@preventive/triage 1.0.0-alpha.8 → 1.0.0-alpha.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +202 -0
- package/README.md +16 -0
- package/api/reap.ts +16 -78
- package/cli.js +6 -0
- package/client/dependency-paths.d.ts +3 -0
- package/client/dependency-paths.js +36 -0
- package/client/finding-link.js +305 -0
- package/client/linked-findings.d.ts +1 -0
- package/client/linked-findings.js +115 -0
- package/common/bundle-commit.d.ts +1 -0
- package/common/bundle-commit.js +4 -0
- package/common/bundle-compare-diff.d.ts +6 -0
- package/common/bundle-compare-diff.js +377 -0
- package/common/bundle-compare-inputs.d.ts +3 -0
- package/common/bundle-compare-inputs.js +141 -0
- package/common/bundle-compare-versions.js +172 -0
- package/common/bundle-comparison.d.ts +8 -0
- package/common/bundle-comparison.js +69 -0
- package/common/bundle-imports.js +20 -0
- package/common/bundle-metadata.d.ts +15 -0
- package/common/bundle-metadata.js +226 -0
- package/common/bundle-pkg-of.d.ts +1 -0
- package/common/bundle-pkg-of.js +90 -0
- package/common/bundle-reasons.d.ts +6 -0
- package/common/bundle-reasons.js +58 -0
- package/common/bundle-source-links.d.ts +6 -0
- package/common/bundle-source-links.js +216 -0
- package/common/bundle-sourcemap.d.ts +10 -0
- package/common/bundle-sourcemap.js +100 -0
- package/common/bundle-sources.d.ts +10 -0
- package/common/bundle-sources.js +374 -0
- package/common/bundle-stats.js +41 -0
- package/common/bundle-tabs.js +1 -0
- package/common/code-language.js +66 -0
- package/common/default-scan-models.ts +36 -0
- package/common/dependency-reviews.d.ts +18 -0
- package/common/dependency-reviews.js +64 -0
- package/common/finding-duplicates.js +63 -0
- package/common/finding-filters.js +313 -0
- package/common/finding-id.js +47 -0
- package/common/finding-repo.d.ts +5 -0
- package/common/finding-repo.js +67 -0
- package/common/github-issue-labels.d.ts +1 -0
- package/common/github-issue-labels.js +11 -0
- package/common/github-pr.ts +56 -0
- package/common/gzip.js +59 -0
- package/common/line-diff.d.ts +14 -0
- package/common/line-diff.js +181 -0
- package/common/linked-workspace-groups.js +63 -0
- package/common/managed/agent-tasks.ts +292 -0
- package/common/managed/comments.ts +43 -0
- package/common/managed/dependency-routes.js +25 -0
- package/common/managed/directory-packages.ts +28 -0
- package/common/managed/finding-detail.d.ts +5 -0
- package/common/managed/finding-detail.js +75 -0
- package/common/managed/finding-values.d.ts +2 -0
- package/common/managed/finding-values.js +138 -0
- package/common/managed/github-agents.ts +114 -0
- package/common/managed/github-logins.ts +49 -0
- package/common/managed/lite-name.d.ts +2 -0
- package/common/managed/lite-name.js +20 -0
- package/common/managed/npm-packages.d.ts +9 -0
- package/common/managed/npm-packages.js +63 -0
- package/common/managed/permissions.ts +31 -0
- package/common/managed/report-content.ts +72 -0
- package/common/managed/report-filter.ts +120 -0
- package/common/managed/repository-alias.ts +65 -0
- package/common/managed/review-view-routes.js +23 -0
- package/common/managed/risk-routes.js +30 -0
- package/common/managed/roles.ts +41 -0
- package/common/managed/routes.d.ts +2 -0
- package/common/managed/routes.js +385 -0
- package/common/managed/scan-models.ts +6 -0
- package/common/managed/stasis-config.ts +7 -0
- package/common/managed/team-app.d.ts +19 -0
- package/common/managed/team-app.js +129 -0
- package/common/managed/team-filters.js +26 -0
- package/common/managed/triage.ts +83 -0
- package/common/managed/upload-seal.ts +126 -0
- package/common/pretty-json.js +98 -0
- package/common/pretty-kinds.js +20 -0
- package/common/pretty-print.d.ts +6 -0
- package/common/pretty-print.js +36 -0
- package/common/pretty-sourcemap.js +70 -0
- package/common/repo-commit.d.ts +4 -0
- package/common/repo-commit.js +30 -0
- package/common/revalidation-conflicts.js +48 -0
- package/common/revalidation-input-groups.js +56 -0
- package/common/save-error-reason.ts +20 -7
- package/common/scan-server.ts +13 -0
- package/common/security-links.d.ts +5 -0
- package/common/security-links.js +33 -0
- package/common/server-info.ts +46 -0
- package/common/sourcemap-listing.js +78 -0
- package/common/sourcemap-mappings.js +136 -0
- package/common/sourcemap-unlist.js +85 -0
- package/common/stasis-files.d.ts +5 -0
- package/common/stasis-files.js +20 -0
- package/common/stasis-tgz.d.ts +6 -0
- package/common/stasis-tgz.js +27 -0
- package/common/utf8.d.ts +3 -0
- package/common/utf8.js +45 -0
- package/common/whitespace-insensitive.js +19 -0
- package/common/workspace-app.js +91 -0
- package/common/workspace-groups.js +176 -0
- package/out/activity.js +2 -0
- package/out/brotli-fallback.js +3 -3
- package/out/chunk-2XUEZHIP.js +28 -0
- package/out/chunk-55YIWY3H.js +5 -0
- package/out/chunk-5AVGKFMR.js +1 -0
- package/out/chunk-5CJKUV53.js +1 -0
- package/out/chunk-5EAVJAD2.js +3 -0
- package/out/chunk-5M2X3QPK.js +6 -0
- package/out/chunk-5QWPKTCE.js +40 -0
- package/out/chunk-6CCSTJWB.js +1 -0
- package/out/chunk-6VOB5WXX.js +2 -0
- package/out/chunk-6Y6PZ2BU.js +9 -0
- package/out/chunk-74JZTGTO.js +11 -0
- package/out/chunk-7BKKYVWR.js +7 -0
- package/out/chunk-7C7DWL7I.js +1 -0
- package/out/chunk-7HP2VYIC.js +2 -0
- package/out/chunk-7YFJUT2P.js +1 -0
- package/out/chunk-7YO4QV5P.js +1 -0
- package/out/chunk-A4BBBHQU.js +1 -0
- package/out/chunk-B64CTMVU.js +4 -0
- package/out/chunk-BEKYZCPX.js +14 -0
- package/out/chunk-C4Z6ZBXV.js +10 -0
- package/out/chunk-CU3FPB3P.js +1 -0
- package/out/chunk-DEVAORP2.js +1 -0
- package/out/chunk-DUASGS2O.js +8 -0
- package/out/chunk-DUS5ARE2.js +53 -0
- package/out/chunk-EEJA7JBI.js +13 -0
- package/out/chunk-FSU2PLJL.js +1 -0
- package/out/chunk-GBMAXAYK.js +3 -0
- package/out/chunk-GO7FT4OD.js +1 -0
- package/out/chunk-GX5UXWT4.js +1 -0
- package/out/chunk-ITUKKCCK.js +10 -0
- package/out/chunk-IYPY47MC.js +1 -0
- package/out/chunk-JXBRWLMA.js +4 -0
- package/out/chunk-K4XJHM2T.js +1 -0
- package/out/chunk-LBD3M3J6.js +1 -0
- package/out/chunk-LVSLM7HB.js +1 -0
- package/out/chunk-LVW7WWV4.js +1 -0
- package/out/chunk-MV66NL3G.js +3 -0
- package/out/chunk-N57OWFKY.js +15 -0
- package/out/chunk-NRPC74AM.js +1 -0
- package/out/chunk-OOJM4CTU.js +1 -0
- package/out/chunk-OWSEQOL5.js +1 -0
- package/out/chunk-PKLVXUEI.js +11 -0
- package/out/chunk-PLGH63UC.js +2 -0
- package/out/chunk-PNHBZGDD.js +1 -0
- package/out/chunk-PTFYDJUP.js +1 -0
- package/out/chunk-PWFUOLZK.js +17 -0
- package/out/chunk-PXK7EU4V.js +1 -0
- package/out/chunk-QD3IBSF4.js +7 -0
- package/out/chunk-QI66YA4F.js +1 -0
- package/out/chunk-QRKFPLA4.js +80 -0
- package/out/chunk-R3NZFXVR.js +1 -0
- package/out/chunk-R5O6FAW4.js +2 -0
- package/out/chunk-RPNO56H2.js +1 -0
- package/out/chunk-SSPDMA6D.js +1 -0
- package/out/chunk-SZWPYLPC.js +1 -0
- package/out/chunk-TUII34K2.js +1 -0
- package/out/chunk-UJP4PQJA.js +1 -0
- package/out/chunk-UJSJMXEG.js +1 -0
- package/out/chunk-UR4WYMIP.js +1 -0
- package/out/chunk-VHEXSGGP.js +1 -0
- package/out/chunk-VYYUMYVW.js +9 -0
- package/out/chunk-VZPPX6MV.js +1 -0
- package/out/chunk-WCDYSIKG.js +1 -0
- package/out/chunk-XM4RLC4A.js +2 -0
- package/out/chunk-YKCRCNYZ.js +266 -0
- package/out/chunk-ZQHLECTI.js +1 -0
- package/out/client-managed-import.js +4 -0
- package/out/client-managed.js +37 -0
- package/out/client-sync.js +11 -17
- package/out/compare.js +26 -0
- package/out/dialogs.js +40 -0
- package/out/github-issue-authorized.html +3 -0
- package/out/github-issue-authorized.js +1 -0
- package/out/graph.js +19 -4
- package/out/index.html +104 -24
- package/out/prism.js +14 -10
- package/out/scan.js +2 -0
- package/out/stasis.svg +20 -0
- package/out/terminal.js +367 -39
- package/out/view.css +1 -1
- package/out/view.js +19 -147
- package/package.json +409 -64
- package/risk/actions/findings.js +161 -0
- package/risk/actions/resolve.js +287 -0
- package/risk/actions/scripts/commands.js +182 -0
- package/risk/actions/scripts/grade.js +113 -0
- package/risk/actions/scripts/packages.js +123 -0
- package/risk/actions/scripts/shell.js +169 -0
- package/risk/actions/uses.js +94 -0
- package/risk/actions/workflow.js +183 -0
- package/risk/files/characters.js +341 -0
- package/risk/files/hosts.js +206 -0
- package/risk/files/readability.js +185 -0
- package/risk/files/runs-code.js +563 -0
- package/risk/files/script.js +402 -0
- package/risk/files/source-map-link.js +43 -0
- package/risk/files/stamps.js +47 -0
- package/risk/index.d.ts +294 -0
- package/risk/index.js +12 -0
- package/risk/npm/assess.js +285 -0
- package/risk/npm/combined.js +68 -0
- package/risk/npm/compare.js +236 -0
- package/risk/npm/dependencies.js +172 -0
- package/risk/npm/diff.js +79 -0
- package/risk/npm/downloads.js +84 -0
- package/risk/npm/files.js +445 -0
- package/risk/npm/held.js +67 -0
- package/risk/npm/install-scripts.js +34 -0
- package/risk/npm/malware.js +38 -0
- package/risk/npm/manifest.js +65 -0
- package/risk/npm/new-dependency.js +60 -0
- package/risk/npm/old-version.js +108 -0
- package/risk/npm/registry.js +393 -0
- package/risk/npm/release.js +85 -0
- package/risk/npm/score.js +59 -0
- package/risk/npm/specs.js +124 -0
- package/risk/npm/tarball.js +169 -0
- package/server-common/database-config.ts +16 -0
- package/server-common/initialize.ts +18 -0
- package/server-common/npm-advisories.ts +101 -0
- package/{server → server-common}/origin.ts +5 -5
- package/server-common/reap.ts +48 -0
- package/server-common/scan-config.ts +19 -0
- package/server-common/standalone.ts +29 -0
- package/server-common/storage-crypto.ts +182 -0
- package/server-common/storage-log.ts +38 -0
- package/server-common/vercel-blob.ts +103 -0
- package/server-e2e/app.ts +487 -0
- package/{server → server-e2e}/bus-receiver.ts +2 -1
- package/{server → server-e2e}/cli.js +9 -4
- package/{server → server-e2e}/config.ts +50 -42
- package/{server → server-e2e}/db-neon.ts +2 -2
- package/{server → server-e2e}/db-revision-sql.ts +1 -1
- package/{server → server-e2e}/db-stmt.ts +2 -2
- package/{server → server-e2e}/db.ts +7 -7
- package/{server → server-e2e}/http.ts +44 -13
- package/{server → server-e2e}/hub.ts +40 -9
- package/server-e2e/index.ts +17 -0
- package/server-e2e/lifecycle.ts +95 -0
- package/{server → server-e2e}/neon-driver.ts +2 -2
- package/{server → server-e2e}/npm-proxy.ts +12 -145
- package/{server → server-e2e}/objstore/blob-vercel.ts +10 -114
- package/{server → server-e2e}/objstore/blob.ts +1 -1
- package/{server → server-e2e}/objstore/fetch-mint-guard.ts +2 -2
- package/{server → server-e2e}/objstore/handlers.ts +9 -8
- package/{server → server-e2e}/objstore/init.ts +19 -27
- package/{server → server-e2e}/objstore/reaper.ts +1 -1
- package/{server → server-e2e}/objstore/rest-deny.ts +1 -1
- package/{server → server-e2e}/objstore/rest-mint.ts +3 -3
- package/{server → server-e2e}/objstore/rest.ts +3 -3
- package/{server → server-e2e}/objstore/store-neon.ts +6 -10
- package/{server → server-e2e}/objstore/store.ts +7 -7
- package/{server → server-e2e}/objstore/tokens.ts +2 -2
- package/{server → server-e2e}/pubsub.ts +12 -9
- package/{server → server-e2e}/sign.ts +4 -4
- package/{server → server-e2e}/sse-server.ts +60 -33
- package/{server → server-e2e}/static.ts +18 -17
- package/{server → server-e2e}/sync-handlers.ts +64 -30
- package/{server → server-e2e}/ws-server.ts +20 -9
- package/server-managed/activity.ts +247 -0
- package/server-managed/agent-merges.ts +109 -0
- package/server-managed/app-agents.ts +23 -0
- package/server-managed/avatar-store.ts +13 -0
- package/server-managed/blob-store.ts +26 -0
- package/server-managed/brotli.ts +10 -0
- package/server-managed/bundle-advisories.ts +79 -0
- package/server-managed/bundle-advisory-inventory.ts +85 -0
- package/server-managed/bundle-build-diagnostics.d.ts +10 -0
- package/server-managed/bundle-build-diagnostics.js +23 -0
- package/server-managed/bundle-build-leases.ts +41 -0
- package/server-managed/bundle-build-worker.js +380 -0
- package/server-managed/bundle-build.ts +326 -0
- package/server-managed/bundle-cache.ts +261 -0
- package/server-managed/bundle-catalog.ts +29 -0
- package/server-managed/bundle-commits.ts +133 -0
- package/server-managed/bundle-dependency-reviews.ts +91 -0
- package/server-managed/bundle-store.ts +24 -0
- package/server-managed/bundle-summary-cache.ts +139 -0
- package/server-managed/bundle-validation.ts +33 -0
- package/server-managed/bundle.ts +151 -0
- package/server-managed/cache-storage.ts +20 -0
- package/server-managed/cli.js +21 -0
- package/server-managed/combined.ts +43 -0
- package/server-managed/comments.ts +138 -0
- package/server-managed/commit-coauthors.ts +105 -0
- package/server-managed/commit-lockfiles.ts +78 -0
- package/server-managed/comparison.ts +51 -0
- package/server-managed/config.ts +163 -0
- package/server-managed/content-access.ts +15 -0
- package/server-managed/crypto.ts +25 -0
- package/server-managed/db-methods.ts +1914 -0
- package/server-managed/db-neon.ts +398 -0
- package/server-managed/db-schema.ts +263 -0
- package/server-managed/db-table-names.ts +22 -0
- package/server-managed/db.ts +149 -0
- package/server-managed/dependabot-access.ts +61 -0
- package/server-managed/dependabot-alerts.ts +180 -0
- package/server-managed/dependency-review-comments.ts +143 -0
- package/server-managed/dependency-reviews.ts +369 -0
- package/server-managed/github-accounts.ts +59 -0
- package/server-managed/github-actions.ts +71 -0
- package/server-managed/github-app.ts +347 -0
- package/server-managed/github-errors.ts +92 -0
- package/server-managed/github-graphql.ts +42 -0
- package/server-managed/github-issue-links.ts +264 -0
- package/server-managed/github-issue-oauth.ts +30 -0
- package/server-managed/github-issues.ts +157 -0
- package/server-managed/github-link-oauth.ts +56 -0
- package/server-managed/github-links.ts +204 -0
- package/server-managed/github-metadata.ts +213 -0
- package/server-managed/github-oauth.ts +264 -0
- package/server-managed/github-pulls.ts +257 -0
- package/server-managed/github-requests.ts +181 -0
- package/server-managed/github-users.ts +30 -0
- package/server-managed/github-values.ts +26 -0
- package/server-managed/history-windows.ts +172 -0
- package/server-managed/http-response.ts +76 -0
- package/server-managed/http.ts +6324 -0
- package/server-managed/import-triage.ts +51 -0
- package/server-managed/index.ts +204 -0
- package/server-managed/kept-briefly.ts +37 -0
- package/server-managed/kept.ts +28 -0
- package/server-managed/link-reports.ts +149 -0
- package/server-managed/listed-activity.ts +39 -0
- package/server-managed/locked-packages.ts +234 -0
- package/server-managed/lockfile-scope.ts +58 -0
- package/server-managed/lru.ts +30 -0
- package/server-managed/managed-issues.ts +92 -0
- package/server-managed/management-catalog.ts +45 -0
- package/server-managed/management.ts +116 -0
- package/server-managed/npm-delta-worker.js +142 -0
- package/server-managed/npm-delta.ts +277 -0
- package/server-managed/npm-insights.ts +455 -0
- package/server-managed/npm-kept.ts +265 -0
- package/server-managed/npm-loads.ts +259 -0
- package/server-managed/npm-manifest.ts +117 -0
- package/server-managed/npm-packages.ts +469 -0
- package/server-managed/npm-patch-paths.ts +86 -0
- package/server-managed/npm-patch.ts +455 -0
- package/server-managed/npm-provenance.ts +127 -0
- package/server-managed/npm-risk.ts +287 -0
- package/server-managed/object-storage-disk.ts +147 -0
- package/server-managed/object-storage-vercel.ts +71 -0
- package/server-managed/object-storage.ts +82 -0
- package/server-managed/package-entry-points.ts +127 -0
- package/server-managed/pretty-copies.ts +22 -0
- package/server-managed/pretty-format.d.ts +3 -0
- package/server-managed/pretty-format.js +13 -0
- package/server-managed/pretty-print.ts +442 -0
- package/server-managed/public-workspace.ts +243 -0
- package/server-managed/pull-comment-reviews.ts +161 -0
- package/server-managed/pull-dependencies.ts +370 -0
- package/server-managed/pull-dependency-reviews.ts +407 -0
- package/server-managed/pull-reviews.ts +202 -0
- package/server-managed/queue.ts +54 -0
- package/server-managed/release-commits.ts +85 -0
- package/server-managed/rename-diff-worker.js +30 -0
- package/server-managed/rename-diff.ts +237 -0
- package/server-managed/repo-path.ts +21 -0
- package/server-managed/report-migration.ts +32 -0
- package/server-managed/report-opening.ts +77 -0
- package/server-managed/report-query.ts +10 -0
- package/server-managed/report-response.ts +16 -0
- package/server-managed/report-sources.ts +185 -0
- package/server-managed/report-store.ts +77 -0
- package/server-managed/repository-actions.ts +220 -0
- package/server-managed/repository-agents.ts +422 -0
- package/server-managed/repository-aliases.ts +119 -0
- package/server-managed/repository-browser.ts +361 -0
- package/server-managed/repository-changes.ts +280 -0
- package/server-managed/repository-code.ts +222 -0
- package/server-managed/repository-dependency-reviews.ts +182 -0
- package/server-managed/repository-discovery.ts +83 -0
- package/server-managed/repository-history.ts +428 -0
- package/server-managed/repository-issues.ts +293 -0
- package/server-managed/repository-policy.ts +27 -0
- package/server-managed/repository-pulls.ts +207 -0
- package/server-managed/repository-pulse.ts +477 -0
- package/server-managed/repository-risk-assess.ts +108 -0
- package/server-managed/repository-risk-audit.ts +78 -0
- package/server-managed/repository-risk-caches.ts +37 -0
- package/server-managed/repository-risk-read.ts +260 -0
- package/server-managed/repository-risk-stasis.ts +61 -0
- package/server-managed/repository-risk-turn.ts +97 -0
- package/server-managed/repository-risk.ts +516 -0
- package/server-managed/repository-squashes.ts +160 -0
- package/server-managed/repository-stamp.ts +41 -0
- package/server-managed/request-timing.ts +63 -0
- package/server-managed/reviewed-dependencies.ts +170 -0
- package/server-managed/revisions.ts +35 -0
- package/server-managed/scan-downloads.ts +121 -0
- package/server-managed/session.ts +132 -0
- package/server-managed/slugs.ts +38 -0
- package/server-managed/solidity-entry-points.ts +71 -0
- package/server-managed/sql-postgres.ts +34 -0
- package/server-managed/sql.ts +107 -0
- package/server-managed/stasis-config.ts +147 -0
- package/server-managed/stasis-dependencies.ts +221 -0
- package/server-managed/static.ts +28 -0
- package/server-managed/storage-command.ts +16 -0
- package/server-managed/storage-db.ts +183 -0
- package/server-managed/storage-encryption.ts +288 -0
- package/server-managed/storage-maintenance.ts +259 -0
- package/server-managed/storage-payload.ts +121 -0
- package/server-managed/storage-stores.ts +91 -0
- package/server-managed/storage.ts +82 -0
- package/server-managed/team-app-summaries.ts +56 -0
- package/server-managed/team-app.ts +156 -0
- package/server-managed/team-catalog.ts +7 -0
- package/server-managed/team-feed.ts +180 -0
- package/server-managed/team-npm-scopes.ts +103 -0
- package/server-managed/team-reports.ts +368 -0
- package/server-managed/triage-response.ts +16 -0
- package/server-managed/type-only-proof.js +161 -0
- package/server-managed/type-only-worker.js +31 -0
- package/server-managed/type-only.ts +135 -0
- package/server-managed/uploads.ts +106 -0
- package/server-managed/upstream-cache.ts +256 -0
- package/server-managed/view-as.ts +58 -0
- package/server-managed/worker-turns.ts +76 -0
- package/server-managed/workspace-shares.ts +170 -0
- package/server.ts +70 -0
- package/strip-types-loader.js +13 -10
- package/server/index.ts +0 -480
- package/server/lifecycle.ts +0 -208
- /package/{LICENSE → LICENSE-MIT} +0 -0
- /package/{server → server-e2e}/auth.ts +0 -0
- /package/{server → server-e2e}/config.example.json +0 -0
- /package/{server → server-e2e}/objstore/blob-fs.ts +0 -0
- /package/{server → server-e2e}/objstore/fs.ts +0 -0
- /package/{server → server-e2e}/objstore/sign.ts +0 -0
- /package/{server → server-e2e}/peer.ts +0 -0
- /package/{server → server-e2e}/sse-session.ts +0 -0
- /package/{server → server-e2e}/util.ts +0 -0
- /package/{server → server-e2e}/validation.ts +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as e}from"./chunk-QI66YA4F.js";import{C as t,H as n,J as r,K as i,L as a,R as o,a as s,c,d as l,e as u,g as d,h as f,i as p,m,p as h,u as ee}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{d as g,f as te,h as _,i as v,j as ne,m as re,n as ie}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var y=e=>e.replace(/^[ \t\n\r\0\v]+|[ \t\n\r\0\v]+$/gu,``),b=e=>e.replace(/[A-Z]+/gu,e=>e.toLowerCase()),x=e=>e===void 0||e===``||e===`0`,S=e=>e!==void 0&&e>=`0`&&e<=`9`,ae=e=>S(e)||/^[A-Za-z]$/u.test(e??``);function oe(e){let t=e[0];for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1],a=t.at(-1)===`.`?``:`.`;r===`-`||r===`_`||r===`+`?t+=a:!S(i)&&i!==`.`&&S(r)||S(i)&&!S(r)&&r!==`.`?t+=`${a}${r}`:ae(r)?t+=r:t+=a}return t.endsWith(`.`)?t.slice(0,-1):t}var se=[[`dev`,0],[`alpha`,1],[`a`,1],[`beta`,2],[`b`,2],[`RC`,3],[`rc`,3],[`#`,4],[`pl`,5],[`p`,5]],C=e=>se.find(([t])=>e.startsWith(t))?.[1]??-1,w=e=>e>0?1:e<0?-1:0,T=2n**63n-1n,ce=e=>e<=T&&e>=-T-1n,le=e=>{let t=BigInt(/^\d+/u.exec(e)[0]);return t>T?T:t};function ue(e,t){return S(e[0])&&S(t[0])?w(Number(le(e)-le(t))):!S(e[0])&&!S(t[0])?w(C(e)-C(t)):S(e[0])?w(C(`#N#`)-C(t)):w(C(e)-C(`#N#`))}var de=new TextEncoder,fe=e=>/^[\0-\u007F]*$/u.test(e)?e:String.fromCodePoint(...de.encode(e));function pe(e,t){if(e===``||t===``)return e===t?0:e===``?-1:1;let n=e[0]===`#`?e:oe(e),r=t[0]===`#`?t:oe(t),[i,a,o,s,c]=[0,0,0,0,0];for(;i<n.length&&a<r.length&&o!==-1&&s!==-1&&(o=n.indexOf(`.`,i),s=r.indexOf(`.`,a),c=ue(n.slice(i,o===-1?void 0:o),r.slice(a,s===-1?void 0:s)),c===0);)o!==-1&&(i=o+1),s!==-1&&(a=s+1);return c===0?o===-1?s===-1?0:S(r[a])?-1:pe(`#N#`,r.slice(a)):S(n[i])?1:pe(n.slice(i),`#N#`):c}var me=(e,t)=>pe(fe(e),fe(t)),he={"==":e=>e===0,"!=":e=>e!==0,"<":e=>e<0,"<=":e=>e<=0,">":e=>e>0,">=":e=>e>=0},ge=(e,t,n)=>he[n](me(e,t)),E=(t,n)=>w(e(t,n)),_e=/^[ \t\n\r\v\f]*[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[ \t\n\r\v\f]*$/u;function ve(e){if(!_e.test(e))return;let t=e.trim();if(!/[.eE]/u.test(t)){let e=BigInt(t);return ce(e)?{long:e}:{double:Number(t),overflow:e>0n?1:-1}}return{double:Number(t),overflow:0}}function ye(e,t){let n=ve(e),r=ve(t);return n===void 0||r===void 0||n.overflow!==void 0&&n.overflow!==0&&n.overflow===r.overflow&&n.double-r.double===0?E(e,t):n.double!==void 0||r.double!==void 0?n.double===void 0?r.overflow===0?w(Number(n.long)-r.double):-r.overflow:r.double===void 0?n.overflow===0?w(n.double-Number(r.long)):n.overflow:n.double===r.double&&!Number.isFinite(n.double)?E(e,t):w(n.double-r.double):w(Number(n.long-r.long))}var be=/^(?:0|-?[1-9]\d*)$/u;function xe(e){if(!be.test(e))return e;let t=BigInt(e);return ce(t)?t:e}function Se(e,t){let n=xe(e),r=xe(t);if(typeof n==`bigint`&&typeof r==`bigint`)return n>r?1:-1;if(typeof n==`string`&&typeof r==`string`)return ye(n,r);let[i,a,o]=typeof n==`bigint`?[n,r,1]:[r,n,-1],s=ve(a);return s?.long===void 0?s?.double===void 0?o*E(String(i),a):o*w(Number(i)-s.double):o*w(Number(i-s.long))}var D=511,Ce=new WeakMap,O=e=>Ce.get(e)??Object.keys(e),we=e=>c(e)&&O(e).length===0,Te=e=>e.every((e,t)=>e===String(t)),k=(e,t)=>{let n=1;for(let r=e.indexOf(`
|
|
2
|
+
`);r!==-1&&r<t;r=e.indexOf(`
|
|
3
|
+
`,r+1))n++;return n},A=(e,t,n=e.pos)=>ne(t,k(e.text,n)-1);function j(e){let{text:t,pos:n}=e;if(n>=t.length)return`the end of the file`;if(t[n]===`
|
|
4
|
+
`)return`an LF line end`;if(t.startsWith(`\r
|
|
5
|
+
`,n))return`a CRLF line end`;let r=t.indexOf(`
|
|
6
|
+
`,n);return _(t.slice(n,r===-1?t.length:t[r-1]===`\r`?r-1:r))}function Ee(e,t,n){if(!e.text.startsWith(t,e.pos))throw A(e,`expected ${n()}, as Composer writes it, found ${j(e)}`);e.pos+=t.length}function M(e,t){e.lines[t]??=`${e.eol}${e.indent.repeat(t)}`,Ee(e,e.lines[t],()=>t===0?`a line end`:`a line end and ${t===1?``:`${t} times `}${_(e.indent)} of indentation`)}var De=e=>JSON.stringify(e).replaceAll(`\u2028`,`\\u2028`).replaceAll(`\u2029`,`\\u2029`);function Oe(e){let{text:t,pos:n}=e;if(t[n]!==`"`)throw A(e,`expected a string, found ${j(e)}`);let r=n+1;for(;r<t.length&&t[r]!==`"`&&t[r]!==`
|
|
7
|
+
`;)r+=t[r]===`\\`?2:1;if(t[r]!==`"`)throw A(e,`a string with no closing quote`);let i=t.slice(n,r+1);if(e.pos=r+1,!ke.test(i))return i.slice(1,-1);let a=te(()=>JSON.parse(i),()=>{throw A(e,`${_(i)} is not a string as JSON writes it`,n)});if(!a.isWellFormed())throw A(e,`${_(i)} escapes a lone surrogate, which PHP does not read`,n);if(De(a)!==i)throw A(e,`${_(i)} is not written as Composer writes it, ${_(De(a))}`,n);return a}var ke=/[\\\p{Cc}\u2028\u2029\p{Cs}]/u;function Ae(e){if(e===0)return Object.is(e,-0)?`-0`:`0`;let t=e<0?`-`:``,[n,r]=Math.abs(e).toExponential().split(`e`),i=n.replace(`.`,``),a=Number(r)+1;return a<-3||a>17?`${t}${i[0]}.${i.slice(1)||`0`}e${a>0?`+`:`-`}${Math.abs(a-1)}`:a<=0?`${t}0.${`0`.repeat(-a)}${i}`:i.length<=a?`${t}${i}${`0`.repeat(a-i.length)}`:`${t}${i.slice(0,a)}.${i.slice(a)}`}var je=/-?(?:0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/uy,Me=([e,t,n])=>t===void 0&&n===void 0&&ce(BigInt(e));function Ne(e){let t=ie(e,je);if(t===null)throw A(e,`expected a value, found ${j(e)}`);let[n]=t,r=Me(t),i=Number(n);if(!Number.isFinite(i))throw A(e,`${n} is past what PHP reads as a number`);let a=r?BigInt(n).toString():Ae(i);if(a!==n)throw A(e,`${n} is not written as Composer writes it, ${a}`);return r&&!Number.isSafeInteger(i)?BigInt(n):i}var Pe=[[`true`,!0],[`false`,!1],[`null`,null]];function Fe(e){let t=Pe.find(([t])=>e.text.startsWith(t,e.pos));return t!==void 0&&(e.pos+=t[0].length),t}function Ie(e,t){let n=e.text[e.pos];if(n===`{`)return Re(e,t);if(n===`[`)return ze(e,t);if(n===`"`)return Oe(e);let r=Fe(e);return r===void 0?Ne(e):r[1]}function Le(e,t){if(t===D)throw A(e,`nested more than ${D} deep, which PHP does not read`);e.pos++}function Re(e,t){let n=e.pos;Le(e,t);let r=Object.create(null);if(e.text[e.pos]===`}`){if(t!==1)throw A(e,`an empty object, which Composer writes as "[]"`,n);return e.pos++,r}let i=new Map;for(let n=!0;n;){M(e,t+1);let a=e.pos,o=Oe(e);if(i.has(o))throw A(e,`${_(o)} is a key at line ${k(e.text,i.get(o))} too`,a);i.set(o,a),Ee(e,`: `,()=>`": " after ${_(o)}`),r[o]=Ie(e,t+1),n=e.text[e.pos]===`,`,n&&e.pos++}M(e,t),Ee(e,`}`,()=>`"}"`);let a=[...i.keys()];if(Te(a))throw A(e,`an object of the keys 0 to ${a.length-1}, which Composer writes as a list`,n);return Ce.set(r,a),r}function ze(e,t){Le(e,t);let n=[];if(e.text[e.pos]===`]`)return e.pos++,n;for(let r=!0;r;)M(e,t+1),n.push(Ie(e,t+1)),r=e.text[e.pos]===`,`,r&&e.pos++;return M(e,t),Ee(e,`]`,()=>`"]"`),n}var Be=/^<<<<<<< /mu;function Ve(e){let t=Be.exec(e);if(t!==null)throw new g(`a merge conflict at line ${k(e,t.index)}, which Composer reads as a lockfile of no content-hash where its sides differ in that alone`);let[n,r]=re(e,`Composer`),i={text:e,pos:0,eol:n,indent:r,lines:[]},a=Re(i,0);if(M(i,0),i.pos!==e.length)throw A(i,`expected the end of the file after the last "}", found ${j(i)}`);return a}var He=/[ \t\n\r]*/uy,N=e=>ie(e,He),P=(e,t)=>new g(`not JSON as PHP reads it: ${t} at line ${k(e.text,e.pos)}`,e.where);function Ue(e){let{text:t,pos:n}=e,r=n+1;for(;r<t.length&&t[r]!==`"`;)r+=t[r]===`\\`?2:1;if(r>=t.length)throw P(e,`a string with no closing quote`);let i=te(()=>JSON.parse(t.slice(n,r+1)),()=>{throw P(e,`${_(t.slice(n,r+1))} is not a string`)});if(!i.isWellFormed())throw P(e,`a lone surrogate, which is not UTF-8`);return e.pos=r+1,i}function We(e,t){N(e);let n=e.text[e.pos];if(n===`{`||n===`[`){if(t===D)throw P(e,`nested more than ${D} deep`);let r=n===`{`,i=r?`}`:`]`,a=r?new Map:[];if(e.pos++,N(e),e.text[e.pos]===i)return e.pos++,a;for(;;){if(r){if(N(e),e.text[e.pos]!==`"`)throw P(e,`expected a key, found ${j(e)}`);let n=Ue(e);if(N(e),e.text[e.pos]!==`:`)throw P(e,`expected ":", found ${j(e)}`);e.pos++,a.set(n,We(e,t+1))}else a.push(We(e,t+1));N(e);let n=e.text[e.pos];if(n!==i&&n!==`,`)throw P(e,`expected "," or ${_(i)}, found ${j(e)}`);if(e.pos++,n===i)return a}}if(n===`"`)return Ue(e);let r=Fe(e);if(r!==void 0)return r[1];let i=ie(e,je);if(i===null)throw P(e,`expected a value, found ${j(e)}`);return Me(i)?BigInt(i[0]):Number(i[0])}function Ge(e,t){if(typeof e==`number`)return Number.isFinite(e)?void 0:t;if(e instanceof Map||Array.isArray(e))for(let[n,r]of e.entries()){let i=Ge(r,Array.isArray(e)?`${t}[${n}]`:v(t,n));if(i!==void 0)return i}}function Ke(e,t){let n={text:e,pos:0,where:t},r=We(n,0);if(N(n),n.pos!==e.length)throw P(n,`expected the end of the file, found ${j(n)}`);let i=Ge(r,t);if(i!==void 0)throw new g(`a number past what a double holds, which Composer refuses of the file`,i);return r}var qe=e=>`\\u${e.toString(16).padStart(4,`0`)}`;function Je(e){let t=``;for(let n of e){let e=n.codePointAt(0);t+=e<128?n:e<65536?qe(e):qe(55296+(e-65536>>10))+qe(56320+(e-65536&1023))}return t}function F(e){if(e===null||typeof e==`boolean`)return String(e);if(typeof e==`bigint`)return e.toString();if(typeof e==`number`)return Ae(e);if(typeof e==`string`)return Je(JSON.stringify(e).replaceAll(`/`,`\\/`));if(Array.isArray(e))return`[${e.map(F).join(`,`)}]`;let t=[...e.keys()];return Te(t)?`[${[...e.values()].map(F).join(`,`)}]`:`{${t.map(t=>`${F(t)}:${F(e.get(t))}`).join(`,`)}}`}var I=`[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\\d+)*)?)?([.-]?dev)?`,Ye=`stable|RC|beta|alpha|dev`,Xe=`[\\t\\n\\v\\f\\r ]`,Ze=`[^\\t\\n\\v\\f\\r ]`,Qe=`[^,\\t\\n\\v\\f\\r ]`,$e=`9999999-dev`,L=(e,t=``)=>new RegExp(e,t||`u`),et=L(`^(${Qe}+) +as +(${Qe}+)$`),tt=L(`@(?:${Ye})$`,`i`),nt=L(`^([^,\\t\\n\\v\\f\\r +]+)\\+${Ze}+$`),rt=L(`^v?(\\d{1,5})(\\.\\d+)?(\\.\\d+)?(\\.\\d+)?${I}$`,`i`),it=L(`^v?(\\d{4}(?:[.:-]?\\d{2}){1,6}(?:[.:-]?\\d{1,3}){0,2})${I}$`,`i`),at=/^([^\n]*?)[.-]?dev$/iu,ot=/^v?(\d+)(\.(?:\d+|[xX*]))?(\.(?:\d+|[xX*]))?(\.(?:\d+|[xX*]))?$/iu,st=/^((?:\d+\.)*\d+)(?:\.x)?-dev$/iu,ct=L(`${I}(?:\\+[^\\n]*)?$`,`i`);function lt(e){let t=b(e);return{a:`alpha`,b:`beta`,p:`patch`,pl:`patch`,rc:`RC`}[t]??t}function ut(e){let t=e.replace(/#[^\n]+$/u,``);if(t.startsWith(`dev-`)||t.endsWith(`-dev`))return`dev`;let n=ct.exec(b(t));return x(n[3])?{beta:`beta`,b:`beta`,alpha:`alpha`,a:`alpha`,rc:`RC`}[n[1]]??`stable`:`dev`}function dt(e){let t=y(e),n=ot.exec(t);if(n===null)return`dev-${t}`;let r=``;for(let e=1;e<5;e++)r+=n[e]===void 0?`.x`:n[e].replaceAll(`*`,`x`).replaceAll(`X`,`x`);return`${r.replaceAll(`x`,`9999999`)}-dev`}function ft(e){let t=st.exec(e);return t===null?void 0:`${t[1]}.`}function R(e){let t=y(e),n=et.exec(t);if(n!==null&&(t=n[1]),n=tt.exec(t),n!==null&&(t=t.slice(0,t.length-n[0].length)),(t===`master`||t===`trunk`||t==="default")&&(t=`dev-${t}`),/^dev-/iu.test(t))return`dev-${t.slice(4)}`;n=nt.exec(t),n!==null&&(t=n[1]);let r;if((n=rt.exec(t))===null?(n=it.exec(t))!==null&&(t=n[1].replaceAll(/\D/gu,`.`),r=2):(t=`${n[1]}${x(n[2])?`.0`:n[2]}${x(n[3])?`.0`:n[3]}${x(n[4])?`.0`:n[4]}`,r=5),r!==void 0){if(!x(n[r])){if(n[r]===`stable`)return t;let e=n[r+1];t+=`-${lt(n[r])}${(e??``).replace(/^[.-]+/u,``)}`}return x(n[r+2])||(t+=`-dev`),t}if(n=at.exec(t),n!==null){let e=dt(n[1]);if(!e.includes(`dev-`))return e}}var pt={"=":`==`,"==":`==`,"<":`<`,"<=":`<=`,">":`>`,">=":`>=`,"<>":`!=`,"!=":`!=`},z=(e,t)=>({operator:pt[e],version:t}),mt=Object.freeze({all:!0}),ht=e=>e.all?`*`:e.multi===void 0?`${e.operator} ${e.version}`:`[${e.multi.map(ht).join(e.conjunctive?` `:` || `)}]`;function gt(e,t,n=0){let r=[...e];for(let e=4;e>0;e--)if(e>t)r[e]=`0`;else if(e===t&&n!==0){let t=BigInt(r[e])+BigInt(n);if(t>T)return;r[e]=String(t)}return`${r[1]??``}.${r[2]??``}.${r[3]??``}.${r[4]??``}`}var _t=`v?(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(?:\\.(\\d+))?(?:${I}|\\.([xX*][.-]?dev))(?:\\+${Ze}+)?`,vt=L(`^(${Qe}*?)@(${Ye})$`,`i`),yt=/^(dev-[^,\t\n\v\f\r @]+?|[^,\t\n\v\f\r @]+?\.x-dev)#[^\n]+$/iu,bt=/^(v)?[xX*](\.[xX*])*$/iu,xt=L(`^~>?${_t}$`,`i`),St=L(`^\\^${_t}($)`,`i`),Ct=/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.[xX*])+$/u,wt=L(`^(${_t}) +- +(${_t})($)`,`i`),Tt=L(`^(<>|!=|>=?|<=?|==?)?${Xe}*([^\\n]*)`),Et=L(`-${I}$`,`i`),B=e=>e!==void 0&&e!==``;function Dt(e,t,n){let r=R(`${e}${x(t[5])&&x(t[7])&&x(t[8])?`-dev`:``}`.slice(1)),i=gt(t,n,1);return r===void 0||i===void 0?void 0:[z(`>=`,r),z(`<`,`${i}-dev`)]}function Ot(e){let t=e,n=et.exec(t);n!==null&&(t=n[1]);let r;if(n=vt.exec(t),n!==null&&(t=n[1]===``?`*`:n[1],n[2]!==`stable`&&(r=n[2])),n=yt.exec(t),n!==null&&(t=n[1]),n=bt.exec(t),n!==null)return!x(n[1])||!x(n[2])?[z(`>=`,`0.0.0.0-dev`)]:[mt];if((n=xt.exec(t))!==null){if(t.startsWith(`~>`))return;let e=B(n[4])?4:B(n[3])?3:B(n[2])?2:1;return x(n[8])||e++,Dt(t,n,Math.max(1,e-1))}if((n=St.exec(t))!==null)return Dt(t,n,n[1]!==`0`||!B(n[2])?1:n[2]!==`0`||!B(n[3])?2:3);if((n=Ct.exec(t))!==null){let e=B(n[3])?3:B(n[2])?2:1,t=`${gt(n,e)}-dev`,r=gt(n,e,1);return r===void 0?void 0:t===`0.0.0.0-dev`?[z(`<`,`${r}-dev`)]:[z(`>=`,t),z(`<`,`${r}-dev`)]}if((n=wt.exec(t))!==null){let e=x(n[6])&&x(n[8])&&x(n[9])?`-dev`:``,t=R(n[1]),r=R(n[10]);if(t===void 0||r===void 0)return;let i=z(`>=`,`${t}${e}`);if(B(n[12])&&B(n[13])||!x(n[15])||!x(n[17])||!x(n[18]))return[i,z(`<=`,r)];let a=gt([``,n[11],n[12],n[13],n[14]],B(n[12])?2:1,1);return a===void 0?void 0:[i,z(`<`,`${a}-dev`)]}n=Tt.exec(t);let i=R(n[2]);if(i===void 0&&n[2].endsWith(`-dev`)&&/^[0-9a-zA-Z\-./]+$/u.test(n[2])&&(i=R(`dev-${n[2].slice(0,-4)}`)),i===void 0)return;let a=n[1]||`=`;return a!==`==`&&a!==`=`&&!x(r)&&ut(i)===`stable`?i+=`-${r}`:a!==`<`&&a!==`>=`||Et.test(n[2])||n[2].startsWith(`dev-`)||(i+=`-dev`),[z(a,i)]}var kt=L(`${Xe}*\\|\\|?${Xe}*`),At=/(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)/u;function jt(e){let t=e[0],n=[],r=!1,i=e=>e.multi!==void 0&&e.conjunctive&&e.multi.length===2;for(let a of e.slice(1)){let[e,o,s,c]=i(t)&&i(a)?[...t.multi,...a.multi].map(ht):[];e?.startsWith(`>=`)&&o.startsWith(`<`)&&s.startsWith(`>=`)&&c.startsWith(`<`)&&o.slice(2)===s.slice(3)?(r=!0,t={multi:[t.multi[0],a.multi[1]],conjunctive:!0}):(n.push(t),t=a)}if(r)return n.push(t),n}function Mt(e){if(e.length===1)return e[0];let t=jt(e);return t?.length===1?t[0]:{multi:t??e,conjunctive:!1}}function Nt(e){let t=y(e).split(kt).map(e=>e.split(At).map(Ot));if(!t.some(e=>e.includes(void 0)))return Mt(t.map(e=>e.flat()).map(e=>e.length===1?e[0]:{multi:e,conjunctive:!0}))}function Pt(e,t,n){let r=e.startsWith(`dev-`),i=t.startsWith(`dev-`);return n===`!=`&&(r||i)?e!==t:r&&i?n===`==`&&e===t:r||i?!1:ge(e,t,n)}var Ft=e=>e.replaceAll(`=`,``);function It(e,t){let n=e.operator===`==`,r=e.operator===`!=`,i=t.operator===`==`,a=t.operator===`!=`;if(r||a)return r&&!a&&!i&&t.version.startsWith(`dev-`)||a&&!r&&!n&&e.version.startsWith(`dev-`)?!1:!n&&!i||Pt(t.version,e.version,`!=`);if(e.operator!==`==`&&Ft(e.operator)===Ft(t.operator))return!(e.version.startsWith(`dev-`)||t.version.startsWith(`dev-`));let[o,s,c]=n?[e.version,t.version,t.operator]:[t.version,e.version,e.operator];return Pt(o,s,c)?t.operator!==Ft(t.operator)||e.operator===Ft(e.operator)||me(t.version,e.version)!==0:!1}function V(e,t){return e.all||t.all?!0:e.multi===void 0?t.multi===void 0?It(e,t):V(t,e):e.conjunctive?t.multi!==void 0&&!t.conjunctive?V(t,e):e.multi.every(e=>V(t,e)):e.multi.some(e=>V(t,e))}var Lt=e=>z(`==`,e),H=(e,t)=>O(e).map(n=>[n,e[n],v(t,n)]);function U(e,t,n,r={}){u(e,t);let i=e=>t===void 0?e:v(t,e),a=-1;for(let o of O(e)){if(Object.hasOwn(r,o))throw new g(r[o],i(o));let e=n.indexOf(o);if(e===-1)throw new g(`unsupported field ${_(o)}`,t);if(e<a)throw new g(`out of the order Composer writes, before ${_(n[a])}`,i(o));a=e}return e}function W(e,t){if(x(f(e,t)))throw new g(`${_(e)}, which Composer reads as no value and does not write`,t);return e}var Rt=/[\p{Cc}]/u;function G(e,t){if(Rt.test(f(e,t)))throw new g(`${_(e)} has a control character in it`,t);return e}var zt=(e,t)=>{if(Array.isArray(e)?e.length===0:!c(e))throw l(`a non-empty mapping or sequence`,e,t);return e},Bt=(e,t)=>{if(d(e,t).length===0)throw new g(`an empty sequence, which Composer does not write`,t);return e},K=(e,t,n=f)=>Bt(e,t).map((e,r)=>n(e,`${t}[${r}]`));function Vt(e,t,n=`Composer sorts the keys in`){let r=O(e);for(let e=1;e<r.length;e++)if(Se(r[e-1],r[e])>0)throw new g(`out of the order ${n}, after ${_(r[e-1])}`,v(t,r[e]));return r}function Ht(e,t){let n=G(e,t),r=/\s|@(?:stable|rc|beta|alpha|dev)$/u.test(b(n))||n===`0`?void 0:R(n);if(r===void 0)throw new g(`${_(n)} is not a version Composer locks a package at`,t);return r}function Ut(e,t){let n=R(G(e,t));if(n===void 0)throw new g(`${_(e)} is not a version Composer reads`,t);return n}function Wt(e,t,n){let r=G(e,t)===`self.version`,i=Nt(r?n:e);if(i!==void 0)return i;throw new g(r?`"self.version", which is ${_(n)}, and not a version constraint Composer reads`:`${_(e)} is not a version constraint Composer reads`,t)}var Gt=/^[a-z0-9](?:[_.-]?[a-z0-9]+)*\/[a-z0-9](?:(?:[_.]|-{1,2})?[a-z0-9]+)*$/u,Kt=new Set([`nul`,`con`,`prn`,`aux`,...[`com`,`lpt`].flatMap(e=>Array.from({length:9},(t,n)=>`${e}${n+1}`))]);function qt(e,t){let n=f(e,t);if(!Gt.test(b(n)))throw new g(`${_(n)} is not a package name, a vendor and a package as Composer takes them`,t);if(b(n).split(`/`).some(e=>Kt.has(e)))throw new g(`${_(n)} has a name Windows reserves in it, which Composer refuses`,t);if(n.endsWith(`.json`))throw new g(`${_(n)} ends in .json, which Composer refuses`,t);return n}var Jt=/^[a-z0-9_./-]+$/u,Yt=/^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer(?:-(?:plugin|runtime)-api)?)$/u,q=e=>Yt.test(b(e));function Xt(e,t,n){let r=Object.create(null);return Vt(u(e,t),t),{written:r,links:H(e,t).map(([e,t,i])=>{if(!Jt.test(e))throw new g(`${_(e)} is not a package name in lowercase, as Composer writes a link's`,i);let a=Wt(t,i,n);return r[e]=t,{target:e,pretty:t,constraint:a}})}}function Zt(e,n){let r=G(e,n);if(r.startsWith(`/`)||/^[A-Za-z]:/u.test(r))throw new g(`${_(r)} is an absolute path, of the machine the lockfile was written on`,n);let i=/^[A-Za-z][\d+.A-Za-z-]*:/u.exec(r);if(i!==null)throw new g(`${_(r)} is a URL, of ${i[0]}, and not a path`,n);return t(r.startsWith(`./`)?r.slice(2):r,n),r}function Qt(e,t){if(/^\s*-/u.test(G(e,t)))throw new g(`${_(e)} starts with "-", which a tool would read as an option and Composer refuses`,t);if(e===``)throw new g(`an empty string, of which Composer fetches nothing`,t);return e}var $t={git:[`https:`,`http:`,`ssh:`,`git:`,`git+ssh:`],hg:[`https:`,`http:`,`ssh:`],svn:[`https:`,`http:`,`svn:`,`svn+ssh:`],fossil:[`https:`,`http:`,`ssh:`]},en=/^(?:(?:tcp|ssl)(?:4|6|46|64)?:)?(?:\[[0-9a-f:.]+\]|[a-z0-9._][a-z0-9._-]*)(?::[a-z0-9._][a-z0-9._-]*)?$/u,tn=/^([\w.-]+@)?([\w.-]+):[^\s]/u;function nn(e,t,n){let r=Qt(e,t);if(n===`perforce`){let e=b(r);if(!en.test(e)||/^\s*(?:rsh|jsh)\s*:/u.test(e))throw new g(`${_(r)} is not a Perforce port, [tcp|ssl:][host:]port, as Composer takes one`,t);return r}a(r,t);let i=n===`git`&&!r.includes(`://`)&&!/^[A-Za-z]:/u.test(r)?tn.exec(r):null;if(i!==null){if(i[1]===void 0&&/^(?:file|https?|ssh|git|ftps?)$/u.test(b(i[2])))throw new g(`${_(r)} is of the host ${i[2]} to git, and a URL of ${b(i[2])}: to a URL parser`,t);return r}if(/^[A-Za-z][\d+.A-Za-z-]*:/u.test(r)){let e=URL.parse(r);if(e===null||!$t[n].includes(e.protocol)||/\s/u.test(r))throw new g(`${_(r)} is not a URL ${n} fetches from, ${$t[n].join(` `)}`,t);return r}return Zt(r,t)}function rn(e,t,r){let a=Qt(e,t);return r===`git`&&!n(a)&&i(a,t),a}function an(e,t,n){return Bt(e,t).map((e,r)=>{let i=`${t}[${r}]`;U(e,i,[`url`,`preferred`]);let a=p(e.preferred,v(i,`preferred`));return{url:n(e.url,v(i,`url`)),preferred:a}})}var on=[`git`,`hg`,`svn`,`fossil`,`perforce`];function sn(e,t){U(e,t,[`type`,`url`,`reference`,`mirrors`]);let n=f(e.type,v(t,`type`));if(!on.includes(n))throw new g(`expected one of ${on.join(`, `)}, which Composer clones from`,v(t,`type`));if(e.reference===void 0)throw new g(`expected a reference, without which Composer does not read a source`,t);let r=(e,t)=>nn(e,t,n);return{type:n,url:r(e.url,v(t,`url`)),reference:rn(e.reference,v(t,`reference`),n),mirrors:m(e,`mirrors`,t,(e,t)=>an(e,t,r))??[]}}var cn=[`zip`,`tar`,`gzip`,`xz`,`rar`,`phar`,`file`];function ln(e,t,n){let r=Qt(e,t);return n!==`path`&&o(r)||Zt(r,t),r}function un(e,t){U(e,t,[`type`,`url`,`reference`,`shasum`,`mirrors`]);let n=f(e.type,v(t,`type`));if(n!==`path`&&!cn.includes(n))throw new g(`expected path or one of ${cn.join(`, `)}, which Composer installs from`,v(t,`type`));let i=(e,t)=>ln(e,t,n),a=m(e,`shasum`,t,f);if(a!==void 0&&a!==``&&!r(a))throw new g(`${_(a)} is not a sha1 in lowercase hex, which Composer compares the download's with`,v(t,`shasum`));return{type:n,url:i(e.url,v(t,`url`)),reference:m(e,`reference`,t,Qt),shasum:a||void 0,mirrors:m(e,`mirrors`,t,(e,t)=>an(e,t,i))??[]}}function dn(e,t){let n=G(e,t);if(n===``||/^(?:[\\/]|[A-Za-z]:)/u.test(n)||/(?:^|[\\/])\.\.(?:[\\/]|$)/u.test(n))throw new g(`${_(n)} is not a path in the package, as Composer installs a bin from`,t);return n}var fn=e=>e.replace(/(?:^|[\\/]+)\.\.?(?:[\\/]+|$)(?:\.\.?(?:[\\/]+|$))*/gu,`/`).replace(/^\/+/u,``);function pn(e,t){let n=G(e,t);if(fn(n)!==n)throw new g(`${_(n)} is not written as Composer writes a target-dir, ${_(fn(n))}`,t);if(n.startsWith(`\\`))throw new g(`${_(n)} is of the drive's root on Windows, and not under the package's directory`,t);return n!==``&&Zt(n.replaceAll(`\\`,`/`),t),n}function mn(e,t){return Vt(u(e,t),t),h(e,t,(e,t)=>{if(y(f(e,t))===`self.version`)throw new g(`"self.version", which Composer writes as the package's version`,t);return e},H)}var hn=(e,t)=>h(u(e,t),t,(e,t)=>{if(!Array.isArray(e))throw l(`a sequence, as Composer writes even one listener`,e,t);return e.map((e,n)=>f(e,`${t}[${n}]`))},H);function gn(e,t){let n=K(e,t);for(let e=1;e<n.length;e++)if(ye(n[e-1],n[e])>0)throw new g(`out of the order Composer sorts keywords in, after ${_(n[e-1])}`,`${t}[${e}]`);return n}function _n(e,t){return U(e,t,[`name`,`exclude`]),{name:m(e,`name`,t,W),exclude:m(e,`exclude`,t,K)??[]}}function vn(e,t){if(e===!0)return!0;if(typeof e!=`string`)throw l(`true or the name of a replacement`,e,t);return W(e,t)}var yn=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})[+-](\d{2}):(\d{2})$/u;function bn(e,t){let n=yn.exec(f(e,t)),[r,i,a,o,s,c,l,u]=n===null?[]:n.slice(1).map(Number),d=new Date(Date.UTC(2e3,i,0)).getUTCDate()-+(i===2&&(r%4!=0||r%100==0&&r%400!=0));if(n===null||i<1||i>12||a<1||a>d||o>23||s>59||c>59||u>59||l>24)throw new g(`${_(e)} is not a time as Composer writes one, as 2026-10-02T00:00:00+00:00`,t);return e}var xn={require:`require`,conflict:`conflict`,provide:`provide`,replace:`replace`,requireDev:`require-dev`},Sn=`name.version.target-dir.source.dist.require.conflict.provide.replace.require-dev.suggest.default-branch.bin.type.extra.autoload.autoload-dev.notification-url.include-path.php-ext.archive.scripts.license.authors.description.homepage.keywords.support.funding.abandoned.transport-options.time`.split(`.`),Cn={version_normalized:"`version_normalized`, which Composer leaves out of a lockfile","installation-source":"`installation-source`, which Composer leaves out of a lockfile",repositories:"`repositories`, which Composer reads of the project's composer.json alone","minimum-stability":"`minimum-stability`, which Composer reads of the project's composer.json alone"};function wn(e,t,n){if(U(e,t,Sn,Cn),e.name===void 0)throw new g(`expected a name`,t);if(e.version===void 0)throw new g(`expected a version`,t);let r=qt(e.name,v(t,`name`)),i=Ht(e.version,v(t,`version`));if(e.type===void 0)throw new g(`expected a type, which Composer always writes`,t);let a=W(G(e.type,v(t,`type`)),v(t,`type`));if(b(a)!==a)throw new g(`${_(a)}, which Composer writes in lowercase`,v(t,`type`));if(e[`default-branch`]!==void 0&&e[`default-branch`]!==!0)throw l(`true, as Composer writes it of the default branch alone`,e[`default-branch`],v(t,`default-branch`));let s=Object.create(null),c={};for(let[n,r]of Object.entries(xn)){let i=m(e,r,t,(t,n)=>Xt(t,n,e.version));s[n]=i?.written??Object.create(null),c[n]=i?.links??[]}let u=n=>m(e,n,t,zt);return{pkg:{name:r,version:e.version,normalized:i,stability:ut(i),dev:n,source:m(e,`source`,t,sn),dist:m(e,`dist`,t,un),...s,suggest:m(e,`suggest`,t,mn)??Object.create(null),defaultBranch:e[`default-branch`]===!0,bin:m(e,`bin`,t,(e,t)=>K(e,t,dn))??[],type:a,targetDir:m(e,`target-dir`,t,pn),extra:u(`extra`),autoload:u(`autoload`),autoloadDev:u(`autoload-dev`),notificationUrl:m(e,`notification-url`,t,(e,t)=>{if(!o(f(e,t)))throw new g(`${_(e)} is not an http(s) URL, which Composer posts installs to`,t);return e}),includePath:m(e,`include-path`,t,K)??[],phpExt:u(`php-ext`),archive:m(e,`archive`,t,_n)??{name:void 0,exclude:[]},scripts:m(e,`scripts`,t,hn)??Object.create(null),license:m(e,`license`,t,K)??[],authors:u(`authors`),description:m(e,`description`,t,W),homepage:m(e,`homepage`,t,W),keywords:m(e,`keywords`,t,gn)??[],support:u(`support`),funding:u(`funding`),abandoned:m(e,`abandoned`,t,vn),transportOptions:u(`transport-options`),time:m(e,`time`,t,bn)},links:c}}var Tn=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21],En=Array.from({length:64},(e,t)=>Math.floor(Math.abs(Math.sin(t+1))*2**32)>>>0);function Dn(e){let t=e.length,n=Math.ceil((t+9)/64),r=new Uint8Array(n*64);for(let n=0;n<t;n++)r[n]=e.codePointAt(n);r[t]=128;let i=new DataView(r.buffer);return i.setUint32(r.length-8,t*8>>>0,!0),i.setUint32(r.length-4,Math.floor(t*8/2**32),!0),Array.from({length:r.length/4},(e,t)=>i.getUint32(t*4,!0))}var On=(e,t)=>(e<<t|e>>>32-t)>>>0;function kn(e){if(/[^\0-\u007F]/u.test(e))throw TypeError(`expected ASCII`);let t=[0x67452301,0xefcdab89,0x98badcfe,271733878],n=Dn(e);for(let e=0;e<n.length;e+=16){let[r,i,a,o]=t;for(let t=0;t<64;t++){let s=t>>4,c=[i&a|~i&o,o&i|~o&a,i^a^o,a^(i|~o)][s],l=[t,5*t+1,3*t+5,7*t][s]%16,u=i+On(r+c+En[t]+n[e+l]>>>0,Tn[s*4+t%4])>>>0;[r,i,a,o]=[o,u,i,a]}for(let[e,n]of[r,i,a,o].entries())t[e]=t[e]+n>>>0}return t.map(e=>[0,8,16,24].map(t=>(e>>>t&255).toString(16).padStart(2,`0`)).join(``)).join(``)}var An={string:[e=>typeof e==`string`,`a string`],boolean:[e=>typeof e==`boolean`,`true or false`],object:[e=>e instanceof Map,`a mapping`],array:[Array.isArray,`a sequence`],null:[e=>e===null,`null`]};function J(e,t,n){let r=[t.type].flat();if(!r.some(t=>An[t][0](e)))throw l(r.map(e=>An[e][1]).join(` or `),e,n);if(t.enum!==void 0&&!t.enum.includes(e))throw l(`one of ${t.enum.map(_).join(`, `)}`,e,n);if(t.pattern!==void 0&&!t.pattern.test(e))throw new g(`${_(e)} is not as Composer's schema has it`,n);if(e instanceof Map){for(let r of t.required??[])if(!e.has(r))throw new g(`no ${_(r)}, which Composer's schema requires`,n);for(let[r,i]of e){let e=Object.hasOwn(t.properties??{},r)?t.properties[r]:t.additionalProperties;e!==void 0&&J(i,e,v(n,r))}}Array.isArray(e)&&t.items!==void 0&&e.forEach((e,r)=>J(e,t.items,`${n}[${r}]`))}var Y={type:`string`},X={type:`boolean`},jn={type:`array`,items:Y},Mn={type:[`string`,`boolean`]},Nn={type:`object`,required:[`name`,`version`],properties:{name:Y,version:Y}},Pn={name:Y,canonical:X,only:jn,exclude:jn},Fn={url:Y,"no-api":X,"secure-http":X,"svn-cache-credentials":X,"trunk-path":Mn,"branches-path":Mn,"tags-path":Mn,"package-path":Y,depot:Y,branch:Y,unique_perforce_client_name:Y,p4user:Y,p4password:Y},In={composer:{url:Y,options:{type:`object`},allow_ssl_downgrade:X,"force-lazy-providers":X,filter:{type:[`boolean`,`object`],additionalProperties:X}},...Object.fromEntries([`vcs`,`github`,`git`,`gitlab`,`bitbucket`,`git-bitbucket`,`hg`,`fossil`,`perforce`,`svn`,`forgejo`].map(e=>[e,Fn])),path:{url:Y,options:{type:`object`,properties:{reference:{type:`string`,enum:[`none`,`config`,`auto`]},symlink:{type:[`boolean`,`null`]},relative:X,versions:{type:`object`,additionalProperties:Y}}}},artifact:{url:Y},pear:{url:Y,"vendor-alias":Y},package:{package:{...Nn,type:[`object`,`array`],items:Nn}}};function Ln(e,t,n){J(e,{type:`object`},t);let r=e.get(`type`);if(typeof r!=`string`||!Object.hasOwn(In,r))throw l(`a type of repository Composer knows`,r,v(t,`type`));if(J(e,{type:`object`,required:[r===`package`?`package`:`url`],properties:{...Pn,...In[r]}},t),n&&e.has(`name`))throw new g(`a name, where the key names a repository, which Composer's schema refuses`,v(t,`name`))}function Rn(e,t){if(J(e,{type:[`object`,`array`]},t),Array.isArray(e))e.forEach((e,n)=>{e instanceof Map&&e.size===1&&[...e.values()][0]===!1||Ln(e,`${t}[${n}]`,!1)});else for(let[n,r]of e)r!==!1&&Ln(r,v(t,n),!0)}var zn={version:{type:`string`,pattern:/^[vV]?\d+(?:[.-]\d+){0,3}[._-]?(?:(?:[sS][tT][aA][bB][lL][eE]|[bB][eE][tT][aA]|[bB]|[rR][cC]|[aA][lL][pP][hH][aA]|[aA]|[pP][aA][tT][cC][hH]|[pP][lL]|[pP])(?:[.-]?\d+)*)?(?:[.-]?[dD][eE][vV]|\.x-dev)?(?:\+.*)?$|^dev-.*$/su},"minimum-stability":{type:`string`,enum:[`dev`,`alpha`,`beta`,`rc`,`RC`,`stable`]},"prefer-stable":X,extra:{type:[`object`,`array`]},config:{type:`object`,properties:{platform:{type:`object`,additionalProperties:Mn}}}};function Bn(e,t){for(let[n,r]of Object.entries(zn))e.has(n)&&J(e.get(n),r,v(t,n));e.has(`repositories`)&&Rn(e.get(`repositories`),v(t,`repositories`))}var Z=`composerJson`,Vn=[`name`,`version`,`require`,`require-dev`,`conflict`,`replace`,`provide`,`minimum-stability`,`prefer-stable`,`repositories`,`extra`];function Hn(e){let t=new Map(Vn.filter(t=>e.has(t)).map(t=>[t,e.get(t)])),n=e.get(`config`),r=n instanceof Map?n.get(`platform`):void 0;return r!=null&&t.set(`config`,new Map([[`platform`,r]])),kn(F(new Map([...t].sort(([e],[t])=>Se(e,t)))))}function Un(e,t){let n=qt(e,t);if(/[A-Z]/u.test(n))throw new g(`${_(n)} has capitals, which Composer refuses in composer.json`,t);return n}var Wn=/(?:^|\| *|, *)([^,\t\n\v\f\r #|]+)(?:#[^ ]+)? +as +([^,\t\n\v\f\r |]+)(?:$| *\|| *,)/u;function Gn(e,t,n,r){let i=e.get(t);if(i===void 0)return[];if(!(i instanceof Map))throw l(`a mapping`,i,v(Z,t));let a=new Map;for(let[e,o]of i){let i=b(e),s=v(v(Z,t),e);q(e)||Un(e,s),G(f(o,s),s);let c=o===`self.version`?r===void 0?{all:!0}:Nt(r.pretty):Nt(o);if(c===void 0)throw new g(`${_(o)} is not a version constraint Composer reads`,s);if(t===`require`||t===`require-dev`){let e=Wn.exec(o);if(e===null?o.includes(` as `):R(e[1])===void 0||R(e[2])===void 0)throw new g(`${_(o)} is not an alias of one version as another, which Composer refuses`,s);if(i===n)throw new g(`the root itself, which Composer refuses`,s)}a.set(i,{target:i,pretty:o,constraint:c})}return[...a.values()]}function Kn(e){if(typeof e!=`string`)throw TypeError(`composerJson: expected the text of composer.json`);let t=Ke(e,Z);if(!(t instanceof Map))throw new g(`expected an object`,Z);return t}function qn(e){let t=Kn(e);Bn(t,Z);let n=t.has(`name`)?Un(t.get(`name`),v(Z,`name`)):`__root__`,r=t.get(`version`),i=r===void 0?void 0:{pretty:r,normalized:Ut(r,v(Z,`version`))},a=Object.create(null);for(let[e,r]of Object.entries(xn))a[e]=Gn(t,r,n,i);return{contentHash:Hn(t),name:n,version:i?.normalized,links:a}}var Q={stable:0,RC:5,beta:10,alpha:15,dev:20};function Jn(e,t,n,r){let i=Object.create(null),a=e=>e.pretty===`self.version`,o=e=>({...e,constraint:Lt(t)});for(let t of Object.keys(xn))i[t]=t===`conflict`||t===`provide`||t===`replace`?[...e.links[t],...e.links[t].filter(a).map(o)]:e.links[t].map(e=>a(e)?o(e):e);let s=e.links.require.some(a);return{name:e.name,version:t,exact:Lt(t),pretty:n,stability:ut(t),links:i,alias:r?`root`:`branch`,base:e,selfVersionRequires:s,where:e.where}}function Yn(e,t){let{version:n}=e;if(!n.startsWith(`dev-`)&&!n.endsWith(`-dev`))return;let r=e.extra?.[`branch-alias`];if(typeof r==`object`&&r)for(let e of O(r)){let i=r[e];if(typeof i!=`string`)throw new g(`expected a string, as Composer reads a branch alias of a dev version`,v(v(v(t,`extra`),`branch-alias`),e));if(!i.endsWith(`-dev`))continue;let a=i===$e?i:dt(i.slice(0,-4));if(!a.endsWith(`-dev`)||b(n)!==b(e))continue;let o=ft(e),s=ft(i);if(o===void 0||s===void 0||b(s).startsWith(b(o)))return a}if(e.defaultBranch&&ft(n.replace(/^v/u,``))===void 0)return $e}function Xn(e,t){let n=new Set([e.name]);if(t)for(let t of e.links.provide)n.add(t.target);for(let t of e.links.replace)n.add(t.target);return n}function Zn(e,t,n){if(e.name===t)return e.exact===void 0||V(n,e.exact);let r=e=>e.target===t&&V(n,e.constraint);return e.links.provide.some(r)||e.links.replace.some(r)}function Qn(e){let t=new Map;for(let n of e)for(let e of Xn(n,!0))(t.get(e)??t.set(e,[]).get(e)).push(n);return{entries:e,byName:t,provided:new Map}}var $n=(e,t)=>e.byName.get(t)??[];function $(e,t){return e.provided.has(t)||e.provided.set(t,$n(e,t.target).filter(e=>Zn(e,t.target,t.constraint))),e.provided.get(t)}function er(e){return e.root?`the root`:`${e.base?.pkg.name??e.pkg.name} ${e.alias===void 0?e.pkg.version:`${e.pretty}, an alias of ${e.base.pkg.version}`}`}function tr(e,t,n){let r=Q[e.stability];return[...Xn(e,!0)].some(e=>r<=Q[Object.hasOwn(n,e)?n[e]:t])}function nr(e){let t=new Map;for(let n of e)for(let e of Xn(n,!1)){let r=t.get(e);if(r!==void 0){let t=r.root?`the root`:r.where,i=e===n.name&&e===r.name?`listed twice, first as ${t}`:`${_(e)} is ${e===r.name?`the name`:`replaced by`} of ${t}, and ${e===n.name?`its name`:`replaced by it`} too, which Composer installs neither of`;throw new g(i,n.where)}t.set(e,n)}}function rr(e,t,n,r){for(let i of e)if(i.alias===void 0||i.selfVersionRequires)for(let e of i.links.require){if(q(e.target)||$(t,e).length>0)continue;let a=$n(r,e.target).filter(e=>!e.root),o=i.alias===void 0?``:`, as its alias ${i.pretty} asks for ${e.target} at it`,s=a.length===0?``:`, of ${a.map(er).join(`, `)}, which the lockfile has`;throw new g(`nothing ${n} meets it${o}${s}`,v(v(i.where,`require`),e.target))}}function ir(e){let t=new Set(e.entries.filter(e=>e.alias===void 0).flatMap(e=>[...Xn(e,!1)]));for(let n of e.entries)for(let r of n.links.conflict){if(q(r.target)||!t.has(r.target))continue;let i=$(e,r).find(e=>e!==n&&(e.alias===void 0||e.name===r.target));if(i!==void 0)throw new g(`conflicts with ${er(i)}, which ${i.root?`composer.json is`:`the lockfile has`}`,v(v(n.where,`conflict`),r.target))}}function ar(e,t,n){for(let r of e.links[n])if(!(q(r.target)||r.pretty===`self.version`||$(t,r).length>0))throw new g(`nothing in the lockfile${n===`requireDev`?``:` that composer install --no-dev installs`} meets it, which composer install refuses`,v(v(e.where,xn[n]),r.target))}function or(e,t){let n=Object.create(null);for(let r of e.links.require){let e=[...new Set($(t,r).filter(e=>!e.root).map(e=>(e.base??e).name))];n[r.target]={constraint:r.pretty,platform:q(r.target),targets:e}}return n}function sr(e,t,n,r,i){let a=e.map(({pkg:e,links:t,where:n})=>({name:b(e.name),version:e.normalized,exact:Lt(e.normalized),stability:e.stability,links:t,pkg:e,where:n})),o=i===void 0?[]:[{...i,exact:i.version===void 0?void 0:Lt(i.version),where:Z,root:!0}];nr([...o,...a]);let s=new Map(a.map(e=>[e.name,e])),c=[],l=new Map(a.map(e=>[e,[]])),u=e=>{c.push(e),l.get(e.base).push(e)};for(let e of a){c.push(e);let t=Yn(e.pkg,e.where);t!==void 0&&u(Jn(e,t,t.replaceAll(/(?:\.9{7})+/gu,`.x`),!1))}for(let e of t)u(Jn(s.get(e.package),e.aliasNormalized,e.alias,!0));for(let e of c)if(!tr(e,n,r)){let t=e.alias===void 0?``:`its alias ${e.pretty}, `;throw new g(`${t}of stability ${e.stability}, which minimum-stability, ${n}, and stability-flags do not take, and Composer installs nothing against`,e.where)}let d=e=>(e.base??e).pkg.dev,f=c.filter(e=>!d(e)),p=Qn([...o,...f]),m=Qn([...o,...c]);return ir(m),i!==void 0&&(rr(f,p,`that composer install --no-dev installs`,m),rr(c.filter(d),m,`in the lockfile`,m),ar(o[0],p,`require`),ar(o[0],m,`requireDev`)),new Map(a.map(e=>[e,{require:or(e,d(e)?m:p),aliases:l.get(e).map(e=>({version:e.pretty,normalized:e.version,root:e.alias===`root`}))}]))}var cr=[`_readme`,`content-hash`,`packages`,`packages-dev`,`aliases`,`minimum-stability`,`stability-flags`,`prefer-stable`,`prefer-lowest`,`platform`,`platform-dev`,`platform-overrides`,`plugin-api-version`],lr={hash:"`hash`, the md5 of composer.json that Composer 1.2 and older wrote, which is not read here"},ur=cr.filter(e=>e!==`platform-overrides`),dr=[`This file locks the dependencies of your project to a known state`,`Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies`,`This file is @generated automatically`],fr=[`2.0.0`,`2.1.0`,`2.2.0`,`2.3.0`,`2.6.0`,`2.9.0`],pr=[`stability-flags`,`platform`,`platform-dev`];function mr(e){let t=`plugin-api-version`;if(e===void 0)throw new g(`no plugin-api-version: a lockfile of Composer 1.9 or older, which is not read here`);if(typeof e==`string`&&e.startsWith(`1.`))throw new g(`${_(e)} is Composer 1's, which is not read here`,t);if(!fr.includes(e))throw new g(`unsupported plugin-api-version: expected one of ${fr.join(`, `)}, found ${s(e)}`,t);return e}function hr(e){U(e,void 0,cr,lr);let t=mr(e[`plugin-api-version`]),n=ur.find(t=>e[t]===void 0);if(n!==void 0)throw new g(`expected ${_(n)}, which Composer always writes`,n);let r=e._readme;if(!Array.isArray(r)||r.length!==dr.length||r.some((e,t)=>e!==dr[t]))throw new g(`expected the three lines Composer writes`,`_readme`);let i=f(e[`content-hash`],`content-hash`);if(!/^[\da-f]{32}$/u.test(i))throw new g(`${_(i)} is not an md5 in lowercase hex`,`content-hash`);for(let t of[`prefer-stable`,`prefer-lowest`])p(e[t],t);let a=e[`minimum-stability`];if(typeof a!=`string`||!Object.hasOwn(Q,a))throw l(`one of ${Object.keys(Q).join(`, `)}`,a,`minimum-stability`);return{contentHash:i,pluginApiVersion:t,minimumStability:a}}function gr(e,t){let n=pr.find(t=>we(e[t])),r=pr.find(t=>Array.isArray(e[t])&&e[t].length===0),i=t===`2.9.0`?`{}`:t===`2.6.0`?void 0:`[]`,a=i===`{}`?r:i===`[]`?n:void 0;if(a!==void 0)throw new g(`"${i===`{}`?`[]`:`{}`}", which Composer of plugin-api-version ${t} writes as "${i}"`,a);if(n!==void 0&&r!==void 0)throw new g(`"[]", where ${_(n)} is "{}", as no Composer writes them both`,r);return n!==void 0||t===`2.9.0`}var _r=(e,t)=>Array.isArray(e)&&e.length===0?Object.create(null):u(e,t);function vr(e,t){let n=`stability-flags`,r=_r(e,n);t&&Vt(r,n,`Composer 2.8 and later sort it in`);let i=Object.entries(Q);return h(r,n,(e,t,n)=>{if(b(n)!==n)throw new g(`${_(n)}, which Composer writes in lowercase`,t);let r=i.find(([,t])=>t===e);if(r===void 0)throw l(`one of ${Object.values(Q).join(`, `)}`,e,t);return r[0]},H)}var yr=(e,t)=>h(_r(e,t),t,(e,t,n)=>{if(!q(n)||b(n)!==n)throw new g(`${_(n)} is not a platform package's name in lowercase, as Composer writes one`,t);return Wt(e,t,`1.0.0`),e},H);function br(e){let t=`platform-overrides`;if(e===void 0)return Object.create(null);if(!c(e)||we(e))throw l(`a non-empty mapping, as Composer writes it where there are any`,e,t);let n=new Map;return h(e,t,(e,t,r)=>{if(!q(r))throw new g(`${_(r)} is not a platform package's name`,t);let i=b(r),a=n.get(i);if(a!==void 0)throw new g(`${_(a)} too, of which Composer takes the last, as it takes a name in any case`,t);if(n.set(i,r),e!==!1&&(typeof e!=`string`||R(G(e,t))===void 0))throw l(`a version, or false`,e,t);if(i===`php`&&e===!1)throw new g(`false, which Composer refuses of php, as it cannot be missing`,t);return e},H)}function xr(e,t){let n=e[t];if(t===`packages-dev`&&n===null)throw new g(`null, as Composer 1 writes it after update --no-dev, which Composer 2 does not install from`,t);return d(n,t)}function Sr(e){for(let t=1;t<e.length;t++){let n=e[t-1].pkg,r=e[t].pkg;if(n.dev===r.dev&&(E(n.name,r.name)||E(n.version,r.version))>0)throw new g(`out of the order Composer sorts packages in, by name then version, after ${_(n.name)}`,e[t].where)}}var Cr=[`package`,`version`,`alias`,`alias_normalized`];function wr(e,t){let n=`aliases`;return d(e,n).map((r,i)=>{let a=`${n}[${i}]`;U(r,a,Cr);for(let e of Cr)if(r[e]===void 0)throw new g(`expected ${e}`,a);let o=f(r.package,v(a,`package`));if(!t.has(o))throw new g(`${_(o)} is not a package in the lockfile, by its name in lowercase`,v(a,`package`));if(i>0&&E(e[i-1].package,o)>0)throw new g(`out of the order Composer sorts aliases in, by package, after ${_(e[i-1].package)}`,a);let s=f(r.version,v(a,`version`));if(Ut(s,v(a,`version`))!==s)throw new g(`${_(s)} is not a version normalized, as Composer writes it`,v(a,`version`));if([`dev-master`,`dev-trunk`,`dev-default`].includes(s))throw new g(`${_(s)}, which Composer writes as ${$e}`,v(a,`version`));let c=f(r.alias,v(a,`alias`));if(/\s/u.test(c))throw new g(`${_(c)} has a space, which Composer's alias of a requirement cannot`,v(a,`alias`));let l=Ut(c,v(a,`alias`));if(r.alias_normalized!==l)throw new g(`expected ${_(l)}, the alias normalized`,v(a,`alias_normalized`));return{package:o,version:s,alias:c,aliasNormalized:l}})}function Tr(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{composerJson:n}=ee(t,[`composerJson`]),r=n===void 0?void 0:qn(n),i=Ve(e),{contentHash:a,pluginApiVersion:o,minimumStability:s}=hr(i),c=gr(i,o),l=vr(i[`stability-flags`],c),u=[];for(let[e,t]of[[`packages`,!1],[`packages-dev`,!0]])for(let[n,r]of xr(i,e).entries()){let i=`${e}[${n}]`;u.push({...wn(r,i,t),where:i})}Sr(u);let d=new Map(u.map(({pkg:e})=>[b(e.name),e])),f=wr(i.aliases,d),p=sr(u,f,s,l,r),m=Object.create(null);for(let[{pkg:e},{require:t,aliases:n}]of p)m[b(e.name)]={...e,require:t,aliases:n};return{contentHash:a,fresh:r===void 0?void 0:r.contentHash===a,pluginApiVersion:o,minimumStability:s,stabilityFlags:l,preferStable:i[`prefer-stable`],preferLowest:i[`prefer-lowest`],platform:yr(i.platform,`platform`),platformDev:yr(i[`platform-dev`],`platform-dev`),platformOverrides:br(i[`platform-overrides`]),aliases:f,packages:m}}export{g as LockfileError,Tr as parseComposerLock};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.codePointAt(r)-t.codePointAt(r);return e.length-t.length}export{e as a};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var e=new TextEncoder;function t(t){if(typeof t!=`string`)throw TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw TypeError(`encodeUtf8: input contains lone surrogates`);return e.encode(t)}async function n(e){let n=typeof e==`string`?t(e):e,r=new Uint8Array(await crypto.subtle.digest(`SHA-512`,n));return`sha512-${btoa(String.fromCodePoint(...r))}`}async function r(e){let n=t(JSON.stringify(e)),r=await crypto.subtle.digest(`SHA-256`,n),i=new Uint8Array(r,0,16);i[6]=i[6]&15|64,i[8]=i[8]&63|128;let a=Array.from(i,e=>e.toString(16).padStart(2,`0`)).join(``);return`${a.slice(0,8)}-${a.slice(8,12)}-${a.slice(12,16)}-${a.slice(16,20)}-${a.slice(20,32)}`}async function i(e){if(typeof crypto?.subtle?.digest!=`function`)return null;let t=a(e);try{return await r(t)}catch{return null}}function a(e){if(e._idBasis)return e._idBasis;let{severity:t,description:n}=e;return e.fileHash?{severity:t,description:n,fileHash:e.fileHash}:e.location?{severity:t,description:n,location:e.location}:{severity:t,description:n,file:e.file,line:e.line}}var o=new Map([[`CRITICAL`,`critical`],[`HIGH`,`high`],[`MEDIUM`,`medium`],[`LOW`,`low`],[`INFO`,`informational`],[`INFORMATIONAL`,`informational`],[`INFORMATIVE`,`informative`]]);function s(e){return typeof e==`string`&&e.trim().toLowerCase()===`informative`?`informational`:e}function c(e,t=e.severity){let n=s(e.severity);return n!==e.severity&&(!e.id&&!e._idBasis&&(e._idBasis=a({...e,severity:t})),e.severity=n),e.correctedSeverity!==void 0&&(e.correctedSeverity=s(e.correctedSeverity)),e}var l={critical:`Critical`,high:`High`,medium:`Medium`,low:`Low`,high_bug:`High bug`,bug:`Bug`,informational:`Informational`},u={inprogress:`In progress`,fixed:`Fixed`,invalid:`Invalid`,deleted:`Deleted`,ignored:`Ignored`},d={red:`Red`,blue:`Blue`,green:`Green`,gray:`Gray`,none:`Unmarked`},f={"claude-security":`Claude Security`,"codex-security":`Codex Security`,deepsec:`DeepSec`,piolium:`Piolium`,"markdown-generic":`Markdown (generic)`};function p(e){return l[s(e)]??String(e??``)}var m=/^( *)(`{3,}|~{3,})(.*)$/u,h=/^ {0,3}(?:#{1,6}(?:[ \t]|$)|>|([-*_])(?:[ \t]*\1){2,}[ \t]*$)/u,g=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u,_=/^ {0,3}(?:=+|-+)[ \t]*$/u,v=/^( *)(?:[-*+]|\d{1,9}[.)]) +(?=\S)/u,ee=/^ *(?:[-*+]|\d{1,9}[.)])[ \t]*$/u,y=/^\s*$/u,te=[[/^<(script|pre|textarea|style)(?:\s|>|$)/iu,/<\/(?:script|pre|textarea|style)>/iu,e=>`</${e[1].toLowerCase()}>`],[/^<!--/u,/-->/u,`-->`],[/^<\?/u,/\?>/u,`?>`],[/^<![A-Za-z]/u,/>/u,`<!-- -->`],[/^<!\[CDATA\[/u,/\]\]>/u,`]]>`],[/^<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|search|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/iu,y,null]],ne=/^(?:<[A-Za-z][\dA-Za-z-]*(?:\s+[:A-Z_a-z][\w.:-]*(?:\s*=\s*(?:[^\s"'<=>`]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][\dA-Za-z-]*\s*>)\s*$/u;function b(e,t,n=t){let r=/^ */u.exec(e)[0].length;if(r>3)return null;if(t&&n&&_.test(e))return!0;let i=m.exec(e);if(i&&!(i[2][0]==="`"&&i[3].includes("`")))return{fence:i[2]};let a=e.slice(r);for(let[e,t,n]of te){let r=e.exec(a);if(r)return{html:t,close:typeof n==`function`?n(r):n}}if(!t&&ne.test(a))return{html:y,close:null};let o=g.test(e)?null:v.exec(e);if(o&&!(t&&n&&/^ *(?:\d*[02-9]|\d+\d)[.)]/u.test(o[0]))){let e=/ +$/u.exec(o[0])[0].length;return{item:e>4?o[0].length-e+1:o[0].length}}let s=g.test(e)||t&&n?null:ee.exec(e);return s?{item:s[0].trimEnd().length+1}:h.test(e)||null}function x(e){return ie(e).ranges}function re(e,t){let n=e.replace(/^(?: {0,3}> ?)+/u,``),r=b(n,t);for(;r?.item;)n=n.slice(r.item),r=b(n,!1);return n.trim()!==``&&!r&&/^ */u.exec(n)[0].length<4}function ie(e){let t=[],n=-1,r=``,i=null,a=0,o=[],s=!1,c=!1,l=!1,u=0;for(let d of e.split(`
|
|
2
|
+
`)){let e=u;u+=d.length+1;let f=/^ */u.exec(d)[0].length;if(n!==-1||i){let o=a>0&&d.trim()!==``&&f<a,s=!o&&(i?i.ends.test(d):f<=a+3&&ae(r,d));if((o||s)&&(n!==-1&&t.push([n,o?e-1:e+d.length]),n=-1,i=null),!o)continue}if(!d.trim()){l&&o.pop(),l=!1,s=!1;continue}let p=o.length;for(;p>0&&f<o[p-1];)p--;let m=p>0?o[p-1]:0,h=d.slice(m),g=b(h,s,p===o.length&&!c);if(s&&!g)continue;for(o.length=p;g?.item;)m+=g.item,h=h.slice(g.item),o.push(m),g=b(h,!1);l=h.trim()===``,g?.fence?[n,r,a]=[e,g.fence,m]:g?.html&&([i,a]=[g.html.test(h)?null:{ends:g.html,close:g.close},m]);let _=s&&c;c=/^ {0,3}>/u.test(h),s=c?re(h,_):!g&&!l&&/^ */u.exec(h)[0].length<4}n!==-1&&t.push([n,e.length]);let d=n===-1?i?.close:r;return{ranges:t,closer:d?` `.repeat(a)+d:null}}function ae(e,t){let n=m.exec(t);return n!==null&&n[2][0]===e[0]&&n[2].length>=e.length&&!n[3].trim()}function S(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i][1]<=t?n=i+1:r=i}return n<e.length&&t>=e[n][0]}function C(e){return String(e??``).replaceAll(/\r\n?/gu,`
|
|
3
|
+
`)}var oe=/^## +(.*)$/gmu,se=/^### +(.*)$/gmu,w=/^#### +(.*)$/gmu,ce=/^##### +(.*)$/gmu,le=/^(.+):(\d+(?:-\d+)?)$/u;function T(e){return/^[0-9a-f]{7,64}$/iu.test(e)}function ue(e,t){let n=x(e);return[...e.matchAll(t)].filter(e=>!S(n,e.index))}function de(e,t){let n=ue(e,t);return[e.slice(0,n[0]?.index),...n.map((t,r)=>e.slice(t.index+t[0].length,n[r+1]?.index))]}function E(e,t){let n=ue(e,t);return{head:e.slice(0,n[0]?.index),subs:n.map((t,r)=>({heading:t[1],body:e.slice(t.index+t[0].length+1,n[r+1]?.index)}))}}function D(e,t){return E(e,t).subs}function O(e){let t=e.indexOf(`
|
|
4
|
+
`);return t===-1?{title:e.trim(),body:``}:{title:e.slice(0,t).trim(),body:e.slice(t+1)}}function fe(e){let t=e.split(`
|
|
5
|
+
`).map(e=>e.trim()).filter(e=>e.startsWith(`|`)&&!(/^[\s:|-]+$/u.test(e)&&e.includes(`-`))).map(e=>e.replace(/^\|/u,``).replace(/\|$/u,``).split(`|`).map(e=>e.trim()));if(t.length<2)return[];let n=t[0].map(e=>e.toLowerCase());return t.slice(1).filter(e=>e.length!==n.length||e.some((e,t)=>e.toLowerCase()!==n[t])).map(e=>Object.fromEntries(n.flatMap((t,n)=>t?[[t,e[n]??``]]:[])))}function pe(e){let t=Object.create(null),n=Object.create(null),r=[],i=null,a=``,o=[],s=``,c=(e,r,i)=>{!e||e in t||(t[e]=i.trim(),n[e]=r)},l=()=>{i&&c(i,a,o.join(`
|
|
6
|
+
`)),i=null,a=``,o=[]},u=e=>{(i?o:r).push(e)};for(let t of e.split(`
|
|
7
|
+
`)){let e=/^ {0,3}(```|~~~)/u.exec(t),n=e!==null&&(!s||e[1]===s);if(n&&(s=s?``:e[1]),n||s){u(t);continue}if(!t.trim()){i?l():r.push(t);continue}let d=/^\s*(?:[-*] +)?\*\*([^:*]+):\*\*\s*(.*)$/u.exec(t);if(d){l();let e=d[1].trim(),t=d[2],n;for(;(n=/\s+[\u00B7\u2022]\s+\*\*([^:*]+):\*\*\s*/u.exec(t))!==null;)c(e.toLowerCase(),e,t.slice(0,n.index)),e=n[1].trim(),t=t.slice(n.index+n[0].length);i=e.toLowerCase(),a=e,o=[t]}else/^\s*(?:#{1,6} |\||[-=*_]{3,}\s*$)/u.test(t)?l():u(t)}return l(),{fields:t,labels:n,prose:r.join(`
|
|
8
|
+
`).trim()}}function me(e){let t=(e||``).trim(),n=``,r=k(t);r&&(t=r.label.trim(),n=r.url.trim());let i=/#L(\d+)/u.exec(n)?.[1]??``,a=[...t.matchAll(/`([^`]+)`/gu)].map(e=>e[1].trim()).find(e=>!e.includes(`(`)&&(e.includes(`/`)||/\.\w/u.test(e)))??(t.replaceAll("`",``).trim().split(/[\s,]+/u).find(Boolean)||``),o=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(a);o&&(a=o[1],i||=o[2]);let s=le.exec(a);return s?(i||=s[2],{file:s[1],line:i,locationLink:n}):{file:a,line:i||`?`,locationLink:n}}function he(e){return e.replaceAll(`**`,``)}function k(e){let t=String(e??``),n=ge(t,_e(t)),r=ve(t),i=t.indexOf(`]`);for(let e=t.indexOf(`[`);e!==-1;e=t.indexOf(`[`,e+1)){for(;i!==-1&&i<=e;)i=t.indexOf(`]`,i+1);for(let a of[i,n.get(e)??-1]){if(a===-1||a===e+1||t[a+1]!==`(`)continue;let n=ye(t,a+1,r);if(n!==null)return{label:t.slice(e+1,a),url:n,index:e}}}return null}function ge(e,t){let n=new Map,r=[];for(let i=0;i<e.length;i++){let a=e[i];Ce(e,i)?i++:a==="`"?i=t.get(i)??i:a===`[`?r.push(i):a===`]`&&r.length>0&&n.set(r.pop(),i)}return n}function _e(e){let t=[];for(let n=e.indexOf("`");n!==-1;n=e.indexOf("`",n)){let r=1;for(;e[n+r]==="`";)r++;t.push([n,r]),n+=r}let n=new Map,r=new Map;for(let e=t.length-1;e>=0;e--){let[i,a]=t[e],o=r.get(a);o!==void 0&&n.set(i,o+a-1),r.set(a,i)}return n}function ve(e){let t=e.length,n=new Int32Array(t+1).fill(-1),r=new Int32Array(t+1).fill(-1),i=new Int32Array(t+1).fill(-1),a=new Int32Array(t+1).fill(-1);for(let o=t-1;o>=0;o--)n[o]=e[o]===`)`?o:n[o+1],r[o]=/\s/u.test(e[o])?o:r[o+1],i[o]=e[o]===`>`?o:i[o+1],a[o]=e[o]===`
|
|
9
|
+
`?o:a[o+1];let o=new Map,s=[];for(let n=0;n<t;n++){let t=e[n];Ce(e,n)?n++:r[n]===n?s.length=0:t===`(`?s.push(n):t===`)`&&s.length>0&&o.set(s.pop(),n)}return{balanced:o,nextClose:n,nextSpace:r,nextAngle:i,nextLine:a}}function ye(e,t,n){let r=be(e,t,n);if(r)return r;let i=n.balanced.get(t);if(i!==void 0)return i>t+1?e.slice(t+1,i):null;let a=n.nextClose[t+1],o=n.nextSpace[t+1];return a===-1||a===t+1||o!==-1&&o<a?null:e.slice(t+1,a)}function be(e,t,n){if(e[t+1]!==`<`)return``;let r=n.nextAngle[t+2],i=n.nextLine[t+2];return r===-1||i!==-1&&i<r||e[r+1]!==`)`?``:e.slice(t+2,r)}var xe=/\\([!-/:-@[-`{-~])/gu,Se=/[!-/:-@[-`{-~]/u;function Ce(e,t){return e[t]===`\\`&&Se.test(e[t+1]??``)}function we(e){return typeof e==`string`?e.replace(xe,`$1`):e}function Te(e){let t=/^\[(.+)\]$/u.exec(e.trim());return t?t[1].trim():e.trim()}function A(e){let t=(e||``).trim();return/^[-\u2013\u2014]+$/u.test(t)?``:t}var Ee={critical:6,high:5,medium:4,low:3,high_bug:2,bug:1,informational:0},j=[`critical`,`high`,`medium`,`low`,`high_bug`,`bug`,`informational`];function De(e){return e=s(e),e!=null&&e in Ee?e:null}function Oe(e){return De(e?.correctedSeverity)??s(e?.severity)}function ke(e){let t=De(e?.correctedSeverity);return t!=null&&t!==s(e?.severity)}function Ae(e,t){return t===`original`?s(e?.severity):Oe(e)}function je(e){let t=e?._correctedByReport;return t&&new Set(Object.values(t).map(e=>s(e?.severity))).size>1?t:null}var Me=[`revalidation`,`refuted`,`unreachable`,`confirmed`,`partial`,`unknown`],Ne=new Set(Me);function M(e){return Ne.has(e?.revalidate)?e.revalidate:``}function Pe(e,t=e?.source){return Object.hasOwn(f,t)||M(e)===`revalidation`}function Fe(e,t=e?._source??e?.source){let n=typeof t==`string`&&t!==``&&t!==`deepview`,r=n?t:e?.analyzer??e?.type??e?._analyzer;return e?.security===!0||(r===`security`||r===`dependencies`)&&e?.security!==!1||n&&[`critical`,`high`,`medium`,`low`].includes(e?.severity)}function Ie(e){return e&&e.replace(/^[^/]+\//u,``).replace(/^claude-/u,``).replaceAll(`-`,` `)}function Le(e,t=!0){let n=t&&M(e)===`revalidation`?`revalidate`:``;return[e?.type,n,Ie(e?.model),e?.effort,e?.exportsMode].filter(Boolean).join(` · `)}function N(e,t){if(!e)return e;let n=e;t?.exportsMode===`isolate`&&(n=n.replace(/^\((?:[^()]|\([^()]*\))*\): \[export:\s*\w+\] /u,``),n=n.replace(/^\[export:\s*\w+\] /u,``));let r=[t?.exportName,t?.methodName].filter(Boolean).map(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/gu,`\\$&`));for(let e of r)n=n.replaceAll(RegExp(`\\[export:\\s*${e}\\]\\s*`,`gu`),``);for(let e of r)n=n.replace(RegExp(`^\\(\`?${e}\`?\\): `,`u`),``);return n}function Re(e){let t=e?.exportName,n=e?.methodName;return t&&n&&t!==n?`${t}.${n}`:t||n||``}function P(e){return e?e.split(`
|
|
10
|
+
`).find(e=>e.trim())?.trim()??``:``}function ze(e){return typeof e?.title==`string`?e.title.trim():``}function F(e){return ze(e)||P(N(e?.description,e))}function Be(e){let t=N(e?.description,e)||``,n=ze(e);if(n){let e=t.trim(),r=O(e);return{title:n,body:r.title===n?r.body.replace(/^\s+/u,``):e}}let r=t.indexOf(`
|
|
11
|
+
`);if(r<0||x(t.slice(0,r))[0]?.[0]===0)return{title:``,body:t};let i=t.slice(r+1).replace(/^\s+/u,``);return i?{title:t.slice(0,r).trim(),body:i}:{title:``,body:t}}function Ve(e){let t=ze(e);if(!t)return N(e?.description,e)||``;let{body:n}=Be(e);return n?`${t}
|
|
12
|
+
|
|
13
|
+
${n}`:t}var He=/^\*\*([^*\n]+):\*\*[ \t]*/u;function Ue(e){let t=[];for(let n of de(e||``,/\n{2,}/gu)){if(!n.trim())continue;let e=He.exec(n);if(e){t.push({label:e[1].trim(),body:n.slice(e[0].length).trim()});continue}let r=t.at(-1);r&&r.label===null?r.body+=`
|
|
14
|
+
|
|
15
|
+
${n}`:t.push({label:null,body:n})}return t}function I(e){return Number.isFinite(parseInt(e?.line,10))?`${e.file}:${e.line}`:e?.file??``}function We(e){let t=e=>typeof e==`string`?e:``;return`${t(e?.observation)}
|
|
16
|
+
${t(e?.text)}`.trim()}function L(e){if(typeof e!=`string`||e.length===0)return!1;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function Ge(e){return String(e??``).replaceAll(/\s*\n\s*/gu,` `).replaceAll(`|`,`\\|`).trim()}function R(e){let t=String(e??``);if(t===``)return``;let n=Math.max(0,...[...t.matchAll(/`+/gu)].map(e=>e[0].length)),r="`".repeat(n+1),i=t.startsWith("`")||t.endsWith("`")?` `:``;return`${r}${i}${t}${i}${r}`}function Ke(e){return String(e??``).replaceAll(/[[\]]/gu,`\\$&`)}function z(e,t){return`[${e}](${/[\s()<>]/u.test(t)?`<${t.replaceAll(`>`,`%3E`)}>`:t})`}function qe(e){return L(e)?`<${e}>`:String(e??``)}function Je(e,t){let n=String(e??``).toLowerCase().replaceAll(/[^\p{L}\p{N}\p{M}\s_-]/gu,``).replaceAll(/\s/gu,`-`),r=n;for(let e=1;t.has(r);e++)r=`${n}-${e}`;return t.add(r),r}function B(e,t){return`${`#`.repeat(Math.min(6,Math.max(1,e)))} ${t}`}function Ye(e,t,n=[]){return[e,e.map((e,t)=>n[t]===`right`?`---:`:`---`),...t].map(e=>`| ${e.join(` | `)} |`).join(`
|
|
17
|
+
`)}function Xe(e){let t=e instanceof Date?e:new Date(e);if(Number.isNaN(t.getTime()))return``;let n=e=>String(e).padStart(2,`0`);return`${t.getUTCFullYear()}-${n(t.getUTCMonth()+1)}-${n(t.getUTCDate())} ${n(t.getUTCHours())}:${n(t.getUTCMinutes())} UTC`}function V(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function Ze(e){return e.filter(e=>typeof e==`string`&&e.trim()).map(e=>e.replace(/\s+$/u,``)).join(`
|
|
18
|
+
|
|
19
|
+
`)}var Qe=/^( {0,3})(\\*#)/u;function H(e){let t=C(e).trim();if(!t)return``;let n=$e(t,e=>e.replace(Qe,`$1\\$2`)),{closer:r}=ie(n);return r===null?n:`${n}
|
|
20
|
+
${r}`}function $e(e,t){let n=x(e),r=0;return e.split(`
|
|
21
|
+
`).map(e=>{let i=r;return r+=e.length+1,S(n,i)?e:t(e)}).join(`
|
|
22
|
+
`)}function U(e){return $e(String(e??``),e=>e.replace(/^( {0,3})\\(\\*#)/u,`$1$2`))}function et(e,t){let n=` `.repeat(e.length);return t.split(`
|
|
23
|
+
`).map(e=>e?n+e:``).join(`
|
|
24
|
+
`)}var tt=[`type`,`model`,`think`,`effort`,`exportsMode`];function nt(e,t){if(!t.source)for(let n of tt)e[n]==null&&t[n]!=null&&(e[n]=t[n])}var rt=/^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/?#]+)\/([^/?#]+?)(?:\.git)?(?:[/?#].*)?$/iu,it=/^[\w.-]+\/[\w.-]+$/u;function at(e){return it.test(e)}function ot(e){let t=e?.repo?.github;if(typeof t!=`string`)return null;let n=t.trim().replace(/\/+$/u,``);if(!n)return null;let r=rt.exec(n),i=(r?`${r[1]}/${r[2]}`:n).replace(/\.git$/u,``);return at(i)?i:null}function st(e){let t=(typeof e?.directory==`string`?e.directory.trim():``).replace(/^(?:\.\/)+/u,``).replaceAll(/^\/+|\/+$/gu,``).replaceAll(/\/{2,}/gu,`/`);return!t||t===`.`||/[?#]/u.test(t)||t.split(`/`).includes(`..`)?``:t}var ct=[`finding_url`,`repository`,`title`,`description`,`severity`,`configured_scan_id`,`relevant_paths`];function lt(e){let t=[],n=[],r=``,i=!1;for(let a=0;a<e.length;a++){let o=e[a];i?o===`"`?e[a+1]===`"`?(r+=`"`,a++):i=!1:r+=o:o===`"`?i=!0:o===`,`?(n.push(r),r=``):o===`
|
|
25
|
+
`||o===`\r`?(n.push(r),t.push(n),n=[],r=``,o===`\r`&&e[a+1]===`
|
|
26
|
+
`&&a++):r+=o}for((r!==``||n.length>0)&&(n.push(r),t.push(n));t.length>0&&t.at(-1).length===1&&t.at(-1)[0]===``;)t.pop();return t}function ut(e,t){return t.map(t=>{let n=Object.create(null);return e.forEach((e,r)=>{n[e]=t[r]??``}),n})}function dt(e){let t=lt(e);if(t.length<2)throw Error(`Codex CSV: empty or missing header row`);let[n,...r]=t;for(let e of ct)if(!n.includes(e))throw Error(`Codex CSV: missing required column "${e}"`);let i=Map.groupBy(ut(n,r).filter(e=>e.configured_scan_id),e=>e.configured_scan_id);if(i.size===0)throw Error(`Codex CSV: no rows with a configured_scan_id`);let a=[];for(let[e,t]of i){let n=new Set(t.map(e=>e.repository).filter(Boolean));if(n.size>1)throw Error(`Codex CSV: scan ${e} contains multiple repositories: ${[...n].join(`, `)}`);let r=`${[...n][0]||`unknown-repo`}:${e.replace(/^[^:]+:/u,``)}`;a.push({displayName:r,data:{type:`security`,source:`codex-security`,findings:t.map(ft)}})}return a}function ft(e){let t=e.relevant_paths.split(` | `).map(e=>e.trim()).find(Boolean)||`unknown`,n=[e.title,e.description].filter(Boolean).join(`
|
|
27
|
+
|
|
28
|
+
`),r={id:e.finding_url,file:t,line:`?`,severity:(e.severity||`medium`).toLowerCase(),description:n,repo:{github:e.repository}};return e.commit_hash&&(r.commitHash=e.commit_hash),e.detected_at&&(r.detectedAt=e.detected_at),e.committed_at&&(r.committedAt=e.committed_at),c(r)}function pt(){let e=[],t=new Map,n=n=>{if(!t.has(n)){let r={security:!1};r.parent=r,t.set(n,r),typeof n==`string`&&e.push(n)}return t.get(n)},r=e=>{let t=e;for(;t.parent!==t;)t=t.parent;for(;e.parent!==e;){let n=e.parent;e.parent=t,e=n}return t};return{nodeFor:n,root:r,join:(e,t)=>{e=r(e),t=r(t),e!==t&&(t.parent=e,e.security||=t.security)},ids:e}}function mt(e,{source:t,linkedIds:n=()=>[],knownRows:r=()=>[]}={}){let{nodeFor:i,root:a,join:o,ids:s}=pt(),c=[],l=(e,n=!1)=>{let r;for(let s of e){if(!s||typeof s!=`object`)continue;let e=i(s.id||s);a(e).security||=n?s.isSecurity===!0:Fe(s,s._source??s.source??t),r?o(r,e):r=e,n||c.push([s,e])}};for(let t of e)l(t);let u=new Set;for(let e=0;e<s.length;e++){let t=s[e],a=i(t);for(let e of n(t))o(a,i(e));for(let e of r([t]))u.has(e)||(u.add(e),l(e.members,!0))}let d=!1;for(let[e,t]of c){let n=a(t).security;e.isSecurity!==n&&(e.isSecurity=n,d=!0)}return d}var ht=/^## ([A-Z][A-Z_]*)\s*\(\d+\)\s*\n/mu,gt=new Map([...o,[`HIGH_BUG`,`high_bug`],[`BUG`,`bug`]]),_t=e=>String(e??``).toLowerCase().replaceAll(/[^a-z]+/gu,``),vt=new Map([[`high`,8],[`medium`,6],[`low`,4]]);function yt(e){if(e!==void 0)return vt.get(_t(e))??vt.get(`medium`)}var bt=new Map([[`confirmed`,`confirmed`],[`falsepositive`,`refuted`],[`uncertain`,`unknown`]]);function xt(e){let t=C(e).trim().split(ht);if(t.length===1)return null;let n=[];for(let e=1;e<t.length;e+=2){let r=gt.get(t[e].toUpperCase())??`medium`;for(let i of de(t[e+1],/^### /gmu).slice(1)){let e=St(i,r);if(!e)continue;let t=i.indexOf(`
|
|
29
|
+
### `);t!==-1&&(e._idBasis=a(St(i.slice(0,t+1),r))),n.push(e)}}return n.length===0?null:{type:`security`,source:`deepsec`,findings:n}}function St(e,t){let{title:n,body:r}=O(e);if(!n)return null;let i=r.replace(/\n---\s*$/u,``).trim(),a=Object.fromEntries([...i.matchAll(/^- \*\*([^:*]+):\*\*\s*(.+)$/gmu)].map(e=>[e[1].trim().toLowerCase(),e[2].trim()])),o=/^\*\*Recommendation:\*\*\s*/mu.exec(i),s=o?i.slice(0,o.index):i,l=o?i.slice(o.index+o[0].length).trim():``,u=[n,s.split(`
|
|
30
|
+
`).filter(e=>!/^\s*- \*\*/u.test(e)).join(`
|
|
31
|
+
`).replaceAll(`**`,``).trim()].filter(Boolean).join(`
|
|
32
|
+
|
|
33
|
+
`),d={file:(a.file||`unknown`).replace(/^`(.*)`$/u,`$1`),line:(a.lines||``).split(`,`).map(e=>e.trim()).find(Boolean)||`?`,severity:t,description:u};l&&(d.recommendation=l.replaceAll(`**`,``));let f=yt(a.confidence);f!==void 0&&(d.confidence=f);let p=bt.get(_t(a.revalidation));return p&&(d.revalidate=p,d.revalidateSource=`deepsec`,a.reasoning&&(d.revalidateVerdict=a.reasoning.replaceAll(`**`,``))),a.slug&&(d.slug=a.slug),c(d,t===`informative`?`medium`:t)}var W=120;function Ct(e){let t=F(e)||I(e)||`Untitled finding`;return t.length>W?`${t.slice(0,W-1).trimEnd()}\u2026`:t}function wt(e){let t=String(e??``).trim();return L(t)?qe(t):at(t)?z(t,`https://github.com/${t}`):t}function Tt(e,t,n){return t?f[t]??String(t):Le(e,n)}var Et=[[`Impact`,`impact`,!1],[`Reproduction`,`reproduction`,!1],[`Recommendation`,`recommendation`,!1],[`Confidence reasoning`,`confidenceReason`,!1],[`Revalidation verdict`,`revalidateVerdict`,!0],[`Revalidation recommendation`,`revalidateRecommendation`,!0]],Dt=[[`Status`,`status`],[`Branch`,`branch`],[`Date created`,`dateCreated`],[`Detected at`,`detectedAt`],[`Committed at`,`committedAt`],[`PoC status`,`pocStatus`],[`Variant of`,`parent`],[`Slug`,`slug`],[`Priority`,`priority`]],Ot=[[`Detailed report`,`reportPath`],[`Commit audited`,`auditedCommit`],[`ID`,`id`]];function G(e){return typeof e==`number`?Number.isFinite(e)?String(e):``:typeof e==`string`?e.replaceAll(/\s*\n\s*/gu,` `).trim():``}function kt(e){return typeof e==`string`?e.trim():``}function At(e,t){let n=t.severityMode===`original`,r=p(Ae(e,t.severityMode));ke(e)&&(r+=n?` \u2014 corrected to ${p(Oe(e))}`:` \u2014 corrected from ${p(e.severity)}`);let i=je(e);if(i){let e=Object.entries(i).map(([e,t])=>`${e||`this report`}: ${p(t?.severity)}`);r+=` (varies across reports \u2014 ${e.join(`; `)})`}return e.critical===!0&&(r+=` · flagged critical by the analyzer`),r}function jt(e,t){let n=I(e);if(!n)return``;let r=t.hooks.location(e),i=L(r)?z(R(n),r):R(n),a=Re(e);return a?`${i} \xB7 ${R(a)}`:i}function Mt(e){if(!e)return``;let t=[],n=u[e.triage]??(e.ignored?u.ignored:``);return n&&t.push(n),e.color&&t.push(`${d[e.color]??e.color} mark`),e.flagged===!0&&t.push(`Flagged`),t.join(` · `)}function Nt(e,t){let n=G(e.commitHash);if(!n)return``;let r=t.hooks.commit(e);return L(r)?z(R(n.slice(0,7)),r):R(n)}function Pt(e,t,n){let r=[],i=(e,t)=>{t&&r.push(`- **${e}:** ${t}`)};i(`Location`,jt(e,t)),i(`Severity`,At(e,t)),e.confidence!==void 0&&e.confidence!==null&&i(`Confidence`,`${e.confidence}/10`),t.showAnalyzer&&i(`Analyzer`,t.analyzerOf(e)),i(`Category`,G(e.category));let a=t.revalidation?M(e):``;a&&i(`Revalidation`,a===`revalidation`?`the revalidation pass itself`:a);let o=G(e.revalidateSource);a&&i(`Revalidated by`,f[o]??o),i(`Triage`,Mt(n)),n?.fix&&i(`Fix`,qe(String(n.fix).trim())),t.showReport&&i(`Report`,R(t.hooks.report(e)??``));let s=G(e.repo?.github);s&&s!==t.repo&&i(`Repository`,wt(s)),i(`Introduced in`,Nt(e,t));let c=G(e.discoveredIn);c&&c!==String(e.file??``).trim()&&i(`Found while analyzing`,R(c));let l=e.package?.npm,u=G(l?.name);u&&i(`Package`,R(G(l.version)?`${u}@${G(l.version)}`:u));for(let[t,n]of Dt)i(t,G(e[n]));for(let[t,n]of Ot)i(t,R(G(e[n])));return r.join(`
|
|
34
|
+
`)}function K(e,t,n){let r=H(n);return r?`${B(e,t)}
|
|
35
|
+
|
|
36
|
+
${r}`:B(e,t)}function Ft(e,t){return(Array.isArray(e.evidence)?e.evidence:[]).map((n,r)=>{let i=`${r+1}. `,a=I(n),o=t.hooks.evidence(n,e,r),s=``;a?s=L(o)?z(R(a),o):R(a):L(o)&&(s=qe(o));let c=H(We(n)),l=i+(s||`(no reference)`);return c?`${l}
|
|
37
|
+
|
|
38
|
+
${et(i,c)}`:l}).join(`
|
|
39
|
+
|
|
40
|
+
`)}function It(e,t,n){let r=Be(e),i=C(r.body),a=F(e),o=a.length>W,s=!o&&!r.title&&i.trim()===a,c=o&&P(i)!==a?`${a}
|
|
41
|
+
|
|
42
|
+
${i}`:i,l=Ue(s?``:c),u=l.findIndex(e=>e.label!==null),d=u===-1?l:l.slice(0,u),f=u===-1?[]:l.slice(u),p=d.map(e=>H(e.body)),m=Ft(e,t);m&&p.push(`${B(n,`Evidence`)}
|
|
43
|
+
|
|
44
|
+
${m}`);for(let e of f)p.push(e.label===null?H(e.body):K(n,e.label,e.body));return p}function Lt(e,t,n){let r=t.hooks.annotation(e),i=[Pt(e,t,r),...It(e,t,n)];for(let[r,a,o]of Et){if(o&&!t.revalidation)continue;let s=e[a],c=typeof s==`string`?N(s,e):``;c.trim()&&i.push(K(n,r,c))}ke(e)&&kt(e.correctedSeverityReason)&&i.push(K(n,`Severity correction`,e.correctedSeverityReason));let a=kt(r?.comment);return a&&i.push(K(n,`Comment`,a)),i}function Rt(e,t,{headingText:n,depth:r}){let i=[B(r,n)];if(e.length===1)return Ze([...i,...Lt(e[0],t,r+1)]);let a=[...new Set(e.map(e=>t.hooks.report(e)).filter(Boolean))],o=a.length>1?` \u2014 reported in ${a.map(e=>R(e)).join(`, `)}`:``;i.push(`${V(e.length,`case`)} of this finding${o}.`);let s=F(e[0]);return e.forEach((n,a)=>{let o=I(n);i.push(B(r+1,`Case ${a+1} of ${e.length}${o?` \u2014 ${R(o)}`:``}`));let c=F(n);c&&c!==s&&i.push(H(c)),i.push(...Lt(n,t,r+2))}),Ze(i)}var zt=new Map(Object.entries(l).map(([e,t])=>[t.toLowerCase(),e])),Bt=new Map(Object.entries(f).map(([e,t])=>[t.toLowerCase(),e]));function q(e){let t=/(`+)(.+?)\1(?!`)/u.exec(String(e??``));if(!t)return null;let n=t[2];if(n.length>2&&n.startsWith(` `)&&n.endsWith(` `)){let e=n.slice(1,-1);if(e.startsWith("`")||e.endsWith("`"))return e}return n}function J(e){let t=k(String(e??``));return t?.index===0?{label:t.label,url:t.url}:null}function Vt(e){let t=/^<(https?:[^>\s]*)>$/u.exec(e.trim());return t?t[1]:null}function Ht(e){let t=le.exec(e);return t?{file:t[1],line:t[2]}:{file:e,line:`?`}}function Ut(e){let t=e.indexOf(`.`);return t>0?{exportName:e.slice(0,t),methodName:e.slice(t+1)}:{exportName:e}}function Wt(e){let t=String(e??``).trim();return zt.get(t.toLowerCase())??t}function Gt(e){let t={},n=e.trim(),r=/ \u00B7 (`+)(.+?)\1$/u.exec(n);r&&(Object.assign(t,Ut(q(r[0]))),n=n.slice(0,r.index));let i=J(n),a=q(i?i.label:n);return a!==null&&Object.assign(t,Ht(a)),i&&L(i.url)&&(t.location=i.url),t}var Kt=` · flagged critical by the analyzer`,qt=` (varies across reports — `;function Jt(e){let t={},n=e.trim();n.endsWith(Kt)&&(t.critical=!0,n=n.slice(0,-Kt.length));let r=n.indexOf(qt);r!==-1&&(n=n.slice(0,r));let i=/^(.*?) \u2014 corrected (from|to) (.*)$/u.exec(n);return i?[t.severity,t.correctedSeverity]=(i[2]===`from`?[i[3],i[1]]:[i[1],i[3]]).map(Wt):t.severity=Wt(n),t}var Yt=new Set([`max`,`xhigh`,`high`,`medium`,`low`,`minimal`]),Xt=new Set([`list`,`isolate`]);function Zt(e){return/\d/u.test(e)||/^(?:opus|sonnet|haiku|gpt|gemini|fable|mythos|llama|mistral)\b/iu.test(e)}function Qt(e){let t=e.trim(),n=Bt.get(t.toLowerCase());if(n)return{source:n};let r={},i=[];for(let e of t.split(` · `).map(e=>e.trim()).filter(Boolean))e===`revalidate`&&!r.revalidate?r.revalidate=`revalidation`:Xt.has(e)&&!r.exportsMode?r.exportsMode=e:Yt.has(e)&&!r.effort?r.effort=e:i.push(e);return i.length>1?[r.type,r.model]=i:i.length===1&&(r[Zt(i[0])?`model`:`type`]=i[0]),{run:r}}function $t(e){let t=e.trim(),n=J(t);return n?n.label.trim():Vt(t)??t}function en(e){let t=J(e.trim());if(t){let e=t.url.split(`/`).at(-1)??``;return T(e)?e:q(t.label)??e}return q(e)??e.trim()}function tn(e){let t=q(e)??e.trim(),n=t.lastIndexOf(`@`);return{npm:n>0?{name:t.slice(0,n),version:t.slice(n+1)}:{name:t}}}function nn(e){let t=e.trim().toLowerCase();return t===`the revalidation pass itself`?`revalidation`:Me.includes(t)?t:void 0}var rn=new Map([...[[`Category`,`category`],...Dt].map(([e,t])=>[e.toLowerCase(),(e,n)=>{e[t]=n}]),...[...Ot,[`Found while analyzing`,`discoveredIn`]].map(([e,t])=>[e.toLowerCase(),(e,n)=>{e[t]=q(n)??n}]),[`location`,(e,t)=>Object.assign(e,Gt(t))],[`severity`,(e,t)=>Object.assign(e,Jt(t))],[`confidence`,(e,t)=>{let n=/^(\d+(?:\.\d+)?)\/10$/u.exec(t);n&&(e.confidence=Number(n[1]))}],[`revalidation`,(e,t)=>{let n=nn(t);n&&(e.revalidate=n)}],[`revalidated by`,(e,t)=>{let n=t.trim();n&&(e.revalidateSource=Bt.get(n.toLowerCase())??n)}],[`repository`,(e,t)=>{e.repo={github:$t(t)}}],[`introduced in`,(e,t)=>{e.commitHash=en(t)}],[`package`,(e,t)=>{e.package=tn(t)}],[`priority`,(e,t)=>{e.priority=/^-?\d+(?:\.\d+)?$/u.test(t)?Number(t):t}]]);function an(e,t,n){let r=rn.get(t.trim().toLowerCase());r&&r(e,n.trim())}var on=/^- \*\*([^*\n]+?):\*\* ?(.*)$/u;function sn(e){let t=e.split(`
|
|
45
|
+
`),n=0,r=()=>{for(;n<t.length&&!t[n].trim();)n++},i=()=>{let e=[];for(let r;(r=on.exec(t[n]??``))!==null;n++)e.push([r[1].trim(),r[2].trim()]);return e};r();let a=i();if(a.length>0)return{title:``,facts:a,rest:t.slice(n).join(`
|
|
46
|
+
`)};let o=[];for(;n<t.length&&t[n].trim();)o.push(t[n++]);return r(),a=i(),a.length===0?{title:``,facts:a,rest:e}:{title:U(o.join(`
|
|
47
|
+
`).trim()),facts:a,rest:t.slice(n).join(`
|
|
48
|
+
`)}}var cn=/^(\d+)\. (.*)$/u;function ln(e){let t=[],n=x(e),r=0;for(let i of e.split(`
|
|
49
|
+
`)){let e=S(n,r)?null:cn.exec(i);r+=i.length+1,e?t.push({ref:e[2].trim(),indent:e[1].length+2,note:[]}):t.length>0&&t.at(-1).note.push(i)}return t.map(e=>un(e))}function un({ref:e,indent:t,note:n}){let r={},i=J(e),a=Vt(e),o=a===null?q(i?i.label:e):null;o!==null&&Object.assign(r,Ht(o));let s=i?i.url:a;L(s)&&(r.url=s);let c=U(n.map(e=>e.slice(Math.min(t,/^ */u.exec(e)[0].length))).join(`
|
|
50
|
+
`).trim());return c&&(r.text=c),r}var dn=new Map(Et.map(([e,t])=>[e.toLowerCase(),t])),fn=[...dn.keys()];function pn(e){let t=e.length,n=1/0;for(let r=e.length-1;r>=0;r--){let i=fn.indexOf(e[r].label.toLowerCase());if(i===-1||i>=n)break;n=i,t=r}return{paragraphs:e.slice(0,t),fields:e.slice(t).map(e=>[dn.get(e.label.toLowerCase()),e.body])}}function mn(e,t,n){let r=[],i=P(t),a=e.endsWith(`…`)?e.slice(0,-1).trimEnd():``;!e||i===e||a&&i.startsWith(a)?r.push(t):r.push(e,t);for(let{label:e,body:t}of n)r.push(t?`**${e}:** ${t}`:`**${e}:**`);return r.filter(Boolean).join(`
|
|
51
|
+
|
|
52
|
+
`)}var hn=/^<!--\s*DeepView findings export\b[^>]*-->/u,gn=/^Case \d+ of \d+(?:\s|$)/u,_n=/^- \*\*([^*\n]+?):\*\* ?(.*)$/gmu,vn=new Set([`evidence`,`severity correction`,`comment`]);function yn(e){let t=C(e).trim();if(!hn.test(t))return null;let{head:n,subs:r}=E(t,oe),i=[];for(let{heading:e,body:t}of r){if(e.trim().toLowerCase()===`summary`)continue;let n=bn(e);for(let e of D(t,se))i.push(Sn(e,n))}return Tn(xn(n),i)}function bn(e){let t=/^(.*?)\s*\(\d+\)\s*$/u.exec(e.trim());return Wt(t?t[1]:e)}function xn(e){let t=new Map;for(let n of e.matchAll(_n)){let e=n[1].trim().toLowerCase();t.has(e)||t.set(e,n[2].trim())}return{sources:(t.get(`source`)??``).split(`,`).map(e=>Qt(e).source).filter(Boolean),analyzers:(t.get(`analyzer`)??t.get(`analyzers`)??``).split(`;`).map(e=>e.trim()).filter(Boolean),repo:t.has(`repository`)?$t(t.get(`repository`)):``}}function Sn({heading:e,body:t},n){let r=e.trim().replace(/^\d+\.\s+/u,``),i=D(t,w).filter(e=>gn.test(e.heading.trim()));return i.length===0?[Cn(t,w,r,n)]:i.map(e=>Cn(e.body,ce,r,n))}function Cn(e,t,n,r){let{title:i,facts:a,rest:o}=sn(e),{head:s,subs:l}=E(o,t),u=l.map(e=>({label:e.heading.trim(),body:e.body.trim()})),d={file:`unknown`,line:`?`},f=null;for(let[e,t]of a)e.trim().toLowerCase()===`analyzer`?f=Qt(t):an(d,e,t);d.severity||=r||`medium`;let p=i||n,m=p!==`Untitled finding`&&p!==I(d),{paragraphs:h,fields:g}=pn(u.filter(e=>!vn.has(e.label.toLowerCase())).map(e=>({label:e.label,body:U(e.body)})));d.description=mn(m?p:``,U(s.trim()),h);let _=u.filter(e=>e.label.toLowerCase()===`evidence`).flatMap(e=>ln(e.body));_.length>0&&(d.evidence=_);for(let[e,t]of g)d[e]=t;let v=u.find(e=>e.label.toLowerCase()===`severity correction`);return v?.body&&(d.correctedSeverityReason=U(v.body)),{finding:c(d),analyzer:f}}function wn(e,t){let n={source:null,run:{}};if(t.some(e=>e.analyzer!==null)){let e=new Set(t.map(e=>e.analyzer?.source??null));e.size===1&&!e.has(null)&&([n.source]=e);for(let e of t)e.analyzer?.run?Object.assign(e.finding,e.analyzer.run):e.analyzer?.source&&!n.source&&(e.finding.source=e.analyzer.source);return n}let r=e.analyzers.length===1?Qt(e.analyzers[0]):null;return r?.source?n.source=r.source:r?.run?n.run=r.run:e.analyzers.length===0&&e.sources.length===1&&([n.source]=e.sources),n}function Tn(e,t){let n=t.flat(),{source:r,run:i}=wn(e,n),a={},o=new Set(n.map(e=>e.finding.type).filter(Boolean)),s=i.type??(o.size===1?[...o][0]:null)??(r?`security`:null);s&&(a.type=s),r&&(a.source=r);for(let e of[`model`,`effort`,`exportsMode`])i[e]&&(a[e]=i[e]);e.repo&&(a.repo={github:e.repo});let c=t.map(e=>e.map(e=>e.finding));return c.every(e=>e.length===1)?a.findings=c.flat():a.groups=c,a}var En=`markdown-generic`,Dn=[`#`,`id`,`product`,`priority`,`vulnerability`],On=[`title`,`description`,`root cause`,`code references`,`attack scenario`,`steps to reproduce`,`impact`,`patch`],kn=/^(?:#{3,6}[ \t]+)?(?:\*\*)?(Title|Description|Root Cause|Code references|Attack Scenario|Steps to Reproduce(?:[ \t]+.*?)?|Impact|Patch):?(?:\*\*)?(?:[ \t]+#+)?[ \t]*$/gimu,An={P0:`critical`,P1:`high`,P2:`medium`,P3:`low`,P4:`informational`},Y=e=>e.trim().slice(1,-1).split(`|`).map(e=>e.trim());function X(e,t){if(!e)throw Error(`Markdown (generic): unsupported ${t}`)}function jn(e){return[...new Set(e.split(`
|
|
53
|
+
`).map(e=>e.trim()).filter(Boolean))].map(e=>{X(/^https?:\/\/[^\s()[\]{}"'<>`\\]+$/iu.test(e)&&!/[.,;!?]$/u.test(e),`link syntax; use bare URLs on separate lines`);let t;try{t=new URL(e)}catch{X(!1,`URL`)}let[n,r,i,a,...o]=t.pathname.slice(1).split(`/`);X([`github.com`,`www.github.com`].includes(t.hostname)&&!t.username&&!t.password&&!t.port&&[n,r].every(e=>e&&/^[\w-][\w.-]*$/u.test(e)),`repository URL`),X(o.every(Boolean),`repository path; empty components`);let s=`${n}/${r.replace(/\.git$/iu,``)}`.toLowerCase(),c=/^#L(\d+)(?:-L?(\d+))?$/u.exec(t.hash),l=i===`blob`?o.slice(0,-1):i===`tree`?o:[];try{l=l.map(decodeURIComponent)}catch{X(!1,`repository directory encoding`)}return X(l.every(e=>e===e.trim()&&!/[\\/:?#\p{Cc}]/u.test(e)),`repository directory`),{repo:s,ref:a,directory:l,...i===`blob`&&o.length&&{evidence:{file:o.join(`/`),line:c?c.slice(1).filter(Boolean).join(`-`):`?`,url:e}}}})}function Mn(e,t,n,r){let i=jn(n),a=i[0]?.repo;X(a&&i.every(e=>e.repo===a),`repository set for finding ${e.id}; expected exactly one repository`),X(!e.group.github||e.group.github===a,`repository set for product ${e.product}; expected exactly one repository`);let o=r.get(a);X(o===void 0||o===e.prefix,`repository ID prefixes for ${a}; expected ${o}, got ${e.prefix} (${e.id})`),r.set(a,e.prefix),e.group.github=a,e.group.directories.push(...i.map(e=>e.directory));let s=i.flatMap(e=>e.evidence??[]);if(s.length){Object.assign(t,{file:s[0].file,line:s[0].line,location:s[0].url,evidence:s});let e=i.filter(e=>e.evidence).map(e=>e.ref.toLowerCase()),n=e.reduce((e,t)=>t.length>e.length?t:e);e.every(e=>T(e)&&n.startsWith(e))&&(t.auditedCommit=n)}}function Nn(e){let t=e[0];for(let n of e.slice(1)){let e=0;for(;e<t.length&&t[e]===n[e];)e++;t=t.slice(0,e)}return t.join(`/`)}function Pn(e){let t=C(e).trim(),n=[...t.matchAll(/^## +(.*)$/gmu)];if(!n.some(e=>/^\d+\.\s+\S+/u.test(e[1]))&&(n.length||t.startsWith(`# `)))return null;let r=[...t.matchAll(/^\|[^\n]*\|$/gmu)].find(([e])=>Y(e).map(e=>e.toLowerCase()).join()===Dn.join());if(!r)return null;let i=t.slice(0,r.index).trim();X(!i||/^# [^\n]+$/u.test(i),`summary preamble`),X(r.index<(n[0]?.index??t.length),`summary position`);let a=t.slice(r.index,n[0]?.index).trim().split(`
|
|
54
|
+
`),o=new Set(Y(a[0]).map(e=>e.toLowerCase()));X(a[1]&&Y(a[1]).length===5&&Y(a[1]).every(e=>/^:?-{3,}:?$/u.test(e)),`summary separator`);let s=new Map,c=new Map,l=new Map;for(let e of a.slice(2).filter(e=>e.trim())){X(/^\|.*\|$/u.test(e)&&Y(e).length===5,`summary row`);let[t,n,r,i]=Y(e),a=/^(.+-)\d+$/u.exec(n)?.[1];X(/^\d+$/u.test(t)&&a&&r&&Object.hasOwn(An,i)&&!l.has(n),`summary values for ${n}`);let o=s.get(r)??{directories:[],rows:[]},c={raw:e,id:n,prefix:a,product:r,priority:i,group:o};l.set(n,c),o.rows.push(c),s.set(r,o)}X(l.size,`empty summary`);for(let[e,r]of n.entries()){let i=/^\d+\.\s+(\S+)\s*$/u.exec(r[1])?.[1],a=l.get(i);X(a&&!a.finding,`finding section ${r[1]}`);let s=t.slice(r.index,n[e+1]?.index),u=s.slice(r[0].length+1),d=new Map,f=[...u.matchAll(kn)];for(let[e,t]of f.entries()){let n=t[1],r=n.toLowerCase().replace(/^steps to reproduce\b.*$/u,`steps to reproduce`);X(!d.has(r),`duplicate section ${n}`),d.set(r,{heading:n,body:u.slice(t.index+t[0].length,f[e+1]?.index).trim()})}X(On.every(e=>d.has(e)),`missing required headers for ${i}`),X(!u.slice(0,f[0].index).trim(),`text before field headers for ${i}`);let p=d.get(`title`)?.body;X(p,`missing Title for ${i}`);let m={sourceId:i,_idBasis:{source:En,row:a.raw.trim(),section:s.trim()},product:a.product,priority:a.priority,severity:An[a.priority],file:`unknown`,line:`?`};o.has(`vulnerability`)&&(m.security=!0);let h=[p];for(let[e,t]of d)e===`title`||e===`code references`||(e===`steps to reproduce`?m.reproduction=t.body:e===`patch`?m.recommendation=t.body:h.push(e===`description`?t.body:`**${t.heading}:**
|
|
55
|
+
${t.body}`));m.description=h.join(`
|
|
56
|
+
|
|
57
|
+
`),Mn(a,m,d.get(`code references`).body,c),a.finding=m}return X([...l.values()].every(e=>e.finding),`missing finding sections`),[...s].map(([e,t])=>({displayName:e,data:{type:`security`,source:En,product:e,repo:{github:t.github,directory:Nn(t.directories)},findings:t.rows.map(({finding:e})=>({...e,repo:{github:t.github}}))}}))}function Fn(e){let t=Pn(e);return t===null?null:t.length===1?t[0].data:{type:`security`,source:En,findings:t.flatMap(({data:e})=>e.findings)}}var In=new Set([`critical`,`high`,`medium`,`low`,`high_bug`,`bug`,`informational`]);function Ln(e){let t=Rn(e);if(!t)return null;let{severity:n,description:r,location:i,file:a,line:o}=t;return i?{severity:n,description:r,location:i}:{severity:n,description:r,file:a,line:o}}function Rn(e){let t=e.indexOf(`
|
|
58
|
+
`),n=(t===-1?e:e.slice(0,t)).trim();if(!n)return null;let{sectionsText:r,metaText:i}=zn(t===-1?``:e.slice(t+1)),a=Bn(r),o=Vn(i),{file:s,line:c,locationLink:l}=Hn(a.location||``),u=(o.severity||``).toLowerCase();return{severity:In.has(u)?u:`medium`,description:Un(n,a),location:l,file:s||`unknown`,line:c}}function zn(e){let t=/^---\s*$/mu,n=t.exec(e);if(!n)return{sectionsText:e,metaText:``};let r=e.slice(0,n.index).trim(),i=e.slice(n.index+n[0].length).replace(/^\n/u,``),a=t.exec(i);return{sectionsText:r,metaText:a?i.slice(0,a.index):i}}function Bn(e){let t={},n=e.split(/^## /mu);for(let e=1;e<n.length;e++){let r=n[e],i=r.indexOf(`
|
|
59
|
+
`),a=(i===-1?r:r.slice(0,i)).trim().toLowerCase(),o=(i===-1?``:r.slice(i+1)).trim();a&&(t[a]=o)}return t}function Vn(e){let t={};for(let n of e.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu))t[n[1].trim().toLowerCase()]=n[2].trim();return t}function Hn(e){let t=``,n=`?`,r=``,i=e.match(/\[([^\]]+)\]\(([^)]+)\)/u);if(i){t=i[1].trim(),r=i[2];let e=i[2].match(/#L(\d+)/u);e&&(n=e[1])}else t=e.trim(),r=e.trim();let a=t.match(/^(.+):(\d+)$/u);return a&&(t=a[1],n===`?`&&(n=a[2])),{file:t,line:n,locationLink:r}}function Un(e,t){let n=[e];return t.details&&n.push(t.details),t.impact&&n.push(`Impact: ${t.impact}`),t[`reproduction steps`]&&n.push(`Reproduction: ${t[`reproduction steps`]}`),Wn(n.join(`
|
|
60
|
+
|
|
61
|
+
`))}function Wn(e){return e.replaceAll(`**`,``)}var Gn=new Set([...j,`informative`]);function Kn(e){let t=C(e).trim();if(!t.startsWith(`# `))return null;let n=de(t,/^# /gmu).slice(1).filter(e=>e.trim().length>0).map(e=>qn(e)).filter(Boolean);return n.length===0?null:{type:`security`,source:`claude-security`,findings:n}}function qn(e){let{title:t,body:n}=O(e);if(!t)return null;let{sectionsText:r,metaText:i}=Jn(n),a=Yn(r),o=Object.fromEntries([...i.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu)].map(e=>[e[1].trim().toLowerCase(),e[2].trim()])),s=nr(a.evidence||``),{file:l,line:u,locationLink:d}=Xn(a.location||s[0]?.ref||``),f=(o.severity||``).toLowerCase(),p=Gn.has(f)?f:`medium`,m=ir(t,a,s.length>0),h={file:l||`unknown`,line:u,severity:p,description:m};d&&(h.location=d),s.length>0&&(h.evidence=s.map(rr)),a[`reproduction steps`]&&(h.reproduction=Zn(a[`reproduction steps`])),a[`recommended fix`]&&(h.recommendation=a[`recommended fix`]),o.repository&&(h.repo={github:o.repository}),o.branch&&(h.branch=o.branch),o[`date created`]&&(h.dateCreated=o[`date created`]),o.status&&(h.status=o.status),o.category&&(h.category=o.category);let g=e.indexOf(`
|
|
62
|
+
# `),_=Ln(g===-1?e:e.slice(0,g+1));return _&&(h._idBasis=_),c(h)}function Jn(e){let t=/^---\s*$/mu,n=t.exec(e);if(!n)return{sectionsText:e,metaText:``};let r=e.slice(0,n.index).trim(),i=e.slice(n.index+n[0].length).replace(/^\n/u,``),a=t.exec(i);return{sectionsText:r,metaText:a?i.slice(0,a.index):i}}function Yn(e){let t=e.split(/^## /mu).slice(1).map(e=>O(e));return Object.fromEntries(t.filter(e=>e.title).map(e=>[e.title.toLowerCase(),e.body.trim()]))}function Xn(e){let t=``,n=`?`,r=``,i=k(e);if(i){t=i.label.trim(),r=i.url.trim();let e=r.match(/#L(\d+)(?:-L?(\d+))?/u);e&&(n=e[2]?`${e[1]}-${e[2]}`:e[1])}else t=e.trim(),r=e.trim();t=we(t.replaceAll("`",``)).trim();let a=t.match(/^(.+):(\d+)(?:\s*[-\u2013\u2014]\s*L?(\d+))?$/u);return a&&(t=a[1],n===`?`&&(n=a[3]?`${a[2]}-${a[3]}`:a[2])),{file:t,line:n,locationLink:r,linked:i!==null}}function Zn(e){let t=e.split(`
|
|
63
|
+
`),n=t.findIndex(e=>e.trim());if(n===-1||!v.test(t[n])||t.some((e,t)=>t!==n&&v.test(e)))return e;let r=t[n].replace(/^ */u,``),i=r.replace(v,``);if(!i.trim())return e;let a=er(i)??er(r);if(a===null&&(v.test(i)||$n.test(r)))return e;let o=a===null?[i]:a.length===1?[a[0].step]:a.map(({number:e,step:t})=>`${e}. ${t}`);return t.splice(n,1,...o),t.join(`
|
|
64
|
+
`)}var Qn=/(?:^|[ \t])(\d{1,9})\)(?=[ \t]|$)/gu,$n=/^\d{1,9}\)(?=[ \t]|$)/u;function er(e){let t=[...e.matchAll(Qn)];if(t.length===0||t[0].index!==0)return null;let n=[];for(let[r,i]of t.entries()){let a=Number(i[1]);if(r>0&&a<=n[r-1].number)return null;let o=e.slice(i.index+i[0].length,t[r+1]?.index).trim();if(!o)return null;n.push({number:a,step:o})}return n}var tr=/^[ \t]*(?:\d+[.)]|[-*+])\s+/u;function nr(e){let t=[];for(let n of e.split(`
|
|
65
|
+
`))tr.test(n)?t.push({ref:n.replace(tr,``).trim(),note:[]}):t.length>0&&n.trim()&&t.at(-1).note.push(n.trim());if(t.length===0){let n=e.split(`
|
|
66
|
+
`).map(e=>e.trim()).filter(Boolean),r=n.findIndex(e=>k(e)!==null);if(r===-1&&n.length!==1)return[];let i=r===-1?0:r;t.push({ref:n[i],note:n.filter((e,t)=>t!==i)})}return t.filter(e=>e.ref)}function rr({ref:e,note:t}){let{file:n,line:r,locationLink:i,linked:a}=Xn(e),o={file:n||`unknown`,line:r};i&&a&&(o.url=i);let s=t.join(`
|
|
67
|
+
`);return s&&(o.text=s),o}function ir(e,t,n){let r=[e];return t.details&&r.push(t.details),t.evidence&&!n&&r.push(`**Evidence:**
|
|
68
|
+
${t.evidence}`),t.impact&&r.push(`**Impact:** ${t.impact}`),r.join(`
|
|
69
|
+
|
|
70
|
+
`)}function ar(e){let t=(e||``).trim(),n=``,r=/\[([^\]]+)\]\(([^)]+)\)/u.exec(t);r&&(t=r[1].trim(),n=r[2].trim());let i=``,a=/#L(\d+)/u.exec(n);a&&(i=a[1]);let o=[...t.matchAll(/`([^`]+)`/gu)].map(e=>e[1].trim()).find(e=>!e.includes(`(`)&&(e.includes(`/`)||/\.\w/u.test(e)))??(t.replaceAll("`",``).trim().split(/[\s,]+/u).find(Boolean)||``),s=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(o);s&&(o=s[1],i||=s[2]);let c=/^(.+):(\d+(?:-\d+)?)$/u.exec(o);return c?(i||=c[2],{file:c[1],line:i,locationLink:n}):{file:o,line:i||`?`,locationLink:n}}function or({severity:e,description:t,ref:n,lineBullet:r=``,id:i=``}){let a=ar(n),o=a.file||`unknown`,s=a.line===`?`&&r?r:a.line,c=a.locationLink||(o===`unknown`&&i?`piolium:${i}`:``);return c?{severity:e,description:t,location:c}:{severity:e,description:t,file:o,line:s}}function Z(e){let t=((e||``).trim().split(/\s+/u)[0]||``).replaceAll(/[`*]+/gu,``);return o.get(t.toUpperCase())??``}function sr(...e){return{severity:e.find(Boolean)||`medium`,identitySeverity:e.find(e=>e&&e!==`informative`)||`medium`}}function cr(e){let t=/^([CHML])-?\d+$/iu.exec((e||``).trim());return t?{C:`critical`,H:`high`,M:`medium`,L:`low`}[t[1].toUpperCase()]:``}function lr(e){return Z(/^(critical|high|medium|low|informational|informative|info)(?:[ -](?:severity|risk))?(?:[ -]findings?)?(?:\s*\(\d+\))?$/iu.exec((e||``).trim())?.[1])}function ur(e){return Z(/^(critical|high|medium|low|informational|informative|info)\b/iu.exec((e||``).trim())?.[1])}function dr(e){return/^variants?\s*(?:\(\d+\))?\s*:?$/iu.test((e||``).trim())}function fr(e){let t=/^([CHML]-?\d{1,4}|(?:p|q|b|r|m|l|x|diff)\d{0,4}-\d{2,4})(?:-([A-Za-z0-9][\w-]*))?$/iu.exec(e||``);return t?{id:t[1].toUpperCase(),slug:t[2]||``}:null}function pr(e){return(e||``).replaceAll(`-`,` `)}function mr(e){let t=(e||``).trim(),n=/^\[([^\]]+)\]\([^)]*\)$/u.exec(t);return Te(n?n[1]:t).toUpperCase()}function hr(e){let t=/^\[([^\]]+)\]\(([^)]+)\)\s*[:\u2014\u2013-]*\s*(.*)$/u.exec(e);return t?{text:t[3]?`${t[1].trim()} ${t[3].trim()}`:t[1].trim(),link:t[2].trim()}:null}function gr(e){let t=e.search(/\s/u),n=fr((t===-1?e:e.slice(0,t)).replace(/[:.,\u2014\u2013-]+$/u,``));if(!n)return null;let r=(t===-1?``:e.slice(t+1)).replace(/^[:\u2014\u2013-]+\s*/u,``).trim();return{id:n.id,slug:n.slug,rest:r}}function _r(e){let{text:t,link:n}=hr(e)??{text:e,link:``},r=/^\[([^\]]+)\] *(.*)$/u.exec(t);if(r){let e=fr(r[1].trim());return e?{id:e.id,title:r[2].trim()||pr(e.slug)||e.id,link:n}:{id:r[1].trim().toUpperCase(),title:r[2].trim(),link:n}}let i=gr(t);return i?{id:i.id,title:i.rest||pr(i.slug)||i.id,link:n}:{id:``,title:t.trim(),link:n}}function vr(e){let t={},n=t=>{let n=t.exec(e||``)?.[1];return n===void 0?``:(/`([^`]+)`/u.exec(n)?.[1]??n.split(/\s+/u)[0]??``).trim()},r=n(/^\s*(?:[-*] +)?\*\*Target:?\*\*\s*(.*)$/imu);at(r)&&(t.repo=r);let i=n(/^\s*(?:[-*] +)?\*\*Commit[^:*]*:?\*\*\s*(.*)$/imu);return T(i)&&(t.commitHash=i),t}var yr=[`key code reference`,`key code`,`code reference`,`location`,`affected file`,`file`,`path`];function br(e){return{id:mr(e.id||``),title:A(e.title),severity:A(e.severity),pocStatus:A(e[`poc status`]||e.poc),status:A(e.status),parent:mr(A(e.parent||``)),location:A(e.location)}}function xr(e,t=``){let{severity:n,identitySeverity:r}=sr(Z(e.severity),t,cr(e.id)),i=Sr({ref:e.location||``,id:e.id,severity:n,identitySeverity:r,description:he(e.title||e.id)});for(let t of[`pocStatus`,`status`,`parent`])e[t]&&(i[t]=e[t]);return c(i)}function Sr({ref:e,lineBullet:t=``,id:n,severity:r,identitySeverity:i,description:a}){let{file:o,line:s,locationLink:c}=me(e),l={file:o||`unknown`,line:s===`?`&&t?t:s,severity:r,description:a};return c?l.location=c:l.file===`unknown`&&n&&(l.location=`piolium:${n}`),l._idBasis=or({severity:i,description:a,ref:e,lineBullet:t,id:n}),l}function Cr(e,t,n){let r=[];for(let i of e.split(`
|
|
71
|
+
`)){let e=/^\s{0,3}(?:[-*+]|\d{1,3}[.)])\s+(.+)$/u.exec(i);if(!e)continue;let a=e[1].trim();if(/^\*\*[^:*]+:\*\*/u.test(a))continue;let o=hr(a),s=o?.link??``;if(o)a=o.text;else{let e=/^\*\*([^*]+)\*\*\s*[:\u2014\u2013-]*\s*(.*)$/u.exec(a);e&&(a=e[2]?`${e[1].trim()} ${e[2].trim()}`:e[1].trim())}if(/^(?:none\b|no |n\/a\b)/iu.test(a))continue;let l=gr(a),u=l?.id??``,d=a;if(l){let e=pr(l.slug);d=e&&l.rest?`${e}
|
|
72
|
+
|
|
73
|
+
${l.rest}`:l.rest||e||l.id}let f=n.get(u),{severity:p,identitySeverity:m}=sr(Z(f?.severity),t,cr(u)),h={file:`unknown`,line:`?`,severity:p,description:he(d)};u?h.location=`piolium:${u}`:s&&(h.location=s),s.endsWith(`report.md`)&&(h.reportPath=s);for(let e of[`pocStatus`,`status`,`parent`])f?.[e]&&(h[e]=f[e]);r.push({id:u,finding:c(h,m)})}return r}function wr(e,t,n,r=``){let i=[];for(let a of fe(e)){let e=br(a);!e.id&&!e.title||(!e.parent&&n&&(e.parent=n),e.id&&!t.has(e.id)&&t.set(e.id,e),i.push({id:e.id,finding:xr(e,r)}))}if(i.length>0)return i;let a=Cr(e,r,t);for(let e of a)n&&!e.finding.parent&&(e.finding.parent=n);return a}var Tr=new Set([`technical findings detail`,`technical findings`,`detailed findings`,`findings detail`,`findings`]),Er=/^(?:summary of findings\b|deferred|methodolog|executive|conclusion|attack surface|coverage|discoveries|scope\b|table of contents|contents\b|appendix|recommendation|remediation)/u;function Dr(e){let{id:t}=_r(e);return!!(t&&fr(t))}function Or(e){let t=D(e,se);return(t.length>0?t:D(e,w)).some(({heading:e})=>Dr(e))}function kr(e){let t=C(e).trim();if(!/^# +Security Audit Report\b/mu.test(t)&&!/^## +Technical Findings Detail\s*$/imu.test(t)&&!/^## +Findings by Severity\b/imu.test(t))return null;let{head:n,subs:r}=E(t,oe),i=Ir(r),a=new Map(fe(i[`summary of findings`]||``).map(br).filter(e=>e.id).map(e=>[e.id,e])),o=vr(n),s=[],c=new Set,l=[],u=({id:e,finding:t})=>{s.push(t),e&&c.add(e)},d=e=>{for(let t of e)u(t)};for(let[e,t]of Object.entries(i)){let n=lr(e);n||Tr.has(e)||e.startsWith(`findings by severity`)?d(Pr(t,n,a,l)):!Er.test(e)&&Or(t)&&d(Pr(t,ur(e),a,l))}for(let e of l)e.id&&c.has(e.id)||u(e);for(let e of a.values())c.has(e.id)||u({id:e.id,finding:xr(e)});if(s.length===0)return null;for(let e of s)o.repo&&(e.repo={github:o.repo}),o.commitHash&&!e.auditedCommit&&(e.auditedCommit=o.commitHash);return{type:`security`,source:`piolium`,findings:s}}function Ar(e,t,n,r){let i=[],a=``;for(let{heading:o,body:s}of e){let e=lr(o);if(e)i.push(...Pr(s,e,t,n)),a=``;else if(dr(o))i.push(...Mr(s,t,a,n,r));else{let e=jr(o,s,t,n,r);i.push(...e),a=e[0]?.id||a}}return i}function jr(e,t,n,r,i){let{head:a,subs:o}=E(t,w),s=Fr(e,a,n,i),c=s!==null&&!s.id&&o.some(e=>!dr(e.heading)&&Dr(e.heading)),l=s&&!c?[s]:[];return l.push(...Nr(o,n,r,i,s?.id||``)),l}function Mr(e,t,n,r,i){let{head:a,subs:o}=E(e,w);return r.push(...wr(a,t,n,i)),Nr(o,t,r,i,``)}function Nr(e,t,n,r,i){let a=[],o=``;for(let{heading:s,body:c}of e){if(dr(s)){n.push(...wr(c,t,i??o,r));continue}let e=Fr(s,c,t,r);e&&(a.push(e),o=e.id||o)}return a}function Pr(e,t,n,r){let i=D(e,se);if(i.length>0)return Ar(i,n,r,t);let a=Nr(D(e,w),n,r,t,null);if(a.length>0)return a;let o=fe(e).map(br).filter(e=>e.id||e.title);for(let e of o)!e.severity&&t&&(e.severity=t),e.id&&!n.has(e.id)?n.set(e.id,e):e.id||r.push({id:``,finding:xr(e,t)});return o.length===0&&r.push(...Cr(e,t,n)),[]}function Fr(e,t,n,r=``){let i=e.trim();if(!i)return null;let{id:a,title:o,link:s}=_r(i),l=n.get(a);if(!a&&o){let e=o.toLowerCase();l=[...n.values()].find(t=>t.title.toLowerCase()===e),a=l?.id??``}let{fields:u,labels:d,prose:f}=pe(t),{severity:p,identitySeverity:m}=sr(Z(u.severity),Z(l?.severity),r,cr(a)),h=/\d+/u.exec(u.line||u.lines||``)?.[0]??``,g=/\*\*Variant of:?\*\*\s*\[?([^\]\s)]+)/iu.exec(t),_=f.split(`
|
|
74
|
+
`).filter(e=>!/^\s*<a\s[^>]*>\s*<\/a>\s*$/iu.test(e)&&!/\*\*Variant of:?\*\*/iu.test(e)).join(`
|
|
75
|
+
`).trim(),v=Sr({ref:yr.map(e=>u[e]).find(Boolean)??``,lineBullet:h,id:a,severity:p,identitySeverity:m,description:Rr(o||a,u,d,_)}),ee=u[`poc status`]||u.poc||l?.pocStatus;ee&&(v.pocStatus=ee);let y=u[`detailed report`]||(s.endsWith(`report.md`)?s:``);y&&(v.reportPath=y),l?.status&&(v.status=l.status);let te=l?.parent||(g?mr(g[1]):``);return te&&(v.parent=te),{id:a,finding:c(v)}}function Ir(e){let t=Object.create(null);for(let{heading:n,body:r}of e){let e=n.trim().toLowerCase();e&&(t[e]=e in t?`${t[e]}
|
|
76
|
+
${r}`:r)}return t}var Lr=new Set([...yr,`severity`,`summary`,`files`,`poc`,`poc status`,`line`,`lines`,`detailed report`,`proof of concept`,`evidence`,`variant of`,`pattern`,`status`,`id`,`title`]);function Rr(e,t,n,r){let i=[e];t.summary&&i.push(t.summary),r&&i.push(r);for(let[e,r]of Object.entries(t))!r||Lr.has(e)||i.push(`**${n[e]||e}:** ${r}`);return i.filter(Boolean).join(`
|
|
77
|
+
|
|
78
|
+
`)}var zr=`<!-- DeepView findings export -->`,Br={annotation:()=>null,location:e=>typeof e?.location==`string`?e.location:null,evidence:e=>typeof e?.url==`string`?e.url:null,commit:()=>null,report:()=>null};function Vr(e,t){let n=e=>typeof e?.source==`string`&&e.source?e.source:null;if(e.length===1)return t=>n(t)??e[0].source??null;let r=new Map(e.map(e=>[e.name,e.source??null]));return e=>n(e)??r.get(t.report(e))??null}function Hr(e,t,n){let r=e.view?.revalidation!==!1,i=(Array.isArray(e.reports)?e.reports:[]).filter(e=>e&&typeof e==`object`),a=Vr(i,t),o=e=>Tt(e,a(e),r),s=new Set(n.map(o)),c=new Set(n.map(e=>t.report(e)).filter(Boolean));return{hooks:t,analyzerOf:o,severityMode:e.view?.severityMode===`original`?`original`:`corrected`,revalidation:r,showAnalyzer:s.size>1,showReport:c.size>1||i.length>1,repo:typeof e.repo==`string`&&e.repo?e.repo:null}}function Ur(e){if(!e)return``;let t=[e.bucket?`${e.bucket} findings`:`Live findings`];return e.severityMode===`original`?t.push(`original analyzer severities`):e.severityMode===`corrected`&&t.push(`corrected severities`),e.revalidation===!1?t.push(`code view — the revalidation pass is not applied`):e.revalidation===!0&&(e.revalidationDetail===!0?t.push(`detailed app view — the revalidation pass is applied, with the rows it re-rated`):e.revalidationDetail===!1?t.push(`app view — the revalidation pass is applied, standing in for the rows it re-rated`):t.push(`app view — the revalidation pass is applied`)),t.join(` · `)}function Wr(e){if(!e)return``;let t=Number(e.included)||0,n=Number(e.total)||0;return n===0?`no findings`:t>=n?`all ${V(n,`finding`)}`:`${t} of ${V(n,`finding`)} (${n-t} filtered out)`}function Gr(e,t,n){let r=[],i=(e,t)=>{t&&r.push(`- **${e}:** ${t}`)},a=Array.isArray(e.reports)?e.reports:[],o=[...new Set(a.map(e=>f[e?.source]??``).filter(Boolean))];i(`Source`,o.join(`, `));let s=a.map(e=>e?.name).filter(Boolean);i(s.length===1?`Report`:`Reports`,s.map(e=>R(e)).join(`, `)),i(`Workspace`,typeof e.workspace==`string`?e.workspace.trim():``),t.repo&&i(`Repository`,wt(t.repo));let c=[...new Set(n.map(t.analyzerOf).filter(Boolean))],l=c.length===o.length&&c.every(e=>o.includes(e));return c.length>0&&!l&&i(c.length===1?`Analyzer`:`Analyzers`,c.join(`; `)),e.generatedAt&&i(`Exported`,Xe(e.generatedAt)),i(`View`,Ur(e.view)),Array.isArray(e.filters)&&i(`Filters`,e.filters.length>0?e.filters.map(e=>`${e.label}: ${e.value}`).join(` · `):`none`),i(`Included`,Wr(e.counts)),r.join(`
|
|
79
|
+
`)}function Kr(e,t){let n=Map.groupBy(e,e=>Ae(e[0],t.severityMode)??`informational`),r=[...j,...[...n.keys()].filter(e=>!j.includes(e))],i=new Set,a=[];for(let e of r)for(let t of n.get(e)??[]){let n=a.length+1,r=Ct(t[0]),o=`${n}. ${r}`;a.push({group:t,number:n,severity:e,title:r,headingText:o,slug:Je(o,i)})}return a}function qr(e){let t=new Map;for(let n of e)t.set(n.severity,(t.get(n.severity)??0)+1);return t}var Jr=[[`flagged`,e=>e.flagged===!0],[`colour-marked`,e=>e.color],[`commented`,e=>e.comment],[`with a fix link`,e=>e.fix]];function Yr(e,t){let n=e.flatMap(({group:e})=>e.map(e=>t.hooks.annotation(e))).filter(Boolean),r=Jr.map(([e,t])=>[n.filter(t).length,e]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}`);return r.length>0?`Annotations: ${r.join(`, `)}.`:``}function Xr(e){let t=e.some(({group:e})=>e.some(e=>e.confidence!==void 0&&e.confidence!==null)),n=[`#`,`Severity`,`Finding`,`Location`];return t&&n.push(`Confidence`),Ye(n,e.map(e=>{let n=e.group[0],r=e.group.length>1?` (${V(e.group.length,`case`)})`:``,i=I(n),a=[String(e.number),p(e.severity),z(Ge(Ke(e.title)),`#${e.slug}`)+r,i?Ge(R(i)):``];return t&&a.push(n.confidence===void 0||n.confidence===null?``:`${n.confidence}/10`),a}),[`right`])}function Zr(e,t){let n=[B(2,`Summary`)];if(e.length===0)return[...n,`No findings are included.`];let r=[...qr(e)].map(([e,t])=>[p(e),String(t)]);r.push([`**Total**`,`**${e.length}**`]),n.push(Ye([`Severity`,`Findings`],r,[`left`,`right`]));let i=Yr(e,t);return i&&n.push(i),n.push(Xr(e)),n}function Qr(e,t){let n=qr(e),r=[],i=null;for(let a of e)a.severity!==i&&(i=a.severity,r.push(B(2,`${p(i)} (${n.get(i)})`))),r.push(Rt(a.group,t,{headingText:a.headingText,depth:3}));return r}function $r(e={},t={}){let n=Object.fromEntries(Object.entries(Br).map(([e,n])=>[e,typeof t?.[e]==`function`?t[e]:n])),r=(Array.isArray(e.groups)?e.groups:[]).map(e=>Array.isArray(e)?e:[e]).map(e=>e.filter(e=>e&&typeof e==`object`)).filter(e=>e.length>0),i=r.flat(),a=Hr(e,n,i),o=Kr(r,a);return`${Ze([zr,B(1,typeof e.title==`string`&&e.title.trim()?e.title.trim():`Findings`),Gr(e,a,i),...Zr(o,a),...Qr(o,a)])}
|
|
80
|
+
`}var ei=[[`deepview-md`,yn],[`markdown-generic`,Fn],[`deepsec`,xt],[`piolium`,kr],[`claude-security`,Kn]];function Q(e){return Array.isArray(e?.findings)?e.findings:Array.isArray(e?.groups)?e.groups:null}function ti(e,t){return typeof t==`string`&&/\.csv$/iu.test(t)?`codex`:$(e).format}function $(e){let t;try{let t=JSON.parse(e);if(Q(t)){for(let e of ri(Q(t)))c(e);return{data:t,format:`json`,reason:null}}return{data:null,format:null,reason:`JSON, but not a report: no findings array`}}catch(e){t=e}for(let[t,n]of ei)try{let r=n(e);if(r)return{data:r,format:t,reason:null}}catch(e){if(t!==`markdown-generic`)throw e;return{data:null,format:t,reason:e.message}}return{data:null,format:null,reason:`Not JSON, and not a recognized markdown format. (JSON error: ${t.message})`}}function ni(e){let{data:t}=$(e);return t?{count:Q(t).length,source:t.source,recognized:!0}:{count:0,recognized:!1}}function ri(e){return e.flat().filter(e=>e&&typeof e==`object`)}async function ii(e){for(let t of e)c(t);let t=e.filter(e=>!e.id);if(t.length===0)return;let n=await Promise.all(t.map(i));t.forEach((e,t)=>{n[t]&&(e.id=n[t])})}async function ai(e){let{data:t,format:n}=$(e);if(!t)return null;let r=ri(Q(t));return await ii(r),{format:n,data:t,findings:r}}export{n as a,x as b,S as c,we as d,l as e,u as f,d as g,f as h,Ee as i,j,Oe as k,ke as l,Ae as m,je as n,Me as o,M as p,Pe as q,Ie as r,Le as s,N as t,Re as u,F as v,Be as w,Ve as x,Ue as y,I as z,We as A,L as B,nt as C,ot as D,st as E,Pn as F,dt as G,mt as H,$r as I,Q as J,ti as K,$ as L,ni as M,ii as N,ai as O};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={view:`.bundle-code-view`,pane:`.bundle-code-rail`,property:`--bundle-code-rail-width`,axis:`x`,grow:1,keys:{ArrowLeft:-16,ArrowRight:16},initial:()=>320,bounds:e=>({min:Math.min(180,e*.4),max:e*.6}),preferred:null},t={view:`.bundle-code-main`,pane:`.bundle-code-terminal`,property:`--bundle-code-terminal-height`,axis:`y`,grow:-1,keys:{ArrowUp:16,ArrowDown:-16},initial:e=>e*.4,bounds:e=>({min:Math.min(96,e*.4),max:e*.85}),preferred:null},n=class extends HTMLElement{static split=e;constructor(){super(),this._split=this.constructor.split,this._drag=null,this.addEventListener(`pointerdown`,e=>this._startDrag(e)),this.addEventListener(`pointermove`,e=>{this._drag?.id===e.pointerId&&(this._split.preferred=this._apply(this._drag.size+this._split.grow*(this._client(e)-this._drag.at)))});for(let e of[`pointerup`,`pointercancel`,`lostpointercapture`])this.addEventListener(e,e=>{this._drag?.id===e.pointerId&&this._endDrag()});this.addEventListener(`keydown`,e=>this._onKeyDown(e)),this.addEventListener(`dblclick`,()=>{this._split.preferred=null,this._apply(this._preferred())})}connectedCallback(){this._view=this.closest(this._split.view),this._view&&(this._observer=new ResizeObserver(()=>this._apply(this._preferred())),this._observer.observe(this._view),this._apply(this._preferred()))}disconnectedCallback(){this._observer?.disconnect(),this._endDrag(),this._view=null}_client(e){return this._split.axis===`x`?e.clientX:e.clientY}_measure(e){let t=e.getBoundingClientRect();return this._split.axis===`x`?t.width:t.height}_preferred(){return this._split.preferred??this._split.initial(this._view?this._measure(this._view):0)}_bounds(){return this._split.bounds(this._measure(this._view))}_apply(e){if(!this._view)return e;let{min:t,max:n}=this._bounds();if(n===0)return e;let r=Math.max(t,Math.min(n,e));return this._view.style.setProperty(this._split.property,`${r}px`),this.setAttribute(`aria-valuemin`,String(Math.round(t))),this.setAttribute(`aria-valuemax`,String(Math.round(n))),this.setAttribute(`aria-valuenow`,String(Math.round(r))),this.setAttribute(`aria-valuetext`,`${Math.round(r)} pixels`),r}_paneSize(){return this._measure(this._view.querySelector(this._split.pane))}_startDrag(e){e.button!==0||!e.isPrimary||this._drag||!this._view||(e.preventDefault(),this._drag={id:e.pointerId,at:this._client(e),size:this._paneSize(),view:this.closest(`.bundle-code-view`)},this.setPointerCapture(e.pointerId),this.classList.add(`dragging`),this._drag.view?.classList.add(`splitting`))}_endDrag(){if(!this._drag)return;let{id:e,view:t}=this._drag;this._drag=null,this.classList.remove(`dragging`),t?.classList.remove(`splitting`),this.hasPointerCapture(e)&&this.releasePointerCapture(e)}_onKeyDown(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||!this._view)return;let{min:t,max:n}=this._bounds(),r=this._split.keys[e.key],i=r===void 0?{Home:t,End:n}[e.key]:this._paneSize()+r;i!==void 0&&(e.preventDefault(),e.stopPropagation(),this._split.preferred=this._apply(i))}};customElements.define(`bundle-code-splitter`,n),customElements.define(`bundle-code-terminal-splitter`,class extends n{static split=t});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=`.detail-action{width:22px;height:22px;display:grid;place-items:center;padding:0;background:transparent;border:0;border-radius:var(--ui-radius, 4px);color:var(--muted);font:500 16px/1 ui-monospace,monospace;cursor:default;&:hover{color:var(--accent);background:var(--surface-active)}&:focus-visible{outline:2px solid var(--accent);outline-offset:1px}}
|
|
2
|
+
`;export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as t,c as n,d as r}from"./chunk-K4XJHM2T.js";import{a as i,b as a,c as o,d as s,e as c,f as l,g as u,j as d,l as f,m as p,n as m,p as h}from"./chunk-GX5UXWT4.js";import{A as ee,B as te,H as ne,I as g,M as _,c as re,k as v,l as y,m as b,t as ie,u as ae}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{a as oe,e as x,g as S}from"./chunk-VYYUMYVW.js";import{d as C,e as w,f as se,h as T,i as E}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var D=d(e=>/^[A-Z_a-z][\w-]*$/u.test(e),`a package name`),O=d(e=>t(e)!==void 0,`a version`),ce=d(e=>/^\w[\w+.-]*$/u.test(e),`a feature name`),le=[`branch`,`tag`,`rev`];function k(e){let t=e.hostname===`github.com`,n=new URL(t?`https:${e.href.slice(e.protocol.length)}`:e.href),r=n.pathname.replace(/\/$/u,``);return n.pathname=(t?r.toLowerCase():r).replace(/\.git$/u,``),n.href}var ue=e=>e.href.startsWith(`/`,e.protocol.length);function de(e){let t=URL.parse(e);return t!==null&&t.href===e&&ue(t)?t:void 0}var A=(e,t,n=[])=>JSON.stringify([e,k(t),...n]);function j(e,t,n){let r=n=>w(`${T(e)} is not a source: ${n}`,t),[,i,a]=/^(registry|sparse|git)\+(.*)$/su.exec(e)??r(`expected registry+, sparse+ or git+ and a URL`);if(i!==`git`){i===`registry`&&_(a,t);let n=de(i===`sparse`?e:a);return(n===void 0||n.search!==``||n.hash!==``)&&r(`expected a URL in normal form, without a query or a fragment`),{scheme:i,identity:A(i,n)}}let[,o,s,c]=/^([^#?]*)(?:\?([^#]*))?(?:#(.*))?$/su.exec(a);(n?c!==void 0:!ne(c??``))&&r(n?`a dependency names no commit`:`expected "#" and the commit it resolved to`),_(o,t);let l=de(o)??r(`expected a URL in normal form`),u=[...new URLSearchParams(s??``)];return(u.length>1||u.length===1&&!le.includes(u[0][0]))&&r(`expected at most one of branch=, tag= or rev=`),{scheme:i,identity:A(i,l,u[0])}}var M=new URL(`https://github.com/rust-lang/crates.io-index`),fe=e=>e.registry===void 0||e.registry===`crates-io`,N=`any registry`;function P(e,t){if(e.type===`path`)return t;if(e.type===`git`){let t=le.flatMap(t=>e[t]===void 0?[]:[t,e[t]]);return A(`git`,new URL(e.url),t)}return e.index===void 0?fe(e)?A(`registry`,M):N:A(e.index.startsWith(`sparse+`)?`sparse`:`registry`,new URL(e.index))}var pe=e=>e===`crates-io`?M:URL.parse(e);function F(e){let t=pe(e);return t===null?`registry ${e}`:k(t)}function me(e){return pe(e)?.href??`registry ${e}`}function I(e){if(e.type!==`path`)return e.type===`git`?k(new URL(e.url)):e.index===void 0?fe(e)?k(M):`registry ${e.registry}`:k(new URL(e.index))}var he=[`version`,`package`,`patch`],ge=[`name`,`version`,`source`,`checksum`,`dependencies`],_e=[`name`,`version`,`source`,`checksum`],ve={root:`a [root] table is lockfile version 1, which is not read here`,metadata:`a [metadata] table holds checksums in lockfile version 1 and nothing cargo writes after`},ye={replace:`[replace] is not supported`};function be(e,t){if(e===3||e===4)return e;throw e===void 0?new C("no `version`: this is lockfile version 1 or 2, which is not read here, where 3 and 4 are",t):e===5?new C(`lockfile version 5 is only read by a nightly cargo, with -Znext-lockfile-bump`,t):new C(`unsupported version: expected 3 or 4, found ${i(e)}`,t)}var L=(e,t,n)=>n===void 0?`${e} ${t}`:`${e} ${t} (${n})`;function xe(e,t,n=ge){o(e,t,n,ye);let r=D(e.name,E(t,`name`)),i=O(e.version,E(t,`version`)),a=b(e,`source`,t,l),s=a===void 0?void 0:j(a,E(t,`source`),!1),c=b(e,`checksum`,t,l);if(c!==void 0&&(s===void 0||s.scheme===`git`))throw new C(`a ${s===void 0?`path`:`git`} package has no checksum`,E(t,`checksum`));if(c!==void 0&&!g(c))throw new C(`${T(c)} is not a sha256 checksum`,E(t,`checksum`));if(c===void 0&&s!==void 0&&s.scheme!==`git`&&n===ge)throw new C(`expected a checksum, which cargo checks a registry's package with, and refuses the lockfile without`,t);let u=b(e,`dependencies`,t,p)??[];return{key:L(r,i,a),name:r,version:i,source:a,checksum:c,identity:s?.identity,edges:u}}function Se(e,t,n){let r=n=>w(`${T(e)} ${n}`,t),[,i,a,o]=/^([^ ]+)(?: ([^ ]+)(?: \((.+)\))?)?$/su.exec(e)??r("is not `name`, `name version` or `name version (source)`"),s=n.get(i)??r(`names no package in the lockfile`),c=a===void 0?[...new Set(s.map(e=>e.version))]:[a];c.length>1&&r(`could be any of ${c.length} versions`);let l=s.filter(e=>e.version===c[0]);if(l.length===0&&r(`names a version the lockfile does not hold`),o!==void 0){let e=j(o,t,!0).identity,n=l.filter(t=>t.identity===e);return n.length!==1&&r(`names a source the lockfile does not hold`),n[0]}let u=l.filter(e=>e.source===void 0);return u.length>0||l.length===1?u[0]??l[0]:r(`could be any of ${l.length} sources`)}function Ce(e,t){let n=new Set(e.filter(e=>e.source===void 0));for(let e of n)for(let t of e.resolved)n.add(t);let r=e.find(e=>!n.has(e));if(r!==void 0)throw new C(`nothing in the workspace depends on ${T(r.key)}, directly or not`,t)}function we(e){let t=o(S(e),void 0,he,ve),n=be(t.version,`version`),r=c(t.package??[],`package`).map((e,t)=>xe(e,`package[${t}]`));h(r,e=>`${e.name} ${e.version} ${e.identity}`,e=>e.key);let i=Map.groupBy(r,e=>e.name);for(let[e,t]of r.entries()){let n=E(`package[${e}]`,`dependencies`);t.resolved=t.edges.map((e,t)=>Se(e,`${n}[${t}]`,i));let r=ie(t.resolved);if(r!==void 0)throw new C(`${T(r.key)} is listed twice`,n)}Ce(r,`package`);let a=Object.create(null);for(let e of r)a[e.key]={...R(e),dependencies:e.resolved.map(e=>e.key)};return{version:n,packages:a,unusedPatches:Te(t.patch)}}function Te(e){return e===void 0?[]:(o(e,`patch`,[`unused`]),c(e.unused,`patch.unused`).map((e,t)=>R(xe(e,`patch.unused[${t}]`,_e))))}var R=({name:e,version:t,source:n,checksum:r})=>({name:e,version:t,source:n,checksum:r}),Ee=/[\\/]/u;function z(e,t){let n=t?e.indexOf(`\\`):e.search(Ee);return n===-1?[e,``]:[e.slice(0,n),e.slice(n+1)]}function De(e){let t=e.slice(0,8).replaceAll(`/`,`\\`);if(!t.startsWith(`\\\\`))return/^[A-Za-z]:/u.test(e)?{length:2,verbatim:!1}:void 0;if(t.startsWith(`?\\`,2)&&!e.slice(0,4).includes(`/`)){if(t.startsWith(`UNC\\`,4)){let[t,n]=z(e.slice(8),!0),[r]=z(n,!0);return{length:8+t.length+(r===``?0:1+r.length),verbatim:!0}}return/^[A-Za-z]:(?:[\\/]|$)/u.test(e.slice(4))?{length:6,verbatim:!0}:{length:4+z(e.slice(4),!0)[0].length,verbatim:!0}}if(t.startsWith(`.\\`,2))return{length:4+z(e.slice(4),!1)[0].length,verbatim:!1};let[n,r]=z(e.slice(2),!1),[i]=z(r,!1);return n!==``&&i!==``?{length:3+n.length+i.length,verbatim:!1}:void 0}function Oe(e,t){let n=t?De(e):void 0,r=n?.verbatim===!0,i=e.slice(n?.length??0).replace(t?/^[\\/]/u:/^\//u,``).split(r?`\\`:t?Ee:`/`).findLast(e=>e!==``&&(r||e!==`.`));return i===`..`||i===`.`?void 0:i}var ke=/ *(?:([(),=])|"([^"]*)"|(r#)?([A-Z_a-z]\w*)|(.|$))/gsuy,Ae=64,je=class extends Error{},B=()=>{throw new je};function Me(e){let t=[];for(let[,n,r,i,a,o]of e.matchAll(ke)){if(o===``)break;o!==void 0&&B(),t.push(a===void 0?{punct:n,string:r}:{ident:a,raw:i!==void 0})}return t}function Ne(e){let t=Me(e),n=0,r=()=>t[n],i=e=>{r()?.punct!==e&&B(),n++},a=()=>{let e=t[n++];if(e?.ident===void 0&&B(),r()?.punct!==`=`)return{name:e.ident,key:e.ident};n++;let i=t[n++]?.string;return i===void 0&&B(),{name:e.ident,value:i,key:`${e.ident}="${i}"`}},o=(e=0)=>{let t=r();if(t?.raw===!1&&[`all`,`any`,`not`].includes(t.ident)){e>=Ae&&B(),n++,i(`(`);let a=[];for(;r()?.punct!==`)`&&(a.push(o(e+1)),t.ident!==`not`&&r()?.punct===`,`);)n++;return t.ident===`not`&&a.length===0&&B(),i(`)`),{op:t.ident,list:a}}let{name:s,value:c,key:l}=a();return c===void 0&&(s===`true`||s===`false`)?{op:s,list:[]}:{op:`cfg`,name:s,key:l}};return{expr:o,cfg:a,done:()=>r()===void 0}}function Pe(e,t){try{let n=Ne(e),r=t(n);return n.done()?r:void 0}catch(e){if(e instanceof je)return;throw e}}function V(t){let n=/^cfg\((.*)\)$/su.exec(e(t))?.[1];return n===void 0?/^[\w.-]+$/u.test(t)?{name:t,expr:void 0}:void 0:Pe(n,e=>({name:void 0,expr:e.expr()}))}function Fe(t){return Pe(e(t),e=>e.cfg().key)}var Ie={__proto__:null,all:(e,t)=>Le(e.list,t,!1),any:(e,t)=>Le(e.list,t,!0),not:(e,t)=>{let n=H(e.list[0],t);return n===void 0?void 0:!n},true:()=>!0,false:()=>!1,cfg:(e,t)=>t(e)};function H(e,t){return Ie[e.op](e,t)}function Le(e,t,n){let r=!1;for(let i of e){let e=H(i,t);if(e===n)return n;e===void 0&&(r=!0)}return r?void 0:!n}function Re(e,t){if(e.expr===void 0)return t.name===void 0?void 0:e.name===t.name;let n=e=>t.decides===void 0||t.decides.has(e);return H(e.expr,e=>t.cfg.has(e.key)?!0:!n(e.name)&&void 0)}function ze(e){let t=/^[\\/]{2}([^\\/?.][^\\/]*)[\\/]+([^\\/]+)/u.exec(e);if(t!==null)return{prefix:`//${t[1]}/${t[2]}`.toLowerCase(),rest:`/${e.slice(t[0].length)}`};let n=/^([A-Za-z]):(?=[\\/])/u.exec(e);return n===null?/^(?:[\\/]{2}|[A-Za-z]:)/u.test(e)?void 0:{prefix:void 0,rest:e}:{prefix:n[1].toUpperCase(),rest:e.slice(2)}}function Be(e,t){let n=t?ze(e):{prefix:void 0,rest:e};if(n===void 0)return;let r=[],i=0;for(let e of n.rest.split(t?/[\\/]/u:`/`))e===`..`&&r.length>0?r.pop():e===`..`?i++:e!==``&&e!==`.`&&r.push(e);return{prefix:n.prefix,absolute:t?/^[\\/]/u.test(n.rest):n.rest.startsWith(`/`),up:i,parts:r}}function Ve(e,t){if(e.type!==`path`){let t=P(e,`path`);return{key:t===N?`${t} ${e.registry}`:t}}return{key:`path`,readings:[!1,!0].map(t=>Be(e.path,t)),inherited:t}}var U=(e,t)=>t.length<=e.length&&t.every((n,r)=>n===e[e.length-t.length+r]);function He(e,t,n){if(e.absolute&&t.absolute)return e.prefix!==void 0&&t.prefix!==void 0&&e.prefix!==t.prefix||e.parts.join(`/`)!==t.parts.join(`/`);if(e.absolute||t.absolute)return!U((e.absolute?e:t).parts,(e.absolute?t:e).parts);if(n)return!U(e.parts,t.parts)&&!U(t.parts,e.parts);let[r,i]=e.up>=t.up?[e,t]:[t,e],a=r.parts.length-i.parts.length;return a<0||a>r.up-i.up||!U(r.parts,i.parts)}function Ue(e,t){return e.key!==`path`||t.key!==`path`?e.key!==t.key:e.readings.every((n,r)=>{let i=t.readings[r];return n!==void 0&&i!==void 0&&He(n,i,e.inherited!==t.inherited)})}var W=`which only a nightly cargo reads, is not supported`;function G(e,t){let r=n(e);if(r===void 0)throw new C(`${T(e)} is not a version requirement`,t);return r}var We=[`version`,`registry`,`registry-index`,`path`,`git`,`branch`,`tag`,`rev`,`features`,`optional`,`default-features`,`default_features`,`package`,`public`],Ge={base:`a path base, ${W}`,artifact:`an artifact dependency, ${W}`,lib:`an artifact dependency, ${W}`,target:`an artifact dependency, ${W}`},Ke=[`workspace`,`features`,`default-features`,`default_features`,`optional`,`public`],qe=[[`dependencies`,`normal`],[`dev-dependencies`,`dev`],[`build-dependencies`,`build`]];function K(e,t,n,r){let i=n.replaceAll(`-`,`_`);if(i===n||e[i]===void 0)return e[n];let a=E(t??``,i);if(r===`2024`)throw new C(`not supported in the 2024 edition: use ${T(n)}`,a);if(e[n]!==void 0)throw new C(`given beside ${T(n)}`,a);return e[i]}function Je(e,t){let n=URL.parse(l(e,t));if(n===null)throw new C(`${T(e)} is not a URL`,t);if(!ue(n))throw new C(`${T(e)} is a URL with no path, which cargo refuses`,t);return n}function Ye(e,t,n){let r=b(e,`features`,t,p)??[];for(let[e,n]of r.entries()){let r=`${E(t,`features`)}[${e}]`;if(n.includes(`/`))throw new C(`${T(n)}: a dependency's feature cannot name another's`,r);if(n.startsWith(`dep:`))throw new C(`${T(n)}: a dependency's feature cannot be \`dep:\``,r)}return b(e,`public`,t,u),{features:r,defaultFeatures:y(u)(K(e,t,`default-features`,n),E(t,`default-features`))}}function q(e,t,n,r){if(typeof e==`string`)return G(e,t),{package:n,version:e,source:{type:`registry`,registry:void 0,index:void 0},optional:!1,defaultFeatures:!0,features:[]};o(e,t,We,Ge);let i=(n,r)=>b(e,n,t,r),a=i(`version`,l);a!==void 0&&G(a,E(t,`version`));let s=i(`registry`,D),c=i(`registry-index`,l);c!==void 0&&Je(c,E(t,`registry-index`));let d=i(`path`,l),f=i(`git`,l),p=[`branch`,`tag`,`rev`].filter(t=>e[t]!==void 0),m=[f!==void 0&&(s!==void 0||c!==void 0)&&"`git` or a registry",s!==void 0&&c!==void 0&&"`registry` or `registry-index`",f!==void 0&&d!==void 0&&"`git` or `path`",p.length>1&&"`branch`, `tag` or `rev`"].find(Boolean);if(m)throw new C(`ambiguous: only one of ${m} is taken`,t);if(f===void 0&&p.length>0)throw new C(`\`${p[0]}\` is only for a git dependency`,E(t,p[0]));if(a===void 0&&d===void 0&&f===void 0)throw new C(`names no version, path or git repository`,t);let h={type:`registry`,registry:s,index:c};if(d!==void 0&&(h={type:`path`,path:d}),f!==void 0){let e=Je(_(f,E(t,`git`)),E(t,`git`));if(e.search!==``||e.hash!==``)throw new C(`${T(f)} has a query or a fragment, which cargo drops or misreads`,E(t,`git`));h={type:`git`,url:f,branch:i(`branch`,l),tag:i(`tag`,l),rev:i(`rev`,l)}}let{features:ee,defaultFeatures:te=!0}=Ye(e,t,r);return{package:i(`package`,D)??n,version:a,source:h,optional:i(`optional`,u)??!1,defaultFeatures:te,features:ee}}function Xe(e,t,n,r){if(o(e,t,n),e.workspace!==!0)throw a(`true`,e.workspace,E(t,`workspace`));if(r===void 0)throw new C(`inherits from a workspace, and no workspace root is given`,t)}function Ze(e,t,n,r){Xe(e,t,Ke,r.workspace);let i=r.workspace.dependencies[n];if(i===void 0)throw new C(`${T(n)} is not in [workspace.dependencies]`,t);let{features:a,defaultFeatures:o}=Ye(e,t,r.edition);if(o===!1&&i.defaultFeatures&&r.edition===`2024`)throw new C("`default-features = false` cannot turn off the workspace's default features",t);return{...i,features:[...i.features,...a],defaultFeatures:o===!0||i.defaultFeatures,optional:b(e,`optional`,t,u)??!1,inherited:!0}}function Qe(e,t,n,r,i){for(let[a,o,c]of s(e,t)){D(a,c);let e=x(o)&&`workspace`in o?Ze(o,c,a,i):{...q(o,c,a,i.edition),inherited:!1};if(e.optional&&n===`dev`)throw new C(`a dev-dependency cannot be optional`,c);let t=Ve(e.source,e.inherited),s=i.sources.get(a)??[];if(s.some(e=>Ue(e,t)))throw new C(`${T(a)} is given another source elsewhere, which cargo refuses`,c);i.sources.set(a,[...s,t]),i.list.push({name:a,kind:n,target:r,...e})}}function $e(e,t,n){let r={workspace:t,edition:n,list:[],sources:new Map},i=(e,t,n)=>{for(let[i,a]of qe){let o=K(e,t,i,r.edition);o!==void 0&&Qe(o,E(t??``,i),a,n,r)}};i(e,void 0,void 0);for(let[t,n,r]of s(v(e.target),`target`)){if(V(t)===void 0)throw new C(`${T(t)} is neither a target's name nor a cfg(\u2026) cargo reads`,r);o(n,r,qe.flatMap(([e])=>[e,e.replaceAll(`-`,`_`)])),i(n,r,t)}return r.list}function J(e){let t=e.indexOf(`/`);if(t!==-1){let n=e[t-1]===`?`;return{dep:e.slice(0,n?t-1:t),feature:e.slice(t+1),weak:n}}return e.startsWith(`dep:`)?{dep:e.slice(4),feature:void 0,weak:!1}:{dep:void 0,feature:e,weak:!1}}function et(e,t,n){let r=m(e,t,ce,f()),i=new Set(Object.values(r).flat().map(J).filter(e=>e.feature===void 0).map(e=>e.dep)),a=Object.assign(Object.create(null),r),o=new Map;for(let e of n)o.set(e.name,o.get(e.name)||e.optional),e.optional&&!(e.name in r)&&!i.has(e.name)&&(a[e.name]=[`dep:${e.name}`]);let s=new Set;for(let[e,n]of Object.entries(a))for(let i of n){let n=n=>w(`${T(i)} ${n}`,E(t,e)),{dep:c,feature:l,weak:u}=J(i);if(c===void 0){if(l in r)continue;o.has(l)||n(`is neither a feature nor a dependency`),o.get(l)||n(`is a dependency, but not an optional one`),l in a||n(`is an optional dependency with no feature of its name: use "dep:${l}"`)}else s.add(c),l?.includes(`/`)&&n(`has more than one "/"`),c.startsWith(`dep:`)&&n(`has both "dep:" and "/"`),o.has(c)||n(`names ${T(c)}, which is not a dependency`),(l===void 0||u)&&!o.get(c)&&n(`names ${T(c)}, which is not an optional dependency`)}let c=[...o].find(([e,t])=>t&&!s.has(e));if(c!==void 0)throw new C(`optional dependency ${T(c[0])} is in no feature: add "dep:${c[0]}" to one`,t);return a}var tt=[`badges`,`features`,`lib`,`bin`,`example`,`test`,`bench`,`dependencies`,`dev-dependencies`,`dev_dependencies`,`build-dependencies`,`build_dependencies`,`target`,`lints`,`hints`],nt=[...tt,`package`,`project`,`workspace`,`profile`,`patch`],rt={"cargo-features":`cargo-features, ${W}`,replace:`[replace] is not supported`},it={metabuild:`metabuild, ${W}`,"default-target":`a per-package target, ${W}`,"forced-target":`a per-package target, ${W}`,"im-a-teapot":`im-a-teapot, ${W}`,"cargo-features":`cargo-features belong at the top of the manifest, and are not supported`},at=[`members`,`exclude`,`default-members`,`resolver`,`metadata`,`package`,`dependencies`,`lints`],ot=[`2015`,`2018`,`2021`,`2024`],Y={__proto__:null,2018:`1.31.0`,2021:`1.56.0`,2024:`1.85.0`},st={__proto__:null,1:1,2:2,3:3},ct=d(e=>ot.includes(e),`an edition: expected one of ${ot.join(`, `)}`),lt=d(e=>e in st,`a resolver: expected "1", "2" or "3"`),ut=(e,t)=>st[lt(e,t)];function dt(e){let r=t(e);if(r!==void 0)return r.pre===``&&r.build===``?r:void 0;let i=n(e);if(i?.length!==1||i[0].op!==`^`||i[0].pre!==``||e.startsWith(`^`))return;let{major:a,minor:o,patch:s}=i[0];return t(`${a}.${o??0}.${s??0}`)}var ft=d(e=>dt(e)!==void 0,`a Rust version`);function pt(e,t){if(typeof e!=`boolean`&&typeof e!=`string`)throw a(`true, false or a path`,e,t);return e}var mt=e=>[!1,!0].every(t=>Oe(e,t)!==void 0);function ht(e,t){if(Array.isArray(e))throw new C(`several build scripts, ${W}`,t);let n=pt(e,t);if(typeof n==`string`&&!mt(n))throw new C(`${T(n)} names no file, which cargo crashes on`,t);return n}function gt(e,t){let n=l(e,t);if(/^\p{White_Space}*$/u.test(n))throw new C(`a library's name cannot be empty, which cargo refuses`,t);if(n.includes(`-`))throw new C(`${T(n)}: a library's name cannot have a "-", which cargo refuses`,t);return n}function _t(e,t){let n=v(e.lib);return{name:b(n,`name`,`lib`,gt)??t.replaceAll(`-`,`_`),path:b(n,`path`,`lib`,l)}}function vt(e,t){if(typeof e==`boolean`)return e;if(!Array.isArray(e))throw a(`true, false or registry names`,e,t);return p(e,t)}var X={authors:p,categories:p,description:l,documentation:l,edition:ct,exclude:p,homepage:l,include:p,keywords:p,license:l,"license-file":l,publish:vt,readme:pt,repository:l,"rust-version":ft,version:O},yt={...X,name:D,build:ht,links:l,workspace:l,autolib:u,autobins:u,autoexamples:u,autotests:u,autobenches:u,"default-run":l,resolver:ut,metadata:e=>e};function bt(e,t){for(let[,n,r]of s(e,t))for(let[,e,t]of s(n,r))l(e,t);return e}function xt(e,t,n,r){o(e,t);let i=y(u)(K(e,t,`proc-macro`,n),E(t,`proc-macro`)),a=y(p)(K(e,t,`crate-type`,n),E(t,`crate-type`));if(r&&a?.includes(`proc-macro`)&&a.length>1)throw new C(`a proc-macro crate type is taken alone`,E(t,`crate-type`));return i??a?.includes(`proc-macro`)??!1}function St(e,t){let n=e.lib!==void 0&&xt(e.lib,`lib`,t,!0),r=[`example`,`test`,`bench`].flatMap(n=>c(e[n]??[],n).map((e,r)=>xt(e,`${n}[${r}]`,t,!1)));return{procMacro:n,procMacroTarget:n||r.includes(!0)}}function Ct(e){o(e,`workspace`,at);let t=(t,n)=>b(e,t,`workspace`,n),n=t(`package`,(e,t)=>o(e,t,[...Object.keys(X),`badges`]))??Object.create(null);for(let[e,t,r]of s(n,`workspace.package`))(e===`badges`?bt:X[e])(t,r);let r=m(e.dependencies,`workspace.dependencies`,D,(e,t,n)=>{let r=q(e,t,n);if(r.optional)throw new C(`a workspace dependency cannot be optional`,t);if(x(e)&&e.public!==void 0)throw new C(`a workspace dependency cannot be public`,t);return r});return{members:t(`members`,p)??[],exclude:t(`exclude`,p)??[],defaultMembers:t(`default-members`,p),resolver:t(`resolver`,ut),package:n,dependencies:r}}var wt=e=>m(e,`patch`,e=>e,(e,t)=>m(e,t,D,q));function Tt(e,t,n){if(x(e)&&x(t)){let r=Object.assign(Object.create(null),t);for(let[i,a]of Object.entries(e))r[i]=Object.hasOwn(t,i)?Tt(a,t[i],E(n,i)):a;return r}if(Array.isArray(e)&&Array.isArray(t))return[...t,...e];if([e,t].some(e=>x(e)||Array.isArray(e)))throw new C(`${i(e)} in one config and ${i(t)} in one under it, which cargo does not merge`,n);return e}function Et(e){if(!Array.isArray(e)||!e.every(e=>typeof e==`string`))throw TypeError(`expected the texts of the config files`);let t;for(let[n,r]of e.entries()){let e=se(()=>S(r),e=>{throw e instanceof oe&&(e.message=`texts[${n}]: ${e.message}`),e});e.patch!==void 0&&(t=t===void 0?e.patch:Tt(t,e.patch,`patch`))}return{patch:wt(t)}}function Dt(e,t,n,r){if(!x(e))return e;if(Xe(e,t,[`workspace`],r),r.package[n]===void 0)throw new C(`workspace.package.${n} is not given`,t);return r.package[n]}function Ot(e,t){if(e.package!==void 0&&e.project!==void 0)throw new C(`[project] beside [package]`,`project`);let i=e.package===void 0?`project`:`package`,a=o(e[i],i,Object.keys(yt),it),s=Object.create(null);for(let[e,n]of Object.entries(yt)){let r=E(i,e);s[e]=y(n)(e in X?Dt(a[e],r,e,t):a[e],r)}if(a.workspace!==void 0&&e.workspace!==void 0)throw new C(`a workspace root names no other root`,E(i,`workspace`));let c=s.edition??`2015`;if(i===`project`&&c===`2024`)throw new C(`not supported in the 2024 edition: use [package]`,i);let l=s[`rust-version`];if(l!==void 0&&c in Y&&!r(n(`^${Y[c]}`),dt(l)))throw new C(`rust-version ${T(l)} is incompatible with ${Y[c]}, which the ${c} edition requires`,E(i,`rust-version`));let{version:u,publish:d,resolver:f,links:p}=s;if(u===void 0&&d!==void 0&&d!==!1&&!(Array.isArray(d)&&d.length===0))throw new C("`publish` needs a `version`",E(i,`publish`));if(f!==void 0&&e.workspace?.resolver!==void 0)throw new C("`resolver` is given in [workspace] too",E(i,`resolver`));if(p!==void 0&&s.build===!1)throw new C(`links to ${T(p)} with no build script, which cargo refuses`,E(i,`links`));let m=s.build===!0?`build.rs`:s.build;return{name:D(a.name,E(i,`name`)),version:u??`0.0.0`,edition:c,resolver:f,links:p,build:m}}function kt(e,t){let n=o(S(e),void 0,nt,rt),r=n.workspace===void 0?void 0:Ct(n.workspace);if(r!==void 0&&t!==void 0)throw new C(`a workspace root inherits from its own [workspace], not another`,`workspace`);if(t!==void 0&&t.workspace===void 0)throw TypeError(`expected the manifest of a workspace root`);let i=r??t?.workspace,a=wt(n.patch);if(n.package===void 0&&n.project===void 0){if(r===void 0)throw new C(`neither [package] nor [workspace]`);let e=tt.find(e=>n[e]!==void 0);if(e!==void 0)throw new C(`a virtual manifest has no package for it`,e);return{package:void 0,workspace:r,patch:a}}let s=Ot(n,i),c=$e(n,i,s.edition),l=St(n,s.edition);return{package:{...s,features:et(n.features,`features`,c),dependencies:c,lib:_t(n,s.name),...l},workspace:r,patch:a}}function At(e,t){let n=o(S(e),t),r=E(t,n.package===void 0?`project`:`package`),i=o(n.package??n.project,r),a=D(i.name,E(r,`name`));if(x(i.version))throw new C(`a vendored package inherits nothing from a workspace`,E(r,`version`));return{name:a,version:b(i,`version`,r,O)??`0.0.0`}}function jt(e){let t=0;for(let n of e.matchAll(/"(?:[^"\\]|\\.)*"(\s*:)?/gsu))n[1]!==void 0&&t++;return t}function Mt(e,t){let n=se(()=>JSON.parse(e),e=>w(`not JSON: ${e.message}`,t));if(!re(n))throw new C(`expected an object`,t);if(n.$comment!==void 0&&typeof n.$comment!=`string`)throw new C(`expected "$comment" to be a string`,t);if(Object.keys(n).filter(e=>e!==`$comment`).sort().join()!==`files,package`)throw new C(`expected "files" and "package", and nothing else`,t);if(n.package!==null&&!g(n.package))throw new C(`expected "package" to be a sha256 or null`,t);if(!re(n.files))throw new C(`expected "files" to be an object`,t);let r=Object.create(null);for(let[e,i]of Object.entries(n.files)){if(!te(e))throw new C(`${T(e)} is not a path within the package`,t);if(typeof i!=`string`||!g(i))throw new C(`expected a sha256 for ${T(e)}`,t);r[e]=i}if(jt(e)!==Object.keys(n).length+Object.keys(r).length)throw new C(`a key is given twice`,t);return{checksum:n.package??void 0,files:r}}function Nt(e){if(typeof e!=`string`)throw TypeError(`expected the text of a .cargo-checksum.json`);return Mt(e,void 0)}function Pt(e,t){if(typeof t!=`object`||!t)throw TypeError(`expected the vendor directory, by directory`);let n=new Map;for(let[e,r]of Object.entries(t)){if(!ee(e)||e.startsWith(`.`))throw new C(`${T(e)} is not a directory a directory source reads`,e);if(typeof r?.manifest!=`string`||typeof r.checksum!=`string`)throw TypeError(`expected the manifest and checksum texts of ${T(e)}`);let{name:t,version:i}=At(r.manifest,E(e,`Cargo.toml`)),a=`${t} ${i}`;if(n.has(a))throw new C(`${T(n.get(a).directory)} holds ${T(a)} too, and cargo would read either`,e);n.set(a,{directory:e,...Mt(r.checksum,E(e,`.cargo-checksum.json`))})}let r=Object.create(null);for(let[t,i]of Object.entries(e.packages)){if(i.source===void 0)continue;let e=n.get(`${i.name} ${i.version}`);if(e===void 0)throw new C(`no directory holds ${T(`${i.name} ${i.version}`)}`,t);if(e.checksum!==i.checksum)throw new C(`${T(e.directory)} holds it with checksum ${e.checksum??`none`}, where the lockfile has ${i.checksum??`none`}`,t);r[t]={directory:e.directory,files:e.files}}return r}var Z=(e,t)=>e.get(t)??e.set(t,new Set).get(t),Ft=(e,t,n)=>new C(`${T(e)} is asked of ${T(t)}, which has no such feature`,n),It=(e,t)=>new C(`feature ${T(e)} enables itself, which cargo refuses`,t);function Q(e,t){return t.defaultFeatures&&`default`in e[t.resolved].manifest.features?[...t.features,`default`]:t.features}var Lt=()=>({features:new Set,enabled:new Set,asked:new Map}),Rt=class{constructor(e,t){this.packages=e,this.why=t,this.requests=new Map,this.active=new Set,this.dirty=new Set}requestOf(e){return this.requests.has(e)||(this.requests.set(e,Lt()),this.dirty.add(e)),this.requests.get(e)}require(e,t,n,r){let i=this.packages[e].manifest.features;if(!(n in i))throw Ft(n,e,r);if(!t.features.has(n)){if(t.features.add(n),this.dirty.add(e),i[n].includes(n))throw It(n,e);for(let r of i[n])this.requireValue(e,t,J(r),e)}}requireValue(e,t,n,r){if(n.dep===void 0)return this.require(e,t,n.feature,r);let{features:i,dependencies:a}=this.packages[e].manifest,o=a.some(e=>e.name===n.dep&&e.optional);n.feature!==void 0&&!n.weak&&o&&n.dep in i&&this.require(e,t,n.dep,r),t.enabled.add(n.dep),n.feature!==void 0&&Z(t.asked,n.dep).add(n.feature),this.dirty.add(e)}ask(e,t,n){if(e.resolved===void 0)throw new C(this.why(e,n),n);this.active.add(e);let r=this.requestOf(e.resolved);for(let i of[...Q(this.packages,e),...t])this.require(e.resolved,r,i,n)}run(e){for(let[t,n]of e){let[e,r]=[Lt(),this.requestOf(t)];for(let i of n)this.requireValue(t,e,i,`features`),this.requireValue(t,r,i,`features`);for(let n of this.packages[t].dependencies)n.kind===`dev`&&this.ask(n,e.asked.get(n.name)??[],t)}for(;this.dirty.size>0;){let e=this.dirty.values().next().value;this.dirty.delete(e);let t=this.requestOf(e);for(let n of this.packages[e].dependencies)n.kind===`dev`||n.optional&&!t.enabled.has(n.name)||this.ask(n,t.asked.get(n.name)??[],e)}return this.active}};function zt(e,t,n){return new Rt(e,n).run(t)}var Bt=`path`,Vt={__proto__:null,registry:{registry:!1,index:!1},git:{url:!0,branch:!1,tag:!1,rev:!1},path:{path:!0}};function Ht(e){let t=Vt[e?.type];if(!(t!==void 0&&Object.entries(t).every(([t,n])=>typeof e[t]==`string`||!n&&e[t]===void 0)))throw TypeError(`expected a source, as parseCargoManifest gives one`)}function Ut(e,t){if(typeof e!=`string`)throw TypeError(`expected the key of a [patch] table`);return Ht(t),I(t)===F(e)}var Wt=(e,n)=>e===void 0||r(e,t(n)),Gt=(e,t)=>t.identity===e||e===N&&t.source!==void 0&&!t.source.startsWith(`git+`),Kt=(e,t)=>t.name===e.package&&Gt(e.identity,t)&&Wt(e.requirement,t.version),qt=(e,t)=>({...e,key:L(e.name,e.version,e.source),identity:e.source===void 0?Bt:j(e.source,t,!1).identity});function Jt(e,t,n){let r=new Map;for(let i of Object.keys(e).toSorted()){let a=E(t,i),o=Object.entries(e[i]).map(([e,t])=>({key:i,name:e,spec:t,where:E(a,e)}));r.set(me(i),{key:i,where:a,label:`${n}[patch.${i}]`,entries:o})}return r}function Yt(e,t){let n=Jt(v(t?.patch),E(`config`,`patch`),`the config's `);for(let[t,r]of Jt(e.patch,`patch`,``)){let e=n.get(t);e===void 0?n.set(t,r):e.entries.push(...r.entries.filter(t=>!e.entries.some(e=>e.name===t.name)))}let r=new Map;for(let{key:e,where:t,label:i}of n.values()){let n=F(e),a=r.get(n);if(a!==void 0)throw new C(`patches the source ${a} does by another URL, and cargo would take either table`,t);r.set(n,i)}return[...n.values()].flatMap(e=>e.entries)}function Xt(e,t){return Yt(e,t).map(({key:e,spec:t,where:n})=>{let r=F(e);if(I(t.source)===r)throw new C(`patches its source with itself, which cargo refuses`,n);let i=y(G)(t.version,n);return{table:r,target:`${r} ${t.package}`,package:t.package,identity:P(t.source,Bt),requirement:i,where:n}})}function Zt(e,t,n){let r=t.map(()=>{}),i=(e,a)=>t.some((t,o)=>a.has(o)||!n(e,t)||(a.add(o),r[o]!==void 0&&!i(r[o],a))?!1:(r[o]=e,!0));return e.find(e=>!i(e,new Set))}function Qt(e,t,n,r){let i=t.map(e=>qt(e,`patch.unused`)),a=i.find(t=>t.source!==void 0&&e.has(t.key));if(a!==void 0)throw new C(`the lockfile lists ${T(a.key)} unused, and among its packages: is it out of date?`,`patch.unused`);let o=new Map;for(let t of n)for(let n of e.values())Kt(t,n)&&o.set(`${t.table} ${n.key}`,{...n,table:t.table});let s=(e,t)=>(t.table===void 0||t.table===e.table)&&Kt(e,t),c=Zt(n,[...o.values(),...i],s);if(c!==void 0)throw new C(`the lockfile has no package of its own this patch offers, used or unused: is it out of date?`,c.where);let l=Zt([...[...r].map(e=>o.get(e)),...i],n,(e,t)=>s(t,e));if(l?.table!==void 0)throw new C(`a dependency resolves to it by a [patch], and no patch is left that offers it: is the lockfile out of date?`,l.key);if(l!==void 0)throw new C(`the lockfile lists ${T(`${l.name} ${l.version}`)} unused where no [patch] does: is it out of date?`,`patch.unused`)}function $t(e){let t=e.package?.edition;return e.workspace?.resolver??e.package?.resolver??(t===`2024`?3:t===`2021`?2:1)}function en(e,t){let n=new Map;for(let r of t){if(!(r in e.packages)||e.packages[r].source!==void 0)throw new C(`${T(r)} is not a path package in the lockfile`,`members`);let{name:t}=e.packages[r];if(n.has(t)&&n.get(t)!==r)throw new C(`${T(n.get(t))} and ${T(r)} are two members of one name, which cargo refuses`,`members`);n.set(t,r)}}function tn(e){let t=new Map;for(let[n,{manifest:r}]of Object.entries(e))if(r.links!==void 0){if(t.has(r.links))throw new C(`links the native library ${T(r.links)}, as ${T(t.get(r.links))} does, which cargo refuses`,n);t.set(r.links,n)}}function nn(e,t,n,r){let i=Object.create(null),a=new Map,o=new Map;for(let[s,c]of Object.entries(e.packages)){let e=t[s]?.package;if(e===void 0)throw new C(`no manifest of this package is given`,s);if(e.name!==c.name||e.version!==c.version)throw new C(`the manifest given is of ${T(`${e.name} ${e.version}`)}`,s);let l=n.includes(s),u=e.dependencies.map((e,t)=>{let n=l||e.kind!==`dev`?on(e,s,r,E(E(s,`dependencies`),String(t))):[],i={...e,resolved:n.length===1?n[0].key:void 0,active:!1};return n.length>1&&a.set(i,n.map(e=>e.key)),n.length===1&&n[0].slot!==void 0&&o.set(i,n[0].slot),i});i[s]={...R(c),manifest:e,dependencies:u}}return{packages:i,ambiguous:a,patched:o}}function rn(e,t,n){let r=new Set(n);for(let e of Object.values(t))for(let t of e.dependencies)t.active&&r.add(t.resolved);let i=Object.keys(t).find(e=>!r.has(e));if(i!==void 0)throw new C(`no member depends on it, directly or not: is the lockfile out of date?`,i);for(let[n,r]of Object.entries(t)){let t=new Set(r.dependencies.filter(e=>e.active).map(e=>e.resolved)),i=e.packages[n].dependencies.find(e=>!t.has(e));if(i!==void 0)throw new C(`the lockfile's edge to ${T(i)} is no dependency the members' features turn on: is it out of date?`,n)}}function an(e,t,n){let{workspace:r,members:i,config:a}=ae(n,[`workspace`,`members`,`config`]);if(r?.patch===void 0||r.workspace===void 0&&r.package===void 0)throw TypeError(`expected the manifest of the workspace root`);if(!Array.isArray(i))throw TypeError(`expected the members of the workspace`);if(a!==void 0&&a?.patch===void 0)throw TypeError(`expected the config, as parseCargoConfig gives it`);en(e,i);let o=r.package===void 0?void 0:L(r.package.name,r.package.version);if(o!==void 0&&!i.includes(o))throw new C(`the root package ${T(o)} is not among the members`,`members`);let s=new Map(Object.entries(e.packages).map(([e,t])=>[e,qt(t,e)])),c=Xt(r,a),{packages:l,ambiguous:u,patched:d}=nn(e,t,i,{locked:s,patches:Map.groupBy(c,e=>e.target)}),f=new Map(i.map(e=>[e,Object.keys(l[e].manifest.features).map(J)])),p=(t,n)=>{if(u.has(t))return`${T(t.name)} could be any of ${u.get(t).map(T).join(`, `)}`;let r=e.packages[n].dependencies.filter(n=>e.packages[n].name===t.package);return r.length===0?`the lockfile resolves no ${T(t.name)}, which the members' features turn on: is it out of date?`:`the lockfile resolves ${T(t.name)} to none but ${r.map(T).join(`, `)}, of another source or version: is it out of date, or [patch]ed by a config not given?`};for(let e of zt(l,f,p))e.active=!0;return rn(e,l,i),tn(l),Qt(s,e.unusedPatches,c,new Set(d.entries().filter(([e])=>e.active).map(([,e])=>e))),{resolver:$t(r),root:o,members:[...i],packages:l}}function on(e,t,{locked:n,patches:r},i){let a=y(G)(e.version,i),o=P(e.source,n.get(t).identity),s=I(e.source),c=r.get(`${s} ${e.package}`)??[];return n.get(t).dependencies.flatMap(t=>{let r=n.get(t);return r.name!==e.package||!Wt(a,r.version)?[]:Gt(o,r)?[{key:t,slot:void 0}]:c.some(e=>Kt(e,r))?[{key:t,slot:`${s} ${t}`}]:[]})}var sn=/^[A-Z_a-z]\w*$/u;function $(e,t){if(typeof e!=`object`||!e||!Array.isArray(e.cfg)||e.name!==void 0&&typeof e.name!=`string`)throw TypeError(`expected ${t} as { name, cfg }`);if(e.decides!==void 0&&!(Array.isArray(e.decides)&&e.decides.every(e=>typeof e==`string`)))throw TypeError(`expected ${t}.decides as the names of cfgs`);let n=e.cfg.map(e=>Fe(e)??w(`${T(e)} is not a line of \`rustc --print cfg\``,t)),r=e.decides?.map(e=>sn.test(e)?e:w(`${T(e)} is not the name of a cfg`,E(t,`decides`)));return{name:e.name,cfg:new Set(n),decides:r===void 0?void 0:new Set(r)}}var cn=e=>e.name===void 0||e.decides!==void 0;function ln(e){let t=$(e,`platform`),n=new Map;return e=>{if(typeof e!=`string`)throw TypeError(`expected a platform as a [target] table names it`);return n.has(e)||n.set(e,V(e)),Re(n.get(e)??w(`${T(e)} is neither a target's name nor a cfg(\u2026) cargo reads`),t)}}function un(e){if(!Array.isArray(e)||!e.every(e=>typeof e==`string`))throw TypeError(`expected the features as strings`);return[...new Set(e.flatMap(e=>e.split(/[\p{White_Space},]+/u)).filter(Boolean))].map(e=>{let t=J(e);if(t.feature===void 0)throw new C(`${T(e)}: \`dep:\` is not taken on the command line`,`features`);if(t.dep!==void 0&&t.feature.includes(`/`))throw new C(`${T(e)} has more than one "/"`,`features`);return{text:e,...t}})}function dn(e){let t=e=>(e.target===void 0?[`normal`,`dev`,`build`]:[`normal`,`build`,`dev`]).indexOf(e.kind),n=e.dependencies.toSorted((e,n)=>{let[r,i]=[e.target??``,n.target??``];return r===i?t(e)-t(n):r<i?-1:1});return new Map(n.map(e=>[e.name,e]))}function fn(e,t,n){let r=dn(e),i=t=>t in e.features||r.get(t)?.optional===!0,a=t=>t.dep===void 0?i(t.feature)?t:void 0:r.has(t.dep)?t:t.dep===e.name&&i(t.feature)?J(t.feature):void 0;return t.flatMap(e=>{let t=a(e);return t===void 0?[]:(n.add(e.text),[t])})}function pn(e,t,n,r){let i=new Map;if(e.root===void 0||e.resolver>=2){let a=new Set;for(let o of n)i.set(o,[fn(e.packages[o].manifest,t,a),!r.noDefaultFeatures]);let o=t.filter(e=>!a.has(e.text));if(o.length>0)throw new C(`no package selected has ${o.map(e=>T(e.text)).join(`, `)}`,`features`);return i}let a=r.current??e.root;if(!e.members.includes(a))throw new C(`${T(a)} is not a member of the workspace`,`current`);let o=t=>e.packages[t].name,s=t=>t.dep!==void 0&&e.members.some(e=>e!==a&&o(e)===t.dep)&&n.some(e=>o(e)===t.dep),c=Map.groupBy(t.filter(s),e=>e.dep);for(let l of e.members)l===a?i.set(l,[t.filter(e=>!s(e)),!r.noDefaultFeatures]):n.includes(l)&&i.set(l,[(c.get(o(l))??[]).map(e=>J(e.feature)),!0]);return i}function mn(e,t){let{packages:n}=t;if(!Array.isArray(n)||n.length===0)throw TypeError(`expected the packages built, as keys of members`);for(let t of n)if(!e.members.includes(t))throw new C(`${T(t)} is not a member of the workspace`,`packages`);let r=e.members.filter(e=>n.includes(e)),i=new Map;for(let[n,[a,o]]of pn(e,un(t.features??[]),r,t)){let{features:r,dependencies:s}=e.packages[n].manifest,c=a.find(e=>e.dep!==void 0&&!s.some(t=>t.name===e.dep));if(c!==void 0)throw new C(`${T(n)} has no dependency ${T(c.dep)}`,`features`);let l=[...o&&`default`in r?[`default`]:[],...t.allFeatures?Object.keys(r):[]];i.set(n,[...a,...l.map(J)])}return i}function hn(e,t){let{undecided:n}=e;if(n===void 0){if(t.some(cn))throw TypeError("expected `undecided`, 'on' or 'off', as a platform leaves cfgs undecided");return!1}if(n!==`on`&&n!==`off`)throw TypeError("expected `undecided` to be 'on' or 'off'");if(e.targets===`all`)throw TypeError("expected no `undecided` with targets 'all', which reads every platform");return n===`on`}var gn=class{constructor(e,t,n){this.graph=e,this.targeted=t;let r=n.targets===`all`;this.host=r?void 0:$(n.host,`host`),this.targets=r?[]:(n.targets?.length>0?n.targets:[n.host]).map((e,t)=>$(e,`targets[${t}]`)),this.undecided=hn(n,r?[]:[this.host,...this.targets]),this.dev=n.dev===!0,this.decoupleHost=e.resolver>=2,this.decoupleDev=e.resolver>=2&&!this.dev,this.ignoreInactive=e.resolver>=2&&!r,this.trackForHost=this.decoupleHost||this.ignoreInactive,this.platforms=new Map,this.depsOf=new Map,this.activated=new Map,this.activatedDeps=new Map,this.processed=new Set,this.deferred=new Map}saved(e){return this.decoupleHost?e:`normal`}enabled(e,t){return Z(this.activated,`${this.saved(t)} ${e}`)}features(e){return this.graph.packages[e].manifest.features}deps(e,t){let n=`${t} ${e}`;return this.depsOf.has(n)||this.depsOf.set(n,this.graph.packages[e].dependencies.filter(e=>this.targeted.has(e)&&!(e.kind===`dev`&&this.decoupleDev)&&(e.target===void 0||!this.ignoreInactive||this.activeFor(e,t))).map(e=>({dep:e,depFk:this.trackForHost&&this.forHost(e)?`host`:t}))),this.depsOf.get(n)}forHost(e){return e.kind===`build`||this.graph.packages[e.resolved].manifest.procMacro}activeFor(e,t){this.platforms.has(e.target)||this.platforms.set(e.target,V(e.target));let n=this.platforms.get(e.target),r=e=>Re(n,e)??this.undecided;return e.kind===`build`||t===`host`?r(this.host):this.targets.some(r)}request(e,t,n,r){if(!(n in this.features(e)))throw Ft(n,e,r);this.activateRec(e,t,n)}activatePkg(e,t,n,r){for(let i of n)this.request(e,t,i,r);if(!this.processed.has(`${t} ${e}`)){this.processed.add(`${t} ${e}`);for(let{dep:n,depFk:r}of this.deps(e,t))n.optional||this.activatePkg(n.resolved,r,Q(this.graph.packages,n),e)}}activateValue(e,t,n){n.dep===void 0?this.activateRec(e,t,n.feature):n.feature===void 0?this.activateDependency(e,t,n.dep):this.activateDepFeature(e,t,n.dep,n.feature,n.weak)}activateRec(e,t,n){let r=this.enabled(e,t);if(r.has(n))return;r.add(n);let i=this.features(e)[n]??[];if(i.includes(n))throw It(n,e);for(let n of i)this.activateValue(e,t,J(n))}activateDependency(e,t,n){Z(this.activatedDeps,`${this.saved(t)} ${e}`).add(n);let r=this.deferred.get(`${t} ${e} ${n}`)??[];this.deferred.delete(`${t} ${e} ${n}`);for(let{dep:i,depFk:a}of this.deps(e,t).filter(e=>e.dep.name===n)){for(let t of r)this.request(i.resolved,a,t,e);this.activatePkg(i.resolved,a,Q(this.graph.packages,i),e)}}activateDepFeature(e,t,n,r,i){for(let{dep:a,depFk:o}of this.deps(e,t).filter(e=>e.dep.name===n)){if(a.optional){if(i&&!this.activatedDeps.get(`${this.saved(t)} ${e}`)?.has(n)){Z(this.deferred,`${t} ${e} ${n}`).add(r);continue}this.activateDependency(e,t,n),!i&&n in this.features(e)&&this.activateRec(e,t,n)}this.request(a.resolved,o,r,e)}}builtKinds(e){let{procMacro:t,procMacroTarget:n}=this.graph.packages[e].manifest;return t||n&&this.dev?[`normal`,`host`]:[`normal`]}resolveRoot(e,t){for(let n of this.trackForHost&&this.graph.packages[e].manifest.procMacroTarget?[`normal`,`host`]:[`normal`]){for(let r of t)this.activateValue(e,n,r);this.activatePkg(e,n,[],`roots`)}}reach(e,t){let n=new Map,r=(e,t)=>{n.has(`${t} ${e}`)||n.set(`${t} ${e}`,[e,t])};for(let[t,n]of e)r(t,n);let i=new Set(n.keys());for(let[e,a]of n.values()){let n=this.activatedDeps.get(`${this.saved(a)} ${e}`);for(let o of this.graph.packages[e].dependencies)!this.targeted.has(o)||o.optional&&!n?.has(o.name)||o.kind===`dev`&&!(this.dev&&i.has(`${a} ${e}`))||o.target!==void 0&&this.host!==void 0&&!this.activeFor(o,a)||t(e,o)&&r(o.resolved,a===`host`||this.forHost(o)?`host`:`normal`)}return n}result(e){let t=e.map(e=>[e,this.graph.packages[e].manifest.procMacro?`host`:`normal`]);this.reach(t,(e,t)=>this.checkNamed(e,t));let n=this.reach(e.flatMap(e=>this.builtKinds(e).map(t=>[e,t])),()=>!0),r=Object.create(null);for(let e of Object.keys(this.graph.packages)){let[t,i]=[`normal`,`host`].map(t=>n.has(`${t} ${e}`)?[...this.enabled(e,t)].sort():void 0);(t!==void 0||i!==void 0)&&(r[e]={normal:t,host:i})}return r}checkNamed(e,t){let n=e=>e.name.replaceAll(`-`,`_`),r=this.graph.packages[e].dependencies.find(e=>this.targeted.has(e)&&e.resolved===t.resolved&&n(e)!==n(t));if(r!==void 0)throw new C(`depends on ${T(t.resolved)} as both ${T(t.name)} and ${T(r.name)}, which cargo refuses to build`,e);return!0}};function _n(e,t){ae(t,[`packages`,`features`,`allFeatures`,`noDefaultFeatures`,`current`,`dev`,`host`,`targets`,`undecided`]);let n=mn(e,t),r=new gn(e,zt(e.packages,n,e=>`the build turns on ${T(e.name)}, which the lockfile does not resolve to one package, and cargo would anew`),t);for(let[e,t]of n)r.resolveRoot(e,t);return r.result(t.packages)}export{C as LockfileError,oe as TomlError,an as linkCargo,ln as matchCargoPlatform,Nt as parseCargoChecksum,Et as parseCargoConfig,we as parseCargoLock,kt as parseCargoManifest,Ut as patchesCargoSource,Pt as readCargoVendor,_n as resolveCargoFeatures};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as lockfileWhy,b as routesTo}from"./chunk-A4BBBHQU.js";import"./chunk-OOJM4CTU.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as t,c as n}from"./chunk-ZQHLECTI.js";import{d as r,f as i,g as a,j as o,k as s,m as c}from"./chunk-PXK7EU4V.js";var l=[{},{},{}],u=[[...`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`],[...`0123456789ABCDEFGHIJKLMNOPQRSTUV`],[...`0123456789ABCDEFGHJKMNPQRSTVWXYZ`]],d=`Invalid character in base32 input`,f=`Invalid base32 padding`,p=`Invalid base32 length`,m=`Invalid last chunk`,h=r;function g(e,n,r){o(e);let i=Math.floor(e.length/5),s=i*5,c=``,d=0,f=u[n],p=l[n];if(!p.pairs){if(p.pairs=[],a){p.codepairs=new Uint16Array(1024);let e=p.codepairs,t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(let e=0;e<32;e++){let n=f[e].charCodeAt(0);for(let r=0;r<32;r++)t[e<<6|r<<1]=t[r<<6|(e<<1)+1]=n}}else{let e=p.pairs;for(let t=0;t<32;t++)for(let n=0;n<32;n++)e.push(`${f[t]}${f[n]}`)}}let{pairs:m,codepairs:g}=p;if(a){let n=new Uint16Array(i*4);for(let t=0;d<s;d+=5){let r=e[d],i=e[d+1],a=e[d+2],o=e[d+3],s=e[d+4],c=r<<2|i>>6,l=(i&63)<<4|a>>4,u=(a&15)<<6|o>>2,f=(o&3)<<8|s;n[t]=g[c],n[t+1]=g[l],n[t+2]=g[u],n[t+3]=g[f],t+=4}c=t(n)}else if(h)for(;d<s;d+=5){let t=e[d],n=e[d+1],r=e[d+2],i=e[d+3],a=e[d+4],o=t<<2|n>>6,s=(n&63)<<4|r>>4,l=(r&15)<<6|i>>2,u=(i&3)<<8|a;c+=`${m[o]}${m[s]}${m[l]}${m[u]}`}else for(;d<s;d+=5){let t=e[d],n=e[d+1],r=e[d+2],i=e[d+3],a=e[d+4],o=t<<2|n>>6,s=(n&63)<<4|r>>4,l=(r&15)<<6|i>>2,u=(i&3)<<8|a;c+=m[o],c+=m[s],c+=m[l],c+=m[u]}let _=0,v=3;for(;d<e.length;d++){let t=e[d];c+=f[_|t>>v],v>=5&&(v-=5,c+=f[t>>v&31]),_=t<<5-v&31,v+=3}return v!==3&&(c+=f[_]),r&&(c+=[``,`======`,`====`,`===`,`=`][e.length-s]),c}var _=i?128:65536;function v(e,t){let r=e.length;for(;e[r-1]===`=`;)r--;let a=e.length-r,o=r%8,s=r-o;if(![0,2,4,5,7].includes(o))throw SyntaxError(p);if(a>7||a!==0&&e.length%8!=0)throw SyntaxError(f);let c=u[t],h=l[t];if(!h.fromMap){h.fromMap=new Int8Array(_).fill(-1);let e=h.fromMap;c.forEach((t,n)=>{e[t.charCodeAt(0)]=e[t.toLowerCase().charCodeAt(0)]=n}),t===2&&(e[73]=e[76]=e[105]=e[108]=e[49],e[79]=e[111]=e[48])}let g=h.fromMap,v=new Uint8Array(Math.floor(r*5/8)),y=0,b=0;if(i){let t=n(e,d);for(;b<s;b+=8){let e=t[b],n=t[b+1],r=t[b+2],i=t[b+3],a=t[b+4],o=t[b+5],s=t[b+6],c=t[b+7],l=g[e]<<15|g[n]<<10|g[r]<<5|g[i],u=g[a]<<15|g[o]<<10|g[s]<<5|g[c];if(l<0||u<0)throw SyntaxError(d);v[y]=l>>12,v[y+1]=l>>4&255,v[y+2]=l<<4&255|u>>16,v[y+3]=u>>8&255,v[y+4]=u&255,y+=5}}else for(;b<s;b+=8){let t=e.charCodeAt(b),n=e.charCodeAt(b+1),r=e.charCodeAt(b+2),i=e.charCodeAt(b+3),a=e.charCodeAt(b+4),o=e.charCodeAt(b+5),s=e.charCodeAt(b+6),c=e.charCodeAt(b+7),l=g[t]<<15|g[n]<<10|g[r]<<5|g[i],u=g[a]<<15|g[o]<<10|g[s]<<5|g[c];if(l<0||u<0)throw SyntaxError(d);v[y]=l>>12,v[y+1]=l>>4&255,v[y+2]=l<<4&255|u>>16,v[y+3]=u>>8&255,v[y+4]=u&255,y+=5}if(o<2)return v;let x=g[e.charCodeAt(b++)]<<5|g[e.charCodeAt(b++)];if(x<0)throw SyntaxError(d);if(v[y++]=x>>2,o<4){if(x&3)throw SyntaxError(m);return v}let S=g[e.charCodeAt(b++)]<<5|g[e.charCodeAt(b++)];if(S<0)throw SyntaxError(d);if(v[y++]=x<<6&255|S>>4,o<5){if(S&15)throw SyntaxError(m);return v}let C=g[e.charCodeAt(b++)];if(C<0)throw SyntaxError(d);if(v[y++]=S<<4&255|C>>1,o<7){if(C&1)throw SyntaxError(m);return v}let w=g[e.charCodeAt(b++)]<<5|g[e.charCodeAt(b++)];if(w<0)throw SyntaxError(d);if(v[y++]=C<<7&255|w>>3,w&7)throw SyntaxError(m);return v}function y(t,n,r,i,a){if(typeof t!=`string`)throw TypeError(s);if(a!==null&&e(a),r===!0){if(t.length%8!=0)throw SyntaxError(f)}else if(r===!1){if(t.endsWith(`=`))throw SyntaxError(`Did not expect padding in base32 input`)}else if(r!==`both`)throw TypeError(`Invalid padding option`);return c(v(t,n),i)}var b=(e=>(t,n)=>{if(!n)return y(t,e,`both`,`uint8`,null);let{format:r=`uint8`,padding:i=`both`,...a}=n;return y(t,e,i,r,a)})(0),x=(e,{padding:t=!1}={})=>g(e,0,t);export{b as a,x as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=new TextEncoder,t=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});function n(t){if(typeof t!=`string`)throw TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw TypeError(`encodeUtf8: input contains lone surrogates`);return e.encode(t)}var r=2;function i(t){if(typeof t!=`string`)throw TypeError(`utf8ByteLength expects a string, got ${typeof t}`);if(/[\u0100-\uFFFF]/.test(t))return e.encode(t).byteLength;let n=/[\u0080-\u00FF]/gu,i=t.length;for(;n.test(t);){let e=n.lastIndex-1;for(let n=0;e<t.length&&n<r;e++)t.codePointAt(e)>127?(i++,n=0):n++;n.lastIndex=e}return i}function a(e){if(!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer))throw TypeError(`decodeUtf8 expects a BufferSource, got ${e===null?`null`:typeof e}`);return t.decode(e)}export{n as a,i as b,a as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,i as t}from"./chunk-7HP2VYIC.js";var n=[`dependencies`,`devDependencies`,`optionalDependencies`];function r(n,r,i){let[a,o]=[`dependencies`,`optionalDependencies`].map(e=>i(n[e],t(r,e))),s=Object.keys(o).find(e=>e in a);if(s!==void 0)throw new e(`listed under dependencies too`,t(t(r,`optionalDependencies`),s));return{dependencies:a,optionalDependencies:o}}function i(e,t){let n=new Set,r=e=>{for(let t of Object.values(e))t.startsWith(`link:`)||n.add(t)};for(let t of e)r(t);for(let e of n)r(t[e].dependencies),r(t[e].optionalDependencies);return Object.keys(t).find(e=>!n.has(e))}function a(e,t,{required:n=[`dependencies`],dev:r=[`devDependencies`],optional:i=[`optionalDependencies`]}={}){let a=(n,r)=>{let i=new Set,a=t=>{for(let n of Object.values(t))n.startsWith(`link:`)||i.add(e[n])};for(let e of Object.values(t))for(let t of n)a(e[t]);for(let e of i)for(let t of r)a(e[t]);return i},o=a([...n,...i],[`dependencies`,`optionalDependencies`]),s=a([...n,...r],[`dependencies`]),c=a(n,[`dependencies`]);return e=>({dev:!o.has(e),optional:!s.has(e),devOptional:!c.has(e)})}export{n as a,r as b,i as c,a as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,h as t}from"./chunk-7HP2VYIC.js";function n(e,t){let[n,r,i,a]=[0,0,-1,0];for(;r<t.length;)if(e[n]===`*`)i=n++,a=r;else if(e[n]===`?`||e[n]===t[r])n++,r++;else{if(i===-1)return!1;n=i+1,r=++a}for(;e[n]===`*`;)n++;return n===e.length}function r(r,i){let a=r.split(`/`);if(a.length>30||a.some(e=>e===``||/[[\]{}()!+#\\]/u.test(e)))throw new e(`${t(r)} is a glob not read here`,i);return a.map(e=>{if(e===`**`)return null;let t=!e.startsWith(`.`)&&/[*?]/u.test(e),r=[...e];return e=>!(t&&e.startsWith(`.`))&&n(r,[...e])})}function i(e,t){let n=t;for(let t=0;t<e.length;t++)n&1<<t&&e[t]===null&&(n|=1<<t+1);return n}function a(e,t,n){let r=0;for(let i=0;i<e.length;i++)t&1<<i&&(e[i]===null?r|=n.startsWith(`.`)?0:1<<i:e[i](n)&&(r|=1<<i+1));return i(e,r)}var o=(e,t)=>!!(t&1<<e.length),s=(e,t)=>o(e,t.split(`/`).reduce((t,n)=>a(e,t,n),i(e,1)));export{r as a,i as b,a as c,o as d,s as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-OOJM4CTU.js";var e=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)])),t=(...e)=>e.flatMap(e=>Object.values(e)),n=e=>[...new Set(e)];function r(e){let t=Object.keys(e),n=t=>e[t].dependencies.filter(n=>n!==t&&Object.hasOwn(e,n)),r=[],i=new Set;for(let e of t){if(i.has(e))continue;i.add(e);let t=[[e,n(e).values()]];for(;t.length>0;){let[e,a]=t.at(-1),o=a.next();o.done?(r.push(e),t.pop()):i.has(o.value)||(i.add(o.value),t.push([o.value,n(o.value).values()]))}}let a=new Map(t.map(e=>[e,[]]));for(let e of t)for(let t of n(e))a.get(t).push(e);let o=new Map;for(let e of r.toReversed())if(!o.has(e)){o.set(e,e);for(let t=[e];t.length>0;)for(let n of a.get(t.pop()))o.has(n)||(o.set(n,e),t.push(n))}let s=new Set;for(let e of t)for(let t of n(e))o.get(t)!==o.get(e)&&s.add(o.get(t));return{".":{dependencies:t.filter(e=>!s.has(o.get(e)))}}}function i(e,t){let r=new Map(e.map(e=>[e,new Set]));for(let n=!0;n;){n=!1;for(let i of e)for(let{to:e,extras:a}of t(i,r.get(i)))for(let t of e)for(let e of a){let i=r.get(t);i&&!i.has(e)&&(i.add(e),n=!0)}}return new Map(e.map(e=>[e,n(t(e,r.get(e)).flatMap(e=>e.to)).filter(t=>t!==e)]))}function a(e){let t=new Set;return e.map((e,n)=>{let r=e.version===void 0?e.name:`${e.name}==${e.version}`,i=t.has(r)?`${r} (${n})`:r;return t.add(i),i})}var o=e=>e.toLowerCase().replaceAll(/[-_.]+/gu,`-`);function s(e){if(typeof e!=`string`)return null;try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)&&t.workspaces===void 0?t:null}catch{return null}}function c(e,t){if(typeof e!=`string`)return null;try{let r=JSON.parse(e);return n([r?.require,r?.[`require-dev`]].flatMap(e=>e&&typeof e==`object`&&!Array.isArray(e)?Object.keys(e):[]).flatMap(e=>t(e.toLowerCase())))}catch{return null}}var l={async npm(t){let{parseNpmLockfile:n}=await import(`./chunk-55YIWY3H.js`),r=e=>Object.values(e.edges).map(e=>e.target).filter(e=>e!==void 0),{importers:i,packages:a}=n(t,{checkVersions:!1});return{importers:e(i,e=>({version:e.version,dependencies:r(e)})),packages:e(a,e=>({name:e.name,version:e.version,dependencies:r(e)}))}},async pnpm(n,r,{env:i=!1}={}){let{parsePnpmLockfile:a}=await import(`./chunk-PKLVXUEI.js`),{lockfile:o,env:s}=a(n),c={importers:e(o?.importers??{},e=>({dependencies:t(e.dependencies,e.devDependencies,e.optionalDependencies)})),packages:e(o?.packages??{},e=>({name:e.name,version:e.version,dependencies:t(e.dependencies,e.optionalDependencies)}))};if(!i||!s)return c;let l=e=>`env:${e}`,u=s.importers?.[`.`]??{};c.importers[`.`]={...c.importers[`.`],dependencies:[...c.importers[`.`]?.dependencies??[],...t(u.configDependencies??{},u.packageManagerDependencies??{}).map(l)]};for(let[e,n]of Object.entries(s.packages??{}))c.packages[l(e)]={name:n.name,version:n.version,dependencies:t(n.dependencies??{},n.optionalDependencies??{}).map(l)};return c},async yarn(n,r){if(/^__metadata:/mu.test(n))throw Error(`a yarn.lock of Yarn 2 or later, which is not read`);let{parseYarn1Lockfile:i}=await import(`./chunk-B64CTMVU.js`),a=s(r),{importers:o,packages:c}=i(n,{checkVersions:!1,...a&&{manifests:{".":a}}}),l=new Map;for(let[e,t]of Object.entries(c))l.has(t)||l.set(t,e);let u=e=>e.startsWith(`link:`)?e:l.get(c[e]);return{importers:e(o??{},e=>({version:a.version,dependencies:t(e.dependencies,e.devDependencies,e.optionalDependencies).map(u)})),packages:Object.fromEntries([...l].map(([e,n])=>[n,{name:/@npm:((?:@[^/@]+\/)?[^/@]+)/u.exec(e.patterns[0]??``)?.[1]??e.name,version:e.version,dependencies:t(e.dependencies,e.optionalDependencies).map(u)}]))}},async bundler(t){let{parseGemfileLock:n}=await import(`./chunk-XM4RLC4A.js`),{specs:r,gems:i,dependencies:a}=n(t),o=e=>Object.hasOwn(i,e)?i[e]:[];return{importers:{".":{dependencies:Object.keys(a).flatMap(o)}},packages:e(r,e=>({name:e.name,version:e.platform===`ruby`?e.version:`${e.version}-${e.platform}`,dependencies:Object.keys(e.dependencies).flatMap(o)}))}},async cargo(e){let{parseCargoLock:t}=await import(`./chunk-RPNO56H2.js`),n=Object.entries(t(e).packages),r=n.filter(([,e])=>e.source===void 0),i=new Map;for(let[,e]of r)i.set(e.name,(i.get(e.name)??0)+1);let a=new Map(r.map(([e,t])=>[e,i.get(t.name)>1?e:t.name])),o=e=>a.has(e)?`link:${a.get(e)}`:e;return{importers:Object.fromEntries(r.map(([e,t])=>[a.get(e),{version:t.version,dependencies:t.dependencies.map(o)}])),packages:Object.fromEntries(n.filter(([e])=>!a.has(e)).map(([e,t])=>[e,{name:t.name,version:t.version,dependencies:t.dependencies.map(o)}]))}},async cocoapods(t){let{parsePodfileLock:r}=await import(`./chunk-BEKYZCPX.js`),{pods:i,dependencies:a}=await r(t),o=({name:e})=>Object.hasOwn(i,e)?[e]:[];return{importers:{".":{dependencies:n(a.flatMap(o))}},packages:e(i,e=>({name:e.root,version:e.version,dependencies:n(e.dependencies.flatMap(o))}))}},async composer(t,i){let{parseComposerLock:a}=await import(`./chunk-QD3IBSF4.js`),o=a(t).packages,s=e(o,e=>({name:e.name,version:e.version,dependencies:n(Object.values(e.require).flatMap(e=>e.targets))})),l=new Map;for(let[e,t]of Object.entries(o))for(let n of[...Object.keys(t.provide),...Object.keys(t.replace)])l.set(n,[...l.get(n)??[],e]);let u=c(i,e=>Object.hasOwn(s,e)?[e]:l.get(e)??[]);return{importers:u?{".":{dependencies:u}}:r(s),packages:s}},async poetry(e){let{parsePoetryLock:t}=await import(`./chunk-VHEXSGGP.js`),s=t(e).packages,c=a(s),l=Map.groupBy(c,(e,t)=>o(s[t].name)),u=new Map(c.map((e,t)=>[e,s[t]])),d=i(c,(e,t)=>{let r=u.get(e),i=new Set([...t].flatMap(e=>(r.extras[e]??[]).map(e=>o(/^[\w.-]+/u.exec(e)?.[0]??``))));return Object.entries(r.dependencies).filter(([e,t])=>t.some(e=>!e.optional)||i.has(o(e))).map(([e,t])=>({to:l.get(o(e))??[],extras:n(t.flatMap(e=>e.extras))}))}),f=Object.fromEntries(c.map((e,t)=>[e,{name:s[t].name,version:s[t].version,dependencies:d.get(e)}]));return{importers:r(f),packages:f}},async uv(e){let{parseUvLock:t}=await import(`./chunk-FSU2PLJL.js`),{packages:n,members:a}=t(e),o=new Map(a.map(e=>[e,n[e].source.path??e])),s=Object.keys(n),c=i(s,(e,t)=>{let r=n[e],i=o.has(e)?[...Object.values(r.optionalDependencies),...Object.values(r.devDependencies)].flat():[...t].flatMap(e=>r.optionalDependencies[e]??[]);return[...r.dependencies,...i].map(e=>({to:[e.package],extras:e.extras}))}),l=e=>o.has(e)?`link:${o.get(e)}`:e,u=Object.fromEntries(s.filter(e=>!o.has(e)).map(e=>[e,{name:n[e].name,version:n[e].version,dependencies:c.get(e).map(l)}])),d=Object.fromEntries(a.map(e=>[o.get(e),{version:n[e].version,dependencies:c.get(e).map(l)}]));return{importers:a.length>0?d:r(u),packages:u}},async pylock(e){let{parsePylock:t}=await import(`./chunk-LVSLM7HB.js`),i=t(e).packages,o=a(i),s=Object.fromEntries(o.map((e,t)=>[e,{name:i[t].name,version:i[t].version,dependencies:n(i[t].dependencies.map(e=>o[e]))}]));return{importers:r(s),packages:s}},async soldeer(e){let{parseSoldeerLockfile:t}=await import(`./chunk-6Y6PZ2BU.js`),n=Object.fromEntries(Object.values(t(e).dependencies).map(e=>[`${e.name}@${e.version}`,{name:e.name,version:e.version,dependencies:[]}]));return{importers:{".":{dependencies:Object.keys(n)}},packages:n}},async foundry(e){let{parseFoundryLockfile:t}=await import(`./chunk-EEJA7JBI.js`),n=Object.fromEntries(Object.entries(t(e).dependencies).map(([e,t])=>[e,{name:e.slice(e.lastIndexOf(`/`)+1),version:t.type===`tag`?t.name:t.type===`branch`?`${t.name}@${t.rev.slice(0,7)}`:t.rev.slice(0,12),dependencies:[]}]));return{importers:{".":{dependencies:Object.keys(n)}},packages:n}}};async function u(e,t,{manifest:n,env:r=!1}={}){if(!Object.hasOwn(l,e))throw TypeError(`readLockfile: ${e} lockfiles are not read`);return await l[e](t,n,{env:r})}export{u as readLockfile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,c as t,f as n,g as r,h as i,i as a,j as o,m as s,o as c,p as l,q as u,r as d}from"./chunk-CU3FPB3P.js";import{a as f,c as p,d as m,e as h,f as g,g as _,i as v,j as y,k as b,l as x,m as S,n as C,o as w,p as T}from"./chunk-GX5UXWT4.js";import{B as E,H as D,I as O,M as k,m as A,t as j}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{a as M,e as ee,g as N}from"./chunk-VYYUMYVW.js";import{d as P,h as F,i as I}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var L=Object.fromEntries([`md5`,`sha1`,`sha224`,`sha256`,`sha384`,`sha512`].map(e=>[e,s[e]]));function R(e,t){let n=URL.parse(k(v(e,t),t));if(!/^[\w.-]+@[\w.-]+:./u.test(e)&&(n===null||![`https:`,`http:`,`ssh:`,`git:`,`file:`].includes(n.protocol)))throw new P(`${F(e)} is not a repository URL`,t);return e}var z={version:[`version`],path:[`path`,`develop`],url:[`url`],git:[`git`,`branch`,`tag`,`rev`,`subdirectory`]},B=Object.keys(z),V=new Set([`extras`,`optional`,`markers`]),H=[...new Set(Object.values(z).flat()),...V];function U(e,t,n){let r=I(n,e);if(e===`version`)return{version:v(t.version,r)};if(e===`path`)return{path:u(t.path,r),develop:A(t,`develop`,n,_)??!1};if(e===`url`)return{url:l(t.url,r)};let i=[`branch`,`tag`,`rev`].filter(e=>t[e]!==void 0);if(i.length>1)throw new P(`${i.join(` and `)}, of which Poetry writes one`,n);return{git:R(t.git,r),reference:i.length===0?void 0:{kind:i[0],name:v(t[i[0]],I(n,i[0]))},subdirectory:A(t,`subdirectory`,n,d)}}function W(e,t){if(typeof e==`string`)return{type:`version`,version:v(e,t),extras:[],optional:!1,markers:void 0};p(e,t,H);let n=w(e,B,t),r=H.find(t=>e[t]!==void 0&&!z[n].includes(t)&&!V.has(t));if(r!==void 0)throw new P(`a field Poetry does not write for a ${n} dependency`,I(t,r));return{type:n,...U(n,e,t),extras:A(e,`extras`,t,x(i))??[],optional:A(e,`optional`,t,_)??!1,markers:A(e,`markers`,t,a)}}function G(e,t){let i=Object.create(null);if(e===void 0)return i;let a=new Map;for(let[o,s,c]of m(e,t)){let e=n(r(o,c));if(a.has(e))throw new P(`${F(o)} and ${F(a.get(e))} are one name`,c);if(a.set(e,o),Array.isArray(s)&&s.length===0)throw new P(`an empty array, where Poetry writes a constraint`,c);i[o]=Array.isArray(s)?b(W)(s,c):[W(s,c)]}return i}function K(e,t){let n=new Set;return b((e,t)=>{p(e,t,[`file`,`hash`]);let r=v(e.file,I(t,`file`));if(!E(r)||r.includes(`/`))throw new P(`${F(r)} is not a file's name`,I(t,`file`));if(n.has(r))throw new P(`${F(r)} is listed twice`,t);return n.add(r),{file:r,hash:c(e.hash,I(t,`hash`),L)}})(e,t)}var q=(e,t)=>C(e,t,i,x(o)),J={legacy:[`url`,`reference`],git:[`url`,`reference`,`resolved_reference`,`subdirectory`],url:[`url`,`subdirectory`],file:[`url`],directory:[`url`]},Y=y(D,`a full commit hash, as Poetry writes`);function X(e,t){let n=g(p(e,t).type,I(t,`type`));if(!Object.hasOwn(J,n))throw new P(`expected one of ${Object.keys(J).join(`, `)}`,I(t,`type`));p(e,t,[`type`,...J[n]]);let r=I(t,`url`),i=A(e,`subdirectory`,t,d);return n===`legacy`?{type:n,url:l(e.url,r),name:v(e.reference,I(t,`reference`))}:n===`url`?{type:n,url:l(e.url,r),subdirectory:i}:n===`file`||n===`directory`?{type:n,path:u(e.url,r)}:{type:n,url:R(e.url,r),reference:A(e,`reference`,t,v),commit:Y(e.resolved_reference,I(t,`resolved_reference`)),subdirectory:i}}var Z=[`package`,`extras`,`metadata`],Q=[`name`,`version`,`description`,`optional`,`python-versions`,`files`,`dependencies`,`extras`,`source`,`develop`],te=[...Q,`groups`,`markers`],ne={category:"`category` is lock-version 1, which Poetry 1.4 and older write and is not read here"};function $(e,t){if(e===`2.0`||e===`2.1`)return e;throw typeof e==`string`&&/^1\.\d+$/u.test(e)?new P(`lock-version ${e} is Poetry 1.4's or older, which is not read here`,t):new P(`unsupported lock-version: expected "2.0" or "2.1", found ${f(e)}`,t)}function re(e){p(e,`metadata`,[`lock-version`,`python-versions`,`content-hash`],{files:`metadata.files is lock-version 1, which is not read here`,hashes:`metadata.hashes is lock-version 1, which is not read here`});let t=e=>I(`metadata`,e),n=y(O,`a hex sha256`)(e[`content-hash`],t(`content-hash`));return{lockVersion:$(e[`lock-version`],t(`lock-version`)),pythonVersions:v(e[`python-versions`],t(`python-versions`)),contentHash:n}}function ie(e,t,n){let r=typeof e==`string`?a(e,n):void 0,i=Object.create(null);for(let e of t)i[e]=r;if(e===void 0||r!==void 0)return i;for(let[t,r,o]of m(e,n)){if(!Object.hasOwn(i,t))throw new P(`${F(t)} is not one of the package's groups`,o);i[t]=a(r,o)}return i}function ae(e,t){let n=S(e,t,i);if(n.length===0)throw new P(`expected a group at least`,t);let r=j(n);if(r!==void 0)throw new P(`${F(r)} is listed twice`,t);return n}function oe(e,n,i){p(e,n,i===`2.1`?te:Q,ne);let a=A(e,`source`,n,X),o=a?.type===`directory`||a?.type===`git`;if(o&&e.develop===void 0)throw new P(`expected develop, which Poetry writes of a directory or a git source`,n);if(!o&&e.develop!==void 0)throw new P(`develop, which Poetry writes of a directory or a git source alone`,I(n,`develop`));let s=i===`2.1`?ae(e.groups,I(n,`groups`)):void 0;return{name:r(e.name,I(n,`name`)),version:t(e.version,I(n,`version`)),description:A(e,`description`,n,g)??``,optional:_(e.optional,I(n,`optional`)),pythonVersions:v(e[`python-versions`],I(n,`python-versions`)),groups:s,markers:s===void 0?void 0:ie(e.markers,s,I(n,`markers`)),files:K(e.files,I(n,`files`)),dependencies:G(e.dependencies,I(n,`dependencies`)),extras:q(e.extras,I(n,`extras`)),source:a,develop:A(e,`develop`,n,_)}}function se(e,t){return C(e,`extras`,i,x((e,i)=>{if(!t.has(n(r(e,i))))throw new P(`${F(e)} names no package in the lockfile`,i);return e}))}var ce=t=>JSON.stringify([n(t.name),e(t.version),t.source??null]);function le(e){let t=p(N(e),void 0,Z);if(!ee(t.metadata))throw new P(`expected a [metadata] table, which Poetry requires`,`metadata`);let{lockVersion:r,pythonVersions:i,contentHash:a}=re(t.metadata),o=h(t.package??[],`package`).map((e,t)=>oe(e,`package[${t}]`,r));return T(o,ce,e=>`${e.name} ${e.version}`),{lockVersion:r,pythonVersions:i,contentHash:a,extras:se(t.extras,new Set(o.map(e=>n(e.name)))),packages:o}}export{P as LockfileError,M as TomlError,le as parsePoetryLock};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as e,b as t,c as n,n as r}from"./chunk-7HP2VYIC.js";var i=class extends n{};function a(e,t,n){if(!e)throw new i(typeof n==`function`?n():n,t.line)}var o=/^(\d{4})-(\d\d)-(\d\d)([Tt])(\d\d):(\d\d):(\d\d)(\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))$/u,s=/^(?:\d{4}-\d\d-\d\d(?:[Tt]\d\d:\d\d:\d\d(?:\.\d+)?)?|\d\d:\d\d:\d\d(?:\.\d+)?)$/u,c=/^(?:\d{4}-\d\d-\d\d[Tt])?\d\d:\d\d(?:[Zz]|[+-]\d\d:\d\d)?$/u,l=[31,28,31,30,31,30,31,31,30,31,30,31];function u(e){let t=o.exec(e);if(t===null)return;let[n,r,i,a,s,c]=[t[1],t[2],t[3],t[5],t[6],t[7]].map(Number),u=n%4==0&&n%100!=0||n%400==0;if(r<1||r>12||i<1||i>(r===2&&u?29:l[r-1])||a>23||s>59||c>60||t[10]!==void 0&&(Number(t[11])>23||Number(t[12])>59))return;let d=[];(t[4]===`t`||t[9]===`z`)&&d.push(`a date-time with a lower-case "t" or "z" is not supported`),n===0&&d.push(`the year 0000 is not supported`),c===60&&d.push(`a leap second is not supported`);let f=t[10]===void 0?0:(t[10]===`-`?-1:1)*(Number(t[11])*60+Number(t[12]));return{year:n,month:r,day:i,hour:a,minute:s,second:c,fraction:t[8]?.slice(1)??``,offset:f,unsupported:d}}var d=class{constructor(e){if(typeof e!=`string`||u(e)?.unsupported.length!==0)throw TypeError(`expected an RFC 3339 offset date-time`);this.text=e,Object.freeze(this)}toString(){return this.text}toJSON(){return this.text}toDate(){let{year:e,month:t,day:n,hour:r,minute:i,second:a,fraction:o,offset:s}=u(this.text),c=new Date(0);return c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,i-s,a,Number(o.padEnd(3,`0`).slice(0,3))),c}},f=e=>u(e)?.unsupported.length===0;function ee(e,n){if(!/^(?:\d{4}-\d\d-\d\d|\d\d:\d\d)/u.test(e))return;let r=u(e);if(r?.unsupported.length===0)return new d(e);throw a(!(/^\d{4}-\d\d-\d\d$/u.test(e)&&/^ \d\d:/u.test(n.text.slice(n.pos,n.pos+4))),n,`a date-time with a space in place of "T" is not supported`),a(!s.test(e),n,()=>`local dates and times are not supported: ${t(e)}`),a(!c.test(e),n,()=>`a date-time or a time without seconds is not supported: ${t(e)}`),a(r?.unsupported.length!==1,n,()=>`${r.unsupported[0]}: ${t(e)}`),new i(`${t(e)} is not a date-time of the form YYYY-MM-DDTHH:MM:SS[.fraction](Z|\xB1HH:MM)`,n.line)}var p=/^[+-]?(?:0|[1-9](?:_?\d)*)$/u,m=/^0(?:x[\dA-Fa-f](?:_?[\dA-Fa-f])*|o[0-7](?:_?[0-7])*|b[01](?:_?[01])*)$/u,h=/^[+-]?(?:inf|nan|(?:0|[1-9](?:_?\d)*)(?:\.\d(?:_?\d)*(?:[Ee][+-]?\d(?:_?\d)*)?|[Ee][+-]?\d(?:_?\d)*))$/u,g=2n**63n,_=BigInt(2**53-1),te={__proto__:null,x:16,o:21,b:63};function v(e,n){let r=p.test(e);if(!r&&!m.test(e))return;let i=e.replaceAll(`_`,``),o=r?i.replace(/^[+-]/u,``):i.slice(2).replace(/^0+/u,``),s=o.length<=(r?19:te[i[1]])?BigInt(r?i:`${i.slice(0,2)}${o||`0`}`):void 0;return a(s!==void 0&&s>=-g&&s<g,n,()=>`integer out of range ${t(e)}`),s>=-_&&s<=_?Number(s):s}var y={__proto__:null,inf:1/0,"+inf":1/0,"-inf":-1/0,nan:NaN,"+nan":NaN,"-nan":NaN};function b(e){if(typeof e!=`string`||!h.test(e))return;if(e in y)return y[e];let t=Number(e.replaceAll(`_`,``)),n=!/[1-9]/u.test(e.split(/[Ee]/u)[0]);return Number.isFinite(t)&&(t!==0||n)?t:null}var x=class{constructor(e){let t=b(e);if(t==null)throw TypeError(`expected a TOML float that a double can hold`);this.text=e,this.value=t,Object.freeze(this)}valueOf(){return this.value}toString(){return this.text}toJSON(){return this.value}};function S(e,n){let r=b(e);if(r!==void 0)return a(r!==null,n,()=>`float out of range ${t(e)}`),new x(e)}var C=64;function w(e){for(;e.text[e.pos]===` `||e.text[e.pos]===` `;)e.pos++}function T(e){if(e.pos>=e.text.length)return`the end of the text`;let n=/^[^\n]*/u.exec(e.text.slice(e.pos,e.pos+64+1))[0].replace(/\r$/u,``);return n===``?`the end of the line`:t(n)}var E=`a carriage return must be followed by a line feed`;function D(t,n,r){throw new i(n===`\r`?E:`${e(n)} is not allowed in ${r}`,t.line)}var O=e=>e.pos>=e.text.length||e.text[e.pos]===`
|
|
2
|
+
`||e.text.startsWith(`\r
|
|
3
|
+
`,e.pos),k=/#[^[\p{Cc}--[\t\u0080-\u009F]]]*/vy;function A(e){e.text[e.pos]===`#`&&(r(e,k),O(e)||D(e,e.text[e.pos],`a comment`))}function j(e){if(e.text[e.pos]===`
|
|
4
|
+
`)e.pos+=1;else if(e.text.startsWith(`\r
|
|
5
|
+
`,e.pos))e.pos+=2;else return!1;return e.line++,!0}function M(e){do w(e),A(e);while(j(e))}var N={__proto__:null,b:`\b`,t:` `,n:`
|
|
6
|
+
`,f:`\f`,r:`\r`,'"':`"`,"\\":`\\`},ne={__proto__:null,'"':/[^"\\[\p{Cc}--[\t\u0080-\u009F]]]*/vy,"'":/[^'[\p{Cc}--[\t\u0080-\u009F]]]*/vy},re=/u([\dA-Fa-f]{4})|U([\dA-Fa-f]{8})/uy;function P(e){let n=e.text[e.pos];if(n in N)return N[e.text[e.pos++]];let i=r(e,re);a(i!==null,e,()=>`unsupported escape ${t(`\\${n??``}`)}`);let o=Number.parseInt(i[1]??i[2],16);return a(o<=1114111&&(o<55296||o>57343),e,()=>`\\${i[0]} is not a Unicode scalar value`),String.fromCodePoint(o)}var ie=/[\t ]*\r?\n(?:[\t ]|\r?\n)*/uy;function ae(e){let t=r(e,ie);return t===null?P(e):(e.line+=t[0].split(`
|
|
7
|
+
`).length-1,``)}var F=(e,t)=>e.text[e.pos+1]===t&&e.text[e.pos+2]===t,I={__proto__:null,'"':/"/uy,"'":/'/uy,'"""':/"{3,5}/uy,"'''":/'{3,5}/uy};function L(e,t){let n=F(e,t),i=I[n?t.repeat(3):t];e.pos+=n?3:1,n&&j(e);let o=``;for(;;){if(o+=r(e,ne[t])[0],n&&j(e)){o+=`
|
|
8
|
+
`;continue}a(!O(e),e,`unterminated string`);let s=r(e,i);if(s!==null)return o+s[0].slice(3);let c=e.text[e.pos++];c===t?o+=c:c===`\\`?o+=n?ae(e):P(e):D(e,c,`a string`)}}var R=/[\w-]+/uy;function z(e){let t=e.text[e.pos];if(t===`"`||t===`'`)return a(!F(e,t),e,`a multi-line string cannot be a key`),L(e,t);let n=r(e,R);return a(n!==null,e,()=>`expected a key, found ${T(e)}`),n[0]}function B(e){let t=[z(e)];for(;;){if(w(e),e.text[e.pos]!==`.`)return t;e.pos++,w(e),t.push(z(e)),a(t.length<=C,e,`a key with too many parts`)}}var V=/[\w+.:-]+/uy;function H(e){let n=r(e,V);a(n!==null,e,()=>`expected a value, found ${T(e)}`);let i=n[0];if(i===`true`)return!0;if(i===`false`)return!1;let o=v(i,e)??S(i,e)??ee(i,e);return a(o!==void 0,e,()=>`expected a value, found ${t(i)}`),o}function U(e,n,r,i){a(n[r]===void 0,e,()=>`duplicate key ${t(r)}`),n[r]=i}function W(e,t){let n=B(e);return a(e.text[e.pos]===`=`,e,()=>`expected "=" after the key, found ${T(e)}`),e.pos++,w(e),{header:!1,keys:n,value:X(e,t)}}function G(e,t){e.pos++;let n=[];for(M(e);e.text[e.pos]!==`]`&&(n.push(X(e,t+1)),M(e),e.text[e.pos]!==`]`);M(e))a(e.text[e.pos]===`,`,e,()=>`expected "," or "]", found ${T(e)}`),e.pos++;return e.pos++,n}var K=e=>typeof e==`object`&&!!e&&Object.getPrototypeOf(e)===null,q=new WeakSet,oe=e=>q.has(e);function J(e,t,n,r,i,o){let s=t;for(let t of r.slice(0,-1)){t in s||n.add(s[t]=Object.create(null));let r=s[t];a(n.has(r),e,()=>o(t,r)),s=r}U(e,s,r.at(-1),i)}var se=e=>Array.isArray(e)?`an array`:K(e)?`an inline table`:`a value`,ce=(e,n)=>`${t(e)} is ${se(n)}, which a dotted key cannot add to`;function Y(e){w(e),a(!O(e)&&e.text[e.pos]!==`#`,e,`an inline table across lines is not supported`)}function le(e,t){e.pos++;let n=Object.create(null);q.add(n);let r=new Set;if(Y(e),e.text[e.pos]===`}`)e.pos++;else do{Y(e),a(e.text[e.pos]!==`}`,e,`a trailing comma in an inline table is not supported`);let{keys:i,value:o}=W(e,t+1);J(e,n,r,i,o,ce),Y(e);let s=e.text[e.pos];a(s===`,`||s===`}`,e,()=>`expected "," or "}" on the inline table's line, found ${T(e)}`)}while(e.text[e.pos++]===`,`);return n}function X(e,t){a(t<=C,e,`nested too deep`);let n=e.text[e.pos];return n===`"`||n===`'`?L(e,n):n===`[`?G(e,t):n===`{`?le(e,t):H(e)}function ue(e){let t=e.text.startsWith(`[[`,e.pos);e.pos+=t?2:1,w(e);let n=B(e),r=t?`]]`:`]`;return a(e.text.startsWith(r,e.pos),e,()=>`expected "${r}", found ${T(e)}`),e.pos+=r.length,{header:!0,keys:n,array:t}}function de(e){w(e);let t=e.text[e.pos];if(t===`[`)return ue(e);if(!(t===`#`||t===`\r`||O(e)))return W(e,0)}function fe(e){if(w(e),A(e),!(j(e)||e.pos===e.text.length))throw a(e.text[e.pos]!==`\r`,e,E),new i(`expected the end of the line, found ${T(e)}`,e.line)}function Z(e,t){return e.arrays.has(t)?`an array of tables`:Array.isArray(t)?`an array`:K(t)?e.fixed.has(t)?`an inline table`:`a table`:`a value`}var Q=e=>t(e.join(`.`));function pe(e,n,r){let i=e.root;for(let o of r){o in i||e.implicit.add(i[o]=Object.create(null));let r=e.arrays.has(i[o])?i[o].at(-1):i[o];a(K(r)&&!e.fixed.has(r),n,()=>`${t(o)} is ${Z(e,r)}, which a header cannot add to`),i=r}return i}function $(e,t,n,r){e.pending.clear();let i=pe(e,t,n.slice(0,-1)),o=n.at(-1);r?(o in i||e.arrays.add(i[o]=[]),a(e.arrays.has(i[o]),t,()=>`${Q(n)} is ${Z(e,i[o])}, not an array of tables`),i[o].push(e.current=Object.create(null))):(o in i?a(e.implicit.delete(i[o]),t,()=>`${Q(n)} is ${Z(e,i[o])} already`):i[o]=Object.create(null),e.current=i[o])}function me(e,n,r){return!K(r)||e.fixed.has(r)?`${t(n)} is ${Z(e,r)}, which a dotted key cannot add to`:e.implicit.has(r)?`a dotted key through ${t(n)}, a table a header made on its way, is not supported`:`${t(n)} is a table declared elsewhere, which a dotted key cannot add to`}function he(e,t,n,r){J(t,e.current,e.pending,n,r,(t,n)=>me(e,t,n)),K(r)&&e.fixed.add(r)}var ge={__proto__:null,"":`a byte order mark is not read`,"�":`U+FFFD is not supported: a decoder puts it where bytes are not UTF-8`};function _e(e){if(typeof e!=`string`)throw TypeError(`expected a string`);let t=/\p{Cs}|^\uFEFF|\uFFFD/u.exec(e);if(t===null)return;let n=e.slice(0,t.index).split(`
|
|
9
|
+
`).length-1;throw new i(ge[t[0]]??`a lone surrogate is not well-formed Unicode`,n)}function ve(e){_e(e);let t=Object.create(null),n={text:e,pos:0,line:0},r={root:t,current:t,implicit:new Set,pending:new Set,arrays:new Set,fixed:new Set};for(;n.pos<e.length;){let e=de(n);e?.header===!0?$(r,n,e.keys,e.array):e!==void 0&&he(r,n,e.keys,e.value),fe(n)}return t}export{i as a,d as b,f as c,x as d,K as e,oe as f,ve as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-GO7FT4OD.js";import{b as t,c as n,d as r,e as i}from"./chunk-PTFYDJUP.js";import{c as a,d as o,f as s,i as c,j as l,k as u,m as d,o as f}from"./chunk-MV66NL3G.js";import"./chunk-N57OWFKY.js";import{a as p}from"./chunk-7YFJUT2P.js";import"./chunk-PXK7EU4V.js";import{m,q as h,s as g,w as _}from"./chunk-5M2X3QPK.js";import"./chunk-DUASGS2O.js";import{b as v}from"./chunk-IYPY47MC.js";import"./chunk-QRKFPLA4.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function y(e){if(e instanceof Uint8Array)return{proven:!1,reason:`unsupported`,at:null};if(typeof e!=`string`)throw TypeError(`a text must be a string or its UTF-8 bytes, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a text must be a well-formed string`);return{proven:!1,reason:`unsupported`,at:null}}var b=e=>e.subarray(0,8e3).includes(0),x=(e,t)=>(e+Math.imul(t,97)>>>0)%107927,S=e=>Uint8Array.from({length:256},(t,n)=>Number(n===10||e.includes(String.fromCodePoint(n)))),C=S(``),w=S(`,;={}`);function T(e,t=C){let n=!b(e),r=new Map,i=(e,t)=>r.set(e,(r.get(e)??0)+t),a=0,o=0,s=0;for(let r=0;r<e.length;r++){let c=e[r];if(n&&c===13&&e[r+1]===10)continue;let l=a;a=(a<<7^o>>>25)+c>>>0,o=(o<<7^l>>>25)>>>0,!(++s<64&&t[c]===0)&&(i(x(a,o),s),s=0,a=0,o=0)}s>0&&i(x(a,o),s);let c=Uint32Array.from(r.keys()).sort();return{hashes:c,bytes:Float64Array.from(c,e=>r.get(e)),total:r.values().reduce((e,t)=>e+t,0)}}function E(e,t){let n=0;for(let r=0,i=0;r<e.hashes.length&&i<t.hashes.length;)e.hashes[r]<t.hashes[i]?r++:e.hashes[r]>t.hashes[i]?i++:n+=Math.min(e.bytes[r++],t.bytes[i++]);return n}function D(e,t,n){let r=0,i=e.total,a=t.total;for(let o=0,s=0;o<e.hashes.length&&s<t.hashes.length;)if(e.hashes[o]<t.hashes[s]?i-=e.bytes[o++]:(e.hashes[o]>t.hashes[s]||(r+=Math.min(e.bytes[o],t.bytes[s]),i-=e.bytes[o++]),a-=t.bytes[s++]),(r+Math.min(i,a))*6e4<n)return 0;return r}function O(e,t,n,r,i=!1){if(e===null||t===null||t.length===0)return 0;let a=Math.abs(e.length-t.length),o=Math.max(e.length,t.length);if(o*(6e4-n)<a*6e4)return 0;let s=r(e),c=r(t),l=i?D(s,c,n*o):E(s,c);return Math.trunc(l*6e4/o)}var k=/^[\w-]{6,}$/u,A=/[\dA-Z]/u,ee=/^(?:\.[\w-]+)+$/u,te=/^[\w-]{8,32}$/u;function j(e){let t=[];for(let n=e.length-1;n>0;n--){if(e[n]!==`-`&&e[n]!==`.`)continue;let r=e.indexOf(`.`,n+1),i=e.slice(r),a=e.slice(n+1,r);r!==-1&&te.test(a)&&ee.test(i)&&/[A-Za-z]/u.test(a)&&A.test(a)&&t.push([e.slice(0,n),a,i])}return t}var M=e=>e.replaceAll(/\d/gu,`0`).replaceAll(/[a-z]/gu,`a`).replaceAll(/[A-Z]/gu,`A`);function ne(e,t){let n=j(t);for(let[t,r,i]of j(e)){let e=n.find(e=>e[2]===i);if(e&&e[1]!==r)return e[0]===t&&M(e[1])!==M(r)}return!1}function re(e){let t=e.lastIndexOf(`/`),n=e.slice(t+1),r=n.lastIndexOf(`.`),i=r>0?n.slice(r):``;return{name:n,key:`${e.slice(0,t+1)}\0${i}\0${n.length}`}}function ie(e,t){let n=e.length,r=0;for(;r<e.length&&e[r]===t[r];)r++;for(;n>r&&e[n-1]===t[n-1];)n--;for(;r>0&&!`-._`.includes(e[r-1]);)r--;for(;n<e.length&&e[n]!==`.`;)n++;let i=e.slice(r,n),a=t.slice(r,n);return r>0&&k.test(i)&&k.test(a)&&(A.test(i)||A.test(a))}function ae({sources:e,dests:t,pairs:n,used:r,record:i,punctuatedScoreOf:a},{remaining:o,open:s},c,l){let u=(e,t)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>[t,re(e[t].path)])),d=u(t,s),f=u(e,o),p=Map.groupBy(f.keys(),e=>f.get(e).key),m=Map.groupBy(d.keys(),e=>d.get(e).key),h=[];for(let[e,t]of m){let n=p.get(e)??[];for(let e of t)for(let t of n)ie(f.get(t).name,d.get(e).name)&&h.push({s:t,d:e})}let g=Map.groupBy(h,({d:e})=>e),_=Map.groupBy(h,({s:e})=>e),v=[];for(let{s:e,d:t}of h){let n=_.get(e).length===1&&g.get(t).length===1&&ne(f.get(e).name,d.get(t).name),r=a(e,t,n?0:c);(n||r>=c)&&v.push({s:e,d:t,score:r})}let y=[],b=new Set,x=new Set;for(let e of v.sort((e,t)=>t.score-e.score))n.has(e.d)||r.has(e.s)||(x.has(e.s)||b.has(e.d)||l(e)?(y.push(e),x.add(e.s),b.add(e.d)):i(e.d,e.s,e.score));return y}function oe(e,t){let n=e.length;if(n!==t.length)return!1;let r=0;if(n>=32&&(e.byteOffset&3)==(t.byteOffset&3)){for(let n=4-(e.byteOffset&3)&3;r<n;r++)if(e[r]!==t[r])return!1;let i=n-r>>>2,a=new Int32Array(e.buffer,e.byteOffset+r,i),o=new Int32Array(t.buffer,t.byteOffset+r,i);for(let e=0;e<i;e++)if(a[e]!==o[e])return!1;r+=i*4}for(;r<n;r++)if(e[r]!==t[r])return!1;return!0}var N=class extends Error{constructor(e,t,n){let r=n===void 0?``:` in the ${n} tree`;super(t===void 0?e:`${e}: ${JSON.stringify(t)}${r}`),this.name=`CompareError`,this.path=t,this.tree=n}},se=new Set([`file`,`contiguous-file`]),ce=new Set([`fifo`,`character-device`,`block-device`]),le=/(?:^|\/)\.{0,2}(?:\/|$)/u;function ue(e){if(!Number.isInteger(e)||e<0||e>4095)throw RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function de(e,t,n,r){if(typeof e!=`string`)throw TypeError(`an entry's name must be a string, not ${typeof e}`);if(e!==`.`||t!==`directory`){if(r?e===``:le.test(e))throw new N(r?`a name must not be empty`:"a name must be a relative path with no empty, `.` or `..` segment",e,n);if(!e.isWellFormed())throw new N(`a name must be well-formed Unicode`,e,n)}}function fe(e,t,n){if(typeof e!=`string`||e===``)throw new N(`a link must name its target`,t,n);if(!e.isWellFormed())throw new N(`a link target must be well-formed Unicode`,t,n);return e}function pe(e){if(e===void 0)return new Uint8Array;if(e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`a file's data must be a string or a Uint8Array, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a file's text must be well-formed Unicode`);return e}var P=e=>typeof e==`string`?p(e):e;function me(e,t,n){if(typeof e!=`object`||!e)throw TypeError(`an entry must be an object, not ${e===null?`null`:typeof e}`);let{name:r,type:i=`file`,mode:a,linkname:o,data:s}=e;if(de(r,i,t,n),a!==void 0&&ue(a),se.has(i))return{path:r,type:`file`,mode:a??420,data:pe(s)};if(i===`symlink`||i===`hardlink`)return{path:r,type:i,target:fe(o,r,t)};if(i===`directory`)return{path:r,type:i};throw ce.has(i)?new N(`a ${i} is neither a file nor a link`,r,t):TypeError(`${JSON.stringify(i)} is not an entry type`)}function F(e,t){return e.type===t.type?e.type===`symlink`?e.target===t.target:e.data===t.data?!0:typeof e.data==`string`&&typeof t.data==`string`?!1:oe(P(e.data),P(t.data)):!1}function he(e,t,n){let r=new Set([e.path]),i=t.get(e.target);for(;i?.type===`hardlink`;){if(r.has(i.path))throw new N(`a hard link leads back to itself`,e.path,n);r.add(i.path),i=t.get(i.target)}if(i===void 0||i.type===`directory`)throw new N(`a hard link must name a file or a link in the tree`,e.path,n);return{...i,path:e.path}}function I(e,t,n){let r=new Map;for(let i of e){let e=me(i,t,n);if(e.type!==`directory`||e.path!==`.`){if(r.has(e.path))throw new N(`a name is given twice`,e.path,t);r.set(e.path,e)}}let i=new Map;for(let[e,a]of r){for(let i=n?-1:e.lastIndexOf(`/`);i>0;i=e.lastIndexOf(`/`,i-1)){let n=r.get(e.slice(0,i));if(n!==void 0&&n.type!==`directory`)throw new N(`a path lies under a ${n.type===`symlink`?`link`:`file`}`,e,t)}a.type===`hardlink`?i.set(e,he(a,r,t)):a.type!==`directory`&&i.set(e,a)}return i}var ge=100,_e=4,L=e=>e.slice(e.lastIndexOf(`/`)+1);function R(t,n){if(t.type===`symlink`)return`l${t.target}`;let r=n(t);return`f${r.length}:${e(r)}`}function ve({sources:e,dests:t,sourceNames:n,destNames:r,used:i,record:a,bytes:o}){let s=Map.groupBy(e.keys(),t=>R(e[t],o));for(let c=0;c<t.length;c++){let l=-1,u=ge;for(let a of s.get(R(t[c],o))??[])if(!i.has(a)&&F(e[a],t[c])&&((l===-1||n[a]===r[c])&&(l=a),n[a]===r[c]||--u===0))break;l!==-1&&a(c,l,6e4)}}var ye=new Map([[`.ts`,`.js`],[`.mts`,`.mjs`],[`.cts`,`.cjs`],[`.tsx`,`.jsx`]]),be=new Map([...[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.mts`,`.cts`,`.tsx`].map(e=>[e,`script`]),...[`.css`,`.scss`,`.sass`,`.less`].map(e=>[e,`style`])]);function z(e){let t=e.split(`/`),n=t.pop(),r=n.lastIndexOf(`.`);return r>0?{dirs:t,stem:n.slice(0,r),extension:n.slice(r)}:{dirs:t,stem:n,extension:``}}function B(e){let{dirs:t,stem:n,extension:r}=z(e);return JSON.stringify([t.map(e=>e===`lib`||e===`src`?null:e),n,ye.get(r)??r])}function xe(e){let{dirs:t,stem:n,extension:r}=z(e),i=[n,be.get(r)??r],a=t.lastIndexOf(`node_modules`),o=a===-1?0:a+(t[a+1]?.startsWith(`@`)?3:2),s=[JSON.stringify([...i,t])];for(let e=o;e<t.length;e++)s.push(JSON.stringify([...i,t.toSpliced(e,1,null)]));return s}var V=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function H({pairs:e,used:t,scoreOf:n},{remaining:r,open:i},{s:a,d:o,score:s},c){let l=V(s,c);return i.some(t=>t!==o&&!e.has(t)&&n(a,t,l)>=l)||r.some(e=>e!==a&&!t.has(e)&&n(e,o,l)>=l)}function Se(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=Map.groupBy(t.remaining.filter(e=>i[e].type===`file`),e=>B(i[e].path)),d=t.open.filter(e=>a[e].type===`file`).flatMap(e=>(u.get(B(a[e].path))??[]).map(t=>({s:t,d:e,score:l(t,e,0)})));for(let i of d.sort((e,t)=>t.score-e.score))o.has(i.d)||s.has(i.s)||n&&H(e,t,i,r)||c(i.d,i.s,i.score)}function Ce(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=new Map,d=(e,t,n)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>{let r=xe(e[t].path);for(let e of r)(u.get(e)??u.set(e,{sources:[],dests:[]}).get(e))[n].push(t);return[t,r]})),f=d(a,t.open.filter(e=>!o.has(e)),`dests`),p=d(i,t.remaining.filter(e=>!s.has(e)),`sources`),m=(e,t)=>{let n=new Set(e.flatMap(e=>u.get(e)[t]));return n.size===1?[...n][0]:-1};for(let[i,a]of p){let o=m(a,`dests`);if(o===-1||m(f.get(o),`sources`)!==i)continue;let s={s:i,d:o,score:l(i,o,0)};n&&H(e,t,s,r)||c(o,i,s.score)}}function we(e,t,n){let r=G(e),i=t<6e4&&r.remaining.length*r.open.length<=n*n;Se(e,r,i,t),Ce(e,r,i,t)}function U(e,t){let n=new Map;for(let r of t)n.set(e[r],n.has(e[r])?-1:r);return n}function Te({sourceNames:e,destNames:t,record:n,scoreOf:r},{remaining:i,open:a},o){let s=U(t,a),c=U(e,i);for(let t of i){let i=s.get(e[t]);if(i===void 0||i===-1||c.get(e[t])===-1)continue;let a=r(t,i,o);a>=o&&n(i,t,a)}}var W=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function Ee(e,t){if(e.length<_e){e.push(t);return}let n=0;for(let t=1;t<e.length;t++)W(e[t],e[n])>0&&(n=t);W(e[n],t)>0&&(e[n]=t)}function De({sourceNames:e,destNames:t,pairs:n,used:r,record:i,scoreOf:a},{remaining:o,open:s},c,l){let u=[];for(let n of s){let r=[];for(let i of o)Ee(r,{score:a(i,n,c),nameScore:+(e[i]===t[n]),dst:n,src:i});u.push(...r)}let d=0,f=e=>{for(;d<l.length&&V(l[d].score,c)>e;d++){let{s:e,d:t,score:a}=l[d];!n.has(t)&&!r.has(e)&&i(t,e,a)}};for(let{dst:e,src:t,score:a}of u.sort(W)){if(a<c)break;f(a),!n.has(e)&&!r.has(t)&&i(e,t,a)}f(-1/0)}var G=({sources:e,dests:t,pairs:n,used:r})=>({remaining:e.keys().filter(e=>!r.has(e)).toArray(),open:t.keys().filter(e=>!n.has(e)).toArray()}),K=e=>V(e,e);function q(e,t,{minimum:n,limit:r,byPath:i}){let a=new Map,o=new Set;if(e.length===0||t.length===0)return a;let s=new Map,c=new Map,l=new Map,u=e=>e.type===`file`?c.get(e)??c.set(e,P(e.data)).get(e):null,d=e=>s.get(e)??s.set(e,T(e)).get(e),f=e=>l.get(e)??l.set(e,T(e,w)).get(e),p={sources:e,dests:t,pairs:a,used:o,sourceNames:e.map(e=>L(e.path)),destNames:t.map(e=>L(e.path)),record(e,t,n){a.set(e,{source:t,score:n}),o.add(t)},bytes:u,scoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,d),punctuatedScoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,f,!0)};if(ve(p),i&&we(p,n,r),n>=6e4)return a;Te(p,G(p),K(n));let m=G(p);if(m.remaining.length*m.open.length>r*r)return a;let h=i?ae(p,m,K(n),e=>H(p,m,e,n)):[];return De(p,G(p),n,h),a}var Oe=50,ke=1e3;function J(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.codePointAt(r)-t.codePointAt(r);return e.length-t.length}function Ae(e){if(e===!1)return null;let t=e===!0?Oe:e;if(typeof t!=`number`)throw TypeError(`renames must be a boolean or a percentage, not ${typeof e}`);if(!(t>0&&t<=100))throw RangeError(`renames must be a percentage above 0 and at most 100, not ${e}`);return Math.max(1,Math.trunc(6e4*t/100))}function je({renamesByPath:e,renameLimit:t,renameGroup:n,paths:r,lines:i}){if(typeof e!=`boolean`)throw TypeError(`renamesByPath must be a boolean, not ${typeof e}`);if(t!==1/0&&!(Number.isSafeInteger(t)&&t>=0))throw RangeError(`renameLimit must be a whole number or Infinity, not ${t}`);if(n!==null&&typeof n!=`function`)throw TypeError(`renameGroup must be a function, not ${typeof n}`);if(r!==`tree`&&r!==`keys`)throw RangeError(`paths must be 'tree' or 'keys', not ${r}`);if(typeof i!=`boolean`)throw TypeError(`lines must be a boolean, not ${typeof i}`)}var Me=(e,t)=>F(e,t)&&(e.type!==`file`||e.mode===t.mode),Y=(e,t,n,r=null)=>({status:e,old:t,new:n,similarity:r}),Ne=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,Pe=e=>e.endsWith(`.mts`)?`module`:e.endsWith(`.cts`)?`commonjs`:null,Fe=/^export\s*\{\s*\}\s*;?$/u;function Ie(e){if(e===null)return{proven:!0,runtime:``,loads:!1};try{return a(e)===void 0?{proven:!1}:y(e.data)}catch{return{proven:!1}}}function Le(e){if(![e.old,e.new].filter(e=>e!==null).every(e=>e.type===`file`&&Ne.test(e.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let t=Ie(e.new),n=Ie(e.old);return!n.proven||!t.proven||n.runtime!==t.runtime&&!(e.old===null&&Fe.test(t.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&Pe(e.old.path)!==Pe(e.new.path)?e:{...e,typeOnly:!0}}function Re(e,t){let n=[],r=[],i=[];for(let[n,a]of e){let e=t.get(n);e===void 0?i.push(a):e.type===a.type?Me(a,e)||r.push(Y(`modified`,a,e)):r.push(Y(`type-changed`,a,e))}for(let[r,i]of t)e.has(r)||n.push(i);return i.sort((e,t)=>J(e.path,t.path)),n.sort((e,t)=>J(e.path,t.path)),{changes:r,deleted:i,added:n}}function ze(e,t,{group:n,...r}){if(n===null)return q(e,t,r);let i=new Map,a=e=>Map.groupBy(e.keys(),t=>n(e[t].path)),o=a(e);for(let[n,s]of a(t)){let a=o.get(n);if(a!==void 0)for(let[n,{source:o,score:c}]of q(a.map(t=>e[t]),s.map(e=>t[e]),r))i.set(s[n],{source:a[o],score:c})}return i}function Be(e,t,{renames:n=!0,renamesByPath:r=!0,renameLimit:i=ke,renameGroup:a=null,paths:c=`tree`,lines:l=!0,horizon:u,whitespace:d,ignoreCase:f,shortest:p}={}){let m=Ae(n);je({renamesByPath:r,renameLimit:i,renameGroup:a,paths:c,lines:l});let h=o({horizon:u,whitespace:d,ignoreCase:f,shortest:p}),g=c===`keys`,{changes:_,deleted:v,added:y}=Re(I(e,`old`,g),I(t,`new`,g)),b=m===null?new Map:ze(v,y,{minimum:m,limit:i,byPath:r,group:a});for(let[e,t]of y.entries()){let n=b.get(e);_.push(n===void 0?Y(`added`,null,t):Y(`renamed`,v[n.source],t,Math.trunc(n.score*100/6e4)))}let x=new Set(b.values().map(({source:e})=>e));for(let[e,t]of v.entries())x.has(e)||_.push(Y(`deleted`,t,null));return _.sort((e,t)=>J((e.new??e.old).path,(t.new??t.old).path)),(l?_.map(e=>({...e,...s(e.old,e.new,h)})):_).map(Le)}function X(e,t,n){let r=new Map,i=new Set,a=0;for(let o of e){let e=c(n,o);e===null||!t.has(e)||(r.set(o,e),i.add(e),e!==o&&a++)}for(let n of e)r.has(n)||!t.has(n)||i.has(n)||(r.set(n,n),i.add(n));let o=r.size;for(let a of e){if(r.has(a))continue;let e=c(n,a)??l(n,a);for(;t.has(e)||i.has(e);)e=`../${e}`;r.set(a,e),i.add(e)}return{paths:r,paired:o,moved:a}}function Ve(e,t){let n=new Set(e),r=new Set(t),i=(e,t)=>{let n=new Map;for(let r of e)for(let e=r.indexOf(`/`);e!==-1;e=r.indexOf(`/`,e+1)){let i=r.slice(0,e+1);t.has(r.slice(e+1))&&n.set(i,(n.get(i)??0)+1)}let r=null,i=!1;for(let[e,t]of n)t>(n.get(r)??0)?[r,i]=[e,!1]:t===n.get(r)&&(i=!0);return i?null:r},a=X(n,r,null).paired,o=[[{base:``,other:i(r,n)},n],[{base:i(n,r),other:``},r]].filter(([e])=>e.base!==null&&e.other!==null).map(([e,t])=>({root:e,side:t,...X(n,r,e)})).filter(({side:e,paired:t,moved:n})=>t>a&&n*2>=e.size);return o.length===2&&o[0].paired===o[1].paired?null:o.toSorted((e,t)=>t.paired-e.paired)[0]?.root??null}function He(e,t){let n=[...e],r=new Set(t),i=Ve(n,r);return{root:i,paths:X(n,r,i).paths}}function Ue(e,t,n){if(!e&&!t)return null;let r=[...e??[]],i=Map.groupBy(r,([,e])=>e),a=new Map(i.entries().map(([e,t])=>[e,u(n,e,t.map(([t])=>t.slice(e.length+1)))]));return new Map([...r.map(([e,t])=>[n.paths.get(e)??e,a.get(t)]),...t??[]])}function We(e,t,n=new Map,i=new Map,a=null,o=()=>!1){let s=e=>{let t=n.get(e)??i.get(e);return t===void 0?[...new Set([e,Ze(a,e)??e])]:[t]},c=[],l=[],u=[],d=new Set;for(let n of e.values()){let e=s(n.parent).map(e=>t.get(r(e,n.specifier,n.conditions,n.platform))).find(Boolean),a=i.get(n.target)??n.target;if(e){if(d.add(e.key),!s(n.target).includes(e.target)){let{target:t,...n}=e;c.push({...n,baseTarget:a,otherTarget:t})}continue}let u=s(n.parent).find(o);if(u===void 0)continue;let{specifier:f,conditions:p,platform:m}=n;l.push({key:r(u,f,p,m),parent:u,specifier:f,conditions:p,platform:m,baseTarget:a,otherTarget:null})}for(let e of t.values()){if(d.has(e.key)||!o(e.parent))continue;let{target:t,...n}=e;u.push({...n,baseTarget:null,otherTarget:t})}for(let e of[c,l,u])e.sort((e,t)=>e.key.localeCompare(t.key));return{changed:c,onlyBase:l,onlyOther:u,totalChanges:c.length+l.length+u.length}}function Z(e){return m(e)??0}function Ge(e,t){return e===t||e?.format===`base64`&&t?.format===`base64`&&e.data===t.data||e?.format===`digest`&&t?.format===`digest`&&e.digest===t.digest}function Q(e){if(e?.npmExecutable instanceof Set)return t=>({executable:e.npmExecutable.has(t)});if(e?.kind!==`stasis`||!e.bundle)return null;let{formats:t,executable:n,entries:r}=e.bundle;return e=>({format:t?.get(e),executable:n?.has(e)??!1,entry:r?.has(e)??!1})}function Ke(e,t){return!e||!t?[]:[`format`,`executable`,`entry`].filter(n=>e[n]!==t[n]).map(n=>({field:n,from:e[n],to:t[n]}))}function qe(e){return(t,n)=>Math.abs(n.delta)-Math.abs(t.delta)||t[e].localeCompare(n[e])}function $(e){return(t,n)=>n.bytes-t.bytes||t[e].localeCompare(n[e])}function Je(e,t){return typeof e==`string`?`\0text\0${e.toWellFormed()}`:e?.format===`base64`?`\0base64\0${e.data}`:e?.format===`digest`?`\0digest\0${e.digest}`:`\0none\0${t}`}var Ye=250;function Xe(e,t,n,r,i){let a=(e,t,n)=>e.filter(({path:e})=>e!==``&&e.isWellFormed()).map(({path:e},r)=>({name:e,data:Je(t.get(e),`${n}${r}`)})),o={paths:`keys`,renameGroup:i,renameLimit:Ye,lines:!1},s=Be(a(e,n,`a`),a(t,r,`b`),o);return new Map(s.filter(({status:e})=>e===`renamed`).map(e=>[e.old.path,e.new.path]))}function Ze(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}function Qe(){return{baseBytes:0,otherBytes:0,onlyBaseFiles:0,onlyOtherFiles:0,changedFiles:0}}function $e(e,t,n,r=He(e.keys(),t.keys()),i=[]){let{root:a,paths:o}=r,s=new Map([...o].map(([e,t])=>[t,e]));e=new Map([...e].map(([e,t])=>[o.get(e),t]));let c=e=>s.get(e)===e?{}:{basePath:s.get(e)},l=(e,t)=>{let n=Ke(i[0]?.(e),i[1]?.(t));return n.length>0?{meta:n}:{}},u=[],d=[],f=[],p=0,m=0,h=0,g=0,_=0,v=0,y=new Map,b=e=>{let t=n(e),r=y.get(t);return r||(r=Qe(),y.set(t,r)),r},x=new Set([...e.keys(),...t.keys()]);for(let n of x){let r=e.has(n),i=t.has(n),a=b(n);if(r&&i){let r=e.get(n),i=t.get(n),o=Ge(r,i),u=l(s.get(n),n),d=Z(r),h=o?d:Z(i);if(p+=d,m+=h,a.baseBytes+=d,a.otherBytes+=h,o&&!u.meta)v++;else{let e=h-d;f.push({path:n,...c(n),baseBytes:d,otherBytes:h,delta:e,...u,...o?{modified:!1}:{}}),_+=e,a.changedFiles++}}else if(r){let t=Z(e.get(n));p+=t,h+=t,a.baseBytes+=t,a.onlyBaseFiles++,u.push({path:n,...c(n),bytes:t})}else{let e=Z(t.get(n));m+=e,g+=e,a.otherBytes+=e,a.onlyOtherFiles++,d.push({path:n,bytes:e})}}let S=Xe(u,d,e,t,n);if(S.size>0){let n=new Set(S.values());for(let[n,r]of S){let i=e.get(n),a=t.get(r),o=Ge(i,a),c=Z(i),u=o?c:Z(a);h-=c,g-=u,f.push({path:r,renamedFrom:n,basePath:s.get(n),baseBytes:c,otherBytes:u,delta:u-c,modified:!o,...l(s.get(n),r)}),_+=u-c;let d=b(n);d.onlyBaseFiles--,d.onlyOtherFiles--,d.changedFiles++}u.splice(0,u.length,...u.filter(e=>!S.has(e.path))),d.splice(0,d.length,...d.filter(e=>!n.has(e.path)))}let C=[],w=[],T=[],E=[];for(let[e,t]of y){let n=t.baseBytes>0||t.onlyBaseFiles>0||t.changedFiles>0,r=t.otherBytes>0||t.onlyOtherFiles>0||t.changedFiles>0,i=t.onlyBaseFiles+t.onlyOtherFiles+t.changedFiles;n&&!r?C.push({pkg:e,bytes:t.baseBytes}):r&&!n?w.push({pkg:e,bytes:t.otherBytes}):i>0||t.baseBytes!==t.otherBytes?T.push({pkg:e,baseBytes:t.baseBytes,otherBytes:t.otherBytes,delta:t.otherBytes-t.baseBytes}):E.push({pkg:e,bytes:t.baseBytes})}return u.sort($(`path`)),d.sort($(`path`)),f.sort(qe(`path`)),C.sort($(`pkg`)),w.sort($(`pkg`)),T.sort(qe(`pkg`)),{totals:{baseFiles:e.size,baseBytes:p,otherFiles:t.size,otherBytes:m,onlyBaseFiles:u.length,onlyBaseBytes:h,onlyOtherFiles:d.length,onlyOtherBytes:g,changedFiles:f.length,renamedFiles:S.size,changedDelta:_,unchangedFiles:v,fileDelta:t.size-e.size,byteDelta:m-p,identical:u.length===0&&d.length===0&&f.length===0},files:{onlyBase:u,onlyOther:d,changed:f,root:a,basePaths:o},packages:{onlyBase:C,onlyOther:w,changed:T,unchanged:E}}}function et(e,r,a=null){let[o,s]=[e,r],[c,l]=t(o,s,a),u=n(o,c),p=n(s,l),m=He(u.keys(),p.keys()),y=Ue(h(o),h(s),m),b=$e(u,p,e=>v(e,{packageDir:y?.get(e)}),m,[Q(o),Q(s)]),x=_(o),S=_(s),C=(e,t)=>{let n=0;for(let r of t)n+=e.get(r)??0;return n};Object.assign(b.totals,{baseLines:C(x,u.keys()),otherLines:C(S,p.keys())});for(let e of b.files.onlyBase)e.lines=x.get(e.basePath??e.path)??0;for(let e of b.files.onlyOther)e.lines=S.get(e.path)??0;for(let e of b.files.changed)Object.assign(e,{baseLines:x.get(e.basePath??e.path)??0,otherLines:S.get(e.path)??0});let w=new Set([...b.files.onlyOther,...b.files.changed.filter(e=>e.modified!==!1)].map(e=>e.path));b.resolutions=We(i(o,c),i(s,l),new Map(b.files.changed.filter(e=>e.renamedFrom!=null).map(e=>[e.basePath,e.path])),b.files.basePaths,b.files.root,e=>p.has(e)&&!w.has(e));let T=e=>v(``,{packageDir:e}),E=g(o,c?u.keys():null,T),D=g(s,l?p.keys():null,T);return b.versionUpdates=f(E,D),b.packageRows=d(b.packages,E,D),b.scope=a??``,b}export{et as prepareComparison};
|