diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index c4ac6bc77f70aa..0330e649cdadf8 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -336,7 +336,7 @@ jobs: # no-op if the base branch is already up-to-date. with: token: ${{ secrets.GH_USER_TOKEN }} - branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action. + branch: actions/${{ github.ref_name == 'main' || format('{0}/', github.ref_name) }}tools-update-${{ matrix.id }} # Custom branch *just* for this Action. delete-branch: true commit-message: ${{ env.COMMIT_MSG }} labels: ${{ matrix.label }} diff --git a/.gitignore b/.gitignore index d283bce868da6c..0b8f1a405bda3a 100644 --- a/.gitignore +++ b/.gitignore @@ -160,6 +160,10 @@ cmake_install.cmake install_manifest.txt *.cbp +# === Rules for AI assistants === +CLAUDE.md +AGENTS.md + # === Global Rules === # Keep last to avoid being excluded *.pyc diff --git a/BUILDING.md b/BUILDING.md index 632833c2a66697..f7364e1499febd 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -98,7 +98,7 @@ and libc version. The table below lists the support tier for each supported combination. A list of [supported compile toolchains](#supported-toolchains) is also supplied for tier 1 platforms. -**For production applications, run Node.js on supported platforms only.** +**For production applications, run Node.js on supported platforms only (Tier 1 or 2).** Node.js does not support a platform version if a vendor has expired support for it. In other words, Node.js does not support running on End-of-Life (EoL) @@ -226,12 +226,11 @@ If compiling without one of the above, use `configure` with the ### Previous versions of this document Supported platforms and toolchains change with each major version of Node.js. -This document is only valid for the current major version of Node.js. -Consult previous versions of this document for older versions of Node.js: +This document is only valid for the current version of Node.js, and is expected +to be valid for the entire lifetime of this release line. -* [Node.js 24](https://github.com/nodejs/node/blob/v24.x/BUILDING.md) -* [Node.js 22](https://github.com/nodejs/node/blob/v22.x/BUILDING.md) -* [Node.js 20](https://github.com/nodejs/node/blob/v20.x/BUILDING.md) +To consult the version of this document for another version, download its source +tarball and/or browse the git repository checked out at the relevant tag. ## Building Node.js on supported platforms @@ -753,9 +752,13 @@ Refs: To install it, select the following two optional components: * C++ Clang Compiler for Windows (Microsoft.VisualStudio.Component.VC.Llvm.Clang) * MSBuild support for LLVM (clang-cl) toolset (Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset) -* As an alternative to Visual Studio 2026, download Visual Studio 2022 Current channel Version 17.4 from the +* As an alternative to Visual Studio 2026, download Visual Studio 2022 Current channel Version 17.14 from the [Evergreen bootstrappers](https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#evergreen-bootstrappers) table and install using the same workload and optional component selection as described above. +* To install the Rust toolchain, required for Temporal support introduced in Node.js 26, + ensure Visual Studio is already installed, then run `rustup-init.exe` downloaded from + [Install Rust](https://rust-lang.org/tools/install/), + choosing the default: "Proceed with standard installation". * Basic Unix tools required for some tests, [Git for Windows](https://git-scm.com/download/win) includes Git Bash and tools which can be included in the global `PATH`. @@ -1046,11 +1049,24 @@ enable FIPS support in Node.js. Node.js supports the [Temporal](https://github.com/tc39/proposal-temporal) APIs, when linking statically or dynamically with a version of [temporal\_rs](https://github.com/boa-dev/temporal). -To build Node.js with Temporal support, a Rust toolchain is required: +Temporal support is enabled by default starting in Node.js 26. Building it +requires a Rust toolchain: * rustc >= 1.82 (with LLVM >= 19) * cargo >= 1.82 +If `--v8-enable-temporal-support` and `--v8-disable-temporal-support` are both +omitted, `configure.py` probes for `cargo` and `rustc`. If either is missing, +a warning is printed and Temporal support is disabled. + +* Pass `--v8-enable-temporal-support` to `configure.py` to require Temporal + support. The build will stop with an error if `cargo` or `rustc` cannot be + found. +* Pass `--v8-disable-temporal-support` to opt out of Temporal support and + remove the Rust toolchain requirement. + +Passing both options to `configure.py` is an error. + ## Building Node.js with external core modules It is possible to specify one or more JavaScript text files to be bundled in diff --git a/CHANGELOG.md b/CHANGELOG.md index ae815048c3cfbf..3d7a9c06d1c734 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,12 @@ Select a Node.js version below to view the changelog history: * [Node.js 26](doc/changelogs/CHANGELOG_V26.md) **Current** -* [Node.js 25](doc/changelogs/CHANGELOG_V25.md) **Current** +* [Node.js 25](doc/changelogs/CHANGELOG_V25.md) Current * [Node.js 24](doc/changelogs/CHANGELOG_V24.md) **Long Term Support** * [Node.js 23](doc/changelogs/CHANGELOG_V23.md) End-of-Life * [Node.js 22](doc/changelogs/CHANGELOG_V22.md) Long Term Support * [Node.js 21](doc/changelogs/CHANGELOG_V21.md) End-of-Life -* [Node.js 20](doc/changelogs/CHANGELOG_V20.md) Long Term Support +* [Node.js 20](doc/changelogs/CHANGELOG_V20.md) End-of-Life * [Node.js 19](doc/changelogs/CHANGELOG_V19.md) End-of-Life * [Node.js 18](doc/changelogs/CHANGELOG_V18.md) End-of-Life * [Node.js 17](doc/changelogs/CHANGELOG_V17.md) End-of-Life @@ -39,11 +39,11 @@ release. 25 (Current) 24 (LTS) 22 (LTS) - 20 (LTS) -26.1.0
+26.2.0
+26.1.0
26.0.0
@@ -86,22 +86,20 @@ release. 24.0.0
-23.11.0
-23.10.0
-23.9.0
-23.8.0
-23.7.0
-23.6.1
-23.6.0
-23.5.0
-23.4.0
-23.3.0
-23.2.0
-23.1.0
-23.0.0
- - -22.15.0
+22.22.3
+22.22.2
+22.22.1
+22.22.0
+22.21.1
+22.21.0
+22.20.0
+22.19.0
+22.18.0
+22.17.1
+22.17.0
+22.16.0
+22.15.1
+22.15.0
22.14.0
22.13.1
22.13.0
@@ -121,49 +119,6 @@ release. 22.1.0
22.0.0
- -20.20.2
-20.20.1
-20.20.0
-20.19.6
-20.19.5
-20.19.4
-20.19.3
-20.19.2
-20.19.1
-20.19.0
-20.18.3
-20.18.2
-20.18.1
-20.18.0
-20.17.0
-20.16.0
-20.15.1
-20.15.0
-20.14.0
-20.13.1
-20.13.0
-20.12.2
-20.12.1
-20.12.0
-20.11.1
-20.11.0
-20.10.0
-20.9.0
-20.8.1
-20.8.0
-20.7.0
-20.6.1
-20.6.0
-20.5.1
-20.5.0
-20.4.0
-20.3.1
-20.3.0
-20.2.0
-20.1.0
-20.0.0
- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 54296234a304d8..e22f23543e5ccc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,6 +46,7 @@ dependencies, and tools contained in the `nodejs/node` repository. * [Setting up your local environment](./doc/contributing/pull-requests.md#setting-up-your-local-environment) * [The Process of Making Changes](./doc/contributing/pull-requests.md#the-process-of-making-changes) * [Reviewing Pull Requests](./doc/contributing/pull-requests.md#reviewing-pull-requests) +* [Large Pull Requests](./doc/contributing/large-pull-requests.md) * [Notes](./doc/contributing/pull-requests.md#notes) ## Automation and bots diff --git a/LICENSE b/LICENSE index 2837954aa89579..2842efa1288eef 100644 --- a/LICENSE +++ b/LICENSE @@ -996,208 +996,208 @@ The externally maintained libraries used by Node.js are: - LIEF, located at deps/LIEF, is licensed as follows: """ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 - 2025 R. Thomas - Copyright 2017 - 2025 Quarkslab - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 - 2025 R. Thomas + Copyright 2017 - 2025 Quarkslab + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. """ - llhttp, located at deps/llhttp, is licensed as follows: @@ -1262,8 +1262,7 @@ The externally maintained libraries used by Node.js are: SOFTWARE. """ -- postject, located at test/fixtures/postject-copy and used as a basis for - src/node_sea_bin.cc, is licensed as follows: +- postject, located at test/fixtures/postject-copy, is licensed as follows: """ Postject is licensed for use as follows: diff --git a/Makefile b/Makefile index 9c9aa320963c8e..1e1264619d24bb 100644 --- a/Makefile +++ b/Makefile @@ -603,7 +603,7 @@ test-all-suites: | clear-stalled test-build bench-addons-build doc-only ## Run a $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) test/* JS_SUITES ?= default -NATIVE_SUITES ?= addons js-native-api node-api embedding +NATIVE_SUITES ?= addons ffi js-native-api node-api embedding # CI_* variables should be kept synchronized with the ones in vcbuild.bat CI_NATIVE_SUITES ?= $(NATIVE_SUITES) benchmark CI_JS_SUITES ?= $(JS_SUITES) pummel @@ -1448,7 +1448,7 @@ else LINT_MD_NEWER = -newer tools/.mdlintstamp endif -LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(wildcard *.md) +LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(filter-out CLAUDE.md AGENTS.md,$(wildcard *.md)) LINT_MD_FILES = $(shell $(FIND) $(LINT_MD_TARGETS) -type f \ ! -path '*node_modules*' ! -path 'test/fixtures/*' -name '*.md' \ $(LINT_MD_NEWER)) diff --git a/README.md b/README.md index c137f44f4b7a4e..55f15c5a8045dc 100644 --- a/README.md +++ b/README.md @@ -453,8 +453,6 @@ For information about the governance of the Node.js project, see **Vladimir Morozov** <> (he/him) * [watilde](https://github.com/watilde) - **Daijiro Wachi** <> (he/him) -* [zcbenz](https://github.com/zcbenz) - - **Cheng Zhao** <> (he/him) * [ZYSzys](https://github.com/ZYSzys) - **Yongsheng Zhang** <> (he/him) @@ -733,6 +731,8 @@ For information about the governance of the Node.js project, see **Yorkie Liu** <> * [yosuke-furukawa](https://github.com/yosuke-furukawa) - **Yosuke Furukawa** <> +* [zcbenz](https://github.com/zcbenz) - + **Cheng Zhao** <> (he/him) @@ -745,38 +745,24 @@ maintaining the Node.js project. * [1ilsang](https://github.com/1ilsang) - **Sangchul Lee** <<1ilsang.dev@gmail.com>> (he/him) -* [atlowChemi](https://github.com/atlowChemi) - - **Chemi Atlow** <> (he/him) * [bjohansebas](https://github.com/bjohansebas) - **Sebastian Beltran** <> * [bmuenzenmeyer](https://github.com/bmuenzenmeyer) - **Brian Muenzenmeyer** <> (he/him) -* [CanadaHonk](https://github.com/CanadaHonk) - - **Oliver Medhurst** <> (they/them) -* [daeyeon](https://github.com/daeyeon) - - **Daeyeon Jeong** <> (he/him) * [efekrskl](https://github.com/efekrskl) - **Efe Karasakal** <> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** <> (he/him) -* [gurgunday](https://github.com/gurgunday) - - **Gürgün Dayıoğlu** <> * [haramj](https://github.com/haramj) - **Haram Jeong** <> * [HBSPS](https://github.com/HBSPS) - **Wiyeong Seo** <> * [iam-frankqiu](https://github.com/iam-frankqiu) - **Frank Qiu** <> (he/him) -* [KevinEady](https://github.com/KevinEady) - - **Kevin Eady** <> (he/him) -* [marsonya](https://github.com/marsonya) - - **Akhil Marsonya** <> (he/him) * [milesguicent](https://github.com/milesguicent) - **Miles Guicent** <> (he/him) * [preveen-stack](https://github.com/preveen-stack) - **Preveen Padmanabhan** <> (he/him) -* [RaisinTen](https://github.com/RaisinTen) - - **Darshan Sen** <> (he/him) Triagers follow the [Triage Guide](./doc/contributing/issues.md#triaging-a-bug-report) when responding to new issues. diff --git a/benchmark/crypto/create-keyobject.js b/benchmark/crypto/create-keyobject.js index 30f8213175df69..7cd6db2d567ad6 100644 --- a/benchmark/crypto/create-keyobject.js +++ b/benchmark/crypto/create-keyobject.js @@ -26,6 +26,8 @@ const keyFixtures = { if (hasOpenSSL(3, 5)) { keyFixtures['ml-dsa-44'] = readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private'); +} else if (process.features.openssl_is_boringssl) { + keyFixtures['ml-dsa-44'] = readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private_seed_only'); } const bench = common.createBenchmark(main, { diff --git a/benchmark/crypto/kem.js b/benchmark/crypto/kem.js index ffdcac6d7fcb0d..a544fc2124afe9 100644 --- a/benchmark/crypto/kem.js +++ b/benchmark/crypto/kem.js @@ -24,6 +24,9 @@ if (hasOpenSSL(3, 5)) { keyFixtures['ml-kem-512'] = readKeyPair('ml_kem_512_public', 'ml_kem_512_private'); keyFixtures['ml-kem-768'] = readKeyPair('ml_kem_768_public', 'ml_kem_768_private'); keyFixtures['ml-kem-1024'] = readKeyPair('ml_kem_1024_public', 'ml_kem_1024_private'); +} else if (process.features.openssl_is_boringssl) { + keyFixtures['ml-kem-768'] = readKeyPair('ml_kem_768_public', 'ml_kem_768_private_seed_only'); + keyFixtures['ml-kem-1024'] = readKeyPair('ml_kem_1024_public', 'ml_kem_1024_private_seed_only'); } if (hasOpenSSL(3, 2)) { keyFixtures['p-256'] = readKeyPair('ec_p256_public', 'ec_p256_private'); diff --git a/benchmark/crypto/oneshot-sign.js b/benchmark/crypto/oneshot-sign.js index d0abc7b5412e60..72e3726d9a5349 100644 --- a/benchmark/crypto/oneshot-sign.js +++ b/benchmark/crypto/oneshot-sign.js @@ -19,6 +19,8 @@ const keyFixtures = { if (hasOpenSSL(3, 5)) { keyFixtures['ml-dsa-44'] = readKey('ml_dsa_44_private'); +} else if (process.features.openssl_is_boringssl) { + keyFixtures['ml-dsa-44'] = readKey('ml_dsa_44_private_seed_only'); } const data = crypto.randomBytes(256); diff --git a/benchmark/crypto/oneshot-verify.js b/benchmark/crypto/oneshot-verify.js index c6a24f52126eb2..8b397b02dbf285 100644 --- a/benchmark/crypto/oneshot-verify.js +++ b/benchmark/crypto/oneshot-verify.js @@ -26,6 +26,8 @@ const keyFixtures = { if (hasOpenSSL(3, 5)) { keyFixtures['ml-dsa-44'] = readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private'); +} else if (process.features.openssl_is_boringssl) { + keyFixtures['ml-dsa-44'] = readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private_seed_only'); } const data = crypto.randomBytes(256); diff --git a/benchmark/streams/iter-from-batching.js b/benchmark/streams/iter-from-batching.js new file mode 100644 index 00000000000000..0e09537b9eae11 --- /dev/null +++ b/benchmark/streams/iter-from-batching.js @@ -0,0 +1,100 @@ +// Measures batching behavior for stream/iter from() and fromSync() +// with plain synchronous Uint8Array iterables. +'use strict'; + +const common = require('../common.js'); +const { closeSync, openSync, writeSync, writevSync } = require('fs'); +const { devNull } = require('os'); + +const bench = common.createBenchmark(main, { + method: ['from-first-batch', 'from-sync-writev'], + chunks: [256, 4096, 16384], + chunkSize: [16], + n: [100, 1000], +}, { + flags: ['--experimental-stream-iter'], + combinationFilter({ method, chunks, n }) { + if (n === 1) { + return true; + } + if (method === 'from-first-batch') { + return n === 1000; + } + return n === 100 && chunks !== 16384; + }, + test: { + chunks: 256, + chunkSize: 16, + n: 1, + }, +}); + +function main({ method, chunks, chunkSize, n }) { + switch (method) { + case 'from-first-batch': + return benchFromFirstBatch(chunks, chunkSize, n); + case 'from-sync-writev': + return benchFromSyncWritev(chunks, chunkSize, n); + } +} + +function* source(chunks, chunk) { + for (let i = 0; i < chunks; i++) { + yield chunk; + } +} + +function benchFromFirstBatch(chunks, chunkSize, n) { + const { from } = require('stream/iter'); + const chunk = new Uint8Array(chunkSize); + let seen = 0; + + (async () => { + bench.start(); + for (let i = 0; i < n; i++) { + const iterator = from(source(chunks, chunk))[Symbol.asyncIterator](); + const { value, done } = await iterator.next(); + if (done || value.length === 0) { + throw new Error('expected a batch'); + } + seen += value.length; + } + bench.end(n); + if (seen === 0) { + throw new Error('expected chunks'); + } + })(); +} + +function benchFromSyncWritev(chunks, chunkSize, n) { + const { pipeToSync } = require('stream/iter'); + const chunk = new Uint8Array(chunkSize); + const expected = chunks * chunkSize * n; + let seen = 0; + let total = 0; + const fd = openSync(devNull, 'w'); + const writer = { + writeSync(chunk) { + writeSync(fd, chunk); + seen++; + }, + writevSync(batch) { + writevSync(fd, batch); + seen += batch.length; + }, + }; + + try { + bench.start(); + for (let i = 0; i < n; i++) { + total += pipeToSync(source(chunks, chunk), writer); + } + bench.end(chunks * n); + } finally { + closeSync(fd); + } + + if (total !== expected || seen !== chunks * n) { + throw new Error('unexpected chunk count'); + } +} diff --git a/benchmark/streams/iter-throughput-broadcast.js b/benchmark/streams/iter-throughput-broadcast.js index 459d78e7c75f25..c5bbac9306777e 100644 --- a/benchmark/streams/iter-throughput-broadcast.js +++ b/benchmark/streams/iter-throughput-broadcast.js @@ -128,9 +128,11 @@ function benchIter(chunk, numConsumers, datasize, n, totalOps) { let remaining = datasize; while (remaining > 0) { const size = Math.min(remaining, chunk.length); - remaining -= size; const buf = size === chunk.length ? chunk : chunk.subarray(0, size); - writer.writeSync(buf); + if (!writer.writeSync(buf)) { + await writer.write(buf); + } + remaining -= size; } writer.endSync(); diff --git a/benchmark/streams/iter-throughput-pipeto.js b/benchmark/streams/iter-throughput-pipeto.js index 117a78aead1088..819d5e22a8a272 100644 --- a/benchmark/streams/iter-throughput-pipeto.js +++ b/benchmark/streams/iter-throughput-pipeto.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const { Readable, Writable, pipeline } = require('stream'); const bench = common.createBenchmark(main, { - api: ['classic', 'webstream', 'iter', 'iter-sync'], + api: ['classic', 'webstream', 'iter', 'iter-sync-source', 'iter-sync'], datasize: [1024 * 1024, 16 * 1024 * 1024, 64 * 1024 * 1024], n: [5], }, { @@ -26,6 +26,8 @@ function main({ api, datasize, n }) { return benchWebStream(chunk, datasize, n, totalOps); case 'iter': return benchIter(chunk, datasize, n, totalOps); + case 'iter-sync-source': + return benchIterSyncSource(chunk, datasize, n, totalOps); case 'iter-sync': return benchIterSync(chunk, datasize, n, totalOps); } @@ -101,6 +103,29 @@ function benchIter(chunk, datasize, n, totalOps) { })(); } +function benchIterSyncSource(chunk, datasize, n, totalOps) { + const { pipeTo } = require('stream/iter'); + + async function run() { + let remaining = datasize; + function* source() { + while (remaining > 0) { + const size = Math.min(remaining, chunk.length); + remaining -= size; + yield size === chunk.length ? chunk : chunk.subarray(0, size); + } + } + const writer = { write() {}, writeSync() { return true; } }; + await pipeTo(source(), writer); + } + + (async () => { + bench.start(); + for (let i = 0; i < n; i++) await run(); + bench.end(totalOps); + })(); +} + function benchIterSync(chunk, datasize, n, totalOps) { const { pipeToSync } = require('stream/iter'); diff --git a/benchmark/streams/iter-throughput-share.js b/benchmark/streams/iter-throughput-share.js new file mode 100644 index 00000000000000..a0383172c04140 --- /dev/null +++ b/benchmark/streams/iter-throughput-share.js @@ -0,0 +1,32 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + consumers: [2, 8, 32], + batches: [1e4], + backpressure: ['block'], + n: [5], +}, { + flags: ['--experimental-stream-iter'], +}); + +async function main({ consumers, batches, backpressure, n }) { + const { share, array } = require('stream/iter'); + const chunk = Buffer.alloc(1024); + const totalOps = batches * consumers * n; + + async function* source() { + for (let i = 0; i < batches; i++) { + yield [chunk]; + } + } + + bench.start(); + for (let i = 0; i < n; i++) { + const shared = share(source(), { highWaterMark: 64, backpressure }); + const readers = Array.from({ length: consumers }, () => array(shared.pull())); + await Promise.all(readers); + } + bench.end(totalOps); +} diff --git a/common.gypi b/common.gypi index dbd6bf9df814f8..c0a3d785a3dab3 100644 --- a/common.gypi +++ b/common.gypi @@ -40,7 +40,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.19', + 'v8_embedder_string': '-node.20', ##### V8 defaults for Node.js ##### diff --git a/configure.py b/configure.py index 7b82e0c5e86e7d..eea76312119385 100755 --- a/configure.py +++ b/configure.py @@ -2310,17 +2310,20 @@ def without_sqlite_error(option): configure_library('sqlite', o, pkgname='sqlite3') def bundled_ffi_supported(os_name, target_arch): - supported = { - 'freebsd': {'arm', 'arm64', 'x64'}, - 'linux': {'arm', 'arm64', 'x64'}, - 'mac': {'arm64', 'x64'}, - 'win': {'arm64', 'x64'}, - } - if target_arch == 'x86': target_arch = 'ia32' - return target_arch in supported.get(os_name, set()) + if target_arch in {'arm', 'arm64', 'ia32', 'x64', 'x86_64', + 'riscv64', 'loong64'}: + return True + + if target_arch in {'mips', 'mipsel', 'mips64el'}: + return os_name in {'freebsd', 'linux', 'openbsd'} + + if target_arch == 'ppc64': + return os_name in {'aix', 'freebsd', 'linux', 'mac', 'openbsd'} + + return False def configure_ffi(o): use_ffi = not options.without_ffi diff --git a/deps/corepack/CHANGELOG.md b/deps/corepack/CHANGELOG.md index 16553bd776ffa4..be8dfa5c8cb8df 100644 --- a/deps/corepack/CHANGELOG.md +++ b/deps/corepack/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [0.35.0](https://github.com/nodejs/corepack/compare/v0.34.7...v0.35.0) (2026-05-15) + + +### ⚠ BREAKING CHANGES + +* Drop support for Node.js 20 and Node.js 25. +* Switching to Node.js built-in proxy support, meaning that proxy support is now + gated by having `NODE_USE_ENV_PROXY` set as an environment variable. + +### Features + +* update package manager versions ([#820](https://github.com/nodejs/corepack/issues/820)) ([fdbd751](https://github.com/nodejs/corepack/commit/fdbd751d9851a50730925de053e9722963c2e135)) + + +### Bug Fixes + +* target node 22.22.2 in esbuild ([#845](https://github.com/nodejs/corepack/issues/845)) ([0f01502](https://github.com/nodejs/corepack/commit/0f01502fd8832649a573bc68e1851128f547646d)) + + +### Miscellaneous Chores + +* **deps:** bump engine support matrix ([88c602a](https://github.com/nodejs/corepack/commit/88c602a6ea3f75bf30dc1d071bdb488fae2c8276)) +* **deps:** drop Undici and `proxy-from-env` ([8167b0d](https://github.com/nodejs/corepack/commit/8167b0d65acc091af464ead019f7485cb512082f)) + ## [0.34.7](https://github.com/nodejs/corepack/compare/v0.34.6...v0.34.7) (2026-04-17) diff --git a/deps/corepack/README.md b/deps/corepack/README.md index 1920174797a5dc..dd32b4ad09f139 100644 --- a/deps/corepack/README.md +++ b/deps/corepack/README.md @@ -328,8 +328,6 @@ same major line. Should you need to upgrade to a new major, use an explicit Only keys that start with `COREPACK_` and are not in the exception list (`COREPACK_ENABLE_DOWNLOAD_PROMPT` and `COREPACK_ENV_FILE` are ignored) will be taken into account. - For Node.js 18.x users, this setting has no effect as that version doesn't - support parsing of `.env` files. - `COREPACK_HOME` can be set in order to define where Corepack should install the package managers. By default it is set to `%LOCALAPPDATA%\node\corepack` @@ -352,7 +350,7 @@ same major line. Should you need to upgrade to a new major, use an explicit empty password, explicitly set `COREPACK_NPM_PASSWORD` to an empty string. - `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are supported through - [`proxy-from-env`](https://github.com/Rob--W/proxy-from-env). + [`NODE_USE_ENV_PROXY=1`](https://nodejs.org/api/cli.html#node_use_env_proxy1). - `COREPACK_INTEGRITY_KEYS` can be set to an empty string or `0` to instruct Corepack to skip integrity checks, or to a JSON string containing diff --git a/deps/corepack/dist/lib/corepack.cjs b/deps/corepack/dist/lib/corepack.cjs index 232645cab47b0c..478389c3e2d04e 100644 --- a/deps/corepack/dist/lib/corepack.cjs +++ b/deps/corepack/dist/lib/corepack.cjs @@ -33,7 +33,248 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// .yarn/cache/typanion-npm-3.14.0-8af344c436-8b03b19844.zip/node_modules/typanion/lib/index.mjs +// node_modules/clipanion/lib/constants.js +var require_constants = __commonJS({ + "node_modules/clipanion/lib/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var NODE_INITIAL = 0; + var NODE_SUCCESS = 1; + var NODE_ERRORED = 2; + var START_OF_INPUT = ``; + var END_OF_INPUT = `\0`; + var HELP_COMMAND_INDEX = -1; + var HELP_REGEX = /^(-h|--help)(?:=([0-9]+))?$/; + var OPTION_REGEX = /^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/; + var BATCH_REGEX = /^-[a-zA-Z]{2,}$/; + var BINDING_REGEX = /^([^=]+)=([\s\S]*)$/; + var DEBUG = process.env.DEBUG_CLI === `1`; + exports2.BATCH_REGEX = BATCH_REGEX; + exports2.BINDING_REGEX = BINDING_REGEX; + exports2.DEBUG = DEBUG; + exports2.END_OF_INPUT = END_OF_INPUT; + exports2.HELP_COMMAND_INDEX = HELP_COMMAND_INDEX; + exports2.HELP_REGEX = HELP_REGEX; + exports2.NODE_ERRORED = NODE_ERRORED; + exports2.NODE_INITIAL = NODE_INITIAL; + exports2.NODE_SUCCESS = NODE_SUCCESS; + exports2.OPTION_REGEX = OPTION_REGEX; + exports2.START_OF_INPUT = START_OF_INPUT; + } +}); + +// node_modules/clipanion/lib/errors.js +var require_errors = __commonJS({ + "node_modules/clipanion/lib/errors.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var constants2 = require_constants(); + var UsageError16 = class extends Error { + constructor(message) { + super(message); + this.clipanion = { type: `usage` }; + this.name = `UsageError`; + } + }; + var UnknownSyntaxError = class extends Error { + constructor(input, candidates) { + super(); + this.input = input; + this.candidates = candidates; + this.clipanion = { type: `none` }; + this.name = `UnknownSyntaxError`; + if (this.candidates.length === 0) { + this.message = `Command not found, but we're not sure what's the alternative.`; + } else if (this.candidates.every((candidate) => candidate.reason !== null && candidate.reason === candidates[0].reason)) { + const [{ reason }] = this.candidates; + this.message = `${reason} + +${this.candidates.map(({ usage }) => `$ ${usage}`).join(` +`)}`; + } else if (this.candidates.length === 1) { + const [{ usage }] = this.candidates; + this.message = `Command not found; did you mean: + +$ ${usage} +${whileRunning(input)}`; + } else { + this.message = `Command not found; did you mean one of: + +${this.candidates.map(({ usage }, index) => { + return `${`${index}.`.padStart(4)} ${usage}`; + }).join(` +`)} + +${whileRunning(input)}`; + } + } + }; + var AmbiguousSyntaxError = class extends Error { + constructor(input, usages) { + super(); + this.input = input; + this.usages = usages; + this.clipanion = { type: `none` }; + this.name = `AmbiguousSyntaxError`; + this.message = `Cannot find which to pick amongst the following alternatives: + +${this.usages.map((usage, index) => { + return `${`${index}.`.padStart(4)} ${usage}`; + }).join(` +`)} + +${whileRunning(input)}`; + } + }; + var whileRunning = (input) => `While running ${input.filter((token) => { + return token !== constants2.END_OF_INPUT; + }).map((token) => { + const json = JSON.stringify(token); + if (token.match(/\s/) || token.length === 0 || json !== `"${token}"`) { + return json; + } else { + return token; + } + }).join(` `)}`; + exports2.AmbiguousSyntaxError = AmbiguousSyntaxError; + exports2.UnknownSyntaxError = UnknownSyntaxError; + exports2.UsageError = UsageError16; + } +}); + +// node_modules/clipanion/lib/format.js +var require_format = __commonJS({ + "node_modules/clipanion/lib/format.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var MAX_LINE_LENGTH = 80; + var richLine = Array(MAX_LINE_LENGTH).fill(`\u2501`); + for (let t = 0; t <= 24; ++t) + richLine[richLine.length - t] = `\x1B[38;5;${232 + t}m\u2501`; + var richFormat = { + header: (str) => `\x1B[1m\u2501\u2501\u2501 ${str}${str.length < MAX_LINE_LENGTH - 5 ? ` ${richLine.slice(str.length + 5).join(``)}` : `:`}\x1B[0m`, + bold: (str) => `\x1B[1m${str}\x1B[22m`, + error: (str) => `\x1B[31m\x1B[1m${str}\x1B[22m\x1B[39m`, + code: (str) => `\x1B[36m${str}\x1B[39m` + }; + var textFormat = { + header: (str) => str, + bold: (str) => str, + error: (str) => str, + code: (str) => str + }; + function dedent(text) { + const lines = text.split(` +`); + const nonEmptyLines = lines.filter((line) => line.match(/\S/)); + const indent = nonEmptyLines.length > 0 ? nonEmptyLines.reduce((minLength, line) => Math.min(minLength, line.length - line.trimStart().length), Number.MAX_VALUE) : 0; + return lines.map((line) => line.slice(indent).trimRight()).join(` +`); + } + function formatMarkdownish(text, { format, paragraphs }) { + text = text.replace(/\r\n?/g, ` +`); + text = dedent(text); + text = text.replace(/^\n+|\n+$/g, ``); + text = text.replace(/^(\s*)-([^\n]*?)\n+/gm, `$1-$2 + +`); + text = text.replace(/\n(\n)?\n*/g, ($0, $1) => $1 ? $1 : ` `); + if (paragraphs) { + text = text.split(/\n/).map((paragraph) => { + const bulletMatch = paragraph.match(/^\s*[*-][\t ]+(.*)/); + if (!bulletMatch) + return paragraph.match(/(.{1,80})(?: |$)/g).join(` +`); + const indent = paragraph.length - paragraph.trimStart().length; + return bulletMatch[1].match(new RegExp(`(.{1,${78 - indent}})(?: |$)`, `g`)).map((line, index) => { + return ` `.repeat(indent) + (index === 0 ? `- ` : ` `) + line; + }).join(` +`); + }).join(` + +`); + } + text = text.replace(/(`+)((?:.|[\n])*?)\1/g, ($0, $1, $2) => { + return format.code($1 + $2 + $1); + }); + text = text.replace(/(\*\*)((?:.|[\n])*?)\1/g, ($0, $1, $2) => { + return format.bold($1 + $2 + $1); + }); + return text ? `${text} +` : ``; + } + exports2.formatMarkdownish = formatMarkdownish; + exports2.richFormat = richFormat; + exports2.textFormat = textFormat; + } +}); + +// node_modules/clipanion/lib/advanced/options/utils.js +var require_utils = __commonJS({ + "node_modules/clipanion/lib/advanced/options/utils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var errors = require_errors(); + var isOptionSymbol = /* @__PURE__ */ Symbol(`clipanion/isOption`); + function makeCommandOption(spec) { + return { ...spec, [isOptionSymbol]: true }; + } + function rerouteArguments(a, b) { + if (typeof a === `undefined`) + return [a, b]; + if (typeof a === `object` && a !== null && !Array.isArray(a)) { + return [void 0, a]; + } else { + return [a, b]; + } + } + function cleanValidationError(message, { mergeName = false } = {}) { + const match = message.match(/^([^:]+): (.*)$/m); + if (!match) + return `validation failed`; + let [, path16, line] = match; + if (mergeName) + line = line[0].toLowerCase() + line.slice(1); + line = path16 !== `.` || !mergeName ? `${path16.replace(/^\.(\[|$)/, `$1`)}: ${line}` : `: ${line}`; + return line; + } + function formatError(message, errors$1) { + if (errors$1.length === 1) { + return new errors.UsageError(`${message}${cleanValidationError(errors$1[0], { mergeName: true })}`); + } else { + return new errors.UsageError(`${message}: +${errors$1.map((error) => ` +- ${cleanValidationError(error)}`).join(``)}`); + } + } + function applyValidator(name2, value, validator) { + if (typeof validator === `undefined`) + return value; + const errors2 = []; + const coercions = []; + const coercion = (v) => { + const orig = value; + value = v; + return coercion.bind(null, orig); + }; + const check = validator(value, { errors: errors2, coercions, coercion }); + if (!check) + throw formatError(`Invalid value for ${name2}`, errors2); + for (const [, op] of coercions) + op(); + return value; + } + exports2.applyValidator = applyValidator; + exports2.cleanValidationError = cleanValidationError; + exports2.formatError = formatError; + exports2.isOptionSymbol = isOptionSymbol; + exports2.makeCommandOption = makeCommandOption; + exports2.rerouteArguments = rerouteArguments; + } +}); + +// node_modules/typanion/lib/index.mjs var lib_exports = {}; __export(lib_exports, { KeyRelationship: () => KeyRelationship, @@ -946,7 +1187,7 @@ function hasKeyRelationship(subject, relationship, others, options) { } var simpleKeyRegExp, colorStringRegExp, colorStringAlphaRegExp, base64RegExp, uuid4RegExp, iso8601RegExp, BOOLEAN_COERCIONS, isInstanceOf, isOneOf, TypeAssertionError, checks, KeyRelationship, keyRelationships; var init_lib = __esm({ - ".yarn/cache/typanion-npm-3.14.0-8af344c436-8b03b19844.zip/node_modules/typanion/lib/index.mjs"() { + "node_modules/typanion/lib/index.mjs"() { simpleKeyRegExp = /^[a-zA-Z_][a-zA-Z0-9_]*$/; colorStringRegExp = /^#[0-9a-f]{6}$/i; colorStringAlphaRegExp = /^#[0-9a-f]{6}([0-9a-f]{2})?$/i; @@ -1037,18060 +1278,9840 @@ var init_lib = __esm({ } }); -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/platform/node.js -var require_node = __commonJS({ - ".yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/platform/node.js"(exports2) { +// node_modules/clipanion/lib/advanced/Command.js +var require_Command = __commonJS({ + "node_modules/clipanion/lib/advanced/Command.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var tty2 = require("tty"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var tty__default = /* @__PURE__ */ _interopDefaultLegacy(tty2); - function getDefaultColorDepth2() { - if (tty__default["default"] && `getColorDepth` in tty__default["default"].WriteStream.prototype) - return tty__default["default"].WriteStream.prototype.getColorDepth(); - if (process.env.FORCE_COLOR === `0`) - return 1; - if (process.env.FORCE_COLOR === `1`) - return 8; - if (typeof process.stdout !== `undefined` && process.stdout.isTTY) - return 8; - return 1; - } - var gContextStorage; - function getCaptureActivator2(context) { - let contextStorage = gContextStorage; - if (typeof contextStorage === `undefined`) { - if (context.stdout === process.stdout && context.stderr === process.stderr) - return null; - const { AsyncLocalStorage: LazyAsyncLocalStorage } = require("async_hooks"); - contextStorage = gContextStorage = new LazyAsyncLocalStorage(); - const origStdoutWrite = process.stdout._write; - process.stdout._write = function(chunk, encoding, cb) { - const context2 = contextStorage.getStore(); - if (typeof context2 === `undefined`) - return origStdoutWrite.call(this, chunk, encoding, cb); - return context2.stdout.write(chunk, encoding, cb); - }; - const origStderrWrite = process.stderr._write; - process.stderr._write = function(chunk, encoding, cb) { - const context2 = contextStorage.getStore(); - if (typeof context2 === `undefined`) - return origStderrWrite.call(this, chunk, encoding, cb); - return context2.stderr.write(chunk, encoding, cb); - }; + var advanced_options_utils = require_utils(); + function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = /* @__PURE__ */ Object.create(null); + if (e) { + Object.keys(e).forEach(function(k) { + if (k !== "default") { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function() { + return e[k]; + } + }); + } + }); } - return (fn2) => { - return contextStorage.run(context, fn2); - }; + n["default"] = e; + return Object.freeze(n); } - exports2.getCaptureActivator = getCaptureActivator2; - exports2.getDefaultColorDepth = getDefaultColorDepth2; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/debug.js -var require_debug = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/debug.js"(exports2, module2) { - "use strict"; - var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug2; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/constants.js -var require_constants = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/constants.js"(exports2, module2) { - "use strict"; - var SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var RELEASE_TYPES = [ - "major", - "premajor", - "minor", - "preminor", - "patch", - "prepatch", - "prerelease" - ]; - module2.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 1, - FLAG_LOOSE: 2 - }; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/re.js -var require_re = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/re.js"(exports2, module2) { - "use strict"; - var { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH - } = require_constants(); - var debug2 = require_debug(); - exports2 = module2.exports = {}; - var re = exports2.re = []; - var safeRe = exports2.safeRe = []; - var src = exports2.src = []; - var safeSrc = exports2.safeSrc = []; - var t = exports2.t = {}; - var R = 0; - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - var makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); - } - return value; - }; - var createToken = (name2, value, isGlobal) => { - const safe = makeSafeRegex(value); - const index = R++; - debug2(name2, index, value); - t[name2] = index; - src[index] = value; - safeSrc[index] = safe; - re[index] = new RegExp(value, isGlobal ? "g" : void 0); - safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); - }; - createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); - createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); - createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); - createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); - createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); - createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); - createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); - createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); - createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); - createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); - createToken("FULL", `^${src[t.FULLPLAIN]}$`); - createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); - createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); - createToken("GTLT", "((?:<|>)?=?)"); - createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); - createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); - createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); - createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); - createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); - createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); - createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); - createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); - createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); - createToken("COERCERTL", src[t.COERCE], true); - createToken("COERCERTLFULL", src[t.COERCEFULL], true); - createToken("LONETILDE", "(?:~>?)"); - createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); - exports2.tildeTrimReplace = "$1~"; - createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); - createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); - createToken("LONECARET", "(?:\\^)"); - createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); - exports2.caretTrimReplace = "$1^"; - createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); - createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); - createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); - createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); - createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); - exports2.comparatorTrimReplace = "$1$2$3"; - createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); - createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); - createToken("STAR", "(<|>)?=?\\s*\\*"); - createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); - createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/parse-options.js -var require_parse_options = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/parse-options.js"(exports2, module2) { - "use strict"; - var looseOption = Object.freeze({ loose: true }); - var emptyOpts = Object.freeze({}); - var parseOptions = (options) => { - if (!options) { - return emptyOpts; + var Command12 = class { + constructor() { + this.help = false; } - if (typeof options !== "object") { - return looseOption; + /** + * Defines the usage information for the given command. + */ + static Usage(usage) { + return usage; } - return options; - }; - module2.exports = parseOptions; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/identifiers.js -var require_identifiers = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/identifiers.js"(exports2, module2) { - "use strict"; - var numeric = /^[0-9]+$/; - var compareIdentifiers = (a, b) => { - if (typeof a === "number" && typeof b === "number") { - return a === b ? 0 : a < b ? -1 : 1; + /** + * Standard error handler which will simply rethrow the error. Can be used + * to add custom logic to handle errors from the command or simply return + * the parent class error handling. + */ + async catch(error) { + throw error; } - const anum = numeric.test(a); - const bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + async validateAndExecute() { + const commandClass = this.constructor; + const cascade2 = commandClass.schema; + if (Array.isArray(cascade2)) { + const { isDict: isDict2, isUnknown: isUnknown2, applyCascade: applyCascade2 } = await Promise.resolve().then(function() { + return /* @__PURE__ */ _interopNamespace((init_lib(), __toCommonJS(lib_exports))); + }); + const schema = applyCascade2(isDict2(isUnknown2()), cascade2); + const errors = []; + const coercions = []; + const check = schema(this, { errors, coercions }); + if (!check) + throw advanced_options_utils.formatError(`Invalid option schema`, errors); + for (const [, op] of coercions) { + op(); + } + } else if (cascade2 != null) { + throw new Error(`Invalid command schema`); + } + const exitCode = await this.execute(); + if (typeof exitCode !== `undefined`) { + return exitCode; + } else { + return 0; + } } - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; - }; - var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); - module2.exports = { - compareIdentifiers, - rcompareIdentifiers }; + Command12.isOption = advanced_options_utils.isOptionSymbol; + Command12.Default = []; + exports2.Command = Command12; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/semver.js -var require_semver = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/semver.js"(exports2, module2) { +// node_modules/clipanion/lib/core.js +var require_core = __commonJS({ + "node_modules/clipanion/lib/core.js"(exports2) { "use strict"; - var debug2 = require_debug(); - var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(); - var { safeRe: re, t } = require_re(); - var parseOptions = require_parse_options(); - var { compareIdentifiers } = require_identifiers(); - var SemVer3 = class _SemVer { - constructor(version2, options) { - options = parseOptions(options); - if (version2 instanceof _SemVer) { - if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) { - return version2; - } else { - version2 = version2.version; + Object.defineProperty(exports2, "__esModule", { value: true }); + var constants2 = require_constants(); + var errors = require_errors(); + function debug(str) { + if (constants2.DEBUG) { + console.log(str); + } + } + var basicHelpState = { + candidateUsage: null, + requiredOptions: [], + errorMessage: null, + ignoreOptions: false, + path: [], + positionals: [], + options: [], + remainder: null, + selectedIndex: constants2.HELP_COMMAND_INDEX + }; + function makeStateMachine() { + return { + nodes: [makeNode(), makeNode(), makeNode()] + }; + } + function makeAnyOfMachine(inputs) { + const output = makeStateMachine(); + const heads = []; + let offset = output.nodes.length; + for (const input of inputs) { + heads.push(offset); + for (let t = 0; t < input.nodes.length; ++t) + if (!isTerminalNode(t)) + output.nodes.push(cloneNode(input.nodes[t], offset)); + offset += input.nodes.length - 2; + } + for (const head of heads) + registerShortcut(output, constants2.NODE_INITIAL, head); + return output; + } + function injectNode(machine, node) { + machine.nodes.push(node); + return machine.nodes.length - 1; + } + function simplifyMachine(input) { + const visited = /* @__PURE__ */ new Set(); + const process5 = (node) => { + if (visited.has(node)) + return; + visited.add(node); + const nodeDef = input.nodes[node]; + for (const transitions of Object.values(nodeDef.statics)) + for (const { to } of transitions) + process5(to); + for (const [, { to }] of nodeDef.dynamics) + process5(to); + for (const { to } of nodeDef.shortcuts) + process5(to); + const shortcuts = new Set(nodeDef.shortcuts.map(({ to }) => to)); + while (nodeDef.shortcuts.length > 0) { + const { to } = nodeDef.shortcuts.shift(); + const toDef = input.nodes[to]; + for (const [segment, transitions] of Object.entries(toDef.statics)) { + const store = !Object.prototype.hasOwnProperty.call(nodeDef.statics, segment) ? nodeDef.statics[segment] = [] : nodeDef.statics[segment]; + for (const transition of transitions) { + if (!store.some(({ to: to2 }) => transition.to === to2)) { + store.push(transition); + } + } + } + for (const [test, transition] of toDef.dynamics) + if (!nodeDef.dynamics.some(([otherTest, { to: to2 }]) => test === otherTest && transition.to === to2)) + nodeDef.dynamics.push([test, transition]); + for (const transition of toDef.shortcuts) { + if (!shortcuts.has(transition.to)) { + nodeDef.shortcuts.push(transition); + shortcuts.add(transition.to); + } } - } else if (typeof version2 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`); - } - if (version2.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ); - } - debug2("SemVer", version2, options); - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); - if (!m) { - throw new TypeError(`Invalid Version: ${version2}`); } - this.raw = version2; - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); + }; + process5(constants2.NODE_INITIAL); + } + function debugMachine(machine, { prefix = `` } = {}) { + if (constants2.DEBUG) { + debug(`${prefix}Nodes are:`); + for (let t = 0; t < machine.nodes.length; ++t) { + debug(`${prefix} ${t}: ${JSON.stringify(machine.nodes[t])}`); + } + } + } + function runMachineInternal(machine, input, partial = false) { + debug(`Running a vm on ${JSON.stringify(input)}`); + let branches = [{ node: constants2.NODE_INITIAL, state: { + candidateUsage: null, + requiredOptions: [], + errorMessage: null, + ignoreOptions: false, + options: [], + path: [], + positionals: [], + remainder: null, + selectedIndex: null + } }]; + debugMachine(machine, { prefix: ` ` }); + const tokens = [constants2.START_OF_INPUT, ...input]; + for (let t = 0; t < tokens.length; ++t) { + const segment = tokens[t]; + debug(` Processing ${JSON.stringify(segment)}`); + const nextBranches = []; + for (const { node, state } of branches) { + debug(` Current node is ${node}`); + const nodeDef = machine.nodes[node]; + if (node === constants2.NODE_ERRORED) { + nextBranches.push({ node, state }); + continue; + } + console.assert(nodeDef.shortcuts.length === 0, `Shortcuts should have been eliminated by now`); + const hasExactMatch = Object.prototype.hasOwnProperty.call(nodeDef.statics, segment); + if (!partial || t < tokens.length - 1 || hasExactMatch) { + if (hasExactMatch) { + const transitions = nodeDef.statics[segment]; + for (const { to, reducer } of transitions) { + nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); + debug(` Static transition to ${to} found`); + } + } else { + debug(` No static transition found`); + } + } else { + let hasMatches = false; + for (const candidate of Object.keys(nodeDef.statics)) { + if (!candidate.startsWith(segment)) + continue; + if (segment === candidate) { + for (const { to, reducer } of nodeDef.statics[candidate]) { + nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); + debug(` Static transition to ${to} found`); + } + } else { + for (const { to } of nodeDef.statics[candidate]) { + nextBranches.push({ node: to, state: { ...state, remainder: candidate.slice(segment.length) } }); + debug(` Static transition to ${to} found (partial match)`); + } + } + hasMatches = true; + } + if (!hasMatches) { + debug(` No partial static transition found`); + } + } + if (segment !== constants2.END_OF_INPUT) { + for (const [test, { to, reducer }] of nodeDef.dynamics) { + if (execute(tests, test, state, segment)) { + nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); + debug(` Dynamic transition to ${to} found (via ${test})`); + } + } + } } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + if (nextBranches.length === 0 && segment === constants2.END_OF_INPUT && input.length === 1) { + return [{ + node: constants2.NODE_INITIAL, + state: basicHelpState + }]; } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + if (nextBranches.length === 0) { + throw new errors.UnknownSyntaxError(input, branches.filter(({ node }) => { + return node !== constants2.NODE_ERRORED; + }).map(({ state }) => { + return { usage: state.candidateUsage, reason: null }; + })); } - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - return id; - }); + if (nextBranches.every(({ node }) => node === constants2.NODE_ERRORED)) { + throw new errors.UnknownSyntaxError(input, nextBranches.map(({ state }) => { + return { usage: state.candidateUsage, reason: state.errorMessage }; + })); } - this.build = m[5] ? m[5].split(".") : []; - this.format(); + branches = trimSmallerBranches(nextBranches); } - format() { - this.version = `${this.major}.${this.minor}.${this.patch}`; - if (this.prerelease.length) { - this.version += `-${this.prerelease.join(".")}`; + if (branches.length > 0) { + debug(` Results:`); + for (const branch of branches) { + debug(` - ${branch.node} -> ${JSON.stringify(branch.state)}`); } - return this.version; + } else { + debug(` No results`); } - toString() { - return this.version; + return branches; + } + function checkIfNodeIsFinished(node, state) { + if (state.selectedIndex !== null) + return true; + if (Object.prototype.hasOwnProperty.call(node.statics, constants2.END_OF_INPUT)) { + for (const { to } of node.statics[constants2.END_OF_INPUT]) + if (to === constants2.NODE_SUCCESS) + return true; } - compare(other) { - debug2("SemVer.compare", this.version, this.options, other); - if (!(other instanceof _SemVer)) { - if (typeof other === "string" && other === this.version) { - return 0; + return false; + } + function suggestMachine(machine, input, partial) { + const prefix = partial && input.length > 0 ? [``] : []; + const branches = runMachineInternal(machine, input, partial); + const suggestions = []; + const suggestionsJson = /* @__PURE__ */ new Set(); + const traverseSuggestion = (suggestion, node, skipFirst = true) => { + let nextNodes = [node]; + while (nextNodes.length > 0) { + const currentNodes = nextNodes; + nextNodes = []; + for (const node2 of currentNodes) { + const nodeDef = machine.nodes[node2]; + const keys = Object.keys(nodeDef.statics); + for (const key of Object.keys(nodeDef.statics)) { + const segment = keys[0]; + for (const { to, reducer } of nodeDef.statics[segment]) { + if (reducer !== `pushPath`) + continue; + if (!skipFirst) + suggestion.push(segment); + nextNodes.push(to); + } + } } - other = new _SemVer(other, this.options); - } - if (other.version === this.version) { - return 0; - } - return this.compareMain(other) || this.comparePre(other); - } - compareMain(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - if (this.major < other.major) { - return -1; - } - if (this.major > other.major) { - return 1; - } - if (this.minor < other.minor) { - return -1; + skipFirst = false; } - if (this.minor > other.minor) { - return 1; + const json = JSON.stringify(suggestion); + if (suggestionsJson.has(json)) + return; + suggestions.push(suggestion); + suggestionsJson.add(json); + }; + for (const { node, state } of branches) { + if (state.remainder !== null) { + traverseSuggestion([state.remainder], node); + continue; } - if (this.patch < other.patch) { - return -1; + const nodeDef = machine.nodes[node]; + const isFinished = checkIfNodeIsFinished(nodeDef, state); + for (const [candidate, transitions] of Object.entries(nodeDef.statics)) + if (isFinished && candidate !== constants2.END_OF_INPUT || !candidate.startsWith(`-`) && transitions.some(({ reducer }) => reducer === `pushPath`)) + traverseSuggestion([...prefix, candidate], node); + if (!isFinished) + continue; + for (const [test, { to }] of nodeDef.dynamics) { + if (to === constants2.NODE_ERRORED) + continue; + const tokens = suggest(test, state); + if (tokens === null) + continue; + for (const token of tokens) { + traverseSuggestion([...prefix, token], node); + } } - if (this.patch > other.patch) { - return 1; + } + return [...suggestions].sort(); + } + function runMachine(machine, input) { + const branches = runMachineInternal(machine, [...input, constants2.END_OF_INPUT]); + return selectBestState(input, branches.map(({ state }) => { + return state; + })); + } + function trimSmallerBranches(branches) { + let maxPathSize = 0; + for (const { state } of branches) + if (state.path.length > maxPathSize) + maxPathSize = state.path.length; + return branches.filter(({ state }) => { + return state.path.length === maxPathSize; + }); + } + function selectBestState(input, states) { + const terminalStates = states.filter((state) => { + return state.selectedIndex !== null; + }); + if (terminalStates.length === 0) + throw new Error(); + const requiredOptionsSetStates = terminalStates.filter((state) => state.selectedIndex === constants2.HELP_COMMAND_INDEX || state.requiredOptions.every((names) => names.some((name2) => state.options.find((opt) => opt.name === name2)))); + if (requiredOptionsSetStates.length === 0) { + throw new errors.UnknownSyntaxError(input, terminalStates.map((state) => ({ + usage: state.candidateUsage, + reason: null + }))); + } + let maxPathSize = 0; + for (const state of requiredOptionsSetStates) + if (state.path.length > maxPathSize) + maxPathSize = state.path.length; + const bestPathBranches = requiredOptionsSetStates.filter((state) => { + return state.path.length === maxPathSize; + }); + const getPositionalCount = (state) => state.positionals.filter(({ extra }) => { + return !extra; + }).length + state.options.length; + const statesWithPositionalCount = bestPathBranches.map((state) => { + return { state, positionalCount: getPositionalCount(state) }; + }); + let maxPositionalCount = 0; + for (const { positionalCount } of statesWithPositionalCount) + if (positionalCount > maxPositionalCount) + maxPositionalCount = positionalCount; + const bestPositionalStates = statesWithPositionalCount.filter(({ positionalCount }) => { + return positionalCount === maxPositionalCount; + }).map(({ state }) => { + return state; + }); + const fixedStates = aggregateHelpStates(bestPositionalStates); + if (fixedStates.length > 1) + throw new errors.AmbiguousSyntaxError(input, fixedStates.map((state) => state.candidateUsage)); + return fixedStates[0]; + } + function aggregateHelpStates(states) { + const notHelps = []; + const helps = []; + for (const state of states) { + if (state.selectedIndex === constants2.HELP_COMMAND_INDEX) { + helps.push(state); + } else { + notHelps.push(state); } - return 0; } - comparePre(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); + if (helps.length > 0) { + notHelps.push({ + ...basicHelpState, + path: findCommonPrefix(...helps.map((state) => state.path)), + options: helps.reduce((options, state) => options.concat(state.options), []) + }); + } + return notHelps; + } + function findCommonPrefix(firstPath, secondPath, ...rest) { + if (secondPath === void 0) + return Array.from(firstPath); + return findCommonPrefix(firstPath.filter((segment, i) => segment === secondPath[i]), ...rest); + } + function makeNode() { + return { + dynamics: [], + shortcuts: [], + statics: {} + }; + } + function isTerminalNode(node) { + return node === constants2.NODE_SUCCESS || node === constants2.NODE_ERRORED; + } + function cloneTransition(input, offset = 0) { + return { + to: !isTerminalNode(input.to) ? input.to > 2 ? input.to + offset - 2 : input.to + offset : input.to, + reducer: input.reducer + }; + } + function cloneNode(input, offset = 0) { + const output = makeNode(); + for (const [test, transition] of input.dynamics) + output.dynamics.push([test, cloneTransition(transition, offset)]); + for (const transition of input.shortcuts) + output.shortcuts.push(cloneTransition(transition, offset)); + for (const [segment, transitions] of Object.entries(input.statics)) + output.statics[segment] = transitions.map((transition) => cloneTransition(transition, offset)); + return output; + } + function registerDynamic(machine, from, test, to, reducer) { + machine.nodes[from].dynamics.push([ + test, + { to, reducer } + ]); + } + function registerShortcut(machine, from, to, reducer) { + machine.nodes[from].shortcuts.push({ to, reducer }); + } + function registerStatic(machine, from, test, to, reducer) { + const store = !Object.prototype.hasOwnProperty.call(machine.nodes[from].statics, test) ? machine.nodes[from].statics[test] = [] : machine.nodes[from].statics[test]; + store.push({ to, reducer }); + } + function execute(store, callback, state, segment) { + if (Array.isArray(callback)) { + const [name2, ...args] = callback; + return store[name2](state, segment, ...args); + } else { + return store[callback](state, segment); + } + } + function suggest(callback, state) { + const fn2 = Array.isArray(callback) ? tests[callback[0]] : tests[callback]; + if (typeof fn2.suggest === `undefined`) + return null; + const args = Array.isArray(callback) ? callback.slice(1) : []; + return fn2.suggest(state, ...args); + } + var tests = { + always: () => { + return true; + }, + isOptionLike: (state, segment) => { + return !state.ignoreOptions && (segment !== `-` && segment.startsWith(`-`)); + }, + isNotOptionLike: (state, segment) => { + return state.ignoreOptions || segment === `-` || !segment.startsWith(`-`); + }, + isOption: (state, segment, name2, hidden) => { + return !state.ignoreOptions && segment === name2; + }, + isBatchOption: (state, segment, names) => { + return !state.ignoreOptions && constants2.BATCH_REGEX.test(segment) && [...segment.slice(1)].every((name2) => names.includes(`-${name2}`)); + }, + isBoundOption: (state, segment, names, options) => { + const optionParsing = segment.match(constants2.BINDING_REGEX); + return !state.ignoreOptions && !!optionParsing && constants2.OPTION_REGEX.test(optionParsing[1]) && names.includes(optionParsing[1]) && options.filter((opt) => opt.names.includes(optionParsing[1])).every((opt) => opt.allowBinding); + }, + isNegatedOption: (state, segment, name2) => { + return !state.ignoreOptions && segment === `--no-${name2.slice(2)}`; + }, + isHelp: (state, segment) => { + return !state.ignoreOptions && constants2.HELP_REGEX.test(segment); + }, + isUnsupportedOption: (state, segment, names) => { + return !state.ignoreOptions && segment.startsWith(`-`) && constants2.OPTION_REGEX.test(segment) && !names.includes(segment); + }, + isInvalidOption: (state, segment) => { + return !state.ignoreOptions && segment.startsWith(`-`) && !constants2.OPTION_REGEX.test(segment); + } + }; + tests.isOption.suggest = (state, name2, hidden = true) => { + return !hidden ? [name2] : null; + }; + var reducers = { + setCandidateState: (state, segment, candidateState) => { + return { ...state, ...candidateState }; + }, + setSelectedIndex: (state, segment, index) => { + return { ...state, selectedIndex: index }; + }, + pushBatch: (state, segment) => { + return { ...state, options: state.options.concat([...segment.slice(1)].map((name2) => ({ name: `-${name2}`, value: true }))) }; + }, + pushBound: (state, segment) => { + const [, name2, value] = segment.match(constants2.BINDING_REGEX); + return { ...state, options: state.options.concat({ name: name2, value }) }; + }, + pushPath: (state, segment) => { + return { ...state, path: state.path.concat(segment) }; + }, + pushPositional: (state, segment) => { + return { ...state, positionals: state.positionals.concat({ value: segment, extra: false }) }; + }, + pushExtra: (state, segment) => { + return { ...state, positionals: state.positionals.concat({ value: segment, extra: true }) }; + }, + pushExtraNoLimits: (state, segment) => { + return { ...state, positionals: state.positionals.concat({ value: segment, extra: NoLimits }) }; + }, + pushTrue: (state, segment, name2 = segment) => { + return { ...state, options: state.options.concat({ name: segment, value: true }) }; + }, + pushFalse: (state, segment, name2 = segment) => { + return { ...state, options: state.options.concat({ name: name2, value: false }) }; + }, + pushUndefined: (state, segment) => { + return { ...state, options: state.options.concat({ name: segment, value: void 0 }) }; + }, + pushStringValue: (state, segment) => { + var _a; + const copy = { ...state, options: [...state.options] }; + const lastOption = state.options[state.options.length - 1]; + lastOption.value = ((_a = lastOption.value) !== null && _a !== void 0 ? _a : []).concat([segment]); + return copy; + }, + setStringValue: (state, segment) => { + const copy = { ...state, options: [...state.options] }; + const lastOption = state.options[state.options.length - 1]; + lastOption.value = segment; + return copy; + }, + inhibateOptions: (state) => { + return { ...state, ignoreOptions: true }; + }, + useHelp: (state, segment, command) => { + const [ + , + /* name */ + , + index + ] = segment.match(constants2.HELP_REGEX); + if (typeof index !== `undefined`) { + return { ...state, options: [{ name: `-c`, value: String(command) }, { name: `-i`, value: index }] }; + } else { + return { ...state, options: [{ name: `-c`, value: String(command) }] }; } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; + }, + setError: (state, segment, errorMessage) => { + if (segment === constants2.END_OF_INPUT) { + return { ...state, errorMessage: `${errorMessage}.` }; + } else { + return { ...state, errorMessage: `${errorMessage} ("${segment}").` }; } - let i = 0; - do { - const a = this.prerelease[i]; - const b = other.prerelease[i]; - debug2("prerelease compare", i, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); + }, + setOptionArityError: (state, segment) => { + const lastOption = state.options[state.options.length - 1]; + return { ...state, errorMessage: `Not enough arguments to option ${lastOption.name}.` }; + } + }; + var NoLimits = /* @__PURE__ */ Symbol(); + var CommandBuilder = class { + constructor(cliIndex, cliOpts) { + this.allOptionNames = []; + this.arity = { leading: [], trailing: [], extra: [], proxy: false }; + this.options = []; + this.paths = []; + this.cliIndex = cliIndex; + this.cliOpts = cliOpts; + } + addPath(path16) { + this.paths.push(path16); + } + setArity({ leading = this.arity.leading, trailing = this.arity.trailing, extra = this.arity.extra, proxy = this.arity.proxy }) { + Object.assign(this.arity, { leading, trailing, extra, proxy }); + } + addPositional({ name: name2 = `arg`, required = true } = {}) { + if (!required && this.arity.extra === NoLimits) + throw new Error(`Optional parameters cannot be declared when using .rest() or .proxy()`); + if (!required && this.arity.trailing.length > 0) + throw new Error(`Optional parameters cannot be declared after the required trailing positional arguments`); + if (!required && this.arity.extra !== NoLimits) { + this.arity.extra.push(name2); + } else if (this.arity.extra !== NoLimits && this.arity.extra.length === 0) { + this.arity.leading.push(name2); + } else { + this.arity.trailing.push(name2); + } + } + addRest({ name: name2 = `arg`, required = 0 } = {}) { + if (this.arity.extra === NoLimits) + throw new Error(`Infinite lists cannot be declared multiple times in the same command`); + if (this.arity.trailing.length > 0) + throw new Error(`Infinite lists cannot be declared after the required trailing positional arguments`); + for (let t = 0; t < required; ++t) + this.addPositional({ name: name2 }); + this.arity.extra = NoLimits; + } + addProxy({ required = 0 } = {}) { + this.addRest({ required }); + this.arity.proxy = true; + } + addOption({ names, description, arity = 0, hidden = false, required = false, allowBinding = true }) { + if (!allowBinding && arity > 1) + throw new Error(`The arity cannot be higher than 1 when the option only supports the --arg=value syntax`); + if (!Number.isInteger(arity)) + throw new Error(`The arity must be an integer, got ${arity}`); + if (arity < 0) + throw new Error(`The arity must be positive, got ${arity}`); + this.allOptionNames.push(...names); + this.options.push({ names, description, arity, hidden, required, allowBinding }); + } + setContext(context) { + this.context = context; } - compareBuild(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); + usage({ detailed = true, inlineOptions = true } = {}) { + const segments = [this.cliOpts.binaryName]; + const detailedOptionList = []; + if (this.paths.length > 0) + segments.push(...this.paths[0]); + if (detailed) { + for (const { names, arity, hidden, description, required } of this.options) { + if (hidden) + continue; + const args = []; + for (let t = 0; t < arity; ++t) + args.push(` #${t}`); + const definition = `${names.join(`,`)}${args.join(``)}`; + if (!inlineOptions && description) { + detailedOptionList.push({ definition, description, required }); + } else { + segments.push(required ? `<${definition}>` : `[${definition}]`); + } + } + segments.push(...this.arity.leading.map((name2) => `<${name2}>`)); + if (this.arity.extra === NoLimits) + segments.push(`...`); + else + segments.push(...this.arity.extra.map((name2) => `[${name2}]`)); + segments.push(...this.arity.trailing.map((name2) => `<${name2}>`)); + } + const usage = segments.join(` `); + return { usage, options: detailedOptionList }; + } + compile() { + if (typeof this.context === `undefined`) + throw new Error(`Assertion failed: No context attached`); + const machine = makeStateMachine(); + let firstNode = constants2.NODE_INITIAL; + const candidateUsage = this.usage().usage; + const requiredOptions = this.options.filter((opt) => opt.required).map((opt) => opt.names); + firstNode = injectNode(machine, makeNode()); + registerStatic(machine, constants2.NODE_INITIAL, constants2.START_OF_INPUT, firstNode, [`setCandidateState`, { candidateUsage, requiredOptions }]); + const positionalArgument = this.arity.proxy ? `always` : `isNotOptionLike`; + const paths = this.paths.length > 0 ? this.paths : [[]]; + for (const path16 of paths) { + let lastPathNode = firstNode; + if (path16.length > 0) { + const optionPathNode = injectNode(machine, makeNode()); + registerShortcut(machine, lastPathNode, optionPathNode); + this.registerOptions(machine, optionPathNode); + lastPathNode = optionPathNode; + } + for (let t = 0; t < path16.length; ++t) { + const nextPathNode = injectNode(machine, makeNode()); + registerStatic(machine, lastPathNode, path16[t], nextPathNode, `pushPath`); + lastPathNode = nextPathNode; + } + if (this.arity.leading.length > 0 || !this.arity.proxy) { + const helpNode = injectNode(machine, makeNode()); + registerDynamic(machine, lastPathNode, `isHelp`, helpNode, [`useHelp`, this.cliIndex]); + registerDynamic(machine, helpNode, `always`, helpNode, `pushExtra`); + registerStatic(machine, helpNode, constants2.END_OF_INPUT, constants2.NODE_SUCCESS, [`setSelectedIndex`, constants2.HELP_COMMAND_INDEX]); + this.registerOptions(machine, lastPathNode); + } + if (this.arity.leading.length > 0) + registerStatic(machine, lastPathNode, constants2.END_OF_INPUT, constants2.NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + let lastLeadingNode = lastPathNode; + for (let t = 0; t < this.arity.leading.length; ++t) { + const nextLeadingNode = injectNode(machine, makeNode()); + if (!this.arity.proxy || t + 1 !== this.arity.leading.length) + this.registerOptions(machine, nextLeadingNode); + if (this.arity.trailing.length > 0 || t + 1 !== this.arity.leading.length) + registerStatic(machine, nextLeadingNode, constants2.END_OF_INPUT, constants2.NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + registerDynamic(machine, lastLeadingNode, `isNotOptionLike`, nextLeadingNode, `pushPositional`); + lastLeadingNode = nextLeadingNode; + } + let lastExtraNode = lastLeadingNode; + if (this.arity.extra === NoLimits || this.arity.extra.length > 0) { + const extraShortcutNode = injectNode(machine, makeNode()); + registerShortcut(machine, lastLeadingNode, extraShortcutNode); + if (this.arity.extra === NoLimits) { + const extraNode = injectNode(machine, makeNode()); + if (!this.arity.proxy) + this.registerOptions(machine, extraNode); + registerDynamic(machine, lastLeadingNode, positionalArgument, extraNode, `pushExtraNoLimits`); + registerDynamic(machine, extraNode, positionalArgument, extraNode, `pushExtraNoLimits`); + registerShortcut(machine, extraNode, extraShortcutNode); + } else { + for (let t = 0; t < this.arity.extra.length; ++t) { + const nextExtraNode = injectNode(machine, makeNode()); + if (!this.arity.proxy || t > 0) + this.registerOptions(machine, nextExtraNode); + registerDynamic(machine, lastExtraNode, positionalArgument, nextExtraNode, `pushExtra`); + registerShortcut(machine, nextExtraNode, extraShortcutNode); + lastExtraNode = nextExtraNode; + } + } + lastExtraNode = extraShortcutNode; + } + if (this.arity.trailing.length > 0) + registerStatic(machine, lastExtraNode, constants2.END_OF_INPUT, constants2.NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + let lastTrailingNode = lastExtraNode; + for (let t = 0; t < this.arity.trailing.length; ++t) { + const nextTrailingNode = injectNode(machine, makeNode()); + if (!this.arity.proxy) + this.registerOptions(machine, nextTrailingNode); + if (t + 1 < this.arity.trailing.length) + registerStatic(machine, nextTrailingNode, constants2.END_OF_INPUT, constants2.NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + registerDynamic(machine, lastTrailingNode, `isNotOptionLike`, nextTrailingNode, `pushPositional`); + lastTrailingNode = nextTrailingNode; + } + registerDynamic(machine, lastTrailingNode, positionalArgument, constants2.NODE_ERRORED, [`setError`, `Extraneous positional argument`]); + registerStatic(machine, lastTrailingNode, constants2.END_OF_INPUT, constants2.NODE_SUCCESS, [`setSelectedIndex`, this.cliIndex]); } - let i = 0; - do { - const a = this.build[i]; - const b = other.build[i]; - debug2("build compare", i, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; + return { + machine, + context: this.context + }; + } + registerOptions(machine, node) { + registerDynamic(machine, node, [`isOption`, `--`], node, `inhibateOptions`); + registerDynamic(machine, node, [`isBatchOption`, this.allOptionNames], node, `pushBatch`); + registerDynamic(machine, node, [`isBoundOption`, this.allOptionNames, this.options], node, `pushBound`); + registerDynamic(machine, node, [`isUnsupportedOption`, this.allOptionNames], constants2.NODE_ERRORED, [`setError`, `Unsupported option name`]); + registerDynamic(machine, node, [`isInvalidOption`], constants2.NODE_ERRORED, [`setError`, `Invalid option name`]); + for (const option of this.options) { + const longestName = option.names.reduce((longestName2, name2) => { + return name2.length > longestName2.length ? name2 : longestName2; + }, ``); + if (option.arity === 0) { + for (const name2 of option.names) { + registerDynamic(machine, node, [`isOption`, name2, option.hidden || name2 !== longestName], node, `pushTrue`); + if (name2.startsWith(`--`) && !name2.startsWith(`--no-`)) { + registerDynamic(machine, node, [`isNegatedOption`, name2], node, [`pushFalse`, name2]); + } + } } else { - return compareIdentifiers(a, b); + let lastNode = injectNode(machine, makeNode()); + for (const name2 of option.names) + registerDynamic(machine, node, [`isOption`, name2, option.hidden || name2 !== longestName], lastNode, `pushUndefined`); + for (let t = 0; t < option.arity; ++t) { + const nextNode = injectNode(machine, makeNode()); + registerStatic(machine, lastNode, constants2.END_OF_INPUT, constants2.NODE_ERRORED, `setOptionArityError`); + registerDynamic(machine, lastNode, `isOptionLike`, constants2.NODE_ERRORED, `setOptionArityError`); + const action = option.arity === 1 ? `setStringValue` : `pushStringValue`; + registerDynamic(machine, lastNode, `isNotOptionLike`, nextNode, action); + lastNode = nextNode; + } + registerShortcut(machine, lastNode, node); } - } while (++i); - } - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc(release, identifier, identifierBase) { - if (release.startsWith("pre")) { - if (!identifier && identifierBase === false) { - throw new Error("invalid increment argument: identifier is empty"); - } - if (identifier) { - const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); - if (!match || match[1] !== identifier) { - throw new Error(`invalid identifier: ${identifier}`); - } - } - } - switch (release) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier, identifierBase); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier, identifierBase); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier, identifierBase); - this.inc("pre", identifier, identifierBase); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier, identifierBase); - } - this.inc("pre", identifier, identifierBase); - break; - case "release": - if (this.prerelease.length === 0) { - throw new Error(`version ${this.raw} is not a prerelease`); - } - this.prerelease.length = 0; - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case "pre": { - const base = Number(identifierBase) ? 1 : 0; - if (this.prerelease.length === 0) { - this.prerelease = [base]; - } else { - let i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === "number") { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) { - if (identifier === this.prerelease.join(".") && identifierBase === false) { - throw new Error("invalid increment argument: identifier already exists"); - } - this.prerelease.push(base); - } - } - if (identifier) { - let prerelease = [identifier, base]; - if (identifierBase === false) { - prerelease = [identifier]; - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease; - } - } else { - this.prerelease = prerelease; - } - } - break; - } - default: - throw new Error(`invalid increment argument: ${release}`); - } - this.raw = this.format(); - if (this.build.length) { - this.raw += `+${this.build.join(".")}`; } + } + }; + var CliBuilder = class _CliBuilder { + constructor({ binaryName = `...` } = {}) { + this.builders = []; + this.opts = { binaryName }; + } + static build(cbs, opts = {}) { + return new _CliBuilder(opts).commands(cbs).compile(); + } + getBuilderByIndex(n) { + if (!(n >= 0 && n < this.builders.length)) + throw new Error(`Assertion failed: Out-of-bound command index (${n})`); + return this.builders[n]; + } + commands(cbs) { + for (const cb of cbs) + cb(this.command()); return this; } + command() { + const builder = new CommandBuilder(this.builders.length, this.opts); + this.builders.push(builder); + return builder; + } + compile() { + const machines = []; + const contexts = []; + for (const builder of this.builders) { + const { machine: machine2, context } = builder.compile(); + machines.push(machine2); + contexts.push(context); + } + const machine = makeAnyOfMachine(machines); + simplifyMachine(machine); + return { + machine, + contexts, + process: (input) => { + return runMachine(machine, input); + }, + suggest: (input, partial) => { + return suggestMachine(machine, input, partial); + } + }; + } }; - module2.exports = SemVer3; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/compare.js -var require_compare = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/compare.js"(exports2, module2) { - "use strict"; - var SemVer3 = require_semver(); - var compare = (a, b, loose) => new SemVer3(a, loose).compare(new SemVer3(b, loose)); - module2.exports = compare; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/rcompare.js -var require_rcompare = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/rcompare.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var rcompare = (a, b, loose) => compare(b, a, loose); - module2.exports = rcompare; + exports2.CliBuilder = CliBuilder; + exports2.CommandBuilder = CommandBuilder; + exports2.NoLimits = NoLimits; + exports2.aggregateHelpStates = aggregateHelpStates; + exports2.cloneNode = cloneNode; + exports2.cloneTransition = cloneTransition; + exports2.debug = debug; + exports2.debugMachine = debugMachine; + exports2.execute = execute; + exports2.injectNode = injectNode; + exports2.isTerminalNode = isTerminalNode; + exports2.makeAnyOfMachine = makeAnyOfMachine; + exports2.makeNode = makeNode; + exports2.makeStateMachine = makeStateMachine; + exports2.reducers = reducers; + exports2.registerDynamic = registerDynamic; + exports2.registerShortcut = registerShortcut; + exports2.registerStatic = registerStatic; + exports2.runMachineInternal = runMachineInternal; + exports2.selectBestState = selectBestState; + exports2.simplifyMachine = simplifyMachine; + exports2.suggest = suggest; + exports2.tests = tests; + exports2.trimSmallerBranches = trimSmallerBranches; + } +}); + +// node_modules/clipanion/lib/platform/node.mjs +var node_exports = {}; +__export(node_exports, { + getCaptureActivator: () => getCaptureActivator, + getDefaultColorDepth: () => getDefaultColorDepth +}); +function getDefaultColorDepth() { + if (import_tty.default && `getColorDepth` in import_tty.default.WriteStream.prototype) + return import_tty.default.WriteStream.prototype.getColorDepth(); + if (process.env.FORCE_COLOR === `0`) + return 1; + if (process.env.FORCE_COLOR === `1`) + return 8; + if (typeof process.stdout !== `undefined` && process.stdout.isTTY) + return 8; + return 1; +} +function getCaptureActivator(context) { + let contextStorage = gContextStorage; + if (typeof contextStorage === `undefined`) { + if (context.stdout === process.stdout && context.stderr === process.stderr) + return null; + const { AsyncLocalStorage: LazyAsyncLocalStorage } = require("async_hooks"); + contextStorage = gContextStorage = new LazyAsyncLocalStorage(); + const origStdoutWrite = process.stdout._write; + process.stdout._write = function(chunk, encoding, cb) { + const context2 = contextStorage.getStore(); + if (typeof context2 === `undefined`) + return origStdoutWrite.call(this, chunk, encoding, cb); + return context2.stdout.write(chunk, encoding, cb); + }; + const origStderrWrite = process.stderr._write; + process.stderr._write = function(chunk, encoding, cb) { + const context2 = contextStorage.getStore(); + if (typeof context2 === `undefined`) + return origStderrWrite.call(this, chunk, encoding, cb); + return context2.stderr.write(chunk, encoding, cb); + }; + } + return (fn2) => { + return contextStorage.run(context, fn2); + }; +} +var import_tty, gContextStorage; +var init_node = __esm({ + "node_modules/clipanion/lib/platform/node.mjs"() { + import_tty = __toESM(require("tty"), 1); } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/parse.js -var require_parse = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/parse.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/HelpCommand.js +var require_HelpCommand = __commonJS({ + "node_modules/clipanion/lib/advanced/HelpCommand.js"(exports2) { "use strict"; - var SemVer3 = require_semver(); - var parse4 = (version2, options, throwErrors = false) => { - if (version2 instanceof SemVer3) { - return version2; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_Command = require_Command(); + var HelpCommand = class _HelpCommand extends advanced_Command.Command { + constructor(contexts) { + super(); + this.contexts = contexts; + this.commands = []; + } + static from(state, contexts) { + const command = new _HelpCommand(contexts); + command.path = state.path; + for (const opt of state.options) { + switch (opt.name) { + case `-c`: + { + command.commands.push(Number(opt.value)); + } + break; + case `-i`: + { + command.index = Number(opt.value); + } + break; + } + } + return command; } - try { - return new SemVer3(version2, options); - } catch (er) { - if (!throwErrors) { - return null; + async execute() { + let commands = this.commands; + if (typeof this.index !== `undefined` && this.index >= 0 && this.index < commands.length) + commands = [commands[this.index]]; + if (commands.length === 0) { + this.context.stdout.write(this.cli.usage()); + } else if (commands.length === 1) { + this.context.stdout.write(this.cli.usage(this.contexts[commands[0]].commandClass, { detailed: true })); + } else if (commands.length > 1) { + this.context.stdout.write(`Multiple commands match your selection: +`); + this.context.stdout.write(` +`); + let index = 0; + for (const command of this.commands) + this.context.stdout.write(this.cli.usage(this.contexts[command].commandClass, { prefix: `${index++}. `.padStart(5) })); + this.context.stdout.write(` +`); + this.context.stdout.write(`Run again with -h= to see the longer details of any of those commands. +`); } - throw er; } }; - module2.exports = parse4; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/valid.js -var require_valid = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/valid.js"(exports2, module2) { - "use strict"; - var parse4 = require_parse(); - var valid = (version2, options) => { - const v = parse4(version2, options); - return v ? v.version : null; - }; - module2.exports = valid; + exports2.HelpCommand = HelpCommand; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/lrucache.js -var require_lrucache = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/lrucache.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/Cli.js +var require_Cli = __commonJS({ + "node_modules/clipanion/lib/advanced/Cli.js"(exports2) { "use strict"; - var LRUCache = class { - constructor() { - this.max = 1e3; - this.map = /* @__PURE__ */ new Map(); + Object.defineProperty(exports2, "__esModule", { value: true }); + var constants2 = require_constants(); + var core = require_core(); + var format = require_format(); + var platform5 = (init_node(), __toCommonJS(node_exports)); + var advanced_Command = require_Command(); + var advanced_HelpCommand = require_HelpCommand(); + var errorCommandSymbol = /* @__PURE__ */ Symbol(`clipanion/errorCommand`); + async function runExit(...args) { + const { resolvedOptions, resolvedCommandClasses, resolvedArgv, resolvedContext } = resolveRunParameters(args); + const cli = Cli2.from(resolvedCommandClasses, resolvedOptions); + return cli.runExit(resolvedArgv, resolvedContext); + } + async function run(...args) { + const { resolvedOptions, resolvedCommandClasses, resolvedArgv, resolvedContext } = resolveRunParameters(args); + const cli = Cli2.from(resolvedCommandClasses, resolvedOptions); + return cli.run(resolvedArgv, resolvedContext); + } + function resolveRunParameters(args) { + let resolvedOptions; + let resolvedCommandClasses; + let resolvedArgv; + let resolvedContext; + if (typeof process !== `undefined` && typeof process.argv !== `undefined`) + resolvedArgv = process.argv.slice(2); + switch (args.length) { + case 1: + { + resolvedCommandClasses = args[0]; + } + break; + case 2: + { + if (args[0] && args[0].prototype instanceof advanced_Command.Command || Array.isArray(args[0])) { + resolvedCommandClasses = args[0]; + if (Array.isArray(args[1])) { + resolvedArgv = args[1]; + } else { + resolvedContext = args[1]; + } + } else { + resolvedOptions = args[0]; + resolvedCommandClasses = args[1]; + } + } + break; + case 3: + { + if (Array.isArray(args[2])) { + resolvedOptions = args[0]; + resolvedCommandClasses = args[1]; + resolvedArgv = args[2]; + } else if (args[0] && args[0].prototype instanceof advanced_Command.Command || Array.isArray(args[0])) { + resolvedCommandClasses = args[0]; + resolvedArgv = args[1]; + resolvedContext = args[2]; + } else { + resolvedOptions = args[0]; + resolvedCommandClasses = args[1]; + resolvedContext = args[2]; + } + } + break; + default: + { + resolvedOptions = args[0]; + resolvedCommandClasses = args[1]; + resolvedArgv = args[2]; + resolvedContext = args[3]; + } + break; } - get(key) { - const value = this.map.get(key); - if (value === void 0) { - return void 0; - } else { - this.map.delete(key); - this.map.set(key, value); - return value; - } + if (typeof resolvedArgv === `undefined`) + throw new Error(`The argv parameter must be provided when running Clipanion outside of a Node context`); + return { + resolvedOptions, + resolvedCommandClasses, + resolvedArgv, + resolvedContext + }; + } + var Cli2 = class _Cli { + constructor({ binaryLabel, binaryName: binaryNameOpt = `...`, binaryVersion, enableCapture = false, enableColors } = {}) { + this.registrations = /* @__PURE__ */ new Map(); + this.builder = new core.CliBuilder({ binaryName: binaryNameOpt }); + this.binaryLabel = binaryLabel; + this.binaryName = binaryNameOpt; + this.binaryVersion = binaryVersion; + this.enableCapture = enableCapture; + this.enableColors = enableColors; } - delete(key) { - return this.map.delete(key); + /** + * Creates a new Cli and registers all commands passed as parameters. + * + * @param commandClasses The Commands to register + * @returns The created `Cli` instance + */ + static from(commandClasses, options = {}) { + const cli = new _Cli(options); + const resolvedCommandClasses = Array.isArray(commandClasses) ? commandClasses : [commandClasses]; + for (const commandClass of resolvedCommandClasses) + cli.register(commandClass); + return cli; } - set(key, value) { - const deleted = this.delete(key); - if (!deleted && value !== void 0) { - if (this.map.size >= this.max) { - const firstKey = this.map.keys().next().value; - this.delete(firstKey); + /** + * Registers a command inside the CLI. + */ + register(commandClass) { + var _a; + const specs = /* @__PURE__ */ new Map(); + const command = new commandClass(); + for (const key in command) { + const value = command[key]; + if (typeof value === `object` && value !== null && value[advanced_Command.Command.isOption]) { + specs.set(key, value); + } + } + const builder = this.builder.command(); + const index = builder.cliIndex; + const paths = (_a = commandClass.paths) !== null && _a !== void 0 ? _a : command.paths; + if (typeof paths !== `undefined`) + for (const path16 of paths) + builder.addPath(path16); + this.registrations.set(commandClass, { specs, builder, index }); + for (const [key, { definition }] of specs.entries()) + definition(builder, key); + builder.setContext({ + commandClass + }); + } + process(input, userContext) { + const { contexts, process: process5 } = this.builder.compile(); + const state = process5(input); + const context = { + ..._Cli.defaultContext, + ...userContext + }; + switch (state.selectedIndex) { + case constants2.HELP_COMMAND_INDEX: { + const command = advanced_HelpCommand.HelpCommand.from(state, contexts); + command.context = context; + return command; } - this.map.set(key, value); + default: + { + const { commandClass } = contexts[state.selectedIndex]; + const record = this.registrations.get(commandClass); + if (typeof record === `undefined`) + throw new Error(`Assertion failed: Expected the command class to have been registered.`); + const command = new commandClass(); + command.context = context; + command.path = state.path; + try { + for (const [key, { transformer }] of record.specs.entries()) + command[key] = transformer(record.builder, key, state, context); + return command; + } catch (error) { + error[errorCommandSymbol] = command; + throw error; + } + } + break; } - return this; } - }; - module2.exports = LRUCache; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/eq.js -var require_eq = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/eq.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var eq = (a, b, loose) => compare(a, b, loose) === 0; - module2.exports = eq; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/neq.js -var require_neq = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/neq.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var neq = (a, b, loose) => compare(a, b, loose) !== 0; - module2.exports = neq; + async run(input, userContext) { + var _a, _b; + let command; + const context = { + ..._Cli.defaultContext, + ...userContext + }; + const colored = (_a = this.enableColors) !== null && _a !== void 0 ? _a : context.colorDepth > 1; + if (!Array.isArray(input)) { + command = input; + } else { + try { + command = this.process(input, context); + } catch (error) { + context.stdout.write(this.error(error, { colored })); + return 1; + } + } + if (command.help) { + context.stdout.write(this.usage(command, { colored, detailed: true })); + return 0; + } + command.context = context; + command.cli = { + binaryLabel: this.binaryLabel, + binaryName: this.binaryName, + binaryVersion: this.binaryVersion, + enableCapture: this.enableCapture, + enableColors: this.enableColors, + definitions: () => this.definitions(), + error: (error, opts) => this.error(error, opts), + format: (colored2) => this.format(colored2), + process: (input2, subContext) => this.process(input2, { ...context, ...subContext }), + run: (input2, subContext) => this.run(input2, { ...context, ...subContext }), + usage: (command2, opts) => this.usage(command2, opts) + }; + const activate = this.enableCapture ? (_b = platform5.getCaptureActivator(context)) !== null && _b !== void 0 ? _b : noopCaptureActivator : noopCaptureActivator; + let exitCode; + try { + exitCode = await activate(() => command.validateAndExecute().catch((error) => command.catch(error).then(() => 0))); + } catch (error) { + context.stdout.write(this.error(error, { colored, command })); + return 1; + } + return exitCode; + } + async runExit(input, context) { + process.exitCode = await this.run(input, context); + } + suggest(input, partial) { + const { suggest } = this.builder.compile(); + return suggest(input, partial); + } + definitions({ colored = false } = {}) { + const data = []; + for (const [commandClass, { index }] of this.registrations) { + if (typeof commandClass.usage === `undefined`) + continue; + const { usage: path16 } = this.getUsageByIndex(index, { detailed: false }); + const { usage, options } = this.getUsageByIndex(index, { detailed: true, inlineOptions: false }); + const category = typeof commandClass.usage.category !== `undefined` ? format.formatMarkdownish(commandClass.usage.category, { format: this.format(colored), paragraphs: false }) : void 0; + const description = typeof commandClass.usage.description !== `undefined` ? format.formatMarkdownish(commandClass.usage.description, { format: this.format(colored), paragraphs: false }) : void 0; + const details = typeof commandClass.usage.details !== `undefined` ? format.formatMarkdownish(commandClass.usage.details, { format: this.format(colored), paragraphs: true }) : void 0; + const examples = typeof commandClass.usage.examples !== `undefined` ? commandClass.usage.examples.map(([label, cli]) => [format.formatMarkdownish(label, { format: this.format(colored), paragraphs: false }), cli.replace(/\$0/g, this.binaryName)]) : void 0; + data.push({ path: path16, usage, category, description, details, examples, options }); + } + return data; + } + usage(command = null, { colored, detailed = false, prefix = `$ ` } = {}) { + var _a; + if (command === null) { + for (const commandClass2 of this.registrations.keys()) { + const paths = commandClass2.paths; + const isDocumented = typeof commandClass2.usage !== `undefined`; + const isExclusivelyDefault = !paths || paths.length === 0 || paths.length === 1 && paths[0].length === 0; + const isDefault = isExclusivelyDefault || ((_a = paths === null || paths === void 0 ? void 0 : paths.some((path16) => path16.length === 0)) !== null && _a !== void 0 ? _a : false); + if (isDefault) { + if (command) { + command = null; + break; + } else { + command = commandClass2; + } + } else { + if (isDocumented) { + command = null; + continue; + } + } + } + if (command) { + detailed = true; + } + } + const commandClass = command !== null && command instanceof advanced_Command.Command ? command.constructor : command; + let result = ``; + if (!commandClass) { + const commandsByCategories = /* @__PURE__ */ new Map(); + for (const [commandClass2, { index }] of this.registrations.entries()) { + if (typeof commandClass2.usage === `undefined`) + continue; + const category = typeof commandClass2.usage.category !== `undefined` ? format.formatMarkdownish(commandClass2.usage.category, { format: this.format(colored), paragraphs: false }) : null; + let categoryCommands = commandsByCategories.get(category); + if (typeof categoryCommands === `undefined`) + commandsByCategories.set(category, categoryCommands = []); + const { usage } = this.getUsageByIndex(index); + categoryCommands.push({ commandClass: commandClass2, usage }); + } + const categoryNames = Array.from(commandsByCategories.keys()).sort((a, b) => { + if (a === null) + return -1; + if (b === null) + return 1; + return a.localeCompare(b, `en`, { usage: `sort`, caseFirst: `upper` }); + }); + const hasLabel = typeof this.binaryLabel !== `undefined`; + const hasVersion = typeof this.binaryVersion !== `undefined`; + if (hasLabel || hasVersion) { + if (hasLabel && hasVersion) + result += `${this.format(colored).header(`${this.binaryLabel} - ${this.binaryVersion}`)} + +`; + else if (hasLabel) + result += `${this.format(colored).header(`${this.binaryLabel}`)} +`; + else + result += `${this.format(colored).header(`${this.binaryVersion}`)} +`; + result += ` ${this.format(colored).bold(prefix)}${this.binaryName} +`; + } else { + result += `${this.format(colored).bold(prefix)}${this.binaryName} +`; + } + for (const categoryName of categoryNames) { + const commands = commandsByCategories.get(categoryName).slice().sort((a, b) => { + return a.usage.localeCompare(b.usage, `en`, { usage: `sort`, caseFirst: `upper` }); + }); + const header = categoryName !== null ? categoryName.trim() : `General commands`; + result += ` +`; + result += `${this.format(colored).header(`${header}`)} +`; + for (const { commandClass: commandClass2, usage } of commands) { + const doc = commandClass2.usage.description || `undocumented`; + result += ` +`; + result += ` ${this.format(colored).bold(usage)} +`; + result += ` ${format.formatMarkdownish(doc, { format: this.format(colored), paragraphs: false })}`; + } + } + result += ` +`; + result += format.formatMarkdownish(`You can also print more details about any of these commands by calling them with the \`-h,--help\` flag right after the command name.`, { format: this.format(colored), paragraphs: true }); + } else { + if (!detailed) { + const { usage } = this.getUsageByRegistration(commandClass); + result += `${this.format(colored).bold(prefix)}${usage} +`; + } else { + const { description = ``, details = ``, examples = [] } = commandClass.usage || {}; + if (description !== ``) { + result += format.formatMarkdownish(description, { format: this.format(colored), paragraphs: false }).replace(/^./, ($0) => $0.toUpperCase()); + result += ` +`; + } + if (details !== `` || examples.length > 0) { + result += `${this.format(colored).header(`Usage`)} +`; + result += ` +`; + } + const { usage, options } = this.getUsageByRegistration(commandClass, { inlineOptions: false }); + result += `${this.format(colored).bold(prefix)}${usage} +`; + if (options.length > 0) { + result += ` +`; + result += `${this.format(colored).header(`Options`)} +`; + const maxDefinitionLength = options.reduce((length, option) => { + return Math.max(length, option.definition.length); + }, 0); + result += ` +`; + for (const { definition, description: description2 } of options) { + result += ` ${this.format(colored).bold(definition.padEnd(maxDefinitionLength))} ${format.formatMarkdownish(description2, { format: this.format(colored), paragraphs: false })}`; + } + } + if (details !== ``) { + result += ` +`; + result += `${this.format(colored).header(`Details`)} +`; + result += ` +`; + result += format.formatMarkdownish(details, { format: this.format(colored), paragraphs: true }); + } + if (examples.length > 0) { + result += ` +`; + result += `${this.format(colored).header(`Examples`)} +`; + for (const [description2, example] of examples) { + result += ` +`; + result += format.formatMarkdownish(description2, { format: this.format(colored), paragraphs: false }); + result += `${example.replace(/^/m, ` ${this.format(colored).bold(prefix)}`).replace(/\$0/g, this.binaryName)} +`; + } + } + } + } + return result; + } + error(error, _a) { + var _b; + var { colored, command = (_b = error[errorCommandSymbol]) !== null && _b !== void 0 ? _b : null } = _a === void 0 ? {} : _a; + if (!error || typeof error !== `object` || !(`stack` in error)) + error = new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(error)})`); + let result = ``; + let name2 = error.name.replace(/([a-z])([A-Z])/g, `$1 $2`); + if (name2 === `Error`) + name2 = `Internal Error`; + result += `${this.format(colored).error(name2)}: ${error.message} +`; + const meta = error.clipanion; + if (typeof meta !== `undefined`) { + if (meta.type === `usage`) { + result += ` +`; + result += this.usage(command); + } + } else { + if (error.stack) { + result += `${error.stack.replace(/^.*\n/, ``)} +`; + } + } + return result; + } + format(colored) { + var _a; + return ((_a = colored !== null && colored !== void 0 ? colored : this.enableColors) !== null && _a !== void 0 ? _a : _Cli.defaultContext.colorDepth > 1) ? format.richFormat : format.textFormat; + } + getUsageByRegistration(klass, opts) { + const record = this.registrations.get(klass); + if (typeof record === `undefined`) + throw new Error(`Assertion failed: Unregistered command`); + return this.getUsageByIndex(record.index, opts); + } + getUsageByIndex(n, opts) { + return this.builder.getBuilderByIndex(n).usage(opts); + } + }; + Cli2.defaultContext = { + env: process.env, + stdin: process.stdin, + stdout: process.stdout, + stderr: process.stderr, + colorDepth: platform5.getDefaultColorDepth() + }; + function noopCaptureActivator(fn2) { + return fn2(); + } + exports2.Cli = Cli2; + exports2.run = run; + exports2.runExit = runExit; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gt.js -var require_gt = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gt.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/builtins/definitions.js +var require_definitions = __commonJS({ + "node_modules/clipanion/lib/advanced/builtins/definitions.js"(exports2) { "use strict"; - var compare = require_compare(); - var gt = (a, b, loose) => compare(a, b, loose) > 0; - module2.exports = gt; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_Command = require_Command(); + var DefinitionsCommand = class extends advanced_Command.Command { + async execute() { + this.context.stdout.write(`${JSON.stringify(this.cli.definitions(), null, 2)} +`); + } + }; + DefinitionsCommand.paths = [[`--clipanion=definitions`]]; + exports2.DefinitionsCommand = DefinitionsCommand; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gte.js -var require_gte = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gte.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/builtins/help.js +var require_help = __commonJS({ + "node_modules/clipanion/lib/advanced/builtins/help.js"(exports2) { "use strict"; - var compare = require_compare(); - var gte = (a, b, loose) => compare(a, b, loose) >= 0; - module2.exports = gte; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_Command = require_Command(); + var HelpCommand = class extends advanced_Command.Command { + async execute() { + this.context.stdout.write(this.cli.usage()); + } + }; + HelpCommand.paths = [[`-h`], [`--help`]]; + exports2.HelpCommand = HelpCommand; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lt.js -var require_lt = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lt.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/builtins/version.js +var require_version = __commonJS({ + "node_modules/clipanion/lib/advanced/builtins/version.js"(exports2) { "use strict"; - var compare = require_compare(); - var lt = (a, b, loose) => compare(a, b, loose) < 0; - module2.exports = lt; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_Command = require_Command(); + var VersionCommand = class extends advanced_Command.Command { + async execute() { + var _a; + this.context.stdout.write(`${(_a = this.cli.binaryVersion) !== null && _a !== void 0 ? _a : ``} +`); + } + }; + VersionCommand.paths = [[`-v`], [`--version`]]; + exports2.VersionCommand = VersionCommand; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lte.js -var require_lte = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lte.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/builtins/index.js +var require_builtins = __commonJS({ + "node_modules/clipanion/lib/advanced/builtins/index.js"(exports2) { "use strict"; - var compare = require_compare(); - var lte = (a, b, loose) => compare(a, b, loose) <= 0; - module2.exports = lte; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_builtins_definitions = require_definitions(); + var advanced_builtins_help = require_help(); + var advanced_builtins_version = require_version(); + exports2.DefinitionsCommand = advanced_builtins_definitions.DefinitionsCommand; + exports2.HelpCommand = advanced_builtins_help.HelpCommand; + exports2.VersionCommand = advanced_builtins_version.VersionCommand; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/cmp.js -var require_cmp = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/cmp.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/options/Array.js +var require_Array = __commonJS({ + "node_modules/clipanion/lib/advanced/options/Array.js"(exports2) { "use strict"; - var eq = require_eq(); - var neq = require_neq(); - var gt = require_gt(); - var gte = require_gte(); - var lt = require_lt(); - var lte = require_lte(); - var cmp = (a, op, b, loose) => { - switch (op) { - case "===": - if (typeof a === "object") { - a = a.version; - } - if (typeof b === "object") { - b = b.version; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_options_utils = require_utils(); + function Array2(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = advanced_options_utils.rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const { arity = 1 } = opts; + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return advanced_options_utils.makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + arity, + hidden: opts === null || opts === void 0 ? void 0 : opts.hidden, + description: opts === null || opts === void 0 ? void 0 : opts.description, + required: opts.required + }); + }, + transformer(builder, key, state) { + let usedName; + let currentValue = typeof initialValue !== `undefined` ? [...initialValue] : void 0; + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + usedName = name2; + currentValue = currentValue !== null && currentValue !== void 0 ? currentValue : []; + currentValue.push(value); } - return a === b; - case "!==": - if (typeof a === "object") { - a = a.version; + if (typeof currentValue !== `undefined`) { + return advanced_options_utils.applyValidator(usedName !== null && usedName !== void 0 ? usedName : key, currentValue, opts.validator); + } else { + return currentValue; } - if (typeof b === "object") { - b = b.version; + } + }); + } + exports2.Array = Array2; + } +}); + +// node_modules/clipanion/lib/advanced/options/Boolean.js +var require_Boolean = __commonJS({ + "node_modules/clipanion/lib/advanced/options/Boolean.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_options_utils = require_utils(); + function Boolean2(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = advanced_options_utils.rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return advanced_options_utils.makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + allowBinding: false, + arity: 0, + hidden: opts.hidden, + description: opts.description, + required: opts.required + }); + }, + transformer(builer, key, state) { + let currentValue = initialValue; + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + currentValue = value; } - return a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError(`Invalid operator: ${op}`); - } - }; - module2.exports = cmp; + return currentValue; + } + }); + } + exports2.Boolean = Boolean2; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/comparator.js -var require_comparator = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/comparator.js"(exports2, module2) { +// node_modules/clipanion/lib/advanced/options/Counter.js +var require_Counter = __commonJS({ + "node_modules/clipanion/lib/advanced/options/Counter.js"(exports2) { "use strict"; - var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); - var Comparator = class _Comparator { - static get ANY() { - return ANY; - } - constructor(comp, options) { - options = parseOptions(options); - if (comp instanceof _Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_options_utils = require_utils(); + function Counter(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = advanced_options_utils.rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return advanced_options_utils.makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + allowBinding: false, + arity: 0, + hidden: opts.hidden, + description: opts.description, + required: opts.required + }); + }, + transformer(builder, key, state) { + let currentValue = initialValue; + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + currentValue !== null && currentValue !== void 0 ? currentValue : currentValue = 0; + if (!value) { + currentValue = 0; + } else { + currentValue += 1; + } } + return currentValue; } - comp = comp.trim().split(/\s+/).join(" "); - debug2("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; + }); + } + exports2.Counter = Counter; + } +}); + +// node_modules/clipanion/lib/advanced/options/Proxy.js +var require_Proxy = __commonJS({ + "node_modules/clipanion/lib/advanced/options/Proxy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_options_utils = require_utils(); + function Proxy2(opts = {}) { + return advanced_options_utils.makeCommandOption({ + definition(builder, key) { + var _a; + builder.addProxy({ + name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, + required: opts.required + }); + }, + transformer(builder, key, state) { + return state.positionals.map(({ value }) => value); } - debug2("comp", this); - } - parse(comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - const m = comp.match(r); - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`); + }); + } + exports2.Proxy = Proxy2; + } +}); + +// node_modules/clipanion/lib/advanced/options/Rest.js +var require_Rest = __commonJS({ + "node_modules/clipanion/lib/advanced/options/Rest.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var core = require_core(); + var advanced_options_utils = require_utils(); + function Rest(opts = {}) { + return advanced_options_utils.makeCommandOption({ + definition(builder, key) { + var _a; + builder.addRest({ + name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, + required: opts.required + }); + }, + transformer(builder, key, state) { + const isRestPositional = (index) => { + const positional = state.positionals[index]; + if (positional.extra === core.NoLimits) + return true; + if (positional.extra === false && index < builder.arity.leading.length) + return true; + return false; + }; + let count = 0; + while (count < state.positionals.length && isRestPositional(count)) + count += 1; + return state.positionals.splice(0, count).map(({ value }) => value); } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; + }); + } + exports2.Rest = Rest; + } +}); + +// node_modules/clipanion/lib/advanced/options/String.js +var require_String = __commonJS({ + "node_modules/clipanion/lib/advanced/options/String.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var core = require_core(); + var advanced_options_utils = require_utils(); + function StringOption(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = advanced_options_utils.rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const { arity = 1 } = opts; + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return advanced_options_utils.makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + arity: opts.tolerateBoolean ? 0 : arity, + hidden: opts.hidden, + description: opts.description, + required: opts.required + }); + }, + transformer(builder, key, state, context) { + let usedName; + let currentValue = initialValue; + if (typeof opts.env !== `undefined` && context.env[opts.env]) { + usedName = opts.env; + currentValue = context.env[opts.env]; + } + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + usedName = name2; + currentValue = value; + } + if (typeof currentValue === `string`) { + return advanced_options_utils.applyValidator(usedName !== null && usedName !== void 0 ? usedName : key, currentValue, opts.validator); + } else { + return currentValue; + } } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer3(m[2], this.options.loose); + }); + } + function StringPositional(opts = {}) { + const { required = true } = opts; + return advanced_options_utils.makeCommandOption({ + definition(builder, key) { + var _a; + builder.addPositional({ + name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, + required: opts.required + }); + }, + transformer(builder, key, state) { + var _a; + for (let i = 0; i < state.positionals.length; ++i) { + if (state.positionals[i].extra === core.NoLimits) + continue; + if (required && state.positionals[i].extra === true) + continue; + if (!required && state.positionals[i].extra === false) + continue; + const [positional] = state.positionals.splice(i, 1); + return advanced_options_utils.applyValidator((_a = opts.name) !== null && _a !== void 0 ? _a : key, positional.value, opts.validator); + } + return void 0; } + }); + } + function String2(descriptor, ...args) { + if (typeof descriptor === `string`) { + return StringOption(descriptor, ...args); + } else { + return StringPositional(descriptor); } - toString() { - return this.value; + } + exports2.String = String2; + } +}); + +// node_modules/clipanion/lib/advanced/options/index.js +var require_options = __commonJS({ + "node_modules/clipanion/lib/advanced/options/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var advanced_options_utils = require_utils(); + var advanced_options_Array = require_Array(); + var advanced_options_Boolean = require_Boolean(); + var advanced_options_Counter = require_Counter(); + var advanced_options_Proxy = require_Proxy(); + var advanced_options_Rest = require_Rest(); + var advanced_options_String = require_String(); + exports2.applyValidator = advanced_options_utils.applyValidator; + exports2.cleanValidationError = advanced_options_utils.cleanValidationError; + exports2.formatError = advanced_options_utils.formatError; + exports2.isOptionSymbol = advanced_options_utils.isOptionSymbol; + exports2.makeCommandOption = advanced_options_utils.makeCommandOption; + exports2.rerouteArguments = advanced_options_utils.rerouteArguments; + exports2.Array = advanced_options_Array.Array; + exports2.Boolean = advanced_options_Boolean.Boolean; + exports2.Counter = advanced_options_Counter.Counter; + exports2.Proxy = advanced_options_Proxy.Proxy; + exports2.Rest = advanced_options_Rest.Rest; + exports2.String = advanced_options_String.String; + } +}); + +// node_modules/clipanion/lib/advanced/index.js +var require_advanced = __commonJS({ + "node_modules/clipanion/lib/advanced/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var errors = require_errors(); + var format = require_format(); + var advanced_Command = require_Command(); + var advanced_Cli = require_Cli(); + var advanced_builtins_index = require_builtins(); + var advanced_options_index = require_options(); + exports2.UsageError = errors.UsageError; + exports2.formatMarkdownish = format.formatMarkdownish; + exports2.Command = advanced_Command.Command; + exports2.Cli = advanced_Cli.Cli; + exports2.run = advanced_Cli.run; + exports2.runExit = advanced_Cli.runExit; + exports2.Builtins = advanced_builtins_index; + exports2.Option = advanced_options_index; + } +}); + +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { + "use strict"; + var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug; + } +}); + +// node_modules/semver/internal/constants.js +var require_constants2 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { + "use strict"; + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module2.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// node_modules/semver/internal/re.js +var require_re = __commonJS({ + "node_modules/semver/internal/re.js"(exports2, module2) { + "use strict"; + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants2(); + var debug = require_debug(); + exports2 = module2.exports = {}; + var re = exports2.re = []; + var safeRe = exports2.safeRe = []; + var src = exports2.src = []; + var safeSrc = exports2.safeSrc = []; + var t = exports2.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); } - test(version2) { - debug2("Comparator.test", version2, this.options.loose); - if (this.semver === ANY || version2 === ANY) { - return true; - } - if (typeof version2 === "string") { - try { - version2 = new SemVer3(version2, this.options); - } catch (er) { - return false; - } - } - return cmp(version2, this.operator, this.semver, this.options); + return value; + }; + var createToken = (name2, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug(name2, index, value); + t[name2] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); + createToken("FULL", `^${src[t.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); + createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t.COERCE], true); + createToken("COERCERTLFULL", src[t.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports2.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports2.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); + exports2.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "node_modules/semver/internal/parse-options.js"(exports2, module2) { + "use strict"; + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options) => { + if (!options) { + return emptyOpts; } - intersects(comp, options) { - if (!(comp instanceof _Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (this.operator === "") { - if (this.value === "") { - return true; - } - return new Range3(comp.value, options).test(this.value); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; - } - return new Range3(this.value, options).test(comp.semver); - } - options = parseOptions(options); - if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { - return false; - } - if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { - return false; - } - if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { - return true; - } - if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { - return true; - } - if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { - return true; - } - if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { - return true; - } - if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { - return true; - } - return false; + if (typeof options !== "object") { + return looseOption; } + return options; }; - module2.exports = Comparator; - var parseOptions = require_parse_options(); - var { safeRe: re, t } = require_re(); - var cmp = require_cmp(); - var debug2 = require_debug(); - var SemVer3 = require_semver(); - var Range3 = require_range(); + module2.exports = parseOptions; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/range.js -var require_range = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/range.js"(exports2, module2) { +// node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "node_modules/semver/internal/identifiers.js"(exports2, module2) { "use strict"; - var SPACE_CHARACTERS = /\s+/g; - var Range3 = class _Range { - constructor(range, options) { + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a, b) => { + if (typeof a === "number" && typeof b === "number") { + return a === b ? 0 : a < b ? -1 : 1; + } + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; + }; + var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); + module2.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "node_modules/semver/classes/semver.js"(exports2, module2) { + "use strict"; + var debug = require_debug(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants2(); + var { safeRe: re, t } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer3 = class _SemVer { + constructor(version2, options) { options = parseOptions(options); - if (range instanceof _Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; + if (version2 instanceof _SemVer) { + if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) { + return version2; } else { - return new _Range(range.raw, options); + version2 = version2.version; } + } else if (typeof version2 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`); } - if (range instanceof Comparator) { - this.raw = range.value; - this.set = [[range]]; - this.formatted = void 0; - return this; + if (version2.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); } + debug("SemVer", version2, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().replace(SPACE_CHARACTERS, " "); - this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version2}`); } - if (this.set.length > 1) { - const first = this.set[0]; - this.set = this.set.filter((c) => !isNullSet(c[0])); - if (this.set.length === 0) { - this.set = [first]; - } else if (this.set.length > 1) { - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c]; - break; - } - } - } + this.raw = version2; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); } - this.formatted = void 0; - } - get range() { - if (this.formatted === void 0) { - this.formatted = ""; - for (let i = 0; i < this.set.length; i++) { - if (i > 0) { - this.formatted += "||"; - } - const comps = this.set[i]; - for (let k = 0; k < comps.length; k++) { - if (k > 0) { - this.formatted += " "; + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; } - this.formatted += comps[k].toString().trim(); } - } + return id; + }); } - return this.formatted; + this.build = m[5] ? m[5].split(".") : []; + this.format(); } format() { - return this.range; + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; } toString() { - return this.range; + return this.version; } - parseRange(range) { - const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); - const memoKey = memoOpts + ":" + range; - const cached = cache2.get(memoKey); - if (cached) { - return cached; - } - const loose = this.options.loose; - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); - debug2("hyphen replace", range); - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug2("comparator trim", range); - range = range.replace(re[t.TILDETRIM], tildeTrimReplace); - debug2("tilde trim", range); - range = range.replace(re[t.CARETTRIM], caretTrimReplace); - debug2("caret trim", range); - let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); - if (loose) { - rangeList = rangeList.filter((comp) => { - debug2("loose invalid filter", comp, this.options); - return !!comp.match(re[t.COMPARATORLOOSE]); - }); - } - debug2("range list", rangeList); - const rangeMap = /* @__PURE__ */ new Map(); - const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp]; + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; } - rangeMap.set(comp.value, comp); + other = new _SemVer(other, this.options); } - if (rangeMap.size > 1 && rangeMap.has("")) { - rangeMap.delete(""); + if (other.version === this.version) { + return 0; } - const result = [...rangeMap.values()]; - cache2.set(memoKey, result); - return result; + return this.compareMain(other) || this.comparePre(other); } - intersects(range, options) { - if (!(range instanceof _Range)) { - throw new TypeError("a Range is required"); + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); } - return this.set.some((thisComparators) => { - return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { - return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); - } - // if ANY of the sets match ALL of its comparators, then pass - test(version2) { - if (!version2) { - return false; + if (this.major < other.major) { + return -1; } - if (typeof version2 === "string") { - try { - version2 = new SemVer3(version2, this.options); - } catch (er) { - return false; - } + if (this.major > other.major) { + return 1; } - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version2, this.options)) { - return true; - } + if (this.minor < other.minor) { + return -1; } - return false; - } - }; - module2.exports = Range3; - var LRU = require_lrucache(); - var cache2 = new LRU(); - var parseOptions = require_parse_options(); - var Comparator = require_comparator(); - var debug2 = require_debug(); - var SemVer3 = require_semver(); - var { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace - } = require_re(); - var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(); - var isNullSet = (c) => c.value === "<0.0.0-0"; - var isAny = (c) => c.value === ""; - var isSatisfiable = (comparators, options) => { - let result = true; - const remainingComparators = comparators.slice(); - let testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); + if (this.minor > other.minor) { + return 1; + } + if (this.patch < other.patch) { + return -1; + } + if (this.patch > other.patch) { + return 1; + } + return 0; } - return result; - }; - var parseComparator = (comp, options) => { - comp = comp.replace(re[t.BUILD], ""); - debug2("comp", comp, options); - comp = replaceCarets(comp, options); - debug2("caret", comp); - comp = replaceTildes(comp, options); - debug2("tildes", comp); - comp = replaceXRanges(comp, options); - debug2("xrange", comp); - comp = replaceStars(comp, options); - debug2("stars", comp); - return comp; - }; - var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; - var replaceTildes = (comp, options) => { - return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); - }; - var replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; - return comp.replace(r, (_, M, m, p, pr) => { - debug2("tilde", comp, _, M, m, p, pr); - let ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; - } else if (isX(p)) { - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; - } else if (pr) { - debug2("replaceTilde pr", pr); - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } else { - ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); } - debug2("tilde return", ret); - return ret; - }); - }; - var replaceCarets = (comp, options) => { - return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); - }; - var replaceCaret = (comp, options) => { - debug2("caret", comp, options); - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - const z = options.includePrerelease ? "-0" : ""; - return comp.replace(r, (_, M, m, p, pr) => { - debug2("caret", comp, _, M, m, p, pr); - let ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; - } else if (isX(p)) { - if (M === "0") { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; + return compareIdentifiers(a, b); } - } else if (pr) { - debug2("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } + } while (++i); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug("build compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; } else { - ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + return compareIdentifiers(a, b); } - } else { - debug2("no pr"); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; + } while (++i); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); } - } else { - ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; } } - debug2("caret return", ret); - return ret; - }); - }; - var replaceXRanges = (comp, options) => { - debug2("replaceXRanges", comp, options); - return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); - }; - var replaceXRange = (comp, options) => { - comp = comp.trim(); - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug2("xRange", comp, ret, gtlt, M, m, p, pr); - const xM = isX(M); - const xm = xM || isX(m); - const xp = xm || isX(p); - const anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; - } - p = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; } else { - m = +m + 1; + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } } - } - if (gtlt === "<") { - pr = "-0"; - } - ret = `${gtlt + M}.${m}.${p}${pr}`; - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; - } else if (xp) { - ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; - } - debug2("xRange return", ret); - return ret; - }); - }; - var replaceStars = (comp, options) => { - debug2("replaceStars", comp, options); - return comp.trim().replace(re[t.STAR], ""); - }; - var replaceGTE0 = (comp, options) => { - debug2("replaceGTE0", comp, options); - return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); - }; - var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? "-0" : ""}`; - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; - } else if (fpr) { - from = `>=${from}`; - } else { - from = `>=${from}${incPr ? "-0" : ""}`; - } - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0`; - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0`; - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}`; - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0`; - } else { - to = `<=${to}`; - } - return `${from} ${to}`.trim(); - }; - var testSet = (set, version2, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version2)) { - return false; - } - } - if (version2.prerelease.length && !options.includePrerelease) { - for (let i = 0; i < set.length; i++) { - debug2(set[i].semver); - if (set[i].semver === Comparator.ANY) { - continue; - } - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver; - if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { - return true; + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } } + break; } + default: + throw new Error(`invalid increment argument: ${release}`); } - return false; + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; } - return true; }; + module2.exports = SemVer3; } }); -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/ranges/valid.js -var require_valid2 = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/ranges/valid.js"(exports2, module2) { +// node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "node_modules/semver/functions/compare.js"(exports2, module2) { "use strict"; - var Range3 = require_range(); - var validRange = (range, options) => { - try { - return new Range3(range, options).range || "*"; - } catch (er) { - return null; + var SemVer3 = require_semver(); + var compare = (a, b, loose) => new SemVer3(a, loose).compare(new SemVer3(b, loose)); + module2.exports = compare; + } +}); + +// node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + "node_modules/semver/functions/rcompare.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var rcompare = (a, b, loose) => compare(b, a, loose); + module2.exports = rcompare; + } +}); + +// node_modules/semver/functions/parse.js +var require_parse = __commonJS({ + "node_modules/semver/functions/parse.js"(exports2, module2) { + "use strict"; + var SemVer3 = require_semver(); + var parse4 = (version2, options, throwErrors = false) => { + if (version2 instanceof SemVer3) { + return version2; + } + try { + return new SemVer3(version2, options); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; } }; - module2.exports = validRange; + module2.exports = parse4; } }); -// .yarn/cache/ms-npm-2.1.3-81ff3cfac1-d924b57e73.zip/node_modules/ms/index.js -var require_ms = __commonJS({ - ".yarn/cache/ms-npm-2.1.3-81ff3cfac1-d924b57e73.zip/node_modules/ms/index.js"(exports2, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse4(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); +// node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + "node_modules/semver/functions/valid.js"(exports2, module2) { + "use strict"; + var parse4 = require_parse(); + var valid = (version2, options) => { + const v = parse4(version2, options); + return v ? v.version : null; }; - function parse4(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural2(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural2(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural2(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural2(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural2(ms, msAbs, n, name2) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name2 + (isPlural ? "s" : ""); - } + module2.exports = valid; } }); -// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/common.js -var require_common = __commonJS({ - ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/common.js"(exports2, module2) { - function setup(env2) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env2).forEach((key) => { - createDebug[key] = env2[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; +// node_modules/semver/internal/lrucache.js +var require_lrucache = __commonJS({ + "node_modules/semver/internal/lrucache.js"(exports2, module2) { + "use strict"; + var LRUCache = class { + constructor() { + this.max = 1e3; + this.map = /* @__PURE__ */ new Map(); } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug2(...args) { - if (!debug2.enabled) { - return; - } - const self2 = debug2; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); + get(key) { + const value = this.map.get(key); + if (value === void 0) { + return void 0; + } else { + this.map.delete(key); + this.map.set(key, value); + return value; } - debug2.namespace = namespace; - debug2.useColors = createDebug.useColors(); - debug2.color = createDebug.selectColor(namespace); - debug2.extend = extend; - debug2.destroy = createDebug.destroy; - Object.defineProperty(debug2, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; + } + delete(key) { + return this.map.delete(key); + } + set(key, value) { + const deleted = this.delete(key); + if (!deleted && value !== void 0) { + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value; + this.delete(firstKey); } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug2); + this.map.set(key, value); } - return debug2; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + return this; } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns of split) { - if (ns[0] === "-") { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); + }; + module2.exports = LRUCache; + } +}); + +// node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + "node_modules/semver/functions/eq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var eq = (a, b, loose) => compare(a, b, loose) === 0; + module2.exports = eq; + } +}); + +// node_modules/semver/functions/neq.js +var require_neq = __commonJS({ + "node_modules/semver/functions/neq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var neq = (a, b, loose) => compare(a, b, loose) !== 0; + module2.exports = neq; + } +}); + +// node_modules/semver/functions/gt.js +var require_gt = __commonJS({ + "node_modules/semver/functions/gt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gt = (a, b, loose) => compare(a, b, loose) > 0; + module2.exports = gt; + } +}); + +// node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "node_modules/semver/functions/gte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gte = (a, b, loose) => compare(a, b, loose) >= 0; + module2.exports = gte; + } +}); + +// node_modules/semver/functions/lt.js +var require_lt = __commonJS({ + "node_modules/semver/functions/lt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lt = (a, b, loose) => compare(a, b, loose) < 0; + module2.exports = lt; + } +}); + +// node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + "node_modules/semver/functions/lte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lte = (a, b, loose) => compare(a, b, loose) <= 0; + module2.exports = lte; + } +}); + +// node_modules/semver/functions/cmp.js +var require_cmp = __commonJS({ + "node_modules/semver/functions/cmp.js"(exports2, module2) { + "use strict"; + var eq = require_eq(); + var neq = require_neq(); + var gt = require_gt(); + var gte = require_gte(); + var lt = require_lt(); + var lte = require_lte(); + var cmp = (a, op, b, loose) => { + switch (op) { + case "===": + if (typeof a === "object") { + a = a.version; } - } + if (typeof b === "object") { + b = b.version; + } + return a === b; + case "!==": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a !== b; + case "": + case "=": + case "==": + return eq(a, b, loose); + case "!=": + return neq(a, b, loose); + case ">": + return gt(a, b, loose); + case ">=": + return gte(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError(`Invalid operator: ${op}`); } - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { - if (template[templateIndex] === "*") { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; + }; + module2.exports = cmp; + } +}); + +// node_modules/semver/classes/comparator.js +var require_comparator = __commonJS({ + "node_modules/semver/classes/comparator.js"(exports2, module2) { + "use strict"; + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); + var Comparator = class _Comparator { + static get ANY() { + return ANY; + } + constructor(comp, options) { + options = parseOptions(options); + if (comp instanceof _Comparator) { + if (comp.loose === !!options.loose) { + return comp; } else { - return false; + comp = comp.value; } } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; + comp = comp.trim().split(/\s+/).join(" "); + debug("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; } - return templateIndex === template.length; + debug("comp", this); } - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; + parse(comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + const m = comp.match(r); + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`); + } + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; + } + if (!m[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer3(m[2], this.options.loose); + } } - function enabled(name2) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name2, skip)) { + toString() { + return this.value; + } + test(version2) { + debug("Comparator.test", version2, this.options.loose); + if (this.semver === ANY || version2 === ANY) { + return true; + } + if (typeof version2 === "string") { + try { + version2 = new SemVer3(version2, this.options); + } catch (er) { return false; } } - for (const ns of createDebug.names) { - if (matchesTemplate(name2, ns)) { + return cmp(version2, this.operator, this.semver, this.options); + } + intersects(comp, options) { + if (!(comp instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); + } + if (this.operator === "") { + if (this.value === "") { + return true; + } + return new Range3(comp.value, options).test(this.value); + } else if (comp.operator === "") { + if (comp.value === "") { return true; } + return new Range3(this.value, options).test(comp.semver); } - return false; - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { + return false; } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { + return false; + } + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; + } + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; + } + if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { + return true; + } + if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { + return true; + } + if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { + return true; + } + return false; } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; + }; + module2.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re, t } = require_re(); + var cmp = require_cmp(); + var debug = require_debug(); + var SemVer3 = require_semver(); + var Range3 = require_range(); } }); -// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/browser.js -var require_browser = __commonJS({ - ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/browser.js"(exports2, module2) { - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = /* @__PURE__ */ (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); +// node_modules/semver/classes/range.js +var require_range = __commonJS({ + "node_modules/semver/classes/range.js"(exports2, module2) { + "use strict"; + var SPACE_CHARACTERS = /\s+/g; + var Range3 = class _Range { + constructor(range, options) { + options = parseOptions(options); + if (range instanceof _Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new _Range(range.raw, options); + } } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; + if (range instanceof Comparator) { + this.raw = range.value; + this.set = [[range]]; + this.formatted = void 0; + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().replace(SPACE_CHARACTERS, " "); + this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first = this.set[0]; + this.set = this.set.filter((c) => !isNullSet(c[0])); + if (this.set.length === 0) { + this.set = [first]; + } else if (this.set.length > 1) { + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c]; + break; + } + } + } + } + this.formatted = void 0; } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; + get range() { + if (this.formatted === void 0) { + this.formatted = ""; + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += "||"; + } + const comps = this.set[i]; + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += " "; + } + this.formatted += comps[k].toString().trim(); + } + } + } + return this.formatted; } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; + format() { + return this.range; } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; + toString() { + return this.range; + } + parseRange(range) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range; + const cached = cache2.get(memoKey); + if (cached) { + return cached; } - index++; - if (match === "%c") { - lastC = index; + const loose = this.options.loose; + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug("hyphen replace", range); + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug("comparator trim", range); + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + debug("tilde trim", range); + range = range.replace(re[t.CARETTRIM], caretTrimReplace); + debug("caret trim", range); + let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); + if (loose) { + rangeList = rangeList.filter((comp) => { + debug("loose invalid filter", comp, this.options); + return !!comp.match(re[t.COMPARATORLOOSE]); + }); } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); + debug("range list", rangeList); + const rangeMap = /* @__PURE__ */ new Map(); + const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp]; + } + rangeMap.set(comp.value, comp); } - } catch (error) { + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } + const result = [...rangeMap.values()]; + cache2.set(memoKey, result); + return result; } - } - function load() { - let r; - try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error) { + intersects(range, options) { + if (!(range instanceof _Range)) { + throw new TypeError("a Range is required"); + } + return this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + // if ANY of the sets match ALL of its comparators, then pass + test(version2) { + if (!version2) { + return false; + } + if (typeof version2 === "string") { + try { + version2 = new SemVer3(version2, this.options); + } catch (er) { + return false; + } + } + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version2, this.options)) { + return true; + } + } + return false; } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { + }; + module2.exports = Range3; + var LRU = require_lrucache(); + var cache2 = new LRU(); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug = require_debug(); + var SemVer3 = require_semver(); + var { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants2(); + var isNullSet = (c) => c.value === "<0.0.0-0"; + var isAny = (c) => c.value === ""; + var isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); + testComparator = remainingComparators.pop(); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; + return result; + }; + var parseComparator = (comp, options) => { + comp = comp.replace(re[t.BUILD], ""); + debug("comp", comp, options); + comp = replaceCarets(comp, options); + debug("caret", comp); + comp = replaceTildes(comp, options); + debug("tildes", comp); + comp = replaceXRanges(comp, options); + debug("xrange", comp); + comp = replaceStars(comp, options); + debug("stars", comp); + return comp; + }; + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var replaceTildes = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); + }; + var replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; + return comp.replace(r, (_, M, m, p, pr) => { + debug("tilde", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p)) { + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; + } else if (pr) { + debug("replaceTilde pr", pr); + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + } + debug("tilde return", ret); + return ret; + }); + }; + var replaceCarets = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); + }; + var replaceCaret = (comp, options) => { + debug("caret", comp, options); + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r, (_, M, m, p, pr) => { + debug("caret", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p)) { + if (M === "0") { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; + } + } else if (pr) { + debug("replaceCaret pr", pr); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + } + } else { + debug("no pr"); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + } + } + debug("caret return", ret); + return ret; + }); + }; + var replaceXRanges = (comp, options) => { + debug("replaceXRanges", comp, options); + return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); + }; + var replaceXRange = (comp, options) => { + comp = comp.trim(); + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug("xRange", comp, ret, gtlt, M, m, p, pr); + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; + } + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; + } + } else if (gtlt && anyX) { + if (xm) { + m = 0; + } + p = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else { + m = +m + 1; + p = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; + } + } + if (gtlt === "<") { + pr = "-0"; + } + ret = `${gtlt + M}.${m}.${p}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; + } + debug("xRange return", ret); + return ret; + }); + }; + var replaceStars = (comp, options) => { + debug("replaceStars", comp, options); + return comp.trim().replace(re[t.STAR], ""); + }; + var replaceGTE0 = (comp, options) => { + debug("replaceGTE0", comp, options); + return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); + }; + var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } + if (isX(tM)) { + to = ""; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }; + var testSet = (set, version2, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version2)) { + return false; + } + } + if (version2.prerelease.length && !options.includePrerelease) { + for (let i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === Comparator.ANY) { + continue; + } + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver; + if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { + return true; + } + } + } + return false; } + return true; }; } }); -// .yarn/cache/supports-color-npm-10.2.2-e43ac15f9f-fb28dd7e0c.zip/node_modules/supports-color/index.js -var supports_color_exports = {}; -__export(supports_color_exports, { - createSupportsColor: () => createSupportsColor, - default: () => supports_color_default -}); -function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -} -function envForceColor() { - if (!("FORCE_COLOR" in env)) { - return; - } - if (env.FORCE_COLOR === "true") { - return 1; - } - if (env.FORCE_COLOR === "false") { - return 0; - } - if (env.FORCE_COLOR.length === 0) { - return 1; +// node_modules/semver/ranges/valid.js +var require_valid2 = __commonJS({ + "node_modules/semver/ranges/valid.js"(exports2, module2) { + "use strict"; + var Range3 = require_range(); + var validRange = (range, options) => { + try { + return new Range3(range, options).range || "*"; + } catch (er) { + return null; + } + }; + module2.exports = validRange; } - const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); - if (![0, 1, 2, 3].includes(level)) { - return; - } - return level; -} -function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} -function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { - const noFlagForceColor = envForceColor(); - if (noFlagForceColor !== void 0) { - flagForceColor = noFlagForceColor; - } - const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; - if (forceColor === 0) { - return 0; - } - if (sniffFlags) { - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - } - if ("TF_BUILD" in env && "AGENT_NAME" in env) { - return 1; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (import_node_process.default.platform === "win32") { - const osRelease = import_node_os.default.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) { - return 3; +}); + +// node_modules/ms/index.js +var require_ms = __commonJS({ + "node_modules/ms/index.js"(exports2, module2) { + var s = 1e3; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse4(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse4(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n * y; + case "weeks": + case "week": + case "w": + return n * w; + case "days": + case "day": + case "d": + return n * d; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n * h; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n * m; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n * s; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n; + default: + return void 0; + } } - if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + "d"; + } + if (msAbs >= h) { + return Math.round(ms / h) + "h"; + } + if (msAbs >= m) { + return Math.round(ms / m) + "m"; + } + if (msAbs >= s) { + return Math.round(ms / s) + "s"; + } + return ms + "ms"; } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if (env.TERM === "xterm-kitty") { - return 3; - } - if (env.TERM === "xterm-ghostty") { - return 3; - } - if (env.TERM === "wezterm") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": { - return version2 >= 3 ? 3 : 2; + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural2(ms, msAbs, d, "day"); } - case "Apple_Terminal": { - return 2; + if (msAbs >= h) { + return plural2(ms, msAbs, h, "hour"); + } + if (msAbs >= m) { + return plural2(ms, msAbs, m, "minute"); + } + if (msAbs >= s) { + return plural2(ms, msAbs, s, "second"); } + return ms + " ms"; } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; -} -function createSupportsColor(stream, options = {}) { - const level = _supportsColor(stream, { - streamIsTTY: stream && stream.isTTY, - ...options - }); - return translateLevel(level); -} -var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default; -var init_supports_color = __esm({ - ".yarn/cache/supports-color-npm-10.2.2-e43ac15f9f-fb28dd7e0c.zip/node_modules/supports-color/index.js"() { - import_node_process = __toESM(require("node:process"), 1); - import_node_os = __toESM(require("node:os"), 1); - import_node_tty = __toESM(require("node:tty"), 1); - ({ env } = import_node_process.default); - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - flagForceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - flagForceColor = 1; + function plural2(ms, msAbs, n, name2) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name2 + (isPlural ? "s" : ""); } - supportsColor = { - stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), - stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) - }; - supports_color_default = supportsColor; } }); -// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/node.js -var require_node2 = __commonJS({ - ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/node.js"(exports2, module2) { - var tty2 = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log2; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.destroy = util.deprecate( - () => { - }, - "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." - ); - exports2.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor2 = (init_supports_color(), __toCommonJS(supports_color_exports)); - if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) { - exports2.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports2.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); +// node_modules/debug/src/common.js +var require_common = __commonJS({ + "node_modules/debug/src/common.js"(exports2, module2) { + function setup(env2) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require_ms(); + createDebug.destroy = destroy; + Object.keys(env2).forEach((key) => { + createDebug[key] = env2[key]; }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty2.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name2, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name2} \x1B[0m`; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name2 + " " + args[0]; - } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; - } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log2(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init(debug2) { - debug2.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); - }; - } -}); - -// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/index.js -var require_src = __commonJS({ - ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/index.js"(exports2, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node2(); - } - } -}); - -// .yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-fe7dd8b1bd.zip/node_modules/proxy-from-env/index.js -var require_proxy_from_env = __commonJS({ - ".yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-fe7dd8b1bd.zip/node_modules/proxy-from-env/index.js"(exports2) { - "use strict"; - var parseUrl = require("url").parse; - var DEFAULT_PORTS = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var stringEndsWith = String.prototype.endsWith || function(s) { - return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; - }; - function getProxyForUrl(url) { - var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { - return ""; - } - proto = proto.split(":", 1)[0]; - hostname = hostname.replace(/:\d*$/, ""); - port = parseInt(port) || DEFAULT_PORTS[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ""; - } - var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); - if (proxy && proxy.indexOf("://") === -1) { - proxy = proto + "://" + proxy; - } - return proxy; - } - function shouldProxy(hostname, port) { - var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); - if (!NO_PROXY) { - return true; - } - if (NO_PROXY === "*") { - return false; - } - return NO_PROXY.split(/[,\s]/).every(function(proxy) { - if (!proxy) { - return true; - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; } - if (!/^[.*]/.test(parsedProxyHostname)) { - return hostname !== parsedProxyHostname; + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug(...args) { + if (!debug.enabled) { + return; + } + const self2 = debug; + const curr = Number(/* @__PURE__ */ new Date()); + const ms = curr - (prevTime || curr); + self2.diff = ms; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== "string") { + args.unshift("%O"); + } + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); } - if (parsedProxyHostname.charAt(0) === "*") { - parsedProxyHostname = parsedProxyHostname.slice(1); + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; + Object.defineProperty(debug, "enabled", { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, + set: (v) => { + enableOverride = v; + } + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug); } - return !stringEndsWith.call(hostname, parsedProxyHostname); - }); - } - function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; - } - exports2.getProxyForUrl = getProxyForUrl; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/errors.js -var require_errors = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/errors.js"(exports2, module2) { - "use strict"; - var kUndiciError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR"); - var UndiciError = class extends Error { - constructor(message) { - super(message); - this.name = "UndiciError"; - this.code = "UND_ERR"; + return debug; } - static [Symbol.hasInstance](instance) { - return instance && instance[kUndiciError] === true; + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; } - [kUndiciError] = true; - }; - var kConnectTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"); - var ConnectTimeoutError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ConnectTimeoutError"; - this.message = message || "Connect Timeout Error"; - this.code = "UND_ERR_CONNECT_TIMEOUT"; + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + createDebug.names = []; + createDebug.skips = []; + const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns of split) { + if (ns[0] === "-") { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } } - static [Symbol.hasInstance](instance) { - return instance && instance[kConnectTimeoutError] === true; - } - [kConnectTimeoutError] = true; - }; - var kHeadersTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"); - var HeadersTimeoutError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "HeadersTimeoutError"; - this.message = message || "Headers Timeout Error"; - this.code = "UND_ERR_HEADERS_TIMEOUT"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kHeadersTimeoutError] === true; - } - [kHeadersTimeoutError] = true; - }; - var kHeadersOverflowError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"); - var HeadersOverflowError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "HeadersOverflowError"; - this.message = message || "Headers Overflow Error"; - this.code = "UND_ERR_HEADERS_OVERFLOW"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kHeadersOverflowError] === true; - } - [kHeadersOverflowError] = true; - }; - var kBodyTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"); - var BodyTimeoutError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "BodyTimeoutError"; - this.message = message || "Body Timeout Error"; - this.code = "UND_ERR_BODY_TIMEOUT"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kBodyTimeoutError] === true; - } - [kBodyTimeoutError] = true; - }; - var kResponseStatusCodeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"); - var ResponseStatusCodeError = class extends UndiciError { - constructor(message, statusCode, headers, body) { - super(message); - this.name = "ResponseStatusCodeError"; - this.message = message || "Response Status Code Error"; - this.code = "UND_ERR_RESPONSE_STATUS_CODE"; - this.body = body; - this.status = statusCode; - this.statusCode = statusCode; - this.headers = headers; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseStatusCodeError] === true; - } - [kResponseStatusCodeError] = true; - }; - var kInvalidArgumentError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_ARG"); - var InvalidArgumentError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "InvalidArgumentError"; - this.message = message || "Invalid Argument Error"; - this.code = "UND_ERR_INVALID_ARG"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kInvalidArgumentError] === true; - } - [kInvalidArgumentError] = true; - }; - var kInvalidReturnValueError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"); - var InvalidReturnValueError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "InvalidReturnValueError"; - this.message = message || "Invalid Return Value Error"; - this.code = "UND_ERR_INVALID_RETURN_VALUE"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kInvalidReturnValueError] === true; - } - [kInvalidReturnValueError] = true; - }; - var kAbortError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORT"); - var AbortError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "AbortError"; - this.message = message || "The operation was aborted"; - this.code = "UND_ERR_ABORT"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kAbortError] === true; - } - [kAbortError] = true; - }; - var kRequestAbortedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORTED"); - var RequestAbortedError = class extends AbortError { - constructor(message) { - super(message); - this.name = "AbortError"; - this.message = message || "Request aborted"; - this.code = "UND_ERR_ABORTED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kRequestAbortedError] === true; - } - [kRequestAbortedError] = true; - }; - var kInformationalError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INFO"); - var InformationalError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "InformationalError"; - this.message = message || "Request information"; - this.code = "UND_ERR_INFO"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kInformationalError] === true; - } - [kInformationalError] = true; - }; - var kRequestContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"); - var RequestContentLengthMismatchError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "RequestContentLengthMismatchError"; - this.message = message || "Request body length does not match content-length header"; - this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kRequestContentLengthMismatchError] === true; - } - [kRequestContentLengthMismatchError] = true; - }; - var kResponseContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"); - var ResponseContentLengthMismatchError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ResponseContentLengthMismatchError"; - this.message = message || "Response body length does not match content-length header"; - this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseContentLengthMismatchError] === true; - } - [kResponseContentLengthMismatchError] = true; - }; - var kClientDestroyedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_DESTROYED"); - var ClientDestroyedError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ClientDestroyedError"; - this.message = message || "The client is destroyed"; - this.code = "UND_ERR_DESTROYED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kClientDestroyedError] === true; - } - [kClientDestroyedError] = true; - }; - var kClientClosedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CLOSED"); - var ClientClosedError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ClientClosedError"; - this.message = message || "The client is closed"; - this.code = "UND_ERR_CLOSED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kClientClosedError] === true; - } - [kClientClosedError] = true; - }; - var kSocketError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_SOCKET"); - var SocketError = class extends UndiciError { - constructor(message, socket) { - super(message); - this.name = "SocketError"; - this.message = message || "Socket error"; - this.code = "UND_ERR_SOCKET"; - this.socket = socket; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kSocketError] === true; - } - [kSocketError] = true; - }; - var kNotSupportedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"); - var NotSupportedError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "NotSupportedError"; - this.message = message || "Not supported error"; - this.code = "UND_ERR_NOT_SUPPORTED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kNotSupportedError] === true; - } - [kNotSupportedError] = true; - }; - var kBalancedPoolMissingUpstreamError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"); - var BalancedPoolMissingUpstreamError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "MissingUpstreamError"; - this.message = message || "No upstream has been added to the BalancedPool"; - this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kBalancedPoolMissingUpstreamError] === true; - } - [kBalancedPoolMissingUpstreamError] = true; - }; - var kHTTPParserError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HTTP_PARSER"); - var HTTPParserError = class extends Error { - constructor(message, code2, data) { - super(message); - this.name = "HTTPParserError"; - this.code = code2 ? `HPE_${code2}` : void 0; - this.data = data ? data.toString() : void 0; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kHTTPParserError] === true; - } - [kHTTPParserError] = true; - }; - var kResponseExceededMaxSizeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"); - var ResponseExceededMaxSizeError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "ResponseExceededMaxSizeError"; - this.message = message || "Response content exceeded max size"; - this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseExceededMaxSizeError] === true; - } - [kResponseExceededMaxSizeError] = true; - }; - var kRequestRetryError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_RETRY"); - var RequestRetryError = class extends UndiciError { - constructor(message, code2, { headers, data }) { - super(message); - this.name = "RequestRetryError"; - this.message = message || "Request retry error"; - this.code = "UND_ERR_REQ_RETRY"; - this.statusCode = code2; - this.data = data; - this.headers = headers; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kRequestRetryError] === true; - } - [kRequestRetryError] = true; - }; - var kResponseError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE"); - var ResponseError = class extends UndiciError { - constructor(message, code2, { headers, data }) { - super(message); - this.name = "ResponseError"; - this.message = message || "Response error"; - this.code = "UND_ERR_RESPONSE"; - this.statusCode = code2; - this.data = data; - this.headers = headers; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kResponseError] === true; - } - [kResponseError] = true; - }; - var kSecureProxyConnectionError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_PRX_TLS"); - var SecureProxyConnectionError = class extends UndiciError { - constructor(cause, message, options) { - super(message, { cause, ...options ?? {} }); - this.name = "SecureProxyConnectionError"; - this.message = message || "Secure Proxy Connection failed"; - this.code = "UND_ERR_PRX_TLS"; - this.cause = cause; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kSecureProxyConnectionError] === true; - } - [kSecureProxyConnectionError] = true; - }; - var kMessageSizeExceededError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"); - var MessageSizeExceededError = class extends UndiciError { - constructor(message) { - super(message); - this.name = "MessageSizeExceededError"; - this.message = message || "Max decompressed message size exceeded"; - this.code = "UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"; - } - static [Symbol.hasInstance](instance) { - return instance && instance[kMessageSizeExceededError] === true; - } - get [kMessageSizeExceededError]() { - return true; - } - }; - module2.exports = { - AbortError, - HTTPParserError, - UndiciError, - HeadersTimeoutError, - HeadersOverflowError, - BodyTimeoutError, - RequestContentLengthMismatchError, - ConnectTimeoutError, - ResponseStatusCodeError, - InvalidArgumentError, - InvalidReturnValueError, - RequestAbortedError, - ClientDestroyedError, - ClientClosedError, - InformationalError, - SocketError, - NotSupportedError, - ResponseContentLengthMismatchError, - BalancedPoolMissingUpstreamError, - ResponseExceededMaxSizeError, - RequestRetryError, - ResponseError, - SecureProxyConnectionError, - MessageSizeExceededError - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/symbols.js -var require_symbols = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/symbols.js"(exports2, module2) { - module2.exports = { - kClose: /* @__PURE__ */ Symbol("close"), - kDestroy: /* @__PURE__ */ Symbol("destroy"), - kDispatch: /* @__PURE__ */ Symbol("dispatch"), - kUrl: /* @__PURE__ */ Symbol("url"), - kWriting: /* @__PURE__ */ Symbol("writing"), - kResuming: /* @__PURE__ */ Symbol("resuming"), - kQueue: /* @__PURE__ */ Symbol("queue"), - kConnect: /* @__PURE__ */ Symbol("connect"), - kConnecting: /* @__PURE__ */ Symbol("connecting"), - kKeepAliveDefaultTimeout: /* @__PURE__ */ Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: /* @__PURE__ */ Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: /* @__PURE__ */ Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: /* @__PURE__ */ Symbol("keep alive timeout"), - kKeepAlive: /* @__PURE__ */ Symbol("keep alive"), - kHeadersTimeout: /* @__PURE__ */ Symbol("headers timeout"), - kBodyTimeout: /* @__PURE__ */ Symbol("body timeout"), - kServerName: /* @__PURE__ */ Symbol("server name"), - kLocalAddress: /* @__PURE__ */ Symbol("local address"), - kHost: /* @__PURE__ */ Symbol("host"), - kNoRef: /* @__PURE__ */ Symbol("no ref"), - kBodyUsed: /* @__PURE__ */ Symbol("used"), - kBody: /* @__PURE__ */ Symbol("abstracted request body"), - kRunning: /* @__PURE__ */ Symbol("running"), - kBlocking: /* @__PURE__ */ Symbol("blocking"), - kPending: /* @__PURE__ */ Symbol("pending"), - kSize: /* @__PURE__ */ Symbol("size"), - kBusy: /* @__PURE__ */ Symbol("busy"), - kQueued: /* @__PURE__ */ Symbol("queued"), - kFree: /* @__PURE__ */ Symbol("free"), - kConnected: /* @__PURE__ */ Symbol("connected"), - kClosed: /* @__PURE__ */ Symbol("closed"), - kNeedDrain: /* @__PURE__ */ Symbol("need drain"), - kReset: /* @__PURE__ */ Symbol("reset"), - kDestroyed: /* @__PURE__ */ Symbol.for("nodejs.stream.destroyed"), - kResume: /* @__PURE__ */ Symbol("resume"), - kOnError: /* @__PURE__ */ Symbol("on error"), - kMaxHeadersSize: /* @__PURE__ */ Symbol("max headers size"), - kRunningIdx: /* @__PURE__ */ Symbol("running index"), - kPendingIdx: /* @__PURE__ */ Symbol("pending index"), - kError: /* @__PURE__ */ Symbol("error"), - kClients: /* @__PURE__ */ Symbol("clients"), - kClient: /* @__PURE__ */ Symbol("client"), - kParser: /* @__PURE__ */ Symbol("parser"), - kOnDestroyed: /* @__PURE__ */ Symbol("destroy callbacks"), - kPipelining: /* @__PURE__ */ Symbol("pipelining"), - kSocket: /* @__PURE__ */ Symbol("socket"), - kHostHeader: /* @__PURE__ */ Symbol("host header"), - kConnector: /* @__PURE__ */ Symbol("connector"), - kStrictContentLength: /* @__PURE__ */ Symbol("strict content length"), - kMaxRedirections: /* @__PURE__ */ Symbol("maxRedirections"), - kMaxRequests: /* @__PURE__ */ Symbol("maxRequestsPerClient"), - kProxy: /* @__PURE__ */ Symbol("proxy agent options"), - kCounter: /* @__PURE__ */ Symbol("socket request counter"), - kInterceptors: /* @__PURE__ */ Symbol("dispatch interceptors"), - kMaxResponseSize: /* @__PURE__ */ Symbol("max response size"), - kHTTP2Session: /* @__PURE__ */ Symbol("http2Session"), - kHTTP2SessionState: /* @__PURE__ */ Symbol("http2Session state"), - kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), - kConstruct: /* @__PURE__ */ Symbol("constructable"), - kListeners: /* @__PURE__ */ Symbol("listeners"), - kHTTPContext: /* @__PURE__ */ Symbol("http context"), - kMaxConcurrentStreams: /* @__PURE__ */ Symbol("max concurrent streams"), - kNoProxyAgent: /* @__PURE__ */ Symbol("no proxy agent"), - kHttpProxyAgent: /* @__PURE__ */ Symbol("http proxy agent"), - kHttpsProxyAgent: /* @__PURE__ */ Symbol("https proxy agent") - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/constants.js -var require_constants2 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/constants.js"(exports2, module2) { - "use strict"; - var headerNameLowerCasedRecord = {}; - var wellknownHeaderNames = [ - "Accept", - "Accept-Encoding", - "Accept-Language", - "Accept-Ranges", - "Access-Control-Allow-Credentials", - "Access-Control-Allow-Headers", - "Access-Control-Allow-Methods", - "Access-Control-Allow-Origin", - "Access-Control-Expose-Headers", - "Access-Control-Max-Age", - "Access-Control-Request-Headers", - "Access-Control-Request-Method", - "Age", - "Allow", - "Alt-Svc", - "Alt-Used", - "Authorization", - "Cache-Control", - "Clear-Site-Data", - "Connection", - "Content-Disposition", - "Content-Encoding", - "Content-Language", - "Content-Length", - "Content-Location", - "Content-Range", - "Content-Security-Policy", - "Content-Security-Policy-Report-Only", - "Content-Type", - "Cookie", - "Cross-Origin-Embedder-Policy", - "Cross-Origin-Opener-Policy", - "Cross-Origin-Resource-Policy", - "Date", - "Device-Memory", - "Downlink", - "ECT", - "ETag", - "Expect", - "Expect-CT", - "Expires", - "Forwarded", - "From", - "Host", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Range", - "If-Unmodified-Since", - "Keep-Alive", - "Last-Modified", - "Link", - "Location", - "Max-Forwards", - "Origin", - "Permissions-Policy", - "Pragma", - "Proxy-Authenticate", - "Proxy-Authorization", - "RTT", - "Range", - "Referer", - "Referrer-Policy", - "Refresh", - "Retry-After", - "Sec-WebSocket-Accept", - "Sec-WebSocket-Extensions", - "Sec-WebSocket-Key", - "Sec-WebSocket-Protocol", - "Sec-WebSocket-Version", - "Server", - "Server-Timing", - "Service-Worker-Allowed", - "Service-Worker-Navigation-Preload", - "Set-Cookie", - "SourceMap", - "Strict-Transport-Security", - "Supports-Loading-Mode", - "TE", - "Timing-Allow-Origin", - "Trailer", - "Transfer-Encoding", - "Upgrade", - "Upgrade-Insecure-Requests", - "User-Agent", - "Vary", - "Via", - "WWW-Authenticate", - "X-Content-Type-Options", - "X-DNS-Prefetch-Control", - "X-Frame-Options", - "X-Permitted-Cross-Domain-Policies", - "X-Powered-By", - "X-Requested-With", - "X-XSS-Protection" - ]; - for (let i = 0; i < wellknownHeaderNames.length; ++i) { - const key = wellknownHeaderNames[i]; - const lowerCasedKey = key.toLowerCase(); - headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey; - } - Object.setPrototypeOf(headerNameLowerCasedRecord, null); - module2.exports = { - wellknownHeaderNames, - headerNameLowerCasedRecord - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/tree.js -var require_tree = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/tree.js"(exports2, module2) { - "use strict"; - var { - wellknownHeaderNames, - headerNameLowerCasedRecord - } = require_constants2(); - var TstNode = class _TstNode { - /** @type {any} */ - value = null; - /** @type {null | TstNode} */ - left = null; - /** @type {null | TstNode} */ - middle = null; - /** @type {null | TstNode} */ - right = null; - /** @type {number} */ - code; - /** - * @param {string} key - * @param {any} value - * @param {number} index - */ - constructor(key, value, index) { - if (index === void 0 || index >= key.length) { - throw new TypeError("Unreachable"); - } - const code2 = this.code = key.charCodeAt(index); - if (code2 > 127) { - throw new TypeError("key must be ascii string"); - } - if (key.length !== ++index) { - this.middle = new _TstNode(key, value, index); - } else { - this.value = value; - } - } - /** - * @param {string} key - * @param {any} value - */ - add(key, value) { - const length = key.length; - if (length === 0) { - throw new TypeError("Unreachable"); - } - let index = 0; - let node = this; - while (true) { - const code2 = key.charCodeAt(index); - if (code2 > 127) { - throw new TypeError("key must be ascii string"); - } - if (node.code === code2) { - if (length === ++index) { - node.value = value; - break; - } else if (node.middle !== null) { - node = node.middle; - } else { - node.middle = new _TstNode(key, value, index); - break; - } - } else if (node.code < code2) { - if (node.left !== null) { - node = node.left; + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { + if (template[templateIndex] === "*") { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; } else { - node.left = new _TstNode(key, value, index); - break; + searchIndex++; + templateIndex++; } - } else if (node.right !== null) { - node = node.right; + } else if (starIndex !== -1) { + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; } else { - node.right = new _TstNode(key, value, index); - break; + return false; } } + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; } - /** - * @param {Uint8Array} key - * @return {TstNode | null} - */ - search(key) { - const keylength = key.length; - let index = 0; - let node = this; - while (node !== null && index < keylength) { - let code2 = key[index]; - if (code2 <= 90 && code2 >= 65) { - code2 |= 32; + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; + } + function enabled(name2) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name2, skip)) { + return false; } - while (node !== null) { - if (code2 === node.code) { - if (keylength === ++index) { - return node; - } - node = node.middle; - break; - } - node = node.code < code2 ? node.left : node.right; + } + for (const ns of createDebug.names) { + if (matchesTemplate(name2, ns)) { + return true; } } - return null; + return false; } - }; - var TernarySearchTree = class { - /** @type {TstNode | null} */ - node = null; - /** - * @param {string} key - * @param {any} value - * */ - insert(key, value) { - if (this.node === null) { - this.node = new TstNode(key, value, 0); - } else { - this.node.add(key, value); + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; } + return val; } - /** - * @param {Uint8Array} key - * @return {any} - */ - lookup(key) { - return this.node?.search(key)?.value ?? null; + function destroy() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } - }; - var tree = new TernarySearchTree(); - for (let i = 0; i < wellknownHeaderNames.length; ++i) { - const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]; - tree.insert(key, key); + createDebug.enable(createDebug.load()); + return createDebug; } - module2.exports = { - TernarySearchTree, - tree - }; + module2.exports = setup; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/util.js -var require_util = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/util.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); - var { IncomingMessage } = require("node:http"); - var stream = require("node:stream"); - var net = require("node:net"); - var { Blob: Blob2 } = require("node:buffer"); - var nodeUtil = require("node:util"); - var { stringify } = require("node:querystring"); - var { EventEmitter: EE3 } = require("node:events"); - var { InvalidArgumentError } = require_errors(); - var { headerNameLowerCasedRecord } = require_constants2(); - var { tree } = require_tree(); - var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); - var BodyAsyncIterable = class { - constructor(body) { - this[kBody] = body; - this[kBodyUsed] = false; - } - async *[Symbol.asyncIterator]() { - assert5(!this[kBodyUsed], "disturbed"); - this[kBodyUsed] = true; - yield* this[kBody]; - } - }; - function wrapRequestBody(body) { - if (isStream2(body)) { - if (bodyLength(body) === 0) { - body.on("data", function() { - assert5(false); - }); - } - if (typeof body.readableDidRead !== "boolean") { - body[kBodyUsed] = false; - EE3.prototype.on.call(body, "data", function() { - this[kBodyUsed] = true; - }); - } - return body; - } else if (body && typeof body.pipeTo === "function") { - return new BodyAsyncIterable(body); - } else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable(body)) { - return new BodyAsyncIterable(body); - } else { - return body; - } - } - function nop() { - } - function isStream2(obj) { - return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; - } - function isBlobLike(object) { - if (object === null) { - return false; - } else if (object instanceof Blob2) { - return true; - } else if (typeof object !== "object") { - return false; - } else { - const sTag = object[Symbol.toStringTag]; - return (sTag === "Blob" || sTag === "File") && ("stream" in object && typeof object.stream === "function" || "arrayBuffer" in object && typeof object.arrayBuffer === "function"); - } - } - function buildURL(url, queryParams) { - if (url.includes("?") || url.includes("#")) { - throw new Error('Query params cannot be passed when url already contains "?" or "#".'); - } - const stringified = stringify(queryParams); - if (stringified) { - url += "?" + stringified; - } - return url; - } - function isValidPort(port) { - const value = parseInt(port, 10); - return value === Number(port) && value >= 0 && value <= 65535; - } - function isHttpOrHttpsPrefixed(value) { - return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":"); - } - function parseURL(url) { - if (typeof url === "string") { - url = new URL(url); - if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { - throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); - } - return url; - } - if (!url || typeof url !== "object") { - throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); - } - if (!(url instanceof URL)) { - if (url.port != null && url.port !== "" && isValidPort(url.port) === false) { - throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer."); - } - if (url.path != null && typeof url.path !== "string") { - throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined."); - } - if (url.pathname != null && typeof url.pathname !== "string") { - throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); - } - if (url.hostname != null && typeof url.hostname !== "string") { - throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); - } - if (url.origin != null && typeof url.origin !== "string") { - throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); - } - if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { - throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); - } - const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; - let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`; - let path16 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; - if (origin[origin.length - 1] === "/") { - origin = origin.slice(0, origin.length - 1); - } - if (path16 && path16[0] !== "/") { - path16 = `/${path16}`; +// node_modules/debug/src/browser.js +var require_browser = __commonJS({ + "node_modules/debug/src/browser.js"(exports2, module2) { + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.storage = localstorage(); + exports2.destroy = /* @__PURE__ */ (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } - return new URL(`${origin}${path16}`); - } - if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { - throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); - } - return url; - } - function parseOrigin(url) { - url = parseURL(url); - if (url.pathname !== "/" || url.search || url.hash) { - throw new InvalidArgumentError("invalid url"); - } - return url; - } - function getHostname(host) { - if (host[0] === "[") { - const idx2 = host.indexOf("]"); - assert5(idx2 !== -1); - return host.substring(1, idx2); - } - const idx = host.indexOf(":"); - if (idx === -1) return host; - return host.substring(0, idx); - } - function getServerName(host) { - if (!host) { - return null; - } - assert5(typeof host === "string"); - const servername = getHostname(host); - if (net.isIP(servername)) { - return ""; + }; + })(); + exports2.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; } - return servername; - } - function deepClone(obj) { - return JSON.parse(JSON.stringify(obj)); - } - function isAsyncIterable(obj) { - return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); - } - function isIterable(obj) { - return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); - } - function bodyLength(body) { - if (body == null) { - return 0; - } else if (isStream2(body)) { - const state = body._readableState; - return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null; - } else if (isBlobLike(body)) { - return body.size != null ? body.size : null; - } else if (isBuffer(body)) { - return body.byteLength; + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; } - return null; - } - function isDestroyed(body) { - return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); + let m; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } - function destroy(stream2, err) { - if (stream2 == null || !isStream2(stream2) || isDestroyed(stream2)) { + function formatArgs(args) { + args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); + if (!this.useColors) { return; } - if (typeof stream2.destroy === "function") { - if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { - stream2.socket = null; - } - stream2.destroy(err); - } else if (err) { - queueMicrotask(() => { - stream2.emit("error", err); - }); - } - if (stream2.destroyed !== true) { - stream2[kDestroyed] = true; - } - } - var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val) { - const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); - return m ? parseInt(m[1], 10) * 1e3 : null; - } - function headerNameToString(value) { - return typeof value === "string" ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase(); - } - function bufferToLowerCasedHeaderName(value) { - return tree.lookup(value) ?? value.toString("latin1").toLowerCase(); - } - function parseHeaders(headers, obj) { - if (obj === void 0) obj = {}; - for (let i = 0; i < headers.length; i += 2) { - const key = headerNameToString(headers[i]); - let val = obj[key]; - if (val) { - if (typeof val === "string") { - val = [val]; - obj[key] = val; - } - val.push(headers[i + 1].toString("utf8")); - } else { - const headersValue = headers[i + 1]; - if (typeof headersValue === "string") { - obj[key] = headersValue; - } else { - obj[key] = Array.isArray(headersValue) ? headersValue.map((x) => x.toString("utf8")) : headersValue.toString("utf8"); - } - } - } - if ("content-length" in obj && "content-disposition" in obj) { - obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1"); - } - return obj; - } - function parseRawHeaders(headers) { - const len = headers.length; - const ret = new Array(len); - let hasContentLength = false; - let contentDispositionIdx = -1; - let key; - let val; - let kLen = 0; - for (let n = 0; n < headers.length; n += 2) { - key = headers[n]; - val = headers[n + 1]; - typeof key !== "string" && (key = key.toString()); - typeof val !== "string" && (val = val.toString("utf8")); - kLen = key.length; - if (kLen === 14 && key[7] === "-" && (key === "content-length" || key.toLowerCase() === "content-length")) { - hasContentLength = true; - } else if (kLen === 19 && key[7] === "-" && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = n + 1; - } - ret[n] = key; - ret[n + 1] = val; - } - if (hasContentLength && contentDispositionIdx !== -1) { - ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); - } - return ret; - } - function isBuffer(buffer) { - return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); - } - function validateHandler(handler, method, upgrade) { - if (!handler || typeof handler !== "object") { - throw new InvalidArgumentError("handler must be an object"); - } - if (typeof handler.onConnect !== "function") { - throw new InvalidArgumentError("invalid onConnect method"); - } - if (typeof handler.onError !== "function") { - throw new InvalidArgumentError("invalid onError method"); - } - if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) { - throw new InvalidArgumentError("invalid onBodySent method"); - } - if (upgrade || method === "CONNECT") { - if (typeof handler.onUpgrade !== "function") { - throw new InvalidArgumentError("invalid onUpgrade method"); - } - } else { - if (typeof handler.onHeaders !== "function") { - throw new InvalidArgumentError("invalid onHeaders method"); - } - if (typeof handler.onData !== "function") { - throw new InvalidArgumentError("invalid onData method"); + const c = "color: " + this.color; + args.splice(1, 0, c, "color: inherit"); + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; } - if (typeof handler.onComplete !== "function") { - throw new InvalidArgumentError("invalid onComplete method"); + index++; + if (match === "%c") { + lastC = index; } - } - } - function isDisturbed(body) { - return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); - } - function isErrored(body) { - return !!(body && stream.isErrored(body)); - } - function isReadable2(body) { - return !!(body && stream.isReadable(body)); - } - function getSocketInfo(socket) { - return { - localAddress: socket.localAddress, - localPort: socket.localPort, - remoteAddress: socket.remoteAddress, - remotePort: socket.remotePort, - remoteFamily: socket.remoteFamily, - timeout: socket.timeout, - bytesWritten: socket.bytesWritten, - bytesRead: socket.bytesRead - }; + }); + args.splice(lastC, 0, c); } - function ReadableStreamFrom(iterable) { - let iterator; - return new ReadableStream( - { - async start() { - iterator = iterable[Symbol.asyncIterator](); - }, - async pull(controller) { - const { done, value } = await iterator.next(); - if (done) { - queueMicrotask(() => { - controller.close(); - controller.byobRequest?.respond(0); - }); - } else { - const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); - if (buf.byteLength) { - controller.enqueue(new Uint8Array(buf)); - } - } - return controller.desiredSize > 0; - }, - async cancel(reason) { - await iterator.return(); - }, - type: "bytes" + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); } - ); - } - function isFormDataLike(object) { - return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData"; - } - function addAbortListener(signal, listener) { - if ("addEventListener" in signal) { - signal.addEventListener("abort", listener, { once: true }); - return () => signal.removeEventListener("abort", listener); - } - signal.addListener("abort", listener); - return () => signal.removeListener("abort", listener); - } - var hasToWellFormed = typeof String.prototype.toWellFormed === "function"; - var hasIsWellFormed = typeof String.prototype.isWellFormed === "function"; - function toUSVString(val) { - return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val); - } - function isUSVString(val) { - return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`; - } - function isTokenCharCode(c) { - switch (c) { - case 34: - case 40: - case 41: - case 44: - case 47: - case 58: - case 59: - case 60: - case 61: - case 62: - case 63: - case 64: - case 91: - case 92: - case 93: - case 123: - case 125: - return false; - default: - return c >= 33 && c <= 126; + } catch (error) { } } - function isValidHTTPToken(characters) { - if (characters.length === 0) { - return false; + function load() { + let r; + try { + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error) { } - for (let i = 0; i < characters.length; ++i) { - if (!isTokenCharCode(characters.charCodeAt(i))) { - return false; - } + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; } - return true; - } - var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - function isValidHeaderValue(characters) { - return !headerCharRegex.test(characters); - } - function parseRangeHeader(range) { - if (range == null || range === "") return { start: 0, end: null, size: null }; - const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null; - return m ? { - start: parseInt(m[1]), - end: m[2] ? parseInt(m[2]) : null, - size: m[3] ? parseInt(m[3]) : null - } : null; - } - function addListener(obj, name2, listener) { - const listeners = obj[kListeners] ??= []; - listeners.push([name2, listener]); - obj.on(name2, listener); - return obj; + return r; } - function removeAllListeners(obj) { - for (const [name2, listener] of obj[kListeners] ?? []) { - obj.removeListener(name2, listener); + function localstorage() { + try { + return localStorage; + } catch (error) { } - obj[kListeners] = null; } - function errorRequest(client, request, err) { + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { try { - request.onError(err); - assert5(request.aborted); - } catch (err2) { - client.emit("error", err2); + return JSON.stringify(v); + } catch (error) { + return "[UnexpectedJSONParseError]: " + error.message; } - } - var kEnumerableProperty = /* @__PURE__ */ Object.create(null); - kEnumerableProperty.enumerable = true; - var normalizedMethodRecordsBase = { - delete: "DELETE", - DELETE: "DELETE", - get: "GET", - GET: "GET", - head: "HEAD", - HEAD: "HEAD", - options: "OPTIONS", - OPTIONS: "OPTIONS", - post: "POST", - POST: "POST", - put: "PUT", - PUT: "PUT" - }; - var normalizedMethodRecords = { - ...normalizedMethodRecordsBase, - patch: "patch", - PATCH: "PATCH" - }; - Object.setPrototypeOf(normalizedMethodRecordsBase, null); - Object.setPrototypeOf(normalizedMethodRecords, null); - module2.exports = { - kEnumerableProperty, - nop, - isDisturbed, - isErrored, - isReadable: isReadable2, - toUSVString, - isUSVString, - isBlobLike, - parseOrigin, - parseURL, - getServerName, - isStream: isStream2, - isIterable, - isAsyncIterable, - isDestroyed, - headerNameToString, - bufferToLowerCasedHeaderName, - addListener, - removeAllListeners, - errorRequest, - parseRawHeaders, - parseHeaders, - parseKeepAliveTimeout, - destroy, - bodyLength, - deepClone, - ReadableStreamFrom, - isBuffer, - validateHandler, - getSocketInfo, - isFormDataLike, - buildURL, - addAbortListener, - isValidHTTPToken, - isValidHeaderValue, - isTokenCharCode, - parseRangeHeader, - normalizedMethodRecordsBase, - normalizedMethodRecords, - isValidPort, - isHttpOrHttpsPrefixed, - nodeMajor, - nodeMinor, - safeHTTPMethods: ["GET", "HEAD", "OPTIONS", "TRACE"], - wrapRequestBody }; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/readable.js -var require_readable = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/readable.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var { Readable: Readable2 } = require("node:stream"); - var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); - var util = require_util(); - var { ReadableStreamFrom } = require_util(); - var kConsume = /* @__PURE__ */ Symbol("kConsume"); - var kReading = /* @__PURE__ */ Symbol("kReading"); - var kBody = /* @__PURE__ */ Symbol("kBody"); - var kAbort = /* @__PURE__ */ Symbol("kAbort"); - var kContentType = /* @__PURE__ */ Symbol("kContentType"); - var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); - var noop3 = () => { - }; - var BodyReadable = class extends Readable2 { - constructor({ - resume, - abort, - contentType = "", - contentLength, - highWaterMark = 64 * 1024 - // Same as nodejs fs streams. - }) { - super({ - autoDestroy: true, - read: resume, - highWaterMark - }); - this._readableState.dataEmitted = false; - this[kAbort] = abort; - this[kConsume] = null; - this[kBody] = null; - this[kContentType] = contentType; - this[kContentLength] = contentLength; - this[kReading] = false; - } - destroy(err) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); - } - if (err) { - this[kAbort](); - } - return super.destroy(err); - } - _destroy(err, callback) { - if (!this[kReading]) { - setImmediate(() => { - callback(err); - }); - } else { - callback(err); - } - } - on(ev, ...args) { - if (ev === "data" || ev === "readable") { - this[kReading] = true; - } - return super.on(ev, ...args); - } - addListener(ev, ...args) { - return this.on(ev, ...args); - } - off(ev, ...args) { - const ret = super.off(ev, ...args); - if (ev === "data" || ev === "readable") { - this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; - } - return ret; - } - removeListener(ev, ...args) { - return this.off(ev, ...args); - } - push(chunk) { - if (this[kConsume] && chunk !== null) { - consumePush(this[kConsume], chunk); - return this[kReading] ? super.push(chunk) : true; - } - return super.push(chunk); - } - // https://fetch.spec.whatwg.org/#dom-body-text - async text() { - return consume(this, "text"); - } - // https://fetch.spec.whatwg.org/#dom-body-json - async json() { - return consume(this, "json"); - } - // https://fetch.spec.whatwg.org/#dom-body-blob - async blob() { - return consume(this, "blob"); - } - // https://fetch.spec.whatwg.org/#dom-body-bytes - async bytes() { - return consume(this, "bytes"); - } - // https://fetch.spec.whatwg.org/#dom-body-arraybuffer - async arrayBuffer() { - return consume(this, "arrayBuffer"); - } - // https://fetch.spec.whatwg.org/#dom-body-formdata - async formData() { - throw new NotSupportedError(); - } - // https://fetch.spec.whatwg.org/#dom-body-bodyused - get bodyUsed() { - return util.isDisturbed(this); - } - // https://fetch.spec.whatwg.org/#dom-body-body - get body() { - if (!this[kBody]) { - this[kBody] = ReadableStreamFrom(this); - if (this[kConsume]) { - this[kBody].getReader(); - assert5(this[kBody].locked); - } - } - return this[kBody]; - } - async dump(opts) { - let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024; - const signal = opts?.signal; - if (signal != null && (typeof signal !== "object" || !("aborted" in signal))) { - throw new InvalidArgumentError("signal must be an AbortSignal"); - } - signal?.throwIfAborted(); - if (this._readableState.closeEmitted) { - return null; - } - return await new Promise((resolve, reject) => { - if (this[kContentLength] > limit) { - this.destroy(new AbortError()); - } - const onAbort = () => { - this.destroy(signal.reason ?? new AbortError()); - }; - signal?.addEventListener("abort", onAbort); - this.on("close", function() { - signal?.removeEventListener("abort", onAbort); - if (signal?.aborted) { - reject(signal.reason ?? new AbortError()); - } else { - resolve(null); - } - }).on("error", noop3).on("data", function(chunk) { - limit -= chunk.length; - if (limit <= 0) { - this.destroy(); - } - }).resume(); - }); - } - }; - function isLocked(self2) { - return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; - } - function isUnusable(self2) { - return util.isDisturbed(self2) || isLocked(self2); - } - async function consume(stream, type) { - assert5(!stream[kConsume]); - return new Promise((resolve, reject) => { - if (isUnusable(stream)) { - const rState = stream._readableState; - if (rState.destroyed && rState.closeEmitted === false) { - stream.on("error", (err) => { - reject(err); - }).on("close", () => { - reject(new TypeError("unusable")); - }); - } else { - reject(rState.errored ?? new TypeError("unusable")); - } - } else { - queueMicrotask(() => { - stream[kConsume] = { - type, - stream, - resolve, - reject, - length: 0, - body: [] - }; - stream.on("error", function(err) { - consumeFinish(this[kConsume], err); - }).on("close", function() { - if (this[kConsume].body !== null) { - consumeFinish(this[kConsume], new RequestAbortedError()); - } - }); - consumeStart(stream[kConsume]); - }); - } - }); - } - function consumeStart(consume2) { - if (consume2.body === null) { - return; - } - const { _readableState: state } = consume2.stream; - if (state.bufferIndex) { - const start = state.bufferIndex; - const end = state.buffer.length; - for (let n = start; n < end; n++) { - consumePush(consume2, state.buffer[n]); - } - } else { - for (const chunk of state.buffer) { - consumePush(consume2, chunk); - } - } - if (state.endEmitted) { - consumeEnd(this[kConsume]); - } else { - consume2.stream.on("end", function() { - consumeEnd(this[kConsume]); - }); - } - consume2.stream.resume(); - while (consume2.stream.read() != null) { - } - } - function chunksDecode(chunks, length) { - if (chunks.length === 0 || length === 0) { - return ""; - } - const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); - const bufferLength = buffer.length; - const start = bufferLength > 2 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191 ? 3 : 0; - return buffer.utf8Slice(start, bufferLength); +// node_modules/supports-color/index.js +var supports_color_exports = {}; +__export(supports_color_exports, { + createSupportsColor: () => createSupportsColor, + default: () => supports_color_default +}); +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} +function envForceColor() { + if (!("FORCE_COLOR" in env)) { + return; + } + if (env.FORCE_COLOR === "true") { + return 1; + } + if (env.FORCE_COLOR === "false") { + return 0; + } + if (env.FORCE_COLOR.length === 0) { + return 1; + } + const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + if (![0, 1, 2, 3].includes(level)) { + return; + } + return level; +} +function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} +function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== void 0) { + flagForceColor = noFlagForceColor; + } + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + if (forceColor === 0) { + return 0; + } + if (sniffFlags) { + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; } - function chunksConcat(chunks, length) { - if (chunks.length === 0 || length === 0) { - return new Uint8Array(0); - } - if (chunks.length === 1) { - return new Uint8Array(chunks[0]); - } - const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); - let offset = 0; - for (let i = 0; i < chunks.length; ++i) { - const chunk = chunks[i]; - buffer.set(chunk, offset); - offset += chunk.length; - } - return buffer; + if (hasFlag("color=256")) { + return 2; } - function consumeEnd(consume2) { - const { type, body, resolve, stream, length } = consume2; - try { - if (type === "text") { - resolve(chunksDecode(body, length)); - } else if (type === "json") { - resolve(JSON.parse(chunksDecode(body, length))); - } else if (type === "arrayBuffer") { - resolve(chunksConcat(body, length).buffer); - } else if (type === "blob") { - resolve(new Blob(body, { type: stream[kContentType] })); - } else if (type === "bytes") { - resolve(chunksConcat(body, length)); - } - consumeFinish(consume2); - } catch (err) { - stream.destroy(err); - } + } + if ("TF_BUILD" in env && "AGENT_NAME" in env) { + return 1; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (import_node_process.default.platform === "win32") { + const osRelease = import_node_os.default.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } - function consumePush(consume2, chunk) { - consume2.length += chunk.length; - consume2.body.push(chunk); + return 1; + } + if ("CI" in env) { + if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) { + return 3; } - function consumeFinish(consume2, err) { - if (consume2.body === null) { - return; - } - if (err) { - consume2.reject(err); - } else { - consume2.resolve(); - } - consume2.type = null; - consume2.stream = null; - consume2.resolve = null; - consume2.reject = null; - consume2.length = 0; - consume2.body = null; + if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; } - module2.exports = { Readable: BodyReadable, chunksDecode }; + return min; } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/util.js -var require_util2 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/util.js"(exports2, module2) { - var assert5 = require("node:assert"); - var { - ResponseStatusCodeError - } = require_errors(); - var { chunksDecode } = require_readable(); - var CHUNK_LIMIT = 128 * 1024; - async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { - assert5(body); - let chunks = []; - let length = 0; - try { - for await (const chunk of body) { - chunks.push(chunk); - length += chunk.length; - if (length > CHUNK_LIMIT) { - chunks = []; - length = 0; - break; - } - } - } catch { - chunks = []; - length = 0; - } - const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`; - if (statusCode === 204 || !contentType || !length) { - queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))); - return; - } - const stackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - let payload; - try { - if (isContentTypeApplicationJson(contentType)) { - payload = JSON.parse(chunksDecode(chunks, length)); - } else if (isContentTypeText(contentType)) { - payload = chunksDecode(chunks, length); - } - } catch { - } finally { - Error.stackTraceLimit = stackTraceLimit; - } - queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload))); - } - var isContentTypeApplicationJson = (contentType) => { - return contentType.length > 15 && contentType[11] === "/" && contentType[0] === "a" && contentType[1] === "p" && contentType[2] === "p" && contentType[3] === "l" && contentType[4] === "i" && contentType[5] === "c" && contentType[6] === "a" && contentType[7] === "t" && contentType[8] === "i" && contentType[9] === "o" && contentType[10] === "n" && contentType[12] === "j" && contentType[13] === "s" && contentType[14] === "o" && contentType[15] === "n"; - }; - var isContentTypeText = (contentType) => { - return contentType.length > 4 && contentType[4] === "/" && contentType[0] === "t" && contentType[1] === "e" && contentType[2] === "x" && contentType[3] === "t"; - }; - module2.exports = { - getResolveErrorBodyCallback, - isContentTypeApplicationJson, - isContentTypeText - }; + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-request.js -var require_api_request = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-request.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var { Readable: Readable2 } = require_readable(); - var { InvalidArgumentError, RequestAbortedError } = require_errors(); - var util = require_util(); - var { getResolveErrorBodyCallback } = require_util2(); - var { AsyncResource } = require("node:async_hooks"); - var RequestHandler = class extends AsyncResource { - constructor(opts, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts; - try { - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) { - throw new InvalidArgumentError("invalid highWaterMark"); - } - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - if (method === "CONNECT") { - throw new InvalidArgumentError("invalid method"); - } - if (onInfo && typeof onInfo !== "function") { - throw new InvalidArgumentError("invalid onInfo callback"); - } - super("UNDICI_REQUEST"); - } catch (err) { - if (util.isStream(body)) { - util.destroy(body.on("error", util.nop), err); - } - throw err; - } - this.method = method; - this.responseHeaders = responseHeaders || null; - this.opaque = opaque || null; - this.callback = callback; - this.res = null; - this.abort = null; - this.body = body; - this.trailers = {}; - this.context = null; - this.onInfo = onInfo || null; - this.throwOnError = throwOnError; - this.highWaterMark = highWaterMark; - this.signal = signal; - this.reason = null; - this.removeAbortListener = null; - if (util.isStream(body)) { - body.on("error", (err) => { - this.onError(err); - }); - } - if (this.signal) { - if (this.signal.aborted) { - this.reason = this.signal.reason ?? new RequestAbortedError(); - } else { - this.removeAbortListener = util.addAbortListener(this.signal, () => { - this.reason = this.signal.reason ?? new RequestAbortedError(); - if (this.res) { - util.destroy(this.res.on("error", util.nop), this.reason); - } else if (this.abort) { - this.abort(this.reason); - } - if (this.removeAbortListener) { - this.res?.off("close", this.removeAbortListener); - this.removeAbortListener(); - this.removeAbortListener = null; - } - }); - } - } - } - onConnect(abort, context) { - if (this.reason) { - abort(this.reason); - return; - } - assert5(this.callback); - this.abort = abort; - this.context = context; - } - onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; - const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); - if (statusCode < 200) { - if (this.onInfo) { - this.onInfo({ statusCode, headers }); - } - return; - } - const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; - const contentType = parsedHeaders["content-type"]; - const contentLength = parsedHeaders["content-length"]; - const res = new Readable2({ - resume, - abort, - contentType, - contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null, - highWaterMark - }); - if (this.removeAbortListener) { - res.on("close", this.removeAbortListener); - } - this.callback = null; - this.res = res; - if (callback !== null) { - if (this.throwOnError && statusCode >= 400) { - this.runInAsyncScope( - getResolveErrorBodyCallback, - null, - { callback, body: res, contentType, statusCode, statusMessage, headers } - ); - } else { - this.runInAsyncScope(callback, null, null, { - statusCode, - headers, - trailers: this.trailers, - opaque, - body: res, - context - }); - } - } - } - onData(chunk) { - return this.res.push(chunk); - } - onComplete(trailers) { - util.parseHeaders(trailers, this.trailers); - this.res.push(null); - } - onError(err) { - const { res, callback, body, opaque } = this; - if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - if (res) { - this.res = null; - queueMicrotask(() => { - util.destroy(res, err); - }); - } - if (body) { - this.body = null; - util.destroy(body, err); - } - if (this.removeAbortListener) { - res?.off("close", this.removeAbortListener); - this.removeAbortListener(); - this.removeAbortListener = null; - } - } - }; - function request(opts, callback) { - if (callback === void 0) { - return new Promise((resolve, reject) => { - request.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); - }); - }); - } - try { - this.dispatch(opts, new RequestHandler(opts, callback)); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); - } - } - module2.exports = request; - module2.exports.RequestHandler = RequestHandler; + if (env.COLORTERM === "truecolor") { + return 3; } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/abort-signal.js -var require_abort_signal = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/abort-signal.js"(exports2, module2) { - var { addAbortListener } = require_util(); - var { RequestAbortedError } = require_errors(); - var kListener = /* @__PURE__ */ Symbol("kListener"); - var kSignal = /* @__PURE__ */ Symbol("kSignal"); - function abort(self2) { - if (self2.abort) { - self2.abort(self2[kSignal]?.reason); - } else { - self2.reason = self2[kSignal]?.reason ?? new RequestAbortedError(); - } - removeSignal(self2); - } - function addSignal(self2, signal) { - self2.reason = null; - self2[kSignal] = null; - self2[kListener] = null; - if (!signal) { - return; + if (env.TERM === "xterm-kitty") { + return 3; + } + if (env.TERM === "xterm-ghostty") { + return 3; + } + if (env.TERM === "wezterm") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": { + return version2 >= 3 ? 3 : 2; } - if (signal.aborted) { - abort(self2); - return; + case "Apple_Terminal": { + return 2; } - self2[kSignal] = signal; - self2[kListener] = () => { - abort(self2); - }; - addAbortListener(self2[kSignal], self2[kListener]); } - function removeSignal(self2) { - if (!self2[kSignal]) { - return; - } - if ("removeEventListener" in self2[kSignal]) { - self2[kSignal].removeEventListener("abort", self2[kListener]); - } else { - self2[kSignal].removeListener("abort", self2[kListener]); - } - self2[kSignal] = null; - self2[kListener] = null; + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + return min; +} +function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options + }); + return translateLevel(level); +} +var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default; +var init_supports_color = __esm({ + "node_modules/supports-color/index.js"() { + import_node_process = __toESM(require("node:process"), 1); + import_node_os = __toESM(require("node:os"), 1); + import_node_tty = __toESM(require("node:tty"), 1); + ({ env } = import_node_process.default); + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + flagForceColor = 0; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + flagForceColor = 1; } - module2.exports = { - addSignal, - removeSignal + supportsColor = { + stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), + stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) }; + supports_color_default = supportsColor; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-stream.js -var require_api_stream = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-stream.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var { finished, PassThrough } = require("node:stream"); - var { InvalidArgumentError, InvalidReturnValueError } = require_errors(); - var util = require_util(); - var { getResolveErrorBodyCallback } = require_util2(); - var { AsyncResource } = require("node:async_hooks"); - var { addSignal, removeSignal } = require_abort_signal(); - var StreamHandler = class extends AsyncResource { - constructor(opts, factory, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts; - try { - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - if (typeof factory !== "function") { - throw new InvalidArgumentError("invalid factory"); - } - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - if (method === "CONNECT") { - throw new InvalidArgumentError("invalid method"); - } - if (onInfo && typeof onInfo !== "function") { - throw new InvalidArgumentError("invalid onInfo callback"); - } - super("UNDICI_STREAM"); - } catch (err) { - if (util.isStream(body)) { - util.destroy(body.on("error", util.nop), err); - } - throw err; - } - this.responseHeaders = responseHeaders || null; - this.opaque = opaque || null; - this.factory = factory; - this.callback = callback; - this.res = null; - this.abort = null; - this.context = null; - this.trailers = null; - this.body = body; - this.onInfo = onInfo || null; - this.throwOnError = throwOnError || false; - if (util.isStream(body)) { - body.on("error", (err) => { - this.onError(err); - }); - } - addSignal(this, signal); - } - onConnect(abort, context) { - if (this.reason) { - abort(this.reason); - return; - } - assert5(this.callback); - this.abort = abort; - this.context = context; - } - onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context, callback, responseHeaders } = this; - const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); - if (statusCode < 200) { - if (this.onInfo) { - this.onInfo({ statusCode, headers }); - } - return; - } - this.factory = null; - let res; - if (this.throwOnError && statusCode >= 400) { - const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; - const contentType = parsedHeaders["content-type"]; - res = new PassThrough(); - this.callback = null; - this.runInAsyncScope( - getResolveErrorBodyCallback, - null, - { callback, body: res, contentType, statusCode, statusMessage, headers } - ); - } else { - if (factory === null) { - return; - } - res = this.runInAsyncScope(factory, null, { - statusCode, - headers, - opaque, - context - }); - if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { - throw new InvalidReturnValueError("expected Writable"); - } - finished(res, { readable: false }, (err) => { - const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; - this.res = null; - if (err || !res2.readable) { - util.destroy(res2, err); - } - this.callback = null; - this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); - if (err) { - abort(); - } - }); - } - res.on("drain", resume); - this.res = res; - const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain; - return needDrain !== true; - } - onData(chunk) { - const { res } = this; - return res ? res.write(chunk) : true; - } - onComplete(trailers) { - const { res } = this; - removeSignal(this); - if (!res) { - return; - } - this.trailers = util.parseHeaders(trailers); - res.end(); - } - onError(err) { - const { res, callback, opaque, body } = this; - removeSignal(this); - this.factory = null; - if (res) { - this.res = null; - util.destroy(res, err); - } else if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - if (body) { - this.body = null; - util.destroy(body, err); - } - } - }; - function stream(opts, factory, callback) { - if (callback === void 0) { - return new Promise((resolve, reject) => { - stream.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve(data); - }); - }); - } - try { - this.dispatch(opts, new StreamHandler(opts, factory, callback)); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty3 = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log2; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.destroy = util.deprecate( + () => { + }, + "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." + ); + exports2.colors = [6, 2, 3, 4, 5, 1]; + try { + const supportsColor2 = (init_supports_color(), __toCommonJS(supports_color_exports)); + if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) { + exports2.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; } + } catch (error) { } - module2.exports = stream; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-pipeline.js -var require_api_pipeline = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { - "use strict"; - var { - Readable: Readable2, - Duplex, - PassThrough - } = require("node:stream"); - var { - InvalidArgumentError, - InvalidReturnValueError, - RequestAbortedError - } = require_errors(); - var util = require_util(); - var { AsyncResource } = require("node:async_hooks"); - var { addSignal, removeSignal } = require_abort_signal(); - var assert5 = require("node:assert"); - var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable2 { - constructor() { - super({ autoDestroy: true }); - this[kResume] = null; - } - _read() { - const { [kResume]: resume } = this; - if (resume) { - this[kResume] = null; - resume(); - } + exports2.inspectOpts = Object.keys(process.env).filter((key) => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === "null") { + val = null; + } else { + val = Number(val); } - _destroy(err, callback) { - this._read(); - callback(err); + obj[prop] = val; + return obj; + }, {}); + function useColors() { + return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty3.isatty(process.stderr.fd); + } + function formatArgs(args) { + const { namespace: name2, useColors: useColors2 } = this; + if (useColors2) { + const c = this.color; + const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); + const prefix = ` ${colorCode};1m${name2} \x1B[0m`; + args[0] = prefix + args[0].split("\n").join("\n" + prefix); + args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name2 + " " + args[0]; } - }; - var PipelineResponse = class extends Readable2 { - constructor(resume) { - super({ autoDestroy: true }); - this[kResume] = resume; + } + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; } - _read() { - this[kResume](); + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log2(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; } - _destroy(err, callback) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError(); - } - callback(err); + } + function load() { + return process.env.DEBUG; + } + function init(debug) { + debug.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; } + } + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; - var PipelineHandler = class extends AsyncResource { - constructor(opts, handler) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - if (typeof handler !== "function") { - throw new InvalidArgumentError("invalid handler"); - } - const { signal, method, opaque, onInfo, responseHeaders } = opts; - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - if (method === "CONNECT") { - throw new InvalidArgumentError("invalid method"); - } - if (onInfo && typeof onInfo !== "function") { - throw new InvalidArgumentError("invalid onInfo callback"); - } - super("UNDICI_PIPELINE"); - this.opaque = opaque || null; - this.responseHeaders = responseHeaders || null; - this.handler = handler; - this.abort = null; - this.context = null; - this.onInfo = onInfo || null; - this.req = new PipelineRequest().on("error", util.nop); - this.ret = new Duplex({ - readableObjectMode: opts.objectMode, - autoDestroy: true, - read: () => { - const { body } = this; - if (body?.resume) { - body.resume(); - } - }, - write: (chunk, encoding, callback) => { - const { req } = this; - if (req.push(chunk, encoding) || req._readableState.destroyed) { - callback(); - } else { - req[kResume] = callback; - } - }, - destroy: (err, callback) => { - const { body, req, res, ret, abort } = this; - if (!err && !ret._readableState.endEmitted) { - err = new RequestAbortedError(); - } - if (abort && err) { - abort(); - } - util.destroy(body, err); - util.destroy(req, err); - util.destroy(res, err); - removeSignal(this); - callback(err); - } - }).on("prefinish", () => { - const { req } = this; - req.push(null); - }); - this.res = null; - addSignal(this, signal); - } - onConnect(abort, context) { - const { ret, res } = this; - if (this.reason) { - abort(this.reason); - return; - } - assert5(!res, "pipeline cannot be retried"); - assert5(!ret.destroyed); - this.abort = abort; - this.context = context; - } - onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler, context } = this; - if (statusCode < 200) { - if (this.onInfo) { - const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); - this.onInfo({ statusCode, headers }); - } - return; - } - this.res = new PipelineResponse(resume); - let body; - try { - this.handler = null; - const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); - body = this.runInAsyncScope(handler, null, { - statusCode, - headers, - opaque, - body: this.res, - context - }); - } catch (err) { - this.res.on("error", util.nop); - throw err; - } - if (!body || typeof body.on !== "function") { - throw new InvalidReturnValueError("expected Readable"); - } - body.on("data", (chunk) => { - const { ret, body: body2 } = this; - if (!ret.push(chunk) && body2.pause) { - body2.pause(); - } - }).on("error", (err) => { - const { ret } = this; - util.destroy(ret, err); - }).on("end", () => { - const { ret } = this; - ret.push(null); - }).on("close", () => { - const { ret } = this; - if (!ret._readableState.ended) { - util.destroy(ret, new RequestAbortedError()); - } - }); - this.body = body; - } - onData(chunk) { - const { res } = this; - return res.push(chunk); - } - onComplete(trailers) { - const { res } = this; - res.push(null); - } - onError(err) { - const { ret } = this; - this.handler = null; - util.destroy(ret, err); - } + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; - function pipeline(opts, handler) { - try { - const pipelineHandler = new PipelineHandler(opts, handler); - this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); - return pipelineHandler.ret; - } catch (err) { - return new PassThrough().destroy(err); - } - } - module2.exports = pipeline; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-upgrade.js -var require_api_upgrade = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-upgrade.js"(exports2, module2) { - "use strict"; - var { InvalidArgumentError, SocketError } = require_errors(); - var { AsyncResource } = require("node:async_hooks"); - var util = require_util(); - var { addSignal, removeSignal } = require_abort_signal(); - var assert5 = require("node:assert"); - var UpgradeHandler = class extends AsyncResource { - constructor(opts, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - const { signal, opaque, responseHeaders } = opts; - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - super("UNDICI_UPGRADE"); - this.responseHeaders = responseHeaders || null; - this.opaque = opaque || null; - this.callback = callback; - this.abort = null; - this.context = null; - addSignal(this, signal); - } - onConnect(abort, context) { - if (this.reason) { - abort(this.reason); - return; - } - assert5(this.callback); - this.abort = abort; - this.context = null; - } - onHeaders() { - throw new SocketError("bad upgrade", null); - } - onUpgrade(statusCode, rawHeaders, socket) { - assert5(statusCode === 101); - const { callback, opaque, context } = this; - removeSignal(this); - this.callback = null; - const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); - this.runInAsyncScope(callback, null, null, { - headers, - socket, - opaque, - context - }); - } - onError(err) { - const { callback, opaque } = this; - removeSignal(this); - if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - } - }; - function upgrade(opts, callback) { - if (callback === void 0) { - return new Promise((resolve, reject) => { - upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); - }); - }); - } - try { - const upgradeHandler = new UpgradeHandler(opts, callback); - this.dispatch({ - ...opts, - method: opts.method || "GET", - upgrade: opts.protocol || "Websocket" - }, upgradeHandler); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); - } +// node_modules/debug/src/index.js +var require_src = __commonJS({ + "node_modules/debug/src/index.js"(exports2, module2) { + if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { + module2.exports = require_browser(); + } else { + module2.exports = require_node(); } - module2.exports = upgrade; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-connect.js -var require_api_connect = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/api-connect.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var { AsyncResource } = require("node:async_hooks"); - var { InvalidArgumentError, SocketError } = require_errors(); - var util = require_util(); - var { addSignal, removeSignal } = require_abort_signal(); - var ConnectHandler = class extends AsyncResource { - constructor(opts, callback) { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("invalid opts"); - } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - const { signal, opaque, responseHeaders } = opts; - if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { - throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); - } - super("UNDICI_CONNECT"); - this.opaque = opaque || null; - this.responseHeaders = responseHeaders || null; - this.callback = callback; - this.abort = null; - addSignal(this, signal); - } - onConnect(abort, context) { - if (this.reason) { - abort(this.reason); - return; - } - assert5(this.callback); - this.abort = abort; - this.context = context; - } - onHeaders() { - throw new SocketError("bad connect", null); - } - onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context } = this; - removeSignal(this); - this.callback = null; - let headers = rawHeaders; - if (headers != null) { - headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); - } - this.runInAsyncScope(callback, null, null, { - statusCode, - headers, - socket, - opaque, - context - }); - } - onError(err) { - const { callback, opaque } = this; - removeSignal(this); - if (callback) { - this.callback = null; - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }); - }); - } - } +// node_modules/minipass/dist/esm/index.js +var import_node_events, import_node_stream, import_node_string_decoder, proc, isStream, isReadable, isWritable, EOF, MAYBE_EMIT_END, EMITTED_END, EMITTING_END, EMITTED_ERROR, CLOSED, READ, FLUSH, FLUSHCHUNK, ENCODING, DECODER, FLOWING, PAUSED, RESUME, BUFFER, PIPES, BUFFERLENGTH, BUFFERPUSH, BUFFERSHIFT, OBJECTMODE, DESTROYED, ERROR, EMITDATA, EMITEND, EMITEND2, ASYNC, ABORT, ABORTED, SIGNAL, DATALISTENERS, DISCARDED, defer, nodefer, isEndish, isArrayBufferLike, isArrayBufferView, Pipe, PipeProxyErrors, isObjectModeOptions, isEncodingOptions, Minipass; +var init_esm = __esm({ + "node_modules/minipass/dist/esm/index.js"() { + import_node_events = require("node:events"); + import_node_stream = __toESM(require("node:stream"), 1); + import_node_string_decoder = require("node:string_decoder"); + proc = typeof process === "object" && process ? process : { + stdout: null, + stderr: null }; - function connect(opts, callback) { - if (callback === void 0) { - return new Promise((resolve, reject) => { - connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); - }); - }); - } - try { - const connectHandler = new ConnectHandler(opts, callback); - this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); - } catch (err) { - if (typeof callback !== "function") { - throw err; - } - const opaque = opts?.opaque; - queueMicrotask(() => callback(err, { opaque })); - } - } - module2.exports = connect; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/index.js -var require_api = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/api/index.js"(exports2, module2) { - "use strict"; - module2.exports.request = require_api_request(); - module2.exports.stream = require_api_stream(); - module2.exports.pipeline = require_api_pipeline(); - module2.exports.upgrade = require_api_upgrade(); - module2.exports.connect = require_api_connect(); - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/dispatcher.js -var require_dispatcher = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) { - "use strict"; - var EventEmitter2 = require("node:events"); - var Dispatcher = class extends EventEmitter2 { - dispatch() { - throw new Error("not implemented"); + isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof import_node_stream.default || isReadable(s) || isWritable(s)); + isReadable = (s) => !!s && typeof s === "object" && s instanceof import_node_events.EventEmitter && typeof s.pipe === "function" && // node core Writable streams have a pipe() method, but it throws + s.pipe !== import_node_stream.default.Writable.prototype.pipe; + isWritable = (s) => !!s && typeof s === "object" && s instanceof import_node_events.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; + EOF = /* @__PURE__ */ Symbol("EOF"); + MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"); + EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"); + EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd"); + EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError"); + CLOSED = /* @__PURE__ */ Symbol("closed"); + READ = /* @__PURE__ */ Symbol("read"); + FLUSH = /* @__PURE__ */ Symbol("flush"); + FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk"); + ENCODING = /* @__PURE__ */ Symbol("encoding"); + DECODER = /* @__PURE__ */ Symbol("decoder"); + FLOWING = /* @__PURE__ */ Symbol("flowing"); + PAUSED = /* @__PURE__ */ Symbol("paused"); + RESUME = /* @__PURE__ */ Symbol("resume"); + BUFFER = /* @__PURE__ */ Symbol("buffer"); + PIPES = /* @__PURE__ */ Symbol("pipes"); + BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength"); + BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush"); + BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift"); + OBJECTMODE = /* @__PURE__ */ Symbol("objectMode"); + DESTROYED = /* @__PURE__ */ Symbol("destroyed"); + ERROR = /* @__PURE__ */ Symbol("error"); + EMITDATA = /* @__PURE__ */ Symbol("emitData"); + EMITEND = /* @__PURE__ */ Symbol("emitEnd"); + EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2"); + ASYNC = /* @__PURE__ */ Symbol("async"); + ABORT = /* @__PURE__ */ Symbol("abort"); + ABORTED = /* @__PURE__ */ Symbol("aborted"); + SIGNAL = /* @__PURE__ */ Symbol("signal"); + DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners"); + DISCARDED = /* @__PURE__ */ Symbol("discarded"); + defer = (fn2) => Promise.resolve().then(fn2); + nodefer = (fn2) => fn2(); + isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; + isArrayBufferLike = (b) => b instanceof ArrayBuffer || !!b && typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; + isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); + Pipe = class { + src; + dest; + opts; + ondrain; + constructor(src, dest, opts) { + this.src = src; + this.dest = dest; + this.opts = opts; + this.ondrain = () => src[RESUME](); + this.dest.on("drain", this.ondrain); } - close() { - throw new Error("not implemented"); + unpipe() { + this.dest.removeListener("drain", this.ondrain); } - destroy() { - throw new Error("not implemented"); + // only here for the prototype + /* c8 ignore start */ + proxyErrors(_er) { } - compose(...args) { - const interceptors = Array.isArray(args[0]) ? args[0] : args; - let dispatch = this.dispatch.bind(this); - for (const interceptor of interceptors) { - if (interceptor == null) { - continue; - } - if (typeof interceptor !== "function") { - throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); - } - dispatch = interceptor(dispatch); - if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) { - throw new TypeError("invalid interceptor"); - } - } - return new ComposedDispatcher(this, dispatch); + /* c8 ignore stop */ + end() { + this.unpipe(); + if (this.opts.end) + this.dest.end(); } }; - var ComposedDispatcher = class extends Dispatcher { - #dispatcher = null; - #dispatch = null; - constructor(dispatcher, dispatch) { - super(); - this.#dispatcher = dispatcher; - this.#dispatch = dispatch; - } - dispatch(...args) { - this.#dispatch(...args); - } - close(...args) { - return this.#dispatcher.close(...args); + PipeProxyErrors = class extends Pipe { + unpipe() { + this.src.removeListener("error", this.proxyErrors); + super.unpipe(); } - destroy(...args) { - return this.#dispatcher.destroy(...args); + constructor(src, dest, opts) { + super(src, dest, opts); + this.proxyErrors = (er) => this.dest.emit("error", er); + src.on("error", this.proxyErrors); } }; - module2.exports = Dispatcher; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/dispatcher-base.js -var require_dispatcher_base = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/dispatcher-base.js"(exports2, module2) { - "use strict"; - var Dispatcher = require_dispatcher(); - var { - ClientDestroyedError, - ClientClosedError, - InvalidArgumentError - } = require_errors(); - var { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require_symbols(); - var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); - var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); - var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); - var kWebSocketOptions = /* @__PURE__ */ Symbol("webSocketOptions"); - var DispatcherBase = class extends Dispatcher { - constructor(opts) { + isObjectModeOptions = (o) => !!o.objectMode; + isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== "buffer"; + Minipass = class extends import_node_events.EventEmitter { + [FLOWING] = false; + [PAUSED] = false; + [PIPES] = []; + [BUFFER] = []; + [OBJECTMODE]; + [ENCODING]; + [ASYNC]; + [DECODER]; + [EOF] = false; + [EMITTED_END] = false; + [EMITTING_END] = false; + [CLOSED] = false; + [EMITTED_ERROR] = null; + [BUFFERLENGTH] = 0; + [DESTROYED] = false; + [SIGNAL]; + [ABORTED] = false; + [DATALISTENERS] = 0; + [DISCARDED] = false; + /** + * true if the stream can be written + */ + writable = true; + /** + * true if the stream can be read + */ + readable = true; + /** + * If `RType` is Buffer, then options do not need to be provided. + * Otherwise, an options object must be provided to specify either + * {@link Minipass.SharedOptions.objectMode} or + * {@link Minipass.SharedOptions.encoding}, as appropriate. + */ + constructor(...args) { + const options = args[0] || {}; super(); - this[kDestroyed] = false; - this[kOnDestroyed] = null; - this[kClosed] = false; - this[kOnClosed] = []; - this[kWebSocketOptions] = opts?.webSocket ?? {}; - } - get webSocketOptions() { - return { - maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 - }; - } - get destroyed() { - return this[kDestroyed]; - } - get closed() { - return this[kClosed]; - } - get interceptors() { - return this[kInterceptors]; - } - set interceptors(newInterceptors) { - if (newInterceptors) { - for (let i = newInterceptors.length - 1; i >= 0; i--) { - const interceptor = this[kInterceptors][i]; - if (typeof interceptor !== "function") { - throw new InvalidArgumentError("interceptor must be an function"); - } - } + if (options.objectMode && typeof options.encoding === "string") { + throw new TypeError("Encoding and objectMode may not be used together"); } - this[kInterceptors] = newInterceptors; - } - close(callback) { - if (callback === void 0) { - return new Promise((resolve, reject) => { - this.close((err, data) => { - return err ? reject(err) : resolve(data); - }); - }); + if (isObjectModeOptions(options)) { + this[OBJECTMODE] = true; + this[ENCODING] = null; + } else if (isEncodingOptions(options)) { + this[ENCODING] = options.encoding; + this[OBJECTMODE] = false; + } else { + this[OBJECTMODE] = false; + this[ENCODING] = null; } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); + this[ASYNC] = !!options.async; + this[DECODER] = this[ENCODING] ? new import_node_string_decoder.StringDecoder(this[ENCODING]) : null; + if (options && options.debugExposeBuffer === true) { + Object.defineProperty(this, "buffer", { get: () => this[BUFFER] }); } - if (this[kDestroyed]) { - queueMicrotask(() => callback(new ClientDestroyedError(), null)); - return; + if (options && options.debugExposePipes === true) { + Object.defineProperty(this, "pipes", { get: () => this[PIPES] }); } - if (this[kClosed]) { - if (this[kOnClosed]) { - this[kOnClosed].push(callback); + const { signal } = options; + if (signal) { + this[SIGNAL] = signal; + if (signal.aborted) { + this[ABORT](); } else { - queueMicrotask(() => callback(null, null)); + signal.addEventListener("abort", () => this[ABORT]()); } - return; } - this[kClosed] = true; - this[kOnClosed].push(callback); - const onClosed = () => { - const callbacks = this[kOnClosed]; - this[kOnClosed] = null; - for (let i = 0; i < callbacks.length; i++) { - callbacks[i](null, null); - } - }; - this[kClose]().then(() => this.destroy()).then(() => { - queueMicrotask(onClosed); - }); } - destroy(err, callback) { - if (typeof err === "function") { - callback = err; - err = null; - } - if (callback === void 0) { - return new Promise((resolve, reject) => { - this.destroy(err, (err2, data) => { - return err2 ? ( - /* istanbul ignore next: should never error */ - reject(err2) - ) : resolve(data); - }); - }); - } - if (typeof callback !== "function") { - throw new InvalidArgumentError("invalid callback"); - } - if (this[kDestroyed]) { - if (this[kOnDestroyed]) { - this[kOnDestroyed].push(callback); - } else { - queueMicrotask(() => callback(null, null)); - } - return; - } - if (!err) { - err = new ClientDestroyedError(); - } - this[kDestroyed] = true; - this[kOnDestroyed] = this[kOnDestroyed] || []; - this[kOnDestroyed].push(callback); - const onDestroyed = () => { - const callbacks = this[kOnDestroyed]; - this[kOnDestroyed] = null; - for (let i = 0; i < callbacks.length; i++) { - callbacks[i](null, null); - } - }; - this[kDestroy](err).then(() => { - queueMicrotask(onDestroyed); - }); + /** + * The amount of data stored in the buffer waiting to be read. + * + * For Buffer strings, this will be the total byte length. + * For string encoding streams, this will be the string character length, + * according to JavaScript's `string.length` logic. + * For objectMode streams, this is a count of the items waiting to be + * emitted. + */ + get bufferLength() { + return this[BUFFERLENGTH]; } - [kInterceptedDispatch](opts, handler) { - if (!this[kInterceptors] || this[kInterceptors].length === 0) { - this[kInterceptedDispatch] = this[kDispatch]; - return this[kDispatch](opts, handler); - } - let dispatch = this[kDispatch].bind(this); - for (let i = this[kInterceptors].length - 1; i >= 0; i--) { - dispatch = this[kInterceptors][i](dispatch); - } - this[kInterceptedDispatch] = dispatch; - return dispatch(opts, handler); + /** + * The `BufferEncoding` currently in use, or `null` + */ + get encoding() { + return this[ENCODING]; } - dispatch(opts, handler) { - if (!handler || typeof handler !== "object") { - throw new InvalidArgumentError("handler must be an object"); - } - try { - if (!opts || typeof opts !== "object") { - throw new InvalidArgumentError("opts must be an object."); - } - if (this[kDestroyed] || this[kOnDestroyed]) { - throw new ClientDestroyedError(); - } - if (this[kClosed]) { - throw new ClientClosedError(); - } - return this[kInterceptedDispatch](opts, handler); - } catch (err) { - if (typeof handler.onError !== "function") { - throw new InvalidArgumentError("invalid onError method"); - } - handler.onError(err); - return false; - } + /** + * @deprecated - This is a read only property + */ + set encoding(_enc) { + throw new Error("Encoding must be set at instantiation time"); } - }; - module2.exports = DispatcherBase; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/fixed-queue.js -var require_fixed_queue = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/fixed-queue.js"(exports2, module2) { - "use strict"; - var kSize = 2048; - var kMask = kSize - 1; - var FixedCircularBuffer = class { - constructor() { - this.bottom = 0; - this.top = 0; - this.list = new Array(kSize); - this.next = null; + /** + * @deprecated - Encoding may only be set at instantiation time + */ + setEncoding(_enc) { + throw new Error("Encoding must be set at instantiation time"); } - isEmpty() { - return this.top === this.bottom; + /** + * True if this is an objectMode stream + */ + get objectMode() { + return this[OBJECTMODE]; } - isFull() { - return (this.top + 1 & kMask) === this.bottom; + /** + * @deprecated - This is a read-only property + */ + set objectMode(_om) { + throw new Error("objectMode must be set at instantiation time"); } - push(data) { - this.list[this.top] = data; - this.top = this.top + 1 & kMask; + /** + * true if this is an async stream + */ + get ["async"]() { + return this[ASYNC]; } - shift() { - const nextItem = this.list[this.bottom]; - if (nextItem === void 0) - return null; - this.list[this.bottom] = void 0; - this.bottom = this.bottom + 1 & kMask; - return nextItem; + /** + * Set to true to make this stream async. + * + * Once set, it cannot be unset, as this would potentially cause incorrect + * behavior. Ie, a sync stream can be made async, but an async stream + * cannot be safely made sync. + */ + set ["async"](a) { + this[ASYNC] = this[ASYNC] || !!a; } - }; - module2.exports = class FixedQueue { - constructor() { - this.head = this.tail = new FixedCircularBuffer(); + // drop everything and get out of the flow completely + [ABORT]() { + this[ABORTED] = true; + this.emit("abort", this[SIGNAL]?.reason); + this.destroy(this[SIGNAL]?.reason); } - isEmpty() { - return this.head.isEmpty(); + /** + * True if the stream has been aborted. + */ + get aborted() { + return this[ABORTED]; } - push(data) { - if (this.head.isFull()) { - this.head = this.head.next = new FixedCircularBuffer(); - } - this.head.push(data); + /** + * No-op setter. Stream aborted status is set via the AbortSignal provided + * in the constructor options. + */ + set aborted(_) { } - shift() { - const tail = this.tail; - const next = tail.shift(); - if (tail.isEmpty() && tail.next !== null) { - this.tail = tail.next; + write(chunk, encoding, cb) { + if (this[ABORTED]) + return false; + if (this[EOF]) + throw new Error("write after end"); + if (this[DESTROYED]) { + this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })); + return true; } - return next; - } - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/pool-stats.js -var require_pool_stats = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/pool-stats.js"(exports2, module2) { - var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = /* @__PURE__ */ Symbol("pool"); - var PoolStats = class { - constructor(pool) { - this[kPool] = pool; - } - get connected() { - return this[kPool][kConnected]; - } - get free() { - return this[kPool][kFree]; - } - get pending() { - return this[kPool][kPending]; - } - get queued() { - return this[kPool][kQueued]; - } - get running() { - return this[kPool][kRunning]; - } - get size() { - return this[kPool][kSize]; - } - }; - module2.exports = PoolStats; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/pool-base.js -var require_pool_base = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/pool-base.js"(exports2, module2) { - "use strict"; - var DispatcherBase = require_dispatcher_base(); - var FixedQueue = require_fixed_queue(); - var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols(); - var PoolStats = require_pool_stats(); - var kClients = /* @__PURE__ */ Symbol("clients"); - var kNeedDrain = /* @__PURE__ */ Symbol("needDrain"); - var kQueue = /* @__PURE__ */ Symbol("queue"); - var kClosedResolve = /* @__PURE__ */ Symbol("closed resolve"); - var kOnDrain = /* @__PURE__ */ Symbol("onDrain"); - var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); - var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); - var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); - var kGetDispatcher = /* @__PURE__ */ Symbol("get dispatcher"); - var kAddClient = /* @__PURE__ */ Symbol("add client"); - var kRemoveClient = /* @__PURE__ */ Symbol("remove client"); - var kStats = /* @__PURE__ */ Symbol("stats"); - var PoolBase = class extends DispatcherBase { - constructor(opts) { - super(opts); - this[kQueue] = new FixedQueue(); - this[kClients] = []; - this[kQueued] = 0; - const pool = this; - this[kOnDrain] = function onDrain(origin, targets) { - const queue = pool[kQueue]; - let needDrain = false; - while (!needDrain) { - const item = queue.shift(); - if (!item) { - break; - } - pool[kQueued]--; - needDrain = !this.dispatch(item.opts, item.handler); - } - this[kNeedDrain] = needDrain; - if (!this[kNeedDrain] && pool[kNeedDrain]) { - pool[kNeedDrain] = false; - pool.emit("drain", origin, [pool, ...targets]); - } - if (pool[kClosedResolve] && queue.isEmpty()) { - Promise.all(pool[kClients].map((c) => c.close())).then(pool[kClosedResolve]); + if (typeof encoding === "function") { + cb = encoding; + encoding = "utf8"; + } + if (!encoding) + encoding = "utf8"; + const fn2 = this[ASYNC] ? defer : nodefer; + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) { + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + } else if (isArrayBufferLike(chunk)) { + chunk = Buffer.from(chunk); + } else if (typeof chunk !== "string") { + throw new Error("Non-contiguous data written to non-objectMode stream"); } - }; - this[kOnConnect] = (origin, targets) => { - pool.emit("connect", origin, [pool, ...targets]); - }; - this[kOnDisconnect] = (origin, targets, err) => { - pool.emit("disconnect", origin, [pool, ...targets], err); - }; - this[kOnConnectionError] = (origin, targets, err) => { - pool.emit("connectionError", origin, [pool, ...targets], err); - }; - this[kStats] = new PoolStats(this); - } - get [kBusy]() { - return this[kNeedDrain]; - } - get [kConnected]() { - return this[kClients].filter((client) => client[kConnected]).length; - } - get [kFree]() { - return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; - } - get [kPending]() { - let ret = this[kQueued]; - for (const { [kPending]: pending } of this[kClients]) { - ret += pending; } - return ret; - } - get [kRunning]() { - let ret = 0; - for (const { [kRunning]: running } of this[kClients]) { - ret += running; + if (this[OBJECTMODE]) { + if (this[FLOWING] && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + if (this[FLOWING]) + this.emit("data", chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn2(cb); + return this[FLOWING]; } - return ret; - } - get [kSize]() { - let ret = this[kQueued]; - for (const { [kSize]: size } of this[kClients]) { - ret += size; + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn2(cb); + return this[FLOWING]; } - return ret; - } - get stats() { - return this[kStats]; - } - async [kClose]() { - if (this[kQueue].isEmpty()) { - await Promise.all(this[kClients].map((c) => c.close())); - } else { - await new Promise((resolve) => { - this[kClosedResolve] = resolve; - }); + if (typeof chunk === "string" && // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) { + chunk = Buffer.from(chunk, encoding); } - } - async [kDestroy](err) { - while (true) { - const item = this[kQueue].shift(); - if (!item) { - break; - } - item.handler.onError(err); - } - await Promise.all(this[kClients].map((c) => c.destroy(err))); - } - [kDispatch](opts, handler) { - const dispatcher = this[kGetDispatcher](); - if (!dispatcher) { - this[kNeedDrain] = true; - this[kQueue].push({ opts, handler }); - this[kQueued]++; - } else if (!dispatcher.dispatch(opts, handler)) { - dispatcher[kNeedDrain] = true; - this[kNeedDrain] = !this[kGetDispatcher](); - } - return !this[kNeedDrain]; - } - [kAddClient](client) { - client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); - this[kClients].push(client); - if (this[kNeedDrain]) { - queueMicrotask(() => { - if (this[kNeedDrain]) { - this[kOnDrain](client[kUrl], [this, client]); - } - }); + if (Buffer.isBuffer(chunk) && this[ENCODING]) { + chunk = this[DECODER].write(chunk); } - return this; - } - [kRemoveClient](client) { - client.close(() => { - const idx = this[kClients].indexOf(client); - if (idx !== -1) { - this[kClients].splice(idx, 1); - } - }); - this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); - } - }; - module2.exports = { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kRemoveClient, - kGetDispatcher - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/diagnostics.js -var require_diagnostics = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/diagnostics.js"(exports2, module2) { - "use strict"; - var diagnosticsChannel = require("node:diagnostics_channel"); - var util = require("node:util"); - var undiciDebugLog = util.debuglog("undici"); - var fetchDebuglog = util.debuglog("fetch"); - var websocketDebuglog = util.debuglog("websocket"); - var isClientSet = false; - var channels = { - // Client - beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"), - connected: diagnosticsChannel.channel("undici:client:connected"), - connectError: diagnosticsChannel.channel("undici:client:connectError"), - sendHeaders: diagnosticsChannel.channel("undici:client:sendHeaders"), - // Request - create: diagnosticsChannel.channel("undici:request:create"), - bodySent: diagnosticsChannel.channel("undici:request:bodySent"), - headers: diagnosticsChannel.channel("undici:request:headers"), - trailers: diagnosticsChannel.channel("undici:request:trailers"), - error: diagnosticsChannel.channel("undici:request:error"), - // WebSocket - open: diagnosticsChannel.channel("undici:websocket:open"), - close: diagnosticsChannel.channel("undici:websocket:close"), - socketError: diagnosticsChannel.channel("undici:websocket:socket_error"), - ping: diagnosticsChannel.channel("undici:websocket:ping"), - pong: diagnosticsChannel.channel("undici:websocket:pong") - }; - if (undiciDebugLog.enabled || fetchDebuglog.enabled) { - const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog; - diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { - const { - connectParams: { version: version2, protocol, port, host } - } = evt; - debuglog( - "connecting to %s using %s%s", - `${host}${port ? `:${port}` : ""}`, - protocol, - version2 - ); - }); - diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { - const { - connectParams: { version: version2, protocol, port, host } - } = evt; - debuglog( - "connected to %s using %s%s", - `${host}${port ? `:${port}` : ""}`, - protocol, - version2 - ); - }); - diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { - const { - connectParams: { version: version2, protocol, port, host }, - error - } = evt; - debuglog( - "connection to %s using %s%s errored - %s", - `${host}${port ? `:${port}` : ""}`, - protocol, - version2, - error.message - ); - }); - diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { - const { - request: { method, path: path16, origin } - } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); - }); - diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { - const { - request: { method, path: path16, origin }, - response: { statusCode } - } = evt; - debuglog( - "received response to %s %s/%s - HTTP %d", - method, - origin, - path16, - statusCode - ); - }); - diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { - const { - request: { method, path: path16, origin } - } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path16); - }); - diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { - const { - request: { method, path: path16, origin }, - error - } = evt; - debuglog( - "request to %s %s/%s errored - %s", - method, - origin, - path16, - error.message - ); - }); - isClientSet = true; - } - if (websocketDebuglog.enabled) { - if (!isClientSet) { - const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog; - diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { - const { - connectParams: { version: version2, protocol, port, host } - } = evt; - debuglog( - "connecting to %s%s using %s%s", - host, - port ? `:${port}` : "", - protocol, - version2 - ); - }); - diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { - const { - connectParams: { version: version2, protocol, port, host } - } = evt; - debuglog( - "connected to %s%s using %s%s", - host, - port ? `:${port}` : "", - protocol, - version2 - ); - }); - diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { - const { - connectParams: { version: version2, protocol, port, host }, - error - } = evt; - debuglog( - "connection to %s%s using %s%s errored - %s", - host, - port ? `:${port}` : "", - protocol, - version2, - error.message - ); - }); - diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { - const { - request: { method, path: path16, origin } - } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); - }); + if (this[FLOWING] && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + if (this[FLOWING]) + this.emit("data", chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn2(cb); + return this[FLOWING]; } - diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { - const { - address: { address, port } - } = evt; - websocketDebuglog("connection opened %s%s", address, port ? `:${port}` : ""); - }); - diagnosticsChannel.channel("undici:websocket:close").subscribe((evt) => { - const { websocket, code: code2, reason } = evt; - websocketDebuglog( - "closed connection to %s - %s %s", - websocket.url, - code2, - reason - ); - }); - diagnosticsChannel.channel("undici:websocket:socket_error").subscribe((err) => { - websocketDebuglog("connection errored - %s", err.message); - }); - diagnosticsChannel.channel("undici:websocket:ping").subscribe((evt) => { - websocketDebuglog("ping received"); - }); - diagnosticsChannel.channel("undici:websocket:pong").subscribe((evt) => { - websocketDebuglog("pong received"); - }); - } - module2.exports = { - channels - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/request.js -var require_request = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/request.js"(exports2, module2) { - "use strict"; - var { - InvalidArgumentError, - NotSupportedError - } = require_errors(); - var assert5 = require("node:assert"); - var { - isValidHTTPToken, - isValidHeaderValue, - isStream: isStream2, - destroy, - isBuffer, - isFormDataLike, - isIterable, - isBlobLike, - buildURL, - validateHandler, - getServerName, - normalizedMethodRecords - } = require_util(); - var { channels } = require_diagnostics(); - var { headerNameLowerCasedRecord } = require_constants2(); - var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = /* @__PURE__ */ Symbol("handler"); - var Request = class { - constructor(origin, { - path: path16, - method, - body, - headers, - query, - idempotent, - blocking, - upgrade, - headersTimeout, - bodyTimeout, - reset, - throwOnError, - expectContinue, - servername - }, handler) { - if (typeof path16 !== "string") { - throw new InvalidArgumentError("path must be a string"); - } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { - throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path16)) { - throw new InvalidArgumentError("invalid request path"); - } - if (typeof method !== "string") { - throw new InvalidArgumentError("method must be a string"); - } else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) { - throw new InvalidArgumentError("invalid request method"); - } - if (upgrade && typeof upgrade !== "string") { - throw new InvalidArgumentError("upgrade must be a string"); - } - if (upgrade && !isValidHeaderValue(upgrade)) { - throw new InvalidArgumentError("invalid upgrade header"); - } - if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { - throw new InvalidArgumentError("invalid headersTimeout"); - } - if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { - throw new InvalidArgumentError("invalid bodyTimeout"); - } - if (reset != null && typeof reset !== "boolean") { - throw new InvalidArgumentError("invalid reset"); - } - if (expectContinue != null && typeof expectContinue !== "boolean") { - throw new InvalidArgumentError("invalid expectContinue"); - } - this.headersTimeout = headersTimeout; - this.bodyTimeout = bodyTimeout; - this.throwOnError = throwOnError === true; - this.method = method; - this.abort = null; - if (body == null) { - this.body = null; - } else if (isStream2(body)) { - this.body = body; - const rState = this.body._readableState; - if (!rState || !rState.autoDestroy) { - this.endHandler = function autoDestroy() { - destroy(this); - }; - this.body.on("end", this.endHandler); - } - this.errorHandler = (err) => { - if (this.abort) { - this.abort(err); - } else { - this.error = err; - } - }; - this.body.on("error", this.errorHandler); - } else if (isBuffer(body)) { - this.body = body.byteLength ? body : null; - } else if (ArrayBuffer.isView(body)) { - this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; - } else if (body instanceof ArrayBuffer) { - this.body = body.byteLength ? Buffer.from(body) : null; - } else if (typeof body === "string") { - this.body = body.length ? Buffer.from(body) : null; - } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) { - this.body = body; - } else { - throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); - } - this.completed = false; - this.aborted = false; - this.upgrade = upgrade || null; - this.path = query ? buildURL(path16, query) : path16; - this.origin = origin; - this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; - this.blocking = blocking == null ? false : blocking; - this.reset = reset == null ? null : reset; - this.host = null; - this.contentLength = null; - this.contentType = null; - this.headers = []; - this.expectContinue = expectContinue != null ? expectContinue : false; - if (Array.isArray(headers)) { - if (headers.length % 2 !== 0) { - throw new InvalidArgumentError("headers array must be even"); - } - for (let i = 0; i < headers.length; i += 2) { - processHeader(this, headers[i], headers[i + 1]); - } - } else if (headers && typeof headers === "object") { - if (headers[Symbol.iterator]) { - for (const header of headers) { - if (!Array.isArray(header) || header.length !== 2) { - throw new InvalidArgumentError("headers must be in key-value pair format"); - } - processHeader(this, header[0], header[1]); - } - } else { - const keys = Object.keys(headers); - for (let i = 0; i < keys.length; ++i) { - processHeader(this, keys[i], headers[keys[i]]); - } - } - } else if (headers != null) { - throw new InvalidArgumentError("headers must be an object or an array"); + /** + * Low-level explicit read method. + * + * In objectMode, the argument is ignored, and one item is returned if + * available. + * + * `n` is the number of bytes (or in the case of encoding streams, + * characters) to consume. If `n` is not provided, then the entire buffer + * is returned, or `null` is returned if no data is available. + * + * If `n` is greater that the amount of data in the internal buffer, + * then `null` is returned. + */ + read(n) { + if (this[DESTROYED]) + return null; + this[DISCARDED] = false; + if (this[BUFFERLENGTH] === 0 || n === 0 || n && n > this[BUFFERLENGTH]) { + this[MAYBE_EMIT_END](); + return null; } - validateHandler(handler, method, upgrade); - this.servername = servername || getServerName(this.host); - this[kHandler] = handler; - if (channels.create.hasSubscribers) { - channels.create.publish({ request: this }); + if (this[OBJECTMODE]) + n = null; + if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { + this[BUFFER] = [ + this[ENCODING] ? this[BUFFER].join("") : Buffer.concat(this[BUFFER], this[BUFFERLENGTH]) + ]; } + const ret = this[READ](n || null, this[BUFFER][0]); + this[MAYBE_EMIT_END](); + return ret; } - onBodySent(chunk) { - if (this[kHandler].onBodySent) { - try { - return this[kHandler].onBodySent(chunk); - } catch (err) { - this.abort(err); + [READ](n, chunk) { + if (this[OBJECTMODE]) + this[BUFFERSHIFT](); + else { + const c = chunk; + if (n === c.length || n === null) + this[BUFFERSHIFT](); + else if (typeof c === "string") { + this[BUFFER][0] = c.slice(n); + chunk = c.slice(0, n); + this[BUFFERLENGTH] -= n; + } else { + this[BUFFER][0] = c.subarray(n); + chunk = c.subarray(0, n); + this[BUFFERLENGTH] -= n; } } + this.emit("data", chunk); + if (!this[BUFFER].length && !this[EOF]) + this.emit("drain"); + return chunk; } - onRequestSent() { - if (channels.bodySent.hasSubscribers) { - channels.bodySent.publish({ request: this }); - } - if (this[kHandler].onRequestSent) { - try { - return this[kHandler].onRequestSent(); - } catch (err) { - this.abort(err); - } - } - } - onConnect(abort) { - assert5(!this.aborted); - assert5(!this.completed); - if (this.error) { - abort(this.error); - } else { - this.abort = abort; - return this[kHandler].onConnect(abort); - } - } - onResponseStarted() { - return this[kHandler].onResponseStarted?.(); - } - onHeaders(statusCode, headers, resume, statusText) { - assert5(!this.aborted); - assert5(!this.completed); - if (channels.headers.hasSubscribers) { - channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); - } - try { - return this[kHandler].onHeaders(statusCode, headers, resume, statusText); - } catch (err) { - this.abort(err); - } - } - onData(chunk) { - assert5(!this.aborted); - assert5(!this.completed); - try { - return this[kHandler].onData(chunk); - } catch (err) { - this.abort(err); - return false; - } - } - onUpgrade(statusCode, headers, socket) { - assert5(!this.aborted); - assert5(!this.completed); - return this[kHandler].onUpgrade(statusCode, headers, socket); - } - onComplete(trailers) { - this.onFinally(); - assert5(!this.aborted); - this.completed = true; - if (channels.trailers.hasSubscribers) { - channels.trailers.publish({ request: this, trailers }); - } - try { - return this[kHandler].onComplete(trailers); - } catch (err) { - this.onError(err); - } - } - onError(error) { - this.onFinally(); - if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error }); - } - if (this.aborted) { - return; - } - this.aborted = true; - return this[kHandler].onError(error); - } - onFinally() { - if (this.errorHandler) { - this.body.off("error", this.errorHandler); - this.errorHandler = null; + end(chunk, encoding, cb) { + if (typeof chunk === "function") { + cb = chunk; + chunk = void 0; } - if (this.endHandler) { - this.body.off("end", this.endHandler); - this.endHandler = null; + if (typeof encoding === "function") { + cb = encoding; + encoding = "utf8"; } - } - addHeader(key, value) { - processHeader(this, key, value); + if (chunk !== void 0) + this.write(chunk, encoding); + if (cb) + this.once("end", cb); + this[EOF] = true; + this.writable = false; + if (this[FLOWING] || !this[PAUSED]) + this[MAYBE_EMIT_END](); return this; } - }; - function processHeader(request, key, val) { - if (val && (typeof val === "object" && !Array.isArray(val))) { - throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val === void 0) { - return; - } - let headerName = headerNameLowerCasedRecord[key]; - if (headerName === void 0) { - headerName = key.toLowerCase(); - if (headerNameLowerCasedRecord[headerName] === void 0 && !isValidHTTPToken(headerName)) { - throw new InvalidArgumentError("invalid header key"); - } - } - if (Array.isArray(val)) { - const arr = []; - for (let i = 0; i < val.length; i++) { - if (typeof val[i] === "string") { - if (!isValidHeaderValue(val[i])) { - throw new InvalidArgumentError(`invalid ${key} header`); - } - arr.push(val[i]); - } else if (val[i] === null) { - arr.push(""); - } else if (typeof val[i] === "object") { - throw new InvalidArgumentError(`invalid ${key} header`); - } else { - arr.push(`${val[i]}`); - } - } - val = arr; - } else if (typeof val === "string") { - if (!isValidHeaderValue(val)) { - throw new InvalidArgumentError(`invalid ${key} header`); - } - } else if (val === null) { - val = ""; - } else { - val = `${val}`; - } - if (headerName === "host") { - if (request.host !== null) { - throw new InvalidArgumentError("duplicate host header"); - } - if (typeof val !== "string") { - throw new InvalidArgumentError("invalid host header"); - } - request.host = val; - } else if (headerName === "content-length") { - if (request.contentLength !== null) { - throw new InvalidArgumentError("duplicate content-length header"); - } - request.contentLength = parseInt(val, 10); - if (!Number.isFinite(request.contentLength)) { - throw new InvalidArgumentError("invalid content-length header"); - } - } else if (request.contentType === null && headerName === "content-type") { - request.contentType = val; - request.headers.push(key, val); - } else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") { - throw new InvalidArgumentError(`invalid ${headerName} header`); - } else if (headerName === "connection") { - const value = typeof val === "string" ? val.toLowerCase() : null; - if (value !== "close" && value !== "keep-alive") { - throw new InvalidArgumentError("invalid connection header"); - } - if (value === "close") { - request.reset = true; - } - } else if (headerName === "expect") { - throw new NotSupportedError("expect header not supported"); - } else { - request.headers.push(key, val); - } - } - module2.exports = Request; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/util/timers.js -var require_timers = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/util/timers.js"(exports2, module2) { - "use strict"; - var fastNow = 0; - var RESOLUTION_MS = 1e3; - var TICK_MS = (RESOLUTION_MS >> 1) - 1; - var fastNowTimeout; - var kFastTimer = /* @__PURE__ */ Symbol("kFastTimer"); - var fastTimers = []; - var NOT_IN_LIST = -2; - var TO_BE_CLEARED = -1; - var PENDING2 = 0; - var ACTIVE = 1; - function onTick() { - fastNow += TICK_MS; - let idx = 0; - let len = fastTimers.length; - while (idx < len) { - const timer = fastTimers[idx]; - if (timer._state === PENDING2) { - timer._idleStart = fastNow - TICK_MS; - timer._state = ACTIVE; - } else if (timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout) { - timer._state = TO_BE_CLEARED; - timer._idleStart = -1; - timer._onTimeout(timer._timerArg); - } - if (timer._state === TO_BE_CLEARED) { - timer._state = NOT_IN_LIST; - if (--len !== 0) { - fastTimers[idx] = fastTimers[len]; - } - } else { - ++idx; - } - } - fastTimers.length = len; - if (fastTimers.length !== 0) { - refreshTimeout(); - } - } - function refreshTimeout() { - if (fastNowTimeout) { - fastNowTimeout.refresh(); - } else { - clearTimeout(fastNowTimeout); - fastNowTimeout = setTimeout(onTick, TICK_MS); - if (fastNowTimeout.unref) { - fastNowTimeout.unref(); + // don't let the internal resume be overwritten + [RESUME]() { + if (this[DESTROYED]) + return; + if (!this[DATALISTENERS] && !this[PIPES].length) { + this[DISCARDED] = true; } + this[PAUSED] = false; + this[FLOWING] = true; + this.emit("resume"); + if (this[BUFFER].length) + this[FLUSH](); + else if (this[EOF]) + this[MAYBE_EMIT_END](); + else + this.emit("drain"); } - } - var FastTimer = class { - [kFastTimer] = true; /** - * The state of the timer, which can be one of the following: - * - NOT_IN_LIST (-2) - * - TO_BE_CLEARED (-1) - * - PENDING (0) - * - ACTIVE (1) - * - * @type {-2|-1|0|1} - * @private - */ - _state = NOT_IN_LIST; - /** - * The number of milliseconds to wait before calling the callback. + * Resume the stream if it is currently in a paused state * - * @type {number} - * @private + * If called when there are no pipe destinations or `data` event listeners, + * this will place the stream in a "discarded" state, where all data will + * be thrown away. The discarded state is removed if a pipe destination or + * data handler is added, if pause() is called, or if any synchronous or + * asynchronous iteration is started. */ - _idleTimeout = -1; + resume() { + return this[RESUME](); + } /** - * The time in milliseconds when the timer was started. This value is used to - * calculate when the timer should expire. - * - * @type {number} - * @default -1 - * @private + * Pause the stream */ - _idleStart = -1; + pause() { + this[FLOWING] = false; + this[PAUSED] = true; + this[DISCARDED] = false; + } /** - * The function to be executed when the timer expires. - * @type {Function} - * @private + * true if the stream has been forcibly destroyed */ - _onTimeout; + get destroyed() { + return this[DESTROYED]; + } /** - * The argument to be passed to the callback when the timer expires. - * - * @type {*} - * @private + * true if the stream is currently in a flowing state, meaning that + * any writes will be immediately emitted. */ - _timerArg; + get flowing() { + return this[FLOWING]; + } /** - * @constructor - * @param {Function} callback A function to be executed after the timer - * expires. - * @param {number} delay The time, in milliseconds that the timer should wait - * before the specified function or code is executed. - * @param {*} arg + * true if the stream is currently in a paused state */ - constructor(callback, delay, arg) { - this._onTimeout = callback; - this._idleTimeout = delay; - this._timerArg = arg; - this.refresh(); + get paused() { + return this[PAUSED]; + } + [BUFFERPUSH](chunk) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] += 1; + else + this[BUFFERLENGTH] += chunk.length; + this[BUFFER].push(chunk); + } + [BUFFERSHIFT]() { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] -= 1; + else + this[BUFFERLENGTH] -= this[BUFFER][0].length; + return this[BUFFER].shift(); + } + [FLUSH](noDrain = false) { + do { + } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length); + if (!noDrain && !this[BUFFER].length && !this[EOF]) + this.emit("drain"); + } + [FLUSHCHUNK](chunk) { + this.emit("data", chunk); + return this[FLOWING]; } /** - * Sets the timer's start time to the current time, and reschedules the timer - * to call its callback at the previously specified duration adjusted to the - * current time. - * Using this on a timer that has already called its callback will reactivate - * the timer. + * Pipe all data emitted by this stream into the destination provided. * - * @returns {void} + * Triggers the flow of data. */ - refresh() { - if (this._state === NOT_IN_LIST) { - fastTimers.push(this); - } - if (!fastNowTimeout || fastTimers.length === 1) { - refreshTimeout(); + pipe(dest, opts) { + if (this[DESTROYED]) + return dest; + this[DISCARDED] = false; + const ended = this[EMITTED_END]; + opts = opts || {}; + if (dest === proc.stdout || dest === proc.stderr) + opts.end = false; + else + opts.end = opts.end !== false; + opts.proxyErrors = !!opts.proxyErrors; + if (ended) { + if (opts.end) + dest.end(); + } else { + this[PIPES].push(!opts.proxyErrors ? new Pipe(this, dest, opts) : new PipeProxyErrors(this, dest, opts)); + if (this[ASYNC]) + defer(() => this[RESUME]()); + else + this[RESUME](); } - this._state = PENDING2; + return dest; } /** - * The `clear` method cancels the timer, preventing it from executing. + * Fully unhook a piped destination stream. * - * @returns {void} - * @private + * If the destination stream was the only consumer of this stream (ie, + * there are no other piped destinations or `'data'` event listeners) + * then the flow of data will stop until there is another consumer or + * {@link Minipass#resume} is explicitly called. */ - clear() { - this._state = TO_BE_CLEARED; - this._idleStart = -1; + unpipe(dest) { + const p = this[PIPES].find((p2) => p2.dest === dest); + if (p) { + if (this[PIPES].length === 1) { + if (this[FLOWING] && this[DATALISTENERS] === 0) { + this[FLOWING] = false; + } + this[PIPES] = []; + } else + this[PIPES].splice(this[PIPES].indexOf(p), 1); + p.unpipe(); + } } - }; - module2.exports = { /** - * The setTimeout() method sets a timer which executes a function once the - * timer expires. - * @param {Function} callback A function to be executed after the timer - * expires. - * @param {number} delay The time, in milliseconds that the timer should - * wait before the specified function or code is executed. - * @param {*} [arg] An optional argument to be passed to the callback function - * when the timer expires. - * @returns {NodeJS.Timeout|FastTimer} + * Alias for {@link Minipass#on} */ - setTimeout(callback, delay, arg) { - return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg); - }, + addListener(ev, handler) { + return this.on(ev, handler); + } /** - * The clearTimeout method cancels an instantiated Timer previously created - * by calling setTimeout. + * Mostly identical to `EventEmitter.on`, with the following + * behavior differences to prevent data loss and unnecessary hangs: + * + * - Adding a 'data' event handler will trigger the flow of data * - * @param {NodeJS.Timeout|FastTimer} timeout + * - Adding a 'readable' event handler when there is data waiting to be read + * will cause 'readable' to be emitted immediately. + * + * - Adding an 'endish' event handler ('end', 'finish', etc.) which has + * already passed will cause the event to be emitted immediately and all + * handlers removed. + * + * - Adding an 'error' event handler after an error has been emitted will + * cause the event to be re-emitted immediately with the error previously + * raised. */ - clearTimeout(timeout) { - if (timeout[kFastTimer]) { - timeout.clear(); - } else { - clearTimeout(timeout); + on(ev, handler) { + const ret = super.on(ev, handler); + if (ev === "data") { + this[DISCARDED] = false; + this[DATALISTENERS]++; + if (!this[PIPES].length && !this[FLOWING]) { + this[RESUME](); + } + } else if (ev === "readable" && this[BUFFERLENGTH] !== 0) { + super.emit("readable"); + } else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev); + this.removeAllListeners(ev); + } else if (ev === "error" && this[EMITTED_ERROR]) { + const h = handler; + if (this[ASYNC]) + defer(() => h.call(this, this[EMITTED_ERROR])); + else + h.call(this, this[EMITTED_ERROR]); } - }, + return ret; + } /** - * The setFastTimeout() method sets a fastTimer which executes a function once - * the timer expires. - * @param {Function} callback A function to be executed after the timer - * expires. - * @param {number} delay The time, in milliseconds that the timer should - * wait before the specified function or code is executed. - * @param {*} [arg] An optional argument to be passed to the callback function - * when the timer expires. - * @returns {FastTimer} + * Alias for {@link Minipass#off} */ - setFastTimeout(callback, delay, arg) { - return new FastTimer(callback, delay, arg); - }, + removeListener(ev, handler) { + return this.off(ev, handler); + } /** - * The clearTimeout method cancels an instantiated FastTimer previously - * created by calling setFastTimeout. + * Mostly identical to `EventEmitter.off` * - * @param {FastTimer} timeout + * If a 'data' event handler is removed, and it was the last consumer + * (ie, there are no pipe destinations or other 'data' event listeners), + * then the flow of data will stop until there is another consumer or + * {@link Minipass#resume} is explicitly called. */ - clearFastTimeout(timeout) { - timeout.clear(); - }, + off(ev, handler) { + const ret = super.off(ev, handler); + if (ev === "data") { + this[DATALISTENERS] = this.listeners("data").length; + if (this[DATALISTENERS] === 0 && !this[DISCARDED] && !this[PIPES].length) { + this[FLOWING] = false; + } + } + return ret; + } /** - * The now method returns the value of the internal fast timer clock. + * Mostly identical to `EventEmitter.removeAllListeners` * - * @returns {number} - */ - now() { - return fastNow; - }, - /** - * Trigger the onTick function to process the fastTimers array. - * Exported for testing purposes only. - * Marking as deprecated to discourage any use outside of testing. - * @deprecated - * @param {number} [delay=0] The delay in milliseconds to add to the now value. + * If all 'data' event handlers are removed, and they were the last consumer + * (ie, there are no pipe destinations), then the flow of data will stop + * until there is another consumer or {@link Minipass#resume} is explicitly + * called. */ - tick(delay = 0) { - fastNow += delay - RESOLUTION_MS + 1; - onTick(); - onTick(); - }, + removeAllListeners(ev) { + const ret = super.removeAllListeners(ev); + if (ev === "data" || ev === void 0) { + this[DATALISTENERS] = 0; + if (!this[DISCARDED] && !this[PIPES].length) { + this[FLOWING] = false; + } + } + return ret; + } /** - * Reset FastTimers. - * Exported for testing purposes only. - * Marking as deprecated to discourage any use outside of testing. - * @deprecated + * true if the 'end' event has been emitted */ - reset() { - fastNow = 0; - fastTimers.length = 0; - clearTimeout(fastNowTimeout); - fastNowTimeout = null; - }, + get emittedEnd() { + return this[EMITTED_END]; + } + [MAYBE_EMIT_END]() { + if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this[BUFFER].length === 0 && this[EOF]) { + this[EMITTING_END] = true; + this.emit("end"); + this.emit("prefinish"); + this.emit("finish"); + if (this[CLOSED]) + this.emit("close"); + this[EMITTING_END] = false; + } + } /** - * Exporting for testing purposes only. - * Marking as deprecated to discourage any use outside of testing. - * @deprecated + * Mostly identical to `EventEmitter.emit`, with the following + * behavior differences to prevent data loss and unnecessary hangs: + * + * If the stream has been destroyed, and the event is something other + * than 'close' or 'error', then `false` is returned and no handlers + * are called. + * + * If the event is 'end', and has already been emitted, then the event + * is ignored. If the stream is in a paused or non-flowing state, then + * the event will be deferred until data flow resumes. If the stream is + * async, then handlers will be called on the next tick rather than + * immediately. + * + * If the event is 'close', and 'end' has not yet been emitted, then + * the event will be deferred until after 'end' is emitted. + * + * If the event is 'error', and an AbortSignal was provided for the stream, + * and there are no listeners, then the event is ignored, matching the + * behavior of node core streams in the presense of an AbortSignal. + * + * If the event is 'finish' or 'prefinish', then all listeners will be + * removed after emitting the event, to prevent double-firing. */ - kFastTimer - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/connect.js -var require_connect = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/core/connect.js"(exports2, module2) { - "use strict"; - var net = require("node:net"); - var assert5 = require("node:assert"); - var util = require_util(); - var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); - var timers = require_timers(); - function noop3() { - } - var tls; - var SessionCache; - if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) { - SessionCache = class WeakSessionCache { - constructor(maxCachedSessions) { - this._maxCachedSessions = maxCachedSessions; - this._sessionCache = /* @__PURE__ */ new Map(); - this._sessionRegistry = new global.FinalizationRegistry((key) => { - if (this._sessionCache.size < this._maxCachedSessions) { - return; - } - const ref = this._sessionCache.get(key); - if (ref !== void 0 && ref.deref() === void 0) { - this._sessionCache.delete(key); - } - }); - } - get(sessionKey) { - const ref = this._sessionCache.get(sessionKey); - return ref ? ref.deref() : null; - } - set(sessionKey, session) { - if (this._maxCachedSessions === 0) { - return; - } - this._sessionCache.set(sessionKey, new WeakRef(session)); - this._sessionRegistry.register(session, sessionKey); - } - }; - } else { - SessionCache = class SimpleSessionCache { - constructor(maxCachedSessions) { - this._maxCachedSessions = maxCachedSessions; - this._sessionCache = /* @__PURE__ */ new Map(); + emit(ev, ...args) { + const data = args[0]; + if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) { + return false; + } else if (ev === "data") { + return !this[OBJECTMODE] && !data ? false : this[ASYNC] ? (defer(() => this[EMITDATA](data)), true) : this[EMITDATA](data); + } else if (ev === "end") { + return this[EMITEND](); + } else if (ev === "close") { + this[CLOSED] = true; + if (!this[EMITTED_END] && !this[DESTROYED]) + return false; + const ret2 = super.emit("close"); + this.removeAllListeners("close"); + return ret2; + } else if (ev === "error") { + this[EMITTED_ERROR] = data; + super.emit(ERROR, data); + const ret2 = !this[SIGNAL] || this.listeners("error").length ? super.emit("error", data) : false; + this[MAYBE_EMIT_END](); + return ret2; + } else if (ev === "resume") { + const ret2 = super.emit("resume"); + this[MAYBE_EMIT_END](); + return ret2; + } else if (ev === "finish" || ev === "prefinish") { + const ret2 = super.emit(ev); + this.removeAllListeners(ev); + return ret2; } - get(sessionKey) { - return this._sessionCache.get(sessionKey); + const ret = super.emit(ev, ...args); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITDATA](data) { + for (const p of this[PIPES]) { + if (p.dest.write(data) === false) + this.pause(); } - set(sessionKey, session) { - if (this._maxCachedSessions === 0) { - return; - } - if (this._sessionCache.size >= this._maxCachedSessions) { - const { value: oldestKey } = this._sessionCache.keys().next(); - this._sessionCache.delete(oldestKey); + const ret = this[DISCARDED] ? false : super.emit("data", data); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITEND]() { + if (this[EMITTED_END]) + return false; + this[EMITTED_END] = true; + this.readable = false; + return this[ASYNC] ? (defer(() => this[EMITEND2]()), true) : this[EMITEND2](); + } + [EMITEND2]() { + if (this[DECODER]) { + const data = this[DECODER].end(); + if (data) { + for (const p of this[PIPES]) { + p.dest.write(data); + } + if (!this[DISCARDED]) + super.emit("data", data); } - this._sessionCache.set(sessionKey, session); } - }; - } - function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { - if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { - throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); - } - const options = { path: socketPath, ...opts }; - const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); - timeout = timeout == null ? 1e4 : timeout; - allowH2 = allowH2 != null ? allowH2 : false; - return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { - let socket; - if (protocol === "https:") { - if (!tls) { - tls = require("node:tls"); - } - servername = servername || options.servername || util.getServerName(host) || null; - const sessionKey = servername || hostname; - assert5(sessionKey); - const session = customSession || sessionCache.get(sessionKey) || null; - port = port || 443; - socket = tls.connect({ - highWaterMark: 16384, - // TLS in node can't have bigger HWM anyway... - ...options, - servername, - session, - localAddress, - // TODO(HTTP/2): Add support for h2c - ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], - socket: httpSocket, - // upgrade socket connection - port, - host: hostname - }); - socket.on("session", function(session2) { - sessionCache.set(sessionKey, session2); - }); - } else { - assert5(!httpSocket, "httpSocket can only be sent on TLS update"); - port = port || 80; - socket = net.connect({ - highWaterMark: 64 * 1024, - // Same as nodejs fs streams. - ...options, - localAddress, - port, - host: hostname - }); + for (const p of this[PIPES]) { + p.end(); } - if (options.keepAlive == null || options.keepAlive) { - const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; - socket.setKeepAlive(true, keepAliveInitialDelay); - } - const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }); - socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { - queueMicrotask(clearConnectTimeout); - if (callback) { - const cb = callback; - callback = null; - cb(null, this); - } - }).on("error", function(err) { - queueMicrotask(clearConnectTimeout); - if (callback) { - const cb = callback; - callback = null; - cb(err); - } - }); - return socket; - }; - } - var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => { - if (!opts.timeout) { - return noop3; - } - let s1 = null; - let s2 = null; - const fastTimer = timers.setFastTimeout(() => { - s1 = setImmediate(() => { - s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)); + const ret = super.emit("end"); + this.removeAllListeners("end"); + return ret; + } + /** + * Return a Promise that resolves to an array of all emitted data once + * the stream ends. + */ + async collect() { + const buf = Object.assign([], { + dataLength: 0 }); - }, opts.timeout); - return () => { - timers.clearFastTimeout(fastTimer); - clearImmediate(s1); - clearImmediate(s2); - }; - } : (socketWeakRef, opts) => { - if (!opts.timeout) { - return noop3; - } - let s1 = null; - const fastTimer = timers.setFastTimeout(() => { - s1 = setImmediate(() => { - onConnectTimeout(socketWeakRef.deref(), opts); + if (!this[OBJECTMODE]) + buf.dataLength = 0; + const p = this.promise(); + this.on("data", (c) => { + buf.push(c); + if (!this[OBJECTMODE]) + buf.dataLength += c.length; }); - }, opts.timeout); - return () => { - timers.clearFastTimeout(fastTimer); - clearImmediate(s1); - }; - }; - function onConnectTimeout(socket, opts) { - if (socket == null) { - return; - } - let message = "Connect Timeout Error"; - if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) { - message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`; - } else { - message += ` (attempted address: ${opts.hostname}:${opts.port},`; + await p; + return buf; } - message += ` timeout: ${opts.timeout}ms)`; - util.destroy(socket, new ConnectTimeoutError(message)); - } - module2.exports = buildConnector; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/utils.js -var require_utils = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.enumToMap = void 0; - function enumToMap(obj) { - const res = {}; - Object.keys(obj).forEach((key) => { - const value = obj[key]; - if (typeof value === "number") { - res[key] = value; + /** + * Return a Promise that resolves to the concatenation of all emitted data + * once the stream ends. + * + * Not allowed on objectMode streams. + */ + async concat() { + if (this[OBJECTMODE]) { + throw new Error("cannot concat in objectMode"); } - }); - return res; - } - exports2.enumToMap = enumToMap; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/constants.js -var require_constants3 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0; - var utils_1 = require_utils(); - var ERROR2; - (function(ERROR3) { - ERROR3[ERROR3["OK"] = 0] = "OK"; - ERROR3[ERROR3["INTERNAL"] = 1] = "INTERNAL"; - ERROR3[ERROR3["STRICT"] = 2] = "STRICT"; - ERROR3[ERROR3["LF_EXPECTED"] = 3] = "LF_EXPECTED"; - ERROR3[ERROR3["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; - ERROR3[ERROR3["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; - ERROR3[ERROR3["INVALID_METHOD"] = 6] = "INVALID_METHOD"; - ERROR3[ERROR3["INVALID_URL"] = 7] = "INVALID_URL"; - ERROR3[ERROR3["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; - ERROR3[ERROR3["INVALID_VERSION"] = 9] = "INVALID_VERSION"; - ERROR3[ERROR3["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; - ERROR3[ERROR3["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; - ERROR3[ERROR3["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; - ERROR3[ERROR3["INVALID_STATUS"] = 13] = "INVALID_STATUS"; - ERROR3[ERROR3["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; - ERROR3[ERROR3["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; - ERROR3[ERROR3["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; - ERROR3[ERROR3["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; - ERROR3[ERROR3["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; - ERROR3[ERROR3["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; - ERROR3[ERROR3["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; - ERROR3[ERROR3["PAUSED"] = 21] = "PAUSED"; - ERROR3[ERROR3["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; - ERROR3[ERROR3["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; - ERROR3[ERROR3["USER"] = 24] = "USER"; - })(ERROR2 = exports2.ERROR || (exports2.ERROR = {})); - var TYPE; - (function(TYPE2) { - TYPE2[TYPE2["BOTH"] = 0] = "BOTH"; - TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST"; - TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE"; - })(TYPE = exports2.TYPE || (exports2.TYPE = {})); - var FLAGS; - (function(FLAGS2) { - FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; - FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; - FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; - FLAGS2[FLAGS2["CHUNKED"] = 8] = "CHUNKED"; - FLAGS2[FLAGS2["UPGRADE"] = 16] = "UPGRADE"; - FLAGS2[FLAGS2["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; - FLAGS2[FLAGS2["SKIPBODY"] = 64] = "SKIPBODY"; - FLAGS2[FLAGS2["TRAILING"] = 128] = "TRAILING"; - FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; - })(FLAGS = exports2.FLAGS || (exports2.FLAGS = {})); - var LENIENT_FLAGS; - (function(LENIENT_FLAGS2) { - LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS"; - LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; - LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; - })(LENIENT_FLAGS = exports2.LENIENT_FLAGS || (exports2.LENIENT_FLAGS = {})); - var METHODS; - (function(METHODS2) { - METHODS2[METHODS2["DELETE"] = 0] = "DELETE"; - METHODS2[METHODS2["GET"] = 1] = "GET"; - METHODS2[METHODS2["HEAD"] = 2] = "HEAD"; - METHODS2[METHODS2["POST"] = 3] = "POST"; - METHODS2[METHODS2["PUT"] = 4] = "PUT"; - METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT"; - METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS"; - METHODS2[METHODS2["TRACE"] = 7] = "TRACE"; - METHODS2[METHODS2["COPY"] = 8] = "COPY"; - METHODS2[METHODS2["LOCK"] = 9] = "LOCK"; - METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL"; - METHODS2[METHODS2["MOVE"] = 11] = "MOVE"; - METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND"; - METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH"; - METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH"; - METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK"; - METHODS2[METHODS2["BIND"] = 16] = "BIND"; - METHODS2[METHODS2["REBIND"] = 17] = "REBIND"; - METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND"; - METHODS2[METHODS2["ACL"] = 19] = "ACL"; - METHODS2[METHODS2["REPORT"] = 20] = "REPORT"; - METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY"; - METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT"; - METHODS2[METHODS2["MERGE"] = 23] = "MERGE"; - METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH"; - METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY"; - METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE"; - METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; - METHODS2[METHODS2["PATCH"] = 28] = "PATCH"; - METHODS2[METHODS2["PURGE"] = 29] = "PURGE"; - METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR"; - METHODS2[METHODS2["LINK"] = 31] = "LINK"; - METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK"; - METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE"; - METHODS2[METHODS2["PRI"] = 34] = "PRI"; - METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE"; - METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE"; - METHODS2[METHODS2["SETUP"] = 37] = "SETUP"; - METHODS2[METHODS2["PLAY"] = 38] = "PLAY"; - METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE"; - METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN"; - METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER"; - METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER"; - METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT"; - METHODS2[METHODS2["RECORD"] = 44] = "RECORD"; - METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH"; - })(METHODS = exports2.METHODS || (exports2.METHODS = {})); - exports2.METHODS_HTTP = [ - METHODS.DELETE, - METHODS.GET, - METHODS.HEAD, - METHODS.POST, - METHODS.PUT, - METHODS.CONNECT, - METHODS.OPTIONS, - METHODS.TRACE, - METHODS.COPY, - METHODS.LOCK, - METHODS.MKCOL, - METHODS.MOVE, - METHODS.PROPFIND, - METHODS.PROPPATCH, - METHODS.SEARCH, - METHODS.UNLOCK, - METHODS.BIND, - METHODS.REBIND, - METHODS.UNBIND, - METHODS.ACL, - METHODS.REPORT, - METHODS.MKACTIVITY, - METHODS.CHECKOUT, - METHODS.MERGE, - METHODS["M-SEARCH"], - METHODS.NOTIFY, - METHODS.SUBSCRIBE, - METHODS.UNSUBSCRIBE, - METHODS.PATCH, - METHODS.PURGE, - METHODS.MKCALENDAR, - METHODS.LINK, - METHODS.UNLINK, - METHODS.PRI, - // TODO(indutny): should we allow it with HTTP? - METHODS.SOURCE - ]; - exports2.METHODS_ICE = [ - METHODS.SOURCE - ]; - exports2.METHODS_RTSP = [ - METHODS.OPTIONS, - METHODS.DESCRIBE, - METHODS.ANNOUNCE, - METHODS.SETUP, - METHODS.PLAY, - METHODS.PAUSE, - METHODS.TEARDOWN, - METHODS.GET_PARAMETER, - METHODS.SET_PARAMETER, - METHODS.REDIRECT, - METHODS.RECORD, - METHODS.FLUSH, - // For AirPlay - METHODS.GET, - METHODS.POST - ]; - exports2.METHOD_MAP = utils_1.enumToMap(METHODS); - exports2.H_METHOD_MAP = {}; - Object.keys(exports2.METHOD_MAP).forEach((key) => { - if (/^H/.test(key)) { - exports2.H_METHOD_MAP[key] = exports2.METHOD_MAP[key]; - } - }); - var FINISH; - (function(FINISH2) { - FINISH2[FINISH2["SAFE"] = 0] = "SAFE"; - FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; - FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE"; - })(FINISH = exports2.FINISH || (exports2.FINISH = {})); - exports2.ALPHA = []; - for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) { - exports2.ALPHA.push(String.fromCharCode(i)); - exports2.ALPHA.push(String.fromCharCode(i + 32)); - } - exports2.NUM_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9 - }; - exports2.HEX_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9, - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15, - a: 10, - b: 11, - c: 12, - d: 13, - e: 14, - f: 15 - }; - exports2.NUM = [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9" - ]; - exports2.ALPHANUM = exports2.ALPHA.concat(exports2.NUM); - exports2.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"]; - exports2.USERINFO_CHARS = exports2.ALPHANUM.concat(exports2.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]); - exports2.STRICT_URL_CHAR = [ - "!", - '"', - "$", - "%", - "&", - "'", - "(", - ")", - "*", - "+", - ",", - "-", - ".", - "/", - ":", - ";", - "<", - "=", - ">", - "@", - "[", - "\\", - "]", - "^", - "_", - "`", - "{", - "|", - "}", - "~" - ].concat(exports2.ALPHANUM); - exports2.URL_CHAR = exports2.STRICT_URL_CHAR.concat([" ", "\f"]); - for (let i = 128; i <= 255; i++) { - exports2.URL_CHAR.push(i); - } - exports2.HEX = exports2.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]); - exports2.STRICT_TOKEN = [ - "!", - "#", - "$", - "%", - "&", - "'", - "*", - "+", - "-", - ".", - "^", - "_", - "`", - "|", - "~" - ].concat(exports2.ALPHANUM); - exports2.TOKEN = exports2.STRICT_TOKEN.concat([" "]); - exports2.HEADER_CHARS = [" "]; - for (let i = 32; i <= 255; i++) { - if (i !== 127) { - exports2.HEADER_CHARS.push(i); + const buf = await this.collect(); + return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength); } - } - exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((c) => c !== 44); - exports2.MAJOR = exports2.NUM_MAP; - exports2.MINOR = exports2.MAJOR; - var HEADER_STATE; - (function(HEADER_STATE2) { - HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL"; - HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION"; - HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; - HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; - HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE"; - HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; - HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; - HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; - HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; - })(HEADER_STATE = exports2.HEADER_STATE || (exports2.HEADER_STATE = {})); - exports2.SPECIAL_HEADERS = { - "connection": HEADER_STATE.CONNECTION, - "content-length": HEADER_STATE.CONTENT_LENGTH, - "proxy-connection": HEADER_STATE.CONNECTION, - "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING, - "upgrade": HEADER_STATE.UPGRADE - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/llhttp-wasm.js -var require_llhttp_wasm = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports2, module2) { - "use strict"; - var { Buffer: Buffer3 } = require("node:buffer"); - module2.exports = Buffer3.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AA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UcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8A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gAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFq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EBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv", "base64"); - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js -var require_llhttp_simd_wasm = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports2, module2) { - "use strict"; - var { Buffer: Buffer3 } = require("node:buffer"); - module2.exports = Buffer3.from("AGFzbQEAAAABJwdgAX8Bf2AD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ADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3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FBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAE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AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsg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UFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==", "base64"); - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/constants.js -var require_constants4 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/constants.js"(exports2, module2) { - "use strict"; - var corsSafeListedMethods = ( - /** @type {const} */ - ["GET", "HEAD", "POST"] - ); - var corsSafeListedMethodsSet = new Set(corsSafeListedMethods); - var nullBodyStatus = ( - /** @type {const} */ - [101, 204, 205, 304] - ); - var redirectStatus = ( - /** @type {const} */ - [301, 302, 303, 307, 308] - ); - var redirectStatusSet = new Set(redirectStatus); - var badPorts = ( - /** @type {const} */ - [ - "1", - "7", - "9", - "11", - "13", - "15", - "17", - "19", - "20", - "21", - "22", - "23", - "25", - "37", - "42", - "43", - "53", - "69", - "77", - "79", - "87", - "95", - "101", - "102", - "103", - "104", - "109", - "110", - "111", - "113", - "115", - "117", - "119", - "123", - "135", - "137", - "139", - "143", - "161", - "179", - "389", - "427", - "465", - "512", - "513", - "514", - "515", - "526", - "530", - "531", - "532", - "540", - "548", - "554", - "556", - "563", - "587", - "601", - "636", - "989", - "990", - "993", - "995", - "1719", - "1720", - "1723", - "2049", - "3659", - "4045", - "4190", - "5060", - "5061", - "6000", - "6566", - "6665", - "6666", - "6667", - "6668", - "6669", - "6679", - "6697", - "10080" - ] - ); - var badPortsSet = new Set(badPorts); - var referrerPolicy = ( - /** @type {const} */ - [ - "", - "no-referrer", - "no-referrer-when-downgrade", - "same-origin", - "origin", - "strict-origin", - "origin-when-cross-origin", - "strict-origin-when-cross-origin", - "unsafe-url" - ] - ); - var referrerPolicySet = new Set(referrerPolicy); - var requestRedirect = ( - /** @type {const} */ - ["follow", "manual", "error"] - ); - var safeMethods = ( - /** @type {const} */ - ["GET", "HEAD", "OPTIONS", "TRACE"] - ); - var safeMethodsSet = new Set(safeMethods); - var requestMode = ( - /** @type {const} */ - ["navigate", "same-origin", "no-cors", "cors"] - ); - var requestCredentials = ( - /** @type {const} */ - ["omit", "same-origin", "include"] - ); - var requestCache = ( - /** @type {const} */ - [ - "default", - "no-store", - "reload", - "no-cache", - "force-cache", - "only-if-cached" - ] - ); - var requestBodyHeader = ( - /** @type {const} */ - [ - "content-encoding", - "content-language", - "content-location", - "content-type", - // See https://github.com/nodejs/undici/issues/2021 - // 'Content-Length' is a forbidden header name, which is typically - // removed in the Headers implementation. However, undici doesn't - // filter out headers, so we add it here. - "content-length" - ] - ); - var requestDuplex = ( - /** @type {const} */ - [ - "half" - ] - ); - var forbiddenMethods = ( - /** @type {const} */ - ["CONNECT", "TRACE", "TRACK"] - ); - var forbiddenMethodsSet = new Set(forbiddenMethods); - var subresource = ( - /** @type {const} */ - [ - "audio", - "audioworklet", - "font", - "image", - "manifest", - "paintworklet", - "script", - "style", - "track", - "video", - "xslt", - "" - ] - ); - var subresourceSet = new Set(subresource); - module2.exports = { - subresource, - forbiddenMethods, - requestBodyHeader, - referrerPolicy, - requestRedirect, - requestMode, - requestCredentials, - requestCache, - redirectStatus, - corsSafeListedMethods, - nullBodyStatus, - safeMethods, - badPorts, - requestDuplex, - subresourceSet, - badPortsSet, - redirectStatusSet, - corsSafeListedMethodsSet, - safeMethodsSet, - forbiddenMethodsSet, - referrerPolicySet - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/global.js -var require_global = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/global.js"(exports2, module2) { - "use strict"; - var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); - function getGlobalOrigin() { - return globalThis[globalOrigin]; - } - function setGlobalOrigin(newOrigin) { - if (newOrigin === void 0) { - Object.defineProperty(globalThis, globalOrigin, { - value: void 0, - writable: true, - enumerable: false, - configurable: false + /** + * Return a void Promise that resolves once the stream ends. + */ + async promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error("stream destroyed"))); + this.on("error", (er) => reject(er)); + this.on("end", () => resolve()); }); - return; - } - const parsedURL = new URL(newOrigin); - if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") { - throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`); } - Object.defineProperty(globalThis, globalOrigin, { - value: parsedURL, - writable: true, - enumerable: false, - configurable: false - }); - } - module2.exports = { - getGlobalOrigin, - setGlobalOrigin - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/data-url.js -var require_data_url = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/data-url.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var encoder = new TextEncoder(); - var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/; - var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/; - var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g; - var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/; - function dataURLProcessor(dataURL) { - assert5(dataURL.protocol === "data:"); - let input = URLSerializer(dataURL, true); - input = input.slice(5); - const position = { position: 0 }; - let mimeType = collectASequenceOfCodePointsFast( - ",", - input, - position - ); - const mimeTypeLength = mimeType.length; - mimeType = removeASCIIWhitespace(mimeType, true, true); - if (position.position >= input.length) { - return "failure"; - } - position.position++; - const encodedBody = input.slice(mimeTypeLength + 1); - let body = stringPercentDecode(encodedBody); - if (/;(\u0020){0,}base64$/i.test(mimeType)) { - const stringBody = isomorphicDecode(body); - body = forgivingBase64(stringBody); - if (body === "failure") { - return "failure"; - } - mimeType = mimeType.slice(0, -6); - mimeType = mimeType.replace(/(\u0020)+$/, ""); - mimeType = mimeType.slice(0, -1); - } - if (mimeType.startsWith(";")) { - mimeType = "text/plain" + mimeType; - } - let mimeTypeRecord = parseMIMEType(mimeType); - if (mimeTypeRecord === "failure") { - mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII"); - } - return { mimeType: mimeTypeRecord, body }; - } - function URLSerializer(url, excludeFragment = false) { - if (!excludeFragment) { - return url.href; - } - const href = url.href; - const hashLength = url.hash.length; - const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength); - if (!hashLength && href.endsWith("#")) { - return serialized.slice(0, -1); + /** + * Asynchronous `for await of` iteration. + * + * This will continue emitting all chunks until the stream terminates. + */ + [Symbol.asyncIterator]() { + this[DISCARDED] = false; + let stopped = false; + const stop = async () => { + this.pause(); + stopped = true; + return { value: void 0, done: true }; + }; + const next = () => { + if (stopped) + return stop(); + const res = this.read(); + if (res !== null) + return Promise.resolve({ done: false, value: res }); + if (this[EOF]) + return stop(); + let resolve; + let reject; + const onerr = (er) => { + this.off("data", ondata); + this.off("end", onend); + this.off(DESTROYED, ondestroy); + stop(); + reject(er); + }; + const ondata = (value) => { + this.off("error", onerr); + this.off("end", onend); + this.off(DESTROYED, ondestroy); + this.pause(); + resolve({ value, done: !!this[EOF] }); + }; + const onend = () => { + this.off("error", onerr); + this.off("data", ondata); + this.off(DESTROYED, ondestroy); + stop(); + resolve({ done: true, value: void 0 }); + }; + const ondestroy = () => onerr(new Error("stream destroyed")); + return new Promise((res2, rej) => { + reject = rej; + resolve = res2; + this.once(DESTROYED, ondestroy); + this.once("error", onerr); + this.once("end", onend); + this.once("data", ondata); + }); + }; + return { + next, + throw: stop, + return: stop, + [Symbol.asyncIterator]() { + return this; + }, + [Symbol.asyncDispose]: async () => { + } + }; } - return serialized; - } - function collectASequenceOfCodePoints(condition, input, position) { - let result = ""; - while (position.position < input.length && condition(input[position.position])) { - result += input[position.position]; - position.position++; + /** + * Synchronous `for of` iteration. + * + * The iteration will terminate when the internal buffer runs out, even + * if the stream has not yet terminated. + */ + [Symbol.iterator]() { + this[DISCARDED] = false; + let stopped = false; + const stop = () => { + this.pause(); + this.off(ERROR, stop); + this.off(DESTROYED, stop); + this.off("end", stop); + stopped = true; + return { done: true, value: void 0 }; + }; + const next = () => { + if (stopped) + return stop(); + const value = this.read(); + return value === null ? stop() : { done: false, value }; + }; + this.once("end", stop); + this.once(ERROR, stop); + this.once(DESTROYED, stop); + return { + next, + throw: stop, + return: stop, + [Symbol.iterator]() { + return this; + }, + [Symbol.dispose]: () => { + } + }; } - return result; - } - function collectASequenceOfCodePointsFast(char, input, position) { - const idx = input.indexOf(char, position.position); - const start = position.position; - if (idx === -1) { - position.position = input.length; - return input.slice(start); - } - position.position = idx; - return input.slice(start, position.position); - } - function stringPercentDecode(input) { - const bytes = encoder.encode(input); - return percentDecode(bytes); - } - function isHexCharByte(byte) { - return byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102; - } - function hexByteToNumber(byte) { - return ( - // 0-9 - byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55 - ); - } - function percentDecode(input) { - const length = input.length; - const output = new Uint8Array(length); - let j = 0; - for (let i = 0; i < length; ++i) { - const byte = input[i]; - if (byte !== 37) { - output[j++] = byte; - } else if (byte === 37 && !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))) { - output[j++] = 37; - } else { - output[j++] = hexByteToNumber(input[i + 1]) << 4 | hexByteToNumber(input[i + 2]); - i += 2; + /** + * Destroy a stream, preventing it from being used for any further purpose. + * + * If the stream has a `close()` method, then it will be called on + * destruction. + * + * After destruction, any attempt to write data, read data, or emit most + * events will be ignored. + * + * If an error argument is provided, then it will be emitted in an + * 'error' event. + */ + destroy(er) { + if (this[DESTROYED]) { + if (er) + this.emit("error", er); + else + this.emit(DESTROYED); + return this; } + this[DESTROYED] = true; + this[DISCARDED] = true; + this[BUFFER].length = 0; + this[BUFFERLENGTH] = 0; + const wc = this; + if (typeof wc.close === "function" && !this[CLOSED]) + wc.close(); + if (er) + this.emit("error", er); + else + this.emit(DESTROYED); + return this; } - return length === j ? output : output.subarray(0, j); - } - function parseMIMEType(input) { - input = removeHTTPWhitespace(input, true, true); - const position = { position: 0 }; - const type = collectASequenceOfCodePointsFast( - "/", - input, - position - ); - if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { - return "failure"; - } - if (position.position > input.length) { - return "failure"; + /** + * Alias for {@link isStream} + * + * Former export location, maintained for backwards compatibility. + * + * @deprecated + */ + static get isStream() { + return isStream; } - position.position++; - let subtype = collectASequenceOfCodePointsFast( - ";", - input, - position - ); - subtype = removeHTTPWhitespace(subtype, false, true); - if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { - return "failure"; - } - const typeLowercase = type.toLowerCase(); - const subtypeLowercase = subtype.toLowerCase(); - const mimeType = { - type: typeLowercase, - subtype: subtypeLowercase, - /** @type {Map} */ - parameters: /* @__PURE__ */ new Map(), - // https://mimesniff.spec.whatwg.org/#mime-type-essence - essence: `${typeLowercase}/${subtypeLowercase}` - }; - while (position.position < input.length) { - position.position++; - collectASequenceOfCodePoints( - // https://fetch.spec.whatwg.org/#http-whitespace - (char) => HTTP_WHITESPACE_REGEX.test(char), - input, - position - ); - let parameterName = collectASequenceOfCodePoints( - (char) => char !== ";" && char !== "=", - input, - position - ); - parameterName = parameterName.toLowerCase(); - if (position.position < input.length) { - if (input[position.position] === ";") { - continue; - } - position.position++; - } - if (position.position > input.length) { - break; + }; + } +}); + +// node_modules/@isaacs/fs-minipass/dist/esm/index.js +var import_events2, import_fs2, writev, _autoClose, _close, _ended, _fd, _finished, _flags, _flush, _handleChunk, _makeBuf, _mode, _needDrain, _onerror, _onopen, _onread, _onwrite, _open, _path, _pos, _queue, _read, _readSize, _reading, _remain, _size, _write, _writing, _defaultFlag, _errored, ReadStream, ReadStreamSync, WriteStream, WriteStreamSync; +var init_esm2 = __esm({ + "node_modules/@isaacs/fs-minipass/dist/esm/index.js"() { + import_events2 = __toESM(require("events"), 1); + import_fs2 = __toESM(require("fs"), 1); + init_esm(); + writev = import_fs2.default.writev; + _autoClose = /* @__PURE__ */ Symbol("_autoClose"); + _close = /* @__PURE__ */ Symbol("_close"); + _ended = /* @__PURE__ */ Symbol("_ended"); + _fd = /* @__PURE__ */ Symbol("_fd"); + _finished = /* @__PURE__ */ Symbol("_finished"); + _flags = /* @__PURE__ */ Symbol("_flags"); + _flush = /* @__PURE__ */ Symbol("_flush"); + _handleChunk = /* @__PURE__ */ Symbol("_handleChunk"); + _makeBuf = /* @__PURE__ */ Symbol("_makeBuf"); + _mode = /* @__PURE__ */ Symbol("_mode"); + _needDrain = /* @__PURE__ */ Symbol("_needDrain"); + _onerror = /* @__PURE__ */ Symbol("_onerror"); + _onopen = /* @__PURE__ */ Symbol("_onopen"); + _onread = /* @__PURE__ */ Symbol("_onread"); + _onwrite = /* @__PURE__ */ Symbol("_onwrite"); + _open = /* @__PURE__ */ Symbol("_open"); + _path = /* @__PURE__ */ Symbol("_path"); + _pos = /* @__PURE__ */ Symbol("_pos"); + _queue = /* @__PURE__ */ Symbol("_queue"); + _read = /* @__PURE__ */ Symbol("_read"); + _readSize = /* @__PURE__ */ Symbol("_readSize"); + _reading = /* @__PURE__ */ Symbol("_reading"); + _remain = /* @__PURE__ */ Symbol("_remain"); + _size = /* @__PURE__ */ Symbol("_size"); + _write = /* @__PURE__ */ Symbol("_write"); + _writing = /* @__PURE__ */ Symbol("_writing"); + _defaultFlag = /* @__PURE__ */ Symbol("_defaultFlag"); + _errored = /* @__PURE__ */ Symbol("_errored"); + ReadStream = class extends Minipass { + [_errored] = false; + [_fd]; + [_path]; + [_readSize]; + [_reading] = false; + [_size]; + [_remain]; + [_autoClose]; + constructor(path16, opt) { + opt = opt || {}; + super(opt); + this.readable = true; + this.writable = false; + if (typeof path16 !== "string") { + throw new TypeError("path must be a string"); } - let parameterValue = null; - if (input[position.position] === '"') { - parameterValue = collectAnHTTPQuotedString(input, position, true); - collectASequenceOfCodePointsFast( - ";", - input, - position - ); + this[_errored] = false; + this[_fd] = typeof opt.fd === "number" ? opt.fd : void 0; + this[_path] = path16; + this[_readSize] = opt.readSize || 16 * 1024 * 1024; + this[_reading] = false; + this[_size] = typeof opt.size === "number" ? opt.size : Infinity; + this[_remain] = this[_size]; + this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; + if (typeof this[_fd] === "number") { + this[_read](); } else { - parameterValue = collectASequenceOfCodePointsFast( - ";", - input, - position - ); - parameterValue = removeHTTPWhitespace(parameterValue, false, true); - if (parameterValue.length === 0) { - continue; - } - } - if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) { - mimeType.parameters.set(parameterName, parameterValue); + this[_open](); } } - return mimeType; - } - function forgivingBase64(data) { - data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, ""); - let dataLength = data.length; - if (dataLength % 4 === 0) { - if (data.charCodeAt(dataLength - 1) === 61) { - --dataLength; - if (data.charCodeAt(dataLength - 1) === 61) { - --dataLength; - } - } + get fd() { + return this[_fd]; } - if (dataLength % 4 === 1) { - return "failure"; + get path() { + return this[_path]; } - if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) { - return "failure"; + //@ts-ignore + write() { + throw new TypeError("this is a readable stream"); } - const buffer = Buffer.from(data, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } - function collectAnHTTPQuotedString(input, position, extractValue) { - const positionStart = position.position; - let value = ""; - assert5(input[position.position] === '"'); - position.position++; - while (true) { - value += collectASequenceOfCodePoints( - (char) => char !== '"' && char !== "\\", - input, - position - ); - if (position.position >= input.length) { - break; - } - const quoteOrBackslash = input[position.position]; - position.position++; - if (quoteOrBackslash === "\\") { - if (position.position >= input.length) { - value += "\\"; - break; - } - value += input[position.position]; - position.position++; - } else { - assert5(quoteOrBackslash === '"'); - break; - } + //@ts-ignore + end() { + throw new TypeError("this is a readable stream"); } - if (extractValue) { - return value; - } - return input.slice(positionStart, position.position); - } - function serializeAMimeType(mimeType) { - assert5(mimeType !== "failure"); - const { parameters, essence } = mimeType; - let serialization = essence; - for (let [name2, value] of parameters.entries()) { - serialization += ";"; - serialization += name2; - serialization += "="; - if (!HTTP_TOKEN_CODEPOINTS.test(value)) { - value = value.replace(/(\\|")/g, "\\$1"); - value = '"' + value; - value += '"'; - } - serialization += value; - } - return serialization; - } - function isHTTPWhiteSpace(char) { - return char === 13 || char === 10 || char === 9 || char === 32; - } - function removeHTTPWhitespace(str, leading = true, trailing = true) { - return removeChars(str, leading, trailing, isHTTPWhiteSpace); - } - function isASCIIWhitespace(char) { - return char === 13 || char === 10 || char === 9 || char === 12 || char === 32; - } - function removeASCIIWhitespace(str, leading = true, trailing = true) { - return removeChars(str, leading, trailing, isASCIIWhitespace); - } - function removeChars(str, leading, trailing, predicate) { - let lead = 0; - let trail = str.length - 1; - if (leading) { - while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; - } - if (trailing) { - while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; - } - return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); - } - function isomorphicDecode(input) { - const length = input.length; - if ((2 << 15) - 1 > length) { - return String.fromCharCode.apply(null, input); - } - let result = ""; - let i = 0; - let addition = (2 << 15) - 1; - while (i < length) { - if (i + addition > length) { - addition = length - i; - } - result += String.fromCharCode.apply(null, input.subarray(i, i += addition)); + [_open]() { + import_fs2.default.open(this[_path], "r", (er, fd) => this[_onopen](er, fd)); } - return result; - } - function minimizeSupportedMimeType(mimeType) { - switch (mimeType.essence) { - case "application/ecmascript": - case "application/javascript": - case "application/x-ecmascript": - case "application/x-javascript": - case "text/ecmascript": - case "text/javascript": - case "text/javascript1.0": - case "text/javascript1.1": - case "text/javascript1.2": - case "text/javascript1.3": - case "text/javascript1.4": - case "text/javascript1.5": - case "text/jscript": - case "text/livescript": - case "text/x-ecmascript": - case "text/x-javascript": - return "text/javascript"; - case "application/json": - case "text/json": - return "application/json"; - case "image/svg+xml": - return "image/svg+xml"; - case "text/xml": - case "application/xml": - return "application/xml"; - } - if (mimeType.subtype.endsWith("+json")) { - return "application/json"; - } - if (mimeType.subtype.endsWith("+xml")) { - return "application/xml"; - } - return ""; - } - module2.exports = { - dataURLProcessor, - URLSerializer, - collectASequenceOfCodePoints, - collectASequenceOfCodePointsFast, - stringPercentDecode, - parseMIMEType, - collectAnHTTPQuotedString, - serializeAMimeType, - removeChars, - removeHTTPWhitespace, - minimizeSupportedMimeType, - HTTP_TOKEN_CODEPOINTS, - isomorphicDecode - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/webidl.js -var require_webidl = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/webidl.js"(exports2, module2) { - "use strict"; - var { types, inspect } = require("node:util"); - var { markAsUncloneable } = require("node:worker_threads"); - var { toUSVString } = require_util(); - var webidl = {}; - webidl.converters = {}; - webidl.util = {}; - webidl.errors = {}; - webidl.errors.exception = function(message) { - return new TypeError(`${message.header}: ${message.message}`); - }; - webidl.errors.conversionFailed = function(context) { - const plural2 = context.types.length === 1 ? "" : " one of"; - const message = `${context.argument} could not be converted to${plural2}: ${context.types.join(", ")}.`; - return webidl.errors.exception({ - header: context.prefix, - message - }); - }; - webidl.errors.invalidArgument = function(context) { - return webidl.errors.exception({ - header: context.prefix, - message: `"${context.value}" is an invalid ${context.type}.` - }); - }; - webidl.brandCheck = function(V, I, opts) { - if (opts?.strict !== false) { - if (!(V instanceof I)) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; - } - } else { - if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; + [_onopen](er, fd) { + if (er) { + this[_onerror](er); + } else { + this[_fd] = fd; + this.emit("open", fd); + this[_read](); } } - }; - webidl.argumentLengthCheck = function({ length }, min, ctx) { - if (length < min) { - throw webidl.errors.exception({ - message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, - header: ctx - }); + [_makeBuf]() { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])); } - }; - webidl.illegalConstructor = function() { - throw webidl.errors.exception({ - header: "TypeError", - message: "Illegal constructor" - }); - }; - webidl.util.Type = function(V) { - switch (typeof V) { - case "undefined": - return "Undefined"; - case "boolean": - return "Boolean"; - case "string": - return "String"; - case "symbol": - return "Symbol"; - case "number": - return "Number"; - case "bigint": - return "BigInt"; - case "function": - case "object": { - if (V === null) { - return "Null"; + [_read]() { + if (!this[_reading]) { + this[_reading] = true; + const buf = this[_makeBuf](); + if (buf.length === 0) { + return process.nextTick(() => this[_onread](null, 0, buf)); } - return "Object"; + import_fs2.default.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b)); } } - }; - webidl.util.markAsUncloneable = markAsUncloneable || (() => { - }); - webidl.util.ConvertToInt = function(V, bitLength, signedness, opts) { - let upperBound; - let lowerBound; - if (bitLength === 64) { - upperBound = Math.pow(2, 53) - 1; - if (signedness === "unsigned") { - lowerBound = 0; - } else { - lowerBound = Math.pow(-2, 53) + 1; - } - } else if (signedness === "unsigned") { - lowerBound = 0; - upperBound = Math.pow(2, bitLength) - 1; - } else { - lowerBound = Math.pow(-2, bitLength) - 1; - upperBound = Math.pow(2, bitLength - 1) - 1; - } - let x = Number(V); - if (x === 0) { - x = 0; - } - if (opts?.enforceRange === true) { - if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { - throw webidl.errors.exception({ - header: "Integer conversion", - message: `Could not convert ${webidl.util.Stringify(V)} to an integer.` - }); - } - x = webidl.util.IntegerPart(x); - if (x < lowerBound || x > upperBound) { - throw webidl.errors.exception({ - header: "Integer conversion", - message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` - }); + [_onread](er, br, buf) { + this[_reading] = false; + if (er) { + this[_onerror](er); + } else if (this[_handleChunk](br, buf)) { + this[_read](); } - return x; } - if (!Number.isNaN(x) && opts?.clamp === true) { - x = Math.min(Math.max(x, lowerBound), upperBound); - if (Math.floor(x) % 2 === 0) { - x = Math.floor(x); - } else { - x = Math.ceil(x); + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); } - return x; - } - if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { - return 0; - } - x = webidl.util.IntegerPart(x); - x = x % Math.pow(2, bitLength); - if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) { - return x - Math.pow(2, bitLength); } - return x; - }; - webidl.util.IntegerPart = function(n) { - const r = Math.floor(Math.abs(n)); - if (n < 0) { - return -1 * r; - } - return r; - }; - webidl.util.Stringify = function(V) { - const type = webidl.util.Type(V); - switch (type) { - case "Symbol": - return `Symbol(${V.description})`; - case "Object": - return inspect(V); - case "String": - return `"${V}"`; - default: - return `${V}`; + [_onerror](er) { + this[_reading] = true; + this[_close](); + this.emit("error", er); } - }; - webidl.sequenceConverter = function(converter) { - return (V, prefix, argument, Iterable) => { - if (webidl.util.Type(V) !== "Object") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.` - }); + [_handleChunk](br, buf) { + let ret = false; + this[_remain] -= br; + if (br > 0) { + ret = super.write(br < buf.length ? buf.subarray(0, br) : buf); } - const method = typeof Iterable === "function" ? Iterable() : V?.[Symbol.iterator]?.(); - const seq = []; - let index = 0; - if (method === void 0 || typeof method.next !== "function") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} is not iterable.` - }); + if (br === 0 || this[_remain] <= 0) { + ret = false; + this[_close](); + super.end(); } - while (true) { - const { done, value } = method.next(); - if (done) { - break; - } - seq.push(converter(value, prefix, `${argument}[${index++}]`)); + return ret; + } + emit(ev, ...args) { + switch (ev) { + case "prefinish": + case "finish": + return false; + case "drain": + if (typeof this[_fd] === "number") { + this[_read](); + } + return false; + case "error": + if (this[_errored]) { + return false; + } + this[_errored] = true; + return super.emit(ev, ...args); + default: + return super.emit(ev, ...args); } - return seq; - }; + } }; - webidl.recordConverter = function(keyConverter, valueConverter) { - return (O, prefix, argument) => { - if (webidl.util.Type(O) !== "Object") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} ("${webidl.util.Type(O)}") is not an Object.` - }); - } - const result = {}; - if (!types.isProxy(O)) { - const keys2 = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]; - for (const key of keys2) { - const typedKey = keyConverter(key, prefix, argument); - const typedValue = valueConverter(O[key], prefix, argument); - result[typedKey] = typedValue; - } - return result; - } - const keys = Reflect.ownKeys(O); - for (const key of keys) { - const desc2 = Reflect.getOwnPropertyDescriptor(O, key); - if (desc2?.enumerable) { - const typedKey = keyConverter(key, prefix, argument); - const typedValue = valueConverter(O[key], prefix, argument); - result[typedKey] = typedValue; + ReadStreamSync = class extends ReadStream { + [_open]() { + let threw = true; + try { + this[_onopen](null, import_fs2.default.openSync(this[_path], "r")); + threw = false; + } finally { + if (threw) { + this[_close](); } } - return result; - }; - }; - webidl.interfaceConverter = function(i) { - return (V, prefix, argument, opts) => { - if (opts?.strict !== false && !(V instanceof i)) { - throw webidl.errors.exception({ - header: prefix, - message: `Expected ${argument} ("${webidl.util.Stringify(V)}") to be an instance of ${i.name}.` - }); - } - return V; - }; - }; - webidl.dictionaryConverter = function(converters) { - return (dictionary, prefix, argument) => { - const type = webidl.util.Type(dictionary); - const dict = {}; - if (type === "Null" || type === "Undefined") { - return dict; - } else if (type !== "Object") { - throw webidl.errors.exception({ - header: prefix, - message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` - }); - } - for (const options of converters) { - const { key, defaultValue, required, converter } = options; - if (required === true) { - if (!Object.hasOwn(dictionary, key)) { - throw webidl.errors.exception({ - header: prefix, - message: `Missing required key "${key}".` - }); - } - } - let value = dictionary[key]; - const hasDefault = Object.hasOwn(options, "defaultValue"); - if (hasDefault && value !== null) { - value ??= defaultValue(); + } + [_read]() { + let threw = true; + try { + if (!this[_reading]) { + this[_reading] = true; + do { + const buf = this[_makeBuf](); + const br = buf.length === 0 ? 0 : import_fs2.default.readSync(this[_fd], buf, 0, buf.length, null); + if (!this[_handleChunk](br, buf)) { + break; + } + } while (true); + this[_reading] = false; } - if (required || hasDefault || value !== void 0) { - value = converter(value, prefix, `${argument}.${key}`); - if (options.allowedValues && !options.allowedValues.includes(value)) { - throw webidl.errors.exception({ - header: prefix, - message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.` - }); - } - dict[key] = value; + threw = false; + } finally { + if (threw) { + this[_close](); } } - return dict; - }; - }; - webidl.nullableConverter = function(converter) { - return (V, prefix, argument) => { - if (V === null) { - return V; - } - return converter(V, prefix, argument); - }; - }; - webidl.converters.DOMString = function(V, prefix, argument, opts) { - if (V === null && opts?.legacyNullToEmptyString) { - return ""; } - if (typeof V === "symbol") { - throw webidl.errors.exception({ - header: prefix, - message: `${argument} is a symbol, which cannot be converted to a DOMString.` - }); + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.closeSync(fd); + this.emit("close"); + } } - return String(V); }; - webidl.converters.ByteString = function(V, prefix, argument) { - const x = webidl.converters.DOMString(V, prefix, argument); - for (let index = 0; index < x.length; index++) { - if (x.charCodeAt(index) > 255) { - throw new TypeError( - `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` - ); + WriteStream = class extends import_events2.default { + readable = false; + writable = true; + [_errored] = false; + [_writing] = false; + [_ended] = false; + [_queue] = []; + [_needDrain] = false; + [_path]; + [_mode]; + [_autoClose]; + [_fd]; + [_defaultFlag]; + [_flags]; + [_finished] = false; + [_pos]; + constructor(path16, opt) { + opt = opt || {}; + super(opt); + this[_path] = path16; + this[_fd] = typeof opt.fd === "number" ? opt.fd : void 0; + this[_mode] = opt.mode === void 0 ? 438 : opt.mode; + this[_pos] = typeof opt.start === "number" ? opt.start : void 0; + this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; + const defaultFlag = this[_pos] !== void 0 ? "r+" : "w"; + this[_defaultFlag] = opt.flags === void 0; + this[_flags] = opt.flags === void 0 ? defaultFlag : opt.flags; + if (this[_fd] === void 0) { + this[_open](); } } - return x; - }; - webidl.converters.USVString = toUSVString; - webidl.converters.boolean = function(V) { - const x = Boolean(V); - return x; - }; - webidl.converters.any = function(V) { - return V; - }; - webidl.converters["long long"] = function(V, prefix, argument) { - const x = webidl.util.ConvertToInt(V, 64, "signed", void 0, prefix, argument); - return x; - }; - webidl.converters["unsigned long long"] = function(V, prefix, argument) { - const x = webidl.util.ConvertToInt(V, 64, "unsigned", void 0, prefix, argument); - return x; - }; - webidl.converters["unsigned long"] = function(V, prefix, argument) { - const x = webidl.util.ConvertToInt(V, 32, "unsigned", void 0, prefix, argument); - return x; - }; - webidl.converters["unsigned short"] = function(V, prefix, argument, opts) { - const x = webidl.util.ConvertToInt(V, 16, "unsigned", opts, prefix, argument); - return x; - }; - webidl.converters.ArrayBuffer = function(V, prefix, argument, opts) { - if (webidl.util.Type(V) !== "Object" || !types.isAnyArrayBuffer(V)) { - throw webidl.errors.conversionFailed({ - prefix, - argument: `${argument} ("${webidl.util.Stringify(V)}")`, - types: ["ArrayBuffer"] - }); + emit(ev, ...args) { + if (ev === "error") { + if (this[_errored]) { + return false; + } + this[_errored] = true; + } + return super.emit(ev, ...args); } - if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "SharedArrayBuffer is not allowed." - }); + get fd() { + return this[_fd]; } - if (V.resizable || V.growable) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "Received a resizable ArrayBuffer." - }); + get path() { + return this[_path]; } - return V; - }; - webidl.converters.TypedArray = function(V, T, prefix, name2, opts) { - if (webidl.util.Type(V) !== "Object" || !types.isTypedArray(V) || V.constructor.name !== T.name) { - throw webidl.errors.conversionFailed({ - prefix, - argument: `${name2} ("${webidl.util.Stringify(V)}")`, - types: [T.name] - }); + [_onerror](er) { + this[_close](); + this[_writing] = true; + this.emit("error", er); } - if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "SharedArrayBuffer is not allowed." - }); + [_open]() { + import_fs2.default.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)); } - if (V.buffer.resizable || V.buffer.growable) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "Received a resizable ArrayBuffer." - }); + [_onopen](er, fd) { + if (this[_defaultFlag] && this[_flags] === "r+" && er && er.code === "ENOENT") { + this[_flags] = "w"; + this[_open](); + } else if (er) { + this[_onerror](er); + } else { + this[_fd] = fd; + this.emit("open", fd); + if (!this[_writing]) { + this[_flush](); + } + } } - return V; - }; - webidl.converters.DataView = function(V, prefix, name2, opts) { - if (webidl.util.Type(V) !== "Object" || !types.isDataView(V)) { - throw webidl.errors.exception({ - header: prefix, - message: `${name2} is not a DataView.` - }); - } - if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "SharedArrayBuffer is not allowed." - }); - } - if (V.buffer.resizable || V.buffer.growable) { - throw webidl.errors.exception({ - header: "ArrayBuffer", - message: "Received a resizable ArrayBuffer." - }); - } - return V; - }; - webidl.converters.BufferSource = function(V, prefix, name2, opts) { - if (types.isAnyArrayBuffer(V)) { - return webidl.converters.ArrayBuffer(V, prefix, name2, { ...opts, allowShared: false }); - } - if (types.isTypedArray(V)) { - return webidl.converters.TypedArray(V, V.constructor, prefix, name2, { ...opts, allowShared: false }); - } - if (types.isDataView(V)) { - return webidl.converters.DataView(V, prefix, name2, { ...opts, allowShared: false }); - } - throw webidl.errors.conversionFailed({ - prefix, - argument: `${name2} ("${webidl.util.Stringify(V)}")`, - types: ["BufferSource"] - }); - }; - webidl.converters["sequence"] = webidl.sequenceConverter( - webidl.converters.ByteString - ); - webidl.converters["sequence>"] = webidl.sequenceConverter( - webidl.converters["sequence"] - ); - webidl.converters["record"] = webidl.recordConverter( - webidl.converters.ByteString, - webidl.converters.ByteString - ); - module2.exports = { - webidl - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/util.js -var require_util3 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/util.js"(exports2, module2) { - "use strict"; - var { Transform } = require("node:stream"); - var zlib = require("node:zlib"); - var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants4(); - var { getGlobalOrigin } = require_global(); - var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); - var { performance } = require("node:perf_hooks"); - var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util(); - var assert5 = require("node:assert"); - var { isUint8Array } = require("node:util/types"); - var { webidl } = require_webidl(); - var supportedHashes = []; - var crypto; - try { - crypto = require("node:crypto"); - const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); - } catch { - } - function responseURL(response) { - const urlList = response.urlList; - const length = urlList.length; - return length === 0 ? null : urlList[length - 1].toString(); - } - function responseLocationURL(response, requestFragment) { - if (!redirectStatusSet.has(response.status)) { - return null; - } - let location = response.headersList.get("location", true); - if (location !== null && isValidHeaderValue(location)) { - if (!isValidEncodedURL(location)) { - location = normalizeBinaryStringToUtf8(location); - } - location = new URL(location, responseURL(response)); - } - if (location && !location.hash) { - location.hash = requestFragment; - } - return location; - } - function isValidEncodedURL(url) { - for (let i = 0; i < url.length; ++i) { - const code2 = url.charCodeAt(i); - if (code2 > 126 || // Non-US-ASCII + DEL - code2 < 32) { - return false; - } - } - return true; - } - function normalizeBinaryStringToUtf8(value) { - return Buffer.from(value, "binary").toString("utf8"); - } - function requestCurrentURL(request) { - return request.urlList[request.urlList.length - 1]; - } - function requestBadPort(request) { - const url = requestCurrentURL(request); - if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { - return "blocked"; - } - return "allowed"; - } - function isErrorLike(object) { - return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException"); - } - function isValidReasonPhrase(statusText) { - for (let i = 0; i < statusText.length; ++i) { - const c = statusText.charCodeAt(i); - if (!(c === 9 || // HTAB - c >= 32 && c <= 126 || // SP / VCHAR - c >= 128 && c <= 255)) { - return false; + end(buf, enc) { + if (buf) { + this.write(buf, enc); } - } - return true; - } - var isValidHeaderName = isValidHTTPToken; - function isValidHeaderValue(potentialValue) { - return (potentialValue[0] === " " || potentialValue[0] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue.includes("\n") || potentialValue.includes("\r") || potentialValue.includes("\0")) === false; - } - function setRequestReferrerPolicyOnRedirect(request, actualResponse) { - const { headersList } = actualResponse; - const policyHeader = (headersList.get("referrer-policy", true) ?? "").split(","); - let policy = ""; - if (policyHeader.length > 0) { - for (let i = policyHeader.length; i !== 0; i--) { - const token = policyHeader[i - 1].trim(); - if (referrerPolicyTokens.has(token)) { - policy = token; - break; - } + this[_ended] = true; + if (!this[_writing] && !this[_queue].length && typeof this[_fd] === "number") { + this[_onwrite](null, 0); } + return this; } - if (policy !== "") { - request.referrerPolicy = policy; - } - } - function crossOriginResourcePolicyCheck() { - return "allowed"; - } - function corsCheck() { - return "success"; - } - function TAOCheck() { - return "success"; - } - function appendFetchMetadata(httpRequest) { - let header = null; - header = httpRequest.mode; - httpRequest.headersList.set("sec-fetch-mode", header, true); - } - function appendRequestOriginHeader(request) { - let serializedOrigin = request.origin; - if (serializedOrigin === "client" || serializedOrigin === void 0) { - return; - } - if (request.responseTainting === "cors" || request.mode === "websocket") { - request.headersList.append("origin", serializedOrigin, true); - } else if (request.method !== "GET" && request.method !== "HEAD") { - switch (request.referrerPolicy) { - case "no-referrer": - serializedOrigin = null; - break; - case "no-referrer-when-downgrade": - case "strict-origin": - case "strict-origin-when-cross-origin": - if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { - serializedOrigin = null; - } - break; - case "same-origin": - if (!sameOrigin(request, requestCurrentURL(request))) { - serializedOrigin = null; - } - break; - default: + write(buf, enc) { + if (typeof buf === "string") { + buf = Buffer.from(buf, enc); } - request.headersList.append("origin", serializedOrigin, true); - } - } - function coarsenTime(timestamp, crossOriginIsolatedCapability) { - return timestamp; - } - function clampAndCoarsenConnectionTimingInfo(connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) { - if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) { - return { - domainLookupStartTime: defaultStartTime, - domainLookupEndTime: defaultStartTime, - connectionStartTime: defaultStartTime, - connectionEndTime: defaultStartTime, - secureConnectionStartTime: defaultStartTime, - ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol - }; - } - return { - domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability), - domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability), - connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability), - connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability), - secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability), - ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol - }; - } - function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { - return coarsenTime(performance.now(), crossOriginIsolatedCapability); - } - function createOpaqueTimingInfo(timingInfo) { - return { - startTime: timingInfo.startTime ?? 0, - redirectStartTime: 0, - redirectEndTime: 0, - postRedirectStartTime: timingInfo.startTime ?? 0, - finalServiceWorkerStartTime: 0, - finalNetworkResponseStartTime: 0, - finalNetworkRequestStartTime: 0, - endTime: 0, - encodedBodySize: 0, - decodedBodySize: 0, - finalConnectionTimingInfo: null - }; - } - function makePolicyContainer() { - return { - referrerPolicy: "strict-origin-when-cross-origin" - }; - } - function clonePolicyContainer(policyContainer) { - return { - referrerPolicy: policyContainer.referrerPolicy - }; - } - function determineRequestsReferrer(request) { - const policy = request.referrerPolicy; - assert5(policy); - let referrerSource = null; - if (request.referrer === "client") { - const globalOrigin = getGlobalOrigin(); - if (!globalOrigin || globalOrigin.origin === "null") { - return "no-referrer"; - } - referrerSource = new URL(globalOrigin); - } else if (request.referrer instanceof URL) { - referrerSource = request.referrer; - } - let referrerURL = stripURLForReferrer(referrerSource); - const referrerOrigin = stripURLForReferrer(referrerSource, true); - if (referrerURL.toString().length > 4096) { - referrerURL = referrerOrigin; - } - const areSameOrigin = sameOrigin(request, referrerURL); - const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request.url); - switch (policy) { - case "origin": - return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true); - case "unsafe-url": - return referrerURL; - case "same-origin": - return areSameOrigin ? referrerOrigin : "no-referrer"; - case "origin-when-cross-origin": - return areSameOrigin ? referrerURL : referrerOrigin; - case "strict-origin-when-cross-origin": { - const currentURL = requestCurrentURL(request); - if (sameOrigin(referrerURL, currentURL)) { - return referrerURL; - } - if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { - return "no-referrer"; - } - return referrerOrigin; - } - case "strict-origin": - // eslint-disable-line - /** - * 1. If referrerURL is a potentially trustworthy URL and - * request’s current URL is not a potentially trustworthy URL, - * then return no referrer. - * 2. Return referrerOrigin - */ - case "no-referrer-when-downgrade": - // eslint-disable-line - /** - * 1. If referrerURL is a potentially trustworthy URL and - * request’s current URL is not a potentially trustworthy URL, - * then return no referrer. - * 2. Return referrerOrigin - */ - default: - return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; - } - } - function stripURLForReferrer(url, originOnly) { - assert5(url instanceof URL); - url = new URL(url); - if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") { - return "no-referrer"; - } - url.username = ""; - url.password = ""; - url.hash = ""; - if (originOnly) { - url.pathname = ""; - url.search = ""; - } - return url; - } - function isURLPotentiallyTrustworthy(url) { - if (!(url instanceof URL)) { - return false; - } - if (url.href === "about:blank" || url.href === "about:srcdoc") { - return true; - } - if (url.protocol === "data:") return true; - if (url.protocol === "file:") return true; - return isOriginPotentiallyTrustworthy(url.origin); - function isOriginPotentiallyTrustworthy(origin) { - if (origin == null || origin === "null") return false; - const originAsURL = new URL(origin); - if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") { - return true; + if (this[_ended]) { + this.emit("error", new Error("write() after end()")); + return false; } - if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || (originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.")) || originAsURL.hostname.endsWith(".localhost")) { - return true; + if (this[_fd] === void 0 || this[_writing] || this[_queue].length) { + this[_queue].push(buf); + this[_needDrain] = true; + return false; } - return false; - } - } - function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { - return true; - } - const parsedMetadata = parseMetadata(metadataList); - if (parsedMetadata === "no metadata") { + this[_writing] = true; + this[_write](buf); return true; } - if (parsedMetadata.length === 0) { - return true; + [_write](buf) { + import_fs2.default.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); } - const strongest = getStrongestMetadata(parsedMetadata); - const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest); - for (const item of metadata) { - const algorithm = item.algo; - const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); - if (actualValue[actualValue.length - 1] === "=") { - if (actualValue[actualValue.length - 2] === "=") { - actualValue = actualValue.slice(0, -2); + [_onwrite](er, bw) { + if (er) { + this[_onerror](er); + } else { + if (this[_pos] !== void 0 && typeof bw === "number") { + this[_pos] += bw; + } + if (this[_queue].length) { + this[_flush](); } else { - actualValue = actualValue.slice(0, -1); + this[_writing] = false; + if (this[_ended] && !this[_finished]) { + this[_finished] = true; + this[_close](); + this.emit("finish"); + } else if (this[_needDrain]) { + this[_needDrain] = false; + this.emit("drain"); + } } } - if (compareBase64Mixed(actualValue, expectedValue)) { - return true; - } - } - return false; - } - var parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i; - function parseMetadata(metadata) { - const result = []; - let empty = true; - for (const token of metadata.split(" ")) { - empty = false; - const parsedToken = parseHashWithOptions.exec(token); - if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) { - continue; - } - const algorithm = parsedToken.groups.algo.toLowerCase(); - if (supportedHashes.includes(algorithm)) { - result.push(parsedToken.groups); - } - } - if (empty === true) { - return "no metadata"; } - return result; - } - function getStrongestMetadata(metadataList) { - let algorithm = metadataList[0].algo; - if (algorithm[3] === "5") { - return algorithm; - } - for (let i = 1; i < metadataList.length; ++i) { - const metadata = metadataList[i]; - if (metadata.algo[3] === "5") { - algorithm = "sha512"; - break; - } else if (algorithm[3] === "3") { - continue; - } else if (metadata.algo[3] === "3") { - algorithm = "sha384"; + [_flush]() { + if (this[_queue].length === 0) { + if (this[_ended]) { + this[_onwrite](null, 0); + } + } else if (this[_queue].length === 1) { + this[_write](this[_queue].pop()); + } else { + const iovec = this[_queue]; + this[_queue] = []; + writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)); } } - return algorithm; - } - function filterMetadataListByAlgorithm(metadataList, algorithm) { - if (metadataList.length === 1) { - return metadataList; - } - let pos2 = 0; - for (let i = 0; i < metadataList.length; ++i) { - if (metadataList[i].algo === algorithm) { - metadataList[pos2++] = metadataList[i]; + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); } } - metadataList.length = pos2; - return metadataList; - } - function compareBase64Mixed(actualValue, expectedValue) { - if (actualValue.length !== expectedValue.length) { - return false; - } - for (let i = 0; i < actualValue.length; ++i) { - if (actualValue[i] !== expectedValue[i]) { - if (actualValue[i] === "+" && expectedValue[i] === "-" || actualValue[i] === "/" && expectedValue[i] === "_") { - continue; + }; + WriteStreamSync = class extends WriteStream { + [_open]() { + let fd; + if (this[_defaultFlag] && this[_flags] === "r+") { + try { + fd = import_fs2.default.openSync(this[_path], this[_flags], this[_mode]); + } catch (er) { + if (er?.code === "ENOENT") { + this[_flags] = "w"; + return this[_open](); + } else { + throw er; + } } - return false; + } else { + fd = import_fs2.default.openSync(this[_path], this[_flags], this[_mode]); } + this[_onopen](null, fd); } - return true; - } - function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) { - } - function sameOrigin(A, B) { - if (A.origin === B.origin && A.origin === "null") { - return true; - } - if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { - return true; - } - return false; - } - function createDeferredPromise() { - let res; - let rej; - const promise = new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }); - return { promise, resolve: res, reject: rej }; - } - function isAborted(fetchParams) { - return fetchParams.controller.state === "aborted"; - } - function isCancelled(fetchParams) { - return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; - } - function normalizeMethod(method) { - return normalizedMethodRecordsBase[method.toLowerCase()] ?? method; - } - function serializeJavascriptValueToJSONString(value) { - const result = JSON.stringify(value); - if (result === void 0) { - throw new TypeError("Value is not JSON serializable"); - } - assert5(typeof result === "string"); - return result; - } - var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); - function createIterator(name2, kInternalIterator, keyIndex = 0, valueIndex = 1) { - class FastIterableIterator { - /** @type {any} */ - #target; - /** @type {'key' | 'value' | 'key+value'} */ - #kind; - /** @type {number} */ - #index; - /** - * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object - * @param {unknown} target - * @param {'key' | 'value' | 'key+value'} kind - */ - constructor(target, kind) { - this.#target = target; - this.#kind = kind; - this.#index = 0; - } - next() { - if (typeof this !== "object" || this === null || !(#target in this)) { - throw new TypeError( - `'next' called on an object that does not implement interface ${name2} Iterator.` - ); - } - const index = this.#index; - const values = this.#target[kInternalIterator]; - const len = values.length; - if (index >= len) { - return { - value: void 0, - done: true - }; - } - const { [keyIndex]: key, [valueIndex]: value } = values[index]; - this.#index = index + 1; - let result; - switch (this.#kind) { - case "key": - result = key; - break; - case "value": - result = value; - break; - case "key+value": - result = [key, value]; - break; - } - return { - value: result, - done: false - }; + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.closeSync(fd); + this.emit("close"); } } - delete FastIterableIterator.prototype.constructor; - Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype); - Object.defineProperties(FastIterableIterator.prototype, { - [Symbol.toStringTag]: { - writable: false, - enumerable: false, - configurable: true, - value: `${name2} Iterator` - }, - next: { writable: true, enumerable: true, configurable: true } - }); - return function(target, kind) { - return new FastIterableIterator(target, kind); - }; - } - function iteratorMixin(name2, object, kInternalIterator, keyIndex = 0, valueIndex = 1) { - const makeIterator = createIterator(name2, kInternalIterator, keyIndex, valueIndex); - const properties = { - keys: { - writable: true, - enumerable: true, - configurable: true, - value: function keys() { - webidl.brandCheck(this, object); - return makeIterator(this, "key"); - } - }, - values: { - writable: true, - enumerable: true, - configurable: true, - value: function values() { - webidl.brandCheck(this, object); - return makeIterator(this, "value"); - } - }, - entries: { - writable: true, - enumerable: true, - configurable: true, - value: function entries() { - webidl.brandCheck(this, object); - return makeIterator(this, "key+value"); - } - }, - forEach: { - writable: true, - enumerable: true, - configurable: true, - value: function forEach(callbackfn, thisArg = globalThis) { - webidl.brandCheck(this, object); - webidl.argumentLengthCheck(arguments, 1, `${name2}.forEach`); - if (typeof callbackfn !== "function") { - throw new TypeError( - `Failed to execute 'forEach' on '${name2}': parameter 1 is not of type 'Function'.` - ); - } - for (const { 0: key, 1: value } of makeIterator(this, "key+value")) { - callbackfn.call(thisArg, value, key, this); + [_write](buf) { + let threw = true; + try { + this[_onwrite](null, import_fs2.default.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); + threw = false; + } finally { + if (threw) { + try { + this[_close](); + } catch { } } } - }; - return Object.defineProperties(object.prototype, { - ...properties, - [Symbol.iterator]: { - writable: true, - enumerable: false, - configurable: true, - value: properties.entries.value - } - }); - } - async function fullyReadBody(body, processBody, processBodyError) { - const successSteps = processBody; - const errorSteps = processBodyError; - let reader; - try { - reader = body.stream.getReader(); - } catch (e) { - errorSteps(e); - return; } - try { - successSteps(await readAllBytes(reader)); - } catch (e) { - errorSteps(e); - } - } - function isReadableStreamLike(stream) { - return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; - } - function readableStreamClose(controller) { - try { - controller.close(); - controller.byobRequest?.respond(0); - } catch (err) { - if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) { - throw err; - } - } - } - var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/; - function isomorphicEncode(input) { - assert5(!invalidIsomorphicEncodeValueRegex.test(input)); - return input; - } - async function readAllBytes(reader) { - const bytes = []; - let byteLength = 0; - while (true) { - const { done, value: chunk } = await reader.read(); - if (done) { - return Buffer.concat(bytes, byteLength); - } - if (!isUint8Array(chunk)) { - throw new TypeError("Received non-Uint8Array chunk"); - } - bytes.push(chunk); - byteLength += chunk.length; - } - } - function urlIsLocal(url) { - assert5("protocol" in url); - const protocol = url.protocol; - return protocol === "about:" || protocol === "blob:" || protocol === "data:"; - } - function urlHasHttpsScheme(url) { - return typeof url === "string" && url[5] === ":" && url[0] === "h" && url[1] === "t" && url[2] === "t" && url[3] === "p" && url[4] === "s" || url.protocol === "https:"; - } - function urlIsHttpHttpsScheme(url) { - assert5("protocol" in url); - const protocol = url.protocol; - return protocol === "http:" || protocol === "https:"; - } - function simpleRangeHeaderValue(value, allowWhitespace) { - const data = value; - if (!data.startsWith("bytes")) { - return "failure"; - } - const position = { position: 5 }; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - if (data.charCodeAt(position.position) !== 61) { - return "failure"; - } - position.position++; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - const rangeStart = collectASequenceOfCodePoints( - (char) => { - const code2 = char.charCodeAt(0); - return code2 >= 48 && code2 <= 57; - }, - data, - position - ); - const rangeStartValue = rangeStart.length ? Number(rangeStart) : null; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - if (data.charCodeAt(position.position) !== 45) { - return "failure"; - } - position.position++; - if (allowWhitespace) { - collectASequenceOfCodePoints( - (char) => char === " " || char === " ", - data, - position - ); - } - const rangeEnd = collectASequenceOfCodePoints( - (char) => { - const code2 = char.charCodeAt(0); - return code2 >= 48 && code2 <= 57; - }, - data, - position - ); - const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null; - if (position.position < data.length) { - return "failure"; - } - if (rangeEndValue === null && rangeStartValue === null) { - return "failure"; - } - if (rangeStartValue > rangeEndValue) { - return "failure"; - } - return { rangeStartValue, rangeEndValue }; - } - function buildContentRange(rangeStart, rangeEnd, fullLength) { - let contentRange = "bytes "; - contentRange += isomorphicEncode(`${rangeStart}`); - contentRange += "-"; - contentRange += isomorphicEncode(`${rangeEnd}`); - contentRange += "/"; - contentRange += isomorphicEncode(`${fullLength}`); - return contentRange; - } - var InflateStream = class extends Transform { - #zlibOptions; - /** @param {zlib.ZlibOptions} [zlibOptions] */ - constructor(zlibOptions) { - super(); - this.#zlibOptions = zlibOptions; - } - _transform(chunk, encoding, callback) { - if (!this._inflateStream) { - if (chunk.length === 0) { - callback(); - return; - } - this._inflateStream = (chunk[0] & 15) === 8 ? zlib.createInflate(this.#zlibOptions) : zlib.createInflateRaw(this.#zlibOptions); - this._inflateStream.on("data", this.push.bind(this)); - this._inflateStream.on("end", () => this.push(null)); - this._inflateStream.on("error", (err) => this.destroy(err)); - } - this._inflateStream.write(chunk, encoding, callback); - } - _final(callback) { - if (this._inflateStream) { - this._inflateStream.end(); - this._inflateStream = null; - } - callback(); - } - }; - function createInflate(zlibOptions) { - return new InflateStream(zlibOptions); - } - function extractMimeType(headers) { - let charset = null; - let essence = null; - let mimeType = null; - const values = getDecodeSplit("content-type", headers); - if (values === null) { - return "failure"; - } - for (const value of values) { - const temporaryMimeType = parseMIMEType(value); - if (temporaryMimeType === "failure" || temporaryMimeType.essence === "*/*") { - continue; - } - mimeType = temporaryMimeType; - if (mimeType.essence !== essence) { - charset = null; - if (mimeType.parameters.has("charset")) { - charset = mimeType.parameters.get("charset"); - } - essence = mimeType.essence; - } else if (!mimeType.parameters.has("charset") && charset !== null) { - mimeType.parameters.set("charset", charset); - } - } - if (mimeType == null) { - return "failure"; - } - return mimeType; - } - function gettingDecodingSplitting(value) { - const input = value; - const position = { position: 0 }; - const values = []; - let temporaryValue = ""; - while (position.position < input.length) { - temporaryValue += collectASequenceOfCodePoints( - (char) => char !== '"' && char !== ",", - input, - position - ); - if (position.position < input.length) { - if (input.charCodeAt(position.position) === 34) { - temporaryValue += collectAnHTTPQuotedString( - input, - position - ); - if (position.position < input.length) { - continue; - } - } else { - assert5(input.charCodeAt(position.position) === 44); - position.position++; - } - } - temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 9 || char === 32); - values.push(temporaryValue); - temporaryValue = ""; - } - return values; - } - function getDecodeSplit(name2, list2) { - const value = list2.get(name2, true); - if (value === null) { - return null; - } - return gettingDecodingSplitting(value); - } - var textDecoder = new TextDecoder(); - function utf8DecodeBytes(buffer) { - if (buffer.length === 0) { - return ""; - } - if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { - buffer = buffer.subarray(3); - } - const output = textDecoder.decode(buffer); - return output; - } - var EnvironmentSettingsObjectBase = class { - get baseUrl() { - return getGlobalOrigin(); - } - get origin() { - return this.baseUrl?.origin; - } - policyContainer = makePolicyContainer(); - }; - var EnvironmentSettingsObject = class { - settingsObject = new EnvironmentSettingsObjectBase(); - }; - var environmentSettingsObject = new EnvironmentSettingsObject(); - module2.exports = { - isAborted, - isCancelled, - isValidEncodedURL, - createDeferredPromise, - ReadableStreamFrom, - tryUpgradeRequestToAPotentiallyTrustworthyURL, - clampAndCoarsenConnectionTimingInfo, - coarsenedSharedCurrentTime, - determineRequestsReferrer, - makePolicyContainer, - clonePolicyContainer, - appendFetchMetadata, - appendRequestOriginHeader, - TAOCheck, - corsCheck, - crossOriginResourcePolicyCheck, - createOpaqueTimingInfo, - setRequestReferrerPolicyOnRedirect, - isValidHTTPToken, - requestBadPort, - requestCurrentURL, - responseURL, - responseLocationURL, - isBlobLike, - isURLPotentiallyTrustworthy, - isValidReasonPhrase, - sameOrigin, - normalizeMethod, - serializeJavascriptValueToJSONString, - iteratorMixin, - createIterator, - isValidHeaderName, - isValidHeaderValue, - isErrorLike, - fullyReadBody, - bytesMatch, - isReadableStreamLike, - readableStreamClose, - isomorphicEncode, - urlIsLocal, - urlHasHttpsScheme, - urlIsHttpHttpsScheme, - readAllBytes, - simpleRangeHeaderValue, - buildContentRange, - parseMetadata, - createInflate, - extractMimeType, - getDecodeSplit, - utf8DecodeBytes, - environmentSettingsObject }; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/symbols.js -var require_symbols2 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/symbols.js"(exports2, module2) { - "use strict"; - module2.exports = { - kUrl: /* @__PURE__ */ Symbol("url"), - kHeaders: /* @__PURE__ */ Symbol("headers"), - kSignal: /* @__PURE__ */ Symbol("signal"), - kState: /* @__PURE__ */ Symbol("state"), - kDispatcher: /* @__PURE__ */ Symbol("dispatcher") +// node_modules/tar/dist/esm/options.js +var argmap, isSyncFile, isAsyncFile, isSyncNoFile, isAsyncNoFile, dealiasKey, dealias; +var init_options = __esm({ + "node_modules/tar/dist/esm/options.js"() { + argmap = /* @__PURE__ */ new Map([ + ["C", "cwd"], + ["f", "file"], + ["z", "gzip"], + ["P", "preservePaths"], + ["U", "unlink"], + ["strip-components", "strip"], + ["stripComponents", "strip"], + ["keep-newer", "newer"], + ["keepNewer", "newer"], + ["keep-newer-files", "newer"], + ["keepNewerFiles", "newer"], + ["k", "keep"], + ["keep-existing", "keep"], + ["keepExisting", "keep"], + ["m", "noMtime"], + ["no-mtime", "noMtime"], + ["p", "preserveOwner"], + ["L", "follow"], + ["h", "follow"], + ["onentry", "onReadEntry"] + ]); + isSyncFile = (o) => !!o.sync && !!o.file; + isAsyncFile = (o) => !o.sync && !!o.file; + isSyncNoFile = (o) => !!o.sync && !o.file; + isAsyncNoFile = (o) => !o.sync && !o.file; + dealiasKey = (k) => { + const d = argmap.get(k); + if (d) + return d; + return k; }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/file.js -var require_file = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/file.js"(exports2, module2) { - "use strict"; - var { Blob: Blob2, File } = require("node:buffer"); - var { kState } = require_symbols2(); - var { webidl } = require_webidl(); - var FileLike = class _FileLike { - constructor(blobLike, fileName, options = {}) { - const n = fileName; - const t = options.type; - const d = options.lastModified ?? Date.now(); - this[kState] = { - blobLike, - name: n, - type: t, - lastModified: d - }; - } - stream(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.stream(...args); - } - arrayBuffer(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.arrayBuffer(...args); - } - slice(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.slice(...args); - } - text(...args) { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.text(...args); - } - get size() { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.size; - } - get type() { - webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.type; - } - get name() { - webidl.brandCheck(this, _FileLike); - return this[kState].name; - } - get lastModified() { - webidl.brandCheck(this, _FileLike); - return this[kState].lastModified; + dealias = (opt = {}) => { + if (!opt) + return {}; + const result = {}; + for (const [key, v] of Object.entries(opt)) { + const k = dealiasKey(key); + result[k] = v; } - get [Symbol.toStringTag]() { - return "File"; + if (result.chmod === void 0 && result.noChmod === false) { + result.chmod = true; } + delete result.noChmod; + return result; }; - webidl.converters.Blob = webidl.interfaceConverter(Blob2); - function isFileLike(object) { - return object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; - } - module2.exports = { FileLike, isFileLike }; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/formdata.js -var require_formdata = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/formdata.js"(exports2, module2) { - "use strict"; - var { isBlobLike, iteratorMixin } = require_util3(); - var { kState } = require_symbols2(); - var { kEnumerableProperty } = require_util(); - var { FileLike, isFileLike } = require_file(); - var { webidl } = require_webidl(); - var { File: NativeFile } = require("node:buffer"); - var nodeUtil = require("node:util"); - var File = globalThis.File ?? NativeFile; - var FormData = class _FormData { - constructor(form) { - webidl.util.markAsUncloneable(this); - if (form !== void 0) { - throw webidl.errors.conversionFailed({ - prefix: "FormData constructor", - argument: "Argument 1", - types: ["undefined"] - }); - } - this[kState] = []; - } - append(name2, value, filename = void 0) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.append"; - webidl.argumentLengthCheck(arguments, 2, prefix); - if (arguments.length === 3 && !isBlobLike(value)) { - throw new TypeError( - "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" - ); - } - name2 = webidl.converters.USVString(name2, prefix, "name"); - value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "value", { strict: false }) : webidl.converters.USVString(value, prefix, "value"); - filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "filename") : void 0; - const entry = makeEntry(name2, value, filename); - this[kState].push(entry); - } - delete(name2) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.delete"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name2 = webidl.converters.USVString(name2, prefix, "name"); - this[kState] = this[kState].filter((entry) => entry.name !== name2); - } - get(name2) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.get"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name2 = webidl.converters.USVString(name2, prefix, "name"); - const idx = this[kState].findIndex((entry) => entry.name === name2); - if (idx === -1) { - return null; - } - return this[kState][idx].value; - } - getAll(name2) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.getAll"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name2 = webidl.converters.USVString(name2, prefix, "name"); - return this[kState].filter((entry) => entry.name === name2).map((entry) => entry.value); - } - has(name2) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.has"; - webidl.argumentLengthCheck(arguments, 1, prefix); - name2 = webidl.converters.USVString(name2, prefix, "name"); - return this[kState].findIndex((entry) => entry.name === name2) !== -1; - } - set(name2, value, filename = void 0) { - webidl.brandCheck(this, _FormData); - const prefix = "FormData.set"; - webidl.argumentLengthCheck(arguments, 2, prefix); - if (arguments.length === 3 && !isBlobLike(value)) { - throw new TypeError( - "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" - ); +// node_modules/tar/dist/esm/make-command.js +var makeCommand; +var init_make_command = __esm({ + "node_modules/tar/dist/esm/make-command.js"() { + init_options(); + makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => { + return Object.assign((opt_ = [], entries, cb) => { + if (Array.isArray(opt_)) { + entries = opt_; + opt_ = {}; } - name2 = webidl.converters.USVString(name2, prefix, "name"); - value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "name", { strict: false }) : webidl.converters.USVString(value, prefix, "name"); - filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "name") : void 0; - const entry = makeEntry(name2, value, filename); - const idx = this[kState].findIndex((entry2) => entry2.name === name2); - if (idx !== -1) { - this[kState] = [ - ...this[kState].slice(0, idx), - entry, - ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name2) - ]; - } else { - this[kState].push(entry); + if (typeof entries === "function") { + cb = entries; + entries = void 0; } - } - [nodeUtil.inspect.custom](depth, options) { - const state = this[kState].reduce((a, b) => { - if (a[b.name]) { - if (Array.isArray(a[b.name])) { - a[b.name].push(b.value); - } else { - a[b.name] = [a[b.name], b.value]; - } - } else { - a[b.name] = b.value; + entries = !entries ? [] : Array.from(entries); + const opt = dealias(opt_); + validate?.(opt, entries); + if (isSyncFile(opt)) { + if (typeof cb === "function") { + throw new TypeError("callback not supported for sync tar functions"); } - return a; - }, { __proto__: null }); - options.depth ??= depth; - options.colors ??= true; - const output = nodeUtil.formatWithOptions(options, state); - return `FormData ${output.slice(output.indexOf("]") + 2)}`; - } - }; - iteratorMixin("FormData", FormData, kState, "name", "value"); - Object.defineProperties(FormData.prototype, { - append: kEnumerableProperty, - delete: kEnumerableProperty, - get: kEnumerableProperty, - getAll: kEnumerableProperty, - has: kEnumerableProperty, - set: kEnumerableProperty, - [Symbol.toStringTag]: { - value: "FormData", - configurable: true - } - }); - function makeEntry(name2, value, filename) { - if (typeof value === "string") { - } else { - if (!isFileLike(value)) { - value = value instanceof Blob ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); - } - if (filename !== void 0) { - const options = { - type: value.type, - lastModified: value.lastModified - }; - value = value instanceof NativeFile ? new File([value], filename, options) : new FileLike(value, filename, options); + return syncFile(opt, entries); + } else if (isAsyncFile(opt)) { + const p = asyncFile(opt, entries); + return cb ? p.then(() => cb(), cb) : p; + } else if (isSyncNoFile(opt)) { + if (typeof cb === "function") { + throw new TypeError("callback not supported for sync tar functions"); + } + return syncNoFile(opt, entries); + } else if (isAsyncNoFile(opt)) { + if (typeof cb === "function") { + throw new TypeError("callback only supported with file option"); + } + return asyncNoFile(opt, entries); } - } - return { name: name2, value }; - } - module2.exports = { FormData, makeEntry }; + throw new Error("impossible options??"); + }, { + syncFile, + asyncFile, + syncNoFile, + asyncNoFile, + validate + }); + }; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/formdata-parser.js -var require_formdata_parser = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/formdata-parser.js"(exports2, module2) { - "use strict"; - var { isUSVString, bufferToLowerCasedHeaderName } = require_util(); - var { utf8DecodeBytes } = require_util3(); - var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url(); - var { isFileLike } = require_file(); - var { makeEntry } = require_formdata(); - var assert5 = require("node:assert"); - var { File: NodeFile } = require("node:buffer"); - var File = globalThis.File ?? NodeFile; - var formDataNameBuffer = Buffer.from('form-data; name="'); - var filenameBuffer = Buffer.from("; filename"); - var dd = Buffer.from("--"); - var ddcrlf = Buffer.from("--\r\n"); - function isAsciiString(chars) { - for (let i = 0; i < chars.length; ++i) { - if ((chars.charCodeAt(i) & ~127) !== 0) { - return false; - } - } - return true; - } - function validateBoundary(boundary) { - const length = boundary.length; - if (length < 27 || length > 70) { - return false; - } - for (let i = 0; i < length; ++i) { - const cp = boundary.charCodeAt(i); - if (!(cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 39 || cp === 45 || cp === 95)) { - return false; - } - } - return true; - } - function multipartFormDataParser(input, mimeType) { - assert5(mimeType !== "failure" && mimeType.essence === "multipart/form-data"); - const boundaryString = mimeType.parameters.get("boundary"); - if (boundaryString === void 0) { - return "failure"; - } - const boundary = Buffer.from(`--${boundaryString}`, "utf8"); - const entryList = []; - const position = { position: 0 }; - while (input[position.position] === 13 && input[position.position + 1] === 10) { - position.position += 2; - } - let trailing = input.length; - while (input[trailing - 1] === 10 && input[trailing - 2] === 13) { - trailing -= 2; - } - if (trailing !== input.length) { - input = input.subarray(0, trailing); - } - while (true) { - if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) { - position.position += boundary.length; - } else { - return "failure"; - } - if (position.position === input.length - 2 && bufferStartsWith(input, dd, position) || position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position)) { - return entryList; - } - if (input[position.position] !== 13 || input[position.position + 1] !== 10) { - return "failure"; - } - position.position += 2; - const result = parseMultipartFormDataHeaders(input, position); - if (result === "failure") { - return "failure"; - } - let { name: name2, filename, contentType, encoding } = result; - position.position += 2; - let body; - { - const boundaryIndex = input.indexOf(boundary.subarray(2), position.position); - if (boundaryIndex === -1) { - return "failure"; - } - body = input.subarray(position.position, boundaryIndex - 4); - position.position += body.length; - if (encoding === "base64") { - body = Buffer.from(body.toString(), "base64"); - } - } - if (input[position.position] !== 13 || input[position.position + 1] !== 10) { - return "failure"; - } else { - position.position += 2; - } - let value; - if (filename !== null) { - contentType ??= "text/plain"; - if (!isAsciiString(contentType)) { - contentType = ""; - } - value = new File([body], filename, { type: contentType }); - } else { - value = utf8DecodeBytes(Buffer.from(body)); - } - assert5(isUSVString(name2)); - assert5(typeof value === "string" && isUSVString(value) || isFileLike(value)); - entryList.push(makeEntry(name2, value, filename)); - } - } - function parseMultipartFormDataHeaders(input, position) { - let name2 = null; - let filename = null; - let contentType = null; - let encoding = null; - while (true) { - if (input[position.position] === 13 && input[position.position + 1] === 10) { - if (name2 === null) { - return "failure"; - } - return { name: name2, filename, contentType, encoding }; - } - let headerName = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13 && char !== 58, - input, - position - ); - headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32); - if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) { - return "failure"; - } - if (input[position.position] !== 58) { - return "failure"; - } - position.position++; - collectASequenceOfBytes( - (char) => char === 32 || char === 9, - input, - position - ); - switch (bufferToLowerCasedHeaderName(headerName)) { - case "content-disposition": { - name2 = filename = null; - if (!bufferStartsWith(input, formDataNameBuffer, position)) { - return "failure"; - } - position.position += 17; - name2 = parseMultipartFormDataName(input, position); - if (name2 === null) { - return "failure"; - } - if (bufferStartsWith(input, filenameBuffer, position)) { - let check = position.position + filenameBuffer.length; - if (input[check] === 42) { - position.position += 1; - check += 1; - } - if (input[check] !== 61 || input[check + 1] !== 34) { - return "failure"; - } - position.position += 12; - filename = parseMultipartFormDataName(input, position); - if (filename === null) { - return "failure"; - } - } - break; - } - case "content-type": { - let headerValue = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13, - input, - position - ); - headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); - contentType = isomorphicDecode(headerValue); - break; - } - case "content-transfer-encoding": { - let headerValue = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13, - input, - position - ); - headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); - encoding = isomorphicDecode(headerValue); - break; - } - default: { - collectASequenceOfBytes( - (char) => char !== 10 && char !== 13, - input, - position - ); - } - } - if (input[position.position] !== 13 && input[position.position + 1] !== 10) { - return "failure"; - } else { - position.position += 2; - } - } - } - function parseMultipartFormDataName(input, position) { - assert5(input[position.position - 1] === 34); - let name2 = collectASequenceOfBytes( - (char) => char !== 10 && char !== 13 && char !== 34, - input, - position - ); - if (input[position.position] !== 34) { - return null; - } else { - position.position++; - } - name2 = new TextDecoder().decode(name2).replace(/%0A/ig, "\n").replace(/%0D/ig, "\r").replace(/%22/g, '"'); - return name2; - } - function collectASequenceOfBytes(condition, input, position) { - let start = position.position; - while (start < input.length && condition(input[start])) { - ++start; +// node_modules/minizlib/dist/esm/constants.js +var import_zlib, realZlibConstants, constants; +var init_constants = __esm({ + "node_modules/minizlib/dist/esm/constants.js"() { + import_zlib = __toESM(require("zlib"), 1); + realZlibConstants = import_zlib.default.constants || { ZLIB_VERNUM: 4736 }; + constants = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_VERSION_ERROR: -6, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + DEFLATE: 1, + INFLATE: 2, + GZIP: 3, + GUNZIP: 4, + DEFLATERAW: 5, + INFLATERAW: 6, + UNZIP: 7, + BROTLI_DECODE: 8, + BROTLI_ENCODE: 9, + Z_MIN_WINDOWBITS: 8, + Z_MAX_WINDOWBITS: 15, + Z_DEFAULT_WINDOWBITS: 15, + Z_MIN_CHUNK: 64, + Z_MAX_CHUNK: Infinity, + Z_DEFAULT_CHUNK: 16384, + Z_MIN_MEMLEVEL: 1, + Z_MAX_MEMLEVEL: 9, + Z_DEFAULT_MEMLEVEL: 8, + Z_MIN_LEVEL: -1, + Z_MAX_LEVEL: 9, + Z_DEFAULT_LEVEL: -1, + BROTLI_OPERATION_PROCESS: 0, + BROTLI_OPERATION_FLUSH: 1, + BROTLI_OPERATION_FINISH: 2, + BROTLI_OPERATION_EMIT_METADATA: 3, + BROTLI_MODE_GENERIC: 0, + BROTLI_MODE_TEXT: 1, + BROTLI_MODE_FONT: 2, + BROTLI_DEFAULT_MODE: 0, + BROTLI_MIN_QUALITY: 0, + BROTLI_MAX_QUALITY: 11, + BROTLI_DEFAULT_QUALITY: 11, + BROTLI_MIN_WINDOW_BITS: 10, + BROTLI_MAX_WINDOW_BITS: 24, + BROTLI_LARGE_MAX_WINDOW_BITS: 30, + BROTLI_DEFAULT_WINDOW: 22, + BROTLI_MIN_INPUT_BLOCK_BITS: 16, + BROTLI_MAX_INPUT_BLOCK_BITS: 24, + BROTLI_PARAM_MODE: 0, + BROTLI_PARAM_QUALITY: 1, + BROTLI_PARAM_LGWIN: 2, + BROTLI_PARAM_LGBLOCK: 3, + BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, + BROTLI_PARAM_SIZE_HINT: 5, + BROTLI_PARAM_LARGE_WINDOW: 6, + BROTLI_PARAM_NPOSTFIX: 7, + BROTLI_PARAM_NDIRECT: 8, + BROTLI_DECODER_RESULT_ERROR: 0, + BROTLI_DECODER_RESULT_SUCCESS: 1, + BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, + BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, + BROTLI_DECODER_NO_ERROR: 0, + BROTLI_DECODER_SUCCESS: 1, + BROTLI_DECODER_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, + BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, + BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, + BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, + BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, + BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, + BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, + BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, + BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, + BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, + BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, + BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, + BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, + BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, + BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, + BROTLI_DECODER_ERROR_UNREACHABLE: -31 + }, realZlibConstants)); + } +}); + +// node_modules/minizlib/dist/esm/index.js +var import_assert2, import_buffer, realZlib2, OriginalBufferConcat, desc, noop, passthroughBufferConcat, _superWrite, ZlibError, _flushFlag, ZlibBase, Zlib, Gzip, Unzip, Brotli, BrotliCompress, BrotliDecompress, Zstd, ZstdCompress, ZstdDecompress; +var init_esm3 = __esm({ + "node_modules/minizlib/dist/esm/index.js"() { + import_assert2 = __toESM(require("assert"), 1); + import_buffer = require("buffer"); + init_esm(); + realZlib2 = __toESM(require("zlib"), 1); + init_constants(); + init_constants(); + OriginalBufferConcat = import_buffer.Buffer.concat; + desc = Object.getOwnPropertyDescriptor(import_buffer.Buffer, "concat"); + noop = (args) => args; + passthroughBufferConcat = desc?.writable === true || desc?.set !== void 0 ? (makeNoOp) => { + import_buffer.Buffer.concat = makeNoOp ? noop : OriginalBufferConcat; + } : (_) => { + }; + _superWrite = /* @__PURE__ */ Symbol("_superWrite"); + ZlibError = class extends Error { + code; + errno; + constructor(err, origin) { + super("zlib: " + err.message, { cause: err }); + this.code = err.code; + this.errno = err.errno; + if (!this.code) + this.code = "ZLIB_ERROR"; + this.message = "zlib: " + err.message; + Error.captureStackTrace(this, origin ?? this.constructor); } - return input.subarray(position.position, position.position = start); - } - function removeChars(buf, leading, trailing, predicate) { - let lead = 0; - let trail = buf.length - 1; - if (leading) { - while (lead < buf.length && predicate(buf[lead])) lead++; + get name() { + return "ZlibError"; } - if (trailing) { - while (trail > 0 && predicate(buf[trail])) trail--; + }; + _flushFlag = /* @__PURE__ */ Symbol("flushFlag"); + ZlibBase = class extends Minipass { + #sawError = false; + #ended = false; + #flushFlag; + #finishFlushFlag; + #fullFlushFlag; + #handle; + #onError; + get sawError() { + return this.#sawError; } - return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1); - } - function bufferStartsWith(buffer, start, position) { - if (buffer.length < start.length) { - return false; + get handle() { + return this.#handle; } - for (let i = 0; i < start.length; i++) { - if (start[i] !== buffer[position.position + i]) { - return false; - } + /* c8 ignore start */ + get flushFlag() { + return this.#flushFlag; } - return true; - } - module2.exports = { - multipartFormDataParser, - validateBoundary - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/body.js -var require_body = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/web/fetch/body.js"(exports2, module2) { - "use strict"; - var util = require_util(); - var { - ReadableStreamFrom, - isBlobLike, - isReadableStreamLike, - readableStreamClose, - createDeferredPromise, - fullyReadBody, - extractMimeType, - utf8DecodeBytes - } = require_util3(); - var { FormData } = require_formdata(); - var { kState } = require_symbols2(); - var { webidl } = require_webidl(); - var { Blob: Blob2 } = require("node:buffer"); - var assert5 = require("node:assert"); - var { isErrored, isDisturbed } = require("node:stream"); - var { isArrayBuffer } = require("node:util/types"); - var { serializeAMimeType } = require_data_url(); - var { multipartFormDataParser } = require_formdata_parser(); - var random; - try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); - } catch { - random = (max) => Math.floor(Math.random(max)); - } - var textEncoder = new TextEncoder(); - function noop3() { - } - var hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0; - var streamRegistry; - if (hasFinalizationRegistry) { - streamRegistry = new FinalizationRegistry((weakRef) => { - const stream = weakRef.deref(); - if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { - stream.cancel("Response object has been garbage collected").catch(noop3); + /* c8 ignore stop */ + constructor(opts, mode) { + if (!opts || typeof opts !== "object") + throw new TypeError("invalid options for ZlibBase constructor"); + super(opts); + this.#flushFlag = opts.flush ?? 0; + this.#finishFlushFlag = opts.finishFlush ?? 0; + this.#fullFlushFlag = opts.fullFlushFlag ?? 0; + if (typeof realZlib2[mode] !== "function") { + throw new TypeError("Compression method not supported: " + mode); } - }); - } - function extractBody(object, keepalive = false) { - let stream = null; - if (object instanceof ReadableStream) { - stream = object; - } else if (isBlobLike(object)) { - stream = object.stream(); - } else { - stream = new ReadableStream({ - async pull(controller) { - const buffer = typeof source === "string" ? textEncoder.encode(source) : source; - if (buffer.byteLength) { - controller.enqueue(buffer); - } - queueMicrotask(() => readableStreamClose(controller)); - }, - start() { - }, - type: "bytes" - }); - } - assert5(isReadableStreamLike(stream)); - let action = null; - let source = null; - let length = null; - let type = null; - if (typeof object === "string") { - source = object; - type = "text/plain;charset=UTF-8"; - } else if (object instanceof URLSearchParams) { - source = object.toString(); - type = "application/x-www-form-urlencoded;charset=UTF-8"; - } else if (isArrayBuffer(object)) { - source = new Uint8Array(object.slice()); - } else if (ArrayBuffer.isView(object)) { - source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); - } else if (util.isFormDataLike(object)) { - const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; - const prefix = `--${boundary}\r -Content-Disposition: form-data`; - const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); - const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); - const blobParts = []; - const rn = new Uint8Array([13, 10]); - length = 0; - let hasUnknownSizeValue = false; - for (const [name2, value] of object) { - if (typeof value === "string") { - const chunk2 = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name2))}"\r -\r -${normalizeLinefeeds(value)}\r -`); - blobParts.push(chunk2); - length += chunk2.byteLength; - } else { - const chunk2 = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name2))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\r -Content-Type: ${value.type || "application/octet-stream"}\r -\r -`); - blobParts.push(chunk2, value, rn); - if (typeof value.size === "number") { - length += chunk2.byteLength + value.size + rn.byteLength; - } else { - hasUnknownSizeValue = true; - } - } + try { + this.#handle = new realZlib2[mode](opts); + } catch (er) { + throw new ZlibError(er, this.constructor); } - const chunk = textEncoder.encode(`--${boundary}--\r -`); - blobParts.push(chunk); - length += chunk.byteLength; - if (hasUnknownSizeValue) { - length = null; - } - source = object; - action = async function* () { - for (const part of blobParts) { - if (part.stream) { - yield* part.stream(); - } else { - yield part; - } - } + this.#onError = (err) => { + if (this.#sawError) + return; + this.#sawError = true; + this.close(); + this.emit("error", err); }; - type = `multipart/form-data; boundary=${boundary}`; - } else if (isBlobLike(object)) { - source = object; - length = object.size; - if (object.type) { - type = object.type; - } - } else if (typeof object[Symbol.asyncIterator] === "function") { - if (keepalive) { - throw new TypeError("keepalive"); - } - if (util.isDisturbed(object) || object.locked) { - throw new TypeError( - "Response body object should not be disturbed or locked" - ); - } - stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); - } - if (typeof source === "string" || util.isBuffer(source)) { - length = Buffer.byteLength(source); + this.#handle?.on("error", (er) => this.#onError(new ZlibError(er))); + this.once("end", () => this.close); } - if (action != null) { - let iterator; - stream = new ReadableStream({ - async start() { - iterator = action(object)[Symbol.asyncIterator](); - }, - async pull(controller) { - const { value, done } = await iterator.next(); - if (done) { - queueMicrotask(() => { - controller.close(); - controller.byobRequest?.respond(0); - }); - } else { - if (!isErrored(stream)) { - const buffer = new Uint8Array(value); - if (buffer.byteLength) { - controller.enqueue(buffer); - } - } - } - return controller.desiredSize > 0; - }, - async cancel(reason) { - await iterator.return(); - }, - type: "bytes" - }); + close() { + if (this.#handle) { + this.#handle.close(); + this.#handle = void 0; + this.emit("close"); + } } - const body = { stream, source, length }; - return [body, type]; - } - function safelyExtractBody(object, keepalive = false) { - if (object instanceof ReadableStream) { - assert5(!util.isDisturbed(object), "The body has already been consumed."); - assert5(!object.locked, "The stream is locked."); + reset() { + if (!this.#sawError) { + (0, import_assert2.default)(this.#handle, "zlib binding closed"); + return this.#handle.reset?.(); + } } - return extractBody(object, keepalive); - } - function cloneBody(instance, body) { - const [out1, out2] = body.stream.tee(); - body.stream = out1; - return { - stream: out2, - length: body.length, - source: body.source - }; - } - function throwIfAborted(state) { - if (state.aborted) { - throw new DOMException("The operation was aborted.", "AbortError"); + flush(flushFlag) { + if (this.ended) + return; + if (typeof flushFlag !== "number") + flushFlag = this.#fullFlushFlag; + this.write(Object.assign(import_buffer.Buffer.alloc(0), { [_flushFlag]: flushFlag })); } - } - function bodyMixinMethods(instance) { - const methods = { - blob() { - return consumeBody(this, (bytes) => { - let mimeType = bodyMimeType(this); - if (mimeType === null) { - mimeType = ""; - } else if (mimeType) { - mimeType = serializeAMimeType(mimeType); - } - return new Blob2([bytes], { type: mimeType }); - }, instance); - }, - arrayBuffer() { - return consumeBody(this, (bytes) => { - return new Uint8Array(bytes).buffer; - }, instance); - }, - text() { - return consumeBody(this, utf8DecodeBytes, instance); - }, - json() { - return consumeBody(this, parseJSONFromBytes, instance); - }, - formData() { - return consumeBody(this, (value) => { - const mimeType = bodyMimeType(this); - if (mimeType !== null) { - switch (mimeType.essence) { - case "multipart/form-data": { - const parsed = multipartFormDataParser(value, mimeType); - if (parsed === "failure") { - throw new TypeError("Failed to parse body as FormData."); - } - const fd = new FormData(); - fd[kState] = parsed; - return fd; - } - case "application/x-www-form-urlencoded": { - const entries = new URLSearchParams(value.toString()); - const fd = new FormData(); - for (const [name2, value2] of entries) { - fd.append(name2, value2); - } - return fd; - } - } - } - throw new TypeError( - 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' - ); - }, instance); - }, - bytes() { - return consumeBody(this, (bytes) => { - return new Uint8Array(bytes); - }, instance); + end(chunk, encoding, cb) { + if (typeof chunk === "function") { + cb = chunk; + encoding = void 0; + chunk = void 0; } - }; - return methods; - } - function mixinBody(prototype) { - Object.assign(prototype.prototype, bodyMixinMethods(prototype)); - } - async function consumeBody(object, convertBytesToJSValue, instance) { - webidl.brandCheck(object, instance); - if (bodyUnusable(object)) { - throw new TypeError("Body is unusable: Body has already been read"); - } - throwIfAborted(object[kState]); - const promise = createDeferredPromise(); - const errorSteps = (error) => promise.reject(error); - const successSteps = (data) => { - try { - promise.resolve(convertBytesToJSValue(data)); - } catch (e) { - errorSteps(e); + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; } - }; - if (object[kState].body == null) { - successSteps(Buffer.allocUnsafe(0)); - return promise.promise; + if (chunk) { + if (encoding) + this.write(chunk, encoding); + else + this.write(chunk); + } + this.flush(this.#finishFlushFlag); + this.#ended = true; + return super.end(cb); } - await fullyReadBody(object[kState].body, successSteps, errorSteps); - return promise.promise; - } - function bodyUnusable(object) { - const body = object[kState].body; - return body != null && (body.stream.locked || util.isDisturbed(body.stream)); - } - function parseJSONFromBytes(bytes) { - return JSON.parse(utf8DecodeBytes(bytes)); - } - function bodyMimeType(requestOrResponse) { - const headers = requestOrResponse[kState].headersList; - const mimeType = extractMimeType(headers); - if (mimeType === "failure") { - return null; + get ended() { + return this.#ended; } - return mimeType; - } - module2.exports = { - extractBody, - safelyExtractBody, - cloneBody, - mixinBody, - streamRegistry, - hasFinalizationRegistry, - bodyUnusable - }; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/client-h1.js -var require_client_h1 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var util = require_util(); - var { channels } = require_diagnostics(); - var timers = require_timers(); - var { - RequestContentLengthMismatchError, - ResponseContentLengthMismatchError, - RequestAbortedError, - HeadersTimeoutError, - HeadersOverflowError, - SocketError, - InformationalError, - BodyTimeoutError, - HTTPParserError, - ResponseExceededMaxSizeError - } = require_errors(); - var { - kUrl, - kReset, - kClient, - kParser, - kBlocking, - kRunning, - kPending, - kSize, - kWriting, - kQueue, - kNoRef, - kKeepAliveDefaultTimeout, - kHostHeader, - kPendingIdx, - kRunningIdx, - kError, - kPipelining, - kSocket, - kKeepAliveTimeoutValue, - kMaxHeadersSize, - kKeepAliveMaxTimeout, - kKeepAliveTimeoutThreshold, - kHeadersTimeout, - kBodyTimeout, - kStrictContentLength, - kMaxRequests, - kCounter, - kMaxResponseSize, - kOnError, - kResume, - kHTTPContext - } = require_symbols(); - var constants2 = require_constants3(); - var EMPTY_BUF = Buffer.alloc(0); - var FastBuffer = Buffer[Symbol.species]; - var addListener = util.addListener; - var removeAllListeners = util.removeAllListeners; - var extractBody; - async function lazyllhttp() { - const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; - let mod; - try { - mod = await WebAssembly.compile(require_llhttp_simd_wasm()); - } catch (e) { - mod = await WebAssembly.compile(llhttpWasmData || require_llhttp_wasm()); - } - return await WebAssembly.instantiate(mod, { - env: { - /* eslint-disable camelcase */ - wasm_on_url: (p, at, len) => { - return 0; - }, - wasm_on_status: (p, at, len) => { - assert5(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_message_begin: (p) => { - assert5(currentParser.ptr === p); - return currentParser.onMessageBegin() || 0; - }, - wasm_on_header_field: (p, at, len) => { - assert5(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_header_value: (p, at, len) => { - assert5(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { - assert5(currentParser.ptr === p); - return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; - }, - wasm_on_body: (p, at, len) => { - assert5(currentParser.ptr === p); - const start = at - currentBufferPtr + currentBufferRef.byteOffset; - return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; - }, - wasm_on_message_complete: (p) => { - assert5(currentParser.ptr === p); - return currentParser.onMessageComplete() || 0; - } - /* eslint-enable camelcase */ - } - }); - } - var llhttpInstance = null; - var llhttpPromise = lazyllhttp(); - llhttpPromise.catch(); - var currentParser = null; - var currentBufferRef = null; - var currentBufferSize = 0; - var currentBufferPtr = null; - var USE_NATIVE_TIMER = 0; - var USE_FAST_TIMER = 1; - var TIMEOUT_HEADERS = 2 | USE_FAST_TIMER; - var TIMEOUT_BODY = 4 | USE_FAST_TIMER; - var TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER; - var Parser2 = class { - constructor(client, socket, { exports: exports3 }) { - assert5(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); - this.llhttp = exports3; - this.ptr = this.llhttp.llhttp_alloc(constants2.TYPE.RESPONSE); - this.client = client; - this.socket = socket; - this.timeout = null; - this.timeoutValue = null; - this.timeoutType = null; - this.statusCode = null; - this.statusText = ""; - this.upgrade = false; - this.headers = []; - this.headersSize = 0; - this.headersMaxSize = client[kMaxHeadersSize]; - this.shouldKeepAlive = false; - this.paused = false; - this.resume = this.resume.bind(this); - this.bytesRead = 0; - this.keepAlive = ""; - this.contentLength = ""; - this.connection = ""; - this.maxResponseSize = client[kMaxResponseSize]; - } - setTimeout(delay, type) { - if (delay !== this.timeoutValue || type & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) { - if (this.timeout) { - timers.clearTimeout(this.timeout); - this.timeout = null; - } - if (delay) { - if (type & USE_FAST_TIMER) { - this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this)); - } else { - this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this)); - this.timeout.unref(); - } - } - this.timeoutValue = delay; - } else if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); - } - } - this.timeoutType = type; + // overridden in the gzip classes to do portable writes + [_superWrite](data) { + return super.write(data); } - resume() { - if (this.socket.destroyed || !this.paused) { + write(chunk, encoding, cb) { + if (typeof encoding === "function") + cb = encoding, encoding = "utf8"; + if (typeof chunk === "string") + chunk = import_buffer.Buffer.from(chunk, encoding); + if (this.#sawError) return; - } - assert5(this.ptr != null); - assert5(currentParser == null); - this.llhttp.llhttp_resume(this.ptr); - assert5(this.timeoutType === TIMEOUT_BODY); - if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); + (0, import_assert2.default)(this.#handle, "zlib binding closed"); + const nativeHandle = this.#handle._handle; + const originalNativeClose = nativeHandle.close; + nativeHandle.close = () => { + }; + const originalClose = this.#handle.close; + this.#handle.close = () => { + }; + passthroughBufferConcat(true); + let result = void 0; + try { + const flushFlag = typeof chunk[_flushFlag] === "number" ? chunk[_flushFlag] : this.#flushFlag; + result = this.#handle._processChunk(chunk, flushFlag); + passthroughBufferConcat(false); + } catch (err) { + passthroughBufferConcat(false); + this.#onError(new ZlibError(err, this.write)); + } finally { + if (this.#handle) { + ; + this.#handle._handle = nativeHandle; + nativeHandle.close = originalNativeClose; + this.#handle.close = originalClose; + this.#handle.removeAllListeners("error"); } } - this.paused = false; - this.execute(this.socket.read() || EMPTY_BUF); - this.readMore(); - } - readMore() { - while (!this.paused && this.ptr) { - const chunk = this.socket.read(); - if (chunk === null) { - break; + if (this.#handle) + this.#handle.on("error", (er) => this.#onError(new ZlibError(er, this.write))); + let writeReturn; + if (result) { + if (Array.isArray(result) && result.length > 0) { + const r = result[0]; + writeReturn = this[_superWrite](import_buffer.Buffer.from(r)); + for (let i = 1; i < result.length; i++) { + writeReturn = this[_superWrite](result[i]); + } + } else { + writeReturn = this[_superWrite](import_buffer.Buffer.from(result)); } - this.execute(chunk); } + if (cb) + cb(); + return writeReturn; } - execute(data) { - assert5(this.ptr != null); - assert5(currentParser == null); - assert5(!this.paused); - const { socket, llhttp } = this; - if (data.length > currentBufferSize) { - if (currentBufferPtr) { - llhttp.free(currentBufferPtr); - } - currentBufferSize = Math.ceil(data.length / 4096) * 4096; - currentBufferPtr = llhttp.malloc(currentBufferSize); - } - new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); - try { - let ret; + }; + Zlib = class extends ZlibBase { + #level; + #strategy; + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.Z_NO_FLUSH; + opts.finishFlush = opts.finishFlush || constants.Z_FINISH; + opts.fullFlushFlag = constants.Z_FULL_FLUSH; + super(opts, mode); + this.#level = opts.level; + this.#strategy = opts.strategy; + } + params(level, strategy) { + if (this.sawError) + return; + if (!this.handle) + throw new Error("cannot switch params when binding is closed"); + if (!this.handle.params) + throw new Error("not supported in this implementation"); + if (this.#level !== level || this.#strategy !== strategy) { + this.flush(constants.Z_SYNC_FLUSH); + (0, import_assert2.default)(this.handle, "zlib binding closed"); + const origFlush = this.handle.flush; + this.handle.flush = (flushFlag, cb) => { + if (typeof flushFlag === "function") { + cb = flushFlag; + flushFlag = this.flushFlag; + } + this.flush(flushFlag); + cb?.(); + }; try { - currentBufferRef = data; - currentParser = this; - ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); - } catch (err) { - throw err; + ; + this.handle.params(level, strategy); } finally { - currentParser = null; - currentBufferRef = null; + this.handle.flush = origFlush; } - const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret === constants2.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)); - } else if (ret === constants2.ERROR.PAUSED) { - this.paused = true; - socket.unshift(data.slice(offset)); - } else if (ret !== constants2.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr); - let message = ""; - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); - message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; - } - throw new HTTPParserError(message, constants2.ERROR[ret], data.slice(offset)); + if (this.handle) { + this.#level = level; + this.#strategy = strategy; } - } catch (err) { - util.destroy(socket, err); - } - } - destroy() { - assert5(this.ptr != null); - assert5(currentParser == null); - this.llhttp.llhttp_free(this.ptr); - this.ptr = null; - this.timeout && timers.clearTimeout(this.timeout); - this.timeout = null; - this.timeoutValue = null; - this.timeoutType = null; - this.paused = false; - } - onStatus(buf) { - this.statusText = buf.toString(); - } - onMessageBegin() { - const { socket, client } = this; - if (socket.destroyed) { - return -1; - } - const request = client[kQueue][client[kRunningIdx]]; - if (!request) { - return -1; } - request.onResponseStarted(); } - onHeaderField(buf) { - const len = this.headers.length; - if ((len & 1) === 0) { - this.headers.push(buf); - } else { - this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); - } - this.trackHeader(buf.length); + }; + Gzip = class extends Zlib { + #portable; + constructor(opts) { + super(opts, "Gzip"); + this.#portable = opts && !!opts.portable; } - onHeaderValue(buf) { - let len = this.headers.length; - if ((len & 1) === 1) { - this.headers.push(buf); - len += 1; - } else { - this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); - } - const key = this.headers[len - 2]; - if (key.length === 10) { - const headerName = util.bufferToLowerCasedHeaderName(key); - if (headerName === "keep-alive") { - this.keepAlive += buf.toString(); - } else if (headerName === "connection") { - this.connection += buf.toString(); - } - } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === "content-length") { - this.contentLength += buf.toString(); - } - this.trackHeader(buf.length); - } - trackHeader(len) { - this.headersSize += len; - if (this.headersSize >= this.headersMaxSize) { - util.destroy(this.socket, new HeadersOverflowError()); - } - } - onUpgrade(head) { - const { upgrade, client, socket, headers, statusCode } = this; - assert5(upgrade); - assert5(client[kSocket] === socket); - assert5(!socket.destroyed); - assert5(!this.paused); - assert5((headers.length & 1) === 0); - const request = client[kQueue][client[kRunningIdx]]; - assert5(request); - assert5(request.upgrade || request.method === "CONNECT"); - this.statusCode = null; - this.statusText = ""; - this.shouldKeepAlive = null; - this.headers = []; - this.headersSize = 0; - socket.unshift(head); - socket[kParser].destroy(); - socket[kParser] = null; - socket[kClient] = null; - socket[kError] = null; - removeAllListeners(socket); - client[kSocket] = null; - client[kHTTPContext] = null; - client[kQueue][client[kRunningIdx]++] = null; - client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); - try { - request.onUpgrade(statusCode, headers, socket); - } catch (err) { - util.destroy(socket, err); - } - client[kResume](); + [_superWrite](data) { + if (!this.#portable) + return super[_superWrite](data); + this.#portable = false; + data[9] = 255; + return super[_superWrite](data); } - onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { - const { client, socket, headers, statusText } = this; - if (socket.destroyed) { - return -1; - } - const request = client[kQueue][client[kRunningIdx]]; - if (!request) { - return -1; - } - assert5(!this.upgrade); - assert5(this.statusCode < 200); - if (statusCode === 100) { - util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); - return -1; - } - if (upgrade && !request.upgrade) { - util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket))); - return -1; - } - assert5(this.timeoutType === TIMEOUT_HEADERS); - this.statusCode = statusCode; - this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. - request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; - if (this.statusCode >= 200) { - const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout]; - this.setTimeout(bodyTimeout, TIMEOUT_BODY); - } else if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); - } - } - if (request.method === "CONNECT") { - assert5(client[kRunning] === 1); - this.upgrade = true; - return 2; - } - if (upgrade) { - assert5(client[kRunning] === 1); - this.upgrade = true; - return 2; - } - assert5((this.headers.length & 1) === 0); - this.headers = []; - this.headersSize = 0; - if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null; - if (keepAliveTimeout != null) { - const timeout = Math.min( - keepAliveTimeout - client[kKeepAliveTimeoutThreshold], - client[kKeepAliveMaxTimeout] - ); - if (timeout <= 0) { - socket[kReset] = true; - } else { - client[kKeepAliveTimeoutValue] = timeout; - } - } else { - client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; - } - } else { - socket[kReset] = true; - } - const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false; - if (request.aborted) { - return -1; - } - if (request.method === "HEAD") { - return 1; - } - if (statusCode < 200) { - return 1; - } - if (socket[kBlocking]) { - socket[kBlocking] = false; - client[kResume](); - } - return pause ? constants2.ERROR.PAUSED : 0; + }; + Unzip = class extends Zlib { + constructor(opts) { + super(opts, "Unzip"); } - onBody(buf) { - const { client, socket, statusCode, maxResponseSize } = this; - if (socket.destroyed) { - return -1; - } - const request = client[kQueue][client[kRunningIdx]]; - assert5(request); - assert5(this.timeoutType === TIMEOUT_BODY); - if (this.timeout) { - if (this.timeout.refresh) { - this.timeout.refresh(); - } - } - assert5(statusCode >= 200); - if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util.destroy(socket, new ResponseExceededMaxSizeError()); - return -1; - } - this.bytesRead += buf.length; - if (request.onData(buf) === false) { - return constants2.ERROR.PAUSED; - } + }; + Brotli = class extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS; + opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH; + opts.fullFlushFlag = constants.BROTLI_OPERATION_FLUSH; + super(opts, mode); } - onMessageComplete() { - const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this; - if (socket.destroyed && (!statusCode || shouldKeepAlive)) { - return -1; - } - if (upgrade) { - return; - } - assert5(statusCode >= 100); - assert5((this.headers.length & 1) === 0); - const request = client[kQueue][client[kRunningIdx]]; - assert5(request); - this.statusCode = null; - this.statusText = ""; - this.bytesRead = 0; - this.contentLength = ""; - this.keepAlive = ""; - this.connection = ""; - this.headers = []; - this.headersSize = 0; - if (statusCode < 200) { - return; - } - if (request.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { - util.destroy(socket, new ResponseContentLengthMismatchError()); - return -1; - } - request.onComplete(headers); - client[kQueue][client[kRunningIdx]++] = null; - if (socket[kWriting]) { - assert5(client[kRunning] === 0); - util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; - } else if (!shouldKeepAlive) { - util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; - } else if (socket[kReset] && client[kRunning] === 0) { - util.destroy(socket, new InformationalError("reset")); - return constants2.ERROR.PAUSED; - } else if (client[kPipelining] == null || client[kPipelining] === 1) { - setImmediate(() => client[kResume]()); - } else { - client[kResume](); - } + }; + BrotliCompress = class extends Brotli { + constructor(opts) { + super(opts, "BrotliCompress"); } }; - function onParserTimeout(parser) { - const { socket, timeoutType, client, paused } = parser.deref(); - if (timeoutType === TIMEOUT_HEADERS) { - if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { - assert5(!paused, "cannot be paused while waiting for headers"); - util.destroy(socket, new HeadersTimeoutError()); - } - } else if (timeoutType === TIMEOUT_BODY) { - if (!paused) { - util.destroy(socket, new BodyTimeoutError()); - } - } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { - assert5(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); - util.destroy(socket, new InformationalError("socket idle timeout")); + BrotliDecompress = class extends Brotli { + constructor(opts) { + super(opts, "BrotliDecompress"); } - } - async function connectH1(client, socket) { - client[kSocket] = socket; - if (!llhttpInstance) { - llhttpInstance = await llhttpPromise; - llhttpPromise = null; - } - socket[kNoRef] = false; - socket[kWriting] = false; - socket[kReset] = false; - socket[kBlocking] = false; - socket[kParser] = new Parser2(client, socket, llhttpInstance); - addListener(socket, "error", function(err) { - assert5(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - const parser = this[kParser]; - if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); - return; - } - this[kError] = err; - this[kClient][kOnError](err); - }); - addListener(socket, "readable", function() { - const parser = this[kParser]; - if (parser) { - parser.readMore(); - } - }); - addListener(socket, "end", function() { - const parser = this[kParser]; - if (parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); - return; - } - util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); - }); - addListener(socket, "close", function() { - const client2 = this[kClient]; - const parser = this[kParser]; - if (parser) { - if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); - } - this[kParser].destroy(); - this[kParser] = null; - } - const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); - client2[kSocket] = null; - client2[kHTTPContext] = null; - if (client2.destroyed) { - assert5(client2[kPending] === 0); - const requests = client2[kQueue].splice(client2[kRunningIdx]); - for (let i = 0; i < requests.length; i++) { - const request = requests[i]; - util.errorRequest(client2, request, err); - } - } else if (client2[kRunning] > 0 && err.code !== "UND_ERR_INFO") { - const request = client2[kQueue][client2[kRunningIdx]]; - client2[kQueue][client2[kRunningIdx]++] = null; - util.errorRequest(client2, request, err); - } - client2[kPendingIdx] = client2[kRunningIdx]; - assert5(client2[kRunning] === 0); - client2.emit("disconnect", client2[kUrl], [client2], err); - client2[kResume](); - }); - let closed = false; - socket.on("close", () => { - closed = true; - }); - return { - version: "h1", - defaultPipelining: 1, - write(...args) { - return writeH1(client, ...args); - }, - resume() { - resumeH1(client); - }, - destroy(err, callback) { - if (closed) { - queueMicrotask(callback); - } else { - socket.destroy(err).on("close", callback); - } - }, - get destroyed() { - return socket.destroyed; - }, - busy(request) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { - return true; - } - if (request) { - if (client[kRunning] > 0 && !request.idempotent) { - return true; - } - if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) { - return true; - } - if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) { - return true; - } - } - return false; - } - }; - } - function resumeH1(client) { - const socket = client[kSocket]; - if (socket && !socket.destroyed) { - if (client[kSize] === 0) { - if (!socket[kNoRef] && socket.unref) { - socket.unref(); - socket[kNoRef] = true; - } - } else if (socket[kNoRef] && socket.ref) { - socket.ref(); - socket[kNoRef] = false; - } - if (client[kSize] === 0) { - if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { - socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE); - } - } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { - if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { - const request = client[kQueue][client[kRunningIdx]]; - const headersTimeout = request.headersTimeout != null ? request.headersTimeout : client[kHeadersTimeout]; - socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); - } - } - } - } - function shouldSendContentLength(method) { - return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; - } - function writeH1(client, request) { - const { method, path: path16, host, upgrade, blocking, reset } = request; - let { body, headers, contentLength } = request; - const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; - if (util.isFormDataLike(body)) { - if (!extractBody) { - extractBody = require_body().extractBody; - } - const [bodyStream, contentType] = extractBody(body); - if (request.contentType == null) { - headers.push("content-type", contentType); - } - body = bodyStream.stream; - contentLength = bodyStream.length; - } else if (util.isBlobLike(body) && request.contentType == null && body.type) { - headers.push("content-type", body.type); - } - if (body && typeof body.read === "function") { - body.read(0); - } - const bodyLength = util.bodyLength(body); - contentLength = bodyLength ?? contentLength; - if (contentLength === null) { - contentLength = request.contentLength; - } - if (contentLength === 0 && !expectsPayload) { - contentLength = null; - } - if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { - if (client[kStrictContentLength]) { - util.errorRequest(client, request, new RequestContentLengthMismatchError()); - return false; - } - process.emitWarning(new RequestContentLengthMismatchError()); - } - const socket = client[kSocket]; - const abort = (err) => { - if (request.aborted || request.completed) { - return; - } - util.errorRequest(client, request, err || new RequestAbortedError()); - util.destroy(body); - util.destroy(socket, new InformationalError("aborted")); - }; - try { - request.onConnect(abort); - } catch (err) { - util.errorRequest(client, request, err); - } - if (request.aborted) { - return false; - } - if (method === "HEAD") { - socket[kReset] = true; - } - if (upgrade || method === "CONNECT") { - socket[kReset] = true; - } - if (reset != null) { - socket[kReset] = reset; - } - if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { - socket[kReset] = true; + }; + Zstd = class extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.ZSTD_e_continue; + opts.finishFlush = opts.finishFlush || constants.ZSTD_e_end; + opts.fullFlushFlag = constants.ZSTD_e_flush; + super(opts, mode); } - if (blocking) { - socket[kBlocking] = true; + }; + ZstdCompress = class extends Zstd { + constructor(opts) { + super(opts, "ZstdCompress"); } - let header = `${method} ${path16} HTTP/1.1\r -`; - if (typeof host === "string") { - header += `host: ${host}\r -`; - } else { - header += client[kHostHeader]; + }; + ZstdDecompress = class extends Zstd { + constructor(opts) { + super(opts, "ZstdDecompress"); } - if (upgrade) { - header += `connection: upgrade\r -upgrade: ${upgrade}\r -`; - } else if (client[kPipelining] && !socket[kReset]) { - header += "connection: keep-alive\r\n"; + }; + } +}); + +// node_modules/tar/dist/esm/large-numbers.js +var encode, encodePositive, encodeNegative, parse, twos, pos, onesComp, twosComp; +var init_large_numbers = __esm({ + "node_modules/tar/dist/esm/large-numbers.js"() { + encode = (num, buf) => { + if (!Number.isSafeInteger(num)) { + throw Error("cannot encode number outside of javascript safe integer range"); + } else if (num < 0) { + encodeNegative(num, buf); } else { - header += "connection: close\r\n"; - } - if (Array.isArray(headers)) { - for (let n = 0; n < headers.length; n += 2) { - const key = headers[n + 0]; - const val = headers[n + 1]; - if (Array.isArray(val)) { - for (let i = 0; i < val.length; i++) { - header += `${key}: ${val[i]}\r -`; - } - } else { - header += `${key}: ${val}\r -`; - } - } - } - if (channels.sendHeaders.hasSubscribers) { - channels.sendHeaders.publish({ request, headers: header, socket }); + encodePositive(num, buf); } - if (!body || bodyLength === 0) { - writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload); - } else if (util.isBuffer(body)) { - writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload); - } else if (util.isBlobLike(body)) { - if (typeof body.stream === "function") { - writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload); - } else { - writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload); - } - } else if (util.isStream(body)) { - writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload); - } else if (util.isIterable(body)) { - writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload); - } else { - assert5(false); + return buf; + }; + encodePositive = (num, buf) => { + buf[0] = 128; + for (var i = buf.length; i > 1; i--) { + buf[i - 1] = num & 255; + num = Math.floor(num / 256); } - return true; - } - function writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload) { - assert5(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); - let finished = false; - const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }); - const onData = function(chunk) { - if (finished) { - return; - } - try { - if (!writer.write(chunk) && this.pause) { - this.pause(); - } - } catch (err) { - util.destroy(this, err); - } - }; - const onDrain = function() { - if (finished) { - return; - } - if (body.resume) { - body.resume(); - } - }; - const onClose = function() { - queueMicrotask(() => { - body.removeListener("error", onFinished); - }); - if (!finished) { - const err = new RequestAbortedError(); - queueMicrotask(() => onFinished(err)); - } - }; - const onFinished = function(err) { - if (finished) { - return; - } - finished = true; - assert5(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); - socket.off("drain", onDrain).off("error", onFinished); - body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose); - if (!err) { - try { - writer.end(); - } catch (er) { - err = er; - } - } - writer.destroy(err); - if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util.destroy(body, err); + }; + encodeNegative = (num, buf) => { + buf[0] = 255; + var flipped = false; + num = num * -1; + for (var i = buf.length; i > 1; i--) { + var byte = num & 255; + num = Math.floor(num / 256); + if (flipped) { + buf[i - 1] = onesComp(byte); + } else if (byte === 0) { + buf[i - 1] = 0; } else { - util.destroy(body); - } - }; - body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose); - if (body.resume) { - body.resume(); - } - socket.on("drain", onDrain).on("error", onFinished); - if (body.errorEmitted ?? body.errored) { - setImmediate(() => onFinished(body.errored)); - } else if (body.endEmitted ?? body.readableEnded) { - setImmediate(() => onFinished(null)); - } - if (body.closeEmitted ?? body.closed) { - setImmediate(onClose); - } - } - function writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload) { - try { - if (!body) { - if (contentLength === 0) { - socket.write(`${header}content-length: 0\r -\r -`, "latin1"); - } else { - assert5(contentLength === null, "no body must not have content length"); - socket.write(`${header}\r -`, "latin1"); - } - } else if (util.isBuffer(body)) { - assert5(contentLength === body.byteLength, "buffer body must have content length"); - socket.cork(); - socket.write(`${header}content-length: ${contentLength}\r -\r -`, "latin1"); - socket.write(body); - socket.uncork(); - request.onBodySent(body); - if (!expectsPayload && request.reset !== false) { - socket[kReset] = true; - } + flipped = true; + buf[i - 1] = twosComp(byte); } - request.onRequestSent(); - client[kResume](); - } catch (err) { - abort(err); } - } - async function writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) { - assert5(contentLength === body.size, "blob body must have content length"); - try { - if (contentLength != null && contentLength !== body.size) { - throw new RequestContentLengthMismatchError(); - } - const buffer = Buffer.from(await body.arrayBuffer()); - socket.cork(); - socket.write(`${header}content-length: ${contentLength}\r -\r -`, "latin1"); - socket.write(buffer); - socket.uncork(); - request.onBodySent(buffer); - request.onRequestSent(); - if (!expectsPayload && request.reset !== false) { - socket[kReset] = true; - } - client[kResume](); - } catch (err) { - abort(err); + }; + parse = (buf) => { + const pre = buf[0]; + const value = pre === 128 ? pos(buf.subarray(1, buf.length)) : pre === 255 ? twos(buf) : null; + if (value === null) { + throw Error("invalid base256 encoding"); } - } - async function writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload) { - assert5(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); - let callback = null; - function onDrain() { - if (callback) { - const cb = callback; - callback = null; - cb(); - } + if (!Number.isSafeInteger(value)) { + throw Error("parsed number outside of javascript safe integer range"); } - const waitForDrain = () => new Promise((resolve, reject) => { - assert5(callback === null); - if (socket[kError]) { - reject(socket[kError]); + return value; + }; + twos = (buf) => { + var len = buf.length; + var sum = 0; + var flipped = false; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + var f; + if (flipped) { + f = onesComp(byte); + } else if (byte === 0) { + f = byte; } else { - callback = resolve; - } - }); - socket.on("close", onDrain).on("drain", onDrain); - const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }); - try { - for await (const chunk of body) { - if (socket[kError]) { - throw socket[kError]; - } - if (!writer.write(chunk)) { - await waitForDrain(); - } - } - writer.end(); - } catch (err) { - writer.destroy(err); - } finally { - socket.off("close", onDrain).off("drain", onDrain); - } - } - var AsyncWriter = class { - constructor({ abort, socket, request, contentLength, client, expectsPayload, header }) { - this.socket = socket; - this.request = request; - this.contentLength = contentLength; - this.client = client; - this.bytesWritten = 0; - this.expectsPayload = expectsPayload; - this.header = header; - this.abort = abort; - socket[kWriting] = true; - } - write(chunk) { - const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this; - if (socket[kError]) { - throw socket[kError]; - } - if (socket.destroyed) { - return false; - } - const len = Buffer.byteLength(chunk); - if (!len) { - return true; - } - if (contentLength !== null && bytesWritten + len > contentLength) { - if (client[kStrictContentLength]) { - throw new RequestContentLengthMismatchError(); - } - process.emitWarning(new RequestContentLengthMismatchError()); - } - socket.cork(); - if (bytesWritten === 0) { - if (!expectsPayload && request.reset !== false) { - socket[kReset] = true; - } - if (contentLength === null) { - socket.write(`${header}transfer-encoding: chunked\r -`, "latin1"); - } else { - socket.write(`${header}content-length: ${contentLength}\r -\r -`, "latin1"); - } - } - if (contentLength === null) { - socket.write(`\r -${len.toString(16)}\r -`, "latin1"); - } - this.bytesWritten += len; - const ret = socket.write(chunk); - socket.uncork(); - request.onBodySent(chunk); - if (!ret) { - if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { - if (socket[kParser].timeout.refresh) { - socket[kParser].timeout.refresh(); - } - } - } - return ret; - } - end() { - const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this; - request.onRequestSent(); - socket[kWriting] = false; - if (socket[kError]) { - throw socket[kError]; - } - if (socket.destroyed) { - return; - } - if (bytesWritten === 0) { - if (expectsPayload) { - socket.write(`${header}content-length: 0\r -\r -`, "latin1"); - } else { - socket.write(`${header}\r -`, "latin1"); - } - } else if (contentLength === null) { - socket.write("\r\n0\r\n\r\n", "latin1"); - } - if (contentLength !== null && bytesWritten !== contentLength) { - if (client[kStrictContentLength]) { - throw new RequestContentLengthMismatchError(); - } else { - process.emitWarning(new RequestContentLengthMismatchError()); - } + flipped = true; + f = twosComp(byte); } - if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { - if (socket[kParser].timeout.refresh) { - socket[kParser].timeout.refresh(); - } + if (f !== 0) { + sum -= f * Math.pow(256, len - i - 1); } - client[kResume](); } - destroy(err) { - const { socket, client, abort } = this; - socket[kWriting] = false; - if (err) { - assert5(client[kRunning] <= 1, "pipeline should only contain this request"); - abort(err); + return sum; + }; + pos = (buf) => { + var len = buf.length; + var sum = 0; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + if (byte !== 0) { + sum += byte * Math.pow(256, len - i - 1); } } + return sum; }; - module2.exports = connectH1; + onesComp = (byte) => (255 ^ byte) & 255; + twosComp = (byte) => (255 ^ byte) + 1 & 255; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/client-h2.js -var require_client_h2 = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var { pipeline } = require("node:stream"); - var util = require_util(); - var { - RequestContentLengthMismatchError, - RequestAbortedError, - SocketError, - InformationalError - } = require_errors(); - var { - kUrl, - kReset, - kClient, - kRunning, - kPending, - kQueue, - kPendingIdx, - kRunningIdx, - kError, - kSocket, - kStrictContentLength, - kOnError, - kMaxConcurrentStreams, - kHTTP2Session, - kResume, - kSize, - kHTTPContext - } = require_symbols(); - var kOpenStreams = /* @__PURE__ */ Symbol("open streams"); - var extractBody; - var h2ExperimentalWarned = false; - var http2; - try { - http2 = require("node:http2"); - } catch { - http2 = { constants: {} }; - } - var { - constants: { - HTTP2_HEADER_AUTHORITY, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_SCHEME, - HTTP2_HEADER_CONTENT_LENGTH, - HTTP2_HEADER_EXPECT, - HTTP2_HEADER_STATUS - } - } = http2; - function parseH2Headers(headers) { - const result = []; - for (const [name2, value] of Object.entries(headers)) { - if (Array.isArray(value)) { - for (const subvalue of value) { - result.push(Buffer.from(name2), Buffer.from(subvalue)); - } - } else { - result.push(Buffer.from(name2), Buffer.from(value)); - } - } - return result; - } - async function connectH2(client, socket) { - client[kSocket] = socket; - if (!h2ExperimentalWarned) { - h2ExperimentalWarned = true; - process.emitWarning("H2 support is experimental, expect them to change at any time.", { - code: "UNDICI-H2" - }); - } - const session = http2.connect(client[kUrl], { - createConnection: () => socket, - peerMaxConcurrentStreams: client[kMaxConcurrentStreams] - }); - session[kOpenStreams] = 0; - session[kClient] = client; - session[kSocket] = socket; - util.addListener(session, "error", onHttp2SessionError); - util.addListener(session, "frameError", onHttp2FrameError); - util.addListener(session, "end", onHttp2SessionEnd); - util.addListener(session, "goaway", onHTTP2GoAway); - util.addListener(session, "close", function() { - const { [kClient]: client2 } = this; - const { [kSocket]: socket2 } = client2; - const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util.getSocketInfo(socket2)); - client2[kHTTP2Session] = null; - if (client2.destroyed) { - assert5(client2[kPending] === 0); - const requests = client2[kQueue].splice(client2[kRunningIdx]); - for (let i = 0; i < requests.length; i++) { - const request = requests[i]; - util.errorRequest(client2, request, err); - } - } - }); - session.unref(); - client[kHTTP2Session] = session; - socket[kHTTP2Session] = session; - util.addListener(socket, "error", function(err) { - assert5(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - this[kError] = err; - this[kClient][kOnError](err); - }); - util.addListener(socket, "end", function() { - util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); - }); - util.addListener(socket, "close", function() { - const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); - client[kSocket] = null; - if (this[kHTTP2Session] != null) { - this[kHTTP2Session].destroy(err); - } - client[kPendingIdx] = client[kRunningIdx]; - assert5(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); - client[kResume](); - }); - let closed = false; - socket.on("close", () => { - closed = true; - }); - return { - version: "h2", - defaultPipelining: Infinity, - write(...args) { - return writeH2(client, ...args); - }, - resume() { - resumeH2(client); - }, - destroy(err, callback) { - if (closed) { - queueMicrotask(callback); - } else { - socket.destroy(err).on("close", callback); - } - }, - get destroyed() { - return socket.destroyed; - }, - busy() { - return false; - } - }; - } - function resumeH2(client) { - const socket = client[kSocket]; - if (socket?.destroyed === false) { - if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) { - socket.unref(); - client[kHTTP2Session].unref(); - } else { - socket.ref(); - client[kHTTP2Session].ref(); - } - } - } - function onHttp2SessionError(err) { - assert5(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - this[kSocket][kError] = err; - this[kClient][kOnError](err); - } - function onHttp2FrameError(type, code2, id) { - if (id === 0) { - const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code2}`); - this[kSocket][kError] = err; - this[kClient][kOnError](err); - } - } - function onHttp2SessionEnd() { - const err = new SocketError("other side closed", util.getSocketInfo(this[kSocket])); - this.destroy(err); - util.destroy(this[kSocket], err); - } - function onHTTP2GoAway(code2) { - const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code2}`, util.getSocketInfo(this)); - const client = this[kClient]; - client[kSocket] = null; - client[kHTTPContext] = null; - if (this[kHTTP2Session] != null) { - this[kHTTP2Session].destroy(err); - this[kHTTP2Session] = null; - } - util.destroy(this[kSocket], err); - if (client[kRunningIdx] < client[kQueue].length) { - const request = client[kQueue][client[kRunningIdx]]; - client[kQueue][client[kRunningIdx]++] = null; - util.errorRequest(client, request, err); - client[kPendingIdx] = client[kRunningIdx]; - } - assert5(client[kRunning] === 0); - client.emit("disconnect", client[kUrl], [client], err); - client[kResume](); - } - function shouldSendContentLength(method) { - return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; - } - function writeH2(client, request) { - const session = client[kHTTP2Session]; - const { method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; - let { body } = request; - if (upgrade) { - util.errorRequest(client, request, new Error("Upgrade not supported for H2")); - return false; - } - const headers = {}; - for (let n = 0; n < reqHeaders.length; n += 2) { - const key = reqHeaders[n + 0]; - const val = reqHeaders[n + 1]; - if (Array.isArray(val)) { - for (let i = 0; i < val.length; i++) { - if (headers[key]) { - headers[key] += `,${val[i]}`; - } else { - headers[key] = val[i]; - } - } - } else { - headers[key] = val; +// node_modules/tar/dist/esm/types.js +var isCode, name, code; +var init_types = __esm({ + "node_modules/tar/dist/esm/types.js"() { + isCode = (c) => name.has(c); + name = /* @__PURE__ */ new Map([ + ["0", "File"], + // same as File + ["", "OldFile"], + ["1", "Link"], + ["2", "SymbolicLink"], + // Devices and FIFOs aren't fully supported + // they are parsed, but skipped when unpacking + ["3", "CharacterDevice"], + ["4", "BlockDevice"], + ["5", "Directory"], + ["6", "FIFO"], + // same as File + ["7", "ContiguousFile"], + // pax headers + ["g", "GlobalExtendedHeader"], + ["x", "ExtendedHeader"], + // vendor-specific stuff + // skip + ["A", "SolarisACL"], + // like 5, but with data, which should be skipped + ["D", "GNUDumpDir"], + // metadata only, skip + ["I", "Inode"], + // data = link path of next file + ["K", "NextFileHasLongLinkpath"], + // data = path of next file + ["L", "NextFileHasLongPath"], + // skip + ["M", "ContinuationFile"], + // like L + ["N", "OldGnuLongPath"], + // skip + ["S", "SparseFile"], + // skip + ["V", "TapeVolumeHeader"], + // like x + ["X", "OldExtendedHeader"] + ]); + code = new Map(Array.from(name).map((kv) => [kv[1], kv[0]])); + } +}); + +// node_modules/tar/dist/esm/header.js +var import_node_path, Header, splitPrefix, decString, decDate, numToDate, decNumber, nanUndef, decSmallNumber, MAXNUM, encNumber, encSmallNumber, octalString, padOctal, encDate, NULLS, encString; +var init_header = __esm({ + "node_modules/tar/dist/esm/header.js"() { + import_node_path = require("node:path"); + init_large_numbers(); + init_types(); + Header = class { + cksumValid = false; + needPax = false; + nullBlock = false; + block; + path; + mode; + uid; + gid; + size; + cksum; + #type = "Unsupported"; + linkpath; + uname; + gname; + devmaj = 0; + devmin = 0; + atime; + ctime; + mtime; + charset; + comment; + constructor(data, off = 0, ex, gex) { + if (Buffer.isBuffer(data)) { + this.decode(data, off || 0, ex, gex); + } else if (data) { + this.#slurp(data); } } - let stream; - const { hostname, port } = client[kUrl]; - headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; - headers[HTTP2_HEADER_METHOD] = method; - const abort = (err) => { - if (request.aborted || request.completed) { - return; - } - err = err || new RequestAbortedError(); - util.errorRequest(client, request, err); - if (stream != null) { - util.destroy(stream, err); + decode(buf, off, ex, gex) { + if (!off) { + off = 0; } - util.destroy(body, err); - client[kQueue][client[kRunningIdx]++] = null; - client[kResume](); - }; - try { - request.onConnect(abort); - } catch (err) { - util.errorRequest(client, request, err); - } - if (request.aborted) { - return false; - } - if (method === "CONNECT") { - session.ref(); - stream = session.request(headers, { endStream: false, signal }); - if (stream.id && !stream.pending) { - request.onUpgrade(null, null, stream); - ++session[kOpenStreams]; - client[kQueue][client[kRunningIdx]++] = null; - } else { - stream.once("ready", () => { - request.onUpgrade(null, null, stream); - ++session[kOpenStreams]; - client[kQueue][client[kRunningIdx]++] = null; - }); + if (!buf || !(buf.length >= off + 512)) { + throw new Error("need 512 bytes for header"); } - stream.once("close", () => { - session[kOpenStreams] -= 1; - if (session[kOpenStreams] === 0) session.unref(); - }); - return true; - } - headers[HTTP2_HEADER_PATH] = path16; - headers[HTTP2_HEADER_SCHEME] = "https"; - const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; - if (body && typeof body.read === "function") { - body.read(0); - } - let contentLength = util.bodyLength(body); - if (util.isFormDataLike(body)) { - extractBody ??= require_body().extractBody; - const [bodyStream, contentType] = extractBody(body); - headers["content-type"] = contentType; - body = bodyStream.stream; - contentLength = bodyStream.length; - } - if (contentLength == null) { - contentLength = request.contentLength; - } - if (contentLength === 0 || !expectsPayload) { - contentLength = null; - } - if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { - if (client[kStrictContentLength]) { - util.errorRequest(client, request, new RequestContentLengthMismatchError()); - return false; + this.path = ex?.path ?? decString(buf, off, 100); + this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8); + this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8); + this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8); + this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12); + this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12); + this.cksum = decNumber(buf, off + 148, 12); + if (gex) + this.#slurp(gex, true); + if (ex) + this.#slurp(ex); + const t = decString(buf, off + 156, 1); + if (isCode(t)) { + this.#type = t || "0"; } - process.emitWarning(new RequestContentLengthMismatchError()); - } - if (contentLength != null) { - assert5(body, "no body must not have content length"); - headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; - } - session.ref(); - const shouldEndStream = method === "GET" || method === "HEAD" || body === null; - if (expectContinue) { - headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream = session.request(headers, { endStream: shouldEndStream, signal }); - stream.once("continue", writeBodyH2); - } else { - stream = session.request(headers, { - endStream: shouldEndStream, - signal - }); - writeBodyH2(); - } - ++session[kOpenStreams]; - stream.once("response", (headers2) => { - const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; - request.onResponseStarted(); - if (request.aborted) { - const err = new RequestAbortedError(); - util.errorRequest(client, request, err); - util.destroy(stream, err); - return; + if (this.#type === "0" && this.path.slice(-1) === "/") { + this.#type = "5"; } - if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { - stream.pause(); + if (this.#type === "5") { + this.size = 0; } - stream.on("data", (chunk) => { - if (request.onData(chunk) === false) { - stream.pause(); + this.linkpath = decString(buf, off + 157, 100); + if (buf.subarray(off + 257, off + 265).toString() === "ustar\x0000") { + this.uname = ex?.uname ?? gex?.uname ?? decString(buf, off + 265, 32); + this.gname = ex?.gname ?? gex?.gname ?? decString(buf, off + 297, 32); + this.devmaj = ex?.devmaj ?? gex?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0; + this.devmin = ex?.devmin ?? gex?.devmin ?? decNumber(buf, off + 337, 8) ?? 0; + if (buf[off + 475] !== 0) { + const prefix = decString(buf, off + 345, 155); + this.path = prefix + "/" + this.path; + } else { + const prefix = decString(buf, off + 345, 130); + if (prefix) { + this.path = prefix + "/" + this.path; + } + this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12); + this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12); } - }); - }); - stream.once("end", () => { - if (stream.state?.state == null || stream.state.state < 6) { - request.onComplete([]); } - if (session[kOpenStreams] === 0) { - session.unref(); + let sum = 8 * 32; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; } - abort(new InformationalError("HTTP/2: stream half-closed (remote)")); - client[kQueue][client[kRunningIdx]++] = null; - client[kPendingIdx] = client[kRunningIdx]; - client[kResume](); - }); - stream.once("close", () => { - session[kOpenStreams] -= 1; - if (session[kOpenStreams] === 0) { - session.unref(); + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; } - }); - stream.once("error", function(err) { - abort(err); - }); - stream.once("frameError", (type, code2) => { - abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code2}`)); - }); - return true; - function writeBodyH2() { - if (!body || contentLength === 0) { - writeBuffer( - abort, - stream, - null, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } else if (util.isBuffer(body)) { - writeBuffer( - abort, - stream, - body, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } else if (util.isBlobLike(body)) { - if (typeof body.stream === "function") { - writeIterable( - abort, - stream, - body.stream(), - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } else { - writeBlob( - abort, - stream, - body, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } - } else if (util.isStream(body)) { - writeStream( - abort, - client[kSocket], - expectsPayload, - stream, - body, - client, - request, - contentLength - ); - } else if (util.isIterable(body)) { - writeIterable( - abort, - stream, - body, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } else { - assert5(false); + this.cksumValid = sum === this.cksum; + if (this.cksum === void 0 && sum === 8 * 32) { + this.nullBlock = true; } } - } - function writeBuffer(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { - try { - if (body != null && util.isBuffer(body)) { - assert5(contentLength === body.byteLength, "buffer body must have content length"); - h2stream.cork(); - h2stream.write(body); - h2stream.uncork(); - h2stream.end(); - request.onBodySent(body); - } - if (!expectsPayload) { - socket[kReset] = true; - } - request.onRequestSent(); - client[kResume](); - } catch (error) { - abort(error); + #slurp(ex, gex = false) { + Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { + return !(v === null || v === void 0 || k === "path" && gex || k === "linkpath" && gex || k === "global"); + }))); } - } - function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { - assert5(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); - const pipe = pipeline( - body, - h2stream, - (err) => { - if (err) { - util.destroy(pipe, err); - abort(err); - } else { - util.removeAllListeners(pipe); - request.onRequestSent(); - if (!expectsPayload) { - socket[kReset] = true; - } - client[kResume](); - } + encode(buf, off = 0) { + if (!buf) { + buf = this.block = Buffer.alloc(512); } - ); - util.addListener(pipe, "data", onPipeData); - function onPipeData(chunk) { - request.onBodySent(chunk); - } - } - async function writeBlob(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { - assert5(contentLength === body.size, "blob body must have content length"); - try { - if (contentLength != null && contentLength !== body.size) { - throw new RequestContentLengthMismatchError(); - } - const buffer = Buffer.from(await body.arrayBuffer()); - h2stream.cork(); - h2stream.write(buffer); - h2stream.uncork(); - h2stream.end(); - request.onBodySent(buffer); - request.onRequestSent(); - if (!expectsPayload) { - socket[kReset] = true; - } - client[kResume](); - } catch (err) { - abort(err); - } - } - async function writeIterable(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { - assert5(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); - let callback = null; - function onDrain() { - if (callback) { - const cb = callback; - callback = null; - cb(); + if (this.#type === "Unsupported") { + this.#type = "0"; } - } - const waitForDrain = () => new Promise((resolve, reject) => { - assert5(callback === null); - if (socket[kError]) { - reject(socket[kError]); + if (!(buf.length >= off + 512)) { + throw new Error("need 512 bytes for header"); + } + const prefixSize = this.ctime || this.atime ? 130 : 155; + const split = splitPrefix(this.path || "", prefixSize); + const path16 = split[0]; + const prefix = split[1]; + this.needPax = !!split[2]; + this.needPax = encString(buf, off, 100, path16) || this.needPax; + this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax; + this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax; + this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax; + this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax; + this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax; + buf[off + 156] = Number(this.#type.codePointAt(0)); + this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax; + buf.write("ustar\x0000", off + 257, 8); + this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax; + this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax; + this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax; + this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax; + this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax; + if (buf[off + 475] !== 0) { + this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax; } else { - callback = resolve; + this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax; + this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax; + this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax; } - }); - h2stream.on("close", onDrain).on("drain", onDrain); - try { - for await (const chunk of body) { - if (socket[kError]) { - throw socket[kError]; - } - const res = h2stream.write(chunk); - request.onBodySent(chunk); - if (!res) { - await waitForDrain(); - } + let sum = 8 * 32; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; } - h2stream.end(); - request.onRequestSent(); - if (!expectsPayload) { - socket[kReset] = true; + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; } - client[kResume](); - } catch (err) { - abort(err); - } finally { - h2stream.off("close", onDrain).off("drain", onDrain); + this.cksum = sum; + encNumber(buf, off + 148, 8, this.cksum); + this.cksumValid = true; + return this.needPax; } - } - module2.exports = connectH2; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/handler/redirect-handler.js -var require_redirect_handler = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/handler/redirect-handler.js"(exports2, module2) { - "use strict"; - var util = require_util(); - var { kBodyUsed } = require_symbols(); - var assert5 = require("node:assert"); - var { InvalidArgumentError } = require_errors(); - var EE3 = require("node:events"); - var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = /* @__PURE__ */ Symbol("body"); - var BodyAsyncIterable = class { - constructor(body) { - this[kBody] = body; - this[kBodyUsed] = false; - } - async *[Symbol.asyncIterator]() { - assert5(!this[kBodyUsed], "disturbed"); - this[kBodyUsed] = true; - yield* this[kBody]; - } - }; - var RedirectHandler = class { - constructor(dispatch, maxRedirections, opts, handler) { - if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { - throw new InvalidArgumentError("maxRedirections must be a positive number"); - } - util.validateHandler(handler, opts.method, opts.upgrade); - this.dispatch = dispatch; - this.location = null; - this.abort = null; - this.opts = { ...opts, maxRedirections: 0 }; - this.maxRedirections = maxRedirections; - this.handler = handler; - this.history = []; - this.redirectionLimitReached = false; - if (util.isStream(this.opts.body)) { - if (util.bodyLength(this.opts.body) === 0) { - this.opts.body.on("data", function() { - assert5(false); - }); - } - if (typeof this.opts.body.readableDidRead !== "boolean") { - this.opts.body[kBodyUsed] = false; - EE3.prototype.on.call(this.opts.body, "data", function() { - this[kBodyUsed] = true; - }); - } - } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { - this.opts.body = new BodyAsyncIterable(this.opts.body); - } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util.isIterable(this.opts.body)) { - this.opts.body = new BodyAsyncIterable(this.opts.body); - } - } - onConnect(abort) { - this.abort = abort; - this.handler.onConnect(abort, { history: this.history }); - } - onUpgrade(statusCode, headers, socket) { - this.handler.onUpgrade(statusCode, headers, socket); - } - onError(error) { - this.handler.onError(error); - } - onHeaders(statusCode, headers, resume, statusText) { - this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); - if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { - if (this.request) { - this.request.abort(new Error("max redirects")); - } - this.redirectionLimitReached = true; - this.abort(new Error("max redirects")); - return; - } - if (this.opts.origin) { - this.history.push(new URL(this.opts.path, this.opts.origin)); - } - if (!this.location) { - return this.handler.onHeaders(statusCode, headers, resume, statusText); - } - const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path16 = search ? `${pathname}${search}` : pathname; - this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path16; - this.opts.origin = origin; - this.opts.maxRedirections = 0; - this.opts.query = null; - if (statusCode === 303 && this.opts.method !== "HEAD") { - this.opts.method = "GET"; - this.opts.body = null; - } + get type() { + return this.#type === "Unsupported" ? this.#type : name.get(this.#type); } - onData(chunk) { - if (this.location) { - } else { - return this.handler.onData(chunk); - } + get typeKey() { + return this.#type; } - onComplete(trailers) { - if (this.location) { - this.location = null; - this.abort = null; - this.dispatch(this.opts, this); + set type(type) { + const c = String(code.get(type)); + if (isCode(c) || c === "Unsupported") { + this.#type = c; + } else if (isCode(type)) { + this.#type = type; } else { - this.handler.onComplete(trailers); - } - } - onBodySent(chunk) { - if (this.handler.onBodySent) { - this.handler.onBodySent(chunk); + throw new TypeError("invalid entry type: " + type); } } }; - function parseLocation(statusCode, headers) { - if (redirectableStatusCodes.indexOf(statusCode) === -1) { - return null; - } - for (let i = 0; i < headers.length; i += 2) { - if (headers[i].length === 8 && util.headerNameToString(headers[i]) === "location") { - return headers[i + 1]; - } - } - } - function shouldRemoveHeader(header, removeContent, unknownOrigin) { - if (header.length === 4) { - return util.headerNameToString(header) === "host"; - } - if (removeContent && util.headerNameToString(header).startsWith("content-")) { - return true; - } - if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { - const name2 = util.headerNameToString(header); - return name2 === "authorization" || name2 === "cookie" || name2 === "proxy-authorization"; - } - return false; - } - function cleanRequestHeaders(headers, removeContent, unknownOrigin) { - const ret = []; - if (Array.isArray(headers)) { - for (let i = 0; i < headers.length; i += 2) { - if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { - ret.push(headers[i], headers[i + 1]); - } - } - } else if (headers && typeof headers === "object") { - for (const key of Object.keys(headers)) { - if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { - ret.push(key, headers[key]); + splitPrefix = (p, prefixSize) => { + const pathSize = 100; + let pp = p; + let prefix = ""; + let ret = void 0; + const root = import_node_path.posix.parse(p).root || "."; + if (Buffer.byteLength(pp) < pathSize) { + ret = [pp, prefix, false]; + } else { + prefix = import_node_path.posix.dirname(pp); + pp = import_node_path.posix.basename(pp); + do { + if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) { + ret = [pp, prefix, false]; + } else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) { + ret = [pp.slice(0, pathSize - 1), prefix, true]; + } else { + pp = import_node_path.posix.join(import_node_path.posix.basename(prefix), pp); + prefix = import_node_path.posix.dirname(prefix); } + } while (prefix !== root && ret === void 0); + if (!ret) { + ret = [p.slice(0, pathSize - 1), "", true]; } - } else { - assert5(headers == null, "headers must be an object or an array"); } return ret; - } - module2.exports = RedirectHandler; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/interceptor/redirect-interceptor.js -var require_redirect_interceptor = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/interceptor/redirect-interceptor.js"(exports2, module2) { - "use strict"; - var RedirectHandler = require_redirect_handler(); - function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) { - return (dispatch) => { - return function Intercept(opts, handler) { - const { maxRedirections = defaultMaxRedirections } = opts; - if (!maxRedirections) { - return dispatch(opts, handler); - } - const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler); - opts = { ...opts, maxRedirections: 0 }; - return dispatch(opts, redirectHandler); - }; - }; - } - module2.exports = createRedirectInterceptor; + }; + decString = (buf, off, size) => buf.subarray(off, off + size).toString("utf8").replace(/\0.*/, ""); + decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)); + numToDate = (num) => num === void 0 ? void 0 : new Date(num * 1e3); + decNumber = (buf, off, size) => Number(buf[off]) & 128 ? parse(buf.subarray(off, off + size)) : decSmallNumber(buf, off, size); + nanUndef = (value) => isNaN(value) ? void 0 : value; + decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf.subarray(off, off + size).toString("utf8").replace(/\0.*$/, "").trim(), 8)); + MAXNUM = { + 12: 8589934591, + 8: 2097151 + }; + encNumber = (buf, off, size, num) => num === void 0 ? false : num > MAXNUM[size] || num < 0 ? (encode(num, buf.subarray(off, off + size)), true) : (encSmallNumber(buf, off, size, num), false); + encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, "ascii"); + octalString = (num, size) => padOctal(Math.floor(num).toString(8), size); + padOctal = (str, size) => (str.length === size - 1 ? str : new Array(size - str.length - 1).join("0") + str + " ") + "\0"; + encDate = (buf, off, size, date) => date === void 0 ? false : encNumber(buf, off, size, date.getTime() / 1e3); + NULLS = new Array(156).join("\0"); + encString = (buf, off, size, str) => str === void 0 ? false : (buf.write(str + NULLS, off, size, "utf8"), str.length !== Buffer.byteLength(str) || str.length > size); } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/client.js -var require_client = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/client.js"(exports2, module2) { - "use strict"; - var assert5 = require("node:assert"); - var net = require("node:net"); - var http = require("node:http"); - var util = require_util(); - var { channels } = require_diagnostics(); - var Request = require_request(); - var DispatcherBase = require_dispatcher_base(); - var { - InvalidArgumentError, - InformationalError, - ClientDestroyedError - } = require_errors(); - var buildConnector = require_connect(); - var { - kUrl, - kServerName, - kClient, - kBusy, - kConnect, - kResuming, - kRunning, - kPending, - kSize, - kQueue, - kConnected, - kConnecting, - kNeedDrain, - kKeepAliveDefaultTimeout, - kHostHeader, - kPendingIdx, - kRunningIdx, - kError, - kPipelining, - kKeepAliveTimeoutValue, - kMaxHeadersSize, - kKeepAliveMaxTimeout, - kKeepAliveTimeoutThreshold, - kHeadersTimeout, - kBodyTimeout, - kStrictContentLength, - kConnector, - kMaxRedirections, - kMaxRequests, - kCounter, - kClose, - kDestroy, - kDispatch, - kInterceptors, - kLocalAddress, - kMaxResponseSize, - kOnError, - kHTTPContext, - kMaxConcurrentStreams, - kResume - } = require_symbols(); - var connectH1 = require_client_h1(); - var connectH2 = require_client_h2(); - var deprecatedInterceptorWarned = false; - var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); - var noop3 = () => { - }; - function getPipelining(client) { - return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1; - } - var Client = class extends DispatcherBase { - /** - * - * @param {string|URL} url - * @param {import('../../types/client.js').Client.Options} options - */ - constructor(url, { - interceptors, - maxHeaderSize, - headersTimeout, - socketTimeout, - requestTimeout, - connectTimeout, - bodyTimeout, - idleTimeout, - keepAlive, - keepAliveTimeout, - maxKeepAliveTimeout, - keepAliveMaxTimeout, - keepAliveTimeoutThreshold, - socketPath, - pipelining, - tls, - strictContentLength, - maxCachedSessions, - maxRedirections, - connect: connect2, - maxRequestsPerClient, - localAddress, - maxResponseSize, - autoSelectFamily, - autoSelectFamilyAttemptTimeout, - // h2 - maxConcurrentStreams, - allowH2, - webSocket - } = {}) { - super({ webSocket }); - if (keepAlive !== void 0) { - throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); - } - if (socketTimeout !== void 0) { - throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); - } - if (requestTimeout !== void 0) { - throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); - } - if (idleTimeout !== void 0) { - throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead"); - } - if (maxKeepAliveTimeout !== void 0) { - throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); - } - if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { - throw new InvalidArgumentError("invalid maxHeaderSize"); - } - if (socketPath != null && typeof socketPath !== "string") { - throw new InvalidArgumentError("invalid socketPath"); - } - if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { - throw new InvalidArgumentError("invalid connectTimeout"); - } - if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { - throw new InvalidArgumentError("invalid keepAliveTimeout"); - } - if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { - throw new InvalidArgumentError("invalid keepAliveMaxTimeout"); - } - if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { - throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold"); - } - if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { - throw new InvalidArgumentError("headersTimeout must be a positive integer or zero"); - } - if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { - throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero"); - } - if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { - throw new InvalidArgumentError("connect must be a function or an object"); - } - if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { - throw new InvalidArgumentError("maxRedirections must be a positive number"); - } - if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { - throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); - } - if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) { - throw new InvalidArgumentError("localAddress must be valid string IP address"); - } - if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { - throw new InvalidArgumentError("maxResponseSize must be a positive number"); - } - if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) { - throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number"); - } - if (allowH2 != null && typeof allowH2 !== "boolean") { - throw new InvalidArgumentError("allowH2 must be a valid boolean value"); - } - if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) { - throw new InvalidArgumentError("maxConcurrentStreams must be a positive integer, greater than 0"); - } - if (typeof connect2 !== "function") { - connect2 = buildConnector({ - ...tls, - maxCachedSessions, - allowH2, - socketPath, - timeout: connectTimeout, - ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, - ...connect2 - }); - } - if (interceptors?.Client && Array.isArray(interceptors.Client)) { - this[kInterceptors] = interceptors.Client; - if (!deprecatedInterceptorWarned) { - deprecatedInterceptorWarned = true; - process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.", { - code: "UNDICI-CLIENT-INTERCEPTOR-DEPRECATED" - }); - } - } else { - this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]; - } - this[kUrl] = util.parseOrigin(url); - this[kConnector] = connect2; - this[kPipelining] = pipelining != null ? pipelining : 1; - this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize; - this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; - this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; - this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold; - this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; - this[kServerName] = null; - this[kLocalAddress] = localAddress != null ? localAddress : null; - this[kResuming] = 0; - this[kNeedDrain] = 0; - this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r -`; - this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; - this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; - this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; - this[kMaxRedirections] = maxRedirections; - this[kMaxRequests] = maxRequestsPerClient; - this[kClosedResolve] = null; - this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1; - this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100; - this[kHTTPContext] = null; - this[kQueue] = []; - this[kRunningIdx] = 0; - this[kPendingIdx] = 0; - this[kResume] = (sync) => resume(this, sync); - this[kOnError] = (err) => onError(this, err); - } - get pipelining() { - return this[kPipelining]; - } - set pipelining(value) { - this[kPipelining] = value; - this[kResume](true); - } - get [kPending]() { - return this[kQueue].length - this[kPendingIdx]; - } - get [kRunning]() { - return this[kPendingIdx] - this[kRunningIdx]; - } - get [kSize]() { - return this[kQueue].length - this[kRunningIdx]; - } - get [kConnected]() { - return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed; - } - get [kBusy]() { - return Boolean( - this[kHTTPContext]?.busy(null) || this[kSize] >= (getPipelining(this) || 1) || this[kPending] > 0 - ); +// node_modules/tar/dist/esm/pax.js +var import_node_path2, Pax, merge, parseKV, parseKVLine; +var init_pax = __esm({ + "node_modules/tar/dist/esm/pax.js"() { + import_node_path2 = require("node:path"); + init_header(); + Pax = class _Pax { + atime; + mtime; + ctime; + charset; + comment; + gid; + uid; + gname; + uname; + linkpath; + dev; + ino; + nlink; + path; + size; + mode; + global; + constructor(obj, global2 = false) { + this.atime = obj.atime; + this.charset = obj.charset; + this.comment = obj.comment; + this.ctime = obj.ctime; + this.dev = obj.dev; + this.gid = obj.gid; + this.global = global2; + this.gname = obj.gname; + this.ino = obj.ino; + this.linkpath = obj.linkpath; + this.mtime = obj.mtime; + this.nlink = obj.nlink; + this.path = obj.path; + this.size = obj.size; + this.uid = obj.uid; + this.uname = obj.uname; } - /* istanbul ignore: only used for test */ - [kConnect](cb) { - connect(this); - this.once("connect", cb); - } - [kDispatch](opts, handler) { - const origin = opts.origin || this[kUrl].origin; - const request = new Request(origin, opts, handler); - this[kQueue].push(request); - if (this[kResuming]) { - } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { - this[kResuming] = 1; - queueMicrotask(() => resume(this)); - } else { - this[kResume](true); + encode() { + const body = this.encodeBody(); + if (body === "") { + return Buffer.allocUnsafe(0); } - if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { - this[kNeedDrain] = 2; + const bodyLen = Buffer.byteLength(body); + const bufLen = 512 * Math.ceil(1 + bodyLen / 512); + const buf = Buffer.allocUnsafe(bufLen); + for (let i = 0; i < 512; i++) { + buf[i] = 0; } - return this[kNeedDrain] < 2; - } - async [kClose]() { - return new Promise((resolve) => { - if (this[kSize]) { - this[kClosedResolve] = resolve; - } else { - resolve(null); - } - }); - } - async [kDestroy](err) { - return new Promise((resolve) => { - const requests = this[kQueue].splice(this[kPendingIdx]); - for (let i = 0; i < requests.length; i++) { - const request = requests[i]; - util.errorRequest(this, request, err); - } - const callback = () => { - if (this[kClosedResolve]) { - this[kClosedResolve](); - this[kClosedResolve] = null; - } - resolve(null); - }; - if (this[kHTTPContext]) { - this[kHTTPContext].destroy(err, callback); - this[kHTTPContext] = null; - } else { - queueMicrotask(callback); - } - this[kResume](); - }); - } - }; - var createRedirectInterceptor = require_redirect_interceptor(); - function onError(client, err) { - if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { - assert5(client[kPendingIdx] === client[kRunningIdx]); - const requests = client[kQueue].splice(client[kRunningIdx]); - for (let i = 0; i < requests.length; i++) { - const request = requests[i]; - util.errorRequest(client, request, err); + new Header({ + // XXX split the path + // then the path should be PaxHeader + basename, but less than 99, + // prepend with the dirname + /* c8 ignore start */ + path: ("PaxHeader/" + (0, import_node_path2.basename)(this.path ?? "")).slice(0, 99), + /* c8 ignore stop */ + mode: this.mode || 420, + uid: this.uid, + gid: this.gid, + size: bodyLen, + mtime: this.mtime, + type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", + linkpath: "", + uname: this.uname || "", + gname: this.gname || "", + devmaj: 0, + devmin: 0, + atime: this.atime, + ctime: this.ctime + }).encode(buf); + buf.write(body, 512, bodyLen, "utf8"); + for (let i = bodyLen + 512; i < buf.length; i++) { + buf[i] = 0; } - assert5(client[kSize] === 0); + return buf; } - } - async function connect(client) { - assert5(!client[kConnecting]); - assert5(!client[kHTTPContext]); - let { host, hostname, protocol, port } = client[kUrl]; - if (hostname[0] === "[") { - const idx = hostname.indexOf("]"); - assert5(idx !== -1); - const ip = hostname.substring(1, idx); - assert5(net.isIP(ip)); - hostname = ip; - } - client[kConnecting] = true; - if (channels.beforeConnect.hasSubscribers) { - channels.beforeConnect.publish({ - connectParams: { - host, - hostname, - protocol, - port, - version: client[kHTTPContext]?.version, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector] - }); + encodeBody() { + return this.encodeField("path") + this.encodeField("ctime") + this.encodeField("atime") + this.encodeField("dev") + this.encodeField("ino") + this.encodeField("nlink") + this.encodeField("charset") + this.encodeField("comment") + this.encodeField("gid") + this.encodeField("gname") + this.encodeField("linkpath") + this.encodeField("mtime") + this.encodeField("size") + this.encodeField("uid") + this.encodeField("uname"); } - try { - const socket = await new Promise((resolve, reject) => { - client[kConnector]({ - host, - hostname, - protocol, - port, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, (err, socket2) => { - if (err) { - reject(err); - } else { - resolve(socket2); - } - }); - }); - if (client.destroyed) { - util.destroy(socket.on("error", noop3), new ClientDestroyedError()); - return; - } - assert5(socket); - try { - client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket); - } catch (err) { - socket.destroy().on("error", noop3); - throw err; - } - client[kConnecting] = false; - socket[kCounter] = 0; - socket[kMaxRequests] = client[kMaxRequests]; - socket[kClient] = client; - socket[kError] = null; - if (channels.connected.hasSubscribers) { - channels.connected.publish({ - connectParams: { - host, - hostname, - protocol, - port, - version: client[kHTTPContext]?.version, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector], - socket - }); - } - client.emit("connect", client[kUrl], [client]); - } catch (err) { - if (client.destroyed) { - return; - } - client[kConnecting] = false; - if (channels.connectError.hasSubscribers) { - channels.connectError.publish({ - connectParams: { - host, - hostname, - protocol, - port, - version: client[kHTTPContext]?.version, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector], - error: err - }); + encodeField(field) { + if (this[field] === void 0) { + return ""; } - if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - assert5(client[kRunning] === 0); - while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { - const request = client[kQueue][client[kPendingIdx]++]; - util.errorRequest(client, request, err); - } - } else { - onError(client, err); + const r = this[field]; + const v = r instanceof Date ? r.getTime() / 1e3 : r; + const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n"; + const byteLen = Buffer.byteLength(s); + let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1; + if (byteLen + digits >= Math.pow(10, digits)) { + digits += 1; } - client.emit("connectionError", client[kUrl], [client], err); + const len = digits + byteLen; + return len + s; } - client[kResume](); - } - function emitDrain(client) { - client[kNeedDrain] = 0; - client.emit("drain", client[kUrl], [client]); - } - function resume(client, sync) { - if (client[kResuming] === 2) { - return; + static parse(str, ex, g = false) { + return new _Pax(merge(parseKV(str), ex), g); } - client[kResuming] = 2; - _resume(client, sync); - client[kResuming] = 0; - if (client[kRunningIdx] > 256) { - client[kQueue].splice(0, client[kRunningIdx]); - client[kPendingIdx] -= client[kRunningIdx]; - client[kRunningIdx] = 0; + }; + merge = (a, b) => b ? Object.assign({}, b, a) : a; + parseKV = (str) => str.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null)); + parseKVLine = (set, line) => { + const n = parseInt(line, 10); + if (n !== Buffer.byteLength(line) + 1) { + return set; } - } - function _resume(client, sync) { - while (true) { - if (client.destroyed) { - assert5(client[kPending] === 0); - return; - } - if (client[kClosedResolve] && !client[kSize]) { - client[kClosedResolve](); - client[kClosedResolve] = null; - return; - } - if (client[kHTTPContext]) { - client[kHTTPContext].resume(); - } - if (client[kBusy]) { - client[kNeedDrain] = 2; - } else if (client[kNeedDrain] === 2) { - if (sync) { - client[kNeedDrain] = 1; - queueMicrotask(() => emitDrain(client)); - } else { - emitDrain(client); - } - continue; - } - if (client[kPending] === 0) { - return; - } - if (client[kRunning] >= (getPipelining(client) || 1)) { - return; - } - const request = client[kQueue][client[kPendingIdx]]; - if (client[kUrl].protocol === "https:" && client[kServerName] !== request.servername) { - if (client[kRunning] > 0) { - return; - } - client[kServerName] = request.servername; - client[kHTTPContext]?.destroy(new InformationalError("servername changed"), () => { - client[kHTTPContext] = null; - resume(client); - }); - } - if (client[kConnecting]) { - return; - } - if (!client[kHTTPContext]) { - connect(client); - return; - } - if (client[kHTTPContext].destroyed) { - return; - } - if (client[kHTTPContext].busy(request)) { - return; - } - if (!request.aborted && client[kHTTPContext].write(request)) { - client[kPendingIdx]++; - } else { - client[kQueue].splice(client[kPendingIdx], 1); - } + line = line.slice((n + " ").length); + const kv = line.split("="); + const r = kv.shift(); + if (!r) { + return set; } - } - module2.exports = Client; + const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"); + const v = kv.join("="); + set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(Number(v) * 1e3) : /^[0-9]+$/.test(v) ? +v : v; + return set; + }; } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/pool.js -var require_pool = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/pool.js"(exports2, module2) { - "use strict"; - var { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kGetDispatcher - } = require_pool_base(); - var Client = require_client(); - var { - InvalidArgumentError - } = require_errors(); - var util = require_util(); - var { kUrl, kInterceptors } = require_symbols(); - var buildConnector = require_connect(); - var kOptions = /* @__PURE__ */ Symbol("options"); - var kConnections = /* @__PURE__ */ Symbol("connections"); - var kFactory = /* @__PURE__ */ Symbol("factory"); - function defaultFactory(origin, opts) { - return new Client(origin, opts); - } - var Pool = class extends PoolBase { - constructor(origin, { - connections, - factory = defaultFactory, - connect, - connectTimeout, - tls, - maxCachedSessions, - socketPath, - autoSelectFamily, - autoSelectFamilyAttemptTimeout, - allowH2, - ...options - } = {}) { - if (connections != null && (!Number.isFinite(connections) || connections < 0)) { - throw new InvalidArgumentError("invalid connections"); - } - if (typeof factory !== "function") { - throw new InvalidArgumentError("factory must be a function."); - } - if (connect != null && typeof connect !== "function" && typeof connect !== "object") { - throw new InvalidArgumentError("connect must be a function or an object"); - } - if (typeof connect !== "function") { - connect = buildConnector({ - ...tls, - maxCachedSessions, - allowH2, - socketPath, - timeout: connectTimeout, - ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, - ...connect - }); - } - super(options); - this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; - this[kConnections] = connections || null; - this[kUrl] = util.parseOrigin(origin); - this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; - this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; - this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error) => { - for (const target of targets) { - const idx = this[kClients].indexOf(target); - if (idx !== -1) { - this[kClients].splice(idx, 1); - } - } - }); - } - [kGetDispatcher]() { - for (const client of this[kClients]) { - if (!client[kNeedDrain]) { - return client; - } - } - if (!this[kConnections] || this[kClients].length < this[kConnections]) { - const dispatcher = this[kFactory](this[kUrl], this[kOptions]); - this[kAddClient](dispatcher); - return dispatcher; - } - } - }; - module2.exports = Pool; +// node_modules/tar/dist/esm/normalize-windows-path.js +var platform, normalizeWindowsPath; +var init_normalize_windows_path = __esm({ + "node_modules/tar/dist/esm/normalize-windows-path.js"() { + platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; + normalizeWindowsPath = platform !== "win32" ? (p) => p : (p) => p && p.replaceAll(/\\/g, "/"); } }); -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/agent.js -var require_agent = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/agent.js"(exports2, module2) { - "use strict"; - var { InvalidArgumentError } = require_errors(); - var { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); - var DispatcherBase = require_dispatcher_base(); - var Pool = require_pool(); - var Client = require_client(); - var util = require_util(); - var createRedirectInterceptor = require_redirect_interceptor(); - var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); - var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); - var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); - var kMaxRedirections = /* @__PURE__ */ Symbol("maxRedirections"); - var kOnDrain = /* @__PURE__ */ Symbol("onDrain"); - var kFactory = /* @__PURE__ */ Symbol("factory"); - var kOptions = /* @__PURE__ */ Symbol("options"); - function defaultFactory(origin, opts) { - return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); - } - var Agent = class extends DispatcherBase { - constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - if (typeof factory !== "function") { - throw new InvalidArgumentError("factory must be a function."); - } - if (connect != null && typeof connect !== "function" && typeof connect !== "object") { - throw new InvalidArgumentError("connect must be a function or an object"); - } - if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { - throw new InvalidArgumentError("maxRedirections must be a positive number"); - } - super(options); - if (connect && typeof connect !== "function") { - connect = { ...connect }; - } - this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; - this[kOptions] = { ...util.deepClone(options), connect }; - this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; - this[kMaxRedirections] = maxRedirections; - this[kFactory] = factory; - this[kClients] = /* @__PURE__ */ new Map(); - this[kOnDrain] = (origin, targets) => { - this.emit("drain", origin, [this, ...targets]); - }; - this[kOnConnect] = (origin, targets) => { - this.emit("connect", origin, [this, ...targets]); - }; - this[kOnDisconnect] = (origin, targets, err) => { - this.emit("disconnect", origin, [this, ...targets], err); - }; - this[kOnConnectionError] = (origin, targets, err) => { - this.emit("connectionError", origin, [this, ...targets], err); - }; - } - get [kRunning]() { - let ret = 0; - for (const client of this[kClients].values()) { - ret += client[kRunning]; +// node_modules/tar/dist/esm/read-entry.js +var ReadEntry; +var init_read_entry = __esm({ + "node_modules/tar/dist/esm/read-entry.js"() { + init_esm(); + init_normalize_windows_path(); + ReadEntry = class extends Minipass { + extended; + globalExtended; + header; + startBlockSize; + blockRemain; + remain; + type; + meta = false; + ignore = false; + path; + mode; + uid; + gid; + uname; + gname; + size = 0; + mtime; + atime; + ctime; + linkpath; + dev; + ino; + nlink; + invalid = false; + absolute; + unsupported = false; + constructor(header, ex, gex) { + super({}); + this.pause(); + this.extended = ex; + this.globalExtended = gex; + this.header = header; + this.remain = header.size ?? 0; + this.startBlockSize = 512 * Math.ceil(this.remain / 512); + this.blockRemain = this.startBlockSize; + this.type = header.type; + switch (this.type) { + case "File": + case "OldFile": + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + case "ContiguousFile": + case "GNUDumpDir": + break; + case "NextFileHasLongLinkpath": + case "NextFileHasLongPath": + case "OldGnuLongPath": + case "GlobalExtendedHeader": + case "ExtendedHeader": + case "OldExtendedHeader": + this.meta = true; + break; + // NOTE: gnutar and bsdtar treat unrecognized types as 'File' + // it may be worth doing the same, but with a warning. + default: + this.ignore = true; } - return ret; - } - [kDispatch](opts, handler) { - let key; - if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) { - key = String(opts.origin); - } else { - throw new InvalidArgumentError("opts.origin must be a non-empty string or URL."); + if (!header.path) { + throw new Error("no path provided for tar.ReadEntry"); } - let dispatcher = this[kClients].get(key); - if (!dispatcher) { - dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); - this[kClients].set(key, dispatcher); + this.path = normalizeWindowsPath(header.path); + this.mode = header.mode; + if (this.mode) { + this.mode = this.mode & 4095; } - return dispatcher.dispatch(opts, handler); - } - async [kClose]() { - const closePromises = []; - for (const client of this[kClients].values()) { - closePromises.push(client.close()); + this.uid = header.uid; + this.gid = header.gid; + this.uname = header.uname; + this.gname = header.gname; + this.size = this.remain; + this.mtime = header.mtime; + this.atime = header.atime; + this.ctime = header.ctime; + this.linkpath = header.linkpath ? normalizeWindowsPath(header.linkpath) : void 0; + this.uname = header.uname; + this.gname = header.gname; + if (ex) { + this.#slurp(ex); } - this[kClients].clear(); - await Promise.all(closePromises); - } - async [kDestroy](err) { - const destroyPromises = []; - for (const client of this[kClients].values()) { - destroyPromises.push(client.destroy(err)); + if (gex) { + this.#slurp(gex, true); } - this[kClients].clear(); - await Promise.all(destroyPromises); - } - }; - module2.exports = Agent; - } -}); - -// .yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/proxy-agent.js -var require_proxy_agent = __commonJS({ - ".yarn/cache/undici-npm-6.25.0-6002e70879-2597cc6689.zip/node_modules/undici/lib/dispatcher/proxy-agent.js"(exports2, module2) { - "use strict"; - var { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); - var { URL: URL2 } = require("node:url"); - var Agent = require_agent(); - var Pool = require_pool(); - var DispatcherBase = require_dispatcher_base(); - var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); - var buildConnector = require_connect(); - var Client = require_client(); - var kAgent = /* @__PURE__ */ Symbol("proxy agent"); - var kClient = /* @__PURE__ */ Symbol("proxy client"); - var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); - var kRequestTls = /* @__PURE__ */ Symbol("request tls settings"); - var kProxyTls = /* @__PURE__ */ Symbol("proxy tls settings"); - var kConnectEndpoint = /* @__PURE__ */ Symbol("connect endpoint function"); - var kTunnelProxy = /* @__PURE__ */ Symbol("tunnel proxy"); - function defaultProtocolPort(protocol) { - return protocol === "https:" ? 443 : 80; - } - function defaultFactory(origin, opts) { - return new Pool(origin, opts); - } - var noop3 = () => { - }; - function defaultAgentFactory(origin, opts) { - if (opts.connections === 1) { - return new Client(origin, opts); } - return new Pool(origin, opts); - } - var Http1ProxyWrapper = class extends DispatcherBase { - #client; - constructor(proxyUrl, { headers = {}, connect, factory }) { - super(); - if (!proxyUrl) { - throw new InvalidArgumentError("Proxy URL is mandatory"); + write(data) { + const writeLen = data.length; + if (writeLen > this.blockRemain) { + throw new Error("writing more to entry than is appropriate"); } - this[kProxyHeaders] = headers; - if (factory) { - this.#client = factory(proxyUrl, { connect }); - } else { - this.#client = new Client(proxyUrl, { connect }); + const r = this.remain; + const br = this.blockRemain; + this.remain = Math.max(0, r - writeLen); + this.blockRemain = Math.max(0, br - writeLen); + if (this.ignore) { + return true; } - } - [kDispatch](opts, handler) { - const onHeaders = handler.onHeaders; - handler.onHeaders = function(statusCode, data, resume) { - if (statusCode === 407) { - if (typeof handler.onError === "function") { - handler.onError(new InvalidArgumentError("Proxy Authentication Required (407)")); - } - return; - } - if (onHeaders) onHeaders.call(this, statusCode, data, resume); - }; - const { - origin, - path: path16 = "/", - headers = {} - } = opts; - opts.path = origin + path16; - if (!("host" in headers) && !("Host" in headers)) { - const { host } = new URL2(origin); - headers.host = host; + if (r >= writeLen) { + return super.write(data); } - opts.headers = { ...this[kProxyHeaders], ...headers }; - return this.#client[kDispatch](opts, handler); - } - async [kClose]() { - return this.#client.close(); + return super.write(data.subarray(0, r)); } - async [kDestroy](err) { - return this.#client.destroy(err); + #slurp(ex, gex = false) { + if (ex.path) + ex.path = normalizeWindowsPath(ex.path); + if (ex.linkpath) + ex.linkpath = normalizeWindowsPath(ex.linkpath); + Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { + return !(v === null || v === void 0 || k === "path" && gex); + }))); } }; - var ProxyAgent2 = class extends DispatcherBase { - constructor(opts) { - super(); - if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) { - throw new InvalidArgumentError("Proxy uri is mandatory"); - } - const { clientFactory = defaultFactory } = opts; - if (typeof clientFactory !== "function") { - throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); - } - const { proxyTunnel = true } = opts; - const url = this.#getUrl(opts); - const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url; - this[kProxy] = { uri: href, protocol }; - this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; - this[kRequestTls] = opts.requestTls; - this[kProxyTls] = opts.proxyTls; - this[kProxyHeaders] = opts.headers || {}; - this[kTunnelProxy] = proxyTunnel; - if (opts.auth && opts.token) { - throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); - } else if (opts.auth) { - this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`; - } else if (opts.token) { - this[kProxyHeaders]["proxy-authorization"] = opts.token; - } else if (username && password) { - this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`; - } - const connect = buildConnector({ ...opts.proxyTls }); - this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); - const agentFactory = opts.factory || defaultAgentFactory; - const factory = (origin2, options) => { - const { protocol: protocol2 } = new URL2(origin2); - if (!this[kTunnelProxy] && protocol2 === "http:" && this[kProxy].protocol === "http:") { - return new Http1ProxyWrapper(this[kProxy].uri, { - headers: this[kProxyHeaders], - connect, - factory: agentFactory - }); - } - return agentFactory(origin2, options); - }; - this[kClient] = clientFactory(url, { connect }); - this[kAgent] = new Agent({ - ...opts, - factory, - connect: async (opts2, callback) => { - let requestedPath = opts2.host; - if (!opts2.port) { - requestedPath += `:${defaultProtocolPort(opts2.protocol)}`; - } - try { - const { socket, statusCode } = await this[kClient].connect({ - origin, - port, - path: requestedPath, - signal: opts2.signal, - headers: { - ...this[kProxyHeaders], - host: opts2.host - }, - servername: this[kProxyTls]?.servername || proxyHostname - }); - if (statusCode !== 200) { - socket.on("error", noop3).destroy(); - callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)); - } - if (opts2.protocol !== "https:") { - callback(null, socket); - return; - } - let servername; - if (this[kRequestTls]) { - servername = this[kRequestTls].servername; - } else { - servername = opts2.servername; - } - this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); - } catch (err) { - if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - callback(new SecureProxyConnectionError(err)); - } else { - callback(err); - } - } - } - }); + } +}); + +// node_modules/tar/dist/esm/warn-method.js +var warnMethod; +var init_warn_method = __esm({ + "node_modules/tar/dist/esm/warn-method.js"() { + warnMethod = (self2, code2, message, data = {}) => { + if (self2.file) { + data.file = self2.file; } - dispatch(opts, handler) { - const headers = buildHeaders(opts.headers); - throwIfProxyAuthIsSent(headers); - if (headers && !("host" in headers) && !("Host" in headers)) { - const { host } = new URL2(opts.origin); - headers.host = host; - } - return this[kAgent].dispatch( - { - ...opts, - headers - }, - handler - ); + if (self2.cwd) { + data.cwd = self2.cwd; } - /** - * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts - * @returns {URL} - */ - #getUrl(opts) { - if (typeof opts === "string") { - return new URL2(opts); - } else if (opts instanceof URL2) { - return opts; - } else { - return new URL2(opts.uri); + data.code = message instanceof Error && message.code || code2; + data.tarCode = code2; + if (!self2.strict && data.recoverable !== false) { + if (message instanceof Error) { + data = Object.assign(message, data); + message = message.message; } - } - async [kClose]() { - await this[kAgent].close(); - await this[kClient].close(); - } - async [kDestroy]() { - await this[kAgent].destroy(); - await this[kClient].destroy(); + self2.emit("warn", code2, message, data); + } else if (message instanceof Error) { + self2.emit("error", Object.assign(message, data)); + } else { + self2.emit("error", Object.assign(new Error(`${code2}: ${message}`), data)); } }; - function buildHeaders(headers) { - if (Array.isArray(headers)) { - const headersPair = {}; - for (let i = 0; i < headers.length; i += 2) { - headersPair[headers[i]] = headers[i + 1]; - } - return headersPair; - } - return headers; - } - function throwIfProxyAuthIsSent(headers) { - const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization"); - if (existProxyAuth) { - throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); - } - } - module2.exports = ProxyAgent2; } }); -// .yarn/cache/minipass-npm-7.1.2-3a5327d36d-b0fd20bb9f.zip/node_modules/minipass/dist/esm/index.js -var import_node_events, import_node_stream, import_node_string_decoder, proc, isStream, isReadable, isWritable, EOF, MAYBE_EMIT_END, EMITTED_END, EMITTING_END, EMITTED_ERROR, CLOSED, READ, FLUSH, FLUSHCHUNK, ENCODING, DECODER, FLOWING, PAUSED, RESUME, BUFFER, PIPES, BUFFERLENGTH, BUFFERPUSH, BUFFERSHIFT, OBJECTMODE, DESTROYED, ERROR, EMITDATA, EMITEND, EMITEND2, ASYNC, ABORT, ABORTED, SIGNAL, DATALISTENERS, DISCARDED, defer, nodefer, isEndish, isArrayBufferLike, isArrayBufferView, Pipe, PipeProxyErrors, isObjectModeOptions, isEncodingOptions, Minipass; -var init_esm = __esm({ - ".yarn/cache/minipass-npm-7.1.2-3a5327d36d-b0fd20bb9f.zip/node_modules/minipass/dist/esm/index.js"() { - import_node_events = require("node:events"); - import_node_stream = __toESM(require("node:stream"), 1); - import_node_string_decoder = require("node:string_decoder"); - proc = typeof process === "object" && process ? process : { - stdout: null, - stderr: null - }; - isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof import_node_stream.default || isReadable(s) || isWritable(s)); - isReadable = (s) => !!s && typeof s === "object" && s instanceof import_node_events.EventEmitter && typeof s.pipe === "function" && // node core Writable streams have a pipe() method, but it throws - s.pipe !== import_node_stream.default.Writable.prototype.pipe; - isWritable = (s) => !!s && typeof s === "object" && s instanceof import_node_events.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; - EOF = /* @__PURE__ */ Symbol("EOF"); - MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"); - EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"); - EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd"); - EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError"); - CLOSED = /* @__PURE__ */ Symbol("closed"); - READ = /* @__PURE__ */ Symbol("read"); - FLUSH = /* @__PURE__ */ Symbol("flush"); - FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk"); - ENCODING = /* @__PURE__ */ Symbol("encoding"); - DECODER = /* @__PURE__ */ Symbol("decoder"); - FLOWING = /* @__PURE__ */ Symbol("flowing"); - PAUSED = /* @__PURE__ */ Symbol("paused"); - RESUME = /* @__PURE__ */ Symbol("resume"); - BUFFER = /* @__PURE__ */ Symbol("buffer"); - PIPES = /* @__PURE__ */ Symbol("pipes"); - BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength"); - BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush"); - BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift"); - OBJECTMODE = /* @__PURE__ */ Symbol("objectMode"); - DESTROYED = /* @__PURE__ */ Symbol("destroyed"); - ERROR = /* @__PURE__ */ Symbol("error"); - EMITDATA = /* @__PURE__ */ Symbol("emitData"); - EMITEND = /* @__PURE__ */ Symbol("emitEnd"); - EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2"); - ASYNC = /* @__PURE__ */ Symbol("async"); - ABORT = /* @__PURE__ */ Symbol("abort"); - ABORTED = /* @__PURE__ */ Symbol("aborted"); - SIGNAL = /* @__PURE__ */ Symbol("signal"); - DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners"); - DISCARDED = /* @__PURE__ */ Symbol("discarded"); - defer = (fn2) => Promise.resolve().then(fn2); - nodefer = (fn2) => fn2(); - isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; - isArrayBufferLike = (b) => b instanceof ArrayBuffer || !!b && typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; - isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); - Pipe = class { - src; - dest; - opts; - ondrain; - constructor(src, dest, opts) { - this.src = src; - this.dest = dest; - this.opts = opts; - this.ondrain = () => src[RESUME](); - this.dest.on("drain", this.ondrain); - } - unpipe() { - this.dest.removeListener("drain", this.ondrain); - } - // only here for the prototype - /* c8 ignore start */ - proxyErrors(_er) { - } - /* c8 ignore stop */ - end() { - this.unpipe(); - if (this.opts.end) - this.dest.end(); - } - }; - PipeProxyErrors = class extends Pipe { - unpipe() { - this.src.removeListener("error", this.proxyErrors); - super.unpipe(); - } - constructor(src, dest, opts) { - super(src, dest, opts); - this.proxyErrors = (er) => dest.emit("error", er); - src.on("error", this.proxyErrors); - } - }; - isObjectModeOptions = (o) => !!o.objectMode; - isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== "buffer"; - Minipass = class extends import_node_events.EventEmitter { - [FLOWING] = false; - [PAUSED] = false; - [PIPES] = []; - [BUFFER] = []; - [OBJECTMODE]; - [ENCODING]; - [ASYNC]; - [DECODER]; - [EOF] = false; - [EMITTED_END] = false; - [EMITTING_END] = false; - [CLOSED] = false; - [EMITTED_ERROR] = null; - [BUFFERLENGTH] = 0; - [DESTROYED] = false; - [SIGNAL]; - [ABORTED] = false; - [DATALISTENERS] = 0; - [DISCARDED] = false; - /** - * true if the stream can be written - */ +// node_modules/tar/dist/esm/parse.js +var import_events3, maxMetaEntrySize, gzipHeader, zstdHeader, ZIP_HEADER_LEN, STATE, WRITEENTRY, READENTRY, NEXTENTRY, PROCESSENTRY, EX, GEX, META, EMITMETA, BUFFER2, QUEUE, ENDED, EMITTEDEND, EMIT, UNZIP, CONSUMECHUNK, CONSUMECHUNKSUB, CONSUMEBODY, CONSUMEMETA, CONSUMEHEADER, CONSUMING, BUFFERCONCAT, MAYBEEND, WRITING, ABORTED2, DONE, SAW_VALID_ENTRY, SAW_NULL_BLOCK, SAW_EOF, CLOSESTREAM, noop2, Parser; +var init_parse = __esm({ + "node_modules/tar/dist/esm/parse.js"() { + import_events3 = require("events"); + init_esm3(); + init_header(); + init_pax(); + init_read_entry(); + init_warn_method(); + maxMetaEntrySize = 1024 * 1024; + gzipHeader = Buffer.from([31, 139]); + zstdHeader = Buffer.from([40, 181, 47, 253]); + ZIP_HEADER_LEN = Math.max(gzipHeader.length, zstdHeader.length); + STATE = /* @__PURE__ */ Symbol("state"); + WRITEENTRY = /* @__PURE__ */ Symbol("writeEntry"); + READENTRY = /* @__PURE__ */ Symbol("readEntry"); + NEXTENTRY = /* @__PURE__ */ Symbol("nextEntry"); + PROCESSENTRY = /* @__PURE__ */ Symbol("processEntry"); + EX = /* @__PURE__ */ Symbol("extendedHeader"); + GEX = /* @__PURE__ */ Symbol("globalExtendedHeader"); + META = /* @__PURE__ */ Symbol("meta"); + EMITMETA = /* @__PURE__ */ Symbol("emitMeta"); + BUFFER2 = /* @__PURE__ */ Symbol("buffer"); + QUEUE = /* @__PURE__ */ Symbol("queue"); + ENDED = /* @__PURE__ */ Symbol("ended"); + EMITTEDEND = /* @__PURE__ */ Symbol("emittedEnd"); + EMIT = /* @__PURE__ */ Symbol("emit"); + UNZIP = /* @__PURE__ */ Symbol("unzip"); + CONSUMECHUNK = /* @__PURE__ */ Symbol("consumeChunk"); + CONSUMECHUNKSUB = /* @__PURE__ */ Symbol("consumeChunkSub"); + CONSUMEBODY = /* @__PURE__ */ Symbol("consumeBody"); + CONSUMEMETA = /* @__PURE__ */ Symbol("consumeMeta"); + CONSUMEHEADER = /* @__PURE__ */ Symbol("consumeHeader"); + CONSUMING = /* @__PURE__ */ Symbol("consuming"); + BUFFERCONCAT = /* @__PURE__ */ Symbol("bufferConcat"); + MAYBEEND = /* @__PURE__ */ Symbol("maybeEnd"); + WRITING = /* @__PURE__ */ Symbol("writing"); + ABORTED2 = /* @__PURE__ */ Symbol("aborted"); + DONE = /* @__PURE__ */ Symbol("onDone"); + SAW_VALID_ENTRY = /* @__PURE__ */ Symbol("sawValidEntry"); + SAW_NULL_BLOCK = /* @__PURE__ */ Symbol("sawNullBlock"); + SAW_EOF = /* @__PURE__ */ Symbol("sawEOF"); + CLOSESTREAM = /* @__PURE__ */ Symbol("closeStream"); + noop2 = () => true; + Parser = class extends import_events3.EventEmitter { + file; + strict; + maxMetaEntrySize; + filter; + brotli; + zstd; writable = true; - /** - * true if the stream can be read - */ - readable = true; - /** - * If `RType` is Buffer, then options do not need to be provided. - * Otherwise, an options object must be provided to specify either - * {@link Minipass.SharedOptions.objectMode} or - * {@link Minipass.SharedOptions.encoding}, as appropriate. - */ - constructor(...args) { - const options = args[0] || {}; + readable = false; + [QUEUE] = []; + [BUFFER2]; + [READENTRY]; + [WRITEENTRY]; + [STATE] = "begin"; + [META] = ""; + [EX]; + [GEX]; + [ENDED] = false; + [UNZIP]; + [ABORTED2] = false; + [SAW_VALID_ENTRY]; + [SAW_NULL_BLOCK] = false; + [SAW_EOF] = false; + [WRITING] = false; + [CONSUMING] = false; + [EMITTEDEND] = false; + constructor(opt = {}) { super(); - if (options.objectMode && typeof options.encoding === "string") { - throw new TypeError("Encoding and objectMode may not be used together"); - } - if (isObjectModeOptions(options)) { - this[OBJECTMODE] = true; - this[ENCODING] = null; - } else if (isEncodingOptions(options)) { - this[ENCODING] = options.encoding; - this[OBJECTMODE] = false; + this.file = opt.file || ""; + this.on(DONE, () => { + if (this[STATE] === "begin" || this[SAW_VALID_ENTRY] === false) { + this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format"); + } + }); + if (opt.ondone) { + this.on(DONE, opt.ondone); } else { - this[OBJECTMODE] = false; - this[ENCODING] = null; - } - this[ASYNC] = !!options.async; - this[DECODER] = this[ENCODING] ? new import_node_string_decoder.StringDecoder(this[ENCODING]) : null; - if (options && options.debugExposeBuffer === true) { - Object.defineProperty(this, "buffer", { get: () => this[BUFFER] }); + this.on(DONE, () => { + this.emit("prefinish"); + this.emit("finish"); + this.emit("end"); + }); } - if (options && options.debugExposePipes === true) { - Object.defineProperty(this, "pipes", { get: () => this[PIPES] }); + this.strict = !!opt.strict; + this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize; + this.filter = typeof opt.filter === "function" ? opt.filter : noop2; + const isTBR = opt.file && (opt.file.endsWith(".tar.br") || opt.file.endsWith(".tbr")); + this.brotli = !(opt.gzip || opt.zstd) && opt.brotli !== void 0 ? opt.brotli : isTBR ? void 0 : false; + const isTZST = opt.file && (opt.file.endsWith(".tar.zst") || opt.file.endsWith(".tzst")); + this.zstd = !(opt.gzip || opt.brotli) && opt.zstd !== void 0 ? opt.zstd : isTZST ? true : void 0; + this.on("end", () => this[CLOSESTREAM]()); + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); } - const { signal } = options; - if (signal) { - this[SIGNAL] = signal; - if (signal.aborted) { - this[ABORT](); - } else { - signal.addEventListener("abort", () => this[ABORT]()); - } + if (typeof opt.onReadEntry === "function") { + this.on("entry", opt.onReadEntry); } } - /** - * The amount of data stored in the buffer waiting to be read. - * - * For Buffer strings, this will be the total byte length. - * For string encoding streams, this will be the string character length, - * according to JavaScript's `string.length` logic. - * For objectMode streams, this is a count of the items waiting to be - * emitted. - */ - get bufferLength() { - return this[BUFFERLENGTH]; - } - /** - * The `BufferEncoding` currently in use, or `null` - */ - get encoding() { - return this[ENCODING]; - } - /** - * @deprecated - This is a read only property - */ - set encoding(_enc) { - throw new Error("Encoding must be set at instantiation time"); - } - /** - * @deprecated - Encoding may only be set at instantiation time - */ - setEncoding(_enc) { - throw new Error("Encoding must be set at instantiation time"); + warn(code2, message, data = {}) { + warnMethod(this, code2, message, data); } - /** - * True if this is an objectMode stream - */ - get objectMode() { - return this[OBJECTMODE]; + [CONSUMEHEADER](chunk, position) { + if (this[SAW_VALID_ENTRY] === void 0) { + this[SAW_VALID_ENTRY] = false; + } + let header; + try { + header = new Header(chunk, position, this[EX], this[GEX]); + } catch (er) { + return this.warn("TAR_ENTRY_INVALID", er); + } + if (header.nullBlock) { + if (this[SAW_NULL_BLOCK]) { + this[SAW_EOF] = true; + if (this[STATE] === "begin") { + this[STATE] = "header"; + } + this[EMIT]("eof"); + } else { + this[SAW_NULL_BLOCK] = true; + this[EMIT]("nullBlock"); + } + } else { + this[SAW_NULL_BLOCK] = false; + if (!header.cksumValid) { + this.warn("TAR_ENTRY_INVALID", "checksum failure", { header }); + } else if (!header.path) { + this.warn("TAR_ENTRY_INVALID", "path is required", { header }); + } else { + const type = header.type; + if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) { + this.warn("TAR_ENTRY_INVALID", "linkpath required", { + header + }); + } else if (!/^(Symbolic)?Link$/.test(type) && !/^(Global)?ExtendedHeader$/.test(type) && header.linkpath) { + this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { + header + }); + } else { + const entry = this[WRITEENTRY] = new ReadEntry(header, this[EX], this[GEX]); + if (!this[SAW_VALID_ENTRY]) { + if (entry.remain) { + const onend = () => { + if (!entry.invalid) { + this[SAW_VALID_ENTRY] = true; + } + }; + entry.on("end", onend); + } else { + this[SAW_VALID_ENTRY] = true; + } + } + if (entry.meta) { + if (entry.size > this.maxMetaEntrySize) { + entry.ignore = true; + this[EMIT]("ignoredEntry", entry); + this[STATE] = "ignore"; + entry.resume(); + } else if (entry.size > 0) { + this[META] = ""; + entry.on("data", (c) => this[META] += c); + this[STATE] = "meta"; + } + } else { + this[EX] = void 0; + entry.ignore = entry.ignore || !this.filter(entry.path, entry); + if (entry.ignore) { + this[EMIT]("ignoredEntry", entry); + this[STATE] = entry.remain ? "ignore" : "header"; + entry.resume(); + } else { + if (entry.remain) { + this[STATE] = "body"; + } else { + this[STATE] = "header"; + entry.end(); + } + if (!this[READENTRY]) { + this[QUEUE].push(entry); + this[NEXTENTRY](); + } else { + this[QUEUE].push(entry); + } + } + } + } + } + } } - /** - * @deprecated - This is a read-only property - */ - set objectMode(_om) { - throw new Error("objectMode must be set at instantiation time"); + [CLOSESTREAM]() { + queueMicrotask(() => this.emit("close")); } - /** - * true if this is an async stream - */ - get ["async"]() { - return this[ASYNC]; + [PROCESSENTRY](entry) { + let go = true; + if (!entry) { + this[READENTRY] = void 0; + go = false; + } else if (Array.isArray(entry)) { + const [ev, ...args] = entry; + this.emit(ev, ...args); + } else { + this[READENTRY] = entry; + this.emit("entry", entry); + if (!entry.emittedEnd) { + entry.on("end", () => this[NEXTENTRY]()); + go = false; + } + } + return go; } - /** - * Set to true to make this stream async. - * - * Once set, it cannot be unset, as this would potentially cause incorrect - * behavior. Ie, a sync stream can be made async, but an async stream - * cannot be safely made sync. - */ - set ["async"](a) { - this[ASYNC] = this[ASYNC] || !!a; + [NEXTENTRY]() { + do { + } while (this[PROCESSENTRY](this[QUEUE].shift())); + if (this[QUEUE].length === 0) { + const re = this[READENTRY]; + const drainNow = !re || re.flowing || re.size === re.remain; + if (drainNow) { + if (!this[WRITING]) { + this.emit("drain"); + } + } else { + re.once("drain", () => this.emit("drain")); + } + } } - // drop everything and get out of the flow completely - [ABORT]() { - this[ABORTED] = true; - this.emit("abort", this[SIGNAL]?.reason); - this.destroy(this[SIGNAL]?.reason); + [CONSUMEBODY](chunk, position) { + const entry = this[WRITEENTRY]; + if (!entry) { + throw new Error("attempt to consume body without entry??"); + } + const br = entry.blockRemain ?? 0; + const c = br >= chunk.length && position === 0 ? chunk : chunk.subarray(position, position + br); + entry.write(c); + if (!entry.blockRemain) { + this[STATE] = "header"; + this[WRITEENTRY] = void 0; + entry.end(); + } + return c.length; } - /** - * True if the stream has been aborted. - */ - get aborted() { - return this[ABORTED]; + [CONSUMEMETA](chunk, position) { + const entry = this[WRITEENTRY]; + const ret = this[CONSUMEBODY](chunk, position); + if (!this[WRITEENTRY] && entry) { + this[EMITMETA](entry); + } + return ret; } - /** - * No-op setter. Stream aborted status is set via the AbortSignal provided - * in the constructor options. - */ - set aborted(_) { + [EMIT](ev, data, extra) { + if (this[QUEUE].length === 0 && !this[READENTRY]) { + this.emit(ev, data, extra); + } else { + this[QUEUE].push([ev, data, extra]); + } } - write(chunk, encoding, cb) { - if (this[ABORTED]) - return false; - if (this[EOF]) - throw new Error("write after end"); - if (this[DESTROYED]) { - this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })); - return true; + [EMITMETA](entry) { + this[EMIT]("meta", this[META]); + switch (entry.type) { + case "ExtendedHeader": + case "OldExtendedHeader": + this[EX] = Pax.parse(this[META], this[EX], false); + break; + case "GlobalExtendedHeader": + this[GEX] = Pax.parse(this[META], this[GEX], true); + break; + case "NextFileHasLongPath": + case "OldGnuLongPath": { + const ex = this[EX] ?? /* @__PURE__ */ Object.create(null); + this[EX] = ex; + ex.path = this[META].replace(/\0.*/, ""); + break; + } + case "NextFileHasLongLinkpath": { + const ex = this[EX] || /* @__PURE__ */ Object.create(null); + this[EX] = ex; + ex.linkpath = this[META].replace(/\0.*/, ""); + break; + } + /* c8 ignore start */ + default: + throw new Error("unknown meta: " + entry.type); } + } + abort(error) { + this[ABORTED2] = true; + this.emit("abort", error); + this.warn("TAR_ABORT", error, { recoverable: false }); + } + write(chunk, encoding, cb) { if (typeof encoding === "function") { cb = encoding; - encoding = "utf8"; + encoding = void 0; } - if (!encoding) - encoding = "utf8"; - const fn2 = this[ASYNC] ? defer : nodefer; - if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { - if (isArrayBufferView(chunk)) { - chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); - } else if (isArrayBufferLike(chunk)) { - chunk = Buffer.from(chunk); - } else if (typeof chunk !== "string") { - throw new Error("Non-contiguous data written to non-objectMode stream"); - } + if (typeof chunk === "string") { + chunk = Buffer.from( + chunk, + /* c8 ignore next */ + typeof encoding === "string" ? encoding : "utf8" + ); } - if (this[OBJECTMODE]) { - if (this[FLOWING] && this[BUFFERLENGTH] !== 0) - this[FLUSH](true); - if (this[FLOWING]) - this.emit("data", chunk); - else - this[BUFFERPUSH](chunk); - if (this[BUFFERLENGTH] !== 0) - this.emit("readable"); - if (cb) - fn2(cb); - return this[FLOWING]; + if (this[ABORTED2]) { + cb?.(); + return false; } - if (!chunk.length) { - if (this[BUFFERLENGTH] !== 0) - this.emit("readable"); - if (cb) - fn2(cb); - return this[FLOWING]; + const needSniff = this[UNZIP] === void 0 || this.brotli === void 0 && this[UNZIP] === false; + if (needSniff && chunk) { + if (this[BUFFER2]) { + chunk = Buffer.concat([this[BUFFER2], chunk]); + this[BUFFER2] = void 0; + } + if (chunk.length < ZIP_HEADER_LEN) { + this[BUFFER2] = chunk; + cb?.(); + return true; + } + for (let i = 0; this[UNZIP] === void 0 && i < gzipHeader.length; i++) { + if (chunk[i] !== gzipHeader[i]) { + this[UNZIP] = false; + } + } + let isZstd = false; + if (this[UNZIP] === false && this.zstd !== false) { + isZstd = true; + for (let i = 0; i < zstdHeader.length; i++) { + if (chunk[i] !== zstdHeader[i]) { + isZstd = false; + break; + } + } + } + const maybeBrotli = this.brotli === void 0 && !isZstd; + if (this[UNZIP] === false && maybeBrotli) { + if (chunk.length < 512) { + if (this[ENDED]) { + this.brotli = true; + } else { + this[BUFFER2] = chunk; + cb?.(); + return true; + } + } else { + try { + new Header(chunk.subarray(0, 512)); + this.brotli = false; + } catch (_) { + this.brotli = true; + } + } + } + if (this[UNZIP] === void 0 || this[UNZIP] === false && (this.brotli || isZstd)) { + const ended = this[ENDED]; + this[ENDED] = false; + this[UNZIP] = this[UNZIP] === void 0 ? new Unzip({}) : isZstd ? new ZstdDecompress({}) : new BrotliDecompress({}); + this[UNZIP].on("data", (chunk2) => this[CONSUMECHUNK](chunk2)); + this[UNZIP].on("error", (er) => this.abort(er)); + this[UNZIP].on("end", () => { + this[ENDED] = true; + this[CONSUMECHUNK](); + }); + this[WRITING] = true; + const ret2 = !!this[UNZIP][ended ? "end" : "write"](chunk); + this[WRITING] = false; + cb?.(); + return ret2; + } } - if (typeof chunk === "string" && // unless it is a string already ready for us to use - !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) { - chunk = Buffer.from(chunk, encoding); + this[WRITING] = true; + if (this[UNZIP]) { + this[UNZIP].write(chunk); + } else { + this[CONSUMECHUNK](chunk); } - if (Buffer.isBuffer(chunk) && this[ENCODING]) { - chunk = this[DECODER].write(chunk); + this[WRITING] = false; + const ret = this[QUEUE].length > 0 ? false : this[READENTRY] ? this[READENTRY].flowing : true; + if (!ret && this[QUEUE].length === 0) { + this[READENTRY]?.once("drain", () => this.emit("drain")); } - if (this[FLOWING] && this[BUFFERLENGTH] !== 0) - this[FLUSH](true); - if (this[FLOWING]) - this.emit("data", chunk); - else - this[BUFFERPUSH](chunk); - if (this[BUFFERLENGTH] !== 0) - this.emit("readable"); - if (cb) - fn2(cb); - return this[FLOWING]; + cb?.(); + return ret; } - /** - * Low-level explicit read method. - * - * In objectMode, the argument is ignored, and one item is returned if - * available. - * - * `n` is the number of bytes (or in the case of encoding streams, - * characters) to consume. If `n` is not provided, then the entire buffer - * is returned, or `null` is returned if no data is available. - * - * If `n` is greater that the amount of data in the internal buffer, - * then `null` is returned. - */ - read(n) { - if (this[DESTROYED]) - return null; - this[DISCARDED] = false; - if (this[BUFFERLENGTH] === 0 || n === 0 || n && n > this[BUFFERLENGTH]) { - this[MAYBE_EMIT_END](); - return null; + [BUFFERCONCAT](c) { + if (c && !this[ABORTED2]) { + this[BUFFER2] = this[BUFFER2] ? Buffer.concat([this[BUFFER2], c]) : c; } - if (this[OBJECTMODE]) - n = null; - if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { - this[BUFFER] = [ - this[ENCODING] ? this[BUFFER].join("") : Buffer.concat(this[BUFFER], this[BUFFERLENGTH]) - ]; + } + [MAYBEEND]() { + if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED2] && !this[CONSUMING]) { + this[EMITTEDEND] = true; + const entry = this[WRITEENTRY]; + if (entry && entry.blockRemain) { + const have = this[BUFFER2] ? this[BUFFER2].length : 0; + this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${entry.blockRemain} more bytes, only ${have} available)`, { entry }); + if (this[BUFFER2]) { + entry.write(this[BUFFER2]); + } + entry.end(); + } + this[EMIT](DONE); } - const ret = this[READ](n || null, this[BUFFER][0]); - this[MAYBE_EMIT_END](); - return ret; } - [READ](n, chunk) { - if (this[OBJECTMODE]) - this[BUFFERSHIFT](); - else { - const c = chunk; - if (n === c.length || n === null) - this[BUFFERSHIFT](); - else if (typeof c === "string") { - this[BUFFER][0] = c.slice(n); - chunk = c.slice(0, n); - this[BUFFERLENGTH] -= n; + [CONSUMECHUNK](chunk) { + if (this[CONSUMING] && chunk) { + this[BUFFERCONCAT](chunk); + } else if (!chunk && !this[BUFFER2]) { + this[MAYBEEND](); + } else if (chunk) { + this[CONSUMING] = true; + if (this[BUFFER2]) { + this[BUFFERCONCAT](chunk); + const c = this[BUFFER2]; + this[BUFFER2] = void 0; + this[CONSUMECHUNKSUB](c); } else { - this[BUFFER][0] = c.subarray(n); - chunk = c.subarray(0, n); - this[BUFFERLENGTH] -= n; + this[CONSUMECHUNKSUB](chunk); + } + while (this[BUFFER2] && this[BUFFER2]?.length >= 512 && !this[ABORTED2] && !this[SAW_EOF]) { + const c = this[BUFFER2]; + this[BUFFER2] = void 0; + this[CONSUMECHUNKSUB](c); } + this[CONSUMING] = false; + } + if (!this[BUFFER2] || this[ENDED]) { + this[MAYBEEND](); + } + } + [CONSUMECHUNKSUB](chunk) { + let position = 0; + const length = chunk.length; + while (position + 512 <= length && !this[ABORTED2] && !this[SAW_EOF]) { + switch (this[STATE]) { + case "begin": + case "header": + this[CONSUMEHEADER](chunk, position); + position += 512; + break; + case "ignore": + case "body": + position += this[CONSUMEBODY](chunk, position); + break; + case "meta": + position += this[CONSUMEMETA](chunk, position); + break; + /* c8 ignore start */ + default: + throw new Error("invalid state: " + this[STATE]); + } + } + if (position < length) { + this[BUFFER2] = this[BUFFER2] ? Buffer.concat([chunk.subarray(position), this[BUFFER2]]) : chunk.subarray(position); } - this.emit("data", chunk); - if (!this[BUFFER].length && !this[EOF]) - this.emit("drain"); - return chunk; } end(chunk, encoding, cb) { if (typeof chunk === "function") { cb = chunk; + encoding = void 0; chunk = void 0; } if (typeof encoding === "function") { cb = encoding; - encoding = "utf8"; + encoding = void 0; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); } - if (chunk !== void 0) - this.write(chunk, encoding); if (cb) - this.once("end", cb); - this[EOF] = true; - this.writable = false; - if (this[FLOWING] || !this[PAUSED]) - this[MAYBE_EMIT_END](); - return this; - } - // don't let the internal resume be overwritten - [RESUME]() { - if (this[DESTROYED]) - return; - if (!this[DATALISTENERS] && !this[PIPES].length) { - this[DISCARDED] = true; + this.once("finish", cb); + if (!this[ABORTED2]) { + if (this[UNZIP]) { + if (chunk) + this[UNZIP].write(chunk); + this[UNZIP].end(); + } else { + this[ENDED] = true; + if (this.brotli === void 0 || this.zstd === void 0) + chunk = chunk || Buffer.alloc(0); + if (chunk) + this.write(chunk); + this[MAYBEEND](); + } } - this[PAUSED] = false; - this[FLOWING] = true; - this.emit("resume"); - if (this[BUFFER].length) - this[FLUSH](); - else if (this[EOF]) - this[MAYBE_EMIT_END](); - else - this.emit("drain"); + return this; } - /** - * Resume the stream if it is currently in a paused state - * - * If called when there are no pipe destinations or `data` event listeners, - * this will place the stream in a "discarded" state, where all data will - * be thrown away. The discarded state is removed if a pipe destination or - * data handler is added, if pause() is called, or if any synchronous or - * asynchronous iteration is started. - */ - resume() { - return this[RESUME](); - } - /** - * Pause the stream - */ - pause() { - this[FLOWING] = false; - this[PAUSED] = true; - this[DISCARDED] = false; - } - /** - * true if the stream has been forcibly destroyed - */ - get destroyed() { - return this[DESTROYED]; - } - /** - * true if the stream is currently in a flowing state, meaning that - * any writes will be immediately emitted. - */ - get flowing() { - return this[FLOWING]; - } - /** - * true if the stream is currently in a paused state - */ - get paused() { - return this[PAUSED]; - } - [BUFFERPUSH](chunk) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] += 1; - else - this[BUFFERLENGTH] += chunk.length; - this[BUFFER].push(chunk); - } - [BUFFERSHIFT]() { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] -= 1; - else - this[BUFFERLENGTH] -= this[BUFFER][0].length; - return this[BUFFER].shift(); - } - [FLUSH](noDrain = false) { - do { - } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length); - if (!noDrain && !this[BUFFER].length && !this[EOF]) - this.emit("drain"); - } - [FLUSHCHUNK](chunk) { - this.emit("data", chunk); - return this[FLOWING]; - } - /** - * Pipe all data emitted by this stream into the destination provided. - * - * Triggers the flow of data. - */ - pipe(dest, opts) { - if (this[DESTROYED]) - return dest; - this[DISCARDED] = false; - const ended = this[EMITTED_END]; - opts = opts || {}; - if (dest === proc.stdout || dest === proc.stderr) - opts.end = false; - else - opts.end = opts.end !== false; - opts.proxyErrors = !!opts.proxyErrors; - if (ended) { - if (opts.end) - dest.end(); - } else { - this[PIPES].push(!opts.proxyErrors ? new Pipe(this, dest, opts) : new PipeProxyErrors(this, dest, opts)); - if (this[ASYNC]) - defer(() => this[RESUME]()); - else - this[RESUME](); - } - return dest; + }; + } +}); + +// node_modules/tar/dist/esm/strip-trailing-slashes.js +var stripTrailingSlashes; +var init_strip_trailing_slashes = __esm({ + "node_modules/tar/dist/esm/strip-trailing-slashes.js"() { + stripTrailingSlashes = (str) => { + let i = str.length - 1; + let slashesStart = -1; + while (i > -1 && str.charAt(i) === "/") { + slashesStart = i; + i--; } - /** - * Fully unhook a piped destination stream. - * - * If the destination stream was the only consumer of this stream (ie, - * there are no other piped destinations or `'data'` event listeners) - * then the flow of data will stop until there is another consumer or - * {@link Minipass#resume} is explicitly called. - */ - unpipe(dest) { - const p = this[PIPES].find((p2) => p2.dest === dest); - if (p) { - if (this[PIPES].length === 1) { - if (this[FLOWING] && this[DATALISTENERS] === 0) { - this[FLOWING] = false; - } - this[PIPES] = []; - } else - this[PIPES].splice(this[PIPES].indexOf(p), 1); - p.unpipe(); + return slashesStart === -1 ? str : str.slice(0, slashesStart); + }; + } +}); + +// node_modules/tar/dist/esm/list.js +var list_exports = {}; +__export(list_exports, { + filesFilter: () => filesFilter, + list: () => list +}); +var import_node_fs, import_path2, onReadEntryFunction, filesFilter, listFileSync, listFile, list; +var init_list = __esm({ + "node_modules/tar/dist/esm/list.js"() { + init_esm2(); + import_node_fs = __toESM(require("node:fs"), 1); + import_path2 = require("path"); + init_make_command(); + init_parse(); + init_strip_trailing_slashes(); + onReadEntryFunction = (opt) => { + const onReadEntry = opt.onReadEntry; + opt.onReadEntry = onReadEntry ? (e) => { + onReadEntry(e); + e.resume(); + } : (e) => e.resume(); + }; + filesFilter = (opt, files) => { + const map = new Map(files.map((f) => [stripTrailingSlashes(f), true])); + const filter = opt.filter; + const mapHas = (file, r = "") => { + const root = r || (0, import_path2.parse)(file).root || "."; + let ret; + if (file === root) + ret = false; + else { + const m = map.get(file); + ret = m !== void 0 ? m : mapHas((0, import_path2.dirname)(file), root); } - } - /** - * Alias for {@link Minipass#on} - */ - addListener(ev, handler) { - return this.on(ev, handler); - } - /** - * Mostly identical to `EventEmitter.on`, with the following - * behavior differences to prevent data loss and unnecessary hangs: - * - * - Adding a 'data' event handler will trigger the flow of data - * - * - Adding a 'readable' event handler when there is data waiting to be read - * will cause 'readable' to be emitted immediately. - * - * - Adding an 'endish' event handler ('end', 'finish', etc.) which has - * already passed will cause the event to be emitted immediately and all - * handlers removed. - * - * - Adding an 'error' event handler after an error has been emitted will - * cause the event to be re-emitted immediately with the error previously - * raised. - */ - on(ev, handler) { - const ret = super.on(ev, handler); - if (ev === "data") { - this[DISCARDED] = false; - this[DATALISTENERS]++; - if (!this[PIPES].length && !this[FLOWING]) { - this[RESUME](); + map.set(file, ret); + return ret; + }; + opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(stripTrailingSlashes(file)) : (file) => mapHas(stripTrailingSlashes(file)); + }; + listFileSync = (opt) => { + const p = new Parser(opt); + const file = opt.file; + let fd; + try { + fd = import_node_fs.default.openSync(file, "r"); + const stat = import_node_fs.default.fstatSync(fd); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + if (stat.size < readSize) { + const buf = Buffer.allocUnsafe(stat.size); + const read = import_node_fs.default.readSync(fd, buf, 0, stat.size, 0); + p.end(read === buf.byteLength ? buf : buf.subarray(0, read)); + } else { + let pos2 = 0; + const buf = Buffer.allocUnsafe(readSize); + while (pos2 < stat.size) { + const bytesRead = import_node_fs.default.readSync(fd, buf, 0, readSize, pos2); + if (bytesRead === 0) + break; + pos2 += bytesRead; + p.write(buf.subarray(0, bytesRead)); } - } else if (ev === "readable" && this[BUFFERLENGTH] !== 0) { - super.emit("readable"); - } else if (isEndish(ev) && this[EMITTED_END]) { - super.emit(ev); - this.removeAllListeners(ev); - } else if (ev === "error" && this[EMITTED_ERROR]) { - const h = handler; - if (this[ASYNC]) - defer(() => h.call(this, this[EMITTED_ERROR])); - else - h.call(this, this[EMITTED_ERROR]); + p.end(); } - return ret; - } - /** - * Alias for {@link Minipass#off} - */ - removeListener(ev, handler) { - return this.off(ev, handler); - } - /** - * Mostly identical to `EventEmitter.off` - * - * If a 'data' event handler is removed, and it was the last consumer - * (ie, there are no pipe destinations or other 'data' event listeners), - * then the flow of data will stop until there is another consumer or - * {@link Minipass#resume} is explicitly called. - */ - off(ev, handler) { - const ret = super.off(ev, handler); - if (ev === "data") { - this[DATALISTENERS] = this.listeners("data").length; - if (this[DATALISTENERS] === 0 && !this[DISCARDED] && !this[PIPES].length) { - this[FLOWING] = false; + } finally { + if (typeof fd === "number") { + try { + import_node_fs.default.closeSync(fd); + } catch { } } - return ret; } - /** - * Mostly identical to `EventEmitter.removeAllListeners` - * - * If all 'data' event handlers are removed, and they were the last consumer - * (ie, there are no pipe destinations), then the flow of data will stop - * until there is another consumer or {@link Minipass#resume} is explicitly - * called. - */ - removeAllListeners(ev) { - const ret = super.removeAllListeners(ev); - if (ev === "data" || ev === void 0) { - this[DATALISTENERS] = 0; - if (!this[DISCARDED] && !this[PIPES].length) { - this[FLOWING] = false; + }; + listFile = (opt, _files) => { + const parse4 = new Parser(opt); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const file = opt.file; + const p = new Promise((resolve, reject) => { + parse4.on("error", reject); + parse4.on("end", resolve); + import_node_fs.default.stat(file, (er, stat) => { + if (er) { + reject(er); + } else { + const stream = new ReadStream(file, { + readSize, + size: stat.size + }); + stream.on("error", reject); + stream.pipe(parse4); } - } - return ret; + }); + }); + return p; + }; + list = makeCommand(listFileSync, listFile, (opt) => new Parser(opt), (opt) => new Parser(opt), (opt, files) => { + if (files?.length) + filesFilter(opt, files); + if (!opt.noResume) + onReadEntryFunction(opt); + }); + } +}); + +// node_modules/tar/dist/esm/get-write-flag.js +var import_fs3, platform2, isWindows, O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP, fMapEnabled, fMapLimit, fMapFlag, noFollowFlag, getWriteFlag; +var init_get_write_flag = __esm({ + "node_modules/tar/dist/esm/get-write-flag.js"() { + import_fs3 = __toESM(require("fs"), 1); + platform2 = process.env.__FAKE_PLATFORM__ || process.platform; + isWindows = platform2 === "win32"; + ({ O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY } = import_fs3.default.constants); + UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) || import_fs3.default.constants.UV_FS_O_FILEMAP || 0; + fMapEnabled = isWindows && !!UV_FS_O_FILEMAP; + fMapLimit = 512 * 1024; + fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY; + noFollowFlag = !isWindows && typeof O_NOFOLLOW === "number" ? O_NOFOLLOW | O_TRUNC | O_CREAT | O_WRONLY : null; + getWriteFlag = noFollowFlag !== null ? () => noFollowFlag : !fMapEnabled ? () => "w" : (size) => size < fMapLimit ? fMapFlag : "w"; + } +}); + +// node_modules/chownr/dist/esm/index.js +var import_node_fs2, import_node_path3, lchownSync, chown, chownrKid, chownr, chownrKidSync, chownrSync; +var init_esm4 = __esm({ + "node_modules/chownr/dist/esm/index.js"() { + import_node_fs2 = __toESM(require("node:fs"), 1); + import_node_path3 = __toESM(require("node:path"), 1); + lchownSync = (path16, uid, gid) => { + try { + return import_node_fs2.default.lchownSync(path16, uid, gid); + } catch (er) { + if (er?.code !== "ENOENT") + throw er; } - /** - * true if the 'end' event has been emitted - */ - get emittedEnd() { - return this[EMITTED_END]; + }; + chown = (cpath, uid, gid, cb) => { + import_node_fs2.default.lchown(cpath, uid, gid, (er) => { + cb(er && er?.code !== "ENOENT" ? er : null); + }); + }; + chownrKid = (p, child, uid, gid, cb) => { + if (child.isDirectory()) { + chownr(import_node_path3.default.resolve(p, child.name), uid, gid, (er) => { + if (er) + return cb(er); + const cpath = import_node_path3.default.resolve(p, child.name); + chown(cpath, uid, gid, cb); + }); + } else { + const cpath = import_node_path3.default.resolve(p, child.name); + chown(cpath, uid, gid, cb); } - [MAYBE_EMIT_END]() { - if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this[BUFFER].length === 0 && this[EOF]) { - this[EMITTING_END] = true; - this.emit("end"); - this.emit("prefinish"); - this.emit("finish"); - if (this[CLOSED]) - this.emit("close"); - this[EMITTING_END] = false; + }; + chownr = (p, uid, gid, cb) => { + import_node_fs2.default.readdir(p, { withFileTypes: true }, (er, children) => { + if (er) { + if (er.code === "ENOENT") + return cb(); + else if (er.code !== "ENOTDIR" && er.code !== "ENOTSUP") + return cb(er); } - } - /** - * Mostly identical to `EventEmitter.emit`, with the following - * behavior differences to prevent data loss and unnecessary hangs: - * - * If the stream has been destroyed, and the event is something other - * than 'close' or 'error', then `false` is returned and no handlers - * are called. - * - * If the event is 'end', and has already been emitted, then the event - * is ignored. If the stream is in a paused or non-flowing state, then - * the event will be deferred until data flow resumes. If the stream is - * async, then handlers will be called on the next tick rather than - * immediately. - * - * If the event is 'close', and 'end' has not yet been emitted, then - * the event will be deferred until after 'end' is emitted. - * - * If the event is 'error', and an AbortSignal was provided for the stream, - * and there are no listeners, then the event is ignored, matching the - * behavior of node core streams in the presense of an AbortSignal. - * - * If the event is 'finish' or 'prefinish', then all listeners will be - * removed after emitting the event, to prevent double-firing. - */ - emit(ev, ...args) { - const data = args[0]; - if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) { - return false; - } else if (ev === "data") { - return !this[OBJECTMODE] && !data ? false : this[ASYNC] ? (defer(() => this[EMITDATA](data)), true) : this[EMITDATA](data); - } else if (ev === "end") { - return this[EMITEND](); - } else if (ev === "close") { - this[CLOSED] = true; - if (!this[EMITTED_END] && !this[DESTROYED]) - return false; - const ret2 = super.emit("close"); - this.removeAllListeners("close"); - return ret2; - } else if (ev === "error") { - this[EMITTED_ERROR] = data; - super.emit(ERROR, data); - const ret2 = !this[SIGNAL] || this.listeners("error").length ? super.emit("error", data) : false; - this[MAYBE_EMIT_END](); - return ret2; - } else if (ev === "resume") { - const ret2 = super.emit("resume"); - this[MAYBE_EMIT_END](); - return ret2; - } else if (ev === "finish" || ev === "prefinish") { - const ret2 = super.emit(ev); - this.removeAllListeners(ev); - return ret2; + if (er || !children.length) + return chown(p, uid, gid, cb); + let len = children.length; + let errState = null; + const then = (er2) => { + if (errState) + return; + if (er2) + return cb(errState = er2); + if (--len === 0) + return chown(p, uid, gid, cb); + }; + for (const child of children) { + chownrKid(p, child, uid, gid, then); } - const ret = super.emit(ev, ...args); - this[MAYBE_EMIT_END](); - return ret; + }); + }; + chownrKidSync = (p, child, uid, gid) => { + if (child.isDirectory()) + chownrSync(import_node_path3.default.resolve(p, child.name), uid, gid); + lchownSync(import_node_path3.default.resolve(p, child.name), uid, gid); + }; + chownrSync = (p, uid, gid) => { + let children; + try { + children = import_node_fs2.default.readdirSync(p, { withFileTypes: true }); + } catch (er) { + const e = er; + if (e?.code === "ENOENT") + return; + else if (e?.code === "ENOTDIR" || e?.code === "ENOTSUP") + return lchownSync(p, uid, gid); + else + throw e; } - [EMITDATA](data) { - for (const p of this[PIPES]) { - if (p.dest.write(data) === false) - this.pause(); - } - const ret = this[DISCARDED] ? false : super.emit("data", data); - this[MAYBE_EMIT_END](); - return ret; + for (const child of children) { + chownrKidSync(p, child, uid, gid); } - [EMITEND]() { - if (this[EMITTED_END]) - return false; - this[EMITTED_END] = true; - this.readable = false; - return this[ASYNC] ? (defer(() => this[EMITEND2]()), true) : this[EMITEND2](); + return lchownSync(p, uid, gid); + }; + } +}); + +// node_modules/tar/dist/esm/cwd-error.js +var CwdError; +var init_cwd_error = __esm({ + "node_modules/tar/dist/esm/cwd-error.js"() { + CwdError = class extends Error { + path; + code; + syscall = "chdir"; + constructor(path16, code2) { + super(`${code2}: Cannot cd into '${path16}'`); + this.path = path16; + this.code = code2; } - [EMITEND2]() { - if (this[DECODER]) { - const data = this[DECODER].end(); - if (data) { - for (const p of this[PIPES]) { - p.dest.write(data); - } - if (!this[DISCARDED]) - super.emit("data", data); - } - } - for (const p of this[PIPES]) { - p.end(); - } - const ret = super.emit("end"); - this.removeAllListeners("end"); - return ret; + get name() { + return "CwdError"; } - /** - * Return a Promise that resolves to an array of all emitted data once - * the stream ends. - */ - async collect() { - const buf = Object.assign([], { - dataLength: 0 - }); - if (!this[OBJECTMODE]) - buf.dataLength = 0; - const p = this.promise(); - this.on("data", (c) => { - buf.push(c); - if (!this[OBJECTMODE]) - buf.dataLength += c.length; - }); - await p; - return buf; - } - /** - * Return a Promise that resolves to the concatenation of all emitted data - * once the stream ends. - * - * Not allowed on objectMode streams. - */ - async concat() { - if (this[OBJECTMODE]) { - throw new Error("cannot concat in objectMode"); - } - const buf = await this.collect(); - return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength); - } - /** - * Return a void Promise that resolves once the stream ends. - */ - async promise() { - return new Promise((resolve, reject) => { - this.on(DESTROYED, () => reject(new Error("stream destroyed"))); - this.on("error", (er) => reject(er)); - this.on("end", () => resolve()); - }); - } - /** - * Asynchronous `for await of` iteration. - * - * This will continue emitting all chunks until the stream terminates. - */ - [Symbol.asyncIterator]() { - this[DISCARDED] = false; - let stopped = false; - const stop = async () => { - this.pause(); - stopped = true; - return { value: void 0, done: true }; - }; - const next = () => { - if (stopped) - return stop(); - const res = this.read(); - if (res !== null) - return Promise.resolve({ done: false, value: res }); - if (this[EOF]) - return stop(); - let resolve; - let reject; - const onerr = (er) => { - this.off("data", ondata); - this.off("end", onend); - this.off(DESTROYED, ondestroy); - stop(); - reject(er); - }; - const ondata = (value) => { - this.off("error", onerr); - this.off("end", onend); - this.off(DESTROYED, ondestroy); - this.pause(); - resolve({ value, done: !!this[EOF] }); - }; - const onend = () => { - this.off("error", onerr); - this.off("data", ondata); - this.off(DESTROYED, ondestroy); - stop(); - resolve({ done: true, value: void 0 }); - }; - const ondestroy = () => onerr(new Error("stream destroyed")); - return new Promise((res2, rej) => { - reject = rej; - resolve = res2; - this.once(DESTROYED, ondestroy); - this.once("error", onerr); - this.once("end", onend); - this.once("data", ondata); - }); - }; - return { - next, - throw: stop, - return: stop, - [Symbol.asyncIterator]() { - return this; - } - }; - } - /** - * Synchronous `for of` iteration. - * - * The iteration will terminate when the internal buffer runs out, even - * if the stream has not yet terminated. - */ - [Symbol.iterator]() { - this[DISCARDED] = false; - let stopped = false; - const stop = () => { - this.pause(); - this.off(ERROR, stop); - this.off(DESTROYED, stop); - this.off("end", stop); - stopped = true; - return { done: true, value: void 0 }; - }; - const next = () => { - if (stopped) - return stop(); - const value = this.read(); - return value === null ? stop() : { done: false, value }; - }; - this.once("end", stop); - this.once(ERROR, stop); - this.once(DESTROYED, stop); - return { - next, - throw: stop, - return: stop, - [Symbol.iterator]() { - return this; - } - }; - } - /** - * Destroy a stream, preventing it from being used for any further purpose. - * - * If the stream has a `close()` method, then it will be called on - * destruction. - * - * After destruction, any attempt to write data, read data, or emit most - * events will be ignored. - * - * If an error argument is provided, then it will be emitted in an - * 'error' event. - */ - destroy(er) { - if (this[DESTROYED]) { - if (er) - this.emit("error", er); - else - this.emit(DESTROYED); - return this; - } - this[DESTROYED] = true; - this[DISCARDED] = true; - this[BUFFER].length = 0; - this[BUFFERLENGTH] = 0; - const wc = this; - if (typeof wc.close === "function" && !this[CLOSED]) - wc.close(); - if (er) - this.emit("error", er); - else - this.emit(DESTROYED); - return this; + }; + } +}); + +// node_modules/tar/dist/esm/symlink-error.js +var SymlinkError; +var init_symlink_error = __esm({ + "node_modules/tar/dist/esm/symlink-error.js"() { + SymlinkError = class extends Error { + path; + symlink; + syscall = "symlink"; + code = "TAR_SYMLINK_ERROR"; + constructor(symlink, path16) { + super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"); + this.symlink = symlink; + this.path = path16; } - /** - * Alias for {@link isStream} - * - * Former export location, maintained for backwards compatibility. - * - * @deprecated - */ - static get isStream() { - return isStream; + get name() { + return "SymlinkError"; } }; } }); -// .yarn/cache/@isaacs-fs-minipass-npm-4.0.1-677026e841-c25b6dc159.zip/node_modules/@isaacs/fs-minipass/dist/esm/index.js -var import_events2, import_fs2, writev, _autoClose, _close, _ended, _fd, _finished, _flags, _flush, _handleChunk, _makeBuf, _mode, _needDrain, _onerror, _onopen, _onread, _onwrite, _open, _path, _pos, _queue, _read, _readSize, _reading, _remain, _size, _write, _writing, _defaultFlag, _errored, ReadStream, ReadStreamSync, WriteStream, WriteStreamSync; -var init_esm2 = __esm({ - ".yarn/cache/@isaacs-fs-minipass-npm-4.0.1-677026e841-c25b6dc159.zip/node_modules/@isaacs/fs-minipass/dist/esm/index.js"() { - import_events2 = __toESM(require("events"), 1); - import_fs2 = __toESM(require("fs"), 1); - init_esm(); - writev = import_fs2.default.writev; - _autoClose = /* @__PURE__ */ Symbol("_autoClose"); - _close = /* @__PURE__ */ Symbol("_close"); - _ended = /* @__PURE__ */ Symbol("_ended"); - _fd = /* @__PURE__ */ Symbol("_fd"); - _finished = /* @__PURE__ */ Symbol("_finished"); - _flags = /* @__PURE__ */ Symbol("_flags"); - _flush = /* @__PURE__ */ Symbol("_flush"); - _handleChunk = /* @__PURE__ */ Symbol("_handleChunk"); - _makeBuf = /* @__PURE__ */ Symbol("_makeBuf"); - _mode = /* @__PURE__ */ Symbol("_mode"); - _needDrain = /* @__PURE__ */ Symbol("_needDrain"); - _onerror = /* @__PURE__ */ Symbol("_onerror"); - _onopen = /* @__PURE__ */ Symbol("_onopen"); - _onread = /* @__PURE__ */ Symbol("_onread"); - _onwrite = /* @__PURE__ */ Symbol("_onwrite"); - _open = /* @__PURE__ */ Symbol("_open"); - _path = /* @__PURE__ */ Symbol("_path"); - _pos = /* @__PURE__ */ Symbol("_pos"); - _queue = /* @__PURE__ */ Symbol("_queue"); - _read = /* @__PURE__ */ Symbol("_read"); - _readSize = /* @__PURE__ */ Symbol("_readSize"); - _reading = /* @__PURE__ */ Symbol("_reading"); - _remain = /* @__PURE__ */ Symbol("_remain"); - _size = /* @__PURE__ */ Symbol("_size"); - _write = /* @__PURE__ */ Symbol("_write"); - _writing = /* @__PURE__ */ Symbol("_writing"); - _defaultFlag = /* @__PURE__ */ Symbol("_defaultFlag"); - _errored = /* @__PURE__ */ Symbol("_errored"); - ReadStream = class extends Minipass { - [_errored] = false; - [_fd]; - [_path]; - [_readSize]; - [_reading] = false; - [_size]; - [_remain]; - [_autoClose]; - constructor(path16, opt) { - opt = opt || {}; - super(opt); - this.readable = true; - this.writable = false; - if (typeof path16 !== "string") { - throw new TypeError("path must be a string"); +// node_modules/tar/dist/esm/mkdir.js +var import_node_fs3, import_promises, import_node_path4, checkCwd, mkdir, mkdir_, onmkdir, checkCwdSync, mkdirSync2; +var init_mkdir = __esm({ + "node_modules/tar/dist/esm/mkdir.js"() { + init_esm4(); + import_node_fs3 = __toESM(require("node:fs"), 1); + import_promises = __toESM(require("node:fs/promises"), 1); + import_node_path4 = __toESM(require("node:path"), 1); + init_cwd_error(); + init_normalize_windows_path(); + init_symlink_error(); + checkCwd = (dir, cb) => { + import_node_fs3.default.stat(dir, (er, st) => { + if (er || !st.isDirectory()) { + er = new CwdError(dir, er?.code || "ENOTDIR"); } - this[_errored] = false; - this[_fd] = typeof opt.fd === "number" ? opt.fd : void 0; - this[_path] = path16; - this[_readSize] = opt.readSize || 16 * 1024 * 1024; - this[_reading] = false; - this[_size] = typeof opt.size === "number" ? opt.size : Infinity; - this[_remain] = this[_size]; - this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; - if (typeof this[_fd] === "number") { - this[_read](); - } else { - this[_open](); - } - } - get fd() { - return this[_fd]; - } - get path() { - return this[_path]; - } - //@ts-ignore - write() { - throw new TypeError("this is a readable stream"); - } - //@ts-ignore - end() { - throw new TypeError("this is a readable stream"); - } - [_open]() { - import_fs2.default.open(this[_path], "r", (er, fd) => this[_onopen](er, fd)); - } - [_onopen](er, fd) { + cb(er); + }); + }; + mkdir = (dir, opt, cb) => { + dir = normalizeWindowsPath(dir); + const umask2 = opt.umask ?? 18; + const mode = opt.mode | 448; + const needChmod = (mode & umask2) !== 0; + const uid = opt.uid; + const gid = opt.gid; + const doChown = typeof uid === "number" && typeof gid === "number" && (uid !== opt.processUid || gid !== opt.processGid); + const preserve = opt.preserve; + const unlink = opt.unlink; + const cwd = normalizeWindowsPath(opt.cwd); + const done = (er, created) => { if (er) { - this[_onerror](er); + cb(er); } else { - this[_fd] = fd; - this.emit("open", fd); - this[_read](); - } - } - [_makeBuf]() { - return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])); - } - [_read]() { - if (!this[_reading]) { - this[_reading] = true; - const buf = this[_makeBuf](); - if (buf.length === 0) { - return process.nextTick(() => this[_onread](null, 0, buf)); + if (created && doChown) { + chownr(created, uid, gid, (er2) => done(er2)); + } else if (needChmod) { + import_node_fs3.default.chmod(dir, mode, cb); + } else { + cb(); } - import_fs2.default.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b)); - } - } - [_onread](er, br, buf) { - this[_reading] = false; - if (er) { - this[_onerror](er); - } else if (this[_handleChunk](br, buf)) { - this[_read](); } + }; + if (dir === cwd) { + return checkCwd(dir, done); } - [_close]() { - if (this[_autoClose] && typeof this[_fd] === "number") { - const fd = this[_fd]; - this[_fd] = void 0; - import_fs2.default.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); - } + if (preserve) { + return import_promises.default.mkdir(dir, { mode, recursive: true }).then( + (made) => done(null, made ?? void 0), + // oh, ts + done + ); } - [_onerror](er) { - this[_reading] = true; - this[_close](); - this.emit("error", er); + const sub = normalizeWindowsPath(import_node_path4.default.relative(cwd, dir)); + const parts = sub.split("/"); + mkdir_(cwd, parts, mode, unlink, cwd, void 0, done); + }; + mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => { + if (parts.length === 0) { + return cb(null, created); } - [_handleChunk](br, buf) { - let ret = false; - this[_remain] -= br; - if (br > 0) { - ret = super.write(br < buf.length ? buf.subarray(0, br) : buf); - } - if (br === 0 || this[_remain] <= 0) { - ret = false; - this[_close](); - super.end(); - } - return ret; + const p = parts.shift(); + const part = normalizeWindowsPath(import_node_path4.default.resolve(base + "/" + p)); + import_node_fs3.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb)); + }; + onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => { + if (er) { + import_node_fs3.default.lstat(part, (statEr, st) => { + if (statEr) { + statEr.path = statEr.path && normalizeWindowsPath(statEr.path); + cb(statEr); + } else if (st.isDirectory()) { + mkdir_(part, parts, mode, unlink, cwd, created, cb); + } else if (unlink) { + import_node_fs3.default.unlink(part, (er2) => { + if (er2) { + return cb(er2); + } + import_node_fs3.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb)); + }); + } else if (st.isSymbolicLink()) { + return cb(new SymlinkError(part, part + "/" + parts.join("/"))); + } else { + cb(er); + } + }); + } else { + created = created || part; + mkdir_(part, parts, mode, unlink, cwd, created, cb); } - emit(ev, ...args) { - switch (ev) { - case "prefinish": - case "finish": - return false; - case "drain": - if (typeof this[_fd] === "number") { - this[_read](); - } - return false; - case "error": - if (this[_errored]) { - return false; - } - this[_errored] = true; - return super.emit(ev, ...args); - default: - return super.emit(ev, ...args); + }; + checkCwdSync = (dir) => { + let ok = false; + let code2; + try { + ok = import_node_fs3.default.statSync(dir).isDirectory(); + } catch (er) { + code2 = er?.code; + } finally { + if (!ok) { + throw new CwdError(dir, code2 ?? "ENOTDIR"); } } }; - ReadStreamSync = class extends ReadStream { - [_open]() { - let threw = true; - try { - this[_onopen](null, import_fs2.default.openSync(this[_path], "r")); - threw = false; - } finally { - if (threw) { - this[_close](); - } + mkdirSync2 = (dir, opt) => { + dir = normalizeWindowsPath(dir); + const umask2 = opt.umask ?? 18; + const mode = opt.mode | 448; + const needChmod = (mode & umask2) !== 0; + const uid = opt.uid; + const gid = opt.gid; + const doChown = typeof uid === "number" && typeof gid === "number" && (uid !== opt.processUid || gid !== opt.processGid); + const preserve = opt.preserve; + const unlink = opt.unlink; + const cwd = normalizeWindowsPath(opt.cwd); + const done = (created2) => { + if (created2 && doChown) { + chownrSync(created2, uid, gid); + } + if (needChmod) { + import_node_fs3.default.chmodSync(dir, mode); } + }; + if (dir === cwd) { + checkCwdSync(cwd); + return done(); } - [_read]() { - let threw = true; + if (preserve) { + return done(import_node_fs3.default.mkdirSync(dir, { mode, recursive: true }) ?? void 0); + } + const sub = normalizeWindowsPath(import_node_path4.default.relative(cwd, dir)); + const parts = sub.split("/"); + let created; + for (let p = parts.shift(), part = cwd; p && (part += "/" + p); p = parts.shift()) { + part = normalizeWindowsPath(import_node_path4.default.resolve(part)); try { - if (!this[_reading]) { - this[_reading] = true; - do { - const buf = this[_makeBuf](); - const br = buf.length === 0 ? 0 : import_fs2.default.readSync(this[_fd], buf, 0, buf.length, null); - if (!this[_handleChunk](br, buf)) { - break; - } - } while (true); - this[_reading] = false; - } - threw = false; - } finally { - if (threw) { - this[_close](); + import_node_fs3.default.mkdirSync(part, mode); + created = created || part; + } catch { + const st = import_node_fs3.default.lstatSync(part); + if (st.isDirectory()) { + continue; + } else if (unlink) { + import_node_fs3.default.unlinkSync(part); + import_node_fs3.default.mkdirSync(part, mode); + created = created || part; + continue; + } else if (st.isSymbolicLink()) { + return new SymlinkError(part, part + "/" + parts.join("/")); } } } - [_close]() { - if (this[_autoClose] && typeof this[_fd] === "number") { - const fd = this[_fd]; - this[_fd] = void 0; - import_fs2.default.closeSync(fd); - this.emit("close"); - } - } + return done(created); }; - WriteStream = class extends import_events2.default { - readable = false; - writable = true; - [_errored] = false; - [_writing] = false; - [_ended] = false; - [_queue] = []; - [_needDrain] = false; - [_path]; - [_mode]; - [_autoClose]; - [_fd]; - [_defaultFlag]; - [_flags]; - [_finished] = false; - [_pos]; - constructor(path16, opt) { - opt = opt || {}; - super(opt); - this[_path] = path16; - this[_fd] = typeof opt.fd === "number" ? opt.fd : void 0; - this[_mode] = opt.mode === void 0 ? 438 : opt.mode; - this[_pos] = typeof opt.start === "number" ? opt.start : void 0; - this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; - const defaultFlag = this[_pos] !== void 0 ? "r+" : "w"; - this[_defaultFlag] = opt.flags === void 0; - this[_flags] = opt.flags === void 0 ? defaultFlag : opt.flags; - if (this[_fd] === void 0) { - this[_open](); + } +}); + +// node_modules/tar/dist/esm/strip-absolute-path.js +var import_node_path5, isAbsolute, parse3, stripAbsolutePath; +var init_strip_absolute_path = __esm({ + "node_modules/tar/dist/esm/strip-absolute-path.js"() { + import_node_path5 = require("node:path"); + ({ isAbsolute, parse: parse3 } = import_node_path5.win32); + stripAbsolutePath = (path16) => { + let r = ""; + let parsed = parse3(path16); + while (isAbsolute(path16) || parsed.root) { + const root = path16.charAt(0) === "/" && path16.slice(0, 4) !== "//?/" ? "/" : parsed.root; + path16 = path16.slice(root.length); + r += root; + parsed = parse3(path16); + } + return [r, path16]; + }; + } +}); + +// node_modules/tar/dist/esm/winchars.js +var raw, win, toWin, toRaw, encode2, decode; +var init_winchars = __esm({ + "node_modules/tar/dist/esm/winchars.js"() { + raw = ["|", "<", ">", "?", ":"]; + win = raw.map((char) => String.fromCodePoint(61440 + Number(char.codePointAt(0)))); + toWin = new Map(raw.map((char, i) => [char, win[i]])); + toRaw = new Map(win.map((char, i) => [char, raw[i]])); + encode2 = (s) => raw.reduce((s2, c) => s2.split(c).join(toWin.get(c)), s); + decode = (s) => win.reduce((s2, c) => s2.split(c).join(toRaw.get(c)), s); + } +}); + +// node_modules/tar/dist/esm/normalize-unicode.js +var normalizeCache, MAX, cache, normalizeUnicode; +var init_normalize_unicode = __esm({ + "node_modules/tar/dist/esm/normalize-unicode.js"() { + normalizeCache = /* @__PURE__ */ Object.create(null); + MAX = 1e4; + cache = /* @__PURE__ */ new Set(); + normalizeUnicode = (s) => { + if (!cache.has(s)) { + normalizeCache[s] = s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"); + } else { + cache.delete(s); + } + cache.add(s); + const ret = normalizeCache[s]; + let i = cache.size - MAX; + if (i > MAX / 10) { + for (const s2 of cache) { + cache.delete(s2); + delete normalizeCache[s2]; + if (--i <= 0) + break; } } - emit(ev, ...args) { - if (ev === "error") { - if (this[_errored]) { - return false; + return ret; + }; + } +}); + +// node_modules/tar/dist/esm/path-reservations.js +var import_node_path6, platform3, isWindows2, getDirs, PathReservations; +var init_path_reservations = __esm({ + "node_modules/tar/dist/esm/path-reservations.js"() { + import_node_path6 = require("node:path"); + init_normalize_unicode(); + init_strip_trailing_slashes(); + platform3 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; + isWindows2 = platform3 === "win32"; + getDirs = (path16) => { + const dirs = path16.split("/").slice(0, -1).reduce((set, path17) => { + const s = set.at(-1); + if (s !== void 0) { + path17 = (0, import_node_path6.join)(s, path17); + } + set.push(path17 || "/"); + return set; + }, []); + return dirs; + }; + PathReservations = class { + // path => [function or Set] + // A Set object means a directory reservation + // A fn is a direct reservation on that path + #queues = /* @__PURE__ */ new Map(); + // fn => {paths:[path,...], dirs:[path, ...]} + #reservations = /* @__PURE__ */ new Map(); + // functions currently running + #running = /* @__PURE__ */ new Set(); + reserve(paths, fn2) { + paths = isWindows2 ? ["win32 parallelization disabled"] : paths.map((p) => { + return stripTrailingSlashes((0, import_node_path6.join)(normalizeUnicode(p))); + }); + const dirs = new Set(paths.map((path16) => getDirs(path16)).reduce((a, b) => a.concat(b))); + this.#reservations.set(fn2, { dirs, paths }); + for (const p of paths) { + const q = this.#queues.get(p); + if (!q) { + this.#queues.set(p, [fn2]); + } else { + q.push(fn2); } - this[_errored] = true; } - return super.emit(ev, ...args); - } - get fd() { - return this[_fd]; - } - get path() { - return this[_path]; - } - [_onerror](er) { - this[_close](); - this[_writing] = true; - this.emit("error", er); - } - [_open]() { - import_fs2.default.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)); - } - [_onopen](er, fd) { - if (this[_defaultFlag] && this[_flags] === "r+" && er && er.code === "ENOENT") { - this[_flags] = "w"; - this[_open](); - } else if (er) { - this[_onerror](er); - } else { - this[_fd] = fd; - this.emit("open", fd); - if (!this[_writing]) { - this[_flush](); + for (const dir of dirs) { + const q = this.#queues.get(dir); + if (!q) { + this.#queues.set(dir, [/* @__PURE__ */ new Set([fn2])]); + } else { + const l = q.at(-1); + if (l instanceof Set) { + l.add(fn2); + } else { + q.push(/* @__PURE__ */ new Set([fn2])); + } } } + return this.#run(fn2); } - end(buf, enc) { - if (buf) { - this.write(buf, enc); - } - this[_ended] = true; - if (!this[_writing] && !this[_queue].length && typeof this[_fd] === "number") { - this[_onwrite](null, 0); + // return the queues for each path the function cares about + // fn => {paths, dirs} + #getQueues(fn2) { + const res = this.#reservations.get(fn2); + if (!res) { + throw new Error("function does not have any path reservations"); } - return this; + return { + paths: res.paths.map((path16) => this.#queues.get(path16)), + dirs: [...res.dirs].map((path16) => this.#queues.get(path16)) + }; } - write(buf, enc) { - if (typeof buf === "string") { - buf = Buffer.from(buf, enc); - } - if (this[_ended]) { - this.emit("error", new Error("write() after end()")); - return false; - } - if (this[_fd] === void 0 || this[_writing] || this[_queue].length) { - this[_queue].push(buf); - this[_needDrain] = true; + // check if fn is first in line for all its paths, and is + // included in the first set for all its dir queues + check(fn2) { + const { paths, dirs } = this.#getQueues(fn2); + return paths.every((q) => q && q[0] === fn2) && dirs.every((q) => q && q[0] instanceof Set && q[0].has(fn2)); + } + // run the function if it's first in line and not already running + #run(fn2) { + if (this.#running.has(fn2) || !this.check(fn2)) { return false; } - this[_writing] = true; - this[_write](buf); + this.#running.add(fn2); + fn2(() => this.#clear(fn2)); return true; } - [_write](buf) { - import_fs2.default.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); - } - [_onwrite](er, bw) { - if (er) { - this[_onerror](er); - } else { - if (this[_pos] !== void 0 && typeof bw === "number") { - this[_pos] += bw; + #clear(fn2) { + if (!this.#running.has(fn2)) { + return false; + } + const res = this.#reservations.get(fn2); + if (!res) { + throw new Error("invalid reservation"); + } + const { paths, dirs } = res; + const next = /* @__PURE__ */ new Set(); + for (const path16 of paths) { + const q = this.#queues.get(path16); + if (!q || q?.[0] !== fn2) { + continue; } - if (this[_queue].length) { - this[_flush](); + const q0 = q[1]; + if (!q0) { + this.#queues.delete(path16); + continue; + } + q.shift(); + if (typeof q0 === "function") { + next.add(q0); } else { - this[_writing] = false; - if (this[_ended] && !this[_finished]) { - this[_finished] = true; - this[_close](); - this.emit("finish"); - } else if (this[_needDrain]) { - this[_needDrain] = false; - this.emit("drain"); + for (const f of q0) { + next.add(f); } } } - } - [_flush]() { - if (this[_queue].length === 0) { - if (this[_ended]) { - this[_onwrite](null, 0); - } - } else if (this[_queue].length === 1) { - this[_write](this[_queue].pop()); - } else { - const iovec = this[_queue]; - this[_queue] = []; - writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)); - } - } - [_close]() { - if (this[_autoClose] && typeof this[_fd] === "number") { - const fd = this[_fd]; - this[_fd] = void 0; - import_fs2.default.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); - } - } - }; - WriteStreamSync = class extends WriteStream { - [_open]() { - let fd; - if (this[_defaultFlag] && this[_flags] === "r+") { - try { - fd = import_fs2.default.openSync(this[_path], this[_flags], this[_mode]); - } catch (er) { - if (er?.code === "ENOENT") { - this[_flags] = "w"; - return this[_open](); - } else { - throw er; - } - } - } else { - fd = import_fs2.default.openSync(this[_path], this[_flags], this[_mode]); - } - this[_onopen](null, fd); - } - [_close]() { - if (this[_autoClose] && typeof this[_fd] === "number") { - const fd = this[_fd]; - this[_fd] = void 0; - import_fs2.default.closeSync(fd); - this.emit("close"); - } - } - [_write](buf) { - let threw = true; - try { - this[_onwrite](null, import_fs2.default.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); - threw = false; - } finally { - if (threw) { - try { - this[_close](); - } catch { + for (const dir of dirs) { + const q = this.#queues.get(dir); + const q0 = q?.[0]; + if (!q || !(q0 instanceof Set)) + continue; + if (q0.size === 1 && q.length === 1) { + this.#queues.delete(dir); + continue; + } else if (q0.size === 1) { + q.shift(); + const n = q[0]; + if (typeof n === "function") { + next.add(n); } + } else { + q0.delete(fn2); } } + this.#running.delete(fn2); + next.forEach((fn3) => this.#run(fn3)); + return true; } }; } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/options.js -var argmap, isSyncFile, isAsyncFile, isSyncNoFile, isAsyncNoFile, dealiasKey, dealias; -var init_options = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/options.js"() { - argmap = /* @__PURE__ */ new Map([ - ["C", "cwd"], - ["f", "file"], - ["z", "gzip"], - ["P", "preservePaths"], - ["U", "unlink"], - ["strip-components", "strip"], - ["stripComponents", "strip"], - ["keep-newer", "newer"], - ["keepNewer", "newer"], - ["keep-newer-files", "newer"], - ["keepNewerFiles", "newer"], - ["k", "keep"], - ["keep-existing", "keep"], - ["keepExisting", "keep"], - ["m", "noMtime"], - ["no-mtime", "noMtime"], - ["p", "preserveOwner"], - ["L", "follow"], - ["h", "follow"], - ["onentry", "onReadEntry"] - ]); - isSyncFile = (o) => !!o.sync && !!o.file; - isAsyncFile = (o) => !o.sync && !!o.file; - isSyncNoFile = (o) => !!o.sync && !o.file; - isAsyncNoFile = (o) => !o.sync && !o.file; - dealiasKey = (k) => { - const d = argmap.get(k); - if (d) - return d; - return k; - }; - dealias = (opt = {}) => { - if (!opt) - return {}; - const result = {}; - for (const [key, v] of Object.entries(opt)) { - const k = dealiasKey(key); - result[k] = v; - } - if (result.chmod === void 0 && result.noChmod === false) { - result.chmod = true; - } - delete result.noChmod; - return result; - }; +// node_modules/tar/dist/esm/process-umask.js +var umask; +var init_process_umask = __esm({ + "node_modules/tar/dist/esm/process-umask.js"() { + umask = () => process.umask(); } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/make-command.js -var makeCommand; -var init_make_command = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/make-command.js"() { - init_options(); - makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => { - return Object.assign((opt_ = [], entries, cb) => { - if (Array.isArray(opt_)) { - entries = opt_; - opt_ = {}; - } - if (typeof entries === "function") { - cb = entries; - entries = void 0; - } - entries = !entries ? [] : Array.from(entries); - const opt = dealias(opt_); - validate?.(opt, entries); - if (isSyncFile(opt)) { - if (typeof cb === "function") { - throw new TypeError("callback not supported for sync tar functions"); - } - return syncFile(opt, entries); - } else if (isAsyncFile(opt)) { - const p = asyncFile(opt, entries); - return cb ? p.then(() => cb(), cb) : p; - } else if (isSyncNoFile(opt)) { - if (typeof cb === "function") { - throw new TypeError("callback not supported for sync tar functions"); - } - return syncNoFile(opt, entries); - } else if (isAsyncNoFile(opt)) { - if (typeof cb === "function") { - throw new TypeError("callback only supported with file option"); - } - return asyncNoFile(opt, entries); +// node_modules/tar/dist/esm/unpack.js +var import_node_assert, import_node_crypto, import_node_fs4, import_node_path7, ONENTRY, CHECKFS, CHECKFS2, ISREUSABLE, MAKEFS, FILE, DIRECTORY, LINK, SYMLINK, HARDLINK, ENSURE_NO_SYMLINK, UNSUPPORTED, CHECKPATH, STRIPABSOLUTEPATH, MKDIR, ONERROR, PENDING, PEND, UNPEND, ENDED2, MAYBECLOSE, SKIP, DOCHOWN, UID, GID, CHECKED_CWD, platform4, isWindows3, DEFAULT_MAX_DEPTH, unlinkFile, unlinkFileSync, uint32, Unpack, callSync, UnpackSync; +var init_unpack = __esm({ + "node_modules/tar/dist/esm/unpack.js"() { + init_esm2(); + import_node_assert = __toESM(require("node:assert"), 1); + import_node_crypto = require("node:crypto"); + import_node_fs4 = __toESM(require("node:fs"), 1); + import_node_path7 = __toESM(require("node:path"), 1); + init_get_write_flag(); + init_mkdir(); + init_normalize_windows_path(); + init_parse(); + init_strip_absolute_path(); + init_winchars(); + init_path_reservations(); + init_symlink_error(); + init_process_umask(); + ONENTRY = /* @__PURE__ */ Symbol("onEntry"); + CHECKFS = /* @__PURE__ */ Symbol("checkFs"); + CHECKFS2 = /* @__PURE__ */ Symbol("checkFs2"); + ISREUSABLE = /* @__PURE__ */ Symbol("isReusable"); + MAKEFS = /* @__PURE__ */ Symbol("makeFs"); + FILE = /* @__PURE__ */ Symbol("file"); + DIRECTORY = /* @__PURE__ */ Symbol("directory"); + LINK = /* @__PURE__ */ Symbol("link"); + SYMLINK = /* @__PURE__ */ Symbol("symlink"); + HARDLINK = /* @__PURE__ */ Symbol("hardlink"); + ENSURE_NO_SYMLINK = /* @__PURE__ */ Symbol("ensureNoSymlink"); + UNSUPPORTED = /* @__PURE__ */ Symbol("unsupported"); + CHECKPATH = /* @__PURE__ */ Symbol("checkPath"); + STRIPABSOLUTEPATH = /* @__PURE__ */ Symbol("stripAbsolutePath"); + MKDIR = /* @__PURE__ */ Symbol("mkdir"); + ONERROR = /* @__PURE__ */ Symbol("onError"); + PENDING = /* @__PURE__ */ Symbol("pending"); + PEND = /* @__PURE__ */ Symbol("pend"); + UNPEND = /* @__PURE__ */ Symbol("unpend"); + ENDED2 = /* @__PURE__ */ Symbol("ended"); + MAYBECLOSE = /* @__PURE__ */ Symbol("maybeClose"); + SKIP = /* @__PURE__ */ Symbol("skip"); + DOCHOWN = /* @__PURE__ */ Symbol("doChown"); + UID = /* @__PURE__ */ Symbol("uid"); + GID = /* @__PURE__ */ Symbol("gid"); + CHECKED_CWD = /* @__PURE__ */ Symbol("checkedCwd"); + platform4 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; + isWindows3 = platform4 === "win32"; + DEFAULT_MAX_DEPTH = 1024; + unlinkFile = (path16, cb) => { + if (!isWindows3) { + return import_node_fs4.default.unlink(path16, cb); + } + const name2 = path16 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex"); + import_node_fs4.default.rename(path16, name2, (er) => { + if (er) { + return cb(er); } - throw new Error("impossible options??"); - }, { - syncFile, - asyncFile, - syncNoFile, - asyncNoFile, - validate + import_node_fs4.default.unlink(name2, cb); }); }; - } -}); - -// .yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/constants.js -var import_zlib, realZlibConstants, constants; -var init_constants = __esm({ - ".yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/constants.js"() { - import_zlib = __toESM(require("zlib"), 1); - realZlibConstants = import_zlib.default.constants || { ZLIB_VERNUM: 4736 }; - constants = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { - Z_NO_FLUSH: 0, - Z_PARTIAL_FLUSH: 1, - Z_SYNC_FLUSH: 2, - Z_FULL_FLUSH: 3, - Z_FINISH: 4, - Z_BLOCK: 5, - Z_OK: 0, - Z_STREAM_END: 1, - Z_NEED_DICT: 2, - Z_ERRNO: -1, - Z_STREAM_ERROR: -2, - Z_DATA_ERROR: -3, - Z_MEM_ERROR: -4, - Z_BUF_ERROR: -5, - Z_VERSION_ERROR: -6, - Z_NO_COMPRESSION: 0, - Z_BEST_SPEED: 1, - Z_BEST_COMPRESSION: 9, - Z_DEFAULT_COMPRESSION: -1, - Z_FILTERED: 1, - Z_HUFFMAN_ONLY: 2, - Z_RLE: 3, - Z_FIXED: 4, - Z_DEFAULT_STRATEGY: 0, - DEFLATE: 1, - INFLATE: 2, - GZIP: 3, - GUNZIP: 4, - DEFLATERAW: 5, - INFLATERAW: 6, - UNZIP: 7, - BROTLI_DECODE: 8, - BROTLI_ENCODE: 9, - Z_MIN_WINDOWBITS: 8, - Z_MAX_WINDOWBITS: 15, - Z_DEFAULT_WINDOWBITS: 15, - Z_MIN_CHUNK: 64, - Z_MAX_CHUNK: Infinity, - Z_DEFAULT_CHUNK: 16384, - Z_MIN_MEMLEVEL: 1, - Z_MAX_MEMLEVEL: 9, - Z_DEFAULT_MEMLEVEL: 8, - Z_MIN_LEVEL: -1, - Z_MAX_LEVEL: 9, - Z_DEFAULT_LEVEL: -1, - BROTLI_OPERATION_PROCESS: 0, - BROTLI_OPERATION_FLUSH: 1, - BROTLI_OPERATION_FINISH: 2, - BROTLI_OPERATION_EMIT_METADATA: 3, - BROTLI_MODE_GENERIC: 0, - BROTLI_MODE_TEXT: 1, - BROTLI_MODE_FONT: 2, - BROTLI_DEFAULT_MODE: 0, - BROTLI_MIN_QUALITY: 0, - BROTLI_MAX_QUALITY: 11, - BROTLI_DEFAULT_QUALITY: 11, - BROTLI_MIN_WINDOW_BITS: 10, - BROTLI_MAX_WINDOW_BITS: 24, - BROTLI_LARGE_MAX_WINDOW_BITS: 30, - BROTLI_DEFAULT_WINDOW: 22, - BROTLI_MIN_INPUT_BLOCK_BITS: 16, - BROTLI_MAX_INPUT_BLOCK_BITS: 24, - BROTLI_PARAM_MODE: 0, - BROTLI_PARAM_QUALITY: 1, - BROTLI_PARAM_LGWIN: 2, - BROTLI_PARAM_LGBLOCK: 3, - BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, - BROTLI_PARAM_SIZE_HINT: 5, - BROTLI_PARAM_LARGE_WINDOW: 6, - BROTLI_PARAM_NPOSTFIX: 7, - BROTLI_PARAM_NDIRECT: 8, - BROTLI_DECODER_RESULT_ERROR: 0, - BROTLI_DECODER_RESULT_SUCCESS: 1, - BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, - BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, - BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, - BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, - BROTLI_DECODER_NO_ERROR: 0, - BROTLI_DECODER_SUCCESS: 1, - BROTLI_DECODER_NEEDS_MORE_INPUT: 2, - BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, - BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, - BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, - BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, - BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, - BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, - BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, - BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, - BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, - BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, - BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, - BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, - BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, - BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, - BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, - BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, - BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, - BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, - BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, - BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, - BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, - BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, - BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, - BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, - BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, - BROTLI_DECODER_ERROR_UNREACHABLE: -31 - }, realZlibConstants)); - } -}); - -// .yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/index.js -var import_assert2, import_buffer, realZlib2, OriginalBufferConcat, desc, noop, passthroughBufferConcat, _superWrite, ZlibError, _flushFlag, ZlibBase, Zlib, Gzip, Unzip, Brotli, BrotliCompress, BrotliDecompress, Zstd, ZstdCompress, ZstdDecompress; -var init_esm3 = __esm({ - ".yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/index.js"() { - import_assert2 = __toESM(require("assert"), 1); - import_buffer = require("buffer"); - init_esm(); - realZlib2 = __toESM(require("zlib"), 1); - init_constants(); - init_constants(); - OriginalBufferConcat = import_buffer.Buffer.concat; - desc = Object.getOwnPropertyDescriptor(import_buffer.Buffer, "concat"); - noop = (args) => args; - passthroughBufferConcat = desc?.writable === true || desc?.set !== void 0 ? (makeNoOp) => { - import_buffer.Buffer.concat = makeNoOp ? noop : OriginalBufferConcat; - } : (_) => { - }; - _superWrite = /* @__PURE__ */ Symbol("_superWrite"); - ZlibError = class extends Error { - code; - errno; - constructor(err, origin) { - super("zlib: " + err.message, { cause: err }); - this.code = err.code; - this.errno = err.errno; - if (!this.code) - this.code = "ZLIB_ERROR"; - this.message = "zlib: " + err.message; - Error.captureStackTrace(this, origin ?? this.constructor); - } - get name() { - return "ZlibError"; + unlinkFileSync = (path16) => { + if (!isWindows3) { + return import_node_fs4.default.unlinkSync(path16); } + const name2 = path16 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex"); + import_node_fs4.default.renameSync(path16, name2); + import_node_fs4.default.unlinkSync(name2); }; - _flushFlag = /* @__PURE__ */ Symbol("flushFlag"); - ZlibBase = class extends Minipass { - #sawError = false; - #ended = false; - #flushFlag; - #finishFlushFlag; - #fullFlushFlag; - #handle; - #onError; - get sawError() { - return this.#sawError; - } - get handle() { - return this.#handle; - } - /* c8 ignore start */ - get flushFlag() { - return this.#flushFlag; - } - /* c8 ignore stop */ - constructor(opts, mode) { - if (!opts || typeof opts !== "object") - throw new TypeError("invalid options for ZlibBase constructor"); - super(opts); - this.#flushFlag = opts.flush ?? 0; - this.#finishFlushFlag = opts.finishFlush ?? 0; - this.#fullFlushFlag = opts.fullFlushFlag ?? 0; - if (typeof realZlib2[mode] !== "function") { - throw new TypeError("Compression method not supported: " + mode); - } - try { - this.#handle = new realZlib2[mode](opts); - } catch (er) { - throw new ZlibError(er, this.constructor); - } - this.#onError = (err) => { - if (this.#sawError) - return; - this.#sawError = true; - this.close(); - this.emit("error", err); + uint32 = (a, b, c) => a !== void 0 && a === a >>> 0 ? a : b !== void 0 && b === b >>> 0 ? b : c; + Unpack = class extends Parser { + [ENDED2] = false; + [CHECKED_CWD] = false; + [PENDING] = 0; + reservations = new PathReservations(); + transform; + writable = true; + readable = false; + uid; + gid; + setOwner; + preserveOwner; + processGid; + processUid; + maxDepth; + forceChown; + win32; + newer; + keep; + noMtime; + preservePaths; + unlink; + cwd; + strip; + processUmask; + umask; + dmode; + fmode; + chmod; + constructor(opt = {}) { + opt.ondone = () => { + this[ENDED2] = true; + this[MAYBECLOSE](); }; - this.#handle?.on("error", (er) => this.#onError(new ZlibError(er))); - this.once("end", () => this.close); - } - close() { - if (this.#handle) { - this.#handle.close(); - this.#handle = void 0; - this.emit("close"); + super(opt); + this.transform = opt.transform; + this.chmod = !!opt.chmod; + if (typeof opt.uid === "number" || typeof opt.gid === "number") { + if (typeof opt.uid !== "number" || typeof opt.gid !== "number") { + throw new TypeError("cannot set owner without number uid and gid"); + } + if (opt.preserveOwner) { + throw new TypeError("cannot preserve owner in archive and also set owner explicitly"); + } + this.uid = opt.uid; + this.gid = opt.gid; + this.setOwner = true; + } else { + this.uid = void 0; + this.gid = void 0; + this.setOwner = false; } + this.preserveOwner = opt.preserveOwner === void 0 && typeof opt.uid !== "number" ? !!(process.getuid && process.getuid() === 0) : !!opt.preserveOwner; + this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0; + this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0; + this.maxDepth = typeof opt.maxDepth === "number" ? opt.maxDepth : DEFAULT_MAX_DEPTH; + this.forceChown = opt.forceChown === true; + this.win32 = !!opt.win32 || isWindows3; + this.newer = !!opt.newer; + this.keep = !!opt.keep; + this.noMtime = !!opt.noMtime; + this.preservePaths = !!opt.preservePaths; + this.unlink = !!opt.unlink; + this.cwd = normalizeWindowsPath(import_node_path7.default.resolve(opt.cwd || process.cwd())); + this.strip = Number(opt.strip) || 0; + this.processUmask = !this.chmod ? 0 : typeof opt.processUmask === "number" ? opt.processUmask : umask(); + this.umask = typeof opt.umask === "number" ? opt.umask : this.processUmask; + this.dmode = opt.dmode || 511 & ~this.umask; + this.fmode = opt.fmode || 438 & ~this.umask; + this.on("entry", (entry) => this[ONENTRY](entry)); } - reset() { - if (!this.#sawError) { - (0, import_assert2.default)(this.#handle, "zlib binding closed"); - return this.#handle.reset?.(); + // a bad or damaged archive is a warning for Parser, but an error + // when extracting. Mark those errors as unrecoverable, because + // the Unpack contract cannot be met. + warn(code2, msg, data = {}) { + if (code2 === "TAR_BAD_ARCHIVE" || code2 === "TAR_ABORT") { + data.recoverable = false; } + return super.warn(code2, msg, data); } - flush(flushFlag) { - if (this.ended) - return; - if (typeof flushFlag !== "number") - flushFlag = this.#fullFlushFlag; - this.write(Object.assign(import_buffer.Buffer.alloc(0), { [_flushFlag]: flushFlag })); + [MAYBECLOSE]() { + if (this[ENDED2] && this[PENDING] === 0) { + this.emit("prefinish"); + this.emit("finish"); + this.emit("end"); + } } - end(chunk, encoding, cb) { - if (typeof chunk === "function") { - cb = chunk; - encoding = void 0; - chunk = void 0; - } - if (typeof encoding === "function") { - cb = encoding; - encoding = void 0; + // return false if we need to skip this file + // return true if the field was successfully sanitized + [STRIPABSOLUTEPATH](entry, field) { + const p = entry[field]; + const { type } = entry; + if (!p || this.preservePaths) + return true; + const [root, stripped] = stripAbsolutePath(p); + const parts = stripped.replaceAll(/\\/g, "/").split("/"); + if (parts.includes("..") || /* c8 ignore next */ + isWindows3 && /^[a-z]:\.\.$/i.test(parts[0] ?? "")) { + if (field === "path" || type === "Link") { + this.warn("TAR_ENTRY_ERROR", `${field} contains '..'`, { + entry, + [field]: p + }); + return false; + } + const entryDir = import_node_path7.default.posix.dirname(entry.path); + const resolved = import_node_path7.default.posix.normalize(import_node_path7.default.posix.join(entryDir, parts.join("/"))); + if (resolved.startsWith("../") || resolved === "..") { + this.warn("TAR_ENTRY_ERROR", `${field} escapes extraction directory`, { + entry, + [field]: p + }); + return false; + } } - if (chunk) { - if (encoding) - this.write(chunk, encoding); - else - this.write(chunk); + if (root) { + entry[field] = String(stripped); + this.warn("TAR_ENTRY_INFO", `stripping ${root} from absolute ${field}`, { + entry, + [field]: p + }); } - this.flush(this.#finishFlushFlag); - this.#ended = true; - return super.end(cb); - } - get ended() { - return this.#ended; - } - // overridden in the gzip classes to do portable writes - [_superWrite](data) { - return super.write(data); + return true; } - write(chunk, encoding, cb) { - if (typeof encoding === "function") - cb = encoding, encoding = "utf8"; - if (typeof chunk === "string") - chunk = import_buffer.Buffer.from(chunk, encoding); - if (this.#sawError) - return; - (0, import_assert2.default)(this.#handle, "zlib binding closed"); - const nativeHandle = this.#handle._handle; - const originalNativeClose = nativeHandle.close; - nativeHandle.close = () => { - }; - const originalClose = this.#handle.close; - this.#handle.close = () => { - }; - passthroughBufferConcat(true); - let result = void 0; - try { - const flushFlag = typeof chunk[_flushFlag] === "number" ? chunk[_flushFlag] : this.#flushFlag; - result = this.#handle._processChunk(chunk, flushFlag); - passthroughBufferConcat(false); - } catch (err) { - passthroughBufferConcat(false); - this.#onError(new ZlibError(err, this.write)); - } finally { - if (this.#handle) { - ; - this.#handle._handle = nativeHandle; - nativeHandle.close = originalNativeClose; - this.#handle.close = originalClose; - this.#handle.removeAllListeners("error"); + // no IO, just string checking for absolute indicators + [CHECKPATH](entry) { + const p = normalizeWindowsPath(entry.path); + const parts = p.split("/"); + if (this.strip) { + if (parts.length < this.strip) { + return false; } - } - if (this.#handle) - this.#handle.on("error", (er) => this.#onError(new ZlibError(er, this.write))); - let writeReturn; - if (result) { - if (Array.isArray(result) && result.length > 0) { - const r = result[0]; - writeReturn = this[_superWrite](import_buffer.Buffer.from(r)); - for (let i = 1; i < result.length; i++) { - writeReturn = this[_superWrite](result[i]); + if (entry.type === "Link") { + const linkparts = normalizeWindowsPath(String(entry.linkpath)).split("/"); + if (linkparts.length >= this.strip) { + entry.linkpath = linkparts.slice(this.strip).join("/"); + } else { + return false; } - } else { - writeReturn = this[_superWrite](import_buffer.Buffer.from(result)); } + parts.splice(0, this.strip); + entry.path = parts.join("/"); } - if (cb) - cb(); - return writeReturn; - } - }; - Zlib = class extends ZlibBase { - #level; - #strategy; - constructor(opts, mode) { - opts = opts || {}; - opts.flush = opts.flush || constants.Z_NO_FLUSH; - opts.finishFlush = opts.finishFlush || constants.Z_FINISH; - opts.fullFlushFlag = constants.Z_FULL_FLUSH; - super(opts, mode); - this.#level = opts.level; - this.#strategy = opts.strategy; + if (isFinite(this.maxDepth) && parts.length > this.maxDepth) { + this.warn("TAR_ENTRY_ERROR", "path excessively deep", { + entry, + path: p, + depth: parts.length, + maxDepth: this.maxDepth + }); + return false; + } + if (!this[STRIPABSOLUTEPATH](entry, "path") || !this[STRIPABSOLUTEPATH](entry, "linkpath")) { + return false; + } + entry.absolute = import_node_path7.default.isAbsolute(entry.path) ? normalizeWindowsPath(import_node_path7.default.resolve(entry.path)) : normalizeWindowsPath(import_node_path7.default.resolve(this.cwd, entry.path)); + if (!this.preservePaths && typeof entry.absolute === "string" && entry.absolute.indexOf(this.cwd + "/") !== 0 && entry.absolute !== this.cwd) { + this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { + entry, + path: normalizeWindowsPath(entry.path), + resolvedPath: entry.absolute, + cwd: this.cwd + }); + return false; + } + if (entry.absolute === this.cwd && entry.type !== "Directory" && entry.type !== "GNUDumpDir") { + return false; + } + if (this.win32) { + const { root: aRoot } = import_node_path7.default.win32.parse(String(entry.absolute)); + entry.absolute = aRoot + encode2(String(entry.absolute).slice(aRoot.length)); + const { root: pRoot } = import_node_path7.default.win32.parse(entry.path); + entry.path = pRoot + encode2(entry.path.slice(pRoot.length)); + } + return true; } - params(level, strategy) { - if (this.sawError) - return; - if (!this.handle) - throw new Error("cannot switch params when binding is closed"); - if (!this.handle.params) - throw new Error("not supported in this implementation"); - if (this.#level !== level || this.#strategy !== strategy) { - this.flush(constants.Z_SYNC_FLUSH); - (0, import_assert2.default)(this.handle, "zlib binding closed"); - const origFlush = this.handle.flush; - this.handle.flush = (flushFlag, cb) => { - if (typeof flushFlag === "function") { - cb = flushFlag; - flushFlag = this.flushFlag; + [ONENTRY](entry) { + if (!this[CHECKPATH](entry)) { + return entry.resume(); + } + import_node_assert.default.equal(typeof entry.absolute, "string"); + switch (entry.type) { + case "Directory": + case "GNUDumpDir": + if (entry.mode) { + entry.mode = entry.mode | 448; } - this.flush(flushFlag); - cb?.(); - }; - try { - ; - this.handle.params(level, strategy); - } finally { - this.handle.flush = origFlush; - } - if (this.handle) { - this.#level = level; - this.#strategy = strategy; - } + // eslint-disable-next-line no-fallthrough + case "File": + case "OldFile": + case "ContiguousFile": + case "Link": + case "SymbolicLink": + return this[CHECKFS](entry); + case "CharacterDevice": + case "BlockDevice": + case "FIFO": + default: + return this[UNSUPPORTED](entry); } } - }; - Gzip = class extends Zlib { - #portable; - constructor(opts) { - super(opts, "Gzip"); - this.#portable = opts && !!opts.portable; + [ONERROR](er, entry) { + if (er.name === "CwdError") { + this.emit("error", er); + } else { + this.warn("TAR_ENTRY_ERROR", er, { entry }); + this[UNPEND](); + entry.resume(); + } } - [_superWrite](data) { - if (!this.#portable) - return super[_superWrite](data); - this.#portable = false; - data[9] = 255; - return super[_superWrite](data); + [MKDIR](dir, mode, cb) { + mkdir(normalizeWindowsPath(dir), { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cwd: this.cwd, + mode + }, cb); } - }; - Unzip = class extends Zlib { - constructor(opts) { - super(opts, "Unzip"); + [DOCHOWN](entry) { + return this.forceChown || this.preserveOwner && (typeof entry.uid === "number" && entry.uid !== this.processUid || typeof entry.gid === "number" && entry.gid !== this.processGid) || typeof this.uid === "number" && this.uid !== this.processUid || typeof this.gid === "number" && this.gid !== this.processGid; } - }; - Brotli = class extends ZlibBase { - constructor(opts, mode) { - opts = opts || {}; - opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS; - opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH; - opts.fullFlushFlag = constants.BROTLI_OPERATION_FLUSH; - super(opts, mode); + [UID](entry) { + return uint32(this.uid, entry.uid, this.processUid); } - }; - BrotliCompress = class extends Brotli { - constructor(opts) { - super(opts, "BrotliCompress"); + [GID](entry) { + return uint32(this.gid, entry.gid, this.processGid); } - }; - BrotliDecompress = class extends Brotli { - constructor(opts) { - super(opts, "BrotliDecompress"); + [FILE](entry, fullyDone) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.fmode; + const stream = new WriteStream(String(entry.absolute), { + // slight lie, but it can be numeric flags + flags: getWriteFlag(entry.size), + mode, + autoClose: false + }); + stream.on("error", (er) => { + if (stream.fd) { + import_node_fs4.default.close(stream.fd, () => { + }); + } + stream.write = () => true; + this[ONERROR](er, entry); + fullyDone(); + }); + let actions = 1; + const done = (er) => { + if (er) { + if (stream.fd) { + import_node_fs4.default.close(stream.fd, () => { + }); + } + this[ONERROR](er, entry); + fullyDone(); + return; + } + if (--actions === 0) { + if (stream.fd !== void 0) { + import_node_fs4.default.close(stream.fd, (er2) => { + if (er2) { + this[ONERROR](er2, entry); + } else { + this[UNPEND](); + } + fullyDone(); + }); + } + } + }; + stream.on("finish", () => { + const abs = String(entry.absolute); + const fd = stream.fd; + if (typeof fd === "number" && entry.mtime && !this.noMtime) { + actions++; + const atime = entry.atime || /* @__PURE__ */ new Date(); + const mtime = entry.mtime; + import_node_fs4.default.futimes(fd, atime, mtime, (er) => er ? import_node_fs4.default.utimes(abs, atime, mtime, (er2) => done(er2 && er)) : done()); + } + if (typeof fd === "number" && this[DOCHOWN](entry)) { + actions++; + const uid = this[UID](entry); + const gid = this[GID](entry); + if (typeof uid === "number" && typeof gid === "number") { + import_node_fs4.default.fchown(fd, uid, gid, (er) => er ? import_node_fs4.default.chown(abs, uid, gid, (er2) => done(er2 && er)) : done()); + } + } + done(); + }); + const tx = this.transform ? this.transform(entry) || entry : entry; + if (tx !== entry) { + tx.on("error", (er) => { + this[ONERROR](er, entry); + fullyDone(); + }); + entry.pipe(tx); + } + tx.pipe(stream); } - }; - Zstd = class extends ZlibBase { - constructor(opts, mode) { - opts = opts || {}; - opts.flush = opts.flush || constants.ZSTD_e_continue; - opts.finishFlush = opts.finishFlush || constants.ZSTD_e_end; - opts.fullFlushFlag = constants.ZSTD_e_flush; - super(opts, mode); + [DIRECTORY](entry, fullyDone) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.dmode; + this[MKDIR](String(entry.absolute), mode, (er) => { + if (er) { + this[ONERROR](er, entry); + fullyDone(); + return; + } + let actions = 1; + const done = () => { + if (--actions === 0) { + fullyDone(); + this[UNPEND](); + entry.resume(); + } + }; + if (entry.mtime && !this.noMtime) { + actions++; + import_node_fs4.default.utimes(String(entry.absolute), entry.atime || /* @__PURE__ */ new Date(), entry.mtime, done); + } + if (this[DOCHOWN](entry)) { + actions++; + import_node_fs4.default.chown(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry)), done); + } + done(); + }); } - }; - ZstdCompress = class extends Zstd { - constructor(opts) { - super(opts, "ZstdCompress"); + [UNSUPPORTED](entry) { + entry.unsupported = true; + this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${entry.type}`, { entry }); + entry.resume(); } - }; - ZstdDecompress = class extends Zstd { - constructor(opts) { - super(opts, "ZstdDecompress"); + [SYMLINK](entry, done) { + const parts = normalizeWindowsPath(import_node_path7.default.relative(this.cwd, import_node_path7.default.resolve(import_node_path7.default.dirname(String(entry.absolute)), String(entry.linkpath)))).split("/"); + this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, String(entry.linkpath), "symlink", done), (er) => { + this[ONERROR](er, entry); + done(); + }); } - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/large-numbers.js -var encode, encodePositive, encodeNegative, parse, twos, pos, onesComp, twosComp; -var init_large_numbers = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/large-numbers.js"() { - encode = (num, buf) => { - if (!Number.isSafeInteger(num)) { - throw Error("cannot encode number outside of javascript safe integer range"); - } else if (num < 0) { - encodeNegative(num, buf); - } else { - encodePositive(num, buf); + [HARDLINK](entry, done) { + const linkpath = normalizeWindowsPath(import_node_path7.default.resolve(this.cwd, String(entry.linkpath))); + const parts = normalizeWindowsPath(String(entry.linkpath)).split("/"); + this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, linkpath, "link", done), (er) => { + this[ONERROR](er, entry); + done(); + }); } - return buf; - }; - encodePositive = (num, buf) => { - buf[0] = 128; - for (var i = buf.length; i > 1; i--) { - buf[i - 1] = num & 255; - num = Math.floor(num / 256); + [ENSURE_NO_SYMLINK](entry, cwd, parts, done, onError) { + const p = parts.shift(); + if (this.preservePaths || p === void 0) + return done(); + const t = import_node_path7.default.resolve(cwd, p); + import_node_fs4.default.lstat(t, (er, st) => { + if (er) + return done(); + if (st?.isSymbolicLink()) { + return onError(new SymlinkError(t, import_node_path7.default.resolve(t, parts.join("/")))); + } + this[ENSURE_NO_SYMLINK](entry, t, parts, done, onError); + }); } - }; - encodeNegative = (num, buf) => { - buf[0] = 255; - var flipped = false; - num = num * -1; - for (var i = buf.length; i > 1; i--) { - var byte = num & 255; - num = Math.floor(num / 256); - if (flipped) { - buf[i - 1] = onesComp(byte); - } else if (byte === 0) { - buf[i - 1] = 0; - } else { - flipped = true; - buf[i - 1] = twosComp(byte); - } + [PEND]() { + this[PENDING]++; } - }; - parse = (buf) => { - const pre = buf[0]; - const value = pre === 128 ? pos(buf.subarray(1, buf.length)) : pre === 255 ? twos(buf) : null; - if (value === null) { - throw Error("invalid base256 encoding"); + [UNPEND]() { + this[PENDING]--; + this[MAYBECLOSE](); } - if (!Number.isSafeInteger(value)) { - throw Error("parsed number outside of javascript safe integer range"); + [SKIP](entry) { + this[UNPEND](); + entry.resume(); } - return value; - }; - twos = (buf) => { - var len = buf.length; - var sum = 0; - var flipped = false; - for (var i = len - 1; i > -1; i--) { - var byte = Number(buf[i]); - var f; - if (flipped) { - f = onesComp(byte); - } else if (byte === 0) { - f = byte; - } else { - flipped = true; - f = twosComp(byte); - } - if (f !== 0) { - sum -= f * Math.pow(256, len - i - 1); - } + // Check if we can reuse an existing filesystem entry safely and + // overwrite it, rather than unlinking and recreating + // Windows doesn't report a useful nlink, so we just never reuse entries + [ISREUSABLE](entry, st) { + return entry.type === "File" && !this.unlink && st.isFile() && st.nlink <= 1 && !isWindows3; } - return sum; - }; - pos = (buf) => { - var len = buf.length; - var sum = 0; - for (var i = len - 1; i > -1; i--) { - var byte = Number(buf[i]); - if (byte !== 0) { - sum += byte * Math.pow(256, len - i - 1); + // check if a thing is there, and if so, try to clobber it + [CHECKFS](entry) { + this[PEND](); + const paths = [entry.path]; + if (entry.linkpath) { + paths.push(entry.linkpath); } + this.reservations.reserve(paths, (done) => this[CHECKFS2](entry, done)); } - return sum; - }; - onesComp = (byte) => (255 ^ byte) & 255; - twosComp = (byte) => (255 ^ byte) + 1 & 255; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/types.js -var isCode, name, code; -var init_types = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/types.js"() { - isCode = (c) => name.has(c); - name = /* @__PURE__ */ new Map([ - ["0", "File"], - // same as File - ["", "OldFile"], - ["1", "Link"], - ["2", "SymbolicLink"], - // Devices and FIFOs aren't fully supported - // they are parsed, but skipped when unpacking - ["3", "CharacterDevice"], - ["4", "BlockDevice"], - ["5", "Directory"], - ["6", "FIFO"], - // same as File - ["7", "ContiguousFile"], - // pax headers - ["g", "GlobalExtendedHeader"], - ["x", "ExtendedHeader"], - // vendor-specific stuff - // skip - ["A", "SolarisACL"], - // like 5, but with data, which should be skipped - ["D", "GNUDumpDir"], - // metadata only, skip - ["I", "Inode"], - // data = link path of next file - ["K", "NextFileHasLongLinkpath"], - // data = path of next file - ["L", "NextFileHasLongPath"], - // skip - ["M", "ContinuationFile"], - // like L - ["N", "OldGnuLongPath"], - // skip - ["S", "SparseFile"], - // skip - ["V", "TapeVolumeHeader"], - // like x - ["X", "OldExtendedHeader"] - ]); - code = new Map(Array.from(name).map((kv) => [kv[1], kv[0]])); - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/header.js -var import_node_path, Header, splitPrefix, decString, decDate, numToDate, decNumber, nanUndef, decSmallNumber, MAXNUM, encNumber, encSmallNumber, octalString, padOctal, encDate, NULLS, encString; -var init_header = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/header.js"() { - import_node_path = require("node:path"); - init_large_numbers(); - init_types(); - Header = class { - cksumValid = false; - needPax = false; - nullBlock = false; - block; - path; - mode; - uid; - gid; - size; - cksum; - #type = "Unsupported"; - linkpath; - uname; - gname; - devmaj = 0; - devmin = 0; - atime; - ctime; - mtime; - charset; - comment; - constructor(data, off = 0, ex, gex) { - if (Buffer.isBuffer(data)) { - this.decode(data, off || 0, ex, gex); - } else if (data) { - this.#slurp(data); + [CHECKFS2](entry, fullyDone) { + const done = (er) => { + fullyDone(er); + }; + const checkCwd2 = () => { + this[MKDIR](this.cwd, this.dmode, (er) => { + if (er) { + this[ONERROR](er, entry); + done(); + return; + } + this[CHECKED_CWD] = true; + start(); + }); + }; + const start = () => { + if (entry.absolute !== this.cwd) { + const parent = normalizeWindowsPath(import_node_path7.default.dirname(String(entry.absolute))); + if (parent !== this.cwd) { + return this[MKDIR](parent, this.dmode, (er) => { + if (er) { + this[ONERROR](er, entry); + done(); + return; + } + afterMakeParent(); + }); + } + } + afterMakeParent(); + }; + const afterMakeParent = () => { + import_node_fs4.default.lstat(String(entry.absolute), (lstatEr, st) => { + if (st && (this.keep || /* c8 ignore next */ + this.newer && st.mtime > (entry.mtime ?? st.mtime))) { + this[SKIP](entry); + done(); + return; + } + if (lstatEr || this[ISREUSABLE](entry, st)) { + return this[MAKEFS](null, entry, done); + } + if (st.isDirectory()) { + if (entry.type === "Directory") { + const needChmod = this.chmod && entry.mode && (st.mode & 4095) !== entry.mode; + const afterChmod = (er) => this[MAKEFS](er ?? null, entry, done); + if (!needChmod) { + return afterChmod(); + } + return import_node_fs4.default.chmod(String(entry.absolute), Number(entry.mode), afterChmod); + } + if (entry.absolute !== this.cwd) { + return import_node_fs4.default.rmdir(String(entry.absolute), (er) => this[MAKEFS](er ?? null, entry, done)); + } + } + if (entry.absolute === this.cwd) { + return this[MAKEFS](null, entry, done); + } + unlinkFile(String(entry.absolute), (er) => this[MAKEFS](er ?? null, entry, done)); + }); + }; + if (this[CHECKED_CWD]) { + start(); + } else { + checkCwd2(); } } - decode(buf, off, ex, gex) { - if (!off) { - off = 0; - } - if (!buf || !(buf.length >= off + 512)) { - throw new Error("need 512 bytes for header"); - } - this.path = ex?.path ?? decString(buf, off, 100); - this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8); - this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8); - this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8); - this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12); - this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12); - this.cksum = decNumber(buf, off + 148, 12); - if (gex) - this.#slurp(gex, true); - if (ex) - this.#slurp(ex); - const t = decString(buf, off + 156, 1); - if (isCode(t)) { - this.#type = t || "0"; - } - if (this.#type === "0" && this.path.slice(-1) === "/") { - this.#type = "5"; + [MAKEFS](er, entry, done) { + if (er) { + this[ONERROR](er, entry); + done(); + return; } - if (this.#type === "5") { - this.size = 0; + switch (entry.type) { + case "File": + case "OldFile": + case "ContiguousFile": + return this[FILE](entry, done); + case "Link": + return this[HARDLINK](entry, done); + case "SymbolicLink": + return this[SYMLINK](entry, done); + case "Directory": + case "GNUDumpDir": + return this[DIRECTORY](entry, done); } - this.linkpath = decString(buf, off + 157, 100); - if (buf.subarray(off + 257, off + 265).toString() === "ustar\x0000") { - this.uname = ex?.uname ?? gex?.uname ?? decString(buf, off + 265, 32); - this.gname = ex?.gname ?? gex?.gname ?? decString(buf, off + 297, 32); - this.devmaj = ex?.devmaj ?? gex?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0; - this.devmin = ex?.devmin ?? gex?.devmin ?? decNumber(buf, off + 337, 8) ?? 0; - if (buf[off + 475] !== 0) { - const prefix = decString(buf, off + 345, 155); - this.path = prefix + "/" + this.path; + } + [LINK](entry, linkpath, link, done) { + import_node_fs4.default[link](linkpath, String(entry.absolute), (er) => { + if (er) { + this[ONERROR](er, entry); } else { - const prefix = decString(buf, off + 345, 130); - if (prefix) { - this.path = prefix + "/" + this.path; - } - this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12); - this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12); + this[UNPEND](); + entry.resume(); + } + done(); + }); + } + }; + callSync = (fn2) => { + try { + return [null, fn2()]; + } catch (er) { + return [er, null]; + } + }; + UnpackSync = class extends Unpack { + sync = true; + [MAKEFS](er, entry) { + return super[MAKEFS](er, entry, () => { + }); + } + [CHECKFS](entry) { + if (!this[CHECKED_CWD]) { + const er2 = this[MKDIR](this.cwd, this.dmode); + if (er2) { + return this[ONERROR](er2, entry); } + this[CHECKED_CWD] = true; } - let sum = 8 * 32; - for (let i = off; i < off + 148; i++) { - sum += buf[i]; + if (entry.absolute !== this.cwd) { + const parent = normalizeWindowsPath(import_node_path7.default.dirname(String(entry.absolute))); + if (parent !== this.cwd) { + const mkParent = this[MKDIR](parent, this.dmode); + if (mkParent) { + return this[ONERROR](mkParent, entry); + } + } } - for (let i = off + 156; i < off + 512; i++) { - sum += buf[i]; + const [lstatEr, st] = callSync(() => import_node_fs4.default.lstatSync(String(entry.absolute))); + if (st && (this.keep || /* c8 ignore next */ + this.newer && st.mtime > (entry.mtime ?? st.mtime))) { + return this[SKIP](entry); } - this.cksumValid = sum === this.cksum; - if (this.cksum === void 0 && sum === 8 * 32) { - this.nullBlock = true; + if (lstatEr || this[ISREUSABLE](entry, st)) { + return this[MAKEFS](null, entry); } - } - #slurp(ex, gex = false) { - Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { - return !(v === null || v === void 0 || k === "path" && gex || k === "linkpath" && gex || k === "global"); - }))); - } - encode(buf, off = 0) { - if (!buf) { - buf = this.block = Buffer.alloc(512); + if (st.isDirectory()) { + if (entry.type === "Directory") { + const needChmod = this.chmod && entry.mode && (st.mode & 4095) !== entry.mode; + const [er3] = needChmod ? callSync(() => { + import_node_fs4.default.chmodSync(String(entry.absolute), Number(entry.mode)); + }) : []; + return this[MAKEFS](er3, entry); + } + const [er2] = callSync(() => import_node_fs4.default.rmdirSync(String(entry.absolute))); + this[MAKEFS](er2, entry); } - if (this.#type === "Unsupported") { - this.#type = "0"; + const [er] = entry.absolute === this.cwd ? [] : callSync(() => unlinkFileSync(String(entry.absolute))); + this[MAKEFS](er, entry); + } + [FILE](entry, done) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.fmode; + const oner = (er) => { + let closeError; + try { + import_node_fs4.default.closeSync(fd); + } catch (e) { + closeError = e; + } + if (er || closeError) { + this[ONERROR](er || closeError, entry); + } + done(); + }; + let fd; + try { + fd = import_node_fs4.default.openSync(String(entry.absolute), getWriteFlag(entry.size), mode); + } catch (er) { + return oner(er); } - if (!(buf.length >= off + 512)) { - throw new Error("need 512 bytes for header"); + const tx = this.transform ? this.transform(entry) || entry : entry; + if (tx !== entry) { + tx.on("error", (er) => this[ONERROR](er, entry)); + entry.pipe(tx); } - const prefixSize = this.ctime || this.atime ? 130 : 155; - const split = splitPrefix(this.path || "", prefixSize); - const path16 = split[0]; - const prefix = split[1]; - this.needPax = !!split[2]; - this.needPax = encString(buf, off, 100, path16) || this.needPax; - this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax; - this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax; - this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax; - this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax; - this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax; - buf[off + 156] = Number(this.#type.codePointAt(0)); - this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax; - buf.write("ustar\x0000", off + 257, 8); - this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax; - this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax; - this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax; - this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax; - this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax; - if (buf[off + 475] !== 0) { - this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax; - } else { - this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax; - this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax; - this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax; + tx.on("data", (chunk) => { + try { + import_node_fs4.default.writeSync(fd, chunk, 0, chunk.length); + } catch (er) { + oner(er); + } + }); + tx.on("end", () => { + let er = null; + if (entry.mtime && !this.noMtime) { + const atime = entry.atime || /* @__PURE__ */ new Date(); + const mtime = entry.mtime; + try { + import_node_fs4.default.futimesSync(fd, atime, mtime); + } catch (futimeser) { + try { + import_node_fs4.default.utimesSync(String(entry.absolute), atime, mtime); + } catch { + er = futimeser; + } + } + } + if (this[DOCHOWN](entry)) { + const uid = this[UID](entry); + const gid = this[GID](entry); + try { + import_node_fs4.default.fchownSync(fd, Number(uid), Number(gid)); + } catch (fchowner) { + try { + import_node_fs4.default.chownSync(String(entry.absolute), Number(uid), Number(gid)); + } catch { + er = er || fchowner; + } + } + } + oner(er); + }); + } + [DIRECTORY](entry, done) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.dmode; + const er = this[MKDIR](String(entry.absolute), mode); + if (er) { + this[ONERROR](er, entry); + done(); + return; } - let sum = 8 * 32; - for (let i = off; i < off + 148; i++) { - sum += buf[i]; + if (entry.mtime && !this.noMtime) { + try { + import_node_fs4.default.utimesSync(String(entry.absolute), entry.atime || /* @__PURE__ */ new Date(), entry.mtime); + } catch { + } } - for (let i = off + 156; i < off + 512; i++) { - sum += buf[i]; + if (this[DOCHOWN](entry)) { + try { + import_node_fs4.default.chownSync(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry))); + } catch { + } } - this.cksum = sum; - encNumber(buf, off + 148, 8, this.cksum); - this.cksumValid = true; - return this.needPax; - } - get type() { - return this.#type === "Unsupported" ? this.#type : name.get(this.#type); - } - get typeKey() { - return this.#type; + done(); + entry.resume(); } - set type(type) { - const c = String(code.get(type)); - if (isCode(c) || c === "Unsupported") { - this.#type = c; - } else if (isCode(type)) { - this.#type = type; - } else { - throw new TypeError("invalid entry type: " + type); + [MKDIR](dir, mode) { + try { + return mkdirSync2(normalizeWindowsPath(dir), { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cwd: this.cwd, + mode + }); + } catch (er) { + return er; } } - }; - splitPrefix = (p, prefixSize) => { - const pathSize = 100; - let pp = p; - let prefix = ""; - let ret = void 0; - const root = import_node_path.posix.parse(p).root || "."; - if (Buffer.byteLength(pp) < pathSize) { - ret = [pp, prefix, false]; - } else { - prefix = import_node_path.posix.dirname(pp); - pp = import_node_path.posix.basename(pp); - do { - if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) { - ret = [pp, prefix, false]; - } else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) { - ret = [pp.slice(0, pathSize - 1), prefix, true]; - } else { - pp = import_node_path.posix.join(import_node_path.posix.basename(prefix), pp); - prefix = import_node_path.posix.dirname(prefix); + [ENSURE_NO_SYMLINK](_entry, cwd, parts, done, onError) { + if (this.preservePaths || parts.length === 0) + return done(); + let t = cwd; + for (const p of parts) { + t = import_node_path7.default.resolve(t, p); + const [er, st] = callSync(() => import_node_fs4.default.lstatSync(t)); + if (er) + return done(); + if (st.isSymbolicLink()) { + return onError(new SymlinkError(t, import_node_path7.default.resolve(cwd, parts.join("/")))); } - } while (prefix !== root && ret === void 0); - if (!ret) { - ret = [p.slice(0, pathSize - 1), "", true]; + } + done(); + } + [LINK](entry, linkpath, link, done) { + const linkSync = `${link}Sync`; + try { + import_node_fs4.default[linkSync](linkpath, String(entry.absolute)); + done(); + entry.resume(); + } catch (er) { + return this[ONERROR](er, entry); } } - return ret; - }; - decString = (buf, off, size) => buf.subarray(off, off + size).toString("utf8").replace(/\0.*/, ""); - decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)); - numToDate = (num) => num === void 0 ? void 0 : new Date(num * 1e3); - decNumber = (buf, off, size) => Number(buf[off]) & 128 ? parse(buf.subarray(off, off + size)) : decSmallNumber(buf, off, size); - nanUndef = (value) => isNaN(value) ? void 0 : value; - decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf.subarray(off, off + size).toString("utf8").replace(/\0.*$/, "").trim(), 8)); - MAXNUM = { - 12: 8589934591, - 8: 2097151 }; - encNumber = (buf, off, size, num) => num === void 0 ? false : num > MAXNUM[size] || num < 0 ? (encode(num, buf.subarray(off, off + size)), true) : (encSmallNumber(buf, off, size, num), false); - encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, "ascii"); - octalString = (num, size) => padOctal(Math.floor(num).toString(8), size); - padOctal = (str, size) => (str.length === size - 1 ? str : new Array(size - str.length - 1).join("0") + str + " ") + "\0"; - encDate = (buf, off, size, date) => date === void 0 ? false : encNumber(buf, off, size, date.getTime() / 1e3); - NULLS = new Array(156).join("\0"); - encString = (buf, off, size, str) => str === void 0 ? false : (buf.write(str + NULLS, off, size, "utf8"), str.length !== Buffer.byteLength(str) || str.length > size); } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/pax.js -var import_node_path2, Pax, merge, parseKV, parseKVLine; -var init_pax = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/pax.js"() { - import_node_path2 = require("node:path"); - init_header(); - Pax = class _Pax { - atime; - mtime; - ctime; - charset; - comment; - gid; - uid; - gname; - uname; - linkpath; - dev; - ino; - nlink; - path; - size; - mode; - global; - constructor(obj, global2 = false) { - this.atime = obj.atime; - this.charset = obj.charset; - this.comment = obj.comment; - this.ctime = obj.ctime; - this.dev = obj.dev; - this.gid = obj.gid; - this.global = global2; - this.gname = obj.gname; - this.ino = obj.ino; - this.linkpath = obj.linkpath; - this.mtime = obj.mtime; - this.nlink = obj.nlink; - this.path = obj.path; - this.size = obj.size; - this.uid = obj.uid; - this.uname = obj.uname; +// node_modules/tar/dist/esm/extract.js +var extract_exports = {}; +__export(extract_exports, { + extract: () => extract +}); +var import_node_fs5, extractFileSync, extractFile, extract; +var init_extract = __esm({ + "node_modules/tar/dist/esm/extract.js"() { + init_esm2(); + import_node_fs5 = __toESM(require("node:fs"), 1); + init_list(); + init_make_command(); + init_unpack(); + extractFileSync = (opt) => { + const u = new UnpackSync(opt); + const file = opt.file; + const stat = import_node_fs5.default.statSync(file); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const stream = new ReadStreamSync(file, { + readSize, + size: stat.size + }); + stream.pipe(u); + }; + extractFile = (opt, _) => { + const u = new Unpack(opt); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const file = opt.file; + const p = new Promise((resolve, reject) => { + u.on("error", reject); + u.on("close", resolve); + import_node_fs5.default.stat(file, (er, stat) => { + if (er) { + reject(er); + } else { + const stream = new ReadStream(file, { + readSize, + size: stat.size + }); + stream.on("error", reject); + stream.pipe(u); + } + }); + }); + return p; + }; + extract = makeCommand(extractFileSync, extractFile, (opt) => new UnpackSync(opt), (opt) => new Unpack(opt), (opt, files) => { + if (files?.length) + filesFilter(opt, files); + }); + } +}); + +// node_modules/v8-compile-cache/v8-compile-cache.js +var require_v8_compile_cache = __commonJS({ + "node_modules/v8-compile-cache/v8-compile-cache.js"(exports2, module2) { + "use strict"; + var Module2 = require("module"); + var crypto = require("crypto"); + var fs17 = require("fs"); + var path16 = require("path"); + var vm = require("vm"); + var os3 = require("os"); + var hasOwnProperty = Object.prototype.hasOwnProperty; + var FileSystemBlobStore = class { + constructor(directory, prefix) { + const name2 = prefix ? slashEscape(prefix + ".") : ""; + this._blobFilename = path16.join(directory, name2 + "BLOB"); + this._mapFilename = path16.join(directory, name2 + "MAP"); + this._lockFilename = path16.join(directory, name2 + "LOCK"); + this._directory = directory; + this._load(); } - encode() { - const body = this.encodeBody(); - if (body === "") { - return Buffer.allocUnsafe(0); + has(key, invalidationKey) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + return this._invalidationKeys[key] === invalidationKey; + } else if (hasOwnProperty.call(this._storedMap, key)) { + return this._storedMap[key][0] === invalidationKey; } - const bodyLen = Buffer.byteLength(body); - const bufLen = 512 * Math.ceil(1 + bodyLen / 512); - const buf = Buffer.allocUnsafe(bufLen); - for (let i = 0; i < 512; i++) { - buf[i] = 0; + return false; + } + get(key, invalidationKey) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + if (this._invalidationKeys[key] === invalidationKey) { + return this._memoryBlobs[key]; + } + } else if (hasOwnProperty.call(this._storedMap, key)) { + const mapping = this._storedMap[key]; + if (mapping[0] === invalidationKey) { + return this._storedBlob.slice(mapping[1], mapping[2]); + } } - new Header({ - // XXX split the path - // then the path should be PaxHeader + basename, but less than 99, - // prepend with the dirname - /* c8 ignore start */ - path: ("PaxHeader/" + (0, import_node_path2.basename)(this.path ?? "")).slice(0, 99), - /* c8 ignore stop */ - mode: this.mode || 420, - uid: this.uid, - gid: this.gid, - size: bodyLen, - mtime: this.mtime, - type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", - linkpath: "", - uname: this.uname || "", - gname: this.gname || "", - devmaj: 0, - devmin: 0, - atime: this.atime, - ctime: this.ctime - }).encode(buf); - buf.write(body, 512, bodyLen, "utf8"); - for (let i = bodyLen + 512; i < buf.length; i++) { - buf[i] = 0; + } + set(key, invalidationKey, buffer) { + this._invalidationKeys[key] = invalidationKey; + this._memoryBlobs[key] = buffer; + this._dirty = true; + } + delete(key) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + this._dirty = true; + delete this._memoryBlobs[key]; + } + if (hasOwnProperty.call(this._invalidationKeys, key)) { + this._dirty = true; + delete this._invalidationKeys[key]; + } + if (hasOwnProperty.call(this._storedMap, key)) { + this._dirty = true; + delete this._storedMap[key]; } - return buf; } - encodeBody() { - return this.encodeField("path") + this.encodeField("ctime") + this.encodeField("atime") + this.encodeField("dev") + this.encodeField("ino") + this.encodeField("nlink") + this.encodeField("charset") + this.encodeField("comment") + this.encodeField("gid") + this.encodeField("gname") + this.encodeField("linkpath") + this.encodeField("mtime") + this.encodeField("size") + this.encodeField("uid") + this.encodeField("uname"); + isDirty() { + return this._dirty; } - encodeField(field) { - if (this[field] === void 0) { - return ""; + save() { + const dump = this._getDump(); + const blobToStore = Buffer.concat(dump[0]); + const mapToStore = JSON.stringify(dump[1]); + try { + mkdirpSync(this._directory); + fs17.writeFileSync(this._lockFilename, "LOCK", { flag: "wx" }); + } catch (error) { + return false; } - const r = this[field]; - const v = r instanceof Date ? r.getTime() / 1e3 : r; - const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n"; - const byteLen = Buffer.byteLength(s); - let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1; - if (byteLen + digits >= Math.pow(10, digits)) { - digits += 1; + try { + fs17.writeFileSync(this._blobFilename, blobToStore); + fs17.writeFileSync(this._mapFilename, mapToStore); + } finally { + fs17.unlinkSync(this._lockFilename); } - const len = digits + byteLen; - return len + s; + return true; } - static parse(str, ex, g = false) { - return new _Pax(merge(parseKV(str), ex), g); + _load() { + try { + this._storedBlob = fs17.readFileSync(this._blobFilename); + this._storedMap = JSON.parse(fs17.readFileSync(this._mapFilename)); + } catch (e) { + this._storedBlob = Buffer.alloc(0); + this._storedMap = {}; + } + this._dirty = false; + this._memoryBlobs = {}; + this._invalidationKeys = {}; + } + _getDump() { + const buffers = []; + const newMap = {}; + let offset = 0; + function push2(key, invalidationKey, buffer) { + buffers.push(buffer); + newMap[key] = [invalidationKey, offset, offset + buffer.length]; + offset += buffer.length; + } + for (const key of Object.keys(this._memoryBlobs)) { + const buffer = this._memoryBlobs[key]; + const invalidationKey = this._invalidationKeys[key]; + push2(key, invalidationKey, buffer); + } + for (const key of Object.keys(this._storedMap)) { + if (hasOwnProperty.call(newMap, key)) continue; + const mapping = this._storedMap[key]; + const buffer = this._storedBlob.slice(mapping[1], mapping[2]); + push2(key, mapping[0], buffer); + } + return [buffers, newMap]; } }; - merge = (a, b) => b ? Object.assign({}, b, a) : a; - parseKV = (str) => str.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null)); - parseKVLine = (set, line) => { - const n = parseInt(line, 10); - if (n !== Buffer.byteLength(line) + 1) { - return set; + var NativeCompileCache = class { + constructor() { + this._cacheStore = null; + this._previousModuleCompile = null; } - line = line.slice((n + " ").length); - const kv = line.split("="); - const r = kv.shift(); - if (!r) { - return set; + setCacheStore(cacheStore) { + this._cacheStore = cacheStore; } - const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"); - const v = kv.join("="); - set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(Number(v) * 1e3) : /^[0-9]+$/.test(v) ? +v : v; - return set; - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/normalize-windows-path.js -var platform, normalizeWindowsPath; -var init_normalize_windows_path = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/normalize-windows-path.js"() { - platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; - normalizeWindowsPath = platform !== "win32" ? (p) => p : (p) => p && p.replaceAll(/\\/g, "/"); - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/read-entry.js -var ReadEntry; -var init_read_entry = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/read-entry.js"() { - init_esm(); - init_normalize_windows_path(); - ReadEntry = class extends Minipass { - extended; - globalExtended; - header; - startBlockSize; - blockRemain; - remain; - type; - meta = false; - ignore = false; - path; - mode; - uid; - gid; - uname; - gname; - size = 0; - mtime; - atime; - ctime; - linkpath; - dev; - ino; - nlink; - invalid = false; - absolute; - unsupported = false; - constructor(header, ex, gex) { - super({}); - this.pause(); - this.extended = ex; - this.globalExtended = gex; - this.header = header; - this.remain = header.size ?? 0; - this.startBlockSize = 512 * Math.ceil(this.remain / 512); - this.blockRemain = this.startBlockSize; - this.type = header.type; - switch (this.type) { - case "File": - case "OldFile": - case "Link": - case "SymbolicLink": - case "CharacterDevice": - case "BlockDevice": - case "Directory": - case "FIFO": - case "ContiguousFile": - case "GNUDumpDir": - break; - case "NextFileHasLongLinkpath": - case "NextFileHasLongPath": - case "OldGnuLongPath": - case "GlobalExtendedHeader": - case "ExtendedHeader": - case "OldExtendedHeader": - this.meta = true; - break; - // NOTE: gnutar and bsdtar treat unrecognized types as 'File' - // it may be worth doing the same, but with a warning. - default: - this.ignore = true; - } - if (!header.path) { - throw new Error("no path provided for tar.ReadEntry"); - } - this.path = normalizeWindowsPath(header.path); - this.mode = header.mode; - if (this.mode) { - this.mode = this.mode & 4095; - } - this.uid = header.uid; - this.gid = header.gid; - this.uname = header.uname; - this.gname = header.gname; - this.size = this.remain; - this.mtime = header.mtime; - this.atime = header.atime; - this.ctime = header.ctime; - this.linkpath = header.linkpath ? normalizeWindowsPath(header.linkpath) : void 0; - this.uname = header.uname; - this.gname = header.gname; - if (ex) { - this.#slurp(ex); - } - if (gex) { - this.#slurp(gex, true); - } + install() { + const self2 = this; + const hasRequireResolvePaths = typeof require.resolve.paths === "function"; + this._previousModuleCompile = Module2.prototype._compile; + Module2.prototype._compile = function(content, filename) { + const mod = this; + function require2(id) { + return mod.require(id); + } + function resolve(request, options) { + return Module2._resolveFilename(request, mod, false, options); + } + require2.resolve = resolve; + if (hasRequireResolvePaths) { + resolve.paths = function paths(request) { + return Module2._resolveLookupPaths(request, mod, true); + }; + } + require2.main = process.mainModule; + require2.extensions = Module2._extensions; + require2.cache = Module2._cache; + const dirname2 = path16.dirname(filename); + const compiledWrapper = self2._moduleCompile(filename, content); + const args = [mod.exports, require2, mod, filename, dirname2, process, global, Buffer]; + return compiledWrapper.apply(mod.exports, args); + }; } - write(data) { - const writeLen = data.length; - if (writeLen > this.blockRemain) { - throw new Error("writing more to entry than is appropriate"); + uninstall() { + Module2.prototype._compile = this._previousModuleCompile; + } + _moduleCompile(filename, content) { + var contLen = content.length; + if (contLen >= 2) { + if (content.charCodeAt(0) === 35 && content.charCodeAt(1) === 33) { + if (contLen === 2) { + content = ""; + } else { + var i = 2; + for (; i < contLen; ++i) { + var code2 = content.charCodeAt(i); + if (code2 === 10 || code2 === 13) break; + } + if (i === contLen) { + content = ""; + } else { + content = content.slice(i); + } + } + } } - const r = this.remain; - const br = this.blockRemain; - this.remain = Math.max(0, r - writeLen); - this.blockRemain = Math.max(0, br - writeLen); - if (this.ignore) { - return true; + var wrapper = Module2.wrap(content); + var invalidationKey = crypto.createHash("sha1").update(content, "utf8").digest("hex"); + var buffer = this._cacheStore.get(filename, invalidationKey); + var script = new vm.Script(wrapper, { + filename, + lineOffset: 0, + displayErrors: true, + cachedData: buffer, + produceCachedData: true + }); + if (script.cachedDataProduced) { + this._cacheStore.set(filename, invalidationKey, script.cachedData); + } else if (script.cachedDataRejected) { + this._cacheStore.delete(filename); } - if (r >= writeLen) { - return super.write(data); + var compiledWrapper = script.runInThisContext({ + filename, + lineOffset: 0, + columnOffset: 0, + displayErrors: true + }); + return compiledWrapper; + } + }; + function mkdirpSync(p_) { + _mkdirpSync(path16.resolve(p_), 511); + } + function _mkdirpSync(p, mode) { + try { + fs17.mkdirSync(p, mode); + } catch (err0) { + if (err0.code === "ENOENT") { + _mkdirpSync(path16.dirname(p)); + _mkdirpSync(p); + } else { + try { + const stat = fs17.statSync(p); + if (!stat.isDirectory()) { + throw err0; + } + } catch (err1) { + throw err0; + } } - return super.write(data.subarray(0, r)); } - #slurp(ex, gex = false) { - if (ex.path) - ex.path = normalizeWindowsPath(ex.path); - if (ex.linkpath) - ex.linkpath = normalizeWindowsPath(ex.linkpath); - Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { - return !(v === null || v === void 0 || k === "path" && gex); - }))); + } + function slashEscape(str) { + const ESCAPE_LOOKUP = { + "\\": "zB", + ":": "zC", + "/": "zS", + "\0": "z0", + "z": "zZ" + }; + const ESCAPE_REGEX = /[\\:/\x00z]/g; + return str.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]); + } + function supportsCachedData() { + const script = new vm.Script('""', { produceCachedData: true }); + return script.cachedDataProduced === true; + } + function getCacheDir() { + const v8_compile_cache_cache_dir = process.env.V8_COMPILE_CACHE_CACHE_DIR; + if (v8_compile_cache_cache_dir) { + return v8_compile_cache_cache_dir; } + const dirname2 = typeof process.getuid === "function" ? "v8-compile-cache-" + process.getuid() : "v8-compile-cache"; + const arch = process.arch; + const version2 = typeof process.versions.v8 === "string" ? process.versions.v8 : typeof process.versions.chakracore === "string" ? "chakracore-" + process.versions.chakracore : "node-" + process.version; + const cacheDir = path16.join(os3.tmpdir(), dirname2, arch, version2); + return cacheDir; + } + function getMainName() { + const mainName = require.main && typeof require.main.filename === "string" ? require.main.filename : process.cwd(); + return mainName; + } + if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { + const cacheDir = getCacheDir(); + const prefix = getMainName(); + const blobStore = new FileSystemBlobStore(cacheDir, prefix); + const nativeCompileCache = new NativeCompileCache(); + nativeCompileCache.setCacheStore(blobStore); + nativeCompileCache.install(); + process.once("exit", () => { + if (blobStore.isDirty()) { + blobStore.save(); + } + nativeCompileCache.uninstall(); + }); + } + module2.exports.__TEST__ = { + FileSystemBlobStore, + NativeCompileCache, + mkdirpSync, + slashEscape, + supportsCachedData, + getCacheDir, + getMainName }; } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/warn-method.js -var warnMethod; -var init_warn_method = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/warn-method.js"() { - warnMethod = (self2, code2, message, data = {}) => { - if (self2.file) { - data.file = self2.file; - } - if (self2.cwd) { - data.cwd = self2.cwd; - } - data.code = message instanceof Error && message.code || code2; - data.tarCode = code2; - if (!self2.strict && data.recoverable !== false) { - if (message instanceof Error) { - data = Object.assign(message, data); - message = message.message; - } - self2.emit("warn", code2, message, data); - } else if (message instanceof Error) { - self2.emit("error", Object.assign(message, data)); - } else { - self2.emit("error", Object.assign(new Error(`${code2}: ${message}`), data)); +// node_modules/semver/functions/satisfies.js +var require_satisfies = __commonJS({ + "node_modules/semver/functions/satisfies.js"(exports2, module2) { + "use strict"; + var Range3 = require_range(); + var satisfies = (version2, range, options) => { + try { + range = new Range3(range, options); + } catch (er) { + return false; } + return range.test(version2); }; + module2.exports = satisfies; } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/parse.js -var import_events3, maxMetaEntrySize, gzipHeader, zstdHeader, ZIP_HEADER_LEN, STATE, WRITEENTRY, READENTRY, NEXTENTRY, PROCESSENTRY, EX, GEX, META, EMITMETA, BUFFER2, QUEUE, ENDED, EMITTEDEND, EMIT, UNZIP, CONSUMECHUNK, CONSUMECHUNKSUB, CONSUMEBODY, CONSUMEMETA, CONSUMEHEADER, CONSUMING, BUFFERCONCAT, MAYBEEND, WRITING, ABORTED2, DONE, SAW_VALID_ENTRY, SAW_NULL_BLOCK, SAW_EOF, CLOSESTREAM, noop2, Parser; -var init_parse = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/parse.js"() { - import_events3 = require("events"); - init_esm3(); - init_header(); - init_pax(); - init_read_entry(); - init_warn_method(); - maxMetaEntrySize = 1024 * 1024; - gzipHeader = Buffer.from([31, 139]); - zstdHeader = Buffer.from([40, 181, 47, 253]); - ZIP_HEADER_LEN = Math.max(gzipHeader.length, zstdHeader.length); - STATE = /* @__PURE__ */ Symbol("state"); - WRITEENTRY = /* @__PURE__ */ Symbol("writeEntry"); - READENTRY = /* @__PURE__ */ Symbol("readEntry"); - NEXTENTRY = /* @__PURE__ */ Symbol("nextEntry"); - PROCESSENTRY = /* @__PURE__ */ Symbol("processEntry"); - EX = /* @__PURE__ */ Symbol("extendedHeader"); - GEX = /* @__PURE__ */ Symbol("globalExtendedHeader"); - META = /* @__PURE__ */ Symbol("meta"); - EMITMETA = /* @__PURE__ */ Symbol("emitMeta"); - BUFFER2 = /* @__PURE__ */ Symbol("buffer"); - QUEUE = /* @__PURE__ */ Symbol("queue"); - ENDED = /* @__PURE__ */ Symbol("ended"); - EMITTEDEND = /* @__PURE__ */ Symbol("emittedEnd"); - EMIT = /* @__PURE__ */ Symbol("emit"); - UNZIP = /* @__PURE__ */ Symbol("unzip"); - CONSUMECHUNK = /* @__PURE__ */ Symbol("consumeChunk"); - CONSUMECHUNKSUB = /* @__PURE__ */ Symbol("consumeChunkSub"); - CONSUMEBODY = /* @__PURE__ */ Symbol("consumeBody"); - CONSUMEMETA = /* @__PURE__ */ Symbol("consumeMeta"); - CONSUMEHEADER = /* @__PURE__ */ Symbol("consumeHeader"); - CONSUMING = /* @__PURE__ */ Symbol("consuming"); - BUFFERCONCAT = /* @__PURE__ */ Symbol("bufferConcat"); - MAYBEEND = /* @__PURE__ */ Symbol("maybeEnd"); - WRITING = /* @__PURE__ */ Symbol("writing"); - ABORTED2 = /* @__PURE__ */ Symbol("aborted"); - DONE = /* @__PURE__ */ Symbol("onDone"); - SAW_VALID_ENTRY = /* @__PURE__ */ Symbol("sawValidEntry"); - SAW_NULL_BLOCK = /* @__PURE__ */ Symbol("sawNullBlock"); - SAW_EOF = /* @__PURE__ */ Symbol("sawEOF"); - CLOSESTREAM = /* @__PURE__ */ Symbol("closeStream"); - noop2 = () => true; - Parser = class extends import_events3.EventEmitter { - file; - strict; - maxMetaEntrySize; - filter; - brotli; - zstd; - writable = true; - readable = false; - [QUEUE] = []; - [BUFFER2]; - [READENTRY]; - [WRITEENTRY]; - [STATE] = "begin"; - [META] = ""; - [EX]; - [GEX]; - [ENDED] = false; - [UNZIP]; - [ABORTED2] = false; - [SAW_VALID_ENTRY]; - [SAW_NULL_BLOCK] = false; - [SAW_EOF] = false; - [WRITING] = false; - [CONSUMING] = false; - [EMITTEDEND] = false; - constructor(opt = {}) { - super(); - this.file = opt.file || ""; - this.on(DONE, () => { - if (this[STATE] === "begin" || this[SAW_VALID_ENTRY] === false) { - this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format"); - } - }); - if (opt.ondone) { - this.on(DONE, opt.ondone); - } else { - this.on(DONE, () => { - this.emit("prefinish"); - this.emit("finish"); - this.emit("end"); - }); - } - this.strict = !!opt.strict; - this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize; - this.filter = typeof opt.filter === "function" ? opt.filter : noop2; - const isTBR = opt.file && (opt.file.endsWith(".tar.br") || opt.file.endsWith(".tbr")); - this.brotli = !(opt.gzip || opt.zstd) && opt.brotli !== void 0 ? opt.brotli : isTBR ? void 0 : false; - const isTZST = opt.file && (opt.file.endsWith(".tar.zst") || opt.file.endsWith(".tzst")); - this.zstd = !(opt.gzip || opt.brotli) && opt.zstd !== void 0 ? opt.zstd : isTZST ? true : void 0; - this.on("end", () => this[CLOSESTREAM]()); - if (typeof opt.onwarn === "function") { - this.on("warn", opt.onwarn); +// node_modules/which/node_modules/isexe/dist/commonjs/index.min.js +var require_index_min = __commonJS({ + "node_modules/which/node_modules/isexe/dist/commonjs/index.min.js"(exports2) { + "use strict"; + var a = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports); + var _ = a((i) => { + "use strict"; + Object.defineProperty(i, "__esModule", { value: true }); + i.sync = i.isexe = void 0; + var M = require("node:fs"), x = require("node:fs/promises"), q = async (t, e = {}) => { + let { ignoreErrors: r = false } = e; + try { + return d(await (0, x.stat)(t), e); + } catch (s) { + let n = s; + if (r || n.code === "EACCES") return false; + throw n; } - if (typeof opt.onReadEntry === "function") { - this.on("entry", opt.onReadEntry); + }; + i.isexe = q; + var m = (t, e = {}) => { + let { ignoreErrors: r = false } = e; + try { + return d((0, M.statSync)(t), e); + } catch (s) { + let n = s; + if (r || n.code === "EACCES") return false; + throw n; } - } - warn(code2, message, data = {}) { - warnMethod(this, code2, message, data); - } - [CONSUMEHEADER](chunk, position) { - if (this[SAW_VALID_ENTRY] === void 0) { - this[SAW_VALID_ENTRY] = false; + }; + i.sync = m; + var d = (t, e) => t.isFile() && A(t, e), A = (t, e) => { + let r = e.uid ?? process.getuid?.(), s = e.groups ?? process.getgroups?.() ?? [], n = e.gid ?? process.getgid?.() ?? s[0]; + if (r === void 0 || n === void 0) throw new Error("cannot get uid or gid"); + let u = /* @__PURE__ */ new Set([n, ...s]), c = t.mode, S = t.uid, P = t.gid, f = parseInt("100", 8), l = parseInt("010", 8), j = parseInt("001", 8), C = f | l; + return !!(c & j || c & l && u.has(P) || c & f && S === r || c & C && r === 0); + }; + }); + var g = a((o) => { + "use strict"; + Object.defineProperty(o, "__esModule", { value: true }); + o.sync = o.isexe = void 0; + var T = require("node:fs"), I = require("node:fs/promises"), D = require("node:path"), F = async (t, e = {}) => { + let { ignoreErrors: r = false } = e; + try { + return y(await (0, I.stat)(t), t, e); + } catch (s) { + let n = s; + if (r || n.code === "EACCES") return false; + throw n; } - let header; + }; + o.isexe = F; + var L = (t, e = {}) => { + let { ignoreErrors: r = false } = e; try { - header = new Header(chunk, position, this[EX], this[GEX]); - } catch (er) { - return this.warn("TAR_ENTRY_INVALID", er); + return y((0, T.statSync)(t), t, e); + } catch (s) { + let n = s; + if (r || n.code === "EACCES") return false; + throw n; } - if (header.nullBlock) { - if (this[SAW_NULL_BLOCK]) { - this[SAW_EOF] = true; - if (this[STATE] === "begin") { - this[STATE] = "header"; - } - this[EMIT]("eof"); - } else { - this[SAW_NULL_BLOCK] = true; - this[EMIT]("nullBlock"); - } - } else { - this[SAW_NULL_BLOCK] = false; - if (!header.cksumValid) { - this.warn("TAR_ENTRY_INVALID", "checksum failure", { header }); - } else if (!header.path) { - this.warn("TAR_ENTRY_INVALID", "path is required", { header }); - } else { - const type = header.type; - if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) { - this.warn("TAR_ENTRY_INVALID", "linkpath required", { - header - }); - } else if (!/^(Symbolic)?Link$/.test(type) && !/^(Global)?ExtendedHeader$/.test(type) && header.linkpath) { - this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { - header - }); - } else { - const entry = this[WRITEENTRY] = new ReadEntry(header, this[EX], this[GEX]); - if (!this[SAW_VALID_ENTRY]) { - if (entry.remain) { - const onend = () => { - if (!entry.invalid) { - this[SAW_VALID_ENTRY] = true; - } - }; - entry.on("end", onend); - } else { - this[SAW_VALID_ENTRY] = true; - } - } - if (entry.meta) { - if (entry.size > this.maxMetaEntrySize) { - entry.ignore = true; - this[EMIT]("ignoredEntry", entry); - this[STATE] = "ignore"; - entry.resume(); - } else if (entry.size > 0) { - this[META] = ""; - entry.on("data", (c) => this[META] += c); - this[STATE] = "meta"; - } - } else { - this[EX] = void 0; - entry.ignore = entry.ignore || !this.filter(entry.path, entry); - if (entry.ignore) { - this[EMIT]("ignoredEntry", entry); - this[STATE] = entry.remain ? "ignore" : "header"; - entry.resume(); - } else { - if (entry.remain) { - this[STATE] = "body"; - } else { - this[STATE] = "header"; - entry.end(); - } - if (!this[READENTRY]) { - this[QUEUE].push(entry); - this[NEXTENTRY](); - } else { - this[QUEUE].push(entry); - } - } - } - } - } + }; + o.sync = L; + var B = (t, e) => { + let { pathExt: r = process.env.PATHEXT || "" } = e, s = r.split(D.delimiter); + if (s.indexOf("") !== -1) return true; + for (let n of s) { + let u = n.toLowerCase(), c = t.substring(t.length - u.length).toLowerCase(); + if (u && c === u) return true; + } + return false; + }, y = (t, e, r) => t.isFile() && B(e, r); + }); + var p = a((h) => { + "use strict"; + Object.defineProperty(h, "__esModule", { value: true }); + }); + var v = exports2 && exports2.__createBinding || (Object.create ? (function(t, e, r, s) { + s === void 0 && (s = r); + var n = Object.getOwnPropertyDescriptor(e, r); + (!n || ("get" in n ? !e.__esModule : n.writable || n.configurable)) && (n = { enumerable: true, get: function() { + return e[r]; + } }), Object.defineProperty(t, s, n); + }) : (function(t, e, r, s) { + s === void 0 && (s = r), t[s] = e[r]; + })); + var G = exports2 && exports2.__setModuleDefault || (Object.create ? (function(t, e) { + Object.defineProperty(t, "default", { enumerable: true, value: e }); + }) : function(t, e) { + t.default = e; + }); + var w = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { + var t = function(e) { + return t = Object.getOwnPropertyNames || function(r) { + var s = []; + for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (s[s.length] = n); + return s; + }, t(e); + }; + return function(e) { + if (e && e.__esModule) return e; + var r = {}; + if (e != null) for (var s = t(e), n = 0; n < s.length; n++) s[n] !== "default" && v(r, e, s[n]); + return G(r, e), r; + }; + })(); + var X = exports2 && exports2.__exportStar || function(t, e) { + for (var r in t) r !== "default" && !Object.prototype.hasOwnProperty.call(e, r) && v(e, t, r); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sync = exports2.isexe = exports2.posix = exports2.win32 = void 0; + var E = w(_()); + exports2.posix = E; + var O = w(g()); + exports2.win32 = O; + X(p(), exports2); + var H = process.env._ISEXE_TEST_PLATFORM_ || process.platform; + var b = H === "win32" ? O : E; + exports2.isexe = b.isexe; + exports2.sync = b.sync; + } +}); + +// node_modules/which/lib/index.js +var require_lib = __commonJS({ + "node_modules/which/lib/index.js"(exports2, module2) { + var { isexe, sync: isexeSync } = require_index_min(); + var { join: join3, delimiter, sep, posix } = require("path"); + var isWindows4 = process.platform === "win32"; + var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1")); + var rRel = new RegExp(`^\\.${rSlash.source}`); + var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); + var getPathInfo = (cmd, { + path: optPath = process.env.PATH, + pathExt: optPathExt = process.env.PATHEXT, + delimiter: optDelimiter = delimiter + }) => { + const pathEnv = cmd.match(rSlash) ? [""] : [ + // windows always checks the cwd first + ...isWindows4 ? [process.cwd()] : [], + ...(optPath || /* istanbul ignore next: very unusual */ + "").split(optDelimiter) + ]; + if (isWindows4) { + const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter); + const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]); + if (cmd.includes(".") && pathExt[0] !== "") { + pathExt.unshift(""); } + return { pathEnv, pathExt, pathExtExe }; } - [CLOSESTREAM]() { - queueMicrotask(() => this.emit("close")); - } - [PROCESSENTRY](entry) { - let go = true; - if (!entry) { - this[READENTRY] = void 0; - go = false; - } else if (Array.isArray(entry)) { - const [ev, ...args] = entry; - this.emit(ev, ...args); - } else { - this[READENTRY] = entry; - this.emit("entry", entry); - if (!entry.emittedEnd) { - entry.on("end", () => this[NEXTENTRY]()); - go = false; - } - } - return go; - } - [NEXTENTRY]() { - do { - } while (this[PROCESSENTRY](this[QUEUE].shift())); - if (this[QUEUE].length === 0) { - const re = this[READENTRY]; - const drainNow = !re || re.flowing || re.size === re.remain; - if (drainNow) { - if (!this[WRITING]) { - this.emit("drain"); + return { pathEnv, pathExt: [""] }; + }; + var getPathPart = (raw2, cmd) => { + const pathPart = /^".*"$/.test(raw2) ? raw2.slice(1, -1) : raw2; + const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ""; + return prefix + join3(pathPart, cmd); + }; + var which3 = async (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); + const found = []; + for (const envPart of pathEnv) { + const p = getPathPart(envPart, cmd); + for (const ext of pathExt) { + const withExt = p + ext; + const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }); + if (is) { + if (!opt.all) { + return withExt; } - } else { - re.once("drain", () => this.emit("drain")); + found.push(withExt); } } } - [CONSUMEBODY](chunk, position) { - const entry = this[WRITEENTRY]; - if (!entry) { - throw new Error("attempt to consume body without entry??"); - } - const br = entry.blockRemain ?? 0; - const c = br >= chunk.length && position === 0 ? chunk : chunk.subarray(position, position + br); - entry.write(c); - if (!entry.blockRemain) { - this[STATE] = "header"; - this[WRITEENTRY] = void 0; - entry.end(); - } - return c.length; - } - [CONSUMEMETA](chunk, position) { - const entry = this[WRITEENTRY]; - const ret = this[CONSUMEBODY](chunk, position); - if (!this[WRITEENTRY] && entry) { - this[EMITMETA](entry); - } - return ret; - } - [EMIT](ev, data, extra) { - if (this[QUEUE].length === 0 && !this[READENTRY]) { - this.emit(ev, data, extra); - } else { - this[QUEUE].push([ev, data, extra]); - } - } - [EMITMETA](entry) { - this[EMIT]("meta", this[META]); - switch (entry.type) { - case "ExtendedHeader": - case "OldExtendedHeader": - this[EX] = Pax.parse(this[META], this[EX], false); - break; - case "GlobalExtendedHeader": - this[GEX] = Pax.parse(this[META], this[GEX], true); - break; - case "NextFileHasLongPath": - case "OldGnuLongPath": { - const ex = this[EX] ?? /* @__PURE__ */ Object.create(null); - this[EX] = ex; - ex.path = this[META].replace(/\0.*/, ""); - break; - } - case "NextFileHasLongLinkpath": { - const ex = this[EX] || /* @__PURE__ */ Object.create(null); - this[EX] = ex; - ex.linkpath = this[META].replace(/\0.*/, ""); - break; - } - /* c8 ignore start */ - default: - throw new Error("unknown meta: " + entry.type); - } + if (opt.all && found.length) { + return found; } - abort(error) { - this[ABORTED2] = true; - this.emit("abort", error); - this.warn("TAR_ABORT", error, { recoverable: false }); + if (opt.nothrow) { + return null; } - write(chunk, encoding, cb) { - if (typeof encoding === "function") { - cb = encoding; - encoding = void 0; - } - if (typeof chunk === "string") { - chunk = Buffer.from( - chunk, - /* c8 ignore next */ - typeof encoding === "string" ? encoding : "utf8" - ); - } - if (this[ABORTED2]) { - cb?.(); - return false; - } - const needSniff = this[UNZIP] === void 0 || this.brotli === void 0 && this[UNZIP] === false; - if (needSniff && chunk) { - if (this[BUFFER2]) { - chunk = Buffer.concat([this[BUFFER2], chunk]); - this[BUFFER2] = void 0; - } - if (chunk.length < ZIP_HEADER_LEN) { - this[BUFFER2] = chunk; - cb?.(); - return true; - } - for (let i = 0; this[UNZIP] === void 0 && i < gzipHeader.length; i++) { - if (chunk[i] !== gzipHeader[i]) { - this[UNZIP] = false; - } - } - let isZstd = false; - if (this[UNZIP] === false && this.zstd !== false) { - isZstd = true; - for (let i = 0; i < zstdHeader.length; i++) { - if (chunk[i] !== zstdHeader[i]) { - isZstd = false; - break; - } - } - } - const maybeBrotli = this.brotli === void 0 && !isZstd; - if (this[UNZIP] === false && maybeBrotli) { - if (chunk.length < 512) { - if (this[ENDED]) { - this.brotli = true; - } else { - this[BUFFER2] = chunk; - cb?.(); - return true; - } - } else { - try { - new Header(chunk.subarray(0, 512)); - this.brotli = false; - } catch (_) { - this.brotli = true; - } + throw getNotFoundError(cmd); + }; + var whichSync = (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); + const found = []; + for (const pathEnvPart of pathEnv) { + const p = getPathPart(pathEnvPart, cmd); + for (const ext of pathExt) { + const withExt = p + ext; + const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true }); + if (is) { + if (!opt.all) { + return withExt; } + found.push(withExt); } - if (this[UNZIP] === void 0 || this[UNZIP] === false && (this.brotli || isZstd)) { - const ended = this[ENDED]; - this[ENDED] = false; - this[UNZIP] = this[UNZIP] === void 0 ? new Unzip({}) : isZstd ? new ZstdDecompress({}) : new BrotliDecompress({}); - this[UNZIP].on("data", (chunk2) => this[CONSUMECHUNK](chunk2)); - this[UNZIP].on("error", (er) => this.abort(er)); - this[UNZIP].on("end", () => { - this[ENDED] = true; - this[CONSUMECHUNK](); - }); - this[WRITING] = true; - const ret2 = !!this[UNZIP][ended ? "end" : "write"](chunk); - this[WRITING] = false; - cb?.(); - return ret2; - } - } - this[WRITING] = true; - if (this[UNZIP]) { - this[UNZIP].write(chunk); - } else { - this[CONSUMECHUNK](chunk); - } - this[WRITING] = false; - const ret = this[QUEUE].length > 0 ? false : this[READENTRY] ? this[READENTRY].flowing : true; - if (!ret && this[QUEUE].length === 0) { - this[READENTRY]?.once("drain", () => this.emit("drain")); } - cb?.(); - return ret; } - [BUFFERCONCAT](c) { - if (c && !this[ABORTED2]) { - this[BUFFER2] = this[BUFFER2] ? Buffer.concat([this[BUFFER2], c]) : c; - } + if (opt.all && found.length) { + return found; } - [MAYBEEND]() { - if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED2] && !this[CONSUMING]) { - this[EMITTEDEND] = true; - const entry = this[WRITEENTRY]; - if (entry && entry.blockRemain) { - const have = this[BUFFER2] ? this[BUFFER2].length : 0; - this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${entry.blockRemain} more bytes, only ${have} available)`, { entry }); - if (this[BUFFER2]) { - entry.write(this[BUFFER2]); - } - entry.end(); - } - this[EMIT](DONE); - } - } - [CONSUMECHUNK](chunk) { - if (this[CONSUMING] && chunk) { - this[BUFFERCONCAT](chunk); - } else if (!chunk && !this[BUFFER2]) { - this[MAYBEEND](); - } else if (chunk) { - this[CONSUMING] = true; - if (this[BUFFER2]) { - this[BUFFERCONCAT](chunk); - const c = this[BUFFER2]; - this[BUFFER2] = void 0; - this[CONSUMECHUNKSUB](c); - } else { - this[CONSUMECHUNKSUB](chunk); - } - while (this[BUFFER2] && this[BUFFER2]?.length >= 512 && !this[ABORTED2] && !this[SAW_EOF]) { - const c = this[BUFFER2]; - this[BUFFER2] = void 0; - this[CONSUMECHUNKSUB](c); - } - this[CONSUMING] = false; - } - if (!this[BUFFER2] || this[ENDED]) { - this[MAYBEEND](); - } - } - [CONSUMECHUNKSUB](chunk) { - let position = 0; - const length = chunk.length; - while (position + 512 <= length && !this[ABORTED2] && !this[SAW_EOF]) { - switch (this[STATE]) { - case "begin": - case "header": - this[CONSUMEHEADER](chunk, position); - position += 512; - break; - case "ignore": - case "body": - position += this[CONSUMEBODY](chunk, position); - break; - case "meta": - position += this[CONSUMEMETA](chunk, position); - break; - /* c8 ignore start */ - default: - throw new Error("invalid state: " + this[STATE]); - } - } - if (position < length) { - this[BUFFER2] = this[BUFFER2] ? Buffer.concat([chunk.subarray(position), this[BUFFER2]]) : chunk.subarray(position); - } - } - end(chunk, encoding, cb) { - if (typeof chunk === "function") { - cb = chunk; - encoding = void 0; - chunk = void 0; - } - if (typeof encoding === "function") { - cb = encoding; - encoding = void 0; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - if (cb) - this.once("finish", cb); - if (!this[ABORTED2]) { - if (this[UNZIP]) { - if (chunk) - this[UNZIP].write(chunk); - this[UNZIP].end(); - } else { - this[ENDED] = true; - if (this.brotli === void 0 || this.zstd === void 0) - chunk = chunk || Buffer.alloc(0); - if (chunk) - this.write(chunk); - this[MAYBEEND](); - } - } - return this; + if (opt.nothrow) { + return null; } + throw getNotFoundError(cmd); }; + module2.exports = which3; + which3.sync = whichSync; } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/strip-trailing-slashes.js -var stripTrailingSlashes; -var init_strip_trailing_slashes = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/strip-trailing-slashes.js"() { - stripTrailingSlashes = (str) => { - let i = str.length - 1; - let slashesStart = -1; - while (i > -1 && str.charAt(i) === "/") { - slashesStart = i; - i--; +// node_modules/is-windows/index.js +var require_is_windows = __commonJS({ + "node_modules/is-windows/index.js"(exports2, module2) { + (function(factory) { + if (exports2 && typeof exports2 === "object" && typeof module2 !== "undefined") { + module2.exports = factory(); + } else if (typeof define === "function" && define.amd) { + define([], factory); + } else if (typeof window !== "undefined") { + window.isWindows = factory(); + } else if (typeof global !== "undefined") { + global.isWindows = factory(); + } else if (typeof self !== "undefined") { + self.isWindows = factory(); + } else { + this.isWindows = factory(); } - return slashesStart === -1 ? str : str.slice(0, slashesStart); - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/list.js -var list_exports = {}; -__export(list_exports, { - filesFilter: () => filesFilter, - list: () => list -}); -var import_node_fs, import_path2, onReadEntryFunction, filesFilter, listFileSync, listFile, list; -var init_list = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/list.js"() { - init_esm2(); - import_node_fs = __toESM(require("node:fs"), 1); - import_path2 = require("path"); - init_make_command(); - init_parse(); - init_strip_trailing_slashes(); - onReadEntryFunction = (opt) => { - const onReadEntry = opt.onReadEntry; - opt.onReadEntry = onReadEntry ? (e) => { - onReadEntry(e); - e.resume(); - } : (e) => e.resume(); - }; - filesFilter = (opt, files) => { - const map = new Map(files.map((f) => [stripTrailingSlashes(f), true])); - const filter = opt.filter; - const mapHas = (file, r = "") => { - const root = r || (0, import_path2.parse)(file).root || "."; - let ret; - if (file === root) - ret = false; - else { - const m = map.get(file); - ret = m !== void 0 ? m : mapHas((0, import_path2.dirname)(file), root); - } - map.set(file, ret); - return ret; + })(function() { + "use strict"; + return function isWindows4() { + return process && (process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE)); }; - opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(stripTrailingSlashes(file)) : (file) => mapHas(stripTrailingSlashes(file)); - }; - listFileSync = (opt) => { - const p = new Parser(opt); - const file = opt.file; - let fd; - try { - fd = import_node_fs.default.openSync(file, "r"); - const stat = import_node_fs.default.fstatSync(fd); - const readSize = opt.maxReadSize || 16 * 1024 * 1024; - if (stat.size < readSize) { - const buf = Buffer.allocUnsafe(stat.size); - const read = import_node_fs.default.readSync(fd, buf, 0, stat.size, 0); - p.end(read === buf.byteLength ? buf : buf.subarray(0, read)); - } else { - let pos2 = 0; - const buf = Buffer.allocUnsafe(readSize); - while (pos2 < stat.size) { - const bytesRead = import_node_fs.default.readSync(fd, buf, 0, readSize, pos2); - if (bytesRead === 0) - break; - pos2 += bytesRead; - p.write(buf.subarray(0, bytesRead)); - } - p.end(); - } - } finally { - if (typeof fd === "number") { - try { - import_node_fs.default.closeSync(fd); - } catch { - } - } - } - }; - listFile = (opt, _files) => { - const parse4 = new Parser(opt); - const readSize = opt.maxReadSize || 16 * 1024 * 1024; - const file = opt.file; - const p = new Promise((resolve, reject) => { - parse4.on("error", reject); - parse4.on("end", resolve); - import_node_fs.default.stat(file, (er, stat) => { - if (er) { - reject(er); - } else { - const stream = new ReadStream(file, { - readSize, - size: stat.size - }); - stream.on("error", reject); - stream.pipe(parse4); - } - }); - }); - return p; - }; - list = makeCommand(listFileSync, listFile, (opt) => new Parser(opt), (opt) => new Parser(opt), (opt, files) => { - if (files?.length) - filesFilter(opt, files); - if (!opt.noResume) - onReadEntryFunction(opt); }); } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/get-write-flag.js -var import_fs3, platform2, isWindows, O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP, fMapEnabled, fMapLimit, fMapFlag, noFollowFlag, getWriteFlag; -var init_get_write_flag = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/get-write-flag.js"() { - import_fs3 = __toESM(require("fs"), 1); - platform2 = process.env.__FAKE_PLATFORM__ || process.platform; - isWindows = platform2 === "win32"; - ({ O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY } = import_fs3.default.constants); - UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) || import_fs3.default.constants.UV_FS_O_FILEMAP || 0; - fMapEnabled = isWindows && !!UV_FS_O_FILEMAP; - fMapLimit = 512 * 1024; - fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY; - noFollowFlag = !isWindows && typeof O_NOFOLLOW === "number" ? O_NOFOLLOW | O_TRUNC | O_CREAT | O_WRONLY : null; - getWriteFlag = noFollowFlag !== null ? () => noFollowFlag : !fMapEnabled ? () => "w" : (size) => size < fMapLimit ? fMapFlag : "w"; +// node_modules/cmd-extension/index.js +var require_cmd_extension = __commonJS({ + "node_modules/cmd-extension/index.js"(exports2, module2) { + "use strict"; + var path16 = require("path"); + var cmdExtension; + if (process.env.PATHEXT) { + cmdExtension = process.env.PATHEXT.split(path16.delimiter).find((ext) => ext.toUpperCase() === ".CMD"); + } + module2.exports = cmdExtension || ".cmd"; } }); -// .yarn/cache/chownr-npm-3.0.0-5275e85d25-43925b8770.zip/node_modules/chownr/dist/esm/index.js -var import_node_fs2, import_node_path3, lchownSync, chown, chownrKid, chownr, chownrKidSync, chownrSync; -var init_esm4 = __esm({ - ".yarn/cache/chownr-npm-3.0.0-5275e85d25-43925b8770.zip/node_modules/chownr/dist/esm/index.js"() { - import_node_fs2 = __toESM(require("node:fs"), 1); - import_node_path3 = __toESM(require("node:path"), 1); - lchownSync = (path16, uid, gid) => { - try { - return import_node_fs2.default.lchownSync(path16, uid, gid); - } catch (er) { - if (er?.code !== "ENOENT") - throw er; - } - }; - chown = (cpath, uid, gid, cb) => { - import_node_fs2.default.lchown(cpath, uid, gid, (er) => { - cb(er && er?.code !== "ENOENT" ? er : null); - }); - }; - chownrKid = (p, child, uid, gid, cb) => { - if (child.isDirectory()) { - chownr(import_node_path3.default.resolve(p, child.name), uid, gid, (er) => { - if (er) - return cb(er); - const cpath = import_node_path3.default.resolve(p, child.name); - chown(cpath, uid, gid, cb); - }); - } else { - const cpath = import_node_path3.default.resolve(p, child.name); - chown(cpath, uid, gid, cb); - } +// node_modules/graceful-fs/polyfills.js +var require_polyfills = __commonJS({ + "node_modules/graceful-fs/polyfills.js"(exports2, module2) { + var constants2 = require("constants"); + var origCwd = process.cwd; + var cwd = null; + var platform5 = process.env.GRACEFUL_FS_PLATFORM || process.platform; + process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process); + return cwd; }; - chownr = (p, uid, gid, cb) => { - import_node_fs2.default.readdir(p, { withFileTypes: true }, (er, children) => { - if (er) { - if (er.code === "ENOENT") - return cb(); - else if (er.code !== "ENOTDIR" && er.code !== "ENOTSUP") - return cb(er); - } - if (er || !children.length) - return chown(p, uid, gid, cb); - let len = children.length; - let errState = null; - const then = (er2) => { - if (errState) - return; - if (er2) - return cb(errState = er2); - if (--len === 0) - return chown(p, uid, gid, cb); - }; - for (const child of children) { - chownrKid(p, child, uid, gid, then); - } - }); - }; - chownrKidSync = (p, child, uid, gid) => { - if (child.isDirectory()) - chownrSync(import_node_path3.default.resolve(p, child.name), uid, gid); - lchownSync(import_node_path3.default.resolve(p, child.name), uid, gid); - }; - chownrSync = (p, uid, gid) => { - let children; - try { - children = import_node_fs2.default.readdirSync(p, { withFileTypes: true }); - } catch (er) { - const e = er; - if (e?.code === "ENOENT") - return; - else if (e?.code === "ENOTDIR" || e?.code === "ENOTSUP") - return lchownSync(p, uid, gid); - else - throw e; - } - for (const child of children) { - chownrKidSync(p, child, uid, gid); - } - return lchownSync(p, uid, gid); - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/cwd-error.js -var CwdError; -var init_cwd_error = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/cwd-error.js"() { - CwdError = class extends Error { - path; - code; - syscall = "chdir"; - constructor(path16, code2) { - super(`${code2}: Cannot cd into '${path16}'`); - this.path = path16; - this.code = code2; - } - get name() { - return "CwdError"; - } - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/symlink-error.js -var SymlinkError; -var init_symlink_error = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/symlink-error.js"() { - SymlinkError = class extends Error { - path; - symlink; - syscall = "symlink"; - code = "TAR_SYMLINK_ERROR"; - constructor(symlink, path16) { - super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"); - this.symlink = symlink; - this.path = path16; - } - get name() { - return "SymlinkError"; - } - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/mkdir.js -var import_node_fs3, import_promises, import_node_path4, checkCwd, mkdir, mkdir_, onmkdir, checkCwdSync, mkdirSync2; -var init_mkdir = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/mkdir.js"() { - init_esm4(); - import_node_fs3 = __toESM(require("node:fs"), 1); - import_promises = __toESM(require("node:fs/promises"), 1); - import_node_path4 = __toESM(require("node:path"), 1); - init_cwd_error(); - init_normalize_windows_path(); - init_symlink_error(); - checkCwd = (dir, cb) => { - import_node_fs3.default.stat(dir, (er, st) => { - if (er || !st.isDirectory()) { - er = new CwdError(dir, er?.code || "ENOTDIR"); - } - cb(er); - }); - }; - mkdir = (dir, opt, cb) => { - dir = normalizeWindowsPath(dir); - const umask2 = opt.umask ?? 18; - const mode = opt.mode | 448; - const needChmod = (mode & umask2) !== 0; - const uid = opt.uid; - const gid = opt.gid; - const doChown = typeof uid === "number" && typeof gid === "number" && (uid !== opt.processUid || gid !== opt.processGid); - const preserve = opt.preserve; - const unlink = opt.unlink; - const cwd = normalizeWindowsPath(opt.cwd); - const done = (er, created) => { - if (er) { - cb(er); - } else { - if (created && doChown) { - chownr(created, uid, gid, (er2) => done(er2)); - } else if (needChmod) { - import_node_fs3.default.chmod(dir, mode, cb); - } else { - cb(); - } - } + try { + process.cwd(); + } catch (er) { + } + if (typeof process.chdir === "function") { + chdir = process.chdir; + process.chdir = function(d) { + cwd = null; + chdir.call(process, d); }; - if (dir === cwd) { - return checkCwd(dir, done); + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); + } + var chdir; + module2.exports = patch; + function patch(fs17) { + if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs17); } - if (preserve) { - return import_promises.default.mkdir(dir, { mode, recursive: true }).then( - (made) => done(null, made ?? void 0), - // oh, ts - done - ); + if (!fs17.lutimes) { + patchLutimes(fs17); } - const sub = normalizeWindowsPath(import_node_path4.default.relative(cwd, dir)); - const parts = sub.split("/"); - mkdir_(cwd, parts, mode, unlink, cwd, void 0, done); - }; - mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => { - if (parts.length === 0) { - return cb(null, created); + fs17.chown = chownFix(fs17.chown); + fs17.fchown = chownFix(fs17.fchown); + fs17.lchown = chownFix(fs17.lchown); + fs17.chmod = chmodFix(fs17.chmod); + fs17.fchmod = chmodFix(fs17.fchmod); + fs17.lchmod = chmodFix(fs17.lchmod); + fs17.chownSync = chownFixSync(fs17.chownSync); + fs17.fchownSync = chownFixSync(fs17.fchownSync); + fs17.lchownSync = chownFixSync(fs17.lchownSync); + fs17.chmodSync = chmodFixSync(fs17.chmodSync); + fs17.fchmodSync = chmodFixSync(fs17.fchmodSync); + fs17.lchmodSync = chmodFixSync(fs17.lchmodSync); + fs17.stat = statFix(fs17.stat); + fs17.fstat = statFix(fs17.fstat); + fs17.lstat = statFix(fs17.lstat); + fs17.statSync = statFixSync(fs17.statSync); + fs17.fstatSync = statFixSync(fs17.fstatSync); + fs17.lstatSync = statFixSync(fs17.lstatSync); + if (fs17.chmod && !fs17.lchmod) { + fs17.lchmod = function(path16, mode, cb) { + if (cb) process.nextTick(cb); + }; + fs17.lchmodSync = function() { + }; } - const p = parts.shift(); - const part = normalizeWindowsPath(import_node_path4.default.resolve(base + "/" + p)); - import_node_fs3.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb)); - }; - onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => { - if (er) { - import_node_fs3.default.lstat(part, (statEr, st) => { - if (statEr) { - statEr.path = statEr.path && normalizeWindowsPath(statEr.path); - cb(statEr); - } else if (st.isDirectory()) { - mkdir_(part, parts, mode, unlink, cwd, created, cb); - } else if (unlink) { - import_node_fs3.default.unlink(part, (er2) => { - if (er2) { - return cb(er2); + if (fs17.chown && !fs17.lchown) { + fs17.lchown = function(path16, uid, gid, cb) { + if (cb) process.nextTick(cb); + }; + fs17.lchownSync = function() { + }; + } + if (platform5 === "win32") { + fs17.rename = typeof fs17.rename !== "function" ? fs17.rename : (function(fs$rename) { + function rename(from, to, cb) { + var start = Date.now(); + var backoff = 0; + fs$rename(from, to, function CB(er) { + if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { + setTimeout(function() { + fs17.stat(to, function(stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er); + }); + }, backoff); + if (backoff < 100) + backoff += 10; + return; } - import_node_fs3.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb)); + if (cb) cb(er); }); - } else if (st.isSymbolicLink()) { - return cb(new SymlinkError(part, part + "/" + parts.join("/"))); - } else { - cb(er); } - }); - } else { - created = created || part; - mkdir_(part, parts, mode, unlink, cwd, created, cb); - } - }; - checkCwdSync = (dir) => { - let ok = false; - let code2; - try { - ok = import_node_fs3.default.statSync(dir).isDirectory(); - } catch (er) { - code2 = er?.code; - } finally { - if (!ok) { - throw new CwdError(dir, code2 ?? "ENOTDIR"); - } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); + return rename; + })(fs17.rename); } - }; - mkdirSync2 = (dir, opt) => { - dir = normalizeWindowsPath(dir); - const umask2 = opt.umask ?? 18; - const mode = opt.mode | 448; - const needChmod = (mode & umask2) !== 0; - const uid = opt.uid; - const gid = opt.gid; - const doChown = typeof uid === "number" && typeof gid === "number" && (uid !== opt.processUid || gid !== opt.processGid); - const preserve = opt.preserve; - const unlink = opt.unlink; - const cwd = normalizeWindowsPath(opt.cwd); - const done = (created2) => { - if (created2 && doChown) { - chownrSync(created2, uid, gid); + fs17.read = typeof fs17.read !== "function" ? fs17.read : (function(fs$read) { + function read(fd, buffer, offset, length, position, callback_) { + var callback; + if (callback_ && typeof callback_ === "function") { + var eagCounter = 0; + callback = function(er, _, __) { + if (er && er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + return fs$read.call(fs17, fd, buffer, offset, length, position, callback); + } + callback_.apply(this, arguments); + }; + } + return fs$read.call(fs17, fd, buffer, offset, length, position, callback); } - if (needChmod) { - import_node_fs3.default.chmodSync(dir, mode); + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); + return read; + })(fs17.read); + fs17.readSync = typeof fs17.readSync !== "function" ? fs17.readSync : /* @__PURE__ */ (function(fs$readSync) { + return function(fd, buffer, offset, length, position) { + var eagCounter = 0; + while (true) { + try { + return fs$readSync.call(fs17, fd, buffer, offset, length, position); + } catch (er) { + if (er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + continue; + } + throw er; + } + } + }; + })(fs17.readSync); + function patchLchmod(fs18) { + fs18.lchmod = function(path16, mode, callback) { + fs18.open( + path16, + constants2.O_WRONLY | constants2.O_SYMLINK, + mode, + function(err, fd) { + if (err) { + if (callback) callback(err); + return; + } + fs18.fchmod(fd, mode, function(err2) { + fs18.close(fd, function(err22) { + if (callback) callback(err2 || err22); + }); + }); + } + ); + }; + fs18.lchmodSync = function(path16, mode) { + var fd = fs18.openSync(path16, constants2.O_WRONLY | constants2.O_SYMLINK, mode); + var threw = true; + var ret; + try { + ret = fs18.fchmodSync(fd, mode); + threw = false; + } finally { + if (threw) { + try { + fs18.closeSync(fd); + } catch (er) { + } + } else { + fs18.closeSync(fd); + } + } + return ret; + }; + } + function patchLutimes(fs18) { + if (constants2.hasOwnProperty("O_SYMLINK") && fs18.futimes) { + fs18.lutimes = function(path16, at, mt, cb) { + fs18.open(path16, constants2.O_SYMLINK, function(er, fd) { + if (er) { + if (cb) cb(er); + return; + } + fs18.futimes(fd, at, mt, function(er2) { + fs18.close(fd, function(er22) { + if (cb) cb(er2 || er22); + }); + }); + }); + }; + fs18.lutimesSync = function(path16, at, mt) { + var fd = fs18.openSync(path16, constants2.O_SYMLINK); + var ret; + var threw = true; + try { + ret = fs18.futimesSync(fd, at, mt); + threw = false; + } finally { + if (threw) { + try { + fs18.closeSync(fd); + } catch (er) { + } + } else { + fs18.closeSync(fd); + } + } + return ret; + }; + } else if (fs18.futimes) { + fs18.lutimes = function(_a, _b, _c, cb) { + if (cb) process.nextTick(cb); + }; + fs18.lutimesSync = function() { + }; } - }; - if (dir === cwd) { - checkCwdSync(cwd); - return done(); } - if (preserve) { - return done(import_node_fs3.default.mkdirSync(dir, { mode, recursive: true }) ?? void 0); + function chmodFix(orig) { + if (!orig) return orig; + return function(target, mode, cb) { + return orig.call(fs17, target, mode, function(er) { + if (chownErOk(er)) er = null; + if (cb) cb.apply(this, arguments); + }); + }; } - const sub = normalizeWindowsPath(import_node_path4.default.relative(cwd, dir)); - const parts = sub.split("/"); - let created; - for (let p = parts.shift(), part = cwd; p && (part += "/" + p); p = parts.shift()) { - part = normalizeWindowsPath(import_node_path4.default.resolve(part)); - try { - import_node_fs3.default.mkdirSync(part, mode); - created = created || part; - } catch { - const st = import_node_fs3.default.lstatSync(part); - if (st.isDirectory()) { - continue; - } else if (unlink) { - import_node_fs3.default.unlinkSync(part); - import_node_fs3.default.mkdirSync(part, mode); - created = created || part; - continue; - } else if (st.isSymbolicLink()) { - return new SymlinkError(part, part + "/" + parts.join("/")); + function chmodFixSync(orig) { + if (!orig) return orig; + return function(target, mode) { + try { + return orig.call(fs17, target, mode); + } catch (er) { + if (!chownErOk(er)) throw er; } - } + }; } - return done(created); - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/strip-absolute-path.js -var import_node_path5, isAbsolute, parse3, stripAbsolutePath; -var init_strip_absolute_path = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/strip-absolute-path.js"() { - import_node_path5 = require("node:path"); - ({ isAbsolute, parse: parse3 } = import_node_path5.win32); - stripAbsolutePath = (path16) => { - let r = ""; - let parsed = parse3(path16); - while (isAbsolute(path16) || parsed.root) { - const root = path16.charAt(0) === "/" && path16.slice(0, 4) !== "//?/" ? "/" : parsed.root; - path16 = path16.slice(root.length); - r += root; - parsed = parse3(path16); + function chownFix(orig) { + if (!orig) return orig; + return function(target, uid, gid, cb) { + return orig.call(fs17, target, uid, gid, function(er) { + if (chownErOk(er)) er = null; + if (cb) cb.apply(this, arguments); + }); + }; } - return [r, path16]; - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/winchars.js -var raw, win, toWin, toRaw, encode2, decode; -var init_winchars = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/winchars.js"() { - raw = ["|", "<", ">", "?", ":"]; - win = raw.map((char) => String.fromCodePoint(61440 + Number(char.codePointAt(0)))); - toWin = new Map(raw.map((char, i) => [char, win[i]])); - toRaw = new Map(win.map((char, i) => [char, raw[i]])); - encode2 = (s) => raw.reduce((s2, c) => s2.split(c).join(toWin.get(c)), s); - decode = (s) => win.reduce((s2, c) => s2.split(c).join(toRaw.get(c)), s); + function chownFixSync(orig) { + if (!orig) return orig; + return function(target, uid, gid) { + try { + return orig.call(fs17, target, uid, gid); + } catch (er) { + if (!chownErOk(er)) throw er; + } + }; + } + function statFix(orig) { + if (!orig) return orig; + return function(target, options, cb) { + if (typeof options === "function") { + cb = options; + options = null; + } + function callback(er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 4294967296; + if (stats.gid < 0) stats.gid += 4294967296; + } + if (cb) cb.apply(this, arguments); + } + return options ? orig.call(fs17, target, options, callback) : orig.call(fs17, target, callback); + }; + } + function statFixSync(orig) { + if (!orig) return orig; + return function(target, options) { + var stats = options ? orig.call(fs17, target, options) : orig.call(fs17, target); + if (stats) { + if (stats.uid < 0) stats.uid += 4294967296; + if (stats.gid < 0) stats.gid += 4294967296; + } + return stats; + }; + } + function chownErOk(er) { + if (!er) + return true; + if (er.code === "ENOSYS") + return true; + var nonroot = !process.getuid || process.getuid() !== 0; + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true; + } + return false; + } + } } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/normalize-unicode.js -var normalizeCache, MAX, cache, normalizeUnicode; -var init_normalize_unicode = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/normalize-unicode.js"() { - normalizeCache = /* @__PURE__ */ Object.create(null); - MAX = 1e4; - cache = /* @__PURE__ */ new Set(); - normalizeUnicode = (s) => { - if (!cache.has(s)) { - normalizeCache[s] = s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"); - } else { - cache.delete(s); - } - cache.add(s); - const ret = normalizeCache[s]; - let i = cache.size - MAX; - if (i > MAX / 10) { - for (const s2 of cache) { - cache.delete(s2); - delete normalizeCache[s2]; - if (--i <= 0) - break; - } - } - return ret; - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/path-reservations.js -var import_node_path6, platform3, isWindows2, getDirs, PathReservations; -var init_path_reservations = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/path-reservations.js"() { - import_node_path6 = require("node:path"); - init_normalize_unicode(); - init_strip_trailing_slashes(); - platform3 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; - isWindows2 = platform3 === "win32"; - getDirs = (path16) => { - const dirs = path16.split("/").slice(0, -1).reduce((set, path17) => { - const s = set.at(-1); - if (s !== void 0) { - path17 = (0, import_node_path6.join)(s, path17); +// node_modules/graceful-fs/legacy-streams.js +var require_legacy_streams = __commonJS({ + "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { + var Stream2 = require("stream").Stream; + module2.exports = legacy; + function legacy(fs17) { + return { + ReadStream: ReadStream2, + WriteStream: WriteStream2 + }; + function ReadStream2(path16, options) { + if (!(this instanceof ReadStream2)) return new ReadStream2(path16, options); + Stream2.call(this); + var self2 = this; + this.path = path16; + this.fd = null; + this.readable = true; + this.paused = false; + this.flags = "r"; + this.mode = 438; + this.bufferSize = 64 * 1024; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; } - set.push(path17 || "/"); - return set; - }, []); - return dirs; - }; - PathReservations = class { - // path => [function or Set] - // A Set object means a directory reservation - // A fn is a direct reservation on that path - #queues = /* @__PURE__ */ new Map(); - // fn => {paths:[path,...], dirs:[path, ...]} - #reservations = /* @__PURE__ */ new Map(); - // functions currently running - #running = /* @__PURE__ */ new Set(); - reserve(paths, fn2) { - paths = isWindows2 ? ["win32 parallelization disabled"] : paths.map((p) => { - return stripTrailingSlashes((0, import_node_path6.join)(normalizeUnicode(p))); - }); - const dirs = new Set(paths.map((path16) => getDirs(path16)).reduce((a, b) => a.concat(b))); - this.#reservations.set(fn2, { dirs, paths }); - for (const p of paths) { - const q = this.#queues.get(p); - if (!q) { - this.#queues.set(p, [fn2]); - } else { - q.push(fn2); + if (this.encoding) this.setEncoding(this.encoding); + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); } - } - for (const dir of dirs) { - const q = this.#queues.get(dir); - if (!q) { - this.#queues.set(dir, [/* @__PURE__ */ new Set([fn2])]); - } else { - const l = q.at(-1); - if (l instanceof Set) { - l.add(fn2); - } else { - q.push(/* @__PURE__ */ new Set([fn2])); - } + if (this.end === void 0) { + this.end = Infinity; + } else if ("number" !== typeof this.end) { + throw TypeError("end must be a Number"); } + if (this.start > this.end) { + throw new Error("start must be <= end"); + } + this.pos = this.start; } - return this.#run(fn2); - } - // return the queues for each path the function cares about - // fn => {paths, dirs} - #getQueues(fn2) { - const res = this.#reservations.get(fn2); - if (!res) { - throw new Error("function does not have any path reservations"); - } - return { - paths: res.paths.map((path16) => this.#queues.get(path16)), - dirs: [...res.dirs].map((path16) => this.#queues.get(path16)) - }; - } - // check if fn is first in line for all its paths, and is - // included in the first set for all its dir queues - check(fn2) { - const { paths, dirs } = this.#getQueues(fn2); - return paths.every((q) => q && q[0] === fn2) && dirs.every((q) => q && q[0] instanceof Set && q[0].has(fn2)); - } - // run the function if it's first in line and not already running - #run(fn2) { - if (this.#running.has(fn2) || !this.check(fn2)) { - return false; + if (this.fd !== null) { + process.nextTick(function() { + self2._read(); + }); + return; } - this.#running.add(fn2); - fn2(() => this.#clear(fn2)); - return true; + fs17.open(this.path, this.flags, this.mode, function(err, fd) { + if (err) { + self2.emit("error", err); + self2.readable = false; + return; + } + self2.fd = fd; + self2.emit("open", fd); + self2._read(); + }); } - #clear(fn2) { - if (!this.#running.has(fn2)) { - return false; - } - const res = this.#reservations.get(fn2); - if (!res) { - throw new Error("invalid reservation"); + function WriteStream2(path16, options) { + if (!(this instanceof WriteStream2)) return new WriteStream2(path16, options); + Stream2.call(this); + this.path = path16; + this.fd = null; + this.writable = true; + this.flags = "w"; + this.encoding = "binary"; + this.mode = 438; + this.bytesWritten = 0; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; } - const { paths, dirs } = res; - const next = /* @__PURE__ */ new Set(); - for (const path16 of paths) { - const q = this.#queues.get(path16); - if (!q || q?.[0] !== fn2) { - continue; - } - const q0 = q[1]; - if (!q0) { - this.#queues.delete(path16); - continue; + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); } - q.shift(); - if (typeof q0 === "function") { - next.add(q0); - } else { - for (const f of q0) { - next.add(f); - } + if (this.start < 0) { + throw new Error("start must be >= zero"); } + this.pos = this.start; } - for (const dir of dirs) { - const q = this.#queues.get(dir); - const q0 = q?.[0]; - if (!q || !(q0 instanceof Set)) - continue; - if (q0.size === 1 && q.length === 1) { - this.#queues.delete(dir); - continue; - } else if (q0.size === 1) { - q.shift(); - const n = q[0]; - if (typeof n === "function") { - next.add(n); - } - } else { - q0.delete(fn2); - } + this.busy = false; + this._queue = []; + if (this.fd === null) { + this._open = fs17.open; + this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); + this.flush(); } - this.#running.delete(fn2); - next.forEach((fn3) => this.#run(fn3)); - return true; } - }; + } } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/process-umask.js -var umask; -var init_process_umask = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/process-umask.js"() { - umask = () => process.umask(); +// node_modules/graceful-fs/clone.js +var require_clone = __commonJS({ + "node_modules/graceful-fs/clone.js"(exports2, module2) { + "use strict"; + module2.exports = clone; + var getPrototypeOf = Object.getPrototypeOf || function(obj) { + return obj.__proto__; + }; + function clone(obj) { + if (obj === null || typeof obj !== "object") + return obj; + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) }; + else + var copy = /* @__PURE__ */ Object.create(null); + Object.getOwnPropertyNames(obj).forEach(function(key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); + }); + return copy; + } } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/unpack.js -var import_node_assert, import_node_crypto, import_node_fs4, import_node_path7, ONENTRY, CHECKFS, CHECKFS2, ISREUSABLE, MAKEFS, FILE, DIRECTORY, LINK, SYMLINK, HARDLINK, ENSURE_NO_SYMLINK, UNSUPPORTED, CHECKPATH, STRIPABSOLUTEPATH, MKDIR, ONERROR, PENDING, PEND, UNPEND, ENDED2, MAYBECLOSE, SKIP, DOCHOWN, UID, GID, CHECKED_CWD, platform4, isWindows3, DEFAULT_MAX_DEPTH, unlinkFile, unlinkFileSync, uint32, Unpack, callSync, UnpackSync; -var init_unpack = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/unpack.js"() { - init_esm2(); - import_node_assert = __toESM(require("node:assert"), 1); - import_node_crypto = require("node:crypto"); - import_node_fs4 = __toESM(require("node:fs"), 1); - import_node_path7 = __toESM(require("node:path"), 1); - init_get_write_flag(); - init_mkdir(); - init_normalize_windows_path(); - init_parse(); - init_strip_absolute_path(); - init_winchars(); - init_path_reservations(); - init_symlink_error(); - init_process_umask(); - ONENTRY = /* @__PURE__ */ Symbol("onEntry"); - CHECKFS = /* @__PURE__ */ Symbol("checkFs"); - CHECKFS2 = /* @__PURE__ */ Symbol("checkFs2"); - ISREUSABLE = /* @__PURE__ */ Symbol("isReusable"); - MAKEFS = /* @__PURE__ */ Symbol("makeFs"); - FILE = /* @__PURE__ */ Symbol("file"); - DIRECTORY = /* @__PURE__ */ Symbol("directory"); - LINK = /* @__PURE__ */ Symbol("link"); - SYMLINK = /* @__PURE__ */ Symbol("symlink"); - HARDLINK = /* @__PURE__ */ Symbol("hardlink"); - ENSURE_NO_SYMLINK = /* @__PURE__ */ Symbol("ensureNoSymlink"); - UNSUPPORTED = /* @__PURE__ */ Symbol("unsupported"); - CHECKPATH = /* @__PURE__ */ Symbol("checkPath"); - STRIPABSOLUTEPATH = /* @__PURE__ */ Symbol("stripAbsolutePath"); - MKDIR = /* @__PURE__ */ Symbol("mkdir"); - ONERROR = /* @__PURE__ */ Symbol("onError"); - PENDING = /* @__PURE__ */ Symbol("pending"); - PEND = /* @__PURE__ */ Symbol("pend"); - UNPEND = /* @__PURE__ */ Symbol("unpend"); - ENDED2 = /* @__PURE__ */ Symbol("ended"); - MAYBECLOSE = /* @__PURE__ */ Symbol("maybeClose"); - SKIP = /* @__PURE__ */ Symbol("skip"); - DOCHOWN = /* @__PURE__ */ Symbol("doChown"); - UID = /* @__PURE__ */ Symbol("uid"); - GID = /* @__PURE__ */ Symbol("gid"); - CHECKED_CWD = /* @__PURE__ */ Symbol("checkedCwd"); - platform4 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; - isWindows3 = platform4 === "win32"; - DEFAULT_MAX_DEPTH = 1024; - unlinkFile = (path16, cb) => { - if (!isWindows3) { - return import_node_fs4.default.unlink(path16, cb); - } - const name2 = path16 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex"); - import_node_fs4.default.rename(path16, name2, (er) => { - if (er) { - return cb(er); +// node_modules/graceful-fs/graceful-fs.js +var require_graceful_fs = __commonJS({ + "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { + var fs17 = require("fs"); + var polyfills = require_polyfills(); + var legacy = require_legacy_streams(); + var clone = require_clone(); + var util = require("util"); + var gracefulQueue; + var previousSymbol; + if (typeof Symbol === "function" && typeof Symbol.for === "function") { + gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"); + previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous"); + } else { + gracefulQueue = "___graceful-fs.queue"; + previousSymbol = "___graceful-fs.previous"; + } + function noop3() { + } + function publishQueue(context, queue2) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue2; } - import_node_fs4.default.unlink(name2, cb); }); - }; - unlinkFileSync = (path16) => { - if (!isWindows3) { - return import_node_fs4.default.unlinkSync(path16); - } - const name2 = path16 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex"); - import_node_fs4.default.renameSync(path16, name2); - import_node_fs4.default.unlinkSync(name2); - }; - uint32 = (a, b, c) => a !== void 0 && a === a >>> 0 ? a : b !== void 0 && b === b >>> 0 ? b : c; - Unpack = class extends Parser { - [ENDED2] = false; - [CHECKED_CWD] = false; - [PENDING] = 0; - reservations = new PathReservations(); - transform; - writable = true; - readable = false; - uid; - gid; - setOwner; - preserveOwner; - processGid; - processUid; - maxDepth; - forceChown; - win32; - newer; - keep; - noMtime; - preservePaths; - unlink; - cwd; - strip; - processUmask; - umask; - dmode; - fmode; - chmod; - constructor(opt = {}) { - opt.ondone = () => { - this[ENDED2] = true; - this[MAYBECLOSE](); - }; - super(opt); - this.transform = opt.transform; - this.chmod = !!opt.chmod; - if (typeof opt.uid === "number" || typeof opt.gid === "number") { - if (typeof opt.uid !== "number" || typeof opt.gid !== "number") { - throw new TypeError("cannot set owner without number uid and gid"); - } - if (opt.preserveOwner) { - throw new TypeError("cannot preserve owner in archive and also set owner explicitly"); - } - this.uid = opt.uid; - this.gid = opt.gid; - this.setOwner = true; - } else { - this.uid = void 0; - this.gid = void 0; - this.setOwner = false; + } + var debug = noop3; + if (util.debuglog) + debug = util.debuglog("gfs4"); + else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) + debug = function() { + var m = util.format.apply(util, arguments); + m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); + console.error(m); + }; + if (!fs17[gracefulQueue]) { + queue = global[gracefulQueue] || []; + publishQueue(fs17, queue); + fs17.close = (function(fs$close) { + function close(fd, cb) { + return fs$close.call(fs17, fd, function(err) { + if (!err) { + resetQueue(); + } + if (typeof cb === "function") + cb.apply(this, arguments); + }); } - this.preserveOwner = opt.preserveOwner === void 0 && typeof opt.uid !== "number" ? !!(process.getuid && process.getuid() === 0) : !!opt.preserveOwner; - this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0; - this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0; - this.maxDepth = typeof opt.maxDepth === "number" ? opt.maxDepth : DEFAULT_MAX_DEPTH; - this.forceChown = opt.forceChown === true; - this.win32 = !!opt.win32 || isWindows3; - this.newer = !!opt.newer; - this.keep = !!opt.keep; - this.noMtime = !!opt.noMtime; - this.preservePaths = !!opt.preservePaths; - this.unlink = !!opt.unlink; - this.cwd = normalizeWindowsPath(import_node_path7.default.resolve(opt.cwd || process.cwd())); - this.strip = Number(opt.strip) || 0; - this.processUmask = !this.chmod ? 0 : typeof opt.processUmask === "number" ? opt.processUmask : umask(); - this.umask = typeof opt.umask === "number" ? opt.umask : this.processUmask; - this.dmode = opt.dmode || 511 & ~this.umask; - this.fmode = opt.fmode || 438 & ~this.umask; - this.on("entry", (entry) => this[ONENTRY](entry)); + Object.defineProperty(close, previousSymbol, { + value: fs$close + }); + return close; + })(fs17.close); + fs17.closeSync = (function(fs$closeSync) { + function closeSync(fd) { + fs$closeSync.apply(fs17, arguments); + resetQueue(); + } + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }); + return closeSync; + })(fs17.closeSync); + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { + process.on("exit", function() { + debug(fs17[gracefulQueue]); + require("assert").equal(fs17[gracefulQueue].length, 0); + }); } - // a bad or damaged archive is a warning for Parser, but an error - // when extracting. Mark those errors as unrecoverable, because - // the Unpack contract cannot be met. - warn(code2, msg, data = {}) { - if (code2 === "TAR_BAD_ARCHIVE" || code2 === "TAR_ABORT") { - data.recoverable = false; + } + var queue; + if (!global[gracefulQueue]) { + publishQueue(global, fs17[gracefulQueue]); + } + module2.exports = patch(clone(fs17)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs17.__patched) { + module2.exports = patch(fs17); + fs17.__patched = true; + } + function patch(fs18) { + polyfills(fs18); + fs18.gracefulify = patch; + fs18.createReadStream = createReadStream; + fs18.createWriteStream = createWriteStream; + var fs$readFile = fs18.readFile; + fs18.readFile = readFile; + function readFile(path16, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$readFile(path16, options, cb); + function go$readFile(path17, options2, cb2, startTime) { + return fs$readFile(path17, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$readFile, [path17, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); } - return super.warn(code2, msg, data); } - [MAYBECLOSE]() { - if (this[ENDED2] && this[PENDING] === 0) { - this.emit("prefinish"); - this.emit("finish"); - this.emit("end"); + var fs$writeFile = fs18.writeFile; + fs18.writeFile = writeFile; + function writeFile(path16, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$writeFile(path16, data, options, cb); + function go$writeFile(path17, data2, options2, cb2, startTime) { + return fs$writeFile(path17, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$writeFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); } } - // return false if we need to skip this file - // return true if the field was successfully sanitized - [STRIPABSOLUTEPATH](entry, field) { - const p = entry[field]; - const { type } = entry; - if (!p || this.preservePaths) - return true; - const [root, stripped] = stripAbsolutePath(p); - const parts = stripped.replaceAll(/\\/g, "/").split("/"); - if (parts.includes("..") || /* c8 ignore next */ - isWindows3 && /^[a-z]:\.\.$/i.test(parts[0] ?? "")) { - if (field === "path" || type === "Link") { - this.warn("TAR_ENTRY_ERROR", `${field} contains '..'`, { - entry, - [field]: p - }); - return false; - } - const entryDir = import_node_path7.default.posix.dirname(entry.path); - const resolved = import_node_path7.default.posix.normalize(import_node_path7.default.posix.join(entryDir, parts.join("/"))); - if (resolved.startsWith("../") || resolved === "..") { - this.warn("TAR_ENTRY_ERROR", `${field} escapes extraction directory`, { - entry, - [field]: p - }); - return false; - } - } - if (root) { - entry[field] = String(stripped); - this.warn("TAR_ENTRY_INFO", `stripping ${root} from absolute ${field}`, { - entry, - [field]: p - }); - } - return true; - } - // no IO, just string checking for absolute indicators - [CHECKPATH](entry) { - const p = normalizeWindowsPath(entry.path); - const parts = p.split("/"); - if (this.strip) { - if (parts.length < this.strip) { - return false; - } - if (entry.type === "Link") { - const linkparts = normalizeWindowsPath(String(entry.linkpath)).split("/"); - if (linkparts.length >= this.strip) { - entry.linkpath = linkparts.slice(this.strip).join("/"); - } else { - return false; + var fs$appendFile = fs18.appendFile; + if (fs$appendFile) + fs18.appendFile = appendFile; + function appendFile(path16, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$appendFile(path16, data, options, cb); + function go$appendFile(path17, data2, options2, cb2, startTime) { + return fs$appendFile(path17, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$appendFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); } - } - parts.splice(0, this.strip); - entry.path = parts.join("/"); - } - if (isFinite(this.maxDepth) && parts.length > this.maxDepth) { - this.warn("TAR_ENTRY_ERROR", "path excessively deep", { - entry, - path: p, - depth: parts.length, - maxDepth: this.maxDepth - }); - return false; - } - if (!this[STRIPABSOLUTEPATH](entry, "path") || !this[STRIPABSOLUTEPATH](entry, "linkpath")) { - return false; - } - entry.absolute = import_node_path7.default.isAbsolute(entry.path) ? normalizeWindowsPath(import_node_path7.default.resolve(entry.path)) : normalizeWindowsPath(import_node_path7.default.resolve(this.cwd, entry.path)); - if (!this.preservePaths && typeof entry.absolute === "string" && entry.absolute.indexOf(this.cwd + "/") !== 0 && entry.absolute !== this.cwd) { - this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { - entry, - path: normalizeWindowsPath(entry.path), - resolvedPath: entry.absolute, - cwd: this.cwd }); - return false; - } - if (entry.absolute === this.cwd && entry.type !== "Directory" && entry.type !== "GNUDumpDir") { - return false; - } - if (this.win32) { - const { root: aRoot } = import_node_path7.default.win32.parse(String(entry.absolute)); - entry.absolute = aRoot + encode2(String(entry.absolute).slice(aRoot.length)); - const { root: pRoot } = import_node_path7.default.win32.parse(entry.path); - entry.path = pRoot + encode2(entry.path.slice(pRoot.length)); } - return true; } - [ONENTRY](entry) { - if (!this[CHECKPATH](entry)) { - return entry.resume(); + var fs$copyFile = fs18.copyFile; + if (fs$copyFile) + fs18.copyFile = copyFile; + function copyFile(src, dest, flags, cb) { + if (typeof flags === "function") { + cb = flags; + flags = 0; } - import_node_assert.default.equal(typeof entry.absolute, "string"); - switch (entry.type) { - case "Directory": - case "GNUDumpDir": - if (entry.mode) { - entry.mode = entry.mode | 448; + return go$copyFile(src, dest, flags, cb); + function go$copyFile(src2, dest2, flags2, cb2, startTime) { + return fs$copyFile(src2, dest2, flags2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); } - // eslint-disable-next-line no-fallthrough - case "File": - case "OldFile": - case "ContiguousFile": - case "Link": - case "SymbolicLink": - return this[CHECKFS](entry); - case "CharacterDevice": - case "BlockDevice": - case "FIFO": - default: - return this[UNSUPPORTED](entry); - } - } - [ONERROR](er, entry) { - if (er.name === "CwdError") { - this.emit("error", er); - } else { - this.warn("TAR_ENTRY_ERROR", er, { entry }); - this[UNPEND](); - entry.resume(); + }); } } - [MKDIR](dir, mode, cb) { - mkdir(normalizeWindowsPath(dir), { - uid: this.uid, - gid: this.gid, - processUid: this.processUid, - processGid: this.processGid, - umask: this.processUmask, - preserve: this.preservePaths, - unlink: this.unlink, - cwd: this.cwd, - mode - }, cb); - } - [DOCHOWN](entry) { - return this.forceChown || this.preserveOwner && (typeof entry.uid === "number" && entry.uid !== this.processUid || typeof entry.gid === "number" && entry.gid !== this.processGid) || typeof this.uid === "number" && this.uid !== this.processUid || typeof this.gid === "number" && this.gid !== this.processGid; - } - [UID](entry) { - return uint32(this.uid, entry.uid, this.processUid); - } - [GID](entry) { - return uint32(this.gid, entry.gid, this.processGid); - } - [FILE](entry, fullyDone) { - const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.fmode; - const stream = new WriteStream(String(entry.absolute), { - // slight lie, but it can be numeric flags - flags: getWriteFlag(entry.size), - mode, - autoClose: false - }); - stream.on("error", (er) => { - if (stream.fd) { - import_node_fs4.default.close(stream.fd, () => { - }); - } - stream.write = () => true; - this[ONERROR](er, entry); - fullyDone(); - }); - let actions = 1; - const done = (er) => { - if (er) { - if (stream.fd) { - import_node_fs4.default.close(stream.fd, () => { - }); - } - this[ONERROR](er, entry); - fullyDone(); - return; - } - if (--actions === 0) { - if (stream.fd !== void 0) { - import_node_fs4.default.close(stream.fd, (er2) => { - if (er2) { - this[ONERROR](er2, entry); - } else { - this[UNPEND](); - } - fullyDone(); - }); - } - } + var fs$readdir = fs18.readdir; + fs18.readdir = readdir; + var noReaddirOptionVersions = /^v[0-5]\./; + function readdir(path16, options, cb) { + if (typeof options === "function") + cb = options, options = null; + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path17, options2, cb2, startTime) { + return fs$readdir(path17, fs$readdirCallback( + path17, + options2, + cb2, + startTime + )); + } : function go$readdir2(path17, options2, cb2, startTime) { + return fs$readdir(path17, options2, fs$readdirCallback( + path17, + options2, + cb2, + startTime + )); }; - stream.on("finish", () => { - const abs = String(entry.absolute); - const fd = stream.fd; - if (typeof fd === "number" && entry.mtime && !this.noMtime) { - actions++; - const atime = entry.atime || /* @__PURE__ */ new Date(); - const mtime = entry.mtime; - import_node_fs4.default.futimes(fd, atime, mtime, (er) => er ? import_node_fs4.default.utimes(abs, atime, mtime, (er2) => done(er2 && er)) : done()); - } - if (typeof fd === "number" && this[DOCHOWN](entry)) { - actions++; - const uid = this[UID](entry); - const gid = this[GID](entry); - if (typeof uid === "number" && typeof gid === "number") { - import_node_fs4.default.fchown(fd, uid, gid, (er) => er ? import_node_fs4.default.chown(abs, uid, gid, (er2) => done(er2 && er)) : done()); + return go$readdir(path16, options, cb); + function fs$readdirCallback(path17, options2, cb2, startTime) { + return function(err, files) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([ + go$readdir, + [path17, options2, cb2], + err, + startTime || Date.now(), + Date.now() + ]); + else { + if (files && files.sort) + files.sort(); + if (typeof cb2 === "function") + cb2.call(this, err, files); } - } - done(); - }); - const tx = this.transform ? this.transform(entry) || entry : entry; - if (tx !== entry) { - tx.on("error", (er) => { - this[ONERROR](er, entry); - fullyDone(); - }); - entry.pipe(tx); + }; } - tx.pipe(stream); } - [DIRECTORY](entry, fullyDone) { - const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.dmode; - this[MKDIR](String(entry.absolute), mode, (er) => { - if (er) { - this[ONERROR](er, entry); - fullyDone(); - return; - } - let actions = 1; - const done = () => { - if (--actions === 0) { - fullyDone(); - this[UNPEND](); - entry.resume(); - } - }; - if (entry.mtime && !this.noMtime) { - actions++; - import_node_fs4.default.utimes(String(entry.absolute), entry.atime || /* @__PURE__ */ new Date(), entry.mtime, done); - } - if (this[DOCHOWN](entry)) { - actions++; - import_node_fs4.default.chown(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry)), done); - } - done(); - }); - } - [UNSUPPORTED](entry) { - entry.unsupported = true; - this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${entry.type}`, { entry }); - entry.resume(); - } - [SYMLINK](entry, done) { - const parts = normalizeWindowsPath(import_node_path7.default.relative(this.cwd, import_node_path7.default.resolve(import_node_path7.default.dirname(String(entry.absolute)), String(entry.linkpath)))).split("/"); - this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, String(entry.linkpath), "symlink", done), (er) => { - this[ONERROR](er, entry); - done(); - }); - } - [HARDLINK](entry, done) { - const linkpath = normalizeWindowsPath(import_node_path7.default.resolve(this.cwd, String(entry.linkpath))); - const parts = normalizeWindowsPath(String(entry.linkpath)).split("/"); - this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, linkpath, "link", done), (er) => { - this[ONERROR](er, entry); - done(); - }); - } - [ENSURE_NO_SYMLINK](entry, cwd, parts, done, onError) { - const p = parts.shift(); - if (this.preservePaths || p === void 0) - return done(); - const t = import_node_path7.default.resolve(cwd, p); - import_node_fs4.default.lstat(t, (er, st) => { - if (er) - return done(); - if (st?.isSymbolicLink()) { - return onError(new SymlinkError(t, import_node_path7.default.resolve(t, parts.join("/")))); - } - this[ENSURE_NO_SYMLINK](entry, t, parts, done, onError); - }); - } - [PEND]() { - this[PENDING]++; - } - [UNPEND]() { - this[PENDING]--; - this[MAYBECLOSE](); - } - [SKIP](entry) { - this[UNPEND](); - entry.resume(); - } - // Check if we can reuse an existing filesystem entry safely and - // overwrite it, rather than unlinking and recreating - // Windows doesn't report a useful nlink, so we just never reuse entries - [ISREUSABLE](entry, st) { - return entry.type === "File" && !this.unlink && st.isFile() && st.nlink <= 1 && !isWindows3; - } - // check if a thing is there, and if so, try to clobber it - [CHECKFS](entry) { - this[PEND](); - const paths = [entry.path]; - if (entry.linkpath) { - paths.push(entry.linkpath); - } - this.reservations.reserve(paths, (done) => this[CHECKFS2](entry, done)); - } - [CHECKFS2](entry, fullyDone) { - const done = (er) => { - fullyDone(er); - }; - const checkCwd2 = () => { - this[MKDIR](this.cwd, this.dmode, (er) => { - if (er) { - this[ONERROR](er, entry); - done(); - return; - } - this[CHECKED_CWD] = true; - start(); - }); - }; - const start = () => { - if (entry.absolute !== this.cwd) { - const parent = normalizeWindowsPath(import_node_path7.default.dirname(String(entry.absolute))); - if (parent !== this.cwd) { - return this[MKDIR](parent, this.dmode, (er) => { - if (er) { - this[ONERROR](er, entry); - done(); - return; - } - afterMakeParent(); - }); - } - } - afterMakeParent(); - }; - const afterMakeParent = () => { - import_node_fs4.default.lstat(String(entry.absolute), (lstatEr, st) => { - if (st && (this.keep || /* c8 ignore next */ - this.newer && st.mtime > (entry.mtime ?? st.mtime))) { - this[SKIP](entry); - done(); - return; - } - if (lstatEr || this[ISREUSABLE](entry, st)) { - return this[MAKEFS](null, entry, done); - } - if (st.isDirectory()) { - if (entry.type === "Directory") { - const needChmod = this.chmod && entry.mode && (st.mode & 4095) !== entry.mode; - const afterChmod = (er) => this[MAKEFS](er ?? null, entry, done); - if (!needChmod) { - return afterChmod(); - } - return import_node_fs4.default.chmod(String(entry.absolute), Number(entry.mode), afterChmod); - } - if (entry.absolute !== this.cwd) { - return import_node_fs4.default.rmdir(String(entry.absolute), (er) => this[MAKEFS](er ?? null, entry, done)); - } - } - if (entry.absolute === this.cwd) { - return this[MAKEFS](null, entry, done); - } - unlinkFile(String(entry.absolute), (er) => this[MAKEFS](er ?? null, entry, done)); - }); - }; - if (this[CHECKED_CWD]) { - start(); - } else { - checkCwd2(); - } - } - [MAKEFS](er, entry, done) { - if (er) { - this[ONERROR](er, entry); - done(); - return; - } - switch (entry.type) { - case "File": - case "OldFile": - case "ContiguousFile": - return this[FILE](entry, done); - case "Link": - return this[HARDLINK](entry, done); - case "SymbolicLink": - return this[SYMLINK](entry, done); - case "Directory": - case "GNUDumpDir": - return this[DIRECTORY](entry, done); - } - } - [LINK](entry, linkpath, link, done) { - import_node_fs4.default[link](linkpath, String(entry.absolute), (er) => { - if (er) { - this[ONERROR](er, entry); - } else { - this[UNPEND](); - entry.resume(); - } - done(); - }); - } - }; - callSync = (fn2) => { - try { - return [null, fn2()]; - } catch (er) { - return [er, null]; - } - }; - UnpackSync = class extends Unpack { - sync = true; - [MAKEFS](er, entry) { - return super[MAKEFS](er, entry, () => { - }); - } - [CHECKFS](entry) { - if (!this[CHECKED_CWD]) { - const er2 = this[MKDIR](this.cwd, this.dmode); - if (er2) { - return this[ONERROR](er2, entry); - } - this[CHECKED_CWD] = true; - } - if (entry.absolute !== this.cwd) { - const parent = normalizeWindowsPath(import_node_path7.default.dirname(String(entry.absolute))); - if (parent !== this.cwd) { - const mkParent = this[MKDIR](parent, this.dmode); - if (mkParent) { - return this[ONERROR](mkParent, entry); - } - } - } - const [lstatEr, st] = callSync(() => import_node_fs4.default.lstatSync(String(entry.absolute))); - if (st && (this.keep || /* c8 ignore next */ - this.newer && st.mtime > (entry.mtime ?? st.mtime))) { - return this[SKIP](entry); - } - if (lstatEr || this[ISREUSABLE](entry, st)) { - return this[MAKEFS](null, entry); - } - if (st.isDirectory()) { - if (entry.type === "Directory") { - const needChmod = this.chmod && entry.mode && (st.mode & 4095) !== entry.mode; - const [er3] = needChmod ? callSync(() => { - import_node_fs4.default.chmodSync(String(entry.absolute), Number(entry.mode)); - }) : []; - return this[MAKEFS](er3, entry); - } - const [er2] = callSync(() => import_node_fs4.default.rmdirSync(String(entry.absolute))); - this[MAKEFS](er2, entry); - } - const [er] = entry.absolute === this.cwd ? [] : callSync(() => unlinkFileSync(String(entry.absolute))); - this[MAKEFS](er, entry); - } - [FILE](entry, done) { - const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.fmode; - const oner = (er) => { - let closeError; - try { - import_node_fs4.default.closeSync(fd); - } catch (e) { - closeError = e; - } - if (er || closeError) { - this[ONERROR](er || closeError, entry); - } - done(); - }; - let fd; - try { - fd = import_node_fs4.default.openSync(String(entry.absolute), getWriteFlag(entry.size), mode); - } catch (er) { - return oner(er); - } - const tx = this.transform ? this.transform(entry) || entry : entry; - if (tx !== entry) { - tx.on("error", (er) => this[ONERROR](er, entry)); - entry.pipe(tx); - } - tx.on("data", (chunk) => { - try { - import_node_fs4.default.writeSync(fd, chunk, 0, chunk.length); - } catch (er) { - oner(er); - } - }); - tx.on("end", () => { - let er = null; - if (entry.mtime && !this.noMtime) { - const atime = entry.atime || /* @__PURE__ */ new Date(); - const mtime = entry.mtime; - try { - import_node_fs4.default.futimesSync(fd, atime, mtime); - } catch (futimeser) { - try { - import_node_fs4.default.utimesSync(String(entry.absolute), atime, mtime); - } catch { - er = futimeser; - } - } - } - if (this[DOCHOWN](entry)) { - const uid = this[UID](entry); - const gid = this[GID](entry); - try { - import_node_fs4.default.fchownSync(fd, Number(uid), Number(gid)); - } catch (fchowner) { - try { - import_node_fs4.default.chownSync(String(entry.absolute), Number(uid), Number(gid)); - } catch { - er = er || fchowner; - } - } - } - oner(er); - }); - } - [DIRECTORY](entry, done) { - const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.dmode; - const er = this[MKDIR](String(entry.absolute), mode); - if (er) { - this[ONERROR](er, entry); - done(); - return; - } - if (entry.mtime && !this.noMtime) { - try { - import_node_fs4.default.utimesSync(String(entry.absolute), entry.atime || /* @__PURE__ */ new Date(), entry.mtime); - } catch { - } - } - if (this[DOCHOWN](entry)) { - try { - import_node_fs4.default.chownSync(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry))); - } catch { - } - } - done(); - entry.resume(); - } - [MKDIR](dir, mode) { - try { - return mkdirSync2(normalizeWindowsPath(dir), { - uid: this.uid, - gid: this.gid, - processUid: this.processUid, - processGid: this.processGid, - umask: this.processUmask, - preserve: this.preservePaths, - unlink: this.unlink, - cwd: this.cwd, - mode - }); - } catch (er) { - return er; - } - } - [ENSURE_NO_SYMLINK](_entry, cwd, parts, done, onError) { - if (this.preservePaths || parts.length === 0) - return done(); - let t = cwd; - for (const p of parts) { - t = import_node_path7.default.resolve(t, p); - const [er, st] = callSync(() => import_node_fs4.default.lstatSync(t)); - if (er) - return done(); - if (st.isSymbolicLink()) { - return onError(new SymlinkError(t, import_node_path7.default.resolve(cwd, parts.join("/")))); - } - } - done(); - } - [LINK](entry, linkpath, link, done) { - const linkSync = `${link}Sync`; - try { - import_node_fs4.default[linkSync](linkpath, String(entry.absolute)); - done(); - entry.resume(); - } catch (er) { - return this[ONERROR](er, entry); - } - } - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/extract.js -var extract_exports = {}; -__export(extract_exports, { - extract: () => extract -}); -var import_node_fs5, extractFileSync, extractFile, extract; -var init_extract = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/extract.js"() { - init_esm2(); - import_node_fs5 = __toESM(require("node:fs"), 1); - init_list(); - init_make_command(); - init_unpack(); - extractFileSync = (opt) => { - const u = new UnpackSync(opt); - const file = opt.file; - const stat = import_node_fs5.default.statSync(file); - const readSize = opt.maxReadSize || 16 * 1024 * 1024; - const stream = new ReadStreamSync(file, { - readSize, - size: stat.size - }); - stream.pipe(u); - }; - extractFile = (opt, _) => { - const u = new Unpack(opt); - const readSize = opt.maxReadSize || 16 * 1024 * 1024; - const file = opt.file; - const p = new Promise((resolve, reject) => { - u.on("error", reject); - u.on("close", resolve); - import_node_fs5.default.stat(file, (er, stat) => { - if (er) { - reject(er); - } else { - const stream = new ReadStream(file, { - readSize, - size: stat.size - }); - stream.on("error", reject); - stream.pipe(u); - } - }); - }); - return p; - }; - extract = makeCommand(extractFileSync, extractFile, (opt) => new UnpackSync(opt), (opt) => new Unpack(opt), (opt, files) => { - if (files?.length) - filesFilter(opt, files); - }); - } -}); - -// .yarn/cache/v8-compile-cache-npm-2.4.0-5979f8e405-3878511925.zip/node_modules/v8-compile-cache/v8-compile-cache.js -var require_v8_compile_cache = __commonJS({ - ".yarn/cache/v8-compile-cache-npm-2.4.0-5979f8e405-3878511925.zip/node_modules/v8-compile-cache/v8-compile-cache.js"(exports2, module2) { - "use strict"; - var Module2 = require("module"); - var crypto = require("crypto"); - var fs17 = require("fs"); - var path16 = require("path"); - var vm = require("vm"); - var os3 = require("os"); - var hasOwnProperty = Object.prototype.hasOwnProperty; - var FileSystemBlobStore = class { - constructor(directory, prefix) { - const name2 = prefix ? slashEscape(prefix + ".") : ""; - this._blobFilename = path16.join(directory, name2 + "BLOB"); - this._mapFilename = path16.join(directory, name2 + "MAP"); - this._lockFilename = path16.join(directory, name2 + "LOCK"); - this._directory = directory; - this._load(); - } - has(key, invalidationKey) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - return this._invalidationKeys[key] === invalidationKey; - } else if (hasOwnProperty.call(this._storedMap, key)) { - return this._storedMap[key][0] === invalidationKey; - } - return false; - } - get(key, invalidationKey) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - if (this._invalidationKeys[key] === invalidationKey) { - return this._memoryBlobs[key]; - } - } else if (hasOwnProperty.call(this._storedMap, key)) { - const mapping = this._storedMap[key]; - if (mapping[0] === invalidationKey) { - return this._storedBlob.slice(mapping[1], mapping[2]); - } - } - } - set(key, invalidationKey, buffer) { - this._invalidationKeys[key] = invalidationKey; - this._memoryBlobs[key] = buffer; - this._dirty = true; - } - delete(key) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - this._dirty = true; - delete this._memoryBlobs[key]; - } - if (hasOwnProperty.call(this._invalidationKeys, key)) { - this._dirty = true; - delete this._invalidationKeys[key]; - } - if (hasOwnProperty.call(this._storedMap, key)) { - this._dirty = true; - delete this._storedMap[key]; - } - } - isDirty() { - return this._dirty; - } - save() { - const dump = this._getDump(); - const blobToStore = Buffer.concat(dump[0]); - const mapToStore = JSON.stringify(dump[1]); - try { - mkdirpSync(this._directory); - fs17.writeFileSync(this._lockFilename, "LOCK", { flag: "wx" }); - } catch (error) { - return false; - } - try { - fs17.writeFileSync(this._blobFilename, blobToStore); - fs17.writeFileSync(this._mapFilename, mapToStore); - } finally { - fs17.unlinkSync(this._lockFilename); - } - return true; - } - _load() { - try { - this._storedBlob = fs17.readFileSync(this._blobFilename); - this._storedMap = JSON.parse(fs17.readFileSync(this._mapFilename)); - } catch (e) { - this._storedBlob = Buffer.alloc(0); - this._storedMap = {}; - } - this._dirty = false; - this._memoryBlobs = {}; - this._invalidationKeys = {}; - } - _getDump() { - const buffers = []; - const newMap = {}; - let offset = 0; - function push2(key, invalidationKey, buffer) { - buffers.push(buffer); - newMap[key] = [invalidationKey, offset, offset + buffer.length]; - offset += buffer.length; - } - for (const key of Object.keys(this._memoryBlobs)) { - const buffer = this._memoryBlobs[key]; - const invalidationKey = this._invalidationKeys[key]; - push2(key, invalidationKey, buffer); - } - for (const key of Object.keys(this._storedMap)) { - if (hasOwnProperty.call(newMap, key)) continue; - const mapping = this._storedMap[key]; - const buffer = this._storedBlob.slice(mapping[1], mapping[2]); - push2(key, mapping[0], buffer); - } - return [buffers, newMap]; - } - }; - var NativeCompileCache = class { - constructor() { - this._cacheStore = null; - this._previousModuleCompile = null; - } - setCacheStore(cacheStore) { - this._cacheStore = cacheStore; - } - install() { - const self2 = this; - const hasRequireResolvePaths = typeof require.resolve.paths === "function"; - this._previousModuleCompile = Module2.prototype._compile; - Module2.prototype._compile = function(content, filename) { - const mod = this; - function require2(id) { - return mod.require(id); - } - function resolve(request, options) { - return Module2._resolveFilename(request, mod, false, options); - } - require2.resolve = resolve; - if (hasRequireResolvePaths) { - resolve.paths = function paths(request) { - return Module2._resolveLookupPaths(request, mod, true); - }; - } - require2.main = process.mainModule; - require2.extensions = Module2._extensions; - require2.cache = Module2._cache; - const dirname2 = path16.dirname(filename); - const compiledWrapper = self2._moduleCompile(filename, content); - const args = [mod.exports, require2, mod, filename, dirname2, process, global, Buffer]; - return compiledWrapper.apply(mod.exports, args); - }; - } - uninstall() { - Module2.prototype._compile = this._previousModuleCompile; - } - _moduleCompile(filename, content) { - var contLen = content.length; - if (contLen >= 2) { - if (content.charCodeAt(0) === 35 && content.charCodeAt(1) === 33) { - if (contLen === 2) { - content = ""; - } else { - var i = 2; - for (; i < contLen; ++i) { - var code2 = content.charCodeAt(i); - if (code2 === 10 || code2 === 13) break; - } - if (i === contLen) { - content = ""; - } else { - content = content.slice(i); - } - } - } - } - var wrapper = Module2.wrap(content); - var invalidationKey = crypto.createHash("sha1").update(content, "utf8").digest("hex"); - var buffer = this._cacheStore.get(filename, invalidationKey); - var script = new vm.Script(wrapper, { - filename, - lineOffset: 0, - displayErrors: true, - cachedData: buffer, - produceCachedData: true - }); - if (script.cachedDataProduced) { - this._cacheStore.set(filename, invalidationKey, script.cachedData); - } else if (script.cachedDataRejected) { - this._cacheStore.delete(filename); - } - var compiledWrapper = script.runInThisContext({ - filename, - lineOffset: 0, - columnOffset: 0, - displayErrors: true - }); - return compiledWrapper; - } - }; - function mkdirpSync(p_) { - _mkdirpSync(path16.resolve(p_), 511); - } - function _mkdirpSync(p, mode) { - try { - fs17.mkdirSync(p, mode); - } catch (err0) { - if (err0.code === "ENOENT") { - _mkdirpSync(path16.dirname(p)); - _mkdirpSync(p); - } else { - try { - const stat = fs17.statSync(p); - if (!stat.isDirectory()) { - throw err0; - } - } catch (err1) { - throw err0; - } - } - } - } - function slashEscape(str) { - const ESCAPE_LOOKUP = { - "\\": "zB", - ":": "zC", - "/": "zS", - "\0": "z0", - "z": "zZ" - }; - const ESCAPE_REGEX = /[\\:/\x00z]/g; - return str.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]); - } - function supportsCachedData() { - const script = new vm.Script('""', { produceCachedData: true }); - return script.cachedDataProduced === true; - } - function getCacheDir() { - const v8_compile_cache_cache_dir = process.env.V8_COMPILE_CACHE_CACHE_DIR; - if (v8_compile_cache_cache_dir) { - return v8_compile_cache_cache_dir; - } - const dirname2 = typeof process.getuid === "function" ? "v8-compile-cache-" + process.getuid() : "v8-compile-cache"; - const arch = process.arch; - const version2 = typeof process.versions.v8 === "string" ? process.versions.v8 : typeof process.versions.chakracore === "string" ? "chakracore-" + process.versions.chakracore : "node-" + process.version; - const cacheDir = path16.join(os3.tmpdir(), dirname2, arch, version2); - return cacheDir; - } - function getMainName() { - const mainName = require.main && typeof require.main.filename === "string" ? require.main.filename : process.cwd(); - return mainName; - } - if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { - const cacheDir = getCacheDir(); - const prefix = getMainName(); - const blobStore = new FileSystemBlobStore(cacheDir, prefix); - const nativeCompileCache = new NativeCompileCache(); - nativeCompileCache.setCacheStore(blobStore); - nativeCompileCache.install(); - process.once("exit", () => { - if (blobStore.isDirty()) { - blobStore.save(); - } - nativeCompileCache.uninstall(); - }); - } - module2.exports.__TEST__ = { - FileSystemBlobStore, - NativeCompileCache, - mkdirpSync, - slashEscape, - supportsCachedData, - getCacheDir, - getMainName - }; - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/satisfies.js -var require_satisfies = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/satisfies.js"(exports2, module2) { - "use strict"; - var Range3 = require_range(); - var satisfies = (version2, range, options) => { - try { - range = new Range3(range, options); - } catch (er) { - return false; - } - return range.test(version2); - }; - module2.exports = satisfies; - } -}); - -// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/posix.js -var require_posix = __commonJS({ - ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/posix.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sync = exports2.isexe = void 0; - var fs_1 = require("fs"); - var promises_1 = require("fs/promises"); - var isexe = async (path16, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(await (0, promises_1.stat)(path16), options); - } catch (e) { - const er = e; - if (ignoreErrors || er.code === "EACCES") - return false; - throw er; - } - }; - exports2.isexe = isexe; - var sync = (path16, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat((0, fs_1.statSync)(path16), options); - } catch (e) { - const er = e; - if (ignoreErrors || er.code === "EACCES") - return false; - throw er; - } - }; - exports2.sync = sync; - var checkStat = (stat, options) => stat.isFile() && checkMode(stat, options); - var checkMode = (stat, options) => { - const myUid = options.uid ?? process.getuid?.(); - const myGroups = options.groups ?? process.getgroups?.() ?? []; - const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]; - if (myUid === void 0 || myGid === void 0) { - throw new Error("cannot get uid or gid"); - } - const groups = /* @__PURE__ */ new Set([myGid, ...myGroups]); - const mod = stat.mode; - const uid = stat.uid; - const gid = stat.gid; - const u = parseInt("100", 8); - const g = parseInt("010", 8); - const o = parseInt("001", 8); - const ug = u | g; - return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0); - }; - } -}); - -// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/win32.js -var require_win32 = __commonJS({ - ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/win32.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sync = exports2.isexe = void 0; - var fs_1 = require("fs"); - var promises_1 = require("fs/promises"); - var isexe = async (path16, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(await (0, promises_1.stat)(path16), path16, options); - } catch (e) { - const er = e; - if (ignoreErrors || er.code === "EACCES") - return false; - throw er; - } - }; - exports2.isexe = isexe; - var sync = (path16, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat((0, fs_1.statSync)(path16), path16, options); - } catch (e) { - const er = e; - if (ignoreErrors || er.code === "EACCES") - return false; - throw er; - } - }; - exports2.sync = sync; - var checkPathExt = (path16, options) => { - const { pathExt = process.env.PATHEXT || "" } = options; - const peSplit = pathExt.split(";"); - if (peSplit.indexOf("") !== -1) { - return true; - } - for (let i = 0; i < peSplit.length; i++) { - const p = peSplit[i].toLowerCase(); - const ext = path16.substring(path16.length - p.length).toLowerCase(); - if (p && ext === p) { - return true; - } - } - return false; - }; - var checkStat = (stat, path16, options) => stat.isFile() && checkPathExt(path16, options); - } -}); - -// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/options.js -var require_options = __commonJS({ - ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/options.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/index.js -var require_cjs = __commonJS({ - ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc2 = Object.getOwnPropertyDescriptor(m, k); - if (!desc2 || ("get" in desc2 ? !m.__esModule : desc2.writable || desc2.configurable)) { - desc2 = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc2); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sync = exports2.isexe = exports2.posix = exports2.win32 = void 0; - var posix = __importStar(require_posix()); - exports2.posix = posix; - var win322 = __importStar(require_win32()); - exports2.win32 = win322; - __exportStar(require_options(), exports2); - var platform5 = process.env._ISEXE_TEST_PLATFORM_ || process.platform; - var impl = platform5 === "win32" ? win322 : posix; - exports2.isexe = impl.isexe; - exports2.sync = impl.sync; - } -}); - -// .yarn/cache/which-npm-5.0.0-15aa39eb60-e556e4cd8b.zip/node_modules/which/lib/index.js -var require_lib = __commonJS({ - ".yarn/cache/which-npm-5.0.0-15aa39eb60-e556e4cd8b.zip/node_modules/which/lib/index.js"(exports2, module2) { - var { isexe, sync: isexeSync } = require_cjs(); - var { join: join3, delimiter, sep, posix } = require("path"); - var isWindows4 = process.platform === "win32"; - var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1")); - var rRel = new RegExp(`^\\.${rSlash.source}`); - var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); - var getPathInfo = (cmd, { - path: optPath = process.env.PATH, - pathExt: optPathExt = process.env.PATHEXT, - delimiter: optDelimiter = delimiter - }) => { - const pathEnv = cmd.match(rSlash) ? [""] : [ - // windows always checks the cwd first - ...isWindows4 ? [process.cwd()] : [], - ...(optPath || /* istanbul ignore next: very unusual */ - "").split(optDelimiter) - ]; - if (isWindows4) { - const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter); - const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]); - if (cmd.includes(".") && pathExt[0] !== "") { - pathExt.unshift(""); - } - return { pathEnv, pathExt, pathExtExe }; - } - return { pathEnv, pathExt: [""] }; - }; - var getPathPart = (raw2, cmd) => { - const pathPart = /^".*"$/.test(raw2) ? raw2.slice(1, -1) : raw2; - const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ""; - return prefix + join3(pathPart, cmd); - }; - var which3 = async (cmd, opt = {}) => { - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); - const found = []; - for (const envPart of pathEnv) { - const p = getPathPart(envPart, cmd); - for (const ext of pathExt) { - const withExt = p + ext; - const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }); - if (is) { - if (!opt.all) { - return withExt; - } - found.push(withExt); - } - } - } - if (opt.all && found.length) { - return found; - } - if (opt.nothrow) { - return null; - } - throw getNotFoundError(cmd); - }; - var whichSync = (cmd, opt = {}) => { - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); - const found = []; - for (const pathEnvPart of pathEnv) { - const p = getPathPart(pathEnvPart, cmd); - for (const ext of pathExt) { - const withExt = p + ext; - const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true }); - if (is) { - if (!opt.all) { - return withExt; - } - found.push(withExt); - } - } - } - if (opt.all && found.length) { - return found; - } - if (opt.nothrow) { - return null; - } - throw getNotFoundError(cmd); - }; - module2.exports = which3; - which3.sync = whichSync; - } -}); - -// .yarn/cache/is-windows-npm-1.0.2-898cd6f3d7-b32f418ab3.zip/node_modules/is-windows/index.js -var require_is_windows = __commonJS({ - ".yarn/cache/is-windows-npm-1.0.2-898cd6f3d7-b32f418ab3.zip/node_modules/is-windows/index.js"(exports2, module2) { - (function(factory) { - if (exports2 && typeof exports2 === "object" && typeof module2 !== "undefined") { - module2.exports = factory(); - } else if (typeof define === "function" && define.amd) { - define([], factory); - } else if (typeof window !== "undefined") { - window.isWindows = factory(); - } else if (typeof global !== "undefined") { - global.isWindows = factory(); - } else if (typeof self !== "undefined") { - self.isWindows = factory(); - } else { - this.isWindows = factory(); - } - })(function() { - "use strict"; - return function isWindows4() { - return process && (process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE)); - }; - }); - } -}); - -// .yarn/cache/cmd-extension-npm-1.0.2-11aa204c4b-acdb425d51.zip/node_modules/cmd-extension/index.js -var require_cmd_extension = __commonJS({ - ".yarn/cache/cmd-extension-npm-1.0.2-11aa204c4b-acdb425d51.zip/node_modules/cmd-extension/index.js"(exports2, module2) { - "use strict"; - var path16 = require("path"); - var cmdExtension; - if (process.env.PATHEXT) { - cmdExtension = process.env.PATHEXT.split(path16.delimiter).find((ext) => ext.toUpperCase() === ".CMD"); - } - module2.exports = cmdExtension || ".cmd"; - } -}); - -// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/polyfills.js -var require_polyfills = __commonJS({ - ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/polyfills.js"(exports2, module2) { - var constants2 = require("constants"); - var origCwd = process.cwd; - var cwd = null; - var platform5 = process.env.GRACEFUL_FS_PLATFORM || process.platform; - process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process); - return cwd; - }; - try { - process.cwd(); - } catch (er) { - } - if (typeof process.chdir === "function") { - chdir = process.chdir; - process.chdir = function(d) { - cwd = null; - chdir.call(process, d); - }; - if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); - } - var chdir; - module2.exports = patch; - function patch(fs17) { - if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs17); - } - if (!fs17.lutimes) { - patchLutimes(fs17); - } - fs17.chown = chownFix(fs17.chown); - fs17.fchown = chownFix(fs17.fchown); - fs17.lchown = chownFix(fs17.lchown); - fs17.chmod = chmodFix(fs17.chmod); - fs17.fchmod = chmodFix(fs17.fchmod); - fs17.lchmod = chmodFix(fs17.lchmod); - fs17.chownSync = chownFixSync(fs17.chownSync); - fs17.fchownSync = chownFixSync(fs17.fchownSync); - fs17.lchownSync = chownFixSync(fs17.lchownSync); - fs17.chmodSync = chmodFixSync(fs17.chmodSync); - fs17.fchmodSync = chmodFixSync(fs17.fchmodSync); - fs17.lchmodSync = chmodFixSync(fs17.lchmodSync); - fs17.stat = statFix(fs17.stat); - fs17.fstat = statFix(fs17.fstat); - fs17.lstat = statFix(fs17.lstat); - fs17.statSync = statFixSync(fs17.statSync); - fs17.fstatSync = statFixSync(fs17.fstatSync); - fs17.lstatSync = statFixSync(fs17.lstatSync); - if (fs17.chmod && !fs17.lchmod) { - fs17.lchmod = function(path16, mode, cb) { - if (cb) process.nextTick(cb); - }; - fs17.lchmodSync = function() { - }; - } - if (fs17.chown && !fs17.lchown) { - fs17.lchown = function(path16, uid, gid, cb) { - if (cb) process.nextTick(cb); - }; - fs17.lchownSync = function() { - }; - } - if (platform5 === "win32") { - fs17.rename = typeof fs17.rename !== "function" ? fs17.rename : (function(fs$rename) { - function rename(from, to, cb) { - var start = Date.now(); - var backoff = 0; - fs$rename(from, to, function CB(er) { - if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { - setTimeout(function() { - fs17.stat(to, function(stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er); - }); - }, backoff); - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er); - }); - } - if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); - return rename; - })(fs17.rename); - } - fs17.read = typeof fs17.read !== "function" ? fs17.read : (function(fs$read) { - function read(fd, buffer, offset, length, position, callback_) { - var callback; - if (callback_ && typeof callback_ === "function") { - var eagCounter = 0; - callback = function(er, _, __) { - if (er && er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - return fs$read.call(fs17, fd, buffer, offset, length, position, callback); - } - callback_.apply(this, arguments); - }; - } - return fs$read.call(fs17, fd, buffer, offset, length, position, callback); - } - if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); - return read; - })(fs17.read); - fs17.readSync = typeof fs17.readSync !== "function" ? fs17.readSync : /* @__PURE__ */ (function(fs$readSync) { - return function(fd, buffer, offset, length, position) { - var eagCounter = 0; - while (true) { - try { - return fs$readSync.call(fs17, fd, buffer, offset, length, position); - } catch (er) { - if (er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - continue; - } - throw er; - } - } - }; - })(fs17.readSync); - function patchLchmod(fs18) { - fs18.lchmod = function(path16, mode, callback) { - fs18.open( - path16, - constants2.O_WRONLY | constants2.O_SYMLINK, - mode, - function(err, fd) { - if (err) { - if (callback) callback(err); - return; - } - fs18.fchmod(fd, mode, function(err2) { - fs18.close(fd, function(err22) { - if (callback) callback(err2 || err22); - }); - }); - } - ); - }; - fs18.lchmodSync = function(path16, mode) { - var fd = fs18.openSync(path16, constants2.O_WRONLY | constants2.O_SYMLINK, mode); - var threw = true; - var ret; - try { - ret = fs18.fchmodSync(fd, mode); - threw = false; - } finally { - if (threw) { - try { - fs18.closeSync(fd); - } catch (er) { - } - } else { - fs18.closeSync(fd); - } - } - return ret; - }; - } - function patchLutimes(fs18) { - if (constants2.hasOwnProperty("O_SYMLINK") && fs18.futimes) { - fs18.lutimes = function(path16, at, mt, cb) { - fs18.open(path16, constants2.O_SYMLINK, function(er, fd) { - if (er) { - if (cb) cb(er); - return; - } - fs18.futimes(fd, at, mt, function(er2) { - fs18.close(fd, function(er22) { - if (cb) cb(er2 || er22); - }); - }); - }); - }; - fs18.lutimesSync = function(path16, at, mt) { - var fd = fs18.openSync(path16, constants2.O_SYMLINK); - var ret; - var threw = true; - try { - ret = fs18.futimesSync(fd, at, mt); - threw = false; - } finally { - if (threw) { - try { - fs18.closeSync(fd); - } catch (er) { - } - } else { - fs18.closeSync(fd); - } - } - return ret; - }; - } else if (fs18.futimes) { - fs18.lutimes = function(_a, _b, _c, cb) { - if (cb) process.nextTick(cb); - }; - fs18.lutimesSync = function() { - }; - } - } - function chmodFix(orig) { - if (!orig) return orig; - return function(target, mode, cb) { - return orig.call(fs17, target, mode, function(er) { - if (chownErOk(er)) er = null; - if (cb) cb.apply(this, arguments); - }); - }; - } - function chmodFixSync(orig) { - if (!orig) return orig; - return function(target, mode) { - try { - return orig.call(fs17, target, mode); - } catch (er) { - if (!chownErOk(er)) throw er; - } - }; - } - function chownFix(orig) { - if (!orig) return orig; - return function(target, uid, gid, cb) { - return orig.call(fs17, target, uid, gid, function(er) { - if (chownErOk(er)) er = null; - if (cb) cb.apply(this, arguments); - }); - }; - } - function chownFixSync(orig) { - if (!orig) return orig; - return function(target, uid, gid) { - try { - return orig.call(fs17, target, uid, gid); - } catch (er) { - if (!chownErOk(er)) throw er; - } - }; - } - function statFix(orig) { - if (!orig) return orig; - return function(target, options, cb) { - if (typeof options === "function") { - cb = options; - options = null; - } - function callback(er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 4294967296; - if (stats.gid < 0) stats.gid += 4294967296; - } - if (cb) cb.apply(this, arguments); - } - return options ? orig.call(fs17, target, options, callback) : orig.call(fs17, target, callback); - }; - } - function statFixSync(orig) { - if (!orig) return orig; - return function(target, options) { - var stats = options ? orig.call(fs17, target, options) : orig.call(fs17, target); - if (stats) { - if (stats.uid < 0) stats.uid += 4294967296; - if (stats.gid < 0) stats.gid += 4294967296; - } - return stats; - }; - } - function chownErOk(er) { - if (!er) - return true; - if (er.code === "ENOSYS") - return true; - var nonroot = !process.getuid || process.getuid() !== 0; - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true; - } - return false; - } - } - } -}); - -// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/legacy-streams.js -var require_legacy_streams = __commonJS({ - ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { - var Stream2 = require("stream").Stream; - module2.exports = legacy; - function legacy(fs17) { - return { - ReadStream: ReadStream2, - WriteStream: WriteStream2 - }; - function ReadStream2(path16, options) { - if (!(this instanceof ReadStream2)) return new ReadStream2(path16, options); - Stream2.call(this); - var self2 = this; - this.path = path16; - this.fd = null; - this.readable = true; - this.paused = false; - this.flags = "r"; - this.mode = 438; - this.bufferSize = 64 * 1024; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.encoding) this.setEncoding(this.encoding); - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.end === void 0) { - this.end = Infinity; - } else if ("number" !== typeof this.end) { - throw TypeError("end must be a Number"); - } - if (this.start > this.end) { - throw new Error("start must be <= end"); - } - this.pos = this.start; - } - if (this.fd !== null) { - process.nextTick(function() { - self2._read(); - }); - return; - } - fs17.open(this.path, this.flags, this.mode, function(err, fd) { - if (err) { - self2.emit("error", err); - self2.readable = false; - return; - } - self2.fd = fd; - self2.emit("open", fd); - self2._read(); - }); - } - function WriteStream2(path16, options) { - if (!(this instanceof WriteStream2)) return new WriteStream2(path16, options); - Stream2.call(this); - this.path = path16; - this.fd = null; - this.writable = true; - this.flags = "w"; - this.encoding = "binary"; - this.mode = 438; - this.bytesWritten = 0; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.start < 0) { - throw new Error("start must be >= zero"); - } - this.pos = this.start; - } - this.busy = false; - this._queue = []; - if (this.fd === null) { - this._open = fs17.open; - this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); - this.flush(); - } - } - } - } -}); - -// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/clone.js -var require_clone = __commonJS({ - ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/clone.js"(exports2, module2) { - "use strict"; - module2.exports = clone; - var getPrototypeOf = Object.getPrototypeOf || function(obj) { - return obj.__proto__; - }; - function clone(obj) { - if (obj === null || typeof obj !== "object") - return obj; - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) }; - else - var copy = /* @__PURE__ */ Object.create(null); - Object.getOwnPropertyNames(obj).forEach(function(key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); - }); - return copy; - } - } -}); - -// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/graceful-fs.js -var require_graceful_fs = __commonJS({ - ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs17 = require("fs"); - var polyfills = require_polyfills(); - var legacy = require_legacy_streams(); - var clone = require_clone(); - var util = require("util"); - var gracefulQueue; - var previousSymbol; - if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"); - previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous"); - } else { - gracefulQueue = "___graceful-fs.queue"; - previousSymbol = "___graceful-fs.previous"; - } - function noop3() { - } - function publishQueue(context, queue2) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue2; - } - }); - } - var debug2 = noop3; - if (util.debuglog) - debug2 = util.debuglog("gfs4"); - else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) - debug2 = function() { - var m = util.format.apply(util, arguments); - m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); - console.error(m); - }; - if (!fs17[gracefulQueue]) { - queue = global[gracefulQueue] || []; - publishQueue(fs17, queue); - fs17.close = (function(fs$close) { - function close(fd, cb) { - return fs$close.call(fs17, fd, function(err) { - if (!err) { - resetQueue(); - } - if (typeof cb === "function") - cb.apply(this, arguments); - }); - } - Object.defineProperty(close, previousSymbol, { - value: fs$close - }); - return close; - })(fs17.close); - fs17.closeSync = (function(fs$closeSync) { - function closeSync(fd) { - fs$closeSync.apply(fs17, arguments); - resetQueue(); - } - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }); - return closeSync; - })(fs17.closeSync); - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { - process.on("exit", function() { - debug2(fs17[gracefulQueue]); - require("assert").equal(fs17[gracefulQueue].length, 0); - }); - } - } - var queue; - if (!global[gracefulQueue]) { - publishQueue(global, fs17[gracefulQueue]); - } - module2.exports = patch(clone(fs17)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs17.__patched) { - module2.exports = patch(fs17); - fs17.__patched = true; - } - function patch(fs18) { - polyfills(fs18); - fs18.gracefulify = patch; - fs18.createReadStream = createReadStream; - fs18.createWriteStream = createWriteStream; - var fs$readFile = fs18.readFile; - fs18.readFile = readFile; - function readFile(path16, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$readFile(path16, options, cb); - function go$readFile(path17, options2, cb2, startTime) { - return fs$readFile(path17, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path17, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$writeFile = fs18.writeFile; - fs18.writeFile = writeFile; - function writeFile(path16, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$writeFile(path16, data, options, cb); - function go$writeFile(path17, data2, options2, cb2, startTime) { - return fs$writeFile(path17, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$appendFile = fs18.appendFile; - if (fs$appendFile) - fs18.appendFile = appendFile; - function appendFile(path16, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$appendFile(path16, data, options, cb); - function go$appendFile(path17, data2, options2, cb2, startTime) { - return fs$appendFile(path17, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$copyFile = fs18.copyFile; - if (fs$copyFile) - fs18.copyFile = copyFile; - function copyFile(src, dest, flags, cb) { - if (typeof flags === "function") { - cb = flags; - flags = 0; - } - return go$copyFile(src, dest, flags, cb); - function go$copyFile(src2, dest2, flags2, cb2, startTime) { - return fs$copyFile(src2, dest2, flags2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$readdir = fs18.readdir; - fs18.readdir = readdir; - var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path16, options, cb) { - if (typeof options === "function") - cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path17, options2, cb2, startTime) { - return fs$readdir(path17, fs$readdirCallback( - path17, - options2, - cb2, - startTime - )); - } : function go$readdir2(path17, options2, cb2, startTime) { - return fs$readdir(path17, options2, fs$readdirCallback( - path17, - options2, - cb2, - startTime - )); - }; - return go$readdir(path16, options, cb); - function fs$readdirCallback(path17, options2, cb2, startTime) { - return function(err, files) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([ - go$readdir, - [path17, options2, cb2], - err, - startTime || Date.now(), - Date.now() - ]); - else { - if (files && files.sort) - files.sort(); - if (typeof cb2 === "function") - cb2.call(this, err, files); - } - }; - } - } - if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs18); - ReadStream2 = legStreams.ReadStream; - WriteStream2 = legStreams.WriteStream; - } - var fs$ReadStream = fs18.ReadStream; - if (fs$ReadStream) { - ReadStream2.prototype = Object.create(fs$ReadStream.prototype); - ReadStream2.prototype.open = ReadStream$open; - } - var fs$WriteStream = fs18.WriteStream; - if (fs$WriteStream) { - WriteStream2.prototype = Object.create(fs$WriteStream.prototype); - WriteStream2.prototype.open = WriteStream$open; - } - Object.defineProperty(fs18, "ReadStream", { - get: function() { - return ReadStream2; - }, - set: function(val) { - ReadStream2 = val; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(fs18, "WriteStream", { - get: function() { - return WriteStream2; - }, - set: function(val) { - WriteStream2 = val; - }, - enumerable: true, - configurable: true - }); - var FileReadStream = ReadStream2; - Object.defineProperty(fs18, "FileReadStream", { - get: function() { - return FileReadStream; - }, - set: function(val) { - FileReadStream = val; - }, - enumerable: true, - configurable: true - }); - var FileWriteStream = WriteStream2; - Object.defineProperty(fs18, "FileWriteStream", { - get: function() { - return FileWriteStream; - }, - set: function(val) { - FileWriteStream = val; - }, - enumerable: true, - configurable: true - }); - function ReadStream2(path16, options) { - if (this instanceof ReadStream2) - return fs$ReadStream.apply(this, arguments), this; - else - return ReadStream2.apply(Object.create(ReadStream2.prototype), arguments); - } - function ReadStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - if (that.autoClose) - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - that.read(); - } - }); - } - function WriteStream2(path16, options) { - if (this instanceof WriteStream2) - return fs$WriteStream.apply(this, arguments), this; - else - return WriteStream2.apply(Object.create(WriteStream2.prototype), arguments); - } - function WriteStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - } - }); - } - function createReadStream(path16, options) { - return new fs18.ReadStream(path16, options); - } - function createWriteStream(path16, options) { - return new fs18.WriteStream(path16, options); - } - var fs$open = fs18.open; - fs18.open = open; - function open(path16, flags, mode, cb) { - if (typeof mode === "function") - cb = mode, mode = null; - return go$open(path16, flags, mode, cb); - function go$open(path17, flags2, mode2, cb2, startTime) { - return fs$open(path17, flags2, mode2, function(err, fd) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path17, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - return fs18; - } - function enqueue(elem) { - debug2("ENQUEUE", elem[0].name, elem[1]); - fs17[gracefulQueue].push(elem); - retry(); - } - var retryTimer; - function resetQueue() { - var now = Date.now(); - for (var i = 0; i < fs17[gracefulQueue].length; ++i) { - if (fs17[gracefulQueue][i].length > 2) { - fs17[gracefulQueue][i][3] = now; - fs17[gracefulQueue][i][4] = now; - } - } - retry(); - } - function retry() { - clearTimeout(retryTimer); - retryTimer = void 0; - if (fs17[gracefulQueue].length === 0) - return; - var elem = fs17[gracefulQueue].shift(); - var fn2 = elem[0]; - var args = elem[1]; - var err = elem[2]; - var startTime = elem[3]; - var lastTime = elem[4]; - if (startTime === void 0) { - debug2("RETRY", fn2.name, args); - fn2.apply(null, args); - } else if (Date.now() - startTime >= 6e4) { - debug2("TIMEOUT", fn2.name, args); - var cb = args.pop(); - if (typeof cb === "function") - cb.call(null, err); - } else { - var sinceAttempt = Date.now() - lastTime; - var sinceStart = Math.max(lastTime - startTime, 1); - var desiredDelay = Math.min(sinceStart * 1.2, 100); - if (sinceAttempt >= desiredDelay) { - debug2("RETRY", fn2.name, args); - fn2.apply(null, args.concat([startTime])); - } else { - fs17[gracefulQueue].push(elem); - } - } - if (retryTimer === void 0) { - retryTimer = setTimeout(retry, 0); - } - } - } -}); - -// .yarn/cache/@zkochan-cmd-shim-npm-6.0.0-97792a7373-ba1442ba1e.zip/node_modules/@zkochan/cmd-shim/index.js -var require_cmd_shim = __commonJS({ - ".yarn/cache/@zkochan-cmd-shim-npm-6.0.0-97792a7373-ba1442ba1e.zip/node_modules/@zkochan/cmd-shim/index.js"(exports2, module2) { - "use strict"; - cmdShim2.ifExists = cmdShimIfExists; - var util_1 = require("util"); - var path16 = require("path"); - var isWindows4 = require_is_windows(); - var CMD_EXTENSION = require_cmd_extension(); - var shebangExpr = /^#!\s*(?:\/usr\/bin\/env(?:\s+-S\s*)?)?\s*([^ \t]+)(.*)$/; - var DEFAULT_OPTIONS = { - // Create PowerShell file by default if the option hasn't been specified - createPwshFile: true, - createCmdFile: isWindows4(), - fs: require_graceful_fs() - }; - var extensionToProgramMap = /* @__PURE__ */ new Map([ - [".js", "node"], - [".cjs", "node"], - [".mjs", "node"], - [".cmd", "cmd"], - [".bat", "cmd"], - [".ps1", "pwsh"], - [".sh", "sh"] - ]); - function ingestOptions(opts) { - const opts_ = { ...DEFAULT_OPTIONS, ...opts }; - const fs17 = opts_.fs; - opts_.fs_ = { - chmod: fs17.chmod ? (0, util_1.promisify)(fs17.chmod) : (async () => { - }), - mkdir: (0, util_1.promisify)(fs17.mkdir), - readFile: (0, util_1.promisify)(fs17.readFile), - stat: (0, util_1.promisify)(fs17.stat), - unlink: (0, util_1.promisify)(fs17.unlink), - writeFile: (0, util_1.promisify)(fs17.writeFile) - }; - return opts_; - } - async function cmdShim2(src, to, opts) { - const opts_ = ingestOptions(opts); - await cmdShim_(src, to, opts_); - } - function cmdShimIfExists(src, to, opts) { - return cmdShim2(src, to, opts).catch(() => { - }); - } - function rm(path17, opts) { - return opts.fs_.unlink(path17).catch(() => { - }); - } - async function cmdShim_(src, to, opts) { - const srcRuntimeInfo = await searchScriptRuntime(src, opts); - await writeShimsPreCommon(to, opts); - return writeAllShims(src, to, srcRuntimeInfo, opts); - } - function writeShimsPreCommon(target, opts) { - return opts.fs_.mkdir(path16.dirname(target), { recursive: true }); - } - function writeAllShims(src, to, srcRuntimeInfo, opts) { - const opts_ = ingestOptions(opts); - const generatorAndExts = [{ generator: generateShShim, extension: "" }]; - if (opts_.createCmdFile) { - generatorAndExts.push({ generator: generateCmdShim, extension: CMD_EXTENSION }); - } - if (opts_.createPwshFile) { - generatorAndExts.push({ generator: generatePwshShim, extension: ".ps1" }); - } - return Promise.all(generatorAndExts.map((generatorAndExt) => writeShim(src, to + generatorAndExt.extension, srcRuntimeInfo, generatorAndExt.generator, opts_))); - } - function writeShimPre(target, opts) { - return rm(target, opts); - } - function writeShimPost(target, opts) { - return chmodShim(target, opts); - } - async function searchScriptRuntime(target, opts) { - try { - const data = await opts.fs_.readFile(target, "utf8"); - const firstLine = data.trim().split(/\r*\n/)[0]; - const shebang = firstLine.match(shebangExpr); - if (!shebang) { - const targetExtension = path16.extname(target).toLowerCase(); - return { - // undefined if extension is unknown but it's converted to null. - program: extensionToProgramMap.get(targetExtension) || null, - additionalArgs: "" - }; - } - return { - program: shebang[1], - additionalArgs: shebang[2] - }; - } catch (err) { - if (!isWindows4() || err.code !== "ENOENT") - throw err; - if (await opts.fs_.stat(`${target}${getExeExtension()}`)) { - return { - program: null, - additionalArgs: "" - }; - } - throw err; - } - } - function getExeExtension() { - let cmdExtension; - if (process.env.PATHEXT) { - cmdExtension = process.env.PATHEXT.split(path16.delimiter).find((ext) => ext.toLowerCase() === ".exe"); - } - return cmdExtension || ".exe"; - } - async function writeShim(src, to, srcRuntimeInfo, generateShimScript, opts) { - const defaultArgs = opts.preserveSymlinks ? "--preserve-symlinks" : ""; - const args = [srcRuntimeInfo.additionalArgs, defaultArgs].filter((arg) => arg).join(" "); - opts = Object.assign({}, opts, { - prog: srcRuntimeInfo.program, - args - }); - await writeShimPre(to, opts); - await opts.fs_.writeFile(to, generateShimScript(src, to, opts), "utf8"); - return writeShimPost(to, opts); - } - function generateCmdShim(src, to, opts) { - const shTarget = path16.relative(path16.dirname(to), src); - let target = shTarget.split("/").join("\\"); - const quotedPathToTarget = path16.isAbsolute(target) ? `"${target}"` : `"%~dp0\\${target}"`; - let longProg; - let prog = opts.prog; - let args = opts.args || ""; - const nodePath = normalizePathEnvVar(opts.nodePath).win32; - const prependToPath = normalizePathEnvVar(opts.prependToPath).win32; - if (!prog) { - prog = quotedPathToTarget; - args = ""; - target = ""; - } else if (prog === "node" && opts.nodeExecPath) { - prog = `"${opts.nodeExecPath}"`; - target = quotedPathToTarget; - } else { - longProg = `"%~dp0\\${prog}.exe"`; - target = quotedPathToTarget; - } - let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; - let cmd = "@SETLOCAL\r\n"; - if (prependToPath) { - cmd += `@SET "PATH=${prependToPath}:%PATH%"\r -`; - } - if (nodePath) { - cmd += `@IF NOT DEFINED NODE_PATH (\r - @SET "NODE_PATH=${nodePath}"\r -) ELSE (\r - @SET "NODE_PATH=${nodePath};%NODE_PATH%"\r -)\r -`; - } - if (longProg) { - cmd += `@IF EXIST ${longProg} (\r - ${longProg} ${args} ${target} ${progArgs}%*\r -) ELSE (\r - @SET PATHEXT=%PATHEXT:;.JS;=;%\r - ${prog} ${args} ${target} ${progArgs}%*\r -)\r -`; - } else { - cmd += `@${prog} ${args} ${target} ${progArgs}%*\r -`; - } - return cmd; - } - function generateShShim(src, to, opts) { - let shTarget = path16.relative(path16.dirname(to), src); - let shProg = opts.prog && opts.prog.split("\\").join("/"); - let shLongProg; - shTarget = shTarget.split("\\").join("/"); - const quotedPathToTarget = path16.isAbsolute(shTarget) ? `"${shTarget}"` : `"$basedir/${shTarget}"`; - let args = opts.args || ""; - const shNodePath = normalizePathEnvVar(opts.nodePath).posix; - if (!shProg) { - shProg = quotedPathToTarget; - args = ""; - shTarget = ""; - } else if (opts.prog === "node" && opts.nodeExecPath) { - shProg = `"${opts.nodeExecPath}"`; - shTarget = quotedPathToTarget; - } else { - shLongProg = `"$basedir/${opts.prog}"`; - shTarget = quotedPathToTarget; - } - let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; - let sh = `#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')") - -case \`uname\` in - *CYGWIN*) basedir=\`cygpath -w "$basedir"\`;; -esac - -`; - if (opts.prependToPath) { - sh += `export PATH="${opts.prependToPath}:$PATH" -`; - } - if (shNodePath) { - sh += `if [ -z "$NODE_PATH" ]; then - export NODE_PATH="${shNodePath}" -else - export NODE_PATH="${shNodePath}:$NODE_PATH" -fi -`; - } - if (shLongProg) { - sh += `if [ -x ${shLongProg} ]; then - exec ${shLongProg} ${args} ${shTarget} ${progArgs}"$@" -else - exec ${shProg} ${args} ${shTarget} ${progArgs}"$@" -fi -`; - } else { - sh += `${shProg} ${args} ${shTarget} ${progArgs}"$@" -exit $? -`; - } - return sh; - } - function generatePwshShim(src, to, opts) { - let shTarget = path16.relative(path16.dirname(to), src); - const shProg = opts.prog && opts.prog.split("\\").join("/"); - let pwshProg = shProg && `"${shProg}$exe"`; - let pwshLongProg; - shTarget = shTarget.split("\\").join("/"); - const quotedPathToTarget = path16.isAbsolute(shTarget) ? `"${shTarget}"` : `"$basedir/${shTarget}"`; - let args = opts.args || ""; - let normalizedNodePathEnvVar = normalizePathEnvVar(opts.nodePath); - const nodePath = normalizedNodePathEnvVar.win32; - const shNodePath = normalizedNodePathEnvVar.posix; - let normalizedPrependPathEnvVar = normalizePathEnvVar(opts.prependToPath); - const prependPath = normalizedPrependPathEnvVar.win32; - const shPrependPath = normalizedPrependPathEnvVar.posix; - if (!pwshProg) { - pwshProg = quotedPathToTarget; - args = ""; - shTarget = ""; - } else if (opts.prog === "node" && opts.nodeExecPath) { - pwshProg = `"${opts.nodeExecPath}"`; - shTarget = quotedPathToTarget; - } else { - pwshLongProg = `"$basedir/${opts.prog}$exe"`; - shTarget = quotedPathToTarget; - } - let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; - let pwsh = `#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -${nodePath || prependPath ? '$pathsep=":"\n' : ""}${nodePath ? `$env_node_path=$env:NODE_PATH -$new_node_path="${nodePath}" -` : ""}${prependPath ? `$env_path=$env:PATH -$prepend_path="${prependPath}" -` : ""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -${nodePath || prependPath ? ' $pathsep=";"\n' : ""}}`; - if (shNodePath || shPrependPath) { - pwsh += ` else { -${shNodePath ? ` $new_node_path="${shNodePath}" -` : ""}${shPrependPath ? ` $prepend_path="${shPrependPath}" -` : ""}} -`; - } - if (shNodePath) { - pwsh += `if ([string]::IsNullOrEmpty($env_node_path)) { - $env:NODE_PATH=$new_node_path -} else { - $env:NODE_PATH="$new_node_path$pathsep$env_node_path" -} -`; - } - if (opts.prependToPath) { - pwsh += ` -$env:PATH="$prepend_path$pathsep$env:PATH" -`; - } - if (pwshLongProg) { - pwsh += ` -$ret=0 -if (Test-Path ${pwshLongProg}) { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & ${pwshLongProg} ${args} ${shTarget} ${progArgs}$args - } else { - & ${pwshLongProg} ${args} ${shTarget} ${progArgs}$args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & ${pwshProg} ${args} ${shTarget} ${progArgs}$args - } else { - & ${pwshProg} ${args} ${shTarget} ${progArgs}$args - } - $ret=$LASTEXITCODE -} -${nodePath ? "$env:NODE_PATH=$env_node_path\n" : ""}${prependPath ? "$env:PATH=$env_path\n" : ""}exit $ret -`; - } else { - pwsh += ` -# Support pipeline input -if ($MyInvocation.ExpectingInput) { - $input | & ${pwshProg} ${args} ${shTarget} ${progArgs}$args -} else { - & ${pwshProg} ${args} ${shTarget} ${progArgs}$args -} -${nodePath ? "$env:NODE_PATH=$env_node_path\n" : ""}${prependPath ? "$env:PATH=$env_path\n" : ""}exit $LASTEXITCODE -`; + if (process.version.substr(0, 4) === "v0.8") { + var legStreams = legacy(fs18); + ReadStream2 = legStreams.ReadStream; + WriteStream2 = legStreams.WriteStream; } - return pwsh; - } - function chmodShim(to, opts) { - return opts.fs_.chmod(to, 493); - } - function normalizePathEnvVar(nodePath) { - if (!nodePath || !nodePath.length) { - return { - win32: "", - posix: "" - }; + var fs$ReadStream = fs18.ReadStream; + if (fs$ReadStream) { + ReadStream2.prototype = Object.create(fs$ReadStream.prototype); + ReadStream2.prototype.open = ReadStream$open; } - let split = typeof nodePath === "string" ? nodePath.split(path16.delimiter) : Array.from(nodePath); - let result = {}; - for (let i = 0; i < split.length; i++) { - const win322 = split[i].split("/").join("\\"); - const posix = isWindows4() ? split[i].split("\\").join("/").replace(/^([^:\\/]*):/, (_, $1) => `/mnt/${$1.toLowerCase()}`) : split[i]; - result.win32 = result.win32 ? `${result.win32};${win322}` : win322; - result.posix = result.posix ? `${result.posix}:${posix}` : posix; - result[i] = { win32: win322, posix }; + var fs$WriteStream = fs18.WriteStream; + if (fs$WriteStream) { + WriteStream2.prototype = Object.create(fs$WriteStream.prototype); + WriteStream2.prototype.open = WriteStream$open; } - return result; - } - module2.exports = cmdShim2; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/mode-fix.js -var modeFix; -var init_mode_fix = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/mode-fix.js"() { - modeFix = (mode, isDir, portable) => { - mode &= 4095; - if (portable) { - mode = (mode | 384) & ~18; + Object.defineProperty(fs18, "ReadStream", { + get: function() { + return ReadStream2; + }, + set: function(val) { + ReadStream2 = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(fs18, "WriteStream", { + get: function() { + return WriteStream2; + }, + set: function(val) { + WriteStream2 = val; + }, + enumerable: true, + configurable: true + }); + var FileReadStream = ReadStream2; + Object.defineProperty(fs18, "FileReadStream", { + get: function() { + return FileReadStream; + }, + set: function(val) { + FileReadStream = val; + }, + enumerable: true, + configurable: true + }); + var FileWriteStream = WriteStream2; + Object.defineProperty(fs18, "FileWriteStream", { + get: function() { + return FileWriteStream; + }, + set: function(val) { + FileWriteStream = val; + }, + enumerable: true, + configurable: true + }); + function ReadStream2(path16, options) { + if (this instanceof ReadStream2) + return fs$ReadStream.apply(this, arguments), this; + else + return ReadStream2.apply(Object.create(ReadStream2.prototype), arguments); } - if (isDir) { - if (mode & 256) { - mode |= 64; - } - if (mode & 32) { - mode |= 8; - } - if (mode & 4) { - mode |= 1; - } + function ReadStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + if (that.autoClose) + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); + that.read(); + } + }); } - return mode; - }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/write-entry.js -var import_fs11, import_path9, prefixPath, maxReadSize, PROCESS, FILE2, DIRECTORY2, SYMLINK2, HARDLINK2, HEADER, READ2, LSTAT, ONLSTAT, ONREAD, ONREADLINK, OPENFILE, ONOPENFILE, CLOSE, MODE, AWAITDRAIN, ONDRAIN, PREFIX, WriteEntry, WriteEntrySync, WriteEntryTar, getType; -var init_write_entry = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/write-entry.js"() { - import_fs11 = __toESM(require("fs"), 1); - init_esm(); - import_path9 = __toESM(require("path"), 1); - init_header(); - init_mode_fix(); - init_normalize_windows_path(); - init_options(); - init_pax(); - init_strip_absolute_path(); - init_strip_trailing_slashes(); - init_warn_method(); - init_winchars(); - prefixPath = (path16, prefix) => { - if (!prefix) { - return normalizeWindowsPath(path16); + function WriteStream2(path16, options) { + if (this instanceof WriteStream2) + return fs$WriteStream.apply(this, arguments), this; + else + return WriteStream2.apply(Object.create(WriteStream2.prototype), arguments); } - path16 = normalizeWindowsPath(path16).replace(/^\.(\/|$)/, ""); - return stripTrailingSlashes(prefix) + "/" + path16; - }; - maxReadSize = 16 * 1024 * 1024; - PROCESS = /* @__PURE__ */ Symbol("process"); - FILE2 = /* @__PURE__ */ Symbol("file"); - DIRECTORY2 = /* @__PURE__ */ Symbol("directory"); - SYMLINK2 = /* @__PURE__ */ Symbol("symlink"); - HARDLINK2 = /* @__PURE__ */ Symbol("hardlink"); - HEADER = /* @__PURE__ */ Symbol("header"); - READ2 = /* @__PURE__ */ Symbol("read"); - LSTAT = /* @__PURE__ */ Symbol("lstat"); - ONLSTAT = /* @__PURE__ */ Symbol("onlstat"); - ONREAD = /* @__PURE__ */ Symbol("onread"); - ONREADLINK = /* @__PURE__ */ Symbol("onreadlink"); - OPENFILE = /* @__PURE__ */ Symbol("openfile"); - ONOPENFILE = /* @__PURE__ */ Symbol("onopenfile"); - CLOSE = /* @__PURE__ */ Symbol("close"); - MODE = /* @__PURE__ */ Symbol("mode"); - AWAITDRAIN = /* @__PURE__ */ Symbol("awaitDrain"); - ONDRAIN = /* @__PURE__ */ Symbol("ondrain"); - PREFIX = /* @__PURE__ */ Symbol("prefix"); - WriteEntry = class extends Minipass { - path; - portable; - myuid = process.getuid && process.getuid() || 0; - // until node has builtin pwnam functions, this'll have to do - myuser = process.env.USER || ""; - maxReadSize; - linkCache; - statCache; - preservePaths; - cwd; - strict; - mtime; - noPax; - noMtime; - prefix; - fd; - blockLen = 0; - blockRemain = 0; - buf; - pos = 0; - remain = 0; - length = 0; - offset = 0; - win32; - absolute; - header; - type; - linkpath; - stat; - onWriteEntry; - #hadError = false; - constructor(p, opt_ = {}) { - const opt = dealias(opt_); - super(); - this.path = normalizeWindowsPath(p); - this.portable = !!opt.portable; - this.maxReadSize = opt.maxReadSize || maxReadSize; - this.linkCache = opt.linkCache || /* @__PURE__ */ new Map(); - this.statCache = opt.statCache || /* @__PURE__ */ new Map(); - this.preservePaths = !!opt.preservePaths; - this.cwd = normalizeWindowsPath(opt.cwd || process.cwd()); - this.strict = !!opt.strict; - this.noPax = !!opt.noPax; - this.noMtime = !!opt.noMtime; - this.mtime = opt.mtime; - this.prefix = opt.prefix ? normalizeWindowsPath(opt.prefix) : void 0; - this.onWriteEntry = opt.onWriteEntry; - if (typeof opt.onwarn === "function") { - this.on("warn", opt.onwarn); - } - let pathWarn = false; - if (!this.preservePaths) { - const [root, stripped] = stripAbsolutePath(this.path); - if (root && typeof stripped === "string") { - this.path = stripped; - pathWarn = root; + function WriteStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); } - } - this.win32 = !!opt.win32 || process.platform === "win32"; - if (this.win32) { - this.path = decode(this.path.replaceAll(/\\/g, "/")); - p = p.replaceAll(/\\/g, "/"); - } - this.absolute = normalizeWindowsPath(opt.absolute || import_path9.default.resolve(this.cwd, p)); - if (this.path === "") { - this.path = "./"; - } - if (pathWarn) { - this.warn("TAR_ENTRY_INFO", `stripping ${pathWarn} from absolute path`, { - entry: this, - path: pathWarn + this.path + }); + } + function createReadStream(path16, options) { + return new fs18.ReadStream(path16, options); + } + function createWriteStream(path16, options) { + return new fs18.WriteStream(path16, options); + } + var fs$open = fs18.open; + fs18.open = open; + function open(path16, flags, mode, cb) { + if (typeof mode === "function") + cb = mode, mode = null; + return go$open(path16, flags, mode, cb); + function go$open(path17, flags2, mode2, cb2, startTime) { + return fs$open(path17, flags2, mode2, function(err, fd) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$open, [path17, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } }); } - const cs = this.statCache.get(this.absolute); - if (cs) { - this[ONLSTAT](cs); - } else { - this[LSTAT](); - } - } - warn(code2, message, data = {}) { - return warnMethod(this, code2, message, data); } - emit(ev, ...data) { - if (ev === "error") { - this.#hadError = true; + return fs18; + } + function enqueue(elem) { + debug("ENQUEUE", elem[0].name, elem[1]); + fs17[gracefulQueue].push(elem); + retry(); + } + var retryTimer; + function resetQueue() { + var now = Date.now(); + for (var i = 0; i < fs17[gracefulQueue].length; ++i) { + if (fs17[gracefulQueue][i].length > 2) { + fs17[gracefulQueue][i][3] = now; + fs17[gracefulQueue][i][4] = now; } - return super.emit(ev, ...data); - } - [LSTAT]() { - import_fs11.default.lstat(this.absolute, (er, stat) => { - if (er) { - return this.emit("error", er); - } - this[ONLSTAT](stat); - }); } - [ONLSTAT](stat) { - this.statCache.set(this.absolute, stat); - this.stat = stat; - if (!stat.isFile()) { - stat.size = 0; + retry(); + } + function retry() { + clearTimeout(retryTimer); + retryTimer = void 0; + if (fs17[gracefulQueue].length === 0) + return; + var elem = fs17[gracefulQueue].shift(); + var fn2 = elem[0]; + var args = elem[1]; + var err = elem[2]; + var startTime = elem[3]; + var lastTime = elem[4]; + if (startTime === void 0) { + debug("RETRY", fn2.name, args); + fn2.apply(null, args); + } else if (Date.now() - startTime >= 6e4) { + debug("TIMEOUT", fn2.name, args); + var cb = args.pop(); + if (typeof cb === "function") + cb.call(null, err); + } else { + var sinceAttempt = Date.now() - lastTime; + var sinceStart = Math.max(lastTime - startTime, 1); + var desiredDelay = Math.min(sinceStart * 1.2, 100); + if (sinceAttempt >= desiredDelay) { + debug("RETRY", fn2.name, args); + fn2.apply(null, args.concat([startTime])); + } else { + fs17[gracefulQueue].push(elem); } - this.type = getType(stat); - this.emit("stat", stat); - this[PROCESS](); } - [PROCESS]() { - switch (this.type) { - case "File": - return this[FILE2](); - case "Directory": - return this[DIRECTORY2](); - case "SymbolicLink": - return this[SYMLINK2](); - // unsupported types are ignored. - default: - return this.end(); - } + if (retryTimer === void 0) { + retryTimer = setTimeout(retry, 0); } - [MODE](mode) { - return modeFix(mode, this.type === "Directory", this.portable); + } + } +}); + +// node_modules/@zkochan/cmd-shim/index.js +var require_cmd_shim = __commonJS({ + "node_modules/@zkochan/cmd-shim/index.js"(exports2, module2) { + "use strict"; + cmdShim2.ifExists = cmdShimIfExists; + var util_1 = require("util"); + var path16 = require("path"); + var isWindows4 = require_is_windows(); + var CMD_EXTENSION = require_cmd_extension(); + var shebangExpr = /^#!\s*(?:\/usr\/bin\/env(?:\s+-S\s*)?)?\s*([^ \t]+)(.*)$/; + var DEFAULT_OPTIONS = { + // Create PowerShell file by default if the option hasn't been specified + createPwshFile: true, + createCmdFile: isWindows4(), + fs: require_graceful_fs() + }; + var extensionToProgramMap = /* @__PURE__ */ new Map([ + [".js", "node"], + [".cjs", "node"], + [".mjs", "node"], + [".cmd", "cmd"], + [".bat", "cmd"], + [".ps1", "pwsh"], + [".sh", "sh"] + ]); + function ingestOptions(opts) { + const opts_ = { ...DEFAULT_OPTIONS, ...opts }; + const fs17 = opts_.fs; + opts_.fs_ = { + chmod: fs17.chmod ? (0, util_1.promisify)(fs17.chmod) : (async () => { + }), + mkdir: (0, util_1.promisify)(fs17.mkdir), + readFile: (0, util_1.promisify)(fs17.readFile), + stat: (0, util_1.promisify)(fs17.stat), + unlink: (0, util_1.promisify)(fs17.unlink), + writeFile: (0, util_1.promisify)(fs17.writeFile) + }; + return opts_; + } + async function cmdShim2(src, to, opts) { + const opts_ = ingestOptions(opts); + await cmdShim_(src, to, opts_); + } + function cmdShimIfExists(src, to, opts) { + return cmdShim2(src, to, opts).catch(() => { + }); + } + function rm(path17, opts) { + return opts.fs_.unlink(path17).catch(() => { + }); + } + async function cmdShim_(src, to, opts) { + const srcRuntimeInfo = await searchScriptRuntime(src, opts); + await writeShimsPreCommon(to, opts); + return writeAllShims(src, to, srcRuntimeInfo, opts); + } + function writeShimsPreCommon(target, opts) { + return opts.fs_.mkdir(path16.dirname(target), { recursive: true }); + } + function writeAllShims(src, to, srcRuntimeInfo, opts) { + const opts_ = ingestOptions(opts); + const generatorAndExts = [{ generator: generateShShim, extension: "" }]; + if (opts_.createCmdFile) { + generatorAndExts.push({ generator: generateCmdShim, extension: CMD_EXTENSION }); } - [PREFIX](path16) { - return prefixPath(path16, this.prefix); + if (opts_.createPwshFile) { + generatorAndExts.push({ generator: generatePwshShim, extension: ".ps1" }); } - [HEADER]() { - if (!this.stat) { - throw new Error("cannot write header before stat"); - } - if (this.type === "Directory" && this.portable) { - this.noMtime = true; - } - this.onWriteEntry?.(this); - this.header = new Header({ - path: this[PREFIX](this.path), - // only apply the prefix to hard links. - linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, - // only the permissions and setuid/setgid/sticky bitflags - // not the higher-order bits that specify file type - mode: this[MODE](this.stat.mode), - uid: this.portable ? void 0 : this.stat.uid, - gid: this.portable ? void 0 : this.stat.gid, - size: this.stat.size, - mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, - /* c8 ignore next */ - type: this.type === "Unsupported" ? void 0 : this.type, - uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", - atime: this.portable ? void 0 : this.stat.atime, - ctime: this.portable ? void 0 : this.stat.ctime - }); - if (this.header.encode() && !this.noPax) { - super.write(new Pax({ - atime: this.portable ? void 0 : this.header.atime, - ctime: this.portable ? void 0 : this.header.ctime, - gid: this.portable ? void 0 : this.header.gid, - mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, - path: this[PREFIX](this.path), - linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, - size: this.header.size, - uid: this.portable ? void 0 : this.header.uid, - uname: this.portable ? void 0 : this.header.uname, - dev: this.portable ? void 0 : this.stat.dev, - ino: this.portable ? void 0 : this.stat.ino, - nlink: this.portable ? void 0 : this.stat.nlink - }).encode()); + return Promise.all(generatorAndExts.map((generatorAndExt) => writeShim(src, to + generatorAndExt.extension, srcRuntimeInfo, generatorAndExt.generator, opts_))); + } + function writeShimPre(target, opts) { + return rm(target, opts); + } + function writeShimPost(target, opts) { + return chmodShim(target, opts); + } + async function searchScriptRuntime(target, opts) { + try { + const data = await opts.fs_.readFile(target, "utf8"); + const firstLine = data.trim().split(/\r*\n/)[0]; + const shebang = firstLine.match(shebangExpr); + if (!shebang) { + const targetExtension = path16.extname(target).toLowerCase(); + return { + // undefined if extension is unknown but it's converted to null. + program: extensionToProgramMap.get(targetExtension) || null, + additionalArgs: "" + }; } - const block = this.header?.block; - if (!block) { - throw new Error("failed to encode header"); + return { + program: shebang[1], + additionalArgs: shebang[2] + }; + } catch (err) { + if (!isWindows4() || err.code !== "ENOENT") + throw err; + if (await opts.fs_.stat(`${target}${getExeExtension()}`)) { + return { + program: null, + additionalArgs: "" + }; } - super.write(block); + throw err; } - [DIRECTORY2]() { - if (!this.stat) { - throw new Error("cannot create directory entry without stat"); - } - if (this.path.slice(-1) !== "/") { - this.path += "/"; - } - this.stat.size = 0; - this[HEADER](); - this.end(); + } + function getExeExtension() { + let cmdExtension; + if (process.env.PATHEXT) { + cmdExtension = process.env.PATHEXT.split(path16.delimiter).find((ext) => ext.toLowerCase() === ".exe"); + } + return cmdExtension || ".exe"; + } + async function writeShim(src, to, srcRuntimeInfo, generateShimScript, opts) { + const defaultArgs = opts.preserveSymlinks ? "--preserve-symlinks" : ""; + const args = [srcRuntimeInfo.additionalArgs, defaultArgs].filter((arg) => arg).join(" "); + opts = Object.assign({}, opts, { + prog: srcRuntimeInfo.program, + args + }); + await writeShimPre(to, opts); + await opts.fs_.writeFile(to, generateShimScript(src, to, opts), "utf8"); + return writeShimPost(to, opts); + } + function generateCmdShim(src, to, opts) { + const shTarget = path16.relative(path16.dirname(to), src); + let target = shTarget.split("/").join("\\"); + const quotedPathToTarget = path16.isAbsolute(target) ? `"${target}"` : `"%~dp0\\${target}"`; + let longProg; + let prog = opts.prog; + let args = opts.args || ""; + const nodePath = normalizePathEnvVar(opts.nodePath).win32; + const prependToPath = normalizePathEnvVar(opts.prependToPath).win32; + if (!prog) { + prog = quotedPathToTarget; + args = ""; + target = ""; + } else if (prog === "node" && opts.nodeExecPath) { + prog = `"${opts.nodeExecPath}"`; + target = quotedPathToTarget; + } else { + longProg = `"%~dp0\\${prog}.exe"`; + target = quotedPathToTarget; } - [SYMLINK2]() { - import_fs11.default.readlink(this.absolute, (er, linkpath) => { - if (er) { - return this.emit("error", er); - } - this[ONREADLINK](linkpath); - }); + let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; + let cmd = "@SETLOCAL\r\n"; + if (prependToPath) { + cmd += `@SET "PATH=${prependToPath}:%PATH%"\r +`; } - [ONREADLINK](linkpath) { - this.linkpath = normalizeWindowsPath(linkpath); - this[HEADER](); - this.end(); + if (nodePath) { + cmd += `@IF NOT DEFINED NODE_PATH (\r + @SET "NODE_PATH=${nodePath}"\r +) ELSE (\r + @SET "NODE_PATH=${nodePath};%NODE_PATH%"\r +)\r +`; } - [HARDLINK2](linkpath) { - if (!this.stat) { - throw new Error("cannot create link entry without stat"); - } - this.type = "Link"; - this.linkpath = normalizeWindowsPath(import_path9.default.relative(this.cwd, linkpath)); - this.stat.size = 0; - this[HEADER](); - this.end(); + if (longProg) { + cmd += `@IF EXIST ${longProg} (\r + ${longProg} ${args} ${target} ${progArgs}%*\r +) ELSE (\r + @SET PATHEXT=%PATHEXT:;.JS;=;%\r + ${prog} ${args} ${target} ${progArgs}%*\r +)\r +`; + } else { + cmd += `@${prog} ${args} ${target} ${progArgs}%*\r +`; } - [FILE2]() { - if (!this.stat) { - throw new Error("cannot create file entry without stat"); - } - if (this.stat.nlink > 1) { - const linkKey = `${this.stat.dev}:${this.stat.ino}`; - const linkpath = this.linkCache.get(linkKey); - if (linkpath?.indexOf(this.cwd) === 0) { - return this[HARDLINK2](linkpath); - } - this.linkCache.set(linkKey, this.absolute); - } - this[HEADER](); - if (this.stat.size === 0) { - return this.end(); - } - this[OPENFILE](); + return cmd; + } + function generateShShim(src, to, opts) { + let shTarget = path16.relative(path16.dirname(to), src); + let shProg = opts.prog && opts.prog.split("\\").join("/"); + let shLongProg; + shTarget = shTarget.split("\\").join("/"); + const quotedPathToTarget = path16.isAbsolute(shTarget) ? `"${shTarget}"` : `"$basedir/${shTarget}"`; + let args = opts.args || ""; + const shNodePath = normalizePathEnvVar(opts.nodePath).posix; + if (!shProg) { + shProg = quotedPathToTarget; + args = ""; + shTarget = ""; + } else if (opts.prog === "node" && opts.nodeExecPath) { + shProg = `"${opts.nodeExecPath}"`; + shTarget = quotedPathToTarget; + } else { + shLongProg = `"$basedir/${opts.prog}"`; + shTarget = quotedPathToTarget; } - [OPENFILE]() { - import_fs11.default.open(this.absolute, "r", (er, fd) => { - if (er) { - return this.emit("error", er); - } - this[ONOPENFILE](fd); - }); + let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; + let sh = `#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')") + +case \`uname\` in + *CYGWIN*) basedir=\`cygpath -w "$basedir"\`;; +esac + +`; + if (opts.prependToPath) { + sh += `export PATH="${opts.prependToPath}:$PATH" +`; } - [ONOPENFILE](fd) { - this.fd = fd; - if (this.#hadError) { - return this[CLOSE](); - } - if (!this.stat) { - throw new Error("should stat before calling onopenfile"); - } - this.blockLen = 512 * Math.ceil(this.stat.size / 512); - this.blockRemain = this.blockLen; - const bufLen = Math.min(this.blockLen, this.maxReadSize); - this.buf = Buffer.allocUnsafe(bufLen); - this.offset = 0; - this.pos = 0; - this.remain = this.stat.size; - this.length = this.buf.length; - this[READ2](); + if (shNodePath) { + sh += `if [ -z "$NODE_PATH" ]; then + export NODE_PATH="${shNodePath}" +else + export NODE_PATH="${shNodePath}:$NODE_PATH" +fi +`; } - [READ2]() { - const { fd, buf, offset, length, pos: pos2 } = this; - if (fd === void 0 || buf === void 0) { - throw new Error("cannot read file without first opening"); - } - import_fs11.default.read(fd, buf, offset, length, pos2, (er, bytesRead) => { - if (er) { - return this[CLOSE](() => this.emit("error", er)); - } - this[ONREAD](bytesRead); - }); + if (shLongProg) { + sh += `if [ -x ${shLongProg} ]; then + exec ${shLongProg} ${args} ${shTarget} ${progArgs}"$@" +else + exec ${shProg} ${args} ${shTarget} ${progArgs}"$@" +fi +`; + } else { + sh += `${shProg} ${args} ${shTarget} ${progArgs}"$@" +exit $? +`; } - /* c8 ignore start */ - [CLOSE](cb = () => { - }) { - if (this.fd !== void 0) - import_fs11.default.close(this.fd, cb); + return sh; + } + function generatePwshShim(src, to, opts) { + let shTarget = path16.relative(path16.dirname(to), src); + const shProg = opts.prog && opts.prog.split("\\").join("/"); + let pwshProg = shProg && `"${shProg}$exe"`; + let pwshLongProg; + shTarget = shTarget.split("\\").join("/"); + const quotedPathToTarget = path16.isAbsolute(shTarget) ? `"${shTarget}"` : `"$basedir/${shTarget}"`; + let args = opts.args || ""; + let normalizedNodePathEnvVar = normalizePathEnvVar(opts.nodePath); + const nodePath = normalizedNodePathEnvVar.win32; + const shNodePath = normalizedNodePathEnvVar.posix; + let normalizedPrependPathEnvVar = normalizePathEnvVar(opts.prependToPath); + const prependPath = normalizedPrependPathEnvVar.win32; + const shPrependPath = normalizedPrependPathEnvVar.posix; + if (!pwshProg) { + pwshProg = quotedPathToTarget; + args = ""; + shTarget = ""; + } else if (opts.prog === "node" && opts.nodeExecPath) { + pwshProg = `"${opts.nodeExecPath}"`; + shTarget = quotedPathToTarget; + } else { + pwshLongProg = `"$basedir/${opts.prog}$exe"`; + shTarget = quotedPathToTarget; } - [ONREAD](bytesRead) { - if (bytesRead <= 0 && this.remain > 0) { - const er = Object.assign(new Error("encountered unexpected EOF"), { - path: this.absolute, - syscall: "read", - code: "EOF" - }); - return this[CLOSE](() => this.emit("error", er)); - } - if (bytesRead > this.remain) { - const er = Object.assign(new Error("did not encounter expected EOF"), { - path: this.absolute, - syscall: "read", - code: "EOF" - }); - return this[CLOSE](() => this.emit("error", er)); - } - if (!this.buf) { - throw new Error("should have created buffer prior to reading"); - } - if (bytesRead === this.remain) { - for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) { - this.buf[i + this.offset] = 0; - bytesRead++; - this.remain++; - } - } - const chunk = this.offset === 0 && bytesRead === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + bytesRead); - const flushed = this.write(chunk); - if (!flushed) { - this[AWAITDRAIN](() => this[ONDRAIN]()); - } else { - this[ONDRAIN](); - } + let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; + let pwsh = `#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +${nodePath || prependPath ? '$pathsep=":"\n' : ""}${nodePath ? `$env_node_path=$env:NODE_PATH +$new_node_path="${nodePath}" +` : ""}${prependPath ? `$env_path=$env:PATH +$prepend_path="${prependPath}" +` : ""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +${nodePath || prependPath ? ' $pathsep=";"\n' : ""}}`; + if (shNodePath || shPrependPath) { + pwsh += ` else { +${shNodePath ? ` $new_node_path="${shNodePath}" +` : ""}${shPrependPath ? ` $prepend_path="${shPrependPath}" +` : ""}} +`; } - [AWAITDRAIN](cb) { - this.once("drain", cb); + if (shNodePath) { + pwsh += `if ([string]::IsNullOrEmpty($env_node_path)) { + $env:NODE_PATH=$new_node_path +} else { + $env:NODE_PATH="$new_node_path$pathsep$env_node_path" +} +`; } - write(chunk, encoding, cb) { - if (typeof encoding === "function") { - cb = encoding; - encoding = void 0; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8"); - } - if (this.blockRemain < chunk.length) { - const er = Object.assign(new Error("writing more data than expected"), { - path: this.absolute - }); - return this.emit("error", er); - } - this.remain -= chunk.length; - this.blockRemain -= chunk.length; - this.pos += chunk.length; - this.offset += chunk.length; - return super.write(chunk, null, cb); + if (opts.prependToPath) { + pwsh += ` +$env:PATH="$prepend_path$pathsep$env:PATH" +`; } - [ONDRAIN]() { - if (!this.remain) { - if (this.blockRemain) { - super.write(Buffer.alloc(this.blockRemain)); - } - return this[CLOSE]((er) => er ? this.emit("error", er) : this.end()); - } - if (!this.buf) { - throw new Error("buffer lost somehow in ONDRAIN"); - } - if (this.offset >= this.length) { - this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)); - this.offset = 0; - } - this.length = this.buf.length - this.offset; - this[READ2](); + if (pwshLongProg) { + pwsh += ` +$ret=0 +if (Test-Path ${pwshLongProg}) { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & ${pwshLongProg} ${args} ${shTarget} ${progArgs}$args + } else { + & ${pwshLongProg} ${args} ${shTarget} ${progArgs}$args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & ${pwshProg} ${args} ${shTarget} ${progArgs}$args + } else { + & ${pwshProg} ${args} ${shTarget} ${progArgs}$args + } + $ret=$LASTEXITCODE +} +${nodePath ? "$env:NODE_PATH=$env_node_path\n" : ""}${prependPath ? "$env:PATH=$env_path\n" : ""}exit $ret +`; + } else { + pwsh += ` +# Support pipeline input +if ($MyInvocation.ExpectingInput) { + $input | & ${pwshProg} ${args} ${shTarget} ${progArgs}$args +} else { + & ${pwshProg} ${args} ${shTarget} ${progArgs}$args +} +${nodePath ? "$env:NODE_PATH=$env_node_path\n" : ""}${prependPath ? "$env:PATH=$env_path\n" : ""}exit $LASTEXITCODE +`; } - }; - WriteEntrySync = class extends WriteEntry { - sync = true; - [LSTAT]() { - this[ONLSTAT](import_fs11.default.lstatSync(this.absolute)); + return pwsh; + } + function chmodShim(to, opts) { + return opts.fs_.chmod(to, 493); + } + function normalizePathEnvVar(nodePath) { + if (!nodePath || !nodePath.length) { + return { + win32: "", + posix: "" + }; } - [SYMLINK2]() { - this[ONREADLINK](import_fs11.default.readlinkSync(this.absolute)); + let split = typeof nodePath === "string" ? nodePath.split(path16.delimiter) : Array.from(nodePath); + let result = {}; + for (let i = 0; i < split.length; i++) { + const win322 = split[i].split("/").join("\\"); + const posix = isWindows4() ? split[i].split("\\").join("/").replace(/^([^:\\/]*):/, (_, $1) => `/mnt/${$1.toLowerCase()}`) : split[i]; + result.win32 = result.win32 ? `${result.win32};${win322}` : win322; + result.posix = result.posix ? `${result.posix}:${posix}` : posix; + result[i] = { win32: win322, posix }; } - [OPENFILE]() { - this[ONOPENFILE](import_fs11.default.openSync(this.absolute, "r")); + return result; + } + module2.exports = cmdShim2; + } +}); + +// node_modules/tar/dist/esm/mode-fix.js +var modeFix; +var init_mode_fix = __esm({ + "node_modules/tar/dist/esm/mode-fix.js"() { + modeFix = (mode, isDir, portable) => { + mode &= 4095; + if (portable) { + mode = (mode | 384) & ~18; } - [READ2]() { - let threw = true; - try { - const { fd, buf, offset, length, pos: pos2 } = this; - if (fd === void 0 || buf === void 0) { - throw new Error("fd and buf must be set in READ method"); - } - const bytesRead = import_fs11.default.readSync(fd, buf, offset, length, pos2); - this[ONREAD](bytesRead); - threw = false; - } finally { - if (threw) { - try { - this[CLOSE](() => { - }); - } catch { - } - } + if (isDir) { + if (mode & 256) { + mode |= 64; + } + if (mode & 32) { + mode |= 8; + } + if (mode & 4) { + mode |= 1; } } - [AWAITDRAIN](cb) { - cb(); - } - /* c8 ignore start */ - [CLOSE](cb = () => { - }) { - if (this.fd !== void 0) - import_fs11.default.closeSync(this.fd); - cb(); + return mode; + }; + } +}); + +// node_modules/tar/dist/esm/write-entry.js +var import_fs11, import_path9, prefixPath, maxReadSize, PROCESS, FILE2, DIRECTORY2, SYMLINK2, HARDLINK2, HEADER, READ2, LSTAT, ONLSTAT, ONREAD, ONREADLINK, OPENFILE, ONOPENFILE, CLOSE, MODE, AWAITDRAIN, ONDRAIN, PREFIX, WriteEntry, WriteEntrySync, WriteEntryTar, getType; +var init_write_entry = __esm({ + "node_modules/tar/dist/esm/write-entry.js"() { + import_fs11 = __toESM(require("fs"), 1); + init_esm(); + import_path9 = __toESM(require("path"), 1); + init_header(); + init_mode_fix(); + init_normalize_windows_path(); + init_options(); + init_pax(); + init_strip_absolute_path(); + init_strip_trailing_slashes(); + init_warn_method(); + init_winchars(); + prefixPath = (path16, prefix) => { + if (!prefix) { + return normalizeWindowsPath(path16); } + path16 = normalizeWindowsPath(path16).replace(/^\.(\/|$)/, ""); + return stripTrailingSlashes(prefix) + "/" + path16; }; - WriteEntryTar = class extends Minipass { - blockLen = 0; - blockRemain = 0; - buf = 0; - pos = 0; - remain = 0; - length = 0; - preservePaths; + maxReadSize = 16 * 1024 * 1024; + PROCESS = /* @__PURE__ */ Symbol("process"); + FILE2 = /* @__PURE__ */ Symbol("file"); + DIRECTORY2 = /* @__PURE__ */ Symbol("directory"); + SYMLINK2 = /* @__PURE__ */ Symbol("symlink"); + HARDLINK2 = /* @__PURE__ */ Symbol("hardlink"); + HEADER = /* @__PURE__ */ Symbol("header"); + READ2 = /* @__PURE__ */ Symbol("read"); + LSTAT = /* @__PURE__ */ Symbol("lstat"); + ONLSTAT = /* @__PURE__ */ Symbol("onlstat"); + ONREAD = /* @__PURE__ */ Symbol("onread"); + ONREADLINK = /* @__PURE__ */ Symbol("onreadlink"); + OPENFILE = /* @__PURE__ */ Symbol("openfile"); + ONOPENFILE = /* @__PURE__ */ Symbol("onopenfile"); + CLOSE = /* @__PURE__ */ Symbol("close"); + MODE = /* @__PURE__ */ Symbol("mode"); + AWAITDRAIN = /* @__PURE__ */ Symbol("awaitDrain"); + ONDRAIN = /* @__PURE__ */ Symbol("ondrain"); + PREFIX = /* @__PURE__ */ Symbol("prefix"); + WriteEntry = class extends Minipass { + path; portable; + myuid = process.getuid && process.getuid() || 0; + // until node has builtin pwnam functions, this'll have to do + myuser = process.env.USER || ""; + maxReadSize; + linkCache; + statCache; + preservePaths; + cwd; strict; + mtime; noPax; noMtime; - readEntry; - type; prefix; - path; - mode; - uid; - gid; - uname; - gname; + fd; + blockLen = 0; + blockRemain = 0; + buf; + pos = 0; + remain = 0; + length = 0; + offset = 0; + win32; + absolute; header; - mtime; - atime; - ctime; + type; linkpath; - size; + stat; onWriteEntry; - warn(code2, message, data = {}) { - return warnMethod(this, code2, message, data); - } - constructor(readEntry, opt_ = {}) { + #hadError = false; + constructor(p, opt_ = {}) { const opt = dealias(opt_); super(); + this.path = normalizeWindowsPath(p); + this.portable = !!opt.portable; + this.maxReadSize = opt.maxReadSize || maxReadSize; + this.linkCache = opt.linkCache || /* @__PURE__ */ new Map(); + this.statCache = opt.statCache || /* @__PURE__ */ new Map(); this.preservePaths = !!opt.preservePaths; - this.portable = !!opt.portable; + this.cwd = normalizeWindowsPath(opt.cwd || process.cwd()); this.strict = !!opt.strict; this.noPax = !!opt.noPax; this.noMtime = !!opt.noMtime; + this.mtime = opt.mtime; + this.prefix = opt.prefix ? normalizeWindowsPath(opt.prefix) : void 0; this.onWriteEntry = opt.onWriteEntry; - this.readEntry = readEntry; - const { type } = readEntry; - if (type === "Unsupported") { - throw new Error("writing entry that should be ignored"); - } - this.type = type; - if (this.type === "Directory" && this.portable) { - this.noMtime = true; - } - this.prefix = opt.prefix; - this.path = normalizeWindowsPath(readEntry.path); - this.mode = readEntry.mode !== void 0 ? this[MODE](readEntry.mode) : void 0; - this.uid = this.portable ? void 0 : readEntry.uid; - this.gid = this.portable ? void 0 : readEntry.gid; - this.uname = this.portable ? void 0 : readEntry.uname; - this.gname = this.portable ? void 0 : readEntry.gname; - this.size = readEntry.size; - this.mtime = this.noMtime ? void 0 : opt.mtime || readEntry.mtime; - this.atime = this.portable ? void 0 : readEntry.atime; - this.ctime = this.portable ? void 0 : readEntry.ctime; - this.linkpath = readEntry.linkpath !== void 0 ? normalizeWindowsPath(readEntry.linkpath) : void 0; if (typeof opt.onwarn === "function") { this.on("warn", opt.onwarn); } @@ -19102,2670 +11123,1450 @@ var init_write_entry = __esm({ pathWarn = root; } } - this.remain = readEntry.size; - this.blockRemain = readEntry.startBlockSize; - this.onWriteEntry?.(this); - this.header = new Header({ - path: this[PREFIX](this.path), - linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, - // only the permissions and setuid/setgid/sticky bitflags - // not the higher-order bits that specify file type - mode: this.mode, - uid: this.portable ? void 0 : this.uid, - gid: this.portable ? void 0 : this.gid, - size: this.size, - mtime: this.noMtime ? void 0 : this.mtime, - type: this.type, - uname: this.portable ? void 0 : this.uname, - atime: this.portable ? void 0 : this.atime, - ctime: this.portable ? void 0 : this.ctime - }); + this.win32 = !!opt.win32 || process.platform === "win32"; + if (this.win32) { + this.path = decode(this.path.replaceAll(/\\/g, "/")); + p = p.replaceAll(/\\/g, "/"); + } + this.absolute = normalizeWindowsPath(opt.absolute || import_path9.default.resolve(this.cwd, p)); + if (this.path === "") { + this.path = "./"; + } if (pathWarn) { this.warn("TAR_ENTRY_INFO", `stripping ${pathWarn} from absolute path`, { entry: this, path: pathWarn + this.path }); } - if (this.header.encode() && !this.noPax) { - super.write(new Pax({ - atime: this.portable ? void 0 : this.atime, - ctime: this.portable ? void 0 : this.ctime, - gid: this.portable ? void 0 : this.gid, - mtime: this.noMtime ? void 0 : this.mtime, - path: this[PREFIX](this.path), - linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, - size: this.size, - uid: this.portable ? void 0 : this.uid, - uname: this.portable ? void 0 : this.uname, - dev: this.portable ? void 0 : this.readEntry.dev, - ino: this.portable ? void 0 : this.readEntry.ino, - nlink: this.portable ? void 0 : this.readEntry.nlink - }).encode()); - } - const b = this.header?.block; - if (!b) - throw new Error("failed to encode header"); - super.write(b); - readEntry.pipe(this); - } - [PREFIX](path16) { - return prefixPath(path16, this.prefix); - } - [MODE](mode) { - return modeFix(mode, this.type === "Directory", this.portable); - } - write(chunk, encoding, cb) { - if (typeof encoding === "function") { - cb = encoding; - encoding = void 0; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8"); - } - const writeLen = chunk.length; - if (writeLen > this.blockRemain) { - throw new Error("writing more to entry than is appropriate"); - } - this.blockRemain -= writeLen; - return super.write(chunk, cb); - } - end(chunk, encoding, cb) { - if (this.blockRemain) { - super.write(Buffer.alloc(this.blockRemain)); - } - if (typeof chunk === "function") { - cb = chunk; - encoding = void 0; - chunk = void 0; - } - if (typeof encoding === "function") { - cb = encoding; - encoding = void 0; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding ?? "utf8"); + const cs = this.statCache.get(this.absolute); + if (cs) { + this[ONLSTAT](cs); + } else { + this[LSTAT](); } - if (cb) - this.once("finish", cb); - if (chunk) - super.end(chunk, cb); - else - super.end(cb); - return this; - } - }; - getType = (stat) => stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : "Unsupported"; - } -}); - -// .yarn/cache/yallist-npm-5.0.0-8732dd9f1c-a499c81ce6.zip/node_modules/yallist/dist/esm/index.js -function insertAfter(self2, node, value) { - const prev = node; - const next = node ? node.next : self2.head; - const inserted = new Node(value, prev, next, self2); - if (inserted.next === void 0) { - self2.tail = inserted; - } - if (inserted.prev === void 0) { - self2.head = inserted; - } - self2.length++; - return inserted; -} -function push(self2, item) { - self2.tail = new Node(item, self2.tail, void 0, self2); - if (!self2.head) { - self2.head = self2.tail; - } - self2.length++; -} -function unshift(self2, item) { - self2.head = new Node(item, void 0, self2.head, self2); - if (!self2.tail) { - self2.tail = self2.head; - } - self2.length++; -} -var Yallist, Node; -var init_esm5 = __esm({ - ".yarn/cache/yallist-npm-5.0.0-8732dd9f1c-a499c81ce6.zip/node_modules/yallist/dist/esm/index.js"() { - Yallist = class _Yallist { - tail; - head; - length = 0; - static create(list2 = []) { - return new _Yallist(list2); } - constructor(list2 = []) { - for (const item of list2) { - this.push(item); - } + warn(code2, message, data = {}) { + return warnMethod(this, code2, message, data); } - *[Symbol.iterator]() { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value; + emit(ev, ...data) { + if (ev === "error") { + this.#hadError = true; } + return super.emit(ev, ...data); } - removeNode(node) { - if (node.list !== this) { - throw new Error("removing node which does not belong to this list"); - } - const next = node.next; - const prev = node.prev; - if (next) { - next.prev = prev; - } - if (prev) { - prev.next = next; - } - if (node === this.head) { - this.head = next; - } - if (node === this.tail) { - this.tail = prev; - } - this.length--; - node.next = void 0; - node.prev = void 0; - node.list = void 0; - return next; + [LSTAT]() { + import_fs11.default.lstat(this.absolute, (er, stat) => { + if (er) { + return this.emit("error", er); + } + this[ONLSTAT](stat); + }); } - unshiftNode(node) { - if (node === this.head) { - return; - } - if (node.list) { - node.list.removeNode(node); - } - const head = this.head; - node.list = this; - node.next = head; - if (head) { - head.prev = node; - } - this.head = node; - if (!this.tail) { - this.tail = node; + [ONLSTAT](stat) { + this.statCache.set(this.absolute, stat); + this.stat = stat; + if (!stat.isFile()) { + stat.size = 0; } - this.length++; + this.type = getType(stat); + this.emit("stat", stat); + this[PROCESS](); } - pushNode(node) { - if (node === this.tail) { - return; - } - if (node.list) { - node.list.removeNode(node); - } - const tail = this.tail; - node.list = this; - node.prev = tail; - if (tail) { - tail.next = node; - } - this.tail = node; - if (!this.head) { - this.head = node; + [PROCESS]() { + switch (this.type) { + case "File": + return this[FILE2](); + case "Directory": + return this[DIRECTORY2](); + case "SymbolicLink": + return this[SYMLINK2](); + // unsupported types are ignored. + default: + return this.end(); } - this.length++; } - push(...args) { - for (let i = 0, l = args.length; i < l; i++) { - push(this, args[i]); - } - return this.length; + [MODE](mode) { + return modeFix(mode, this.type === "Directory", this.portable); } - unshift(...args) { - for (var i = 0, l = args.length; i < l; i++) { - unshift(this, args[i]); - } - return this.length; + [PREFIX](path16) { + return prefixPath(path16, this.prefix); } - pop() { - if (!this.tail) { - return void 0; + [HEADER]() { + if (!this.stat) { + throw new Error("cannot write header before stat"); } - const res = this.tail.value; - const t = this.tail; - this.tail = this.tail.prev; - if (this.tail) { - this.tail.next = void 0; - } else { - this.head = void 0; + if (this.type === "Directory" && this.portable) { + this.noMtime = true; } - t.list = void 0; - this.length--; - return res; - } - shift() { - if (!this.head) { - return void 0; + this.onWriteEntry?.(this); + this.header = new Header({ + path: this[PREFIX](this.path), + // only apply the prefix to hard links. + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this[MODE](this.stat.mode), + uid: this.portable ? void 0 : this.stat.uid, + gid: this.portable ? void 0 : this.stat.gid, + size: this.stat.size, + mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, + /* c8 ignore next */ + type: this.type === "Unsupported" ? void 0 : this.type, + uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", + atime: this.portable ? void 0 : this.stat.atime, + ctime: this.portable ? void 0 : this.stat.ctime + }); + if (this.header.encode() && !this.noPax) { + super.write(new Pax({ + atime: this.portable ? void 0 : this.header.atime, + ctime: this.portable ? void 0 : this.header.ctime, + gid: this.portable ? void 0 : this.header.gid, + mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, + path: this[PREFIX](this.path), + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + size: this.header.size, + uid: this.portable ? void 0 : this.header.uid, + uname: this.portable ? void 0 : this.header.uname, + dev: this.portable ? void 0 : this.stat.dev, + ino: this.portable ? void 0 : this.stat.ino, + nlink: this.portable ? void 0 : this.stat.nlink + }).encode()); } - const res = this.head.value; - const h = this.head; - this.head = this.head.next; - if (this.head) { - this.head.prev = void 0; - } else { - this.tail = void 0; + const block = this.header?.block; + if (!block) { + throw new Error("failed to encode header"); } - h.list = void 0; - this.length--; - return res; + super.write(block); } - forEach(fn2, thisp) { - thisp = thisp || this; - for (let walker = this.head, i = 0; !!walker; i++) { - fn2.call(thisp, walker.value, i, this); - walker = walker.next; + [DIRECTORY2]() { + if (!this.stat) { + throw new Error("cannot create directory entry without stat"); } + if (this.path.slice(-1) !== "/") { + this.path += "/"; + } + this.stat.size = 0; + this[HEADER](); + this.end(); } - forEachReverse(fn2, thisp) { - thisp = thisp || this; - for (let walker = this.tail, i = this.length - 1; !!walker; i--) { - fn2.call(thisp, walker.value, i, this); - walker = walker.prev; + [SYMLINK2]() { + import_fs11.default.readlink(this.absolute, (er, linkpath) => { + if (er) { + return this.emit("error", er); + } + this[ONREADLINK](linkpath); + }); + } + [ONREADLINK](linkpath) { + this.linkpath = normalizeWindowsPath(linkpath); + this[HEADER](); + this.end(); + } + [HARDLINK2](linkpath) { + if (!this.stat) { + throw new Error("cannot create link entry without stat"); } + this.type = "Link"; + this.linkpath = normalizeWindowsPath(import_path9.default.relative(this.cwd, linkpath)); + this.stat.size = 0; + this[HEADER](); + this.end(); } - get(n) { - let i = 0; - let walker = this.head; - for (; !!walker && i < n; i++) { - walker = walker.next; + [FILE2]() { + if (!this.stat) { + throw new Error("cannot create file entry without stat"); } - if (i === n && !!walker) { - return walker.value; + if (this.stat.nlink > 1) { + const linkKey = `${this.stat.dev}:${this.stat.ino}`; + const linkpath = this.linkCache.get(linkKey); + if (linkpath?.indexOf(this.cwd) === 0) { + return this[HARDLINK2](linkpath); + } + this.linkCache.set(linkKey, this.absolute); + } + this[HEADER](); + if (this.stat.size === 0) { + return this.end(); } + this[OPENFILE](); } - getReverse(n) { - let i = 0; - let walker = this.tail; - for (; !!walker && i < n; i++) { - walker = walker.prev; + [OPENFILE]() { + import_fs11.default.open(this.absolute, "r", (er, fd) => { + if (er) { + return this.emit("error", er); + } + this[ONOPENFILE](fd); + }); + } + [ONOPENFILE](fd) { + this.fd = fd; + if (this.#hadError) { + return this[CLOSE](); } - if (i === n && !!walker) { - return walker.value; + if (!this.stat) { + throw new Error("should stat before calling onopenfile"); } + this.blockLen = 512 * Math.ceil(this.stat.size / 512); + this.blockRemain = this.blockLen; + const bufLen = Math.min(this.blockLen, this.maxReadSize); + this.buf = Buffer.allocUnsafe(bufLen); + this.offset = 0; + this.pos = 0; + this.remain = this.stat.size; + this.length = this.buf.length; + this[READ2](); } - map(fn2, thisp) { - thisp = thisp || this; - const res = new _Yallist(); - for (let walker = this.head; !!walker; ) { - res.push(fn2.call(thisp, walker.value, this)); - walker = walker.next; + [READ2]() { + const { fd, buf, offset, length, pos: pos2 } = this; + if (fd === void 0 || buf === void 0) { + throw new Error("cannot read file without first opening"); } - return res; + import_fs11.default.read(fd, buf, offset, length, pos2, (er, bytesRead) => { + if (er) { + return this[CLOSE](() => this.emit("error", er)); + } + this[ONREAD](bytesRead); + }); } - mapReverse(fn2, thisp) { - thisp = thisp || this; - var res = new _Yallist(); - for (let walker = this.tail; !!walker; ) { - res.push(fn2.call(thisp, walker.value, this)); - walker = walker.prev; - } - return res; + /* c8 ignore start */ + [CLOSE](cb = () => { + }) { + if (this.fd !== void 0) + import_fs11.default.close(this.fd, cb); } - reduce(fn2, initial) { - let acc; - let walker = this.head; - if (arguments.length > 1) { - acc = initial; - } else if (this.head) { - walker = this.head.next; - acc = this.head.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); - } - for (var i = 0; !!walker; i++) { - acc = fn2(acc, walker.value, i); - walker = walker.next; + [ONREAD](bytesRead) { + if (bytesRead <= 0 && this.remain > 0) { + const er = Object.assign(new Error("encountered unexpected EOF"), { + path: this.absolute, + syscall: "read", + code: "EOF" + }); + return this[CLOSE](() => this.emit("error", er)); } - return acc; - } - reduceReverse(fn2, initial) { - let acc; - let walker = this.tail; - if (arguments.length > 1) { - acc = initial; - } else if (this.tail) { - walker = this.tail.prev; - acc = this.tail.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); + if (bytesRead > this.remain) { + const er = Object.assign(new Error("did not encounter expected EOF"), { + path: this.absolute, + syscall: "read", + code: "EOF" + }); + return this[CLOSE](() => this.emit("error", er)); } - for (let i = this.length - 1; !!walker; i--) { - acc = fn2(acc, walker.value, i); - walker = walker.prev; + if (!this.buf) { + throw new Error("should have created buffer prior to reading"); } - return acc; - } - toArray() { - const arr = new Array(this.length); - for (let i = 0, walker = this.head; !!walker; i++) { - arr[i] = walker.value; - walker = walker.next; + if (bytesRead === this.remain) { + for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) { + this.buf[i + this.offset] = 0; + bytesRead++; + this.remain++; + } } - return arr; - } - toArrayReverse() { - const arr = new Array(this.length); - for (let i = 0, walker = this.tail; !!walker; i++) { - arr[i] = walker.value; - walker = walker.prev; + const chunk = this.offset === 0 && bytesRead === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + bytesRead); + const flushed = this.write(chunk); + if (!flushed) { + this[AWAITDRAIN](() => this[ONDRAIN]()); + } else { + this[ONDRAIN](); } - return arr; } - slice(from = 0, to = this.length) { - if (to < 0) { - to += this.length; - } - if (from < 0) { - from += this.length; + [AWAITDRAIN](cb) { + this.once("drain", cb); + } + write(chunk, encoding, cb) { + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; } - const ret = new _Yallist(); - if (to < from || to < 0) { - return ret; + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8"); } - if (from < 0) { - from = 0; + if (this.blockRemain < chunk.length) { + const er = Object.assign(new Error("writing more data than expected"), { + path: this.absolute + }); + return this.emit("error", er); } - if (to > this.length) { - to = this.length; + this.remain -= chunk.length; + this.blockRemain -= chunk.length; + this.pos += chunk.length; + this.offset += chunk.length; + return super.write(chunk, null, cb); + } + [ONDRAIN]() { + if (!this.remain) { + if (this.blockRemain) { + super.write(Buffer.alloc(this.blockRemain)); + } + return this[CLOSE]((er) => er ? this.emit("error", er) : this.end()); } - let walker = this.head; - let i = 0; - for (i = 0; !!walker && i < from; i++) { - walker = walker.next; + if (!this.buf) { + throw new Error("buffer lost somehow in ONDRAIN"); } - for (; !!walker && i < to; i++, walker = walker.next) { - ret.push(walker.value); + if (this.offset >= this.length) { + this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)); + this.offset = 0; } - return ret; + this.length = this.buf.length - this.offset; + this[READ2](); } - sliceReverse(from = 0, to = this.length) { - if (to < 0) { - to += this.length; + }; + WriteEntrySync = class extends WriteEntry { + sync = true; + [LSTAT]() { + this[ONLSTAT](import_fs11.default.lstatSync(this.absolute)); + } + [SYMLINK2]() { + this[ONREADLINK](import_fs11.default.readlinkSync(this.absolute)); + } + [OPENFILE]() { + this[ONOPENFILE](import_fs11.default.openSync(this.absolute, "r")); + } + [READ2]() { + let threw = true; + try { + const { fd, buf, offset, length, pos: pos2 } = this; + if (fd === void 0 || buf === void 0) { + throw new Error("fd and buf must be set in READ method"); + } + const bytesRead = import_fs11.default.readSync(fd, buf, offset, length, pos2); + this[ONREAD](bytesRead); + threw = false; + } finally { + if (threw) { + try { + this[CLOSE](() => { + }); + } catch { + } + } } - if (from < 0) { - from += this.length; + } + [AWAITDRAIN](cb) { + cb(); + } + /* c8 ignore start */ + [CLOSE](cb = () => { + }) { + if (this.fd !== void 0) + import_fs11.default.closeSync(this.fd); + cb(); + } + }; + WriteEntryTar = class extends Minipass { + blockLen = 0; + blockRemain = 0; + buf = 0; + pos = 0; + remain = 0; + length = 0; + preservePaths; + portable; + strict; + noPax; + noMtime; + readEntry; + type; + prefix; + path; + mode; + uid; + gid; + uname; + gname; + header; + mtime; + atime; + ctime; + linkpath; + size; + onWriteEntry; + warn(code2, message, data = {}) { + return warnMethod(this, code2, message, data); + } + constructor(readEntry, opt_ = {}) { + const opt = dealias(opt_); + super(); + this.preservePaths = !!opt.preservePaths; + this.portable = !!opt.portable; + this.strict = !!opt.strict; + this.noPax = !!opt.noPax; + this.noMtime = !!opt.noMtime; + this.onWriteEntry = opt.onWriteEntry; + this.readEntry = readEntry; + const { type } = readEntry; + if (type === "Unsupported") { + throw new Error("writing entry that should be ignored"); } - const ret = new _Yallist(); - if (to < from || to < 0) { - return ret; + this.type = type; + if (this.type === "Directory" && this.portable) { + this.noMtime = true; } - if (from < 0) { - from = 0; + this.prefix = opt.prefix; + this.path = normalizeWindowsPath(readEntry.path); + this.mode = readEntry.mode !== void 0 ? this[MODE](readEntry.mode) : void 0; + this.uid = this.portable ? void 0 : readEntry.uid; + this.gid = this.portable ? void 0 : readEntry.gid; + this.uname = this.portable ? void 0 : readEntry.uname; + this.gname = this.portable ? void 0 : readEntry.gname; + this.size = readEntry.size; + this.mtime = this.noMtime ? void 0 : opt.mtime || readEntry.mtime; + this.atime = this.portable ? void 0 : readEntry.atime; + this.ctime = this.portable ? void 0 : readEntry.ctime; + this.linkpath = readEntry.linkpath !== void 0 ? normalizeWindowsPath(readEntry.linkpath) : void 0; + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); } - if (to > this.length) { - to = this.length; + let pathWarn = false; + if (!this.preservePaths) { + const [root, stripped] = stripAbsolutePath(this.path); + if (root && typeof stripped === "string") { + this.path = stripped; + pathWarn = root; + } } - let i = this.length; - let walker = this.tail; - for (; !!walker && i > to; i--) { - walker = walker.prev; + this.remain = readEntry.size; + this.blockRemain = readEntry.startBlockSize; + this.onWriteEntry?.(this); + this.header = new Header({ + path: this[PREFIX](this.path), + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this.mode, + uid: this.portable ? void 0 : this.uid, + gid: this.portable ? void 0 : this.gid, + size: this.size, + mtime: this.noMtime ? void 0 : this.mtime, + type: this.type, + uname: this.portable ? void 0 : this.uname, + atime: this.portable ? void 0 : this.atime, + ctime: this.portable ? void 0 : this.ctime + }); + if (pathWarn) { + this.warn("TAR_ENTRY_INFO", `stripping ${pathWarn} from absolute path`, { + entry: this, + path: pathWarn + this.path + }); } - for (; !!walker && i > from; i--, walker = walker.prev) { - ret.push(walker.value); + if (this.header.encode() && !this.noPax) { + super.write(new Pax({ + atime: this.portable ? void 0 : this.atime, + ctime: this.portable ? void 0 : this.ctime, + gid: this.portable ? void 0 : this.gid, + mtime: this.noMtime ? void 0 : this.mtime, + path: this[PREFIX](this.path), + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + size: this.size, + uid: this.portable ? void 0 : this.uid, + uname: this.portable ? void 0 : this.uname, + dev: this.portable ? void 0 : this.readEntry.dev, + ino: this.portable ? void 0 : this.readEntry.ino, + nlink: this.portable ? void 0 : this.readEntry.nlink + }).encode()); } - return ret; + const b = this.header?.block; + if (!b) + throw new Error("failed to encode header"); + super.write(b); + readEntry.pipe(this); + } + [PREFIX](path16) { + return prefixPath(path16, this.prefix); + } + [MODE](mode) { + return modeFix(mode, this.type === "Directory", this.portable); } - splice(start, deleteCount = 0, ...nodes) { - if (start > this.length) { - start = this.length - 1; + write(chunk, encoding, cb) { + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; } - if (start < 0) { - start = this.length + start; + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8"); } - let walker = this.head; - for (let i = 0; !!walker && i < start; i++) { - walker = walker.next; + const writeLen = chunk.length; + if (writeLen > this.blockRemain) { + throw new Error("writing more to entry than is appropriate"); } - const ret = []; - for (let i = 0; !!walker && i < deleteCount; i++) { - ret.push(walker.value); - walker = this.removeNode(walker); + this.blockRemain -= writeLen; + return super.write(chunk, cb); + } + end(chunk, encoding, cb) { + if (this.blockRemain) { + super.write(Buffer.alloc(this.blockRemain)); } - if (!walker) { - walker = this.tail; - } else if (walker !== this.tail) { - walker = walker.prev; + if (typeof chunk === "function") { + cb = chunk; + encoding = void 0; + chunk = void 0; } - for (const v of nodes) { - walker = insertAfter(this, walker, v); + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; } - return ret; - } - reverse() { - const head = this.head; - const tail = this.tail; - for (let walker = head; !!walker; walker = walker.prev) { - const p = walker.prev; - walker.prev = walker.next; - walker.next = p; + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding ?? "utf8"); } - this.head = tail; - this.tail = head; + if (cb) + this.once("finish", cb); + if (chunk) + super.end(chunk, cb); + else + super.end(cb); return this; } }; - Node = class { - list; - next; - prev; - value; - constructor(value, prev, next, list2) { - this.list = list2; - this.value = value; - if (prev) { - prev.next = this; - this.prev = prev; - } else { - this.prev = void 0; - } - if (next) { - next.prev = this; - this.next = next; - } else { - this.next = void 0; - } - } - }; + getType = (stat) => stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : "Unsupported"; } }); -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/pack.js -var import_fs12, import_path10, PackJob, EOF2, ONSTAT, ENDED3, QUEUE2, CURRENT, PROCESS2, PROCESSING, PROCESSJOB, JOBS, JOBDONE, ADDFSENTRY, ADDTARENTRY, STAT, READDIR, ONREADDIR, PIPE, ENTRY, ENTRYOPT, WRITEENTRYCLASS, WRITE, ONDRAIN2, Pack, PackSync; -var init_pack = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/pack.js"() { - import_fs12 = __toESM(require("fs"), 1); - init_write_entry(); - init_esm(); - init_esm3(); - init_esm5(); - init_read_entry(); - init_warn_method(); - import_path10 = __toESM(require("path"), 1); - init_normalize_windows_path(); - PackJob = class { - path; - absolute; - entry; - stat; - readdir; - pending = false; - ignore = false; - piped = false; - constructor(path16, absolute) { - this.path = path16 || "./"; - this.absolute = absolute; +// node_modules/yallist/dist/esm/index.js +function insertAfter(self2, node, value) { + const prev = node; + const next = node ? node.next : self2.head; + const inserted = new Node(value, prev, next, self2); + if (inserted.next === void 0) { + self2.tail = inserted; + } + if (inserted.prev === void 0) { + self2.head = inserted; + } + self2.length++; + return inserted; +} +function push(self2, item) { + self2.tail = new Node(item, self2.tail, void 0, self2); + if (!self2.head) { + self2.head = self2.tail; + } + self2.length++; +} +function unshift(self2, item) { + self2.head = new Node(item, void 0, self2.head, self2); + if (!self2.tail) { + self2.tail = self2.head; + } + self2.length++; +} +var Yallist, Node; +var init_esm5 = __esm({ + "node_modules/yallist/dist/esm/index.js"() { + Yallist = class _Yallist { + tail; + head; + length = 0; + static create(list2 = []) { + return new _Yallist(list2); } - }; - EOF2 = Buffer.alloc(1024); - ONSTAT = /* @__PURE__ */ Symbol("onStat"); - ENDED3 = /* @__PURE__ */ Symbol("ended"); - QUEUE2 = /* @__PURE__ */ Symbol("queue"); - CURRENT = /* @__PURE__ */ Symbol("current"); - PROCESS2 = /* @__PURE__ */ Symbol("process"); - PROCESSING = /* @__PURE__ */ Symbol("processing"); - PROCESSJOB = /* @__PURE__ */ Symbol("processJob"); - JOBS = /* @__PURE__ */ Symbol("jobs"); - JOBDONE = /* @__PURE__ */ Symbol("jobDone"); - ADDFSENTRY = /* @__PURE__ */ Symbol("addFSEntry"); - ADDTARENTRY = /* @__PURE__ */ Symbol("addTarEntry"); - STAT = /* @__PURE__ */ Symbol("stat"); - READDIR = /* @__PURE__ */ Symbol("readdir"); - ONREADDIR = /* @__PURE__ */ Symbol("onreaddir"); - PIPE = /* @__PURE__ */ Symbol("pipe"); - ENTRY = /* @__PURE__ */ Symbol("entry"); - ENTRYOPT = /* @__PURE__ */ Symbol("entryOpt"); - WRITEENTRYCLASS = /* @__PURE__ */ Symbol("writeEntryClass"); - WRITE = /* @__PURE__ */ Symbol("write"); - ONDRAIN2 = /* @__PURE__ */ Symbol("ondrain"); - Pack = class extends Minipass { - sync = false; - opt; - cwd; - maxReadSize; - preservePaths; - strict; - noPax; - prefix; - linkCache; - statCache; - file; - portable; - zip; - readdirCache; - noDirRecurse; - follow; - noMtime; - mtime; - filter; - jobs; - [WRITEENTRYCLASS]; - onWriteEntry; - // Note: we actually DO need a linked list here, because we - // shift() to update the head of the list where we start, but still - // while that happens, need to know what the next item in the queue - // will be. Since we do multiple jobs in parallel, it's not as simple - // as just an Array.shift(), since that would lose the information about - // the next job in the list. We could add a .next field on the PackJob - // class, but then we'd have to be tracking the tail of the queue the - // whole time, and Yallist just does that for us anyway. - [QUEUE2]; - [JOBS] = 0; - [PROCESSING] = false; - [ENDED3] = false; - constructor(opt = {}) { - super(); - this.opt = opt; - this.file = opt.file || ""; - this.cwd = opt.cwd || process.cwd(); - this.maxReadSize = opt.maxReadSize; - this.preservePaths = !!opt.preservePaths; - this.strict = !!opt.strict; - this.noPax = !!opt.noPax; - this.prefix = normalizeWindowsPath(opt.prefix || ""); - this.linkCache = opt.linkCache || /* @__PURE__ */ new Map(); - this.statCache = opt.statCache || /* @__PURE__ */ new Map(); - this.readdirCache = opt.readdirCache || /* @__PURE__ */ new Map(); - this.onWriteEntry = opt.onWriteEntry; - this[WRITEENTRYCLASS] = WriteEntry; - if (typeof opt.onwarn === "function") { - this.on("warn", opt.onwarn); + constructor(list2 = []) { + for (const item of list2) { + this.push(item); } - this.portable = !!opt.portable; - if (opt.gzip || opt.brotli || opt.zstd) { - if ((opt.gzip ? 1 : 0) + (opt.brotli ? 1 : 0) + (opt.zstd ? 1 : 0) > 1) { - throw new TypeError("gzip, brotli, zstd are mutually exclusive"); - } - if (opt.gzip) { - if (typeof opt.gzip !== "object") { - opt.gzip = {}; - } - if (this.portable) { - opt.gzip.portable = true; - } - this.zip = new Gzip(opt.gzip); - } - if (opt.brotli) { - if (typeof opt.brotli !== "object") { - opt.brotli = {}; - } - this.zip = new BrotliCompress(opt.brotli); - } - if (opt.zstd) { - if (typeof opt.zstd !== "object") { - opt.zstd = {}; - } - this.zip = new ZstdCompress(opt.zstd); - } - if (!this.zip) - throw new Error("impossible"); - const zip = this.zip; - zip.on("data", (chunk) => super.write(chunk)); - zip.on("end", () => super.end()); - zip.on("drain", () => this[ONDRAIN2]()); - this.on("resume", () => zip.resume()); - } else { - this.on("drain", this[ONDRAIN2]); + } + *[Symbol.iterator]() { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; } - this.noDirRecurse = !!opt.noDirRecurse; - this.follow = !!opt.follow; - this.noMtime = !!opt.noMtime; - if (opt.mtime) - this.mtime = opt.mtime; - this.filter = typeof opt.filter === "function" ? opt.filter : () => true; - this[QUEUE2] = new Yallist(); - this[JOBS] = 0; - this.jobs = Number(opt.jobs) || 4; - this[PROCESSING] = false; - this[ENDED3] = false; } - [WRITE](chunk) { - return super.write(chunk); + removeNode(node) { + if (node.list !== this) { + throw new Error("removing node which does not belong to this list"); + } + const next = node.next; + const prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + this.length--; + node.next = void 0; + node.prev = void 0; + node.list = void 0; + return next; } - add(path16) { - this.write(path16); - return this; + unshiftNode(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + const head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; } - end(path16, encoding, cb) { - if (typeof path16 === "function") { - cb = path16; - path16 = void 0; + pushNode(node) { + if (node === this.tail) { + return; } - if (typeof encoding === "function") { - cb = encoding; - encoding = void 0; + if (node.list) { + node.list.removeNode(node); } - if (path16) { - this.add(path16); + const tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; } - this[ENDED3] = true; - this[PROCESS2](); - if (cb) - cb(); - return this; + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; } - write(path16) { - if (this[ENDED3]) { - throw new Error("write after end"); + push(...args) { + for (let i = 0, l = args.length; i < l; i++) { + push(this, args[i]); } - if (path16 instanceof ReadEntry) { - this[ADDTARENTRY](path16); + return this.length; + } + unshift(...args) { + for (var i = 0, l = args.length; i < l; i++) { + unshift(this, args[i]); + } + return this.length; + } + pop() { + if (!this.tail) { + return void 0; + } + const res = this.tail.value; + const t = this.tail; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = void 0; } else { - this[ADDFSENTRY](path16); + this.head = void 0; } - return this.flowing; + t.list = void 0; + this.length--; + return res; } - [ADDTARENTRY](p) { - const absolute = normalizeWindowsPath(import_path10.default.resolve(this.cwd, p.path)); - if (!this.filter(p.path, p)) { - p.resume(); + shift() { + if (!this.head) { + return void 0; + } + const res = this.head.value; + const h = this.head; + this.head = this.head.next; + if (this.head) { + this.head.prev = void 0; } else { - const job = new PackJob(p.path, absolute); - job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)); - job.entry.on("end", () => this[JOBDONE](job)); - this[JOBS] += 1; - this[QUEUE2].push(job); + this.tail = void 0; } - this[PROCESS2](); + h.list = void 0; + this.length--; + return res; } - [ADDFSENTRY](p) { - const absolute = normalizeWindowsPath(import_path10.default.resolve(this.cwd, p)); - this[QUEUE2].push(new PackJob(p, absolute)); - this[PROCESS2](); + forEach(fn2, thisp) { + thisp = thisp || this; + for (let walker = this.head, i = 0; !!walker; i++) { + fn2.call(thisp, walker.value, i, this); + walker = walker.next; + } } - [STAT](job) { - job.pending = true; - this[JOBS] += 1; - const stat = this.follow ? "stat" : "lstat"; - import_fs12.default[stat](job.absolute, (er, stat2) => { - job.pending = false; - this[JOBS] -= 1; - if (er) { - this.emit("error", er); - } else { - this[ONSTAT](job, stat2); - } - }); + forEachReverse(fn2, thisp) { + thisp = thisp || this; + for (let walker = this.tail, i = this.length - 1; !!walker; i--) { + fn2.call(thisp, walker.value, i, this); + walker = walker.prev; + } } - [ONSTAT](job, stat) { - this.statCache.set(job.absolute, stat); - job.stat = stat; - if (!this.filter(job.path, stat)) { - job.ignore = true; - } else if (stat.isFile() && stat.nlink > 1 && job === this[CURRENT] && !this.linkCache.get(`${stat.dev}:${stat.ino}`) && !this.sync) { - this[PROCESSJOB](job); + get(n) { + let i = 0; + let walker = this.head; + for (; !!walker && i < n; i++) { + walker = walker.next; + } + if (i === n && !!walker) { + return walker.value; } - this[PROCESS2](); } - [READDIR](job) { - job.pending = true; - this[JOBS] += 1; - import_fs12.default.readdir(job.absolute, (er, entries) => { - job.pending = false; - this[JOBS] -= 1; - if (er) { - return this.emit("error", er); - } - this[ONREADDIR](job, entries); - }); + getReverse(n) { + let i = 0; + let walker = this.tail; + for (; !!walker && i < n; i++) { + walker = walker.prev; + } + if (i === n && !!walker) { + return walker.value; + } } - [ONREADDIR](job, entries) { - this.readdirCache.set(job.absolute, entries); - job.readdir = entries; - this[PROCESS2](); + map(fn2, thisp) { + thisp = thisp || this; + const res = new _Yallist(); + for (let walker = this.head; !!walker; ) { + res.push(fn2.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; } - [PROCESS2]() { - if (this[PROCESSING]) { - return; + mapReverse(fn2, thisp) { + thisp = thisp || this; + var res = new _Yallist(); + for (let walker = this.tail; !!walker; ) { + res.push(fn2.call(thisp, walker.value, this)); + walker = walker.prev; } - this[PROCESSING] = true; - for (let w = this[QUEUE2].head; !!w && this[JOBS] < this.jobs; w = w.next) { - this[PROCESSJOB](w.value); - if (w.value.ignore) { - const p = w.next; - this[QUEUE2].removeNode(w); - w.next = p; - } + return res; + } + reduce(fn2, initial) { + let acc; + let walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); } - this[PROCESSING] = false; - if (this[ENDED3] && this[QUEUE2].length === 0 && this[JOBS] === 0) { - if (this.zip) { - this.zip.end(EOF2); - } else { - super.write(EOF2); - super.end(); - } + for (var i = 0; !!walker; i++) { + acc = fn2(acc, walker.value, i); + walker = walker.next; } + return acc; } - get [CURRENT]() { - return this[QUEUE2] && this[QUEUE2].head && this[QUEUE2].head.value; + reduceReverse(fn2, initial) { + let acc; + let walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (let i = this.length - 1; !!walker; i--) { + acc = fn2(acc, walker.value, i); + walker = walker.prev; + } + return acc; } - [JOBDONE](_job) { - this[QUEUE2].shift(); - this[JOBS] -= 1; - this[PROCESS2](); + toArray() { + const arr = new Array(this.length); + for (let i = 0, walker = this.head; !!walker; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; } - [PROCESSJOB](job) { - if (job.pending) { - return; + toArrayReverse() { + const arr = new Array(this.length); + for (let i = 0, walker = this.tail; !!walker; i++) { + arr[i] = walker.value; + walker = walker.prev; } - if (job.entry) { - if (job === this[CURRENT] && !job.piped) { - this[PIPE](job); - } - return; + return arr; + } + slice(from = 0, to = this.length) { + if (to < 0) { + to += this.length; } - if (!job.stat) { - const sc = this.statCache.get(job.absolute); - if (sc) { - this[ONSTAT](job, sc); - } else { - this[STAT](job); - } + if (from < 0) { + from += this.length; } - if (!job.stat) { - return; + const ret = new _Yallist(); + if (to < from || to < 0) { + return ret; } - if (job.ignore) { - return; + if (from < 0) { + from = 0; } - if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { - const rc = this.readdirCache.get(job.absolute); - if (rc) { - this[ONREADDIR](job, rc); - } else { - this[READDIR](job); - } - if (!job.readdir) { - return; - } + if (to > this.length) { + to = this.length; } - job.entry = this[ENTRY](job); - if (!job.entry) { - job.ignore = true; - return; + let walker = this.head; + let i = 0; + for (i = 0; !!walker && i < from; i++) { + walker = walker.next; } - if (job === this[CURRENT] && !job.piped) { - this[PIPE](job); + for (; !!walker && i < to; i++, walker = walker.next) { + ret.push(walker.value); } + return ret; } - [ENTRYOPT](job) { - return { - onwarn: (code2, msg, data) => this.warn(code2, msg, data), - noPax: this.noPax, - cwd: this.cwd, - absolute: job.absolute, - preservePaths: this.preservePaths, - maxReadSize: this.maxReadSize, - strict: this.strict, - portable: this.portable, - linkCache: this.linkCache, - statCache: this.statCache, - noMtime: this.noMtime, - mtime: this.mtime, - prefix: this.prefix, - onWriteEntry: this.onWriteEntry - }; - } - [ENTRY](job) { - this[JOBS] += 1; - try { - const e = new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)); - return e.on("end", () => this[JOBDONE](job)).on("error", (er) => this.emit("error", er)); - } catch (er) { - this.emit("error", er); + sliceReverse(from = 0, to = this.length) { + if (to < 0) { + to += this.length; } - } - [ONDRAIN2]() { - if (this[CURRENT] && this[CURRENT].entry) { - this[CURRENT].entry.resume(); + if (from < 0) { + from += this.length; } - } - // like .pipe() but using super, because our write() is special - [PIPE](job) { - job.piped = true; - if (job.readdir) { - job.readdir.forEach((entry) => { - const p = job.path; - const base = p === "./" ? "" : p.replace(/\/*$/, "/"); - this[ADDFSENTRY](base + entry); - }); + const ret = new _Yallist(); + if (to < from || to < 0) { + return ret; } - const source = job.entry; - const zip = this.zip; - if (!source) - throw new Error("cannot pipe without source"); - if (zip) { - source.on("data", (chunk) => { - if (!zip.write(chunk)) { - source.pause(); - } - }); - } else { - source.on("data", (chunk) => { - if (!super.write(chunk)) { - source.pause(); - } - }); + if (from < 0) { + from = 0; } - } - pause() { - if (this.zip) { - this.zip.pause(); + if (to > this.length) { + to = this.length; } - return super.pause(); - } - warn(code2, message, data = {}) { - warnMethod(this, code2, message, data); - } - }; - PackSync = class extends Pack { - sync = true; - constructor(opt) { - super(opt); - this[WRITEENTRYCLASS] = WriteEntrySync; - } - // pause/resume are no-ops in sync streams. - pause() { - } - resume() { - } - [STAT](job) { - const stat = this.follow ? "statSync" : "lstatSync"; - this[ONSTAT](job, import_fs12.default[stat](job.absolute)); - } - [READDIR](job) { - this[ONREADDIR](job, import_fs12.default.readdirSync(job.absolute)); - } - // gotta get it all in this tick - [PIPE](job) { - const source = job.entry; - const zip = this.zip; - if (job.readdir) { - job.readdir.forEach((entry) => { - const p = job.path; - const base = p === "./" ? "" : p.replace(/\/*$/, "/"); - this[ADDFSENTRY](base + entry); - }); + let i = this.length; + let walker = this.tail; + for (; !!walker && i > to; i--) { + walker = walker.prev; } - if (!source) - throw new Error("Cannot pipe without source"); - if (zip) { - source.on("data", (chunk) => { - zip.write(chunk); - }); - } else { - source.on("data", (chunk) => { - super[WRITE](chunk); - }); + for (; !!walker && i > from; i--, walker = walker.prev) { + ret.push(walker.value); } + return ret; + } + splice(start, deleteCount = 0, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + let walker = this.head; + for (let i = 0; !!walker && i < start; i++) { + walker = walker.next; + } + const ret = []; + for (let i = 0; !!walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (!walker) { + walker = this.tail; + } else if (walker !== this.tail) { + walker = walker.prev; + } + for (const v of nodes) { + walker = insertAfter(this, walker, v); + } + return ret; + } + reverse() { + const head = this.head; + const tail = this.tail; + for (let walker = head; !!walker; walker = walker.prev) { + const p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; } }; - } -}); - -// .yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/create.js -var create_exports = {}; -__export(create_exports, { - create: () => create -}); -var import_node_path8, createFileSync, createFile, addFilesSync, addFilesAsync, createSync, createAsync, create; -var init_create = __esm({ - ".yarn/cache/tar-npm-7.5.13-3c09e37d51-5c65b80847.zip/node_modules/tar/dist/esm/create.js"() { - init_esm2(); - import_node_path8 = __toESM(require("node:path"), 1); - init_list(); - init_make_command(); - init_pack(); - createFileSync = (opt, files) => { - const p = new PackSync(opt); - const stream = new WriteStreamSync(opt.file, { - mode: opt.mode || 438 - }); - p.pipe(stream); - addFilesSync(p, files); - }; - createFile = (opt, files) => { - const p = new Pack(opt); - const stream = new WriteStream(opt.file, { - mode: opt.mode || 438 - }); - p.pipe(stream); - const promise = new Promise((res, rej) => { - stream.on("error", rej); - stream.on("close", res); - p.on("error", rej); - }); - addFilesAsync(p, files).catch((er) => p.emit("error", er)); - return promise; - }; - addFilesSync = (p, files) => { - files.forEach((file) => { - if (file.charAt(0) === "@") { - list({ - file: import_node_path8.default.resolve(p.cwd, file.slice(1)), - sync: true, - noResume: true, - onReadEntry: (entry) => p.add(entry) - }); + Node = class { + list; + next; + prev; + value; + constructor(value, prev, next, list2) { + this.list = list2; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; } else { - p.add(file); + this.prev = void 0; } - }); - p.end(); - }; - addFilesAsync = async (p, files) => { - for (const file of files) { - if (file.charAt(0) === "@") { - await list({ - file: import_node_path8.default.resolve(String(p.cwd), file.slice(1)), - noResume: true, - onReadEntry: (entry) => { - p.add(entry); - } - }); + if (next) { + next.prev = this; + this.next = next; } else { - p.add(file); + this.next = void 0; } } - p.end(); - }; - createSync = (opt, files) => { - const p = new PackSync(opt); - addFilesSync(p, files); - return p; - }; - createAsync = (opt, files) => { - const p = new Pack(opt); - addFilesAsync(p, files).catch((er) => p.emit("error", er)); - return p; }; - create = makeCommand(createFileSync, createFile, createSync, createAsync, (_opt, files) => { - if (!files?.length) { - throw new TypeError("no paths specified to add to archive"); - } - }); - } -}); - -// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/major.js -var require_major = __commonJS({ - ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/major.js"(exports2, module2) { - "use strict"; - var SemVer3 = require_semver(); - var major = (a, loose) => new SemVer3(a, loose).major; - module2.exports = major; } }); -// sources/_lib.ts -var lib_exports2 = {}; -__export(lib_exports2, { - runMain: () => runMain -}); -module.exports = __toCommonJS(lib_exports2); - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/constants.mjs -var NODE_INITIAL = 0; -var NODE_SUCCESS = 1; -var NODE_ERRORED = 2; -var START_OF_INPUT = ``; -var END_OF_INPUT = `\0`; -var HELP_COMMAND_INDEX = -1; -var HELP_REGEX = /^(-h|--help)(?:=([0-9]+))?$/; -var OPTION_REGEX = /^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/; -var BATCH_REGEX = /^-[a-zA-Z]{2,}$/; -var BINDING_REGEX = /^([^=]+)=([\s\S]*)$/; -var DEBUG = process.env.DEBUG_CLI === `1`; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/errors.mjs -var UsageError = class extends Error { - constructor(message) { - super(message); - this.clipanion = { type: `usage` }; - this.name = `UsageError`; - } -}; -var UnknownSyntaxError = class extends Error { - constructor(input, candidates) { - super(); - this.input = input; - this.candidates = candidates; - this.clipanion = { type: `none` }; - this.name = `UnknownSyntaxError`; - if (this.candidates.length === 0) { - this.message = `Command not found, but we're not sure what's the alternative.`; - } else if (this.candidates.every((candidate) => candidate.reason !== null && candidate.reason === candidates[0].reason)) { - const [{ reason }] = this.candidates; - this.message = `${reason} - -${this.candidates.map(({ usage }) => `$ ${usage}`).join(` -`)}`; - } else if (this.candidates.length === 1) { - const [{ usage }] = this.candidates; - this.message = `Command not found; did you mean: - -$ ${usage} -${whileRunning(input)}`; - } else { - this.message = `Command not found; did you mean one of: - -${this.candidates.map(({ usage }, index) => { - return `${`${index}.`.padStart(4)} ${usage}`; - }).join(` -`)} - -${whileRunning(input)}`; - } - } -}; -var AmbiguousSyntaxError = class extends Error { - constructor(input, usages) { - super(); - this.input = input; - this.usages = usages; - this.clipanion = { type: `none` }; - this.name = `AmbiguousSyntaxError`; - this.message = `Cannot find which to pick amongst the following alternatives: - -${this.usages.map((usage, index) => { - return `${`${index}.`.padStart(4)} ${usage}`; - }).join(` -`)} - -${whileRunning(input)}`; - } -}; -var whileRunning = (input) => `While running ${input.filter((token) => { - return token !== END_OF_INPUT; -}).map((token) => { - const json = JSON.stringify(token); - if (token.match(/\s/) || token.length === 0 || json !== `"${token}"`) { - return json; - } else { - return token; - } -}).join(` `)}`; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/format.mjs -var MAX_LINE_LENGTH = 80; -var richLine = Array(MAX_LINE_LENGTH).fill(`\u2501`); -for (let t = 0; t <= 24; ++t) - richLine[richLine.length - t] = `\x1B[38;5;${232 + t}m\u2501`; -var richFormat = { - header: (str) => `\x1B[1m\u2501\u2501\u2501 ${str}${str.length < MAX_LINE_LENGTH - 5 ? ` ${richLine.slice(str.length + 5).join(``)}` : `:`}\x1B[0m`, - bold: (str) => `\x1B[1m${str}\x1B[22m`, - error: (str) => `\x1B[31m\x1B[1m${str}\x1B[22m\x1B[39m`, - code: (str) => `\x1B[36m${str}\x1B[39m` -}; -var textFormat = { - header: (str) => str, - bold: (str) => str, - error: (str) => str, - code: (str) => str -}; -function dedent(text) { - const lines = text.split(` -`); - const nonEmptyLines = lines.filter((line) => line.match(/\S/)); - const indent = nonEmptyLines.length > 0 ? nonEmptyLines.reduce((minLength, line) => Math.min(minLength, line.length - line.trimStart().length), Number.MAX_VALUE) : 0; - return lines.map((line) => line.slice(indent).trimRight()).join(` -`); -} -function formatMarkdownish(text, { format, paragraphs }) { - text = text.replace(/\r\n?/g, ` -`); - text = dedent(text); - text = text.replace(/^\n+|\n+$/g, ``); - text = text.replace(/^(\s*)-([^\n]*?)\n+/gm, `$1-$2 - -`); - text = text.replace(/\n(\n)?\n*/g, ($0, $1) => $1 ? $1 : ` `); - if (paragraphs) { - text = text.split(/\n/).map((paragraph) => { - const bulletMatch = paragraph.match(/^\s*[*-][\t ]+(.*)/); - if (!bulletMatch) - return paragraph.match(/(.{1,80})(?: |$)/g).join(` -`); - const indent = paragraph.length - paragraph.trimStart().length; - return bulletMatch[1].match(new RegExp(`(.{1,${78 - indent}})(?: |$)`, `g`)).map((line, index) => { - return ` `.repeat(indent) + (index === 0 ? `- ` : ` `) + line; - }).join(` -`); - }).join(` - -`); - } - text = text.replace(/(`+)((?:.|[\n])*?)\1/g, ($0, $1, $2) => { - return format.code($1 + $2 + $1); - }); - text = text.replace(/(\*\*)((?:.|[\n])*?)\1/g, ($0, $1, $2) => { - return format.bold($1 + $2 + $1); - }); - return text ? `${text} -` : ``; -} - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/utils.mjs -var isOptionSymbol = /* @__PURE__ */ Symbol(`clipanion/isOption`); -function makeCommandOption(spec) { - return { ...spec, [isOptionSymbol]: true }; -} -function rerouteArguments(a, b) { - if (typeof a === `undefined`) - return [a, b]; - if (typeof a === `object` && a !== null && !Array.isArray(a)) { - return [void 0, a]; - } else { - return [a, b]; - } -} -function cleanValidationError(message, { mergeName = false } = {}) { - const match = message.match(/^([^:]+): (.*)$/m); - if (!match) - return `validation failed`; - let [, path16, line] = match; - if (mergeName) - line = line[0].toLowerCase() + line.slice(1); - line = path16 !== `.` || !mergeName ? `${path16.replace(/^\.(\[|$)/, `$1`)}: ${line}` : `: ${line}`; - return line; -} -function formatError(message, errors) { - if (errors.length === 1) { - return new UsageError(`${message}${cleanValidationError(errors[0], { mergeName: true })}`); - } else { - return new UsageError(`${message}: -${errors.map((error) => ` -- ${cleanValidationError(error)}`).join(``)}`); - } -} -function applyValidator(name2, value, validator) { - if (typeof validator === `undefined`) - return value; - const errors = []; - const coercions = []; - const coercion = (v) => { - const orig = value; - value = v; - return coercion.bind(null, orig); - }; - const check = validator(value, { errors, coercions, coercion }); - if (!check) - throw formatError(`Invalid value for ${name2}`, errors); - for (const [, op] of coercions) - op(); - return value; -} - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/Command.mjs -var Command = class { - constructor() { - this.help = false; - } - /** - * Defines the usage information for the given command. - */ - static Usage(usage) { - return usage; - } - /** - * Standard error handler which will simply rethrow the error. Can be used - * to add custom logic to handle errors from the command or simply return - * the parent class error handling. - */ - async catch(error) { - throw error; - } - async validateAndExecute() { - const commandClass = this.constructor; - const cascade2 = commandClass.schema; - if (Array.isArray(cascade2)) { - const { isDict: isDict2, isUnknown: isUnknown2, applyCascade: applyCascade2 } = await Promise.resolve().then(() => (init_lib(), lib_exports)); - const schema = applyCascade2(isDict2(isUnknown2()), cascade2); - const errors = []; - const coercions = []; - const check = schema(this, { errors, coercions }); - if (!check) - throw formatError(`Invalid option schema`, errors); - for (const [, op] of coercions) { - op(); +// node_modules/tar/dist/esm/pack.js +var import_fs12, import_path10, PackJob, EOF2, ONSTAT, ENDED3, QUEUE2, PENDINGLINKS, CURRENT, PROCESS2, PROCESSING, PROCESSJOB, JOBS, JOBDONE, ADDFSENTRY, ADDTARENTRY, STAT, READDIR, ONREADDIR, PIPE, ENTRY, ENTRYOPT, WRITEENTRYCLASS, WRITE, ONDRAIN2, Pack, PackSync; +var init_pack = __esm({ + "node_modules/tar/dist/esm/pack.js"() { + import_fs12 = __toESM(require("fs"), 1); + init_write_entry(); + init_esm(); + init_esm3(); + init_esm5(); + init_read_entry(); + init_warn_method(); + import_path10 = __toESM(require("path"), 1); + init_normalize_windows_path(); + PackJob = class { + path; + absolute; + entry; + stat; + readdir; + pending = false; + pendingLink = false; + ignore = false; + piped = false; + constructor(path16, absolute) { + this.path = path16 || "./"; + this.absolute = absolute; } - } else if (cascade2 != null) { - throw new Error(`Invalid command schema`); - } - const exitCode = await this.execute(); - if (typeof exitCode !== `undefined`) { - return exitCode; - } else { - return 0; - } - } -}; -Command.isOption = isOptionSymbol; -Command.Default = []; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/core.mjs -function debug(str) { - if (DEBUG) { - console.log(str); - } -} -var basicHelpState = { - candidateUsage: null, - requiredOptions: [], - errorMessage: null, - ignoreOptions: false, - path: [], - positionals: [], - options: [], - remainder: null, - selectedIndex: HELP_COMMAND_INDEX -}; -function makeStateMachine() { - return { - nodes: [makeNode(), makeNode(), makeNode()] - }; -} -function makeAnyOfMachine(inputs) { - const output = makeStateMachine(); - const heads = []; - let offset = output.nodes.length; - for (const input of inputs) { - heads.push(offset); - for (let t = 0; t < input.nodes.length; ++t) - if (!isTerminalNode(t)) - output.nodes.push(cloneNode(input.nodes[t], offset)); - offset += input.nodes.length - 2; - } - for (const head of heads) - registerShortcut(output, NODE_INITIAL, head); - return output; -} -function injectNode(machine, node) { - machine.nodes.push(node); - return machine.nodes.length - 1; -} -function simplifyMachine(input) { - const visited = /* @__PURE__ */ new Set(); - const process5 = (node) => { - if (visited.has(node)) - return; - visited.add(node); - const nodeDef = input.nodes[node]; - for (const transitions of Object.values(nodeDef.statics)) - for (const { to } of transitions) - process5(to); - for (const [, { to }] of nodeDef.dynamics) - process5(to); - for (const { to } of nodeDef.shortcuts) - process5(to); - const shortcuts = new Set(nodeDef.shortcuts.map(({ to }) => to)); - while (nodeDef.shortcuts.length > 0) { - const { to } = nodeDef.shortcuts.shift(); - const toDef = input.nodes[to]; - for (const [segment, transitions] of Object.entries(toDef.statics)) { - const store = !Object.prototype.hasOwnProperty.call(nodeDef.statics, segment) ? nodeDef.statics[segment] = [] : nodeDef.statics[segment]; - for (const transition of transitions) { - if (!store.some(({ to: to2 }) => transition.to === to2)) { - store.push(transition); + }; + EOF2 = Buffer.alloc(1024); + ONSTAT = /* @__PURE__ */ Symbol("onStat"); + ENDED3 = /* @__PURE__ */ Symbol("ended"); + QUEUE2 = /* @__PURE__ */ Symbol("queue"); + PENDINGLINKS = /* @__PURE__ */ Symbol("queue"); + CURRENT = /* @__PURE__ */ Symbol("current"); + PROCESS2 = /* @__PURE__ */ Symbol("process"); + PROCESSING = /* @__PURE__ */ Symbol("processing"); + PROCESSJOB = /* @__PURE__ */ Symbol("processJob"); + JOBS = /* @__PURE__ */ Symbol("jobs"); + JOBDONE = /* @__PURE__ */ Symbol("jobDone"); + ADDFSENTRY = /* @__PURE__ */ Symbol("addFSEntry"); + ADDTARENTRY = /* @__PURE__ */ Symbol("addTarEntry"); + STAT = /* @__PURE__ */ Symbol("stat"); + READDIR = /* @__PURE__ */ Symbol("readdir"); + ONREADDIR = /* @__PURE__ */ Symbol("onreaddir"); + PIPE = /* @__PURE__ */ Symbol("pipe"); + ENTRY = /* @__PURE__ */ Symbol("entry"); + ENTRYOPT = /* @__PURE__ */ Symbol("entryOpt"); + WRITEENTRYCLASS = /* @__PURE__ */ Symbol("writeEntryClass"); + WRITE = /* @__PURE__ */ Symbol("write"); + ONDRAIN2 = /* @__PURE__ */ Symbol("ondrain"); + Pack = class extends Minipass { + sync = false; + opt; + cwd; + maxReadSize; + preservePaths; + strict; + noPax; + prefix; + linkCache; + statCache; + file; + portable; + zip; + readdirCache; + noDirRecurse; + follow; + noMtime; + mtime; + filter; + jobs; + [WRITEENTRYCLASS]; + onWriteEntry; + // Note: we actually DO need a linked list here, because we + // shift() to update the head of the list where we start, but still + // while that happens, need to know what the next item in the queue + // will be. Since we do multiple jobs in parallel, it's not as simple + // as just an Array.shift(), since that would lose the information about + // the next job in the list. We could add a .next field on the PackJob + // class, but then we'd have to be tracking the tail of the queue the + // whole time, and Yallist just does that for us anyway. + [QUEUE2]; + [PENDINGLINKS] = /* @__PURE__ */ new Map(); + [JOBS] = 0; + [PROCESSING] = false; + [ENDED3] = false; + constructor(opt = {}) { + super(); + this.opt = opt; + this.file = opt.file || ""; + this.cwd = opt.cwd || process.cwd(); + this.maxReadSize = opt.maxReadSize; + this.preservePaths = !!opt.preservePaths; + this.strict = !!opt.strict; + this.noPax = !!opt.noPax; + this.prefix = normalizeWindowsPath(opt.prefix || ""); + this.linkCache = opt.linkCache || /* @__PURE__ */ new Map(); + this.statCache = opt.statCache || /* @__PURE__ */ new Map(); + this.readdirCache = opt.readdirCache || /* @__PURE__ */ new Map(); + this.onWriteEntry = opt.onWriteEntry; + this[WRITEENTRYCLASS] = WriteEntry; + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); + } + this.portable = !!opt.portable; + if (opt.gzip || opt.brotli || opt.zstd) { + if ((opt.gzip ? 1 : 0) + (opt.brotli ? 1 : 0) + (opt.zstd ? 1 : 0) > 1) { + throw new TypeError("gzip, brotli, zstd are mutually exclusive"); + } + if (opt.gzip) { + if (typeof opt.gzip !== "object") { + opt.gzip = {}; + } + if (this.portable) { + opt.gzip.portable = true; + } + this.zip = new Gzip(opt.gzip); + } + if (opt.brotli) { + if (typeof opt.brotli !== "object") { + opt.brotli = {}; + } + this.zip = new BrotliCompress(opt.brotli); + } + if (opt.zstd) { + if (typeof opt.zstd !== "object") { + opt.zstd = {}; + } + this.zip = new ZstdCompress(opt.zstd); } + if (!this.zip) + throw new Error("impossible"); + const zip = this.zip; + zip.on("data", (chunk) => super.write(chunk)); + zip.on("end", () => super.end()); + zip.on("drain", () => this[ONDRAIN2]()); + this.on("resume", () => zip.resume()); + } else { + this.on("drain", this[ONDRAIN2]); } + this.noDirRecurse = !!opt.noDirRecurse; + this.follow = !!opt.follow; + this.noMtime = !!opt.noMtime; + if (opt.mtime) + this.mtime = opt.mtime; + this.filter = typeof opt.filter === "function" ? opt.filter : () => true; + this[QUEUE2] = new Yallist(); + this[JOBS] = 0; + this.jobs = Number(opt.jobs) || 4; + this[PROCESSING] = false; + this[ENDED3] = false; } - for (const [test, transition] of toDef.dynamics) - if (!nodeDef.dynamics.some(([otherTest, { to: to2 }]) => test === otherTest && transition.to === to2)) - nodeDef.dynamics.push([test, transition]); - for (const transition of toDef.shortcuts) { - if (!shortcuts.has(transition.to)) { - nodeDef.shortcuts.push(transition); - shortcuts.add(transition.to); - } + [WRITE](chunk) { + return super.write(chunk); } - } - }; - process5(NODE_INITIAL); -} -function debugMachine(machine, { prefix = `` } = {}) { - if (DEBUG) { - debug(`${prefix}Nodes are:`); - for (let t = 0; t < machine.nodes.length; ++t) { - debug(`${prefix} ${t}: ${JSON.stringify(machine.nodes[t])}`); - } - } -} -function runMachineInternal(machine, input, partial = false) { - debug(`Running a vm on ${JSON.stringify(input)}`); - let branches = [{ node: NODE_INITIAL, state: { - candidateUsage: null, - requiredOptions: [], - errorMessage: null, - ignoreOptions: false, - options: [], - path: [], - positionals: [], - remainder: null, - selectedIndex: null - } }]; - debugMachine(machine, { prefix: ` ` }); - const tokens = [START_OF_INPUT, ...input]; - for (let t = 0; t < tokens.length; ++t) { - const segment = tokens[t]; - debug(` Processing ${JSON.stringify(segment)}`); - const nextBranches = []; - for (const { node, state } of branches) { - debug(` Current node is ${node}`); - const nodeDef = machine.nodes[node]; - if (node === NODE_ERRORED) { - nextBranches.push({ node, state }); - continue; + add(path16) { + this.write(path16); + return this; } - console.assert(nodeDef.shortcuts.length === 0, `Shortcuts should have been eliminated by now`); - const hasExactMatch = Object.prototype.hasOwnProperty.call(nodeDef.statics, segment); - if (!partial || t < tokens.length - 1 || hasExactMatch) { - if (hasExactMatch) { - const transitions = nodeDef.statics[segment]; - for (const { to, reducer } of transitions) { - nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); - debug(` Static transition to ${to} found`); - } - } else { - debug(` No static transition found`); + end(path16, encoding, cb) { + if (typeof path16 === "function") { + cb = path16; + path16 = void 0; } - } else { - let hasMatches = false; - for (const candidate of Object.keys(nodeDef.statics)) { - if (!candidate.startsWith(segment)) - continue; - if (segment === candidate) { - for (const { to, reducer } of nodeDef.statics[candidate]) { - nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); - debug(` Static transition to ${to} found`); - } - } else { - for (const { to } of nodeDef.statics[candidate]) { - nextBranches.push({ node: to, state: { ...state, remainder: candidate.slice(segment.length) } }); - debug(` Static transition to ${to} found (partial match)`); - } - } - hasMatches = true; + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; } - if (!hasMatches) { - debug(` No partial static transition found`); + if (path16) { + this.add(path16); } + this[ENDED3] = true; + this[PROCESS2](); + if (cb) + cb(); + return this; } - if (segment !== END_OF_INPUT) { - for (const [test, { to, reducer }] of nodeDef.dynamics) { - if (execute(tests, test, state, segment)) { - nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); - debug(` Dynamic transition to ${to} found (via ${test})`); - } + write(path16) { + if (this[ENDED3]) { + throw new Error("write after end"); } - } - } - if (nextBranches.length === 0 && segment === END_OF_INPUT && input.length === 1) { - return [{ - node: NODE_INITIAL, - state: basicHelpState - }]; - } - if (nextBranches.length === 0) { - throw new UnknownSyntaxError(input, branches.filter(({ node }) => { - return node !== NODE_ERRORED; - }).map(({ state }) => { - return { usage: state.candidateUsage, reason: null }; - })); - } - if (nextBranches.every(({ node }) => node === NODE_ERRORED)) { - throw new UnknownSyntaxError(input, nextBranches.map(({ state }) => { - return { usage: state.candidateUsage, reason: state.errorMessage }; - })); - } - branches = trimSmallerBranches(nextBranches); - } - if (branches.length > 0) { - debug(` Results:`); - for (const branch of branches) { - debug(` - ${branch.node} -> ${JSON.stringify(branch.state)}`); - } - } else { - debug(` No results`); - } - return branches; -} -function checkIfNodeIsFinished(node, state) { - if (state.selectedIndex !== null) - return true; - if (Object.prototype.hasOwnProperty.call(node.statics, END_OF_INPUT)) { - for (const { to } of node.statics[END_OF_INPUT]) - if (to === NODE_SUCCESS) - return true; - } - return false; -} -function suggestMachine(machine, input, partial) { - const prefix = partial && input.length > 0 ? [``] : []; - const branches = runMachineInternal(machine, input, partial); - const suggestions = []; - const suggestionsJson = /* @__PURE__ */ new Set(); - const traverseSuggestion = (suggestion, node, skipFirst = true) => { - let nextNodes = [node]; - while (nextNodes.length > 0) { - const currentNodes = nextNodes; - nextNodes = []; - for (const node2 of currentNodes) { - const nodeDef = machine.nodes[node2]; - const keys = Object.keys(nodeDef.statics); - for (const key of Object.keys(nodeDef.statics)) { - const segment = keys[0]; - for (const { to, reducer } of nodeDef.statics[segment]) { - if (reducer !== `pushPath`) - continue; - if (!skipFirst) - suggestion.push(segment); - nextNodes.push(to); - } + if (path16 instanceof ReadEntry) { + this[ADDTARENTRY](path16); + } else { + this[ADDFSENTRY](path16); } + return this.flowing; } - skipFirst = false; - } - const json = JSON.stringify(suggestion); - if (suggestionsJson.has(json)) - return; - suggestions.push(suggestion); - suggestionsJson.add(json); - }; - for (const { node, state } of branches) { - if (state.remainder !== null) { - traverseSuggestion([state.remainder], node); - continue; - } - const nodeDef = machine.nodes[node]; - const isFinished = checkIfNodeIsFinished(nodeDef, state); - for (const [candidate, transitions] of Object.entries(nodeDef.statics)) - if (isFinished && candidate !== END_OF_INPUT || !candidate.startsWith(`-`) && transitions.some(({ reducer }) => reducer === `pushPath`)) - traverseSuggestion([...prefix, candidate], node); - if (!isFinished) - continue; - for (const [test, { to }] of nodeDef.dynamics) { - if (to === NODE_ERRORED) - continue; - const tokens = suggest(test, state); - if (tokens === null) - continue; - for (const token of tokens) { - traverseSuggestion([...prefix, token], node); - } - } - } - return [...suggestions].sort(); -} -function runMachine(machine, input) { - const branches = runMachineInternal(machine, [...input, END_OF_INPUT]); - return selectBestState(input, branches.map(({ state }) => { - return state; - })); -} -function trimSmallerBranches(branches) { - let maxPathSize = 0; - for (const { state } of branches) - if (state.path.length > maxPathSize) - maxPathSize = state.path.length; - return branches.filter(({ state }) => { - return state.path.length === maxPathSize; - }); -} -function selectBestState(input, states) { - const terminalStates = states.filter((state) => { - return state.selectedIndex !== null; - }); - if (terminalStates.length === 0) - throw new Error(); - const requiredOptionsSetStates = terminalStates.filter((state) => state.selectedIndex === HELP_COMMAND_INDEX || state.requiredOptions.every((names) => names.some((name2) => state.options.find((opt) => opt.name === name2)))); - if (requiredOptionsSetStates.length === 0) { - throw new UnknownSyntaxError(input, terminalStates.map((state) => ({ - usage: state.candidateUsage, - reason: null - }))); - } - let maxPathSize = 0; - for (const state of requiredOptionsSetStates) - if (state.path.length > maxPathSize) - maxPathSize = state.path.length; - const bestPathBranches = requiredOptionsSetStates.filter((state) => { - return state.path.length === maxPathSize; - }); - const getPositionalCount = (state) => state.positionals.filter(({ extra }) => { - return !extra; - }).length + state.options.length; - const statesWithPositionalCount = bestPathBranches.map((state) => { - return { state, positionalCount: getPositionalCount(state) }; - }); - let maxPositionalCount = 0; - for (const { positionalCount } of statesWithPositionalCount) - if (positionalCount > maxPositionalCount) - maxPositionalCount = positionalCount; - const bestPositionalStates = statesWithPositionalCount.filter(({ positionalCount }) => { - return positionalCount === maxPositionalCount; - }).map(({ state }) => { - return state; - }); - const fixedStates = aggregateHelpStates(bestPositionalStates); - if (fixedStates.length > 1) - throw new AmbiguousSyntaxError(input, fixedStates.map((state) => state.candidateUsage)); - return fixedStates[0]; -} -function aggregateHelpStates(states) { - const notHelps = []; - const helps = []; - for (const state of states) { - if (state.selectedIndex === HELP_COMMAND_INDEX) { - helps.push(state); - } else { - notHelps.push(state); - } - } - if (helps.length > 0) { - notHelps.push({ - ...basicHelpState, - path: findCommonPrefix(...helps.map((state) => state.path)), - options: helps.reduce((options, state) => options.concat(state.options), []) - }); - } - return notHelps; -} -function findCommonPrefix(firstPath, secondPath, ...rest) { - if (secondPath === void 0) - return Array.from(firstPath); - return findCommonPrefix(firstPath.filter((segment, i) => segment === secondPath[i]), ...rest); -} -function makeNode() { - return { - dynamics: [], - shortcuts: [], - statics: {} - }; -} -function isTerminalNode(node) { - return node === NODE_SUCCESS || node === NODE_ERRORED; -} -function cloneTransition(input, offset = 0) { - return { - to: !isTerminalNode(input.to) ? input.to > 2 ? input.to + offset - 2 : input.to + offset : input.to, - reducer: input.reducer - }; -} -function cloneNode(input, offset = 0) { - const output = makeNode(); - for (const [test, transition] of input.dynamics) - output.dynamics.push([test, cloneTransition(transition, offset)]); - for (const transition of input.shortcuts) - output.shortcuts.push(cloneTransition(transition, offset)); - for (const [segment, transitions] of Object.entries(input.statics)) - output.statics[segment] = transitions.map((transition) => cloneTransition(transition, offset)); - return output; -} -function registerDynamic(machine, from, test, to, reducer) { - machine.nodes[from].dynamics.push([ - test, - { to, reducer } - ]); -} -function registerShortcut(machine, from, to, reducer) { - machine.nodes[from].shortcuts.push({ to, reducer }); -} -function registerStatic(machine, from, test, to, reducer) { - const store = !Object.prototype.hasOwnProperty.call(machine.nodes[from].statics, test) ? machine.nodes[from].statics[test] = [] : machine.nodes[from].statics[test]; - store.push({ to, reducer }); -} -function execute(store, callback, state, segment) { - if (Array.isArray(callback)) { - const [name2, ...args] = callback; - return store[name2](state, segment, ...args); - } else { - return store[callback](state, segment); - } -} -function suggest(callback, state) { - const fn2 = Array.isArray(callback) ? tests[callback[0]] : tests[callback]; - if (typeof fn2.suggest === `undefined`) - return null; - const args = Array.isArray(callback) ? callback.slice(1) : []; - return fn2.suggest(state, ...args); -} -var tests = { - always: () => { - return true; - }, - isOptionLike: (state, segment) => { - return !state.ignoreOptions && (segment !== `-` && segment.startsWith(`-`)); - }, - isNotOptionLike: (state, segment) => { - return state.ignoreOptions || segment === `-` || !segment.startsWith(`-`); - }, - isOption: (state, segment, name2, hidden) => { - return !state.ignoreOptions && segment === name2; - }, - isBatchOption: (state, segment, names) => { - return !state.ignoreOptions && BATCH_REGEX.test(segment) && [...segment.slice(1)].every((name2) => names.includes(`-${name2}`)); - }, - isBoundOption: (state, segment, names, options) => { - const optionParsing = segment.match(BINDING_REGEX); - return !state.ignoreOptions && !!optionParsing && OPTION_REGEX.test(optionParsing[1]) && names.includes(optionParsing[1]) && options.filter((opt) => opt.names.includes(optionParsing[1])).every((opt) => opt.allowBinding); - }, - isNegatedOption: (state, segment, name2) => { - return !state.ignoreOptions && segment === `--no-${name2.slice(2)}`; - }, - isHelp: (state, segment) => { - return !state.ignoreOptions && HELP_REGEX.test(segment); - }, - isUnsupportedOption: (state, segment, names) => { - return !state.ignoreOptions && segment.startsWith(`-`) && OPTION_REGEX.test(segment) && !names.includes(segment); - }, - isInvalidOption: (state, segment) => { - return !state.ignoreOptions && segment.startsWith(`-`) && !OPTION_REGEX.test(segment); - } -}; -tests.isOption.suggest = (state, name2, hidden = true) => { - return !hidden ? [name2] : null; -}; -var reducers = { - setCandidateState: (state, segment, candidateState) => { - return { ...state, ...candidateState }; - }, - setSelectedIndex: (state, segment, index) => { - return { ...state, selectedIndex: index }; - }, - pushBatch: (state, segment) => { - return { ...state, options: state.options.concat([...segment.slice(1)].map((name2) => ({ name: `-${name2}`, value: true }))) }; - }, - pushBound: (state, segment) => { - const [, name2, value] = segment.match(BINDING_REGEX); - return { ...state, options: state.options.concat({ name: name2, value }) }; - }, - pushPath: (state, segment) => { - return { ...state, path: state.path.concat(segment) }; - }, - pushPositional: (state, segment) => { - return { ...state, positionals: state.positionals.concat({ value: segment, extra: false }) }; - }, - pushExtra: (state, segment) => { - return { ...state, positionals: state.positionals.concat({ value: segment, extra: true }) }; - }, - pushExtraNoLimits: (state, segment) => { - return { ...state, positionals: state.positionals.concat({ value: segment, extra: NoLimits }) }; - }, - pushTrue: (state, segment, name2 = segment) => { - return { ...state, options: state.options.concat({ name: segment, value: true }) }; - }, - pushFalse: (state, segment, name2 = segment) => { - return { ...state, options: state.options.concat({ name: name2, value: false }) }; - }, - pushUndefined: (state, segment) => { - return { ...state, options: state.options.concat({ name: segment, value: void 0 }) }; - }, - pushStringValue: (state, segment) => { - var _a; - const copy = { ...state, options: [...state.options] }; - const lastOption = state.options[state.options.length - 1]; - lastOption.value = ((_a = lastOption.value) !== null && _a !== void 0 ? _a : []).concat([segment]); - return copy; - }, - setStringValue: (state, segment) => { - const copy = { ...state, options: [...state.options] }; - const lastOption = state.options[state.options.length - 1]; - lastOption.value = segment; - return copy; - }, - inhibateOptions: (state) => { - return { ...state, ignoreOptions: true }; - }, - useHelp: (state, segment, command) => { - const [ - , - /* name */ - , - index - ] = segment.match(HELP_REGEX); - if (typeof index !== `undefined`) { - return { ...state, options: [{ name: `-c`, value: String(command) }, { name: `-i`, value: index }] }; - } else { - return { ...state, options: [{ name: `-c`, value: String(command) }] }; - } - }, - setError: (state, segment, errorMessage) => { - if (segment === END_OF_INPUT) { - return { ...state, errorMessage: `${errorMessage}.` }; - } else { - return { ...state, errorMessage: `${errorMessage} ("${segment}").` }; - } - }, - setOptionArityError: (state, segment) => { - const lastOption = state.options[state.options.length - 1]; - return { ...state, errorMessage: `Not enough arguments to option ${lastOption.name}.` }; - } -}; -var NoLimits = /* @__PURE__ */ Symbol(); -var CommandBuilder = class { - constructor(cliIndex, cliOpts) { - this.allOptionNames = []; - this.arity = { leading: [], trailing: [], extra: [], proxy: false }; - this.options = []; - this.paths = []; - this.cliIndex = cliIndex; - this.cliOpts = cliOpts; - } - addPath(path16) { - this.paths.push(path16); - } - setArity({ leading = this.arity.leading, trailing = this.arity.trailing, extra = this.arity.extra, proxy = this.arity.proxy }) { - Object.assign(this.arity, { leading, trailing, extra, proxy }); - } - addPositional({ name: name2 = `arg`, required = true } = {}) { - if (!required && this.arity.extra === NoLimits) - throw new Error(`Optional parameters cannot be declared when using .rest() or .proxy()`); - if (!required && this.arity.trailing.length > 0) - throw new Error(`Optional parameters cannot be declared after the required trailing positional arguments`); - if (!required && this.arity.extra !== NoLimits) { - this.arity.extra.push(name2); - } else if (this.arity.extra !== NoLimits && this.arity.extra.length === 0) { - this.arity.leading.push(name2); - } else { - this.arity.trailing.push(name2); - } - } - addRest({ name: name2 = `arg`, required = 0 } = {}) { - if (this.arity.extra === NoLimits) - throw new Error(`Infinite lists cannot be declared multiple times in the same command`); - if (this.arity.trailing.length > 0) - throw new Error(`Infinite lists cannot be declared after the required trailing positional arguments`); - for (let t = 0; t < required; ++t) - this.addPositional({ name: name2 }); - this.arity.extra = NoLimits; - } - addProxy({ required = 0 } = {}) { - this.addRest({ required }); - this.arity.proxy = true; - } - addOption({ names, description, arity = 0, hidden = false, required = false, allowBinding = true }) { - if (!allowBinding && arity > 1) - throw new Error(`The arity cannot be higher than 1 when the option only supports the --arg=value syntax`); - if (!Number.isInteger(arity)) - throw new Error(`The arity must be an integer, got ${arity}`); - if (arity < 0) - throw new Error(`The arity must be positive, got ${arity}`); - this.allOptionNames.push(...names); - this.options.push({ names, description, arity, hidden, required, allowBinding }); - } - setContext(context) { - this.context = context; - } - usage({ detailed = true, inlineOptions = true } = {}) { - const segments = [this.cliOpts.binaryName]; - const detailedOptionList = []; - if (this.paths.length > 0) - segments.push(...this.paths[0]); - if (detailed) { - for (const { names, arity, hidden, description, required } of this.options) { - if (hidden) - continue; - const args = []; - for (let t = 0; t < arity; ++t) - args.push(` #${t}`); - const definition = `${names.join(`,`)}${args.join(``)}`; - if (!inlineOptions && description) { - detailedOptionList.push({ definition, description, required }); + [ADDTARENTRY](p) { + const absolute = normalizeWindowsPath(import_path10.default.resolve(this.cwd, p.path)); + if (!this.filter(p.path, p)) { + p.resume(); } else { - segments.push(required ? `<${definition}>` : `[${definition}]`); + const job = new PackJob(p.path, absolute); + job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)); + job.entry.on("end", () => this[JOBDONE](job)); + this[JOBS] += 1; + this[QUEUE2].push(job); } + this[PROCESS2](); + } + [ADDFSENTRY](p) { + const absolute = normalizeWindowsPath(import_path10.default.resolve(this.cwd, p)); + this[QUEUE2].push(new PackJob(p, absolute)); + this[PROCESS2](); + } + [STAT](job) { + job.pending = true; + this[JOBS] += 1; + const stat = this.follow ? "stat" : "lstat"; + import_fs12.default[stat](job.absolute, (er, stat2) => { + job.pending = false; + this[JOBS] -= 1; + if (er) { + this.emit("error", er); + } else { + this[ONSTAT](job, stat2); + } + }); } - segments.push(...this.arity.leading.map((name2) => `<${name2}>`)); - if (this.arity.extra === NoLimits) - segments.push(`...`); - else - segments.push(...this.arity.extra.map((name2) => `[${name2}]`)); - segments.push(...this.arity.trailing.map((name2) => `<${name2}>`)); - } - const usage = segments.join(` `); - return { usage, options: detailedOptionList }; - } - compile() { - if (typeof this.context === `undefined`) - throw new Error(`Assertion failed: No context attached`); - const machine = makeStateMachine(); - let firstNode = NODE_INITIAL; - const candidateUsage = this.usage().usage; - const requiredOptions = this.options.filter((opt) => opt.required).map((opt) => opt.names); - firstNode = injectNode(machine, makeNode()); - registerStatic(machine, NODE_INITIAL, START_OF_INPUT, firstNode, [`setCandidateState`, { candidateUsage, requiredOptions }]); - const positionalArgument = this.arity.proxy ? `always` : `isNotOptionLike`; - const paths = this.paths.length > 0 ? this.paths : [[]]; - for (const path16 of paths) { - let lastPathNode = firstNode; - if (path16.length > 0) { - const optionPathNode = injectNode(machine, makeNode()); - registerShortcut(machine, lastPathNode, optionPathNode); - this.registerOptions(machine, optionPathNode); - lastPathNode = optionPathNode; - } - for (let t = 0; t < path16.length; ++t) { - const nextPathNode = injectNode(machine, makeNode()); - registerStatic(machine, lastPathNode, path16[t], nextPathNode, `pushPath`); - lastPathNode = nextPathNode; - } - if (this.arity.leading.length > 0 || !this.arity.proxy) { - const helpNode = injectNode(machine, makeNode()); - registerDynamic(machine, lastPathNode, `isHelp`, helpNode, [`useHelp`, this.cliIndex]); - registerDynamic(machine, helpNode, `always`, helpNode, `pushExtra`); - registerStatic(machine, helpNode, END_OF_INPUT, NODE_SUCCESS, [`setSelectedIndex`, HELP_COMMAND_INDEX]); - this.registerOptions(machine, lastPathNode); - } - if (this.arity.leading.length > 0) - registerStatic(machine, lastPathNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); - let lastLeadingNode = lastPathNode; - for (let t = 0; t < this.arity.leading.length; ++t) { - const nextLeadingNode = injectNode(machine, makeNode()); - if (!this.arity.proxy || t + 1 !== this.arity.leading.length) - this.registerOptions(machine, nextLeadingNode); - if (this.arity.trailing.length > 0 || t + 1 !== this.arity.leading.length) - registerStatic(machine, nextLeadingNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); - registerDynamic(machine, lastLeadingNode, `isNotOptionLike`, nextLeadingNode, `pushPositional`); - lastLeadingNode = nextLeadingNode; - } - let lastExtraNode = lastLeadingNode; - if (this.arity.extra === NoLimits || this.arity.extra.length > 0) { - const extraShortcutNode = injectNode(machine, makeNode()); - registerShortcut(machine, lastLeadingNode, extraShortcutNode); - if (this.arity.extra === NoLimits) { - const extraNode = injectNode(machine, makeNode()); - if (!this.arity.proxy) - this.registerOptions(machine, extraNode); - registerDynamic(machine, lastLeadingNode, positionalArgument, extraNode, `pushExtraNoLimits`); - registerDynamic(machine, extraNode, positionalArgument, extraNode, `pushExtraNoLimits`); - registerShortcut(machine, extraNode, extraShortcutNode); - } else { - for (let t = 0; t < this.arity.extra.length; ++t) { - const nextExtraNode = injectNode(machine, makeNode()); - if (!this.arity.proxy || t > 0) - this.registerOptions(machine, nextExtraNode); - registerDynamic(machine, lastExtraNode, positionalArgument, nextExtraNode, `pushExtra`); - registerShortcut(machine, nextExtraNode, extraShortcutNode); - lastExtraNode = nextExtraNode; + [ONSTAT](job, stat) { + this.statCache.set(job.absolute, stat); + job.stat = stat; + if (!this.filter(job.path, stat)) { + job.ignore = true; + } else if (stat.isFile() && stat.nlink > 1 && !this.linkCache.get(`${stat.dev}:${stat.ino}`) && !this.sync) { + if (job === this[CURRENT]) { + this[PROCESSJOB](job); + } else { + const key = `${stat.dev}:${stat.ino}`; + const pending = this[PENDINGLINKS].get(key); + if (pending) + pending.push(job); + else + this[PENDINGLINKS].set(key, [job]); + job.pendingLink = true; + job.pending = true; } } - lastExtraNode = extraShortcutNode; - } - if (this.arity.trailing.length > 0) - registerStatic(machine, lastExtraNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); - let lastTrailingNode = lastExtraNode; - for (let t = 0; t < this.arity.trailing.length; ++t) { - const nextTrailingNode = injectNode(machine, makeNode()); - if (!this.arity.proxy) - this.registerOptions(machine, nextTrailingNode); - if (t + 1 < this.arity.trailing.length) - registerStatic(machine, nextTrailingNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); - registerDynamic(machine, lastTrailingNode, `isNotOptionLike`, nextTrailingNode, `pushPositional`); - lastTrailingNode = nextTrailingNode; - } - registerDynamic(machine, lastTrailingNode, positionalArgument, NODE_ERRORED, [`setError`, `Extraneous positional argument`]); - registerStatic(machine, lastTrailingNode, END_OF_INPUT, NODE_SUCCESS, [`setSelectedIndex`, this.cliIndex]); - } - return { - machine, - context: this.context - }; - } - registerOptions(machine, node) { - registerDynamic(machine, node, [`isOption`, `--`], node, `inhibateOptions`); - registerDynamic(machine, node, [`isBatchOption`, this.allOptionNames], node, `pushBatch`); - registerDynamic(machine, node, [`isBoundOption`, this.allOptionNames, this.options], node, `pushBound`); - registerDynamic(machine, node, [`isUnsupportedOption`, this.allOptionNames], NODE_ERRORED, [`setError`, `Unsupported option name`]); - registerDynamic(machine, node, [`isInvalidOption`], NODE_ERRORED, [`setError`, `Invalid option name`]); - for (const option of this.options) { - const longestName = option.names.reduce((longestName2, name2) => { - return name2.length > longestName2.length ? name2 : longestName2; - }, ``); - if (option.arity === 0) { - for (const name2 of option.names) { - registerDynamic(machine, node, [`isOption`, name2, option.hidden || name2 !== longestName], node, `pushTrue`); - if (name2.startsWith(`--`) && !name2.startsWith(`--no-`)) { - registerDynamic(machine, node, [`isNegatedOption`, name2], node, [`pushFalse`, name2]); + this[PROCESS2](); + } + [READDIR](job) { + job.pending = true; + this[JOBS] += 1; + import_fs12.default.readdir(job.absolute, (er, entries) => { + job.pending = false; + this[JOBS] -= 1; + if (er) { + return this.emit("error", er); } - } - } else { - let lastNode = injectNode(machine, makeNode()); - for (const name2 of option.names) - registerDynamic(machine, node, [`isOption`, name2, option.hidden || name2 !== longestName], lastNode, `pushUndefined`); - for (let t = 0; t < option.arity; ++t) { - const nextNode = injectNode(machine, makeNode()); - registerStatic(machine, lastNode, END_OF_INPUT, NODE_ERRORED, `setOptionArityError`); - registerDynamic(machine, lastNode, `isOptionLike`, NODE_ERRORED, `setOptionArityError`); - const action = option.arity === 1 ? `setStringValue` : `pushStringValue`; - registerDynamic(machine, lastNode, `isNotOptionLike`, nextNode, action); - lastNode = nextNode; - } - registerShortcut(machine, lastNode, node); + this[ONREADDIR](job, entries); + }); } - } - } -}; -var CliBuilder = class _CliBuilder { - constructor({ binaryName = `...` } = {}) { - this.builders = []; - this.opts = { binaryName }; - } - static build(cbs, opts = {}) { - return new _CliBuilder(opts).commands(cbs).compile(); - } - getBuilderByIndex(n) { - if (!(n >= 0 && n < this.builders.length)) - throw new Error(`Assertion failed: Out-of-bound command index (${n})`); - return this.builders[n]; - } - commands(cbs) { - for (const cb of cbs) - cb(this.command()); - return this; - } - command() { - const builder = new CommandBuilder(this.builders.length, this.opts); - this.builders.push(builder); - return builder; - } - compile() { - const machines = []; - const contexts = []; - for (const builder of this.builders) { - const { machine: machine2, context } = builder.compile(); - machines.push(machine2); - contexts.push(context); - } - const machine = makeAnyOfMachine(machines); - simplifyMachine(machine); - return { - machine, - contexts, - process: (input) => { - return runMachine(machine, input); - }, - suggest: (input, partial) => { - return suggestMachine(machine, input, partial); + [ONREADDIR](job, entries) { + this.readdirCache.set(job.absolute, entries); + job.readdir = entries; + this[PROCESS2](); } - }; - } -}; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/Cli.mjs -var import_platform = __toESM(require_node(), 1); - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/HelpCommand.mjs -var HelpCommand = class _HelpCommand extends Command { - constructor(contexts) { - super(); - this.contexts = contexts; - this.commands = []; - } - static from(state, contexts) { - const command = new _HelpCommand(contexts); - command.path = state.path; - for (const opt of state.options) { - switch (opt.name) { - case `-c`: - { - command.commands.push(Number(opt.value)); + [PROCESS2]() { + if (this[PROCESSING]) { + return; + } + this[PROCESSING] = true; + for (let w = this[QUEUE2].head; !!w && this[JOBS] < this.jobs; w = w.next) { + this[PROCESSJOB](w.value); + if (w.value.ignore) { + const p = w.next; + this[QUEUE2].removeNode(w); + w.next = p; } - break; - case `-i`: - { - command.index = Number(opt.value); + } + this[PROCESSING] = false; + if (this[ENDED3] && this[QUEUE2].length === 0 && this[JOBS] === 0) { + if (this.zip) { + this.zip.end(EOF2); + } else { + super.write(EOF2); + super.end(); } - break; - } - } - return command; - } - async execute() { - let commands = this.commands; - if (typeof this.index !== `undefined` && this.index >= 0 && this.index < commands.length) - commands = [commands[this.index]]; - if (commands.length === 0) { - this.context.stdout.write(this.cli.usage()); - } else if (commands.length === 1) { - this.context.stdout.write(this.cli.usage(this.contexts[commands[0]].commandClass, { detailed: true })); - } else if (commands.length > 1) { - this.context.stdout.write(`Multiple commands match your selection: -`); - this.context.stdout.write(` -`); - let index = 0; - for (const command of this.commands) - this.context.stdout.write(this.cli.usage(this.contexts[command].commandClass, { prefix: `${index++}. `.padStart(5) })); - this.context.stdout.write(` -`); - this.context.stdout.write(`Run again with -h= to see the longer details of any of those commands. -`); - } - } -}; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/Cli.mjs -var errorCommandSymbol = /* @__PURE__ */ Symbol(`clipanion/errorCommand`); -var Cli = class _Cli { - constructor({ binaryLabel, binaryName: binaryNameOpt = `...`, binaryVersion, enableCapture = false, enableColors } = {}) { - this.registrations = /* @__PURE__ */ new Map(); - this.builder = new CliBuilder({ binaryName: binaryNameOpt }); - this.binaryLabel = binaryLabel; - this.binaryName = binaryNameOpt; - this.binaryVersion = binaryVersion; - this.enableCapture = enableCapture; - this.enableColors = enableColors; - } - /** - * Creates a new Cli and registers all commands passed as parameters. - * - * @param commandClasses The Commands to register - * @returns The created `Cli` instance - */ - static from(commandClasses, options = {}) { - const cli = new _Cli(options); - const resolvedCommandClasses = Array.isArray(commandClasses) ? commandClasses : [commandClasses]; - for (const commandClass of resolvedCommandClasses) - cli.register(commandClass); - return cli; - } - /** - * Registers a command inside the CLI. - */ - register(commandClass) { - var _a; - const specs = /* @__PURE__ */ new Map(); - const command = new commandClass(); - for (const key in command) { - const value = command[key]; - if (typeof value === `object` && value !== null && value[Command.isOption]) { - specs.set(key, value); + } } - } - const builder = this.builder.command(); - const index = builder.cliIndex; - const paths = (_a = commandClass.paths) !== null && _a !== void 0 ? _a : command.paths; - if (typeof paths !== `undefined`) - for (const path16 of paths) - builder.addPath(path16); - this.registrations.set(commandClass, { specs, builder, index }); - for (const [key, { definition }] of specs.entries()) - definition(builder, key); - builder.setContext({ - commandClass - }); - } - process(input, userContext) { - const { contexts, process: process5 } = this.builder.compile(); - const state = process5(input); - const context = { - ..._Cli.defaultContext, - ...userContext - }; - switch (state.selectedIndex) { - case HELP_COMMAND_INDEX: { - const command = HelpCommand.from(state, contexts); - command.context = context; - return command; + get [CURRENT]() { + return this[QUEUE2] && this[QUEUE2].head && this[QUEUE2].head.value; } - default: - { - const { commandClass } = contexts[state.selectedIndex]; - const record = this.registrations.get(commandClass); - if (typeof record === `undefined`) - throw new Error(`Assertion failed: Expected the command class to have been registered.`); - const command = new commandClass(); - command.context = context; - command.path = state.path; - try { - for (const [key, { transformer }] of record.specs.entries()) - command[key] = transformer(record.builder, key, state, context); - return command; - } catch (error) { - error[errorCommandSymbol] = command; - throw error; + [JOBDONE](job) { + this[QUEUE2].shift(); + this[JOBS] -= 1; + const { stat } = job; + if (stat && stat.isFile() && stat.nlink > 1) { + const key = `${stat.dev}:${stat.ino}`; + const pending = this[PENDINGLINKS].get(key); + if (pending) { + this[PENDINGLINKS].delete(key); + for (const job2 of pending) { + job2.pending = false; + this[PROCESSJOB](job2); + } } } - break; - } - } - async run(input, userContext) { - var _a, _b; - let command; - const context = { - ..._Cli.defaultContext, - ...userContext - }; - const colored = (_a = this.enableColors) !== null && _a !== void 0 ? _a : context.colorDepth > 1; - if (!Array.isArray(input)) { - command = input; - } else { - try { - command = this.process(input, context); - } catch (error) { - context.stdout.write(this.error(error, { colored })); - return 1; + this[PROCESS2](); } - } - if (command.help) { - context.stdout.write(this.usage(command, { colored, detailed: true })); - return 0; - } - command.context = context; - command.cli = { - binaryLabel: this.binaryLabel, - binaryName: this.binaryName, - binaryVersion: this.binaryVersion, - enableCapture: this.enableCapture, - enableColors: this.enableColors, - definitions: () => this.definitions(), - error: (error, opts) => this.error(error, opts), - format: (colored2) => this.format(colored2), - process: (input2, subContext) => this.process(input2, { ...context, ...subContext }), - run: (input2, subContext) => this.run(input2, { ...context, ...subContext }), - usage: (command2, opts) => this.usage(command2, opts) - }; - const activate = this.enableCapture ? (_b = (0, import_platform.getCaptureActivator)(context)) !== null && _b !== void 0 ? _b : noopCaptureActivator : noopCaptureActivator; - let exitCode; - try { - exitCode = await activate(() => command.validateAndExecute().catch((error) => command.catch(error).then(() => 0))); - } catch (error) { - context.stdout.write(this.error(error, { colored, command })); - return 1; - } - return exitCode; - } - async runExit(input, context) { - process.exitCode = await this.run(input, context); - } - suggest(input, partial) { - const { suggest: suggest2 } = this.builder.compile(); - return suggest2(input, partial); - } - definitions({ colored = false } = {}) { - const data = []; - for (const [commandClass, { index }] of this.registrations) { - if (typeof commandClass.usage === `undefined`) - continue; - const { usage: path16 } = this.getUsageByIndex(index, { detailed: false }); - const { usage, options } = this.getUsageByIndex(index, { detailed: true, inlineOptions: false }); - const category = typeof commandClass.usage.category !== `undefined` ? formatMarkdownish(commandClass.usage.category, { format: this.format(colored), paragraphs: false }) : void 0; - const description = typeof commandClass.usage.description !== `undefined` ? formatMarkdownish(commandClass.usage.description, { format: this.format(colored), paragraphs: false }) : void 0; - const details = typeof commandClass.usage.details !== `undefined` ? formatMarkdownish(commandClass.usage.details, { format: this.format(colored), paragraphs: true }) : void 0; - const examples = typeof commandClass.usage.examples !== `undefined` ? commandClass.usage.examples.map(([label, cli]) => [formatMarkdownish(label, { format: this.format(colored), paragraphs: false }), cli.replace(/\$0/g, this.binaryName)]) : void 0; - data.push({ path: path16, usage, category, description, details, examples, options }); - } - return data; - } - usage(command = null, { colored, detailed = false, prefix = `$ ` } = {}) { - var _a; - if (command === null) { - for (const commandClass2 of this.registrations.keys()) { - const paths = commandClass2.paths; - const isDocumented = typeof commandClass2.usage !== `undefined`; - const isExclusivelyDefault = !paths || paths.length === 0 || paths.length === 1 && paths[0].length === 0; - const isDefault = isExclusivelyDefault || ((_a = paths === null || paths === void 0 ? void 0 : paths.some((path16) => path16.length === 0)) !== null && _a !== void 0 ? _a : false); - if (isDefault) { - if (command) { - command = null; - break; + [PROCESSJOB](job) { + if (job.pending && job.pendingLink && job === this[CURRENT]) { + job.pending = false; + job.pendingLink = false; + } + if (job.pending) { + return; + } + if (job.entry) { + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job); + } + return; + } + if (!job.stat) { + const sc = this.statCache.get(job.absolute); + if (sc) { + this[ONSTAT](job, sc); } else { - command = commandClass2; + this[STAT](job); } - } else { - if (isDocumented) { - command = null; - continue; + } + if (!job.stat) { + return; + } + if (job.ignore) { + return; + } + if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { + const rc = this.readdirCache.get(job.absolute); + if (rc) { + this[ONREADDIR](job, rc); + } else { + this[READDIR](job); + } + if (!job.readdir) { + return; } } + job.entry = this[ENTRY](job); + if (!job.entry) { + job.ignore = true; + return; + } + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job); + } } - if (command) { - detailed = true; - } - } - const commandClass = command !== null && command instanceof Command ? command.constructor : command; - let result = ``; - if (!commandClass) { - const commandsByCategories = /* @__PURE__ */ new Map(); - for (const [commandClass2, { index }] of this.registrations.entries()) { - if (typeof commandClass2.usage === `undefined`) - continue; - const category = typeof commandClass2.usage.category !== `undefined` ? formatMarkdownish(commandClass2.usage.category, { format: this.format(colored), paragraphs: false }) : null; - let categoryCommands = commandsByCategories.get(category); - if (typeof categoryCommands === `undefined`) - commandsByCategories.set(category, categoryCommands = []); - const { usage } = this.getUsageByIndex(index); - categoryCommands.push({ commandClass: commandClass2, usage }); - } - const categoryNames = Array.from(commandsByCategories.keys()).sort((a, b) => { - if (a === null) - return -1; - if (b === null) - return 1; - return a.localeCompare(b, `en`, { usage: `sort`, caseFirst: `upper` }); - }); - const hasLabel = typeof this.binaryLabel !== `undefined`; - const hasVersion = typeof this.binaryVersion !== `undefined`; - if (hasLabel || hasVersion) { - if (hasLabel && hasVersion) - result += `${this.format(colored).header(`${this.binaryLabel} - ${this.binaryVersion}`)} - -`; - else if (hasLabel) - result += `${this.format(colored).header(`${this.binaryLabel}`)} -`; - else - result += `${this.format(colored).header(`${this.binaryVersion}`)} -`; - result += ` ${this.format(colored).bold(prefix)}${this.binaryName} -`; - } else { - result += `${this.format(colored).bold(prefix)}${this.binaryName} -`; + [ENTRYOPT](job) { + return { + onwarn: (code2, msg, data) => this.warn(code2, msg, data), + noPax: this.noPax, + cwd: this.cwd, + absolute: job.absolute, + preservePaths: this.preservePaths, + maxReadSize: this.maxReadSize, + strict: this.strict, + portable: this.portable, + linkCache: this.linkCache, + statCache: this.statCache, + noMtime: this.noMtime, + mtime: this.mtime, + prefix: this.prefix, + onWriteEntry: this.onWriteEntry + }; } - for (const categoryName of categoryNames) { - const commands = commandsByCategories.get(categoryName).slice().sort((a, b) => { - return a.usage.localeCompare(b.usage, `en`, { usage: `sort`, caseFirst: `upper` }); - }); - const header = categoryName !== null ? categoryName.trim() : `General commands`; - result += ` -`; - result += `${this.format(colored).header(`${header}`)} -`; - for (const { commandClass: commandClass2, usage } of commands) { - const doc = commandClass2.usage.description || `undocumented`; - result += ` -`; - result += ` ${this.format(colored).bold(usage)} -`; - result += ` ${formatMarkdownish(doc, { format: this.format(colored), paragraphs: false })}`; + [ENTRY](job) { + this[JOBS] += 1; + try { + const e = new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)); + return e.on("end", () => this[JOBDONE](job)).on("error", (er) => this.emit("error", er)); + } catch (er) { + this.emit("error", er); } } - result += ` -`; - result += formatMarkdownish(`You can also print more details about any of these commands by calling them with the \`-h,--help\` flag right after the command name.`, { format: this.format(colored), paragraphs: true }); - } else { - if (!detailed) { - const { usage } = this.getUsageByRegistration(commandClass); - result += `${this.format(colored).bold(prefix)}${usage} -`; - } else { - const { description = ``, details = ``, examples = [] } = commandClass.usage || {}; - if (description !== ``) { - result += formatMarkdownish(description, { format: this.format(colored), paragraphs: false }).replace(/^./, ($0) => $0.toUpperCase()); - result += ` -`; - } - if (details !== `` || examples.length > 0) { - result += `${this.format(colored).header(`Usage`)} -`; - result += ` -`; - } - const { usage, options } = this.getUsageByRegistration(commandClass, { inlineOptions: false }); - result += `${this.format(colored).bold(prefix)}${usage} -`; - if (options.length > 0) { - result += ` -`; - result += `${this.format(colored).header(`Options`)} -`; - const maxDefinitionLength = options.reduce((length, option) => { - return Math.max(length, option.definition.length); - }, 0); - result += ` -`; - for (const { definition, description: description2 } of options) { - result += ` ${this.format(colored).bold(definition.padEnd(maxDefinitionLength))} ${formatMarkdownish(description2, { format: this.format(colored), paragraphs: false })}`; - } + [ONDRAIN2]() { + if (this[CURRENT] && this[CURRENT].entry) { + this[CURRENT].entry.resume(); } - if (details !== ``) { - result += ` -`; - result += `${this.format(colored).header(`Details`)} -`; - result += ` -`; - result += formatMarkdownish(details, { format: this.format(colored), paragraphs: true }); + } + // like .pipe() but using super, because our write() is special + [PIPE](job) { + job.piped = true; + if (job.readdir) { + job.readdir.forEach((entry) => { + const p = job.path; + const base = p === "./" ? "" : p.replace(/\/*$/, "/"); + this[ADDFSENTRY](base + entry); + }); } - if (examples.length > 0) { - result += ` -`; - result += `${this.format(colored).header(`Examples`)} -`; - for (const [description2, example] of examples) { - result += ` -`; - result += formatMarkdownish(description2, { format: this.format(colored), paragraphs: false }); - result += `${example.replace(/^/m, ` ${this.format(colored).bold(prefix)}`).replace(/\$0/g, this.binaryName)} -`; - } + const source = job.entry; + const zip = this.zip; + if (!source) + throw new Error("cannot pipe without source"); + if (zip) { + source.on("data", (chunk) => { + if (!zip.write(chunk)) { + source.pause(); + } + }); + } else { + source.on("data", (chunk) => { + if (!super.write(chunk)) { + source.pause(); + } + }); } } - } - return result; - } - error(error, _a) { - var _b; - var { colored, command = (_b = error[errorCommandSymbol]) !== null && _b !== void 0 ? _b : null } = _a === void 0 ? {} : _a; - if (!error || typeof error !== `object` || !(`stack` in error)) - error = new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(error)})`); - let result = ``; - let name2 = error.name.replace(/([a-z])([A-Z])/g, `$1 $2`); - if (name2 === `Error`) - name2 = `Internal Error`; - result += `${this.format(colored).error(name2)}: ${error.message} -`; - const meta = error.clipanion; - if (typeof meta !== `undefined`) { - if (meta.type === `usage`) { - result += ` -`; - result += this.usage(command); + pause() { + if (this.zip) { + this.zip.pause(); + } + return super.pause(); } - } else { - if (error.stack) { - result += `${error.stack.replace(/^.*\n/, ``)} -`; + warn(code2, message, data = {}) { + warnMethod(this, code2, message, data); } - } - return result; - } - format(colored) { - var _a; - return ((_a = colored !== null && colored !== void 0 ? colored : this.enableColors) !== null && _a !== void 0 ? _a : _Cli.defaultContext.colorDepth > 1) ? richFormat : textFormat; - } - getUsageByRegistration(klass, opts) { - const record = this.registrations.get(klass); - if (typeof record === `undefined`) - throw new Error(`Assertion failed: Unregistered command`); - return this.getUsageByIndex(record.index, opts); - } - getUsageByIndex(n, opts) { - return this.builder.getBuilderByIndex(n).usage(opts); - } -}; -Cli.defaultContext = { - env: process.env, - stdin: process.stdin, - stdout: process.stdout, - stderr: process.stderr, - colorDepth: (0, import_platform.getDefaultColorDepth)() -}; -function noopCaptureActivator(fn2) { - return fn2(); -} - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/index.mjs -var builtins_exports = {}; -__export(builtins_exports, { - DefinitionsCommand: () => DefinitionsCommand, - HelpCommand: () => HelpCommand2, - VersionCommand: () => VersionCommand -}); - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/definitions.mjs -var DefinitionsCommand = class extends Command { - async execute() { - this.context.stdout.write(`${JSON.stringify(this.cli.definitions(), null, 2)} -`); - } -}; -DefinitionsCommand.paths = [[`--clipanion=definitions`]]; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/help.mjs -var HelpCommand2 = class extends Command { - async execute() { - this.context.stdout.write(this.cli.usage()); - } -}; -HelpCommand2.paths = [[`-h`], [`--help`]]; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/version.mjs -var VersionCommand = class extends Command { - async execute() { - var _a; - this.context.stdout.write(`${(_a = this.cli.binaryVersion) !== null && _a !== void 0 ? _a : ``} -`); - } -}; -VersionCommand.paths = [[`-v`], [`--version`]]; - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/index.mjs -var options_exports = {}; -__export(options_exports, { - Array: () => Array2, - Boolean: () => Boolean2, - Counter: () => Counter, - Proxy: () => Proxy2, - Rest: () => Rest, - String: () => String2, - applyValidator: () => applyValidator, - cleanValidationError: () => cleanValidationError, - formatError: () => formatError, - isOptionSymbol: () => isOptionSymbol, - makeCommandOption: () => makeCommandOption, - rerouteArguments: () => rerouteArguments -}); - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Array.mjs -function Array2(descriptor, initialValueBase, optsBase) { - const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); - const { arity = 1 } = opts; - const optNames = descriptor.split(`,`); - const nameSet = new Set(optNames); - return makeCommandOption({ - definition(builder) { - builder.addOption({ - names: optNames, - arity, - hidden: opts === null || opts === void 0 ? void 0 : opts.hidden, - description: opts === null || opts === void 0 ? void 0 : opts.description, - required: opts.required - }); - }, - transformer(builder, key, state) { - let usedName; - let currentValue = typeof initialValue !== `undefined` ? [...initialValue] : void 0; - for (const { name: name2, value } of state.options) { - if (!nameSet.has(name2)) - continue; - usedName = name2; - currentValue = currentValue !== null && currentValue !== void 0 ? currentValue : []; - currentValue.push(value); + }; + PackSync = class extends Pack { + sync = true; + constructor(opt) { + super(opt); + this[WRITEENTRYCLASS] = WriteEntrySync; } - if (typeof currentValue !== `undefined`) { - return applyValidator(usedName !== null && usedName !== void 0 ? usedName : key, currentValue, opts.validator); - } else { - return currentValue; + // pause/resume are no-ops in sync streams. + pause() { } - } - }); -} - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Boolean.mjs -function Boolean2(descriptor, initialValueBase, optsBase) { - const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); - const optNames = descriptor.split(`,`); - const nameSet = new Set(optNames); - return makeCommandOption({ - definition(builder) { - builder.addOption({ - names: optNames, - allowBinding: false, - arity: 0, - hidden: opts.hidden, - description: opts.description, - required: opts.required - }); - }, - transformer(builer, key, state) { - let currentValue = initialValue; - for (const { name: name2, value } of state.options) { - if (!nameSet.has(name2)) - continue; - currentValue = value; + resume() { } - return currentValue; - } - }); -} - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Counter.mjs -function Counter(descriptor, initialValueBase, optsBase) { - const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); - const optNames = descriptor.split(`,`); - const nameSet = new Set(optNames); - return makeCommandOption({ - definition(builder) { - builder.addOption({ - names: optNames, - allowBinding: false, - arity: 0, - hidden: opts.hidden, - description: opts.description, - required: opts.required - }); - }, - transformer(builder, key, state) { - let currentValue = initialValue; - for (const { name: name2, value } of state.options) { - if (!nameSet.has(name2)) - continue; - currentValue !== null && currentValue !== void 0 ? currentValue : currentValue = 0; - if (!value) { - currentValue = 0; + [STAT](job) { + const stat = this.follow ? "statSync" : "lstatSync"; + this[ONSTAT](job, import_fs12.default[stat](job.absolute)); + } + [READDIR](job) { + this[ONREADDIR](job, import_fs12.default.readdirSync(job.absolute)); + } + // gotta get it all in this tick + [PIPE](job) { + const source = job.entry; + const zip = this.zip; + if (job.readdir) { + job.readdir.forEach((entry) => { + const p = job.path; + const base = p === "./" ? "" : p.replace(/\/*$/, "/"); + this[ADDFSENTRY](base + entry); + }); + } + if (!source) + throw new Error("Cannot pipe without source"); + if (zip) { + source.on("data", (chunk) => { + zip.write(chunk); + }); } else { - currentValue += 1; + source.on("data", (chunk) => { + super[WRITE](chunk); + }); } } - return currentValue; - } - }); -} + }; + } +}); -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Proxy.mjs -function Proxy2(opts = {}) { - return makeCommandOption({ - definition(builder, key) { - var _a; - builder.addProxy({ - name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, - required: opts.required +// node_modules/tar/dist/esm/create.js +var create_exports = {}; +__export(create_exports, { + create: () => create +}); +var import_node_path8, createFileSync, createFile, addFilesSync, addFilesAsync, createSync, createAsync, create; +var init_create = __esm({ + "node_modules/tar/dist/esm/create.js"() { + init_esm2(); + import_node_path8 = __toESM(require("node:path"), 1); + init_list(); + init_make_command(); + init_pack(); + createFileSync = (opt, files) => { + const p = new PackSync(opt); + const stream = new WriteStreamSync(opt.file, { + mode: opt.mode || 438 }); - }, - transformer(builder, key, state) { - return state.positionals.map(({ value }) => value); - } - }); -} - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Rest.mjs -function Rest(opts = {}) { - return makeCommandOption({ - definition(builder, key) { - var _a; - builder.addRest({ - name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, - required: opts.required + p.pipe(stream); + addFilesSync(p, files); + }; + createFile = (opt, files) => { + const p = new Pack(opt); + const stream = new WriteStream(opt.file, { + mode: opt.mode || 438 }); - }, - transformer(builder, key, state) { - const isRestPositional = (index) => { - const positional = state.positionals[index]; - if (positional.extra === NoLimits) - return true; - if (positional.extra === false && index < builder.arity.leading.length) - return true; - return false; - }; - let count = 0; - while (count < state.positionals.length && isRestPositional(count)) - count += 1; - return state.positionals.splice(0, count).map(({ value }) => value); - } - }); -} - -// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/String.mjs -function StringOption(descriptor, initialValueBase, optsBase) { - const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); - const { arity = 1 } = opts; - const optNames = descriptor.split(`,`); - const nameSet = new Set(optNames); - return makeCommandOption({ - definition(builder) { - builder.addOption({ - names: optNames, - arity: opts.tolerateBoolean ? 0 : arity, - hidden: opts.hidden, - description: opts.description, - required: opts.required + p.pipe(stream); + const promise = new Promise((res, rej) => { + stream.on("error", rej); + stream.on("close", res); + p.on("error", rej); }); - }, - transformer(builder, key, state, context) { - let usedName; - let currentValue = initialValue; - if (typeof opts.env !== `undefined` && context.env[opts.env]) { - usedName = opts.env; - currentValue = context.env[opts.env]; - } - for (const { name: name2, value } of state.options) { - if (!nameSet.has(name2)) - continue; - usedName = name2; - currentValue = value; - } - if (typeof currentValue === `string`) { - return applyValidator(usedName !== null && usedName !== void 0 ? usedName : key, currentValue, opts.validator); - } else { - return currentValue; - } - } - }); -} -function StringPositional(opts = {}) { - const { required = true } = opts; - return makeCommandOption({ - definition(builder, key) { - var _a; - builder.addPositional({ - name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, - required: opts.required + addFilesAsync(p, files).catch((er) => p.emit("error", er)); + return promise; + }; + addFilesSync = (p, files) => { + files.forEach((file) => { + if (file.charAt(0) === "@") { + list({ + file: import_node_path8.default.resolve(p.cwd, file.slice(1)), + sync: true, + noResume: true, + onReadEntry: (entry) => p.add(entry) + }); + } else { + p.add(file); + } }); - }, - transformer(builder, key, state) { - var _a; - for (let i = 0; i < state.positionals.length; ++i) { - if (state.positionals[i].extra === NoLimits) - continue; - if (required && state.positionals[i].extra === true) - continue; - if (!required && state.positionals[i].extra === false) - continue; - const [positional] = state.positionals.splice(i, 1); - return applyValidator((_a = opts.name) !== null && _a !== void 0 ? _a : key, positional.value, opts.validator); + p.end(); + }; + addFilesAsync = async (p, files) => { + for (const file of files) { + if (file.charAt(0) === "@") { + await list({ + file: import_node_path8.default.resolve(String(p.cwd), file.slice(1)), + noResume: true, + onReadEntry: (entry) => { + p.add(entry); + } + }); + } else { + p.add(file); + } } - return void 0; - } - }); -} -function String2(descriptor, ...args) { - if (typeof descriptor === `string`) { - return StringOption(descriptor, ...args); - } else { - return StringPositional(descriptor); + p.end(); + }; + createSync = (opt, files) => { + const p = new PackSync(opt); + addFilesSync(p, files); + return p; + }; + createAsync = (opt, files) => { + const p = new Pack(opt); + addFilesAsync(p, files).catch((er) => p.emit("error", er)); + return p; + }; + create = makeCommand(createFileSync, createFile, createSync, createAsync, (_opt, files) => { + if (!files?.length) { + throw new TypeError("no paths specified to add to archive"); + } + }); } -} +}); + +// node_modules/semver/functions/major.js +var require_major = __commonJS({ + "node_modules/semver/functions/major.js"(exports2, module2) { + "use strict"; + var SemVer3 = require_semver(); + var major = (a, loose) => new SemVer3(a, loose).major; + module2.exports = major; + } +}); + +// sources/_lib.ts +var lib_exports2 = {}; +__export(lib_exports2, { + runMain: () => runMain +}); +module.exports = __toCommonJS(lib_exports2); + +// sources/main.ts +var import_clipanion17 = __toESM(require_advanced()); // package.json -var version = "0.34.7"; +var version = "0.35.0"; // sources/Engine.ts +var import_clipanion5 = __toESM(require_advanced()); var import_fs6 = __toESM(require("fs")); var import_path5 = __toESM(require("path")); var import_process3 = __toESM(require("process")); @@ -21777,7 +12578,7 @@ var import_valid4 = __toESM(require_valid2()); var config_default = { definitions: { npm: { - default: "11.12.1+sha1.432da55a9f0ca53c982740fabe2b081a38019fb1", + default: "11.14.1+sha1.4a6839650da0005f323fec6abd39d77ee24f842f", fetchLatestFrom: { type: "npm", package: "npm" @@ -21814,7 +12615,7 @@ var config_default = { } }, pnpm: { - default: "10.33.0+sha1.46a0bef28aad690765997ab6da6d5475bdd4148e", + default: "11.1.2+sha1.ed39d701687311ce9345771c62376f9fe7286694", fetchLatestFrom: { type: "npm", package: "pnpm" @@ -21992,6 +12793,7 @@ var import_debug = __toESM(require_src()); var log = (0, import_debug.default)(`corepack`); // sources/folderUtils.ts +var import_clipanion = __toESM(require_advanced()); var import_fs = require("fs"); var import_os = require("os"); var import_path = require("path"); @@ -22022,7 +12824,7 @@ function getTemporaryFolder(target = (0, import_os.tmpdir)()) { if (error.code === `EEXIST`) { continue; } else if (error.code === `EACCES`) { - throw new UsageError(`Failed to create cache directory. Please ensure the user has write access to the target directory (${target}). If the user's home directory does not exist, create it first.`); + throw new import_clipanion.UsageError(`Failed to create cache directory. Please ensure the user has write access to the target directory (${target}). If the user's home directory does not exist, create it first.`); } else { throw error; } @@ -22032,11 +12834,13 @@ function getTemporaryFolder(target = (0, import_os.tmpdir)()) { // sources/httpUtils.ts var import_assert = __toESM(require("assert")); +var import_clipanion3 = __toESM(require_advanced()); var import_events = require("events"); var import_process2 = require("process"); var import_stream = require("stream"); // sources/npmRegistryUtils.ts +var import_clipanion2 = __toESM(require_advanced()); var import_crypto = require("crypto"); var DEFAULT_HEADERS = { [`Accept`]: `application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8` @@ -22045,7 +12849,7 @@ var DEFAULT_NPM_REGISTRY_URL = `https://registry.npmjs.org`; async function fetchAsJson2(packageName, version2) { const npmRegistryUrl = process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL; if (process.env.COREPACK_ENABLE_NETWORK === `0`) - throw new UsageError(`Network access disabled by the environment; can't reach npm repository ${npmRegistryUrl}`); + throw new import_clipanion2.UsageError(`Network access disabled by the environment; can't reach npm repository ${npmRegistryUrl}`); const headers = { ...DEFAULT_HEADERS }; if (`COREPACK_NPM_TOKEN` in process.env) { headers.authorization = `Bearer ${process.env.COREPACK_NPM_TOKEN}`; @@ -22067,7 +12871,7 @@ function verifySignature({ signatures, integrity, packageName, version: version2 break; } } - if (signature?.sig == null) throw new UsageError(`The package was not signed by any trusted keys: ${JSON.stringify({ signatures, trustedKeys }, void 0, 2)}`); + if (signature?.sig == null) throw new import_clipanion2.UsageError(`The package was not signed by any trusted keys: ${JSON.stringify({ signatures, trustedKeys }, void 0, 2)}`); const verifier = (0, import_crypto.createVerify)(`SHA256`); verifier.end(`${packageName}@${version2}:${integrity}`); const valid = verifier.verify( @@ -22117,8 +12921,7 @@ async function fetchTarballURLAndSignature(packageName, version2) { // sources/httpUtils.ts async function fetch(input, init) { if (process.env.COREPACK_ENABLE_NETWORK === `0`) - throw new UsageError(`Network access disabled by the environment; can't reach ${input}`); - const agent = await getProxyAgent(input); + throw new import_clipanion3.UsageError(`Network access disabled by the environment; can't reach ${input}`); if (typeof input === `string`) input = new URL(input); let headers = init?.headers; @@ -22142,7 +12945,6 @@ async function fetch(input, init) { try { response = await globalThis.fetch(input, { ...init, - dispatcher: agent, headers }); } catch (error) { @@ -22172,7 +12974,7 @@ async function fetchUrlStream(input, init) { const chars = await (0, import_events.once)(import_process2.stdin, `data`); import_process2.stdin.pause(); if (chars[0][0] === 110 || chars[0][0] === 78) - throw new UsageError(`Aborted by the user`); + throw new import_clipanion3.UsageError(`Aborted by the user`); console.error(); } } @@ -22182,25 +12984,6 @@ async function fetchUrlStream(input, init) { const stream = import_stream.Readable.fromWeb(webStream); return stream; } -var ProxyAgent; -async function getProxyAgent(input) { - const { getProxyForUrl } = await Promise.resolve().then(() => __toESM(require_proxy_from_env())); - const proxy = getProxyForUrl(input); - if (!proxy) return void 0; - if (ProxyAgent == null) { - const [api, Dispatcher, _ProxyAgent] = await Promise.all([ - // @ts-expect-error internal module is untyped - Promise.resolve().then(() => __toESM(require_api())), - // @ts-expect-error internal module is untyped - Promise.resolve().then(() => __toESM(require_dispatcher())), - // @ts-expect-error internal module is untyped - Promise.resolve().then(() => __toESM(require_proxy_agent())) - ]); - Object.assign(Dispatcher.default.prototype, api.default); - ProxyAgent = _ProxyAgent.default; - } - return new ProxyAgent(proxy); -} // sources/nodeUtils.ts var import_os2 = __toESM(require("os")); @@ -22611,6 +13394,7 @@ function satisfiesWithPrereleases(version2, range, loose = false) { } // sources/specUtils.ts +var import_clipanion4 = __toESM(require_advanced()); var import_fs5 = __toESM(require("fs")); var import_path4 = __toESM(require("path")); var import_satisfies = __toESM(require_satisfies()); @@ -22640,14 +13424,14 @@ function isSupportedPackageManager(value) { var nodeModulesRegExp = /[\\/]node_modules[\\/](@[^\\/]*[\\/])?([^@\\/][^\\/]*)$/; function parseSpec(raw2, source, { enforceExactVersion = true } = {}) { if (typeof raw2 !== `string`) - throw new UsageError(`Invalid package manager specification in ${source}; expected a string`); + throw new import_clipanion4.UsageError(`Invalid package manager specification in ${source}; expected a string`); const atIndex = raw2.indexOf(`@`); if (atIndex === -1 || atIndex === raw2.length - 1) { if (enforceExactVersion) - throw new UsageError(`No version specified for ${raw2} in "packageManager" of ${source}`); + throw new import_clipanion4.UsageError(`No version specified for ${raw2} in "packageManager" of ${source}`); const name3 = atIndex === -1 ? raw2 : raw2.slice(0, -1); if (!isSupportedPackageManager(name3)) - throw new UsageError(`Unsupported package manager specification (${name3})`); + throw new import_clipanion4.UsageError(`Unsupported package manager specification (${name3})`); return { name: name3, range: `*` @@ -22658,12 +13442,12 @@ function parseSpec(raw2, source, { enforceExactVersion = true } = {}) { const isURL = URL.canParse(range); if (!isURL) { if (enforceExactVersion && !(0, import_valid.default)(range)) - throw new UsageError(`Invalid package manager specification in ${source} (${raw2}); expected a semver version${enforceExactVersion ? `` : `, range, or tag`}`); + throw new import_clipanion4.UsageError(`Invalid package manager specification in ${source} (${raw2}); expected a semver version${enforceExactVersion ? `` : `, range, or tag`}`); if (!isSupportedPackageManager(name2)) { - throw new UsageError(`Unsupported package manager specification (${raw2})`); + throw new import_clipanion4.UsageError(`Unsupported package manager specification (${raw2})`); } } else if (isSupportedPackageManager(name2) && process.env.COREPACK_ENABLE_UNSAFE_CUSTOM_URLS !== `1`) { - throw new UsageError(`Illegal use of URL for known package manager. Instead, select a specific version, or set COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 in your environment (${raw2})`); + throw new import_clipanion4.UsageError(`Illegal use of URL for known package manager. Instead, select a specific version, or set COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 in your environment (${raw2})`); } return { name: name2, @@ -22676,7 +13460,7 @@ function warnOrThrow(errorMessage, onFail) { break; case `error`: case void 0: - throw new UsageError(errorMessage); + throw new import_clipanion4.UsageError(errorMessage); default: console.warn(`! Corepack validation warning: ${errorMessage}`); } @@ -22757,7 +13541,7 @@ async function loadSpec(initialCwd) { } catch { } if (typeof data !== `object` || data === null) - throw new UsageError(`Invalid package.json in ${import_path4.default.relative(initialCwd, manifestPath)}`); + throw new import_clipanion4.UsageError(`Invalid package.json in ${import_path4.default.relative(initialCwd, manifestPath)}`); let localEnv; const envFilePath2 = import_path4.default.resolve(currCwd, process.env.COREPACK_ENV_FILE ?? `.corepack.env`); if (process.env.COREPACK_ENV_FILE == `0`) { @@ -22902,7 +13686,7 @@ var Engine = class { } const definition = this.config.definitions[locator.name]; if (typeof definition === `undefined`) - throw new UsageError(`This package manager (${locator.name}) isn't supported by this corepack build`); + throw new import_clipanion5.UsageError(`This package manager (${locator.name}) isn't supported by this corepack build`); const ranges = Object.keys(definition.ranges).reverse(); const range = ranges.find((range2) => satisfiesWithPrereleases(locator.reference, range2)); if (typeof range === `undefined`) @@ -22928,7 +13712,7 @@ var Engine = class { async getDefaultVersion(packageManager) { const definition = this.config.definitions[packageManager]; if (typeof definition === `undefined`) - throw new UsageError(`This package manager (${packageManager}) isn't supported by this corepack build`); + throw new import_clipanion5.UsageError(`This package manager (${packageManager}) isn't supported by this corepack build`); const lastKnownGood = await getLastKnownGood(); const lastKnownGoodForThisPackageManager = getLastKnownGoodFromFileContent(lastKnownGood, packageManager); if (lastKnownGoodForThisPackageManager) { @@ -23012,7 +13796,7 @@ var Engine = class { if (import_process3.default.env.COREPACK_ENABLE_AUTO_PIN === `1`) { const resolved = await this.resolveDescriptor(fallbackDescriptor, { allowTags: true }); if (resolved === null) - throw new UsageError(`Failed to successfully resolve '${fallbackDescriptor.range}' to a valid ${fallbackDescriptor.name} release`); + throw new import_clipanion5.UsageError(`Failed to successfully resolve '${fallbackDescriptor.range}' to a valid ${fallbackDescriptor.name} release`); const installSpec = await this.ensurePackageManager(resolved); console.error(`! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing ${installSpec.locator.name}@${installSpec.locator.reference}.`); console.error(`! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager`); @@ -23031,7 +13815,7 @@ var Engine = class { log(`Falling back to ${fallbackDescriptor.name}@${fallbackDescriptor.range} in a ${spec.name}@${spec.range} project`); return fallbackDescriptor; } else { - throw new UsageError(`This project is configured to use ${spec.name} because ${result.target} has a "packageManager" field`); + throw new import_clipanion5.UsageError(`This project is configured to use ${spec.name} because ${result.target} has a "packageManager" field`); } } else { log(`Using ${spec.name}@${spec.range} as defined in project manifest ${result.target}`); @@ -23067,14 +13851,14 @@ var Engine = class { descriptor.range = binaryVersion; const resolved = await this.resolveDescriptor(descriptor, { allowTags: true }); if (resolved === null) - throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + throw new import_clipanion5.UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); const installSpec = await this.ensurePackageManager(resolved); return await runVersion(resolved, installSpec, binaryName, args); } async resolveDescriptor(descriptor, { allowTags = false, useCache = true } = {}) { if (!isSupportedPackageManagerDescriptor(descriptor)) { if (import_process3.default.env.COREPACK_ENABLE_UNSAFE_CUSTOM_URLS !== `1` && isSupportedPackageManager(descriptor.name)) - throw new UsageError(`Illegal use of URL for known package manager. Instead, select a specific version, or set COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 in your environment (${descriptor.name}@${descriptor.range})`); + throw new import_clipanion5.UsageError(`Illegal use of URL for known package manager. Instead, select a specific version, or set COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 in your environment (${descriptor.name}@${descriptor.range})`); return { name: descriptor.name, reference: descriptor.range @@ -23082,18 +13866,18 @@ var Engine = class { } const definition = this.config.definitions[descriptor.name]; if (typeof definition === `undefined`) - throw new UsageError(`This package manager (${descriptor.name}) isn't supported by this corepack build`); + throw new import_clipanion5.UsageError(`This package manager (${descriptor.name}) isn't supported by this corepack build`); let finalDescriptor = descriptor; if (!(0, import_valid3.default)(descriptor.range) && !(0, import_valid4.default)(descriptor.range)) { if (!allowTags) - throw new UsageError(`Packages managers can't be referenced via tags in this context`); + throw new import_clipanion5.UsageError(`Packages managers can't be referenced via tags in this context`); const ranges = Object.keys(definition.ranges); const tagRange = ranges[ranges.length - 1]; const packageManagerSpec = definition.ranges[tagRange]; const registry = getRegistryFromPackageManagerSpec(packageManagerSpec); const tags = await fetchAvailableTags2(registry); if (!Object.hasOwn(tags, descriptor.range)) - throw new UsageError(`Tag not found (${descriptor.range})`); + throw new import_clipanion5.UsageError(`Tag not found (${descriptor.range})`); finalDescriptor = { name: descriptor.name, range: tags[descriptor.range] @@ -23118,13 +13902,14 @@ var Engine = class { }; // sources/commands/Cache.ts +var import_clipanion6 = __toESM(require_advanced()); var import_fs7 = __toESM(require("fs")); -var CacheCommand = class extends Command { +var CacheCommand = class extends import_clipanion6.Command { static paths = [ [`cache`, `clean`], [`cache`, `clear`] ]; - static usage = Command.Usage({ + static usage = import_clipanion6.Command.Usage({ description: `Cleans Corepack cache`, details: ` Removes Corepack cache directory from your local disk. @@ -23136,14 +13921,15 @@ var CacheCommand = class extends Command { }; // sources/commands/Disable.ts +var import_clipanion7 = __toESM(require_advanced()); var import_fs8 = __toESM(require("fs")); var import_path6 = __toESM(require("path")); var import_which = __toESM(require_lib()); -var DisableCommand = class extends Command { +var DisableCommand = class extends import_clipanion7.Command { static paths = [ [`disable`] ]; - static usage = Command.Usage({ + static usage = import_clipanion7.Command.Usage({ description: `Remove the Corepack shims from the install directory`, details: ` When run, this command will remove the shims for the specified package managers from the install directory, or all shims if no parameters are passed. @@ -23161,10 +13947,10 @@ var DisableCommand = class extends Command { `$0 disable yarn` ]] }); - installDirectory = options_exports.String(`--install-directory`, { + installDirectory = import_clipanion7.Option.String(`--install-directory`, { description: `Where the shims are located` }); - names = options_exports.Rest(); + names = import_clipanion7.Option.Rest(); async execute() { let installDirectory = this.installDirectory; if (typeof installDirectory === `undefined`) @@ -23173,7 +13959,7 @@ var DisableCommand = class extends Command { const allBinNames = []; for (const name2 of new Set(names)) { if (!isSupportedPackageManager(name2)) - throw new UsageError(`Invalid package manager name '${name2}'`); + throw new import_clipanion7.UsageError(`Invalid package manager name '${name2}'`); const binNames = this.context.engine.getBinariesFor(name2); allBinNames.push(...binNames); } @@ -23210,14 +13996,15 @@ var DisableCommand = class extends Command { // sources/commands/Enable.ts var import_cmd_shim = __toESM(require_cmd_shim()); +var import_clipanion8 = __toESM(require_advanced()); var import_fs9 = __toESM(require("fs")); var import_path7 = __toESM(require("path")); var import_which2 = __toESM(require_lib()); -var EnableCommand = class extends Command { +var EnableCommand = class extends import_clipanion8.Command { static paths = [ [`enable`] ]; - static usage = Command.Usage({ + static usage = import_clipanion8.Command.Usage({ description: `Add the Corepack shims to the install directory`, details: ` When run, this command will check whether the shims for the specified package managers can be found with the correct values inside the install directory. If not, or if they don't exist, they will be created. @@ -23235,10 +14022,10 @@ var EnableCommand = class extends Command { `$0 enable yarn` ]] }); - installDirectory = options_exports.String(`--install-directory`, { + installDirectory = import_clipanion8.Option.String(`--install-directory`, { description: `Where the shims are to be installed` }); - names = options_exports.Rest(); + names = import_clipanion8.Option.Rest(); async execute() { let installDirectory = this.installDirectory; if (typeof installDirectory === `undefined`) @@ -23252,7 +14039,7 @@ var EnableCommand = class extends Command { const allBinNames = []; for (const name2 of new Set(names)) { if (!isSupportedPackageManager(name2)) - throw new UsageError(`Invalid package manager name '${name2}'`); + throw new import_clipanion8.UsageError(`Invalid package manager name '${name2}'`); const binNames = this.context.engine.getBinariesFor(name2); allBinNames.push(...binNames); } @@ -23287,20 +14074,22 @@ var EnableCommand = class extends Command { }; // sources/commands/InstallGlobal.ts +var import_clipanion10 = __toESM(require_advanced()); var import_fs10 = __toESM(require("fs")); var import_path8 = __toESM(require("path")); // sources/commands/Base.ts -var BaseCommand = class extends Command { +var import_clipanion9 = __toESM(require_advanced()); +var BaseCommand = class extends import_clipanion9.Command { async resolvePatternsToDescriptors({ patterns }) { const resolvedSpecs = patterns.map((pattern) => parseSpec(pattern, `CLI arguments`, { enforceExactVersion: false })); if (resolvedSpecs.length === 0) { const lookup = await loadSpec(this.context.cwd); switch (lookup.type) { case `NoProject`: - throw new UsageError(`Couldn't find a project in the local directory - please specify the package manager to pack, or run this command from a valid project`); + throw new import_clipanion9.UsageError(`Couldn't find a project in the local directory - please specify the package manager to pack, or run this command from a valid project`); case `NoSpec`: - throw new UsageError(`The local project doesn't feature a 'packageManager' field nor a 'devEngines.packageManager' field - please specify the package manager to pack, or update the manifest to reference it`); + throw new import_clipanion9.UsageError(`The local project doesn't feature a 'packageManager' field nor a 'devEngines.packageManager' field - please specify the package manager to pack, or update the manifest to reference it`); default: { return [lookup.range ?? lookup.getSpec()]; } @@ -23328,7 +14117,7 @@ var InstallGlobalCommand = class extends BaseCommand { static paths = [ [`install`] ]; - static usage = Command.Usage({ + static usage = import_clipanion10.Command.Usage({ description: `Install package managers on the system`, details: ` Download the selected package managers and install them on the system. @@ -23343,16 +14132,16 @@ var InstallGlobalCommand = class extends BaseCommand { `corepack install -g pnpm` ]] }); - global = options_exports.Boolean(`-g,--global`, { + global = import_clipanion10.Option.Boolean(`-g,--global`, { required: true }); - cacheOnly = options_exports.Boolean(`--cache-only`, false, { + cacheOnly = import_clipanion10.Option.Boolean(`--cache-only`, false, { description: `If true, the package managers will only be cached, not set as new defaults` }); - args = options_exports.Rest(); + args = import_clipanion10.Option.Rest(); async execute() { if (this.args.length === 0) - throw new UsageError(`No package managers specified`); + throw new import_clipanion10.UsageError(`No package managers specified`); await Promise.all(this.args.map((arg) => { if (arg.endsWith(`.tgz`)) { return this.installFromTarball(import_path8.default.resolve(this.context.cwd, arg)); @@ -23373,7 +14162,7 @@ var InstallGlobalCommand = class extends BaseCommand { async installFromDescriptor(descriptor) { const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true, useCache: false }); if (resolved === null) - throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + throw new import_clipanion10.UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); this.log(resolved); await this.context.engine.ensurePackageManager(resolved); if (!this.cacheOnly) { @@ -23399,12 +14188,12 @@ var InstallGlobalCommand = class extends BaseCommand { } } }); if (hasShortEntries || archiveEntries.size < 1) - throw new UsageError(`Invalid archive format; did it get generated by 'corepack pack'?`); + throw new import_clipanion10.UsageError(`Invalid archive format; did it get generated by 'corepack pack'?`); const { extract: tarX } = await Promise.resolve().then(() => (init_extract(), extract_exports)); for (const [name2, references] of archiveEntries) { for (const reference of references) { if (!isSupportedPackageManager(name2)) - throw new UsageError(`Unsupported package manager '${name2}'`); + throw new import_clipanion10.UsageError(`Unsupported package manager '${name2}'`); this.log({ name: name2, reference }); await import_fs10.default.promises.mkdir(installFolder, { recursive: true }); await tarX({ file: p, cwd: installFolder }, [`${name2}/${reference}`]); @@ -23417,11 +14206,12 @@ var InstallGlobalCommand = class extends BaseCommand { }; // sources/commands/InstallLocal.ts +var import_clipanion11 = __toESM(require_advanced()); var InstallLocalCommand = class extends BaseCommand { static paths = [ [`install`] ]; - static usage = Command.Usage({ + static usage = import_clipanion11.Command.Usage({ description: `Install the package manager configured in the local project`, details: ` Download and install the package manager configured in the local project. This command doesn't change the global version used when running the package manager from outside the project (use the \`-g,--global\` flag if you wish to do this). @@ -23437,7 +14227,7 @@ var InstallLocalCommand = class extends BaseCommand { }); const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true }); if (resolved === null) - throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + throw new import_clipanion11.UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); this.context.stdout.write(`Adding ${resolved.name}@${resolved.reference} to the cache... `); await this.context.engine.ensurePackageManager(resolved); @@ -23445,13 +14235,14 @@ var InstallLocalCommand = class extends BaseCommand { }; // sources/commands/Pack.ts +var import_clipanion12 = __toESM(require_advanced()); var import_promises3 = require("fs/promises"); var import_path11 = __toESM(require("path")); var PackCommand = class extends BaseCommand { static paths = [ [`pack`] ]; - static usage = Command.Usage({ + static usage = import_clipanion12.Command.Usage({ description: `Store package managers in a tarball`, details: ` Download the selected package managers and store them inside a tarball suitable for use with \`corepack install -g\`. @@ -23464,13 +14255,13 @@ var PackCommand = class extends BaseCommand { `corepack pack yarn@^1` ]] }); - json = options_exports.Boolean(`--json`, false, { + json = import_clipanion12.Option.Boolean(`--json`, false, { description: `If true, the path to the generated tarball will be printed on stdout` }); - output = options_exports.String(`-o,--output`, { + output = import_clipanion12.Option.String(`-o,--output`, { description: `Where the tarball should be generated; by default "corepack.tgz"` }); - patterns = options_exports.Rest(); + patterns = import_clipanion12.Option.Rest(); async execute() { const descriptors = await this.resolvePatternsToDescriptors({ patterns: this.patterns @@ -23479,7 +14270,7 @@ var PackCommand = class extends BaseCommand { for (const descriptor of descriptors) { const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true, useCache: false }); if (resolved === null) - throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + throw new import_clipanion12.UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); this.context.stdout.write(`Adding ${resolved.name}@${resolved.reference} to the cache... `); const packageManagerInfo = await this.context.engine.ensurePackageManager(resolved); @@ -23510,6 +14301,7 @@ var PackCommand = class extends BaseCommand { }; // sources/commands/Up.ts +var import_clipanion13 = __toESM(require_advanced()); var import_major = __toESM(require_major()); var import_valid5 = __toESM(require_valid()); var import_valid6 = __toESM(require_valid2()); @@ -23517,7 +14309,7 @@ var UpCommand = class extends BaseCommand { static paths = [ [`up`] ]; - static usage = Command.Usage({ + static usage = import_clipanion13.Command.Usage({ description: `Update the package manager used in the current project`, details: ` Retrieve the latest available version for the current major release line @@ -23539,15 +14331,15 @@ var UpCommand = class extends BaseCommand { patterns: [] }); if (!(0, import_valid5.default)(descriptor.range) && !(0, import_valid6.default)(descriptor.range)) - throw new UsageError(`The 'corepack up' command can only be used when your project's packageManager field is set to a semver version or semver range`); + throw new import_clipanion13.UsageError(`The 'corepack up' command can only be used when your project's packageManager field is set to a semver version or semver range`); const resolved = await this.context.engine.resolveDescriptor(descriptor, { useCache: false }); if (!resolved) - throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + throw new import_clipanion13.UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); const majorVersion = (0, import_major.default)(resolved.reference); const majorDescriptor = { name: descriptor.name, range: `^${majorVersion}.0.0` }; const highestVersion = await this.context.engine.resolveDescriptor(majorDescriptor, { useCache: false }); if (!highestVersion) - throw new UsageError(`Failed to find the highest release for ${descriptor.name} ${majorVersion}.x`); + throw new import_clipanion13.UsageError(`Failed to find the highest release for ${descriptor.name} ${majorVersion}.x`); this.context.stdout.write(`Installing ${highestVersion.name}@${highestVersion.reference} in the project... `); const packageManagerInfo = await this.context.engine.ensurePackageManager(highestVersion); @@ -23556,11 +14348,12 @@ var UpCommand = class extends BaseCommand { }; // sources/commands/Use.ts +var import_clipanion14 = __toESM(require_advanced()); var UseCommand = class extends BaseCommand { static paths = [ [`use`] ]; - static usage = Command.Usage({ + static usage = import_clipanion14.Command.Usage({ description: `Define the package manager to use for the current project`, details: ` When run, this command will retrieve the latest release matching the @@ -23572,14 +14365,14 @@ var UseCommand = class extends BaseCommand { `corepack use yarn` ]] }); - pattern = options_exports.String(); + pattern = import_clipanion14.Option.String(); async execute() { const [descriptor] = await this.resolvePatternsToDescriptors({ patterns: [this.pattern] }); const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true, useCache: false }); if (resolved === null) - throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + throw new import_clipanion14.UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); this.context.stdout.write(`Installing ${resolved.name}@${resolved.reference} in the project... `); const packageManagerInfo = await this.context.engine.ensurePackageManager(resolved); @@ -23588,16 +14381,17 @@ var UseCommand = class extends BaseCommand { }; // sources/commands/deprecated/Hydrate.ts +var import_clipanion15 = __toESM(require_advanced()); var import_promises4 = require("fs/promises"); var import_path12 = __toESM(require("path")); -var HydrateCommand = class extends Command { +var HydrateCommand = class extends import_clipanion15.Command { static paths = [ [`hydrate`] ]; - activate = options_exports.Boolean(`--activate`, false, { + activate = import_clipanion15.Option.Boolean(`--activate`, false, { description: `If true, this release will become the default one for this package manager` }); - fileName = options_exports.String(); + fileName = import_clipanion15.Option.String(); async execute() { const installFolder = getInstallFolder(); const fileName = import_path12.default.resolve(this.context.cwd, this.fileName); @@ -23616,12 +14410,12 @@ var HydrateCommand = class extends Command { } } }); if (hasShortEntries || archiveEntries.size < 1) - throw new UsageError(`Invalid archive format; did it get generated by 'corepack prepare'?`); + throw new import_clipanion15.UsageError(`Invalid archive format; did it get generated by 'corepack prepare'?`); const { extract: tarX } = await Promise.resolve().then(() => (init_extract(), extract_exports)); for (const [name2, references] of archiveEntries) { for (const reference of references) { if (!isSupportedPackageManager(name2)) - throw new UsageError(`Unsupported package manager '${name2}'`); + throw new import_clipanion15.UsageError(`Unsupported package manager '${name2}'`); if (this.activate) this.context.stdout.write(`Hydrating ${name2}@${reference} for immediate activation... `); @@ -23641,23 +14435,24 @@ var HydrateCommand = class extends Command { }; // sources/commands/deprecated/Prepare.ts +var import_clipanion16 = __toESM(require_advanced()); var import_promises5 = require("fs/promises"); var import_path13 = __toESM(require("path")); -var PrepareCommand = class extends Command { +var PrepareCommand = class extends import_clipanion16.Command { static paths = [ [`prepare`] ]; - activate = options_exports.Boolean(`--activate`, false, { + activate = import_clipanion16.Option.Boolean(`--activate`, false, { description: `If true, this release will become the default one for this package manager` }); - json = options_exports.Boolean(`--json`, false, { + json = import_clipanion16.Option.Boolean(`--json`, false, { description: `If true, the output will be the path of the generated tarball` }); - output = options_exports.String(`-o,--output`, { + output = import_clipanion16.Option.String(`-o,--output`, { description: `If true, the installed package managers will also be stored in a tarball`, tolerateBoolean: true }); - specs = options_exports.Rest(); + specs = import_clipanion16.Option.Rest(); async execute() { const specs = this.specs; const installLocations = []; @@ -23665,9 +14460,9 @@ var PrepareCommand = class extends Command { const lookup = await loadSpec(this.context.cwd); switch (lookup.type) { case `NoProject`: - throw new UsageError(`Couldn't find a project in the local directory - please specify the package manager to pack, or run this command from a valid project`); + throw new import_clipanion16.UsageError(`Couldn't find a project in the local directory - please specify the package manager to pack, or run this command from a valid project`); case `NoSpec`: - throw new UsageError(`The local project doesn't feature a 'packageManager' field - please specify the package manager to pack, or update the manifest to reference it`); + throw new import_clipanion16.UsageError(`The local project doesn't feature a 'packageManager' field - please specify the package manager to pack, or update the manifest to reference it`); default: { specs.push(lookup.getSpec()); } @@ -23677,7 +14472,7 @@ var PrepareCommand = class extends Command { const spec = typeof request === `string` ? parseSpec(request, `CLI arguments`, { enforceExactVersion: false }) : request; const resolved = await this.context.engine.resolveDescriptor(spec, { allowTags: true }); if (resolved === null) - throw new UsageError(`Failed to successfully resolve '${spec.range}' to a valid ${spec.name} release`); + throw new import_clipanion16.UsageError(`Failed to successfully resolve '${spec.range}' to a valid ${spec.name} release`); if (!this.json) { if (this.activate) { this.context.stdout.write(`Preparing ${spec.name}@${spec.range} for immediate activation... @@ -23740,13 +14535,13 @@ async function runMain(argv) { const [firstArg, ...restArgs] = argv; const request = getPackageManagerRequestFromCli(firstArg, engine); if (!request) { - const cli = new Cli({ + const cli = new import_clipanion17.Cli({ binaryLabel: `Corepack`, binaryName: `corepack`, binaryVersion: version }); - cli.register(builtins_exports.HelpCommand); - cli.register(builtins_exports.VersionCommand); + cli.register(import_clipanion17.Builtins.HelpCommand); + cli.register(import_clipanion17.Builtins.VersionCommand); cli.register(CacheCommand); cli.register(DisableCommand); cli.register(EnableCommand); @@ -23758,7 +14553,7 @@ async function runMain(argv) { cli.register(HydrateCommand); cli.register(PrepareCommand); const context = { - ...Cli.defaultContext, + ...import_clipanion17.Cli.defaultContext, cwd: process.cwd(), engine }; @@ -23787,9 +14582,6 @@ async function runMain(argv) { }); /*! Bundled license information: -undici/lib/web/fetch/body.js: - (*! formdata-polyfill. MIT License. Jimmy Wärting *) - is-windows/index.js: (*! * is-windows diff --git a/deps/corepack/package.json b/deps/corepack/package.json index d800198cb7df0f..279475fb9cec6e 100644 --- a/deps/corepack/package.json +++ b/deps/corepack/package.json @@ -1,6 +1,6 @@ { "name": "corepack", - "version": "0.34.7", + "version": "0.35.0", "homepage": "https://github.com/nodejs/corepack#readme", "bugs": { "url": "https://github.com/nodejs/corepack/issues" @@ -10,44 +10,43 @@ "url": "https://github.com/nodejs/corepack.git" }, "engines": { - "node": "^20.10.0 || ^22.11.0 || >=24.0.0" + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" }, "exports": { "./package.json": "./package.json" }, "license": "MIT", - "packageManager": "yarn@4.11.0+sha224.209a3e277c6bbc03df6e4206fbfcb0c1621c27ecf0688f79a0c619f0", + "packageManager": "yarn@4.14.1+sha224.88b7a7244bbd9040380c417f7eb556d85c67640b651f113cb4c72113", "devDependencies": { "@types/debug": "^4.1.5", - "@types/node": "^20.4.6", + "@types/node": "^22.0.0", "@types/proxy-from-env": "^1", "@types/semver": "^7.1.0", "@types/which": "^3.0.0", "@yarnpkg/eslint-config": "^3.0.0", "@yarnpkg/fslib": "^3.0.0-rc.48", "@zkochan/cmd-shim": "^6.0.0", - "better-sqlite3": "^11.7.2", "clipanion": "patch:clipanion@npm%3A3.2.1#~/.yarn/patches/clipanion-npm-3.2.1-fc9187f56c.patch", "debug": "^4.1.1", - "esbuild": "^0.27.0", + "esbuild": "^0.28.0", "eslint": "^9.22.0", - "proxy-from-env": "^1.1.0", "semver": "^7.6.3", "supports-color": "^10.0.0", "tar": "^7.5.11", "tsx": "^4.16.2", "typescript": "^5.7.3", - "undici": "^6.24.0", "v8-compile-cache": "^2.3.0", - "vitest": "^3.0.5", - "which": "^5.0.0" + "vitest": "^4.0.5", + "which": "^7.0.0" }, - "resolutions": { - "undici-types": "6.x" + "dependenciesMeta": { + "esbuild": { + "built": true + } }, "scripts": { "build": "run clean && run build:bundle && tsx ./mkshims.ts", - "build:bundle": "esbuild ./sources/_lib.ts --bundle --platform=node --target=node18.17.0 --external:corepack --outfile='./dist/lib/corepack.cjs' --resolve-extensions='.ts,.mjs,.js'", + "build:bundle": "esbuild ./sources/_lib.ts --bundle --platform=node --target=node22.22.2 --external:corepack --outfile='./dist/lib/corepack.cjs' --resolve-extensions='.ts,.mjs,.js'", "clean": "run rimraf dist shims", "corepack": "tsx ./sources/_cli.ts", "lint": "eslint .", diff --git a/deps/libffi/generate-headers.py b/deps/libffi/generate-headers.py index 30a460bb27869c..d1b024450caba1 100644 --- a/deps/libffi/generate-headers.py +++ b/deps/libffi/generate-headers.py @@ -10,33 +10,63 @@ LIBFFI_VERSION = '3.5.2' LIBFFI_VERSION_NUMBER = '30502' -TARGETS = { - ('freebsd', 'arm'): ('ARM', 'arm'), - ('freebsd', 'arm64'): ('AARCH64', 'aarch64'), - ('freebsd', 'x64'): ('X86_64', 'x86'), - ('linux', 'arm'): ('ARM', 'arm'), - ('linux', 'arm64'): ('AARCH64', 'aarch64'), - ('linux', 'x64'): ('X86_64', 'x86'), - ('mac', 'arm64'): ('AARCH64', 'aarch64'), - ('mac', 'x64'): ('X86_64', 'x86'), - ('win', 'arm'): ('ARM_WIN32', 'arm'), - ('win', 'arm64'): ('ARM_WIN64', 'aarch64'), - ('win', 'x64'): ('X86_WIN64', 'x86'), -} +def normalize_arch(target_arch): + aliases = { + 'x86': 'ia32', + 'x86_64': 'x64', + 'arm64': 'arm64', + 'aarch64': 'arm64', + } + return aliases.get(target_arch, target_arch) def get_target(os_name, target_arch): - try: - return TARGETS[(os_name, target_arch)] - except KeyError as exc: - supported = ', '.join( - f'{os_name}/{arch}' for os_name, arch in sorted(TARGETS)) - raise ValueError( - f'Unsupported libffi target {os_name}/{target_arch}. ' - f'Supported targets: {supported}.') from exc + target_arch = normalize_arch(target_arch) + + if target_arch == 'arm': + return ('ARM_WIN32' if os_name == 'win' else 'ARM', 'arm') + + if target_arch == 'arm64': + return ('ARM_WIN64' if os_name == 'win' else 'AARCH64', 'aarch64') + + if target_arch == 'ia32': + if os_name in ('freebsd', 'openbsd'): + return ('X86_FREEBSD', 'x86') + if os_name in ('ios', 'mac'): + return ('X86_DARWIN', 'x86') + if os_name == 'win': + return ('X86_WIN32', 'x86') + return ('X86', 'x86') + + if target_arch == 'x64': + return ('X86_WIN64' if os_name == 'win' else 'X86_64', 'x86') + + if target_arch == 'riscv64': + return ('RISCV', 'riscv') + + if target_arch == 'loong64': + return ('LOONGARCH64', 'loongarch64') + + if target_arch in ('mips', 'mipsel', 'mips64el'): + if os_name in ('freebsd', 'linux', 'openbsd'): + return ('MIPS', 'mips') + + if target_arch == 'ppc64': + if os_name == 'aix': + return ('POWERPC_AIX', 'powerpc') + if os_name == 'mac': + return ('POWERPC_DARWIN', 'powerpc') + if os_name in ('freebsd', 'openbsd'): + return ('POWERPC_FREEBSD', 'powerpc') + if os_name == 'linux': + return ('POWERPC', 'powerpc') + + raise ValueError(f'Unsupported libffi target {os_name}/{target_arch}.') def has_long_double(os_name, target_arch): + target_arch = normalize_arch(target_arch) + if os_name == 'win': return '0' @@ -50,6 +80,7 @@ def has_long_double(os_name, target_arch): def uses_exec_trampoline_table(os_name, target_arch): + target_arch = normalize_arch(target_arch) return os_name == 'mac' and target_arch in ('arm', 'arm64') @@ -72,6 +103,7 @@ def render_ffi_header(base_dir, os_name, target_arch, target): def render_fficonfig(os_name, target_arch): + target_arch = normalize_arch(target_arch) lines = [ '/* Auto-generated by generate-headers.py. */', '#ifndef LIBFFI_FFICONFIG_H_', @@ -94,15 +126,15 @@ def render_fficonfig(os_name, target_arch): '#define EH_FRAME_FLAGS "a"', ]) - if target_arch in ('x64', 'x86') and os_name != 'win': + if target_arch in ('ia32', 'x64') and os_name != 'win': lines.append('#define HAVE_AS_X86_PCREL 1') if uses_exec_trampoline_table(os_name, target_arch): lines.append('#define FFI_EXEC_TRAMPOLINE_TABLE 1') - elif os_name in ('freebsd', 'mac'): + elif os_name in ('freebsd', 'mac', 'openbsd'): lines.append('#define FFI_MMAP_EXEC_WRIT 1') - if os_name == 'linux': + if os_name != 'win': lines.extend([ '#define HAVE_DLFCN_H 1', '#define HAVE_MMAP 1', @@ -111,15 +143,10 @@ def render_fficonfig(os_name, target_arch): '#define HAVE_SYS_MMAN_H 1', '#define HAVE_UNISTD_H 1', ]) - elif os_name in ('freebsd', 'mac'): + + if os_name in ('freebsd', 'ios', 'mac', 'openbsd'): lines.extend([ - '#define HAVE_DLFCN_H 1', - '#define HAVE_MMAP 1', - '#define HAVE_MMAP_ANON 1', '#define HAVE_MMAP_DEV_ZERO 1', - '#define HAVE_MMAP_FILE 1', - '#define HAVE_SYS_MMAN_H 1', - '#define HAVE_UNISTD_H 1', ]) if os_name == 'mac' and target_arch == 'arm64': @@ -204,12 +231,19 @@ def detect_target_arch(): 'x86_64': 'x64', 'x64': 'x64', 'win32': 'x64', - 'i386': 'x86', - 'i686': 'x86', - 'x86': 'x86', + 'i386': 'ia32', + 'i686': 'ia32', + 'ia32': 'ia32', + 'x86': 'ia32', 'arm64': 'arm64', 'aarch64': 'arm64', 'arm': 'arm', + 'riscv64': 'riscv64', + 'loong64': 'loong64', + 'ppc64': 'ppc64', + 'mips': 'mips', + 'mipsel': 'mipsel', + 'mips64el': 'mips64el', } for candidate in candidates: diff --git a/deps/libffi/libffi.gyp b/deps/libffi/libffi.gyp index cc83695f45b6ab..e02e959c19a001 100644 --- a/deps/libffi/libffi.gyp +++ b/deps/libffi/libffi.gyp @@ -15,7 +15,14 @@ 'conditions': [ ['OS == "win"', { 'conditions': [ - ['target_arch == "x64"', { + ['target_arch == "ia32" or target_arch == "x86"', { + 'variables': { + 'libffi_arch_sources': [ + 'src/x86/ffi.c', + ], + }, + }], + ['target_arch == "x64" or target_arch == "x86_64"', { 'variables': { 'libffi_arch_sources': [ 'src/x86/ffiw64.c', @@ -26,7 +33,6 @@ 'variables': { 'libffi_arch_sources': [ 'src/arm/ffi.c', - 'src/arm/sysv_msvc_arm32.S', ], }, }], @@ -39,9 +45,17 @@ }], ], }], - ['OS == "linux" or OS == "freebsd"', { + ['OS != "win"', { 'conditions': [ - ['target_arch == "x64"', { + ['target_arch == "ia32" or target_arch == "x86"', { + 'variables': { + 'libffi_arch_sources': [ + 'src/x86/ffi.c', + 'src/x86/sysv.S', + ], + }, + }], + ['target_arch == "x64" or target_arch == "x86_64"', { 'variables': { 'libffi_arch_sources': [ 'src/x86/ffiw64.c', @@ -67,25 +81,69 @@ ], }, }], - ], - }], - ['OS == "mac"', { - 'conditions': [ - ['target_arch == "x64"', { + ['target_arch == "riscv64"', { 'variables': { 'libffi_arch_sources': [ - 'src/x86/ffiw64.c', - 'src/x86/ffi64.c', - 'src/x86/unix64.S', - 'src/x86/win64.S', + 'src/riscv/ffi.c', + 'src/riscv/sysv.S', ], }, }], - ['target_arch == "arm64"', { + ['target_arch == "loong64"', { 'variables': { 'libffi_arch_sources': [ - 'src/aarch64/ffi.c', - 'src/aarch64/sysv.S', + 'src/loongarch64/ffi.c', + 'src/loongarch64/sysv.S', + ], + }, + }], + ['target_arch == "mips" or target_arch == "mipsel" or target_arch == "mips64el"', { + 'variables': { + 'libffi_arch_sources': [ + 'src/mips/ffi.c', + 'src/mips/o32.S', + 'src/mips/n32.S', + ], + }, + }], + ['target_arch == "ppc64" and OS == "mac"', { + 'variables': { + 'libffi_arch_sources': [ + 'src/powerpc/ffi_darwin.c', + 'src/powerpc/darwin.S', + 'src/powerpc/darwin_closure.S', + ], + }, + }], + ['target_arch == "ppc64" and OS == "aix"', { + 'variables': { + 'libffi_arch_sources': [ + 'src/powerpc/ffi_darwin.c', + 'src/powerpc/aix.S', + 'src/powerpc/aix_closure.S', + ], + }, + }], + ['target_arch == "ppc64" and (OS == "freebsd" or OS == "openbsd")', { + 'variables': { + 'libffi_arch_sources': [ + 'src/powerpc/ffi.c', + 'src/powerpc/ffi_sysv.c', + 'src/powerpc/sysv.S', + 'src/powerpc/ppc_closure.S', + ], + }, + }], + ['target_arch == "ppc64" and OS == "linux"', { + 'variables': { + 'libffi_arch_sources': [ + 'src/powerpc/ffi.c', + 'src/powerpc/ffi_sysv.c', + 'src/powerpc/ffi_linux64.c', + 'src/powerpc/sysv.S', + 'src/powerpc/ppc_closure.S', + 'src/powerpc/linux64.S', + 'src/powerpc/linux64_closure.S', ], }, }], @@ -107,6 +165,7 @@ ], 'include_dirs': [ 'include', + 'src', '<(SHARED_INTERMEDIATE_DIR)/libffi', ], 'sources': [ @@ -121,6 +180,10 @@ 'include/ffi.h.in', 'src/aarch64/ffitarget.h', 'src/arm/ffitarget.h', + 'src/loongarch64/ffitarget.h', + 'src/mips/ffitarget.h', + 'src/powerpc/ffitarget.h', + 'src/riscv/ffitarget.h', 'src/x86/ffitarget.h', ], 'outputs': [ @@ -141,7 +204,7 @@ }, ], 'conditions': [ - ['OS == "win" and target_arch == "x64"', { + ['OS == "win" and (target_arch == "x64" or target_arch == "x86_64")', { 'actions': [ { 'action_name': 'preprocess_win64_intel_asm', @@ -176,6 +239,75 @@ }, ], }], + ['OS == "win" and (target_arch == "ia32" or target_arch == "x86")', { + 'actions': [ + { + 'action_name': 'preprocess_win32_intel_asm', + 'process_outputs_as_sources': 1, + 'inputs': [ + 'preprocess_asm.py', + 'include/ffi_cfi.h', + 'src/x86/asmnames.h', + 'src/x86/sysv_intel.S', + '<(SHARED_INTERMEDIATE_DIR)/libffi/ffi.h', + '<(SHARED_INTERMEDIATE_DIR)/libffi/fficonfig.h', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/sysv_intel.asm', + ], + 'action': [ + '<(python)', + 'preprocess_asm.py', + '--input', + 'src/x86/sysv_intel.S', + '--output', + '<@(_outputs)', + '--include-dir', + 'include', + '--include-dir', + 'src/x86', + '--include-dir', + '<(SHARED_INTERMEDIATE_DIR)/libffi', + '--define', + 'FFI_STATIC_BUILD', + ], + }, + ], + }], + ['OS == "win" and target_arch == "arm"', { + 'actions': [ + { + 'action_name': 'preprocess_win32_arm_asm', + 'process_outputs_as_sources': 1, + 'inputs': [ + 'preprocess_asm.py', + 'include/ffi_cfi.h', + 'src/arm/sysv_msvc_arm32.S', + '<(SHARED_INTERMEDIATE_DIR)/libffi/ffi.h', + '<(SHARED_INTERMEDIATE_DIR)/libffi/fficonfig.h', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/sysv_msvc_arm32.asm', + ], + 'action': [ + '<(python)', + 'preprocess_asm.py', + '--input', + 'src/arm/sysv_msvc_arm32.S', + '--output', + '<@(_outputs)', + '--include-dir', + 'include', + '--include-dir', + 'src/arm', + '--include-dir', + '<(SHARED_INTERMEDIATE_DIR)/libffi', + '--define', + 'FFI_STATIC_BUILD', + ], + }, + ], + }], ['OS == "win" and target_arch == "arm64"', { # Link the prebuilt object file directly 'libraries': [ diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc index b7a0c96ee2ea60..38378b730aca66 100644 --- a/deps/ncrypto/ncrypto.cc +++ b/deps/ncrypto/ncrypto.cc @@ -7,6 +7,11 @@ #include #include #include +#if NCRYPTO_USE_BORINGSSL_EVP_DO_ALL_FALLBACK +#include +#include +#include +#endif #include #include #include @@ -15,7 +20,7 @@ #include #include #include -#if OPENSSL_VERSION_NUMBER >= 0x30200000L +#if OPENSSL_WITH_ARGON2 #include #endif #endif @@ -29,9 +34,13 @@ constexpr static PQCMapping pqc_mappings[] = { {"ML-DSA-44", EVP_PKEY_ML_DSA_44}, {"ML-DSA-65", EVP_PKEY_ML_DSA_65}, {"ML-DSA-87", EVP_PKEY_ML_DSA_87}, - {"ML-KEM-512", EVP_PKEY_ML_KEM_512}, {"ML-KEM-768", EVP_PKEY_ML_KEM_768}, {"ML-KEM-1024", EVP_PKEY_ML_KEM_1024}, + +#if OPENSSL_WITH_PQC_ML_KEM_512 + {"ML-KEM-512", EVP_PKEY_ML_KEM_512}, +#endif +#if OPENSSL_WITH_PQC_SLH_DSA {"SLH-DSA-SHA2-128f", EVP_PKEY_SLH_DSA_SHA2_128F}, {"SLH-DSA-SHA2-128s", EVP_PKEY_SLH_DSA_SHA2_128S}, {"SLH-DSA-SHA2-192f", EVP_PKEY_SLH_DSA_SHA2_192F}, @@ -44,6 +53,7 @@ constexpr static PQCMapping pqc_mappings[] = { {"SLH-DSA-SHAKE-192s", EVP_PKEY_SLH_DSA_SHAKE_192S}, {"SLH-DSA-SHAKE-256f", EVP_PKEY_SLH_DSA_SHAKE_256F}, {"SLH-DSA-SHAKE-256s", EVP_PKEY_SLH_DSA_SHAKE_256S}, +#endif }; #endif @@ -67,6 +77,28 @@ using NetscapeSPKIPointer = DeleteFnPtr; static constexpr int kX509NameFlagsRFC2253WithinUtf8JSON = XN_FLAG_RFC2253 & ~ASN1_STRFLGS_ESC_MSB & ~ASN1_STRFLGS_ESC_CTRL; + +#if NCRYPTO_USE_BORINGSSL_EVP_DO_ALL_FALLBACK +struct BoringSSLCipher { + const EVP_CIPHER* (*get)(); + const char* name; +}; + +constexpr BoringSSLCipher kBoringSSLCiphers[] = { + {EVP_aes_128_cbc, "aes-128-cbc"}, {EVP_aes_128_ctr, "aes-128-ctr"}, + {EVP_aes_128_ecb, "aes-128-ecb"}, {EVP_aes_128_gcm, "aes-128-gcm"}, + {EVP_aes_128_ofb, "aes-128-ofb"}, {EVP_aes_192_cbc, "aes-192-cbc"}, + {EVP_aes_192_ctr, "aes-192-ctr"}, {EVP_aes_192_ecb, "aes-192-ecb"}, + {EVP_aes_192_gcm, "aes-192-gcm"}, {EVP_aes_192_ofb, "aes-192-ofb"}, + {EVP_aes_256_cbc, "aes-256-cbc"}, {EVP_aes_256_ctr, "aes-256-ctr"}, + {EVP_aes_256_ecb, "aes-256-ecb"}, {EVP_aes_256_gcm, "aes-256-gcm"}, + {EVP_aes_256_ofb, "aes-256-ofb"}, {EVP_des_cbc, "des-cbc"}, + {EVP_des_ecb, "des-ecb"}, {EVP_des_ede, "des-ede"}, + {EVP_des_ede3_cbc, "des-ede3-cbc"}, {EVP_des_ede_cbc, "des-ede-cbc"}, + {EVP_rc2_cbc, "rc2-cbc"}, {EVP_rc4, "rc4"}, +}; + +#endif } // namespace // ============================================================================ @@ -1928,8 +1960,7 @@ DataPointer pbkdf2(const Digest& md, return {}; } -#if OPENSSL_VERSION_NUMBER >= 0x30200000L -#ifndef OPENSSL_NO_ARGON2 +#if OPENSSL_WITH_ARGON2 DataPointer argon2(const Buffer& pass, const Buffer& salt, uint32_t lanes, @@ -2022,7 +2053,6 @@ DataPointer argon2(const Buffer& pass, return {}; } #endif -#endif // ============================================================================ @@ -2070,27 +2100,99 @@ EVPKeyPointer EVPKeyPointer::NewRawPrivate( } #if OPENSSL_WITH_PQC -EVPKeyPointer EVPKeyPointer::NewRawSeed( - int id, const Buffer& data) { - if (id == 0) return {}; +namespace { +constexpr size_t kPqcMlDsaSeedSize = 32; +constexpr size_t kPqcMlKemSeedSize = 64; + +size_t GetPqcSeedSize(int id) { + switch (id) { + case EVP_PKEY_ML_DSA_44: + case EVP_PKEY_ML_DSA_65: + case EVP_PKEY_ML_DSA_87: + return kPqcMlDsaSeedSize; +#if OPENSSL_WITH_PQC_ML_KEM_512 + case EVP_PKEY_ML_KEM_512: +#endif + case EVP_PKEY_ML_KEM_768: + case EVP_PKEY_ML_KEM_1024: + return kPqcMlKemSeedSize; + default: + unreachable(); + } +} +#if OPENSSL_WITH_BORINGSSL_PQC +const EVP_PKEY_ALG* GetPqcSeedAlg(int id) { + switch (id) { + case EVP_PKEY_ML_DSA_44: + return EVP_pkey_ml_dsa_44(); + case EVP_PKEY_ML_DSA_65: + return EVP_pkey_ml_dsa_65(); + case EVP_PKEY_ML_DSA_87: + return EVP_pkey_ml_dsa_87(); + case EVP_PKEY_ML_KEM_768: + return EVP_pkey_ml_kem_768(); + case EVP_PKEY_ML_KEM_1024: + return EVP_pkey_ml_kem_1024(); + default: + unreachable(); + } +} +#else +const char* GetPqcSeedParamName(int id) { + switch (id) { + case EVP_PKEY_ML_DSA_44: + case EVP_PKEY_ML_DSA_65: + case EVP_PKEY_ML_DSA_87: + return OSSL_PKEY_PARAM_ML_DSA_SEED; + case EVP_PKEY_ML_KEM_512: + case EVP_PKEY_ML_KEM_768: + case EVP_PKEY_ML_KEM_1024: + return OSSL_PKEY_PARAM_ML_KEM_SEED; + default: + unreachable(); + } +} +#endif + +EVPKeyPointer NewPqcKeyFromSeed(int id, + const Buffer& data) { +#if OPENSSL_WITH_BORINGSSL_PQC + return EVPKeyPointer( + EVP_PKEY_from_private_seed(GetPqcSeedAlg(id), data.data, data.len)); +#else OSSL_PARAM params[] = { - OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_ML_DSA_SEED, + OSSL_PARAM_construct_octet_string(GetPqcSeedParamName(id), const_cast(data.data), data.len), OSSL_PARAM_END}; - EVP_PKEY_CTX* ctx = EVP_PKEY_CTX_new_id(id, nullptr); - if (ctx == nullptr) return {}; + auto ctx = EVPKeyCtxPointer::NewFromID(id); + if (!ctx) return {}; EVP_PKEY* pkey = nullptr; - if (ctx == nullptr || EVP_PKEY_fromdata_init(ctx) <= 0 || - EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEYPAIR, params) <= 0) { - EVP_PKEY_CTX_free(ctx); + if (EVP_PKEY_fromdata_init(ctx.get()) <= 0 || + EVP_PKEY_fromdata(ctx.get(), &pkey, EVP_PKEY_KEYPAIR, params) <= 0) { return {}; } - return EVPKeyPointer(pkey); +#endif +} + +bool GetPqcSeed(EVP_PKEY* pkey, int id, const Buffer& out) { + size_t len = out.len; +#if OPENSSL_WITH_BORINGSSL_PQC + return EVP_PKEY_get_private_seed(pkey, out.data, &len) == 1; +#else + return EVP_PKEY_get_octet_string_param( + pkey, GetPqcSeedParamName(id), out.data, out.len, &len) == 1; +#endif +} +} // namespace + +EVPKeyPointer EVPKeyPointer::NewRawSeed( + int id, const Buffer& data) { + return NewPqcKeyFromSeed(id, data); } #endif @@ -2140,7 +2242,7 @@ EVP_PKEY* EVPKeyPointer::release() { int EVPKeyPointer::id(const EVP_PKEY* key) { if (key == nullptr) return 0; int type = EVP_PKEY_id(key); -#if OPENSSL_WITH_PQC +#if OPENSSL_WITH_OPENSSL_PQC // EVP_PKEY_id returns -1 when EVP_PKEY_* is only implemented in a provider // which is the case for all post-quantum NIST algorithms // one suggested way would be to use a chain of `EVP_PKEY_is_a` @@ -2218,34 +2320,11 @@ DataPointer EVPKeyPointer::rawPublicKey() const { DataPointer EVPKeyPointer::rawSeed() const { if (!pkey_) return {}; - // Determine seed length and parameter name based on key type - size_t seed_len; - const char* param_name; - - switch (id()) { - case EVP_PKEY_ML_DSA_44: - case EVP_PKEY_ML_DSA_65: - case EVP_PKEY_ML_DSA_87: - seed_len = 32; // ML-DSA uses 32-byte seeds - param_name = OSSL_PKEY_PARAM_ML_DSA_SEED; - break; - case EVP_PKEY_ML_KEM_512: - case EVP_PKEY_ML_KEM_768: - case EVP_PKEY_ML_KEM_1024: - seed_len = 64; // ML-KEM uses 64-byte seeds - param_name = OSSL_PKEY_PARAM_ML_KEM_SEED; - break; - default: - unreachable(); - } + const size_t seed_len = GetPqcSeedSize(id()); if (auto data = DataPointer::Alloc(seed_len)) { const Buffer buf = data; - size_t len = data.size(); - - if (EVP_PKEY_get_octet_string_param( - get(), param_name, buf.data, len, &seed_len) != 1) - return {}; + if (!GetPqcSeed(get(), id(), buf)) return {}; return data; } return {}; @@ -2287,6 +2366,7 @@ EVPKeyPointer::operator const EC_KEY*() const { } namespace { + EVPKeyPointer::ParseKeyResult TryParsePublicKeyInner(const BIOPointer& bp, const char* name, auto&& parse) { @@ -2714,6 +2794,7 @@ bool EVPKeyPointer::isOneShotVariant() const { case EVP_PKEY_ML_DSA_44: case EVP_PKEY_ML_DSA_65: case EVP_PKEY_ML_DSA_87: +#if OPENSSL_WITH_PQC_SLH_DSA case EVP_PKEY_SLH_DSA_SHA2_128F: case EVP_PKEY_SLH_DSA_SHA2_128S: case EVP_PKEY_SLH_DSA_SHA2_192F: @@ -2726,6 +2807,7 @@ bool EVPKeyPointer::isOneShotVariant() const { case EVP_PKEY_SLH_DSA_SHAKE_192S: case EVP_PKEY_SLH_DSA_SHAKE_256F: case EVP_PKEY_SLH_DSA_SHAKE_256S: +#endif #endif return true; default: @@ -4209,6 +4291,12 @@ void Cipher::ForEach(Cipher::CipherNameCallback callback) { CipherCallbackContext context; context.cb = std::move(callback); +#if NCRYPTO_USE_BORINGSSL_EVP_DO_ALL_FALLBACK + for (const auto& cipher : kBoringSSLCiphers) { + static_cast(cipher.get); + context.cb(cipher.name); + } +#else EVP_CIPHER_do_all_sorted( #if OPENSSL_VERSION_MAJOR >= 3 array_push_back, #endif &context); +#endif } // ============================================================================ @@ -4369,7 +4458,17 @@ std::optional EVPMDCtxPointer::signInitWithContext( const EVPKeyPointer& key, const Digest& digest, const Buffer& context_string) { -#ifdef OSSL_SIGNATURE_PARAM_CONTEXT_STRING +#ifdef OPENSSL_IS_BORINGSSL + EVP_PKEY_CTX* ctx = nullptr; + if (!EVP_DigestSignInit(ctx_.get(), &ctx, digest, nullptr, key.get())) { + return std::nullopt; + } + if (EVP_PKEY_CTX_set1_signature_context_string( + ctx, context_string.data, context_string.len) <= 0) { + return std::nullopt; + } + return ctx; +#elif defined(OSSL_SIGNATURE_PARAM_CONTEXT_STRING) EVP_PKEY_CTX* ctx = nullptr; #ifdef OSSL_SIGNATURE_PARAM_INSTANCE @@ -4414,7 +4513,17 @@ std::optional EVPMDCtxPointer::verifyInitWithContext( const EVPKeyPointer& key, const Digest& digest, const Buffer& context_string) { -#ifdef OSSL_SIGNATURE_PARAM_CONTEXT_STRING +#ifdef OPENSSL_IS_BORINGSSL + EVP_PKEY_CTX* ctx = nullptr; + if (!EVP_DigestVerifyInit(ctx_.get(), &ctx, digest, nullptr, key.get())) { + return std::nullopt; + } + if (EVP_PKEY_CTX_set1_signature_context_string( + ctx, context_string.data, context_string.len) <= 0) { + return std::nullopt; + } + return ctx; +#elif defined(OSSL_SIGNATURE_PARAM_CONTEXT_STRING) EVP_PKEY_CTX* ctx = nullptr; #ifdef OSSL_SIGNATURE_PARAM_INSTANCE @@ -4580,7 +4689,7 @@ HMACCtxPointer HMACCtxPointer::New() { return HMACCtxPointer(HMAC_CTX_new()); } -#if OPENSSL_VERSION_MAJOR >= 3 +#if OPENSSL_WITH_KMAC EVPMacPointer::EVPMacPointer(EVP_MAC* mac) : mac_(mac) {} EVPMacPointer::EVPMacPointer(EVPMacPointer&& other) noexcept @@ -4668,7 +4777,7 @@ EVPMacCtxPointer EVPMacCtxPointer::New(EVP_MAC* mac) { if (!mac) return EVPMacCtxPointer(); return EVPMacCtxPointer(EVP_MAC_CTX_new(mac)); } -#endif // OPENSSL_VERSION_MAJOR >= 3 +#endif // OPENSSL_WITH_KMAC DataPointer hashDigest(const Buffer& buf, const EVP_MD* md) { @@ -4815,8 +4924,8 @@ const Digest Digest::FromName(const char* name) { // ============================================================================ // KEM Implementation -#if OPENSSL_VERSION_MAJOR >= 3 -#if !OPENSSL_VERSION_PREREQ(3, 5) +#if OPENSSL_WITH_KEM +#if OPENSSL_WITH_KEM_OPERATION_PARAM bool KEM::SetOperationParameter(EVP_PKEY_CTX* ctx, const EVPKeyPointer& key) { const char* operation = nullptr; @@ -4824,7 +4933,7 @@ bool KEM::SetOperationParameter(EVP_PKEY_CTX* ctx, const EVPKeyPointer& key) { case EVP_PKEY_RSA: operation = OSSL_KEM_PARAM_OPERATION_RSASVE; break; -#if OPENSSL_VERSION_PREREQ(3, 2) +#if OPENSSL_WITH_OPENSSL_DHKEM case EVP_PKEY_EC: case EVP_PKEY_X25519: case EVP_PKEY_X448: @@ -4861,7 +4970,7 @@ std::optional KEM::Encapsulate( return std::nullopt; } -#if !OPENSSL_VERSION_PREREQ(3, 5) +#if OPENSSL_WITH_KEM_OPERATION_PARAM if (!SetOperationParameter(ctx.get(), public_key)) { return std::nullopt; } @@ -4902,7 +5011,7 @@ DataPointer KEM::Decapsulate(const EVPKeyPointer& private_key, return {}; } -#if !OPENSSL_VERSION_PREREQ(3, 5) +#if OPENSSL_WITH_KEM_OPERATION_PARAM if (!SetOperationParameter(ctx.get(), private_key)) { return {}; } @@ -4932,6 +5041,6 @@ DataPointer KEM::Decapsulate(const EVPKeyPointer& private_key, return shared_key; } -#endif // OPENSSL_VERSION_MAJOR >= 3 +#endif // OPENSSL_WITH_KEM } // namespace ncrypto diff --git a/deps/ncrypto/ncrypto.gyp b/deps/ncrypto/ncrypto.gyp index cf9b7c6cdb6d2c..1747f3ea0149b9 100644 --- a/deps/ncrypto/ncrypto.gyp +++ b/deps/ncrypto/ncrypto.gyp @@ -1,5 +1,6 @@ { 'variables': { + 'ncrypto_bssl_libdecrepit_missing%': 1, 'ncrypto_sources': [ 'engine.cc', 'ncrypto.cc', @@ -11,8 +12,14 @@ 'target_name': 'ncrypto', 'type': 'static_library', 'include_dirs': ['.'], + 'defines': [ + 'NCRYPTO_BSSL_LIBDECREPIT_MISSING=<(ncrypto_bssl_libdecrepit_missing)', + ], 'direct_dependent_settings': { 'include_dirs': ['.'], + 'defines': [ + 'NCRYPTO_BSSL_LIBDECREPIT_MISSING=<(ncrypto_bssl_libdecrepit_missing)', + ], }, 'sources': [ '<@(ncrypto_sources)' ], 'conditions': [ diff --git a/deps/ncrypto/ncrypto.h b/deps/ncrypto/ncrypto.h index 1f116169f57a27..b27e2e76c3dcfc 100644 --- a/deps/ncrypto/ncrypto.h +++ b/deps/ncrypto/ncrypto.h @@ -22,22 +22,103 @@ #ifndef OPENSSL_NO_ENGINE #include #endif // !OPENSSL_NO_ENGINE + +#ifndef OPENSSL_VERSION_PREREQ +#define OPENSSL_VERSION_PREREQ(maj, min) \ + (OPENSSL_VERSION_NUMBER >= (((maj) << 28) | ((min) << 20))) +#endif + +// BoringSSL declares the EVP_*_do_all* APIs, but their implementation may +// live in libdecrepit. This matches standalone ncrypto's build flag. +#ifndef NCRYPTO_BSSL_LIBDECREPIT_MISSING +#define NCRYPTO_BSSL_LIBDECREPIT_MISSING 0 +#endif + +#if defined(OPENSSL_IS_BORINGSSL) && NCRYPTO_BSSL_LIBDECREPIT_MISSING +#define NCRYPTO_USE_BORINGSSL_EVP_DO_ALL_FALLBACK 1 +#else +#define NCRYPTO_USE_BORINGSSL_EVP_DO_ALL_FALLBACK 0 +#endif + // The FIPS-related functions are only available // when the OpenSSL itself was compiled with FIPS support. -#if defined(OPENSSL_FIPS) && OPENSSL_VERSION_MAJOR < 3 +#if defined(OPENSSL_FIPS) && !OPENSSL_VERSION_PREREQ(3, 0) #include #endif // OPENSSL_FIPS -// Define OPENSSL_WITH_PQC for post-quantum cryptography support -#if OPENSSL_VERSION_NUMBER >= 0x30500000L -#define OPENSSL_WITH_PQC 1 +#if OPENSSL_VERSION_PREREQ(3, 0) +#define OPENSSL_WITH_AES_OCB 1 +#else +#define OPENSSL_WITH_AES_OCB 0 +#endif + +#if !defined(OPENSSL_NO_ARGON2) && OPENSSL_VERSION_PREREQ(3, 2) +#define OPENSSL_WITH_ARGON2 1 +#else +#define OPENSSL_WITH_ARGON2 0 +#endif + +#if OPENSSL_VERSION_PREREQ(3, 0) || defined(OPENSSL_IS_BORINGSSL) +#define OPENSSL_WITH_KEM 1 +#else +#define OPENSSL_WITH_KEM 0 +#endif + +#if OPENSSL_VERSION_PREREQ(3, 0) +#define OPENSSL_WITH_KMAC 1 +#else +#define OPENSSL_WITH_KMAC 0 +#endif + +#if defined(OPENSSL_IS_BORINGSSL) || OPENSSL_VERSION_PREREQ(3, 2) +#define OPENSSL_WITH_SIGNATURE_CONTEXT_STRING 1 +#else +#define OPENSSL_WITH_SIGNATURE_CONTEXT_STRING 0 +#endif + +#if !defined(OPENSSL_IS_BORINGSSL) && OPENSSL_VERSION_PREREQ(3, 2) +#define OPENSSL_WITH_OPENSSL_DHKEM 1 +#else +#define OPENSSL_WITH_OPENSSL_DHKEM 0 +#endif + +#if OPENSSL_WITH_KEM && !defined(OPENSSL_IS_BORINGSSL) && \ + !OPENSSL_VERSION_PREREQ(3, 5) +#define OPENSSL_WITH_KEM_OPERATION_PARAM 1 +#else +#define OPENSSL_WITH_KEM_OPERATION_PARAM 0 +#endif + +// Post-quantum cryptography support. Keep these explicit so code can +// distinguish provider API shape from the available algorithm set. +#if !defined(OPENSSL_IS_BORINGSSL) && OPENSSL_VERSION_PREREQ(3, 5) +#define OPENSSL_WITH_OPENSSL_PQC 1 +#else +#define OPENSSL_WITH_OPENSSL_PQC 0 +#endif + +#ifdef OPENSSL_IS_BORINGSSL +#define OPENSSL_WITH_BORINGSSL_PQC 1 +#else +#define OPENSSL_WITH_BORINGSSL_PQC 0 +#endif + +#define OPENSSL_WITH_PQC \ + (OPENSSL_WITH_OPENSSL_PQC || OPENSSL_WITH_BORINGSSL_PQC) +#define OPENSSL_WITH_PQC_ML_KEM_512 OPENSSL_WITH_OPENSSL_PQC +#define OPENSSL_WITH_PQC_SLH_DSA OPENSSL_WITH_OPENSSL_PQC + +#if OPENSSL_WITH_OPENSSL_PQC #define EVP_PKEY_ML_KEM_512 NID_ML_KEM_512 #define EVP_PKEY_ML_KEM_768 NID_ML_KEM_768 #define EVP_PKEY_ML_KEM_1024 NID_ML_KEM_1024 #include +#elif OPENSSL_WITH_BORINGSSL_PQC +#define EVP_PKEY_ML_KEM_768 NID_ML_KEM_768 +#define EVP_PKEY_ML_KEM_1024 NID_ML_KEM_1024 #endif -#if OPENSSL_VERSION_MAJOR >= 3 +#if OPENSSL_VERSION_PREREQ(3, 0) #define OSSL3_CONST const #else #define OSSL3_CONST @@ -1474,7 +1555,7 @@ class HMACCtxPointer final { DeleteFnPtr ctx_; }; -#if OPENSSL_VERSION_MAJOR >= 3 +#if OPENSSL_WITH_KMAC class EVPMacPointer final { public: EVPMacPointer() = default; @@ -1522,7 +1603,7 @@ class EVPMacCtxPointer final { private: DeleteFnPtr ctx_; }; -#endif // OPENSSL_VERSION_MAJOR >= 3 +#endif // OPENSSL_WITH_KMAC #ifndef OPENSSL_NO_ENGINE class EnginePointer final { @@ -1635,8 +1716,7 @@ DataPointer pbkdf2(const Digest& md, uint32_t iterations, size_t length); -#if OPENSSL_VERSION_NUMBER >= 0x30200000L -#ifndef OPENSSL_NO_ARGON2 +#if OPENSSL_WITH_ARGON2 enum class Argon2Type { ARGON2D, ARGON2I, ARGON2ID }; DataPointer argon2(const Buffer& pass, @@ -1650,11 +1730,10 @@ DataPointer argon2(const Buffer& pass, const Buffer& ad, Argon2Type type); #endif -#endif // ============================================================================ // KEM (Key Encapsulation Mechanism) -#if OPENSSL_VERSION_MAJOR >= 3 +#if OPENSSL_WITH_KEM class KEM final { public: @@ -1678,13 +1757,13 @@ class KEM final { const Buffer& ciphertext); private: -#if !OPENSSL_VERSION_PREREQ(3, 5) +#if OPENSSL_WITH_KEM_OPERATION_PARAM static bool SetOperationParameter(EVP_PKEY_CTX* ctx, const EVPKeyPointer& key); #endif }; -#endif // OPENSSL_VERSION_MAJOR >= 3 +#endif // OPENSSL_WITH_KEM // ============================================================================ // Version metadata diff --git a/deps/ngtcp2/ngtcp2.gyp b/deps/ngtcp2/ngtcp2.gyp index 74c8ce60456347..7ad8997b0005e3 100644 --- a/deps/ngtcp2/ngtcp2.gyp +++ b/deps/ngtcp2/ngtcp2.gyp @@ -206,6 +206,7 @@ 'defines': [ 'BUILDING_NGHTTP3', 'NGHTTP3_STATICLIB', + 'DEBUGBUILD', ], 'dependencies': [ 'ngtcp2' @@ -247,7 +248,10 @@ }, { 'target_name': 'ngtcp2_test_server', - 'type': 'executable', + # Disabled: ngtcp2 examples now require C++23 (, , + # std::println, std::expected) which is not yet supported on all + # Node.js platforms. Re-enable when C++23 is available. + 'type': 'none', 'cflags': [ '-Wno-everything' ], 'include_dirs': [ '', @@ -305,7 +309,10 @@ }, { 'target_name': 'ngtcp2_test_client', - 'type': 'executable', + # Disabled: ngtcp2 examples now require C++23 (, , + # std::println, std::expected) which is not yet supported on all + # Node.js platforms. Re-enable when C++23 is available. + 'type': 'none', 'cflags': [ '-Wno-everything' ], 'include_dirs': [ '', diff --git a/deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h b/deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h index 88e0107a55ac85..a1f09e7148bd84 100644 --- a/deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h +++ b/deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h @@ -36,7 +36,7 @@ * * Version number of the ngtcp2 library release. */ -#define NGTCP2_VERSION "1.22.0" +#define NGTCP2_VERSION "1.22.1" /** * @macro @@ -46,6 +46,6 @@ * number, 8 bits for minor and 8 bits for patch. Version 1.2.3 * becomes 0x010203. */ -#define NGTCP2_VERSION_NUM 0x011600 +#define NGTCP2_VERSION_NUM 0x011601 #endif /* !defined(NGTCP2_VERSION_H) */ diff --git a/deps/ngtcp2/ngtcp2/lib/ngtcp2_qlog.c b/deps/ngtcp2/ngtcp2/lib/ngtcp2_qlog.c index ed08eb1b5ac2b4..42609481ec4757 100644 --- a/deps/ngtcp2/ngtcp2/lib/ngtcp2_qlog.c +++ b/deps/ngtcp2/ngtcp2/lib/ngtcp2_qlog.c @@ -902,7 +902,7 @@ void ngtcp2_qlog_pkt_sent_end(ngtcp2_qlog *qlog, const ngtcp2_pkt_hd *hd, void ngtcp2_qlog_parameters_set_transport_params( ngtcp2_qlog *qlog, const ngtcp2_transport_params *params, int server, ngtcp2_qlog_side side) { - uint8_t buf[1024]; + uint8_t buf[2048]; uint8_t *p = buf; const ngtcp2_preferred_addr *paddr; const ngtcp2_sockaddr_in *sa_in; diff --git a/deps/simdjson/simdjson.cpp b/deps/simdjson/simdjson.cpp index cbcd9f1e6bc017..6fa9693596be0c 100644 --- a/deps/simdjson/simdjson.cpp +++ b/deps/simdjson/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2026-04-03 15:25:03 -0400. version 4.6.1 Do not edit! */ +/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */ /* including simdjson.cpp: */ /* begin file simdjson.cpp */ #define SIMDJSON_SRC_SIMDJSON_CPP diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h index 0a021531346106..b9befc5b17ed3c 100644 --- a/deps/simdjson/simdjson.h +++ b/deps/simdjson/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on 2026-04-03 15:25:03 -0400. version 4.6.1 Do not edit! */ +/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */ /* including simdjson.h: */ /* begin file simdjson.h */ #ifndef SIMDJSON_H @@ -2538,7 +2538,7 @@ namespace std { #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION "4.6.1" +#define SIMDJSON_VERSION "4.6.4" namespace simdjson { enum { @@ -2553,7 +2553,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 1 + SIMDJSON_VERSION_REVISION = 4 }; } // namespace simdjson @@ -39794,6 +39794,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for arm64 */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -40549,6 +40550,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -40557,6 +40563,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -41878,6 +41889,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for fallback */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -42633,6 +42645,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -42641,6 +42658,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -44449,6 +44471,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for haswell */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -45204,6 +45227,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -45212,6 +45240,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -47020,6 +47053,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for icelake */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -47775,6 +47809,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -47783,6 +47822,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -49706,6 +49750,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for ppc64 */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -50461,6 +50506,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -50469,6 +50519,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -52709,6 +52764,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for westmere */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -53464,6 +53520,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -53472,6 +53533,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -55186,6 +55252,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for lsx */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -55941,6 +56008,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -55949,6 +56021,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -57686,6 +57763,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for lasx */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -58441,6 +58519,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -58449,6 +58532,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -60190,6 +60278,7 @@ simdjson_warn_unused simdjson_result extract_fractured_json( /* begin file simdjson/generic/builder/json_string_builder-inl.h for rvv_vls */ #include #include +#include #include #ifndef SIMDJSON_GENERIC_STRING_BUILDER_INL_H @@ -60945,6 +61034,11 @@ simdjson_inline void string_builder::append(number_type v) noexcept { simdjson_inline void string_builder::escape_and_append(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the multiplication below. + if (input.size() > (std::numeric_limits::max)() / 6) { + set_valid(false); + return; + } if (capacity_check(6 * input.size())) { position += write_string_escaped(input, buffer.get() + position); } @@ -60953,6 +61047,11 @@ string_builder::escape_and_append(std::string_view input) noexcept { simdjson_inline void string_builder::escape_and_append_with_quotes(std::string_view input) noexcept { // escaping might turn a control character into \x00xx so 6 characters. + // Guard against size_t overflow in the arithmetic below. + if (input.size() > ((std::numeric_limits::max)() - 2) / 6) { + set_valid(false); + return; + } if (capacity_check(2 + 6 * input.size())) { buffer.get()[position++] = '"'; position += write_string_escaped(input, buffer.get() + position); @@ -63512,13 +63611,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -63711,9 +63818,23 @@ struct simdjson_result : public arm64::implementation_si simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + arm64::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -65052,8 +65173,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -65216,13 +65335,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -65346,7 +65473,13 @@ struct simdjson_result : public arm64::implementation_si simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -66246,21 +66379,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -66481,7 +66617,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -66567,7 +66709,13 @@ struct simdjson_result : public arm64::implementation simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -66652,7 +66800,13 @@ struct simdjson_result : public arm64::impl simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -67305,13 +67459,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -67461,7 +67623,13 @@ struct simdjson_result : public arm64::implementation_s simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -68475,46 +68643,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -68522,16 +68678,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -68594,9 +68747,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -69017,14 +69176,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -69288,12 +69453,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -69669,8 +69840,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -69678,9 +69855,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -70017,9 +70194,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -70130,7 +70313,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -70395,11 +70584,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -71977,9 +72172,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -71989,34 +72188,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -72147,9 +72334,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -72530,7 +72723,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -76788,13 +76981,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -76987,9 +77188,23 @@ struct simdjson_result : public fallback::implementat simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + fallback::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -78328,8 +78543,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -78492,13 +78705,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -78622,7 +78843,13 @@ struct simdjson_result : public fallback::implementat simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -79522,21 +79749,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -79757,7 +79987,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -79843,7 +80079,13 @@ struct simdjson_result : public fallback::implemen simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -79928,7 +80170,13 @@ struct simdjson_result : public fallback simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -80581,13 +80829,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -80737,7 +80993,13 @@ struct simdjson_result : public fallback::implementa simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -81751,46 +82013,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -81798,16 +82048,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -81870,9 +82117,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -82293,14 +82546,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -82564,12 +82823,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -82945,8 +83210,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -82954,9 +83225,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -83293,9 +83564,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -83406,7 +83683,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -83671,11 +83954,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -85253,9 +85542,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -85265,34 +85558,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -85423,9 +85704,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -85806,7 +86093,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -90551,13 +90838,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -90750,9 +91045,23 @@ struct simdjson_result : public haswell::implementatio simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + haswell::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -92091,8 +92400,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -92255,13 +92562,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -92385,7 +92700,13 @@ struct simdjson_result : public haswell::implementatio simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -93285,21 +93606,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -93520,7 +93844,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -93606,7 +93936,13 @@ struct simdjson_result : public haswell::implementa simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -93691,7 +94027,13 @@ struct simdjson_result : public haswell:: simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -94344,13 +94686,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -94500,7 +94850,13 @@ struct simdjson_result : public haswell::implementati simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -95514,46 +95870,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -95561,16 +95905,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -95633,9 +95974,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -96056,14 +96403,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -96327,12 +96680,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -96708,8 +97067,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -96717,9 +97082,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -97056,9 +97421,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -97169,7 +97540,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -97434,11 +97811,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -99016,9 +99399,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -99028,34 +99415,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -99186,9 +99561,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -99569,7 +99950,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -104314,13 +104695,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -104513,9 +104902,23 @@ struct simdjson_result : public icelake::implementatio simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + icelake::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -105854,8 +106257,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -106018,13 +106419,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -106148,7 +106557,13 @@ struct simdjson_result : public icelake::implementatio simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -107048,21 +107463,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -107283,7 +107701,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -107369,7 +107793,13 @@ struct simdjson_result : public icelake::implementa simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -107454,7 +107884,13 @@ struct simdjson_result : public icelake:: simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -108107,13 +108543,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -108263,7 +108707,13 @@ struct simdjson_result : public icelake::implementati simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -109277,46 +109727,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -109324,16 +109762,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -109396,9 +109831,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -109819,14 +110260,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -110090,12 +110537,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -110471,8 +110924,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -110480,9 +110939,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -110819,9 +111278,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -110932,7 +111397,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -111197,11 +111668,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -112779,9 +113256,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -112791,34 +113272,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -112949,9 +113418,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -113332,7 +113807,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -118192,13 +118667,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -118391,9 +118874,23 @@ struct simdjson_result : public ppc64::implementation_si simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + ppc64::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -119732,8 +120229,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -119896,13 +120391,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -120026,7 +120529,13 @@ struct simdjson_result : public ppc64::implementation_si simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -120926,21 +121435,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -121161,7 +121673,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -121247,7 +121765,13 @@ struct simdjson_result : public ppc64::implementation simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -121332,7 +121856,13 @@ struct simdjson_result : public ppc64::impl simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -121985,13 +122515,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -122141,7 +122679,13 @@ struct simdjson_result : public ppc64::implementation_s simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -123155,46 +123699,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -123202,16 +123734,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -123274,9 +123803,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -123697,14 +124232,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -123968,12 +124509,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -124349,8 +124896,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -124358,9 +124911,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -124697,9 +125250,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -124810,7 +125369,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -125075,11 +125640,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -126657,9 +127228,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -126669,34 +127244,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -126827,9 +127390,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -127210,7 +127779,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -132387,13 +132956,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -132586,9 +133163,23 @@ struct simdjson_result : public westmere::implementat simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + westmere::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -133927,8 +134518,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -134091,13 +134680,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -134221,7 +134818,13 @@ struct simdjson_result : public westmere::implementat simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -135121,21 +135724,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -135356,7 +135962,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -135442,7 +136054,13 @@ struct simdjson_result : public westmere::implemen simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -135527,7 +136145,13 @@ struct simdjson_result : public westmere simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -136180,13 +136804,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -136336,7 +136968,13 @@ struct simdjson_result : public westmere::implementa simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -137350,46 +137988,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -137397,16 +138023,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -137469,9 +138092,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -137892,14 +138521,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -138163,12 +138798,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -138544,8 +139185,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -138553,9 +139200,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -138892,9 +139539,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -139005,7 +139658,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -139270,11 +139929,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -140852,9 +141517,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -140864,34 +141533,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -141022,9 +141679,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -141405,7 +142068,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -146056,13 +146719,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -146255,9 +146926,23 @@ struct simdjson_result : public lsx::implementation_simdjs simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + lsx::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -147596,8 +148281,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -147760,13 +148443,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -147890,7 +148581,13 @@ struct simdjson_result : public lsx::implementation_simdjs simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -148790,21 +149487,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -149025,7 +149725,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -149111,7 +149817,13 @@ struct simdjson_result : public lsx::implementation_sim simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -149196,7 +149908,13 @@ struct simdjson_result : public lsx::implemen simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -149849,13 +150567,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -150005,7 +150731,13 @@ struct simdjson_result : public lsx::implementation_simdj simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -151019,46 +151751,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -151066,16 +151786,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -151138,9 +151855,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -151561,14 +152284,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -151832,12 +152561,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -152213,8 +152948,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -152222,9 +152963,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -152561,9 +153302,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -152674,7 +153421,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -152939,11 +153692,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -154521,9 +155280,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -154533,34 +155296,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -154691,9 +155442,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -155074,7 +155831,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -159748,13 +160505,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -159947,9 +160712,23 @@ struct simdjson_result : public lasx::implementation_simd simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + lasx::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -161288,8 +162067,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -161452,13 +162229,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -161582,7 +162367,13 @@ struct simdjson_result : public lasx::implementation_simd simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -162482,21 +163273,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -162717,7 +163511,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -162803,7 +163603,13 @@ struct simdjson_result : public lasx::implementation_s simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -162888,7 +163694,13 @@ struct simdjson_result : public lasx::implem simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -163541,13 +164353,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -163697,7 +164517,13 @@ struct simdjson_result : public lasx::implementation_sim simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -164711,46 +165537,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -164758,16 +165572,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -164830,9 +165641,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -165253,14 +166070,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -165524,12 +166347,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -165905,8 +166734,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -165914,9 +166749,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -166253,9 +167088,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -166366,7 +167207,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -166631,11 +167478,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -168213,9 +169066,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -168225,34 +169082,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -168383,9 +169228,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -168766,7 +169617,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); @@ -173444,13 +174295,21 @@ class value { simdjson_inline simdjson_result at_path(std::string_view at_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard character (*) for arrays or ".*" for objects. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; protected: /** @@ -173643,9 +174502,23 @@ struct simdjson_result : public rvv_vls::implementatio simdjson_inline simdjson_result current_depth() const noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; }; +// Forward-declare explicit specializations so MSVC /permissive- sees them before +// any template instantiation that would resolve element.get(val) to the primary. +template<> simdjson_inline error_code +simdjson_result::get( + rvv_vls::ondemand::value &out) noexcept; +template<> simdjson_inline simdjson_result +simdjson_result::get() noexcept; + } // namespace simdjson #endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H @@ -174984,8 +175857,6 @@ class parser { static simdjson_inline bool release_parser(); private: - friend bool release_parser(); - friend ondemand::parser& get_parser(); /** Get the thread-local parser instance, allocates it if needed */ static simdjson_inline simdjson_warn_unused std::unique_ptr& get_parser_instance(); /** Get the thread-local parser instance, it might be null */ @@ -175148,13 +176019,21 @@ class array { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like "[*]" to match all array elements. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the array and returns a string_view instance corresponding to the @@ -175278,7 +176157,13 @@ struct simdjson_result : public rvv_vls::implementatio simdjson_inline simdjson_result at(size_t index) noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; simdjson_inline simdjson_result raw_json() noexcept; #if SIMDJSON_SUPPORTS_CONCEPTS // TODO: move this code into object-inl.h @@ -176178,21 +177063,24 @@ class document { simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * * Supports wildcard patterns like "$.array[*]" or "$.object.*" to match multiple elements. * - * This method materializes all matching values into a vector. * The document will be consumed after this call. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern, or: - * - INVALID_JSON_POINTER if the JSONPath cannot be parsed - * - NO_SUCH_FIELD if a field does not exist - * - INDEX_OUT_OF_BOUNDS if an array index is out of bounds - * - INCORRECT_TYPE if path traversal encounters wrong type + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Consumes the document and returns a string_view instance corresponding to the @@ -176413,7 +177301,13 @@ class document_reference { simdjson_inline simdjson_result raw_json_token() noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; private: document *doc{nullptr}; @@ -176499,7 +177393,13 @@ struct simdjson_result : public rvv_vls::implementa simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -176584,7 +177484,13 @@ struct simdjson_result : public rvv_vls:: simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; #if SIMDJSON_STATIC_REFLECTION template requires(std::is_class_v && (sizeof...(FieldNames) > 0)) @@ -177237,13 +178143,21 @@ class object { inline simdjson_result at_path(std::string_view json_path) noexcept; /** - * Get all values matching the given JSONPath expression with wildcard support. + * Call the provided callback for each value matching the given JSONPath + * expression with wildcard support. * Supports wildcard patterns like ".*" to match all object fields. * * @param json_path JSONPath expression with wildcards - * @return Vector of values matching the wildcard pattern + * @param callback Function called for each matching value + * @return error_code indicating success or failure */ - inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; /** * Reset the iterator so that we are pointing back at the @@ -177393,7 +178307,13 @@ struct simdjson_result : public rvv_vls::implementati simdjson_inline simdjson_result operator[](std::string_view key) && noexcept; simdjson_inline simdjson_result at_pointer(std::string_view json_pointer) noexcept; simdjson_inline simdjson_result at_path(std::string_view json_path) noexcept; - simdjson_inline simdjson_result> at_path_with_wildcard(std::string_view json_path) noexcept; +#if SIMDJSON_SUPPORTS_CONCEPTS + template + requires std::invocable +#else + template +#endif + simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept; inline simdjson_result reset() noexcept; inline simdjson_result is_empty() noexcept; inline simdjson_result count_fields() & noexcept; @@ -178407,46 +179327,34 @@ inline simdjson_result array::at_path(std::string_view json_path) noexcep return at_pointer(json_pointer); } -inline simdjson_result> array::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code array::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; // Wildcard case - if(key=="*"){ - for(auto element: *this){ - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - // Use value_unsafe() because we've already checked for errors above. - // The 'element' is a simdjson_result wrapper, and we need to extract - // the underlying value. value_unsafe() is safe here because error() returned false. - result.push_back(std::move(element).value_unsafe()); - - }else{ - auto nested_result = element.at_path_with_wildcard(remaining_path); - - if(nested_result.error()){ - return nested_result.error(); - } - // Same logic as above. - std::vector nested_matches = std::move(nested_result).value_unsafe(); - - result.insert(result.end(), - std::make_move_iterator(nested_matches.begin()), - std::make_move_iterator(nested_matches.end())); + if (key=="*"){ + for(auto element: *this) { + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()) { + callback(val); + } else { + error_code err = element.for_each_at_path_with_wildcard(remaining_path, callback); + if(err) { return err; } } } - return result; - }else{ + return SUCCESS; + } else { // Specific index case in which we access the element at the given index - size_t idx=0; + size_t idx = 0; - for(char c:key){ + for (char c : key) { if(c < '0' || c > '9'){ return INVALID_JSON_POINTER; } @@ -178454,16 +179362,13 @@ inline simdjson_result> array::at_path_with_wildcard(std::str } auto element = at(idx); - - if(element.error()){ - return element.error(); - } - - if(remaining_path.empty()){ - result.push_back(std::move(element).value_unsafe()); - return result; - }else{ - return element.at_path_with_wildcard(remaining_path); + value val; + SIMDJSON_TRY(element.get(val)); + if (remaining_path.empty()){ + callback(val); + return SUCCESS; + } else { + return element.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -178526,9 +179431,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result simdjson_result::raw_json() noexcept { if (error()) { return error(); } @@ -178949,14 +179860,20 @@ simdjson_inline simdjson_result value::at_path(std::string_view json_path } } -inline simdjson_result> value::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code value::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { json_type t; SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -179220,12 +180137,18 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard( - std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code simdjson_result::for_each_at_path_with_wildcard( + std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } } // namespace simdjson @@ -179601,8 +180524,14 @@ simdjson_inline simdjson_result document::at_path(std::string_view json_p } } -simdjson_inline simdjson_result> document::at_path_with_wildcard(std::string_view json_path) noexcept { - rewind(); // Rewind the document each time at_path_with_wildcard is called +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { + rewind(); // Rewind the document each time for_each_at_path_with_wildcard is called if (json_path.empty()) { return INVALID_JSON_POINTER; } @@ -179610,9 +180539,9 @@ simdjson_inline simdjson_result> document::at_path_with_wildc SIMDJSON_TRY(type().get(t)); switch (t) { case json_type::array: - return (*this).get_array().at_path_with_wildcard(json_path); + return (*this).get_array().for_each_at_path_with_wildcard(json_path, std::forward(callback)); case json_type::object: - return (*this).get_object().at_path_with_wildcard(json_path); + return (*this).get_object().for_each_at_path_with_wildcard(json_path, std::forward(callback)); default: return INVALID_JSON_POINTER; } @@ -179949,9 +180878,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION @@ -180062,7 +180997,13 @@ simdjson_inline simdjson_result document_reference::get_number() noexcep simdjson_inline simdjson_result document_reference::raw_json_token() noexcept { return doc->raw_json_token(); } simdjson_inline simdjson_result document_reference::at_pointer(std::string_view json_pointer) noexcept { return doc->at_pointer(json_pointer); } simdjson_inline simdjson_result document_reference::at_path(std::string_view json_path) noexcept { return doc->at_path(json_path); } -simdjson_inline simdjson_result> document_reference::at_path_with_wildcard(std::string_view json_path) noexcept { return doc->at_path_with_wildcard(json_path); } +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code document_reference::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { return doc->for_each_at_path_with_wildcard(json_path, std::forward(callback)); } simdjson_inline simdjson_result document_reference::raw_json() noexcept { return doc->raw_json();} simdjson_inline document_reference::operator document&() const noexcept { return *doc; } #if SIMDJSON_SUPPORTS_CONCEPTS && SIMDJSON_STATIC_REFLECTION @@ -180327,11 +181268,17 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } #if SIMDJSON_STATIC_REFLECTION template @@ -181909,9 +182856,13 @@ inline simdjson_result object::at_path(std::string_view json_path) noexce return at_pointer(json_pointer); } -inline simdjson_result> object::at_path_with_wildcard(std::string_view json_path) noexcept { - std::vector result; - +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +inline error_code object::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { auto result_pair = get_next_key_and_json_path(json_path); std::string_view key = result_pair.first; std::string_view remaining_path = result_pair.second; @@ -181921,34 +182872,22 @@ inline simdjson_result> object::at_path_with_wildcard(std::st for (auto field : *this) { value val; SIMDJSON_TRY(field.value().get(val)); - if (remaining_path.empty()) { - result.push_back(std::move(val)); + callback(val); } else { - auto nested_result = val.at_path_with_wildcard(remaining_path); - - if (nested_result.error()) { - return nested_result.error(); - } - // Extract and append all nested matches to our result - std::vector nested_vec; - SIMDJSON_TRY(std::move(nested_result).get(nested_vec)); - - result.insert(result.end(), - std::make_move_iterator(nested_vec.begin()), - std::make_move_iterator(nested_vec.end())); + SIMDJSON_TRY(val.for_each_at_path_with_wildcard(remaining_path, callback)); } } - return result; + return SUCCESS; } else { value val; SIMDJSON_TRY(find_field(key).get(val)); if (remaining_path.empty()) { - result.push_back(std::move(val)); - return result; + callback(val); + return SUCCESS; } else { - return val.at_path_with_wildcard(remaining_path); + return val.for_each_at_path_with_wildcard(remaining_path, callback); } } } @@ -182079,9 +183018,15 @@ simdjson_inline simdjson_result simdjson_result> simdjson_result::at_path_with_wildcard(std::string_view json_path) noexcept { +#if SIMDJSON_SUPPORTS_CONCEPTS +template + requires std::invocable +#else +template +#endif +simdjson_inline error_code simdjson_result::for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept { if (error()) { return error(); } - return first.at_path_with_wildcard(json_path); + return first.for_each_at_path_with_wildcard(json_path, std::forward(callback)); } inline simdjson_result simdjson_result::reset() noexcept { @@ -182462,7 +183407,7 @@ simdjson_inline simdjson_warn_unused ondemand::parser& parser::get_parser() { return *parser::get_parser_instance(); } -simdjson_inline bool release_parser() { +simdjson_inline bool parser::release_parser() { auto &parser_instance = parser::get_threadlocal_parser_if_exists(); if (parser_instance) { parser_instance.reset(); diff --git a/deps/sqlite/sqlite3.c b/deps/sqlite/sqlite3.c index 91db04a9ecdc54..dfd557adeda581 100644 --- a/deps/sqlite/sqlite3.c +++ b/deps/sqlite/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.53.0. By combining all the individual C code files into this +** version 3.53.1. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** 4525003a53a7fc63ca75c59b22c79608659c with changes in files: +** c88b22011a54b4f6fbd149e9f8e4de77658c with changes in files: ** ** */ @@ -467,12 +467,12 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.53.0" -#define SQLITE_VERSION_NUMBER 3053000 -#define SQLITE_SOURCE_ID "2026-04-09 11:41:38 4525003a53a7fc63ca75c59b22c79608659ca12f0131f52c18637f829977f20b" -#define SQLITE_SCM_BRANCH "trunk" -#define SQLITE_SCM_TAGS "release major-release version-3.53.0" -#define SQLITE_SCM_DATETIME "2026-04-09T11:41:38.498Z" +#define SQLITE_VERSION "3.53.1" +#define SQLITE_VERSION_NUMBER 3053001 +#define SQLITE_SOURCE_ID "2026-05-05 10:34:17 c88b22011a54b4f6fbd149e9f8e4de77658ce58143a1af0e3785e4e6475127e9" +#define SQLITE_SCM_BRANCH "branch-3.53" +#define SQLITE_SCM_TAGS "release version-3.53.1" +#define SQLITE_SCM_DATETIME "2026-05-05T10:34:17.344Z" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -32513,7 +32513,7 @@ static char *printfTempBuf(sqlite3_str *pAccum, sqlite3_int64 n){ sqlite3StrAccumSetError(pAccum, SQLITE_TOOBIG); return 0; } - z = sqlite3DbMallocRaw(pAccum->db, n); + z = sqlite3_malloc(n); if( z==0 ){ sqlite3StrAccumSetError(pAccum, SQLITE_NOMEM); } @@ -32971,11 +32971,27 @@ SQLITE_API void sqlite3_str_vappendf( szBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+10; if( cThousand && e2>0 ) szBufNeeded += (e2+2)/3; - if( sqlite3StrAccumEnlargeIfNeeded(pAccum, szBufNeeded) ){ - width = length = 0; - break; + if( szBufNeeded + pAccum->nChar >= pAccum->nAlloc ){ + if( pAccum->mxAlloc==0 && pAccum->accError==0 ){ + /* Unable to allocate space in pAccum, perhaps because it + ** is coming from sqlite3_snprintf() or similar. We'll have + ** to render into temporary space and the memcpy() it over. */ + bufpt = sqlite3_malloc(szBufNeeded); + if( bufpt==0 ){ + sqlite3StrAccumSetError(pAccum, SQLITE_NOMEM); + return; + } + zExtra = bufpt; + }else if( sqlite3StrAccumEnlarge(pAccum, szBufNeeded)zText + pAccum->nChar; + } + }else{ + bufpt = pAccum->zText + pAccum->nChar; } - bufpt = zOut = pAccum->zText + pAccum->nChar; + zOut = bufpt; flag_dp = (precision>0 ?1:0) | flag_alternateform | flag_altform2; /* The sign in front of the number */ @@ -33076,14 +33092,22 @@ SQLITE_API void sqlite3_str_vappendf( } length = width; } - pAccum->nChar += length; - zOut[length] = 0; - /* Floating point conversions render directly into the output - ** buffer. Hence, don't just break out of the switch(). Bypass the - ** output buffer writing that occurs after the switch() by continuing - ** to the next character in the format string. */ - continue; + if( zExtra==0 ){ + /* The result is being rendered directory into pAccum. This + ** is the command and fast case */ + pAccum->nChar += length; + zOut[length] = 0; + continue; + }else{ + /* We were unable to render directly into pAccum because we + ** couldn't allocate sufficient memory. We need to memcpy() + ** the rendering (or some prefix thereof) into the output + ** buffer. */ + bufpt[0] = 0; + bufpt = zExtra; + break; + } } case etSIZE: if( !bArgList ){ @@ -33130,7 +33154,7 @@ SQLITE_API void sqlite3_str_vappendf( if( sqlite3StrAccumEnlargeIfNeeded(pAccum, nCopyBytes) ){ break; } - sqlite3_str_append(pAccum, + sqlite3_str_append(pAccum, &pAccum->zText[pAccum->nChar-nCopyBytes], nCopyBytes); precision -= nPrior; nPrior *= 2; @@ -33646,7 +33670,7 @@ SQLITE_API void sqlite3_str_reset(StrAccum *p){ ** of its content, all in one call. */ SQLITE_API void sqlite3_str_free(sqlite3_str *p){ - if( p ){ + if( p!=0 && p!=&sqlite3OomStr ){ sqlite3_str_reset(p); sqlite3_free(p); } @@ -36792,15 +36816,20 @@ SQLITE_PRIVATE u8 sqlite3StrIHash(const char *z){ return h; } +#if !defined(SQLITE_DISABLE_INTRINSIC) \ + && (defined(__GNUC__) || defined(__clang__)) \ + && (defined(__x86_64__) || defined(__aarch64__) || \ + (defined(__riscv) && defined(__riscv_xlen) && (__riscv_xlen>32))) +#define SQLITE_USE_UINT128 +#endif + /* ** Two inputs are multiplied to get a 128-bit result. Write the ** lower 64-bits of the result into *pLo, and return the high-order ** 64 bits. */ static u64 sqlite3Multiply128(u64 a, u64 b, u64 *pLo){ -#if (defined(__GNUC__) || defined(__clang__)) \ - && (defined(__x86_64__) || defined(__aarch64__) || defined(__riscv)) \ - && !defined(SQLITE_DISABLE_INTRINSIC) +#if defined(SQLITE_USE_UINT128) __uint128_t r = (__uint128_t)a * b; *pLo = (u64)r; return (u64)(r>>64); @@ -36834,9 +36863,7 @@ static u64 sqlite3Multiply128(u64 a, u64 b, u64 *pLo){ ** The lower 64 bits of A*B are discarded. */ static u64 sqlite3Multiply160(u64 a, u32 aLo, u64 b, u32 *pLo){ -#if (defined(__GNUC__) || defined(__clang__)) \ - && (defined(__x86_64__) || defined(__aarch64__) || defined(__riscv)) \ - && !defined(SQLITE_DISABLE_INTRINSIC) +#if defined(SQLITE_USE_UINT128) __uint128_t r = (__uint128_t)a * b; r += ((__uint128_t)aLo * b) >> 32; *pLo = (r>>32)&0xffffffff; @@ -36874,6 +36901,8 @@ static u64 sqlite3Multiply160(u64 a, u32 aLo, u64 b, u32 *pLo){ #endif } +#undef SQLITE_USE_UINT128 + /* ** Return a u64 with the N-th bit set. */ @@ -56108,10 +56137,10 @@ SQLITE_API int sqlite3_deserialize( if( rc ) goto end_deserialize; db->init.iDb = (u8)iDb; db->init.reopenMemdb = 1; - rc = sqlite3_step(pStmt); + sqlite3_step(pStmt); db->init.reopenMemdb = 0; - if( rc!=SQLITE_DONE ){ - rc = SQLITE_ERROR; + rc = sqlite3_finalize(pStmt); + if( rc!=SQLITE_OK ){ goto end_deserialize; } p = memdbFromDbSchema(db, zSchema); @@ -56132,7 +56161,6 @@ SQLITE_API int sqlite3_deserialize( } end_deserialize: - sqlite3_finalize(pStmt); if( pData && (mFlags & SQLITE_DESERIALIZE_FREEONCLOSE)!=0 ){ sqlite3_free(pData); } @@ -123122,7 +123150,9 @@ SQLITE_PRIVATE void sqlite3AlterDropConstraint( if( !pTab ) return; if( pCons ){ - zArg = sqlite3MPrintf(db, "%.*Q", pCons->n, pCons->z); + char *z = sqlite3NameFromToken(db, pCons); + zArg = sqlite3MPrintf(db, "%Q", z); + sqlite3DbFree(db, z); }else{ int iCol; if( alterFindCol(pParse, pTab, pCol, &iCol) ) return; @@ -125504,6 +125534,16 @@ static void attachFunc( ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ Btree *pNewBt = 0; + + pNew = &db->aDb[db->init.iDb]; + assert( pNew->pBt!=0 ); + if( sqlite3BtreeTxnState(pNew->pBt)!=SQLITE_TXN_NONE + || sqlite3BtreeIsInBackup(pNew->pBt) + ){ + rc = SQLITE_BUSY; + goto attach_error; + } + pVfs = sqlite3_vfs_find("memdb"); if( pVfs==0 ) return; rc = sqlite3BtreeOpen(pVfs, "x\0", db, &pNewBt, 0, SQLITE_OPEN_MAIN_DB); @@ -125513,8 +125553,7 @@ static void attachFunc( /* Both the Btree and the new Schema were allocated successfully. ** Close the old db and update the aDb[] slot with the new memdb ** values. */ - pNew = &db->aDb[db->init.iDb]; - if( ALWAYS(pNew->pBt) ) sqlite3BtreeClose(pNew->pBt); + sqlite3BtreeClose(pNew->pBt); pNew->pBt = pNewBt; pNew->pSchema = pNewSchema; }else{ @@ -156057,6 +156096,7 @@ static SQLITE_NOINLINE void existsToJoin( && !ExprHasProperty(pWhere, EP_OuterON|EP_InnerON) && ALWAYS(p->pSrc!=0) && p->pSrc->nSrcpLimit==0 || p->pLimit->pRight==0) ){ if( pWhere->op==TK_AND ){ Expr *pRight = pWhere->pRight; @@ -156104,7 +156144,6 @@ static SQLITE_NOINLINE void existsToJoin( sqlite3TreeViewSelect(0, p, 0); } #endif - existsToJoin(pParse, p, pSubWhere); } } } @@ -165946,7 +165985,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( ** by this loop in the a[0] slot and all notReady tables in a[1..] slots. ** This becomes the SrcList in the recursive call to sqlite3WhereBegin(). */ - if( pWInfo->nLevel>1 ){ + if( pWInfo->nLevel>1 || pTabItem->fg.fromExists ){ int nNotReady; /* The number of notReady tables */ SrcItem *origSrc; /* Original list of tables */ nNotReady = pWInfo->nLevel - iLevel - 1; @@ -165959,6 +165998,13 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( for(k=1; k<=nNotReady; k++){ memcpy(&pOrTab->a[k], &origSrc[pLevel[k].iFrom], sizeof(pOrTab->a[k])); } + + /* Clear the fromExists flag on the OR-optimized table entry so that + ** the calls to sqlite3WhereEnd() do not code early-exits after the + ** first row is visited. The early exit applies to this table's + ** overall loop - including the multiple OR branches and any WHERE + ** conditions not passed to the sub-loops - not to the sub-loops. */ + pOrTab->a[0].fg.fromExists = 0; }else{ pOrTab = pWInfo->pTabList; } @@ -166202,7 +166248,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( assert( pLevel->op==OP_Return ); pLevel->p2 = sqlite3VdbeCurrentAddr(v); - if( pWInfo->nLevel>1 ){ sqlite3DbFreeNN(db, pOrTab); } + if( pWInfo->pTabList!=pOrTab ){ sqlite3DbFreeNN(db, pOrTab); } if( !untestedTerms ) disableTerm(pLevel, pTerm); }else #endif /* SQLITE_OMIT_OR_OPTIMIZATION */ @@ -176127,27 +176173,11 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ } #endif /* SQLITE_DISABLE_SKIPAHEAD_DISTINCT */ } - if( pTabList->a[pLevel->iFrom].fg.fromExists - && (i==pWInfo->nLevel-1 - || pTabList->a[pWInfo->a[i+1].iFrom].fg.fromExists==0) - ){ - /* This is an EXISTS-to-JOIN optimization which is either the - ** inner-most loop, or the inner-most of a group of nested - ** EXISTS-to-JOIN optimization loops. If this loop sees a successful - ** row, it should break out of itself as well as other EXISTS-to-JOIN - ** loops in which is is directly nested. */ - int nOuter = 0; /* Nr of outer EXISTS that this one is nested within */ - while( nOutera[pLevel[-nOuter-1].iFrom].fg.fromExists ) break; - nOuter++; - } - testcase( nOuter>0 ); - sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel[-nOuter].addrBrk); - if( nOuter ){ - VdbeComment((v, "EXISTS break %d..%d", i-nOuter, i)); - }else{ - VdbeComment((v, "EXISTS break %d", i)); - } + if( pTabList->a[pLevel->iFrom].fg.fromExists ){ + /* This is an EXISTS-to-JOIN optimization loop. If this loop sees a + ** successful row, it should break out of itself. */ + sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk); + VdbeComment((v, "EXISTS break %d", i)); } sqlite3VdbeResolveLabel(v, pLevel->addrCont); if( pLevel->op!=OP_Noop ){ @@ -184334,6 +184364,7 @@ static YYACTIONTYPE yy_reduce( yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy454, 0); if( yymsp[-4].minor.yy454 ){ yymsp[-4].minor.yy454->x.pList = pList; + sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy454); }else{ sqlite3ExprListDelete(pParse->db, pList); } @@ -233951,10 +233982,11 @@ static int sessionSerialLen(const u8 *a){ int n; assert( a!=0 ); e = *a; - if( e==0 || e==0xFF ) return 1; - if( e==SQLITE_NULL ) return 1; if( e==SQLITE_INTEGER || e==SQLITE_FLOAT ) return 9; - return sessionVarintGet(&a[1], &n) + 1 + n; + if( e==SQLITE_TEXT || e==SQLITE_BLOB ){ + return sessionVarintGet(&a[1], &n) + 1 + n; + } + return 1; } /* @@ -233977,17 +234009,17 @@ static unsigned int sessionChangeHash( u8 *a = aRecord; /* Used to iterate through change record */ for(i=0; inCol; i++){ - int eType = *a; int isPK = pTab->abPK[i]; if( bPkOnly && isPK==0 ) continue; - assert( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT - || eType==SQLITE_TEXT || eType==SQLITE_BLOB - || eType==SQLITE_NULL || eType==0 - ); - if( isPK ){ - a++; + int eType = *a++; + + assert( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT + || eType==SQLITE_TEXT || eType==SQLITE_BLOB + || eType==SQLITE_NULL || eType==0 + ); + h = sessionHashAppendType(h, eType); if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ h = sessionHashAppendI64(h, sessionGetI64(a)); @@ -237015,9 +237047,11 @@ static int sessionChangesetBufferRecord( rc = sessionInputBuffer(pIn, nByte); }else if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ nByte += 8; + }else if( eType!=0 && eType!=SQLITE_NULL ){ + rc = SQLITE_CORRUPT_BKPT; } } - if( (pIn->iNext+nByte)>pIn->nData ){ + if( rc==SQLITE_OK && (pIn->iNext+nByte)>pIn->nData ){ rc = SQLITE_CORRUPT_BKPT; } } @@ -263222,7 +263256,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2026-04-09 11:41:38 4525003a53a7fc63ca75c59b22c79608659ca12f0131f52c18637f829977f20b", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2026-05-05 10:34:17 c88b22011a54b4f6fbd149e9f8e4de77658ce58143a1af0e3785e4e6475127e9", -1, SQLITE_TRANSIENT); } /* diff --git a/deps/sqlite/sqlite3.h b/deps/sqlite/sqlite3.h index 5d7f82b659140b..8ee26c99d86e6e 100644 --- a/deps/sqlite/sqlite3.h +++ b/deps/sqlite/sqlite3.h @@ -146,12 +146,12 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.53.0" -#define SQLITE_VERSION_NUMBER 3053000 -#define SQLITE_SOURCE_ID "2026-04-09 11:41:38 4525003a53a7fc63ca75c59b22c79608659ca12f0131f52c18637f829977f20b" -#define SQLITE_SCM_BRANCH "trunk" -#define SQLITE_SCM_TAGS "release major-release version-3.53.0" -#define SQLITE_SCM_DATETIME "2026-04-09T11:41:38.498Z" +#define SQLITE_VERSION "3.53.1" +#define SQLITE_VERSION_NUMBER 3053001 +#define SQLITE_SOURCE_ID "2026-05-05 10:34:17 c88b22011a54b4f6fbd149e9f8e4de77658ce58143a1af0e3785e4e6475127e9" +#define SQLITE_SCM_BRANCH "branch-3.53" +#define SQLITE_SCM_TAGS "release version-3.53.1" +#define SQLITE_SCM_DATETIME "2026-05-05T10:34:17.344Z" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/deps/undici/src/.gitignore b/deps/undici/src/.gitignore index 2af62573ea7ee8..fc02456981b799 100644 --- a/deps/undici/src/.gitignore +++ b/deps/undici/src/.gitignore @@ -91,3 +91,5 @@ AGENTS.md # Ignore .githuman .githuman + +benchmarks/package-lock.json diff --git a/deps/undici/src/README.md b/deps/undici/src/README.md index c15ffd0cc86910..b5a1cc17c04fd5 100644 --- a/deps/undici/src/README.md +++ b/deps/undici/src/README.md @@ -200,7 +200,9 @@ await fetch('https://example.com', { ``` `install()` replaces the global `fetch`, `Headers`, `Response`, `Request`, and -`FormData` implementations with undici's versions, so they all match. +`FormData` implementations with undici's versions, so they all match. It also +installs undici's `WebSocket`, `CloseEvent`, `ErrorEvent`, `MessageEvent`, and +`EventSource` globals. Avoid mixing a global `FormData` with `undici.fetch()`, or `undici.FormData` with the built-in global `fetch()`. @@ -283,12 +285,12 @@ const data2 = await getData(); ## Global Installation -Undici provides an `install()` function to add all WHATWG fetch classes to `globalThis`, making them available globally: +Undici provides an `install()` function to add fetch-related and other web API classes to `globalThis`, making them available globally: ```js import { install } from 'undici' -// Install all WHATWG fetch classes globally +// Install undici's global web APIs install() // Now you can use fetch classes globally without importing @@ -316,8 +318,9 @@ The `install()` function adds the following classes to `globalThis`: When you call `install()`, these globals come from the same undici implementation. For example, global `fetch` and global `FormData` will both be -undici's versions, which is the recommended setup if you want to use undici -through globals. +undici's versions, and `WebSocket` and `EventSource` will also come from +undici, which is the recommended setup if you want to use undici through +globals. This is useful for: - Polyfilling environments that don't have fetch diff --git a/deps/undici/src/docs/docs/api/GlobalInstallation.md b/deps/undici/src/docs/docs/api/GlobalInstallation.md index 2fc5bc2fd86ce3..d2f8f77e7b8b0f 100644 --- a/deps/undici/src/docs/docs/api/GlobalInstallation.md +++ b/deps/undici/src/docs/docs/api/GlobalInstallation.md @@ -1,17 +1,17 @@ # Global Installation -Undici provides an `install()` function to add all WHATWG fetch classes to `globalThis`, making them available globally without requiring imports. +Undici provides an `install()` function to add fetch-related and other web API classes to `globalThis`, making them available globally without requiring imports. ## `install()` -Install all WHATWG fetch classes globally on `globalThis`. +Install undici's global web APIs on `globalThis`. **Example:** ```js import { install } from 'undici' -// Install all WHATWG fetch classes globally +// Install undici's global web APIs install() // Now you can use fetch classes globally without importing @@ -74,6 +74,8 @@ await fetch('https://example.com', { After `install()`, `fetch`, `Headers`, `Response`, `Request`, and `FormData` all come from the installed `undici` package, so they work as a matching set. +`WebSocket`, `CloseEvent`, `ErrorEvent`, `MessageEvent`, and `EventSource` +also come from the installed `undici` package. If you do not want to install globals, import both from `undici` instead: @@ -135,5 +137,5 @@ test('fetch API test', async () => { - The `install()` function overwrites any existing global implementations - Classes installed are undici's implementations, not Node.js built-ins -- This provides access to undici's latest features and performance improvements -- The global installation persists for the lifetime of the process \ No newline at end of file +- This provides access to undici's latest fetch, WebSocket, and EventSource features and performance improvements +- The global installation persists for the lifetime of the process diff --git a/deps/undici/src/docs/docs/api/SnapshotAgent.md b/deps/undici/src/docs/docs/api/SnapshotAgent.md index e4c8f2484a5408..1de74fb73f97c3 100644 --- a/deps/undici/src/docs/docs/api/SnapshotAgent.md +++ b/deps/undici/src/docs/docs/api/SnapshotAgent.md @@ -27,7 +27,9 @@ new SnapshotAgent([options]) - **ignoreHeaders** `Array` - Headers to ignore during request matching - **excludeHeaders** `Array` - Headers to exclude from snapshots (for security) - **matchBody** `Boolean` - Whether to include request body in matching. Default: `true` + - **normalizeBody** `Function` - Optional function `(body) => string` to normalize the request body before matching (e.g. strip volatile fields like timestamps). Only used when `matchBody` is `true`. - **matchQuery** `Boolean` - Whether to include query parameters in matching. Default: `true` + - **normalizeQuery** `Function` - Optional function `(query: URLSearchParams) => string` to normalize query parameters before matching (e.g. strip volatile params like cache-busters). Only used when `matchQuery` is `true`. - **caseSensitive** `Boolean` - Whether header matching is case-sensitive. Default: `false` - **shouldRecord** `Function` - Callback to determine if a request should be recorded - **shouldPlayback** `Function` - Callback to determine if a request should be played back @@ -108,6 +110,27 @@ await agent.saveSnapshots('./custom-snapshots.json') ## Advanced Configuration +### Body Matching + +By default (`matchBody: true`) the full request body string is included in the snapshot key. Set it to `false` to ignore the body entirely, or use `normalizeBody` to strip volatile fields (like timestamps) before matching: + +```javascript +const agent = new SnapshotAgent({ + mode: 'playback', + snapshotPath: './snapshots.json', + + // Match on everything except the timestamp field + normalizeBody: (body) => { + if (!body) return '' + const parsed = JSON.parse(String(body)) + delete parsed.timestamp + return JSON.stringify(parsed) + } +}) +``` + +`normalizeBody` receives the raw body (`string | Buffer | null | undefined`) and must return a `string`. It runs at both record and playback time so the hash is consistent. Two requests match the same snapshot whenever their normalized strings are identical. + ### Header Filtering Control which headers are used for request matching and what gets stored in snapshots: diff --git a/deps/undici/src/lib/api/api-pipeline.js b/deps/undici/src/lib/api/api-pipeline.js index 6e61710b90741a..6af3913440a490 100644 --- a/deps/undici/src/lib/api/api-pipeline.js +++ b/deps/undici/src/lib/api/api-pipeline.js @@ -13,6 +13,7 @@ const { RequestAbortedError } = require('../core/errors') const util = require('../core/util') +const { kBodyUsed } = require('../core/symbols') const { addSignal, removeSignal } = require('./abort-signal') function noop () {} @@ -24,6 +25,9 @@ class PipelineRequest extends Readable { super({ autoDestroy: true }) this[kResume] = null + // Pipeline request bodies come from a live writable side and cannot be + // replayed across redirects or retries, even before any bytes are read. + this[kBodyUsed] = true } _read () { diff --git a/deps/undici/src/lib/api/api-stream.js b/deps/undici/src/lib/api/api-stream.js index 249d6774f6bea8..f111d70efc17cd 100644 --- a/deps/undici/src/lib/api/api-stream.js +++ b/deps/undici/src/lib/api/api-stream.js @@ -1,7 +1,6 @@ 'use strict' const assert = require('node:assert') -const { finished } = require('node:stream') const { AsyncResource } = require('node:async_hooks') const { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors') const util = require('../core/util') @@ -9,6 +8,54 @@ const { addSignal, removeSignal } = require('./abort-signal') function noop () {} +function getWritableError (stream) { + return stream.errored ?? stream.writableErrored ?? stream._writableState?.errored +} + +function createPrematureCloseError () { + const err = new Error('Premature close') + err.code = 'ERR_STREAM_PREMATURE_CLOSE' + return err +} + +function trackWritableLifecycle (stream, callback) { + let done = false + + const cleanup = () => { + stream.removeListener('close', onClose) + stream.removeListener('error', onError) + stream.removeListener('finish', onFinish) + } + + const finish = (err, fromErrorEvent = false) => { + if (done) { + return + } + + done = true + cleanup() + callback(err, fromErrorEvent) + } + + const onClose = () => { + const err = getWritableError(stream) + finish(err ?? (!stream.writableFinished ? createPrematureCloseError() : undefined)) + } + + const onError = (err) => finish(err, true) + const onFinish = () => finish() + + stream.on('close', onClose) + stream.on('error', onError) + stream.on('finish', onFinish) + + if (stream.closed) { + process.nextTick(onClose) + } else if (stream.writableFinished) { + process.nextTick(onFinish) + } +} + class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { if (!opts || typeof opts !== 'object') { @@ -117,20 +164,19 @@ class StreamHandler extends AsyncResource { throw new InvalidReturnValueError('expected Writable') } - // TODO: Avoid finished. It registers an unnecessary amount of listeners. - finished(res, { readable: false }, (err) => { + trackWritableLifecycle(res, (err, fromErrorEvent) => { const { callback, res, opaque, trailers, abort } = this this.res = null if (err || !res?.readable) { - util.destroy(res, err) + util.destroy(res, fromErrorEvent ? undefined : err) } this.callback = null this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) if (err) { - abort() + abort(err) } }) diff --git a/deps/undici/src/lib/core/symbols.js b/deps/undici/src/lib/core/symbols.js index ff37adc0448f1b..8bad25eed9fdb9 100644 --- a/deps/undici/src/lib/core/symbols.js +++ b/deps/undici/src/lib/core/symbols.js @@ -62,6 +62,7 @@ module.exports = { kListeners: Symbol('listeners'), kHTTPContext: Symbol('http context'), kMaxConcurrentStreams: Symbol('max concurrent streams'), + kHostAuthority: Symbol('host authority'), kHTTP2InitialWindowSize: Symbol('http2 initial window size'), kHTTP2ConnectionWindowSize: Symbol('http2 connection window size'), kEnableConnectProtocol: Symbol('http2session connect protocol'), diff --git a/deps/undici/src/lib/core/util.js b/deps/undici/src/lib/core/util.js index 54346a2567c2d2..98337c596c76c7 100644 --- a/deps/undici/src/lib/core/util.js +++ b/deps/undici/src/lib/core/util.js @@ -776,7 +776,7 @@ function isValidHeaderValue (characters) { return !headerCharRegex.test(characters) } -const rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+)?$/ +const rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+|\*)?$/ /** * @typedef {object} RangeHeader @@ -799,7 +799,7 @@ function parseRangeHeader (range) { ? { start: parseInt(m[1]), end: m[2] ? parseInt(m[2]) : null, - size: m[3] ? parseInt(m[3]) : null + size: m[3] && m[3] !== '*' ? parseInt(m[3]) : null } : null } diff --git a/deps/undici/src/lib/dispatcher/client-h1.js b/deps/undici/src/lib/dispatcher/client-h1.js index f64d3f11324c7a..f1c52fb5f116ec 100644 --- a/deps/undici/src/lib/dispatcher/client-h1.js +++ b/deps/undici/src/lib/dispatcher/client-h1.js @@ -360,16 +360,7 @@ class Parser { this.paused = true socket.unshift(data) } else { - const ptr = llhttp.llhttp_get_error_reason(this.ptr) - let message = '' - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) - message = - 'Response does not match the HTTP/1.1 protocol (' + - Buffer.from(llhttp.memory.buffer, ptr, len).toString() + - ')' - } - throw new HTTPParserError(message, constants.ERROR[ret], data) + throw this.createError(ret, data) } } } catch (err) { @@ -377,6 +368,54 @@ class Parser { } } + finish () { + assert(currentParser === null) + assert(this.ptr != null) + assert(!this.paused) + + const { llhttp } = this + + let ret + + try { + currentParser = this + ret = llhttp.llhttp_finish(this.ptr) + } finally { + currentParser = null + } + + if (ret === constants.ERROR.OK) { + return null + } + + if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { + this.paused = true + return null + } + + return this.createError(ret, EMPTY_BUF) + } + + createError (ret, data) { + const { llhttp, contentLength, bytesRead } = this + + if (contentLength !== -1 && bytesRead !== contentLength) { + return new ResponseContentLengthMismatchError() + } + + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + + return new HTTPParserError(message, constants.ERROR[ret], data) + } + destroy () { assert(currentParser === null) assert(this.ptr != null) @@ -888,8 +927,11 @@ function onHttpSocketError (err) { // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so for as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + this[kError] = parserErr + this[kClient][kOnError](parserErr) + } return } @@ -906,8 +948,10 @@ function onHttpSocketEnd () { const parser = this[kParser] if (parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + util.destroy(this, parserErr) + } return } @@ -919,8 +963,7 @@ function onHttpSocketClose () { if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + this[kError] = parser.finish() || this[kError] } this[kParser].destroy() @@ -1382,8 +1425,6 @@ function writeBuffer (abort, body, client, request, socket, contentLength, heade * @returns {Promise} */ async function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) { - assert(contentLength === body.size, 'blob body must have content length') - try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError() diff --git a/deps/undici/src/lib/dispatcher/client-h2.js b/deps/undici/src/lib/dispatcher/client-h2.js index b77013df98da46..ba9157cab5b145 100644 --- a/deps/undici/src/lib/dispatcher/client-h2.js +++ b/deps/undici/src/lib/dispatcher/client-h2.js @@ -28,6 +28,7 @@ const { kHTTP2Session, kHTTP2InitialWindowSize, kHTTP2ConnectionWindowSize, + kHostAuthority, kResume, kSize, kHTTPContext, @@ -44,8 +45,7 @@ const kOpenStreams = Symbol('open streams') const kRequestStreamId = Symbol('request stream id') const kRequestStream = Symbol('request stream') const kRequestStreamCleanup = Symbol('request stream cleanup') -const kRequestStreamOnData = Symbol('request stream on data') -const kRequestStreamOnCloseError = Symbol('request stream on close error') +const kRequestStreamState = Symbol('request stream state') const kReceivedGoAway = Symbol('received goaway') let extractBody @@ -107,8 +107,9 @@ function detachRequestFromStream (request) { function bindRequestToStream (request, stream, cleanup) { const previousCleanup = request[kRequestStreamCleanup] + const previousStream = request[kRequestStream] detachRequestFromStream(request) - previousCleanup?.() + previousCleanup?.(previousStream) request[kRequestStreamId] = stream.id request[kRequestStream] = stream request[kRequestStreamCleanup] = cleanup @@ -116,8 +117,9 @@ function bindRequestToStream (request, stream, cleanup) { function clearRequestStream (request) { const cleanup = request[kRequestStreamCleanup] + const stream = request[kRequestStream] detachRequestFromStream(request) - cleanup?.() + cleanup?.(stream) } function canRetryRequestAfterGoAway (request) { @@ -516,20 +518,18 @@ function closeStreamSession (stream) { function onUpgradeStreamClose () { this.off('error', noop) - const failUpgradeStream = this[kRequestStreamOnCloseError] - this[kRequestStreamOnCloseError] = null + const state = this[kRequestStreamState] + this[kRequestStreamState] = null - failUpgradeStream(new InformationalError('HTTP/2: stream closed before response headers')) + failUpgradeStream(state, new InformationalError('HTTP/2: stream closed before response headers')) closeStreamSession(this) } function onRequestStreamClose () { - const onData = this[kRequestStreamOnData] - - this[kRequestStreamOnData] = null this.off('data', onData) this.off('error', noop) closeStreamSession(this) + this[kRequestStreamState] = null } // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 @@ -537,25 +537,17 @@ function shouldSendContentLength (method) { return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' } -function writeH2 (client, request) { - const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout] - const session = client[kHTTP2Session] - const { method, path, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request - let { body } = request - - if (upgrade != null && upgrade !== 'websocket') { - util.errorRequest(client, request, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`)) - return false - } - +function buildRequestHeaders (reqHeaders) { const headers = {} + for (let n = 0; n < reqHeaders.length; n += 2) { const key = reqHeaders[n + 0] const val = reqHeaders[n + 1] + const current = headers[key] if (key === 'cookie') { - if (headers[key] != null) { - headers[key] = Array.isArray(headers[key]) ? (headers[key].push(val), headers[key]) : [headers[key], val] + if (current != null) { + headers[key] = Array.isArray(current) ? (current.push(val), current) : [current, val] } else { headers[key] = val } @@ -563,27 +555,140 @@ function writeH2 (client, request) { continue } - if (Array.isArray(val)) { - for (let i = 0; i < val.length; i++) { - if (headers[key]) { - headers[key] += `, ${val[i]}` - } else { - headers[key] = val[i] - } - } - } else if (headers[key]) { - headers[key] += `, ${val}` - } else { - headers[key] = val + if (typeof val === 'string') { + headers[key] = current ? `${current}, ${val}` : val + continue } + + for (let i = 0; i < val.length; i++) { + headers[key] = headers[key] ? `${headers[key]}, ${val[i]}` : val[i] + } + } + + return headers +} + +function removeUpgradeStreamListeners (stream) { + stream.off('response', onUpgradeResponse) + stream.off('error', onUpgradeStreamError) + stream.off('end', onUpgradeStreamEnd) + stream.off('timeout', onUpgradeStreamTimeout) + stream.off('error', noop) +} + +function releaseUpgradeStream (stream) { + if (stream == null) { + return + } + + const state = stream[kRequestStreamState] + if (state == null) { + return + } + + const { request } = state + + if (request[kRequestStream] === stream) { + detachRequestFromStream(request) + } + + removeUpgradeStreamListeners(stream) + + if (!stream.destroyed && !stream.closed) { + stream.once('error', noop) + } +} + +function failUpgradeStream (state, err) { + if (state == null) { + return + } + + const { request } = state + if (state.responseReceived || request.aborted || request.completed) { + return + } + + releaseUpgradeStream(state.stream) + state.abort(err, true) +} + +function onUpgradeStreamError () { + const state = this[kRequestStreamState] + + if (typeof this.rstCode === 'number' && this.rstCode !== 0) { + failUpgradeStream(state, new InformationalError(`HTTP/2: "stream error" received - code ${this.rstCode}`)) + } else { + failUpgradeStream(state, new InformationalError('HTTP/2: stream errored before response headers')) + } +} + +function onUpgradeStreamEnd () { + failUpgradeStream(this[kRequestStreamState], new InformationalError('HTTP/2: stream half-closed (remote)')) +} + +function onUpgradeStreamTimeout () { + const state = this[kRequestStreamState] + failUpgradeStream(state, new InformationalError(`HTTP/2: "stream timeout after ${state.requestTimeout}"`)) +} + +function onUpgradeResponse (headers, _flags) { + const stream = this + const state = stream[kRequestStreamState] + const { request } = state + + state.responseReceived = true + + const statusCode = headers[HTTP2_HEADER_STATUS] + delete headers[HTTP2_HEADER_STATUS] + + request.onRequestUpgrade(statusCode, headers, stream) + + if (request.aborted || request.completed) { + return } + removeUpgradeStreamListeners(stream) + detachRequestFromStream(request) + state.finalizeRequest() +} + +function setupUpgradeStream (stream, state) { + const { request, requestTimeout, session } = state + + stream[kHTTP2Stream] = true + stream[kHTTP2Session] = session + stream[kRequestStreamState] = state + state.stream = stream + + bindRequestToStream(request, stream, releaseUpgradeStream) + stream.once('response', onUpgradeResponse) + stream.on('error', onUpgradeStreamError) + stream.once('end', onUpgradeStreamEnd) + stream.on('timeout', onUpgradeStreamTimeout) + stream.once('close', onUpgradeStreamClose) + + ++session[kOpenStreams] + stream.setTimeout(requestTimeout) +} + +function writeH2 (client, request) { + const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout] + const session = client[kHTTP2Session] + const { method, path, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request + let { body } = request + + if (upgrade != null && upgrade !== 'websocket') { + util.errorRequest(client, request, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`)) + return false + } + + const headers = buildRequestHeaders(reqHeaders) + /** @type {import('node:http2').ClientHttp2Stream} */ let stream = null - const { hostname, port } = client[kUrl] - - headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}` + headers[HTTP2_HEADER_AUTHORITY] = host || client[kHostAuthority] headers[HTTP2_HEADER_METHOD] = method let requestFinalized = false @@ -662,82 +767,14 @@ function writeH2 (client, request) { if (upgrade || method === 'CONNECT') { session.ref() - const setupUpgradeStream = (stream) => { - let responseReceived = false - - const removeUpgradeStreamListeners = () => { - stream.off('response', onUpgradeResponse) - stream.off('error', onUpgradeStreamError) - stream.off('end', onUpgradeStreamEnd) - stream.off('timeout', onUpgradeStreamTimeout) - stream.off('error', noop) - } - - const releaseUpgradeStream = () => { - if (request[kRequestStream] === stream) { - detachRequestFromStream(request) - } - - removeUpgradeStreamListeners() - - if (!stream.destroyed && !stream.closed) { - stream.once('error', noop) - } - } - - const failUpgradeStream = (err) => { - if (responseReceived || request.aborted || request.completed) { - return - } - - releaseUpgradeStream() - abort(err, true) - } - - const onUpgradeStreamError = () => { - if (typeof stream.rstCode === 'number' && stream.rstCode !== 0) { - failUpgradeStream(new InformationalError(`HTTP/2: "stream error" received - code ${stream.rstCode}`)) - } else { - failUpgradeStream(new InformationalError('HTTP/2: stream errored before response headers')) - } - } - - const onUpgradeStreamEnd = () => { - failUpgradeStream(new InformationalError('HTTP/2: stream half-closed (remote)')) - } - - const onUpgradeStreamTimeout = () => { - failUpgradeStream(new InformationalError(`HTTP/2: "stream timeout after ${requestTimeout}"`)) - } - - const onUpgradeResponse = (headers, _flags) => { - responseReceived = true - - const statusCode = headers[HTTP2_HEADER_STATUS] - delete headers[HTTP2_HEADER_STATUS] - - request.onRequestUpgrade(statusCode, headers, stream) - - if (request.aborted || request.completed) { - return - } - - removeUpgradeStreamListeners() - detachRequestFromStream(request) - finalizeRequest() - } - - bindRequestToStream(request, stream, releaseUpgradeStream) - stream.once('response', onUpgradeResponse) - stream.on('error', onUpgradeStreamError) - stream.once('end', onUpgradeStreamEnd) - stream.on('timeout', onUpgradeStreamTimeout) - stream[kHTTP2Session] = session - stream[kRequestStreamOnCloseError] = failUpgradeStream - stream.once('close', onUpgradeStreamClose) - - ++session[kOpenStreams] - stream.setTimeout(requestTimeout) + const upgradeState = { + abort, + finalizeRequest, + request, + requestTimeout, + responseReceived: false, + session, + stream: null } if (upgrade === 'websocket') { @@ -767,8 +804,7 @@ function writeH2 (client, request) { session.unref() return false } - stream[kHTTP2Stream] = true - setupUpgradeStream(stream) + setupUpgradeStream(stream, upgradeState) return true } @@ -782,8 +818,7 @@ function writeH2 (client, request) { session.unref() return false } - stream[kHTTP2Stream] = true - setupUpgradeStream(stream) + setupUpgradeStream(stream, upgradeState) return true } @@ -805,7 +840,10 @@ function writeH2 (client, request) { const expectsPayload = ( method === 'PUT' || method === 'POST' || - method === 'PATCH' + method === 'PATCH' || + method === 'QUERY' || + method === 'PROPFIND' || + method === 'PROPPATCH' ) if (body && typeof body.read === 'function') { @@ -865,230 +903,251 @@ function writeH2 (client, request) { } // TODO(metcoder95): add support for sending trailers - const shouldEndStream = body === null + const shouldEndStream = body === null || contentLength === 0 + const state = { + abort, + body, + client, + contentLength, + expectsPayload, + finalizeRequest, + request, + requestTimeout, + responseReceived: false, + session, + stream: null + } + if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = '100-continue' - stream = requestStream(headers, { endStream: shouldEndStream, signal }) - if (stream == null) { - return false - } - stream[kHTTP2Stream] = true - bindRequestToStream(request, stream, null) - } else { - stream = requestStream(headers, { - endStream: shouldEndStream, - signal - }) - if (stream == null) { - return false - } - stream[kHTTP2Stream] = true - bindRequestToStream(request, stream, null) } + stream = requestStream(headers, { endStream: shouldEndStream, signal }) + if (stream == null) { + return false + } + stream[kHTTP2Stream] = true + stream[kRequestStreamState] = state + state.stream = stream + bindRequestToStream(request, stream, null) + // Increment counter as we have new streams open ++session[kOpenStreams] stream.setTimeout(requestTimeout) - // Track whether we received a response (headers) - let responseReceived = false - const onData = (chunk) => { - if (request.aborted || request.completed) { - return - } + stream[kHTTP2Session] = session + stream.once('close', onRequestStreamClose) - if (request.onResponseData(chunk) === false) { - stream.pause() - } + bindRequestToStream(request, stream, releaseRequestStream) + if (expectContinue) { + stream.once('continue', writeBodyH2) } + stream.once('response', onResponse) + stream.once('end', onEnd) + stream.once('error', onError) + stream.once('frameError', onFrameError) + stream.on('aborted', onAborted) + stream.on('timeout', onTimeout) + stream.once('trailers', onTrailers) - const removeRequestStreamListeners = () => { - stream.off('error', noop) - stream.off('continue', writeBodyH2) - stream.off('response', onResponse) - stream.off('end', onEnd) - stream.off('error', onError) - stream.off('frameError', onFrameError) - stream.off('aborted', onAborted) - stream.off('timeout', onTimeout) - stream.off('trailers', onTrailers) - stream.off('data', onData) + if (!expectContinue) { + writeBodyH2.call(stream) } - const releaseRequestStream = () => { - if (request[kRequestStream] === stream) { - detachRequestFromStream(request) - } + return true +} - removeRequestStreamListeners() +function removeRequestStreamListeners (stream) { + stream.off('error', noop) + stream.off('continue', writeBodyH2) + stream.off('response', onResponse) + stream.off('end', onEnd) + stream.off('error', onError) + stream.off('frameError', onFrameError) + stream.off('aborted', onAborted) + stream.off('timeout', onTimeout) + stream.off('trailers', onTrailers) + stream.off('data', onData) +} - if (!stream.destroyed && !stream.closed) { - stream.once('error', noop) - } +function releaseRequestStream (stream) { + if (stream == null) { + return } - const onResponse = (headers) => { - stream.off('response', onResponse) + const state = stream[kRequestStreamState] + if (state == null) { + return + } - const statusCode = headers[HTTP2_HEADER_STATUS] - delete headers[HTTP2_HEADER_STATUS] - request.onResponseStarted() - responseReceived = true + const { request } = state - // Due to the stream nature, it is possible we face a race condition - // where the stream has been assigned, but the request has been aborted - // the request remains in-flight and headers hasn't been received yet - // for those scenarios, best effort is to destroy the stream immediately - // as there's no value to keep it open. - if (request.aborted) { - releaseRequestStream() - return - } + if (request[kRequestStream] === stream) { + detachRequestFromStream(request) + } - if (request.onResponseStart(Number(statusCode), headers, stream.resume.bind(stream), '') === false) { - stream.pause() - } + removeRequestStreamListeners(stream) - stream.on('data', onData) + if (!stream.destroyed && !stream.closed) { + stream.once('error', noop) } +} - const onEnd = () => { - stream.off('end', onEnd) - - releaseRequestStream() - // If we received a response, this is a normal completion - if (responseReceived) { - if (!request.aborted && !request.completed) { - request.onResponseEnd({}) - } +function onData (chunk) { + const stream = this + const { request } = stream[kRequestStreamState] - finalizeRequest() - } else { - // Stream ended without receiving a response - this is an error - // (e.g., server destroyed the stream before sending headers) - abort(new InformationalError('HTTP/2: stream half-closed (remote)'), true) - } + if (request.aborted || request.completed) { + return } - stream[kHTTP2Session] = session - stream[kRequestStreamOnData] = onData - stream.once('close', onRequestStreamClose) + if (request.onResponseData(chunk) === false) { + stream.pause() + } +} - const onError = function (err) { - stream.off('error', onError) +function onResponse (headers) { + const stream = this + const state = stream[kRequestStreamState] + const { request } = state - releaseRequestStream() - abort(err) - } + stream.off('response', onResponse) - const onFrameError = (type, code) => { - stream.off('frameError', onFrameError) + const statusCode = headers[HTTP2_HEADER_STATUS] + delete headers[HTTP2_HEADER_STATUS] + request.onResponseStarted() + state.responseReceived = true - releaseRequestStream() - abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)) + // Due to the stream nature, it is possible we face a race condition + // where the stream has been assigned, but the request has been aborted + // the request remains in-flight and headers hasn't been received yet + // for those scenarios, best effort is to destroy the stream immediately + // as there's no value to keep it open. + if (request.aborted) { + releaseRequestStream(stream) + return } - const onAborted = () => { - stream.off('data', onData) + if (request.onResponseStart(Number(statusCode), headers, stream.resume.bind(stream), '') === false) { + stream.pause() } - const onTimeout = () => { - releaseRequestStream() + stream.on('data', onData) +} - const err = new InformationalError(`HTTP/2: "stream timeout after ${requestTimeout}"`) - abort(err) - } +function onEnd () { + const stream = this + const state = stream[kRequestStreamState] + const { request } = state - const onTrailers = (trailers) => { - stream.off('trailers', onTrailers) + stream.off('end', onEnd) - if (request.aborted || request.completed) { - return + releaseRequestStream(stream) + // If we received a response, this is a normal completion + if (state.responseReceived) { + if (!request.aborted && !request.completed) { + request.onResponseEnd({}) } - releaseRequestStream() - request.onResponseEnd(trailers) - finalizeRequest() + state.finalizeRequest() + } else { + // Stream ended without receiving a response - this is an error + // (e.g., server destroyed the stream before sending headers) + state.abort(new InformationalError('HTTP/2: stream half-closed (remote)'), true) } +} - bindRequestToStream(request, stream, releaseRequestStream) - if (expectContinue) { - stream.once('continue', writeBodyH2) - } - stream.once('response', onResponse) - stream.once('end', onEnd) - stream.once('error', onError) - stream.once('frameError', onFrameError) - stream.on('aborted', onAborted) - stream.on('timeout', onTimeout) - stream.once('trailers', onTrailers) +function onError (err) { + const stream = this + const state = stream[kRequestStreamState] - if (!expectContinue) { - writeBodyH2() + stream.off('error', onError) + + releaseRequestStream(stream) + state.abort(err) +} + +function onFrameError (type, code) { + const stream = this + const state = stream[kRequestStreamState] + + stream.off('frameError', onFrameError) + + releaseRequestStream(stream) + state.abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)) +} + +function onAborted () { + this.off('data', onData) +} + +function onTimeout () { + const stream = this + const state = stream[kRequestStreamState] + + releaseRequestStream(stream) + + const err = new InformationalError(`HTTP/2: "stream timeout after ${state.requestTimeout}"`) + state.abort(err) +} + +function onTrailers (trailers) { + const stream = this + const state = stream[kRequestStreamState] + const { request } = state + + stream.off('trailers', onTrailers) + + if (request.aborted || request.completed) { + return } - return true + releaseRequestStream(stream) + request.onResponseEnd(trailers) + state.finalizeRequest() +} - function writeBodyH2 () { - if (!body || contentLength === 0) { - writeBuffer( - abort, - stream, - null, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ) - } else if (util.isBuffer(body)) { - writeBuffer( +function writeBodyH2 () { + const stream = this + const state = stream[kRequestStreamState] + const { abort, body, client, contentLength, expectsPayload, request } = state + + if (!body || contentLength === 0) { + writeBuffer( + abort, + stream, + null, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } else if (util.isBuffer(body)) { + writeBuffer( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable( abort, stream, - body, + body.stream(), client, request, client[kSocket], contentLength, expectsPayload ) - } else if (util.isBlobLike(body)) { - if (typeof body.stream === 'function') { - writeIterable( - abort, - stream, - body.stream(), - client, - request, - client[kSocket], - contentLength, - expectsPayload - ) - } else { - writeBlob( - abort, - stream, - body, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ) - } - } else if (util.isStream(body)) { - writeStream( - abort, - client[kSocket], - expectsPayload, - stream, - body, - client, - request, - contentLength - ) - } else if (util.isIterable(body)) { - writeIterable( + } else { + writeBlob( abort, stream, body, @@ -1098,9 +1157,31 @@ function writeH2 (client, request) { contentLength, expectsPayload ) - } else { - assert(false) } + } else if (util.isStream(body)) { + writeStream( + abort, + client[kSocket], + expectsPayload, + stream, + body, + client, + request, + contentLength + ) + } else if (util.isIterable(body)) { + writeIterable( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } else { + assert(false) } } @@ -1159,8 +1240,6 @@ function writeStream (abort, socket, expectsPayload, h2stream, body, client, req } async function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { - assert(contentLength === body.size, 'blob body must have content length') - try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError() diff --git a/deps/undici/src/lib/dispatcher/client.js b/deps/undici/src/lib/dispatcher/client.js index 6ef97ba0a369a9..c2195f3dd37503 100644 --- a/deps/undici/src/lib/dispatcher/client.js +++ b/deps/undici/src/lib/dispatcher/client.js @@ -52,6 +52,7 @@ const { kOnError, kHTTPContext, kMaxConcurrentStreams, + kHostAuthority, kHTTP2InitialWindowSize, kHTTP2ConnectionWindowSize, kResume, @@ -246,6 +247,7 @@ class Client extends DispatcherBase { } this[kUrl] = util.parseOrigin(url) + this[kHostAuthority] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` this[kConnector] = connect this[kPipelining] = pipelining != null ? pipelining : 1 this[kMaxHeadersSize] = maxHeaderSize @@ -257,7 +259,7 @@ class Client extends DispatcherBase { this[kLocalAddress] = localAddress != null ? localAddress : null this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming - this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` + this[kHostHeader] = `host: ${this[kHostAuthority]}\r\n` this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength diff --git a/deps/undici/src/lib/dispatcher/pool-base.js b/deps/undici/src/lib/dispatcher/pool-base.js index 1395cd7f2772ec..c8a91d42ba5254 100644 --- a/deps/undici/src/lib/dispatcher/pool-base.js +++ b/deps/undici/src/lib/dispatcher/pool-base.js @@ -14,6 +14,7 @@ const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') const kOnConnectionError = Symbol('onConnectionError') const kGetDispatcher = Symbol('get dispatcher') +const kHasDispatcher = Symbol('has dispatcher') const kAddClient = Symbol('add client') const kRemoveClient = Symbol('remove client') @@ -162,12 +163,28 @@ class PoolBase extends DispatcherBase { this[kQueued]++ } else if (!dispatcher.dispatch(opts, handler)) { dispatcher[kNeedDrain] = true - this[kNeedDrain] = !this[kGetDispatcher]() + this[kNeedDrain] = !this[kHasDispatcher]() } return !this[kNeedDrain] } + [kHasDispatcher] () { + for (let i = 0; i < this[kClients].length; i++) { + const dispatcher = this[kClients][i] + + if ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + ) { + return true + } + } + + return false + } + [kAddClient] (client) { client .on('drain', this[kOnDrain].bind(this, client)) @@ -196,7 +213,7 @@ class PoolBase extends DispatcherBase { client.close(() => {}) - this[kNeedDrain] = this[kClients].some(dispatcher => ( + this[kNeedDrain] = !this[kClients].some(dispatcher => ( !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true @@ -210,5 +227,6 @@ module.exports = { kNeedDrain, kAddClient, kRemoveClient, - kGetDispatcher + kGetDispatcher, + kHasDispatcher } diff --git a/deps/undici/src/lib/dispatcher/pool.js b/deps/undici/src/lib/dispatcher/pool.js index f5898b02b3551c..39bf7403236698 100644 --- a/deps/undici/src/lib/dispatcher/pool.js +++ b/deps/undici/src/lib/dispatcher/pool.js @@ -6,6 +6,7 @@ const { kNeedDrain, kAddClient, kGetDispatcher, + kHasDispatcher, kRemoveClient } = require('./pool-base') const Client = require('./client') @@ -115,6 +116,28 @@ class Pool extends PoolBase { return dispatcher } } + + [kHasDispatcher] () { + const clientTtlOption = this[kOptions].clientTtl + for (let i = 0; i < this[kClients].length; i++) { + const client = this[kClients][i] + + if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && ((Date.now() - client.ttl) > clientTtlOption)) { + this[kRemoveClient](client) + i-- + } else if (!client[kNeedDrain]) { + return true + } + } + + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + const dispatcher = this[kFactory](this[kUrl], this[kOptions]) + this[kAddClient](dispatcher) + return true + } + + return false + } } module.exports = Pool diff --git a/deps/undici/src/lib/dispatcher/proxy-agent.js b/deps/undici/src/lib/dispatcher/proxy-agent.js index b89b88bde969d2..8522bdd586d1b7 100644 --- a/deps/undici/src/lib/dispatcher/proxy-agent.js +++ b/deps/undici/src/lib/dispatcher/proxy-agent.js @@ -18,6 +18,7 @@ const kProxyTls = Symbol('proxy tls settings') const kConnectEndpoint = Symbol('connect endpoint function') const kConnectEndpointHTTP1 = Symbol('connect endpoint function (http/1.1 only)') const kTunnelProxy = Symbol('tunnel proxy') +const proxyAuthorization = 'proxy-authorization' function defaultProtocolPort (protocol) { return protocol === 'https:' ? 443 : 80 @@ -298,6 +299,10 @@ function buildHeaders (headers) { const headersPair = {} for (let i = 0; i < headers.length; i += 2) { + if (isProxyAuthorizationHeader(headers[i])) { + throwProxyAuthError() + } + headersPair[headers[i]] = headers[i + 1] } @@ -316,11 +321,23 @@ function buildHeaders (headers) { * It should be removed in the next major version for performance reasons */ function throwIfProxyAuthIsSent (headers) { - const existProxyAuth = headers && Object.keys(headers) - .find((key) => key.toLowerCase() === 'proxy-authorization') - if (existProxyAuth) { - throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') + for (const key in headers) { + if (isProxyAuthorizationHeader(key)) { + throwProxyAuthError() + } } } +/** + * @param {string} key + * @returns {boolean} + */ +function isProxyAuthorizationHeader (key) { + return key.length === proxyAuthorization.length && key.toLowerCase() === proxyAuthorization +} + +function throwProxyAuthError () { + throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') +} + module.exports = ProxyAgent diff --git a/deps/undici/src/lib/dispatcher/round-robin-pool.js b/deps/undici/src/lib/dispatcher/round-robin-pool.js index 17daea7a4a3274..b1f4763530f5a2 100644 --- a/deps/undici/src/lib/dispatcher/round-robin-pool.js +++ b/deps/undici/src/lib/dispatcher/round-robin-pool.js @@ -6,6 +6,7 @@ const { kNeedDrain, kAddClient, kGetDispatcher, + kHasDispatcher, kRemoveClient } = require('./pool-base') const Client = require('./client') @@ -128,6 +129,31 @@ class RoundRobinPool extends PoolBase { return dispatcher } } + + [kHasDispatcher] () { + const clientTtlOption = this[kOptions].clientTtl + for (let i = 0; i < this[kClients].length; i++) { + const client = this[kClients][i] + + if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && ((Date.now() - client.ttl) > clientTtlOption)) { + this[kRemoveClient](client) + if (i <= this[kIndex]) { + this[kIndex]-- + } + i-- + } else if (!client[kNeedDrain]) { + return true + } + } + + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + const dispatcher = this[kFactory](this[kUrl], this[kOptions]) + this[kAddClient](dispatcher) + return true + } + + return false + } } module.exports = RoundRobinPool diff --git a/deps/undici/src/lib/dispatcher/socks5-proxy-agent.js b/deps/undici/src/lib/dispatcher/socks5-proxy-agent.js index c0b681929ac499..3cc5b19f0be214 100644 --- a/deps/undici/src/lib/dispatcher/socks5-proxy-agent.js +++ b/deps/undici/src/lib/dispatcher/socks5-proxy-agent.js @@ -1,6 +1,5 @@ 'use strict' -const net = require('node:net') const { URL } = require('node:url') let tls // include tls conditionally since it is not always available @@ -17,6 +16,7 @@ const debug = debuglog('undici:socks5-proxy') const kProxyUrl = Symbol('proxy url') const kProxyHeaders = Symbol('proxy headers') const kProxyAuth = Symbol('proxy auth') +const kProxyProtocol = Symbol('proxy protocol') const kPools = Symbol('pools') const kConnector = Symbol('connector') @@ -52,6 +52,7 @@ class Socks5ProxyAgent extends DispatcherBase { this[kProxyUrl] = url this[kProxyHeaders] = options.headers || {} + this[kProxyProtocol] = options.proxyTls ? 'https:' : 'http:' // Extract auth from URL or options this[kProxyAuth] = { @@ -81,25 +82,20 @@ class Socks5ProxyAgent extends DispatcherBase { // Connect to the SOCKS5 proxy const socketReady = Promise.withResolvers() - const onSocketConnect = () => { - socket.removeListener('error', onSocketError) - socketReady.resolve(socket) - } - - const onSocketError = (err) => { - socket.removeListener('connect', onSocketConnect) - socketReady.reject(err) - } - - const socket = net.connect({ + this[kConnector]({ + hostname: proxyHost, host: proxyHost, - port: proxyPort + port: proxyPort, + protocol: this[kProxyProtocol] + }, (err, socket) => { + if (err) { + socketReady.reject(err) + } else { + socketReady.resolve(socket) + } }) - socket.once('connect', onSocketConnect) - socket.once('error', onSocketError) - - await socketReady.promise + const socket = await socketReady.promise // Create SOCKS5 client const socks5Client = new Socks5Client(socket, this[kProxyAuth]) @@ -177,7 +173,7 @@ class Socks5ProxyAgent extends DispatcherBase { /** * Dispatch a request through the SOCKS5 proxy */ - async [kDispatch] (opts, handler) { + [kDispatch] (opts, handler) { const { origin } = opts debug('dispatching request to', origin, 'via SOCKS5') @@ -234,8 +230,12 @@ class Socks5ProxyAgent extends DispatcherBase { return pool[kDispatch](opts, handler) } catch (err) { debug('dispatch error:', err) - if (typeof handler.onError === 'function') { + if (typeof handler.onResponseError === 'function') { + handler.onResponseError(null, err) + return false + } else if (typeof handler.onError === 'function') { handler.onError(err) + return false } else { throw err } diff --git a/deps/undici/src/lib/handler/retry-handler.js b/deps/undici/src/lib/handler/retry-handler.js index ee2f69a2043e69..7ec506e21ebf5b 100644 --- a/deps/undici/src/lib/handler/retry-handler.js +++ b/deps/undici/src/lib/handler/retry-handler.js @@ -68,6 +68,8 @@ class RetryHandler { this.start = 0 this.end = null this.etag = null + this.statusCode = null + this.headers = null } onResponseStartWithRetry (controller, statusCode, headers, statusMessage, err) { @@ -183,6 +185,8 @@ class RetryHandler { onResponseStart (controller, statusCode, headers, statusMessage) { this.error = null this.retryCount += 1 + this.statusCode = statusCode + this.headers = headers if (statusCode >= 300) { const err = new RequestRetryError('Request failed', statusCode, { @@ -320,6 +324,16 @@ class RetryHandler { } if (!this.error) { + // Verify that the received body length matches the expected range + // when we have a finite end position (from Content-Length or Content-Range) + if (this.end != null && Number.isFinite(this.end)) { + if (this.start !== this.end + 1) { + throw new RequestRetryError('Content-Range mismatch', this.statusCode, { + headers: this.headers, + data: { count: this.retryCount } + }) + } + } this.retryCount = 0 return this.handler.onResponseEnd?.(controller, trailers) } diff --git a/deps/undici/src/lib/llhttp/wasm_build_env.txt b/deps/undici/src/lib/llhttp/wasm_build_env.txt index 7440bdcb1b3820..3ba57f70d8d37e 100644 --- a/deps/undici/src/lib/llhttp/wasm_build_env.txt +++ b/deps/undici/src/lib/llhttp/wasm_build_env.txt @@ -1,5 +1,5 @@ -> undici@8.2.0 build:wasm +> undici@8.3.0 build:wasm > node build/wasm.js --docker > docker run --rm --platform=linux/x86_64 --user 1001:1001 --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/lib/llhttp,target=/home/node/build/lib/llhttp --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/build,target=/home/node/build/build --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/deps,target=/home/node/build/deps -t ghcr.io/nodejs/wasm-builder@sha256:975f391d907e42a75b8c72eb77c782181e941608687d4d8694c3e9df415a0970 node build/wasm.js diff --git a/deps/undici/src/lib/mock/mock-utils.js b/deps/undici/src/lib/mock/mock-utils.js index 1022405d239aff..5b6b5bd79cfa56 100644 --- a/deps/undici/src/lib/mock/mock-utils.js +++ b/deps/undici/src/lib/mock/mock-utils.js @@ -424,7 +424,9 @@ function buildMockDispatch () { throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)${interceptsMessage}`) } if (checkNetConnect(netConnect, origin)) { - originalDispatch.call(this, opts, handler) + originalDispatch.call(this, '__mockAgentBodyForDispatch' in opts + ? { ...opts, body: opts.__mockAgentBodyForDispatch } + : opts, handler) } else { throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)${interceptsMessage}`) } diff --git a/deps/undici/src/lib/mock/snapshot-agent.js b/deps/undici/src/lib/mock/snapshot-agent.js index a3aee68cb2db0f..362745c414c158 100644 --- a/deps/undici/src/lib/mock/snapshot-agent.js +++ b/deps/undici/src/lib/mock/snapshot-agent.js @@ -55,7 +55,9 @@ class SnapshotAgent extends MockAgent { ignoreHeaders: opts.ignoreHeaders, excludeHeaders: opts.excludeHeaders, matchBody: opts.matchBody, + normalizeBody: opts.normalizeBody, matchQuery: opts.matchQuery, + normalizeQuery: opts.normalizeQuery, caseSensitive: opts.caseSensitive, shouldRecord: opts.shouldRecord, shouldPlayback: opts.shouldPlayback, diff --git a/deps/undici/src/lib/mock/snapshot-recorder.js b/deps/undici/src/lib/mock/snapshot-recorder.js index b5d07fae381cd2..57a7e7a41dd0dd 100644 --- a/deps/undici/src/lib/mock/snapshot-recorder.js +++ b/deps/undici/src/lib/mock/snapshot-recorder.js @@ -46,7 +46,9 @@ const { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = * @property {Array} [ignoreHeaders=[]] - Headers to ignore for matching * @property {Array} [excludeHeaders=[]] - Headers to exclude from matching * @property {boolean} [matchBody=true] - Whether to match request body - * @property {boolean} [matchQuery=true] - Whether to match query properties + * @property {(body: string|Buffer|null|undefined) => string} [normalizeBody] - Function to normalize the body before matching (e.g. strip timestamps) + * @property {boolean} [matchQuery=true] - Whether to match query parameters + * @property {(query: URLSearchParams) => string} [normalizeQuery] - Function to normalize query parameters before matching (e.g. strip volatile params) * @property {boolean} [caseSensitive=false] - Whether header matching is case-sensitive */ @@ -79,6 +81,37 @@ const { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = * @property {string} timestamp - ISO timestamp of when the snapshot was created */ +/** + * Normalizes the URL string used for request matching. + * + * @param {URL} url - Parsed request URL + * @param {boolean} matchQuery - Whether to include query parameters in matching + * @param {((query: URLSearchParams) => string)|undefined} normalizeQuery - Optional normalization function + * @returns {string} - URL string for hashing + */ +function normalizeUrlForMatching (url, matchQuery, normalizeQuery) { + if (matchQuery === false) return `${url.origin}${url.pathname}` + if (normalizeQuery) { + const normalized = String(normalizeQuery(url.searchParams) ?? '') + return normalized ? `${url.origin}${url.pathname}?${normalized}` : `${url.origin}${url.pathname}` + } + return url.toString() +} + +/** + * Normalizes the body value used for request matching. + * + * @param {string|Buffer|null|undefined} body - Raw request body + * @param {boolean} matchBody - Whether to include the body in matching + * @param {((body: string|Buffer|null|undefined) => string)|undefined} normalizeBody - Optional normalization function + * @returns {string} - Body string for hashing + */ +function normalizeBodyForMatching (body, matchBody, normalizeBody) { + if (matchBody === false) return '' + if (normalizeBody) return String(normalizeBody(body) ?? '') + return body ? String(body) : '' +} + /** * Formats a request for consistent snapshot storage * Caches normalized headers to avoid repeated processing @@ -99,9 +132,9 @@ function formatRequestKey (opts, headerFilters, matchOptions = {}) { return { method: opts.method || 'GET', - url: matchOptions.matchQuery !== false ? url.toString() : `${url.origin}${url.pathname}`, + url: normalizeUrlForMatching(url, matchOptions.matchQuery, matchOptions.normalizeQuery), headers: filterHeadersForMatching(normalized, headerFilters, matchOptions), - body: matchOptions.matchBody !== false && opts.body ? String(opts.body) : '' + body: normalizeBodyForMatching(opts.body, matchOptions.matchBody, matchOptions.normalizeBody) } } @@ -250,7 +283,9 @@ class SnapshotRecorder { ignoreHeaders: options.ignoreHeaders || [], excludeHeaders: options.excludeHeaders || [], matchBody: options.matchBody !== false, // default: true + normalizeBody: options.normalizeBody || undefined, matchQuery: options.matchQuery !== false, // default: true + normalizeQuery: options.normalizeQuery || undefined, caseSensitive: options.caseSensitive || false } diff --git a/deps/undici/src/lib/web/fetch/body.js b/deps/undici/src/lib/web/fetch/body.js index 7e08b29fd6c9e9..525bafb2c3c56e 100644 --- a/deps/undici/src/lib/web/fetch/body.js +++ b/deps/undici/src/lib/web/fetch/body.js @@ -7,7 +7,7 @@ const { fullyReadBody, extractMimeType } = require('./util') -const { FormData, setFormDataState } = require('./formdata') +const { FormData, setFormDataState, getFormDataBoundary } = require('./formdata') const { webidl } = require('../webidl') const assert = require('node:assert') const { isErrored, isDisturbed } = require('node:stream') @@ -16,11 +16,6 @@ const { serializeAMimeType } = require('./data-url') const { multipartFormDataParser } = require('./formdata-parser') const { parseJSONFromBytes } = require('../infra') const { utf8DecodeBytes } = require('../../encoding') -const { runtimeFeatures } = require('../../util/runtime-features.js') - -const random = runtimeFeatures.has('crypto') - ? require('node:crypto').randomInt - : (max) => Math.floor(Math.random() * max) const textEncoder = new TextEncoder() function noop () {} @@ -106,7 +101,7 @@ function extractBody (object, keepalive = false) { // Set source to a copy of the bytes held by object. source = webidl.util.getCopyOfBytesHeldByBufferSource(object) } else if (webidl.is.FormData(object)) { - const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}` + const boundary = getFormDataBoundary(object) const prefix = `--${boundary}\r\nContent-Disposition: form-data` /*! formdata-polyfill. MIT License. Jimmy Wärting */ diff --git a/deps/undici/src/lib/web/fetch/formdata.js b/deps/undici/src/lib/web/fetch/formdata.js index c21fb06a3eeb62..226bd32958775b 100644 --- a/deps/undici/src/lib/web/fetch/formdata.js +++ b/deps/undici/src/lib/web/fetch/formdata.js @@ -4,10 +4,16 @@ const { iteratorMixin } = require('./util') const { kEnumerableProperty } = require('../../core/util') const { webidl } = require('../webidl') const nodeUtil = require('node:util') +const { runtimeFeatures } = require('../../util/runtime-features.js') + +const random = runtimeFeatures.has('crypto') + ? require('node:crypto').randomInt + : (max) => Math.floor(Math.random() * max) // https://xhr.spec.whatwg.org/#formdata class FormData { #state = [] + #boundary = null constructor (form = undefined) { webidl.util.markAsUncloneable(this) @@ -192,11 +198,24 @@ class FormData { static setFormDataState (formData, newState) { formData.#state = newState } + + /** + * @param {FormData} formData + * @returns {string | null} + */ + static getFormDataBoundary (formData) { + const boundary = formData.#boundary + if (boundary != null) return boundary + + // eslint-disable-next-line no-return-assign + return formData.#boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}` + } } -const { getFormDataState, setFormDataState } = FormData +const { getFormDataState, setFormDataState, getFormDataBoundary } = FormData Reflect.deleteProperty(FormData, 'getFormDataState') Reflect.deleteProperty(FormData, 'setFormDataState') +Reflect.deleteProperty(FormData, 'getFormDataBoundary') iteratorMixin('FormData', FormData, getFormDataState, 'name', 'value') @@ -256,4 +275,4 @@ function makeEntry (name, value, filename) { webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData) -module.exports = { FormData, makeEntry, setFormDataState } +module.exports = { FormData, makeEntry, setFormDataState, getFormDataBoundary } diff --git a/deps/undici/src/lib/web/fetch/index.js b/deps/undici/src/lib/web/fetch/index.js index 33d7761cecda9f..1959f27c04aa96 100644 --- a/deps/undici/src/lib/web/fetch/index.js +++ b/deps/undici/src/lib/web/fetch/index.js @@ -2184,6 +2184,8 @@ async function httpNetworkFetch ( origin: url.origin, method: request.method, body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body, + // Preserve the serialized fetch body for MockAgent net-connect fallthroughs. + __mockAgentBodyForDispatch: body, headers: request.headersList.entries, maxRedirections: 0, upgrade: request.mode === 'websocket' ? 'websocket' : undefined, diff --git a/deps/undici/src/package-lock.json b/deps/undici/src/package-lock.json index 30097844c87d07..dcfc6ca55f2bff 100644 --- a/deps/undici/src/package-lock.json +++ b/deps/undici/src/package-lock.json @@ -1,12 +1,12 @@ { "name": "undici", - "version": "8.2.0", + "version": "8.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "undici", - "version": "8.2.0", + "version": "8.3.0", "license": "MIT", "devDependencies": { "@fastify/busboy": "3.2.0", @@ -15,8 +15,8 @@ "@sinonjs/fake-timers": "^12.0.0", "@types/node": "^22.0.0", "abort-controller": "^3.0.0", - "borp": "^0.20.0", - "c8": "^10.0.0", + "borp": "^1.0.0", + "c8": "^11.0.0", "cross-env": "^10.0.0", "dns-packet": "^5.4.0", "esbuild": "^0.28.0", @@ -25,7 +25,7 @@ "husky": "^9.0.7", "jest": "^30.0.5", "jsondiffpatch": "^0.7.3", - "neostandard": "^0.12.0", + "neostandard": "^0.13.0", "node-forge": "^1.3.1", "proxy": "^4.0.0", "tsd": "^0.33.0", @@ -91,9 +91,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", - "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.3.tgz", + "integrity": "sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg==", "dev": true, "license": "MIT", "engines": { @@ -262,9 +262,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", - "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz", + "integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==", "dev": true, "license": "MIT", "dependencies": { @@ -582,9 +582,9 @@ "license": "Apache-2.0" }, "node_modules/@emnapi/core": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz", - "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", "dev": true, "license": "MIT", "optional": true, @@ -594,9 +594,9 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz", - "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", "dev": true, "license": "MIT", "optional": true, @@ -1424,17 +1424,17 @@ } }, "node_modules/@jest/console": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.3.0.tgz", - "integrity": "sha512-PAwCvFJ4696XP2qZj+LAn1BWjZaJ6RjG6c7/lkMaUJnkyMS34ucuIsfqYvfskVNvUI27R/u4P1HMYFnlVXG/Ww==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.4.1.tgz", + "integrity": "sha512-v3bhyxUh9Hgmo5p6hAOXe14/R3ZxZDOsvHleh4B07z3m/x4/ngPUXEm9XwK4sF4u+f+P2ORb0Ge+MgpaqRMVDA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "@types/node": "*", "chalk": "^4.1.2", - "jest-message-util": "30.3.0", - "jest-util": "30.3.0", + "jest-message-util": "30.4.1", + "jest-util": "30.4.1", "slash": "^3.0.0" }, "engines": { @@ -1442,38 +1442,39 @@ } }, "node_modules/@jest/core": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.3.0.tgz", - "integrity": "sha512-U5mVPsBxLSO6xYbf+tgkymLx+iAhvZX43/xI1+ej2ZOPnPdkdO1CzDmFKh2mZBn2s4XZixszHeQnzp1gm/DIxw==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.4.2.tgz", + "integrity": "sha512-TZJA6cPJUFxoWhxaLo8t0VX/MZX2wPWr0uIDvLSHIvN4gu9h02vSzqI2kBADG1ExqQlC+cY09xKMSreivvrChQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.3.0", - "@jest/pattern": "30.0.1", - "@jest/reporters": "30.3.0", - "@jest/test-result": "30.3.0", - "@jest/transform": "30.3.0", - "@jest/types": "30.3.0", + "@jest/console": "30.4.1", + "@jest/pattern": "30.4.0", + "@jest/reporters": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", "ci-info": "^4.2.0", "exit-x": "^0.2.2", + "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-changed-files": "30.3.0", - "jest-config": "30.3.0", - "jest-haste-map": "30.3.0", - "jest-message-util": "30.3.0", - "jest-regex-util": "30.0.1", - "jest-resolve": "30.3.0", - "jest-resolve-dependencies": "30.3.0", - "jest-runner": "30.3.0", - "jest-runtime": "30.3.0", - "jest-snapshot": "30.3.0", - "jest-util": "30.3.0", - "jest-validate": "30.3.0", - "jest-watcher": "30.3.0", - "pretty-format": "30.3.0", + "jest-changed-files": "30.4.1", + "jest-config": "30.4.2", + "jest-haste-map": "30.4.1", + "jest-message-util": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-resolve": "30.4.1", + "jest-resolve-dependencies": "30.4.2", + "jest-runner": "30.4.2", + "jest-runtime": "30.4.2", + "jest-snapshot": "30.4.1", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", + "jest-watcher": "30.4.1", + "pretty-format": "30.4.1", "slash": "^3.0.0" }, "engines": { @@ -1489,9 +1490,9 @@ } }, "node_modules/@jest/diff-sequences": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.3.0.tgz", - "integrity": "sha512-cG51MVnLq1ecVUaQ3fr6YuuAOitHK1S4WUJHnsPFE/quQr33ADUx1FfrTCpMCRxvy0Yr9BThKpDjSlcTi91tMA==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.4.0.tgz", + "integrity": "sha512-zOpzlfUs45l6u7jm39qr87JCHUDsaeCtvL+kQe/Vn9jSnRB4/5IPXISm0h9I1vZW/o00Kn4UTJ2MOlhnUGwv3g==", "dev": true, "license": "MIT", "engines": { @@ -1499,39 +1500,39 @@ } }, "node_modules/@jest/environment": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.3.0.tgz", - "integrity": "sha512-SlLSF4Be735yQXyh2+mctBOzNDx5s5uLv88/j8Qn1wH679PDcwy67+YdADn8NJnGjzlXtN62asGH/T4vWOkfaw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.4.1.tgz", + "integrity": "sha512-AK9yNRqgKxiabqMoe4oW+3/TSSeV8vkdC7BGaxZdU0AFXfOpofTLqdru2GXKZghP3sdgwE9XXpnVwfZ8JnFV4w==", "dev": true, "license": "MIT", "dependencies": { - "@jest/fake-timers": "30.3.0", - "@jest/types": "30.3.0", + "@jest/fake-timers": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "jest-mock": "30.3.0" + "jest-mock": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.3.0.tgz", - "integrity": "sha512-76Nlh4xJxk2D/9URCn3wFi98d2hb19uWE1idLsTt2ywhvdOldbw3S570hBgn25P4ICUZ/cBjybrBex2g17IDbg==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.4.1.tgz", + "integrity": "sha512-ginrj6TMgh2GshLUGCjO94Ptx9HhdZA/I6A9iUfyeLKFtdAjnKzHDgzgP9HYQgbxM1lbXScQ2eUBz2lGeVDPWA==", "dev": true, "license": "MIT", "dependencies": { - "expect": "30.3.0", - "jest-snapshot": "30.3.0" + "expect": "30.4.1", + "jest-snapshot": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.3.0.tgz", - "integrity": "sha512-j0+W5iQQ8hBh7tHZkTQv3q2Fh/M7Je72cIsYqC4OaktgtO7v1So9UTjp6uPBHIaB6beoF/RRsCgMJKvti0wADA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.4.1.tgz", + "integrity": "sha512-ZBn5CglH8fBsQsvs4VWNzD4aWfUYks+IdOOQU3MEK71ol/BcVm+P+rtb1KpiFBpSWSCE27uOahyyf1vfqOVbcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1542,27 +1543,27 @@ } }, "node_modules/@jest/fake-timers": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.3.0.tgz", - "integrity": "sha512-WUQDs8SOP9URStX1DzhD425CqbN/HxUYCTwVrT8sTVBfMvFqYt/s61EK5T05qnHu0po6RitXIvP9otZxYDzTGQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.4.1.tgz", + "integrity": "sha512-iW5umdmfPeWzehrVhugFQZqCchSCud5S1l2YT0O9ZhjRR0ExclANDZkiSBwzqtnlOn0J1JXvO+HZ6rkuyOVOgQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.3.0", - "@sinonjs/fake-timers": "^15.0.0", + "@jest/types": "30.4.1", + "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", - "jest-message-util": "30.3.0", - "jest-mock": "30.3.0", - "jest-util": "30.3.0" + "jest-message-util": "30.4.1", + "jest-mock": "30.4.1", + "jest-util": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/fake-timers/node_modules/@sinonjs/fake-timers": { - "version": "15.3.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.3.2.tgz", - "integrity": "sha512-mrn35Jl2pCpns+mE3HaZa1yPN5EYCRgiMI+135COjr2hr8Cls9DXqIZ57vZe2cz7y2XVSq92tcs6kGQcT1J8Rw==", + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.4.0.tgz", + "integrity": "sha512-DsG+8/LscQIQg68J6Ef3dv10u6nVyetYn923s3/sus5eaGfTo1of5WMZSLf0UJc9KDuKPilPH0UDJCjvNbDNCA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -1580,47 +1581,47 @@ } }, "node_modules/@jest/globals": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.3.0.tgz", - "integrity": "sha512-+owLCBBdfpgL3HU+BD5etr1SvbXpSitJK0is1kiYjJxAAJggYMRQz5hSdd5pq1sSggfxPbw2ld71pt4x5wwViA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.4.1.tgz", + "integrity": "sha512-ZbuY4cmXC8DkxYjfvT2DbcHWL2T6vmsMhXCDcmTB2T0y0gaezBI77ufq5ZAIdcRkYZ7NEQEDg1xFeKbxUJ5v5Q==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.3.0", - "@jest/expect": "30.3.0", - "@jest/types": "30.3.0", - "jest-mock": "30.3.0" + "@jest/environment": "30.4.1", + "@jest/expect": "30.4.1", + "@jest/types": "30.4.1", + "jest-mock": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/pattern": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz", - "integrity": "sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.4.0.tgz", + "integrity": "sha512-RAWn3+f9u8BsHijKJ71uHcFp6vmyEt6VvoWXkl6hKF3qVIuWNmudVjg12DlBPGup/frIl5UcUlH5HfEuvHpEXg==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", - "jest-regex-util": "30.0.1" + "jest-regex-util": "30.4.0" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/reporters": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.3.0.tgz", - "integrity": "sha512-a09z89S+PkQnL055bVj8+pe2Caed2PBOaczHcXCykW5ngxX9EWx/1uAwncxc/HiU0oZqfwseMjyhxgRjS49qPw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.4.1.tgz", + "integrity": "sha512-/SnkPCzEQpUaBH81kjdEdDdo2WZl5hxw+BmLDGWjRkm8o7XlhjwsU36cqwe5PGBE5WYpBvDzRSdXx9rbGuJtNA==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "30.3.0", - "@jest/test-result": "30.3.0", - "@jest/transform": "30.3.0", - "@jest/types": "30.3.0", + "@jest/console": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "@jridgewell/trace-mapping": "^0.3.25", "@types/node": "*", "chalk": "^4.1.2", @@ -1633,9 +1634,9 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^5.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "30.3.0", - "jest-util": "30.3.0", - "jest-worker": "30.3.0", + "jest-message-util": "30.4.1", + "jest-util": "30.4.1", + "jest-worker": "30.4.1", "slash": "^3.0.0", "string-length": "^4.0.2", "v8-to-istanbul": "^9.0.1" @@ -1660,9 +1661,9 @@ "license": "MIT" }, "node_modules/@jest/schemas": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", - "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.4.1.tgz", + "integrity": "sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==", "dev": true, "license": "MIT", "dependencies": { @@ -1673,13 +1674,13 @@ } }, "node_modules/@jest/snapshot-utils": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.3.0.tgz", - "integrity": "sha512-ORbRN9sf5PP82v3FXNSwmO1OTDR2vzR2YTaR+E3VkSBZ8zadQE6IqYdYEeFH1NIkeB2HIGdF02dapb6K0Mj05g==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.4.1.tgz", + "integrity": "sha512-ObY4ljvQ95mt6iwKtVLetR/4yXiAgl3H4nJxhztr0MTjrN97TwDYrnCp/kF60Ec9HdhkWTHSu+Hg05aXfngpOA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", "natural-compare": "^1.4.0" @@ -1704,14 +1705,14 @@ } }, "node_modules/@jest/test-result": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.3.0.tgz", - "integrity": "sha512-e/52nJGuD74AKTSe0P4y5wFRlaXP0qmrS17rqOMHeSwm278VyNyXE3gFO/4DTGF9w+65ra3lo3VKj0LBrzmgdQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.4.1.tgz", + "integrity": "sha512-/ZG7pgEiOmmWkN9TplKbOu4id2N5lh7FHwRwlkgBVAzGdRH+OkkQ8wX/kIxg4zmd3ZQvAL1RwL2yWsvNYYECTw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.3.0", - "@jest/types": "30.3.0", + "@jest/console": "30.4.1", + "@jest/types": "30.4.1", "@types/istanbul-lib-coverage": "^2.0.6", "collect-v8-coverage": "^1.0.2" }, @@ -1720,15 +1721,15 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.3.0.tgz", - "integrity": "sha512-dgbWy9b8QDlQeRZcv7LNF+/jFiiYHTKho1xirauZ7kVwY7avjFF6uTT0RqlgudB5OuIPagFdVtfFMosjVbk1eA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.4.1.tgz", + "integrity": "sha512-PeYE+4td5rKjoRPxztObrXU+H8hsjZfxKMXOcmrr34JerSyB/ROOxbbicz8B7A5j9R9VayDnVPvBmedqCsFCdw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.3.0", + "@jest/test-result": "30.4.1", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.3.0", + "jest-haste-map": "30.4.1", "slash": "^3.0.0" }, "engines": { @@ -1736,23 +1737,23 @@ } }, "node_modules/@jest/transform": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.3.0.tgz", - "integrity": "sha512-TLKY33fSLVd/lKB2YI1pH69ijyUblO/BQvCj566YvnwuzoTNr648iE0j22vRvVNk2HsPwByPxATg3MleS3gf5A==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.4.1.tgz", + "integrity": "sha512-Wz0LyktlTvRefoymh+n64hQ84KNXsRGcwdoZ8CSa0Ea+fgYcHZlnk+hDP7v2MS7il2bQ5uTEIxf4/NNfhMN4KQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "@jridgewell/trace-mapping": "^0.3.25", "babel-plugin-istanbul": "^7.0.1", "chalk": "^4.1.2", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.3.0", - "jest-regex-util": "30.0.1", - "jest-util": "30.3.0", + "jest-haste-map": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-util": "30.4.1", "pirates": "^4.0.7", "slash": "^3.0.0", "write-file-atomic": "^5.0.1" @@ -1762,14 +1763,14 @@ } }, "node_modules/@jest/types": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.3.0.tgz", - "integrity": "sha512-JHm87k7bA33hpBngtU8h6UBub/fqqA9uXfw+21j5Hmk7ooPHlboRNxHq0JcMtC+n8VJGP1mcfnD3Mk+XKe1oSw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.4.1.tgz", + "integrity": "sha512-f1x/vJXIfjOlEmejYpbkbgw1gOqpPECwMvMEtBqe47j7H2Hg8h8w3o3ikhSXq3MI15kg+oQ0exWO0uCtTNJLoQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/pattern": "30.0.1", - "@jest/schemas": "30.0.5", + "@jest/pattern": "30.4.0", + "@jest/schemas": "30.4.1", "@types/istanbul-lib-coverage": "^2.0.6", "@types/istanbul-reports": "^3.0.4", "@types/node": "*", @@ -1909,23 +1910,6 @@ "node": ">= 8" } }, - "node_modules/@nolyfill/is-core-module": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", - "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.4.0" - } - }, - "node_modules/@package-json/types": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@package-json/types/-/types-0.0.12.tgz", - "integrity": "sha512-uu43FGU34B5VM9mCNjXCwLaGHYjXdNincqKLaraaCW+7S2+SmiBg1Nv8bPnmschrIfZmfKNY9f3fC376MRrObw==", - "dev": true, - "license": "MIT" - }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -2039,9 +2023,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", - "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", "dev": true, "license": "MIT", "optional": true, @@ -2490,9 +2474,9 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.1.tgz", + "integrity": "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ==", "dev": true, "license": "ISC" }, @@ -2602,9 +2586,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2619,9 +2600,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2636,9 +2614,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2653,9 +2628,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2670,9 +2642,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2687,9 +2656,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2704,9 +2670,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2721,9 +2684,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -3220,16 +3180,16 @@ } }, "node_modules/babel-jest": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.3.0.tgz", - "integrity": "sha512-gRpauEU2KRrCox5Z296aeVHR4jQ98BCnu0IO332D/xpHNOsIH/bgSRk9k6GbKIbBw8vFeN6ctuu6tV8WOyVfYQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.4.1.tgz", + "integrity": "sha512-fATAbM8piYxkiXQp3RBXmZHxZVNJZAVXXfyeyCN2Tida3+qJ8ea9UxhiJ2y4fLO90ZImKt6k9FlcH2+rLkJGhw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/transform": "30.3.0", + "@jest/transform": "30.4.1", "@types/babel__core": "^7.20.5", "babel-plugin-istanbul": "^7.0.1", - "babel-preset-jest": "30.3.0", + "babel-preset-jest": "30.4.0", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", "slash": "^3.0.0" @@ -3299,9 +3259,9 @@ } }, "node_modules/babel-plugin-jest-hoist": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.3.0.tgz", - "integrity": "sha512-+TRkByhsws6sfPjVaitzadk1I0F5sPvOVUH5tyTSzhePpsGIVrdeunHSw/C36QeocS95OOk8lunc4rlu5Anwsg==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.4.0.tgz", + "integrity": "sha512-9EdtWM/sSfXLOGLwSn+GS6pIXyBnL07/8gyJlwFXjWy4DxMOyItqyUT29d4lQiS380EZwYlX7/At4PgBS+m2aA==", "dev": true, "license": "MIT", "dependencies": { @@ -3339,13 +3299,13 @@ } }, "node_modules/babel-preset-jest": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.3.0.tgz", - "integrity": "sha512-6ZcUbWHC+dMz2vfzdNwi87Z1gQsLNK2uLuK1Q89R11xdvejcivlYYwDlEv0FHX3VwEXpbBQ9uufB/MUNpZGfhQ==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.4.0.tgz", + "integrity": "sha512-lBY4jxsNmCnSiu7kquw8ZC9F4+XLMOKypT3RnNHPvU2Kpd4W0xaPuLr5ZkRyOsvLYAY4yaW1ZwTW4xB7NIiZzg==", "dev": true, "license": "MIT", "dependencies": { - "babel-plugin-jest-hoist": "30.3.0", + "babel-plugin-jest-hoist": "30.4.0", "babel-preset-current-node-syntax": "^1.2.0" }, "engines": { @@ -3363,9 +3323,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.18", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.18.tgz", - "integrity": "sha512-VSnGQAOLtP5mib/DPyg2/t+Tlv65NTBz83BJBJvmLVHHuKJVaDOBvJJykiT5TR++em5nfAySPccDZDa4oSrn8A==", + "version": "2.10.29", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.29.tgz", + "integrity": "sha512-Asa2krT+XTPZINCS+2QcyS8WTkObE77RwkydwF7h6DmnKqbvlalz93m/dnphUyCa6SWSP51VgtEUf2FN+gelFQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -3382,9 +3342,9 @@ "dev": true }, "node_modules/borp": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/borp/-/borp-0.20.2.tgz", - "integrity": "sha512-WJl/vYU6KoD0SyppDWPCdgrrTt2e+hCqTk5443fOUD92cbHLDLIcVRVRh8FIP0uhJjcZQ82Ky0XhB7Kyh32d/w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/borp/-/borp-1.0.0.tgz", + "integrity": "sha512-ooi3bLC8hQRGfthud3BWqS1A98X7NuQqAgGgX6mn5l6Gu6aeHJ7sjpS9gQhHLx+ju026hcc0BEPLRg1obxB1gw==", "dev": true, "license": "MIT", "dependencies": { @@ -3397,6 +3357,156 @@ }, "bin": { "borp": "borp.js" + }, + "engines": { + "node": ">=22.6.0" + } + }, + "node_modules/borp/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/borp/node_modules/brace-expansion": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", + "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/borp/node_modules/c8": { + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz", + "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@bcoe/v8-coverage": "^1.0.1", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/borp/node_modules/c8/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/borp/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/borp/node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/borp/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/borp/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/borp/node_modules/test-exclude": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.2.tgz", + "integrity": "sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^10.2.2" + }, + "engines": { + "node": ">=18" } }, "node_modules/brace-expansion": { @@ -3475,9 +3585,9 @@ "license": "MIT" }, "node_modules/c8": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz", - "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-11.0.0.tgz", + "integrity": "sha512-e/uRViGHSVIJv7zsaDKM7VRn2390TgHXqUSvYwPHBQaU6L7E9L0n9JbdkwdYPvshDT0KymBmmlwSpms3yBaMNg==", "dev": true, "license": "ISC", "dependencies": { @@ -3488,7 +3598,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "test-exclude": "^7.0.1", + "test-exclude": "^8.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", "yargs-parser": "^21.1.1" @@ -3497,7 +3607,7 @@ "c8": "bin/c8.js" }, "engines": { - "node": ">=18" + "node": "20 || >=22" }, "peerDependencies": { "monocart-coverage-reports": "^2" @@ -3656,9 +3766,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001788", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001788.tgz", - "integrity": "sha512-6q8HFp+lOQtcf7wBK+uEenxymVWkGKkjFpCvw5W25cmMwEDU45p1xQFBQv8JDlMMry7eNxyBaR+qxgmTUZkIRQ==", + "version": "1.0.30001792", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001792.tgz", + "integrity": "sha512-hVLMUZFgR4JJ6ACt1uEESvQN1/dBVqPAKY0hgrV70eN3391K6juAfTjKZLKvOMsx8PxA7gsY1/tLMMTcfFLLpw==", "dev": true, "funding": [ { @@ -3842,16 +3952,6 @@ "dev": true, "license": "MIT" }, - "node_modules/comment-parser": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.6.tgz", - "integrity": "sha512-ObxuY6vnbWTN6Od72xfwN9DbzC7Y2vv8u1Soi9ahRKL37gb6y1qk6/dgjs+3JWuXJHWvsg3BXIwzd/rkmAwavg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12.0.0" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4158,9 +4258,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.336", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.336.tgz", - "integrity": "sha512-AbH9q9J455r/nLmdNZes0G0ZKcRX73FicwowalLs6ijwOmCJSRRrLX63lcAlzy9ux3dWK1w1+1nsBJEWN11hcQ==", + "version": "1.5.354", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.354.tgz", + "integrity": "sha512-JaBHwWcfIdmSAfWM5l3uwjGd431j8YEMikZ+K/2nXVuBqJKyZ0f+2h4n4JY5AyNiZmnY9qQr2RU3v9DxDmHMNg==", "dev": true, "license": "ISC" }, @@ -4607,66 +4707,6 @@ "node": ">=8" } }, - "node_modules/eslint-import-context": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.1.9.tgz", - "integrity": "sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-tsconfig": "^4.10.1", - "stable-hash-x": "^0.2.0" - }, - "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-import-context" - }, - "peerDependencies": { - "unrs-resolver": "^1.0.0" - }, - "peerDependenciesMeta": { - "unrs-resolver": { - "optional": true - } - } - }, - "node_modules/eslint-import-resolver-typescript": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.10.1.tgz", - "integrity": "sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@nolyfill/is-core-module": "1.0.39", - "debug": "^4.4.0", - "get-tsconfig": "^4.10.0", - "is-bun-module": "^2.0.0", - "stable-hash": "^0.0.5", - "tinyglobby": "^0.2.13", - "unrs-resolver": "^1.6.2" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-import-resolver-typescript" - }, - "peerDependencies": { - "eslint": "*", - "eslint-plugin-import": "*", - "eslint-plugin-import-x": "*" - }, - "peerDependenciesMeta": { - "eslint-plugin-import": { - "optional": true - }, - "eslint-plugin-import-x": { - "optional": true - } - } - }, "node_modules/eslint-plugin-es-x": { "version": "7.8.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz", @@ -4689,96 +4729,6 @@ "eslint": ">=8" } }, - "node_modules/eslint-plugin-import-x": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.16.2.tgz", - "integrity": "sha512-rM9K8UBHcWKpzQzStn1YRN2T5NvdeIfSVoKu/lKF41znQXHAUcBbYXe5wd6GNjZjTrP7viQ49n1D83x/2gYgIw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@package-json/types": "^0.0.12", - "@typescript-eslint/types": "^8.56.0", - "comment-parser": "^1.4.1", - "debug": "^4.4.1", - "eslint-import-context": "^0.1.9", - "is-glob": "^4.0.3", - "minimatch": "^9.0.3 || ^10.1.2", - "semver": "^7.7.2", - "stable-hash-x": "^0.2.0", - "unrs-resolver": "^1.9.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-plugin-import-x" - }, - "peerDependencies": { - "@typescript-eslint/utils": "^8.56.0", - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "eslint-import-resolver-node": "*" - }, - "peerDependenciesMeta": { - "@typescript-eslint/utils": { - "optional": true - }, - "eslint-import-resolver-node": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-import-x/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/eslint-plugin-import-x/node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/eslint-plugin-import-x/node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/eslint-plugin-import-x/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-n": { "version": "17.24.0", "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.24.0.tgz", @@ -5106,27 +5056,27 @@ } }, "node_modules/expect": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.3.0.tgz", - "integrity": "sha512-1zQrciTiQfRdo7qJM1uG4navm8DayFa2TgCSRlzUyNkhcJ6XUZF3hjnpkyr3VhAqPH7i/9GkG7Tv5abz6fqz0Q==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.4.1.tgz", + "integrity": "sha512-PMARsyh/JtqC20HoGqlFcIlQAyqUtW4PlI1rup1uhYJtKuwAjbvWi3GQMAn+STdHum/dk8xrKfUM1+5SAwpolA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "30.3.0", + "@jest/expect-utils": "30.4.1", "@jest/get-type": "30.1.0", - "jest-matcher-utils": "30.3.0", - "jest-message-util": "30.3.0", - "jest-mock": "30.3.0", - "jest-util": "30.3.0" + "jest-matcher-utils": "30.4.1", + "jest-message-util": "30.4.1", + "jest-mock": "30.4.1", + "jest-util": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/fast-check": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.6.0.tgz", - "integrity": "sha512-h7H6Dm0Fy+H4ciQYFxFjXnXkzR2kr9Fb22c0UBpHnm59K2zpr2t13aPTHlltFiNT6zuxp6HMPAVVvgur4BLdpA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.8.0.tgz", + "integrity": "sha512-GOJ158CUMnN6cSahsv4+ExARvIDuzzinFjkp0E9WtiBa5zcVeLozVkWaE4IzFcc+Y48Wp1EDlUZsXRyAztQcSg==", "dev": true, "funding": [ { @@ -6037,29 +5987,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-bun-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", - "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.7.1" - } - }, - "node_modules/is-bun-module/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -6482,9 +6409,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", "dev": true, "license": "ISC", "bin": { @@ -6573,16 +6500,16 @@ } }, "node_modules/jest": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-30.3.0.tgz", - "integrity": "sha512-AkXIIFcaazymvey2i/+F94XRnM6TsVLZDhBMLsd1Sf/W0wzsvvpjeyUrCZD6HGG4SDYPgDJDBKeiJTBb10WzMg==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.4.2.tgz", + "integrity": "sha512-Yi1jqNC/Oq0N4hBgNH/YvBpP1P57QqundgytzYqy3yqAa7NZPNjSoi4SGbRAXDMdBzNE6xBCi5U7RgfrvMEUVQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.3.0", - "@jest/types": "30.3.0", + "@jest/core": "30.4.2", + "@jest/types": "30.4.1", "import-local": "^3.2.0", - "jest-cli": "30.3.0" + "jest-cli": "30.4.2" }, "bin": { "jest": "bin/jest.js" @@ -6600,14 +6527,14 @@ } }, "node_modules/jest-changed-files": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.3.0.tgz", - "integrity": "sha512-B/7Cny6cV5At6M25EWDgf9S617lHivamL8vl6KEpJqkStauzcG4e+WPfDgMMF+H4FVH4A2PLRyvgDJan4441QA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.4.1.tgz", + "integrity": "sha512-IuctmYrxi21iOSOaIXpJWalHyPAsVv0GeBHKDn8C1CA4W5htHn7INL+wdnL4Bo0+olEndvAFkmb++tIQJG+vvg==", "dev": true, "license": "MIT", "dependencies": { "execa": "^5.1.1", - "jest-util": "30.3.0", + "jest-util": "30.4.1", "p-limit": "^3.1.0" }, "engines": { @@ -6705,29 +6632,29 @@ } }, "node_modules/jest-circus": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.3.0.tgz", - "integrity": "sha512-PyXq5szeSfR/4f1lYqCmmQjh0vqDkURUYi9N6whnHjlRz4IUQfMcXkGLeEoiJtxtyPqgUaUUfyQlApXWBSN1RA==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.4.2.tgz", + "integrity": "sha512-rvHH7VlY6LgbJXJTQ87GW62g1FntOtbhh0zT+v04kC+pgL6aBKyYINXxWukCpj3dcIBMw5/XUbtDS9dU9JTXeQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.3.0", - "@jest/expect": "30.3.0", - "@jest/test-result": "30.3.0", - "@jest/types": "30.3.0", + "@jest/environment": "30.4.1", + "@jest/expect": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", "chalk": "^4.1.2", "co": "^4.6.0", "dedent": "^1.6.0", "is-generator-fn": "^2.1.0", - "jest-each": "30.3.0", - "jest-matcher-utils": "30.3.0", - "jest-message-util": "30.3.0", - "jest-runtime": "30.3.0", - "jest-snapshot": "30.3.0", - "jest-util": "30.3.0", + "jest-each": "30.4.1", + "jest-matcher-utils": "30.4.1", + "jest-message-util": "30.4.1", + "jest-runtime": "30.4.2", + "jest-snapshot": "30.4.1", + "jest-util": "30.4.1", "p-limit": "^3.1.0", - "pretty-format": "30.3.0", + "pretty-format": "30.4.1", "pure-rand": "^7.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.6" @@ -6754,21 +6681,21 @@ "license": "MIT" }, "node_modules/jest-cli": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.3.0.tgz", - "integrity": "sha512-l6Tqx+j1fDXJEW5bqYykDQQ7mQg+9mhWXtnj+tQZrTWYHyHoi6Be8HPumDSA+UiX2/2buEgjA58iJzdj146uCw==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.4.2.tgz", + "integrity": "sha512-jfA2ocvVHMXS2QijrJ0d31ektP+d/W0T5RpcTX2Pq+3sVqHlsXVCM2+FmwpL+bdY8OfHpIg9xMxLF17Zg0U49Q==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.3.0", - "@jest/test-result": "30.3.0", - "@jest/types": "30.3.0", + "@jest/core": "30.4.2", + "@jest/test-result": "30.4.1", + "@jest/types": "30.4.1", "chalk": "^4.1.2", "exit-x": "^0.2.2", "import-local": "^3.2.0", - "jest-config": "30.3.0", - "jest-util": "30.3.0", - "jest-validate": "30.3.0", + "jest-config": "30.4.2", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", "yargs": "^17.7.2" }, "bin": { @@ -6787,33 +6714,33 @@ } }, "node_modules/jest-config": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.3.0.tgz", - "integrity": "sha512-WPMAkMAtNDY9P/oKObtsRG/6KTrhtgPJoBTmk20uDn4Uy6/3EJnnaZJre/FMT1KVRx8cve1r7/FlMIOfRVWL4w==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.4.2.tgz", + "integrity": "sha512-rNHAShJQqQwFNoL0hbf3BphSBOWnpOUAKvidLS/AjNVLPfoj5mSf4jQMfW3cYOs6hXeZC7nF7mDHaBnbxELOzg==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@jest/get-type": "30.1.0", - "@jest/pattern": "30.0.1", - "@jest/test-sequencer": "30.3.0", - "@jest/types": "30.3.0", - "babel-jest": "30.3.0", + "@jest/pattern": "30.4.0", + "@jest/test-sequencer": "30.4.1", + "@jest/types": "30.4.1", + "babel-jest": "30.4.1", "chalk": "^4.1.2", "ci-info": "^4.2.0", "deepmerge": "^4.3.1", "glob": "^10.5.0", "graceful-fs": "^4.2.11", - "jest-circus": "30.3.0", - "jest-docblock": "30.2.0", - "jest-environment-node": "30.3.0", - "jest-regex-util": "30.0.1", - "jest-resolve": "30.3.0", - "jest-runner": "30.3.0", - "jest-util": "30.3.0", - "jest-validate": "30.3.0", + "jest-circus": "30.4.2", + "jest-docblock": "30.4.0", + "jest-environment-node": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-resolve": "30.4.1", + "jest-runner": "30.4.2", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", "parse-json": "^5.2.0", - "pretty-format": "30.3.0", + "pretty-format": "30.4.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -6838,25 +6765,25 @@ } }, "node_modules/jest-diff": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.3.0.tgz", - "integrity": "sha512-n3q4PDQjS4LrKxfWB3Z5KNk1XjXtZTBwQp71OP0Jo03Z6V60x++K5L8k6ZrW8MY8pOFylZvHM0zsjS1RqlHJZQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.4.1.tgz", + "integrity": "sha512-CRpFK0RtLriVDGcPPAnR6HMVI8bSR2jnUIgralhauzYQZIb4RH9AtEInTuQr65LmmGggGcRT6HIASxwqsVsmlA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/diff-sequences": "30.3.0", + "@jest/diff-sequences": "30.4.0", "@jest/get-type": "30.1.0", "chalk": "^4.1.2", - "pretty-format": "30.3.0" + "pretty-format": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-docblock": { - "version": "30.2.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.2.0.tgz", - "integrity": "sha512-tR/FFgZKS1CXluOQzZvNH3+0z9jXr3ldGSD8bhyuxvlVUwbeLOGynkunvlTMxchC5urrKndYiwCFC0DLVjpOCA==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.4.0.tgz", + "integrity": "sha512-ZPMabUZCx5MpbZ2eBYSvZ0J8fvo3dR9oM+eeUpb3aKNQFuS2tu3Duw1TNlMoP8k3WQgKGJuhcMFvwcVuq6T7oA==", "dev": true, "license": "MIT", "dependencies": { @@ -6867,36 +6794,36 @@ } }, "node_modules/jest-each": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.3.0.tgz", - "integrity": "sha512-V8eMndg/aZ+3LnCJgSm13IxS5XSBM22QSZc9BtPK8Dek6pm+hfUNfwBdvsB3d342bo1q7wnSkC38zjX259qZNA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.4.1.tgz", + "integrity": "sha512-/8MJbH6fuj48TstjrMf+u/pd06Qezz5xOXvZA6442heNOWr8bdeoGZX2d9fCn028CoMgYmroH9//zky5GfyYmA==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "chalk": "^4.1.2", - "jest-util": "30.3.0", - "pretty-format": "30.3.0" + "jest-util": "30.4.1", + "pretty-format": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-environment-node": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.3.0.tgz", - "integrity": "sha512-4i6HItw/JSiJVsC5q0hnKIe/hbYfZLVG9YJ/0pU9Hz2n/9qZe3Rhn5s5CUZA5ORZlcdT/vmAXRMyONXJwPrmYQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.4.1.tgz", + "integrity": "sha512-4FZYVOk85hz2AyT6BbarKy9u37g6DbrDyCdFhsnDdXqyrueYQvB+0zO4f/kqLCRD0BsPRXPMNJeQwihKZV8naw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.3.0", - "@jest/fake-timers": "30.3.0", - "@jest/types": "30.3.0", + "@jest/environment": "30.4.1", + "@jest/fake-timers": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "jest-mock": "30.3.0", - "jest-util": "30.3.0", - "jest-validate": "30.3.0" + "jest-mock": "30.4.1", + "jest-util": "30.4.1", + "jest-validate": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -6913,20 +6840,20 @@ } }, "node_modules/jest-haste-map": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.3.0.tgz", - "integrity": "sha512-mMi2oqG4KRU0R9QEtscl87JzMXfUhbKaFqOxmjb2CKcbHcUGFrJCBWHmnTiUqi6JcnzoBlO4rWfpdl2k/RfLCA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.4.1.tgz", + "integrity": "sha512-rFrcONd8jeFsyw+Z9CrScJgglRf2+NFmNam8dKu7n+SoHqNYT47mn0DdEcVUZJpvh7Iz6/si7f7yUH7GJHVgnw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "@types/node": "*", "anymatch": "^3.1.3", "fb-watchman": "^2.0.2", "graceful-fs": "^4.2.11", - "jest-regex-util": "30.0.1", - "jest-util": "30.3.0", - "jest-worker": "30.3.0", + "jest-regex-util": "30.4.0", + "jest-util": "30.4.1", + "jest-worker": "30.4.1", "picomatch": "^4.0.3", "walker": "^1.0.8" }, @@ -6938,49 +6865,50 @@ } }, "node_modules/jest-leak-detector": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.3.0.tgz", - "integrity": "sha512-cuKmUUGIjfXZAiGJ7TbEMx0bcqNdPPI6P1V+7aF+m/FUJqFDxkFR4JqkTu8ZOiU5AaX/x0hZ20KaaIPXQzbMGQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.4.1.tgz", + "integrity": "sha512-IpmyiioeHxiWDhesHnUFmOxcTzwCwKpgACgWajtAP+nYQXiY7DakTxB6Bx9JFiRMljr0AX1PvnQdaU1KFoz6NQ==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", - "pretty-format": "30.3.0" + "pretty-format": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.3.0.tgz", - "integrity": "sha512-HEtc9uFQgaUHkC7nLSlQL3Tph4Pjxt/yiPvkIrrDCt9jhoLIgxaubo1G+CFOnmHYMxHwwdaSN7mkIFs6ZK8OhA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.4.1.tgz", + "integrity": "sha512-zvYfX5CaeEkFrrLS9suWe9rvJrm9J1Iv3ua8kIBv9GEPzcnsfBf0bob37la7s67fs0nlBC3EuvkOLnXQKxtx4A==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", "chalk": "^4.1.2", - "jest-diff": "30.3.0", - "pretty-format": "30.3.0" + "jest-diff": "30.4.1", + "pretty-format": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-message-util": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.3.0.tgz", - "integrity": "sha512-Z/j4Bo+4ySJ+JPJN3b2Qbl9hDq3VrXmnjjGEWD/x0BCXeOXPTV1iZYYzl2X8c1MaCOL+ewMyNBcm88sboE6YWw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.4.1.tgz", + "integrity": "sha512-kwCKIvq0MCW1HzLoGola9Te6JUdzgV0loyKJ3Qghrkz9i5/RRIHsL95BMQc2HBBhlBKC4j22K9p11TGHH8RBpQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "@types/stack-utils": "^2.0.3", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", + "jest-util": "30.4.1", "picomatch": "^4.0.3", - "pretty-format": "30.3.0", + "pretty-format": "30.4.1", "slash": "^3.0.0", "stack-utils": "^2.0.6" }, @@ -6989,15 +6917,15 @@ } }, "node_modules/jest-mock": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.3.0.tgz", - "integrity": "sha512-OTzICK8CpE+t4ndhKrwlIdbM6Pn8j00lvmSmq5ejiO+KxukbLjgOflKWMn3KE34EZdQm5RqTuKj+5RIEniYhog==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.4.1.tgz", + "integrity": "sha512-/i8SVb8/NSB7RfNi8gfqu8gxLV23KaL5EpAttyb9iz8qWRIqXRLflycz/32wXsYkOnaUlx8NAKnJYtpsmXUmfw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "@types/node": "*", - "jest-util": "30.3.0" + "jest-util": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -7022,9 +6950,9 @@ } }, "node_modules/jest-regex-util": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.0.1.tgz", - "integrity": "sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.4.0.tgz", + "integrity": "sha512-mWlvLviKIgIQ8VCuM1xRdD0TWp3zlzionlmDBjuXVBs+VkmXq6FgW9T4Emr7oGz/Rk6feDCGyiugolcQEyp3mg==", "dev": true, "license": "MIT", "engines": { @@ -7032,18 +6960,18 @@ } }, "node_modules/jest-resolve": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.3.0.tgz", - "integrity": "sha512-NRtTAHQlpd15F9rUR36jqwelbrDV/dY4vzNte3S2kxCKUJRYNd5/6nTSbYiak1VX5g8IoFF23Uj5TURkUW8O5g==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.4.1.tgz", + "integrity": "sha512-Zry8Yq/yJcNAZ7dJ5F2heic8AheXvbFZ7XI5V+h28nrYZ7Qoyy4dItq8OodjnYD270mvX+ZudmrNV9cysqhW5Q==", "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.1.2", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.3.0", + "jest-haste-map": "30.4.1", "jest-pnp-resolver": "^1.2.3", - "jest-util": "30.3.0", - "jest-validate": "30.3.0", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", "slash": "^3.0.0", "unrs-resolver": "^1.7.11" }, @@ -7052,46 +6980,46 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.3.0.tgz", - "integrity": "sha512-9ev8s3YN6Hsyz9LV75XUwkCVFlwPbaFn6Wp75qnI0wzAINYWY8Fb3+6y59Rwd3QaS3kKXffHXsZMziMavfz/nw==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.4.2.tgz", + "integrity": "sha512-gDiVh1I+GxYzz9oXlyw+1wv6VOYX1WYxMOfjsA3iGKePV2oxmbHhwxfkALxNxYy1ciw6APWwkW2zZONwP97aEQ==", "dev": true, "license": "MIT", "dependencies": { - "jest-regex-util": "30.0.1", - "jest-snapshot": "30.3.0" + "jest-regex-util": "30.4.0", + "jest-snapshot": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runner": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.3.0.tgz", - "integrity": "sha512-gDv6C9LGKWDPLia9TSzZwf4h3kMQCqyTpq+95PODnTRDO0g9os48XIYYkS6D236vjpBir2fF63YmJFtqkS5Duw==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.4.2.tgz", + "integrity": "sha512-2dw0PslVYXxffXGpLo+Ejad+KcI1Qkjn7f4X4619gf21oCUmL+SPfjqIa/losUem3yEOvfNZe/F1HWUcNpODcg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.3.0", - "@jest/environment": "30.3.0", - "@jest/test-result": "30.3.0", - "@jest/transform": "30.3.0", - "@jest/types": "30.3.0", + "@jest/console": "30.4.1", + "@jest/environment": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", "chalk": "^4.1.2", "emittery": "^0.13.1", "exit-x": "^0.2.2", "graceful-fs": "^4.2.11", - "jest-docblock": "30.2.0", - "jest-environment-node": "30.3.0", - "jest-haste-map": "30.3.0", - "jest-leak-detector": "30.3.0", - "jest-message-util": "30.3.0", - "jest-resolve": "30.3.0", - "jest-runtime": "30.3.0", - "jest-util": "30.3.0", - "jest-watcher": "30.3.0", - "jest-worker": "30.3.0", + "jest-docblock": "30.4.0", + "jest-environment-node": "30.4.1", + "jest-haste-map": "30.4.1", + "jest-leak-detector": "30.4.1", + "jest-message-util": "30.4.1", + "jest-resolve": "30.4.1", + "jest-runtime": "30.4.2", + "jest-util": "30.4.1", + "jest-watcher": "30.4.1", + "jest-worker": "30.4.1", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -7100,32 +7028,32 @@ } }, "node_modules/jest-runtime": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.3.0.tgz", - "integrity": "sha512-CgC+hIBJbuh78HEffkhNKcbXAytQViplcl8xupqeIWyKQF50kCQA8J7GeJCkjisC6hpnC9Muf8jV5RdtdFbGng==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.4.2.tgz", + "integrity": "sha512-3/5e8iPz2k/VLqlr8DgTftYyLUv8Su3FkCAO2/Od81UsUTpSxOrS6O5x5KkoQwyUjmpYyDJKeyAvg2T2nvpNkQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.3.0", - "@jest/fake-timers": "30.3.0", - "@jest/globals": "30.3.0", + "@jest/environment": "30.4.1", + "@jest/fake-timers": "30.4.1", + "@jest/globals": "30.4.1", "@jest/source-map": "30.0.1", - "@jest/test-result": "30.3.0", - "@jest/transform": "30.3.0", - "@jest/types": "30.3.0", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", "chalk": "^4.1.2", "cjs-module-lexer": "^2.1.0", "collect-v8-coverage": "^1.0.2", "glob": "^10.5.0", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.3.0", - "jest-message-util": "30.3.0", - "jest-mock": "30.3.0", - "jest-regex-util": "30.0.1", - "jest-resolve": "30.3.0", - "jest-snapshot": "30.3.0", - "jest-util": "30.3.0", + "jest-haste-map": "30.4.1", + "jest-message-util": "30.4.1", + "jest-mock": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-resolve": "30.4.1", + "jest-snapshot": "30.4.1", + "jest-util": "30.4.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -7134,9 +7062,9 @@ } }, "node_modules/jest-snapshot": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.3.0.tgz", - "integrity": "sha512-f14c7atpb4O2DeNhwcvS810Y63wEn8O1HqK/luJ4F6M4NjvxmAKQwBUWjbExUtMxWJQ0wVgmCKymeJK6NZMnfQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.4.1.tgz", + "integrity": "sha512-tEOkkfOMppUyeiHwjZswOQ3lcnoTnws/q5FnGIaeIh/jmoU0ZlgMYRR8sTlTj+nNGCoJ0RDq6SfxGxCsyMTPmw==", "dev": true, "license": "MIT", "dependencies": { @@ -7145,20 +7073,20 @@ "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1", "@babel/types": "^7.27.3", - "@jest/expect-utils": "30.3.0", + "@jest/expect-utils": "30.4.1", "@jest/get-type": "30.1.0", - "@jest/snapshot-utils": "30.3.0", - "@jest/transform": "30.3.0", - "@jest/types": "30.3.0", + "@jest/snapshot-utils": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "babel-preset-current-node-syntax": "^1.2.0", "chalk": "^4.1.2", - "expect": "30.3.0", + "expect": "30.4.1", "graceful-fs": "^4.2.11", - "jest-diff": "30.3.0", - "jest-matcher-utils": "30.3.0", - "jest-message-util": "30.3.0", - "jest-util": "30.3.0", - "pretty-format": "30.3.0", + "jest-diff": "30.4.1", + "jest-matcher-utils": "30.4.1", + "jest-message-util": "30.4.1", + "jest-util": "30.4.1", + "pretty-format": "30.4.1", "semver": "^7.7.2", "synckit": "^0.11.8" }, @@ -7167,9 +7095,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", "dev": true, "license": "ISC", "bin": { @@ -7180,13 +7108,13 @@ } }, "node_modules/jest-util": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.3.0.tgz", - "integrity": "sha512-/jZDa00a3Sz7rdyu55NLrQCIrbyIkbBxareejQI315f/i8HjYN+ZWsDLLpoQSiUIEIyZF/R8fDg3BmB8AtHttg==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.4.1.tgz", + "integrity": "sha512-vjQb1sACEiv13DKJMDToJpzVW0joCsIQrmbg0fi7CyOOt+g9jTuQl2A216pWRBYhOVt53XbL/2LbMKg1BECWOw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "@types/node": "*", "chalk": "^4.1.2", "ci-info": "^4.2.0", @@ -7198,18 +7126,18 @@ } }, "node_modules/jest-validate": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.3.0.tgz", - "integrity": "sha512-I/xzC8h5G+SHCb2P2gWkJYrNiTbeL47KvKeW5EzplkyxzBRBw1ssSHlI/jXec0ukH2q7x2zAWQm7015iusg62Q==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.4.1.tgz", + "integrity": "sha512-PDWi4SOwLnwqNDfHZjOcsEFyZ4fc/2W2gVL3DEoyqnB6jCQMLRtfBong8s6omIw3lI0HWOus12xfnFmQtjW3fw==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", - "@jest/types": "30.3.0", + "@jest/types": "30.4.1", "camelcase": "^6.3.0", "chalk": "^4.1.2", "leven": "^3.1.0", - "pretty-format": "30.3.0" + "pretty-format": "30.4.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -7229,19 +7157,19 @@ } }, "node_modules/jest-watcher": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.3.0.tgz", - "integrity": "sha512-PJ1d9ThtTR8aMiBWUdcownq9mDdLXsQzJayTk4kmaBRHKvwNQn+ANveuhEBUyNI2hR1TVhvQ8D5kHubbzBHR/w==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.4.1.tgz", + "integrity": "sha512-/l9UonmvCwjHH7d2h3iAwIloLc1H0S8mJZ/LNK3i86hqwPAz8otUJjP9MfYtz9Tt77Su5FD2xGjZn8d31IZHlw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.3.0", - "@jest/types": "30.3.0", + "@jest/test-result": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", "emittery": "^0.13.1", - "jest-util": "30.3.0", + "jest-util": "30.4.1", "string-length": "^4.0.2" }, "engines": { @@ -7249,15 +7177,15 @@ } }, "node_modules/jest-worker": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.3.0.tgz", - "integrity": "sha512-DrCKkaQwHexjRUFTmPzs7sHQe0TSj9nvDALKGdwmK5mW9v7j90BudWirKAJHt3QQ9Dhrg1F7DogPzhChppkJpQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.4.1.tgz", + "integrity": "sha512-SHynN/q/QD++iNyvMdy+WMmbCGk8jIsNcRxycXbWubSOhvo6T+j2afcfUSl+3hYsiBebOTo0cT7c2H7CXugu1g==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", "@ungap/structured-clone": "^1.3.0", - "jest-util": "30.3.0", + "jest-util": "30.4.1", "merge-stream": "^2.0.0", "supports-color": "^8.1.1" }, @@ -7779,55 +7707,53 @@ "license": "MIT" }, "node_modules/neostandard": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/neostandard/-/neostandard-0.12.2.tgz", - "integrity": "sha512-VZU8EZpSaNadp3rKEwBhVD1Kw8jE3AftQLkCyOaM7bWemL1LwsYRsBnAmXy2LjG9zO8t66qJdqB7ccwwORyrAg==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/neostandard/-/neostandard-0.13.0.tgz", + "integrity": "sha512-R3iglFr+Dla/8qFBqsMxBvcYBOgP6rAGw7uRHKMpM3bUP0wLDRzUstxtEI9RfEwn7xszE/UUnh8H090Ru4Z52A==", "dev": true, "license": "MIT", "dependencies": { "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "@stylistic/eslint-plugin": "2.11.0", - "eslint-import-resolver-typescript": "^3.10.1", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-n": "^17.20.0", + "eslint-plugin-n": "^17.23.2", "eslint-plugin-promise": "^7.2.1", "eslint-plugin-react": "^7.37.5", - "find-up": "^5.0.0", - "globals": "^15.15.0", - "peowly": "^1.3.2", - "typescript-eslint": "^8.35.1" + "find-up": "^8.0.0", + "globals": "^17.3.0", + "peowly": "^1.3.3", + "typescript-eslint": "^8.56.0" }, "bin": { "neostandard": "cli.mjs" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "peerDependencies": { "eslint": "^9.0.0" } }, "node_modules/neostandard/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-8.0.0.tgz", + "integrity": "sha512-JGG8pvDi2C+JxidYdIwQDyS/CgcrIdh18cvgxcBge3wSHRQOrooMD3GlFBcmMJAN9M42SAZjDp5zv1dglJjwww==", "dev": true, "license": "MIT", "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "locate-path": "^8.0.0", + "unicorn-magic": "^0.3.0" }, "engines": { - "node": ">=10" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/neostandard/node_modules/globals": { - "version": "15.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", - "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", + "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", "dev": true, "license": "MIT", "engines": { @@ -7838,47 +7764,34 @@ } }, "node_modules/neostandard/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-8.0.0.tgz", + "integrity": "sha512-XT9ewWAC43tiAV7xDAPflMkG0qOPn2QjHqlgX8FOqmWa/rxnyYDulF9T0F7tRy1u+TVTmK/M//6VIOye+2zDXg==", "dev": true, "license": "MIT", "dependencies": { - "p-locate": "^5.0.0" + "p-locate": "^6.0.0" }, "engines": { - "node": ">=10" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/neostandard/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/neostandard/node_modules/unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", "dev": true, "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/neostandard/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/node-exports-info": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/node-exports-info/-/node-exports-info-1.6.0.tgz", @@ -7916,9 +7829,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.37", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", - "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", + "version": "2.0.44", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.44.tgz", + "integrity": "sha512-5WUyunoPMsvvEhS8AxHtRzP+oA8UCkJ7YRxatWKjngndhDGLiqEVAQKWjFAiAiuL8zMRGzGSJxFnLetoa43qGQ==", "dev": true, "license": "MIT" }, @@ -8525,15 +8438,16 @@ } }, "node_modules/pretty-format": { - "version": "30.3.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.3.0.tgz", - "integrity": "sha512-oG4T3wCbfeuvljnyAzhBvpN45E8iOTXCU/TD3zXW80HA3dQ4ahdqMkWGiPWZvjpQwlbyHrPTWUAqUzGzv4l1JQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.4.1.tgz", + "integrity": "sha512-K6KiKMHTL4jjX4u3Kir2EW07nRfcqVTXIImx50wbjHQTcZPgg+gjVeNTIT3l3L1Rd4UefxfogquC9J37SoFyyw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/schemas": "30.0.5", + "@jest/schemas": "30.4.1", "ansi-styles": "^5.2.0", - "react-is": "^18.3.1" + "react-is-18": "npm:react-is@^18.3.1", + "react-is-19": "npm:react-is@^19.2.5" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -8670,6 +8584,22 @@ "dev": true, "license": "MIT" }, + "node_modules/react-is-18": { + "name": "react-is", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/react-is-19": { + "name": "react-is", + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.6.tgz", + "integrity": "sha512-XjBR15BhXuylgWGuslhDKqlSayuqvqBX91BP8pauG8kd1zY8kotkNWbXksTCNRarse4kuGbe2kIY05ARtwNIvw==", + "dev": true, + "license": "MIT" + }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -9325,23 +9255,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/stable-hash": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.5.tgz", - "integrity": "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==", - "dev": true, - "license": "MIT" - }, - "node_modules/stable-hash-x": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.2.0.tgz", - "integrity": "sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -9738,18 +9651,18 @@ } }, "node_modules/test-exclude": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.2.tgz", - "integrity": "sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-8.0.0.tgz", + "integrity": "sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==", "dev": true, "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^10.4.1", + "glob": "^13.0.6", "minimatch": "^10.2.2" }, "engines": { - "node": ">=18" + "node": "20 || >=22" } }, "node_modules/test-exclude/node_modules/balanced-match": { @@ -9775,6 +9688,34 @@ "node": "18 || 20 || >=22" } }, + "node_modules/test-exclude/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/lru-cache": { + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.3.5.tgz", + "integrity": "sha512-NxVFwLAnrd9i7KUBxC4DrUhmgjzOs+1Qm50D3oF1/oL+r1NpZ4gA7xvG0/zJ8evR7zIKn4vLf7qTNduWFtCrRw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/test-exclude/node_modules/minimatch": { "version": "10.2.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", @@ -9791,6 +9732,23 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/test-exclude/node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/tinyglobby": { "version": "0.2.16", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", @@ -10103,9 +10061,9 @@ } }, "node_modules/typescript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz", - "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/deps/undici/src/package.json b/deps/undici/src/package.json index 082c56a4783ae1..b9d007ade7cf0c 100644 --- a/deps/undici/src/package.json +++ b/deps/undici/src/package.json @@ -1,6 +1,6 @@ { "name": "undici", - "version": "8.2.0", + "version": "8.3.0", "description": "An HTTP/1.1 client, written from scratch for Node.js", "homepage": "https://undici.nodejs.org", "bugs": { @@ -115,8 +115,8 @@ "@sinonjs/fake-timers": "^12.0.0", "@types/node": "^22.0.0", "abort-controller": "^3.0.0", - "borp": "^0.20.0", - "c8": "^10.0.0", + "borp": "^1.0.0", + "c8": "^11.0.0", "cross-env": "^10.0.0", "dns-packet": "^5.4.0", "esbuild": "^0.28.0", @@ -125,7 +125,7 @@ "husky": "^9.0.7", "jest": "^30.0.5", "jsondiffpatch": "^0.7.3", - "neostandard": "^0.12.0", + "neostandard": "^0.13.0", "node-forge": "^1.3.1", "proxy": "^4.0.0", "tsd": "^0.33.0", diff --git a/deps/undici/src/types/client.d.ts b/deps/undici/src/types/client.d.ts index 13b7bf5899454d..530a94583898a9 100644 --- a/deps/undici/src/types/client.d.ts +++ b/deps/undici/src/types/client.d.ts @@ -3,7 +3,7 @@ import Dispatcher from './dispatcher' import buildConnector from './connector' import TClientStats from './client-stats' -type ClientConnectOptions = Omit +type ClientConnectOptions = Omit, 'origin'> /** * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default. @@ -20,12 +20,12 @@ export class Client extends Dispatcher { readonly stats: TClientStats // Override dispatcher APIs. - override connect ( - options: ClientConnectOptions - ): Promise - override connect ( - options: ClientConnectOptions, - callback: (err: Error | null, data: Dispatcher.ConnectData) => void + override connect ( + options: ClientConnectOptions + ): Promise> + override connect ( + options: ClientConnectOptions, + callback: (err: Error | null, data: Dispatcher.ConnectData) => void ): void } diff --git a/deps/undici/src/types/dispatcher.d.ts b/deps/undici/src/types/dispatcher.d.ts index 40a75de6743506..f732ec45cc97f7 100644 --- a/deps/undici/src/types/dispatcher.d.ts +++ b/deps/undici/src/types/dispatcher.d.ts @@ -121,8 +121,6 @@ declare namespace Dispatcher { bodyTimeout?: number | null; /** Whether the request should stablish a keep-alive or not. Default `false` */ reset?: boolean; - /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */ - throwOnError?: boolean; /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server */ expectContinue?: boolean; } diff --git a/deps/undici/src/types/formdata.d.ts b/deps/undici/src/types/formdata.d.ts index 5244e04559fe5a..b9819a7e725d49 100644 --- a/deps/undici/src/types/formdata.d.ts +++ b/deps/undici/src/types/formdata.d.ts @@ -4,12 +4,6 @@ import { File } from 'node:buffer' import { SpecIterableIterator } from './fetch' -declare module 'node:buffer' { - interface File { - readonly [Symbol.toStringTag]: string - } -} - /** * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs. */ diff --git a/deps/undici/src/types/snapshot-agent.d.ts b/deps/undici/src/types/snapshot-agent.d.ts index f1d1ccdbb4d2f2..9696b604f5a7c8 100644 --- a/deps/undici/src/types/snapshot-agent.d.ts +++ b/deps/undici/src/types/snapshot-agent.d.ts @@ -30,7 +30,9 @@ declare namespace SnapshotRecorder { ignoreHeaders?: string[] excludeHeaders?: string[] matchBody?: boolean + normalizeBody?: (body: string | Buffer | null | undefined) => string matchQuery?: boolean + normalizeQuery?: (query: URLSearchParams) => string caseSensitive?: boolean shouldRecord?: (requestOpts: any) => boolean shouldPlayback?: (requestOpts: any) => boolean @@ -98,7 +100,9 @@ declare namespace SnapshotAgent { ignoreHeaders?: string[] excludeHeaders?: string[] matchBody?: boolean + normalizeBody?: (body: string | Buffer | null | undefined) => string matchQuery?: boolean + normalizeQuery?: (query: URLSearchParams) => string caseSensitive?: boolean shouldRecord?: (requestOpts: any) => boolean shouldPlayback?: (requestOpts: any) => boolean diff --git a/deps/undici/undici.js b/deps/undici/undici.js index 86f020015b22c2..20e38982a91d47 100644 --- a/deps/undici/undici.js +++ b/deps/undici/undici.js @@ -556,6 +556,7 @@ var require_symbols = __commonJS({ kListeners: /* @__PURE__ */ Symbol("listeners"), kHTTPContext: /* @__PURE__ */ Symbol("http context"), kMaxConcurrentStreams: /* @__PURE__ */ Symbol("max concurrent streams"), + kHostAuthority: /* @__PURE__ */ Symbol("host authority"), kHTTP2InitialWindowSize: /* @__PURE__ */ Symbol("http2 initial window size"), kHTTP2ConnectionWindowSize: /* @__PURE__ */ Symbol("http2 connection window size"), kEnableConnectProtocol: /* @__PURE__ */ Symbol("http2session connect protocol"), @@ -901,6 +902,7 @@ var require_pool_base = __commonJS({ var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); var kGetDispatcher = /* @__PURE__ */ Symbol("get dispatcher"); + var kHasDispatcher = /* @__PURE__ */ Symbol("has dispatcher"); var kAddClient = /* @__PURE__ */ Symbol("add client"); var kRemoveClient = /* @__PURE__ */ Symbol("remove client"); var PoolBase = class extends DispatcherBase { @@ -1026,10 +1028,19 @@ var require_pool_base = __commonJS({ this[kQueued]++; } else if (!dispatcher.dispatch(opts, handler)) { dispatcher[kNeedDrain] = true; - this[kNeedDrain] = !this[kGetDispatcher](); + this[kNeedDrain] = !this[kHasDispatcher](); } return !this[kNeedDrain]; } + [kHasDispatcher]() { + for (let i = 0; i < this[kClients].length; i++) { + const dispatcher = this[kClients][i]; + if (!dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true) { + return true; + } + } + return false; + } [kAddClient](client) { client.on("drain", this[kOnDrain].bind(this, client)).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); this[kClients].push(client); @@ -1049,7 +1060,7 @@ var require_pool_base = __commonJS({ } client.close(() => { }); - this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); + this[kNeedDrain] = !this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); } }; module2.exports = { @@ -1058,7 +1069,8 @@ var require_pool_base = __commonJS({ kNeedDrain, kAddClient, kRemoveClient, - kGetDispatcher + kGetDispatcher, + kHasDispatcher }; } }); @@ -2283,14 +2295,14 @@ var require_util = __commonJS({ return !headerCharRegex.test(characters); } __name(isValidHeaderValue, "isValidHeaderValue"); - var rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+)?$/; + var rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+|\*)?$/; function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; const m = range ? range.match(rangeHeaderRegex) : null; return m ? { start: parseInt(m[1]), end: m[2] ? parseInt(m[2]) : null, - size: m[3] ? parseInt(m[3]) : null + size: m[3] && m[3] !== "*" ? parseInt(m[3]) : null } : null; } __name(parseRangeHeader, "parseRangeHeader"); @@ -6040,6 +6052,86 @@ var require_util2 = __commonJS({ } }); +// lib/util/runtime-features.js +var require_runtime_features = __commonJS({ + "lib/util/runtime-features.js"(exports2, module2) { + "use strict"; + var lazyLoaders = { + __proto__: null, + "node:crypto": /* @__PURE__ */ __name(() => require("node:crypto"), "node:crypto"), + "node:sqlite": /* @__PURE__ */ __name(() => require("node:sqlite"), "node:sqlite") + }; + function detectRuntimeFeatureByNodeModule(moduleName) { + try { + lazyLoaders[moduleName](); + return true; + } catch (err) { + if (err.code !== "ERR_UNKNOWN_BUILTIN_MODULE" && err.code !== "ERR_NO_CRYPTO") { + throw err; + } + return false; + } + } + __name(detectRuntimeFeatureByNodeModule, "detectRuntimeFeatureByNodeModule"); + var runtimeFeaturesAsNodeModule = ( + /** @type {const} */ + ["crypto", "sqlite"] + ); + function detectRuntimeFeature(feature) { + if (runtimeFeaturesAsNodeModule.includes( + /** @type {RuntimeFeatureByNodeModule} */ + feature + )) { + return detectRuntimeFeatureByNodeModule(`node:${feature}`); + } + throw new TypeError(`unknown feature: ${feature}`); + } + __name(detectRuntimeFeature, "detectRuntimeFeature"); + var RuntimeFeatures = class { + static { + __name(this, "RuntimeFeatures"); + } + /** @type {Map} */ + #map = /* @__PURE__ */ new Map(); + /** + * Clears all cached feature detections. + */ + clear() { + this.#map.clear(); + } + /** + * @param {Feature} feature + * @returns {boolean} + */ + has(feature) { + return this.#map.get(feature) ?? this.#detectRuntimeFeature(feature); + } + /** + * @param {Feature} feature + * @param {boolean} value + */ + set(feature, value) { + if (runtimeFeaturesAsNodeModule.includes(feature) === false) { + throw new TypeError(`unknown feature: ${feature}`); + } + this.#map.set(feature, value); + } + /** + * @param {Feature} feature + * @returns {boolean} + */ + #detectRuntimeFeature(feature) { + const result = detectRuntimeFeature(feature); + this.#map.set(feature, result); + return result; + } + }; + var instance = new RuntimeFeatures(); + module2.exports.runtimeFeatures = instance; + module2.exports.default = instance; + } +}); + // lib/web/fetch/formdata.js var require_formdata = __commonJS({ "lib/web/fetch/formdata.js"(exports2, module2) { @@ -6048,11 +6140,14 @@ var require_formdata = __commonJS({ var { kEnumerableProperty } = require_util(); var { webidl } = require_webidl(); var nodeUtil = require("node:util"); + var { runtimeFeatures } = require_runtime_features(); + var random = runtimeFeatures.has("crypto") ? require("node:crypto").randomInt : (max) => Math.floor(Math.random() * max); var FormData = class _FormData { static { __name(this, "FormData"); } #state = []; + #boundary = null; constructor(form = void 0) { webidl.util.markAsUncloneable(this); if (form !== void 0) { @@ -6167,10 +6262,20 @@ var require_formdata = __commonJS({ static setFormDataState(formData, newState) { formData.#state = newState; } + /** + * @param {FormData} formData + * @returns {string | null} + */ + static getFormDataBoundary(formData) { + const boundary = formData.#boundary; + if (boundary != null) return boundary; + return formData.#boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + } }; - var { getFormDataState, setFormDataState } = FormData; + var { getFormDataState, setFormDataState, getFormDataBoundary } = FormData; Reflect.deleteProperty(FormData, "getFormDataState"); Reflect.deleteProperty(FormData, "setFormDataState"); + Reflect.deleteProperty(FormData, "getFormDataBoundary"); iteratorMixin("FormData", FormData, getFormDataState, "name", "value"); Object.defineProperties(FormData.prototype, { append: kEnumerableProperty, @@ -6202,7 +6307,7 @@ var require_formdata = __commonJS({ } __name(makeEntry, "makeEntry"); webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData); - module2.exports = { FormData, makeEntry, setFormDataState }; + module2.exports = { FormData, makeEntry, setFormDataState, getFormDataBoundary }; } }); @@ -6548,86 +6653,6 @@ var require_formdata_parser = __commonJS({ } }); -// lib/util/runtime-features.js -var require_runtime_features = __commonJS({ - "lib/util/runtime-features.js"(exports2, module2) { - "use strict"; - var lazyLoaders = { - __proto__: null, - "node:crypto": /* @__PURE__ */ __name(() => require("node:crypto"), "node:crypto"), - "node:sqlite": /* @__PURE__ */ __name(() => require("node:sqlite"), "node:sqlite") - }; - function detectRuntimeFeatureByNodeModule(moduleName) { - try { - lazyLoaders[moduleName](); - return true; - } catch (err) { - if (err.code !== "ERR_UNKNOWN_BUILTIN_MODULE" && err.code !== "ERR_NO_CRYPTO") { - throw err; - } - return false; - } - } - __name(detectRuntimeFeatureByNodeModule, "detectRuntimeFeatureByNodeModule"); - var runtimeFeaturesAsNodeModule = ( - /** @type {const} */ - ["crypto", "sqlite"] - ); - function detectRuntimeFeature(feature) { - if (runtimeFeaturesAsNodeModule.includes( - /** @type {RuntimeFeatureByNodeModule} */ - feature - )) { - return detectRuntimeFeatureByNodeModule(`node:${feature}`); - } - throw new TypeError(`unknown feature: ${feature}`); - } - __name(detectRuntimeFeature, "detectRuntimeFeature"); - var RuntimeFeatures = class { - static { - __name(this, "RuntimeFeatures"); - } - /** @type {Map} */ - #map = /* @__PURE__ */ new Map(); - /** - * Clears all cached feature detections. - */ - clear() { - this.#map.clear(); - } - /** - * @param {Feature} feature - * @returns {boolean} - */ - has(feature) { - return this.#map.get(feature) ?? this.#detectRuntimeFeature(feature); - } - /** - * @param {Feature} feature - * @param {boolean} value - */ - set(feature, value) { - if (runtimeFeaturesAsNodeModule.includes(feature) === false) { - throw new TypeError(`unknown feature: ${feature}`); - } - this.#map.set(feature, value); - } - /** - * @param {Feature} feature - * @returns {boolean} - */ - #detectRuntimeFeature(feature) { - const result = detectRuntimeFeature(feature); - this.#map.set(feature, result); - return result; - } - }; - var instance = new RuntimeFeatures(); - module2.exports.runtimeFeatures = instance; - module2.exports.default = instance; - } -}); - // lib/web/fetch/body.js var require_body = __commonJS({ "lib/web/fetch/body.js"(exports2, module2) { @@ -6639,7 +6664,7 @@ var require_body = __commonJS({ fullyReadBody, extractMimeType } = require_util2(); - var { FormData, setFormDataState } = require_formdata(); + var { FormData, setFormDataState, getFormDataBoundary } = require_formdata(); var { webidl } = require_webidl(); var assert = require("node:assert"); var { isErrored, isDisturbed } = require("node:stream"); @@ -6648,8 +6673,6 @@ var require_body = __commonJS({ var { multipartFormDataParser } = require_formdata_parser(); var { parseJSONFromBytes } = require_infra(); var { utf8DecodeBytes } = require_encoding(); - var { runtimeFeatures } = require_runtime_features(); - var random = runtimeFeatures.has("crypto") ? require("node:crypto").randomInt : (max) => Math.floor(Math.random() * max); var textEncoder = new TextEncoder(); function noop() { } @@ -6693,7 +6716,7 @@ var require_body = __commonJS({ } else if (webidl.is.BufferSource(object)) { source = webidl.util.getCopyOfBytesHeldByBufferSource(object); } else if (webidl.is.FormData(object)) { - const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + const boundary = getFormDataBoundary(object); const prefix = `--${boundary}\r Content-Disposition: form-data`; const formdataEscape = /* @__PURE__ */ __name((str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "formdataEscape"); @@ -7211,19 +7234,47 @@ var require_client_h1 = __commonJS({ this.paused = true; socket.unshift(data); } else { - const ptr = llhttp.llhttp_get_error_reason(this.ptr); - let message = ""; - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); - message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; - } - throw new HTTPParserError(message, constants.ERROR[ret], data); + throw this.createError(ret, data); } } } catch (err) { util.destroy(socket, err); } } + finish() { + assert(currentParser === null); + assert(this.ptr != null); + assert(!this.paused); + const { llhttp } = this; + let ret; + try { + currentParser = this; + ret = llhttp.llhttp_finish(this.ptr); + } finally { + currentParser = null; + } + if (ret === constants.ERROR.OK) { + return null; + } + if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { + this.paused = true; + return null; + } + return this.createError(ret, EMPTY_BUF); + } + createError(ret, data) { + const { llhttp, contentLength, bytesRead } = this; + if (contentLength !== -1 && bytesRead !== contentLength) { + return new ResponseContentLengthMismatchError(); + } + const ptr = llhttp.llhttp_get_error_reason(this.ptr); + let message = ""; + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); + message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; + } + return new HTTPParserError(message, constants.ERROR[ret], data); + } destroy() { assert(currentParser === null); assert(this.ptr != null); @@ -7607,7 +7658,11 @@ var require_client_h1 = __commonJS({ assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); const parser = this[kParser]; if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); + const parserErr = parser.finish(); + if (parserErr) { + this[kError] = parserErr; + this[kClient][kOnError](parserErr); + } return; } this[kError] = err; @@ -7621,7 +7676,10 @@ var require_client_h1 = __commonJS({ function onHttpSocketEnd() { const parser = this[kParser]; if (parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); + const parserErr = parser.finish(); + if (parserErr) { + util.destroy(this, parserErr); + } return; } util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); @@ -7631,7 +7689,7 @@ var require_client_h1 = __commonJS({ const parser = this[kParser]; if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); + this[kError] = parser.finish() || this[kError]; } this[kParser].destroy(); this[kParser] = null; @@ -7920,7 +7978,6 @@ upgrade: ${upgrade}\r } __name(writeBuffer, "writeBuffer"); async function writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) { - assert(contentLength === body.size, "blob body must have content length"); try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError(); @@ -8149,6 +8206,7 @@ var require_client_h2 = __commonJS({ kHTTP2Session, kHTTP2InitialWindowSize, kHTTP2ConnectionWindowSize, + kHostAuthority, kResume, kSize, kHTTPContext, @@ -8164,8 +8222,7 @@ var require_client_h2 = __commonJS({ var kRequestStreamId = /* @__PURE__ */ Symbol("request stream id"); var kRequestStream = /* @__PURE__ */ Symbol("request stream"); var kRequestStreamCleanup = /* @__PURE__ */ Symbol("request stream cleanup"); - var kRequestStreamOnData = /* @__PURE__ */ Symbol("request stream on data"); - var kRequestStreamOnCloseError = /* @__PURE__ */ Symbol("request stream on close error"); + var kRequestStreamState = /* @__PURE__ */ Symbol("request stream state"); var kReceivedGoAway = /* @__PURE__ */ Symbol("received goaway"); var extractBody; var http2; @@ -8214,8 +8271,9 @@ var require_client_h2 = __commonJS({ __name(detachRequestFromStream, "detachRequestFromStream"); function bindRequestToStream(request, stream, cleanup) { const previousCleanup = request[kRequestStreamCleanup]; + const previousStream = request[kRequestStream]; detachRequestFromStream(request); - previousCleanup?.(); + previousCleanup?.(previousStream); request[kRequestStreamId] = stream.id; request[kRequestStream] = stream; request[kRequestStreamCleanup] = cleanup; @@ -8223,8 +8281,9 @@ var require_client_h2 = __commonJS({ __name(bindRequestToStream, "bindRequestToStream"); function clearRequestStream(request) { const cleanup = request[kRequestStreamCleanup]; + const stream = request[kRequestStream]; detachRequestFromStream(request); - cleanup?.(); + cleanup?.(stream); } __name(clearRequestStream, "clearRequestStream"); function canRetryRequestAfterGoAway(request) { @@ -8530,62 +8589,148 @@ var require_client_h2 = __commonJS({ __name(closeStreamSession, "closeStreamSession"); function onUpgradeStreamClose() { this.off("error", noop); - const failUpgradeStream = this[kRequestStreamOnCloseError]; - this[kRequestStreamOnCloseError] = null; - failUpgradeStream(new InformationalError("HTTP/2: stream closed before response headers")); + const state = this[kRequestStreamState]; + this[kRequestStreamState] = null; + failUpgradeStream(state, new InformationalError("HTTP/2: stream closed before response headers")); closeStreamSession(this); } __name(onUpgradeStreamClose, "onUpgradeStreamClose"); function onRequestStreamClose() { - const onData = this[kRequestStreamOnData]; - this[kRequestStreamOnData] = null; this.off("data", onData); this.off("error", noop); closeStreamSession(this); + this[kRequestStreamState] = null; } __name(onRequestStreamClose, "onRequestStreamClose"); function shouldSendContentLength(method) { return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } __name(shouldSendContentLength, "shouldSendContentLength"); - function writeH2(client, request) { - const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout]; - const session = client[kHTTP2Session]; - const { method, path, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request; - let { body } = request; - if (upgrade != null && upgrade !== "websocket") { - util.errorRequest(client, request, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`)); - return false; - } + function buildRequestHeaders(reqHeaders) { const headers = {}; for (let n = 0; n < reqHeaders.length; n += 2) { const key = reqHeaders[n + 0]; const val = reqHeaders[n + 1]; + const current = headers[key]; if (key === "cookie") { - if (headers[key] != null) { - headers[key] = Array.isArray(headers[key]) ? (headers[key].push(val), headers[key]) : [headers[key], val]; + if (current != null) { + headers[key] = Array.isArray(current) ? (current.push(val), current) : [current, val]; } else { headers[key] = val; } continue; } - if (Array.isArray(val)) { - for (let i = 0; i < val.length; i++) { - if (headers[key]) { - headers[key] += `, ${val[i]}`; - } else { - headers[key] = val[i]; - } - } - } else if (headers[key]) { - headers[key] += `, ${val}`; - } else { - headers[key] = val; + if (typeof val === "string") { + headers[key] = current ? `${current}, ${val}` : val; + continue; + } + for (let i = 0; i < val.length; i++) { + headers[key] = headers[key] ? `${headers[key]}, ${val[i]}` : val[i]; } } + return headers; + } + __name(buildRequestHeaders, "buildRequestHeaders"); + function removeUpgradeStreamListeners(stream) { + stream.off("response", onUpgradeResponse); + stream.off("error", onUpgradeStreamError); + stream.off("end", onUpgradeStreamEnd); + stream.off("timeout", onUpgradeStreamTimeout); + stream.off("error", noop); + } + __name(removeUpgradeStreamListeners, "removeUpgradeStreamListeners"); + function releaseUpgradeStream(stream) { + if (stream == null) { + return; + } + const state = stream[kRequestStreamState]; + if (state == null) { + return; + } + const { request } = state; + if (request[kRequestStream] === stream) { + detachRequestFromStream(request); + } + removeUpgradeStreamListeners(stream); + if (!stream.destroyed && !stream.closed) { + stream.once("error", noop); + } + } + __name(releaseUpgradeStream, "releaseUpgradeStream"); + function failUpgradeStream(state, err) { + if (state == null) { + return; + } + const { request } = state; + if (state.responseReceived || request.aborted || request.completed) { + return; + } + releaseUpgradeStream(state.stream); + state.abort(err, true); + } + __name(failUpgradeStream, "failUpgradeStream"); + function onUpgradeStreamError() { + const state = this[kRequestStreamState]; + if (typeof this.rstCode === "number" && this.rstCode !== 0) { + failUpgradeStream(state, new InformationalError(`HTTP/2: "stream error" received - code ${this.rstCode}`)); + } else { + failUpgradeStream(state, new InformationalError("HTTP/2: stream errored before response headers")); + } + } + __name(onUpgradeStreamError, "onUpgradeStreamError"); + function onUpgradeStreamEnd() { + failUpgradeStream(this[kRequestStreamState], new InformationalError("HTTP/2: stream half-closed (remote)")); + } + __name(onUpgradeStreamEnd, "onUpgradeStreamEnd"); + function onUpgradeStreamTimeout() { + const state = this[kRequestStreamState]; + failUpgradeStream(state, new InformationalError(`HTTP/2: "stream timeout after ${state.requestTimeout}"`)); + } + __name(onUpgradeStreamTimeout, "onUpgradeStreamTimeout"); + function onUpgradeResponse(headers, _flags) { + const stream = this; + const state = stream[kRequestStreamState]; + const { request } = state; + state.responseReceived = true; + const statusCode = headers[HTTP2_HEADER_STATUS]; + delete headers[HTTP2_HEADER_STATUS]; + request.onRequestUpgrade(statusCode, headers, stream); + if (request.aborted || request.completed) { + return; + } + removeUpgradeStreamListeners(stream); + detachRequestFromStream(request); + state.finalizeRequest(); + } + __name(onUpgradeResponse, "onUpgradeResponse"); + function setupUpgradeStream(stream, state) { + const { request, requestTimeout, session } = state; + stream[kHTTP2Stream] = true; + stream[kHTTP2Session] = session; + stream[kRequestStreamState] = state; + state.stream = stream; + bindRequestToStream(request, stream, releaseUpgradeStream); + stream.once("response", onUpgradeResponse); + stream.on("error", onUpgradeStreamError); + stream.once("end", onUpgradeStreamEnd); + stream.on("timeout", onUpgradeStreamTimeout); + stream.once("close", onUpgradeStreamClose); + ++session[kOpenStreams]; + stream.setTimeout(requestTimeout); + } + __name(setupUpgradeStream, "setupUpgradeStream"); + function writeH2(client, request) { + const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout]; + const session = client[kHTTP2Session]; + const { method, path, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request; + let { body } = request; + if (upgrade != null && upgrade !== "websocket") { + util.errorRequest(client, request, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`)); + return false; + } + const headers = buildRequestHeaders(reqHeaders); let stream = null; - const { hostname, port } = client[kUrl]; - headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; + headers[HTTP2_HEADER_AUTHORITY] = host || client[kHostAuthority]; headers[HTTP2_HEADER_METHOD] = method; let requestFinalized = false; const finalizeRequest = /* @__PURE__ */ __name((resetPendingIdx = false) => { @@ -8639,67 +8784,15 @@ var require_client_h2 = __commonJS({ } if (upgrade || method === "CONNECT") { session.ref(); - const setupUpgradeStream = /* @__PURE__ */ __name((stream2) => { - let responseReceived2 = false; - const removeUpgradeStreamListeners = /* @__PURE__ */ __name(() => { - stream2.off("response", onUpgradeResponse); - stream2.off("error", onUpgradeStreamError); - stream2.off("end", onUpgradeStreamEnd); - stream2.off("timeout", onUpgradeStreamTimeout); - stream2.off("error", noop); - }, "removeUpgradeStreamListeners"); - const releaseUpgradeStream = /* @__PURE__ */ __name(() => { - if (request[kRequestStream] === stream2) { - detachRequestFromStream(request); - } - removeUpgradeStreamListeners(); - if (!stream2.destroyed && !stream2.closed) { - stream2.once("error", noop); - } - }, "releaseUpgradeStream"); - const failUpgradeStream = /* @__PURE__ */ __name((err) => { - if (responseReceived2 || request.aborted || request.completed) { - return; - } - releaseUpgradeStream(); - abort(err, true); - }, "failUpgradeStream"); - const onUpgradeStreamError = /* @__PURE__ */ __name(() => { - if (typeof stream2.rstCode === "number" && stream2.rstCode !== 0) { - failUpgradeStream(new InformationalError(`HTTP/2: "stream error" received - code ${stream2.rstCode}`)); - } else { - failUpgradeStream(new InformationalError("HTTP/2: stream errored before response headers")); - } - }, "onUpgradeStreamError"); - const onUpgradeStreamEnd = /* @__PURE__ */ __name(() => { - failUpgradeStream(new InformationalError("HTTP/2: stream half-closed (remote)")); - }, "onUpgradeStreamEnd"); - const onUpgradeStreamTimeout = /* @__PURE__ */ __name(() => { - failUpgradeStream(new InformationalError(`HTTP/2: "stream timeout after ${requestTimeout}"`)); - }, "onUpgradeStreamTimeout"); - const onUpgradeResponse = /* @__PURE__ */ __name((headers2, _flags) => { - responseReceived2 = true; - const statusCode = headers2[HTTP2_HEADER_STATUS]; - delete headers2[HTTP2_HEADER_STATUS]; - request.onRequestUpgrade(statusCode, headers2, stream2); - if (request.aborted || request.completed) { - return; - } - removeUpgradeStreamListeners(); - detachRequestFromStream(request); - finalizeRequest(); - }, "onUpgradeResponse"); - bindRequestToStream(request, stream2, releaseUpgradeStream); - stream2.once("response", onUpgradeResponse); - stream2.on("error", onUpgradeStreamError); - stream2.once("end", onUpgradeStreamEnd); - stream2.on("timeout", onUpgradeStreamTimeout); - stream2[kHTTP2Session] = session; - stream2[kRequestStreamOnCloseError] = failUpgradeStream; - stream2.once("close", onUpgradeStreamClose); - ++session[kOpenStreams]; - stream2.setTimeout(requestTimeout); - }, "setupUpgradeStream"); + const upgradeState = { + abort, + finalizeRequest, + request, + requestTimeout, + responseReceived: false, + session, + stream: null + }; if (upgrade === "websocket") { if (session[kEnableConnectProtocol] === false) { util.errorRequest(client, request, new InformationalError("HTTP/2: Extended CONNECT protocol not supported by server")); @@ -8719,8 +8812,7 @@ var require_client_h2 = __commonJS({ session.unref(); return false; } - stream[kHTTP2Stream] = true; - setupUpgradeStream(stream); + setupUpgradeStream(stream, upgradeState); return true; } stream = requestStream(headers, { endStream: false, signal }); @@ -8728,13 +8820,12 @@ var require_client_h2 = __commonJS({ session.unref(); return false; } - stream[kHTTP2Stream] = true; - setupUpgradeStream(stream); + setupUpgradeStream(stream, upgradeState); return true; } headers[HTTP2_HEADER_PATH] = path; headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https"; - const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (body && typeof body.read === "function") { body.read(0); } @@ -8772,115 +8863,35 @@ var require_client_h2 = __commonJS({ } channels.sendHeaders.publish({ request, headers: header, socket: session[kSocket] }); } - const shouldEndStream = body === null; + const shouldEndStream = body === null || contentLength === 0; + const state = { + abort, + body, + client, + contentLength, + expectsPayload, + finalizeRequest, + request, + requestTimeout, + responseReceived: false, + session, + stream: null + }; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; - stream = requestStream(headers, { endStream: shouldEndStream, signal }); - if (stream == null) { - return false; - } - stream[kHTTP2Stream] = true; - bindRequestToStream(request, stream, null); - } else { - stream = requestStream(headers, { - endStream: shouldEndStream, - signal - }); - if (stream == null) { - return false; - } - stream[kHTTP2Stream] = true; - bindRequestToStream(request, stream, null); } + stream = requestStream(headers, { endStream: shouldEndStream, signal }); + if (stream == null) { + return false; + } + stream[kHTTP2Stream] = true; + stream[kRequestStreamState] = state; + state.stream = stream; + bindRequestToStream(request, stream, null); ++session[kOpenStreams]; stream.setTimeout(requestTimeout); - let responseReceived = false; - const onData = /* @__PURE__ */ __name((chunk) => { - if (request.aborted || request.completed) { - return; - } - if (request.onResponseData(chunk) === false) { - stream.pause(); - } - }, "onData"); - const removeRequestStreamListeners = /* @__PURE__ */ __name(() => { - stream.off("error", noop); - stream.off("continue", writeBodyH2); - stream.off("response", onResponse); - stream.off("end", onEnd); - stream.off("error", onError); - stream.off("frameError", onFrameError); - stream.off("aborted", onAborted); - stream.off("timeout", onTimeout); - stream.off("trailers", onTrailers); - stream.off("data", onData); - }, "removeRequestStreamListeners"); - const releaseRequestStream = /* @__PURE__ */ __name(() => { - if (request[kRequestStream] === stream) { - detachRequestFromStream(request); - } - removeRequestStreamListeners(); - if (!stream.destroyed && !stream.closed) { - stream.once("error", noop); - } - }, "releaseRequestStream"); - const onResponse = /* @__PURE__ */ __name((headers2) => { - stream.off("response", onResponse); - const statusCode = headers2[HTTP2_HEADER_STATUS]; - delete headers2[HTTP2_HEADER_STATUS]; - request.onResponseStarted(); - responseReceived = true; - if (request.aborted) { - releaseRequestStream(); - return; - } - if (request.onResponseStart(Number(statusCode), headers2, stream.resume.bind(stream), "") === false) { - stream.pause(); - } - stream.on("data", onData); - }, "onResponse"); - const onEnd = /* @__PURE__ */ __name(() => { - stream.off("end", onEnd); - releaseRequestStream(); - if (responseReceived) { - if (!request.aborted && !request.completed) { - request.onResponseEnd({}); - } - finalizeRequest(); - } else { - abort(new InformationalError("HTTP/2: stream half-closed (remote)"), true); - } - }, "onEnd"); stream[kHTTP2Session] = session; - stream[kRequestStreamOnData] = onData; stream.once("close", onRequestStreamClose); - const onError = /* @__PURE__ */ __name(function(err) { - stream.off("error", onError); - releaseRequestStream(); - abort(err); - }, "onError"); - const onFrameError = /* @__PURE__ */ __name((type, code) => { - stream.off("frameError", onFrameError); - releaseRequestStream(); - abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)); - }, "onFrameError"); - const onAborted = /* @__PURE__ */ __name(() => { - stream.off("data", onData); - }, "onAborted"); - const onTimeout = /* @__PURE__ */ __name(() => { - releaseRequestStream(); - const err = new InformationalError(`HTTP/2: "stream timeout after ${requestTimeout}"`); - abort(err); - }, "onTimeout"); - const onTrailers = /* @__PURE__ */ __name((trailers) => { - stream.off("trailers", onTrailers); - if (request.aborted || request.completed) { - return; - } - releaseRequestStream(); - request.onResponseEnd(trailers); - finalizeRequest(); - }, "onTrailers"); bindRequestToStream(request, stream, releaseRequestStream); if (expectContinue) { stream.once("continue", writeBodyH2); @@ -8893,69 +8904,169 @@ var require_client_h2 = __commonJS({ stream.on("timeout", onTimeout); stream.once("trailers", onTrailers); if (!expectContinue) { - writeBodyH2(); + writeBodyH2.call(stream); } return true; - function writeBodyH2() { - if (!body || contentLength === 0) { - writeBuffer( - abort, - stream, - null, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } else if (util.isBuffer(body)) { - writeBuffer( + } + __name(writeH2, "writeH2"); + function removeRequestStreamListeners(stream) { + stream.off("error", noop); + stream.off("continue", writeBodyH2); + stream.off("response", onResponse); + stream.off("end", onEnd); + stream.off("error", onError); + stream.off("frameError", onFrameError); + stream.off("aborted", onAborted); + stream.off("timeout", onTimeout); + stream.off("trailers", onTrailers); + stream.off("data", onData); + } + __name(removeRequestStreamListeners, "removeRequestStreamListeners"); + function releaseRequestStream(stream) { + if (stream == null) { + return; + } + const state = stream[kRequestStreamState]; + if (state == null) { + return; + } + const { request } = state; + if (request[kRequestStream] === stream) { + detachRequestFromStream(request); + } + removeRequestStreamListeners(stream); + if (!stream.destroyed && !stream.closed) { + stream.once("error", noop); + } + } + __name(releaseRequestStream, "releaseRequestStream"); + function onData(chunk) { + const stream = this; + const { request } = stream[kRequestStreamState]; + if (request.aborted || request.completed) { + return; + } + if (request.onResponseData(chunk) === false) { + stream.pause(); + } + } + __name(onData, "onData"); + function onResponse(headers) { + const stream = this; + const state = stream[kRequestStreamState]; + const { request } = state; + stream.off("response", onResponse); + const statusCode = headers[HTTP2_HEADER_STATUS]; + delete headers[HTTP2_HEADER_STATUS]; + request.onResponseStarted(); + state.responseReceived = true; + if (request.aborted) { + releaseRequestStream(stream); + return; + } + if (request.onResponseStart(Number(statusCode), headers, stream.resume.bind(stream), "") === false) { + stream.pause(); + } + stream.on("data", onData); + } + __name(onResponse, "onResponse"); + function onEnd() { + const stream = this; + const state = stream[kRequestStreamState]; + const { request } = state; + stream.off("end", onEnd); + releaseRequestStream(stream); + if (state.responseReceived) { + if (!request.aborted && !request.completed) { + request.onResponseEnd({}); + } + state.finalizeRequest(); + } else { + state.abort(new InformationalError("HTTP/2: stream half-closed (remote)"), true); + } + } + __name(onEnd, "onEnd"); + function onError(err) { + const stream = this; + const state = stream[kRequestStreamState]; + stream.off("error", onError); + releaseRequestStream(stream); + state.abort(err); + } + __name(onError, "onError"); + function onFrameError(type, code) { + const stream = this; + const state = stream[kRequestStreamState]; + stream.off("frameError", onFrameError); + releaseRequestStream(stream); + state.abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)); + } + __name(onFrameError, "onFrameError"); + function onAborted() { + this.off("data", onData); + } + __name(onAborted, "onAborted"); + function onTimeout() { + const stream = this; + const state = stream[kRequestStreamState]; + releaseRequestStream(stream); + const err = new InformationalError(`HTTP/2: "stream timeout after ${state.requestTimeout}"`); + state.abort(err); + } + __name(onTimeout, "onTimeout"); + function onTrailers(trailers) { + const stream = this; + const state = stream[kRequestStreamState]; + const { request } = state; + stream.off("trailers", onTrailers); + if (request.aborted || request.completed) { + return; + } + releaseRequestStream(stream); + request.onResponseEnd(trailers); + state.finalizeRequest(); + } + __name(onTrailers, "onTrailers"); + function writeBodyH2() { + const stream = this; + const state = stream[kRequestStreamState]; + const { abort, body, client, contentLength, expectsPayload, request } = state; + if (!body || contentLength === 0) { + writeBuffer( + abort, + stream, + null, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } else if (util.isBuffer(body)) { + writeBuffer( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } else if (util.isBlobLike(body)) { + if (typeof body.stream === "function") { + writeIterable( abort, stream, - body, + body.stream(), client, request, client[kSocket], contentLength, expectsPayload ); - } else if (util.isBlobLike(body)) { - if (typeof body.stream === "function") { - writeIterable( - abort, - stream, - body.stream(), - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } else { - writeBlob( - abort, - stream, - body, - client, - request, - client[kSocket], - contentLength, - expectsPayload - ); - } - } else if (util.isStream(body)) { - writeStream( - abort, - client[kSocket], - expectsPayload, - stream, - body, - client, - request, - contentLength - ); - } else if (util.isIterable(body)) { - writeIterable( + } else { + writeBlob( abort, stream, body, @@ -8965,13 +9076,34 @@ var require_client_h2 = __commonJS({ contentLength, expectsPayload ); - } else { - assert(false); } + } else if (util.isStream(body)) { + writeStream( + abort, + client[kSocket], + expectsPayload, + stream, + body, + client, + request, + contentLength + ); + } else if (util.isIterable(body)) { + writeIterable( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } else { + assert(false); } - __name(writeBodyH2, "writeBodyH2"); } - __name(writeH2, "writeH2"); + __name(writeBodyH2, "writeBodyH2"); function writeBuffer(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { try { if (body != null && util.isBuffer(body)) { @@ -9019,7 +9151,6 @@ var require_client_h2 = __commonJS({ } __name(writeStream, "writeStream"); async function writeBlob(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { - assert(contentLength === body.size, "blob body must have content length"); try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError(); @@ -9144,6 +9275,7 @@ var require_client = __commonJS({ kOnError, kHTTPContext, kMaxConcurrentStreams, + kHostAuthority, kHTTP2InitialWindowSize, kHTTP2ConnectionWindowSize, kResume, @@ -9300,6 +9432,7 @@ var require_client = __commonJS({ }, callback), "connect"); } this[kUrl] = util.parseOrigin(url); + this[kHostAuthority] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}`; this[kConnector] = connect2; this[kPipelining] = pipelining != null ? pipelining : 1; this[kMaxHeadersSize] = maxHeaderSize; @@ -9311,7 +9444,7 @@ var require_client = __commonJS({ this[kLocalAddress] = localAddress != null ? localAddress : null; this[kResuming] = 0; this[kNeedDrain] = 0; - this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r + this[kHostHeader] = `host: ${this[kHostAuthority]}\r `; this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; @@ -9635,6 +9768,7 @@ var require_pool = __commonJS({ kNeedDrain, kAddClient, kGetDispatcher, + kHasDispatcher, kRemoveClient } = require_pool_base(); var Client = require_client(); @@ -9729,6 +9863,24 @@ var require_pool = __commonJS({ return dispatcher; } } + [kHasDispatcher]() { + const clientTtlOption = this[kOptions].clientTtl; + for (let i = 0; i < this[kClients].length; i++) { + const client = this[kClients][i]; + if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && Date.now() - client.ttl > clientTtlOption) { + this[kRemoveClient](client); + i--; + } else if (!client[kNeedDrain]) { + return true; + } + } + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + const dispatcher = this[kFactory](this[kUrl], this[kOptions]); + this[kAddClient](dispatcher); + return true; + } + return false; + } }; module2.exports = Pool; } @@ -10531,7 +10683,6 @@ var require_socks5_client = __commonJS({ var require_socks5_proxy_agent = __commonJS({ "lib/dispatcher/socks5-proxy-agent.js"(exports2, module2) { "use strict"; - var net = require("node:net"); var { URL: URL2 } = require("node:url"); var tls; var DispatcherBase = require_dispatcher_base(); @@ -10545,6 +10696,7 @@ var require_socks5_proxy_agent = __commonJS({ var kProxyUrl = /* @__PURE__ */ Symbol("proxy url"); var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); var kProxyAuth = /* @__PURE__ */ Symbol("proxy auth"); + var kProxyProtocol = /* @__PURE__ */ Symbol("proxy protocol"); var kPools = /* @__PURE__ */ Symbol("pools"); var kConnector = /* @__PURE__ */ Symbol("connector"); var experimentalWarningEmitted = false; @@ -10570,6 +10722,7 @@ var require_socks5_proxy_agent = __commonJS({ } this[kProxyUrl] = url; this[kProxyHeaders] = options.headers || {}; + this[kProxyProtocol] = options.proxyTls ? "https:" : "http:"; this[kProxyAuth] = { username: options.username || (url.username ? decodeURIComponent(url.username) : null), password: options.password || (url.password ? decodeURIComponent(url.password) : null) @@ -10588,21 +10741,19 @@ var require_socks5_proxy_agent = __commonJS({ const proxyPort = parseInt(this[kProxyUrl].port) || 1080; debug("creating SOCKS5 connection to", proxyHost, proxyPort); const socketReady = Promise.withResolvers(); - const onSocketConnect = /* @__PURE__ */ __name(() => { - socket.removeListener("error", onSocketError); - socketReady.resolve(socket); - }, "onSocketConnect"); - const onSocketError = /* @__PURE__ */ __name((err) => { - socket.removeListener("connect", onSocketConnect); - socketReady.reject(err); - }, "onSocketError"); - const socket = net.connect({ + this[kConnector]({ + hostname: proxyHost, host: proxyHost, - port: proxyPort + port: proxyPort, + protocol: this[kProxyProtocol] + }, (err, socket2) => { + if (err) { + socketReady.reject(err); + } else { + socketReady.resolve(socket2); + } }); - socket.once("connect", onSocketConnect); - socket.once("error", onSocketError); - await socketReady.promise; + const socket = await socketReady.promise; const socks5Client = new Socks5Client(socket, this[kProxyAuth]); socks5Client.on("error", (err) => { debug("SOCKS5 error:", err); @@ -10655,7 +10806,7 @@ var require_socks5_proxy_agent = __commonJS({ /** * Dispatch a request through the SOCKS5 proxy */ - async [kDispatch](opts, handler) { + [kDispatch](opts, handler) { const { origin } = opts; debug("dispatching request to", origin, "via SOCKS5"); try { @@ -10700,8 +10851,12 @@ var require_socks5_proxy_agent = __commonJS({ return pool[kDispatch](opts, handler); } catch (err) { debug("dispatch error:", err); - if (typeof handler.onError === "function") { + if (typeof handler.onResponseError === "function") { + handler.onResponseError(null, err); + return false; + } else if (typeof handler.onError === "function") { handler.onError(err); + return false; } else { throw err; } @@ -10749,6 +10904,7 @@ var require_proxy_agent = __commonJS({ var kConnectEndpoint = /* @__PURE__ */ Symbol("connect endpoint function"); var kConnectEndpointHTTP1 = /* @__PURE__ */ Symbol("connect endpoint function (http/1.1 only)"); var kTunnelProxy = /* @__PURE__ */ Symbol("tunnel proxy"); + var proxyAuthorization = "proxy-authorization"; function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -10982,6 +11138,9 @@ var require_proxy_agent = __commonJS({ if (Array.isArray(headers)) { const headersPair = {}; for (let i = 0; i < headers.length; i += 2) { + if (isProxyAuthorizationHeader(headers[i])) { + throwProxyAuthError(); + } headersPair[headers[i]] = headers[i + 1]; } return headersPair; @@ -10990,12 +11149,21 @@ var require_proxy_agent = __commonJS({ } __name(buildHeaders, "buildHeaders"); function throwIfProxyAuthIsSent(headers) { - const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization"); - if (existProxyAuth) { - throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); + for (const key in headers) { + if (isProxyAuthorizationHeader(key)) { + throwProxyAuthError(); + } } } __name(throwIfProxyAuthIsSent, "throwIfProxyAuthIsSent"); + function isProxyAuthorizationHeader(key) { + return key.length === proxyAuthorization.length && key.toLowerCase() === proxyAuthorization; + } + __name(isProxyAuthorizationHeader, "isProxyAuthorizationHeader"); + function throwProxyAuthError() { + throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); + } + __name(throwProxyAuthError, "throwProxyAuthError"); module2.exports = ProxyAgent; } }); @@ -13944,6 +14112,8 @@ var require_fetch = __commonJS({ origin: url.origin, method: request.method, body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body2, + // Preserve the serialized fetch body for MockAgent net-connect fallthroughs. + __mockAgentBodyForDispatch: body2, headers: request.headersList.entries, maxRedirections: 0, upgrade: request.mode === "websocket" ? "websocket" : void 0, @@ -17267,7 +17437,6 @@ var require_api_stream = __commonJS({ "lib/api/api-stream.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { finished } = require("node:stream"); var { AsyncResource } = require("node:async_hooks"); var { InvalidArgumentError, InvalidReturnValueError } = require_errors(); var util = require_util(); @@ -17275,6 +17444,47 @@ var require_api_stream = __commonJS({ function noop() { } __name(noop, "noop"); + function getWritableError(stream2) { + return stream2.errored ?? stream2.writableErrored ?? stream2._writableState?.errored; + } + __name(getWritableError, "getWritableError"); + function createPrematureCloseError() { + const err = new Error("Premature close"); + err.code = "ERR_STREAM_PREMATURE_CLOSE"; + return err; + } + __name(createPrematureCloseError, "createPrematureCloseError"); + function trackWritableLifecycle(stream2, callback) { + let done = false; + const cleanup = /* @__PURE__ */ __name(() => { + stream2.removeListener("close", onClose); + stream2.removeListener("error", onError); + stream2.removeListener("finish", onFinish); + }, "cleanup"); + const finish = /* @__PURE__ */ __name((err, fromErrorEvent = false) => { + if (done) { + return; + } + done = true; + cleanup(); + callback(err, fromErrorEvent); + }, "finish"); + const onClose = /* @__PURE__ */ __name(() => { + const err = getWritableError(stream2); + finish(err ?? (!stream2.writableFinished ? createPrematureCloseError() : void 0)); + }, "onClose"); + const onError = /* @__PURE__ */ __name((err) => finish(err, true), "onError"); + const onFinish = /* @__PURE__ */ __name(() => finish(), "onFinish"); + stream2.on("close", onClose); + stream2.on("error", onError); + stream2.on("finish", onFinish); + if (stream2.closed) { + process.nextTick(onClose); + } else if (stream2.writableFinished) { + process.nextTick(onFinish); + } + } + __name(trackWritableLifecycle, "trackWritableLifecycle"); var StreamHandler = class extends AsyncResource { static { __name(this, "StreamHandler"); @@ -17358,16 +17568,16 @@ var require_api_stream = __commonJS({ if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); } - finished(res, { readable: false }, (err) => { + trackWritableLifecycle(res, (err, fromErrorEvent) => { const { callback, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2?.readable) { - util.destroy(res2, err); + util.destroy(res2, fromErrorEvent ? void 0 : err); } this.callback = null; this.runInAsyncScope(callback, null, err || null, { opaque: opaque2, trailers }); if (err) { - abort(); + abort(err); } }); res.on("drain", () => controller.resume()); @@ -17457,6 +17667,7 @@ var require_api_pipeline = __commonJS({ RequestAbortedError } = require_errors(); var util = require_util(); + var { kBodyUsed } = require_symbols(); var { addSignal, removeSignal } = require_abort_signal(); function noop() { } @@ -17469,6 +17680,7 @@ var require_api_pipeline = __commonJS({ constructor() { super({ autoDestroy: true }); this[kResume] = null; + this[kBodyUsed] = true; } _read() { const { [kResume]: resume } = this; diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c index a26f2dc7fa4649..90cb40d98d47ab 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -460,27 +460,28 @@ static ssize_t uv__preadv_or_pwritev(int fd, off_t off, _Atomic uintptr_t* cache, int is_pread) { - ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t); - void* p; + union { + ssize_t (*f)(int, const struct iovec*, uv__iovcnt, off_t); + void* p; + } u; - p = (void*) atomic_load_explicit(cache, memory_order_relaxed); - if (p == NULL) { + u.p = (void*) atomic_load_explicit(cache, memory_order_relaxed); + if (u.p == NULL) { #ifdef RTLD_DEFAULT /* Try _LARGEFILE_SOURCE version of preadv/pwritev first, * then fall back to the plain version, for libcs like musl. */ - p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64"); - if (p == NULL) - p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev"); + u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv64" : "pwritev64"); + if (u.p == NULL) + u.p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev"); dlerror(); /* Clear errors. */ #endif /* RTLD_DEFAULT */ - if (p == NULL) - p = is_pread ? uv__preadv_emul : uv__pwritev_emul; - atomic_store_explicit(cache, (uintptr_t) p, memory_order_relaxed); + if (u.p == NULL) + u.f = is_pread ? uv__preadv_emul : uv__pwritev_emul; + atomic_store_explicit(cache, (uintptr_t) u.p, memory_order_relaxed); } - f = p; - return f(fd, bufs, nbufs, off); + return u.f(fd, bufs, nbufs, off); } diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index e5a7632909fc65..f1e8928d37ebf4 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -957,7 +957,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { int i; for (i = 0; i < count; i++) - uv__free(cpu_infos[i].model); + uv__free((char*) cpu_infos[i].model); uv__free(cpu_infos); #endif /* __linux__ */ diff --git a/deps/v8/src/codegen/external-reference.h b/deps/v8/src/codegen/external-reference.h index eecaf7928c18b5..25121bcc2fc990 100644 --- a/deps/v8/src/codegen/external-reference.h +++ b/deps/v8/src/codegen/external-reference.h @@ -375,6 +375,8 @@ enum class IsolateFieldId : uint8_t; IF_WASM(V, wasm_WebAssemblyExceptionGetArg, \ "wasm::WebAssemblyExceptionGetArg") \ IF_WASM(V, wasm_WebAssemblyExceptionIs, "wasm::WebAssemblyExceptionIs") \ + IF_WASM(V, wasm_WebAssemblyExceptionGetStack, \ + "wasm::WebAssemblyExceptionGetStack") \ IF_WASM(V, wasm_WebAssemblyGlobal, "wasm::WebAssemblyGlobal") \ IF_WASM(V, wasm_WebAssemblyGlobalGetValue, \ "wasm::WebAssemblyGlobalGetValue") \ diff --git a/deps/v8/src/wasm/wasm-js.cc b/deps/v8/src/wasm/wasm-js.cc index 32c39a55c418c9..d8866284523f07 100644 --- a/deps/v8/src/wasm/wasm-js.cc +++ b/deps/v8/src/wasm/wasm-js.cc @@ -3119,6 +3119,15 @@ void WebAssemblyExceptionIsImpl( info.GetReturnValue().Set(tag_object->tag() == *tag); } +void WebAssemblyExceptionGetStackImpl( + const v8::FunctionCallbackInfo& info) { + WasmJSApiScope js_api_scope{info, "WebAssembly.Exception.stack()"}; + auto [isolate, i_isolate, thrower] = js_api_scope.isolates_and_thrower(); + EXTRACT_THIS(exception, WasmExceptionPackage); + + info.GetReturnValue().Set(v8::Undefined(isolate)); +} + void WebAssemblyGlobalGetValueCommon(WasmJSApiScope& js_api_scope) { auto [isolate, i_isolate, thrower] = js_api_scope.isolates_and_thrower(); auto& info = js_api_scope.callback_info(); // Needed by EXTRACT_THIS. @@ -3562,6 +3571,7 @@ void WasmJs::PrepareForSnapshot(Isolate* isolate) { { DirectHandle exception_constructor = InstallConstructorFunc( isolate, webassembly, "Exception", wasm::WebAssemblyException); + exception_constructor->shared()->set_length(2); SetDummyInstanceTemplate(isolate, exception_constructor); DirectHandle exception_proto = SetupConstructor( isolate, exception_constructor, WASM_EXCEPTION_PACKAGE_TYPE, @@ -3571,6 +3581,8 @@ void WasmJs::PrepareForSnapshot(Isolate* isolate) { wasm::WebAssemblyExceptionGetArg, 2); InstallFunc(isolate, exception_proto, "is", wasm::WebAssemblyExceptionIs, 1); + InstallGetter(isolate, exception_proto, "stack", + wasm::WebAssemblyExceptionGetStack); native_context->set_wasm_exception_constructor(*exception_constructor); DirectHandle initial_map(exception_constructor->initial_map(), diff --git a/deps/v8/src/wasm/wasm-js.h b/deps/v8/src/wasm/wasm-js.h index 3477abf1c4e809..901ba8c342af14 100644 --- a/deps/v8/src/wasm/wasm-js.h +++ b/deps/v8/src/wasm/wasm-js.h @@ -34,6 +34,7 @@ V8_EXPORT_PRIVATE std::unique_ptr StartStreamingForTesting( V(WebAssemblyCompile) \ V(WebAssemblyException) \ V(WebAssemblyExceptionGetArg) \ + V(WebAssemblyExceptionGetStack) \ V(WebAssemblyExceptionIs) \ V(WebAssemblyGlobal) \ V(WebAssemblyGlobalGetValue) \ diff --git a/deps/v8/test/mjsunit/wasm/exceptions-api.js b/deps/v8/test/mjsunit/wasm/exceptions-api.js index 25ba9c7e80ec27..9ceb2d506dfcbf 100644 --- a/deps/v8/test/mjsunit/wasm/exceptions-api.js +++ b/deps/v8/test/mjsunit/wasm/exceptions-api.js @@ -106,13 +106,19 @@ d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js"); print(arguments.callee.name); let tag = new WebAssembly.Tag({parameters: []}); let exn = new WebAssembly.Exception(tag, []); + assertTrue('stack' in exn); assertEquals(undefined, exn.stack); exn = new WebAssembly.Exception(tag, [], {traceStack: false}); + assertTrue('stack' in exn); assertEquals(undefined, exn.stack); exn = new WebAssembly.Exception(tag, [], {traceStack: true}); assertTrue(exn.stack.indexOf(arguments.callee.name) > 0); assertThrows(() => new WebAssembly.Exception(tag, [], 0), TypeError, /Argument 2 is not an object/); + // The stack getter may only be used with a receiver that is a + // WebAssembly.Exception. + let proto = WebAssembly.Exception.prototype; + assertThrows(() => proto.stack, TypeError); })(); (function TestCatchJSException() { @@ -319,3 +325,7 @@ function TestGetArgHelper(types_str, types, values) { // Don't catch with implicit wrapping. assertThrowsEquals(() => instance.exports.test(obj), obj); })(); + +(function TestExceptionConstructorLength() { + assertEquals(2, WebAssembly.Exception.length); +})(); diff --git a/deps/v8/test/wasm-js/wasm-js.status b/deps/v8/test/wasm-js/wasm-js.status index ec3d4289eba09a..c44b0d6dd2059c 100644 --- a/deps/v8/test/wasm-js/wasm-js.status +++ b/deps/v8/test/wasm-js/wasm-js.status @@ -42,6 +42,10 @@ 'wpt/table/type.tentative': [FAIL], 'wpt/tag/type.tentative': [FAIL], + # TODO(mliedtke): This requires synchronizing the spec-tests with their newest version. + 'wpt/exception/constructor.tentative': [FAIL], + 'exception/constructor.tentative': [FAIL], + # Broken test (forgot to define JS function 'nulls()'). 'table/grow-memory64': [FAIL], diff --git a/doc/api/assert.md b/doc/api/assert.md index 0ca4d54ea5100e..d89a7f2c62380b 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -1683,7 +1683,7 @@ If no arguments are passed in at all `message` will be set to the string: Be aware that in the `repl` the error message will be different to the one thrown in a file! See below for further details. - + ```mjs import assert from 'node:assert/strict'; @@ -1720,7 +1720,7 @@ assert.ok(0); // assert.ok(0) ``` - + ```cjs const assert = require('node:assert/strict'); diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 2aeb253337f2df..e90759b16d3fa8 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -591,7 +591,6 @@ the error passed to the callback will be an `AbortError`: ```cjs const { fork } = require('node:child_process'); -const process = require('node:process'); if (process.argv[2] === 'child') { setTimeout(() => { @@ -933,7 +932,6 @@ Example of a long-running process, by detaching and also ignoring its parent ```cjs const { spawn } = require('node:child_process'); -const process = require('node:process'); const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, @@ -1077,7 +1075,6 @@ pipes between the parent and child. The value is one of the following: ```cjs const { spawn } = require('node:child_process'); -const process = require('node:process'); // Child will use parent's stdios. spawn('prg', [], { stdio: 'inherit' }); @@ -1833,7 +1830,6 @@ process to wait for the child process to exit before exiting itself. ```cjs const { spawn } = require('node:child_process'); -const process = require('node:process'); const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, @@ -2289,7 +2285,6 @@ the child and the parent processes. ```cjs const { spawn } = require('node:child_process'); -const process = require('node:process'); const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, diff --git a/doc/api/cli.md b/doc/api/cli.md index 61dd51b3de9dba..d2dceb7108cd82 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1064,7 +1064,8 @@ The alias `--experimental-default-config-file` is equivalent to `--experimental-config-file` without an argument. Node.js will read the configuration file and apply the settings. The configuration file should be a JSON file with the following structure. `vX.Y.Z` -in the `$schema` must be replaced with the version of Node.js you are using. +in the `$schema` must be replaced with the version of Node.js you are using or +`latest-vX.x` for the latest version of that major release line. ```json { @@ -1091,6 +1092,44 @@ The configuration file supports namespace-specific options: * Namespace fields like `test`, `watch`, and `permission` contain configuration specific to that subsystem. +The configuration file can target a specific Node.js major version with +`nodeVersion`: + +```json +{ + "nodeVersion": 25, + "nodeOptions": { + "watch-path": "src" + } +} +``` + +To keep multiple version-specific configurations in the same file, use the +`configs` array. Node.js will use the first entry whose `nodeVersion` matches +the current Node.js major version: + +```json +{ + "$schema": "https://nodejs.org/dist/latest-v26.x/docs/node-config-schema.json", + "configs": [ + { + "nodeVersion": 25, + "config": { + "$schema": "https://nodejs.org/dist/latest-v25.x/docs/node-config-schema.json", + "nodeOptions": { + "watch-path": "src" + } + } + } + ] +} +``` + +When `configs` is used, the top level may only contain `$schema` and +`configs`. Each `configs` item must define an integer `nodeVersion` and an +object `config`. A single top-level config does not require `nodeVersion`, but +if present it must match the current Node.js major version. + When a namespace is present in the configuration file, Node.js automatically enables the corresponding flag (e.g., `--test`, `--watch`, `--permission`). This allows you to configure @@ -1373,6 +1412,23 @@ Enable module mocking in the test runner. This feature requires `--allow-worker` if used with the [Permission Model][]. +### `--experimental-test-tag-filter=` + + + +> Stability: 1.0 - Early development + +Run only tests whose tag set contains ``. Tests declare tags via the +`tags` option on `test()`, `it()`, `suite()`, or `describe()`; tags +inherit from suites to nested tests by union. Filtering is +case-insensitive. + +The flag may be specified more than once; tests must contain **every** +filter value to run. See [Test tags][] for details on declaring and +inheriting tags. + ### `--experimental-vm-modules` - -```js +```console > console.count() default: 1 undefined @@ -274,9 +272,7 @@ added: v8.3.0 Resets the internal counter specific to `label`. - - -```js +```console > console.count('abc'); abc: 1 undefined diff --git a/doc/api/crypto.md b/doc/api/crypto.md index b2a4e0141989a1..19140fcff8440a 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -53,8 +53,6 @@ try { } ``` - - When using the lexical ESM `import` keyword, the error can only be caught if a handler for `process.on('uncaughtException')` is registered _before_ any attempt to load the module is made (using, for instance, @@ -6134,7 +6132,7 @@ changes: * `algorithm` {string | null | undefined} -* `data` {ArrayBuffer|Buffer|TypedArray|DataView} +* `data` {ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView|string} * `key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey} * `callback` {Function} * `err` {Error} @@ -6266,9 +6264,9 @@ changes: * `algorithm` {string|null|undefined} -* `data` {ArrayBuffer| Buffer|TypedArray|DataView} +* `data` {ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView|string} * `key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey} -* `signature` {ArrayBuffer|Buffer|TypedArray|DataView} +* `signature` {ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView} * `callback` {Function} * `err` {Error} * `result` {boolean} diff --git a/doc/api/debugger.md b/doc/api/debugger.md index 691b025c1d9929..5eeffd43e57f5f 100644 --- a/doc/api/debugger.md +++ b/doc/api/debugger.md @@ -10,6 +10,14 @@ Node.js includes a command-line debugging utility. The Node.js debugger client is not a full-featured debugger, but simple stepping and inspection are possible. +The debugger supports two modes of operation: [interactive mode][] and [non-interactive probe mode][]. + +## Interactive mode + +```console +$ node inspect [--port=] [ ...] [