From 1c41febc62c708bb9e12916d10e45827dbdc0875 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:26:44 -0700 Subject: [PATCH 01/28] chore(deps): bump effect and @effect/* to 4.0.1 Drop the rc.112 pnpm patches: the stdin EPIPE listener is covered upstream since rc.113 (effect PRs 7712 and 7714), and the vitest runTest rewrite is superseded by upstream's finalizer ordering fix (effect PR 8154). Effect no longer depends on msgpackr, so its build approval goes too. Co-Authored-By: Claude Fable 5.1 --- ...t__platform-node-shared@4.0.0-rc.112.patch | 15 - patches/@effect__vitest@4.0.0-rc.112.patch | 54 --- pnpm-lock.yaml | 320 +++++------------- pnpm-workspace.yaml | 25 +- 4 files changed, 88 insertions(+), 326 deletions(-) delete mode 100644 patches/@effect__platform-node-shared@4.0.0-rc.112.patch delete mode 100644 patches/@effect__vitest@4.0.0-rc.112.patch diff --git a/patches/@effect__platform-node-shared@4.0.0-rc.112.patch b/patches/@effect__platform-node-shared@4.0.0-rc.112.patch deleted file mode 100644 index 9ad2c171a9..0000000000 --- a/patches/@effect__platform-node-shared@4.0.0-rc.112.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/dist/NodeChildProcessSpawner.js b/dist/NodeChildProcessSpawner.js -index aa8abbe375f40350f9a5a12f36143d5d85802485..5a86ce881e6a5aa1358059dc0f10ec0934ef164d 100644 ---- a/dist/NodeChildProcessSpawner.js -+++ b/dist/NodeChildProcessSpawner.js -@@ -196,6 +196,10 @@ const make = /*#__PURE__*/Effect.gen(function* () { - // sink that will attached to the process handle - let sink = Sink.drain; - if (Predicate.isNotNull(childProcess.stdin)) { -+ // A child that exits before reading its input fails the final flush of `end()` with -+ // EPIPE after the sink's own listener is gone; without a listener Node raises it as an -+ // uncaught exception. The write loop still reports write failures through `onError`. -+ childProcess.stdin.on("error", () => {}); - sink = NodeSink.fromWritable({ - evaluate: () => childProcess.stdin, - onError: error => toPlatformError("fromWritable(stdin)", toError(error), command), diff --git a/patches/@effect__vitest@4.0.0-rc.112.patch b/patches/@effect__vitest@4.0.0-rc.112.patch deleted file mode 100644 index 8ab160abfd..0000000000 --- a/patches/@effect__vitest@4.0.0-rc.112.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff --git a/dist/internal/internal.js b/dist/internal/internal.js -index 0000000..0000000 100644 ---- a/dist/internal/internal.js -+++ b/dist/internal/internal.js -@@ -30,7 +30,20 @@ - signal: ctx?.signal - })); - /** @internal */ --const runTest = ctx => effect => runPromise(effect, ctx); -+const runTest = ctx => effect => { -+ const failure = cause => { -+ const errors = Cause.prettyErrors(cause); -+ return errors.length > 1 ? new AggregateError(errors) : errors[0] ?? Cause.squash(cause); -+ }; -+ const exitPromise = Effect.runPromiseExit(effect, { -+ signal: ctx?.signal -+ }); -+ const promise = exitPromise.then(exit => Exit.isSuccess(exit) ? exit.value : Promise.reject(failure(exit.cause))); -+ ctx?.onTestFinished(() => exitPromise.then(exit => { -+ if (Exit.isFailure(exit) && Cause.hasInterrupts(exit.cause) && !Cause.hasInterruptsOnly(exit.cause)) return Promise.reject(failure(exit.cause)); -+ })); -+ return promise; -+}; - const TestEnv = /*#__PURE__*/Layer.mergeAll(TestConsole.layer, /*#__PURE__*/TestClock.layer()); - /** @internal */ - export const addEqualityTesters = () => { -diff --git a/src/internal/internal.ts b/src/internal/internal.ts -index 0000000..0000000 100644 ---- a/src/internal/internal.ts -+++ b/src/internal/internal.ts -@@ -36,7 +36,22 @@ - }, (effect, _, ctx) => Effect.runPromise(effect, { signal: ctx?.signal })) - - /** @internal */ --const runTest = (ctx?: Vitest.TestContext) => (effect: Effect.Effect) => runPromise(effect, ctx) -+const runTest = (ctx?: Vitest.TestContext) => (effect: Effect.Effect) => { -+ const failure = (cause: Cause.Cause) => { -+ const errors = Cause.prettyErrors(cause) -+ return errors.length > 1 ? new AggregateError(errors) : errors[0] ?? Cause.squash(cause) -+ } -+ const exitPromise = Effect.runPromiseExit(effect, { signal: ctx?.signal }) -+ const promise = exitPromise.then((exit) => Exit.isSuccess(exit) -+ ? exit.value -+ : Promise.reject(failure(exit.cause))) -+ ctx?.onTestFinished(() => exitPromise.then((exit) => { -+ if (Exit.isFailure(exit) && Cause.hasInterrupts(exit.cause) && !Cause.hasInterruptsOnly(exit.cause)) { -+ return Promise.reject(failure(exit.cause)) -+ } -+ })) -+ return promise -+} - - /** @internal */ - export type TestContext = TestConsole.TestConsole | TestClock.TestClock diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f7fb93cb8d..0cb14b2d93 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -165,20 +165,20 @@ settings: catalogs: default: '@effect/platform-bun': - specifier: 4.0.0-rc.112 - version: 4.0.0-rc.112 + specifier: 4.0.1 + version: 4.0.1 '@effect/platform-node': - specifier: 4.0.0-rc.112 - version: 4.0.0-rc.112 + specifier: 4.0.1 + version: 4.0.1 '@effect/sql-pg': - specifier: 4.0.0-rc.112 - version: 4.0.0-rc.112 + specifier: 4.0.1 + version: 4.0.1 '@effect/tsgo': specifier: 0.37.0 version: 0.37.0 '@effect/vitest': - specifier: 4.0.0-rc.112 - version: 4.0.0-rc.112 + specifier: 4.0.1 + version: 4.0.1 '@supabase/supabase-js': specifier: ^2.110.7 version: 2.112.4 @@ -195,8 +195,8 @@ catalogs: specifier: ^5.0.0 version: 5.0.0 effect: - specifier: 4.0.0-rc.112 - version: 4.0.0-rc.112 + specifier: 4.0.1 + version: 4.0.1 knip: specifier: ^6.32.2 version: 6.34.0 @@ -234,8 +234,6 @@ overrides: packageExtensionsChecksum: sha256-gAA6Mc6Jn3jUpogzVWO9hE5trVRioaB8peQBgDbyG6I= patchedDependencies: - '@effect/platform-node-shared@4.0.0-rc.112': ae37153251ecf7edd0be9de349cc18b4b13c8cf3bd7e9ead20e8e891716af128 - '@effect/vitest@4.0.0-rc.112': fbd126f7e68e041231312d90b8c02f705f12b66c2cb2d6fc246f5c12a4ed9787 '@libpg-query/parser@17.6.10': ed67c0ca88b6ced3ec50fd6862f191d6192a246cf20d9c777d45efdb8373bed3 importers: @@ -311,13 +309,13 @@ importers: version: 1.7.0 '@effect/platform-bun': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112) + version: 4.0.1(effect@4.0.1) '@effect/sql-pg': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112) + version: 4.0.1(effect@4.0.1) '@effect/vitest': specifier: 'catalog:' - version: 4.0.0-rc.112(patch_hash=fbd126f7e68e041231312d90b8c02f705f12b66c2cb2d6fc246f5c12a4ed9787)(effect@4.0.0-rc.112)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) + version: 4.0.1(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) '@modelcontextprotocol/sdk': specifier: ^1.30.0 version: 1.30.0(supports-color@7.2.0)(zod@4.5.4) @@ -368,7 +366,7 @@ importers: version: 17.4.2 effect: specifier: 'catalog:' - version: 4.0.0-rc.112 + version: 4.0.1 esbuild: specifier: ^0.28.2 version: 0.28.2 @@ -493,13 +491,13 @@ importers: dependencies: '@effect/platform-bun': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112) + version: 4.0.1(effect@4.0.1) '@effect/platform-node': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112)(redis@6.2.1) + version: 4.0.1(effect@4.0.1)(redis@6.2.1) effect: specifier: 'catalog:' - version: 4.0.0-rc.112 + version: 4.0.1 devDependencies: '@tsconfig/bun': specifier: 'catalog:' @@ -565,10 +563,10 @@ importers: devDependencies: '@effect/platform-bun': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112) + version: 4.0.1(effect@4.0.1) '@effect/platform-node': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112)(redis@6.2.1) + version: 4.0.1(effect@4.0.1)(redis@6.2.1) '@semantic-release/commit-analyzer': specifier: ^13.0.1 version: 13.0.1(semantic-release@25.0.9(supports-color@7.2.0)(typescript@7.0.2))(supports-color@7.2.0) @@ -586,7 +584,7 @@ importers: version: 5.0.0(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) effect: specifier: 'catalog:' - version: 4.0.0-rc.112 + version: 4.0.1 semantic-release: specifier: 'catalog:' version: 25.0.9(supports-color@7.2.0)(typescript@7.0.2) @@ -604,20 +602,20 @@ importers: dependencies: '@effect/platform-node': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112)(redis@6.2.1) + version: 4.0.1(effect@4.0.1)(redis@6.2.1) '@effect/sql-pg': specifier: 'catalog:' - version: 4.0.0-rc.112(effect@4.0.0-rc.112) + version: 4.0.1(effect@4.0.1) effect: specifier: 'catalog:' - version: 4.0.0-rc.112 + version: 4.0.1 jose: specifier: ^6.2.10 version: 6.2.10 devDependencies: '@effect/vitest': specifier: 'catalog:' - version: 4.0.0-rc.112(patch_hash=fbd126f7e68e041231312d90b8c02f705f12b66c2cb2d6fc246f5c12a4ed9787)(effect@4.0.0-rc.112)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) + version: 4.0.1(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) '@tsconfig/bun': specifier: 'catalog:' version: 1.0.11 @@ -880,28 +878,28 @@ packages: peerDependencies: '@noble/ciphers': ^1.0.0 - '@effect/platform-bun@4.0.0-rc.112': - resolution: {integrity: sha512-Y5n2HhV/vsbrJls9ukX42RL7zqXQxISHegWFsP9njsCyDmGTnq7QYSO82rglwrLPwtTrv5dkSRTuGw4+oXxgMg==} + '@effect/platform-bun@4.0.1': + resolution: {integrity: sha512-m+QR4bp39ZWujCuEsUhZADIYIOFZcUHHlmrixENZqZRbEYgaPLMUWiPrRJ69CM4BuuHW8oCOxfMGUU7oSw/o5g==} peerDependencies: - effect: ^4.0.0-rc.112 + effect: ^4.0.1 - '@effect/platform-node-shared@4.0.0-rc.112': - resolution: {integrity: sha512-ttjz0xKamFN7vL8pNDYVwddJLjZvqKePc05djlz2VcdaKbLsnYbtMnL1rbOfHgEnIUSHGh7FkjaN4DM1Ov81sQ==} + '@effect/platform-node-shared@4.0.1': + resolution: {integrity: sha512-VanaejudEhKJ4mpmqnEzdncVUhN6sGSO9ZDND54mRxAlZxj+4dYAWjDTYAy9o4tJo9aALeP2U8cVcOFzEdSeLg==} engines: {node: '>=18.0.0'} peerDependencies: - effect: ^4.0.0-rc.112 + effect: ^4.0.1 - '@effect/platform-node@4.0.0-rc.112': - resolution: {integrity: sha512-/BMAcdNGQQskLmI0Zoa95KfTZkr9HV9N4NSxaSrusG6GeW6Ulp9KvZ+Rlaiw8lnOt43CXjFLdfll5/k5rxL4hQ==} + '@effect/platform-node@4.0.1': + resolution: {integrity: sha512-FT0Fu5LO0/XP9zBpj0HqrtJNLluK4StNKqf6TSulUsjp8FPBsDVXGJiDuyoN5J2yVMT7tgvhxSwaDcObWVRIaQ==} engines: {node: '>=18.0.0'} peerDependencies: - effect: ^4.0.0-rc.112 + effect: ^4.0.1 redis: '>=5.0.0 <7.0.0' - '@effect/sql-pg@4.0.0-rc.112': - resolution: {integrity: sha512-UYUA3LAGH1Pg88Yau7eTlTLHRrIb/uTdxdPGxVcRdIjjrTzxtA7iKHR4hcmUeq5lQEcGLCopN7E4ffsAKF8vEQ==} + '@effect/sql-pg@4.0.1': + resolution: {integrity: sha512-X5aqOxHNWqVXL+vyTQZLYDip65lm5rrZHuNkWyyr672iup1tjYAs5Dn9tHR5h1t0blpJ57j8Ng5G5AUQ8teIqA==} peerDependencies: - effect: ^4.0.0-rc.112 + effect: ^4.0.1 '@effect/tsgo-darwin-arm64@0.37.0': resolution: {integrity: sha512-D9o2NKswmRklu+sG28HkxZAvtvOa0Mt+bLVjJKydF2kVw+gePxiHuTbbI3e4Kqumv4ucLT3TtqU1a2RirC80lA==} @@ -942,12 +940,12 @@ packages: resolution: {integrity: sha512-jCJIUcNgI0vaoylao/mhOv+7hDfaJRwZJSJrg5kA/FCQ4aGDhAYqyQx+hoZh8AW3pzD9Qp1RWtUsVFqOzIOENw==} hasBin: true - '@effect/vitest@4.0.0-rc.112': - resolution: {integrity: sha512-mEKh/FI64mt8JK1/v9mpOrJYdnp+UFZdRUBMEdZMiKz7klg6NPqVgg/oeAGH6wOOQc2iAPcfc2H9BbAv1KyzMQ==} + '@effect/vitest@4.0.1': + resolution: {integrity: sha512-DbY9kf/018zBxRIX7rJwBnPVPzSarnUpcshm0vfYPFiDkSa7AFrXTh2BlDNUbrdrmqcIOBhVZ7GkEtxf8WiQrg==} peerDependencies: - effect: ^4.0.0-rc.112 + effect: ^4.0.1 vite: '*' - vitest: '>=4.1.0 <5.0.0' + vitest: '>=5.0.0 <6.0.0' '@emnapi/core@1.11.2': resolution: {integrity: sha512-TC8MkTuZUtcTSiFeuC0ksCh9QIJ5+F21MvZ4Wn4ORfYaFJ/0dsiudv5tVkejgwZlwQ39jL9WWDe2lz8x0WglOA==} @@ -1357,36 +1355,6 @@ packages: '@cfworker/json-schema': optional: true - '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.4': - resolution: {integrity: sha512-LCkGo6JDfaBhgST7UpPWgNgLINpcpabaHfyz5OBx75nUYxBsaEPxjnyNjWpeb/xBup/682QnBfRBy2/LvPutZQ==} - cpu: [arm64] - os: [darwin] - - '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.4': - resolution: {integrity: sha512-zExlW9zUJKZH/tOtVMttwjKa4Xm/3KcNjnE3dPN92uCktwavMxpgCA3MoJK/DOnTWsQgo224OaST27/mPNAf+w==} - cpu: [x64] - os: [darwin] - - '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.4': - resolution: {integrity: sha512-dgX0P/9wGPJeHFBG+ZmhgE6bmtMt7NP5CRBGyyktpopdk/mW4POnrpQsSLtKI1dwpc+pPLuXHDh6vvskyQE/sw==} - cpu: [arm64] - os: [linux] - - '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.4': - resolution: {integrity: sha512-Tg3yX65f5GbtXLkrYEHE5oibZG9epyYWas7FogTTEJeDEF9JlXJzKgXaNhT3UXlTOeA+AfZpYZYZ0uPj7Cfquw==} - cpu: [arm] - os: [linux] - - '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.4': - resolution: {integrity: sha512-8TNXMEjJc3QEy7R/x1INhgiU+XakDAFUzBhaz7+Rbrs8NH5UQeHQxxmzsSBJGyV6I1jW79undiQm8tOI+D+8FQ==} - cpu: [x64] - os: [linux] - - '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.4': - resolution: {integrity: sha512-CmCXPQrkbwExx3j946/PtHWHbYJiCRBRDl4BlkRQcJB/YOwQxJRTpoo7aTsortjgoJ1x7opzTSxn7C+ASSLVjQ==} - cpu: [x64] - os: [win32] - '@napi-rs/keyring-darwin-arm64@1.3.0': resolution: {integrity: sha512-pl76hJvdYUBn6I24bXiOBMA9nbDapo3I5B+f3OorjDU4dUMSypXeKbOVehJe8fhgTiH24flMyTS3aAIy43xegQ==} engines: {node: '>= 10'} @@ -3387,11 +3355,6 @@ packages: ajv-formats@3.0.1: resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true ajv@8.20.0: resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} @@ -3973,8 +3936,8 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - effect@4.0.0-rc.112: - resolution: {integrity: sha512-wXxwuh1Ywnv4cPRM3Wfa0vDwuOHnZ1TsTgHJkG9XgzND6inhBH9n1vBxhg3iIXOia/OrpmvVmd3lrD4vq6bF3A==} + effect@4.0.1: + resolution: {integrity: sha512-b1VlQG9g8fwxE5QnIZuPoOP/0MsqHJSRKxUijjoM80E5q95FXrX5yWtY5XI8G+GJsBQAVSDbLS458z9a++uVvw==} emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} @@ -4145,11 +4108,6 @@ packages: extsprintf@1.3.0: resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} - engines: {'0': node >=0.6.0} - - fast-check@4.9.0: - resolution: {integrity: sha512-7ms6T7SybUev/PQITciI0yLM2pOSFy5zpG8Ty7tQofcVaQUvrMXp6CBwqF6fThLCLOrfBtuHAtwq6Yu4XPCllg==} - engines: {node: '>=12.17.0'} fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -4791,7 +4749,6 @@ packages: jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} - engines: {'0': node >= 0.2.0} jsonwebtoken@9.0.3: resolution: {integrity: sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==} @@ -4799,7 +4756,6 @@ packages: jsprim@2.0.2: resolution: {integrity: sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==} - engines: {'0': node >=0.6.0} jwa@2.0.1: resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==} @@ -5266,13 +5222,6 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msgpackr-extract@3.0.4: - resolution: {integrity: sha512-4kmO/MdyUIkLIvTPr8VHLil4AtoKIoniWPIEk5+CDy0xnWC84azhSFmuJ7PxZdsYtiP5kEeQsORAVIeMgxT+Hw==} - hasBin: true - - msgpackr@2.1.0: - resolution: {integrity: sha512-p/pBCVO63CsvvpkomUnNNag6+n38rULuDA6HHe70o2gtC8ODI52foF/4ko2qQcp6OiErJXTmrZeXmsGGHsIQNQ==} - mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -5342,10 +5291,6 @@ packages: encoding: optional: true - node-gyp-build-optional-packages@5.2.2: - resolution: {integrity: sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==} - hasBin: true - normalize-package-data@6.0.2: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} @@ -5453,9 +5398,6 @@ packages: resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} engines: {node: '>= 0.4'} - obuf@1.1.2: - resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} - obug@2.1.4: resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==} engines: {node: '>=12.20.0'} @@ -5653,19 +5595,10 @@ packages: pg-copy-streams@7.0.0: resolution: {integrity: sha512-zBvnY6wtaBRE2ae2xXWOOGMaNVPkXh1vhypAkNSKgMdciJeTyIQAHZaEeRAxUjs/p1El5jgzYmwG5u871Zj3dQ==} - pg-cursor@2.22.0: - resolution: {integrity: sha512-knzXLKqarTjOvb3qDSW0JiGsazmxwEKXrqHfWRte7XUsOYccQRafn3BLnQobWwInkzFJSyOej8y8cQRh2z3kGw==} - peerDependencies: - pg: ^8 - pg-int8@1.0.1: resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} engines: {node: '>=4.0.0'} - pg-numeric@1.0.2: - resolution: {integrity: sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==} - engines: {node: '>=4'} - pg-pool@3.14.0: resolution: {integrity: sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==} peerDependencies: @@ -5681,10 +5614,6 @@ packages: resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} engines: {node: '>=4'} - pg-types@4.1.0: - resolution: {integrity: sha512-o2XFanIMy/3+mThw69O8d4n1E5zsLhdO+OPqswezu7Z5ekP4hYDqlDjlmOpYMbzY2Br0ufCwJLdDIXeNVwcWFg==} - engines: {node: '>=10'} - pg@8.23.0: resolution: {integrity: sha512-Ip2EQCngowJLGOfCwkFhPXU7/ljlhn6Rxlmy4XYfL2Y+vyRM59+8uR2xqRWKdYmbXmxCFOAmKxBuSUCdF34qLg==} engines: {node: '>= 16.0.0'} @@ -5758,37 +5687,18 @@ packages: resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} engines: {node: '>=4'} - postgres-array@3.0.4: - resolution: {integrity: sha512-nAUSGfSDGOaOAEGwqsRY27GPOea7CNipJPOA7lPbdEpx5Kg3qzdP0AaWC5MlhTWV9s4hFX39nomVZ+C4tnGOJQ==} - engines: {node: '>=12'} - postgres-bytea@1.0.1: resolution: {integrity: sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==} engines: {node: '>=0.10.0'} - postgres-bytea@3.0.0: - resolution: {integrity: sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==} - engines: {node: '>= 6'} - postgres-date@1.0.7: resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} engines: {node: '>=0.10.0'} - postgres-date@2.1.0: - resolution: {integrity: sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==} - engines: {node: '>=12'} - postgres-interval@1.2.0: resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} engines: {node: '>=0.10.0'} - postgres-interval@3.0.0: - resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==} - engines: {node: '>=12'} - - postgres-range@1.1.4: - resolution: {integrity: sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==} - posthog-node@5.51.6: resolution: {integrity: sha512-r+Ge3p0OnOcOWeTnvKZmAtDwECeIoyNTyxBxuZc8wM6RHCQ9j2Xrhogrf39HSq1Y2gIOpWLqIDRmWDcu7xmqcA==} engines: {node: ^20.20.0 || >=22.22.0} @@ -5845,9 +5755,6 @@ packages: pumpify@1.5.1: resolution: {integrity: sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==} - pure-rand@8.4.2: - resolution: {integrity: sha512-vvuOGgcuPJAirlHvuQw1TrOiw7ptaIXXmIbNuiNOY6lNGJJH49PQ1Kj4nd783nPdQhQdicgOjVI2yI/9BD6/Ng==} - qs@6.15.3: resolution: {integrity: sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==} engines: {node: '>=0.6'} @@ -6516,8 +6423,8 @@ packages: resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==} engines: {node: '>=20.18.1'} - undici@8.10.1: - resolution: {integrity: sha512-YQ3WlbqjYMmNpdvDH64jAgLjxuAR9+649calDWhbshYaeQGO2bR4nI94ORJmwI3J9YhoKQnpyGOK+0zlWS5N5Q==} + undici@8.11.2: + resolution: {integrity: sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==} engines: {node: '>=22.19.0'} unicode-emoji-modifier-base@1.0.0: @@ -6638,7 +6545,6 @@ packages: verror@1.10.0: resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} - engines: {'0': node >=0.6.0} vfile-location@5.0.3: resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} @@ -6785,6 +6691,18 @@ packages: utf-8-validate: optional: true + ws@8.22.0: + resolution: {integrity: sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} @@ -7123,44 +7041,36 @@ snapshots: dependencies: '@noble/ciphers': 1.3.0 - '@effect/platform-bun@4.0.0-rc.112(effect@4.0.0-rc.112)': + '@effect/platform-bun@4.0.1(effect@4.0.1)': dependencies: - '@effect/platform-node-shared': 4.0.0-rc.112(patch_hash=ae37153251ecf7edd0be9de349cc18b4b13c8cf3bd7e9ead20e8e891716af128)(effect@4.0.0-rc.112) - effect: 4.0.0-rc.112 + '@effect/platform-node-shared': 4.0.1(effect@4.0.1) + effect: 4.0.1 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node-shared@4.0.0-rc.112(patch_hash=ae37153251ecf7edd0be9de349cc18b4b13c8cf3bd7e9ead20e8e891716af128)(effect@4.0.0-rc.112)': + '@effect/platform-node-shared@4.0.1(effect@4.0.1)': dependencies: '@types/ws': 8.18.1 - effect: 4.0.0-rc.112 - ws: 8.21.3 + effect: 4.0.1 + ws: 8.22.0 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node@4.0.0-rc.112(effect@4.0.0-rc.112)(redis@6.2.1)': + '@effect/platform-node@4.0.1(effect@4.0.1)(redis@6.2.1)': dependencies: - '@effect/platform-node-shared': 4.0.0-rc.112(patch_hash=ae37153251ecf7edd0be9de349cc18b4b13c8cf3bd7e9ead20e8e891716af128)(effect@4.0.0-rc.112) - effect: 4.0.0-rc.112 - mime: 4.1.0 + '@effect/platform-node-shared': 4.0.1(effect@4.0.1) + effect: 4.0.1 redis: 6.2.1 - undici: 8.10.1 + undici: 8.11.2 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/sql-pg@4.0.0-rc.112(effect@4.0.0-rc.112)': + '@effect/sql-pg@4.0.1(effect@4.0.1)': dependencies: - effect: 4.0.0-rc.112 - pg: 8.23.0 - pg-connection-string: 2.14.0 - pg-cursor: 2.22.0(pg@8.23.0) - pg-pool: 3.14.0(pg@8.23.0) - pg-types: 4.1.0 - transitivePeerDependencies: - - pg-native + effect: 4.0.1 '@effect/tsgo-darwin-arm64@0.37.0': optional: true @@ -7193,9 +7103,9 @@ snapshots: '@effect/tsgo-win32-arm64': 0.37.0 '@effect/tsgo-win32-x64': 0.37.0 - '@effect/vitest@4.0.0-rc.112(patch_hash=fbd126f7e68e041231312d90b8c02f705f12b66c2cb2d6fc246f5c12a4ed9787)(effect@4.0.0-rc.112)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0)': + '@effect/vitest@4.0.1(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0)': dependencies: - effect: 4.0.0-rc.112 + effect: 4.0.1 vite: 8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0) vitest: 5.0.0(@types/node@26.4.1)(@vitest/coverage-v8@5.0.0)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0)) @@ -7507,7 +7417,7 @@ snapshots: dependencies: '@hono/node-server': 2.1.1(hono@4.13.5) ajv: 8.20.0 - ajv-formats: 3.0.1(ajv@8.20.0) + ajv-formats: 3.0.1 content-type: 1.0.5 cors: 2.8.6 cross-spawn: 7.0.6 @@ -7525,24 +7435,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.4': - optional: true - - '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.4': - optional: true - '@napi-rs/keyring-darwin-arm64@1.3.0': optional: true @@ -9153,8 +9045,8 @@ snapshots: clean-stack: 5.3.0 indent-string: 5.0.0 - ajv-formats@3.0.1(ajv@8.20.0): - optionalDependencies: + ajv-formats@3.0.1: + dependencies: ajv: 8.20.0 ajv@8.20.0: @@ -9690,10 +9582,7 @@ snapshots: ee-first@1.1.1: {} - effect@4.0.0-rc.112: - dependencies: - fast-check: 4.9.0 - msgpackr: 2.1.0 + effect@4.0.1: {} emoji-regex@10.6.0: {} @@ -9961,10 +9850,6 @@ snapshots: extsprintf@1.3.0: {} - fast-check@4.9.0: - dependencies: - pure-rand: 8.4.2 - fast-deep-equal@3.1.3: {} fast-fifo@1.3.2: {} @@ -11348,22 +11233,6 @@ snapshots: ms@2.1.3: {} - msgpackr-extract@3.0.4: - dependencies: - node-gyp-build-optional-packages: 5.2.2 - optionalDependencies: - '@msgpackr-extract/msgpackr-extract-darwin-arm64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-darwin-x64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-linux-arm': 3.0.4 - '@msgpackr-extract/msgpackr-extract-linux-arm64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-linux-x64': 3.0.4 - '@msgpackr-extract/msgpackr-extract-win32-x64': 3.0.4 - optional: true - - msgpackr@2.1.0: - optionalDependencies: - msgpackr-extract: 3.0.4 - mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -11427,11 +11296,6 @@ snapshots: dependencies: whatwg-url: 5.0.0 - node-gyp-build-optional-packages@5.2.2: - dependencies: - detect-libc: 2.1.2 - optional: true - normalize-package-data@6.0.2: dependencies: hosted-git-info: 7.0.2 @@ -11465,8 +11329,6 @@ snapshots: object-inspect@1.13.4: {} - obuf@1.1.2: {} - obug@2.1.4: {} on-exit-leak-free@2.1.2: {} @@ -11727,14 +11589,8 @@ snapshots: pg-copy-streams@7.0.0: {} - pg-cursor@2.22.0(pg@8.23.0): - dependencies: - pg: 8.23.0 - pg-int8@1.0.1: {} - pg-numeric@1.0.2: {} - pg-pool@3.14.0(pg@8.23.0): dependencies: pg: 8.23.0 @@ -11763,16 +11619,6 @@ snapshots: postgres-date: 1.0.7 postgres-interval: 1.2.0 - pg-types@4.1.0: - dependencies: - pg-int8: 1.0.1 - pg-numeric: 1.0.2 - postgres-array: 3.0.4 - postgres-bytea: 3.0.0 - postgres-date: 2.1.0 - postgres-interval: 3.0.0 - postgres-range: 1.1.4 - pg@8.23.0: dependencies: pg-connection-string: 2.14.0 @@ -11864,26 +11710,14 @@ snapshots: postgres-array@2.0.0: {} - postgres-array@3.0.4: {} - postgres-bytea@1.0.1: {} - postgres-bytea@3.0.0: - dependencies: - obuf: 1.1.2 - postgres-date@1.0.7: {} - postgres-date@2.1.0: {} - postgres-interval@1.2.0: dependencies: xtend: 4.0.2 - postgres-interval@3.0.0: {} - - postgres-range@1.1.4: {} - posthog-node@5.51.6: dependencies: '@posthog/core': 1.50.2 @@ -11924,8 +11758,6 @@ snapshots: inherits: 2.0.4 pump: 2.0.1 - pure-rand@8.4.2: {} - qs@6.15.3: dependencies: es-define-property: 1.0.1 @@ -12786,7 +12618,7 @@ snapshots: undici@7.29.0: {} - undici@8.10.1: {} + undici@8.11.2: {} unicode-emoji-modifier-base@1.0.0: {} @@ -13042,6 +12874,8 @@ snapshots: ws@8.21.3: {} + ws@8.22.0: {} + xtend@4.0.2: {} y18n@5.0.8: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4f94cb7c4e..fdcb49971b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,22 +8,21 @@ allowBuilds: "@parcel/watcher": true "@launchql/protobufjs": true esbuild: true - msgpackr-extract: true sharp: true catalog: - "@effect/platform-bun": "4.0.0-rc.112" - "@effect/platform-node": "4.0.0-rc.112" - "@effect/sql-pg": "4.0.0-rc.112" + "@effect/platform-bun": "4.0.1" + "@effect/platform-node": "4.0.1" + "@effect/sql-pg": "4.0.1" "@effect/tsgo": &effect-tsgo-version "0.37.0" - "@effect/vitest": "4.0.0-rc.112" + "@effect/vitest": "4.0.1" "@supabase/supabase-js": ^2.110.7 "@tsconfig/bun": "^1.0.11" "@types/bun": "^1.4.2" "@types/ws": "8.18.1" "typescript": "^7.0.2" "@vitest/coverage-v8": "^5.0.0" - "effect": "4.0.0-rc.112" + "effect": "4.0.1" "knip": "^6.32.2" "oxfmt": "^0.65.0" "oxlint": "1.80.0" @@ -103,11 +102,11 @@ minimumReleaseAgeExclude: - "@turbo/linux-arm64@2.10.11" - "@turbo/windows-64@2.10.11" - "@turbo/windows-arm64@2.10.11" - - "@effect/platform-bun@4.0.0-rc.112" - - "@effect/platform-node@4.0.0-rc.112" - - "@effect/platform-node-shared@4.0.0-rc.112" - - "@effect/sql-pg@4.0.0-rc.112" - - "@effect/vitest@4.0.0-rc.112" + - "@effect/platform-bun@4.0.1" + - "@effect/platform-node@4.0.1" + - "@effect/platform-node-shared@4.0.1" + - "@effect/sql-pg@4.0.1" + - "@effect/vitest@4.0.1" - "@supabase/pg-delta@1.0.0-alpha.56" - "@supabase/pg-topo@1.0.0-alpha.7" - "@supabase/postgrest-typegen@0.4.0" @@ -116,7 +115,7 @@ minimumReleaseAgeExclude: - "@ark/schema@0.56.4" - "@ark/util@0.56.4" - "arkregex@0.0.10" - - "effect@4.0.0-rc.112" + - "effect@4.0.1" - "turbo@2.10.11" supportedArchitectures: @@ -135,8 +134,6 @@ supportedArchitectures: - win32 patchedDependencies: - "@effect/platform-node-shared@4.0.0-rc.112": patches/@effect__platform-node-shared@4.0.0-rc.112.patch - "@effect/vitest@4.0.0-rc.112": patches/@effect__vitest@4.0.0-rc.112.patch "@libpg-query/parser@17.6.10": patches/@libpg-query__parser@17.6.10.patch virtualStoreType: global From 1c6385f4569cd7a566b61d4f79aae1288af773b4 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:27:43 -0700 Subject: [PATCH 02/28] refactor(repo): move effect/unstable/* imports to their stable 4.0 paths Generated with: grep -rl 'effect/unstable/' apps packages tools --include='*.ts' \ | xargs sed -i '' 's#\(["'\''\]\)effect/unstable/#\1effect/#g' Co-Authored-By: Claude Fable 5.1 --- apps/cli/scripts/bench-cli.ts | 2 +- .../auth/command-platform-api-factory.layer.ts | 2 +- apps/cli/src/auth/command-platform-api.layer.ts | 2 +- .../auth/command-platform-api.layer.unit.test.ts | 6 +++--- apps/cli/src/auth/http-debug.layer.ts | 4 ++-- .../src/cli/boolean-flag-defaults.unit.test.ts | 2 +- apps/cli/src/cli/complete.ts | 6 +++--- apps/cli/src/cli/main.ts | 2 +- .../cli/root-stack-aliases.integration.test.ts | 2 +- apps/cli/src/cli/root.ts | 2 +- apps/cli/src/command-internal/branch-target.ts | 2 +- .../command-internal/bundled-postgres-client.ts | 4 ++-- .../command-internal/connect-errors.unit.test.ts | 2 +- apps/cli/src/command-internal/container-cli.ts | 4 ++-- .../command-internal/container-cli.unit.test.ts | 2 +- .../db-bootstrap/await-storage-ready.ts | 4 ++-- .../await-storage-ready.unit.test.ts | 4 ++-- .../db-bootstrap/container-lifecycle.ts | 2 +- .../container-lifecycle.unit.test.ts | 2 +- .../command-internal/db-bootstrap/db-setup.ts | 2 +- .../db-bootstrap/db-setup.unit.test.ts | 2 +- .../db-bootstrap/health-check.ts | 6 +++--- .../db-bootstrap/health-check.unit.test.ts | 6 +++--- .../db-bootstrap/image-prepull.ts | 2 +- .../db-bootstrap/image-prepull.unit.test.ts | 2 +- .../db-bootstrap/local-container-inputs.ts | 6 +++--- .../local-db-running.integration.test.ts | 2 +- .../db-bootstrap/local-db-running.ts | 2 +- .../db-bootstrap/pgdata-snapshot.ts | 2 +- .../db-bootstrap/recreate-local-database.ts | 4 ++-- .../db-bootstrap/reset-local-database.ts | 2 +- .../db-bootstrap/restart-services.ts | 2 +- .../db-bootstrap/restart-services.unit.test.ts | 2 +- .../command-internal/db-bootstrap/rollback.ts | 2 +- .../db-bootstrap/rollback.unit.test.ts | 2 +- .../db-bootstrap/shadow-cache.ts | 2 +- .../db-bootstrap/shadow-database.ts | 2 +- .../db-bootstrap/shadow-database.unit.test.ts | 2 +- .../db-bootstrap/start-database.ts | 4 ++-- .../db-bootstrap/start-local-database.ts | 2 +- .../src/command-internal/db-config.service.ts | 2 +- .../db-connection.sql-pg.layer.ts | 4 ++-- .../db-connection.sql-pg.unit.test.ts | 2 +- apps/cli/src/command-internal/db-pull-run.ts | 2 +- .../src/command-internal/docker-image-resolve.ts | 2 +- .../docker-image-resolve.unit.test.ts | 4 ++-- .../cli/src/command-internal/docker-lifecycle.ts | 2 +- .../docker-lifecycle.unit.test.ts | 2 +- .../src/command-internal/docker-remove-all.ts | 2 +- .../cli/src/command-internal/docker-run.layer.ts | 2 +- apps/cli/src/command-internal/git-status.ts | 4 ++-- .../src/command-internal/git-status.unit.test.ts | 2 +- apps/cli/src/command-internal/global-flags.ts | 2 +- apps/cli/src/command-internal/go-proxy.layer.ts | 4 ++-- .../command-internal/go-proxy.layer.unit.test.ts | 2 +- apps/cli/src/command-internal/http-dns.ts | 2 +- .../src/command-internal/http-dns.unit.test.ts | 8 ++++---- apps/cli/src/command-internal/http-errors.ts | 4 ++-- .../command-internal/http-errors.unit.test.ts | 2 +- .../identity-stitch.integration.test.ts | 4 ++-- apps/cli/src/command-internal/identity-stitch.ts | 2 +- .../local-config-values.unit.test.ts | 2 +- apps/cli/src/command-internal/login-api.layer.ts | 4 ++-- .../management-api-runtime.layer.ts | 4 ++-- .../src/command-internal/param-introspection.ts | 4 ++-- .../param-introspection.unit.test.ts | 2 +- .../pg-dump.native.integration.test.ts | 2 +- apps/cli/src/command-internal/raw-http.ts | 2 +- apps/cli/src/command-internal/seed-buckets.ts | 2 +- apps/cli/src/command-internal/stack-api.ts | 4 ++-- .../stack-catalog-setup.integration.test.ts | 2 +- apps/cli/src/command-internal/stack-config.ts | 2 +- apps/cli/src/command-internal/stack-runtime.ts | 4 ++-- .../stack-storage.native.integration.test.ts | 2 +- apps/cli/src/command-internal/storage-gateway.ts | 8 ++++---- .../storage-gateway.unit.test.ts | 6 +++--- .../command-internal/storage-runtime.layer.ts | 2 +- .../src/command-internal/string-slice-flag.ts | 2 +- apps/cli/src/command-internal/tenant-versions.ts | 4 ++-- .../command-internal/test-db.command-handler.ts | 4 ++-- .../test-db.native.integration.test.ts | 2 +- apps/cli/src/command-internal/upgrade-suggest.ts | 8 ++++---- .../upgrade-suggest.unit.test.ts | 4 ++-- apps/cli/src/commands/backups/backups.command.ts | 2 +- .../src/commands/backups/list/list.command.ts | 4 ++-- .../commands/backups/restore/restore.command.ts | 4 ++-- .../backups/restore/restore.integration.test.ts | 2 +- .../src/commands/bootstrap/bootstrap.command.ts | 4 ++-- .../src/commands/bootstrap/bootstrap.handler.ts | 2 +- .../bootstrap.templates.integration.test.ts | 6 +++--- .../commands/bootstrap/bootstrap.templates.ts | 4 ++-- .../src/commands/branches/branches.command.ts | 2 +- .../commands/branches/create/create.command.ts | 4 ++-- .../branches/create/create.integration.test.ts | 2 +- .../commands/branches/delete/delete.command.ts | 4 ++-- .../commands/branches/disable/disable.command.ts | 4 ++-- .../cli/src/commands/branches/get/get.command.ts | 4 ++-- .../src/commands/branches/list/list.command.ts | 4 ++-- .../src/commands/branches/pause/pause.command.ts | 4 ++-- .../commands/branches/unpause/unpause.command.ts | 4 ++-- .../commands/branches/update/update.command.ts | 4 ++-- .../src/commands/completion/bash/bash.command.ts | 4 ++-- .../completion/bash/bash.integration.test.ts | 2 +- .../commands/completion/completion.command.ts | 2 +- .../src/commands/completion/completion.flags.ts | 2 +- .../src/commands/completion/fish/fish.command.ts | 4 ++-- .../completion/fish/fish.integration.test.ts | 2 +- .../completion/powershell/powershell.command.ts | 4 ++-- .../powershell/powershell.integration.test.ts | 2 +- .../src/commands/completion/zsh/zsh.command.ts | 4 ++-- .../completion/zsh/zsh.integration.test.ts | 2 +- apps/cli/src/commands/config/config.command.ts | 2 +- .../cli/src/commands/config/diff/diff.command.ts | 4 ++-- .../cli/src/commands/config/pull/pull.command.ts | 4 ++-- .../config/pull/pull.integration.test.ts | 4 ++-- .../commands/config/push/push.branch-target.ts | 2 +- .../cli/src/commands/config/push/push.command.ts | 4 ++-- .../src/commands/config/push/push.cost-matrix.ts | 6 +++--- .../config/push/push.integration.test.ts | 6 +++--- .../src/commands/db/advisors/advisors.command.ts | 4 ++-- .../db/advisors/advisors.integration.test.ts | 2 +- .../src/commands/db/advisors/advisors.linked.ts | 8 ++++---- .../cli/src/commands/db/branch/branch.command.ts | 2 +- .../commands/db/branch/create/create.command.ts | 4 ++-- .../commands/db/branch/delete/delete.command.ts | 4 ++-- .../src/commands/db/branch/list/list.command.ts | 4 ++-- .../commands/db/branch/switch/switch.command.ts | 4 ++-- apps/cli/src/commands/db/db.command.ts | 2 +- apps/cli/src/commands/db/diff/diff.command.ts | 4 ++-- apps/cli/src/commands/db/diff/diff.handler.ts | 2 +- .../commands/db/diff/diff.integration.test.ts | 4 ++-- .../db/diff/diff.stack-cache.e2e.test.ts | 2 +- apps/cli/src/commands/db/dump/dump.command.ts | 4 ++-- .../commands/db/dump/dump.integration.test.ts | 2 +- apps/cli/src/commands/db/lint/lint.command.ts | 4 ++-- apps/cli/src/commands/db/pull/pull.command.ts | 4 ++-- .../commands/db/pull/pull.integration.test.ts | 4 ++-- apps/cli/src/commands/db/push/push.command.ts | 4 ++-- apps/cli/src/commands/db/query/query.command.ts | 4 ++-- apps/cli/src/commands/db/query/query.handler.ts | 4 ++-- .../commands/db/query/query.integration.test.ts | 6 +++--- .../db/remote/changes/changes.command.ts | 4 ++-- .../commands/db/remote/commit/commit.command.ts | 4 ++-- .../cli/src/commands/db/remote/remote.command.ts | 2 +- apps/cli/src/commands/db/reset/reset.command.ts | 4 ++-- .../commands/db/reset/reset.integration.test.ts | 6 +++--- .../commands/db/reset/reset.stack.e2e.test.ts | 2 +- .../db/schema/declarative/declarative.command.ts | 2 +- .../db/schema/declarative/declarative.shared.ts | 2 +- .../declarative/generate/generate.command.ts | 4 ++-- .../db/schema/declarative/sync/sync.command.ts | 4 ++-- .../cli/src/commands/db/schema/schema.command.ts | 2 +- apps/cli/src/commands/db/shared/migra.ts | 2 +- .../db/shared/pgdelta-next-shadow.layer.ts | 6 +++--- ...pgdelta-next-shadow.stack.integration.test.ts | 2 +- .../db/shared/pgdelta.seam.integration.test.ts | 4 ++-- .../src/commands/db/shared/pgdelta.seam.layer.ts | 2 +- apps/cli/src/commands/db/shared/shadow-source.ts | 4 ++-- apps/cli/src/commands/db/start/start.command.ts | 4 ++-- .../commands/db/start/start.integration.test.ts | 6 +++--- apps/cli/src/commands/db/test/test.command.ts | 2 +- .../commands/db/test/test.integration.test.ts | 2 +- .../domains/activate/activate.command.ts | 4 ++-- .../commands/domains/create/create.command.ts | 4 ++-- .../commands/domains/create/create.handler.ts | 2 +- .../commands/domains/delete/delete.command.ts | 4 ++-- apps/cli/src/commands/domains/domains.cname.ts | 4 ++-- apps/cli/src/commands/domains/domains.command.ts | 2 +- apps/cli/src/commands/domains/get/get.command.ts | 4 ++-- .../domains/reverify/reverify.command.ts | 4 ++-- .../commands/encryption/encryption.command.ts | 2 +- .../get-root-key/get-root-key.command.ts | 4 ++-- .../update-root-key/update-root-key.command.ts | 4 ++-- .../experimental/compute/compute.command.ts | 2 +- .../compute/delete/delete.command.ts | 4 ++-- .../experimental/compute/list/list.command.ts | 4 ++-- .../experimental/compute/logs/logs.command.ts | 4 ++-- .../compute/logs/logs.integration.test.ts | 2 +- .../experimental/compute/new/new.command.ts | 4 ++-- .../experimental/compute/push/push.command.ts | 4 ++-- .../compute/status/status.command.ts | 4 ++-- .../stack/destroy/destroy.command.ts | 4 ++-- .../experimental/stack/list/list.command.ts | 2 +- .../experimental/stack/logs/logs.command.ts | 4 ++-- .../stack/prepare/prepare.command.ts | 4 ++-- .../stack/restart/restart.command.ts | 4 ++-- .../stack-command-telemetry.integration.test.ts | 2 +- .../commands/experimental/stack/stack.command.ts | 2 +- .../start-export-pointer.integration.test.ts | 2 +- .../experimental/stack/start/start.command.ts | 4 ++-- .../experimental/stack/start/start.e2e.test.ts | 2 +- .../stack/start/start.integration.test.ts | 2 +- .../stack/start/start.native.integration.test.ts | 2 +- .../stack/start/start.storage.e2e.test.ts | 2 +- .../experimental/stack/status/status.command.ts | 4 ++-- .../experimental/stack/stop/stop.command.ts | 4 ++-- .../cli/src/commands/feedback/add/add.command.ts | 4 ++-- .../commands/feedback/delete/delete.command.ts | 4 ++-- .../src/commands/feedback/feedback.command.ts | 2 +- .../commands/functions/delete/delete.command.ts | 4 ++-- .../commands/functions/deploy/deploy.command.ts | 4 ++-- .../functions/deploy/deploy.integration.test.ts | 2 +- .../functions/download/download.command.ts | 4 ++-- .../download/download.integration.test.ts | 4 ++-- .../src/commands/functions/functions.command.ts | 2 +- .../src/commands/functions/list/list.command.ts | 4 ++-- .../functions/list/list.integration.test.ts | 2 +- .../src/commands/functions/new/new.command.ts | 4 ++-- .../commands/functions/new/new.stack.e2e.test.ts | 2 +- .../serve/serve.command.integration.test.ts | 2 +- .../commands/functions/serve/serve.command.ts | 2 +- .../functions/serve/serve.integration.test.ts | 4 ++-- .../functions/serve/serve.stack.e2e.test.ts | 2 +- .../gen/bearer-jwt/bearer-jwt.command.ts | 4 ++-- .../bearer-jwt/bearer-jwt.integration.test.ts | 2 +- apps/cli/src/commands/gen/gen.command.ts | 2 +- apps/cli/src/commands/gen/keys/keys.command.ts | 4 ++-- .../gen/signing-key/signing-key.command.ts | 4 ++-- .../gen/signing-key/signing-key.handler.ts | 2 +- .../signing-key/signing-key.integration.test.ts | 4 ++-- apps/cli/src/commands/gen/types/types.command.ts | 4 ++-- .../commands/gen/types/types.generator.layer.ts | 2 +- apps/cli/src/commands/gen/types/types.handler.ts | 2 +- .../commands/gen/types/types.integration.test.ts | 8 ++++---- .../src/commands/gen/types/types.languages.ts | 2 +- .../types/types.typegen-host.integration.test.ts | 2 +- .../src/commands/gen/types/types.typegen-host.ts | 2 +- .../gen/types/types.typegen-host.unit.test.ts | 2 +- apps/cli/src/commands/init/init.command.ts | 4 ++-- .../commands/inspect/db/bloat/bloat.command.ts | 2 +- .../inspect/db/blocking/blocking.command.ts | 2 +- .../inspect/db/cache-hit/cache-hit.command.ts | 2 +- .../commands/inspect/db/calls/calls.command.ts | 2 +- .../inspect/db/db-stats/db-stats.command.ts | 2 +- apps/cli/src/commands/inspect/db/db.command.ts | 2 +- .../db/index-sizes/index-sizes.command.ts | 2 +- .../db/index-stats/index-stats.command.ts | 2 +- .../db/index-usage/index-usage.command.ts | 2 +- .../commands/inspect/db/inspect-db-command.ts | 2 +- .../commands/inspect/db/locks/locks.command.ts | 2 +- .../long-running-queries.command.ts | 2 +- .../inspect/db/outliers/outliers.command.ts | 2 +- .../replication-slots.command.ts | 2 +- .../db/role-configs/role-configs.command.ts | 2 +- .../role-connections/role-connections.command.ts | 2 +- .../inspect/db/role-stats/role-stats.command.ts | 2 +- .../inspect/db/seq-scans/seq-scans.command.ts | 2 +- .../table-index-sizes.command.ts | 2 +- .../table-record-counts.command.ts | 2 +- .../db/table-sizes/table-sizes.command.ts | 2 +- .../db/table-stats/table-stats.command.ts | 2 +- .../total-index-size/total-index-size.command.ts | 2 +- .../total-table-sizes.command.ts | 2 +- .../traffic-profile/traffic-profile.command.ts | 2 +- .../db/unused-indexes/unused-indexes.command.ts | 2 +- .../db/vacuum-stats/vacuum-stats.command.ts | 2 +- apps/cli/src/commands/inspect/inspect.command.ts | 2 +- .../commands/inspect/report/report.command.ts | 4 ++-- apps/cli/src/commands/issue/issue.command.ts | 4 ++-- apps/cli/src/commands/link/link.command.ts | 4 ++-- .../src/commands/link/link.integration.test.ts | 8 ++++---- apps/cli/src/commands/login/login.command.ts | 4 ++-- .../src/commands/login/login.integration.test.ts | 2 +- apps/cli/src/commands/logout/logout.command.ts | 2 +- .../src/commands/migration/down/down.command.ts | 4 ++-- .../commands/migration/fetch/fetch.command.ts | 4 ++-- .../src/commands/migration/list/list.command.ts | 4 ++-- .../src/commands/migration/migration.command.ts | 2 +- .../migration/migration.integration.test.ts | 2 +- .../src/commands/migration/new/new.command.ts | 4 ++-- .../commands/migration/repair/repair.command.ts | 2 +- .../commands/migration/squash/squash.command.ts | 4 ++-- .../commands/migration/squash/squash.handler.ts | 4 ++-- .../migration/squash/squash.integration.test.ts | 4 ++-- .../squash/squash.native.integration.test.ts | 2 +- apps/cli/src/commands/migration/up/up.command.ts | 4 ++-- .../src/commands/network-bans/get/get.command.ts | 4 ++-- .../network-bans/network-bans.command.ts | 2 +- ...rk-bans.experimental-gate.integration.test.ts | 2 +- .../network-bans/remove/remove.command.ts | 4 ++-- .../network-restrictions/get/get.command.ts | 4 ++-- .../network-restrictions.command.ts | 2 +- ...ictions.experimental-gate.integration.test.ts | 2 +- .../update/update.command.ts | 4 ++-- .../src/commands/notebooks/notebooks.command.ts | 2 +- .../src/commands/notebooks/pull/pull.command.ts | 4 ++-- .../src/commands/notebooks/push/push.command.ts | 4 ++-- .../src/commands/orgs/create/create.command.ts | 4 ++-- apps/cli/src/commands/orgs/list/list.command.ts | 4 ++-- apps/cli/src/commands/orgs/orgs.command.ts | 2 +- .../postgres-config/delete/delete.command.ts | 4 ++-- .../commands/postgres-config/get/get.command.ts | 4 ++-- .../postgres-config/postgres-config.command.ts | 2 +- ...-config.experimental-gate.integration.test.ts | 2 +- .../postgres-config/postgres-config.shared.ts | 6 +++--- .../postgres-config/update/update.command.ts | 4 ++-- .../projects/api-keys/api-keys.command.ts | 4 ++-- .../commands/projects/create/create.command.ts | 4 ++-- .../projects/create/create.integration.test.ts | 2 +- .../commands/projects/delete/delete.command.ts | 4 ++-- .../commands/projects/delete/delete.handler.ts | 2 +- .../src/commands/projects/list/list.command.ts | 4 ++-- .../src/commands/projects/projects.command.ts | 2 +- apps/cli/src/commands/pull/pull.command.ts | 4 ++-- .../src/commands/pull/pull.integration.test.ts | 4 ++-- apps/cli/src/commands/pull/pull.layers.ts | 2 +- .../src/commands/secrets/list/list.command.ts | 4 ++-- apps/cli/src/commands/secrets/secrets.command.ts | 2 +- apps/cli/src/commands/secrets/set/set.command.ts | 4 ++-- .../src/commands/secrets/unset/unset.command.ts | 4 ++-- .../src/commands/seed/buckets/buckets.command.ts | 2 +- .../seed/buckets/buckets.integration.test.ts | 6 +++--- apps/cli/src/commands/seed/seed.command.ts | 2 +- apps/cli/src/commands/seed/seed.flags.ts | 2 +- .../src/commands/services/services.command.ts | 4 ++-- .../services/services.integration.test.ts | 4 ++-- .../cli/src/commands/services/services.layers.ts | 4 ++-- .../snippets/download/download.command.ts | 4 ++-- .../snippets/download/download.handler.ts | 4 ++-- .../src/commands/snippets/list/list.command.ts | 4 ++-- .../src/commands/snippets/list/list.handler.ts | 4 ++-- .../src/commands/snippets/snippets.command.ts | 2 +- .../commands/ssl-enforcement/get/get.command.ts | 4 ++-- .../ssl-enforcement/ssl-enforcement.command.ts | 2 +- ...rcement.experimental-gate.integration.test.ts | 2 +- .../ssl-enforcement/update/update.command.ts | 4 ++-- apps/cli/src/commands/sso/add/add.command.ts | 4 ++-- apps/cli/src/commands/sso/add/add.handler.ts | 4 ++-- .../src/commands/sso/add/add.integration.test.ts | 2 +- apps/cli/src/commands/sso/info/info.command.ts | 4 ++-- apps/cli/src/commands/sso/list/list.command.ts | 4 ++-- .../commands/sso/list/list.integration.test.ts | 2 +- .../src/commands/sso/remove/remove.command.ts | 4 ++-- .../sso/remove/remove.integration.test.ts | 2 +- apps/cli/src/commands/sso/show/show.command.ts | 4 ++-- apps/cli/src/commands/sso/sso.command.ts | 2 +- apps/cli/src/commands/sso/sso.metadata-url.ts | 6 +++--- .../sso.string-slice-flags.integration.test.ts | 2 +- .../src/commands/sso/update/update.command.ts | 4 ++-- .../src/commands/sso/update/update.handler.ts | 4 ++-- .../sso/update/update.integration.test.ts | 2 +- .../edge-runtime.service.integration.test.ts | 2 +- .../commands/start/services/vector.service.ts | 4 ++-- .../start/services/vector.service.unit.test.ts | 2 +- apps/cli/src/commands/start/start.command.ts | 4 ++-- apps/cli/src/commands/start/start.handler.ts | 4 ++-- .../src/commands/start/start.integration.test.ts | 6 +++--- .../commands/start/start.slim-images.e2e.test.ts | 2 +- .../start.string-slice-flags.integration.test.ts | 2 +- apps/cli/src/commands/status/status.command.ts | 4 ++-- apps/cli/src/commands/status/status.handler.ts | 2 +- .../commands/status/status.integration.test.ts | 6 +++--- ...status.string-slice-flags.integration.test.ts | 2 +- apps/cli/src/commands/stop/stop.command.ts | 4 ++-- apps/cli/src/commands/stop/stop.e2e.test.ts | 2 +- apps/cli/src/commands/stop/stop.handler.ts | 2 +- .../src/commands/stop/stop.integration.test.ts | 2 +- .../storage/cp/cp.command.integration.test.ts | 2 +- apps/cli/src/commands/storage/cp/cp.command.ts | 4 ++-- apps/cli/src/commands/storage/ls/ls.command.ts | 4 ++-- apps/cli/src/commands/storage/mv/mv.command.ts | 4 ++-- apps/cli/src/commands/storage/rm/rm.command.ts | 2 +- apps/cli/src/commands/storage/storage.command.ts | 2 +- ...storage.experimental-gate.integration.test.ts | 2 +- apps/cli/src/commands/storage/storage.flags.ts | 2 +- apps/cli/src/commands/storage/storage.frame.ts | 2 +- .../telemetry/disable/disable.command.ts | 4 ++-- .../commands/telemetry/enable/enable.command.ts | 4 ++-- .../commands/telemetry/status/status.command.ts | 4 ++-- .../src/commands/telemetry/telemetry.command.ts | 2 +- .../telemetry/telemetry.integration.test.ts | 4 ++-- apps/cli/src/commands/test/db/db.command.ts | 2 +- apps/cli/src/commands/test/new/new.command.ts | 4 ++-- apps/cli/src/commands/test/test.command.ts | 2 +- apps/cli/src/commands/unlink/unlink.command.ts | 2 +- .../commands/unlink/unlink.integration.test.ts | 2 +- .../activate/activate.command.ts | 4 ++-- .../check-availability.command.ts | 4 ++-- .../vanity-subdomains/delete/delete.command.ts | 4 ++-- .../vanity-subdomains/get/get.command.ts | 4 ++-- .../vanity-subdomains.command.ts | 2 +- ...domains.experimental-gate.integration.test.ts | 2 +- apps/cli/src/commands/whoami/whoami.command.ts | 4 ++-- apps/cli/src/docs/docs-introspection.ts | 2 +- apps/cli/src/docs/docs-spec.ts | 4 ++-- apps/cli/src/docs/docs-spec.unit.test.ts | 2 +- .../cli/src/shared/auth/jwks.integration.test.ts | 2 +- apps/cli/src/shared/auth/jwks.ts | 2 +- apps/cli/src/shared/cli/command-docs.ts | 2 +- .../cli/src/shared/cli/command-docs.unit.test.ts | 2 +- apps/cli/src/shared/cli/hidden-flag.unit.test.ts | 2 +- apps/cli/src/shared/cli/markdown-formatter.ts | 2 +- .../shared/cli/markdown-formatter.unit.test.ts | 2 +- apps/cli/src/shared/cli/run.integration.test.ts | 2 +- apps/cli/src/shared/cli/run.ts | 6 +++--- apps/cli/src/shared/cli/run.unit.test.ts | 2 +- .../shared/cli/subcommand-flag-suggestions.ts | 2 +- .../cli/subcommand-flag-suggestions.unit.test.ts | 2 +- .../src/shared/cli/version.integration.test.ts | 4 ++-- .../cli/src/shared/compute/compute-api-status.ts | 4 ++-- apps/cli/src/shared/compute/compute-api.ts | 4 ++-- apps/cli/src/shared/functions/delete.ts | 2 +- apps/cli/src/shared/functions/deploy.ts | 4 ++-- apps/cli/src/shared/functions/download.ts | 6 +++--- .../cli/src/shared/functions/functions-docker.ts | 2 +- .../functions/functions-docker.unit.test.ts | 4 ++-- .../functions/serve-main-offline.e2e.test.ts | 6 +++--- apps/cli/src/shared/functions/serve.ts | 2 +- apps/cli/src/shared/output/json-formatter.ts | 2 +- apps/cli/src/shared/output/normalize-error.ts | 2 +- .../shared/output/normalize-error.unit.test.ts | 2 +- apps/cli/src/shared/output/text-formatter.ts | 2 +- .../shared/output/text-formatter.unit.test.ts | 2 +- apps/cli/src/shared/runtime/browser.layer.ts | 2 +- .../shared/runtime/browser.layer.unit.test.ts | 2 +- .../src/shared/runtime/stdin.integration.test.ts | 2 +- apps/cli/src/shared/services/services.shared.ts | 4 ++-- .../shared/services/services.shared.unit.test.ts | 2 +- .../error-actionability-coverage.unit.test.ts | 2 +- .../src/shared/telemetry/error-actionability.ts | 4 ++-- .../telemetry/error-actionability.unit.test.ts | 2 +- apps/cli/src/shared/telemetry/otlp-trace-sink.ts | 8 ++++---- apps/cli/src/shared/telemetry/posthog-client.ts | 2 +- .../shared/telemetry/posthog-client.unit.test.ts | 2 +- apps/cli/src/shared/telemetry/spans.ts | 4 ++-- .../src/shared/telemetry/trace-export.layer.ts | 2 +- apps/cli/src/shared/telemetry/trace-sanitize.ts | 4 ++-- .../shared/telemetry/trace-sanitize.unit.test.ts | 4 ++-- .../analytics.layer.integration.test.ts | 2 +- apps/cli/src/telemetry/command-telemetry.ts | 2 +- .../src/telemetry/command-telemetry.unit.test.ts | 2 +- .../linked-project-cache.integration.test.ts | 2 +- .../src/telemetry/linked-project-cache.layer.ts | 4 ++-- apps/cli/tests/helpers/child-process-spawner.ts | 2 +- apps/cli/tests/helpers/cli.ts | 2 +- apps/cli/tests/helpers/command-mocks.ts | 16 ++++++++-------- apps/cli/tests/helpers/compute.ts | 8 ++++---- apps/cli/tests/helpers/docker-image.ts | 6 +++--- apps/cli/tests/helpers/docker-image.unit.test.ts | 2 +- .../helpers/live-project.integration.test.ts | 6 +++--- apps/cli/tests/helpers/live-project.ts | 2 +- apps/cli/tests/helpers/live-project.unit.test.ts | 6 +++--- apps/cli/tests/helpers/local-reset.ts | 6 +++--- apps/cli/tests/helpers/notebooks.ts | 10 +++++----- apps/cli/tests/helpers/storage.ts | 4 ++-- apps/cli/tests/live-global-setup.ts | 2 +- packages/api/src/bun.ts | 2 +- packages/api/src/effect.unit.test.ts | 8 ++++---- packages/api/src/internal/client.ts | 10 +++++----- packages/api/src/internal/client.unit.test.ts | 12 ++++++------ .../api/src/internal/promise-client.unit.test.ts | 10 +++++----- .../api/src/node-lifecycle.integration.test.ts | 2 +- .../stack/src/HostProcess.integration.test.ts | 8 ++++---- packages/stack/src/HostProcess.ts | 8 ++++---- packages/stack/src/HttpProxy.integration.test.ts | 2 +- packages/stack/src/Network.integration.test.ts | 2 +- .../src/Owner.analytics.integration.test.ts | 2 +- packages/stack/src/Owner.integration.test.ts | 4 ++-- packages/stack/src/Owner.ts | 6 +++--- packages/stack/src/Proxy.integration.test.ts | 2 +- packages/stack/src/Proxy.ts | 2 +- packages/stack/src/Rpc.ts | 2 +- ...ckHost.container-shutdown.integration.test.ts | 2 +- ...ost.container-sweep-retry.integration.test.ts | 2 +- packages/stack/src/StackHost.integration.test.ts | 6 +++--- packages/stack/src/StackHost.ts | 10 +++++----- .../stack/src/State.process.integration.test.ts | 2 +- .../stack/src/State.windows.integration.test.ts | 2 +- packages/stack/src/Sweep.integration.test.ts | 2 +- .../Supabase.native.integration.test.ts | 2 +- .../create.owner-rollback.integration.test.ts | 2 +- ...stroy.runtime-unavailable.integration.test.ts | 2 +- .../stack/src/effect-timeout.integration.test.ts | 2 +- packages/stack/src/effect.ts | 4 ++-- ...mandRunner.native-cleanup.integration.test.ts | 2 +- packages/stack/src/host/CommandRunner.ts | 4 ++-- packages/stack/src/host/LogForwarder.ts | 2 +- .../src/internal/dispatch.integration.test.ts | 2 +- packages/stack/src/lifetime.integration.test.ts | 2 +- packages/stack/src/preparation/ArtifactStore.ts | 4 ++-- .../stack/src/preparation/SlimServicesSource.ts | 4 ++-- .../slim-services.integration.test.ts | 2 +- packages/stack/src/public.e2e.test.ts | 4 ++-- .../src/runtime/Container.integration.test.ts | 6 +++--- packages/stack/src/runtime/Container.ts | 2 +- packages/stack/src/runtime/NativeProcess.ts | 4 ++-- .../stack/src/runtime/PostgresDatabaseSession.ts | 2 +- .../container-image-mirror.integration.test.ts | 2 +- .../runtime/native-process.integration.test.ts | 6 +++--- ...postgres-database-session.integration.test.ts | 2 +- packages/stack/src/runtime/postgres-user.ts | 2 +- .../AnalyticsImgproxy.integration.test.ts | 2 +- .../src/services/AuthStorage.integration.test.ts | 2 +- packages/stack/src/services/Catalog.ts | 4 ++-- packages/stack/src/services/Database.ts | 6 +++--- .../DatabaseSnapshot.integration.test.ts | 2 +- packages/stack/src/services/DatabaseSnapshot.ts | 2 +- .../src/services/Functions.integration.test.ts | 4 ++-- .../stack/src/services/Mail.integration.test.ts | 2 +- .../services/ProcessRecipe.integration.test.ts | 6 +++--- packages/stack/src/services/ProcessRecipe.ts | 6 +++--- .../src/services/Realtime.integration.test.ts | 2 +- .../stack/src/services/Rest.integration.test.ts | 2 +- .../services/StorageGateway.integration.test.ts | 2 +- packages/stack/src/shutdown.integration.test.ts | 2 +- .../storage/DirectoryCopy.integration.test.ts | 2 +- packages/stack/src/storage/DirectoryCopy.ts | 2 +- .../DockerDatabaseStorage.integration.test.ts | 2 +- .../stack/src/storage/DockerDatabaseStorage.ts | 4 ++-- packages/stack/tests/docker-cleanup.ts | 2 +- .../tests/docker-fixture.integration.test.ts | 2 +- packages/stack/tests/docker-fixture.ts | 2 +- .../tests/docker-volume-run.integration.test.ts | 2 +- packages/stack/tests/helpers/git.ts | 2 +- packages/stack/tests/host-process-fixture.ts | 2 +- packages/stack/tests/owner-rpc.ts | 2 +- packages/stack/tests/owner.ts | 2 +- packages/stack/tests/state-lock-fixture.ts | 2 +- packages/stack/tests/whole-stack/analytics.ts | 2 +- packages/stack/tests/whole-stack/fixture.ts | 2 +- packages/stack/tests/whole-stack/idle.ts | 2 +- .../stack/tests/whole-stack/realtime-mail.ts | 2 +- .../stack/tests/whole-stack/service-flows.ts | 2 +- packages/stack/tests/whole-stack/websocket.ts | 2 +- packages/stack/tests/whole-stack/workloads.ts | 2 +- 525 files changed, 839 insertions(+), 839 deletions(-) diff --git a/apps/cli/scripts/bench-cli.ts b/apps/cli/scripts/bench-cli.ts index 94e77f2da2..7e7530bb63 100644 --- a/apps/cli/scripts/bench-cli.ts +++ b/apps/cli/scripts/bench-cli.ts @@ -11,7 +11,7 @@ import process from "node:process"; import { parseArgs } from "node:util"; import { BunRuntime, BunServices } from "@effect/platform-bun"; import { Clock, Console, Effect, FileSystem, Path, Ref, Stdio } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { readSpans, type ReportSpan } from "./trace-report.ts"; const USAGE = diff --git a/apps/cli/src/auth/command-platform-api-factory.layer.ts b/apps/cli/src/auth/command-platform-api-factory.layer.ts index bac5353c7f..cffbb8f951 100644 --- a/apps/cli/src/auth/command-platform-api-factory.layer.ts +++ b/apps/cli/src/auth/command-platform-api-factory.layer.ts @@ -1,4 +1,4 @@ -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { Effect, Layer } from "effect"; import { dohFetchLayer } from "../command-internal/http-dns.ts"; diff --git a/apps/cli/src/auth/command-platform-api.layer.ts b/apps/cli/src/auth/command-platform-api.layer.ts index d0bc9f2a46..223096c775 100644 --- a/apps/cli/src/auth/command-platform-api.layer.ts +++ b/apps/cli/src/auth/command-platform-api.layer.ts @@ -1,6 +1,6 @@ import { makeApiClient } from "@supabase/api/effect"; import { Effect, Layer, Option, Redacted } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import * as HttpClient from "effect/http/HttpClient"; import { CLI_VERSION } from "../shared/cli/version.ts"; import { CommandSettings } from "../config/command-settings.service.ts"; diff --git a/apps/cli/src/auth/command-platform-api.layer.unit.test.ts b/apps/cli/src/auth/command-platform-api.layer.unit.test.ts index 84dc920389..71b087fc45 100644 --- a/apps/cli/src/auth/command-platform-api.layer.unit.test.ts +++ b/apps/cli/src/auth/command-platform-api.layer.unit.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "@effect/vitest"; import { Effect, Exit, FileSystem, Layer, Option, Path, Redacted } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { access, mkdir, readFile, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; diff --git a/apps/cli/src/auth/http-debug.layer.ts b/apps/cli/src/auth/http-debug.layer.ts index 0d10151e3c..e1bdc82b69 100644 --- a/apps/cli/src/auth/http-debug.layer.ts +++ b/apps/cli/src/auth/http-debug.layer.ts @@ -1,6 +1,6 @@ import { Effect, Layer } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import { FetchHttpClient } from "effect/http"; +import * as HttpClient from "effect/http/HttpClient"; import { dohFetchLayer } from "../command-internal/http-dns.ts"; import { DebugLogger } from "../command-internal/debug-logger.service.ts"; diff --git a/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts b/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts index a12ea64acc..8ae23b6905 100644 --- a/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts +++ b/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { Primitive, type Command } from "effect/unstable/cli"; +import { Primitive, type Command } from "effect/cli"; import { commandInternals, flattenSubcommands, diff --git a/apps/cli/src/cli/complete.ts b/apps/cli/src/cli/complete.ts index c305a00051..93a03c758e 100644 --- a/apps/cli/src/cli/complete.ts +++ b/apps/cli/src/cli/complete.ts @@ -1,8 +1,8 @@ import { BunServices } from "@effect/platform-bun"; import { Cause, Effect, Layer, Option } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; -import { GlobalFlag } from "effect/unstable/cli"; -import type { Command, Param, Primitive } from "effect/unstable/cli"; +import { FetchHttpClient } from "effect/http"; +import { GlobalFlag } from "effect/cli"; +import type { Command, Param, Primitive } from "effect/cli"; import process from "node:process"; import { QUERY_OUTPUT_FORMATS, diff --git a/apps/cli/src/cli/main.ts b/apps/cli/src/cli/main.ts index f6c506c85d..d1e2f2147f 100644 --- a/apps/cli/src/cli/main.ts +++ b/apps/cli/src/cli/main.ts @@ -1,7 +1,7 @@ #!/usr/bin/env bun import { BunServices } from "@effect/platform-bun"; import { Effect, Exit, Layer, Stdio } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { runCli } from "../shared/cli/run.ts"; import { upgradeNoticeHook } from "../command-internal/upgrade-notice.ts"; import { analyticsLayer } from "../telemetry/analytics.layer.ts"; diff --git a/apps/cli/src/cli/root-stack-aliases.integration.test.ts b/apps/cli/src/cli/root-stack-aliases.integration.test.ts index 2d6f2266d9..cbcefd0954 100644 --- a/apps/cli/src/cli/root-stack-aliases.integration.test.ts +++ b/apps/cli/src/cli/root-stack-aliases.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "@effect/vitest"; import { Console, Effect, Layer, Option } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { emptyEnv, fakeConsole, mockOutput } from "../../tests/helpers/mocks.ts"; import { CliArgs } from "../shared/cli/cli-args.service.ts"; import { textCliOutputFormatter } from "../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/cli/root.ts b/apps/cli/src/cli/root.ts index 620d42231f..1acd3c6bf7 100644 --- a/apps/cli/src/cli/root.ts +++ b/apps/cli/src/cli/root.ts @@ -1,5 +1,5 @@ import { Effect, Layer, Option } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { backupsCommand } from "../commands/backups/backups.command.ts"; import { bootstrapCommand } from "../commands/bootstrap/bootstrap.command.ts"; import { branchesCommand } from "../commands/branches/branches.command.ts"; diff --git a/apps/cli/src/command-internal/branch-target.ts b/apps/cli/src/command-internal/branch-target.ts index 1733f7a1b2..87baf401cc 100644 --- a/apps/cli/src/command-internal/branch-target.ts +++ b/apps/cli/src/command-internal/branch-target.ts @@ -1,6 +1,6 @@ import type { ApiClient, V1ListAllBranchesOutput } from "@supabase/api/effect"; import { Duration, Effect, Option } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpClientError from "effect/http/HttpClientError"; import { CommandPlatformApiFactory } from "../auth/command-platform-api-factory.service.ts"; import { CommandPlatformApi } from "../auth/command-platform-api.service.ts"; diff --git a/apps/cli/src/command-internal/bundled-postgres-client.ts b/apps/cli/src/command-internal/bundled-postgres-client.ts index 8495a41661..8fd768d47c 100644 --- a/apps/cli/src/command-internal/bundled-postgres-client.ts +++ b/apps/cli/src/command-internal/bundled-postgres-client.ts @@ -10,8 +10,8 @@ import { PlatformError, Stream, } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { FetchHttpClient } from "effect/http"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { ArtifactError, postgresVersion, diff --git a/apps/cli/src/command-internal/connect-errors.unit.test.ts b/apps/cli/src/command-internal/connect-errors.unit.test.ts index 5420f47ef3..06ecd7f09e 100644 --- a/apps/cli/src/command-internal/connect-errors.unit.test.ts +++ b/apps/cli/src/command-internal/connect-errors.unit.test.ts @@ -1,4 +1,4 @@ -import { ConnectionError, SqlError } from "effect/unstable/sql/SqlError"; +import { ConnectionError, SqlError } from "effect/sql/SqlError"; import * as Pg from "pg"; import { describe, expect, it } from "vitest"; diff --git a/apps/cli/src/command-internal/container-cli.ts b/apps/cli/src/command-internal/container-cli.ts index 8ea7a0addc..9eef1e4075 100644 --- a/apps/cli/src/command-internal/container-cli.ts +++ b/apps/cli/src/command-internal/container-cli.ts @@ -1,6 +1,6 @@ import { Data, Effect, Stream } from "effect"; -import * as ChildProcess from "effect/unstable/process/ChildProcess"; -import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import * as ChildProcess from "effect/process/ChildProcess"; +import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { withChildTraceEnv, diff --git a/apps/cli/src/command-internal/container-cli.unit.test.ts b/apps/cli/src/command-internal/container-cli.unit.test.ts index 26d92e53ca..7f69cb8b1b 100644 --- a/apps/cli/src/command-internal/container-cli.unit.test.ts +++ b/apps/cli/src/command-internal/container-cli.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Exit, PlatformError, Sink, Stream, Tracer } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { containerCliExitCode, diff --git a/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.ts b/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.ts index 24eb15c41e..9e01c29068 100644 --- a/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.ts +++ b/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.ts @@ -8,8 +8,8 @@ */ import { Effect, Result } from "effect"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type * as HttpClient from "effect/http/HttpClient"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { inspectContainerState } from "../docker-lifecycle.ts"; import { serviceContainerName } from "../docker-ids.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.unit.test.ts index 55b5edb922..de3f84d05a 100644 --- a/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/await-storage-ready.unit.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Deferred, Effect, Exit, Fiber, Layer, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; import * as TestClock from "effect/testing/TestClock"; import { HealthCheckTimeoutError } from "./health-check.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.ts b/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.ts index bc078643c8..4d3cb98dc2 100644 --- a/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.ts +++ b/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.ts @@ -9,7 +9,7 @@ */ import { Data, Effect, Stream } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { actionability, diff --git a/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.unit.test.ts index 5c250bf23b..8fc596ac8b 100644 --- a/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/container-lifecycle.unit.test.ts @@ -4,7 +4,7 @@ import { join } from "node:path"; import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, PlatformError, Sink, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { afterEach, beforeEach } from "vitest"; import { diff --git a/apps/cli/src/command-internal/db-bootstrap/db-setup.ts b/apps/cli/src/command-internal/db-bootstrap/db-setup.ts index 4ad1081f39..5e6246b0bf 100644 --- a/apps/cli/src/command-internal/db-bootstrap/db-setup.ts +++ b/apps/cli/src/command-internal/db-bootstrap/db-setup.ts @@ -11,7 +11,7 @@ import type { CliConfig } from "@supabase/config"; import { Data, Effect, type FileSystem, Option, type Path, Schedule } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import type { LocalServiceVersionOverrides } from "../../shared/services/services.shared.ts"; import { slimImagesEnabled } from "../../shared/services/slim-images.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/db-setup.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/db-setup.unit.test.ts index 83ea77ad29..ca8e689909 100644 --- a/apps/cli/src/command-internal/db-bootstrap/db-setup.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/db-setup.unit.test.ts @@ -7,7 +7,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { afterEach, vi } from "vitest"; import { Deferred, Effect, FileSystem, Layer, Path, Schema, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { mockOutput, mockRuntimeInfo } from "../../../tests/helpers/mocks.ts"; import { DbExecError } from "../db-connection.errors.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/health-check.ts b/apps/cli/src/command-internal/db-bootstrap/health-check.ts index c8420daf07..267b997177 100644 --- a/apps/cli/src/command-internal/db-bootstrap/health-check.ts +++ b/apps/cli/src/command-internal/db-bootstrap/health-check.ts @@ -6,9 +6,9 @@ */ import { Context, Data, Duration, Effect, Schedule, Stream } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { actionability, diff --git a/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts index 2e45bbcc4f..b05716271d 100644 --- a/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Exit, Fiber, Layer, Sink, Stream, Tracer } from "effect"; import * as PlatformError from "effect/PlatformError"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import * as TestClock from "effect/testing/TestClock"; import { DbConnectError } from "../db-connection.errors.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/image-prepull.ts b/apps/cli/src/command-internal/db-bootstrap/image-prepull.ts index 2aabd6536d..3baa883787 100644 --- a/apps/cli/src/command-internal/db-bootstrap/image-prepull.ts +++ b/apps/cli/src/command-internal/db-bootstrap/image-prepull.ts @@ -5,7 +5,7 @@ */ import { Data, Effect, Result } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { actionability, diff --git a/apps/cli/src/command-internal/db-bootstrap/image-prepull.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/image-prepull.unit.test.ts index f048dbf70c..638702f1cd 100644 --- a/apps/cli/src/command-internal/db-bootstrap/image-prepull.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/image-prepull.unit.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Fiber, Ref, Sink, Stream } from "effect"; import * as TestClock from "effect/testing/TestClock"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { ImagePrepullError, ensureImagesCached } from "./image-prepull.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/local-container-inputs.ts b/apps/cli/src/command-internal/db-bootstrap/local-container-inputs.ts index ce589339a3..4921da50e2 100644 --- a/apps/cli/src/command-internal/db-bootstrap/local-container-inputs.ts +++ b/apps/cli/src/command-internal/db-bootstrap/local-container-inputs.ts @@ -9,9 +9,9 @@ */ import { Crypto, Effect, FileSystem, Option, Path } from "effect"; -import { HttpClient } from "effect/unstable/http"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; -import type { GlobalFlag } from "effect/unstable/cli"; +import { HttpClient } from "effect/http"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; +import type { GlobalFlag } from "effect/cli"; import { CliArgs } from "../../shared/cli/cli-args.service.ts"; import { RuntimeInfo } from "../../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/local-db-running.integration.test.ts b/apps/cli/src/command-internal/db-bootstrap/local-db-running.integration.test.ts index 70ba2f5754..7bd9526ee1 100644 --- a/apps/cli/src/command-internal/db-bootstrap/local-db-running.integration.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/local-db-running.integration.test.ts @@ -6,7 +6,7 @@ import { join } from "node:path"; import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { ConfigProvider, Effect, FileSystem, Layer, Option, Path } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { mockContainerCliSpawner } from "../../../tests/helpers/local-reset.ts"; import { DebugLogger } from "../debug-logger.service.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts b/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts index bc873b6c43..1f4e8b2ce0 100644 --- a/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts +++ b/apps/cli/src/command-internal/db-bootstrap/local-db-running.ts @@ -1,7 +1,7 @@ import http from "node:http"; import { Context, Crypto, Data, Effect, FileSystem, Layer, Option, Path, Stream } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { actionability, diff --git a/apps/cli/src/command-internal/db-bootstrap/pgdata-snapshot.ts b/apps/cli/src/command-internal/db-bootstrap/pgdata-snapshot.ts index 8bf6d9d4b0..afa0317e8d 100644 --- a/apps/cli/src/command-internal/db-bootstrap/pgdata-snapshot.ts +++ b/apps/cli/src/command-internal/db-bootstrap/pgdata-snapshot.ts @@ -13,7 +13,7 @@ */ import { Effect, Option, Stream, type FileSystem } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { collectText, describeContainerCliFailure, spawnContainerCli } from "../container-cli.ts"; import { dockerCopyArchiveIntoContainer } from "./container-lifecycle.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/recreate-local-database.ts b/apps/cli/src/command-internal/db-bootstrap/recreate-local-database.ts index 148166dbeb..0ef0f625e1 100644 --- a/apps/cli/src/command-internal/db-bootstrap/recreate-local-database.ts +++ b/apps/cli/src/command-internal/db-bootstrap/recreate-local-database.ts @@ -10,8 +10,8 @@ */ import { Data, Effect, Result, Schedule, type FileSystem, type Path } from "effect"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type * as HttpClient from "effect/http/HttpClient"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { Output } from "../../shared/output/output.service.ts"; import type { RuntimeInfo } from "../../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/reset-local-database.ts b/apps/cli/src/command-internal/db-bootstrap/reset-local-database.ts index cb61d07cf2..8e45180f25 100644 --- a/apps/cli/src/command-internal/db-bootstrap/reset-local-database.ts +++ b/apps/cli/src/command-internal/db-bootstrap/reset-local-database.ts @@ -10,7 +10,7 @@ */ import { Data, Effect, FileSystem, Option, Path } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { branchClause, detectGitBranch } from "../../shared/git/git-branch.ts"; import { diff --git a/apps/cli/src/command-internal/db-bootstrap/restart-services.ts b/apps/cli/src/command-internal/db-bootstrap/restart-services.ts index ef7a370b04..44011cbd3d 100644 --- a/apps/cli/src/command-internal/db-bootstrap/restart-services.ts +++ b/apps/cli/src/command-internal/db-bootstrap/restart-services.ts @@ -7,7 +7,7 @@ */ import { Data, Effect, Option, Result } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { actionability, diff --git a/apps/cli/src/command-internal/db-bootstrap/restart-services.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/restart-services.unit.test.ts index 0ac994b4d5..3d861c826f 100644 --- a/apps/cli/src/command-internal/db-bootstrap/restart-services.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/restart-services.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { ContainerRestartError, diff --git a/apps/cli/src/command-internal/db-bootstrap/rollback.ts b/apps/cli/src/command-internal/db-bootstrap/rollback.ts index dbe0127373..6ecdd15040 100644 --- a/apps/cli/src/command-internal/db-bootstrap/rollback.ts +++ b/apps/cli/src/command-internal/db-bootstrap/rollback.ts @@ -1,5 +1,5 @@ import { Effect } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import type { ContainerIdName } from "../docker-lifecycle.ts"; import { dockerRemoveAll } from "../docker-remove-all.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/rollback.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/rollback.unit.test.ts index 0ec8a4c969..7d372a83c5 100644 --- a/apps/cli/src/command-internal/db-bootstrap/rollback.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/rollback.unit.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from "@effect/vitest"; import { Data, Deferred, Effect, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { HealthCheckTimeoutError } from "./health-check.ts"; import { isUnhealthyStartError, rollbackStart } from "./rollback.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/shadow-cache.ts b/apps/cli/src/command-internal/db-bootstrap/shadow-cache.ts index 1ffe855cc4..113a5b62bf 100644 --- a/apps/cli/src/command-internal/db-bootstrap/shadow-cache.ts +++ b/apps/cli/src/command-internal/db-bootstrap/shadow-cache.ts @@ -18,7 +18,7 @@ import { Semaphore, type FileSystem, } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { viperEnvBoolWithProjectFallback } from "../viper-env.ts"; import { Output } from "../../shared/output/output.service.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/shadow-database.ts b/apps/cli/src/command-internal/db-bootstrap/shadow-database.ts index 9451314dc1..b7f1adb7b7 100644 --- a/apps/cli/src/command-internal/db-bootstrap/shadow-database.ts +++ b/apps/cli/src/command-internal/db-bootstrap/shadow-database.ts @@ -16,7 +16,7 @@ import { type Path, type Scope, } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { Output } from "../../shared/output/output.service.ts"; import type { RuntimeInfo } from "../../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/shadow-database.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/shadow-database.unit.test.ts index 4bf1d5ceac..0467e64888 100644 --- a/apps/cli/src/command-internal/db-bootstrap/shadow-database.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/shadow-database.unit.test.ts @@ -5,7 +5,7 @@ import { describe, expect, it } from "@effect/vitest"; import { Effect, Exit, FileSystem, Fiber, Layer, Option, Path, Schema, Sink, Stream } from "effect"; import * as PlatformError from "effect/PlatformError"; import * as TestClock from "effect/testing/TestClock"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { mockOutput, mockRuntimeInfo } from "../../../tests/helpers/mocks.ts"; import { useTempWorkdir } from "../../../tests/helpers/command-mocks.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/start-database.ts b/apps/cli/src/command-internal/db-bootstrap/start-database.ts index a5f52cca2f..1f18672a7c 100644 --- a/apps/cli/src/command-internal/db-bootstrap/start-database.ts +++ b/apps/cli/src/command-internal/db-bootstrap/start-database.ts @@ -9,8 +9,8 @@ */ import { Data, Effect, type FileSystem, type Path, Result } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; +import type * as HttpClient from "effect/http/HttpClient"; import { Output } from "../../shared/output/output.service.ts"; import type { RuntimeInfo } from "../../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/command-internal/db-bootstrap/start-local-database.ts b/apps/cli/src/command-internal/db-bootstrap/start-local-database.ts index db9961f353..d935a283cf 100644 --- a/apps/cli/src/command-internal/db-bootstrap/start-local-database.ts +++ b/apps/cli/src/command-internal/db-bootstrap/start-local-database.ts @@ -9,7 +9,7 @@ */ import { Effect, FileSystem, Option, Path } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { Output } from "../../shared/output/output.service.ts"; import { RuntimeInfo } from "../../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/command-internal/db-config.service.ts b/apps/cli/src/command-internal/db-config.service.ts index 04fff5865e..f4e5bdfadf 100644 --- a/apps/cli/src/command-internal/db-config.service.ts +++ b/apps/cli/src/command-internal/db-config.service.ts @@ -1,6 +1,6 @@ import { Context, Config, type Effect, type Option } from "effect"; import type { SupabaseApiInputError } from "@supabase/api/effect"; -import type * as HttpBody from "effect/unstable/http/HttpBody"; +import type * as HttpBody from "effect/http/HttpBody"; import type { CommandPlatformApiFactoryError } from "../auth/command-platform-api-factory.service.ts"; import type { PgConnInput } from "./db-connection.service.ts"; import type { diff --git a/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts b/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts index e8d99fea43..e98c258ad6 100644 --- a/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts +++ b/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts @@ -3,8 +3,8 @@ import * as net from "node:net"; import type { ConnectionOptions } from "node:tls"; import { PgClient } from "@effect/sql-pg"; import { Cause, Duration, Effect, Exit, Layer, Scope } from "effect"; -import * as Reactivity from "effect/unstable/reactivity/Reactivity"; -import { ConnectionError, SqlError } from "effect/unstable/sql/SqlError"; +import * as Reactivity from "effect/reactivity/Reactivity"; +import { ConnectionError, SqlError } from "effect/sql/SqlError"; // `pg` is `@effect/sql-pg`'s transitive driver; used directly here for COPY and // extended-protocol batches, which `@effect/sql-pg` does not expose. Keep the direct `pg` // version in package.json aligned with the one `@effect/sql-pg` resolves. diff --git a/apps/cli/src/command-internal/db-connection.sql-pg.unit.test.ts b/apps/cli/src/command-internal/db-connection.sql-pg.unit.test.ts index 72e59e03d1..d1bf594a81 100644 --- a/apps/cli/src/command-internal/db-connection.sql-pg.unit.test.ts +++ b/apps/cli/src/command-internal/db-connection.sql-pg.unit.test.ts @@ -1,6 +1,6 @@ import { EventEmitter } from "node:events"; import { Effect, Exit } from "effect"; -import { SqlError, SqlSyntaxError, UnknownError } from "effect/unstable/sql/SqlError"; +import { SqlError, SqlSyntaxError, UnknownError } from "effect/sql/SqlError"; import type * as Pg from "pg"; import { describe, expect, it } from "vitest"; diff --git a/apps/cli/src/command-internal/db-pull-run.ts b/apps/cli/src/command-internal/db-pull-run.ts index caf4e0ced2..ad76e5f138 100644 --- a/apps/cli/src/command-internal/db-pull-run.ts +++ b/apps/cli/src/command-internal/db-pull-run.ts @@ -1,5 +1,5 @@ import { Clock, Effect, FileSystem, Option, Path } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { DebugFlag, diff --git a/apps/cli/src/command-internal/docker-image-resolve.ts b/apps/cli/src/command-internal/docker-image-resolve.ts index 3b3f0bea5e..d9ddd9ef6f 100644 --- a/apps/cli/src/command-internal/docker-image-resolve.ts +++ b/apps/cli/src/command-internal/docker-image-resolve.ts @@ -1,5 +1,5 @@ import { Effect, Exit, Stream } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { ContainerRuntimeNotFoundError, spawnContainerCli } from "./container-cli.ts"; import { DockerRunError } from "./docker-run.errors.ts"; import { SUGGEST_DOCKER_INSTALL, isDockerDaemonUnreachable } from "./docker-suggest.ts"; diff --git a/apps/cli/src/command-internal/docker-image-resolve.unit.test.ts b/apps/cli/src/command-internal/docker-image-resolve.unit.test.ts index f392479bef..591edf8fa6 100644 --- a/apps/cli/src/command-internal/docker-image-resolve.unit.test.ts +++ b/apps/cli/src/command-internal/docker-image-resolve.unit.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Fiber, PlatformError, Sink, Stream } from "effect"; -import type * as ChildProcess from "effect/unstable/process/ChildProcess"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import type * as ChildProcess from "effect/process/ChildProcess"; +import { ChildProcessSpawner } from "effect/process"; import * as TestClock from "effect/testing/TestClock"; import { makeDockerImageResolver } from "./docker-image-resolve.ts"; diff --git a/apps/cli/src/command-internal/docker-lifecycle.ts b/apps/cli/src/command-internal/docker-lifecycle.ts index c9e8f11232..c972a0bb13 100644 --- a/apps/cli/src/command-internal/docker-lifecycle.ts +++ b/apps/cli/src/command-internal/docker-lifecycle.ts @@ -1,6 +1,6 @@ import { isDockerDaemonDownMessage } from "../shared/stack-constants.ts"; import { Data, Effect, Stream } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { actionability, diff --git a/apps/cli/src/command-internal/docker-lifecycle.unit.test.ts b/apps/cli/src/command-internal/docker-lifecycle.unit.test.ts index 97165a31c4..fe41ca0d35 100644 --- a/apps/cli/src/command-internal/docker-lifecycle.unit.test.ts +++ b/apps/cli/src/command-internal/docker-lifecycle.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { classifyCliErrorActionability } from "../shared/telemetry/error-actionability.ts"; import { diff --git a/apps/cli/src/command-internal/docker-remove-all.ts b/apps/cli/src/command-internal/docker-remove-all.ts index f1116300cd..f9a3e4cced 100644 --- a/apps/cli/src/command-internal/docker-remove-all.ts +++ b/apps/cli/src/command-internal/docker-remove-all.ts @@ -1,5 +1,5 @@ import { Data, Effect, Result } from "effect"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { actionability, diff --git a/apps/cli/src/command-internal/docker-run.layer.ts b/apps/cli/src/command-internal/docker-run.layer.ts index cb56b8800a..535238b569 100644 --- a/apps/cli/src/command-internal/docker-run.layer.ts +++ b/apps/cli/src/command-internal/docker-run.layer.ts @@ -1,5 +1,5 @@ import { Effect, Layer, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { ProcessControl } from "../shared/runtime/process-control.service.ts"; import { isBitbucketPipeline } from "./bitbucket-pipeline.ts"; import { containerCliExitCode, spawnContainerCli } from "./container-cli.ts"; diff --git a/apps/cli/src/command-internal/git-status.ts b/apps/cli/src/command-internal/git-status.ts index 136f4014ac..7325e456e9 100644 --- a/apps/cli/src/command-internal/git-status.ts +++ b/apps/cli/src/command-internal/git-status.ts @@ -1,7 +1,7 @@ import { basename, dirname } from "node:path"; import { Effect, Option } from "effect"; -import * as ChildProcess from "effect/unstable/process/ChildProcess"; -import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import * as ChildProcess from "effect/process/ChildProcess"; +import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { withChildTraceEnv, withProcessSpan } from "../shared/telemetry/spans.ts"; import { collectText } from "./container-cli.ts"; diff --git a/apps/cli/src/command-internal/git-status.unit.test.ts b/apps/cli/src/command-internal/git-status.unit.test.ts index 525f8bfe75..94b053c719 100644 --- a/apps/cli/src/command-internal/git-status.unit.test.ts +++ b/apps/cli/src/command-internal/git-status.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Option, PlatformError, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { pathHasUncommittedChanges } from "./git-status.ts"; diff --git a/apps/cli/src/command-internal/global-flags.ts b/apps/cli/src/command-internal/global-flags.ts index 2348e9a7cf..8ecee8224b 100644 --- a/apps/cli/src/command-internal/global-flags.ts +++ b/apps/cli/src/command-internal/global-flags.ts @@ -1,5 +1,5 @@ import { Effect, Option } from "effect"; -import { Flag, GlobalFlag } from "effect/unstable/cli"; +import { Flag, GlobalFlag } from "effect/cli"; import { CliArgs } from "../shared/cli/cli-args.service.ts"; import { VALUE_CONSUMING_LONG_FLAGS, VALUE_CONSUMING_SHORT_FLAGS } from "./db-target-flags.ts"; diff --git a/apps/cli/src/command-internal/go-proxy.layer.ts b/apps/cli/src/command-internal/go-proxy.layer.ts index 553d2c9acb..8b679e649e 100644 --- a/apps/cli/src/command-internal/go-proxy.layer.ts +++ b/apps/cli/src/command-internal/go-proxy.layer.ts @@ -4,8 +4,8 @@ import os from "node:os"; import path from "node:path"; import process from "node:process"; import { Effect, Layer, Option, Stream } from "effect"; -import * as ChildProcess from "effect/unstable/process/ChildProcess"; -import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import * as ChildProcess from "effect/process/ChildProcess"; +import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { CLI_VERSION } from "../shared/cli/version.ts"; import { ProcessControl } from "../shared/runtime/process-control.service.ts"; import { GoChildExitError } from "./go-child-exit.error.ts"; diff --git a/apps/cli/src/command-internal/go-proxy.layer.unit.test.ts b/apps/cli/src/command-internal/go-proxy.layer.unit.test.ts index 2ea151e9c1..552e8a8cf2 100644 --- a/apps/cli/src/command-internal/go-proxy.layer.unit.test.ts +++ b/apps/cli/src/command-internal/go-proxy.layer.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from "@effect/vitest"; import { Cause, Deferred, Effect, Exit, Fiber, Layer, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { type CliProcessSignal, ProcessControl, diff --git a/apps/cli/src/command-internal/http-dns.ts b/apps/cli/src/command-internal/http-dns.ts index 736eeea4f6..c21fe7ce61 100644 --- a/apps/cli/src/command-internal/http-dns.ts +++ b/apps/cli/src/command-internal/http-dns.ts @@ -1,6 +1,6 @@ import * as net from "node:net"; import { Effect, Layer } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { DnsResolverFlag } from "./global-flags.ts"; import { DbConnectError } from "./db-connection.errors.ts"; diff --git a/apps/cli/src/command-internal/http-dns.unit.test.ts b/apps/cli/src/command-internal/http-dns.unit.test.ts index f17ffba58a..0e2e4106e7 100644 --- a/apps/cli/src/command-internal/http-dns.unit.test.ts +++ b/apps/cli/src/command-internal/http-dns.unit.test.ts @@ -253,8 +253,8 @@ describe("dohFetchLayer (Effect layer integration)", () => { }); it.effect("dohFetchLayer provides FetchHttpClient.Fetch from context via DnsResolverFlag", () => { - const { FetchHttpClient } = require("effect/unstable/http") as { - FetchHttpClient: typeof import("effect/unstable/http").FetchHttpClient; + const { FetchHttpClient } = require("effect/http") as { + FetchHttpClient: typeof import("effect/http").FetchHttpClient; }; return Effect.gen(function* () { @@ -265,8 +265,8 @@ describe("dohFetchLayer (Effect layer integration)", () => { }); it.effect("dohFetchLayer with 'native' also provides a fetch function", () => { - const { FetchHttpClient } = require("effect/unstable/http") as { - FetchHttpClient: typeof import("effect/unstable/http").FetchHttpClient; + const { FetchHttpClient } = require("effect/http") as { + FetchHttpClient: typeof import("effect/http").FetchHttpClient; }; return Effect.gen(function* () { diff --git a/apps/cli/src/command-internal/http-errors.ts b/apps/cli/src/command-internal/http-errors.ts index 1d90ad9cdf..0bb77c8c60 100644 --- a/apps/cli/src/command-internal/http-errors.ts +++ b/apps/cli/src/command-internal/http-errors.ts @@ -1,7 +1,7 @@ import { SupabaseApiInputError, type SupabaseApiError } from "@supabase/api/effect"; import { Effect } from "effect"; -import * as HttpBody from "effect/unstable/http/HttpBody"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpBody from "effect/http/HttpBody"; +import * as HttpClientError from "effect/http/HttpClientError"; // HttpClientError reasons that indicate the server returned an actual response (vs a transport // failure). Anything in this set surfaces as an `UnexpectedStatusError`; everything else maps diff --git a/apps/cli/src/command-internal/http-errors.unit.test.ts b/apps/cli/src/command-internal/http-errors.unit.test.ts index cb215edaf0..aa430d1532 100644 --- a/apps/cli/src/command-internal/http-errors.unit.test.ts +++ b/apps/cli/src/command-internal/http-errors.unit.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { SupabaseApiInputError } from "@supabase/api/effect"; import { Data, Effect } from "effect"; -import * as HttpBody from "effect/unstable/http/HttpBody"; +import * as HttpBody from "effect/http/HttpBody"; import { classifyCliErrorActionability } from "../shared/telemetry/error-actionability.ts"; import { sanitizeInlineName, mapHttpError, unexpectedStatusMessage } from "./http-errors.ts"; diff --git a/apps/cli/src/command-internal/identity-stitch.integration.test.ts b/apps/cli/src/command-internal/identity-stitch.integration.test.ts index e36a9ee46e..581841d56b 100644 --- a/apps/cli/src/command-internal/identity-stitch.integration.test.ts +++ b/apps/cli/src/command-internal/identity-stitch.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { Effect, FileSystem, Layer, Path } from "effect"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { BunFileSystem, BunPath } from "@effect/platform-bun"; import { mockAnalytics, mockTelemetryRuntime } from "../../tests/helpers/mocks.ts"; import { IdentityStitch, identityStitchLayer } from "./identity-stitch.ts"; diff --git a/apps/cli/src/command-internal/identity-stitch.ts b/apps/cli/src/command-internal/identity-stitch.ts index f4dcc93fd6..0a25071f75 100644 --- a/apps/cli/src/command-internal/identity-stitch.ts +++ b/apps/cli/src/command-internal/identity-stitch.ts @@ -1,5 +1,5 @@ import { Context, Effect, FileSystem, Layer, Option, Path } from "effect"; -import type * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import type * as HttpClientResponse from "effect/http/HttpClientResponse"; import { Analytics } from "../shared/telemetry/analytics.service.ts"; import { TelemetryRuntime } from "../shared/telemetry/runtime.service.ts"; diff --git a/apps/cli/src/command-internal/local-config-values.unit.test.ts b/apps/cli/src/command-internal/local-config-values.unit.test.ts index b0d58ddb37..b35355956e 100644 --- a/apps/cli/src/command-internal/local-config-values.unit.test.ts +++ b/apps/cli/src/command-internal/local-config-values.unit.test.ts @@ -4,7 +4,7 @@ import { join } from "node:path"; import { CliConfigSchema, type CliConfig } from "@supabase/config"; import { Effect, Schema } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { importJWK, jwtVerify } from "jose"; import { afterEach, describe, expect, it, vi } from "vitest"; diff --git a/apps/cli/src/command-internal/login-api.layer.ts b/apps/cli/src/command-internal/login-api.layer.ts index 259b32398e..234d621010 100644 --- a/apps/cli/src/command-internal/login-api.layer.ts +++ b/apps/cli/src/command-internal/login-api.layer.ts @@ -1,6 +1,6 @@ import { Effect, Layer, Option } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../config/command-settings.service.ts"; import { LoginApi, type LoginApiSessionResponse } from "../commands/login/login-api.service.ts"; diff --git a/apps/cli/src/command-internal/management-api-runtime.layer.ts b/apps/cli/src/command-internal/management-api-runtime.layer.ts index ce4c3e6f86..1a2be6b77c 100644 --- a/apps/cli/src/command-internal/management-api-runtime.layer.ts +++ b/apps/cli/src/command-internal/management-api-runtime.layer.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; -import { FetchHttpClient } from "effect/unstable/http"; +import type * as HttpClient from "effect/http/HttpClient"; +import { FetchHttpClient } from "effect/http"; import { CommandCredentials } from "../auth/command-credentials.service.ts"; import { commandCredentialsLayer } from "../auth/command-credentials.layer.ts"; diff --git a/apps/cli/src/command-internal/param-introspection.ts b/apps/cli/src/command-internal/param-introspection.ts index ed8560b84b..a7b48b9980 100644 --- a/apps/cli/src/command-internal/param-introspection.ts +++ b/apps/cli/src/command-internal/param-introspection.ts @@ -1,8 +1,8 @@ import { Option } from "effect"; -import { Param } from "effect/unstable/cli"; +import { Param } from "effect/cli"; /** - * Reimplements `effect/unstable/cli`'s internal `Param.extractSingleParams`/ + * Reimplements `effect/cli`'s internal `Param.extractSingleParams`/ * `getParamMetadata` unwrap using only public fields, since the originals are `@internal` and * would need a forbidden `as` cast. Fails closed (`undefined`) on an unrecognized variant. */ diff --git a/apps/cli/src/command-internal/param-introspection.unit.test.ts b/apps/cli/src/command-internal/param-introspection.unit.test.ts index 9244518425..fa4129a2e2 100644 --- a/apps/cli/src/command-internal/param-introspection.unit.test.ts +++ b/apps/cli/src/command-internal/param-introspection.unit.test.ts @@ -1,4 +1,4 @@ -import { Flag } from "effect/unstable/cli"; +import { Flag } from "effect/cli"; import { describe, expect, it } from "vitest"; import { unwrapParam, unwrapToSingleParam } from "./param-introspection.ts"; diff --git a/apps/cli/src/command-internal/pg-dump.native.integration.test.ts b/apps/cli/src/command-internal/pg-dump.native.integration.test.ts index 1b163a63d6..33d82fdc5c 100644 --- a/apps/cli/src/command-internal/pg-dump.native.integration.test.ts +++ b/apps/cli/src/command-internal/pg-dump.native.integration.test.ts @@ -1,6 +1,6 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { Effect, FileSystem, Layer, Option, Redacted, Ref, Stream } from "effect"; import { type ServiceCreation } from "@supabase/stack/effect"; import { postgres } from "@supabase/stack/commands"; diff --git a/apps/cli/src/command-internal/raw-http.ts b/apps/cli/src/command-internal/raw-http.ts index 0e4c08bf19..7d30d2c998 100644 --- a/apps/cli/src/command-internal/raw-http.ts +++ b/apps/cli/src/command-internal/raw-http.ts @@ -1,5 +1,5 @@ import { Option, type Redacted } from "effect"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; /** * Applies the Management API auth + identification headers to a raw `HttpClientRequest`: diff --git a/apps/cli/src/command-internal/seed-buckets.ts b/apps/cli/src/command-internal/seed-buckets.ts index 0fda1b5e35..b9f7f57c27 100644 --- a/apps/cli/src/command-internal/seed-buckets.ts +++ b/apps/cli/src/command-internal/seed-buckets.ts @@ -2,7 +2,7 @@ import { type CliConfig, CliConfigSchema } from "@supabase/config/effect"; import { loadCliConfig, type InternalLoadCliConfigOptions } from "@supabase/config/internal"; import { BunPath } from "@effect/platform-bun"; import { Effect, FileSystem, Path, Schema } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import type { PlatformError } from "effect/PlatformError"; import { Output } from "../shared/output/output.service.ts"; diff --git a/apps/cli/src/command-internal/stack-api.ts b/apps/cli/src/command-internal/stack-api.ts index 4c09eff029..d0f640901d 100644 --- a/apps/cli/src/command-internal/stack-api.ts +++ b/apps/cli/src/command-internal/stack-api.ts @@ -1,6 +1,6 @@ import { Context, Crypto, Effect, FileSystem, Layer, Option, Path, Scope } from "effect"; -import { FetchHttpClient, HttpClient } from "effect/unstable/http"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { FetchHttpClient, HttpClient } from "effect/http"; +import { ChildProcessSpawner } from "effect/process"; import { create, discover, diff --git a/apps/cli/src/command-internal/stack-catalog-setup.integration.test.ts b/apps/cli/src/command-internal/stack-catalog-setup.integration.test.ts index 8601b9b809..217602e22d 100644 --- a/apps/cli/src/command-internal/stack-catalog-setup.integration.test.ts +++ b/apps/cli/src/command-internal/stack-catalog-setup.integration.test.ts @@ -13,7 +13,7 @@ import { Result, Stream, } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { tmpdir } from "node:os"; import { create, StackError, type Stack } from "@supabase/stack/effect"; import { postgres } from "@supabase/stack/commands"; diff --git a/apps/cli/src/command-internal/stack-config.ts b/apps/cli/src/command-internal/stack-config.ts index 3009d58552..73ba00489a 100644 --- a/apps/cli/src/command-internal/stack-config.ts +++ b/apps/cli/src/command-internal/stack-config.ts @@ -9,7 +9,7 @@ import { } from "@supabase/stack/defaults"; import { type ServiceCreationInput as ServiceCreationType } from "@supabase/stack/effect"; import { Crypto, Effect, Data, FileSystem, Path, Redacted, Schema, SchemaIssue } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { loadLocalProjectContext, type LocalProjectContext } from "./local-project-context.ts"; import { RuntimeInfo } from "../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/command-internal/stack-runtime.ts b/apps/cli/src/command-internal/stack-runtime.ts index aa7fb4dcf3..541a045bfb 100644 --- a/apps/cli/src/command-internal/stack-runtime.ts +++ b/apps/cli/src/command-internal/stack-runtime.ts @@ -1,7 +1,7 @@ import { defaultRuntime } from "@supabase/stack/internal/artifacts"; import { Data, Effect } from "effect"; -import * as ChildProcess from "effect/unstable/process/ChildProcess"; -import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import * as ChildProcess from "effect/process/ChildProcess"; +import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { RuntimeInfo } from "../shared/runtime/runtime-info.service.ts"; import { actionability, diff --git a/apps/cli/src/command-internal/stack-storage.native.integration.test.ts b/apps/cli/src/command-internal/stack-storage.native.integration.test.ts index 15b735a500..2cd088a0e5 100644 --- a/apps/cli/src/command-internal/stack-storage.native.integration.test.ts +++ b/apps/cli/src/command-internal/stack-storage.native.integration.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect, FileSystem, Layer, Option, Path, Stream } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { CommandPlatformApiFactory } from "../auth/command-platform-api-factory.service.ts"; import { dbConnectionLayer } from "./db-connection.sql-pg.layer.ts"; diff --git a/apps/cli/src/command-internal/storage-gateway.ts b/apps/cli/src/command-internal/storage-gateway.ts index 3fd73f6f1a..5c1ffd5bc7 100644 --- a/apps/cli/src/command-internal/storage-gateway.ts +++ b/apps/cli/src/command-internal/storage-gateway.ts @@ -1,8 +1,8 @@ import { Effect, FileSystem, Stream } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { kongAuthHeaders } from "./kong-auth.ts"; import { StorageGatewayNetworkError, StorageGatewayStatusError } from "./storage-gateway.errors.ts"; diff --git a/apps/cli/src/command-internal/storage-gateway.unit.test.ts b/apps/cli/src/command-internal/storage-gateway.unit.test.ts index 59b38ed5b7..fd757bfa86 100644 --- a/apps/cli/src/command-internal/storage-gateway.unit.test.ts +++ b/apps/cli/src/command-internal/storage-gateway.unit.test.ts @@ -1,9 +1,9 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect, Exit, Layer } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; import { classifyCliErrorActionability } from "../shared/telemetry/error-actionability.ts"; import { StorageGatewayStatusError } from "./storage-gateway.errors.ts"; diff --git a/apps/cli/src/command-internal/storage-runtime.layer.ts b/apps/cli/src/command-internal/storage-runtime.layer.ts index b075818b09..41882a0398 100644 --- a/apps/cli/src/command-internal/storage-runtime.layer.ts +++ b/apps/cli/src/command-internal/storage-runtime.layer.ts @@ -1,5 +1,5 @@ import { Layer } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import * as HttpClient from "effect/http/HttpClient"; import { commandCredentialsLayer } from "../auth/command-credentials.layer.ts"; import { commandPlatformApiFactoryLayer } from "../auth/command-platform-api-factory.layer.ts"; diff --git a/apps/cli/src/command-internal/string-slice-flag.ts b/apps/cli/src/command-internal/string-slice-flag.ts index d754c79305..589b2e6f78 100644 --- a/apps/cli/src/command-internal/string-slice-flag.ts +++ b/apps/cli/src/command-internal/string-slice-flag.ts @@ -12,7 +12,7 @@ import { * * Whitespace is not trimmed and empty fields are not dropped. */ -import { Flag } from "effect/unstable/cli"; +import { Flag } from "effect/cli"; const QUOTE = 0x22; // " const COMMA = 0x2c; // , diff --git a/apps/cli/src/command-internal/tenant-versions.ts b/apps/cli/src/command-internal/tenant-versions.ts index d0876527fc..db8dd9a7e7 100644 --- a/apps/cli/src/command-internal/tenant-versions.ts +++ b/apps/cli/src/command-internal/tenant-versions.ts @@ -1,6 +1,6 @@ import { Effect, Option } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { tagForServiceVersion } from "../shared/services/services.shared.ts"; diff --git a/apps/cli/src/command-internal/test-db.command-handler.ts b/apps/cli/src/command-internal/test-db.command-handler.ts index 72546c7ee0..ae03a35e2c 100644 --- a/apps/cli/src/command-internal/test-db.command-handler.ts +++ b/apps/cli/src/command-internal/test-db.command-handler.ts @@ -1,6 +1,6 @@ import { Effect, Option } from "effect"; -import { Argument, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../shared/output/json-error-handling.ts"; import { Output } from "../shared/output/output.service.ts"; diff --git a/apps/cli/src/command-internal/test-db.native.integration.test.ts b/apps/cli/src/command-internal/test-db.native.integration.test.ts index 6377dabdbe..1e76cea761 100644 --- a/apps/cli/src/command-internal/test-db.native.integration.test.ts +++ b/apps/cli/src/command-internal/test-db.native.integration.test.ts @@ -1,6 +1,6 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Redacted } from "effect"; import { Analytics } from "../shared/telemetry/analytics.service.ts"; import { CommandRuntime } from "../shared/runtime/command-runtime.service.ts"; diff --git a/apps/cli/src/command-internal/upgrade-suggest.ts b/apps/cli/src/command-internal/upgrade-suggest.ts index 345b95182d..51d5af061b 100644 --- a/apps/cli/src/command-internal/upgrade-suggest.ts +++ b/apps/cli/src/command-internal/upgrade-suggest.ts @@ -2,10 +2,10 @@ import { styleText } from "node:util"; import type { SupabaseApiError } from "@supabase/api/effect"; import { Effect, Option, type Redacted } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import type * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import type * as HttpClientResponse from "effect/http/HttpClientResponse"; import { CommandSettings } from "../config/command-settings.service.ts"; import { resolveAccessToken } from "./resolve-token.ts"; diff --git a/apps/cli/src/command-internal/upgrade-suggest.unit.test.ts b/apps/cli/src/command-internal/upgrade-suggest.unit.test.ts index 3c76ec386a..d6192e11db 100644 --- a/apps/cli/src/command-internal/upgrade-suggest.unit.test.ts +++ b/apps/cli/src/command-internal/upgrade-suggest.unit.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { Effect, Option, PlatformError, Redacted, Layer } from "effect"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { CommandCredentials } from "../auth/command-credentials.service.ts"; import { mockAnalytics, mockOutput } from "../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/commands/backups/backups.command.ts b/apps/cli/src/commands/backups/backups.command.ts index 3326c58a55..c28a2d7724 100644 --- a/apps/cli/src/commands/backups/backups.command.ts +++ b/apps/cli/src/commands/backups/backups.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { backupsListCommand } from "./list/list.command.ts"; import { backupsRestoreCommand } from "./restore/restore.command.ts"; diff --git a/apps/cli/src/commands/backups/list/list.command.ts b/apps/cli/src/commands/backups/list/list.command.ts index 05e453fc0a..1df7b6d88a 100644 --- a/apps/cli/src/commands/backups/list/list.command.ts +++ b/apps/cli/src/commands/backups/list/list.command.ts @@ -1,5 +1,5 @@ -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Command, Flag } from "effect/cli"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/backups/restore/restore.command.ts b/apps/cli/src/commands/backups/restore/restore.command.ts index dcd3cea4fd..492083bd58 100644 --- a/apps/cli/src/commands/backups/restore/restore.command.ts +++ b/apps/cli/src/commands/backups/restore/restore.command.ts @@ -1,5 +1,5 @@ -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Command, Flag } from "effect/cli"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/backups/restore/restore.integration.test.ts b/apps/cli/src/commands/backups/restore/restore.integration.test.ts index 4877c63e84..a231465569 100644 --- a/apps/cli/src/commands/backups/restore/restore.integration.test.ts +++ b/apps/cli/src/commands/backups/restore/restore.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Option } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockOutput, mockTty } from "../../../../tests/helpers/mocks.ts"; import { diff --git a/apps/cli/src/commands/bootstrap/bootstrap.command.ts b/apps/cli/src/commands/bootstrap/bootstrap.command.ts index d4228b5ba2..eceec912a2 100644 --- a/apps/cli/src/commands/bootstrap/bootstrap.command.ts +++ b/apps/cli/src/commands/bootstrap/bootstrap.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; import { cliConfigProviderLayer } from "../../shared/config/cli-config-provider.layer.ts"; diff --git a/apps/cli/src/commands/bootstrap/bootstrap.handler.ts b/apps/cli/src/commands/bootstrap/bootstrap.handler.ts index 771a43daa0..403fb02bd3 100644 --- a/apps/cli/src/commands/bootstrap/bootstrap.handler.ts +++ b/apps/cli/src/commands/bootstrap/bootstrap.handler.ts @@ -1,5 +1,5 @@ import { Effect, FileSystem, Option, Path, Redacted, Schedule } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpClientError from "effect/http/HttpClientError"; import { CommandPlatformApi } from "../../auth/command-platform-api.service.ts"; import { CommandSettings } from "../../config/command-settings.service.ts"; diff --git a/apps/cli/src/commands/bootstrap/bootstrap.templates.integration.test.ts b/apps/cli/src/commands/bootstrap/bootstrap.templates.integration.test.ts index 11ac2488f7..cea75451f1 100644 --- a/apps/cli/src/commands/bootstrap/bootstrap.templates.integration.test.ts +++ b/apps/cli/src/commands/bootstrap/bootstrap.templates.integration.test.ts @@ -1,9 +1,9 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect, FileSystem, Layer, Option, Path, Redacted } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockCommandSettings } from "../../../tests/helpers/command-mocks.ts"; import { mockOutput } from "../../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/commands/bootstrap/bootstrap.templates.ts b/apps/cli/src/commands/bootstrap/bootstrap.templates.ts index c789f0d65f..e096362184 100644 --- a/apps/cli/src/commands/bootstrap/bootstrap.templates.ts +++ b/apps/cli/src/commands/bootstrap/bootstrap.templates.ts @@ -1,6 +1,6 @@ import { Context, Effect, FileSystem, Layer, Option, Path, Redacted, Schema } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../../config/command-settings.service.ts"; import { Output } from "../../shared/output/output.service.ts"; diff --git a/apps/cli/src/commands/branches/branches.command.ts b/apps/cli/src/commands/branches/branches.command.ts index 5f6466b652..6991f95d9d 100644 --- a/apps/cli/src/commands/branches/branches.command.ts +++ b/apps/cli/src/commands/branches/branches.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { branchesListCommand } from "./list/list.command.ts"; import { branchesCreateCommand } from "./create/create.command.ts"; import { branchesGetCommand } from "./get/get.command.ts"; diff --git a/apps/cli/src/commands/branches/create/create.command.ts b/apps/cli/src/commands/branches/create/create.command.ts index fb24bad899..a0f79f05f9 100644 --- a/apps/cli/src/commands/branches/create/create.command.ts +++ b/apps/cli/src/commands/branches/create/create.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { Layer } from "effect"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/branches/create/create.integration.test.ts b/apps/cli/src/commands/branches/create/create.integration.test.ts index e8e2b4dfe2..f7f5e8eb53 100644 --- a/apps/cli/src/commands/branches/create/create.integration.test.ts +++ b/apps/cli/src/commands/branches/create/create.integration.test.ts @@ -1,7 +1,7 @@ import type { V1CreateABranchOutput } from "@supabase/api/effect"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer, Option } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { mockAnalytics, diff --git a/apps/cli/src/commands/branches/delete/delete.command.ts b/apps/cli/src/commands/branches/delete/delete.command.ts index ccb978c6ed..b11930970f 100644 --- a/apps/cli/src/commands/branches/delete/delete.command.ts +++ b/apps/cli/src/commands/branches/delete/delete.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/branches/disable/disable.command.ts b/apps/cli/src/commands/branches/disable/disable.command.ts index 7c2ed5364d..3492e32e3b 100644 --- a/apps/cli/src/commands/branches/disable/disable.command.ts +++ b/apps/cli/src/commands/branches/disable/disable.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/branches/get/get.command.ts b/apps/cli/src/commands/branches/get/get.command.ts index 9e05cafb1d..81788f04d8 100644 --- a/apps/cli/src/commands/branches/get/get.command.ts +++ b/apps/cli/src/commands/branches/get/get.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/branches/list/list.command.ts b/apps/cli/src/commands/branches/list/list.command.ts index bfc2252d27..3d27ee0552 100644 --- a/apps/cli/src/commands/branches/list/list.command.ts +++ b/apps/cli/src/commands/branches/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/branches/pause/pause.command.ts b/apps/cli/src/commands/branches/pause/pause.command.ts index 09af879850..f00fff5069 100644 --- a/apps/cli/src/commands/branches/pause/pause.command.ts +++ b/apps/cli/src/commands/branches/pause/pause.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/branches/unpause/unpause.command.ts b/apps/cli/src/commands/branches/unpause/unpause.command.ts index 5f105ae3d7..d5c71a3686 100644 --- a/apps/cli/src/commands/branches/unpause/unpause.command.ts +++ b/apps/cli/src/commands/branches/unpause/unpause.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/branches/update/update.command.ts b/apps/cli/src/commands/branches/update/update.command.ts index 26348c6ee0..5896d2dad7 100644 --- a/apps/cli/src/commands/branches/update/update.command.ts +++ b/apps/cli/src/commands/branches/update/update.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/completion/bash/bash.command.ts b/apps/cli/src/commands/completion/bash/bash.command.ts index 691e48ef28..b1e3db687e 100644 --- a/apps/cli/src/commands/completion/bash/bash.command.ts +++ b/apps/cli/src/commands/completion/bash/bash.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/completion/bash/bash.integration.test.ts b/apps/cli/src/commands/completion/bash/bash.integration.test.ts index 907f1c2210..ca276648bb 100644 --- a/apps/cli/src/commands/completion/bash/bash.integration.test.ts +++ b/apps/cli/src/commands/completion/bash/bash.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Effect, Layer } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { mockAnalytics, mockOutput } from "../../../../tests/helpers/mocks.ts"; import { processControlLayer } from "../../../shared/runtime/process-control.layer.ts"; import { EventCommandExecuted } from "../../../shared/telemetry/event-catalog.ts"; diff --git a/apps/cli/src/commands/completion/completion.command.ts b/apps/cli/src/commands/completion/completion.command.ts index 1003485904..6f466dbe46 100644 --- a/apps/cli/src/commands/completion/completion.command.ts +++ b/apps/cli/src/commands/completion/completion.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { completionBashCommand } from "./bash/bash.command.ts"; import { completionFishCommand } from "./fish/fish.command.ts"; import { completionPowershellCommand } from "./powershell/powershell.command.ts"; diff --git a/apps/cli/src/commands/completion/completion.flags.ts b/apps/cli/src/commands/completion/completion.flags.ts index d99387e33c..4bd5a7cc6d 100644 --- a/apps/cli/src/commands/completion/completion.flags.ts +++ b/apps/cli/src/commands/completion/completion.flags.ts @@ -1,4 +1,4 @@ -import { Flag } from "effect/unstable/cli"; +import { Flag } from "effect/cli"; /** * `--no-descriptions` flag shared by all four completion subcommands. diff --git a/apps/cli/src/commands/completion/fish/fish.command.ts b/apps/cli/src/commands/completion/fish/fish.command.ts index b021e74103..594a89899f 100644 --- a/apps/cli/src/commands/completion/fish/fish.command.ts +++ b/apps/cli/src/commands/completion/fish/fish.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/completion/fish/fish.integration.test.ts b/apps/cli/src/commands/completion/fish/fish.integration.test.ts index 7456dbe7e7..7854fdf0e0 100644 --- a/apps/cli/src/commands/completion/fish/fish.integration.test.ts +++ b/apps/cli/src/commands/completion/fish/fish.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Effect, Layer } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { mockAnalytics, mockOutput } from "../../../../tests/helpers/mocks.ts"; import { processControlLayer } from "../../../shared/runtime/process-control.layer.ts"; import { EventCommandExecuted } from "../../../shared/telemetry/event-catalog.ts"; diff --git a/apps/cli/src/commands/completion/powershell/powershell.command.ts b/apps/cli/src/commands/completion/powershell/powershell.command.ts index 65cd35854b..7afb1a75e5 100644 --- a/apps/cli/src/commands/completion/powershell/powershell.command.ts +++ b/apps/cli/src/commands/completion/powershell/powershell.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/completion/powershell/powershell.integration.test.ts b/apps/cli/src/commands/completion/powershell/powershell.integration.test.ts index 8d2fd70766..f207a0d695 100644 --- a/apps/cli/src/commands/completion/powershell/powershell.integration.test.ts +++ b/apps/cli/src/commands/completion/powershell/powershell.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Effect, Layer } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { mockAnalytics, mockOutput } from "../../../../tests/helpers/mocks.ts"; import { processControlLayer } from "../../../shared/runtime/process-control.layer.ts"; import { EventCommandExecuted } from "../../../shared/telemetry/event-catalog.ts"; diff --git a/apps/cli/src/commands/completion/zsh/zsh.command.ts b/apps/cli/src/commands/completion/zsh/zsh.command.ts index c3d1603852..b80c3e3871 100644 --- a/apps/cli/src/commands/completion/zsh/zsh.command.ts +++ b/apps/cli/src/commands/completion/zsh/zsh.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/completion/zsh/zsh.integration.test.ts b/apps/cli/src/commands/completion/zsh/zsh.integration.test.ts index 5636de9da8..639a31e3b2 100644 --- a/apps/cli/src/commands/completion/zsh/zsh.integration.test.ts +++ b/apps/cli/src/commands/completion/zsh/zsh.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Effect, Layer } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { mockAnalytics, mockOutput } from "../../../../tests/helpers/mocks.ts"; import { processControlLayer } from "../../../shared/runtime/process-control.layer.ts"; import { EventCommandExecuted } from "../../../shared/telemetry/event-catalog.ts"; diff --git a/apps/cli/src/commands/config/config.command.ts b/apps/cli/src/commands/config/config.command.ts index 70bda53056..f672b6d619 100644 --- a/apps/cli/src/commands/config/config.command.ts +++ b/apps/cli/src/commands/config/config.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { configDiffCommand } from "./diff/diff.command.ts"; import { configPullCommand } from "./pull/pull.command.ts"; import { configPushCommand } from "./push/push.command.ts"; diff --git a/apps/cli/src/commands/config/diff/diff.command.ts b/apps/cli/src/commands/config/diff/diff.command.ts index cf6a47e707..60e4610e6d 100644 --- a/apps/cli/src/commands/config/diff/diff.command.ts +++ b/apps/cli/src/commands/config/diff/diff.command.ts @@ -1,6 +1,6 @@ import { Option } from "effect"; -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Command, Flag } from "effect/cli"; import { PROJECT_REF_PATTERN } from "../../../config/project-ref.service.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/config/pull/pull.command.ts b/apps/cli/src/commands/config/pull/pull.command.ts index 991d3cf068..a7ef981151 100644 --- a/apps/cli/src/commands/config/pull/pull.command.ts +++ b/apps/cli/src/commands/config/pull/pull.command.ts @@ -1,6 +1,6 @@ import { Layer, Option } from "effect"; -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Command, Flag } from "effect/cli"; import { PROJECT_REF_PATTERN } from "../../../config/project-ref.service.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/config/pull/pull.integration.test.ts b/apps/cli/src/commands/config/pull/pull.integration.test.ts index eb4c7722a6..3de87900d6 100644 --- a/apps/cli/src/commands/config/pull/pull.integration.test.ts +++ b/apps/cli/src/commands/config/pull/pull.integration.test.ts @@ -13,8 +13,8 @@ import { Sink, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockOutput, diff --git a/apps/cli/src/commands/config/push/push.branch-target.ts b/apps/cli/src/commands/config/push/push.branch-target.ts index 74097558b2..ee3aee1201 100644 --- a/apps/cli/src/commands/config/push/push.branch-target.ts +++ b/apps/cli/src/commands/config/push/push.branch-target.ts @@ -1,5 +1,5 @@ import { Effect, FileSystem, Option, Path } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpClientError from "effect/http/HttpClientError"; import { CommandPlatformApi } from "../../../auth/command-platform-api.service.ts"; import { CommandSettings } from "../../../config/command-settings.service.ts"; diff --git a/apps/cli/src/commands/config/push/push.command.ts b/apps/cli/src/commands/config/push/push.command.ts index 06c447db41..0a3a4c3357 100644 --- a/apps/cli/src/commands/config/push/push.command.ts +++ b/apps/cli/src/commands/config/push/push.command.ts @@ -1,8 +1,8 @@ import { Layer, Option } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; +import { Command, Flag } from "effect/cli"; import { PROJECT_REF_PATTERN } from "../../../config/project-ref.service.ts"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/config/push/push.cost-matrix.ts b/apps/cli/src/commands/config/push/push.cost-matrix.ts index 5abff00304..2692f5a831 100644 --- a/apps/cli/src/commands/config/push/push.cost-matrix.ts +++ b/apps/cli/src/commands/config/push/push.cost-matrix.ts @@ -1,7 +1,7 @@ import { Effect } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { sanitizeErrorBody } from "../../../command-internal/http-errors.ts"; diff --git a/apps/cli/src/commands/config/push/push.integration.test.ts b/apps/cli/src/commands/config/push/push.integration.test.ts index 391bd6def0..867f1b51e4 100644 --- a/apps/cli/src/commands/config/push/push.integration.test.ts +++ b/apps/cli/src/commands/config/push/push.integration.test.ts @@ -13,9 +13,9 @@ import { Schema, Stdio, } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockAnalytics, diff --git a/apps/cli/src/commands/db/advisors/advisors.command.ts b/apps/cli/src/commands/db/advisors/advisors.command.ts index 4c2dd468ba..ef2b095053 100644 --- a/apps/cli/src/commands/db/advisors/advisors.command.ts +++ b/apps/cli/src/commands/db/advisors/advisors.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { dbAdvisors } from "./advisors.handler.ts"; diff --git a/apps/cli/src/commands/db/advisors/advisors.integration.test.ts b/apps/cli/src/commands/db/advisors/advisors.integration.test.ts index fecee4932f..407ece3ec3 100644 --- a/apps/cli/src/commands/db/advisors/advisors.integration.test.ts +++ b/apps/cli/src/commands/db/advisors/advisors.integration.test.ts @@ -12,7 +12,7 @@ import { mockTelemetryStateTracked, sequentialExecBatch, } from "../../../../tests/helpers/command-mocks.ts"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; import { DnsResolverFlag } from "../../../command-internal/global-flags.ts"; diff --git a/apps/cli/src/commands/db/advisors/advisors.linked.ts b/apps/cli/src/commands/db/advisors/advisors.linked.ts index a397f56553..fdc8b3c438 100644 --- a/apps/cli/src/commands/db/advisors/advisors.linked.ts +++ b/apps/cli/src/commands/db/advisors/advisors.linked.ts @@ -1,8 +1,8 @@ import { Effect } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import type * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import type * as HttpClientResponse from "effect/http/HttpClientResponse"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { sanitizeErrorBody } from "../../../command-internal/http-errors.ts"; diff --git a/apps/cli/src/commands/db/branch/branch.command.ts b/apps/cli/src/commands/db/branch/branch.command.ts index d3363a0a22..1994ad8614 100644 --- a/apps/cli/src/commands/db/branch/branch.command.ts +++ b/apps/cli/src/commands/db/branch/branch.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { dbBranchCreateCommand } from "./create/create.command.ts"; import { dbBranchDeleteCommand } from "./delete/delete.command.ts"; import { dbBranchListCommand } from "./list/list.command.ts"; diff --git a/apps/cli/src/commands/db/branch/create/create.command.ts b/apps/cli/src/commands/db/branch/create/create.command.ts index bdcb982f2b..ddbc5ff3a8 100644 --- a/apps/cli/src/commands/db/branch/create/create.command.ts +++ b/apps/cli/src/commands/db/branch/create/create.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { dbBranchCreate } from "./create.handler.ts"; const config = { diff --git a/apps/cli/src/commands/db/branch/delete/delete.command.ts b/apps/cli/src/commands/db/branch/delete/delete.command.ts index cb35a6dbe7..93a06da6be 100644 --- a/apps/cli/src/commands/db/branch/delete/delete.command.ts +++ b/apps/cli/src/commands/db/branch/delete/delete.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { dbBranchDelete } from "./delete.handler.ts"; const config = { diff --git a/apps/cli/src/commands/db/branch/list/list.command.ts b/apps/cli/src/commands/db/branch/list/list.command.ts index e53aa60eca..f2d3eafbcc 100644 --- a/apps/cli/src/commands/db/branch/list/list.command.ts +++ b/apps/cli/src/commands/db/branch/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { dbBranchList } from "./list.handler.ts"; const config = {} as const; diff --git a/apps/cli/src/commands/db/branch/switch/switch.command.ts b/apps/cli/src/commands/db/branch/switch/switch.command.ts index d948f7dcf3..82c83a6f14 100644 --- a/apps/cli/src/commands/db/branch/switch/switch.command.ts +++ b/apps/cli/src/commands/db/branch/switch/switch.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { dbBranchSwitch } from "./switch.handler.ts"; const config = { diff --git a/apps/cli/src/commands/db/db.command.ts b/apps/cli/src/commands/db/db.command.ts index 4509c15711..57180f492a 100644 --- a/apps/cli/src/commands/db/db.command.ts +++ b/apps/cli/src/commands/db/db.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { dbDiffCommand } from "./diff/diff.command.ts"; import { dbDumpCommand } from "./dump/dump.command.ts"; import { dbPushCommand } from "./push/push.command.ts"; diff --git a/apps/cli/src/commands/db/diff/diff.command.ts b/apps/cli/src/commands/db/diff/diff.command.ts index 3fff3ac3d8..9be489b526 100644 --- a/apps/cli/src/commands/db/diff/diff.command.ts +++ b/apps/cli/src/commands/db/diff/diff.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { parseSchemaFlags } from "../../../command-internal/schema-flags.ts"; diff --git a/apps/cli/src/commands/db/diff/diff.handler.ts b/apps/cli/src/commands/db/diff/diff.handler.ts index 85a048de5a..cdf86f85f0 100644 --- a/apps/cli/src/commands/db/diff/diff.handler.ts +++ b/apps/cli/src/commands/db/diff/diff.handler.ts @@ -1,5 +1,5 @@ import { Clock, Effect, FileSystem, Option, Path } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { DebugFlag, diff --git a/apps/cli/src/commands/db/diff/diff.integration.test.ts b/apps/cli/src/commands/db/diff/diff.integration.test.ts index 76832600d3..04b7923751 100644 --- a/apps/cli/src/commands/db/diff/diff.integration.test.ts +++ b/apps/cli/src/commands/db/diff/diff.integration.test.ts @@ -13,8 +13,8 @@ import { Option, Path, } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { stripAnsi } from "../../../../tests/helpers/ansi.ts"; import { diff --git a/apps/cli/src/commands/db/diff/diff.stack-cache.e2e.test.ts b/apps/cli/src/commands/db/diff/diff.stack-cache.e2e.test.ts index 37603ac7da..4324f31a50 100644 --- a/apps/cli/src/commands/db/diff/diff.stack-cache.e2e.test.ts +++ b/apps/cli/src/commands/db/diff/diff.stack-cache.e2e.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect, FileSystem, Path, Redacted } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { create as createStack } from "@supabase/stack/effect"; import { tmpdir } from "node:os"; import { runSupabaseEffect } from "../../../../tests/helpers/cli.ts"; diff --git a/apps/cli/src/commands/db/dump/dump.command.ts b/apps/cli/src/commands/db/dump/dump.command.ts index 31766b13c1..89b118da02 100644 --- a/apps/cli/src/commands/db/dump/dump.command.ts +++ b/apps/cli/src/commands/db/dump/dump.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { Output } from "../../../shared/output/output.service.ts"; diff --git a/apps/cli/src/commands/db/dump/dump.integration.test.ts b/apps/cli/src/commands/db/dump/dump.integration.test.ts index e020809e10..2e31bd4db7 100644 --- a/apps/cli/src/commands/db/dump/dump.integration.test.ts +++ b/apps/cli/src/commands/db/dump/dump.integration.test.ts @@ -13,7 +13,7 @@ import { Schema, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { mockOutput, mockTty, processEnvLayer } from "../../../../tests/helpers/mocks.ts"; import { diff --git a/apps/cli/src/commands/db/lint/lint.command.ts b/apps/cli/src/commands/db/lint/lint.command.ts index 702b739ac8..b8900989e8 100644 --- a/apps/cli/src/commands/db/lint/lint.command.ts +++ b/apps/cli/src/commands/db/lint/lint.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { parseSchemaFlags } from "../../../command-internal/schema-flags.ts"; diff --git a/apps/cli/src/commands/db/pull/pull.command.ts b/apps/cli/src/commands/db/pull/pull.command.ts index 8f4a98e969..498664c3e4 100644 --- a/apps/cli/src/commands/db/pull/pull.command.ts +++ b/apps/cli/src/commands/db/pull/pull.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { parseSchemaFlags } from "../../../command-internal/schema-flags.ts"; diff --git a/apps/cli/src/commands/db/pull/pull.integration.test.ts b/apps/cli/src/commands/db/pull/pull.integration.test.ts index e0129d4e8a..9bb877ffbe 100644 --- a/apps/cli/src/commands/db/pull/pull.integration.test.ts +++ b/apps/cli/src/commands/db/pull/pull.integration.test.ts @@ -13,8 +13,8 @@ import { Path, Schema, } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { stripAnsi } from "../../../../tests/helpers/ansi.ts"; import { diff --git a/apps/cli/src/commands/db/push/push.command.ts b/apps/cli/src/commands/db/push/push.command.ts index c6f2330b01..1729ea98d5 100644 --- a/apps/cli/src/commands/db/push/push.command.ts +++ b/apps/cli/src/commands/db/push/push.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/db/query/query.command.ts b/apps/cli/src/commands/db/query/query.command.ts index 37c6683ffb..a056a440a9 100644 --- a/apps/cli/src/commands/db/query/query.command.ts +++ b/apps/cli/src/commands/db/query/query.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/db/query/query.handler.ts b/apps/cli/src/commands/db/query/query.handler.ts index d021e2214d..dc7c213cc3 100644 --- a/apps/cli/src/commands/db/query/query.handler.ts +++ b/apps/cli/src/commands/db/query/query.handler.ts @@ -1,6 +1,6 @@ import { DateTime, Effect, FileSystem, Option, Path, Redacted, Schema } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { CommandCredentials } from "../../../auth/command-credentials.service.ts"; diff --git a/apps/cli/src/commands/db/query/query.integration.test.ts b/apps/cli/src/commands/db/query/query.integration.test.ts index 8202aa7a81..d41ba08efe 100644 --- a/apps/cli/src/commands/db/query/query.integration.test.ts +++ b/apps/cli/src/commands/db/query/query.integration.test.ts @@ -12,9 +12,9 @@ import { Schema, Stream, } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { VALID_TOKEN, diff --git a/apps/cli/src/commands/db/remote/changes/changes.command.ts b/apps/cli/src/commands/db/remote/changes/changes.command.ts index 2f30f047ec..d7a5629b04 100644 --- a/apps/cli/src/commands/db/remote/changes/changes.command.ts +++ b/apps/cli/src/commands/db/remote/changes/changes.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { dbRemoteChanges } from "./changes.handler.ts"; const config = { diff --git a/apps/cli/src/commands/db/remote/commit/commit.command.ts b/apps/cli/src/commands/db/remote/commit/commit.command.ts index 32ba41a61f..5dacbe9014 100644 --- a/apps/cli/src/commands/db/remote/commit/commit.command.ts +++ b/apps/cli/src/commands/db/remote/commit/commit.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/db/remote/remote.command.ts b/apps/cli/src/commands/db/remote/remote.command.ts index d7daeb9e25..cc860fa8c6 100644 --- a/apps/cli/src/commands/db/remote/remote.command.ts +++ b/apps/cli/src/commands/db/remote/remote.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { dbRemoteChangesCommand } from "./changes/changes.command.ts"; import { dbRemoteCommitCommand } from "./commit/commit.command.ts"; diff --git a/apps/cli/src/commands/db/reset/reset.command.ts b/apps/cli/src/commands/db/reset/reset.command.ts index 0f695b2bcc..31d241f3f0 100644 --- a/apps/cli/src/commands/db/reset/reset.command.ts +++ b/apps/cli/src/commands/db/reset/reset.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/db/reset/reset.integration.test.ts b/apps/cli/src/commands/db/reset/reset.integration.test.ts index 1f73deb1b8..66ea8f3800 100644 --- a/apps/cli/src/commands/db/reset/reset.integration.test.ts +++ b/apps/cli/src/commands/db/reset/reset.integration.test.ts @@ -14,9 +14,9 @@ import { Redacted, Schema, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockOutput, diff --git a/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts b/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts index f86b7e44f8..23865f265e 100644 --- a/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts +++ b/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Context, Data, Effect, FileSystem, Layer, Path, Redacted } from "effect"; -import { FetchHttpClient, HttpClient } from "effect/unstable/http"; +import { FetchHttpClient, HttpClient } from "effect/http"; import { PgClient } from "@effect/sql-pg"; import { create as createStack } from "@supabase/stack/effect"; import { tmpdir } from "node:os"; diff --git a/apps/cli/src/commands/db/schema/declarative/declarative.command.ts b/apps/cli/src/commands/db/schema/declarative/declarative.command.ts index b07e6539b6..5fe73596ec 100644 --- a/apps/cli/src/commands/db/schema/declarative/declarative.command.ts +++ b/apps/cli/src/commands/db/schema/declarative/declarative.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { dbSchemaDeclarativeSharedBase } from "./declarative.shared.ts"; import { dbSchemaDeclarativeGenerateCommand } from "./generate/generate.command.ts"; import { dbSchemaDeclarativeSyncCommand } from "./sync/sync.command.ts"; diff --git a/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts b/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts index 9758479f09..edb1dd999a 100644 --- a/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts +++ b/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts @@ -1,4 +1,4 @@ -import { Command, Flag } from "effect/unstable/cli"; +import { Command, Flag } from "effect/cli"; /** * Base `db schema declarative` group command carrying the shared `--no-cache`/`--strict-coverage` diff --git a/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts b/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts index 23bf7fe998..442da47404 100644 --- a/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts +++ b/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../../shared/output/json-error-handling.ts"; import { Output } from "../../../../../shared/output/output.service.ts"; diff --git a/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts b/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts index c196f92522..6f6f3e2955 100644 --- a/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts +++ b/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../../shared/output/json-error-handling.ts"; import { parseSchemaFlags } from "../../../../../command-internal/schema-flags.ts"; diff --git a/apps/cli/src/commands/db/schema/schema.command.ts b/apps/cli/src/commands/db/schema/schema.command.ts index 763cc0977c..ff39063efe 100644 --- a/apps/cli/src/commands/db/schema/schema.command.ts +++ b/apps/cli/src/commands/db/schema/schema.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { dbSchemaDeclarativeCommand } from "./declarative/declarative.command.ts"; export const dbSchemaCommand = Command.make("schema").pipe( diff --git a/apps/cli/src/commands/db/shared/migra.ts b/apps/cli/src/commands/db/shared/migra.ts index 57d1814e56..199286e7b3 100644 --- a/apps/cli/src/commands/db/shared/migra.ts +++ b/apps/cli/src/commands/db/shared/migra.ts @@ -1,5 +1,5 @@ import { Config, Effect, Option } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { isBitbucketPipeline } from "../../../command-internal/bitbucket-pipeline.ts"; import { diff --git a/apps/cli/src/commands/db/shared/pgdelta-next-shadow.layer.ts b/apps/cli/src/commands/db/shared/pgdelta-next-shadow.layer.ts index 6fa1993936..0f5db7067f 100644 --- a/apps/cli/src/commands/db/shared/pgdelta-next-shadow.layer.ts +++ b/apps/cli/src/commands/db/shared/pgdelta-next-shadow.layer.ts @@ -38,9 +38,9 @@ import { shadowRunInputFromLocalContainerInputs, setupShadowDatabase, } from "../../../command-internal/db-bootstrap/shadow-database.ts"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerType } from "effect/unstable/process/ChildProcessSpawner"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import { ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerType } from "effect/process/ChildProcessSpawner"; +import * as HttpClient from "effect/http/HttpClient"; import { PgDeltaNextShadow, diff --git a/apps/cli/src/commands/db/shared/pgdelta-next-shadow.stack.integration.test.ts b/apps/cli/src/commands/db/shared/pgdelta-next-shadow.stack.integration.test.ts index 9b4a0acf11..2f8630abc5 100644 --- a/apps/cli/src/commands/db/shared/pgdelta-next-shadow.stack.integration.test.ts +++ b/apps/cli/src/commands/db/shared/pgdelta-next-shadow.stack.integration.test.ts @@ -1,6 +1,6 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { Effect, FileSystem, Layer, Option } from "effect"; import { mockCommandSettings, withEnvVar } from "../../../../tests/helpers/command-mocks.ts"; diff --git a/apps/cli/src/commands/db/shared/pgdelta.seam.integration.test.ts b/apps/cli/src/commands/db/shared/pgdelta.seam.integration.test.ts index 3cdd90f8a7..fff4575c73 100644 --- a/apps/cli/src/commands/db/shared/pgdelta.seam.integration.test.ts +++ b/apps/cli/src/commands/db/shared/pgdelta.seam.integration.test.ts @@ -1,8 +1,8 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer, Option } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { afterEach, beforeEach, vi } from "vitest"; import { diff --git a/apps/cli/src/commands/db/shared/pgdelta.seam.layer.ts b/apps/cli/src/commands/db/shared/pgdelta.seam.layer.ts index a493fd8ea4..89a64810d2 100644 --- a/apps/cli/src/commands/db/shared/pgdelta.seam.layer.ts +++ b/apps/cli/src/commands/db/shared/pgdelta.seam.layer.ts @@ -1,5 +1,5 @@ import { Effect, FileSystem, Layer, Option, Path, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; diff --git a/apps/cli/src/commands/db/shared/shadow-source.ts b/apps/cli/src/commands/db/shared/shadow-source.ts index e6483fc8a7..b5afb92d70 100644 --- a/apps/cli/src/commands/db/shared/shadow-source.ts +++ b/apps/cli/src/commands/db/shared/shadow-source.ts @@ -7,8 +7,8 @@ */ import { Effect, Result, type FileSystem, type Path } from "effect"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import type * as HttpClient from "effect/http/HttpClient"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import { Output } from "../../../shared/output/output.service.ts"; import type { RuntimeInfo } from "../../../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/commands/db/start/start.command.ts b/apps/cli/src/commands/db/start/start.command.ts index 57c9b0150d..1fb559e20b 100644 --- a/apps/cli/src/commands/db/start/start.command.ts +++ b/apps/cli/src/commands/db/start/start.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/db/start/start.integration.test.ts b/apps/cli/src/commands/db/start/start.integration.test.ts index 48f591f4dc..0eec663ee0 100644 --- a/apps/cli/src/commands/db/start/start.integration.test.ts +++ b/apps/cli/src/commands/db/start/start.integration.test.ts @@ -13,9 +13,9 @@ import { Stream, Redacted, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { vi } from "vitest"; import { diff --git a/apps/cli/src/commands/db/test/test.command.ts b/apps/cli/src/commands/db/test/test.command.ts index f80ee47b21..4cbf589f2d 100644 --- a/apps/cli/src/commands/db/test/test.command.ts +++ b/apps/cli/src/commands/db/test/test.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { TEST_DB_DESCRIPTION, diff --git a/apps/cli/src/commands/db/test/test.integration.test.ts b/apps/cli/src/commands/db/test/test.integration.test.ts index a960da47f7..1369c4f27b 100644 --- a/apps/cli/src/commands/db/test/test.integration.test.ts +++ b/apps/cli/src/commands/db/test/test.integration.test.ts @@ -8,7 +8,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect, Layer, Option, Stdio } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { mockOutput, diff --git a/apps/cli/src/commands/domains/activate/activate.command.ts b/apps/cli/src/commands/domains/activate/activate.command.ts index b6f637ce9a..8ce697e34c 100644 --- a/apps/cli/src/commands/domains/activate/activate.command.ts +++ b/apps/cli/src/commands/domains/activate/activate.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/domains/create/create.command.ts b/apps/cli/src/commands/domains/create/create.command.ts index 4974af1115..94ed783d16 100644 --- a/apps/cli/src/commands/domains/create/create.command.ts +++ b/apps/cli/src/commands/domains/create/create.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/domains/create/create.handler.ts b/apps/cli/src/commands/domains/create/create.handler.ts index f65d28f597..96d91eca98 100644 --- a/apps/cli/src/commands/domains/create/create.handler.ts +++ b/apps/cli/src/commands/domains/create/create.handler.ts @@ -1,5 +1,5 @@ import { Effect } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import * as HttpClient from "effect/http/HttpClient"; import { CommandPlatformApi } from "../../../auth/command-platform-api.service.ts"; import { CommandSettings } from "../../../config/command-settings.service.ts"; diff --git a/apps/cli/src/commands/domains/delete/delete.command.ts b/apps/cli/src/commands/domains/delete/delete.command.ts index 3c6bb65f37..be54c54d20 100644 --- a/apps/cli/src/commands/domains/delete/delete.command.ts +++ b/apps/cli/src/commands/domains/delete/delete.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/domains/domains.cname.ts b/apps/cli/src/commands/domains/domains.cname.ts index a5b47ebaec..95e5c23500 100644 --- a/apps/cli/src/commands/domains/domains.cname.ts +++ b/apps/cli/src/commands/domains/domains.cname.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import type * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { DomainsCnameError } from "./domains.errors.ts"; diff --git a/apps/cli/src/commands/domains/domains.command.ts b/apps/cli/src/commands/domains/domains.command.ts index c5afc94674..5e67898123 100644 --- a/apps/cli/src/commands/domains/domains.command.ts +++ b/apps/cli/src/commands/domains/domains.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { domainsActivateCommand } from "./activate/activate.command.ts"; import { domainsCreateCommand } from "./create/create.command.ts"; import { domainsDeleteCommand } from "./delete/delete.command.ts"; diff --git a/apps/cli/src/commands/domains/get/get.command.ts b/apps/cli/src/commands/domains/get/get.command.ts index 3c66863e9b..f1ad2002af 100644 --- a/apps/cli/src/commands/domains/get/get.command.ts +++ b/apps/cli/src/commands/domains/get/get.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/domains/reverify/reverify.command.ts b/apps/cli/src/commands/domains/reverify/reverify.command.ts index 4d05881003..4483e1b496 100644 --- a/apps/cli/src/commands/domains/reverify/reverify.command.ts +++ b/apps/cli/src/commands/domains/reverify/reverify.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/encryption/encryption.command.ts b/apps/cli/src/commands/encryption/encryption.command.ts index 1144a251b9..200157a294 100644 --- a/apps/cli/src/commands/encryption/encryption.command.ts +++ b/apps/cli/src/commands/encryption/encryption.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { encryptionGetRootKeyCommand } from "./get-root-key/get-root-key.command.ts"; import { encryptionUpdateRootKeyCommand } from "./update-root-key/update-root-key.command.ts"; diff --git a/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts b/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts index 609a465b7f..643abaa342 100644 --- a/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts +++ b/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts b/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts index dcc1ead3d8..2b8c60c04d 100644 --- a/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts +++ b/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/experimental/compute/compute.command.ts b/apps/cli/src/commands/experimental/compute/compute.command.ts index 38100684db..5d89d2a12f 100644 --- a/apps/cli/src/commands/experimental/compute/compute.command.ts +++ b/apps/cli/src/commands/experimental/compute/compute.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { computeDeleteCommand } from "./delete/delete.command.ts"; import { computeListCommand } from "./list/list.command.ts"; import { computeLogsCommand } from "./logs/logs.command.ts"; diff --git a/apps/cli/src/commands/experimental/compute/delete/delete.command.ts b/apps/cli/src/commands/experimental/compute/delete/delete.command.ts index c8a86d5ac9..2d5555e6bb 100644 --- a/apps/cli/src/commands/experimental/compute/delete/delete.command.ts +++ b/apps/cli/src/commands/experimental/compute/delete/delete.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../../command-internal/management-api-runtime.layer.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/experimental/compute/list/list.command.ts b/apps/cli/src/commands/experimental/compute/list/list.command.ts index 4b230f757c..a8a4fe0694 100644 --- a/apps/cli/src/commands/experimental/compute/list/list.command.ts +++ b/apps/cli/src/commands/experimental/compute/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../../command-internal/management-api-runtime.layer.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/experimental/compute/logs/logs.command.ts b/apps/cli/src/commands/experimental/compute/logs/logs.command.ts index 049ea2b126..8f76711a84 100644 --- a/apps/cli/src/commands/experimental/compute/logs/logs.command.ts +++ b/apps/cli/src/commands/experimental/compute/logs/logs.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../../command-internal/management-api-runtime.layer.ts"; import { diff --git a/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts b/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts index 1efe2a159a..a3422d95d8 100644 --- a/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts +++ b/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts @@ -13,7 +13,7 @@ import { Stdio, Tracer, } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { makeComputeProject, setupCompute, diff --git a/apps/cli/src/commands/experimental/compute/new/new.command.ts b/apps/cli/src/commands/experimental/compute/new/new.command.ts index 167d15055a..0ac0f1ba66 100644 --- a/apps/cli/src/commands/experimental/compute/new/new.command.ts +++ b/apps/cli/src/commands/experimental/compute/new/new.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../../shared/runtime/command-runtime.layer.ts"; import { diff --git a/apps/cli/src/commands/experimental/compute/push/push.command.ts b/apps/cli/src/commands/experimental/compute/push/push.command.ts index fd56fc69ab..580644d670 100644 --- a/apps/cli/src/commands/experimental/compute/push/push.command.ts +++ b/apps/cli/src/commands/experimental/compute/push/push.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { COMPUTE_EXPOSURES } from "../../../../shared/compute/compute-runtimes.ts"; import { managementApiRuntimeLayer } from "../../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/experimental/compute/status/status.command.ts b/apps/cli/src/commands/experimental/compute/status/status.command.ts index 86a6334ef2..0dd9eaa4e1 100644 --- a/apps/cli/src/commands/experimental/compute/status/status.command.ts +++ b/apps/cli/src/commands/experimental/compute/status/status.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../../command-internal/management-api-runtime.layer.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts b/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts index d32d57f57e..a7595ce7fd 100644 --- a/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts +++ b/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { stdinLayer } from "../../../../shared/runtime/stdin.layer.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/experimental/stack/list/list.command.ts b/apps/cli/src/commands/experimental/stack/list/list.command.ts index 625b259261..826485911a 100644 --- a/apps/cli/src/commands/experimental/stack/list/list.command.ts +++ b/apps/cli/src/commands/experimental/stack/list/list.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; import { stackList } from "./list.handler.ts"; diff --git a/apps/cli/src/commands/experimental/stack/logs/logs.command.ts b/apps/cli/src/commands/experimental/stack/logs/logs.command.ts index 8b707c123b..dd41b233f1 100644 --- a/apps/cli/src/commands/experimental/stack/logs/logs.command.ts +++ b/apps/cli/src/commands/experimental/stack/logs/logs.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; import { stackLogs } from "./logs.handler.ts"; diff --git a/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts b/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts index d1a052ffe9..6e52e1c35e 100644 --- a/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts +++ b/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; import { stackPrepare } from "./prepare.handler.ts"; diff --git a/apps/cli/src/commands/experimental/stack/restart/restart.command.ts b/apps/cli/src/commands/experimental/stack/restart/restart.command.ts index 206d37fe57..cb3bbebca0 100644 --- a/apps/cli/src/commands/experimental/stack/restart/restart.command.ts +++ b/apps/cli/src/commands/experimental/stack/restart/restart.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; import { stackRestart } from "./restart.handler.ts"; diff --git a/apps/cli/src/commands/experimental/stack/stack-command-telemetry.integration.test.ts b/apps/cli/src/commands/experimental/stack/stack-command-telemetry.integration.test.ts index 290c59da79..aca726ef17 100644 --- a/apps/cli/src/commands/experimental/stack/stack-command-telemetry.integration.test.ts +++ b/apps/cli/src/commands/experimental/stack/stack-command-telemetry.integration.test.ts @@ -1,6 +1,6 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { Effect, FileSystem, Layer, Option, Path } from "effect"; import { mockContextualAnalytics, diff --git a/apps/cli/src/commands/experimental/stack/stack.command.ts b/apps/cli/src/commands/experimental/stack/stack.command.ts index eb710b0fa9..7665e0366e 100644 --- a/apps/cli/src/commands/experimental/stack/stack.command.ts +++ b/apps/cli/src/commands/experimental/stack/stack.command.ts @@ -1,5 +1,5 @@ import { Effect, Layer } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { commandSettingsLayer } from "../../../config/command-settings.layer.ts"; import { debugLoggerLayer } from "../../../command-internal/debug-logger.layer.ts"; diff --git a/apps/cli/src/commands/experimental/stack/start/start-export-pointer.integration.test.ts b/apps/cli/src/commands/experimental/stack/start/start-export-pointer.integration.test.ts index 022a52ae47..4a01f9df13 100644 --- a/apps/cli/src/commands/experimental/stack/start/start-export-pointer.integration.test.ts +++ b/apps/cli/src/commands/experimental/stack/start/start-export-pointer.integration.test.ts @@ -1,6 +1,6 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { Effect, Layer, Option, Redacted, Schema, Stream } from "effect"; import type { Observation, diff --git a/apps/cli/src/commands/experimental/stack/start/start.command.ts b/apps/cli/src/commands/experimental/stack/start/start.command.ts index bcc8f3e806..09043e7a40 100644 --- a/apps/cli/src/commands/experimental/stack/start/start.command.ts +++ b/apps/cli/src/commands/experimental/stack/start/start.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { machineErrorContextLayer } from "../../../../shared/output/machine-error-context.layer.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/experimental/stack/start/start.e2e.test.ts b/apps/cli/src/commands/experimental/stack/start/start.e2e.test.ts index d73c028be2..b5ea2ee405 100644 --- a/apps/cli/src/commands/experimental/stack/start/start.e2e.test.ts +++ b/apps/cli/src/commands/experimental/stack/start/start.e2e.test.ts @@ -12,7 +12,7 @@ import { Predicate, Schema, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { parse as parseDotenv } from "dotenv"; import { afterAll, afterEach, describe, expect, test } from "vitest"; import { diff --git a/apps/cli/src/commands/experimental/stack/start/start.integration.test.ts b/apps/cli/src/commands/experimental/stack/start/start.integration.test.ts index 4a3f809976..313005872a 100644 --- a/apps/cli/src/commands/experimental/stack/start/start.integration.test.ts +++ b/apps/cli/src/commands/experimental/stack/start/start.integration.test.ts @@ -50,7 +50,7 @@ import { StackCatalogSetup } from "../../../../command-internal/stack-catalog-se import { ExperimentalFlag, YesFlag } from "../../../../command-internal/global-flags.ts"; import { CommandPlatformApiFactory } from "../../../../auth/command-platform-api-factory.service.ts"; import { stdinLayer } from "../../../../shared/runtime/stdin.layer.ts"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import * as HttpClient from "effect/http/HttpClient"; import { CliArgs } from "../../../../shared/cli/cli-args.service.ts"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { machineErrorContextLayer } from "../../../../shared/output/machine-error-context.layer.ts"; diff --git a/apps/cli/src/commands/experimental/stack/start/start.native.integration.test.ts b/apps/cli/src/commands/experimental/stack/start/start.native.integration.test.ts index 85363964ec..98fa6b7fd7 100644 --- a/apps/cli/src/commands/experimental/stack/start/start.native.integration.test.ts +++ b/apps/cli/src/commands/experimental/stack/start/start.native.integration.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Path } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import * as net from "node:net"; import type { Stack } from "@supabase/stack/effect"; import { diff --git a/apps/cli/src/commands/experimental/stack/start/start.storage.e2e.test.ts b/apps/cli/src/commands/experimental/stack/start/start.storage.e2e.test.ts index c268717965..0f2de48ef3 100644 --- a/apps/cli/src/commands/experimental/stack/start/start.storage.e2e.test.ts +++ b/apps/cli/src/commands/experimental/stack/start/start.storage.e2e.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Data, Effect, Exit, FileSystem, Path, Schema } from "effect"; -import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/http"; import { tmpdir } from "node:os"; import { diff --git a/apps/cli/src/commands/experimental/stack/status/status.command.ts b/apps/cli/src/commands/experimental/stack/status/status.command.ts index 804ea0f622..115891ccb3 100644 --- a/apps/cli/src/commands/experimental/stack/status/status.command.ts +++ b/apps/cli/src/commands/experimental/stack/status/status.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { stringSliceFlag } from "../../../../command-internal/string-slice-flag.ts"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/experimental/stack/stop/stop.command.ts b/apps/cli/src/commands/experimental/stack/stop/stop.command.ts index 76f82b7515..25bc63f9c2 100644 --- a/apps/cli/src/commands/experimental/stack/stop/stop.command.ts +++ b/apps/cli/src/commands/experimental/stack/stop/stop.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts"; import { stackStop } from "./stop.handler.ts"; diff --git a/apps/cli/src/commands/feedback/add/add.command.ts b/apps/cli/src/commands/feedback/add/add.command.ts index 5d7b845ab6..752af93adb 100644 --- a/apps/cli/src/commands/feedback/add/add.command.ts +++ b/apps/cli/src/commands/feedback/add/add.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/feedback/delete/delete.command.ts b/apps/cli/src/commands/feedback/delete/delete.command.ts index 0229d03606..1a8a7ab9b6 100644 --- a/apps/cli/src/commands/feedback/delete/delete.command.ts +++ b/apps/cli/src/commands/feedback/delete/delete.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/feedback/feedback.command.ts b/apps/cli/src/commands/feedback/feedback.command.ts index 14c571df45..88c881cecf 100644 --- a/apps/cli/src/commands/feedback/feedback.command.ts +++ b/apps/cli/src/commands/feedback/feedback.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { feedbackAddCommand } from "./add/add.command.ts"; import { feedbackDeleteCommand } from "./delete/delete.command.ts"; diff --git a/apps/cli/src/commands/functions/delete/delete.command.ts b/apps/cli/src/commands/functions/delete/delete.command.ts index 5f11f4acc7..f8ac0fcc75 100644 --- a/apps/cli/src/commands/functions/delete/delete.command.ts +++ b/apps/cli/src/commands/functions/delete/delete.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { FUNCTIONS_PROJECT_REF_SAFE_FLAGS } from "../../../shared/functions/functions.shared.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/functions/deploy/deploy.command.ts b/apps/cli/src/commands/functions/deploy/deploy.command.ts index 968f897b8e..c5a0e110d5 100644 --- a/apps/cli/src/commands/functions/deploy/deploy.command.ts +++ b/apps/cli/src/commands/functions/deploy/deploy.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { FUNCTIONS_PROJECT_REF_SAFE_FLAGS } from "../../../shared/functions/functions.shared.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/functions/deploy/deploy.integration.test.ts b/apps/cli/src/commands/functions/deploy/deploy.integration.test.ts index f06ac21d68..7f13fef965 100644 --- a/apps/cli/src/commands/functions/deploy/deploy.integration.test.ts +++ b/apps/cli/src/commands/functions/deploy/deploy.integration.test.ts @@ -12,7 +12,7 @@ import { Path, Stdio, } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { YesFlag } from "../../../command-internal/global-flags.ts"; import { stripControlSequences } from "../../../shared/output/strip-control-sequences.ts"; diff --git a/apps/cli/src/commands/functions/download/download.command.ts b/apps/cli/src/commands/functions/download/download.command.ts index 188f2f61b1..985f174bb7 100644 --- a/apps/cli/src/commands/functions/download/download.command.ts +++ b/apps/cli/src/commands/functions/download/download.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { FUNCTIONS_PROJECT_REF_SAFE_FLAGS } from "../../../shared/functions/functions.shared.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/functions/download/download.integration.test.ts b/apps/cli/src/commands/functions/download/download.integration.test.ts index 0ce78d449b..ec0471a52a 100644 --- a/apps/cli/src/commands/functions/download/download.integration.test.ts +++ b/apps/cli/src/commands/functions/download/download.integration.test.ts @@ -17,8 +17,8 @@ import { Stdio, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { CurrentAnalyticsContext } from "../../../shared/telemetry/analytics-context.ts"; diff --git a/apps/cli/src/commands/functions/functions.command.ts b/apps/cli/src/commands/functions/functions.command.ts index 4e4305b489..21669d7980 100644 --- a/apps/cli/src/commands/functions/functions.command.ts +++ b/apps/cli/src/commands/functions/functions.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { functionsListCommand } from "./list/list.command.ts"; import { functionsDeleteCommand } from "./delete/delete.command.ts"; import { functionsDownloadCommand } from "./download/download.command.ts"; diff --git a/apps/cli/src/commands/functions/list/list.command.ts b/apps/cli/src/commands/functions/list/list.command.ts index 393f17c665..9f1726a9a2 100644 --- a/apps/cli/src/commands/functions/list/list.command.ts +++ b/apps/cli/src/commands/functions/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { FUNCTIONS_PROJECT_REF_SAFE_FLAGS } from "../../../shared/functions/functions.shared.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/functions/list/list.integration.test.ts b/apps/cli/src/commands/functions/list/list.integration.test.ts index 6b9e887992..89d2b52651 100644 --- a/apps/cli/src/commands/functions/list/list.integration.test.ts +++ b/apps/cli/src/commands/functions/list/list.integration.test.ts @@ -1,7 +1,7 @@ import type { V1ListAllFunctionsOutput } from "@supabase/api/effect"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer, Option } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { VALID_REF, diff --git a/apps/cli/src/commands/functions/new/new.command.ts b/apps/cli/src/commands/functions/new/new.command.ts index defb873b70..3f83614606 100644 --- a/apps/cli/src/commands/functions/new/new.command.ts +++ b/apps/cli/src/commands/functions/new/new.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/functions/new/new.stack.e2e.test.ts b/apps/cli/src/commands/functions/new/new.stack.e2e.test.ts index d3c24be7c5..b58f21eb08 100644 --- a/apps/cli/src/commands/functions/new/new.stack.e2e.test.ts +++ b/apps/cli/src/commands/functions/new/new.stack.e2e.test.ts @@ -3,7 +3,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect, FileSystem, Layer, Path, Schema } from "effect"; -import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/http"; import { homedir } from "node:os"; import { makeTempHome, runSupabaseEffect } from "../../../../tests/helpers/cli.ts"; diff --git a/apps/cli/src/commands/functions/serve/serve.command.integration.test.ts b/apps/cli/src/commands/functions/serve/serve.command.integration.test.ts index 26ea220c39..6b88151e49 100644 --- a/apps/cli/src/commands/functions/serve/serve.command.integration.test.ts +++ b/apps/cli/src/commands/functions/serve/serve.command.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { textCliOutputFormatter } from "../../../shared/output/text-formatter.ts"; import { functionsServeCommand } from "./serve.command.ts"; diff --git a/apps/cli/src/commands/functions/serve/serve.command.ts b/apps/cli/src/commands/functions/serve/serve.command.ts index e7fd48e098..4f5e81d85a 100644 --- a/apps/cli/src/commands/functions/serve/serve.command.ts +++ b/apps/cli/src/commands/functions/serve/serve.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; import { httpClientLayer } from "../../../auth/http-debug.layer.ts"; -import { Argument, Command, Flag } from "effect/unstable/cli"; +import { Argument, Command, Flag } from "effect/cli"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { FUNCTIONS_SERVE_INSPECT_MODES } from "../../../shared/functions/serve.ts"; diff --git a/apps/cli/src/commands/functions/serve/serve.integration.test.ts b/apps/cli/src/commands/functions/serve/serve.integration.test.ts index 275063814f..68bbbe7154 100644 --- a/apps/cli/src/commands/functions/serve/serve.integration.test.ts +++ b/apps/cli/src/commands/functions/serve/serve.integration.test.ts @@ -1,6 +1,6 @@ import { BunServices } from "@effect/platform-bun"; import { FileSystem, Path } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { describe, expect, it } from "@effect/vitest"; import { CliConfigParseError } from "@supabase/config"; @@ -21,7 +21,7 @@ import { Sink, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { beforeEach, vi } from "vitest"; import { diff --git a/apps/cli/src/commands/functions/serve/serve.stack.e2e.test.ts b/apps/cli/src/commands/functions/serve/serve.stack.e2e.test.ts index 5bc41babe2..b771f6df8b 100644 --- a/apps/cli/src/commands/functions/serve/serve.stack.e2e.test.ts +++ b/apps/cli/src/commands/functions/serve/serve.stack.e2e.test.ts @@ -2,7 +2,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { create as createStack } from "@supabase/stack/effect"; import { Data, Effect, FileSystem, Layer, Path, Redacted, Schema } from "effect"; -import { FetchHttpClient, HttpClient } from "effect/unstable/http"; +import { FetchHttpClient, HttpClient } from "effect/http"; import { homedir, tmpdir } from "node:os"; import { spawnSupabase } from "../../../../tests/helpers/cli.ts"; diff --git a/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts b/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts index ff80d29bcf..3ee5165362 100644 --- a/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts +++ b/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.integration.test.ts b/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.integration.test.ts index 6660897120..65a0e4a7fc 100644 --- a/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.integration.test.ts +++ b/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.integration.test.ts @@ -2,7 +2,7 @@ import { generateKeyPairSync } from "node:crypto"; import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Path, Schema } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { importJWK, jwtVerify } from "jose"; import { diff --git a/apps/cli/src/commands/gen/gen.command.ts b/apps/cli/src/commands/gen/gen.command.ts index 245640f2b5..108c7673eb 100644 --- a/apps/cli/src/commands/gen/gen.command.ts +++ b/apps/cli/src/commands/gen/gen.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { genTypesCommand } from "./types/types.command.ts"; import { genSigningKeyCommand } from "./signing-key/signing-key.command.ts"; import { genBearerJwtCommand } from "./bearer-jwt/bearer-jwt.command.ts"; diff --git a/apps/cli/src/commands/gen/keys/keys.command.ts b/apps/cli/src/commands/gen/keys/keys.command.ts index 232f8f10e0..80986da5c0 100644 --- a/apps/cli/src/commands/gen/keys/keys.command.ts +++ b/apps/cli/src/commands/gen/keys/keys.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { genKeys } from "./keys.handler.ts"; const config = { diff --git a/apps/cli/src/commands/gen/signing-key/signing-key.command.ts b/apps/cli/src/commands/gen/signing-key/signing-key.command.ts index 383b8d8137..ec30c20dcd 100644 --- a/apps/cli/src/commands/gen/signing-key/signing-key.command.ts +++ b/apps/cli/src/commands/gen/signing-key/signing-key.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/gen/signing-key/signing-key.handler.ts b/apps/cli/src/commands/gen/signing-key/signing-key.handler.ts index be56233efd..eff2b7a0ce 100644 --- a/apps/cli/src/commands/gen/signing-key/signing-key.handler.ts +++ b/apps/cli/src/commands/gen/signing-key/signing-key.handler.ts @@ -1,7 +1,7 @@ import { generateKeyPairSync, randomUUID } from "node:crypto"; import { styleText } from "node:util"; import { Effect, FileSystem, Option, Path, Schema } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { emitSuccessTrailer } from "../../../shared/cli/success-trailer.ts"; diff --git a/apps/cli/src/commands/gen/signing-key/signing-key.integration.test.ts b/apps/cli/src/commands/gen/signing-key/signing-key.integration.test.ts index 3436de11d6..a0539fdd08 100644 --- a/apps/cli/src/commands/gen/signing-key/signing-key.integration.test.ts +++ b/apps/cli/src/commands/gen/signing-key/signing-key.integration.test.ts @@ -13,8 +13,8 @@ import { Sink, Stream, } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { CliOutput, Command } from "effect/cli"; +import { ChildProcessSpawner } from "effect/process"; import { mockAnalytics, diff --git a/apps/cli/src/commands/gen/types/types.command.ts b/apps/cli/src/commands/gen/types/types.command.ts index db87d011f7..c1ff4c1973 100644 --- a/apps/cli/src/commands/gen/types/types.command.ts +++ b/apps/cli/src/commands/gen/types/types.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag, Param } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag, Param } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { parseSchemaFlags } from "../../../command-internal/schema-flags.ts"; diff --git a/apps/cli/src/commands/gen/types/types.generator.layer.ts b/apps/cli/src/commands/gen/types/types.generator.layer.ts index d540245688..02d2eabfff 100644 --- a/apps/cli/src/commands/gen/types/types.generator.layer.ts +++ b/apps/cli/src/commands/gen/types/types.generator.layer.ts @@ -10,7 +10,7 @@ import { type TypegenLanguage, } from "@supabase/typegen"; import { Config, Effect, Layer, Option } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { DbConnection } from "../../../command-internal/db-connection.service.ts"; import { RuntimeInfo } from "../../../shared/runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/commands/gen/types/types.handler.ts b/apps/cli/src/commands/gen/types/types.handler.ts index 53feefe65f..7fafa45aef 100644 --- a/apps/cli/src/commands/gen/types/types.handler.ts +++ b/apps/cli/src/commands/gen/types/types.handler.ts @@ -1,6 +1,6 @@ import type { LoadedCliConfig } from "@supabase/config/effect"; import { loadCliConfig } from "@supabase/config/internal"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { Effect, FileSystem, Option, Path, Stdio, Stream } from "effect"; import { getDomain } from "tldts"; import { DnsResolverFlag } from "../../../command-internal/global-flags.ts"; diff --git a/apps/cli/src/commands/gen/types/types.integration.test.ts b/apps/cli/src/commands/gen/types/types.integration.test.ts index d494a07a5e..64626bbf14 100644 --- a/apps/cli/src/commands/gen/types/types.integration.test.ts +++ b/apps/cli/src/commands/gen/types/types.integration.test.ts @@ -7,10 +7,10 @@ import type { V1GetPoolerConfigOutput, V1GetProjectOutput, } from "@supabase/api/effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { Cause, ConfigProvider, diff --git a/apps/cli/src/commands/gen/types/types.languages.ts b/apps/cli/src/commands/gen/types/types.languages.ts index 77e45da8fd..d4ce509873 100644 --- a/apps/cli/src/commands/gen/types/types.languages.ts +++ b/apps/cli/src/commands/gen/types/types.languages.ts @@ -1,6 +1,6 @@ import { languages, type OptionSpec, type OptionValue, type OptionValues } from "@supabase/typegen"; import { Option } from "effect"; -import { Flag } from "effect/unstable/cli"; +import { Flag } from "effect/cli"; /** A user-facing registry option as one CLI flag, merged across the languages that declare it. */ export interface LanguageFlagSpec { diff --git a/apps/cli/src/commands/gen/types/types.typegen-host.integration.test.ts b/apps/cli/src/commands/gen/types/types.typegen-host.integration.test.ts index 991dedfb47..b7b1b11b3e 100644 --- a/apps/cli/src/commands/gen/types/types.typegen-host.integration.test.ts +++ b/apps/cli/src/commands/gen/types/types.typegen-host.integration.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { makeTypegenHost } from "./types.typegen-host.ts"; describe.skipIf(process.platform === "win32")("makeTypegenHost with the real spawner", () => { diff --git a/apps/cli/src/commands/gen/types/types.typegen-host.ts b/apps/cli/src/commands/gen/types/types.typegen-host.ts index 51e9966a62..4325919d22 100644 --- a/apps/cli/src/commands/gen/types/types.typegen-host.ts +++ b/apps/cli/src/commands/gen/types/types.typegen-host.ts @@ -7,7 +7,7 @@ import { type SpawnResult, } from "@supabase/typegen"; import { Effect, Predicate, Stream } from "effect"; -import { ChildProcess, type ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, type ChildProcessSpawner } from "effect/process"; import { collectText } from "../../../command-internal/container-cli.ts"; import { withProcessSpanScoped } from "../../../shared/telemetry/spans.ts"; diff --git a/apps/cli/src/commands/gen/types/types.typegen-host.unit.test.ts b/apps/cli/src/commands/gen/types/types.typegen-host.unit.test.ts index d40155f741..3dbff497e9 100644 --- a/apps/cli/src/commands/gen/types/types.typegen-host.unit.test.ts +++ b/apps/cli/src/commands/gen/types/types.typegen-host.unit.test.ts @@ -2,7 +2,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import type { SpawnRequest, SpawnResult } from "@supabase/typegen"; import { Data, Deferred, Effect, FileSystem, Path, PlatformError, Sink, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { makeTypegenHost } from "./types.typegen-host.ts"; interface SpawnCall { diff --git a/apps/cli/src/commands/init/init.command.ts b/apps/cli/src/commands/init/init.command.ts index df44722c64..86357469aa 100644 --- a/apps/cli/src/commands/init/init.command.ts +++ b/apps/cli/src/commands/init/init.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; import { cliConfigProviderLayer } from "../../shared/config/cli-config-provider.layer.ts"; import { commandRuntimeLayer } from "../../shared/runtime/command-runtime.layer.ts"; diff --git a/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts b/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts index 97d3344f65..5f45a1e712 100644 --- a/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts +++ b/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbBloat } from "./bloat.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts b/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts index 60c9ce8e59..84af68b454 100644 --- a/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts +++ b/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbBlocking } from "./blocking.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/cache-hit/cache-hit.command.ts b/apps/cli/src/commands/inspect/db/cache-hit/cache-hit.command.ts index 93b050a940..28b5329210 100644 --- a/apps/cli/src/commands/inspect/db/cache-hit/cache-hit.command.ts +++ b/apps/cli/src/commands/inspect/db/cache-hit/cache-hit.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbCacheHit } from "./cache-hit.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/calls/calls.command.ts b/apps/cli/src/commands/inspect/db/calls/calls.command.ts index 376da6b5a4..b5bf7787ae 100644 --- a/apps/cli/src/commands/inspect/db/calls/calls.command.ts +++ b/apps/cli/src/commands/inspect/db/calls/calls.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbCalls } from "./calls.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts b/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts index cd6308c2d6..8f7967deb0 100644 --- a/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbDbStats } from "./db-stats.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/db.command.ts b/apps/cli/src/commands/inspect/db/db.command.ts index d68d765621..e1d1f9a511 100644 --- a/apps/cli/src/commands/inspect/db/db.command.ts +++ b/apps/cli/src/commands/inspect/db/db.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbBloatCommand } from "./bloat/bloat.command.ts"; import { inspectDbBlockingCommand } from "./blocking/blocking.command.ts"; import { inspectDbCallsCommand } from "./calls/calls.command.ts"; diff --git a/apps/cli/src/commands/inspect/db/index-sizes/index-sizes.command.ts b/apps/cli/src/commands/inspect/db/index-sizes/index-sizes.command.ts index 1c21717dbd..b427db6ef1 100644 --- a/apps/cli/src/commands/inspect/db/index-sizes/index-sizes.command.ts +++ b/apps/cli/src/commands/inspect/db/index-sizes/index-sizes.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbIndexSizes } from "./index-sizes.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts b/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts index 6896fe63cd..8f9219122e 100644 --- a/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbIndexStats } from "./index-stats.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/index-usage/index-usage.command.ts b/apps/cli/src/commands/inspect/db/index-usage/index-usage.command.ts index a7de7b8cee..4ca772603d 100644 --- a/apps/cli/src/commands/inspect/db/index-usage/index-usage.command.ts +++ b/apps/cli/src/commands/inspect/db/index-usage/index-usage.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbIndexUsage } from "./index-usage.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/inspect-db-command.ts b/apps/cli/src/commands/inspect/db/inspect-db-command.ts index 068827c405..b61d156a77 100644 --- a/apps/cli/src/commands/inspect/db/inspect-db-command.ts +++ b/apps/cli/src/commands/inspect/db/inspect-db-command.ts @@ -1,5 +1,5 @@ import { Effect } from "effect"; -import { Flag } from "effect/unstable/cli"; +import { Flag } from "effect/cli"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/inspect/db/locks/locks.command.ts b/apps/cli/src/commands/inspect/db/locks/locks.command.ts index 29a86a4c1d..0409ca92c1 100644 --- a/apps/cli/src/commands/inspect/db/locks/locks.command.ts +++ b/apps/cli/src/commands/inspect/db/locks/locks.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbLocks } from "./locks.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts b/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts index 633c7cbcbc..759a13dd57 100644 --- a/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts +++ b/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbLongRunningQueries } from "./long-running-queries.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts b/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts index 5fe394932a..3da925735d 100644 --- a/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts +++ b/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbOutliers } from "./outliers.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts b/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts index 627a7fe445..dae91a37c5 100644 --- a/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts +++ b/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbReplicationSlots } from "./replication-slots.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/role-configs/role-configs.command.ts b/apps/cli/src/commands/inspect/db/role-configs/role-configs.command.ts index e224070b90..08bfb172b3 100644 --- a/apps/cli/src/commands/inspect/db/role-configs/role-configs.command.ts +++ b/apps/cli/src/commands/inspect/db/role-configs/role-configs.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbRoleConfigs } from "./role-configs.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/role-connections/role-connections.command.ts b/apps/cli/src/commands/inspect/db/role-connections/role-connections.command.ts index 2cdbf959ef..5736bf9f1e 100644 --- a/apps/cli/src/commands/inspect/db/role-connections/role-connections.command.ts +++ b/apps/cli/src/commands/inspect/db/role-connections/role-connections.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbRoleConnections } from "./role-connections.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts b/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts index 6a29ea76a3..569a4c3f9d 100644 --- a/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbRoleStats } from "./role-stats.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/seq-scans/seq-scans.command.ts b/apps/cli/src/commands/inspect/db/seq-scans/seq-scans.command.ts index af1c9c4cb1..b940f61b51 100644 --- a/apps/cli/src/commands/inspect/db/seq-scans/seq-scans.command.ts +++ b/apps/cli/src/commands/inspect/db/seq-scans/seq-scans.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbSeqScans } from "./seq-scans.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/table-index-sizes/table-index-sizes.command.ts b/apps/cli/src/commands/inspect/db/table-index-sizes/table-index-sizes.command.ts index c2ed3651dd..5de6d40288 100644 --- a/apps/cli/src/commands/inspect/db/table-index-sizes/table-index-sizes.command.ts +++ b/apps/cli/src/commands/inspect/db/table-index-sizes/table-index-sizes.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbTableIndexSizes } from "./table-index-sizes.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/table-record-counts/table-record-counts.command.ts b/apps/cli/src/commands/inspect/db/table-record-counts/table-record-counts.command.ts index 9c7f3aa7d8..416dde502e 100644 --- a/apps/cli/src/commands/inspect/db/table-record-counts/table-record-counts.command.ts +++ b/apps/cli/src/commands/inspect/db/table-record-counts/table-record-counts.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbTableRecordCounts } from "./table-record-counts.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/table-sizes/table-sizes.command.ts b/apps/cli/src/commands/inspect/db/table-sizes/table-sizes.command.ts index d4a3c17b82..b23475ee2b 100644 --- a/apps/cli/src/commands/inspect/db/table-sizes/table-sizes.command.ts +++ b/apps/cli/src/commands/inspect/db/table-sizes/table-sizes.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbTableSizes } from "./table-sizes.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts b/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts index 5a63618f01..272e0a0637 100644 --- a/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbTableStats } from "./table-stats.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/total-index-size/total-index-size.command.ts b/apps/cli/src/commands/inspect/db/total-index-size/total-index-size.command.ts index ff53600760..7b93bef285 100644 --- a/apps/cli/src/commands/inspect/db/total-index-size/total-index-size.command.ts +++ b/apps/cli/src/commands/inspect/db/total-index-size/total-index-size.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbTotalIndexSize } from "./total-index-size.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/total-table-sizes/total-table-sizes.command.ts b/apps/cli/src/commands/inspect/db/total-table-sizes/total-table-sizes.command.ts index 7d0dd5e644..0b90653b79 100644 --- a/apps/cli/src/commands/inspect/db/total-table-sizes/total-table-sizes.command.ts +++ b/apps/cli/src/commands/inspect/db/total-table-sizes/total-table-sizes.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbTotalTableSizes } from "./total-table-sizes.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts b/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts index 8482a9f6f2..a652d4aeee 100644 --- a/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts +++ b/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbTrafficProfile } from "./traffic-profile.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/unused-indexes/unused-indexes.command.ts b/apps/cli/src/commands/inspect/db/unused-indexes/unused-indexes.command.ts index b7569441e4..329b9a15b8 100644 --- a/apps/cli/src/commands/inspect/db/unused-indexes/unused-indexes.command.ts +++ b/apps/cli/src/commands/inspect/db/unused-indexes/unused-indexes.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbUnusedIndexes } from "./unused-indexes.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts b/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts index 3f8a04a2c0..c48c01f261 100644 --- a/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbVacuumStats } from "./vacuum-stats.handler.ts"; import { INSPECT_DB_FLAGS, inspectDbCommandHandler } from "../inspect-db-command.ts"; import { inspectDbRuntimeLayer } from "../db.layers.ts"; diff --git a/apps/cli/src/commands/inspect/inspect.command.ts b/apps/cli/src/commands/inspect/inspect.command.ts index 28f53c94e3..0005ce9079 100644 --- a/apps/cli/src/commands/inspect/inspect.command.ts +++ b/apps/cli/src/commands/inspect/inspect.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { inspectDbCommand } from "./db/db.command.ts"; import { inspectReportCommand } from "./report/report.command.ts"; diff --git a/apps/cli/src/commands/inspect/report/report.command.ts b/apps/cli/src/commands/inspect/report/report.command.ts index 9e170de825..58f70a3a0c 100644 --- a/apps/cli/src/commands/inspect/report/report.command.ts +++ b/apps/cli/src/commands/inspect/report/report.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; diff --git a/apps/cli/src/commands/issue/issue.command.ts b/apps/cli/src/commands/issue/issue.command.ts index 6b98fa91f4..eb8572e381 100644 --- a/apps/cli/src/commands/issue/issue.command.ts +++ b/apps/cli/src/commands/issue/issue.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { browserLayer } from "../../shared/runtime/browser.layer.ts"; import { commandRuntimeLayer } from "../../shared/runtime/command-runtime.layer.ts"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/link/link.command.ts b/apps/cli/src/commands/link/link.command.ts index 6623b37d60..05c1e9b53f 100644 --- a/apps/cli/src/commands/link/link.command.ts +++ b/apps/cli/src/commands/link/link.command.ts @@ -1,6 +1,6 @@ import { Option } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { PROJECT_REF_PATTERN } from "../../config/project-ref.service.ts"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/link/link.integration.test.ts b/apps/cli/src/commands/link/link.integration.test.ts index 1ce4cae955..3948924d16 100644 --- a/apps/cli/src/commands/link/link.integration.test.ts +++ b/apps/cli/src/commands/link/link.integration.test.ts @@ -2,10 +2,10 @@ import { describe, expect, it } from "@effect/vitest"; import { BunCrypto } from "@effect/platform-bun"; import type { V1ListAllBranchesOutput } from "@supabase/api/effect"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Path, Schema, Stdio } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import type * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequestModule from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import type * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequestModule from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { commandRuntimeLayer } from "../../shared/runtime/command-runtime.layer.ts"; import { diff --git a/apps/cli/src/commands/login/login.command.ts b/apps/cli/src/commands/login/login.command.ts index f58cd968b1..a118bd83a3 100644 --- a/apps/cli/src/commands/login/login.command.ts +++ b/apps/cli/src/commands/login/login.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withCommandTelemetry } from "../../telemetry/command-telemetry.ts"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/login/login.integration.test.ts b/apps/cli/src/commands/login/login.integration.test.ts index 883a783e0c..33551b35fd 100644 --- a/apps/cli/src/commands/login/login.integration.test.ts +++ b/apps/cli/src/commands/login/login.integration.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Path, Redacted } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import * as HttpClient from "effect/http/HttpClient"; import { mockAnalytics, diff --git a/apps/cli/src/commands/logout/logout.command.ts b/apps/cli/src/commands/logout/logout.command.ts index e19e83bb25..970cdfd28a 100644 --- a/apps/cli/src/commands/logout/logout.command.ts +++ b/apps/cli/src/commands/logout/logout.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/migration/down/down.command.ts b/apps/cli/src/commands/migration/down/down.command.ts index 429a515d46..c9a1d486b8 100644 --- a/apps/cli/src/commands/migration/down/down.command.ts +++ b/apps/cli/src/commands/migration/down/down.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/migration/fetch/fetch.command.ts b/apps/cli/src/commands/migration/fetch/fetch.command.ts index eb5212e06f..67b7a69db6 100644 --- a/apps/cli/src/commands/migration/fetch/fetch.command.ts +++ b/apps/cli/src/commands/migration/fetch/fetch.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/migration/list/list.command.ts b/apps/cli/src/commands/migration/list/list.command.ts index ccedb29cbf..04d9a2d459 100644 --- a/apps/cli/src/commands/migration/list/list.command.ts +++ b/apps/cli/src/commands/migration/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/migration/migration.command.ts b/apps/cli/src/commands/migration/migration.command.ts index 414972382e..dbdfaae3a3 100644 --- a/apps/cli/src/commands/migration/migration.command.ts +++ b/apps/cli/src/commands/migration/migration.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { migrationListCommand } from "./list/list.command.ts"; import { migrationNewCommand } from "./new/new.command.ts"; import { migrationRepairCommand } from "./repair/repair.command.ts"; diff --git a/apps/cli/src/commands/migration/migration.integration.test.ts b/apps/cli/src/commands/migration/migration.integration.test.ts index ddc3a8b76c..8ace4998b6 100644 --- a/apps/cli/src/commands/migration/migration.integration.test.ts +++ b/apps/cli/src/commands/migration/migration.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer, Predicate } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; import { GLOBAL_FLAGS } from "../../command-internal/global-flags.ts"; diff --git a/apps/cli/src/commands/migration/new/new.command.ts b/apps/cli/src/commands/migration/new/new.command.ts index 7bb0ce6b56..881b864641 100644 --- a/apps/cli/src/commands/migration/new/new.command.ts +++ b/apps/cli/src/commands/migration/new/new.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/migration/repair/repair.command.ts b/apps/cli/src/commands/migration/repair/repair.command.ts index 4d4473d17c..690ef893c7 100644 --- a/apps/cli/src/commands/migration/repair/repair.command.ts +++ b/apps/cli/src/commands/migration/repair/repair.command.ts @@ -1,4 +1,4 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; +import { Argument, Command, Flag } from "effect/cli"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/migration/squash/squash.command.ts b/apps/cli/src/commands/migration/squash/squash.command.ts index 55ba9638a1..d39f67a739 100644 --- a/apps/cli/src/commands/migration/squash/squash.command.ts +++ b/apps/cli/src/commands/migration/squash/squash.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/migration/squash/squash.handler.ts b/apps/cli/src/commands/migration/squash/squash.handler.ts index 3005397104..3021a67b48 100644 --- a/apps/cli/src/commands/migration/squash/squash.handler.ts +++ b/apps/cli/src/commands/migration/squash/squash.handler.ts @@ -1,6 +1,6 @@ import { Effect, FileSystem, Option, Path } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerType } from "effect/unstable/process/ChildProcessSpawner"; +import { ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerType } from "effect/process/ChildProcessSpawner"; import { cobraMutuallyExclusiveErrorMessage } from "../../../shared/cli/cobra-flag-groups.ts"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; diff --git a/apps/cli/src/commands/migration/squash/squash.integration.test.ts b/apps/cli/src/commands/migration/squash/squash.integration.test.ts index 64969f7aed..69ca245520 100644 --- a/apps/cli/src/commands/migration/squash/squash.integration.test.ts +++ b/apps/cli/src/commands/migration/squash/squash.integration.test.ts @@ -13,8 +13,8 @@ import { Path, } from "effect"; import { PlatformError, SystemError } from "effect/PlatformError"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { stripAnsi } from "../../../../tests/helpers/ansi.ts"; import { diff --git a/apps/cli/src/commands/migration/squash/squash.native.integration.test.ts b/apps/cli/src/commands/migration/squash/squash.native.integration.test.ts index 88ebe11339..6edd2c6a3a 100644 --- a/apps/cli/src/commands/migration/squash/squash.native.integration.test.ts +++ b/apps/cli/src/commands/migration/squash/squash.native.integration.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Path } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { mockCommandSettings, diff --git a/apps/cli/src/commands/migration/up/up.command.ts b/apps/cli/src/commands/migration/up/up.command.ts index 380a33841a..ec18b25194 100644 --- a/apps/cli/src/commands/migration/up/up.command.ts +++ b/apps/cli/src/commands/migration/up/up.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/network-bans/get/get.command.ts b/apps/cli/src/commands/network-bans/get/get.command.ts index 568b55d67a..9a27ed899a 100644 --- a/apps/cli/src/commands/network-bans/get/get.command.ts +++ b/apps/cli/src/commands/network-bans/get/get.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/network-bans/network-bans.command.ts b/apps/cli/src/commands/network-bans/network-bans.command.ts index 5164748031..8a6f614948 100644 --- a/apps/cli/src/commands/network-bans/network-bans.command.ts +++ b/apps/cli/src/commands/network-bans/network-bans.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { networkBansGetCommand } from "./get/get.command.ts"; import { networkBansRemoveCommand } from "./remove/remove.command.ts"; diff --git a/apps/cli/src/commands/network-bans/network-bans.experimental-gate.integration.test.ts b/apps/cli/src/commands/network-bans/network-bans.experimental-gate.integration.test.ts index cf3f664712..44280a8d03 100644 --- a/apps/cli/src/commands/network-bans/network-bans.experimental-gate.integration.test.ts +++ b/apps/cli/src/commands/network-bans/network-bans.experimental-gate.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { normalizeCause } from "../../shared/output/normalize-error.ts"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/network-bans/remove/remove.command.ts b/apps/cli/src/commands/network-bans/remove/remove.command.ts index d83a2c91f4..2e9b0ea441 100644 --- a/apps/cli/src/commands/network-bans/remove/remove.command.ts +++ b/apps/cli/src/commands/network-bans/remove/remove.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/network-restrictions/get/get.command.ts b/apps/cli/src/commands/network-restrictions/get/get.command.ts index bd6cb47544..15c89a6039 100644 --- a/apps/cli/src/commands/network-restrictions/get/get.command.ts +++ b/apps/cli/src/commands/network-restrictions/get/get.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts b/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts index 8eb788a197..e428dc290b 100644 --- a/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts +++ b/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { networkRestrictionsGetCommand } from "./get/get.command.ts"; import { networkRestrictionsUpdateCommand } from "./update/update.command.ts"; diff --git a/apps/cli/src/commands/network-restrictions/network-restrictions.experimental-gate.integration.test.ts b/apps/cli/src/commands/network-restrictions/network-restrictions.experimental-gate.integration.test.ts index fabfda57b0..0652051684 100644 --- a/apps/cli/src/commands/network-restrictions/network-restrictions.experimental-gate.integration.test.ts +++ b/apps/cli/src/commands/network-restrictions/network-restrictions.experimental-gate.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { normalizeCause } from "../../shared/output/normalize-error.ts"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/network-restrictions/update/update.command.ts b/apps/cli/src/commands/network-restrictions/update/update.command.ts index d747103403..8ec3b4543c 100644 --- a/apps/cli/src/commands/network-restrictions/update/update.command.ts +++ b/apps/cli/src/commands/network-restrictions/update/update.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/notebooks/notebooks.command.ts b/apps/cli/src/commands/notebooks/notebooks.command.ts index 1730291f17..c2b7db8603 100644 --- a/apps/cli/src/commands/notebooks/notebooks.command.ts +++ b/apps/cli/src/commands/notebooks/notebooks.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { notebooksPullCommand } from "./pull/pull.command.ts"; import { notebooksPushCommand } from "./push/push.command.ts"; diff --git a/apps/cli/src/commands/notebooks/pull/pull.command.ts b/apps/cli/src/commands/notebooks/pull/pull.command.ts index 90accb45cd..7dd1617cbd 100644 --- a/apps/cli/src/commands/notebooks/pull/pull.command.ts +++ b/apps/cli/src/commands/notebooks/pull/pull.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/notebooks/push/push.command.ts b/apps/cli/src/commands/notebooks/push/push.command.ts index 3348c0610b..8a4a2b493c 100644 --- a/apps/cli/src/commands/notebooks/push/push.command.ts +++ b/apps/cli/src/commands/notebooks/push/push.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/orgs/create/create.command.ts b/apps/cli/src/commands/orgs/create/create.command.ts index f151a7dfd0..99f44946ad 100644 --- a/apps/cli/src/commands/orgs/create/create.command.ts +++ b/apps/cli/src/commands/orgs/create/create.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/orgs/list/list.command.ts b/apps/cli/src/commands/orgs/list/list.command.ts index bb9847ba3e..8c8cf207f8 100644 --- a/apps/cli/src/commands/orgs/list/list.command.ts +++ b/apps/cli/src/commands/orgs/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/orgs/orgs.command.ts b/apps/cli/src/commands/orgs/orgs.command.ts index 07d019058f..204cdbe5f4 100644 --- a/apps/cli/src/commands/orgs/orgs.command.ts +++ b/apps/cli/src/commands/orgs/orgs.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { orgsCreateCommand } from "./create/create.command.ts"; import { orgsListCommand } from "./list/list.command.ts"; diff --git a/apps/cli/src/commands/postgres-config/delete/delete.command.ts b/apps/cli/src/commands/postgres-config/delete/delete.command.ts index de55984cf7..d0bba5b321 100644 --- a/apps/cli/src/commands/postgres-config/delete/delete.command.ts +++ b/apps/cli/src/commands/postgres-config/delete/delete.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/postgres-config/get/get.command.ts b/apps/cli/src/commands/postgres-config/get/get.command.ts index 28d30092d7..0b8b3b59c1 100644 --- a/apps/cli/src/commands/postgres-config/get/get.command.ts +++ b/apps/cli/src/commands/postgres-config/get/get.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/postgres-config/postgres-config.command.ts b/apps/cli/src/commands/postgres-config/postgres-config.command.ts index 2f9f3e7324..946a4a8cdd 100644 --- a/apps/cli/src/commands/postgres-config/postgres-config.command.ts +++ b/apps/cli/src/commands/postgres-config/postgres-config.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { postgresConfigDeleteCommand } from "./delete/delete.command.ts"; import { postgresConfigGetCommand } from "./get/get.command.ts"; import { postgresConfigUpdateCommand } from "./update/update.command.ts"; diff --git a/apps/cli/src/commands/postgres-config/postgres-config.experimental-gate.integration.test.ts b/apps/cli/src/commands/postgres-config/postgres-config.experimental-gate.integration.test.ts index 0b5b214aca..3ce7293774 100644 --- a/apps/cli/src/commands/postgres-config/postgres-config.experimental-gate.integration.test.ts +++ b/apps/cli/src/commands/postgres-config/postgres-config.experimental-gate.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { normalizeCause } from "../../shared/output/normalize-error.ts"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/postgres-config/postgres-config.shared.ts b/apps/cli/src/commands/postgres-config/postgres-config.shared.ts index 3e1fc73e3e..00d10e9791 100644 --- a/apps/cli/src/commands/postgres-config/postgres-config.shared.ts +++ b/apps/cli/src/commands/postgres-config/postgres-config.shared.ts @@ -1,7 +1,7 @@ import { Effect, Option, Schema } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../../config/command-settings.service.ts"; import { OutputFlag } from "../../command-internal/global-flags.ts"; diff --git a/apps/cli/src/commands/postgres-config/update/update.command.ts b/apps/cli/src/commands/postgres-config/update/update.command.ts index 72fce371eb..37bafae8fb 100644 --- a/apps/cli/src/commands/postgres-config/update/update.command.ts +++ b/apps/cli/src/commands/postgres-config/update/update.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/projects/api-keys/api-keys.command.ts b/apps/cli/src/commands/projects/api-keys/api-keys.command.ts index 43d2ea5de3..b165c4f975 100644 --- a/apps/cli/src/commands/projects/api-keys/api-keys.command.ts +++ b/apps/cli/src/commands/projects/api-keys/api-keys.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/projects/create/create.command.ts b/apps/cli/src/commands/projects/create/create.command.ts index 511f591635..a8a19b6820 100644 --- a/apps/cli/src/commands/projects/create/create.command.ts +++ b/apps/cli/src/commands/projects/create/create.command.ts @@ -1,6 +1,6 @@ import { V1CreateAProjectInput } from "@supabase/api/effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/projects/create/create.integration.test.ts b/apps/cli/src/commands/projects/create/create.integration.test.ts index 8acbb041c8..52e7e06e59 100644 --- a/apps/cli/src/commands/projects/create/create.integration.test.ts +++ b/apps/cli/src/commands/projects/create/create.integration.test.ts @@ -1,7 +1,7 @@ import type { OrganizationResponseV1_Output, V1CreateAProjectOutput } from "@supabase/api/effect"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer, Option, Schema } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { mockOutput, mockTelemetryRuntime, mockTty } from "../../../../tests/helpers/mocks.ts"; import { GLOBAL_FLAGS, ExperimentalFlag } from "../../../command-internal/global-flags.ts"; diff --git a/apps/cli/src/commands/projects/delete/delete.command.ts b/apps/cli/src/commands/projects/delete/delete.command.ts index ca4085a422..a2a6cb7690 100644 --- a/apps/cli/src/commands/projects/delete/delete.command.ts +++ b/apps/cli/src/commands/projects/delete/delete.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Argument, Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { stdinLayer } from "../../../shared/runtime/stdin.layer.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/projects/delete/delete.handler.ts b/apps/cli/src/commands/projects/delete/delete.handler.ts index f6292a615e..730560e8bc 100644 --- a/apps/cli/src/commands/projects/delete/delete.handler.ts +++ b/apps/cli/src/commands/projects/delete/delete.handler.ts @@ -1,6 +1,6 @@ import type { V1DeleteAProjectOutput } from "@supabase/api/effect"; import { Effect, FileSystem, Option, Path } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpClientError from "effect/http/HttpClientError"; import { CommandPlatformApi } from "../../../auth/command-platform-api.service.ts"; import { CommandSettings } from "../../../config/command-settings.service.ts"; diff --git a/apps/cli/src/commands/projects/list/list.command.ts b/apps/cli/src/commands/projects/list/list.command.ts index 2f6e89313d..c8395b618c 100644 --- a/apps/cli/src/commands/projects/list/list.command.ts +++ b/apps/cli/src/commands/projects/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/projects/projects.command.ts b/apps/cli/src/commands/projects/projects.command.ts index afc47b196d..9604c227a4 100644 --- a/apps/cli/src/commands/projects/projects.command.ts +++ b/apps/cli/src/commands/projects/projects.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { projectsListCommand } from "./list/list.command.ts"; import { projectsCreateCommand } from "./create/create.command.ts"; import { projectsApiKeysCommand } from "./api-keys/api-keys.command.ts"; diff --git a/apps/cli/src/commands/pull/pull.command.ts b/apps/cli/src/commands/pull/pull.command.ts index 21880b7ee5..8bb5e1c261 100644 --- a/apps/cli/src/commands/pull/pull.command.ts +++ b/apps/cli/src/commands/pull/pull.command.ts @@ -1,6 +1,6 @@ import { Option } from "effect"; -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Command, Flag } from "effect/cli"; import { PROJECT_REF_PATTERN } from "../../config/project-ref.service.ts"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/pull/pull.integration.test.ts b/apps/cli/src/commands/pull/pull.integration.test.ts index f3eba9ba8c..8cdde2e272 100644 --- a/apps/cli/src/commands/pull/pull.integration.test.ts +++ b/apps/cli/src/commands/pull/pull.integration.test.ts @@ -14,8 +14,8 @@ import { Stdio, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { v2ProjectConfigResponse } from "../../../tests/helpers/config-fixtures.ts"; import { diff --git a/apps/cli/src/commands/pull/pull.layers.ts b/apps/cli/src/commands/pull/pull.layers.ts index 38a0db9610..06ef3a1543 100644 --- a/apps/cli/src/commands/pull/pull.layers.ts +++ b/apps/cli/src/commands/pull/pull.layers.ts @@ -1,5 +1,5 @@ import { Layer } from "effect"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; +import type * as HttpClient from "effect/http/HttpClient"; import { CommandCredentials } from "../../auth/command-credentials.service.ts"; import { CommandPlatformApi } from "../../auth/command-platform-api.service.ts"; diff --git a/apps/cli/src/commands/secrets/list/list.command.ts b/apps/cli/src/commands/secrets/list/list.command.ts index 3d7eb994fb..557261455f 100644 --- a/apps/cli/src/commands/secrets/list/list.command.ts +++ b/apps/cli/src/commands/secrets/list/list.command.ts @@ -1,5 +1,5 @@ -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Command, Flag } from "effect/cli"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/secrets/secrets.command.ts b/apps/cli/src/commands/secrets/secrets.command.ts index b59b5cd88d..f30cd13cbd 100644 --- a/apps/cli/src/commands/secrets/secrets.command.ts +++ b/apps/cli/src/commands/secrets/secrets.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { secretsListCommand } from "./list/list.command.ts"; import { secretsSetCommand } from "./set/set.command.ts"; import { secretsUnsetCommand } from "./unset/unset.command.ts"; diff --git a/apps/cli/src/commands/secrets/set/set.command.ts b/apps/cli/src/commands/secrets/set/set.command.ts index 18969c95c7..c78461118e 100644 --- a/apps/cli/src/commands/secrets/set/set.command.ts +++ b/apps/cli/src/commands/secrets/set/set.command.ts @@ -1,5 +1,5 @@ -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Argument, Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/secrets/unset/unset.command.ts b/apps/cli/src/commands/secrets/unset/unset.command.ts index bafcb73196..955baf0d3c 100644 --- a/apps/cli/src/commands/secrets/unset/unset.command.ts +++ b/apps/cli/src/commands/secrets/unset/unset.command.ts @@ -1,5 +1,5 @@ -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Argument, Command, Flag } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; import { Layer } from "effect"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/seed/buckets/buckets.command.ts b/apps/cli/src/commands/seed/buckets/buckets.command.ts index 5e502ac9b8..f3c229523c 100644 --- a/apps/cli/src/commands/seed/buckets/buckets.command.ts +++ b/apps/cli/src/commands/seed/buckets/buckets.command.ts @@ -1,5 +1,5 @@ import { Effect, Layer, type Option } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; +import { Command, Flag } from "effect/cli"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/seed/buckets/buckets.integration.test.ts b/apps/cli/src/commands/seed/buckets/buckets.integration.test.ts index d1dd7650f2..6a28fa2629 100644 --- a/apps/cli/src/commands/seed/buckets/buckets.integration.test.ts +++ b/apps/cli/src/commands/seed/buckets/buckets.integration.test.ts @@ -2,9 +2,9 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { loadCliConfig } from "@supabase/config/internal"; import { Cause, ConfigProvider, Effect, Exit, FileSystem, Layer, Option, Path } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import type * as HttpClientError from "effect/unstable/http/HttpClientError"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import * as HttpClient from "effect/http/HttpClient"; +import type * as HttpClientError from "effect/http/HttpClientError"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { mockOutput, mockStdin, mockTty } from "../../../../tests/helpers/mocks.ts"; import { diff --git a/apps/cli/src/commands/seed/seed.command.ts b/apps/cli/src/commands/seed/seed.command.ts index 345a25fe5a..4b35815c4c 100644 --- a/apps/cli/src/commands/seed/seed.command.ts +++ b/apps/cli/src/commands/seed/seed.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { bucketsCommand } from "./buckets/buckets.command.ts"; import { SeedLinkedFlag, SeedLocalFlag } from "./seed.flags.ts"; diff --git a/apps/cli/src/commands/seed/seed.flags.ts b/apps/cli/src/commands/seed/seed.flags.ts index 2888ec211a..38297ea804 100644 --- a/apps/cli/src/commands/seed/seed.flags.ts +++ b/apps/cli/src/commands/seed/seed.flags.ts @@ -1,4 +1,4 @@ -import { Flag, GlobalFlag } from "effect/unstable/cli"; +import { Flag, GlobalFlag } from "effect/cli"; /** * `--linked` / `--local` are scoped global flags on the `seed` group, so both diff --git a/apps/cli/src/commands/services/services.command.ts b/apps/cli/src/commands/services/services.command.ts index 2f93cd39c0..7a2d664905 100644 --- a/apps/cli/src/commands/services/services.command.ts +++ b/apps/cli/src/commands/services/services.command.ts @@ -1,7 +1,7 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; import { withCommandTelemetry } from "../../telemetry/command-telemetry.ts"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import type * as CliCommand from "effect/cli/Command"; import { services } from "./services.handler.ts"; import { servicesRuntimeLayer } from "./services.layers.ts"; diff --git a/apps/cli/src/commands/services/services.integration.test.ts b/apps/cli/src/commands/services/services.integration.test.ts index 1cdebc41ca..9d2d086e52 100644 --- a/apps/cli/src/commands/services/services.integration.test.ts +++ b/apps/cli/src/commands/services/services.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { catalogPins } from "@supabase/stack/internal/artifacts"; import { BunServices } from "@effect/platform-bun"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { Cause, Data, @@ -17,7 +17,7 @@ import { Schema, Stdio, } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { CommandCredentials } from "../../auth/command-credentials.service.ts"; import { CommandSettings } from "../../config/command-settings.service.ts"; import { INVALID_PROJECT_REF_MESSAGE } from "../../config/project-ref.service.ts"; diff --git a/apps/cli/src/commands/services/services.layers.ts b/apps/cli/src/commands/services/services.layers.ts index 4f9d79dbf9..4476820124 100644 --- a/apps/cli/src/commands/services/services.layers.ts +++ b/apps/cli/src/commands/services/services.layers.ts @@ -1,6 +1,6 @@ -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { Layer } from "effect"; -import type * as HttpClient from "effect/unstable/http/HttpClient"; +import type * as HttpClient from "effect/http/HttpClient"; import { commandCredentialsLayer } from "../../auth/command-credentials.layer.ts"; import { CommandCredentials } from "../../auth/command-credentials.service.ts"; diff --git a/apps/cli/src/commands/snippets/download/download.command.ts b/apps/cli/src/commands/snippets/download/download.command.ts index 2f1bac1fa0..2c85503509 100644 --- a/apps/cli/src/commands/snippets/download/download.command.ts +++ b/apps/cli/src/commands/snippets/download/download.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/snippets/download/download.handler.ts b/apps/cli/src/commands/snippets/download/download.handler.ts index 9d1b3233e7..248644a045 100644 --- a/apps/cli/src/commands/snippets/download/download.handler.ts +++ b/apps/cli/src/commands/snippets/download/download.handler.ts @@ -1,6 +1,6 @@ import { Effect, Option } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { ProjectRefResolver } from "../../../config/project-ref.service.ts"; diff --git a/apps/cli/src/commands/snippets/list/list.command.ts b/apps/cli/src/commands/snippets/list/list.command.ts index 3b1c92b01a..3a7d632c87 100644 --- a/apps/cli/src/commands/snippets/list/list.command.ts +++ b/apps/cli/src/commands/snippets/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/snippets/list/list.handler.ts b/apps/cli/src/commands/snippets/list/list.handler.ts index 0f56049338..f1459bf847 100644 --- a/apps/cli/src/commands/snippets/list/list.handler.ts +++ b/apps/cli/src/commands/snippets/list/list.handler.ts @@ -1,6 +1,6 @@ import { Effect, Option } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { ProjectRefResolver } from "../../../config/project-ref.service.ts"; diff --git a/apps/cli/src/commands/snippets/snippets.command.ts b/apps/cli/src/commands/snippets/snippets.command.ts index 9002b79cb4..67ee9b3421 100644 --- a/apps/cli/src/commands/snippets/snippets.command.ts +++ b/apps/cli/src/commands/snippets/snippets.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { snippetsListCommand } from "./list/list.command.ts"; import { snippetsDownloadCommand } from "./download/download.command.ts"; diff --git a/apps/cli/src/commands/ssl-enforcement/get/get.command.ts b/apps/cli/src/commands/ssl-enforcement/get/get.command.ts index 58e516c8fd..1dc6519d18 100644 --- a/apps/cli/src/commands/ssl-enforcement/get/get.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/get/get.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts b/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts index 2434ca4179..cecc2b9e35 100644 --- a/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { sslEnforcementGetCommand } from "./get/get.command.ts"; import { sslEnforcementUpdateCommand } from "./update/update.command.ts"; diff --git a/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.experimental-gate.integration.test.ts b/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.experimental-gate.integration.test.ts index 5af6fba114..ef14d08159 100644 --- a/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.experimental-gate.integration.test.ts +++ b/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.experimental-gate.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; import { ExperimentalRequiredError } from "../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/ssl-enforcement/update/update.command.ts b/apps/cli/src/commands/ssl-enforcement/update/update.command.ts index d1270bedc0..39d693dde7 100644 --- a/apps/cli/src/commands/ssl-enforcement/update/update.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/update/update.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/sso/add/add.command.ts b/apps/cli/src/commands/sso/add/add.command.ts index e145f0bdc8..d407a9c97d 100644 --- a/apps/cli/src/commands/sso/add/add.command.ts +++ b/apps/cli/src/commands/sso/add/add.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/sso/add/add.handler.ts b/apps/cli/src/commands/sso/add/add.handler.ts index 3d7674777c..1456891779 100644 --- a/apps/cli/src/commands/sso/add/add.handler.ts +++ b/apps/cli/src/commands/sso/add/add.handler.ts @@ -1,6 +1,6 @@ import { Effect, Option, Redacted, Result, Stdio } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandSettings } from "../../../config/command-settings.service.ts"; import { ProjectRefResolver } from "../../../config/project-ref.service.ts"; diff --git a/apps/cli/src/commands/sso/add/add.integration.test.ts b/apps/cli/src/commands/sso/add/add.integration.test.ts index 0d93aa76a1..279b8d053d 100644 --- a/apps/cli/src/commands/sso/add/add.integration.test.ts +++ b/apps/cli/src/commands/sso/add/add.integration.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Path, Predicate, Stdio } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { withEnvVar } from "../../../../tests/helpers/command-mocks.ts"; import { mockAnalytics, mockOutput } from "../../../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/commands/sso/info/info.command.ts b/apps/cli/src/commands/sso/info/info.command.ts index 2e686cc11b..82049dd5de 100644 --- a/apps/cli/src/commands/sso/info/info.command.ts +++ b/apps/cli/src/commands/sso/info/info.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/sso/list/list.command.ts b/apps/cli/src/commands/sso/list/list.command.ts index 0716afe712..e84f799969 100644 --- a/apps/cli/src/commands/sso/list/list.command.ts +++ b/apps/cli/src/commands/sso/list/list.command.ts @@ -1,5 +1,5 @@ -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/sso/list/list.integration.test.ts b/apps/cli/src/commands/sso/list/list.integration.test.ts index 85167c7f63..fa547044be 100644 --- a/apps/cli/src/commands/sso/list/list.integration.test.ts +++ b/apps/cli/src/commands/sso/list/list.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Option, Schema } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockAnalytics, mockOutput } from "../../../../tests/helpers/mocks.ts"; import { diff --git a/apps/cli/src/commands/sso/remove/remove.command.ts b/apps/cli/src/commands/sso/remove/remove.command.ts index 734fd18146..81e3e5e040 100644 --- a/apps/cli/src/commands/sso/remove/remove.command.ts +++ b/apps/cli/src/commands/sso/remove/remove.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/sso/remove/remove.integration.test.ts b/apps/cli/src/commands/sso/remove/remove.integration.test.ts index 2f168ff964..822ebde999 100644 --- a/apps/cli/src/commands/sso/remove/remove.integration.test.ts +++ b/apps/cli/src/commands/sso/remove/remove.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Option } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockAnalytics, mockOutput } from "../../../../tests/helpers/mocks.ts"; import { diff --git a/apps/cli/src/commands/sso/show/show.command.ts b/apps/cli/src/commands/sso/show/show.command.ts index 5b75a5f8ff..2752bc282a 100644 --- a/apps/cli/src/commands/sso/show/show.command.ts +++ b/apps/cli/src/commands/sso/show/show.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/sso/sso.command.ts b/apps/cli/src/commands/sso/sso.command.ts index fecb743f97..746faabbf2 100644 --- a/apps/cli/src/commands/sso/sso.command.ts +++ b/apps/cli/src/commands/sso/sso.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { ssoAddCommand } from "./add/add.command.ts"; import { ssoInfoCommand } from "./info/info.command.ts"; import { ssoListCommand } from "./list/list.command.ts"; diff --git a/apps/cli/src/commands/sso/sso.metadata-url.ts b/apps/cli/src/commands/sso/sso.metadata-url.ts index 0675df5b7e..e5a925109e 100644 --- a/apps/cli/src/commands/sso/sso.metadata-url.ts +++ b/apps/cli/src/commands/sso/sso.metadata-url.ts @@ -1,7 +1,7 @@ import { Duration, Effect } from "effect"; -import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as FetchHttpClient from "effect/http/FetchHttpClient"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { quoteSsoString } from "./sso.format.ts"; import { diff --git a/apps/cli/src/commands/sso/sso.string-slice-flags.integration.test.ts b/apps/cli/src/commands/sso/sso.string-slice-flags.integration.test.ts index 75d0c76844..023b15e7b2 100644 --- a/apps/cli/src/commands/sso/sso.string-slice-flags.integration.test.ts +++ b/apps/cli/src/commands/sso/sso.string-slice-flags.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer, Predicate } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { normalizeCause } from "../../shared/output/normalize-error.ts"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/sso/update/update.command.ts b/apps/cli/src/commands/sso/update/update.command.ts index eab6c0a3cc..4ece232c5f 100644 --- a/apps/cli/src/commands/sso/update/update.command.ts +++ b/apps/cli/src/commands/sso/update/update.command.ts @@ -1,5 +1,5 @@ -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { managementApiRuntimeLayer } from "../../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/commands/sso/update/update.handler.ts b/apps/cli/src/commands/sso/update/update.handler.ts index 3f32371153..4751cfa2df 100644 --- a/apps/cli/src/commands/sso/update/update.handler.ts +++ b/apps/cli/src/commands/sso/update/update.handler.ts @@ -1,7 +1,7 @@ import type { SupabaseApiError } from "@supabase/api/effect"; import { Effect, Option, Redacted, Result, Stdio } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandPlatformApi } from "../../../auth/command-platform-api.service.ts"; import { CommandSettings } from "../../../config/command-settings.service.ts"; diff --git a/apps/cli/src/commands/sso/update/update.integration.test.ts b/apps/cli/src/commands/sso/update/update.integration.test.ts index c3ae3f85c1..aae64fab5a 100644 --- a/apps/cli/src/commands/sso/update/update.integration.test.ts +++ b/apps/cli/src/commands/sso/update/update.integration.test.ts @@ -13,7 +13,7 @@ import { Redacted, Stdio, } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { withEnvVar } from "../../../../tests/helpers/command-mocks.ts"; import { mockAnalytics, mockOutput, mockRuntimeInfo } from "../../../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/commands/start/services/edge-runtime.service.integration.test.ts b/apps/cli/src/commands/start/services/edge-runtime.service.integration.test.ts index d82f1cbe02..439b23f9d0 100644 --- a/apps/cli/src/commands/start/services/edge-runtime.service.integration.test.ts +++ b/apps/cli/src/commands/start/services/edge-runtime.service.integration.test.ts @@ -4,7 +4,7 @@ import { expect, layer } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { edgeRuntimeNofileUlimit } from "../../../shared/stack-constants.ts"; import { ConfigProvider, Deferred, Effect, Exit, Sink, Stream } from "effect"; -import { type ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { type ChildProcess, ChildProcessSpawner } from "effect/process"; import { afterEach, beforeEach, vi } from "vitest"; import { useTempWorkdir } from "../../../../tests/helpers/command-mocks.ts"; diff --git a/apps/cli/src/commands/start/services/vector.service.ts b/apps/cli/src/commands/start/services/vector.service.ts index a04c710670..3fc411576b 100644 --- a/apps/cli/src/commands/start/services/vector.service.ts +++ b/apps/cli/src/commands/start/services/vector.service.ts @@ -10,8 +10,8 @@ */ import { Effect, Stream } from "effect"; -import * as ChildProcess from "effect/unstable/process/ChildProcess"; -import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"; +import * as ChildProcess from "effect/process/ChildProcess"; +import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; import type { StartContainerSpec } from "../../../command-internal/db-bootstrap/docker-create-args.ts"; import { diff --git a/apps/cli/src/commands/start/services/vector.service.unit.test.ts b/apps/cli/src/commands/start/services/vector.service.unit.test.ts index 10c149fc10..f13f253707 100644 --- a/apps/cli/src/commands/start/services/vector.service.unit.test.ts +++ b/apps/cli/src/commands/start/services/vector.service.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, test } from "@effect/vitest"; import { Deferred, Effect, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { buildVectorContainerSpec, diff --git a/apps/cli/src/commands/start/start.command.ts b/apps/cli/src/commands/start/start.command.ts index 184970f1ca..8d1f8344b4 100644 --- a/apps/cli/src/commands/start/start.command.ts +++ b/apps/cli/src/commands/start/start.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { commandRuntimeLayer } from "../../shared/runtime/command-runtime.layer.ts"; import { stdinLayer } from "../../shared/runtime/stdin.layer.ts"; diff --git a/apps/cli/src/commands/start/start.handler.ts b/apps/cli/src/commands/start/start.handler.ts index 20d6842ab5..48433170fa 100644 --- a/apps/cli/src/commands/start/start.handler.ts +++ b/apps/cli/src/commands/start/start.handler.ts @@ -6,8 +6,8 @@ import { BunPath } from "@effect/platform-bun"; import { inferFunctionsManifest } from "@supabase/config/effect"; import { resolveCliConfigSubtree } from "@supabase/config/internal"; import { Effect, FileSystem, Option, Path, Result } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { FetchHttpClient } from "effect/http"; +import { ChildProcessSpawner } from "effect/process"; import { CLI_VERSION } from "../../shared/cli/version.ts"; import { rawFunctionConfigRecord } from "../../shared/functions/deploy.ts"; diff --git a/apps/cli/src/commands/start/start.integration.test.ts b/apps/cli/src/commands/start/start.integration.test.ts index 208203cb30..4c03040bb1 100644 --- a/apps/cli/src/commands/start/start.integration.test.ts +++ b/apps/cli/src/commands/start/start.integration.test.ts @@ -16,9 +16,9 @@ import { Sink, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { vi } from "vitest"; import { diff --git a/apps/cli/src/commands/start/start.slim-images.e2e.test.ts b/apps/cli/src/commands/start/start.slim-images.e2e.test.ts index 86419c7502..abbab43aac 100644 --- a/apps/cli/src/commands/start/start.slim-images.e2e.test.ts +++ b/apps/cli/src/commands/start/start.slim-images.e2e.test.ts @@ -1,4 +1,4 @@ -import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/http"; import { BunServices } from "@effect/platform-bun"; import { Clock, Data, Effect, FileSystem, Layer, Path, Schema } from "effect"; import { beforeAll, describe, expect, it } from "@effect/vitest"; diff --git a/apps/cli/src/commands/start/start.string-slice-flags.integration.test.ts b/apps/cli/src/commands/start/start.string-slice-flags.integration.test.ts index b44e722b95..4942eb3cf1 100644 --- a/apps/cli/src/commands/start/start.string-slice-flags.integration.test.ts +++ b/apps/cli/src/commands/start/start.string-slice-flags.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { normalizeCause } from "../../shared/output/normalize-error.ts"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/status/status.command.ts b/apps/cli/src/commands/status/status.command.ts index 0652cc861d..18bf56ae29 100644 --- a/apps/cli/src/commands/status/status.command.ts +++ b/apps/cli/src/commands/status/status.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { commandCredentialsLayer } from "../../auth/command-credentials.layer.ts"; import { commandPlatformApiFactoryLayer } from "../../auth/command-platform-api-factory.layer.ts"; diff --git a/apps/cli/src/commands/status/status.handler.ts b/apps/cli/src/commands/status/status.handler.ts index e2da29c5aa..aedb4812a3 100644 --- a/apps/cli/src/commands/status/status.handler.ts +++ b/apps/cli/src/commands/status/status.handler.ts @@ -1,4 +1,4 @@ -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { Effect, FileSystem, Option } from "effect"; import { CommandSettings } from "../../config/command-settings.service.ts"; diff --git a/apps/cli/src/commands/status/status.integration.test.ts b/apps/cli/src/commands/status/status.integration.test.ts index c6fb090829..c9f3f20f05 100644 --- a/apps/cli/src/commands/status/status.integration.test.ts +++ b/apps/cli/src/commands/status/status.integration.test.ts @@ -18,9 +18,9 @@ import { Stdio, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import type * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequestModule from "effect/unstable/http/HttpClientRequest"; +import { ChildProcessSpawner } from "effect/process"; +import type * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequestModule from "effect/http/HttpClientRequest"; import { vi } from "vitest"; import { mockOutput, mockProcessControl } from "../../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/commands/status/status.string-slice-flags.integration.test.ts b/apps/cli/src/commands/status/status.string-slice-flags.integration.test.ts index a34e0415a4..e15ee76dd2 100644 --- a/apps/cli/src/commands/status/status.string-slice-flags.integration.test.ts +++ b/apps/cli/src/commands/status/status.string-slice-flags.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { normalizeCause } from "../../shared/output/normalize-error.ts"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/stop/stop.command.ts b/apps/cli/src/commands/stop/stop.command.ts index 311062eeb3..cddf20fdfc 100644 --- a/apps/cli/src/commands/stop/stop.command.ts +++ b/apps/cli/src/commands/stop/stop.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { commandRuntimeLayer } from "../../shared/runtime/command-runtime.layer.ts"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/stop/stop.e2e.test.ts b/apps/cli/src/commands/stop/stop.e2e.test.ts index 137f3c4545..74276679e7 100644 --- a/apps/cli/src/commands/stop/stop.e2e.test.ts +++ b/apps/cli/src/commands/stop/stop.e2e.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Data, Effect, Path, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { makeTempCliStackProject, diff --git a/apps/cli/src/commands/stop/stop.handler.ts b/apps/cli/src/commands/stop/stop.handler.ts index 5a44798e21..0fa66dd17c 100644 --- a/apps/cli/src/commands/stop/stop.handler.ts +++ b/apps/cli/src/commands/stop/stop.handler.ts @@ -1,5 +1,5 @@ import { Effect, FileSystem, Option } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { emitSuccessTrailer } from "../../shared/cli/success-trailer.ts"; import { Output } from "../../shared/output/output.service.ts"; diff --git a/apps/cli/src/commands/stop/stop.integration.test.ts b/apps/cli/src/commands/stop/stop.integration.test.ts index 1e63e8cec6..099aaca57f 100644 --- a/apps/cli/src/commands/stop/stop.integration.test.ts +++ b/apps/cli/src/commands/stop/stop.integration.test.ts @@ -13,7 +13,7 @@ import { Sink, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { vi } from "vitest"; import { mockOutput } from "../../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/commands/storage/cp/cp.command.integration.test.ts b/apps/cli/src/commands/storage/cp/cp.command.integration.test.ts index f7ba5f09a3..88a554cf9a 100644 --- a/apps/cli/src/commands/storage/cp/cp.command.integration.test.ts +++ b/apps/cli/src/commands/storage/cp/cp.command.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Cause, Effect, Exit, Layer, Option } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; import { textCliOutputFormatter } from "../../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/storage/cp/cp.command.ts b/apps/cli/src/commands/storage/cp/cp.command.ts index 80299cb1f0..6de42301e3 100644 --- a/apps/cli/src/commands/storage/cp/cp.command.ts +++ b/apps/cli/src/commands/storage/cp/cp.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/storage/ls/ls.command.ts b/apps/cli/src/commands/storage/ls/ls.command.ts index 7ee6306f50..392f6547c9 100644 --- a/apps/cli/src/commands/storage/ls/ls.command.ts +++ b/apps/cli/src/commands/storage/ls/ls.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/storage/mv/mv.command.ts b/apps/cli/src/commands/storage/mv/mv.command.ts index 6c2576fed6..7baa7d3a9e 100644 --- a/apps/cli/src/commands/storage/mv/mv.command.ts +++ b/apps/cli/src/commands/storage/mv/mv.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/storage/rm/rm.command.ts b/apps/cli/src/commands/storage/rm/rm.command.ts index d37bfed444..dac4716e08 100644 --- a/apps/cli/src/commands/storage/rm/rm.command.ts +++ b/apps/cli/src/commands/storage/rm/rm.command.ts @@ -1,5 +1,5 @@ import { Effect, Layer } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; +import { Argument, Command, Flag } from "effect/cli"; import { CliArgs } from "../../../shared/cli/cli-args.service.ts"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; diff --git a/apps/cli/src/commands/storage/storage.command.ts b/apps/cli/src/commands/storage/storage.command.ts index 15efeae578..85df777834 100644 --- a/apps/cli/src/commands/storage/storage.command.ts +++ b/apps/cli/src/commands/storage/storage.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { storageLsCommand } from "./ls/ls.command.ts"; import { storageCpCommand } from "./cp/cp.command.ts"; import { storageMvCommand } from "./mv/mv.command.ts"; diff --git a/apps/cli/src/commands/storage/storage.experimental-gate.integration.test.ts b/apps/cli/src/commands/storage/storage.experimental-gate.integration.test.ts index 188cb5653b..1fbfe525cd 100644 --- a/apps/cli/src/commands/storage/storage.experimental-gate.integration.test.ts +++ b/apps/cli/src/commands/storage/storage.experimental-gate.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Cause, Effect, Exit, Layer, Option } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { CliArgs } from "../../shared/cli/cli-args.service.ts"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; diff --git a/apps/cli/src/commands/storage/storage.flags.ts b/apps/cli/src/commands/storage/storage.flags.ts index d904255c77..419b52a91a 100644 --- a/apps/cli/src/commands/storage/storage.flags.ts +++ b/apps/cli/src/commands/storage/storage.flags.ts @@ -1,5 +1,5 @@ import { Effect } from "effect"; -import { Flag } from "effect/unstable/cli"; +import { Flag } from "effect/cli"; import { changedLinkedLocalFlags } from "../../command-internal/db-target-flags.ts"; import { StorageMutuallyExclusiveFlagsError } from "./storage.errors.ts"; diff --git a/apps/cli/src/commands/storage/storage.frame.ts b/apps/cli/src/commands/storage/storage.frame.ts index ffb0db64c3..733e74120a 100644 --- a/apps/cli/src/commands/storage/storage.frame.ts +++ b/apps/cli/src/commands/storage/storage.frame.ts @@ -1,7 +1,7 @@ import { CliConfigSchema, type CliConfig } from "@supabase/config/effect"; import { loadCliConfig, type InternalLoadCliConfigOptions } from "@supabase/config/internal"; import { Effect, FileSystem, Schema } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { resolveStorageCredentials, diff --git a/apps/cli/src/commands/telemetry/disable/disable.command.ts b/apps/cli/src/commands/telemetry/disable/disable.command.ts index 4061573795..d8795b07f7 100644 --- a/apps/cli/src/commands/telemetry/disable/disable.command.ts +++ b/apps/cli/src/commands/telemetry/disable/disable.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/telemetry/enable/enable.command.ts b/apps/cli/src/commands/telemetry/enable/enable.command.ts index 0f07e91bba..dd1eba8da3 100644 --- a/apps/cli/src/commands/telemetry/enable/enable.command.ts +++ b/apps/cli/src/commands/telemetry/enable/enable.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/telemetry/status/status.command.ts b/apps/cli/src/commands/telemetry/status/status.command.ts index 7c720f7f40..20ca21cf00 100644 --- a/apps/cli/src/commands/telemetry/status/status.command.ts +++ b/apps/cli/src/commands/telemetry/status/status.command.ts @@ -1,5 +1,5 @@ -import { Command } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts"; import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; diff --git a/apps/cli/src/commands/telemetry/telemetry.command.ts b/apps/cli/src/commands/telemetry/telemetry.command.ts index f73e4df213..93b63fd8ca 100644 --- a/apps/cli/src/commands/telemetry/telemetry.command.ts +++ b/apps/cli/src/commands/telemetry/telemetry.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { telemetryDisableCommand } from "./disable/disable.command.ts"; import { telemetryEnableCommand } from "./enable/enable.command.ts"; import { telemetryStatusCommand } from "./status/status.command.ts"; diff --git a/apps/cli/src/commands/telemetry/telemetry.integration.test.ts b/apps/cli/src/commands/telemetry/telemetry.integration.test.ts index 96d5fdd7ee..d191908df8 100644 --- a/apps/cli/src/commands/telemetry/telemetry.integration.test.ts +++ b/apps/cli/src/commands/telemetry/telemetry.integration.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Effect, FileSystem, Layer, Path, Schema } from "effect"; -import { Command } from "effect/unstable/cli"; -import { FetchHttpClient } from "effect/unstable/http"; +import { Command } from "effect/cli"; +import { FetchHttpClient } from "effect/http"; import { mockAnalytics, diff --git a/apps/cli/src/commands/test/db/db.command.ts b/apps/cli/src/commands/test/db/db.command.ts index efc05ecf9b..8f033c8c97 100644 --- a/apps/cli/src/commands/test/db/db.command.ts +++ b/apps/cli/src/commands/test/db/db.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { TEST_DB_DESCRIPTION, diff --git a/apps/cli/src/commands/test/new/new.command.ts b/apps/cli/src/commands/test/new/new.command.ts index 8dfcfba7af..6720ae7d35 100644 --- a/apps/cli/src/commands/test/new/new.command.ts +++ b/apps/cli/src/commands/test/new/new.command.ts @@ -1,6 +1,6 @@ import { Layer } from "effect"; -import { Argument, Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Argument, Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { commandSettingsLayer } from "../../../config/command-settings.layer.ts"; import { debugLoggerLayer } from "../../../command-internal/debug-logger.layer.ts"; diff --git a/apps/cli/src/commands/test/test.command.ts b/apps/cli/src/commands/test/test.command.ts index 4637e85322..02c320cb54 100644 --- a/apps/cli/src/commands/test/test.command.ts +++ b/apps/cli/src/commands/test/test.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { testDbCommand } from "./db/db.command.ts"; import { testNewCommand } from "./new/new.command.ts"; diff --git a/apps/cli/src/commands/unlink/unlink.command.ts b/apps/cli/src/commands/unlink/unlink.command.ts index caf9e5e1df..649ea8371e 100644 --- a/apps/cli/src/commands/unlink/unlink.command.ts +++ b/apps/cli/src/commands/unlink/unlink.command.ts @@ -1,5 +1,5 @@ import { Layer } from "effect"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { commandCredentialsLayer } from "../../auth/command-credentials.layer.ts"; import { commandSettingsLayer } from "../../config/command-settings.layer.ts"; diff --git a/apps/cli/src/commands/unlink/unlink.integration.test.ts b/apps/cli/src/commands/unlink/unlink.integration.test.ts index 16945ec1a1..69c100b6eb 100644 --- a/apps/cli/src/commands/unlink/unlink.integration.test.ts +++ b/apps/cli/src/commands/unlink/unlink.integration.test.ts @@ -2,7 +2,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, FileSystem, Layer, Option, Path } from "effect"; import { badArgument } from "effect/PlatformError"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import * as HttpClient from "effect/http/HttpClient"; import { mockAnalytics, mockOutput } from "../../../tests/helpers/mocks.ts"; import { diff --git a/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts b/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts index 77b2c3cc4a..328256f7e7 100644 --- a/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts b/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts index d96a370410..7270e2737f 100644 --- a/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts b/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts index dd84cd7ec5..7b211e049a 100644 --- a/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/vanity-subdomains/get/get.command.ts b/apps/cli/src/commands/vanity-subdomains/get/get.command.ts index b8043ec7f5..de5d4d3aeb 100644 --- a/apps/cli/src/commands/vanity-subdomains/get/get.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/get/get.command.ts @@ -1,6 +1,6 @@ import { Effect } from "effect"; -import { Command, Flag } from "effect/unstable/cli"; -import type * as CliCommand from "effect/unstable/cli/Command"; +import { Command, Flag } from "effect/cli"; +import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; import { requireExperimental } from "../../../command-internal/experimental-gate.ts"; diff --git a/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts b/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts index 0ca79fb1f7..f4c838479f 100644 --- a/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts @@ -1,4 +1,4 @@ -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { vanitySubdomainsActivateCommand } from "./activate/activate.command.ts"; import { vanitySubdomainsCheckAvailabilityCommand } from "./check-availability/check-availability.command.ts"; import { vanitySubdomainsDeleteCommand } from "./delete/delete.command.ts"; diff --git a/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.experimental-gate.integration.test.ts b/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.experimental-gate.integration.test.ts index f4f958e4d2..dec89cfa98 100644 --- a/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.experimental-gate.integration.test.ts +++ b/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.experimental-gate.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Layer } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; +import { CliOutput, Command } from "effect/cli"; import { textCliOutputFormatter } from "../../shared/output/text-formatter.ts"; import { GLOBAL_FLAGS } from "../../command-internal/global-flags.ts"; diff --git a/apps/cli/src/commands/whoami/whoami.command.ts b/apps/cli/src/commands/whoami/whoami.command.ts index 5739e47421..3bb8c56210 100644 --- a/apps/cli/src/commands/whoami/whoami.command.ts +++ b/apps/cli/src/commands/whoami/whoami.command.ts @@ -1,5 +1,5 @@ -import type * as CliCommand from "effect/unstable/cli/Command"; -import { Command } from "effect/unstable/cli"; +import type * as CliCommand from "effect/cli/Command"; +import { Command } from "effect/cli"; import { GLOBAL_OUTPUT_FORMATS } from "../../command-internal/global-flags.ts"; import { managementApiRuntimeLayer } from "../../command-internal/management-api-runtime.layer.ts"; diff --git a/apps/cli/src/docs/docs-introspection.ts b/apps/cli/src/docs/docs-introspection.ts index 3063ee1339..cedfe58ca0 100644 --- a/apps/cli/src/docs/docs-introspection.ts +++ b/apps/cli/src/docs/docs-introspection.ts @@ -1,4 +1,4 @@ -import type { Command, GlobalFlag, Param, Primitive } from "effect/unstable/cli"; +import type { Command, GlobalFlag, Param, Primitive } from "effect/cli"; /** * `.config.flags`/`.contextConfig.flags`/`.globalFlags` exist on `Command` at runtime but are diff --git a/apps/cli/src/docs/docs-spec.ts b/apps/cli/src/docs/docs-spec.ts index 7e7bf61200..85f7715093 100644 --- a/apps/cli/src/docs/docs-spec.ts +++ b/apps/cli/src/docs/docs-spec.ts @@ -1,7 +1,7 @@ import { Option } from "effect"; import { stringify } from "yaml"; -import { GlobalFlag } from "effect/unstable/cli"; -import type { Command, Param } from "effect/unstable/cli"; +import { GlobalFlag } from "effect/cli"; +import type { Command, Param } from "effect/cli"; import { choiceKeysOf, commandInternals, diff --git a/apps/cli/src/docs/docs-spec.unit.test.ts b/apps/cli/src/docs/docs-spec.unit.test.ts index 80e6f178cc..6d951aeb69 100644 --- a/apps/cli/src/docs/docs-spec.unit.test.ts +++ b/apps/cli/src/docs/docs-spec.unit.test.ts @@ -1,7 +1,7 @@ import { mkdtempSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import path from "node:path"; -import { Command, Flag } from "effect/unstable/cli"; +import { Command, Flag } from "effect/cli"; import { describe, expect, it } from "vitest"; import { ExperimentalFlag } from "../command-internal/global-flags.ts"; diff --git a/apps/cli/src/shared/auth/jwks.integration.test.ts b/apps/cli/src/shared/auth/jwks.integration.test.ts index 7c5873051d..69b641a2d5 100644 --- a/apps/cli/src/shared/auth/jwks.integration.test.ts +++ b/apps/cli/src/shared/auth/jwks.integration.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Exit, Fiber } from "effect"; import { TestClock } from "effect/testing"; -import { HttpClient, HttpClientResponse } from "effect/unstable/http"; +import { HttpClient, HttpClientResponse } from "effect/http"; import { resolveRemoteJwks } from "./jwks.ts"; diff --git a/apps/cli/src/shared/auth/jwks.ts b/apps/cli/src/shared/auth/jwks.ts index ab2264286e..7fe0c3cc67 100644 --- a/apps/cli/src/shared/auth/jwks.ts +++ b/apps/cli/src/shared/auth/jwks.ts @@ -1,5 +1,5 @@ import { Data, Effect, Schema } from "effect"; -import { HttpClient, HttpClientResponse } from "effect/unstable/http"; +import { HttpClient, HttpClientResponse } from "effect/http"; import { actionability, ErrorActionabilityId, diff --git a/apps/cli/src/shared/cli/command-docs.ts b/apps/cli/src/shared/cli/command-docs.ts index 8a64bbca51..77abe75f1b 100644 --- a/apps/cli/src/shared/cli/command-docs.ts +++ b/apps/cli/src/shared/cli/command-docs.ts @@ -1,4 +1,4 @@ -import type { Command, HelpDoc } from "effect/unstable/cli"; +import type { Command, HelpDoc } from "effect/cli"; // Get HelpDoc from a command (uses internal buildHelpDoc) export function getHelpDoc( diff --git a/apps/cli/src/shared/cli/command-docs.unit.test.ts b/apps/cli/src/shared/cli/command-docs.unit.test.ts index 640fb45e05..a0970c475e 100644 --- a/apps/cli/src/shared/cli/command-docs.unit.test.ts +++ b/apps/cli/src/shared/cli/command-docs.unit.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { Command } from "effect/unstable/cli"; +import { Command } from "effect/cli"; import { collectCommands, findCommand } from "./command-docs.ts"; function makeTree() { diff --git a/apps/cli/src/shared/cli/hidden-flag.unit.test.ts b/apps/cli/src/shared/cli/hidden-flag.unit.test.ts index ab83e33047..2c2e7c56c1 100644 --- a/apps/cli/src/shared/cli/hidden-flag.unit.test.ts +++ b/apps/cli/src/shared/cli/hidden-flag.unit.test.ts @@ -1,6 +1,6 @@ import { Cause, Effect, Exit, FileSystem, Layer, Schema } from "effect"; import { BunServices } from "@effect/platform-bun"; -import { CliOutput, Command, type HelpDoc } from "effect/unstable/cli"; +import { CliOutput, Command, type HelpDoc } from "effect/cli"; import { describe, expect, it } from "@effect/vitest"; import { branchesCommand } from "../../commands/branches/branches.command.ts"; import { dbCommand } from "../../commands/db/db.command.ts"; diff --git a/apps/cli/src/shared/cli/markdown-formatter.ts b/apps/cli/src/shared/cli/markdown-formatter.ts index 62e6eac47d..fcf95b93e2 100644 --- a/apps/cli/src/shared/cli/markdown-formatter.ts +++ b/apps/cli/src/shared/cli/markdown-formatter.ts @@ -1,5 +1,5 @@ import { Option } from "effect"; -import type { HelpDoc } from "effect/unstable/cli"; +import type { HelpDoc } from "effect/cli"; function escapeMdxText(value: string): string { return value diff --git a/apps/cli/src/shared/cli/markdown-formatter.unit.test.ts b/apps/cli/src/shared/cli/markdown-formatter.unit.test.ts index 74f4cdd29f..6cc5748727 100644 --- a/apps/cli/src/shared/cli/markdown-formatter.unit.test.ts +++ b/apps/cli/src/shared/cli/markdown-formatter.unit.test.ts @@ -1,5 +1,5 @@ import { Option, Context } from "effect"; -import type { HelpDoc } from "effect/unstable/cli"; +import type { HelpDoc } from "effect/cli"; import { describe, expect, it } from "vitest"; import { formatHelpDocAsMarkdown } from "./markdown-formatter.ts"; diff --git a/apps/cli/src/shared/cli/run.integration.test.ts b/apps/cli/src/shared/cli/run.integration.test.ts index ca5a904444..de88e5ce93 100644 --- a/apps/cli/src/shared/cli/run.integration.test.ts +++ b/apps/cli/src/shared/cli/run.integration.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Console, Effect, Exit, Layer } from "effect"; -import { Argument, CliOutput, Command, Flag } from "effect/unstable/cli"; +import { Argument, CliOutput, Command, Flag } from "effect/cli"; import { branchesCommand } from "../../commands/branches/branches.command.ts"; import { GLOBAL_FLAGS, OutputFormatFlag } from "../../command-internal/global-flags.ts"; import { textCliOutputFormatter } from "../output/text-formatter.ts"; diff --git a/apps/cli/src/shared/cli/run.ts b/apps/cli/src/shared/cli/run.ts index 966873a739..54dabdd641 100644 --- a/apps/cli/src/shared/cli/run.ts +++ b/apps/cli/src/shared/cli/run.ts @@ -16,9 +16,9 @@ import { Scope, Stdio, } from "effect"; -import { CliError, CliOutput, Command } from "effect/unstable/cli"; -import { HttpClient } from "effect/unstable/http"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { CliError, CliOutput, Command } from "effect/cli"; +import { HttpClient } from "effect/http"; +import { ChildProcessSpawner } from "effect/process"; import { CLI_VERSION } from "./version.ts"; import type { CliProjectHome } from "../config/cli-project-home.service.ts"; import type { CliSettings } from "../config/cli-settings.service.ts"; diff --git a/apps/cli/src/shared/cli/run.unit.test.ts b/apps/cli/src/shared/cli/run.unit.test.ts index 810fbc426c..4e0fd082c3 100644 --- a/apps/cli/src/shared/cli/run.unit.test.ts +++ b/apps/cli/src/shared/cli/run.unit.test.ts @@ -1,5 +1,5 @@ import { Cause } from "effect"; -import { CliError, Command } from "effect/unstable/cli"; +import { CliError, Command } from "effect/cli"; import { describe, expect, it } from "vitest"; import { branchesCommand } from "../../commands/branches/branches.command.ts"; diff --git a/apps/cli/src/shared/cli/subcommand-flag-suggestions.ts b/apps/cli/src/shared/cli/subcommand-flag-suggestions.ts index 85b7e20774..4e2785e3d4 100644 --- a/apps/cli/src/shared/cli/subcommand-flag-suggestions.ts +++ b/apps/cli/src/shared/cli/subcommand-flag-suggestions.ts @@ -1,4 +1,4 @@ -import type { CliError, Command, HelpDoc } from "effect/unstable/cli"; +import type { CliError, Command, HelpDoc } from "effect/cli"; import { formatInvalidValueMessage } from "./invalid-value-message.ts"; export interface CliErrorSuggestionContext { diff --git a/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts b/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts index 761f2c1177..7462242dce 100644 --- a/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts +++ b/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts @@ -1,4 +1,4 @@ -import { CliError, Command } from "effect/unstable/cli"; +import { CliError, Command } from "effect/cli"; import { describe, expect, it } from "vitest"; import { branchesCommand } from "../../commands/branches/branches.command.ts"; import { networkRestrictionsCommand } from "../../commands/network-restrictions/network-restrictions.command.ts"; diff --git a/apps/cli/src/shared/cli/version.integration.test.ts b/apps/cli/src/shared/cli/version.integration.test.ts index 8349391d23..9fc5f45811 100644 --- a/apps/cli/src/shared/cli/version.integration.test.ts +++ b/apps/cli/src/shared/cli/version.integration.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "@effect/vitest"; import { BunServices } from "@effect/platform-bun"; import { Console, Effect, Layer, Schema, Stream } from "effect"; -import { CliOutput, Command } from "effect/unstable/cli"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { CliOutput, Command } from "effect/cli"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { fileURLToPath } from "node:url"; import { rootCommand } from "../../cli/root.ts"; import { emptyEnv, fakeConsole, mockOutput } from "../../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/shared/compute/compute-api-status.ts b/apps/cli/src/shared/compute/compute-api-status.ts index 56319a42fc..63930b1840 100644 --- a/apps/cli/src/shared/compute/compute-api-status.ts +++ b/apps/cli/src/shared/compute/compute-api-status.ts @@ -1,7 +1,7 @@ import { markSupabaseApiInputErrorAsUserInput, SupabaseApiInputError } from "@supabase/api/effect"; import { Effect, Option, Schema } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import type * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientError from "effect/http/HttpClientError"; +import type * as HttpClientResponse from "effect/http/HttpClientResponse"; import { CLI_UPGRADE_GUIDE_URL } from "../cli/version.ts"; import { ComputeApiNetworkError, diff --git a/apps/cli/src/shared/compute/compute-api.ts b/apps/cli/src/shared/compute/compute-api.ts index e905f3a138..29c04bcb59 100644 --- a/apps/cli/src/shared/compute/compute-api.ts +++ b/apps/cli/src/shared/compute/compute-api.ts @@ -7,8 +7,8 @@ import { type ApiClient, } from "@supabase/api/effect"; import { Effect, Option, Schedule } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { bodyText, decodeJsonBody, diff --git a/apps/cli/src/shared/functions/delete.ts b/apps/cli/src/shared/functions/delete.ts index 4bcbc82695..953922b198 100644 --- a/apps/cli/src/shared/functions/delete.ts +++ b/apps/cli/src/shared/functions/delete.ts @@ -5,7 +5,7 @@ import { type ApiClient, } from "@supabase/api/effect"; import { Effect, type Option } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpClientError from "effect/http/HttpClientError"; import { Output } from "../output/output.service.ts"; import { DeleteFunctionNetworkError, diff --git a/apps/cli/src/shared/functions/deploy.ts b/apps/cli/src/shared/functions/deploy.ts index 74f845eed7..9193c0e0a5 100644 --- a/apps/cli/src/shared/functions/deploy.ts +++ b/apps/cli/src/shared/functions/deploy.ts @@ -23,8 +23,8 @@ import { type PlatformError, Schema, } from "effect"; -import * as HttpBody from "effect/unstable/http/HttpBody"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpBody from "effect/http/HttpBody"; +import * as HttpClientError from "effect/http/HttpClientError"; import { promptYesNo } from "../../command-internal/prompt-yes-no.ts"; import { bitbucketCloneDir } from "../../command-internal/bitbucket-pipeline.ts"; import { CONTEXT_CANCELED_MESSAGE } from "../output/errors.ts"; diff --git a/apps/cli/src/shared/functions/download.ts b/apps/cli/src/shared/functions/download.ts index d848afc205..70b4997905 100644 --- a/apps/cli/src/shared/functions/download.ts +++ b/apps/cli/src/shared/functions/download.ts @@ -3,9 +3,9 @@ import { operationDefinitions, SupabaseApiInputError, type ApiClient } from "@su import { randomUUID } from "node:crypto"; import { fileURLToPath } from "node:url"; import { Effect, FileSystem, Option, Path, type PlatformError, Schema } from "effect"; -import * as HttpBody from "effect/unstable/http/HttpBody"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import type * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpBody from "effect/http/HttpBody"; +import * as HttpClientError from "effect/http/HttpClientError"; +import type * as HttpClientResponse from "effect/http/HttpClientResponse"; import { Output } from "../output/output.service.ts"; import { cobraMutuallyExclusiveErrorMessage, diff --git a/apps/cli/src/shared/functions/functions-docker.ts b/apps/cli/src/shared/functions/functions-docker.ts index b31fa892ba..e5d60cc7f8 100644 --- a/apps/cli/src/shared/functions/functions-docker.ts +++ b/apps/cli/src/shared/functions/functions-docker.ts @@ -12,7 +12,7 @@ import { import type { Path } from "effect"; import { Data, Effect, Option, Predicate, Runtime, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { spawnContainerCli } from "../../command-internal/container-cli.ts"; import { makeDockerImageResolver } from "../../command-internal/docker-image-resolve.ts"; import { DENO1_EDGE_RUNTIME_VERSION } from "./functions.shared.ts"; diff --git a/apps/cli/src/shared/functions/functions-docker.unit.test.ts b/apps/cli/src/shared/functions/functions-docker.unit.test.ts index dd909ee291..4846773a75 100644 --- a/apps/cli/src/shared/functions/functions-docker.unit.test.ts +++ b/apps/cli/src/shared/functions/functions-docker.unit.test.ts @@ -12,8 +12,8 @@ import { Sink, Stream, } from "effect"; -import { CliError } from "effect/unstable/cli"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { CliError } from "effect/cli"; +import { ChildProcessSpawner } from "effect/process"; import process from "node:process"; import { formatCliError, normalizeCause, normalizeCliError } from "../output/normalize-error.ts"; import { FileWatcherError } from "../runtime/file-watcher.service.ts"; diff --git a/apps/cli/src/shared/functions/serve-main-offline.e2e.test.ts b/apps/cli/src/shared/functions/serve-main-offline.e2e.test.ts index a98313fd90..e6bdd1761e 100644 --- a/apps/cli/src/shared/functions/serve-main-offline.e2e.test.ts +++ b/apps/cli/src/shared/functions/serve-main-offline.e2e.test.ts @@ -14,9 +14,9 @@ import { Schedule, Stream, } from "effect"; -import { FetchHttpClient, HttpBody, HttpClient } from "effect/unstable/http"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { FetchHttpClient, HttpBody, HttpClient } from "effect/http"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { START_KONG_YML_TEMPLATE } from "../../commands/start/templates/kong.yml.ts"; import { edgeRuntimeDockerfileImage } from "../../command-internal/edge-runtime-image.ts"; diff --git a/apps/cli/src/shared/functions/serve.ts b/apps/cli/src/shared/functions/serve.ts index fe1c997214..d5409cf1f9 100644 --- a/apps/cli/src/shared/functions/serve.ts +++ b/apps/cli/src/shared/functions/serve.ts @@ -42,7 +42,7 @@ import { Schema, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { describeContainerCliFailure, isContainerNotFoundMessage, diff --git a/apps/cli/src/shared/output/json-formatter.ts b/apps/cli/src/shared/output/json-formatter.ts index e8f1cbc48d..18795fc7da 100644 --- a/apps/cli/src/shared/output/json-formatter.ts +++ b/apps/cli/src/shared/output/json-formatter.ts @@ -1,4 +1,4 @@ -import type { CliOutput, HelpDoc } from "effect/unstable/cli"; +import type { CliOutput, HelpDoc } from "effect/cli"; import type { CliErrorSuggestionContext } from "../cli/subcommand-flag-suggestions.ts"; import { cliErrorCode, formatCliErrorsForDisplay } from "../cli/subcommand-flag-suggestions.ts"; diff --git a/apps/cli/src/shared/output/normalize-error.ts b/apps/cli/src/shared/output/normalize-error.ts index 2695d593a2..6619fda663 100644 --- a/apps/cli/src/shared/output/normalize-error.ts +++ b/apps/cli/src/shared/output/normalize-error.ts @@ -1,5 +1,5 @@ import { Cause, Option } from "effect"; -import { CliError } from "effect/unstable/cli"; +import { CliError } from "effect/cli"; import { unwrapNativeFailure } from "../telemetry/error-actionability.ts"; import { formatInvalidValueMessage } from "../cli/invalid-value-message.ts"; import type { CliErrorSuggestionContext } from "../cli/subcommand-flag-suggestions.ts"; diff --git a/apps/cli/src/shared/output/normalize-error.unit.test.ts b/apps/cli/src/shared/output/normalize-error.unit.test.ts index 840dd4076f..52194f8ce6 100644 --- a/apps/cli/src/shared/output/normalize-error.unit.test.ts +++ b/apps/cli/src/shared/output/normalize-error.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "vitest"; import { Cause } from "effect"; -import { CliError, Command } from "effect/unstable/cli"; +import { CliError, Command } from "effect/cli"; import { CliConfigParseError, CliProjectEnvParseError } from "@supabase/config"; import { branchesCommand } from "../../commands/branches/branches.command.ts"; import { networkRestrictionsCommand } from "../../commands/network-restrictions/network-restrictions.command.ts"; diff --git a/apps/cli/src/shared/output/text-formatter.ts b/apps/cli/src/shared/output/text-formatter.ts index 4829507963..dc314545af 100644 --- a/apps/cli/src/shared/output/text-formatter.ts +++ b/apps/cli/src/shared/output/text-formatter.ts @@ -1,4 +1,4 @@ -import { CliOutput } from "effect/unstable/cli"; +import { CliOutput } from "effect/cli"; import type { CliErrorSuggestionContext, FormattedCliError, diff --git a/apps/cli/src/shared/output/text-formatter.unit.test.ts b/apps/cli/src/shared/output/text-formatter.unit.test.ts index 903c02dbf6..c464209373 100644 --- a/apps/cli/src/shared/output/text-formatter.unit.test.ts +++ b/apps/cli/src/shared/output/text-formatter.unit.test.ts @@ -1,4 +1,4 @@ -import { CliError, Command } from "effect/unstable/cli"; +import { CliError, Command } from "effect/cli"; import { describe, expect, it } from "vitest"; import { networkRestrictionsCommand } from "../../commands/network-restrictions/network-restrictions.command.ts"; import { textCliOutputFormatter } from "./text-formatter.ts"; diff --git a/apps/cli/src/shared/runtime/browser.layer.ts b/apps/cli/src/shared/runtime/browser.layer.ts index 97b9db9692..b783661603 100644 --- a/apps/cli/src/shared/runtime/browser.layer.ts +++ b/apps/cli/src/shared/runtime/browser.layer.ts @@ -1,5 +1,5 @@ import { Config, Effect, FileSystem, Layer } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { RuntimeInfo } from "./runtime-info.service.ts"; import { Browser } from "./browser.service.ts"; diff --git a/apps/cli/src/shared/runtime/browser.layer.unit.test.ts b/apps/cli/src/shared/runtime/browser.layer.unit.test.ts index fe5456620d..a638c92a07 100644 --- a/apps/cli/src/shared/runtime/browser.layer.unit.test.ts +++ b/apps/cli/src/shared/runtime/browser.layer.unit.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { ConfigProvider, Effect, Layer, PlatformError, Sink, Stream } from "effect"; import { FileSystem } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { mockRuntimeInfo } from "../../../tests/helpers/mocks.ts"; import { Browser } from "./browser.service.ts"; import { browserLayer } from "./browser.layer.ts"; diff --git a/apps/cli/src/shared/runtime/stdin.integration.test.ts b/apps/cli/src/shared/runtime/stdin.integration.test.ts index 35f611b2fe..6278d7a621 100644 --- a/apps/cli/src/shared/runtime/stdin.integration.test.ts +++ b/apps/cli/src/shared/runtime/stdin.integration.test.ts @@ -3,7 +3,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Duration, Effect, Fiber, Layer, Option, Queue, Ref, Stream } from "effect"; import { systemError, type PlatformError } from "effect/PlatformError"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { TestClock } from "effect/testing"; import { mockTty } from "../../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/shared/services/services.shared.ts b/apps/cli/src/shared/services/services.shared.ts index d1e683d9f7..4fb0c54a86 100644 --- a/apps/cli/src/shared/services/services.shared.ts +++ b/apps/cli/src/shared/services/services.shared.ts @@ -1,8 +1,8 @@ import { styleText } from "node:util"; import { makeApiClient, type ApiClient } from "@supabase/api/effect"; import { Data, Duration, Effect, Exit, Redacted } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { renderGlamourTable } from "../../output/glamour-table.ts"; import { actionability, diff --git a/apps/cli/src/shared/services/services.shared.unit.test.ts b/apps/cli/src/shared/services/services.shared.unit.test.ts index 93179986c7..90af5802a3 100644 --- a/apps/cli/src/shared/services/services.shared.unit.test.ts +++ b/apps/cli/src/shared/services/services.shared.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, test } from "@effect/vitest"; import { Effect, Redacted } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { afterEach, beforeEach, vi } from "vitest"; import serviceImagesDockerfile from "./Dockerfile" with { type: "text" }; import { dockerfileServiceImageRaw } from "./dockerfile-images.ts"; diff --git a/apps/cli/src/shared/telemetry/error-actionability-coverage.unit.test.ts b/apps/cli/src/shared/telemetry/error-actionability-coverage.unit.test.ts index 703814d542..cade7cd30d 100644 --- a/apps/cli/src/shared/telemetry/error-actionability-coverage.unit.test.ts +++ b/apps/cli/src/shared/telemetry/error-actionability-coverage.unit.test.ts @@ -1,4 +1,4 @@ -import { CliError } from "effect/unstable/cli"; +import { CliError } from "effect/cli"; import { describe, expect, it } from "vitest"; import { classifyCliErrorActionability } from "./error-actionability.ts"; diff --git a/apps/cli/src/shared/telemetry/error-actionability.ts b/apps/cli/src/shared/telemetry/error-actionability.ts index 552e6bcc25..fe66bd7946 100644 --- a/apps/cli/src/shared/telemetry/error-actionability.ts +++ b/apps/cli/src/shared/telemetry/error-actionability.ts @@ -1,5 +1,5 @@ import { Cause, Option, Predicate } from "effect"; -import type { CliError as EffectCliError } from "effect/unstable/cli"; +import type { CliError as EffectCliError } from "effect/cli"; /** * CLI error actionability taxonomy for KPI reporting. @@ -820,7 +820,7 @@ const externalActionabilityByTag: Record = { ? { ...actionability.invalidInput, fingerprint_suffix: "request_input" } : { ...actionability.impossibleState, fingerprint_suffix: "request_encoding" }, - // effect/unstable/http — generated Management API client transport/decoding + // effect/http — generated Management API client transport/decoding HttpClientError: (error) => { const reason = error["reason"]; const reasonTag = isErrorRecord(reason) ? readString(reason, "_tag") : undefined; diff --git a/apps/cli/src/shared/telemetry/error-actionability.unit.test.ts b/apps/cli/src/shared/telemetry/error-actionability.unit.test.ts index e0508fd99f..0c9889c6b8 100644 --- a/apps/cli/src/shared/telemetry/error-actionability.unit.test.ts +++ b/apps/cli/src/shared/telemetry/error-actionability.unit.test.ts @@ -1,5 +1,5 @@ import { Cause, Data } from "effect"; -import { CliError } from "effect/unstable/cli"; +import { CliError } from "effect/cli"; import { describe, expect, it } from "vitest"; import { SupabaseApiInputError, markSupabaseApiInputErrorAsUserInput } from "@supabase/api/effect"; import { BootstrapHealthError } from "../../commands/bootstrap/bootstrap.errors.ts"; diff --git a/apps/cli/src/shared/telemetry/otlp-trace-sink.ts b/apps/cli/src/shared/telemetry/otlp-trace-sink.ts index 106dd73372..bc391df5bb 100644 --- a/apps/cli/src/shared/telemetry/otlp-trace-sink.ts +++ b/apps/cli/src/shared/telemetry/otlp-trace-sink.ts @@ -9,10 +9,10 @@ import { Semaphore, } from "effect"; import type { Crypto, Scope, Tracer } from "effect"; -import { FetchHttpClient, HttpBody, HttpClient, HttpClientResponse } from "effect/unstable/http"; -import * as OtlpExporter from "effect/unstable/observability/OtlpExporter"; -import * as OtlpSerialization from "effect/unstable/observability/OtlpSerialization"; -import * as OtlpTracer from "effect/unstable/observability/OtlpTracer"; +import { FetchHttpClient, HttpBody, HttpClient, HttpClientResponse } from "effect/http"; +import * as OtlpExporter from "effect/observability/OtlpExporter"; +import * as OtlpSerialization from "effect/observability/OtlpSerialization"; +import * as OtlpTracer from "effect/observability/OtlpTracer"; import { makeTraceSanitizer } from "./trace-sanitize.ts"; const EXPORT_TIMEOUT_MS = 2_000; diff --git a/apps/cli/src/shared/telemetry/posthog-client.ts b/apps/cli/src/shared/telemetry/posthog-client.ts index aa15346128..73d120fc0d 100644 --- a/apps/cli/src/shared/telemetry/posthog-client.ts +++ b/apps/cli/src/shared/telemetry/posthog-client.ts @@ -6,7 +6,7 @@ import { HttpClient, HttpClientRequest, type HttpClientResponse, -} from "effect/unstable/http"; +} from "effect/http"; import { PostHog, type PostHogOptions } from "posthog-node"; const EXIT_DELAY_CAP_MS = 2_000; diff --git a/apps/cli/src/shared/telemetry/posthog-client.unit.test.ts b/apps/cli/src/shared/telemetry/posthog-client.unit.test.ts index bc41356563..8e196a420c 100644 --- a/apps/cli/src/shared/telemetry/posthog-client.unit.test.ts +++ b/apps/cli/src/shared/telemetry/posthog-client.unit.test.ts @@ -7,7 +7,7 @@ import { HttpClientError, type HttpClientRequest, HttpClientResponse, -} from "effect/unstable/http"; +} from "effect/http"; import { PostHog } from "posthog-node"; import { makePosthogFetch, scopedPosthogClient } from "./posthog-client.ts"; diff --git a/apps/cli/src/shared/telemetry/spans.ts b/apps/cli/src/shared/telemetry/spans.ts index 4998a89953..d5e14bf915 100644 --- a/apps/cli/src/shared/telemetry/spans.ts +++ b/apps/cli/src/shared/telemetry/spans.ts @@ -1,7 +1,7 @@ import { Clock, Context, Effect, Exit } from "effect"; import type { Scope, Tracer } from "effect"; -import type * as ChildProcess from "effect/unstable/process/ChildProcess"; -import { makeHandle, type ChildProcessHandle } from "effect/unstable/process/ChildProcessSpawner"; +import type * as ChildProcess from "effect/process/ChildProcess"; +import { makeHandle, type ChildProcessHandle } from "effect/process/ChildProcessSpawner"; /** Whether spawned processes receive `TRACEPARENT`; true only while a trace sink is active. */ export const ChildTracePropagation = Context.Reference( diff --git a/apps/cli/src/shared/telemetry/trace-export.layer.ts b/apps/cli/src/shared/telemetry/trace-export.layer.ts index 56ecdb4549..e11e92b93c 100644 --- a/apps/cli/src/shared/telemetry/trace-export.layer.ts +++ b/apps/cli/src/shared/telemetry/trace-export.layer.ts @@ -17,7 +17,7 @@ import { Stream, Tracer, } from "effect"; -import { Headers, HttpTraceContext } from "effect/unstable/http"; +import { Headers, HttpTraceContext } from "effect/http"; import { CLI_VERSION } from "../cli/version.ts"; import { CliSettings } from "../config/cli-settings.service.ts"; import { RuntimeInfo } from "../runtime/runtime-info.service.ts"; diff --git a/apps/cli/src/shared/telemetry/trace-sanitize.ts b/apps/cli/src/shared/telemetry/trace-sanitize.ts index 66be615ad6..e6447a28e0 100644 --- a/apps/cli/src/shared/telemetry/trace-sanitize.ts +++ b/apps/cli/src/shared/telemetry/trace-sanitize.ts @@ -1,7 +1,7 @@ import { createHmac } from "node:crypto"; import { Cause, Crypto, Effect, Exit } from "effect"; -import type { KeyValue, AnyValue } from "effect/unstable/observability/OtlpResource"; -import type { ScopeSpan, TraceData } from "effect/unstable/observability/OtlpTracer"; +import type { KeyValue, AnyValue } from "effect/observability/OtlpResource"; +import type { ScopeSpan, TraceData } from "effect/observability/OtlpTracer"; const MAX_STRING_LENGTH = 2048; const REDACTED = ""; diff --git a/apps/cli/src/shared/telemetry/trace-sanitize.unit.test.ts b/apps/cli/src/shared/telemetry/trace-sanitize.unit.test.ts index 76a2b20268..5f2171db7f 100644 --- a/apps/cli/src/shared/telemetry/trace-sanitize.unit.test.ts +++ b/apps/cli/src/shared/telemetry/trace-sanitize.unit.test.ts @@ -1,8 +1,8 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "vitest"; import { Effect, Exit } from "effect"; -import type { TraceData } from "effect/unstable/observability/OtlpTracer"; -import { SqlError, UniqueViolation } from "effect/unstable/sql/SqlError"; +import type { TraceData } from "effect/observability/OtlpTracer"; +import { SqlError, UniqueViolation } from "effect/sql/SqlError"; import { DbExecError } from "../../command-internal/db-connection.errors.ts"; import { errorTypeOf, makeTraceSanitizer, scrubString, sqlStateOf } from "./trace-sanitize.ts"; diff --git a/apps/cli/src/telemetry/analytics.layer.integration.test.ts b/apps/cli/src/telemetry/analytics.layer.integration.test.ts index 75e9ae1d0d..23acd05c42 100644 --- a/apps/cli/src/telemetry/analytics.layer.integration.test.ts +++ b/apps/cli/src/telemetry/analytics.layer.integration.test.ts @@ -1,7 +1,7 @@ import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { ConfigProvider, Effect, Layer, Option } from "effect"; -import { HttpClient, HttpClientResponse } from "effect/unstable/http"; +import { HttpClient, HttpClientResponse } from "effect/http"; import { useTempWorkdir } from "../../tests/helpers/command-mocks.ts"; import { mockRuntimeInfo, mockTty } from "../../tests/helpers/mocks.ts"; diff --git a/apps/cli/src/telemetry/command-telemetry.ts b/apps/cli/src/telemetry/command-telemetry.ts index 58bb5c4230..ff156ac0be 100644 --- a/apps/cli/src/telemetry/command-telemetry.ts +++ b/apps/cli/src/telemetry/command-telemetry.ts @@ -1,5 +1,5 @@ import { Cause, Clock, Effect, Exit, Option, Ref, Stdio } from "effect"; -import { Param } from "effect/unstable/cli"; +import { Param } from "effect/cli"; import { CommandRuntime, getCommandRuntimeCommand, diff --git a/apps/cli/src/telemetry/command-telemetry.unit.test.ts b/apps/cli/src/telemetry/command-telemetry.unit.test.ts index 1686ed56a7..e0e0ca6605 100644 --- a/apps/cli/src/telemetry/command-telemetry.unit.test.ts +++ b/apps/cli/src/telemetry/command-telemetry.unit.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@effect/vitest"; import { BunCrypto } from "@effect/platform-bun"; import { Cause, Effect, Exit, Layer, Option, Stdio } from "effect"; -import { Flag } from "effect/unstable/cli"; +import { Flag } from "effect/cli"; import { commandRuntimeLayer } from "../shared/runtime/command-runtime.layer.ts"; import { AgentFlag, diff --git a/apps/cli/src/telemetry/linked-project-cache.integration.test.ts b/apps/cli/src/telemetry/linked-project-cache.integration.test.ts index bd110bf772..5e09626a17 100644 --- a/apps/cli/src/telemetry/linked-project-cache.integration.test.ts +++ b/apps/cli/src/telemetry/linked-project-cache.integration.test.ts @@ -4,7 +4,7 @@ import { join } from "node:path"; import { BunServices } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; import { Effect, Layer } from "effect"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { mockAnalytics, mockTelemetryRuntime } from "../../tests/helpers/mocks.ts"; import { diff --git a/apps/cli/src/telemetry/linked-project-cache.layer.ts b/apps/cli/src/telemetry/linked-project-cache.layer.ts index ff6a028c5f..b1ab675549 100644 --- a/apps/cli/src/telemetry/linked-project-cache.layer.ts +++ b/apps/cli/src/telemetry/linked-project-cache.layer.ts @@ -1,6 +1,6 @@ import { Effect, FileSystem, Layer, Option, Path, Redacted } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; import { CommandCredentials } from "../auth/command-credentials.service.ts"; import { CommandSettings } from "../config/command-settings.service.ts"; diff --git a/apps/cli/tests/helpers/child-process-spawner.ts b/apps/cli/tests/helpers/child-process-spawner.ts index 7dc2ad5a0e..db669a298b 100644 --- a/apps/cli/tests/helpers/child-process-spawner.ts +++ b/apps/cli/tests/helpers/child-process-spawner.ts @@ -1,5 +1,5 @@ import { Deferred, Effect, Layer, PlatformError, Predicate, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; interface SpawnRecord { command: string; diff --git a/apps/cli/tests/helpers/cli.ts b/apps/cli/tests/helpers/cli.ts index 867b38d5f4..7a65b16953 100644 --- a/apps/cli/tests/helpers/cli.ts +++ b/apps/cli/tests/helpers/cli.ts @@ -1,4 +1,4 @@ -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { spawn } from "node:child_process"; import { existsSync, mkdirSync, mkdtempSync, rmSync, symlinkSync } from "node:fs"; import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; diff --git a/apps/cli/tests/helpers/command-mocks.ts b/apps/cli/tests/helpers/command-mocks.ts index 1f8cb7c04a..6533705950 100644 --- a/apps/cli/tests/helpers/command-mocks.ts +++ b/apps/cli/tests/helpers/command-mocks.ts @@ -16,14 +16,14 @@ import { Stream, } from "effect"; import { PlatformError, SystemError } from "effect/PlatformError"; -import type { ChildProcess } from "effect/unstable/process"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import * as HttpClientRequestModule from "effect/unstable/http/HttpClientRequest"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as UrlParams from "effect/unstable/http/UrlParams"; +import type { ChildProcess } from "effect/process"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import * as HttpClientRequestModule from "effect/http/HttpClientRequest"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as UrlParams from "effect/http/UrlParams"; import { afterEach, beforeEach } from "vitest"; import { CommandCredentials } from "../../src/auth/command-credentials.service.ts"; diff --git a/apps/cli/tests/helpers/compute.ts b/apps/cli/tests/helpers/compute.ts index 81e258d95d..91a2293b62 100644 --- a/apps/cli/tests/helpers/compute.ts +++ b/apps/cli/tests/helpers/compute.ts @@ -1,10 +1,10 @@ import { BunServices } from "@effect/platform-bun"; import { makeApiClient } from "@supabase/api/effect"; import { Effect, FileSystem, Layer, Option, Path, Predicate, Redacted, Schema } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { CommandPlatformApi } from "../../src/auth/command-platform-api.service.ts"; import { CommandSettings } from "../../src/config/command-settings.service.ts"; import { ProjectRefResolver } from "../../src/config/project-ref.service.ts"; diff --git a/apps/cli/tests/helpers/docker-image.ts b/apps/cli/tests/helpers/docker-image.ts index da49b91dee..cf388af81e 100644 --- a/apps/cli/tests/helpers/docker-image.ts +++ b/apps/cli/tests/helpers/docker-image.ts @@ -1,8 +1,8 @@ import { BunServices } from "@effect/platform-bun"; import { Cause, Duration, Effect, Layer } from "effect"; -import * as ChildProcess from "effect/unstable/process/ChildProcess"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerTag } from "effect/unstable/process/ChildProcessSpawner"; +import * as ChildProcess from "effect/process/ChildProcess"; +import { ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerTag } from "effect/process/ChildProcessSpawner"; import { makeDockerImageResolver } from "../../src/command-internal/docker-image-resolve.ts"; diff --git a/apps/cli/tests/helpers/docker-image.unit.test.ts b/apps/cli/tests/helpers/docker-image.unit.test.ts index 2293aca1d8..50830a4cf3 100644 --- a/apps/cli/tests/helpers/docker-image.unit.test.ts +++ b/apps/cli/tests/helpers/docker-image.unit.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Deferred, Effect, Layer, PlatformError, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { runDockerEffect } from "./cli.ts"; diff --git a/apps/cli/tests/helpers/live-project.integration.test.ts b/apps/cli/tests/helpers/live-project.integration.test.ts index be267fa325..3472036075 100644 --- a/apps/cli/tests/helpers/live-project.integration.test.ts +++ b/apps/cli/tests/helpers/live-project.integration.test.ts @@ -1,8 +1,8 @@ import { makeApiClient } from "@supabase/api/effect"; import { Effect, Layer } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { afterEach, describe, expect, it, vi } from "vitest"; import { provisionLiveEnvironment } from "./live-project.ts"; diff --git a/apps/cli/tests/helpers/live-project.ts b/apps/cli/tests/helpers/live-project.ts index ecff21050d..70765ff971 100644 --- a/apps/cli/tests/helpers/live-project.ts +++ b/apps/cli/tests/helpers/live-project.ts @@ -5,7 +5,7 @@ import path from "node:path"; import { makeApiClient, type OperationOutput } from "@supabase/api/effect"; import { Cause, Data, Effect, Exit, Schedule, Schema } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; +import * as HttpClientError from "effect/http/HttpClientError"; import { getDomain } from "tldts"; import { diff --git a/apps/cli/tests/helpers/live-project.unit.test.ts b/apps/cli/tests/helpers/live-project.unit.test.ts index 71932c4847..9d8b712039 100644 --- a/apps/cli/tests/helpers/live-project.unit.test.ts +++ b/apps/cli/tests/helpers/live-project.unit.test.ts @@ -1,7 +1,7 @@ import { Effect } from "effect"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import { describe, expect, it } from "vitest"; import { diff --git a/apps/cli/tests/helpers/local-reset.ts b/apps/cli/tests/helpers/local-reset.ts index 22cce083fc..361f355860 100644 --- a/apps/cli/tests/helpers/local-reset.ts +++ b/apps/cli/tests/helpers/local-reset.ts @@ -1,7 +1,7 @@ import { Effect, Layer, PlatformError, Sink, Stream } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import { ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; /** * A minimal `docker`/`podman` CLI spawner mock + default happy-path route for diff --git a/apps/cli/tests/helpers/notebooks.ts b/apps/cli/tests/helpers/notebooks.ts index 27b5d33b2c..697a79e448 100644 --- a/apps/cli/tests/helpers/notebooks.ts +++ b/apps/cli/tests/helpers/notebooks.ts @@ -1,11 +1,11 @@ import { BunServices } from "@effect/platform-bun"; import { makeApiClient } from "@supabase/api/effect"; import { Effect, FileSystem, Layer, Option, Path, Predicate, Stdio } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import type * as HttpClientError from "effect/unstable/http/HttpClientError"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import * as UrlParams from "effect/unstable/http/UrlParams"; +import * as HttpClient from "effect/http/HttpClient"; +import type * as HttpClientError from "effect/http/HttpClientError"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import * as UrlParams from "effect/http/UrlParams"; import { CommandPlatformApi } from "../../src/auth/command-platform-api.service.ts"; import { ProjectRefNotLinkedError } from "../../src/config/project-ref.errors.ts"; import { ProjectRefResolver } from "../../src/config/project-ref.service.ts"; diff --git a/apps/cli/tests/helpers/storage.ts b/apps/cli/tests/helpers/storage.ts index 95cb7d9854..07a1ebb23a 100644 --- a/apps/cli/tests/helpers/storage.ts +++ b/apps/cli/tests/helpers/storage.ts @@ -3,8 +3,8 @@ import { dirname, join } from "node:path"; import { BunServices } from "@effect/platform-bun"; import { Effect, Layer, Option, Redacted, Stream } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import type { DatabaseInstance, Observation, diff --git a/apps/cli/tests/live-global-setup.ts b/apps/cli/tests/live-global-setup.ts index 40b4d31c57..71dbfc2839 100644 --- a/apps/cli/tests/live-global-setup.ts +++ b/apps/cli/tests/live-global-setup.ts @@ -2,7 +2,7 @@ import type { ProvidedContext } from "vitest"; import { makeApiClient } from "@supabase/api/effect"; import { Effect } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import "./helpers/live-provided-context.ts"; import { cleanupLiveEnvironment, provisionLiveEnvironment } from "./helpers/live-project.ts"; diff --git a/packages/api/src/bun.ts b/packages/api/src/bun.ts index 9b82e3a97c..1b90590435 100644 --- a/packages/api/src/bun.ts +++ b/packages/api/src/bun.ts @@ -1,6 +1,6 @@ import { BunServices } from "@effect/platform-bun"; import { Layer, ManagedRuntime } from "effect"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { makeApiClient, type ApiClient } from "./effect.ts"; import { type SupabaseApiClientOptions, type SupabaseApiConfig } from "./internal/client.ts"; diff --git a/packages/api/src/effect.unit.test.ts b/packages/api/src/effect.unit.test.ts index b495314bab..466a97815a 100644 --- a/packages/api/src/effect.unit.test.ts +++ b/packages/api/src/effect.unit.test.ts @@ -1,10 +1,10 @@ import { describe, expect, test } from "vitest"; import { ConfigProvider, Effect, Layer } from "effect"; import * as Schema from "effect/Schema"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; import { makeApiClient, operationDefinitions } from "./effect.ts"; import { diff --git a/packages/api/src/internal/client.ts b/packages/api/src/internal/client.ts index 440444eabf..bbd8668d50 100644 --- a/packages/api/src/internal/client.ts +++ b/packages/api/src/internal/client.ts @@ -3,11 +3,11 @@ import * as Cause from "effect/Cause"; import * as Redacted from "effect/Redacted"; import type { SchemaError } from "effect/Schema"; import * as Schema from "effect/Schema"; -import * as HttpBody from "effect/unstable/http/HttpBody"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; +import * as HttpBody from "effect/http/HttpBody"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; import type { OperationDefinition, diff --git a/packages/api/src/internal/client.unit.test.ts b/packages/api/src/internal/client.unit.test.ts index cd61dd6f6f..1943eac670 100644 --- a/packages/api/src/internal/client.unit.test.ts +++ b/packages/api/src/internal/client.unit.test.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from "vitest"; import { Effect, Exit, Layer, Option, Redacted } from "effect"; -import * as HttpBody from "effect/unstable/http/HttpBody"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as UrlParams from "effect/unstable/http/UrlParams"; +import * as HttpBody from "effect/http/HttpBody"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as UrlParams from "effect/http/UrlParams"; import * as Schema from "effect/Schema"; import { operationDefinitions } from "../generated/contracts.ts"; diff --git a/packages/api/src/internal/promise-client.unit.test.ts b/packages/api/src/internal/promise-client.unit.test.ts index 9f4f5182a5..3bded77339 100644 --- a/packages/api/src/internal/promise-client.unit.test.ts +++ b/packages/api/src/internal/promise-client.unit.test.ts @@ -1,10 +1,10 @@ import { describe, expect, test } from "vitest"; import { Effect, Layer, ManagedRuntime, Option } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientError from "effect/unstable/http/HttpClientError"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import type * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as UrlParams from "effect/unstable/http/UrlParams"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientError from "effect/http/HttpClientError"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import type * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as UrlParams from "effect/http/UrlParams"; import { makeApiClient } from "../effect.ts"; import { makePromiseClient } from "./promise-client.ts"; diff --git a/packages/api/src/node-lifecycle.integration.test.ts b/packages/api/src/node-lifecycle.integration.test.ts index d9dccde1b2..825d3426f7 100644 --- a/packages/api/src/node-lifecycle.integration.test.ts +++ b/packages/api/src/node-lifecycle.integration.test.ts @@ -2,7 +2,7 @@ import { createServer, type Server } from "node:http"; import type { Socket } from "node:net"; import { describe, expect, test } from "vitest"; import { Effect } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import * as HttpClient from "effect/http/HttpClient"; import { createApiClient as createNodeApiClient } from "./node.ts"; async function startApiServer() { diff --git a/packages/stack/src/HostProcess.integration.test.ts b/packages/stack/src/HostProcess.integration.test.ts index f6a89455ba..c51049d244 100644 --- a/packages/stack/src/HostProcess.integration.test.ts +++ b/packages/stack/src/HostProcess.integration.test.ts @@ -14,10 +14,10 @@ import { Stream, Tracer, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as FetchHttpClient from "effect/http/FetchHttpClient"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- integration verifies exact-port reopening. import * as Net from "node:net"; import { fileURLToPath } from "node:url"; diff --git a/packages/stack/src/HostProcess.ts b/packages/stack/src/HostProcess.ts index 88f34aa4de..8ddd3fc8bb 100644 --- a/packages/stack/src/HostProcess.ts +++ b/packages/stack/src/HostProcess.ts @@ -17,10 +17,10 @@ import { Scope, Stream, } from "effect"; -import * as HttpClient from "effect/unstable/http/HttpClient"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse"; -import { RpcClient, RpcSerialization } from "effect/unstable/rpc"; +import * as HttpClient from "effect/http/HttpClient"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClientResponse from "effect/http/HttpClientResponse"; +import { RpcClient, RpcSerialization } from "effect/rpc"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- Effect ChildProcess cannot hand the owner a log file descriptor or release its lifeline pipe from the event loop. import { spawn, type ChildProcess } from "node:child_process"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- the spawner shares its owner log descriptor with the owner and reads the log tail through it. diff --git a/packages/stack/src/HttpProxy.integration.test.ts b/packages/stack/src/HttpProxy.integration.test.ts index 8e6398d412..5f59391644 100644 --- a/packages/stack/src/HttpProxy.integration.test.ts +++ b/packages/stack/src/HttpProxy.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Data, Deferred, Effect, Fiber, Layer } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { createServer, type Server, type ServerResponse } from "node:http"; // oxlint-disable-line effecttsgo/node-builtin-import -- raw server fixture. import { createServer as createTcpServer, Socket, type Server as NetServer } from "node:net"; // oxlint-disable-line effecttsgo/node-builtin-import -- raw disconnect fixture. // oxlint-disable-next-line effecttsgo/node-builtin-import -- raw WebSocket upgrade fixture. diff --git a/packages/stack/src/Network.integration.test.ts b/packages/stack/src/Network.integration.test.ts index 680424c0ad..ecfdb190ef 100644 --- a/packages/stack/src/Network.integration.test.ts +++ b/packages/stack/src/Network.integration.test.ts @@ -3,7 +3,7 @@ import { expect, it } from "@effect/vitest"; import { Context, Data, Deferred, Effect, Fiber, FileSystem, Layer, Path, Ref } from "effect"; import * as Net from "node:net"; // oxlint-disable-line effecttsgo/node-builtin-import -- fixture retains an idle HTTP connection. import { createServer } from "node:http"; // oxlint-disable-line effecttsgo/node-builtin-import -- real socket fixture. -import { HttpClient } from "effect/unstable/http"; +import { HttpClient } from "effect/http"; import * as Network from "./Network.ts"; import { DOCKER_HOST_ALIAS } from "./runtime/Container.ts"; import * as State from "./State.ts"; diff --git a/packages/stack/src/Owner.analytics.integration.test.ts b/packages/stack/src/Owner.analytics.integration.test.ts index 578c863a83..2921765f51 100644 --- a/packages/stack/src/Owner.analytics.integration.test.ts +++ b/packages/stack/src/Owner.analytics.integration.test.ts @@ -16,7 +16,7 @@ import { Schema, Stream, } from "effect"; -import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http"; import { tmpdir } from "node:os"; import { logflareEvent, logflareSources } from "./host/LogflareEvents.ts"; import * as State from "./State.ts"; diff --git a/packages/stack/src/Owner.integration.test.ts b/packages/stack/src/Owner.integration.test.ts index 029119d629..966f1ee6a8 100644 --- a/packages/stack/src/Owner.integration.test.ts +++ b/packages/stack/src/Owner.integration.test.ts @@ -2,9 +2,9 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { PgClient } from "@effect/sql-pg"; import { expect, it } from "@effect/vitest"; import { Context, Effect, FileSystem, Layer, Redacted, Ref, Schema } from "effect"; -import { HttpClient } from "effect/unstable/http"; +import { HttpClient } from "effect/http"; import { tmpdir } from "node:os"; -import { RpcTest } from "effect/unstable/rpc"; +import { RpcTest } from "effect/rpc"; import * as Owner from "./Owner.ts"; import { OwnerRpc } from "./Rpc.ts"; import * as State from "./State.ts"; diff --git a/packages/stack/src/Owner.ts b/packages/stack/src/Owner.ts index d8549c3956..89dca099a5 100644 --- a/packages/stack/src/Owner.ts +++ b/packages/stack/src/Owner.ts @@ -13,9 +13,9 @@ import { Semaphore, Stream, } from "effect"; -import { HttpClient } from "effect/unstable/http"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import type { Rpc, RpcGroup } from "effect/unstable/rpc"; +import { HttpClient } from "effect/http"; +import { ChildProcessSpawner } from "effect/process"; +import type { Rpc, RpcGroup } from "effect/rpc"; import { failureMessage } from "./internal/failure-message.ts"; import * as Network from "./Network.ts"; import type { NetworkEndpoint, NetworkNamespace } from "./Network.ts"; diff --git a/packages/stack/src/Proxy.integration.test.ts b/packages/stack/src/Proxy.integration.test.ts index e08b81eaa2..0f5431e8f2 100644 --- a/packages/stack/src/Proxy.integration.test.ts +++ b/packages/stack/src/Proxy.integration.test.ts @@ -6,7 +6,7 @@ import { HttpClientRequest, HttpServerRequest, HttpServerResponse, -} from "effect/unstable/http"; +} from "effect/http"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- NodeHttpServer.make requires a native server factory. import * as Http from "node:http"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- raw client and backend fixtures for connection failures. diff --git a/packages/stack/src/Proxy.ts b/packages/stack/src/Proxy.ts index 9ac7018056..eb27dc2799 100644 --- a/packages/stack/src/Proxy.ts +++ b/packages/stack/src/Proxy.ts @@ -1,7 +1,7 @@ import { NodeSink, NodeSocket, NodeSocketServer, NodeStream } from "@effect/platform-node"; import { Data, Effect, Option, Stream } from "effect"; import type { Scope } from "effect"; -import type { SocketServer } from "effect/unstable/socket"; +import type { SocketServer } from "effect/socket"; import * as Net from "node:net"; import { PortError } from "./Ports.ts"; diff --git a/packages/stack/src/Rpc.ts b/packages/stack/src/Rpc.ts index 873f1b7b70..4befcf862c 100644 --- a/packages/stack/src/Rpc.ts +++ b/packages/stack/src/Rpc.ts @@ -1,5 +1,5 @@ import { Exit, Schema } from "effect"; -import { Rpc, RpcGroup } from "effect/unstable/rpc"; +import { Rpc, RpcGroup } from "effect/rpc"; import { ServiceCreation, ServiceCreationInput } from "./services/Catalog.ts"; import { snapshotScopes } from "./services/DatabaseSnapshot.ts"; import { causeMessage, CompositionConfig, OrchestratorError } from "./Orchestrator.ts"; diff --git a/packages/stack/src/StackHost.container-shutdown.integration.test.ts b/packages/stack/src/StackHost.container-shutdown.integration.test.ts index 4c0971f97c..60d0a18f4d 100644 --- a/packages/stack/src/StackHost.container-shutdown.integration.test.ts +++ b/packages/stack/src/StackHost.container-shutdown.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Context, Crypto, Effect, FileSystem, Layer, Path, Redacted, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import * as State from "./State.ts"; import { hasReason, diff --git a/packages/stack/src/StackHost.container-sweep-retry.integration.test.ts b/packages/stack/src/StackHost.container-sweep-retry.integration.test.ts index 5e893aaa75..35ad0909db 100644 --- a/packages/stack/src/StackHost.container-sweep-retry.integration.test.ts +++ b/packages/stack/src/StackHost.container-sweep-retry.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Context, Deferred, Effect, FileSystem, Layer, Sink, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import * as State from "./State.ts"; import * as Owner from "./Owner.ts"; import * as CommandRunner from "./host/CommandRunner.ts"; diff --git a/packages/stack/src/StackHost.integration.test.ts b/packages/stack/src/StackHost.integration.test.ts index 0bb65d4a65..5258b205da 100644 --- a/packages/stack/src/StackHost.integration.test.ts +++ b/packages/stack/src/StackHost.integration.test.ts @@ -15,9 +15,9 @@ import { Schema, Stream, } from "effect"; -import { Rpc, RpcClient, RpcGroup, RpcSerialization } from "effect/unstable/rpc"; -import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"; -import * as HttpClient from "effect/unstable/http/HttpClient"; +import { Rpc, RpcClient, RpcGroup, RpcSerialization } from "effect/rpc"; +import * as HttpClientRequest from "effect/http/HttpClientRequest"; +import * as HttpClient from "effect/http/HttpClient"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- integration observes exact listener closure. import * as Net from "node:net"; import { diff --git a/packages/stack/src/StackHost.ts b/packages/stack/src/StackHost.ts index 23f2a5b813..fb240dfd9f 100644 --- a/packages/stack/src/StackHost.ts +++ b/packages/stack/src/StackHost.ts @@ -23,11 +23,11 @@ import { Semaphore, Path, } from "effect"; -import * as HttpServer from "effect/unstable/http/HttpServer"; -import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest"; -import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse"; -import * as RpcServer from "effect/unstable/rpc/RpcServer"; -import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization"; +import * as HttpServer from "effect/http/HttpServer"; +import * as HttpServerRequest from "effect/http/HttpServerRequest"; +import * as HttpServerResponse from "effect/http/HttpServerResponse"; +import * as RpcServer from "effect/rpc/RpcServer"; +import * as RpcSerialization from "effect/rpc/RpcSerialization"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- NodeHttpServer.make requires a native server factory. import * as Http from "node:http"; import { diff --git a/packages/stack/src/State.process.integration.test.ts b/packages/stack/src/State.process.integration.test.ts index 90dec13572..98241a5d7f 100644 --- a/packages/stack/src/State.process.integration.test.ts +++ b/packages/stack/src/State.process.integration.test.ts @@ -12,7 +12,7 @@ import { Schema, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { fileURLToPath } from "node:url"; import { ownerExitProbe, waitForOwnerExit } from "./HostProcess.ts"; import * as State from "./State.ts"; diff --git a/packages/stack/src/State.windows.integration.test.ts b/packages/stack/src/State.windows.integration.test.ts index cc43a6ca78..ac99fd1c5c 100644 --- a/packages/stack/src/State.windows.integration.test.ts +++ b/packages/stack/src/State.windows.integration.test.ts @@ -12,7 +12,7 @@ import { Ref, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import * as State from "./State.ts"; const saved: State.SavedStack = { diff --git a/packages/stack/src/Sweep.integration.test.ts b/packages/stack/src/Sweep.integration.test.ts index e57462b0f1..cdc2f9174a 100644 --- a/packages/stack/src/Sweep.integration.test.ts +++ b/packages/stack/src/Sweep.integration.test.ts @@ -14,7 +14,7 @@ import { Schema, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { launchHost } from "./HostProcess.ts"; import { makeContainerRuntime } from "./runtime/Container.ts"; import * as State from "./State.ts"; diff --git a/packages/stack/src/composition/Supabase.native.integration.test.ts b/packages/stack/src/composition/Supabase.native.integration.test.ts index fffc8cc9b5..8be4ed3d93 100644 --- a/packages/stack/src/composition/Supabase.native.integration.test.ts +++ b/packages/stack/src/composition/Supabase.native.integration.test.ts @@ -13,7 +13,7 @@ import { Schema, } from "effect"; import { PgClient } from "@effect/sql-pg"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { SignJWT } from "jose"; import { tmpdir } from "node:os"; import * as State from "../State.ts"; diff --git a/packages/stack/src/create.owner-rollback.integration.test.ts b/packages/stack/src/create.owner-rollback.integration.test.ts index 34ab4ff186..799fdd68d3 100644 --- a/packages/stack/src/create.owner-rollback.integration.test.ts +++ b/packages/stack/src/create.owner-rollback.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Effect, Exit, Fiber, FileSystem, Layer, Path } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { create, discover } from "./effect.ts"; import { deriveStackId, resolveStackIdentity } from "./identity/Identity.ts"; diff --git a/packages/stack/src/destroy.runtime-unavailable.integration.test.ts b/packages/stack/src/destroy.runtime-unavailable.integration.test.ts index 595b75a6a5..eeada06c7b 100644 --- a/packages/stack/src/destroy.runtime-unavailable.integration.test.ts +++ b/packages/stack/src/destroy.runtime-unavailable.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Effect, Exit, FileSystem, Layer, Path } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { create, discover } from "./effect.ts"; const layer = Layer.merge(NodeServices.layer, NodeHttpClient.layerNodeHttp); diff --git a/packages/stack/src/effect-timeout.integration.test.ts b/packages/stack/src/effect-timeout.integration.test.ts index 7f8b8a8e4d..94c884bf4c 100644 --- a/packages/stack/src/effect-timeout.integration.test.ts +++ b/packages/stack/src/effect-timeout.integration.test.ts @@ -1,7 +1,7 @@ import { NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Deferred, Effect, Fiber, FileSystem, Path, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { watch } from "node:fs"; // oxlint-disable-line effecttsgo/node-builtin-import -- synchronous watcher subscription must precede child spawn. import { stripVTControlCharacters } from "node:util"; import { fileURLToPath } from "node:url"; diff --git a/packages/stack/src/effect.ts b/packages/stack/src/effect.ts index 19ff8424bf..ccb7ab819c 100644 --- a/packages/stack/src/effect.ts +++ b/packages/stack/src/effect.ts @@ -18,8 +18,8 @@ import { Semaphore, Stream, } from "effect"; -import { HttpClient } from "effect/unstable/http"; -import { RpcClientError } from "effect/unstable/rpc/RpcClientError"; +import { HttpClient } from "effect/http"; +import { RpcClientError } from "effect/rpc/RpcClientError"; import { connectHost, hasReason, diff --git a/packages/stack/src/host/CommandRunner.native-cleanup.integration.test.ts b/packages/stack/src/host/CommandRunner.native-cleanup.integration.test.ts index 240d72a977..20f708cad2 100644 --- a/packages/stack/src/host/CommandRunner.native-cleanup.integration.test.ts +++ b/packages/stack/src/host/CommandRunner.native-cleanup.integration.test.ts @@ -2,7 +2,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Context, Effect, FileSystem, Layer, Path, Stream } from "effect"; import { systemError } from "effect/PlatformError"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { postgres } from "../Commands.ts"; import * as CommandRunner from "./CommandRunner.ts"; diff --git a/packages/stack/src/host/CommandRunner.ts b/packages/stack/src/host/CommandRunner.ts index 1a318c2892..e8fd639a23 100644 --- a/packages/stack/src/host/CommandRunner.ts +++ b/packages/stack/src/host/CommandRunner.ts @@ -13,8 +13,8 @@ import { } from "effect"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- FileSystem has no non-recursive directory removal operation. import { rmdir } from "node:fs/promises"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import { HttpClient } from "effect/unstable/http"; +import { ChildProcessSpawner } from "effect/process"; +import { HttpClient } from "effect/http"; import { slimImageMirrors, prepareNativeArtifact, diff --git a/packages/stack/src/host/LogForwarder.ts b/packages/stack/src/host/LogForwarder.ts index 7fe0c513e8..041c295dde 100644 --- a/packages/stack/src/host/LogForwarder.ts +++ b/packages/stack/src/host/LogForwarder.ts @@ -18,7 +18,7 @@ import { Stream, SubscriptionRef, } from "effect"; -import { HttpClient, HttpClientError, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientError, HttpClientRequest } from "effect/http"; import type { CompositionConfig } from "../Orchestrator.ts"; import type { ServiceObservation } from "../Service.ts"; import type { ServiceCreation } from "../services/Catalog.ts"; diff --git a/packages/stack/src/internal/dispatch.integration.test.ts b/packages/stack/src/internal/dispatch.integration.test.ts index 7a547d4ef4..8d7f8147a2 100644 --- a/packages/stack/src/internal/dispatch.integration.test.ts +++ b/packages/stack/src/internal/dispatch.integration.test.ts @@ -1,7 +1,7 @@ import { NodeServices } from "@effect/platform-node"; import { Context, Data, Effect, FileSystem, Layer, Path, Schema, Stream } from "effect"; import { expect, it } from "@effect/vitest"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { fileURLToPath } from "node:url"; import { HostEndpoint } from "../HostProcess.ts"; import * as State from "../State.ts"; diff --git a/packages/stack/src/lifetime.integration.test.ts b/packages/stack/src/lifetime.integration.test.ts index da1a17a058..10dbf1dd64 100644 --- a/packages/stack/src/lifetime.integration.test.ts +++ b/packages/stack/src/lifetime.integration.test.ts @@ -12,7 +12,7 @@ import { Schema, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { tmpdir } from "node:os"; import { fileURLToPath } from "node:url"; import { create, open } from "./effect.ts"; diff --git a/packages/stack/src/preparation/ArtifactStore.ts b/packages/stack/src/preparation/ArtifactStore.ts index 1b21d3c92e..16c2922a58 100644 --- a/packages/stack/src/preparation/ArtifactStore.ts +++ b/packages/stack/src/preparation/ArtifactStore.ts @@ -9,8 +9,8 @@ import { Predicate, Schema, } from "effect"; -import { HttpClient } from "effect/unstable/http"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { HttpClient } from "effect/http"; +import { ChildProcessSpawner } from "effect/process"; import { ArtifactIntegrityError, PreparationError } from "./Errors.ts"; import { validateRelativePath, validateSha256 } from "./Integrity.ts"; import { restrictDirectoryToOwner } from "../runtime/postgres-user.ts"; diff --git a/packages/stack/src/preparation/SlimServicesSource.ts b/packages/stack/src/preparation/SlimServicesSource.ts index 3f12a10e92..d2f8c3bc7a 100644 --- a/packages/stack/src/preparation/SlimServicesSource.ts +++ b/packages/stack/src/preparation/SlimServicesSource.ts @@ -1,9 +1,9 @@ import { Effect, FileSystem, Path, Ref, Schedule, Schema, Stream } from "effect"; import { NodeStream } from "@effect/platform-node"; -import { HttpClient, HttpClientError } from "effect/unstable/http"; +import { HttpClient, HttpClientError } from "effect/http"; import { createZstdDecompress } from "node:zlib"; import { createHash } from "node:crypto"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { errorChainMessage } from "../internal/error-message.ts"; import type { ArtifactRequest, ArtifactSource } from "./ArtifactStore.ts"; import { PreparationError } from "./Errors.ts"; diff --git a/packages/stack/src/preparation/slim-services.integration.test.ts b/packages/stack/src/preparation/slim-services.integration.test.ts index c321aae3c1..73d815d6a6 100644 --- a/packages/stack/src/preparation/slim-services.integration.test.ts +++ b/packages/stack/src/preparation/slim-services.integration.test.ts @@ -16,7 +16,7 @@ import { // oxlint-disable-next-line effecttsgo/node-builtin-import -- the redirect test owns a local native listener. import { createServer, type Server } from "node:http"; import { zstdCompress } from "node:zlib"; -import { FetchHttpClient } from "effect/unstable/http"; +import { FetchHttpClient } from "effect/http"; import { catalogPins, prepareNativeArtifact, resolveArtifact } from "../Artifacts.ts"; import { makeArtifactStore, type ArtifactRequest, type ArtifactSource } from "./ArtifactStore.ts"; import { digestHex } from "./Integrity.ts"; diff --git a/packages/stack/src/public.e2e.test.ts b/packages/stack/src/public.e2e.test.ts index f8f33a415c..58044e48e4 100644 --- a/packages/stack/src/public.e2e.test.ts +++ b/packages/stack/src/public.e2e.test.ts @@ -1,8 +1,8 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, expectTypeOf, it } from "@effect/vitest"; import { Effect, FileSystem, Layer, Path, Redacted, Schema, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -import { HttpClient } from "effect/unstable/http"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import { HttpClient } from "effect/http"; import { tmpdir } from "node:os"; import { discover, open } from "./effect.ts"; import { postgres } from "./Commands.ts"; diff --git a/packages/stack/src/runtime/Container.integration.test.ts b/packages/stack/src/runtime/Container.integration.test.ts index 9028e812db..b403862a97 100644 --- a/packages/stack/src/runtime/Container.integration.test.ts +++ b/packages/stack/src/runtime/Container.integration.test.ts @@ -19,9 +19,9 @@ import { Stream, } from "effect"; import { TestClock } from "effect/testing"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/unstable/process/ChildProcessSpawner"; -import { HttpClient } from "effect/unstable/http"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/process/ChildProcessSpawner"; +import { HttpClient } from "effect/http"; import { ContainerLaunchError, DOCKER_HOST_ALIAS, diff --git a/packages/stack/src/runtime/Container.ts b/packages/stack/src/runtime/Container.ts index cc0b192d55..8e9eca0be6 100644 --- a/packages/stack/src/runtime/Container.ts +++ b/packages/stack/src/runtime/Container.ts @@ -19,7 +19,7 @@ import { Sink, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { testRunLabelArgs as readTestRunLabelArgs } from "../internal/test-run-label.ts"; import { identifyContainer } from "./ContainerName.ts"; diff --git a/packages/stack/src/runtime/NativeProcess.ts b/packages/stack/src/runtime/NativeProcess.ts index 1826d5ca67..7b401f5a29 100644 --- a/packages/stack/src/runtime/NativeProcess.ts +++ b/packages/stack/src/runtime/NativeProcess.ts @@ -1,13 +1,13 @@ import { Data, Duration, Effect, Fiber, Option, Scope, Sink, Stream } from "effect"; import { fileURLToPath } from "node:url"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import type { PlatformError } from "effect/PlatformError"; import { isBunVirtualPath } from "../internal/dispatch-markers.ts"; import type { ChildProcessHandle, ExitCode, ProcessId, -} from "effect/unstable/process/ChildProcessSpawner"; +} from "effect/process/ChildProcessSpawner"; export interface NativeProcessSpec { readonly executable: string; diff --git a/packages/stack/src/runtime/PostgresDatabaseSession.ts b/packages/stack/src/runtime/PostgresDatabaseSession.ts index 2b3ffce13e..a196b2a6f1 100644 --- a/packages/stack/src/runtime/PostgresDatabaseSession.ts +++ b/packages/stack/src/runtime/PostgresDatabaseSession.ts @@ -1,5 +1,5 @@ import { Effect, Predicate, Redacted, Schema, Scope } from "effect"; -import { isSqlError, type SqlError } from "effect/unstable/sql/SqlError"; +import { isSqlError, type SqlError } from "effect/sql/SqlError"; import { DatabaseBootstrapError, INTERNAL_DATABASE, diff --git a/packages/stack/src/runtime/container-image-mirror.integration.test.ts b/packages/stack/src/runtime/container-image-mirror.integration.test.ts index e528d9d33e..022c3fbee5 100644 --- a/packages/stack/src/runtime/container-image-mirror.integration.test.ts +++ b/packages/stack/src/runtime/container-image-mirror.integration.test.ts @@ -2,7 +2,7 @@ import { NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Fiber, Layer, Option, Sink, Stream } from "effect"; import { TestClock } from "effect/testing"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { makeContainerRuntime } from "./Container.ts"; const primary = "ghcr.io/supabase/cli/postgrest:v16.2"; diff --git a/packages/stack/src/runtime/native-process.integration.test.ts b/packages/stack/src/runtime/native-process.integration.test.ts index 0fef4834c0..d5f7f95b23 100644 --- a/packages/stack/src/runtime/native-process.integration.test.ts +++ b/packages/stack/src/runtime/native-process.integration.test.ts @@ -3,9 +3,9 @@ import { Cause, Deferred, Effect, Exit, Fiber, Option, Ref, Scope, Sink, Stream import * as TestClock from "effect/testing/TestClock"; import { NodeServices } from "@effect/platform-node"; import { systemError, type PlatformError } from "effect/PlatformError"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerType } from "effect/unstable/process/ChildProcessSpawner"; -import type { ExitCode } from "effect/unstable/process/ChildProcessSpawner"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerType } from "effect/process/ChildProcessSpawner"; +import type { ExitCode } from "effect/process/ChildProcessSpawner"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- The test closes inherited fd5 before sending the launch payload and scans exact marker-owned processes for cleanup. import { execFileSync, spawn as spawnProcess } from "node:child_process"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- The test waits for actual inherited-fd and process events. diff --git a/packages/stack/src/runtime/postgres-database-session.integration.test.ts b/packages/stack/src/runtime/postgres-database-session.integration.test.ts index 1a4de7c5b4..c3cf4cd41e 100644 --- a/packages/stack/src/runtime/postgres-database-session.integration.test.ts +++ b/packages/stack/src/runtime/postgres-database-session.integration.test.ts @@ -5,7 +5,7 @@ import { ConnectionError, SqlError, UnknownError, -} from "effect/unstable/sql/SqlError"; +} from "effect/sql/SqlError"; import { ensureInternalDatabase, makeDatabaseSessionFromAcquisition, diff --git a/packages/stack/src/runtime/postgres-user.ts b/packages/stack/src/runtime/postgres-user.ts index b53302bee1..bacf29c2f4 100644 --- a/packages/stack/src/runtime/postgres-user.ts +++ b/packages/stack/src/runtime/postgres-user.ts @@ -1,5 +1,5 @@ import { Config, Effect, FileSystem, Option, Path } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { ServiceError } from "../Service.ts"; /** Names the non-root system user that runs native PostgreSQL when the stack itself runs as root. */ diff --git a/packages/stack/src/services/AnalyticsImgproxy.integration.test.ts b/packages/stack/src/services/AnalyticsImgproxy.integration.test.ts index 9ad83b0bc4..bd266c74b9 100644 --- a/packages/stack/src/services/AnalyticsImgproxy.integration.test.ts +++ b/packages/stack/src/services/AnalyticsImgproxy.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Effect, FileSystem, Layer, Redacted } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { makeService } from "../Service.ts"; import { makeServiceRecipe } from "./Catalog.ts"; import { makeDockerTcpRelay } from "../../tests/docker-relay.ts"; diff --git a/packages/stack/src/services/AuthStorage.integration.test.ts b/packages/stack/src/services/AuthStorage.integration.test.ts index a28f9e6571..8596754be7 100644 --- a/packages/stack/src/services/AuthStorage.integration.test.ts +++ b/packages/stack/src/services/AuthStorage.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Effect, FileSystem, Layer, Redacted, Schema } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { SignJWT } from "jose"; import { makeService } from "../Service.ts"; import { makeServiceRecipe } from "./Catalog.ts"; diff --git a/packages/stack/src/services/Catalog.ts b/packages/stack/src/services/Catalog.ts index c7d9e4375c..e4a4d17e1e 100644 --- a/packages/stack/src/services/Catalog.ts +++ b/packages/stack/src/services/Catalog.ts @@ -1,6 +1,6 @@ import { Crypto, Effect, FileSystem, Path, Ref, Schema } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import { HttpClient } from "effect/unstable/http"; +import { ChildProcessSpawner } from "effect/process"; +import { HttpClient } from "effect/http"; import { makeContainerRuntime } from "../runtime/Container.ts"; import { randomPortSpanStart, reserveNativePort } from "../Ports.ts"; import { ServiceError, type ServiceDefinition } from "../Service.ts"; diff --git a/packages/stack/src/services/Database.ts b/packages/stack/src/services/Database.ts index ea12f21962..b882e79551 100644 --- a/packages/stack/src/services/Database.ts +++ b/packages/stack/src/services/Database.ts @@ -18,9 +18,9 @@ import { Scope, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/unstable/process/ChildProcessSpawner"; -import { HttpClient } from "effect/unstable/http"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/process/ChildProcessSpawner"; +import { HttpClient } from "effect/http"; import { slimImageMirrors, prepareNativeArtifact, diff --git a/packages/stack/src/services/DatabaseSnapshot.integration.test.ts b/packages/stack/src/services/DatabaseSnapshot.integration.test.ts index a89e190335..596ed45108 100644 --- a/packages/stack/src/services/DatabaseSnapshot.integration.test.ts +++ b/packages/stack/src/services/DatabaseSnapshot.integration.test.ts @@ -1,7 +1,7 @@ import { NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Crypto, Data, Effect, Exit, FileSystem, Path, Ref, Schema, Scope, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { postgresVersion, resolveArtifact } from "../Artifacts.ts"; import { makeContainerRuntime } from "../runtime/Container.ts"; import { makeDockerDatabaseStorage } from "../storage/DockerDatabaseStorage.ts"; diff --git a/packages/stack/src/services/DatabaseSnapshot.ts b/packages/stack/src/services/DatabaseSnapshot.ts index eb335fcaa1..c5717377d6 100644 --- a/packages/stack/src/services/DatabaseSnapshot.ts +++ b/packages/stack/src/services/DatabaseSnapshot.ts @@ -14,7 +14,7 @@ import { Schema, } from "effect"; import type { PlatformError } from "effect/PlatformError"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import { postgresVersion } from "../Artifacts.ts"; import { failureMessage } from "../internal/failure-message.ts"; import { copyDirectory, type DirectoryCopyError } from "../storage/DirectoryCopy.ts"; diff --git a/packages/stack/src/services/Functions.integration.test.ts b/packages/stack/src/services/Functions.integration.test.ts index 0b667ca653..b47abeb208 100644 --- a/packages/stack/src/services/Functions.integration.test.ts +++ b/packages/stack/src/services/Functions.integration.test.ts @@ -14,8 +14,8 @@ import { Scope, Stream, } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { HttpClient, HttpClientRequest } from "effect/http"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { ContainerError, type ContainerRuntime } from "../runtime/Container.ts"; import { randomPortSpanStart, reserveNativePort } from "../Ports.ts"; import { makeService } from "../Service.ts"; diff --git a/packages/stack/src/services/Mail.integration.test.ts b/packages/stack/src/services/Mail.integration.test.ts index 1b6b262f88..e7ddef1e3b 100644 --- a/packages/stack/src/services/Mail.integration.test.ts +++ b/packages/stack/src/services/Mail.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Effect, Exit, FileSystem, Layer, Path } from "effect"; -import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http"; import { makeService } from "../Service.ts"; import { makeServiceRecipe } from "./Catalog.ts"; diff --git a/packages/stack/src/services/ProcessRecipe.integration.test.ts b/packages/stack/src/services/ProcessRecipe.integration.test.ts index d91b480694..470b76f8f2 100644 --- a/packages/stack/src/services/ProcessRecipe.integration.test.ts +++ b/packages/stack/src/services/ProcessRecipe.integration.test.ts @@ -17,9 +17,9 @@ import { Stream, } from "effect"; import { TestClock } from "effect/testing"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/unstable/process/ChildProcessSpawner"; +import { HttpClient, HttpClientRequest } from "effect/http"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/process/ChildProcessSpawner"; import { systemError } from "effect/PlatformError"; import * as Net from "node:net"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- the collision fixture owns a local HTTP listener. diff --git a/packages/stack/src/services/ProcessRecipe.ts b/packages/stack/src/services/ProcessRecipe.ts index 1845cef70e..89bdcafe52 100644 --- a/packages/stack/src/services/ProcessRecipe.ts +++ b/packages/stack/src/services/ProcessRecipe.ts @@ -17,9 +17,9 @@ import { Scope, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/unstable/process/ChildProcessSpawner"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { ChildProcessSpawner } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/process/ChildProcessSpawner"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { prepareNativeArtifact, resolveArtifact, type ServiceKind } from "../Artifacts.ts"; import { accepts, type NativePortReservation, type PortError } from "../Ports.ts"; import type * as State from "../State.ts"; diff --git a/packages/stack/src/services/Realtime.integration.test.ts b/packages/stack/src/services/Realtime.integration.test.ts index 06922425c0..cb3a89290d 100644 --- a/packages/stack/src/services/Realtime.integration.test.ts +++ b/packages/stack/src/services/Realtime.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Effect, Layer, Redacted } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { makeService } from "../Service.ts"; import { makeServiceRecipe } from "./Catalog.ts"; import { makeDockerHttpRelay, makeDockerTcpRelay } from "../../tests/docker-relay.ts"; diff --git a/packages/stack/src/services/Rest.integration.test.ts b/packages/stack/src/services/Rest.integration.test.ts index 0f902e8bbe..07325ae4f1 100644 --- a/packages/stack/src/services/Rest.integration.test.ts +++ b/packages/stack/src/services/Rest.integration.test.ts @@ -2,7 +2,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Context, Effect, FileSystem, Layer, Path, Redacted, Ref } from "effect"; import { PgClient } from "@effect/sql-pg"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { SignJWT } from "jose"; import { tmpdir } from "node:os"; import * as Network from "../Network.ts"; diff --git a/packages/stack/src/services/StorageGateway.integration.test.ts b/packages/stack/src/services/StorageGateway.integration.test.ts index 857e6b9460..6b873c2783 100644 --- a/packages/stack/src/services/StorageGateway.integration.test.ts +++ b/packages/stack/src/services/StorageGateway.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Context, Crypto, Effect, FileSystem, Layer, Path, Redacted } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { tmpdir } from "node:os"; import { DEFAULT_LOCAL_S3_ACCESS_KEY_ID, diff --git a/packages/stack/src/shutdown.integration.test.ts b/packages/stack/src/shutdown.integration.test.ts index 905d95750c..877e4bd2ee 100644 --- a/packages/stack/src/shutdown.integration.test.ts +++ b/packages/stack/src/shutdown.integration.test.ts @@ -1,7 +1,7 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Context, Data, Effect, FileSystem, Layer, Option, Schema, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { fileURLToPath } from "node:url"; import * as PromiseStack from "./index.ts"; import { HostEndpoint } from "./HostProcess.ts"; diff --git a/packages/stack/src/storage/DirectoryCopy.integration.test.ts b/packages/stack/src/storage/DirectoryCopy.integration.test.ts index 25114e747a..fee9bbcdc0 100644 --- a/packages/stack/src/storage/DirectoryCopy.integration.test.ts +++ b/packages/stack/src/storage/DirectoryCopy.integration.test.ts @@ -16,7 +16,7 @@ import { Stream, Tracer, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { copyDirectory } from "./DirectoryCopy.ts"; const run = ( diff --git a/packages/stack/src/storage/DirectoryCopy.ts b/packages/stack/src/storage/DirectoryCopy.ts index 12d25998ad..191d1568c0 100644 --- a/packages/stack/src/storage/DirectoryCopy.ts +++ b/packages/stack/src/storage/DirectoryCopy.ts @@ -1,7 +1,7 @@ // oxlint-disable-next-line effecttsgo/node-builtin-import -- FileSystem has no lstat or typed directory listing. import { lstat, readdir } from "node:fs/promises"; import { Cause, Effect, FileSystem, Option, Path, Schema, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; export class DirectoryCopyError extends Schema.TaggedError()( "DirectoryCopyError", diff --git a/packages/stack/src/storage/DockerDatabaseStorage.integration.test.ts b/packages/stack/src/storage/DockerDatabaseStorage.integration.test.ts index 16619a0b77..910fe12743 100644 --- a/packages/stack/src/storage/DockerDatabaseStorage.integration.test.ts +++ b/packages/stack/src/storage/DockerDatabaseStorage.integration.test.ts @@ -18,7 +18,7 @@ import { Ref, Stream, } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { postgresVersion, resolveArtifact } from "../Artifacts.ts"; import { makeContainerRuntime } from "../runtime/Container.ts"; import { makeDatabaseSnapshots } from "../services/DatabaseSnapshot.ts"; diff --git a/packages/stack/src/storage/DockerDatabaseStorage.ts b/packages/stack/src/storage/DockerDatabaseStorage.ts index f35f5d9a4f..f1dc3ab5e2 100644 --- a/packages/stack/src/storage/DockerDatabaseStorage.ts +++ b/packages/stack/src/storage/DockerDatabaseStorage.ts @@ -11,8 +11,8 @@ import { Semaphore, Stream, } from "effect"; -import { ChildProcess } from "effect/unstable/process"; -import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/unstable/process/ChildProcessSpawner"; +import { ChildProcess } from "effect/process"; +import type { ChildProcessSpawner as ChildProcessSpawnerService } from "effect/process/ChildProcessSpawner"; import { postgresVersion, resolveArtifact } from "../Artifacts.ts"; import { failureMessage } from "../internal/failure-message.ts"; import { testRunLabelArgs as readTestRunLabelArgs } from "../internal/test-run-label.ts"; diff --git a/packages/stack/tests/docker-cleanup.ts b/packages/stack/tests/docker-cleanup.ts index cf64d569b6..deae344c61 100644 --- a/packages/stack/tests/docker-cleanup.ts +++ b/packages/stack/tests/docker-cleanup.ts @@ -1,4 +1,4 @@ -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { Effect, Stream } from "effect"; export const cleanupDockerRoot = Effect.fn("DockerTest.cleanupRoot")((root: string) => diff --git a/packages/stack/tests/docker-fixture.integration.test.ts b/packages/stack/tests/docker-fixture.integration.test.ts index 17303cf6ab..1f1160a56f 100644 --- a/packages/stack/tests/docker-fixture.integration.test.ts +++ b/packages/stack/tests/docker-fixture.integration.test.ts @@ -1,7 +1,7 @@ import { PgClient } from "@effect/sql-pg"; import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { Context, Effect, FileSystem, Layer, Redacted, Schema, Stream } from "effect"; import { makeService } from "../src/Service.ts"; import { makeDatabase, type BackendEndpoint } from "../src/services/Database.ts"; diff --git a/packages/stack/tests/docker-fixture.ts b/packages/stack/tests/docker-fixture.ts index a900828687..b609bdbf9f 100644 --- a/packages/stack/tests/docker-fixture.ts +++ b/packages/stack/tests/docker-fixture.ts @@ -1,4 +1,4 @@ -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { Effect, FileSystem, Stream } from "effect"; import { cleanupDockerRoot } from "./docker-cleanup.ts"; diff --git a/packages/stack/tests/docker-volume-run.integration.test.ts b/packages/stack/tests/docker-volume-run.integration.test.ts index 6233923a8f..e86ff1b813 100644 --- a/packages/stack/tests/docker-volume-run.integration.test.ts +++ b/packages/stack/tests/docker-volume-run.integration.test.ts @@ -1,7 +1,7 @@ import { NodeServices } from "@effect/platform-node"; import { describe, expect, it } from "@effect/vitest"; import { Crypto, DateTime, Effect, FileSystem, Path } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { runDocker } from "./docker-fixture.ts"; import { encodeRunMarker, diff --git a/packages/stack/tests/helpers/git.ts b/packages/stack/tests/helpers/git.ts index 439c946cab..2492fd604d 100644 --- a/packages/stack/tests/helpers/git.ts +++ b/packages/stack/tests/helpers/git.ts @@ -1,4 +1,4 @@ -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { Data, Effect, Stream } from "effect"; export class GitSetupError extends Data.TaggedError("GitSetupError")<{ diff --git a/packages/stack/tests/host-process-fixture.ts b/packages/stack/tests/host-process-fixture.ts index f0210334c5..dd2870e395 100644 --- a/packages/stack/tests/host-process-fixture.ts +++ b/packages/stack/tests/host-process-fixture.ts @@ -11,7 +11,7 @@ import { Schema, Stream, } from "effect"; -import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http"; +import { HttpServerRequest, HttpServerResponse } from "effect/http"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- test fixture owns inherited readiness and release descriptors. import { closeSync, createReadStream, writeSync } from "node:fs"; import { currentRelease, launchHost, authorizes, type HostEndpoint } from "../src/HostProcess.ts"; diff --git a/packages/stack/tests/owner-rpc.ts b/packages/stack/tests/owner-rpc.ts index fd8d254423..0c14190088 100644 --- a/packages/stack/tests/owner-rpc.ts +++ b/packages/stack/tests/owner-rpc.ts @@ -1,5 +1,5 @@ import { Context, Effect, Layer } from "effect"; -import { RpcTest } from "effect/unstable/rpc"; +import { RpcTest } from "effect/rpc"; import * as Owner from "../src/Owner.ts"; import { OwnerRpc } from "../src/Rpc.ts"; import { Service as StateService } from "../src/State.ts"; diff --git a/packages/stack/tests/owner.ts b/packages/stack/tests/owner.ts index 1678d75ab4..c34d3492fd 100644 --- a/packages/stack/tests/owner.ts +++ b/packages/stack/tests/owner.ts @@ -1,6 +1,6 @@ import { expect } from "@effect/vitest"; import { Deferred, Effect, Fiber, Option, Predicate, Stream } from "effect"; -import { ChildProcess } from "effect/unstable/process"; +import { ChildProcess } from "effect/process"; import { fileURLToPath } from "node:url"; import { discover, type StackLocations } from "../src/effect.ts"; import { HostProcessError, shutdownHost, type HostAccess } from "../src/HostProcess.ts"; diff --git a/packages/stack/tests/state-lock-fixture.ts b/packages/stack/tests/state-lock-fixture.ts index d78b5d0e24..4b05c32f2c 100644 --- a/packages/stack/tests/state-lock-fixture.ts +++ b/packages/stack/tests/state-lock-fixture.ts @@ -1,6 +1,6 @@ import { NodeServices, NodeSocketServer } from "@effect/platform-node"; import { Console, Effect } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import * as State from "../src/State.ts"; import { isBunVirtualPath } from "../src/internal/dispatch-markers.ts"; import { fileURLToPath } from "node:url"; diff --git a/packages/stack/tests/whole-stack/analytics.ts b/packages/stack/tests/whole-stack/analytics.ts index 898d28acae..d0667834d7 100644 --- a/packages/stack/tests/whole-stack/analytics.ts +++ b/packages/stack/tests/whole-stack/analytics.ts @@ -1,5 +1,5 @@ import { Clock, DateTime, Effect, Schedule, Schema } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; const AnalyticsLog = Schema.Struct({ event_message: Schema.String, diff --git a/packages/stack/tests/whole-stack/fixture.ts b/packages/stack/tests/whole-stack/fixture.ts index c34c578377..11d848303c 100644 --- a/packages/stack/tests/whole-stack/fixture.ts +++ b/packages/stack/tests/whole-stack/fixture.ts @@ -14,7 +14,7 @@ import { } from "effect"; import { postgres } from "../../src/Commands.ts"; import { homedir, tmpdir } from "node:os"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { create, type Stack } from "../../src/effect.ts"; import type { Observation } from "../../src/Rpc.ts"; import { cleanupDockerRoot } from "../docker-cleanup.ts"; diff --git a/packages/stack/tests/whole-stack/idle.ts b/packages/stack/tests/whole-stack/idle.ts index 67e3f46289..665970384a 100644 --- a/packages/stack/tests/whole-stack/idle.ts +++ b/packages/stack/tests/whole-stack/idle.ts @@ -1,7 +1,7 @@ import { expect } from "@effect/vitest"; import { Context, Effect, Fiber, Layer, Redacted, Schema } from "effect"; import { PgClient } from "@effect/sql-pg"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { SignJWT } from "jose"; import { jsonRequest, diff --git a/packages/stack/tests/whole-stack/realtime-mail.ts b/packages/stack/tests/whole-stack/realtime-mail.ts index 8a6e25d7f3..ec58a9c7ee 100644 --- a/packages/stack/tests/whole-stack/realtime-mail.ts +++ b/packages/stack/tests/whole-stack/realtime-mail.ts @@ -1,5 +1,5 @@ import { Effect, Option, Schema, Scope, Stream } from "effect"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { openWebSocket } from "./websocket.ts"; const MailRecipient = Schema.Struct({ Address: Schema.String }); diff --git a/packages/stack/tests/whole-stack/service-flows.ts b/packages/stack/tests/whole-stack/service-flows.ts index df884e15d7..b5a68f592c 100644 --- a/packages/stack/tests/whole-stack/service-flows.ts +++ b/packages/stack/tests/whole-stack/service-flows.ts @@ -1,7 +1,7 @@ import { expect } from "@effect/vitest"; import { Context, Effect, Layer, Redacted, Schema } from "effect"; import { PgClient } from "@effect/sql-pg"; -import { HttpClient, HttpClientRequest } from "effect/unstable/http"; +import { HttpClient, HttpClientRequest } from "effect/http"; import { SignJWT } from "jose"; import { requestWithHeaders, service, type WholeStack } from "./fixture.ts"; diff --git a/packages/stack/tests/whole-stack/websocket.ts b/packages/stack/tests/whole-stack/websocket.ts index 744cb6018c..6622e31421 100644 --- a/packages/stack/tests/whole-stack/websocket.ts +++ b/packages/stack/tests/whole-stack/websocket.ts @@ -1,6 +1,6 @@ import { Deferred, Effect, Queue, Schedule, Schema, Scope } from "effect"; import { NodeSocket } from "@effect/platform-node"; -import * as Socket from "effect/unstable/socket/Socket"; +import * as Socket from "effect/socket/Socket"; class RealtimeProbeError extends Schema.TaggedError()("RealtimeProbeError", { message: Schema.String, diff --git a/packages/stack/tests/whole-stack/workloads.ts b/packages/stack/tests/whole-stack/workloads.ts index da3a1e377d..2a7a899a71 100644 --- a/packages/stack/tests/whole-stack/workloads.ts +++ b/packages/stack/tests/whole-stack/workloads.ts @@ -1,5 +1,5 @@ import { expect } from "@effect/vitest"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { Effect, Schema } from "effect"; import { service, type Runtime, type WholeStack } from "./fixture.ts"; From 2864ed9971b2beae07dad864a505a6bde5229df9 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:29:57 -0700 Subject: [PATCH 03/28] refactor(repo): rename Effect CLI and Config constructors to their PascalCase 4.0 names Flag.string/boolean/integer/choice/choiceWithValue, Argument.string/choice, Primitive.boolean/integer/keyValuePair, GlobalFlag.setting, and Config.string/redacted/literals became String/Boolean/Int/Literals/ChoiceWithValue, KeyValuePair, Setting, and Redacted in effect 4.0.0-rc.113 (effect PRs 7453, 8121). Generated with a perl word-boundary substitution over apps, packages, and tools. Co-Authored-By: Claude Fable 5.1 --- .../cli/src/auth/command-credentials.layer.ts | 4 +- .../cli/boolean-flag-defaults.unit.test.ts | 6 +-- apps/cli/src/cli/complete.ts | 6 +-- apps/cli/src/cli/complete.unit.test.ts | 4 +- .../command-internal/bitbucket-pipeline.ts | 2 +- .../bundled-postgres-client.ts | 2 +- .../src/command-internal/db-config.layer.ts | 2 +- .../command-internal/db-config.toml-read.ts | 2 +- .../src/command-internal/db-target-flags.ts | 4 +- .../db-target-flags.unit.test.ts | 2 +- .../src/command-internal/docker-registry.ts | 2 +- .../command-internal/experimental-feature.ts | 2 +- apps/cli/src/command-internal/global-flags.ts | 44 +++++++++---------- apps/cli/src/command-internal/hostname.ts | 2 +- .../param-introspection.unit.test.ts | 24 +++++----- .../src/command-internal/string-slice-flag.ts | 2 +- .../test-db.command-handler.ts | 10 ++--- .../src/commands/backups/list/list.command.ts | 2 +- .../backups/restore/restore.command.ts | 4 +- .../commands/bootstrap/bootstrap.command.ts | 4 +- .../branches/create/create.command.ts | 16 +++---- .../branches/delete/delete.command.ts | 4 +- .../branches/disable/disable.command.ts | 2 +- .../src/commands/branches/get/get.command.ts | 4 +- .../commands/branches/list/list.command.ts | 2 +- .../commands/branches/pause/pause.command.ts | 4 +- .../branches/unpause/unpause.command.ts | 4 +- .../branches/update/update.command.ts | 14 +++--- .../commands/completion/completion.flags.ts | 4 +- .../src/commands/config/diff/diff.command.ts | 4 +- .../src/commands/config/pull/pull.command.ts | 8 ++-- .../src/commands/config/pull/pull.e2e.test.ts | 2 +- .../src/commands/config/push/push.command.ts | 2 +- .../commands/db/advisors/advisors.command.ts | 14 +++--- .../db/branch/create/create.command.ts | 2 +- .../db/branch/delete/delete.command.ts | 2 +- .../db/branch/switch/switch.command.ts | 2 +- apps/cli/src/commands/db/diff/diff.command.ts | 28 ++++++------ .../commands/db/diff/diff.integration.test.ts | 2 +- apps/cli/src/commands/db/dump/dump.command.ts | 26 +++++------ apps/cli/src/commands/db/dump/dump.handler.ts | 4 +- apps/cli/src/commands/db/lint/lint.command.ts | 16 +++---- apps/cli/src/commands/db/pull/pull.command.ts | 22 +++++----- .../commands/db/pull/pull.integration.test.ts | 2 +- apps/cli/src/commands/db/push/push.command.ts | 20 ++++----- .../src/commands/db/query/query.command.ts | 12 ++--- .../db/remote/changes/changes.command.ts | 8 ++-- .../db/remote/commit/commit.command.ts | 8 ++-- .../src/commands/db/reset/reset.command.ts | 16 +++---- .../src/commands/db/reset/reset.handler.ts | 2 +- .../schema/declarative/declarative.shared.ts | 4 +- .../declarative/generate/generate.command.ts | 16 +++---- .../schema/declarative/sync/sync.command.ts | 10 ++--- apps/cli/src/commands/db/shared/migra.ts | 2 +- .../src/commands/db/start/start.command.ts | 2 +- .../domains/activate/activate.command.ts | 4 +- .../commands/domains/create/create.command.ts | 6 +-- .../commands/domains/delete/delete.command.ts | 4 +- .../src/commands/domains/get/get.command.ts | 4 +- .../domains/reverify/reverify.command.ts | 4 +- .../get-root-key/get-root-key.command.ts | 2 +- .../update-root-key.command.ts | 2 +- .../compute/delete/delete.command.ts | 4 +- .../experimental/compute/list/list.command.ts | 2 +- .../experimental/compute/logs/logs.command.ts | 12 ++--- .../experimental/compute/new/new.command.ts | 12 ++--- .../experimental/compute/push/push.command.ts | 10 ++--- .../compute/status/status.command.ts | 4 +- .../stack/destroy/destroy.command.ts | 4 +- .../experimental/stack/logs/logs.command.ts | 12 ++--- .../stack/prepare/prepare.command.ts | 8 ++-- .../stack/restart/restart.command.ts | 4 +- .../experimental/stack/start/start.command.ts | 10 ++--- .../stack/status/status.command.ts | 6 +-- .../experimental/stack/stop/stop.command.ts | 6 +-- .../src/commands/feedback/add/add.command.ts | 4 +- .../feedback/delete/delete.command.ts | 4 +- .../functions/delete/delete.command.ts | 4 +- .../functions/deploy/deploy.command.ts | 18 ++++---- .../functions/download/download.command.ts | 10 ++--- .../download/download.integration.test.ts | 2 +- .../commands/functions/list/list.command.ts | 2 +- .../src/commands/functions/new/new.command.ts | 4 +- .../commands/functions/serve/serve.command.ts | 16 +++---- .../gen/bearer-jwt/bearer-jwt.command.ts | 10 ++--- .../commands/gen/gen.signing-keys-config.ts | 2 +- .../cli/src/commands/gen/keys/keys.command.ts | 4 +- .../gen/signing-key/signing-key.command.ts | 4 +- .../src/commands/gen/types/types.command.ts | 18 ++++---- .../src/commands/gen/types/types.e2e.test.ts | 6 +-- .../gen/types/types.generator.layer.ts | 2 +- .../src/commands/gen/types/types.languages.ts | 6 +-- .../src/commands/gen/types/types.shared.ts | 2 +- apps/cli/src/commands/init/init.command.ts | 12 ++--- .../commands/inspect/db/inspect-db-command.ts | 8 ++-- .../commands/inspect/report/report.command.ts | 10 ++--- apps/cli/src/commands/issue/issue.command.ts | 6 +-- apps/cli/src/commands/link/link.command.ts | 8 ++-- apps/cli/src/commands/login/login.command.ts | 6 +-- .../commands/migration/down/down.command.ts | 10 ++--- .../commands/migration/fetch/fetch.command.ts | 8 ++-- .../commands/migration/list/list.command.ts | 10 ++--- .../src/commands/migration/new/new.command.ts | 2 +- .../migration/repair/repair.command.ts | 14 +++--- .../migration/squash/squash.command.ts | 12 ++--- .../squash/squash.integration.test.ts | 2 +- .../src/commands/migration/up/up.command.ts | 10 ++--- .../commands/network-bans/get/get.command.ts | 2 +- .../network-bans/remove/remove.command.ts | 2 +- .../network-restrictions/get/get.command.ts | 2 +- .../update/update.command.ts | 6 +-- .../commands/notebooks/pull/pull.command.ts | 4 +- .../commands/notebooks/push/push.command.ts | 4 +- .../commands/orgs/create/create.command.ts | 2 +- .../postgres-config/delete/delete.command.ts | 4 +- .../postgres-config/get/get.command.ts | 2 +- .../postgres-config/update/update.command.ts | 6 +-- .../projects/api-keys/api-keys.command.ts | 4 +- .../projects/create/create.command.ts | 22 +++++----- .../projects/delete/delete.command.ts | 2 +- apps/cli/src/commands/pull/pull.command.ts | 10 ++--- .../src/commands/secrets/list/list.command.ts | 2 +- .../src/commands/secrets/set/set.command.ts | 6 +-- .../commands/secrets/unset/unset.command.ts | 4 +- .../commands/seed/buckets/buckets.command.ts | 2 +- apps/cli/src/commands/seed/seed.flags.ts | 8 ++-- .../snippets/download/download.command.ts | 4 +- .../commands/snippets/list/list.command.ts | 2 +- .../ssl-enforcement/get/get.command.ts | 2 +- .../ssl-enforcement/update/update.command.ts | 6 +-- apps/cli/src/commands/sso/add/add.command.ts | 14 +++--- .../cli/src/commands/sso/info/info.command.ts | 2 +- .../cli/src/commands/sso/list/list.command.ts | 2 +- .../src/commands/sso/remove/remove.command.ts | 4 +- .../cli/src/commands/sso/show/show.command.ts | 6 +-- apps/cli/src/commands/sso/sso.e2e.test.ts | 2 +- .../src/commands/sso/update/update.command.ts | 14 +++--- apps/cli/src/commands/start/start.command.ts | 4 +- .../cli/src/commands/status/status.command.ts | 2 +- apps/cli/src/commands/stop/stop.command.ts | 10 ++--- .../cli/src/commands/storage/cp/cp.command.ts | 16 +++---- .../cli/src/commands/storage/ls/ls.command.ts | 4 +- .../cli/src/commands/storage/mv/mv.command.ts | 6 +-- .../cli/src/commands/storage/rm/rm.command.ts | 4 +- .../cli/src/commands/storage/storage.flags.ts | 6 +-- apps/cli/src/commands/test/new/new.command.ts | 4 +- .../activate/activate.command.ts | 4 +- .../check-availability.command.ts | 4 +- .../delete/delete.command.ts | 2 +- .../vanity-subdomains/get/get.command.ts | 2 +- apps/cli/src/config/command-settings.layer.ts | 14 +++--- apps/cli/src/docs/docs-introspection.ts | 2 +- apps/cli/src/docs/docs-spec.unit.test.ts | 2 +- .../src/shared/cli/run.integration.test.ts | 8 ++-- apps/cli/src/shared/cli/run.unit.test.ts | 2 +- .../subcommand-flag-suggestions.unit.test.ts | 4 +- .../src/shared/compute/compute-runtimes.ts | 2 +- .../src/shared/config/cli-settings.layer.ts | 20 ++++----- apps/cli/src/shared/functions/deploy.ts | 2 +- apps/cli/src/shared/functions/serve.main.ts | 18 ++++---- apps/cli/src/shared/git/git-branch.ts | 2 +- apps/cli/src/shared/issue/issue-url.ts | 4 +- .../output/normalize-error.unit.test.ts | 2 +- apps/cli/src/shared/runtime/browser.layer.ts | 2 +- apps/cli/src/shared/services/slim-images.ts | 2 +- .../error-tag-stability.unit.test.ts | 2 +- .../src/shared/telemetry/posthog-config.ts | 2 +- .../cli/src/shared/telemetry/runtime.layer.ts | 2 +- .../shared/telemetry/trace-export.layer.ts | 2 +- apps/cli/src/telemetry/analytics.layer.ts | 6 +-- apps/cli/src/telemetry/command-telemetry.ts | 10 ++--- .../telemetry/command-telemetry.unit.test.ts | 26 +++++------ packages/api/src/config/api-config.layer.ts | 4 +- packages/stack/src/functions/serve.main.ts | 22 +++++----- packages/stack/src/internal/test-run-label.ts | 2 +- packages/stack/src/runtime/native-launcher.ts | 2 +- packages/stack/src/runtime/postgres-user.ts | 2 +- packages/stack/src/testing.ts | 2 +- .../stack/tests/effect-timeout.fixture.ts | 2 +- 179 files changed, 584 insertions(+), 584 deletions(-) diff --git a/apps/cli/src/auth/command-credentials.layer.ts b/apps/cli/src/auth/command-credentials.layer.ts index 8701566a7c..df08dad47c 100644 --- a/apps/cli/src/auth/command-credentials.layer.ts +++ b/apps/cli/src/auth/command-credentials.layer.ts @@ -402,7 +402,7 @@ export const accessTokenForProfile = Effect.fn("CommandCredentials.accessTokenFo return Option.some(cliSettings.accessToken.value); } - const noKeyring = yield* Config.option(Config.string("SUPABASE_NO_KEYRING")).parse( + const noKeyring = yield* Config.option(Config.String("SUPABASE_NO_KEYRING")).parse( configProvider, ); const keyringModule = yield* loadKeyringModule(fs, noKeyring); @@ -435,7 +435,7 @@ const makeCommandCredentials = Effect.gen(function* () { const runtimeInfo = yield* RuntimeInfo; const cliSettings = yield* CommandSettings; const configProvider = yield* ConfigProvider.ConfigProvider; - const noKeyring = yield* Config.option(Config.string("SUPABASE_NO_KEYRING")).parse( + const noKeyring = yield* Config.option(Config.String("SUPABASE_NO_KEYRING")).parse( configProvider, ); const debugLogger = yield* DebugLogger; diff --git a/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts b/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts index 8ae23b6905..c3e6284563 100644 --- a/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts +++ b/apps/cli/src/cli/boolean-flag-defaults.unit.test.ts @@ -9,7 +9,7 @@ import { unwrapParam } from "../command-internal/param-introspection.ts"; import { rootCommandForFeatures } from "./root.ts"; /** - * `Flag.boolean(name)` alone builds a required param, so omitting it fails the whole command + * `Flag.Boolean(name)` alone builds a required param, so omitting it fails the whole command * with a missing-flag error before the handler runs — every boolean flag must pair with * `Flag.withDefault(false)` or `Flag.optional`. No other test catches this: handler integration * tests build their flags record directly, bypassing the parser, and the type checker can't see @@ -17,11 +17,11 @@ import { rootCommandForFeatures } from "./root.ts"; */ /** - * Uses `Primitive.getTypeName(Primitive.boolean)` rather than the literal `"boolean"`, so a + * Uses `Primitive.getTypeName(Primitive.Boolean)` rather than the literal `"boolean"`, so a * rename upstream breaks loudly instead of silently matching nothing and passing every command. * Avoids `primitiveType._tag` to keep this guard off effect's runtime representation. */ -const BOOLEAN_TYPE_NAME = Primitive.getTypeName(Primitive.boolean); +const BOOLEAN_TYPE_NAME = Primitive.getTypeName(Primitive.Boolean); function booleanFlagsRequiringAValue(command: Command.Command.Any): ReadonlyArray { const internals = commandInternals(command); diff --git a/apps/cli/src/cli/complete.ts b/apps/cli/src/cli/complete.ts index 93a03c758e..9b00b0de35 100644 --- a/apps/cli/src/cli/complete.ts +++ b/apps/cli/src/cli/complete.ts @@ -461,8 +461,8 @@ function hasUnconsumedFlagTerminator( /** * Flags whose real validation rejects a leading `-`/`+`, unlike this tree's plain signed - * `Flag.integer`/`Flag.string` declarations — checked before `primitiveTag` dispatch since - * `storage cp --jobs` is declared as `Flag.string`. Key = `:`. + * `Flag.Int`/`Flag.String` declarations — checked before `primitiveTag` dispatch since + * `storage cp --jobs` is declared as `Flag.String`. Key = `:`. */ const COMPLETION_UINT_FLAGS: ReadonlySet = new Set([ "functions deploy:jobs", @@ -473,7 +473,7 @@ const COMPLETION_UINT_FLAGS: ReadonlySet = new Set([ /** * Flags validated against Go duration syntax (see `isValidGoDuration`) rather than this - * tree's plain `Flag.string` declarations. + * tree's plain `Flag.String` declarations. */ const COMPLETION_DURATION_FLAGS: ReadonlySet = new Set([ "gen types:query-timeout", diff --git a/apps/cli/src/cli/complete.unit.test.ts b/apps/cli/src/cli/complete.unit.test.ts index 9e38f872b2..f14b19c49a 100644 --- a/apps/cli/src/cli/complete.unit.test.ts +++ b/apps/cli/src/cli/complete.unit.test.ts @@ -511,7 +511,7 @@ describe("respondToComplete", () => { { path: ["db", "reset"], flag: "last" }, ])("rejects a negative value for $path --$flag", ({ path, flag }) => { // These flags are validated as unsigned integers, which reject a leading sign, - // unlike this tree's plain signed Flag.integer regex. + // unlike this tree's plain signed Flag.Int regex. const result = respondToComplete(rootCommand, ["__complete", ...path, `--${flag}`, "-1", ""]); expect(result).toEqual({ candidates: [], directive: CompletionDirective.Default }); }); @@ -593,7 +593,7 @@ describe("respondToComplete", () => { it("rejects a value one past int64 max for a plain (non-uint) integer flag", () => { // Validated against the signed int64 range, which is narrower than the uint64 - // bound `Flag.integer` alone would suggest. + // bound `Flag.Int` alone would suggest. const overflow = respondToComplete(rootCommand, [ "__complete", "backups", diff --git a/apps/cli/src/command-internal/bitbucket-pipeline.ts b/apps/cli/src/command-internal/bitbucket-pipeline.ts index 90dd3a67c0..025aa9446f 100644 --- a/apps/cli/src/command-internal/bitbucket-pipeline.ts +++ b/apps/cli/src/command-internal/bitbucket-pipeline.ts @@ -14,7 +14,7 @@ export const bitbucketCloneDir = Effect.fnUntraced(function* ( const projectValue = Option.fromNullishOr(projectEnvValues[BITBUCKET_CLONE_DIR_ENV_KEY]); if (Option.isSome(projectValue)) return projectValue; } - return yield* Config.option(Config.string(BITBUCKET_CLONE_DIR_ENV_KEY)); + return yield* Config.option(Config.String(BITBUCKET_CLONE_DIR_ENV_KEY)); }); /** Returns whether a non-empty Bitbucket marker disables restricted Docker options. */ diff --git a/apps/cli/src/command-internal/bundled-postgres-client.ts b/apps/cli/src/command-internal/bundled-postgres-client.ts index 8fd768d47c..5110fc6fe7 100644 --- a/apps/cli/src/command-internal/bundled-postgres-client.ts +++ b/apps/cli/src/command-internal/bundled-postgres-client.ts @@ -135,7 +135,7 @@ const nativeRun = Effect.fn("BundledPostgresClient.nativeRun")(function* ( const tool = ["pg_dump", "pg_dumpall", "pg_prove", "psql"].includes(command) ? path.join(artifactRoot, "bin", command) : command; - const inheritedPath = yield* Config.option(Config.string("PATH")).pipe( + const inheritedPath = yield* Config.option(Config.String("PATH")).pipe( Effect.mapError(mapSpawnError), ); const env = { diff --git a/apps/cli/src/command-internal/db-config.layer.ts b/apps/cli/src/command-internal/db-config.layer.ts index c4c5ff6f96..04ec9f4a8e 100644 --- a/apps/cli/src/command-internal/db-config.layer.ts +++ b/apps/cli/src/command-internal/db-config.layer.ts @@ -214,7 +214,7 @@ const resolveDbPassword = Effect.fnUntraced(function* ( const fs = yield* FileSystem.FileSystem; const path = yield* Path.Path; const projectEnv = yield* loadProjectEnv(fs, path, workdir); - const ambientPassword = yield* Config.option(Config.string("SUPABASE_DB_PASSWORD")); + const ambientPassword = yield* Config.option(Config.String("SUPABASE_DB_PASSWORD")); return ( Option.getOrUndefined(passwordFlag) ?? Option.getOrUndefined(ambientPassword) ?? diff --git a/apps/cli/src/command-internal/db-config.toml-read.ts b/apps/cli/src/command-internal/db-config.toml-read.ts index 60bcd879d9..d57b79e257 100644 --- a/apps/cli/src/command-internal/db-config.toml-read.ts +++ b/apps/cli/src/command-internal/db-config.toml-read.ts @@ -762,7 +762,7 @@ export const resolveSeedSqlPath = (pathSvc: Path.Path, pattern: string): string const DEFAULT_SUPABASE_ENV = "development"; export const configEnvOption = Effect.fnUntraced(function* (name: string) { - return yield* Config.option(Config.string(name)).pipe( + return yield* Config.option(Config.String(name)).pipe( Effect.mapError( () => new DbConfigLoadError({ message: `failed to resolve environment variable: ${name}` }), ), diff --git a/apps/cli/src/command-internal/db-target-flags.ts b/apps/cli/src/command-internal/db-target-flags.ts index 035d2546fe..8622d8e393 100644 --- a/apps/cli/src/command-internal/db-target-flags.ts +++ b/apps/cli/src/command-internal/db-target-flags.ts @@ -44,11 +44,11 @@ export const VALUE_CONSUMING_LONG_FLAGS = new Set([ "password", // inspect report flag "output-dir", - // storage cp command flags (Flag.string / Flag.integer) + // storage cp command flags (Flag.String / Flag.Int) "cache-control", "content-type", "jobs", - // global flags (Flag.string / Flag.choice) + // global flags (Flag.String / Flag.Literals) "output", "output-format", "profile", diff --git a/apps/cli/src/command-internal/db-target-flags.unit.test.ts b/apps/cli/src/command-internal/db-target-flags.unit.test.ts index bc7f841570..fc72b4fcdd 100644 --- a/apps/cli/src/command-internal/db-target-flags.unit.test.ts +++ b/apps/cli/src/command-internal/db-target-flags.unit.test.ts @@ -210,7 +210,7 @@ describe("VALUE_CONSUMING_LONG_FLAGS / VALUE_CONSUMING_SHORT_FLAGS completeness const current = calls[i]!; if (!VALUE_FLAG_KINDS.includes(current.kind)) continue; - // Name declared as a literal string (e.g. `Flag.string("schema")`); a name passed as an + // Name declared as a literal string (e.g. `Flag.String("schema")`); a name passed as an // identifier doesn't match and is silently skipped — see INDIRECT_NAME_FILES above. const remainder = source.slice(current.index); const nameMatch = remainder.match(/^Flag\.\w+\(\s*"([a-zA-Z0-9-]+)"/); diff --git a/apps/cli/src/command-internal/docker-registry.ts b/apps/cli/src/command-internal/docker-registry.ts index 598aea9b27..186b825de3 100644 --- a/apps/cli/src/command-internal/docker-registry.ts +++ b/apps/cli/src/command-internal/docker-registry.ts @@ -44,7 +44,7 @@ const registryOverride = Effect.fnUntraced(function* ( }), ambient, ); - return yield* Config.option(Config.string(INTERNAL_IMAGE_REGISTRY_ENV)).pipe( + return yield* Config.option(Config.String(INTERNAL_IMAGE_REGISTRY_ENV)).pipe( Effect.provideService(ConfigProvider.ConfigProvider, provider), Effect.map(Option.map((value) => value.trim().toLowerCase())), ); diff --git a/apps/cli/src/command-internal/experimental-feature.ts b/apps/cli/src/command-internal/experimental-feature.ts index cf43e986b0..1eba2f160d 100644 --- a/apps/cli/src/command-internal/experimental-feature.ts +++ b/apps/cli/src/command-internal/experimental-feature.ts @@ -80,7 +80,7 @@ export const experimentalFeatureEnv = ( Effect.gen(function* () { const envName = `SUPABASE_EXPERIMENTAL_${feature.toUpperCase()}`; const provider = yield* ConfigProvider.ConfigProvider; - const override = yield* Config.option(Config.string(envName)) + const override = yield* Config.option(Config.String(envName)) .parse(provider) .pipe(Effect.orElseSucceed(() => Option.none())); return { [envName]: Option.getOrUndefined(override) }; diff --git a/apps/cli/src/command-internal/global-flags.ts b/apps/cli/src/command-internal/global-flags.ts index 8ecee8224b..ff560e41a6 100644 --- a/apps/cli/src/command-internal/global-flags.ts +++ b/apps/cli/src/command-internal/global-flags.ts @@ -27,8 +27,8 @@ export const GLOBAL_OUTPUT_FORMATS = [ "csv", ] as const; -export const OutputFlag = GlobalFlag.setting("output")({ - flag: Flag.choice("output", GLOBAL_OUTPUT_FORMATS).pipe( +export const OutputFlag = GlobalFlag.Setting("output")({ + flag: Flag.Literals("output", GLOBAL_OUTPUT_FORMATS).pipe( Flag.withAlias("o"), Flag.withDescription("output format of status variables"), Flag.optional, @@ -41,29 +41,29 @@ export const OutputFlag = GlobalFlag.setting("output")({ * A value-taking global flag must also be registered in `PERSISTENT_VALUE_FLAG_NAMES` * (`shared/cli/cobra-flag-groups.ts`), or the pre-parse argv scanners won't consume its value. */ -export const OutputFormatFlag = GlobalFlag.setting("output-format")({ - flag: Flag.choice("output-format", ["text", "json", "stream-json"]).pipe( +export const OutputFormatFlag = GlobalFlag.Setting("output-format")({ + flag: Flag.Literals("output-format", ["text", "json", "stream-json"]).pipe( Flag.withDescription("Output format: text (default), json, or stream-json (NDJSON)"), Flag.optional, ), }); -export const ProfileFlag = GlobalFlag.setting("profile")({ - flag: Flag.string("profile").pipe( +export const ProfileFlag = GlobalFlag.Setting("profile")({ + flag: Flag.String("profile").pipe( Flag.withDescription("use a specific profile for connecting to Supabase API"), Flag.withDefault("supabase"), ), }); -export const DebugFlag = GlobalFlag.setting("debug")({ - flag: Flag.boolean("debug").pipe( +export const DebugFlag = GlobalFlag.Setting("debug")({ + flag: Flag.Boolean("debug").pipe( Flag.withDescription("output debug logs to stderr"), Flag.withDefault(false), ), }); -export const WorkdirFlag = GlobalFlag.setting("workdir")({ - flag: Flag.string("workdir").pipe( +export const WorkdirFlag = GlobalFlag.Setting("workdir")({ + flag: Flag.String("workdir").pipe( Flag.withDescription( "path to the directory containing your supabase/ folder; used exactly as given, with no ancestor directory search (defaults to searching upward from the current directory)", ), @@ -71,43 +71,43 @@ export const WorkdirFlag = GlobalFlag.setting("workdir")({ ), }); -export const ExperimentalFlag = GlobalFlag.setting("experimental")({ - flag: Flag.boolean("experimental").pipe( +export const ExperimentalFlag = GlobalFlag.Setting("experimental")({ + flag: Flag.Boolean("experimental").pipe( Flag.withDescription("enable experimental features"), Flag.withDefault(false), ), }); -export const NetworkIdFlag = GlobalFlag.setting("network-id")({ - flag: Flag.string("network-id").pipe( +export const NetworkIdFlag = GlobalFlag.Setting("network-id")({ + flag: Flag.String("network-id").pipe( Flag.withDescription("use the specified docker network instead of a generated one"), Flag.optional, ), }); -export const YesFlag = GlobalFlag.setting("yes")({ - flag: Flag.boolean("yes").pipe( +export const YesFlag = GlobalFlag.Setting("yes")({ + flag: Flag.Boolean("yes").pipe( Flag.withDescription("answer yes to all prompts"), Flag.withDefault(false), ), }); -export const DnsResolverFlag = GlobalFlag.setting("dns-resolver")({ - flag: Flag.choice("dns-resolver", ["native", "https"] as const).pipe( +export const DnsResolverFlag = GlobalFlag.Setting("dns-resolver")({ + flag: Flag.Literals("dns-resolver", ["native", "https"] as const).pipe( Flag.withDescription("lookup domain names using the specified resolver"), Flag.withDefault("native" as const), ), }); -export const CreateTicketFlag = GlobalFlag.setting("create-ticket")({ - flag: Flag.boolean("create-ticket").pipe( +export const CreateTicketFlag = GlobalFlag.Setting("create-ticket")({ + flag: Flag.Boolean("create-ticket").pipe( Flag.withDescription("create a support ticket for any CLI error"), Flag.withDefault(false), ), }); -export const AgentFlag = GlobalFlag.setting("agent")({ - flag: Flag.choice("agent", ["auto", "yes", "no"] as const).pipe( +export const AgentFlag = GlobalFlag.Setting("agent")({ + flag: Flag.Literals("agent", ["auto", "yes", "no"] as const).pipe( Flag.withDescription("Override agent detection: yes, no, or auto (default auto)"), Flag.withDefault("auto" as const), ), diff --git a/apps/cli/src/command-internal/hostname.ts b/apps/cli/src/command-internal/hostname.ts index f4c8acda48..9d1a7ac23a 100644 --- a/apps/cli/src/command-internal/hostname.ts +++ b/apps/cli/src/command-internal/hostname.ts @@ -15,7 +15,7 @@ const envOption = ( const projectValue = Option.fromNullishOr(projectEnvValues?.[name]); return Option.isSome(projectValue) ? Effect.succeed(projectValue) - : Config.option(Config.string(name)); + : Config.option(Config.String(name)); }; const dockerConfigDir = ( diff --git a/apps/cli/src/command-internal/param-introspection.unit.test.ts b/apps/cli/src/command-internal/param-introspection.unit.test.ts index fa4129a2e2..12b541c3a6 100644 --- a/apps/cli/src/command-internal/param-introspection.unit.test.ts +++ b/apps/cli/src/command-internal/param-introspection.unit.test.ts @@ -5,7 +5,7 @@ import { unwrapParam, unwrapToSingleParam } from "./param-introspection.ts"; describe("unwrapParam", () => { it("unwraps a plain, required flag with isOptional/isVariadic both false and variadicMin 0", () => { - const result = unwrapParam(Flag.string("custom-hostname")); + const result = unwrapParam(Flag.String("custom-hostname")); expect(result?.single.name).toBe("custom-hostname"); expect(result?.isOptional).toBe(false); expect(result?.isVariadic).toBe(false); @@ -13,26 +13,26 @@ describe("unwrapParam", () => { }); it("marks a Flag.optional-wrapped flag as isOptional", () => { - const result = unwrapParam(Flag.string("desired-subdomain").pipe(Flag.optional)); + const result = unwrapParam(Flag.String("desired-subdomain").pipe(Flag.optional)); expect(result?.single.name).toBe("desired-subdomain"); expect(result?.isOptional).toBe(true); }); it("marks a Flag.withDefault-wrapped flag as isOptional (composes as Map(Optional(Single)))", () => { - const result = unwrapParam(Flag.string("profile").pipe(Flag.withDefault("supabase"))); + const result = unwrapParam(Flag.String("profile").pipe(Flag.withDefault("supabase"))); expect(result?.single.name).toBe("profile"); expect(result?.isOptional).toBe(true); }); it("does not mark a plain boolean flag as isOptional (booleans default to false unwrapped)", () => { - const result = unwrapParam(Flag.boolean("debug")); + const result = unwrapParam(Flag.Boolean("debug")); expect(result?.single.name).toBe("debug"); expect(result?.isOptional).toBe(false); expect(result?.single.primitiveType._tag).toBe("Boolean"); }); it("marks a zero-minimum variadic flag (Flag.atLeast(0)) as variadic but NOT optional, with variadicMin 0", () => { - const result = unwrapParam(Flag.string("domains").pipe(Flag.atLeast(0))); + const result = unwrapParam(Flag.String("domains").pipe(Flag.atLeast(0))); expect(result?.single.name).toBe("domains"); expect(result?.isOptional).toBe(false); expect(result?.isVariadic).toBe(true); @@ -40,26 +40,26 @@ describe("unwrapParam", () => { }); it("captures a positive variadic minimum (Flag.atLeast(2))", () => { - const result = unwrapParam(Flag.string("source").pipe(Flag.atLeast(2))); + const result = unwrapParam(Flag.String("source").pipe(Flag.atLeast(2))); expect(result?.isVariadic).toBe(true); expect(result?.variadicMin).toBe(2); }); it("captures the minimum from Flag.between", () => { - const result = unwrapParam(Flag.string("host").pipe(Flag.between(1, 3))); + const result = unwrapParam(Flag.String("host").pipe(Flag.between(1, 3))); expect(result?.isVariadic).toBe(true); expect(result?.variadicMin).toBe(1); }); it("reports variadicMin 0 for an unbounded Flag.atMost (no minimum set)", () => { - const result = unwrapParam(Flag.string("warning").pipe(Flag.atMost(3))); + const result = unwrapParam(Flag.String("warning").pipe(Flag.atMost(3))); expect(result?.isVariadic).toBe(true); expect(result?.variadicMin).toBe(0); }); it("walks through a chained Map after Optional (Flag.withDefault on a choice flag)", () => { const result = unwrapParam( - Flag.choice("dns-resolver", ["native", "https"] as const).pipe(Flag.withDefault("native")), + Flag.Literals("dns-resolver", ["native", "https"] as const).pipe(Flag.withDefault("native")), ); expect(result?.single.name).toBe("dns-resolver"); expect(result?.isOptional).toBe(true); @@ -67,7 +67,7 @@ describe("unwrapParam", () => { }); it("preserves aliases and hidden metadata on the underlying Single", () => { - const result = unwrapParam(Flag.string("type").pipe(Flag.withAlias("t"), Flag.withHidden)); + const result = unwrapParam(Flag.String("type").pipe(Flag.withAlias("t"), Flag.withHidden)); expect(result?.single.aliases).toEqual(["t"]); expect(result?.single.hidden).toBe(true); }); @@ -75,12 +75,12 @@ describe("unwrapParam", () => { describe("unwrapToSingleParam", () => { it("returns just the underlying Single, discarding optional/variadic metadata", () => { - const single = unwrapToSingleParam(Flag.string("role").pipe(Flag.optional)); + const single = unwrapToSingleParam(Flag.String("role").pipe(Flag.optional)); expect(single?.name).toBe("role"); }); it("agrees with unwrapParam's own .single for the same input", () => { - const param = Flag.string("status").pipe(Flag.atLeast(0)); + const param = Flag.String("status").pipe(Flag.atLeast(0)); expect(unwrapToSingleParam(param)).toBe(unwrapParam(param)?.single); }); }); diff --git a/apps/cli/src/command-internal/string-slice-flag.ts b/apps/cli/src/command-internal/string-slice-flag.ts index 589b2e6f78..bff8a3827b 100644 --- a/apps/cli/src/command-internal/string-slice-flag.ts +++ b/apps/cli/src/command-internal/string-slice-flag.ts @@ -256,7 +256,7 @@ export function stringSliceFlag( ) { const alias = options?.alias; const pflagName = alias === undefined ? `--${name}` : `-${alias}, --${name}`; - const base = Flag.string(name).pipe(Flag.withDescription(description), Flag.atLeast(0)); + const base = Flag.String(name).pipe(Flag.withDescription(description), Flag.atLeast(0)); return (alias === undefined ? base : base.pipe(Flag.withAlias(alias))).pipe( Flag.mapTryCatch( (rawValues) => parseStringSliceFlag(rawValues), diff --git a/apps/cli/src/command-internal/test-db.command-handler.ts b/apps/cli/src/command-internal/test-db.command-handler.ts index ae03a35e2c..f923bd1132 100644 --- a/apps/cli/src/command-internal/test-db.command-handler.ts +++ b/apps/cli/src/command-internal/test-db.command-handler.ts @@ -38,26 +38,26 @@ const onRunFailure = (error: TestDbRunError | TestDbNoTestsError) => * families — see "Hoist Before You Duplicate" in `apps/cli/CLAUDE.md`. */ export const testDbConfig = { - paths: Argument.string("path").pipe( + paths: Argument.String("path").pipe( Argument.withDescription("Paths to test files or directories."), Argument.variadic(), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Tests the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Runs pgTAP tests on the linked project."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Runs pgTAP tests on the local database."), Flag.withDefault(false), ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/backups/list/list.command.ts b/apps/cli/src/commands/backups/list/list.command.ts index 1df7b6d88a..069efa6a50 100644 --- a/apps/cli/src/commands/backups/list/list.command.ts +++ b/apps/cli/src/commands/backups/list/list.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { backupsList } from "./list.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/backups/restore/restore.command.ts b/apps/cli/src/commands/backups/restore/restore.command.ts index 492083bd58..d15aed8db9 100644 --- a/apps/cli/src/commands/backups/restore/restore.command.ts +++ b/apps/cli/src/commands/backups/restore/restore.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { backupsRestore } from "./restore.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - timestamp: Flag.integer("timestamp").pipe( + timestamp: Flag.Int("timestamp").pipe( Flag.withAlias("t"), Flag.withDescription("The recovery time target in seconds since epoch."), Flag.optional, diff --git a/apps/cli/src/commands/bootstrap/bootstrap.command.ts b/apps/cli/src/commands/bootstrap/bootstrap.command.ts index eceec912a2..e277b96f81 100644 --- a/apps/cli/src/commands/bootstrap/bootstrap.command.ts +++ b/apps/cli/src/commands/bootstrap/bootstrap.command.ts @@ -9,11 +9,11 @@ import { bootstrapRuntimeLayer } from "./bootstrap.layers.ts"; import { bootstrap } from "./bootstrap.handler.ts"; const config = { - template: Argument.string("template").pipe( + template: Argument.String("template").pipe( Argument.withDescription("Name of the starter template to bootstrap from."), Argument.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withDescription("Password to your remote Postgres database."), Flag.withAlias("p"), Flag.optional, diff --git a/apps/cli/src/commands/branches/create/create.command.ts b/apps/cli/src/commands/branches/create/create.command.ts index a0f79f05f9..20cd15af79 100644 --- a/apps/cli/src/commands/branches/create/create.command.ts +++ b/apps/cli/src/commands/branches/create/create.command.ts @@ -51,37 +51,37 @@ const BRANCH_SIZES = [ ] as const; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription("Name for the new branch."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - region: Flag.choice("region", BRANCH_REGIONS).pipe( + region: Flag.Literals("region", BRANCH_REGIONS).pipe( Flag.withDescription("Select a region to deploy the branch database."), Flag.optional, ), - size: Flag.choice("size", BRANCH_SIZES).pipe( + size: Flag.Literals("size", BRANCH_SIZES).pipe( Flag.withDescription("Select a desired instance size for the branch database."), Flag.optional, ), // Optional so the handler can distinguish "flag explicitly set false" from "flag absent": // `--persistent`/`--no-persistent` set `Option.some(true|false)`; absent stays `Option.none()`. - persistent: Flag.boolean("persistent").pipe( + persistent: Flag.Boolean("persistent").pipe( Flag.withDescription("Whether to create a persistent branch."), Flag.optional, ), - withData: Flag.boolean("with-data").pipe( + withData: Flag.Boolean("with-data").pipe( Flag.withDescription("Whether to clone production data to the branch database."), Flag.optional, ), - notifyUrl: Flag.string("notify-url").pipe( + notifyUrl: Flag.String("notify-url").pipe( Flag.withDescription("URL to notify when branch is active healthy."), Flag.optional, ), - gitBranch: Flag.string("git-branch").pipe( + gitBranch: Flag.String("git-branch").pipe( Flag.withDescription("Associate a git branch with the new preview branch."), Flag.optional, ), diff --git a/apps/cli/src/commands/branches/delete/delete.command.ts b/apps/cli/src/commands/branches/delete/delete.command.ts index b11930970f..d2a8d7a42c 100644 --- a/apps/cli/src/commands/branches/delete/delete.command.ts +++ b/apps/cli/src/commands/branches/delete/delete.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { branchesDelete } from "./delete.handler.ts"; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription("Branch name or ID to delete."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/branches/disable/disable.command.ts b/apps/cli/src/commands/branches/disable/disable.command.ts index 3492e32e3b..ed13186d2f 100644 --- a/apps/cli/src/commands/branches/disable/disable.command.ts +++ b/apps/cli/src/commands/branches/disable/disable.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { branchesDisable } from "./disable.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/branches/get/get.command.ts b/apps/cli/src/commands/branches/get/get.command.ts index 81788f04d8..5d6b0a34e7 100644 --- a/apps/cli/src/commands/branches/get/get.command.ts +++ b/apps/cli/src/commands/branches/get/get.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { branchesGet } from "./get.handler.ts"; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription("Branch name or ID."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/branches/list/list.command.ts b/apps/cli/src/commands/branches/list/list.command.ts index 3d27ee0552..2b15000ace 100644 --- a/apps/cli/src/commands/branches/list/list.command.ts +++ b/apps/cli/src/commands/branches/list/list.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { branchesList } from "./list.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/branches/pause/pause.command.ts b/apps/cli/src/commands/branches/pause/pause.command.ts index f00fff5069..5361025bbe 100644 --- a/apps/cli/src/commands/branches/pause/pause.command.ts +++ b/apps/cli/src/commands/branches/pause/pause.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { branchesPause } from "./pause.handler.ts"; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription("Branch name or ID to pause."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/branches/unpause/unpause.command.ts b/apps/cli/src/commands/branches/unpause/unpause.command.ts index d5c71a3686..66ede0fb27 100644 --- a/apps/cli/src/commands/branches/unpause/unpause.command.ts +++ b/apps/cli/src/commands/branches/unpause/unpause.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { branchesUnpause } from "./unpause.handler.ts"; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription("Branch name or ID to unpause."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/branches/update/update.command.ts b/apps/cli/src/commands/branches/update/update.command.ts index 5896d2dad7..29c2a265c9 100644 --- a/apps/cli/src/commands/branches/update/update.command.ts +++ b/apps/cli/src/commands/branches/update/update.command.ts @@ -15,30 +15,30 @@ const BRANCH_STATUSES = [ ] as const; const config = { - branchId: Argument.string("name").pipe( + branchId: Argument.String("name").pipe( Argument.withDescription("Branch name or ID to update."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - name: Flag.string("name").pipe(Flag.withDescription("Rename the preview branch."), Flag.optional), - gitBranch: Flag.string("git-branch").pipe( + name: Flag.String("name").pipe(Flag.withDescription("Rename the preview branch."), Flag.optional), + gitBranch: Flag.String("git-branch").pipe( Flag.withDescription("Change the associated git branch."), Flag.optional, ), // Optional so the handler can distinguish "explicit false" (demote to // ephemeral) from "absent". - persistent: Flag.boolean("persistent").pipe( + persistent: Flag.Boolean("persistent").pipe( Flag.withDescription("Switch between ephemeral and persistent branch."), Flag.optional, ), - status: Flag.choice("status", BRANCH_STATUSES).pipe( + status: Flag.Literals("status", BRANCH_STATUSES).pipe( Flag.withDescription("Override the current branch status."), Flag.optional, ), - notifyUrl: Flag.string("notify-url").pipe( + notifyUrl: Flag.String("notify-url").pipe( Flag.withDescription("URL to notify when branch is active healthy."), Flag.optional, ), diff --git a/apps/cli/src/commands/completion/completion.flags.ts b/apps/cli/src/commands/completion/completion.flags.ts index 4bd5a7cc6d..d1c1f8bade 100644 --- a/apps/cli/src/commands/completion/completion.flags.ts +++ b/apps/cli/src/commands/completion/completion.flags.ts @@ -3,10 +3,10 @@ import { Flag } from "effect/cli"; /** * `--no-descriptions` flag shared by all four completion subcommands. * - * `Flag.boolean` auto-derives a `--no-no-descriptions` negation from the name, which + * `Flag.Boolean` auto-derives a `--no-no-descriptions` negation from the name, which * harmlessly resolves back to the same `false` default. */ -export const CompletionNoDescriptionsFlagDef = Flag.boolean("no-descriptions").pipe( +export const CompletionNoDescriptionsFlagDef = Flag.Boolean("no-descriptions").pipe( Flag.withDescription("disable completion descriptions"), Flag.withDefault(false), ); diff --git a/apps/cli/src/commands/config/diff/diff.command.ts b/apps/cli/src/commands/config/diff/diff.command.ts index 60e4610e6d..b81367f6ec 100644 --- a/apps/cli/src/commands/config/diff/diff.command.ts +++ b/apps/cli/src/commands/config/diff/diff.command.ts @@ -11,13 +11,13 @@ import { configDiff } from "./diff.handler.ts"; const config = { // Accepts either a project ref or a branch of the linked project; no separate `--target` flag. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription( "Project ref of the Supabase project, or the name (or UUID) of one of its branches. Values that are exactly 20 lowercase letters are always treated as project refs.", ), Flag.optional, ), - exitCode: Flag.boolean("exit-code").pipe( + exitCode: Flag.Boolean("exit-code").pipe( Flag.withDescription( "Exit with status 2 when any difference is found (errors keep exiting 1).", ), diff --git a/apps/cli/src/commands/config/pull/pull.command.ts b/apps/cli/src/commands/config/pull/pull.command.ts index a7ef981151..e9791ab60c 100644 --- a/apps/cli/src/commands/config/pull/pull.command.ts +++ b/apps/cli/src/commands/config/pull/pull.command.ts @@ -13,24 +13,24 @@ import { configPull } from "./pull.handler.ts"; const config = { // Accepts either a project ref or a branch name/UUID of the linked project; there's no // separate --target flag. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription( "Project ref of the Supabase project, or the name (or UUID) of one of its branches. Values that are exactly 20 lowercase letters are always treated as project refs.", ), Flag.optional, ), - remoteLabel: Flag.string("remote-label").pipe( + remoteLabel: Flag.String("remote-label").pipe( Flag.withDescription( "Name of the [remotes.*] block to write into, overriding the block config pull would otherwise reuse or create.", ), Flag.optional, ), - dryRun: Flag.boolean("dry-run").pipe( + dryRun: Flag.Boolean("dry-run").pipe( Flag.withDescription("Show what would be written without touching the config file."), // Without an explicit default, a boolean flag is required by the parser. Flag.withDefault(false), ), - force: Flag.boolean("force").pipe( + force: Flag.Boolean("force").pipe( Flag.withDescription("Write even when supabase/config.toml has uncommitted changes in git."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/config/pull/pull.e2e.test.ts b/apps/cli/src/commands/config/pull/pull.e2e.test.ts index 5d387efd8f..6effc6cae6 100644 --- a/apps/cli/src/commands/config/pull/pull.e2e.test.ts +++ b/apps/cli/src/commands/config/pull/pull.e2e.test.ts @@ -17,7 +17,7 @@ const TEST_REF = "abcdefghijklmnopqrst"; describe("config pull CLI surface", () => { it.live("plain `config pull` parses — no boolean flag is accidentally required", () => Effect.gen(function* () { - // A Flag.boolean without Flag.withDefault(false) is a required flag, so a missing default + // A Flag.Boolean without Flag.withDefault(false) is a required flag, so a missing default // on --dry-run/--force would fail plain `supabase config pull`. Integration tests hand the // handler pre-built flags and never exercise the parser, so this needs pinning at the // subprocess boundary. diff --git a/apps/cli/src/commands/config/push/push.command.ts b/apps/cli/src/commands/config/push/push.command.ts index 0a3a4c3357..ee172e7858 100644 --- a/apps/cli/src/commands/config/push/push.command.ts +++ b/apps/cli/src/commands/config/push/push.command.ts @@ -13,7 +13,7 @@ import { configPush } from "./push.handler.ts"; const config = { // Accepts either a project ref or a branch name/UUID of the linked project; there's no // separate --target flag. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription( "Project ref of the Supabase project, or the name (or UUID) of one of its branches. Values that are exactly 20 lowercase letters are always treated as project refs.", ), diff --git a/apps/cli/src/commands/db/advisors/advisors.command.ts b/apps/cli/src/commands/db/advisors/advisors.command.ts index ef2b095053..5c6895540f 100644 --- a/apps/cli/src/commands/db/advisors/advisors.command.ts +++ b/apps/cli/src/commands/db/advisors/advisors.command.ts @@ -6,34 +6,34 @@ import { dbAdvisors } from "./advisors.handler.ts"; import { dbAdvisorsRuntimeLayer } from "./advisors.layers.ts"; const config = { - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Checks the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Checks the linked project for issues."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Checks the local database for issues."), Flag.withDefault(false), ), // Overrides the linked project ref; the same flag exists on `config push`. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - type: Flag.choice("type", ["all", "security", "performance"] as const).pipe( + type: Flag.Literals("type", ["all", "security", "performance"] as const).pipe( Flag.withDescription("Type of advisors to check: all, security, performance."), Flag.optional, ), - level: Flag.choice("level", ["info", "warn", "error"] as const).pipe( + level: Flag.Literals("level", ["info", "warn", "error"] as const).pipe( Flag.withDescription("Minimum issue level to display: info, warn, error."), Flag.optional, ), - failOn: Flag.choice("fail-on", ["none", "info", "warn", "error"] as const).pipe( + failOn: Flag.Literals("fail-on", ["none", "info", "warn", "error"] as const).pipe( Flag.withDescription("Issue level to exit with non-zero status: none, info, warn, error."), Flag.optional, ), diff --git a/apps/cli/src/commands/db/branch/create/create.command.ts b/apps/cli/src/commands/db/branch/create/create.command.ts index ddbc5ff3a8..f9836dfe91 100644 --- a/apps/cli/src/commands/db/branch/create/create.command.ts +++ b/apps/cli/src/commands/db/branch/create/create.command.ts @@ -3,7 +3,7 @@ import type * as CliCommand from "effect/cli/Command"; import { dbBranchCreate } from "./create.handler.ts"; const config = { - branchName: Argument.string("branch name").pipe( + branchName: Argument.String("branch name").pipe( Argument.withDescription("Name for the new branch."), ), } as const; diff --git a/apps/cli/src/commands/db/branch/delete/delete.command.ts b/apps/cli/src/commands/db/branch/delete/delete.command.ts index 93a06da6be..c54de6514a 100644 --- a/apps/cli/src/commands/db/branch/delete/delete.command.ts +++ b/apps/cli/src/commands/db/branch/delete/delete.command.ts @@ -3,7 +3,7 @@ import type * as CliCommand from "effect/cli/Command"; import { dbBranchDelete } from "./delete.handler.ts"; const config = { - branchName: Argument.string("branch name").pipe( + branchName: Argument.String("branch name").pipe( Argument.withDescription("Name of the branch to delete."), ), } as const; diff --git a/apps/cli/src/commands/db/branch/switch/switch.command.ts b/apps/cli/src/commands/db/branch/switch/switch.command.ts index 82c83a6f14..277b2a8d38 100644 --- a/apps/cli/src/commands/db/branch/switch/switch.command.ts +++ b/apps/cli/src/commands/db/branch/switch/switch.command.ts @@ -3,7 +3,7 @@ import type * as CliCommand from "effect/cli/Command"; import { dbBranchSwitch } from "./switch.handler.ts"; const config = { - branchName: Argument.string("branch name").pipe( + branchName: Argument.String("branch name").pipe( Argument.withDescription("Name of the branch to switch to."), ), } as const; diff --git a/apps/cli/src/commands/db/diff/diff.command.ts b/apps/cli/src/commands/db/diff/diff.command.ts index 9be489b526..3e7b1da8a6 100644 --- a/apps/cli/src/commands/db/diff/diff.command.ts +++ b/apps/cli/src/commands/db/diff/diff.command.ts @@ -11,15 +11,15 @@ const config = { // The four engine flags are a mutually-exclusive group, and `--use-migra` defaults to true, so // they are modelled as `Option` to track whether the flag was passed: the mutex check and // `resolveDiffEngine`'s `useMigraChanged` key off whether it was passed, not its value. - useMigra: Flag.boolean("use-migra").pipe( + useMigra: Flag.Boolean("use-migra").pipe( Flag.withDescription("Use migra to generate schema diff."), Flag.optional, ), - usePgAdmin: Flag.boolean("use-pgadmin").pipe( + usePgAdmin: Flag.Boolean("use-pgadmin").pipe( Flag.withDescription("Use pgAdmin to generate schema diff."), Flag.optional, ), - usePgSchema: Flag.boolean("use-pg-schema").pipe( + usePgSchema: Flag.Boolean("use-pg-schema").pipe( // Deprecated in favor of the pg-delta engine (or the default migra engine): pg-schema-diff // has no TS/container equivalent, so this stays proxied — see SIDE_EFFECTS.md. This // description-only notice isn't enforced by the flag framework; see diff.handler.ts's @@ -29,32 +29,32 @@ const config = { ), Flag.optional, ), - usePgDelta: Flag.boolean("use-pg-delta").pipe( + usePgDelta: Flag.Boolean("use-pg-delta").pipe( Flag.withDescription("Use pg-delta to generate schema diff."), Flag.optional, ), - strictCoverage: Flag.boolean("strict-coverage").pipe( + strictCoverage: Flag.Boolean("strict-coverage").pipe( Flag.withDescription( "Fail when bundled pg-delta finds schema objects it cannot manage instead of leaving them unmanaged.", ), Flag.withDefault(false), ), - from: Flag.string("from").pipe( + from: Flag.String("from").pipe( Flag.withDescription("Diff from local, linked, migrations, or a Postgres URL."), Flag.optional, ), - to: Flag.string("to").pipe( + to: Flag.String("to").pipe( Flag.withDescription("Diff to local, linked, migrations, or a Postgres URL."), Flag.optional, ), - output: Flag.string("output").pipe( + output: Flag.String("output").pipe( Flag.withAlias("o"), Flag.withDescription( "Write flattened explicit diff SQL to a file for review; this is not a portable apply script.", ), Flag.optional, ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Diffs against the database specified by the connection string (must be percent-encoded).", ), @@ -63,27 +63,27 @@ const config = { // The target flags form a mutually-exclusive group; modelled as `Option` so // the mutex check tracks whether a flag was passed. `--local` defaults to true // via the target resolver's fall-through. - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Diffs local migration files against the linked project."), Flag.optional, ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Diffs local migration files against the local database."), Flag.optional, ), // Overrides the linked project ref; the same flag exists on `config push`. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - file: Flag.string("file").pipe( + file: Flag.String("file").pipe( Flag.withAlias("f"), Flag.withDescription( "In normal mode, names and saves the complete schema diff as a new migration; it does not filter objects. Ignored with --from/--to.", ), Flag.optional, ), - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), diff --git a/apps/cli/src/commands/db/diff/diff.integration.test.ts b/apps/cli/src/commands/db/diff/diff.integration.test.ts index 04b7923751..58857f31ae 100644 --- a/apps/cli/src/commands/db/diff/diff.integration.test.ts +++ b/apps/cli/src/commands/db/diff/diff.integration.test.ts @@ -2210,7 +2210,7 @@ describe("db diff", () => { pgadminStdout: [JSON.stringify([pgadminEntry()])], }); const ambientRegistry = () => - Config.option(Config.string("SUPABASE_INTERNAL_IMAGE_REGISTRY")).pipe( + Config.option(Config.String("SUPABASE_INTERNAL_IMAGE_REGISTRY")).pipe( Effect.provideService( ConfigProvider.ConfigProvider, ConfigProvider.fromEnv({ preserveEmptyStrings: true }), diff --git a/apps/cli/src/commands/db/dump/dump.command.ts b/apps/cli/src/commands/db/dump/dump.command.ts index 89b118da02..42abd7d09f 100644 --- a/apps/cli/src/commands/db/dump/dump.command.ts +++ b/apps/cli/src/commands/db/dump/dump.command.ts @@ -27,22 +27,22 @@ const onRunFailure = (error: DbDumpRunError) => }); const config = { - dryRun: Flag.boolean("dry-run").pipe( + dryRun: Flag.Boolean("dry-run").pipe( Flag.withDescription("Prints the pg_dump script that would be executed."), Flag.withDefault(false), ), // Mutually-exclusive-group flags (data-only/role-only/keep-comments, and the // db-url/linked/local target group) are modelled as `Option` so presence, not // value, drives validation — `--data-only=false` still counts as set. - dataOnly: Flag.boolean("data-only").pipe( + dataOnly: Flag.Boolean("data-only").pipe( Flag.withDescription("Dumps only data records."), Flag.optional, ), - useCopy: Flag.boolean("use-copy").pipe( + useCopy: Flag.Boolean("use-copy").pipe( Flag.withDescription("Use copy statements in place of inserts."), Flag.withDefault(false), ), - exclude: Flag.string("exclude").pipe( + exclude: Flag.String("exclude").pipe( Flag.withAlias("x"), Flag.withDescription("List of schema.tables to exclude from data-only dump."), Flag.atLeast(0), @@ -52,44 +52,44 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - roleOnly: Flag.boolean("role-only").pipe( + roleOnly: Flag.Boolean("role-only").pipe( Flag.withDescription("Dumps only cluster roles."), Flag.optional, ), - keepComments: Flag.boolean("keep-comments").pipe( + keepComments: Flag.Boolean("keep-comments").pipe( Flag.withDescription("Keeps commented lines from pg_dump output."), Flag.optional, ), - file: Flag.string("file").pipe( + file: Flag.String("file").pipe( Flag.withAlias("f"), Flag.withDescription("File path to save the dumped contents."), Flag.optional, ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Dumps from the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Dumps from the linked project."), Flag.optional, ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Dumps from the local database."), Flag.optional, ), // TS-only override of the linked project ref — see push.command.ts. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, ), - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), diff --git a/apps/cli/src/commands/db/dump/dump.handler.ts b/apps/cli/src/commands/db/dump/dump.handler.ts index c4d32a5dc9..292001b0bf 100644 --- a/apps/cli/src/commands/db/dump/dump.handler.ts +++ b/apps/cli/src/commands/db/dump/dump.handler.ts @@ -339,8 +339,8 @@ export const dbDump = Effect.fn("db.dump")(function* (flags: DbDumpFlags) { runtimeInfo.platform === "win32" && tty.stdoutIsPipe && Option.isNone(resolvedFile) && - Option.getOrElse(yield* Config.option(Config.string("MSYSTEM")), () => "") === "" && - Option.getOrUndefined(yield* Config.option(Config.string("TERM_PROGRAM"))) !== "mintty"; + Option.getOrElse(yield* Config.option(Config.String("MSYSTEM")), () => "") === "" && + Option.getOrUndefined(yield* Config.option(Config.String("TERM_PROGRAM"))) !== "mintty"; let sawNonAscii = false; // Open (create + truncate) the output file up front so an unwritable diff --git a/apps/cli/src/commands/db/lint/lint.command.ts b/apps/cli/src/commands/db/lint/lint.command.ts index b8900989e8..b99cbe438e 100644 --- a/apps/cli/src/commands/db/lint/lint.command.ts +++ b/apps/cli/src/commands/db/lint/lint.command.ts @@ -7,26 +7,26 @@ import { dbLint } from "./lint.handler.ts"; import { dbLintRuntimeLayer } from "./lint.layers.ts"; const config = { - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Lints the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Lints the linked project for schema errors."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Lints the local database for schema errors."), Flag.withDefault(false), ), // TS-only override of the linked project ref — see push.command.ts. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), @@ -35,11 +35,11 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - level: Flag.choice("level", ["warning", "error"] as const).pipe( + level: Flag.Literals("level", ["warning", "error"] as const).pipe( Flag.withDescription("Error level to emit."), Flag.optional, ), - failOn: Flag.choice("fail-on", ["none", "warning", "error"] as const).pipe( + failOn: Flag.Literals("fail-on", ["none", "warning", "error"] as const).pipe( Flag.withDescription("Error level to exit with non-zero status."), Flag.optional, ), @@ -62,7 +62,7 @@ export const dbLintCommand = Command.make("lint", config).pipe( level: flags.level, "fail-on": flags.failOn, }, - // level/fail-on are auto-detected as safe (Flag.choice); --schema and + // level/fail-on are auto-detected as safe (Flag.Literals); --schema and // --project-ref stay redacted (no established safelist). config, aliases: { s: "schema" }, diff --git a/apps/cli/src/commands/db/pull/pull.command.ts b/apps/cli/src/commands/db/pull/pull.command.ts index 498664c3e4..be949df21d 100644 --- a/apps/cli/src/commands/db/pull/pull.command.ts +++ b/apps/cli/src/commands/db/pull/pull.command.ts @@ -8,37 +8,37 @@ import { dbPull } from "./pull.handler.ts"; import { dbPullRuntimeLayer } from "./pull.layers.ts"; const config = { - name: Argument.string("migration name").pipe( + name: Argument.String("migration name").pipe( Argument.withDescription("Optional name for the migration file."), Argument.optional, ), // `--declarative` and the deprecated `--use-pg-delta` both select declarative // export and are mutually exclusive with `--diff-engine`. Optional so the // mutex tracks whether the flag was passed. - declarative: Flag.boolean("declarative").pipe( + declarative: Flag.Boolean("declarative").pipe( Flag.withDescription( "Replace the declarative schema tree from the selected database instead of creating a migration; migration history is not updated.", ), Flag.optional, ), - usePgDelta: Flag.boolean("use-pg-delta").pipe( + usePgDelta: Flag.Boolean("use-pg-delta").pipe( Flag.withDescription("Use pg-delta to pull declarative schema."), // Hidden: Effect V4 has no `Flag.withDeprecated`; the handler prints // cobra's deprecation line. Flag.withHidden, Flag.optional, ), - diffEngine: Flag.choice("diff-engine", ["migra", "pg-delta"] as const).pipe( + diffEngine: Flag.Literals("diff-engine", ["migra", "pg-delta"] as const).pipe( Flag.withDescription("Diff engine to use for migration-style db pull."), Flag.optional, ), - strictCoverage: Flag.boolean("strict-coverage").pipe( + strictCoverage: Flag.Boolean("strict-coverage").pipe( Flag.withDescription( "Fail when bundled pg-delta finds schema objects it cannot manage instead of leaving them unmanaged.", ), Flag.withDefault(false), ), - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), @@ -47,26 +47,26 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Pulls from the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Pulls from the linked project."), Flag.optional, ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Pulls from the local database."), Flag.optional, ), // TS-only override of the linked project ref — see push.command.ts. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, diff --git a/apps/cli/src/commands/db/pull/pull.integration.test.ts b/apps/cli/src/commands/db/pull/pull.integration.test.ts index 9bb877ffbe..29e8887c59 100644 --- a/apps/cli/src/commands/db/pull/pull.integration.test.ts +++ b/apps/cli/src/commands/db/pull/pull.integration.test.ts @@ -188,7 +188,7 @@ function setup(workdir: string, opts: SetupOpts = {}) { } const stdout = opts.edgeStdout ?? ""; if (stdout.trim().length === 0) { - return Config.option(Config.string("PGDELTA_DEBUG")).pipe( + return Config.option(Config.String("PGDELTA_DEBUG")).pipe( Effect.provideService( ConfigProvider.ConfigProvider, ConfigProvider.fromEnv({ preserveEmptyStrings: true }), diff --git a/apps/cli/src/commands/db/push/push.command.ts b/apps/cli/src/commands/db/push/push.command.ts index 1729ea98d5..623008cbe8 100644 --- a/apps/cli/src/commands/db/push/push.command.ts +++ b/apps/cli/src/commands/db/push/push.command.ts @@ -7,39 +7,39 @@ import { dbPush } from "./push.handler.ts"; import { dbPushRuntimeLayer } from "./push.layers.ts"; const config = { - includeAll: Flag.boolean("include-all").pipe( + includeAll: Flag.Boolean("include-all").pipe( Flag.withDescription("Include all migrations not found on remote history table."), Flag.withDefault(false), ), - includeRoles: Flag.boolean("include-roles").pipe( + includeRoles: Flag.Boolean("include-roles").pipe( Flag.withDescription("Include custom roles from supabase/roles.sql."), Flag.withDefault(false), ), - includeSeed: Flag.boolean("include-seed").pipe( + includeSeed: Flag.Boolean("include-seed").pipe( Flag.withDescription("Include seed data from your config."), Flag.withDefault(false), ), - skipVault: Flag.boolean("skip-vault").pipe( + skipVault: Flag.Boolean("skip-vault").pipe( Flag.withDescription("Skip updating vault secrets from config.toml."), Flag.withDefault(false), ), - dryRun: Flag.boolean("dry-run").pipe( + dryRun: Flag.Boolean("dry-run").pipe( Flag.withDescription( "Print the migrations that would be applied, but don't actually apply them.", ), Flag.withDefault(false), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Pushes to the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Pushes to the linked project."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Pushes to the local database."), Flag.withDefault(false), ), @@ -48,11 +48,11 @@ const config = { // container ids or the pg-delta project id (see `db-config.types.ts`'s // `linkedProjectRef` doc) — and is rejected outright on a non-linked target rather // than silently ignored (see the handler's guard). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, diff --git a/apps/cli/src/commands/db/query/query.command.ts b/apps/cli/src/commands/db/query/query.command.ts index a056a440a9..c3812830ae 100644 --- a/apps/cli/src/commands/db/query/query.command.ts +++ b/apps/cli/src/commands/db/query/query.command.ts @@ -14,32 +14,32 @@ import { dbQueryRuntimeLayer } from "./query.layers.ts"; * defaults by agent mode (JSON for agents, table for humans) when unset. See SIDE_EFFECTS.md. */ const config = { - sql: Argument.string("sql").pipe( + sql: Argument.String("sql").pipe( Argument.withDescription("SQL query to execute."), Argument.optional, ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Queries the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), // Selects the linked path by presence, not value, so `--linked=false` still selects it. - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Queries the linked project's database via Management API."), Flag.optional, ), // In the same mutually-exclusive target group as `--db-url`/`--linked`, keyed off explicit // presence, so `--local=false` still counts as an explicit target in the conflict check. - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Queries the local database."), Flag.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - file: Flag.string("file").pipe( + file: Flag.String("file").pipe( Flag.withAlias("f"), Flag.withDescription("Path to a SQL file to execute."), Flag.optional, diff --git a/apps/cli/src/commands/db/remote/changes/changes.command.ts b/apps/cli/src/commands/db/remote/changes/changes.command.ts index d7a5629b04..790306ca50 100644 --- a/apps/cli/src/commands/db/remote/changes/changes.command.ts +++ b/apps/cli/src/commands/db/remote/changes/changes.command.ts @@ -3,20 +3,20 @@ import type * as CliCommand from "effect/cli/Command"; import { dbRemoteChanges } from "./changes.handler.ts"; const config = { - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription("Connect using the specified Postgres URL (must be percent-encoded)."), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Connect to the linked project."), Flag.withDefault(false), ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, diff --git a/apps/cli/src/commands/db/remote/commit/commit.command.ts b/apps/cli/src/commands/db/remote/commit/commit.command.ts index 5dacbe9014..47016f3f17 100644 --- a/apps/cli/src/commands/db/remote/commit/commit.command.ts +++ b/apps/cli/src/commands/db/remote/commit/commit.command.ts @@ -8,7 +8,7 @@ import { dbSchemaPullRuntimeLayer } from "../../pull/pull.layers.ts"; import { dbRemoteCommit } from "./commit.handler.ts"; const config = { - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), @@ -17,15 +17,15 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription("Connect using the specified Postgres URL (must be percent-encoded)."), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Connect to the linked project."), Flag.withDefault(false), ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, diff --git a/apps/cli/src/commands/db/reset/reset.command.ts b/apps/cli/src/commands/db/reset/reset.command.ts index 31d241f3f0..646e810c85 100644 --- a/apps/cli/src/commands/db/reset/reset.command.ts +++ b/apps/cli/src/commands/db/reset/reset.command.ts @@ -9,40 +9,40 @@ import { dbResetRuntimeLayer } from "./reset.layers.ts"; const noSqlPaths: ReadonlyArray = []; const config = { - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Resets the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Resets the linked project with local migrations."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Resets the local database with local migrations."), Flag.withDefault(false), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - noSeed: Flag.boolean("no-seed").pipe( + noSeed: Flag.Boolean("no-seed").pipe( Flag.withDescription("Skip running the seed script after reset."), Flag.withDefault(false), ), - sqlPaths: Flag.string("sql-paths").pipe( + sqlPaths: Flag.String("sql-paths").pipe( Flag.atLeast(0), Flag.withDescription( "Override [db.seed].sql_paths for this reset. May be repeated; each value accepts a SQL file path or glob pattern relative to the supabase directory and force-enables seeding.", ), Flag.withDefault(noSqlPaths), ), - version: Flag.string("version").pipe( + version: Flag.String("version").pipe( Flag.withDescription("Reset up to the specified version."), Flag.optional, ), - last: Flag.integer("last").pipe( + last: Flag.Int("last").pipe( Flag.withDescription("Reset up to the last n migration versions."), Flag.optional, ), diff --git a/apps/cli/src/commands/db/reset/reset.handler.ts b/apps/cli/src/commands/db/reset/reset.handler.ts index a85fee1d23..c2ddca7451 100644 --- a/apps/cli/src/commands/db/reset/reset.handler.ts +++ b/apps/cli/src/commands/db/reset/reset.handler.ts @@ -82,7 +82,7 @@ export const dbReset = Effect.fn("db.reset")(function* (flags: DbResetFlags) { message: `if any flags in the group [db-url linked local] are set none of the others can be; [${target.setFlags.join(" ")}] were all set`, }); } - // `--last` is an unsigned flag, so a negative value should be rejected; `Flag.integer` here + // `--last` is an unsigned flag, so a negative value should be rejected; `Flag.Int` here // accepts it, so reject it explicitly rather than silently resetting the full history. if (Option.isSome(flags.last) && flags.last.value < 0) { return yield* new DbResetLastFlagError({ diff --git a/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts b/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts index edb1dd999a..c413438cc6 100644 --- a/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts +++ b/apps/cli/src/commands/db/schema/declarative/declarative.shared.ts @@ -9,11 +9,11 @@ export const dbSchemaDeclarativeSharedBase = Command.make("declarative").pipe( Command.withDescription("Manage declarative database schemas."), Command.withShortDescription("Manage declarative database schemas"), Command.withSharedFlags({ - noCache: Flag.boolean("no-cache").pipe( + noCache: Flag.Boolean("no-cache").pipe( Flag.withDescription("Disable catalog cache and force fresh shadow database setup."), Flag.withDefault(false), ), - strictCoverage: Flag.boolean("strict-coverage").pipe( + strictCoverage: Flag.Boolean("strict-coverage").pipe( Flag.withDescription( "Fail when bundled pg-delta finds schema objects it cannot manage instead of leaving them unmanaged.", ), diff --git a/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts b/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts index 442da47404..69149d5a18 100644 --- a/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts +++ b/apps/cli/src/commands/db/schema/declarative/generate/generate.command.ts @@ -12,24 +12,24 @@ import { dbSchemaDeclarativeGenerate } from "./generate.handler.ts"; import { dbSchemaDeclarativeGenerateRuntimeLayer } from "./generate.layers.ts"; const config = { - overwrite: Flag.boolean("overwrite").pipe( + overwrite: Flag.Boolean("overwrite").pipe( Flag.withDescription("Overwrite declarative schema files without confirmation."), Flag.withDefault(false), ), // Not named `--output`/`-o`: that's reserved for the global machine-format flag // (`OutputFlag`), and a leaf string flag would shadow it — `generate -o json` would write a // directory literally named `json` instead of requesting JSON output. - outputDir: Flag.string("output-dir").pipe( + outputDir: Flag.String("output-dir").pipe( Flag.withDescription( "Write the generated declarative schema to this directory without changing the configured declarative schema path.", ), Flag.optional, ), - reset: Flag.boolean("reset").pipe( + reset: Flag.Boolean("reset").pipe( Flag.withDescription("Reset local database before generating (local data will be lost)."), Flag.withDefault(false), ), - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), @@ -40,7 +40,7 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Generates declarative schema from the database specified by the connection string (must be percent-encoded).", ), @@ -48,15 +48,15 @@ const config = { ), // Explicit-target selection keys off presence, not the bool value, so model `--linked`/ // `--local` as `Option` (like `--db-url`) so `--linked=false` still takes the explicit path. - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Generates declarative schema from the linked project."), Flag.optional, ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Generates declarative schema from the local database."), Flag.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, diff --git a/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts b/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts index 6f6f3e2955..443b2f8a26 100644 --- a/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts +++ b/apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts @@ -10,7 +10,7 @@ import { dbSchemaDeclarativeSync } from "./sync.handler.ts"; import { dbSchemaDeclarativeSyncRuntimeLayer } from "./sync.layers.ts"; const config = { - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), @@ -21,22 +21,22 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - file: Flag.string("file").pipe( + file: Flag.String("file").pipe( Flag.withAlias("f"), Flag.withDescription("Saves schema diff to a new migration file."), Flag.optional, ), - name: Flag.string("name").pipe( + name: Flag.String("name").pipe( Flag.withDescription("Name for the generated migration file."), Flag.optional, ), // Mutually exclusive with `--no-apply`, keyed off presence not value, so model with `Option` // so `--apply=false --no-apply` still trips the conflict. - apply: Flag.boolean("apply").pipe( + apply: Flag.Boolean("apply").pipe( Flag.withDescription("Apply the generated migration to the local database without prompting."), Flag.optional, ), - noApply: Flag.boolean("no-apply").pipe( + noApply: Flag.Boolean("no-apply").pipe( Flag.withDescription( "Generate the migration file without prompting or applying it to the local database.", ), diff --git a/apps/cli/src/commands/db/shared/migra.ts b/apps/cli/src/commands/db/shared/migra.ts index 199286e7b3..928c41d018 100644 --- a/apps/cli/src/commands/db/shared/migra.ts +++ b/apps/cli/src/commands/db/shared/migra.ts @@ -101,7 +101,7 @@ where pd.deptype is null and pn.nspowner::regrole::text != 'supabase_admin' order by pn.nspname`; -const isSslDebugEnabled = Config.string("SUPABASE_SSL_DEBUG").pipe( +const isSslDebugEnabled = Config.String("SUPABASE_SSL_DEBUG").pipe( Config.withDefault(""), Effect.map((value) => value.toLowerCase() === "true"), Effect.orElseSucceed(() => false), diff --git a/apps/cli/src/commands/db/start/start.command.ts b/apps/cli/src/commands/db/start/start.command.ts index 1fb559e20b..7475eaf92d 100644 --- a/apps/cli/src/commands/db/start/start.command.ts +++ b/apps/cli/src/commands/db/start/start.command.ts @@ -7,7 +7,7 @@ import { dbStart } from "./start.handler.ts"; import { dbStartRuntimeLayer } from "./start.layers.ts"; const config = { - fromBackup: Flag.string("from-backup").pipe( + fromBackup: Flag.String("from-backup").pipe( Flag.withDescription("Path to a logical backup file."), Flag.optional, ), diff --git a/apps/cli/src/commands/domains/activate/activate.command.ts b/apps/cli/src/commands/domains/activate/activate.command.ts index 8ce697e34c..e4cb5d7b8a 100644 --- a/apps/cli/src/commands/domains/activate/activate.command.ts +++ b/apps/cli/src/commands/domains/activate/activate.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { domainsActivate } from "./activate.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - includeRawOutput: Flag.boolean("include-raw-output").pipe( + includeRawOutput: Flag.Boolean("include-raw-output").pipe( Flag.withDescription("(Deprecated) use -o json instead."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/domains/create/create.command.ts b/apps/cli/src/commands/domains/create/create.command.ts index 94ed783d16..008fde822d 100644 --- a/apps/cli/src/commands/domains/create/create.command.ts +++ b/apps/cli/src/commands/domains/create/create.command.ts @@ -7,14 +7,14 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { domainsCreate } from "./create.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - customHostname: Flag.string("custom-hostname").pipe( + customHostname: Flag.String("custom-hostname").pipe( Flag.withDescription("The custom hostname to use for your Supabase project."), ), - includeRawOutput: Flag.boolean("include-raw-output").pipe( + includeRawOutput: Flag.Boolean("include-raw-output").pipe( Flag.withDescription("(Deprecated) use -o json instead."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/domains/delete/delete.command.ts b/apps/cli/src/commands/domains/delete/delete.command.ts index be54c54d20..0206785052 100644 --- a/apps/cli/src/commands/domains/delete/delete.command.ts +++ b/apps/cli/src/commands/domains/delete/delete.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { domainsDelete } from "./delete.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - includeRawOutput: Flag.boolean("include-raw-output").pipe( + includeRawOutput: Flag.Boolean("include-raw-output").pipe( Flag.withDescription("(Deprecated) use -o json instead."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/domains/get/get.command.ts b/apps/cli/src/commands/domains/get/get.command.ts index f1ad2002af..03d0170ef3 100644 --- a/apps/cli/src/commands/domains/get/get.command.ts +++ b/apps/cli/src/commands/domains/get/get.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { domainsGet } from "./get.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - includeRawOutput: Flag.boolean("include-raw-output").pipe( + includeRawOutput: Flag.Boolean("include-raw-output").pipe( Flag.withDescription("(Deprecated) use -o json instead."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/domains/reverify/reverify.command.ts b/apps/cli/src/commands/domains/reverify/reverify.command.ts index 4483e1b496..0565b0126f 100644 --- a/apps/cli/src/commands/domains/reverify/reverify.command.ts +++ b/apps/cli/src/commands/domains/reverify/reverify.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { domainsReverify } from "./reverify.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - includeRawOutput: Flag.boolean("include-raw-output").pipe( + includeRawOutput: Flag.Boolean("include-raw-output").pipe( Flag.withDescription("(Deprecated) use -o json instead."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts b/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts index 643abaa342..43c739540f 100644 --- a/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts +++ b/apps/cli/src/commands/encryption/get-root-key/get-root-key.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { encryptionGetRootKey } from "./get-root-key.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts b/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts index 2b8c60c04d..38e38f8556 100644 --- a/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts +++ b/apps/cli/src/commands/encryption/update-root-key/update-root-key.command.ts @@ -10,7 +10,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { encryptionUpdateRootKey } from "./update-root-key.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/experimental/compute/delete/delete.command.ts b/apps/cli/src/commands/experimental/compute/delete/delete.command.ts index 2d5555e6bb..e6939083e8 100644 --- a/apps/cli/src/commands/experimental/compute/delete/delete.command.ts +++ b/apps/cli/src/commands/experimental/compute/delete/delete.command.ts @@ -9,8 +9,8 @@ import { computeDelete } from "./delete.handler.ts"; // reads through `resolveYes`, so redeclaring it here would shadow the // global, list `--yes` twice in `--help`, and quietly ignore `SUPABASE_YES`. const config = { - name: Argument.string("name").pipe(Argument.withDescription("Compute to delete.")), - projectRef: Flag.string("project-ref").pipe( + name: Argument.String("name").pipe(Argument.withDescription("Compute to delete.")), + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/experimental/compute/list/list.command.ts b/apps/cli/src/commands/experimental/compute/list/list.command.ts index a8a4fe0694..9e16aaa99a 100644 --- a/apps/cli/src/commands/experimental/compute/list/list.command.ts +++ b/apps/cli/src/commands/experimental/compute/list/list.command.ts @@ -6,7 +6,7 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { computeList } from "./list.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/experimental/compute/logs/logs.command.ts b/apps/cli/src/commands/experimental/compute/logs/logs.command.ts index 8f76711a84..a4d2633215 100644 --- a/apps/cli/src/commands/experimental/compute/logs/logs.command.ts +++ b/apps/cli/src/commands/experimental/compute/logs/logs.command.ts @@ -20,29 +20,29 @@ import { computeLogs } from "./logs.handler.ts"; const MAX_TAIL = 1000; const config = { - name: Argument.string("name").pipe(Argument.withDescription("Compute to read logs for.")), - projectRef: Flag.string("project-ref").pipe( + name: Argument.String("name").pipe(Argument.withDescription("Compute to read logs for.")), + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - kind: Flag.choice("kind", COMPUTE_LOG_KINDS).pipe( + kind: Flag.Literals("kind", COMPUTE_LOG_KINDS).pipe( Flag.withDescription( "Limit to one log stream: app (the compute's own output), requests (HTTP access), " + "builds (deploy lifecycle). Defaults to all three.", ), Flag.optional, ), - follow: Flag.boolean("follow").pipe( + follow: Flag.Boolean("follow").pipe( Flag.withAlias("f"), Flag.withDescription( `Keep printing new lines until interrupted, polling every ${COMPUTE_LOG_POLL_SECONDS} seconds.`, ), - // Required: `Flag.boolean` alone builds a *required* param, which breaks + // Required: `Flag.Boolean` alone builds a *required* param, which breaks // invocations that omit the flag. `boolean-flag-defaults.unit.test.ts` // walks the command tree and fails any bare boolean. Flag.withDefault(false), ), - tail: Flag.integer("tail").pipe( + tail: Flag.Int("tail").pipe( Flag.filter( (tail) => tail >= 0 && tail <= MAX_TAIL, (tail) => `Expected --tail between 0 and ${MAX_TAIL}, got ${tail}`, diff --git a/apps/cli/src/commands/experimental/compute/new/new.command.ts b/apps/cli/src/commands/experimental/compute/new/new.command.ts index 0ac0f1ba66..e643e3977c 100644 --- a/apps/cli/src/commands/experimental/compute/new/new.command.ts +++ b/apps/cli/src/commands/experimental/compute/new/new.command.ts @@ -15,31 +15,31 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { computeNew } from "./new.handler.ts"; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription( "Compute name. Doubles as its directory, and its hostname. Prompted when omitted.", ), Argument.optional, ), - runtime: Flag.choice("runtime", COMPUTE_RUNTIMES).pipe( + runtime: Flag.Literals("runtime", COMPUTE_RUNTIMES).pipe( Flag.withDescription( "Runtime to scaffold and record in supabase/config.toml. Prompted when omitted.", ), Flag.optional, ), - size: Flag.choice("size", COMPUTE_SIZES).pipe( + size: Flag.Literals("size", COMPUTE_SIZES).pipe( Flag.withDescription( "Instance size to record in supabase/config.toml. Each size implies its own vCPU count, so there is no separate --cpu. Prompted when omitted.", ), Flag.optional, ), - exposure: Flag.choice("exposure", COMPUTE_EXPOSURES).pipe( + exposure: Flag.Literals("exposure", COMPUTE_EXPOSURES).pipe( Flag.withDescription( "Whether the compute is reachable from the internet, recorded as `exposure` in supabase/config.toml. Prompted when omitted.", ), Flag.optional, ), - instances: Flag.integer("instances").pipe( + instances: Flag.Int("instances").pipe( // Bounded at the parser, the same way `push --instances` and the config // schema's own `instances` are. Flag.filter( @@ -51,7 +51,7 @@ const config = { ), Flag.optional, ), - source: Flag.string("source").pipe( + source: Flag.String("source").pipe( Flag.withDescription( "Scaffold the compute here instead of the default compute directory, recorded as `source` in supabase/config.toml.", ), diff --git a/apps/cli/src/commands/experimental/compute/push/push.command.ts b/apps/cli/src/commands/experimental/compute/push/push.command.ts index 580644d670..a2d833d080 100644 --- a/apps/cli/src/commands/experimental/compute/push/push.command.ts +++ b/apps/cli/src/commands/experimental/compute/push/push.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { computePush } from "./push.handler.ts"; const config = { - names: Argument.string("name").pipe( + names: Argument.String("name").pipe( Argument.withDescription("Compute to deploy. Deploys every compute in the project if omitted."), Argument.variadic(), ), - instances: Flag.integer("instances").pipe( + instances: Flag.Int("instances").pipe( // Bounded at the parser: left unchecked, a negative value reached the deploy // endpoint after the build context was already packaged and uploaded. Flag.filter( @@ -23,7 +23,7 @@ const config = { ), Flag.optional, ), - exposure: Flag.choice("exposure", COMPUTE_EXPOSURES).pipe( + exposure: Flag.Literals("exposure", COMPUTE_EXPOSURES).pipe( // A closed set at the parser, the way `new --runtime` and `new --size` are: // the accepted values get listed in the refusal, and nothing unrecognized // reaches the deploy endpoint after a build context has been uploaded. @@ -34,7 +34,7 @@ const config = { ), Flag.optional, ), - noWait: Flag.boolean("no-wait").pipe( + noWait: Flag.Boolean("no-wait").pipe( // The deploy POST returns once the platform accepts the spec and context; the // server-side build that follows can run for minutes. Waiting stays the // default so a plain push reports the build's verdict; `--no-wait` opts out @@ -44,7 +44,7 @@ const config = { ), Flag.withDefault(false), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/experimental/compute/status/status.command.ts b/apps/cli/src/commands/experimental/compute/status/status.command.ts index 0dd9eaa4e1..692669787a 100644 --- a/apps/cli/src/commands/experimental/compute/status/status.command.ts +++ b/apps/cli/src/commands/experimental/compute/status/status.command.ts @@ -6,8 +6,8 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { computeStatus } from "./status.handler.ts"; const config = { - name: Argument.string("name").pipe(Argument.withDescription("Compute to inspect.")), - projectRef: Flag.string("project-ref").pipe( + name: Argument.String("name").pipe(Argument.withDescription("Compute to inspect.")), + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts b/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts index a7595ce7fd..0b400cc56e 100644 --- a/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts +++ b/apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts @@ -6,13 +6,13 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { stackDestroy } from "./destroy.handler.ts"; const config = { - stack: Flag.string("stack").pipe( + stack: Flag.String("stack").pipe( Flag.withDescription( "Destroy the stack with this name (defaults to the current project stack).", ), Flag.optional, ), - stackId: Flag.string("stack-id").pipe( + stackId: Flag.String("stack-id").pipe( Flag.withDescription("Destroy an existing stack by id or unique id prefix."), Flag.optional, ), diff --git a/apps/cli/src/commands/experimental/stack/logs/logs.command.ts b/apps/cli/src/commands/experimental/stack/logs/logs.command.ts index dd41b233f1..521019fafd 100644 --- a/apps/cli/src/commands/experimental/stack/logs/logs.command.ts +++ b/apps/cli/src/commands/experimental/stack/logs/logs.command.ts @@ -5,30 +5,30 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { stackLogs } from "./logs.handler.ts"; const config = { - stack: Flag.string("stack").pipe( + stack: Flag.String("stack").pipe( Flag.withDescription( "Select an existing stack by name (defaults to the current project stack).", ), Flag.optional, ), - stackId: Flag.string("stack-id").pipe( + stackId: Flag.String("stack-id").pipe( Flag.withDescription("Read logs from an existing stack by id or unique id prefix."), Flag.optional, ), - service: Flag.string("service").pipe( + service: Flag.String("service").pipe( Flag.withDescription( "Read one service kind or instance ID; repeat to select several. Defaults to composition members.", ), Flag.atLeast(0), ), - follow: Flag.boolean("follow").pipe( + follow: Flag.Boolean("follow").pipe( Flag.withAlias("f"), Flag.withDescription( "After the history, keep streaming new lines until interrupted; requires a running stack.", ), Flag.withDefault(false), ), - tail: Flag.integer("tail").pipe( + tail: Flag.Int("tail").pipe( Flag.filter( (tail) => tail >= 0, (tail) => `Expected --tail to be 0 or more, got ${tail}`, @@ -38,7 +38,7 @@ const config = { ), Flag.withDefault(200), ), - since: Flag.string("since").pipe( + since: Flag.String("since").pipe( Flag.withDescription( "Only print lines since a duration ago (10m, 1h30m), an ISO-8601 time, or start for each service's latest launch.", ), diff --git a/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts b/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts index 6e52e1c35e..8fc1c5d29b 100644 --- a/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts +++ b/apps/cli/src/commands/experimental/stack/prepare/prepare.command.ts @@ -6,19 +6,19 @@ import { stackPrepare } from "./prepare.handler.ts"; import { STACK_PREPARABLE_CAPABILITIES } from "../start/start.options.ts"; const config = { - stack: Flag.string("stack").pipe(Flag.withDescription("Name this stack."), Flag.optional), - stackId: Flag.string("stack-id").pipe( + stack: Flag.String("stack").pipe(Flag.withDescription("Name this stack."), Flag.optional), + stackId: Flag.String("stack-id").pipe( Flag.withDescription("Open an existing stack by id or unique id prefix."), Flag.optional, ), - runtime: Flag.choice("runtime", ["auto", "docker", "podman", "native"] as const).pipe( + runtime: Flag.Literals("runtime", ["auto", "docker", "podman", "native"] as const).pipe( Flag.withDescription( "Runtime to use for a new stack. auto selects Docker, then Podman, then native, based on what is available.", ), Flag.withDefault("auto" as const), ), capability: Flag.atMost( - Flag.choice("capability", STACK_PREPARABLE_CAPABILITIES), + Flag.Literals("capability", STACK_PREPARABLE_CAPABILITIES), STACK_PREPARABLE_CAPABILITIES.length, ).pipe(Flag.withDescription("Capability to prepare (repeatable).")), } as const; diff --git a/apps/cli/src/commands/experimental/stack/restart/restart.command.ts b/apps/cli/src/commands/experimental/stack/restart/restart.command.ts index cb3bbebca0..1ca449e6de 100644 --- a/apps/cli/src/commands/experimental/stack/restart/restart.command.ts +++ b/apps/cli/src/commands/experimental/stack/restart/restart.command.ts @@ -5,11 +5,11 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { stackRestart } from "./restart.handler.ts"; const config = { - stack: Flag.string("stack").pipe( + stack: Flag.String("stack").pipe( Flag.withDescription("Restart a named stack (defaults to the current project stack)."), Flag.optional, ), - stackId: Flag.string("stack-id").pipe( + stackId: Flag.String("stack-id").pipe( Flag.withDescription("Restart an existing stack by id or unique id prefix."), Flag.optional, ), diff --git a/apps/cli/src/commands/experimental/stack/start/start.command.ts b/apps/cli/src/commands/experimental/stack/start/start.command.ts index 09043e7a40..c7feb0eca0 100644 --- a/apps/cli/src/commands/experimental/stack/start/start.command.ts +++ b/apps/cli/src/commands/experimental/stack/start/start.command.ts @@ -17,22 +17,22 @@ const excludeFlag = stringSliceFlag( const config = { exclude: excludeFlag, - stack: Flag.string("stack").pipe(Flag.withDescription("Name this stack."), Flag.optional), - stackId: Flag.string("stack-id").pipe( + stack: Flag.String("stack").pipe(Flag.withDescription("Name this stack."), Flag.optional), + stackId: Flag.String("stack-id").pipe( Flag.withDescription("Open an existing stack by id or unique id prefix."), Flag.optional, ), - runtime: Flag.choice("runtime", ["auto", "docker", "podman", "native"] as const).pipe( + runtime: Flag.Literals("runtime", ["auto", "docker", "podman", "native"] as const).pipe( Flag.withDescription( "Runtime to use for a new stack. auto selects Docker, then Podman, then native, based on what is available.", ), Flag.withDefault("auto" as const), ), - preparation: Flag.choice("preparation", ["background", "on-demand"] as const).pipe( + preparation: Flag.Literals("preparation", ["background", "on-demand"] as const).pipe( Flag.withDescription("Artifact preparation policy."), Flag.withDefault("background" as const), ), - eager: Flag.boolean("eager").pipe( + eager: Flag.Boolean("eager").pipe( Flag.withDescription( "Activate all enabled capabilities before returning and disable automatic idle stops.", ), diff --git a/apps/cli/src/commands/experimental/stack/status/status.command.ts b/apps/cli/src/commands/experimental/stack/status/status.command.ts index 115891ccb3..734cfa0dab 100644 --- a/apps/cli/src/commands/experimental/stack/status/status.command.ts +++ b/apps/cli/src/commands/experimental/stack/status/status.command.ts @@ -6,12 +6,12 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { stackStatus } from "./status.handler.ts"; const config = { - stack: Flag.string("stack").pipe(Flag.withDescription("Inspect a named stack."), Flag.optional), - stackId: Flag.string("stack-id").pipe( + stack: Flag.String("stack").pipe(Flag.withDescription("Inspect a named stack."), Flag.optional), + stackId: Flag.String("stack-id").pipe( Flag.withDescription("Inspect an existing stack by id or unique id prefix."), Flag.optional, ), - env: Flag.boolean("env").pipe( + env: Flag.Boolean("env").pipe( Flag.withDescription("Export connection URLs and credentials as environment variables."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/experimental/stack/stop/stop.command.ts b/apps/cli/src/commands/experimental/stack/stop/stop.command.ts index 25bc63f9c2..38b665cdb0 100644 --- a/apps/cli/src/commands/experimental/stack/stop/stop.command.ts +++ b/apps/cli/src/commands/experimental/stack/stop/stop.command.ts @@ -5,15 +5,15 @@ import { withCommandTelemetry } from "../../../../telemetry/command-telemetry.ts import { stackStop } from "./stop.handler.ts"; const config = { - all: Flag.boolean("all").pipe( + all: Flag.Boolean("all").pipe( Flag.withDescription("Stop every readable managed stack."), Flag.optional, ), - stack: Flag.string("stack").pipe( + stack: Flag.String("stack").pipe( Flag.withDescription("Stop the stack with this name (defaults to the current project stack)."), Flag.optional, ), - stackId: Flag.string("stack-id").pipe( + stackId: Flag.String("stack-id").pipe( Flag.withDescription("Stop an existing stack by id or unique id prefix."), Flag.optional, ), diff --git a/apps/cli/src/commands/feedback/add/add.command.ts b/apps/cli/src/commands/feedback/add/add.command.ts index 752af93adb..3aa6b98f18 100644 --- a/apps/cli/src/commands/feedback/add/add.command.ts +++ b/apps/cli/src/commands/feedback/add/add.command.ts @@ -11,13 +11,13 @@ import { FEEDBACK_OUTPUT_FORMATS } from "../feedback-output.ts"; import { feedbackAdd } from "./add.handler.ts"; const config = { - message: Argument.string("message").pipe( + message: Argument.String("message").pipe( Argument.withDescription( "Freeform feedback. Bare words are joined with spaces. 1000 character limit.", ), Argument.variadic(), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription( "Project ref to attribute the feedback to (defaults to SUPABASE_PROJECT_ID, then the linked project).", ), diff --git a/apps/cli/src/commands/feedback/delete/delete.command.ts b/apps/cli/src/commands/feedback/delete/delete.command.ts index 1a8a7ab9b6..bdf3f48e17 100644 --- a/apps/cli/src/commands/feedback/delete/delete.command.ts +++ b/apps/cli/src/commands/feedback/delete/delete.command.ts @@ -10,10 +10,10 @@ import { FEEDBACK_OUTPUT_FORMATS } from "../feedback-output.ts"; import { feedbackDelete } from "./delete.handler.ts"; const config = { - token: Argument.string("token").pipe( + token: Argument.String("token").pipe( Argument.withDescription("Deletion token (UUID) printed when the feedback was submitted."), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project the feedback was submitted with."), Flag.optional, ), diff --git a/apps/cli/src/commands/functions/delete/delete.command.ts b/apps/cli/src/commands/functions/delete/delete.command.ts index f8ac0fcc75..b37b234ae6 100644 --- a/apps/cli/src/commands/functions/delete/delete.command.ts +++ b/apps/cli/src/commands/functions/delete/delete.command.ts @@ -7,10 +7,10 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { functionsDelete } from "./delete.handler.ts"; const config = { - functionName: Argument.string("Function name").pipe( + functionName: Argument.String("Function name").pipe( Argument.withDescription("Name of the Function to delete."), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/functions/deploy/deploy.command.ts b/apps/cli/src/commands/functions/deploy/deploy.command.ts index c5a0e110d5..1871002573 100644 --- a/apps/cli/src/commands/functions/deploy/deploy.command.ts +++ b/apps/cli/src/commands/functions/deploy/deploy.command.ts @@ -9,31 +9,31 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { functionsDeploy } from "./deploy.handler.ts"; const config = { - functionNames: Argument.string("Function name").pipe( + functionNames: Argument.String("Function name").pipe( Argument.withDescription("Names of Functions to deploy. Deploys all if omitted."), Argument.variadic(), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - noVerifyJwt: Flag.boolean("no-verify-jwt").pipe( + noVerifyJwt: Flag.Boolean("no-verify-jwt").pipe( Flag.withDescription("Disable JWT verification for the Function."), Flag.withDefault(false), ), - useApi: Flag.boolean("use-api").pipe( + useApi: Flag.Boolean("use-api").pipe( Flag.withDescription("Bundle functions server-side without using Docker."), Flag.withDefault(false), ), - importMap: Flag.string("import-map").pipe( + importMap: Flag.String("import-map").pipe( Flag.withDescription("Path to import map file."), Flag.optional, ), - prune: Flag.boolean("prune").pipe( + prune: Flag.Boolean("prune").pipe( Flag.withDescription("Delete Functions that exist in Supabase project but not locally."), Flag.withDefault(false), ), - jobs: Flag.integer("jobs").pipe( + jobs: Flag.Int("jobs").pipe( Flag.withAlias("j"), Flag.filter( (jobs) => jobs >= 0, @@ -42,12 +42,12 @@ const config = { Flag.withDescription("Maximum number of parallel jobs."), Flag.optional, ), - useDocker: Flag.boolean("use-docker").pipe( + useDocker: Flag.Boolean("use-docker").pipe( Flag.withDescription("Use Docker to bundle functions locally."), Flag.withDefault(true), Flag.withHidden, ), - legacyBundle: Flag.boolean("legacy-bundle").pipe( + legacyBundle: Flag.Boolean("legacy-bundle").pipe( Flag.withDescription("Use legacy bundling."), Flag.withDefault(false), Flag.withHidden, diff --git a/apps/cli/src/commands/functions/download/download.command.ts b/apps/cli/src/commands/functions/download/download.command.ts index 985f174bb7..55c0c8d23a 100644 --- a/apps/cli/src/commands/functions/download/download.command.ts +++ b/apps/cli/src/commands/functions/download/download.command.ts @@ -7,24 +7,24 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { functionsDownload } from "./download.handler.ts"; const config = { - functionName: Argument.string("Function name").pipe( + functionName: Argument.String("Function name").pipe( Argument.withDescription("Name of the Function to download. Downloads all if omitted."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - useApi: Flag.boolean("use-api").pipe( + useApi: Flag.Boolean("use-api").pipe( Flag.withDescription("Unbundle functions server-side without using Docker."), Flag.withDefault(false), ), - useDocker: Flag.boolean("use-docker").pipe( + useDocker: Flag.Boolean("use-docker").pipe( Flag.withDescription("Use Docker to unbundle functions locally."), Flag.withDefault(true), Flag.withHidden, ), - legacyBundle: Flag.boolean("legacy-bundle").pipe( + legacyBundle: Flag.Boolean("legacy-bundle").pipe( Flag.withDescription("Use legacy bundling."), Flag.withDefault(false), Flag.withHidden, diff --git a/apps/cli/src/commands/functions/download/download.integration.test.ts b/apps/cli/src/commands/functions/download/download.integration.test.ts index ec0471a52a..e805f6d172 100644 --- a/apps/cli/src/commands/functions/download/download.integration.test.ts +++ b/apps/cli/src/commands/functions/download/download.integration.test.ts @@ -2292,7 +2292,7 @@ describe("functions download", () => { ), ).toHaveLength(1); const ambient = yield* Config.option( - Config.string("SUPABASE_INTERNAL_IMAGE_REGISTRY"), + Config.String("SUPABASE_INTERNAL_IMAGE_REGISTRY"), ).pipe( Effect.provideService( ConfigProvider.ConfigProvider, diff --git a/apps/cli/src/commands/functions/list/list.command.ts b/apps/cli/src/commands/functions/list/list.command.ts index 9f1726a9a2..d83c55f542 100644 --- a/apps/cli/src/commands/functions/list/list.command.ts +++ b/apps/cli/src/commands/functions/list/list.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { functionsList } from "./list.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/functions/new/new.command.ts b/apps/cli/src/commands/functions/new/new.command.ts index 3f83614606..61c913bace 100644 --- a/apps/cli/src/commands/functions/new/new.command.ts +++ b/apps/cli/src/commands/functions/new/new.command.ts @@ -13,10 +13,10 @@ import { functionsNew } from "./new.handler.ts"; const AUTH_MODE_VALUES = ["none", "apikey", "user"] as const; const config = { - functionName: Argument.string("Function name").pipe( + functionName: Argument.String("Function name").pipe( Argument.withDescription("Name of the Function to create."), ), - auth: Flag.choice("auth", AUTH_MODE_VALUES).pipe( + auth: Flag.Literals("auth", AUTH_MODE_VALUES).pipe( Flag.withDescription("use a specific auth mode"), Flag.withDefault("apikey" as const), ), diff --git a/apps/cli/src/commands/functions/serve/serve.command.ts b/apps/cli/src/commands/functions/serve/serve.command.ts index 4f5e81d85a..095e34b795 100644 --- a/apps/cli/src/commands/functions/serve/serve.command.ts +++ b/apps/cli/src/commands/functions/serve/serve.command.ts @@ -24,33 +24,33 @@ const functionsServeRuntimeLayer = Layer.mergeAll( ); const config = { - noVerifyJwt: Flag.boolean("no-verify-jwt").pipe( + noVerifyJwt: Flag.Boolean("no-verify-jwt").pipe( Flag.withDescription("Disable JWT verification for the Function."), Flag.optional, ), - envFile: Flag.string("env-file").pipe( + envFile: Flag.String("env-file").pipe( Flag.withDescription( "Path to an env file. Overrides supabase/functions/.env and per-Function .env files.", ), Flag.optional, ), - importMap: Flag.string("import-map").pipe( + importMap: Flag.String("import-map").pipe( Flag.withDescription("Path to import map file."), Flag.optional, ), - inspect: Flag.boolean("inspect").pipe( + inspect: Flag.Boolean("inspect").pipe( Flag.withDescription("Alias of --inspect-mode brk."), Flag.withDefault(false), ), - inspectMode: Flag.choice("inspect-mode", FUNCTIONS_SERVE_INSPECT_MODES).pipe( + inspectMode: Flag.Literals("inspect-mode", FUNCTIONS_SERVE_INSPECT_MODES).pipe( Flag.withDescription("Activate inspector capability for debugging."), Flag.optional, ), - inspectMain: Flag.boolean("inspect-main").pipe( + inspectMain: Flag.Boolean("inspect-main").pipe( Flag.withDescription("Allow inspecting the main worker."), Flag.withDefault(false), ), - all: Flag.boolean("all").pipe( + all: Flag.Boolean("all").pipe( Flag.withDescription("Serve all Functions."), Flag.withDefault(true), Flag.withHidden, @@ -59,7 +59,7 @@ const config = { const commandConfig = { ...config, - functionNames: Argument.string("Function name").pipe( + functionNames: Argument.String("Function name").pipe( Argument.withDescription("Legacy Function names. All Functions are served."), Argument.variadic(), ), diff --git a/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts b/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts index 3ee5165362..0e6063ee95 100644 --- a/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts +++ b/apps/cli/src/commands/gen/bearer-jwt/bearer-jwt.command.ts @@ -15,12 +15,12 @@ const config = { // `--role` stays optional at parse time so a missing value is enforced in // the handler instead, after telemetry is wired up — see // `GenBearerJwtRoleRequiredError`. - role: Flag.string("role").pipe(Flag.withDescription("Postgres role to use."), Flag.optional), + role: Flag.String("role").pipe(Flag.withDescription("Postgres role to use."), Flag.optional), // The displayed default is cosmetically "anonymous" but the real default // stays "" — an omitted `--sub` never puts a `sub` claim in the token at // all. - sub: Flag.string("sub").pipe(Flag.withDescription("User ID to impersonate."), Flag.optional), - exp: Flag.string("exp").pipe( + sub: Flag.String("sub").pipe(Flag.withDescription("User ID to impersonate."), Flag.optional), + exp: Flag.String("exp").pipe( Flag.withDescription("Expiry timestamp for this token."), Flag.mapTryCatch( (value) => parseBearerJwtExp(value), @@ -28,7 +28,7 @@ const config = { ), Flag.optional, ), - validFor: Flag.string("valid-for").pipe( + validFor: Flag.String("valid-for").pipe( Flag.withDescription("Validity duration for this token."), Flag.withDefault("30m"), Flag.mapTryCatch( @@ -36,7 +36,7 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - payload: Flag.string("payload").pipe( + payload: Flag.String("payload").pipe( Flag.withDescription("Custom claims in JSON format."), Flag.withDefault("{}"), ), diff --git a/apps/cli/src/commands/gen/gen.signing-keys-config.ts b/apps/cli/src/commands/gen/gen.signing-keys-config.ts index f5d377dbde..bbf8975dad 100644 --- a/apps/cli/src/commands/gen/gen.signing-keys-config.ts +++ b/apps/cli/src/commands/gen/gen.signing-keys-config.ts @@ -323,7 +323,7 @@ export const resolveSigningKeysConfigPaths = Effect.fnUntraced(function* ( // Loads the dotenv cascade explicitly before `loadCliConfig` decodes `env(...)` TOML // references — `loadCliConfig`'s own internal env resolution covers only // `supabase/.env[.local]`, not `.env.[.local]` or `/.env`. - const supabaseEnv = yield* Config.option(Config.string("SUPABASE_ENV")).pipe( + const supabaseEnv = yield* Config.option(Config.String("SUPABASE_ENV")).pipe( Effect.mapError(() => onConfigParseError("failed to resolve environment variable: SUPABASE_ENV"), ), diff --git a/apps/cli/src/commands/gen/keys/keys.command.ts b/apps/cli/src/commands/gen/keys/keys.command.ts index 80986da5c0..0106956f2d 100644 --- a/apps/cli/src/commands/gen/keys/keys.command.ts +++ b/apps/cli/src/commands/gen/keys/keys.command.ts @@ -3,11 +3,11 @@ import type * as CliCommand from "effect/cli/Command"; import { genKeys } from "./keys.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - overrideName: Flag.string("override-name").pipe( + overrideName: Flag.String("override-name").pipe( Flag.withDescription("Override specific variable names."), Flag.atLeast(0), ), diff --git a/apps/cli/src/commands/gen/signing-key/signing-key.command.ts b/apps/cli/src/commands/gen/signing-key/signing-key.command.ts index ec30c20dcd..74b1f21df5 100644 --- a/apps/cli/src/commands/gen/signing-key/signing-key.command.ts +++ b/apps/cli/src/commands/gen/signing-key/signing-key.command.ts @@ -13,11 +13,11 @@ import { genSigningKey } from "./signing-key.handler.ts"; const ALGORITHM_VALUES = ["ES256", "RS256"] as const; const config = { - algorithm: Flag.choice("algorithm", ALGORITHM_VALUES).pipe( + algorithm: Flag.Literals("algorithm", ALGORITHM_VALUES).pipe( Flag.withDescription("Algorithm for signing key generation."), Flag.withDefault("ES256" as const), ), - append: Flag.boolean("append").pipe( + append: Flag.Boolean("append").pipe( Flag.withDescription("Append new key to existing keys file instead of overwriting."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/gen/types/types.command.ts b/apps/cli/src/commands/gen/types/types.command.ts index c1ff4c1973..75ee00a62c 100644 --- a/apps/cli/src/commands/gen/types/types.command.ts +++ b/apps/cli/src/commands/gen/types/types.command.ts @@ -13,27 +13,27 @@ import { GEN_TYPES_LANGUAGES, genTypesLanguageFlags } from "./types.languages.ts import { genTypesRuntimeLayer } from "./types.layers.ts"; const config = { - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Generate types from the local dev database."), Flag.withDefault(false), ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Generate types from the linked project."), Flag.withDefault(false), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription("Generate types from a database url."), Flag.optional, ), - projectId: Flag.string("project-id").pipe( + projectId: Flag.String("project-id").pipe( Flag.withDescription("Generate types from a project ID."), Flag.optional, ), - lang: Flag.choice("lang", GEN_TYPES_LANGUAGES).pipe( + lang: Flag.Literals("lang", GEN_TYPES_LANGUAGES).pipe( Flag.withDescription("Output language of the generated types. (default typescript)"), Flag.withDefault("typescript"), ), - schema: Flag.string("schema").pipe( + schema: Flag.String("schema").pipe( Flag.withAlias("s"), Flag.withDescription("Comma separated list of schema to include."), Flag.atLeast(0), @@ -43,12 +43,12 @@ const config = { ), ), // Hidden: Effect V4 has no `Flag.withDeprecated`; the handler prints cobra's deprecation line. - postgrestV9Compat: Flag.boolean("postgrest-v9-compat").pipe( + postgrestV9Compat: Flag.Boolean("postgrest-v9-compat").pipe( Flag.withDescription("Generate types compatible with PostgREST v9 and below."), Flag.withHidden, Flag.withDefault(false), ), - queryTimeout: Flag.string("query-timeout").pipe( + queryTimeout: Flag.String("query-timeout").pipe( Flag.withDescription("Maximum timeout allowed for the database query. (default 15s)"), Flag.withDefault("15s"), ), @@ -81,7 +81,7 @@ const flagsConfig = { ...config, ...genTypesLanguageFlags(GEN_TYPES_RESERVED_FLA const commandConfig = { ...flagsConfig, - language: Argument.string("language").pipe(Argument.optional, Param.withHidden), + language: Argument.String("language").pipe(Argument.optional, Param.withHidden), } as const; /** The registry's language flags are only known at runtime; read them through `languageOptionValues`. */ diff --git a/apps/cli/src/commands/gen/types/types.e2e.test.ts b/apps/cli/src/commands/gen/types/types.e2e.test.ts index 505f1b65fd..78997f9979 100644 --- a/apps/cli/src/commands/gen/types/types.e2e.test.ts +++ b/apps/cli/src/commands/gen/types/types.e2e.test.ts @@ -361,9 +361,9 @@ describe("gen types e2e", () => { // An unset or empty variable reads as `Option.none()`. const remote = Effect.runSync( Effect.all({ - projectRef: Config.option(Config.string(REMOTE_PROJECT_REF_ENV)), - accessToken: Config.option(Config.string("SUPABASE_ACCESS_TOKEN")), - enabled: Config.option(Config.string(REMOTE_E2E_FLAG)), + projectRef: Config.option(Config.String(REMOTE_PROJECT_REF_ENV)), + accessToken: Config.option(Config.String("SUPABASE_ACCESS_TOKEN")), + enabled: Config.option(Config.String(REMOTE_E2E_FLAG)), }), ); const remoteEnabled = Option.getOrElse(remote.enabled, () => "") === "1"; diff --git a/apps/cli/src/commands/gen/types/types.generator.layer.ts b/apps/cli/src/commands/gen/types/types.generator.layer.ts index 02d2eabfff..fe8a356fa0 100644 --- a/apps/cli/src/commands/gen/types/types.generator.layer.ts +++ b/apps/cli/src/commands/gen/types/types.generator.layer.ts @@ -55,7 +55,7 @@ export const mapRegistryError = (lang: string, cause: unknown): GenTypesGenerate }; const optionalEnv = (name: string) => - Config.option(Config.string(name)).pipe(Effect.map(Option.getOrUndefined)); + Config.option(Config.String(name)).pipe(Effect.map(Option.getOrUndefined)); /** * Live `GenTypesGenerator`: opens a `DbConnection` session, adapts it to typegen's `Queryable` diff --git a/apps/cli/src/commands/gen/types/types.languages.ts b/apps/cli/src/commands/gen/types/types.languages.ts index d4ce509873..c8823e9646 100644 --- a/apps/cli/src/commands/gen/types/types.languages.ts +++ b/apps/cli/src/commands/gen/types/types.languages.ts @@ -58,14 +58,14 @@ const languageFlag = (spec: LanguageFlagSpec): Flag.Flag "postgres"); }); diff --git a/apps/cli/src/commands/init/init.command.ts b/apps/cli/src/commands/init/init.command.ts index 86357469aa..0d85adb6ec 100644 --- a/apps/cli/src/commands/init/init.command.ts +++ b/apps/cli/src/commands/init/init.command.ts @@ -9,30 +9,30 @@ import { withCommandTelemetry } from "../../telemetry/command-telemetry.ts"; import { init } from "./init.handler.ts"; const config = { - interactive: Flag.boolean("interactive").pipe( + interactive: Flag.Boolean("interactive").pipe( Flag.withDescription("Enables interactive mode to configure IDE settings."), Flag.withAlias("i"), Flag.withDefault(false), ), - useOrioledb: Flag.boolean("use-orioledb").pipe( + useOrioledb: Flag.Boolean("use-orioledb").pipe( Flag.withDescription("Use OrioleDB storage engine for Postgres."), Flag.withDefault(false), ), - force: Flag.boolean("force").pipe( + force: Flag.Boolean("force").pipe( Flag.withDescription("Overwrite existing supabase/config.toml."), Flag.withDefault(false), ), - withVscodeWorkspace: Flag.boolean("with-vscode-workspace").pipe( + withVscodeWorkspace: Flag.Boolean("with-vscode-workspace").pipe( Flag.withDescription("Generate VS Code workspace."), Flag.withHidden, Flag.withDefault(false), ), - withVscodeSettings: Flag.boolean("with-vscode-settings").pipe( + withVscodeSettings: Flag.Boolean("with-vscode-settings").pipe( Flag.withDescription("Generate VS Code settings for Deno."), Flag.withHidden, Flag.withDefault(false), ), - withIntellijSettings: Flag.boolean("with-intellij-settings").pipe( + withIntellijSettings: Flag.Boolean("with-intellij-settings").pipe( Flag.withDescription("Generate IntelliJ IDEA settings for Deno."), Flag.withHidden, Flag.withDefault(false), diff --git a/apps/cli/src/commands/inspect/db/inspect-db-command.ts b/apps/cli/src/commands/inspect/db/inspect-db-command.ts index b61d156a77..9ba251d85f 100644 --- a/apps/cli/src/commands/inspect/db/inspect-db-command.ts +++ b/apps/cli/src/commands/inspect/db/inspect-db-command.ts @@ -10,22 +10,22 @@ import type { InspectConnectionFlags } from "./inspect-query.ts"; * verbatim across all 25 commands so flag names and descriptions live in one place. */ export const INSPECT_DB_FLAGS = { - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Inspect the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Inspect the linked project."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Inspect the local database."), Flag.withDefault(false), ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/inspect/report/report.command.ts b/apps/cli/src/commands/inspect/report/report.command.ts index 58f70a3a0c..b29123d452 100644 --- a/apps/cli/src/commands/inspect/report/report.command.ts +++ b/apps/cli/src/commands/inspect/report/report.command.ts @@ -9,26 +9,26 @@ import { inspectReport } from "./report.handler.ts"; import { inspectBaseLayer } from "../inspect.layers.ts"; const config = { - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Inspect the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Inspect the linked project."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Inspect the local database."), Flag.withDefault(false), ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - outputDir: Flag.string("output-dir").pipe( + outputDir: Flag.String("output-dir").pipe( Flag.withDescription("Path to save CSV files in."), Flag.withDefault("."), ), diff --git a/apps/cli/src/commands/issue/issue.command.ts b/apps/cli/src/commands/issue/issue.command.ts index eb8572e381..9be04f119a 100644 --- a/apps/cli/src/commands/issue/issue.command.ts +++ b/apps/cli/src/commands/issue/issue.command.ts @@ -6,13 +6,13 @@ import { withJsonErrorHandling } from "../../shared/output/json-error-handling.t import { withCommandTelemetry } from "../../telemetry/command-telemetry.ts"; import { issueBug, issueDocs, issueFeature } from "./issue.handler.ts"; -const issueNoBrowserFlag = Flag.boolean("no-browser").pipe( +const issueNoBrowserFlag = Flag.Boolean("no-browser").pipe( Flag.withDescription("Print the issue form URL without opening a browser."), Flag.withDefault(false), ); const issueOptionalTextFlag = (name: string, description: string) => - Flag.string(name).pipe(Flag.withDescription(description), Flag.optional); + Flag.String(name).pipe(Flag.withDescription(description), Flag.optional); const issueCommonContextFlag = issueOptionalTextFlag( "additional-context", @@ -38,7 +38,7 @@ const issueBugConfig = { } as const; const issueFeatureConfig = { - existingIssues: Flag.boolean("existing-issues").pipe( + existingIssues: Flag.Boolean("existing-issues").pipe( Flag.withDescription("Prefill the existing issues checklist."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/link/link.command.ts b/apps/cli/src/commands/link/link.command.ts index 05c1e9b53f..a6d1294eff 100644 --- a/apps/cli/src/commands/link/link.command.ts +++ b/apps/cli/src/commands/link/link.command.ts @@ -9,24 +9,24 @@ import { withCommandTelemetry } from "../../telemetry/command-telemetry.ts"; import { link } from "./link.handler.ts"; const config = { - refOrBranch: Argument.string("ref-or-branch").pipe( + refOrBranch: Argument.String("ref-or-branch").pipe( Argument.withDescription( "Project ref, or the name (or UUID) of a branch of the currently linked project. Values that are exactly 20 lowercase letters are always treated as project refs.", ), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription( "Project ref of the Supabase project, or the name of one of its branches.", ), Flag.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, ), - skipPooler: Flag.boolean("skip-pooler").pipe( + skipPooler: Flag.Boolean("skip-pooler").pipe( Flag.withDescription("Use direct connection instead of pooler."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/login/login.command.ts b/apps/cli/src/commands/login/login.command.ts index a118bd83a3..40d1403f8b 100644 --- a/apps/cli/src/commands/login/login.command.ts +++ b/apps/cli/src/commands/login/login.command.ts @@ -7,15 +7,15 @@ import { loginRuntimeLayer } from "./login.layers.ts"; import { login } from "./login.handler.ts"; const config = { - token: Flag.string("token").pipe( + token: Flag.String("token").pipe( Flag.withDescription("Use provided token instead of automatic login flow."), Flag.optional, ), - name: Flag.string("name").pipe( + name: Flag.String("name").pipe( Flag.withDescription("Name that will be used to store token in your settings."), Flag.optional, ), - noBrowser: Flag.boolean("no-browser").pipe( + noBrowser: Flag.Boolean("no-browser").pipe( Flag.withDescription("Do not open browser automatically."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/migration/down/down.command.ts b/apps/cli/src/commands/migration/down/down.command.ts index c9a1d486b8..4be9d6750b 100644 --- a/apps/cli/src/commands/migration/down/down.command.ts +++ b/apps/cli/src/commands/migration/down/down.command.ts @@ -9,7 +9,7 @@ import { migrationDown } from "./down.handler.ts"; const config = { // `--last` is conceptually a uint (default 1); Effect has no uint type, so negatives are // rejected explicitly. - last: Flag.integer("last").pipe( + last: Flag.Int("last").pipe( Flag.withDescription("Reset up to the last n migration versions."), Flag.withDefault(1), Flag.mapTryCatch( @@ -22,21 +22,21 @@ const config = { (err) => (err instanceof Error ? err.message : String(err)), ), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Resets applied migrations on the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Resets applied migrations on the linked project."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Resets applied migrations on the local database."), Flag.withDefault(true), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/migration/fetch/fetch.command.ts b/apps/cli/src/commands/migration/fetch/fetch.command.ts index 67b7a69db6..70ab5fb5d0 100644 --- a/apps/cli/src/commands/migration/fetch/fetch.command.ts +++ b/apps/cli/src/commands/migration/fetch/fetch.command.ts @@ -7,22 +7,22 @@ import { migrationDbRuntimeLayer } from "../migration.layers.ts"; import { migrationFetch } from "./fetch.handler.ts"; const config = { - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Fetches migrations from the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Fetches migration history from the linked project."), Flag.withDefault(true), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Fetches migration history from the local database."), Flag.withDefault(false), ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/migration/list/list.command.ts b/apps/cli/src/commands/migration/list/list.command.ts index 04d9a2d459..6a790a3cdd 100644 --- a/apps/cli/src/commands/migration/list/list.command.ts +++ b/apps/cli/src/commands/migration/list/list.command.ts @@ -7,26 +7,26 @@ import { migrationDbRuntimeLayer } from "../migration.layers.ts"; import { migrationList } from "./list.handler.ts"; const config = { - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Lists migrations of the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Lists migrations applied to the linked project."), Flag.withDefault(true), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Lists migrations applied to the local database."), Flag.withDefault(false), ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, diff --git a/apps/cli/src/commands/migration/new/new.command.ts b/apps/cli/src/commands/migration/new/new.command.ts index 881b864641..36e2996098 100644 --- a/apps/cli/src/commands/migration/new/new.command.ts +++ b/apps/cli/src/commands/migration/new/new.command.ts @@ -7,7 +7,7 @@ import { migrationNewRuntimeLayer } from "../migration.layers.ts"; import { migrationNew } from "./new.handler.ts"; const config = { - migrationName: Argument.string("migration name").pipe( + migrationName: Argument.String("migration name").pipe( Argument.withDescription("Name for the new migration file."), ), } as const; diff --git a/apps/cli/src/commands/migration/repair/repair.command.ts b/apps/cli/src/commands/migration/repair/repair.command.ts index 690ef893c7..f69faa7014 100644 --- a/apps/cli/src/commands/migration/repair/repair.command.ts +++ b/apps/cli/src/commands/migration/repair/repair.command.ts @@ -6,33 +6,33 @@ import { migrationDbRuntimeLayer } from "../migration.layers.ts"; import { migrationRepair } from "./repair.handler.ts"; const config = { - versions: Argument.string("version").pipe( + versions: Argument.String("version").pipe( Argument.withDescription("Migration version(s) to repair."), Argument.variadic(), ), - status: Flag.choice("status", ["applied", "reverted"] as const).pipe( + status: Flag.Literals("status", ["applied", "reverted"] as const).pipe( Flag.withDescription("Version status to update."), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Repairs migrations of the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Repairs the migration history of the linked project."), Flag.withDefault(true), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Repairs the migration history of the local database."), Flag.withDefault(false), ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, diff --git a/apps/cli/src/commands/migration/squash/squash.command.ts b/apps/cli/src/commands/migration/squash/squash.command.ts index d39f67a739..056ad3e713 100644 --- a/apps/cli/src/commands/migration/squash/squash.command.ts +++ b/apps/cli/src/commands/migration/squash/squash.command.ts @@ -7,31 +7,31 @@ import { migrationSquashRuntimeLayer } from "../migration.layers.ts"; import { migrationSquash } from "./squash.handler.ts"; const config = { - version: Flag.string("version").pipe( + version: Flag.String("version").pipe( Flag.withDescription("Squash up to the specified version."), Flag.optional, ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Squashes migrations of the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Squashes the migration history of the linked project."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Squashes the migration history of the local database."), Flag.withDefault(true), ), - password: Flag.string("password").pipe( + password: Flag.String("password").pipe( Flag.withAlias("p"), Flag.withDescription("Password to your remote Postgres database."), Flag.optional, ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/migration/squash/squash.integration.test.ts b/apps/cli/src/commands/migration/squash/squash.integration.test.ts index 69ca245520..d4d94840e8 100644 --- a/apps/cli/src/commands/migration/squash/squash.integration.test.ts +++ b/apps/cli/src/commands/migration/squash/squash.integration.test.ts @@ -836,7 +836,7 @@ describe("migration squash", () => { // Reverted once the command's scope closes; never leaks into a later command in // the same process. const ambient = yield* Config.option( - Config.string("SUPABASE_INTERNAL_IMAGE_REGISTRY"), + Config.String("SUPABASE_INTERNAL_IMAGE_REGISTRY"), ).pipe( Effect.provideService( ConfigProvider.ConfigProvider, diff --git a/apps/cli/src/commands/migration/up/up.command.ts b/apps/cli/src/commands/migration/up/up.command.ts index ec18b25194..e0c86b4bb5 100644 --- a/apps/cli/src/commands/migration/up/up.command.ts +++ b/apps/cli/src/commands/migration/up/up.command.ts @@ -7,26 +7,26 @@ import { migrationDbRuntimeLayer } from "../migration.layers.ts"; import { migrationUp } from "./up.handler.ts"; const config = { - includeAll: Flag.boolean("include-all").pipe( + includeAll: Flag.Boolean("include-all").pipe( Flag.withDescription("Include all migrations not found on remote history table."), Flag.withDefault(false), ), - dbUrl: Flag.string("db-url").pipe( + dbUrl: Flag.String("db-url").pipe( Flag.withDescription( "Applies migrations to the database specified by the connection string (must be percent-encoded).", ), Flag.optional, ), - linked: Flag.boolean("linked").pipe( + linked: Flag.Boolean("linked").pipe( Flag.withDescription("Applies pending migrations to the linked project."), Flag.withDefault(false), ), - local: Flag.boolean("local").pipe( + local: Flag.Boolean("local").pipe( Flag.withDescription("Applies pending migrations to the local database."), Flag.withDefault(true), ), // TS-only override of the linked project ref — see push.command.ts (db push). - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/network-bans/get/get.command.ts b/apps/cli/src/commands/network-bans/get/get.command.ts index 9a27ed899a..33f268ff60 100644 --- a/apps/cli/src/commands/network-bans/get/get.command.ts +++ b/apps/cli/src/commands/network-bans/get/get.command.ts @@ -13,7 +13,7 @@ import { import { networkBansGet } from "./get.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/network-bans/remove/remove.command.ts b/apps/cli/src/commands/network-bans/remove/remove.command.ts index 2e9b0ea441..8eea12f836 100644 --- a/apps/cli/src/commands/network-bans/remove/remove.command.ts +++ b/apps/cli/src/commands/network-bans/remove/remove.command.ts @@ -24,7 +24,7 @@ export const networkBansRemoveDbUnbanIpFlag = stringSliceFlag( ); const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/network-restrictions/get/get.command.ts b/apps/cli/src/commands/network-restrictions/get/get.command.ts index 15c89a6039..a4dc736354 100644 --- a/apps/cli/src/commands/network-restrictions/get/get.command.ts +++ b/apps/cli/src/commands/network-restrictions/get/get.command.ts @@ -13,7 +13,7 @@ import { import { networkRestrictionsGet } from "./get.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/network-restrictions/update/update.command.ts b/apps/cli/src/commands/network-restrictions/update/update.command.ts index 8ec3b4543c..1b04cad186 100644 --- a/apps/cli/src/commands/network-restrictions/update/update.command.ts +++ b/apps/cli/src/commands/network-restrictions/update/update.command.ts @@ -24,16 +24,16 @@ export const networkRestrictionsUpdateDbAllowCidrFlag = stringSliceFlag( ); const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), dbAllowCidr: networkRestrictionsUpdateDbAllowCidrFlag, - bypassCidrChecks: Flag.boolean("bypass-cidr-checks").pipe( + bypassCidrChecks: Flag.Boolean("bypass-cidr-checks").pipe( Flag.withDescription("Bypass some of the CIDR validation checks."), Flag.withDefault(false), ), - append: Flag.boolean("append").pipe( + append: Flag.Boolean("append").pipe( Flag.withDescription("Append to existing restrictions instead of replacing them."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/notebooks/pull/pull.command.ts b/apps/cli/src/commands/notebooks/pull/pull.command.ts index 7dd1617cbd..5cac62d7de 100644 --- a/apps/cli/src/commands/notebooks/pull/pull.command.ts +++ b/apps/cli/src/commands/notebooks/pull/pull.command.ts @@ -7,13 +7,13 @@ import { notebooksProjectRefSafeFlags } from "../notebooks.shared.ts"; import { notebooksPull } from "./pull.handler.ts"; const config = { - notebookId: Argument.string("Notebook id").pipe( + notebookId: Argument.String("Notebook id").pipe( Argument.withDescription( "UUID of the notebook to replace locally. Pulls only locally missing notebooks if omitted.", ), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/notebooks/push/push.command.ts b/apps/cli/src/commands/notebooks/push/push.command.ts index 8a4a2b493c..983d3f48cd 100644 --- a/apps/cli/src/commands/notebooks/push/push.command.ts +++ b/apps/cli/src/commands/notebooks/push/push.command.ts @@ -7,11 +7,11 @@ import { notebooksProjectRefSafeFlags } from "../notebooks.shared.ts"; import { notebooksPush } from "./push.handler.ts"; const config = { - notebookName: Argument.string("Notebook name").pipe( + notebookName: Argument.String("Notebook name").pipe( Argument.withDescription("Name of the notebook to push. Pushes all if omitted."), Argument.optional, ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/orgs/create/create.command.ts b/apps/cli/src/commands/orgs/create/create.command.ts index 99f44946ad..683f8f0e75 100644 --- a/apps/cli/src/commands/orgs/create/create.command.ts +++ b/apps/cli/src/commands/orgs/create/create.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { orgsCreate } from "./create.handler.ts"; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription("Display name for the new organization."), ), }; diff --git a/apps/cli/src/commands/postgres-config/delete/delete.command.ts b/apps/cli/src/commands/postgres-config/delete/delete.command.ts index d0bba5b321..6ab0cddaf5 100644 --- a/apps/cli/src/commands/postgres-config/delete/delete.command.ts +++ b/apps/cli/src/commands/postgres-config/delete/delete.command.ts @@ -23,12 +23,12 @@ export const postgresConfigDeleteConfigFlag = stringSliceFlag( ); const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), config: postgresConfigDeleteConfigFlag, - noRestart: Flag.boolean("no-restart").pipe( + noRestart: Flag.Boolean("no-restart").pipe( Flag.withDescription("Do not restart the database after deleting config."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/postgres-config/get/get.command.ts b/apps/cli/src/commands/postgres-config/get/get.command.ts index 0b8b3b59c1..564628c55e 100644 --- a/apps/cli/src/commands/postgres-config/get/get.command.ts +++ b/apps/cli/src/commands/postgres-config/get/get.command.ts @@ -13,7 +13,7 @@ import { import { postgresConfigGet } from "./get.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/postgres-config/update/update.command.ts b/apps/cli/src/commands/postgres-config/update/update.command.ts index 37bafae8fb..2dfd853265 100644 --- a/apps/cli/src/commands/postgres-config/update/update.command.ts +++ b/apps/cli/src/commands/postgres-config/update/update.command.ts @@ -23,18 +23,18 @@ export const postgresConfigUpdateConfigFlag = stringSliceFlag( ); const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), config: postgresConfigUpdateConfigFlag, - replaceExistingOverrides: Flag.boolean("replace-existing-overrides").pipe( + replaceExistingOverrides: Flag.Boolean("replace-existing-overrides").pipe( Flag.withDescription( "If true, replaces all existing overrides with the ones provided. If false (default), merges existing overrides with the ones provided.", ), Flag.withDefault(false), ), - noRestart: Flag.boolean("no-restart").pipe( + noRestart: Flag.Boolean("no-restart").pipe( Flag.withDescription("Do not restart the database after updating config."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/projects/api-keys/api-keys.command.ts b/apps/cli/src/commands/projects/api-keys/api-keys.command.ts index b165c4f975..8563b6e518 100644 --- a/apps/cli/src/commands/projects/api-keys/api-keys.command.ts +++ b/apps/cli/src/commands/projects/api-keys/api-keys.command.ts @@ -6,11 +6,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { projectsApiKeys } from "./api-keys.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - reveal: Flag.boolean("reveal").pipe( + reveal: Flag.Boolean("reveal").pipe( Flag.withDescription("Reveal the secret API keys in full (e.g. sb_secret_...)."), Flag.withDefault(false), ), diff --git a/apps/cli/src/commands/projects/create/create.command.ts b/apps/cli/src/commands/projects/create/create.command.ts index a8a19b6820..7ca2da77c0 100644 --- a/apps/cli/src/commands/projects/create/create.command.ts +++ b/apps/cli/src/commands/projects/create/create.command.ts @@ -54,49 +54,49 @@ const INSTANCE_SIZES = [ ] as const; const config = { - name: Argument.string("name").pipe( + name: Argument.String("name").pipe( Argument.withDescription("Name of the project to create."), Argument.optional, ), - orgId: Flag.string("org-id").pipe( + orgId: Flag.String("org-id").pipe( Flag.withDescription("Organization ID to create the project in."), Flag.optional, ), - dbPassword: Flag.string("db-password").pipe( + dbPassword: Flag.String("db-password").pipe( Flag.withDescription("Database password of the project."), Flag.optional, ), - region: Flag.choice("region", AWS_REGIONS).pipe( + region: Flag.Literals("region", AWS_REGIONS).pipe( Flag.withDescription("Select a region close to you for the best performance."), Flag.optional, ), - size: Flag.choice("size", INSTANCE_SIZES).pipe( + size: Flag.Literals("size", INSTANCE_SIZES).pipe( Flag.withDescription("Select a desired instance size for your project."), Flag.optional, ), - highAvailability: Flag.boolean("high-availability").pipe( + highAvailability: Flag.Boolean("high-availability").pipe( Flag.withDescription("Enable high availability for the project."), Flag.optional, ), // Hidden and `--experimental`-gated: the upstream OpenAPI spec marks these fields deprecated // even though the API accepts them, restored via `packages/api/scripts/openapi-overrides.json`. - releaseChannel: Flag.choice("release-channel", RELEASE_CHANNELS).pipe( + releaseChannel: Flag.Literals("release-channel", RELEASE_CHANNELS).pipe( Flag.withDescription("Select a release channel for the project."), Flag.optional, Flag.withHidden, ), - postgresEngine: Flag.choice("postgres-engine", POSTGRES_ENGINES).pipe( + postgresEngine: Flag.Literals("postgres-engine", POSTGRES_ENGINES).pipe( Flag.withDescription("Select the Postgres engine for the project."), Flag.optional, Flag.withHidden, ), - interactive: Flag.boolean("interactive").pipe( + interactive: Flag.Boolean("interactive").pipe( Flag.withDescription("Enables interactive mode."), Flag.withAlias("i"), Flag.optional, Flag.withHidden, ), - plan: Flag.string("plan").pipe( + plan: Flag.String("plan").pipe( Flag.withDescription("Select a plan that suits your needs."), Flag.optional, Flag.withHidden, @@ -118,7 +118,7 @@ export const projectsCreateCommand = Command.make("create", config).pipe( projectsCreate(flags).pipe( // `high-availability` is omitted from `safeFlags` since boolean flags are always logged // verbatim regardless of that list. `config` auto-detects `region`/`size`/`release-channel`/ - // `postgres-engine` as safe since they're `Flag.choice`. + // `postgres-engine` as safe since they're `Flag.Literals`. withCommandTelemetry({ flags, safeFlags: ["org-id"], config }), withJsonErrorHandling, ), diff --git a/apps/cli/src/commands/projects/delete/delete.command.ts b/apps/cli/src/commands/projects/delete/delete.command.ts index a2a6cb7690..0159ce28b2 100644 --- a/apps/cli/src/commands/projects/delete/delete.command.ts +++ b/apps/cli/src/commands/projects/delete/delete.command.ts @@ -8,7 +8,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { projectsDelete } from "./delete.handler.ts"; const config = { - ref: Argument.string("ref").pipe( + ref: Argument.String("ref").pipe( Argument.withDescription("Project ref to delete."), Argument.optional, ), diff --git a/apps/cli/src/commands/pull/pull.command.ts b/apps/cli/src/commands/pull/pull.command.ts index 8bb5e1c261..27262d715a 100644 --- a/apps/cli/src/commands/pull/pull.command.ts +++ b/apps/cli/src/commands/pull/pull.command.ts @@ -11,29 +11,29 @@ import { pullRuntimeLayer } from "./pull.layers.ts"; const config = { // Accepts either a project ref or a branch name of the linked project — no separate `--target`. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription( "Project ref of the Supabase project, or the name (or UUID) of one of its branches. Values that are exactly 20 lowercase letters are always treated as project refs.", ), Flag.optional, ), - remoteLabel: Flag.string("remote-label").pipe( + remoteLabel: Flag.String("remote-label").pipe( Flag.withDescription( "Name of the [remotes.*] block the config step writes into, overriding the block it would otherwise reuse or create.", ), Flag.optional, ), - dryRun: Flag.boolean("dry-run").pipe( + dryRun: Flag.Boolean("dry-run").pipe( Flag.withDescription("Show what would be pulled without writing or changing anything."), Flag.withDefault(false), ), - force: Flag.boolean("force").pipe( + force: Flag.Boolean("force").pipe( Flag.withDescription( "Write even when supabase/config.toml (or config.json), supabase/migrations, or supabase/functions has uncommitted or untracked changes in git.", ), Flag.withDefault(false), ), - withMigrationHistory: Flag.boolean("with-migration-history").pipe( + withMigrationHistory: Flag.Boolean("with-migration-history").pipe( Flag.withDescription( "Fetch the remote migration history table into supabase/migrations, even when it already has files. Runs automatically when supabase/migrations is missing or empty.", ), diff --git a/apps/cli/src/commands/secrets/list/list.command.ts b/apps/cli/src/commands/secrets/list/list.command.ts index 557261455f..1c142701a6 100644 --- a/apps/cli/src/commands/secrets/list/list.command.ts +++ b/apps/cli/src/commands/secrets/list/list.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { secretsList } from "./list.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/secrets/set/set.command.ts b/apps/cli/src/commands/secrets/set/set.command.ts index c78461118e..2b42e12df1 100644 --- a/apps/cli/src/commands/secrets/set/set.command.ts +++ b/apps/cli/src/commands/secrets/set/set.command.ts @@ -7,15 +7,15 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { secretsSet } from "./set.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - envFile: Flag.string("env-file").pipe( + envFile: Flag.String("env-file").pipe( Flag.withDescription("Read secrets from a .env file."), Flag.optional, ), - secrets: Argument.string("NAME=VALUE").pipe( + secrets: Argument.String("NAME=VALUE").pipe( Argument.withDescription("Secret name=value pairs to set."), Argument.variadic(), ), diff --git a/apps/cli/src/commands/secrets/unset/unset.command.ts b/apps/cli/src/commands/secrets/unset/unset.command.ts index 955baf0d3c..1b7ee38301 100644 --- a/apps/cli/src/commands/secrets/unset/unset.command.ts +++ b/apps/cli/src/commands/secrets/unset/unset.command.ts @@ -9,11 +9,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { secretsUnset } from "./unset.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - names: Argument.string("NAME").pipe( + names: Argument.String("NAME").pipe( Argument.withDescription("Secret names to unset."), Argument.variadic(), ), diff --git a/apps/cli/src/commands/seed/buckets/buckets.command.ts b/apps/cli/src/commands/seed/buckets/buckets.command.ts index f3c229523c..18994ae3fc 100644 --- a/apps/cli/src/commands/seed/buckets/buckets.command.ts +++ b/apps/cli/src/commands/seed/buckets/buckets.command.ts @@ -12,7 +12,7 @@ import { seedBuckets } from "./buckets.handler.ts"; const config = { // TS-only flag; see push.command.ts (db push) for the same pattern. - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/seed/seed.flags.ts b/apps/cli/src/commands/seed/seed.flags.ts index 38297ea804..12aeb60b49 100644 --- a/apps/cli/src/commands/seed/seed.flags.ts +++ b/apps/cli/src/commands/seed/seed.flags.ts @@ -7,15 +7,15 @@ import { Flag, GlobalFlag } from "effect/cli"; * the changed-flag set (`buckets.flags.ts`), not these parsed values — the * defaults only affect help text and the telemetry flags map. */ -export const SeedLinkedFlag = GlobalFlag.setting("linked")({ - flag: Flag.boolean("linked").pipe( +export const SeedLinkedFlag = GlobalFlag.Setting("linked")({ + flag: Flag.Boolean("linked").pipe( Flag.withDescription("Seeds the linked project."), Flag.withDefault(false), ), }); -export const SeedLocalFlag = GlobalFlag.setting("local")({ - flag: Flag.boolean("local").pipe( +export const SeedLocalFlag = GlobalFlag.Setting("local")({ + flag: Flag.Boolean("local").pipe( Flag.withDescription("Seeds the local database."), Flag.withDefault(true), ), diff --git a/apps/cli/src/commands/snippets/download/download.command.ts b/apps/cli/src/commands/snippets/download/download.command.ts index 2c85503509..16872c7f74 100644 --- a/apps/cli/src/commands/snippets/download/download.command.ts +++ b/apps/cli/src/commands/snippets/download/download.command.ts @@ -7,10 +7,10 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { snippetsDownload } from "./download.handler.ts"; const config = { - snippetId: Argument.string("snippet-id").pipe( + snippetId: Argument.String("snippet-id").pipe( Argument.withDescription("ID of the SQL snippet to download."), ), - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/snippets/list/list.command.ts b/apps/cli/src/commands/snippets/list/list.command.ts index 3a7d632c87..20df3ff225 100644 --- a/apps/cli/src/commands/snippets/list/list.command.ts +++ b/apps/cli/src/commands/snippets/list/list.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { snippetsList } from "./list.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/ssl-enforcement/get/get.command.ts b/apps/cli/src/commands/ssl-enforcement/get/get.command.ts index 1dc6519d18..19fbf70bd6 100644 --- a/apps/cli/src/commands/ssl-enforcement/get/get.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/get/get.command.ts @@ -13,7 +13,7 @@ import { import { sslEnforcementGet } from "./get.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/ssl-enforcement/update/update.command.ts b/apps/cli/src/commands/ssl-enforcement/update/update.command.ts index 39d693dde7..07b00dab5e 100644 --- a/apps/cli/src/commands/ssl-enforcement/update/update.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/update/update.command.ts @@ -13,17 +13,17 @@ import { import { sslEnforcementUpdate } from "./update.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - enableDbSslEnforcement: Flag.boolean("enable-db-ssl-enforcement").pipe( + enableDbSslEnforcement: Flag.Boolean("enable-db-ssl-enforcement").pipe( Flag.withDescription( "Whether the DB should enable SSL enforcement for all external connections.", ), Flag.withDefault(false), ), - disableDbSslEnforcement: Flag.boolean("disable-db-ssl-enforcement").pipe( + disableDbSslEnforcement: Flag.Boolean("disable-db-ssl-enforcement").pipe( Flag.withDescription( "Whether the DB should disable SSL enforcement for all external connections.", ), diff --git a/apps/cli/src/commands/sso/add/add.command.ts b/apps/cli/src/commands/sso/add/add.command.ts index d407a9c97d..42a33a17b0 100644 --- a/apps/cli/src/commands/sso/add/add.command.ts +++ b/apps/cli/src/commands/sso/add/add.command.ts @@ -15,41 +15,41 @@ export const ssoAddDomainsFlag = stringSliceFlag( ); const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), // No `Flag.optional`: `--type` is required, enforced by the CLI parser. - type: Flag.choice("type", ["saml"] as const).pipe( + type: Flag.Literals("type", ["saml"] as const).pipe( Flag.withAlias("t"), Flag.withDescription("Type of identity provider (according to supported protocol)."), ), domains: ssoAddDomainsFlag, - metadataFile: Flag.string("metadata-file").pipe( + metadataFile: Flag.String("metadata-file").pipe( Flag.withDescription( "File containing a SAML 2.0 Metadata XML document describing the identity provider.", ), Flag.optional, ), - metadataUrl: Flag.string("metadata-url").pipe( + metadataUrl: Flag.String("metadata-url").pipe( Flag.withDescription( "URL pointing to a SAML 2.0 Metadata XML document describing the identity provider.", ), Flag.optional, ), - skipUrlValidation: Flag.boolean("skip-url-validation").pipe( + skipUrlValidation: Flag.Boolean("skip-url-validation").pipe( Flag.withDescription( "Skip local validation of the SAML 2.0 Metadata URL (HTTPS requirement, live GET probe, and UTF-8 body decode). Use in air-gapped CI where the IDP is not reachable from the build agent.", ), Flag.withDefault(false), ), - attributeMappingFile: Flag.string("attribute-mapping-file").pipe( + attributeMappingFile: Flag.String("attribute-mapping-file").pipe( Flag.withDescription( "File containing a JSON mapping between SAML attributes to custom JWT claims.", ), Flag.optional, ), - nameIdFormat: Flag.choice("name-id-format", SSO_NAME_ID_FORMATS).pipe( + nameIdFormat: Flag.Literals("name-id-format", SSO_NAME_ID_FORMATS).pipe( Flag.withDescription( "URI reference representing the classification of string-based identifier information.", ), diff --git a/apps/cli/src/commands/sso/info/info.command.ts b/apps/cli/src/commands/sso/info/info.command.ts index 82049dd5de..f7ef7b1d3c 100644 --- a/apps/cli/src/commands/sso/info/info.command.ts +++ b/apps/cli/src/commands/sso/info/info.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { ssoInfo } from "./info.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/sso/list/list.command.ts b/apps/cli/src/commands/sso/list/list.command.ts index e84f799969..a3cd242bae 100644 --- a/apps/cli/src/commands/sso/list/list.command.ts +++ b/apps/cli/src/commands/sso/list/list.command.ts @@ -7,7 +7,7 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { ssoList } from "./list.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/sso/remove/remove.command.ts b/apps/cli/src/commands/sso/remove/remove.command.ts index 81e3e5e040..49d70dfb3e 100644 --- a/apps/cli/src/commands/sso/remove/remove.command.ts +++ b/apps/cli/src/commands/sso/remove/remove.command.ts @@ -7,11 +7,11 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { ssoRemove } from "./remove.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - providerId: Argument.string("provider-id").pipe( + providerId: Argument.String("provider-id").pipe( Argument.withDescription("The ID of the SSO identity provider to remove."), ), }; diff --git a/apps/cli/src/commands/sso/show/show.command.ts b/apps/cli/src/commands/sso/show/show.command.ts index 2752bc282a..678d1a5ecb 100644 --- a/apps/cli/src/commands/sso/show/show.command.ts +++ b/apps/cli/src/commands/sso/show/show.command.ts @@ -7,15 +7,15 @@ import { withCommandTelemetry } from "../../../telemetry/command-telemetry.ts"; import { ssoShow } from "./show.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), - metadata: Flag.boolean("metadata").pipe( + metadata: Flag.Boolean("metadata").pipe( Flag.withDescription("Show SAML 2.0 XML Metadata only"), Flag.withDefault(false), ), - providerId: Argument.string("provider-id").pipe( + providerId: Argument.String("provider-id").pipe( Argument.withDescription("The ID of the SSO identity provider to show."), ), }; diff --git a/apps/cli/src/commands/sso/sso.e2e.test.ts b/apps/cli/src/commands/sso/sso.e2e.test.ts index eb4790cdef..92a08c0711 100644 --- a/apps/cli/src/commands/sso/sso.e2e.test.ts +++ b/apps/cli/src/commands/sso/sso.e2e.test.ts @@ -97,7 +97,7 @@ describe("supabase sso", () => { // Usage-silencing is set before required-flag validation, so a missing // `--type` prints a single clean stderr line with no usage block — but - // `Flag.choice` validation runs during parsing, before that point, so an + // `Flag.Literals` validation runs during parsing, before that point, so an // invalid `--type` value still shows a usage block. it.live( "add without --type: stdout stays clean, stderr is a single Go-parity line (no usage block)", diff --git a/apps/cli/src/commands/sso/update/update.command.ts b/apps/cli/src/commands/sso/update/update.command.ts index 4ece232c5f..18ce829833 100644 --- a/apps/cli/src/commands/sso/update/update.command.ts +++ b/apps/cli/src/commands/sso/update/update.command.ts @@ -26,44 +26,44 @@ export const ssoUpdateRemoveDomainsFlag = stringSliceFlag( ); const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), domains: ssoUpdateDomainsFlag, addDomains: ssoUpdateAddDomainsFlag, removeDomains: ssoUpdateRemoveDomainsFlag, - metadataFile: Flag.string("metadata-file").pipe( + metadataFile: Flag.String("metadata-file").pipe( Flag.withDescription( "File containing a SAML 2.0 Metadata XML document describing the identity provider.", ), Flag.optional, ), - metadataUrl: Flag.string("metadata-url").pipe( + metadataUrl: Flag.String("metadata-url").pipe( Flag.withDescription( "URL pointing to a SAML 2.0 Metadata XML document describing the identity provider.", ), Flag.optional, ), - skipUrlValidation: Flag.boolean("skip-url-validation").pipe( + skipUrlValidation: Flag.Boolean("skip-url-validation").pipe( Flag.withDescription( "Skip local validation of the SAML 2.0 Metadata URL (HTTPS requirement, live GET probe, and UTF-8 body decode). Use in air-gapped CI where the IDP is not reachable from the build agent.", ), Flag.withDefault(false), ), - attributeMappingFile: Flag.string("attribute-mapping-file").pipe( + attributeMappingFile: Flag.String("attribute-mapping-file").pipe( Flag.withDescription( "File containing a JSON mapping between SAML attributes to custom JWT claims.", ), Flag.optional, ), - nameIdFormat: Flag.choice("name-id-format", SSO_NAME_ID_FORMATS).pipe( + nameIdFormat: Flag.Literals("name-id-format", SSO_NAME_ID_FORMATS).pipe( Flag.withDescription( "URI reference representing the classification of string-based identifier information.", ), Flag.optional, ), - providerId: Argument.string("provider-id").pipe( + providerId: Argument.String("provider-id").pipe( Argument.withDescription("The ID of the SSO identity provider to update."), ), }; diff --git a/apps/cli/src/commands/start/start.command.ts b/apps/cli/src/commands/start/start.command.ts index 8d1f8344b4..63d60648c2 100644 --- a/apps/cli/src/commands/start/start.command.ts +++ b/apps/cli/src/commands/start/start.command.ts @@ -32,11 +32,11 @@ export const startExcludeFlag = stringSliceFlag( const config = { exclude: startExcludeFlag, - ignoreHealthCheck: Flag.boolean("ignore-health-check").pipe( + ignoreHealthCheck: Flag.Boolean("ignore-health-check").pipe( Flag.withDescription("Ignore unhealthy services and exit 0"), Flag.withDefault(false), ), - preview: Flag.boolean("preview").pipe( + preview: Flag.Boolean("preview").pipe( Flag.withDescription("Connect to feature preview branch"), Flag.withDefault(false), Flag.withHidden, diff --git a/apps/cli/src/commands/status/status.command.ts b/apps/cli/src/commands/status/status.command.ts index 18bf56ae29..8d0c6e77c0 100644 --- a/apps/cli/src/commands/status/status.command.ts +++ b/apps/cli/src/commands/status/status.command.ts @@ -31,7 +31,7 @@ export const statusExcludeFlag = stringSliceFlag( const config = { overrideName: statusOverrideNameFlag, exclude: statusExcludeFlag, - ignoreHealthCheck: Flag.boolean("ignore-health-check").pipe( + ignoreHealthCheck: Flag.Boolean("ignore-health-check").pipe( Flag.withDescription("Ignore unhealthy services and exit 0"), Flag.withHidden, Flag.withDefault(false), diff --git a/apps/cli/src/commands/stop/stop.command.ts b/apps/cli/src/commands/stop/stop.command.ts index cddf20fdfc..4b1c28a03a 100644 --- a/apps/cli/src/commands/stop/stop.command.ts +++ b/apps/cli/src/commands/stop/stop.command.ts @@ -11,24 +11,24 @@ import { withCommandTelemetry } from "../../telemetry/command-telemetry.ts"; import { stop } from "./stop.handler.ts"; const config = { - projectId: Flag.string("project-id").pipe( + projectId: Flag.String("project-id").pipe( Flag.withDescription("Local project ID to stop."), Flag.optional, ), // Hidden for backward compatibility: `--backup=false` is equivalent to `--no-backup`. - backup: Flag.boolean("backup").pipe( + backup: Flag.Boolean("backup").pipe( Flag.withDescription("Backs up the current database before stopping."), Flag.withDefault(true), Flag.withHidden, ), - noBackup: Flag.boolean("no-backup").pipe( + noBackup: Flag.Boolean("no-backup").pipe( Flag.withDescription("Deletes all data volumes after stopping."), Flag.withDefault(false), ), // `Option` so presence means "explicitly set": `--project-id`/`--all` are mutually // exclusive whenever both were explicitly set, regardless of `--all`'s value. A plain - // `Flag.boolean` couldn't distinguish `--project-id x --all=false` from `--project-id x` alone. - all: Flag.boolean("all").pipe( + // `Flag.Boolean` couldn't distinguish `--project-id x --all=false` from `--project-id x` alone. + all: Flag.Boolean("all").pipe( Flag.withDescription("Stop all local Supabase instances from all projects across the machine."), Flag.optional, ), diff --git a/apps/cli/src/commands/storage/cp/cp.command.ts b/apps/cli/src/commands/storage/cp/cp.command.ts index 6de42301e3..f988f0b7df 100644 --- a/apps/cli/src/commands/storage/cp/cp.command.ts +++ b/apps/cli/src/commands/storage/cp/cp.command.ts @@ -22,28 +22,28 @@ import { storageCp } from "./cp.handler.ts"; // Flags are declared before `src`/`dst` on purpose: Effect CLI validates flags before positional // args in declaration order, so a malformed `--jobs` must fail before a missing-operand error. const config = { - recursive: Flag.boolean("recursive").pipe( + recursive: Flag.Boolean("recursive").pipe( Flag.withAlias("r"), Flag.withDescription("Recursively copy a directory."), Flag.withDefault(false), ), - cacheControl: Flag.string("cache-control").pipe( + cacheControl: Flag.String("cache-control").pipe( Flag.withDescription('Custom Cache-Control header for HTTP upload. (default "max-age=3600")'), Flag.optional, ), - contentType: Flag.string("content-type").pipe( + contentType: Flag.String("content-type").pipe( Flag.withDescription('Custom Content-Type header for HTTP upload. (default "auto-detect")'), Flag.optional, ), - jobs: Flag.string("jobs").pipe( + jobs: Flag.String("jobs").pipe( Flag.withAlias("j"), - // Declared as a string, not `Flag.integer`, so the raw token reaches the parser below; + // Declared as a string, not `Flag.Int`, so the raw token reaches the parser below; // `withMetavar` keeps the `--jobs, -j integer` help token. Flag.withMetavar("integer"), Flag.withDescription("Maximum number of parallel jobs. (default 1)"), // `--jobs` is a pflag-style uint: a non-uint token must fail at parse time, before the // experimental gate, the handler, or any telemetry, with pflag's exact message and original - // spelling preserved. `Flag.integer` loses that fidelity (`-0` normalizes to negative zero, + // spelling preserved. `Flag.Int` loses that fidelity (`-0` normalizes to negative zero, // which a `value < 0` check would wrongly accept), so this parses the raw token with // `parseUintBase0` instead; it must sit before `Flag.optional`, which passes `InvalidValue` // through untouched. @@ -62,8 +62,8 @@ const config = { linked: StorageLinkedFlagDef, local: StorageLocalFlagDef, projectRef: StorageProjectRefFlagDef, - src: Argument.string("src").pipe(Argument.withDescription("Source path to copy from.")), - dst: Argument.string("dst").pipe(Argument.withDescription("Destination path to copy to.")), + src: Argument.String("src").pipe(Argument.withDescription("Source path to copy from.")), + dst: Argument.String("dst").pipe(Argument.withDescription("Destination path to copy to.")), } as const; export type StorageCpFlags = CliCommand.Command.Config.Infer; diff --git a/apps/cli/src/commands/storage/ls/ls.command.ts b/apps/cli/src/commands/storage/ls/ls.command.ts index 392f6547c9..69cccf48df 100644 --- a/apps/cli/src/commands/storage/ls/ls.command.ts +++ b/apps/cli/src/commands/storage/ls/ls.command.ts @@ -16,11 +16,11 @@ import { import { storageLs } from "./ls.handler.ts"; const config = { - path: Argument.string("path").pipe( + path: Argument.String("path").pipe( Argument.withDescription("Storage path to list (e.g. ss:///bucket/docs)."), Argument.optional, ), - recursive: Flag.boolean("recursive").pipe( + recursive: Flag.Boolean("recursive").pipe( Flag.withAlias("r"), Flag.withDescription("Recursively list a directory."), Flag.withDefault(false), diff --git a/apps/cli/src/commands/storage/mv/mv.command.ts b/apps/cli/src/commands/storage/mv/mv.command.ts index 7baa7d3a9e..7af3de30d1 100644 --- a/apps/cli/src/commands/storage/mv/mv.command.ts +++ b/apps/cli/src/commands/storage/mv/mv.command.ts @@ -16,9 +16,9 @@ import { import { storageMv } from "./mv.handler.ts"; const config = { - src: Argument.string("src").pipe(Argument.withDescription("Source path to move from.")), - dst: Argument.string("dst").pipe(Argument.withDescription("Destination path to move to.")), - recursive: Flag.boolean("recursive").pipe( + src: Argument.String("src").pipe(Argument.withDescription("Source path to move from.")), + dst: Argument.String("dst").pipe(Argument.withDescription("Destination path to move to.")), + recursive: Flag.Boolean("recursive").pipe( Flag.withAlias("r"), Flag.withDescription("Recursively move a directory."), Flag.withDefault(false), diff --git a/apps/cli/src/commands/storage/rm/rm.command.ts b/apps/cli/src/commands/storage/rm/rm.command.ts index dac4716e08..35c3babe0c 100644 --- a/apps/cli/src/commands/storage/rm/rm.command.ts +++ b/apps/cli/src/commands/storage/rm/rm.command.ts @@ -16,11 +16,11 @@ import { import { storageRm } from "./rm.handler.ts"; const config = { - files: Argument.string("file").pipe( + files: Argument.String("file").pipe( Argument.withDescription("File paths to remove."), Argument.variadic(), ), - recursive: Flag.boolean("recursive").pipe( + recursive: Flag.Boolean("recursive").pipe( Flag.withAlias("r"), Flag.withDescription("Recursively remove a directory."), Flag.withDefault(false), diff --git a/apps/cli/src/commands/storage/storage.flags.ts b/apps/cli/src/commands/storage/storage.flags.ts index 419b52a91a..785377cf77 100644 --- a/apps/cli/src/commands/storage/storage.flags.ts +++ b/apps/cli/src/commands/storage/storage.flags.ts @@ -11,19 +11,19 @@ import { StorageMutuallyExclusiveFlagsError } from "./storage.errors.ts"; * tree-wide and `seed` already owns `linked`/`local`, so these must follow the * subcommand token (`storage ls --local`, not `storage --local ls`). */ -export const StorageLinkedFlagDef = Flag.boolean("linked").pipe( +export const StorageLinkedFlagDef = Flag.Boolean("linked").pipe( Flag.withDescription("Connects to Storage API of the linked project."), Flag.withDefault(true), ); -export const StorageLocalFlagDef = Flag.boolean("local").pipe( +export const StorageLocalFlagDef = Flag.Boolean("local").pipe( Flag.withDescription("Connects to Storage API of the local database."), Flag.withDefault(false), ); // Overrides the project ref for the linked target; declared once since all four // storage leaves share the identical flag. -export const StorageProjectRefFlagDef = Flag.string("project-ref").pipe( +export const StorageProjectRefFlagDef = Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ); diff --git a/apps/cli/src/commands/test/new/new.command.ts b/apps/cli/src/commands/test/new/new.command.ts index 6720ae7d35..02dcd8f661 100644 --- a/apps/cli/src/commands/test/new/new.command.ts +++ b/apps/cli/src/commands/test/new/new.command.ts @@ -13,8 +13,8 @@ import { testNew } from "./new.handler.ts"; const TEMPLATE_VALUES = ["pgtap"] as const; const config = { - name: Argument.string("name").pipe(Argument.withDescription("Name of the test file to create.")), - template: Flag.choice("template", TEMPLATE_VALUES).pipe( + name: Argument.String("name").pipe(Argument.withDescription("Name of the test file to create.")), + template: Flag.Literals("template", TEMPLATE_VALUES).pipe( Flag.withAlias("t"), Flag.withDescription("Template framework to generate."), Flag.optional, diff --git a/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts b/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts index 328256f7e7..f14e29e3f2 100644 --- a/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/activate/activate.command.ts @@ -13,14 +13,14 @@ import { import { vanitySubdomainsActivate } from "./activate.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), // Optional at parse time so the --experimental gate, login check, and project-ref // resolution all run first; required-ness is enforced in the handler after ref // resolution. - desiredSubdomain: Flag.string("desired-subdomain").pipe( + desiredSubdomain: Flag.String("desired-subdomain").pipe( Flag.withDescription("The desired vanity subdomain to use for your Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts b/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts index 7270e2737f..23ca7b76fe 100644 --- a/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/check-availability/check-availability.command.ts @@ -13,14 +13,14 @@ import { import { vanitySubdomainsCheckAvailability } from "./check-availability.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), // Optional at parse time so the --experimental gate, login check, and project-ref // resolution all run first; required-ness is enforced in the handler after ref // resolution. - desiredSubdomain: Flag.string("desired-subdomain").pipe( + desiredSubdomain: Flag.String("desired-subdomain").pipe( Flag.withDescription("The desired vanity subdomain to use for your Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts b/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts index 7b211e049a..32550e8186 100644 --- a/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts @@ -13,7 +13,7 @@ import { import { vanitySubdomainsDelete } from "./delete.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/commands/vanity-subdomains/get/get.command.ts b/apps/cli/src/commands/vanity-subdomains/get/get.command.ts index de5d4d3aeb..2cbe24655a 100644 --- a/apps/cli/src/commands/vanity-subdomains/get/get.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/get/get.command.ts @@ -13,7 +13,7 @@ import { import { vanitySubdomainsGet } from "./get.handler.ts"; const config = { - projectRef: Flag.string("project-ref").pipe( + projectRef: Flag.String("project-ref").pipe( Flag.withDescription("Project ref of the Supabase project."), Flag.optional, ), diff --git a/apps/cli/src/config/command-settings.layer.ts b/apps/cli/src/config/command-settings.layer.ts index 90f177897d..27dc344cf2 100644 --- a/apps/cli/src/config/command-settings.layer.ts +++ b/apps/cli/src/config/command-settings.layer.ts @@ -113,8 +113,8 @@ export const commandSettingsLayer = Layer.unwrap( const runtimeInfo = yield* RuntimeInfo; const provider = yield* ConfigProvider.ConfigProvider; const read = (config: Config.Config) => config.parse(provider); - const profileEnvValue = yield* read(Config.option(Config.string("SUPABASE_PROFILE"))); - const supabaseHome = yield* read(Config.option(Config.string("SUPABASE_HOME"))); + const profileEnvValue = yield* read(Config.option(Config.String("SUPABASE_PROFILE"))); + const supabaseHome = yield* read(Config.option(Config.String("SUPABASE_HOME"))); const resolvedSupabaseHome = resolveSupabaseHomeValue( path, supabaseHome, @@ -144,25 +144,25 @@ export const commandSettingsLayer = Layer.unwrap( debugLogger, ); - const rawDbPassword = yield* read(Config.option(Config.string("SUPABASE_DB_PASSWORD"))); + const rawDbPassword = yield* read(Config.option(Config.String("SUPABASE_DB_PASSWORD"))); const dbPassword = Option.filter(rawDbPassword, (value) => value.length > 0).pipe( Option.map((value) => Redacted.make(value, { label: "SUPABASE_DB_PASSWORD" })), ); - const rawGithubToken = yield* read(Config.option(Config.string("GITHUB_TOKEN"))); + const rawGithubToken = yield* read(Config.option(Config.String("GITHUB_TOKEN"))); const githubToken = Option.filter(rawGithubToken, (value) => value.length > 0).pipe( Option.map((value) => Redacted.make(value, { label: "GITHUB_TOKEN" })), ); - const rawAccessToken = yield* read(Config.option(Config.string("SUPABASE_ACCESS_TOKEN"))); + const rawAccessToken = yield* read(Config.option(Config.String("SUPABASE_ACCESS_TOKEN"))); const accessToken = Option.filter(rawAccessToken, (value) => value.length > 0).pipe( Option.map((value) => Redacted.make(value, { label: "SUPABASE_ACCESS_TOKEN" })), ); - const rawProjectId = yield* read(Config.option(Config.string("SUPABASE_PROJECT_ID"))); + const rawProjectId = yield* read(Config.option(Config.String("SUPABASE_PROJECT_ID"))); const projectId = Option.filter(rawProjectId, (value) => value.length > 0); - const workdirEnvValue = yield* read(Config.option(Config.string("SUPABASE_WORKDIR"))); + const workdirEnvValue = yield* read(Config.option(Config.String("SUPABASE_WORKDIR"))); const { workdir, explicit: explicitWorkdir } = yield* resolveWorkdir( workdirFlag, workdirEnvValue, diff --git a/apps/cli/src/docs/docs-introspection.ts b/apps/cli/src/docs/docs-introspection.ts index cedfe58ca0..3abcfa5836 100644 --- a/apps/cli/src/docs/docs-introspection.ts +++ b/apps/cli/src/docs/docs-introspection.ts @@ -66,7 +66,7 @@ export function userGlobalFlagParams(command: Command.Command.Any): ReadonlyArra } /** - * `choiceKeys` (the valid value set for `Flag.choice`/`Flag.choiceWithValue`) is attached to + * `choiceKeys` (the valid value set for `Flag.Literals`/`Flag.ChoiceWithValue`) is attached to * the `Primitive` at runtime but carries an `@internal` tag and is absent from the public * type, so this narrows through the same runtime type-guard idiom as `CommandInternals` above. */ diff --git a/apps/cli/src/docs/docs-spec.unit.test.ts b/apps/cli/src/docs/docs-spec.unit.test.ts index 6d951aeb69..de61aa1041 100644 --- a/apps/cli/src/docs/docs-spec.unit.test.ts +++ b/apps/cli/src/docs/docs-spec.unit.test.ts @@ -367,7 +367,7 @@ describe("build guards fail loudly", () => { const root = Command.make("supabase").pipe( Command.withSubcommands([ Command.make("db").pipe( - Command.withSubcommands([Command.make("query", { output: Flag.string("output") })]), + Command.withSubcommands([Command.make("query", { output: Flag.String("output") })]), ), ]), Command.withGlobalFlags([ExperimentalFlag]), diff --git a/apps/cli/src/shared/cli/run.integration.test.ts b/apps/cli/src/shared/cli/run.integration.test.ts index de88e5ce93..60a27b03a7 100644 --- a/apps/cli/src/shared/cli/run.integration.test.ts +++ b/apps/cli/src/shared/cli/run.integration.test.ts @@ -71,7 +71,7 @@ describe("group command exit codes (CLI-1906)", () => { * service `withoutParseErrorHelpDump` overrides and replays through. * * `branchesCommand` covers the `UnrecognizedOption` shape end to end. `MissingOption`/ - * `InvalidValue` need a genuinely required flag or `Flag.choice`, which every shipped command + * `InvalidValue` need a genuinely required flag or `Flag.Literals`, which every shipped command * with one also wraps in its own management-API runtime layer — a minimal synthetic * `Command.make` runs through the same `Command.runWith`/`showHelp()` machinery without that * overhead. A real subprocess run against `sso add` is covered end to end by `sso.e2e.test.ts`. @@ -95,7 +95,7 @@ describe("withoutParseErrorHelpDump (CLI-1901)", () => { // `type`'s `-t` alias mirrors the real `sso add --type`/`-t` flag, so the short-alias case // below exercises the same shape without pulling in a management-API runtime layer. const requiredFlagCommand = Command.make("test-required-flag", { - type: Flag.choice("type", ["saml"] as const).pipe(Flag.withAlias("t")), + type: Flag.Literals("type", ["saml"] as const).pipe(Flag.withAlias("t")), }); const runRequiredFlagCommand = (args: ReadonlyArray, console: Console.Console) => @@ -180,7 +180,7 @@ describe("withoutParseErrorHelpDump (CLI-1901)", () => { ); it.effect( - "an invalid Flag.choice value: replays the help dump to stderr (never stdout) and drops the duplicate error, but still fails with the original cause", + "an invalid Flag.Literals value: replays the help dump to stderr (never stdout) and drops the duplicate error, but still fails with the original cause", () => Effect.gen(function* () { const { console, calls } = fakeConsole(); @@ -232,7 +232,7 @@ describe("nested command parsing", () => { Effect.gen(function* () { let receivedPaths: ReadonlyArray = []; const db = Command.make("db", { - paths: Argument.string("path").pipe(Argument.variadic()), + paths: Argument.String("path").pipe(Argument.variadic()), }).pipe( Command.withHandler(({ paths }) => Effect.sync(() => { diff --git a/apps/cli/src/shared/cli/run.unit.test.ts b/apps/cli/src/shared/cli/run.unit.test.ts index 4e0fd082c3..58f7c5072d 100644 --- a/apps/cli/src/shared/cli/run.unit.test.ts +++ b/apps/cli/src/shared/cli/run.unit.test.ts @@ -308,7 +308,7 @@ describe("classifyParseErrorConsoleOutput", () => { ).toBe("drop"); }); - it("flushes the help dump to stderr for an invalid Flag.choice value", () => { + it("flushes the help dump to stderr for an invalid Flag.Literals value", () => { const cause = Cause.fail( new CliError.ShowHelp({ commandPath: ["supabase", "sso", "add"], diff --git a/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts b/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts index 7462242dce..44cd05969d 100644 --- a/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts +++ b/apps/cli/src/shared/cli/subcommand-flag-suggestions.unit.test.ts @@ -159,7 +159,7 @@ describe("subcommand flag placement suggestions", () => { }); it("also collapses the doubled prefix for a non-choice primitive whose failure text starts with 'Expected' (e.g. an invalid integer flag value)", () => { - // Real failure text from effect's schema-backed `Primitive.integer` (also affects `float`, + // Real failure text from effect's schema-backed `Primitive.Int` (also affects `float`, // `boolean`, and `date`). const errors = formatCliErrorsForDisplay([ new CliError.InvalidValue({ @@ -178,7 +178,7 @@ describe("subcommand flag placement suggestions", () => { }); it("leaves invalid-value errors whose expected text does not start with 'Expected' unchanged", () => { - // Real failure text from effect's `Primitive.keyValuePair`, which never starts with + // Real failure text from effect's `Primitive.KeyValuePair`, which never starts with // "Expected", so it needs no rewriting. const errors = formatCliErrorsForDisplay([ new CliError.InvalidValue({ diff --git a/apps/cli/src/shared/compute/compute-runtimes.ts b/apps/cli/src/shared/compute/compute-runtimes.ts index 1ae981e044..6500b1d6e7 100644 --- a/apps/cli/src/shared/compute/compute-runtimes.ts +++ b/apps/cli/src/shared/compute/compute-runtimes.ts @@ -27,7 +27,7 @@ function isComputeRuntime(value: string): value is ComputeRuntime { /** * Parses a config-file `[compute.] runtime` value case-insensitively (hand-written casing * like `Runtime = "Node"` should still mean `node`). Not used for `--runtime`, which validates - * through a `Flag.choice` over the same catalog instead. + * through a `Flag.Literals` over the same catalog instead. */ export function parseComputeRuntime(value: string): ComputeRuntime | undefined { const canonical = value.trim().toLowerCase(); diff --git a/apps/cli/src/shared/config/cli-settings.layer.ts b/apps/cli/src/shared/config/cli-settings.layer.ts index e205ad78d9..dabd8bddaa 100644 --- a/apps/cli/src/shared/config/cli-settings.layer.ts +++ b/apps/cli/src/shared/config/cli-settings.layer.ts @@ -23,30 +23,30 @@ const makeCliSettings = Effect.gen(function* () { }); const read = (config: Config.Config) => config.parse(provider); const posthogConfig = yield* resolvePosthogConfig(provider); - const supabaseHome = yield* read(Config.option(Config.string("SUPABASE_HOME"))); + const supabaseHome = yield* read(Config.option(Config.String("SUPABASE_HOME"))); return CliSettings.of({ apiUrl: yield* read( - Config.string("SUPABASE_API_URL").pipe(Config.withDefault(SUPABASE_API_URL)), + Config.String("SUPABASE_API_URL").pipe(Config.withDefault(SUPABASE_API_URL)), ), dashboardUrl: yield* read( - Config.string("SUPABASE_DASHBOARD_URL").pipe(Config.withDefault(SUPABASE_DASHBOARD_URL)), + Config.String("SUPABASE_DASHBOARD_URL").pipe(Config.withDefault(SUPABASE_DASHBOARD_URL)), ), projectHost: yield* read( - Config.string("SUPABASE_PROJECT_HOST").pipe(Config.withDefault(SUPABASE_PROJECT_HOST)), + Config.String("SUPABASE_PROJECT_HOST").pipe(Config.withDefault(SUPABASE_PROJECT_HOST)), ), telemetryPosthogHost: posthogConfig.host, telemetryPosthogKey: posthogConfig.key, accessToken: Option.map( - yield* read(Config.option(Config.string("SUPABASE_ACCESS_TOKEN"))), + yield* read(Config.option(Config.String("SUPABASE_ACCESS_TOKEN"))), (token) => Redacted.make(token, { label: "SUPABASE_ACCESS_TOKEN" }), ), - noKeyring: yield* read(Config.option(Config.string("SUPABASE_NO_KEYRING"))), + noKeyring: yield* read(Config.option(Config.String("SUPABASE_NO_KEYRING"))), supabaseHome: resolveSupabaseHomeValue(path, supabaseHome, runtimeInfo.homeDir), - debug: yield* read(Config.option(Config.string("SUPABASE_DEBUG"))), - telemetryDebug: yield* read(Config.option(Config.string("SUPABASE_TELEMETRY_DEBUG"))), - telemetryDisabled: yield* read(Config.option(Config.string("SUPABASE_TELEMETRY_DISABLED"))), - doNotTrack: yield* read(Config.option(Config.string("DO_NOT_TRACK"))), + debug: yield* read(Config.option(Config.String("SUPABASE_DEBUG"))), + telemetryDebug: yield* read(Config.option(Config.String("SUPABASE_TELEMETRY_DEBUG"))), + telemetryDisabled: yield* read(Config.option(Config.String("SUPABASE_TELEMETRY_DISABLED"))), + doNotTrack: yield* read(Config.option(Config.String("DO_NOT_TRACK"))), }); }); diff --git a/apps/cli/src/shared/functions/deploy.ts b/apps/cli/src/shared/functions/deploy.ts index 9193c0e0a5..5a604d0cc3 100644 --- a/apps/cli/src/shared/functions/deploy.ts +++ b/apps/cli/src/shared/functions/deploy.ts @@ -414,7 +414,7 @@ const hostError = (pathname: string) => (error: PlatformError.PlatformError) => const unknownHostError = (pathname: string) => (error: PlatformError.PlatformError) => new Cause.UnknownError(hostError(pathname)(error), "An error occurred in Effect.tryPromise"); -const debugEnvEnabled = Config.option(Config.string("DEBUG")).pipe( +const debugEnvEnabled = Config.option(Config.String("DEBUG")).pipe( Effect.map(Option.exists((value) => value === "true")), Effect.orDie, ); diff --git a/apps/cli/src/shared/functions/serve.main.ts b/apps/cli/src/shared/functions/serve.main.ts index bfcd1fd5c7..b562e0ebf7 100644 --- a/apps/cli/src/shared/functions/serve.main.ts +++ b/apps/cli/src/shared/functions/serve.main.ts @@ -65,15 +65,15 @@ const bootstrapEnv = Effect.runSync( Effect.gen(function* () { const read = (config: Config.Config) => config.pipe(Config.option); return { - hostPort: yield* read(Config.string("SUPABASE_INTERNAL_HOST_PORT")), - jwtSecret: yield* read(Config.string("SUPABASE_INTERNAL_JWT_SECRET")), - supabaseUrl: yield* read(Config.string("SUPABASE_URL")), - debug: yield* read(Config.string("SUPABASE_INTERNAL_DEBUG")), - functionsConfig: yield* read(Config.string("SUPABASE_INTERNAL_FUNCTIONS_CONFIG")), - jwks: yield* read(Config.string("SUPABASE_JWKS")), - publishableKey: yield* read(Config.string("SUPABASE_INTERNAL_PUBLISHABLE_KEY")), - secretKey: yield* read(Config.string("SUPABASE_INTERNAL_SECRET_KEY")), - wallclock: yield* read(Config.string("SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC")), + hostPort: yield* read(Config.String("SUPABASE_INTERNAL_HOST_PORT")), + jwtSecret: yield* read(Config.String("SUPABASE_INTERNAL_JWT_SECRET")), + supabaseUrl: yield* read(Config.String("SUPABASE_URL")), + debug: yield* read(Config.String("SUPABASE_INTERNAL_DEBUG")), + functionsConfig: yield* read(Config.String("SUPABASE_INTERNAL_FUNCTIONS_CONFIG")), + jwks: yield* read(Config.String("SUPABASE_JWKS")), + publishableKey: yield* read(Config.String("SUPABASE_INTERNAL_PUBLISHABLE_KEY")), + secretKey: yield* read(Config.String("SUPABASE_INTERNAL_SECRET_KEY")), + wallclock: yield* read(Config.String("SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC")), }; }).pipe( Effect.provideService( diff --git a/apps/cli/src/shared/git/git-branch.ts b/apps/cli/src/shared/git/git-branch.ts index 46a5f62b2f..4a4a700277 100644 --- a/apps/cli/src/shared/git/git-branch.ts +++ b/apps/cli/src/shared/git/git-branch.ts @@ -20,7 +20,7 @@ export const detectGitBranch = ( RuntimeInfo | FileSystem.FileSystem | Path.Path > => Effect.gen(function* () { - const githubHeadRef = yield* Config.option(Config.string("GITHUB_HEAD_REF")); + const githubHeadRef = yield* Config.option(Config.String("GITHUB_HEAD_REF")); if (Option.isSome(githubHeadRef) && githubHeadRef.value.length > 0) { return githubHeadRef; } diff --git a/apps/cli/src/shared/issue/issue-url.ts b/apps/cli/src/shared/issue/issue-url.ts index ed99976e0c..9e40c4f2cc 100644 --- a/apps/cli/src/shared/issue/issue-url.ts +++ b/apps/cli/src/shared/issue/issue-url.ts @@ -137,14 +137,14 @@ function validInstallMethod(value: string): string { export const inferIssueInstallMethod = Effect.fnUntraced(function* (runtimeInfo: { readonly execPath: string; }) { - const explicit = (yield* Config.option(Config.string("SUPABASE_INSTALL_METHOD"))).pipe( + const explicit = (yield* Config.option(Config.String("SUPABASE_INSTALL_METHOD"))).pipe( Option.map((value) => value.trim()), Option.filter((value) => value.length > 0), ); if (Option.isSome(explicit)) return validInstallMethod(explicit.value); const userAgent = Option.getOrUndefined( - yield* Config.option(Config.string("npm_config_user_agent")), + yield* Config.option(Config.String("npm_config_user_agent")), )?.toLowerCase(); if (userAgent?.startsWith("pnpm/")) return "pnpm"; if (userAgent?.startsWith("npm/")) return "npm"; diff --git a/apps/cli/src/shared/output/normalize-error.unit.test.ts b/apps/cli/src/shared/output/normalize-error.unit.test.ts index 52194f8ce6..ed2b48e619 100644 --- a/apps/cli/src/shared/output/normalize-error.unit.test.ts +++ b/apps/cli/src/shared/output/normalize-error.unit.test.ts @@ -78,7 +78,7 @@ describe("normalizeCliError", () => { }); }); - test("InvalidValue collapses the doubled 'Expected: Expected' prefix (e.g. a bad GlobalFlag.setting value)", () => { + test("InvalidValue collapses the doubled 'Expected: Expected' prefix (e.g. a bad GlobalFlag.Setting value)", () => { const error = new CliError.InvalidValue({ option: "output-format", value: "bogus", diff --git a/apps/cli/src/shared/runtime/browser.layer.ts b/apps/cli/src/shared/runtime/browser.layer.ts index b783661603..484a153795 100644 --- a/apps/cli/src/shared/runtime/browser.layer.ts +++ b/apps/cli/src/shared/runtime/browser.layer.ts @@ -20,7 +20,7 @@ const makeBrowser = Effect.gen(function* () { command = "open"; args = [url]; } else if (runtimeInfo.platform === "win32") { - const systemRoot = yield* Config.string("SYSTEMROOT").pipe( + const systemRoot = yield* Config.String("SYSTEMROOT").pipe( Config.withDefault("C:\\Windows"), ); command = `${systemRoot}\\System32\\rundll32.exe`; diff --git a/apps/cli/src/shared/services/slim-images.ts b/apps/cli/src/shared/services/slim-images.ts index 503114e438..3abde50090 100644 --- a/apps/cli/src/shared/services/slim-images.ts +++ b/apps/cli/src/shared/services/slim-images.ts @@ -43,7 +43,7 @@ const V_PREFIXED_SERVICES: ReadonlySet = new Set([ /** The slim-image flag from the process environment, never the active `ConfigProvider`. */ export const slimImagesEnabled = Effect.suspend(() => - Config.option(Config.string(SLIM_IMAGES_ENV)).parse(ConfigProvider.fromEnv()), + Config.option(Config.String(SLIM_IMAGES_ENV)).parse(ConfigProvider.fromEnv()), ).pipe(Effect.map(Option.exists((value) => value === "true" || value === "1")), Effect.orDie); /** Catalog tag: `v`-prefixed for application services; postgres, studio, and vector stay bare. */ diff --git a/apps/cli/src/shared/telemetry/error-tag-stability.unit.test.ts b/apps/cli/src/shared/telemetry/error-tag-stability.unit.test.ts index 5b4a4e3620..6c14551e45 100644 --- a/apps/cli/src/shared/telemetry/error-tag-stability.unit.test.ts +++ b/apps/cli/src/shared/telemetry/error-tag-stability.unit.test.ts @@ -191,7 +191,7 @@ describe("error tag stability", () => { Effect.gen(function* () { const currentTagSet = new Set(productionDeclarations.map((declaration) => declaration.tag)); - const updateFixture = yield* Config.option(Config.string("UPDATE_ERROR_TAGS_FIXTURE")); + const updateFixture = yield* Config.option(Config.String("UPDATE_ERROR_TAGS_FIXTURE")); if (Option.isSome(updateFixture) && updateFixture.value === "1") { yield* writeFixture(currentTagSet); } diff --git a/apps/cli/src/shared/telemetry/posthog-config.ts b/apps/cli/src/shared/telemetry/posthog-config.ts index 61ffe34edb..a9f0e7ba76 100644 --- a/apps/cli/src/shared/telemetry/posthog-config.ts +++ b/apps/cli/src/shared/telemetry/posthog-config.ts @@ -20,7 +20,7 @@ function readNonEmptyString( provider: ConfigProvider.ConfigProvider, name: string, ): Effect.Effect, Config.ConfigError> { - return Config.option(Config.string(name)) + return Config.option(Config.String(name)) .parse(provider) .pipe(Effect.map(Option.flatMap(nonEmptyString))); } diff --git a/apps/cli/src/shared/telemetry/runtime.layer.ts b/apps/cli/src/shared/telemetry/runtime.layer.ts index 3c48b97811..6c07ca5b41 100644 --- a/apps/cli/src/shared/telemetry/runtime.layer.ts +++ b/apps/cli/src/shared/telemetry/runtime.layer.ts @@ -12,7 +12,7 @@ const CI_ENV_VARS = ["CI", "GITHUB_ACTIONS", "GITLAB_CI", "CIRCLECI", "JENKINS_U /** Whether a well-known CI provider variable is set. */ export const detectCi = Effect.gen(function* () { for (const envVar of CI_ENV_VARS) { - if (Option.isSome(yield* Config.option(Config.string(envVar)))) return true; + if (Option.isSome(yield* Config.option(Config.String(envVar)))) return true; } return false; }); diff --git a/apps/cli/src/shared/telemetry/trace-export.layer.ts b/apps/cli/src/shared/telemetry/trace-export.layer.ts index e11e92b93c..d5436c6979 100644 --- a/apps/cli/src/shared/telemetry/trace-export.layer.ts +++ b/apps/cli/src/shared/telemetry/trace-export.layer.ts @@ -52,7 +52,7 @@ export interface TraceSettings { } const optionalEnv = (name: string) => - Config.option(Config.string(name)).pipe( + Config.option(Config.String(name)).pipe( Effect.map(Option.filter((value) => value.trim().length > 0)), Effect.mapError(() => `${name} could not be read`), ); diff --git a/apps/cli/src/telemetry/analytics.layer.ts b/apps/cli/src/telemetry/analytics.layer.ts index 987f54bc61..f72a1f7c0e 100644 --- a/apps/cli/src/telemetry/analytics.layer.ts +++ b/apps/cli/src/telemetry/analytics.layer.ts @@ -86,7 +86,7 @@ export const collectEnvSignals = Effect.gen(function* () { const signals: Record = {}; for (const key of EnvSignalPresenceKeys) { - const raw = yield* Config.option(Config.string(key)); + const raw = yield* Config.option(Config.String(key)); if (Option.isNone(raw)) continue; const value = raw.value; if (value.trim().length === 0) continue; @@ -94,7 +94,7 @@ export const collectEnvSignals = Effect.gen(function* () { } for (const key of EnvSignalValueKeys) { - const raw = yield* Config.option(Config.string(key)); + const raw = yield* Config.option(Config.String(key)); if (Option.isNone(raw)) continue; const trimmed = raw.value.trim(); if (trimmed.length === 0) continue; @@ -115,7 +115,7 @@ function makeLoadLinkedProject( runtimeInfo: { readonly cwd: string }, ): Effect.Effect> { return Effect.gen(function* () { - const configuredWorkdir = yield* Config.option(Config.string("SUPABASE_WORKDIR")); + const configuredWorkdir = yield* Config.option(Config.String("SUPABASE_WORKDIR")); const workdir = Option.getOrElse(configuredWorkdir, () => runtimeInfo.cwd); const cachePath = path.join(workdir, "supabase", ".temp", "linked-project.json"); const exists = yield* fs.exists(cachePath).pipe(Effect.orElseSucceed(() => false)); diff --git a/apps/cli/src/telemetry/command-telemetry.ts b/apps/cli/src/telemetry/command-telemetry.ts index ff156ac0be..845e471965 100644 --- a/apps/cli/src/telemetry/command-telemetry.ts +++ b/apps/cli/src/telemetry/command-telemetry.ts @@ -70,7 +70,7 @@ interface CommandTelemetryOptions = never> // passed through regardless of this list. readonly safeFlags?: ReadonlyArray; // A command's flag config record (the object passed to `Command.make`). Any - // `Flag.choice`/`Flag.choiceWithValue` flag in it is treated as telemetry-safe automatically, so + // `Flag.Literals`/`Flag.ChoiceWithValue` flag in it is treated as telemetry-safe automatically, so // enum flags don't need hand-listing in `safeFlags`. The three global choice flags (`--output`, // `--dns-resolver`, `--agent`) are covered separately via `GLOBAL_CHOICE_FLAG_NAMES` below. readonly config?: Record; @@ -221,9 +221,9 @@ function normalizeFlagValue(value: unknown): unknown { return normalizeFlagValue(value.value); } -// Every `Flag.choice`/`Flag.choiceWithValue` flag is treated as telemetry-safe automatically — +// Every `Flag.Literals`/`Flag.ChoiceWithValue` flag is treated as telemetry-safe automatically — // checks the unwrapped `Single`'s primitive `_tag`. Restricted to `kind === Param.flagKind` so a -// same-named `Argument.choice` positional can never be mistaken for a `--flag`. +// same-named `Argument.Literals` positional can never be mistaken for a `--flag`. function getChoiceFlagNames(config: Record | undefined): ReadonlySet { const names = new Set(); if (config === undefined) return names; @@ -258,8 +258,8 @@ const GLOBAL_SHORT_ALIASES: Readonly> = (() => { })(); /** - * CLI-name set for every global/persistent flag that is itself a `Flag.choice`/ - * `Flag.choiceWithValue` (today `output`, `dns-resolver`, `agent`), derived from `GLOBAL_FLAGS` + * CLI-name set for every global/persistent flag that is itself a `Flag.Literals`/ + * `Flag.ChoiceWithValue` (today `output`, `dns-resolver`, `agent`), derived from `GLOBAL_FLAGS` * the same way `GLOBAL_SHORT_ALIASES` is. Applied only to the global-fallback path in * `buildFlagsMap` (`!isFromHandler`): a command that registers its own differently-typed local * flag under the same CLI name (e.g. `db diff`'s local string `--output`) must pass that flag in diff --git a/apps/cli/src/telemetry/command-telemetry.unit.test.ts b/apps/cli/src/telemetry/command-telemetry.unit.test.ts index e0e0ca6605..88043832a8 100644 --- a/apps/cli/src/telemetry/command-telemetry.unit.test.ts +++ b/apps/cli/src/telemetry/command-telemetry.unit.test.ts @@ -346,7 +346,7 @@ describe("withCommandTelemetry", () => { () => { const analytics = mockContextualAnalytics(); const config = { - service: Flag.choice("service", ["database"] as const), + service: Flag.Literals("service", ["database"] as const), }; return Effect.void.pipe( @@ -570,10 +570,10 @@ describe("withCommandTelemetry", () => { ); }); - it.live("passes Flag.choice values through verbatim (Go parity: isEnumFlag)", () => { + it.live("passes Flag.Literals values through verbatim (Go parity: isEnumFlag)", () => { const analytics = mockContextualAnalytics(); const config = { - lang: Flag.choice("lang", ["typescript", "go", "python"] as const), + lang: Flag.Literals("lang", ["typescript", "go", "python"] as const), }; return Effect.void.pipe( @@ -598,12 +598,12 @@ describe("withCommandTelemetry", () => { }); it.live( - "passes a Flag.withDefault-wrapped Flag.choice value through verbatim (Map(Optional(Single)))", + "passes a Flag.withDefault-wrapped Flag.Literals value through verbatim (Map(Optional(Single)))", () => { const analytics = mockContextualAnalytics(); // `.pipe(Flag.withDefault(...))` composes as `Map(Optional(Single))`. const config = { - algorithm: Flag.choice("algorithm", ["RS256", "ES256"] as const).pipe( + algorithm: Flag.Literals("algorithm", ["RS256", "ES256"] as const).pipe( Flag.withDefault("ES256" as const), ), }; @@ -633,11 +633,11 @@ describe("withCommandTelemetry", () => { ); it.live( - "resolves a Flag.choice's shorthand alias to its canonical name (Go parity: pflag.Visit)", + "resolves a Flag.Literals's shorthand alias to its canonical name (Go parity: pflag.Visit)", () => { const analytics = mockContextualAnalytics(); const config = { - type: Flag.choice("type", ["saml"] as const).pipe(Flag.withAlias("t")), + type: Flag.Literals("type", ["saml"] as const).pipe(Flag.withAlias("t")), }; return Effect.void.pipe( @@ -661,10 +661,10 @@ describe("withCommandTelemetry", () => { }, ); - it.live("passes an Optional-wrapped Flag.choice value through verbatim", () => { + it.live("passes an Optional-wrapped Flag.Literals value through verbatim", () => { const analytics = mockContextualAnalytics(); const config = { - algorithm: Flag.choice("algorithm", ["RS256", "ES256"] as const).pipe(Flag.optional), + algorithm: Flag.Literals("algorithm", ["RS256", "ES256"] as const).pipe(Flag.optional), }; return Effect.void.pipe( @@ -693,8 +693,8 @@ describe("withCommandTelemetry", () => { it.live("still redacts non-choice string flags even when config is provided", () => { const analytics = mockContextualAnalytics(); const config = { - lang: Flag.choice("lang", ["typescript", "go"] as const), - schema: Flag.string("schema"), + lang: Flag.Literals("lang", ["typescript", "go"] as const), + schema: Flag.String("schema"), }; return Effect.void.pipe( @@ -1482,8 +1482,8 @@ describe("withCommandTelemetry", () => { it.live( "still redacts a global choice flag shadowed by a command's own differently-typed local flag (db diff's local string --output, Go parity)", () => { - // `db diff` declares its own local `output: Flag.string("output")` (a file path) rather - // than a `Flag.choice`. Simulated here: `output` is in the handler's own `flags` record + // `db diff` declares its own local `output: Flag.String("output")` (a file path) rather + // than a `Flag.Literals`. Simulated here: `output` is in the handler's own `flags` record // (so `isFromHandler` is true) but absent from `config`, so it must not inherit safety from // `GLOBAL_CHOICE_FLAG_NAMES` just because the CLI name collides with the global flag. const analytics = mockContextualAnalytics(); diff --git a/packages/api/src/config/api-config.layer.ts b/packages/api/src/config/api-config.layer.ts index 267406abf5..efba74fc8f 100644 --- a/packages/api/src/config/api-config.layer.ts +++ b/packages/api/src/config/api-config.layer.ts @@ -6,10 +6,10 @@ export const DEFAULT_SUPABASE_API_URL = "https://api.supabase.com"; const makeApiConfig = Effect.gen(function* () { return ApiConfig.of({ - baseUrl: yield* Config.string("SUPABASE_API_URL").pipe( + baseUrl: yield* Config.String("SUPABASE_API_URL").pipe( Config.withDefault(DEFAULT_SUPABASE_API_URL), ), - accessToken: yield* Config.option(Config.redacted("SUPABASE_ACCESS_TOKEN")), + accessToken: yield* Config.option(Config.Redacted("SUPABASE_ACCESS_TOKEN")), }); }); diff --git a/packages/stack/src/functions/serve.main.ts b/packages/stack/src/functions/serve.main.ts index 20766f7478..edf1378fde 100644 --- a/packages/stack/src/functions/serve.main.ts +++ b/packages/stack/src/functions/serve.main.ts @@ -75,17 +75,17 @@ const bootstrapConfig = Effect.runSync( Effect.gen(function* () { const read = (config: Config.Config) => config.pipe(Config.option); return { - hostPort: yield* read(Config.string("SUPABASE_INTERNAL_HOST_PORT")), - functionsRoot: yield* read(Config.string("SUPABASE_INTERNAL_FUNCTIONS_ROOT")), - filesRoot: yield* read(Config.string("SUPABASE_INTERNAL_FUNCTIONS_FILES_ROOT")), - jwtSecret: yield* read(Config.string("SUPABASE_INTERNAL_JWT_SECRET")), - supabaseUrl: yield* read(Config.string("SUPABASE_URL")), - wallclock: yield* read(Config.string("SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC")), - publishableKey: yield* read(Config.string("SUPABASE_INTERNAL_PUBLISHABLE_KEY")), - secretKey: yield* read(Config.string("SUPABASE_INTERNAL_SECRET_KEY")), - functionsConfig: yield* read(Config.string("SUPABASE_INTERNAL_FUNCTIONS_CONFIG")), - debug: yield* read(Config.string("SUPABASE_INTERNAL_DEBUG")), - jwks: yield* read(Config.string("SUPABASE_JWKS")), + hostPort: yield* read(Config.String("SUPABASE_INTERNAL_HOST_PORT")), + functionsRoot: yield* read(Config.String("SUPABASE_INTERNAL_FUNCTIONS_ROOT")), + filesRoot: yield* read(Config.String("SUPABASE_INTERNAL_FUNCTIONS_FILES_ROOT")), + jwtSecret: yield* read(Config.String("SUPABASE_INTERNAL_JWT_SECRET")), + supabaseUrl: yield* read(Config.String("SUPABASE_URL")), + wallclock: yield* read(Config.String("SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC")), + publishableKey: yield* read(Config.String("SUPABASE_INTERNAL_PUBLISHABLE_KEY")), + secretKey: yield* read(Config.String("SUPABASE_INTERNAL_SECRET_KEY")), + functionsConfig: yield* read(Config.String("SUPABASE_INTERNAL_FUNCTIONS_CONFIG")), + debug: yield* read(Config.String("SUPABASE_INTERNAL_DEBUG")), + jwks: yield* read(Config.String("SUPABASE_JWKS")), }; }).pipe( Effect.provideService( diff --git a/packages/stack/src/internal/test-run-label.ts b/packages/stack/src/internal/test-run-label.ts index 8cdcdefb24..9753d3ef73 100644 --- a/packages/stack/src/internal/test-run-label.ts +++ b/packages/stack/src/internal/test-run-label.ts @@ -10,7 +10,7 @@ const testRunLabelPattern = /^[A-Za-z0-9-]{1,64}$/u; /** Reads and validates the optional test-run id through Effect `Config`. */ export const readTestRunId: Effect.Effect, string> = Effect.gen(function* () { - const testRun = yield* Config.option(Config.string(testRunEnvVar)).pipe( + const testRun = yield* Config.option(Config.String(testRunEnvVar)).pipe( Effect.mapError((cause) => String(cause)), ); if (Option.isNone(testRun)) return testRun; diff --git a/packages/stack/src/runtime/native-launcher.ts b/packages/stack/src/runtime/native-launcher.ts index 37081c5d34..b0119a8e67 100644 --- a/packages/stack/src/runtime/native-launcher.ts +++ b/packages/stack/src/runtime/native-launcher.ts @@ -78,7 +78,7 @@ const inheritedEnvironment = Effect.gen(function* () { const environment: NodeJS.ProcessEnv = {}; const provider = ConfigProvider.fromEnv(); for (const name of inheritedEnvironmentNames) { - const value = yield* Config.option(Config.string(name)).parse(provider); + const value = yield* Config.option(Config.String(name)).parse(provider); if (Option.isSome(value)) environment[name] = value.value; } return environment; diff --git a/packages/stack/src/runtime/postgres-user.ts b/packages/stack/src/runtime/postgres-user.ts index bacf29c2f4..74e0295d7b 100644 --- a/packages/stack/src/runtime/postgres-user.ts +++ b/packages/stack/src/runtime/postgres-user.ts @@ -105,7 +105,7 @@ export const resolveNativePostgresUser = Effect.fn("NativePostgresUser.resolve") const fs = yield* FileSystem.FileSystem; const env: Record = {}; for (const name of environmentNames) { - const value = yield* Config.option(Config.string(name)).pipe( + const value = yield* Config.option(Config.String(name)).pipe( Effect.orElseSucceed(() => Option.none()), ); if (Option.isSome(value)) env[name] = value.value; diff --git a/packages/stack/src/testing.ts b/packages/stack/src/testing.ts index 531b3c4a25..77ef027704 100644 --- a/packages/stack/src/testing.ts +++ b/packages/stack/src/testing.ts @@ -117,7 +117,7 @@ export interface TestStack< } const runtimeOverride = Config.option( - Config.literals(["native", "docker", "podman"], "SUPABASE_STACK_TEST_RUNTIME"), + Config.Literals(["native", "docker", "podman"], "SUPABASE_STACK_TEST_RUNTIME"), ); const testFailure = (operation: string) => (cause: unknown) => stackError(operation, cause); diff --git a/packages/stack/tests/effect-timeout.fixture.ts b/packages/stack/tests/effect-timeout.fixture.ts index 1b5fcf71a5..98e20d45ad 100644 --- a/packages/stack/tests/effect-timeout.fixture.ts +++ b/packages/stack/tests/effect-timeout.fixture.ts @@ -3,7 +3,7 @@ import { NodeServices } from "@effect/platform-node"; import { Config, Effect, Option, Path } from "effect"; import { existsSync, watch, writeFileSync } from "node:fs"; // oxlint-disable-line effecttsgo/node-builtin-import -- synchronous watcher subscription and marker writes are the fixture boundary. -const environment = (name: string) => Effect.runSync(Config.option(Config.string(name))); +const environment = (name: string) => Effect.runSync(Config.option(Config.String(name))); const marker = environment("SUPABASE_TIMEOUT_MARKER"); const defectMarker = environment("SUPABASE_TIMEOUT_DEFECT_MARKER"); const doubleFailure = environment("SUPABASE_TIMEOUT_DOUBLE_FAILURE"); From 2b0db9bab36e40af06dc07864525ffcecb2f6b3c Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:41:05 -0700 Subject: [PATCH 04/28] chore(stack): reformat imports shortened by the effect path move Co-Authored-By: Claude Fable 5.1 --- packages/stack/src/runtime/NativeProcess.ts | 6 +----- .../runtime/postgres-database-session.integration.test.ts | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/stack/src/runtime/NativeProcess.ts b/packages/stack/src/runtime/NativeProcess.ts index 7b401f5a29..be20712e10 100644 --- a/packages/stack/src/runtime/NativeProcess.ts +++ b/packages/stack/src/runtime/NativeProcess.ts @@ -3,11 +3,7 @@ import { fileURLToPath } from "node:url"; import { ChildProcess, ChildProcessSpawner } from "effect/process"; import type { PlatformError } from "effect/PlatformError"; import { isBunVirtualPath } from "../internal/dispatch-markers.ts"; -import type { - ChildProcessHandle, - ExitCode, - ProcessId, -} from "effect/process/ChildProcessSpawner"; +import type { ChildProcessHandle, ExitCode, ProcessId } from "effect/process/ChildProcessSpawner"; export interface NativeProcessSpec { readonly executable: string; diff --git a/packages/stack/src/runtime/postgres-database-session.integration.test.ts b/packages/stack/src/runtime/postgres-database-session.integration.test.ts index c3cf4cd41e..cc292428a3 100644 --- a/packages/stack/src/runtime/postgres-database-session.integration.test.ts +++ b/packages/stack/src/runtime/postgres-database-session.integration.test.ts @@ -1,11 +1,6 @@ import { describe, expect, it } from "@effect/vitest"; import { Cause, Effect, Exit, Redacted, Ref } from "effect"; -import { - AuthenticationError, - ConnectionError, - SqlError, - UnknownError, -} from "effect/sql/SqlError"; +import { AuthenticationError, ConnectionError, SqlError, UnknownError } from "effect/sql/SqlError"; import { ensureInternalDatabase, makeDatabaseSessionFromAcquisition, From 8450e1034e27fce85db350cefd0dd23c70c8a3d3 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:41:06 -0700 Subject: [PATCH 05/28] refactor(config): adopt effect 4.0 Union options and JSON schema excess-property option SchemaAST.Union.mode moved under options (effect PR 8131) and ToJsonSchemaOptions.additionalProperties became onExcessProperty (effect PR 8147). The generated document is unchanged. Co-Authored-By: Claude Fable 5.1 --- packages/config/src/project-config/project-schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/config/src/project-config/project-schema.ts b/packages/config/src/project-config/project-schema.ts index 02995296fb..f5468931fd 100644 --- a/packages/config/src/project-config/project-schema.ts +++ b/packages/config/src/project-config/project-schema.ts @@ -87,7 +87,7 @@ function toDeepOptionalHostedAst(ast: SchemaAST.AST, path: ReadonlyArray if (SchemaAST.isUnion(ast)) { return new SchemaAST.Union( ast.types.map((type) => toDeepOptionalHostedAst(type, path)), - ast.mode, + ast.options, ast.annotations, ast.checks, ast.encoding, @@ -139,7 +139,7 @@ export const ProjectConfigSchema: StandardSchemaV1< /** JSON Schema (draft 2020-12) rendering of {@link ProjectConfigSchema}. */ export function toProjectConfigJsonSchema() { const document = Schema.toJsonSchemaDocument(ProjectConfigSchema, { - additionalProperties: true, + onExcessProperty: "ignore", }); return { $schema: "https://json-schema.org/draft/2020-12/schema", From 2f9d85cd1ea136e7909487d751e595196c6e783b Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:41:06 -0700 Subject: [PATCH 06/28] refactor(stack): adopt effect 4.0 socket address, file, encoding, and Socket APIs Server addresses are NetAddress.SocketAddress values (effect PR 7524), File.seek and File.Info.size use bigint and ByteSize (effect PR 8108), Encoding moved to effect/encoding/Base64Url (effect PR 8356), and Socket.runString was replaced by the reader and writer pair (effect PR 7487). The Proxy comment now describes the listener contract instead of naming a release candidate. Co-Authored-By: Claude Fable 5.1 --- .../stack/src/Commands.integration.test.ts | 6 ++-- packages/stack/src/Proxy.integration.test.ts | 18 ++++------ packages/stack/src/Proxy.ts | 2 +- packages/stack/src/StackHost.ts | 3 +- packages/stack/src/host/LogStore.ts | 2 +- .../stack/src/promise-api.integration.test.ts | 3 +- packages/stack/src/services/ServiceConfig.ts | 7 ++-- .../src/services/ServiceConfig.unit.test.ts | 5 +-- .../stack/src/testing.integration.test.ts | 3 +- packages/stack/tests/docker-relay.ts | 5 +-- packages/stack/tests/whole-stack/fixture.ts | 5 +-- packages/stack/tests/whole-stack/websocket.ts | 33 +++++++------------ 12 files changed, 41 insertions(+), 51 deletions(-) diff --git a/packages/stack/src/Commands.integration.test.ts b/packages/stack/src/Commands.integration.test.ts index 21d81d129a..2c04b3882b 100644 --- a/packages/stack/src/Commands.integration.test.ts +++ b/packages/stack/src/Commands.integration.test.ts @@ -8,13 +8,13 @@ import { Fiber, FileSystem, Layer, - Predicate, Redacted, Ref, Scope, Schedule, Stream, } from "effect"; +import * as NetAddress from "effect/net/NetAddress"; import { tmpdir } from "node:os"; import { randomUUID } from "node:crypto"; import { postgres } from "./Commands.ts"; @@ -103,7 +103,7 @@ describe("finite PostgreSQL commands", { timeout: 180_000 }, () => { yield* service.ready; const endpoint = yield* database.endpoint; const listener = yield* bindTcp(runtime === "native" ? "127.0.0.1" : "0.0.0.0", 0); - if (!Predicate.isTagged(listener.address, "TcpAddress")) + if (!NetAddress.isInetAddress(listener.address)) return yield* Effect.die("Expected TCP listener"); yield* serveTcp( listener, @@ -253,7 +253,7 @@ describe("finite PostgreSQL commands", { timeout: 180_000 }, () => { yield* service.ready; const endpoint = yield* database.endpoint; const listener = yield* bindTcp(runtime === "native" ? "127.0.0.1" : "0.0.0.0", 0); - if (!Predicate.isTagged(listener.address, "TcpAddress")) + if (!NetAddress.isInetAddress(listener.address)) return yield* Effect.die("Expected TCP listener"); yield* serveTcp( listener, diff --git a/packages/stack/src/Proxy.integration.test.ts b/packages/stack/src/Proxy.integration.test.ts index 0f5431e8f2..72f2afbf17 100644 --- a/packages/stack/src/Proxy.integration.test.ts +++ b/packages/stack/src/Proxy.integration.test.ts @@ -1,12 +1,8 @@ import { NodeHttpClient, NodeHttpServer } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; -import { Deferred, Effect, Fiber, Predicate } from "effect"; -import { - HttpClient, - HttpClientRequest, - HttpServerRequest, - HttpServerResponse, -} from "effect/http"; +import { Deferred, Effect, Fiber } from "effect"; +import * as NetAddress from "effect/net/NetAddress"; +import { HttpClient, HttpClientRequest, HttpServerRequest, HttpServerResponse } from "effect/http"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- NodeHttpServer.make requires a native server factory. import * as Http from "node:http"; // oxlint-disable-next-line effecttsgo/node-builtin-import -- raw client and backend fixtures for connection failures. @@ -35,8 +31,8 @@ it.live( ); const listener = yield* bindTcp("127.0.0.1", 0); if ( - !Predicate.isTagged(backend.address, "TcpAddress") || - !Predicate.isTagged(listener.address, "TcpAddress") + !NetAddress.isInetAddress(backend.address) || + !NetAddress.isInetAddress(listener.address) ) return yield* Effect.die("Expected TCP listeners"); const address = { host: "127.0.0.1", port: backend.address.port }; @@ -84,7 +80,7 @@ it.live("logs one error naming the endpoint when its target fails to wake", () = return Effect.scoped( Effect.gen(function* () { const listener = yield* bindTcp("127.0.0.1", 0); - if (!Predicate.isTagged(listener.address, "TcpAddress")) + if (!NetAddress.isInetAddress(listener.address)) return yield* Effect.die("Expected TCP listener"); const port = listener.address.port; const target = Effect.fail(new ProxyError({ message: "wake failed" })); @@ -131,7 +127,7 @@ it.live("does not log an error when a backend copy resets after a successful con return Effect.scoped( Effect.gen(function* () { const listener = yield* bindTcp("127.0.0.1", 0); - if (!Predicate.isTagged(listener.address, "TcpAddress")) + if (!NetAddress.isInetAddress(listener.address)) return yield* Effect.die("Expected TCP listener"); const port = listener.address.port; const backend = yield* listenResetBackend(); diff --git a/packages/stack/src/Proxy.ts b/packages/stack/src/Proxy.ts index eb27dc2799..a219f5bf73 100644 --- a/packages/stack/src/Proxy.ts +++ b/packages/stack/src/Proxy.ts @@ -64,7 +64,7 @@ export const serveTcp = Effect.fn("Proxy.serveTcp")( listener.run(() => Effect.scoped( Effect.gen(function* () { - // rc.112 supplies this service to handlers but does not remove it from run's requirements. + // The listener provides the raw socket to handlers but keeps it in `run`'s requirements. const incoming = yield* Effect.serviceOption(NodeSocket.NetSocket).pipe( Effect.flatMap( Option.match({ diff --git a/packages/stack/src/StackHost.ts b/packages/stack/src/StackHost.ts index fb240dfd9f..1c2a2a0a88 100644 --- a/packages/stack/src/StackHost.ts +++ b/packages/stack/src/StackHost.ts @@ -25,6 +25,7 @@ import { } from "effect"; import * as HttpServer from "effect/http/HttpServer"; import * as HttpServerRequest from "effect/http/HttpServerRequest"; +import * as NetAddress from "effect/net/NetAddress"; import * as HttpServerResponse from "effect/http/HttpServerResponse"; import * as RpcServer from "effect/rpc/RpcServer"; import * as RpcSerialization from "effect/rpc/RpcSerialization"; @@ -82,7 +83,7 @@ export const bindControl = Effect.fn("StackHost.bindControl")(function* () { }, { host: "127.0.0.1", port: 0 }, ).pipe(Effect.mapError((cause) => hostError("control", cause))); - if (server.address._tag !== "TcpAddress") + if (!NetAddress.isInetAddress(server.address)) return yield* hostError("control", "Control listener has no TCP address"); return { port: server.address.port, diff --git a/packages/stack/src/host/LogStore.ts b/packages/stack/src/host/LogStore.ts index 51dcdd4973..22d93b6fed 100644 --- a/packages/stack/src/host/LogStore.ts +++ b/packages/stack/src/host/LogStore.ts @@ -249,7 +249,7 @@ const makeReader = (fs: FileSystem.FileSystem, path: Path.Path) => { const readChunk = (file: string, offset: number) => Effect.scoped( fs.open(file, { flag: "r" }).pipe( - Effect.tap((handle) => handle.seek(offset, "start")), + Effect.tap((handle) => handle.seek(BigInt(offset), "start")), Effect.flatMap((handle) => handle.readAlloc(readChunkBytes)), Effect.map(Option.getOrElse(() => new Uint8Array(0))), Effect.map(Option.some), diff --git a/packages/stack/src/promise-api.integration.test.ts b/packages/stack/src/promise-api.integration.test.ts index 394f99e4ea..79fb1b0042 100644 --- a/packages/stack/src/promise-api.integration.test.ts +++ b/packages/stack/src/promise-api.integration.test.ts @@ -1,6 +1,7 @@ import { NodeServices, NodeSocketServer } from "@effect/platform-node"; import { expect, it } from "@effect/vitest"; import { Effect, Exit, FileSystem, Redacted, Schema } from "effect"; +import * as NetAddress from "effect/net/NetAddress"; import { discover, StackError, type LogRecord, type Observation } from "./index.ts"; import { createTestStack } from "./testing.ts"; @@ -57,7 +58,7 @@ it.live( const fs = yield* FileSystem.FileSystem; const stateRoot = yield* fs.makeTempDirectoryScoped({ prefix: "stack-promise-failure-" }); const occupied = yield* NodeSocketServer.make({ host: "127.0.0.1", port: 0 }); - if (occupied.address._tag !== "TcpAddress") return yield* Effect.die("Expected TCP"); + if (!NetAddress.isInetAddress(occupied.address)) return yield* Effect.die("Expected TCP"); const port = occupied.address.port; const failure = yield* Effect.promise(() => diff --git a/packages/stack/src/services/ServiceConfig.ts b/packages/stack/src/services/ServiceConfig.ts index 72156d14a0..df61145299 100644 --- a/packages/stack/src/services/ServiceConfig.ts +++ b/packages/stack/src/services/ServiceConfig.ts @@ -1,4 +1,5 @@ -import { Effect, Encoding, Schema } from "effect"; +import { Effect, Schema } from "effect"; +import * as Base64Url from "effect/encoding/Base64Url"; import { SignJWT } from "jose"; import { ServiceError } from "../Service.ts"; import { @@ -100,9 +101,7 @@ export const resolveStackKeys = Effect.fn("ServiceConfig.resolveStackKeys")( keys: [ ...remoteKeys, ...localKeys, - ...(hasConfiguredSigningKeys - ? [] - : [{ kty: "oct", k: Encoding.encodeBase64Url(jwtSecret) }]), + ...(hasConfiguredSigningKeys ? [] : [{ kty: "oct", k: Base64Url.encode(jwtSecret) }]), ], }); const normalizedRemoteJwks = yield* stringify(remoteKeys); diff --git a/packages/stack/src/services/ServiceConfig.unit.test.ts b/packages/stack/src/services/ServiceConfig.unit.test.ts index b2be74d51d..5a77fa1b70 100644 --- a/packages/stack/src/services/ServiceConfig.unit.test.ts +++ b/packages/stack/src/services/ServiceConfig.unit.test.ts @@ -1,6 +1,7 @@ import { expect, it } from "@effect/vitest"; import { Buffer } from "node:buffer"; -import { Effect, Encoding, Schema } from "effect"; +import { Effect, Schema } from "effect"; +import * as Base64Url from "effect/encoding/Base64Url"; import { importJWK, jwtVerify, SignJWT } from "jose"; import { DEFAULT_LOCAL_DATABASE_PASSWORD, @@ -107,7 +108,7 @@ it.effect("publishes a usable HMAC key for an empty signing-key file", () => expect(resolved.anonKey).toBe(defaults.anonKey); expect(resolved.serviceRoleKey).toBe(defaults.serviceRoleKey); expect(resolved.jwks).toContain('"kty":"oct"'); - expect(resolved.jwks).toContain(Encoding.encodeBase64Url(DEFAULT_LOCAL_JWT_SECRET)); + expect(resolved.jwks).toContain(Base64Url.encode(DEFAULT_LOCAL_JWT_SECRET)); expect(resolved.gotrueJwtKeys).toBe("[]"); const jwks = yield* Schema.decodeEffect(PublishedJwks)(resolved.jwks); const hmacKey = jwks.keys.find((key) => key.kty === "oct"); diff --git a/packages/stack/src/testing.integration.test.ts b/packages/stack/src/testing.integration.test.ts index 8f92f1b45e..547a0fcc45 100644 --- a/packages/stack/src/testing.integration.test.ts +++ b/packages/stack/src/testing.integration.test.ts @@ -13,6 +13,7 @@ import { Path, Stream, } from "effect"; +import * as NetAddress from "effect/net/NetAddress"; import { discover, type Stack } from "./effect.ts"; import { makeTestStack } from "./testing.ts"; import { postgres } from "./Commands.ts"; @@ -174,7 +175,7 @@ it.live( const fs = yield* FileSystem.FileSystem; const stateRoot = yield* fs.makeTempDirectoryScoped({ prefix: "stack-testing-failure-" }); const occupied = yield* NodeSocketServer.make({ host: "127.0.0.1", port: 0 }); - if (occupied.address._tag !== "TcpAddress") return yield* Effect.die("Expected TCP"); + if (!NetAddress.isInetAddress(occupied.address)) return yield* Effect.die("Expected TCP"); const port = occupied.address.port; const startup = yield* makeTestStack({ diff --git a/packages/stack/tests/docker-relay.ts b/packages/stack/tests/docker-relay.ts index 003922d0a5..9f84b5adb7 100644 --- a/packages/stack/tests/docker-relay.ts +++ b/packages/stack/tests/docker-relay.ts @@ -1,4 +1,5 @@ -import { Effect, Predicate } from "effect"; +import { Effect } from "effect"; +import * as NetAddress from "effect/net/NetAddress"; import { bindTcp, serveTcp, ProxyError } from "../src/Proxy.ts"; import { makeHttpProxy } from "../src/HttpProxy.ts"; import type { ServiceEndpoint } from "../src/services/Recipe.ts"; @@ -19,7 +20,7 @@ export const makeDockerTcpRelay = Effect.fn("DockerRelay.makeTcp")( (endpoint: Effect.Effect) => Effect.gen(function* () { const listener = yield* bindTcp("0.0.0.0", 0); - if (!Predicate.isTagged(listener.address, "TcpAddress")) + if (!NetAddress.isInetAddress(listener.address)) return yield* Effect.die("Expected TCP relay listener"); yield* serveTcp(listener, address(endpoint), "docker-relay").pipe(Effect.forkScoped); return { host: "host.docker.internal", port: listener.address.port }; diff --git a/packages/stack/tests/whole-stack/fixture.ts b/packages/stack/tests/whole-stack/fixture.ts index 11d848303c..0bad19a902 100644 --- a/packages/stack/tests/whole-stack/fixture.ts +++ b/packages/stack/tests/whole-stack/fixture.ts @@ -1,5 +1,6 @@ import { NodeHttpClient, NodeServices } from "@effect/platform-node"; import { + ByteSize, Cause, Crypto, Effect, @@ -95,10 +96,10 @@ const ownerLogTail = Effect.fn("WholeStack.ownerLogTail")( Effect.scoped( Effect.gen(function* () { const file = yield* fs.open(path.join(stateRoot, stackId, "owner.log")); - const size = (yield* file.stat).size; + const size = ByteSize.toBigInt((yield* file.stat).size); const length = size < 4096n ? size : 4096n; yield* file.seek(size - length, "start"); - const bytes = yield* file.readAlloc(length); + const bytes = yield* file.readAlloc(Number(length)); const content = Option.match(bytes, { onNone: () => "", onSome: (buffer) => new TextDecoder().decode(buffer), diff --git a/packages/stack/tests/whole-stack/websocket.ts b/packages/stack/tests/whole-stack/websocket.ts index 6622e31421..4a1da692c9 100644 --- a/packages/stack/tests/whole-stack/websocket.ts +++ b/packages/stack/tests/whole-stack/websocket.ts @@ -1,4 +1,4 @@ -import { Deferred, Effect, Queue, Schedule, Schema, Scope } from "effect"; +import { Effect, Queue, Schedule, Schema, Scope } from "effect"; import { NodeSocket } from "@effect/platform-node"; import * as Socket from "effect/socket/Socket"; @@ -52,33 +52,22 @@ export const openWebSocket = Effect.fn("WholeStack.openWebSocket")( (url: string): Effect.Effect => Effect.gen(function* () { const messages = yield* Queue.unbounded(); - const ready = yield* Deferred.make(); const socket = yield* Socket.makeWebSocket(url, { openTimeout: "60 seconds" }).pipe( Effect.provide(NodeSocket.layerWebSocketConstructorWS), ); - yield* socket - .runString((message) => Queue.offer(messages, message), { - onOpen: Deferred.succeed(ready, undefined), - }) - .pipe( - Effect.catch((cause: Socket.SocketError) => - Effect.all([ - Deferred.fail(ready, cause), - Queue.fail(messages, channelError(cause)), - ]).pipe(Effect.asVoid), - ), - Effect.andThen( - Queue.fail(messages, new WebSocketChannelError({ message: "WebSocket closed" })).pipe( - Effect.asVoid, - ), - ), - Effect.forkScoped, - ); - yield* Deferred.await(ready).pipe(Effect.mapError(channelError)); + const pull = yield* Socket.readerString(socket).pipe(Effect.mapError(channelError)); + yield* pull.pipe( + Effect.flatMap((frames) => Queue.offerAll(messages, frames)), + Effect.forever, + Effect.catch((cause: Socket.SocketError) => + Queue.fail(messages, channelError(cause)).pipe(Effect.asVoid), + ), + Effect.forkScoped, + ); const writer = yield* socket.writer; return { messages, - send: (message) => writer(message).pipe(Effect.mapError(channelError)), + send: (message) => writer.write(message).pipe(Effect.mapError(channelError)), }; }), ); From 894fb9ac978165d4ae8037bdfaa762cf997eeeea Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:41:06 -0700 Subject: [PATCH 07/28] refactor(stack): keep command payload strictness and the 10 second pool idle timeout Parse-option annotations no longer influence decoding (effect PR 8131), so the initialization command and runCommand payload schemas reject unknown keys through a Record filter ahead of the struct decode. @effect/sql-pg 4.0.1 raised the default pool idle timeout from 10 to 60 seconds (effect PR 8679); the stack's Postgres layers pin the previous value. Co-Authored-By: Claude Fable 5.1 --- packages/stack/src/Commands.ts | 39 +++++++++++-------- packages/stack/src/Rpc.ts | 11 ++++-- packages/stack/src/host/LogflareStorage.ts | 6 ++- .../stack/src/internal/reject-excess-keys.ts | 17 ++++++++ packages/stack/src/services/Database.ts | 3 ++ 5 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 packages/stack/src/internal/reject-excess-keys.ts diff --git a/packages/stack/src/Commands.ts b/packages/stack/src/Commands.ts index 05ed207925..ad45aef91e 100644 --- a/packages/stack/src/Commands.ts +++ b/packages/stack/src/Commands.ts @@ -1,4 +1,5 @@ import { Schema } from "effect"; +import { rejectExcessKeys } from "./internal/reject-excess-keys.ts"; const PgProveMount = Schema.Struct({ source: Schema.String, @@ -18,22 +19,28 @@ export const PostgresCommand = Schema.Struct({ }); export interface PostgresCommand extends Schema.Schema.Type {} -const AuthInitializationCommand = Schema.Struct({ - type: Schema.Literal("auth.initialize"), - version: Schema.optional(Schema.String), - databaseUrl: Schema.String, -}).annotate({ parseOptions: { onExcessProperty: "error" } }); -const StorageInitializationCommand = Schema.Struct({ - type: Schema.Literal("storage.initialize"), - version: Schema.optional(Schema.String), - databaseUrl: Schema.String, - filePath: Schema.String, -}).annotate({ parseOptions: { onExcessProperty: "error" } }); -const RealtimeInitializationCommand = Schema.Struct({ - type: Schema.Literal("realtime.initialize"), - version: Schema.optional(Schema.String), - databaseUrl: Schema.String, -}).annotate({ parseOptions: { onExcessProperty: "error" } }); +const AuthInitializationCommand = rejectExcessKeys( + Schema.Struct({ + type: Schema.Literal("auth.initialize"), + version: Schema.optional(Schema.String), + databaseUrl: Schema.String, + }), +); +const StorageInitializationCommand = rejectExcessKeys( + Schema.Struct({ + type: Schema.Literal("storage.initialize"), + version: Schema.optional(Schema.String), + databaseUrl: Schema.String, + filePath: Schema.String, + }), +); +const RealtimeInitializationCommand = rejectExcessKeys( + Schema.Struct({ + type: Schema.Literal("realtime.initialize"), + version: Schema.optional(Schema.String), + databaseUrl: Schema.String, + }), +); /** A finite service setup action with inputs owned by its service definition. */ export const InitializationCommand = Schema.Union([ diff --git a/packages/stack/src/Rpc.ts b/packages/stack/src/Rpc.ts index 4befcf862c..b9c0dbf4ed 100644 --- a/packages/stack/src/Rpc.ts +++ b/packages/stack/src/Rpc.ts @@ -1,4 +1,5 @@ import { Exit, Schema } from "effect"; +import { rejectExcessKeys } from "./internal/reject-excess-keys.ts"; import { Rpc, RpcGroup } from "effect/rpc"; import { ServiceCreation, ServiceCreationInput } from "./services/Catalog.ts"; import { snapshotScopes } from "./services/DatabaseSnapshot.ts"; @@ -90,10 +91,12 @@ export const CommandEvent = Schema.TaggedUnion({ Stderr: { bytes: Schema.Uint8ArrayFromBase64 }, Completed: { jobId: Schema.String, exitCode: Schema.Int }, }); -export const RunCommandPayload = Schema.Struct({ - attachmentId: Schema.String, - command: CommandInvocation, -}).annotate({ parseOptions: { onExcessProperty: "error" } }); +export const RunCommandPayload = rejectExcessKeys( + Schema.Struct({ + attachmentId: Schema.String, + command: CommandInvocation, + }), +); export type RunCommandPayload = Schema.Schema.Type; /** Instance and composition operations served by the owner. */ diff --git a/packages/stack/src/host/LogflareStorage.ts b/packages/stack/src/host/LogflareStorage.ts index 62c5eacf24..681931bfb7 100644 --- a/packages/stack/src/host/LogflareStorage.ts +++ b/packages/stack/src/host/LogflareStorage.ts @@ -69,7 +69,11 @@ export const make = Effect.fn("LogflareStorage.make")(function* ( acquire: database.pipe( Effect.flatMap((connection) => Layer.build( - PgClient.layer({ url: Redacted.make(connection.url), connectTimeout: "2 seconds" }), + PgClient.layer({ + url: Redacted.make(connection.url), + connectTimeout: "2 seconds", + idleTimeout: "10 seconds", + }), ), ), Effect.map((context) => Context.get(context, PgClient.PgClient)), diff --git a/packages/stack/src/internal/reject-excess-keys.ts b/packages/stack/src/internal/reject-excess-keys.ts new file mode 100644 index 0000000000..ddab9e1962 --- /dev/null +++ b/packages/stack/src/internal/reject-excess-keys.ts @@ -0,0 +1,17 @@ +import { Schema } from "effect"; + +/** + * Fails decoding when the input carries keys the struct does not declare. Parse-option + * annotations no longer influence decoding, and the RPC transport passes no parse options, so + * strictness has to live in the schema itself. + */ +export const rejectExcessKeys = >(struct: S) => + Schema.Record(Schema.String, Schema.Unknown).pipe( + Schema.check( + Schema.makeFilter((input) => { + const excess = Object.keys(input).filter((key) => !(key in struct.fields)); + return excess.length === 0 ? undefined : `Unexpected keys: ${excess.join(", ")}`; + }), + ), + Schema.decodeTo(struct), + ); diff --git a/packages/stack/src/services/Database.ts b/packages/stack/src/services/Database.ts index b882e79551..9762802172 100644 --- a/packages/stack/src/services/Database.ts +++ b/packages/stack/src/services/Database.ts @@ -275,6 +275,7 @@ const health = Effect.fn("Database.health")(function* ( username: "supabase_admin", password: config.databasePassword, connectTimeout: "2 seconds", + idleTimeout: "10 seconds", }), ); const client = Context.get(layer, PgClient.PgClient); @@ -297,6 +298,7 @@ const health = Effect.fn("Database.health")(function* ( username: "supabase_admin", password: config.databasePassword, connectTimeout: "2 seconds", + idleTimeout: "10 seconds", }), ); const client = Context.get(layer, PgClient.PgClient); @@ -310,6 +312,7 @@ const health = Effect.fn("Database.health")(function* ( username: "supabase_admin", password: config.databasePassword, connectTimeout: "2 seconds", + idleTimeout: "10 seconds", }), ); return makeDatabaseSessionFromSqlClient(Context.get(internalLayer, PgClient.PgClient)); From b93710a12f831ef68f77992f8e4c6b15dd068e43 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:41:07 -0700 Subject: [PATCH 08/28] refactor(cli): bridge the node-postgres pool to the effect 4.0 SQL client @effect/sql-pg 4.0 is a native client and dropped PgClient.fromPool (effect PR 7426). The remote session keeps its node-postgres pool for the zero idle timeout, the per-connection role step-down hook, and raw COPY connections, so a local SqlClient.make adapter over that pool replaces the removed bridge with the same statement execution, cancellation, and error classification. Co-Authored-By: Claude Fable 5.1 --- .../db-connection.pool-client.ts | 246 ++++++++++++++++++ .../db-connection.sql-pg.layer.ts | 7 +- 2 files changed, 248 insertions(+), 5 deletions(-) create mode 100644 apps/cli/src/command-internal/db-connection.pool-client.ts diff --git a/apps/cli/src/command-internal/db-connection.pool-client.ts b/apps/cli/src/command-internal/db-connection.pool-client.ts new file mode 100644 index 0000000000..6cffda0e5b --- /dev/null +++ b/apps/cli/src/command-internal/db-connection.pool-client.ts @@ -0,0 +1,246 @@ +import { PgClient } from "@effect/sql-pg"; +import { Effect, Stream } from "effect"; +import type * as Reactivity from "effect/reactivity/Reactivity"; +import * as SqlClient from "effect/sql/SqlClient"; +import type * as SqlConnection from "effect/sql/SqlConnection"; +import { + AuthenticationError, + AuthorizationError, + ConnectionError, + ConstraintError, + DeadlockError, + LockTimeoutError, + SerializationError, + SqlError, + SqlSyntaxError, + StatementTimeoutError, + UniqueViolation, + UnknownError, +} from "effect/sql/SqlError"; +import type * as Pg from "pg"; + +/** + * Builds an Effect SQL client over a caller-owned node-postgres pool. `@effect/sql-pg` ships a + * native client with no pool bridge, while the CLI keeps node-postgres for the pool behaviors + * `db-connection.sql-pg.layer.ts` relies on: a zero idle timeout, the per-connection role + * step-down hook, and raw COPY connections. + */ +export const makePoolSqlClient = ( + pool: Pg.Pool, +): Effect.Effect => + SqlClient.make({ + acquirer: Effect.succeed(new PoolConnection(pool)), + compiler: PgClient.makeCompiler(), + spanAttributes: [ + ["db.system.name", "postgresql"], + ["db.namespace", pool.options.database ?? pool.options.user ?? "postgres"], + ["server.address", pool.options.host ?? "localhost"], + ["server.port", pool.options.port ?? 5432], + ], + }); + +type TransformRows = ((rows: ReadonlyArray) => ReadonlyArray) | undefined; + +class PoolConnection implements SqlConnection.Connection { + constructor(private readonly pool: Pg.Pool) {} + + private withClient( + f: (client: Pg.ClientBase, resume: (_: Effect.Effect) => void) => void, + ): Effect.Effect { + const pool = this.pool; + return Effect.callback((resume) => { + let done = false; + let cancel: Effect.Effect | undefined; + let client: Pg.PoolClient | undefined; + const onError = (cause: Error) => { + cleanup(cause); + resume( + Effect.fail( + new SqlError({ + reason: classifyError(cause, "Connection error", "acquireConnection"), + }), + ), + ); + }; + const cleanup = (cause?: Error) => { + if (!done) client?.release(cause); + done = true; + client?.off("error", onError); + }; + pool.connect((cause, acquired) => { + if (cause) { + return resume( + Effect.fail( + new SqlError({ + reason: classifyError(cause, "Failed to acquire connection", "acquireConnection"), + }), + ), + ); + } + if (!acquired) { + return resume( + Effect.fail( + new SqlError({ + reason: new ConnectionError({ + message: "Failed to acquire connection", + cause: new Error("No client returned"), + operation: "acquireConnection", + }), + }), + ), + ); + } + if (done) { + acquired.release(); + return; + } + client = acquired; + client.once("error", onError); + cancel = makeCancel(pool, client); + f(client, (effect) => { + cleanup(); + resume(effect); + }); + }); + return Effect.suspend(() => { + if (!cancel) { + cleanup(); + return Effect.void; + } + return Effect.ensuring(cancel, Effect.sync(cleanup)); + }); + }); + } + + private run(query: string, params: ReadonlyArray) { + return this.withClient>((client, resume) => { + client.query(query, params as Array, (err, result) => { + if (err) { + resume( + Effect.fail( + new SqlError({ + reason: classifyError(err, "Failed to execute statement", "execute"), + }), + ), + ); + } else { + resume( + Effect.succeed( + Array.isArray(result) ? result.map((r) => r.rows ?? []) : (result.rows ?? []), + ), + ); + } + }); + }); + } + + execute(sql: string, params: ReadonlyArray, transformRows: TransformRows) { + return transformRows ? Effect.map(this.run(sql, params), transformRows) : this.run(sql, params); + } + + executeRaw(sql: string, params: ReadonlyArray) { + return this.withClient((client, resume) => { + client.query(sql, params as Array, (err, result) => { + if (err) { + resume( + Effect.fail( + new SqlError({ + reason: classifyError(err, "Failed to execute statement", "execute"), + }), + ), + ); + } else { + resume(Effect.succeed(result)); + } + }); + }); + } + + executeValues(sql: string, params: ReadonlyArray) { + return this.withClient>>((client, resume) => { + client.query( + { text: sql, rowMode: "array", values: params as Array }, + (err, result) => { + if (err) { + resume( + Effect.fail( + new SqlError({ + reason: classifyError(err, "Failed to execute statement", "execute"), + }), + ), + ); + } else { + resume(Effect.succeed(result.rows)); + } + }, + ); + }); + } + + executeValuesUnprepared(sql: string, params: ReadonlyArray) { + return this.executeValues(sql, params); + } + + executeUnprepared(sql: string, params: ReadonlyArray, transformRows: TransformRows) { + return this.execute(sql, params, transformRows); + } + + executeStream(sql: string, params: ReadonlyArray, transformRows: TransformRows) { + return Stream.unwrap( + Effect.map(this.execute(sql, params, transformRows), (rows) => Stream.fromArray(rows)), + ); + } +} + +const cancelEffects = new WeakMap | undefined>(); + +/** Best-effort `pg_cancel_backend` for an interrupted statement. */ +const makeCancel = (pool: Pg.Pool, client: Pg.PoolClient) => { + if (cancelEffects.has(client)) return cancelEffects.get(client); + const processId: unknown = Reflect.get(client, "processID"); + const effect = + typeof processId === "number" + ? Effect.callback((resume) => { + if (pool.ending) return resume(Effect.void); + pool.query(`SELECT pg_cancel_backend(${processId})`, () => { + resume(Effect.void); + }); + }).pipe(Effect.interruptible, Effect.timeoutOption(5000), Effect.asVoid) + : undefined; + cancelEffects.set(client, effect); + return effect; +}; + +const pgCodeFromCause = (cause: unknown): string | undefined => { + if (typeof cause !== "object" || cause === null || !("code" in cause)) return undefined; + return typeof cause.code === "string" ? cause.code : undefined; +}; + +const pgConstraintFromCause = (cause: unknown): string => { + if (typeof cause !== "object" || cause === null || !("constraint" in cause)) return "unknown"; + const constraint = cause.constraint; + if (typeof constraint !== "string") return "unknown"; + const normalized = constraint.trim(); + return normalized.length === 0 ? "unknown" : normalized; +}; + +/** Maps a node-postgres error to the `SqlError` reason the `@effect/sql-pg` bridge used to raise. */ +const classifyError = (cause: unknown, message: string, operation: string) => { + const props = { cause, message, operation }; + const code = pgCodeFromCause(cause); + if (code !== undefined) { + if (code.startsWith("08")) return new ConnectionError(props); + if (code.startsWith("28")) return new AuthenticationError(props); + if (code === "42501") return new AuthorizationError(props); + if (code.startsWith("42")) return new SqlSyntaxError(props); + if (code === "23505") { + return new UniqueViolation({ ...props, constraint: pgConstraintFromCause(cause) }); + } + if (code.startsWith("23")) return new ConstraintError(props); + if (code === "40P01") return new DeadlockError(props); + if (code === "40001") return new SerializationError(props); + if (code === "55P03") return new LockTimeoutError(props); + if (code === "57014") return new StatementTimeoutError(props); + } + return new UnknownError(props); +}; diff --git a/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts b/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts index e98c258ad6..476c838d61 100644 --- a/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts +++ b/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts @@ -1,7 +1,6 @@ import { readFileSync } from "node:fs"; import * as net from "node:net"; import type { ConnectionOptions } from "node:tls"; -import { PgClient } from "@effect/sql-pg"; import { Cause, Duration, Effect, Exit, Layer, Scope } from "effect"; import * as Reactivity from "effect/reactivity/Reactivity"; import { ConnectionError, SqlError } from "effect/sql/SqlError"; @@ -19,6 +18,7 @@ import { isSqlState, } from "./connect-errors.ts"; import { DbConnectError, DbCopyError, DbExecError } from "./db-connection.errors.ts"; +import { makePoolSqlClient } from "./db-connection.pool-client.ts"; import { type DbBatchStatement, type DbBatchValue, @@ -864,10 +864,7 @@ const connect = ( cfg, options, ); - const client = yield* PgClient.fromPool({ acquire: Effect.succeed(pool) }).pipe( - Effect.provide(Reactivity.layer), - Effect.mapError((error) => toConnectError(cfg, options.isLocal, error)), - ); + const client = yield* makePoolSqlClient(pool).pipe(Effect.provide(Reactivity.layer)); // `inspect report` runs ~14 `COPY (...) TO STDOUT` statements. node-postgres' COPY protocol // needs a raw client, which `@effect/sql-pg` does not surface, so the session opens one From 776b16e8dc343767bbe902fb006b6a08507914b3 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:41:07 -0700 Subject: [PATCH 09/28] refactor(cli): adopt effect 4.0 encoding, primitive tags, and parse options Encoding moved to effect/encoding/Base64Url (effect PR 8356), the Int and Finite primitives replaced Integer and Float (effect PR 8121), File.Info.size is a ByteSize, and onExcessProperty "preserve" was removed in favour of the default "ignore" (effect PR 8131). Co-Authored-By: Claude Fable 5.1 --- apps/cli/src/cli/complete.ts | 6 +++--- apps/cli/src/command-internal/glob.unit.test.ts | 4 ++-- apps/cli/src/command-internal/local-config-values.ts | 5 +++-- .../experimental/compute/push/push.integration.test.ts | 2 +- .../src/commands/functions/serve/serve.integration.test.ts | 2 -- apps/cli/src/commands/sso/list/list.integration.test.ts | 1 - apps/cli/src/docs/docs-spec.ts | 6 +++--- 7 files changed, 12 insertions(+), 14 deletions(-) diff --git a/apps/cli/src/cli/complete.ts b/apps/cli/src/cli/complete.ts index 9b00b0de35..ed763866e2 100644 --- a/apps/cli/src/cli/complete.ts +++ b/apps/cli/src/cli/complete.ts @@ -59,7 +59,7 @@ export interface FlagDescriptor { readonly description: string | undefined; readonly isVariadic: boolean; readonly isBoolean: boolean; - /** `Param.Single`'s underlying `Primitive._tag` (`"Boolean"`, `"Choice"`, `"Integer"`, ...). */ + /** `Param.Single`'s underlying `Primitive._tag` (`"Boolean"`, `"Choice"`, `"Int"`, ...). */ readonly primitiveTag: string; /** The valid value set for a `primitiveTag === "Choice"` flag; `undefined` for every other tag. */ readonly choiceKeys: ReadonlyArray | undefined; @@ -690,9 +690,9 @@ function isValidFlagValue( return outputFlagChoiceKeys(matchedPath).includes(value); } return flag.choiceKeys !== undefined && flag.choiceKeys.includes(value); - case "Integer": + case "Int": return isValidBase0Int64(value); - case "Float": + case "Finite": return value.trim().length > 0 && !Number.isNaN(Number(value)); default: return true; diff --git a/apps/cli/src/command-internal/glob.unit.test.ts b/apps/cli/src/command-internal/glob.unit.test.ts index 5fa2f0164d..0e79804e1a 100644 --- a/apps/cli/src/command-internal/glob.unit.test.ts +++ b/apps/cli/src/command-internal/glob.unit.test.ts @@ -1,6 +1,6 @@ import { BunFileSystem, BunPath } from "@effect/platform-bun"; import { describe, expect, it } from "@effect/vitest"; -import { Effect, Exit, FileSystem, Layer, Option, Path, PlatformError } from "effect"; +import { ByteSize, Effect, Exit, FileSystem, Layer, Option, Path, PlatformError } from "effect"; import { compareUtf8Bytes, globPattern, resolveUnderWorkdir, walkSqlFiles } from "./glob.ts"; @@ -88,7 +88,7 @@ function fakeFileInfo(type: FileSystem.File.Type): FileSystem.File.Info { uid: Option.none(), gid: Option.none(), rdev: Option.none(), - size: 0n as FileSystem.Size, + size: ByteSize.zero, blksize: Option.none(), blocks: Option.none(), }; diff --git a/apps/cli/src/command-internal/local-config-values.ts b/apps/cli/src/command-internal/local-config-values.ts index fb26bb4bf1..4844feb3da 100644 --- a/apps/cli/src/command-internal/local-config-values.ts +++ b/apps/cli/src/command-internal/local-config-values.ts @@ -15,7 +15,8 @@ import { defaultPublishableKey, defaultSecretKey, } from "../shared/stack-constants.ts"; -import { Effect, Encoding, Option, Schema } from "effect"; +import { Effect, Option, Schema } from "effect"; +import * as Base64Url from "effect/encoding/Base64Url"; import { resolveRemoteJwks, @@ -3103,7 +3104,7 @@ export const resolveLocalJwks = Effect.fnUntraced(function* ( } keys.push(...signingKeys.map(toPublicJwk)); if (signingKeysPath === undefined || signingKeysPath.length === 0) { - keys.push({ kty: "oct", k: Encoding.encodeBase64Url(jwtSecret) }); + keys.push({ kty: "oct", k: Base64Url.encode(jwtSecret) }); } return yield* Schema.encodeEffect( Schema.fromJsonString(Schema.Struct({ keys: Schema.Array(Schema.Unknown) })), diff --git a/apps/cli/src/commands/experimental/compute/push/push.integration.test.ts b/apps/cli/src/commands/experimental/compute/push/push.integration.test.ts index 2f161a7f28..e1545c7900 100644 --- a/apps/cli/src/commands/experimental/compute/push/push.integration.test.ts +++ b/apps/cli/src/commands/experimental/compute/push/push.integration.test.ts @@ -59,7 +59,7 @@ const deployRequest = Schema.Struct({ }), }); const decodeDeploy = (body: string) => - Schema.decodeEffect(Schema.fromJsonString(deployRequest))(body, { onExcessProperty: "preserve" }); + Schema.decodeEffect(Schema.fromJsonString(deployRequest))(body); function flags(overrides: Partial = {}): ComputePushFlags { return { diff --git a/apps/cli/src/commands/functions/serve/serve.integration.test.ts b/apps/cli/src/commands/functions/serve/serve.integration.test.ts index 68bbbe7154..e22c95691d 100644 --- a/apps/cli/src/commands/functions/serve/serve.integration.test.ts +++ b/apps/cli/src/commands/functions/serve/serve.integration.test.ts @@ -541,7 +541,6 @@ const decodeFunctionsContainerConfig = Schema.decodeEffect( }), ), ), - { onExcessProperty: "preserve" }, ); const decodeJwks = Schema.decodeEffect( @@ -552,7 +551,6 @@ const decodeJwks = Schema.decodeEffect( ), }), ), - { onExcessProperty: "preserve" }, ); beforeEach(() => { diff --git a/apps/cli/src/commands/sso/list/list.integration.test.ts b/apps/cli/src/commands/sso/list/list.integration.test.ts index fa547044be..8506a44024 100644 --- a/apps/cli/src/commands/sso/list/list.integration.test.ts +++ b/apps/cli/src/commands/sso/list/list.integration.test.ts @@ -185,7 +185,6 @@ describe("sso list integration", () => { ), }), ), - { onExcessProperty: "preserve" }, )(out.stdoutText); expect(out.stdoutText).toContain("0b0d48f6-878b-4190-88d7-2ca33ed800bc"); expect(out.stdoutText).not.toContain("8682fcf4-4056-455c-bd93-f33295604929"); diff --git a/apps/cli/src/docs/docs-spec.ts b/apps/cli/src/docs/docs-spec.ts index 85f7715093..be1ef1b6b0 100644 --- a/apps/cli/src/docs/docs-spec.ts +++ b/apps/cli/src/docs/docs-spec.ts @@ -148,9 +148,9 @@ function docsPrimitiveVarname( switch (single.primitiveType._tag) { case "Boolean": return undefined; - case "Integer": + case "Int": return "int"; - case "Float": + case "Finite": return "float"; case "Date": return "time"; @@ -165,7 +165,7 @@ function docsTypeDefault( ): string { if (single.primitiveType._tag === "Boolean") return "false"; if (isVariadic) return "[]"; - if (single.primitiveType._tag === "Integer" || single.primitiveType._tag === "Float") return "0"; + if (single.primitiveType._tag === "Int" || single.primitiveType._tag === "Finite") return "0"; return ""; } From 89dfb88ed5617fe990159aa50e66fb03b6494557 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:41:08 -0700 Subject: [PATCH 10/28] docs(repo): use effect 4.0 import paths and constructor names Co-Authored-By: Claude Fable 5.1 --- .agents/skills/effect/references/CONFIG.md | 2 +- .agents/skills/effect/references/HTTP_CLIENTS.md | 8 ++++---- apps/cli/README.md | 2 +- apps/cli/src/commands/db/test/SIDE_EFFECTS.md | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.agents/skills/effect/references/CONFIG.md b/.agents/skills/effect/references/CONFIG.md index 50c03fca7e..c57de4eeb8 100644 --- a/.agents/skills/effect/references/CONFIG.md +++ b/.agents/skills/effect/references/CONFIG.md @@ -11,7 +11,7 @@ export const layerFromEnvironment = Layer.effect( Configuration.Service, Effect.gen(function* () { const apiKey = yield* Config.redacted("API_KEY"); - const optionalModel = yield* Config.option(Config.string("MODEL")); + const optionalModel = yield* Config.option(Config.String("MODEL")); const enabled = yield* Config.boolean("FEATURE_ENABLED").pipe(Config.withDefault(false)); return Configuration.Service.of({ apiKey, optionalModel, enabled }); diff --git a/.agents/skills/effect/references/HTTP_CLIENTS.md b/.agents/skills/effect/references/HTTP_CLIENTS.md index 34b6b8033c..8ba862ed57 100644 --- a/.agents/skills/effect/references/HTTP_CLIENTS.md +++ b/.agents/skills/effect/references/HTTP_CLIENTS.md @@ -4,10 +4,10 @@ Use this when writing outgoing HTTP calls, Effect HttpClient adapters, status cl Use Effect HTTP client modules for outgoing HTTP in app/provider code: -- `effect/unstable/http/HttpClient` -- `effect/unstable/http/HttpClientRequest` -- `effect/unstable/http/HttpClientResponse` -- `effect/unstable/http/HttpClientError` +- `effect/http/HttpClient` +- `effect/http/HttpClientRequest` +- `effect/http/HttpClientResponse` +- `effect/http/HttpClientError` Prefer Effect HttpClient in Effect application and provider code when its typed errors, layers, and transforms are useful. Raw `fetch` remains reasonable for browser or edge constraints, small adapters, platform transports, and libraries that intentionally avoid unstable Effect HTTP APIs. diff --git a/apps/cli/README.md b/apps/cli/README.md index 5baad3fd81..e379c971f5 100644 --- a/apps/cli/README.md +++ b/apps/cli/README.md @@ -101,7 +101,7 @@ See [`docs/binary-distribution.md`](./docs/binary-distribution.md) for a full ex ## Architecture -The CLI is built on `effect/unstable/cli`. +The CLI is built on `effect/cli`. Important areas: diff --git a/apps/cli/src/commands/db/test/SIDE_EFFECTS.md b/apps/cli/src/commands/db/test/SIDE_EFFECTS.md index 18bb7939c9..2096cca0b2 100644 --- a/apps/cli/src/commands/db/test/SIDE_EFFECTS.md +++ b/apps/cli/src/commands/db/test/SIDE_EFFECTS.md @@ -79,7 +79,7 @@ Identical to `test db`. See proxy-only `--local` default-modelling caveat that existed while this command still forwarded to the Go binary (the previous proxy's `if (flags.local) args.push("--local")` never actually forwarded the - default, since Effect CLI's own `Flag.boolean` default is `false`; now that + default, since Effect CLI's own `Flag.Boolean` default is `false`; now that the flag drives `resolveDbTargetFlags`'s presence-based selection directly — same mechanism `test db` already used — the true default is reflected exactly, with no proxy-only quirk to carry over). From 5d2c348e62e53c1446f8f52f328f5874aaae4cd9 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:42:59 -0700 Subject: [PATCH 11/28] chore(stack): regenerate the functions bootstrap bundle for effect 4.0 paths Co-Authored-By: Claude Fable 5.1 --- packages/stack/src/functions/generated/serve-main-bundle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stack/src/functions/generated/serve-main-bundle.ts b/packages/stack/src/functions/generated/serve-main-bundle.ts index 9514b4407e..49eb8eaa9b 100644 --- a/packages/stack/src/functions/generated/serve-main-bundle.ts +++ b/packages/stack/src/functions/generated/serve-main-bundle.ts @@ -1,3 +1,3 @@ // Generated by packages/stack/scripts/generate-functions-bootstrap.ts; run `pnpm generate`. /** Bundled Edge Runtime main service used when a Functions creation has no bootstrap. */ -export const defaultFunctionsBootstrap = "var m2=Object.defineProperty;var uo=(e,t)=>{for(var n in t)m2(e,n,{get:t[n],enumerable:!0})};var K=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let r=0,o=t.length;rt(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,r){return arguments.length>=2?t(n,r):function(o){return t(o,n)}};case 3:return function(n,r,o){return arguments.length>=3?t(n,r,o):function(s){return t(s,n,r)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(r){return t(r,...n)}}}};var _=e=>e;var Le=e=>()=>e,cn=Le(!0),Cu=Le(!1),Cg=Le(null),fo=Le(void 0),_r=fo;function wd(e,...t){return K(e,t)}function Td(e,t,n,r,o,s,i,a,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return o(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return s(o(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return i(s(o(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return a(i(s(o(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(a(i(s(o(r(n(t(e.apply(this,arguments)))))))))}}}function It(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let o=e(n);return t.set(n,o),o}}function pi(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let o=e(n);return t.set(n,o),t.set(o,o),o}}var Ou=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(\"stack\");let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let o=Reflect.ownKeys(r);for(let s=0;sRu(e)&&t in e),$t=l(2,(e,t)=>M(e,\"_tag\")&&e._tag===t);function w0(e){return e instanceof Error}function $o(e){return M(e,Symbol.iterator)||$n(e)}var be=\"~effect/interfaces/Hash\",H=e=>{switch(typeof e){case\"number\":return On(e);case\"bigint\":return Ue(e.toString(10));case\"boolean\":return Ue(String(e));case\"symbol\":return Ue(String(e));case\"string\":return Ue(e);case\"undefined\":return Ue(\"undefined\");case\"function\":case\"object\":{if(e===null)return Ue(\"null\");if(e instanceof Date)return Number.isNaN(e.getTime())?Ue(\"Invalid Date\"):Ue(e.toISOString());if(e instanceof RegExp)return Ue(e.toString());{if(ja.has(e))return Cd(e);if(_g.has(e))return _g.get(e);let t=b2(e,()=>g2(e)?e[be]():typeof e==\"function\"?Cd(e):e instanceof DataView?Ba(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?Ba(e):e instanceof Map?x2(e):e instanceof Set?y2(e):Fg(e));return _g.set(e,t),t}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Cd=e=>(Rg.has(e)||Rg.set(e,On(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),Rg.get(e)),it=l(2,(e,t)=>e*53^t),Ts=e=>e&3221225471|e>>>1&1073741824,g2=e=>M(e,be),On=e=>{if(e!==e)return Ue(\"NaN\");if(e===1/0)return Ue(\"Infinity\");if(e===-1/0)return Ue(\"-Infinity\");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Ts(t)},Ue=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Ts(t)},Pg=(e,t)=>{let n=12289;for(let r of t)n^=it(H(r),H(e[r]));return Ts(n)},Fg=e=>Pg(e,Ou(e)),Ug=(e,t)=>n=>{let r=e;for(let o of n)r^=t(o);return Ts(r)},Ba=Ug(6151,H),x2=Ug(Ue(\"Map\"),([e,t])=>it(H(e),H(t))),y2=Ug(Ue(\"Set\"),H),Rg=new WeakMap,_g=new WeakMap,Mg=new WeakSet;function b2(e,t){if(Mg.has(e))return Ue(\"[Circular]\");Mg.add(e);let n=t();return Mg.delete(e),n}var Se=\"~effect/interfaces/Equal\";function B(){return arguments.length===1?e=>mi(e,arguments[0]):mi(arguments[0],arguments[1])}function mi(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n!==typeof t?!1:n===\"number\"&&e!==e&&t!==t?!0:n!==\"object\"&&n!==\"function\"||ja.has(e)||ja.has(t)?!1:I2(e,t,E2)}function S2(e,t,n){let r=Dg.has(e),o=Ng.has(t);if(r&&o)return!0;if(r||o)return!1;Dg.add(e),Ng.add(t);let s=n();return Dg.delete(e),Ng.delete(t),s}var Dg=new WeakSet,Ng=new WeakSet;function E2(e,t){if(H(e)!==H(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let s=e.getTime(),i=t.getTime();return s===i||Number.isNaN(s)&&Number.isNaN(i)}else if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;let n=v0(e),r=v0(t);if(n!==r)return!1;let o=n&&r;return typeof e==\"function\"&&!o?!1:S2(e,t,()=>{if(o)return e[Se](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:w2(e,t);if(ArrayBuffer.isView(e)){let s=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||s!==t instanceof DataView)return!1;if(s){let i=t;return T0(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(i.buffer,i.byteOffset,i.byteLength))}return T0(e,t)}else{if(e instanceof Map)return!(t instanceof Map)||e.size!==t.size?!1:v2(e,t);if(e instanceof Set)return!(t instanceof Set)||e.size!==t.size?!1:A2(e,t)}return T2(e,t)})}function I2(e,t,n){let r=Od.get(e);if(!r)r=new WeakMap,Od.set(e,r);else if(r.has(t))return r.get(t);let o=n(e,t);r.set(t,o);let s=Od.get(t);return s||(s=new WeakMap,Od.set(t,s)),s.set(e,o),o}var Od=new WeakMap;function w2(e,t){for(let n=0;nM(e,Se),Lg=()=>B;var $g=e=>(ja.add(e),e);function or(e,t,n){return{combine:e,initialValue:t,combineAll:n??(r=>{let o=t;for(let s of r)o=e(o,s);return o})}}var Rt=e=>(t,n)=>t===n||e(t,n),C2=(e,t)=>e===t,A0=()=>C2;function C0(e){return Rt((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;re.length>0;var _d=e=>l(3,(t,n,r)=>e(t,o=>({...o,[n]:r(o)}))),Md=e=>l(2,(t,n)=>e(t,r=>({[n]:r}))),Pd=(e,t)=>l(3,(n,r,o)=>t(n,s=>e(o(s),i=>({...s,[r]:i}))));function F(e,t,n){t===\"__proto__\"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Fd(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&F(e,n,t[n])}var ye={};uo(ye,{Do:()=>IL,all:()=>fL,andThen:()=>oL,as:()=>J0,asVoid:()=>nL,bind:()=>EL,bindTo:()=>bL,composeK:()=>cL,contains:()=>xL,containsWith:()=>Y0,exists:()=>yL,filter:()=>Ci,filterMap:()=>pL,firstSomeOf:()=>eL,flatMap:()=>vi,flatMapNullishOr:()=>sL,flatten:()=>Ai,fromIterable:()=>G2,fromNullOr:()=>Qg,fromNullishOr:()=>qu,fromUndefinedOr:()=>Yg,gen:()=>wL,getFailure:()=>Z2,getOrElse:()=>Bu,getOrNull:()=>Hd,getOrThrow:()=>ex,getOrThrowWith:()=>Xg,getOrUndefined:()=>ks,getSuccess:()=>V2,isNone:()=>ae,isOption:()=>ec,isSome:()=>_e,let:()=>SL,lift2:()=>hL,liftNullishOr:()=>tL,liftPredicate:()=>gL,liftThrowable:()=>Rs,makeCombinerFailFast:()=>Q0,makeEquivalence:()=>tx,makeOrder:()=>mL,makeReducer:()=>TL,makeReducerFailFast:()=>vL,map:()=>Bt,match:()=>fr,none:()=>R,orElse:()=>Y2,orElseResult:()=>X2,orElseSome:()=>Q2,partitionMap:()=>dL,product:()=>G0,productMany:()=>uL,reduceCompact:()=>lL,some:()=>k,tap:()=>K0,toArray:()=>Z0,toRefinement:()=>K2,void:()=>rL,zipLeft:()=>aL,zipRight:()=>iL,zipWith:()=>V0});function Ud(e){return{combine:e}}var _u=Symbol.for(\"~effect/Redactable\"),k2=e=>M(e,_u);function za(e){return k2(e)?qg(e):e}function qg(e){return e[_u](globalThis[Wa]?.context??R2)}var Wa=\"~effect/Fiber/currentFiber\",k0=new Map,R2={\"~effect/Context\":{},base:k0,depth:0,mapUnsafe:k0,pipe(){return K(this,arguments)}};function N(e,t){let n=t?.space??0,r=new WeakSet,o=n?typeof n==\"number\"?\" \".repeat(n):n:\"\",s=u=>o.repeat(u),i=(u,f)=>{let d=u?.constructor;return d&&d!==Object.prototype.constructor&&d.name?`${d.name}(${f})`:f},a=u=>{try{return Reflect.ownKeys(u)}catch{return[\"[ownKeys threw]\"]}};function c(u,f=0){if(typeof u==\"string\")return JSON.stringify(u);if(typeof u==\"number\"||u==null||typeof u==\"boolean\"||typeof u==\"symbol\")return String(u);if(typeof u==\"bigint\")return String(u)+\"n\";if(typeof u==\"object\"||typeof u==\"function\"){if(r.has(u))return M2;r.add(u);let d;if(_u in u)d=c(qg(u),f);else if(Array.isArray(u))d=!o||u.length<=1?`[${u.map(p=>c(p,f)).join(\",\")}]`:`[\n${s(f+1)}${u.map(p=>c(p,f+1)).join(`,\n`+s(f+1))}\n${s(f)}]`;else if(u instanceof Date)d=zg(u);else if(!t?.ignoreToString&&M(u,\"toString\")&&typeof u.toString==\"function\"&&u.toString!==Object.prototype.toString&&u.toString!==Array.prototype.toString){let p=P2(u);d=u instanceof Error&&u.cause?`${p} (cause: ${c(u.cause,f)})`:p}else if(Symbol.iterator in u)d=`${u.constructor.name}(${c(Array.from(u),f)})`;else{let p=a(u);if(!o||p.length<=1){let m=`{${p.map(g=>`${Bo(g)}:${c(u[g],f)}`).join(\",\")}}`;d=i(u,m)}else{let m=`{\n${p.map(g=>`${s(f+1)}${Bo(g)}: ${c(u[g],f+1)}`).join(`,\n`)}\n${s(f)}}`;d=i(u,m)}}return r.delete(u),d}return String(u)}return c(e,0)}var M2=\"[Circular]\";function Bo(e){return typeof e==\"string\"?JSON.stringify(e):String(e)}function Dd(e){return e.map(t=>`[${Bo(t)}]`).join(\"\")}function zg(e){try{return e.toISOString()}catch{return\"Invalid Date\"}}function P2(e){try{let t=e.toString();return typeof t==\"string\"?t:String(t)}catch{return\"[toString threw]\"}}function hi(e,t){let n=[];return JSON.stringify(e,function(r,o){let s=Object.getOwnPropertyDescriptor(this,r)?.value,i=M(s,_u)?za(s):za(o);if(typeof i==\"bigint\")return N(i);if(typeof i!=\"object\"||i===null)return i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(!n.includes(i))return n.push(i),i},t?.space)??\"null\"}var Qe=Symbol.for(\"nodejs.util.inspect.custom\"),ht=e=>{try{return e=za(e),M(e,\"toJSON\")&&un(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(ht):e}catch{return\"[toJSON threw]\"}},_0=(e,t=2)=>{if(typeof e==\"string\")return e;try{return typeof e==\"object\"?hi(e,{space:t}):N(e,{space:t})}catch{return String(e)}},jQ={toJSON(){return ht(this)},[Qe](){return this.toJSON()},toString(){return N(this.toJSON())}},R0=class{[Qe](){return this.toJSON()}toString(){return N(this.toJSON())}};var vs=class e{called=!1;self;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},U2=()=>{let e=\"~effect/Utils/internal\",t={[e]:o=>o()},n={[e]:o=>o()};return t[e](()=>new Error().stack)?.includes(e)===!0?t[e]:n[e]},we=U2();var po=\"~effect/Effect\",gi=\"~effect/Exit\",N2={_A:_,_E:_,_R:_},F0=`${po}/identifier`,Z=`${po}/args`,at=`${po}/evaluate`,fn=`${po}/successCont`,sr=`${po}/failureCont`,As=`${po}/ensureCont`,bi=Symbol.for(\"effect/Effect/Yield\"),ln={pipe(){return K(this,arguments)},toJSON(){return{...this}},toString(){return N(this.toJSON(),{ignoreToString:!0,space:2})},[Qe](){return this.toJSON()}},U0={[be](){return Pg(this,Object.keys(this))},[Se](e){let t=Object.keys(this),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r=0;rM(e,po),Wg=e=>M(e,gi),Ha=\"~effect/Cause\",Ja=\"~effect/Cause/Reason\",Ga=e=>M(e,Ha),D0=e=>M(e,Ja),lo=class{[Ha];reasons;constructor(t){this[Ha]=Ha,this.reasons=t}pipe(){return K(this,arguments)}toJSON(){return{_id:\"Cause\",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${N(this.reasons)})`}[Qe](){return this.toJSON()}[Se](t){return Ga(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,r)=>B(n,t.reasons[r]))}[be](){return Ba(this.reasons)}},P0=new WeakMap,Ka=class{[Ja];annotations;_tag;constructor(t,n,r){if(this[Ja]=Ja,this._tag=t,n!==Fu&&typeof r==\"object\"&&r!==null&&n.size>0){let o=P0.get(r);o&&(n=new Map([...o,...n])),P0.set(r,n)}this.annotations=n}annotate(t,n){if(t.mapUnsafe.size===0)return this;let r=new Map(this.annotations);t.mapUnsafe.forEach((s,i)=>{n?.overwrite!==!0&&r.has(i)||r.set(i,s)});let o=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return o.annotations=r,o}pipe(){return K(this,arguments)}toString(){return N(this)}[Qe](){return this.toString()}},Fu=new Map,xi=class extends Ka{error;constructor(t,n=Fu){super(\"Fail\",n,t),this.error=t}toString(){return`Fail(${N(this.error)})`}toJSON(){return{_tag:\"Fail\",error:this.error}}[Se](t){return Cs(t)&&B(this.error,t.error)&&B(this.annotations,t.annotations)}[be](){return it(Ue(this._tag))(it(H(this.error))(H(this.annotations)))}},qo=e=>new lo(e),Nd=new lo([]),Va=e=>new lo([new xi(e)]),Mu=class extends Ka{defect;constructor(t,n=Fu){super(\"Die\",n,t),this.defect=t}toString(){return`Die(${N(this.defect)})`}toJSON(){return{_tag:\"Die\",defect:this.defect}}[Se](t){return Si(t)&&B(this.defect,t.defect)&&B(this.annotations,t.annotations)}[be](){return it(Ue(this._tag))(it(H(this.defect))(H(this.annotations)))}},Hg=e=>new lo([new Mu(e)]),Za=l(e=>Ga(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new lo(e.reasons.map(r=>r.annotate(t,n)))),Cs=e=>e._tag===\"Fail\",Si=e=>e._tag===\"Die\",Ei=e=>e._tag===\"Interrupt\";function $2(e){return ar(\"Effect.evaluate: Not implemented\")}var zo=e=>({...L2,[F0]:e.op,[at]:e[at]??$2,[fn]:e[fn],[sr]:e[sr],[As]:e[As]}),ir=e=>{let t=zo(e);return function(){let n=Object.create(t);return n[Z]=e.single===!1?arguments:arguments[0],n}},N0=e=>{let t={[gi]:gi,_tag:e.op,get[e.prop](){return this[Z]},...zo(e),toString(){return`${e.op}(${N(this[Z])})`},toJSON(){return{_id:\"Exit\",_tag:e.op,[e.prop]:this[Z]}},[Se](n){return Wg(n)&&n._tag===this._tag&&B(this[Z],n[Z])},[be](){return it(Ue(e.op),H(this[Z]))}};return function(n){let r=Object.create(t);return r[Z]=n,r}},Oe=N0({op:\"Success\",prop:\"value\",[at](e){let t=e.getCont(fn);return t?t[fn](this[Z],e,this):e.yieldWith(this)}}),Ld={key:\"effect/Cause/StackTrace\"},Jg={key:\"effect/Cause/InterruptorStackTrace\"},Mt=N0({op:\"Failure\",prop:\"cause\",[at](e){let t=this[Z],n=!1;e.currentStackFrame&&(t=Za(t,{mapUnsafe:new Map([[Ld.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(sr);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(sr);return r?r[sr](t,e,n?void 0:this):e.yieldWith(n?Mt(t):this)}}),jn=e=>Mt(Va(e)),ar=e=>Mt(Hg(e)),Y=ir({op:\"WithFiber\",[at](e){return this[Z](e)}}),j2=(function(){class e extends globalThis.Error{}let t=zo({op:\"YieldableError\",[at](){return jn(this)}});return delete t.toString,Object.assign(e.prototype,t),e})(),Uu=(function(){let e=Symbol.for(\"effect/Data/Error/plainArgs\");return class extends j2{constructor(n){super(n?.message,n?.cause?{cause:n.cause}:void 0),n&&(Fd(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),Wo=e=>{class t extends Uu{_tag=e}return t.prototype.name=e,t},Pu=\"~effect/Cause/NoSuchElementError\",$d=e=>M(e,Pu),Mr=class extends Wo(\"NoSuchElementError\"){[Pu]=Pu;constructor(t){super({message:t})}},yi=\"~effect/Cause/Done\",Du=e=>M(e,yi),L0={[yi]:yi,_tag:\"Done\",value:void 0},Ii=e=>e===void 0?L0:{[yi]:yi,_tag:\"Done\",value:e},B2=jn(L0),$0=e=>e===void 0?B2:jn(Ii(e));var j0=\"~effect/data/Option\",B0={[j0]:{_A:e=>e},...ln,[Symbol.iterator](){return new vs(this)}},q2=Object.defineProperty(Object.assign(Object.create(B0),{_tag:\"Some\",_op:\"Some\",[Se](e){return jd(e)&&Kg(e)&&B(this.value,e.value)},[be](){return it(H(this._tag))(H(this.value))},toString(){return`some(${N(this.value)})`},toJSON(){return{_id:\"Option\",_tag:this._tag,value:ht(this.value)}}}),\"valueOrUndefined\",{get(){return this.value}}),z2=H(\"None\"),W2=Object.assign(Object.create(B0),{_tag:\"None\",_op:\"None\",valueOrUndefined:void 0,[Se](e){return jd(e)&&Bd(e)},[be](){return z2},toString(){return\"none()\"},toJSON(){return{_id:\"Option\",_tag:this._tag}}}),jd=e=>M(e,j0),Bd=e=>e._tag===\"None\",Kg=e=>e._tag===\"Some\",Nu=Object.create(W2),Lu=e=>{let t=Object.create(q2);return t.value=e,t};var z0=\"~effect/data/Result\",W0={[z0]:{_A:e=>e,_E:e=>e},...ln,[Symbol.iterator](){return new vs(this)}},H2=Object.assign(Object.create(W0),{_tag:\"Success\",_op:\"Success\",[Se](e){return qd(e)&&Qa(e)&&B(this.success,e.success)},[be](){return it(H(this._tag))(H(this.success))},toString(){return`success(${N(this.success)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,value:ht(this.success)}}}),J2=Object.assign(Object.create(W0),{_tag:\"Failure\",_op:\"Failure\",[Se](e){return qd(e)&&Ya(e)&&B(this.failure,e.failure)},[be](){return it(H(this._tag))(H(this.failure))},toString(){return`failure(${N(this.failure)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,failure:ht(this.failure)}}}),qd=e=>M(e,z0),Ya=e=>e._tag===\"Failure\",Qa=e=>e._tag===\"Success\",zd=e=>{let t=Object.create(J2);return t.failure=e,t},Wd=e=>{let t=Object.create(H2);return t.success=e,t},Gg=e=>Qa(e)?Nu:Lu(e.failure),Vg=e=>Ya(e)?Nu:Lu(e.success);function Ho(e){return(t,n)=>t===n?0:e(t,n)}var Bn=Ho((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:eeHo((n,r)=>e(t(n),t(r)))),wi=Zg(Bn,e=>e.getTime());var Xa=e=>l(2,(t,n)=>e(t,n)===-1),Os=e=>l(2,(t,n)=>e(t,n)===1),$u=e=>l(2,(t,n)=>e(t,n)!==1),ju=e=>l(2,(t,n)=>e(t,n)!==-1);var R=()=>Nu,k=Lu,ec=jd,ae=Bd,_e=Kg,fr=l(2,(e,{onNone:t,onSome:n})=>ae(e)?t():n(e.value)),K2=e=>t=>_e(e(t)),G2=e=>{for(let t of e)return k(t);return R()},V2=Vg,Z2=Gg,Bu=l(2,(e,t)=>ae(e)?t():e.value),Y2=l(2,(e,t)=>ae(e)?t():e),Q2=l(2,(e,t)=>ae(e)?k(t()):e),X2=l(2,(e,t)=>ae(e)?Bt(t(),Wd):Bt(e,zd)),eL=e=>{let t=R();for(t of e)if(_e(t))return t;return t},qu=e=>e==null?R():k(e),Yg=e=>e===void 0?R():k(e),Qg=e=>e===null?R():k(e),tL=e=>(...t)=>qu(e(...t)),Hd=Bu(Cg),ks=Bu(fo),Rs=e=>(...t)=>{try{return k(e(...t))}catch{return R()}},Xg=l(2,(e,t)=>{if(_e(e))return e.value;throw t()}),ex=Xg(()=>new Error(\"getOrThrow called on a None\")),Bt=l(2,(e,t)=>ae(e)?R():k(t(e.value))),J0=l(2,(e,t)=>Bt(e,()=>t)),nL=J0(void 0),rL=k(void 0);var vi=l(2,(e,t)=>ae(e)?R():t(e.value)),oL=l(2,(e,t)=>vi(e,n=>{let r=un(t)?t(n):t;return ec(r)?r:k(r)})),sL=l(2,(e,t)=>ae(e)?R():qu(t(e.value))),Ai=vi(_),iL=l(2,(e,t)=>vi(e,()=>t)),aL=l(2,(e,t)=>K0(e,()=>t)),cL=l(2,(e,t)=>n=>vi(e(n),t)),K0=l(2,(e,t)=>vi(e,n=>Bt(t(n),()=>n))),G0=(e,t)=>_e(e)&&_e(t)?k([e.value,t.value]):R(),uL=(e,t)=>{if(ae(e))return R();let n=[e.value];for(let r of t){if(ae(r))return R();n.push(r.value)}return k(n)},fL=e=>{if(Symbol.iterator in e){let n=[];for(let r of e){if(ae(r))return R();n.push(r.value)}return k(n)}let t={};for(let n of Object.keys(e)){let r=e[n];if(ae(r))return R();F(t,n,r.value)}return k(t)},V0=l(3,(e,t,n)=>Bt(G0(e,t),([r,o])=>n(r,o))),lL=l(3,(e,t,n)=>{let r=t;for(let o of e)_e(o)&&(r=n(r,o.value));return r}),Z0=e=>ae(e)?[]:[e.value],dL=l(2,(e,t)=>{if(ae(e))return[R(),R()];let n=t(e.value);return Ya(n)?[k(n.failure),R()]:[R(),k(n.success)]}),pL=l(2,(e,t)=>{if(ae(e))return R();let n=t(e.value);return Qa(n)?k(n.success):R()}),Ci=l(2,(e,t)=>ae(e)?R():t(e.value)?k(e.value):R()),tx=e=>Rt((t,n)=>ae(t)?ae(n):ae(n)?!1:e(t.value,n.value)),mL=e=>Ho((t,n)=>_e(t)?_e(n)?e(t.value,n.value):1:-1),hL=e=>l(2,(t,n)=>V0(t,n,e)),gL=l(2,(e,t)=>t(e)?k(e):R()),Y0=e=>l(2,(t,n)=>ae(t)?!1:e(t.value,n)),xL=Y0(Lg()),yL=l(2,(e,t)=>ae(e)?!1:t(e.value)),bL=Md(Bt),SL=_d(Bt);var EL=Pd(Bt,vi),IL=k({}),wL=(...e)=>{let n=(e.length===1?e[0]:e[1].bind(e[0]))(),r=n.next();for(;!r.done;){let o=r.value;if(ae(o))return o;r=n.next(o.value)}return k(r.value)};function TL(e){return or((t,n)=>ae(t)?n:ae(n)?t:k(e.combine(t.value,n.value)),R())}function Q0(e){return Ud((t,n)=>ae(t)||ae(n)?R():k(e.combine(t.value,n.value)))}function vL(e){let t=Q0(e).combine,n=k(e.initialValue);return or(t,n,r=>{let o=n;for(let s of r)if(o=t(o,s),ae(o))return o;return o})}var se=Wd,re=zd;var X0=e=>{if(un(e))try{return se(e())}catch(t){return re(t)}else try{return se(e.try())}catch(t){return re(e.catch(t))}};var eT=qd,ie=Ya,Tt=Qa;var tT=(e,t)=>Rt((n,r)=>ie(n)?ie(r)&&t(n.failure,r.failure):Tt(r)&&e(n.success,r.success));var Jd=l(2,(e,t)=>ie(e)?re(t(e.failure)):e),Oi=l(2,(e,t)=>Tt(e)?se(t(e.success)):e),lr=l(2,(e,{onFailure:t,onSuccess:n})=>ie(e)?t(e.failure):n(e.success));var zu=l(2,(e,t)=>ie(e)?t(e.failure):e.success);var Kd=l(2,(e,t)=>ie(e)?re(e.failure):t(e.success));var AL=(e,t)=>{let n=t?.length!==void 0?Math.max(1,Math.floor(t.length)):1/0;return{[Symbol.iterator](){let r=0;return{next(){return rOL(AL(()=>e,{length:t}))),nT=e=>CL(e,1/0);var rT=e=>{let n=e[Symbol.iterator]().next();if(n.done)throw new Error(\"headUnsafe: empty iterable\");return n.value};var OL=e=>({[Symbol.iterator](){let t=e[Symbol.iterator](),n;function r(){for(;;){if(n===void 0){let s=t.next();if(s.done)return s;n=s.value[Symbol.iterator]()}let o=n.next();if(!o.done)return o;n=void 0}}return{next:r}}});var oT=l(2,(e,t)=>({[Symbol.iterator](){let n=e[Symbol.iterator](),r=0;return{next(){let o=n.next();for(;!o.done;){if(t(o.value,r++))return{done:!1,value:o.value};o=n.next()}return{done:!0,value:void 0}}}}}));var Wu=l(2,(e,t)=>{let n={...e};for(let r of kL(e))F(n,r,t(e[r],r));return n});var kL=e=>Object.keys(e);var Hu=globalThis.Array;var sT=l(2,(e,t)=>{let n=Math.max(1,Math.floor(e)),r=new Hu(n);for(let o=0;oe<=t?sT(t-e+1,n=>e+n):[e];var Be=e=>Hu.isArray(e)?e:Hu.from(e),iT=e=>Hu.isArray(e)?e:[e];var ox=l(2,(e,t)=>[...e,t]),sx=l(2,(e,t)=>Be(e).concat(Be(t)));var aT=Hu.isArray;var qt=jg,Me=jg;function RL(e,t){return!Number.isFinite(e)||e<0||e>=t.length}var cT=l(2,(e,t)=>{let n=Math.floor(t);if(RL(n,e))throw new Error(`Index out of bounds: ${n}`);return e[n]});var Vd=e=>e[e.length-1];var uT=l(2,(e,t)=>{let n=0,r=[];for(let o of e){if(!t(o,n))break;r.push(o),n++}return r});var _L=(e,t)=>{let n=H(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let o of r)if(B(o,t))return!1;return r.push(t),!0};var ix=l(2,(e,t)=>{let n=Be(e),r=Be(t);return Me(n)?Me(r)?Zd(sx(n,r)):n:r});var gt=()=>[],Ee=e=>[e],Pr=l(2,(e,t)=>e.map(t));var ax=e=>{let t=[];for(let n of e)_e(n)&&t.push(n.value);return t};var cx=l(2,(e,t)=>{let n=Be(e),r=[];for(let o=0;o{let n=[],r=[],o=0;for(let s of e){let i=t(s,o++);Tt(i)?r.push(i.success):n.push(i.failure)}return[n,r]});var Zd=e=>{let t=Be(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let o of t)_L(n,o)&&r.push(o);return r};var ML=or((e,t)=>e.concat(t),[]);function fT(){return ML}var lT=/^[+-]?\\d+$/,fx=\"~effect/BigDecimal\",NL={[fx]:fx,[be](){let e=lx(this);return it(H(e.value),On(e.scale))},[Se](e){return Qd(e)&&zL(this,e)},toString(){return`BigDecimal(${mo(this)})`},toJSON(){return{_id:\"BigDecimal\",value:String(this.value),scale:this.scale}},[Qe](){return this.toJSON()},pipe(){return K(this,arguments)}},Qd=e=>M(e,fx),Rn=(e,t)=>{let n=Object.create(NL);return n.value=e,n.scale=t,n},pT=(e,t)=>{if(e!==qn&&e%Yd===qn)throw new RangeError(\"Value must be normalized\");let n=Rn(e,t);return n.normalized=n,n},qn=BigInt(0),LL=BigInt(1),$L=BigInt(-1);var Yd=BigInt(10),mT=pT(qn,0);var lx=e=>{if(e.normalized===void 0)if(e.value===qn)e.normalized=mT;else{let t=`${e.value}`,n=0;for(let s=t.length-1;s>=0&&t[s]===\"0\";s--)n++;n===0&&(e.normalized=e);let r=BigInt(t.substring(0,t.length-n)),o=e.scale-n;e.normalized=pT(r,o)}return e.normalized},_s=l(2,(e,t)=>t>e.scale?Rn(e.value*Yd**BigInt(t-e.scale),t):tt.value===qn?e:e.value===qn?t:e.scale>t.scale?Rn(_s(t,e.scale).value+e.value,e.scale):e.scale{let n=Bn(dT(e),dT(t));return n!==0?n:e.scale>t.scale?ur(e.value,_s(t,e.scale).value):e.scalee.value===qn?0:e.valuee.valuee.scale>t.scale?_s(t,e.scale).value===e.value:e.scaledx(e,t));var gT=e=>{if(e===\"\")return k(mT);let t,n,r=e.search(/[eE]/);if(r!==-1){let c=e.slice(r+1);if(t=e.slice(0,r),n=Number(c),t===\"\"||!Number.isSafeInteger(n)||!lT.test(c))return R()}else t=e,n=0;let o,s,i=t.search(/\\./);if(i!==-1){let c=t.slice(0,i),u=t.slice(i+1);o=`${c}${u}`,s=u.length}else o=t,s=0;if(!lT.test(o))return R();let a=s-n;return Number.isSafeInteger(a)?k(Rn(BigInt(o),a)):R()};var mo=e=>{let t=lx(e);if(Math.abs(t.scale)>=16)return WL(t);let n=t.value=r.length)o=\"0\",s=\"0\".repeat(t.scale-r.length)+r;else{let a=r.length-t.scale;if(a>r.length){let c=a-r.length;o=`${r}${\"0\".repeat(c)}`,s=\"\"}else s=r.slice(a),o=r.slice(0,a)}let i=s===\"\"?o:`${o}.${s}`;return n?`-${i}`:i},WL=e=>{if(HL(e))return\"0e+0\";let t=lx(e),n=`${qL(t).value}`,r=n.slice(0,1),o=n.slice(1),s=`${xT(t)?\"-\":\"\"}${r}`;o!==\"\"&&(s+=`.${o}`);let i=o.length-t.scale;return`${s}e${i>=0?\"+\":\"\"}${i}`};var HL=e=>e.value===qn,xT=e=>e.valuee.value>qn,px=e=>Qd(e[0]);var yT=l(px,(e,t=0)=>e.scale<=t?e:Rn(e.value/Yd**BigInt(e.scale-t),t)),mx=l(px,(e,t=0)=>{let n=yT(e,t);return JL(e)&&jL(n,e)?hT(n,Rn(LL,t)):n});var hx=l(px,(e,t=0)=>{let n=yT(e,t);return xT(e)&&BL(n,e)?hT(n,Rn($L,t)):n});var x9=globalThis.Boolean;var bT=or((e,t)=>e||t,!1);var Wt={};uo(Wt,{AsyncFiberError:()=>Bj,AsyncFiberErrorTypeId:()=>$j,Done:()=>cb,DoneTypeId:()=>_j,ExceededCapacityError:()=>ub,ExceededCapacityErrorTypeId:()=>Lj,IllegalArgumentError:()=>vf,IllegalArgumentErrorTypeId:()=>Uj,InterruptorStackTrace:()=>Xy,NoSuchElementError:()=>Rj,NoSuchElementErrorTypeId:()=>kj,ReasonTypeId:()=>dj,StackTrace:()=>Qy,TimeoutError:()=>Fj,TimeoutErrorTypeId:()=>Mj,TypeId:()=>lj,UnknownError:()=>Wj,UnknownErrorTypeId:()=>qj,annotate:()=>Hj,annotations:()=>Kj,combine:()=>xj,die:()=>rb,done:()=>G,empty:()=>nb,fail:()=>hj,filterInterruptors:()=>Aj,findDefect:()=>Ij,findDie:()=>Ej,findError:()=>ib,findErrorOption:()=>bj,findFail:()=>yj,findInterrupt:()=>Tj,fromReasons:()=>Bi,hasDies:()=>Sj,hasFails:()=>sb,hasInterrupts:()=>wj,hasInterruptsOnly:()=>ob,interrupt:()=>gj,interruptors:()=>vj,isAsyncFiberError:()=>jj,isCause:()=>eb,isDieReason:()=>pj,isDone:()=>dc,isExceededCapacityError:()=>Nj,isFailReason:()=>Ef,isIllegalArgumentError:()=>Dj,isInterruptReason:()=>mj,isNoSuchElementError:()=>Oj,isReason:()=>tb,isTimeoutError:()=>Pj,isUnknownError:()=>zj,makeDieReason:()=>wf,makeFailReason:()=>If,makeInterruptReason:()=>Tf,map:()=>ns,pretty:()=>ab,prettyErrors:()=>Cj,reasonAnnotations:()=>Jj,squash:()=>Wp});var Xd=e=>zo({op:e.label,[at]:e.evaluate});var ET=\"~effect/Context/Service\",Vt=function(){function e(){}let t=e;Object.setPrototypeOf(t,KL);let n=(r,o)=>(t.key=r,o?.defaultValue&&(t[bx]=bx,t.defaultValue=o.defaultValue),o?.make&&(t.make=o.make),o?.fiberCached&&IT.add(r),t);return arguments.length>0?n(arguments[0],arguments[1]):n},KL={[ET]:ET,...Xd({label:\"Service\",evaluate(e){return Oe(Xe(e.context,this))}}),toJSON(){return{_id:\"Service\",key:this.key}},of(e){return e},context(e){return ki(this,e)},use(e){return Y(t=>e(Xe(t.context,this)))},useSync(e){return Y(t=>Oe(e(Xe(t.context,this))))}},IT=new Set,bx=\"~effect/Context/Reference\",wT=\"~effect/Context\",GL=8,VL=8,Sx=(e,t,n,r)=>{let o=Object.create(YL);return o.cacheRoot=e??o,o.base=t,o.overlay=n,o.depth=r,o._flat=void 0,o.baseHits=0,o},TT=(e,t)=>{t&&(TT(e,t.parent),e.set(t.key,t.value))},vT=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return TT(t,e.overlay),e._flat=t},ZL=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),ho(n)},ep=Symbol(),Ex=(e,t)=>{let n=e;for(let o=n.overlay;o;o=o.parent)if(o.key===t)return o.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?ep:(n.overlay&&++n.baseHits>=VL&&(n.base=vT(n),n.overlay=void 0,n.depth=0),r)},ho=e=>Sx(void 0,e,void 0,0),YL={get mapUnsafe(){return vT(this)},...ln,[wT]:{_Services:e=>e},toJSON(){return{_id:\"Context\",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Se](e){if(!Ju(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[r,o]of t)if(!n.has(r)||!B(o,n.get(r)))return!1;return!0},[be](){return On(this.mapUnsafe.size)}},AT=(e,t)=>e.cacheRoot===t.cacheRoot,Ju=e=>M(e,wT);var CT=e=>!!e[bx],pn=()=>QL,QL=ho(new Map),ki=(e,t)=>ho(new Map([[e.key,t]])),Pt=l(3,(e,t,n)=>XL(e,t.key,n)),XL=(e,t,n)=>{let r=e,o=IT.has(t)?void 0:r.cacheRoot;if(r.depth>=GL){let s=new Map(r.mapUnsafe);return s.set(t,n),Sx(o,s,void 0,0)}return Sx(o,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)};var tp=l(2,(e,t)=>Ku(e,t.key)),Ku=(e,t)=>{let n=Ex(e,t);return n===ep?void 0:n},Fr=l(2,(e,t)=>{let n=Ex(e,t.key);if(n===ep){if(CT(t))return OT(t);throw e$(t)}return n}),Xe=Fr,yx=\"~effect/Context/defaultValue\",OT=e=>yx in e?e[yx]:e[yx]=e.defaultValue(),e$=e=>{let t=new Error(`Service not found${e.key?`: ${String(e.key)}`:\"\"}`);if(t.stack){let n=t.stack.split(`\n`);n.splice(1,3),t.stack=n.join(`\n`)}return t},Ix=l(2,(e,t)=>{let n=Ex(e,t.key);return n!==ep?k(n):CT(t)?k(OT(t)):R()}),np=l(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:ZL(e,n=>t.mapUnsafe.forEach((r,o)=>n.set(o,r)))),kT=(...e)=>{let t=new Map;for(let n=0;n{t.set(o,r)});return ho(t)};var Ae=Vt;var rp=\"~effect/time/Duration\",Tx=BigInt(0),PT=BigInt(1),t$=BigInt(2),n$=BigInt(10);var r$=BigInt(1e3);var op=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),FT=e=>op(e*1e6),RT=(e,t)=>{let n=e.indexOf(\".\");if(n===-1)return BigInt(e)*t;let r=e[0]===\"-\",o=e.slice(n+1),s=n$**BigInt(o.length),i=(BigInt(e.slice(r?1:0,n))*s+BigInt(o))*t,a=i/s+(i%s*t$>=s?PT:Tx);return r?-a:a};var o$=/^(-?\\d+(?:\\.\\d+)?)\\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,mt=e=>{switch(typeof e){case\"number\":return go(e);case\"bigint\":return dr(e);case\"string\":{if(e===\"Infinity\")return Ur;if(e===\"-Infinity\")return Ri;let t=o$.exec(e);if(!t)break;let[n,r,o]=t;if(o===\"nano\"||o===\"nanos\")return dr(RT(r,PT));if(o===\"micro\"||o===\"micros\")return dr(RT(r,r$));let s=Number(r);switch(o){case\"milli\":case\"millis\":return go(s);case\"second\":case\"seconds\":return c$(s);case\"minute\":case\"minutes\":return u$(s);case\"hour\":case\"hours\":return f$(s);case\"day\":case\"days\":return l$(s);case\"week\":case\"weeks\":return d$(s)}break}case\"object\":{if(e===null)break;if(rp in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(ku)?_T(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Ms:e[0]===-1/0||e[1]===-1/0?Ri:e[0]===1/0||e[1]===1/0?Ur:mn(op(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?mn(n):mn(op(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return _T(e)},_T=e=>{throw new Error(`Invalid Input: ${e}`)},UT=Rs(mt),MT={_tag:\"Millis\",millis:0},s$={_tag:\"Infinity\"},i$={_tag:\"NegativeInfinity\"},a$={[rp]:rp,[be](){switch(this.value._tag){case\"Millis\":{let e=this.value.millis*1e6;return Number.isFinite(e)?H(op(e)):On(this.value.millis)}case\"Nanos\":return H(this.value.nanos);default:return Fg(this.value)}},[Se](e){return vx(e)&&m$(this,e)},toString(){switch(this.value._tag){case\"Infinity\":return\"Infinity\";case\"NegativeInfinity\":return\"-Infinity\";case\"Nanos\":return`${this.value.nanos} nanos`;case\"Millis\":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case\"Millis\":return{_id:\"Duration\",_tag:\"Millis\",millis:this.value.millis};case\"Nanos\":return{_id:\"Duration\",_tag:\"Nanos\",nanos:String(this.value.nanos)};case\"Infinity\":return{_id:\"Duration\",_tag:\"Infinity\"};case\"NegativeInfinity\":return{_id:\"Duration\",_tag:\"NegativeInfinity\"}}},[Qe](){return this.toJSON()},pipe(){return K(this,arguments)}},mn=e=>{let t=Object.create(a$);return typeof e==\"number\"?isNaN(e)||e===0||Object.is(e,-0)?t.value=MT:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:\"Millis\",millis:e}:t.value={_tag:\"Nanos\",nanos:FT(e)}:t.value=e>0?s$:i$:e===Tx?t.value=MT:t.value={_tag:\"Nanos\",nanos:e},t},vx=e=>M(e,rp),tc=e=>e.value._tag!==\"Infinity\"&&e.value._tag!==\"NegativeInfinity\",Gu=e=>{switch(e.value._tag){case\"Millis\":return e.value.millis===0;case\"Nanos\":return e.value.nanos===Tx;case\"Infinity\":case\"NegativeInfinity\":return!1}};var Ms=mn(0),Ur=mn(1/0),Ri=mn(-1/0),dr=e=>mn(e);var go=e=>mn(e),c$=e=>mn(e*1e3),u$=e=>mn(e*6e4),f$=e=>mn(e*36e5),l$=e=>mn(e*864e5),d$=e=>mn(e*6048e5),_n=e=>p$(mt(e),{onMillis:_,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var wx=e=>{let t=mt(e);switch(t.value._tag){case\"Infinity\":case\"NegativeInfinity\":throw new Error(\"Cannot convert infinite duration to nanos\");case\"Nanos\":return t.value.nanos;case\"Millis\":return FT(t.value.millis)}},DT=Rs(wx);var p$=l(2,(e,t)=>{switch(e.value._tag){case\"Millis\":return t.onMillis(e.value.millis);case\"Nanos\":return t.onNanos(e.value.nanos);case\"Infinity\":return t.onInfinity();case\"NegativeInfinity\":return(t.onNegativeInfinity??t.onInfinity)()}}),NT=l(3,(e,t,n)=>e.value._tag===\"Infinity\"||e.value._tag===\"NegativeInfinity\"||t.value._tag===\"Infinity\"||t.value._tag===\"NegativeInfinity\"?n.onInfinity(e,t):e.value._tag===\"Millis\"?t.value._tag===\"Millis\"?n.onMillis(e.value.millis,t.value.millis):n.onNanos(wx(e),t.value.nanos):n.onNanos(e.value.nanos,wx(t)));var Ax=(e,t)=>NT(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r,onInfinity:(n,r)=>n.value._tag===r.value._tag});var LT=l(2,(e,t)=>NT(e,t,{onMillis:(n,r)=>mn(n-r),onNanos:(n,r)=>mn(n-r),onInfinity:(n,r)=>{let o=n.value._tag,s=r.value._tag;return o===\"Infinity\"?s===\"Infinity\"?Ms:Ur:o===\"NegativeInfinity\"?s===\"NegativeInfinity\"?Ms:Ri:s===\"Infinity\"?Ri:Ur}}));var m$=l(2,(e,t)=>Ax(e,t));var Cx=l(2,(e,t)=>n=>{let r=e(n);if(ie(r))return re(n);let o=t(r.success);return ie(o)?re(n):o}),$T=e=>t=>{let n=e(t);return ie(n)?R():k(n.success)};var Vu=Ae(\"effect/Scheduler\",{fiberCached:!0,defaultValue:()=>new _i}),BT=\"setImmediate\"in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},h$=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Ox=class{buckets=[];scheduleTask(t,n){let r=this.buckets,o=r.length,s,i=0;for(;in);i++)s=r[i];s&&s[0]===n?s[1].push(t):i===o?r.push([n,[t]]):r.splice(i,0,[n,[t]])}drain(){let t=this.buckets;return this.buckets=[],t}},_i=class{executionMode;setImmediate;constructor(t=\"async\",n){this.executionMode=t,this.setImmediate=n??(t===\"sync\"?h$:BT)}shouldYield(t){return t.currentOpCount>=t.maxOpsBeforeYield}makeDispatcher(){return new kx(this.setImmediate)}},kx=class{tasks=new Ox;running=void 0;setImmediate;constructor(t=BT){this.setImmediate=t}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let t=this.tasks.drain();for(let n=0;n0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},qT=Ae(\"effect/Scheduler/MaxOpsBeforeYield\",{fiberCached:!0,defaultValue:()=>2048}),zT=Ae(\"effect/Scheduler/PreventSchedulerYield\",{fiberCached:!0,defaultValue:()=>!1});var bo={};uo(bo,{Class:()=>sp,Error:()=>WT,TaggedClass:()=>g$,TaggedError:()=>yo,taggedEnum:()=>x$});var sp=class extends di{constructor(e){super(),e&&Fd(this,e)}},g$=e=>class extends sp{_tag=e},x$=()=>new Proxy({},{get(e,t,n){return t===\"$is\"?$t:t===\"$match\"?y$:r=>({...r,_tag:t})}});function y$(){if(arguments.length===1){let n=arguments[0];return function(r){return n[r._tag](r)}}let e=arguments[0];return arguments[1][e._tag](e)}var WT=Uu,yo=Wo;var HT=\"~effect/encoding/EncodingError\",Go=class extends yo(\"EncodingError\"){[HT]=HT};var ap=e=>_x(typeof e==\"string\"?Ux.encode(e):e),rc=e=>{let t=tv(e),n=t.length;if(n%4!==0)return re(new Go({kind:\"Decode\",module:\"Base64\",input:t,message:`Length must be a multiple of 4, but is ${n}`}));let r=t.indexOf(\"=\");if(r!==-1&&(r$e()(st([J({_tag:ze(\"Some\"),value:n}),J({_tag:ze(\"None\")})]),We({decode:r=>r._tag===\"None\"?R():k(r.value),encode:r=>_e(r)?{_tag:\"Some\",value:r.value}:{_tag:\"None\"}})),toArbitrary:([n])=>(r,o)=>{let s=r.constant(R()),i=r.oneof(s,n.arbitrary.map(k));return _a(r,o,s,i)},toEquivalence:([n])=>tx(n),toFormatter:([n])=>fr({onNone:()=>\"none()\",onSome:r=>`some(${n(r)})`})});return j(t.ast,{value:e})}var _3=wn(\"effect/schema/Option\",Re,({annotations:e,typeParameters:t})=>{let n=si(t[0]);return e===void 0?n:n.annotate(e)});function M3(e){return ow(e).pipe(ne(si(Tn(e)),sR()))}function P3(e){return rg(e).pipe(ne(si(Tn(e)),iR()))}function F3(e,t){return nU(e).pipe(ne(si(Tn(e)),aR(t)))}function U3(e){return Oa(e).pipe(ne(si(Tn(e)),cR()))}function D3(e){return Ar(e).pipe(ne(si(Tn(e)),uR()))}function N3(e,t){let n=t===void 0?\"omit\":t.onNoneEncoding,r=n===null?null:void 0;return Ar(ow(e)).pipe(ne(si(Tn(e)),Pm({decode:o=>o.pipe(Ci(Ad),k),encode:n===\"omit\"?Ai:o=>k(Bu(Ai(o),()=>r))})))}function QU(e,t){let n=Dn()([e,t],([r,o])=>(s,i,a)=>{if(!eT(s))return P(new He(i,s,a));switch(s._tag){case\"Success\":return Ut(kI(r)(s.success,a),{onSuccess:se,onFailure:c=>Pn(i,\"success\",c,s,a)});case\"Failure\":return Ut(kI(o)(s.failure,a),{onSuccess:re,onFailure:c=>Pn(i,\"failure\",c,s,a)})}},{representation:{id:\"effect/schema/Result\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Result(${r[0].runtime}, ${r[1].runtime})`,Type:`Result.Result<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as Result from \"effect/Result\"']}),expected:\"Result\",toCodec:([r,o])=>$e()(st([J({_tag:ze(\"Success\"),success:r}),J({_tag:ze(\"Failure\"),failure:o})]),We({decode:s=>s._tag===\"Success\"?se(s.success):re(s.failure),encode:s=>Tt(s)?{_tag:\"Success\",success:s.success}:{_tag:\"Failure\",failure:s.failure}})),toArbitrary:([r,o])=>(s,i)=>{let a=uD(s,r.terminal?.map(u=>se(u)),o.terminal?.map(u=>re(u))),c=s.oneof(r.arbitrary.map(u=>se(u)),o.arbitrary.map(u=>re(u)));return _a(s,i,a,c)},toEquivalence:([r,o])=>tT(r,o),toFormatter:([r,o])=>lr({onSuccess:s=>`success(${r(s)})`,onFailure:s=>`failure(${o(s)})`})});return j(n.ast,{success:e,failure:t})}var L3=wn(\"effect/schema/Result\",Re,({annotations:e,typeParameters:t})=>{let n=QU(t[0],t[1]);return e===void 0?n:n.annotate(e)}),$3=Cr(e=>{if(!wt(e))return!1;let t=globalThis.Object.keys(e);return t.length>0&&t.every(n=>{switch(n){case\"label\":return typeof e[n]==\"string\";case\"disallowJsonEncode\":return e[n]===!0;default:return!1}})}),j3=st([Re,$3]);function td(e,t){let n=typeof t?.label==\"string\"?t.label:void 0,r=t?.disallowJsonEncode===!0,o=n!==void 0?r?{label:n,disallowJsonEncode:!0}:{label:n}:r?{disallowJsonEncode:!0}:void 0,s=n!==void 0?Ze(ze(n)):void 0,i=Dn()([e],([a])=>(c,u,f)=>{if(VI(c)){let d=s!==void 0?fs(s(c.label,f),p=>new Ve([\"label\"],p)):te;return lt(d,()=>Ut(Ze(a)(nu(c),f),{onSuccess:()=>c,onFailure:()=>new nt(u,[new Ve([\"value\"],new ge(void 0,c,f))],c,f)}))}return P(new He(u,c,f))},{representation:{id:\"effect/schema/Redacted\",payload:o??null},toCode:({typeParameters:a})=>({runtime:o!==void 0?`Schema.Redacted(${a[0].runtime}, ${N(o)})`:`Schema.Redacted(${a[0].runtime})`,Type:`Redacted.Redacted<${a[0].Type}>`,importDeclarations:['import * as Redacted from \"effect/Redacted\"']}),expected:\"Redacted\",toCodecJson:([a])=>$e()(a,{decode:ue(c=>Wl(c,{label:n})),encode:r?IS(c=>\"Cannot serialize Redacted\"+(_e(c)&&typeof c.value.label==\"string\"?` with label: \"${c.value.label}\"`:\"\")):ue(nu)}),toArbitrary:([a])=>()=>({arbitrary:a.arbitrary.map(c=>Wl(c,{label:n})),terminal:a.terminal?.map(c=>Wl(c,{label:n}))}),toFormatter:()=>globalThis.String,toEquivalence:([a])=>EF(a)});return j(i.ast,{value:e})}var B3=wn(\"effect/schema/Redacted\",j3,({annotations:e,payload:t,typeParameters:n})=>{let r=td(n[0],t??void 0);return e===void 0?r:r.annotate(e)});function q3(e,t){return ne(td(Tn(e),{label:t?.label,disallowJsonEncode:t?.disallowEncode}),{decode:ue(n=>Wl(n,{label:t?.label})),encode:t?.disallowEncode?IS(n=>\"Cannot encode Redacted\"+(_e(n)&&typeof n.value.label==\"string\"?` with label: \"${n.value.label}\"`:\"\")):ue(nu)})(e)}function Zh(e,t){let n=Dn()([e,t],([r,o])=>(s,i,a)=>{if(!tb(s))return P(new He(i,s,a));switch(s._tag){case\"Fail\":return Ut(Ze(r)(s.error,a),{onSuccess:If,onFailure:c=>Pn(i,\"error\",c,s,a)});case\"Die\":return Ut(Ze(o)(s.defect,a),{onSuccess:wf,onFailure:c=>Pn(i,\"defect\",c,s,a)});case\"Interrupt\":return x(s)}},{representation:{id:\"effect/schema/CauseReason\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.CauseReason(${r[0].runtime}, ${r[1].runtime})`,Type:`Cause.Failure<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause.Failure\",toCodec:([r,o])=>$e()(st([J({_tag:ze(\"Fail\"),error:r}),J({_tag:ze(\"Die\"),defect:o}),J({_tag:ze(\"Interrupt\"),fiberId:rg(Xn)})]),We({decode:s=>{switch(s._tag){case\"Fail\":return If(s.error);case\"Die\":return wf(s.defect);case\"Interrupt\":return Tf(s.fiberId)}},encode:_})),toArbitrary:([r,o])=>XU(r,o),toEquivalence:([r,o])=>eD(r,o),toFormatter:([r,o])=>tD(r,o)});return j(n.ast,{error:e,defect:t})}var z3=wn(\"effect/schema/CauseReason\",Re,({annotations:e,typeParameters:t})=>{let n=Zh(t[0],t[1]);return e===void 0?n:n.annotate(e)});function XU(e,t){return(n,r)=>{let o=n.constant(Tf()),s=n.oneof(o,n.integer({min:1}).map(Tf),e.arbitrary.map(i=>If(i)),t.arbitrary.map(i=>wf(i)));return _a(n,r,o,s)}}function eD(e,t){return(n,r)=>{if(n._tag!==r._tag)return!1;switch(n._tag){case\"Fail\":return e(n.error,r.error);case\"Die\":return t(n.defect,r.defect);case\"Interrupt\":return n.fiberId===r.fiberId}}}function tD(e,t){return n=>{switch(n._tag){case\"Fail\":return`Fail(${e(n.error)})`;case\"Die\":return`Die(${t(n.defect)})`;case\"Interrupt\":return\"Interrupt\"}}}function Yh(e,t){let n=Dn()([e,t],([r,o])=>{let s=Ye(Zh(r,o));return(i,a,c)=>eb(i)?Ut(Ze(s)(i.reasons,c),{onSuccess:Bi,onFailure:u=>Pn(a,\"failures\",u,i,c)}):P(new He(a,i,c))},{representation:{id:\"effect/schema/Cause\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Cause(${r[0].runtime}, ${r[1].runtime})`,Type:`Cause.Cause<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause\",toCodec:([r,o])=>$e()(Ye(Zh(r,o)),We({decode:Bi,encode:({reasons:s})=>s})),toArbitrary:([r,o])=>nD(r,o),toEquivalence:([r,o])=>rD(r,o),toFormatter:([r,o])=>oD(r,o)});return j(n.ast,{error:e,defect:t})}var W3=wn(\"effect/schema/Cause\",Re,({annotations:e,typeParameters:t})=>{let n=Yh(t[0],t[1]);return e===void 0?n:n.annotate(e)});function nD(e,t){return(n,r)=>{let o=XU(e,t)(n,r),s=n.constant(nb),i=n.array(o.arbitrary).map(Bi);return _a(n,r,s,i)}}function rD(e,t){let n=C0(eD(e,t));return(r,o)=>n(r.reasons,o.reasons)}function oD(e,t){let n=tD(e,t);return r=>`Cause([${r.reasons.map(n).join(\", \")}])`}var H3=Cr(e=>{if(!wt(e))return!1;let t=globalThis.Object.keys(e);return t.length>0&&t.every(n=>(n===\"includeStack\"||n===\"excludeCause\")&&e[n]===!0)}),J3=st([Re,H3]),sD=e=>(e?.includeStack===!0?1:0)|(e?.excludeCause===!0?2:0),iD=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},_F=[];function aD(e){let t=sD(e),n=_F[t];if(n!==void 0)return n;let r=iD(t),o=oi(globalThis.Error,{representation:{id:\"effect/schema/Error\",payload:r??null},toCode:()=>({runtime:r!==void 0?`Schema.ErrorInstance(${N(r)})`:\"Schema.ErrorInstance()\",Type:\"globalThis.Error\"}),expected:\"Error\",toCodecJson:()=>$e()($6,rR(r)),toArbitrary:()=>s=>s.string().map(i=>new globalThis.Error(i))});return _F[t]=o,o}var K3=wn(\"effect/schema/Error\",J3,({annotations:e,payload:t})=>{let n=aD(t??void 0);return e===void 0?n:n.annotate(e)}),MF=[];function G3(e){let t=sD(e),n=MF[t];if(n!==void 0)return n;let r=ad.pipe(ne(tw,oR(iD(t))));return MF[t]=r,r}function cD(e,t,n){let r=Dn()([e,t,n],([o,s,i])=>{let a=Yh(s,i);return(c,u,f)=>{if(!Af(c))return P(new He(u,c,f));switch(c._tag){case\"Success\":return Ut(Ze(o)(c.value,f),{onSuccess:Yt,onFailure:d=>Pn(u,\"value\",d,c,f)});case\"Failure\":return Ut(Ze(a)(c.cause,f),{onSuccess:Qt,onFailure:d=>Pn(u,\"cause\",d,c,f)})}}},{representation:{id:\"effect/schema/Exit\",payload:null},toCode:({typeParameters:o})=>({runtime:`Schema.Exit(${o[0].runtime}, ${o[1].runtime}, ${o[2].runtime})`,Type:`Exit.Exit<${o[0].Type}, ${o[1].Type}, ${o[2].Type}>`,importDeclarations:['import * as Exit from \"effect/Exit\"']}),expected:\"Exit\",toCodec:([o,s,i])=>$e()(st([J({_tag:ze(\"Success\"),value:o}),J({_tag:ze(\"Failure\"),cause:Yh(s,i)})]),We({decode:a=>a._tag===\"Success\"?Yt(a.value):Qt(a.cause),encode:a=>et(a)?{_tag:\"Success\",value:a.value}:{_tag:\"Failure\",cause:a.cause}})),toArbitrary:([o,s,i])=>(a,c)=>{let u=nD(s,i)(a,c),f=uD(a,o.terminal?.map(p=>Yt(p)),u.terminal?.map(p=>Qt(p))),d=a.oneof(o.arbitrary.map(p=>Yt(p)),u.arbitrary.map(p=>Qt(p)));return _a(a,c,f,d)},toEquivalence:([o,s,i])=>{let a=rD(s,i);return(c,u)=>{if(c._tag!==u._tag)return!1;switch(c._tag){case\"Success\":return o(c.value,u.value);case\"Failure\":return a(c.cause,u.cause)}}},toFormatter:([o,s,i])=>{let a=oD(s,i);return c=>{switch(c._tag){case\"Success\":return`Exit.Success(${o(c.value)})`;case\"Failure\":return`Exit.Failure(${a(c.cause)})`}}}});return j(r.ast,{value:e,error:t,defect:n})}var V3=wn(\"effect/schema/Exit\",Re,({annotations:e,typeParameters:t})=>{let n=cD(t[0],t[1],t[2]);return e===void 0?n:n.annotate(e)});function uD(e,t,n){return t===void 0?n:n===void 0?t:e.oneof(t,n)}function _a(e,t,n,r){return{arbitrary:n===void 0||t.recursion===void 0?r:e.oneof(t.recursion,n,r),terminal:n}}function PF(e,t,n,r){return r===void 0?e.array(t,n):e.uniqueArray(t,{...n,comparator:r})}function sg(e,t,n,r,o,s){let i=t.constraint,a=i===void 0||i.minLength===void 0&&i.maxLength===void 0?void 0:{...i.minLength!==void 0?{minLength:i.minLength}:{},...i.maxLength!==void 0?{maxLength:i.maxLength}:{}};if(a?.minLength!==void 0&&a.maxLength!==void 0&&a.minLength>a.maxLength)throw new globalThis.Error(\"Unable to derive an arbitrary for size constraints\");let c=a?.minLength??0,u=c===0?e.constant([]):r===void 0?void 0:PF(e,r,{...a,maxLength:c},s),f=_a(e,t,u,PF(e,n,a,s));return{arbitrary:f.arbitrary.map(o),terminal:f.terminal?.map(o)}}function fD(e,t,n,r,o){return sg(e,t,e.tuple(n.arbitrary,r.arbitrary),n.terminal===void 0||r.terminal===void 0?void 0:e.tuple(n.terminal,r.terminal),o,([s],[i])=>B(s,i))}function lD(e,t){let n=Dn()([e,t],([r,o])=>{let s=Ye(ou([r,o]));return(i,a,c)=>i instanceof globalThis.Map?Ut(Ze(s)([...i],c),{onSuccess:u=>new globalThis.Map(u),onFailure:u=>Pn(a,\"entries\",u,i,c)}):P(new He(a,i,c))},{representation:{id:\"effect/schema/ReadonlyMap\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.ReadonlyMap(${r[0].runtime}, ${r[1].runtime})`,Type:`globalThis.ReadonlyMap<${r[0].Type}, ${r[1].Type}>`}),expected:\"ReadonlyMap\",toCodec:([r,o])=>$e()(Ye(ou([r,o])),We({decode:s=>new globalThis.Map(s),encode:s=>[...s.entries()]})),toArbitrary:([r,o])=>(s,i)=>fD(s,i,r,o,a=>new globalThis.Map(a)),toEquivalence:([r,o])=>kd(r,o),toFormatter:([r,o])=>s=>{let i=s.size;if(i===0)return\"ReadonlyMap(0) {}\";let a=globalThis.Array.from(s.entries()).sort().map(([c,u])=>`${r(c)} => ${o(u)}`);return`ReadonlyMap(${i}) { ${a.join(\", \")} }`}});return j(n.ast,{key:e,value:t})}var Z3=wn(\"effect/schema/ReadonlyMap\",Re,({annotations:e,typeParameters:t})=>{let n=lD(t[0],t[1]);return e===void 0?n:n.annotate(e)});function FF(e,t,n){return J({type:ze(e),nodes:Ye(J({index:Gt,data:t})),edges:Ye(J({index:Gt,source:Gt,target:Gt,data:n}))})}function UF(e,t){let n=-1,r=new Set;for(let o=0;o{let o=kl(n),s=kl(r);if(o.type!==s.type||o.nodes.length!==s.nodes.length||o.edges.length!==s.edges.length)return!1;for(let i=0;i{let s=Rl({type:e,nodes:[],edges:[]}),i=r.constant(s),a=r.array(t.arbitrary).chain(c=>{let u=c.map((d,p)=>({index:p,data:d}));if(u.length===0)return i;let f=r.integer({min:0,max:u.length-1});return r.array(r.tuple(f,f,n.arbitrary)).map(d=>Rl({type:e,nodes:u,edges:d.map(([p,m,g],b)=>({index:b,source:p,target:m,data:g}))}))});return _a(r,o,i,a)}}function dD(e,t,n){let r=Dn()([t,n],([o,s])=>{let i=FF(e,o,s);return(a,c,u)=>!yI(a)||a.mutable||a.type!==e?P(new He(c,a,u)):T(Ze(i)(kl(a),u),f=>UF(f,u))},{representation:{id:\"effect/schema/Graph\",payload:e},toCode:({typeParameters:o})=>({runtime:`Schema.Graph(${N(e)}, ${o[0].runtime}, ${o[1].runtime})`,Type:`Graph.Graph<${o[0].Type}, ${o[1].Type}, ${N(e)}>`,importDeclarations:['import * as Graph from \"effect/Graph\"']}),expected:`an immutable ${e} Graph`,toCodec:([o,s])=>$e()(FF(e,o,s),Zn({decode:UF,encode:(i,a)=>Y3(i,e,a)})),toArbitrary:([o,s])=>X3(e,o,s),toEquivalence:([o,s])=>Q3(o,s),toFormatter:()=>globalThis.String});return j(r.ast,{type:e,node:t,edge:n})}var eG=wn(\"effect/schema/Graph\",io([\"directed\",\"undirected\"]),({annotations:e,payload:t,typeParameters:n})=>{let r=dD(t,n[0],n[1]);return e===void 0?r:r.annotate(e)});function pD(e,t){let n=Dn()([e,t],([r,o])=>{let s=Ye(ou([r,o]));return(i,a,c)=>XM(i)?Ut(Ze(s)(Uh(i),c),{onSuccess:Fh,onFailure:u=>Pn(a,\"entries\",u,i,c)}):P(new He(a,i,c))},{representation:{id:\"effect/schema/HashMap\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.HashMap(${r[0].runtime}, ${r[1].runtime})`,Type:`HashMap.HashMap<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as HashMap from \"effect/HashMap\"']}),expected:\"HashMap\",toCodec:([r,o])=>$e()(Ye(ou([r,o])),We({decode:Fh,encode:Uh})),toArbitrary:([r,o])=>(s,i)=>fD(s,i,r,o,Fh),toEquivalence:([r,o])=>kd(r,o),toFormatter:([r,o])=>s=>{let i=eP(s);if(i===0)return\"HashMap(0) {}\";let a=Uh(s).sort().map(([c,u])=>`${r(c)} => ${o(u)}`);return`HashMap(${i}) { ${a.join(\", \")} }`}});return j(n.ast,{key:e,value:t})}var tG=wn(\"effect/schema/HashMap\",Re,({annotations:e,typeParameters:t})=>{let n=pD(t[0],t[1]);return e===void 0?n:n.annotate(e)});function mD(e){let t=Dn()([e],([n])=>{let r=Ye(n);return(o,s,i)=>o instanceof globalThis.Set?Ut(Ze(r)([...o],i),{onSuccess:a=>new globalThis.Set(a),onFailure:a=>Pn(s,\"values\",a,o,i)}):P(new He(s,o,i))},{representation:{id:\"effect/schema/ReadonlySet\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.ReadonlySet(${n[0].runtime})`,Type:`globalThis.ReadonlySet<${n[0].Type}>`}),expected:\"ReadonlySet\",toCodec:([n])=>$e()(Ye(n),We({decode:r=>new globalThis.Set(r),encode:r=>[...r.values()]})),toArbitrary:([n])=>(r,o)=>sg(r,o,n.arbitrary,n.terminal,s=>new globalThis.Set(s),B),toEquivalence:([n])=>Rd(n),toFormatter:([n])=>r=>{let o=r.size;if(o===0)return\"ReadonlySet(0) {}\";let s=globalThis.Array.from(r.values()).sort().map(i=>`${n(i)}`);return`ReadonlySet(${o}) { ${s.join(\", \")} }`}});return j(t.ast,{value:e})}var nG=wn(\"effect/schema/ReadonlySet\",Re,({annotations:e,typeParameters:t})=>{let n=mD(t[0]);return e===void 0?n:n.annotate(e)});function hD(e){let t=Dn()([e],([n])=>{let r=Ye(n);return(o,s,i)=>sP(o)?Ut(Ze(r)(Be(o),i),{onSuccess:Nh,onFailure:a=>Pn(s,\"values\",a,o,i)}):P(new He(s,o,i))},{representation:{id:\"effect/schema/HashSet\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.HashSet(${n[0].runtime})`,Type:`HashSet.HashSet<${n[0].Type}>`}),expected:\"HashSet\",toCodec:([n])=>$e()(Ye(n),We({decode:Nh,encode:Be})),toArbitrary:([n])=>(r,o)=>sg(r,o,n.arbitrary,n.terminal,Nh,B),toEquivalence:([n])=>Rd(n),toFormatter:([n])=>r=>{let o=iP(r);if(o===0)return\"HashSet(0) {}\";let s=globalThis.Array.from(r).sort().map(i=>`${n(i)}`);return`HashSet(${o}) { ${s.join(\", \")} }`}});return j(t.ast,{value:e})}var rG=wn(\"effect/schema/HashSet\",Re,({annotations:e,typeParameters:t})=>{let n=hD(t[0]);return e===void 0?n:n.annotate(e)});function gD(e){let t=Dn()([e],([n])=>{let r=Ye(n);return(o,s,i)=>Xm(o)?Ut(Ze(r)(Be(o),i),{onSuccess:eh,onFailure:a=>Pn(s,\"values\",a,o,i)}):P(new He(s,o,i))},{representation:{id:\"effect/schema/Chunk\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Chunk(${n[0].runtime})`,Type:`Chunk.Chunk<${n[0].Type}>`}),expected:\"Chunk\",toCodec:([n])=>$e()(Ye(n),We({decode:eh,encode:Be})),toArbitrary:([n])=>(r,o)=>sg(r,o,n.arbitrary,n.terminal,eh),toEquivalence:([n])=>vE(n),toFormatter:([n])=>r=>{let o=d_(r);if(o===0)return\"Chunk(0) {}\";let s=globalThis.Array.from(r).sort().map(i=>`${n(i)}`);return`Chunk(${o}) { ${s.join(\", \")} }`}});return j(t.ast,{value:e})}var oG=wn(\"effect/schema/Chunk\",Re,({annotations:e,typeParameters:t})=>{let n=gD(t[0]);return e===void 0?n:n.annotate(e)}),xD=oi(globalThis.RegExp,{representation:{id:\"effect/schema/RegExp\",payload:null},toCode:()=>({runtime:\"Schema.RegExp\",Type:\"globalThis.RegExp\"}),expected:\"RegExp\",toCodecJson:()=>$e()(J({source:X,flags:X}),Zn({decode:(e,t)=>Sc({try:()=>new globalThis.RegExp(e.source,e.flags),catch:()=>new ge({expected:\"valid RegExp source and flags\"},e,t)}),encode:e=>x({source:e.source,flags:e.flags})})),toArbitrary:()=>e=>e.tuple(e.constantFrom(\".\",\".*\",\"\\\\d+\",\"\\\\w+\",\"[a-z]+\",\"[A-Z]+\",\"[0-9]+\",\"^[a-zA-Z0-9]+$\",\"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\"),e.uniqueArray(e.constantFrom(\"g\",\"i\",\"m\",\"s\",\"u\",\"y\"),{minLength:0,maxLength:6}).map(t=>t.join(\"\"))).map(([t,n])=>new globalThis.RegExp(t,n)),toEquivalence:()=>(e,t)=>e.source===t.source&&e.flags===t.flags}),sG=sn(\"effect/schema/RegExp\",xD),yD=X.annotate({expected:\"a string that will be decoded as a URL\"}),nd=oi(globalThis.URL,{representation:{id:\"effect/schema/URL\",payload:null},toCode:()=>({runtime:\"Schema.URL\",Type:\"globalThis.URL\"}),expected:\"URL\",toCodecJson:()=>$e()(yD,kS),toArbitrary:()=>e=>e.webUrl().map(t=>new globalThis.URL(t)),toEquivalence:()=>(e,t)=>e.toString()===t.toString()}),iG=sn(\"effect/schema/URL\",nd),aG=yD.pipe(ne(nd,kS));function mw(e,t,n){let r={...t};if(e?.minimum!==void 0){let o=n===void 0?e.minimum:n(e.minimum),s=e.exclusiveMinimum?new globalThis.Date(o.getTime()+1):o;(r.min===void 0||s.getTime()>r.min.getTime())&&(r.min=s)}if(e?.maximum!==void 0){let o=n===void 0?e.maximum:n(e.maximum),s=e.exclusiveMaximum?new globalThis.Date(o.getTime()-1):o;(r.max===void 0||s.getTime()e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:\"effect/schema/Date\",payload:null},toCode:()=>({runtime:\"Schema.Date\",Type:\"globalThis.Date\"}),expected:\"a valid Date\",toCodecJson:()=>$e()(bD,OS),toArbitrary:()=>(e,t)=>e.date(mw(t?.constraint?.ordered?.order===wi?t.constraint.ordered:void 0,{noInvalidDate:!0}))}),cG=sn(\"effect/schema/Date\",er),uG=bD.pipe(ne(er,OS)),fG=Uo.pipe(ne(er,Zk)),rd=Cr(vx,{representation:{id:\"effect/schema/Duration\",payload:null},toCode:()=>({runtime:\"Schema.Duration\",Type:\"Duration.Duration\",importDeclarations:['import * as Duration from \"effect/Duration\"']}),expected:\"Duration\",toCodecJson:()=>$e()(st([J({_tag:ze(\"Infinity\")}),J({_tag:ze(\"NegativeInfinity\")}),J({_tag:ze(\"Nanos\"),value:Fo}),J({_tag:ze(\"Millis\"),value:Uo})]),We({decode:e=>{switch(e._tag){case\"Infinity\":return Ur;case\"NegativeInfinity\":return Ri;case\"Nanos\":return dr(e.value);case\"Millis\":return go(e.value)}},encode:e=>{switch(e.value._tag){case\"Infinity\":return{_tag:\"Infinity\"};case\"NegativeInfinity\":return{_tag:\"NegativeInfinity\"};case\"Nanos\":return{_tag:\"Nanos\",value:e.value.nanos};case\"Millis\":return{_tag:\"Millis\",value:e.value.millis}}}})),toArbitrary:()=>e=>e.oneof(e.constant(Ur),e.constant(Ri),e.bigInt().map(dr),e.maxSafeInteger().map(go)),toFormatter:()=>globalThis.String,toEquivalence:()=>Ax}),lG=sn(\"effect/schema/Duration\",rd),dG=X.annotate({expected:\"a string that will be decoded as a Duration\"}),hw=dG.pipe(ne(rd,Yk)),pG=Fo.pipe(ne(rd,Qk)),mG=uu.pipe(ne(rd,Xk)),SD=X.annotate({expected:\"a string that will be decoded as a BigDecimal\"}),ED=20,ID=\"Unable to derive an arbitrary for the ordered BigDecimal constraints\";function Qh(e,t){return _s(e,t).value}function hG(e,t,n){return n?Qh(hx(e,t),t)+globalThis.BigInt(1):Qh(mx(e,t),t)}function gG(e,t,n){return n?Qh(mx(e,t),t)-globalThis.BigInt(1):Qh(hx(e,t),t)}function xG(e){return Math.max(ED,e.minimum?.scale??0,e.maximum?.scale??0,e.exclusiveMinimum&&e.minimum!==void 0?e.minimum.scale+1:0,e.exclusiveMaximum&&e.maximum!==void 0?e.maximum.scale+1:0)}function YI(e,t){let n={};if(e.minimum!==void 0&&(n.min=hG(e.minimum,t,e.exclusiveMinimum===!0)),e.maximum!==void 0&&(n.max=gG(e.maximum,t,e.exclusiveMaximum===!0)),!(n.min!==void 0&&n.max!==void 0&&n.min>n.max))return n}function yG(e){let t=xG(e);if(YI(e,t)===void 0)throw new globalThis.Error(ID);let n=0,r=t;for(;n({runtime:\"Schema.BigDecimal\",Type:\"BigDecimal.BigDecimal\",importDeclarations:['import * as BigDecimal from \"effect/BigDecimal\"']}),expected:\"BigDecimal\",toCodecJson:()=>$e()(SD,RS),toArbitrary:()=>(e,t)=>{let n=t.constraint?.ordered?.order===Jo?t.constraint.ordered:void 0;return n===void 0?e.tuple(e.bigInt(),e.integer({min:0,max:ED})).map(([r,o])=>Rn(r,o)):e.integer(yG(n)).chain(r=>{let o=YI(n,r);if(o===void 0)throw new globalThis.Error(ID);return e.bigInt(o).map(s=>Rn(s,r))})},toFormatter:()=>e=>mo(e),toEquivalence:()=>dx}),bG=sn(\"effect/schema/BigDecimal\",gw),SG=SD.pipe(ne(gw,RS)),EG=X.annotate({expected:\"a string that will be decoded as JSON\",contentMediaType:\"application/json\"});function wD(e,t){return EG.pipe(ne(e,mR(t)))}var IG=wD(tw),xw=oi(globalThis.File,{representation:{id:\"effect/schema/File\",payload:null},toCode:()=>({runtime:\"Schema.File\",Type:\"globalThis.File\"}),expected:\"File\",toCodecJson:()=>$e()(J({data:X.check(cw()),type:X,name:X,lastModified:Uo}),Zn({decode:(e,t)=>lr(rc(e.data),{onFailure:()=>P(new ge({expected:\"a valid Base64 string\"},e.data,t)),onSuccess:n=>{let r=new globalThis.Uint8Array(n);return x(new globalThis.File([r],e.name,{type:e.type,lastModified:e.lastModified}))}}),encode:(e,t)=>bc({try:async()=>{let n=new globalThis.Uint8Array(await e.arrayBuffer());return{data:ap(n),type:e.type,name:e.name,lastModified:e.lastModified}},catch:()=>new ge({expected:\"a readable File\"},e,t)})}))}),wG=sn(\"effect/schema/File\",xw),yw=oi(globalThis.FormData,{representation:{id:\"effect/schema/FormData\",payload:null},toCode:()=>({runtime:\"Schema.FormData\",Type:\"globalThis.FormData\"}),expected:\"FormData\",toCodecJson:()=>$e()(Ye(ou([X,st([J({_tag:ka(\"String\"),value:X}),J({_tag:ka(\"File\"),value:xw})])])),Zn({decode:e=>{let t=new globalThis.FormData;for(let[n,r]of e)t.append(n,r.value);return x(t)},encode:e=>x(globalThis.Array.from(e.entries()).map(([t,n])=>typeof n==\"string\"?[t,{_tag:\"String\",value:n}]:[t,{_tag:\"File\",value:n}]))}))}),TG=sn(\"effect/schema/FormData\",yw);function vG(e){return yw.pipe(ne(e,hR))}var bw=oi(globalThis.URLSearchParams,{representation:{id:\"effect/schema/URLSearchParams\",payload:null},toCode:()=>({runtime:\"Schema.URLSearchParams\",Type:\"globalThis.URLSearchParams\"}),expected:\"URLSearchParams\",toCodecJson:()=>$e()(X.annotate({expected:\"a query string that will be decoded as URLSearchParams\"}),We({decode:e=>new globalThis.URLSearchParams(e),encode:e=>e.toString()}))}),AG=sn(\"effect/schema/URLSearchParams\",bw);function CG(e){return bw.pipe(ne(e,gR))}var OG=X.annotate({expected:\"a string that will be decoded as a number\"}).pipe(ne(uu,_c)),kG=X.annotate({expected:\"a string that will be decoded as a finite number\"}).pipe(ne(Xn,_c)),RG=j(yE).pipe(ne(Fo,Fm)),TD=X.check(aw()),_G=X.annotate({expected:\"a string that will be decoded as a trimmed string\"}).pipe(ne(TD,Gk())),MG=X.annotate({expected:\"a base64 encoded string that will be decoded as a UTF-8 string\"}).pipe(ne(X,fR)),PG=X.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a UTF-8 string\"}).pipe(ne(X,lR)),FG=X.annotate({expected:\"a hex encoded string that will be decoded as a UTF-8 string\"}).pipe(ne(X,dR)),UG=X.annotate({expected:\"a URI component encoded string that will be decoded as a UTF-8 string\"}).pipe(ne(X,pR)),QI=st([Xn,XF,X]),DG=J({issues:Ye(J({message:X,path:Ar(Ye(st([QI,J({key:QI})])))}))}),NG=io([0,1]).pipe(ne(ng,We({decode:e=>e===1,encode:e=>e?1:0}))),vD=X.annotate({expected:\"a base64 encoded string that will be decoded as Uint8Array\",format:\"byte\",contentEncoding:\"base64\"}),od=oi(globalThis.Uint8Array,{representation:{id:\"effect/schema/Uint8Array\",payload:null},toCode:()=>({runtime:\"Schema.Uint8Array\",Type:\"globalThis.Uint8Array\"}),expected:\"Uint8Array\",toCodecJson:()=>$e()(vD,_S),toArbitrary:()=>e=>e.uint8Array()}),LG=sn(\"effect/schema/Uint8Array\",od),$G=vD.pipe(ne(od,_S)),jG=X.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a Uint8Array\"}).pipe(ne(od,{decode:Dk(),encode:Rm()})),BG=X.annotate({expected:\"a hex encoded string that will be decoded as a Uint8Array\"}).pipe(ne(od,{decode:Lk(),encode:_m()})),sd=Cr(e=>yS(e)&&gk(e),{representation:{id:\"effect/schema/DateTimeUtc\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeUtc\",Type:\"DateTime.Utc\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Utc\",toCodecJson:()=>$e()(X,FS),toArbitrary:()=>(e,t)=>e.date(mw(t?.constraint?.ordered?.order===SS?t.constraint.ordered:void 0,{noInvalidDate:!0},vm)).map(n=>yk(n)),toFormatter:()=>e=>e.toString(),toEquivalence:()=>bS}),qG=sn(\"effect/schema/DateTimeUtc\",sd),zG=er.pipe(ne(sd,{decode:CS(),encode:ue(vm)})),WG=X.annotate({expected:\"a string that will be decoded as a DateTime.Utc\"}).pipe(ne(sd,FS)),HG=Uo.pipe(ne(sd,{decode:CS(),encode:ue(wk)})),AD=Cr(mk,{representation:{id:\"effect/schema/TimeZoneOffset\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneOffset\",Type:\"DateTime.TimeZone.Offset\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Offset\",toCodecJson:()=>$e()(Uo,xR),toArbitrary:()=>e=>e.integer({min:-720*60*1e3,max:840*60*1e3}).map(t=>Xf(t)),toFormatter:()=>e=>Vs(e),toEquivalence:()=>(e,t)=>e.offset===t.offset}),JG=sn(\"effect/schema/TimeZoneOffset\",AD),CD=X.annotate({expected:\"an IANA time zone identifier\"}),Sw=Cr(hk,{representation:{id:\"effect/schema/TimeZoneNamed\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneNamed\",Type:\"DateTime.TimeZone.Named\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Named\",toCodecJson:()=>$e()(CD,MS),toArbitrary:()=>e=>e.constantFrom(...[\"UTC\",\"Europe/London\",\"America/New_York\",\"Asia/Tokyo\",\"Australia/Sydney\"].map(ES)),toFormatter:()=>e=>Vs(e),toEquivalence:()=>(e,t)=>e.id===t.id}),KG=sn(\"effect/schema/TimeZoneNamed\",Sw),GG=CD.pipe(ne(Sw,MS)),OD=X.annotate({expected:\"a time zone string (IANA identifier or offset like +03:00)\"}),Ew=Cr(pk,{representation:{id:\"effect/schema/TimeZone\",payload:null},toCode:()=>({runtime:\"Schema.TimeZone\",Type:\"DateTime.TimeZone\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone\",toCodecJson:()=>$e()(OD,PS),toArbitrary:()=>e=>e.oneof(e.integer({min:-720*60*1e3,max:840*60*1e3}).map(t=>Xf(t)),e.constantFrom(...[\"UTC\",\"Europe/London\",\"America/New_York\",\"Asia/Tokyo\",\"Australia/Sydney\"].map(ES))),toFormatter:()=>e=>Vs(e),toEquivalence:()=>(e,t)=>Vs(e)===Vs(t)}),VG=sn(\"effect/schema/TimeZone\",Ew),ZG=OD.pipe(ne(Ew,PS)),kD=X.annotate({expected:\"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])\"}),Iw=Cr(e=>yS(e)&&xk(e),{representation:{id:\"effect/schema/DateTimeZoned\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeZoned\",Type:\"DateTime.Zoned\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Zoned\",toCodecJson:()=>$e()(kD,US),toArbitrary:()=>(e,t)=>e.tuple(e.date(mw(t?.constraint?.ordered?.order===SS?t.constraint.ordered:void 0,{max:new globalThis.Date(864e13-840*60*1e3),min:new globalThis.Date(-864e13+840*60*1e3),noInvalidDate:!0},vm)),e.constantFrom(\"UTC\",\"Europe/London\",\"America/New_York\",\"Asia/Tokyo\",\"Australia/Sydney\")).map(([n,r])=>bk(n,{timeZone:r})),toFormatter:()=>e=>Am(e),toEquivalence:()=>bS}),YG=sn(\"effect/schema/DateTimeZoned\",Iw),QG=kD.pipe(ne(Iw,US)),XG=globalThis.Symbol.for(\"immer-draftable\"),XI={};function ww(e,t,n,r,o){let s=t6(n,t,r),i=RD(t),a=class extends e{constructor(...[c,u]){let d=u?.[\"~payload\"],p=d?.token===XI?d.value:n.make(c??{},u);super(p,{...u,disableChecks:!0,\"~payload\":{token:XI,value:p}})}static[Hl]=Hl;get[i](){return i}static[XG]=!0;static identifier=t;static fields=n.fields;static get ast(){return s(this).ast}static pipe(){return K(this,arguments)}static rebuild(c){return s(this).rebuild(c)}static make(c,u){return new this(c,u)}static makeOption(c,u){return $h(s(this))(c??{},u)}static makeEffect(c,u){return s(this).makeEffect(c??{},u)}static annotate(c){return this.rebuild(Ir(this.ast,c))}static annotateKey(c){return this.rebuild(pl(this.ast,c))}static check(...c){return this.rebuild(ko(this.ast,c))}static extend(c){return(u,f)=>{let d=id(u)?u:J(u),p={...n.fields,...d.fields},m=zm(p,n.ast.checks,{identifier:c});return ww(this,c,rw(ko(m,d.ast.checks),p),f,o)}}static mapFields(c,u){return n.mapFields(c,u)}};return o!==void 0&&Object.assign(a.prototype,o(t)),a}function e6(e){return new Te(ue(t=>new e(t,{\"~payload\":{token:XI,value:t}})),Sn())}function RD(e){return`~effect/Schema/Class/${e}`}function t6(e,t,n){let r;return o=>{if(r!==void 0)return r;let s=RD(t),i=u=>u instanceof o||M(u,s),a=e6(o),c=j(new ia([e.ast],()=>(u,f,d)=>i(u)?x(u):P(new He(f,u,d)),{identifier:t,[xm]:([u])=>({isConstructed:i,link:new Je(u,a)}),toCodec:([u])=>new Je(u.ast,a),toArbitrary:([u])=>()=>({arbitrary:u.arbitrary.map(f=>new o(f)),terminal:u.terminal?.map(f=>new o(f))}),toFormatter:([u])=>f=>`${o.identifier}(${u(f)})`,[Kf]:Fc(e.ast),...n}));return r=ne(c,a)(e)}}function id(e){return tg(e)}var _D=e=>(t,n)=>{let r=id(t)?t:J(t);return ww(sp,e,r,n,o=>({toString(){return`${o}(${N({...this})})`}}))},n6=e=>(t,n,r)=>{let o=id(n)?n.mapFields(s=>({_tag:ka(t),...s}),{unsafePreserveChecks:!0}):og(t,n);return _D(e??t)(o,r)},MD=e=>(t,n)=>{let r=id(t)?t:J(t);return ww(Uu,e,r,n,s=>({name:s}))},r6=e=>(t,n,r)=>{let o=id(n)?n.mapFields(s=>({_tag:ka(t),...s}),{unsafePreserveChecks:!0}):og(t,n);return MD(e??t)(o,r)};function o6(e){let t=KP(e.ast);return n=>t(n,{})}function s6(e){return t=>t.annotate({toFormatter:e})}function i6(e,t){return n(e.ast);function n(o){let s=Co(o)?.toFormatter;if(typeof s==\"function\")return s(Qs(o)?o.typeParameters.map(n):[]);if(t?.onBefore){let i=t.onBefore(o,n);if(i!==void 0)return i}return r(o)}function r(o){switch(o._tag){default:return N;case\"Never\":return()=>\"never\";case\"Void\":return()=>\"void\";case\"Arrays\":{let s=o.elements.map(n),i=o.rest.map(n);return a=>{let c=[],u=0;for(;u0){let[f,...d]=i;for(;un(a.type)),i=o.indexSignatures.map(a=>n(a.type));return o.propertySignatures.length===0&&o.indexSignatures.length===0?N:a=>{let c=[],u=new Set;for(let f=0;f0?\"{ \"+c.join(\", \")+\" }\":\"{}\"}}case\"Union\":{let s=Jt(o).types,i=c=>cl(c,s),a=new Map(s.map((c,u)=>[c,[Ia(c),n(o.types[u])]]));return c=>{let u=i(c);for(let f=0;fn(o.thunk()));return i=>s()(i)}}}}function a6(e){return t=>t.annotate({toEquivalence:e})}function c6(e){return GP(e.ast)}function u6(e,t){return zI(e.ast,t)}function PD(e,t){let n=zI(ig(e.ast),t);return uF(n,t)}function FD(e){return j(ig(e.ast),{schema:e})}var ig=la(e=>{let t=l6(e,ig),n=e.context;return t===e||n===void 0?t:Vm(t,Tw(n))});function Tw(e){return e.constructorDefault===void 0?e:new Er(e.isOptional,e.isMutable,void 0,e.annotations)}function UD(e){if(e.propertySignatures.some(t=>typeof t.name!=\"string\"))throw new globalThis.Error(\"Objects property names must be strings\",{cause:e})}function DD(e){return t=>{let n=new Map;for(let s=0;s{s=nn(s),i=nn(i);let a=e(s),c=e(i);return a!==c?a-c:n.get(s)-n.get(i)});return r.some((s,i)=>s!==t[i])?r:t}}var f6=DD(e=>{switch(e._tag){case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function l6(e,t){switch(e._tag){case\"Declaration\":{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!un(n))return Ne(e,[SE]);let r=e.typeParameters.map(s=>Ll(nn(s))),o=n(r);return o===void 0?e:Ne(e,[Nc(o,t)])}case\"Unknown\":return Ne(e,[SE]);case\"ObjectKeyword\":return Ne(e,[i_]);case\"Undefined\":case\"Void\":case\"Literal\":case\"Number\":return e.toCodecJson();case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return UD(e),e.recur(t,Ym);case\"Union\":{let n=f6(e.types);return n!==e.types?new En(n,e.mode,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}function ND(e){return j(LD(Jt(e.ast)))}var LD=It(e=>{let t=d6(e,LD);return t!==e&&e.context!==void 0?Vm(t,Tw(e.context)):t});function d6(e,t){switch(e._tag){case\"Declaration\":{let n=e.annotations?.toCodecIso??e.annotations?.toCodec;if(un(n)){let r=n(e.typeParameters.map(o=>Ll(o)));return Ne(e,[Nc(r,t)])}return e}case\"Arrays\":case\"Objects\":case\"Union\":case\"Suspend\":return e.recur(t)}return e}function lu(e){return j(BD(e.ast),{schema:e})}function p6(e){return j(qD(e.ast))}function m6(e,t){let n=Ac(e.ast)??lS(e.ast),r=KF(lu(e));return o=>r(o).pipe($(s=>h6(s,{rootName:n,...t})))}function h6(e,t){let n=t.rootName??\"root\",r=t.arrayItemName??\"item\",o=t.pretty??!0,s=t.indent??\" \",i=t.sortKeys??!0,a=new Set,c=[];return f(n,e,0),c.join(o?`\n`:\"\");function u(d,p){c.push(o?s.repeat(d)+p:p)}function f(d,p,m,g){let{attrs:b,safe:I}=ru.tagInfo(d,g);if(p===void 0)u(m,`<${I}${b}/>`);else if(typeof p==\"string\")u(m,`<${I}${b}>${ru.escapeText(p)}`);else if(typeof p!=\"object\"||p===null)u(m,`<${I}${b}>${ru.escapeText(N(p))}`);else{if(a.has(p))throw new globalThis.Error(\"Cycle detected while serializing to XML.\",{cause:p});a.add(p);try{if(globalThis.globalThis.Array.isArray(p)){if(p.length===0){u(m,`<${I}${b}/>`);return}u(m,`<${I}${b}>`);for(let h of p)f(r,h,m+1);u(m,``);return}let w=p,E=Object.keys(w);if(i&&E.sort(),E.length===0){u(m,`<${I}${b}/>`);return}u(m,`<${I}${b}>`);for(let h of E)f(ru.parseTagName(h).safe,w[h],m+1,h);u(m,``)}finally{a.delete(p)}}}}var ru={escapeText(e){return e.replace(/&/g,\"&\").replace(//g,\">\")},escapeAttribute(e){return e.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(//g,\">\")},parseTagName(e){let t=e,n=e;return/^[A-Za-z_]/.test(n)||(n=\"_\"+n),n=n.replace(/[^A-Za-z0-9._-]/g,\"_\"),/^xml/i.test(n)&&(n=\"_\"+n),{safe:n,changed:n!==t}},tagInfo(e,t){let{changed:n,safe:r}=ru.parseTagName(e),s=n||t&&t!==e?` data-name=\"${ru.escapeAttribute(t??e)}\"`:\"\";return{safe:r,attrs:s}}},g6=DD(e=>{switch(e._tag){case\"Null\":case\"Boolean\":case\"Number\":case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function x6(e,t,n){switch(e._tag){case\"Declaration\":{let r=e.typeParameters.map(u=>j(t(nn(u)))),o=e.annotations?.toCodecStringTree;if(un(o)){let u=o(r);return u===void 0?e:Ne(e,[Nc(u,t)])}let s=e.annotations?.toCodecJson,i=un(s)?s(r):void 0,a=i===void 0?e.annotations?.toCodec:void 0,c=i??(un(a)?a(r):void 0);return c===void 0?n(e):Ne(e,[Nc(c,t)])}case\"Null\":return Ne(e,[y6]);case\"Boolean\":return Ne(e,[b6]);case\"Unknown\":case\"ObjectKeyword\":return Ne(e,[EE]);case\"Enum\":case\"Number\":case\"Literal\":case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return UD(e),e.recur(t,Ym);case\"Union\":{let r=g6(e.types);return r!==e.types?new En(r,e.mode,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}var y6=new Je(new Fn(\"null\"),new Te(ue(()=>null),ue(()=>\"null\"))),b6=new Je(new En([new Fn(\"true\"),new Fn(\"false\")],\"anyOf\"),new Te(ue(e=>e===\"true\"),sa())),$D=new Te(ue(e=>typeof e==\"string\"?[e]:e),Sn()),jD=e=>e.transformation===$D,BD=la(e=>{let t=x6(e,BD,n=>{throw new globalThis.Error(\"Missing structural codec for StringTree\",{cause:n})});return t!==e&&e.context!==void 0?Vm(t,Tw(e.context)):t},{stopAt:jD}),DF=e=>dt(e)?Lc(Kr):Kr,qD=la(e=>{let t=S6(e);if(tE(t)){let n=$c(new En([new Gr(t.isMutable,t.elements.map(DF),t.rest.map(DF)),Oo],\"anyOf\"),t,$D);return dt(e)?Lc(n):n}return t},{stopAt:jD});function S6(e){return e._tag===\"Declaration\"||e._tag===\"Arrays\"||e._tag===\"Objects\"||e._tag===\"Union\"||e._tag===\"Suspend\"?e.recur(qD):e}var E6=fe(\"effect/schema/isGreaterThanDate\",J({exclusiveMinimum:er}),({annotations:e,payload:t})=>PU(t.exclusiveMinimum,e)),I6=fe(\"effect/schema/isGreaterThanOrEqualToDate\",J({minimum:er}),({annotations:e,payload:t})=>FU(t.minimum,e)),w6=fe(\"effect/schema/isLessThanDate\",J({exclusiveMaximum:er}),({annotations:e,payload:t})=>UU(t.exclusiveMaximum,e)),T6=fe(\"effect/schema/isLessThanOrEqualToDate\",J({maximum:er}),({annotations:e,payload:t})=>DU(t.maximum,e)),v6=fe(\"effect/schema/isBetweenDate\",J({minimum:er,maximum:er,exclusiveMinimum:Ar(ze(!0)),exclusiveMaximum:Ar(ze(!0))}),({annotations:e,payload:t})=>NU(t,e)),A6=fe(\"effect/schema/isGreaterThanBigInt\",J({exclusiveMinimum:Fo}),({annotations:e,payload:t})=>LU(t.exclusiveMinimum,e)),C6=fe(\"effect/schema/isGreaterThanOrEqualToBigInt\",J({minimum:Fo}),({annotations:e,payload:t})=>$U(t.minimum,e)),O6=fe(\"effect/schema/isLessThanBigInt\",J({exclusiveMaximum:Fo}),({annotations:e,payload:t})=>jU(t.exclusiveMaximum,e)),k6=fe(\"effect/schema/isLessThanOrEqualToBigInt\",J({maximum:Fo}),({annotations:e,payload:t})=>BU(t.maximum,e)),R6=fe(\"effect/schema/isBetweenBigInt\",J({minimum:Fo,maximum:Fo,exclusiveMinimum:Ar(ze(!0)),exclusiveMaximum:Ar(ze(!0))}),({annotations:e,payload:t})=>qU(t,e));function _6(e){let t=ND(e);return xF(PI(t),_I(t))}function M6(e){return Vh()}function P6(e){return Vh()}function F6(e,t){return n=>j(Ir(n.ast,{toCodecIso:()=>new Je(e.ast,Mm(t))}),{schema:n})}function U6(e){let t=FD(e),n=PI(t),r=_I(t);return{empty:[],diff:(o,s)=>lF(n(o),n(s)),combine:(o,s)=>[...o,...s],patch:(o,s)=>{let i=n(o),a=dF(s,i);return Object.is(a,i)?o:r(a)}}}function D6(e){let t=rU(()=>n),n=st([e,Ye(t),Gl(X,t)]);return n}var ad=j(Ir(Dc,{toCode:()=>({runtime:\"Schema.Json\",Type:\"Schema.Json\"})})),N6=Gl(X,ad),L6=sn(\"effect/schema/Json\",ad),$6=J({message:X,name:Oa(X),stack:Oa(X),cause:Oa(ad)}),zD=j(Ir(s_,{toCode:()=>({runtime:\"Schema.MutableJson\",Type:\"Schema.MutableJson\"})})),j6=sn(\"effect/schema/MutableJson\",zD);function B6(e){return Co(e.ast)}function q6(e){return e.ast.context?.annotations}var An={};uo(An,{Array:()=>J8,Boolean:()=>y1,ConfigError:()=>xu,FalseValues:()=>x1,LogLevel:()=>S1,Port:()=>b1,Record:()=>H8,TrueValues:()=>g1,all:()=>l1,boolean:()=>nY,date:()=>cY,duration:()=>rY,fail:()=>K8,finite:()=>Q8,int:()=>X8,isConfig:()=>u1,literal:()=>eY,literals:()=>tY,logLevel:()=>sY,map:()=>f1,mapOrFail:()=>L8,nested:()=>uY,nonEmptyString:()=>Z8,number:()=>Y8,option:()=>q8,orElse:()=>$8,port:()=>oY,redacted:()=>iY,schema:()=>vn,string:()=>V8,succeed:()=>G8,unwrap:()=>p1,url:()=>aY,withDefault:()=>d1});var gu={};uo(gu,{ConfigProvider:()=>Fa,SourceError:()=>lg,constantCase:()=>x8,fromDir:()=>P8,fromDotEnv:()=>M8,fromDotEnvContents:()=>r1,fromEnv:()=>n1,fromEnvRecord:()=>Kw,fromUnknown:()=>E8,layer:()=>b8,layerAdd:()=>S8,make:()=>pg,makeArray:()=>Hw,makeRecord:()=>dg,makeValue:()=>md,mapInput:()=>Jw,nested:()=>y8,orElse:()=>Ww});var WD=\"~effect/platform/PlatformError\",du=class extends yo(\"BadArgument\"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:\"\"}`}};var HD=class extends yo(\"PlatformError\"){constructor(t){\"cause\"in t?super({reason:t,cause:t.cause}):super({reason:t})}[WD]=WD;get message(){return this.reason.message}};var W6=\"~effect/Stream\",H6={_R:_,_E:_,_A:_},J6={[W6]:H6,pipe(){return K(this,arguments)}},JD=e=>{let t=Object.create(J6);return t.channel=e,t};var G6=\"~effect/Sink\";var V6={_A:_,_In:_,_L:_,_E:_,_R:_},Z6={[G6]:V6,pipe(){return K(this,arguments)}};var Y6=e=>{let t=Object.create(Z6);return t.transform=e,t},KD=e=>Ce((t,n)=>x(T(e.transform(t,n),G)));var GD=e=>Y6(t=>{let n=[];if(e<=0)return x([n]);let r;return t.pipe(T(o=>{if(n.length+o.length<=e)return n.push(...o),n.length===e?G():te;for(let s=0;sx([n,r])))});var Do={};uo(Do,{DefaultChunkSize:()=>iN,Do:()=>FZ,TypeId:()=>sN,accumulate:()=>xZ,aggregate:()=>uZ,aggregateWithin:()=>Dw,bind:()=>DZ,bindEffect:()=>NZ,bindTo:()=>LZ,broadcast:()=>PN,broadcastN:()=>fZ,buffer:()=>bV,bufferArray:()=>SV,callback:()=>uN,catch:()=>dd,catchCause:()=>yN,catchCauseFilter:()=>CV,catchCauseIf:()=>AV,catchFilter:()=>EN,catchIf:()=>SN,catchReason:()=>TV,catchReasons:()=>vV,catchTag:()=>IV,catchTags:()=>wV,changes:()=>yZ,changesWith:()=>FN,changesWithEffect:()=>bZ,chunks:()=>ON,collect:()=>gZ,combine:()=>JV,combineArray:()=>KV,concat:()=>ud,cross:()=>Q5,crossWith:()=>gN,debounce:()=>XV,decodeText:()=>SZ,die:()=>d5,drain:()=>L5,drainFork:()=>$5,drop:()=>Uw,dropRight:()=>zV,dropUntil:()=>jV,dropUntilEffect:()=>BV,dropWhile:()=>AN,dropWhileEffect:()=>CN,dropWhileFilter:()=>qV,empty:()=>ai,encodeText:()=>EZ,ensuring:()=>kZ,fail:()=>cd,failCause:()=>fN,failCauseSync:()=>p5,failSync:()=>l5,filter:()=>lV,filterEffect:()=>pV,filterMap:()=>dV,filterMapEffect:()=>mV,flatMap:()=>hu,flatten:()=>Rw,flattenArray:()=>N5,flattenEffect:()=>_5,flattenIterable:()=>H5,flattenTake:()=>J5,forever:()=>W5,fromArray:()=>fd,fromArrayEffect:()=>x5,fromArrays:()=>y5,fromAsyncIterable:()=>E5,fromChannel:()=>O,fromEffect:()=>ag,fromEffectDrain:()=>aN,fromEffectRepeat:()=>cN,fromEffectSchedule:()=>a5,fromEventListener:()=>T5,fromIterable:()=>Ma,fromIterableEffect:()=>h5,fromIterableEffectRepeat:()=>g5,fromIteratorSucceed:()=>m5,fromPubSub:()=>b5,fromPubSubTake:()=>lN,fromPull:()=>ao,fromQueue:()=>mu,fromReadableStream:()=>S5,fromSchedule:()=>I5,fromSubscription:()=>w5,groupAdjacentBy:()=>aZ,groupBy:()=>sZ,groupByKey:()=>iZ,grouped:()=>rZ,groupedWithin:()=>oZ,haltWhen:()=>AZ,ignore:()=>_V,ignoreCause:()=>MV,interleave:()=>TZ,interleaveWith:()=>DN,interruptWhen:()=>vZ,intersperse:()=>UN,intersperseAffixes:()=>wZ,isStream:()=>Ie,iterate:()=>A5,let:()=>UZ,limitBytes:()=>DV,make:()=>u5,map:()=>nr,mapAccum:()=>GV,mapAccumArray:()=>Pa,mapAccumArrayEffect:()=>ZV,mapAccumEffect:()=>VV,mapArray:()=>pN,mapArrayEffect:()=>M5,mapBoth:()=>R5,mapEffect:()=>ld,mapError:()=>IN,merge:()=>_w,mergeAll:()=>Y5,mergeEffect:()=>cg,mergeLeft:()=>V5,mergeResult:()=>G5,mergeRight:()=>Z5,mkArrayBuffer:()=>VZ,mkString:()=>GZ,mkUint8Array:()=>ZZ,never:()=>O5,onEnd:()=>OZ,onError:()=>CZ,onExit:()=>NN,onFirst:()=>$N,onStart:()=>LN,orDie:()=>RV,orElseIfEmpty:()=>OV,orElseSucceed:()=>kV,paginate:()=>v5,partition:()=>gV,partitionEffect:()=>hV,partitionQueue:()=>Fw,peel:()=>yV,pipeThrough:()=>hZ,pipeThroughChannel:()=>pZ,pipeThroughChannelOrFail:()=>mZ,prepend:()=>K5,provide:()=>jN,provideContext:()=>RZ,provideService:()=>_Z,provideServiceEffect:()=>Nw,race:()=>fV,raceAll:()=>xN,range:()=>C5,rechunk:()=>kN,repeat:()=>j5,repeatElements:()=>z5,result:()=>P5,retry:()=>PV,run:()=>qN,runCollect:()=>zN,runCount:()=>$Z,runDrain:()=>fg,runFold:()=>BZ,runFoldEffect:()=>qZ,runForEach:()=>HZ,runForEachArray:()=>WN,runForEachWhile:()=>JZ,runHead:()=>zZ,runIntoPubSub:()=>t8,runIntoQueue:()=>o8,runLast:()=>WZ,runSum:()=>jZ,scan:()=>YV,scanEffect:()=>QV,schedule:()=>B5,scoped:()=>k5,service:()=>s5,serviceOption:()=>i5,share:()=>dZ,sliding:()=>WV,slidingSize:()=>RN,split:()=>HV,splitLines:()=>IZ,succeed:()=>pu,suspend:()=>tr,switchMap:()=>D5,sync:()=>f5,take:()=>UV,takeRight:()=>NV,takeUntil:()=>wN,takeUntilEffect:()=>TN,takeWhile:()=>vN,takeWhileEffect:()=>$V,takeWhileFilter:()=>LV,tap:()=>mN,tapBoth:()=>F5,tapCause:()=>EV,tapError:()=>bN,tapSink:()=>U5,throttle:()=>nZ,throttleEffect:()=>_N,tick:()=>c5,timeout:()=>q5,timeoutOrElse:()=>hN,toAsyncIterable:()=>e8,toAsyncIterableEffect:()=>XZ,toAsyncIterableWith:()=>$w,toChannel:()=>Or,toPubSub:()=>n8,toPubSubTake:()=>HN,toPull:()=>KZ,toQueue:()=>r8,toReadableStream:()=>YZ,toReadableStreamEffect:()=>QZ,toReadableStreamWith:()=>Lw,transduce:()=>cZ,transformPull:()=>St,transformPullBracket:()=>kw,unfold:()=>dN,unwrap:()=>ii,updateContext:()=>BN,updateService:()=>MZ,when:()=>xV,withExecutionPlan:()=>FV,withSpan:()=>PZ,zip:()=>eV,zipFlatten:()=>rV,zipLatest:()=>cV,zipLatestAll:()=>Pw,zipLatestWith:()=>uV,zipLeft:()=>tV,zipRight:()=>nV,zipWith:()=>Mw,zipWithArray:()=>ug,zipWithIndex:()=>oV,zipWithNext:()=>sV,zipWithPrevious:()=>iV,zipWithPreviousAndNext:()=>aV});var ZD=\"~effect/RcMap\",Q6=e=>({[ZD]:ZD,lookup:e.lookup,context:e.context,scope:e.scope,idleTimeToLive:e.idleTimeToLive,capacity:e.capacity,state:{_tag:\"Open\",map:ml()},pipe(){return K(this,arguments)}}),YD=e=>Gn(t=>{let n=t.context,r=Xe(n,xn),o=Q6({lookup:e.lookup,context:n,scope:r,idleTimeToLive:typeof e.idleTimeToLive==\"function\"?Td(e.idleTimeToLive,mt):Le(mt(e.idleTimeToLive??Ms)),capacity:Math.max(e.capacity??Number.POSITIVE_INFINITY,0)});return At(Eo(r,()=>{if(o.state._tag===\"Closed\")return te;let s=o.state.map;return o.state={_tag:\"Closed\"},qs(s,([,i])=>gr(Fe(i.scope,ut))).pipe(bn(()=>oe(()=>{Qm(s)})))}),o)}),vw=l(2,(e,t)=>Hs(n=>{if(e.state._tag===\"Closed\")return vo;let r=e.state,o=th(),s=Xs(r.map,t),i;if(s._tag===\"Some\")i=s.value,i.refCount++;else{if(Number.isFinite(e.capacity)&&u_(e.state.map)>=e.capacity)return P(new ub(`RcMap attempted to exceed capacity of ${e.capacity}`));{i={deferred:qi(),scope:mr(),idleTimeToLive:e.idleTimeToLive(t),finalizer:void 0,fiber:void 0,expiresAt:0,refCount:1},i.finalizer=X6(e,t,i),gl(r.map,t,i);let c=new Map(e.context.mapUnsafe);o.context.mapUnsafe.forEach((u,f)=>{c.set(f,u)}),c.set(xn.key,i.scope),e.lookup(t).pipe(Ao(ho(c)),da(i.scope)).addObserver(u=>pc(i.deferred,u))}}let a=Fr(o.context,xn);return Ht(a,i.finalizer).pipe(yn(n(zi(i.deferred))))}));var X6=(e,t,n)=>Gn(r=>{if(n.refCount--,n.refCount>0)return te;if(e.state._tag===\"Closed\"||!c_(e.state.map,t)||Gu(n.idleTimeToLive))return e.state._tag===\"Open\"&&xl(e.state.map,t),Fe(n.scope,ut);if(!tc(n.idleTimeToLive))return te;let o=r.getRef(_f);return n.expiresAt=o.currentTimeMillisUnsafe()+_n(n.idleTimeToLive),n.fiber?te:(n.fiber=sS(function s(i){let a=o.currentTimeMillisUnsafe(),c=n.expiresAt-a;return c<=0?e.state._tag===\"Closed\"||n.refCount>0?te:(xl(e.state.map,t),i(Fe(n.scope,ut))):T(o.sleep(go(c)),()=>s(i))}).pipe(ea(oe(()=>{n.fiber=void 0})),Ao(r.context),da(e.scope)),te)});var Aw=l(2,(e,t)=>ta(n=>{if(e.state._tag===\"Closed\")return te;let r=Xs(e.state.map,t);if(r._tag===\"None\"||Gu(r.value.idleTimeToLive))return te;let o=r.value;return o.expiresAt=n.currentTimeMillisUnsafe()+_n(o.idleTimeToLive),te}));var e5=\"~effect/RcRef\",Cw={_tag:\"Empty\"},t5={_tag:\"Closed\"},n5={_A:_,_E:_},Ow=class{[e5]=n5;pipe(){return K(this,arguments)}state=Cw;semaphore=Jc(1);acquire;context;scope;idleTimeToLive;constructor(t,n,r,o){this.acquire=t,this.context=n,this.scope=r,this.idleTimeToLive=o}},XD=e=>Gn(t=>{let n=t.context,r=Xe(n,xn),o=new Ow(e.acquire,n,r,e.idleTimeToLive?mt(e.idleTimeToLive):void 0);return At(Eo(r,()=>{let s=o.state._tag===\"Acquired\"?Fe(o.state.scope,ut):te;return o.state=t5,s}),o)}),r5=e=>Hs(function t(n){switch(e.state._tag){case\"Closed\":return vo;case\"Acquired\":return e.state.refCount++,e.state.fiber?At(ei(e.state.fiber),e.state):x(e.state);case\"Empty\":{let r=mr();return e.semaphore.withPermit(z(()=>e.state._tag!==\"Empty\"?t(n):n(xr(e.acquire,Pt(e.context,xn,r))).pipe($(o=>{let s={_tag:\"Acquired\",value:o,scope:r,fiber:void 0,refCount:1,invalidated:!1};return e.state=s,s}),yr(o=>os(o)?Fe(r,o):te))))}}}),eN=xe(function*(e){let t=e,n=yield*r5(t),r=yield*Qi,o=t.idleTimeToLive!==void 0&&tc(t.idleTimeToLive);return yield*Eo(r,()=>(n.refCount--,n.refCount>0?te:t.idleTimeToLive===void 0?(t.state=Cw,Fe(n.scope,ut)):n.invalidated?Fe(n.scope,ut):o?(n.fiber=Vi(t.idleTimeToLive).pipe(T(()=>t.state._tag===\"Acquired\"&&t.state.refCount===0?(t.state=Cw,Fe(n.scope,ut)):te),ea(oe(()=>{n.fiber=void 0})),Ao(t.context),da(t.scope)),te):te)),n.value});var tN=XD,nN=eN;var sN=\"~effect/Stream\",Ie=e=>M(e,sN),iN=Al,O=JD,ag=e=>O(Eh($(e,Ee))),s5=e=>ag(tS(e)),i5=e=>ag(nS(e)),aN=e=>ao(x(T(e,()=>G()))),cN=e=>ao(x($(e,Ee))),a5=(e,t)=>ao(en(function*(){let n=yield*qr(t),r=yield*To(e,Ft,Ft.defaultValue()),o=!0,s=z(()=>n(r)).pipe(T(i=>To(e,Ft,i)),$(i=>(r=i,Ee(i))));return z(()=>o?(o=!1,x(Ee(r))):s)})),c5=e=>ao(oe(()=>{let t=!0,n=x(Ee(void 0)),r=Vb(n,e);return z(()=>t?(t=!1,n):r)})),ao=e=>O(Nt(e)),St=(e,t)=>O(Ce((n,r)=>T(Mo(e.channel,r),o=>t(o,r)))),kw=(e,t)=>O(to((n,r,o)=>T(Mo(e.channel,r),s=>t(s,r,o)))),Or=e=>e.channel,uN=(e,t)=>O(D_(e,t)),ai=O(Kc),pu=e=>O(Sh(Ee(e))),u5=(...e)=>fd(e),f5=e=>O(L_(()=>Ee(e()))),tr=e=>O(bh(()=>e().channel)),cd=e=>O(_o(e)),l5=e=>O(j_(e)),fN=e=>O(Cl(e)),d5=e=>O(nI(e)),p5=e=>O(B_(e)),m5=(e,t)=>O(tI(()=>e,t)),Ma=(e,t)=>Array.isArray(e)&&t?.chunkSize===void 0?fd(e):O(N_(e,t?.chunkSize)),h5=e=>ii($(e,Ma)),g5=e=>hu(cN(e),Ma),fd=e=>Me(e)?O(Sh(e)):ai,x5=e=>ii($(e,fd)),y5=(...e)=>O(eI(cx(e,Me))),mu=e=>O(z_(e)),b5=e=>O(W_(e)),lN=e=>O(H_(e)),S5=e=>O(J_(e)),E5=(e,t)=>O(K_(e,t)),I5=e=>ao($(gc(e),t=>Ge($(t(void 0),Ee),()=>G()))),w5=e=>O(oI(e)),T5=(e,t,n)=>uN(r=>{function o(s){A_(r,s)}return Xi(oe(()=>e.addEventListener(t,o,n)),()=>oe(()=>e.removeEventListener(t,o,n)))},{bufferSize:typeof n==\"object\"?n.bufferSize:void 0}),dN=(e,t)=>ao(oe(()=>{let n=e;return T(z(()=>t(n)),r=>r===void 0?G():(n=r[1],x(Ee(r[0]))))})),v5=(e,t)=>ao(oe(()=>{let n=e,r=!1;return z(function o(){return r?G():T(t(n),([s,i])=>(ae(i)?r=!0:n=i.value,Me(s)?x(s):o()))})})),A5=(e,t)=>dN(e,n=>x([n,t(n)])),C5=(e,t,n=Al)=>e>t?ai:ao(oe(()=>{let r=Math.max(1,n),o=e,s=!1;return z(()=>{if(s)return G();let i=t-o+1;if(i>r){let c=rx(o,o+r-1);return o+=r,x(c)}let a=rx(o,o+i-1);return s=!0,x(a)})})),O5=O($_),ii=e=>O(xs($(e,Or))),k5=e=>O(IM(e.channel)),nr=l(2,(e,t)=>tr(()=>{let n=0;return O(no(e.channel,Pr(r=>t(r,n++))))})),R5=l(2,(e,t)=>e.pipe(nr(t.onSuccess),IN(t.onFailure))),pN=l(2,(e,t)=>O(no(e.channel,t))),ld=l(e=>Ie(e[0]),(e,t,n)=>e.channel.pipe(rn,Ih(t,n),no(Ee),O)),_5=l(e=>Ie(e[0]),(e,t)=>ld(e,_,t)),M5=l(2,(e,t)=>O(Ih(e.channel,t))),P5=e=>e.pipe(nr(se),dd(t=>pu(re(t)))),mN=l(e=>Ie(e[0]),(e,t,n)=>ld(e,r=>At(t(r),r),n)),F5=l(2,(e,t)=>e.pipe(bN(t.onError),mN(t.onElement,{concurrency:t.concurrency}))),U5=l(2,(e,t)=>kw(e,xe(function*(n,r,o){let s=Yn(),i=Yn(),a,c,u=!1,f=!1,d=s.whenOpen(z(()=>{if(a){let m=a;return a=void 0,f||s.closeUnsafe(),At(i.open,m)}return G()}));yield*z(()=>t.transform(d,o)).pipe(m=>oS(m,g=>(u=!0,os(g)&&(c=g.cause),i.open),!0),yt(o));let p=n.pipe(T(m=>(a=m,i.closeUnsafe(),s.openUnsafe(),At(i.await,m))),Ge(()=>(f=!0,i.closeUnsafe(),s.openUnsafe(),T(i.await,()=>G()))));return z(()=>c?tt(c):u?n:p)}))),hu=l(e=>Ie(e[0]),(e,t,n)=>e.channel.pipe(rn,Z_(r=>t(r).channel,n),O)),D5=l(e=>Ie(e[0]),(e,t,n)=>e.channel.pipe(rn,bM(r=>t(r).channel,n),O)),Rw=l(e=>Ie(e[0]),(e,t)=>hu(e,_,t)),N5=e=>O(rn(e.channel)),L5=e=>O(X_(e.channel)),$5=l(2,(e,t)=>cg(e,fg(t))),j5=l(2,(e,t)=>O(eM(e.channel,t))),B5=l(2,(e,t)=>e.channel.pipe(rn,tM(t),no(Ee),O)),q5=l(2,(e,t)=>hN(e,{duration:t,orElse:()=>ai})),hN=l(2,(e,t)=>{let n=mt(t.duration);if(!tc(n))return e;if(Gu(n))return tr(t.orElse);let r=Symbol();return yN(tr(()=>{let s=th().getRef(_f),i=_n(n),a,c=Yn(!1);return _w(St(e,(u,f)=>z(()=>(a=s.currentTimeMillisUnsafe()+i,c.openUnsafe(),u)).pipe($(d=>(c.closeUnsafe(),a=void 0,d)),x)),aN(en(function*(){for(;;)if(yield*c.await,!(a===void 0||(yield*Vi(a-s.currentTimeMillisUnsafe()),a===void 0)||a-s.currentTimeMillisUnsafe()>0))return yield*hr(r)})),{haltStrategy:\"left\"})}),o=>o.reasons.find(i=>i._tag===\"Die\"&&i.defect===r)?t.orElse():fN(o))}),z5=l(2,(e,t)=>O(Ce((n,r)=>$(me(rn(e.channel))(n,r),o=>{let s,i=en(function*(){let a=yield*o,c=Ee(a);return s=(yield*gc(t))(a).pipe(At(c),Ge(f=>(s=void 0,i))),c});return z(()=>s??i)})))),W5=e=>O(iI(e.channel)),H5=e=>hu(e,Ma),J5=e=>e.channel.pipe(rn,Q_,O),ud=l(2,(e,t)=>Rw(fd([e,t]))),K5=l(2,(e,t)=>ud(Ma(t),e)),_w=l(e=>Ie(e[0])&&Ie(e[1]),(e,t,n)=>O(Ah(Or(e),Or(t),n))),cg=l(2,(e,t)=>e.channel.pipe(SM(t),O)),G5=l(2,(e,t)=>_w(nr(e,se),nr(t,re))),V5=l(2,(e,t)=>cg(e,fg(t))),Z5=l(2,(e,t)=>cg(t,fg(e))),Y5=l(2,(e,t)=>Rw(Ma(e),t)),Q5=l(2,(e,t)=>gN(e,t,(n,r)=>[n,r])),gN=l(3,(e,t,n)=>hu(e,r=>nr(t,o=>n(r,o)))),Mw=l(3,(e,t,n)=>ug(e,t,X5(n))),X5=e=>(t,n)=>{let r=Math.min(t.length,n.length),o=[];for(let s=0;sO(to(xe(function*(r,o){let s=yield*Mo(e.channel,o),i=yield*Mo(t.channel,o),a=en(function*(){let f=yield*yt(s,o),d=yield*yt(i,o);return yield*h_([f,d])}),c={_tag:\"PullBoth\"};return en(function*(){let[f,d]=c._tag===\"PullBoth\"?yield*a:c._tag===\"PullLeft\"?[yield*s,c.rightArray]:[c.leftArray,yield*i],p=n(f,d);return Me(p[1])?c={_tag:\"PullRight\",leftArray:p[1]}:Me(p[2])?c={_tag:\"PullLeft\",rightArray:p[2]}:c={_tag:\"PullBoth\"},p[0]})})))),eV=l(2,(e,t)=>Mw(e,t,(n,r)=>[n,r])),tV=l(2,(e,t)=>ug(e,t,(n,r)=>{let o=Math.min(n.length,r.length),s=n.slice(0,o),i=n.slice(o),a=r.slice(o);return[s,i,a]})),nV=l(2,(e,t)=>ug(e,t,(n,r)=>{let o=Math.min(n.length,r.length),s=r.slice(0,o),i=n.slice(o),a=r.slice(o);return[s,i,a]})),rV=l(2,(e,t)=>Mw(e,t,(n,r)=>[...n,r])),oV=e=>nr(e,(t,n)=>[t,n]),sV=e=>Pa(e,R,(t,n)=>{let r=0;t._tag===\"None\"&&(r=1,t=k(n[0]));let o=gt();for(;rPa(e,R,(t,n)=>{let r=gt();for(let o=0;oPa(e,()=>({prev:R(),current:R()}),(t,n)=>{let r=0,o;t.current._tag===\"None\"?(r=1,o=n[0],t.current=k(o)):o=t.current.value;let s=gt();for(;rO(bh(()=>{let t=[],n=new Set,r=Yn();return vh(eI(e.map((o,s)=>o.channel.pipe(rn,Ih(i=>(t[s]=i,n.has(s)?x(Ee(t.slice())):(n.add(s),n.sizePw(e,t)),uV=l(3,(e,t,n)=>nr(Pw(e,t),([r,o])=>n(r,o))),xN=(...e)=>O(Ce((t,n)=>oe(()=>{let r,o=Zb(e.map(s=>{let i=vt(n);return Mo(s.channel,i).pipe(T(a=>Kb(x(a),a)),yr(a=>a._tag===\"Success\"?r?Fe(i,a):(r=a.value[0],te):Fe(i,a)),$(([,a])=>a))}));return z(()=>r??o)}))),fV=l(2,(e,t)=>xN(e,t)),lV=l(2,(e,t)=>O(rM(Or(e),t))),dV=l(2,(e,t)=>O(oM(Or(e),t))),pV=l(2,(e,t)=>O(sM(Or(e),t))),mV=l(2,(e,t)=>O(iM(Or(e),t))),Fw=l(e=>Ie(e[0]),xe(function*(e,t,n){let r=yield*Qi,o=yield*Mo(e.channel,r),s=n?.capacity===\"unbounded\"?void 0:n?.capacity??iN,i=yield*wr({capacity:s}),a=yield*wr({capacity:s});return yield*en(function*(){for(;;){let c=yield*o,u=[],f=[];for(let p=0;p0){let p=yh(i,f);p.length>0&&(d=yield*wc(ha(i,p)))}if(u.length>0){let p=yh(a,u);p.length>0&&(yield*ha(a,p))}d&&(yield*Bc(d))}}).pipe(Wr(c=>(ti(i,c),ti(a,c),te)),yt(r)),[i,a]})),hV=l(e=>Ie(e[0]),(e,t,n)=>$(Fw(ld(e,r=>t(r),n),r=>r,n),([r,o])=>[mu(r),mu(o)])),gV=l(e=>Ie(e[0]),(e,t,n)=>$(Fw(e,t,{capacity:n?.bufferSize??16}),([r,o])=>[mu(o),mu(r)])),xV=l(2,(e,t)=>t.pipe($(n=>n?e:ai),ii)),yV=l(2,xe(function*(e,t){let n,r=yield*pI(e.channel),o=ft(r,a=>(n=a,tt(a))),s=ao(x(o)),i=yield*qN(s,t);return n?[i,ai]:(s=ao(x(r)),[i,s])})),bV=l(2,(e,t)=>O(TM(e.channel,t))),SV=l(2,(e,t)=>O(wM(e.channel,t))),yN=l(2,(e,t)=>e.channel.pipe(Vc(n=>t(n).channel),O)),EV=l(2,(e,t)=>e.channel.pipe(Th(t),O)),dd=l(2,(e,t)=>O(Xr(e.channel,n=>t(n).channel)));var bN=l(2,(e,t)=>e.channel.pipe(uM(t),O)),SN=l(e=>Ie(e[0]),(e,t,n,r)=>O(fM(Or(e),t,o=>n(o).channel,r&&(o=>r(o).channel)))),EN=l(e=>Ie(e[0]),(e,t,n,r)=>O(lM(Or(e),t,o=>n(o).channel,r&&(o=>r(o).channel)))),IV=l(e=>Ie(e[0]),(e,t,n,r)=>{let o=Array.isArray(t)?s=>M(s,\"_tag\")&&t.includes(s._tag):$t(t);return SN(e,o,n,r)}),wV=l(e=>Ie(e[0]),(e,t,n)=>{let r;return EN(e,o=>(r??=Object.keys(t),M(o,\"_tag\")&&Xp(o._tag)&&r.includes(o._tag)?se(o):re(o)),o=>t[o._tag](o),n)}),TV=l(e=>Ie(e[0]),(e,t,n,r,o)=>O(dM(Or(e),t,n,(s,i)=>r(s,i).channel,o&&((s,i)=>o(s,i).channel)))),vV=l(e=>Ie(e[0]),(e,t,n,r)=>{let o=Object.create(null);for(let i of Object.keys(n)){let a=n[i];o[i]=(c,u)=>a(c,u).channel}let s=r&&((i,a)=>r(i,a).channel);return O(pM(e.channel,t,o,s))}),IN=l(2,(e,t)=>O(mM(e.channel,t))),AV=l(3,(e,t,n)=>O(cM(e.channel,t,r=>n(r).channel))),CV=l(3,(e,t,n)=>O(aI(e.channel,t,(r,o)=>n(r,o).channel))),OV=l(2,(e,t)=>O(Y_(e.channel,n=>Or(t())))),kV=l(2,(e,t)=>dd(e,n=>pu(t(n)))),RV=e=>O(hM(e.channel)),_V=l(e=>Ie(e[0]),(e,t)=>O(gM(e.channel,t))),MV=l(e=>Ie(e[0]),(e,t)=>O(xM(e.channel,t))),PV=l(2,(e,t)=>O(yM(e.channel,t))),oN=(e,t)=>ii($(qr(t),n=>{let r=Ft.defaultValue(),o=()=>dd(Nw(e,Ft,oe(()=>r)),s=>ii(Ge($(n(s),i=>(r=i,ii(At(qf,o())))),()=>x(cd(s)))));return o()})),FV=l(e=>Ie(e[0]),(e,t,n)=>tr(()=>{let r=n?.preventFallbackOnPartialStream??!1,o=0,s={attempt:0,stepIndex:0},i=Nw(Vp,oe(()=>(s={attempt:s.attempt+1,stepIndex:o},s))),a=n?.onEvent===void 0?void 0:Bb(n.onEvent,()=>s),c,u=a===void 0?_:p=>NN(LN(p,$(a.begin,m=>{c=m})),m=>z(()=>{if(c===void 0)return te;let g=c;return c=void 0,a.end(g,m)})),f=R(),d=tr(()=>{let p=t.steps[o];if(!p)return cd(ex(f));let m=i(u(jN(e,p.provide))),g=!1;if(_e(f)){let b=f.value,I=!1,w=m;m=tr(()=>I?w:(I=!0,cd(b))),m=oN(m,Bf(p,!1))}else{let b=Bf(p,!0);m=b?oN(m,b):m}return dd(r?$N(m,b=>(g=!0,te)):m,b=>(o++,r&&g?cd(b):(f=k(b),d)))});return d})),UV=l(2,(e,t)=>t<1?ai:wN(e,(n,r)=>r===t-1)),DV=l(3,(e,t,n)=>tr(()=>{let r=BigInt(t),o=BigInt(0),s=!1;return ud(vN(e,i=>{let a=o+BigInt(i.length);return a>r?(s=!0,!1):(o=a,!0)}),tr(()=>s?n():ai))})),NV=l(2,(e,t)=>Pa(e,hs,(n,r)=>(rh(n,r),n.length>t&&Il(n,n.length-t),[n,Ss]),{onHalt(n){return ma(n)}})),wN=l(e=>Ie(e[0]),(e,t,n)=>St(e,(r,o)=>oe(()=>{let s=0,i=!1;return T(z(()=>i?G():r),c=>{let u=c.findIndex(f=>t(f,s++));if(u>=0){i=!0;let f=c.slice(0,n?.excludeLast?u:u+1);return Me(f)?x(f):G()}return x(c)})}))),TN=l(e=>Ie(e[0]),(e,t,n)=>St(e,(r,o)=>oe(()=>{let s=0,i=!1;return en(function*(){if(i)return yield*G();let a=yield*r;for(let c=0;cSt(e,(n,r)=>oe(()=>{let o=0,s=!1,i=T(z(()=>s?G():n),a=>{let c=[];for(let u=0;uSt(e,(n,r)=>oe(()=>{let o=!1,s=T(z(()=>o?G():n),i=>{let a=[];for(let c=0;cTN(e,(n,r)=>$(t(n,r),o=>!o),{excludeLast:!0})),Uw=l(2,(e,t)=>St(e,(n,r)=>oe(()=>{let o=0,s=n.pipe(T(i=>o>=t?x(i):(o+=i.length,o<=t?s:x(i.slice(t-o)))));return s}))),jV=l(2,(e,t)=>Uw(AN(e,(n,r)=>!t(n,r)),1)),BV=l(2,(e,t)=>Uw(CN(e,(n,r)=>$(t(n,r),o=>!o)),1)),AN=l(2,(e,t)=>St(e,(n,r)=>oe(()=>{let o=!0,s=0,i=T(n,a=>{let c=a.findIndex(u=>!t(u,s++));return c===-1?i:(o=!1,x(a.slice(c)))});return z(()=>o?i:n)}))),qV=l(2,(e,t)=>St(e,(n,r)=>oe(()=>{let o=!0,s=T(n,i=>{let a=i.findIndex(c=>ie(t(c)));return a===-1?s:(o=!1,x(i.slice(a)))});return z(()=>o?s:n)}))),CN=l(2,(e,t)=>St(e,(n,r)=>oe(()=>{let o=!0,s=0,i=en(function*(){for(;;){let a=yield*n;for(let c=0;co?i:n)}))),zV=l(2,(e,t)=>t<=0?e:St(e,(n,r)=>oe(()=>{let o=hs(),s=T(n,i=>{oh(o,i);let a=o.length-t,c=pa(o,a);return qt(c)?x(c):s});return s}))),ON=e=>e.channel.pipe(no(Ee),O),kN=l(2,(e,t)=>(t=Math.max(1,t),St(e,(n,r)=>oe(()=>{let o=gt(),s=0,i,a=!1;return z(function c(){if(a)return G();if(i===void 0)return T(n,u=>o.length===0&&u.length===t?x(u):o.length+u.length{if(o.length===0)return G();let c=o;return a=!0,o=[],x(c)}))})))),WV=l(2,(e,t)=>RN(e,t,1)),RN=l(3,(e,t,n)=>St(e,(r,o)=>oe(()=>{let s=null,i=hs(),a=!1,c=0,u=Zi(r,{onSuccess(f){if(oh(i,f),c>0){let p=i.length;Il(i,c),c=Math.max(0,c-p)}if(i.length=t;)if(t===n)d.push(pa(i,t));else if(d.push(S_(i,t)),t===1&&n<=0)Yr(i);else{let p=i.length;Il(i,n),c=Math.max(0,n-p)}return x(d)},onFailure(f){return a&&Il(i,t-n),i.length===0?tt(f):(s=f,x(Ee(ma(i))))}});return z(()=>s?tt(s):u)}))),HV=l(2,(e,t)=>Pa(e,gt,(n,r)=>{let o=gt();for(let s=0;ssI(rn(e.channel),rn(t.channel),n,r).pipe(no(Ee),O)),KV=l(4,(e,t,n,r)=>O(sI(e.channel,t.channel,n,r))),GV=l(e=>Ie(e[0]),(e,t,n,r)=>O(Gc(e.channel,t,(o,s)=>{let i=gt();for(let a=0;aIe(e[0]),(e,t,n,r)=>O(Gc(e.channel,t,(o,s)=>{let[i,a]=n(o,s);return o=i,[o,Me(a)?Ee(a):Ss]},r?.onHalt?{onHalt(o){let s=r.onHalt(o);return Me(s)?Ee(s):Ss}}:void 0))),Ss=gt(),VV=l(e=>Ie(e[0]),(e,t,n,r)=>e.channel.pipe(rn,Gc(t,(o,s)=>$(n(o,s),([i,a])=>[i,Me(a)?Ee(a):gt()]),r?.onHalt?{onHalt(o){let s=r.onHalt(o);return Me(s)?Ee(s):Ss}}:void 0),O)),ZV=l(e=>Ie(e[0]),(e,t,n,r)=>e.channel.pipe(Gc(t,(o,s)=>$(n(o,s),([i,a])=>[i,Me(a)?Ee(a):Ss]),r?.onHalt?{onHalt(o){let s=r.onHalt(o);return Me(s)?Ee(s):Ss}}:void 0),O)),YV=l(3,(e,t,n)=>tr(()=>{let r=!0;return O(Gc(e.channel,Le(t),(o,s)=>{let i=gt();r&&(r=!1,i.push(o));for(let a=0;ae.channel.pipe(rn,aM(t,n),no(Ee),O)),XV=l(2,(e,t)=>St(e,xe(function*(n,r){let o=yield*_f,s=_n(mt(t)),i,a,c=1/0,u=Yn(),f=Yn(),d=Yn();yield*n.pipe(u.whenOpen,T(m=>(f.openUnsafe(),i=m,c=o.currentTimeMillisUnsafe()+s,te)),Ct({disableYield:!0}),Wr(m=>(a=m,c=o.currentTimeMillisUnsafe(),f.openUnsafe(),d.openUnsafe(),te)),yt(r));let p=z(function m(){let g=o.currentTimeMillisUnsafe(),b=c{if(o.currentTimeMillisUnsafe(){if(a){if(i){let m=x(Ee(Vd(i)));return i=void 0,m}return tt(a)}return u.openUnsafe(),f.whenOpen(p)})}))),_N=l(2,(e,t)=>{let n=t.burst??0;return t.strategy===\"enforce\"?eZ(e,t.cost,t.units,t.duration,n):tZ(e,t.cost,t.units,t.duration,n)}),eZ=(e,t,n,r,o)=>St(e,s=>ta(i=>{let a=_n(mt(r)),c=n+o<0?Number.POSITIVE_INFINITY:n+o,u=n,f=i.currentTimeMillisUnsafe();return x(T(s,function d(p){return T(t(p),m=>{let g=i.currentTimeMillisUnsafe(),I=(g-f)/a,w=u+I*n,E=w<0?c:Math.min(w,c);return m<=E?(u=E-m,f=g,x(p)):T(s,d)})}))})),tZ=(e,t,n,r,o)=>St(e,s=>ta(i=>{let a=_n(mt(r)),c=n+o<0?Number.POSITIVE_INFINITY:n+o,u=n,f=i.currentTimeMillisUnsafe();return x(T(s,d=>T(t(d),p=>{let m=i.currentTimeMillisUnsafe(),b=(m-f)/a,I=u+b*n,E=(I<0?c:Math.min(I,c))-p;if(E>=0)return u=E,f=m,x(d);let h=-E/n,A=Math.max(0,h*a);return A>0?T(Vi(A),()=>(u=E,f=m,x(d))):(u=E,f=m,x(d))})))})),nZ=l(2,(e,t)=>_N(e,{...t,cost:n=>x(t.cost(n))})),rZ=l(2,(e,t)=>ON(kN(e,t))),oZ=l(3,(e,t,n)=>Dw(e,GD(t),Lb(n))),sZ=l(e=>Ie(e[0]),(e,t,n)=>MN(e,xe(function*(r,o,s){for(let i=0;iIe(e[0]),(e,t,n)=>tr(()=>{let r=ml();return MN(e,xe(function*(o,s,i){for(let a=0;akw(e,xe(function*(r,o,s){let i=yield*v_();yield*Ht(o,Qr(i));let a=ml(),c=yield*YD({lookup:u=>Xi(wr({capacity:n?.bufferSize??4096}).pipe(bn(f=>(gl(a,u,f),Qn(i,[u,mu(f)])))),f=>(xl(a,u),C_(f))),idleTimeToLive:n?.idleTimeToLive??Ur}).pipe(ss(s));return yield*zr({while:cn,body:Le(T(r,u=>t(u,c,a))),step:_r}).pipe(ft(u=>Dt(i,u)),yt(o)),Hc(i)})),aZ=l(2,(e,t)=>St(e,(n,r)=>oe(()=>{let o,s,i=gt(),a=n.pipe(T(u=>{for(let f=0;fc?G():a),()=>{c=!0;let u=s;return s=void 0,u&&qt(u)?x(Ee([o,u])):G()})}))),cZ=l(2,(e,t)=>St(e,(n,r)=>oe(()=>{let o,s,i=z(()=>{if(s!==void 0){let c=s;return s=void 0,x(c)}return n}).pipe(Ws(c=>(o=rs(c),G()))),a=$(z(()=>t.transform(i,r)),([c,u])=>(s=u,Ee(c)));return z(()=>o||a)}))),uZ=l(2,(e,t)=>Dw(e,t,Nf)),Dw=l(3,(e,t,n)=>O(to(xe(function*(r,o,s){let i=yield*Mo(e.channel,o),a=Yn(!1),c=Symbol(),u=yield*wr({capacity:0});yield*i.pipe(a.whenOpen,T(h=>(a.closeUnsafe(),Qn(u,h))),Ct,ft(h=>Dt(u,h)),yt(s));let f=R(),d,p=!1,m=yield*gc(n),b=z(function h(){return T(m(f),()=>p?Qn(u,c):h())}).pipe(T(()=>Gi),Ge(()=>G())),I=gs(u).pipe(T(h=>h===c?G():(p=!0,x(h)))),w=z(()=>{if(d!==void 0){let h=d;return d=void 0,p=!0,x(h)}return a.openUnsafe(),I}),E=T(([h,A])=>!p&&u.state._tag===\"Done\"?G():(f=k(h),d=A,x(Ee(h))));return z(()=>u.state._tag===\"Done\"&&d===void 0?u.state.exit:(p=d!==void 0,x(z(()=>t.transform(w,s))))).pipe(T(h=>Ec(E(h),b)))})))),fZ=l(2,xe(function*(e,t){let n=yield*lZ(t),r=new Array(t.n),o=yield*xn;for(let s=0;sFe(i,c)),O)}return yield*xa(e.channel,s=>zc(n,s)).pipe(yr(s=>zc(n,s)),Tc),r})),lZ=e=>Xi(e.capacity===\"unbounded\"?dh(e):e.strategy===\"dropping\"?fh(e):e.strategy===\"sliding\"?lh(e):uh(e),wl),PN=l(2,(e,t)=>$(HN(e,t),lN)),dZ=l(2,(e,t)=>$(tN({acquire:PN(e,t),idleTimeToLive:t.idleTimeToLive}),n=>ii(nN(n)))),pZ=l(2,(e,t)=>O(cI(e.channel,t))),mZ=l(2,(e,t)=>O(uI(e.channel,t))),hZ=l(2,(e,t)=>e.channel.pipe(uI(KD(t)),wh(([n,r])=>r?Sh(r):Kc),O)),gZ=e=>ag(zN(e)),xZ=e=>Pa(e,gt,(t,n)=>{let r=sx(t,n);return[r,[r]]}),yZ=e=>FN(e,B),FN=l(2,(e,t)=>St(e,(n,r)=>oe(()=>{let o=!0,s;return T(n,function i(a){let c=[],u=0;for(o&&(o=!1,s=a[0],u=1,c.push(s));uSt(e,(n,r)=>oe(()=>{let o=!0,s;return T(n,xe(function*i(a){let c=[],u=0;for(o&&(o=!1,s=a[0],u=1,c.push(s));uIe(e[0]),(e,t)=>tr(()=>{let n=new TextDecoder(t?.encoding);return nr(e,r=>n.decode(r,{stream:!0}))})),EZ=e=>tr(()=>{let t=new TextEncoder;return nr(e,n=>t.encode(n))}),IZ=e=>e.channel.pipe(cI(EM()),O),UN=l(2,(e,t)=>pN(e,(n,r)=>{let o=r===0?[]:[t],s=n.length-1;for(let i=0;ipu(t.start).pipe(ud(UN(e,t.middle)),ud(pu(t.end)))),TZ=l(2,(e,t)=>DN(e,t,Ma(nT([!0,!1])))),DN=l(3,(e,t,n)=>O(Ce(xe(function*(r,o){let s=yield*me(rn(n.channel))(r,o),i=Symbol(),a=!1,c=!1,u=(yield*me(rn(e.channel))(r,o)).pipe(Ge(()=>(a=!0,x(i)))),f=(yield*me(rn(t.channel))(r,o)).pipe(Ge(()=>(c=!0,x(i))));return en(function*(){for(;;){if(a&&c)return yield*G();let d=yield*s;if(d&&a||!d&&c)continue;let p=yield*d?u:f;if(p!==i)return Ee(p)}})})))),vZ=l(2,(e,t)=>O(vM(e.channel,t))),AZ=l(2,(e,t)=>O(AM(e.channel,t))),NN=l(2,(e,t)=>O(Ol(e.channel,t))),CZ=l(2,(e,t)=>O(CM(e.channel,t))),LN=l(2,(e,t)=>O(OM(e.channel,t))),$N=l(2,(e,t)=>O(fI(e.channel,n=>t(n[0])))),OZ=l(2,(e,t)=>O(kM(e.channel,t))),kZ=l(2,(e,t)=>O(RM(e.channel,t))),jN=l(e=>Ie(e[0]),(e,t,n)=>O(_M(e.channel,t,n))),RZ=l(2,(e,t)=>O(Ch(e.channel,t))),_Z=l(3,(e,t,n)=>O(Oh(e.channel,t,n))),Nw=l(3,(e,t,n)=>O(kh(e.channel,t,n))),BN=l(2,(e,t)=>O(MM(e.channel,t))),MZ=l(3,(e,t,n)=>BN(e,r=>Pt(r,t,n(Xe(r,t))))),PZ=function(){let e=Ie(arguments[0]),t=e?arguments[1]:arguments[0],n=Fs(e?arguments[2]:arguments[1]);if(e){let r=arguments[0];return O(lI(r.channel,t,n))}return r=>O(lI(r.channel,t,n))},FZ=pu({}),UZ=l(3,(e,t,n)=>nr(e,r=>({...r,[t]:n(r)})));var DZ=l(e=>Ie(e[0]),(e,t,n,r)=>hu(e,o=>nr(n(o),s=>({...o,[t]:s})),r)),NZ=l(e=>Ie(e[0]),(e,t,n,r)=>ld(e,o=>$(n(o),s=>({...o,[t]:s})),r)),LZ=l(2,(e,t)=>nr(e,n=>({[t]:n}))),qN=l(2,(e,t)=>rS(n=>Mo(e.channel,n).pipe(T(r=>t.transform(r,n)),$(([r])=>r)))),zN=e=>ya(e.channel,()=>[],(t,n)=>{for(let r=0;rya(e.channel,()=>0,(t,n)=>t+n.length),jZ=e=>ya(e.channel,()=>0,(t,n)=>{for(let r=0;rya(e.channel,t,(r,o)=>{for(let s=0;sNM(e.channel,t,(r,o)=>{let s=0,i=r;return $(zr({while:()=>sn(i,o[s]),step(a){i=a,s++}}),()=>i)})),zZ=e=>$(UM(e.channel),Bt(cT(0))),WZ=e=>$(DM(e.channel),Bt(Vd)),HZ=l(2,(e,t)=>xa(e.channel,n=>{let r=0;return zr({while:()=>rt(n[r++]),step:_r})})),JZ=l(2,(e,t)=>FM(e.channel,n=>{let r=!1,o=0;return $(zr({while:()=>!r&&ot(n[o]),step(s){o++,s||(r=!0)}}),()=>!r)})),WN=l(2,(e,t)=>xa(e.channel,t)),fg=e=>PM(e.channel),KZ=e=>pI(e.channel),GZ=e=>ya(e.channel,()=>\"\",(t,n)=>t+n.join(\"\")),VZ=e=>$(dI(e.channel),t=>t.buffer),ZZ=e=>dI(e.channel),Lw=l(e=>Ie(e[0]),(e,t,n)=>{let r,o,s=Yn(!1);return new ReadableStream({start(i){o=Hf(xr(WN(e,a=>s.whenOpen(oe(()=>{s.closeUnsafe();for(let c=0;c{a._tag===\"Failure\"?i.error(Wp(a.cause)):i.close()})},pull(){return new Promise(i=>{r=i,s.openUnsafe()})},cancel(){if(o)return aS(zs(ei(o)))}},n?.strategy)}),YZ=l(e=>Ie(e[0]),(e,t)=>Lw(e,pn(),t)),QZ=l(e=>Ie(e[0]),(e,t)=>$(Yi(),n=>Lw(e,n,t))),$w=l(2,(e,t)=>({[Symbol.asyncIterator](){let n=cS(t),r=Ao(t),o=mr(),s,i,a,c,u=d=>{if(c)return c;let p=a;return c=n(At(yn(p?ei(p):te,Fe(o,d)),{done:!0,value:void 0})),c},f=async d=>{try{await u(d)}catch(p){await n(uS(\"Suppressed error while closing Stream async iterator\",p))}};return{async next(){if(c)return c;if(i){let m=i.next();if(!m.done)return m;i=void 0}let d=r(s??T(Mo(e.channel,o),m=>(s=m,m)));a=d;let p=await n(m_(d));if(a===d&&(a=void 0),et(p))return i=p.value[Symbol.iterator](),i.next();if(is(p.cause))return u(ut);if(c&&ob(p.cause))return c;throw await f(p),Wp(p.cause)},return(){return u(ut)},async throw(d){throw await f(fb(d)),d}}}})),XZ=e=>$(Yi(),t=>$w(e,t)),e8=e=>$w(e,pn()),t8=l(e=>Ie(e[0]),(e,t,n)=>hI(e.channel,t,n)),n8=l(2,(e,t)=>jM(e.channel,t)),HN=l(2,(e,t)=>BM(e.channel,t)),r8=l(2,(e,t)=>LM(e.channel,t)),o8=l(2,(e,t)=>mI(e.channel,t));var pd=BigInt(1024),Pne=pd*pd*pd*pd*pd;var jw=Vt(\"effect/platform/FileSystem\");var KN=\"~effect/platform/Path\",qw=Vt(\"effect/Path\");function GN(e,t){let n=\"\",r=0,o=-1,s=0,i;for(let a=0;a<=e.length;++a){if(a2){let c=n.lastIndexOf(\"/\");if(c!==n.length-1){c===-1?(n=\"\",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(\"/\")),o=a,s=0;continue}}else if(n.length===2||n.length===1){n=\"\",r=0,o=a,s=0;continue}}t&&(n.length>0?n+=\"/..\":n=\"..\",r=2)}else n.length>0?n+=\"/\"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,s=0}else i===46&&s!==-1?++s:s=-1}return n}function s8(e,t){let n=t.dir||t.root,r=t.base||(t.name||\"\")+(t.ext||\"\");return n?n===t.root?n+r:n+e+r:r}function i8(e){if(e.protocol!==\"file:\")return P(new du({module:\"Path\",method:\"fromFileUrl\",description:\"URL must be of scheme file\"}));if(e.hostname!==\"\")return P(new du({module:\"Path\",method:\"fromFileUrl\",description:\"Invalid file URL host\"}));let t=e.pathname;for(let n=0;n=-1&&!n;o--){let s;if(o>=0)s=arguments[o];else{let i=globalThis.process;r===void 0&&\"process\"in globalThis&&typeof i==\"object\"&&i!==null&&typeof i.cwd==\"function\"&&(r=i.cwd()),s=r}s.length!==0&&(t=s+\"/\"+t,n=s.charCodeAt(0)===47)}return t=GN(t,!n),n?t.length>0?\"/\"+t:\"/\":t.length>0?t:\".\"},a8=47;function c8(e){let t=new URL(\"file://\"),n=VN(e);return e.charCodeAt(e.length-1)===a8&&n[n.length-1]!==\"/\"&&(n+=\"/\"),t.pathname=m8(n),x(t)}var u8=/%/g,f8=/\\\\/g,l8=/\\n/g,d8=/\\r/g,p8=/\\t/g;function m8(e){return e.includes(\"%\")&&(e=e.replace(u8,\"%25\")),e.includes(\"\\\\\")&&(e=e.replace(f8,\"%5C\")),e.includes(`\n`)&&(e=e.replace(l8,\"%0A\")),e.includes(\"\\r\")&&(e=e.replace(d8,\"%0D\")),e.includes(\"\t\")&&(e=e.replace(p8,\"%09\")),e}var Bw=qw.of({[KN]:KN,resolve:VN,normalize(e){if(e.length===0)return\".\";let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=GN(e,!t),e.length===0&&!t&&(e=\".\"),e.length>0&&n&&(e+=\"/\"),t?\"/\"+e:e},isAbsolute(e){return e.length>0&&e.charCodeAt(0)===47},join(){if(arguments.length===0)return\".\";let e;for(let t=0;t0&&(e===void 0?e=n:e+=\"/\"+n)}return e===void 0?\".\":Bw.normalize(e)},relative(e,t){if(e===t||(e=Bw.resolve(e),t=Bw.resolve(t),e===t))return\"\";let n=1;for(;nc){if(t.charCodeAt(s+f)===47)return t.slice(s+f+1);if(f===0)return t.slice(s+f)}else o>c&&(e.charCodeAt(n+f)===47?u=f:f===0&&(u=0));break}let p=e.charCodeAt(n+f),m=t.charCodeAt(s+f);if(p!==m)break;p===47&&(u=f)}let d=\"\";for(f=n+u+1;f<=r;++f)(f===r||e.charCodeAt(f)===47)&&(d.length===0?d+=\"..\":d+=\"/..\");return d.length>0?d+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},dirname(e){if(e.length===0)return\".\";let t=e.charCodeAt(0),n=t===47,r=-1,o=!0;for(let s=e.length-1;s>=1;--s)if(t=e.charCodeAt(s),t===47){if(!o){r=s;break}}else o=!1;return r===-1?n?\"/\":\".\":n&&r===1?\"//\":e.slice(0,r)},basename(e,t){let n=0,r=-1,o=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return\"\";let i=t.length-1,a=-1;for(s=e.length-1;s>=0;--s){let c=e.charCodeAt(s);if(c===47){if(!o){n=s+1;break}}else a===-1&&(o=!1,a=s+1),i>=0&&(c===t.charCodeAt(i)?--i===-1&&(r=s):(i=-1,r=a))}return n===r?r=a:r===-1&&(r=e.length),e.slice(n,r)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){n=s+1;break}}else r===-1&&(o=!1,r=s+1);return r===-1?\"\":e.slice(n,r)}},extname(e){let t=-1,n=0,r=-1,o=!0,s=0;for(let i=e.length-1;i>=0;--i){let a=e.charCodeAt(i);if(a===47){if(!o){n=i+1;break}continue}r===-1&&(o=!1,r=i+1),a===46?t===-1?t=i:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||r===-1||s===0||s===1&&t===r-1&&t===n+1?\"\":e.slice(t,r)},format:function(t){if(t===null||typeof t!=\"object\")throw new TypeError('The \"pathObject\" argument must be of type Object. Received type '+typeof t);return s8(\"/\",t)},parse(e){let t={root:\"\",dir:\"\",base:\"\",ext:\"\",name:\"\"};if(e.length===0)return t;let n=e.charCodeAt(0),r=n===47,o;r?(t.root=\"/\",o=1):o=0;let s=-1,i=0,a=-1,c=!0,u=e.length-1,f=0;for(;u>=o;--u){if(n=e.charCodeAt(u),n===47){if(!c){i=u+1;break}continue}a===-1&&(c=!1,a=u+1),n===46?s===-1?s=u:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||a===-1||f===0||f===1&&s===a-1&&s===i+1?a!==-1&&(i===0&&r?t.base=t.name=e.slice(1,a):t.base=t.name=e.slice(i,a)):(i===0&&r?(t.name=e.slice(1,s),t.base=e.slice(1,a)):(t.name=e.slice(i,s),t.base=e.slice(i,a)),t.ext=e.slice(s,a)),i>0?t.dir=e.slice(0,i-1):r&&(t.dir=\"/\"),t},sep:\"/\",fromFileUrl:i8,toFileUrl:c8,toNamespacedPath:_});function md(e){return{_tag:\"Value\",value:e}}function dg(e,t){return{_tag:\"Record\",keys:e,value:t}}function Hw(e,t){return{_tag:\"Array\",length:e,value:t}}var lg=class extends yo(\"SourceError\"){},Fa=Ae(\"effect/ConfigProvider\",{defaultValue:()=>n1()}),h8={...ln,toJSON(){return{_id:\"ConfigProvider\"}}},g8=e=>e;function YN(e,t){let n=Object.create(h8);return n.load=e,n.mapInput=t,n}function QN(e,t){return YN(n=>e(t(n)),n=>QN(e,Td(t,n)))}function XN(e,t){return YN(n=>T(e.load(n),r=>r!==void 0?x(r):t.load(n)),n=>XN(e.mapInput(n),t.mapInput(n)))}function pg(e){return QN(e,g8)}var Ww=l(2,(e,t)=>XN(e,t)),Jw=l(2,(e,t)=>e.mapInput(t)),x8=Jw(e=>e.map(t=>typeof t==\"number\"?t:FO(t))),y8=l(2,(e,t)=>{let n=typeof t==\"string\"?[t]:t;return Jw(e,r=>[...n,...r])}),b8=e=>wo(e)?gb(Fa)(e):iO(Fa)(e),S8=(e,t)=>gb(Fa)(en(function*(){let n=yield*Fa,r=wo(e)?yield*e:e;return t?.asPrimary?Ww(r,n):Ww(n,r)}));function E8(e,t){let n=t?.preserveEmptyStrings===!0;return pg(r=>x(I8(e,r,n)))}function I8(e,t,n){let r=e;for(let o of t){if(r==null)return;if(Array.isArray(r)){if(typeof o!=\"number\"||!Number.isInteger(o)||o<0||o>=r.length)return;r=r[o];continue}if(wt(r)){if(typeof o!=\"string\"||!Object.hasOwn(r,o))return;r=r[o];continue}return}return w8(r,n)}function w8(e,t){if(e!=null)return typeof e==\"string\"?e1(e,t):typeof e==\"number\"||typeof e==\"boolean\"||typeof e==\"bigint\"?md(String(e)):Array.isArray(e)?Hw(e.length):wt(e)?dg(new Set(Object.keys(e))):md(N(e))}function e1(e,t){let n=t1(e,t);return n===void 0?void 0:md(n)}function t1(e,t){return e===\"\"&&!t?void 0:e}function Kw(e,t){let n=t?.preserveEmptyStrings===!0,r=T8(e);return pg(o=>x(A8(r,e,o,n)))}function n1(e){let t=e?.env??{...globalThis.process?.env,...import.meta?.env};return Kw(t,{preserveEmptyStrings:e?.preserveEmptyStrings})}function T8(e){let t={};for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let o=n.split(\"_\"),s=t;for(let i of o){let a=s.children??=Object.create(null);s=a[i]??={}}}return t}var v8=/^(0|[1-9][0-9]*)$/;function A8(e,t,n,r){let o=n.map(String).join(\"_\"),s=t1(Object.hasOwn(t,o)?t[o]:void 0,r),i=C8(e,n),a=i?.children?Object.keys(i.children):[];if(a.length===0)return s===void 0?void 0:md(s);if(a.every(u=>v8.test(u))){let u=Math.max(...a.map(f=>parseInt(f,10)))+1;return Hw(u,s)}return dg(new Set(a),s)}function C8(e,t){if(t.length===0)return e;let n=e;for(let r of t)if(n=n?.children?.[String(r)],!n)return;return n}function r1(e,t){let n=k8(e);return t?.expandVariables&&(n=R8(n)),Kw(n,{preserveEmptyStrings:t?.preserveEmptyStrings})}var O8=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg;function k8(e){let t=Object.create(null);e=e.replace(/\\r\\n?/gm,`\n`);let n;for(;(n=O8.exec(e))!=null;){let r=n[1],o=n[2]||\"\";o=o.trim();let s=o[0];o=o.replace(/^(['\"`])([\\s\\S]*)\\1$/gm,\"$2\"),s==='\"'&&(o=o.replace(/\\\\n/g,`\n`),o=o.replace(/\\\\r/g,\"\\r\")),t[r]=o}return t}function R8(e){let t=Object.create(null);for(let n of Object.keys(e))t[n]=o1(e[n],e).replace(/\\\\\\$/g,\"$\");return t}function o1(e,t){let n=_8(e,/(?!(?<=\\\\))\\$/g);if(n===-1)return e;let r=e.slice(n),o=/((?!(?<=\\\\))\\${?([\\w]+)(?::-([^}\\\\]*))?}?)/,s=r.match(o);if(s!==null){let[i,a,c,u]=s,f=Object.hasOwn(t,c)&&t[c]!==\"\"?t[c]:u??\"\";return o1(e.replace(a,f),t)}return e}function _8(e,t){let n=Array.from(e.matchAll(t));return n.length>0?n.slice(-1)[0].index:-1}var M8=xe(function*(e){let n=yield*(yield*jw).readFileString(e?.path??\".env\");return r1(n,e)}),P8=xe(function*(e){let t=yield*qw,n=yield*jw,r=e?.rootPath??\"/\",o=e?.preserveEmptyStrings===!0;return pg(s=>{let i=t.join(r,...s.map(String)),a=n.readFileString(i).pipe($(u=>e1(u.trim(),o))),c=n.readDirectory(i).pipe($(u=>dg(new Set(u.map(f=>t.basename(f))))));return a.pipe(Ws(u=>c.pipe(Ws(f=>zw(u)&&zw(f)?x(void 0):P(zw(u)?f:u)))),fm(u=>new lg({message:`Failed to read file at ${t.join(r,...s.map(String))}`,cause:u})))})}),zw=e=>e.reason._tag===\"NotFound\";var s1=[\"All\",\"Fatal\",\"Error\",\"Warn\",\"Info\",\"Debug\",\"Trace\",\"None\"];var Gw=\"~effect/Config\",u1=e=>M(e,Gw),xu=class{_tag=\"ConfigError\";name=\"ConfigError\";cause;constructor(t){this.cause=t}get message(){return this.cause.toString()}toString(){return`ConfigError(${this.message})`}},F8={...Xd({label:\"Config\",evaluate(e){return this.parse(e.getRef(Fa))}}),[Gw]:Gw,toJSON(){return{_id:\"Config\"}}};function No(e){let t=Object.create(F8);return t.evaluator=e,t.parse=n=>e(n,[]).pipe(fs(r=>r.error),lt(r=>r._tag===\"Resolved\"?x(r.value):P(r.error))),t}var Es=(e,t,n)=>e.evaluator(t,n),ci=(e,t)=>({_tag:\"Resolved\",value:e,hasInput:t}),U8=e=>({_tag:\"Absent\",error:e}),Lo=(e,t)=>({error:e,hasInput:t}),D8=e=>$t(e,\"SourceError\"),a1=(e,t)=>e.pipe(zf(n=>D8(n)?P(Lo(new xu(n),t)):hr(n))),N8=(e,t)=>t?e.pipe(fs(n=>Lo(n.error,!0)),lt(n=>n._tag===\"Resolved\"?x(ci(n.value,!0)):P(Lo(n.error,!0)))):e,f1=l(2,(e,t)=>No((n,r)=>$(Es(e,n,r),o=>o._tag===\"Resolved\"?ci(t(o.value),o.hasInput):o))),L8=l(2,(e,t)=>No((n,r)=>T(Es(e,n,r),o=>o._tag===\"Resolved\"?t(o.value).pipe(br(s=>ci(s,o.hasInput)),fs(s=>Lo(s,o.hasInput))):x(o)))),$8=l(2,(e,t)=>No((n,r)=>eS(Es(e,n,r),{onFailure:o=>N8(Es(t(o.error),n,r),o.hasInput),onSuccess:o=>o._tag===\"Absent\"?Es(t(o.error),n,r):x(o)})));function l1(e){let t=Array.isArray(e)?e:Symbol.iterator in e?[...e]:e;return Array.isArray(t)?No((n,r)=>lt(om(t.map(o=>cm(Es(o,n,r)))),j8)):No((n,r)=>lt(om(Wu(t,o=>cm(Es(o,n,r)))),B8))}var j8=e=>{let t=[],n,r,o=!1;for(let s of e){if(ie(s)){n??=s.failure,o=o||s.failure.hasInput;continue}let i=s.success;i._tag===\"Absent\"?r??=i:(t.push(i.value),o=o||i.hasInput)}return n!==void 0?P(Lo(n.error,o)):r!==void 0?o?P(Lo(r.error,!0)):x(r):x(ci(t,o))},B8=e=>{let t={},n,r,o=!1;for(let s in e){let i=e[s];if(ie(i)){n??=i.failure,o=o||i.failure.hasInput;continue}let a=i.success;a._tag===\"Absent\"?r??=a:(F(t,s,a.value),o=o||a.hasInput)}return n!==void 0?P(Lo(n.error,o)):r!==void 0?o?P(Lo(r.error,!0)):x(r):x(ci(t,o))},d1=l(2,(e,t)=>No((n,r)=>br(Es(e,n,r),o=>o._tag===\"Absent\"?ci(t,!1):o))),q8=e=>e.pipe(f1(k),d1(R())),p1=e=>u1(e)?e:l1(Wu(e,t=>p1(t))),z8=()=>\"\",m1=(e,t)=>e.load(t).pipe(Gb,br(n=>({provider:e,path:t,node:n,toString:z8}))),c1=(e,t)=>m1(e.provider,[...e.path,t]),Vw=e=>e?.value,mg=(e,t)=>$c(Kr,e,new Te(tn(n=>t(n)),Sn())),h1=e=>{switch(e._tag){case\"Union\":return e.types.every(h1);case\"Objects\":case\"Arrays\":case\"Suspend\":return!1;default:return!0}},Zw=(e,t)=>{switch(e._tag){case\"Objects\":return t?._tag===\"Record\";case\"Arrays\":return t?._tag===\"Array\";case\"Union\":return e.types.some(n=>Zw(n,t));case\"Suspend\":return Zw(e.thunk(),t);default:return Vw(t)!==void 0}},W8=It(e=>{let t=new WeakSet,n=BR(r=>{switch(t.add(r),r._tag){case\"Objects\":{let o=r.indexSignatures.map(i=>Ia(i.parameter)),s=xe(function*(i){if(i.node?._tag!==\"Record\")return;let a=i.node,c=new Set;for(let f of r.propertySignatures)typeof f.name==\"string\"&&c.add(f.name);if(o.length>0)for(let f of a.keys)o.some(d=>d(f))&&c.add(f);let u={};for(let f of c){let d=yield*c1(i,f);d.node!==void 0&&F(u,f,d)}return u});return mg(r.recur(n,i=>i),s)}case\"Arrays\":{let o=xe(function*(s){if(s.node?._tag!==\"Array\")return;let i=[];for(let a=0;ax(Vw(o.node))):r.recur(n);case\"Suspend\":{let o=r.thunk();return t.has(o)||n(o),r.recur(n)}case\"Declaration\":case\"Any\":throw new globalThis.Error(\"Config.schema does not support opaque StringTree encodings\",{cause:r});default:return mg(r,o=>x(Vw(o.node)))}});return n(e)});function vn(e,t){let n=lu(e),r=nn(n.ast),o=Ze(j(W8(n.ast))),s=typeof t==\"string\"?[t]:t??[];return No((i,a)=>{let c=[...a,...s];return a1(m1(i,c),!1).pipe(lt(u=>{let f=Zw(r,u.node);return a1(o(u).pipe(br(d=>ci(d,f)),vc(d=>{let p=new xu(new bs(c.length>0?new Ve(c,d):d));return f?P(Lo(p,!0)):x(U8(p))})),f)}))})}var g1=io([\"true\",\"yes\",\"on\",\"1\",\"y\"]),x1=io([\"false\",\"no\",\"off\",\"0\",\"n\"]),y1=io([...g1.literals,...x1.literals]).pipe(ne(ng,We({decode:e=>e===\"true\"||e===\"yes\"||e===\"on\"||e===\"1\"||e===\"y\",encode:e=>e?\"true\":\"false\"}))),b1=Uo.check(fu({minimum:1,maximum:65535})),S1=io(s1),H8=(e,t,n)=>{let r=Gl(e,t),o=Vk(n),s=X.pipe(ne(lu(r),{decode:o.decode,encode:Sn({strict:!1}).compose(o.encode)}));return st([r,s])},J8=(e,t)=>{let n=Ye(e),r=t?.separator??\",\",o=X.pipe(ne(lu(n),{decode:Pk(t),encode:Sn({strict:!1}).compose(ue(s=>s.join(r)))}));return st([o,n])};function K8(e){return No(()=>P(Lo(new xu(e),!1)))}function G8(e){return No(()=>x(ci(e,!1)))}function V8(e){return vn(X,e)}function Z8(e){return vn(pw,e)}function Y8(e){return vn(uu,e)}function Q8(e){return vn(Xn,e)}function X8(e){return vn(Uo,e)}function eY(e,t){return vn(ze(e),t)}function tY(e,t){return vn(io(e),t)}function nY(e){return vn(y1,e)}function rY(e){return vn(hw,e)}function oY(e){return vn(b1,e)}function sY(e){return vn(S1,e)}function iY(e){return vn(td(X),e)}function aY(e){return vn(nd,e)}function cY(e){return vn(er,e)}var uY=l(2,(e,t)=>No((n,r)=>Es(e,n,[...r,t])));var Ua={};uo(Ua,{Console:()=>E1,assert:()=>fY,clear:()=>lY,consoleWith:()=>Ot,count:()=>dY,countReset:()=>pY,debug:()=>mY,dir:()=>hY,dirxml:()=>gY,error:()=>xY,group:()=>yY,info:()=>bY,log:()=>SY,table:()=>EY,time:()=>IY,timeLog:()=>wY,trace:()=>TY,warn:()=>vY,withGroup:()=>AY,withTime:()=>CY});var E1=Vy,Ot=e=>Y(t=>e(t.getRef(E1))),fY=(e,...t)=>Ot(n=>L(()=>{n.assert(e,...t)})),lY=Ot(e=>L(()=>{e.clear()})),dY=e=>Ot(t=>L(()=>{t.count(e)})),pY=e=>Ot(t=>L(()=>{t.countReset(e)})),mY=(...e)=>Ot(t=>L(()=>{t.debug(...e)})),hY=(e,t)=>Ot(n=>L(()=>{n.dir(e,t)})),gY=(...e)=>Ot(t=>L(()=>{t.dirxml(...e)})),xY=(...e)=>Ot(t=>L(()=>{t.error(...e)})),yY=e=>Ot(t=>Li(L(()=>{e?.collapsed?t.groupCollapsed(e.label):t.group(e?.label)}),()=>L(()=>{t.groupEnd()}))),bY=(...e)=>Ot(t=>L(()=>{t.info(...e)})),SY=(...e)=>Ot(t=>L(()=>{t.log(...e)})),EY=(e,t)=>Ot(n=>L(()=>{n.table(e,t)})),IY=e=>Ot(t=>Li(L(()=>{t.time(e)}),()=>L(()=>{t.timeEnd(e)}))),wY=(e,...t)=>Ot(n=>L(()=>{n.timeLog(e,...t)})),TY=(...e)=>Ot(t=>L(()=>{t.trace(...e)})),vY=(...e)=>Ot(t=>L(()=>{t.warn(...e)})),AY=l(e=>ee(e[0]),(e,t)=>Ot(n=>yf(L(()=>{t?.collapsed?n.groupCollapsed(t.label):n.group(t?.label)}),()=>e,()=>L(()=>{n.groupEnd()})))),CY=l(e=>ee(e[0]),(e,t)=>Ot(n=>yf(L(()=>{n.time(t)}),()=>e,()=>L(()=>{n.timeEnd(t)}))));var Nn={OK:200,Unauthorized:401,NotFound:404,InternalServerError:500,ServiceUnavailable:503},Yw={[Nn.OK]:\"OK\",[Nn.Unauthorized]:\"Unauthorized\",[Nn.NotFound]:\"Not Found\",[Nn.InternalServerError]:\"Internal Server Error\",[Nn.ServiceUnavailable]:\"Service Unavailable\"},OY=e=>{let t=e.startsWith(\"/\"),n=[];for(let o of e.split(\"/\"))if(!(o===\"\"||o===\".\")){if(o===\"..\"){n.length>0&&n.at(-1)!==\"..\"?n.pop():t||n.push(\"..\");continue}n.push(o)}let r=n.join(\"/\");return t?`/${r}`:r||\".\"},ui=(...e)=>OY(e.filter(Boolean).join(\"/\")),yu=e=>{if(e.length===0)return\".\";let t=e.length;for(;t>1&&e[t-1]===\"/\";)t-=1;let n=e.slice(0,t),r=n.lastIndexOf(\"/\");return r<0?\".\":r===0?\"/\":n.slice(0,r)},I1=e=>{if(!e.startsWith(\"/\"))throw new TypeError(\"Path must be absolute\");let t=new URL(\"file:///\");return t.pathname=e.replace(/%/g,\"%25\").replace(/\\\\/g,\"%5C\"),t};var kY=/^[A-Za-z0-9_-]+$/u,w1=/[*?[{]/u,hg=(e,t)=>t===e||t.startsWith(`${e.replace(/\\/+$/u,\"\")}/`),bu=class extends bo.TaggedError(\"FunctionFileSystemError\"){},kr=(e,t)=>e.lstat(t).pipe(D.catch(()=>D.undefined)),Da=(e,t,n)=>D.all([e.realPath(t),e.realPath(n)],{concurrency:2}).pipe(D.map(([r,o])=>hg(r,o)),D.orElseSucceed(()=>!1)),T1=(e,t,n)=>D.gen(function*(){let r=yield*kr(e,n);if(r===void 0)return!0;if(r.isSymbolicLink||!(yield*Da(e,t,n)))return!1;if(!r.isDirectory)return!0;let o=yield*e.readDirectory(n).pipe(D.catch(()=>D.undefined));if(o===void 0)return!1;for(let s of o)if(!(yield*T1(e,t,ui(n,s))))return!1;return!0}),hd=(e,t)=>t.length===0?\"\":t.startsWith(\"/\")?t:ui(e,t),Qw=[\"deno.json\",\"deno.jsonc\"],v1=e=>Qw.includes(e.slice(e.lastIndexOf(\"/\")+1)),RY=(e,t,n)=>D.gen(function*(){let r=yu(ui(n));for(;hg(t,r);){for(let s of Qw){let i=ui(r,s),a=yield*kr(e,i);if(a!==void 0)return a.isFile&&!a.isSymbolicLink?i:void 0}let o=yu(r);if(o===r)break;r=o}}),_Y=(e,t,n)=>D.all([e.realPath(t),e.realPath(n)],{concurrency:2}).pipe(D.map(([r,o])=>r===o),D.orElseSucceed(()=>!1)),A1=D.fn(\"Functions.resolveFunctionConfig\")(function*(e){let{root:t,slug:n,overrides:r,fs:o}=e;if(!t.startsWith(\"/\")||!kY.test(n)||n===\"_shared\"||(yield*kr(o,t))===void 0)return;let i=yield*o.realPath(t).pipe(D.orElseSucceed(()=>\"\"));if(!i.startsWith(\"/\"))return;let a=yield*kr(o,i);if(a===void 0||!a.isDirectory)return;let c=e.filesRoot===void 0?i:yield*o.realPath(e.filesRoot).pipe(D.orElseSucceed(()=>\"\"));if(!c.startsWith(\"/\")||!hg(c,i))return;let u=r.$default,f=r[n],d={...u,...f};if(d.enabled===!1)return;let p=ui(i,n),m=d?.entrypointPath&&d.entrypointPath.length>0?d.entrypointPath:d.entrypoint&&d.entrypoint.length>0?d.entrypoint:\"index.ts\";if(!m.startsWith(\"/\")){let S=yield*kr(o,p);if(S===void 0||!S.isDirectory||!(yield*Da(o,i,p)))return}let g=hd(p,m);if(!(yield*Da(o,c,g)))return;let b=yield*kr(o,g);if(b===void 0||!b.isFile||b.isSymbolicLink)return;let I=f?.importMapPath??f?.import_map,w=u?.importMapRoot??u?.import_map_root,E=I!==void 0?hd(p,I):w!==void 0?hd(i,w):hd(p,\"\");if(E.length>0){if(!(yield*Da(o,c,E)))return;let S=yield*kr(o,E);if(S===void 0||!S.isFile||S.isSymbolicLink)return}else for(let S of Qw){let v=ui(p,S),C=yield*kr(o,v);if(C!==void 0){if(!C.isFile||C.isSymbolicLink||!(yield*Da(o,c,v)))return;E=v;break}}let h=E.length===0?void 0:yield*RY(o,c,g),A=h!==void 0&&(yield*_Y(o,h,E)),y=(d.staticFiles??d.static_files??[]).map(S=>hd(p,S));for(let S of y){if(!hg(c,S))return;let v=S.search(w1),C=v<0?S:S.slice(0,v),V=v<0?yu(S):C.slice(0,Math.max(0,C.lastIndexOf(\"/\")))||i;if(!(yield*T1(o,c,V)))return;if(!w1.test(S)){let ce=yield*kr(o,S);if(ce!==void 0&&(!(yield*Da(o,c,S))||ce.isSymbolicLink))return}}return{entrypointPath:g,importMapPath:E,importMapDiscoveredByRuntime:A,staticFiles:y,verifyJWT:d.verifyJWT??d.verify_jwt??!0,env:d.env}}),MY=e=>ui(yu(e.entrypointPath),\"package.json\"),C1=e=>{let t=new Map,n=new Map;return(r,o)=>{let s=n.get(r);if(s!==void 0)return s;let i=yu(o.entrypointPath),a=t.get(i),c=a===void 0||a===r?i:e();return a===void 0&&t.set(i,r),n.set(r,c),c}},O1=D.fn(\"Functions.packageJsonContainedFor\")(function*(e){if(!e.root.startsWith(\"/\"))return!1;let t=yield*kr(e.fs,e.root);if(t===void 0||!t.isDirectory&&!t.isSymbolicLink)return!1;let n=yield*e.fs.realPath(e.root).pipe(D.orElseSucceed(()=>\"\"));if(!n.startsWith(\"/\"))return!1;let r=yield*kr(e.fs,n);if(r===void 0||!r.isDirectory)return!1;let o=MY(e.config),s=yield*kr(e.fs,o);return s===void 0||!s.isFile||s.isSymbolicLink?!1:yield*Da(e.fs,n,o)});var Xw=new TextEncoder,gd=new TextDecoder,gg=new TextDecoder(\"utf-8\",{fatal:!0}),Jre=2**32;function k1(...e){let t=e.reduce((o,{length:s})=>o+s,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function Su(e){let t=new Uint8Array(e.length);for(let n=0;n127)throw new TypeError(\"non-ASCII string encountered in encode()\");t[n]=r}return t}var xg=(e,t=\"algorithm.name\")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function PY(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function R1(e,t){let{modulusLength:n}=t.algorithm;if(typeof n!=\"number\"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function _1(e,t,n){let r=e.algorithm;if(r.name!==t.name)throw xg(t.name);if(t.hash&&r.hash?.name!==t.hash)throw xg(t.hash,\"algorithm.hash\");if(t.namedCurve&&r.namedCurve!==t.namedCurve)throw xg(t.namedCurve,\"algorithm.namedCurve\");if(t.length!==void 0&&r.length!==t.length)throw xg(t.length,\"algorithm.length\");PY(e,n)}function FY(e,t,...n){if(n.length>2){let r=n.pop();e+=`one of type ${n.join(\", \")}, or ${r}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==\"function\"&&t.name?e+=` Received function ${t.name}`:typeof t==\"object\"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var xd=(e,t,...n)=>FY(`Key for the ${e} algorithm must be `,t,...n);var an=class extends Error{static code=\"ERR_JOSE_GENERIC\";code=\"ERR_JOSE_GENERIC\";constructor(t,n){super(t,n),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Is=class extends an{static code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";claim;reason;payload;constructor(t,n,r=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.claim=r,this.reason=o,this.payload=n}},yd=class extends an{static code=\"ERR_JWT_EXPIRED\";code=\"ERR_JWT_EXPIRED\";claim;reason;payload;constructor(t,n,r=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.claim=r,this.reason=o,this.payload=n}},yg=class extends an{static code=\"ERR_JOSE_ALG_NOT_ALLOWED\";code=\"ERR_JOSE_ALG_NOT_ALLOWED\"},co=class extends an{static code=\"ERR_JOSE_NOT_SUPPORTED\";code=\"ERR_JOSE_NOT_SUPPORTED\"};var Ln=class extends an{static code=\"ERR_JWS_INVALID\";code=\"ERR_JWS_INVALID\"},Eu=class extends an{static code=\"ERR_JWT_INVALID\";code=\"ERR_JWT_INVALID\"};var bd=class extends an{static code=\"ERR_JWKS_INVALID\";code=\"ERR_JWKS_INVALID\"},Iu=class extends an{static code=\"ERR_JWKS_NO_MATCHING_KEY\";code=\"ERR_JWKS_NO_MATCHING_KEY\";constructor(t=\"no applicable key found in the JSON Web Key Set\",n){super(t,n)}},bg=class extends an{[Symbol.asyncIterator]=async function*(){};static code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";constructor(t=\"multiple matching keys found in the JSON Web Key Set\",n){super(t,n)}},Sg=class extends an{static code=\"ERR_JWKS_TIMEOUT\";code=\"ERR_JWKS_TIMEOUT\";constructor(t=\"request timed out\",n){super(t,n)}},Eg=class extends an{static code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";constructor(t=\"signature verification failed\",n){super(t,n)}};var e0=e=>{if(e?.[Symbol.toStringTag]===\"CryptoKey\")return!0;try{return e instanceof CryptoKey}catch{return!1}},UY=e=>e?.[Symbol.toStringTag]===\"KeyObject\",M1=e=>e0(e)||UY(e);function P1(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),n=new Uint8Array(t.length);for(let r=0;rtypeof o!=\"string\")||new Set(r).size!==r.length)throw new TypeError('\"key_ops\" (Key Operations) Parameter must be an array of unique strings');t.key_ops=r}return t}var o0=e=>e[Symbol.toStringTag],DY=(e,t,n)=>{let{alg:r}=e;if(t.use!==void 0){let o=n===\"sign\"||n===\"verify\"?\"sig\":\"enc\";if(t.use!==o)throw new TypeError(`Invalid key for this operation, its \"use\" must be \"${o}\" when present`)}if(t.alg!==void 0&&t.alg!==r)throw new TypeError(`Invalid key for this operation, its \"alg\" must be \"${r}\" when present`);if(Array.isArray(t.key_ops)){let o=n===\"encrypt\"||n===\"decrypt\"?e.ops?.[n===\"encrypt\"?0:1]:n;if(o&&!t.key_ops.includes(o))throw new TypeError(`Invalid key for this operation, its \"key_ops\" must include \"${o}\" when present`)}};function NY(e,t,n){let{alg:r,secret:o}=e,s=n===\"decrypt\"||n===\"sign\";if(o&&t instanceof Uint8Array)return[N1,t];if(fi(t)){let i=U1(t);if(typeof i.kty!=\"string\")throw new TypeError(o?xd(r,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):xd(r,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(!(o?i.kty===\"oct\"&&typeof i.k==\"string\":i.kty!==\"oct\"&&(s?i.kty===\"AKP\"&&typeof i.priv==\"string\"||typeof i.d==\"string\":i.d===void 0&&i.priv===void 0)))throw new TypeError(o?'JSON Web Key for symmetric algorithms must have JWK \"kty\" (Key Type) equal to \"oct\" and the JWK \"k\" (Key Value) present':`JSON Web Key for this operation must be a ${s?\"private\":\"public\"} JWK`);return DY(e,i,n),[j1,t,i]}if(!M1(t))throw new TypeError(o?xd(r,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):xd(r,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(o){if(t.type!==\"secret\")throw new TypeError(`${o0(t)} instances for symmetric algorithms must be of type \"secret\"`)}else{if(t.type===\"secret\")throw new TypeError(`${o0(t)} instances for asymmetric algorithms must not be of type \"secret\"`);let i=s?\"private\":\"public\";if((t.type===\"public\"||t.type===\"private\")&&t.type!==i){let a=n===\"sign\"?\"signing\":n===\"verify\"?\"verifying\":`${n.slice(0,-1)}tion`;throw new TypeError(`${o0(t)} instances for asymmetric algorithm ${a} must be of type \"${i}\"`)}}return e0(t)?[L1,t]:[$1,t]}var N1=0,L1=1,$1=2,j1=3,s0,LY={__proto__:null,prime256v1:\"P-256\",secp384r1:\"P-384\",secp521r1:\"P-521\"};function vg(e,t,n){s0||=new WeakMap;let r=s0.get(e);return n&&(r?r[t]=n:s0.set(e,{[t]:n})),n??r?.[t]}var D1=async(e,t,n)=>vg(e,n.alg)??vg(e,n.alg,await Tg(n,{...t,alg:n.alg})),$Y=(e,t)=>{let n=vg(e,t.alg);if(n)return n;let r=e.type===\"public\",o=t.usages[r?0:1],{asymmetricKeyType:s}=e,i=LY[e.asymmetricKeyDetails?.namedCurve],a=t.resolve?.({crv:i,asymmetricKeyType:s})??t.subtle;return vg(e,t.alg,e.toCryptoKey(a,r,o))};async function B1(e,t,n){let r=NY(e,t,n);switch(r[0]){case N1:case L1:return r[1];case j1:{let o=r[1],s=r[2];if(s.kty===\"oct\")return Sd(s.k);if(!Object.isFrozen(o)){let{key_ops:i}=o;Array.isArray(i)&&Object.freeze(i),Object.freeze(o)}return D1(o,s,e)}case $1:{let o=r[1];return o.type===\"secret\"?o.export():\"toCryptoKey\"in o&&typeof o.toCryptoKey==\"function\"?$Y(o,e):D1(o,o.export({format:\"jwk\"}),e)}}}function q1(e){let t={__proto__:null};for(let n in e)t[n]={...e[n],alg:n};return t}var z1={__proto__:null,b64:!0};function W1(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(n=>typeof n!=\"string\")))throw new TypeError(`\"${e}\" option must be an array of strings`);if(t)return new Set(t)}function H1(e,t,n,r,o){if(o.crit!==void 0&&r?.crit===void 0)throw new e('\"crit\" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return[];if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(i=>typeof i!=\"string\"||i.length===0))throw new e('\"crit\" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s=n===void 0?t:{__proto__:null,...n,...t};for(let i of r.crit){if(!(i in s))throw new co(`Extension Header Parameter \"${i}\" is not recognized`);if(!Object.hasOwn(o,i)||o[i]===void 0)throw new e(`Extension Header Parameter \"${i}\" is missing`);if(s[i]&&(!Object.hasOwn(r,i)||r[i]===void 0))throw new e(`Extension Header Parameter \"${i}\" MUST be integrity protected`)}return r.crit}function J1(e,t){if(t.includes(\"b64\")){let n=e.b64;if(typeof n!=\"boolean\")throw new Ln('The \"b64\" (base64url-encode payload) Header Parameter must be a boolean');return n}return!0}async function jY(e,t,n){return t instanceof Uint8Array?crypto.subtle.importKey(\"raw\",t,e.subtle,!1,[n]):(_1(t,e.subtle,n),e.minRsaBits&&R1(e.alg,t),t)}async function K1(e,t,n,r){let o=await jY(e,t,\"verify\");try{return await crypto.subtle.verify(e.signing,o,n,r)}catch{return!1}}var Ed=[[\"verify\"],[\"sign\"]];function i0(e){let t={name:\"HMAC\",hash:`SHA-${e}`};return{kty:[\"oct\"],secret:!0,subtle:t,signing:t,usages:Ed}}function wu(e,t){let r={name:t?\"RSA-PSS\":\"RSASSA-PKCS1-v1_5\",hash:`SHA-${e}`};return{kty:[\"RSA\"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:Ed,minRsaBits:2048}}function a0(e,t){return{kty:[\"EC\"],crv:e,subtle:{name:\"ECDSA\",namedCurve:e},signing:{name:\"ECDSA\",hash:`SHA-${t}`},usages:Ed}}function G1(){let e={name:\"Ed25519\"};return{kty:[\"OKP\"],crv:\"Ed25519\",subtle:e,signing:e,usages:Ed}}function c0(e){let n={name:`ML-DSA-${e}`};return{kty:[\"AKP\"],subtle:n,signing:n,usages:Ed}}var u0=q1({HS256:i0(256),HS384:i0(384),HS512:i0(512),RS256:wu(256),RS384:wu(384),RS512:wu(512),PS256:wu(256,32),PS384:wu(384,48),PS512:wu(512,64),ES256:a0(\"P-256\",256),ES384:a0(\"P-384\",384),ES512:a0(\"P-521\",512),EdDSA:G1(),Ed25519:G1(),\"ML-DSA-44\":c0(44),\"ML-DSA-65\":c0(65),\"ML-DSA-87\":c0(87)});function V1(e){let t=typeof e==\"string\"?u0[e]:void 0;if(!t)throw new co(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Z1(e){return[e&&W1(\"algorithms\",e.algorithms),e?.crit]}function BY(e,t=e===void 0?{}:wg(e,Ln,\"JWS Protected Header is invalid\")){return t}function qY(e,t,n){let r=J1(e,H1(Ln,z1,n[1],e,t)),o=t.alg;if(typeof o!=\"string\"||!o)throw new Ln('JWS \"alg\" (Algorithm) Header Parameter missing or invalid');if(n[0]&&!n[0].has(o))throw new yg('\"alg\" (Algorithm) Header Parameter value not allowed');return[r,o]}function zY(e){try{return Su(e)}catch{throw new Ln(\"JWS Compact Serialization payload must use only ASCII characters\")}}async function WY(e,t,n,r,o,s,i){let a=!1;typeof n==\"function\"&&(n=await n(o,e),a=!0);let c=typeof i==\"string\",u=V1(s),f=k1(r!==void 0?Su(r):new Uint8Array,Su(\".\"),c?t[2]??=F1(i,\"payload\",Ln):i),d=n0(e.signature,\"signature\",Ln),p=await B1(u,n,\"verify\");if(!await K1(u,p,d,f))throw new Eg;return[c?n0(i,\"payload\",Ln):i,o,c,p,a]}async function Y1(e,t,n){if(e instanceof Uint8Array&&(e=gd.decode(e)),typeof e!=\"string\")throw new Ln(\"Compact JWS must be a string or Uint8Array\");let{0:r,1:o,2:s,length:i}=e.split(\".\");if(i!==3)throw new Ln(\"Invalid Compact JWS\");let a={payload:o,protected:r,signature:s},c=BY(r),[u,f]=qY(c,c,t),d=u?o:zY(o);return WY(a,t,n,r,c,f,d)}var HY=e=>Math.floor(e.getTime()/1e3),JY={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},KY=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Tu=\"check_failed\";function f0(){throw new TypeError(\"Invalid time period format\")}function Q1(e){typeof e!=\"string\"&&f0();let t=KY.exec(e);(!t||t[4]&&t[1])&&f0();let n=parseFloat(t[2]),r=Math.round(n*JY[t[3][0].toLowerCase()]);return Number.isFinite(r)||f0(),t[1]===\"-\"||t[4]===\"ago\"?-r:r}function l0(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}var X1=e=>{let t=e.toLowerCase();return e.includes(\"/\")?t:`application/${t}`},GY=(e,t)=>typeof e==\"string\"?t.includes(e):Array.isArray(e)?t.some(n=>e.includes(n)):!1;function d0(e,t,n=!1){let r=e[t];if(!(r===void 0&&!n)){if(typeof r!=\"number\")throw new Is(`\"${t}\" claim must be a number`,e,t,\"invalid\");return r}}function p0(e,t){throw new Is(`unexpected \"${t}\" claim value`,e,t,Tu)}function e2(e,t,n={}){let r;try{r=JSON.parse(gg.decode(t))}catch{}if(!fi(r))throw new Eu(\"JWT Claims Set must be a top-level JSON object\");let{typ:o}=n;if(o!==void 0&&(typeof e.typ!=\"string\"||X1(e.typ)!==X1(o)))throw new Is('unexpected \"typ\" JWT header value',r,\"typ\",Tu);let{requiredClaims:s=[],issuer:i,subject:a,audience:c,maxTokenAge:u}=n,f=[...s];u!==void 0&&f.push(\"iat\"),c!==void 0&&f.push(\"aud\"),a!==void 0&&f.push(\"sub\"),i!==void 0&&f.push(\"iss\");for(let E of new Set(f.reverse()))if(!Object.hasOwn(r,E))throw new Is(`missing required \"${E}\" claim`,r,E,\"missing\");i!==void 0&&!(Array.isArray(i)?i:[i]).includes(r.iss)&&p0(r,\"iss\"),a!==void 0&&r.sub!==a&&p0(r,\"sub\"),c!==void 0&&!GY(r.aud,typeof c==\"string\"?[c]:c)&&p0(r,\"aud\");let{clockTolerance:d}=n,p=0;if(typeof d==\"string\")p=Q1(d);else if(d!==void 0){if(typeof d!=\"number\")throw new TypeError(\"Invalid clockTolerance option type\");p=d}l0(\"clockTolerance option\",p);let{currentDate:m}=n,g=l0(\"currentDate option\",HY(m===void 0?new Date:m)),b=d0(r,\"iat\",u!==void 0),I=d0(r,\"nbf\");if(I!==void 0&&I>g+p)throw new Is('\"nbf\" claim timestamp check failed',r,\"nbf\",Tu);let w=d0(r,\"exp\");if(w!==void 0&&w<=g-p)throw new yd('\"exp\" claim timestamp check failed',r,\"exp\",Tu);if(u!==void 0){let E=g-b,h=l0(\"maxTokenAge option\",typeof u==\"number\"?u:Q1(u));if(E-p>h)throw new yd('\"iat\" claim timestamp check failed (too far in the past)',r,\"iat\",Tu);if(E<-p)throw new Is('\"iat\" claim timestamp check failed (it should be in the past)',r,\"iat\",Tu)}return r}async function Ag(e,t,n){let r=await Y1(e,Z1(n),t);if(!r[2])throw new Eu(\"JWTs MUST NOT use unencoded payload\");let s={payload:e2(r[1],r[0],n),protectedHeader:r[1]};return typeof t==\"function\"?{...s,key:r[3]}:s}function VY(e,t,n,r){let{kty:o,key_ops:s,ext:i,kid:a,alg:c,use:u,crv:f}=r0(e),d=Array.isArray(s)?[...s]:s;return(i===void 0||typeof i==\"boolean\")&&(d===void 0||Array.isArray(d)&&d.every((p,m)=>typeof p==\"string\"&&d.indexOf(p)===m)&&d.includes(\"verify\"))&&t.kty.includes(o)&&(r===void 0||typeof r==\"string\"&&r===a)&&(c===void 0?o!==\"AKP\":n===c)&&(u===void 0||u===\"sig\")&&(!t.crv||f===t.crv)}async function t2(e,t,n){let r=e.get(t)||e.set(t,{}).get(t),{alg:o}=n;if(r[o]===void 0){let s=await Tg(n,{...t,alg:o,ext:!0});if(s.type!==\"public\")throw new bd(\"JSON Web Key Set members must be public keys\");r[o]=s}return r[o]}function Na(e){let t;try{t=structuredClone(e)}catch{}if(!Ig(t))throw new bd(\"JSON Web Key Set malformed\");let n=new WeakMap;return Object.defineProperty(async(o,s)=>{let{alg:i,kid:a}={...o,...s?.header},c=typeof i==\"string\"?u0[i]:void 0;if(!c||c.secret)throw new co('Unsupported \"alg\" value for a JSON Web Key Set');let u=t.keys.filter(p=>VY(p,c,i,a)),{0:f,length:d}=u;if(!d)throw new Iu;if(d!==1){let p=new bg;throw p[Symbol.asyncIterator]=async function*(){for(let m of u)try{yield await t2(n,m,c)}catch{}},p}return t2(n,f,c)},\"jwks\",{value:()=>structuredClone(t)})}function ZY(){return typeof WebSocketPair<\"u\"||typeof navigator<\"u\"&&navigator.userAgent===\"Cloudflare-Workers\"||typeof EdgeRuntime<\"u\"&&EdgeRuntime===\"vercel\"}var m0;(typeof navigator>\"u\"||!navigator.userAgent?.startsWith?.(\"Mozilla/5.0 \"))&&(m0=\"jose/v6.2.10\");var r2=Symbol();async function YY(e,t,n,r=fetch){let o=await r(e,{method:\"GET\",signal:n,redirect:\"manual\",headers:t}).catch(s=>{throw s.name===\"TimeoutError\"?new Sg:s});if(o.status!==200)throw new an(\"Expected 200 OK from the JSON Web Key Set HTTP response\");try{return await o.json()}catch{throw new an(\"Failed to parse the JSON Web Key Set HTTP response as JSON\")}}var o2=Symbol();function Id(e,t){return Number.isFinite(e)&&Date.now(){if(p&&ZY()&&(p=void 0),!p){let E=++m,h=p=YY(n,c,AbortSignal.timeout(s),u).then(A=>{let y=Na(A);if(E<=g)return;b=y;let S=Date.now();f&&(f.uat=S,f.jwks=A),d=S,g=E}).finally(()=>{p===h&&(p=void 0)})}await p};return Object.defineProperties(async(E,h)=>{(!b||!Id(d,a))&&await I();try{return await b(E,h)}catch(A){if(A instanceof Iu&&!Id(d,i))return await I(),b(E,h);throw A}},{coolingDown:{get:()=>Id(d,i),enumerable:!0},fresh:{get:()=>Id(d,a),enumerable:!0},reload:{value:I,enumerable:!0},reloading:{get:()=>!!p,enumerable:!0},jwks:{value:()=>b?.jwks(),enumerable:!0}})}function g0(e){let t;if(typeof e==\"string\"){let r=e.split(\".\");(r.length===3||r.length===5)&&([t]=r)}else if(typeof e==\"object\"&&e)if(\"protected\"in e)t=e.protected;else throw new TypeError(\"Token does not contain a Protected Header\");let n=\"Invalid Token or Protected Header formatting\";if(typeof t!=\"string\"||!t)throw new TypeError(n);return wg(t,TypeError,n)}var XY=new Set([\"HOME\",\"HOSTNAME\",\"PATH\",\"PWD\"]),Rr=D.runSync(D.gen(function*(){let e=t=>t.pipe(An.option);return{hostPort:yield*e(An.string(\"SUPABASE_INTERNAL_HOST_PORT\")),functionsRoot:yield*e(An.string(\"SUPABASE_INTERNAL_FUNCTIONS_ROOT\")),filesRoot:yield*e(An.string(\"SUPABASE_INTERNAL_FUNCTIONS_FILES_ROOT\")),jwtSecret:yield*e(An.string(\"SUPABASE_INTERNAL_JWT_SECRET\")),supabaseUrl:yield*e(An.string(\"SUPABASE_URL\")),wallclock:yield*e(An.string(\"SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC\")),publishableKey:yield*e(An.string(\"SUPABASE_INTERNAL_PUBLISHABLE_KEY\")),secretKey:yield*e(An.string(\"SUPABASE_INTERNAL_SECRET_KEY\")),functionsConfig:yield*e(An.string(\"SUPABASE_INTERNAL_FUNCTIONS_CONFIG\")),debug:yield*e(An.string(\"SUPABASE_INTERNAL_DEBUG\")),jwks:yield*e(An.string(\"SUPABASE_JWKS\"))}}).pipe(D.provideService(gu.ConfigProvider,gu.fromEnvRecord(Deno.env.toObject(),{preserveEmptyStrings:!0})))),Au=(e,t=\"\")=>ye.getOrElse(e,()=>t),s2=Au(Rr.hostPort,\"8081\"),l2=Au(Rr.functionsRoot),eQ=Au(Rr.jwtSecret),tQ=Au(Rr.supabaseUrl,\"http://127.0.0.1:54321\"),nQ=new URL(\"/auth/v1/.well-known/jwks.json\",tQ),i2=Number.parseInt(Au(Rr.wallclock,\"400\"),10),a2=ye.getOrUndefined(Rr.publishableKey),c2=ye.getOrUndefined(Rr.secretKey),ws={BootError:Nn.ServiceUnavailable,InvalidWorkerResponse:Nn.InternalServerError,WorkerLimit:546},rQ={[ws.BootError]:\"BOOT_ERROR\",[ws.InvalidWorkerResponse]:\"WORKER_ERROR\",[ws.WorkerLimit]:\"WORKER_LIMIT\"},oQ={[ws.BootError]:\"Worker failed to boot (please check logs)\",[ws.InvalidWorkerResponse]:\"Function exited due to an error (please check logs)\",[ws.WorkerLimit]:\"Worker failed to respond due to a resource limit (please check logs)\"},sQ=new Map([[Deno.errors.InvalidWorkerCreation,ws.BootError],[Deno.errors.InvalidWorkerResponse,ws.InvalidWorkerResponse],[Deno.errors.WorkerRequestCancelled,ws.WorkerLimit]]),iQ=e=>{let t=Deno.errors.WorkerAlreadyRetired;return t!==void 0&&e instanceof t},aQ=(s=>(s.MissingAuthHeader=\"UNAUTHORIZED_NO_AUTH_HEADER\",s.InvalidLegacyJWT=\"UNAUTHORIZED_JWT\",s.InvalidAsymmetricJWT=\"UNAUTHORIZED_ASYMMETRIC_JWT\",s.InvalidTokenFormat=\"UNAUTHORIZED_INVALID_JWT_FORMAT\",s.UnsupportedTokenAlgorithm=\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",s))(aQ||{}),cQ=le.Struct({enabled:le.optionalKey(le.Boolean),verifyJWT:le.optionalKey(le.Boolean),verify_jwt:le.optionalKey(le.Boolean),entrypointPath:le.optionalKey(le.String),entrypoint:le.optionalKey(le.String),importMapPath:le.optionalKey(le.String),import_map:le.optionalKey(le.String),importMapRoot:le.optionalKey(le.String),import_map_root:le.optionalKey(le.String),staticFiles:le.optionalKey(le.Array(le.String)),static_files:le.optionalKey(le.Array(le.String)),env:le.optionalKey(le.Record(le.String,le.String))}),uQ=le.Record(le.String,cQ),fQ=le.declare(e=>typeof e==\"object\"&&e!==null&&\"keys\"in e&&Array.isArray(e.keys)&&e.keys.every(t=>typeof t==\"object\"&&t!==null)),lQ=()=>ye.match(Rr.functionsConfig,{onNone:()=>({}),onSome:e=>D.runSync(le.decodeEffect(le.fromJsonString(uQ))(e).pipe(D.orElseSucceed(()=>({}))))}),x0=lQ();if(ye.getOrUndefined(Rr.debug)===\"true\"){let e=Object.fromEntries(Object.entries(x0).map(([t,n])=>[t,Object.fromEntries(Object.entries(n).filter(([r])=>r!==\"env\"))]));D.runSync(Ua.log(\"Functions config:\",JSON.stringify(e,null,2)))}var La=(e,t,n={})=>{let r={...n},o=null;return e!=null&&(typeof e==\"object\"?(r[\"Content-Type\"]=\"application/json\",o=JSON.stringify(e)):(r[\"Content-Type\"]=\"text/plain\",o=typeof e==\"string\"?e:JSON.stringify(e)??null)),new Response(o,{status:t,headers:r})},u2=({code:e,message:t=\"Invalid JWT\"})=>La({code:e,message:t,msg:t},Nn.Unauthorized,{\"sb-error-code\":e,\"Access-Control-Expose-Headers\":\"sb-error-code\"}),dQ=e=>{for(let[t,n]of sQ.entries())if(t!==void 0&&e instanceof t)return La({code:rQ[n],message:oQ[n]},n);return La({code:Yw[Nn.InternalServerError],message:\"Request failed due to an internal server error\"},Nn.InternalServerError)};function pQ(e){let t=e.split(\" \");return t.length===2&&t[0]===\"Bearer\"?t[1]:null}var mQ=e=>{let t=e.headers.get(\"authorization\"),n=e.headers.get(\"sb-api-key\")?.replace(\"Bearer\",\"\").trim();if(!t&&!n)return{code:\"UNAUTHORIZED_NO_AUTH_HEADER\",message:\"Missing authorization header\"};let r=pQ(t??\"\"),o=!r||r.startsWith(\"sb_\")?n:r;return o||{code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"}},vu=class extends bo.TaggedError(\"BootstrapOperationError\"){},hQ=D.runSync(ye.match(Rr.jwks,{onNone:()=>D.succeed(ye.some(Na({keys:[]}))),onSome:e=>D.gen(function*(){let t=yield*le.decodeEffect(le.fromJsonString(fQ))(e);return yield*D.try({try:()=>Na(t),catch:n=>new vu({cause:n})})}).pipe(D.option)})),gQ=ye.getOrElse(hQ,()=>h0(nQ)),li=e=>D.tryPromise({try:e,catch:t=>new vu({cause:t})}),xQ=e=>D.gen(function*(){return yield*li(()=>Ag(e,gQ)),ye.none()}).pipe(D.orElseSucceed(()=>ye.some({code:\"UNAUTHORIZED_ASYMMETRIC_JWT\"})));function yQ(e,t){return D.gen(function*(){let n=yield*D.try({try:()=>g0(t).alg,catch:r=>new vu({cause:r})});return n?n===\"HS256\"?yield*li(()=>Ag(t,new TextEncoder().encode(e))).pipe(D.as(ye.none()),D.orElseSucceed(()=>ye.some({code:\"UNAUTHORIZED_JWT\"}))):n===\"ES256\"||n===\"RS256\"?yield*xQ(t):ye.some({code:\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",message:`Unsupported JWT algorithm ${n}`}):ye.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})}).pipe(D.orElseSucceed(()=>ye.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})))}var d2={lstat:e=>li(()=>Deno.lstat(e)).pipe(D.mapError(t=>new bu({cause:t})),D.map(t=>({isDirectory:t.isDirectory,isFile:t.isFile,isSymbolicLink:t.isSymlink}))),realPath:e=>li(()=>Deno.realPath(e)).pipe(D.mapError(t=>new bu({cause:t}))),readDirectory:e=>Do.suspend(()=>Do.fromAsyncIterable(Deno.readDir(e),t=>new vu({cause:t})).pipe(Do.map(t=>t.name))).pipe(Do.runCollect,D.mapError(t=>new bu({cause:t})))},bQ=e=>A1({root:l2,filesRoot:ye.getOrUndefined(Rr.filesRoot),slug:e,overrides:x0,fs:d2}),f2=new Set,SQ=(e,t)=>t.importMapDiscoveredByRuntime||!v1(t.importMapPath)||f2.has(e)?D.void:D.sync(()=>f2.add(e)).pipe(D.andThen(Ua.warn(`[functions] ${e}: ${t.importMapPath} is not the nearest Deno config of ${t.entrypointPath}, so Edge Runtime loads it as a plain import map without comments or jsr:/npm: subpath imports. Move it next to the entrypoint or into a parent directory without a closer deno.json(c).`))),EQ=C1(()=>Deno.makeTempDirSync({prefix:\"supabase-worker-\"})),IQ=e=>e.importMapPath?D.succeed(!1):O1({root:Au(Rr.filesRoot,l2),config:e,fs:d2}),p2=e=>Do.fromEffectRepeat(li(()=>e.read()).pipe(D.flatMap(t=>t.done?Wt.done():D.succeed(t.value)))),wQ=e=>e===void 0?D.void:Do.runDrain(p2(e)).pipe(D.ignore);function TQ(e,t){let n=new URL(e.url),r=e.headers.get(\"x-forwarded-host\");r&&(n.hostname=r);let o=new Request(n.href,{method:e.method,headers:e.headers,body:t===void 0?null:Do.toReadableStream(p2(t)),signal:e.signal,duplex:\"half\"});return o.headers.delete(\"sb-api-key\"),EdgeRuntime.applySupabaseTag(e,o),o}Deno.serve({handler:e=>D.runPromiseExit(D.gen(function*(){let t=yield*D.acquireRelease(D.sync(()=>e.body?.getReader()),u=>D.interruptible(wQ(u))),{pathname:n}=new URL(e.url);if(n===\"/_internal/health\")return La({message:\"ok\"},Nn.OK);if(n===\"/_internal/metric\")return Response.json(yield*li(()=>EdgeRuntime.getRuntimeMetrics()));let r=n.split(\"/\")[1];if(!r)return La(\"Function not found\",Nn.NotFound);let o=yield*bQ(r);if(!o)return La(\"Function not found\",Nn.NotFound);if(yield*SQ(r,o),e.method!==\"OPTIONS\"&&o.verifyJWT){let u=mQ(e);if(typeof u!=\"string\")return u2(u);let f=yield*yQ(eQ,u);if(ye.isSome(f))return u2(f.value)}let s={...Deno.env.toObject(),...Object.fromEntries(Object.entries(o.env??{}).filter(([u])=>!u.startsWith(\"SUPABASE_\"))),SUPABASE_FUNCTION_SLUG:r};a2&&(s.SUPABASE_PUBLISHABLE_KEYS=yield*le.encodeEffect(le.fromJsonString(le.Unknown))({default:a2})),c2&&(s.SUPABASE_SECRET_KEYS=yield*le.encodeEffect(le.fromJsonString(le.Unknown))({default:c2}));let i=Object.entries(s).filter(([u])=>!XY.has(u)&&!u.startsWith(\"SUPABASE_INTERNAL_\")),a=!(yield*IQ(o));return yield*D.gen(function*(){let u=yield*li(()=>EdgeRuntime.userWorkers.create({servicePath:EQ(r,o),memoryLimitMb:256,workerTimeoutMs:Number.isFinite(i2)?i2*1e3:4e5,noModuleCache:!0,noNpm:a,envVars:i,forceCreate:!0,customModuleRoot:\"\",cpuTimeSoftLimitMs:1e3,cpuTimeHardLimitMs:2e3,decoratorType:\"tc39\",maybeEntrypoint:I1(o.entrypointPath).href,context:{useReadSyncFileAPI:!0,...o.importMapPath===\"\"||o.importMapDiscoveredByRuntime?{}:{importMapPath:o.importMapPath}},staticPatterns:o.staticFiles}));return yield*li(()=>u.fetch(TQ(e,t)))}).pipe(D.retry({times:1,while:({cause:u})=>e.body===null&&iQ(u)}),D.catchTag(\"BootstrapOperationError\",({cause:u})=>Ua.error(\"[functions] worker error\",u).pipe(D.andThen(D.succeed(dQ(u))))))}).pipe(D.scoped),{signal:e.signal}).then(t=>{if(Xt.isSuccess(t))return t.value;if(e.signal.aborted&&Wt.hasInterruptsOnly(t.cause))return new Response(null,{status:499});throw Wt.squash(t.cause)}),onListen:()=>{let t=Object.keys(x0).slice(0,5).map(n=>` - http://127.0.0.1:${s2}/functions/v1/${n}`);D.runSync(Ua.log(`Serving functions on http://127.0.0.1:${s2}/functions/v1/${t.length?`\n${t.join(`\n`)}`:\"\"}\nUsing ${Deno.version.deno}`))},onError:()=>La({code:Yw[500],message:\"Request failed due to an internal server error\"},500)});export{aQ as RequestErrors,pQ as extractBearerToken,TQ as prepareUserRequest};\n"; +export const defaultFunctionsBootstrap = "var J$=Object.defineProperty;var Eo=(e,t)=>{for(var r in t)J$(e,r,{get:t[r],enumerable:!0})};var Z=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let r=e;for(let n=0,o=t.length;nt(r,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(r,n){return arguments.length>=2?t(r,n):function(o){return t(o,r)}};case 3:return function(r,n,o){return arguments.length>=3?t(r,n,o):function(s){return t(s,r,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(n){return t(n,...r)}}}};var R=e=>e;var je=e=>()=>e,Er=je(!0),hf=je(!1),Mg=je(null),Sn=je(void 0),Un=Sn;function Fg(e,...t){return Z(e,t)}function Y0(e,t,r,n,o,s,a,i,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return r(t(e.apply(this,arguments)))};case 4:return function(){return n(r(t(e.apply(this,arguments))))};case 5:return function(){return o(n(r(t(e.apply(this,arguments)))))};case 6:return function(){return s(o(n(r(t(e.apply(this,arguments))))))};case 7:return function(){return a(s(o(n(r(t(e.apply(this,arguments)))))))};case 8:return function(){return i(a(s(o(n(r(t(e.apply(this,arguments))))))))};case 9:return function(){return c(i(a(s(o(n(r(t(e.apply(this,arguments)))))))))}}}function Zr(e){let t=new WeakMap;return r=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),o}}function va(e){let t=new WeakMap;return r=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),o!==r&&t.set(o,o),o}}var Lt={};Eo(Lt,{AsyncFiberError:()=>bq,AsyncFiberErrorTypeId:()=>yq,Done:()=>rb,DoneTypeId:()=>fq,ExceededCapacityError:()=>nb,ExceededCapacityErrorTypeId:()=>gq,IllegalArgumentError:()=>pl,IllegalArgumentErrorTypeId:()=>mq,InterruptorStackTrace:()=>GS,NoSuchElementError:()=>uq,NoSuchElementErrorTypeId:()=>cq,ReasonTypeId:()=>Wz,StackTrace:()=>KS,TimeoutError:()=>dq,TimeoutErrorTypeId:()=>lq,TypeId:()=>Hz,UnknownError:()=>Tq,UnknownErrorTypeId:()=>Eq,annotate:()=>wq,annotations:()=>Aq,combine:()=>Yz,die:()=>oi,done:()=>ee,empty:()=>Gz,fail:()=>Vz,filterInterruptors:()=>sq,findDefect:()=>ll,findDie:()=>tq,findError:()=>eb,findErrorOption:()=>Xz,findFail:()=>Qz,findInterrupt:()=>nq,fromReasons:()=>Uc,hasDies:()=>eq,hasFails:()=>XS,hasInterrupts:()=>rq,hasInterruptsOnly:()=>QS,interrupt:()=>Zz,interruptors:()=>oq,isAsyncFiberError:()=>Sq,isCause:()=>VS,isDieReason:()=>Jz,isDone:()=>Dc,isExceededCapacityError:()=>xq,isFailReason:()=>fl,isIllegalArgumentError:()=>hq,isInterruptReason:()=>Kz,isNoSuchElementError:()=>iq,isReason:()=>ZS,isTimeoutError:()=>pq,isUnknownError:()=>Iq,makeDieReason:()=>vm,makeFailReason:()=>km,makeInterruptReason:()=>YS,map:()=>ms,pretty:()=>tb,prettyErrors:()=>aq,reasonAnnotations:()=>Cq,squash:()=>Om});var xf=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(\"stack\");let r=Object.getPrototypeOf(e),n=r;for(;n!==null&&n!==Object.prototype;){let o=Reflect.ownKeys(n);for(let s=0;snew Uint8Array(e.buffer,e.byteOffset,e.byteLength);var Oa=0,X0=()=>{Oa++};function Ir(e){return typeof e==\"string\"}function yf(e){return typeof e==\"number\"}function nd(e){return typeof e==\"boolean\"}function eC(e){return typeof e==\"bigint\"}function Ng(e){return typeof e==\"symbol\"}function od(e){return Ir(e)||yf(e)||Ng(e)}function Yr(e){return typeof e==\"function\"}function tC(e){return e===void 0}function Io(e){return e!==void 0}function sd(e){return e!=null}function rC(e){return!1}function Ug(e){return!0}function ur(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}function Sf(e){return typeof e==\"object\"&&e!==null||Yr(e)}var A=l(2,(e,t)=>Sf(e)&&t in e),Ct=l(2,(e,t)=>A(e,\"_tag\")&&e._tag===t);function nC(e){return e instanceof Error}function ns(e){return A(e,Symbol.iterator)||Ir(e)}var se=\"~effect/Hash\",H=e=>{switch(typeof e){case\"number\":return It(e);case\"bigint\":return _e(e.toString(10));case\"string\":return _e(e);case\"function\":case\"object\":{if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?_e(\"Invalid Date\"):_e(e.toISOString());if(e instanceof RegExp)return _e(e.toString());{if(sc.has(e))return ad(e);let t=sC.get(e);if(t!==void 0)return t;if($g.has(e))return X0(),_e(\"[Circular]\");$g.add(e);let r=Oa,n;try{se in e?n=e[se]():typeof e==\"function\"?n=ad(e):e instanceof DataView?n=To(gf(e)):Array.isArray(e)||ArrayBuffer.isView(e)?n=To(e):e instanceof Map?n=K$(e):e instanceof Set?n=G$(e):n=bf(e)}finally{$g.delete(e)}return r===Oa&&sC.set(e,n),n}}}return zt(aC(_e(String(e))))},ad=e=>(Lg.has(e)||Lg.set(e,zt(Math.random()*4294967296|0)),Lg.get(e)),aC=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),fe=l(2,(e,t)=>aC(Math.imul(e,2654435761)+Math.imul(t,2246822507))),zt=e=>e&3221225471|e>>>1&1073741824;var Dg=new DataView(new ArrayBuffer(8)),It=e=>{let t=e|0;return t===e?zt(t):(Dg.setFloat64(0,e!==e?NaN:e),zt(fe(Dg.getInt32(0),Dg.getInt32(4))))},_e=e=>{let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return zt(t)},Bg=(e,t)=>{let r=12289;for(let n of t)r^=fe(H(n),H(e[n]));return zt(r)},bf=e=>Bg(e,xf(e)),iC=(e,t)=>r=>{let n=e;for(let o of r)n^=t(o);return zt(n)},To=e=>{let t=6151;for(let r of e)t=fe(t,H(r));return zt(t)},K$=iC(_e(\"Map\"),([e,t])=>fe(H(e),H(t))),oC=_e(\"Set\"),G$=iC(oC,e=>fe(oC,H(e))),Lg=new WeakMap,sC=new WeakMap,$g=new WeakSet;var ae=\"~effect/Equal\";function W(){return arguments.length===1?e=>_a(e,arguments[0]):_a(arguments[0],arguments[1])}function _a(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let r=typeof e;return r!==typeof t?!1:r===\"number\"&&e!==e&&t!==t?!0:r!==\"object\"&&r!==\"function\"||sc.has(e)||sc.has(t)?!1:V$(e,t)}function V$(e,t){let r=id.length;for(let s=r;s-- >0;)if(id[s]===e&&jg[s]===t)return!0;if(r)return cC(e,t);let n=uC.get(e);n||uC.set(e,n=new WeakMap);let o=n.get(t);return o===void 0&&n.set(t,o=cC(e,t)),o}function cC(e,t){id.push(e),jg.push(t);try{return Z$(e,t)}finally{id.pop(),jg.pop()}}var id=[],jg=[],uC=new WeakMap;function Z$(e,t){if(H(e)!==H(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),o=t.getTime();return n===o||Number.isNaN(n)&&Number.isNaN(o)}else if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let r=lC(e);if(r!==lC(t)||typeof e==\"function\"&&!r)return!1;if(r)return e[ae](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Y$(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?fC(gf(e),gf(t)):fC(e,t)}else{if(e instanceof Map)return!(t instanceof Map)||e.size!==t.size?!1:zg(e,t,X$,eB);if(e instanceof Set)return!(t instanceof Set)||e.size!==t.size?!1:zg(e,t,H,_a)}return Q$(e,t)}function Y$(e,t){for(let r=0;rH(e[0]),eB=(e,t)=>_a(e[0],t[0])&&_a(e[1],t[1]),tB=()=>0;function cd(e,t){return Ef((r,n)=>e(r[0],n[0])&&t(r[1],n[1]))}function Ef(e){return function(r,n){return zg(r,n,tB,e)}}var lC=e=>A(e,ae),qg=()=>W;var pC=e=>(sc.add(e),e);var Ra=Symbol.for(\"~effect/Redactable\"),rB=e=>A(e,Ra);function Ds(e){return rB(e)?Hg(e):e}function Hg(e){return e[Ra](globalThis[ac]?.context??nB)}var ac=\"~effect/Fiber/currentFiber\",dC=new Map,nB={\"~effect/Context\":{},base:dC,depth:0,mapUnsafe:dC,pipe(){return Z(this,arguments)}};function F(e,t){let r=t?.space??0,n=new WeakSet,o=r?typeof r==\"number\"?\" \".repeat(r):r:\"\",s=f=>o.repeat(f),a=(f,p)=>{let d=f?.constructor;return d&&d!==Object.prototype.constructor&&d.name?`${d.name}(${p})`:p},i=f=>{try{return Reflect.ownKeys(f)}catch{return[\"[ownKeys threw]\"]}};function c(f,p=0){try{return u(f,p)}catch{return(typeof f==\"object\"&&f!==null||typeof f==\"function\")&&n.delete(f),\"[inspection threw]\"}}function u(f,p=0){if(typeof f==\"string\")return JSON.stringify(f);if(typeof f==\"number\"||f==null||typeof f==\"boolean\"||typeof f==\"symbol\")return String(f);if(typeof f==\"bigint\")return String(f)+\"n\";if(typeof f==\"object\"||typeof f==\"function\"){if(n.has(f))return oB;n.add(f);let d;if(Ra in f)d=c(Hg(f),p);else if(Array.isArray(f))d=!o||f.length<=1?`[${f.map(m=>c(m,p)).join(\",\")}]`:`[\n${s(p+1)}${f.map(m=>c(m,p+1)).join(`,\n`+s(p+1))}\n${s(p)}]`;else if(f instanceof Date)d=Wg(f);else if(!t?.ignoreToString&&A(f,\"toString\")&&typeof f.toString==\"function\"&&f.toString!==Object.prototype.toString&&f.toString!==Array.prototype.toString){let m=sB(f);d=f instanceof Error&&f.cause!==void 0?`${m} (cause: ${c(f.cause,p)})`:m}else if(Symbol.iterator in f)d=`${f.constructor.name}(${c(Array.from(f),p)})`;else{let m=i(f);if(!o||m.length<=1){let x=`{${m.map(y=>`${wo(y)}:${c(hC(f,y),p)}`).join(\",\")}}`;d=a(f,x)}else{let x=`{\n${m.map(y=>`${s(p+1)}${wo(y)}: ${c(hC(f,y),p+1)}`).join(`,\n`)}\n${s(p)}}`;d=a(f,x)}}return n.delete(f),d}return String(f)}return c(e,0)}var oB=\"[Circular]\";function wo(e){return typeof e==\"string\"?JSON.stringify(e):String(e)}function ud(e){return e.map(t=>`[${wo(t)}]`).join(\"\")}function Wg(e){try{return e.toISOString()}catch{return\"Invalid Date\"}}function sB(e){try{let t=e.toString();return typeof t==\"string\"?t:String(t)}catch{return\"[toString threw]\"}}function hC(e,t){try{return e[t]}catch{return\"[property access threw]\"}}function Pa(e,t){let r=[];return JSON.stringify(e,function(n,o){let s=Object.getOwnPropertyDescriptor(this,n)?.value,a=A(s,Ra)?Ds(s):Ds(o);if(typeof a==\"bigint\")return F(a);if(typeof a!=\"object\"||a===null)return a;let i=a instanceof Error&&!A(a,\"toJSON\")?{...a,name:a.name,message:a.message}:a;for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(!r.includes(a))return r.push(a),i!==a&&r.push(i),i},t?.space)??\"null\"}var Ie=Symbol.for(\"nodejs.util.inspect.custom\"),kt=e=>{try{return e=Ds(e),A(e,\"toJSON\")&&Yr(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(kt):e}catch{return\"[toJSON threw]\"}},gC=(e,t=2)=>{if(typeof e==\"string\")return e;try{return typeof e==\"object\"?Pa(e,{space:t}):F(e,{space:t})}catch{return String(e)}},ic={toJSON(){return kt(this)},[Ie](){return this.toJSON()},toString(){return F(this.toJSON())}},xC=class{[Ie](){return this.toJSON()}toString(){return F(this.toJSON())}};var iB=()=>{let e=Object.getOwnPropertyDescriptor(Error,\"stackTraceLimit\");return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,\"writable\")?e.writable===!0:e.set!==void 0},cB=iB(),Co=()=>Error.stackTraceLimit,Qr=e=>{cB&&(Error.stackTraceLimit=e)};var Ls=class{constructor(t){this.value=t,this.done=!1}next(t){return this.done?(this.value=t,this):(this.done=!0,{value:this.value,done:!1})}},uB=()=>{let e=\"~effect/Utils/internal\",t={[e]:o=>o()},r={[e]:o=>o()};return Co()!==0&&t[e](()=>new Error().stack)?.includes(e)===!0?t[e]:r[e]},$s=uB();function N(e,t,r){t===\"__proto__\"?Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[t]=r}function ld(e,t){for(let r of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,r)&&N(e,r,t[r])}var ko=\"~effect/Effect\",Ma=\"~effect/Exit\",lB={_A:R,_E:R,_R:R},Jg=`${ko}/identifier`,pe=`${ko}/args`,tt=`${ko}/evaluate`,Ot=`${ko}/successCont`,Xr=`${ko}/failureCont`,Fa=`${ko}/ensureCont`,Da=Symbol.for(\"effect/Effect/Yield\"),er={pipe(){return Z(this,arguments)},toJSON(){return{...this}},toString(){return F(this.toJSON(),{ignoreToString:!0,space:2})},[Ie](){return this.toJSON()}},SC={[se](){return Bg(this,Object.keys(this))},[ae](e){let t=Object.keys(this),r=Object.keys(e);if(t.length!==r.length)return!1;for(let n=0;nA(e,ko),Kg=e=>A(e,Ma),If=\"~effect/Cause\",cc=\"~effect/Cause/Reason\",fc=e=>A(e,If),bC=e=>A(e,cc),Ao=class{constructor(t){this[If]=If,this.reasons=t}pipe(){return Z(this,arguments)}toJSON(){return{_id:\"Cause\",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${F(this.reasons)})`}[Ie](){return this.toJSON()}[ae](t){return fc(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((r,n)=>W(r,t.reasons[n]))}[se](){return To(this.reasons)}},yC=new WeakMap,uc=class{[cc];annotations;_tag;constructor(t,r,n){if(this[cc]=cc,this._tag=t,r!==Cf&&typeof n==\"object\"&&n!==null&&r.size>0){let o=yC.get(n);o&&(r=new Map([...o,...r])),yC.set(n,r)}this.annotations=r}annotate(t,r){if(t.mapUnsafe.size===0)return this;let n=new Map(this.annotations);t.mapUnsafe.forEach((s,a)=>{r?.overwrite!==!0&&n.has(a)||n.set(a,s)});let o=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return o.annotations=n,o}pipe(){return Z(this,arguments)}toString(){return F(this)}[Ie](){return this.toString()}},Cf=new Map,Na=class extends uc{constructor(t,r=Cf){super(\"Fail\",r,t),this.error=t}toString(){return`Fail(${F(this.error)})`}toJSON(){return{_tag:\"Fail\",error:this.error}}[ae](t){return ss(t)&&W(this.error,t.error)&&W(this.annotations,t.annotations)}[se](){return fe(_e(this._tag))(fe(H(this.error))(H(this.annotations)))}},os=e=>new Ao(e),dB=(e,t)=>{let r=new Map,n=[];for(let o of e.concat(t)){let s=H(o),a=r.get(s);if(a===void 0)r.set(s,[o]);else{if(a.some(i=>W(i,o)))continue;a.push(o)}n.push(o)}return n},La=l(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let r=new Ao(dB(e.reasons,t.reasons));return W(e,r)?e:r}),pd=new Ao([]),lc=e=>new Ao([new Na(e)]),Tf=class extends uc{constructor(t,r=Cf){super(\"Die\",r,t),this.defect=t}toString(){return`Die(${F(this.defect)})`}toJSON(){return{_tag:\"Die\",defect:this.defect}}[ae](t){return $a(t)&&W(this.defect,t.defect)&&W(this.annotations,t.annotations)}[se](){return fe(_e(this._tag))(fe(H(this.defect))(H(this.annotations)))}},Gg=e=>new Ao([new Tf(e)]),pc=l(e=>fc(e[0]),(e,t,r)=>t.mapUnsafe.size===0?e:new Ao(e.reasons.map(n=>n.annotate(t,r)))),ss=e=>e._tag===\"Fail\",$a=e=>e._tag===\"Die\",Ba=e=>e._tag===\"Interrupt\";function mB(e){return Tr(\"Effect.evaluate: Not implemented\")}var en=e=>({...pB,[Jg]:e.op,[tt]:e[tt]??mB,[Ot]:e[Ot],[Xr]:e[Xr],[Fa]:e[Fa]}),vo=e=>{let t=en(e),r=function(n){this[pe]=n};return r.prototype=t,function(n){return new r(n)}},EC=e=>{let t={[Ma]:Ma,_tag:e.op,get[e.prop](){return this[pe]},...en(e),toString(){return`${e.op}(${F(this[pe])})`},toJSON(){return{_id:\"Exit\",_tag:e.op,[e.prop]:this[pe]}},[ae](n){return Kg(n)&&n._tag===this._tag&&W(this[pe],n[pe])},[se](){return fe(_e(e.op),H(this[pe]))}},r=function(n){this[pe]=n};return r.prototype=t,function(n){return new r(n)}},we=EC({op:\"Success\",prop:\"value\",[tt](e){let t=e.getCont(Ot);return t?t[Ot](this[pe],e,this):e.yieldWith(this)}}),dd={key:\"effect/Cause/StackTrace\"},Vg={key:\"effect/Cause/InterruptorStackTrace\"},qt=EC({op:\"Failure\",prop:\"cause\",[tt](e){let t=this[pe],r=!1;e.cache.stackFrame&&(t=pc(t,{mapUnsafe:new Map([[dd.key,e.cache.stackFrame]])}),r=!0);let n=e.getCont(Xr),o=e._interruptedCause;if(o&&e.interruptible){let s=!1;for(;n&&e.interruptible;)s||=Jg in n,n=e.getCont(Xr);s&&(t=os(t.reasons.filter(a=>a._tag!==\"Fail\"))),t=La(t,o),r=!0}return n?n[Xr](t,e,r?void 0:this):e.yieldWith(r?qt(t):this)}}),tn=e=>qt(lc(e)),Tr=e=>qt(Gg(e)),ne=vo({op:\"WithFiber\",[tt](e){return this[pe](e)}}),IC=vo({op:\"WithFiberSucceed\",[tt](e){let t=this[pe](e),r=e.getCont(Ot);return r?r[Ot](t,e):e.yieldWith(we(t))}}),hB=(function(){class e extends globalThis.Error{}let t=en({op:\"YieldableError\",[tt](){return tn(this)}});return delete t.toString,Object.assign(e.prototype,t),e})(),Af=(function(){let e=Symbol.for(\"effect/Data/Error/plainArgs\");return class extends hB{constructor(r){super(r?.message,r?.cause?{cause:r.cause}:void 0),r&&(ld(this,r),Object.defineProperty(this,e,{value:r,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),as=e=>{class t extends Af{_tag=e}return t.prototype.name=e,t},wf=\"~effect/Cause/NoSuchElementError\",md=e=>A(e,wf),Dn=class extends as(\"NoSuchElementError\"){[wf]=wf;constructor(t){super({message:t})}},Ua=\"~effect/Cause/Done\",kf=e=>A(e,Ua),TC={[Ua]:Ua,_tag:\"Done\",value:void 0},ja=e=>e===void 0?TC:{[Ua]:Ua,_tag:\"Done\",value:e},xB=tn(TC),wC=e=>e===void 0?xB:tn(ja(e));var hd=e=>en({op:e.label,[tt]:e.evaluate});var xe={};Eo(xe,{Do:()=>ej,all:()=>BB,andThen:()=>FB,as:()=>BC,asVoid:()=>PB,bind:()=>XB,bindTo:()=>YB,composeK:()=>LB,contains:()=>VB,containsWith:()=>HC,exists:()=>ZB,filter:()=>Wa,filterMap:()=>HB,firstSomeOf:()=>_B,flatMap:()=>qa,flatMapNullishOr:()=>NB,flatten:()=>Ha,fromIterable:()=>wB,fromNullOr:()=>ny,fromNullishOr:()=>Pf,fromUndefinedOr:()=>ry,gen:()=>tj,getFailure:()=>AB,getOrElse:()=>Rf,getOrNull:()=>vd,getOrThrow:()=>oy,getOrThrowWith:()=>Od,getOrUndefined:()=>js,getSuccess:()=>CB,isNone:()=>ue,isOption:()=>yc,isSome:()=>Oe,let:()=>QB,lift2:()=>KB,liftNullishOr:()=>RB,liftPredicate:()=>GB,liftThrowable:()=>Ln,makeCombinerFailFast:()=>WC,makeEquivalence:()=>WB,makeOrder:()=>JB,makeReducer:()=>rj,makeReducerFailFast:()=>nj,map:()=>_t,match:()=>Ht,none:()=>v,orElse:()=>kB,orElseResult:()=>OB,orElseSome:()=>vB,partitionMap:()=>qB,product:()=>zC,productMany:()=>$B,reduceCompact:()=>jB,some:()=>O,tap:()=>jC,toArray:()=>zB,toRefinement:()=>TB,void:()=>MB,zipLeft:()=>DB,zipRight:()=>UB,zipWith:()=>qC});function CC(e){return{combine:e}}function Yg(e,t,r){return{combine:e,initialValue:t,combineAll:r??(n=>{let o=t;for(let s of n)o=e(o,s);return o})}}var tr=e=>(t,r)=>t===r||e(t,r),gB=(e,t)=>e===t,za=()=>gB;function vC(e){return tr((t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n{if(t.length!==r.length)return!1;for(let n=0;nl(3,(t,r,n)=>e(t,o=>({...o,[r]:n(o)}))),yd=e=>l(2,(t,r)=>e(t,n=>({[r]:n}))),Sd=(e,t)=>l(3,(r,n,o)=>t(r,s=>e(o(s),a=>({...s,[n]:a}))));var _C=\"~effect/Option\",RC={[_C]:{_A:e=>e},...er,[Symbol.iterator](){return new Ls(this)}},yB=Object.defineProperty(Object.assign(Object.create(RC),{_tag:\"Some\",_op:\"Some\",[ae](e){return bd(e)&&Qg(e)&&W(this.value,e.value)},[se](){return fe(H(this._tag))(H(this.value))},toString(){return`some(${F(this.value)})`},toJSON(){return{_id:\"Option\",_tag:this._tag,value:kt(this.value)}}}),\"valueOrUndefined\",{get(){return this.value}}),SB=H(\"None\"),bB=Object.assign(Object.create(RC),{_tag:\"None\",_op:\"None\",valueOrUndefined:void 0,[ae](e){return bd(e)&&Ed(e)},[se](){return SB},toString(){return\"none()\"},toJSON(){return{_id:\"Option\",_tag:this._tag}}}),bd=e=>A(e,_C),Ed=e=>e._tag===\"None\",Qg=e=>e._tag===\"Some\",vf=Object.create(bB),PC=function(e){this.value=e};PC.prototype=yB;var Of=e=>new PC(e);var FC=\"~effect/Result\",NC={[FC]:{_A:e=>e,_E:e=>e},...er,[Symbol.iterator](){return new Ls(this)}},EB=Object.assign(Object.create(NC),{_tag:\"Success\",_op:\"Success\",[ae](e){return Id(e)&&mc(e)&&W(this.success,e.success)},[se](){return fe(H(this._tag))(H(this.success))},toString(){return`success(${F(this.success)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,value:kt(this.success)}}}),IB=Object.assign(Object.create(NC),{_tag:\"Failure\",_op:\"Failure\",[ae](e){return Id(e)&&dc(e)&&W(this.failure,e.failure)},[se](){return fe(H(this._tag))(H(this.failure))},toString(){return`failure(${F(this.failure)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,failure:kt(this.failure)}}}),Id=e=>A(e,FC),dc=e=>e._tag===\"Failure\",mc=e=>e._tag===\"Success\",UC=function(e){this.failure=e};UC.prototype=IB;var Td=e=>new UC(e),DC=function(e){this.success=e};DC.prototype=EB;var wd=e=>new DC(e),Xg=e=>mc(e)?vf:Of(e.failure),ey=e=>dc(e)?vf:Of(e.success);function Bs(e){return(t,r)=>t===r?0:e(t,r)}var $C=Bs((e,t)=>eglobalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:eeBs((r,n)=>e(t(r),t(n)))),xc=ty(is,e=>e.getTime());var Cd=e=>l(2,(t,r)=>e(t,r)===-1),gc=e=>l(2,(t,r)=>e(t,r)===1),Ad=e=>l(2,(t,r)=>e(t,r)!==1),kd=e=>l(2,(t,r)=>e(t,r)!==-1);var v=()=>vf,O=Of,yc=bd,ue=Ed,Oe=Qg,Ht=l(2,(e,{onNone:t,onSome:r})=>ue(e)?t():r(e.value)),TB=e=>t=>Oe(e(t)),wB=e=>{for(let t of e)return O(t);return v()},CB=ey,AB=Xg,Rf=l(2,(e,t)=>ue(e)?t():e.value),kB=l(2,(e,t)=>ue(e)?t():e),vB=l(2,(e,t)=>ue(e)?O(t()):e),OB=l(2,(e,t)=>ue(e)?_t(t(),wd):_t(e,Td)),_B=e=>{let t=v();for(t of e)if(Oe(t))return t;return t},Pf=e=>e==null?v():O(e),ry=e=>e===void 0?v():O(e),ny=e=>e===null?v():O(e),RB=e=>(...t)=>Pf(e(...t)),vd=Rf(Mg),js=Rf(Sn),Ln=e=>(...t)=>{try{return O(e(...t))}catch{return v()}},Od=l(2,(e,t)=>{if(Oe(e))return e.value;throw t()}),oy=Od(()=>new Error(\"getOrThrow called on a None\")),_t=l(2,(e,t)=>ue(e)?v():O(t(e.value))),BC=l(2,(e,t)=>_t(e,()=>t)),PB=BC(void 0),MB=O(void 0);var qa=l(2,(e,t)=>ue(e)?v():t(e.value)),FB=l(2,(e,t)=>qa(e,r=>{let n=Yr(t)?t(r):t;return yc(n)?n:O(n)})),NB=l(2,(e,t)=>ue(e)?v():Pf(t(e.value))),Ha=qa(R),UB=l(2,(e,t)=>qa(e,()=>t)),DB=l(2,(e,t)=>jC(e,()=>t)),LB=l(2,(e,t)=>r=>qa(e(r),t)),jC=l(2,(e,t)=>qa(e,r=>_t(t(r),()=>r))),zC=l(2,(e,t)=>Oe(e)&&Oe(t)?O([e.value,t.value]):v()),$B=l(2,(e,t)=>{if(ue(e))return v();let r=[e.value];for(let n of t){if(ue(n))return v();r.push(n.value)}return O(r)}),BB=e=>{if(Symbol.iterator in e){let r=[];for(let n of e){if(ue(n))return v();r.push(n.value)}return O(r)}let t={};for(let r of Object.keys(e)){let n=e[r];if(ue(n))return v();N(t,r,n.value)}return O(t)},qC=l(3,(e,t,r)=>_t(zC(e,t),([n,o])=>r(n,o))),jB=l(3,(e,t,r)=>{let n=t;for(let o of e)Oe(o)&&(n=r(n,o.value));return n}),zB=e=>ue(e)?[]:[e.value],qB=l(2,(e,t)=>{if(ue(e))return[v(),v()];let r=t(e.value);return dc(r)?[v(),O(r.failure)]:[O(r.success),v()]}),HB=l(2,(e,t)=>{if(ue(e))return v();let r=t(e.value);return mc(r)?O(r.success):v()}),Wa=l(2,(e,t)=>ue(e)?v():t(e.value)?O(e.value):v()),WB=e=>tr((t,r)=>ue(t)?ue(r):ue(r)?!1:e(t.value,r.value)),JB=e=>Bs((t,r)=>Oe(t)?Oe(r)?e(t.value,r.value):1:-1),KB=e=>l(2,(t,r)=>qC(t,r,e)),GB=l(2,(e,t)=>t(e)?O(e):v()),HC=e=>l(2,(t,r)=>ue(t)?!1:e(t.value,r)),VB=HC(qg()),ZB=l(2,(e,t)=>ue(e)?!1:t(e.value)),YB=yd(_t),QB=gd(_t);var XB=Sd(_t,qa),ej=O({}),tj=(...e)=>{let r=(e.length===1?e[0]:e[1].bind(e[0]))(),n=r.next();for(;!n.done;){let o=n.value;if(ue(o))return o;n=r.next(o.value)}return O(n.value)};function rj(e){return Yg((t,r)=>ue(t)?r:ue(r)?t:O(e.combine(t.value,r.value)),v())}function WC(e){return CC((t,r)=>ue(t)||ue(r)?v():O(e.combine(t.value,r.value)))}function nj(e){let t=WC(e).combine,r=O(e.initialValue);return Yg(t,r,n=>{let o=r;for(let s of n)if(o=t(o,s),ue(o))return o;return o})}var JC=\"~effect/Context/Service\",fr=function(){function e(){}let t=e;Object.setPrototypeOf(t,oj);let r=(n,o)=>(t.key=n,o?.defaultValue&&(t[ay]=ay,t.defaultValue=o.defaultValue),o?.make&&(t.make=o.make),o?.fiberCached&&KC.add(n),t);return arguments.length>0?r(arguments[0],arguments[1]):r},oj={[JC]:JC,...hd({label:\"Service\",evaluate(e){return we(Fe(e.context,this))}}),toJSON(){return{_id:\"Service\",key:this.key}},of(e){return e},context(e){return Ja(this,e)},use(e){return ne(t=>e(Fe(t.context,this)))},useSync(e){return ne(t=>we(e(Fe(t.context,this))))}},KC=new Set,ay=\"~effect/Context/Reference\",GC=\"~effect/Context\",sj=8,aj=8,iy=(e,t,r,n)=>{let o=Object.create(cj);return o.cacheRoot=e??o,o.base=t,o.overlay=r,o.depth=n,o._flat=void 0,o.baseHits=0,o},VC=(e,t)=>{t&&(VC(e,t.parent),e.set(t.key,t.value))},ZC=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return VC(t,e.overlay),e._flat=t},ij=(e,t)=>{let r=new Map(e.mapUnsafe);return t(r),_o(r)},_d=Symbol(),cy=(e,t)=>{let r=e;for(let o=r.overlay;o;o=o.parent)if(o.key===t)return o.value;let n=r.base.get(t);return n===void 0&&!r.base.has(t)?_d:(r.overlay&&++r.baseHits>=r.base.size&&r.baseHits>=aj&&(r.base=ZC(r),r.overlay=void 0,r.depth=0),n)},_o=e=>iy(void 0,e,void 0,0),cj={get mapUnsafe(){return ZC(this)},...er,[GC]:{_Services:e=>e},toJSON(){return{_id:\"Context\",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ae](e){if(!Mf(e))return!1;let t=this.mapUnsafe,r=e.mapUnsafe;if(t.size!==r.size)return!1;for(let[n,o]of t)if(!r.has(n)||!W(o,r.get(n)))return!1;return!0},[se](){return It(this.mapUnsafe.size)}},YC=(e,t)=>e.cacheRoot===t.cacheRoot,Mf=e=>A(e,GC);var QC=e=>!!e[ay],wr=()=>uj,uj=_o(new Map),Ja=(e,t)=>_o(new Map([[e.key,t]])),Wt=l(3,(e,t,r)=>fj(e,t.key,r)),fj=(e,t,r)=>{let n=e,o=KC.has(t)?void 0:n.cacheRoot;if(n.depth>=sj){let s=new Map(n.mapUnsafe);return s.set(t,r),iy(o,s,void 0,0)}return iy(o,n.base,{key:t,value:r,parent:n.overlay},n.depth+1)};var Rd=l(2,(e,t)=>Ff(e,t.key)),Ff=(e,t)=>{let r=cy(e,t);return r===_d?void 0:r},Ro=l(2,(e,t)=>{let r=cy(e,t.key);if(r===_d){if(QC(t))return XC(t);throw lj(t)}return r}),Fe=Ro,sy=\"~effect/Context/defaultValue\",XC=e=>sy in e?e[sy]:e[sy]=e.defaultValue(),lj=e=>{let t=new Error(`Service not found${e.key?`: ${String(e.key)}`:\"\"}`);if(t.stack){let r=t.stack.split(`\n`);r.splice(1,3),t.stack=r.join(`\n`)}return t},Pd=l(2,(e,t)=>{let r=cy(e,t.key);return r!==_d?O(r):QC(t)?O(XC(t)):v()}),Md=l(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:ij(e,r=>t.mapUnsafe.forEach((n,o)=>r.set(o,n)))),eA=(...e)=>{let t=new Map;for(let r=0;r{t.set(o,n)});return _o(t)};var Te=fr;var uy=e=>e.length>0;var rt=e=>e>0?Math.floor(e):0,En=e=>Math.max(1,rt(e));var B=wd,K=Td;var tA=Id,ce=dc,at=mc;var Fd=l(2,(e,t)=>ce(e)?K(t(e.failure)):e),Cr=l(2,(e,t)=>at(e)?B(t(e.success)):e),Ar=l(2,(e,{onFailure:t,onSuccess:r})=>ce(e)?t(e.failure):r(e.success));var Nf=l(2,(e,t)=>ce(e)?t(e.failure):e.success);var dj=l(2,(e,t)=>{if(at(e))return e.success;throw t(e.failure)}),Uf=dj(R);var Dt=l(2,(e,t)=>ce(e)?K(e.failure):t(e.success));var fy=e=>{if(Symbol.iterator in e){let r=[];for(let n of e){if(ce(n))return n;r.push(n.success)}return B(r)}let t={};for(let r of Object.keys(e)){let n=e[r];if(ce(n))return n;N(t,r,n.success)}return B(t)};var rA=vC;var mj=(e,t)=>{let r=t?.length!==void 0?En(t.length):1/0;return{[Symbol.iterator](){let n=0;return{next(){return nxj(mj(()=>e,{length:t}))),oA=e=>hj(e,1/0);var sA=e=>{let r=e[Symbol.iterator]().next();if(r.done)throw new Error(\"headUnsafe: empty iterable\");return r.value};var aA=l(2,(e,t)=>{let r=0;for(let n of e){let o=t(n,r);if(nd(o)){if(o)return O(n)}else if(Oe(o))return o;r++}return v()});var xj=e=>({[Symbol.iterator](){let t=e[Symbol.iterator](),r;function n(){for(;;){if(r===void 0){let s=t.next();if(s.done)return s;r=s.value[Symbol.iterator]()}let o=r.next();if(!o.done)return o;r=void 0}}return{next:n}}});var iA=l(2,(e,t)=>({[Symbol.iterator](){let r=e[Symbol.iterator](),n=0;return{next(){let o=r.next();for(;!o.done;){if(t(o.value,n++))return{done:!1,value:o.value};o=r.next()}return{done:!0,value:void 0}}}}}));var gj=l(2,(e,t)=>Object.hasOwn(e,t));var Ka=l(2,(e,t)=>{let r={...e};for(let n of cA(e))N(r,n,t(e[n],n));return r});var cA=e=>Object.keys(e);var yj=e=>l(2,(t,r)=>{for(let n of cA(t))if(!gj(r,n)||!e(t[n],r[n]))return!1;return!0});var uA=e=>{let t=yj(e);return(r,n)=>t(r,n)&&t(n,r)};var Nd=globalThis.Array;var fA=l(2,(e,t)=>{let r=En(e),n=new Nd(r);for(let o=0;oe<=t?fA(t-e+1,r=>e+r):[e];var Ve=e=>Nd.isArray(e)?e:Nd.from(e);var Ud=l(2,(e,t)=>[...e,t]),py=l(2,(e,t)=>Ve(e).concat(Ve(t)));var lA=Nd.isArray;var rr=uy,Qe=uy;function Sc(e){let t=Number(e);return String(t)===e&&Number.isInteger(t)&&t>=0&&t<2**32-1}function Sj(e,t){return!Number.isFinite(e)||e<0||e>=t.length}var pA=l(2,(e,t)=>{let r=Math.floor(t);if(Sj(r,e))throw new Error(`Index out of bounds: ${r}`);return e[r]});var Dd=e=>e[e.length-1];var dy=aA;var bj=(e,t)=>{let r=H(t),n=e.get(r);if(n===void 0)return e.set(r,[t]),!0;for(let o of n)if(W(o,t))return!1;return n.push(t),!0};var Rt=()=>[],be=e=>[e],In=l(2,(e,t)=>e.map(t));var Ld=l(2,(e,t)=>{let r=Ve(e),n=[];for(let o=0;o{let r=[],n=[],o=0;for(let s of e){let a=t(s,o++);at(a)?r.push(a.success):n.push(a.failure)}return[r,n]});var dA=xd;var $d=e=>{let t=Ve(e);if(t.length<2)return[...t];let r=new Map,n=[];for(let o of t)bj(r,o)&&n.push(o);return n};var jd=\"~effect/Duration\",Ec=BigInt(0),SA=BigInt(1),Ej=BigInt(2),Ij=BigInt(10),mA=BigInt(24),Bd=BigInt(60),hy=BigInt(1e3),hA=BigInt(1e6);var zd=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),bA=e=>zd(e*1e6),xA=(e,t)=>{let r=e.indexOf(\".\");if(r===-1)return BigInt(e)*t;let n=e[0]===\"-\",o=e.slice(r+1),s=Ij**BigInt(o.length),a=(BigInt(e.slice(n?1:0,r))*s+BigInt(o))*t,i=a/s+(a%s*Ej>=s?SA:Ec);return n?-i:i};var Tj=/^(-?\\d+(?:\\.\\d+)?)\\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,We=e=>{switch(typeof e){case\"number\":return Hs(e);case\"bigint\":return Po(e);case\"string\":{if(e===\"Infinity\")return cs;if(e===\"-Infinity\")return bc;let t=Tj.exec(e);if(!t)break;let[r,n,o]=t;if(o===\"nano\"||o===\"nanos\")return Po(xA(n,SA));if(o===\"micro\"||o===\"micros\")return Po(xA(n,hy));let s=Number(n);switch(o){case\"milli\":case\"millis\":return Hs(s);case\"second\":case\"seconds\":return gy(s);case\"minute\":case\"minutes\":return Oj(s);case\"hour\":case\"hours\":return _j(s);case\"day\":case\"days\":return Rj(s);case\"week\":case\"weeks\":return Pj(s)}break}case\"object\":{if(e===null)break;if(jd in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(yf)?gA(e):Number.isNaN(e[0])||Number.isNaN(e[1])?qs:e[0]===-1/0||e[1]===-1/0?bc:e[0]===1/0||e[1]===1/0?cs:or(zd(e[0]*1e9+e[1]));let t=e,r=0;return t.weeks&&(r+=t.weeks*6048e5),t.days&&(r+=t.days*864e5),t.hours&&(r+=t.hours*36e5),t.minutes&&(r+=t.minutes*6e4),t.seconds&&(r+=t.seconds*1e3),t.milliseconds&&(r+=t.milliseconds),!t.microseconds&&!t.nanoseconds?or(r):or(zd(r*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return gA(e)},gA=e=>{throw new Error(`Invalid Input: ${e}`)},EA=Ln(We),yA={_tag:\"Millis\",millis:0},wj={_tag:\"Infinity\"},Cj={_tag:\"NegativeInfinity\"},Aj={[jd]:jd,[se](){switch(this.value._tag){case\"Millis\":{let e=this.value.millis*1e6;return Number.isFinite(e)?H(zd(e)):It(this.value.millis)}case\"Nanos\":return H(this.value.nanos);default:return bf(this.value)}},[ae](e){return xy(e)&&Fj(this,e)},toString(){switch(this.value._tag){case\"Infinity\":return\"Infinity\";case\"NegativeInfinity\":return\"-Infinity\";case\"Nanos\":return`${this.value.nanos} nanos`;case\"Millis\":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case\"Millis\":return{_id:\"Duration\",_tag:\"Millis\",millis:this.value.millis};case\"Nanos\":return{_id:\"Duration\",_tag:\"Nanos\",nanos:String(this.value.nanos)};case\"Infinity\":return{_id:\"Duration\",_tag:\"Infinity\"};case\"NegativeInfinity\":return{_id:\"Duration\",_tag:\"NegativeInfinity\"}}},[Ie](){return this.toJSON()},pipe(){return Z(this,arguments)}},or=e=>{let t=Object.create(Aj);return typeof e==\"number\"?isNaN(e)||e===0||Object.is(e,-0)?t.value=yA:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:\"Millis\",millis:e}:t.value={_tag:\"Nanos\",nanos:bA(e)}:t.value=e>0?wj:Cj:e===Ec?t.value=yA:t.value={_tag:\"Nanos\",nanos:e},t},xy=e=>A(e,jd),Ws=e=>e.value._tag!==\"Infinity\"&&e.value._tag!==\"NegativeInfinity\",Ic=e=>{switch(e.value._tag){case\"Millis\":return e.value.millis===0;case\"Nanos\":return e.value.nanos===Ec;case\"Infinity\":case\"NegativeInfinity\":return!1}},kj=e=>{switch(e.value._tag){case\"Millis\":return e.value.millis<0;case\"Nanos\":return e.value.nanos{switch(e.value._tag){case\"Infinity\":case\"NegativeInfinity\":return cs;case\"Millis\":return e.value.millis<0?or(-e.value.millis):e;case\"Nanos\":return e.value.nanosor(e);var Hs=e=>or(e),gy=e=>or(e*1e3),Oj=e=>or(e*6e4),_j=e=>or(e*36e5),Rj=e=>or(e*864e5),Pj=e=>or(e*6048e5),kr=e=>wA(We(e),{onMillis:R,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),IA=e=>wA(We(e),{onMillis:t=>t/1e3,onNanos:t=>Number(t)/1e9,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var qd=e=>{let t=We(e);switch(t.value._tag){case\"Infinity\":case\"NegativeInfinity\":throw new Error(\"Cannot convert infinite duration to nanos\");case\"Nanos\":return t.value.nanos;case\"Millis\":return bA(t.value.millis)}},TA=Ln(qd);var wA=l(2,(e,t)=>{switch(e.value._tag){case\"Millis\":return t.onMillis(e.value.millis);case\"Nanos\":return t.onNanos(e.value.nanos);case\"Infinity\":return t.onInfinity();case\"NegativeInfinity\":return(t.onNegativeInfinity??t.onInfinity)()}}),CA=l(3,(e,t,r)=>e.value._tag===\"Infinity\"||e.value._tag===\"NegativeInfinity\"||t.value._tag===\"Infinity\"||t.value._tag===\"NegativeInfinity\"?r.onInfinity(e,t):e.value._tag===\"Millis\"?t.value._tag===\"Millis\"?r.onMillis(e.value.millis,t.value.millis):r.onNanos(qd(e),t.value.nanos):r.onNanos(e.value.nanos,qd(t)));var Mj=(e,t)=>CA(e,t,{onMillis:(r,n)=>r===n,onNanos:(r,n)=>r===n,onInfinity:(r,n)=>r.value._tag===n.value._tag});var AA=l(2,(e,t)=>CA(e,t,{onMillis:(r,n)=>or(r-n),onNanos:(r,n)=>or(r-n),onInfinity:(r,n)=>{let o=r.value._tag,s=n.value._tag;return o===\"Infinity\"?s===\"Infinity\"?qs:cs:o===\"NegativeInfinity\"?s===\"NegativeInfinity\"?qs:bc:s===\"Infinity\"?bc:cs}}));var Fj=l(2,(e,t)=>Mj(e,t)),Nj=e=>{if(e.value._tag===\"Infinity\")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};if(e.value._tag===\"NegativeInfinity\")return{days:-1/0,hours:-1/0,minutes:-1/0,seconds:-1/0,millis:-1/0,nanos:-1/0};let t=qd(e),r=t{if(e.value._tag===\"Infinity\")return\"Infinity\";if(e.value._tag===\"NegativeInfinity\")return\"-Infinity\";if(Ic(e))return\"0\";if(kj(e))return\"-\"+yy(vj(e));let t=Nj(e),r=[];return t.days!==0&&r.push(`${t.days}d`),t.hours!==0&&r.push(`${t.hours}h`),t.minutes!==0&&r.push(`${t.minutes}m`),t.seconds!==0&&r.push(`${t.seconds}s`),t.millis!==0&&r.push(`${t.millis}ms`),t.nanos!==0&&r.push(`${t.nanos}ns`),r.join(\" \")};var Sy=l(2,(e,t)=>r=>{let n=e(r);if(ce(n))return K(r);let o=t(n.success);return ce(o)?K(r):o}),kA=e=>t=>{let r=e(t);return ce(r)?v():O(r.success)};var $f=Te(\"effect/Scheduler\",{fiberCached:!0,defaultValue:()=>new Ga}),OA=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Uj=\"setImmediate\"in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},_A=e=>{try{return Uj(e)}catch{return OA(e)}},by=class{buckets=[];scheduleTask(t,r){let n=this.buckets,o=n.length,s,a=0;for(;ar);a++)s=n[a];s&&s[0]===r?s[1].push(t):a===o?n.push([r,[t]]):n.splice(a,0,[r,[t]])}drain(){let t=this.buckets;return this.buckets=[],t}},Ga=class{executionMode;setImmediate;constructor(t=\"async\",r){this.executionMode=t,this.setImmediate=r??(t===\"sync\"?OA:_A)}shouldYield(t){return t.currentOpCount>=t.cache.maxOpsBeforeYield}makeDispatcher(){return new Ey(this.setImmediate)}},Ey=class{tasks=new by;running=void 0;setImmediate;constructor(t=_A){this.setImmediate=t}scheduleTask(t,r){this.tasks.scheduleTask(t,r),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let t=this.tasks.drain();for(let r=0;r0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},RA=Te(\"effect/Scheduler/MaxOpsBeforeYield\",{fiberCached:!0,defaultValue:()=>2048}),PA=Te(\"effect/Scheduler/PreventSchedulerYield\",{fiberCached:!0,defaultValue:()=>!1});var Tn={};Eo(Tn,{Class:()=>Hd,Error:()=>Wd,TaggedClass:()=>Dj,TaggedError:()=>Fr,taggedEnum:()=>Lj});var Hd=class extends Us{constructor(e){super(),e&&ld(this,e)}},Dj=e=>class extends Hd{_tag=e},Lj=()=>new Proxy({},{get(e,t,r){return t===\"$is\"?Ct:t===\"$match\"?$j:n=>({...n,_tag:t})}});function $j(){if(arguments.length===1){let r=arguments[0];return function(n){return r[n._tag](n)}}let e=arguments[0];return arguments[1][e._tag](e)}var Wd=Af,Fr=as;var MA=\"~effect/encoding/EncodingError\",wn=class extends Fr(\"EncodingError\"){[MA]=MA};var UA=e=>FA(typeof e==\"string\"?qj.encode(e):e),Ty=e=>{switch(e){case 16:return jj();case 32:return zj();default:{let t=\"\";for(let r=e>>>3;r>0;r--)t+=Bj();return t}}},X=Uint8Array.from(\"0123456789abcdef\",e=>e.charCodeAt(0)),Va=()=>Math.random()*4294967296>>>0,Bj=()=>{let e=Va();return String.fromCharCode(X[e>>>28],X[e>>>24&15],X[e>>>20&15],X[e>>>16&15],X[e>>>12&15],X[e>>>8&15],X[e>>>4&15],X[e&15])},jj=()=>{let e=Va(),t=Va();return String.fromCharCode(X[e>>>28],X[e>>>24&15],X[e>>>20&15],X[e>>>16&15],X[e>>>12&15],X[e>>>8&15],X[e>>>4&15],X[e&15],X[t>>>28],X[t>>>24&15],X[t>>>20&15],X[t>>>16&15],X[t>>>12&15],X[t>>>8&15],X[t>>>4&15],X[t&15])},zj=()=>{let e=Va(),t=Va(),r=Va(),n=Va();return String.fromCharCode(X[e>>>28],X[e>>>24&15],X[e>>>20&15],X[e>>>16&15],X[e>>>12&15],X[e>>>8&15],X[e>>>4&15],X[e&15],X[t>>>28],X[t>>>24&15],X[t>>>20&15],X[t>>>16&15],X[t>>>12&15],X[t>>>8&15],X[t>>>4&15],X[t&15],X[r>>>28],X[r>>>24&15],X[r>>>20&15],X[r>>>16&15],X[r>>>12&15],X[r>>>8&15],X[r>>>4&15],X[r&15],X[n>>>28],X[n>>>24&15],X[n>>>20&15],X[n>>>16&15],X[n>>>12&15],X[n>>>8&15],X[n>>>4&15],X[n&15])},wy=e=>{let t=new TextEncoder().encode(e);if(t.length%2!==0)return K(new wn({module:\"Hex\",kind:\"Decode\",input:e,message:`Length must be a multiple of 2, but is ${t.length}`}));try{let r=t.length/2,n=new Uint8Array(r);for(let o=0;oCr(wy(e),t=>Hj.decode(t)),qj=new TextEncoder,Hj=new TextDecoder,Wj=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\")),FA=e=>{let t=\"\";for(let r=0;r{if(48<=e&&e<=57)return e-48;if(97<=e&&e<=102)return e-97+10;if(65<=e&&e<=70)return e-65+10;throw new TypeError(\"Invalid input\")};var Ay=\"effect/Tracer/ParentSpan\",Za=class extends fr()(Ay,{fiberCached:!0}){},Jj=e=>e;var Jd=Te(\"effect/Tracer/DisablePropagation\",{defaultValue:hf}),$A=Te(\"effect/Tracer/CurrentTraceLevel\",{defaultValue:()=>\"Info\"}),BA=Te(\"effect/Tracer/MinimumTraceLevel\",{defaultValue:()=>\"All\"}),ky=\"effect/Tracer\",vy=Te(ky,{fiberCached:!0,defaultValue:()=>Oy}),Oy=Jj({span:e=>new Cy(e)}),Cy=class{_tag=\"Span\";sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(t){this.name=t.name,this.parent=t.parent,this.annotations=t.annotations,this.links=t.links,this.startTime=t.startTime,this.kind=t.kind,this.sampled=t.sampled,this.status={_tag:\"Started\",startTime:t.startTime}}get traceId(){return this._traceId??=js(this.parent)?.traceId??Ty(32)}get spanId(){return this._spanId??=Ty(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(t,r){this.status={_tag:\"Ended\",endTime:t,exit:r,startTime:this.status.startTime}}attribute(t,r){this.attributes.set(t,r)}event(t,r,n){this.events.push([t,r,n??{}])}addLinks(t){this.links.push(...t)}};var zA=\"effect/Metric/FiberRuntimeMetrics\";var qA=Te(\"effect/ErrorReporter/CurrentErrorReporters\",{defaultValue:()=>new Set}),Bf=Te(\"effect/References/CurrentStackFrame\",{fiberCached:!0,defaultValue:Sn}),Kd=Te(\"effect/References/TracerEnabled\",{fiberCached:!0,defaultValue:Er}),Ya=Te(\"effect/References/TracerTimingEnabled\",{defaultValue:Er}),jf=Te(\"effect/References/TracerSpanAnnotations\",{defaultValue:()=>({})}),zf=Te(\"effect/References/TracerSpanLinks\",{defaultValue:()=>[]}),us=Te(\"effect/References/CurrentLogAnnotations\",{defaultValue:()=>({})}),_y=Te(\"effect/References/CurrentLogLevel\",{fiberCached:!0,defaultValue:()=>\"Info\"}),Ry=Te(\"effect/References/MinimumLogLevel\",{fiberCached:!0,defaultValue:()=>\"Info\"});var Gd=Te(\"effect/References/CurrentLogSpans\",{defaultValue:()=>[]});var Js=e=>{if(e?.captureStackTrace===!1)return e;if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=\"boolean\")return e;let t=Co();if(t===0&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};Qr(3);let r=new Error;return Qr(t),{...e,captureStackTrace:Vj(()=>r.stack)}},Py=e=>t=>{let r;return()=>{if(r!==void 0)return r;let n=t();if(!n)return;let o=n.split(`\n`);if(o[e]!==void 0)return r=o[e].trim(),r}},Vj=Py(3);var Vd=class extends uc{constructor(t,r=Cf){super(\"Interrupt\",r,\"Interrupted\"),this.fiberId=t}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:\"Interrupt\",fiberId:this.fiberId}}[ae](t){return Ba(t)&&this.fiberId===t.fiberId&&this.annotations===t.annotations}[se](){return fe(_e(`${this._tag}:${this.fiberId}`))(ad(this.annotations))}},YA=e=>new Vd(e),Gs=e=>new Ao([new Vd(e)]),zy=e=>e.reasons.some(ss),qy=e=>{let t=e.reasons.find(ss);return t?B(t):K(e)},Cn=e=>{for(let t=0;te.reasons.some($a),XA=e=>{let t=e.reasons.find($a);return t?B(t):K(e)},Qf=e=>{let t=e.reasons.find($a);return t?B(t.defect):K(e)},rm=e=>e.reasons.some(Ba),ek=e=>{let t=e.reasons.find(Ba);return t?B(t):K(e)},nm=e=>{let t;for(let r=0;r{let t=nm(e);return ce(t)?Zj:t.success},Zj=new Set,rk=e=>e.reasons.length>0&&e.reasons.every(Ba),nk=e=>_o(e.annotations),ok=e=>{let t=new Map;for(let r of e.reasons)if(r.annotations.size>0)for(let[n,o]of r.annotations)t.set(n,o);return _o(t)},sk=l(2,(e,t)=>{let r=!1,n=e.reasons.map(o=>ss(o)?(r=!0,new Na(t(o.error),o.annotations)):o);return r?os(n):e}),om=e=>{let t;for(let r of e.reasons){if(r._tag===\"Fail\")return r.error;r._tag===\"Die\"&&(t??=r)}return t!==void 0?t.defect:e.reasons.length>0?new globalThis.Error(\"All fibers interrupted without error\"):new globalThis.Error(\"Empty cause\")},Hy=(e,t)=>{let r=[],n=[];if(e.reasons.length===0)return r;let o=Co();o!==0&&Qr(1);try{for(let s of e.reasons){if(s._tag===\"Interrupt\"){n.push(s);continue}r.push(Fy(s._tag===\"Die\"?s.defect:s.error,s.annotations,t))}if(r.length===0){let s=new Error(\"The fiber was interrupted by:\");s.name=\"InterruptCause\",s.stack=ez(s,n);let a=new globalThis.Error(\"All fibers interrupted without error\",{cause:s});a.name=\"InterruptError\",a.stack=`${a.name}: ${a.message}`,r.push(Fy(a,n[0].annotations,t))}}finally{o!==0&&Qr(o)}return r},Fy=(e,t,r)=>{let n=typeof e,o;if(e&&n===\"object\"){if(o=new globalThis.Error(Yj(e),{cause:e.cause?Fy(e.cause):void 0}),typeof e.name==\"string\"&&(o.name=e.name),typeof e.stack==\"string\")o.stack=Xj(e.stack,o,t);else{let s=`${o.name}: ${o.message}`;o.stack=t?ak(s,t):s}r?.includeCauseInStack&&(o.stack=ck(o));for(let s of Object.keys(e))s in o||(o[s]=e[s])}else o=new globalThis.Error(e?n===\"string\"?e:Pa(e):`Unknown error: ${e}`);return o},Yj=e=>{if(typeof e.message==\"string\")return e.message;if(typeof e.toString==\"function\"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Pa(e)},Qj=/\\((.*)\\)/g,Xj=(e,t,r)=>{let n=`${t.name}: ${t.message}`,o=(e.startsWith(n)?e.slice(n.length):e).split(`\n`),s=[n];for(let a=1;a{let r=t?.get(dd.key);return r&&(e=`${e}\n${ik(r)}`),e},ez=(e,t)=>{let r=[`${e.name}: ${e.message}`];for(let n of t){let o=n.fiberId!==void 0?`#${n.fiberId}`:\"unknown\",s=n.annotations.get(Vg.key);r.push(` at fiber (${o})`),s&&r.push(ik(s))}return r.join(`\n`)},ik=e=>{let t=[],r=e,n=0;for(;r&&n<10;){let o=r.stack();if(o){let s=o.matchAll(Qj),a=!1;for(let[,i]of s)a=!0,t.push(` at ${r.name} (${i})`);a||t.push(` at ${r.name} (${o.replace(/^at /,\"\")})`)}else t.push(` at ${r.name}`);r=r.parent,n++}return t.join(`\n`)},sm=e=>Hy(e).map(ck).join(`\n`),ck=e=>e.cause?`${e.stack} {\n${uk(e.cause,\" \")}\n}`:e.stack,uk=(e,t)=>{let r=e.stack.split(`\n`),n=`${t}[cause]: ${r[0]}`;for(let o=1,s=r.length;o{try{return globalThis.process?.getBuiltinModule?.(\"node:async_hooks\")?.AsyncResource}catch{return}})(),fk=()=>HA===void 0?void 0:new HA(\"effect/Fiber\"),fs=()=>globalThis[ac],Zd=class{constructor(t,r=!0){this.setContext(t),this.id=++rz.id,this.currentOpCount=0,this.interruptible=r,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[Wy](){return tz}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(t){return Fe(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Un):(this._observers===void 0?this._observers=[t]:this._observers.push(t),()=>this.removeObserver(t))}removeObserver(t){if(this._exit||this._observers===void 0)return;let r=this._observers.indexOf(t);r>=0&&this._observers.splice(r,1)}interruptUnsafe(t,r){if(this._exit)return;let n=Gs(t);this.cache.stackFrame&&(n=pc(n,Ja(dd,this.cache.stackFrame))),r&&(n=pc(n,r)),this._interruptedCause=this._interruptedCause?La(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Ue(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(t){if(this._exit)return;if(this._asyncContext!==void 0){let o=this._asyncContext;return this._asyncContext=void 0,o.runInAsyncScope(this.evaluate,this,t)}else if(this._yielded!==void 0){let o=this._yielded;this._yielded=void 0,o()}let r=this.runLoop(t);if(r===Da){this._asyncContext=fk();return}let n=Ny.interruptChildren&&Ny.interruptChildren(this);if(n!==void 0)return this.evaluate(V(n,()=>r));if(this._exit=r,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&(this._parent._children?.delete(this),this._parent=void 0),this._observers!==void 0){let o=this._observers;this._observers=void 0;for(let s=0;si)}if(s=a.tracerContext?a.tracerContext(s,this):s[tt](this),s===Da){let i=this._yielded;if(Ma in i)return this._deferredInterrupt=!1,this._yielded=void 0,i;if(this._deferredInterrupt){this._yielded=void 0,i();continue}return Da}}}catch(a){return A(s,tt)?this.runLoop(Tr(a)):Tr(`Fiber.runLoop: Not a valid effect: ${String(s)}`)}finally{this._running=n,globalThis[ac]=r}}getCont(t){if(this._deferredInterrupt)return this._deferredInterrupt=!1,oz;for(;;){let r=this._stack.pop();if(!r)return;let n=r[Fa];if(n!==void 0){let o=n.call(r,this);if(o)return o[t]=o,o}if(r[t])return r}}succeedWith(t){if((++this.currentOpCount&sz-1)===0)return we(t);let r=this.getCont(Ot);return r?r[Ot](t,this):this.yieldWith(we(t))}yieldWith(t){return this._yielded=t,Da}children(){return this._children??=new Set}pipe(){return Z(this,arguments)}setContext(t){let r=this.context;if(this.context=t,r!==void 0&&YC(r,t))return;let n=t.cacheRoot,o=n._fiberCache??=nz(t);this.cache?.scheduler!==o.scheduler&&(this._dispatcher=void 0),this.cache=o}get currentSpanLocal(){let t=this.cache.span;return t?._tag===\"Span\"?t:void 0}},nz=e=>{let t=Ff(e,ky);return{scheduler:Fe(e,$f),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Fe(e,Kd),span:Ff(e,Ay),logLevel:Fe(e,_y),minimumLogLevel:Fe(e,Ry),stackFrame:Fe(e,Bf),runtimeMetrics:Ff(e,zA),maxOpsBeforeYield:Fe(e,RA),preventYield:Fe(e,PA)}},oz={[Ot](e,t){return Ue(t._interruptedCause)},[Xr](e,t){return Ue(t._interruptedCause)}},sz=32,Ny={interruptChildren:void 0},am=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Vg.key,e.cache.stackFrame),_o(t)},az=e=>{if(!(e._children===void 0||e._children.size===0))return Tc(e._children)},Jy=e=>{let t=e;return t._exit?D(t._exit):mt(r=>t._exit?r(D(t._exit)):z(e.addObserver(n=>r(D(n)))))},im=e=>mt(t=>{let r=e[Symbol.iterator](),n=[],o;function s(){let a=r.next();for(;!a.done;){if(a.value._exit){n.push(a.value._exit),a=r.next();continue}o=a.value.addObserver(i=>{n.push(i),s()});return}t(D(n))}return s(),z(()=>o?.())}),Ky=e=>{let t=e;return t._exit?t._exit:mt(r=>t._exit?r(t._exit):z(e.addObserver(r)))},lk=e=>mt(t=>{let r=Array.from(e);if(r.length===0)return t(D(Rt()));let n=new Array(r.length),o=Rt(),s=()=>{for(let c=0;c{if(a++,f._tag===\"Failure\")return i=!0,s(),t(f);n[c]=f.value,a===r.length&&t(D(n))};o.push(u),r[c].addObserver(u)}return z(()=>{i=!0,s()})}),Xf=e=>ne(t=>pk(e,t.id)),pk=l(e=>A(e[0],Wy),(e,t,r)=>ne(n=>{let o=am(n);return o=o&&r?Md(o,r):o??r,e.interruptUnsafe(t,o),el(Jy(e))})),Tc=e=>ne(t=>{let r=am(t),n=Rt();for(let o of e)o.interruptUnsafe(t.id,r),n.push(o);return el(im(n))});var D=we,Ue=qt,Je=tn,z=vo({op:\"Sync\",[tt](e){let t=this[pe](),r=e.getCont(Ot);return r?r[Ot](t,e):e.yieldWith(we(t))}}),re=vo({op:\"Suspend\",[tt](e){return this[pe]()}}),Gy=l(e=>e.length>=2||yc(e[0]),(e,t)=>ue(e)?Je(t?t():new Dn(\"Effect.fromOption: Option.none\")):D(e.value)),Ac=Ar({onFailure:Je,onSuccess:D}),dk=e=>e==null?Je(new Dn):D(e),Vy=vo({op:\"Yield\",[tt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(lr)},this[pe]??0),e.yieldWith(()=>{t=!0})}}),kc=Vy(0),Zy=e=>D(O(e)),ei=D(v()),mk=e=>ue(e)?ei:Re(e.value,O),hk=e=>re(()=>Ue(e())),Vs=e=>Tr(e),cm=e=>re(()=>Je(e())),le=D(void 0);var xk=e=>{let t=typeof e==\"function\"?e:e.try,r=typeof e==\"function\"?n=>new Cc(n,\"An error occurred in Effect.try\"):e.catch;return re(()=>{try{return D(t())}catch(n){return Je(r(n))}})};var Yy=e=>Qy(function(t,r){e(r).then(n=>t(D(n)),n=>t(Vs(n)))},e.length!==0),gk=e=>{let t=typeof e==\"function\"?e:e.try,r=typeof e==\"function\"?n=>new Cc(n,\"An error occurred in Effect.tryPromise\"):e.catch;return Qy(function(n,o){let s=a=>re(()=>{try{return Je($s(()=>r(a)))}catch(i){return Vs(i)}});try{t(o).then(a=>n(D(a)),a=>n(s(a)))}catch(a){n(s(a))}},t.length!==0)},yk=e=>ne(t=>e(t.id)),Sk=ne(D),bk=yk(D),Qy=(function(){let e=en({op:\"Async\",[tt](r){let n=!1,o=!1,s=this.withSignal?new AbortController:void 0,a=this.register.call(r.cache.scheduler,i=>{n||(n=!0,o?r.evaluate(i):o=i)},s?.signal);return o!==!1?o:(o=!0,r._yielded=()=>{n=!0},s===void 0&&a===void 0?Da:(r._stack.push(iz(()=>(n=!0,s?.abort(),a??lr))),Da))}}),t=function(r,n){this.register=r,this.withSignal=n};return t.prototype=e,function(r,n){return new t(r,n)}})(),iz=vo({op:\"AsyncFinalizer\",[Fa](e){e.interruptible&&(e.interruptible=!1,e._stack.push(il))},[Xr](e,t){return rm(e)?V(Cv(qt(e),this[pe]()),()=>Ue(e)):Ue(e)}}),mt=e=>Qy(e,e.length>=2),um=mt(Un),Ek=(...e)=>{if(e.length===1){let n=e[0];return re(()=>Xa(n()))}let[t,r]=e;return re(()=>Xa(r.call(t.self)))},Xy=(e,...t)=>{let r=t.length===0?function(){return re(()=>Xa(e.apply(this,arguments)))}:function(){let n=re(()=>Xa(e.apply(this,arguments)));for(let o=0;oObject.defineProperty(t,\"length\",{value:e,configurable:!0}),WA=Py(2),Ik=function(){let e=typeof arguments[0]==\"string\",t=e?arguments[0]:\"Effect.fn\",r=e?arguments[1]:void 0,n=Co(),o;return n!==0&&(Qr(2),o=new globalThis.Error,Qr(n)),e?(s,...a)=>JA(t,s,o,a,e,r):JA(t,arguments[0],o,Array.prototype.slice.call(arguments,1),e,r)},JA=(e,t,r,n,o,s)=>{let a=typeof t==\"function\"?t:n.shift().bind(t.self),i=`${e} (definition)`,c=r?WA(()=>r.stack):Sn;return eS(a.length,function(...u){let f=re(()=>{let m=a.apply(this,arguments);return ie(m)?m:Xa(m)});for(let m=0;mBy(f,m)):f,Bf,m=>({name:e,stack:d?WA(()=>d.stack):Sn,parent:{name:i,stack:c,parent:m}}))})},Tk=(e,...t)=>eS(e.length,t.length===0?function(){return KA(()=>e.apply(this,arguments))}:function(){let r=KA(()=>e.apply(this,arguments));for(let n of t)r=n(r,...arguments);return r}),KA=e=>{try{let t=e(),r;for(;;){let n=t.next(r);if(n.done)return D(n.value);let o=n.value;if(o&&o._tag===\"Success\"){r=o.value;continue}else{if(o&&o._tag===\"Failure\")return n.value;{let s=!0;return re(()=>s?(s=!1,V(n.value,a=>Xa(t,a))):re(()=>Xa(e())))}}}}catch(t){return Vs(t)}},Xa=(function(){let e=en({op:\"Iterator\",[Ot](r,n){let o=this.iterator;for(;;){let s=o.next(r);if(s.done)return D(s.value);if(De(s.value)){if(s.value._tag===\"Failure\")return s.value}else return n._stack.push(this),s.value;r=s.value.value}},[tt](r){return this[Ot](this.initial,r)}}),t=function(r,n){this.iterator=r,this.initial=n};return t.prototype=e,function(r,n){return new t(r,n)}})(),vr=l(2,(e,t)=>new ls(e,tS,D(t))),fm=function(e){return e._stack.push(this),this[pe]},cz=en({op:\"OnSuccess\",[tt]:fm}),ls=function(e,t,r){this[pe]=e,this[Ot]=t,this.payload=r};ls.prototype=cz;var tS=function(){return this.payload},wk=function(e,t){return t.succeedWith(this.payload)},lm=(()=>{let e=\"~effect/Effect/stackProbe\";return{[e]:function(){return new Error().stack}}[e]()?.includes(\"[as \"+e+\"]\")===!0})(),uz=function(e,t){let r=this.payload;return t.succeedWith(lm?r(e):$s(()=>r(e)))},Ck=function(e){let t=this.payload;return t(e)},fz=function(e){let t=this.payload;return new ls(t(e),wk,e)},lz=function(e){return new ls(this.payload,wk,e)},vc=e=>Re(e,O),Ak=e=>Pc(e,{onFailure:D,onSuccess:Je}),No=l(2,(e,t)=>new ls(e,ie(t)?tS:Ck,t)),ti=l(2,(e,t)=>new ls(e,ie(t)?lz:fz,t)),el=e=>new ls(e,tS,lr),kk=e=>nn(e,Je),rS=(e,t)=>ne(r=>{let n=new Set;return Fc(r,()=>n.size===0?void 0:Tc(n)),mt(o=>{let s=Ve(e),a=s.length,i=0,c=!1,u=[],f=(p,d,m)=>{if(i++,p._tag===\"Failure\"){u.push(...p.cause.reasons),i>=a&&o(Ue(os(u)));return}let x=!c;c=!0,o(p),x&&t?.onWinner&&t.onWinner({fiber:d,index:m,parentFiber:r})};for(let p=0;p{n.delete(d),f(m,d,p)}),c)break}})}),nS=(e,t)=>ne(r=>{let n=new Set;return Fc(r,()=>n.size===0?void 0:Tc(n)),mt(o=>{let s=!1,a=0;for(let i of e){if(s)break;let c=a++,u=ea(r,i,!0,!0,!1);n.add(u),u.addObserver(f=>{n.delete(u);let p=!s;s=!0,o(f),p&&t?.onWinner&&t.onWinner({fiber:u,index:c,parentFiber:r})})}})}),vk=l(e=>ie(e[1]),(e,t,r)=>rS([e,t],r)),oS=l(e=>ie(e[1]),(e,t,r)=>nS([e,t],r)),V=l(2,(e,t)=>new ls(e,Ck,t)),Ok=l(2,(e,t)=>De(e)?e._tag===\"Success\"?t.onSuccess(e.value):t.onFailure(e.cause):Fo(e,t)),De=e=>e[Ma]!==void 0,_k=l(2,(e,t)=>De(e)?e._tag===\"Success\"?t(e.value):e:V(e,t)),Rk=e=>V(e,R),Re=l(2,(e,t)=>new ls(e,uz,t)),Pk=l(2,(e,t)=>De(e)?cS(e,t):Re(e,t)),Mk=l(2,(e,t)=>De(e)?uS(e,t):yS(e,t)),Fk=l(2,(e,t)=>De(e)?fS(e,t):SS(e,t)),Nk=l(2,(e,t)=>{if(De(e)){if(e._tag===\"Success\")return e;let r=Cn(e.cause);return ce(r)?e:t(r.success)}return on(e,t)}),Oc=e=>qt(Gs(e)),Zs=e=>e._tag===\"Success\",Uk=e=>e._tag===\"Success\"?B(e):K(e),Dk=e=>e._tag===\"Success\"?B(e.value):K(e),sS=e=>e._tag===\"Failure\",Lk=e=>e._tag===\"Failure\"?B(e):K(e),tl=e=>e._tag===\"Failure\"?B(e.cause):K(e),aS=Sy(tl,Cn),$k=Sy(tl,Qf),iS=e=>e._tag===\"Failure\"&&rm(e.cause),Bk=e=>e._tag===\"Failure\"&&tm(e.cause),jk=e=>e._tag===\"Failure\"&&zy(e.cause),lr=we(void 0),cS=l(2,(e,t)=>e._tag===\"Success\"?we(t(e.value)):e),uS=l(2,(e,t)=>{if(e._tag===\"Success\")return e;let r=Cn(e.cause);return ce(r)?e:tn(t(r.success))}),fS=l(2,(e,t)=>{if(e._tag===\"Success\")return we(t.onSuccess(e.value));let r=Cn(e.cause);return ce(r)?e:tn(t.onFailure(r.success))}),pz=l(2,(e,t)=>Zs(e)?we(t):e),zk=l(2,(e,t)=>Zs(e)?t:e),qk=l(2,(e,t)=>Zs(e)?t.onSuccess(e.value):t.onFailure(e.cause)),Hk=pz(void 0),lS=e=>{let t=[];for(let r of e)r._tag===\"Failure\"&&t.push(...r.cause.reasons);return t.length===0?lr:qt(os(t))},Wk=e=>Zs(e)?O(e.value):v(),Jk=e=>sS(e)?O(e.cause):v(),Kk=e=>{let t=aS(e);return ce(t)?v():O(t.success)},Gk=e=>e,Vk=e=>ne(t=>D(Pd(t.context,e))),dz=e=>ne(t=>Gy(Pd(t.context,e))),_c=l(2,(e,t)=>ne(r=>{let n=r.context,o=t(n);return n===o||(r.setContext(o),Fc(r,()=>{r.setContext(n)})),e})),ps=l(3,(e,t,r)=>_c(e,n=>{let o=Ro(n,t),s=r(o);return o===s?n:Wt(n,t,s)})),Zk=(e,t,r)=>ni(ne(n=>{let o=Ro(n.context,e),s=t(o);return n.setContext(Wt(n.context,e,s)),Xs(Ro(n.context,Qs),a=>{let i=Pd(n.context,e);if(ue(i))return le;let c=i.value,u;if(r?.reset===void 0){if(c!==s)return le;u=o}else u=r.reset(o,s,c);return n.setContext(Wt(n.context,e,u)),le})})),pS=()=>mz,mz=ne(e=>D(e.context)),Ys=e=>ne(t=>e(t.context)),Yk=l(2,(e,t)=>_c(e,je(t))),$n=l(2,(e,t)=>De(e)?e:_c(e,Md(t))),Or=function(){return arguments.length===1?l(2,(e,t)=>GA(e,arguments[0],t)):l(3,(e,t,r)=>GA(e,t,r)).apply(this,arguments)},GA=(e,t,r)=>_c(e,Wt(t,r)),pm=l(3,(e,t,r)=>V(r,n=>Or(e,t,n))),Qk=l(e=>ie(e[1]),(e,t,r)=>dS(e,t,(n,o)=>[n,o],r)),dS=l(e=>ie(e[1]),(e,t,r,n)=>n?.concurrent?Re(cl([e,t],{concurrency:2}),([o,s])=>r(o,s)):V(e,o=>Re(t,s=>r(o,s)))),Xk=l(e=>ie(e[0]),(e,t,r)=>NS(e,t,r?n=>Je(r(n)):()=>Je(new Dn))),ev=l(2,(e,t)=>V(t,r=>r?vc(e):ei)),mS=l(2,(e,t)=>Array.from({length:t},()=>e)),tv=l(e=>ie(e[0]),(e,t,r)=>cl(mS(e,t),r)),dm=l(e=>ie(e[0]),(e,t)=>Uo({while:Er,body:je(t?.disableYield?e:V(e,r=>kc)),step:Un})),nn=l(2,(e,t)=>new rv(e,t.length!==1?r=>t(r):t)),hz=en({op:\"OnFailure\",[tt]:fm}),rv=function(e,t){this[pe]=e,this[Xr]=t};rv.prototype=hz;var hS=l(3,(e,t,r)=>nn(e,n=>t(n)?r(n):Ue(n))),Rc=l(3,(e,t,r)=>nn(e,n=>{let o=t(n);return ce(o)?Ue(o.failure):r(o.success,n)})),on=l(2,(e,t)=>Rc(e,Cn,r=>t(r))),nv=e=>Pc(e,{onFailure:t=>md(t)?ei:Je(t),onSuccess:Zy}),ov=l(2,(e,t)=>Rc(e,Qf,t)),sv=l(2,(e,t)=>nn(e,r=>No(t(r),Ue(r)))),av=l(3,(e,t,r)=>hS(e,t,n=>No(r(n),Ue(n)))),mm=l(3,(e,t,r)=>nn(e,n=>{let o=t(n);return ce(o)?Ue(n):No(r(o.success,n),Ue(n))})),xS=l(2,(e,t)=>mm(e,Cn,r=>t(r))),iv=l(3,(e,t,r)=>{let n=Array.isArray(t)?o=>A(o,\"_tag\")&&t.includes(o._tag):Ct(t);return xS(e,o=>n(o)?r(o):le)}),cv=l(2,(e,t)=>mm(e,Qf,r=>t(r))),rl=l(e=>ie(e[0]),(e,t,r,n)=>nn(e,o=>{let s=Cn(o);return ce(s)?Ue(s.failure):t(s.success)?r(s.success):n?n(s.success):Ue(o)})),hm=l(e=>ie(e[0]),(e,t,r,n)=>nn(e,o=>{let s=Cn(o);if(ce(s))return Ue(s.failure);let a=t(s.success);return ce(a)?n?n(a.failure):Ue(o):r(a.success)})),gS=l(e=>ie(e[0]),(e,t,r,n)=>{let o=Array.isArray(t)?s=>A(s,\"_tag\")&&t.includes(s._tag):Ct(t);return rl(e,o,r,n)}),uv=l(e=>ie(e[0]),(e,t,r)=>{let n;return hm(e,o=>(n??=Object.keys(t),A(o,\"_tag\")&&Ir(o._tag)&&n.includes(o._tag)?B(o):K(o)),o=>t[o._tag](o),r)}),fv=l(e=>ie(e[0]),(e,t,r,n,o)=>rl(e,s=>Ct(s,t)&&A(s,\"reason\")&&(o!==void 0||Ct(s.reason,r)),s=>{let a=s.reason;return Ct(a,r)?n(a,s):o?o(a,s):Je(s)})),lv=l(e=>ie(e[0]),(e,t,r,n)=>{let o;return rl(e,s=>Ct(s,t)&&A(s,\"reason\")&&A(s.reason,\"_tag\")&&Ir(s.reason._tag)&&(n!==void 0||(o??=Object.keys(r)).includes(s.reason._tag)),s=>{let a=s.reason;return o??=Object.keys(r),o.includes(a._tag)?r[a._tag](a,s):n?n(a,s):Je(s)})}),pv=l(2,(e,t)=>hm(e,r=>Ct(r,t)&&A(r,\"reason\")?B(r.reason):K(r),Je)),yS=l(2,(e,t)=>on(e,r=>cm(()=>t(r)))),SS=l(2,(e,t)=>Pc(e,{onFailure:r=>cm(()=>t.onFailure(r)),onSuccess:r=>z(()=>t.onSuccess(r))})),bS=e=>on(e,Vs),dv=l(2,(e,t)=>on(e,r=>z(()=>t(r)))),mv=e=>re(()=>{let t=e[Symbol.iterator](),r=t.next();if(r.done)return Vs(new Error(\"Received an empty collection of effects\"));function n(o){let s=t.next();return s.done?o.value:on(o.value,a=>n(s))}return n(r)}),ES=e=>on(e,t=>V(kc,()=>ES(e))),hv=l(e=>ie(e[0]),(e,t)=>{if(!t?.log)return Pc(e,{onFailure:n=>le,onSuccess:n=>le});let r=qn(t.log===!0?void 0:t.log);return Fo(e,{onFailure(n){let o=qy(n);return ce(o)?Ue(o.failure):t.message===void 0?r(n):r(t.message,n)},onSuccess:n=>le})}),xm=l(e=>ie(e[0]),(e,t)=>{if(!t?.log)return Fo(e,{onFailure:n=>le,onSuccess:n=>le});let r=qn(t.log===!0?void 0:t.log);return Fo(e,{onFailure:n=>t.message===void 0?r(n):r(t.message,n),onSuccess:n=>le})}),xv=e=>gm(e,{onFailure:v,onSuccess:O}),Ks=e=>nl(e,{onFailure:K,onSuccess:B}),Fo=l(2,(e,t)=>new gv(e,t.onSuccess.length!==1?r=>t.onSuccess(r):t.onSuccess,t.onFailure.length!==1?r=>t.onFailure(r):t.onFailure)),xz=en({op:\"OnSuccessAndFailure\",[tt]:fm}),gv=function(e,t,r){this[pe]=e,this[Ot]=t,this[Xr]=r};gv.prototype=xz;var gz=function(e,t){let r=this.payload;return t.succeedWith(lm?r.onSuccess(e):$s(()=>r.onSuccess(e)))},yv=(e,t)=>{let r=en({op:e,[tt]:fm,[Ot]:gz,[Xr]:t}),n=function(o,s){this[pe]=o,this.payload=s};return n.prototype=r,n},yz=yv(\"Match\",function(e,t){let r=e.reasons.find(ss);if(r===void 0)return Ue(e);let n=this.payload;return t.succeedWith(lm?n.onFailure(r.error):$s(()=>n.onFailure(r.error)))}),Sz=yv(\"MatchCause\",function(e,t){let r=this.payload;return t.succeedWith(lm?r.onFailure(e):$s(()=>r.onFailure(e)))}),IS=l(2,(e,t)=>new Sz(e,t)),Pc=l(2,(e,t)=>Fo(e,{onFailure:r=>{let n=r.reasons.find(ss);return n?t.onFailure(n.error):Ue(r)},onSuccess:t.onSuccess})),gm=l(2,(e,t)=>new yz(e,t)),nl=l(2,(e,t)=>{if(De(e)){if(e._tag===\"Success\")return we(t.onSuccess(e.value));let r=Cn(e.cause);return ce(r)?e:we(t.onFailure(r.success))}return gm(e,t)}),Sv=l(2,(e,t)=>De(e)?e._tag===\"Success\"?we(t.onSuccess(e.value)):we(t.onFailure(e.cause)):IS(e,t)),ol=e=>De(e)?we(e):bz(e),bz=vo({op:\"Exit\",[tt](e){return e._stack.push(this),this[pe]},[Ot](e,t,r){return t.succeedWith(r??we(e))},[Xr](e,t,r){return t.succeedWith(r??qt(e))}}),bv=nl({onFailure:()=>!0,onSuccess:()=>!1}),Ev=nl({onFailure:()=>!1,onSuccess:()=>!0}),Iv=l(2,(e,t)=>No(Nc(t),e)),TS=l(2,(e,t)=>V(wS(e,t.duration),r=>ue(r)?t.orElse():D(r.value))),Ez=e=>new Jf(`Operation timed out after '${yy(e)}'`),Tv=l(2,(e,t)=>{let r=We(t);return TS(e,{duration:r,orElse:()=>Je(Ez(r))})}),wS=l(2,(e,t)=>oS(vc(e),vr(Nc(t),v()))),wv=e=>zn(t=>{let r=t.monotonicTimeNanosUnsafe();return Re(e,n=>[Po(t.monotonicTimeNanosUnsafe()-r),n])}),Uy=\"~effect/Scope\",Dy=\"~effect/Scope/Closeable\",Qs=fr(\"effect/Scope\"),CS=(e,t)=>ne(r=>{let n=ym(e,t);return n===void 0?le:(Cz(r),n)}),ym=(e,t)=>{let r=e.state;if(r._tag===\"Closed\"||(e.state={_tag:\"Closed\",exit:t},e.parent!==void 0&&AS(e.parent,e),r._tag===\"Empty\"))return;if(r.finalizer!==void 0)return Yd(r.finalizer,t);let n=r.finalizers;return n.size===1?Yd(n.values().next().value,t):Iz(e,n,t)},Yd=(e,t)=>{try{return e(t)}catch(r){return Tr(r)}},Cv=(e,t)=>Zs(e)?t:nn(t,r=>Ue(La(e.cause,r))),Iz=Xy(function*(e,t,r){let n=[],o=[],s=Array.from(t.values()),a=fs();for(let i=s.length-1;i>=0;i--){let c=s[i];e.strategy===\"sequential\"?n.push(yield*ol(Yd(c,r))):o.push(ea(a,Yd(c,r),!0,!0,\"inherit\"))}return o.length>0&&(n=yield*im(o)),yield*lS(n)});var Av=(e,t)=>{let r=vv(t,e);return e.state._tag===\"Closed\"?(r.state=e.state,r):(Mc(e,r,n=>CS(r,n)),r)},Xs=(e,t)=>re(()=>e.state._tag===\"Closed\"?t(e.state.exit):(Mc(e,{},t),le)),kv=(e,t)=>Xs(e,je(t)),Mc=(e,t,r)=>{if(e.state._tag===\"Empty\")e.state={_tag:\"Open\",finalizerKey:t,finalizer:r,finalizers:void 0};else if(e.state._tag===\"Open\"){let n=e.state;n.finalizer!==void 0&&(n.finalizers=new Map([[n.finalizerKey,n.finalizer]]),n.finalizerKey=void 0,n.finalizer=void 0),n.finalizers.set(t,r)}},AS=(e,t)=>{if(e.state._tag!==\"Open\")return;let r=e.state;r.finalizerKey===t?e.state=Ly:r.finalizers!==void 0&&(r.finalizers.delete(t),r.finalizers.size===0&&(e.state=Ly))},Sm=e=>vv(e,void 0),vv=(e=\"sequential\",t)=>({[Dy]:Dy,[Uy]:Uy,strategy:e,parent:t,state:Ly}),Ly={_tag:\"Empty\"};var sl=Qs,Ov=Or(Qs),kS=e=>ne(t=>{let r=t.context,n=Sm();return t.setContext(Wt(t.context,Qs,n)),Fc(t,o=>(t.setContext(r),ym(n,o))),e});var bm=e=>re(()=>{let t=Sm();return sn(e(t),r=>re(()=>ym(t,r)??le))}),ri=(e,t,r)=>Ys(n=>jn(o=>V(sl,s=>ti(r?.interruptible?o(e):e,a=>Xs(s,i=>$n(t(a,i),n)))))),vS=e=>V(sl,t=>Ys(r=>Xs(t,n=>$n(e(n),r)))),_v=(function(){let e=en({op:\"OnExit\",[tt](r){return r._stack.push(this),this.effect},[Fa](r){r.interruptible&&this.interruptible!==!0&&(r._stack.push(il),r.interruptible=!1)},[Ot](r,n,o){o??=we(r);let s;try{s=this.onExit(o)}catch(a){s=Tr(a)}return s?V(s,a=>o):o},[Xr](r,n,o){o??=qt(r);let s;try{s=this.onExit(o)}catch(a){s=Tr(a)}return s?V(Cv(o,s),a=>o):o}}),t=function(r,n,o){this.effect=r,this.onExit=n,this.interruptible=o};return t.prototype=e,t})(),Bn=(e,t,r)=>new _v(e,t,r),Fc=(e,t)=>{e._stack.push(new _v(void 0,t,void 0))},sn=l(2,Bn),Rv=l(2,(e,t)=>sn(e,r=>t)),OS=l(3,(e,t,r)=>sn(e,n=>t(n)?r(n):le)),_S=l(3,(e,t,r)=>sn(e,n=>{let o=t(n);return ce(o)?le:r(o.success,n)})),RS=l(2,(e,t)=>_S(e,tl,t)),Pv=l(3,(e,t,r)=>OS(e,n=>n._tag!==\"Failure\"?!1:t(n.cause),n=>r(n.cause))),PS=l(3,(e,t,r)=>sn(e,n=>{if(n._tag!==\"Failure\")return le;let o=t(n.cause);return ce(o)?le:r(o.success,n.cause)})),Mv=l(2,(e,t)=>PS(nm,t)(e)),al=(e,t,r)=>jn(n=>V(e,o=>Bn(re(()=>n(t(o))),s=>r(o,s),!0))),Fv=e=>ri(e,t=>A(t,Symbol.asyncDispose)?Yy(()=>t[Symbol.asyncDispose]()):z(()=>t[Symbol.dispose]())),MS=l(2,(e,t)=>z(()=>Nv(e,typeof t==\"function\"?r=>kr(We(t(r))):je(kr(We(t)))))),Tz=je(1/0),Nv=(e,t)=>{let r=0,n,o,s=(a,i)=>(i.awaiters++,Fc(a,()=>{if(!(--i.awaiters>0||o!==i))return o=void 0,Xf(i.fiber)}),Ky(i.fiber));return[ne(a=>{if(o!==void 0)return s(a,o);if(n!==void 0&&(r===1/0||a.getRef(Nr).currentTimeMillisUnsafe(){if(o!==c||(o=void 0,iS(u)))return;let f=t(u);r=f===1/0?1/0:i.currentTimeMillisUnsafe()+f,n=u}),!0,!0),c.fiber._exit??s(a,c)}),z(()=>{n=void 0})]},Uv=l(2,(e,t)=>Re(MS(e,t),r=>r[0])),Dv=e=>z(()=>Nv(e,Tz)[0]),Lv=ne(e=>Ue(Gs(e.id))),ni=e=>ne(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(il)),e)),$v=vo({op:\"SetInterruptible\",[Fa](e){if(e.interruptible=this[pe],e._interruptedCause&&e.interruptible)return()=>Ue(e._interruptedCause)}}),il=$v(!0),wz=$v(!1),Bv=e=>{if(e.interruptible=!0,e._stack.push(wz),e._interruptedCause)return Ue(e._interruptedCause)},Cz=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(il))};var Em=e=>ne(t=>t.interruptible?e:Bv(t)??e),jn=e=>ne(t=>t.interruptible?(t.interruptible=!1,t._stack.push(il),e(Em)):e(R)),jv=e=>ne(t=>{if(t.interruptible)return e(R);let r=Bv(t),n=e(ni);return r??n}),zv=Re(ri(z(()=>new AbortController),e=>z(()=>e.abort())),e=>e.signal),cl=(e,t)=>ns(e)?t?.mode===\"result\"?rn(e,Ks,t):rn(e,R,t):t?.discard?t.mode===\"result\"?rn(Object.values(e),Ks,t):rn(Object.values(e),R,t):re(()=>{let r={};return vr(rn(Object.entries(e),([n,o])=>Re(t?.mode===\"result\"?Ks(o):o,s=>{N(r,n,s)}),{discard:!0,concurrency:t?.concurrency}),r)}),FS=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>Re(rn(e,(n,o)=>Ks(t(n,o)),r),n=>my(n,R))),qv=l(3,(e,t,r)=>{let n=Ve(e);return n.length===0?z(t):re(()=>{let o=0,s=t();return Re(Uo({while:()=>or(s,n[o],o),step(a){s=a,o++}}),()=>s)})}),Hv=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>V(FS(e,t,{concurrency:r?.concurrency}),([n,o])=>rr(o)?Je(o):r?.discard?le:D(n))),Wv=l(e=>ns(e[0])&&!ie(e[0]),(e,t)=>re(()=>{let r=e[Symbol.iterator](),n=r.next();return n.done?D(v()):Jv(r,0,t,n.value)})),Jv=(e,t,r,n)=>V(r(n,t),o=>{if(o)return D(O(n));let s=e.next();return s.done?D(v()):Jv(e,t+1,r,s.value)}),Kv=l(e=>ns(e[0])&&!ie(e[0]),(e,t)=>re(()=>{let r=e[Symbol.iterator](),n=r.next();return n.done?D(v()):Gv(r,0,t,n.value)})),Gv=(e,t,r,n)=>V(r(n,t),o=>{if(at(o))return D(O(o.success));let s=e.next();return s.done?D(v()):Gv(e,t+1,r,s.value)}),Uo=vo({op:\"While\",[Ot](e,t){return this[pe].step(e),this[pe].while()?(t._stack.push(this),this[pe].body()):lr},[tt](e){return this[pe].while()?(e._stack.push(this),this[pe].body()):lr}}),rn=l(e=>typeof e[1]==\"function\",(e,t,r)=>re(()=>{let n=ul(r?.concurrency);if(n===1)return Az(e,t,r);let o=Ve(e),s=o.length;if(s===0)return r?.discard?le:D([]);let a=r?.discard?void 0:new Array(s),i=kz({f:t,out:a},o,{concurrency:n});return i?vr(i,a):D(a)})),Vv=e=>V(e,t=>{let r=t[Symbol.iterator]().next();return r.done?Je(new Dn):D(r.value)}),Az=(e,t,r)=>re(()=>{let n=r?.discard?void 0:[],o=e[Symbol.iterator](),s=o.next(),a=0;return vr(Uo({while:()=>!s.done,body:()=>t(s.value,a++),step:i=>{n&&n.push(i),s=o.next()}}),n)}),ul=e=>e===\"unbounded\"?Number.POSITIVE_INFINITY:Math.max(1,e??1),Im=()=>e=>{let t=e.onItem,r=e.step,n=(s,a,i,c,u)=>V(ol(u),f=>r(s,a[i],f,i)??o(s,a,i+1,c)??le),o=(s,a,i=0,c=a.length)=>{for(;i{let t=e.onItem,r=e.step;return(n,o,s)=>{let a=0,i=s.end??o.length,c=s.concurrency,u=!1,f,p,d,m,x,y=w=>{let E=Tr(w);return m=E,u=!0,p&&p.size>0?V(ni(Tc(Array.from(p))),()=>m??E):E},S=()=>{let w=!1;for(;!m&&a{p.delete(_);try{if(m){if(b._tag===\"Failure\"){let T=b.cause.reasons.filter(C=>C._tag!==\"Interrupt\");if(T.length>0){let C=os(T);m=qt(m._tag===\"Failure\"?La(m.cause,C):C)}}}else{let T=r(n,E,b,h);T&&(m=T,S())}if(w){let T=S();T&&d(T)}else u&&p.size===0&&d(m??le)}catch(T){d(y(T))}}),p.size{f=fs(),p=new Set,x=M,d=_;let h;try{h=S()}catch(b){return _(y(b))}return h?_(h):re(()=>(m??=lr,V(p?Tc(p):le,()=>m?._tag===\"Failure\"?m:le)))})}if(u=!0,m){if(p&&p.size>0){let E=am(f);p.forEach(M=>M.interruptUnsafe(f.id,E));return}if(d||m._tag===\"Failure\")return m}else if(d)if(p)p.size===0&&d(le);else return lr};return S()}},Tm=()=>e=>Zv(e),kz=Zv({onItem(e,t,r){return e.f(t,r)},step(e,t,r,n){if(r._tag===\"Failure\")return r;e.out&&(e.out[n]=r.value)}}),NS=l(3,(e,t,r)=>V(e,n=>t(n)?D(n):r(n))),US=l(3,(e,t,r)=>V(e,n=>{let o=t(n);return ce(o)?r(o.failure):D(o.success)})),Yv=l(e=>ie(e[0]),(e,t,r)=>US(e,t,r?n=>Je(r(n)):()=>Je(new Dn))),Qv=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>re(()=>{let n=[];return vr(rn(e,(o,s)=>{let a=t(o,s);return typeof a==\"boolean\"?(a&&n.push(o),le):Re(a,i=>{i&&n.push(o)})},{discard:!0,concurrency:r?.concurrency}),n)})),Xv=l(e=>ns(e[0])&&!ie(e[0]),(e,t)=>re(()=>{let r=[];for(let n of e){let o=t(n);at(o)&&r.push(o.success)}return D(r)})),eO=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>re(()=>{let n=[];return vr(rn(e,o=>Re(t(o),s=>{at(s)&&n.push(s.success)}),{discard:!0,concurrency:r?.concurrency}),n)})),tO=D({}),rO=yd(Re),nO=Sd(Re,V),oO=gd(Re);var sO=l(e=>ie(e[0]),(e,t)=>ne(r=>(zz(),D(ea(r,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),ea=(e,t,r=!1,n=!1,o=!1)=>{let s=e,a=o===\"inherit\"?s.interruptible:!o,i=new Zd(s.context,a);return r?i.evaluate(t):(i._asyncContext=fk(),s.currentDispatcher.scheduleTask(()=>i.evaluate(t),0)),!n&&!i._exit&&(s.children().add(i),i._parent=s),i},aO=l(e=>ie(e[0]),(e,t)=>ne(r=>D(ea(r,e,t?.startImmediately,!0,t?.uninterruptible)))),iO=e=>ne(t=>{let r=t._children&&new Set(t._children),n=t.interruptible;return Bn(e,o=>{let s=t._children;if(s===void 0||s.size===0)return le;r&&(s=iA(s,i=>!r.has(i)));let a=el(im(s));return n?Em(a):a})}),DS=l(e=>ie(e[0]),(e,t,r)=>ne(n=>{let o=ea(n,e,r?.startImmediately,!0,r?.uninterruptible);if(!o._exit)if(t.state._tag!==\"Closed\"){let s={};Mc(t,s,()=>yk(i=>i===o.id?le:Xf(o))),o.addObserver(()=>AS(t,s))}else o.interruptUnsafe(n.id,am(n));return D(o)})),cO=l(e=>ie(e[0]),(e,t)=>V(sl,r=>DS(e,r,t))),ds=e=>(t,r)=>{let n=new Zd(r?.scheduler?Wt(e,$f,r.scheduler):e,r?.uninterruptible!==!0);if(n.evaluate(t),n._exit)return n;if(r?.signal)if(r.signal.aborted)n.interruptUnsafe();else{let o=()=>n.interruptUnsafe();r.signal.addEventListener(\"abort\",o,{once:!0}),n.addObserver(()=>r.signal.removeEventListener(\"abort\",o))}return r?.onFiberStart&&r.onFiberStart(n),n},uO=l(2,(e,t)=>{if(e._exit)return e;if(t.state._tag===\"Closed\")return e.interruptUnsafe(e.id),e;let r={};return Mc(t,r,()=>Xf(e)),e.addObserver(()=>AS(t,r)),e}),fO=ds(wr()),LS=e=>{let t=ds(e);return(r,n)=>{let o=t(r,n);return n?.onExit&&o.addObserver(n.onExit),s=>o.interruptUnsafe(s)}},lO=LS(wr()),wm=e=>{let t=ds(e);return(r,n)=>{let o=t(r,n);return new Promise(s=>{o.addObserver(a=>s(a))})}},pO=wm(wr()),$S=e=>{let t=wm(e);return(r,n)=>t(r,n).then(o=>{if(o._tag===\"Failure\")throw om(o.cause);return o.value})},dO=$S(wr()),Cm=e=>{let t=ds(e);return r=>{if(De(r))return r;let n=new Ga(\"sync\"),o=t(r,{scheduler:n});return o._dispatcher?.flush(),o._exit??Tr(new Zf(o))}},mO=Cm(wr()),BS=e=>{let t=Cm(e);return r=>{let n=t(r);if(n._tag===\"Failure\")throw om(n.cause);return n.value}},hO=BS(wr()),VA=D(!0),ZA=D(!1),$y=class{waiters=[];scheduled=void 0;_isOpen;constructor(t){this._isOpen=t}scheduleUnsafe(t){if(this.waiters.length===0)return VA;if(this.scheduled===void 0)this.scheduled=this.waiters,t.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let r=0;r{if(this.scheduled===void 0)return;let t=this.scheduled;this.scheduled=void 0;for(let r=0;rthis._isOpen?ZA:(this._isOpen=!0,this.scheduleUnsafe(t)));release=ne(t=>this._isOpen?ZA:this.scheduleUnsafe(t));openUnsafe(){return this._isOpen?!1:(this._isOpen=!0,this.flushWaiters(),!0)}await=mt(t=>this._isOpen?t(le):(this.waiters.push(t),z(()=>{let r=this.waiters.indexOf(t);r!==-1?this.waiters.splice(r,1):this.scheduled!==void 0&&(r=this.scheduled.indexOf(t),r!==-1&&this.scheduled.splice(r,1))})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=z(()=>this.closeUnsafe());whenOpen=t=>V(this.await,()=>t);isOpen(){return this._isOpen}},jS=e=>new $y(e??!1),xO=e=>z(()=>jS(e)),gO=ne(e=>D(e.getRef(vy))),yO=l(2,(e,t)=>Or(e,vy,t)),SO=Or(Kd),bO=Or(Ya),Qd=BigInt(0),vz={_tag:\"Span\",spanId:\"noop\",traceId:\"noop\",sampled:!1,status:{_tag:\"Ended\",startTime:Qd,endTime:Qd,exit:lr},attributes:new Map,links:[],kind:\"internal\",attribute(){},event(){},end(){},addLinks(){}},Oz=e=>Object.assign(Object.create(vz),e),EO=e=>e?Fe(e.annotations,Jd)?e._tag===\"Span\"?EO(js(e.parent)):v():O(e):v(),zS=(e,t,r)=>{let n=!e.cache.tracerEnabled||r?.annotations&&Fe(r.annotations,Jd),o=r?.parent!==void 0?O(r.parent):r?.root?v():EO(e.cache.span),s;if(n)s=Oz({name:t,parent:o,annotations:Wt(r?.annotations??wr(),Jd,!0)});else{let a=e.cache.tracer??Oy,i=e.getRef(Nr),c=e.getRef(Ya),u=e.getRef(jf),f=e.getRef(zf),p=r?.level??e.getRef($A),d=r?.links!==void 0?[...f,...r.links]:f.length===0?[]:f.slice();s=a.span({name:t,parent:o,annotations:r?.annotations??wr(),links:d,startTime:c?i.currentTimeNanosUnsafe():Qd,kind:r?.kind??\"internal\",root:r?.root??ue(o),sampled:r?.sampled??(Oe(o)&&o.value.sampled===!1?!1:!$O(e.getRef(BA),p))});for(let m in u)s.attribute(m,u[m]);if(r?.attributes!==void 0)for(let m in r.attributes)s.attribute(m,r.attributes[m])}return s},IO=(e,t)=>ne(r=>D(zS(r,e,t))),qf=(e,t)=>ni(ne(r=>{let n=Ro(r.context,Qs),o=zS(r,e,t??{}),s=r.getRef(Nr),a=r.getRef(Ya);return vr(Xs(n,i=>Am(o,i,s,a)),o)})),TO=function(){let e=typeof arguments[0]!=\"string\",t=e?arguments[1]:arguments[0],r=Js(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return V(qf(t,r),o=>wc(n,o,r))}return n=>V(qf(t,r),o=>wc(n,o,r))},_z=(e,t)=>(t=typeof t==\"function\"?t:Sn,ps(Bf,r=>({name:e,stack:t,parent:r}))),wO=jf,CO=zf,AO=l(e=>ie(e[0]),(e,t,r={})=>{let o=(Array.isArray(t)?t:[t]).map(s=>({span:s,attributes:r}));return ps(e,zf,s=>[...s,...o])}),Am=(e,t,r,n)=>z(()=>{e.status._tag!==\"Ended\"&&e.end(n?r.currentTimeNanosUnsafe():Qd,t)}),Hf=(e,...t)=>{let r=t.length===1?void 0:t[0],n=t[t.length-1];return ne(o=>{let s=zS(o,e,r),a=o.getRef(Nr),i=o.getRef(Ya);return Fc(o,c=>Am(s,c,a,i)),n(s)})},By=Or(Za),wc=function(){let e=ie(arguments[0]),t=e?arguments[1]:arguments[0],r=e?arguments[2]:arguments[1],n=R;return t._tag===\"Span\"&&(r=Js(r),n=_z(t.name,r?.captureStackTrace)),e?By(n(arguments[0]),t):o=>By(n(o),t)},kO=function(){let e=typeof arguments[0]!=\"string\",t=e?arguments[1]:arguments[0],r=Js(arguments[2]);if(e){let s=arguments[0];return Hf(t,arguments[2],a=>wc(s,a,r))}let n=typeof arguments[1]==\"function\"?arguments[1]:void 0,o=n?void 0:arguments[1];return(s,...a)=>Hf(t,n?n(...a):o,i=>wc(s,i,r))},vO=l(e=>ie(e[0]),(e,...t)=>ps(e,jf,r=>{let n=t.length===1?{...r,...t[0]}:{...r};return t.length===1||N(n,t[0],t[1]),n})),OO=(...e)=>ne(t=>{let r=t.currentSpanLocal;if(r)if(e.length===1)for(let[n,o]of Object.entries(e[0]))r.attribute(n,o);else r.attribute(e[0],e[1]);return le}),_O=ne(e=>{let t=e.currentSpanLocal;return t?D(t):Je(new Dn)}),RO=dz(Za),Nr=Te(\"effect/Clock\",{defaultValue:()=>new jy}),My=2**31-1,jy=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=z(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Rz()}currentTimeNanos=z(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return MO()}monotonicTimeNanos=z(()=>this.monotonicTimeNanosUnsafe());sleep(t){return this.sleepMillis(kr(t))}sleepMillis(t){return t<=0?kc:Number.isFinite(t)?mt(r=>{let n=t>My?this.sleepMillis(t-My):le,o=setTimeout(()=>r(n),Math.min(t,My));return z(()=>clearTimeout(o))}):um}},PO=BigInt(1e6),MO=(function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==\"function\")return()=>e.bigint();if(typeof performance<\"u\"&&typeof performance.now==\"function\")return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let r=BigInt(Date.now())*PO;return r>t&&(t=r),t}})(),Rz=(function(){let e=BigInt(1e9),t;return()=>{let r=MO(),n=BigInt(Date.now())*PO;if(t===void 0)t=n-r;else{let o=t+r;(n>o?n-o:o-n)>e&&(t=n-r)}return t+r}})(),zn=e=>ne(t=>e(t.getRef(Nr))),Nc=e=>zn(t=>t.sleep(We(e))),qS=zn(e=>e.currentTimeMillis);var Wf=\"~effect/Cause/TimeoutError\",FO=e=>A(e,Wf),Jf=class extends as(\"TimeoutError\"){[Wf]=Wf;constructor(t){super({message:t})}},Kf=\"~effect/Cause/IllegalArgumentError\",NO=e=>A(e,Kf),Xd=class extends as(\"IllegalArgumentError\"){[Kf]=Kf;constructor(t){super({message:t})}},Gf=\"~effect/Cause/ExceededCapacityError\",UO=e=>A(e,Gf),em=class extends as(\"ExceededCapacityError\"){[Gf]=Gf;constructor(t){super({message:t})}},Vf=\"~effect/Cause/AsyncFiberError\",DO=e=>A(e,Vf),Zf=class extends as(\"AsyncFiberError\"){[Vf]=Vf;constructor(t){super({message:\"An asynchronous Effect was executed with Effect.runSync\",fiber:t})}},Yf=\"~effect/Cause/UnknownError\",LO=e=>A(e,Yf),Cc=class extends as(\"UnknownError\"){[Yf]=Yf;constructor(t,r){super({message:r,cause:t})}},HS=Te(\"effect/Console\",{defaultValue:()=>globalThis.console}),Pz=e=>{switch(e){case\"All\":return Number.MIN_SAFE_INTEGER;case\"Fatal\":return 5e4;case\"Error\":return 4e4;case\"Warn\":return 3e4;case\"Info\":return 2e4;case\"Debug\":return 1e4;case\"Trace\":return 0;case\"None\":return Number.MAX_SAFE_INTEGER}},Mz=ty(is,Pz),$O=gc(Mz),WS=Te(\"effect/Logger/CurrentLoggers\",{defaultValue:()=>new Set([Bz,jz])}),Fz=Te(\"effect/Logger/LogToStderr\",{defaultValue:hf}),BO=function(){let e=typeof arguments[0]==\"string\"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return ni(ne(t=>{let r=t.getRef(us),n={...r};for(let o=0;o{let s=t.getRef(us),a={...s};for(let i=0;i{let t=Object.create(Uz);return t.log=e,t},Dz=e=>e.replace(/[\\s=\"]/g,\"_\"),Lz=(e,t)=>`${Dz(e[0])}=${t-e[1]}ms`;var qn=e=>(...t)=>{let r;for(let n=0,o=t.length;n{let o=e??n.cache.logLevel;if($O(n.cache.minimumLogLevel,o))return le;let s=n.getRef(Nr),a=n.getRef(WS);if(a.size>0){let i=new Date(s.currentTimeMillisUnsafe());for(let c of a)c.log({cause:r,fiber:n,date:i,logLevel:o,message:t})}return le})};var Qa={bold:\"1\",red:\"31\",green:\"32\",yellow:\"33\",blue:\"34\",cyan:\"36\",white:\"37\",gray:\"90\",black:\"30\",bgBrightRed:\"101\"},Sre={None:[],All:[],Trace:[Qa.gray],Debug:[Qa.blue],Info:[Qa.green],Warn:[Qa.yellow],Error:[Qa.red],Fatal:[Qa.bgBrightRed,Qa.black]};var $z=e=>`${e.getHours().toString().padStart(2,\"0\")}:${e.getMinutes().toString().padStart(2,\"0\")}:${e.getSeconds().toString().padStart(2,\"0\")}.${e.getMilliseconds().toString().padStart(3,\"0\")}`;var Bz=jO(({cause:e,date:t,fiber:r,logLevel:n,message:o})=>{let s=Array.isArray(o)?o.slice():[o];e.reasons.length>0&&s.push(sm(e));let a=t.getTime(),i=r.getRef(Gd),c=\"\";for(let d of i)c+=` ${Lz(d,a)}`;let u=r.getRef(us);Object.keys(u).length>0&&s.push(u);let f=r.getRef(HS);(r.getRef(Fz)?f.error:f.log)(`[${$z(t)}] ${n.toUpperCase()} (#${r.id})${c}:`,...s)}),jz=jO(({cause:e,fiber:t,logLevel:r,message:n})=>{let o=t.getRef(Nr),s=t.getRef(us),a=t.cache.span;if(a===void 0||a._tag===\"ExternalSpan\")return;let i={};for(let[c,u]of Object.entries(s))N(i,c,u);i[\"effect.fiberId\"]=t.id,i[\"effect.logLevel\"]=r.toUpperCase(),e.reasons.length>0&&(i[\"effect.cause\"]=sm(e)),a.event(gC(Array.isArray(n)&&n.length===1?n[0]:n),o.currentTimeNanosUnsafe(),i)});function zz(){Ny.interruptChildren??=az}var JS=D(void 0);var zO=l(e=>ie(e[0]),(e,t)=>RS(e,r=>ne(n=>(qz(n,r,t?.defectsOnly),le)))),qz=(e,t,r)=>{let n=e.getRef(qA);if(n.size===0||r&&!tm(t))return;let o={cause:t,fiber:e,timestamp:e.getRef(Nr).currentTimeNanosUnsafe()};n.forEach(s=>s.report(o))};var Hz=If,Wz=cc,VS=fc,ZS=bC,fl=ss,Jz=$a,Kz=Ba,Uc=os,Gz=pd,Vz=lc,oi=Gg,Zz=Gs,km=e=>new Na(e),vm=e=>new Tf(e),YS=YA,QS=rk,ms=sk,Yz=La,Om=om,XS=zy,Qz=qy,eb=Cn,Xz=QA,eq=tm,tq=XA,ll=Qf,rq=rm,nq=ek,oq=tk,sq=nm,aq=Hy,tb=sm,iq=md,cq=wf,uq=Dn,Dc=kf,fq=Ua,rb=ja,ee=wC,lq=Wf,pq=FO,dq=Jf,mq=Kf,hq=NO,pl=Xd,xq=UO,gq=Gf,nb=em,yq=Vf,Sq=DO,bq=Zf,Eq=Yf,Iq=LO,Tq=Cc,wq=pc,Cq=nk,Aq=ok,KS=class extends fr()(\"effect/Cause/StackTrace\"){},GS=class extends fr()(\"effect/Cause/InterruptorStackTrace\"){};var U={};Eo(U,{Do:()=>KH,Transaction:()=>qc,TypeId:()=>$H,abortSignal:()=>fJ,acquireDisposable:()=>XW,acquireRelease:()=>di,acquireUseRelease:()=>J_,addFinalizer:()=>eJ,all:()=>Jm,andThen:()=>mr,annotateCurrentSpan:()=>EJ,annotateLogs:()=>QJ,annotateLogsScoped:()=>XJ,annotateSpans:()=>bJ,as:()=>Ft,asSome:()=>Vm,asVoid:()=>na,awaitAllChildren:()=>NJ,bind:()=>ZH,bindTo:()=>GH,cached:()=>sJ,cachedInvalidateWithTTL:()=>iJ,cachedWithTTL:()=>aJ,callback:()=>Wc,catch:()=>oa,catchCause:()=>xt,catchCauseFilter:()=>hW,catchCauseIf:()=>mW,catchDefect:()=>Rl,catchEager:()=>Zc,catchFilter:()=>pW,catchIf:()=>lW,catchNoSuchElement:()=>dW,catchReason:()=>cW,catchReasons:()=>uW,catchTag:()=>aW,catchTags:()=>iW,clockWith:()=>hi,context:()=>li,contextWith:()=>Pl,currentParentSpan:()=>TJ,currentSpan:()=>IJ,delay:()=>$b,die:()=>Rr,effectify:()=>fK,ensuring:()=>mi,eventually:()=>bW,exit:()=>kn,fail:()=>P,failCause:()=>it,failCauseSync:()=>Ss,failSync:()=>Gm,fiber:()=>UJ,fiberId:()=>DJ,filter:()=>jb,filterMap:()=>UW,filterMapEffect:()=>zb,filterMapOrElse:()=>LW,filterMapOrFail:()=>BW,filterOrElse:()=>DW,filterOrFail:()=>$W,findFirst:()=>qH,findFirstFilter:()=>HH,firstSuccessOf:()=>OW,flatMap:()=>I,flatMapEager:()=>nt,flatten:()=>Ub,flip:()=>oW,fn:()=>HJ,fnUntraced:()=>Se,fnUntracedEager:()=>eE,forEach:()=>ta,forever:()=>$t,forkChild:()=>Gc,forkDetach:()=>FJ,forkIn:()=>Nt,forkScoped:()=>Vc,fromNullishOr:()=>tW,fromOption:()=>XH,fromResult:()=>_l,gen:()=>dr,head:()=>WH,ignore:()=>wW,ignoreCause:()=>CW,interrupt:()=>On,interruptible:()=>cJ,interruptibleMask:()=>uJ,isEffect:()=>Bo,isFailure:()=>WW,isSuccess:()=>JW,let:()=>VH,linkSpans:()=>AJ,log:()=>WJ,logDebug:()=>VJ,logError:()=>Xb,logFatal:()=>JJ,logInfo:()=>GJ,logTrace:()=>ZJ,logWarning:()=>KJ,logWithLevel:()=>th,makeSpan:()=>Zb,makeSpanScoped:()=>kJ,map:()=>j,mapBoth:()=>xW,mapBothEager:()=>Kt,mapEager:()=>Dr,mapError:()=>Zm,mapErrorEager:()=>Fl,match:()=>qb,matchCause:()=>zW,matchCauseEager:()=>qW,matchCauseEffect:()=>fi,matchCauseEffectEager:()=>HW,matchEager:()=>jW,matchEffect:()=>Hb,never:()=>ui,onError:()=>Jn,onErrorFilter:()=>rJ,onErrorIf:()=>tJ,onExit:()=>cn,onExitFilter:()=>oJ,onExitIf:()=>nJ,onExitPrimitive:()=>Gb,onInterrupt:()=>Vb,option:()=>nW,orDie:()=>Lb,orElseSucceed:()=>vW,partition:()=>BH,promise:()=>Km,provide:()=>KW,provideContext:()=>vn,provideService:()=>jo,provideServiceEffect:()=>QW,race:()=>NW,raceAll:()=>Bb,raceAllFirst:()=>FW,raceFirst:()=>Kc,reduce:()=>jH,repeat:()=>lJ,repeatOrElse:()=>pJ,replicate:()=>dJ,replicateEffect:()=>mJ,request:()=>PJ,requestUnsafe:()=>MJ,result:()=>rW,retry:()=>EW,retryOrElse:()=>IW,runCallback:()=>$J,runCallbackWith:()=>LJ,runFork:()=>Ml,runForkWith:()=>_n,runPromise:()=>Yb,runPromiseExit:()=>eh,runPromiseExitWith:()=>BJ,runPromiseWith:()=>Qb,runSync:()=>jJ,runSyncExit:()=>qo,runSyncExitWith:()=>qJ,runSyncWith:()=>zJ,sandbox:()=>TW,satisfiesErrorType:()=>pK,satisfiesServicesType:()=>dK,satisfiesSuccessType:()=>lK,schedule:()=>hJ,scheduleFrom:()=>K_,scope:()=>pi,scoped:()=>Xm,scopedWith:()=>Kb,service:()=>Wb,serviceOption:()=>Jb,setContext:()=>GW,sleep:()=>sa,spanAnnotations:()=>wJ,spanLinks:()=>CJ,succeed:()=>g,succeedNone:()=>ra,succeedSome:()=>Nb,suspend:()=>$,sync:()=>te,tap:()=>Pr,tapCause:()=>H_,tapCauseFilter:()=>SW,tapCauseIf:()=>yW,tapDefect:()=>W_,tapError:()=>Ym,tapErrorTag:()=>gW,timed:()=>MW,timeout:()=>_W,timeoutOption:()=>RW,timeoutOrElse:()=>PW,tracer:()=>xJ,track:()=>tK,trackDefects:()=>oK,trackDuration:()=>sK,trackErrors:()=>nK,trackSuccesses:()=>rK,transposeOption:()=>eW,try:()=>Jc,tryPromise:()=>Hc,tx:()=>aK,txRetry:()=>uK,undefined:()=>JH,uninterruptible:()=>bs,uninterruptibleMask:()=>zo,unwrapReason:()=>fW,updateContext:()=>VW,updateService:()=>ZW,updateServiceScoped:()=>YW,useSpan:()=>vJ,validate:()=>zH,void:()=>Y,when:()=>Qm,whileLoop:()=>Wn,withErrorReporting:()=>kW,withExecutionPlan:()=>AW,withFiber:()=>an,withFiberSucceed:()=>QH,withLogSpan:()=>eK,withLogger:()=>YJ,withParentSpan:()=>RJ,withSpan:()=>OJ,withSpanScoped:()=>_J,withTracer:()=>gJ,withTracerEnabled:()=>yJ,withTracerTiming:()=>SJ,yieldNow:()=>Ol,yieldNowWith:()=>YH,zip:()=>Db,zipWith:()=>sW});var sr={};Eo(sr,{asVoid:()=>Lq,asVoidAll:()=>$q,die:()=>ob,fail:()=>hs,failCause:()=>Ur,filterCause:()=>Pq,filterFailure:()=>Rq,filterSuccess:()=>Oq,filterValue:()=>_q,findDefect:()=>Fq,findError:()=>Mq,findErrorOption:()=>zq,getCause:()=>jq,getSuccess:()=>Bq,hasDies:()=>vq,hasFails:()=>kq,hasInterrupts:()=>ab,interrupt:()=>sb,isExit:()=>dl,isFailure:()=>xs,isSuccess:()=>Ke,map:()=>Nq,mapBoth:()=>Dq,mapError:()=>Uq,match:()=>ib,succeed:()=>pr,void:()=>ht});var dl=Kg,pr=we,Ur=qt,hs=tn,ob=Tr,sb=Oc,ht=lr;var Ke=Zs,xs=sS,kq=jk,vq=Bk,ab=iS,Oq=Uk,_q=Dk,Rq=Lk,Pq=tl,Mq=aS,Fq=$k,ib=qk,Nq=cS,Uq=uS,Dq=fS,Lq=Hk,$q=lS,Bq=Wk,jq=Jk,zq=Kk;var qq=\"~effect/Deferred\";var Hq={[qq]:{_A:R,_E:R},pipe(){return Z(this,arguments)}},qO=function(){this.resumes=void 0,this.effect=void 0};qO.prototype=Hq;var si=()=>new qO;var _m=e=>mt(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),z(()=>{let r=e.resumes;if(r===void 0)return;let n=r.indexOf(t);n>=0&&r.splice(n,1)})));var Wq=l(2,(e,t)=>z(()=>Do(e,t))),Jq=Wq;var Kq=l(2,(e,t)=>Jq(e,qt(t)));var cb=l(2,(e,t)=>Kq(e,Gs(t)));var Do=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let r=e.resumes;e.resumes=void 0;for(let n=0;n{let r={observers:0,deferred:si(),scope:An(),finalizer:n=>re(()=>--r.observers>0?le:(e.map.delete(t),Le(r.scope,n)))};return r},GO=(e,t)=>t.state._tag===\"Closed\"?!1:(e.observers++,Mc(t,{},e.finalizer),!0),YO=e=>A(e,ZO),Zq={[ZO]:{_ROut:R,_E:R,_RIn:R},pipe(){return Z(this,arguments)}},QO=e=>{let t=Object.create(Zq);return t.build=e,t},ub=e=>QO((t,r)=>{let n=Mt(r);return sn(e(t,n),o=>o._tag===\"Failure\"?Le(n,o):le)}),Yq=e=>{let t=ub((r,n)=>r.getOrElseMemoize(t,n,e));return t},Pm=class{get[KO](){return KO}parent;constructor(t){this.parent=t}map=new Map;get(t,r){let n=this.map.get(t);return n?(GO(n,r),n.deferred.effect??_m(n.deferred)):this.parent?.get(t,r)}getOrElseMemoize(t,r,n){return re(()=>{let o;return Bn(re(()=>{let s=this.get(t,r);if(s)return s;let a=Vq(this,t);return GO(a,r)?(o=a.deferred,this.map.set(t,a),n(this,a.scope)):n(this,r)}),s=>{o&&Do(o,s)})})}},hl=()=>new Pm,Qq=e=>new Pm(e);var ml=class e extends fr()(\"effect/Layer/CurrentMemoMap\"){static forkOrCreate(t){let r=Rd(t,e);return r?Qq(r):hl()}},xl=l(3,(e,t,r)=>Or(Re(e.build(t,r),Wt(ml,t)),ml,t));var Fm=l(2,(e,t)=>ne(r=>xl(e,ml.forkOrCreate(r.context),t))),XO=function(){return arguments.length===1?e=>Mm(Ja(arguments[0],e)):Mm(Ja(arguments[0],arguments[1]))},Mm=e=>QO(je(D(e)));var fb=function(){return arguments.length===1?e=>VO(arguments[0],e):VO(arguments[0],arguments[1])},VO=(e,t)=>Xq(Re(t,r=>Ja(e,r))),Xq=e=>Yq((t,r)=>gs(e,r));var e_=(e,t,r)=>{let n=Mt(r,\"parallel\");return rn(e,o=>o.build(t,Mt(n,\"sequential\")),{concurrency:e.length}).pipe(Re(o=>eA(...o)))},t_=(...e)=>ub((t,r)=>e_(e,t,r));var eH=(e,t,r)=>ub((n,o)=>V(Array.isArray(t)?e_(t,n,o):t.build(n,o),s=>e.build(n,o).pipe($n(s),Re(a=>r(a,s))))),r_=l(2,(e,t)=>eH(e,t,R));var n_=\"~effect/ExecutionPlan\";var tH={[n_]:n_,get captureRequirements(){let e=this;return Ys(t=>D(rH(e.steps.map(r=>({...r,while:r.while?n=>$n(r.while(n),t):void 0,provide:YO(r.provide)?r_(r.provide,Mm(t)):r.provide})))))},pipe(){return Z(this,arguments)}},rH=e=>{let t=Object.create(tH);return t.steps=e,t};var Nm=Te(\"effect/ExecutionPlan/CurrentMetadata\",{defaultValue:je({attempt:0,stepIndex:0})});var Lc=Nr;var Um=\"~effect/DateTime\",Dm=\"~effect/DateTime/TimeZone\",s_={[Um]:Um,pipe(){return Z(this,arguments)},[Ie](){return this.toString()},toJSON(){return bl(this).toJSON()}},oH={...s_,_tag:\"Utc\",[se](){return It(this.epochMilliseconds)},[ae](e){return Bc(e)&&e._tag===\"Utc\"&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${bl(this).toJSON()})`}},sH={...s_,_tag:\"Zoned\",[se](){return fe(It(this.epochMilliseconds))(H(this.zone))},[ae](e){return Bc(e)&&e._tag===\"Zoned\"&&this.epochMilliseconds===e.epochMilliseconds&&W(this.zone,e.zone)},toString(){return`DateTime.Zoned(${Tb(this)})`}},a_={[Dm]:Dm,[Ie](){return this.toString()}},aH={...a_,_tag:\"Named\",[se](){return _e(`Named:${this.id}`)},[ae](e){return ii(e)&&e._tag===\"Named\"&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:\"TimeZone\",_tag:\"Named\",id:this.id}}},iH={...a_,_tag:\"Offset\",[se](){return _e(`Offset:${this.offset}`)},[ae](e){return ii(e)&&e._tag===\"Offset\"&&this.offset===e.offset},toString(){return`TimeZone.Offset(${bb(this.offset)})`},toJSON(){return{_id:\"TimeZone\",_tag:\"Offset\",offset:this.offset}}},$o=(e,t,r)=>{let n=Object.create(sH);return n.epochMilliseconds=e,n.zone=t,Object.defineProperty(n,\"partsUtc\",{value:r,enumerable:!1,writable:!0}),Object.defineProperty(n,\"adjustedEpochMillis\",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(n,\"partsAdjusted\",{value:void 0,enumerable:!1,writable:!0}),n},Bc=e=>A(e,Um);var ii=e=>A(e,Dm),i_=e=>ii(e)&&e._tag===\"Offset\",c_=e=>ii(e)&&e._tag===\"Named\",u_=e=>e._tag===\"Utc\",mb=e=>e._tag===\"Zoned\",f_=tr((e,t)=>e.epochMilliseconds===t.epochMilliseconds);var l_=e=>{let t=Object.create(oH);return t.epochMilliseconds=e,Object.defineProperty(t,\"partsUtc\",{value:void 0,enumerable:!1,writable:!0}),t},$c=e=>{let t=e.getTime();if(Number.isNaN(t))throw new pl(\"Invalid date\");return l_(t)},$m=e=>{if(Bc(e))return e;if(e instanceof Date)return $c(e);if(typeof e==\"object\"){if(\"epochMilliseconds\"in e)return $c(new Date(e.epochMilliseconds));let t=new Date(0);return hH(t,e),$c(t)}else if(typeof e==\"string\"&&!cH(e))return $c(new Date(e+\"Z\"));return $c(new Date(e))},cH=e=>/Z|GMT|[+-]\\d{2}$|[+-]\\d{2}:?\\d{2}$|\\]$/.test(e),uH=-864e13+720*60*1e3,fH=864e13-840*60*1e3,hb=(e,t)=>{let r=t?.timeZone;if(r===void 0&&Bc(e)&&mb(e))return e;let n=$m(e);if(n.epochMillisecondsfH)throw new RangeError(`Epoch millis out of range: ${n.epochMilliseconds}`);r===void 0&&typeof e==\"object\"&&\"timeZoneId\"in e&&(r=e.timeZoneId);let o;if(r===void 0){let s=new Date(n.epochMilliseconds).getTimezoneOffset()*-60*1e3;o=Sl(s)}else if(ii(r))o=r;else if(typeof r==\"number\")o=Sl(r);else{let s=yb(r);if(ue(s))throw new pl(`Invalid time zone: ${r}`);o=s.value}return t?.adjustForTimeZone!==!0?$o(n.epochMilliseconds,o,n.partsUtc):xH(n.epochMilliseconds,o,t?.disambiguation??\"compatible\")},pb=Ln(hb),p_=Ln($m),lH=/^(.{17,35})\\[(.+)\\]$/,d_=e=>{let t=lH.exec(e);if(t===null){let o=Ib(e);return o!==null?pb(e,{timeZone:o}):v()}let[,r,n]=t;return pb(r,{timeZone:n})};var m_=e=>l_(e.epochMilliseconds);var Lm=new Map,pH={day:\"numeric\",month:\"numeric\",year:\"numeric\",hour:\"numeric\",minute:\"numeric\",second:\"numeric\",timeZoneName:\"longOffset\",fractionalSecondDigits:3,hourCycle:\"h23\"},dH=e=>{let t=e.resolvedOptions().timeZone,r=Lm.get(t);if(r!==void 0)return r;let n=Object.create(aH);return n.id=t,n.format=e,Lm.set(t,n),n},xb=e=>{let t=Lm.get(e);if(t!==void 0)return t;try{let r=dH(new Intl.DateTimeFormat(\"en-US\",{...pH,timeZone:e}));return Lm.set(e,r),r}catch{throw new pl(`Invalid time zone: ${e}`)}},Sl=e=>{let t=Object.create(iH);return t.offset=e,t},gb=Ln(xb);var mH=/^(?:GMT|[+-])/,yb=e=>{if(mH.test(e)){let t=Ib(e);return t===null?v():O(Sl(t))}return gb(e)},h_=e=>e._tag===\"Offset\"?bb(e.offset):e.id;var bl=e=>new Date(e.epochMilliseconds),Bm=e=>{if(e._tag===\"Utc\")return new Date(e.epochMilliseconds);if(e.zone._tag===\"Offset\")return new Date(e.epochMilliseconds+e.zone.offset);if(e.adjustedEpochMilliseconds!==void 0)return new Date(e.adjustedEpochMilliseconds);let t=e.zone.format.formatToParts(e.epochMilliseconds).filter(n=>n.type!==\"literal\"),r=new Date(0);return r.setUTCFullYear(Number(t[2].value),Number(t[0].value)-1,Number(t[1].value)),r.setUTCHours(Number(t[3].value),Number(t[4].value),Number(t[5].value),t[6]?.type===\"fractionalSecond\"?Number(t[6].value):(e.epochMilliseconds%1e3+1e3)%1e3),e.adjustedEpochMilliseconds=r.getTime(),r},Sb=e=>Bm(e).getTime()-Eb(e),bb=e=>{let t=Math.abs(e),r=Math.floor(t/(3600*1e3)),n=Math.round(t%(3600*1e3)/(60*1e3));return n===60&&(r+=1,n=0),`${e<0?\"-\":\"+\"}${String(r).padStart(2,\"0\")}:${String(n).padStart(2,\"0\")}`},x_=e=>bb(Sb(e)),Eb=e=>e.epochMilliseconds;var hH=(e,t)=>{if((t.year!==void 0||t.month!==void 0||t.day!==void 0)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),t.month!==void 0?t.month-1:e.getUTCMonth(),t.day??e.getUTCDate()),t.weekDay!==void 0){let r=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+r)}t.hour!==void 0&&e.setUTCHours(t.hour),t.minute!==void 0&&e.setUTCMinutes(t.minute),t.second!==void 0&&e.setUTCSeconds(t.second),t.millisecond!==void 0&&e.setUTCMilliseconds(t.millisecond)};var o_=1440*60*1e3,xH=(e,t,r)=>{if(t._tag===\"Offset\")return $o(e-t.offset,t);let n=yl(e-o_,e,t),o=yl(e+o_,e,t);if(n===o)return $o(e-n,t);let s=n{let t=gH.exec(e);if(t===null)return null;let[,r,n,o]=t;return(r===\"+\"?1:-1)*(Number(n)*60+Number(o))*60*1e3},yl=(e,t,r)=>{let n=r.format.formatToParts(e).find(s=>s.type===\"timeZoneName\")?.value??\"\";if(n===\"GMT\")return 0;let o=Ib(n);return o===null?Sb($o(t,r)):o};var g_=e=>bl(e).toISOString();var db=e=>{let t=Bm(e);return e._tag===\"Utc\"?t.toISOString():`${t.toISOString().slice(0,-1)}${x_(e)}`},Tb=e=>e.zone._tag===\"Offset\"?db(e):`${db(e)}[${e.zone.id}]`;var Ure=globalThis.Number;var S_=l(2,(e,t)=>{if(!globalThis.Number.isFinite(e)||!globalThis.Number.isFinite(t)||t===0)return NaN;if(globalThis.Number.isInteger(e)&&globalThis.Number.isInteger(t))return e%t;let[r,n]=y_(e),[o,s]=y_(t),a=Math.min(n,s),i=r*BigInt(10)**BigInt(n-a),c=o*BigInt(10)**BigInt(s-a),u=i%c;if(u===BigInt(0))return e<0||Object.is(e,-0)?-0:0;let f=globalThis.Number(`${u}e${a}`);return f===0?Math.sign(e)*globalThis.Number.MIN_VALUE:f});function y_(e){if(globalThis.Number.isInteger(e))return[BigInt(e),0];let t=Math.abs(e).toExponential(),r=t.indexOf(\"e\"),n=t.slice(0,r).replace(\".\",\"\");return[BigInt(n)*(e<0?-BigInt(1):BigInt(1)),globalThis.Number(t.slice(r+1))-n.length+1]}var b_=e=>{let t=Math.ceil(Math.log(e)/Math.log(2));return Math.max(Math.pow(2,t),2)};var Lre=globalThis.String,jm=Ir;var E_=e=>e.toUpperCase();var I_=e=>e.trim();var bH=(e,t,r,n,o)=>{let s=e;for(let c of t)s=s.replace(c,\"$1\\0$2\");for(let c of r)s=s.replace(c,\"\\0\");let a=0,i=s.length;for(;s.charAt(a)===\"\\0\";)a++;for(;s.charAt(i-1)===\"\\0\";)i--;return s.slice(a,i).split(\"\\0\").map(o).join(n)};var EH=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],IH=/[^A-Z0-9]+/gi;var T_=e=>bH(e,EH,[IH],\"_\",E_);var Xe=l(2,(e,t)=>Rc(e,TH,r=>t(r))),ys=e=>e.reasons.some(wb),wb=e=>e._tag===\"Fail\"&&Dc(e.error),jc=e=>{let t,r=!1;for(let n of e.reasons)wb(n)?t??=n.error:n._tag!==\"Interrupt\"&&(r=!0);return t===void 0?K(e):r?K(Uc(e.reasons.filter(n=>!wb(n)))):B(t)};var TH=e=>{let t=jc(e);return ce(t)?t:B(t.success.value)},Cb=e=>{let t=jc(e);return ce(t)?Ur(t.failure):pr(t.success.value)},qm=l(2,(e,t)=>Fo(e,{onSuccess:t.onSuccess,onFailure:r=>{let n=jc(r);return ce(n)?t.onFailure(n.failure):t.onDone(n.success.value)}}));var w_=\"~effect/Schedule\";var Jt=Te(\"effect/Schedule/CurrentMetadata\",{defaultValue:je({input:void 0,output:void 0,duration:qs,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),wH={[w_]:{_Out:R,_In:R,_Env:R},pipe(){return Z(this,arguments)}},Ab=e=>A(e,w_),kb=e=>{let t=Object.create(wH);return t.step=e,t},vb=()=>{let e=0,t,r;return(n,o)=>{r===void 0&&(r=n);let s=n-r,a=t===void 0?0:n-t;return t=n,{input:o,attempt:++e,start:r,now:n,elapsed:s,elapsedSincePrevious:a}}},CH=e=>kb(Re(e,t=>{let r=vb();return(n,o)=>t(r(n,o))})),El=e=>nn(e.step,t=>D(()=>Ue(t))),Hn=e=>zn(t=>Re(El(e),r=>{let n=vb();return o=>re(()=>{let s=t.currentTimeMillisUnsafe();return V(r(s,o),([a,i])=>{let c=n(s,o);return c.output=a,c.duration=i,vr(Nc(i),c)})})})),Il=e=>Re(Hn(e),t=>r=>Re(t(r),n=>n.output));var Ob=e=>kb(Re(El(e),t=>(r,n)=>qm(t(r,n),{onSuccess:o=>D([n,o[1]]),onFailure:Ue,onDone:()=>ee(n)}))),C_=e=>Tl(wl,({attempt:t})=>D(t<=e)),_b=e=>{let t=We(e);return CH(D(r=>D([r.attempt-1,t])))};var Tl=l(2,(e,t)=>kb(Re(El(e),r=>{let n=vb();return(o,s)=>V(r(o,s),a=>{let[i,c]=a,u=t({...n(o,s),output:i,duration:c});return V(ie(u)?u:D(u),f=>f?D(a):ee(i))})})));var wl=_b(qs);var AH=(e,t,r)=>bm(n=>V(r?.local?xl(t,hl(),n):Fm(t,n),o=>$n(e,o))),Hm=l(e=>ie(e[0]),(e,t,r)=>Mf(t)?$n(e,t):AH(e,Array.isArray(t)?t_(...t):t,r));var Rb=l(3,(e,t,r)=>V(Hn(t),n=>{let o=Jt.defaultValue();return on(dm(ti(V(re(()=>Or(e,Jt,o)),n),s=>z(()=>{o=s})),{disableYield:!0}),s=>kf(s)?D(s.value):r(s,o.attempt===0?v():O(o)))})),Pb=l(3,(e,t,r)=>V(Hn(t),n=>{let o=Jt.defaultValue(),s,a=on(re(()=>Or(e,Jt,o)),i=>(s=i,V(n(i),c=>(o=c,a))));return Xe(a,i=>$s(()=>r(s,i)))})),k_=l(2,(e,t)=>{let r=typeof t==\"function\"?t(R):Ab(t)?t:kl(t);return Rb(e,r,Je)}),Al=l(2,(e,t)=>{let r=typeof t==\"function\"?t(R):Ab(t)?t:kl(t);return Pb(e,r,Je)}),v_=l(3,(e,t,r)=>V(Hn(r),n=>{let o=Jt.defaultValue(),s=re(()=>Or(e,Jt,o));return on(V(n(t),a=>{o=a;let i=je(V(s,n));return Uo({while:Er,body:i,step(c){o=c}})}),a=>kf(a)?D(a.value):Je(a))})),kH=Ob(wl),kl=e=>{let t=e.schedule?Ob(e.schedule):kH;return e.while&&(t=Tl(t,({input:r})=>{let n=e.while(r);return ie(n)?n:D(n)})),e.until&&(t=Tl(t,({input:r})=>{let n=e.until(r);return ie(n)?Re(n,o=>!o):D(!n)})),e.times!==void 0&&(t=Tl(t,({attempt:r})=>D(r<=e.times))),t};var Mb=(e,t)=>{let r=-1,n=0,o=s=>xm(e(s));return{begin:zn(s=>re(()=>{let a=t();a.stepIndex!==r&&(r=a.stepIndex,n=0),n++;let i={attempt:a.attempt,stepAttempt:n,stepIndex:a.stepIndex,startNanos:s.monotonicTimeNanosUnsafe()};return vr(o({_tag:\"AttemptStart\",attempt:i.attempt,stepAttempt:i.stepAttempt,stepIndex:i.stepIndex}),i)})),end:(s,a)=>zn(i=>{let c=Po(i.monotonicTimeNanosUnsafe()-s.startNanos);return o(a._tag===\"Success\"?{_tag:\"AttemptSuccess\",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c}:{_tag:\"AttemptFailure\",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c,cause:a.cause})})}},__=l(e=>ie(e[0]),(e,t,r)=>re(()=>{let n=0,o={attempt:0,stepIndex:0},s=pm(Nm,z(()=>(o={attempt:o.attempt+1,stepIndex:n},o))),a=r?.onEvent===void 0?void 0:Mb(r.onEvent,()=>o),i=a===void 0?R:u=>jn(f=>V(a.begin,p=>sn(f(u),d=>a.end(p,d)))),c;return V(Uo({while:()=>np?d:(p=!0,Ac(c))),f=Al(f,vl(u,!1))}else{let p=vl(u,!0);f=p?Al(f,p):f}return Ks(f)},step(u){c=u,n++}}),()=>Ac(c))})),vl=(e,t)=>{if(t){if(e.attempts===1||!(e.schedule||e.attempts))return}else return kl({schedule:e.schedule?e.schedule:e.attempts?void 0:vH,times:e.attempts,while:e.while});return kl({schedule:e.schedule,while:e.while,times:e.attempts?e.attempts-1:void 0})},vH=C_(1);var OH=\"~effect/Request\",_H=pC({_E:e=>e,_A:e=>e,_R:e=>e}),ene={...SC,[OH]:_H};var P_=e=>e;var F_=l(2,(e,t)=>{let r=n=>mt(o=>{let s=U_(n,e,o,fs());return PH(n,s)});return ie(t)?V(t,r):r(t)}),N_=(e,t)=>{let r=U_(t.resolver,e,t.onExit,{context:t.context,cache:{scheduler:Fe(t.context,$f)}});return()=>D_(t.resolver,r)},Wm=[],Fb=new WeakMap,U_=(e,t,r,n)=>{let o=Fb.get(e);o||(o=new Map,Fb.set(e,o));let s,a=!1,i=P_({request:t,context:n.context,uninterruptible:!1,completeUnsafe(u){a||(a=!0,!(s&&!s.entrySet.delete(i))&&r(u))}});if(e.preCheck!==void 0&&!e.preCheck(i))return i;let c=e.batchKey(i);if(s=o.get(c),!s){if(Wm.length>0)s=Wm.pop(),s.key=c,s.resolver=e,s.map=o;else{let u={key:c,resolver:e,map:o,entrySet:new Set,entries:new Set,delayEffect:V(re(()=>u.resolver.delay),f=>M_(u)),run:sn(re(()=>u.resolver.runAll(Array.from(u.entries),u.key)),f=>{for(let p of u.entrySet)p.completeUnsafe(f._tag===\"Success\"?Tr(new Error(\"Effect.request: RequestResolver did not complete request\",{cause:p.request})):f);return u.entries.clear(),Wm.length<128&&(u.entrySet.clear(),u.key=void 0,u.fiber=void 0,u.resolver=void 0,u.map=void 0,Wm.push(u)),le})};s=u}o.set(c,s),s.fiber=ds(n.context)(s.delayEffect,{scheduler:n.cache.scheduler})}return s.entrySet.add(i),s.entries.add(i),s.resolver.collectWhile(s.entries)||(s.fiber.interruptUnsafe(n.id),s.fiber=ds(n.context)(M_(s),{scheduler:n.cache.scheduler})),i},D_=(e,t)=>{if(t.uninterruptible)return;let r=Fb.get(e);if(!r)return;let n=e.batchKey(t),o=r.get(n);if(!o||!o.entries.delete(t))return;o.entrySet.delete(t);let s;o.entries.size===0&&(r.delete(n),s=o.fiber),t.completeUnsafe(Oc()),s?.interruptUnsafe()},PH=(e,t)=>z(()=>D_(e,t));function M_(e){return e.map.has(e.key)?(e.map.delete(e.key),e.run):le}var FH=\"effect/Metric/CurrentMetricAttributes\",NH=Te(FH,{defaultValue:()=>({})}),UH=\"effect/Metric/MetricRegistry\",DH=Te(UH,{defaultValue:()=>new Map}),L_=\"~effect/Metric\",$_=class{[L_]=L_;#t;#e=\"\";id;description;attributes;constructor(t,r,n){this.id=t,this.description=r,this.attributes=n}valueUnsafe(t){return this.hook(t).get(t)}modifyUnsafe(t,r){return this.hook(r).modify(t,r)}updateUnsafe(t,r){return this.hook(r).update(t,r)}hook(t){let r=Fe(t,NH);r!==this.#t&&(this.#t=r,this.#e=LH(this,B_(this.attributes,r)));let n=Fe(t,DH),o=n.get(this.#e);return tC(o)&&(o={id:this.id,type:this.type,description:this.description,attributes:Object.keys(r).length>0?B_(this.attributes,r):this.attributes,hooks:this.createHooks()},n.set(this.#e,o)),o.hooks}pipe(){return Z(this,arguments)}};var zc=l(2,(e,t)=>Ys(r=>z(()=>e.updateUnsafe(t,r))));function LH(e,t){let r=Object.entries(t).sort((n,o)=>n[0]o[0]?1:0);return JSON.stringify([e.type,e.id,e.description,r])}function B_(e,t){return{...j_(e),...j_(t)}}function j_(e){return Io(e)&&Array.isArray(e)?e.reduce((t,[r,n])=>(N(t,r,n),t),{}):e}var $H=ko,Bo=ie,Jm=cl,BH=FS,jH=qv,zH=Hv,qH=Wv,HH=Kv,ta=rn,WH=Vv,Wn=Uo,Km=Yy,Hc=gk,g=D,ra=ei,Nb=Zy,$=re,te=z,Y=le;var JH=JS;var Wc=mt,ui=um,KH=tO,GH=rO,VH=oO;var ZH=nO,dr=Ek,P=Je,Gm=cm,it=Ue,Ss=hk,Rr=Vs,Jc=xk;var Ol=kc,YH=Vy,an=ne,QH=IC,_l=Ac,XH=Gy,eW=mk,tW=dk,I=V,Ub=Rk,mr=No,Pr=ti,rW=Ks,nW=xv,kn=ol,j=Re,Ft=vr,Vm=vc,na=el,oW=Ak,Db=Qk,sW=dS,oa=on;var aW=gS,iW=uv,cW=fv,uW=lv,fW=pv,xt=nn,Rl=ov,lW=rl,pW=hm,dW=nv,mW=hS,hW=Rc,Zm=yS,xW=SS,Lb=bS,Ym=xS,gW=iv,H_=sv,yW=av,SW=mm,W_=cv,bW=ES,EW=Al,IW=Pb,TW=kk,wW=hv,CW=xm,AW=__,kW=zO,vW=dv,OW=mv,_W=Tv,RW=wS,PW=TS,$b=Iv,sa=Nc,MW=wv,Bb=rS,FW=nS,NW=vk,Kc=oS,jb=Qv,UW=Xv,zb=eO,DW=NS,LW=US,$W=Xk,BW=Yv,Qm=ev,qb=gm,jW=nl,zW=IS,qW=Sv,HW=Ok,fi=Fo,Hb=Pc,WW=bv,JW=Ev,li=pS,Pl=Ys,KW=Hm,vn=$n,GW=Yk,Wb=Gk,Jb=Vk,VW=_c,ZW=ps,YW=Zk,jo=Or,QW=pm,pi=sl,Xm=kS,Kb=bm,di=ri,XW=Fv,J_=al,eJ=vS,mi=Rv,Jn=RS,tJ=Pv,rJ=PS,Gb=Bn,cn=sn,nJ=OS,oJ=_S,sJ=Dv,aJ=Uv,iJ=MS,On=Lv,cJ=Em,Vb=Mv,bs=ni,zo=jn,uJ=jv,fJ=zv,$t=dm,lJ=k_,pJ=Rb,dJ=mS,mJ=tv,hJ=l(2,(e,t)=>K_(e,void 0,t)),K_=v_,xJ=gO,gJ=yO,yJ=SO,SJ=bO,bJ=vO,EJ=OO,IJ=_O,TJ=RO,wJ=wO,CJ=CO,AJ=AO,Zb=IO,kJ=qf,vJ=Hf,OJ=kO,_J=TO,RJ=wc,PJ=F_,MJ=N_,Gc=sO,Nt=DS,Vc=cO,FJ=aO,NJ=iO,UJ=Sk,DJ=bk,Ml=fO,_n=ds,LJ=LS,$J=lO,Yb=dO,Qb=$S,eh=pO,BJ=wm,jJ=hO,zJ=BS,qo=mO,qJ=Cm,Se=Xy,HJ=Ik,hi=zn,th=qn,WJ=qn(),JJ=qn(\"Fatal\"),KJ=qn(\"Warn\"),Xb=qn(\"Error\"),GJ=qn(\"Info\"),VJ=qn(\"Debug\"),ZJ=qn(\"Trace\"),YJ=l(2,(e,t)=>ps(e,WS,r=>new Set([...r,t]))),QJ=l(e=>Bo(e[0]),(e,...t)=>ps(e,HO,r=>{let n=t.length===1?{...r,...t[0]}:{...r};return t.length===1||N(n,t[0],t[1]),n})),XJ=BO,eK=l(2,(e,t)=>V(qS,r=>ps(e,WO,n=>[[t,r],...n]))),tK=l(e=>Bo(e[0]),(e,t,r)=>cn(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),rK=l(e=>Bo(e[0]),(e,t,r)=>Pr(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),nK=l(e=>Bo(e[0]),(e,t,r)=>Ym(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),oK=l(e=>Bo(e[0]),(e,t,r)=>W_(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),sK=l(e=>Bo(e[0]),(e,t,r)=>hi(n=>{let o=n.monotonicTimeNanosUnsafe();return cn(e,()=>{let s=n.monotonicTimeNanosUnsafe(),a=AA(We(s),We(o)),i=r===void 0?a:r(a);return zc(t,i)})})),qc=class extends fr()(\"effect/Effect/Transaction\"){},aK=e=>an(t=>{let r=Rd(t.context,qc);if(r)return e;r={journal:new Map,retry:!1};let n;return zo(o=>I(Wn({while:()=>!n,body:je(o(e).pipe(jo(qc,r),H_(()=>r.retry?o(iK(r)):Y),kn)),step(s){if(r.retry||!G_(r))return q_(r);Ke(s)?cK(t,r):q_(r),n=s}}),()=>n))}),G_=e=>{for(let[t,{version:r}]of e.journal)if(t.version!==r)return!1;return!0},iK=e=>Wc(t=>{if(!G_(e))return t(Y);let r={},n=Array.from(e.journal.keys()),o=()=>{for(let a of n)a.pending.delete(r)},s=()=>{o(),t(Y)};for(let a of n)a.pending.set(r,s);return te(o)});function cK(e,t){for(let[r,{value:n,written:o}]of t.journal)if(o){Object.is(n,r.value)||(r.version=r.version+1,r.value=n);for(let s of r.pending.values())e.currentDispatcher.scheduleTask(s,0);r.pending.clear()}}function q_(e){e.retry=!1,e.journal.clear()}var uK=I(qc,e=>(e.retry=!0,On)),fK=(e,t,r)=>(...n)=>Wc(o=>{try{e(...n,(s,a)=>{o(s?P(t?t(s,n):s):g(a))})}catch(s){o(r?P(r(s,n)):Rr(s))}}),lK=()=>e=>e,pK=()=>e=>e,dK=()=>e=>e,Dr=Pk,Fl=Mk,Kt=Fk,nt=_k,Zc=Nk,eE=Tk;var V_=/^[+-]?\\d+$/,rE=\"~effect/BigDecimal\",mK={[rE]:rE,[se](){let e=oE(this);return fe(_e(String(e.value)),It(e.scale))},[ae](e){return nE(e)&&tR(this,e)===0},toString(){return`BigDecimal(${Es(this)})`},toJSON(){return{_id:\"BigDecimal\",value:String(this.value),scale:this.scale}},[Ie](){return this.toJSON()},pipe(){return Z(this,arguments)}},nE=e=>A(e,rE),Q_=(e,t)=>{if(!Number.isSafeInteger(t))throw new RangeError(`Scale must be a safe integer, got ${t}`);let r=Object.create(mK);return r.value=e,r.scale=t,r},X_=(e,t)=>{let r=Q_(e,t);return r.normalized=r,r};var Kn=BigInt(0),hK=BigInt(1);var xK=BigInt(10),eR=X_(Kn,0);var oE=e=>{if(e.normalized===void 0)if(e.value===Kn)e.normalized=eR;else{let t=`${e.value}`,r=t.length;for(;t[r-1]===\"0\";)r--;e.normalized=X_(BigInt(t.slice(0,r)),e.scale-(t.length-r))}return e.normalized};var gK=100,yK=[hK],tE=(e,t)=>e===t?0:e{let r=`${e.value{if(e.scale===t.scale)return tE(e.value,t.value);let r=Y_(e),n=Y_(t);if(r!==n)return rgK)return r===-1?Z_(t,e):Z_(e,t);let a=yK[s]??=xK**BigInt(s);return o>0?tE(e.value,t.value*a):tE(e.value*a,t.value)},Yc=Bs(tR);var Y_=e=>e.value===Kn?0:e.value{if(e===\"\")return O(eR);let t,r,n=e.search(/[eE]/);if(n!==-1){let c=e.slice(n+1);if(t=e.slice(0,n),r=Number(c),t===\"\"||!Number.isSafeInteger(r)||!V_.test(c))return v()}else t=e,r=0;let o,s,a=t.search(/\\./);if(a!==-1){let c=t.slice(0,a),u=t.slice(a+1);o=`${c}${u}`,s=u.length}else o=t,s=0;if(!V_.test(o))return v();let i=s-r;return Number.isSafeInteger(i)?O(Q_(BigInt(o),i)):v()};var Es=e=>{let t=oE(e);if(Math.abs(t.scale)>=16)return SK(t);let r=t.value0?n.padStart(t.scale+1,\"0\"):n.padEnd(n.length-t.scale,\"0\"),s=o.length-t.scale,a=t.scale>0?`${o.slice(0,s)}.${o.slice(s)}`:o;return r?`-${a}`:a},SK=e=>{if(bK(e))return\"0e+0\";let t=oE(e),r=`${t.value}`,n=t.value=0?\"+\":\"\"}${a}`};var bK=e=>e.value===Kn;var me={};Eo(me,{Any:()=>V3,Array:()=>$e,ArrayEnsure:()=>aV,BigDecimal:()=>sD,BigDecimalFromString:()=>BZ,BigInt:()=>Fu,BigIntFromString:()=>wZ,Boolean:()=>VT,BooleanFromBit:()=>RZ,BooleanLiterals:()=>XT,ByteSize:()=>Bu,ByteSizeFromBigInt:()=>zZ,ByteSizeFromNumber:()=>qZ,ByteSizeFromString:()=>jZ,Cause:()=>WT,CauseReason:()=>HT,Char:()=>uZ,Chunk:()=>HZ,Class:()=>ND,Cookie:()=>PD,Cookies:()=>MD,Date:()=>$u,DateFromMillis:()=>gZ,DateFromString:()=>xZ,DateTimeUtc:()=>Cx,DateTimeUtcFromDate:()=>ZZ,DateTimeUtcFromMillis:()=>QZ,DateTimeUtcFromString:()=>YZ,DateTimeZoned:()=>ID,DateTimeZonedFromString:()=>r5,Defect:()=>lZ,Duration:()=>kx,DurationFromMillis:()=>W5,DurationFromNanos:()=>H5,DurationFromString:()=>lw,Enum:()=>K3,Error:()=>UD,ErrorInstance:()=>fZ,Exit:()=>J5,FalseLiterals:()=>FU,File:()=>QU,Finite:()=>Du,FiniteFromString:()=>TZ,FormData:()=>XU,Graph:()=>Z5,HashMap:()=>Y5,HashSet:()=>Q5,Headers:()=>n8,InetAddress:()=>_D,InetAddressFromString:()=>D5,InetAddressV4:()=>N5,InetAddressV6:()=>U5,Int:()=>co,IpAddress:()=>qi,IpAddressFromString:()=>zu,IpInterface:()=>AD,IpInterfaceFromString:()=>R5,IpLinkLocalAddress:()=>g5,IpLinkLocalAddressFromString:()=>y5,IpLoopbackAddress:()=>h5,IpLoopbackAddressFromString:()=>x5,IpMulticastAddress:()=>n5,IpMulticastAddressFromString:()=>o5,IpNetwork:()=>OD,IpNetworkFromString:()=>F5,IpUnicastAddress:()=>i5,IpUnicastAddressFromString:()=>c5,IpUnspecifiedAddress:()=>S5,IpUnspecifiedAddressFromString:()=>b5,Ipv4Address:()=>Ax,Ipv4AddressFromString:()=>uw,Ipv4BroadcastAddress:()=>l5,Ipv4BroadcastAddressFromString:()=>p5,Ipv4Interface:()=>wD,Ipv4InterfaceFromString:()=>O5,Ipv4Network:()=>kD,Ipv4NetworkFromString:()=>P5,Ipv4PrivateAddress:()=>E5,Ipv4PrivateAddressFromString:()=>I5,Ipv6Address:()=>fw,Ipv6AddressFromString:()=>TD,Ipv6Interface:()=>CD,Ipv6InterfaceFromString:()=>_5,Ipv6Network:()=>vD,Ipv6NetworkFromString:()=>M5,Ipv6UniqueLocalAddress:()=>T5,Ipv6UniqueLocalAddressFromString:()=>w5,Json:()=>Ox,JsonFromUrlParamsField:()=>o8,JsonObject:()=>P8,Literal:()=>wt,Literals:()=>io,MacAddress:()=>zi,MacAddressFromString:()=>ju,MacBroadcastAddress:()=>d5,MacBroadcastAddressFromString:()=>m5,MacLocallyAdministeredAddress:()=>C5,MacLocallyAdministeredAddressFromString:()=>A5,MacMulticastAddress:()=>s5,MacMulticastAddressFromString:()=>a5,MacUnicastAddress:()=>u5,MacUnicastAddressFromString:()=>f5,MacUniversallyAdministeredAddress:()=>k5,MacUniversallyAdministeredAddressFromString:()=>v5,MutableJson:()=>F8,Natural:()=>Li,Never:()=>G3,NonEmptyArray:()=>YT,NonEmptyString:()=>aw,Null:()=>yx,NullOr:()=>QT,NullishOr:()=>CU,Number:()=>ji,NumberFromString:()=>IZ,ObjectKeyword:()=>Q3,Opaque:()=>SV,Option:()=>Hi,OptionFromNullOr:()=>X5,OptionFromNullishOr:()=>t8,OptionFromOptional:()=>i8,OptionFromOptionalKey:()=>a8,OptionFromOptionalNullOr:()=>c8,OptionFromUndefinedOr:()=>e8,PropertyKey:()=>qT,ReadonlyMap:()=>pZ,ReadonlySet:()=>dZ,Record:()=>ks,RecordFromCookies:()=>r8,RecordFromUrlParams:()=>s8,Redacted:()=>vx,RedactedFromValue:()=>u8,RegExp:()=>mZ,Result:()=>f8,SchemaError:()=>As,SocketAddress:()=>$5,StandardSchemaV1FailureResult:()=>_Z,String:()=>J,StringForLiteralAutocomplete:()=>Z3,StringFromBase64:()=>AZ,StringFromBase64Url:()=>kZ,StringFromHex:()=>vZ,StringFromUriComponent:()=>OZ,Struct:()=>Me,StructWithRest:()=>oV,Symbol:()=>IU,TaggedClass:()=>m8,TaggedError:()=>h8,TaggedStruct:()=>Ex,TaggedUnion:()=>yV,TemplateLiteral:()=>W3,TemplateLiteralParser:()=>J3,TimeZone:()=>bD,TimeZoneFromString:()=>t5,TimeZoneNamed:()=>yD,TimeZoneNamedFromString:()=>e5,TimeZoneOffset:()=>XZ,Tree:()=>R8,Trim:()=>CZ,Trimmed:()=>tD,TrueLiterals:()=>MU,Tuple:()=>Zo,TupleWithRest:()=>sV,URL:()=>Tx,URLFromString:()=>hZ,URLSearchParams:()=>eD,Uint8Array:()=>wx,Uint8ArrayFromBase64:()=>PZ,Uint8ArrayFromBase64Url:()=>MZ,Uint8ArrayFromHex:()=>FZ,Undefined:()=>GT,UndefinedOr:()=>bx,Union:()=>st,UniqueArray:()=>iV,UniqueSymbol:()=>X3,UnixPathAddress:()=>RD,UnixPathAddressFromString:()=>L5,Unknown:()=>Ap,UnknownFromJsonString:()=>SZ,UrlParams:()=>pw,Void:()=>Y3,annotate:()=>y3,annotateEncoded:()=>S3,annotateKey:()=>b3,asserts:()=>C3,brand:()=>vU,catchDecoding:()=>lV,catchDecodingWithContext:()=>RU,catchEncoding:()=>pV,catchEncodingWithContext:()=>PU,check:()=>uV,declare:()=>Be,declareConstructor:()=>qr,decode:()=>dV,decodeEffect:()=>A3,decodeExit:()=>k3,decodeOption:()=>O3,decodePromise:()=>R3,decodeResult:()=>_3,decodeSync:()=>P3,decodeTo:()=>G,decodeUnknownEffect:()=>hx,decodeUnknownExit:()=>dU,decodeUnknownOption:()=>v3,decodeUnknownPromise:()=>hU,decodeUnknownResult:()=>mU,decodeUnknownSync:()=>xU,encode:()=>mV,encodeEffect:()=>M3,encodeExit:()=>F3,encodeKeys:()=>rV,encodeOption:()=>U3,encodePromise:()=>L3,encodeResult:()=>D3,encodeSync:()=>$3,encodeTo:()=>ew,encodeUnknownEffect:()=>xx,encodeUnknownExit:()=>gU,encodeUnknownOption:()=>N3,encodeUnknownPromise:()=>SU,encodeUnknownResult:()=>yU,encodeUnknownSync:()=>bU,extendTo:()=>nV,fieldsAssign:()=>eV,flip:()=>zT,fromBrand:()=>fV,fromFormData:()=>bZ,fromJsonString:()=>iw,fromURLSearchParams:()=>EZ,instanceOf:()=>xa,is:()=>w3,isBase64:()=>BU,isBase64Url:()=>vV,isBetween:()=>Lu,isBetweenBigDecimal:()=>$Z,isBetweenBigInt:()=>QV,isBetweenCodePoints:()=>tZ,isBetweenDate:()=>GV,isBetweenLength:()=>nw,isBetweenProperties:()=>iZ,isBetweenSize:()=>oZ,isCapitalized:()=>FV,isEndingWith:()=>_V,isFinite:()=>UV,isGUID:()=>AV,isGreaterThan:()=>LV,isGreaterThanBigDecimal:()=>NZ,isGreaterThanBigInt:()=>VV,isGreaterThanDate:()=>HV,isGreaterThanOrEqualTo:()=>jU,isGreaterThanOrEqualToBigDecimal:()=>UZ,isGreaterThanOrEqualToBigInt:()=>zU,isGreaterThanOrEqualToDate:()=>WV,isIncluding:()=>RV,isInt:()=>Ix,isInt32:()=>zV,isLessThan:()=>$V,isLessThanBigDecimal:()=>DZ,isLessThanBigInt:()=>ZV,isLessThanDate:()=>JV,isLessThanOrEqualTo:()=>BV,isLessThanOrEqualToBigDecimal:()=>LZ,isLessThanOrEqualToBigInt:()=>YV,isLessThanOrEqualToDate:()=>KV,isLowercased:()=>MV,isMaxCodePoints:()=>eZ,isMaxLength:()=>JU,isMaxProperties:()=>aZ,isMaxSize:()=>nZ,isMinCodePoints:()=>XV,isMinLength:()=>qU,isMinProperties:()=>sZ,isMinSize:()=>rZ,isMultipleOf:()=>jV,isNonEmpty:()=>WU,isPattern:()=>Uu,isPropertyNames:()=>cZ,isSchema:()=>gx,isSchemaError:()=>cU,isStartingWith:()=>OV,isStringBigInt:()=>IV,isStringFinite:()=>EV,isStringSymbol:()=>TV,isTrimmed:()=>$U,isULID:()=>kV,isUUID:()=>CV,isUint32:()=>qV,isUncapitalized:()=>NV,isUnique:()=>sw,isUniqueKey:()=>KU,isUppercased:()=>PV,link:()=>Ae,linkDecoding:()=>Nu,make:()=>q,makeFilter:()=>Ne,makeFilterGroup:()=>bV,makeIsBetween:()=>Rp,makeIsGreaterThan:()=>kp,makeIsGreaterThanOrEqualTo:()=>vp,makeIsLessThan:()=>Op,makeIsLessThanOrEqualTo:()=>_p,makeIsMultipleOf:()=>DV,middlewareDecoding:()=>OU,middlewareEncoding:()=>_U,mutable:()=>cV,mutableKey:()=>z3,optional:()=>Pu,optionalKey:()=>$i,overrideToCodecIso:()=>O8,overrideToEquivalence:()=>y8,overrideToFormatter:()=>x8,readonlyKey:()=>q3,refine:()=>kU,required:()=>j3,requiredKey:()=>B3,resolveAnnotations:()=>N8,resolveAnnotationsKey:()=>U8,revealBottom:()=>g3,revealCodec:()=>E3,suspend:()=>AU,tag:()=>Bi,tagDefaultOmit:()=>gV,toCodecArrayFromSingle:()=>w8,toCodecIso:()=>T8,toCodecJson:()=>I8,toCodecStringTree:()=>Mp,toDifferJsonPatch:()=>_8,toEncoded:()=>Mu,toEncoderXml:()=>C8,toEquivalence:()=>S8,toFormatter:()=>g8,toIso:()=>A8,toIsoFocus:()=>v8,toIsoSource:()=>k8,toJsonSchemaDocument:()=>E8,toRepresentation:()=>b8,toStandardJSONSchemaV1:()=>T3,toStandardSchemaV1:()=>I3,toTaggedUnion:()=>LU,toType:()=>Hr,withArrayLengthConstraints:()=>Sx,withConstructorDefault:()=>NU,withDecodingDefault:()=>DU,withDecodingDefaultKey:()=>tw,withDecodingDefaultType:()=>xV,withDecodingDefaultTypeKey:()=>hV});var oR=globalThis.BigInt;var sR=e=>e>oR(Number.MAX_SAFE_INTEGER)||ee.names.map(t=>[t,e])));var aE=e=>e;var Qc=e=>{throw new Error(`Invalid ByteSize: ${e}`)},cR=e=>!Number.isSafeInteger(e)||e<0?Qc(`expected a non-negative safe integer, received ${e}`):aE(BigInt(e));var uR=e=>{let t=/^\\s*(\\d+)(?:\\.(\\d+))?\\s*([A-Za-z]+)\\s*$/.exec(e);if(t===null)return Qc(`unsupported syntax ${JSON.stringify(e)}`);let r=wK.get(t[3]);if(r===void 0)return Qc(`unsupported unit ${JSON.stringify(t[3])}`);let n=t[2]??\"\",o=BigInt(10)**BigInt(n.length),s=BigInt(t[1]+n)*r.factor;return s%o!==sE?Qc(`${JSON.stringify(e)} does not represent an integral number of bytes`):aE(s/o)},fR=Ln(uR),rh=e=>{switch(typeof e){case\"bigint\":return etypeof e==\"bigint\"?rh(e):cR(e);var pR=e=>typeof e==\"bigint\"&&e>=sE;var nh=e=>e,dR=sR;var hR=\"~effect/Chunk\";function mR(e,t,r,n,o){for(let s=t;str((t,r)=>{if(t.length!==r.length)return!1;let n=xi(t),o=xi(r);for(let s=0;se},toString(){return`Chunk(${F(xi(this))})`},toJSON(){return{_id:\"Chunk\",values:kt(xi(this))}},[Ie](){return this.toJSON()},[ae](e){return sh(e)&&kK(this,e)},[se](){return To(xi(this))},[Symbol.iterator](){switch(this.backing._tag){case\"IArray\":return this.backing.array[Symbol.iterator]();case\"IEmpty\":return xR[Symbol.iterator]();default:return xi(this)[Symbol.iterator]()}},pipe(){return Z(this,arguments)}},fE=e=>{let t=Object.create(vK);switch(t.backing=e,e._tag){case\"IEmpty\":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case\"IConcat\":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case\"IArray\":{t.length=e.array.length,t.depth=0,t.left=Is,t.right=Is;break}case\"ISingleton\":{t.length=1,t.depth=0,t.left=Is,t.right=Is;break}case\"ISlice\":{t.length=e.length,t.depth=0,t.left=Is,t.right=Is;break}}return t},sh=e=>A(e,hR),Is=fE({_tag:\"IEmpty\"}),OK=()=>Is;var _K=e=>fE({_tag:\"ISingleton\",a:e}),lE=e=>sh(e)?e:PK(Ve(e)),cE=(e,t,r)=>{switch(e.backing._tag){case\"IArray\":{mR(e.backing.array,0,t,r,e.length);break}case\"IConcat\":{cE(e.left,t,r),cE(e.right,t,r+e.left.length);break}case\"ISingleton\":{t[r]=e.backing.a;break}case\"ISlice\":{mR(xi(e.backing.chunk),e.backing.offset,t,r,e.length);break}}};var RK=e=>{switch(e.backing._tag){case\"IEmpty\":return xR;case\"IArray\":return e.backing.array;default:{let t=new Array(e.length);return cE(e,t,0),e.backing={_tag:\"IArray\",array:t},e.left=Is,e.right=Is,e.depth=0,t}}},xi=RK;var PK=e=>e.length===0?OK():e.length===1?_K(e[0]):fE({_tag:\"IArray\",array:e});var gR=e=>e.length;var dE=Bc,yR=ii,SR=i_,bR=c_,ER=u_,IR=mb,TR=f_;var wR=$m;var CR=hb;var mE=p_,AR=d_;var hE=m_;var xE=xb,gE=Sl,kR=gb;var vR=yb,Nl=h_;var OR=bl;var _R=Eb;var RR=g_;var yE=Tb;var Xc=e=>MK(typeof e==\"string\"?FK.encode(e):e),gi=e=>{let t=UK(e),r=t.length;if(r%4!==0)return K(new wn({kind:\"Decode\",module:\"Base64\",input:t,message:`Length must be a multiple of 4, but is ${r}`}));let n=t.indexOf(\"=\");if(n!==-1&&(nUf(t4(e,t,r));function r4(e){let t=tP(e.name,e.valueEncoded,e.options);if(t!==void 0)throw t;let r=e.name+\"=\"+e.valueEncoded;if(e.options===void 0)return r;let n=e.options;if(n.maxAge!==void 0){let o=IA(We(n.maxAge));r+=\"; Max-Age=\"+Math.trunc(o)}if(n.domain!==void 0&&(r+=\"; Domain=\"+n.domain),n.path!==void 0&&(r+=\"; Path=\"+n.path),n.priority!==void 0)switch(n.priority){case\"low\":r+=\"; Priority=Low\";break;case\"medium\":r+=\"; Priority=Medium\";break;case\"high\":r+=\"; Priority=High\";break}if(n.expires!==void 0&&(r+=\"; Expires=\"+n.expires.toUTCString()),n.httpOnly&&(r+=\"; HttpOnly\"),n.secure&&(r+=\"; Secure\"),n.partitioned&&(r+=\"; Partitioned\"),n.sameSite!==void 0)switch(n.sameSite){case\"lax\":r+=\"; SameSite=Lax\";break;case\"strict\":r+=\"; SameSite=Strict\";break;case\"none\":r+=\"; SameSite=None\";break}return r}var nP=e=>{let t={},r=Object.values(e.cookies);for(let n=0;nObject.values(e.cookies).map(r4);var n4=e=>{try{return decodeURIComponent(e)}catch{return e}};var Ii=new WeakMap,sP=e=>{if(Ii.has(e))return Ii.get(e);throw new Error(\"Unable to get redacted value\"+(e.label?` with label: \"${e.label}\"`:\"\"))};var aP=\"~effect/Redacted\",$E=e=>A(e,aP),Ti=(e,t)=>{let r=Object.create(a4);return t?.label&&(r.label=t.label),Ii.set(r,e),r},a4={[aP]:{_A:e=>e},label:void 0,...er,toJSON(){return this.toString()},toString(){return``},[se](){return H(Ii.get(this))},[ae](e){return $E(e)&&W(Ii.get(this),Ii.get(e))}},eu=sP;var iP=e=>tr((t,r)=>e(eu(t),eu(r)));var jE=Symbol.for(\"~effect/http/Headers\"),cP=e=>A(e,jE),zE=Object.defineProperties(Object.create(null),{[jE]:{value:jE},[Ra]:{value(e){return c4(this,Fe(e,u4))}},toJSON:{value(){return Ds(this)}},[ae]:{value(e){return qE(this,e)}},[se]:{value(){return bf(this)}},toString:{value:ic.toString},[Ie]:{value:ic[Ie]}});var qE=uA(za()),i4=Object.create(zE),uP=e=>{if(e===void 0)return i4;if(Symbol.iterator in e){let r=Object.create(zE);for(let[n,o]of e)r[n.toLowerCase()]=o;return r}let t=Object.create(zE);for(let[r,n]of Object.entries(e))Array.isArray(n)?t[r.toLowerCase()]=n.join(\", \"):n!==void 0&&(t[r.toLowerCase()]=n);return t};var c4=l(2,(e,t)=>{let r={...e},n=o=>{if(typeof o==\"string\"){let s=o.toLowerCase();s in e&&(r[s]=Ti(e[s]))}else for(let s in e)s.search(o)!==-1&&(r[s]=Ti(e[s]))};if(Array.isArray(t))for(let o=0;o[\"authorization\",\"cookie\",\"set-cookie\",\"x-api-key\"]});var HE=\"~effect/http/UrlParams\",WE=e=>A(e,HE),l4={...er,[HE]:HE,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:\"UrlParams\",params:Object.fromEntries(this.params)}},[ae](e){return JE(this,e)},[se](){return To(this.params.flat())}},dh=e=>{let t=Object.create(l4);return t.params=e,t},fP=e=>{if(WE(e))return e;let t=lP(e),r=[];for(let n=0;n{let t=typeof e[Symbol.iterator]==\"function\"?Ve(e):Object.entries(e),r=[];for(let[n,o]of t)if(Array.isArray(o))for(let s=0;sp4(e.params,t.params)),p4=dA(rA([za(),za()]));var pP=l(2,(e,t)=>dy(e.params,([r])=>r===t).pipe(_t(([,r])=>r)));var d4=e=>{let t={};for(let[r,n]of e.params)if(!Object.hasOwn(t,r))N(t,r,n);else{let o=t[r];typeof o==\"string\"?N(t,r,[o,n]):o.push(n)}return t},dP=d4;var KE=\"~effect/Graph\",GE=e=>A(e,KE),mP=e=>e;var h4=(e,t,r)=>(e===\"directed\"?t.source===r.source&&t.target===r.target:t.source===r.source&&t.target===r.target||t.source===r.target&&t.target===r.source)&&W(t.data,r.data),x4=(e,t)=>e===\"directed\"?H(t):zt(fe(H(t.data),g4(t.source,t.target))),g4=(e,t)=>fe(0,H(e))+fe(0,H(t)),y4=_e(\"Graph\"),S4={[KE]:{_N:e=>e,_E:e=>e},[Symbol.iterator](){return this.nodes[Symbol.iterator]()},[Ie](){return this.toJSON()},[ae](e){if(A(e,KE)){let t=mP(e);if(this.nodes.size!==t.nodes.size||this.edges.size!==t.edges.size||this.type!==t.type)return!1;for(let[r,n]of this.nodes)if(!t.nodes.has(r)||!W(n,t.nodes.get(r)))return!1;for(let[r,n]of this.edges){let o=t.edges.get(r);if(o===void 0||!h4(this.type,n,o))return!1}return!0}return!1},[se](){let e=y4;e=e^_e(this.type),e=e^It(this.nodes.size),e=e^It(this.edges.size);for(let[t,r]of this.nodes)e^=fe(H(t),H(r));for(let[t,r]of this.edges)e^=fe(H(t),x4(this.type,r));return zt(e)},toJSON(){return{_id:\"Graph\",nodeCount:this.nodes.size,edgeCount:this.edges.size,type:this.type}},toString(){return`Graph(${this.type}, ${this.nodes.size}, ${this.edges.size})`},pipe(){return Z(this,arguments)}},b4=(e,t)=>{let r=Object.create(S4);return r.type=e,r.mutable=t,r.transforming=!1,r.nodes=new Map,r.edges=new Map,r.adjacency=new Map,r.reverseAdjacency=new Map,r.nextNodeIndex=0,r.nextEdgeIndex=0,r.acyclic=O(!0),r};var zl=e=>{let t=mP(e);return{type:e.type,nodes:Array.from(t.nodes,([r,n])=>({index:r,data:n})).sort((r,n)=>r.index-n.index),edges:Array.from(t.edges,([r,n])=>({index:r,source:n.source,target:n.target,data:n.data})).sort((r,n)=>r.index-n.index)}},mh=e=>{let t=b4(e.type,!1);for(let r of e.nodes)t.nodes.set(r.index,r.data),t.adjacency.set(r.index,[]),t.reverseAdjacency.set(r.index,[]);for(let r of e.edges)t.edges.set(r.index,{source:r.source,target:r.target,data:r.data}),t.adjacency.get(r.source).push(r.index),t.reverseAdjacency.get(r.target).push(r.index),e.type===\"undirected\"&&(t.adjacency.get(r.target).push(r.index),t.reverseAdjacency.get(r.source).push(r.index));return t.nextNodeIndex=e.nodes.length===0?0:e.nodes[e.nodes.length-1].index+1,t.nextEdgeIndex=e.edges.length===0?0:e.edges[e.edges.length-1].index+1,t.acyclic=v(),t};function Ts(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function hh(e){return t=>Ts(t)?.[e]}var Lr=\"~structural\",wi=\"~identifier\",ql=\"~sentinels\",xh=\"~constructor\",hP=[\"title\",\"description\",\"default\",\"examples\",\"readOnly\",\"writeOnly\",\"format\",\"contentEncoding\",\"contentMediaType\",\"contentSchema\"],tu=hh(\"identifier\"),VE=hh(wi),ZE=hh(\"title\");var Hl=Zr(e=>{let t=Ts(e)?.identifier;return typeof t==\"string\"?t:e.getExpected(Hl)}),xP=new Set([ql,Lr,\"representation\",\"arbitraryConstraint\",\"toJsonSchema\",\"toCode\",\"toEquivalence\",\"toFormatter\",\"toCodec\",\"toCodecJson\",\"toCodecStringTree\",\"toCodecIso\",\"toCodecArbitrary\"]);var ge=Symbol();var Gt=pr,$r=Gt(ge),ze=Gt(ge),Wl=e=>e===ge?v():O(e),YE=e=>e._tag===\"None\"?$r:Gt(e.value);var Gl=\"~effect/SchemaIssue/Issue\";function XE(e){return A(e,Gl)&&e[Gl]===Gl}function I4(e){return Object.hasOwn(e,\"input\")}var un=class{[Gl]=Gl;constructor(t,r){r?.reportInput===!0&&t!==ge&&(this.input=t)}},gP=class extends un{_tag=\"Filter\";filter;issue;constructor(e,t,r,n){super(r,n),this.filter=e,this.issue=t}},yP=class extends un{_tag=\"Encoding\";ast;issue;constructor(e,t,r,n){super(r,n),this.ast=e,this.issue=t}},ct=class extends un{_tag=\"Pointer\";path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},fa=class extends un{_tag=\"MissingKey\";annotations;constructor(e){super(),this.annotations=e}},eI=class extends un{_tag=\"UnexpectedKey\";ast;constructor(e,t,r){super(t,r),this.ast=e}},Tt=class extends un{_tag=\"Composite\";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},ut=class extends un{_tag=\"InvalidType\";ast;constructor(e,t,r){super(t,r),this.ast=e}},de=class extends un{_tag=\"InvalidValue\";annotations;constructor(e,t,r){super(t,r),this.annotations=e}};function Br(e,t,r,n,o){return new Tt(e,[new ct([t],r)],n,o)}var Vl=class extends un{_tag=\"Forbidden\";annotations;constructor(e,t,r){super(t,r),this.annotations=e}},Zl=class extends un{_tag=\"AnyOf\";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},SP=class extends un{_tag=\"OneOf\";ast;successes;constructor(e,t,r,n){super(r,n),this.ast=e,this.successes=t}};function QE(e,t,r){if(XE(e))return e;if(typeof e==\"string\")return new de({message:e},t,r);let n=typeof e.issue==\"string\"?new de({message:e.issue},t,r):e.issue;return new ct(e.path,n)}function bP(e,t,r){if(e!==void 0)return typeof e==\"boolean\"?e?void 0:new de(void 0,t,r):QE(e,t,r)}function EP(e,t,r,n){return Array.isArray(t)?Qe(t)?t.length===1?QE(t[0],r,n):new Tt(e,In(t,o=>QE(o,r,n)),r,n):void 0:bP(t,r,n)}var IP=e=>{let t=nu(e);if(t!==void 0)return t;switch(e._tag){case\"InvalidType\":return ua(Hl(e.ast),e);case\"InvalidValue\":{let r=tI(e);if(r!==void 0)return ua(r,e);let n=gh(e);return n===void 0?\"Expected a valid value\":`Invalid data ${n}`}case\"MissingKey\":return\"Missing key\";case\"UnexpectedKey\":{let r=gh(e);return r===void 0?\"Expected no excess property\":`Unexpected key with value ${r}`}case\"Forbidden\":return\"Forbidden operation\";case\"OneOf\":{let r=gh(e);return r===void 0?\"Expected exactly one member to match\":`Expected exactly one member to match the input ${r}`}}},TP=e=>nu(e.issue)??nu(e);function wP(e){return t=>({issues:ru(t,[],e?.leafHook??IP,e?.checkHook??TP)})}function gh(e){return I4(e)?F(e.input):void 0}function tI(e){let t=e.annotations?.expected;return typeof t==\"string\"?t:void 0}function ua(e,t){let r=gh(t);return r===void 0?`Expected ${e}`:`Expected ${e}, got ${r}`}function ru(e,t,r,n){switch(e._tag){case\"Filter\":{let o=n(e);if(o!==void 0)return[{path:t,message:o}];if(e.issue._tag!==\"InvalidValue\")return ru(e.issue,t,r,n);let s=tI(e.issue);return[{path:t,message:s===void 0?ua(rI(e.filter),e):ua(s,e.issue)}]}case\"Encoding\":return ru(e.issue,t,r,n);case\"Pointer\":return ru(e.issue,[...t,...e.path],r,n);case\"Composite\":return e.issues.flatMap(o=>ru(o,t,r,n));case\"AnyOf\":return e.issues.length===0?[{path:t,message:nu(e)??ua(Hl(e.ast),e)}]:e.issues.flatMap(o=>ru(o,t,r,n));default:return[{path:t,message:r(e)}]}}function rI(e){let t=e.annotations?.expected;if(typeof t==\"string\")return t;switch(e._tag){case\"Filter\":return\"\";case\"FilterGroup\":return e.checks.map(r=>rI(r)).join(\" & \")}}function T4(){return e=>Kl(e,\"\")}var CP=T4();function Kl(e,t){let r;switch(e._tag){case\"Filter\":{let n=TP(e);if(n!==void 0)r=n;else{if(e.issue._tag!==\"InvalidValue\")return Kl(e.issue,t);let o=tI(e.issue);r=o===void 0?ua(rI(e.filter),e):ua(o,e.issue)}break}case\"Encoding\":return Kl(e.issue,t);case\"Pointer\":return Kl(e.issue,t+ud(e.path));case\"Composite\":case\"AnyOf\":{if(e._tag===\"Composite\"||e.issues.length>0)return e.issues.map(n=>Kl(n,t)).join(`\n`);r=nu(e)??ua(Hl(e.ast),e);break}default:r=IP(e);break}return t?`${r}\n at ${t}`:r}function nu(e){if(e._tag===\"Pointer\")return;if(e._tag===\"Encoding\")return nu(e.issue);let r=(e._tag===\"Filter\"?e.filter.annotations:\"annotations\"in e?e.annotations:e.ast.annotations)?.[e._tag===\"MissingKey\"?\"messageMissingKey\":e._tag===\"UnexpectedKey\"?\"messageUnexpectedKey\":\"message\"];if(typeof r==\"string\")return r}function Yl(e){let t;for(let r of e.reasons){if(!fl(r)||!XE(r.error))return;t??=r.error}return t}function fn(e,t){let r=Yl(e);if(r===void 0)throw new Error(t,{cause:e});return r}var kP=e=>Xc(e).replace(/=/g,\"\").replace(/\\+/g,\"-\").replace(/\\//g,\"_\"),nI=e=>{let t=e.replace(/[\\n\\r]/g,\"\"),r=t.length;if(r%4===1)return K(new wn({module:\"Base64Url\",kind:\"Decode\",input:t,message:`Length should be a multiple of 4, but is ${r}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(t))return K(new wn({module:\"Base64Url\",kind:\"Decode\",input:t,message:\"Invalid input\"}));let n=r%4===2?`${t}==`:r%4===3?`${t}=`:t;return n=n.replace(/-/g,\"+\").replace(/_/g,\"/\"),gi(n)},vP=e=>Cr(nI(e),t=>w4.decode(t)),w4=new TextDecoder;var OP=(e,t,r)=>{switch(e._tag){case\"Passthrough\":return g(t);case\"Transform\":return g(_t(t,e.transform));case\"TransformOptional\":return g(e.transform(t));case\"TransformEffect\":return ue(t)?ra:Dr(e.transform(t.value,r),O);case\"TransformOptionalEffect\":return e.transform(t,r)}};var Ql=e=>Object.assign(Object.create(Pg),e),yh=(e,t)=>oI((r,n)=>nt(OP(e,r,n),o=>OP(t,o,n))),Sh=l(2,(e,t)=>{if(e._tag===\"Passthrough\")return t;if(t._tag===\"Passthrough\")return e;switch(e._tag){case\"Transform\":switch(t._tag){case\"Transform\":return oe(r=>t.transform(e.transform(r)));case\"TransformOptional\":return Ci(r=>t.transform(_t(r,e.transform)));case\"TransformEffect\":return gt((r,n)=>t.transform(e.transform(r),n));case\"TransformOptionalEffect\":return yh(e,t)}case\"TransformOptional\":switch(t._tag){case\"Transform\":return Ci(r=>_t(e.transform(r),t.transform));case\"TransformOptional\":return Ci(r=>t.transform(e.transform(r)));case\"TransformEffect\":case\"TransformOptionalEffect\":return yh(e,t)}case\"TransformEffect\":switch(t._tag){case\"Transform\":return gt((r,n)=>Dr(e.transform(r,n),t.transform));case\"TransformOptional\":case\"TransformOptionalEffect\":return yh(e,t);case\"TransformEffect\":return gt((r,n)=>nt(e.transform(r,n),o=>t.transform(o,n)))}case\"TransformOptionalEffect\":return yh(e,t)}});function A4(e){return oI((t,r)=>P(e(t,r)))}function bh(e){return A4((t,r)=>{let n={message:e(t)};return Oe(t)?new Vl(n,t.value,r):new Vl(n)})}var _P=bh(()=>\"Encoding is not supported\"),k4=Ql({_tag:\"Passthrough\"});function jr(){return k4}function oe(e){return Ql({_tag:\"Transform\",transform:e})}function gt(e){return Ql({_tag:\"TransformEffect\",transform:e})}function Ci(e){return Ql({_tag:\"TransformOptional\",transform:e})}function oI(e){return Ql({_tag:\"TransformOptionalEffect\",transform:e})}function sI(){return Ci(()=>v())}function aI(e){return oI(t=>{let r=Wa(t,Io);return Oe(r)?g(r):Dr(e,O)})}function Ai(){return oe(globalThis.String)}function Eh(){return oe(globalThis.Number)}function RP(){return oe(globalThis.BigInt)}function iI(){return oe(e=>new globalThis.Date(e))}function PP(){return oe(I_)}function MP(e){return gt((t,r)=>Jc({try:()=>JSON.parse(t,e?.reviver),catch:()=>new de({expected:\"a valid JSON string\"},t,r)}))}function FP(e){return gt((t,r)=>Jc({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw new TypeError(\"Value cannot be represented as JSON\");return n},catch:()=>new de({expected:\"a JSON-serializable value\"},t,r)}))}function NP(e){let t=e?.separator??\",\",r=e?.keyValueSeparator??\"=\";return oe(n=>n.split(t).reduce((o,s)=>{let[a,i]=s.split(r);return a&&i&&N(o,a,i),o},{}))}function UP(e){let t=e?.separator??\",\",r=e?.keyValueSeparator??\"=\";return oe(n=>Object.entries(n).map(([o,s])=>`${o}${r}${s}`).join(t))}function DP(e){let t=e?.separator??\",\";return oe(r=>r===\"\"?[]:r.split(t))}function cI(){return oe(Xc)}function Ih(){return oe(kP)}function Th(){return oe(UA)}function LP(){return gt((e,t)=>Fl(_l(gi(e)),()=>new de({expected:\"a valid Base64 string\"},e,t)))}function $P(){return gt((e,t)=>Ar(MR(e),{onFailure:()=>P(new de({expected:\"a valid Base64 string\"},e,t)),onSuccess:g}))}function BP(){return gt((e,t)=>Ar(nI(e),{onFailure:()=>P(new de({expected:\"a valid Base64Url string\"},e,t)),onSuccess:g}))}function jP(){return gt((e,t)=>Ar(vP(e),{onFailure:()=>P(new de({expected:\"a valid Base64Url string\"},e,t)),onSuccess:g}))}function zP(){return gt((e,t)=>Ar(wy(e),{onFailure:()=>P(new de({expected:\"a valid hexadecimal string\"},e,t)),onSuccess:g}))}function qP(){return gt((e,t)=>Ar(DA(e),{onFailure:()=>P(new de({expected:\"a valid hexadecimal string\"},e,t)),onSuccess:g}))}function HP(){return oe(encodeURIComponent)}function WP(){return gt((e,t)=>{try{return g(globalThis.decodeURIComponent(e))}catch{return P(new de({expected:\"a valid URI component\"},e,t))}})}function JP(){return oe(e=>ZP(Array.from(e.entries())))}var v4=YP(e=>typeof e==\"string\"||typeof Blob<\"u\"&&e instanceof Blob);function KP(){return oe(e=>{let t=new FormData;return typeof e==\"object\"&&e!==null&&v4(e).forEach(([n,o])=>{t.append(n,o)}),t})}function GP(){return oe(e=>ZP(Array.from(e.entries())))}var O4=YP(Ir);function VP(){return oe(e=>typeof e==\"object\"&&e!==null?new URLSearchParams(O4(e)):new URLSearchParams)}function _4(e){if(e===\"\")return[\"\"];let t=e.replace(/\\[(.*?)\\]/g,\".$1\"),r=t.split(\".\"),n=t.startsWith(\".\")?1:0;return r.slice(n).map(o=>Sc(o)?globalThis.Number(o):o)}function ZP(e){let t={},r=new WeakSet,n=new WeakSet;function o(s,a,i){let c=Object.hasOwn(s,a)?s[a]:void 0;if(r.has(c)&&Array.isArray(c)===i)return c;let u=i?[]:{};return r.add(u),N(s,a,u),u}return e.forEach(([s,a])=>{let i=_4(s),c=t;i.forEach((u,f)=>{let p=f===i.length-1;if(Array.isArray(c)&&u===\"\")if(p)c.push(a);else{let d=i[f+1],m=typeof d==\"number\"||d===\"\",x=c.length;c=o(c,x,m)}else if(p){let d=Object.hasOwn(c,u);if(d&&Array.isArray(c[u])&&(r.has(c[u])||n.has(c[u])))c[u].push(a);else if(d){let m=[c[u],a];n.add(m),N(c,u,m)}else N(c,u,a)}else{let d=i[f+1];c=o(c,u,typeof d==\"number\"||d===\"\")}})}),t}function YP(e){return t=>{let r=[];function n(o,s){if(e(s))r.push([o,s]);else if(Array.isArray(s))s.every(e)?s.forEach(i=>{r.push([o,i])}):s.forEach((i,c)=>{n(`${o}[${c}]`,i)});else if(typeof s==\"object\"&&s!==null)for(let[a,i]of Object.entries(s))n(`${o}[${a}]`,i)}for(let[o,s]of Object.entries(t))n(o,s);return r}}var wh=class extends Us{_tag=\"Middleware\";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new wh(this.encode,this.decode)}},Xl=\"~effect/SchemaTransformation/Transformation\",Ce=class extends Us{[Xl]=Xl;_tag=\"Transformation\";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Ce(this.encode,this.decode)}};function R4(e){return A(e,Xl)&&e[Xl]===Xl}var Ch=e=>R4(e)?e:new Ce(e.decode,e.encode);function Vt(e){return new Ce(gt(e.decode),gt(e.encode))}function Pe(e){return new Ce(oe(e.decode),oe(e.encode))}function Ah(e){return new Ce(Ci(e.decode),Ci(e.encode))}function QP(){return new Ce(PP(),jr())}function XP(e){return new Ce(NP(e),UP(e))}var P4=new Ce(jr(),jr());function su(){return P4}var au=new Ce(Eh(),Ai()),kh=new Ce(RP(),Ai()),uI=new Ce(iI(),oe(Wg)),eM=new Ce(iI(),oe(e=>e.getTime()));var fI=Vt({decode:(e,t)=>Ht(fR(e),{onNone:()=>P(new de({expected:\"a valid ByteSize string\"},e,t)),onSome:g}),encode:e=>g(`${e} ${e===BigInt(1)?\"byte\":\"bytes\"}`)}),tM=Vt({decode:(e,t)=>Ht(iE(e),{onNone:()=>P(new de({expected:\"a non-negative bigint byte count\"},e,t)),onSome:g}),encode:e=>g(nh(e))}),rM=Vt({decode:(e,t)=>Ht(iE(e),{onNone:()=>P(new de({expected:\"a non-negative safe-integer byte count\"},e,t)),onSome:g}),encode:(e,t)=>Ht(dR(e),{onNone:()=>P(new de({expected:\"a ByteSize representable as a safe integer\"},e,t)),onSome:g})}),M4=e=>ur(e)&&typeof e.message==\"string\",nM=e=>{let r=Object.hasOwn(e,\"cause\")?new Error(e.message,{cause:sM(e.cause)}):new Error(e.message);return typeof e.name==\"string\"&&e.name!==\"Error\"&&(r.name=e.name),typeof e.stack==\"string\"&&(r.stack=e.stack),r},F4=e=>{try{let t=Pa(e);return t===void 0?F(e):JSON.parse(t)}catch{return F(e)}},N4=(e,t,r)=>{let n={name:e.name,message:typeof e.message==\"string\"?e.message:\"\"};return t?.includeStack&&typeof e.stack==\"string\"&&(n.stack=e.stack),!t?.excludeCause&&e.cause!==void 0&&(n.cause=r(e.cause)),n},oM=e=>{let t=new WeakSet,r=n=>{if(nC(n)){if(t.has(n))return\"[Circular]\";t.add(n);let o=N4(n,e,r);return t.delete(n),o}return F4(n)};return r},sM=e=>M4(e)?nM(e):e,aM=e=>Pe({decode:nM,encode:t=>oM(e)(t)}),iM=e=>Pe({decode:sM,encode:oM(e)});function cM(){return Pe({decode:ny,encode:vd})}function uM(){return Pe({decode:ry,encode:js})}function fM(e){return Pe({decode:Pf,encode:e?.onNoneEncoding===null?vd:js})}function lM(){return Ah({decode:O,encode:Ha})}function pM(){return Ah({decode:e=>e.pipe(Wa(Io),O),encode:Ha})}var lI=Vt({decode:(e,t)=>URL.canParse(e)?g(new URL(e)):P(new de({expected:\"a valid URL string\"},e,t)),encode:e=>g(e.href)});var pI=new Ce(LP(),cI()),dM=new Ce($P(),cI()),mM=new Ce(jP(),Ih()),hM=new Ce(qP(),Th()),xM=new Ce(WP(),HP());function gM(e){return new Ce(MP(e??{}),FP(e))}var yM=new Ce(JP(),KP()),SM=new Ce(GP(),VP());function pa(e){return t=>t._tag===e}var lu=pa(\"Declaration\");var U4=pa(\"Never\");var cu=pa(\"Literal\"),mI=pa(\"UniqueSymbol\");var II=pa(\"Arrays\"),D4=pa(\"Objects\"),kM=pa(\"Union\"),vM=pa(\"Suspend\"),ot=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Jo={},Wo=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,r=void 0,n=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=r,this.annotations=n}},bM=\"~effect/Schema\",ft=class{[bM]=bM;annotations;checks;encoding;context;constructor(t=void 0,r=void 0,n=void 0,o=void 0){this.annotations=t,this.checks=r,this.encoding=n,this.context=o}toString(){return`<${this._tag}>`}},pu=class extends ft{_tag=\"Declaration\";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,r,n,o,s,a,i){super(r,n,o,s),this.typeParameters=e,this.run=t,this.encodingChecks=a,this.encodingRun=i}getParser(){let e;return(t,r)=>t===ge?$r:(e??=this.run(this.typeParameters))(t,this,r)}_rebuild(e,t,r,n,o){let s=vi(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&r===this.encodingChecks&&n===this.run&&o===this.encodingRun?this:new pu(s,n,this.annotations,t,void 0,this.context,r,o)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==\"string\"?e:\"\"}},L4=class extends ft{_tag=\"Null\";getParser(){return Dh(this,null)}getExpected(){return\"null\"}},TI=new L4;var $4=class extends ft{_tag=\"Undefined\";getParser(){return Dh(this,void 0)}toCodecJson(){return qe(this,[OM])}getExpected(){return\"undefined\"}},OM=new ot(TI,new Ce(oe(()=>{}),oe(()=>null))),wI=new $4;var B4=class extends ft{_tag=\"Void\";getParser(){let e=Gt(void 0);return t=>t===ge?$r:e}toCodecJson(){return qe(this,[OM])}getExpected(){return\"void\"}},_M=new B4;var j4=class extends ft{_tag=\"Never\";getParser(){return Xn(this,rC)}getExpected(){return\"never\"}},CI=new j4,z4=class extends ft{_tag=\"Any\";getParser(){return Xn(this,Ug)}getExpected(){return\"any\"}},RM=new z4,q4=class extends ft{_tag=\"Unknown\";getParser(){return Xn(this,Ug)}getExpected(){return\"unknown\"}},Yn=new q4,H4=class extends ft{_tag=\"ObjectKeyword\";getParser(){return Xn(this,Sf)}getExpected(){return\"object | array | function\"}},PM=new H4,MM=class extends ft{_tag=\"Enum\";enums;constructor(e,t,r,n,o){super(t,r,n,o);for(let[,s]of e)if(typeof s==\"number\"&&!globalThis.Number.isFinite(s))throw new Error(`A numeric enum value must be finite, got ${F(s)}`);this.enums=e}getParser(){let e=new Set(this.enums.map(([,t])=>t));return Xn(this,t=>e.has(t))}toCodecStringTree(){if(this.enums.some(([e,t])=>typeof t==\"number\")){let e=Object.fromEntries(this.enums.map(([t,r])=>[globalThis.String(r),r]));return qe(this,[new ot(new zr(Object.keys(e).map(t=>new pn(t))),new Ce(oe(t=>e[t]),Ai()))])}return this}getExpected(){return this.enums.map(([e,t])=>JSON.stringify(t)).join(\" | \")}};function dI(e){return typeof e==\"number\"?`parts[${e}]`:e}function hI(e,t,r){if(r.has(e))return!0;if(e.encoding)throw new Error(`TemplateLiteral parts cannot have an encoding at ${dI(t)}`);let n;switch(e._tag){case\"String\":case\"Number\":case\"BigInt\":n=!0;break;case\"Literal\":n=!e.checks;break;case\"TemplateLiteral\":{let o=dI(t);n=!e.checks&&e.parts.every((s,a)=>hI(s,`${o}.parts[${a}]`,r));break}case\"Union\":{let o=dI(t);n=!e.checks&&e.types.every((s,a)=>hI(s,`${o}.types[${a}]`,r));break}default:return!1}return n&&r.add(e),n}var AI=class extends ft{_tag=\"TemplateLiteral\";parts;encodedParts;literals;suffixLengths;constructor(e,t,r,n,o){super(t,r,n,o);let s=[],a=[],i=new Set;for(let u=0;u=0;u--)c[u]=c[u+1]+(a[u]?.length??0);this.parts=e,this.encodedParts=s,this.literals=a,this.suffixLengths=c}getParser(e){let t=new Rn(!1,this.parts.map(jI),[]),r=e(da(ln,t,NM(this)));return(n,o)=>{if(n===ge)return $r;let s=r(n,o);return s._tag===\"Success\"?ze:Kt(s,{onSuccess:()=>n,onFailure:a=>new Tt(this,[a],n,o)})}}getExpected(){return\"string\"}matchPart(e,t){return aF(this,e,t)===void 0?void 0:e}};function FM(e){let t=Zr(o=>{if(o._tag!==\"Union\")return o;let s=vi(o.types,t);return(o.options?.mode??\"anyOf\")===\"anyOf\"&&s===o.types?o:new zr(s,o.options===void 0?void 0:{...o.options,mode:\"anyOf\"},o.annotations,o.checks,void 0,o.context)}),r=new AI(e.map(o=>t(mn(o)))),n=new Rn(!1,e.map(jI),[]);return da(r,n,NM(r))}function NM(e){return new Ce(gt((t,r)=>{let n=aF(e,t,r);return n?g(n):P(new de({expected:\"a string matching template literal parts\"},t,r))}),oe(t=>t.join(\"\")))}var UM=class extends ft{_tag=\"UniqueSymbol\";symbol;constructor(e,t,r,n,o){super(t,r,n,o),this.symbol=e}getParser(){return Dh(this,this.symbol)}toCodecStringTree(){let e=globalThis.Symbol.keyFor(this.symbol);return qe(this,[new ot(e===void 0?CI:new pn(globalThis.String(this.symbol)),uF.transformation)])}getExpected(){return globalThis.String(this.symbol)}},pn=class extends ft{_tag=\"Literal\";literal;constructor(e,t,r,n,o){if(super(t,r,n,o),typeof e==\"number\"&&!globalThis.Number.isFinite(e))throw new Error(`A numeric literal must be finite, got ${F(e)}`);this.literal=e}getParser(){return Dh(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==\"bigint\"?EM(this):this}toCodecStringTree(){return typeof this.literal==\"string\"?this:EM(this)}getExpected(){return typeof this.literal==\"string\"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function EM(e){let t=globalThis.String(e.literal);return qe(e,[new ot(new pn(t),new Ce(oe(()=>e.literal),oe(()=>t)))])}var W4=class extends ft{_tag=\"String\";getParser(){return Xn(this,Ir)}matchPart(e,t){let r=this.checks;return r&&!t.disableChecks&&eo(r,e,void 0,this,t)?void 0:e}getExpected(){return\"string\"}},ln=new W4,J4=class extends ft{_tag=\"Number\";getParser(){return Xn(this,yf)}matchKey(e,t){return this._match(p6,e,t)}matchPart(e,t){return this._match(SI,e,t)}_match(e,t,r){if(!e.test(t))return;let n=globalThis.Number(t);return r.disableChecks||!this.checks?n:eo(this.checks,n,void 0,this,r)?void 0:n}toCodecJson(){return this.checks&&(xI(this.checks,\"effect/schema/isFinite\")||xI(this.checks,\"effect/schema/isInt\"))?this:qe(this,[s6])}toCodecStringTree(){return this.toCodecJson()===this?qe(this,[d6]):qe(this,[m6])}getExpected(){return\"number\"}};function xI(e,t){return e.some(r=>r.annotations?.representation?.id===t||r._tag===\"FilterGroup\"&&xI(r.checks,t))}var kI=new J4,K4=class extends ft{_tag=\"Boolean\";getParser(){return Xn(this,nd)}getExpected(){return\"boolean\"}},DM=new K4,G4=class extends ft{_tag=\"Symbol\";getParser(){return Xn(this,Ng)}matchKey(e,t){return t.disableChecks||!this.checks?e:eo(this.checks,e,void 0,this,t)?void 0:e}toCodecStringTree(){return qe(this,[uF])}getExpected(){return\"symbol\"}},LM=new G4,V4=class extends ft{_tag=\"BigInt\";getParser(){return Xn(this,eC)}matchPart(e,t){if(!bI.test(e))return;let r=globalThis.BigInt(e);return t.disableChecks||!this.checks?r:eo(this.checks,r,void 0,this,t)?void 0:r}toCodecStringTree(){return qe(this,[x6])}getExpected(){return\"bigint\"}},$M=new V4,Rn=class extends ft{_tag=\"Arrays\";isMutable;elements;rest;encodingChecks;constructor(e,t,r,n,o,s,a,i){super(n,o,s,a),this.isMutable=e,this.elements=t,this.rest=r,this.encodingChecks=i;let c=!1;for(let u=0;u1)throw new Error(\"A required element cannot follow an optional element. ts(1257)\");for(let u=1;u=f?o[p-f+1]:o[0]}let c=f=>{let{input:p,len:d,options:m}=f;if(r.rest.length===0&&d>s)for(let x=s;x{let d=f.length,m={ast:r,getParser:i,input:f,len:d,tailThreshold:Math.max(s,d-a),output:new globalThis.Array(d),issues:void 0,options:p},x=r.rest.length===0?s:Math.max(d,s+a),y=p.concurrency===void 0?1:ul(p.concurrency),S=y===1?Y4(m,f,0,x):Q4(m,f,{concurrency:y,end:x});if(!S)return c(m);if(De(S))return nt(S,()=>c(m));let w=!0;return $(()=>w?(w=!1,I(S,()=>c(m))):u(f,p))};return(f,p)=>{if(f===ge)return $r;try{return Array.isArray(f)?(n||(n=r.elements.map(d=>({ast:d,parser:t(d)})),o=r.rest.map(d=>({ast:d,parser:t(d)}))),u(f,p)):P(new ut(r,f,p))}catch(d){return Rr(d)}}}_rebuild(e,t,r){let n=vi(this.elements,e),o=vi(this.rest,e);return n===this.elements&&o===this.rest&&t===this.checks&&r===this.encodingChecks?this:new Rn(this.isMutable,n,o,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return\"array\"}};function Z4(e,t,r,n){if(r._tag===\"Failure\")return Oh(e,e.ast,n,r);let o=r===ze?t:r[pe];if(o!==ge)e.output[n]=o;else{let s=e.getParser(e.tailThreshold,n);if(Zt(s.ast))return;let a=new ct([n],new fa(s.ast.context?.annotations));if(e.options.errors===\"all\")e.issues?e.issues.push(a):e.issues=[a];else return hs(new Tt(e.ast,[a],e.input,e.options))}}var BM={onItem(e,t,r){let n=r{if(n.cause.reasons.length===0)return n;let o=Yl(n.cause);if(o===void 0)return Ur(ms(n.cause,a=>new Tt(t,[new ct([r],a)],e.input,e.options)));let s=new ct([r],o);if(e.options.errors===\"all\")e.issues?e.issues.push(s):e.issues=[s];else return hs(new Tt(t,[s],e.input,e.options))},Rh=\"[+-]?\\\\d*\\\\.?\\\\d+(?:[Ee][+-]?\\\\d+)?\";function la(e,t,r=Jo){let n,o;function s(a){switch(a._tag){case\"String\":case\"TemplateLiteral\":return(n??=Object.keys(e)).filter(i=>a.matchPart(i,r)!==void 0);case\"Number\":return(n??=Object.keys(e)).filter(i=>a.matchKey(i,r)!==void 0);case\"Symbol\":return(o??=Object.getOwnPropertySymbols(e)).filter(i=>Object.prototype.propertyIsEnumerable.call(e,i)&&a.matchKey(i,r)!==void 0);case\"Union\":return[...new Set(a.types.flatMap(s))];default:return[]}}return s(BI(mn(t)))}var vI=class{name;type;constructor(e,t){this.name=e,this.type=t}};function jM(e){switch(e._tag){case\"String\":case\"Number\":case\"Symbol\":case\"TemplateLiteral\":return!0;case\"Union\":return e.types.every(jM);default:return!1}}function zM(e){let t=mu(e);switch(t._tag){case\"String\":case\"Number\":case\"Symbol\":case\"TemplateLiteral\":return!0;case\"Union\":return t.types.every(zM);default:return!1}}function X4(e){return jM(e)&&zM(e)}var OI=class{parameter;type;constructor(e,t){if(!X4(e))throw new Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Zt(t)&&!sF(t))throw new Error(\"Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.\")}},tp=class extends ft{_tag=\"Objects\";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,r,n,o,s,a){super(r,n,o,s),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=a}getParser(e,t=e){let r=this,n=r.propertySignatures.length,o=r.indexSignatures.length;if(!n&&!o)return Xn(r,sd);let s,a,i=()=>(s||(s=r.propertySignatures.map(p=>({parser:t(p.type),name:p.name,type:p.type})),a=o?r.indexSignatures.map(p=>({is:p,parserKey:e(BI(p.parameter)),parserValue:t(p.type)})):void 0),s),c=()=>{let p=new Set(r.propertySignatures.map(S=>typeof S.name==\"number\"?globalThis.String(S.name):S.name)),d=(S,w,E,M,_)=>{if(_._tag===\"Failure\")return Oh(S,r,w,_)??ht;let h=_===ze?M:_[pe];if(E!==ge&&h!==ge){if(n&&(p.has(w)||p.has(typeof E==\"number\"?globalThis.String(E):E)))return ht;N(S.out,E,h)}return ht},m=(S,w,E,M)=>{if(!M){let T=E.parserKey(w,S.options);if(!De(T))return I(kn(T),C=>m(S,w,E,C));M=T}if(M._tag===\"Failure\")return Oh(S,r,w,M)??ht;let _=M===ze?w:M[pe],h=S.input[w],b=E.parserValue(h,S.options);return De(b)?d(S,w,_,h,b):I(kn(b),T=>d(S,w,_,h,T))},x=(S,w,E)=>{let M=S.input[w],_=E.parserValue(M,S.options);return De(_)?d(S,w,w,M,_):I(kn(_),h=>d(S,w,w,M,h))},y=o?Tm()({onItem:(S,[w,E])=>E.is.parameter===ln?x(S,w,E):m(S,w,E),step:(S,w,E)=>E._tag===\"Failure\"?E:void 0}):void 0;return eE(function*(S,w){if(S===ge)return ge;if(!(typeof S==\"object\"&&S!==null&&!Array.isArray(S)))return yield*P(new ut(r,S,w));i();let E=S,M={},_={ast:r,input:E,out:M,issues:void 0,options:w},h=w.errors===\"all\",b=w.onExcessProperty===\"error\",T=w.concurrency===void 0?1:ul(w.concurrency),C=o&&b?r.indexSignatures.map(L=>la(E,L.parameter,w)):void 0;if(b){let L=C?new Set(p):p;if(C)for(let ye of C)for(let ve of ye)L.add(ve);let Q=Reflect.ownKeys(E);for(let ye=0;ye{let x=s[d];return I(kn(m),y=>{let S=gI(p,x,y);if(S)return S;let w=()=>Gt(p.out),E=IM(p,s.slice(d+1));return E?nt(E,w):w()})};return(p,d)=>{if(p===ge)return $r;if(d.errors===\"all\"||d.onExcessProperty!==void 0||d.concurrency!==void 0&&ul(d.concurrency)!==1)return(u??=c())(p,d);if(!(typeof p==\"object\"&&p!==null&&!Array.isArray(p)))return P(new ut(r,p,d));let m=i(),x=p,y={},S={ast:r,input:x,out:y,issues:void 0,options:d};try{for(let w=0;w{let i=e(a.type);return i===a.type?a:new vI(a.name,i)}),s=vi(this.indexSignatures,a=>{let i=t(a.parameter),c=e(a.type);return i===a.parameter&&c===a.type?a:new OI(i,c)});return o===this.propertySignatures&&s===this.indexSignatures&&r===this.checks&&n===this.encodingChecks?this:new tp(o,s,this.annotations,r,void 0,this.context,n)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?\"object | array\":\"object\"}};function gI(e,t,r){if(r._tag===\"Failure\")return Oh(e,e.ast,t.name,r);if(r===ze)return;let n=r[pe];if(n!==ge){N(e.out,t.name,n);return}if(delete e.out[t.name],!Zt(t.type)){let o=new ct([t.name],new fa(t.type.context?.annotations));if(e.options.errors===\"all\"){e.issues?e.issues.push(o):e.issues=[o];return}else return hs(new Tt(e.ast,[o],e.input,e.options))}}var qM={onItem(e,t){if(!iu(e.input,t.name))return t.parser(ge,e.options);let r=e.input[t.name];return N(e.out,t.name,r),t.parser(r,e.options)},step:gI},IM=Im()(qM),e6=Tm()(qM);function _I(e,t){return e?t?[...e,...t]:e:t}function Ph(e,t,r){return new tp(Reflect.ownKeys(e).map(n=>new vI(n,e[n].ast)),[],r,t)}function rp(e){return e.ast}function RI(e,t=void 0){return new Rn(!1,e.map(r=>r.ast),[],void 0,t)}function Mh(e,t,r){return new zr(e.map(rp),t,void 0,r)}function HM(e,t){if(e.encoding||t.some(s=>s.encoding))throw new Error(\"StructWithRest does not support encodings\");let r=e.propertySignatures,n=e.indexSignatures,o=e.checks;for(let s of t){for(let a of s.propertySignatures)if(r.some(i=>i.name===a.name))throw new Error(`Duplicate identifier: ${JSON.stringify(a.name)}. ts(2300)`);r=r.concat(s.propertySignatures),n=n.concat(s.indexSignatures),o=_I(o,s.checks)}return new tp(r,n,void 0,o)}function WM(e,t){if(e.encoding)throw new Error(\"TupleWithRest does not support encodings\");return new Rn(e.isMutable,e.elements,t,void 0,e.checks)}function JM(e){if(e.encoding)throw new Error(\"mutable does not support encodings\");return new Rn(!0,e.elements,e.rest,e.annotations,e.checks,void 0,e.context,e.encodingChecks)}var PI=va(e=>{for(;;){if(vM(e))return Yn;let t=e.encoding;if(!t)return e.recur?.(PI,R)??e;if(t.some(r=>r.transformation._tag===\"Middleware\"&&r.transformation.decode!==R))return Yn;e=t[t.length-1].to}});function KM(e){switch(e._tag){case\"Null\":return[\"null\"];case\"Undefined\":return[\"undefined\"];case\"String\":case\"TemplateLiteral\":return[\"string\"];case\"Number\":return[\"number\"];case\"Boolean\":return[\"boolean\"];case\"Symbol\":case\"UniqueSymbol\":return[\"symbol\"];case\"BigInt\":return[\"bigint\"];case\"Arrays\":return[\"array\"];case\"ObjectKeyword\":return[\"object\",\"array\",\"function\"];case\"Objects\":return e.propertySignatures.length||e.indexSignatures.length?[\"object\"]:[\"string\",\"number\",\"boolean\",\"symbol\",\"bigint\",\"object\",\"array\",\"function\"];case\"Enum\":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case\"Literal\":return[typeof e.literal];case\"Union\":return Array.from(new Set(e.types.flatMap(KM)));default:return[\"null\",\"undefined\",\"string\",\"number\",\"boolean\",\"symbol\",\"bigint\",\"object\",\"array\",\"function\"]}}function uu(e){switch(e._tag){default:return[];case\"Declaration\":{let t=e.annotations?.[ql];return Array.isArray(t)?t:[]}case\"Objects\":return e.propertySignatures.flatMap(t=>{let r=t.type;if(!Zt(r)){if(cu(r))return[{key:t.name,literal:r.literal}];if(mI(r))return[{key:t.name,literal:r.symbol}]}return[]});case\"Arrays\":return e.elements.flatMap((t,r)=>{if(!Zt(t)){if(cu(t))return[{key:r,literal:t.literal}];if(mI(t))return[{key:r,literal:t.symbol}]}return[]});case\"Union\":{if(e.types.length===0)return[];let t=e.types.map(r=>uu(PI(r)));return t[0].filter(r=>t.every(n=>n.some(o=>o.key===r.key&&o.literal===r.literal)))}case\"Suspend\":return uu(e.thunk())}}var TM=new WeakMap,vh=Object.freeze([]),wM=e=>e===null?\"null\":Array.isArray(e)?\"array\":typeof e,iu=(e,t)=>t===\"__proto__\"?Object.hasOwn(e,t):t in e;function np(e){let t=TM.get(e);if(t)return t;let r,n=0,o,s,a=!0,i=[];for(let f=0;fc[f]??=Object.freeze(o?.[f]??vh);if(a&&s)s.forEach(Object.freeze),t=f=>s.get(f)??vh;else if(r?.size===1&&!o){let[f,[p]]=r.entries().next().value,d=new Map;for(let[x,y]of p)d.set(x,Object.freeze(Array.from(y)));let m=Object.freeze(e.map((x,y)=>y));t=(x,y)=>{if(Sf(x)){let S=iu(x,f)?x[f]:void 0;if(S!==void 0)return d.get(S)??vh;if(y)return m}return vh}}else if(r){let f;for(let p of r)(!f||p[1][0].size>f[1][0].size)&&p[1][1].size===n&&(f=p);t=(p,d)=>{let m=wM(p);if(!Sf(p))return u(m);let x=new Set(o?.[m]),y;if(f){let[S,[w]]=f,E=iu(p,S),M=E?p[S]:void 0;if(E&&(!d||M!==void 0)){let _=w.get(M);if(!_)return u(m);for(let h of _)x.add(h);y=S}}if(y===void 0)for(let[S,[w,E]]of r){let M=iu(p,S),_=M?p[S]:void 0;if(M&&(!d||_!==void 0)){let h=w.get(_);if(h)for(let b of h)x.add(b)}else if(d)for(let h of E)x.add(h)}for(let[S,[w,E]]of r){if(S===y)continue;let M=iu(p,S),_=M?p[S]:void 0;if(M&&(!d||_!==void 0)){let h=w.get(_);for(let b of x)E.has(b)&&!h?.has(b)&&x.delete(b)}}return Array.from(x).sort((S,w)=>S-w)}}else t=f=>{let p=u(wM(f));return s?p.filter(d=>i[d]===void 0||i[d]===f):p};return TM.set(e,t),t}var zr=class extends ft{_tag=\"Union\";types;options;encodingChecks;constructor(e,t,r,n,o,s,a){super(r,n,o,s),this.types=e,this.options=t,this.encodingChecks=a}getParser(e,t){let r=this,n=t!==void 0,o=[],s=i=>o[i]??=e(r.types[i]),a;return(i,c)=>{if(i===ge)return $r;let u=(a??=np(r.types))(i,n);if(u.length===0)return P(new Zl(r,[],i,c));if(u.length===1){let f=s(u[0])(i,c);return f._tag===\"Success\"?f:De(f)?GM(r,f.cause,i,c):t6(r,f,i,c)}return r6(r,s,u,i,c)}}_rebuild(e,t,r){let n=vi(this.types,e);return n===this.types&&t===this.checks&&r===this.encodingChecks?this:new zr(n,this.options,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let r of this.types){let n=r.matchPart(e,t);if(n!==void 0)return n}}getExpected(e){let t=this.annotations?.expected;if(typeof t==\"string\")return t;if(this.types.length===0)return\"never\";let r=this.types.map(n=>{let o=mn(n);switch(o._tag){case\"Arrays\":{let s=o.elements.filter(cu);if(s.length>0)return`${CM(o.isMutable)}[ ${s.map(a=>e(a)+AM(a.context?.isOptional)).join(\", \")}, ... ]`;break}case\"Objects\":{let s=o.propertySignatures.filter(a=>cu(a.type));if(s.length>0)return`{ ${s.map(a=>`${CM(a.type.context?.isMutable)}${wo(a.name)}${AM(a.type.context?.isOptional)}: ${e(a.type)}`).join(\", \")}, ... }`;break}}return e(o)});return Array.from(new Set(r)).join(\" | \")}};function GM(e,t,r,n){let o=Yl(t);return o?hs(new Zl(e,[o],r,n)):Ur(t)}function t6(e,t,r,n){return xt(t,o=>GM(e,o,r,n))}function r6(e,t,r,n,o){let s={ast:e,parser:t,input:n,out:void 0,successes:e.options?.mode===\"oneOf\"?[]:void 0,issues:void 0,options:o},a=o6(s,r);return a?n6(a,s):s.out?s.out:P(new Zl(e,s.issues??[],n,o))}function n6(e,t){return nt(e,r=>t.out===ze?g(t.input):t.out?t.out:P(new Zl(t.ast,t.issues??[],t.input,t.options)))}var o6=Im()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,r){if(r._tag===\"Failure\"){let n=Yl(r.cause);if(n===void 0)return r;e.issues?e.issues.push(n):e.issues=[n]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),hs(new SP(e.ast,e.successes,e.input,e.options));if(e.out=r,e.successes)e.successes.push(e.ast.types[t]);else return ht}}}),VM=new zr([new pn(\"Infinity\"),new pn(\"-Infinity\"),new pn(\"NaN\")]);function CM(e){return e?\"\":\"readonly \"}function AM(e){return e?\"?\":\"\"}var MI=class extends ft{_tag=\"Suspend\";thunk;constructor(e,t,r,n,o){if(r)throw new Error(\"Cannot add checks to Suspend\");super(t,void 0,n,o);let s;this.thunk=()=>s??=e()}getParser(e){let t;return(r,n)=>(t??=e(this.thunk()))(r,n)}recur(e){return new MI(()=>e(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(e){return e(this.thunk())}},_h=class extends Us{_tag=\"Filter\";run;annotations;aborted;constructor(e,t=void 0,r=!1){super(),this.run=e,this.annotations=t,this.aborted=r}annotate(e){return new _h(this.run,{...this.annotations,...e},this.aborted)}abort(){return new _h(this.run,this.annotations,!0)}and(e,t){return new ki([this,e],t)}},ki=class extends Us{_tag=\"FilterGroup\";checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new ki(this.checks,{...this.annotations,...e})}and(e,t){return new ki([this,e],t)}};function Fh(e,t,r=!1){return new _h((n,o,s)=>EP(o,e(n,o,s),n,s),t,r)}function Nh(e,t){return new _h((r,n,o)=>e(r)?void 0:new de(void 0,r,o),t,!0)}function FI(e){return Fh(t=>globalThis.Number.isFinite(t),{expected:\"a finite number\",representation:{id:\"effect/schema/isFinite\",payload:null},toJsonSchema:()=>({type:\"number\"}),toCode:()=>({runtime:\"Schema.isFinite()\"}),arbitraryConstraint:{number:\"finite\"},...e})}var NI=Ko(kI,[FI()]),s6=new ot(new zr([NI,VM]),new Ce(Eh(),oe(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function op(e,t){let r=new globalThis.RegExp(e),n={source:r.source,flags:r.flags};return Fh(o=>(r.lastIndex=0,r.test(o)),{expected:`a string matching the RegExp ${n.source}`,representation:{id:\"effect/schema/isPattern\",payload:n},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[n]},...t})}var yI=new WeakMap;function sp(e,t){let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(n=>n===\"context\"||n===\"encoding\")&&yI.set(r,du(e)),r}function du(e){let t=yI.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return yI.set(e,r),r}function qe(e,t){return e.encoding===t?e:sp(e,{encoding:t})}function Oi(e,t){if(e.context===t)return e;let r=du(e);return r.context===t&&r.encoding===e.encoding?r:sp(e,{context:t})}function mu(e){return e.encoding?mu(e.encoding[e.encoding.length-1].to):e}function Qn(e,t){if(e.checks){let r=e.checks[e.checks.length-1];return ZM(e,Ud(e.checks.slice(0,-1),r.annotate(t)))}return sp(e,{annotations:{...e.annotations,...t}})}function ZM(e,t){if(e._tag===\"Suspend\"&&t)throw new Error(\"Cannot add checks to Suspend\");return e.checks===t?e:sp(e,{checks:t})}function Ko(e,t){return ZM(e,_I(e.checks,t))}function hu(e,t){let r=t(e.to);return r===e.to?e:new ot(r,e.transformation)}function UI(e,t){let r=e,n=r[r.length-1],o=hu(n,t);return o===n?e:Ud(e.slice(0,e.length-1),o)}function DI(e){return t=>t.encoding?qe(t,UI(t.encoding,e)):t}function Uh(e,t){return DI(r=>Oi(r,t))(e)}function YM(e){function t(r){return r.encoding?qe(r,UI(r.encoding,t)):e(r)}return Zr(t)}function _i(e,t){function r(n){if(n.encoding){let o=n.encoding[n.encoding.length-1];return t?.stopAt?.(o)?n:qe(n,UI(n.encoding,r))}return e(n)}return va(r)}function QM(e,t){return LI(e,t,yt(e))}function XM(e,t){return LI(mn(e),t,e)}function LI(e,t,r){let n=new ot(e,t);return qe(r,r.encoding?[...r.encoding,n]:[n])}function vi(e,t){let r;for(let n=0;n{let t=e.context?e.context.isOptional===!1?new Wo(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Wo(!0,!1);return a6(Oi(e,t))}),a6=DI(Ri),eF=Zr(e=>Ri(new zr([e,wI]))),$I=va(e=>{let t=e.context?e.context.isMutable===!1?new Wo(e.context.isOptional,!0,e.context.constructorDefault,e.context.annotations):e.context:new Wo(!1,!0);return i6(Oi(e,t))}),i6=DI($I);function tF(e,t){let r=e.context?new Wo(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new Wo(!1,!1,t);return Oi(e,r)}function da(e,t,r){return LI(e,r,t)}function c6(e){let t=[],r=[];function n(o){switch(o._tag){case\"Literal\":od(o.literal)&&!t.includes(o.literal)&&t.push(o.literal);return;case\"UniqueSymbol\":t.includes(o.symbol)||t.push(o.symbol);return;case\"Never\":return;case\"Union\":for(let s=0;snew vI(o,t)),n.map(o=>new OI(o,t)))}function Zt(e){return e.context?.isOptional??!1}function nF(e){return e.context?.isMutable??!1}function oF(e){return e.annotations?.[Lr]===!0||e._tag===\"FilterGroup\"&&e.checks.every(oF)}function u6(e){function t(n){return oF(n)?[n]:n._tag===\"FilterGroup\"?n.checks.flatMap(t):[]}let r=e.flatMap(t);return rr(r)?r:void 0}function f6(e){let t=!0;function r(n){return t=t&&!n.encoding&&!vM(n),t&&\"recur\"in n&&n.recur(r),n}return\"recur\"in e&&e.recur(r),t}var yt=va(e=>{let t=du(e);if(t!==e){let n=yt(t);return n===t&&e.encoding===void 0?e:Oi(n,e.context)}let r=\"recur\"in e?e.recur(yt):e;if(\"encodingChecks\"in r&&r.encodingChecks){let n=f6(e)?r.encodingChecks:II(r)||D4(r)||lu(r)&&r.typeParameters.length>0?u6(r.encodingChecks):void 0;return sp(r,{encodingChecks:void 0,checks:_I(r.checks,n)})}return r}),mn=va(e=>yt(dn(e)));function l6(e,t){let r=t,n=r.length,o=r[n-1],s=[new ot(dn(qe(e,void 0)),r[0].transformation.flip())];for(let i=1;i{if(e.encoding)return l6(e,e.encoding);let t=du(e);if(t!==e){let r=dn(t);return r===t?e:Oi(r,e.context)}return\"flip\"in e?e.flip(dn):\"recur\"in e?e.recur(dn):e});function sF(e){switch(e._tag){case\"Undefined\":return!0;case\"Union\":return e.types.some(sF);default:return!1}}function Dh(e,t){let r=t===0?ze:Gt(t);return(n,o)=>n===ge?$r:n===t?r:P(new ut(e,n,o))}function Xn(e,t){return(r,n)=>r===ge?$r:t(r)?ze:P(new ut(e,r,n))}function aF(e,t,r){let n=e.encodedParts,o=e.literals,s=t.length;for(let u=0;us)return;let a=new Array(n.length),i;function c(u,f){if(u===n.length)return f===s;if(i?.has(u*(s+1)+f))return!1;let p=n[u];if(u===n.length-1){let d=t.slice(f);if(p.matchPart(d,r)!==void 0)return a[u]=d,!0}else if(p._tag===\"Literal\"){let d=o[u];if(t.startsWith(d,f)&&c(u+1,f+d.length))return a[u]=d,!0}else{let d=s-e.suffixLengths[u+1],m=o[u+1],x=m===void 0?d:t.lastIndexOf(m,d);for(;x>=f;){let y=t.slice(f,x);if(p.matchPart(y,r)!==void 0&&c(u+1,x))return a[u]=y,!0;if(x===0)break;x=m===void 0?x-1:t.lastIndexOf(m,x-1)}}return i??=new Set,i.add(u*(s+1)+f),!1}return c(0,0)?a:void 0}var BI=_i(e=>{switch(e._tag){default:return e;case\"Number\":return e.toCodecStringTree();case\"Union\":return e.recur(BI)}}),Lh=_i(e=>{switch(e._tag){default:return e;case\"Symbol\":case\"UniqueSymbol\":return e.toCodecStringTree();case\"Union\":return e.recur(Lh)}}),jI=_i(e=>{switch(e._tag){default:return e;case\"Number\":case\"Literal\":case\"BigInt\":return e.toCodecStringTree();case\"Union\":return e.recur(jI)}}),iF=\"[\\\\s\\\\S]*?\",SI=new globalThis.RegExp(`^${Rh}$`),p6=new globalThis.RegExp(`^(?:${Rh}|Infinity|-Infinity|NaN)$`);function zI(e){return op(SI,{expected:\"a string representing a finite number\",representation:{id:\"effect/schema/isStringFinite\",payload:null},toJsonSchema:()=>({pattern:SI.source}),...e})}var cF=Ko(ln,[zI()]),d6=new ot(cF,au),m6=new ot(new zr([cF,VM]),au),h6=\"-?\\\\d+\",bI=new globalThis.RegExp(`^${h6}$`);function qI(e){return op(bI,{expected:\"a string representing a bigint\",representation:{id:\"effect/schema/isStringBigInt\",payload:null},toJsonSchema:()=>({pattern:bI.source}),...e})}var HI=Ko(ln,[qI({expected:\"a string representing a bigint\"})]),x6=new ot(HI,kh),g6=\"Symbol\\\\(([\\\\s\\\\S]*)\\\\)\",EI=new globalThis.RegExp(`^${g6}$`),y6=Ko(ln,[WI()]),uF=new ot(y6,new Ce(oe(e=>globalThis.Symbol.for(EI.exec(e)[1])),gt((e,t)=>globalThis.Symbol.keyFor(e)!==void 0?g(globalThis.String(e)):P(new Vl({message:\"cannot serialize to string, Symbol is not registered\"},e,t)))));function WI(e){return op(EI,{expected:\"a string representing a symbol\",representation:{id:\"effect/schema/isStringSymbol\",payload:null},toJsonSchema:()=>({pattern:EI.source}),...e})}function eo(e,t,r,n,o){for(let s=0;s0;){let o=n[n.length-1],s=o.keys;if(typeof s==\"number\"){if(o.index(e,t,r)=>xu(e)?ze:P(new ut(t,e,r)),{representation:{id:\"effect/schema/Json\",payload:null},expected:\"JSON value\",toCodecJson:()=>{},toCodecStringTree:()=>KI}),dF=Qn(fu,{representation:{id:\"effect/schema/MutableJson\",payload:null}}),JI=new ot(fu,su()),mF=new ot(new zr([new Rn(!1,[],[fu]),new tp([],[new OI(ln,fu)])]),su());function E6(e){return pF(e,b6)}var I6=new pu([],()=>(e,t,r)=>E6(e)?ze:P(new ut(t,e,r)),{expected:\"StringTree\",toCodecStringTree:()=>{}}),KI=new ot(I6,su());var $h=(e,t,r)=>e===ze?r(t):nt(e,r);function xF(e){if(e._tag===\"Middleware\")return(r,n,o)=>{let s=r===ze?e.decode(Gt(Wl(n)),o):e.decode(Dr(r,Wl),o);return hF(s)};let t=e.decode;switch(t._tag){case\"Passthrough\":return(r,n)=>r===ze?Gt(n):r;case\"Transform\":{let r=n=>n===ge?$r:Gt(t.transform(n));return(n,o)=>$h(n,o,r)}case\"TransformOptional\":{let r=n=>YE(t.transform(Wl(n)));return(n,o)=>$h(n,o,r)}case\"TransformEffect\":return(r,n,o)=>$h(r,n,s=>s===ge?$r:t.transform(s,o));case\"TransformOptionalEffect\":return(r,n,o)=>$h(r,n,s=>hF(t.transform(Wl(s),o)))}}var hF=e=>nt(e,YE),gF=(e,t,r,n)=>xt(n,o=>Ss(()=>ms(o,s=>new yP(e,s,t,r))));function T6(e,t){let r=xF(e.link.transformation),n;return(o,s)=>{if(o===ge)return $r;if(e.isConstructed(o))return ze;let a=(n??=t(e.link.to))(o,s);return r(a,o,s)}}function w6(e,t){let r=e.context.constructorDefault;return(n,o)=>{if(n!==ge&&n!==void 0)return t(n,o);let s=r;if(De(s)&&s._tag===\"Success\"){let a=t(s[pe],o);return a===ze?s:a}return nt(gF(e,n,o,s),a=>{let i=t(a,o);return i===ze?Gt(a):i})}}function GI(e,t){let r=t(e);return e.context?.constructorDefault===void 0?r:w6(e,r)}function ip(e,t,r,n,o){if(e._tag===\"Declaration\")for(let x of e.typeParameters)t(x);let s=r?lF(e):void 0,a=s?T6(s,t):n??e.getParser(t,r),i=e.checks,c=e.encoding,u=c?.map(x=>xF(x.transformation)),f=e.encodingChecks;if(!c&&!i&&!f)return a;let p,d=(x,y)=>{let S=a(x,y);if(f&&!y.disableChecks)if(De(S)){if(S._tag===\"Success\"){let w=S===ze?x:S[pe];if(x!==ge&&w!==ge){let E=eo(f,x,void 0,e,y);E&&(S=P(new Tt(e,E,x,y)))}}}else S=I(S,w=>{if(x!==ge&&w!==ge){let E=eo(f,x,void 0,e,y);if(E)return P(new Tt(e,E,x,y))}return g(w)});if(i&&!y.disableChecks)if(De(S)){if(S._tag===\"Success\"){let w=S===ze?x:S[pe];if(w===ge)return S;let E=eo(i,w,void 0,e,y);E&&(S=P(new Tt(e,E,w,y)))}}else S=I(S,w=>{if(w!==ge){let E=eo(i,w,void 0,e,y);if(E)return P(new Tt(e,E,w,y))}return g(w)});return S},m=o===void 0?d:o(d);return c?(x,y)=>{let S=p??=c.map(M=>t(M.to)),w=x,E=S[S.length-1](x,y);for(let M=c.length-1;M>=0;M--)if(E=u[M](E,w,y),M!==0){let _=S[M-1];E._tag===\"Success\"?(w=E[pe],E=_(w,y)):E=nt(E,h=>{let b=_(h,y);return b===ze?Gt(h):b})}if(E._tag===\"Success\"){let M=E[pe],_=m(M,y);return _===ze?E:_}return E=gF(e,x,y,E),nt(E,M=>{let _=m(M,y);return _===ze?Gt(M):_})}:m}var zh=Symbol(),yF=new WeakMap,SF,gu=!1;var A6=e=>gu?jh(xn,e,\"parser\"):xn(e).parser,bF=e=>gu?jh(xn,e,\"makeEffect\"):xn(e).makeEffect,k6=e=>GI(e,bF),Bh=class{ast;constructor(t){this.ast=t}get decodeEffect(){return this.cachedDecodeEffect??=ip(this.ast,A6)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=ip(this.ast,bF,k6)}},VI=class extends Bh{compiled;resolve;constructor(t,r,n){super(t),this.compiled=r,this.resolve=n}save(t,r){return Object.defineProperty(this,t,{value:r}),r}operation(t){let r=this.compiled;return typeof r==\"function\"?r(this.ast,this.resolve,t):r?.[t]}get is(){return this.save(\"is\",this.operation(\"is\"))}get decode(){return this.save(\"decode\",this.operation(\"decode\"))}get make(){return this.save(\"make\",this.operation(\"make\"))}get decodeEffect(){return this.save(\"decodeEffect\",this.operation(\"decodeEffect\")??ip(this.ast,t=>jh(this.resolve,t,\"parser\")))}get parser(){let t=this.decode;return t===void 0?this.decodeEffect:this.save(\"parser\",v6(t,()=>this.decodeEffect))}get makeEffect(){let t=this.operation(\"makeEffect\");if(t!==void 0)return this.save(\"makeEffect\",t);let r=n=>jh(this.resolve,n,\"makeEffect\");return this.save(\"makeEffect\",ip(this.ast,r,n=>GI(n,r)))}};function v6(e,t){let r;return(n,o)=>{if(n!==ge)try{let s=e(n,o);if(s!==zh)return s===n?ze:Gt(s)}catch(s){return Rr(s)}return(r??=t())(n,o)}}function jh(e,t,r){let n=e(t);if(n.compiled===void 0||Object.hasOwn(n,r))return n[r];let o;return(s,a)=>(o??=n[r])(s,a)}function xn(e){let t=yF.get(e);if(t!==void 0)return t;let r=SF===void 0?new Bh(e):new VI(e,SF(e,xn),xn);return yF.set(e,r),r}function YI(e){let t=e.ast,r;return(n,o)=>(r??=oT(D6,yt(t)))(n,o?.disableChecks?o?.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions)}function Hh(e){let t=YI(e);return(r,n)=>{let o=qo(t(r,n));return Ke(o)?O(o.value):(fn(o.cause,\"Option adapter can only return none for schema issues\"),v())}}function Wh(e){return N6(yt(e.ast))}function QI(e){return Pi(e.ast)}function _6(e){if(!gu){let o=yu(Gh(e));return s=>{let a=o(s,Jo);return Ke(a)?!0:(fn(a.cause,\"Type guard adapter can only return false for schema issues\"),!1)}}let t=xn(e),r=t.is;if(r!==void 0)return o=>{try{return r(o,Jo)}catch(s){return fn(oi(s),\"Type guard adapter can only return false for schema issues\"),!1}};let n=t.parser;return o=>{let s=qo(nT(n(o,Jo),o));return Ke(s)?!0:(fn(s.cause,\"Type guard adapter can only return false for schema issues\"),!1)}}function Pi(e){let t=yt(e),r=n=>(r=_6(t),r(n));return n=>r(n)}function EF(e){let t=Gh(e);return(r,n)=>{let o=qo(t(r,n));if(!Ke(o))return fn(o.cause,\"Issue adapter can only return schema issues\")}}function IF(e,t){let r=yt(e.ast),n=xn(r).parser(t,Jo),o=qo(nT(n,t));if(xs(o)){let s=fn(o.cause,\"Assertion adapter can only throw schema issues\");throw new Error(\"Schema validation failed\",{cause:s})}}function et(e,t){let r=Gh(e.ast);return t===void 0?r:(n,o)=>r(n,rT(t,o))}var XI=et;function TF(e,t){return yu(et(e,t))}function eT(e,t){return _F(et(e,t))}var wF=eT;function CF(e,t){return RF(et(e,t))}function R6(e,t){return gu?PF(e.ast,t):sT(et(e,t))}var Jh=R6;function Mi(e,t){let r=Gh(dn(e.ast));return t===void 0?r:(n,o)=>r(n,rT(t,o))}var AF=Mi;function kF(e,t){return yu(Mi(e,t))}function tT(e,t){return _F(Mi(e,t))}var vF=tT;function OF(e,t){return RF(Mi(e,t))}function P6(e,t){return gu?PF(dn(e.ast),t):sT(Mi(e,t))}var Kh=P6,rT=(e,t)=>t?{...e,...t}:e,qh=e=>e===ge?P(new de):g(e);function Gh(e){return oT(U6,e)}function nT(e,t){return e===ze?g(t):De(e)?e[pe]===ge?qh(ge):e:nt(e,qh)}function oT(e,t){let r;return(n,o)=>{let s=(r??=e(t))(n,o??Jo);return s===ze?g(n):De(s)?s[pe]===ge?qh(ge):s:nt(s,qh)}}function yu(e){return(t,r)=>qo(e(t,r))}function _F(e){let t=yu(e);return(r,n)=>{let o=t(r,n);return Ke(o)?O(o.value):(fn(o.cause,\"Option adapter can only return none for schema issues\"),v())}}function RF(e){let t=yu(e);return(r,n)=>{let o=t(r,n);return Ke(o)?B(o.value):K(fn(o.cause,\"Result adapter can only return schema issues\"))}}function PF(e,t){let r;return(n,o)=>(r??=M6(xn(e),t))(n,o)}function M6(e,t){let r=e.decode,n,o=r===void 0?(s,a=Jo)=>(n??=ZI(e))(s,a):(s,a=Jo)=>{if(s===ge)return(n??=ZI(e))(s,a);let i;try{i=r(s,a)}catch(c){throw fn(oi(c),\"Sync adapter can only throw schema issues\"),c}return i!==zh?i:(n??=ZI(e))(s,a)};return t===void 0?o:(s,a)=>o(s,rT(t,a))}function ZI(e){return sT(oT(()=>e.decodeEffect,e.ast))}function sT(e){let t=yu(e);return(r,n)=>{let o=t(r,n);if(Ke(o))return o.value;let s=fn(o.cause,\"Sync adapter can only throw schema issues\");throw new Error(\"Schema validation failed\",{cause:s})}}function F6(e,t){let r=qo(e);if(Ke(r))return r.value;let n=fn(r.cause,t);throw new Error(\"Schema validation failed\",{cause:n})}function N6(e){let t,r;return(n,o)=>{t??=xn(e);let s=o?.disableChecks?o.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions??Jo,a=t.make;if(a!==void 0&&n!==ge){let c;try{c=a(n,s)}catch(u){throw fn(oi(u),\"Constructor adapter can only throw schema issues\"),u}if(c!==zh&&c!==ge)return c}let i=(r??=t.makeEffect)(n,s);return F6(nT(i,n),\"Constructor adapter can only throw schema issues\")}}var U6=e=>xn(e).parser,D6=e=>xn(e).makeEffect;var Vh=\"~effect/Schema/Schema\",MF=Symbol(),L6={[Vh]:Vh,get make(){let e=Wh(this);return Object.defineProperty(this,\"make\",{value:e,enumerable:!0}),e},get makeEffect(){let e=YI(this);return Object.defineProperty(this,\"makeEffect\",{value:e,enumerable:!0}),e},get makeOption(){let e=Hh(this);return Object.defineProperty(this,\"makeOption\",{value:e,enumerable:!0}),e},pipe(){return Z(this,arguments)},annotate(e){return this.rebuild(Qn(this.ast,e))},annotateKey(e){return this.rebuild(ap(this.ast,e))},check(...e){return this.rebuild(Ko(this.ast,e))},rebuild(e){return to(e,this[MF])}};function to(e,t){function r(){}let n=Object.setPrototypeOf(r,L6);return t&&(Object.hasOwn(t,\"name\")||Object.hasOwn(t,\"length\")||Object.hasOwn(t,\"__proto__\"))?Object.defineProperties(n,Object.getOwnPropertyDescriptors({...t})):Object.assign(n,t),n[MF]=t,n.ast=e,n}function aT(e){return e.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}function cp(e){return e.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}function iT(e){return encodeURI(aT(e)).replace(/#/g,\"%23\")}function cT(e){if(e.length===0||e===\"#\")return\"\";if(!e.startsWith(\"#\"))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,\"%\").replace(/#/g,\"%23\")!==t)return;let r=decodeURIComponent(t);return r.startsWith(\"/\")&&!/~(?:[^01]|$)/.test(r)?r:void 0}catch{return}}function NF(e){let t=cT(e);return t===void 0?void 0:t.length===0?[]:t.slice(1).split(\"/\").map(cp)}function UF(e){return e.reduce((t,r)=>`${t}/${iT(r)}`,\"#\")}var B6=\"http://json-schema.org/draft-07/schema#\",DF=\"https://json-schema.org/draft/2020-12/schema\";function LF(e,t){return e===t||e===(t.endsWith(\"#\")?t.slice(0,-1):`${t}#`)}function jF(e){return{dialect:\"draft-07\",...W6(e,tG)}}function j6(e,t){return r(e,!1,!0);function r(n,o,s=!1){if(!ur(n))return n;let a=o||!s&&HF(n.$id),i={};for(let c of Object.keys(n)){let u=n[c],f=u;switch(c){case\"$defs\":case\"properties\":case\"patternProperties\":case\"dependentSchemas\":f=fT(u,p=>r(p,a))??u;break;case\"allOf\":case\"anyOf\":case\"oneOf\":case\"prefixItems\":f=Array.isArray(u)?u.map(p=>r(p,a)):u;break;case\"not\":case\"additionalProperties\":case\"propertyNames\":case\"unevaluatedProperties\":case\"items\":case\"contains\":case\"unevaluatedItems\":case\"if\":case\"then\":case\"else\":case\"contentSchema\":f=r(u,a)}N(i,c,f)}return t(i,a),i}}function zF(e,t){return j6(e,r=>{z6(r,t)})}function z6(e,t){typeof e.$ref==\"string\"&&N(e,\"$ref\",t(e.$ref,\"$ref\")),typeof e.$dynamicRef==\"string\"&&N(e,\"$dynamicRef\",t(e.$dynamicRef,\"$dynamicRef\"))}function fT(e,t){if(!ur(e))return;let r={};for(let n of Object.keys(e))N(r,n,t(e[n],n));return r}function q6(e,t,r){let n=new Map,o=[],s=uT;function a(d,m=[],x=[]){if(m.length===0&&t?.trackIds){let y=ur(d)?f(d):void 0;s=$F(y,uT)??uT}return u(d,m,x,{sourceRoot:[],targetRoot:[],uri:s})}function i(){for(let[d,m,x]of o){let y=m,S=qF(m,x);if(S!==void 0){let w=NF(S.hash);if(S.hash=\"\",w!==void 0){let E=n.get(BF(S.href,w));E!==void 0&&(y=H6(m,E))}}N(d,\"$ref\",y)}}let c=r(a);return i(),c;function u(d,m,x,y){if(typeof d==\"boolean\")return p(m,x,y),t?.booleanAdapter?.(d)??d;if(!ur(d))return d;let S=y,w=f(d);if(m.length>0&&t?.trackIds&&HF(w)){let _=$F(w,y.uri);_!==void 0&&(S={parent:y,sourceRoot:m,targetRoot:x,uri:_})}p(m,x,S);let E=S.uri,M={isDocumentRoot:m.length===0,schema(_,h,b=h){return u(_,[...m,h],[...x,b],S)},schemaAt(_,h,b){return u(_,[...m,...h],[...x,...b],S)},schemaArray(_,h,b=h){return Array.isArray(_)?_.map((T,C)=>u(T,[...m,h,String(C)],[...x,b,String(C)],S)):_},schemaMap(_,h,b=h){return ur(_)?fT(_,(T,C)=>u(T,[...m,h,C],[...x,b,C],S)):_},reference(_,h){typeof h==\"string\"?o.push([_,h,E]):N(_,\"$ref\",h)}};return e(d,M)}function f(d){return t?.ignoreRefSiblings===!0&&typeof d.$ref==\"string\"?void 0:d.$id}function p(d,m,x){x.parent!==void 0&&p(d,m,x.parent),n.set(BF(x.uri,d.slice(x.sourceRoot.length)),m.slice(x.targetRoot.length))}}var uT=\"https://effect.invalid/.json-schema/\";function qF(e,t){return URL.canParse(e,t)?new URL(e,t):void 0}function $F(e,t){if(typeof e!=\"string\")return;let r=qF(e,t);if(r!==void 0)return r.hash=\"\",r.href}function H6(e,t){let r=e.indexOf(\"#\");return r===-1&&t.length===0?e:`${r===-1?e:e.slice(0,r)}${UF(t)}`}function BF(e,t){return`${e}\\0${JSON.stringify(t)}`}function HF(e){return typeof e==\"string\"&&e.length>0&&e[0]!==\"#\"}function W6(e,t,r){return q6(t,{...r,trackIds:!0},n=>({schema:n(e.schema),definitions:fT(e.definitions,(o,s)=>n(o,[\"$defs\",s],[\"definitions\",s]))}))}var J6=new Set([\"properties\",\"patternProperties\"]),K6=new Set([\"allOf\",\"anyOf\",\"oneOf\"]),G6=new Set([\"not\",\"additionalProperties\",\"propertyNames\",\"contains\",\"if\",\"then\",\"else\",\"contentSchema\"]);function V6(e,t,r,n,o,s=J6){let a;if(s.has(t))a=n.schemaMap(r,t);else if(K6.has(t))a=n.schemaArray(r,t);else if(o.has(t))a=n.schema(r,t);else return!1;return N(e,t,a),!0}var WF=[\"$anchor\",\"$defs\",\"$dynamicAnchor\",\"$dynamicRef\",\"$vocabulary\",\"contentSchema\",\"dependentRequired\",\"dependentSchemas\",\"maxContains\",\"minContains\",\"prefixItems\",\"unevaluatedItems\",\"unevaluatedProperties\"],mie=[...WF,\"deprecated\"],hie=[...WF,\"$comment\",\"$id\",\"$schema\",\"const\",\"contains\",\"contentEncoding\",\"contentMediaType\",\"else\",\"examples\",\"if\",\"patternProperties\",\"propertyNames\",\"then\"],Z6=/^[A-Za-z_][-A-Za-z0-9._]*$/,Y6=/^[A-Za-z][-A-Za-z0-9._:]*$/;function Fi(e,t,r){throw new Error(`Cannot convert JSON Schema keyword \"${e}\" to ${t}: ${r}`)}function Q6(e,t,r,n){for(let o of t)Object.hasOwn(e,o)&&Fi(o,r,`it is not active in ${n} but would become active in the target`)}var X6=[\"additionalItems\",\"definitions\",\"dependencies\"];function eG(e,t,r,n,o){r.isDocumentRoot?N(e,\"$schema\",LF(t,DF)?n:t):LF(t,DF)||Fi(\"$schema\",o,\"an embedded resource cannot declare a different dialect\")}function tG(e,t){Q6(e,X6,\"Draft-07\",\"Draft 2020-12\");let r={},n,o,s;for(let a of Object.keys(e)){let i=e[a];if(!V6(r,a,i,t,G6))switch(a){case\"$ref\":n=i;break;case\"$schema\":eG(r,i,t,B6,\"Draft-07\");break;case\"$id\":case\"$anchor\":break;case\"$defs\":N(r,\"definitions\",t.schemaMap(i,a,\"definitions\"));break;case\"prefixItems\":o=i;break;case\"items\":s=i;break;case\"dependentRequired\":case\"dependentSchemas\":case\"minContains\":case\"maxContains\":break;case\"$dynamicRef\":case\"$dynamicAnchor\":case\"$vocabulary\":case\"unevaluatedProperties\":case\"unevaluatedItems\":Fi(a,\"Draft-07\",\"the target dialect has no equivalent\");case\"required\":if(Array.isArray(i)&&i.length===0)break;N(r,a,i);break;default:N(r,a,i)}}if(rG(r,o,s,t),Object.hasOwn(e,\"contains\")){let a=e.minContains,i=e.maxContains;(a!==void 0&&a!==1||i!==void 0)&&Fi(\"minContains/maxContains\",\"Draft-07\",\"contains cardinality cannot be represented\"),Object.hasOwn(e,\"minContains\")&&N(r,\"minContains\",a)}else Object.hasOwn(e,\"minContains\")&&N(r,\"minContains\",e.minContains),Object.hasOwn(e,\"maxContains\")&&N(r,\"maxContains\",e.maxContains);return oG(e,r,t,\"draft-07\"),aG(e,r,\"$id\",\"Draft-07\"),nG(r,n,t),r}function rG(e,t,r,n){if(t===void 0){r!==void 0&&N(e,\"items\",n.schema(r,\"items\"));return}N(e,\"items\",n.schemaArray(t,\"prefixItems\",\"items\")),r!==void 0&&N(e,\"additionalItems\",n.schema(r,\"items\",\"additionalItems\"))}function nG(e,t,r){if(t!==void 0)if(typeof t==\"string\"&&Object.keys(e).length>0){let n={};r.reference(n,t),sG(e,n)}else r.reference(e,t)}function oG(e,t,r,n){let o=ur(e.dependentRequired)?e.dependentRequired:void 0,s=ur(e.dependentSchemas)?e.dependentSchemas:void 0;if(o===void 0&&s===void 0)return;let a={},i=new Set([...Object.keys(o??{}),...Object.keys(s??{})]);for(let c of i){let u=o?.[c],f=s?.[c],p=n===\"draft-04\"&&Array.isArray(u)&&u.length===0;f===void 0?p||N(a,c,u):u===void 0||p?N(a,c,r.schemaAt(f,[\"dependentSchemas\",c],[\"dependencies\",c])):N(a,c,{allOf:[r.schemaAt(f,[\"dependentSchemas\",c],[\"dependencies\",c,\"allOf\",\"0\"]),{required:u}]})}Object.keys(a).length>0&&N(t,\"dependencies\",a)}function sG(e,t){Array.isArray(e.allOf)?e.allOf.push(t):N(e,\"allOf\",[t])}function aG(e,t,r,n){let o=e.$id,s=e.$anchor;if(s===void 0){o!==void 0&&N(t,r,o);return}(typeof s!=\"string\"||!Z6.test(s))&&Fi(\"$anchor\",n,\"the anchor is not valid\"),Y6.test(s)||Fi(\"$anchor\",n,\"the anchor cannot be represented as a plain-name fragment identifier\"),o===void 0?N(t,r,`#${s}`):Fi(\"$anchor\",n,\"it cannot be combined with the schema $id\")}function Zh(e){return to(Su(e.ast),{schema:e})}var Su=_i(e=>{let t=cG(e,Su),r=e.context;return t===e||r===void 0?t:Uh(t,lT(r))});function lT(e){return e.constructorDefault===void 0?e:new Wo(e.isOptional,e.isMutable,void 0,e.annotations)}function GF(e){if(e.propertySignatures.some(t=>typeof t.name!=\"string\"))throw new globalThis.Error(\"Objects property names must be strings\",{cause:e})}function VF(e){return t=>{let r=[...t].sort((o,s)=>e(mn(o))-e(mn(s)));return r.some((o,s)=>o!==t[s])?r:t}}var iG=VF(e=>{switch(e._tag){case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function cG(e,t){switch(e._tag){case\"Declaration\":{let r=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Yr(r))return qe(e,[JI]);let n=e.typeParameters.map(s=>to(mn(s))),o=r(n);return o===void 0?e:qe(e,[hu(o,t)])}case\"Unknown\":return qe(e,[JI]);case\"ObjectKeyword\":return qe(e,[mF]);case\"Undefined\":case\"Void\":case\"Literal\":case\"Number\":return e.toCodecJson();case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return GF(e),e.recur(t,Lh);case\"Union\":{let r=iG(e.types);return r!==e.types?new zr(r,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}function Yh(e){return to(ZF(yt(e.ast)))}var ZF=Zr(e=>{let t=uG(e,ZF);return t!==e&&e.context!==void 0?Uh(t,lT(e.context)):t});function uG(e,t){switch(e._tag){case\"Declaration\":{let r=e.annotations?.toCodecIso??e.annotations?.toCodec;if(Yr(r)){let n=r(e.typeParameters.map(o=>to(o)));return qe(e,[hu(n,t)])}return e}case\"Arrays\":case\"Objects\":case\"Union\":case\"Suspend\":return e.recur(t)}return e}function Qh(e){return to(eN(e.ast),{schema:e})}function YF(e){return to(tN(e.ast))}var fG=VF(e=>{switch(e._tag){case\"Null\":case\"Boolean\":case\"Number\":case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function lG(e,t,r){switch(e._tag){case\"Declaration\":{let n=e.typeParameters.map(u=>to(t(mn(u)))),o=e.annotations?.toCodecStringTree;if(Yr(o)){let u=o(n);return u===void 0?e:qe(e,[hu(u,t)])}let s=e.annotations?.toCodecJson,a=Yr(s)?s(n):void 0,i=a===void 0?e.annotations?.toCodec:void 0,c=a??(Yr(i)?i(n):void 0);return c===void 0?r(e):qe(e,[hu(c,t)])}case\"Null\":return qe(e,[pG]);case\"Boolean\":return qe(e,[dG]);case\"Unknown\":case\"ObjectKeyword\":return qe(e,[KI]);case\"Enum\":case\"Number\":case\"Literal\":case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return GF(e),e.recur(t,Lh);case\"Union\":{let n=fG(e.types);return n!==e.types?new zr(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}var pG=new ot(new pn(\"null\"),new Ce(oe(()=>null),oe(()=>\"null\"))),dG=new ot(new zr([new pn(\"true\"),new pn(\"false\")]),new Ce(oe(e=>e===\"true\"),Ai())),QF=new Ce(oe(e=>typeof e==\"string\"?[e]:e),jr()),XF=e=>e.transformation===QF,eN=_i(e=>{let t=lG(e,eN,r=>{throw new globalThis.Error(\"Missing structural codec for StringTree\",{cause:r})});return t!==e&&e.context!==void 0?Uh(t,lT(e.context)):t},{stopAt:XF}),KF=e=>Zt(e)?Ri(Yn):Yn,tN=_i(e=>{let t=mG(e);if(II(t)){let r=da(new zr([new Rn(t.isMutable,t.elements.map(KF),t.rest.map(KF)),ln],{mode:\"anyOf\"}),t,QF);return Zt(e)?Ri(r):r}return t},{stopAt:XF});function mG(e){return e._tag===\"Declaration\"||e._tag===\"Arrays\"||e._tag===\"Objects\"||e._tag===\"Union\"||e._tag===\"Suspend\"?e.recur(tN):e}var gie=globalThis.RegExp;var ws=e=>e.replace(/[/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\");function ma(e,t){return t.length>0&&(e+=`\n at ${ud(t)}`),new Error(e)}function rN(e){return`#/$defs/${iT(e)}`}var hG=new Set([...xP,wi,...hP]);function fp(e,t){if(e===void 0)return;let r={},n=e.title;typeof n==\"string\"&&(r.title=n);let o=e.description,s=e.expected;typeof o==\"string\"?r.description=o:t?.generateDescriptions===!0&&typeof s==\"string\"&&(r.description=s);let a=e.default;xu(a)&&(r.default=a);let i=e.examples;Array.isArray(i)&&xu(i)&&(r.examples=i);let c=e.readOnly;typeof c==\"boolean\"&&(r.readOnly=c);let u=e.writeOnly;typeof u==\"boolean\"&&(r.writeOnly=u);let f=e.format;typeof f==\"string\"&&(r.format=f);let p=e.contentEncoding;typeof p==\"string\"&&(r.contentEncoding=p);let d=e.contentMediaType;typeof d==\"string\"&&(r.contentMediaType=d);let m=e.contentSchema;if(xu(m)&&(r.contentSchema=m),t?.includeAnnotationKey!==void 0)for(let[x,y]of Object.entries(e))hG.has(x)||!t.includeAnnotationKey(x)||xu(y)&&N(r,x,y);return Object.keys(r).length===0?void 0:r}function oN(e){let t=e.type===\"number\"||e.type===\"integer\"?e.type:void 0,r=e;if(t!==void 0&&(r={...e},delete r.type),Array.isArray(r.allOf)){let n=[],o=!1;for(let s of r.allOf){let a=oN(s);a.type!==void 0&&(o=!0,(t===void 0||a.type===\"integer\")&&(t=a.type)),Object.keys(a.schema).length>0&&n.push(a.schema)}if(o){let{allOf:s,...a}=r;r=n.length===0?a:{...a,allOf:n}}}return{type:t,schema:r}}function xG(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==\"number\")return!1;let t=e.anyOf[1];return t?.type===\"string\"&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(\"NaN\")&&t.enum.includes(\"Infinity\")&&t.enum.includes(\"-Infinity\")}var sN=\"|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|\";function Xh(e,t){return Object.keys(e).every(r=>t.includes(`|${r}|`))}function nN(e,t){return typeof e.$ref!=\"string\"&&t.every(r=>!Object.hasOwn(e,r))}var mT=\"|title|description|default|examples|readOnly|writeOnly|\",gG=sN+mT;function lp(e,t,r){if(Object.keys(e).length===0)return t;let n=Object.keys(t);if(n.length===0)return e;let o=e.type===\"number\"||e.type===\"integer\"?e.type:void 0,s=xG(e);if(o!==void 0||s){let i=oN(t);if(i.type!==void 0){let c=o===\"integer\"||i.type===\"integer\"?\"integer\":\"number\",u={...e,type:c};s&&delete u.anyOf;let f=Object.keys(i.schema);return f.length===0?u:Xh(i.schema,mT)&&nN(u,f)?{...u,...i.schema}:lp(u,i.schema,r)}}if(r&&nN(e,n))return{...e,...t};let a=Array.isArray(t.allOf)&&n.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...a]}:typeof e.$ref==\"string\"?{allOf:[e,...a]}:{...e,allOf:a}}function dT(e,t=new Set){return typeof e==\"boolean\"?e:t.has(e)?!0:(t.add(e),e.every(r=>dT(r,t)))}function yG(e){return Array.isArray(e)}function SG(e,t,r,n){let o=new Map,s=new Map,a=new WeakMap,i=new Map,c=new Map,u=Object.keys(r);for(let h of u)x(h,[\"references\",h]);let f=In(e,(h,b)=>E(h,t[b],[]));for(let[h,b]of i.values())if(!dT(h))for(let T of b)Array.isArray(T.oneOf)&&(T.anyOf=T.oneOf,delete T.oneOf);for(let h of u){let b=r[h],T=S(b);if(T===void 0)continue;let C=o.get(h)[0],L=c.get(T),Q=L?.find(ye=>W(o.get(ye)[0],C));Q===void 0?L===void 0?c.set(T,[h]):L.push(h):s.set(h,Q)}let p=In(f,y),d={};for(let h of u)s.has(h)||N(d,h,y(o.get(h)[0]));return{dialect:\"draft-2020-12\",schemas:p,definitions:d};function m(h){return Array.isArray(h.oneOf)&&i.get(h.oneOf)?.[1].push(h),h}function x(h,b){if(!Object.hasOwn(r,h))throw ma(`Invalid reference ${h}`,[...b,\"$ref\"]);let T=o.get(h);if(T!==void 0)return T;let C=[{},[]];return o.set(h,C),C[0]=E(r[h],[\"references\",h],C[1]),C}function y(h){return zF(h,b=>{let T=cT(b);if(T===void 0){if(/^#(?:\\/|%2f)/i.test(b))throw new Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(b)}`);return b}if(!T.startsWith(\"/$defs/\"))return b;let C=T.indexOf(\"/\",7),L=s.get(cp(T.slice(7,C<0?void 0:C)));return L===void 0?b:b.replace(/^#(?:\\/|%2f).*?(?:\\/|%2f).*?(?=\\/|%2f|$)/i,rN(L))})}function S(h){if(h._tag===\"Reference\")return;let b=h.checks.length===0?h.annotations:h.checks[h.checks.length-1].annotations;return typeof b?.identifier!=\"string\"&&typeof b?.[wi]==\"string\"?b[wi]:void 0}function w(h,b,T,C){let L=h.annotations,Q=L?.toJsonSchema;if(Q!==void 0){let Ge=h.representation?.schemas?.map((mf,W$)=>E(mf,[...T,\"representation\",\"schemas\",W$],C))??[],Ns=Q({type:b,schemas:Ge}),Ye=yG(Ns);Ye&&C.push(!1);let jt=Ye?Ns[0]:Ns,cr=fp(L,n),rs=cr===void 0?jt:{...jt,...cr},Aa=cr===void 0?sN:gG;return[rs,h._tag===\"Filter\"&&Xh(rs,Aa)&&(cr===void 0||Xh(cr,mT))?!0:void 0]}if(h._tag===\"Filter\"){C.push(!1);return}let ye=h.checks.flatMap((Ge,Ns)=>{let Ye=w(Ge,b,[...T,\"checks\",Ns],C);return Ye===void 0?[]:[Ye[0]]});if(ye.length===0)return;let ve=fp(L,n),Et={allOf:ye};return[ve===void 0?Et:{...Et,...ve}]}function E(h,b,T){if(h._tag===\"Reference\")return T.push(x(h.$ref,b)[1]),{$ref:rN(h.$ref)};let C=a.get(h);if(C!==void 0)return T.push(C[1]),C[0];let L=[];T.push(L);let Q=M(h,b,L),ye=fp(h.annotations,n);ye!==void 0&&(Q={...Q,...ye});for(let ve=0;ve{if(typeof Q==\"number\"&&!globalThis.Number.isFinite(Q))throw ma(`Invalid numeric enum value ${globalThis.String(Q)}`,[...b,\"enums\",ye,1]);return{type:typeof Q,enum:[Q],title:L}});return C.length===0?{not:{}}:{anyOf:C}}case\"TemplateLiteral\":return{type:\"string\",pattern:`^${h.parts.map(ex).join(\"\")}$`};case\"Arrays\":{if(h.rest.length>1)throw ma(\"Invalid schema representation document\",[...b,\"rest\"]);let C={type:\"array\"},L=h.elements.length,Q=h.elements.map((ye,ve)=>{ye.isOptional&&L--;let Et=E(ye.type,[...b,\"elements\",ve,\"type\"],T),Ge=fp(ye.annotations,n);return Ge===void 0?Et:m(lp(Et,Ge))});if(Q.length>0?(C.prefixItems=Q,C.maxItems=h.elements.length,L>0&&(C.minItems=L)):C.items=!1,h.rest.length===1){delete C.maxItems;let ye=E(h.rest[0],[...b,\"rest\",0],T);Object.keys(ye).length>0?C.items=ye:delete C.items}return C}case\"Objects\":{if(h.propertySignatures.length===0&&h.indexSignatures.length===0)return{not:{type:\"null\"}};let C={type:\"object\"},L={},Q=[];for(let Ye=0;Ye0&&(C.properties=L),Q.length>0&&(C.required=Q);let ye={},ve=[],Et=[],Ge=!1;for(let Ye=0;Ye0;if(Ns&&(C.patternProperties=ye),Ge&&n?.onExcessProperty===\"error\"){let Ye=[];h.propertySignatures.length>0&&Ye.push({enum:Object.keys(L)});for(let jt=0;jt0&&(C.allOf=ve.map(jt=>({type:\"object\",additionalProperties:jt})))}else ve.length===0?C.additionalProperties=Ge||n?.onExcessProperty!==\"error\":ve.length===1&&h.propertySignatures.length===0&&!Ns?C.additionalProperties=ve[0]:ve.length>0&&(C.allOf=ve.map(Ye=>({type:\"object\",additionalProperties:Ye})));return typeof C.additionalProperties==\"object\"&&C.additionalProperties!==null&&Object.keys(C.additionalProperties).length===0&&delete C.additionalProperties,C}case\"Union\":{let C=[],L=h.types.map((ye,ve)=>E(ye,[...b,\"types\",ve],C));if(T.push(C),L.length===0)return{not:{}};let Q=h.options?.mode??\"anyOf\";if(Q===\"anyOf\"&&L.length>1){let ye=EG(L);if(ye!==void 0)return ye}return Q===\"oneOf\"&&i.set(L,[C,[]]),{[Q]:L}}}}function _(h,b,T){switch(h._tag){case\"Reference\":{if(!Object.hasOwn(r,h.$ref))throw ma(`Invalid reference ${h.$ref}`,[...b,\"$ref\"]);if(x(h.$ref,b),T.has(h.$ref))return;let C=new Set(T).add(h.$ref);return _(r[h.$ref],[\"references\",h.$ref],C)}case\"String\":{if(h.checks.length===0)return[];if(h.checks.length!==1||h.checks[0]._tag!==\"Filter\"||h.checks[0].annotations?.toJsonSchema===void 0)return;let C=[],L=E(h,b,C);return dT(C)&&L.type===\"string\"&&typeof L.pattern==\"string\"&&Xh(L,\"|type|pattern|title|description|default|examples|readOnly|writeOnly|\")?[L.pattern]:void 0}case\"TemplateLiteral\":return h.checks.length===0?[`^${h.parts.map(ex).join(\"\")}$`]:void 0;case\"Union\":{if(h.types.length===0||h.checks.length>0||h.options?.mode===\"oneOf\")return;let C=[];for(let L=0;Le;function ro(e){return e===void 0?void 0:{annotations:e}}function pp(e,t){let{references:r,representations:n}=TG([e],t);return{representation:n[0],references:r}}function TG(e,t){let r={},n=new Map,o=new Set,s=new Map,a=new Set;for(let h of e)m(h);let i=t?.referencePolicy??IG;for(let h of s.values())for(let b of h.values()){let T=i({ast:b.ast,occurrences:b.occurrences,identifier:b.identifier});if(T!==void 0){let C=T===b.identifier||!T.endsWith(\"_\")?\"_\":\"\";b.reference=u(T,b,C)}else b.isRecursive&&(b.reference=u(`${b.ast._tag}_`,b,\"\"))}return{representations:In(e,h=>y(h)),references:r};function u(h,b,T=\"_\"){let C=h,L=0;for(;n.has(C);){if(n.get(C)===b)return C;C=`${h}${T}${++L}`}return n.set(C,b),C}function f(h,b,T){let C=b.fallback;return C!==void 0?VE(h)===C?h:Qn(h,{[wi]:C}):T===b.identifier?h:Qn(h,{identifier:T})}function p(h,b){if(!Object.hasOwn(r,h)&&!o.has(h)){o.add(h);let T=S(b);o.delete(h),N(r,h,T)}return{_tag:\"Reference\",$ref:h}}function d(h){let b=mu(h),T=du(b),C=tu(b),L=C===void 0?(b!==h?tu(h):void 0)??VE(b):void 0;L!==void 0&&(C=`${L}Encoded`);let Q=s.get(T);Q===void 0&&(Q=new Map,s.set(T,Q));let ye=Q.get(C);return ye===void 0&&(ye={ast:T,identifier:C,fallback:L,occurrences:0,isRecursive:!1,reference:void 0},Q.set(C,ye)),ye}function m(h){let b=d(h),T=b.ast;if(b.occurrences++,a.has(b)){b.isRecursive=!0;return}if(!(b.occurrences>1)){switch(a.add(b),x(T.checks),T._tag){case\"Declaration\":case\"Arrays\":case\"Objects\":case\"Union\":T.recur(C=>(m(C),C));break;case\"TemplateLiteral\":T.parts.forEach(m);break;case\"Suspend\":m(T.thunk());break}a.delete(b)}}function x(h){h?.forEach(b=>{b.annotations?.representation?.schemas?.forEach(T=>m(yt(T))),b._tag===\"FilterGroup\"&&x(b.checks)})}function y(h){let b=d(h),T=b.ast,C=b.reference;if(C!==void 0){let L=b.identifier===void 0?T:f(T,b,C);return p(C,L)}return S(T)}function S(h){let b=w(h.checks);switch(h._tag){case\"Declaration\":return{_tag:\"Declaration\",typeParameters:h.typeParameters.map(T=>y(T)),checks:b,...M(h.annotations)};case\"Null\":case\"Undefined\":case\"Void\":case\"Never\":case\"Unknown\":case\"Any\":case\"String\":case\"Boolean\":case\"Number\":case\"BigInt\":case\"Symbol\":case\"ObjectKeyword\":return{_tag:h._tag,checks:b,...ro(h.annotations)};case\"Literal\":return{_tag:\"Literal\",literal:h.literal,checks:b,...ro(h.annotations)};case\"UniqueSymbol\":return{_tag:\"UniqueSymbol\",symbol:h.symbol,checks:b,...ro(h.annotations)};case\"Enum\":return{_tag:\"Enum\",enums:h.enums,checks:b,...ro(h.annotations)};case\"TemplateLiteral\":return{_tag:\"TemplateLiteral\",parts:h.parts.map(T=>y(T)),checks:b,...ro(h.annotations)};case\"Arrays\":return{_tag:\"Arrays\",elements:h.elements.map(T=>{let C=mu(T),L=C.context?.annotations;return{isOptional:Zt(C),type:y(T),...ro(L)}}),rest:h.rest.map(T=>y(T)),checks:b,...ro(h.annotations)};case\"Objects\":return{_tag:\"Objects\",propertySignatures:h.propertySignatures.map(T=>{let C=mu(T.type),L=C.context?.annotations;return{name:T.name,type:y(T.type),isOptional:Zt(C),isMutable:nF(C),...ro(L)}}),indexSignatures:h.indexSignatures.map(T=>({parameter:y(T.parameter),type:y(T.type)})),checks:b,...ro(h.annotations)};case\"Union\":return{_tag:\"Union\",types:h.types.map(T=>y(T)),...h.options===void 0?{}:{options:h.options},checks:b,...ro(h.annotations)};case\"Suspend\":return{_tag:\"Suspend\",checks:[],thunk:y(h.thunk()),...ro(h.annotations)}}}function w(h){return h?.map(E)??[]}function E(h){switch(h._tag){case\"Filter\":return{_tag:\"Filter\",aborted:h.aborted,..._(h.annotations)};case\"FilterGroup\":return{_tag:\"FilterGroup\",checks:In(h.checks,E),..._(h.annotations)}}}function M(h){if(h===void 0)return;let{representation:b,...T}=h;return{...b===void 0?void 0:{representation:b},...Object.keys(T).length===0?void 0:{annotations:T}}}function _(h){if(h===void 0)return;let{representation:b,...T}=h,C=b===void 0?void 0:b.schemas===void 0?b:{...b,schemas:b.schemas.map(L=>y(yt(L)))};return{...C===void 0?void 0:{representation:C},...Object.keys(T).length===0?void 0:{annotations:T}}}}function cN(e){return Ke(e)?e.value:{issues:[{message:tb(e.cause)}]}}function fN(e,t){let r=et(e),n={errors:\"all\",...t?.parseOptions},o=wP(t),s=a=>{let i=new Ga(\"sync\"),c=Ml(qb(r(a,n),{onFailure:o,onSuccess:f=>({value:f})}),{scheduler:i});c.currentDispatcher?.flush();let u=c.pollUnsafe();return u?cN(u):new Promise(f=>{c.addObserver(p=>{f(cN(p))})})};if(\"~standard\"in e){let a=e;return\"validate\"in a[\"~standard\"]||Object.assign(a[\"~standard\"],{validate:s}),a}return Object.assign(e,{\"~standard\":{version:1,vendor:\"effect\",validate:s}})}function wG(e){let t=pp(Su(e));return tx(t)}function uN(e,t){let r=wG(e);if(t===\"draft-2020-12\"){let n=r.schema;return Object.keys(r.definitions).length>0&&(n.$defs=r.definitions),n}else if(t===\"draft-07\"){let n=jF(r),o=n.schema;return Object.keys(n.definitions).length>0&&(o.definitions=n.definitions),o}throw new globalThis.Error(`Unsupported target: ${t}`)}function lN(e){let t={input(r){return uN(e.ast,r.target)},output(r){return uN(yt(e.ast),r.target)}};if(\"~standard\"in e){let r=e;return\"jsonSchema\"in r[\"~standard\"]||Object.assign(r[\"~standard\"],{jsonSchema:t}),r}return Object.assign(e,{\"~standard\":{version:1,vendor:\"effect\",jsonSchema:t}})}function dN(e,t){let r=[];return hT(e,t,\"\",r),r}function hT(e,t,r,n){if(!Object.is(e,t)){if(Array.isArray(e)&&Array.isArray(t)){let o=e.length,s=t.length,a=Math.min(o,s);for(let i=0;i=s;i--)n.push({op:\"remove\",path:`${r}/${i}`});for(let i=o;ii)throw new Error(`Array index out of bounds at \"${t.path}\".`);let c=o.slice();return t.op===\"add\"?c.splice(a,0,t.value):t.op===\"remove\"?c.splice(a,1):c[a]=t.value,pN(s,c)}if(rx(o)){if(t.op!==\"add\"&&!Object.hasOwn(o,n))throw new Error(`Property \"${n}\" does not exist at \"${t.path}\".`);let a={...o};return t.op===\"remove\"?delete a[n]:N(a,n,t.value),pN(s,a)}throw new Error(`Cannot ${t.op} at \"${t.path}\" (parent not found or not a container).`)}function vG(e,t){let r=AG(t);if(r.length===0)return null;let n=r[r.length-1],o=[],s=e;for(let a=0;a=s.length)return null;o.push({container:s,token:c}),s=s[c];continue}if(rx(s)){if(!Object.hasOwn(s,i))return null;o.push({container:s,token:i}),s=s[i];continue}return null}return{stack:o,parent:s,lastToken:n}}function pN(e,t){let r=t;for(let n=e.length-1;n>=0;n--){let{container:o,token:s}=e[n];if(Array.isArray(o)){let a=o.slice();a[s]=r,r=a}else{let a={...o};N(a,s,r),r=a}}return r}function gN(e){let t=Zh(e),r=Kh(t),n=Jh(t);return{empty:[],diff:(o,s)=>dN(r(o),r(s)),combine:(o,s)=>[...o,...s],patch:(o,s)=>{let a=r(o),i=mN(s,a);return Object.is(i,a)?o:n(i)}}}function yN(e,t){let r=tu(e.ast)??ZE(e.ast),n=AF(Qh(e));return o=>n(o).pipe(j(s=>_G(s,{rootName:r,...t})))}function _G(e,t){let r=t.rootName??\"root\",n=t.arrayItemName??\"item\",o=t.pretty??!0,s=t.indent??\" \",a=t.sortKeys??!0,i=new Set,c=[];return f(r,e,0),c.join(o?`\n`:\"\");function u(p,d){c.push(o?s.repeat(p)+d:d)}function f(p,d,m,x){let{attrs:y,safe:S}=bu.tagInfo(p,x);if(d===void 0)u(m,`<${S}${y}/>`);else if(typeof d==\"string\")u(m,`<${S}${y}>${bu.escapeText(d)}`);else if(typeof d!=\"object\"||d===null)u(m,`<${S}${y}>${bu.escapeText(F(d))}`);else{if(i.has(d))throw new globalThis.Error(\"Cycle detected while serializing to XML.\",{cause:d});i.add(d);try{if(globalThis.Array.isArray(d)){if(d.length===0){u(m,`<${S}${y}/>`);return}u(m,`<${S}${y}>`);for(let M of d)f(n,M,m+1);u(m,``);return}let w=d,E=Object.keys(w);if(a&&E.sort(),E.length===0){u(m,`<${S}${y}/>`);return}u(m,`<${S}${y}>`);for(let M of E)f(bu.parseTagName(M).safe,w[M],m+1,M);u(m,``)}finally{i.delete(d)}}}}var bu={escapeText(e){return e.replace(/&/g,\"&\").replace(//g,\">\")},escapeAttribute(e){return e.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(//g,\">\")},parseTagName(e){let t=e,r=e;return/^[A-Za-z_]/.test(r)||(r=\"_\"+r),r=r.replace(/[^A-Za-z0-9._-]/g,\"_\"),/^xml/i.test(r)&&(r=\"_\"+r),{safe:r,changed:r!==t}},tagInfo(e,t){let{changed:r,safe:n}=bu.parseTagName(e),s=r||t&&t!==e?` data-name=\"${bu.escapeAttribute(t??e)}\"`:\"\";return{safe:n,attrs:s}}};var xT=Zr(e=>ha(e));function ha(e){let t=Ts(e)?.toEquivalence;if(t)return t(lu(e)?e.typeParameters.map(ha):[]);switch(e._tag){case\"Never\":return za();case\"Declaration\":return PG(e);case\"Null\":case\"Undefined\":case\"Void\":case\"Unknown\":case\"Any\":case\"String\":case\"Number\":case\"Boolean\":case\"BigInt\":case\"Symbol\":case\"Literal\":case\"UniqueSymbol\":case\"ObjectKeyword\":case\"Enum\":case\"TemplateLiteral\":return W;case\"Arrays\":{let r=e.elements.map(ha),n=e.rest.map(ha),[o,...s]=n,a=s.length;return tr((i,c)=>{if(!Array.isArray(i)||!Array.isArray(c))return!1;let u=i.length;if(u!==c.length)return!1;let f=0;for(;f0){for(;fha(o.type)),n=e.indexSignatures.map(o=>ha(o.type));return tr((o,s)=>{if(!ur(o)||!ur(s))return!1;for(let a=0;a[Pi(s),ha(e.types[a])]);return tr((s,a)=>{let i=n(s,!1);for(let c=0;c(r??=xT(e.thunk()))(n,o))}}}function PG(e){let t=e.annotations?.representation;if(t===void 0)return W;switch(t.id){case\"effect/schema/Option\":{let[r]=Ni(e);return(n,o)=>n._tag===o._tag&&(n._tag===\"None\"||r(n.value,o.value))}case\"effect/schema/Result\":{let[r,n]=Ni(e);return(o,s)=>o._tag===s._tag&&(o._tag===\"Success\"?r(o.success,s.success):n(o.failure,s.failure))}case\"effect/schema/CauseReason\":{let[r,n]=Ni(e);return bN(r,n)}case\"effect/schema/Cause\":{let[r,n]=Ni(e);return SN(r,n)}case\"effect/schema/Exit\":{let[r,n,o]=Ni(e),s=SN(n,o);return(a,i)=>a._tag===i._tag&&(a._tag===\"Success\"?r(a.value,i.value):s(a.cause,i.cause))}case\"effect/schema/ReadonlyMap\":{let[r,n]=Ni(e);return cd(r,n)}case\"effect/schema/ReadonlySet\":return Ef(Ni(e)[0]);case\"effect/schema/RegExp\":return(r,n)=>r.source===n.source&&r.flags===n.flags;case\"effect/schema/URL\":return(r,n)=>r.toString()===n.toString();default:return W}}function Ni(e){return e.typeParameters.map(ha)}function bN(e,t){return(r,n)=>{if(r._tag!==n._tag)return!1;switch(r._tag){case\"Fail\":return e(r.error,n.error);case\"Die\":return t(r.defect,n.defect);case\"Interrupt\":return r.fiberId===n.fiberId}}}function SN(e,t){let r=xd(bN(e,t));return(n,o)=>r(n.reasons,o.reasons)}function IN(e,t){return r=>{switch(r._tag){case\"Fail\":return`Fail(${e(r.error)})`;case\"Die\":return`Die(${t(r.defect)})`;case\"Interrupt\":return\"Interrupt\"}}}function EN(e,t){let r=IN(e,t);return n=>`Cause([${n.reasons.map(r).join(\", \")}])`}function TN(e,t){let r=new Map;return n(e);function n(a){let i=r.get(a);return i===void 0&&(i=o(a),r.set(a,i)),i}function o(a){let i=Ts(a)?.toFormatter;if(typeof i==\"function\")return i(lu(a)?a.typeParameters.map(n):[]);if(t?.onBefore){let c=t.onBefore(a,n);if(c!==void 0)return c}return s(a)}function s(a){switch(a._tag){default:return F;case\"Never\":return()=>\"never\";case\"Void\":return()=>\"void\";case\"Declaration\":{let i=a.annotations?.representation;if(i===void 0)return F;let c=a.typeParameters.map(n);switch(i.id){case\"effect/schema/Option\":{let[u]=c;return Ht({onNone:()=>\"none()\",onSome:f=>`some(${u(f)})`})}case\"effect/schema/Result\":{let[u,f]=c;return Ar({onSuccess:p=>`success(${u(p)})`,onFailure:p=>`failure(${f(p)})`})}case\"effect/schema/CauseReason\":return IN(c[0],c[1]);case\"effect/schema/Cause\":return EN(c[0],c[1]);case\"effect/schema/Exit\":{let[u,f,p]=c,d=EN(f,p);return m=>{switch(m._tag){case\"Success\":return`Exit.Success(${u(m.value)})`;case\"Failure\":return`Exit.Failure(${d(m.cause)})`}}}case\"effect/schema/ReadonlyMap\":{let[u,f]=c;return p=>{let d=p.size;if(d===0)return\"ReadonlyMap(0) {}\";let m=globalThis.Array.from(p.entries()).sort().map(([x,y])=>`${u(x)} => ${f(y)}`);return`ReadonlyMap(${d}) { ${m.join(\", \")} }`}}case\"effect/schema/HashMap\":{let[u,f]=c;return p=>{let d=HR(p);if(d===0)return\"HashMap(0) {}\";let m=Bl(p).sort().map(([x,y])=>`${u(x)} => ${f(y)}`);return`HashMap(${d}) { ${m.join(\", \")} }`}}case\"effect/schema/ReadonlySet\":{let[u]=c;return f=>{let p=f.size;if(p===0)return\"ReadonlySet(0) {}\";let d=globalThis.Array.from(f.values()).sort().map(m=>`${u(m)}`);return`ReadonlySet(${p}) { ${d.join(\", \")} }`}}case\"effect/schema/HashSet\":{let[u]=c;return f=>{let p=VR(f);if(p===0)return\"HashSet(0) {}\";let d=globalThis.Array.from(f).sort().map(m=>`${u(m)}`);return`HashSet(${p}) { ${d.join(\", \")} }`}}case\"effect/schema/Chunk\":{let[u]=c;return f=>{let p=gR(f);if(p===0)return\"Chunk(0) {}\";let d=globalThis.Array.from(f).sort().map(m=>`${u(m)}`);return`Chunk(${p}) { ${d.join(\", \")} }`}}default:return F}}case\"Arrays\":{let i=a.elements.map(d=>n(d)),c=a.rest.map(n),[u,...f]=c,p=f.length;return d=>{let m=[],x=0;for(;x0){for(;xn(u.type)),c=a.indexSignatures.map(u=>n(u.type));return a.propertySignatures.length===0&&a.indexSignatures.length===0?F:u=>{let f=[],p=new Set;for(let d=0;d0?\"{ \"+f.join(\", \")+\" }\":\"{}\"}}case\"Union\":{let i=yt(a).types,c=np(i),u=i.map((f,p)=>[Pi(f),n(a.types[p])]);return f=>{let p=c(f,!1);for(let d=0;d(i??=n(a.thunk()))(c)}}}}var gT=l(2,(e,t)=>bT(e,(r,n)=>CN(t,r)?[r,n]:void 0)),yT=l(2,(e,t)=>bT(e,(r,n)=>CN(t,r)?void 0:[r,n])),wN=l(2,(e,t)=>({...e,...t}));var ST=l(2,(e,t)=>bT(e,(r,n)=>[Object.hasOwn(t,r)?t[r]:r,n]));var hr=e=>e;function CN(e,t){return e.some(r=>r===t||typeof r==\"number\"&&String(r)===t)}function bT(e,t){let r={};for(let n of Reflect.ownKeys(e)){if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;let o=t(n,e[n]);if(o){let[s,a]=o;N(r,s,a)}}return r}function vN(e,t){return no(Eu(\"Iso\",e,t))}function AN(e,t){return no(Eu(\"Lens\",e,t))}function Eu(e,t,r){return[{_tag:\"PrimitiveNode\",kind:e,get:t,set:r}]}var NG={kind:\"Iso\",get:R,set:R},nx=class{_tag=\"PathNode\";kind=\"Lens\";path;get;set;constructor(t){this.path=t,this.get=r=>{let n=r;for(let o=0;o{let o=ox(n),s=o,a=0;for(;afF(t,r)}};function Ui(e,t){if(e.length===0)return t;if(t.length===0)return e;let r=e.slice();for(let n=0;nr)}modify(t){return r=>Nf(Dt(this.getResult(r),n=>this.replaceResult(t(n),r)),()=>r)}compose(t){return no(Ui(this.node,t.node))}key(t){return no(Ui(this.node,[new nx([t])]))}optionalKey(t){return no(Ui(this.node,Eu(\"Lens\",r=>r[t],(r,n)=>{let o=ox(n);return r===void 0?Array.isArray(o)&&(typeof t==\"number\"||typeof t==\"string\"&&Sc(t))?o.splice(Number(t),1):delete o[t]:N(o,t,r),o})))}check(...t){return no(Ui(this.node,[new dp(t)]))}refine(t,r){return no(Ui(this.node,[new dp([Nh(t,r)])]))}tag(t){let r=K(new de({expected:`${JSON.stringify(t)} tag`}));return no(Ui(this.node,Eu(\"Prism\",n=>n._tag===t?B(n):r,R)))}at(t,...r){let n=K(new ct([t],new fa(void 0)));return no(Ui(this.node,Eu(\"Optional\",o=>Object.hasOwn(o,t)?B(o[t]):n,(o,s)=>{if(Object.hasOwn(s,t)){let a=ox(s);return N(a,t,o),B(a)}else return n})))}pick(t){return this.compose(AN(gT(t),(r,n)=>({...yT(n,t),...r})))}omit(t){return this.compose(AN(yT(t),(r,n)=>({...gT(n,t),...r})))}notUndefined(){return this.refine(Io,{expected:\"a value other than `undefined`\"})}forEach(t){let r=t(sx());return UG(n=>Cr(this.getResult(n),o=>{let s=[];for(let a=0;aDt(this.getResult(o),s=>{let a=[];for(let c=0;cNf(Dt(this.getResult(r),n=>this.replaceResult(n.map(t),r)),()=>r)}},IT=class extends Iu{get;set;constructor(t,r,n){super(t,o=>B(r(o)),o=>B(n(o))),this.get=r,this.set=n}replace(t,r){return this.set(t)}modify(t){return r=>this.set(t(this.get(r)))}},TT=class extends Iu{get;constructor(t,r,n){super(t,o=>B(r(o)),(o,s)=>B(n(o,s))),this.get=r,this.replace=n}modify(t){return r=>this.replace(t(this.get(r)),r)}},wT=class extends Iu{set;constructor(t,r,n){super(t,r,(o,s)=>B(n(o))),this.set=n}replace(t,r){return this.set(t)}modify(t){return r=>Nf(Cr(this.getResult(r),n=>this.set(t(n))),()=>r)}};function no(e){let t=e[0]??NG;if(e.length>1){let r=e.reduce((n,o)=>$G(n,o.kind),\"Iso\");t={kind:r,get:DG(e,r),set:LG(e,r)}}switch(t.kind){case\"Iso\":return new IT(e,t.get,t.set);case\"Lens\":return new TT(e,t.get,t.set);case\"Prism\":return new wT(e,t.get,t.set);case\"Optional\":return new Iu(e,t.get,t.set)}}function ox(e){if(Array.isArray(e))return e.slice();if(typeof e==\"object\"&&e!==null){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw new Error(\"Cannot clone object with non-Object constructor or null prototype\");return{...e}}return e}function DG(e,t){return r=>{for(let n=0;n{for(let n=e.length-1;n>=0;n--)r=e[n].set(r);return r}:(r,n)=>{let o=e.length,s=new Array(o);for(let a=0;a=0;a--){let i=e[a];if(kN(i.kind))r=i.set(r);else if(i.kind===\"Lens\")r=i.set(r,s[a]);else{let c=i.set(r,s[a]);if(ce(c))return c;r=c.success}}return t===\"Optional\"?B(r):r}}function CT(e){return e===\"Prism\"||e===\"Optional\"}function kN(e){return e===\"Iso\"||e===\"Prism\"}function $G(e,t){return e===\"Iso\"?t:t===\"Iso\"||e===t?e:\"Optional\"}var BG=no([]);function sx(){return BG}function _N(e){let t=Yh(e);return vN(Kh(t),Jh(t))}function RN(e){return sx()}function PN(e){return sx()}var Tu=\"~effect/Schema/SchemaError\";function MN(e){return A(e,Tu)&&e[Tu]===Tu}var gn=\"~effect/net/NetAddress\";var oo=e=>e.value,so=e=>e,Cs=e=>e.bytes,Di=class extends Fr(\"NetAddressError\"){},wu=e=>A(e,gn),xr=e=>wu(e)&&e._tag===\"Ipv4Address\",Vo=e=>wu(e)&&e._tag===\"Ipv6Address\",FN=e=>xr(e)||Vo(e),Cu=e=>xr(e)?32:128,Au=e=>wu(e)&&e._tag===\"MacAddress\",hp=e=>wu(e)&&e._tag===\"InetAddressV4\",xp=e=>wu(e)&&e._tag===\"InetAddressV6\",AT=e=>hp(e)||xp(e),ax=e=>wu(e)&&e._tag===\"UnixPathAddress\",NN=e=>AT(e)||ax(e),zG={_tag:\"Ipv4Address\",[gn]:gn,[ae](e){return xr(e)&&oo(this)===oo(e)},[se](){return zt(fe(JG,oo(this)|0))},toString(){return ao(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},qG={_tag:\"Ipv6Address\",[gn]:gn,[ae](e){if(!Vo(e))return!1;let t=so(this),r=so(e);return t.w0===r.w0&&t.w1===r.w1&&t.w2===r.w2&&t.w3===r.w3},[se](){let e=so(this),t=fe(KG,e.w0|0);return t=fe(t,e.w1|0),t=fe(t,e.w2|0),zt(fe(t,e.w3|0))},toString(){return ao(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},HG={_tag:\"MacAddress\",[gn]:gn,[ae](e){return Au(e)&&WG(Cs(this),Cs(e))},[se](){return fe(GG,To(Cs(this)))},toString(){return vT(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},WG=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r{let t=Object.create(zG);return t.value=e>>>0,Object.freeze(t)},ZG=(e,t,r,n)=>{let o=Object.create(qG);return o.w0=e>>>0,o.w1=t>>>0,o.w2=r>>>0,o.w3=n>>>0,Object.freeze(o)},YG=(e,t,r,n)=>(e<<24|t<<16|r<<8|n)>>>0;var mp=e=>[e>>>24,e>>>16&255,e>>>8&255,e&255],QG=e=>{let t=Object.assign(Object.create(HG),{bytes:new Uint8Array(e)});return Object.freeze(t)};var St=(e,t)=>K(new Di({input:e,message:t})),XG=e=>e.every(t=>Number.isInteger(t)&&t>=0&&t<=255)?B(VG(YG(e[0],e[1],e[2],e[3]))):St(e,\"octets must be integers from 0 through 255\"),e3=e=>e.every(t=>Number.isInteger(t)&&t>=0&&t<=65535)?B(ZG(e[0]*65536+e[1],e[2]*65536+e[3],e[4]*65536+e[5],e[6]*65536+e[7])):St(e,\"segments must be integers from 0 through 65535\");var UN=e=>/^(?:[0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$/.test(e)?B(QG(new Uint8Array(e.split(\":\").map(t=>Number.parseInt(t,16))))):St(e,\"expected six two-digit hexadecimal octets separated by colons\");var ku=e=>{let t=e.split(\".\");if(t.length!==4||t.some(n=>!/^\\d{1,3}$/.test(n)))return St(e,\"expected exactly four decimal octets\");if(t.some(n=>n.length>1&&n[0]===\"0\"))return St(e,\"leading zeroes are not allowed\");let r=t.map(Number);return r.some(n=>n>255)?St(e,\"octets must be at most 255\"):XG([r[0],r[1],r[2],r[3]])},t3=e=>{if(e.includes(\"[\")||e.includes(\"]\")||e.includes(\"%\"))return St(e,\"brackets and zone identifiers are not valid in a bare IPv6 address\");let t=e.split(\"::\");if(t.length>2)return St(e,\"only one compression marker is allowed\");let r=t[0]===\"\"?[]:t[0].split(\":\"),n=t.length===2&&t[1]!==\"\"?t[1].split(\":\"):[];if(r.some(f=>f===\"\")||n.some(f=>f===\"\"))return St(e,\"empty segments are only valid in the compression marker\");let o=n.length>0?n[n.length-1]:r.length>0?r[r.length-1]:\"\",s;if(o.includes(\".\")){if(t.length===2&&n.length===0)return St(e,\"embedded IPv4 syntax must be trailing\");let f=Cr(ku(o),p=>{let d=oo(p);return[d>>>16,d&65535]});if(ce(f))return f;s=f.success,n.length>0?n.pop():r.pop()}let a=r.length+n.length+(s?2:0);if(t.length===1?a!==8:a>=8)return St(e,t.length===1?\"expected eight segments\":\"compression must replace at least one segment\");let i=f=>/^[0-9a-fA-F]{1,4}$/.test(f)?Number.parseInt(f,16):void 0,c=r.map(i),u=n.map(i);return c.some(f=>f===void 0)||u.some(f=>f===void 0)?St(e,\"segments must contain one through four hexadecimal digits\"):B([...c,...Array(8-a).fill(0),...u,...s??[]])},gp=e=>Dt(t3(e),t=>e3(t)),yp=e=>e.includes(\":\")?gp(e):ku(e);var kT=e=>mp(oo(e)),r3=e=>{let{w0:t,w1:r,w2:n,w3:o}=so(e);return[t>>>16,t&65535,r>>>16,r&65535,n>>>16,n&65535,o>>>16,o&65535]},DN=e=>{let{w0:t,w1:r,w2:n,w3:o}=so(e);return[...mp(t),...mp(r),...mp(n),...mp(o)]};var vT=e=>Array.from(Cs(e),t=>t.toString(16).padStart(2,\"0\")).join(\":\"),ix=e=>Cs(e).every(t=>t===255),n3=e=>(Cs(e)[0]&1)!==0,cx=e=>(Cs(e)[0]&1)===0,OT=e=>(Cs(e)[0]&2)!==0,_T=e=>(Cs(e)[0]&2)===0;var ao=e=>{if(xr(e))return kT(e).join(\".\");let t=r3(e);if(o3(e))return`::ffff:${t[6]>>8}.${t[6]&255}.${t[7]>>8}.${t[7]&255}`;let r=-1,n=0,o=-1;for(let i=0;i<=8;i++)i<8&&t[i]===0?o===-1&&(o=i):o!==-1&&(i-o>n&&(r=o,n=i-o),o=-1);if(n<2)return t.map(i=>i.toString(16)).join(\":\");let s=t.slice(0,r).map(i=>i.toString(16)).join(\":\"),a=t.slice(r+n).map(i=>i.toString(16)).join(\":\");return`${s}::${a}`},ux=e=>{if(xr(e))return oo(e)===0;let{w0:t,w1:r,w2:n,w3:o}=so(e);return t===0&&r===0&&n===0&&o===0},RT=e=>{if(xr(e))return oo(e)>>>24===127;let{w0:t,w1:r,w2:n,w3:o}=so(e);return t===0&&r===0&&n===0&&o===1},vu=e=>Au(e)?n3(e):xr(e)?oo(e)>>>28===14:so(e).w0>>>24===255,fx=e=>Au(e)?ix(e):oo(e)===4294967295,PT=e=>Au(e)?cx(e):!vu(e)&&!ux(e)&&(!xr(e)||!fx(e)),MT=e=>xr(e)?oo(e)>>>16===43518:(so(e).w0>>>16&65472)===65152,FT=e=>{let t=oo(e);return t>>>24===10||(t>>>16&65520)===44048||t>>>16===49320},NT=e=>(so(e).w0>>>24&254)===252,o3=e=>{let{w0:t,w1:r,w2:n}=so(e);return t===0&&r===0&&n===65535};var s3={_tag:\"InetAddressV4\",[gn]:gn,[ae](e){return hp(e)&&this.port===e.port&&W(this.address,e.address)},[se](){return fe(H(this.address),It(this.port))},toString(){return lx(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},a3={_tag:\"InetAddressV6\",[gn]:gn,[ae](e){return xp(e)&&this.port===e.port&&this.scopeId===e.scopeId&&W(this.address,e.address)},[se](){return fe(fe(H(this.address),It(this.port)),It(this.scopeId))},toString(){return lx(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},LN=e=>Number.isInteger(e)&&e>=0&&e<=65535,i3=(e,t)=>{if(!LN(t))return St(e,\"port must be an integer from 0 through 65535\");let r=Object.create(s3);return r.address=e,r.port=t,B(Object.freeze(r))},c3=(e,t,r)=>{if(!LN(t))return St(e,\"port must be an integer from 0 through 65535\");let n=r?.scopeId??0;if(!Number.isInteger(n)||n<0||n>4294967295)return St(e,\"scopeId must be an unsigned 32-bit integer\");let o=Object.create(a3);return o.address=e,o.port=t,o.scopeId=n,B(Object.freeze(o))};var $N=e=>{let t,r,n=0,o=e.startsWith(\"[\");if(o){let s=e.indexOf(\"]\");if(s<0||e[s+1]!==\":\"||e.indexOf(\"]\",s+1)!==-1)return St(e,\"expected [IPv6]:port\");t=e.slice(1,s),r=e.slice(s+2);let a=t.indexOf(\"%\");if(a!==-1){let i=t.slice(a+1);if(t.indexOf(\"%\",a+1)!==-1||!/^\\d+$/.test(i))return St(e,\"scope identifier must be decimal\");if(n=Number(i),!Number.isInteger(n)||n>4294967295)return St(e,\"scope identifier must be an unsigned 32-bit integer\");t=t.slice(0,a)}}else{let s=e.lastIndexOf(\":\");if(s<0)return St(e,\"expected host:port or [IPv6]:port\");if(e.indexOf(\":\")!==s)return St(e,\"IPv6 addresses must be bracketed\");t=e.slice(0,s),r=e.slice(s+1)}return/^(0|[1-9]\\d*)$/.test(r)?Dt(yp(t),s=>o!==Vo(s)?St(e,\"only IPv6 addresses use brackets\"):Vo(s)?c3(s,Number(r),{scopeId:n}):i3(s,Number(r))):St(e,\"port must be an unpadded decimal integer\")};var u3=e=>ao(e.address)+(xp(e)&&e.scopeId!==0?`%${e.scopeId}`:\"\");var lx=e=>{let t=u3(e);return hp(e)?`${t}:${e.port}`:`[${t}]:${e.port}`};var f3={_tag:\"UnixPathAddress\",[gn]:gn,[ae](e){return ax(e)&&this.path===e.path},[se](){return fe(_e(\"UnixPathAddress\"),_e(this.path))},toString(){return this.path},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},BN=e=>{let t=Object.create(f3);return t.path=e,Object.freeze(t)};var DT=\"~effect/net/IpInterface\",jN=e=>Sp(e)&&xr(e.address),zN=e=>Sp(e)&&Vo(e.address),Sp=e=>A(e,DT),l3={_tag:\"IpInterface\",[DT]:DT,[ae](e){return Sp(e)&&this.prefixLength===e.prefixLength&&W(this.address,e.address)},[se](){return fe(H(this.address),It(this.prefixLength))},toString(){return Ep(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},LT=(e,t)=>K(new Di({input:e,message:t})),bp=(e,t)=>{let r=Cu(e);if(!Number.isInteger(t)||t<0||t>r)return LT(e,`prefix length must be an integer from 0 through ${r}`);let n=Object.assign(Object.create(l3),{address:e,prefixLength:t});return B(Object.freeze(n))},$T=(e,t)=>{let r=e.indexOf(\"/\");if(r===-1&&t?.prefix!==\"required\")return B({address:e,prefixLength:void 0});if(r<=0||r!==e.lastIndexOf(\"/\")||r===e.length-1)return LT(e,\"expected an address and prefix length separated by one slash\");let n=e.slice(r+1);return/^(0|[1-9][0-9]*)$/.test(n)?B({address:e.slice(0,r),prefixLength:Number(n)}):LT(e,\"prefix length must be an unpadded ASCII decimal integer\")},px=(e,t)=>Dt($T(e,t),r=>Dt(ku(r.address),n=>bp(n,r.prefixLength??Cu(n)))),dx=(e,t)=>Dt($T(e,t),r=>Dt(gp(r.address),n=>bp(n,r.prefixLength??Cu(n)))),mx=(e,t)=>Dt($T(e,t),r=>Dt(yp(r.address),n=>bp(n,r.prefixLength??Cu(n))));var Ep=e=>`${ao(e.address)}/${e.prefixLength}`;var BT=\"~effect/net/IpNetwork\",HN=e=>Ip(e)&&xr(e.address),WN=e=>Ip(e)&&Vo(e.address),Ip=e=>A(e,BT),p3={_tag:\"IpNetwork\",[BT]:BT,[ae](e){return Ip(e)&&this.prefixLength===e.prefixLength&&W(this.address,e.address)},[se](){return fe(H(this.address),It(this.prefixLength))},toString(){return Tp(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},d3=e=>{let t=Object.assign(Object.create(p3),{address:e.address,prefixLength:e.prefixLength});return Object.freeze(t)},m3=e=>xr(e)?kT(e):DN(e);var h3=(e,t)=>{let r=Math.floor(t/8),n=t%8;return e.map((o,s)=>sDt(bp(e,t),r=>{let n=m3(e),o=h3(n,t);return n.some((s,a)=>s!==o[a])?K(new Di({input:e,message:\"address has non-zero host bits\"})):B(d3(r))});var JN=e=>Dt(px(e,{prefix:\"required\"}),t=>jT(t.address,t.prefixLength)),KN=e=>Dt(dx(e,{prefix:\"required\"}),t=>jT(t.address,t.prefixLength)),GN=e=>Dt(mx(e,{prefix:\"required\"}),t=>jT(t.address,t.prefixLength));var Tp=e=>`${ao(e.address)}/${e.prefixLength}`;var wp=Vh;function qr(){return(e,t,r)=>q(new pu(e.map(rp),n=>t(n.map(o=>q(o))),r))}function Be(e,t){return qr()([],()=>(r,n,o)=>e(r)?g(r):P(new ut(n,r,o)),t)}function g3(e){return e}function y3(e){return t=>t.annotate(e)}function S3(e){return t=>zT(zT(t).annotate(e))}function b3(e){return t=>t.rebuild(ap(t.ast,e))}function E3(e){return e}var As=class extends Fr(\"SchemaError\"){[Tu]=Tu;constructor(t){let r=Co();Qr(0);try{super({issue:t})}finally{Qr(r)}}get message(){return CP(this.issue)}toString(){return`SchemaError(${this.message})`}};function cU(e){return MN(e)}function uU(e){return De(e)?KT(e):xt(e,t=>Ss(()=>ms(t,r=>new As(r))))}function KT(e){return Ke(e)?e:Ur(ms(e.cause,t=>new As(t)))}function fU(e,t){let r;for(let n of e.reasons){if(!fl(n)||!cU(n.error))throw new globalThis.Error(t,{cause:e});r??=n.error}if(r===void 0)throw new globalThis.Error(t,{cause:e});return r}function lU(e){return eh(e).then(t=>{if(Ke(t))return t.value;throw fU(t.cause,\"Promise adapter can only reject schema errors\")})}function pU(e){let t=qo(e);if(Ke(t))return t.value;throw fU(t.cause,\"Sync adapter can only throw schema errors\")}function I3(e,t){return fN(e,t)}function T3(e){return lN(e)}var w3=QI,C3=IF;function hx(e,t){let r=et(e,t);return(n,o)=>uU(r(n,o))}var A3=hx;function dU(e,t){let r=TF(e,t);return(n,o)=>KT(r(n,o))}var k3=dU,v3=eT,O3=wF;function mU(e,t){let r=CF(e,t);return(n,o)=>Fd(r(n,o),s=>new As(s))}var _3=mU;function hU(e,t){let r=hx(e,t);return(n,o)=>lU(r(n,o))}var R3=hU;function xU(e,t){let r=hx(e,t);return(n,o)=>pU(r(n,o))}var P3=xU;function xx(e,t){let r=Mi(e,t);return(n,o)=>uU(r(n,o))}var M3=xx;function gU(e,t){let r=kF(e,t);return(n,o)=>KT(r(n,o))}var F3=gU,N3=tT,U3=vF;function yU(e,t){let r=OF(e,t);return(n,o)=>Fd(r(n,o),s=>new As(s))}var D3=yU;function SU(e,t){let r=xx(e,t);return(n,o)=>lU(r(n,o))}var L3=SU;function bU(e,t){let r=xx(e,t);return(n,o)=>pU(r(n,o))}var $3=bU,q=to;function gx(e){return A(e,wp)&&e[wp]===wp}var $i=hr(e=>q(Ri(e.ast),{schema:e})),B3=hr(e=>e.schema),Pu=hr(e=>{let t=bx(e);return q(eF(e.ast),{schema:t})}),j3=hr(e=>e.schema.members[0]),z3=hr(e=>q($I(e.ast),{schema:e})),q3=hr(e=>e.schema),Hr=hr(e=>q(yt(e.ast),{schema:e})),Mu=hr(e=>q(mn(e.ast),{schema:e})),Cp=\"~effect/Schema/flip\";function H3(e){return A(e,Cp)&&e[Cp]===Cp}function zT(e){return H3(e)?e.schema.rebuild(dn(e.ast)):q(dn(e.ast),{[Cp]:Cp,schema:e})}function wt(e){let t=q(new pn(e),{literal:e,transform(r){return t.pipe(G(wt(r),{decode:oe(()=>r),encode:oe(()=>e)}))}});return t}function EU(e){return e.map(t=>gx(t)?t.ast:new pn(t))}function W3(e){return q(new AI(EU(e)),{parts:e})}function J3(e){return q(FM(EU(e)),{parts:e})}function K3(e){return q(new MM(Object.keys(e).filter(t=>typeof e[e[t]]!=\"number\").map(t=>[t,e[t]])),{enums:e})}var G3=q(CI),V3=q(RM),Ap=q(Yn),yx=q(TI),GT=q(wI),J=q(ln),Z3=J,ji=q(kI),VT=q(DM),IU=q(LM),Fu=q($M),Y3=q(_M),Q3=q(PM);function X3(e){return q(new UM(e))}function ZT(e,t){return q(e,{fields:t,mapFields(r,n){let o=r(this.fields);return ZT(Ph(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Me(e){return ZT(Ph(e,void 0),e)}function eV(e){return hr(t=>t.mapFields(wN(e)))}var tV=e=>typeof e==\"symbol\"?e:globalThis.String(e);function rV(e){return function(t){let r={},n=Object.create(null),o=Object.create(null),s=new Set;for(let a of Reflect.ownKeys(t.fields)){let i=Mu(t.fields[a]),c=Object.hasOwn(e,a),u=c?e[a]:a,f=tV(u);if(s.has(f))throw new globalThis.Error(`Duplicate encoded keys: ${wo(u)}`);s.add(f),N(r,u,i),c&&(n[a]=u,o[u]=a)}return Me(r).pipe(G(t,Pe({decode:ST(o),encode:ST(n)})))}}function nV(e,t){return r=>{let n=Ka(r.fields,Hr),o=Me({...n,...e});return r.pipe(G(o,Pe({decode:s=>{let a={...s};for(let i in e){let c=t[i],u=c(s);Oe(u)&&N(a,i,u.value)}return a},encode:s=>{let a={...s};for(let i in e)delete a[i];return a}})))}}function ks(e,t){return q(rF(e.ast,t.ast),{key:e,value:t})}function oV(e,t){return q(HM(e.ast,t.map(rp)),{schema:e,records:t})}function TU(e,t){return q(e,{elements:t,mapElements(r,n){let o=r(this.elements);return TU(RI(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Zo(e){return TU(RI(e),e)}function sV(e,t){return q(WM(e.ast,t.map(rp)),{schema:e,rest:t})}var $e=hr(e=>q(new Rn(!1,[],[e.ast]),{value:e}));function Sx(e,t,r){return t!==void 0&&r!==void 0?e.check(nw(t,r)):t!==void 0?e.check(qU(t)):r!==void 0?e.check(JU(r)):e}var YT=hr(e=>q(new Rn(!1,[e.ast],[e.ast]),{value:e}));function aV(e){let t=$e(e),r=$e(Hr(e)),n=G(Zo([Ap]),Pe({decode:o=>[o],encode:([o])=>o}))(e);return q(st([n,t]).pipe(G(r)).ast,{from:st([e,t]),to:r})}function iV(e){return $e(e).check(sw())}var cV=hr(e=>q(JM(e.ast),{schema:e}));function wU(e,t){return q(e,{members:t,mapMembers(r,n){let o=r(this.members);return wU(Mh(o,this.ast.options,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function st(e,t){return wU(Mh(e,t,void 0),e)}function io(e){let t=e.map(wt);return q(Mh(t,void 0,void 0),{literals:e,members:t,mapMembers(r){return st(r(this.members))},pick(r){return io(r)},transform(r){return st(t.map((n,o)=>n.transform(r[o])))}})}var QT=hr(e=>st([e,yx])),bx=hr(e=>st([e,GT])),CU=hr(e=>st([e,yx,GT]));function AU(e){return q(new MI(()=>e().ast))}function uV(...e){return t=>t.check(...e)}function kU(e,t){return r=>q(Ko(r.ast,[Nh(e,t)]),{schema:r})}function vU(e){return t=>q(t.ast,{schema:t,identifier:e})}function fV(e,t){return r=>(t.checks?r.check(...t.checks):r).pipe(vU(e))}function OU(e){return t=>q(QM(t.ast,new wh(e,R)),{schema:t})}function _U(e){return t=>q(XM(t.ast,new wh(R,e)),{schema:t})}function lV(e){return RU(e)}function RU(e){return t=>OU(Zc(e))(t)}function pV(e){return PU(e)}function PU(e){return t=>_U(Zc(e))(t)}function G(e,t){return r=>q(da(r.ast,e.ast,t?Ch(t):su()),{from:r,to:e})}function Nu(){return(e,t)=>Ae()(e,{decode:t,encode:_P})}var MU=io([\"true\",\"yes\",\"on\",\"1\",\"y\"]),FU=io([\"false\",\"no\",\"off\",\"0\",\"n\"]),XT=io([...MU.literals,...FU.literals]).pipe(G(VT,Pe({decode:e=>e===\"true\"||e===\"yes\"||e===\"on\"||e===\"1\"||e===\"y\",encode:e=>e?\"true\":\"false\"})));function dV(e){return t=>G(Hr(t),e)(t)}function ew(e,t){return r=>t?G(r,t)(e):G(r)(e)}function mV(e){return t=>G(t,e)(Mu(t))}function NU(e){return t=>q(tF(t.ast,e),{schema:t})}function UU(e){return xt(e,t=>Ss(()=>ms(t,r=>r.issue)))}function tw(e,t){let r=t?.encodingStrategy===\"omit\"?sI():jr();return n=>$i(Mu(n)).pipe(G(n,{decode:aI(UU(e)),encode:r}))}function hV(e,t){return r=>Hr(r).pipe(tw(e,t),ew($i(r)))}function DU(e,t){let r=t?.encodingStrategy===\"omit\"?sI():jr();return n=>Pu(Mu(n)).pipe(G(n,{decode:aI(UU(e)),encode:r}))}function xV(e,t){return r=>Hr(r).pipe(DU(e,t),ew(Pu(r)))}function Bi(e){return wt(e).pipe(NU(g(e)))}function gV(e){return Bi(e).pipe(tw(g(e),{encodingStrategy:\"omit\"}))}function Ex(e,t){return Me({_tag:Bi(e),...t})}function LU(e){return t=>{let r={},n=[],o=new Set,s={},a=f=>p=>f.includes(p[e]);return i(t),Object.assign(t,{cases:r,discriminants:n,isAnyOf:a,guards:s,match:c,matchOrElse:u});function i(f){let p=f.ast;if(kM(p)&&\"members\"in f&&globalThis.Array.isArray(f.members)&&f.members.every(gx))return f.members.forEach(i);let d=uu(p);if(d.length>0){let m=d.find(x=>x.key===e)?.literal;if(od(m)){let x=typeof m==\"number\"?globalThis.String(m):m;if(o.has(x))throw new globalThis.Error(`Duplicate discriminant: ${globalThis.String(m)}`);o.add(x),n.push(m),N(r,m,f),N(s,m,QI(Hr(f)));return}}throw new globalThis.Error(\"No literal or unique symbol found\")}function c(){if(arguments.length===1){let x=arguments[0];return function(y){let S=y[e];return(Object.hasOwn(x,S)?x[S]:void 0)(y)}}let f=arguments[0],p=arguments[1],d=f[e];return(Object.hasOwn(p,d)?p[d]:void 0)(f)}function u(){if(arguments.length===2){let y=arguments[0],S=arguments[1];return function(w){let E=w[e];return(Object.hasOwn(y,E)?y[E]??S:S)(w)}}let f=arguments[0],p=arguments[1],d=arguments[2],m=f[e];return(Object.hasOwn(p,m)?p[m]??d:d)(f)}}}function yV(e){let t={},r=[];for(let c of Object.keys(e)){let u=Ex(c,e[c]);N(t,c,u),r.push(u)}let n=st(r),{guards:o,isAnyOf:s,match:a,matchOrElse:i}=LU(\"_tag\")(n);return q(n.ast,{cases:t,isAnyOf:s,guards:o,match:a,matchOrElse:i})}function SV(){return e=>e}function xa(e,t){return Be(r=>r instanceof e,t)}function Ae(){return(e,t)=>new ot(e.ast,Ch(t))}var Ne=Fh;function bV(e,t=void 0){return new ki(e,t)}var VN=\"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$\";function $U(e){let t=new globalThis.RegExp(VN);return Ne(r=>r.trim()===r,{expected:\"a string with no leading or trailing whitespace\",representation:{id:\"effect/schema/isTrimmed\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isTrimmed()\"}),arbitraryConstraint:{patterns:[{source:VN,flags:\"\"}]},...e})}function Uu(e,t){let r=e.source,n=e.flags,o=/^[dg]*uy?$/.test(n),s=n===\"\"?`new RegExp(${F(r)})`:`new RegExp(${F(r)}, ${F(n)})`;return op(e,{toJsonSchema:()=>o?{pattern:n.endsWith(\"y\")?`^(?:${r})`:r}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${s})`}),...t})}function EV(e){return zI({toCode:()=>({runtime:\"Schema.isStringFinite()\"}),...e})}function IV(e){return qI({toCode:()=>({runtime:\"Schema.isStringBigInt()\"}),...e})}function TV(e){return WI({toCode:()=>({runtime:\"Schema.isStringSymbol()\"}),...e})}var wV=e=>e?new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/;function CV(e,t){let r=wV(e);return Uu(r,{expected:e?`a UUID v${e}`:\"a UUID\",representation:{id:\"effect/schema/isUUID\",payload:{version:e??null}},toJsonSchema:()=>({pattern:r.source,format:\"uuid\"}),toCode:()=>({runtime:e===void 0?\"Schema.isUUID()\":`Schema.isUUID(${e})`}),...t})}var ZN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;function AV(e){return Uu(ZN,{expected:\"a GUID\",representation:{id:\"effect/schema/isGUID\",payload:null},toJsonSchema:()=>({pattern:ZN.source}),toCode:()=>({runtime:\"Schema.isGUID()\"}),...e})}function kV(e){let t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return Uu(t,{representation:{id:\"effect/schema/isULID\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isULID()\"}),...e})}function BU(e){let t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return Uu(t,{expected:\"a base64 encoded string\",representation:{id:\"effect/schema/isBase64\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isBase64()\"}),...e})}function vV(e){let t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return Uu(t,{expected:\"a base64url encoded string\",representation:{id:\"effect/schema/isBase64Url\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isBase64Url()\"}),...e})}function rw(e,t,r){if(e.length===0)return t.length===0?{}:[{},!0];let n={pattern:new globalThis.RegExp(r).source};return e===t?n:[n,!0]}function OV(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(`^${ws(e)}`),o=e.replace(/[\\uD800-\\uDBFF]$/,\"\");return Ne(s=>s.startsWith(e),{expected:`a string starting with ${r}`,representation:{id:\"effect/schema/isStartingWith\",payload:{startsWith:e}},toJsonSchema:()=>rw(o,e,`^${ws(o)}`),toCode:()=>({runtime:`Schema.isStartingWith(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}function _V(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(`${ws(e)}$`),o=e.replace(/^[\\uDC00-\\uDFFF]/,\"\");return Ne(s=>s.endsWith(e),{expected:`a string ending with ${r}`,representation:{id:\"effect/schema/isEndingWith\",payload:{endsWith:e}},toJsonSchema:()=>rw(o,e,`${ws(o)}$`),toCode:()=>({runtime:`Schema.isEndingWith(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}function RV(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(ws(e)),o=e.replace(/^[\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF]$/g,\"\");return Ne(s=>s.includes(e),{expected:`a string including ${r}`,representation:{id:\"effect/schema/isIncluding\",payload:{includes:e}},toJsonSchema:()=>rw(o,e,ws(o)),toCode:()=>({runtime:`Schema.isIncluding(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}var YN=\"^[^a-z]*$\";function PV(e){let t=new globalThis.RegExp(YN);return Ne(r=>r.toUpperCase()===r,{expected:\"a string with all characters in uppercase\",representation:{id:\"effect/schema/isUppercased\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isUppercased()\"}),arbitraryConstraint:{patterns:[{source:YN,flags:\"\"}]},...e})}var QN=\"^[^A-Z]*$\";function MV(e){let t=new globalThis.RegExp(QN);return Ne(r=>r.toLowerCase()===r,{expected:\"a string with all characters in lowercase\",representation:{id:\"effect/schema/isLowercased\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isLowercased()\"}),arbitraryConstraint:{patterns:[{source:QN,flags:\"\"}]},...e})}var XN=\"^(?:[^a-z][\\\\s\\\\S]*)?$\";function FV(e){let t=new globalThis.RegExp(XN);return Ne(r=>r.charAt(0).toUpperCase()===r.charAt(0),{expected:\"a string with the first character in uppercase\",representation:{id:\"effect/schema/isCapitalized\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isCapitalized()\"}),arbitraryConstraint:{patterns:[{source:XN,flags:\"\"}]},...e})}var eU=\"^(?:[^A-Z][\\\\s\\\\S]*)?$\";function NV(e){let t=new globalThis.RegExp(eU);return Ne(r=>r.charAt(0).toLowerCase()===r.charAt(0),{expected:\"a string with the first character in lowercase\",representation:{id:\"effect/schema/isUncapitalized\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isUncapitalized()\"}),arbitraryConstraint:{patterns:[{source:eU,flags:\"\"}]},...e})}var Du=q(NI),UV=FI;function kp(e){let t=gc(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value greater than ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n,exclusiveMinimum:!0},...e.annotate?.(n),...o})}function vp(e){let t=kd(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value greater than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n},...e.annotate?.(n),...o})}function Op(e){let t=Cd(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value less than ${r(n)}`,arbitraryConstraint:{order:e.order,maximum:n,exclusiveMaximum:!0},...e.annotate?.(n),...o})}function _p(e){let t=Ad(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value less than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,maximum:n},...e.annotate?.(n),...o})}function Rp(e){let t=kd(e.order),r=gc(e.order),n=Ad(e.order),o=Cd(e.order),s=e.formatter??F;return(a,i)=>{let c=a.exclusiveMinimum?r:t,u=a.exclusiveMaximum?o:n;return Ne(f=>c(f,a.minimum)&&u(f,a.maximum),{expected:`a value between ${s(a.minimum)}${a.exclusiveMinimum?\" (excluded)\":\"\"} and ${s(a.maximum)}${a.exclusiveMaximum?\" (excluded)\":\"\"}`,arbitraryConstraint:{order:e.order,minimum:a.minimum,maximum:a.maximum,...a.exclusiveMinimum&&{exclusiveMinimum:!0},...a.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(a),...i})}}function DV(e){return(t,r)=>{let n=e.formatter??F;return Ne(o=>e.remainder(o,t)===e.zero,{expected:`a value that is a multiple of ${n(t)}`,...e.annotate?.(t),...r})}}function Ou(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${F(e)}`);return e}var LV=kp({order:is,annotate:e=>({representation:{id:\"effect/schema/isGreaterThan\",payload:{exclusiveMinimum:Ou(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${F(e)})`})})}),jU=vp({order:is,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualTo\",payload:{minimum:Ou(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${F(e)})`})})}),$V=Op({order:is,annotate:e=>({representation:{id:\"effect/schema/isLessThan\",payload:{exclusiveMaximum:Ou(e)}},toJsonSchema:()=>({exclusiveMaximum:e}),toCode:()=>({runtime:`Schema.isLessThan(${F(e)})`})})}),BV=_p({order:is,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualTo\",payload:{maximum:Ou(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${F(e)})`})})}),Lu=Rp({order:is,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetween\",payload:{minimum:Ou(e.minimum),maximum:Ou(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>({[t?\"exclusiveMinimum\":\"minimum\"]:e.minimum,[r?\"exclusiveMaximum\":\"maximum\"]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${F(e.minimum)}, maximum: ${F(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}});function jV(e,t){if(!globalThis.Number.isFinite(e)||e===0)throw new globalThis.RangeError(`Expected a finite non-zero number, got ${globalThis.String(e)}`);return e=globalThis.Math.abs(e),Ne(r=>S_(r,e)===0,{expected:`a value that is a multiple of ${e}`,representation:{id:\"effect/schema/isMultipleOf\",payload:{divisor:e}},toJsonSchema:()=>({multipleOf:e}),toCode:()=>({runtime:`Schema.isMultipleOf(${F(e)})`}),...t})}function Ix(e){return Ne(t=>globalThis.Number.isSafeInteger(t),{expected:\"an integer\",representation:{id:\"effect/schema/isInt\",payload:null},toJsonSchema:()=>[{type:\"integer\"},!0],toCode:()=>({runtime:\"Schema.isInt()\"}),arbitraryConstraint:{number:\"integer\"},...e})}var co=ji.check(Ix()),Li=co.check(jU(0));function zV(e){return new ki([Ix(),Lu({minimum:-2147483648,maximum:2147483647})],{expected:\"a 32-bit integer\",...e})}function qV(e){return new ki([Ix(),Lu({minimum:0,maximum:4294967295})],{expected:\"a 32-bit unsigned integer\",...e})}function _u(e){if(globalThis.Number.isNaN(e.getTime()))throw new globalThis.RangeError(`Expected a valid Date, got ${F(e)}`);return e.toISOString()}function Ru(e){return`new Date(${F(e.getTime())})`}var HV=kp({order:xc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanDate\",payload:{exclusiveMinimum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanDate(${Ru(e)})`})})}),WV=vp({order:xc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualToDate\",payload:{minimum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToDate(${Ru(e)})`})})}),JV=Op({order:xc,annotate:e=>({representation:{id:\"effect/schema/isLessThanDate\",payload:{exclusiveMaximum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanDate(${Ru(e)})`})})}),KV=_p({order:xc,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualToDate\",payload:{maximum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanOrEqualToDate(${Ru(e)})`})})}),GV=Rp({order:xc,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetweenDate\",payload:{minimum:_u(e.minimum),maximum:_u(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenDate({ minimum: ${Ru(e.minimum)}, maximum: ${Ru(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}}),VV=kp({order:hc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanBigInt\",payload:{exclusiveMinimum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanBigInt(${F(e)})`})})}),zU=vp({order:hc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualToBigInt\",payload:{minimum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToBigInt(${F(e)})`})})}),ZV=Op({order:hc,annotate:e=>({representation:{id:\"effect/schema/isLessThanBigInt\",payload:{exclusiveMaximum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanBigInt(${F(e)})`})})}),YV=_p({order:hc,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualToBigInt\",payload:{maximum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanOrEqualToBigInt(${F(e)})`})})}),QV=Rp({order:hc,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetweenBigInt\",payload:{minimum:e.minimum.toString(10),maximum:e.maximum.toString(10),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenBigInt({ minimum: ${F(e.minimum)}, maximum: ${F(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}});function qU(e,t){return e=gr(e),HU(e,Math.ceil(e/2),t)}function HU(e,t,r){return Ne(n=>n.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:\"effect/schema/isMinLength\",payload:{minLength:e}},toJsonSchema:({type:n})=>n===\"string\"?e<=1?{minLength:t}:[{minLength:t},!0]:n===\"array\"?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Lr]:!0,arbitraryConstraint:{minLength:e},...r})}function WU(e){return HU(1,1,e)}function JU(e,t){return e=gr(e),Ne(r=>r.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:\"effect/schema/isMaxLength\",payload:{maxLength:e}},toJsonSchema:({type:r})=>r===\"string\"?e===0?{maxLength:e}:[{maxLength:e},!0]:r===\"array\"?{maxItems:e}:r===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[Lr]:!0,arbitraryConstraint:{maxLength:e},...t})}function nw(e,t,r){return e=gr(e),t=gr(t),Ne(n=>n.length>=e&&n.length<=t,{expected:e===t?`a value with a length of ${e}`:`a value with a length between ${e} and ${t}`,representation:{id:\"effect/schema/isBetweenLength\",payload:{minimum:e,maximum:t}},toJsonSchema:({type:n})=>n===\"string\"?t===0||Math.ceil(e/2)>t?{minLength:Math.ceil(e/2),maxLength:t}:[{minLength:Math.ceil(e/2),maxLength:t},!0]:n===\"array\"?{minItems:e,maxItems:t}:n===void 0?[{minLength:Math.ceil(e/2),maxLength:t,minItems:e,maxItems:t},!0]:[{},!0],toCode:()=>({runtime:`Schema.isBetweenLength(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minLength:e,maxLength:t},...r})}function XV(e,t){return e=gr(e),Ne(r=>ow(r,e)>=e,{expected:`a string with at least ${e} code points`,representation:{id:\"effect/schema/isMinCodePoints\",payload:{minCodePoints:e}},toJsonSchema:()=>({minLength:e}),toCode:()=>({runtime:`Schema.isMinCodePoints(${e})`}),arbitraryConstraint:{minCodePoints:e},...t})}function eZ(e,t){return e=gr(e),Ne(r=>ow(r,e+1)<=e,{expected:`a string with at most ${e} code points`,representation:{id:\"effect/schema/isMaxCodePoints\",payload:{maxCodePoints:e}},toJsonSchema:()=>({maxLength:e}),toCode:()=>({runtime:`Schema.isMaxCodePoints(${e})`}),arbitraryConstraint:{maxCodePoints:e},...t})}function tZ(e,t,r){return e=gr(e),t=gr(t),Ne(n=>{let o=ow(n,t+1);return o>=e&&o<=t},{expected:e===t?`a string with ${e} code points`:`a string with between ${e} and ${t} code points`,representation:{id:\"effect/schema/isBetweenCodePoints\",payload:{minimum:e,maximum:t}},toJsonSchema:()=>({allOf:[{minLength:e},{maxLength:t}]}),toCode:()=>({runtime:`Schema.isBetweenCodePoints(${e}, ${t})`}),arbitraryConstraint:{minCodePoints:e,maxCodePoints:t},...r})}function ow(e,t){if(t===0)return 0;let r=0;for(let n of e)if(++r>=t)break;return r}function gr(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}function rZ(e,t){return e=gr(e),Ne(r=>r.size>=e,{expected:`a value with a size of at least ${e}`,representation:{id:\"effect/schema/isMinSize\",payload:{minSize:e}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isMinSize(${e})`}),[Lr]:!0,arbitraryConstraint:{minSize:e},...t})}function nZ(e,t){return e=gr(e),Ne(r=>r.size<=e,{expected:`a value with a size of at most ${e}`,representation:{id:\"effect/schema/isMaxSize\",payload:{maxSize:e}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isMaxSize(${e})`}),[Lr]:!0,arbitraryConstraint:{maxSize:e},...t})}function oZ(e,t,r){return e=gr(e),t=gr(t),Ne(n=>n.size>=e&&n.size<=t,{expected:e===t?`a value with a size of ${e}`:`a value with a size between ${e} and ${t}`,representation:{id:\"effect/schema/isBetweenSize\",payload:{minimum:e,maximum:t}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenSize(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minSize:e,maxSize:t},...r})}function sZ(e,t){return e=gr(e),Ne(r=>Reflect.ownKeys(r).length>=e,{expected:`a value with at least ${e===1?\"1 entry\":`${e} entries`}`,representation:{id:\"effect/schema/isMinProperties\",payload:{minProperties:e}},toJsonSchema:({type:r})=>r===\"object\"?{minProperties:e}:[{minProperties:e},!0],toCode:()=>({runtime:`Schema.isMinProperties(${e})`}),[Lr]:!0,arbitraryConstraint:{minProperties:e},...t})}function aZ(e,t){return e=gr(e),Ne(r=>Reflect.ownKeys(r).length<=e,{expected:`a value with at most ${e===1?\"1 entry\":`${e} entries`}`,representation:{id:\"effect/schema/isMaxProperties\",payload:{maxProperties:e}},toJsonSchema:({type:r})=>r===\"object\"?{maxProperties:e}:[{maxProperties:e},!0],toCode:()=>({runtime:`Schema.isMaxProperties(${e})`}),[Lr]:!0,arbitraryConstraint:{maxProperties:e},...t})}function iZ(e,t,r){return e=gr(e),t=gr(t),Ne(n=>Reflect.ownKeys(n).length>=e&&Reflect.ownKeys(n).length<=t,{expected:e===t?`a value with exactly ${e===1?\"1 entry\":`${e} entries`}`:`a value with between ${e} and ${t} entries`,representation:{id:\"effect/schema/isBetweenProperties\",payload:{minimum:e,maximum:t}},toJsonSchema:({type:n})=>n===\"object\"?{minProperties:e,maxProperties:t}:[{minProperties:e,maxProperties:t},!0],toCode:()=>({runtime:`Schema.isBetweenProperties(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minProperties:e,maxProperties:t},...r})}function cZ(e,t){let r=Mu(e),n=EF(r.ast);return Ne((o,s,a)=>{let i=Reflect.ownKeys(o),c=[];for(let u of i){let f=n(u,a);if(f!==void 0&&(c.push(new ct([u],f)),a.errors===\"first\"))break}return rr(c)?new Tt(s,c,o,a):!0},{expected:\"an object with property names matching the schema\",representation:{id:\"effect/schema/isPropertyNames\",payload:null,schemas:[r.ast]},toJsonSchema:({schemas:o,type:s})=>s===\"object\"?{propertyNames:o[0]}:[{propertyNames:o[0]},!0],toCode:({schemas:o})=>({runtime:`Schema.isPropertyNames(${o[0].runtime})`}),[Lr]:!0,...t})}function sw(e){return Ne(t=>$d(t).length===t.length,{expected:\"an array with unique items\",representation:{id:\"effect/schema/isUnique\",payload:null},toJsonSchema:()=>({uniqueItems:!0}),toCode:()=>({runtime:\"Schema.isUnique()\"}),arbitraryConstraint:{uniqueBy:R},...e})}function KU(e){return Ne(t=>$d(t.map(([r])=>r)).length===t.length,{expected:\"an array with unique keys\",representation:{id:\"effect/schema/isUniqueKey\",payload:null},toCode:()=>({runtime:\"Schema.isUniqueKey()\"}),arbitraryConstraint:{uniqueBy:t=>t[0]},...e})}var aw=J.check(WU()),uZ=J.check(nw(1,1)),GU=e=>(e?.includeStack===!0?1:0)|(e?.excludeCause===!0?2:0),VU=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},tU=[];function fZ(e){let t=GU(e),r=tU[t];if(r!==void 0)return r;let n=VU(t),o=xa(globalThis.Error,{representation:{id:\"effect/schema/Error\",payload:n??null},toCode:()=>({runtime:n!==void 0?`Schema.ErrorInstance(${F(n)})`:\"Schema.ErrorInstance()\",Type:\"globalThis.Error\"}),expected:\"Error\",toCodecJson:()=>Ae()(M8,aM(n))});return tU[t]=o,o}var rU=[];function lZ(e){let t=GU(e),r=rU[t];if(r!==void 0)return r;let n=Ox.pipe(G(Ap,iM(VU(t))));return rU[t]=n,n}function pZ(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(Zo([n,o]));return(a,i,c)=>a instanceof globalThis.Map?Kt(et(s)([...a],c),{onSuccess:u=>new globalThis.Map(u),onFailure:u=>Br(i,\"entries\",u,a,c)}):P(new ut(i,a,c))},{representation:{id:\"effect/schema/ReadonlyMap\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.ReadonlyMap(${n[0].runtime}, ${n[1].runtime})`,Type:`globalThis.ReadonlyMap<${n[0].Type}, ${n[1].Type}>`}),expected:\"ReadonlyMap\",toCodec:([n,o])=>Ae()($e(Zo([n,o])),Pe({decode:s=>new globalThis.Map(s),encode:s=>[...s.entries()]}))});return q(r.ast,{key:e,value:t})}function dZ(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>o instanceof globalThis.Set?Kt(et(n)([...o],a),{onSuccess:i=>new globalThis.Set(i),onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ut(s,o,a))},{representation:{id:\"effect/schema/ReadonlySet\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.ReadonlySet(${r[0].runtime})`,Type:`globalThis.ReadonlySet<${r[0].Type}>`}),expected:\"ReadonlySet\",toCodec:([r])=>Ae()($e(r),Pe({decode:n=>new globalThis.Set(n),encode:n=>[...n.values()]}))});return q(t.ast,{value:e})}var mZ=xa(globalThis.RegExp,{representation:{id:\"effect/schema/RegExp\",payload:null},toCode:()=>({runtime:\"Schema.RegExp\",Type:\"globalThis.RegExp\"}),expected:\"RegExp\",toCodecJson:()=>Ae()(Me({source:J,flags:J}),Vt({decode:(e,t)=>Jc({try:()=>new globalThis.RegExp(e.source,e.flags),catch:()=>new de({expected:\"valid RegExp source and flags\"},e,t)}),encode:e=>g({source:e.source,flags:e.flags})}))}),ZU=J.annotate({expected:\"a string that will be decoded as a URL\"}),Tx=xa(globalThis.URL,{representation:{id:\"effect/schema/URL\",payload:null},toCode:()=>({runtime:\"Schema.URL\",Type:\"globalThis.URL\"}),expected:\"URL\",toCodecJson:()=>Ae()(ZU,lI)}),hZ=ZU.pipe(G(Tx,lI)),YU=J.annotate({expected:\"a string that will be decoded as a Date\"}),$u=Be(e=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:\"effect/schema/Date\",payload:null},toCode:()=>({runtime:\"Schema.Date\",Type:\"globalThis.Date\"}),expected:\"a valid Date\",toCodecJson:()=>Ae()(YU,uI)}),xZ=YU.pipe(G($u,uI)),gZ=co.pipe(G($u,eM)),yZ=J.annotate({expected:\"a string that will be decoded as JSON\",contentMediaType:\"application/json\"});function iw(e,t){return yZ.pipe(G(e,gM(t)))}var SZ=iw(Ap),QU=xa(globalThis.File,{representation:{id:\"effect/schema/File\",payload:null},toCode:()=>({runtime:\"Schema.File\",Type:\"globalThis.File\"}),expected:\"File\",toCodecJson:()=>Ae()(Me({data:J.check(BU()),type:J,name:J,lastModified:co}),Vt({decode:(e,t)=>Ar(gi(e.data),{onFailure:()=>P(new de({expected:\"a valid Base64 string\"},e.data,t)),onSuccess:r=>{let n=new globalThis.Uint8Array(r);return g(new globalThis.File([n],e.name,{type:e.type,lastModified:e.lastModified}))}}),encode:(e,t)=>Hc({try:async()=>{let r=new globalThis.Uint8Array(await e.arrayBuffer());return{data:Xc(r),type:e.type,name:e.name,lastModified:e.lastModified}},catch:()=>new de({expected:\"a readable File\"},e,t)})}))}),XU=xa(globalThis.FormData,{representation:{id:\"effect/schema/FormData\",payload:null},toCode:()=>({runtime:\"Schema.FormData\",Type:\"globalThis.FormData\"}),expected:\"FormData\",toCodecJson:()=>Ae()($e(Zo([J,st([Me({_tag:Bi(\"String\"),value:J}),Me({_tag:Bi(\"File\"),value:QU})])])),Vt({decode:e=>{let t=new globalThis.FormData;for(let[r,n]of e)t.append(r,n.value);return g(t)},encode:e=>g(globalThis.Array.from(e.entries()).map(([t,r])=>typeof r==\"string\"?[t,{_tag:\"String\",value:r}]:[t,{_tag:\"File\",value:r}]))}))});function bZ(e){return XU.pipe(G(e,yM))}var eD=xa(globalThis.URLSearchParams,{representation:{id:\"effect/schema/URLSearchParams\",payload:null},toCode:()=>({runtime:\"Schema.URLSearchParams\",Type:\"globalThis.URLSearchParams\"}),expected:\"URLSearchParams\",toCodecJson:()=>Ae()(J.annotate({expected:\"a query string that will be decoded as URLSearchParams\"}),Pe({decode:e=>new globalThis.URLSearchParams(e),encode:e=>e.toString()}))});function EZ(e){return eD.pipe(G(e,SM))}var IZ=J.annotate({expected:\"a string that will be decoded as a number\"}).pipe(G(ji,au)),TZ=J.annotate({expected:\"a string that will be decoded as a finite number\"}).pipe(G(Du,au)),wZ=q(HI).pipe(G(Fu,kh)),tD=J.check($U()),CZ=J.annotate({expected:\"a string that will be decoded as a trimmed string\"}).pipe(G(tD,QP())),AZ=J.annotate({expected:\"a base64 encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,dM)),kZ=J.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,mM)),vZ=J.annotate({expected:\"a hex encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,hM)),OZ=J.annotate({expected:\"a URI component encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,xM)),qT=st([Du,IU,J]),_Z=Me({issues:$e(Me({message:J,path:Pu($e(st([qT,Me({key:qT})])))}))}),RZ=io([0,1]).pipe(G(VT,Pe({decode:e=>e===1,encode:e=>e?1:0}))),rD=J.annotate({expected:\"a base64 encoded string that will be decoded as Uint8Array\",format:\"byte\",contentEncoding:\"base64\"}),wx=xa(globalThis.Uint8Array,{representation:{id:\"effect/schema/Uint8Array\",payload:null},toCode:()=>({runtime:\"Schema.Uint8Array\",Type:\"globalThis.Uint8Array\"}),expected:\"Uint8Array\",toCodecJson:()=>Ae()(rD,pI)}),PZ=rD.pipe(G(wx,pI)),MZ=J.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a Uint8Array\"}).pipe(G(wx,{decode:BP(),encode:Ih()})),FZ=J.annotate({expected:\"a hex encoded string that will be decoded as a Uint8Array\"}).pipe(G(wx,{decode:zP(),encode:Th()})),nD=Vt({decode:(e,t)=>{let r=rR(e);return ue(r)?P(new de({expected:\"a valid BigDecimal string\"},e,t)):g(r.value)},encode:e=>g(Es(e))}),NZ=kp({order:Yc,formatter:e=>Es(e)}),UZ=vp({order:Yc,formatter:e=>Es(e)}),DZ=Op({order:Yc,formatter:e=>Es(e)}),LZ=_p({order:Yc,formatter:e=>Es(e)}),$Z=Rp({order:Yc,formatter:e=>Es(e)}),oD=J.annotate({expected:\"a string that will be decoded as a BigDecimal\"}),sD=Be(nE,{representation:{id:\"effect/schema/BigDecimal\",payload:null},toCode:()=>({runtime:\"Schema.BigDecimal\",Type:\"BigDecimal.BigDecimal\",importDeclarations:['import * as BigDecimal from \"effect/BigDecimal\"']}),expected:\"BigDecimal\",toCodecJson:()=>Ae()(oD,nD),toFormatter:()=>e=>Es(e)}),BZ=oD.pipe(G(sD,nD)),Bu=Be(pR,{representation:{id:\"effect/schema/ByteSize\",payload:null},toCode:()=>({runtime:\"Schema.ByteSize\",Type:\"ByteSize.ByteSize\",importDeclarations:['import * as ByteSize from \"effect/ByteSize\"']}),expected:\"ByteSize\",toCodecJson:()=>Ae()(Fu.check(zU(globalThis.BigInt(0))),Pe({decode:lR,encode:nh})),toCodecStringTree:()=>Ae()(aD,fI)}),aD=J.annotate({expected:\"a string that will be decoded as a ByteSize\"}),jZ=aD.pipe(G(Bu,fI)),zZ=Fu.pipe(G(Bu,tM)),qZ=ji.pipe(G(Bu,rM));function HT(e,t){let r=qr()([e,t],([n,o])=>(s,a,i)=>{if(!ZS(s))return P(new ut(a,s,i));switch(s._tag){case\"Fail\":return Kt(et(n)(s.error,i),{onSuccess:km,onFailure:c=>Br(a,\"error\",c,s,i)});case\"Die\":return Kt(et(o)(s.defect,i),{onSuccess:vm,onFailure:c=>Br(a,\"defect\",c,s,i)});case\"Interrupt\":return g(s)}},{representation:{id:\"effect/schema/CauseReason\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.CauseReason(${n[0].runtime}, ${n[1].runtime})`,Type:`Cause.Failure<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause.Failure\",toCodec:([n,o])=>Ae()(st([Me({_tag:wt(\"Fail\"),error:n}),Me({_tag:wt(\"Die\"),defect:o}),Me({_tag:wt(\"Interrupt\"),fiberId:bx(Du)})]),Pe({decode:s=>{switch(s._tag){case\"Fail\":return km(s.error);case\"Die\":return vm(s.defect);case\"Interrupt\":return YS(s.fiberId)}},encode:s=>{switch(s._tag){case\"Fail\":return{_tag:\"Fail\",error:s.error};case\"Die\":return{_tag:\"Die\",defect:s.defect};case\"Interrupt\":return{_tag:\"Interrupt\",fiberId:s.fiberId}}}}))});return q(r.ast,{error:e,defect:t})}function WT(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(HT(n,o));return(a,i,c)=>VS(a)?Kt(et(s)(a.reasons,c),{onSuccess:Uc,onFailure:u=>Br(i,\"failures\",u,a,c)}):P(new ut(i,a,c))},{representation:{id:\"effect/schema/Cause\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Cause(${n[0].runtime}, ${n[1].runtime})`,Type:`Cause.Cause<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause\",toCodec:([n,o])=>Ae()($e(HT(n,o)),Pe({decode:Uc,encode:({reasons:s})=>s}))});return q(r.ast,{error:e,defect:t})}function nU(e){return Ae()(e,Pe({decode:lE,encode:Ve}))}function HZ(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>sh(o)?Kt(et(n)(Ve(o),a),{onSuccess:lE,onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ut(s,o,a))},{representation:{id:\"effect/schema/Chunk\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Chunk(${r[0].runtime})`,Type:`Chunk.Chunk<${r[0].Type}>`}),expected:\"Chunk\",toCodec:([r])=>nU($e(r)),toCodecArbitrary:({constraint:r,typeParameters:[n]})=>nU(Sx($e(n),r?.minLength,r?.maxLength)),toEquivalence:([r])=>uE(r)});return q(t.ast,{value:e})}function iD(){return gt((e,t)=>Ht(mE(e),{onNone:()=>P(new de({message:\"Invalid DateTime input\"},e,t)),onSome:r=>g(hE(r))}))}var WZ=Pe({decode:e=>gE(e),encode:e=>e.offset}),cD=Vt({decode:(e,t)=>Ht(kR(e),{onNone:()=>P(new de({expected:\"a valid IANA time zone\"},e,t)),onSome:g}),encode:e=>g(e.id)}),uD=Vt({decode:(e,t)=>Ht(vR(e),{onNone:()=>P(new de({expected:\"a valid time zone\"},e,t)),onSome:g}),encode:e=>g(Nl(e))}),fD=Vt({decode:(e,t)=>Ht(mE(e),{onNone:()=>P(new de({expected:\"a valid UTC DateTime string\"},e,t)),onSome:r=>g(hE(r))}),encode:e=>g(RR(e))}),lD=Vt({decode:(e,t)=>Ht(AR(e),{onNone:()=>P(new de({expected:\"a valid Zoned DateTime string\"},e,t)),onSome:g}),encode:e=>g(yE(e))}),pD=-864e13,dD=864e13,JZ=pD+840*60*1e3,KZ=dD-840*60*1e3,GZ=-720*60*1e3,VZ=840*60*1e3,mD=[\"UTC\",\"Europe/London\",\"America/New_York\",\"Asia/Tokyo\",\"Australia/Sydney\"];function hD(e,t,r){let n=Math.max(t,e?.minimum===void 0?t:e.minimum.epochMilliseconds+(e.exclusiveMinimum===!0?1:0)),o=Math.min(r,e?.maximum===void 0?r:e.maximum.epochMilliseconds-(e.exclusiveMaximum===!0?1:0));return n<=o?[n,o]:[t,r]}function cw(e,t){return co.check(Lu({minimum:e,maximum:t}))}function xD(){return st([cw(GZ,VZ),io(mD)])}var Cx=Be(e=>dE(e)&&ER(e),{representation:{id:\"effect/schema/DateTimeUtc\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeUtc\",Type:\"DateTime.Utc\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Utc\",toCodecArbitrary:({constraint:e})=>{let[t,r]=hD(e,pD,dD);return Nu()(cw(t,r),oe(wR))},toCodecJson:()=>Ae()(J,fD),toFormatter:()=>e=>e.toString()}),ZZ=$u.pipe(G(Cx,{decode:iD(),encode:oe(OR)})),YZ=J.annotate({expected:\"a string that will be decoded as a DateTime.Utc\"}).pipe(G(Cx,fD)),QZ=co.pipe(G(Cx,{decode:iD(),encode:oe(_R)})),XZ=Be(SR,{representation:{id:\"effect/schema/TimeZoneOffset\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneOffset\",Type:\"DateTime.TimeZone.Offset\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Offset\",toCodecJson:()=>Ae()(co,WZ),toFormatter:()=>e=>Nl(e)}),gD=J.annotate({expected:\"an IANA time zone identifier\"}),yD=Be(bR,{representation:{id:\"effect/schema/TimeZoneNamed\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneNamed\",Type:\"DateTime.TimeZone.Named\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Named\",toCodecArbitrary:()=>Nu()(io(mD),oe(xE)),toCodecJson:()=>Ae()(gD,cD),toFormatter:()=>e=>Nl(e)}),e5=gD.pipe(G(yD,cD)),SD=J.annotate({expected:\"a time zone string (IANA identifier or offset like +03:00)\"}),bD=Be(yR,{representation:{id:\"effect/schema/TimeZone\",payload:null},toCode:()=>({runtime:\"Schema.TimeZone\",Type:\"DateTime.TimeZone\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone\",toCodecArbitrary:()=>Nu()(xD(),oe(e=>typeof e==\"number\"?gE(e):xE(e))),toCodecJson:()=>Ae()(SD,uD),toFormatter:()=>e=>Nl(e)}),t5=SD.pipe(G(bD,uD)),ED=J.annotate({expected:\"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])\"}),ID=Be(e=>dE(e)&&IR(e),{representation:{id:\"effect/schema/DateTimeZoned\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeZoned\",Type:\"DateTime.Zoned\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Zoned\",toCodecArbitrary:({constraint:e})=>{let[t,r]=hD(e,JZ,KZ);return Nu()(Me({epochMilliseconds:cw(t,r),timeZone:xD()}),oe(({epochMilliseconds:n,timeZone:o})=>CR(n,{timeZone:o})))},toCodecJson:()=>Ae()(ED,lD),toFormatter:()=>e=>yE(e),toEquivalence:()=>TR}),r5=ED.pipe(G(ID,lD)),uo=(e,t,r,n)=>J.pipe(G(e,Vt({decode:(o,s)=>{let a=t(o);return at(a)?g(a.success):P(new de({message:a.failure.message},o,s))},encode:o=>g(r(o))}))).annotate({identifier:n}),zi=Be(Au,{identifier:\"MacAddress\"}),ju=uo(zi,UN,vT,\"MacAddressFromString\"),Ax=Be(xr,{identifier:\"Ipv4Address\"}),uw=uo(Ax,ku,ao,\"Ipv4AddressFromString\"),fw=Be(Vo,{identifier:\"Ipv6Address\"}),TD=uo(fw,gp,ao,\"Ipv6AddressFromString\"),qi=Be(FN,{identifier:\"IpAddress\"}),zu=uo(qi,yp,ao,\"IpAddressFromString\"),Ze=(e,t,r,n)=>kU(t,{expected:r})(e).annotate({identifier:n}),n5=Ze(qi,vu,\"a multicast address\",\"IpMulticastAddress\"),o5=Ze(zu,vu,\"a multicast address\",\"IpMulticastAddressFromString\"),s5=Ze(zi,vu,\"a multicast address\",\"MacMulticastAddress\"),a5=Ze(ju,vu,\"a multicast address\",\"MacMulticastAddressFromString\"),i5=Ze(qi,PT,\"a unicast address\",\"IpUnicastAddress\"),c5=Ze(zu,PT,\"a unicast address\",\"IpUnicastAddressFromString\"),u5=Ze(zi,cx,\"a unicast address\",\"MacUnicastAddress\"),f5=Ze(ju,cx,\"a unicast address\",\"MacUnicastAddressFromString\"),l5=Ze(Ax,fx,\"a broadcast address\",\"Ipv4BroadcastAddress\"),p5=Ze(uw,fx,\"a broadcast address\",\"Ipv4BroadcastAddressFromString\"),d5=Ze(zi,ix,\"a broadcast address\",\"MacBroadcastAddress\"),m5=Ze(ju,ix,\"a broadcast address\",\"MacBroadcastAddressFromString\"),h5=Ze(qi,RT,\"a loopback address\",\"IpLoopbackAddress\"),x5=Ze(zu,RT,\"a loopback address\",\"IpLoopbackAddressFromString\"),g5=Ze(qi,MT,\"a link-local address\",\"IpLinkLocalAddress\"),y5=Ze(zu,MT,\"a link-local address\",\"IpLinkLocalAddressFromString\"),S5=Ze(qi,ux,\"an unspecified address\",\"IpUnspecifiedAddress\"),b5=Ze(zu,ux,\"an unspecified address\",\"IpUnspecifiedAddressFromString\"),E5=Ze(Ax,FT,\"a private address\",\"Ipv4PrivateAddress\"),I5=Ze(uw,FT,\"a private address\",\"Ipv4PrivateAddressFromString\"),T5=Ze(fw,NT,\"a unique-local address\",\"Ipv6UniqueLocalAddress\"),w5=Ze(TD,NT,\"a unique-local address\",\"Ipv6UniqueLocalAddressFromString\"),C5=Ze(zi,OT,\"a locally administered address\",\"MacLocallyAdministeredAddress\"),A5=Ze(ju,OT,\"a locally administered address\",\"MacLocallyAdministeredAddressFromString\"),k5=Ze(zi,_T,\"a universally administered address\",\"MacUniversallyAdministeredAddress\"),v5=Ze(ju,_T,\"a universally administered address\",\"MacUniversallyAdministeredAddressFromString\"),wD=Be(jN,{identifier:\"Ipv4Interface\"}),O5=uo(wD,px,Ep,\"Ipv4InterfaceFromString\"),CD=Be(zN,{identifier:\"Ipv6Interface\"}),_5=uo(CD,dx,Ep,\"Ipv6InterfaceFromString\"),AD=Be(Sp,{identifier:\"IpInterface\"}),R5=uo(AD,mx,Ep,\"IpInterfaceFromString\"),kD=Be(HN,{identifier:\"Ipv4Network\"}),P5=uo(kD,JN,Tp,\"Ipv4NetworkFromString\"),vD=Be(WN,{identifier:\"Ipv6Network\"}),M5=uo(vD,KN,Tp,\"Ipv6NetworkFromString\"),OD=Be(Ip,{identifier:\"IpNetwork\"}),F5=uo(OD,GN,Tp,\"IpNetworkFromString\"),N5=Be(hp,{identifier:\"InetAddressV4\"}),U5=Be(xp,{identifier:\"InetAddressV6\"}),_D=Be(AT,{identifier:\"InetAddress\"}),D5=uo(_D,$N,lx,\"InetAddressFromString\"),RD=Be(ax,{identifier:\"UnixPathAddress\"}),L5=J.pipe(G(RD,Pe({decode:BN,encode:e=>e.path}))).annotate({identifier:\"UnixPathAddressFromString\"}),$5=Be(NN,{identifier:\"SocketAddress\"}),B5=Vt({decode:(e,t)=>Ht(EA(e),{onNone:()=>P(new de({expected:\"a valid Duration string\"},e,t)),onSome:g}),encode:e=>g(globalThis.String(e))}),j5=Vt({decode:e=>g(Po(e)),encode:(e,t)=>Ht(TA(e),{onNone:()=>P(new de({expected:\"a Duration representable as a bigint\"},e,t)),onSome:r=>g(r)})}),z5=Pe({decode:e=>Hs(e),encode:e=>kr(e)}),kx=Be(xy,{representation:{id:\"effect/schema/Duration\",payload:null},toCode:()=>({runtime:\"Schema.Duration\",Type:\"Duration.Duration\",importDeclarations:['import * as Duration from \"effect/Duration\"']}),expected:\"Duration\",toCodecJson:()=>Ae()(st([Me({_tag:wt(\"Infinity\")}),Me({_tag:wt(\"NegativeInfinity\")}),Me({_tag:wt(\"Nanos\"),value:Fu}),Me({_tag:wt(\"Millis\"),value:co})]),Pe({decode:e=>{switch(e._tag){case\"Infinity\":return cs;case\"NegativeInfinity\":return bc;case\"Nanos\":return Po(e.value);case\"Millis\":return Hs(e.value)}},encode:e=>{switch(e.value._tag){case\"Infinity\":return{_tag:\"Infinity\"};case\"NegativeInfinity\":return{_tag:\"NegativeInfinity\"};case\"Nanos\":return{_tag:\"Nanos\",value:e.value.nanos};case\"Millis\":return{_tag:\"Millis\",value:e.value.millis}}}}))}),q5=J.annotate({expected:\"a string that will be decoded as a Duration\"}),lw=q5.pipe(G(kx,B5)),H5=Fu.pipe(G(kx,j5)),W5=ji.pipe(G(kx,z5));function J5(e,t,r){let n=qr()([e,t,r],([o,s,a])=>{let i=WT(s,a);return(c,u,f)=>{if(!dl(c))return P(new ut(u,c,f));switch(c._tag){case\"Success\":return Kt(et(o)(c.value,f),{onSuccess:pr,onFailure:p=>Br(u,\"value\",p,c,f)});case\"Failure\":return Kt(et(i)(c.cause,f),{onSuccess:Ur,onFailure:p=>Br(u,\"cause\",p,c,f)})}}},{representation:{id:\"effect/schema/Exit\",payload:null},toCode:({typeParameters:o})=>({runtime:`Schema.Exit(${o[0].runtime}, ${o[1].runtime}, ${o[2].runtime})`,Type:`Exit.Exit<${o[0].Type}, ${o[1].Type}, ${o[2].Type}>`,importDeclarations:['import * as Exit from \"effect/Exit\"']}),expected:\"Exit\",toCodec:([o,s,a])=>Ae()(st([Me({_tag:wt(\"Success\"),value:o}),Me({_tag:wt(\"Failure\"),cause:WT(s,a)})]),Pe({decode:i=>i._tag===\"Success\"?pr(i.value):Ur(i.cause),encode:i=>Ke(i)?{_tag:\"Success\",value:i.value}:{_tag:\"Failure\",cause:i.cause}}))});return q(n.ast,{value:e,error:t,defect:r})}function oU(e,t,r){return Me({type:wt(e),nodes:$e(Me({index:Li,data:t})),edges:$e(Me({index:Li,source:Li,target:Li,data:r}))})}function sU(e,t){let r=-1,n=new Set;for(let o=0;o{let o=zl(r),s=zl(n);if(o.type!==s.type||o.nodes.length!==s.nodes.length||o.edges.length!==s.edges.length)return!1;for(let a=0;a{if(n===null)return mh({type:e,nodes:[],edges:[]});let o=n.nodes.map((s,a)=>({index:a,data:s}));return mh({type:e,nodes:o,edges:n.edges.map(([s,a,i],c)=>({index:c,source:s%o.length,target:a%o.length,data:i}))})}))}function Z5(e,t,r){let n=qr()([t,r],([o,s])=>{let a=oU(e,o,s);return(i,c,u)=>!GE(i)||i.mutable||i.type!==e?P(new ut(c,i,u)):I(et(a)(zl(i),u),f=>sU(f,u))},{representation:{id:\"effect/schema/Graph\",payload:e},toCode:({typeParameters:o})=>({runtime:`Schema.Graph(${F(e)}, ${o[0].runtime}, ${o[1].runtime})`,Type:`Graph.Graph<${o[0].Type}, ${o[1].Type}, ${F(e)}>`,importDeclarations:['import * as Graph from \"effect/Graph\"']}),expected:`an immutable ${e} Graph`,toCodec:([o,s])=>Ae()(oU(e,o,s),Vt({decode:sU,encode:(a,i)=>K5(a,e,i)})),toCodecArbitrary:({typeParameters:[o,s]})=>V5(e,o,s),toEquivalence:([o,s])=>G5(o,s)});return q(n.ast,{type:e,node:t,edge:r})}function aU(e){return Ae()(e,Pe({decode:vE,encode:Bl}))}function Y5(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(Zo([n,o]));return(a,i,c)=>qR(a)?Kt(et(s)(Bl(a),c),{onSuccess:vE,onFailure:u=>Br(i,\"entries\",u,a,c)}):P(new ut(i,a,c))},{representation:{id:\"effect/schema/HashMap\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.HashMap(${n[0].runtime}, ${n[1].runtime})`,Type:`HashMap.HashMap<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as HashMap from \"effect/HashMap\"']}),expected:\"HashMap\",toCodec:([n,o])=>aU($e(Zo([n,o]))),toCodecArbitrary:({constraint:n,typeParameters:[o,s]})=>aU(Sx($e(Zo([o,s])).check(KU()),n?.minSize,n?.maxSize)),toEquivalence:([n,o])=>cd(n,o)});return q(r.ast,{key:e,value:t})}function iU(e){return Ae()(e,Pe({decode:RE,encode:Ve}))}function Q5(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>GR(o)?Kt(et(n)(Ve(o),a),{onSuccess:RE,onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ut(s,o,a))},{representation:{id:\"effect/schema/HashSet\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.HashSet(${r[0].runtime})`,Type:`HashSet.HashSet<${r[0].Type}>`}),expected:\"HashSet\",toCodec:([r])=>iU($e(r)),toCodecArbitrary:({constraint:r,typeParameters:[n]})=>iU(Sx($e(n).check(sw()),r?.minSize,r?.maxSize)),toEquivalence:([r])=>Ef(r)});return q(t.ast,{value:e})}function Hi(e){let t=qr()([e],([r])=>(n,o,s)=>yc(n)?ue(n)?ra:Kt(et(r)(n.value,s),{onSuccess:O,onFailure:a=>Br(o,\"value\",a,n,s)}):P(new ut(o,n,s)),{representation:{id:\"effect/schema/Option\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Option(${r[0].runtime})`,Type:`Option.Option<${r[0].Type}>`,importDeclarations:['import * as Option from \"effect/Option\"']}),expected:\"Option\",toCodec:([r])=>Ae()(st([Me({_tag:wt(\"Some\"),value:r}),Me({_tag:wt(\"None\")})]),Pe({decode:n=>n._tag===\"None\"?v():O(n.value),encode:n=>Oe(n)?{_tag:\"Some\",value:n.value}:{_tag:\"None\"}}))});return q(t.ast,{value:e})}function X5(e){return QT(e).pipe(G(Hi(Hr(e)),cM()))}function e8(e){return bx(e).pipe(G(Hi(Hr(e)),uM()))}function t8(e,t){return CU(e).pipe(G(Hi(Hr(e)),fM(t)))}var PD=Be(QR,{representation:{id:\"effect/http/Cookie\",payload:null},toCode:()=>({runtime:\"Schema.Cookie\",Type:\"Cookies.Cookie\",importDeclarations:['import * as Cookies from \"effect/http/Cookies\"']}),expected:\"Cookie\"}),MD=Be(YR,{representation:{id:\"effect/http/Cookies\",payload:null},toCode:()=>({runtime:\"Schema.Cookies\",Type:\"Cookies.Cookies\",importDeclarations:['import * as Cookies from \"effect/http/Cookies\"']}),expected:\"Cookies\",toCodecJson:()=>Ae()($e(J),Pe({decode:XR,encode:oP})),toCodecIso:()=>Ae()(ks(J,PD),Pe({decode:DE,encode:e=>e.cookies}))}),r8=MD.pipe(G(ks(J,J),Pe({decode:nP,encode:e=>LE(globalThis.Object.entries(e).map(([t,r])=>rP(t,r)))}))),n8=Be(cP,{representation:{id:\"effect/http/Headers\",payload:null},toCode:()=>({runtime:\"Schema.Headers\",Type:\"Headers.Headers\",importDeclarations:['import * as Headers from \"effect/http/Headers\"']}),expected:\"Headers\",toEquivalence:()=>qE,toCodec:()=>Ae()(ks(J,J),Pe({decode:uP,encode:e=>({...e})}))}),pw=Be(WE,{representation:{id:\"effect/http/UrlParams\",payload:null},toCode:()=>({runtime:\"Schema.UrlParams\",Type:\"UrlParams.UrlParams\",importDeclarations:['import * as UrlParams from \"effect/http/UrlParams\"']}),expected:\"UrlParams\",toEquivalence:()=>JE,toCodec:()=>Ae()($e(Zo([J,J])),Pe({decode:dh,encode:e=>e.params}))}),o8=(e,t)=>pw.pipe(G(iw(Ap,t),Vt({decode:r=>Ht(pP(r,e),{onNone:()=>P(new ct([e],new fa(void 0))),onSome:g}),encode:r=>g(dh([[e,r]]))}))),s8=pw.pipe(G(ks(J,st([J,YT(J)])),Pe({decode:dP,encode:fP})));function a8(e){return $i(e).pipe(G(Hi(Hr(e)),lM()))}function i8(e){return Pu(e).pipe(G(Hi(Hr(e)),pM()))}function c8(e,t){let r=t===void 0?\"omit\":t.onNoneEncoding,n=r===null?null:void 0;return Pu(QT(e)).pipe(G(Hi(Hr(e)),Ah({decode:o=>o.pipe(Wa(sd),O),encode:r===\"omit\"?Ha:o=>O(Rf(Ha(o),()=>n))})))}function vx(e,t){let r=typeof t?.label==\"string\"?t.label:void 0,n=t?.disallowJsonEncode===!0,o=r!==void 0?n?{label:r,disallowJsonEncode:!0}:{label:r}:n?{disallowJsonEncode:!0}:void 0,s=r!==void 0?et(wt(r)):void 0,a=qr()([e],([i])=>(c,u,f)=>{if($E(c)){let p=s!==void 0?Fl(s(c.label,f),d=>new ct([\"label\"],d)):Y;return nt(p,()=>Kt(et(i)(eu(c),f),{onSuccess:d=>Ti(d,{label:c.label}),onFailure:()=>new Tt(u,[new ct([\"value\"],new de(void 0,c,f))],c,f)}))}return P(new ut(u,c,f))},{representation:{id:\"effect/schema/Redacted\",payload:o??null},toCode:({typeParameters:i})=>({runtime:o!==void 0?`Schema.Redacted(${i[0].runtime}, ${F(o)})`:`Schema.Redacted(${i[0].runtime})`,Type:`Redacted.Redacted<${i[0].Type}>`,importDeclarations:['import * as Redacted from \"effect/Redacted\"']}),expected:\"Redacted\",toCodecJson:([i])=>Ae()(i,{decode:oe(c=>Ti(c,{label:r})),encode:n?bh(c=>\"Cannot serialize Redacted\"+(Oe(c)&&typeof c.value.label==\"string\"?` with label: \"${c.value.label}\"`:\"\")):oe(eu)}),toEquivalence:([i])=>iP(i)});return q(a.ast,{value:e})}function u8(e,t){return G(vx(Hr(e),{label:t?.label,disallowJsonEncode:t?.disallowEncode}),{decode:oe(r=>Ti(r,{label:t?.label})),encode:t?.disallowEncode?bh(r=>\"Cannot encode Redacted\"+(Oe(r)&&typeof r.value.label==\"string\"?` with label: \"${r.value.label}\"`:\"\")):oe(eu)})(e)}function f8(e,t){let r=qr()([e,t],([n,o])=>(s,a,i)=>{if(!tA(s))return P(new ut(a,s,i));switch(s._tag){case\"Success\":return Kt(XI(n)(s.success,i),{onSuccess:B,onFailure:c=>Br(a,\"success\",c,s,i)});case\"Failure\":return Kt(XI(o)(s.failure,i),{onSuccess:K,onFailure:c=>Br(a,\"failure\",c,s,i)})}},{representation:{id:\"effect/schema/Result\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Result(${n[0].runtime}, ${n[1].runtime})`,Type:`Result.Result<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Result from \"effect/Result\"']}),expected:\"Result\",toCodec:([n,o])=>Ae()(st([Me({_tag:wt(\"Success\"),success:n}),Me({_tag:wt(\"Failure\"),failure:o})]),Pe({decode:s=>s._tag===\"Success\"?B(s.success):K(s.failure),encode:s=>at(s)?{_tag:\"Success\",success:s.success}:{_tag:\"Failure\",failure:s.failure}}))});return q(r.ast,{success:e,failure:t})}var l8=globalThis.Symbol.for(\"immer-draftable\"),JT={};function dw(e,t,r,n,o){let s=d8(r,t,n),a=FD(t),i=class extends e{constructor(...[c,u]){let p=u?.[\"~payload\"],d=p?.token===JT?p.value:r.make(c??{},u);super(d,{...u,disableChecks:!0,\"~payload\":{token:JT,value:d}})}static[wp]=wp;get[a](){return a}static[l8]=!0;static identifier=t;static fields=r.fields;static get ast(){return s(this).ast}static pipe(){return Z(this,arguments)}static rebuild(c){return s(this).rebuild(c)}static make(c,u){return Wh(s(this))(c??{},u)}static makeOption(c,u){return Hh(s(this))(c??{},u)}static makeEffect(c,u){return s(this).makeEffect(c??{},u)}static annotate(c){return this.rebuild(Qn(this.ast,c))}static annotateKey(c){return this.rebuild(ap(this.ast,c))}static check(...c){return this.rebuild(Ko(this.ast,c))}static extend(c){return(u,f)=>{let p=Pp(u)?u:Me(u),d={...r.fields,...p.fields},m=Ph(d,r.ast.checks,{identifier:c});return dw(this,c,ZT(Ko(m,p.ast.checks),d),f,o)}}static mapFields(c,u){return r.mapFields(c,u)}};return o!==void 0&&Object.assign(i.prototype,o(t)),i}function p8(e){return new Ce(oe(t=>new e(t,{\"~payload\":{token:JT,value:t}})),jr())}function FD(e){return`~effect/Schema/Class/${e}`}function d8(e,t,r){let n;return o=>{if(n!==void 0)return n;let s=FD(t),a=u=>u instanceof o||A(u,s),i=p8(o),c=q(new pu([e.ast],()=>(u,f,p)=>a(u)?g(u):P(new ut(f,u,p)),{identifier:t,[xh]:([u])=>({isConstructed:a,link:new ot(u,i)}),toCodec:([u])=>new ot(u.ast,i),toEquivalence:([u])=>u,toFormatter:([u])=>f=>`${o.identifier}(${u(f)})`,[ql]:uu(e.ast),...r}));return n=G(c,i)(e)}}function Pp(e){return gx(e)}var ND=e=>(t,r)=>{let n=Pp(t)?t:Me(t);return dw(Hd,e,n,r,o=>({toString(){return`${o}(${F({...this})})`}}))},m8=e=>(t,r,n)=>{let o=Pp(r)?r.mapFields(s=>({_tag:Bi(t),...s}),{unsafePreserveChecks:!0}):Ex(t,r);return ND(e??t)(o,n)},UD=e=>(t,r)=>{let n=Pp(t)?t:Me(t);return dw(Af,e,n,r,s=>({name:s}))},h8=e=>(t,r,n)=>{let o=Pp(r)?r.mapFields(s=>({_tag:Bi(t),...s}),{unsafePreserveChecks:!0}):Ex(t,r);return UD(e??t)(o,n)};function x8(e){return t=>t.annotate({toFormatter:e})}function g8(e,t){return TN(e.ast,t)}function y8(e){return t=>t.annotate({toEquivalence:e})}function S8(e){return xT(e.ast)}function b8(e,t){return pp(e.ast,t)}function E8(e,t){let r=pp(Su(e.ast),t);return tx(r,t)}var I8=Zh,T8=Yh,Mp=Qh,w8=YF;function C8(e,t){return yN(e,t)}function A8(e){return _N(e)}function k8(e){return RN(e)}function v8(e){return PN(e)}function O8(e,t){return r=>q(Qn(r.ast,{toCodecIso:()=>new ot(e.ast,Ch(t))}),{schema:r})}function _8(e){return gN(e)}function R8(e){let t=AU(()=>r),r=st([e,$e(t),ks(J,t)]);return r}var Ox=q(Qn(fu,{toCode:()=>({runtime:\"Schema.Json\",Type:\"Schema.Json\"})})),P8=ks(J,Ox),M8=Me({message:J,name:$i(J),stack:$i(J),cause:$i(Ox)}),F8=q(Qn(dF,{toCode:()=>({runtime:\"Schema.MutableJson\",Type:\"Schema.MutableJson\"})}));function N8(e){return Ts(e.ast)}function U8(e){return e.ast.context?.annotations}var DD=\"~effect/MutableHashMap\";var D8={[DD]:DD,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${F(Array.from(this))})`},toJSON(){return{_id:\"MutableHashMap\",values:kt(Array.from(this))}},[Ie](){return this.toJSON()},pipe(){return Z(this,arguments)}},Fp=()=>{let e=Object.create(D8);return e.backing=new Map,e.buckets=new Map,e};var Yo=l(2,(e,t)=>{if(e.backing.has(t))return O(e.backing.get(t));if(mw(t))return v();let r=H(t),n=e.buckets.get(r);return n===void 0?v():L8(e,n,t)}),mw=e=>typeof e!=\"object\"&&typeof e!=\"function\";var L8=(e,t,r)=>{for(let n=0,o=t.length;n{if(e.backing.has(t)||mw(t))return e.backing.set(t,r),e;let n=H(t),o=e.buckets.get(n);if(o===void 0)return e.buckets.set(n,[t]),e.backing.set(t,r),e;let s=$8(o,t);return s===void 0&&(o.push(t),s=t),e.backing.set(s,r),e}),$8=(e,t)=>{for(let r=0,n=e.length;r{if(mw(t))return e.backing.delete(t),e;let r=H(t),n=e.buckets.get(r);if(n===void 0)return e;for(let o=0,s=n.length;o(e.backing.clear(),e.buckets.clear(),e),LD=e=>e.backing.size;var $D=Jy;var ga=Ky,BD=lk,fo=Xf;var Hu=fs,ya=uO;var Wr=jS,jD=xO;var zD=\"~effect/MutableRef\",B8={[zD]:zD,...er,toJSON(){return{_id:\"MutableRef\",current:kt(this.current)}}},Wu=e=>{let t=Object.create(B8);return t.current=e,t};var qD=e=>e.current;var Px=l(2,(e,t)=>(e.current=t,e));var yr=Symbol.for(\"effect/MutableList/Empty\"),Os=()=>({head:void 0,tail:void 0,length:0}),gw=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},HD=()=>({array:[],mutable:!0,offset:0,next:void 0}),lo=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=HD(),e.tail=e.tail.next):e.head=e.tail=HD(),e.tail.array.push(t),e.length++},yw=(e,t)=>{e.head={array:[t],mutable:!0,offset:0,next:e.head},e.tail||(e.tail=e.head),e.length++};var Mx=(e,t)=>Fx(e,Ve(t),!Array.isArray(t)),Fx=(e,t,r=!1)=>{if(t.length===0)return 0;let n={array:t,mutable:r,offset:0,next:void 0};return e.head?e.tail=e.tail.next=n:e.head=e.tail=n,e.length+=t.length,t.length},vs=e=>{e.head=e.tail=void 0,e.length=0},Wi=(e,t)=>{if(t=rt(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let s=e.head.array;return vs(e),s}let r=new Array(t),n=0,o=e.head;for(;o;){for(;o.offset{if(t=rt(t),t<=0||!e.head)return;if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){vs(e);return}let r=0,n=e.head;for(;n;){let o=n.array.length-n.offset;if(r+o>t){n.offset+=t-r,e.head=n,e.length-=t,gw(e);return}r+=o,n=n.next}vs(e)},Sa=e=>Wi(e,e.length),Ji=e=>{if(!e.head)return yr;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length?e.head.next?e.head=e.head.next:vs(e):gw(e),t},WD=(e,t)=>{if(t=rt(t),t<=0)return[];let r=Math.min(t,e.length),n=new Array(r),o=0,s=e.head;for(;s;){for(let a=s.offset;a{let r=[],n=e.head,o=0;for(;n;){for(let s=n.offset;sSw(e,r=>r!==t);var j8=\"~effect/PubSub\";var z8=\"~effect/PubSub/Subscription\",$x=e=>te(()=>G8(e.atomicPubSub(),new Map,An(),Wr(!1),Wu(!1),e.strategy(),Wu(v()))),Bx=e=>$x({atomicPubSub:()=>Rw(e),strategy:()=>new Ux}),jx=e=>$x({atomicPubSub:()=>Rw(e),strategy:()=>new Dx}),zx=e=>$x({atomicPubSub:()=>Rw(e),strategy:()=>new _w}),qx=e=>$x({atomicPubSub:()=>KD(e),strategy:()=>new Dx}),Rw=e=>{let t=typeof e==\"number\"?{capacity:e}:e;if(V8(t.capacity),t.capacity===1/0)return KD(t);let r=t.replay&&t.replay>0?new Lx(Math.ceil(t.replay)):void 0;return t.capacity===1?new ww(r):b_(t.capacity)===t.capacity?new Iw(t.capacity,r):new bw(t.capacity,r)},KD=e=>{let t=e?.replay;return new Aw(t&&t>0?new Lx(Math.ceil(t)):void 0)};var Lp=e=>bs(an(t=>(Px(e.shutdownFlag,!0),Le(e.scope,sb(t.id)).pipe(mr(e.strategy.shutdown),Qm(e.shutdownHook.open),na)))),Hx=l(2,(e,t)=>te(()=>q8(e,t))),q8=l(2,(e,t)=>{if(e.shutdownFlag.current||Oe(e.ended.current))return!1;if(Px(e.ended,O(t)),e.strategy instanceof Ux)for(let[n,o,s]of Sa(e.strategy.publishers))s&&Do(o,pr(!1));let r=pr(t);for(let n of e.subscribers.values())for(let o of n){let s;for(;(s=Ji(o))!==yr;)Do(s,r)}return e.subscribers.clear(),!0});var Wx=l(2,(e,t)=>$(()=>e.shutdownFlag.current||Oe(e.ended.current)?g(!1):e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),g(!0)):e.strategy.handleSurplus(e.pubsub,e.subscribers,[t],e.shutdownFlag)));var GD=l(2,(e,t)=>$(()=>{if(e.shutdownFlag.current||Oe(e.ended.current))return g(!1);let r=e.pubsub.publishAll(t);return e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),r.length===0?g(!0):e.strategy.handleSurplus(e.pubsub,e.subscribers,r,e.shutdownFlag)})),$p=e=>bs(Pl(t=>{let r=Fe(t,_r),n=Mt(e.scope),o=K8(e.pubsub,e.subscribers,e.strategy,e.ended);return ar(n,H8(o)).pipe(mr(Lo(r,s=>Le(n,s))),Ft(o))})),H8=e=>bs(an(t=>(Px(e.shutdownFlag,!0),ta(Sa(e.pollers),r=>cb(r,t.id),{discard:!0,concurrency:\"unbounded\"}).pipe(Pr(()=>te(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),Qm(e.shutdownHook.open),na)))),Jx=e=>$(()=>{if(e.shutdownFlag.current)return On;if(e.replayWindow.remaining>0){let r=e.replayWindow.take();return g(r)}let t=e.pollers.length===0?e.subscription.poll():yr;return t===yr?ZD(e):(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),g(t))}),VD=e=>$(function t(r){if(e.shutdownFlag.current)return On;let n=e.pollers.length===0?e.subscription.pollUpTo(Number.POSITIVE_INFINITY):[];return r&&(n=r.concat(n)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?g(e.replayWindow.takeAll().concat(n)):rr(n)?g(n):I(ZD(e),o=>t([o]))}),ZD=e=>Wc(t=>{if(e.shutdownFlag.current)return t(On);if(Oe(e.ended.current))return t(g(e.ended.current.value));let r=si(),n=e.subscribers.get(e.subscription);return n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),lo(e.pollers,r),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),r.effect?t(r.effect):(r.resumes=[t],te(()=>JD(e.pollers,r)))});var bt=Symbol.for(\"effect/PubSub/AbsentValue\"),W8=(e,t,r)=>{e.has(t)||e.set(t,new Set),e.get(t).add(r)},J8=(e,t,r)=>{if(!e.has(t))return;let n=e.get(t);n.delete(r),n.size===0&&e.delete(t)},K8=(e,t,r,n)=>new vw(e,t,e.subscribe(),Os(),Wr(!1),Wu(!1),r,e.replayWindow(),n),bw=class{array;replayIndices;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(t,r){this.capacity=t,this.replayBuffer=r,this.array=Array.from({length:t}),this.replayIndices=r?Array.from({length:t}):[],this.subscribers=Array.from({length:t})}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);if(this.subscriberCount!==0){let n=this.publisherIndex%this.capacity;this.array[n]=t,r!==void 0&&(this.replayIndices[n]=r),this.subscribers[n]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ve(t),n=r.length,o=this.publisherIndex-this.subscribersIndex,s=this.capacity-o,a=Math.min(n,s);if(a===0)return r;let i=0,c=this.publisherIndex+a;for(;this.publisherIndex!==c;){let u=r[i++],f=this.publisherIndex%this.capacity;this.array[f]=u;let p=this.replayBuffer?.offer(u);p!==void 0&&(this.replayIndices[f]=p),this.subscribers[f]=this.subscriberCount,this.publisherIndex+=1}return r.slice(i)}slide(){if(this.subscribersIndex!==this.publisherIndex){let t=this.subscribersIndex%this.capacity,r=this.array[t];this.array[t]=bt,this.subscribers[t]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(r,this.replayIndices[t])}}subscribe(){return this.subscriberCount+=1,new Ew(this,this.publisherIndex,!1)}},Ew=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return yr;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let t=this.subscriberIndex%this.self.capacity,r=this.self.array[t];return this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1,r}return yr}pollUpTo(t){if(t=rt(t),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let r=this.self.publisherIndex-this.subscriberIndex,n=Math.min(t,r);if(n<=0)return[];let o=[],s=this.subscriberIndex+n;for(;this.subscriberIndex!==s;){let a=this.subscriberIndex%this.self.capacity,i=this.self.array[a];this.self.subscribers[a]-=1,this.self.subscribers[a]===0&&(this.self.array[a]=bt,this.self.subscribersIndex+=1),o.push(i),this.subscriberIndex+=1}return o}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let t=this.subscriberIndex%this.self.capacity;this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}},Iw=class{array;replayIndices;mask;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(t,r){this.capacity=t,this.replayBuffer=r,this.array=Array.from({length:t}),this.replayIndices=r?Array.from({length:t}):[],this.mask=t-1,this.subscribers=Array.from({length:t})}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);if(this.subscriberCount!==0){let n=this.publisherIndex&this.mask;this.array[n]=t,r!==void 0&&(this.replayIndices[n]=r),this.subscribers[n]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ve(t),n=r.length,o=this.publisherIndex-this.subscribersIndex,s=this.capacity-o,a=Math.min(n,s);if(a===0)return r;let i=0,c=this.publisherIndex+a;for(;this.publisherIndex!==c;){let u=r[i++],f=this.publisherIndex&this.mask;this.array[f]=u;let p=this.replayBuffer?.offer(u);p!==void 0&&(this.replayIndices[f]=p),this.subscribers[f]=this.subscriberCount,this.publisherIndex+=1}return r.slice(i)}slide(){if(this.subscribersIndex!==this.publisherIndex){let t=this.subscribersIndex&this.mask,r=this.array[t];this.array[t]=bt,this.subscribers[t]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(r,this.replayIndices[t])}}subscribe(){return this.subscriberCount+=1,new Tw(this,this.publisherIndex,!1)}},Tw=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return yr;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let t=this.subscriberIndex&this.self.mask,r=this.self.array[t];return this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1,r}return yr}pollUpTo(t){if(t=rt(t),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let r=this.self.publisherIndex-this.subscriberIndex,n=Math.min(t,r);if(n<=0)return[];let o=[],s=this.subscriberIndex+n;for(;this.subscriberIndex!==s;){let a=this.subscriberIndex&this.self.mask,i=this.self.array[a];this.self.subscribers[a]-=1,this.self.subscribers[a]===0&&(this.self.array[a]=bt,this.self.subscribersIndex+=1),o.push(i),this.subscriberIndex+=1}return o}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let t=this.subscriberIndex&this.self.mask;this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}},ww=class{publisherIndex=0;subscriberCount=0;subscribers=0;value=bt;replayIndex=0;capacity=1;replayBuffer;constructor(t){this.replayBuffer=t}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}pipe(){return Z(this,arguments)}isEmpty(){return this.subscribers===0}isFull(){return!this.isEmpty()}size(){return this.isEmpty()?0:1}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);return this.subscriberCount!==0&&(this.value=t,r!==void 0&&(this.replayIndex=r),this.subscribers=this.subscriberCount,this.publisherIndex+=1),!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ve(t);return r.length===0?r:this.publish(r[0])?r.slice(1):r}slide(){if(this.isFull()){let t=this.value;this.subscribers=0,this.value=bt,this.replayBuffer?.slide(t,this.replayIndex)}}subscribe(){return this.subscriberCount+=1,new Cw(this,this.publisherIndex,!1)}},Cw=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.subscribers===0||this.subscriberIndex===this.self.publisherIndex}size(){return this.isEmpty()?0:1}poll(){if(this.isEmpty())return yr;let t=this.self.value;return this.self.subscribers-=1,this.self.subscribers===0&&(this.self.value=bt),this.subscriberIndex=this.self.publisherIndex,t}pollUpTo(t){return rt(t)<1||this.isEmpty()?[]:[this.poll()]}unsubscribe(){this.unsubscribed||(this.unsubscribed=!0,this.self.subscriberCount-=1,this.self.subscribers!==0&&this.subscriberIndex!==this.self.publisherIndex&&(this.self.subscribers-=1,this.self.subscribers===0&&(this.self.value=bt)))}},Aw=class{publisherHead={value:bt,replayIndex:void 0,subscribers:0,next:null};publisherTail=this.publisherHead;publisherIndex=0;subscribersIndex=0;capacity=Number.MAX_SAFE_INTEGER;replayBuffer;constructor(t){this.replayBuffer=t}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}isEmpty(){return this.publisherHead===this.publisherTail}isFull(){return!1}size(){return this.publisherIndex-this.subscribersIndex}publish(t){let r=this.replayBuffer?.offer(t),n=this.publisherTail.subscribers;if(n!==0){let o={value:t,replayIndex:r,subscribers:n,next:null};this.publisherTail.next=o,this.publisherTail=this.publisherTail.next,this.publisherIndex+=1}return!0}publishAll(t){if(this.publisherTail.subscribers!==0)for(let r of t)this.publish(r);else this.replayBuffer&&this.replayBuffer.offerAll(t);return[]}slide(){if(this.publisherHead!==this.publisherTail){let t=this.publisherHead.next,r=t.value;this.publisherHead=this.publisherHead.next,this.publisherHead.value=bt,this.subscribersIndex+=1,this.replayBuffer?.slide(r,t.replayIndex)}}subscribe(){return this.publisherTail.subscribers+=1,new kw(this,this.publisherTail,this.publisherIndex,!1)}},kw=class{self;subscriberHead;subscriberIndex;unsubscribed;constructor(t,r,n,o){this.self=t,this.subscriberHead=r,this.subscriberIndex=n,this.unsubscribed=o}isEmpty(){if(this.unsubscribed)return!0;let t=!0,r=!0;for(;r;)this.subscriberHead===this.self.publisherTail?r=!1:this.subscriberHead.next.value!==bt?(t=!1,r=!1):(this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1);return t}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return yr;let t=!0,r=yr;for(;t;)if(this.subscriberHead===this.self.publisherTail)t=!1;else{let n=this.subscriberHead.next.value;n!==bt&&(r=n,this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=bt,this.self.subscribersIndex+=1),t=!1),this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1}return r}pollUpTo(t){t=rt(t);let r=[],n=0;for(;n!==t;){let o=this.poll();o===yr?n=t:(r.push(o),n+=1)}return r}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.publisherTail.subscribers-=1;this.subscriberHead!==this.self.publisherTail;)this.subscriberHead.next.value!==bt&&(this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=bt,this.self.subscribersIndex+=1)),this.subscriberHead=this.subscriberHead.next}},vw=class{[z8]={_A:R};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;ended;constructor(t,r,n,o,s,a,i,c,u){this.pubsub=t,this.subscribers=r,this.subscription=n,this.pollers=o,this.shutdownHook=s,this.shutdownFlag=a,this.strategy=i,this.replayWindow=c,this.ended=u}pipe(){return Z(this,arguments)}},Ow=class{[j8]={_A:R};pubsub;subscribers;scope;shutdownHook;shutdownFlag;strategy;ended;constructor(t,r,n,o,s,a,i){this.pubsub=t,this.subscribers=r,this.scope=n,this.shutdownHook=o,this.shutdownFlag=s,this.strategy=a,this.ended=i}pipe(){return Z(this,arguments)}},G8=(e,t,r,n,o,s,a)=>new Ow(e,t,r,n,o,s,a),V8=e=>{if(e<=0)throw new Error(`Cannot construct PubSub with capacity of ${e}`)},Ux=class{publishers=Os();get shutdown(){return an(t=>ta(Sa(this.publishers),([r,n,o])=>o?cb(n,t.id):Y,{concurrency:\"unbounded\",discard:!0}))}handleSurplus(t,r,n,o){return Wc(s=>{let a=si();return this.offerUnsafe(n,a),this.onPubSubEmptySpaceUnsafe(t,r),this.completeSubscribersUnsafe(t,r),qD(o)?(this.removeUnsafe(a),s(On)):a.effect?s(a.effect):(a.resumes=[s],te(()=>this.removeUnsafe(a)))})}onPubSubEmptySpaceUnsafe(t,r){let n=!0;for(;n&&!t.isFull();){let o=Ji(this.publishers);if(o===yr)n=!1;else{let[s,a]=o,i=t.publish(s);i&&o[2]?Do(a,pr(!0)):i||yw(this.publishers,o),this.completeSubscribersUnsafe(t,r)}}}completePollersUnsafe(t,r,n,o){return Pw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Mw(this,t,r)}offerUnsafe(t,r){let n=t[Symbol.iterator](),o=n.next();if(!o.done)for(;;){let s=o.value;if(o=n.next(),o.done){lo(this.publishers,[s,r,!0]);break}lo(this.publishers,[s,r,!1])}}removeUnsafe(t){Sw(this.publishers,([r,n])=>n!==t)}},Dx=class{get shutdown(){return Y}handleSurplus(t,r,n,o){return g(!1)}onPubSubEmptySpaceUnsafe(t,r){}completePollersUnsafe(t,r,n,o){return Pw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Mw(this,t,r)}},_w=class{get shutdown(){return Y}handleSurplus(t,r,n,o){return te(()=>(this.slidingPublishUnsafe(t,n),this.completeSubscribersUnsafe(t,r),!0))}onPubSubEmptySpaceUnsafe(t,r){}completePollersUnsafe(t,r,n,o){return Pw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Mw(this,t,r)}slidingPublishUnsafe(t,r){let n=r[Symbol.iterator](),o=n.next();if(!o.done&&t.capacity>0){let s=o.value,a=!0;for(;a;){t.slide();let i=t.publish(s);i&&(o=n.next())&&!o.done?s=o.value:i&&(a=!1)}}}},Pw=(e,t,r,n,o)=>{let s=!0;for(;s&&!n.isEmpty();){let a=Ji(o);if(a===yr)J8(r,n,o),o.length===0?s=!1:W8(r,n,o);else{let i=n.poll();i===yr?yw(o,a):(Do(a,pr(i)),e.onPubSubEmptySpaceUnsafe(t,r))}}},Mw=(e,t,r)=>{for(let[n,o]of r)for(let s of o)e.completePollersUnsafe(t,r,n,s)},Lx=class{capacity;head={value:bt,index:0,next:null};tail=this.head;slideValues=[];size=0;index=0;publisherIndex=0;constructor(t){this.capacity=t}slide(t,r){this.slideValues[this.index%this.capacity]={value:t,index:r},this.index++}offer(t){let r=this.publisherIndex++;return this.tail.value=t,this.tail.index=r,this.tail.next={value:bt,index:0,next:null},this.tail=this.tail.next,this.size===this.capacity?this.head=this.head.next:this.size+=1,r}offerAll(t){for(let r of t)this.offer(r)}},Ju=class{buffer;values;index=0;remaining;slideIndex;newestIndex=-1;constructor(t){this.buffer=t,this.remaining=t.size,this.slideIndex=t.index,this.values=new Array(this.remaining);let r=t.head;for(let n=0;nthis.newestIndex&&(this.index=(this.index+1)%this.values.length,this.values[(this.index+this.remaining-1)%this.values.length]=s.value,this.newestIndex=s.index)}this.slideIndex=this.buffer.index}take(){if(this.remaining===0)return;this.sync();let t=this.values[this.index];return this.values[this.index]=bt,this.index=(this.index+1)%this.values.length,this.remaining--,this.remaining===0&&this.close(),t}takeN(t){t=rt(t);let r=Math.min(t,this.remaining),n=new Array(r);for(let o=0;o{},takeN:()=>[],takeAll:()=>[],close:()=>{}};var Z8=\"~effect/Queue\",Y8=\"~effect/Queue/Enqueue\",Q8=\"~effect/Queue/Dequeue\";var Nw={_A:R,_E:R},X8={[Z8]:Nw,[Y8]:Nw,[Q8]:Nw,...er,toJSON(){return{_id:\"effect/Queue\",state:this.state._tag,size:rY(this)}}},Pn=e=>ne(t=>{let r=Object.create(X8);return r.dispatcher=t.currentDispatcher,r.capacity=e?.capacity??Number.POSITIVE_INFINITY,r.strategy=e?.strategy??\"suspend\",r.messages=Os(),r.scheduleRunning=!1,r.state={_tag:\"Open\",takers:new Set,offers:new Set,awaiters:new Set},D(r)}),Bp=e=>Pn({capacity:e});var YD=()=>Pn(),yn=l(2,(e,t)=>re(()=>Vx(e,t)?Qx:e.state._tag===\"Open\"&&e.strategy===\"suspend\"?aY(e,t):XD)),Vx=(e,t)=>e.state._tag!==\"Open\"?!1:e.messages.length>=e.capacity?e.strategy===\"sliding\"?(Ji(e.messages),lo(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0?(lo(e.messages,t),e1(e),!0):!1:(lo(e.messages,t),Gx(e),!0),Ki=l(2,(e,t)=>mt(r=>{let n=Zx(e,t);return n.length===0||e.strategy===\"dropping\"?r(we(n)):r1(e,{_tag:\"Array\",remaining:n,offset:0,resume:r})})),Zx=(e,t)=>{if(e.state._tag!==\"Open\")return Ve(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy===\"sliding\")return Mx(e.messages,t),e.strategy===\"sliding\"&&Wi(e.messages,e.messages.length-e.capacity),Gx(e),[];let r=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(r===0)return Ve(t);let n=[],o=0;for(let s of t)oz(()=>ba(e,t))),ba=(e,t)=>{if(e.state._tag!==\"Open\")return!1;let r=qt(t),n=zk(r,nY);return e.state.offers.size===0&&e.messages.length===0?(Xx(e,n),!0):(e.state={...e.state,_tag:\"Closing\",exit:n},Gx(e),!0)},Dw=e=>Yt(e,lc(ja())),Yx=e=>ba(e,lc(ja()));var po=e=>z(()=>eY(e)),eY=e=>{if(e.state._tag===\"Done\")return!1;vs(e.messages);let t=e.state.offers;Xx(e,e.state._tag===\"Open\"?oY:e.state.exit);for(let r of t)n1(r);return!0};var Ku=e=>QD(e,1,Number.POSITIVE_INFINITY);var QD=l(3,(e,t,r)=>(t=rt(t),r=rt(r),re(()=>sY(e,t,r)??No(t1(e,()=>Lw(e,t)),QD(e,t,r))))),_s=e=>re(()=>tY(e)??No(t1(e,()=>Lw(e,1)),_s(e)));var tY=e=>{if(e.state._tag===\"Done\")return e.state.exit;if(e.messages.length>0){let t=Ji(e.messages);return Uw(e),we(t)}else if(e.capacity<=0&&e.state.offers.size>0){let t=o1(e.state.offers);return Uw(e),we(t)}};var rY=e=>e.state._tag===\"Done\"?0:e.messages.length;var XD=we(!1),Qx=we(!0),nY=tn(ja()),oY=Oc(),e1=e=>{if(!(e.state._tag===\"Done\"||e.state.takers.size===0)){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(lr),e.messages.length===0))break}},Gx=e=>{e.scheduleRunning||e.state._tag===\"Done\"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,e1(e)},0))},sY=(e,t,r)=>{if(e.state._tag===\"Done\")return e.state.exit;if(r<=0||t<=0)return we([]);if(!Lw(e,t))return;let n=e.messages.length>0?Wi(e.messages,r):[o1(e.state.offers)];return Uw(e),we(n)},Lw=(e,t)=>e.messages.length>=(e.state._tag===\"Closing\"?1:Math.min(t,e.capacity||1))||e.capacity<=0&&e.state._tag!==\"Done\"&&e.state.offers.size>0,t1=(e,t)=>mt(r=>{if(e.state._tag===\"Done\")return r(e.state.exit);if(t())return r(lr);let n={ready:t,resume:r};return e.state.takers.add(n),z(()=>{e.state._tag!==\"Done\"&&e.state.takers.delete(n)})}),aY=(e,t)=>mt(r=>Vx(e,t)?r(Qx):r1(e,{_tag:\"Single\",message:t,resume:r})),r1=(e,t)=>{if(e.state._tag!==\"Open\")return n1(t);let r=e.state.offers;return r.add(t),z(()=>{e.state._tag!==\"Done\"&&(r.delete(t),e.state._tag===\"Closing\"&&r.size===0&&e.messages.length===0&&Xx(e,e.state.exit))})},n1=e=>e._tag===\"Single\"?e.resume(XD):e.resume(we(e.remaining.slice(e.offset))),o1=e=>{let t=e.values().next().value;if(t._tag===\"Single\")return e.delete(t),t.resume(Qx),t.message;let r=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(we([]))),r},Uw=e=>{if(e.state._tag===\"Done\")return ys(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===\"Closing\"&&e.messages.length===0?(Xx(e,e.state.exit),ys(e.state.exit.cause)):!1;for(let t of e.state.offers){let r=e.capacity-e.messages.length;if(r<=0)break;if(t._tag===\"Single\")lo(e.messages,t.message),e.state.offers.delete(t),t.resume(Qx);else{for(;t.offset{if(e.state._tag===\"Done\")return;let r=e.state;e.state={_tag:\"Done\",exit:t};for(let n of r.takers)n.resume(t);r.takers.clear();for(let n of r.awaiters)n(t);r.awaiters.clear()};var eg=e=>new Bw(e),s1=(e,t,r)=>mt(n=>{if(e.free>=t)return n(r);let o=()=>{e.free{e.waiters.delete(o)})}),Bw=class{waiters=new Set;taken=0;permits;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take(t){let r=re(()=>this.freethis.free0&&t.currentDispatcher.scheduleTask(()=>{for(let n of this.waiters){if(this.free<=0)break;n()}},0),this.free}resize(t){return ne(r=>(this.permits=t,this.free<0?le:(this.releaseUnsafe(r,0),le)))}release(t){return ne(r=>D(this.releaseUnsafe(r,t)))}get releaseAll(){return ne(t=>D(this.releaseUnsafe(t,this.taken)))}withPermits(t){return r=>jn(n=>{let o=re(()=>{if(this.freeo)}return this.taken+=t,Bn(n(r),()=>{this.releaseUnsafe(fs(),t)},!0)});return o})}withPermit=this.withPermits(1);withPermitsIfAvailable(t){return r=>jn(n=>this.free{this.releaseUnsafe(fs(),t)},!0)))}};var jw=e=>dl(e)?Ke(e)?ee(e.value):e:g(e);var f1=\"~effect/Channel\",ir=e=>A(e,f1),iY={[f1]:{_Env:R,_InErr:R,_InElem:R,_OutErr:R,_OutElem:R},pipe(){return Z(this,arguments)}},ke=e=>{let t=Object.create(iY);return t.transform=(r,n)=>xt(e(r,n),o=>g(it(o))),t},ho=(e,t)=>ke((r,n)=>I(he(e)(r,n),o=>t(o,n))),Qt=e=>ke((t,r)=>e),xo=e=>ke(Se(function*(t,r){let n=Mt(r),o=a=>Le(n,Cb(a)),s=yield*Jn(e(t,r,n),o);return Jn(s,o)})),he=e=>e.transform,jp=4096,cY=(e,t,r)=>Pn({capacity:r?.bufferSize,strategy:r?.strategy}).pipe(Pr(n=>ar(e,po(n))),Pr(n=>Nt(gs(t(n),e),e)));var l1=(e,t)=>ke((r,n)=>j(cY(n,e,t),Ku)),tg=e=>ke((t,r)=>$(()=>he(e())(t,r))),uY=(e,t,r)=>xo(Se(function*(n,o,s){let a=v();yield*Lo(s,c=>Oe(a)?r(a.value,c):Y);let i=yield*bs(e);return a=O(i),yield*he(t(i))(n,o)}));var p1=e=>Qt(te(()=>{let t=e();return $(()=>{let r=t.next();return r.done?ee(r.value):g(r.value)})})),zw=e=>Qt(te(()=>{let t=0;return $(()=>t>=e.length?ee():g(e[t++]))}));var qw=(e,t=jp)=>{let r=En(t);return Qt(te(()=>{let n=e(),o=v();return $(()=>{if(o._tag===\"Some\")return ee(o.value);let s=[];for(;s.lengthqw(()=>e[Symbol.iterator](),t),rg=e=>ng(g(e));var m1=e=>ng(te(e)),Gu=Qt(g(ee())),h1=Qt(g(ui)),Qo=e=>Qt(g(P(e))),x1=e=>Qt(Gm(e)),zp=e=>Qt(it(e)),g1=e=>Qt(Ss(e)),Hw=e=>zp(oi(e)),ng=e=>Qt(te(()=>{let t=!1;return $(()=>t?ee():(t=!0,e))}));var y1=e=>Qt(I(e,()=>ee())),Ww=e=>Qt(g(I(e,jw)));var S1=e=>Qt(g(Ku(e)));var Jw=e=>Qt(g(Vb(VD(e),()=>ee())));var b1=e=>Ea(j($p(e),Jw)),E1=e=>Ea(j($p(e),t=>Ww(Jx(t))));var I1=e=>ke((t,r)=>fY({scope:r,readable:e.evaluate(),onError:e.onError,releaseLockOnEnd:e.releaseLockOnEnd}));var fY=e=>{let t=e.readable.getReader(),r=e.exit??Wu(void 0),n=$(()=>r.current?r.current:fi(Hc({try:()=>t.read(),catch:e.onError}),{onFailure:o=>r.current??it(o),onSuccess:({done:o,value:s})=>r.current?r.current:o?ee():g(be(s))}));return Ft(ar(e.scope,e.releaseLockOnEnd?te(()=>t.releaseLock()):Km(()=>t.cancel().catch(Un))),n)},lY=(e,t)=>ke(Se(function*(r,n){let o=e[Symbol.asyncIterator]();return o.return&&(yield*ar(n,Km(()=>o.return()))),I(Hc({try:()=>o.next(),catch:t}),s=>s.done?ee(s.value):g(s.value))})),T1=(e,t)=>go(lY(e,t),be),go=l(2,(e,t)=>ho(e,r=>te(()=>{let n=0;return j(r,o=>t(o,n++))})));var w1=e=>e===void 0||e!==\"unbounded\"&&e<=1,og=l(e=>ir(e[0]),(e,t,r)=>w1(r?.concurrency)?C1(e,t):pY(e,t,r)),C1=(e,t)=>ke((r,n)=>{let o=0;return j(he(e)(r,n),I(s=>t(s,o++)))}),pY=(e,t,r)=>xo(Se(function*(n,o,s){let a=0,i=yield*he(e)(n,o),c=r.concurrency===\"unbounded\"?Number.MAX_SAFE_INTEGER:r.concurrency,u=yield*Bp(0);yield*ar(s,po(u));let f=_n(yield*li()),p=ya(s);if(r.unordered){let d=eg(c),m=je(d.release(1)),x=fi({onFailure:y=>I(Yt(u,y),m),onSuccess:y=>I(yn(u,y),m)});yield*d.take(1).pipe(I(()=>i),I(y=>{let S=a++;return p(f(x($(()=>t(y,S))))),Y}),$t({disableYield:!0}),xt(y=>d.withPermits(c-1)(Yt(u,y))),Nt(s))}else{let d=yield*Bp(c-2);yield*ar(s,po(d)),yield*_s(d).pipe(Ub,I(y=>yn(u,y)),$t({disableYield:!0}),xt(y=>Yt(u,y)),Nt(s));let m,x=y=>{y._tag!==\"Success\"&&(m=y.cause,ba(u,y.cause))};yield*i.pipe(I(y=>{if(m)return it(m);let S=a++,w=f($(()=>t(y,S)));return p(w),w.addObserver(x),yn(d,ga(w))}),$t({disableYield:!0}),xt(y=>yn(d,Ur(y)).pipe(mr(Yt(d,y)))),Nt(s))}return _s(u)}));var Kw=l(e=>ir(e[0]),(e,t,r)=>w1(r?.concurrency)?dY(e,t):mY(e,t,r)),dY=(e,t)=>ke((r,n)=>j(he(e)(r,n),o=>{let s,a,i=I(o,u=>(a??=Mt(n),nt(he(t(u))(r,a),f=>(s=c(f),s)))),c=Xe(u=>{if(s=void 0,a.state._tag===\"Empty\")return i;let f=Le(a,ht);return a=void 0,I(f,()=>i)});return $(()=>s??i)})),mY=(e,t,r)=>e.pipe(go(t),ig(r)),A1=l(2,(e,t)=>ke((r,n)=>te(()=>{let o,s=Mt(n),a=I(he(e)(r,s),i=>(o=Xe(i,c=>Le(s,ht).pipe(I(()=>he(t(c))(r,n)),I(u=>(o=u,u)))),o));return $(()=>o??a)})));var Gw=l(4,(e,t,r,n)=>ke(Se(function*(o,s){let a=yield*he(e)(o,s),i=yield*he(t)(o,s),c=r();return $(()=>{let u=n(c,a,i);return j(u,([f,p])=>(c=p,f))})}))),k1=l(2,(e,t)=>ke((r,n)=>te(()=>{let o,s=Mt(n),a=I(he(e)(r,s),i=>{let c=i.pipe(Pr(()=>(o=i,Y)),Xe(u=>Le(s,pr(u)).pipe(mr(he(t(u))(r,n)),I(f=>(o=f,f)))));return o=c,c});return $(()=>o??a)}))),v1=e=>Kw(e,R),Sr=e=>ho(e,t=>{let r,n=0,o=$(function s(){if(r===void 0)return I(t,i=>{switch(i.length){case 0:return s();case 1:return g(i[0]);default:return r=i,g(i[n++])}});let a=r[n++];return n>=r.length&&(r=void 0,n=0),g(a)});return g(o)}),O1=e=>C1(e,jw),_1=e=>ho(e,t=>g($t(t,{disableYield:!0}))),R1=l(2,(e,t)=>Hn(typeof t==\"function\"?t(R):t).pipe(j(r=>{let n=Jt.defaultValue();return P1(lg(e,Jt,te(()=>n)),o=>r(o).pipe(j(s=>{n=s}),Xe(()=>ee(o))))}),Ea)),P1=(e,t)=>ke((r,n)=>te(()=>{let o,s=()=>{let a=Mt(n);return I(he(e)(r,a),i=>(o=Xe(i,c=>Le(a,ht).pipe(I(()=>t(c)),I(s))),o))};return $(()=>o??s())})),M1=e=>P1(e,()=>Y),F1=l(2,(e,t)=>ho(e,(r,n)=>j(Il(t),o=>Pr(r,o)))),N1=l(2,(e,t)=>ke((r,n)=>j(he(e)(r,n),o=>I(o,function s(a){return t(a)?g(a):I(o,s)}))));var U1=l(2,(e,t)=>ho(e,r=>g(I(r,function n(o){let s=[];for(let a=0;aho(e,r=>g(I(r,function n(o){let s=[];for(let a=0;aho(e,r=>{let n=I(r,o=>jb(o,t));return g(I(n,function o(s){return Qe(s)?g(s):I(n,o)}))})),$1=l(2,(e,t)=>ho(e,r=>g(I(r,function n(o){return I(zb(o,t),s=>Qe(s)?g(s):I(r,n))})))),Vu=l(e=>ir(e[0]),(e,t,r,n)=>ke((o,s)=>j(he(e)(o,s),a=>{let i=t(),c,u=0,f,p=fi(a,{onFailure(m){f=m;let x=n?.onHalt&&n.onHalt(i);return x&&x.length>0?g([i,x]):it(m)},onSuccess(m){let x=r(i,m);return lA(x)?g(x):x}});return $(function m(){if(c===void 0)return f?it(f):I(p,([y,S])=>(i=y,S.length===0?m():S.length===1?g(S[0]):(c=S,m())));let x=c[u++];return u>=c.length&&(c=void 0,u=0),g(x)})})));var B1=l(3,(e,t,r)=>ke((n,o)=>j(he(e)(n,o),s=>{let a=t,i=!0;return $(()=>i?(i=!1,g(a)):j(I(s,c=>r(a,c)),c=>(a=c,a)))}))),Zu=l(2,(e,t)=>ke((r,n)=>{let o=Mt(n);return j(he(e)(r,o),s=>{let a=s.pipe(xt(i=>{if(ys(i))return it(i);let c=o;return o=Mt(n),Le(c,Ur(i)).pipe(mr(he(t(i))(r,o)),I(u=>(a=u,u)))}));return $(()=>a)})})),j1=l(2,(e,t)=>ag(e,ll,t)),sg=l(2,(e,t)=>Zu(e,r=>y1(I(t(r),n=>it(r))))),z1=l(3,(e,t,r)=>Zu(e,n=>t(n)?r(n):zp(n))),ag=l(3,(e,t,r)=>Zu(e,n=>{let o=t(n);return ce(o)?zp(o.failure):r(o.success,n)})),mo=l(2,(e,t)=>ag(e,eb,r=>t(r)));var q1=l(2,(e,t)=>ho(e,r=>g(Ym(r,n=>Dc(n)?Y:na(t(n)))))),H1=l(e=>ir(e[0]),(e,t,r,n)=>mo(e,o=>t(o)?r(o):n?n(o):Qo(o))),W1=l(e=>ir(e[0]),(e,t,r,n)=>mo(e,o=>{let s=t(o);return ce(s)?n?n(s.failure):Qo(s.failure):r(s.success)}));var J1=l(e=>ir(e[0]),(e,t,r,n,o)=>mo(e,s=>{if(Ct(s,t)&&A(s,\"reason\")){let a=s.reason;return Ct(a,r)?n(a,s):o?o(a,s):Qo(s)}return Qo(s)})),K1=l(e=>ir(e[0]),(e,t,r,n)=>{let o;return mo(e,s=>{if(Ct(s,t)&&A(s,\"reason\")&&A(s.reason,\"_tag\")&&jm(s.reason._tag)){let a=s.reason;return o??=new Set(Object.keys(r)),o.has(a._tag)?r[a._tag](a,s):n?n(a,s):Qo(s)}return Qo(s)})});var G1=l(2,(e,t)=>mo(e,r=>Qo(t(r)))),V1=e=>mo(e,Hw),Z1=l(e=>ir(e[0]),(e,t)=>{if(!t?.log)return mo(e,()=>Gu);let r=th(t.log===!0?void 0:t.log);return mo(sg(e,n=>XS(n)?r(n):Y),()=>Gu)}),c1=e=>Zu(e,()=>Gu),Y1=l(e=>ir(e[0]),(e,t)=>{if(!t?.log)return c1(e);let r=th(t.log===!0?void 0:t.log);return c1(sg(e,n=>r(n)))}),Q1=l(2,(e,t)=>tg(()=>{let r,n=Jt.defaultValue(),o=lg(e,Jt,te(()=>n)),s=Yw(o,()=>(r=void 0,Y)),a=typeof t==\"function\"?t(R):t,i=mo(s,Se(function*(c){return r||(r=yield*Hn(a)),n=yield*r(c),i},(c,u)=>Xe(c,()=>g(Qo(u))),Ea));return i})),X1=l(e=>ir(e[0]),(e,t,r)=>e.pipe(go(t),ig({...r,concurrency:r?.concurrency??1,switch:!0}))),ig=l(2,(e,{bufferSize:t=16,concurrency:r,switch:n=!1})=>xo(Se(function*(o,s,a){let i=r===\"unbounded\"?Number.MAX_SAFE_INTEGER:Math.max(1,r),c=n?void 0:eg(i),u=yield*jD(!0),f=new Set,p=yield*Bp(t);yield*ar(a,po(p));let d=yield*he(e)(o,s);return yield*dr(function*(){for(;;){let m;c&&(f.size=i;){let E=sA(f);f.delete(E),f.size===0&&(yield*u.open),yield*fo(E)}let w=yield*S.pipe(Pr(()=>Ol),I(E=>yn(p,E)),$t({disableYield:!0}),Jn(Se(function*(E){let M=jc(E);if(yield*kn(Le(y,ce(M)?Ur(M.failure):pr(M.success.value))),!!f.has(w)&&(f.delete(w),c&&(yield*c.release(1)),f.size===0&&(yield*u.open),!at(M)))return yield*Yt(p,E)})),Gc);u.closeUnsafe(),f.add(w)}}).pipe(xt(m=>{let x=jc(m);return at(x)?u.whenOpen(Yt(p,m)):Yt(p,m)}),Nt(a)),_s(p)}))),cg=l(e=>ir(e[0])&&ir(e[1]),(e,t,r)=>xo(Se(function*(n,o,s){let a=r?.haltStrategy??\"both\",i=yield*Bp(0);yield*ar(s,po(i));let c=0;function u(p,d){if(c++,!ys(d))return Yt(i,d);switch(a){case\"both\":return c===2?Yt(i,d):Y;case\"left\":case\"right\":return p===a?Yt(i,d):Y;case\"either\":return Yt(i,d)}}let f=(p,d,m)=>he(d)(n,m).pipe(I(x=>x.pipe(I(y=>yn(i,y)),$t)),Jn(x=>mr(Le(m,Cb(x)),u(p,x))),Nt(s));return yield*f(\"left\",e,Mt(s)),yield*f(\"right\",t,Mt(s)),_s(i)}))),e2=l(2,(e,t)=>cg(e,y1(t),{haltStrategy:\"left\"})),t2=()=>ke((e,t)=>te(()=>{let r=\"\",n=!1,o=v();function s(c){let u=[];function f(p){r.length===0?u.push(p):(u.push(r+p),r=\"\")}for(let p=0;po._tag===\"Some\"?ee(o.value):qm(e,{onSuccess:i,onFailure:it,onDone:c=>{if(o=O(c),r.length>0){let u=r;return r=\"\",n=!1,g([u])}return ee(c)}}));function i(c){let u=s(c);return u!==null?g(u):a}return a}));var Vw=l(2,(e,t)=>ke((r,n)=>I(he(e)(r,n),o=>he(t)(o,n)))),Zw=l(2,(e,t)=>ke((r,n)=>I(he(e)(r,n),o=>{let s=xt(o,a=>ys(a)?it(a):Rr(rb(a)));return j(he(t)(s,n),a=>Rl(a,i=>Dc(i)?it(i.value):Rr(i)))}))),Ea=e=>ke((t,r)=>{let n;return g($(()=>n||e.pipe(gs(r),I(o=>he(o)(t,r)),I(o=>n=o))))}),r2=e=>xo((t,r,n)=>j(gs(he(e)(t,r),n),gs(n)));var n2=l(2,(e,t)=>ke(Se(function*(r,n){let o=yield*he(e)(r,n),s=yield*Pn({capacity:t.capacity===\"unbounded\"?void 0:t.capacity,strategy:t.capacity===\"unbounded\"?void 0:t.strategy});return yield*ar(n,po(s)),yield*o.pipe(I(a=>yn(s,a)),$t({disableYield:!0}),Jn(a=>Yt(s,a)),Nt(n)),_s(s)}))),o2=l(2,(e,t)=>ke(Se(function*(r,n){let o=yield*he(e)(r,n),s=yield*Pn({capacity:t.capacity===\"unbounded\"?void 0:t.capacity,strategy:t.capacity===\"unbounded\"?void 0:t.strategy});return yield*ar(n,po(s)),yield*o.pipe(I(a=>Ki(s,a)),$t({disableYield:!0}),Jn(a=>Yt(s,a)),Nt(n)),Ku(s)}))),s2=l(2,(e,t)=>cg(e,Qt(g(I(t,ee))),{haltStrategy:\"either\"})),a2=l(2,(e,t)=>xo(Se(function*(r,n,o){let s=yield*he(e)(r,n),a=yield*Nt(t,o,{startImmediately:!0});return $(()=>{let i=a.pollUnsafe();return i===void 0?s:ib(i,{onFailure:it,onSuccess:ee})})}))),i2=l(2,(e,t)=>qp(e,r=>xs(r)?t(r.cause):Y)),qp=l(2,(e,t)=>xo((r,n,o)=>Lo(o,t).pipe(mr(he(e)(r,n))))),c2=l(2,(e,t)=>Ea(Ft(t,e))),Yw=l(2,(e,t)=>ho(e,r=>te(()=>{let n=!0,o=Pr(r,s=>(n=!1,t(s)));return $(()=>n?o:r)}))),u2=l(2,(e,t)=>ho(e,r=>g(Xe(r,n=>I(t,()=>ee(n)))))),f2=l(2,(e,t)=>qp(e,r=>t)),Gi=(e,t,r)=>$(()=>{let n=An(),o=he(e)(ee(),n);return Xe(I(o,t),r||g).pipe(cn(s=>Le(n,s)))});var ug=l(2,(e,t)=>ke((r,n)=>j(vn(he(e)(r,n),t),vn(t)))),fg=l(3,(e,t,r)=>ke((n,o)=>j(jo(he(e)(n,o),t,r),jo(t,r)))),lg=l(3,(e,t,r)=>ke((n,o)=>I(r,s=>he(fg(e,t,s))(n,o)))),l2=l(e=>ir(e[0]),(e,t,r)=>Mf(t)?ug(e,t):ke((n,o)=>I(r?.local?xl(t,hl(),o):Fm(t,o),s=>j(vn(he(e)(n,o),s),vn(s))))),p2=l(2,(e,t)=>ke((r,n)=>Pl(o=>{let s=t(o);return he(ug(e,s))(r,n)})));var Qw=function(){let e=ir(arguments[0]),t=e?arguments[1]:arguments[0],r=Js(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return u1(n,t,r)}return n=>u1(n,t,r)},u1=(e,t,r)=>uY(Zb(t,r),n=>fg(e,Za,n),(n,o)=>an(s=>{let a=s.getRef(Nr),i=s.getRef(JO);return Am(n,o,a,i)}));var d2=e=>Gi(e,t=>$t(t,{disableYield:!0})),Vi=l(2,(e,t)=>Gi(e,r=>$t(I(r,t),{disableYield:!0}))),m2=l(2,(e,t)=>Gi(e,r=>r.pipe(I(t),I(n=>n?Y:ee()),$t({disableYield:!0})))),Xw=e=>j(Zi(e,()=>({bytes:0,arrays:[]}),(t,r)=>{for(let n=0;n{let n=new Uint8Array(r),o=0;for(let s=0;s$(()=>{let t=v();return Gi(e,r=>r.pipe(Vm,I(n=>(t=n,ee()))),()=>g(t))}),x2=e=>$(()=>{let t=Symbol(),r=t;return Gi(e,n=>$t(I(n,o=>(r=o,Y)),{disableYield:!0}),()=>r===t?ra:Nb(r))}),Zi=l(3,(e,t,r)=>$(()=>{let n=t();return Gi(e,o=>Wn({while:Er,body:()=>o,step:s=>{n=r(n,s)}}),()=>g(n))})),g2=l(3,(e,t,r)=>$(()=>{let n=t();return Gi(e,o=>Wn({while:Er,body:je(o.pipe(I(s=>r(n,s)),j(s=>{n=s}))),step:Un}),()=>g(n))})),e0=Se(function*(e){let t=eg(1),r=yield*li(),n=Fe(r,_r);return(yield*he(e)(ee(),n)).pipe(vn(r),t.withPermits(1))},xt(e=>g(it(e)))),Xo=(e,t)=>he(e)(ee(),t);var t0=l(e=>ir(e[0]),(e,t)=>zo(r=>Vi(e,n=>Ki(t,n)).pipe(r,kn,I(n=>(Ke(n)?Yx(t):ba(t,n.cause),Y)))));var y2=l(e=>ir(e[0]),Se(function*(e,t){let r=yield*pi,n=yield*Pn({capacity:typeof t.capacity==\"number\"?t.capacity:void 0,strategy:typeof t.capacity==\"number\"?t.strategy:void 0});return yield*ar(r,po(n)),yield*Nt(t0(e,n),r),n}));var S2=e=>di(e.capacity===\"unbounded\"?qx(e):e.strategy===\"dropping\"?jx(e):e.strategy===\"sliding\"?zx(e):Bx(e),Lp),b2=l(2,Se(function*(e,t){let r=yield*S2(t);return yield*Vc(r0(e,r,{shutdownOnEnd:t.shutdownOnEnd!==!1})),r})),r0=l(e=>ir(e[0]),(e,t,r)=>Vi(e,n=>GD(t,n)).pipe(r?.shutdownOnEnd===!0?mi(Lp(t)):R)),E2=l(2,Se(function*(e,t){let r=yield*S2(t);return yield*Vi(e,n=>Wx(r,n)).pipe(cn(n=>Hx(r,n)),Vc),r}));var Mr={};Eo(Mr,{Array:()=>OX,Boolean:()=>RX,ByteSize:()=>MX,ConfigError:()=>nf,Date:()=>LX,Duration:()=>PX,Finite:()=>CX,Int:()=>AX,Literal:()=>kX,Literals:()=>vX,LogLevel:()=>NX,NonEmptyString:()=>TX,Number:()=>wX,Port:()=>FX,Record:()=>_X,Redacted:()=>UX,String:()=>IX,URL:()=>DX,all:()=>JL,fail:()=>bX,flatMap:()=>lX,isConfig:()=>HL,map:()=>WL,mapEffect:()=>pX,nested:()=>$X,option:()=>mX,orElse:()=>dX,schema:()=>Xt,succeed:()=>EX,unwrap:()=>GL,withDefault:()=>KL});var rf={};Eo(rf,{ConfigProvider:()=>ec,SourceError:()=>gg,constantCase:()=>G7,fromDir:()=>uX,fromDotEnv:()=>cX,fromDotEnvContents:()=>$L,fromEnv:()=>LL,fromEnvRecord:()=>A0,fromUnknown:()=>Q7,layer:()=>Z7,layerAdd:()=>Y7,make:()=>Sg,makeArray:()=>w0,makeRecord:()=>yg,makeValue:()=>Gp,mapInput:()=>C0,nested:()=>V7,orElse:()=>T0});var I2=\"~effect/PlatformError\",Yu=class extends Fr(\"BadArgument\"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:\"\"}`}};var T2=class extends Fr(\"PlatformError\"){constructor(t){\"cause\"in t?super({reason:t,cause:t.cause}):super({reason:t})}[I2]=I2;get message(){return this.reason.message}};var xY=\"~effect/Stream\",gY={_R:R,_E:R,_A:R},w2=function(e){this.channel=e};w2.prototype={[xY]:gY,pipe(){return Z(this,arguments)}};var C2=e=>new w2(e);var SY=\"~effect/Sink\";var bY={_A:R,_In:R,_L:R,_E:R,_R:R},EY={[SY]:bY,pipe(){return Z(this,arguments)}};var IY=e=>{let t=Object.create(EY);return t.transform=e,t},A2=e=>ke((t,r)=>g(I(e.transform(t,r),ee)));var k2=e=>{let t=rt(e);return IY(r=>{let n=[];if(t===0)return g([n]);let o;return r.pipe(I(s=>{if(n.length+s.length<=t)return n.push(...s),n.length===t?ee():Y;for(let a=0;ag([n,o])))})};var es={};Eo(es,{DefaultChunkSize:()=>j2,Do:()=>l7,TypeId:()=>B2,accumulate:()=>G9,aggregate:()=>B9,aggregateWithin:()=>h0,as:()=>rQ,bind:()=>d7,bindEffect:()=>m7,bindTo:()=>h7,broadcast:()=>hL,broadcastN:()=>j9,buffer:()=>KQ,bufferArray:()=>GQ,callback:()=>H2,catch:()=>Kp,catchCause:()=>tL,catchCauseFilter:()=>o9,catchCauseIf:()=>n9,catchDefect:()=>VQ,catchFilter:()=>d0,catchIf:()=>nL,catchReason:()=>e9,catchReasons:()=>t9,catchTag:()=>QQ,catchTags:()=>XQ,changes:()=>V9,changesWith:()=>xL,changesWithEffect:()=>Z9,chunks:()=>fL,collect:()=>K9,combine:()=>T9,combineArray:()=>w9,concat:()=>ef,cross:()=>AQ,crossWith:()=>X2,debounce:()=>_9,decodeText:()=>Y9,die:()=>LY,drain:()=>lQ,drainFork:()=>pQ,drop:()=>m0,dropRight:()=>b9,dropUntil:()=>g9,dropUntilEffect:()=>y9,dropWhile:()=>cL,dropWhileEffect:()=>uL,dropWhileFilter:()=>S9,empty:()=>Ps,encodeText:()=>Q9,ensuring:()=>a7,fail:()=>Qu,failCause:()=>W2,failCauseSync:()=>$Y,failSync:()=>DY,filter:()=>$Q,filterEffect:()=>jQ,filterMap:()=>BQ,filterMapEffect:()=>zQ,flatMap:()=>tf,flatten:()=>Z2,flattenArray:()=>fQ,flattenEffect:()=>oQ,flattenIterable:()=>yQ,flattenTake:()=>SQ,forever:()=>gQ,fromArray:()=>dg,fromArrayEffect:()=>qY,fromArrays:()=>HY,fromAsyncIterable:()=>KY,fromChannel:()=>k,fromEffect:()=>pg,fromEffectDrain:()=>z2,fromEffectRepeat:()=>q2,fromEffectSchedule:()=>MY,fromEventListener:()=>ZY,fromIterable:()=>Qi,fromIterableEffect:()=>jY,fromIterableEffectRepeat:()=>zY,fromIteratorSucceed:()=>BY,fromPubSub:()=>WY,fromPubSubTake:()=>J2,fromPull:()=>yo,fromQueue:()=>Xu,fromReadableStream:()=>JY,fromSchedule:()=>GY,fromSubscription:()=>VY,groupAdjacentBy:()=>L9,groupBy:()=>U9,groupByKey:()=>D9,grouped:()=>F9,groupedWithin:()=>N9,haltWhen:()=>n7,ignore:()=>c9,ignoreCause:()=>u9,interleave:()=>t7,interleaveWith:()=>yL,interruptWhen:()=>r7,intersperse:()=>gL,intersperseAffixes:()=>e7,isStream:()=>Ee,iterate:()=>QY,let:()=>p7,limitBytes:()=>d9,make:()=>NY,map:()=>Kr,mapAccum:()=>C9,mapAccumArray:()=>Xi,mapAccumArrayEffect:()=>k9,mapAccumEffect:()=>A9,mapArray:()=>G2,mapArrayEffect:()=>sQ,mapBoth:()=>nQ,mapEffect:()=>Jp,mapError:()=>oL,merge:()=>c0,mergeAll:()=>CQ,mergeEffect:()=>mg,mergeLeft:()=>TQ,mergeResult:()=>IQ,mergeRight:()=>wQ,mkArrayBuffer:()=>A7,mkString:()=>C7,mkUint8Array:()=>k7,never:()=>eQ,onEnd:()=>s7,onError:()=>o7,onExit:()=>SL,onFirst:()=>EL,onStart:()=>bL,orDie:()=>i9,orElseIfEmpty:()=>s9,orElseSucceed:()=>a9,paginate:()=>YY,partition:()=>HQ,partitionEffect:()=>qQ,partitionQueue:()=>l0,peel:()=>JQ,pipeThrough:()=>J9,pipeThroughChannel:()=>H9,pipeThroughChannelOrFail:()=>W9,prepend:()=>EQ,provide:()=>IL,provideContext:()=>i7,provideService:()=>c7,provideServiceEffect:()=>x0,race:()=>LQ,raceAll:()=>eL,range:()=>XY,rechunk:()=>lL,repeat:()=>dQ,repeatElements:()=>xQ,result:()=>aQ,retry:()=>f9,run:()=>wL,runCollect:()=>CL,runCount:()=>x7,runDrain:()=>xg,runFold:()=>y7,runFoldEffect:()=>S7,runForEach:()=>I7,runForEachArray:()=>AL,runForEachWhile:()=>T7,runHead:()=>b7,runIntoPubSub:()=>P7,runIntoQueue:()=>N7,runLast:()=>E7,runSum:()=>g7,scan:()=>v9,scanEffect:()=>O9,schedule:()=>mQ,scoped:()=>tQ,service:()=>RY,serviceOption:()=>PY,share:()=>q9,sliding:()=>E9,slidingSize:()=>pL,split:()=>I9,splitLines:()=>X9,succeed:()=>Yi,suspend:()=>Jr,switchMap:()=>uQ,sync:()=>UY,take:()=>p9,takeRight:()=>m9,takeUntil:()=>sL,takeUntilEffect:()=>aL,takeWhile:()=>iL,takeWhileEffect:()=>x9,takeWhileFilter:()=>h9,tap:()=>V2,tapBoth:()=>iQ,tapCause:()=>rL,tapDefect:()=>YQ,tapError:()=>p0,tapErrorTag:()=>ZQ,tapSink:()=>cQ,throttle:()=>M9,throttleEffect:()=>dL,tick:()=>FY,timeout:()=>hQ,timeoutOrElse:()=>Y2,toAsyncIterable:()=>R7,toAsyncIterableEffect:()=>_7,toAsyncIterableWith:()=>y0,toChannel:()=>Mn,toPubSub:()=>M7,toPubSubTake:()=>kL,toPull:()=>w7,toQueue:()=>F7,toReadableStream:()=>v7,toReadableStreamEffect:()=>O7,toReadableStreamWith:()=>g0,transduce:()=>$9,transformPull:()=>Ut,transformPullBracket:()=>i0,unfold:()=>K2,unwrap:()=>Ia,unwrapReason:()=>r9,updateContext:()=>TL,updateService:()=>u7,when:()=>WQ,withExecutionPlan:()=>l9,withSpan:()=>f7,zip:()=>vQ,zipFlatten:()=>RQ,zipLatest:()=>UQ,zipLatestAll:()=>f0,zipLatestWith:()=>DQ,zipLeft:()=>OQ,zipRight:()=>_Q,zipWith:()=>u0,zipWithArray:()=>hg,zipWithIndex:()=>PQ,zipWithNext:()=>MQ,zipWithPrevious:()=>FQ,zipWithPreviousAndNext:()=>NQ});var O2=\"~effect/RcMap\",TY=e=>({[O2]:O2,lookup:e.lookup,context:e.context,scope:e.scope,idleTimeToLive:e.idleTimeToLive,capacity:e.capacity,state:{_tag:\"Open\",map:Fp()},pipe(){return Z(this,arguments)}}),_2=e=>an(t=>{let r=t.context,n=Fe(r,_r),o=TY({lookup:e.lookup,context:r,scope:n,idleTimeToLive:typeof e.idleTimeToLive==\"function\"?Y0(e.idleTimeToLive,We):je(We(e.idleTimeToLive??qs)),capacity:Math.max(e.capacity??Number.POSITIVE_INFINITY,0)});return Ft(Lo(n,()=>{if(o.state._tag===\"Closed\")return Y;let s=o.state.map;return o.state={_tag:\"Closed\"},ta(s,([,a])=>kn(Hp(a))).pipe(Pr(()=>te(()=>{_x(s)})))}),o)}),o0=l(2,(e,t)=>zo(r=>{if(e.state._tag===\"Closed\")return On;let n=e.state,o=Hu(),s=Yo(n.map,t),a;if(s._tag===\"Some\")a=s.value,a.refCount++;else{if(Number.isFinite(e.capacity)&&LD(e.state.map)>=e.capacity)return P(new nb(`RcMap attempted to exceed capacity of ${e.capacity}`));{a={deferred:si(),scope:An(),idleTimeToLive:e.idleTimeToLive(t),finalizer:void 0,fiber:void 0,expiresAt:0,refCount:1},a.finalizer=CY(e,t,a),Np(n.map,t,a);let c=new Map(e.context.mapUnsafe);o.context.mapUnsafe.forEach((f,p)=>{c.set(p,f)}),c.set(_r.key,a.scope);let u=_o(c);$(()=>e.lookup(t)).pipe(_n(u),ya(a.scope)).addObserver(f=>{ab(f)&&wY(e,t,a,u),Do(a.deferred,f)})}}let i=Ro(o.context,_r);return ar(i,a.finalizer).pipe(mr(r(_m(a.deferred))))}));var wY=(e,t,r,n)=>{if(e.state._tag===\"Closed\")return;let o=Yo(e.state.map,t);o._tag===\"None\"||o.value!==r||(qu(e.state.map,t),!(r.refCount>0)&&Hp(r).pipe(_n(n),ya(e.scope)))},Hp=e=>e.fiber?fo(e.fiber).pipe(mr(Le(e.scope,ht))):Le(e.scope,ht),CY=(e,t,r)=>an(n=>{if(r.refCount--,r.refCount>0)return Y;if(e.state._tag===\"Closed\")return Hp(r);let o=Yo(e.state.map,t);if(o._tag===\"None\"||o.value!==r)return Hp(r);if(Ic(r.idleTimeToLive))return qu(e.state.map,t),Hp(r);if(!Ws(r.idleTimeToLive))return Y;let s=n.getRef(Lc);return r.expiresAt=s.currentTimeMillisUnsafe()+kr(r.idleTimeToLive),r.fiber?Y:(r.fiber=zo(function a(i){let c=s.currentTimeMillisUnsafe(),u=r.expiresAt-c;if(u<=0){if(e.state._tag===\"Closed\"||r.refCount>0)return Y;let f=Yo(e.state.map,t);return f._tag===\"None\"||f.value!==r?Y:(qu(e.state.map,t),Le(r.scope,ht))}return I(i(s.sleep(Hs(u))),()=>a(i))}).pipe(mi(te(()=>{r.fiber=void 0})),_n(n.context),ya(e.scope)),Y)});var s0=l(2,(e,t)=>hi(r=>{if(e.state._tag===\"Closed\")return Y;let n=Yo(e.state.map,t);if(n._tag===\"None\"||Ic(n.value.idleTimeToLive))return Y;let o=n.value;return o.expiresAt=r.currentTimeMillisUnsafe()+kr(o.idleTimeToLive),Y}));var AY=\"~effect/RcRef\",Wp={_tag:\"Empty\"},kY={_tag:\"Closed\"},vY={_A:R,_E:R},a0=class{[AY]=vY;pipe(){return Z(this,arguments)}state=Wp;acquire;context;scope;idleTimeToLive;constructor(t,r,n,o){this.acquire=t,this.context=r,this.scope=n,this.idleTimeToLive=o}},M2=e=>an(t=>{let r=t.context,n=Fe(r,_r),o=new a0(e.acquire,r,n,e.idleTimeToLive!==void 0?We(e.idleTimeToLive):void 0);return Ft(Lo(n,()=>{let s=o.state;return o.state=kY,s._tag===\"Acquired\"?Le(s.scope,ht):s._tag===\"Acquiring\"?fo(s.fiber):Y}),o)}),OY=(e,t)=>{switch(e.state._tag){case\"Closed\":return On;case\"Acquired\":{let r=e.state;return r.refCount++,r.fiber?Ft(fo(r.fiber),r):g(r)}case\"Acquiring\":{let r=e.state;return r.awaiters++,P2(e,r,t)}case\"Empty\":{let r={_tag:\"Acquiring\",fiber:void 0,awaiters:1,acquired:void 0};e.state=r;let n=An(),o=vn(e.acquire,Wt(e.context,_r,n)).pipe(I(s=>{if(e.state!==r)return On;let a={_tag:\"Acquired\",value:s,scope:n,fiber:void 0,refCount:r.awaiters,invalidated:!1};return e.state=a,r.acquired=a,g(a)}),cn(s=>Ke(s)?Y:(e.state===r&&(e.state=Wp),Le(n,s))));return r.fiber=_n(Hu().context)(o),P2(e,r,t)}}},P2=(e,t,r)=>cn(r(ga(t.fiber)),n=>{let o=t.acquired;return o!==void 0?xs(n)?N2(e,o):Y:--t.awaiters>0||e.state!==t?Y:(e.state=Wp,fo(t.fiber))}),F2=e=>{let t=e;return zo(r=>I(pi,n=>I(OY(t,r),o=>Ft(Lo(n,()=>N2(t,o)),o.value))))},N2=(e,t)=>{if(t.refCount--,t.refCount>0)return Y;let r=e.idleTimeToLive;return r===void 0||t.invalidated?(e.state===t&&(e.state=Wp),Le(t.scope,ht)):Ws(r)?(t.fiber=zo(n=>I(n(sa(r)),()=>e.state===t&&t.refCount===0?(e.state=Wp,Le(t.scope,ht)):Y)).pipe(mi(te(()=>{t.fiber=void 0})),_n(e.context),ya(e.scope)),Y):Y};var U2=M2,D2=F2;var B2=\"~effect/Stream\",Ee=e=>A(e,B2),j2=jp,k=C2,pg=e=>k(ng(j(e,be))),RY=e=>pg(Wb(e)),PY=e=>pg(Jb(e)),z2=e=>yo(g(I(e,()=>ee()))),q2=e=>yo(g(j(e,be))),MY=(e,t)=>yo(dr(function*(){let r=yield*Hn(t),n=yield*jo(e,Jt,Jt.defaultValue()),o=!0,s=$(()=>r(n)).pipe(I(a=>jo(e,Jt,a)),j(a=>(n=a,be(a))));return $(()=>o?(o=!1,g(be(n))):s)})),FY=e=>yo(te(()=>{let t=!0,r=g(be(void 0)),n=$b(r,e);return $(()=>t?(t=!1,r):n)})),yo=e=>k(Qt(e)),Ut=(e,t)=>k(ke((r,n)=>I(Xo(e.channel,n),o=>t(o,n)))),i0=(e,t)=>k(xo((r,n,o)=>I(Xo(e.channel,n),s=>t(s,n,o)))),Mn=e=>e.channel,H2=(e,t)=>k(l1(e,t)),Ps=k(Gu),Yi=e=>k(rg(be(e))),NY=(...e)=>dg(e),UY=e=>k(m1(()=>be(e()))),Jr=e=>k(tg(()=>e().channel)),Qu=e=>k(Qo(e)),DY=e=>k(x1(e)),W2=e=>k(zp(e)),LY=e=>k(Hw(e)),$Y=e=>k(g1(e)),BY=(e,t)=>k(qw(()=>e,t)),Qi=(e,t)=>Array.isArray(e)&&t?.chunkSize===void 0?dg(e):k(d1(e,t?.chunkSize)),jY=e=>Ia(j(e,Qi)),zY=e=>tf(q2(e),Qi),dg=e=>Qe(e)?k(rg(e)):Ps,qY=e=>Ia(j(e,dg)),HY=(...e)=>k(zw(Ld(e,Qe))),Xu=e=>k(S1(e)),WY=e=>k(b1(e)),J2=e=>k(E1(e)),JY=e=>k(I1(e)),KY=(e,t)=>k(T1(e,t)),GY=e=>yo(j(Il(e),t=>Xe(j(t(void 0),be),()=>ee()))),VY=e=>k(Jw(e)),ZY=(e,t,r)=>H2(n=>{let o=typeof r==\"object\"&&r.once;function s(a){Vx(n,a),o&&Yx(n)}return di(te(()=>e.addEventListener(t,s,r)),()=>te(()=>e.removeEventListener(t,s,r)))},{bufferSize:typeof r==\"object\"?r.bufferSize:void 0}),K2=(e,t)=>yo(te(()=>{let r=e;return I($(()=>t(r)),n=>n===void 0?ee():(r=n[1],g(be(n[0]))))})),YY=(e,t)=>yo(te(()=>{let r=e,n=!1;return $(function o(){return n?ee():I(t(r),([s,a])=>(ue(a)?n=!0:r=a.value,Qe(s)?g(s):o()))})})),QY=(e,t)=>K2(e,r=>g([r,t(r)])),XY=(e,t,r=jp)=>e>t?Ps:yo(te(()=>{let n=En(r),o=e,s=!1;return $(()=>{if(s)return ee();let a=t-o+1;if(a>n){let c=ly(o,o+n-1);return o+=n,g(c)}let i=ly(o,o+a-1);return s=!0,g(i)})})),eQ=k(h1),Ia=e=>k(Ea(j(e,Mn))),tQ=e=>k(r2(e.channel)),Kr=l(2,(e,t)=>Jr(()=>{let r=0;return k(go(e.channel,In(n=>t(n,r++))))})),rQ=l(2,(e,t)=>Kr(e,()=>t)),nQ=l(2,(e,t)=>e.pipe(Kr(t.onElement),oL(t.onError))),G2=l(2,(e,t)=>k(go(e.channel,t))),Jp=l(e=>Ee(e[0]),(e,t,r)=>e.channel.pipe(Sr,og(t,r),go(be),k)),oQ=l(e=>Ee(e[0]),(e,t)=>Jp(e,R,t)),sQ=l(2,(e,t)=>k(og(e.channel,t))),aQ=e=>e.pipe(Kr(B),Kp(t=>Yi(K(t)))),V2=l(e=>Ee(e[0]),(e,t,r)=>Jp(e,n=>Ft(t(n),n),r)),iQ=l(2,(e,t)=>e.pipe(p0(t.onError),V2(t.onElement,{concurrency:t.concurrency}))),cQ=l(2,(e,t)=>i0(e,Se(function*(r,n,o){let s=Wr(),a=Wr(),i,c,u=!1,f=!1,p=s.whenOpen($(()=>{if(i){let m=i;return i=void 0,f||s.closeUnsafe(),Ft(a.open,m)}return ee()}));yield*$(()=>t.transform(p,o)).pipe(m=>Gb(m,x=>(u=!0,xs(x)&&(c=x.cause),a.open),!0),Nt(o));let d=r.pipe(I(m=>(i=m,a.closeUnsafe(),s.openUnsafe(),Ft(a.await,m))),Xe(()=>(f=!0,a.closeUnsafe(),s.openUnsafe(),I(a.await,()=>ee()))));return $(()=>c?it(c):u?r:d)}))),tf=l(e=>Ee(e[0]),(e,t,r)=>e.channel.pipe(Sr,Kw(n=>t(n).channel,r),k)),uQ=l(e=>Ee(e[0]),(e,t,r)=>e.channel.pipe(Sr,X1(n=>t(n).channel,r),k)),Z2=l(e=>Ee(e[0]),(e,t)=>tf(e,R,t)),fQ=e=>k(Sr(e.channel)),lQ=e=>k(_1(e.channel)),pQ=l(2,(e,t)=>mg(e,xg(t))),dQ=l(2,(e,t)=>k(R1(e.channel,t))),mQ=l(2,(e,t)=>e.channel.pipe(Sr,F1(t),go(be),k)),hQ=l(2,(e,t)=>Y2(e,{duration:t,orElse:()=>Ps})),Y2=l(2,(e,t)=>{let r=We(t.duration);if(!Ws(r))return e;if(Ic(r))return Jr(t.orElse);let n=Symbol();return tL(Jr(()=>{let s=Hu().getRef(Lc),a=kr(r),i,c=Wr(!1);return c0(Ut(e,(u,f)=>$(()=>(i=s.currentTimeMillisUnsafe()+a,c.openUnsafe(),u)).pipe(j(p=>(c.closeUnsafe(),i=void 0,p)),g)),z2(dr(function*(){for(;;)if(yield*c.await,!(i===void 0||(yield*sa(i-s.currentTimeMillisUnsafe()),i===void 0)||i-s.currentTimeMillisUnsafe()>0))return yield*Rr(n)})),{haltStrategy:\"left\"})}),o=>o.reasons.find(a=>a._tag===\"Die\"&&a.defect===n)?t.orElse():W2(o))}),xQ=l(2,(e,t)=>k(ke((r,n)=>j(he(Sr(e.channel))(r,n),o=>{let s,a=dr(function*(){let i=yield*o,c=be(i);return s=(yield*Il(t))(i).pipe(Ft(c),Xe(f=>(s=void 0,a))),c});return $(()=>s??a)})))),gQ=e=>k(M1(e.channel)),yQ=e=>tf(e,Qi),SQ=e=>e.channel.pipe(Sr,O1,k),ef=l(2,(e,t)=>{let r=k(v1(p1(()=>bQ(e,t))));return Q2.set(r,[e,t]),r}),Q2=new WeakMap;function*bQ(e,t){let r=[t,e];for(;r.length>0;){let n=r.pop(),o=Q2.get(n);o===void 0?yield n.channel:r.push(o[1],o[0])}}var EQ=l(2,(e,t)=>ef(Qi(t),e)),c0=l(e=>Ee(e[0])&&Ee(e[1]),(e,t,r)=>k(cg(Mn(e),Mn(t),r))),mg=l(2,(e,t)=>e.channel.pipe(e2(t),k)),IQ=l(2,(e,t)=>c0(Kr(e,B),Kr(t,K))),TQ=l(2,(e,t)=>mg(e,xg(t))),wQ=l(2,(e,t)=>mg(t,xg(e))),CQ=l(2,(e,t)=>Z2(Qi(e),t)),AQ=l(2,(e,t)=>X2(e,t,(r,n)=>[r,n])),X2=l(3,(e,t,r)=>tf(e,n=>Kr(t,o=>r(n,o)))),u0=l(3,(e,t,r)=>hg(e,t,kQ(r))),kQ=e=>(t,r)=>{let n=Math.min(t.length,r.length),o=[];for(let s=0;sk(xo(Se(function*(n,o){let s=yield*Xo(e.channel,o),a=yield*Xo(t.channel,o),i=dr(function*(){let f=yield*Nt(s,o),p=yield*Nt(a,o);return yield*BD([f,p])}),c={_tag:\"PullBoth\"};return dr(function*(){let[f,p]=c._tag===\"PullBoth\"?yield*i:c._tag===\"PullLeft\"?[yield*s,c.rightArray]:[c.leftArray,yield*a],d=r(f,p);return Qe(d[1])?c={_tag:\"PullRight\",leftArray:d[1]}:Qe(d[2])?c={_tag:\"PullLeft\",rightArray:d[2]}:c={_tag:\"PullBoth\"},d[0]})})))),vQ=l(2,(e,t)=>u0(e,t,(r,n)=>[r,n])),OQ=l(2,(e,t)=>hg(e,t,(r,n)=>{let o=Math.min(r.length,n.length),s=r.slice(0,o),a=r.slice(o),i=n.slice(o);return[s,a,i]})),_Q=l(2,(e,t)=>hg(e,t,(r,n)=>{let o=Math.min(r.length,n.length),s=n.slice(0,o),a=r.slice(o),i=n.slice(o);return[s,a,i]})),RQ=l(2,(e,t)=>u0(e,t,(r,n)=>[...r,n])),PQ=e=>Kr(e,(t,r)=>[t,r]),MQ=e=>Xi(e,v,(t,r)=>{let n=0;t._tag===\"None\"&&(n=1,t=O(r[0]));let o=Rt();for(;nXi(e,v,(t,r)=>{let n=Rt();for(let o=0;oXi(e,()=>({prev:v(),current:v()}),(t,r)=>{let n=0,o;t.current._tag===\"None\"?(n=1,o=r[0],t.current=O(o)):o=t.current.value;let s=Rt();for(;nk(tg(()=>{let t=[],r=new Set,n=Wr();return ig(zw(e.map((o,s)=>o.channel.pipe(Sr,og(a=>(t[s]=a,r.has(s)?g(be(t.slice())):(r.add(s),r.sizef0(e,t)),DQ=l(3,(e,t,r)=>Kr(f0(e,t),([n,o])=>r(n,o))),eL=(...e)=>k(ke((t,r)=>te(()=>{let n,o=Bb(e.map(s=>{let a=Mt(r);return Xo(s.channel,a).pipe(I(i=>Db(g(i),i)),cn(i=>i._tag===\"Success\"?n?Le(a,i):(n=i.value[0],Y):Le(a,i)),j(([,i])=>i))}));return $(()=>n??o)}))),LQ=l(2,(e,t)=>eL(e,t)),$Q=l(2,(e,t)=>k(U1(Mn(e),t))),BQ=l(2,(e,t)=>k(D1(Mn(e),t))),jQ=l(2,(e,t)=>k(L1(Mn(e),t))),zQ=l(2,(e,t)=>k($1(Mn(e),t))),l0=l(e=>Ee(e[0]),Se(function*(e,t,r){let n=yield*pi,o=yield*Xo(e.channel,n),s=r?.capacity===\"unbounded\"?void 0:r?.capacity??j2,a=yield*Pn({capacity:s}),i=yield*Pn({capacity:s});return yield*dr(function*(){for(;;){let c=yield*o,u=[],f=[];for(let d=0;d0){let d=Zx(a,f);d.length>0&&(p=yield*Gc(Ki(a,d)))}if(u.length>0){let d=Zx(i,u);d.length>0&&(yield*Ki(i,d))}p&&(yield*ga(p))}}).pipe(Jn(c=>(ba(a,c),ba(i,c),Y)),Nt(n)),[a,i]})),qQ=l(e=>Ee(e[0]),(e,t,r)=>j(l0(Jp(e,n=>t(n),r),n=>n,r),([n,o])=>[Xu(n),Xu(o)])),HQ=l(e=>Ee(e[0]),(e,t,r)=>j(l0(e,t,{capacity:r?.capacity??16}),([n,o])=>[Xu(n),Xu(o)])),WQ=l(2,(e,t)=>t.pipe(j(r=>r?e:Ps),Ia)),JQ=l(2,Se(function*(e,t){let r,n=yield*e0(e.channel),o=xt(n,i=>(r=i,it(i))),s=yo(g(o)),a=yield*wL(s,t);return r?[a,Ps]:(s=yo(g(n)),[a,s])})),KQ=l(2,(e,t)=>k(o2(e.channel,t))),GQ=l(2,(e,t)=>k(n2(e.channel,t))),tL=l(2,(e,t)=>e.channel.pipe(Zu(r=>t(r).channel),k)),VQ=l(2,(e,t)=>e.channel.pipe(j1(r=>t(r).channel),k)),rL=l(2,(e,t)=>e.channel.pipe(sg(t),k)),Kp=l(2,(e,t)=>k(mo(e.channel,r=>t(r).channel)));var p0=l(2,(e,t)=>e.channel.pipe(q1(t),k)),ZQ=l(3,(e,t,r)=>{let n=Array.isArray(t)?o=>A(o,\"_tag\")&&t.includes(o._tag):Ct(t);return p0(e,o=>n(o)?r(o):Y)}),YQ=l(2,(e,t)=>rL(e,r=>{let n=ll(r);return at(n)?t(n.success):Y})),nL=l(e=>Ee(e[0]),(e,t,r,n)=>k(H1(Mn(e),t,o=>r(o).channel,n&&(o=>n(o).channel)))),d0=l(e=>Ee(e[0]),(e,t,r,n)=>k(W1(Mn(e),t,o=>r(o).channel,n&&(o=>n(o).channel)))),QQ=l(e=>Ee(e[0]),(e,t,r,n)=>{let o=Array.isArray(t)?s=>A(s,\"_tag\")&&t.includes(s._tag):Ct(t);return nL(e,o,r,n)}),XQ=l(e=>Ee(e[0]),(e,t,r)=>{let n;return d0(e,o=>(n??=Object.keys(t),A(o,\"_tag\")&&jm(o._tag)&&n.includes(o._tag)?B(o):K(o)),o=>t[o._tag](o),r)}),e9=l(e=>Ee(e[0]),(e,t,r,n,o)=>k(J1(Mn(e),t,r,(s,a)=>n(s,a).channel,o&&((s,a)=>o(s,a).channel)))),t9=l(e=>Ee(e[0]),(e,t,r,n)=>{let o=Object.create(null);for(let a of Object.keys(r)){let i=r[a];o[a]=(c,u)=>i(c,u).channel}let s=n&&((a,i)=>n(a,i).channel);return k(K1(e.channel,t,o,s))}),r9=l(2,(e,t)=>d0(e,r=>Ct(r,t)&&A(r,\"reason\")?B(r.reason):K(r),Qu)),oL=l(2,(e,t)=>k(G1(e.channel,t))),n9=l(3,(e,t,r)=>k(z1(e.channel,t,n=>r(n).channel))),o9=l(3,(e,t,r)=>k(ag(e.channel,t,(n,o)=>r(n,o).channel))),s9=l(2,(e,t)=>k(k1(e.channel,r=>Mn(t())))),a9=l(2,(e,t)=>Kp(e,r=>Yi(t(r)))),i9=e=>k(V1(e.channel)),c9=l(e=>Ee(e[0]),(e,t)=>k(Z1(e.channel,t))),u9=l(e=>Ee(e[0]),(e,t)=>k(Y1(e.channel,t))),f9=l(2,(e,t)=>k(Q1(e.channel,t))),$2=(e,t)=>Ia(j(Hn(t),r=>{let n=Jt.defaultValue(),o=()=>Kp(x0(e,Jt,te(()=>n)),s=>Ia(Xe(j(r(s),a=>(n=a,Ia(Ft(Ol,o())))),()=>g(Qu(s)))));return o()})),l9=l(e=>Ee(e[0]),(e,t,r)=>Jr(()=>{let n=r?.preventFallbackOnPartialStream??!1,o=0,s={attempt:0,stepIndex:0},a=x0(Nm,te(()=>(s={attempt:s.attempt+1,stepIndex:o},s))),i=r?.onEvent===void 0?void 0:Mb(r.onEvent,()=>s),c,u=i===void 0?R:d=>SL(bL(d,j(i.begin,m=>{c=m})),m=>$(()=>{if(c===void 0)return Y;let x=c;return c=void 0,i.end(x,m)})),f=v(),p=Jr(()=>{let d=t.steps[o];if(!d)return Qu(oy(f));let m=a(u(IL(e,d.provide))),x=!1;if(Oe(f)){let y=f.value,S=!1,w=m;m=Jr(()=>S?w:(S=!0,Qu(y))),m=$2(m,vl(d,!1))}else{let y=vl(d,!0);m=y?$2(m,y):m}return Kp(n?EL(m,y=>(x=!0,Y)):m,y=>(o++,n&&x?Qu(y):(f=O(y),p)))});return p})),p9=l(2,(e,t)=>{let r=rt(t);return r===0?Ps:sL(e,(n,o)=>o===r-1)}),d9=l(3,(e,t,r)=>Jr(()=>{let n=rh(t),o=BigInt(0),s=!1;return ef(iL(e,a=>{let i=o+BigInt(a.length);return i>n?(s=!0,!1):(o=i,!0)}),Jr(()=>s?r():Ps))})),m9=l(2,(e,t)=>{let r=rt(t);return r===0?Ps:Xi(e,Os,(n,o)=>(Mx(n,o),n.length>r&&Dp(n,n.length-r),[n,Rs]),{onHalt(n){return Sa(n)}})}),sL=l(e=>Ee(e[0]),(e,t,r)=>Ut(e,(n,o)=>te(()=>{let s=0,a=!1;return I($(()=>a?ee():n),c=>{let u=c.findIndex(f=>t(f,s++));if(u>=0){a=!0;let f=c.slice(0,r?.excludeLast?u:u+1);return Qe(f)?g(f):ee()}return g(c)})}))),aL=l(e=>Ee(e[0]),(e,t,r)=>Ut(e,(n,o)=>te(()=>{let s=0,a=!1;return dr(function*(){if(a)return yield*ee();let i=yield*n;for(let c=0;cUt(e,(r,n)=>te(()=>{let o=0,s=!1,a=I($(()=>s?ee():r),i=>{let c=[];for(let u=0;uUt(e,(r,n)=>te(()=>{let o=!1,s=I($(()=>o?ee():r),a=>{let i=[];for(let c=0;caL(e,(r,n)=>j(t(r,n),o=>!o),{excludeLast:!0})),m0=l(2,(e,t)=>{let r=rt(t);return r===0?e:Ut(e,(n,o)=>te(()=>{let s=0,a=n.pipe(I(i=>s>=r?g(i):(s+=i.length,s<=r?a:g(i.slice(r-s)))));return a}))}),g9=l(2,(e,t)=>m0(cL(e,(r,n)=>!t(r,n)),1)),y9=l(2,(e,t)=>m0(uL(e,(r,n)=>j(t(r,n),o=>!o)),1)),cL=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s=0,a=I(r,i=>{let c=i.findIndex(u=>!t(u,s++));return c===-1?a:(o=!1,g(i.slice(c)))});return $(()=>o?a:r)}))),S9=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s=I(r,a=>{let i=a.findIndex(c=>ce(t(c)));return i===-1?s:(o=!1,g(a.slice(i)))});return $(()=>o?s:r)}))),uL=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s=0,a=dr(function*(){for(;;){let i=yield*r;for(let c=0;co?a:r)}))),b9=l(2,(e,t)=>{let r=rt(t);return r===0?e:Ut(e,(n,o)=>te(()=>{let s=Os(),a=I(n,i=>{Fx(s,i);let c=s.length-r,u=Wi(s,c);return rr(u)?g(u):a});return a}))}),fL=e=>e.channel.pipe(go(be),k),lL=l(2,(e,t)=>(t=En(t),Ut(e,(r,n)=>te(()=>{let o=Rt(),s=0,a,i=!1;return $(function c(){if(i)return ee();if(a===void 0)return I(r,u=>{if(o.length===0&&u.length===t)return g(u);if(o.length+u.length{if(o.length===0)return ee();let c=o;return i=!0,o=[],g(c)}))})))),E9=l(2,(e,t)=>pL(e,t,1)),pL=l(3,(e,t,r)=>{let n=En(t),o=En(r);return Ut(e,(s,a)=>te(()=>{let i=null,c=Os(),u=!1,f=0,p=fi(s,{onSuccess(d){if(Fx(c,d),f>0){let x=c.length;Dp(c,f),f=Math.max(0,f-x)}if(c.length=n;)if(n===o)m.push(Wi(c,n));else{m.push(WD(c,n));let x=c.length;Dp(c,o),f=Math.max(0,o-x)}return g(m)},onFailure(d){return u&&Dp(c,n-o),c.length===0?it(d):(i=d,g(be(Sa(c))))}});return $(()=>i?it(i):p)}))}),I9=l(2,(e,t)=>Xi(e,Rt,(r,n)=>{let o=Rt();for(let s=0;sGw(Sr(e.channel),Sr(t.channel),r,n).pipe(go(be),k)),w9=l(4,(e,t,r,n)=>k(Gw(e.channel,t.channel,r,n))),C9=l(e=>Ee(e[0]),(e,t,r,n)=>k(Vu(e.channel,t,(o,s)=>{let a=Rt();for(let i=0;iEe(e[0]),(e,t,r,n)=>k(Vu(e.channel,t,(o,s)=>{let[a,i]=r(o,s);return o=a,[o,Qe(i)?be(i):Rs]},n?.onHalt?{onHalt(o){let s=n.onHalt(o);return Qe(s)?be(s):Rs}}:void 0))),Rs=Rt(),A9=l(e=>Ee(e[0]),(e,t,r,n)=>e.channel.pipe(Sr,Vu(t,(o,s)=>j(r(o,s),([a,i])=>[a,Qe(i)?be(i):Rt()]),n?.onHalt?{onHalt(o){let s=n.onHalt(o);return Qe(s)?be(s):Rs}}:void 0),k)),k9=l(e=>Ee(e[0]),(e,t,r,n)=>e.channel.pipe(Vu(t,(o,s)=>j(r(o,s),([a,i])=>[a,Qe(i)?be(i):Rs]),n?.onHalt?{onHalt(o){let s=n.onHalt(o);return Qe(s)?be(s):Rs}}:void 0),k)),v9=l(3,(e,t,r)=>Jr(()=>{let n=t();return ef(Yi(n),k(Vu(e.channel,()=>n,(o,s)=>{let a=Rt();for(let i=0;iJr(()=>e.channel.pipe(Sr,B1(t(),r),go(be),k))),_9=l(2,(e,t)=>Ut(e,Se(function*(r,n){let o=yield*Lc,s=kr(We(t)),a,i,c=1/0,u=Wr(),f=Wr(),p=Wr();yield*r.pipe(u.whenOpen,I(m=>(f.openUnsafe(),a=m,c=o.currentTimeMillisUnsafe()+s,Y)),$t({disableYield:!0}),Jn(m=>(i=m,c=o.currentTimeMillisUnsafe(),f.openUnsafe(),p.openUnsafe(),Y)),Nt(n));let d=$(function m(){let x=o.currentTimeMillisUnsafe(),y=c{if(o.currentTimeMillisUnsafe(){if(i){if(a){let m=g(be(Dd(a)));return a=void 0,m}return it(i)}return u.openUnsafe(),f.whenOpen(d)})}))),dL=l(2,(e,t)=>{let r=t.burst??0;return t.strategy===\"enforce\"?R9(e,t.cost,t.units,t.duration,r):P9(e,t.cost,t.units,t.duration,r)}),R9=(e,t,r,n,o)=>Ut(e,s=>hi(a=>{let i=kr(We(n)),c=r+o<0?Number.POSITIVE_INFINITY:r+o,u=r,f=a.currentTimeMillisUnsafe();return g(I(s,function p(d){return I(t(d),m=>{let x=a.currentTimeMillisUnsafe(),S=(x-f)/i,w=u+S*r,E=w<0?c:Math.min(w,c);return m<=E?(u=E-m,f=x,g(d)):I(s,p)})}))})),P9=(e,t,r,n,o)=>Ut(e,s=>hi(a=>{let i=kr(We(n)),c=r+o<0?Number.POSITIVE_INFINITY:r+o,u=r,f=a.monotonicTimeNanosUnsafe();return g(I(s,p=>I(t(p),d=>{let m=a.monotonicTimeNanosUnsafe(),y=Number(m-f)/1e6/i,S=u+y*r,E=Math.min(S,c)-d;if(E>=0)return u=E,f=m,g(p);let M=-E/r,_=Math.max(0,M*i);return _>0?I(sa(_),()=>(u=E,f=m,g(p))):(u=E,f=m,g(p))})))})),M9=l(2,(e,t)=>dL(e,{...t,cost:r=>g(t.cost(r))})),F9=l(2,(e,t)=>fL(lL(e,t))),N9=l(3,(e,t,r)=>h0(e,k2(En(t)),_b(r))),U9=l(e=>Ee(e[0]),(e,t,r)=>mL(e,Se(function*(n,o,s){for(let a=0;aEe(e[0]),(e,t,r)=>Jr(()=>{let n=Fp();return mL(e,Se(function*(o,s,a){for(let i=0;ii0(e,Se(function*(n,o,s){let a=yield*YD();yield*ar(o,po(a));let i=Fp(),c=yield*_2({lookup:u=>di(Pn({capacity:r?.bufferSize??4096}).pipe(Pr(f=>(Np(i,u,f),yn(a,[u,Xu(f)])))),f=>(qu(i,u),Dw(f))),idleTimeToLive:r?.idleTimeToLive??cs}).pipe(gs(s));return yield*Wn({while:Er,body:je(I(n,u=>t(u,c,i))),step:Un}).pipe(xt(u=>Yt(a,u)),Nt(o)),Ku(a)})),L9=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o,s,a=Rt(),i=r.pipe(I(u=>{for(let f=0;fc?ee():i),()=>{c=!0;let u=s;return s=void 0,u&&rr(u)?g(be([o,u])):ee()})}))),$9=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o,s,a=$(()=>{if(s!==void 0){let c=s;return s=void 0,g(c)}return r}).pipe(oa(c=>(o=hs(c),ee()))),i=j($(()=>t.transform(a,n)),([c,u])=>(s=u,be(c)));return $(()=>o||i)}))),B9=l(2,(e,t)=>h0(e,t,wl)),h0=l(3,(e,t,r)=>k(xo(Se(function*(n,o,s){let a=yield*Xo(e.channel,o),i=Wr(!1),c=Symbol(),u=yield*Pn({capacity:0});yield*a.pipe(i.whenOpen,I(h=>(i.closeUnsafe(),yn(u,h))),$t,xt(h=>Yt(u,h)),Nt(s));let f=yield*Lc,p=yield*El(r),d=Wr(!1),m=f.currentTimeMillisUnsafe(),x=0,y=v(),S,w=h=>(d.openUnsafe()&&(x=f.currentTimeMillisUnsafe()),g(h)),E=d.await.pipe(I(()=>p(m,y)),I(([,h])=>sa(h)),I(()=>yn(u,c)),Xe(()=>Dw(u)),I(()=>ui)),M=$(()=>{if(S!==void 0){let h=S;return S=void 0,w(h)}return u.state._tag===\"Open\"&&i.openUnsafe(),I(_s(u),h=>h===c?ee():w(h))}),_=I(([h,b])=>{if(d.isOpen())m+=f.currentTimeMillisUnsafe()-x;else if(u.state._tag===\"Done\")return ee();return y=O(h),S=b,g(be(h))});return $(()=>{if(u.state._tag===\"Done\"&&S===void 0)return u.state.exit;d.closeUnsafe();let h=_($(()=>t.transform(M,s)));return u.state._tag===\"Open\"?Kc(h,E):h})})))),j9=l(2,Se(function*(e,t){let r=rt(t.n),n=yield*z9(t),o=new Array(r),s=yield*_r;for(let a=0;aLe(i,u)),k)}return yield*Vi(e.channel,a=>Wx(n,a)).pipe(cn(a=>Hx(n,a)),Vc),o})),z9=e=>di(e.capacity===\"unbounded\"?qx(e):e.strategy===\"dropping\"?jx(e):e.strategy===\"sliding\"?zx(e):Bx(e),Lp),hL=l(2,(e,t)=>j(kL(e,t),J2)),q9=l(2,(e,t)=>j(U2({acquire:hL(e,t),idleTimeToLive:t.idleTimeToLive}),r=>Ia(D2(r)))),H9=l(2,(e,t)=>k(Vw(e.channel,t))),W9=l(2,(e,t)=>k(Zw(e.channel,t))),J9=l(2,(e,t)=>e.channel.pipe(Zw(A2(t)),A1(([r,n])=>n?rg(n):Gu),k)),K9=e=>pg(CL(e)),G9=e=>Xi(e,Rt,(t,r)=>{let n=py(t,r);return[n,[n]]}),V9=e=>xL(e,W),xL=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s;return I(r,function a(i){let c=[],u=0;for(o&&(o=!1,s=i[0],u=1,c.push(s));uUt(e,(r,n)=>te(()=>{let o=!0,s;return I(r,Se(function*a(i){let c=[],u=0;for(o&&(o=!1,s=i[0],u=1,c.push(s));uEe(e[0]),(e,t)=>Jr(()=>{let r=new TextDecoder(t?.encoding);return Kr(e,n=>r.decode(n,{stream:!0}))})),Q9=e=>Jr(()=>{let t=new TextEncoder;return Kr(e,r=>t.encode(r))}),X9=e=>e.channel.pipe(Vw(t2()),k),gL=l(2,(e,t)=>G2(e,(r,n)=>{let o=n===0?[]:[t],s=r.length-1;for(let a=0;aYi(t.start).pipe(ef(gL(e,t.middle)),ef(Yi(t.end)))),t7=l(2,(e,t)=>yL(e,t,Qi(oA([!0,!1])))),yL=l(3,(e,t,r)=>k(ke(Se(function*(n,o){let s=yield*he(Sr(r.channel))(n,o),a=Symbol(),i=!1,c=!1,u=(yield*he(Sr(e.channel))(n,o)).pipe(Xe(()=>(i=!0,g(a)))),f=(yield*he(Sr(t.channel))(n,o)).pipe(Xe(()=>(c=!0,g(a))));return dr(function*(){for(;;){if(i&&c)return yield*ee();let p=yield*s;if(p&&i||!p&&c)continue;let d=yield*p?u:f;if(d!==a)return be(d)}})})))),r7=l(2,(e,t)=>k(s2(e.channel,t))),n7=l(2,(e,t)=>k(a2(e.channel,t))),SL=l(2,(e,t)=>k(qp(e.channel,t))),o7=l(2,(e,t)=>k(i2(e.channel,t))),bL=l(2,(e,t)=>k(c2(e.channel,t))),EL=l(2,(e,t)=>k(Yw(e.channel,r=>t(r[0])))),s7=l(2,(e,t)=>k(u2(e.channel,t))),a7=l(2,(e,t)=>k(f2(e.channel,t))),IL=l(e=>Ee(e[0]),(e,t,r)=>k(l2(e.channel,t,r))),i7=l(2,(e,t)=>k(ug(e.channel,t))),c7=l(3,(e,t,r)=>k(fg(e.channel,t,r))),x0=l(3,(e,t,r)=>k(lg(e.channel,t,r))),TL=l(2,(e,t)=>k(p2(e.channel,t))),u7=l(3,(e,t,r)=>TL(e,n=>Wt(n,t,r(Fe(n,t))))),f7=function(){let e=Ee(arguments[0]),t=e?arguments[1]:arguments[0],r=Js(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return k(Qw(n.channel,t,r))}return n=>k(Qw(n.channel,t,r))},l7=Yi({}),p7=l(3,(e,t,r)=>Kr(e,n=>({...n,[t]:r(n)})));var d7=l(e=>Ee(e[0]),(e,t,r,n)=>tf(e,o=>Kr(r(o),s=>({...o,[t]:s})),n)),m7=l(e=>Ee(e[0]),(e,t,r,n)=>Jp(e,o=>j(r(o),s=>({...o,[t]:s})),n)),h7=l(2,(e,t)=>Kr(e,r=>({[t]:r}))),wL=l(2,(e,t)=>Kb(r=>Xo(e.channel,r).pipe(I(n=>t.transform(n,r)),j(([n])=>n)))),CL=e=>Zi(e.channel,()=>[],(t,r)=>{for(let n=0;nZi(e.channel,()=>0,(t,r)=>t+r.length),g7=e=>Zi(e.channel,()=>0,(t,r)=>{for(let n=0;nZi(e.channel,t,(n,o)=>{for(let s=0;sg2(e.channel,t,(n,o)=>{let s=0,a=n;return j(Wn({while:()=>sr(a,o[s]),step(i){a=i,s++}}),()=>a)})),b7=e=>j(h2(e.channel),_t(pA(0))),E7=e=>j(x2(e.channel),_t(Dd)),I7=l(2,(e,t)=>Vi(e.channel,r=>{let n=0;return Wn({while:()=>nt(r[n++]),step:Un})})),T7=l(2,(e,t)=>m2(e.channel,r=>{let n=!1,o=0;return j(Wn({while:()=>!n&&ot(r[o]),step(s){o++,s||(n=!0)}}),()=>!n)})),AL=l(2,(e,t)=>Vi(e.channel,t)),xg=e=>d2(e.channel),w7=e=>e0(e.channel),C7=e=>Zi(e.channel,()=>\"\",(t,r)=>t+r.join(\"\")),A7=e=>j(Xw(e.channel),t=>t.buffer),k7=e=>Xw(e.channel),g0=l(e=>Ee(e[0]),(e,t,r)=>{let n,o,s=Wr(!1);return new ReadableStream({start(a){o=Ml(vn(AL(e,i=>s.whenOpen(te(()=>{s.closeUnsafe();for(let c=0;c{i._tag===\"Failure\"?a.error(Om(i.cause)):a.close()})},pull(){return new Promise(a=>{n=a,s.openUnsafe()})},cancel(){if(o)return Yb(na(fo(o)))}},r?.strategy)}),v7=l(e=>Ee(e[0]),(e,t)=>g0(e,wr(),t)),O7=l(e=>Ee(e[0]),(e,t)=>j(li(),r=>g0(e,r,t))),y0=l(2,(e,t)=>({[Symbol.asyncIterator](){let r=Qb(t),n=_n(t),o=An(),s,a,i,c,u=p=>{if(c)return c;let d=i;return c=r(Ft(mr(d?fo(d):Y,Le(o,p)),{done:!0,value:void 0})),c},f=async p=>{try{await u(p)}catch(d){await r(Xb(\"Suppressed error while closing Stream async iterator\",d))}};return{async next(){if(c)return c;if(a){let m=a.next();if(!m.done)return m;a=void 0}let p=n(s??I(Xo(e.channel,o),m=>(s=m,m)));i=p;let d=await r($D(p));if(i===p&&(i=void 0),Ke(d))return a=d.value[Symbol.iterator](),a.next();if(ys(d.cause))return u(ht);if(c&&QS(d.cause))return c;throw await f(d),Om(d.cause)},return(){return u(ht)},async throw(p){throw await f(ob(p)),p}}}})),_7=e=>j(li(),t=>y0(e,t)),R7=e=>y0(e,wr()),P7=l(e=>Ee(e[0]),(e,t,r)=>r0(e.channel,t,r)),M7=l(2,(e,t)=>b2(e.channel,t)),kL=l(2,(e,t)=>E2(e.channel,t)),F7=l(2,(e,t)=>y2(e.channel,t)),N7=l(2,(e,t)=>t0(e.channel,t));var S0=fr(\"effect/FileSystem\");var OL=\"~effect/Path\",E0=fr(\"effect/Path\");function _L(e,t){let r=\"\",n=0,o=-1,s=0,a;for(let i=0;i<=e.length;++i){if(i2){let c=r.lastIndexOf(\"/\");if(c!==r.length-1){c===-1?(r=\"\",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf(\"/\")),o=i,s=0;continue}}else if(r.length===2||r.length===1){r=\"\",n=0,o=i,s=0;continue}}t&&(r.length>0?r+=\"/..\":r=\"..\",n=2)}else r.length>0?r+=\"/\"+e.slice(o+1,i):r=e.slice(o+1,i),n=i-o-1;o=i,s=0}else a===46&&s!==-1?++s:s=-1}return r}function U7(e,t){let r=t.dir||t.root,n=t.base||(t.name||\"\")+(t.ext||\"\");return r?r===t.root?r+n:r+e+n:n}function D7(e){if(e.protocol!==\"file:\")return P(new Yu({module:\"Path\",method:\"fromFileUrl\",description:\"URL must be of scheme file\"}));if(e.hostname!==\"\")return P(new Yu({module:\"Path\",method:\"fromFileUrl\",description:\"Invalid file URL host\"}));let t=e.pathname;for(let r=0;r=-1&&!r;o--){let s;if(o>=0)s=arguments[o];else{let a=globalThis.process;n===void 0&&\"process\"in globalThis&&typeof a==\"object\"&&a!==null&&typeof a.cwd==\"function\"&&(n=a.cwd()),s=n}s.length!==0&&(t=s+\"/\"+t,r=s.charCodeAt(0)===47)}return t=_L(t,!r),r?t.length>0?\"/\"+t:\"/\":t.length>0?t:\".\"},L7=47;function $7(e){let t=new URL(\"file://\"),r=RL(e);return e.charCodeAt(e.length-1)===L7&&r[r.length-1]!==\"/\"&&(r+=\"/\"),t.pathname=W7(r),g(t)}var B7=/%/g,j7=/\\\\/g,z7=/\\n/g,q7=/\\r/g,H7=/\\t/g;function W7(e){return e.includes(\"%\")&&(e=e.replace(B7,\"%25\")),e.includes(\"\\\\\")&&(e=e.replace(j7,\"%5C\")),e.includes(`\n`)&&(e=e.replace(z7,\"%0A\")),e.includes(\"\\r\")&&(e=e.replace(q7,\"%0D\")),e.includes(\"\t\")&&(e=e.replace(H7,\"%09\")),e}var b0=E0.of({[OL]:OL,resolve:RL,normalize(e){if(e.length===0)return\".\";let t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=_L(e,!t),e.length===0&&!t&&(e=\".\"),e.length>0&&r&&(e+=\"/\"),t?\"/\"+e:e},isAbsolute(e){return e.length>0&&e.charCodeAt(0)===47},join(){if(arguments.length===0)return\".\";let e;for(let t=0;t0&&(e===void 0?e=r:e+=\"/\"+r)}return e===void 0?\".\":b0.normalize(e)},relative(e,t){if(e===t||(e=b0.resolve(e),t=b0.resolve(t),e===t))return\"\";let r=1;for(;rc){if(t.charCodeAt(s+f)===47)return t.slice(s+f+1);if(f===0)return t.slice(s+f)}else o>c&&(e.charCodeAt(r+f)===47?u=f:f===0&&(u=0));break}let d=e.charCodeAt(r+f),m=t.charCodeAt(s+f);if(d!==m)break;d===47&&(u=f)}let p=\"\";for(f=r+u+1;f<=n;++f)(f===n||e.charCodeAt(f)===47)&&(p.length===0?p+=\"..\":p+=\"/..\");return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},dirname(e){if(e.length===0)return\".\";let t=e.charCodeAt(0),r=t===47,n=-1,o=!0;for(let s=e.length-1;s>=1;--s)if(t=e.charCodeAt(s),t===47){if(!o){n=s;break}}else o=!1;return n===-1?r?\"/\":\".\":r&&n===1?\"//\":e.slice(0,n)},basename(e,t){let r=0,n=-1,o=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return\"\";let a=t.length-1,i=-1;for(s=e.length-1;s>=0;--s){let c=e.charCodeAt(s);if(c===47){if(!o){r=s+1;break}}else i===-1&&(o=!1,i=s+1),a>=0&&(c===t.charCodeAt(a)?--a===-1&&(n=s):(a=-1,n=i))}return r===n?n=i:n===-1&&(n=e.length),e.slice(r,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?\"\":e.slice(r,n)}},extname(e){let t=-1,r=0,n=-1,o=!0,s=0;for(let a=e.length-1;a>=0;--a){let i=e.charCodeAt(a);if(i===47){if(!o){r=a+1;break}continue}n===-1&&(o=!1,n=a+1),i===46?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||n===-1||s===0||s===1&&t===n-1&&t===r+1?\"\":e.slice(t,n)},format:function(t){if(t===null||typeof t!=\"object\")throw new TypeError('The \"pathObject\" argument must be of type Object. Received type '+typeof t);return U7(\"/\",t)},parse(e){let t={root:\"\",dir:\"\",base:\"\",ext:\"\",name:\"\"};if(e.length===0)return t;let r=e.charCodeAt(0),n=r===47,o;n?(t.root=\"/\",o=1):o=0;let s=-1,a=0,i=-1,c=!0,u=e.length-1,f=0;for(;u>=o;--u){if(r=e.charCodeAt(u),r===47){if(!c){a=u+1;break}continue}i===-1&&(c=!1,i=u+1),r===46?s===-1?s=u:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||i===-1||f===0||f===1&&s===i-1&&s===a+1?i!==-1&&(a===0&&n?t.base=t.name=e.slice(1,i):t.base=t.name=e.slice(a,i)):(a===0&&n?(t.name=e.slice(1,s),t.base=e.slice(1,i)):(t.name=e.slice(a,s),t.base=e.slice(a,i)),t.ext=e.slice(s,i)),a>0?t.dir=e.slice(0,a-1):n&&(t.dir=\"/\"),t},sep:\"/\",fromFileUrl:D7,toFileUrl:$7,toNamespacedPath:R});function Gp(e){return{_tag:\"Value\",value:e}}function yg(e,t){return{_tag:\"Record\",keys:e,value:t}}function w0(e,t){return{_tag:\"Array\",length:e,value:t}}var gg=class extends Fr(\"SourceError\"){},ec=Te(\"effect/ConfigProvider\",{defaultValue:()=>LL()}),J7={...er,toJSON(){return{_id:\"ConfigProvider\"}}},K7=e=>e;function ML(e,t){let r=Object.create(J7);return r.load=e,r.mapInput=t,r}function FL(e,t){return ML(r=>e(t(r)),r=>FL(e,n=>r(t(n))))}function NL(e,t){return ML(r=>I(e.load(r),n=>n!==void 0?g(n):t.load(r)),r=>NL(e.mapInput(r),t.mapInput(r)))}function Sg(e){return FL(e,K7)}var T0=l(2,(e,t)=>NL(e,t)),C0=l(2,(e,t)=>e.mapInput(t)),G7=C0(e=>e.map(t=>typeof t==\"number\"?t:T_(t))),V7=l(2,(e,t)=>{let r=typeof t==\"string\"?[t]:t;return C0(e,n=>[...r,...n])}),Z7=e=>Bo(e)?fb(ec)(e):XO(ec)(e),Y7=(e,t)=>fb(ec)(dr(function*(){let r=yield*ec,n=Bo(e)?yield*e:e;return t?.asPrimary?T0(n,r):T0(r,n)}));function Q7(e,t){let r=t?.preserveEmptyStrings===!0;return Sg(n=>g(X7(e,n,r)))}function X7(e,t,r){let n=e;for(let o of t){if(n==null)return;if(Array.isArray(n)){if(typeof o!=\"number\"||!Number.isInteger(o)||o<0||o>=n.length)return;n=n[o];continue}if(ur(n)){if(typeof o!=\"string\"||!Object.hasOwn(n,o))return;n=n[o];continue}return}return eX(n,r)}function eX(e,t){if(e!=null)return typeof e==\"string\"?UL(e,t):typeof e==\"number\"||typeof e==\"boolean\"||typeof e==\"bigint\"?Gp(String(e)):Array.isArray(e)?w0(e.length):ur(e)?yg(new Set(Object.keys(e))):Gp(F(e))}function UL(e,t){let r=DL(e,t);return r===void 0?void 0:Gp(r)}function DL(e,t){return e===\"\"&&!t?void 0:e}function A0(e,t){let r=t?.preserveEmptyStrings===!0,n=tX(e);return Sg(o=>g(rX(n,e,o,r)))}function LL(e){let t=e?.env??{...globalThis.process?.env,...import.meta?.env};return A0(t,{preserveEmptyStrings:e?.preserveEmptyStrings})}function tX(e){let t={};for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=r.split(\"_\"),s=t;for(let a of o){let i=s.children??=Object.create(null);s=i[a]??={}}}return t}function rX(e,t,r,n){let o=r.map(String).join(\"_\"),s=DL(Object.hasOwn(t,o)?t[o]:void 0,n),a=nX(e,r),i=a?.children?Object.keys(a.children):[];if(i.length===0)return s===void 0?void 0:Gp(s);if(i.every(Sc)){let u=Math.max(...i.map(f=>parseInt(f,10)))+1;return w0(u,s)}return yg(new Set(i),s)}function nX(e,t){if(t.length===0)return e;let r=e;for(let n of t)if(r=r?.children?.[String(n)],!r)return;return r}function $L(e,t){let r=sX(e);return t?.expandVariables&&(r=aX(r)),A0(r,{preserveEmptyStrings:t?.preserveEmptyStrings})}var oX=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg;function sX(e){let t=Object.create(null);e=e.replace(/\\r\\n?/gm,`\n`);let r;for(;(r=oX.exec(e))!=null;){let n=r[1],o=r[2]||\"\";o=o.trim();let s=o[0];o=o.replace(/^(['\"`])([\\s\\S]*)\\1$/gm,\"$2\"),s==='\"'&&(o=o.replace(/\\\\n/g,`\n`),o=o.replace(/\\\\r/g,\"\\r\")),t[n]=o}return t}function aX(e){let t=Object.create(null);for(let r of Object.keys(e))t[r]=BL(e[r],e).replace(/\\\\\\$/g,\"$\");return t}function BL(e,t){let r=iX(e,/(?!(?<=\\\\))\\$/g);if(r===-1)return e;let n=e.slice(r),o=/((?!(?<=\\\\))\\${?([\\w]+)(?::-([^}\\\\]*))?}?)/,s=n.match(o);if(s!==null){let[a,i,c,u]=s,f=Object.hasOwn(t,c)&&t[c]!==\"\"?t[c]:u??\"\";return BL(e.replace(i,()=>f),t)}return e}function iX(e,t){let r=Array.from(e.matchAll(t));return r.length>0?r.slice(-1)[0].index:-1}var cX=Se(function*(e){let r=yield*(yield*S0).readFileString(e?.path??\".env\");return $L(r,e)}),uX=Se(function*(e){let t=yield*E0,r=yield*S0,n=e?.rootPath??\"/\",o=e?.preserveEmptyStrings===!0;return Sg(s=>{let a=t.join(n,...s.map(String)),i=r.readFileString(a).pipe(j(u=>UL(u.trim(),o))),c=r.readDirectory(a).pipe(j(u=>yg(new Set(u.map(f=>t.basename(f))))));return i.pipe(oa(u=>c.pipe(oa(f=>I0(u)&&I0(f)?g(void 0):P(I0(u)?f:u)))),Zm(u=>new gg({message:`Failed to read file at ${t.join(n,...s.map(String))}`,cause:u})))})}),I0=e=>e.reason._tag===\"NotFound\";var jL=[\"All\",\"Fatal\",\"Error\",\"Warn\",\"Info\",\"Debug\",\"Trace\",\"None\"];var v0=\"~effect/Config\",HL=e=>A(e,v0),nf=class{_tag=\"ConfigError\";name=\"ConfigError\";cause;constructor(t){this.cause=t}get message(){return this.cause.toString()}toString(){return`ConfigError(${this.message})`}},fX={...hd({label:\"Config\",evaluate(e){return this.parse(e.getRef(ec))}}),[v0]:v0,toJSON(){return{_id:\"Config\"}}};function ts(e){let t=Object.create(fX);return t.evaluator=e,t.parse=r=>nt(e(r,[]),_l),t}var So=(e,t,r)=>e.evaluator(t,r),WL=l(2,(e,t)=>ts((r,n)=>j(So(e,r,n),Cr(t)))),lX=l(2,(e,t)=>ts((r,n)=>I(So(e,r,n),Ar({onSuccess:o=>So(t(o),r,n),onFailure:o=>g(K(o))})))),pX=l(2,(e,t)=>ts((r,n)=>I(So(e,r,n),o=>at(o)?Dr(t(o.success),B):g(K(o.failure))))),dX=l(2,(e,t)=>ts((r,n)=>Hb(So(e,r,n),{onFailure:o=>So(t(o),r,n),onSuccess:o=>ce(o)?So(t(o.failure),r,n):g(o)})));function JL(e){let t=globalThis.Array.isArray(e)?e:Symbol.iterator in e?[...e]:e;return ts((r,n)=>globalThis.Array.isArray(t)?Dr(Jm(t.map(o=>So(o,r,n))),fy):Dr(Jm(Ka(t,o=>So(o,r,n))),fy))}var KL=l(2,(e,t)=>ts((r,n)=>Dr(So(e,r,n),o=>ce(o)?B(t):o))),mX=e=>e.pipe(WL(O),KL(v())),GL=e=>HL(e)?e:JL(Ka(e,t=>GL(t))),hX=e=>Ct(e,\"SourceError\"),xX=()=>\"\",VL=(e,t)=>e.load(t).pipe(Lb,Dr(r=>({provider:e,path:t,node:r,toString:xX}))),qL=(e,t)=>VL(e.provider,[...e.path,t]),k0=(e,t)=>da(Yn,e,new Ce(gt(r=>t(r)),jr())),ZL=e=>{switch(e._tag){case\"Union\":return e.types.every(ZL);case\"Objects\":case\"Arrays\":case\"Suspend\":return!1;default:return!0}},O0=(e,t)=>{switch(e._tag){case\"Objects\":return t?._tag===\"Record\";case\"Arrays\":return t?._tag===\"Array\";case\"Union\":return e.types.some(r=>O0(r,t));case\"Suspend\":return O0(e.thunk(),t);default:return t?.value!==void 0}},gX=Zr(e=>{let t=new WeakSet,r=YM(n=>{switch(t.add(n),n._tag){case\"Objects\":{let o=n.indexSignatures.map(a=>Pi(a.parameter)),s=Se(function*(a){if(a.node?._tag!==\"Record\")return;let i=a.node,c=new Set;for(let f of n.propertySignatures)typeof f.name==\"string\"&&c.add(f.name);if(o.length>0)for(let f of i.keys)o.some(p=>p(f))&&c.add(f);let u={};for(let f of c){let p=yield*qL(a,f);p.node!==void 0&&N(u,f,p)}return u});return k0(n.recur(r,a=>a),s)}case\"Arrays\":{let o=Se(function*(s){if(s.node?._tag!==\"Array\")return;let a=[];for(let i=0;ig(o.node?.value))});return r(e)});function Xt(e,t){let r=Mp(e),n=mn(r.ast),o=et(q(gX(r.ast))),s=typeof t==\"string\"?[t]:t??[];return ts((a,i)=>{let c=[...i,...s];return VL(a,c).pipe(nt(u=>o(u).pipe(Dr(B),Zc(f=>{let p=new nf(new As(c.length>0?new ct(c,f):f));return O0(n,u.node)?P(p):g(K(p))}))),Rl(u=>hX(u)?P(new nf(u)):Rr(u)))})}var yX=co.check(Lu({minimum:1,maximum:65535})),SX=io(jL),YL=e=>Ir(e)||globalThis.Array.isArray(e);function bX(e){return ts(()=>P(new nf(e)))}function EX(e){return ts(()=>g(B(e)))}function IX(e){return Xt(J,e)}function TX(e){return Xt(aw,e)}function wX(e){return Xt(ji,e)}function CX(e){return Xt(Du,e)}function AX(e){return Xt(co,e)}function kX(e,t){return Xt(wt(e),t)}function vX(e,t){return Xt(io(e),t)}function OX(e,t,r){let n=YL(t),o=n?r:t,s=$e(e),a=o?.separator??\",\",i=J.pipe(G(Mp(s),{decode:DP(o),encode:Sh(jr({strict:!1}),oe(c=>c.join(a)))}));return Xt(st([i,s]),n?t:void 0)}function _X(e,t,r,n){let o=YL(r),s=ks(e,t),a=XP(o?n:r),i=J.pipe(G(Mp(s),{decode:a.decode,encode:Sh(jr({strict:!1}),a.encode)}));return Xt(st([s,i]),o?r:void 0)}function RX(e){return Xt(XT,e)}function PX(e){return Xt(lw,e)}function MX(e){return Xt(Bu,e)}function FX(e){return Xt(yX,e)}function NX(e){return Xt(SX,e)}function UX(e){return Xt(vx(J),e)}function DX(e){return Xt(Tx,e)}function LX(e){return Xt($u,e)}var $X=l(2,(e,t)=>ts((r,n)=>So(e,r,[...n,t])));var tc={};Eo(tc,{Console:()=>QL,assert:()=>BX,clear:()=>jX,consoleWith:()=>Bt,count:()=>zX,countReset:()=>qX,debug:()=>HX,dir:()=>WX,dirxml:()=>JX,error:()=>KX,group:()=>GX,info:()=>VX,log:()=>ZX,table:()=>YX,time:()=>QX,timeLog:()=>XX,trace:()=>eee,warn:()=>tee,withGroup:()=>ree,withTime:()=>nee});var QL=HS,Bt=e=>ne(t=>e(t.getRef(QL))),BX=(e,...t)=>Bt(r=>z(()=>{r.assert(e,...t)})),jX=Bt(e=>z(()=>{e.clear()})),zX=e=>Bt(t=>z(()=>{t.count(e)})),qX=e=>Bt(t=>z(()=>{t.countReset(e)})),HX=(...e)=>Bt(t=>z(()=>{t.debug(...e)})),WX=(e,t)=>Bt(r=>z(()=>{r.dir(e,t)})),JX=(...e)=>Bt(t=>z(()=>{t.dirxml(...e)})),KX=(...e)=>Bt(t=>z(()=>{t.error(...e)})),GX=e=>Bt(t=>ri(z(()=>{e?.collapsed?t.groupCollapsed(e.label):t.group(e?.label)}),()=>z(()=>{t.groupEnd()}))),VX=(...e)=>Bt(t=>z(()=>{t.info(...e)})),ZX=(...e)=>Bt(t=>z(()=>{t.log(...e)})),YX=(e,t)=>Bt(r=>z(()=>{r.table(e,t)})),QX=e=>Bt(t=>ri(z(()=>{t.time(e)}),()=>z(()=>{t.timeEnd(e)}))),XX=(e,...t)=>Bt(r=>z(()=>{r.timeLog(e,...t)})),eee=(...e)=>Bt(t=>z(()=>{t.trace(...e)})),tee=(...e)=>Bt(t=>z(()=>{t.warn(...e)})),ree=l(e=>ie(e[0]),(e,t)=>Bt(r=>al(z(()=>{t?.collapsed?r.groupCollapsed(t.label):r.group(t?.label)}),()=>e,()=>z(()=>{r.groupEnd()})))),nee=l(e=>ie(e[0]),(e,t)=>Bt(r=>al(z(()=>{r.time(t)}),()=>e,()=>z(()=>{r.timeEnd(t)}))));var Gr={OK:200,Unauthorized:401,NotFound:404,InternalServerError:500,ServiceUnavailable:503},_0={[Gr.OK]:\"OK\",[Gr.Unauthorized]:\"Unauthorized\",[Gr.NotFound]:\"Not Found\",[Gr.InternalServerError]:\"Internal Server Error\",[Gr.ServiceUnavailable]:\"Service Unavailable\"},oee=e=>{let t=e.startsWith(\"/\"),r=[];for(let o of e.split(\"/\"))if(!(o===\"\"||o===\".\")){if(o===\"..\"){r.length>0&&r.at(-1)!==\"..\"?r.pop():t||r.push(\"..\");continue}r.push(o)}let n=r.join(\"/\");return t?`/${n}`:n||\".\"},Ta=(...e)=>oee(e.filter(Boolean).join(\"/\")),of=e=>{if(e.length===0)return\".\";let t=e.length;for(;t>1&&e[t-1]===\"/\";)t-=1;let r=e.slice(0,t),n=r.lastIndexOf(\"/\");return n<0?\".\":n===0?\"/\":r.slice(0,n)},XL=e=>{if(!e.startsWith(\"/\"))throw new TypeError(\"Path must be absolute\");let t=new URL(\"file:///\");return t.pathname=e.replace(/%/g,\"%25\").replace(/\\\\/g,\"%5C\"),t};var see=/^[A-Za-z0-9_-]+$/u,e$=/[*?[{]/u,bg=(e,t)=>t===e||t.startsWith(`${e.replace(/\\/+$/u,\"\")}/`),sf=class extends Tn.TaggedError(\"FunctionFileSystemError\"){},Fn=(e,t)=>e.lstat(t).pipe(U.catch(()=>U.undefined)),rc=(e,t,r)=>U.all([e.realPath(t),e.realPath(r)],{concurrency:2}).pipe(U.map(([n,o])=>bg(n,o)),U.orElseSucceed(()=>!1)),t$=(e,t,r)=>U.gen(function*(){let n=yield*Fn(e,r);if(n===void 0)return!0;if(n.isSymbolicLink||!(yield*rc(e,t,r)))return!1;if(!n.isDirectory)return!0;let o=yield*e.readDirectory(r).pipe(U.catch(()=>U.undefined));if(o===void 0)return!1;for(let s of o)if(!(yield*t$(e,t,Ta(r,s))))return!1;return!0}),Vp=(e,t)=>t.length===0?\"\":t.startsWith(\"/\")?t:Ta(e,t),R0=[\"deno.json\",\"deno.jsonc\"],r$=e=>R0.includes(e.slice(e.lastIndexOf(\"/\")+1)),aee=(e,t,r)=>U.gen(function*(){let n=of(Ta(r));for(;bg(t,n);){for(let s of R0){let a=Ta(n,s),i=yield*Fn(e,a);if(i!==void 0)return i.isFile&&!i.isSymbolicLink?a:void 0}let o=of(n);if(o===n)break;n=o}}),iee=(e,t,r)=>U.all([e.realPath(t),e.realPath(r)],{concurrency:2}).pipe(U.map(([n,o])=>n===o),U.orElseSucceed(()=>!1)),n$=U.fn(\"Functions.resolveFunctionConfig\")(function*(e){let{root:t,slug:r,overrides:n,fs:o}=e;if(!t.startsWith(\"/\")||!see.test(r)||r===\"_shared\"||(yield*Fn(o,t))===void 0)return;let a=yield*o.realPath(t).pipe(U.orElseSucceed(()=>\"\"));if(!a.startsWith(\"/\"))return;let i=yield*Fn(o,a);if(i===void 0||!i.isDirectory)return;let c=e.filesRoot===void 0?a:yield*o.realPath(e.filesRoot).pipe(U.orElseSucceed(()=>\"\"));if(!c.startsWith(\"/\")||!bg(c,a))return;let u=n.$default,f=n[r],p={...u,...f};if(p.enabled===!1)return;let d=Ta(a,r),m=p?.entrypointPath&&p.entrypointPath.length>0?p.entrypointPath:p.entrypoint&&p.entrypoint.length>0?p.entrypoint:\"index.ts\";if(!m.startsWith(\"/\")){let b=yield*Fn(o,d);if(b===void 0||!b.isDirectory||!(yield*rc(o,a,d)))return}let x=Vp(d,m);if(!(yield*rc(o,c,x)))return;let y=yield*Fn(o,x);if(y===void 0||!y.isFile||y.isSymbolicLink)return;let S=f?.importMapPath??f?.import_map,w=u?.importMapRoot??u?.import_map_root,E=S!==void 0?Vp(d,S):w!==void 0?Vp(a,w):Vp(d,\"\");if(E.length>0){if(!(yield*rc(o,c,E)))return;let b=yield*Fn(o,E);if(b===void 0||!b.isFile||b.isSymbolicLink)return}else for(let b of R0){let T=Ta(d,b),C=yield*Fn(o,T);if(C!==void 0){if(!C.isFile||C.isSymbolicLink||!(yield*rc(o,c,T)))return;E=T;break}}let M=E.length===0?void 0:yield*aee(o,c,x),_=M!==void 0&&(yield*iee(o,M,E)),h=(p.staticFiles??p.static_files??[]).map(b=>Vp(d,b));for(let b of h){if(!bg(c,b))return;let T=b.search(e$),C=T<0?b:b.slice(0,T),L=T<0?of(b):C.slice(0,Math.max(0,C.lastIndexOf(\"/\")))||a;if(!(yield*t$(o,c,L)))return;if(!e$.test(b)){let Q=yield*Fn(o,b);if(Q!==void 0&&(!(yield*rc(o,c,b))||Q.isSymbolicLink))return}}return{entrypointPath:x,importMapPath:E,importMapDiscoveredByRuntime:_,staticFiles:h,verifyJWT:p.verifyJWT??p.verify_jwt??!0,env:p.env}}),cee=e=>Ta(of(e.entrypointPath),\"package.json\"),o$=e=>{let t=new Map,r=new Map;return(n,o)=>{let s=r.get(n);if(s!==void 0)return s;let a=of(o.entrypointPath),i=t.get(a),c=i===void 0||i===n?a:e();return i===void 0&&t.set(a,n),r.set(n,c),c}},s$=U.fn(\"Functions.packageJsonContainedFor\")(function*(e){if(!e.root.startsWith(\"/\"))return!1;let t=yield*Fn(e.fs,e.root);if(t===void 0||!t.isDirectory&&!t.isSymbolicLink)return!1;let r=yield*e.fs.realPath(e.root).pipe(U.orElseSucceed(()=>\"\"));if(!r.startsWith(\"/\"))return!1;let n=yield*Fn(e.fs,r);if(n===void 0||!n.isDirectory)return!1;let o=cee(e.config),s=yield*Fn(e.fs,o);return s===void 0||!s.isFile||s.isSymbolicLink?!1:yield*rc(e.fs,r,o)});var P0=new TextEncoder,Zp=new TextDecoder,Eg=new TextDecoder(\"utf-8\",{fatal:!0}),Wue=2**32;function a$(...e){let t=e.reduce((o,{length:s})=>o+s,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function af(e){let t=new Uint8Array(e.length);for(let r=0;r127)throw new TypeError(\"non-ASCII string encountered in encode()\");t[r]=n}return t}var Ig=(e,t=\"algorithm.name\")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function uee(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function i$(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!=\"number\"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function c$(e,t,r){let n=e.algorithm;if(n.name!==t.name)throw Ig(t.name);if(t.hash&&n.hash?.name!==t.hash)throw Ig(t.hash,\"algorithm.hash\");if(t.namedCurve&&n.namedCurve!==t.namedCurve)throw Ig(t.namedCurve,\"algorithm.namedCurve\");if(t.length!==void 0&&n.length!==t.length)throw Ig(t.length,\"algorithm.length\");uee(e,r)}function fee(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(\", \")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t==\"function\"&&t.name?e+=` Received function ${t.name}`:typeof t==\"object\"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Yp=(e,t,...r)=>fee(`Key for the ${e} algorithm must be `,t,...r);var br=class extends Error{static code=\"ERR_JOSE_GENERIC\";code=\"ERR_JOSE_GENERIC\";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Ms=class extends br{static code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";claim;reason;payload;constructor(t,r,n=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},Qp=class extends br{static code=\"ERR_JWT_EXPIRED\";code=\"ERR_JWT_EXPIRED\";claim;reason;payload;constructor(t,r,n=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},Tg=class extends br{static code=\"ERR_JOSE_ALG_NOT_ALLOWED\";code=\"ERR_JOSE_ALG_NOT_ALLOWED\"},bo=class extends br{static code=\"ERR_JOSE_NOT_SUPPORTED\";code=\"ERR_JOSE_NOT_SUPPORTED\"};var Vr=class extends br{static code=\"ERR_JWS_INVALID\";code=\"ERR_JWS_INVALID\"},cf=class extends br{static code=\"ERR_JWT_INVALID\";code=\"ERR_JWT_INVALID\"};var Xp=class extends br{static code=\"ERR_JWKS_INVALID\";code=\"ERR_JWKS_INVALID\"},uf=class extends br{static code=\"ERR_JWKS_NO_MATCHING_KEY\";code=\"ERR_JWKS_NO_MATCHING_KEY\";constructor(t=\"no applicable key found in the JSON Web Key Set\",r){super(t,r)}},wg=class extends br{[Symbol.asyncIterator]=async function*(){};static code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";constructor(t=\"multiple matching keys found in the JSON Web Key Set\",r){super(t,r)}},Cg=class extends br{static code=\"ERR_JWKS_TIMEOUT\";code=\"ERR_JWKS_TIMEOUT\";constructor(t=\"request timed out\",r){super(t,r)}},Ag=class extends br{static code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";constructor(t=\"signature verification failed\",r){super(t,r)}};var M0=e=>{if(e?.[Symbol.toStringTag]===\"CryptoKey\")return!0;try{return e instanceof CryptoKey}catch{return!1}},lee=e=>e?.[Symbol.toStringTag]===\"KeyObject\",u$=e=>M0(e)||lee(e);function f$(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let n=0;ntypeof o!=\"string\")||new Set(n).size!==n.length)throw new TypeError('\"key_ops\" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}var D0=e=>e[Symbol.toStringTag],pee=(e,t,r)=>{let{alg:n}=e;if(t.use!==void 0){let o=r===\"sign\"||r===\"verify\"?\"sig\":\"enc\";if(t.use!==o)throw new TypeError(`Invalid key for this operation, its \"use\" must be \"${o}\" when present`)}if(t.alg!==void 0&&t.alg!==n)throw new TypeError(`Invalid key for this operation, its \"alg\" must be \"${n}\" when present`);if(Array.isArray(t.key_ops)){let o=r===\"encrypt\"||r===\"decrypt\"?e.ops?.[r===\"encrypt\"?0:1]:r;if(o&&!t.key_ops.includes(o))throw new TypeError(`Invalid key for this operation, its \"key_ops\" must include \"${o}\" when present`)}};function dee(e,t,r){let{alg:n,secret:o}=e,s=r===\"decrypt\"||r===\"sign\";if(o&&t instanceof Uint8Array)return[m$,t];if(wa(t)){let a=p$(t);if(typeof a.kty!=\"string\")throw new TypeError(o?Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(!(o?a.kty===\"oct\"&&typeof a.k==\"string\":a.kty!==\"oct\"&&(s?a.kty===\"AKP\"&&typeof a.priv==\"string\"||typeof a.d==\"string\":a.d===void 0&&a.priv===void 0)))throw new TypeError(o?'JSON Web Key for symmetric algorithms must have JWK \"kty\" (Key Type) equal to \"oct\" and the JWK \"k\" (Key Value) present':`JSON Web Key for this operation must be a ${s?\"private\":\"public\"} JWK`);return pee(e,a,r),[g$,t,a]}if(!u$(t))throw new TypeError(o?Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(o){if(t.type!==\"secret\")throw new TypeError(`${D0(t)} instances for symmetric algorithms must be of type \"secret\"`)}else{if(t.type===\"secret\")throw new TypeError(`${D0(t)} instances for asymmetric algorithms must not be of type \"secret\"`);let a=s?\"private\":\"public\";if((t.type===\"public\"||t.type===\"private\")&&t.type!==a){let i=r===\"sign\"?\"signing\":r===\"verify\"?\"verifying\":`${r.slice(0,-1)}tion`;throw new TypeError(`${D0(t)} instances for asymmetric algorithm ${i} must be of type \"${a}\"`)}}return M0(t)?[h$,t]:[x$,t]}var m$=0,h$=1,x$=2,g$=3,L0,mee={__proto__:null,prime256v1:\"P-256\",secp384r1:\"P-384\",secp521r1:\"P-521\"};function _g(e,t,r){L0||=new WeakMap;let n=L0.get(e);return r&&(n?n[t]=r:L0.set(e,{[t]:r})),r??n?.[t]}var d$=async(e,t,r)=>_g(e,r.alg)??_g(e,r.alg,await Og(r,{...t,alg:r.alg})),hee=(e,t)=>{let r=_g(e,t.alg);if(r)return r;let n=e.type===\"public\",o=t.usages[n?0:1],{asymmetricKeyType:s}=e,a=mee[e.asymmetricKeyDetails?.namedCurve],i=t.resolve?.({crv:a,asymmetricKeyType:s})??t.subtle;return _g(e,t.alg,e.toCryptoKey(i,n,o))};async function y$(e,t,r){let n=dee(e,t,r);switch(n[0]){case m$:case h$:return n[1];case g$:{let o=n[1],s=n[2];if(s.kty===\"oct\")return ed(s.k);if(!Object.isFrozen(o)){let{key_ops:a}=o;Array.isArray(a)&&Object.freeze(a),Object.freeze(o)}return d$(o,s,e)}case x$:{let o=n[1];return o.type===\"secret\"?o.export():\"toCryptoKey\"in o&&typeof o.toCryptoKey==\"function\"?hee(o,e):d$(o,o.export({format:\"jwk\"}),e)}}}function S$(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var b$={__proto__:null,b64:!0};function E$(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!=\"string\")))throw new TypeError(`\"${e}\" option must be an array of strings`);if(t)return new Set(t)}function I$(e,t,r,n,o){if(o.crit!==void 0&&n?.crit===void 0)throw new e('\"crit\" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return[];if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(a=>typeof a!=\"string\"||a.length===0))throw new e('\"crit\" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s=r===void 0?t:{__proto__:null,...r,...t};for(let a of n.crit){if(!(a in s))throw new bo(`Extension Header Parameter \"${a}\" is not recognized`);if(!Object.hasOwn(o,a)||o[a]===void 0)throw new e(`Extension Header Parameter \"${a}\" is missing`);if(s[a]&&(!Object.hasOwn(n,a)||n[a]===void 0))throw new e(`Extension Header Parameter \"${a}\" MUST be integrity protected`)}return n.crit}function T$(e,t){if(t.includes(\"b64\")){let r=e.b64;if(typeof r!=\"boolean\")throw new Vr('The \"b64\" (base64url-encode payload) Header Parameter must be a boolean');return r}return!0}async function xee(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey(\"raw\",t,e.subtle,!1,[r]):(c$(t,e.subtle,r),e.minRsaBits&&i$(e.alg,t),t)}async function w$(e,t,r,n){let o=await xee(e,t,\"verify\");try{return await crypto.subtle.verify(e.signing,o,r,n)}catch{return!1}}var td=[[\"verify\"],[\"sign\"]];function $0(e){let t={name:\"HMAC\",hash:`SHA-${e}`};return{kty:[\"oct\"],secret:!0,subtle:t,signing:t,usages:td}}function ff(e,t){let n={name:t?\"RSA-PSS\":\"RSASSA-PKCS1-v1_5\",hash:`SHA-${e}`};return{kty:[\"RSA\"],subtle:n,signing:t?{...n,saltLength:t}:n,usages:td,minRsaBits:2048}}function B0(e,t){return{kty:[\"EC\"],crv:e,subtle:{name:\"ECDSA\",namedCurve:e},signing:{name:\"ECDSA\",hash:`SHA-${t}`},usages:td}}function C$(){let e={name:\"Ed25519\"};return{kty:[\"OKP\"],crv:\"Ed25519\",subtle:e,signing:e,usages:td}}function j0(e){let r={name:`ML-DSA-${e}`};return{kty:[\"AKP\"],subtle:r,signing:r,usages:td}}var z0=S$({HS256:$0(256),HS384:$0(384),HS512:$0(512),RS256:ff(256),RS384:ff(384),RS512:ff(512),PS256:ff(256,32),PS384:ff(384,48),PS512:ff(512,64),ES256:B0(\"P-256\",256),ES384:B0(\"P-384\",384),ES512:B0(\"P-521\",512),EdDSA:C$(),Ed25519:C$(),\"ML-DSA-44\":j0(44),\"ML-DSA-65\":j0(65),\"ML-DSA-87\":j0(87)});function A$(e){let t=typeof e==\"string\"?z0[e]:void 0;if(!t)throw new bo(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function k$(e){return[e&&E$(\"algorithms\",e.algorithms),e?.crit]}function gee(e,t=e===void 0?{}:vg(e,Vr,\"JWS Protected Header is invalid\")){return t}function yee(e,t,r){let n=T$(e,I$(Vr,b$,r[1],e,t)),o=t.alg;if(typeof o!=\"string\"||!o)throw new Vr('JWS \"alg\" (Algorithm) Header Parameter missing or invalid');if(r[0]&&!r[0].has(o))throw new Tg('\"alg\" (Algorithm) Header Parameter value not allowed');return[n,o]}function See(e){try{return af(e)}catch{throw new Vr(\"JWS Compact Serialization payload must use only ASCII characters\")}}async function bee(e,t,r,n,o,s,a){let i=!1;typeof r==\"function\"&&(r=await r(o,e),i=!0);let c=typeof a==\"string\",u=A$(s),f=a$(n!==void 0?af(n):new Uint8Array,af(\".\"),c?t[2]??=l$(a,\"payload\",Vr):a),p=N0(e.signature,\"signature\",Vr),d=await y$(u,r,\"verify\");if(!await w$(u,d,p,f))throw new Ag;return[c?N0(a,\"payload\",Vr):a,o,c,d,i]}async function v$(e,t,r){if(e instanceof Uint8Array&&(e=Zp.decode(e)),typeof e!=\"string\")throw new Vr(\"Compact JWS must be a string or Uint8Array\");let{0:n,1:o,2:s,length:a}=e.split(\".\");if(a!==3)throw new Vr(\"Invalid Compact JWS\");let i={payload:o,protected:n,signature:s},c=gee(n),[u,f]=yee(c,c,t),p=u?o:See(o);return bee(i,t,r,n,c,f,p)}var Eee=e=>Math.floor(e.getTime()/1e3),Iee={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},Tee=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,lf=\"check_failed\";function q0(){throw new TypeError(\"Invalid time period format\")}function O$(e){typeof e!=\"string\"&&q0();let t=Tee.exec(e);(!t||t[4]&&t[1])&&q0();let r=parseFloat(t[2]),n=Math.round(r*Iee[t[3][0].toLowerCase()]);return Number.isFinite(n)||q0(),t[1]===\"-\"||t[4]===\"ago\"?-n:n}function H0(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}var _$=e=>{let t=e.toLowerCase();return e.includes(\"/\")?t:`application/${t}`},wee=(e,t)=>typeof e==\"string\"?t.includes(e):Array.isArray(e)?t.some(r=>e.includes(r)):!1;function W0(e,t,r=!1){let n=e[t];if(!(n===void 0&&!r)){if(typeof n!=\"number\")throw new Ms(`\"${t}\" claim must be a number`,e,t,\"invalid\");return n}}function J0(e,t){throw new Ms(`unexpected \"${t}\" claim value`,e,t,lf)}function R$(e,t,r={}){let n;try{n=JSON.parse(Eg.decode(t))}catch{}if(!wa(n))throw new cf(\"JWT Claims Set must be a top-level JSON object\");let{typ:o}=r;if(o!==void 0&&(typeof e.typ!=\"string\"||_$(e.typ)!==_$(o)))throw new Ms('unexpected \"typ\" JWT header value',n,\"typ\",lf);let{requiredClaims:s=[],issuer:a,subject:i,audience:c,maxTokenAge:u}=r,f=[...s];u!==void 0&&f.push(\"iat\"),c!==void 0&&f.push(\"aud\"),i!==void 0&&f.push(\"sub\"),a!==void 0&&f.push(\"iss\");for(let E of new Set(f.reverse()))if(!Object.hasOwn(n,E))throw new Ms(`missing required \"${E}\" claim`,n,E,\"missing\");a!==void 0&&!(Array.isArray(a)?a:[a]).includes(n.iss)&&J0(n,\"iss\"),i!==void 0&&n.sub!==i&&J0(n,\"sub\"),c!==void 0&&!wee(n.aud,typeof c==\"string\"?[c]:c)&&J0(n,\"aud\");let{clockTolerance:p}=r,d=0;if(typeof p==\"string\")d=O$(p);else if(p!==void 0){if(typeof p!=\"number\")throw new TypeError(\"Invalid clockTolerance option type\");d=p}H0(\"clockTolerance option\",d);let{currentDate:m}=r,x=H0(\"currentDate option\",Eee(m===void 0?new Date:m)),y=W0(n,\"iat\",u!==void 0),S=W0(n,\"nbf\");if(S!==void 0&&S>x+d)throw new Ms('\"nbf\" claim timestamp check failed',n,\"nbf\",lf);let w=W0(n,\"exp\");if(w!==void 0&&w<=x-d)throw new Qp('\"exp\" claim timestamp check failed',n,\"exp\",lf);if(u!==void 0){let E=x-y,M=H0(\"maxTokenAge option\",typeof u==\"number\"?u:O$(u));if(E-d>M)throw new Qp('\"iat\" claim timestamp check failed (too far in the past)',n,\"iat\",lf);if(E<-d)throw new Ms('\"iat\" claim timestamp check failed (it should be in the past)',n,\"iat\",lf)}return n}async function Rg(e,t,r){let n=await v$(e,k$(r),t);if(!n[2])throw new cf(\"JWTs MUST NOT use unencoded payload\");let s={payload:R$(n[1],n[0],r),protectedHeader:n[1]};return typeof t==\"function\"?{...s,key:n[3]}:s}function Cee(e,t,r,n){let{kty:o,key_ops:s,ext:a,kid:i,alg:c,use:u,crv:f}=U0(e),p=Array.isArray(s)?[...s]:s;return(a===void 0||typeof a==\"boolean\")&&(p===void 0||Array.isArray(p)&&p.every((d,m)=>typeof d==\"string\"&&p.indexOf(d)===m)&&p.includes(\"verify\"))&&t.kty.includes(o)&&(n===void 0||typeof n==\"string\"&&n===i)&&(c===void 0?o!==\"AKP\":r===c)&&(u===void 0||u===\"sig\")&&(!t.crv||f===t.crv)}async function P$(e,t,r){let n=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(n[o]===void 0){let s=await Og(r,{...t,alg:o,ext:!0});if(s.type!==\"public\")throw new Xp(\"JSON Web Key Set members must be public keys\");n[o]=s}return n[o]}function nc(e){let t;try{t=structuredClone(e)}catch{}if(!kg(t))throw new Xp(\"JSON Web Key Set malformed\");let r=new WeakMap;return Object.defineProperty(async(o,s)=>{let{alg:a,kid:i}={...o,...s?.header},c=typeof a==\"string\"?z0[a]:void 0;if(!c||c.secret)throw new bo('Unsupported \"alg\" value for a JSON Web Key Set');let u=t.keys.filter(d=>Cee(d,c,a,i)),{0:f,length:p}=u;if(!p)throw new uf;if(p!==1){let d=new wg;throw d[Symbol.asyncIterator]=async function*(){for(let m of u)try{yield await P$(r,m,c)}catch{}},d}return P$(r,f,c)},\"jwks\",{value:()=>structuredClone(t)})}function Aee(){return typeof WebSocketPair<\"u\"||typeof navigator<\"u\"&&navigator.userAgent===\"Cloudflare-Workers\"||typeof EdgeRuntime<\"u\"&&EdgeRuntime===\"vercel\"}var K0;(typeof navigator>\"u\"||!navigator.userAgent?.startsWith?.(\"Mozilla/5.0 \"))&&(K0=\"jose/v6.2.10\");var F$=Symbol();async function kee(e,t,r,n=fetch){let o=await n(e,{method:\"GET\",signal:r,redirect:\"manual\",headers:t}).catch(s=>{throw s.name===\"TimeoutError\"?new Cg:s});if(o.status!==200)throw new br(\"Expected 200 OK from the JSON Web Key Set HTTP response\");try{return await o.json()}catch{throw new br(\"Failed to parse the JSON Web Key Set HTTP response as JSON\")}}var N$=Symbol();function rd(e,t){return Number.isFinite(e)&&Date.now(){if(d&&Aee()&&(d=void 0),!d){let E=++m,M=d=kee(r,c,AbortSignal.timeout(s),u).then(_=>{let h=nc(_);if(E<=x)return;y=h;let b=Date.now();f&&(f.uat=b,f.jwks=_),p=b,x=E}).finally(()=>{d===M&&(d=void 0)})}await d};return Object.defineProperties(async(E,M)=>{(!y||!rd(p,i))&&await S();try{return await y(E,M)}catch(_){if(_ instanceof uf&&!rd(p,a))return await S(),y(E,M);throw _}},{coolingDown:{get:()=>rd(p,a),enumerable:!0},fresh:{get:()=>rd(p,i),enumerable:!0},reload:{value:S,enumerable:!0},reloading:{get:()=>!!d,enumerable:!0},jwks:{value:()=>y?.jwks(),enumerable:!0}})}function V0(e){let t;if(typeof e==\"string\"){let n=e.split(\".\");(n.length===3||n.length===5)&&([t]=n)}else if(typeof e==\"object\"&&e)if(\"protected\"in e)t=e.protected;else throw new TypeError(\"Token does not contain a Protected Header\");let r=\"Invalid Token or Protected Header formatting\";if(typeof t!=\"string\"||!t)throw new TypeError(r);return vg(t,TypeError,r)}var Oee=new Set([\"HOME\",\"HOSTNAME\",\"PATH\",\"PWD\"]),Nn=U.runSync(U.gen(function*(){let e=t=>t.pipe(Mr.option);return{hostPort:yield*e(Mr.String(\"SUPABASE_INTERNAL_HOST_PORT\")),functionsRoot:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_ROOT\")),filesRoot:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_FILES_ROOT\")),jwtSecret:yield*e(Mr.String(\"SUPABASE_INTERNAL_JWT_SECRET\")),supabaseUrl:yield*e(Mr.String(\"SUPABASE_URL\")),wallclock:yield*e(Mr.String(\"SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC\")),publishableKey:yield*e(Mr.String(\"SUPABASE_INTERNAL_PUBLISHABLE_KEY\")),secretKey:yield*e(Mr.String(\"SUPABASE_INTERNAL_SECRET_KEY\")),functionsConfig:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_CONFIG\")),debug:yield*e(Mr.String(\"SUPABASE_INTERNAL_DEBUG\")),jwks:yield*e(Mr.String(\"SUPABASE_JWKS\"))}}).pipe(U.provideService(rf.ConfigProvider,rf.fromEnvRecord(Deno.env.toObject(),{preserveEmptyStrings:!0})))),df=(e,t=\"\")=>xe.getOrElse(e,()=>t),U$=df(Nn.hostPort,\"8081\"),z$=df(Nn.functionsRoot),_ee=df(Nn.jwtSecret),Ree=df(Nn.supabaseUrl,\"http://127.0.0.1:54321\"),Pee=new URL(\"/auth/v1/.well-known/jwks.json\",Ree),D$=Number.parseInt(df(Nn.wallclock,\"400\"),10),L$=xe.getOrUndefined(Nn.publishableKey),$$=xe.getOrUndefined(Nn.secretKey),Fs={BootError:Gr.ServiceUnavailable,InvalidWorkerResponse:Gr.InternalServerError,WorkerLimit:546},Mee={[Fs.BootError]:\"BOOT_ERROR\",[Fs.InvalidWorkerResponse]:\"WORKER_ERROR\",[Fs.WorkerLimit]:\"WORKER_LIMIT\"},Fee={[Fs.BootError]:\"Worker failed to boot (please check logs)\",[Fs.InvalidWorkerResponse]:\"Function exited due to an error (please check logs)\",[Fs.WorkerLimit]:\"Worker failed to respond due to a resource limit (please check logs)\"},Nee=new Map([[Deno.errors.InvalidWorkerCreation,Fs.BootError],[Deno.errors.InvalidWorkerResponse,Fs.InvalidWorkerResponse],[Deno.errors.WorkerRequestCancelled,Fs.WorkerLimit]]),Uee=e=>{let t=Deno.errors.WorkerAlreadyRetired;return t!==void 0&&e instanceof t},Dee=(s=>(s.MissingAuthHeader=\"UNAUTHORIZED_NO_AUTH_HEADER\",s.InvalidLegacyJWT=\"UNAUTHORIZED_JWT\",s.InvalidAsymmetricJWT=\"UNAUTHORIZED_ASYMMETRIC_JWT\",s.InvalidTokenFormat=\"UNAUTHORIZED_INVALID_JWT_FORMAT\",s.UnsupportedTokenAlgorithm=\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",s))(Dee||{}),Lee=me.Struct({enabled:me.optionalKey(me.Boolean),verifyJWT:me.optionalKey(me.Boolean),verify_jwt:me.optionalKey(me.Boolean),entrypointPath:me.optionalKey(me.String),entrypoint:me.optionalKey(me.String),importMapPath:me.optionalKey(me.String),import_map:me.optionalKey(me.String),importMapRoot:me.optionalKey(me.String),import_map_root:me.optionalKey(me.String),staticFiles:me.optionalKey(me.Array(me.String)),static_files:me.optionalKey(me.Array(me.String)),env:me.optionalKey(me.Record(me.String,me.String))}),$ee=me.Record(me.String,Lee),Bee=me.declare(e=>typeof e==\"object\"&&e!==null&&\"keys\"in e&&Array.isArray(e.keys)&&e.keys.every(t=>typeof t==\"object\"&&t!==null)),jee=()=>xe.match(Nn.functionsConfig,{onNone:()=>({}),onSome:e=>U.runSync(me.decodeEffect(me.fromJsonString($ee))(e).pipe(U.orElseSucceed(()=>({}))))}),Z0=jee();if(xe.getOrUndefined(Nn.debug)===\"true\"){let e=Object.fromEntries(Object.entries(Z0).map(([t,r])=>[t,Object.fromEntries(Object.entries(r).filter(([n])=>n!==\"env\"))]));U.runSync(tc.log(\"Functions config:\",JSON.stringify(e,null,2)))}var oc=(e,t,r={})=>{let n={...r},o=null;return e!=null&&(typeof e==\"object\"?(n[\"Content-Type\"]=\"application/json\",o=JSON.stringify(e)):(n[\"Content-Type\"]=\"text/plain\",o=typeof e==\"string\"?e:JSON.stringify(e)??null)),new Response(o,{status:t,headers:n})},B$=({code:e,message:t=\"Invalid JWT\"})=>oc({code:e,message:t,msg:t},Gr.Unauthorized,{\"sb-error-code\":e,\"Access-Control-Expose-Headers\":\"sb-error-code\"}),zee=e=>{for(let[t,r]of Nee.entries())if(t!==void 0&&e instanceof t)return oc({code:Mee[r],message:Fee[r]},r);return oc({code:_0[Gr.InternalServerError],message:\"Request failed due to an internal server error\"},Gr.InternalServerError)};function qee(e){let t=e.split(\" \");return t.length===2&&t[0]===\"Bearer\"?t[1]:null}var Hee=e=>{let t=e.headers.get(\"authorization\"),r=e.headers.get(\"sb-api-key\")?.replace(\"Bearer\",\"\").trim();if(!t&&!r)return{code:\"UNAUTHORIZED_NO_AUTH_HEADER\",message:\"Missing authorization header\"};let n=qee(t??\"\"),o=!n||n.startsWith(\"sb_\")?r:n;return o||{code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"}},pf=class extends Tn.TaggedError(\"BootstrapOperationError\"){},Wee=U.runSync(xe.match(Nn.jwks,{onNone:()=>U.succeed(xe.some(nc({keys:[]}))),onSome:e=>U.gen(function*(){let t=yield*me.decodeEffect(me.fromJsonString(Bee))(e);return yield*U.try({try:()=>nc(t),catch:r=>new pf({cause:r})})}).pipe(U.option)})),Jee=xe.getOrElse(Wee,()=>G0(Pee)),Ca=e=>U.tryPromise({try:e,catch:t=>new pf({cause:t})}),Kee=e=>U.gen(function*(){return yield*Ca(()=>Rg(e,Jee)),xe.none()}).pipe(U.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_ASYMMETRIC_JWT\"})));function Gee(e,t){return U.gen(function*(){let r=yield*U.try({try:()=>V0(t).alg,catch:n=>new pf({cause:n})});return r?r===\"HS256\"?yield*Ca(()=>Rg(t,new TextEncoder().encode(e))).pipe(U.as(xe.none()),U.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_JWT\"}))):r===\"ES256\"||r===\"RS256\"?yield*Kee(t):xe.some({code:\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",message:`Unsupported JWT algorithm ${r}`}):xe.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})}).pipe(U.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})))}var q$={lstat:e=>Ca(()=>Deno.lstat(e)).pipe(U.mapError(t=>new sf({cause:t})),U.map(t=>({isDirectory:t.isDirectory,isFile:t.isFile,isSymbolicLink:t.isSymlink}))),realPath:e=>Ca(()=>Deno.realPath(e)).pipe(U.mapError(t=>new sf({cause:t}))),readDirectory:e=>es.suspend(()=>es.fromAsyncIterable(Deno.readDir(e),t=>new pf({cause:t})).pipe(es.map(t=>t.name))).pipe(es.runCollect,U.mapError(t=>new sf({cause:t})))},Vee=e=>n$({root:z$,filesRoot:xe.getOrUndefined(Nn.filesRoot),slug:e,overrides:Z0,fs:q$}),j$=new Set,Zee=(e,t)=>t.importMapDiscoveredByRuntime||!r$(t.importMapPath)||j$.has(e)?U.void:U.sync(()=>j$.add(e)).pipe(U.andThen(tc.warn(`[functions] ${e}: ${t.importMapPath} is not the nearest Deno config of ${t.entrypointPath}, so Edge Runtime loads it as a plain import map without comments or jsr:/npm: subpath imports. Move it next to the entrypoint or into a parent directory without a closer deno.json(c).`))),Yee=o$(()=>Deno.makeTempDirSync({prefix:\"supabase-worker-\"})),Qee=e=>e.importMapPath?U.succeed(!1):s$({root:df(Nn.filesRoot,z$),config:e,fs:q$}),H$=e=>es.fromEffectRepeat(Ca(()=>e.read()).pipe(U.flatMap(t=>t.done?Lt.done():U.succeed(t.value)))),Xee=e=>e===void 0?U.void:es.runDrain(H$(e)).pipe(U.ignore);function ete(e,t){let r=new URL(e.url),n=e.headers.get(\"x-forwarded-host\");n&&(r.hostname=n);let o=new Request(r.href,{method:e.method,headers:e.headers,body:t===void 0?null:es.toReadableStream(H$(t)),signal:e.signal,duplex:\"half\"});return o.headers.delete(\"sb-api-key\"),EdgeRuntime.applySupabaseTag(e,o),o}Deno.serve({handler:e=>U.runPromiseExit(U.gen(function*(){let t=yield*U.acquireRelease(U.sync(()=>e.body?.getReader()),u=>U.interruptible(Xee(u))),{pathname:r}=new URL(e.url);if(r===\"/_internal/health\")return oc({message:\"ok\"},Gr.OK);if(r===\"/_internal/metric\")return Response.json(yield*Ca(()=>EdgeRuntime.getRuntimeMetrics()));let n=r.split(\"/\")[1];if(!n)return oc(\"Function not found\",Gr.NotFound);let o=yield*Vee(n);if(!o)return oc(\"Function not found\",Gr.NotFound);if(yield*Zee(n,o),e.method!==\"OPTIONS\"&&o.verifyJWT){let u=Hee(e);if(typeof u!=\"string\")return B$(u);let f=yield*Gee(_ee,u);if(xe.isSome(f))return B$(f.value)}let s={...Deno.env.toObject(),...Object.fromEntries(Object.entries(o.env??{}).filter(([u])=>!u.startsWith(\"SUPABASE_\"))),SUPABASE_FUNCTION_SLUG:n};L$&&(s.SUPABASE_PUBLISHABLE_KEYS=yield*me.encodeEffect(me.fromJsonString(me.Unknown))({default:L$})),$$&&(s.SUPABASE_SECRET_KEYS=yield*me.encodeEffect(me.fromJsonString(me.Unknown))({default:$$}));let a=Object.entries(s).filter(([u])=>!Oee.has(u)&&!u.startsWith(\"SUPABASE_INTERNAL_\")),i=!(yield*Qee(o));return yield*U.gen(function*(){let u=yield*Ca(()=>EdgeRuntime.userWorkers.create({servicePath:Yee(n,o),memoryLimitMb:256,workerTimeoutMs:Number.isFinite(D$)?D$*1e3:4e5,noModuleCache:!0,noNpm:i,envVars:a,forceCreate:!0,customModuleRoot:\"\",cpuTimeSoftLimitMs:1e3,cpuTimeHardLimitMs:2e3,decoratorType:\"tc39\",maybeEntrypoint:XL(o.entrypointPath).href,context:{useReadSyncFileAPI:!0,...o.importMapPath===\"\"||o.importMapDiscoveredByRuntime?{}:{importMapPath:o.importMapPath}},staticPatterns:o.staticFiles}));return yield*Ca(()=>u.fetch(ete(e,t)))}).pipe(U.retry({times:1,while:({cause:u})=>e.body===null&&Uee(u)}),U.catchTag(\"BootstrapOperationError\",({cause:u})=>tc.error(\"[functions] worker error\",u).pipe(U.andThen(U.succeed(zee(u))))))}).pipe(U.scoped),{signal:e.signal}).then(t=>{if(sr.isSuccess(t))return t.value;if(e.signal.aborted&&Lt.hasInterruptsOnly(t.cause))return new Response(null,{status:499});throw Lt.squash(t.cause)}),onListen:()=>{let t=Object.keys(Z0).slice(0,5).map(r=>` - http://127.0.0.1:${U$}/functions/v1/${r}`);U.runSync(tc.log(`Serving functions on http://127.0.0.1:${U$}/functions/v1/${t.length?`\n${t.join(`\n`)}`:\"\"}\nUsing ${Deno.version.deno}`))},onError:()=>oc({code:_0[500],message:\"Request failed due to an internal server error\"},500)});export{Dee as RequestErrors,qee as extractBearerToken,ete as prepareUserRequest};\n"; From f36fdc020fd4c263cd77851d8d0df725751788ef Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:44:21 -0700 Subject: [PATCH 12/28] refactor(config): keep regex patterns in the generated JSON schema under effect 4.0 Schema.toJsonSchemaDocument now exports an isPattern check only when its RegExp uses the Unicode flag (effect PR 8482); without it the compute and function name patternProperties selectors and the env() pattern disappeared from the published schema. The flag does not change what these ASCII patterns accept. Co-Authored-By: Claude Fable 5.1 --- packages/config/src/compute.ts | 2 +- packages/config/src/functions.ts | 4 ++-- packages/config/src/lib/env.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/config/src/compute.ts b/packages/config/src/compute.ts index cd5dcb85a4..a19cc3dc95 100644 --- a/packages/config/src/compute.ts +++ b/packages/config/src/compute.ts @@ -5,7 +5,7 @@ const tags = ["compute"]; // Compute names end up in hostnames, so they must be valid DNS labels, matching the // Management API's own validation. -const computeName = Schema.String.check(Schema.isPattern(/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/)); +const computeName = Schema.String.check(Schema.isPattern(/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/u)); const computeEntry = Schema.Struct({ runtime: Schema.optionalKey( diff --git a/packages/config/src/functions.ts b/packages/config/src/functions.ts index 2a919695e1..b1ea383d24 100644 --- a/packages/config/src/functions.ts +++ b/packages/config/src/functions.ts @@ -11,7 +11,7 @@ const links = [ }, ]; -const functionName = Schema.String.check(Schema.isPattern(/^[a-zA-Z0-9_-]+$/)); +const functionName = Schema.String.check(Schema.isPattern(/^[a-zA-Z0-9_-]+$/u)); const defaultEnabled = true; const defaultVerifyJwt = true; const defaultFunctions = {}; @@ -20,7 +20,7 @@ const defaultImportMap = ""; const defaultEntrypoint = ""; const defaultStaticFiles: string[] = []; const defaultEnv = {}; -const envName = Schema.String.check(Schema.isPattern(/^[A-Z_][A-Z0-9_]*$/)); +const envName = Schema.String.check(Schema.isPattern(/^[A-Z_][A-Z0-9_]*$/u)); const func = Schema.Struct({ enabled: Schema.Boolean.annotate({ diff --git a/packages/config/src/lib/env.ts b/packages/config/src/lib/env.ts index 81ee02a363..ed026093be 100644 --- a/packages/config/src/lib/env.ts +++ b/packages/config/src/lib/env.ts @@ -6,7 +6,7 @@ export const ENV_PATTERN = "^env\\((.*)\\)$"; export const ENV_CAPTURE_REGEX = /^env\((.*)\)$/; // Stricter matcher used when `goViperCompat` is off: only SCREAMING_SNAKE_CASE names match. export const ENV_CAPTURE_REGEX_STRICT = /^env\(([A-Z_][A-Z0-9_]*)\)$/; -const envRegex = new RegExp(ENV_PATTERN); +const envRegex = new RegExp(ENV_PATTERN, "u"); export function isEnvReference(value: string, goViperCompat: boolean): boolean { return (goViperCompat ? ENV_CAPTURE_REGEX : ENV_CAPTURE_REGEX_STRICT).test(value); From 89370eca5e63f01b77e3e956828917e8f2aeb3c6 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 11:46:05 -0700 Subject: [PATCH 13/28] refactor(config): keep CLI config JSON schema objects closed under effect 4.0 Schema.toJsonSchemaDocument now leaves unmodeled properties open by default (effect PR 8147); passing onExcessProperty "error" restores additionalProperties false on every struct in the published schema.json. Co-Authored-By: Claude Fable 5.1 --- packages/config/src/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/config/src/base.ts b/packages/config/src/base.ts index fc8e7853ff..69e246b7be 100644 --- a/packages/config/src/base.ts +++ b/packages/config/src/base.ts @@ -80,7 +80,7 @@ export const CliConfigSchema = Schema.Struct({ }); export function toCliConfigJsonSchema() { - const document = Schema.toJsonSchemaDocument(CliConfigSchema); + const document = Schema.toJsonSchemaDocument(CliConfigSchema, { onExcessProperty: "error" }); return { $schema: "https://json-schema.org/draft/2020-12/schema", ...document.schema, From 17573c357c44738b6950967d58b9ba422f7686be Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 12:01:27 -0700 Subject: [PATCH 14/28] test(stack): restore the vitest runner patch on top of effect 4.0.1 Upstream's finalizer ordering fix (effect PR 8154) covers the abort hook, so the patch now only adds what the stack's effect-timeout tests assert: rejecting with the pretty errors themselves and reporting a finalizer failure after a timeout. Co-Authored-By: Claude Fable 5.1 --- patches/@effect__vitest@4.0.1.patch | 31 +++++++++++++++++++++++++++++ pnpm-lock.yaml | 7 ++++--- pnpm-workspace.yaml | 1 + 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 patches/@effect__vitest@4.0.1.patch diff --git a/patches/@effect__vitest@4.0.1.patch b/patches/@effect__vitest@4.0.1.patch new file mode 100644 index 0000000000..8074e0173a --- /dev/null +++ b/patches/@effect__vitest@4.0.1.patch @@ -0,0 +1,31 @@ +diff --git a/dist/internal/internal.js b/dist/internal/internal.js +index 7138319bb00fb82572338e74ddc8947aa7c2967e..018a7180229568cdb42db75fe8c0a73a33bc1230 100644 +--- a/dist/internal/internal.js ++++ b/dist/internal/internal.js +@@ -28,12 +28,24 @@ const runPromise = /*#__PURE__*/Effect.fnUntraced(function* (effect, _ctx) { + })); + /** @internal */ + const runTest = ctx => effect => { +- const promise = runPromise(effect, ctx); ++ // Rejects with the pretty errors themselves (an AggregateError when there are several) so ++ // Vitest prints the defect instead of the runtime's squashed wrapper, and reports a cause ++ // that mixes an interrupt with a real failure once the finalizers have run. ++ const failure = cause => { ++ const errors = Cause.prettyErrors(cause); ++ return errors.length > 1 ? new AggregateError(errors) : errors[0] ?? Cause.squash(cause); ++ }; ++ const exitPromise = Effect.runPromiseExit(effect, { ++ signal: ctx?.signal ++ }); ++ const promise = exitPromise.then(exit => Exit.isSuccess(exit) ? exit.value : Promise.reject(failure(exit.cause))); + if (ctx) { + // Vitest stops awaiting the test promise once the signal aborts (timeout or + // cancellation), so only then add a hook that waits for the finalizers. + // Registering it unconditionally would change the teardown of every test. +- const onAbort = () => ctx.onTestFinished(() => promise.then(constVoid, constVoid)); ++ const onAbort = () => ctx.onTestFinished(() => exitPromise.then(exit => { ++ if (Exit.isFailure(exit) && Cause.hasInterrupts(exit.cause) && !Cause.hasInterruptsOnly(exit.cause)) return Promise.reject(failure(exit.cause)); ++ })); + ctx.signal.addEventListener("abort", onAbort, { + once: true + }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0cb14b2d93..9d19922e1a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -234,6 +234,7 @@ overrides: packageExtensionsChecksum: sha256-gAA6Mc6Jn3jUpogzVWO9hE5trVRioaB8peQBgDbyG6I= patchedDependencies: + '@effect/vitest@4.0.1': 9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146 '@libpg-query/parser@17.6.10': ed67c0ca88b6ced3ec50fd6862f191d6192a246cf20d9c777d45efdb8373bed3 importers: @@ -315,7 +316,7 @@ importers: version: 4.0.1(effect@4.0.1) '@effect/vitest': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) + version: 4.0.1(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) '@modelcontextprotocol/sdk': specifier: ^1.30.0 version: 1.30.0(supports-color@7.2.0)(zod@4.5.4) @@ -615,7 +616,7 @@ importers: devDependencies: '@effect/vitest': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) + version: 4.0.1(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) '@tsconfig/bun': specifier: 'catalog:' version: 1.0.11 @@ -7103,7 +7104,7 @@ snapshots: '@effect/tsgo-win32-arm64': 0.37.0 '@effect/tsgo-win32-x64': 0.37.0 - '@effect/vitest@4.0.1(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0)': + '@effect/vitest@4.0.1(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0)': dependencies: effect: 4.0.1 vite: 8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index fdcb49971b..afc015699c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -134,6 +134,7 @@ supportedArchitectures: - win32 patchedDependencies: + "@effect/vitest@4.0.1": patches/@effect__vitest@4.0.1.patch "@libpg-query/parser@17.6.10": patches/@libpg-query__parser@17.6.10.patch virtualStoreType: global From 750f89fff6541015fce1833beeeced701c6d85db Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 12:01:28 -0700 Subject: [PATCH 15/28] refactor(stack): report excess command payload keys with the original wording Co-Authored-By: Claude Fable 5.1 --- packages/stack/src/internal/reject-excess-keys.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/stack/src/internal/reject-excess-keys.ts b/packages/stack/src/internal/reject-excess-keys.ts index ddab9e1962..b95caa1b2d 100644 --- a/packages/stack/src/internal/reject-excess-keys.ts +++ b/packages/stack/src/internal/reject-excess-keys.ts @@ -8,10 +8,11 @@ import { Schema } from "effect"; export const rejectExcessKeys = >(struct: S) => Schema.Record(Schema.String, Schema.Unknown).pipe( Schema.check( - Schema.makeFilter((input) => { - const excess = Object.keys(input).filter((key) => !(key in struct.fields)); - return excess.length === 0 ? undefined : `Unexpected keys: ${excess.join(", ")}`; - }), + Schema.makeFilter((input) => + Object.keys(input) + .filter((key) => !(key in struct.fields)) + .map((key) => ({ path: [key], issue: "Expected no excess property" })), + ), ), Schema.decodeTo(struct), ); From 5562a5ab33c52aa85e8694d538d308a7bd4c7ef9 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 12:02:11 -0700 Subject: [PATCH 16/28] fix(stack): send one statement per query to the native Postgres client @effect/sql-pg 4.0 runs every query through the extended protocol, which rejects multi-command strings (effect PR 7426). The realtime schema bootstrap runs as two statements, and the generated ALTER ROLE and ALTER DATABASE batches come back from Postgres as an array and execute one at a time inside the same transaction. Tests that seeded fixtures through the client do the same. Co-Authored-By: Claude Fable 5.1 --- .../host/LogflareStorage.integration.test.ts | 18 +++++++++-------- .../stack/src/runtime/DatabaseBootstrap.ts | 16 ++++++++++----- .../src/runtime/PostgresDatabaseSession.ts | 11 +++++----- ...tgres-database-session.integration.test.ts | 20 +++++++++++-------- .../src/services/Database.integration.test.ts | 17 +++++++++++++--- 5 files changed, 53 insertions(+), 29 deletions(-) diff --git a/packages/stack/src/host/LogflareStorage.integration.test.ts b/packages/stack/src/host/LogflareStorage.integration.test.ts index e379409061..12bc7aa0bd 100644 --- a/packages/stack/src/host/LogflareStorage.integration.test.ts +++ b/packages/stack/src/host/LogflareStorage.integration.test.ts @@ -50,14 +50,16 @@ const analyticsDatabase = Effect.gen(function* () { yield* Effect.scoped( Effect.gen(function* () { const services = yield* Layer.build(PgClient.layer({ url: Redacted.make(database.url) })); - yield* Context.get(services, PgClient.PgClient).unsafe(` - CREATE SCHEMA IF NOT EXISTS _analytics; - CREATE TABLE _analytics.sources (name text NOT NULL, token uuid NOT NULL); - INSERT INTO _analytics.sources VALUES - ('postgres.logs', '${sourceToken}'), ('auth.logs', '${uncreatedToken}'); - CREATE TABLE _analytics."log_events_${sourceToken.replaceAll("-", "_")}" (id uuid PRIMARY KEY); - INSERT INTO _analytics."log_events_${sourceToken.replaceAll("-", "_")}" VALUES ('${storedId}'); - `); + const client = Context.get(services, PgClient.PgClient); + const eventsTable = `_analytics."log_events_${sourceToken.replaceAll("-", "_")}"`; + for (const statement of [ + "CREATE SCHEMA IF NOT EXISTS _analytics", + "CREATE TABLE _analytics.sources (name text NOT NULL, token uuid NOT NULL)", + `INSERT INTO _analytics.sources VALUES ('postgres.logs', '${sourceToken}'), ('auth.logs', '${uncreatedToken}')`, + `CREATE TABLE ${eventsTable} (id uuid PRIMARY KEY)`, + `INSERT INTO ${eventsTable} VALUES ('${storedId}')`, + ]) + yield* client.unsafe(statement); }), ); return { database, socket: `${endpoint.path}/.s.PGSQL.${endpoint.port}` }; diff --git a/packages/stack/src/runtime/DatabaseBootstrap.ts b/packages/stack/src/runtime/DatabaseBootstrap.ts index 9b7f765894..86a12f3f26 100644 --- a/packages/stack/src/runtime/DatabaseBootstrap.ts +++ b/packages/stack/src/runtime/DatabaseBootstrap.ts @@ -74,8 +74,12 @@ export interface DatabaseSession { ) => Effect.Effect; } -const REALTIME_SCHEMA_STATEMENT = - "CREATE SCHEMA IF NOT EXISTS _realtime;\nALTER SCHEMA _realtime OWNER TO postgres;"; +// One statement per string: the native Postgres client sends every query through the extended +// protocol, which rejects multiple commands. +const REALTIME_SCHEMA_STATEMENTS = [ + "CREATE SCHEMA IF NOT EXISTS _realtime;", + "ALTER SCHEMA _realtime OWNER TO postgres;", +]; const ADVISORY_LOCK_STATEMENT = `SELECT pg_advisory_xact_lock(hashtext('supabase_internal.bootstrap'));`; /** Private database created outside the bootstrap transaction. */ @@ -101,9 +105,11 @@ export const runDatabaseBootstrap = Effect.fn("DatabaseBootstrap.run")(function* yield* transaction .execute(ADVISORY_LOCK_STATEMENT) .pipe(Effect.mapError((error) => statementError(error, ADVISORY_LOCK_STATEMENT))); - yield* transaction - .execute(REALTIME_SCHEMA_STATEMENT) - .pipe(Effect.mapError((error) => statementError(error, REALTIME_SCHEMA_STATEMENT))); + for (const statement of REALTIME_SCHEMA_STATEMENTS) { + yield* transaction + .execute(statement) + .pipe(Effect.mapError((error) => statementError(error, statement))); + } yield* transaction.execute("SET LOCAL log_statement = 'none'"); yield* transaction.execute("SET LOCAL log_min_error_statement = 'panic'"); yield* transaction.execute("SET LOCAL log_min_duration_statement = -1"); diff --git a/packages/stack/src/runtime/PostgresDatabaseSession.ts b/packages/stack/src/runtime/PostgresDatabaseSession.ts index a196b2a6f1..52d07dd4c9 100644 --- a/packages/stack/src/runtime/PostgresDatabaseSession.ts +++ b/packages/stack/src/runtime/PostgresDatabaseSession.ts @@ -36,7 +36,7 @@ const mapSqlError = (operation === "connection" && Predicate.isTagged(error.reason, "UnknownError"))), }); -const GeneratedStatementSchema = Schema.Struct({ statement: Schema.String }); +const GeneratedStatementsSchema = Schema.Struct({ statements: Schema.Array(Schema.String) }); /** * Adapts Effect SQL to the runtime-neutral bootstrap boundary. Dynamic @@ -78,10 +78,11 @@ export const makeDatabaseSessionFromSqlClient = ( .unsafe(format, parameters) .pipe(Effect.mapError(mapSqlError("statement preparation"))); const first = rows[0]; - const decoded = yield* Schema.decodeUnknownEffect(GeneratedStatementSchema)(first).pipe( + const decoded = yield* Schema.decodeUnknownEffect(GeneratedStatementsSchema)(first).pipe( Effect.mapError(() => sqlFailure("statement preparation")), ); - yield* executeWith(decoded.statement); + // One statement per execution: the native client's extended protocol rejects batches. + for (const statement of decoded.statements) yield* executeWith(statement); }); }); @@ -90,7 +91,7 @@ export const makeDatabaseSessionFromSqlClient = ( setRolePasswords: (roles, password) => { const placeholders = roles.map((_, index) => `$${index + 2}::text`).join(", "); return generated( - `SELECT string_agg(format('ALTER ROLE %I PASSWORD %L', role, $1::text), E';\\n') AS statement FROM unnest(ARRAY[${placeholders}]::text[]) AS role`, + `SELECT array_agg(format('ALTER ROLE %I PASSWORD %L', role, $1::text)) AS statements FROM unnest(ARRAY[${placeholders}]::text[]) AS role`, [Redacted.value(password), ...roles], ); }, @@ -103,7 +104,7 @@ export const makeDatabaseSessionFromSqlClient = ( setting.name === JWT_SECRET_SETTING ? Redacted.value(setting.value) : setting.value, ]); return generated( - `SELECT string_agg(format('ALTER DATABASE postgres SET %I TO %L', name, value), E';\\n') AS statement FROM (VALUES ${values}) AS settings(name, value)`, + `SELECT array_agg(format('ALTER DATABASE postgres SET %I TO %L', name, value)) AS statements FROM (VALUES ${values}) AS settings(name, value)`, parameters, ); }, diff --git a/packages/stack/src/runtime/postgres-database-session.integration.test.ts b/packages/stack/src/runtime/postgres-database-session.integration.test.ts index cc292428a3..3c4da6a563 100644 --- a/packages/stack/src/runtime/postgres-database-session.integration.test.ts +++ b/packages/stack/src/runtime/postgres-database-session.integration.test.ts @@ -243,12 +243,15 @@ describe("Postgres database session", () => { unsafe: (sql, params = []) => Effect.sync(() => { calls.push({ sql, params }); - if (sql.startsWith("SELECT string_agg")) + if (sql.startsWith("SELECT array_agg")) return [ { - statement: sql.includes("ALTER ROLE") - ? "ALTER ROLE postgres PASSWORD 'database-secret'" - : "ALTER DATABASE postgres SET app.settings.jwt_secret TO 'jwt-secret'; ALTER DATABASE postgres SET app.settings.jwt_exp TO '3600'", + statements: sql.includes("ALTER ROLE") + ? ["ALTER ROLE postgres PASSWORD 'database-secret'"] + : [ + "ALTER DATABASE postgres SET app.settings.jwt_secret TO 'jwt-secret'", + "ALTER DATABASE postgres SET app.settings.jwt_exp TO '3600'", + ], }, ]; return []; @@ -266,15 +269,16 @@ describe("Postgres database session", () => { }), ); expect(calls[0]).toEqual({ - sql: "SELECT string_agg(format('ALTER ROLE %I PASSWORD %L', role, $1::text), E';\\n') AS statement FROM unnest(ARRAY[$2::text]::text[]) AS role", + sql: "SELECT array_agg(format('ALTER ROLE %I PASSWORD %L', role, $1::text)) AS statements FROM unnest(ARRAY[$2::text]::text[]) AS role", params: ["database-secret", "postgres"], }); expect(calls[1]?.sql).toContain("ALTER ROLE postgres PASSWORD"); expect(calls[2]).toEqual({ - sql: "SELECT string_agg(format('ALTER DATABASE postgres SET %I TO %L', name, value), E';\\n') AS statement FROM (VALUES ($1::text, $2::text), ($3::text, $4::text)) AS settings(name, value)", + sql: "SELECT array_agg(format('ALTER DATABASE postgres SET %I TO %L', name, value)) AS statements FROM (VALUES ($1::text, $2::text), ($3::text, $4::text)) AS settings(name, value)", params: ["app.settings.jwt_secret", "jwt-secret", "app.settings.jwt_exp", 3600], }); expect(calls[3]?.sql).toContain("ALTER DATABASE postgres SET app.settings.jwt_secret"); + expect(calls[4]?.sql).toContain("ALTER DATABASE postgres SET app.settings.jwt_exp"); }), ); @@ -282,8 +286,8 @@ describe("Postgres database session", () => { Effect.gen(function* () { const client: DatabaseSqlClient = { unsafe: (sql) => - sql.startsWith("SELECT string_agg") - ? Effect.succeed([{ statement: "ALTER ROLE postgres PASSWORD 'database-secret'" }]) + sql.startsWith("SELECT array_agg") + ? Effect.succeed([{ statements: ["ALTER ROLE postgres PASSWORD 'database-secret'"] }]) : Effect.fail( new SqlError({ reason: new UnknownError({ diff --git a/packages/stack/src/services/Database.integration.test.ts b/packages/stack/src/services/Database.integration.test.ts index 0e4d76937c..614e066f24 100644 --- a/packages/stack/src/services/Database.integration.test.ts +++ b/packages/stack/src/services/Database.integration.test.ts @@ -96,7 +96,12 @@ describe("database component", { timeout: 180_000 }, () => { yield* query( endpoint, defaults.databasePassword, - "CREATE EXTENSION IF NOT EXISTS pgsodium; CREATE EXTENSION IF NOT EXISTS supabase_vault", + "CREATE EXTENSION IF NOT EXISTS pgsodium", + ); + yield* query( + endpoint, + defaults.databasePassword, + "CREATE EXTENSION IF NOT EXISTS supabase_vault", ); const derivation = "SELECT encode(pgsodium.derive_key(1), 'hex') AS key"; const originalKey = yield* query(endpoint, defaults.databasePassword, derivation); @@ -187,10 +192,11 @@ describe("database component", { timeout: 180_000 }, () => { "postgres", ).pipe(Effect.flip); expect(Predicate.isTagged(rejected.reason, "AuthenticationError")).toBe(true); + yield* query(endpoint, config.databasePassword, "CREATE EXTENSION dblink"); yield* query( endpoint, config.databasePassword, - "CREATE EXTENSION dblink; CREATE ROLE dblink_probe LOGIN PASSWORD 'probe-password'", + "CREATE ROLE dblink_probe LOGIN PASSWORD 'probe-password'", ); const connected = yield* query( endpoint, @@ -262,7 +268,12 @@ describe("database component", { timeout: 180_000 }, () => { yield* query( firstEndpoint, config.databasePassword, - "ALTER ROLE supabase_admin SET log_statement = 'all'; ALTER ROLE supabase_admin SET log_min_duration_statement = 0", + "ALTER ROLE supabase_admin SET log_statement = 'all'", + ); + yield* query( + firstEndpoint, + config.databasePassword, + "ALTER ROLE supabase_admin SET log_min_duration_statement = 0", ); yield* service.restart(loggedConfig); yield* service.ready; From 58699cf506773dbcbe5510729a08292eeee1c891 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 5 Oct 2026 14:54:05 -0700 Subject: [PATCH 17/28] refactor(config): keep the published JSON Schema byte-identical under effect 4.0 The 4.0 generator writes a boolean additionalProperties on pattern-keyed records and renders an empty struct as not-null (effect PRs 8131 and 8147), neither of which has a per-schema setting. Both published documents now go through one assembler that leaves pattern-keyed records open, and empty bucket tables are modelled as an object-or-array union so they render as before. schema.json and project-schema.json match the develop build byte for byte. Co-Authored-By: Claude Fable 5.1 --- packages/config/src/base.ts | 10 ++--- .../config/src/entrypoint-purity.unit.test.ts | 1 + packages/config/src/json-schema-document.ts | 34 ++++++++++++++++ .../src/json-schema-document.unit.test.ts | 40 +++++++++++++++++++ .../src/project-config/project-schema.ts | 12 ++---- .../project-schema.unit.test.ts | 6 +-- packages/config/src/storage.ts | 15 ++++--- 7 files changed, 94 insertions(+), 24 deletions(-) create mode 100644 packages/config/src/json-schema-document.ts create mode 100644 packages/config/src/json-schema-document.unit.test.ts diff --git a/packages/config/src/base.ts b/packages/config/src/base.ts index 69e246b7be..a13a079fd8 100644 --- a/packages/config/src/base.ts +++ b/packages/config/src/base.ts @@ -7,6 +7,7 @@ import { edge_runtime } from "./edge_runtime.ts"; import { experimental } from "./experimental.ts"; import { functions } from "./functions.ts"; import { inbucket } from "./inbucket.ts"; +import { toPublishedJsonSchemaDocument } from "./json-schema-document.ts"; import { realtime } from "./realtime.ts"; import { storage } from "./storage.ts"; import { studio } from "./studio.ts"; @@ -80,12 +81,9 @@ export const CliConfigSchema = Schema.Struct({ }); export function toCliConfigJsonSchema() { - const document = Schema.toJsonSchemaDocument(CliConfigSchema, { onExcessProperty: "error" }); - return { - $schema: "https://json-schema.org/draft/2020-12/schema", - ...document.schema, - ...(Object.keys(document.definitions).length > 0 ? { $defs: document.definitions } : {}), - }; + return toPublishedJsonSchemaDocument( + Schema.toJsonSchemaDocument(CliConfigSchema, { onExcessProperty: "error" }), + ); } export type CliConfig = typeof CliConfigSchema.Type; diff --git a/packages/config/src/entrypoint-purity.unit.test.ts b/packages/config/src/entrypoint-purity.unit.test.ts index 92473d5e5e..c0f68f0c96 100644 --- a/packages/config/src/entrypoint-purity.unit.test.ts +++ b/packages/config/src/entrypoint-purity.unit.test.ts @@ -274,6 +274,7 @@ const { visitedFiles, bareSpecifiers } = collectImportGraph(join(srcDir, "index. const expectedPureGraphFiles = [ "index.ts", "base.ts", + "json-schema-document.ts", "errors.ts", "config-document.ts", "config-diff.ts", diff --git a/packages/config/src/json-schema-document.ts b/packages/config/src/json-schema-document.ts new file mode 100644 index 0000000000..3b996c03a9 --- /dev/null +++ b/packages/config/src/json-schema-document.ts @@ -0,0 +1,34 @@ +/** + * Assembles a published JSON Schema document from a generated schema and its definitions. + * Pattern-keyed records stay open: the generator now writes a boolean `additionalProperties` + * on them (effect 4.0) and has no per-schema setting, while the published documents never + * carried one there. Structs keep theirs. + */ +export function toPublishedJsonSchemaDocument(document: { + readonly schema: Record; + readonly definitions: Record; +}) { + return { + $schema: "https://json-schema.org/draft/2020-12/schema", + ...openPatternKeyedRecords(document.schema), + ...(Object.keys(document.definitions).length > 0 + ? { $defs: openPatternKeyedRecords(document.definitions) } + : {}), + }; +} + +function openPatternKeyedRecords(node: T): T { + if (Array.isArray(node)) return node.map(openPatternKeyedRecords) as T; + if (typeof node !== "object" || node === null) return node; + const out: Record = {}; + for (const [key, value] of Object.entries(node)) out[key] = openPatternKeyedRecords(value); + if (isRecordLike(out) && typeof out["additionalProperties"] === "boolean") { + delete out["additionalProperties"]; + } + return out as T; +} + +function isRecordLike(node: Record): boolean { + const patternProperties = node["patternProperties"]; + return typeof patternProperties === "object" && patternProperties !== null; +} diff --git a/packages/config/src/json-schema-document.unit.test.ts b/packages/config/src/json-schema-document.unit.test.ts new file mode 100644 index 0000000000..efa0e87e9c --- /dev/null +++ b/packages/config/src/json-schema-document.unit.test.ts @@ -0,0 +1,40 @@ +import { describe, expect, test } from "vitest"; +import { toCliConfigJsonSchema } from "./base.ts"; +import { toProjectConfigJsonSchema } from "./project-config/project-schema.ts"; + +type Node = Record; + +const at = (node: unknown, ...path: ReadonlyArray): Node => { + let current: unknown = node; + for (const key of path) current = (current as Record)[key]; + return current as Node; +}; + +describe("published JSON Schema documents", () => { + test("pattern-keyed records stay open while structs stay closed", () => { + const cli = toCliConfigJsonSchema(); + const functions = at(cli, "properties", "functions", "anyOf", 0); + expect(Object.keys(functions.patternProperties as Node)).toHaveLength(1); + expect(functions).not.toHaveProperty("additionalProperties"); + expect(at(cli, "properties", "api")).toHaveProperty("additionalProperties", false); + + const project = toProjectConfigJsonSchema(); + expect(at(project, "properties", "compute")).not.toHaveProperty("additionalProperties"); + }); + + test("empty bucket tables render as object or array", () => { + const project = toProjectConfigJsonSchema(); + const buckets = at( + project, + "properties", + "storage", + "properties", + "analytics", + "properties", + "buckets", + ); + expect(buckets.additionalProperties).toEqual({ + anyOf: [{ type: "object" }, { type: "array" }], + }); + }); +}); diff --git a/packages/config/src/project-config/project-schema.ts b/packages/config/src/project-config/project-schema.ts index f5468931fd..567469d90e 100644 --- a/packages/config/src/project-config/project-schema.ts +++ b/packages/config/src/project-config/project-schema.ts @@ -9,6 +9,7 @@ import type { StandardSchemaV1 } from "@standard-schema/spec"; import { Schema, SchemaAST } from "effect"; import { CliConfigSchema } from "../base.ts"; +import { toPublishedJsonSchemaDocument } from "../json-schema-document.ts"; import { isDocumentOnlyLocalPath } from "./hosted-sections.ts"; import type { ProjectConfig } from "./project-config.ts"; @@ -138,12 +139,7 @@ export const ProjectConfigSchema: StandardSchemaV1< /** JSON Schema (draft 2020-12) rendering of {@link ProjectConfigSchema}. */ export function toProjectConfigJsonSchema() { - const document = Schema.toJsonSchemaDocument(ProjectConfigSchema, { - onExcessProperty: "ignore", - }); - return { - $schema: "https://json-schema.org/draft/2020-12/schema", - ...document.schema, - ...(Object.keys(document.definitions).length > 0 ? { $defs: document.definitions } : {}), - }; + return toPublishedJsonSchemaDocument( + Schema.toJsonSchemaDocument(ProjectConfigSchema, { onExcessProperty: "ignore" }), + ); } diff --git a/packages/config/src/project-config/project-schema.unit.test.ts b/packages/config/src/project-config/project-schema.unit.test.ts index c82905ffe3..d7b131a7de 100644 --- a/packages/config/src/project-config/project-schema.unit.test.ts +++ b/packages/config/src/project-config/project-schema.unit.test.ts @@ -225,9 +225,7 @@ describe("ProjectConfigSchema secret-strip exhaustiveness", () => { const emptyObjectPaths: string[] = []; collectEmptyObjectPaths(ProjectConfigSchema.ast, [], new Set(), emptyObjectPaths); - expect(emptyObjectPaths.toSorted()).toEqual( - ["storage.analytics.buckets.*", "storage.vector.buckets.*"].toSorted(), - ); + expect(emptyObjectPaths).toEqual([]); }); }); @@ -387,7 +385,7 @@ describe("ProjectConfigSchema derivation AST-walk exhaustiveness", () => { // `Suspend` unhandled; this walks the actual derived AST and fails loudly if a node kind outside // that set appears, instead of silently falling through to the leaf case. const HANDLED_CONTAINER_TAGS = new Set(["Objects", "Arrays", "Union"]); - const HANDLED_LEAF_TAGS = new Set(["String", "Number", "Boolean", "Literal"]); + const HANDLED_LEAF_TAGS = new Set(["String", "Number", "Boolean", "Literal", "Unknown"]); function walk(ast: SchemaAST.AST, seen: Set): void { if (seen.has(ast)) { diff --git a/packages/config/src/storage.ts b/packages/config/src/storage.ts index bab02e7ef3..01a5756fda 100644 --- a/packages/config/src/storage.ts +++ b/packages/config/src/storage.ts @@ -30,6 +30,13 @@ const defaultMaxBuckets = 10; const defaultMaxIndexes = 5; const defaultVectorBuckets = {}; +// Keeps the published `anyOf` object/array rendering of a bucket table; `Schema.Struct({})` +// exports as `not: { type: "null" }` since effect 4.0. +const emptyTable = Schema.Union([ + Schema.Record(Schema.String, Schema.Unknown), + Schema.Array(Schema.Unknown), +]); + // Accepts a human-readable string (`"50MiB"`) or a bare byte count (`5000000`); a numeric // value is normalized to its decimal string so the decoded type is always a `string`. const fileSizeLimit = Schema.Union([Schema.String, Schema.Number]).pipe( @@ -139,9 +146,7 @@ export const storage = Schema.Struct({ }).pipe(Schema.withDecodingDefaultKey(Effect.succeed(defaultMaxCatalogs))), buckets: Schema.Record( Schema.String, - Schema.Struct({}).pipe( - Schema.withDecodingDefault(Effect.succeed({ ...defaultAnalyticsBuckets })), - ), + emptyTable.pipe(Schema.withDecodingDefault(Effect.succeed({ ...defaultAnalyticsBuckets }))), ) .annotate({ default: defaultAnalyticsBuckets, @@ -171,9 +176,7 @@ export const storage = Schema.Struct({ }).pipe(Schema.withDecodingDefaultKey(Effect.succeed(defaultMaxIndexes))), buckets: Schema.Record( Schema.String, - Schema.Struct({}).pipe( - Schema.withDecodingDefault(Effect.succeed({ ...defaultVectorBuckets })), - ), + emptyTable.pipe(Schema.withDecodingDefault(Effect.succeed({ ...defaultVectorBuckets }))), ) .annotate({ default: defaultVectorBuckets, From 1458e75fa990cdcdda7918def7fdd53114f64b4b Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Wed, 7 Oct 2026 20:17:48 -0700 Subject: [PATCH 18/28] chore(deps): bump effect and @effect/* to 4.0.2 Patch release only; the vitest runner patch is re-keyed to 4.0.2 with the same content, and the stack functions bootstrap bundle is regenerated after the merge. Generated with AI Co-Authored-By: Claude --- .../functions/generated/serve-main-bundle.ts | 2 +- ....0.1.patch => @effect__vitest@4.0.2.patch} | 0 pnpm-lock.yaml | 119 +++++++++--------- pnpm-workspace.yaml | 24 ++-- 4 files changed, 76 insertions(+), 69 deletions(-) rename patches/{@effect__vitest@4.0.1.patch => @effect__vitest@4.0.2.patch} (100%) diff --git a/packages/stack/src/functions/generated/serve-main-bundle.ts b/packages/stack/src/functions/generated/serve-main-bundle.ts index 49eb8eaa9b..29ab22b1de 100644 --- a/packages/stack/src/functions/generated/serve-main-bundle.ts +++ b/packages/stack/src/functions/generated/serve-main-bundle.ts @@ -1,3 +1,3 @@ // Generated by packages/stack/scripts/generate-functions-bootstrap.ts; run `pnpm generate`. /** Bundled Edge Runtime main service used when a Functions creation has no bootstrap. */ -export const defaultFunctionsBootstrap = "var J$=Object.defineProperty;var Eo=(e,t)=>{for(var r in t)J$(e,r,{get:t[r],enumerable:!0})};var Z=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let r=e;for(let n=0,o=t.length;nt(r,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(r,n){return arguments.length>=2?t(r,n):function(o){return t(o,r)}};case 3:return function(r,n,o){return arguments.length>=3?t(r,n,o):function(s){return t(s,r,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(n){return t(n,...r)}}}};var R=e=>e;var je=e=>()=>e,Er=je(!0),hf=je(!1),Mg=je(null),Sn=je(void 0),Un=Sn;function Fg(e,...t){return Z(e,t)}function Y0(e,t,r,n,o,s,a,i,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return r(t(e.apply(this,arguments)))};case 4:return function(){return n(r(t(e.apply(this,arguments))))};case 5:return function(){return o(n(r(t(e.apply(this,arguments)))))};case 6:return function(){return s(o(n(r(t(e.apply(this,arguments))))))};case 7:return function(){return a(s(o(n(r(t(e.apply(this,arguments)))))))};case 8:return function(){return i(a(s(o(n(r(t(e.apply(this,arguments))))))))};case 9:return function(){return c(i(a(s(o(n(r(t(e.apply(this,arguments)))))))))}}}function Zr(e){let t=new WeakMap;return r=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),o}}function va(e){let t=new WeakMap;return r=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),o!==r&&t.set(o,o),o}}var Lt={};Eo(Lt,{AsyncFiberError:()=>bq,AsyncFiberErrorTypeId:()=>yq,Done:()=>rb,DoneTypeId:()=>fq,ExceededCapacityError:()=>nb,ExceededCapacityErrorTypeId:()=>gq,IllegalArgumentError:()=>pl,IllegalArgumentErrorTypeId:()=>mq,InterruptorStackTrace:()=>GS,NoSuchElementError:()=>uq,NoSuchElementErrorTypeId:()=>cq,ReasonTypeId:()=>Wz,StackTrace:()=>KS,TimeoutError:()=>dq,TimeoutErrorTypeId:()=>lq,TypeId:()=>Hz,UnknownError:()=>Tq,UnknownErrorTypeId:()=>Eq,annotate:()=>wq,annotations:()=>Aq,combine:()=>Yz,die:()=>oi,done:()=>ee,empty:()=>Gz,fail:()=>Vz,filterInterruptors:()=>sq,findDefect:()=>ll,findDie:()=>tq,findError:()=>eb,findErrorOption:()=>Xz,findFail:()=>Qz,findInterrupt:()=>nq,fromReasons:()=>Uc,hasDies:()=>eq,hasFails:()=>XS,hasInterrupts:()=>rq,hasInterruptsOnly:()=>QS,interrupt:()=>Zz,interruptors:()=>oq,isAsyncFiberError:()=>Sq,isCause:()=>VS,isDieReason:()=>Jz,isDone:()=>Dc,isExceededCapacityError:()=>xq,isFailReason:()=>fl,isIllegalArgumentError:()=>hq,isInterruptReason:()=>Kz,isNoSuchElementError:()=>iq,isReason:()=>ZS,isTimeoutError:()=>pq,isUnknownError:()=>Iq,makeDieReason:()=>vm,makeFailReason:()=>km,makeInterruptReason:()=>YS,map:()=>ms,pretty:()=>tb,prettyErrors:()=>aq,reasonAnnotations:()=>Cq,squash:()=>Om});var xf=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(\"stack\");let r=Object.getPrototypeOf(e),n=r;for(;n!==null&&n!==Object.prototype;){let o=Reflect.ownKeys(n);for(let s=0;snew Uint8Array(e.buffer,e.byteOffset,e.byteLength);var Oa=0,X0=()=>{Oa++};function Ir(e){return typeof e==\"string\"}function yf(e){return typeof e==\"number\"}function nd(e){return typeof e==\"boolean\"}function eC(e){return typeof e==\"bigint\"}function Ng(e){return typeof e==\"symbol\"}function od(e){return Ir(e)||yf(e)||Ng(e)}function Yr(e){return typeof e==\"function\"}function tC(e){return e===void 0}function Io(e){return e!==void 0}function sd(e){return e!=null}function rC(e){return!1}function Ug(e){return!0}function ur(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}function Sf(e){return typeof e==\"object\"&&e!==null||Yr(e)}var A=l(2,(e,t)=>Sf(e)&&t in e),Ct=l(2,(e,t)=>A(e,\"_tag\")&&e._tag===t);function nC(e){return e instanceof Error}function ns(e){return A(e,Symbol.iterator)||Ir(e)}var se=\"~effect/Hash\",H=e=>{switch(typeof e){case\"number\":return It(e);case\"bigint\":return _e(e.toString(10));case\"string\":return _e(e);case\"function\":case\"object\":{if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?_e(\"Invalid Date\"):_e(e.toISOString());if(e instanceof RegExp)return _e(e.toString());{if(sc.has(e))return ad(e);let t=sC.get(e);if(t!==void 0)return t;if($g.has(e))return X0(),_e(\"[Circular]\");$g.add(e);let r=Oa,n;try{se in e?n=e[se]():typeof e==\"function\"?n=ad(e):e instanceof DataView?n=To(gf(e)):Array.isArray(e)||ArrayBuffer.isView(e)?n=To(e):e instanceof Map?n=K$(e):e instanceof Set?n=G$(e):n=bf(e)}finally{$g.delete(e)}return r===Oa&&sC.set(e,n),n}}}return zt(aC(_e(String(e))))},ad=e=>(Lg.has(e)||Lg.set(e,zt(Math.random()*4294967296|0)),Lg.get(e)),aC=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),fe=l(2,(e,t)=>aC(Math.imul(e,2654435761)+Math.imul(t,2246822507))),zt=e=>e&3221225471|e>>>1&1073741824;var Dg=new DataView(new ArrayBuffer(8)),It=e=>{let t=e|0;return t===e?zt(t):(Dg.setFloat64(0,e!==e?NaN:e),zt(fe(Dg.getInt32(0),Dg.getInt32(4))))},_e=e=>{let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return zt(t)},Bg=(e,t)=>{let r=12289;for(let n of t)r^=fe(H(n),H(e[n]));return zt(r)},bf=e=>Bg(e,xf(e)),iC=(e,t)=>r=>{let n=e;for(let o of r)n^=t(o);return zt(n)},To=e=>{let t=6151;for(let r of e)t=fe(t,H(r));return zt(t)},K$=iC(_e(\"Map\"),([e,t])=>fe(H(e),H(t))),oC=_e(\"Set\"),G$=iC(oC,e=>fe(oC,H(e))),Lg=new WeakMap,sC=new WeakMap,$g=new WeakSet;var ae=\"~effect/Equal\";function W(){return arguments.length===1?e=>_a(e,arguments[0]):_a(arguments[0],arguments[1])}function _a(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let r=typeof e;return r!==typeof t?!1:r===\"number\"&&e!==e&&t!==t?!0:r!==\"object\"&&r!==\"function\"||sc.has(e)||sc.has(t)?!1:V$(e,t)}function V$(e,t){let r=id.length;for(let s=r;s-- >0;)if(id[s]===e&&jg[s]===t)return!0;if(r)return cC(e,t);let n=uC.get(e);n||uC.set(e,n=new WeakMap);let o=n.get(t);return o===void 0&&n.set(t,o=cC(e,t)),o}function cC(e,t){id.push(e),jg.push(t);try{return Z$(e,t)}finally{id.pop(),jg.pop()}}var id=[],jg=[],uC=new WeakMap;function Z$(e,t){if(H(e)!==H(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),o=t.getTime();return n===o||Number.isNaN(n)&&Number.isNaN(o)}else if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let r=lC(e);if(r!==lC(t)||typeof e==\"function\"&&!r)return!1;if(r)return e[ae](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Y$(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?fC(gf(e),gf(t)):fC(e,t)}else{if(e instanceof Map)return!(t instanceof Map)||e.size!==t.size?!1:zg(e,t,X$,eB);if(e instanceof Set)return!(t instanceof Set)||e.size!==t.size?!1:zg(e,t,H,_a)}return Q$(e,t)}function Y$(e,t){for(let r=0;rH(e[0]),eB=(e,t)=>_a(e[0],t[0])&&_a(e[1],t[1]),tB=()=>0;function cd(e,t){return Ef((r,n)=>e(r[0],n[0])&&t(r[1],n[1]))}function Ef(e){return function(r,n){return zg(r,n,tB,e)}}var lC=e=>A(e,ae),qg=()=>W;var pC=e=>(sc.add(e),e);var Ra=Symbol.for(\"~effect/Redactable\"),rB=e=>A(e,Ra);function Ds(e){return rB(e)?Hg(e):e}function Hg(e){return e[Ra](globalThis[ac]?.context??nB)}var ac=\"~effect/Fiber/currentFiber\",dC=new Map,nB={\"~effect/Context\":{},base:dC,depth:0,mapUnsafe:dC,pipe(){return Z(this,arguments)}};function F(e,t){let r=t?.space??0,n=new WeakSet,o=r?typeof r==\"number\"?\" \".repeat(r):r:\"\",s=f=>o.repeat(f),a=(f,p)=>{let d=f?.constructor;return d&&d!==Object.prototype.constructor&&d.name?`${d.name}(${p})`:p},i=f=>{try{return Reflect.ownKeys(f)}catch{return[\"[ownKeys threw]\"]}};function c(f,p=0){try{return u(f,p)}catch{return(typeof f==\"object\"&&f!==null||typeof f==\"function\")&&n.delete(f),\"[inspection threw]\"}}function u(f,p=0){if(typeof f==\"string\")return JSON.stringify(f);if(typeof f==\"number\"||f==null||typeof f==\"boolean\"||typeof f==\"symbol\")return String(f);if(typeof f==\"bigint\")return String(f)+\"n\";if(typeof f==\"object\"||typeof f==\"function\"){if(n.has(f))return oB;n.add(f);let d;if(Ra in f)d=c(Hg(f),p);else if(Array.isArray(f))d=!o||f.length<=1?`[${f.map(m=>c(m,p)).join(\",\")}]`:`[\n${s(p+1)}${f.map(m=>c(m,p+1)).join(`,\n`+s(p+1))}\n${s(p)}]`;else if(f instanceof Date)d=Wg(f);else if(!t?.ignoreToString&&A(f,\"toString\")&&typeof f.toString==\"function\"&&f.toString!==Object.prototype.toString&&f.toString!==Array.prototype.toString){let m=sB(f);d=f instanceof Error&&f.cause!==void 0?`${m} (cause: ${c(f.cause,p)})`:m}else if(Symbol.iterator in f)d=`${f.constructor.name}(${c(Array.from(f),p)})`;else{let m=i(f);if(!o||m.length<=1){let x=`{${m.map(y=>`${wo(y)}:${c(hC(f,y),p)}`).join(\",\")}}`;d=a(f,x)}else{let x=`{\n${m.map(y=>`${s(p+1)}${wo(y)}: ${c(hC(f,y),p+1)}`).join(`,\n`)}\n${s(p)}}`;d=a(f,x)}}return n.delete(f),d}return String(f)}return c(e,0)}var oB=\"[Circular]\";function wo(e){return typeof e==\"string\"?JSON.stringify(e):String(e)}function ud(e){return e.map(t=>`[${wo(t)}]`).join(\"\")}function Wg(e){try{return e.toISOString()}catch{return\"Invalid Date\"}}function sB(e){try{let t=e.toString();return typeof t==\"string\"?t:String(t)}catch{return\"[toString threw]\"}}function hC(e,t){try{return e[t]}catch{return\"[property access threw]\"}}function Pa(e,t){let r=[];return JSON.stringify(e,function(n,o){let s=Object.getOwnPropertyDescriptor(this,n)?.value,a=A(s,Ra)?Ds(s):Ds(o);if(typeof a==\"bigint\")return F(a);if(typeof a!=\"object\"||a===null)return a;let i=a instanceof Error&&!A(a,\"toJSON\")?{...a,name:a.name,message:a.message}:a;for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(!r.includes(a))return r.push(a),i!==a&&r.push(i),i},t?.space)??\"null\"}var Ie=Symbol.for(\"nodejs.util.inspect.custom\"),kt=e=>{try{return e=Ds(e),A(e,\"toJSON\")&&Yr(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(kt):e}catch{return\"[toJSON threw]\"}},gC=(e,t=2)=>{if(typeof e==\"string\")return e;try{return typeof e==\"object\"?Pa(e,{space:t}):F(e,{space:t})}catch{return String(e)}},ic={toJSON(){return kt(this)},[Ie](){return this.toJSON()},toString(){return F(this.toJSON())}},xC=class{[Ie](){return this.toJSON()}toString(){return F(this.toJSON())}};var iB=()=>{let e=Object.getOwnPropertyDescriptor(Error,\"stackTraceLimit\");return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,\"writable\")?e.writable===!0:e.set!==void 0},cB=iB(),Co=()=>Error.stackTraceLimit,Qr=e=>{cB&&(Error.stackTraceLimit=e)};var Ls=class{constructor(t){this.value=t,this.done=!1}next(t){return this.done?(this.value=t,this):(this.done=!0,{value:this.value,done:!1})}},uB=()=>{let e=\"~effect/Utils/internal\",t={[e]:o=>o()},r={[e]:o=>o()};return Co()!==0&&t[e](()=>new Error().stack)?.includes(e)===!0?t[e]:r[e]},$s=uB();function N(e,t,r){t===\"__proto__\"?Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[t]=r}function ld(e,t){for(let r of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,r)&&N(e,r,t[r])}var ko=\"~effect/Effect\",Ma=\"~effect/Exit\",lB={_A:R,_E:R,_R:R},Jg=`${ko}/identifier`,pe=`${ko}/args`,tt=`${ko}/evaluate`,Ot=`${ko}/successCont`,Xr=`${ko}/failureCont`,Fa=`${ko}/ensureCont`,Da=Symbol.for(\"effect/Effect/Yield\"),er={pipe(){return Z(this,arguments)},toJSON(){return{...this}},toString(){return F(this.toJSON(),{ignoreToString:!0,space:2})},[Ie](){return this.toJSON()}},SC={[se](){return Bg(this,Object.keys(this))},[ae](e){let t=Object.keys(this),r=Object.keys(e);if(t.length!==r.length)return!1;for(let n=0;nA(e,ko),Kg=e=>A(e,Ma),If=\"~effect/Cause\",cc=\"~effect/Cause/Reason\",fc=e=>A(e,If),bC=e=>A(e,cc),Ao=class{constructor(t){this[If]=If,this.reasons=t}pipe(){return Z(this,arguments)}toJSON(){return{_id:\"Cause\",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${F(this.reasons)})`}[Ie](){return this.toJSON()}[ae](t){return fc(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((r,n)=>W(r,t.reasons[n]))}[se](){return To(this.reasons)}},yC=new WeakMap,uc=class{[cc];annotations;_tag;constructor(t,r,n){if(this[cc]=cc,this._tag=t,r!==Cf&&typeof n==\"object\"&&n!==null&&r.size>0){let o=yC.get(n);o&&(r=new Map([...o,...r])),yC.set(n,r)}this.annotations=r}annotate(t,r){if(t.mapUnsafe.size===0)return this;let n=new Map(this.annotations);t.mapUnsafe.forEach((s,a)=>{r?.overwrite!==!0&&n.has(a)||n.set(a,s)});let o=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return o.annotations=n,o}pipe(){return Z(this,arguments)}toString(){return F(this)}[Ie](){return this.toString()}},Cf=new Map,Na=class extends uc{constructor(t,r=Cf){super(\"Fail\",r,t),this.error=t}toString(){return`Fail(${F(this.error)})`}toJSON(){return{_tag:\"Fail\",error:this.error}}[ae](t){return ss(t)&&W(this.error,t.error)&&W(this.annotations,t.annotations)}[se](){return fe(_e(this._tag))(fe(H(this.error))(H(this.annotations)))}},os=e=>new Ao(e),dB=(e,t)=>{let r=new Map,n=[];for(let o of e.concat(t)){let s=H(o),a=r.get(s);if(a===void 0)r.set(s,[o]);else{if(a.some(i=>W(i,o)))continue;a.push(o)}n.push(o)}return n},La=l(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let r=new Ao(dB(e.reasons,t.reasons));return W(e,r)?e:r}),pd=new Ao([]),lc=e=>new Ao([new Na(e)]),Tf=class extends uc{constructor(t,r=Cf){super(\"Die\",r,t),this.defect=t}toString(){return`Die(${F(this.defect)})`}toJSON(){return{_tag:\"Die\",defect:this.defect}}[ae](t){return $a(t)&&W(this.defect,t.defect)&&W(this.annotations,t.annotations)}[se](){return fe(_e(this._tag))(fe(H(this.defect))(H(this.annotations)))}},Gg=e=>new Ao([new Tf(e)]),pc=l(e=>fc(e[0]),(e,t,r)=>t.mapUnsafe.size===0?e:new Ao(e.reasons.map(n=>n.annotate(t,r)))),ss=e=>e._tag===\"Fail\",$a=e=>e._tag===\"Die\",Ba=e=>e._tag===\"Interrupt\";function mB(e){return Tr(\"Effect.evaluate: Not implemented\")}var en=e=>({...pB,[Jg]:e.op,[tt]:e[tt]??mB,[Ot]:e[Ot],[Xr]:e[Xr],[Fa]:e[Fa]}),vo=e=>{let t=en(e),r=function(n){this[pe]=n};return r.prototype=t,function(n){return new r(n)}},EC=e=>{let t={[Ma]:Ma,_tag:e.op,get[e.prop](){return this[pe]},...en(e),toString(){return`${e.op}(${F(this[pe])})`},toJSON(){return{_id:\"Exit\",_tag:e.op,[e.prop]:this[pe]}},[ae](n){return Kg(n)&&n._tag===this._tag&&W(this[pe],n[pe])},[se](){return fe(_e(e.op),H(this[pe]))}},r=function(n){this[pe]=n};return r.prototype=t,function(n){return new r(n)}},we=EC({op:\"Success\",prop:\"value\",[tt](e){let t=e.getCont(Ot);return t?t[Ot](this[pe],e,this):e.yieldWith(this)}}),dd={key:\"effect/Cause/StackTrace\"},Vg={key:\"effect/Cause/InterruptorStackTrace\"},qt=EC({op:\"Failure\",prop:\"cause\",[tt](e){let t=this[pe],r=!1;e.cache.stackFrame&&(t=pc(t,{mapUnsafe:new Map([[dd.key,e.cache.stackFrame]])}),r=!0);let n=e.getCont(Xr),o=e._interruptedCause;if(o&&e.interruptible){let s=!1;for(;n&&e.interruptible;)s||=Jg in n,n=e.getCont(Xr);s&&(t=os(t.reasons.filter(a=>a._tag!==\"Fail\"))),t=La(t,o),r=!0}return n?n[Xr](t,e,r?void 0:this):e.yieldWith(r?qt(t):this)}}),tn=e=>qt(lc(e)),Tr=e=>qt(Gg(e)),ne=vo({op:\"WithFiber\",[tt](e){return this[pe](e)}}),IC=vo({op:\"WithFiberSucceed\",[tt](e){let t=this[pe](e),r=e.getCont(Ot);return r?r[Ot](t,e):e.yieldWith(we(t))}}),hB=(function(){class e extends globalThis.Error{}let t=en({op:\"YieldableError\",[tt](){return tn(this)}});return delete t.toString,Object.assign(e.prototype,t),e})(),Af=(function(){let e=Symbol.for(\"effect/Data/Error/plainArgs\");return class extends hB{constructor(r){super(r?.message,r?.cause?{cause:r.cause}:void 0),r&&(ld(this,r),Object.defineProperty(this,e,{value:r,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),as=e=>{class t extends Af{_tag=e}return t.prototype.name=e,t},wf=\"~effect/Cause/NoSuchElementError\",md=e=>A(e,wf),Dn=class extends as(\"NoSuchElementError\"){[wf]=wf;constructor(t){super({message:t})}},Ua=\"~effect/Cause/Done\",kf=e=>A(e,Ua),TC={[Ua]:Ua,_tag:\"Done\",value:void 0},ja=e=>e===void 0?TC:{[Ua]:Ua,_tag:\"Done\",value:e},xB=tn(TC),wC=e=>e===void 0?xB:tn(ja(e));var hd=e=>en({op:e.label,[tt]:e.evaluate});var xe={};Eo(xe,{Do:()=>ej,all:()=>BB,andThen:()=>FB,as:()=>BC,asVoid:()=>PB,bind:()=>XB,bindTo:()=>YB,composeK:()=>LB,contains:()=>VB,containsWith:()=>HC,exists:()=>ZB,filter:()=>Wa,filterMap:()=>HB,firstSomeOf:()=>_B,flatMap:()=>qa,flatMapNullishOr:()=>NB,flatten:()=>Ha,fromIterable:()=>wB,fromNullOr:()=>ny,fromNullishOr:()=>Pf,fromUndefinedOr:()=>ry,gen:()=>tj,getFailure:()=>AB,getOrElse:()=>Rf,getOrNull:()=>vd,getOrThrow:()=>oy,getOrThrowWith:()=>Od,getOrUndefined:()=>js,getSuccess:()=>CB,isNone:()=>ue,isOption:()=>yc,isSome:()=>Oe,let:()=>QB,lift2:()=>KB,liftNullishOr:()=>RB,liftPredicate:()=>GB,liftThrowable:()=>Ln,makeCombinerFailFast:()=>WC,makeEquivalence:()=>WB,makeOrder:()=>JB,makeReducer:()=>rj,makeReducerFailFast:()=>nj,map:()=>_t,match:()=>Ht,none:()=>v,orElse:()=>kB,orElseResult:()=>OB,orElseSome:()=>vB,partitionMap:()=>qB,product:()=>zC,productMany:()=>$B,reduceCompact:()=>jB,some:()=>O,tap:()=>jC,toArray:()=>zB,toRefinement:()=>TB,void:()=>MB,zipLeft:()=>DB,zipRight:()=>UB,zipWith:()=>qC});function CC(e){return{combine:e}}function Yg(e,t,r){return{combine:e,initialValue:t,combineAll:r??(n=>{let o=t;for(let s of n)o=e(o,s);return o})}}var tr=e=>(t,r)=>t===r||e(t,r),gB=(e,t)=>e===t,za=()=>gB;function vC(e){return tr((t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n{if(t.length!==r.length)return!1;for(let n=0;nl(3,(t,r,n)=>e(t,o=>({...o,[r]:n(o)}))),yd=e=>l(2,(t,r)=>e(t,n=>({[r]:n}))),Sd=(e,t)=>l(3,(r,n,o)=>t(r,s=>e(o(s),a=>({...s,[n]:a}))));var _C=\"~effect/Option\",RC={[_C]:{_A:e=>e},...er,[Symbol.iterator](){return new Ls(this)}},yB=Object.defineProperty(Object.assign(Object.create(RC),{_tag:\"Some\",_op:\"Some\",[ae](e){return bd(e)&&Qg(e)&&W(this.value,e.value)},[se](){return fe(H(this._tag))(H(this.value))},toString(){return`some(${F(this.value)})`},toJSON(){return{_id:\"Option\",_tag:this._tag,value:kt(this.value)}}}),\"valueOrUndefined\",{get(){return this.value}}),SB=H(\"None\"),bB=Object.assign(Object.create(RC),{_tag:\"None\",_op:\"None\",valueOrUndefined:void 0,[ae](e){return bd(e)&&Ed(e)},[se](){return SB},toString(){return\"none()\"},toJSON(){return{_id:\"Option\",_tag:this._tag}}}),bd=e=>A(e,_C),Ed=e=>e._tag===\"None\",Qg=e=>e._tag===\"Some\",vf=Object.create(bB),PC=function(e){this.value=e};PC.prototype=yB;var Of=e=>new PC(e);var FC=\"~effect/Result\",NC={[FC]:{_A:e=>e,_E:e=>e},...er,[Symbol.iterator](){return new Ls(this)}},EB=Object.assign(Object.create(NC),{_tag:\"Success\",_op:\"Success\",[ae](e){return Id(e)&&mc(e)&&W(this.success,e.success)},[se](){return fe(H(this._tag))(H(this.success))},toString(){return`success(${F(this.success)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,value:kt(this.success)}}}),IB=Object.assign(Object.create(NC),{_tag:\"Failure\",_op:\"Failure\",[ae](e){return Id(e)&&dc(e)&&W(this.failure,e.failure)},[se](){return fe(H(this._tag))(H(this.failure))},toString(){return`failure(${F(this.failure)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,failure:kt(this.failure)}}}),Id=e=>A(e,FC),dc=e=>e._tag===\"Failure\",mc=e=>e._tag===\"Success\",UC=function(e){this.failure=e};UC.prototype=IB;var Td=e=>new UC(e),DC=function(e){this.success=e};DC.prototype=EB;var wd=e=>new DC(e),Xg=e=>mc(e)?vf:Of(e.failure),ey=e=>dc(e)?vf:Of(e.success);function Bs(e){return(t,r)=>t===r?0:e(t,r)}var $C=Bs((e,t)=>eglobalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:eeBs((r,n)=>e(t(r),t(n)))),xc=ty(is,e=>e.getTime());var Cd=e=>l(2,(t,r)=>e(t,r)===-1),gc=e=>l(2,(t,r)=>e(t,r)===1),Ad=e=>l(2,(t,r)=>e(t,r)!==1),kd=e=>l(2,(t,r)=>e(t,r)!==-1);var v=()=>vf,O=Of,yc=bd,ue=Ed,Oe=Qg,Ht=l(2,(e,{onNone:t,onSome:r})=>ue(e)?t():r(e.value)),TB=e=>t=>Oe(e(t)),wB=e=>{for(let t of e)return O(t);return v()},CB=ey,AB=Xg,Rf=l(2,(e,t)=>ue(e)?t():e.value),kB=l(2,(e,t)=>ue(e)?t():e),vB=l(2,(e,t)=>ue(e)?O(t()):e),OB=l(2,(e,t)=>ue(e)?_t(t(),wd):_t(e,Td)),_B=e=>{let t=v();for(t of e)if(Oe(t))return t;return t},Pf=e=>e==null?v():O(e),ry=e=>e===void 0?v():O(e),ny=e=>e===null?v():O(e),RB=e=>(...t)=>Pf(e(...t)),vd=Rf(Mg),js=Rf(Sn),Ln=e=>(...t)=>{try{return O(e(...t))}catch{return v()}},Od=l(2,(e,t)=>{if(Oe(e))return e.value;throw t()}),oy=Od(()=>new Error(\"getOrThrow called on a None\")),_t=l(2,(e,t)=>ue(e)?v():O(t(e.value))),BC=l(2,(e,t)=>_t(e,()=>t)),PB=BC(void 0),MB=O(void 0);var qa=l(2,(e,t)=>ue(e)?v():t(e.value)),FB=l(2,(e,t)=>qa(e,r=>{let n=Yr(t)?t(r):t;return yc(n)?n:O(n)})),NB=l(2,(e,t)=>ue(e)?v():Pf(t(e.value))),Ha=qa(R),UB=l(2,(e,t)=>qa(e,()=>t)),DB=l(2,(e,t)=>jC(e,()=>t)),LB=l(2,(e,t)=>r=>qa(e(r),t)),jC=l(2,(e,t)=>qa(e,r=>_t(t(r),()=>r))),zC=l(2,(e,t)=>Oe(e)&&Oe(t)?O([e.value,t.value]):v()),$B=l(2,(e,t)=>{if(ue(e))return v();let r=[e.value];for(let n of t){if(ue(n))return v();r.push(n.value)}return O(r)}),BB=e=>{if(Symbol.iterator in e){let r=[];for(let n of e){if(ue(n))return v();r.push(n.value)}return O(r)}let t={};for(let r of Object.keys(e)){let n=e[r];if(ue(n))return v();N(t,r,n.value)}return O(t)},qC=l(3,(e,t,r)=>_t(zC(e,t),([n,o])=>r(n,o))),jB=l(3,(e,t,r)=>{let n=t;for(let o of e)Oe(o)&&(n=r(n,o.value));return n}),zB=e=>ue(e)?[]:[e.value],qB=l(2,(e,t)=>{if(ue(e))return[v(),v()];let r=t(e.value);return dc(r)?[v(),O(r.failure)]:[O(r.success),v()]}),HB=l(2,(e,t)=>{if(ue(e))return v();let r=t(e.value);return mc(r)?O(r.success):v()}),Wa=l(2,(e,t)=>ue(e)?v():t(e.value)?O(e.value):v()),WB=e=>tr((t,r)=>ue(t)?ue(r):ue(r)?!1:e(t.value,r.value)),JB=e=>Bs((t,r)=>Oe(t)?Oe(r)?e(t.value,r.value):1:-1),KB=e=>l(2,(t,r)=>qC(t,r,e)),GB=l(2,(e,t)=>t(e)?O(e):v()),HC=e=>l(2,(t,r)=>ue(t)?!1:e(t.value,r)),VB=HC(qg()),ZB=l(2,(e,t)=>ue(e)?!1:t(e.value)),YB=yd(_t),QB=gd(_t);var XB=Sd(_t,qa),ej=O({}),tj=(...e)=>{let r=(e.length===1?e[0]:e[1].bind(e[0]))(),n=r.next();for(;!n.done;){let o=n.value;if(ue(o))return o;n=r.next(o.value)}return O(n.value)};function rj(e){return Yg((t,r)=>ue(t)?r:ue(r)?t:O(e.combine(t.value,r.value)),v())}function WC(e){return CC((t,r)=>ue(t)||ue(r)?v():O(e.combine(t.value,r.value)))}function nj(e){let t=WC(e).combine,r=O(e.initialValue);return Yg(t,r,n=>{let o=r;for(let s of n)if(o=t(o,s),ue(o))return o;return o})}var JC=\"~effect/Context/Service\",fr=function(){function e(){}let t=e;Object.setPrototypeOf(t,oj);let r=(n,o)=>(t.key=n,o?.defaultValue&&(t[ay]=ay,t.defaultValue=o.defaultValue),o?.make&&(t.make=o.make),o?.fiberCached&&KC.add(n),t);return arguments.length>0?r(arguments[0],arguments[1]):r},oj={[JC]:JC,...hd({label:\"Service\",evaluate(e){return we(Fe(e.context,this))}}),toJSON(){return{_id:\"Service\",key:this.key}},of(e){return e},context(e){return Ja(this,e)},use(e){return ne(t=>e(Fe(t.context,this)))},useSync(e){return ne(t=>we(e(Fe(t.context,this))))}},KC=new Set,ay=\"~effect/Context/Reference\",GC=\"~effect/Context\",sj=8,aj=8,iy=(e,t,r,n)=>{let o=Object.create(cj);return o.cacheRoot=e??o,o.base=t,o.overlay=r,o.depth=n,o._flat=void 0,o.baseHits=0,o},VC=(e,t)=>{t&&(VC(e,t.parent),e.set(t.key,t.value))},ZC=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return VC(t,e.overlay),e._flat=t},ij=(e,t)=>{let r=new Map(e.mapUnsafe);return t(r),_o(r)},_d=Symbol(),cy=(e,t)=>{let r=e;for(let o=r.overlay;o;o=o.parent)if(o.key===t)return o.value;let n=r.base.get(t);return n===void 0&&!r.base.has(t)?_d:(r.overlay&&++r.baseHits>=r.base.size&&r.baseHits>=aj&&(r.base=ZC(r),r.overlay=void 0,r.depth=0),n)},_o=e=>iy(void 0,e,void 0,0),cj={get mapUnsafe(){return ZC(this)},...er,[GC]:{_Services:e=>e},toJSON(){return{_id:\"Context\",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ae](e){if(!Mf(e))return!1;let t=this.mapUnsafe,r=e.mapUnsafe;if(t.size!==r.size)return!1;for(let[n,o]of t)if(!r.has(n)||!W(o,r.get(n)))return!1;return!0},[se](){return It(this.mapUnsafe.size)}},YC=(e,t)=>e.cacheRoot===t.cacheRoot,Mf=e=>A(e,GC);var QC=e=>!!e[ay],wr=()=>uj,uj=_o(new Map),Ja=(e,t)=>_o(new Map([[e.key,t]])),Wt=l(3,(e,t,r)=>fj(e,t.key,r)),fj=(e,t,r)=>{let n=e,o=KC.has(t)?void 0:n.cacheRoot;if(n.depth>=sj){let s=new Map(n.mapUnsafe);return s.set(t,r),iy(o,s,void 0,0)}return iy(o,n.base,{key:t,value:r,parent:n.overlay},n.depth+1)};var Rd=l(2,(e,t)=>Ff(e,t.key)),Ff=(e,t)=>{let r=cy(e,t);return r===_d?void 0:r},Ro=l(2,(e,t)=>{let r=cy(e,t.key);if(r===_d){if(QC(t))return XC(t);throw lj(t)}return r}),Fe=Ro,sy=\"~effect/Context/defaultValue\",XC=e=>sy in e?e[sy]:e[sy]=e.defaultValue(),lj=e=>{let t=new Error(`Service not found${e.key?`: ${String(e.key)}`:\"\"}`);if(t.stack){let r=t.stack.split(`\n`);r.splice(1,3),t.stack=r.join(`\n`)}return t},Pd=l(2,(e,t)=>{let r=cy(e,t.key);return r!==_d?O(r):QC(t)?O(XC(t)):v()}),Md=l(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:ij(e,r=>t.mapUnsafe.forEach((n,o)=>r.set(o,n)))),eA=(...e)=>{let t=new Map;for(let r=0;r{t.set(o,n)});return _o(t)};var Te=fr;var uy=e=>e.length>0;var rt=e=>e>0?Math.floor(e):0,En=e=>Math.max(1,rt(e));var B=wd,K=Td;var tA=Id,ce=dc,at=mc;var Fd=l(2,(e,t)=>ce(e)?K(t(e.failure)):e),Cr=l(2,(e,t)=>at(e)?B(t(e.success)):e),Ar=l(2,(e,{onFailure:t,onSuccess:r})=>ce(e)?t(e.failure):r(e.success));var Nf=l(2,(e,t)=>ce(e)?t(e.failure):e.success);var dj=l(2,(e,t)=>{if(at(e))return e.success;throw t(e.failure)}),Uf=dj(R);var Dt=l(2,(e,t)=>ce(e)?K(e.failure):t(e.success));var fy=e=>{if(Symbol.iterator in e){let r=[];for(let n of e){if(ce(n))return n;r.push(n.success)}return B(r)}let t={};for(let r of Object.keys(e)){let n=e[r];if(ce(n))return n;N(t,r,n.success)}return B(t)};var rA=vC;var mj=(e,t)=>{let r=t?.length!==void 0?En(t.length):1/0;return{[Symbol.iterator](){let n=0;return{next(){return nxj(mj(()=>e,{length:t}))),oA=e=>hj(e,1/0);var sA=e=>{let r=e[Symbol.iterator]().next();if(r.done)throw new Error(\"headUnsafe: empty iterable\");return r.value};var aA=l(2,(e,t)=>{let r=0;for(let n of e){let o=t(n,r);if(nd(o)){if(o)return O(n)}else if(Oe(o))return o;r++}return v()});var xj=e=>({[Symbol.iterator](){let t=e[Symbol.iterator](),r;function n(){for(;;){if(r===void 0){let s=t.next();if(s.done)return s;r=s.value[Symbol.iterator]()}let o=r.next();if(!o.done)return o;r=void 0}}return{next:n}}});var iA=l(2,(e,t)=>({[Symbol.iterator](){let r=e[Symbol.iterator](),n=0;return{next(){let o=r.next();for(;!o.done;){if(t(o.value,n++))return{done:!1,value:o.value};o=r.next()}return{done:!0,value:void 0}}}}}));var gj=l(2,(e,t)=>Object.hasOwn(e,t));var Ka=l(2,(e,t)=>{let r={...e};for(let n of cA(e))N(r,n,t(e[n],n));return r});var cA=e=>Object.keys(e);var yj=e=>l(2,(t,r)=>{for(let n of cA(t))if(!gj(r,n)||!e(t[n],r[n]))return!1;return!0});var uA=e=>{let t=yj(e);return(r,n)=>t(r,n)&&t(n,r)};var Nd=globalThis.Array;var fA=l(2,(e,t)=>{let r=En(e),n=new Nd(r);for(let o=0;oe<=t?fA(t-e+1,r=>e+r):[e];var Ve=e=>Nd.isArray(e)?e:Nd.from(e);var Ud=l(2,(e,t)=>[...e,t]),py=l(2,(e,t)=>Ve(e).concat(Ve(t)));var lA=Nd.isArray;var rr=uy,Qe=uy;function Sc(e){let t=Number(e);return String(t)===e&&Number.isInteger(t)&&t>=0&&t<2**32-1}function Sj(e,t){return!Number.isFinite(e)||e<0||e>=t.length}var pA=l(2,(e,t)=>{let r=Math.floor(t);if(Sj(r,e))throw new Error(`Index out of bounds: ${r}`);return e[r]});var Dd=e=>e[e.length-1];var dy=aA;var bj=(e,t)=>{let r=H(t),n=e.get(r);if(n===void 0)return e.set(r,[t]),!0;for(let o of n)if(W(o,t))return!1;return n.push(t),!0};var Rt=()=>[],be=e=>[e],In=l(2,(e,t)=>e.map(t));var Ld=l(2,(e,t)=>{let r=Ve(e),n=[];for(let o=0;o{let r=[],n=[],o=0;for(let s of e){let a=t(s,o++);at(a)?r.push(a.success):n.push(a.failure)}return[r,n]});var dA=xd;var $d=e=>{let t=Ve(e);if(t.length<2)return[...t];let r=new Map,n=[];for(let o of t)bj(r,o)&&n.push(o);return n};var jd=\"~effect/Duration\",Ec=BigInt(0),SA=BigInt(1),Ej=BigInt(2),Ij=BigInt(10),mA=BigInt(24),Bd=BigInt(60),hy=BigInt(1e3),hA=BigInt(1e6);var zd=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),bA=e=>zd(e*1e6),xA=(e,t)=>{let r=e.indexOf(\".\");if(r===-1)return BigInt(e)*t;let n=e[0]===\"-\",o=e.slice(r+1),s=Ij**BigInt(o.length),a=(BigInt(e.slice(n?1:0,r))*s+BigInt(o))*t,i=a/s+(a%s*Ej>=s?SA:Ec);return n?-i:i};var Tj=/^(-?\\d+(?:\\.\\d+)?)\\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,We=e=>{switch(typeof e){case\"number\":return Hs(e);case\"bigint\":return Po(e);case\"string\":{if(e===\"Infinity\")return cs;if(e===\"-Infinity\")return bc;let t=Tj.exec(e);if(!t)break;let[r,n,o]=t;if(o===\"nano\"||o===\"nanos\")return Po(xA(n,SA));if(o===\"micro\"||o===\"micros\")return Po(xA(n,hy));let s=Number(n);switch(o){case\"milli\":case\"millis\":return Hs(s);case\"second\":case\"seconds\":return gy(s);case\"minute\":case\"minutes\":return Oj(s);case\"hour\":case\"hours\":return _j(s);case\"day\":case\"days\":return Rj(s);case\"week\":case\"weeks\":return Pj(s)}break}case\"object\":{if(e===null)break;if(jd in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(yf)?gA(e):Number.isNaN(e[0])||Number.isNaN(e[1])?qs:e[0]===-1/0||e[1]===-1/0?bc:e[0]===1/0||e[1]===1/0?cs:or(zd(e[0]*1e9+e[1]));let t=e,r=0;return t.weeks&&(r+=t.weeks*6048e5),t.days&&(r+=t.days*864e5),t.hours&&(r+=t.hours*36e5),t.minutes&&(r+=t.minutes*6e4),t.seconds&&(r+=t.seconds*1e3),t.milliseconds&&(r+=t.milliseconds),!t.microseconds&&!t.nanoseconds?or(r):or(zd(r*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return gA(e)},gA=e=>{throw new Error(`Invalid Input: ${e}`)},EA=Ln(We),yA={_tag:\"Millis\",millis:0},wj={_tag:\"Infinity\"},Cj={_tag:\"NegativeInfinity\"},Aj={[jd]:jd,[se](){switch(this.value._tag){case\"Millis\":{let e=this.value.millis*1e6;return Number.isFinite(e)?H(zd(e)):It(this.value.millis)}case\"Nanos\":return H(this.value.nanos);default:return bf(this.value)}},[ae](e){return xy(e)&&Fj(this,e)},toString(){switch(this.value._tag){case\"Infinity\":return\"Infinity\";case\"NegativeInfinity\":return\"-Infinity\";case\"Nanos\":return`${this.value.nanos} nanos`;case\"Millis\":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case\"Millis\":return{_id:\"Duration\",_tag:\"Millis\",millis:this.value.millis};case\"Nanos\":return{_id:\"Duration\",_tag:\"Nanos\",nanos:String(this.value.nanos)};case\"Infinity\":return{_id:\"Duration\",_tag:\"Infinity\"};case\"NegativeInfinity\":return{_id:\"Duration\",_tag:\"NegativeInfinity\"}}},[Ie](){return this.toJSON()},pipe(){return Z(this,arguments)}},or=e=>{let t=Object.create(Aj);return typeof e==\"number\"?isNaN(e)||e===0||Object.is(e,-0)?t.value=yA:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:\"Millis\",millis:e}:t.value={_tag:\"Nanos\",nanos:bA(e)}:t.value=e>0?wj:Cj:e===Ec?t.value=yA:t.value={_tag:\"Nanos\",nanos:e},t},xy=e=>A(e,jd),Ws=e=>e.value._tag!==\"Infinity\"&&e.value._tag!==\"NegativeInfinity\",Ic=e=>{switch(e.value._tag){case\"Millis\":return e.value.millis===0;case\"Nanos\":return e.value.nanos===Ec;case\"Infinity\":case\"NegativeInfinity\":return!1}},kj=e=>{switch(e.value._tag){case\"Millis\":return e.value.millis<0;case\"Nanos\":return e.value.nanos{switch(e.value._tag){case\"Infinity\":case\"NegativeInfinity\":return cs;case\"Millis\":return e.value.millis<0?or(-e.value.millis):e;case\"Nanos\":return e.value.nanosor(e);var Hs=e=>or(e),gy=e=>or(e*1e3),Oj=e=>or(e*6e4),_j=e=>or(e*36e5),Rj=e=>or(e*864e5),Pj=e=>or(e*6048e5),kr=e=>wA(We(e),{onMillis:R,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),IA=e=>wA(We(e),{onMillis:t=>t/1e3,onNanos:t=>Number(t)/1e9,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var qd=e=>{let t=We(e);switch(t.value._tag){case\"Infinity\":case\"NegativeInfinity\":throw new Error(\"Cannot convert infinite duration to nanos\");case\"Nanos\":return t.value.nanos;case\"Millis\":return bA(t.value.millis)}},TA=Ln(qd);var wA=l(2,(e,t)=>{switch(e.value._tag){case\"Millis\":return t.onMillis(e.value.millis);case\"Nanos\":return t.onNanos(e.value.nanos);case\"Infinity\":return t.onInfinity();case\"NegativeInfinity\":return(t.onNegativeInfinity??t.onInfinity)()}}),CA=l(3,(e,t,r)=>e.value._tag===\"Infinity\"||e.value._tag===\"NegativeInfinity\"||t.value._tag===\"Infinity\"||t.value._tag===\"NegativeInfinity\"?r.onInfinity(e,t):e.value._tag===\"Millis\"?t.value._tag===\"Millis\"?r.onMillis(e.value.millis,t.value.millis):r.onNanos(qd(e),t.value.nanos):r.onNanos(e.value.nanos,qd(t)));var Mj=(e,t)=>CA(e,t,{onMillis:(r,n)=>r===n,onNanos:(r,n)=>r===n,onInfinity:(r,n)=>r.value._tag===n.value._tag});var AA=l(2,(e,t)=>CA(e,t,{onMillis:(r,n)=>or(r-n),onNanos:(r,n)=>or(r-n),onInfinity:(r,n)=>{let o=r.value._tag,s=n.value._tag;return o===\"Infinity\"?s===\"Infinity\"?qs:cs:o===\"NegativeInfinity\"?s===\"NegativeInfinity\"?qs:bc:s===\"Infinity\"?bc:cs}}));var Fj=l(2,(e,t)=>Mj(e,t)),Nj=e=>{if(e.value._tag===\"Infinity\")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};if(e.value._tag===\"NegativeInfinity\")return{days:-1/0,hours:-1/0,minutes:-1/0,seconds:-1/0,millis:-1/0,nanos:-1/0};let t=qd(e),r=t{if(e.value._tag===\"Infinity\")return\"Infinity\";if(e.value._tag===\"NegativeInfinity\")return\"-Infinity\";if(Ic(e))return\"0\";if(kj(e))return\"-\"+yy(vj(e));let t=Nj(e),r=[];return t.days!==0&&r.push(`${t.days}d`),t.hours!==0&&r.push(`${t.hours}h`),t.minutes!==0&&r.push(`${t.minutes}m`),t.seconds!==0&&r.push(`${t.seconds}s`),t.millis!==0&&r.push(`${t.millis}ms`),t.nanos!==0&&r.push(`${t.nanos}ns`),r.join(\" \")};var Sy=l(2,(e,t)=>r=>{let n=e(r);if(ce(n))return K(r);let o=t(n.success);return ce(o)?K(r):o}),kA=e=>t=>{let r=e(t);return ce(r)?v():O(r.success)};var $f=Te(\"effect/Scheduler\",{fiberCached:!0,defaultValue:()=>new Ga}),OA=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Uj=\"setImmediate\"in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},_A=e=>{try{return Uj(e)}catch{return OA(e)}},by=class{buckets=[];scheduleTask(t,r){let n=this.buckets,o=n.length,s,a=0;for(;ar);a++)s=n[a];s&&s[0]===r?s[1].push(t):a===o?n.push([r,[t]]):n.splice(a,0,[r,[t]])}drain(){let t=this.buckets;return this.buckets=[],t}},Ga=class{executionMode;setImmediate;constructor(t=\"async\",r){this.executionMode=t,this.setImmediate=r??(t===\"sync\"?OA:_A)}shouldYield(t){return t.currentOpCount>=t.cache.maxOpsBeforeYield}makeDispatcher(){return new Ey(this.setImmediate)}},Ey=class{tasks=new by;running=void 0;setImmediate;constructor(t=_A){this.setImmediate=t}scheduleTask(t,r){this.tasks.scheduleTask(t,r),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let t=this.tasks.drain();for(let r=0;r0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},RA=Te(\"effect/Scheduler/MaxOpsBeforeYield\",{fiberCached:!0,defaultValue:()=>2048}),PA=Te(\"effect/Scheduler/PreventSchedulerYield\",{fiberCached:!0,defaultValue:()=>!1});var Tn={};Eo(Tn,{Class:()=>Hd,Error:()=>Wd,TaggedClass:()=>Dj,TaggedError:()=>Fr,taggedEnum:()=>Lj});var Hd=class extends Us{constructor(e){super(),e&&ld(this,e)}},Dj=e=>class extends Hd{_tag=e},Lj=()=>new Proxy({},{get(e,t,r){return t===\"$is\"?Ct:t===\"$match\"?$j:n=>({...n,_tag:t})}});function $j(){if(arguments.length===1){let r=arguments[0];return function(n){return r[n._tag](n)}}let e=arguments[0];return arguments[1][e._tag](e)}var Wd=Af,Fr=as;var MA=\"~effect/encoding/EncodingError\",wn=class extends Fr(\"EncodingError\"){[MA]=MA};var UA=e=>FA(typeof e==\"string\"?qj.encode(e):e),Ty=e=>{switch(e){case 16:return jj();case 32:return zj();default:{let t=\"\";for(let r=e>>>3;r>0;r--)t+=Bj();return t}}},X=Uint8Array.from(\"0123456789abcdef\",e=>e.charCodeAt(0)),Va=()=>Math.random()*4294967296>>>0,Bj=()=>{let e=Va();return String.fromCharCode(X[e>>>28],X[e>>>24&15],X[e>>>20&15],X[e>>>16&15],X[e>>>12&15],X[e>>>8&15],X[e>>>4&15],X[e&15])},jj=()=>{let e=Va(),t=Va();return String.fromCharCode(X[e>>>28],X[e>>>24&15],X[e>>>20&15],X[e>>>16&15],X[e>>>12&15],X[e>>>8&15],X[e>>>4&15],X[e&15],X[t>>>28],X[t>>>24&15],X[t>>>20&15],X[t>>>16&15],X[t>>>12&15],X[t>>>8&15],X[t>>>4&15],X[t&15])},zj=()=>{let e=Va(),t=Va(),r=Va(),n=Va();return String.fromCharCode(X[e>>>28],X[e>>>24&15],X[e>>>20&15],X[e>>>16&15],X[e>>>12&15],X[e>>>8&15],X[e>>>4&15],X[e&15],X[t>>>28],X[t>>>24&15],X[t>>>20&15],X[t>>>16&15],X[t>>>12&15],X[t>>>8&15],X[t>>>4&15],X[t&15],X[r>>>28],X[r>>>24&15],X[r>>>20&15],X[r>>>16&15],X[r>>>12&15],X[r>>>8&15],X[r>>>4&15],X[r&15],X[n>>>28],X[n>>>24&15],X[n>>>20&15],X[n>>>16&15],X[n>>>12&15],X[n>>>8&15],X[n>>>4&15],X[n&15])},wy=e=>{let t=new TextEncoder().encode(e);if(t.length%2!==0)return K(new wn({module:\"Hex\",kind:\"Decode\",input:e,message:`Length must be a multiple of 2, but is ${t.length}`}));try{let r=t.length/2,n=new Uint8Array(r);for(let o=0;oCr(wy(e),t=>Hj.decode(t)),qj=new TextEncoder,Hj=new TextDecoder,Wj=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\")),FA=e=>{let t=\"\";for(let r=0;r{if(48<=e&&e<=57)return e-48;if(97<=e&&e<=102)return e-97+10;if(65<=e&&e<=70)return e-65+10;throw new TypeError(\"Invalid input\")};var Ay=\"effect/Tracer/ParentSpan\",Za=class extends fr()(Ay,{fiberCached:!0}){},Jj=e=>e;var Jd=Te(\"effect/Tracer/DisablePropagation\",{defaultValue:hf}),$A=Te(\"effect/Tracer/CurrentTraceLevel\",{defaultValue:()=>\"Info\"}),BA=Te(\"effect/Tracer/MinimumTraceLevel\",{defaultValue:()=>\"All\"}),ky=\"effect/Tracer\",vy=Te(ky,{fiberCached:!0,defaultValue:()=>Oy}),Oy=Jj({span:e=>new Cy(e)}),Cy=class{_tag=\"Span\";sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(t){this.name=t.name,this.parent=t.parent,this.annotations=t.annotations,this.links=t.links,this.startTime=t.startTime,this.kind=t.kind,this.sampled=t.sampled,this.status={_tag:\"Started\",startTime:t.startTime}}get traceId(){return this._traceId??=js(this.parent)?.traceId??Ty(32)}get spanId(){return this._spanId??=Ty(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(t,r){this.status={_tag:\"Ended\",endTime:t,exit:r,startTime:this.status.startTime}}attribute(t,r){this.attributes.set(t,r)}event(t,r,n){this.events.push([t,r,n??{}])}addLinks(t){this.links.push(...t)}};var zA=\"effect/Metric/FiberRuntimeMetrics\";var qA=Te(\"effect/ErrorReporter/CurrentErrorReporters\",{defaultValue:()=>new Set}),Bf=Te(\"effect/References/CurrentStackFrame\",{fiberCached:!0,defaultValue:Sn}),Kd=Te(\"effect/References/TracerEnabled\",{fiberCached:!0,defaultValue:Er}),Ya=Te(\"effect/References/TracerTimingEnabled\",{defaultValue:Er}),jf=Te(\"effect/References/TracerSpanAnnotations\",{defaultValue:()=>({})}),zf=Te(\"effect/References/TracerSpanLinks\",{defaultValue:()=>[]}),us=Te(\"effect/References/CurrentLogAnnotations\",{defaultValue:()=>({})}),_y=Te(\"effect/References/CurrentLogLevel\",{fiberCached:!0,defaultValue:()=>\"Info\"}),Ry=Te(\"effect/References/MinimumLogLevel\",{fiberCached:!0,defaultValue:()=>\"Info\"});var Gd=Te(\"effect/References/CurrentLogSpans\",{defaultValue:()=>[]});var Js=e=>{if(e?.captureStackTrace===!1)return e;if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=\"boolean\")return e;let t=Co();if(t===0&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};Qr(3);let r=new Error;return Qr(t),{...e,captureStackTrace:Vj(()=>r.stack)}},Py=e=>t=>{let r;return()=>{if(r!==void 0)return r;let n=t();if(!n)return;let o=n.split(`\n`);if(o[e]!==void 0)return r=o[e].trim(),r}},Vj=Py(3);var Vd=class extends uc{constructor(t,r=Cf){super(\"Interrupt\",r,\"Interrupted\"),this.fiberId=t}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:\"Interrupt\",fiberId:this.fiberId}}[ae](t){return Ba(t)&&this.fiberId===t.fiberId&&this.annotations===t.annotations}[se](){return fe(_e(`${this._tag}:${this.fiberId}`))(ad(this.annotations))}},YA=e=>new Vd(e),Gs=e=>new Ao([new Vd(e)]),zy=e=>e.reasons.some(ss),qy=e=>{let t=e.reasons.find(ss);return t?B(t):K(e)},Cn=e=>{for(let t=0;te.reasons.some($a),XA=e=>{let t=e.reasons.find($a);return t?B(t):K(e)},Qf=e=>{let t=e.reasons.find($a);return t?B(t.defect):K(e)},rm=e=>e.reasons.some(Ba),ek=e=>{let t=e.reasons.find(Ba);return t?B(t):K(e)},nm=e=>{let t;for(let r=0;r{let t=nm(e);return ce(t)?Zj:t.success},Zj=new Set,rk=e=>e.reasons.length>0&&e.reasons.every(Ba),nk=e=>_o(e.annotations),ok=e=>{let t=new Map;for(let r of e.reasons)if(r.annotations.size>0)for(let[n,o]of r.annotations)t.set(n,o);return _o(t)},sk=l(2,(e,t)=>{let r=!1,n=e.reasons.map(o=>ss(o)?(r=!0,new Na(t(o.error),o.annotations)):o);return r?os(n):e}),om=e=>{let t;for(let r of e.reasons){if(r._tag===\"Fail\")return r.error;r._tag===\"Die\"&&(t??=r)}return t!==void 0?t.defect:e.reasons.length>0?new globalThis.Error(\"All fibers interrupted without error\"):new globalThis.Error(\"Empty cause\")},Hy=(e,t)=>{let r=[],n=[];if(e.reasons.length===0)return r;let o=Co();o!==0&&Qr(1);try{for(let s of e.reasons){if(s._tag===\"Interrupt\"){n.push(s);continue}r.push(Fy(s._tag===\"Die\"?s.defect:s.error,s.annotations,t))}if(r.length===0){let s=new Error(\"The fiber was interrupted by:\");s.name=\"InterruptCause\",s.stack=ez(s,n);let a=new globalThis.Error(\"All fibers interrupted without error\",{cause:s});a.name=\"InterruptError\",a.stack=`${a.name}: ${a.message}`,r.push(Fy(a,n[0].annotations,t))}}finally{o!==0&&Qr(o)}return r},Fy=(e,t,r)=>{let n=typeof e,o;if(e&&n===\"object\"){if(o=new globalThis.Error(Yj(e),{cause:e.cause?Fy(e.cause):void 0}),typeof e.name==\"string\"&&(o.name=e.name),typeof e.stack==\"string\")o.stack=Xj(e.stack,o,t);else{let s=`${o.name}: ${o.message}`;o.stack=t?ak(s,t):s}r?.includeCauseInStack&&(o.stack=ck(o));for(let s of Object.keys(e))s in o||(o[s]=e[s])}else o=new globalThis.Error(e?n===\"string\"?e:Pa(e):`Unknown error: ${e}`);return o},Yj=e=>{if(typeof e.message==\"string\")return e.message;if(typeof e.toString==\"function\"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Pa(e)},Qj=/\\((.*)\\)/g,Xj=(e,t,r)=>{let n=`${t.name}: ${t.message}`,o=(e.startsWith(n)?e.slice(n.length):e).split(`\n`),s=[n];for(let a=1;a{let r=t?.get(dd.key);return r&&(e=`${e}\n${ik(r)}`),e},ez=(e,t)=>{let r=[`${e.name}: ${e.message}`];for(let n of t){let o=n.fiberId!==void 0?`#${n.fiberId}`:\"unknown\",s=n.annotations.get(Vg.key);r.push(` at fiber (${o})`),s&&r.push(ik(s))}return r.join(`\n`)},ik=e=>{let t=[],r=e,n=0;for(;r&&n<10;){let o=r.stack();if(o){let s=o.matchAll(Qj),a=!1;for(let[,i]of s)a=!0,t.push(` at ${r.name} (${i})`);a||t.push(` at ${r.name} (${o.replace(/^at /,\"\")})`)}else t.push(` at ${r.name}`);r=r.parent,n++}return t.join(`\n`)},sm=e=>Hy(e).map(ck).join(`\n`),ck=e=>e.cause?`${e.stack} {\n${uk(e.cause,\" \")}\n}`:e.stack,uk=(e,t)=>{let r=e.stack.split(`\n`),n=`${t}[cause]: ${r[0]}`;for(let o=1,s=r.length;o{try{return globalThis.process?.getBuiltinModule?.(\"node:async_hooks\")?.AsyncResource}catch{return}})(),fk=()=>HA===void 0?void 0:new HA(\"effect/Fiber\"),fs=()=>globalThis[ac],Zd=class{constructor(t,r=!0){this.setContext(t),this.id=++rz.id,this.currentOpCount=0,this.interruptible=r,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[Wy](){return tz}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(t){return Fe(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Un):(this._observers===void 0?this._observers=[t]:this._observers.push(t),()=>this.removeObserver(t))}removeObserver(t){if(this._exit||this._observers===void 0)return;let r=this._observers.indexOf(t);r>=0&&this._observers.splice(r,1)}interruptUnsafe(t,r){if(this._exit)return;let n=Gs(t);this.cache.stackFrame&&(n=pc(n,Ja(dd,this.cache.stackFrame))),r&&(n=pc(n,r)),this._interruptedCause=this._interruptedCause?La(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Ue(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(t){if(this._exit)return;if(this._asyncContext!==void 0){let o=this._asyncContext;return this._asyncContext=void 0,o.runInAsyncScope(this.evaluate,this,t)}else if(this._yielded!==void 0){let o=this._yielded;this._yielded=void 0,o()}let r=this.runLoop(t);if(r===Da){this._asyncContext=fk();return}let n=Ny.interruptChildren&&Ny.interruptChildren(this);if(n!==void 0)return this.evaluate(V(n,()=>r));if(this._exit=r,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&(this._parent._children?.delete(this),this._parent=void 0),this._observers!==void 0){let o=this._observers;this._observers=void 0;for(let s=0;si)}if(s=a.tracerContext?a.tracerContext(s,this):s[tt](this),s===Da){let i=this._yielded;if(Ma in i)return this._deferredInterrupt=!1,this._yielded=void 0,i;if(this._deferredInterrupt){this._yielded=void 0,i();continue}return Da}}}catch(a){return A(s,tt)?this.runLoop(Tr(a)):Tr(`Fiber.runLoop: Not a valid effect: ${String(s)}`)}finally{this._running=n,globalThis[ac]=r}}getCont(t){if(this._deferredInterrupt)return this._deferredInterrupt=!1,oz;for(;;){let r=this._stack.pop();if(!r)return;let n=r[Fa];if(n!==void 0){let o=n.call(r,this);if(o)return o[t]=o,o}if(r[t])return r}}succeedWith(t){if((++this.currentOpCount&sz-1)===0)return we(t);let r=this.getCont(Ot);return r?r[Ot](t,this):this.yieldWith(we(t))}yieldWith(t){return this._yielded=t,Da}children(){return this._children??=new Set}pipe(){return Z(this,arguments)}setContext(t){let r=this.context;if(this.context=t,r!==void 0&&YC(r,t))return;let n=t.cacheRoot,o=n._fiberCache??=nz(t);this.cache?.scheduler!==o.scheduler&&(this._dispatcher=void 0),this.cache=o}get currentSpanLocal(){let t=this.cache.span;return t?._tag===\"Span\"?t:void 0}},nz=e=>{let t=Ff(e,ky);return{scheduler:Fe(e,$f),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Fe(e,Kd),span:Ff(e,Ay),logLevel:Fe(e,_y),minimumLogLevel:Fe(e,Ry),stackFrame:Fe(e,Bf),runtimeMetrics:Ff(e,zA),maxOpsBeforeYield:Fe(e,RA),preventYield:Fe(e,PA)}},oz={[Ot](e,t){return Ue(t._interruptedCause)},[Xr](e,t){return Ue(t._interruptedCause)}},sz=32,Ny={interruptChildren:void 0},am=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Vg.key,e.cache.stackFrame),_o(t)},az=e=>{if(!(e._children===void 0||e._children.size===0))return Tc(e._children)},Jy=e=>{let t=e;return t._exit?D(t._exit):mt(r=>t._exit?r(D(t._exit)):z(e.addObserver(n=>r(D(n)))))},im=e=>mt(t=>{let r=e[Symbol.iterator](),n=[],o;function s(){let a=r.next();for(;!a.done;){if(a.value._exit){n.push(a.value._exit),a=r.next();continue}o=a.value.addObserver(i=>{n.push(i),s()});return}t(D(n))}return s(),z(()=>o?.())}),Ky=e=>{let t=e;return t._exit?t._exit:mt(r=>t._exit?r(t._exit):z(e.addObserver(r)))},lk=e=>mt(t=>{let r=Array.from(e);if(r.length===0)return t(D(Rt()));let n=new Array(r.length),o=Rt(),s=()=>{for(let c=0;c{if(a++,f._tag===\"Failure\")return i=!0,s(),t(f);n[c]=f.value,a===r.length&&t(D(n))};o.push(u),r[c].addObserver(u)}return z(()=>{i=!0,s()})}),Xf=e=>ne(t=>pk(e,t.id)),pk=l(e=>A(e[0],Wy),(e,t,r)=>ne(n=>{let o=am(n);return o=o&&r?Md(o,r):o??r,e.interruptUnsafe(t,o),el(Jy(e))})),Tc=e=>ne(t=>{let r=am(t),n=Rt();for(let o of e)o.interruptUnsafe(t.id,r),n.push(o);return el(im(n))});var D=we,Ue=qt,Je=tn,z=vo({op:\"Sync\",[tt](e){let t=this[pe](),r=e.getCont(Ot);return r?r[Ot](t,e):e.yieldWith(we(t))}}),re=vo({op:\"Suspend\",[tt](e){return this[pe]()}}),Gy=l(e=>e.length>=2||yc(e[0]),(e,t)=>ue(e)?Je(t?t():new Dn(\"Effect.fromOption: Option.none\")):D(e.value)),Ac=Ar({onFailure:Je,onSuccess:D}),dk=e=>e==null?Je(new Dn):D(e),Vy=vo({op:\"Yield\",[tt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(lr)},this[pe]??0),e.yieldWith(()=>{t=!0})}}),kc=Vy(0),Zy=e=>D(O(e)),ei=D(v()),mk=e=>ue(e)?ei:Re(e.value,O),hk=e=>re(()=>Ue(e())),Vs=e=>Tr(e),cm=e=>re(()=>Je(e())),le=D(void 0);var xk=e=>{let t=typeof e==\"function\"?e:e.try,r=typeof e==\"function\"?n=>new Cc(n,\"An error occurred in Effect.try\"):e.catch;return re(()=>{try{return D(t())}catch(n){return Je(r(n))}})};var Yy=e=>Qy(function(t,r){e(r).then(n=>t(D(n)),n=>t(Vs(n)))},e.length!==0),gk=e=>{let t=typeof e==\"function\"?e:e.try,r=typeof e==\"function\"?n=>new Cc(n,\"An error occurred in Effect.tryPromise\"):e.catch;return Qy(function(n,o){let s=a=>re(()=>{try{return Je($s(()=>r(a)))}catch(i){return Vs(i)}});try{t(o).then(a=>n(D(a)),a=>n(s(a)))}catch(a){n(s(a))}},t.length!==0)},yk=e=>ne(t=>e(t.id)),Sk=ne(D),bk=yk(D),Qy=(function(){let e=en({op:\"Async\",[tt](r){let n=!1,o=!1,s=this.withSignal?new AbortController:void 0,a=this.register.call(r.cache.scheduler,i=>{n||(n=!0,o?r.evaluate(i):o=i)},s?.signal);return o!==!1?o:(o=!0,r._yielded=()=>{n=!0},s===void 0&&a===void 0?Da:(r._stack.push(iz(()=>(n=!0,s?.abort(),a??lr))),Da))}}),t=function(r,n){this.register=r,this.withSignal=n};return t.prototype=e,function(r,n){return new t(r,n)}})(),iz=vo({op:\"AsyncFinalizer\",[Fa](e){e.interruptible&&(e.interruptible=!1,e._stack.push(il))},[Xr](e,t){return rm(e)?V(Cv(qt(e),this[pe]()),()=>Ue(e)):Ue(e)}}),mt=e=>Qy(e,e.length>=2),um=mt(Un),Ek=(...e)=>{if(e.length===1){let n=e[0];return re(()=>Xa(n()))}let[t,r]=e;return re(()=>Xa(r.call(t.self)))},Xy=(e,...t)=>{let r=t.length===0?function(){return re(()=>Xa(e.apply(this,arguments)))}:function(){let n=re(()=>Xa(e.apply(this,arguments)));for(let o=0;oObject.defineProperty(t,\"length\",{value:e,configurable:!0}),WA=Py(2),Ik=function(){let e=typeof arguments[0]==\"string\",t=e?arguments[0]:\"Effect.fn\",r=e?arguments[1]:void 0,n=Co(),o;return n!==0&&(Qr(2),o=new globalThis.Error,Qr(n)),e?(s,...a)=>JA(t,s,o,a,e,r):JA(t,arguments[0],o,Array.prototype.slice.call(arguments,1),e,r)},JA=(e,t,r,n,o,s)=>{let a=typeof t==\"function\"?t:n.shift().bind(t.self),i=`${e} (definition)`,c=r?WA(()=>r.stack):Sn;return eS(a.length,function(...u){let f=re(()=>{let m=a.apply(this,arguments);return ie(m)?m:Xa(m)});for(let m=0;mBy(f,m)):f,Bf,m=>({name:e,stack:d?WA(()=>d.stack):Sn,parent:{name:i,stack:c,parent:m}}))})},Tk=(e,...t)=>eS(e.length,t.length===0?function(){return KA(()=>e.apply(this,arguments))}:function(){let r=KA(()=>e.apply(this,arguments));for(let n of t)r=n(r,...arguments);return r}),KA=e=>{try{let t=e(),r;for(;;){let n=t.next(r);if(n.done)return D(n.value);let o=n.value;if(o&&o._tag===\"Success\"){r=o.value;continue}else{if(o&&o._tag===\"Failure\")return n.value;{let s=!0;return re(()=>s?(s=!1,V(n.value,a=>Xa(t,a))):re(()=>Xa(e())))}}}}catch(t){return Vs(t)}},Xa=(function(){let e=en({op:\"Iterator\",[Ot](r,n){let o=this.iterator;for(;;){let s=o.next(r);if(s.done)return D(s.value);if(De(s.value)){if(s.value._tag===\"Failure\")return s.value}else return n._stack.push(this),s.value;r=s.value.value}},[tt](r){return this[Ot](this.initial,r)}}),t=function(r,n){this.iterator=r,this.initial=n};return t.prototype=e,function(r,n){return new t(r,n)}})(),vr=l(2,(e,t)=>new ls(e,tS,D(t))),fm=function(e){return e._stack.push(this),this[pe]},cz=en({op:\"OnSuccess\",[tt]:fm}),ls=function(e,t,r){this[pe]=e,this[Ot]=t,this.payload=r};ls.prototype=cz;var tS=function(){return this.payload},wk=function(e,t){return t.succeedWith(this.payload)},lm=(()=>{let e=\"~effect/Effect/stackProbe\";return{[e]:function(){return new Error().stack}}[e]()?.includes(\"[as \"+e+\"]\")===!0})(),uz=function(e,t){let r=this.payload;return t.succeedWith(lm?r(e):$s(()=>r(e)))},Ck=function(e){let t=this.payload;return t(e)},fz=function(e){let t=this.payload;return new ls(t(e),wk,e)},lz=function(e){return new ls(this.payload,wk,e)},vc=e=>Re(e,O),Ak=e=>Pc(e,{onFailure:D,onSuccess:Je}),No=l(2,(e,t)=>new ls(e,ie(t)?tS:Ck,t)),ti=l(2,(e,t)=>new ls(e,ie(t)?lz:fz,t)),el=e=>new ls(e,tS,lr),kk=e=>nn(e,Je),rS=(e,t)=>ne(r=>{let n=new Set;return Fc(r,()=>n.size===0?void 0:Tc(n)),mt(o=>{let s=Ve(e),a=s.length,i=0,c=!1,u=[],f=(p,d,m)=>{if(i++,p._tag===\"Failure\"){u.push(...p.cause.reasons),i>=a&&o(Ue(os(u)));return}let x=!c;c=!0,o(p),x&&t?.onWinner&&t.onWinner({fiber:d,index:m,parentFiber:r})};for(let p=0;p{n.delete(d),f(m,d,p)}),c)break}})}),nS=(e,t)=>ne(r=>{let n=new Set;return Fc(r,()=>n.size===0?void 0:Tc(n)),mt(o=>{let s=!1,a=0;for(let i of e){if(s)break;let c=a++,u=ea(r,i,!0,!0,!1);n.add(u),u.addObserver(f=>{n.delete(u);let p=!s;s=!0,o(f),p&&t?.onWinner&&t.onWinner({fiber:u,index:c,parentFiber:r})})}})}),vk=l(e=>ie(e[1]),(e,t,r)=>rS([e,t],r)),oS=l(e=>ie(e[1]),(e,t,r)=>nS([e,t],r)),V=l(2,(e,t)=>new ls(e,Ck,t)),Ok=l(2,(e,t)=>De(e)?e._tag===\"Success\"?t.onSuccess(e.value):t.onFailure(e.cause):Fo(e,t)),De=e=>e[Ma]!==void 0,_k=l(2,(e,t)=>De(e)?e._tag===\"Success\"?t(e.value):e:V(e,t)),Rk=e=>V(e,R),Re=l(2,(e,t)=>new ls(e,uz,t)),Pk=l(2,(e,t)=>De(e)?cS(e,t):Re(e,t)),Mk=l(2,(e,t)=>De(e)?uS(e,t):yS(e,t)),Fk=l(2,(e,t)=>De(e)?fS(e,t):SS(e,t)),Nk=l(2,(e,t)=>{if(De(e)){if(e._tag===\"Success\")return e;let r=Cn(e.cause);return ce(r)?e:t(r.success)}return on(e,t)}),Oc=e=>qt(Gs(e)),Zs=e=>e._tag===\"Success\",Uk=e=>e._tag===\"Success\"?B(e):K(e),Dk=e=>e._tag===\"Success\"?B(e.value):K(e),sS=e=>e._tag===\"Failure\",Lk=e=>e._tag===\"Failure\"?B(e):K(e),tl=e=>e._tag===\"Failure\"?B(e.cause):K(e),aS=Sy(tl,Cn),$k=Sy(tl,Qf),iS=e=>e._tag===\"Failure\"&&rm(e.cause),Bk=e=>e._tag===\"Failure\"&&tm(e.cause),jk=e=>e._tag===\"Failure\"&&zy(e.cause),lr=we(void 0),cS=l(2,(e,t)=>e._tag===\"Success\"?we(t(e.value)):e),uS=l(2,(e,t)=>{if(e._tag===\"Success\")return e;let r=Cn(e.cause);return ce(r)?e:tn(t(r.success))}),fS=l(2,(e,t)=>{if(e._tag===\"Success\")return we(t.onSuccess(e.value));let r=Cn(e.cause);return ce(r)?e:tn(t.onFailure(r.success))}),pz=l(2,(e,t)=>Zs(e)?we(t):e),zk=l(2,(e,t)=>Zs(e)?t:e),qk=l(2,(e,t)=>Zs(e)?t.onSuccess(e.value):t.onFailure(e.cause)),Hk=pz(void 0),lS=e=>{let t=[];for(let r of e)r._tag===\"Failure\"&&t.push(...r.cause.reasons);return t.length===0?lr:qt(os(t))},Wk=e=>Zs(e)?O(e.value):v(),Jk=e=>sS(e)?O(e.cause):v(),Kk=e=>{let t=aS(e);return ce(t)?v():O(t.success)},Gk=e=>e,Vk=e=>ne(t=>D(Pd(t.context,e))),dz=e=>ne(t=>Gy(Pd(t.context,e))),_c=l(2,(e,t)=>ne(r=>{let n=r.context,o=t(n);return n===o||(r.setContext(o),Fc(r,()=>{r.setContext(n)})),e})),ps=l(3,(e,t,r)=>_c(e,n=>{let o=Ro(n,t),s=r(o);return o===s?n:Wt(n,t,s)})),Zk=(e,t,r)=>ni(ne(n=>{let o=Ro(n.context,e),s=t(o);return n.setContext(Wt(n.context,e,s)),Xs(Ro(n.context,Qs),a=>{let i=Pd(n.context,e);if(ue(i))return le;let c=i.value,u;if(r?.reset===void 0){if(c!==s)return le;u=o}else u=r.reset(o,s,c);return n.setContext(Wt(n.context,e,u)),le})})),pS=()=>mz,mz=ne(e=>D(e.context)),Ys=e=>ne(t=>e(t.context)),Yk=l(2,(e,t)=>_c(e,je(t))),$n=l(2,(e,t)=>De(e)?e:_c(e,Md(t))),Or=function(){return arguments.length===1?l(2,(e,t)=>GA(e,arguments[0],t)):l(3,(e,t,r)=>GA(e,t,r)).apply(this,arguments)},GA=(e,t,r)=>_c(e,Wt(t,r)),pm=l(3,(e,t,r)=>V(r,n=>Or(e,t,n))),Qk=l(e=>ie(e[1]),(e,t,r)=>dS(e,t,(n,o)=>[n,o],r)),dS=l(e=>ie(e[1]),(e,t,r,n)=>n?.concurrent?Re(cl([e,t],{concurrency:2}),([o,s])=>r(o,s)):V(e,o=>Re(t,s=>r(o,s)))),Xk=l(e=>ie(e[0]),(e,t,r)=>NS(e,t,r?n=>Je(r(n)):()=>Je(new Dn))),ev=l(2,(e,t)=>V(t,r=>r?vc(e):ei)),mS=l(2,(e,t)=>Array.from({length:t},()=>e)),tv=l(e=>ie(e[0]),(e,t,r)=>cl(mS(e,t),r)),dm=l(e=>ie(e[0]),(e,t)=>Uo({while:Er,body:je(t?.disableYield?e:V(e,r=>kc)),step:Un})),nn=l(2,(e,t)=>new rv(e,t.length!==1?r=>t(r):t)),hz=en({op:\"OnFailure\",[tt]:fm}),rv=function(e,t){this[pe]=e,this[Xr]=t};rv.prototype=hz;var hS=l(3,(e,t,r)=>nn(e,n=>t(n)?r(n):Ue(n))),Rc=l(3,(e,t,r)=>nn(e,n=>{let o=t(n);return ce(o)?Ue(o.failure):r(o.success,n)})),on=l(2,(e,t)=>Rc(e,Cn,r=>t(r))),nv=e=>Pc(e,{onFailure:t=>md(t)?ei:Je(t),onSuccess:Zy}),ov=l(2,(e,t)=>Rc(e,Qf,t)),sv=l(2,(e,t)=>nn(e,r=>No(t(r),Ue(r)))),av=l(3,(e,t,r)=>hS(e,t,n=>No(r(n),Ue(n)))),mm=l(3,(e,t,r)=>nn(e,n=>{let o=t(n);return ce(o)?Ue(n):No(r(o.success,n),Ue(n))})),xS=l(2,(e,t)=>mm(e,Cn,r=>t(r))),iv=l(3,(e,t,r)=>{let n=Array.isArray(t)?o=>A(o,\"_tag\")&&t.includes(o._tag):Ct(t);return xS(e,o=>n(o)?r(o):le)}),cv=l(2,(e,t)=>mm(e,Qf,r=>t(r))),rl=l(e=>ie(e[0]),(e,t,r,n)=>nn(e,o=>{let s=Cn(o);return ce(s)?Ue(s.failure):t(s.success)?r(s.success):n?n(s.success):Ue(o)})),hm=l(e=>ie(e[0]),(e,t,r,n)=>nn(e,o=>{let s=Cn(o);if(ce(s))return Ue(s.failure);let a=t(s.success);return ce(a)?n?n(a.failure):Ue(o):r(a.success)})),gS=l(e=>ie(e[0]),(e,t,r,n)=>{let o=Array.isArray(t)?s=>A(s,\"_tag\")&&t.includes(s._tag):Ct(t);return rl(e,o,r,n)}),uv=l(e=>ie(e[0]),(e,t,r)=>{let n;return hm(e,o=>(n??=Object.keys(t),A(o,\"_tag\")&&Ir(o._tag)&&n.includes(o._tag)?B(o):K(o)),o=>t[o._tag](o),r)}),fv=l(e=>ie(e[0]),(e,t,r,n,o)=>rl(e,s=>Ct(s,t)&&A(s,\"reason\")&&(o!==void 0||Ct(s.reason,r)),s=>{let a=s.reason;return Ct(a,r)?n(a,s):o?o(a,s):Je(s)})),lv=l(e=>ie(e[0]),(e,t,r,n)=>{let o;return rl(e,s=>Ct(s,t)&&A(s,\"reason\")&&A(s.reason,\"_tag\")&&Ir(s.reason._tag)&&(n!==void 0||(o??=Object.keys(r)).includes(s.reason._tag)),s=>{let a=s.reason;return o??=Object.keys(r),o.includes(a._tag)?r[a._tag](a,s):n?n(a,s):Je(s)})}),pv=l(2,(e,t)=>hm(e,r=>Ct(r,t)&&A(r,\"reason\")?B(r.reason):K(r),Je)),yS=l(2,(e,t)=>on(e,r=>cm(()=>t(r)))),SS=l(2,(e,t)=>Pc(e,{onFailure:r=>cm(()=>t.onFailure(r)),onSuccess:r=>z(()=>t.onSuccess(r))})),bS=e=>on(e,Vs),dv=l(2,(e,t)=>on(e,r=>z(()=>t(r)))),mv=e=>re(()=>{let t=e[Symbol.iterator](),r=t.next();if(r.done)return Vs(new Error(\"Received an empty collection of effects\"));function n(o){let s=t.next();return s.done?o.value:on(o.value,a=>n(s))}return n(r)}),ES=e=>on(e,t=>V(kc,()=>ES(e))),hv=l(e=>ie(e[0]),(e,t)=>{if(!t?.log)return Pc(e,{onFailure:n=>le,onSuccess:n=>le});let r=qn(t.log===!0?void 0:t.log);return Fo(e,{onFailure(n){let o=qy(n);return ce(o)?Ue(o.failure):t.message===void 0?r(n):r(t.message,n)},onSuccess:n=>le})}),xm=l(e=>ie(e[0]),(e,t)=>{if(!t?.log)return Fo(e,{onFailure:n=>le,onSuccess:n=>le});let r=qn(t.log===!0?void 0:t.log);return Fo(e,{onFailure:n=>t.message===void 0?r(n):r(t.message,n),onSuccess:n=>le})}),xv=e=>gm(e,{onFailure:v,onSuccess:O}),Ks=e=>nl(e,{onFailure:K,onSuccess:B}),Fo=l(2,(e,t)=>new gv(e,t.onSuccess.length!==1?r=>t.onSuccess(r):t.onSuccess,t.onFailure.length!==1?r=>t.onFailure(r):t.onFailure)),xz=en({op:\"OnSuccessAndFailure\",[tt]:fm}),gv=function(e,t,r){this[pe]=e,this[Ot]=t,this[Xr]=r};gv.prototype=xz;var gz=function(e,t){let r=this.payload;return t.succeedWith(lm?r.onSuccess(e):$s(()=>r.onSuccess(e)))},yv=(e,t)=>{let r=en({op:e,[tt]:fm,[Ot]:gz,[Xr]:t}),n=function(o,s){this[pe]=o,this.payload=s};return n.prototype=r,n},yz=yv(\"Match\",function(e,t){let r=e.reasons.find(ss);if(r===void 0)return Ue(e);let n=this.payload;return t.succeedWith(lm?n.onFailure(r.error):$s(()=>n.onFailure(r.error)))}),Sz=yv(\"MatchCause\",function(e,t){let r=this.payload;return t.succeedWith(lm?r.onFailure(e):$s(()=>r.onFailure(e)))}),IS=l(2,(e,t)=>new Sz(e,t)),Pc=l(2,(e,t)=>Fo(e,{onFailure:r=>{let n=r.reasons.find(ss);return n?t.onFailure(n.error):Ue(r)},onSuccess:t.onSuccess})),gm=l(2,(e,t)=>new yz(e,t)),nl=l(2,(e,t)=>{if(De(e)){if(e._tag===\"Success\")return we(t.onSuccess(e.value));let r=Cn(e.cause);return ce(r)?e:we(t.onFailure(r.success))}return gm(e,t)}),Sv=l(2,(e,t)=>De(e)?e._tag===\"Success\"?we(t.onSuccess(e.value)):we(t.onFailure(e.cause)):IS(e,t)),ol=e=>De(e)?we(e):bz(e),bz=vo({op:\"Exit\",[tt](e){return e._stack.push(this),this[pe]},[Ot](e,t,r){return t.succeedWith(r??we(e))},[Xr](e,t,r){return t.succeedWith(r??qt(e))}}),bv=nl({onFailure:()=>!0,onSuccess:()=>!1}),Ev=nl({onFailure:()=>!1,onSuccess:()=>!0}),Iv=l(2,(e,t)=>No(Nc(t),e)),TS=l(2,(e,t)=>V(wS(e,t.duration),r=>ue(r)?t.orElse():D(r.value))),Ez=e=>new Jf(`Operation timed out after '${yy(e)}'`),Tv=l(2,(e,t)=>{let r=We(t);return TS(e,{duration:r,orElse:()=>Je(Ez(r))})}),wS=l(2,(e,t)=>oS(vc(e),vr(Nc(t),v()))),wv=e=>zn(t=>{let r=t.monotonicTimeNanosUnsafe();return Re(e,n=>[Po(t.monotonicTimeNanosUnsafe()-r),n])}),Uy=\"~effect/Scope\",Dy=\"~effect/Scope/Closeable\",Qs=fr(\"effect/Scope\"),CS=(e,t)=>ne(r=>{let n=ym(e,t);return n===void 0?le:(Cz(r),n)}),ym=(e,t)=>{let r=e.state;if(r._tag===\"Closed\"||(e.state={_tag:\"Closed\",exit:t},e.parent!==void 0&&AS(e.parent,e),r._tag===\"Empty\"))return;if(r.finalizer!==void 0)return Yd(r.finalizer,t);let n=r.finalizers;return n.size===1?Yd(n.values().next().value,t):Iz(e,n,t)},Yd=(e,t)=>{try{return e(t)}catch(r){return Tr(r)}},Cv=(e,t)=>Zs(e)?t:nn(t,r=>Ue(La(e.cause,r))),Iz=Xy(function*(e,t,r){let n=[],o=[],s=Array.from(t.values()),a=fs();for(let i=s.length-1;i>=0;i--){let c=s[i];e.strategy===\"sequential\"?n.push(yield*ol(Yd(c,r))):o.push(ea(a,Yd(c,r),!0,!0,\"inherit\"))}return o.length>0&&(n=yield*im(o)),yield*lS(n)});var Av=(e,t)=>{let r=vv(t,e);return e.state._tag===\"Closed\"?(r.state=e.state,r):(Mc(e,r,n=>CS(r,n)),r)},Xs=(e,t)=>re(()=>e.state._tag===\"Closed\"?t(e.state.exit):(Mc(e,{},t),le)),kv=(e,t)=>Xs(e,je(t)),Mc=(e,t,r)=>{if(e.state._tag===\"Empty\")e.state={_tag:\"Open\",finalizerKey:t,finalizer:r,finalizers:void 0};else if(e.state._tag===\"Open\"){let n=e.state;n.finalizer!==void 0&&(n.finalizers=new Map([[n.finalizerKey,n.finalizer]]),n.finalizerKey=void 0,n.finalizer=void 0),n.finalizers.set(t,r)}},AS=(e,t)=>{if(e.state._tag!==\"Open\")return;let r=e.state;r.finalizerKey===t?e.state=Ly:r.finalizers!==void 0&&(r.finalizers.delete(t),r.finalizers.size===0&&(e.state=Ly))},Sm=e=>vv(e,void 0),vv=(e=\"sequential\",t)=>({[Dy]:Dy,[Uy]:Uy,strategy:e,parent:t,state:Ly}),Ly={_tag:\"Empty\"};var sl=Qs,Ov=Or(Qs),kS=e=>ne(t=>{let r=t.context,n=Sm();return t.setContext(Wt(t.context,Qs,n)),Fc(t,o=>(t.setContext(r),ym(n,o))),e});var bm=e=>re(()=>{let t=Sm();return sn(e(t),r=>re(()=>ym(t,r)??le))}),ri=(e,t,r)=>Ys(n=>jn(o=>V(sl,s=>ti(r?.interruptible?o(e):e,a=>Xs(s,i=>$n(t(a,i),n)))))),vS=e=>V(sl,t=>Ys(r=>Xs(t,n=>$n(e(n),r)))),_v=(function(){let e=en({op:\"OnExit\",[tt](r){return r._stack.push(this),this.effect},[Fa](r){r.interruptible&&this.interruptible!==!0&&(r._stack.push(il),r.interruptible=!1)},[Ot](r,n,o){o??=we(r);let s;try{s=this.onExit(o)}catch(a){s=Tr(a)}return s?V(s,a=>o):o},[Xr](r,n,o){o??=qt(r);let s;try{s=this.onExit(o)}catch(a){s=Tr(a)}return s?V(Cv(o,s),a=>o):o}}),t=function(r,n,o){this.effect=r,this.onExit=n,this.interruptible=o};return t.prototype=e,t})(),Bn=(e,t,r)=>new _v(e,t,r),Fc=(e,t)=>{e._stack.push(new _v(void 0,t,void 0))},sn=l(2,Bn),Rv=l(2,(e,t)=>sn(e,r=>t)),OS=l(3,(e,t,r)=>sn(e,n=>t(n)?r(n):le)),_S=l(3,(e,t,r)=>sn(e,n=>{let o=t(n);return ce(o)?le:r(o.success,n)})),RS=l(2,(e,t)=>_S(e,tl,t)),Pv=l(3,(e,t,r)=>OS(e,n=>n._tag!==\"Failure\"?!1:t(n.cause),n=>r(n.cause))),PS=l(3,(e,t,r)=>sn(e,n=>{if(n._tag!==\"Failure\")return le;let o=t(n.cause);return ce(o)?le:r(o.success,n.cause)})),Mv=l(2,(e,t)=>PS(nm,t)(e)),al=(e,t,r)=>jn(n=>V(e,o=>Bn(re(()=>n(t(o))),s=>r(o,s),!0))),Fv=e=>ri(e,t=>A(t,Symbol.asyncDispose)?Yy(()=>t[Symbol.asyncDispose]()):z(()=>t[Symbol.dispose]())),MS=l(2,(e,t)=>z(()=>Nv(e,typeof t==\"function\"?r=>kr(We(t(r))):je(kr(We(t)))))),Tz=je(1/0),Nv=(e,t)=>{let r=0,n,o,s=(a,i)=>(i.awaiters++,Fc(a,()=>{if(!(--i.awaiters>0||o!==i))return o=void 0,Xf(i.fiber)}),Ky(i.fiber));return[ne(a=>{if(o!==void 0)return s(a,o);if(n!==void 0&&(r===1/0||a.getRef(Nr).currentTimeMillisUnsafe(){if(o!==c||(o=void 0,iS(u)))return;let f=t(u);r=f===1/0?1/0:i.currentTimeMillisUnsafe()+f,n=u}),!0,!0),c.fiber._exit??s(a,c)}),z(()=>{n=void 0})]},Uv=l(2,(e,t)=>Re(MS(e,t),r=>r[0])),Dv=e=>z(()=>Nv(e,Tz)[0]),Lv=ne(e=>Ue(Gs(e.id))),ni=e=>ne(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(il)),e)),$v=vo({op:\"SetInterruptible\",[Fa](e){if(e.interruptible=this[pe],e._interruptedCause&&e.interruptible)return()=>Ue(e._interruptedCause)}}),il=$v(!0),wz=$v(!1),Bv=e=>{if(e.interruptible=!0,e._stack.push(wz),e._interruptedCause)return Ue(e._interruptedCause)},Cz=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(il))};var Em=e=>ne(t=>t.interruptible?e:Bv(t)??e),jn=e=>ne(t=>t.interruptible?(t.interruptible=!1,t._stack.push(il),e(Em)):e(R)),jv=e=>ne(t=>{if(t.interruptible)return e(R);let r=Bv(t),n=e(ni);return r??n}),zv=Re(ri(z(()=>new AbortController),e=>z(()=>e.abort())),e=>e.signal),cl=(e,t)=>ns(e)?t?.mode===\"result\"?rn(e,Ks,t):rn(e,R,t):t?.discard?t.mode===\"result\"?rn(Object.values(e),Ks,t):rn(Object.values(e),R,t):re(()=>{let r={};return vr(rn(Object.entries(e),([n,o])=>Re(t?.mode===\"result\"?Ks(o):o,s=>{N(r,n,s)}),{discard:!0,concurrency:t?.concurrency}),r)}),FS=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>Re(rn(e,(n,o)=>Ks(t(n,o)),r),n=>my(n,R))),qv=l(3,(e,t,r)=>{let n=Ve(e);return n.length===0?z(t):re(()=>{let o=0,s=t();return Re(Uo({while:()=>or(s,n[o],o),step(a){s=a,o++}}),()=>s)})}),Hv=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>V(FS(e,t,{concurrency:r?.concurrency}),([n,o])=>rr(o)?Je(o):r?.discard?le:D(n))),Wv=l(e=>ns(e[0])&&!ie(e[0]),(e,t)=>re(()=>{let r=e[Symbol.iterator](),n=r.next();return n.done?D(v()):Jv(r,0,t,n.value)})),Jv=(e,t,r,n)=>V(r(n,t),o=>{if(o)return D(O(n));let s=e.next();return s.done?D(v()):Jv(e,t+1,r,s.value)}),Kv=l(e=>ns(e[0])&&!ie(e[0]),(e,t)=>re(()=>{let r=e[Symbol.iterator](),n=r.next();return n.done?D(v()):Gv(r,0,t,n.value)})),Gv=(e,t,r,n)=>V(r(n,t),o=>{if(at(o))return D(O(o.success));let s=e.next();return s.done?D(v()):Gv(e,t+1,r,s.value)}),Uo=vo({op:\"While\",[Ot](e,t){return this[pe].step(e),this[pe].while()?(t._stack.push(this),this[pe].body()):lr},[tt](e){return this[pe].while()?(e._stack.push(this),this[pe].body()):lr}}),rn=l(e=>typeof e[1]==\"function\",(e,t,r)=>re(()=>{let n=ul(r?.concurrency);if(n===1)return Az(e,t,r);let o=Ve(e),s=o.length;if(s===0)return r?.discard?le:D([]);let a=r?.discard?void 0:new Array(s),i=kz({f:t,out:a},o,{concurrency:n});return i?vr(i,a):D(a)})),Vv=e=>V(e,t=>{let r=t[Symbol.iterator]().next();return r.done?Je(new Dn):D(r.value)}),Az=(e,t,r)=>re(()=>{let n=r?.discard?void 0:[],o=e[Symbol.iterator](),s=o.next(),a=0;return vr(Uo({while:()=>!s.done,body:()=>t(s.value,a++),step:i=>{n&&n.push(i),s=o.next()}}),n)}),ul=e=>e===\"unbounded\"?Number.POSITIVE_INFINITY:Math.max(1,e??1),Im=()=>e=>{let t=e.onItem,r=e.step,n=(s,a,i,c,u)=>V(ol(u),f=>r(s,a[i],f,i)??o(s,a,i+1,c)??le),o=(s,a,i=0,c=a.length)=>{for(;i{let t=e.onItem,r=e.step;return(n,o,s)=>{let a=0,i=s.end??o.length,c=s.concurrency,u=!1,f,p,d,m,x,y=w=>{let E=Tr(w);return m=E,u=!0,p&&p.size>0?V(ni(Tc(Array.from(p))),()=>m??E):E},S=()=>{let w=!1;for(;!m&&a{p.delete(_);try{if(m){if(b._tag===\"Failure\"){let T=b.cause.reasons.filter(C=>C._tag!==\"Interrupt\");if(T.length>0){let C=os(T);m=qt(m._tag===\"Failure\"?La(m.cause,C):C)}}}else{let T=r(n,E,b,h);T&&(m=T,S())}if(w){let T=S();T&&d(T)}else u&&p.size===0&&d(m??le)}catch(T){d(y(T))}}),p.size{f=fs(),p=new Set,x=M,d=_;let h;try{h=S()}catch(b){return _(y(b))}return h?_(h):re(()=>(m??=lr,V(p?Tc(p):le,()=>m?._tag===\"Failure\"?m:le)))})}if(u=!0,m){if(p&&p.size>0){let E=am(f);p.forEach(M=>M.interruptUnsafe(f.id,E));return}if(d||m._tag===\"Failure\")return m}else if(d)if(p)p.size===0&&d(le);else return lr};return S()}},Tm=()=>e=>Zv(e),kz=Zv({onItem(e,t,r){return e.f(t,r)},step(e,t,r,n){if(r._tag===\"Failure\")return r;e.out&&(e.out[n]=r.value)}}),NS=l(3,(e,t,r)=>V(e,n=>t(n)?D(n):r(n))),US=l(3,(e,t,r)=>V(e,n=>{let o=t(n);return ce(o)?r(o.failure):D(o.success)})),Yv=l(e=>ie(e[0]),(e,t,r)=>US(e,t,r?n=>Je(r(n)):()=>Je(new Dn))),Qv=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>re(()=>{let n=[];return vr(rn(e,(o,s)=>{let a=t(o,s);return typeof a==\"boolean\"?(a&&n.push(o),le):Re(a,i=>{i&&n.push(o)})},{discard:!0,concurrency:r?.concurrency}),n)})),Xv=l(e=>ns(e[0])&&!ie(e[0]),(e,t)=>re(()=>{let r=[];for(let n of e){let o=t(n);at(o)&&r.push(o.success)}return D(r)})),eO=l(e=>ns(e[0])&&!ie(e[0]),(e,t,r)=>re(()=>{let n=[];return vr(rn(e,o=>Re(t(o),s=>{at(s)&&n.push(s.success)}),{discard:!0,concurrency:r?.concurrency}),n)})),tO=D({}),rO=yd(Re),nO=Sd(Re,V),oO=gd(Re);var sO=l(e=>ie(e[0]),(e,t)=>ne(r=>(zz(),D(ea(r,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),ea=(e,t,r=!1,n=!1,o=!1)=>{let s=e,a=o===\"inherit\"?s.interruptible:!o,i=new Zd(s.context,a);return r?i.evaluate(t):(i._asyncContext=fk(),s.currentDispatcher.scheduleTask(()=>i.evaluate(t),0)),!n&&!i._exit&&(s.children().add(i),i._parent=s),i},aO=l(e=>ie(e[0]),(e,t)=>ne(r=>D(ea(r,e,t?.startImmediately,!0,t?.uninterruptible)))),iO=e=>ne(t=>{let r=t._children&&new Set(t._children),n=t.interruptible;return Bn(e,o=>{let s=t._children;if(s===void 0||s.size===0)return le;r&&(s=iA(s,i=>!r.has(i)));let a=el(im(s));return n?Em(a):a})}),DS=l(e=>ie(e[0]),(e,t,r)=>ne(n=>{let o=ea(n,e,r?.startImmediately,!0,r?.uninterruptible);if(!o._exit)if(t.state._tag!==\"Closed\"){let s={};Mc(t,s,()=>yk(i=>i===o.id?le:Xf(o))),o.addObserver(()=>AS(t,s))}else o.interruptUnsafe(n.id,am(n));return D(o)})),cO=l(e=>ie(e[0]),(e,t)=>V(sl,r=>DS(e,r,t))),ds=e=>(t,r)=>{let n=new Zd(r?.scheduler?Wt(e,$f,r.scheduler):e,r?.uninterruptible!==!0);if(n.evaluate(t),n._exit)return n;if(r?.signal)if(r.signal.aborted)n.interruptUnsafe();else{let o=()=>n.interruptUnsafe();r.signal.addEventListener(\"abort\",o,{once:!0}),n.addObserver(()=>r.signal.removeEventListener(\"abort\",o))}return r?.onFiberStart&&r.onFiberStart(n),n},uO=l(2,(e,t)=>{if(e._exit)return e;if(t.state._tag===\"Closed\")return e.interruptUnsafe(e.id),e;let r={};return Mc(t,r,()=>Xf(e)),e.addObserver(()=>AS(t,r)),e}),fO=ds(wr()),LS=e=>{let t=ds(e);return(r,n)=>{let o=t(r,n);return n?.onExit&&o.addObserver(n.onExit),s=>o.interruptUnsafe(s)}},lO=LS(wr()),wm=e=>{let t=ds(e);return(r,n)=>{let o=t(r,n);return new Promise(s=>{o.addObserver(a=>s(a))})}},pO=wm(wr()),$S=e=>{let t=wm(e);return(r,n)=>t(r,n).then(o=>{if(o._tag===\"Failure\")throw om(o.cause);return o.value})},dO=$S(wr()),Cm=e=>{let t=ds(e);return r=>{if(De(r))return r;let n=new Ga(\"sync\"),o=t(r,{scheduler:n});return o._dispatcher?.flush(),o._exit??Tr(new Zf(o))}},mO=Cm(wr()),BS=e=>{let t=Cm(e);return r=>{let n=t(r);if(n._tag===\"Failure\")throw om(n.cause);return n.value}},hO=BS(wr()),VA=D(!0),ZA=D(!1),$y=class{waiters=[];scheduled=void 0;_isOpen;constructor(t){this._isOpen=t}scheduleUnsafe(t){if(this.waiters.length===0)return VA;if(this.scheduled===void 0)this.scheduled=this.waiters,t.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let r=0;r{if(this.scheduled===void 0)return;let t=this.scheduled;this.scheduled=void 0;for(let r=0;rthis._isOpen?ZA:(this._isOpen=!0,this.scheduleUnsafe(t)));release=ne(t=>this._isOpen?ZA:this.scheduleUnsafe(t));openUnsafe(){return this._isOpen?!1:(this._isOpen=!0,this.flushWaiters(),!0)}await=mt(t=>this._isOpen?t(le):(this.waiters.push(t),z(()=>{let r=this.waiters.indexOf(t);r!==-1?this.waiters.splice(r,1):this.scheduled!==void 0&&(r=this.scheduled.indexOf(t),r!==-1&&this.scheduled.splice(r,1))})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=z(()=>this.closeUnsafe());whenOpen=t=>V(this.await,()=>t);isOpen(){return this._isOpen}},jS=e=>new $y(e??!1),xO=e=>z(()=>jS(e)),gO=ne(e=>D(e.getRef(vy))),yO=l(2,(e,t)=>Or(e,vy,t)),SO=Or(Kd),bO=Or(Ya),Qd=BigInt(0),vz={_tag:\"Span\",spanId:\"noop\",traceId:\"noop\",sampled:!1,status:{_tag:\"Ended\",startTime:Qd,endTime:Qd,exit:lr},attributes:new Map,links:[],kind:\"internal\",attribute(){},event(){},end(){},addLinks(){}},Oz=e=>Object.assign(Object.create(vz),e),EO=e=>e?Fe(e.annotations,Jd)?e._tag===\"Span\"?EO(js(e.parent)):v():O(e):v(),zS=(e,t,r)=>{let n=!e.cache.tracerEnabled||r?.annotations&&Fe(r.annotations,Jd),o=r?.parent!==void 0?O(r.parent):r?.root?v():EO(e.cache.span),s;if(n)s=Oz({name:t,parent:o,annotations:Wt(r?.annotations??wr(),Jd,!0)});else{let a=e.cache.tracer??Oy,i=e.getRef(Nr),c=e.getRef(Ya),u=e.getRef(jf),f=e.getRef(zf),p=r?.level??e.getRef($A),d=r?.links!==void 0?[...f,...r.links]:f.length===0?[]:f.slice();s=a.span({name:t,parent:o,annotations:r?.annotations??wr(),links:d,startTime:c?i.currentTimeNanosUnsafe():Qd,kind:r?.kind??\"internal\",root:r?.root??ue(o),sampled:r?.sampled??(Oe(o)&&o.value.sampled===!1?!1:!$O(e.getRef(BA),p))});for(let m in u)s.attribute(m,u[m]);if(r?.attributes!==void 0)for(let m in r.attributes)s.attribute(m,r.attributes[m])}return s},IO=(e,t)=>ne(r=>D(zS(r,e,t))),qf=(e,t)=>ni(ne(r=>{let n=Ro(r.context,Qs),o=zS(r,e,t??{}),s=r.getRef(Nr),a=r.getRef(Ya);return vr(Xs(n,i=>Am(o,i,s,a)),o)})),TO=function(){let e=typeof arguments[0]!=\"string\",t=e?arguments[1]:arguments[0],r=Js(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return V(qf(t,r),o=>wc(n,o,r))}return n=>V(qf(t,r),o=>wc(n,o,r))},_z=(e,t)=>(t=typeof t==\"function\"?t:Sn,ps(Bf,r=>({name:e,stack:t,parent:r}))),wO=jf,CO=zf,AO=l(e=>ie(e[0]),(e,t,r={})=>{let o=(Array.isArray(t)?t:[t]).map(s=>({span:s,attributes:r}));return ps(e,zf,s=>[...s,...o])}),Am=(e,t,r,n)=>z(()=>{e.status._tag!==\"Ended\"&&e.end(n?r.currentTimeNanosUnsafe():Qd,t)}),Hf=(e,...t)=>{let r=t.length===1?void 0:t[0],n=t[t.length-1];return ne(o=>{let s=zS(o,e,r),a=o.getRef(Nr),i=o.getRef(Ya);return Fc(o,c=>Am(s,c,a,i)),n(s)})},By=Or(Za),wc=function(){let e=ie(arguments[0]),t=e?arguments[1]:arguments[0],r=e?arguments[2]:arguments[1],n=R;return t._tag===\"Span\"&&(r=Js(r),n=_z(t.name,r?.captureStackTrace)),e?By(n(arguments[0]),t):o=>By(n(o),t)},kO=function(){let e=typeof arguments[0]!=\"string\",t=e?arguments[1]:arguments[0],r=Js(arguments[2]);if(e){let s=arguments[0];return Hf(t,arguments[2],a=>wc(s,a,r))}let n=typeof arguments[1]==\"function\"?arguments[1]:void 0,o=n?void 0:arguments[1];return(s,...a)=>Hf(t,n?n(...a):o,i=>wc(s,i,r))},vO=l(e=>ie(e[0]),(e,...t)=>ps(e,jf,r=>{let n=t.length===1?{...r,...t[0]}:{...r};return t.length===1||N(n,t[0],t[1]),n})),OO=(...e)=>ne(t=>{let r=t.currentSpanLocal;if(r)if(e.length===1)for(let[n,o]of Object.entries(e[0]))r.attribute(n,o);else r.attribute(e[0],e[1]);return le}),_O=ne(e=>{let t=e.currentSpanLocal;return t?D(t):Je(new Dn)}),RO=dz(Za),Nr=Te(\"effect/Clock\",{defaultValue:()=>new jy}),My=2**31-1,jy=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=z(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Rz()}currentTimeNanos=z(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return MO()}monotonicTimeNanos=z(()=>this.monotonicTimeNanosUnsafe());sleep(t){return this.sleepMillis(kr(t))}sleepMillis(t){return t<=0?kc:Number.isFinite(t)?mt(r=>{let n=t>My?this.sleepMillis(t-My):le,o=setTimeout(()=>r(n),Math.min(t,My));return z(()=>clearTimeout(o))}):um}},PO=BigInt(1e6),MO=(function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==\"function\")return()=>e.bigint();if(typeof performance<\"u\"&&typeof performance.now==\"function\")return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let r=BigInt(Date.now())*PO;return r>t&&(t=r),t}})(),Rz=(function(){let e=BigInt(1e9),t;return()=>{let r=MO(),n=BigInt(Date.now())*PO;if(t===void 0)t=n-r;else{let o=t+r;(n>o?n-o:o-n)>e&&(t=n-r)}return t+r}})(),zn=e=>ne(t=>e(t.getRef(Nr))),Nc=e=>zn(t=>t.sleep(We(e))),qS=zn(e=>e.currentTimeMillis);var Wf=\"~effect/Cause/TimeoutError\",FO=e=>A(e,Wf),Jf=class extends as(\"TimeoutError\"){[Wf]=Wf;constructor(t){super({message:t})}},Kf=\"~effect/Cause/IllegalArgumentError\",NO=e=>A(e,Kf),Xd=class extends as(\"IllegalArgumentError\"){[Kf]=Kf;constructor(t){super({message:t})}},Gf=\"~effect/Cause/ExceededCapacityError\",UO=e=>A(e,Gf),em=class extends as(\"ExceededCapacityError\"){[Gf]=Gf;constructor(t){super({message:t})}},Vf=\"~effect/Cause/AsyncFiberError\",DO=e=>A(e,Vf),Zf=class extends as(\"AsyncFiberError\"){[Vf]=Vf;constructor(t){super({message:\"An asynchronous Effect was executed with Effect.runSync\",fiber:t})}},Yf=\"~effect/Cause/UnknownError\",LO=e=>A(e,Yf),Cc=class extends as(\"UnknownError\"){[Yf]=Yf;constructor(t,r){super({message:r,cause:t})}},HS=Te(\"effect/Console\",{defaultValue:()=>globalThis.console}),Pz=e=>{switch(e){case\"All\":return Number.MIN_SAFE_INTEGER;case\"Fatal\":return 5e4;case\"Error\":return 4e4;case\"Warn\":return 3e4;case\"Info\":return 2e4;case\"Debug\":return 1e4;case\"Trace\":return 0;case\"None\":return Number.MAX_SAFE_INTEGER}},Mz=ty(is,Pz),$O=gc(Mz),WS=Te(\"effect/Logger/CurrentLoggers\",{defaultValue:()=>new Set([Bz,jz])}),Fz=Te(\"effect/Logger/LogToStderr\",{defaultValue:hf}),BO=function(){let e=typeof arguments[0]==\"string\"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return ni(ne(t=>{let r=t.getRef(us),n={...r};for(let o=0;o{let s=t.getRef(us),a={...s};for(let i=0;i{let t=Object.create(Uz);return t.log=e,t},Dz=e=>e.replace(/[\\s=\"]/g,\"_\"),Lz=(e,t)=>`${Dz(e[0])}=${t-e[1]}ms`;var qn=e=>(...t)=>{let r;for(let n=0,o=t.length;n{let o=e??n.cache.logLevel;if($O(n.cache.minimumLogLevel,o))return le;let s=n.getRef(Nr),a=n.getRef(WS);if(a.size>0){let i=new Date(s.currentTimeMillisUnsafe());for(let c of a)c.log({cause:r,fiber:n,date:i,logLevel:o,message:t})}return le})};var Qa={bold:\"1\",red:\"31\",green:\"32\",yellow:\"33\",blue:\"34\",cyan:\"36\",white:\"37\",gray:\"90\",black:\"30\",bgBrightRed:\"101\"},Sre={None:[],All:[],Trace:[Qa.gray],Debug:[Qa.blue],Info:[Qa.green],Warn:[Qa.yellow],Error:[Qa.red],Fatal:[Qa.bgBrightRed,Qa.black]};var $z=e=>`${e.getHours().toString().padStart(2,\"0\")}:${e.getMinutes().toString().padStart(2,\"0\")}:${e.getSeconds().toString().padStart(2,\"0\")}.${e.getMilliseconds().toString().padStart(3,\"0\")}`;var Bz=jO(({cause:e,date:t,fiber:r,logLevel:n,message:o})=>{let s=Array.isArray(o)?o.slice():[o];e.reasons.length>0&&s.push(sm(e));let a=t.getTime(),i=r.getRef(Gd),c=\"\";for(let d of i)c+=` ${Lz(d,a)}`;let u=r.getRef(us);Object.keys(u).length>0&&s.push(u);let f=r.getRef(HS);(r.getRef(Fz)?f.error:f.log)(`[${$z(t)}] ${n.toUpperCase()} (#${r.id})${c}:`,...s)}),jz=jO(({cause:e,fiber:t,logLevel:r,message:n})=>{let o=t.getRef(Nr),s=t.getRef(us),a=t.cache.span;if(a===void 0||a._tag===\"ExternalSpan\")return;let i={};for(let[c,u]of Object.entries(s))N(i,c,u);i[\"effect.fiberId\"]=t.id,i[\"effect.logLevel\"]=r.toUpperCase(),e.reasons.length>0&&(i[\"effect.cause\"]=sm(e)),a.event(gC(Array.isArray(n)&&n.length===1?n[0]:n),o.currentTimeNanosUnsafe(),i)});function zz(){Ny.interruptChildren??=az}var JS=D(void 0);var zO=l(e=>ie(e[0]),(e,t)=>RS(e,r=>ne(n=>(qz(n,r,t?.defectsOnly),le)))),qz=(e,t,r)=>{let n=e.getRef(qA);if(n.size===0||r&&!tm(t))return;let o={cause:t,fiber:e,timestamp:e.getRef(Nr).currentTimeNanosUnsafe()};n.forEach(s=>s.report(o))};var Hz=If,Wz=cc,VS=fc,ZS=bC,fl=ss,Jz=$a,Kz=Ba,Uc=os,Gz=pd,Vz=lc,oi=Gg,Zz=Gs,km=e=>new Na(e),vm=e=>new Tf(e),YS=YA,QS=rk,ms=sk,Yz=La,Om=om,XS=zy,Qz=qy,eb=Cn,Xz=QA,eq=tm,tq=XA,ll=Qf,rq=rm,nq=ek,oq=tk,sq=nm,aq=Hy,tb=sm,iq=md,cq=wf,uq=Dn,Dc=kf,fq=Ua,rb=ja,ee=wC,lq=Wf,pq=FO,dq=Jf,mq=Kf,hq=NO,pl=Xd,xq=UO,gq=Gf,nb=em,yq=Vf,Sq=DO,bq=Zf,Eq=Yf,Iq=LO,Tq=Cc,wq=pc,Cq=nk,Aq=ok,KS=class extends fr()(\"effect/Cause/StackTrace\"){},GS=class extends fr()(\"effect/Cause/InterruptorStackTrace\"){};var U={};Eo(U,{Do:()=>KH,Transaction:()=>qc,TypeId:()=>$H,abortSignal:()=>fJ,acquireDisposable:()=>XW,acquireRelease:()=>di,acquireUseRelease:()=>J_,addFinalizer:()=>eJ,all:()=>Jm,andThen:()=>mr,annotateCurrentSpan:()=>EJ,annotateLogs:()=>QJ,annotateLogsScoped:()=>XJ,annotateSpans:()=>bJ,as:()=>Ft,asSome:()=>Vm,asVoid:()=>na,awaitAllChildren:()=>NJ,bind:()=>ZH,bindTo:()=>GH,cached:()=>sJ,cachedInvalidateWithTTL:()=>iJ,cachedWithTTL:()=>aJ,callback:()=>Wc,catch:()=>oa,catchCause:()=>xt,catchCauseFilter:()=>hW,catchCauseIf:()=>mW,catchDefect:()=>Rl,catchEager:()=>Zc,catchFilter:()=>pW,catchIf:()=>lW,catchNoSuchElement:()=>dW,catchReason:()=>cW,catchReasons:()=>uW,catchTag:()=>aW,catchTags:()=>iW,clockWith:()=>hi,context:()=>li,contextWith:()=>Pl,currentParentSpan:()=>TJ,currentSpan:()=>IJ,delay:()=>$b,die:()=>Rr,effectify:()=>fK,ensuring:()=>mi,eventually:()=>bW,exit:()=>kn,fail:()=>P,failCause:()=>it,failCauseSync:()=>Ss,failSync:()=>Gm,fiber:()=>UJ,fiberId:()=>DJ,filter:()=>jb,filterMap:()=>UW,filterMapEffect:()=>zb,filterMapOrElse:()=>LW,filterMapOrFail:()=>BW,filterOrElse:()=>DW,filterOrFail:()=>$W,findFirst:()=>qH,findFirstFilter:()=>HH,firstSuccessOf:()=>OW,flatMap:()=>I,flatMapEager:()=>nt,flatten:()=>Ub,flip:()=>oW,fn:()=>HJ,fnUntraced:()=>Se,fnUntracedEager:()=>eE,forEach:()=>ta,forever:()=>$t,forkChild:()=>Gc,forkDetach:()=>FJ,forkIn:()=>Nt,forkScoped:()=>Vc,fromNullishOr:()=>tW,fromOption:()=>XH,fromResult:()=>_l,gen:()=>dr,head:()=>WH,ignore:()=>wW,ignoreCause:()=>CW,interrupt:()=>On,interruptible:()=>cJ,interruptibleMask:()=>uJ,isEffect:()=>Bo,isFailure:()=>WW,isSuccess:()=>JW,let:()=>VH,linkSpans:()=>AJ,log:()=>WJ,logDebug:()=>VJ,logError:()=>Xb,logFatal:()=>JJ,logInfo:()=>GJ,logTrace:()=>ZJ,logWarning:()=>KJ,logWithLevel:()=>th,makeSpan:()=>Zb,makeSpanScoped:()=>kJ,map:()=>j,mapBoth:()=>xW,mapBothEager:()=>Kt,mapEager:()=>Dr,mapError:()=>Zm,mapErrorEager:()=>Fl,match:()=>qb,matchCause:()=>zW,matchCauseEager:()=>qW,matchCauseEffect:()=>fi,matchCauseEffectEager:()=>HW,matchEager:()=>jW,matchEffect:()=>Hb,never:()=>ui,onError:()=>Jn,onErrorFilter:()=>rJ,onErrorIf:()=>tJ,onExit:()=>cn,onExitFilter:()=>oJ,onExitIf:()=>nJ,onExitPrimitive:()=>Gb,onInterrupt:()=>Vb,option:()=>nW,orDie:()=>Lb,orElseSucceed:()=>vW,partition:()=>BH,promise:()=>Km,provide:()=>KW,provideContext:()=>vn,provideService:()=>jo,provideServiceEffect:()=>QW,race:()=>NW,raceAll:()=>Bb,raceAllFirst:()=>FW,raceFirst:()=>Kc,reduce:()=>jH,repeat:()=>lJ,repeatOrElse:()=>pJ,replicate:()=>dJ,replicateEffect:()=>mJ,request:()=>PJ,requestUnsafe:()=>MJ,result:()=>rW,retry:()=>EW,retryOrElse:()=>IW,runCallback:()=>$J,runCallbackWith:()=>LJ,runFork:()=>Ml,runForkWith:()=>_n,runPromise:()=>Yb,runPromiseExit:()=>eh,runPromiseExitWith:()=>BJ,runPromiseWith:()=>Qb,runSync:()=>jJ,runSyncExit:()=>qo,runSyncExitWith:()=>qJ,runSyncWith:()=>zJ,sandbox:()=>TW,satisfiesErrorType:()=>pK,satisfiesServicesType:()=>dK,satisfiesSuccessType:()=>lK,schedule:()=>hJ,scheduleFrom:()=>K_,scope:()=>pi,scoped:()=>Xm,scopedWith:()=>Kb,service:()=>Wb,serviceOption:()=>Jb,setContext:()=>GW,sleep:()=>sa,spanAnnotations:()=>wJ,spanLinks:()=>CJ,succeed:()=>g,succeedNone:()=>ra,succeedSome:()=>Nb,suspend:()=>$,sync:()=>te,tap:()=>Pr,tapCause:()=>H_,tapCauseFilter:()=>SW,tapCauseIf:()=>yW,tapDefect:()=>W_,tapError:()=>Ym,tapErrorTag:()=>gW,timed:()=>MW,timeout:()=>_W,timeoutOption:()=>RW,timeoutOrElse:()=>PW,tracer:()=>xJ,track:()=>tK,trackDefects:()=>oK,trackDuration:()=>sK,trackErrors:()=>nK,trackSuccesses:()=>rK,transposeOption:()=>eW,try:()=>Jc,tryPromise:()=>Hc,tx:()=>aK,txRetry:()=>uK,undefined:()=>JH,uninterruptible:()=>bs,uninterruptibleMask:()=>zo,unwrapReason:()=>fW,updateContext:()=>VW,updateService:()=>ZW,updateServiceScoped:()=>YW,useSpan:()=>vJ,validate:()=>zH,void:()=>Y,when:()=>Qm,whileLoop:()=>Wn,withErrorReporting:()=>kW,withExecutionPlan:()=>AW,withFiber:()=>an,withFiberSucceed:()=>QH,withLogSpan:()=>eK,withLogger:()=>YJ,withParentSpan:()=>RJ,withSpan:()=>OJ,withSpanScoped:()=>_J,withTracer:()=>gJ,withTracerEnabled:()=>yJ,withTracerTiming:()=>SJ,yieldNow:()=>Ol,yieldNowWith:()=>YH,zip:()=>Db,zipWith:()=>sW});var sr={};Eo(sr,{asVoid:()=>Lq,asVoidAll:()=>$q,die:()=>ob,fail:()=>hs,failCause:()=>Ur,filterCause:()=>Pq,filterFailure:()=>Rq,filterSuccess:()=>Oq,filterValue:()=>_q,findDefect:()=>Fq,findError:()=>Mq,findErrorOption:()=>zq,getCause:()=>jq,getSuccess:()=>Bq,hasDies:()=>vq,hasFails:()=>kq,hasInterrupts:()=>ab,interrupt:()=>sb,isExit:()=>dl,isFailure:()=>xs,isSuccess:()=>Ke,map:()=>Nq,mapBoth:()=>Dq,mapError:()=>Uq,match:()=>ib,succeed:()=>pr,void:()=>ht});var dl=Kg,pr=we,Ur=qt,hs=tn,ob=Tr,sb=Oc,ht=lr;var Ke=Zs,xs=sS,kq=jk,vq=Bk,ab=iS,Oq=Uk,_q=Dk,Rq=Lk,Pq=tl,Mq=aS,Fq=$k,ib=qk,Nq=cS,Uq=uS,Dq=fS,Lq=Hk,$q=lS,Bq=Wk,jq=Jk,zq=Kk;var qq=\"~effect/Deferred\";var Hq={[qq]:{_A:R,_E:R},pipe(){return Z(this,arguments)}},qO=function(){this.resumes=void 0,this.effect=void 0};qO.prototype=Hq;var si=()=>new qO;var _m=e=>mt(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),z(()=>{let r=e.resumes;if(r===void 0)return;let n=r.indexOf(t);n>=0&&r.splice(n,1)})));var Wq=l(2,(e,t)=>z(()=>Do(e,t))),Jq=Wq;var Kq=l(2,(e,t)=>Jq(e,qt(t)));var cb=l(2,(e,t)=>Kq(e,Gs(t)));var Do=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let r=e.resumes;e.resumes=void 0;for(let n=0;n{let r={observers:0,deferred:si(),scope:An(),finalizer:n=>re(()=>--r.observers>0?le:(e.map.delete(t),Le(r.scope,n)))};return r},GO=(e,t)=>t.state._tag===\"Closed\"?!1:(e.observers++,Mc(t,{},e.finalizer),!0),YO=e=>A(e,ZO),Zq={[ZO]:{_ROut:R,_E:R,_RIn:R},pipe(){return Z(this,arguments)}},QO=e=>{let t=Object.create(Zq);return t.build=e,t},ub=e=>QO((t,r)=>{let n=Mt(r);return sn(e(t,n),o=>o._tag===\"Failure\"?Le(n,o):le)}),Yq=e=>{let t=ub((r,n)=>r.getOrElseMemoize(t,n,e));return t},Pm=class{get[KO](){return KO}parent;constructor(t){this.parent=t}map=new Map;get(t,r){let n=this.map.get(t);return n?(GO(n,r),n.deferred.effect??_m(n.deferred)):this.parent?.get(t,r)}getOrElseMemoize(t,r,n){return re(()=>{let o;return Bn(re(()=>{let s=this.get(t,r);if(s)return s;let a=Vq(this,t);return GO(a,r)?(o=a.deferred,this.map.set(t,a),n(this,a.scope)):n(this,r)}),s=>{o&&Do(o,s)})})}},hl=()=>new Pm,Qq=e=>new Pm(e);var ml=class e extends fr()(\"effect/Layer/CurrentMemoMap\"){static forkOrCreate(t){let r=Rd(t,e);return r?Qq(r):hl()}},xl=l(3,(e,t,r)=>Or(Re(e.build(t,r),Wt(ml,t)),ml,t));var Fm=l(2,(e,t)=>ne(r=>xl(e,ml.forkOrCreate(r.context),t))),XO=function(){return arguments.length===1?e=>Mm(Ja(arguments[0],e)):Mm(Ja(arguments[0],arguments[1]))},Mm=e=>QO(je(D(e)));var fb=function(){return arguments.length===1?e=>VO(arguments[0],e):VO(arguments[0],arguments[1])},VO=(e,t)=>Xq(Re(t,r=>Ja(e,r))),Xq=e=>Yq((t,r)=>gs(e,r));var e_=(e,t,r)=>{let n=Mt(r,\"parallel\");return rn(e,o=>o.build(t,Mt(n,\"sequential\")),{concurrency:e.length}).pipe(Re(o=>eA(...o)))},t_=(...e)=>ub((t,r)=>e_(e,t,r));var eH=(e,t,r)=>ub((n,o)=>V(Array.isArray(t)?e_(t,n,o):t.build(n,o),s=>e.build(n,o).pipe($n(s),Re(a=>r(a,s))))),r_=l(2,(e,t)=>eH(e,t,R));var n_=\"~effect/ExecutionPlan\";var tH={[n_]:n_,get captureRequirements(){let e=this;return Ys(t=>D(rH(e.steps.map(r=>({...r,while:r.while?n=>$n(r.while(n),t):void 0,provide:YO(r.provide)?r_(r.provide,Mm(t)):r.provide})))))},pipe(){return Z(this,arguments)}},rH=e=>{let t=Object.create(tH);return t.steps=e,t};var Nm=Te(\"effect/ExecutionPlan/CurrentMetadata\",{defaultValue:je({attempt:0,stepIndex:0})});var Lc=Nr;var Um=\"~effect/DateTime\",Dm=\"~effect/DateTime/TimeZone\",s_={[Um]:Um,pipe(){return Z(this,arguments)},[Ie](){return this.toString()},toJSON(){return bl(this).toJSON()}},oH={...s_,_tag:\"Utc\",[se](){return It(this.epochMilliseconds)},[ae](e){return Bc(e)&&e._tag===\"Utc\"&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${bl(this).toJSON()})`}},sH={...s_,_tag:\"Zoned\",[se](){return fe(It(this.epochMilliseconds))(H(this.zone))},[ae](e){return Bc(e)&&e._tag===\"Zoned\"&&this.epochMilliseconds===e.epochMilliseconds&&W(this.zone,e.zone)},toString(){return`DateTime.Zoned(${Tb(this)})`}},a_={[Dm]:Dm,[Ie](){return this.toString()}},aH={...a_,_tag:\"Named\",[se](){return _e(`Named:${this.id}`)},[ae](e){return ii(e)&&e._tag===\"Named\"&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:\"TimeZone\",_tag:\"Named\",id:this.id}}},iH={...a_,_tag:\"Offset\",[se](){return _e(`Offset:${this.offset}`)},[ae](e){return ii(e)&&e._tag===\"Offset\"&&this.offset===e.offset},toString(){return`TimeZone.Offset(${bb(this.offset)})`},toJSON(){return{_id:\"TimeZone\",_tag:\"Offset\",offset:this.offset}}},$o=(e,t,r)=>{let n=Object.create(sH);return n.epochMilliseconds=e,n.zone=t,Object.defineProperty(n,\"partsUtc\",{value:r,enumerable:!1,writable:!0}),Object.defineProperty(n,\"adjustedEpochMillis\",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(n,\"partsAdjusted\",{value:void 0,enumerable:!1,writable:!0}),n},Bc=e=>A(e,Um);var ii=e=>A(e,Dm),i_=e=>ii(e)&&e._tag===\"Offset\",c_=e=>ii(e)&&e._tag===\"Named\",u_=e=>e._tag===\"Utc\",mb=e=>e._tag===\"Zoned\",f_=tr((e,t)=>e.epochMilliseconds===t.epochMilliseconds);var l_=e=>{let t=Object.create(oH);return t.epochMilliseconds=e,Object.defineProperty(t,\"partsUtc\",{value:void 0,enumerable:!1,writable:!0}),t},$c=e=>{let t=e.getTime();if(Number.isNaN(t))throw new pl(\"Invalid date\");return l_(t)},$m=e=>{if(Bc(e))return e;if(e instanceof Date)return $c(e);if(typeof e==\"object\"){if(\"epochMilliseconds\"in e)return $c(new Date(e.epochMilliseconds));let t=new Date(0);return hH(t,e),$c(t)}else if(typeof e==\"string\"&&!cH(e))return $c(new Date(e+\"Z\"));return $c(new Date(e))},cH=e=>/Z|GMT|[+-]\\d{2}$|[+-]\\d{2}:?\\d{2}$|\\]$/.test(e),uH=-864e13+720*60*1e3,fH=864e13-840*60*1e3,hb=(e,t)=>{let r=t?.timeZone;if(r===void 0&&Bc(e)&&mb(e))return e;let n=$m(e);if(n.epochMillisecondsfH)throw new RangeError(`Epoch millis out of range: ${n.epochMilliseconds}`);r===void 0&&typeof e==\"object\"&&\"timeZoneId\"in e&&(r=e.timeZoneId);let o;if(r===void 0){let s=new Date(n.epochMilliseconds).getTimezoneOffset()*-60*1e3;o=Sl(s)}else if(ii(r))o=r;else if(typeof r==\"number\")o=Sl(r);else{let s=yb(r);if(ue(s))throw new pl(`Invalid time zone: ${r}`);o=s.value}return t?.adjustForTimeZone!==!0?$o(n.epochMilliseconds,o,n.partsUtc):xH(n.epochMilliseconds,o,t?.disambiguation??\"compatible\")},pb=Ln(hb),p_=Ln($m),lH=/^(.{17,35})\\[(.+)\\]$/,d_=e=>{let t=lH.exec(e);if(t===null){let o=Ib(e);return o!==null?pb(e,{timeZone:o}):v()}let[,r,n]=t;return pb(r,{timeZone:n})};var m_=e=>l_(e.epochMilliseconds);var Lm=new Map,pH={day:\"numeric\",month:\"numeric\",year:\"numeric\",hour:\"numeric\",minute:\"numeric\",second:\"numeric\",timeZoneName:\"longOffset\",fractionalSecondDigits:3,hourCycle:\"h23\"},dH=e=>{let t=e.resolvedOptions().timeZone,r=Lm.get(t);if(r!==void 0)return r;let n=Object.create(aH);return n.id=t,n.format=e,Lm.set(t,n),n},xb=e=>{let t=Lm.get(e);if(t!==void 0)return t;try{let r=dH(new Intl.DateTimeFormat(\"en-US\",{...pH,timeZone:e}));return Lm.set(e,r),r}catch{throw new pl(`Invalid time zone: ${e}`)}},Sl=e=>{let t=Object.create(iH);return t.offset=e,t},gb=Ln(xb);var mH=/^(?:GMT|[+-])/,yb=e=>{if(mH.test(e)){let t=Ib(e);return t===null?v():O(Sl(t))}return gb(e)},h_=e=>e._tag===\"Offset\"?bb(e.offset):e.id;var bl=e=>new Date(e.epochMilliseconds),Bm=e=>{if(e._tag===\"Utc\")return new Date(e.epochMilliseconds);if(e.zone._tag===\"Offset\")return new Date(e.epochMilliseconds+e.zone.offset);if(e.adjustedEpochMilliseconds!==void 0)return new Date(e.adjustedEpochMilliseconds);let t=e.zone.format.formatToParts(e.epochMilliseconds).filter(n=>n.type!==\"literal\"),r=new Date(0);return r.setUTCFullYear(Number(t[2].value),Number(t[0].value)-1,Number(t[1].value)),r.setUTCHours(Number(t[3].value),Number(t[4].value),Number(t[5].value),t[6]?.type===\"fractionalSecond\"?Number(t[6].value):(e.epochMilliseconds%1e3+1e3)%1e3),e.adjustedEpochMilliseconds=r.getTime(),r},Sb=e=>Bm(e).getTime()-Eb(e),bb=e=>{let t=Math.abs(e),r=Math.floor(t/(3600*1e3)),n=Math.round(t%(3600*1e3)/(60*1e3));return n===60&&(r+=1,n=0),`${e<0?\"-\":\"+\"}${String(r).padStart(2,\"0\")}:${String(n).padStart(2,\"0\")}`},x_=e=>bb(Sb(e)),Eb=e=>e.epochMilliseconds;var hH=(e,t)=>{if((t.year!==void 0||t.month!==void 0||t.day!==void 0)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),t.month!==void 0?t.month-1:e.getUTCMonth(),t.day??e.getUTCDate()),t.weekDay!==void 0){let r=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+r)}t.hour!==void 0&&e.setUTCHours(t.hour),t.minute!==void 0&&e.setUTCMinutes(t.minute),t.second!==void 0&&e.setUTCSeconds(t.second),t.millisecond!==void 0&&e.setUTCMilliseconds(t.millisecond)};var o_=1440*60*1e3,xH=(e,t,r)=>{if(t._tag===\"Offset\")return $o(e-t.offset,t);let n=yl(e-o_,e,t),o=yl(e+o_,e,t);if(n===o)return $o(e-n,t);let s=n{let t=gH.exec(e);if(t===null)return null;let[,r,n,o]=t;return(r===\"+\"?1:-1)*(Number(n)*60+Number(o))*60*1e3},yl=(e,t,r)=>{let n=r.format.formatToParts(e).find(s=>s.type===\"timeZoneName\")?.value??\"\";if(n===\"GMT\")return 0;let o=Ib(n);return o===null?Sb($o(t,r)):o};var g_=e=>bl(e).toISOString();var db=e=>{let t=Bm(e);return e._tag===\"Utc\"?t.toISOString():`${t.toISOString().slice(0,-1)}${x_(e)}`},Tb=e=>e.zone._tag===\"Offset\"?db(e):`${db(e)}[${e.zone.id}]`;var Ure=globalThis.Number;var S_=l(2,(e,t)=>{if(!globalThis.Number.isFinite(e)||!globalThis.Number.isFinite(t)||t===0)return NaN;if(globalThis.Number.isInteger(e)&&globalThis.Number.isInteger(t))return e%t;let[r,n]=y_(e),[o,s]=y_(t),a=Math.min(n,s),i=r*BigInt(10)**BigInt(n-a),c=o*BigInt(10)**BigInt(s-a),u=i%c;if(u===BigInt(0))return e<0||Object.is(e,-0)?-0:0;let f=globalThis.Number(`${u}e${a}`);return f===0?Math.sign(e)*globalThis.Number.MIN_VALUE:f});function y_(e){if(globalThis.Number.isInteger(e))return[BigInt(e),0];let t=Math.abs(e).toExponential(),r=t.indexOf(\"e\"),n=t.slice(0,r).replace(\".\",\"\");return[BigInt(n)*(e<0?-BigInt(1):BigInt(1)),globalThis.Number(t.slice(r+1))-n.length+1]}var b_=e=>{let t=Math.ceil(Math.log(e)/Math.log(2));return Math.max(Math.pow(2,t),2)};var Lre=globalThis.String,jm=Ir;var E_=e=>e.toUpperCase();var I_=e=>e.trim();var bH=(e,t,r,n,o)=>{let s=e;for(let c of t)s=s.replace(c,\"$1\\0$2\");for(let c of r)s=s.replace(c,\"\\0\");let a=0,i=s.length;for(;s.charAt(a)===\"\\0\";)a++;for(;s.charAt(i-1)===\"\\0\";)i--;return s.slice(a,i).split(\"\\0\").map(o).join(n)};var EH=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],IH=/[^A-Z0-9]+/gi;var T_=e=>bH(e,EH,[IH],\"_\",E_);var Xe=l(2,(e,t)=>Rc(e,TH,r=>t(r))),ys=e=>e.reasons.some(wb),wb=e=>e._tag===\"Fail\"&&Dc(e.error),jc=e=>{let t,r=!1;for(let n of e.reasons)wb(n)?t??=n.error:n._tag!==\"Interrupt\"&&(r=!0);return t===void 0?K(e):r?K(Uc(e.reasons.filter(n=>!wb(n)))):B(t)};var TH=e=>{let t=jc(e);return ce(t)?t:B(t.success.value)},Cb=e=>{let t=jc(e);return ce(t)?Ur(t.failure):pr(t.success.value)},qm=l(2,(e,t)=>Fo(e,{onSuccess:t.onSuccess,onFailure:r=>{let n=jc(r);return ce(n)?t.onFailure(n.failure):t.onDone(n.success.value)}}));var w_=\"~effect/Schedule\";var Jt=Te(\"effect/Schedule/CurrentMetadata\",{defaultValue:je({input:void 0,output:void 0,duration:qs,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),wH={[w_]:{_Out:R,_In:R,_Env:R},pipe(){return Z(this,arguments)}},Ab=e=>A(e,w_),kb=e=>{let t=Object.create(wH);return t.step=e,t},vb=()=>{let e=0,t,r;return(n,o)=>{r===void 0&&(r=n);let s=n-r,a=t===void 0?0:n-t;return t=n,{input:o,attempt:++e,start:r,now:n,elapsed:s,elapsedSincePrevious:a}}},CH=e=>kb(Re(e,t=>{let r=vb();return(n,o)=>t(r(n,o))})),El=e=>nn(e.step,t=>D(()=>Ue(t))),Hn=e=>zn(t=>Re(El(e),r=>{let n=vb();return o=>re(()=>{let s=t.currentTimeMillisUnsafe();return V(r(s,o),([a,i])=>{let c=n(s,o);return c.output=a,c.duration=i,vr(Nc(i),c)})})})),Il=e=>Re(Hn(e),t=>r=>Re(t(r),n=>n.output));var Ob=e=>kb(Re(El(e),t=>(r,n)=>qm(t(r,n),{onSuccess:o=>D([n,o[1]]),onFailure:Ue,onDone:()=>ee(n)}))),C_=e=>Tl(wl,({attempt:t})=>D(t<=e)),_b=e=>{let t=We(e);return CH(D(r=>D([r.attempt-1,t])))};var Tl=l(2,(e,t)=>kb(Re(El(e),r=>{let n=vb();return(o,s)=>V(r(o,s),a=>{let[i,c]=a,u=t({...n(o,s),output:i,duration:c});return V(ie(u)?u:D(u),f=>f?D(a):ee(i))})})));var wl=_b(qs);var AH=(e,t,r)=>bm(n=>V(r?.local?xl(t,hl(),n):Fm(t,n),o=>$n(e,o))),Hm=l(e=>ie(e[0]),(e,t,r)=>Mf(t)?$n(e,t):AH(e,Array.isArray(t)?t_(...t):t,r));var Rb=l(3,(e,t,r)=>V(Hn(t),n=>{let o=Jt.defaultValue();return on(dm(ti(V(re(()=>Or(e,Jt,o)),n),s=>z(()=>{o=s})),{disableYield:!0}),s=>kf(s)?D(s.value):r(s,o.attempt===0?v():O(o)))})),Pb=l(3,(e,t,r)=>V(Hn(t),n=>{let o=Jt.defaultValue(),s,a=on(re(()=>Or(e,Jt,o)),i=>(s=i,V(n(i),c=>(o=c,a))));return Xe(a,i=>$s(()=>r(s,i)))})),k_=l(2,(e,t)=>{let r=typeof t==\"function\"?t(R):Ab(t)?t:kl(t);return Rb(e,r,Je)}),Al=l(2,(e,t)=>{let r=typeof t==\"function\"?t(R):Ab(t)?t:kl(t);return Pb(e,r,Je)}),v_=l(3,(e,t,r)=>V(Hn(r),n=>{let o=Jt.defaultValue(),s=re(()=>Or(e,Jt,o));return on(V(n(t),a=>{o=a;let i=je(V(s,n));return Uo({while:Er,body:i,step(c){o=c}})}),a=>kf(a)?D(a.value):Je(a))})),kH=Ob(wl),kl=e=>{let t=e.schedule?Ob(e.schedule):kH;return e.while&&(t=Tl(t,({input:r})=>{let n=e.while(r);return ie(n)?n:D(n)})),e.until&&(t=Tl(t,({input:r})=>{let n=e.until(r);return ie(n)?Re(n,o=>!o):D(!n)})),e.times!==void 0&&(t=Tl(t,({attempt:r})=>D(r<=e.times))),t};var Mb=(e,t)=>{let r=-1,n=0,o=s=>xm(e(s));return{begin:zn(s=>re(()=>{let a=t();a.stepIndex!==r&&(r=a.stepIndex,n=0),n++;let i={attempt:a.attempt,stepAttempt:n,stepIndex:a.stepIndex,startNanos:s.monotonicTimeNanosUnsafe()};return vr(o({_tag:\"AttemptStart\",attempt:i.attempt,stepAttempt:i.stepAttempt,stepIndex:i.stepIndex}),i)})),end:(s,a)=>zn(i=>{let c=Po(i.monotonicTimeNanosUnsafe()-s.startNanos);return o(a._tag===\"Success\"?{_tag:\"AttemptSuccess\",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c}:{_tag:\"AttemptFailure\",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c,cause:a.cause})})}},__=l(e=>ie(e[0]),(e,t,r)=>re(()=>{let n=0,o={attempt:0,stepIndex:0},s=pm(Nm,z(()=>(o={attempt:o.attempt+1,stepIndex:n},o))),a=r?.onEvent===void 0?void 0:Mb(r.onEvent,()=>o),i=a===void 0?R:u=>jn(f=>V(a.begin,p=>sn(f(u),d=>a.end(p,d)))),c;return V(Uo({while:()=>np?d:(p=!0,Ac(c))),f=Al(f,vl(u,!1))}else{let p=vl(u,!0);f=p?Al(f,p):f}return Ks(f)},step(u){c=u,n++}}),()=>Ac(c))})),vl=(e,t)=>{if(t){if(e.attempts===1||!(e.schedule||e.attempts))return}else return kl({schedule:e.schedule?e.schedule:e.attempts?void 0:vH,times:e.attempts,while:e.while});return kl({schedule:e.schedule,while:e.while,times:e.attempts?e.attempts-1:void 0})},vH=C_(1);var OH=\"~effect/Request\",_H=pC({_E:e=>e,_A:e=>e,_R:e=>e}),ene={...SC,[OH]:_H};var P_=e=>e;var F_=l(2,(e,t)=>{let r=n=>mt(o=>{let s=U_(n,e,o,fs());return PH(n,s)});return ie(t)?V(t,r):r(t)}),N_=(e,t)=>{let r=U_(t.resolver,e,t.onExit,{context:t.context,cache:{scheduler:Fe(t.context,$f)}});return()=>D_(t.resolver,r)},Wm=[],Fb=new WeakMap,U_=(e,t,r,n)=>{let o=Fb.get(e);o||(o=new Map,Fb.set(e,o));let s,a=!1,i=P_({request:t,context:n.context,uninterruptible:!1,completeUnsafe(u){a||(a=!0,!(s&&!s.entrySet.delete(i))&&r(u))}});if(e.preCheck!==void 0&&!e.preCheck(i))return i;let c=e.batchKey(i);if(s=o.get(c),!s){if(Wm.length>0)s=Wm.pop(),s.key=c,s.resolver=e,s.map=o;else{let u={key:c,resolver:e,map:o,entrySet:new Set,entries:new Set,delayEffect:V(re(()=>u.resolver.delay),f=>M_(u)),run:sn(re(()=>u.resolver.runAll(Array.from(u.entries),u.key)),f=>{for(let p of u.entrySet)p.completeUnsafe(f._tag===\"Success\"?Tr(new Error(\"Effect.request: RequestResolver did not complete request\",{cause:p.request})):f);return u.entries.clear(),Wm.length<128&&(u.entrySet.clear(),u.key=void 0,u.fiber=void 0,u.resolver=void 0,u.map=void 0,Wm.push(u)),le})};s=u}o.set(c,s),s.fiber=ds(n.context)(s.delayEffect,{scheduler:n.cache.scheduler})}return s.entrySet.add(i),s.entries.add(i),s.resolver.collectWhile(s.entries)||(s.fiber.interruptUnsafe(n.id),s.fiber=ds(n.context)(M_(s),{scheduler:n.cache.scheduler})),i},D_=(e,t)=>{if(t.uninterruptible)return;let r=Fb.get(e);if(!r)return;let n=e.batchKey(t),o=r.get(n);if(!o||!o.entries.delete(t))return;o.entrySet.delete(t);let s;o.entries.size===0&&(r.delete(n),s=o.fiber),t.completeUnsafe(Oc()),s?.interruptUnsafe()},PH=(e,t)=>z(()=>D_(e,t));function M_(e){return e.map.has(e.key)?(e.map.delete(e.key),e.run):le}var FH=\"effect/Metric/CurrentMetricAttributes\",NH=Te(FH,{defaultValue:()=>({})}),UH=\"effect/Metric/MetricRegistry\",DH=Te(UH,{defaultValue:()=>new Map}),L_=\"~effect/Metric\",$_=class{[L_]=L_;#t;#e=\"\";id;description;attributes;constructor(t,r,n){this.id=t,this.description=r,this.attributes=n}valueUnsafe(t){return this.hook(t).get(t)}modifyUnsafe(t,r){return this.hook(r).modify(t,r)}updateUnsafe(t,r){return this.hook(r).update(t,r)}hook(t){let r=Fe(t,NH);r!==this.#t&&(this.#t=r,this.#e=LH(this,B_(this.attributes,r)));let n=Fe(t,DH),o=n.get(this.#e);return tC(o)&&(o={id:this.id,type:this.type,description:this.description,attributes:Object.keys(r).length>0?B_(this.attributes,r):this.attributes,hooks:this.createHooks()},n.set(this.#e,o)),o.hooks}pipe(){return Z(this,arguments)}};var zc=l(2,(e,t)=>Ys(r=>z(()=>e.updateUnsafe(t,r))));function LH(e,t){let r=Object.entries(t).sort((n,o)=>n[0]o[0]?1:0);return JSON.stringify([e.type,e.id,e.description,r])}function B_(e,t){return{...j_(e),...j_(t)}}function j_(e){return Io(e)&&Array.isArray(e)?e.reduce((t,[r,n])=>(N(t,r,n),t),{}):e}var $H=ko,Bo=ie,Jm=cl,BH=FS,jH=qv,zH=Hv,qH=Wv,HH=Kv,ta=rn,WH=Vv,Wn=Uo,Km=Yy,Hc=gk,g=D,ra=ei,Nb=Zy,$=re,te=z,Y=le;var JH=JS;var Wc=mt,ui=um,KH=tO,GH=rO,VH=oO;var ZH=nO,dr=Ek,P=Je,Gm=cm,it=Ue,Ss=hk,Rr=Vs,Jc=xk;var Ol=kc,YH=Vy,an=ne,QH=IC,_l=Ac,XH=Gy,eW=mk,tW=dk,I=V,Ub=Rk,mr=No,Pr=ti,rW=Ks,nW=xv,kn=ol,j=Re,Ft=vr,Vm=vc,na=el,oW=Ak,Db=Qk,sW=dS,oa=on;var aW=gS,iW=uv,cW=fv,uW=lv,fW=pv,xt=nn,Rl=ov,lW=rl,pW=hm,dW=nv,mW=hS,hW=Rc,Zm=yS,xW=SS,Lb=bS,Ym=xS,gW=iv,H_=sv,yW=av,SW=mm,W_=cv,bW=ES,EW=Al,IW=Pb,TW=kk,wW=hv,CW=xm,AW=__,kW=zO,vW=dv,OW=mv,_W=Tv,RW=wS,PW=TS,$b=Iv,sa=Nc,MW=wv,Bb=rS,FW=nS,NW=vk,Kc=oS,jb=Qv,UW=Xv,zb=eO,DW=NS,LW=US,$W=Xk,BW=Yv,Qm=ev,qb=gm,jW=nl,zW=IS,qW=Sv,HW=Ok,fi=Fo,Hb=Pc,WW=bv,JW=Ev,li=pS,Pl=Ys,KW=Hm,vn=$n,GW=Yk,Wb=Gk,Jb=Vk,VW=_c,ZW=ps,YW=Zk,jo=Or,QW=pm,pi=sl,Xm=kS,Kb=bm,di=ri,XW=Fv,J_=al,eJ=vS,mi=Rv,Jn=RS,tJ=Pv,rJ=PS,Gb=Bn,cn=sn,nJ=OS,oJ=_S,sJ=Dv,aJ=Uv,iJ=MS,On=Lv,cJ=Em,Vb=Mv,bs=ni,zo=jn,uJ=jv,fJ=zv,$t=dm,lJ=k_,pJ=Rb,dJ=mS,mJ=tv,hJ=l(2,(e,t)=>K_(e,void 0,t)),K_=v_,xJ=gO,gJ=yO,yJ=SO,SJ=bO,bJ=vO,EJ=OO,IJ=_O,TJ=RO,wJ=wO,CJ=CO,AJ=AO,Zb=IO,kJ=qf,vJ=Hf,OJ=kO,_J=TO,RJ=wc,PJ=F_,MJ=N_,Gc=sO,Nt=DS,Vc=cO,FJ=aO,NJ=iO,UJ=Sk,DJ=bk,Ml=fO,_n=ds,LJ=LS,$J=lO,Yb=dO,Qb=$S,eh=pO,BJ=wm,jJ=hO,zJ=BS,qo=mO,qJ=Cm,Se=Xy,HJ=Ik,hi=zn,th=qn,WJ=qn(),JJ=qn(\"Fatal\"),KJ=qn(\"Warn\"),Xb=qn(\"Error\"),GJ=qn(\"Info\"),VJ=qn(\"Debug\"),ZJ=qn(\"Trace\"),YJ=l(2,(e,t)=>ps(e,WS,r=>new Set([...r,t]))),QJ=l(e=>Bo(e[0]),(e,...t)=>ps(e,HO,r=>{let n=t.length===1?{...r,...t[0]}:{...r};return t.length===1||N(n,t[0],t[1]),n})),XJ=BO,eK=l(2,(e,t)=>V(qS,r=>ps(e,WO,n=>[[t,r],...n]))),tK=l(e=>Bo(e[0]),(e,t,r)=>cn(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),rK=l(e=>Bo(e[0]),(e,t,r)=>Pr(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),nK=l(e=>Bo(e[0]),(e,t,r)=>Ym(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),oK=l(e=>Bo(e[0]),(e,t,r)=>W_(e,n=>{let o=r===void 0?n:r(n);return zc(t,o)})),sK=l(e=>Bo(e[0]),(e,t,r)=>hi(n=>{let o=n.monotonicTimeNanosUnsafe();return cn(e,()=>{let s=n.monotonicTimeNanosUnsafe(),a=AA(We(s),We(o)),i=r===void 0?a:r(a);return zc(t,i)})})),qc=class extends fr()(\"effect/Effect/Transaction\"){},aK=e=>an(t=>{let r=Rd(t.context,qc);if(r)return e;r={journal:new Map,retry:!1};let n;return zo(o=>I(Wn({while:()=>!n,body:je(o(e).pipe(jo(qc,r),H_(()=>r.retry?o(iK(r)):Y),kn)),step(s){if(r.retry||!G_(r))return q_(r);Ke(s)?cK(t,r):q_(r),n=s}}),()=>n))}),G_=e=>{for(let[t,{version:r}]of e.journal)if(t.version!==r)return!1;return!0},iK=e=>Wc(t=>{if(!G_(e))return t(Y);let r={},n=Array.from(e.journal.keys()),o=()=>{for(let a of n)a.pending.delete(r)},s=()=>{o(),t(Y)};for(let a of n)a.pending.set(r,s);return te(o)});function cK(e,t){for(let[r,{value:n,written:o}]of t.journal)if(o){Object.is(n,r.value)||(r.version=r.version+1,r.value=n);for(let s of r.pending.values())e.currentDispatcher.scheduleTask(s,0);r.pending.clear()}}function q_(e){e.retry=!1,e.journal.clear()}var uK=I(qc,e=>(e.retry=!0,On)),fK=(e,t,r)=>(...n)=>Wc(o=>{try{e(...n,(s,a)=>{o(s?P(t?t(s,n):s):g(a))})}catch(s){o(r?P(r(s,n)):Rr(s))}}),lK=()=>e=>e,pK=()=>e=>e,dK=()=>e=>e,Dr=Pk,Fl=Mk,Kt=Fk,nt=_k,Zc=Nk,eE=Tk;var V_=/^[+-]?\\d+$/,rE=\"~effect/BigDecimal\",mK={[rE]:rE,[se](){let e=oE(this);return fe(_e(String(e.value)),It(e.scale))},[ae](e){return nE(e)&&tR(this,e)===0},toString(){return`BigDecimal(${Es(this)})`},toJSON(){return{_id:\"BigDecimal\",value:String(this.value),scale:this.scale}},[Ie](){return this.toJSON()},pipe(){return Z(this,arguments)}},nE=e=>A(e,rE),Q_=(e,t)=>{if(!Number.isSafeInteger(t))throw new RangeError(`Scale must be a safe integer, got ${t}`);let r=Object.create(mK);return r.value=e,r.scale=t,r},X_=(e,t)=>{let r=Q_(e,t);return r.normalized=r,r};var Kn=BigInt(0),hK=BigInt(1);var xK=BigInt(10),eR=X_(Kn,0);var oE=e=>{if(e.normalized===void 0)if(e.value===Kn)e.normalized=eR;else{let t=`${e.value}`,r=t.length;for(;t[r-1]===\"0\";)r--;e.normalized=X_(BigInt(t.slice(0,r)),e.scale-(t.length-r))}return e.normalized};var gK=100,yK=[hK],tE=(e,t)=>e===t?0:e{let r=`${e.value{if(e.scale===t.scale)return tE(e.value,t.value);let r=Y_(e),n=Y_(t);if(r!==n)return rgK)return r===-1?Z_(t,e):Z_(e,t);let a=yK[s]??=xK**BigInt(s);return o>0?tE(e.value,t.value*a):tE(e.value*a,t.value)},Yc=Bs(tR);var Y_=e=>e.value===Kn?0:e.value{if(e===\"\")return O(eR);let t,r,n=e.search(/[eE]/);if(n!==-1){let c=e.slice(n+1);if(t=e.slice(0,n),r=Number(c),t===\"\"||!Number.isSafeInteger(r)||!V_.test(c))return v()}else t=e,r=0;let o,s,a=t.search(/\\./);if(a!==-1){let c=t.slice(0,a),u=t.slice(a+1);o=`${c}${u}`,s=u.length}else o=t,s=0;if(!V_.test(o))return v();let i=s-r;return Number.isSafeInteger(i)?O(Q_(BigInt(o),i)):v()};var Es=e=>{let t=oE(e);if(Math.abs(t.scale)>=16)return SK(t);let r=t.value0?n.padStart(t.scale+1,\"0\"):n.padEnd(n.length-t.scale,\"0\"),s=o.length-t.scale,a=t.scale>0?`${o.slice(0,s)}.${o.slice(s)}`:o;return r?`-${a}`:a},SK=e=>{if(bK(e))return\"0e+0\";let t=oE(e),r=`${t.value}`,n=t.value=0?\"+\":\"\"}${a}`};var bK=e=>e.value===Kn;var me={};Eo(me,{Any:()=>V3,Array:()=>$e,ArrayEnsure:()=>aV,BigDecimal:()=>sD,BigDecimalFromString:()=>BZ,BigInt:()=>Fu,BigIntFromString:()=>wZ,Boolean:()=>VT,BooleanFromBit:()=>RZ,BooleanLiterals:()=>XT,ByteSize:()=>Bu,ByteSizeFromBigInt:()=>zZ,ByteSizeFromNumber:()=>qZ,ByteSizeFromString:()=>jZ,Cause:()=>WT,CauseReason:()=>HT,Char:()=>uZ,Chunk:()=>HZ,Class:()=>ND,Cookie:()=>PD,Cookies:()=>MD,Date:()=>$u,DateFromMillis:()=>gZ,DateFromString:()=>xZ,DateTimeUtc:()=>Cx,DateTimeUtcFromDate:()=>ZZ,DateTimeUtcFromMillis:()=>QZ,DateTimeUtcFromString:()=>YZ,DateTimeZoned:()=>ID,DateTimeZonedFromString:()=>r5,Defect:()=>lZ,Duration:()=>kx,DurationFromMillis:()=>W5,DurationFromNanos:()=>H5,DurationFromString:()=>lw,Enum:()=>K3,Error:()=>UD,ErrorInstance:()=>fZ,Exit:()=>J5,FalseLiterals:()=>FU,File:()=>QU,Finite:()=>Du,FiniteFromString:()=>TZ,FormData:()=>XU,Graph:()=>Z5,HashMap:()=>Y5,HashSet:()=>Q5,Headers:()=>n8,InetAddress:()=>_D,InetAddressFromString:()=>D5,InetAddressV4:()=>N5,InetAddressV6:()=>U5,Int:()=>co,IpAddress:()=>qi,IpAddressFromString:()=>zu,IpInterface:()=>AD,IpInterfaceFromString:()=>R5,IpLinkLocalAddress:()=>g5,IpLinkLocalAddressFromString:()=>y5,IpLoopbackAddress:()=>h5,IpLoopbackAddressFromString:()=>x5,IpMulticastAddress:()=>n5,IpMulticastAddressFromString:()=>o5,IpNetwork:()=>OD,IpNetworkFromString:()=>F5,IpUnicastAddress:()=>i5,IpUnicastAddressFromString:()=>c5,IpUnspecifiedAddress:()=>S5,IpUnspecifiedAddressFromString:()=>b5,Ipv4Address:()=>Ax,Ipv4AddressFromString:()=>uw,Ipv4BroadcastAddress:()=>l5,Ipv4BroadcastAddressFromString:()=>p5,Ipv4Interface:()=>wD,Ipv4InterfaceFromString:()=>O5,Ipv4Network:()=>kD,Ipv4NetworkFromString:()=>P5,Ipv4PrivateAddress:()=>E5,Ipv4PrivateAddressFromString:()=>I5,Ipv6Address:()=>fw,Ipv6AddressFromString:()=>TD,Ipv6Interface:()=>CD,Ipv6InterfaceFromString:()=>_5,Ipv6Network:()=>vD,Ipv6NetworkFromString:()=>M5,Ipv6UniqueLocalAddress:()=>T5,Ipv6UniqueLocalAddressFromString:()=>w5,Json:()=>Ox,JsonFromUrlParamsField:()=>o8,JsonObject:()=>P8,Literal:()=>wt,Literals:()=>io,MacAddress:()=>zi,MacAddressFromString:()=>ju,MacBroadcastAddress:()=>d5,MacBroadcastAddressFromString:()=>m5,MacLocallyAdministeredAddress:()=>C5,MacLocallyAdministeredAddressFromString:()=>A5,MacMulticastAddress:()=>s5,MacMulticastAddressFromString:()=>a5,MacUnicastAddress:()=>u5,MacUnicastAddressFromString:()=>f5,MacUniversallyAdministeredAddress:()=>k5,MacUniversallyAdministeredAddressFromString:()=>v5,MutableJson:()=>F8,Natural:()=>Li,Never:()=>G3,NonEmptyArray:()=>YT,NonEmptyString:()=>aw,Null:()=>yx,NullOr:()=>QT,NullishOr:()=>CU,Number:()=>ji,NumberFromString:()=>IZ,ObjectKeyword:()=>Q3,Opaque:()=>SV,Option:()=>Hi,OptionFromNullOr:()=>X5,OptionFromNullishOr:()=>t8,OptionFromOptional:()=>i8,OptionFromOptionalKey:()=>a8,OptionFromOptionalNullOr:()=>c8,OptionFromUndefinedOr:()=>e8,PropertyKey:()=>qT,ReadonlyMap:()=>pZ,ReadonlySet:()=>dZ,Record:()=>ks,RecordFromCookies:()=>r8,RecordFromUrlParams:()=>s8,Redacted:()=>vx,RedactedFromValue:()=>u8,RegExp:()=>mZ,Result:()=>f8,SchemaError:()=>As,SocketAddress:()=>$5,StandardSchemaV1FailureResult:()=>_Z,String:()=>J,StringForLiteralAutocomplete:()=>Z3,StringFromBase64:()=>AZ,StringFromBase64Url:()=>kZ,StringFromHex:()=>vZ,StringFromUriComponent:()=>OZ,Struct:()=>Me,StructWithRest:()=>oV,Symbol:()=>IU,TaggedClass:()=>m8,TaggedError:()=>h8,TaggedStruct:()=>Ex,TaggedUnion:()=>yV,TemplateLiteral:()=>W3,TemplateLiteralParser:()=>J3,TimeZone:()=>bD,TimeZoneFromString:()=>t5,TimeZoneNamed:()=>yD,TimeZoneNamedFromString:()=>e5,TimeZoneOffset:()=>XZ,Tree:()=>R8,Trim:()=>CZ,Trimmed:()=>tD,TrueLiterals:()=>MU,Tuple:()=>Zo,TupleWithRest:()=>sV,URL:()=>Tx,URLFromString:()=>hZ,URLSearchParams:()=>eD,Uint8Array:()=>wx,Uint8ArrayFromBase64:()=>PZ,Uint8ArrayFromBase64Url:()=>MZ,Uint8ArrayFromHex:()=>FZ,Undefined:()=>GT,UndefinedOr:()=>bx,Union:()=>st,UniqueArray:()=>iV,UniqueSymbol:()=>X3,UnixPathAddress:()=>RD,UnixPathAddressFromString:()=>L5,Unknown:()=>Ap,UnknownFromJsonString:()=>SZ,UrlParams:()=>pw,Void:()=>Y3,annotate:()=>y3,annotateEncoded:()=>S3,annotateKey:()=>b3,asserts:()=>C3,brand:()=>vU,catchDecoding:()=>lV,catchDecodingWithContext:()=>RU,catchEncoding:()=>pV,catchEncodingWithContext:()=>PU,check:()=>uV,declare:()=>Be,declareConstructor:()=>qr,decode:()=>dV,decodeEffect:()=>A3,decodeExit:()=>k3,decodeOption:()=>O3,decodePromise:()=>R3,decodeResult:()=>_3,decodeSync:()=>P3,decodeTo:()=>G,decodeUnknownEffect:()=>hx,decodeUnknownExit:()=>dU,decodeUnknownOption:()=>v3,decodeUnknownPromise:()=>hU,decodeUnknownResult:()=>mU,decodeUnknownSync:()=>xU,encode:()=>mV,encodeEffect:()=>M3,encodeExit:()=>F3,encodeKeys:()=>rV,encodeOption:()=>U3,encodePromise:()=>L3,encodeResult:()=>D3,encodeSync:()=>$3,encodeTo:()=>ew,encodeUnknownEffect:()=>xx,encodeUnknownExit:()=>gU,encodeUnknownOption:()=>N3,encodeUnknownPromise:()=>SU,encodeUnknownResult:()=>yU,encodeUnknownSync:()=>bU,extendTo:()=>nV,fieldsAssign:()=>eV,flip:()=>zT,fromBrand:()=>fV,fromFormData:()=>bZ,fromJsonString:()=>iw,fromURLSearchParams:()=>EZ,instanceOf:()=>xa,is:()=>w3,isBase64:()=>BU,isBase64Url:()=>vV,isBetween:()=>Lu,isBetweenBigDecimal:()=>$Z,isBetweenBigInt:()=>QV,isBetweenCodePoints:()=>tZ,isBetweenDate:()=>GV,isBetweenLength:()=>nw,isBetweenProperties:()=>iZ,isBetweenSize:()=>oZ,isCapitalized:()=>FV,isEndingWith:()=>_V,isFinite:()=>UV,isGUID:()=>AV,isGreaterThan:()=>LV,isGreaterThanBigDecimal:()=>NZ,isGreaterThanBigInt:()=>VV,isGreaterThanDate:()=>HV,isGreaterThanOrEqualTo:()=>jU,isGreaterThanOrEqualToBigDecimal:()=>UZ,isGreaterThanOrEqualToBigInt:()=>zU,isGreaterThanOrEqualToDate:()=>WV,isIncluding:()=>RV,isInt:()=>Ix,isInt32:()=>zV,isLessThan:()=>$V,isLessThanBigDecimal:()=>DZ,isLessThanBigInt:()=>ZV,isLessThanDate:()=>JV,isLessThanOrEqualTo:()=>BV,isLessThanOrEqualToBigDecimal:()=>LZ,isLessThanOrEqualToBigInt:()=>YV,isLessThanOrEqualToDate:()=>KV,isLowercased:()=>MV,isMaxCodePoints:()=>eZ,isMaxLength:()=>JU,isMaxProperties:()=>aZ,isMaxSize:()=>nZ,isMinCodePoints:()=>XV,isMinLength:()=>qU,isMinProperties:()=>sZ,isMinSize:()=>rZ,isMultipleOf:()=>jV,isNonEmpty:()=>WU,isPattern:()=>Uu,isPropertyNames:()=>cZ,isSchema:()=>gx,isSchemaError:()=>cU,isStartingWith:()=>OV,isStringBigInt:()=>IV,isStringFinite:()=>EV,isStringSymbol:()=>TV,isTrimmed:()=>$U,isULID:()=>kV,isUUID:()=>CV,isUint32:()=>qV,isUncapitalized:()=>NV,isUnique:()=>sw,isUniqueKey:()=>KU,isUppercased:()=>PV,link:()=>Ae,linkDecoding:()=>Nu,make:()=>q,makeFilter:()=>Ne,makeFilterGroup:()=>bV,makeIsBetween:()=>Rp,makeIsGreaterThan:()=>kp,makeIsGreaterThanOrEqualTo:()=>vp,makeIsLessThan:()=>Op,makeIsLessThanOrEqualTo:()=>_p,makeIsMultipleOf:()=>DV,middlewareDecoding:()=>OU,middlewareEncoding:()=>_U,mutable:()=>cV,mutableKey:()=>z3,optional:()=>Pu,optionalKey:()=>$i,overrideToCodecIso:()=>O8,overrideToEquivalence:()=>y8,overrideToFormatter:()=>x8,readonlyKey:()=>q3,refine:()=>kU,required:()=>j3,requiredKey:()=>B3,resolveAnnotations:()=>N8,resolveAnnotationsKey:()=>U8,revealBottom:()=>g3,revealCodec:()=>E3,suspend:()=>AU,tag:()=>Bi,tagDefaultOmit:()=>gV,toCodecArrayFromSingle:()=>w8,toCodecIso:()=>T8,toCodecJson:()=>I8,toCodecStringTree:()=>Mp,toDifferJsonPatch:()=>_8,toEncoded:()=>Mu,toEncoderXml:()=>C8,toEquivalence:()=>S8,toFormatter:()=>g8,toIso:()=>A8,toIsoFocus:()=>v8,toIsoSource:()=>k8,toJsonSchemaDocument:()=>E8,toRepresentation:()=>b8,toStandardJSONSchemaV1:()=>T3,toStandardSchemaV1:()=>I3,toTaggedUnion:()=>LU,toType:()=>Hr,withArrayLengthConstraints:()=>Sx,withConstructorDefault:()=>NU,withDecodingDefault:()=>DU,withDecodingDefaultKey:()=>tw,withDecodingDefaultType:()=>xV,withDecodingDefaultTypeKey:()=>hV});var oR=globalThis.BigInt;var sR=e=>e>oR(Number.MAX_SAFE_INTEGER)||ee.names.map(t=>[t,e])));var aE=e=>e;var Qc=e=>{throw new Error(`Invalid ByteSize: ${e}`)},cR=e=>!Number.isSafeInteger(e)||e<0?Qc(`expected a non-negative safe integer, received ${e}`):aE(BigInt(e));var uR=e=>{let t=/^\\s*(\\d+)(?:\\.(\\d+))?\\s*([A-Za-z]+)\\s*$/.exec(e);if(t===null)return Qc(`unsupported syntax ${JSON.stringify(e)}`);let r=wK.get(t[3]);if(r===void 0)return Qc(`unsupported unit ${JSON.stringify(t[3])}`);let n=t[2]??\"\",o=BigInt(10)**BigInt(n.length),s=BigInt(t[1]+n)*r.factor;return s%o!==sE?Qc(`${JSON.stringify(e)} does not represent an integral number of bytes`):aE(s/o)},fR=Ln(uR),rh=e=>{switch(typeof e){case\"bigint\":return etypeof e==\"bigint\"?rh(e):cR(e);var pR=e=>typeof e==\"bigint\"&&e>=sE;var nh=e=>e,dR=sR;var hR=\"~effect/Chunk\";function mR(e,t,r,n,o){for(let s=t;str((t,r)=>{if(t.length!==r.length)return!1;let n=xi(t),o=xi(r);for(let s=0;se},toString(){return`Chunk(${F(xi(this))})`},toJSON(){return{_id:\"Chunk\",values:kt(xi(this))}},[Ie](){return this.toJSON()},[ae](e){return sh(e)&&kK(this,e)},[se](){return To(xi(this))},[Symbol.iterator](){switch(this.backing._tag){case\"IArray\":return this.backing.array[Symbol.iterator]();case\"IEmpty\":return xR[Symbol.iterator]();default:return xi(this)[Symbol.iterator]()}},pipe(){return Z(this,arguments)}},fE=e=>{let t=Object.create(vK);switch(t.backing=e,e._tag){case\"IEmpty\":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case\"IConcat\":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case\"IArray\":{t.length=e.array.length,t.depth=0,t.left=Is,t.right=Is;break}case\"ISingleton\":{t.length=1,t.depth=0,t.left=Is,t.right=Is;break}case\"ISlice\":{t.length=e.length,t.depth=0,t.left=Is,t.right=Is;break}}return t},sh=e=>A(e,hR),Is=fE({_tag:\"IEmpty\"}),OK=()=>Is;var _K=e=>fE({_tag:\"ISingleton\",a:e}),lE=e=>sh(e)?e:PK(Ve(e)),cE=(e,t,r)=>{switch(e.backing._tag){case\"IArray\":{mR(e.backing.array,0,t,r,e.length);break}case\"IConcat\":{cE(e.left,t,r),cE(e.right,t,r+e.left.length);break}case\"ISingleton\":{t[r]=e.backing.a;break}case\"ISlice\":{mR(xi(e.backing.chunk),e.backing.offset,t,r,e.length);break}}};var RK=e=>{switch(e.backing._tag){case\"IEmpty\":return xR;case\"IArray\":return e.backing.array;default:{let t=new Array(e.length);return cE(e,t,0),e.backing={_tag:\"IArray\",array:t},e.left=Is,e.right=Is,e.depth=0,t}}},xi=RK;var PK=e=>e.length===0?OK():e.length===1?_K(e[0]):fE({_tag:\"IArray\",array:e});var gR=e=>e.length;var dE=Bc,yR=ii,SR=i_,bR=c_,ER=u_,IR=mb,TR=f_;var wR=$m;var CR=hb;var mE=p_,AR=d_;var hE=m_;var xE=xb,gE=Sl,kR=gb;var vR=yb,Nl=h_;var OR=bl;var _R=Eb;var RR=g_;var yE=Tb;var Xc=e=>MK(typeof e==\"string\"?FK.encode(e):e),gi=e=>{let t=UK(e),r=t.length;if(r%4!==0)return K(new wn({kind:\"Decode\",module:\"Base64\",input:t,message:`Length must be a multiple of 4, but is ${r}`}));let n=t.indexOf(\"=\");if(n!==-1&&(nUf(t4(e,t,r));function r4(e){let t=tP(e.name,e.valueEncoded,e.options);if(t!==void 0)throw t;let r=e.name+\"=\"+e.valueEncoded;if(e.options===void 0)return r;let n=e.options;if(n.maxAge!==void 0){let o=IA(We(n.maxAge));r+=\"; Max-Age=\"+Math.trunc(o)}if(n.domain!==void 0&&(r+=\"; Domain=\"+n.domain),n.path!==void 0&&(r+=\"; Path=\"+n.path),n.priority!==void 0)switch(n.priority){case\"low\":r+=\"; Priority=Low\";break;case\"medium\":r+=\"; Priority=Medium\";break;case\"high\":r+=\"; Priority=High\";break}if(n.expires!==void 0&&(r+=\"; Expires=\"+n.expires.toUTCString()),n.httpOnly&&(r+=\"; HttpOnly\"),n.secure&&(r+=\"; Secure\"),n.partitioned&&(r+=\"; Partitioned\"),n.sameSite!==void 0)switch(n.sameSite){case\"lax\":r+=\"; SameSite=Lax\";break;case\"strict\":r+=\"; SameSite=Strict\";break;case\"none\":r+=\"; SameSite=None\";break}return r}var nP=e=>{let t={},r=Object.values(e.cookies);for(let n=0;nObject.values(e.cookies).map(r4);var n4=e=>{try{return decodeURIComponent(e)}catch{return e}};var Ii=new WeakMap,sP=e=>{if(Ii.has(e))return Ii.get(e);throw new Error(\"Unable to get redacted value\"+(e.label?` with label: \"${e.label}\"`:\"\"))};var aP=\"~effect/Redacted\",$E=e=>A(e,aP),Ti=(e,t)=>{let r=Object.create(a4);return t?.label&&(r.label=t.label),Ii.set(r,e),r},a4={[aP]:{_A:e=>e},label:void 0,...er,toJSON(){return this.toString()},toString(){return``},[se](){return H(Ii.get(this))},[ae](e){return $E(e)&&W(Ii.get(this),Ii.get(e))}},eu=sP;var iP=e=>tr((t,r)=>e(eu(t),eu(r)));var jE=Symbol.for(\"~effect/http/Headers\"),cP=e=>A(e,jE),zE=Object.defineProperties(Object.create(null),{[jE]:{value:jE},[Ra]:{value(e){return c4(this,Fe(e,u4))}},toJSON:{value(){return Ds(this)}},[ae]:{value(e){return qE(this,e)}},[se]:{value(){return bf(this)}},toString:{value:ic.toString},[Ie]:{value:ic[Ie]}});var qE=uA(za()),i4=Object.create(zE),uP=e=>{if(e===void 0)return i4;if(Symbol.iterator in e){let r=Object.create(zE);for(let[n,o]of e)r[n.toLowerCase()]=o;return r}let t=Object.create(zE);for(let[r,n]of Object.entries(e))Array.isArray(n)?t[r.toLowerCase()]=n.join(\", \"):n!==void 0&&(t[r.toLowerCase()]=n);return t};var c4=l(2,(e,t)=>{let r={...e},n=o=>{if(typeof o==\"string\"){let s=o.toLowerCase();s in e&&(r[s]=Ti(e[s]))}else for(let s in e)s.search(o)!==-1&&(r[s]=Ti(e[s]))};if(Array.isArray(t))for(let o=0;o[\"authorization\",\"cookie\",\"set-cookie\",\"x-api-key\"]});var HE=\"~effect/http/UrlParams\",WE=e=>A(e,HE),l4={...er,[HE]:HE,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:\"UrlParams\",params:Object.fromEntries(this.params)}},[ae](e){return JE(this,e)},[se](){return To(this.params.flat())}},dh=e=>{let t=Object.create(l4);return t.params=e,t},fP=e=>{if(WE(e))return e;let t=lP(e),r=[];for(let n=0;n{let t=typeof e[Symbol.iterator]==\"function\"?Ve(e):Object.entries(e),r=[];for(let[n,o]of t)if(Array.isArray(o))for(let s=0;sp4(e.params,t.params)),p4=dA(rA([za(),za()]));var pP=l(2,(e,t)=>dy(e.params,([r])=>r===t).pipe(_t(([,r])=>r)));var d4=e=>{let t={};for(let[r,n]of e.params)if(!Object.hasOwn(t,r))N(t,r,n);else{let o=t[r];typeof o==\"string\"?N(t,r,[o,n]):o.push(n)}return t},dP=d4;var KE=\"~effect/Graph\",GE=e=>A(e,KE),mP=e=>e;var h4=(e,t,r)=>(e===\"directed\"?t.source===r.source&&t.target===r.target:t.source===r.source&&t.target===r.target||t.source===r.target&&t.target===r.source)&&W(t.data,r.data),x4=(e,t)=>e===\"directed\"?H(t):zt(fe(H(t.data),g4(t.source,t.target))),g4=(e,t)=>fe(0,H(e))+fe(0,H(t)),y4=_e(\"Graph\"),S4={[KE]:{_N:e=>e,_E:e=>e},[Symbol.iterator](){return this.nodes[Symbol.iterator]()},[Ie](){return this.toJSON()},[ae](e){if(A(e,KE)){let t=mP(e);if(this.nodes.size!==t.nodes.size||this.edges.size!==t.edges.size||this.type!==t.type)return!1;for(let[r,n]of this.nodes)if(!t.nodes.has(r)||!W(n,t.nodes.get(r)))return!1;for(let[r,n]of this.edges){let o=t.edges.get(r);if(o===void 0||!h4(this.type,n,o))return!1}return!0}return!1},[se](){let e=y4;e=e^_e(this.type),e=e^It(this.nodes.size),e=e^It(this.edges.size);for(let[t,r]of this.nodes)e^=fe(H(t),H(r));for(let[t,r]of this.edges)e^=fe(H(t),x4(this.type,r));return zt(e)},toJSON(){return{_id:\"Graph\",nodeCount:this.nodes.size,edgeCount:this.edges.size,type:this.type}},toString(){return`Graph(${this.type}, ${this.nodes.size}, ${this.edges.size})`},pipe(){return Z(this,arguments)}},b4=(e,t)=>{let r=Object.create(S4);return r.type=e,r.mutable=t,r.transforming=!1,r.nodes=new Map,r.edges=new Map,r.adjacency=new Map,r.reverseAdjacency=new Map,r.nextNodeIndex=0,r.nextEdgeIndex=0,r.acyclic=O(!0),r};var zl=e=>{let t=mP(e);return{type:e.type,nodes:Array.from(t.nodes,([r,n])=>({index:r,data:n})).sort((r,n)=>r.index-n.index),edges:Array.from(t.edges,([r,n])=>({index:r,source:n.source,target:n.target,data:n.data})).sort((r,n)=>r.index-n.index)}},mh=e=>{let t=b4(e.type,!1);for(let r of e.nodes)t.nodes.set(r.index,r.data),t.adjacency.set(r.index,[]),t.reverseAdjacency.set(r.index,[]);for(let r of e.edges)t.edges.set(r.index,{source:r.source,target:r.target,data:r.data}),t.adjacency.get(r.source).push(r.index),t.reverseAdjacency.get(r.target).push(r.index),e.type===\"undirected\"&&(t.adjacency.get(r.target).push(r.index),t.reverseAdjacency.get(r.source).push(r.index));return t.nextNodeIndex=e.nodes.length===0?0:e.nodes[e.nodes.length-1].index+1,t.nextEdgeIndex=e.edges.length===0?0:e.edges[e.edges.length-1].index+1,t.acyclic=v(),t};function Ts(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function hh(e){return t=>Ts(t)?.[e]}var Lr=\"~structural\",wi=\"~identifier\",ql=\"~sentinels\",xh=\"~constructor\",hP=[\"title\",\"description\",\"default\",\"examples\",\"readOnly\",\"writeOnly\",\"format\",\"contentEncoding\",\"contentMediaType\",\"contentSchema\"],tu=hh(\"identifier\"),VE=hh(wi),ZE=hh(\"title\");var Hl=Zr(e=>{let t=Ts(e)?.identifier;return typeof t==\"string\"?t:e.getExpected(Hl)}),xP=new Set([ql,Lr,\"representation\",\"arbitraryConstraint\",\"toJsonSchema\",\"toCode\",\"toEquivalence\",\"toFormatter\",\"toCodec\",\"toCodecJson\",\"toCodecStringTree\",\"toCodecIso\",\"toCodecArbitrary\"]);var ge=Symbol();var Gt=pr,$r=Gt(ge),ze=Gt(ge),Wl=e=>e===ge?v():O(e),YE=e=>e._tag===\"None\"?$r:Gt(e.value);var Gl=\"~effect/SchemaIssue/Issue\";function XE(e){return A(e,Gl)&&e[Gl]===Gl}function I4(e){return Object.hasOwn(e,\"input\")}var un=class{[Gl]=Gl;constructor(t,r){r?.reportInput===!0&&t!==ge&&(this.input=t)}},gP=class extends un{_tag=\"Filter\";filter;issue;constructor(e,t,r,n){super(r,n),this.filter=e,this.issue=t}},yP=class extends un{_tag=\"Encoding\";ast;issue;constructor(e,t,r,n){super(r,n),this.ast=e,this.issue=t}},ct=class extends un{_tag=\"Pointer\";path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},fa=class extends un{_tag=\"MissingKey\";annotations;constructor(e){super(),this.annotations=e}},eI=class extends un{_tag=\"UnexpectedKey\";ast;constructor(e,t,r){super(t,r),this.ast=e}},Tt=class extends un{_tag=\"Composite\";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},ut=class extends un{_tag=\"InvalidType\";ast;constructor(e,t,r){super(t,r),this.ast=e}},de=class extends un{_tag=\"InvalidValue\";annotations;constructor(e,t,r){super(t,r),this.annotations=e}};function Br(e,t,r,n,o){return new Tt(e,[new ct([t],r)],n,o)}var Vl=class extends un{_tag=\"Forbidden\";annotations;constructor(e,t,r){super(t,r),this.annotations=e}},Zl=class extends un{_tag=\"AnyOf\";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},SP=class extends un{_tag=\"OneOf\";ast;successes;constructor(e,t,r,n){super(r,n),this.ast=e,this.successes=t}};function QE(e,t,r){if(XE(e))return e;if(typeof e==\"string\")return new de({message:e},t,r);let n=typeof e.issue==\"string\"?new de({message:e.issue},t,r):e.issue;return new ct(e.path,n)}function bP(e,t,r){if(e!==void 0)return typeof e==\"boolean\"?e?void 0:new de(void 0,t,r):QE(e,t,r)}function EP(e,t,r,n){return Array.isArray(t)?Qe(t)?t.length===1?QE(t[0],r,n):new Tt(e,In(t,o=>QE(o,r,n)),r,n):void 0:bP(t,r,n)}var IP=e=>{let t=nu(e);if(t!==void 0)return t;switch(e._tag){case\"InvalidType\":return ua(Hl(e.ast),e);case\"InvalidValue\":{let r=tI(e);if(r!==void 0)return ua(r,e);let n=gh(e);return n===void 0?\"Expected a valid value\":`Invalid data ${n}`}case\"MissingKey\":return\"Missing key\";case\"UnexpectedKey\":{let r=gh(e);return r===void 0?\"Expected no excess property\":`Unexpected key with value ${r}`}case\"Forbidden\":return\"Forbidden operation\";case\"OneOf\":{let r=gh(e);return r===void 0?\"Expected exactly one member to match\":`Expected exactly one member to match the input ${r}`}}},TP=e=>nu(e.issue)??nu(e);function wP(e){return t=>({issues:ru(t,[],e?.leafHook??IP,e?.checkHook??TP)})}function gh(e){return I4(e)?F(e.input):void 0}function tI(e){let t=e.annotations?.expected;return typeof t==\"string\"?t:void 0}function ua(e,t){let r=gh(t);return r===void 0?`Expected ${e}`:`Expected ${e}, got ${r}`}function ru(e,t,r,n){switch(e._tag){case\"Filter\":{let o=n(e);if(o!==void 0)return[{path:t,message:o}];if(e.issue._tag!==\"InvalidValue\")return ru(e.issue,t,r,n);let s=tI(e.issue);return[{path:t,message:s===void 0?ua(rI(e.filter),e):ua(s,e.issue)}]}case\"Encoding\":return ru(e.issue,t,r,n);case\"Pointer\":return ru(e.issue,[...t,...e.path],r,n);case\"Composite\":return e.issues.flatMap(o=>ru(o,t,r,n));case\"AnyOf\":return e.issues.length===0?[{path:t,message:nu(e)??ua(Hl(e.ast),e)}]:e.issues.flatMap(o=>ru(o,t,r,n));default:return[{path:t,message:r(e)}]}}function rI(e){let t=e.annotations?.expected;if(typeof t==\"string\")return t;switch(e._tag){case\"Filter\":return\"\";case\"FilterGroup\":return e.checks.map(r=>rI(r)).join(\" & \")}}function T4(){return e=>Kl(e,\"\")}var CP=T4();function Kl(e,t){let r;switch(e._tag){case\"Filter\":{let n=TP(e);if(n!==void 0)r=n;else{if(e.issue._tag!==\"InvalidValue\")return Kl(e.issue,t);let o=tI(e.issue);r=o===void 0?ua(rI(e.filter),e):ua(o,e.issue)}break}case\"Encoding\":return Kl(e.issue,t);case\"Pointer\":return Kl(e.issue,t+ud(e.path));case\"Composite\":case\"AnyOf\":{if(e._tag===\"Composite\"||e.issues.length>0)return e.issues.map(n=>Kl(n,t)).join(`\n`);r=nu(e)??ua(Hl(e.ast),e);break}default:r=IP(e);break}return t?`${r}\n at ${t}`:r}function nu(e){if(e._tag===\"Pointer\")return;if(e._tag===\"Encoding\")return nu(e.issue);let r=(e._tag===\"Filter\"?e.filter.annotations:\"annotations\"in e?e.annotations:e.ast.annotations)?.[e._tag===\"MissingKey\"?\"messageMissingKey\":e._tag===\"UnexpectedKey\"?\"messageUnexpectedKey\":\"message\"];if(typeof r==\"string\")return r}function Yl(e){let t;for(let r of e.reasons){if(!fl(r)||!XE(r.error))return;t??=r.error}return t}function fn(e,t){let r=Yl(e);if(r===void 0)throw new Error(t,{cause:e});return r}var kP=e=>Xc(e).replace(/=/g,\"\").replace(/\\+/g,\"-\").replace(/\\//g,\"_\"),nI=e=>{let t=e.replace(/[\\n\\r]/g,\"\"),r=t.length;if(r%4===1)return K(new wn({module:\"Base64Url\",kind:\"Decode\",input:t,message:`Length should be a multiple of 4, but is ${r}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(t))return K(new wn({module:\"Base64Url\",kind:\"Decode\",input:t,message:\"Invalid input\"}));let n=r%4===2?`${t}==`:r%4===3?`${t}=`:t;return n=n.replace(/-/g,\"+\").replace(/_/g,\"/\"),gi(n)},vP=e=>Cr(nI(e),t=>w4.decode(t)),w4=new TextDecoder;var OP=(e,t,r)=>{switch(e._tag){case\"Passthrough\":return g(t);case\"Transform\":return g(_t(t,e.transform));case\"TransformOptional\":return g(e.transform(t));case\"TransformEffect\":return ue(t)?ra:Dr(e.transform(t.value,r),O);case\"TransformOptionalEffect\":return e.transform(t,r)}};var Ql=e=>Object.assign(Object.create(Pg),e),yh=(e,t)=>oI((r,n)=>nt(OP(e,r,n),o=>OP(t,o,n))),Sh=l(2,(e,t)=>{if(e._tag===\"Passthrough\")return t;if(t._tag===\"Passthrough\")return e;switch(e._tag){case\"Transform\":switch(t._tag){case\"Transform\":return oe(r=>t.transform(e.transform(r)));case\"TransformOptional\":return Ci(r=>t.transform(_t(r,e.transform)));case\"TransformEffect\":return gt((r,n)=>t.transform(e.transform(r),n));case\"TransformOptionalEffect\":return yh(e,t)}case\"TransformOptional\":switch(t._tag){case\"Transform\":return Ci(r=>_t(e.transform(r),t.transform));case\"TransformOptional\":return Ci(r=>t.transform(e.transform(r)));case\"TransformEffect\":case\"TransformOptionalEffect\":return yh(e,t)}case\"TransformEffect\":switch(t._tag){case\"Transform\":return gt((r,n)=>Dr(e.transform(r,n),t.transform));case\"TransformOptional\":case\"TransformOptionalEffect\":return yh(e,t);case\"TransformEffect\":return gt((r,n)=>nt(e.transform(r,n),o=>t.transform(o,n)))}case\"TransformOptionalEffect\":return yh(e,t)}});function A4(e){return oI((t,r)=>P(e(t,r)))}function bh(e){return A4((t,r)=>{let n={message:e(t)};return Oe(t)?new Vl(n,t.value,r):new Vl(n)})}var _P=bh(()=>\"Encoding is not supported\"),k4=Ql({_tag:\"Passthrough\"});function jr(){return k4}function oe(e){return Ql({_tag:\"Transform\",transform:e})}function gt(e){return Ql({_tag:\"TransformEffect\",transform:e})}function Ci(e){return Ql({_tag:\"TransformOptional\",transform:e})}function oI(e){return Ql({_tag:\"TransformOptionalEffect\",transform:e})}function sI(){return Ci(()=>v())}function aI(e){return oI(t=>{let r=Wa(t,Io);return Oe(r)?g(r):Dr(e,O)})}function Ai(){return oe(globalThis.String)}function Eh(){return oe(globalThis.Number)}function RP(){return oe(globalThis.BigInt)}function iI(){return oe(e=>new globalThis.Date(e))}function PP(){return oe(I_)}function MP(e){return gt((t,r)=>Jc({try:()=>JSON.parse(t,e?.reviver),catch:()=>new de({expected:\"a valid JSON string\"},t,r)}))}function FP(e){return gt((t,r)=>Jc({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw new TypeError(\"Value cannot be represented as JSON\");return n},catch:()=>new de({expected:\"a JSON-serializable value\"},t,r)}))}function NP(e){let t=e?.separator??\",\",r=e?.keyValueSeparator??\"=\";return oe(n=>n.split(t).reduce((o,s)=>{let[a,i]=s.split(r);return a&&i&&N(o,a,i),o},{}))}function UP(e){let t=e?.separator??\",\",r=e?.keyValueSeparator??\"=\";return oe(n=>Object.entries(n).map(([o,s])=>`${o}${r}${s}`).join(t))}function DP(e){let t=e?.separator??\",\";return oe(r=>r===\"\"?[]:r.split(t))}function cI(){return oe(Xc)}function Ih(){return oe(kP)}function Th(){return oe(UA)}function LP(){return gt((e,t)=>Fl(_l(gi(e)),()=>new de({expected:\"a valid Base64 string\"},e,t)))}function $P(){return gt((e,t)=>Ar(MR(e),{onFailure:()=>P(new de({expected:\"a valid Base64 string\"},e,t)),onSuccess:g}))}function BP(){return gt((e,t)=>Ar(nI(e),{onFailure:()=>P(new de({expected:\"a valid Base64Url string\"},e,t)),onSuccess:g}))}function jP(){return gt((e,t)=>Ar(vP(e),{onFailure:()=>P(new de({expected:\"a valid Base64Url string\"},e,t)),onSuccess:g}))}function zP(){return gt((e,t)=>Ar(wy(e),{onFailure:()=>P(new de({expected:\"a valid hexadecimal string\"},e,t)),onSuccess:g}))}function qP(){return gt((e,t)=>Ar(DA(e),{onFailure:()=>P(new de({expected:\"a valid hexadecimal string\"},e,t)),onSuccess:g}))}function HP(){return oe(encodeURIComponent)}function WP(){return gt((e,t)=>{try{return g(globalThis.decodeURIComponent(e))}catch{return P(new de({expected:\"a valid URI component\"},e,t))}})}function JP(){return oe(e=>ZP(Array.from(e.entries())))}var v4=YP(e=>typeof e==\"string\"||typeof Blob<\"u\"&&e instanceof Blob);function KP(){return oe(e=>{let t=new FormData;return typeof e==\"object\"&&e!==null&&v4(e).forEach(([n,o])=>{t.append(n,o)}),t})}function GP(){return oe(e=>ZP(Array.from(e.entries())))}var O4=YP(Ir);function VP(){return oe(e=>typeof e==\"object\"&&e!==null?new URLSearchParams(O4(e)):new URLSearchParams)}function _4(e){if(e===\"\")return[\"\"];let t=e.replace(/\\[(.*?)\\]/g,\".$1\"),r=t.split(\".\"),n=t.startsWith(\".\")?1:0;return r.slice(n).map(o=>Sc(o)?globalThis.Number(o):o)}function ZP(e){let t={},r=new WeakSet,n=new WeakSet;function o(s,a,i){let c=Object.hasOwn(s,a)?s[a]:void 0;if(r.has(c)&&Array.isArray(c)===i)return c;let u=i?[]:{};return r.add(u),N(s,a,u),u}return e.forEach(([s,a])=>{let i=_4(s),c=t;i.forEach((u,f)=>{let p=f===i.length-1;if(Array.isArray(c)&&u===\"\")if(p)c.push(a);else{let d=i[f+1],m=typeof d==\"number\"||d===\"\",x=c.length;c=o(c,x,m)}else if(p){let d=Object.hasOwn(c,u);if(d&&Array.isArray(c[u])&&(r.has(c[u])||n.has(c[u])))c[u].push(a);else if(d){let m=[c[u],a];n.add(m),N(c,u,m)}else N(c,u,a)}else{let d=i[f+1];c=o(c,u,typeof d==\"number\"||d===\"\")}})}),t}function YP(e){return t=>{let r=[];function n(o,s){if(e(s))r.push([o,s]);else if(Array.isArray(s))s.every(e)?s.forEach(i=>{r.push([o,i])}):s.forEach((i,c)=>{n(`${o}[${c}]`,i)});else if(typeof s==\"object\"&&s!==null)for(let[a,i]of Object.entries(s))n(`${o}[${a}]`,i)}for(let[o,s]of Object.entries(t))n(o,s);return r}}var wh=class extends Us{_tag=\"Middleware\";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new wh(this.encode,this.decode)}},Xl=\"~effect/SchemaTransformation/Transformation\",Ce=class extends Us{[Xl]=Xl;_tag=\"Transformation\";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Ce(this.encode,this.decode)}};function R4(e){return A(e,Xl)&&e[Xl]===Xl}var Ch=e=>R4(e)?e:new Ce(e.decode,e.encode);function Vt(e){return new Ce(gt(e.decode),gt(e.encode))}function Pe(e){return new Ce(oe(e.decode),oe(e.encode))}function Ah(e){return new Ce(Ci(e.decode),Ci(e.encode))}function QP(){return new Ce(PP(),jr())}function XP(e){return new Ce(NP(e),UP(e))}var P4=new Ce(jr(),jr());function su(){return P4}var au=new Ce(Eh(),Ai()),kh=new Ce(RP(),Ai()),uI=new Ce(iI(),oe(Wg)),eM=new Ce(iI(),oe(e=>e.getTime()));var fI=Vt({decode:(e,t)=>Ht(fR(e),{onNone:()=>P(new de({expected:\"a valid ByteSize string\"},e,t)),onSome:g}),encode:e=>g(`${e} ${e===BigInt(1)?\"byte\":\"bytes\"}`)}),tM=Vt({decode:(e,t)=>Ht(iE(e),{onNone:()=>P(new de({expected:\"a non-negative bigint byte count\"},e,t)),onSome:g}),encode:e=>g(nh(e))}),rM=Vt({decode:(e,t)=>Ht(iE(e),{onNone:()=>P(new de({expected:\"a non-negative safe-integer byte count\"},e,t)),onSome:g}),encode:(e,t)=>Ht(dR(e),{onNone:()=>P(new de({expected:\"a ByteSize representable as a safe integer\"},e,t)),onSome:g})}),M4=e=>ur(e)&&typeof e.message==\"string\",nM=e=>{let r=Object.hasOwn(e,\"cause\")?new Error(e.message,{cause:sM(e.cause)}):new Error(e.message);return typeof e.name==\"string\"&&e.name!==\"Error\"&&(r.name=e.name),typeof e.stack==\"string\"&&(r.stack=e.stack),r},F4=e=>{try{let t=Pa(e);return t===void 0?F(e):JSON.parse(t)}catch{return F(e)}},N4=(e,t,r)=>{let n={name:e.name,message:typeof e.message==\"string\"?e.message:\"\"};return t?.includeStack&&typeof e.stack==\"string\"&&(n.stack=e.stack),!t?.excludeCause&&e.cause!==void 0&&(n.cause=r(e.cause)),n},oM=e=>{let t=new WeakSet,r=n=>{if(nC(n)){if(t.has(n))return\"[Circular]\";t.add(n);let o=N4(n,e,r);return t.delete(n),o}return F4(n)};return r},sM=e=>M4(e)?nM(e):e,aM=e=>Pe({decode:nM,encode:t=>oM(e)(t)}),iM=e=>Pe({decode:sM,encode:oM(e)});function cM(){return Pe({decode:ny,encode:vd})}function uM(){return Pe({decode:ry,encode:js})}function fM(e){return Pe({decode:Pf,encode:e?.onNoneEncoding===null?vd:js})}function lM(){return Ah({decode:O,encode:Ha})}function pM(){return Ah({decode:e=>e.pipe(Wa(Io),O),encode:Ha})}var lI=Vt({decode:(e,t)=>URL.canParse(e)?g(new URL(e)):P(new de({expected:\"a valid URL string\"},e,t)),encode:e=>g(e.href)});var pI=new Ce(LP(),cI()),dM=new Ce($P(),cI()),mM=new Ce(jP(),Ih()),hM=new Ce(qP(),Th()),xM=new Ce(WP(),HP());function gM(e){return new Ce(MP(e??{}),FP(e))}var yM=new Ce(JP(),KP()),SM=new Ce(GP(),VP());function pa(e){return t=>t._tag===e}var lu=pa(\"Declaration\");var U4=pa(\"Never\");var cu=pa(\"Literal\"),mI=pa(\"UniqueSymbol\");var II=pa(\"Arrays\"),D4=pa(\"Objects\"),kM=pa(\"Union\"),vM=pa(\"Suspend\"),ot=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Jo={},Wo=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,r=void 0,n=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=r,this.annotations=n}},bM=\"~effect/Schema\",ft=class{[bM]=bM;annotations;checks;encoding;context;constructor(t=void 0,r=void 0,n=void 0,o=void 0){this.annotations=t,this.checks=r,this.encoding=n,this.context=o}toString(){return`<${this._tag}>`}},pu=class extends ft{_tag=\"Declaration\";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,r,n,o,s,a,i){super(r,n,o,s),this.typeParameters=e,this.run=t,this.encodingChecks=a,this.encodingRun=i}getParser(){let e;return(t,r)=>t===ge?$r:(e??=this.run(this.typeParameters))(t,this,r)}_rebuild(e,t,r,n,o){let s=vi(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&r===this.encodingChecks&&n===this.run&&o===this.encodingRun?this:new pu(s,n,this.annotations,t,void 0,this.context,r,o)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==\"string\"?e:\"\"}},L4=class extends ft{_tag=\"Null\";getParser(){return Dh(this,null)}getExpected(){return\"null\"}},TI=new L4;var $4=class extends ft{_tag=\"Undefined\";getParser(){return Dh(this,void 0)}toCodecJson(){return qe(this,[OM])}getExpected(){return\"undefined\"}},OM=new ot(TI,new Ce(oe(()=>{}),oe(()=>null))),wI=new $4;var B4=class extends ft{_tag=\"Void\";getParser(){let e=Gt(void 0);return t=>t===ge?$r:e}toCodecJson(){return qe(this,[OM])}getExpected(){return\"void\"}},_M=new B4;var j4=class extends ft{_tag=\"Never\";getParser(){return Xn(this,rC)}getExpected(){return\"never\"}},CI=new j4,z4=class extends ft{_tag=\"Any\";getParser(){return Xn(this,Ug)}getExpected(){return\"any\"}},RM=new z4,q4=class extends ft{_tag=\"Unknown\";getParser(){return Xn(this,Ug)}getExpected(){return\"unknown\"}},Yn=new q4,H4=class extends ft{_tag=\"ObjectKeyword\";getParser(){return Xn(this,Sf)}getExpected(){return\"object | array | function\"}},PM=new H4,MM=class extends ft{_tag=\"Enum\";enums;constructor(e,t,r,n,o){super(t,r,n,o);for(let[,s]of e)if(typeof s==\"number\"&&!globalThis.Number.isFinite(s))throw new Error(`A numeric enum value must be finite, got ${F(s)}`);this.enums=e}getParser(){let e=new Set(this.enums.map(([,t])=>t));return Xn(this,t=>e.has(t))}toCodecStringTree(){if(this.enums.some(([e,t])=>typeof t==\"number\")){let e=Object.fromEntries(this.enums.map(([t,r])=>[globalThis.String(r),r]));return qe(this,[new ot(new zr(Object.keys(e).map(t=>new pn(t))),new Ce(oe(t=>e[t]),Ai()))])}return this}getExpected(){return this.enums.map(([e,t])=>JSON.stringify(t)).join(\" | \")}};function dI(e){return typeof e==\"number\"?`parts[${e}]`:e}function hI(e,t,r){if(r.has(e))return!0;if(e.encoding)throw new Error(`TemplateLiteral parts cannot have an encoding at ${dI(t)}`);let n;switch(e._tag){case\"String\":case\"Number\":case\"BigInt\":n=!0;break;case\"Literal\":n=!e.checks;break;case\"TemplateLiteral\":{let o=dI(t);n=!e.checks&&e.parts.every((s,a)=>hI(s,`${o}.parts[${a}]`,r));break}case\"Union\":{let o=dI(t);n=!e.checks&&e.types.every((s,a)=>hI(s,`${o}.types[${a}]`,r));break}default:return!1}return n&&r.add(e),n}var AI=class extends ft{_tag=\"TemplateLiteral\";parts;encodedParts;literals;suffixLengths;constructor(e,t,r,n,o){super(t,r,n,o);let s=[],a=[],i=new Set;for(let u=0;u=0;u--)c[u]=c[u+1]+(a[u]?.length??0);this.parts=e,this.encodedParts=s,this.literals=a,this.suffixLengths=c}getParser(e){let t=new Rn(!1,this.parts.map(jI),[]),r=e(da(ln,t,NM(this)));return(n,o)=>{if(n===ge)return $r;let s=r(n,o);return s._tag===\"Success\"?ze:Kt(s,{onSuccess:()=>n,onFailure:a=>new Tt(this,[a],n,o)})}}getExpected(){return\"string\"}matchPart(e,t){return aF(this,e,t)===void 0?void 0:e}};function FM(e){let t=Zr(o=>{if(o._tag!==\"Union\")return o;let s=vi(o.types,t);return(o.options?.mode??\"anyOf\")===\"anyOf\"&&s===o.types?o:new zr(s,o.options===void 0?void 0:{...o.options,mode:\"anyOf\"},o.annotations,o.checks,void 0,o.context)}),r=new AI(e.map(o=>t(mn(o)))),n=new Rn(!1,e.map(jI),[]);return da(r,n,NM(r))}function NM(e){return new Ce(gt((t,r)=>{let n=aF(e,t,r);return n?g(n):P(new de({expected:\"a string matching template literal parts\"},t,r))}),oe(t=>t.join(\"\")))}var UM=class extends ft{_tag=\"UniqueSymbol\";symbol;constructor(e,t,r,n,o){super(t,r,n,o),this.symbol=e}getParser(){return Dh(this,this.symbol)}toCodecStringTree(){let e=globalThis.Symbol.keyFor(this.symbol);return qe(this,[new ot(e===void 0?CI:new pn(globalThis.String(this.symbol)),uF.transformation)])}getExpected(){return globalThis.String(this.symbol)}},pn=class extends ft{_tag=\"Literal\";literal;constructor(e,t,r,n,o){if(super(t,r,n,o),typeof e==\"number\"&&!globalThis.Number.isFinite(e))throw new Error(`A numeric literal must be finite, got ${F(e)}`);this.literal=e}getParser(){return Dh(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==\"bigint\"?EM(this):this}toCodecStringTree(){return typeof this.literal==\"string\"?this:EM(this)}getExpected(){return typeof this.literal==\"string\"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function EM(e){let t=globalThis.String(e.literal);return qe(e,[new ot(new pn(t),new Ce(oe(()=>e.literal),oe(()=>t)))])}var W4=class extends ft{_tag=\"String\";getParser(){return Xn(this,Ir)}matchPart(e,t){let r=this.checks;return r&&!t.disableChecks&&eo(r,e,void 0,this,t)?void 0:e}getExpected(){return\"string\"}},ln=new W4,J4=class extends ft{_tag=\"Number\";getParser(){return Xn(this,yf)}matchKey(e,t){return this._match(p6,e,t)}matchPart(e,t){return this._match(SI,e,t)}_match(e,t,r){if(!e.test(t))return;let n=globalThis.Number(t);return r.disableChecks||!this.checks?n:eo(this.checks,n,void 0,this,r)?void 0:n}toCodecJson(){return this.checks&&(xI(this.checks,\"effect/schema/isFinite\")||xI(this.checks,\"effect/schema/isInt\"))?this:qe(this,[s6])}toCodecStringTree(){return this.toCodecJson()===this?qe(this,[d6]):qe(this,[m6])}getExpected(){return\"number\"}};function xI(e,t){return e.some(r=>r.annotations?.representation?.id===t||r._tag===\"FilterGroup\"&&xI(r.checks,t))}var kI=new J4,K4=class extends ft{_tag=\"Boolean\";getParser(){return Xn(this,nd)}getExpected(){return\"boolean\"}},DM=new K4,G4=class extends ft{_tag=\"Symbol\";getParser(){return Xn(this,Ng)}matchKey(e,t){return t.disableChecks||!this.checks?e:eo(this.checks,e,void 0,this,t)?void 0:e}toCodecStringTree(){return qe(this,[uF])}getExpected(){return\"symbol\"}},LM=new G4,V4=class extends ft{_tag=\"BigInt\";getParser(){return Xn(this,eC)}matchPart(e,t){if(!bI.test(e))return;let r=globalThis.BigInt(e);return t.disableChecks||!this.checks?r:eo(this.checks,r,void 0,this,t)?void 0:r}toCodecStringTree(){return qe(this,[x6])}getExpected(){return\"bigint\"}},$M=new V4,Rn=class extends ft{_tag=\"Arrays\";isMutable;elements;rest;encodingChecks;constructor(e,t,r,n,o,s,a,i){super(n,o,s,a),this.isMutable=e,this.elements=t,this.rest=r,this.encodingChecks=i;let c=!1;for(let u=0;u1)throw new Error(\"A required element cannot follow an optional element. ts(1257)\");for(let u=1;u=f?o[p-f+1]:o[0]}let c=f=>{let{input:p,len:d,options:m}=f;if(r.rest.length===0&&d>s)for(let x=s;x{let d=f.length,m={ast:r,getParser:i,input:f,len:d,tailThreshold:Math.max(s,d-a),output:new globalThis.Array(d),issues:void 0,options:p},x=r.rest.length===0?s:Math.max(d,s+a),y=p.concurrency===void 0?1:ul(p.concurrency),S=y===1?Y4(m,f,0,x):Q4(m,f,{concurrency:y,end:x});if(!S)return c(m);if(De(S))return nt(S,()=>c(m));let w=!0;return $(()=>w?(w=!1,I(S,()=>c(m))):u(f,p))};return(f,p)=>{if(f===ge)return $r;try{return Array.isArray(f)?(n||(n=r.elements.map(d=>({ast:d,parser:t(d)})),o=r.rest.map(d=>({ast:d,parser:t(d)}))),u(f,p)):P(new ut(r,f,p))}catch(d){return Rr(d)}}}_rebuild(e,t,r){let n=vi(this.elements,e),o=vi(this.rest,e);return n===this.elements&&o===this.rest&&t===this.checks&&r===this.encodingChecks?this:new Rn(this.isMutable,n,o,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return\"array\"}};function Z4(e,t,r,n){if(r._tag===\"Failure\")return Oh(e,e.ast,n,r);let o=r===ze?t:r[pe];if(o!==ge)e.output[n]=o;else{let s=e.getParser(e.tailThreshold,n);if(Zt(s.ast))return;let a=new ct([n],new fa(s.ast.context?.annotations));if(e.options.errors===\"all\")e.issues?e.issues.push(a):e.issues=[a];else return hs(new Tt(e.ast,[a],e.input,e.options))}}var BM={onItem(e,t,r){let n=r{if(n.cause.reasons.length===0)return n;let o=Yl(n.cause);if(o===void 0)return Ur(ms(n.cause,a=>new Tt(t,[new ct([r],a)],e.input,e.options)));let s=new ct([r],o);if(e.options.errors===\"all\")e.issues?e.issues.push(s):e.issues=[s];else return hs(new Tt(t,[s],e.input,e.options))},Rh=\"[+-]?\\\\d*\\\\.?\\\\d+(?:[Ee][+-]?\\\\d+)?\";function la(e,t,r=Jo){let n,o;function s(a){switch(a._tag){case\"String\":case\"TemplateLiteral\":return(n??=Object.keys(e)).filter(i=>a.matchPart(i,r)!==void 0);case\"Number\":return(n??=Object.keys(e)).filter(i=>a.matchKey(i,r)!==void 0);case\"Symbol\":return(o??=Object.getOwnPropertySymbols(e)).filter(i=>Object.prototype.propertyIsEnumerable.call(e,i)&&a.matchKey(i,r)!==void 0);case\"Union\":return[...new Set(a.types.flatMap(s))];default:return[]}}return s(BI(mn(t)))}var vI=class{name;type;constructor(e,t){this.name=e,this.type=t}};function jM(e){switch(e._tag){case\"String\":case\"Number\":case\"Symbol\":case\"TemplateLiteral\":return!0;case\"Union\":return e.types.every(jM);default:return!1}}function zM(e){let t=mu(e);switch(t._tag){case\"String\":case\"Number\":case\"Symbol\":case\"TemplateLiteral\":return!0;case\"Union\":return t.types.every(zM);default:return!1}}function X4(e){return jM(e)&&zM(e)}var OI=class{parameter;type;constructor(e,t){if(!X4(e))throw new Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Zt(t)&&!sF(t))throw new Error(\"Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.\")}},tp=class extends ft{_tag=\"Objects\";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,r,n,o,s,a){super(r,n,o,s),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=a}getParser(e,t=e){let r=this,n=r.propertySignatures.length,o=r.indexSignatures.length;if(!n&&!o)return Xn(r,sd);let s,a,i=()=>(s||(s=r.propertySignatures.map(p=>({parser:t(p.type),name:p.name,type:p.type})),a=o?r.indexSignatures.map(p=>({is:p,parserKey:e(BI(p.parameter)),parserValue:t(p.type)})):void 0),s),c=()=>{let p=new Set(r.propertySignatures.map(S=>typeof S.name==\"number\"?globalThis.String(S.name):S.name)),d=(S,w,E,M,_)=>{if(_._tag===\"Failure\")return Oh(S,r,w,_)??ht;let h=_===ze?M:_[pe];if(E!==ge&&h!==ge){if(n&&(p.has(w)||p.has(typeof E==\"number\"?globalThis.String(E):E)))return ht;N(S.out,E,h)}return ht},m=(S,w,E,M)=>{if(!M){let T=E.parserKey(w,S.options);if(!De(T))return I(kn(T),C=>m(S,w,E,C));M=T}if(M._tag===\"Failure\")return Oh(S,r,w,M)??ht;let _=M===ze?w:M[pe],h=S.input[w],b=E.parserValue(h,S.options);return De(b)?d(S,w,_,h,b):I(kn(b),T=>d(S,w,_,h,T))},x=(S,w,E)=>{let M=S.input[w],_=E.parserValue(M,S.options);return De(_)?d(S,w,w,M,_):I(kn(_),h=>d(S,w,w,M,h))},y=o?Tm()({onItem:(S,[w,E])=>E.is.parameter===ln?x(S,w,E):m(S,w,E),step:(S,w,E)=>E._tag===\"Failure\"?E:void 0}):void 0;return eE(function*(S,w){if(S===ge)return ge;if(!(typeof S==\"object\"&&S!==null&&!Array.isArray(S)))return yield*P(new ut(r,S,w));i();let E=S,M={},_={ast:r,input:E,out:M,issues:void 0,options:w},h=w.errors===\"all\",b=w.onExcessProperty===\"error\",T=w.concurrency===void 0?1:ul(w.concurrency),C=o&&b?r.indexSignatures.map(L=>la(E,L.parameter,w)):void 0;if(b){let L=C?new Set(p):p;if(C)for(let ye of C)for(let ve of ye)L.add(ve);let Q=Reflect.ownKeys(E);for(let ye=0;ye{let x=s[d];return I(kn(m),y=>{let S=gI(p,x,y);if(S)return S;let w=()=>Gt(p.out),E=IM(p,s.slice(d+1));return E?nt(E,w):w()})};return(p,d)=>{if(p===ge)return $r;if(d.errors===\"all\"||d.onExcessProperty!==void 0||d.concurrency!==void 0&&ul(d.concurrency)!==1)return(u??=c())(p,d);if(!(typeof p==\"object\"&&p!==null&&!Array.isArray(p)))return P(new ut(r,p,d));let m=i(),x=p,y={},S={ast:r,input:x,out:y,issues:void 0,options:d};try{for(let w=0;w{let i=e(a.type);return i===a.type?a:new vI(a.name,i)}),s=vi(this.indexSignatures,a=>{let i=t(a.parameter),c=e(a.type);return i===a.parameter&&c===a.type?a:new OI(i,c)});return o===this.propertySignatures&&s===this.indexSignatures&&r===this.checks&&n===this.encodingChecks?this:new tp(o,s,this.annotations,r,void 0,this.context,n)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?\"object | array\":\"object\"}};function gI(e,t,r){if(r._tag===\"Failure\")return Oh(e,e.ast,t.name,r);if(r===ze)return;let n=r[pe];if(n!==ge){N(e.out,t.name,n);return}if(delete e.out[t.name],!Zt(t.type)){let o=new ct([t.name],new fa(t.type.context?.annotations));if(e.options.errors===\"all\"){e.issues?e.issues.push(o):e.issues=[o];return}else return hs(new Tt(e.ast,[o],e.input,e.options))}}var qM={onItem(e,t){if(!iu(e.input,t.name))return t.parser(ge,e.options);let r=e.input[t.name];return N(e.out,t.name,r),t.parser(r,e.options)},step:gI},IM=Im()(qM),e6=Tm()(qM);function _I(e,t){return e?t?[...e,...t]:e:t}function Ph(e,t,r){return new tp(Reflect.ownKeys(e).map(n=>new vI(n,e[n].ast)),[],r,t)}function rp(e){return e.ast}function RI(e,t=void 0){return new Rn(!1,e.map(r=>r.ast),[],void 0,t)}function Mh(e,t,r){return new zr(e.map(rp),t,void 0,r)}function HM(e,t){if(e.encoding||t.some(s=>s.encoding))throw new Error(\"StructWithRest does not support encodings\");let r=e.propertySignatures,n=e.indexSignatures,o=e.checks;for(let s of t){for(let a of s.propertySignatures)if(r.some(i=>i.name===a.name))throw new Error(`Duplicate identifier: ${JSON.stringify(a.name)}. ts(2300)`);r=r.concat(s.propertySignatures),n=n.concat(s.indexSignatures),o=_I(o,s.checks)}return new tp(r,n,void 0,o)}function WM(e,t){if(e.encoding)throw new Error(\"TupleWithRest does not support encodings\");return new Rn(e.isMutable,e.elements,t,void 0,e.checks)}function JM(e){if(e.encoding)throw new Error(\"mutable does not support encodings\");return new Rn(!0,e.elements,e.rest,e.annotations,e.checks,void 0,e.context,e.encodingChecks)}var PI=va(e=>{for(;;){if(vM(e))return Yn;let t=e.encoding;if(!t)return e.recur?.(PI,R)??e;if(t.some(r=>r.transformation._tag===\"Middleware\"&&r.transformation.decode!==R))return Yn;e=t[t.length-1].to}});function KM(e){switch(e._tag){case\"Null\":return[\"null\"];case\"Undefined\":return[\"undefined\"];case\"String\":case\"TemplateLiteral\":return[\"string\"];case\"Number\":return[\"number\"];case\"Boolean\":return[\"boolean\"];case\"Symbol\":case\"UniqueSymbol\":return[\"symbol\"];case\"BigInt\":return[\"bigint\"];case\"Arrays\":return[\"array\"];case\"ObjectKeyword\":return[\"object\",\"array\",\"function\"];case\"Objects\":return e.propertySignatures.length||e.indexSignatures.length?[\"object\"]:[\"string\",\"number\",\"boolean\",\"symbol\",\"bigint\",\"object\",\"array\",\"function\"];case\"Enum\":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case\"Literal\":return[typeof e.literal];case\"Union\":return Array.from(new Set(e.types.flatMap(KM)));default:return[\"null\",\"undefined\",\"string\",\"number\",\"boolean\",\"symbol\",\"bigint\",\"object\",\"array\",\"function\"]}}function uu(e){switch(e._tag){default:return[];case\"Declaration\":{let t=e.annotations?.[ql];return Array.isArray(t)?t:[]}case\"Objects\":return e.propertySignatures.flatMap(t=>{let r=t.type;if(!Zt(r)){if(cu(r))return[{key:t.name,literal:r.literal}];if(mI(r))return[{key:t.name,literal:r.symbol}]}return[]});case\"Arrays\":return e.elements.flatMap((t,r)=>{if(!Zt(t)){if(cu(t))return[{key:r,literal:t.literal}];if(mI(t))return[{key:r,literal:t.symbol}]}return[]});case\"Union\":{if(e.types.length===0)return[];let t=e.types.map(r=>uu(PI(r)));return t[0].filter(r=>t.every(n=>n.some(o=>o.key===r.key&&o.literal===r.literal)))}case\"Suspend\":return uu(e.thunk())}}var TM=new WeakMap,vh=Object.freeze([]),wM=e=>e===null?\"null\":Array.isArray(e)?\"array\":typeof e,iu=(e,t)=>t===\"__proto__\"?Object.hasOwn(e,t):t in e;function np(e){let t=TM.get(e);if(t)return t;let r,n=0,o,s,a=!0,i=[];for(let f=0;fc[f]??=Object.freeze(o?.[f]??vh);if(a&&s)s.forEach(Object.freeze),t=f=>s.get(f)??vh;else if(r?.size===1&&!o){let[f,[p]]=r.entries().next().value,d=new Map;for(let[x,y]of p)d.set(x,Object.freeze(Array.from(y)));let m=Object.freeze(e.map((x,y)=>y));t=(x,y)=>{if(Sf(x)){let S=iu(x,f)?x[f]:void 0;if(S!==void 0)return d.get(S)??vh;if(y)return m}return vh}}else if(r){let f;for(let p of r)(!f||p[1][0].size>f[1][0].size)&&p[1][1].size===n&&(f=p);t=(p,d)=>{let m=wM(p);if(!Sf(p))return u(m);let x=new Set(o?.[m]),y;if(f){let[S,[w]]=f,E=iu(p,S),M=E?p[S]:void 0;if(E&&(!d||M!==void 0)){let _=w.get(M);if(!_)return u(m);for(let h of _)x.add(h);y=S}}if(y===void 0)for(let[S,[w,E]]of r){let M=iu(p,S),_=M?p[S]:void 0;if(M&&(!d||_!==void 0)){let h=w.get(_);if(h)for(let b of h)x.add(b)}else if(d)for(let h of E)x.add(h)}for(let[S,[w,E]]of r){if(S===y)continue;let M=iu(p,S),_=M?p[S]:void 0;if(M&&(!d||_!==void 0)){let h=w.get(_);for(let b of x)E.has(b)&&!h?.has(b)&&x.delete(b)}}return Array.from(x).sort((S,w)=>S-w)}}else t=f=>{let p=u(wM(f));return s?p.filter(d=>i[d]===void 0||i[d]===f):p};return TM.set(e,t),t}var zr=class extends ft{_tag=\"Union\";types;options;encodingChecks;constructor(e,t,r,n,o,s,a){super(r,n,o,s),this.types=e,this.options=t,this.encodingChecks=a}getParser(e,t){let r=this,n=t!==void 0,o=[],s=i=>o[i]??=e(r.types[i]),a;return(i,c)=>{if(i===ge)return $r;let u=(a??=np(r.types))(i,n);if(u.length===0)return P(new Zl(r,[],i,c));if(u.length===1){let f=s(u[0])(i,c);return f._tag===\"Success\"?f:De(f)?GM(r,f.cause,i,c):t6(r,f,i,c)}return r6(r,s,u,i,c)}}_rebuild(e,t,r){let n=vi(this.types,e);return n===this.types&&t===this.checks&&r===this.encodingChecks?this:new zr(n,this.options,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let r of this.types){let n=r.matchPart(e,t);if(n!==void 0)return n}}getExpected(e){let t=this.annotations?.expected;if(typeof t==\"string\")return t;if(this.types.length===0)return\"never\";let r=this.types.map(n=>{let o=mn(n);switch(o._tag){case\"Arrays\":{let s=o.elements.filter(cu);if(s.length>0)return`${CM(o.isMutable)}[ ${s.map(a=>e(a)+AM(a.context?.isOptional)).join(\", \")}, ... ]`;break}case\"Objects\":{let s=o.propertySignatures.filter(a=>cu(a.type));if(s.length>0)return`{ ${s.map(a=>`${CM(a.type.context?.isMutable)}${wo(a.name)}${AM(a.type.context?.isOptional)}: ${e(a.type)}`).join(\", \")}, ... }`;break}}return e(o)});return Array.from(new Set(r)).join(\" | \")}};function GM(e,t,r,n){let o=Yl(t);return o?hs(new Zl(e,[o],r,n)):Ur(t)}function t6(e,t,r,n){return xt(t,o=>GM(e,o,r,n))}function r6(e,t,r,n,o){let s={ast:e,parser:t,input:n,out:void 0,successes:e.options?.mode===\"oneOf\"?[]:void 0,issues:void 0,options:o},a=o6(s,r);return a?n6(a,s):s.out?s.out:P(new Zl(e,s.issues??[],n,o))}function n6(e,t){return nt(e,r=>t.out===ze?g(t.input):t.out?t.out:P(new Zl(t.ast,t.issues??[],t.input,t.options)))}var o6=Im()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,r){if(r._tag===\"Failure\"){let n=Yl(r.cause);if(n===void 0)return r;e.issues?e.issues.push(n):e.issues=[n]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),hs(new SP(e.ast,e.successes,e.input,e.options));if(e.out=r,e.successes)e.successes.push(e.ast.types[t]);else return ht}}}),VM=new zr([new pn(\"Infinity\"),new pn(\"-Infinity\"),new pn(\"NaN\")]);function CM(e){return e?\"\":\"readonly \"}function AM(e){return e?\"?\":\"\"}var MI=class extends ft{_tag=\"Suspend\";thunk;constructor(e,t,r,n,o){if(r)throw new Error(\"Cannot add checks to Suspend\");super(t,void 0,n,o);let s;this.thunk=()=>s??=e()}getParser(e){let t;return(r,n)=>(t??=e(this.thunk()))(r,n)}recur(e){return new MI(()=>e(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(e){return e(this.thunk())}},_h=class extends Us{_tag=\"Filter\";run;annotations;aborted;constructor(e,t=void 0,r=!1){super(),this.run=e,this.annotations=t,this.aborted=r}annotate(e){return new _h(this.run,{...this.annotations,...e},this.aborted)}abort(){return new _h(this.run,this.annotations,!0)}and(e,t){return new ki([this,e],t)}},ki=class extends Us{_tag=\"FilterGroup\";checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new ki(this.checks,{...this.annotations,...e})}and(e,t){return new ki([this,e],t)}};function Fh(e,t,r=!1){return new _h((n,o,s)=>EP(o,e(n,o,s),n,s),t,r)}function Nh(e,t){return new _h((r,n,o)=>e(r)?void 0:new de(void 0,r,o),t,!0)}function FI(e){return Fh(t=>globalThis.Number.isFinite(t),{expected:\"a finite number\",representation:{id:\"effect/schema/isFinite\",payload:null},toJsonSchema:()=>({type:\"number\"}),toCode:()=>({runtime:\"Schema.isFinite()\"}),arbitraryConstraint:{number:\"finite\"},...e})}var NI=Ko(kI,[FI()]),s6=new ot(new zr([NI,VM]),new Ce(Eh(),oe(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function op(e,t){let r=new globalThis.RegExp(e),n={source:r.source,flags:r.flags};return Fh(o=>(r.lastIndex=0,r.test(o)),{expected:`a string matching the RegExp ${n.source}`,representation:{id:\"effect/schema/isPattern\",payload:n},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[n]},...t})}var yI=new WeakMap;function sp(e,t){let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(n=>n===\"context\"||n===\"encoding\")&&yI.set(r,du(e)),r}function du(e){let t=yI.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return yI.set(e,r),r}function qe(e,t){return e.encoding===t?e:sp(e,{encoding:t})}function Oi(e,t){if(e.context===t)return e;let r=du(e);return r.context===t&&r.encoding===e.encoding?r:sp(e,{context:t})}function mu(e){return e.encoding?mu(e.encoding[e.encoding.length-1].to):e}function Qn(e,t){if(e.checks){let r=e.checks[e.checks.length-1];return ZM(e,Ud(e.checks.slice(0,-1),r.annotate(t)))}return sp(e,{annotations:{...e.annotations,...t}})}function ZM(e,t){if(e._tag===\"Suspend\"&&t)throw new Error(\"Cannot add checks to Suspend\");return e.checks===t?e:sp(e,{checks:t})}function Ko(e,t){return ZM(e,_I(e.checks,t))}function hu(e,t){let r=t(e.to);return r===e.to?e:new ot(r,e.transformation)}function UI(e,t){let r=e,n=r[r.length-1],o=hu(n,t);return o===n?e:Ud(e.slice(0,e.length-1),o)}function DI(e){return t=>t.encoding?qe(t,UI(t.encoding,e)):t}function Uh(e,t){return DI(r=>Oi(r,t))(e)}function YM(e){function t(r){return r.encoding?qe(r,UI(r.encoding,t)):e(r)}return Zr(t)}function _i(e,t){function r(n){if(n.encoding){let o=n.encoding[n.encoding.length-1];return t?.stopAt?.(o)?n:qe(n,UI(n.encoding,r))}return e(n)}return va(r)}function QM(e,t){return LI(e,t,yt(e))}function XM(e,t){return LI(mn(e),t,e)}function LI(e,t,r){let n=new ot(e,t);return qe(r,r.encoding?[...r.encoding,n]:[n])}function vi(e,t){let r;for(let n=0;n{let t=e.context?e.context.isOptional===!1?new Wo(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Wo(!0,!1);return a6(Oi(e,t))}),a6=DI(Ri),eF=Zr(e=>Ri(new zr([e,wI]))),$I=va(e=>{let t=e.context?e.context.isMutable===!1?new Wo(e.context.isOptional,!0,e.context.constructorDefault,e.context.annotations):e.context:new Wo(!1,!0);return i6(Oi(e,t))}),i6=DI($I);function tF(e,t){let r=e.context?new Wo(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new Wo(!1,!1,t);return Oi(e,r)}function da(e,t,r){return LI(e,r,t)}function c6(e){let t=[],r=[];function n(o){switch(o._tag){case\"Literal\":od(o.literal)&&!t.includes(o.literal)&&t.push(o.literal);return;case\"UniqueSymbol\":t.includes(o.symbol)||t.push(o.symbol);return;case\"Never\":return;case\"Union\":for(let s=0;snew vI(o,t)),n.map(o=>new OI(o,t)))}function Zt(e){return e.context?.isOptional??!1}function nF(e){return e.context?.isMutable??!1}function oF(e){return e.annotations?.[Lr]===!0||e._tag===\"FilterGroup\"&&e.checks.every(oF)}function u6(e){function t(n){return oF(n)?[n]:n._tag===\"FilterGroup\"?n.checks.flatMap(t):[]}let r=e.flatMap(t);return rr(r)?r:void 0}function f6(e){let t=!0;function r(n){return t=t&&!n.encoding&&!vM(n),t&&\"recur\"in n&&n.recur(r),n}return\"recur\"in e&&e.recur(r),t}var yt=va(e=>{let t=du(e);if(t!==e){let n=yt(t);return n===t&&e.encoding===void 0?e:Oi(n,e.context)}let r=\"recur\"in e?e.recur(yt):e;if(\"encodingChecks\"in r&&r.encodingChecks){let n=f6(e)?r.encodingChecks:II(r)||D4(r)||lu(r)&&r.typeParameters.length>0?u6(r.encodingChecks):void 0;return sp(r,{encodingChecks:void 0,checks:_I(r.checks,n)})}return r}),mn=va(e=>yt(dn(e)));function l6(e,t){let r=t,n=r.length,o=r[n-1],s=[new ot(dn(qe(e,void 0)),r[0].transformation.flip())];for(let i=1;i{if(e.encoding)return l6(e,e.encoding);let t=du(e);if(t!==e){let r=dn(t);return r===t?e:Oi(r,e.context)}return\"flip\"in e?e.flip(dn):\"recur\"in e?e.recur(dn):e});function sF(e){switch(e._tag){case\"Undefined\":return!0;case\"Union\":return e.types.some(sF);default:return!1}}function Dh(e,t){let r=t===0?ze:Gt(t);return(n,o)=>n===ge?$r:n===t?r:P(new ut(e,n,o))}function Xn(e,t){return(r,n)=>r===ge?$r:t(r)?ze:P(new ut(e,r,n))}function aF(e,t,r){let n=e.encodedParts,o=e.literals,s=t.length;for(let u=0;us)return;let a=new Array(n.length),i;function c(u,f){if(u===n.length)return f===s;if(i?.has(u*(s+1)+f))return!1;let p=n[u];if(u===n.length-1){let d=t.slice(f);if(p.matchPart(d,r)!==void 0)return a[u]=d,!0}else if(p._tag===\"Literal\"){let d=o[u];if(t.startsWith(d,f)&&c(u+1,f+d.length))return a[u]=d,!0}else{let d=s-e.suffixLengths[u+1],m=o[u+1],x=m===void 0?d:t.lastIndexOf(m,d);for(;x>=f;){let y=t.slice(f,x);if(p.matchPart(y,r)!==void 0&&c(u+1,x))return a[u]=y,!0;if(x===0)break;x=m===void 0?x-1:t.lastIndexOf(m,x-1)}}return i??=new Set,i.add(u*(s+1)+f),!1}return c(0,0)?a:void 0}var BI=_i(e=>{switch(e._tag){default:return e;case\"Number\":return e.toCodecStringTree();case\"Union\":return e.recur(BI)}}),Lh=_i(e=>{switch(e._tag){default:return e;case\"Symbol\":case\"UniqueSymbol\":return e.toCodecStringTree();case\"Union\":return e.recur(Lh)}}),jI=_i(e=>{switch(e._tag){default:return e;case\"Number\":case\"Literal\":case\"BigInt\":return e.toCodecStringTree();case\"Union\":return e.recur(jI)}}),iF=\"[\\\\s\\\\S]*?\",SI=new globalThis.RegExp(`^${Rh}$`),p6=new globalThis.RegExp(`^(?:${Rh}|Infinity|-Infinity|NaN)$`);function zI(e){return op(SI,{expected:\"a string representing a finite number\",representation:{id:\"effect/schema/isStringFinite\",payload:null},toJsonSchema:()=>({pattern:SI.source}),...e})}var cF=Ko(ln,[zI()]),d6=new ot(cF,au),m6=new ot(new zr([cF,VM]),au),h6=\"-?\\\\d+\",bI=new globalThis.RegExp(`^${h6}$`);function qI(e){return op(bI,{expected:\"a string representing a bigint\",representation:{id:\"effect/schema/isStringBigInt\",payload:null},toJsonSchema:()=>({pattern:bI.source}),...e})}var HI=Ko(ln,[qI({expected:\"a string representing a bigint\"})]),x6=new ot(HI,kh),g6=\"Symbol\\\\(([\\\\s\\\\S]*)\\\\)\",EI=new globalThis.RegExp(`^${g6}$`),y6=Ko(ln,[WI()]),uF=new ot(y6,new Ce(oe(e=>globalThis.Symbol.for(EI.exec(e)[1])),gt((e,t)=>globalThis.Symbol.keyFor(e)!==void 0?g(globalThis.String(e)):P(new Vl({message:\"cannot serialize to string, Symbol is not registered\"},e,t)))));function WI(e){return op(EI,{expected:\"a string representing a symbol\",representation:{id:\"effect/schema/isStringSymbol\",payload:null},toJsonSchema:()=>({pattern:EI.source}),...e})}function eo(e,t,r,n,o){for(let s=0;s0;){let o=n[n.length-1],s=o.keys;if(typeof s==\"number\"){if(o.index(e,t,r)=>xu(e)?ze:P(new ut(t,e,r)),{representation:{id:\"effect/schema/Json\",payload:null},expected:\"JSON value\",toCodecJson:()=>{},toCodecStringTree:()=>KI}),dF=Qn(fu,{representation:{id:\"effect/schema/MutableJson\",payload:null}}),JI=new ot(fu,su()),mF=new ot(new zr([new Rn(!1,[],[fu]),new tp([],[new OI(ln,fu)])]),su());function E6(e){return pF(e,b6)}var I6=new pu([],()=>(e,t,r)=>E6(e)?ze:P(new ut(t,e,r)),{expected:\"StringTree\",toCodecStringTree:()=>{}}),KI=new ot(I6,su());var $h=(e,t,r)=>e===ze?r(t):nt(e,r);function xF(e){if(e._tag===\"Middleware\")return(r,n,o)=>{let s=r===ze?e.decode(Gt(Wl(n)),o):e.decode(Dr(r,Wl),o);return hF(s)};let t=e.decode;switch(t._tag){case\"Passthrough\":return(r,n)=>r===ze?Gt(n):r;case\"Transform\":{let r=n=>n===ge?$r:Gt(t.transform(n));return(n,o)=>$h(n,o,r)}case\"TransformOptional\":{let r=n=>YE(t.transform(Wl(n)));return(n,o)=>$h(n,o,r)}case\"TransformEffect\":return(r,n,o)=>$h(r,n,s=>s===ge?$r:t.transform(s,o));case\"TransformOptionalEffect\":return(r,n,o)=>$h(r,n,s=>hF(t.transform(Wl(s),o)))}}var hF=e=>nt(e,YE),gF=(e,t,r,n)=>xt(n,o=>Ss(()=>ms(o,s=>new yP(e,s,t,r))));function T6(e,t){let r=xF(e.link.transformation),n;return(o,s)=>{if(o===ge)return $r;if(e.isConstructed(o))return ze;let a=(n??=t(e.link.to))(o,s);return r(a,o,s)}}function w6(e,t){let r=e.context.constructorDefault;return(n,o)=>{if(n!==ge&&n!==void 0)return t(n,o);let s=r;if(De(s)&&s._tag===\"Success\"){let a=t(s[pe],o);return a===ze?s:a}return nt(gF(e,n,o,s),a=>{let i=t(a,o);return i===ze?Gt(a):i})}}function GI(e,t){let r=t(e);return e.context?.constructorDefault===void 0?r:w6(e,r)}function ip(e,t,r,n,o){if(e._tag===\"Declaration\")for(let x of e.typeParameters)t(x);let s=r?lF(e):void 0,a=s?T6(s,t):n??e.getParser(t,r),i=e.checks,c=e.encoding,u=c?.map(x=>xF(x.transformation)),f=e.encodingChecks;if(!c&&!i&&!f)return a;let p,d=(x,y)=>{let S=a(x,y);if(f&&!y.disableChecks)if(De(S)){if(S._tag===\"Success\"){let w=S===ze?x:S[pe];if(x!==ge&&w!==ge){let E=eo(f,x,void 0,e,y);E&&(S=P(new Tt(e,E,x,y)))}}}else S=I(S,w=>{if(x!==ge&&w!==ge){let E=eo(f,x,void 0,e,y);if(E)return P(new Tt(e,E,x,y))}return g(w)});if(i&&!y.disableChecks)if(De(S)){if(S._tag===\"Success\"){let w=S===ze?x:S[pe];if(w===ge)return S;let E=eo(i,w,void 0,e,y);E&&(S=P(new Tt(e,E,w,y)))}}else S=I(S,w=>{if(w!==ge){let E=eo(i,w,void 0,e,y);if(E)return P(new Tt(e,E,w,y))}return g(w)});return S},m=o===void 0?d:o(d);return c?(x,y)=>{let S=p??=c.map(M=>t(M.to)),w=x,E=S[S.length-1](x,y);for(let M=c.length-1;M>=0;M--)if(E=u[M](E,w,y),M!==0){let _=S[M-1];E._tag===\"Success\"?(w=E[pe],E=_(w,y)):E=nt(E,h=>{let b=_(h,y);return b===ze?Gt(h):b})}if(E._tag===\"Success\"){let M=E[pe],_=m(M,y);return _===ze?E:_}return E=gF(e,x,y,E),nt(E,M=>{let _=m(M,y);return _===ze?Gt(M):_})}:m}var zh=Symbol(),yF=new WeakMap,SF,gu=!1;var A6=e=>gu?jh(xn,e,\"parser\"):xn(e).parser,bF=e=>gu?jh(xn,e,\"makeEffect\"):xn(e).makeEffect,k6=e=>GI(e,bF),Bh=class{ast;constructor(t){this.ast=t}get decodeEffect(){return this.cachedDecodeEffect??=ip(this.ast,A6)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=ip(this.ast,bF,k6)}},VI=class extends Bh{compiled;resolve;constructor(t,r,n){super(t),this.compiled=r,this.resolve=n}save(t,r){return Object.defineProperty(this,t,{value:r}),r}operation(t){let r=this.compiled;return typeof r==\"function\"?r(this.ast,this.resolve,t):r?.[t]}get is(){return this.save(\"is\",this.operation(\"is\"))}get decode(){return this.save(\"decode\",this.operation(\"decode\"))}get make(){return this.save(\"make\",this.operation(\"make\"))}get decodeEffect(){return this.save(\"decodeEffect\",this.operation(\"decodeEffect\")??ip(this.ast,t=>jh(this.resolve,t,\"parser\")))}get parser(){let t=this.decode;return t===void 0?this.decodeEffect:this.save(\"parser\",v6(t,()=>this.decodeEffect))}get makeEffect(){let t=this.operation(\"makeEffect\");if(t!==void 0)return this.save(\"makeEffect\",t);let r=n=>jh(this.resolve,n,\"makeEffect\");return this.save(\"makeEffect\",ip(this.ast,r,n=>GI(n,r)))}};function v6(e,t){let r;return(n,o)=>{if(n!==ge)try{let s=e(n,o);if(s!==zh)return s===n?ze:Gt(s)}catch(s){return Rr(s)}return(r??=t())(n,o)}}function jh(e,t,r){let n=e(t);if(n.compiled===void 0||Object.hasOwn(n,r))return n[r];let o;return(s,a)=>(o??=n[r])(s,a)}function xn(e){let t=yF.get(e);if(t!==void 0)return t;let r=SF===void 0?new Bh(e):new VI(e,SF(e,xn),xn);return yF.set(e,r),r}function YI(e){let t=e.ast,r;return(n,o)=>(r??=oT(D6,yt(t)))(n,o?.disableChecks?o?.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions)}function Hh(e){let t=YI(e);return(r,n)=>{let o=qo(t(r,n));return Ke(o)?O(o.value):(fn(o.cause,\"Option adapter can only return none for schema issues\"),v())}}function Wh(e){return N6(yt(e.ast))}function QI(e){return Pi(e.ast)}function _6(e){if(!gu){let o=yu(Gh(e));return s=>{let a=o(s,Jo);return Ke(a)?!0:(fn(a.cause,\"Type guard adapter can only return false for schema issues\"),!1)}}let t=xn(e),r=t.is;if(r!==void 0)return o=>{try{return r(o,Jo)}catch(s){return fn(oi(s),\"Type guard adapter can only return false for schema issues\"),!1}};let n=t.parser;return o=>{let s=qo(nT(n(o,Jo),o));return Ke(s)?!0:(fn(s.cause,\"Type guard adapter can only return false for schema issues\"),!1)}}function Pi(e){let t=yt(e),r=n=>(r=_6(t),r(n));return n=>r(n)}function EF(e){let t=Gh(e);return(r,n)=>{let o=qo(t(r,n));if(!Ke(o))return fn(o.cause,\"Issue adapter can only return schema issues\")}}function IF(e,t){let r=yt(e.ast),n=xn(r).parser(t,Jo),o=qo(nT(n,t));if(xs(o)){let s=fn(o.cause,\"Assertion adapter can only throw schema issues\");throw new Error(\"Schema validation failed\",{cause:s})}}function et(e,t){let r=Gh(e.ast);return t===void 0?r:(n,o)=>r(n,rT(t,o))}var XI=et;function TF(e,t){return yu(et(e,t))}function eT(e,t){return _F(et(e,t))}var wF=eT;function CF(e,t){return RF(et(e,t))}function R6(e,t){return gu?PF(e.ast,t):sT(et(e,t))}var Jh=R6;function Mi(e,t){let r=Gh(dn(e.ast));return t===void 0?r:(n,o)=>r(n,rT(t,o))}var AF=Mi;function kF(e,t){return yu(Mi(e,t))}function tT(e,t){return _F(Mi(e,t))}var vF=tT;function OF(e,t){return RF(Mi(e,t))}function P6(e,t){return gu?PF(dn(e.ast),t):sT(Mi(e,t))}var Kh=P6,rT=(e,t)=>t?{...e,...t}:e,qh=e=>e===ge?P(new de):g(e);function Gh(e){return oT(U6,e)}function nT(e,t){return e===ze?g(t):De(e)?e[pe]===ge?qh(ge):e:nt(e,qh)}function oT(e,t){let r;return(n,o)=>{let s=(r??=e(t))(n,o??Jo);return s===ze?g(n):De(s)?s[pe]===ge?qh(ge):s:nt(s,qh)}}function yu(e){return(t,r)=>qo(e(t,r))}function _F(e){let t=yu(e);return(r,n)=>{let o=t(r,n);return Ke(o)?O(o.value):(fn(o.cause,\"Option adapter can only return none for schema issues\"),v())}}function RF(e){let t=yu(e);return(r,n)=>{let o=t(r,n);return Ke(o)?B(o.value):K(fn(o.cause,\"Result adapter can only return schema issues\"))}}function PF(e,t){let r;return(n,o)=>(r??=M6(xn(e),t))(n,o)}function M6(e,t){let r=e.decode,n,o=r===void 0?(s,a=Jo)=>(n??=ZI(e))(s,a):(s,a=Jo)=>{if(s===ge)return(n??=ZI(e))(s,a);let i;try{i=r(s,a)}catch(c){throw fn(oi(c),\"Sync adapter can only throw schema issues\"),c}return i!==zh?i:(n??=ZI(e))(s,a)};return t===void 0?o:(s,a)=>o(s,rT(t,a))}function ZI(e){return sT(oT(()=>e.decodeEffect,e.ast))}function sT(e){let t=yu(e);return(r,n)=>{let o=t(r,n);if(Ke(o))return o.value;let s=fn(o.cause,\"Sync adapter can only throw schema issues\");throw new Error(\"Schema validation failed\",{cause:s})}}function F6(e,t){let r=qo(e);if(Ke(r))return r.value;let n=fn(r.cause,t);throw new Error(\"Schema validation failed\",{cause:n})}function N6(e){let t,r;return(n,o)=>{t??=xn(e);let s=o?.disableChecks?o.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions??Jo,a=t.make;if(a!==void 0&&n!==ge){let c;try{c=a(n,s)}catch(u){throw fn(oi(u),\"Constructor adapter can only throw schema issues\"),u}if(c!==zh&&c!==ge)return c}let i=(r??=t.makeEffect)(n,s);return F6(nT(i,n),\"Constructor adapter can only throw schema issues\")}}var U6=e=>xn(e).parser,D6=e=>xn(e).makeEffect;var Vh=\"~effect/Schema/Schema\",MF=Symbol(),L6={[Vh]:Vh,get make(){let e=Wh(this);return Object.defineProperty(this,\"make\",{value:e,enumerable:!0}),e},get makeEffect(){let e=YI(this);return Object.defineProperty(this,\"makeEffect\",{value:e,enumerable:!0}),e},get makeOption(){let e=Hh(this);return Object.defineProperty(this,\"makeOption\",{value:e,enumerable:!0}),e},pipe(){return Z(this,arguments)},annotate(e){return this.rebuild(Qn(this.ast,e))},annotateKey(e){return this.rebuild(ap(this.ast,e))},check(...e){return this.rebuild(Ko(this.ast,e))},rebuild(e){return to(e,this[MF])}};function to(e,t){function r(){}let n=Object.setPrototypeOf(r,L6);return t&&(Object.hasOwn(t,\"name\")||Object.hasOwn(t,\"length\")||Object.hasOwn(t,\"__proto__\"))?Object.defineProperties(n,Object.getOwnPropertyDescriptors({...t})):Object.assign(n,t),n[MF]=t,n.ast=e,n}function aT(e){return e.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}function cp(e){return e.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}function iT(e){return encodeURI(aT(e)).replace(/#/g,\"%23\")}function cT(e){if(e.length===0||e===\"#\")return\"\";if(!e.startsWith(\"#\"))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,\"%\").replace(/#/g,\"%23\")!==t)return;let r=decodeURIComponent(t);return r.startsWith(\"/\")&&!/~(?:[^01]|$)/.test(r)?r:void 0}catch{return}}function NF(e){let t=cT(e);return t===void 0?void 0:t.length===0?[]:t.slice(1).split(\"/\").map(cp)}function UF(e){return e.reduce((t,r)=>`${t}/${iT(r)}`,\"#\")}var B6=\"http://json-schema.org/draft-07/schema#\",DF=\"https://json-schema.org/draft/2020-12/schema\";function LF(e,t){return e===t||e===(t.endsWith(\"#\")?t.slice(0,-1):`${t}#`)}function jF(e){return{dialect:\"draft-07\",...W6(e,tG)}}function j6(e,t){return r(e,!1,!0);function r(n,o,s=!1){if(!ur(n))return n;let a=o||!s&&HF(n.$id),i={};for(let c of Object.keys(n)){let u=n[c],f=u;switch(c){case\"$defs\":case\"properties\":case\"patternProperties\":case\"dependentSchemas\":f=fT(u,p=>r(p,a))??u;break;case\"allOf\":case\"anyOf\":case\"oneOf\":case\"prefixItems\":f=Array.isArray(u)?u.map(p=>r(p,a)):u;break;case\"not\":case\"additionalProperties\":case\"propertyNames\":case\"unevaluatedProperties\":case\"items\":case\"contains\":case\"unevaluatedItems\":case\"if\":case\"then\":case\"else\":case\"contentSchema\":f=r(u,a)}N(i,c,f)}return t(i,a),i}}function zF(e,t){return j6(e,r=>{z6(r,t)})}function z6(e,t){typeof e.$ref==\"string\"&&N(e,\"$ref\",t(e.$ref,\"$ref\")),typeof e.$dynamicRef==\"string\"&&N(e,\"$dynamicRef\",t(e.$dynamicRef,\"$dynamicRef\"))}function fT(e,t){if(!ur(e))return;let r={};for(let n of Object.keys(e))N(r,n,t(e[n],n));return r}function q6(e,t,r){let n=new Map,o=[],s=uT;function a(d,m=[],x=[]){if(m.length===0&&t?.trackIds){let y=ur(d)?f(d):void 0;s=$F(y,uT)??uT}return u(d,m,x,{sourceRoot:[],targetRoot:[],uri:s})}function i(){for(let[d,m,x]of o){let y=m,S=qF(m,x);if(S!==void 0){let w=NF(S.hash);if(S.hash=\"\",w!==void 0){let E=n.get(BF(S.href,w));E!==void 0&&(y=H6(m,E))}}N(d,\"$ref\",y)}}let c=r(a);return i(),c;function u(d,m,x,y){if(typeof d==\"boolean\")return p(m,x,y),t?.booleanAdapter?.(d)??d;if(!ur(d))return d;let S=y,w=f(d);if(m.length>0&&t?.trackIds&&HF(w)){let _=$F(w,y.uri);_!==void 0&&(S={parent:y,sourceRoot:m,targetRoot:x,uri:_})}p(m,x,S);let E=S.uri,M={isDocumentRoot:m.length===0,schema(_,h,b=h){return u(_,[...m,h],[...x,b],S)},schemaAt(_,h,b){return u(_,[...m,...h],[...x,...b],S)},schemaArray(_,h,b=h){return Array.isArray(_)?_.map((T,C)=>u(T,[...m,h,String(C)],[...x,b,String(C)],S)):_},schemaMap(_,h,b=h){return ur(_)?fT(_,(T,C)=>u(T,[...m,h,C],[...x,b,C],S)):_},reference(_,h){typeof h==\"string\"?o.push([_,h,E]):N(_,\"$ref\",h)}};return e(d,M)}function f(d){return t?.ignoreRefSiblings===!0&&typeof d.$ref==\"string\"?void 0:d.$id}function p(d,m,x){x.parent!==void 0&&p(d,m,x.parent),n.set(BF(x.uri,d.slice(x.sourceRoot.length)),m.slice(x.targetRoot.length))}}var uT=\"https://effect.invalid/.json-schema/\";function qF(e,t){return URL.canParse(e,t)?new URL(e,t):void 0}function $F(e,t){if(typeof e!=\"string\")return;let r=qF(e,t);if(r!==void 0)return r.hash=\"\",r.href}function H6(e,t){let r=e.indexOf(\"#\");return r===-1&&t.length===0?e:`${r===-1?e:e.slice(0,r)}${UF(t)}`}function BF(e,t){return`${e}\\0${JSON.stringify(t)}`}function HF(e){return typeof e==\"string\"&&e.length>0&&e[0]!==\"#\"}function W6(e,t,r){return q6(t,{...r,trackIds:!0},n=>({schema:n(e.schema),definitions:fT(e.definitions,(o,s)=>n(o,[\"$defs\",s],[\"definitions\",s]))}))}var J6=new Set([\"properties\",\"patternProperties\"]),K6=new Set([\"allOf\",\"anyOf\",\"oneOf\"]),G6=new Set([\"not\",\"additionalProperties\",\"propertyNames\",\"contains\",\"if\",\"then\",\"else\",\"contentSchema\"]);function V6(e,t,r,n,o,s=J6){let a;if(s.has(t))a=n.schemaMap(r,t);else if(K6.has(t))a=n.schemaArray(r,t);else if(o.has(t))a=n.schema(r,t);else return!1;return N(e,t,a),!0}var WF=[\"$anchor\",\"$defs\",\"$dynamicAnchor\",\"$dynamicRef\",\"$vocabulary\",\"contentSchema\",\"dependentRequired\",\"dependentSchemas\",\"maxContains\",\"minContains\",\"prefixItems\",\"unevaluatedItems\",\"unevaluatedProperties\"],mie=[...WF,\"deprecated\"],hie=[...WF,\"$comment\",\"$id\",\"$schema\",\"const\",\"contains\",\"contentEncoding\",\"contentMediaType\",\"else\",\"examples\",\"if\",\"patternProperties\",\"propertyNames\",\"then\"],Z6=/^[A-Za-z_][-A-Za-z0-9._]*$/,Y6=/^[A-Za-z][-A-Za-z0-9._:]*$/;function Fi(e,t,r){throw new Error(`Cannot convert JSON Schema keyword \"${e}\" to ${t}: ${r}`)}function Q6(e,t,r,n){for(let o of t)Object.hasOwn(e,o)&&Fi(o,r,`it is not active in ${n} but would become active in the target`)}var X6=[\"additionalItems\",\"definitions\",\"dependencies\"];function eG(e,t,r,n,o){r.isDocumentRoot?N(e,\"$schema\",LF(t,DF)?n:t):LF(t,DF)||Fi(\"$schema\",o,\"an embedded resource cannot declare a different dialect\")}function tG(e,t){Q6(e,X6,\"Draft-07\",\"Draft 2020-12\");let r={},n,o,s;for(let a of Object.keys(e)){let i=e[a];if(!V6(r,a,i,t,G6))switch(a){case\"$ref\":n=i;break;case\"$schema\":eG(r,i,t,B6,\"Draft-07\");break;case\"$id\":case\"$anchor\":break;case\"$defs\":N(r,\"definitions\",t.schemaMap(i,a,\"definitions\"));break;case\"prefixItems\":o=i;break;case\"items\":s=i;break;case\"dependentRequired\":case\"dependentSchemas\":case\"minContains\":case\"maxContains\":break;case\"$dynamicRef\":case\"$dynamicAnchor\":case\"$vocabulary\":case\"unevaluatedProperties\":case\"unevaluatedItems\":Fi(a,\"Draft-07\",\"the target dialect has no equivalent\");case\"required\":if(Array.isArray(i)&&i.length===0)break;N(r,a,i);break;default:N(r,a,i)}}if(rG(r,o,s,t),Object.hasOwn(e,\"contains\")){let a=e.minContains,i=e.maxContains;(a!==void 0&&a!==1||i!==void 0)&&Fi(\"minContains/maxContains\",\"Draft-07\",\"contains cardinality cannot be represented\"),Object.hasOwn(e,\"minContains\")&&N(r,\"minContains\",a)}else Object.hasOwn(e,\"minContains\")&&N(r,\"minContains\",e.minContains),Object.hasOwn(e,\"maxContains\")&&N(r,\"maxContains\",e.maxContains);return oG(e,r,t,\"draft-07\"),aG(e,r,\"$id\",\"Draft-07\"),nG(r,n,t),r}function rG(e,t,r,n){if(t===void 0){r!==void 0&&N(e,\"items\",n.schema(r,\"items\"));return}N(e,\"items\",n.schemaArray(t,\"prefixItems\",\"items\")),r!==void 0&&N(e,\"additionalItems\",n.schema(r,\"items\",\"additionalItems\"))}function nG(e,t,r){if(t!==void 0)if(typeof t==\"string\"&&Object.keys(e).length>0){let n={};r.reference(n,t),sG(e,n)}else r.reference(e,t)}function oG(e,t,r,n){let o=ur(e.dependentRequired)?e.dependentRequired:void 0,s=ur(e.dependentSchemas)?e.dependentSchemas:void 0;if(o===void 0&&s===void 0)return;let a={},i=new Set([...Object.keys(o??{}),...Object.keys(s??{})]);for(let c of i){let u=o?.[c],f=s?.[c],p=n===\"draft-04\"&&Array.isArray(u)&&u.length===0;f===void 0?p||N(a,c,u):u===void 0||p?N(a,c,r.schemaAt(f,[\"dependentSchemas\",c],[\"dependencies\",c])):N(a,c,{allOf:[r.schemaAt(f,[\"dependentSchemas\",c],[\"dependencies\",c,\"allOf\",\"0\"]),{required:u}]})}Object.keys(a).length>0&&N(t,\"dependencies\",a)}function sG(e,t){Array.isArray(e.allOf)?e.allOf.push(t):N(e,\"allOf\",[t])}function aG(e,t,r,n){let o=e.$id,s=e.$anchor;if(s===void 0){o!==void 0&&N(t,r,o);return}(typeof s!=\"string\"||!Z6.test(s))&&Fi(\"$anchor\",n,\"the anchor is not valid\"),Y6.test(s)||Fi(\"$anchor\",n,\"the anchor cannot be represented as a plain-name fragment identifier\"),o===void 0?N(t,r,`#${s}`):Fi(\"$anchor\",n,\"it cannot be combined with the schema $id\")}function Zh(e){return to(Su(e.ast),{schema:e})}var Su=_i(e=>{let t=cG(e,Su),r=e.context;return t===e||r===void 0?t:Uh(t,lT(r))});function lT(e){return e.constructorDefault===void 0?e:new Wo(e.isOptional,e.isMutable,void 0,e.annotations)}function GF(e){if(e.propertySignatures.some(t=>typeof t.name!=\"string\"))throw new globalThis.Error(\"Objects property names must be strings\",{cause:e})}function VF(e){return t=>{let r=[...t].sort((o,s)=>e(mn(o))-e(mn(s)));return r.some((o,s)=>o!==t[s])?r:t}}var iG=VF(e=>{switch(e._tag){case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function cG(e,t){switch(e._tag){case\"Declaration\":{let r=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Yr(r))return qe(e,[JI]);let n=e.typeParameters.map(s=>to(mn(s))),o=r(n);return o===void 0?e:qe(e,[hu(o,t)])}case\"Unknown\":return qe(e,[JI]);case\"ObjectKeyword\":return qe(e,[mF]);case\"Undefined\":case\"Void\":case\"Literal\":case\"Number\":return e.toCodecJson();case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return GF(e),e.recur(t,Lh);case\"Union\":{let r=iG(e.types);return r!==e.types?new zr(r,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}function Yh(e){return to(ZF(yt(e.ast)))}var ZF=Zr(e=>{let t=uG(e,ZF);return t!==e&&e.context!==void 0?Uh(t,lT(e.context)):t});function uG(e,t){switch(e._tag){case\"Declaration\":{let r=e.annotations?.toCodecIso??e.annotations?.toCodec;if(Yr(r)){let n=r(e.typeParameters.map(o=>to(o)));return qe(e,[hu(n,t)])}return e}case\"Arrays\":case\"Objects\":case\"Union\":case\"Suspend\":return e.recur(t)}return e}function Qh(e){return to(eN(e.ast),{schema:e})}function YF(e){return to(tN(e.ast))}var fG=VF(e=>{switch(e._tag){case\"Null\":case\"Boolean\":case\"Number\":case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function lG(e,t,r){switch(e._tag){case\"Declaration\":{let n=e.typeParameters.map(u=>to(t(mn(u)))),o=e.annotations?.toCodecStringTree;if(Yr(o)){let u=o(n);return u===void 0?e:qe(e,[hu(u,t)])}let s=e.annotations?.toCodecJson,a=Yr(s)?s(n):void 0,i=a===void 0?e.annotations?.toCodec:void 0,c=a??(Yr(i)?i(n):void 0);return c===void 0?r(e):qe(e,[hu(c,t)])}case\"Null\":return qe(e,[pG]);case\"Boolean\":return qe(e,[dG]);case\"Unknown\":case\"ObjectKeyword\":return qe(e,[KI]);case\"Enum\":case\"Number\":case\"Literal\":case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return GF(e),e.recur(t,Lh);case\"Union\":{let n=fG(e.types);return n!==e.types?new zr(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}var pG=new ot(new pn(\"null\"),new Ce(oe(()=>null),oe(()=>\"null\"))),dG=new ot(new zr([new pn(\"true\"),new pn(\"false\")]),new Ce(oe(e=>e===\"true\"),Ai())),QF=new Ce(oe(e=>typeof e==\"string\"?[e]:e),jr()),XF=e=>e.transformation===QF,eN=_i(e=>{let t=lG(e,eN,r=>{throw new globalThis.Error(\"Missing structural codec for StringTree\",{cause:r})});return t!==e&&e.context!==void 0?Uh(t,lT(e.context)):t},{stopAt:XF}),KF=e=>Zt(e)?Ri(Yn):Yn,tN=_i(e=>{let t=mG(e);if(II(t)){let r=da(new zr([new Rn(t.isMutable,t.elements.map(KF),t.rest.map(KF)),ln],{mode:\"anyOf\"}),t,QF);return Zt(e)?Ri(r):r}return t},{stopAt:XF});function mG(e){return e._tag===\"Declaration\"||e._tag===\"Arrays\"||e._tag===\"Objects\"||e._tag===\"Union\"||e._tag===\"Suspend\"?e.recur(tN):e}var gie=globalThis.RegExp;var ws=e=>e.replace(/[/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\");function ma(e,t){return t.length>0&&(e+=`\n at ${ud(t)}`),new Error(e)}function rN(e){return`#/$defs/${iT(e)}`}var hG=new Set([...xP,wi,...hP]);function fp(e,t){if(e===void 0)return;let r={},n=e.title;typeof n==\"string\"&&(r.title=n);let o=e.description,s=e.expected;typeof o==\"string\"?r.description=o:t?.generateDescriptions===!0&&typeof s==\"string\"&&(r.description=s);let a=e.default;xu(a)&&(r.default=a);let i=e.examples;Array.isArray(i)&&xu(i)&&(r.examples=i);let c=e.readOnly;typeof c==\"boolean\"&&(r.readOnly=c);let u=e.writeOnly;typeof u==\"boolean\"&&(r.writeOnly=u);let f=e.format;typeof f==\"string\"&&(r.format=f);let p=e.contentEncoding;typeof p==\"string\"&&(r.contentEncoding=p);let d=e.contentMediaType;typeof d==\"string\"&&(r.contentMediaType=d);let m=e.contentSchema;if(xu(m)&&(r.contentSchema=m),t?.includeAnnotationKey!==void 0)for(let[x,y]of Object.entries(e))hG.has(x)||!t.includeAnnotationKey(x)||xu(y)&&N(r,x,y);return Object.keys(r).length===0?void 0:r}function oN(e){let t=e.type===\"number\"||e.type===\"integer\"?e.type:void 0,r=e;if(t!==void 0&&(r={...e},delete r.type),Array.isArray(r.allOf)){let n=[],o=!1;for(let s of r.allOf){let a=oN(s);a.type!==void 0&&(o=!0,(t===void 0||a.type===\"integer\")&&(t=a.type)),Object.keys(a.schema).length>0&&n.push(a.schema)}if(o){let{allOf:s,...a}=r;r=n.length===0?a:{...a,allOf:n}}}return{type:t,schema:r}}function xG(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==\"number\")return!1;let t=e.anyOf[1];return t?.type===\"string\"&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(\"NaN\")&&t.enum.includes(\"Infinity\")&&t.enum.includes(\"-Infinity\")}var sN=\"|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|\";function Xh(e,t){return Object.keys(e).every(r=>t.includes(`|${r}|`))}function nN(e,t){return typeof e.$ref!=\"string\"&&t.every(r=>!Object.hasOwn(e,r))}var mT=\"|title|description|default|examples|readOnly|writeOnly|\",gG=sN+mT;function lp(e,t,r){if(Object.keys(e).length===0)return t;let n=Object.keys(t);if(n.length===0)return e;let o=e.type===\"number\"||e.type===\"integer\"?e.type:void 0,s=xG(e);if(o!==void 0||s){let i=oN(t);if(i.type!==void 0){let c=o===\"integer\"||i.type===\"integer\"?\"integer\":\"number\",u={...e,type:c};s&&delete u.anyOf;let f=Object.keys(i.schema);return f.length===0?u:Xh(i.schema,mT)&&nN(u,f)?{...u,...i.schema}:lp(u,i.schema,r)}}if(r&&nN(e,n))return{...e,...t};let a=Array.isArray(t.allOf)&&n.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...a]}:typeof e.$ref==\"string\"?{allOf:[e,...a]}:{...e,allOf:a}}function dT(e,t=new Set){return typeof e==\"boolean\"?e:t.has(e)?!0:(t.add(e),e.every(r=>dT(r,t)))}function yG(e){return Array.isArray(e)}function SG(e,t,r,n){let o=new Map,s=new Map,a=new WeakMap,i=new Map,c=new Map,u=Object.keys(r);for(let h of u)x(h,[\"references\",h]);let f=In(e,(h,b)=>E(h,t[b],[]));for(let[h,b]of i.values())if(!dT(h))for(let T of b)Array.isArray(T.oneOf)&&(T.anyOf=T.oneOf,delete T.oneOf);for(let h of u){let b=r[h],T=S(b);if(T===void 0)continue;let C=o.get(h)[0],L=c.get(T),Q=L?.find(ye=>W(o.get(ye)[0],C));Q===void 0?L===void 0?c.set(T,[h]):L.push(h):s.set(h,Q)}let p=In(f,y),d={};for(let h of u)s.has(h)||N(d,h,y(o.get(h)[0]));return{dialect:\"draft-2020-12\",schemas:p,definitions:d};function m(h){return Array.isArray(h.oneOf)&&i.get(h.oneOf)?.[1].push(h),h}function x(h,b){if(!Object.hasOwn(r,h))throw ma(`Invalid reference ${h}`,[...b,\"$ref\"]);let T=o.get(h);if(T!==void 0)return T;let C=[{},[]];return o.set(h,C),C[0]=E(r[h],[\"references\",h],C[1]),C}function y(h){return zF(h,b=>{let T=cT(b);if(T===void 0){if(/^#(?:\\/|%2f)/i.test(b))throw new Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(b)}`);return b}if(!T.startsWith(\"/$defs/\"))return b;let C=T.indexOf(\"/\",7),L=s.get(cp(T.slice(7,C<0?void 0:C)));return L===void 0?b:b.replace(/^#(?:\\/|%2f).*?(?:\\/|%2f).*?(?=\\/|%2f|$)/i,rN(L))})}function S(h){if(h._tag===\"Reference\")return;let b=h.checks.length===0?h.annotations:h.checks[h.checks.length-1].annotations;return typeof b?.identifier!=\"string\"&&typeof b?.[wi]==\"string\"?b[wi]:void 0}function w(h,b,T,C){let L=h.annotations,Q=L?.toJsonSchema;if(Q!==void 0){let Ge=h.representation?.schemas?.map((mf,W$)=>E(mf,[...T,\"representation\",\"schemas\",W$],C))??[],Ns=Q({type:b,schemas:Ge}),Ye=yG(Ns);Ye&&C.push(!1);let jt=Ye?Ns[0]:Ns,cr=fp(L,n),rs=cr===void 0?jt:{...jt,...cr},Aa=cr===void 0?sN:gG;return[rs,h._tag===\"Filter\"&&Xh(rs,Aa)&&(cr===void 0||Xh(cr,mT))?!0:void 0]}if(h._tag===\"Filter\"){C.push(!1);return}let ye=h.checks.flatMap((Ge,Ns)=>{let Ye=w(Ge,b,[...T,\"checks\",Ns],C);return Ye===void 0?[]:[Ye[0]]});if(ye.length===0)return;let ve=fp(L,n),Et={allOf:ye};return[ve===void 0?Et:{...Et,...ve}]}function E(h,b,T){if(h._tag===\"Reference\")return T.push(x(h.$ref,b)[1]),{$ref:rN(h.$ref)};let C=a.get(h);if(C!==void 0)return T.push(C[1]),C[0];let L=[];T.push(L);let Q=M(h,b,L),ye=fp(h.annotations,n);ye!==void 0&&(Q={...Q,...ye});for(let ve=0;ve{if(typeof Q==\"number\"&&!globalThis.Number.isFinite(Q))throw ma(`Invalid numeric enum value ${globalThis.String(Q)}`,[...b,\"enums\",ye,1]);return{type:typeof Q,enum:[Q],title:L}});return C.length===0?{not:{}}:{anyOf:C}}case\"TemplateLiteral\":return{type:\"string\",pattern:`^${h.parts.map(ex).join(\"\")}$`};case\"Arrays\":{if(h.rest.length>1)throw ma(\"Invalid schema representation document\",[...b,\"rest\"]);let C={type:\"array\"},L=h.elements.length,Q=h.elements.map((ye,ve)=>{ye.isOptional&&L--;let Et=E(ye.type,[...b,\"elements\",ve,\"type\"],T),Ge=fp(ye.annotations,n);return Ge===void 0?Et:m(lp(Et,Ge))});if(Q.length>0?(C.prefixItems=Q,C.maxItems=h.elements.length,L>0&&(C.minItems=L)):C.items=!1,h.rest.length===1){delete C.maxItems;let ye=E(h.rest[0],[...b,\"rest\",0],T);Object.keys(ye).length>0?C.items=ye:delete C.items}return C}case\"Objects\":{if(h.propertySignatures.length===0&&h.indexSignatures.length===0)return{not:{type:\"null\"}};let C={type:\"object\"},L={},Q=[];for(let Ye=0;Ye0&&(C.properties=L),Q.length>0&&(C.required=Q);let ye={},ve=[],Et=[],Ge=!1;for(let Ye=0;Ye0;if(Ns&&(C.patternProperties=ye),Ge&&n?.onExcessProperty===\"error\"){let Ye=[];h.propertySignatures.length>0&&Ye.push({enum:Object.keys(L)});for(let jt=0;jt0&&(C.allOf=ve.map(jt=>({type:\"object\",additionalProperties:jt})))}else ve.length===0?C.additionalProperties=Ge||n?.onExcessProperty!==\"error\":ve.length===1&&h.propertySignatures.length===0&&!Ns?C.additionalProperties=ve[0]:ve.length>0&&(C.allOf=ve.map(Ye=>({type:\"object\",additionalProperties:Ye})));return typeof C.additionalProperties==\"object\"&&C.additionalProperties!==null&&Object.keys(C.additionalProperties).length===0&&delete C.additionalProperties,C}case\"Union\":{let C=[],L=h.types.map((ye,ve)=>E(ye,[...b,\"types\",ve],C));if(T.push(C),L.length===0)return{not:{}};let Q=h.options?.mode??\"anyOf\";if(Q===\"anyOf\"&&L.length>1){let ye=EG(L);if(ye!==void 0)return ye}return Q===\"oneOf\"&&i.set(L,[C,[]]),{[Q]:L}}}}function _(h,b,T){switch(h._tag){case\"Reference\":{if(!Object.hasOwn(r,h.$ref))throw ma(`Invalid reference ${h.$ref}`,[...b,\"$ref\"]);if(x(h.$ref,b),T.has(h.$ref))return;let C=new Set(T).add(h.$ref);return _(r[h.$ref],[\"references\",h.$ref],C)}case\"String\":{if(h.checks.length===0)return[];if(h.checks.length!==1||h.checks[0]._tag!==\"Filter\"||h.checks[0].annotations?.toJsonSchema===void 0)return;let C=[],L=E(h,b,C);return dT(C)&&L.type===\"string\"&&typeof L.pattern==\"string\"&&Xh(L,\"|type|pattern|title|description|default|examples|readOnly|writeOnly|\")?[L.pattern]:void 0}case\"TemplateLiteral\":return h.checks.length===0?[`^${h.parts.map(ex).join(\"\")}$`]:void 0;case\"Union\":{if(h.types.length===0||h.checks.length>0||h.options?.mode===\"oneOf\")return;let C=[];for(let L=0;Le;function ro(e){return e===void 0?void 0:{annotations:e}}function pp(e,t){let{references:r,representations:n}=TG([e],t);return{representation:n[0],references:r}}function TG(e,t){let r={},n=new Map,o=new Set,s=new Map,a=new Set;for(let h of e)m(h);let i=t?.referencePolicy??IG;for(let h of s.values())for(let b of h.values()){let T=i({ast:b.ast,occurrences:b.occurrences,identifier:b.identifier});if(T!==void 0){let C=T===b.identifier||!T.endsWith(\"_\")?\"_\":\"\";b.reference=u(T,b,C)}else b.isRecursive&&(b.reference=u(`${b.ast._tag}_`,b,\"\"))}return{representations:In(e,h=>y(h)),references:r};function u(h,b,T=\"_\"){let C=h,L=0;for(;n.has(C);){if(n.get(C)===b)return C;C=`${h}${T}${++L}`}return n.set(C,b),C}function f(h,b,T){let C=b.fallback;return C!==void 0?VE(h)===C?h:Qn(h,{[wi]:C}):T===b.identifier?h:Qn(h,{identifier:T})}function p(h,b){if(!Object.hasOwn(r,h)&&!o.has(h)){o.add(h);let T=S(b);o.delete(h),N(r,h,T)}return{_tag:\"Reference\",$ref:h}}function d(h){let b=mu(h),T=du(b),C=tu(b),L=C===void 0?(b!==h?tu(h):void 0)??VE(b):void 0;L!==void 0&&(C=`${L}Encoded`);let Q=s.get(T);Q===void 0&&(Q=new Map,s.set(T,Q));let ye=Q.get(C);return ye===void 0&&(ye={ast:T,identifier:C,fallback:L,occurrences:0,isRecursive:!1,reference:void 0},Q.set(C,ye)),ye}function m(h){let b=d(h),T=b.ast;if(b.occurrences++,a.has(b)){b.isRecursive=!0;return}if(!(b.occurrences>1)){switch(a.add(b),x(T.checks),T._tag){case\"Declaration\":case\"Arrays\":case\"Objects\":case\"Union\":T.recur(C=>(m(C),C));break;case\"TemplateLiteral\":T.parts.forEach(m);break;case\"Suspend\":m(T.thunk());break}a.delete(b)}}function x(h){h?.forEach(b=>{b.annotations?.representation?.schemas?.forEach(T=>m(yt(T))),b._tag===\"FilterGroup\"&&x(b.checks)})}function y(h){let b=d(h),T=b.ast,C=b.reference;if(C!==void 0){let L=b.identifier===void 0?T:f(T,b,C);return p(C,L)}return S(T)}function S(h){let b=w(h.checks);switch(h._tag){case\"Declaration\":return{_tag:\"Declaration\",typeParameters:h.typeParameters.map(T=>y(T)),checks:b,...M(h.annotations)};case\"Null\":case\"Undefined\":case\"Void\":case\"Never\":case\"Unknown\":case\"Any\":case\"String\":case\"Boolean\":case\"Number\":case\"BigInt\":case\"Symbol\":case\"ObjectKeyword\":return{_tag:h._tag,checks:b,...ro(h.annotations)};case\"Literal\":return{_tag:\"Literal\",literal:h.literal,checks:b,...ro(h.annotations)};case\"UniqueSymbol\":return{_tag:\"UniqueSymbol\",symbol:h.symbol,checks:b,...ro(h.annotations)};case\"Enum\":return{_tag:\"Enum\",enums:h.enums,checks:b,...ro(h.annotations)};case\"TemplateLiteral\":return{_tag:\"TemplateLiteral\",parts:h.parts.map(T=>y(T)),checks:b,...ro(h.annotations)};case\"Arrays\":return{_tag:\"Arrays\",elements:h.elements.map(T=>{let C=mu(T),L=C.context?.annotations;return{isOptional:Zt(C),type:y(T),...ro(L)}}),rest:h.rest.map(T=>y(T)),checks:b,...ro(h.annotations)};case\"Objects\":return{_tag:\"Objects\",propertySignatures:h.propertySignatures.map(T=>{let C=mu(T.type),L=C.context?.annotations;return{name:T.name,type:y(T.type),isOptional:Zt(C),isMutable:nF(C),...ro(L)}}),indexSignatures:h.indexSignatures.map(T=>({parameter:y(T.parameter),type:y(T.type)})),checks:b,...ro(h.annotations)};case\"Union\":return{_tag:\"Union\",types:h.types.map(T=>y(T)),...h.options===void 0?{}:{options:h.options},checks:b,...ro(h.annotations)};case\"Suspend\":return{_tag:\"Suspend\",checks:[],thunk:y(h.thunk()),...ro(h.annotations)}}}function w(h){return h?.map(E)??[]}function E(h){switch(h._tag){case\"Filter\":return{_tag:\"Filter\",aborted:h.aborted,..._(h.annotations)};case\"FilterGroup\":return{_tag:\"FilterGroup\",checks:In(h.checks,E),..._(h.annotations)}}}function M(h){if(h===void 0)return;let{representation:b,...T}=h;return{...b===void 0?void 0:{representation:b},...Object.keys(T).length===0?void 0:{annotations:T}}}function _(h){if(h===void 0)return;let{representation:b,...T}=h,C=b===void 0?void 0:b.schemas===void 0?b:{...b,schemas:b.schemas.map(L=>y(yt(L)))};return{...C===void 0?void 0:{representation:C},...Object.keys(T).length===0?void 0:{annotations:T}}}}function cN(e){return Ke(e)?e.value:{issues:[{message:tb(e.cause)}]}}function fN(e,t){let r=et(e),n={errors:\"all\",...t?.parseOptions},o=wP(t),s=a=>{let i=new Ga(\"sync\"),c=Ml(qb(r(a,n),{onFailure:o,onSuccess:f=>({value:f})}),{scheduler:i});c.currentDispatcher?.flush();let u=c.pollUnsafe();return u?cN(u):new Promise(f=>{c.addObserver(p=>{f(cN(p))})})};if(\"~standard\"in e){let a=e;return\"validate\"in a[\"~standard\"]||Object.assign(a[\"~standard\"],{validate:s}),a}return Object.assign(e,{\"~standard\":{version:1,vendor:\"effect\",validate:s}})}function wG(e){let t=pp(Su(e));return tx(t)}function uN(e,t){let r=wG(e);if(t===\"draft-2020-12\"){let n=r.schema;return Object.keys(r.definitions).length>0&&(n.$defs=r.definitions),n}else if(t===\"draft-07\"){let n=jF(r),o=n.schema;return Object.keys(n.definitions).length>0&&(o.definitions=n.definitions),o}throw new globalThis.Error(`Unsupported target: ${t}`)}function lN(e){let t={input(r){return uN(e.ast,r.target)},output(r){return uN(yt(e.ast),r.target)}};if(\"~standard\"in e){let r=e;return\"jsonSchema\"in r[\"~standard\"]||Object.assign(r[\"~standard\"],{jsonSchema:t}),r}return Object.assign(e,{\"~standard\":{version:1,vendor:\"effect\",jsonSchema:t}})}function dN(e,t){let r=[];return hT(e,t,\"\",r),r}function hT(e,t,r,n){if(!Object.is(e,t)){if(Array.isArray(e)&&Array.isArray(t)){let o=e.length,s=t.length,a=Math.min(o,s);for(let i=0;i=s;i--)n.push({op:\"remove\",path:`${r}/${i}`});for(let i=o;ii)throw new Error(`Array index out of bounds at \"${t.path}\".`);let c=o.slice();return t.op===\"add\"?c.splice(a,0,t.value):t.op===\"remove\"?c.splice(a,1):c[a]=t.value,pN(s,c)}if(rx(o)){if(t.op!==\"add\"&&!Object.hasOwn(o,n))throw new Error(`Property \"${n}\" does not exist at \"${t.path}\".`);let a={...o};return t.op===\"remove\"?delete a[n]:N(a,n,t.value),pN(s,a)}throw new Error(`Cannot ${t.op} at \"${t.path}\" (parent not found or not a container).`)}function vG(e,t){let r=AG(t);if(r.length===0)return null;let n=r[r.length-1],o=[],s=e;for(let a=0;a=s.length)return null;o.push({container:s,token:c}),s=s[c];continue}if(rx(s)){if(!Object.hasOwn(s,i))return null;o.push({container:s,token:i}),s=s[i];continue}return null}return{stack:o,parent:s,lastToken:n}}function pN(e,t){let r=t;for(let n=e.length-1;n>=0;n--){let{container:o,token:s}=e[n];if(Array.isArray(o)){let a=o.slice();a[s]=r,r=a}else{let a={...o};N(a,s,r),r=a}}return r}function gN(e){let t=Zh(e),r=Kh(t),n=Jh(t);return{empty:[],diff:(o,s)=>dN(r(o),r(s)),combine:(o,s)=>[...o,...s],patch:(o,s)=>{let a=r(o),i=mN(s,a);return Object.is(i,a)?o:n(i)}}}function yN(e,t){let r=tu(e.ast)??ZE(e.ast),n=AF(Qh(e));return o=>n(o).pipe(j(s=>_G(s,{rootName:r,...t})))}function _G(e,t){let r=t.rootName??\"root\",n=t.arrayItemName??\"item\",o=t.pretty??!0,s=t.indent??\" \",a=t.sortKeys??!0,i=new Set,c=[];return f(r,e,0),c.join(o?`\n`:\"\");function u(p,d){c.push(o?s.repeat(p)+d:d)}function f(p,d,m,x){let{attrs:y,safe:S}=bu.tagInfo(p,x);if(d===void 0)u(m,`<${S}${y}/>`);else if(typeof d==\"string\")u(m,`<${S}${y}>${bu.escapeText(d)}`);else if(typeof d!=\"object\"||d===null)u(m,`<${S}${y}>${bu.escapeText(F(d))}`);else{if(i.has(d))throw new globalThis.Error(\"Cycle detected while serializing to XML.\",{cause:d});i.add(d);try{if(globalThis.Array.isArray(d)){if(d.length===0){u(m,`<${S}${y}/>`);return}u(m,`<${S}${y}>`);for(let M of d)f(n,M,m+1);u(m,``);return}let w=d,E=Object.keys(w);if(a&&E.sort(),E.length===0){u(m,`<${S}${y}/>`);return}u(m,`<${S}${y}>`);for(let M of E)f(bu.parseTagName(M).safe,w[M],m+1,M);u(m,``)}finally{i.delete(d)}}}}var bu={escapeText(e){return e.replace(/&/g,\"&\").replace(//g,\">\")},escapeAttribute(e){return e.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(//g,\">\")},parseTagName(e){let t=e,r=e;return/^[A-Za-z_]/.test(r)||(r=\"_\"+r),r=r.replace(/[^A-Za-z0-9._-]/g,\"_\"),/^xml/i.test(r)&&(r=\"_\"+r),{safe:r,changed:r!==t}},tagInfo(e,t){let{changed:r,safe:n}=bu.parseTagName(e),s=r||t&&t!==e?` data-name=\"${bu.escapeAttribute(t??e)}\"`:\"\";return{safe:n,attrs:s}}};var xT=Zr(e=>ha(e));function ha(e){let t=Ts(e)?.toEquivalence;if(t)return t(lu(e)?e.typeParameters.map(ha):[]);switch(e._tag){case\"Never\":return za();case\"Declaration\":return PG(e);case\"Null\":case\"Undefined\":case\"Void\":case\"Unknown\":case\"Any\":case\"String\":case\"Number\":case\"Boolean\":case\"BigInt\":case\"Symbol\":case\"Literal\":case\"UniqueSymbol\":case\"ObjectKeyword\":case\"Enum\":case\"TemplateLiteral\":return W;case\"Arrays\":{let r=e.elements.map(ha),n=e.rest.map(ha),[o,...s]=n,a=s.length;return tr((i,c)=>{if(!Array.isArray(i)||!Array.isArray(c))return!1;let u=i.length;if(u!==c.length)return!1;let f=0;for(;f0){for(;fha(o.type)),n=e.indexSignatures.map(o=>ha(o.type));return tr((o,s)=>{if(!ur(o)||!ur(s))return!1;for(let a=0;a[Pi(s),ha(e.types[a])]);return tr((s,a)=>{let i=n(s,!1);for(let c=0;c(r??=xT(e.thunk()))(n,o))}}}function PG(e){let t=e.annotations?.representation;if(t===void 0)return W;switch(t.id){case\"effect/schema/Option\":{let[r]=Ni(e);return(n,o)=>n._tag===o._tag&&(n._tag===\"None\"||r(n.value,o.value))}case\"effect/schema/Result\":{let[r,n]=Ni(e);return(o,s)=>o._tag===s._tag&&(o._tag===\"Success\"?r(o.success,s.success):n(o.failure,s.failure))}case\"effect/schema/CauseReason\":{let[r,n]=Ni(e);return bN(r,n)}case\"effect/schema/Cause\":{let[r,n]=Ni(e);return SN(r,n)}case\"effect/schema/Exit\":{let[r,n,o]=Ni(e),s=SN(n,o);return(a,i)=>a._tag===i._tag&&(a._tag===\"Success\"?r(a.value,i.value):s(a.cause,i.cause))}case\"effect/schema/ReadonlyMap\":{let[r,n]=Ni(e);return cd(r,n)}case\"effect/schema/ReadonlySet\":return Ef(Ni(e)[0]);case\"effect/schema/RegExp\":return(r,n)=>r.source===n.source&&r.flags===n.flags;case\"effect/schema/URL\":return(r,n)=>r.toString()===n.toString();default:return W}}function Ni(e){return e.typeParameters.map(ha)}function bN(e,t){return(r,n)=>{if(r._tag!==n._tag)return!1;switch(r._tag){case\"Fail\":return e(r.error,n.error);case\"Die\":return t(r.defect,n.defect);case\"Interrupt\":return r.fiberId===n.fiberId}}}function SN(e,t){let r=xd(bN(e,t));return(n,o)=>r(n.reasons,o.reasons)}function IN(e,t){return r=>{switch(r._tag){case\"Fail\":return`Fail(${e(r.error)})`;case\"Die\":return`Die(${t(r.defect)})`;case\"Interrupt\":return\"Interrupt\"}}}function EN(e,t){let r=IN(e,t);return n=>`Cause([${n.reasons.map(r).join(\", \")}])`}function TN(e,t){let r=new Map;return n(e);function n(a){let i=r.get(a);return i===void 0&&(i=o(a),r.set(a,i)),i}function o(a){let i=Ts(a)?.toFormatter;if(typeof i==\"function\")return i(lu(a)?a.typeParameters.map(n):[]);if(t?.onBefore){let c=t.onBefore(a,n);if(c!==void 0)return c}return s(a)}function s(a){switch(a._tag){default:return F;case\"Never\":return()=>\"never\";case\"Void\":return()=>\"void\";case\"Declaration\":{let i=a.annotations?.representation;if(i===void 0)return F;let c=a.typeParameters.map(n);switch(i.id){case\"effect/schema/Option\":{let[u]=c;return Ht({onNone:()=>\"none()\",onSome:f=>`some(${u(f)})`})}case\"effect/schema/Result\":{let[u,f]=c;return Ar({onSuccess:p=>`success(${u(p)})`,onFailure:p=>`failure(${f(p)})`})}case\"effect/schema/CauseReason\":return IN(c[0],c[1]);case\"effect/schema/Cause\":return EN(c[0],c[1]);case\"effect/schema/Exit\":{let[u,f,p]=c,d=EN(f,p);return m=>{switch(m._tag){case\"Success\":return`Exit.Success(${u(m.value)})`;case\"Failure\":return`Exit.Failure(${d(m.cause)})`}}}case\"effect/schema/ReadonlyMap\":{let[u,f]=c;return p=>{let d=p.size;if(d===0)return\"ReadonlyMap(0) {}\";let m=globalThis.Array.from(p.entries()).sort().map(([x,y])=>`${u(x)} => ${f(y)}`);return`ReadonlyMap(${d}) { ${m.join(\", \")} }`}}case\"effect/schema/HashMap\":{let[u,f]=c;return p=>{let d=HR(p);if(d===0)return\"HashMap(0) {}\";let m=Bl(p).sort().map(([x,y])=>`${u(x)} => ${f(y)}`);return`HashMap(${d}) { ${m.join(\", \")} }`}}case\"effect/schema/ReadonlySet\":{let[u]=c;return f=>{let p=f.size;if(p===0)return\"ReadonlySet(0) {}\";let d=globalThis.Array.from(f.values()).sort().map(m=>`${u(m)}`);return`ReadonlySet(${p}) { ${d.join(\", \")} }`}}case\"effect/schema/HashSet\":{let[u]=c;return f=>{let p=VR(f);if(p===0)return\"HashSet(0) {}\";let d=globalThis.Array.from(f).sort().map(m=>`${u(m)}`);return`HashSet(${p}) { ${d.join(\", \")} }`}}case\"effect/schema/Chunk\":{let[u]=c;return f=>{let p=gR(f);if(p===0)return\"Chunk(0) {}\";let d=globalThis.Array.from(f).sort().map(m=>`${u(m)}`);return`Chunk(${p}) { ${d.join(\", \")} }`}}default:return F}}case\"Arrays\":{let i=a.elements.map(d=>n(d)),c=a.rest.map(n),[u,...f]=c,p=f.length;return d=>{let m=[],x=0;for(;x0){for(;xn(u.type)),c=a.indexSignatures.map(u=>n(u.type));return a.propertySignatures.length===0&&a.indexSignatures.length===0?F:u=>{let f=[],p=new Set;for(let d=0;d0?\"{ \"+f.join(\", \")+\" }\":\"{}\"}}case\"Union\":{let i=yt(a).types,c=np(i),u=i.map((f,p)=>[Pi(f),n(a.types[p])]);return f=>{let p=c(f,!1);for(let d=0;d(i??=n(a.thunk()))(c)}}}}var gT=l(2,(e,t)=>bT(e,(r,n)=>CN(t,r)?[r,n]:void 0)),yT=l(2,(e,t)=>bT(e,(r,n)=>CN(t,r)?void 0:[r,n])),wN=l(2,(e,t)=>({...e,...t}));var ST=l(2,(e,t)=>bT(e,(r,n)=>[Object.hasOwn(t,r)?t[r]:r,n]));var hr=e=>e;function CN(e,t){return e.some(r=>r===t||typeof r==\"number\"&&String(r)===t)}function bT(e,t){let r={};for(let n of Reflect.ownKeys(e)){if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;let o=t(n,e[n]);if(o){let[s,a]=o;N(r,s,a)}}return r}function vN(e,t){return no(Eu(\"Iso\",e,t))}function AN(e,t){return no(Eu(\"Lens\",e,t))}function Eu(e,t,r){return[{_tag:\"PrimitiveNode\",kind:e,get:t,set:r}]}var NG={kind:\"Iso\",get:R,set:R},nx=class{_tag=\"PathNode\";kind=\"Lens\";path;get;set;constructor(t){this.path=t,this.get=r=>{let n=r;for(let o=0;o{let o=ox(n),s=o,a=0;for(;afF(t,r)}};function Ui(e,t){if(e.length===0)return t;if(t.length===0)return e;let r=e.slice();for(let n=0;nr)}modify(t){return r=>Nf(Dt(this.getResult(r),n=>this.replaceResult(t(n),r)),()=>r)}compose(t){return no(Ui(this.node,t.node))}key(t){return no(Ui(this.node,[new nx([t])]))}optionalKey(t){return no(Ui(this.node,Eu(\"Lens\",r=>r[t],(r,n)=>{let o=ox(n);return r===void 0?Array.isArray(o)&&(typeof t==\"number\"||typeof t==\"string\"&&Sc(t))?o.splice(Number(t),1):delete o[t]:N(o,t,r),o})))}check(...t){return no(Ui(this.node,[new dp(t)]))}refine(t,r){return no(Ui(this.node,[new dp([Nh(t,r)])]))}tag(t){let r=K(new de({expected:`${JSON.stringify(t)} tag`}));return no(Ui(this.node,Eu(\"Prism\",n=>n._tag===t?B(n):r,R)))}at(t,...r){let n=K(new ct([t],new fa(void 0)));return no(Ui(this.node,Eu(\"Optional\",o=>Object.hasOwn(o,t)?B(o[t]):n,(o,s)=>{if(Object.hasOwn(s,t)){let a=ox(s);return N(a,t,o),B(a)}else return n})))}pick(t){return this.compose(AN(gT(t),(r,n)=>({...yT(n,t),...r})))}omit(t){return this.compose(AN(yT(t),(r,n)=>({...gT(n,t),...r})))}notUndefined(){return this.refine(Io,{expected:\"a value other than `undefined`\"})}forEach(t){let r=t(sx());return UG(n=>Cr(this.getResult(n),o=>{let s=[];for(let a=0;aDt(this.getResult(o),s=>{let a=[];for(let c=0;cNf(Dt(this.getResult(r),n=>this.replaceResult(n.map(t),r)),()=>r)}},IT=class extends Iu{get;set;constructor(t,r,n){super(t,o=>B(r(o)),o=>B(n(o))),this.get=r,this.set=n}replace(t,r){return this.set(t)}modify(t){return r=>this.set(t(this.get(r)))}},TT=class extends Iu{get;constructor(t,r,n){super(t,o=>B(r(o)),(o,s)=>B(n(o,s))),this.get=r,this.replace=n}modify(t){return r=>this.replace(t(this.get(r)),r)}},wT=class extends Iu{set;constructor(t,r,n){super(t,r,(o,s)=>B(n(o))),this.set=n}replace(t,r){return this.set(t)}modify(t){return r=>Nf(Cr(this.getResult(r),n=>this.set(t(n))),()=>r)}};function no(e){let t=e[0]??NG;if(e.length>1){let r=e.reduce((n,o)=>$G(n,o.kind),\"Iso\");t={kind:r,get:DG(e,r),set:LG(e,r)}}switch(t.kind){case\"Iso\":return new IT(e,t.get,t.set);case\"Lens\":return new TT(e,t.get,t.set);case\"Prism\":return new wT(e,t.get,t.set);case\"Optional\":return new Iu(e,t.get,t.set)}}function ox(e){if(Array.isArray(e))return e.slice();if(typeof e==\"object\"&&e!==null){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw new Error(\"Cannot clone object with non-Object constructor or null prototype\");return{...e}}return e}function DG(e,t){return r=>{for(let n=0;n{for(let n=e.length-1;n>=0;n--)r=e[n].set(r);return r}:(r,n)=>{let o=e.length,s=new Array(o);for(let a=0;a=0;a--){let i=e[a];if(kN(i.kind))r=i.set(r);else if(i.kind===\"Lens\")r=i.set(r,s[a]);else{let c=i.set(r,s[a]);if(ce(c))return c;r=c.success}}return t===\"Optional\"?B(r):r}}function CT(e){return e===\"Prism\"||e===\"Optional\"}function kN(e){return e===\"Iso\"||e===\"Prism\"}function $G(e,t){return e===\"Iso\"?t:t===\"Iso\"||e===t?e:\"Optional\"}var BG=no([]);function sx(){return BG}function _N(e){let t=Yh(e);return vN(Kh(t),Jh(t))}function RN(e){return sx()}function PN(e){return sx()}var Tu=\"~effect/Schema/SchemaError\";function MN(e){return A(e,Tu)&&e[Tu]===Tu}var gn=\"~effect/net/NetAddress\";var oo=e=>e.value,so=e=>e,Cs=e=>e.bytes,Di=class extends Fr(\"NetAddressError\"){},wu=e=>A(e,gn),xr=e=>wu(e)&&e._tag===\"Ipv4Address\",Vo=e=>wu(e)&&e._tag===\"Ipv6Address\",FN=e=>xr(e)||Vo(e),Cu=e=>xr(e)?32:128,Au=e=>wu(e)&&e._tag===\"MacAddress\",hp=e=>wu(e)&&e._tag===\"InetAddressV4\",xp=e=>wu(e)&&e._tag===\"InetAddressV6\",AT=e=>hp(e)||xp(e),ax=e=>wu(e)&&e._tag===\"UnixPathAddress\",NN=e=>AT(e)||ax(e),zG={_tag:\"Ipv4Address\",[gn]:gn,[ae](e){return xr(e)&&oo(this)===oo(e)},[se](){return zt(fe(JG,oo(this)|0))},toString(){return ao(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},qG={_tag:\"Ipv6Address\",[gn]:gn,[ae](e){if(!Vo(e))return!1;let t=so(this),r=so(e);return t.w0===r.w0&&t.w1===r.w1&&t.w2===r.w2&&t.w3===r.w3},[se](){let e=so(this),t=fe(KG,e.w0|0);return t=fe(t,e.w1|0),t=fe(t,e.w2|0),zt(fe(t,e.w3|0))},toString(){return ao(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},HG={_tag:\"MacAddress\",[gn]:gn,[ae](e){return Au(e)&&WG(Cs(this),Cs(e))},[se](){return fe(GG,To(Cs(this)))},toString(){return vT(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},WG=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r{let t=Object.create(zG);return t.value=e>>>0,Object.freeze(t)},ZG=(e,t,r,n)=>{let o=Object.create(qG);return o.w0=e>>>0,o.w1=t>>>0,o.w2=r>>>0,o.w3=n>>>0,Object.freeze(o)},YG=(e,t,r,n)=>(e<<24|t<<16|r<<8|n)>>>0;var mp=e=>[e>>>24,e>>>16&255,e>>>8&255,e&255],QG=e=>{let t=Object.assign(Object.create(HG),{bytes:new Uint8Array(e)});return Object.freeze(t)};var St=(e,t)=>K(new Di({input:e,message:t})),XG=e=>e.every(t=>Number.isInteger(t)&&t>=0&&t<=255)?B(VG(YG(e[0],e[1],e[2],e[3]))):St(e,\"octets must be integers from 0 through 255\"),e3=e=>e.every(t=>Number.isInteger(t)&&t>=0&&t<=65535)?B(ZG(e[0]*65536+e[1],e[2]*65536+e[3],e[4]*65536+e[5],e[6]*65536+e[7])):St(e,\"segments must be integers from 0 through 65535\");var UN=e=>/^(?:[0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$/.test(e)?B(QG(new Uint8Array(e.split(\":\").map(t=>Number.parseInt(t,16))))):St(e,\"expected six two-digit hexadecimal octets separated by colons\");var ku=e=>{let t=e.split(\".\");if(t.length!==4||t.some(n=>!/^\\d{1,3}$/.test(n)))return St(e,\"expected exactly four decimal octets\");if(t.some(n=>n.length>1&&n[0]===\"0\"))return St(e,\"leading zeroes are not allowed\");let r=t.map(Number);return r.some(n=>n>255)?St(e,\"octets must be at most 255\"):XG([r[0],r[1],r[2],r[3]])},t3=e=>{if(e.includes(\"[\")||e.includes(\"]\")||e.includes(\"%\"))return St(e,\"brackets and zone identifiers are not valid in a bare IPv6 address\");let t=e.split(\"::\");if(t.length>2)return St(e,\"only one compression marker is allowed\");let r=t[0]===\"\"?[]:t[0].split(\":\"),n=t.length===2&&t[1]!==\"\"?t[1].split(\":\"):[];if(r.some(f=>f===\"\")||n.some(f=>f===\"\"))return St(e,\"empty segments are only valid in the compression marker\");let o=n.length>0?n[n.length-1]:r.length>0?r[r.length-1]:\"\",s;if(o.includes(\".\")){if(t.length===2&&n.length===0)return St(e,\"embedded IPv4 syntax must be trailing\");let f=Cr(ku(o),p=>{let d=oo(p);return[d>>>16,d&65535]});if(ce(f))return f;s=f.success,n.length>0?n.pop():r.pop()}let a=r.length+n.length+(s?2:0);if(t.length===1?a!==8:a>=8)return St(e,t.length===1?\"expected eight segments\":\"compression must replace at least one segment\");let i=f=>/^[0-9a-fA-F]{1,4}$/.test(f)?Number.parseInt(f,16):void 0,c=r.map(i),u=n.map(i);return c.some(f=>f===void 0)||u.some(f=>f===void 0)?St(e,\"segments must contain one through four hexadecimal digits\"):B([...c,...Array(8-a).fill(0),...u,...s??[]])},gp=e=>Dt(t3(e),t=>e3(t)),yp=e=>e.includes(\":\")?gp(e):ku(e);var kT=e=>mp(oo(e)),r3=e=>{let{w0:t,w1:r,w2:n,w3:o}=so(e);return[t>>>16,t&65535,r>>>16,r&65535,n>>>16,n&65535,o>>>16,o&65535]},DN=e=>{let{w0:t,w1:r,w2:n,w3:o}=so(e);return[...mp(t),...mp(r),...mp(n),...mp(o)]};var vT=e=>Array.from(Cs(e),t=>t.toString(16).padStart(2,\"0\")).join(\":\"),ix=e=>Cs(e).every(t=>t===255),n3=e=>(Cs(e)[0]&1)!==0,cx=e=>(Cs(e)[0]&1)===0,OT=e=>(Cs(e)[0]&2)!==0,_T=e=>(Cs(e)[0]&2)===0;var ao=e=>{if(xr(e))return kT(e).join(\".\");let t=r3(e);if(o3(e))return`::ffff:${t[6]>>8}.${t[6]&255}.${t[7]>>8}.${t[7]&255}`;let r=-1,n=0,o=-1;for(let i=0;i<=8;i++)i<8&&t[i]===0?o===-1&&(o=i):o!==-1&&(i-o>n&&(r=o,n=i-o),o=-1);if(n<2)return t.map(i=>i.toString(16)).join(\":\");let s=t.slice(0,r).map(i=>i.toString(16)).join(\":\"),a=t.slice(r+n).map(i=>i.toString(16)).join(\":\");return`${s}::${a}`},ux=e=>{if(xr(e))return oo(e)===0;let{w0:t,w1:r,w2:n,w3:o}=so(e);return t===0&&r===0&&n===0&&o===0},RT=e=>{if(xr(e))return oo(e)>>>24===127;let{w0:t,w1:r,w2:n,w3:o}=so(e);return t===0&&r===0&&n===0&&o===1},vu=e=>Au(e)?n3(e):xr(e)?oo(e)>>>28===14:so(e).w0>>>24===255,fx=e=>Au(e)?ix(e):oo(e)===4294967295,PT=e=>Au(e)?cx(e):!vu(e)&&!ux(e)&&(!xr(e)||!fx(e)),MT=e=>xr(e)?oo(e)>>>16===43518:(so(e).w0>>>16&65472)===65152,FT=e=>{let t=oo(e);return t>>>24===10||(t>>>16&65520)===44048||t>>>16===49320},NT=e=>(so(e).w0>>>24&254)===252,o3=e=>{let{w0:t,w1:r,w2:n}=so(e);return t===0&&r===0&&n===65535};var s3={_tag:\"InetAddressV4\",[gn]:gn,[ae](e){return hp(e)&&this.port===e.port&&W(this.address,e.address)},[se](){return fe(H(this.address),It(this.port))},toString(){return lx(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},a3={_tag:\"InetAddressV6\",[gn]:gn,[ae](e){return xp(e)&&this.port===e.port&&this.scopeId===e.scopeId&&W(this.address,e.address)},[se](){return fe(fe(H(this.address),It(this.port)),It(this.scopeId))},toString(){return lx(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},LN=e=>Number.isInteger(e)&&e>=0&&e<=65535,i3=(e,t)=>{if(!LN(t))return St(e,\"port must be an integer from 0 through 65535\");let r=Object.create(s3);return r.address=e,r.port=t,B(Object.freeze(r))},c3=(e,t,r)=>{if(!LN(t))return St(e,\"port must be an integer from 0 through 65535\");let n=r?.scopeId??0;if(!Number.isInteger(n)||n<0||n>4294967295)return St(e,\"scopeId must be an unsigned 32-bit integer\");let o=Object.create(a3);return o.address=e,o.port=t,o.scopeId=n,B(Object.freeze(o))};var $N=e=>{let t,r,n=0,o=e.startsWith(\"[\");if(o){let s=e.indexOf(\"]\");if(s<0||e[s+1]!==\":\"||e.indexOf(\"]\",s+1)!==-1)return St(e,\"expected [IPv6]:port\");t=e.slice(1,s),r=e.slice(s+2);let a=t.indexOf(\"%\");if(a!==-1){let i=t.slice(a+1);if(t.indexOf(\"%\",a+1)!==-1||!/^\\d+$/.test(i))return St(e,\"scope identifier must be decimal\");if(n=Number(i),!Number.isInteger(n)||n>4294967295)return St(e,\"scope identifier must be an unsigned 32-bit integer\");t=t.slice(0,a)}}else{let s=e.lastIndexOf(\":\");if(s<0)return St(e,\"expected host:port or [IPv6]:port\");if(e.indexOf(\":\")!==s)return St(e,\"IPv6 addresses must be bracketed\");t=e.slice(0,s),r=e.slice(s+1)}return/^(0|[1-9]\\d*)$/.test(r)?Dt(yp(t),s=>o!==Vo(s)?St(e,\"only IPv6 addresses use brackets\"):Vo(s)?c3(s,Number(r),{scopeId:n}):i3(s,Number(r))):St(e,\"port must be an unpadded decimal integer\")};var u3=e=>ao(e.address)+(xp(e)&&e.scopeId!==0?`%${e.scopeId}`:\"\");var lx=e=>{let t=u3(e);return hp(e)?`${t}:${e.port}`:`[${t}]:${e.port}`};var f3={_tag:\"UnixPathAddress\",[gn]:gn,[ae](e){return ax(e)&&this.path===e.path},[se](){return fe(_e(\"UnixPathAddress\"),_e(this.path))},toString(){return this.path},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},BN=e=>{let t=Object.create(f3);return t.path=e,Object.freeze(t)};var DT=\"~effect/net/IpInterface\",jN=e=>Sp(e)&&xr(e.address),zN=e=>Sp(e)&&Vo(e.address),Sp=e=>A(e,DT),l3={_tag:\"IpInterface\",[DT]:DT,[ae](e){return Sp(e)&&this.prefixLength===e.prefixLength&&W(this.address,e.address)},[se](){return fe(H(this.address),It(this.prefixLength))},toString(){return Ep(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},LT=(e,t)=>K(new Di({input:e,message:t})),bp=(e,t)=>{let r=Cu(e);if(!Number.isInteger(t)||t<0||t>r)return LT(e,`prefix length must be an integer from 0 through ${r}`);let n=Object.assign(Object.create(l3),{address:e,prefixLength:t});return B(Object.freeze(n))},$T=(e,t)=>{let r=e.indexOf(\"/\");if(r===-1&&t?.prefix!==\"required\")return B({address:e,prefixLength:void 0});if(r<=0||r!==e.lastIndexOf(\"/\")||r===e.length-1)return LT(e,\"expected an address and prefix length separated by one slash\");let n=e.slice(r+1);return/^(0|[1-9][0-9]*)$/.test(n)?B({address:e.slice(0,r),prefixLength:Number(n)}):LT(e,\"prefix length must be an unpadded ASCII decimal integer\")},px=(e,t)=>Dt($T(e,t),r=>Dt(ku(r.address),n=>bp(n,r.prefixLength??Cu(n)))),dx=(e,t)=>Dt($T(e,t),r=>Dt(gp(r.address),n=>bp(n,r.prefixLength??Cu(n)))),mx=(e,t)=>Dt($T(e,t),r=>Dt(yp(r.address),n=>bp(n,r.prefixLength??Cu(n))));var Ep=e=>`${ao(e.address)}/${e.prefixLength}`;var BT=\"~effect/net/IpNetwork\",HN=e=>Ip(e)&&xr(e.address),WN=e=>Ip(e)&&Vo(e.address),Ip=e=>A(e,BT),p3={_tag:\"IpNetwork\",[BT]:BT,[ae](e){return Ip(e)&&this.prefixLength===e.prefixLength&&W(this.address,e.address)},[se](){return fe(H(this.address),It(this.prefixLength))},toString(){return Tp(this)},toJSON(){return this.toString()},[Ie](){return this.toJSON()}},d3=e=>{let t=Object.assign(Object.create(p3),{address:e.address,prefixLength:e.prefixLength});return Object.freeze(t)},m3=e=>xr(e)?kT(e):DN(e);var h3=(e,t)=>{let r=Math.floor(t/8),n=t%8;return e.map((o,s)=>sDt(bp(e,t),r=>{let n=m3(e),o=h3(n,t);return n.some((s,a)=>s!==o[a])?K(new Di({input:e,message:\"address has non-zero host bits\"})):B(d3(r))});var JN=e=>Dt(px(e,{prefix:\"required\"}),t=>jT(t.address,t.prefixLength)),KN=e=>Dt(dx(e,{prefix:\"required\"}),t=>jT(t.address,t.prefixLength)),GN=e=>Dt(mx(e,{prefix:\"required\"}),t=>jT(t.address,t.prefixLength));var Tp=e=>`${ao(e.address)}/${e.prefixLength}`;var wp=Vh;function qr(){return(e,t,r)=>q(new pu(e.map(rp),n=>t(n.map(o=>q(o))),r))}function Be(e,t){return qr()([],()=>(r,n,o)=>e(r)?g(r):P(new ut(n,r,o)),t)}function g3(e){return e}function y3(e){return t=>t.annotate(e)}function S3(e){return t=>zT(zT(t).annotate(e))}function b3(e){return t=>t.rebuild(ap(t.ast,e))}function E3(e){return e}var As=class extends Fr(\"SchemaError\"){[Tu]=Tu;constructor(t){let r=Co();Qr(0);try{super({issue:t})}finally{Qr(r)}}get message(){return CP(this.issue)}toString(){return`SchemaError(${this.message})`}};function cU(e){return MN(e)}function uU(e){return De(e)?KT(e):xt(e,t=>Ss(()=>ms(t,r=>new As(r))))}function KT(e){return Ke(e)?e:Ur(ms(e.cause,t=>new As(t)))}function fU(e,t){let r;for(let n of e.reasons){if(!fl(n)||!cU(n.error))throw new globalThis.Error(t,{cause:e});r??=n.error}if(r===void 0)throw new globalThis.Error(t,{cause:e});return r}function lU(e){return eh(e).then(t=>{if(Ke(t))return t.value;throw fU(t.cause,\"Promise adapter can only reject schema errors\")})}function pU(e){let t=qo(e);if(Ke(t))return t.value;throw fU(t.cause,\"Sync adapter can only throw schema errors\")}function I3(e,t){return fN(e,t)}function T3(e){return lN(e)}var w3=QI,C3=IF;function hx(e,t){let r=et(e,t);return(n,o)=>uU(r(n,o))}var A3=hx;function dU(e,t){let r=TF(e,t);return(n,o)=>KT(r(n,o))}var k3=dU,v3=eT,O3=wF;function mU(e,t){let r=CF(e,t);return(n,o)=>Fd(r(n,o),s=>new As(s))}var _3=mU;function hU(e,t){let r=hx(e,t);return(n,o)=>lU(r(n,o))}var R3=hU;function xU(e,t){let r=hx(e,t);return(n,o)=>pU(r(n,o))}var P3=xU;function xx(e,t){let r=Mi(e,t);return(n,o)=>uU(r(n,o))}var M3=xx;function gU(e,t){let r=kF(e,t);return(n,o)=>KT(r(n,o))}var F3=gU,N3=tT,U3=vF;function yU(e,t){let r=OF(e,t);return(n,o)=>Fd(r(n,o),s=>new As(s))}var D3=yU;function SU(e,t){let r=xx(e,t);return(n,o)=>lU(r(n,o))}var L3=SU;function bU(e,t){let r=xx(e,t);return(n,o)=>pU(r(n,o))}var $3=bU,q=to;function gx(e){return A(e,wp)&&e[wp]===wp}var $i=hr(e=>q(Ri(e.ast),{schema:e})),B3=hr(e=>e.schema),Pu=hr(e=>{let t=bx(e);return q(eF(e.ast),{schema:t})}),j3=hr(e=>e.schema.members[0]),z3=hr(e=>q($I(e.ast),{schema:e})),q3=hr(e=>e.schema),Hr=hr(e=>q(yt(e.ast),{schema:e})),Mu=hr(e=>q(mn(e.ast),{schema:e})),Cp=\"~effect/Schema/flip\";function H3(e){return A(e,Cp)&&e[Cp]===Cp}function zT(e){return H3(e)?e.schema.rebuild(dn(e.ast)):q(dn(e.ast),{[Cp]:Cp,schema:e})}function wt(e){let t=q(new pn(e),{literal:e,transform(r){return t.pipe(G(wt(r),{decode:oe(()=>r),encode:oe(()=>e)}))}});return t}function EU(e){return e.map(t=>gx(t)?t.ast:new pn(t))}function W3(e){return q(new AI(EU(e)),{parts:e})}function J3(e){return q(FM(EU(e)),{parts:e})}function K3(e){return q(new MM(Object.keys(e).filter(t=>typeof e[e[t]]!=\"number\").map(t=>[t,e[t]])),{enums:e})}var G3=q(CI),V3=q(RM),Ap=q(Yn),yx=q(TI),GT=q(wI),J=q(ln),Z3=J,ji=q(kI),VT=q(DM),IU=q(LM),Fu=q($M),Y3=q(_M),Q3=q(PM);function X3(e){return q(new UM(e))}function ZT(e,t){return q(e,{fields:t,mapFields(r,n){let o=r(this.fields);return ZT(Ph(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Me(e){return ZT(Ph(e,void 0),e)}function eV(e){return hr(t=>t.mapFields(wN(e)))}var tV=e=>typeof e==\"symbol\"?e:globalThis.String(e);function rV(e){return function(t){let r={},n=Object.create(null),o=Object.create(null),s=new Set;for(let a of Reflect.ownKeys(t.fields)){let i=Mu(t.fields[a]),c=Object.hasOwn(e,a),u=c?e[a]:a,f=tV(u);if(s.has(f))throw new globalThis.Error(`Duplicate encoded keys: ${wo(u)}`);s.add(f),N(r,u,i),c&&(n[a]=u,o[u]=a)}return Me(r).pipe(G(t,Pe({decode:ST(o),encode:ST(n)})))}}function nV(e,t){return r=>{let n=Ka(r.fields,Hr),o=Me({...n,...e});return r.pipe(G(o,Pe({decode:s=>{let a={...s};for(let i in e){let c=t[i],u=c(s);Oe(u)&&N(a,i,u.value)}return a},encode:s=>{let a={...s};for(let i in e)delete a[i];return a}})))}}function ks(e,t){return q(rF(e.ast,t.ast),{key:e,value:t})}function oV(e,t){return q(HM(e.ast,t.map(rp)),{schema:e,records:t})}function TU(e,t){return q(e,{elements:t,mapElements(r,n){let o=r(this.elements);return TU(RI(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Zo(e){return TU(RI(e),e)}function sV(e,t){return q(WM(e.ast,t.map(rp)),{schema:e,rest:t})}var $e=hr(e=>q(new Rn(!1,[],[e.ast]),{value:e}));function Sx(e,t,r){return t!==void 0&&r!==void 0?e.check(nw(t,r)):t!==void 0?e.check(qU(t)):r!==void 0?e.check(JU(r)):e}var YT=hr(e=>q(new Rn(!1,[e.ast],[e.ast]),{value:e}));function aV(e){let t=$e(e),r=$e(Hr(e)),n=G(Zo([Ap]),Pe({decode:o=>[o],encode:([o])=>o}))(e);return q(st([n,t]).pipe(G(r)).ast,{from:st([e,t]),to:r})}function iV(e){return $e(e).check(sw())}var cV=hr(e=>q(JM(e.ast),{schema:e}));function wU(e,t){return q(e,{members:t,mapMembers(r,n){let o=r(this.members);return wU(Mh(o,this.ast.options,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function st(e,t){return wU(Mh(e,t,void 0),e)}function io(e){let t=e.map(wt);return q(Mh(t,void 0,void 0),{literals:e,members:t,mapMembers(r){return st(r(this.members))},pick(r){return io(r)},transform(r){return st(t.map((n,o)=>n.transform(r[o])))}})}var QT=hr(e=>st([e,yx])),bx=hr(e=>st([e,GT])),CU=hr(e=>st([e,yx,GT]));function AU(e){return q(new MI(()=>e().ast))}function uV(...e){return t=>t.check(...e)}function kU(e,t){return r=>q(Ko(r.ast,[Nh(e,t)]),{schema:r})}function vU(e){return t=>q(t.ast,{schema:t,identifier:e})}function fV(e,t){return r=>(t.checks?r.check(...t.checks):r).pipe(vU(e))}function OU(e){return t=>q(QM(t.ast,new wh(e,R)),{schema:t})}function _U(e){return t=>q(XM(t.ast,new wh(R,e)),{schema:t})}function lV(e){return RU(e)}function RU(e){return t=>OU(Zc(e))(t)}function pV(e){return PU(e)}function PU(e){return t=>_U(Zc(e))(t)}function G(e,t){return r=>q(da(r.ast,e.ast,t?Ch(t):su()),{from:r,to:e})}function Nu(){return(e,t)=>Ae()(e,{decode:t,encode:_P})}var MU=io([\"true\",\"yes\",\"on\",\"1\",\"y\"]),FU=io([\"false\",\"no\",\"off\",\"0\",\"n\"]),XT=io([...MU.literals,...FU.literals]).pipe(G(VT,Pe({decode:e=>e===\"true\"||e===\"yes\"||e===\"on\"||e===\"1\"||e===\"y\",encode:e=>e?\"true\":\"false\"})));function dV(e){return t=>G(Hr(t),e)(t)}function ew(e,t){return r=>t?G(r,t)(e):G(r)(e)}function mV(e){return t=>G(t,e)(Mu(t))}function NU(e){return t=>q(tF(t.ast,e),{schema:t})}function UU(e){return xt(e,t=>Ss(()=>ms(t,r=>r.issue)))}function tw(e,t){let r=t?.encodingStrategy===\"omit\"?sI():jr();return n=>$i(Mu(n)).pipe(G(n,{decode:aI(UU(e)),encode:r}))}function hV(e,t){return r=>Hr(r).pipe(tw(e,t),ew($i(r)))}function DU(e,t){let r=t?.encodingStrategy===\"omit\"?sI():jr();return n=>Pu(Mu(n)).pipe(G(n,{decode:aI(UU(e)),encode:r}))}function xV(e,t){return r=>Hr(r).pipe(DU(e,t),ew(Pu(r)))}function Bi(e){return wt(e).pipe(NU(g(e)))}function gV(e){return Bi(e).pipe(tw(g(e),{encodingStrategy:\"omit\"}))}function Ex(e,t){return Me({_tag:Bi(e),...t})}function LU(e){return t=>{let r={},n=[],o=new Set,s={},a=f=>p=>f.includes(p[e]);return i(t),Object.assign(t,{cases:r,discriminants:n,isAnyOf:a,guards:s,match:c,matchOrElse:u});function i(f){let p=f.ast;if(kM(p)&&\"members\"in f&&globalThis.Array.isArray(f.members)&&f.members.every(gx))return f.members.forEach(i);let d=uu(p);if(d.length>0){let m=d.find(x=>x.key===e)?.literal;if(od(m)){let x=typeof m==\"number\"?globalThis.String(m):m;if(o.has(x))throw new globalThis.Error(`Duplicate discriminant: ${globalThis.String(m)}`);o.add(x),n.push(m),N(r,m,f),N(s,m,QI(Hr(f)));return}}throw new globalThis.Error(\"No literal or unique symbol found\")}function c(){if(arguments.length===1){let x=arguments[0];return function(y){let S=y[e];return(Object.hasOwn(x,S)?x[S]:void 0)(y)}}let f=arguments[0],p=arguments[1],d=f[e];return(Object.hasOwn(p,d)?p[d]:void 0)(f)}function u(){if(arguments.length===2){let y=arguments[0],S=arguments[1];return function(w){let E=w[e];return(Object.hasOwn(y,E)?y[E]??S:S)(w)}}let f=arguments[0],p=arguments[1],d=arguments[2],m=f[e];return(Object.hasOwn(p,m)?p[m]??d:d)(f)}}}function yV(e){let t={},r=[];for(let c of Object.keys(e)){let u=Ex(c,e[c]);N(t,c,u),r.push(u)}let n=st(r),{guards:o,isAnyOf:s,match:a,matchOrElse:i}=LU(\"_tag\")(n);return q(n.ast,{cases:t,isAnyOf:s,guards:o,match:a,matchOrElse:i})}function SV(){return e=>e}function xa(e,t){return Be(r=>r instanceof e,t)}function Ae(){return(e,t)=>new ot(e.ast,Ch(t))}var Ne=Fh;function bV(e,t=void 0){return new ki(e,t)}var VN=\"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$\";function $U(e){let t=new globalThis.RegExp(VN);return Ne(r=>r.trim()===r,{expected:\"a string with no leading or trailing whitespace\",representation:{id:\"effect/schema/isTrimmed\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isTrimmed()\"}),arbitraryConstraint:{patterns:[{source:VN,flags:\"\"}]},...e})}function Uu(e,t){let r=e.source,n=e.flags,o=/^[dg]*uy?$/.test(n),s=n===\"\"?`new RegExp(${F(r)})`:`new RegExp(${F(r)}, ${F(n)})`;return op(e,{toJsonSchema:()=>o?{pattern:n.endsWith(\"y\")?`^(?:${r})`:r}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${s})`}),...t})}function EV(e){return zI({toCode:()=>({runtime:\"Schema.isStringFinite()\"}),...e})}function IV(e){return qI({toCode:()=>({runtime:\"Schema.isStringBigInt()\"}),...e})}function TV(e){return WI({toCode:()=>({runtime:\"Schema.isStringSymbol()\"}),...e})}var wV=e=>e?new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/;function CV(e,t){let r=wV(e);return Uu(r,{expected:e?`a UUID v${e}`:\"a UUID\",representation:{id:\"effect/schema/isUUID\",payload:{version:e??null}},toJsonSchema:()=>({pattern:r.source,format:\"uuid\"}),toCode:()=>({runtime:e===void 0?\"Schema.isUUID()\":`Schema.isUUID(${e})`}),...t})}var ZN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;function AV(e){return Uu(ZN,{expected:\"a GUID\",representation:{id:\"effect/schema/isGUID\",payload:null},toJsonSchema:()=>({pattern:ZN.source}),toCode:()=>({runtime:\"Schema.isGUID()\"}),...e})}function kV(e){let t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return Uu(t,{representation:{id:\"effect/schema/isULID\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isULID()\"}),...e})}function BU(e){let t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return Uu(t,{expected:\"a base64 encoded string\",representation:{id:\"effect/schema/isBase64\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isBase64()\"}),...e})}function vV(e){let t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return Uu(t,{expected:\"a base64url encoded string\",representation:{id:\"effect/schema/isBase64Url\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isBase64Url()\"}),...e})}function rw(e,t,r){if(e.length===0)return t.length===0?{}:[{},!0];let n={pattern:new globalThis.RegExp(r).source};return e===t?n:[n,!0]}function OV(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(`^${ws(e)}`),o=e.replace(/[\\uD800-\\uDBFF]$/,\"\");return Ne(s=>s.startsWith(e),{expected:`a string starting with ${r}`,representation:{id:\"effect/schema/isStartingWith\",payload:{startsWith:e}},toJsonSchema:()=>rw(o,e,`^${ws(o)}`),toCode:()=>({runtime:`Schema.isStartingWith(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}function _V(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(`${ws(e)}$`),o=e.replace(/^[\\uDC00-\\uDFFF]/,\"\");return Ne(s=>s.endsWith(e),{expected:`a string ending with ${r}`,representation:{id:\"effect/schema/isEndingWith\",payload:{endsWith:e}},toJsonSchema:()=>rw(o,e,`${ws(o)}$`),toCode:()=>({runtime:`Schema.isEndingWith(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}function RV(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(ws(e)),o=e.replace(/^[\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF]$/g,\"\");return Ne(s=>s.includes(e),{expected:`a string including ${r}`,representation:{id:\"effect/schema/isIncluding\",payload:{includes:e}},toJsonSchema:()=>rw(o,e,ws(o)),toCode:()=>({runtime:`Schema.isIncluding(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}var YN=\"^[^a-z]*$\";function PV(e){let t=new globalThis.RegExp(YN);return Ne(r=>r.toUpperCase()===r,{expected:\"a string with all characters in uppercase\",representation:{id:\"effect/schema/isUppercased\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isUppercased()\"}),arbitraryConstraint:{patterns:[{source:YN,flags:\"\"}]},...e})}var QN=\"^[^A-Z]*$\";function MV(e){let t=new globalThis.RegExp(QN);return Ne(r=>r.toLowerCase()===r,{expected:\"a string with all characters in lowercase\",representation:{id:\"effect/schema/isLowercased\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isLowercased()\"}),arbitraryConstraint:{patterns:[{source:QN,flags:\"\"}]},...e})}var XN=\"^(?:[^a-z][\\\\s\\\\S]*)?$\";function FV(e){let t=new globalThis.RegExp(XN);return Ne(r=>r.charAt(0).toUpperCase()===r.charAt(0),{expected:\"a string with the first character in uppercase\",representation:{id:\"effect/schema/isCapitalized\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isCapitalized()\"}),arbitraryConstraint:{patterns:[{source:XN,flags:\"\"}]},...e})}var eU=\"^(?:[^A-Z][\\\\s\\\\S]*)?$\";function NV(e){let t=new globalThis.RegExp(eU);return Ne(r=>r.charAt(0).toLowerCase()===r.charAt(0),{expected:\"a string with the first character in lowercase\",representation:{id:\"effect/schema/isUncapitalized\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isUncapitalized()\"}),arbitraryConstraint:{patterns:[{source:eU,flags:\"\"}]},...e})}var Du=q(NI),UV=FI;function kp(e){let t=gc(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value greater than ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n,exclusiveMinimum:!0},...e.annotate?.(n),...o})}function vp(e){let t=kd(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value greater than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n},...e.annotate?.(n),...o})}function Op(e){let t=Cd(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value less than ${r(n)}`,arbitraryConstraint:{order:e.order,maximum:n,exclusiveMaximum:!0},...e.annotate?.(n),...o})}function _p(e){let t=Ad(e.order),r=e.formatter??F;return(n,o)=>Ne(s=>t(s,n),{expected:`a value less than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,maximum:n},...e.annotate?.(n),...o})}function Rp(e){let t=kd(e.order),r=gc(e.order),n=Ad(e.order),o=Cd(e.order),s=e.formatter??F;return(a,i)=>{let c=a.exclusiveMinimum?r:t,u=a.exclusiveMaximum?o:n;return Ne(f=>c(f,a.minimum)&&u(f,a.maximum),{expected:`a value between ${s(a.minimum)}${a.exclusiveMinimum?\" (excluded)\":\"\"} and ${s(a.maximum)}${a.exclusiveMaximum?\" (excluded)\":\"\"}`,arbitraryConstraint:{order:e.order,minimum:a.minimum,maximum:a.maximum,...a.exclusiveMinimum&&{exclusiveMinimum:!0},...a.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(a),...i})}}function DV(e){return(t,r)=>{let n=e.formatter??F;return Ne(o=>e.remainder(o,t)===e.zero,{expected:`a value that is a multiple of ${n(t)}`,...e.annotate?.(t),...r})}}function Ou(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${F(e)}`);return e}var LV=kp({order:is,annotate:e=>({representation:{id:\"effect/schema/isGreaterThan\",payload:{exclusiveMinimum:Ou(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${F(e)})`})})}),jU=vp({order:is,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualTo\",payload:{minimum:Ou(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${F(e)})`})})}),$V=Op({order:is,annotate:e=>({representation:{id:\"effect/schema/isLessThan\",payload:{exclusiveMaximum:Ou(e)}},toJsonSchema:()=>({exclusiveMaximum:e}),toCode:()=>({runtime:`Schema.isLessThan(${F(e)})`})})}),BV=_p({order:is,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualTo\",payload:{maximum:Ou(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${F(e)})`})})}),Lu=Rp({order:is,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetween\",payload:{minimum:Ou(e.minimum),maximum:Ou(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>({[t?\"exclusiveMinimum\":\"minimum\"]:e.minimum,[r?\"exclusiveMaximum\":\"maximum\"]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${F(e.minimum)}, maximum: ${F(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}});function jV(e,t){if(!globalThis.Number.isFinite(e)||e===0)throw new globalThis.RangeError(`Expected a finite non-zero number, got ${globalThis.String(e)}`);return e=globalThis.Math.abs(e),Ne(r=>S_(r,e)===0,{expected:`a value that is a multiple of ${e}`,representation:{id:\"effect/schema/isMultipleOf\",payload:{divisor:e}},toJsonSchema:()=>({multipleOf:e}),toCode:()=>({runtime:`Schema.isMultipleOf(${F(e)})`}),...t})}function Ix(e){return Ne(t=>globalThis.Number.isSafeInteger(t),{expected:\"an integer\",representation:{id:\"effect/schema/isInt\",payload:null},toJsonSchema:()=>[{type:\"integer\"},!0],toCode:()=>({runtime:\"Schema.isInt()\"}),arbitraryConstraint:{number:\"integer\"},...e})}var co=ji.check(Ix()),Li=co.check(jU(0));function zV(e){return new ki([Ix(),Lu({minimum:-2147483648,maximum:2147483647})],{expected:\"a 32-bit integer\",...e})}function qV(e){return new ki([Ix(),Lu({minimum:0,maximum:4294967295})],{expected:\"a 32-bit unsigned integer\",...e})}function _u(e){if(globalThis.Number.isNaN(e.getTime()))throw new globalThis.RangeError(`Expected a valid Date, got ${F(e)}`);return e.toISOString()}function Ru(e){return`new Date(${F(e.getTime())})`}var HV=kp({order:xc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanDate\",payload:{exclusiveMinimum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanDate(${Ru(e)})`})})}),WV=vp({order:xc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualToDate\",payload:{minimum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToDate(${Ru(e)})`})})}),JV=Op({order:xc,annotate:e=>({representation:{id:\"effect/schema/isLessThanDate\",payload:{exclusiveMaximum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanDate(${Ru(e)})`})})}),KV=_p({order:xc,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualToDate\",payload:{maximum:_u(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanOrEqualToDate(${Ru(e)})`})})}),GV=Rp({order:xc,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetweenDate\",payload:{minimum:_u(e.minimum),maximum:_u(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenDate({ minimum: ${Ru(e.minimum)}, maximum: ${Ru(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}}),VV=kp({order:hc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanBigInt\",payload:{exclusiveMinimum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanBigInt(${F(e)})`})})}),zU=vp({order:hc,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualToBigInt\",payload:{minimum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToBigInt(${F(e)})`})})}),ZV=Op({order:hc,annotate:e=>({representation:{id:\"effect/schema/isLessThanBigInt\",payload:{exclusiveMaximum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanBigInt(${F(e)})`})})}),YV=_p({order:hc,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualToBigInt\",payload:{maximum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanOrEqualToBigInt(${F(e)})`})})}),QV=Rp({order:hc,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetweenBigInt\",payload:{minimum:e.minimum.toString(10),maximum:e.maximum.toString(10),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenBigInt({ minimum: ${F(e.minimum)}, maximum: ${F(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}});function qU(e,t){return e=gr(e),HU(e,Math.ceil(e/2),t)}function HU(e,t,r){return Ne(n=>n.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:\"effect/schema/isMinLength\",payload:{minLength:e}},toJsonSchema:({type:n})=>n===\"string\"?e<=1?{minLength:t}:[{minLength:t},!0]:n===\"array\"?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Lr]:!0,arbitraryConstraint:{minLength:e},...r})}function WU(e){return HU(1,1,e)}function JU(e,t){return e=gr(e),Ne(r=>r.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:\"effect/schema/isMaxLength\",payload:{maxLength:e}},toJsonSchema:({type:r})=>r===\"string\"?e===0?{maxLength:e}:[{maxLength:e},!0]:r===\"array\"?{maxItems:e}:r===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[Lr]:!0,arbitraryConstraint:{maxLength:e},...t})}function nw(e,t,r){return e=gr(e),t=gr(t),Ne(n=>n.length>=e&&n.length<=t,{expected:e===t?`a value with a length of ${e}`:`a value with a length between ${e} and ${t}`,representation:{id:\"effect/schema/isBetweenLength\",payload:{minimum:e,maximum:t}},toJsonSchema:({type:n})=>n===\"string\"?t===0||Math.ceil(e/2)>t?{minLength:Math.ceil(e/2),maxLength:t}:[{minLength:Math.ceil(e/2),maxLength:t},!0]:n===\"array\"?{minItems:e,maxItems:t}:n===void 0?[{minLength:Math.ceil(e/2),maxLength:t,minItems:e,maxItems:t},!0]:[{},!0],toCode:()=>({runtime:`Schema.isBetweenLength(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minLength:e,maxLength:t},...r})}function XV(e,t){return e=gr(e),Ne(r=>ow(r,e)>=e,{expected:`a string with at least ${e} code points`,representation:{id:\"effect/schema/isMinCodePoints\",payload:{minCodePoints:e}},toJsonSchema:()=>({minLength:e}),toCode:()=>({runtime:`Schema.isMinCodePoints(${e})`}),arbitraryConstraint:{minCodePoints:e},...t})}function eZ(e,t){return e=gr(e),Ne(r=>ow(r,e+1)<=e,{expected:`a string with at most ${e} code points`,representation:{id:\"effect/schema/isMaxCodePoints\",payload:{maxCodePoints:e}},toJsonSchema:()=>({maxLength:e}),toCode:()=>({runtime:`Schema.isMaxCodePoints(${e})`}),arbitraryConstraint:{maxCodePoints:e},...t})}function tZ(e,t,r){return e=gr(e),t=gr(t),Ne(n=>{let o=ow(n,t+1);return o>=e&&o<=t},{expected:e===t?`a string with ${e} code points`:`a string with between ${e} and ${t} code points`,representation:{id:\"effect/schema/isBetweenCodePoints\",payload:{minimum:e,maximum:t}},toJsonSchema:()=>({allOf:[{minLength:e},{maxLength:t}]}),toCode:()=>({runtime:`Schema.isBetweenCodePoints(${e}, ${t})`}),arbitraryConstraint:{minCodePoints:e,maxCodePoints:t},...r})}function ow(e,t){if(t===0)return 0;let r=0;for(let n of e)if(++r>=t)break;return r}function gr(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}function rZ(e,t){return e=gr(e),Ne(r=>r.size>=e,{expected:`a value with a size of at least ${e}`,representation:{id:\"effect/schema/isMinSize\",payload:{minSize:e}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isMinSize(${e})`}),[Lr]:!0,arbitraryConstraint:{minSize:e},...t})}function nZ(e,t){return e=gr(e),Ne(r=>r.size<=e,{expected:`a value with a size of at most ${e}`,representation:{id:\"effect/schema/isMaxSize\",payload:{maxSize:e}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isMaxSize(${e})`}),[Lr]:!0,arbitraryConstraint:{maxSize:e},...t})}function oZ(e,t,r){return e=gr(e),t=gr(t),Ne(n=>n.size>=e&&n.size<=t,{expected:e===t?`a value with a size of ${e}`:`a value with a size between ${e} and ${t}`,representation:{id:\"effect/schema/isBetweenSize\",payload:{minimum:e,maximum:t}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenSize(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minSize:e,maxSize:t},...r})}function sZ(e,t){return e=gr(e),Ne(r=>Reflect.ownKeys(r).length>=e,{expected:`a value with at least ${e===1?\"1 entry\":`${e} entries`}`,representation:{id:\"effect/schema/isMinProperties\",payload:{minProperties:e}},toJsonSchema:({type:r})=>r===\"object\"?{minProperties:e}:[{minProperties:e},!0],toCode:()=>({runtime:`Schema.isMinProperties(${e})`}),[Lr]:!0,arbitraryConstraint:{minProperties:e},...t})}function aZ(e,t){return e=gr(e),Ne(r=>Reflect.ownKeys(r).length<=e,{expected:`a value with at most ${e===1?\"1 entry\":`${e} entries`}`,representation:{id:\"effect/schema/isMaxProperties\",payload:{maxProperties:e}},toJsonSchema:({type:r})=>r===\"object\"?{maxProperties:e}:[{maxProperties:e},!0],toCode:()=>({runtime:`Schema.isMaxProperties(${e})`}),[Lr]:!0,arbitraryConstraint:{maxProperties:e},...t})}function iZ(e,t,r){return e=gr(e),t=gr(t),Ne(n=>Reflect.ownKeys(n).length>=e&&Reflect.ownKeys(n).length<=t,{expected:e===t?`a value with exactly ${e===1?\"1 entry\":`${e} entries`}`:`a value with between ${e} and ${t} entries`,representation:{id:\"effect/schema/isBetweenProperties\",payload:{minimum:e,maximum:t}},toJsonSchema:({type:n})=>n===\"object\"?{minProperties:e,maxProperties:t}:[{minProperties:e,maxProperties:t},!0],toCode:()=>({runtime:`Schema.isBetweenProperties(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minProperties:e,maxProperties:t},...r})}function cZ(e,t){let r=Mu(e),n=EF(r.ast);return Ne((o,s,a)=>{let i=Reflect.ownKeys(o),c=[];for(let u of i){let f=n(u,a);if(f!==void 0&&(c.push(new ct([u],f)),a.errors===\"first\"))break}return rr(c)?new Tt(s,c,o,a):!0},{expected:\"an object with property names matching the schema\",representation:{id:\"effect/schema/isPropertyNames\",payload:null,schemas:[r.ast]},toJsonSchema:({schemas:o,type:s})=>s===\"object\"?{propertyNames:o[0]}:[{propertyNames:o[0]},!0],toCode:({schemas:o})=>({runtime:`Schema.isPropertyNames(${o[0].runtime})`}),[Lr]:!0,...t})}function sw(e){return Ne(t=>$d(t).length===t.length,{expected:\"an array with unique items\",representation:{id:\"effect/schema/isUnique\",payload:null},toJsonSchema:()=>({uniqueItems:!0}),toCode:()=>({runtime:\"Schema.isUnique()\"}),arbitraryConstraint:{uniqueBy:R},...e})}function KU(e){return Ne(t=>$d(t.map(([r])=>r)).length===t.length,{expected:\"an array with unique keys\",representation:{id:\"effect/schema/isUniqueKey\",payload:null},toCode:()=>({runtime:\"Schema.isUniqueKey()\"}),arbitraryConstraint:{uniqueBy:t=>t[0]},...e})}var aw=J.check(WU()),uZ=J.check(nw(1,1)),GU=e=>(e?.includeStack===!0?1:0)|(e?.excludeCause===!0?2:0),VU=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},tU=[];function fZ(e){let t=GU(e),r=tU[t];if(r!==void 0)return r;let n=VU(t),o=xa(globalThis.Error,{representation:{id:\"effect/schema/Error\",payload:n??null},toCode:()=>({runtime:n!==void 0?`Schema.ErrorInstance(${F(n)})`:\"Schema.ErrorInstance()\",Type:\"globalThis.Error\"}),expected:\"Error\",toCodecJson:()=>Ae()(M8,aM(n))});return tU[t]=o,o}var rU=[];function lZ(e){let t=GU(e),r=rU[t];if(r!==void 0)return r;let n=Ox.pipe(G(Ap,iM(VU(t))));return rU[t]=n,n}function pZ(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(Zo([n,o]));return(a,i,c)=>a instanceof globalThis.Map?Kt(et(s)([...a],c),{onSuccess:u=>new globalThis.Map(u),onFailure:u=>Br(i,\"entries\",u,a,c)}):P(new ut(i,a,c))},{representation:{id:\"effect/schema/ReadonlyMap\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.ReadonlyMap(${n[0].runtime}, ${n[1].runtime})`,Type:`globalThis.ReadonlyMap<${n[0].Type}, ${n[1].Type}>`}),expected:\"ReadonlyMap\",toCodec:([n,o])=>Ae()($e(Zo([n,o])),Pe({decode:s=>new globalThis.Map(s),encode:s=>[...s.entries()]}))});return q(r.ast,{key:e,value:t})}function dZ(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>o instanceof globalThis.Set?Kt(et(n)([...o],a),{onSuccess:i=>new globalThis.Set(i),onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ut(s,o,a))},{representation:{id:\"effect/schema/ReadonlySet\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.ReadonlySet(${r[0].runtime})`,Type:`globalThis.ReadonlySet<${r[0].Type}>`}),expected:\"ReadonlySet\",toCodec:([r])=>Ae()($e(r),Pe({decode:n=>new globalThis.Set(n),encode:n=>[...n.values()]}))});return q(t.ast,{value:e})}var mZ=xa(globalThis.RegExp,{representation:{id:\"effect/schema/RegExp\",payload:null},toCode:()=>({runtime:\"Schema.RegExp\",Type:\"globalThis.RegExp\"}),expected:\"RegExp\",toCodecJson:()=>Ae()(Me({source:J,flags:J}),Vt({decode:(e,t)=>Jc({try:()=>new globalThis.RegExp(e.source,e.flags),catch:()=>new de({expected:\"valid RegExp source and flags\"},e,t)}),encode:e=>g({source:e.source,flags:e.flags})}))}),ZU=J.annotate({expected:\"a string that will be decoded as a URL\"}),Tx=xa(globalThis.URL,{representation:{id:\"effect/schema/URL\",payload:null},toCode:()=>({runtime:\"Schema.URL\",Type:\"globalThis.URL\"}),expected:\"URL\",toCodecJson:()=>Ae()(ZU,lI)}),hZ=ZU.pipe(G(Tx,lI)),YU=J.annotate({expected:\"a string that will be decoded as a Date\"}),$u=Be(e=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:\"effect/schema/Date\",payload:null},toCode:()=>({runtime:\"Schema.Date\",Type:\"globalThis.Date\"}),expected:\"a valid Date\",toCodecJson:()=>Ae()(YU,uI)}),xZ=YU.pipe(G($u,uI)),gZ=co.pipe(G($u,eM)),yZ=J.annotate({expected:\"a string that will be decoded as JSON\",contentMediaType:\"application/json\"});function iw(e,t){return yZ.pipe(G(e,gM(t)))}var SZ=iw(Ap),QU=xa(globalThis.File,{representation:{id:\"effect/schema/File\",payload:null},toCode:()=>({runtime:\"Schema.File\",Type:\"globalThis.File\"}),expected:\"File\",toCodecJson:()=>Ae()(Me({data:J.check(BU()),type:J,name:J,lastModified:co}),Vt({decode:(e,t)=>Ar(gi(e.data),{onFailure:()=>P(new de({expected:\"a valid Base64 string\"},e.data,t)),onSuccess:r=>{let n=new globalThis.Uint8Array(r);return g(new globalThis.File([n],e.name,{type:e.type,lastModified:e.lastModified}))}}),encode:(e,t)=>Hc({try:async()=>{let r=new globalThis.Uint8Array(await e.arrayBuffer());return{data:Xc(r),type:e.type,name:e.name,lastModified:e.lastModified}},catch:()=>new de({expected:\"a readable File\"},e,t)})}))}),XU=xa(globalThis.FormData,{representation:{id:\"effect/schema/FormData\",payload:null},toCode:()=>({runtime:\"Schema.FormData\",Type:\"globalThis.FormData\"}),expected:\"FormData\",toCodecJson:()=>Ae()($e(Zo([J,st([Me({_tag:Bi(\"String\"),value:J}),Me({_tag:Bi(\"File\"),value:QU})])])),Vt({decode:e=>{let t=new globalThis.FormData;for(let[r,n]of e)t.append(r,n.value);return g(t)},encode:e=>g(globalThis.Array.from(e.entries()).map(([t,r])=>typeof r==\"string\"?[t,{_tag:\"String\",value:r}]:[t,{_tag:\"File\",value:r}]))}))});function bZ(e){return XU.pipe(G(e,yM))}var eD=xa(globalThis.URLSearchParams,{representation:{id:\"effect/schema/URLSearchParams\",payload:null},toCode:()=>({runtime:\"Schema.URLSearchParams\",Type:\"globalThis.URLSearchParams\"}),expected:\"URLSearchParams\",toCodecJson:()=>Ae()(J.annotate({expected:\"a query string that will be decoded as URLSearchParams\"}),Pe({decode:e=>new globalThis.URLSearchParams(e),encode:e=>e.toString()}))});function EZ(e){return eD.pipe(G(e,SM))}var IZ=J.annotate({expected:\"a string that will be decoded as a number\"}).pipe(G(ji,au)),TZ=J.annotate({expected:\"a string that will be decoded as a finite number\"}).pipe(G(Du,au)),wZ=q(HI).pipe(G(Fu,kh)),tD=J.check($U()),CZ=J.annotate({expected:\"a string that will be decoded as a trimmed string\"}).pipe(G(tD,QP())),AZ=J.annotate({expected:\"a base64 encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,dM)),kZ=J.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,mM)),vZ=J.annotate({expected:\"a hex encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,hM)),OZ=J.annotate({expected:\"a URI component encoded string that will be decoded as a UTF-8 string\"}).pipe(G(J,xM)),qT=st([Du,IU,J]),_Z=Me({issues:$e(Me({message:J,path:Pu($e(st([qT,Me({key:qT})])))}))}),RZ=io([0,1]).pipe(G(VT,Pe({decode:e=>e===1,encode:e=>e?1:0}))),rD=J.annotate({expected:\"a base64 encoded string that will be decoded as Uint8Array\",format:\"byte\",contentEncoding:\"base64\"}),wx=xa(globalThis.Uint8Array,{representation:{id:\"effect/schema/Uint8Array\",payload:null},toCode:()=>({runtime:\"Schema.Uint8Array\",Type:\"globalThis.Uint8Array\"}),expected:\"Uint8Array\",toCodecJson:()=>Ae()(rD,pI)}),PZ=rD.pipe(G(wx,pI)),MZ=J.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a Uint8Array\"}).pipe(G(wx,{decode:BP(),encode:Ih()})),FZ=J.annotate({expected:\"a hex encoded string that will be decoded as a Uint8Array\"}).pipe(G(wx,{decode:zP(),encode:Th()})),nD=Vt({decode:(e,t)=>{let r=rR(e);return ue(r)?P(new de({expected:\"a valid BigDecimal string\"},e,t)):g(r.value)},encode:e=>g(Es(e))}),NZ=kp({order:Yc,formatter:e=>Es(e)}),UZ=vp({order:Yc,formatter:e=>Es(e)}),DZ=Op({order:Yc,formatter:e=>Es(e)}),LZ=_p({order:Yc,formatter:e=>Es(e)}),$Z=Rp({order:Yc,formatter:e=>Es(e)}),oD=J.annotate({expected:\"a string that will be decoded as a BigDecimal\"}),sD=Be(nE,{representation:{id:\"effect/schema/BigDecimal\",payload:null},toCode:()=>({runtime:\"Schema.BigDecimal\",Type:\"BigDecimal.BigDecimal\",importDeclarations:['import * as BigDecimal from \"effect/BigDecimal\"']}),expected:\"BigDecimal\",toCodecJson:()=>Ae()(oD,nD),toFormatter:()=>e=>Es(e)}),BZ=oD.pipe(G(sD,nD)),Bu=Be(pR,{representation:{id:\"effect/schema/ByteSize\",payload:null},toCode:()=>({runtime:\"Schema.ByteSize\",Type:\"ByteSize.ByteSize\",importDeclarations:['import * as ByteSize from \"effect/ByteSize\"']}),expected:\"ByteSize\",toCodecJson:()=>Ae()(Fu.check(zU(globalThis.BigInt(0))),Pe({decode:lR,encode:nh})),toCodecStringTree:()=>Ae()(aD,fI)}),aD=J.annotate({expected:\"a string that will be decoded as a ByteSize\"}),jZ=aD.pipe(G(Bu,fI)),zZ=Fu.pipe(G(Bu,tM)),qZ=ji.pipe(G(Bu,rM));function HT(e,t){let r=qr()([e,t],([n,o])=>(s,a,i)=>{if(!ZS(s))return P(new ut(a,s,i));switch(s._tag){case\"Fail\":return Kt(et(n)(s.error,i),{onSuccess:km,onFailure:c=>Br(a,\"error\",c,s,i)});case\"Die\":return Kt(et(o)(s.defect,i),{onSuccess:vm,onFailure:c=>Br(a,\"defect\",c,s,i)});case\"Interrupt\":return g(s)}},{representation:{id:\"effect/schema/CauseReason\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.CauseReason(${n[0].runtime}, ${n[1].runtime})`,Type:`Cause.Failure<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause.Failure\",toCodec:([n,o])=>Ae()(st([Me({_tag:wt(\"Fail\"),error:n}),Me({_tag:wt(\"Die\"),defect:o}),Me({_tag:wt(\"Interrupt\"),fiberId:bx(Du)})]),Pe({decode:s=>{switch(s._tag){case\"Fail\":return km(s.error);case\"Die\":return vm(s.defect);case\"Interrupt\":return YS(s.fiberId)}},encode:s=>{switch(s._tag){case\"Fail\":return{_tag:\"Fail\",error:s.error};case\"Die\":return{_tag:\"Die\",defect:s.defect};case\"Interrupt\":return{_tag:\"Interrupt\",fiberId:s.fiberId}}}}))});return q(r.ast,{error:e,defect:t})}function WT(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(HT(n,o));return(a,i,c)=>VS(a)?Kt(et(s)(a.reasons,c),{onSuccess:Uc,onFailure:u=>Br(i,\"failures\",u,a,c)}):P(new ut(i,a,c))},{representation:{id:\"effect/schema/Cause\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Cause(${n[0].runtime}, ${n[1].runtime})`,Type:`Cause.Cause<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause\",toCodec:([n,o])=>Ae()($e(HT(n,o)),Pe({decode:Uc,encode:({reasons:s})=>s}))});return q(r.ast,{error:e,defect:t})}function nU(e){return Ae()(e,Pe({decode:lE,encode:Ve}))}function HZ(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>sh(o)?Kt(et(n)(Ve(o),a),{onSuccess:lE,onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ut(s,o,a))},{representation:{id:\"effect/schema/Chunk\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Chunk(${r[0].runtime})`,Type:`Chunk.Chunk<${r[0].Type}>`}),expected:\"Chunk\",toCodec:([r])=>nU($e(r)),toCodecArbitrary:({constraint:r,typeParameters:[n]})=>nU(Sx($e(n),r?.minLength,r?.maxLength)),toEquivalence:([r])=>uE(r)});return q(t.ast,{value:e})}function iD(){return gt((e,t)=>Ht(mE(e),{onNone:()=>P(new de({message:\"Invalid DateTime input\"},e,t)),onSome:r=>g(hE(r))}))}var WZ=Pe({decode:e=>gE(e),encode:e=>e.offset}),cD=Vt({decode:(e,t)=>Ht(kR(e),{onNone:()=>P(new de({expected:\"a valid IANA time zone\"},e,t)),onSome:g}),encode:e=>g(e.id)}),uD=Vt({decode:(e,t)=>Ht(vR(e),{onNone:()=>P(new de({expected:\"a valid time zone\"},e,t)),onSome:g}),encode:e=>g(Nl(e))}),fD=Vt({decode:(e,t)=>Ht(mE(e),{onNone:()=>P(new de({expected:\"a valid UTC DateTime string\"},e,t)),onSome:r=>g(hE(r))}),encode:e=>g(RR(e))}),lD=Vt({decode:(e,t)=>Ht(AR(e),{onNone:()=>P(new de({expected:\"a valid Zoned DateTime string\"},e,t)),onSome:g}),encode:e=>g(yE(e))}),pD=-864e13,dD=864e13,JZ=pD+840*60*1e3,KZ=dD-840*60*1e3,GZ=-720*60*1e3,VZ=840*60*1e3,mD=[\"UTC\",\"Europe/London\",\"America/New_York\",\"Asia/Tokyo\",\"Australia/Sydney\"];function hD(e,t,r){let n=Math.max(t,e?.minimum===void 0?t:e.minimum.epochMilliseconds+(e.exclusiveMinimum===!0?1:0)),o=Math.min(r,e?.maximum===void 0?r:e.maximum.epochMilliseconds-(e.exclusiveMaximum===!0?1:0));return n<=o?[n,o]:[t,r]}function cw(e,t){return co.check(Lu({minimum:e,maximum:t}))}function xD(){return st([cw(GZ,VZ),io(mD)])}var Cx=Be(e=>dE(e)&&ER(e),{representation:{id:\"effect/schema/DateTimeUtc\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeUtc\",Type:\"DateTime.Utc\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Utc\",toCodecArbitrary:({constraint:e})=>{let[t,r]=hD(e,pD,dD);return Nu()(cw(t,r),oe(wR))},toCodecJson:()=>Ae()(J,fD),toFormatter:()=>e=>e.toString()}),ZZ=$u.pipe(G(Cx,{decode:iD(),encode:oe(OR)})),YZ=J.annotate({expected:\"a string that will be decoded as a DateTime.Utc\"}).pipe(G(Cx,fD)),QZ=co.pipe(G(Cx,{decode:iD(),encode:oe(_R)})),XZ=Be(SR,{representation:{id:\"effect/schema/TimeZoneOffset\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneOffset\",Type:\"DateTime.TimeZone.Offset\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Offset\",toCodecJson:()=>Ae()(co,WZ),toFormatter:()=>e=>Nl(e)}),gD=J.annotate({expected:\"an IANA time zone identifier\"}),yD=Be(bR,{representation:{id:\"effect/schema/TimeZoneNamed\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneNamed\",Type:\"DateTime.TimeZone.Named\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Named\",toCodecArbitrary:()=>Nu()(io(mD),oe(xE)),toCodecJson:()=>Ae()(gD,cD),toFormatter:()=>e=>Nl(e)}),e5=gD.pipe(G(yD,cD)),SD=J.annotate({expected:\"a time zone string (IANA identifier or offset like +03:00)\"}),bD=Be(yR,{representation:{id:\"effect/schema/TimeZone\",payload:null},toCode:()=>({runtime:\"Schema.TimeZone\",Type:\"DateTime.TimeZone\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone\",toCodecArbitrary:()=>Nu()(xD(),oe(e=>typeof e==\"number\"?gE(e):xE(e))),toCodecJson:()=>Ae()(SD,uD),toFormatter:()=>e=>Nl(e)}),t5=SD.pipe(G(bD,uD)),ED=J.annotate({expected:\"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])\"}),ID=Be(e=>dE(e)&&IR(e),{representation:{id:\"effect/schema/DateTimeZoned\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeZoned\",Type:\"DateTime.Zoned\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Zoned\",toCodecArbitrary:({constraint:e})=>{let[t,r]=hD(e,JZ,KZ);return Nu()(Me({epochMilliseconds:cw(t,r),timeZone:xD()}),oe(({epochMilliseconds:n,timeZone:o})=>CR(n,{timeZone:o})))},toCodecJson:()=>Ae()(ED,lD),toFormatter:()=>e=>yE(e),toEquivalence:()=>TR}),r5=ED.pipe(G(ID,lD)),uo=(e,t,r,n)=>J.pipe(G(e,Vt({decode:(o,s)=>{let a=t(o);return at(a)?g(a.success):P(new de({message:a.failure.message},o,s))},encode:o=>g(r(o))}))).annotate({identifier:n}),zi=Be(Au,{identifier:\"MacAddress\"}),ju=uo(zi,UN,vT,\"MacAddressFromString\"),Ax=Be(xr,{identifier:\"Ipv4Address\"}),uw=uo(Ax,ku,ao,\"Ipv4AddressFromString\"),fw=Be(Vo,{identifier:\"Ipv6Address\"}),TD=uo(fw,gp,ao,\"Ipv6AddressFromString\"),qi=Be(FN,{identifier:\"IpAddress\"}),zu=uo(qi,yp,ao,\"IpAddressFromString\"),Ze=(e,t,r,n)=>kU(t,{expected:r})(e).annotate({identifier:n}),n5=Ze(qi,vu,\"a multicast address\",\"IpMulticastAddress\"),o5=Ze(zu,vu,\"a multicast address\",\"IpMulticastAddressFromString\"),s5=Ze(zi,vu,\"a multicast address\",\"MacMulticastAddress\"),a5=Ze(ju,vu,\"a multicast address\",\"MacMulticastAddressFromString\"),i5=Ze(qi,PT,\"a unicast address\",\"IpUnicastAddress\"),c5=Ze(zu,PT,\"a unicast address\",\"IpUnicastAddressFromString\"),u5=Ze(zi,cx,\"a unicast address\",\"MacUnicastAddress\"),f5=Ze(ju,cx,\"a unicast address\",\"MacUnicastAddressFromString\"),l5=Ze(Ax,fx,\"a broadcast address\",\"Ipv4BroadcastAddress\"),p5=Ze(uw,fx,\"a broadcast address\",\"Ipv4BroadcastAddressFromString\"),d5=Ze(zi,ix,\"a broadcast address\",\"MacBroadcastAddress\"),m5=Ze(ju,ix,\"a broadcast address\",\"MacBroadcastAddressFromString\"),h5=Ze(qi,RT,\"a loopback address\",\"IpLoopbackAddress\"),x5=Ze(zu,RT,\"a loopback address\",\"IpLoopbackAddressFromString\"),g5=Ze(qi,MT,\"a link-local address\",\"IpLinkLocalAddress\"),y5=Ze(zu,MT,\"a link-local address\",\"IpLinkLocalAddressFromString\"),S5=Ze(qi,ux,\"an unspecified address\",\"IpUnspecifiedAddress\"),b5=Ze(zu,ux,\"an unspecified address\",\"IpUnspecifiedAddressFromString\"),E5=Ze(Ax,FT,\"a private address\",\"Ipv4PrivateAddress\"),I5=Ze(uw,FT,\"a private address\",\"Ipv4PrivateAddressFromString\"),T5=Ze(fw,NT,\"a unique-local address\",\"Ipv6UniqueLocalAddress\"),w5=Ze(TD,NT,\"a unique-local address\",\"Ipv6UniqueLocalAddressFromString\"),C5=Ze(zi,OT,\"a locally administered address\",\"MacLocallyAdministeredAddress\"),A5=Ze(ju,OT,\"a locally administered address\",\"MacLocallyAdministeredAddressFromString\"),k5=Ze(zi,_T,\"a universally administered address\",\"MacUniversallyAdministeredAddress\"),v5=Ze(ju,_T,\"a universally administered address\",\"MacUniversallyAdministeredAddressFromString\"),wD=Be(jN,{identifier:\"Ipv4Interface\"}),O5=uo(wD,px,Ep,\"Ipv4InterfaceFromString\"),CD=Be(zN,{identifier:\"Ipv6Interface\"}),_5=uo(CD,dx,Ep,\"Ipv6InterfaceFromString\"),AD=Be(Sp,{identifier:\"IpInterface\"}),R5=uo(AD,mx,Ep,\"IpInterfaceFromString\"),kD=Be(HN,{identifier:\"Ipv4Network\"}),P5=uo(kD,JN,Tp,\"Ipv4NetworkFromString\"),vD=Be(WN,{identifier:\"Ipv6Network\"}),M5=uo(vD,KN,Tp,\"Ipv6NetworkFromString\"),OD=Be(Ip,{identifier:\"IpNetwork\"}),F5=uo(OD,GN,Tp,\"IpNetworkFromString\"),N5=Be(hp,{identifier:\"InetAddressV4\"}),U5=Be(xp,{identifier:\"InetAddressV6\"}),_D=Be(AT,{identifier:\"InetAddress\"}),D5=uo(_D,$N,lx,\"InetAddressFromString\"),RD=Be(ax,{identifier:\"UnixPathAddress\"}),L5=J.pipe(G(RD,Pe({decode:BN,encode:e=>e.path}))).annotate({identifier:\"UnixPathAddressFromString\"}),$5=Be(NN,{identifier:\"SocketAddress\"}),B5=Vt({decode:(e,t)=>Ht(EA(e),{onNone:()=>P(new de({expected:\"a valid Duration string\"},e,t)),onSome:g}),encode:e=>g(globalThis.String(e))}),j5=Vt({decode:e=>g(Po(e)),encode:(e,t)=>Ht(TA(e),{onNone:()=>P(new de({expected:\"a Duration representable as a bigint\"},e,t)),onSome:r=>g(r)})}),z5=Pe({decode:e=>Hs(e),encode:e=>kr(e)}),kx=Be(xy,{representation:{id:\"effect/schema/Duration\",payload:null},toCode:()=>({runtime:\"Schema.Duration\",Type:\"Duration.Duration\",importDeclarations:['import * as Duration from \"effect/Duration\"']}),expected:\"Duration\",toCodecJson:()=>Ae()(st([Me({_tag:wt(\"Infinity\")}),Me({_tag:wt(\"NegativeInfinity\")}),Me({_tag:wt(\"Nanos\"),value:Fu}),Me({_tag:wt(\"Millis\"),value:co})]),Pe({decode:e=>{switch(e._tag){case\"Infinity\":return cs;case\"NegativeInfinity\":return bc;case\"Nanos\":return Po(e.value);case\"Millis\":return Hs(e.value)}},encode:e=>{switch(e.value._tag){case\"Infinity\":return{_tag:\"Infinity\"};case\"NegativeInfinity\":return{_tag:\"NegativeInfinity\"};case\"Nanos\":return{_tag:\"Nanos\",value:e.value.nanos};case\"Millis\":return{_tag:\"Millis\",value:e.value.millis}}}}))}),q5=J.annotate({expected:\"a string that will be decoded as a Duration\"}),lw=q5.pipe(G(kx,B5)),H5=Fu.pipe(G(kx,j5)),W5=ji.pipe(G(kx,z5));function J5(e,t,r){let n=qr()([e,t,r],([o,s,a])=>{let i=WT(s,a);return(c,u,f)=>{if(!dl(c))return P(new ut(u,c,f));switch(c._tag){case\"Success\":return Kt(et(o)(c.value,f),{onSuccess:pr,onFailure:p=>Br(u,\"value\",p,c,f)});case\"Failure\":return Kt(et(i)(c.cause,f),{onSuccess:Ur,onFailure:p=>Br(u,\"cause\",p,c,f)})}}},{representation:{id:\"effect/schema/Exit\",payload:null},toCode:({typeParameters:o})=>({runtime:`Schema.Exit(${o[0].runtime}, ${o[1].runtime}, ${o[2].runtime})`,Type:`Exit.Exit<${o[0].Type}, ${o[1].Type}, ${o[2].Type}>`,importDeclarations:['import * as Exit from \"effect/Exit\"']}),expected:\"Exit\",toCodec:([o,s,a])=>Ae()(st([Me({_tag:wt(\"Success\"),value:o}),Me({_tag:wt(\"Failure\"),cause:WT(s,a)})]),Pe({decode:i=>i._tag===\"Success\"?pr(i.value):Ur(i.cause),encode:i=>Ke(i)?{_tag:\"Success\",value:i.value}:{_tag:\"Failure\",cause:i.cause}}))});return q(n.ast,{value:e,error:t,defect:r})}function oU(e,t,r){return Me({type:wt(e),nodes:$e(Me({index:Li,data:t})),edges:$e(Me({index:Li,source:Li,target:Li,data:r}))})}function sU(e,t){let r=-1,n=new Set;for(let o=0;o{let o=zl(r),s=zl(n);if(o.type!==s.type||o.nodes.length!==s.nodes.length||o.edges.length!==s.edges.length)return!1;for(let a=0;a{if(n===null)return mh({type:e,nodes:[],edges:[]});let o=n.nodes.map((s,a)=>({index:a,data:s}));return mh({type:e,nodes:o,edges:n.edges.map(([s,a,i],c)=>({index:c,source:s%o.length,target:a%o.length,data:i}))})}))}function Z5(e,t,r){let n=qr()([t,r],([o,s])=>{let a=oU(e,o,s);return(i,c,u)=>!GE(i)||i.mutable||i.type!==e?P(new ut(c,i,u)):I(et(a)(zl(i),u),f=>sU(f,u))},{representation:{id:\"effect/schema/Graph\",payload:e},toCode:({typeParameters:o})=>({runtime:`Schema.Graph(${F(e)}, ${o[0].runtime}, ${o[1].runtime})`,Type:`Graph.Graph<${o[0].Type}, ${o[1].Type}, ${F(e)}>`,importDeclarations:['import * as Graph from \"effect/Graph\"']}),expected:`an immutable ${e} Graph`,toCodec:([o,s])=>Ae()(oU(e,o,s),Vt({decode:sU,encode:(a,i)=>K5(a,e,i)})),toCodecArbitrary:({typeParameters:[o,s]})=>V5(e,o,s),toEquivalence:([o,s])=>G5(o,s)});return q(n.ast,{type:e,node:t,edge:r})}function aU(e){return Ae()(e,Pe({decode:vE,encode:Bl}))}function Y5(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(Zo([n,o]));return(a,i,c)=>qR(a)?Kt(et(s)(Bl(a),c),{onSuccess:vE,onFailure:u=>Br(i,\"entries\",u,a,c)}):P(new ut(i,a,c))},{representation:{id:\"effect/schema/HashMap\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.HashMap(${n[0].runtime}, ${n[1].runtime})`,Type:`HashMap.HashMap<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as HashMap from \"effect/HashMap\"']}),expected:\"HashMap\",toCodec:([n,o])=>aU($e(Zo([n,o]))),toCodecArbitrary:({constraint:n,typeParameters:[o,s]})=>aU(Sx($e(Zo([o,s])).check(KU()),n?.minSize,n?.maxSize)),toEquivalence:([n,o])=>cd(n,o)});return q(r.ast,{key:e,value:t})}function iU(e){return Ae()(e,Pe({decode:RE,encode:Ve}))}function Q5(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>GR(o)?Kt(et(n)(Ve(o),a),{onSuccess:RE,onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ut(s,o,a))},{representation:{id:\"effect/schema/HashSet\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.HashSet(${r[0].runtime})`,Type:`HashSet.HashSet<${r[0].Type}>`}),expected:\"HashSet\",toCodec:([r])=>iU($e(r)),toCodecArbitrary:({constraint:r,typeParameters:[n]})=>iU(Sx($e(n).check(sw()),r?.minSize,r?.maxSize)),toEquivalence:([r])=>Ef(r)});return q(t.ast,{value:e})}function Hi(e){let t=qr()([e],([r])=>(n,o,s)=>yc(n)?ue(n)?ra:Kt(et(r)(n.value,s),{onSuccess:O,onFailure:a=>Br(o,\"value\",a,n,s)}):P(new ut(o,n,s)),{representation:{id:\"effect/schema/Option\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Option(${r[0].runtime})`,Type:`Option.Option<${r[0].Type}>`,importDeclarations:['import * as Option from \"effect/Option\"']}),expected:\"Option\",toCodec:([r])=>Ae()(st([Me({_tag:wt(\"Some\"),value:r}),Me({_tag:wt(\"None\")})]),Pe({decode:n=>n._tag===\"None\"?v():O(n.value),encode:n=>Oe(n)?{_tag:\"Some\",value:n.value}:{_tag:\"None\"}}))});return q(t.ast,{value:e})}function X5(e){return QT(e).pipe(G(Hi(Hr(e)),cM()))}function e8(e){return bx(e).pipe(G(Hi(Hr(e)),uM()))}function t8(e,t){return CU(e).pipe(G(Hi(Hr(e)),fM(t)))}var PD=Be(QR,{representation:{id:\"effect/http/Cookie\",payload:null},toCode:()=>({runtime:\"Schema.Cookie\",Type:\"Cookies.Cookie\",importDeclarations:['import * as Cookies from \"effect/http/Cookies\"']}),expected:\"Cookie\"}),MD=Be(YR,{representation:{id:\"effect/http/Cookies\",payload:null},toCode:()=>({runtime:\"Schema.Cookies\",Type:\"Cookies.Cookies\",importDeclarations:['import * as Cookies from \"effect/http/Cookies\"']}),expected:\"Cookies\",toCodecJson:()=>Ae()($e(J),Pe({decode:XR,encode:oP})),toCodecIso:()=>Ae()(ks(J,PD),Pe({decode:DE,encode:e=>e.cookies}))}),r8=MD.pipe(G(ks(J,J),Pe({decode:nP,encode:e=>LE(globalThis.Object.entries(e).map(([t,r])=>rP(t,r)))}))),n8=Be(cP,{representation:{id:\"effect/http/Headers\",payload:null},toCode:()=>({runtime:\"Schema.Headers\",Type:\"Headers.Headers\",importDeclarations:['import * as Headers from \"effect/http/Headers\"']}),expected:\"Headers\",toEquivalence:()=>qE,toCodec:()=>Ae()(ks(J,J),Pe({decode:uP,encode:e=>({...e})}))}),pw=Be(WE,{representation:{id:\"effect/http/UrlParams\",payload:null},toCode:()=>({runtime:\"Schema.UrlParams\",Type:\"UrlParams.UrlParams\",importDeclarations:['import * as UrlParams from \"effect/http/UrlParams\"']}),expected:\"UrlParams\",toEquivalence:()=>JE,toCodec:()=>Ae()($e(Zo([J,J])),Pe({decode:dh,encode:e=>e.params}))}),o8=(e,t)=>pw.pipe(G(iw(Ap,t),Vt({decode:r=>Ht(pP(r,e),{onNone:()=>P(new ct([e],new fa(void 0))),onSome:g}),encode:r=>g(dh([[e,r]]))}))),s8=pw.pipe(G(ks(J,st([J,YT(J)])),Pe({decode:dP,encode:fP})));function a8(e){return $i(e).pipe(G(Hi(Hr(e)),lM()))}function i8(e){return Pu(e).pipe(G(Hi(Hr(e)),pM()))}function c8(e,t){let r=t===void 0?\"omit\":t.onNoneEncoding,n=r===null?null:void 0;return Pu(QT(e)).pipe(G(Hi(Hr(e)),Ah({decode:o=>o.pipe(Wa(sd),O),encode:r===\"omit\"?Ha:o=>O(Rf(Ha(o),()=>n))})))}function vx(e,t){let r=typeof t?.label==\"string\"?t.label:void 0,n=t?.disallowJsonEncode===!0,o=r!==void 0?n?{label:r,disallowJsonEncode:!0}:{label:r}:n?{disallowJsonEncode:!0}:void 0,s=r!==void 0?et(wt(r)):void 0,a=qr()([e],([i])=>(c,u,f)=>{if($E(c)){let p=s!==void 0?Fl(s(c.label,f),d=>new ct([\"label\"],d)):Y;return nt(p,()=>Kt(et(i)(eu(c),f),{onSuccess:d=>Ti(d,{label:c.label}),onFailure:()=>new Tt(u,[new ct([\"value\"],new de(void 0,c,f))],c,f)}))}return P(new ut(u,c,f))},{representation:{id:\"effect/schema/Redacted\",payload:o??null},toCode:({typeParameters:i})=>({runtime:o!==void 0?`Schema.Redacted(${i[0].runtime}, ${F(o)})`:`Schema.Redacted(${i[0].runtime})`,Type:`Redacted.Redacted<${i[0].Type}>`,importDeclarations:['import * as Redacted from \"effect/Redacted\"']}),expected:\"Redacted\",toCodecJson:([i])=>Ae()(i,{decode:oe(c=>Ti(c,{label:r})),encode:n?bh(c=>\"Cannot serialize Redacted\"+(Oe(c)&&typeof c.value.label==\"string\"?` with label: \"${c.value.label}\"`:\"\")):oe(eu)}),toEquivalence:([i])=>iP(i)});return q(a.ast,{value:e})}function u8(e,t){return G(vx(Hr(e),{label:t?.label,disallowJsonEncode:t?.disallowEncode}),{decode:oe(r=>Ti(r,{label:t?.label})),encode:t?.disallowEncode?bh(r=>\"Cannot encode Redacted\"+(Oe(r)&&typeof r.value.label==\"string\"?` with label: \"${r.value.label}\"`:\"\")):oe(eu)})(e)}function f8(e,t){let r=qr()([e,t],([n,o])=>(s,a,i)=>{if(!tA(s))return P(new ut(a,s,i));switch(s._tag){case\"Success\":return Kt(XI(n)(s.success,i),{onSuccess:B,onFailure:c=>Br(a,\"success\",c,s,i)});case\"Failure\":return Kt(XI(o)(s.failure,i),{onSuccess:K,onFailure:c=>Br(a,\"failure\",c,s,i)})}},{representation:{id:\"effect/schema/Result\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Result(${n[0].runtime}, ${n[1].runtime})`,Type:`Result.Result<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Result from \"effect/Result\"']}),expected:\"Result\",toCodec:([n,o])=>Ae()(st([Me({_tag:wt(\"Success\"),success:n}),Me({_tag:wt(\"Failure\"),failure:o})]),Pe({decode:s=>s._tag===\"Success\"?B(s.success):K(s.failure),encode:s=>at(s)?{_tag:\"Success\",success:s.success}:{_tag:\"Failure\",failure:s.failure}}))});return q(r.ast,{success:e,failure:t})}var l8=globalThis.Symbol.for(\"immer-draftable\"),JT={};function dw(e,t,r,n,o){let s=d8(r,t,n),a=FD(t),i=class extends e{constructor(...[c,u]){let p=u?.[\"~payload\"],d=p?.token===JT?p.value:r.make(c??{},u);super(d,{...u,disableChecks:!0,\"~payload\":{token:JT,value:d}})}static[wp]=wp;get[a](){return a}static[l8]=!0;static identifier=t;static fields=r.fields;static get ast(){return s(this).ast}static pipe(){return Z(this,arguments)}static rebuild(c){return s(this).rebuild(c)}static make(c,u){return Wh(s(this))(c??{},u)}static makeOption(c,u){return Hh(s(this))(c??{},u)}static makeEffect(c,u){return s(this).makeEffect(c??{},u)}static annotate(c){return this.rebuild(Qn(this.ast,c))}static annotateKey(c){return this.rebuild(ap(this.ast,c))}static check(...c){return this.rebuild(Ko(this.ast,c))}static extend(c){return(u,f)=>{let p=Pp(u)?u:Me(u),d={...r.fields,...p.fields},m=Ph(d,r.ast.checks,{identifier:c});return dw(this,c,ZT(Ko(m,p.ast.checks),d),f,o)}}static mapFields(c,u){return r.mapFields(c,u)}};return o!==void 0&&Object.assign(i.prototype,o(t)),i}function p8(e){return new Ce(oe(t=>new e(t,{\"~payload\":{token:JT,value:t}})),jr())}function FD(e){return`~effect/Schema/Class/${e}`}function d8(e,t,r){let n;return o=>{if(n!==void 0)return n;let s=FD(t),a=u=>u instanceof o||A(u,s),i=p8(o),c=q(new pu([e.ast],()=>(u,f,p)=>a(u)?g(u):P(new ut(f,u,p)),{identifier:t,[xh]:([u])=>({isConstructed:a,link:new ot(u,i)}),toCodec:([u])=>new ot(u.ast,i),toEquivalence:([u])=>u,toFormatter:([u])=>f=>`${o.identifier}(${u(f)})`,[ql]:uu(e.ast),...r}));return n=G(c,i)(e)}}function Pp(e){return gx(e)}var ND=e=>(t,r)=>{let n=Pp(t)?t:Me(t);return dw(Hd,e,n,r,o=>({toString(){return`${o}(${F({...this})})`}}))},m8=e=>(t,r,n)=>{let o=Pp(r)?r.mapFields(s=>({_tag:Bi(t),...s}),{unsafePreserveChecks:!0}):Ex(t,r);return ND(e??t)(o,n)},UD=e=>(t,r)=>{let n=Pp(t)?t:Me(t);return dw(Af,e,n,r,s=>({name:s}))},h8=e=>(t,r,n)=>{let o=Pp(r)?r.mapFields(s=>({_tag:Bi(t),...s}),{unsafePreserveChecks:!0}):Ex(t,r);return UD(e??t)(o,n)};function x8(e){return t=>t.annotate({toFormatter:e})}function g8(e,t){return TN(e.ast,t)}function y8(e){return t=>t.annotate({toEquivalence:e})}function S8(e){return xT(e.ast)}function b8(e,t){return pp(e.ast,t)}function E8(e,t){let r=pp(Su(e.ast),t);return tx(r,t)}var I8=Zh,T8=Yh,Mp=Qh,w8=YF;function C8(e,t){return yN(e,t)}function A8(e){return _N(e)}function k8(e){return RN(e)}function v8(e){return PN(e)}function O8(e,t){return r=>q(Qn(r.ast,{toCodecIso:()=>new ot(e.ast,Ch(t))}),{schema:r})}function _8(e){return gN(e)}function R8(e){let t=AU(()=>r),r=st([e,$e(t),ks(J,t)]);return r}var Ox=q(Qn(fu,{toCode:()=>({runtime:\"Schema.Json\",Type:\"Schema.Json\"})})),P8=ks(J,Ox),M8=Me({message:J,name:$i(J),stack:$i(J),cause:$i(Ox)}),F8=q(Qn(dF,{toCode:()=>({runtime:\"Schema.MutableJson\",Type:\"Schema.MutableJson\"})}));function N8(e){return Ts(e.ast)}function U8(e){return e.ast.context?.annotations}var DD=\"~effect/MutableHashMap\";var D8={[DD]:DD,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${F(Array.from(this))})`},toJSON(){return{_id:\"MutableHashMap\",values:kt(Array.from(this))}},[Ie](){return this.toJSON()},pipe(){return Z(this,arguments)}},Fp=()=>{let e=Object.create(D8);return e.backing=new Map,e.buckets=new Map,e};var Yo=l(2,(e,t)=>{if(e.backing.has(t))return O(e.backing.get(t));if(mw(t))return v();let r=H(t),n=e.buckets.get(r);return n===void 0?v():L8(e,n,t)}),mw=e=>typeof e!=\"object\"&&typeof e!=\"function\";var L8=(e,t,r)=>{for(let n=0,o=t.length;n{if(e.backing.has(t)||mw(t))return e.backing.set(t,r),e;let n=H(t),o=e.buckets.get(n);if(o===void 0)return e.buckets.set(n,[t]),e.backing.set(t,r),e;let s=$8(o,t);return s===void 0&&(o.push(t),s=t),e.backing.set(s,r),e}),$8=(e,t)=>{for(let r=0,n=e.length;r{if(mw(t))return e.backing.delete(t),e;let r=H(t),n=e.buckets.get(r);if(n===void 0)return e;for(let o=0,s=n.length;o(e.backing.clear(),e.buckets.clear(),e),LD=e=>e.backing.size;var $D=Jy;var ga=Ky,BD=lk,fo=Xf;var Hu=fs,ya=uO;var Wr=jS,jD=xO;var zD=\"~effect/MutableRef\",B8={[zD]:zD,...er,toJSON(){return{_id:\"MutableRef\",current:kt(this.current)}}},Wu=e=>{let t=Object.create(B8);return t.current=e,t};var qD=e=>e.current;var Px=l(2,(e,t)=>(e.current=t,e));var yr=Symbol.for(\"effect/MutableList/Empty\"),Os=()=>({head:void 0,tail:void 0,length:0}),gw=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},HD=()=>({array:[],mutable:!0,offset:0,next:void 0}),lo=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=HD(),e.tail=e.tail.next):e.head=e.tail=HD(),e.tail.array.push(t),e.length++},yw=(e,t)=>{e.head={array:[t],mutable:!0,offset:0,next:e.head},e.tail||(e.tail=e.head),e.length++};var Mx=(e,t)=>Fx(e,Ve(t),!Array.isArray(t)),Fx=(e,t,r=!1)=>{if(t.length===0)return 0;let n={array:t,mutable:r,offset:0,next:void 0};return e.head?e.tail=e.tail.next=n:e.head=e.tail=n,e.length+=t.length,t.length},vs=e=>{e.head=e.tail=void 0,e.length=0},Wi=(e,t)=>{if(t=rt(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let s=e.head.array;return vs(e),s}let r=new Array(t),n=0,o=e.head;for(;o;){for(;o.offset{if(t=rt(t),t<=0||!e.head)return;if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){vs(e);return}let r=0,n=e.head;for(;n;){let o=n.array.length-n.offset;if(r+o>t){n.offset+=t-r,e.head=n,e.length-=t,gw(e);return}r+=o,n=n.next}vs(e)},Sa=e=>Wi(e,e.length),Ji=e=>{if(!e.head)return yr;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length?e.head.next?e.head=e.head.next:vs(e):gw(e),t},WD=(e,t)=>{if(t=rt(t),t<=0)return[];let r=Math.min(t,e.length),n=new Array(r),o=0,s=e.head;for(;s;){for(let a=s.offset;a{let r=[],n=e.head,o=0;for(;n;){for(let s=n.offset;sSw(e,r=>r!==t);var j8=\"~effect/PubSub\";var z8=\"~effect/PubSub/Subscription\",$x=e=>te(()=>G8(e.atomicPubSub(),new Map,An(),Wr(!1),Wu(!1),e.strategy(),Wu(v()))),Bx=e=>$x({atomicPubSub:()=>Rw(e),strategy:()=>new Ux}),jx=e=>$x({atomicPubSub:()=>Rw(e),strategy:()=>new Dx}),zx=e=>$x({atomicPubSub:()=>Rw(e),strategy:()=>new _w}),qx=e=>$x({atomicPubSub:()=>KD(e),strategy:()=>new Dx}),Rw=e=>{let t=typeof e==\"number\"?{capacity:e}:e;if(V8(t.capacity),t.capacity===1/0)return KD(t);let r=t.replay&&t.replay>0?new Lx(Math.ceil(t.replay)):void 0;return t.capacity===1?new ww(r):b_(t.capacity)===t.capacity?new Iw(t.capacity,r):new bw(t.capacity,r)},KD=e=>{let t=e?.replay;return new Aw(t&&t>0?new Lx(Math.ceil(t)):void 0)};var Lp=e=>bs(an(t=>(Px(e.shutdownFlag,!0),Le(e.scope,sb(t.id)).pipe(mr(e.strategy.shutdown),Qm(e.shutdownHook.open),na)))),Hx=l(2,(e,t)=>te(()=>q8(e,t))),q8=l(2,(e,t)=>{if(e.shutdownFlag.current||Oe(e.ended.current))return!1;if(Px(e.ended,O(t)),e.strategy instanceof Ux)for(let[n,o,s]of Sa(e.strategy.publishers))s&&Do(o,pr(!1));let r=pr(t);for(let n of e.subscribers.values())for(let o of n){let s;for(;(s=Ji(o))!==yr;)Do(s,r)}return e.subscribers.clear(),!0});var Wx=l(2,(e,t)=>$(()=>e.shutdownFlag.current||Oe(e.ended.current)?g(!1):e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),g(!0)):e.strategy.handleSurplus(e.pubsub,e.subscribers,[t],e.shutdownFlag)));var GD=l(2,(e,t)=>$(()=>{if(e.shutdownFlag.current||Oe(e.ended.current))return g(!1);let r=e.pubsub.publishAll(t);return e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),r.length===0?g(!0):e.strategy.handleSurplus(e.pubsub,e.subscribers,r,e.shutdownFlag)})),$p=e=>bs(Pl(t=>{let r=Fe(t,_r),n=Mt(e.scope),o=K8(e.pubsub,e.subscribers,e.strategy,e.ended);return ar(n,H8(o)).pipe(mr(Lo(r,s=>Le(n,s))),Ft(o))})),H8=e=>bs(an(t=>(Px(e.shutdownFlag,!0),ta(Sa(e.pollers),r=>cb(r,t.id),{discard:!0,concurrency:\"unbounded\"}).pipe(Pr(()=>te(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),Qm(e.shutdownHook.open),na)))),Jx=e=>$(()=>{if(e.shutdownFlag.current)return On;if(e.replayWindow.remaining>0){let r=e.replayWindow.take();return g(r)}let t=e.pollers.length===0?e.subscription.poll():yr;return t===yr?ZD(e):(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),g(t))}),VD=e=>$(function t(r){if(e.shutdownFlag.current)return On;let n=e.pollers.length===0?e.subscription.pollUpTo(Number.POSITIVE_INFINITY):[];return r&&(n=r.concat(n)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?g(e.replayWindow.takeAll().concat(n)):rr(n)?g(n):I(ZD(e),o=>t([o]))}),ZD=e=>Wc(t=>{if(e.shutdownFlag.current)return t(On);if(Oe(e.ended.current))return t(g(e.ended.current.value));let r=si(),n=e.subscribers.get(e.subscription);return n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),lo(e.pollers,r),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),r.effect?t(r.effect):(r.resumes=[t],te(()=>JD(e.pollers,r)))});var bt=Symbol.for(\"effect/PubSub/AbsentValue\"),W8=(e,t,r)=>{e.has(t)||e.set(t,new Set),e.get(t).add(r)},J8=(e,t,r)=>{if(!e.has(t))return;let n=e.get(t);n.delete(r),n.size===0&&e.delete(t)},K8=(e,t,r,n)=>new vw(e,t,e.subscribe(),Os(),Wr(!1),Wu(!1),r,e.replayWindow(),n),bw=class{array;replayIndices;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(t,r){this.capacity=t,this.replayBuffer=r,this.array=Array.from({length:t}),this.replayIndices=r?Array.from({length:t}):[],this.subscribers=Array.from({length:t})}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);if(this.subscriberCount!==0){let n=this.publisherIndex%this.capacity;this.array[n]=t,r!==void 0&&(this.replayIndices[n]=r),this.subscribers[n]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ve(t),n=r.length,o=this.publisherIndex-this.subscribersIndex,s=this.capacity-o,a=Math.min(n,s);if(a===0)return r;let i=0,c=this.publisherIndex+a;for(;this.publisherIndex!==c;){let u=r[i++],f=this.publisherIndex%this.capacity;this.array[f]=u;let p=this.replayBuffer?.offer(u);p!==void 0&&(this.replayIndices[f]=p),this.subscribers[f]=this.subscriberCount,this.publisherIndex+=1}return r.slice(i)}slide(){if(this.subscribersIndex!==this.publisherIndex){let t=this.subscribersIndex%this.capacity,r=this.array[t];this.array[t]=bt,this.subscribers[t]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(r,this.replayIndices[t])}}subscribe(){return this.subscriberCount+=1,new Ew(this,this.publisherIndex,!1)}},Ew=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return yr;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let t=this.subscriberIndex%this.self.capacity,r=this.self.array[t];return this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1,r}return yr}pollUpTo(t){if(t=rt(t),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let r=this.self.publisherIndex-this.subscriberIndex,n=Math.min(t,r);if(n<=0)return[];let o=[],s=this.subscriberIndex+n;for(;this.subscriberIndex!==s;){let a=this.subscriberIndex%this.self.capacity,i=this.self.array[a];this.self.subscribers[a]-=1,this.self.subscribers[a]===0&&(this.self.array[a]=bt,this.self.subscribersIndex+=1),o.push(i),this.subscriberIndex+=1}return o}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let t=this.subscriberIndex%this.self.capacity;this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}},Iw=class{array;replayIndices;mask;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(t,r){this.capacity=t,this.replayBuffer=r,this.array=Array.from({length:t}),this.replayIndices=r?Array.from({length:t}):[],this.mask=t-1,this.subscribers=Array.from({length:t})}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);if(this.subscriberCount!==0){let n=this.publisherIndex&this.mask;this.array[n]=t,r!==void 0&&(this.replayIndices[n]=r),this.subscribers[n]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ve(t),n=r.length,o=this.publisherIndex-this.subscribersIndex,s=this.capacity-o,a=Math.min(n,s);if(a===0)return r;let i=0,c=this.publisherIndex+a;for(;this.publisherIndex!==c;){let u=r[i++],f=this.publisherIndex&this.mask;this.array[f]=u;let p=this.replayBuffer?.offer(u);p!==void 0&&(this.replayIndices[f]=p),this.subscribers[f]=this.subscriberCount,this.publisherIndex+=1}return r.slice(i)}slide(){if(this.subscribersIndex!==this.publisherIndex){let t=this.subscribersIndex&this.mask,r=this.array[t];this.array[t]=bt,this.subscribers[t]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(r,this.replayIndices[t])}}subscribe(){return this.subscriberCount+=1,new Tw(this,this.publisherIndex,!1)}},Tw=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return yr;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let t=this.subscriberIndex&this.self.mask,r=this.self.array[t];return this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1,r}return yr}pollUpTo(t){if(t=rt(t),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let r=this.self.publisherIndex-this.subscriberIndex,n=Math.min(t,r);if(n<=0)return[];let o=[],s=this.subscriberIndex+n;for(;this.subscriberIndex!==s;){let a=this.subscriberIndex&this.self.mask,i=this.self.array[a];this.self.subscribers[a]-=1,this.self.subscribers[a]===0&&(this.self.array[a]=bt,this.self.subscribersIndex+=1),o.push(i),this.subscriberIndex+=1}return o}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let t=this.subscriberIndex&this.self.mask;this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}},ww=class{publisherIndex=0;subscriberCount=0;subscribers=0;value=bt;replayIndex=0;capacity=1;replayBuffer;constructor(t){this.replayBuffer=t}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}pipe(){return Z(this,arguments)}isEmpty(){return this.subscribers===0}isFull(){return!this.isEmpty()}size(){return this.isEmpty()?0:1}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);return this.subscriberCount!==0&&(this.value=t,r!==void 0&&(this.replayIndex=r),this.subscribers=this.subscriberCount,this.publisherIndex+=1),!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ve(t);return r.length===0?r:this.publish(r[0])?r.slice(1):r}slide(){if(this.isFull()){let t=this.value;this.subscribers=0,this.value=bt,this.replayBuffer?.slide(t,this.replayIndex)}}subscribe(){return this.subscriberCount+=1,new Cw(this,this.publisherIndex,!1)}},Cw=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.subscribers===0||this.subscriberIndex===this.self.publisherIndex}size(){return this.isEmpty()?0:1}poll(){if(this.isEmpty())return yr;let t=this.self.value;return this.self.subscribers-=1,this.self.subscribers===0&&(this.self.value=bt),this.subscriberIndex=this.self.publisherIndex,t}pollUpTo(t){return rt(t)<1||this.isEmpty()?[]:[this.poll()]}unsubscribe(){this.unsubscribed||(this.unsubscribed=!0,this.self.subscriberCount-=1,this.self.subscribers!==0&&this.subscriberIndex!==this.self.publisherIndex&&(this.self.subscribers-=1,this.self.subscribers===0&&(this.self.value=bt)))}},Aw=class{publisherHead={value:bt,replayIndex:void 0,subscribers:0,next:null};publisherTail=this.publisherHead;publisherIndex=0;subscribersIndex=0;capacity=Number.MAX_SAFE_INTEGER;replayBuffer;constructor(t){this.replayBuffer=t}replayWindow(){return this.replayBuffer?new Ju(this.replayBuffer):Kx}isEmpty(){return this.publisherHead===this.publisherTail}isFull(){return!1}size(){return this.publisherIndex-this.subscribersIndex}publish(t){let r=this.replayBuffer?.offer(t),n=this.publisherTail.subscribers;if(n!==0){let o={value:t,replayIndex:r,subscribers:n,next:null};this.publisherTail.next=o,this.publisherTail=this.publisherTail.next,this.publisherIndex+=1}return!0}publishAll(t){if(this.publisherTail.subscribers!==0)for(let r of t)this.publish(r);else this.replayBuffer&&this.replayBuffer.offerAll(t);return[]}slide(){if(this.publisherHead!==this.publisherTail){let t=this.publisherHead.next,r=t.value;this.publisherHead=this.publisherHead.next,this.publisherHead.value=bt,this.subscribersIndex+=1,this.replayBuffer?.slide(r,t.replayIndex)}}subscribe(){return this.publisherTail.subscribers+=1,new kw(this,this.publisherTail,this.publisherIndex,!1)}},kw=class{self;subscriberHead;subscriberIndex;unsubscribed;constructor(t,r,n,o){this.self=t,this.subscriberHead=r,this.subscriberIndex=n,this.unsubscribed=o}isEmpty(){if(this.unsubscribed)return!0;let t=!0,r=!0;for(;r;)this.subscriberHead===this.self.publisherTail?r=!1:this.subscriberHead.next.value!==bt?(t=!1,r=!1):(this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1);return t}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return yr;let t=!0,r=yr;for(;t;)if(this.subscriberHead===this.self.publisherTail)t=!1;else{let n=this.subscriberHead.next.value;n!==bt&&(r=n,this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=bt,this.self.subscribersIndex+=1),t=!1),this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1}return r}pollUpTo(t){t=rt(t);let r=[],n=0;for(;n!==t;){let o=this.poll();o===yr?n=t:(r.push(o),n+=1)}return r}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.publisherTail.subscribers-=1;this.subscriberHead!==this.self.publisherTail;)this.subscriberHead.next.value!==bt&&(this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=bt,this.self.subscribersIndex+=1)),this.subscriberHead=this.subscriberHead.next}},vw=class{[z8]={_A:R};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;ended;constructor(t,r,n,o,s,a,i,c,u){this.pubsub=t,this.subscribers=r,this.subscription=n,this.pollers=o,this.shutdownHook=s,this.shutdownFlag=a,this.strategy=i,this.replayWindow=c,this.ended=u}pipe(){return Z(this,arguments)}},Ow=class{[j8]={_A:R};pubsub;subscribers;scope;shutdownHook;shutdownFlag;strategy;ended;constructor(t,r,n,o,s,a,i){this.pubsub=t,this.subscribers=r,this.scope=n,this.shutdownHook=o,this.shutdownFlag=s,this.strategy=a,this.ended=i}pipe(){return Z(this,arguments)}},G8=(e,t,r,n,o,s,a)=>new Ow(e,t,r,n,o,s,a),V8=e=>{if(e<=0)throw new Error(`Cannot construct PubSub with capacity of ${e}`)},Ux=class{publishers=Os();get shutdown(){return an(t=>ta(Sa(this.publishers),([r,n,o])=>o?cb(n,t.id):Y,{concurrency:\"unbounded\",discard:!0}))}handleSurplus(t,r,n,o){return Wc(s=>{let a=si();return this.offerUnsafe(n,a),this.onPubSubEmptySpaceUnsafe(t,r),this.completeSubscribersUnsafe(t,r),qD(o)?(this.removeUnsafe(a),s(On)):a.effect?s(a.effect):(a.resumes=[s],te(()=>this.removeUnsafe(a)))})}onPubSubEmptySpaceUnsafe(t,r){let n=!0;for(;n&&!t.isFull();){let o=Ji(this.publishers);if(o===yr)n=!1;else{let[s,a]=o,i=t.publish(s);i&&o[2]?Do(a,pr(!0)):i||yw(this.publishers,o),this.completeSubscribersUnsafe(t,r)}}}completePollersUnsafe(t,r,n,o){return Pw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Mw(this,t,r)}offerUnsafe(t,r){let n=t[Symbol.iterator](),o=n.next();if(!o.done)for(;;){let s=o.value;if(o=n.next(),o.done){lo(this.publishers,[s,r,!0]);break}lo(this.publishers,[s,r,!1])}}removeUnsafe(t){Sw(this.publishers,([r,n])=>n!==t)}},Dx=class{get shutdown(){return Y}handleSurplus(t,r,n,o){return g(!1)}onPubSubEmptySpaceUnsafe(t,r){}completePollersUnsafe(t,r,n,o){return Pw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Mw(this,t,r)}},_w=class{get shutdown(){return Y}handleSurplus(t,r,n,o){return te(()=>(this.slidingPublishUnsafe(t,n),this.completeSubscribersUnsafe(t,r),!0))}onPubSubEmptySpaceUnsafe(t,r){}completePollersUnsafe(t,r,n,o){return Pw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Mw(this,t,r)}slidingPublishUnsafe(t,r){let n=r[Symbol.iterator](),o=n.next();if(!o.done&&t.capacity>0){let s=o.value,a=!0;for(;a;){t.slide();let i=t.publish(s);i&&(o=n.next())&&!o.done?s=o.value:i&&(a=!1)}}}},Pw=(e,t,r,n,o)=>{let s=!0;for(;s&&!n.isEmpty();){let a=Ji(o);if(a===yr)J8(r,n,o),o.length===0?s=!1:W8(r,n,o);else{let i=n.poll();i===yr?yw(o,a):(Do(a,pr(i)),e.onPubSubEmptySpaceUnsafe(t,r))}}},Mw=(e,t,r)=>{for(let[n,o]of r)for(let s of o)e.completePollersUnsafe(t,r,n,s)},Lx=class{capacity;head={value:bt,index:0,next:null};tail=this.head;slideValues=[];size=0;index=0;publisherIndex=0;constructor(t){this.capacity=t}slide(t,r){this.slideValues[this.index%this.capacity]={value:t,index:r},this.index++}offer(t){let r=this.publisherIndex++;return this.tail.value=t,this.tail.index=r,this.tail.next={value:bt,index:0,next:null},this.tail=this.tail.next,this.size===this.capacity?this.head=this.head.next:this.size+=1,r}offerAll(t){for(let r of t)this.offer(r)}},Ju=class{buffer;values;index=0;remaining;slideIndex;newestIndex=-1;constructor(t){this.buffer=t,this.remaining=t.size,this.slideIndex=t.index,this.values=new Array(this.remaining);let r=t.head;for(let n=0;nthis.newestIndex&&(this.index=(this.index+1)%this.values.length,this.values[(this.index+this.remaining-1)%this.values.length]=s.value,this.newestIndex=s.index)}this.slideIndex=this.buffer.index}take(){if(this.remaining===0)return;this.sync();let t=this.values[this.index];return this.values[this.index]=bt,this.index=(this.index+1)%this.values.length,this.remaining--,this.remaining===0&&this.close(),t}takeN(t){t=rt(t);let r=Math.min(t,this.remaining),n=new Array(r);for(let o=0;o{},takeN:()=>[],takeAll:()=>[],close:()=>{}};var Z8=\"~effect/Queue\",Y8=\"~effect/Queue/Enqueue\",Q8=\"~effect/Queue/Dequeue\";var Nw={_A:R,_E:R},X8={[Z8]:Nw,[Y8]:Nw,[Q8]:Nw,...er,toJSON(){return{_id:\"effect/Queue\",state:this.state._tag,size:rY(this)}}},Pn=e=>ne(t=>{let r=Object.create(X8);return r.dispatcher=t.currentDispatcher,r.capacity=e?.capacity??Number.POSITIVE_INFINITY,r.strategy=e?.strategy??\"suspend\",r.messages=Os(),r.scheduleRunning=!1,r.state={_tag:\"Open\",takers:new Set,offers:new Set,awaiters:new Set},D(r)}),Bp=e=>Pn({capacity:e});var YD=()=>Pn(),yn=l(2,(e,t)=>re(()=>Vx(e,t)?Qx:e.state._tag===\"Open\"&&e.strategy===\"suspend\"?aY(e,t):XD)),Vx=(e,t)=>e.state._tag!==\"Open\"?!1:e.messages.length>=e.capacity?e.strategy===\"sliding\"?(Ji(e.messages),lo(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0?(lo(e.messages,t),e1(e),!0):!1:(lo(e.messages,t),Gx(e),!0),Ki=l(2,(e,t)=>mt(r=>{let n=Zx(e,t);return n.length===0||e.strategy===\"dropping\"?r(we(n)):r1(e,{_tag:\"Array\",remaining:n,offset:0,resume:r})})),Zx=(e,t)=>{if(e.state._tag!==\"Open\")return Ve(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy===\"sliding\")return Mx(e.messages,t),e.strategy===\"sliding\"&&Wi(e.messages,e.messages.length-e.capacity),Gx(e),[];let r=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(r===0)return Ve(t);let n=[],o=0;for(let s of t)oz(()=>ba(e,t))),ba=(e,t)=>{if(e.state._tag!==\"Open\")return!1;let r=qt(t),n=zk(r,nY);return e.state.offers.size===0&&e.messages.length===0?(Xx(e,n),!0):(e.state={...e.state,_tag:\"Closing\",exit:n},Gx(e),!0)},Dw=e=>Yt(e,lc(ja())),Yx=e=>ba(e,lc(ja()));var po=e=>z(()=>eY(e)),eY=e=>{if(e.state._tag===\"Done\")return!1;vs(e.messages);let t=e.state.offers;Xx(e,e.state._tag===\"Open\"?oY:e.state.exit);for(let r of t)n1(r);return!0};var Ku=e=>QD(e,1,Number.POSITIVE_INFINITY);var QD=l(3,(e,t,r)=>(t=rt(t),r=rt(r),re(()=>sY(e,t,r)??No(t1(e,()=>Lw(e,t)),QD(e,t,r))))),_s=e=>re(()=>tY(e)??No(t1(e,()=>Lw(e,1)),_s(e)));var tY=e=>{if(e.state._tag===\"Done\")return e.state.exit;if(e.messages.length>0){let t=Ji(e.messages);return Uw(e),we(t)}else if(e.capacity<=0&&e.state.offers.size>0){let t=o1(e.state.offers);return Uw(e),we(t)}};var rY=e=>e.state._tag===\"Done\"?0:e.messages.length;var XD=we(!1),Qx=we(!0),nY=tn(ja()),oY=Oc(),e1=e=>{if(!(e.state._tag===\"Done\"||e.state.takers.size===0)){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(lr),e.messages.length===0))break}},Gx=e=>{e.scheduleRunning||e.state._tag===\"Done\"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,e1(e)},0))},sY=(e,t,r)=>{if(e.state._tag===\"Done\")return e.state.exit;if(r<=0||t<=0)return we([]);if(!Lw(e,t))return;let n=e.messages.length>0?Wi(e.messages,r):[o1(e.state.offers)];return Uw(e),we(n)},Lw=(e,t)=>e.messages.length>=(e.state._tag===\"Closing\"?1:Math.min(t,e.capacity||1))||e.capacity<=0&&e.state._tag!==\"Done\"&&e.state.offers.size>0,t1=(e,t)=>mt(r=>{if(e.state._tag===\"Done\")return r(e.state.exit);if(t())return r(lr);let n={ready:t,resume:r};return e.state.takers.add(n),z(()=>{e.state._tag!==\"Done\"&&e.state.takers.delete(n)})}),aY=(e,t)=>mt(r=>Vx(e,t)?r(Qx):r1(e,{_tag:\"Single\",message:t,resume:r})),r1=(e,t)=>{if(e.state._tag!==\"Open\")return n1(t);let r=e.state.offers;return r.add(t),z(()=>{e.state._tag!==\"Done\"&&(r.delete(t),e.state._tag===\"Closing\"&&r.size===0&&e.messages.length===0&&Xx(e,e.state.exit))})},n1=e=>e._tag===\"Single\"?e.resume(XD):e.resume(we(e.remaining.slice(e.offset))),o1=e=>{let t=e.values().next().value;if(t._tag===\"Single\")return e.delete(t),t.resume(Qx),t.message;let r=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(we([]))),r},Uw=e=>{if(e.state._tag===\"Done\")return ys(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===\"Closing\"&&e.messages.length===0?(Xx(e,e.state.exit),ys(e.state.exit.cause)):!1;for(let t of e.state.offers){let r=e.capacity-e.messages.length;if(r<=0)break;if(t._tag===\"Single\")lo(e.messages,t.message),e.state.offers.delete(t),t.resume(Qx);else{for(;t.offset{if(e.state._tag===\"Done\")return;let r=e.state;e.state={_tag:\"Done\",exit:t};for(let n of r.takers)n.resume(t);r.takers.clear();for(let n of r.awaiters)n(t);r.awaiters.clear()};var eg=e=>new Bw(e),s1=(e,t,r)=>mt(n=>{if(e.free>=t)return n(r);let o=()=>{e.free{e.waiters.delete(o)})}),Bw=class{waiters=new Set;taken=0;permits;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take(t){let r=re(()=>this.freethis.free0&&t.currentDispatcher.scheduleTask(()=>{for(let n of this.waiters){if(this.free<=0)break;n()}},0),this.free}resize(t){return ne(r=>(this.permits=t,this.free<0?le:(this.releaseUnsafe(r,0),le)))}release(t){return ne(r=>D(this.releaseUnsafe(r,t)))}get releaseAll(){return ne(t=>D(this.releaseUnsafe(t,this.taken)))}withPermits(t){return r=>jn(n=>{let o=re(()=>{if(this.freeo)}return this.taken+=t,Bn(n(r),()=>{this.releaseUnsafe(fs(),t)},!0)});return o})}withPermit=this.withPermits(1);withPermitsIfAvailable(t){return r=>jn(n=>this.free{this.releaseUnsafe(fs(),t)},!0)))}};var jw=e=>dl(e)?Ke(e)?ee(e.value):e:g(e);var f1=\"~effect/Channel\",ir=e=>A(e,f1),iY={[f1]:{_Env:R,_InErr:R,_InElem:R,_OutErr:R,_OutElem:R},pipe(){return Z(this,arguments)}},ke=e=>{let t=Object.create(iY);return t.transform=(r,n)=>xt(e(r,n),o=>g(it(o))),t},ho=(e,t)=>ke((r,n)=>I(he(e)(r,n),o=>t(o,n))),Qt=e=>ke((t,r)=>e),xo=e=>ke(Se(function*(t,r){let n=Mt(r),o=a=>Le(n,Cb(a)),s=yield*Jn(e(t,r,n),o);return Jn(s,o)})),he=e=>e.transform,jp=4096,cY=(e,t,r)=>Pn({capacity:r?.bufferSize,strategy:r?.strategy}).pipe(Pr(n=>ar(e,po(n))),Pr(n=>Nt(gs(t(n),e),e)));var l1=(e,t)=>ke((r,n)=>j(cY(n,e,t),Ku)),tg=e=>ke((t,r)=>$(()=>he(e())(t,r))),uY=(e,t,r)=>xo(Se(function*(n,o,s){let a=v();yield*Lo(s,c=>Oe(a)?r(a.value,c):Y);let i=yield*bs(e);return a=O(i),yield*he(t(i))(n,o)}));var p1=e=>Qt(te(()=>{let t=e();return $(()=>{let r=t.next();return r.done?ee(r.value):g(r.value)})})),zw=e=>Qt(te(()=>{let t=0;return $(()=>t>=e.length?ee():g(e[t++]))}));var qw=(e,t=jp)=>{let r=En(t);return Qt(te(()=>{let n=e(),o=v();return $(()=>{if(o._tag===\"Some\")return ee(o.value);let s=[];for(;s.lengthqw(()=>e[Symbol.iterator](),t),rg=e=>ng(g(e));var m1=e=>ng(te(e)),Gu=Qt(g(ee())),h1=Qt(g(ui)),Qo=e=>Qt(g(P(e))),x1=e=>Qt(Gm(e)),zp=e=>Qt(it(e)),g1=e=>Qt(Ss(e)),Hw=e=>zp(oi(e)),ng=e=>Qt(te(()=>{let t=!1;return $(()=>t?ee():(t=!0,e))}));var y1=e=>Qt(I(e,()=>ee())),Ww=e=>Qt(g(I(e,jw)));var S1=e=>Qt(g(Ku(e)));var Jw=e=>Qt(g(Vb(VD(e),()=>ee())));var b1=e=>Ea(j($p(e),Jw)),E1=e=>Ea(j($p(e),t=>Ww(Jx(t))));var I1=e=>ke((t,r)=>fY({scope:r,readable:e.evaluate(),onError:e.onError,releaseLockOnEnd:e.releaseLockOnEnd}));var fY=e=>{let t=e.readable.getReader(),r=e.exit??Wu(void 0),n=$(()=>r.current?r.current:fi(Hc({try:()=>t.read(),catch:e.onError}),{onFailure:o=>r.current??it(o),onSuccess:({done:o,value:s})=>r.current?r.current:o?ee():g(be(s))}));return Ft(ar(e.scope,e.releaseLockOnEnd?te(()=>t.releaseLock()):Km(()=>t.cancel().catch(Un))),n)},lY=(e,t)=>ke(Se(function*(r,n){let o=e[Symbol.asyncIterator]();return o.return&&(yield*ar(n,Km(()=>o.return()))),I(Hc({try:()=>o.next(),catch:t}),s=>s.done?ee(s.value):g(s.value))})),T1=(e,t)=>go(lY(e,t),be),go=l(2,(e,t)=>ho(e,r=>te(()=>{let n=0;return j(r,o=>t(o,n++))})));var w1=e=>e===void 0||e!==\"unbounded\"&&e<=1,og=l(e=>ir(e[0]),(e,t,r)=>w1(r?.concurrency)?C1(e,t):pY(e,t,r)),C1=(e,t)=>ke((r,n)=>{let o=0;return j(he(e)(r,n),I(s=>t(s,o++)))}),pY=(e,t,r)=>xo(Se(function*(n,o,s){let a=0,i=yield*he(e)(n,o),c=r.concurrency===\"unbounded\"?Number.MAX_SAFE_INTEGER:r.concurrency,u=yield*Bp(0);yield*ar(s,po(u));let f=_n(yield*li()),p=ya(s);if(r.unordered){let d=eg(c),m=je(d.release(1)),x=fi({onFailure:y=>I(Yt(u,y),m),onSuccess:y=>I(yn(u,y),m)});yield*d.take(1).pipe(I(()=>i),I(y=>{let S=a++;return p(f(x($(()=>t(y,S))))),Y}),$t({disableYield:!0}),xt(y=>d.withPermits(c-1)(Yt(u,y))),Nt(s))}else{let d=yield*Bp(c-2);yield*ar(s,po(d)),yield*_s(d).pipe(Ub,I(y=>yn(u,y)),$t({disableYield:!0}),xt(y=>Yt(u,y)),Nt(s));let m,x=y=>{y._tag!==\"Success\"&&(m=y.cause,ba(u,y.cause))};yield*i.pipe(I(y=>{if(m)return it(m);let S=a++,w=f($(()=>t(y,S)));return p(w),w.addObserver(x),yn(d,ga(w))}),$t({disableYield:!0}),xt(y=>yn(d,Ur(y)).pipe(mr(Yt(d,y)))),Nt(s))}return _s(u)}));var Kw=l(e=>ir(e[0]),(e,t,r)=>w1(r?.concurrency)?dY(e,t):mY(e,t,r)),dY=(e,t)=>ke((r,n)=>j(he(e)(r,n),o=>{let s,a,i=I(o,u=>(a??=Mt(n),nt(he(t(u))(r,a),f=>(s=c(f),s)))),c=Xe(u=>{if(s=void 0,a.state._tag===\"Empty\")return i;let f=Le(a,ht);return a=void 0,I(f,()=>i)});return $(()=>s??i)})),mY=(e,t,r)=>e.pipe(go(t),ig(r)),A1=l(2,(e,t)=>ke((r,n)=>te(()=>{let o,s=Mt(n),a=I(he(e)(r,s),i=>(o=Xe(i,c=>Le(s,ht).pipe(I(()=>he(t(c))(r,n)),I(u=>(o=u,u)))),o));return $(()=>o??a)})));var Gw=l(4,(e,t,r,n)=>ke(Se(function*(o,s){let a=yield*he(e)(o,s),i=yield*he(t)(o,s),c=r();return $(()=>{let u=n(c,a,i);return j(u,([f,p])=>(c=p,f))})}))),k1=l(2,(e,t)=>ke((r,n)=>te(()=>{let o,s=Mt(n),a=I(he(e)(r,s),i=>{let c=i.pipe(Pr(()=>(o=i,Y)),Xe(u=>Le(s,pr(u)).pipe(mr(he(t(u))(r,n)),I(f=>(o=f,f)))));return o=c,c});return $(()=>o??a)}))),v1=e=>Kw(e,R),Sr=e=>ho(e,t=>{let r,n=0,o=$(function s(){if(r===void 0)return I(t,i=>{switch(i.length){case 0:return s();case 1:return g(i[0]);default:return r=i,g(i[n++])}});let a=r[n++];return n>=r.length&&(r=void 0,n=0),g(a)});return g(o)}),O1=e=>C1(e,jw),_1=e=>ho(e,t=>g($t(t,{disableYield:!0}))),R1=l(2,(e,t)=>Hn(typeof t==\"function\"?t(R):t).pipe(j(r=>{let n=Jt.defaultValue();return P1(lg(e,Jt,te(()=>n)),o=>r(o).pipe(j(s=>{n=s}),Xe(()=>ee(o))))}),Ea)),P1=(e,t)=>ke((r,n)=>te(()=>{let o,s=()=>{let a=Mt(n);return I(he(e)(r,a),i=>(o=Xe(i,c=>Le(a,ht).pipe(I(()=>t(c)),I(s))),o))};return $(()=>o??s())})),M1=e=>P1(e,()=>Y),F1=l(2,(e,t)=>ho(e,(r,n)=>j(Il(t),o=>Pr(r,o)))),N1=l(2,(e,t)=>ke((r,n)=>j(he(e)(r,n),o=>I(o,function s(a){return t(a)?g(a):I(o,s)}))));var U1=l(2,(e,t)=>ho(e,r=>g(I(r,function n(o){let s=[];for(let a=0;aho(e,r=>g(I(r,function n(o){let s=[];for(let a=0;aho(e,r=>{let n=I(r,o=>jb(o,t));return g(I(n,function o(s){return Qe(s)?g(s):I(n,o)}))})),$1=l(2,(e,t)=>ho(e,r=>g(I(r,function n(o){return I(zb(o,t),s=>Qe(s)?g(s):I(r,n))})))),Vu=l(e=>ir(e[0]),(e,t,r,n)=>ke((o,s)=>j(he(e)(o,s),a=>{let i=t(),c,u=0,f,p=fi(a,{onFailure(m){f=m;let x=n?.onHalt&&n.onHalt(i);return x&&x.length>0?g([i,x]):it(m)},onSuccess(m){let x=r(i,m);return lA(x)?g(x):x}});return $(function m(){if(c===void 0)return f?it(f):I(p,([y,S])=>(i=y,S.length===0?m():S.length===1?g(S[0]):(c=S,m())));let x=c[u++];return u>=c.length&&(c=void 0,u=0),g(x)})})));var B1=l(3,(e,t,r)=>ke((n,o)=>j(he(e)(n,o),s=>{let a=t,i=!0;return $(()=>i?(i=!1,g(a)):j(I(s,c=>r(a,c)),c=>(a=c,a)))}))),Zu=l(2,(e,t)=>ke((r,n)=>{let o=Mt(n);return j(he(e)(r,o),s=>{let a=s.pipe(xt(i=>{if(ys(i))return it(i);let c=o;return o=Mt(n),Le(c,Ur(i)).pipe(mr(he(t(i))(r,o)),I(u=>(a=u,u)))}));return $(()=>a)})})),j1=l(2,(e,t)=>ag(e,ll,t)),sg=l(2,(e,t)=>Zu(e,r=>y1(I(t(r),n=>it(r))))),z1=l(3,(e,t,r)=>Zu(e,n=>t(n)?r(n):zp(n))),ag=l(3,(e,t,r)=>Zu(e,n=>{let o=t(n);return ce(o)?zp(o.failure):r(o.success,n)})),mo=l(2,(e,t)=>ag(e,eb,r=>t(r)));var q1=l(2,(e,t)=>ho(e,r=>g(Ym(r,n=>Dc(n)?Y:na(t(n)))))),H1=l(e=>ir(e[0]),(e,t,r,n)=>mo(e,o=>t(o)?r(o):n?n(o):Qo(o))),W1=l(e=>ir(e[0]),(e,t,r,n)=>mo(e,o=>{let s=t(o);return ce(s)?n?n(s.failure):Qo(s.failure):r(s.success)}));var J1=l(e=>ir(e[0]),(e,t,r,n,o)=>mo(e,s=>{if(Ct(s,t)&&A(s,\"reason\")){let a=s.reason;return Ct(a,r)?n(a,s):o?o(a,s):Qo(s)}return Qo(s)})),K1=l(e=>ir(e[0]),(e,t,r,n)=>{let o;return mo(e,s=>{if(Ct(s,t)&&A(s,\"reason\")&&A(s.reason,\"_tag\")&&jm(s.reason._tag)){let a=s.reason;return o??=new Set(Object.keys(r)),o.has(a._tag)?r[a._tag](a,s):n?n(a,s):Qo(s)}return Qo(s)})});var G1=l(2,(e,t)=>mo(e,r=>Qo(t(r)))),V1=e=>mo(e,Hw),Z1=l(e=>ir(e[0]),(e,t)=>{if(!t?.log)return mo(e,()=>Gu);let r=th(t.log===!0?void 0:t.log);return mo(sg(e,n=>XS(n)?r(n):Y),()=>Gu)}),c1=e=>Zu(e,()=>Gu),Y1=l(e=>ir(e[0]),(e,t)=>{if(!t?.log)return c1(e);let r=th(t.log===!0?void 0:t.log);return c1(sg(e,n=>r(n)))}),Q1=l(2,(e,t)=>tg(()=>{let r,n=Jt.defaultValue(),o=lg(e,Jt,te(()=>n)),s=Yw(o,()=>(r=void 0,Y)),a=typeof t==\"function\"?t(R):t,i=mo(s,Se(function*(c){return r||(r=yield*Hn(a)),n=yield*r(c),i},(c,u)=>Xe(c,()=>g(Qo(u))),Ea));return i})),X1=l(e=>ir(e[0]),(e,t,r)=>e.pipe(go(t),ig({...r,concurrency:r?.concurrency??1,switch:!0}))),ig=l(2,(e,{bufferSize:t=16,concurrency:r,switch:n=!1})=>xo(Se(function*(o,s,a){let i=r===\"unbounded\"?Number.MAX_SAFE_INTEGER:Math.max(1,r),c=n?void 0:eg(i),u=yield*jD(!0),f=new Set,p=yield*Bp(t);yield*ar(a,po(p));let d=yield*he(e)(o,s);return yield*dr(function*(){for(;;){let m;c&&(f.size=i;){let E=sA(f);f.delete(E),f.size===0&&(yield*u.open),yield*fo(E)}let w=yield*S.pipe(Pr(()=>Ol),I(E=>yn(p,E)),$t({disableYield:!0}),Jn(Se(function*(E){let M=jc(E);if(yield*kn(Le(y,ce(M)?Ur(M.failure):pr(M.success.value))),!!f.has(w)&&(f.delete(w),c&&(yield*c.release(1)),f.size===0&&(yield*u.open),!at(M)))return yield*Yt(p,E)})),Gc);u.closeUnsafe(),f.add(w)}}).pipe(xt(m=>{let x=jc(m);return at(x)?u.whenOpen(Yt(p,m)):Yt(p,m)}),Nt(a)),_s(p)}))),cg=l(e=>ir(e[0])&&ir(e[1]),(e,t,r)=>xo(Se(function*(n,o,s){let a=r?.haltStrategy??\"both\",i=yield*Bp(0);yield*ar(s,po(i));let c=0;function u(p,d){if(c++,!ys(d))return Yt(i,d);switch(a){case\"both\":return c===2?Yt(i,d):Y;case\"left\":case\"right\":return p===a?Yt(i,d):Y;case\"either\":return Yt(i,d)}}let f=(p,d,m)=>he(d)(n,m).pipe(I(x=>x.pipe(I(y=>yn(i,y)),$t)),Jn(x=>mr(Le(m,Cb(x)),u(p,x))),Nt(s));return yield*f(\"left\",e,Mt(s)),yield*f(\"right\",t,Mt(s)),_s(i)}))),e2=l(2,(e,t)=>cg(e,y1(t),{haltStrategy:\"left\"})),t2=()=>ke((e,t)=>te(()=>{let r=\"\",n=!1,o=v();function s(c){let u=[];function f(p){r.length===0?u.push(p):(u.push(r+p),r=\"\")}for(let p=0;po._tag===\"Some\"?ee(o.value):qm(e,{onSuccess:i,onFailure:it,onDone:c=>{if(o=O(c),r.length>0){let u=r;return r=\"\",n=!1,g([u])}return ee(c)}}));function i(c){let u=s(c);return u!==null?g(u):a}return a}));var Vw=l(2,(e,t)=>ke((r,n)=>I(he(e)(r,n),o=>he(t)(o,n)))),Zw=l(2,(e,t)=>ke((r,n)=>I(he(e)(r,n),o=>{let s=xt(o,a=>ys(a)?it(a):Rr(rb(a)));return j(he(t)(s,n),a=>Rl(a,i=>Dc(i)?it(i.value):Rr(i)))}))),Ea=e=>ke((t,r)=>{let n;return g($(()=>n||e.pipe(gs(r),I(o=>he(o)(t,r)),I(o=>n=o))))}),r2=e=>xo((t,r,n)=>j(gs(he(e)(t,r),n),gs(n)));var n2=l(2,(e,t)=>ke(Se(function*(r,n){let o=yield*he(e)(r,n),s=yield*Pn({capacity:t.capacity===\"unbounded\"?void 0:t.capacity,strategy:t.capacity===\"unbounded\"?void 0:t.strategy});return yield*ar(n,po(s)),yield*o.pipe(I(a=>yn(s,a)),$t({disableYield:!0}),Jn(a=>Yt(s,a)),Nt(n)),_s(s)}))),o2=l(2,(e,t)=>ke(Se(function*(r,n){let o=yield*he(e)(r,n),s=yield*Pn({capacity:t.capacity===\"unbounded\"?void 0:t.capacity,strategy:t.capacity===\"unbounded\"?void 0:t.strategy});return yield*ar(n,po(s)),yield*o.pipe(I(a=>Ki(s,a)),$t({disableYield:!0}),Jn(a=>Yt(s,a)),Nt(n)),Ku(s)}))),s2=l(2,(e,t)=>cg(e,Qt(g(I(t,ee))),{haltStrategy:\"either\"})),a2=l(2,(e,t)=>xo(Se(function*(r,n,o){let s=yield*he(e)(r,n),a=yield*Nt(t,o,{startImmediately:!0});return $(()=>{let i=a.pollUnsafe();return i===void 0?s:ib(i,{onFailure:it,onSuccess:ee})})}))),i2=l(2,(e,t)=>qp(e,r=>xs(r)?t(r.cause):Y)),qp=l(2,(e,t)=>xo((r,n,o)=>Lo(o,t).pipe(mr(he(e)(r,n))))),c2=l(2,(e,t)=>Ea(Ft(t,e))),Yw=l(2,(e,t)=>ho(e,r=>te(()=>{let n=!0,o=Pr(r,s=>(n=!1,t(s)));return $(()=>n?o:r)}))),u2=l(2,(e,t)=>ho(e,r=>g(Xe(r,n=>I(t,()=>ee(n)))))),f2=l(2,(e,t)=>qp(e,r=>t)),Gi=(e,t,r)=>$(()=>{let n=An(),o=he(e)(ee(),n);return Xe(I(o,t),r||g).pipe(cn(s=>Le(n,s)))});var ug=l(2,(e,t)=>ke((r,n)=>j(vn(he(e)(r,n),t),vn(t)))),fg=l(3,(e,t,r)=>ke((n,o)=>j(jo(he(e)(n,o),t,r),jo(t,r)))),lg=l(3,(e,t,r)=>ke((n,o)=>I(r,s=>he(fg(e,t,s))(n,o)))),l2=l(e=>ir(e[0]),(e,t,r)=>Mf(t)?ug(e,t):ke((n,o)=>I(r?.local?xl(t,hl(),o):Fm(t,o),s=>j(vn(he(e)(n,o),s),vn(s))))),p2=l(2,(e,t)=>ke((r,n)=>Pl(o=>{let s=t(o);return he(ug(e,s))(r,n)})));var Qw=function(){let e=ir(arguments[0]),t=e?arguments[1]:arguments[0],r=Js(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return u1(n,t,r)}return n=>u1(n,t,r)},u1=(e,t,r)=>uY(Zb(t,r),n=>fg(e,Za,n),(n,o)=>an(s=>{let a=s.getRef(Nr),i=s.getRef(JO);return Am(n,o,a,i)}));var d2=e=>Gi(e,t=>$t(t,{disableYield:!0})),Vi=l(2,(e,t)=>Gi(e,r=>$t(I(r,t),{disableYield:!0}))),m2=l(2,(e,t)=>Gi(e,r=>r.pipe(I(t),I(n=>n?Y:ee()),$t({disableYield:!0})))),Xw=e=>j(Zi(e,()=>({bytes:0,arrays:[]}),(t,r)=>{for(let n=0;n{let n=new Uint8Array(r),o=0;for(let s=0;s$(()=>{let t=v();return Gi(e,r=>r.pipe(Vm,I(n=>(t=n,ee()))),()=>g(t))}),x2=e=>$(()=>{let t=Symbol(),r=t;return Gi(e,n=>$t(I(n,o=>(r=o,Y)),{disableYield:!0}),()=>r===t?ra:Nb(r))}),Zi=l(3,(e,t,r)=>$(()=>{let n=t();return Gi(e,o=>Wn({while:Er,body:()=>o,step:s=>{n=r(n,s)}}),()=>g(n))})),g2=l(3,(e,t,r)=>$(()=>{let n=t();return Gi(e,o=>Wn({while:Er,body:je(o.pipe(I(s=>r(n,s)),j(s=>{n=s}))),step:Un}),()=>g(n))})),e0=Se(function*(e){let t=eg(1),r=yield*li(),n=Fe(r,_r);return(yield*he(e)(ee(),n)).pipe(vn(r),t.withPermits(1))},xt(e=>g(it(e)))),Xo=(e,t)=>he(e)(ee(),t);var t0=l(e=>ir(e[0]),(e,t)=>zo(r=>Vi(e,n=>Ki(t,n)).pipe(r,kn,I(n=>(Ke(n)?Yx(t):ba(t,n.cause),Y)))));var y2=l(e=>ir(e[0]),Se(function*(e,t){let r=yield*pi,n=yield*Pn({capacity:typeof t.capacity==\"number\"?t.capacity:void 0,strategy:typeof t.capacity==\"number\"?t.strategy:void 0});return yield*ar(r,po(n)),yield*Nt(t0(e,n),r),n}));var S2=e=>di(e.capacity===\"unbounded\"?qx(e):e.strategy===\"dropping\"?jx(e):e.strategy===\"sliding\"?zx(e):Bx(e),Lp),b2=l(2,Se(function*(e,t){let r=yield*S2(t);return yield*Vc(r0(e,r,{shutdownOnEnd:t.shutdownOnEnd!==!1})),r})),r0=l(e=>ir(e[0]),(e,t,r)=>Vi(e,n=>GD(t,n)).pipe(r?.shutdownOnEnd===!0?mi(Lp(t)):R)),E2=l(2,Se(function*(e,t){let r=yield*S2(t);return yield*Vi(e,n=>Wx(r,n)).pipe(cn(n=>Hx(r,n)),Vc),r}));var Mr={};Eo(Mr,{Array:()=>OX,Boolean:()=>RX,ByteSize:()=>MX,ConfigError:()=>nf,Date:()=>LX,Duration:()=>PX,Finite:()=>CX,Int:()=>AX,Literal:()=>kX,Literals:()=>vX,LogLevel:()=>NX,NonEmptyString:()=>TX,Number:()=>wX,Port:()=>FX,Record:()=>_X,Redacted:()=>UX,String:()=>IX,URL:()=>DX,all:()=>JL,fail:()=>bX,flatMap:()=>lX,isConfig:()=>HL,map:()=>WL,mapEffect:()=>pX,nested:()=>$X,option:()=>mX,orElse:()=>dX,schema:()=>Xt,succeed:()=>EX,unwrap:()=>GL,withDefault:()=>KL});var rf={};Eo(rf,{ConfigProvider:()=>ec,SourceError:()=>gg,constantCase:()=>G7,fromDir:()=>uX,fromDotEnv:()=>cX,fromDotEnvContents:()=>$L,fromEnv:()=>LL,fromEnvRecord:()=>A0,fromUnknown:()=>Q7,layer:()=>Z7,layerAdd:()=>Y7,make:()=>Sg,makeArray:()=>w0,makeRecord:()=>yg,makeValue:()=>Gp,mapInput:()=>C0,nested:()=>V7,orElse:()=>T0});var I2=\"~effect/PlatformError\",Yu=class extends Fr(\"BadArgument\"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:\"\"}`}};var T2=class extends Fr(\"PlatformError\"){constructor(t){\"cause\"in t?super({reason:t,cause:t.cause}):super({reason:t})}[I2]=I2;get message(){return this.reason.message}};var xY=\"~effect/Stream\",gY={_R:R,_E:R,_A:R},w2=function(e){this.channel=e};w2.prototype={[xY]:gY,pipe(){return Z(this,arguments)}};var C2=e=>new w2(e);var SY=\"~effect/Sink\";var bY={_A:R,_In:R,_L:R,_E:R,_R:R},EY={[SY]:bY,pipe(){return Z(this,arguments)}};var IY=e=>{let t=Object.create(EY);return t.transform=e,t},A2=e=>ke((t,r)=>g(I(e.transform(t,r),ee)));var k2=e=>{let t=rt(e);return IY(r=>{let n=[];if(t===0)return g([n]);let o;return r.pipe(I(s=>{if(n.length+s.length<=t)return n.push(...s),n.length===t?ee():Y;for(let a=0;ag([n,o])))})};var es={};Eo(es,{DefaultChunkSize:()=>j2,Do:()=>l7,TypeId:()=>B2,accumulate:()=>G9,aggregate:()=>B9,aggregateWithin:()=>h0,as:()=>rQ,bind:()=>d7,bindEffect:()=>m7,bindTo:()=>h7,broadcast:()=>hL,broadcastN:()=>j9,buffer:()=>KQ,bufferArray:()=>GQ,callback:()=>H2,catch:()=>Kp,catchCause:()=>tL,catchCauseFilter:()=>o9,catchCauseIf:()=>n9,catchDefect:()=>VQ,catchFilter:()=>d0,catchIf:()=>nL,catchReason:()=>e9,catchReasons:()=>t9,catchTag:()=>QQ,catchTags:()=>XQ,changes:()=>V9,changesWith:()=>xL,changesWithEffect:()=>Z9,chunks:()=>fL,collect:()=>K9,combine:()=>T9,combineArray:()=>w9,concat:()=>ef,cross:()=>AQ,crossWith:()=>X2,debounce:()=>_9,decodeText:()=>Y9,die:()=>LY,drain:()=>lQ,drainFork:()=>pQ,drop:()=>m0,dropRight:()=>b9,dropUntil:()=>g9,dropUntilEffect:()=>y9,dropWhile:()=>cL,dropWhileEffect:()=>uL,dropWhileFilter:()=>S9,empty:()=>Ps,encodeText:()=>Q9,ensuring:()=>a7,fail:()=>Qu,failCause:()=>W2,failCauseSync:()=>$Y,failSync:()=>DY,filter:()=>$Q,filterEffect:()=>jQ,filterMap:()=>BQ,filterMapEffect:()=>zQ,flatMap:()=>tf,flatten:()=>Z2,flattenArray:()=>fQ,flattenEffect:()=>oQ,flattenIterable:()=>yQ,flattenTake:()=>SQ,forever:()=>gQ,fromArray:()=>dg,fromArrayEffect:()=>qY,fromArrays:()=>HY,fromAsyncIterable:()=>KY,fromChannel:()=>k,fromEffect:()=>pg,fromEffectDrain:()=>z2,fromEffectRepeat:()=>q2,fromEffectSchedule:()=>MY,fromEventListener:()=>ZY,fromIterable:()=>Qi,fromIterableEffect:()=>jY,fromIterableEffectRepeat:()=>zY,fromIteratorSucceed:()=>BY,fromPubSub:()=>WY,fromPubSubTake:()=>J2,fromPull:()=>yo,fromQueue:()=>Xu,fromReadableStream:()=>JY,fromSchedule:()=>GY,fromSubscription:()=>VY,groupAdjacentBy:()=>L9,groupBy:()=>U9,groupByKey:()=>D9,grouped:()=>F9,groupedWithin:()=>N9,haltWhen:()=>n7,ignore:()=>c9,ignoreCause:()=>u9,interleave:()=>t7,interleaveWith:()=>yL,interruptWhen:()=>r7,intersperse:()=>gL,intersperseAffixes:()=>e7,isStream:()=>Ee,iterate:()=>QY,let:()=>p7,limitBytes:()=>d9,make:()=>NY,map:()=>Kr,mapAccum:()=>C9,mapAccumArray:()=>Xi,mapAccumArrayEffect:()=>k9,mapAccumEffect:()=>A9,mapArray:()=>G2,mapArrayEffect:()=>sQ,mapBoth:()=>nQ,mapEffect:()=>Jp,mapError:()=>oL,merge:()=>c0,mergeAll:()=>CQ,mergeEffect:()=>mg,mergeLeft:()=>TQ,mergeResult:()=>IQ,mergeRight:()=>wQ,mkArrayBuffer:()=>A7,mkString:()=>C7,mkUint8Array:()=>k7,never:()=>eQ,onEnd:()=>s7,onError:()=>o7,onExit:()=>SL,onFirst:()=>EL,onStart:()=>bL,orDie:()=>i9,orElseIfEmpty:()=>s9,orElseSucceed:()=>a9,paginate:()=>YY,partition:()=>HQ,partitionEffect:()=>qQ,partitionQueue:()=>l0,peel:()=>JQ,pipeThrough:()=>J9,pipeThroughChannel:()=>H9,pipeThroughChannelOrFail:()=>W9,prepend:()=>EQ,provide:()=>IL,provideContext:()=>i7,provideService:()=>c7,provideServiceEffect:()=>x0,race:()=>LQ,raceAll:()=>eL,range:()=>XY,rechunk:()=>lL,repeat:()=>dQ,repeatElements:()=>xQ,result:()=>aQ,retry:()=>f9,run:()=>wL,runCollect:()=>CL,runCount:()=>x7,runDrain:()=>xg,runFold:()=>y7,runFoldEffect:()=>S7,runForEach:()=>I7,runForEachArray:()=>AL,runForEachWhile:()=>T7,runHead:()=>b7,runIntoPubSub:()=>P7,runIntoQueue:()=>N7,runLast:()=>E7,runSum:()=>g7,scan:()=>v9,scanEffect:()=>O9,schedule:()=>mQ,scoped:()=>tQ,service:()=>RY,serviceOption:()=>PY,share:()=>q9,sliding:()=>E9,slidingSize:()=>pL,split:()=>I9,splitLines:()=>X9,succeed:()=>Yi,suspend:()=>Jr,switchMap:()=>uQ,sync:()=>UY,take:()=>p9,takeRight:()=>m9,takeUntil:()=>sL,takeUntilEffect:()=>aL,takeWhile:()=>iL,takeWhileEffect:()=>x9,takeWhileFilter:()=>h9,tap:()=>V2,tapBoth:()=>iQ,tapCause:()=>rL,tapDefect:()=>YQ,tapError:()=>p0,tapErrorTag:()=>ZQ,tapSink:()=>cQ,throttle:()=>M9,throttleEffect:()=>dL,tick:()=>FY,timeout:()=>hQ,timeoutOrElse:()=>Y2,toAsyncIterable:()=>R7,toAsyncIterableEffect:()=>_7,toAsyncIterableWith:()=>y0,toChannel:()=>Mn,toPubSub:()=>M7,toPubSubTake:()=>kL,toPull:()=>w7,toQueue:()=>F7,toReadableStream:()=>v7,toReadableStreamEffect:()=>O7,toReadableStreamWith:()=>g0,transduce:()=>$9,transformPull:()=>Ut,transformPullBracket:()=>i0,unfold:()=>K2,unwrap:()=>Ia,unwrapReason:()=>r9,updateContext:()=>TL,updateService:()=>u7,when:()=>WQ,withExecutionPlan:()=>l9,withSpan:()=>f7,zip:()=>vQ,zipFlatten:()=>RQ,zipLatest:()=>UQ,zipLatestAll:()=>f0,zipLatestWith:()=>DQ,zipLeft:()=>OQ,zipRight:()=>_Q,zipWith:()=>u0,zipWithArray:()=>hg,zipWithIndex:()=>PQ,zipWithNext:()=>MQ,zipWithPrevious:()=>FQ,zipWithPreviousAndNext:()=>NQ});var O2=\"~effect/RcMap\",TY=e=>({[O2]:O2,lookup:e.lookup,context:e.context,scope:e.scope,idleTimeToLive:e.idleTimeToLive,capacity:e.capacity,state:{_tag:\"Open\",map:Fp()},pipe(){return Z(this,arguments)}}),_2=e=>an(t=>{let r=t.context,n=Fe(r,_r),o=TY({lookup:e.lookup,context:r,scope:n,idleTimeToLive:typeof e.idleTimeToLive==\"function\"?Y0(e.idleTimeToLive,We):je(We(e.idleTimeToLive??qs)),capacity:Math.max(e.capacity??Number.POSITIVE_INFINITY,0)});return Ft(Lo(n,()=>{if(o.state._tag===\"Closed\")return Y;let s=o.state.map;return o.state={_tag:\"Closed\"},ta(s,([,a])=>kn(Hp(a))).pipe(Pr(()=>te(()=>{_x(s)})))}),o)}),o0=l(2,(e,t)=>zo(r=>{if(e.state._tag===\"Closed\")return On;let n=e.state,o=Hu(),s=Yo(n.map,t),a;if(s._tag===\"Some\")a=s.value,a.refCount++;else{if(Number.isFinite(e.capacity)&&LD(e.state.map)>=e.capacity)return P(new nb(`RcMap attempted to exceed capacity of ${e.capacity}`));{a={deferred:si(),scope:An(),idleTimeToLive:e.idleTimeToLive(t),finalizer:void 0,fiber:void 0,expiresAt:0,refCount:1},a.finalizer=CY(e,t,a),Np(n.map,t,a);let c=new Map(e.context.mapUnsafe);o.context.mapUnsafe.forEach((f,p)=>{c.set(p,f)}),c.set(_r.key,a.scope);let u=_o(c);$(()=>e.lookup(t)).pipe(_n(u),ya(a.scope)).addObserver(f=>{ab(f)&&wY(e,t,a,u),Do(a.deferred,f)})}}let i=Ro(o.context,_r);return ar(i,a.finalizer).pipe(mr(r(_m(a.deferred))))}));var wY=(e,t,r,n)=>{if(e.state._tag===\"Closed\")return;let o=Yo(e.state.map,t);o._tag===\"None\"||o.value!==r||(qu(e.state.map,t),!(r.refCount>0)&&Hp(r).pipe(_n(n),ya(e.scope)))},Hp=e=>e.fiber?fo(e.fiber).pipe(mr(Le(e.scope,ht))):Le(e.scope,ht),CY=(e,t,r)=>an(n=>{if(r.refCount--,r.refCount>0)return Y;if(e.state._tag===\"Closed\")return Hp(r);let o=Yo(e.state.map,t);if(o._tag===\"None\"||o.value!==r)return Hp(r);if(Ic(r.idleTimeToLive))return qu(e.state.map,t),Hp(r);if(!Ws(r.idleTimeToLive))return Y;let s=n.getRef(Lc);return r.expiresAt=s.currentTimeMillisUnsafe()+kr(r.idleTimeToLive),r.fiber?Y:(r.fiber=zo(function a(i){let c=s.currentTimeMillisUnsafe(),u=r.expiresAt-c;if(u<=0){if(e.state._tag===\"Closed\"||r.refCount>0)return Y;let f=Yo(e.state.map,t);return f._tag===\"None\"||f.value!==r?Y:(qu(e.state.map,t),Le(r.scope,ht))}return I(i(s.sleep(Hs(u))),()=>a(i))}).pipe(mi(te(()=>{r.fiber=void 0})),_n(n.context),ya(e.scope)),Y)});var s0=l(2,(e,t)=>hi(r=>{if(e.state._tag===\"Closed\")return Y;let n=Yo(e.state.map,t);if(n._tag===\"None\"||Ic(n.value.idleTimeToLive))return Y;let o=n.value;return o.expiresAt=r.currentTimeMillisUnsafe()+kr(o.idleTimeToLive),Y}));var AY=\"~effect/RcRef\",Wp={_tag:\"Empty\"},kY={_tag:\"Closed\"},vY={_A:R,_E:R},a0=class{[AY]=vY;pipe(){return Z(this,arguments)}state=Wp;acquire;context;scope;idleTimeToLive;constructor(t,r,n,o){this.acquire=t,this.context=r,this.scope=n,this.idleTimeToLive=o}},M2=e=>an(t=>{let r=t.context,n=Fe(r,_r),o=new a0(e.acquire,r,n,e.idleTimeToLive!==void 0?We(e.idleTimeToLive):void 0);return Ft(Lo(n,()=>{let s=o.state;return o.state=kY,s._tag===\"Acquired\"?Le(s.scope,ht):s._tag===\"Acquiring\"?fo(s.fiber):Y}),o)}),OY=(e,t)=>{switch(e.state._tag){case\"Closed\":return On;case\"Acquired\":{let r=e.state;return r.refCount++,r.fiber?Ft(fo(r.fiber),r):g(r)}case\"Acquiring\":{let r=e.state;return r.awaiters++,P2(e,r,t)}case\"Empty\":{let r={_tag:\"Acquiring\",fiber:void 0,awaiters:1,acquired:void 0};e.state=r;let n=An(),o=vn(e.acquire,Wt(e.context,_r,n)).pipe(I(s=>{if(e.state!==r)return On;let a={_tag:\"Acquired\",value:s,scope:n,fiber:void 0,refCount:r.awaiters,invalidated:!1};return e.state=a,r.acquired=a,g(a)}),cn(s=>Ke(s)?Y:(e.state===r&&(e.state=Wp),Le(n,s))));return r.fiber=_n(Hu().context)(o),P2(e,r,t)}}},P2=(e,t,r)=>cn(r(ga(t.fiber)),n=>{let o=t.acquired;return o!==void 0?xs(n)?N2(e,o):Y:--t.awaiters>0||e.state!==t?Y:(e.state=Wp,fo(t.fiber))}),F2=e=>{let t=e;return zo(r=>I(pi,n=>I(OY(t,r),o=>Ft(Lo(n,()=>N2(t,o)),o.value))))},N2=(e,t)=>{if(t.refCount--,t.refCount>0)return Y;let r=e.idleTimeToLive;return r===void 0||t.invalidated?(e.state===t&&(e.state=Wp),Le(t.scope,ht)):Ws(r)?(t.fiber=zo(n=>I(n(sa(r)),()=>e.state===t&&t.refCount===0?(e.state=Wp,Le(t.scope,ht)):Y)).pipe(mi(te(()=>{t.fiber=void 0})),_n(e.context),ya(e.scope)),Y):Y};var U2=M2,D2=F2;var B2=\"~effect/Stream\",Ee=e=>A(e,B2),j2=jp,k=C2,pg=e=>k(ng(j(e,be))),RY=e=>pg(Wb(e)),PY=e=>pg(Jb(e)),z2=e=>yo(g(I(e,()=>ee()))),q2=e=>yo(g(j(e,be))),MY=(e,t)=>yo(dr(function*(){let r=yield*Hn(t),n=yield*jo(e,Jt,Jt.defaultValue()),o=!0,s=$(()=>r(n)).pipe(I(a=>jo(e,Jt,a)),j(a=>(n=a,be(a))));return $(()=>o?(o=!1,g(be(n))):s)})),FY=e=>yo(te(()=>{let t=!0,r=g(be(void 0)),n=$b(r,e);return $(()=>t?(t=!1,r):n)})),yo=e=>k(Qt(e)),Ut=(e,t)=>k(ke((r,n)=>I(Xo(e.channel,n),o=>t(o,n)))),i0=(e,t)=>k(xo((r,n,o)=>I(Xo(e.channel,n),s=>t(s,n,o)))),Mn=e=>e.channel,H2=(e,t)=>k(l1(e,t)),Ps=k(Gu),Yi=e=>k(rg(be(e))),NY=(...e)=>dg(e),UY=e=>k(m1(()=>be(e()))),Jr=e=>k(tg(()=>e().channel)),Qu=e=>k(Qo(e)),DY=e=>k(x1(e)),W2=e=>k(zp(e)),LY=e=>k(Hw(e)),$Y=e=>k(g1(e)),BY=(e,t)=>k(qw(()=>e,t)),Qi=(e,t)=>Array.isArray(e)&&t?.chunkSize===void 0?dg(e):k(d1(e,t?.chunkSize)),jY=e=>Ia(j(e,Qi)),zY=e=>tf(q2(e),Qi),dg=e=>Qe(e)?k(rg(e)):Ps,qY=e=>Ia(j(e,dg)),HY=(...e)=>k(zw(Ld(e,Qe))),Xu=e=>k(S1(e)),WY=e=>k(b1(e)),J2=e=>k(E1(e)),JY=e=>k(I1(e)),KY=(e,t)=>k(T1(e,t)),GY=e=>yo(j(Il(e),t=>Xe(j(t(void 0),be),()=>ee()))),VY=e=>k(Jw(e)),ZY=(e,t,r)=>H2(n=>{let o=typeof r==\"object\"&&r.once;function s(a){Vx(n,a),o&&Yx(n)}return di(te(()=>e.addEventListener(t,s,r)),()=>te(()=>e.removeEventListener(t,s,r)))},{bufferSize:typeof r==\"object\"?r.bufferSize:void 0}),K2=(e,t)=>yo(te(()=>{let r=e;return I($(()=>t(r)),n=>n===void 0?ee():(r=n[1],g(be(n[0]))))})),YY=(e,t)=>yo(te(()=>{let r=e,n=!1;return $(function o(){return n?ee():I(t(r),([s,a])=>(ue(a)?n=!0:r=a.value,Qe(s)?g(s):o()))})})),QY=(e,t)=>K2(e,r=>g([r,t(r)])),XY=(e,t,r=jp)=>e>t?Ps:yo(te(()=>{let n=En(r),o=e,s=!1;return $(()=>{if(s)return ee();let a=t-o+1;if(a>n){let c=ly(o,o+n-1);return o+=n,g(c)}let i=ly(o,o+a-1);return s=!0,g(i)})})),eQ=k(h1),Ia=e=>k(Ea(j(e,Mn))),tQ=e=>k(r2(e.channel)),Kr=l(2,(e,t)=>Jr(()=>{let r=0;return k(go(e.channel,In(n=>t(n,r++))))})),rQ=l(2,(e,t)=>Kr(e,()=>t)),nQ=l(2,(e,t)=>e.pipe(Kr(t.onElement),oL(t.onError))),G2=l(2,(e,t)=>k(go(e.channel,t))),Jp=l(e=>Ee(e[0]),(e,t,r)=>e.channel.pipe(Sr,og(t,r),go(be),k)),oQ=l(e=>Ee(e[0]),(e,t)=>Jp(e,R,t)),sQ=l(2,(e,t)=>k(og(e.channel,t))),aQ=e=>e.pipe(Kr(B),Kp(t=>Yi(K(t)))),V2=l(e=>Ee(e[0]),(e,t,r)=>Jp(e,n=>Ft(t(n),n),r)),iQ=l(2,(e,t)=>e.pipe(p0(t.onError),V2(t.onElement,{concurrency:t.concurrency}))),cQ=l(2,(e,t)=>i0(e,Se(function*(r,n,o){let s=Wr(),a=Wr(),i,c,u=!1,f=!1,p=s.whenOpen($(()=>{if(i){let m=i;return i=void 0,f||s.closeUnsafe(),Ft(a.open,m)}return ee()}));yield*$(()=>t.transform(p,o)).pipe(m=>Gb(m,x=>(u=!0,xs(x)&&(c=x.cause),a.open),!0),Nt(o));let d=r.pipe(I(m=>(i=m,a.closeUnsafe(),s.openUnsafe(),Ft(a.await,m))),Xe(()=>(f=!0,a.closeUnsafe(),s.openUnsafe(),I(a.await,()=>ee()))));return $(()=>c?it(c):u?r:d)}))),tf=l(e=>Ee(e[0]),(e,t,r)=>e.channel.pipe(Sr,Kw(n=>t(n).channel,r),k)),uQ=l(e=>Ee(e[0]),(e,t,r)=>e.channel.pipe(Sr,X1(n=>t(n).channel,r),k)),Z2=l(e=>Ee(e[0]),(e,t)=>tf(e,R,t)),fQ=e=>k(Sr(e.channel)),lQ=e=>k(_1(e.channel)),pQ=l(2,(e,t)=>mg(e,xg(t))),dQ=l(2,(e,t)=>k(R1(e.channel,t))),mQ=l(2,(e,t)=>e.channel.pipe(Sr,F1(t),go(be),k)),hQ=l(2,(e,t)=>Y2(e,{duration:t,orElse:()=>Ps})),Y2=l(2,(e,t)=>{let r=We(t.duration);if(!Ws(r))return e;if(Ic(r))return Jr(t.orElse);let n=Symbol();return tL(Jr(()=>{let s=Hu().getRef(Lc),a=kr(r),i,c=Wr(!1);return c0(Ut(e,(u,f)=>$(()=>(i=s.currentTimeMillisUnsafe()+a,c.openUnsafe(),u)).pipe(j(p=>(c.closeUnsafe(),i=void 0,p)),g)),z2(dr(function*(){for(;;)if(yield*c.await,!(i===void 0||(yield*sa(i-s.currentTimeMillisUnsafe()),i===void 0)||i-s.currentTimeMillisUnsafe()>0))return yield*Rr(n)})),{haltStrategy:\"left\"})}),o=>o.reasons.find(a=>a._tag===\"Die\"&&a.defect===n)?t.orElse():W2(o))}),xQ=l(2,(e,t)=>k(ke((r,n)=>j(he(Sr(e.channel))(r,n),o=>{let s,a=dr(function*(){let i=yield*o,c=be(i);return s=(yield*Il(t))(i).pipe(Ft(c),Xe(f=>(s=void 0,a))),c});return $(()=>s??a)})))),gQ=e=>k(M1(e.channel)),yQ=e=>tf(e,Qi),SQ=e=>e.channel.pipe(Sr,O1,k),ef=l(2,(e,t)=>{let r=k(v1(p1(()=>bQ(e,t))));return Q2.set(r,[e,t]),r}),Q2=new WeakMap;function*bQ(e,t){let r=[t,e];for(;r.length>0;){let n=r.pop(),o=Q2.get(n);o===void 0?yield n.channel:r.push(o[1],o[0])}}var EQ=l(2,(e,t)=>ef(Qi(t),e)),c0=l(e=>Ee(e[0])&&Ee(e[1]),(e,t,r)=>k(cg(Mn(e),Mn(t),r))),mg=l(2,(e,t)=>e.channel.pipe(e2(t),k)),IQ=l(2,(e,t)=>c0(Kr(e,B),Kr(t,K))),TQ=l(2,(e,t)=>mg(e,xg(t))),wQ=l(2,(e,t)=>mg(t,xg(e))),CQ=l(2,(e,t)=>Z2(Qi(e),t)),AQ=l(2,(e,t)=>X2(e,t,(r,n)=>[r,n])),X2=l(3,(e,t,r)=>tf(e,n=>Kr(t,o=>r(n,o)))),u0=l(3,(e,t,r)=>hg(e,t,kQ(r))),kQ=e=>(t,r)=>{let n=Math.min(t.length,r.length),o=[];for(let s=0;sk(xo(Se(function*(n,o){let s=yield*Xo(e.channel,o),a=yield*Xo(t.channel,o),i=dr(function*(){let f=yield*Nt(s,o),p=yield*Nt(a,o);return yield*BD([f,p])}),c={_tag:\"PullBoth\"};return dr(function*(){let[f,p]=c._tag===\"PullBoth\"?yield*i:c._tag===\"PullLeft\"?[yield*s,c.rightArray]:[c.leftArray,yield*a],d=r(f,p);return Qe(d[1])?c={_tag:\"PullRight\",leftArray:d[1]}:Qe(d[2])?c={_tag:\"PullLeft\",rightArray:d[2]}:c={_tag:\"PullBoth\"},d[0]})})))),vQ=l(2,(e,t)=>u0(e,t,(r,n)=>[r,n])),OQ=l(2,(e,t)=>hg(e,t,(r,n)=>{let o=Math.min(r.length,n.length),s=r.slice(0,o),a=r.slice(o),i=n.slice(o);return[s,a,i]})),_Q=l(2,(e,t)=>hg(e,t,(r,n)=>{let o=Math.min(r.length,n.length),s=n.slice(0,o),a=r.slice(o),i=n.slice(o);return[s,a,i]})),RQ=l(2,(e,t)=>u0(e,t,(r,n)=>[...r,n])),PQ=e=>Kr(e,(t,r)=>[t,r]),MQ=e=>Xi(e,v,(t,r)=>{let n=0;t._tag===\"None\"&&(n=1,t=O(r[0]));let o=Rt();for(;nXi(e,v,(t,r)=>{let n=Rt();for(let o=0;oXi(e,()=>({prev:v(),current:v()}),(t,r)=>{let n=0,o;t.current._tag===\"None\"?(n=1,o=r[0],t.current=O(o)):o=t.current.value;let s=Rt();for(;nk(tg(()=>{let t=[],r=new Set,n=Wr();return ig(zw(e.map((o,s)=>o.channel.pipe(Sr,og(a=>(t[s]=a,r.has(s)?g(be(t.slice())):(r.add(s),r.sizef0(e,t)),DQ=l(3,(e,t,r)=>Kr(f0(e,t),([n,o])=>r(n,o))),eL=(...e)=>k(ke((t,r)=>te(()=>{let n,o=Bb(e.map(s=>{let a=Mt(r);return Xo(s.channel,a).pipe(I(i=>Db(g(i),i)),cn(i=>i._tag===\"Success\"?n?Le(a,i):(n=i.value[0],Y):Le(a,i)),j(([,i])=>i))}));return $(()=>n??o)}))),LQ=l(2,(e,t)=>eL(e,t)),$Q=l(2,(e,t)=>k(U1(Mn(e),t))),BQ=l(2,(e,t)=>k(D1(Mn(e),t))),jQ=l(2,(e,t)=>k(L1(Mn(e),t))),zQ=l(2,(e,t)=>k($1(Mn(e),t))),l0=l(e=>Ee(e[0]),Se(function*(e,t,r){let n=yield*pi,o=yield*Xo(e.channel,n),s=r?.capacity===\"unbounded\"?void 0:r?.capacity??j2,a=yield*Pn({capacity:s}),i=yield*Pn({capacity:s});return yield*dr(function*(){for(;;){let c=yield*o,u=[],f=[];for(let d=0;d0){let d=Zx(a,f);d.length>0&&(p=yield*Gc(Ki(a,d)))}if(u.length>0){let d=Zx(i,u);d.length>0&&(yield*Ki(i,d))}p&&(yield*ga(p))}}).pipe(Jn(c=>(ba(a,c),ba(i,c),Y)),Nt(n)),[a,i]})),qQ=l(e=>Ee(e[0]),(e,t,r)=>j(l0(Jp(e,n=>t(n),r),n=>n,r),([n,o])=>[Xu(n),Xu(o)])),HQ=l(e=>Ee(e[0]),(e,t,r)=>j(l0(e,t,{capacity:r?.capacity??16}),([n,o])=>[Xu(n),Xu(o)])),WQ=l(2,(e,t)=>t.pipe(j(r=>r?e:Ps),Ia)),JQ=l(2,Se(function*(e,t){let r,n=yield*e0(e.channel),o=xt(n,i=>(r=i,it(i))),s=yo(g(o)),a=yield*wL(s,t);return r?[a,Ps]:(s=yo(g(n)),[a,s])})),KQ=l(2,(e,t)=>k(o2(e.channel,t))),GQ=l(2,(e,t)=>k(n2(e.channel,t))),tL=l(2,(e,t)=>e.channel.pipe(Zu(r=>t(r).channel),k)),VQ=l(2,(e,t)=>e.channel.pipe(j1(r=>t(r).channel),k)),rL=l(2,(e,t)=>e.channel.pipe(sg(t),k)),Kp=l(2,(e,t)=>k(mo(e.channel,r=>t(r).channel)));var p0=l(2,(e,t)=>e.channel.pipe(q1(t),k)),ZQ=l(3,(e,t,r)=>{let n=Array.isArray(t)?o=>A(o,\"_tag\")&&t.includes(o._tag):Ct(t);return p0(e,o=>n(o)?r(o):Y)}),YQ=l(2,(e,t)=>rL(e,r=>{let n=ll(r);return at(n)?t(n.success):Y})),nL=l(e=>Ee(e[0]),(e,t,r,n)=>k(H1(Mn(e),t,o=>r(o).channel,n&&(o=>n(o).channel)))),d0=l(e=>Ee(e[0]),(e,t,r,n)=>k(W1(Mn(e),t,o=>r(o).channel,n&&(o=>n(o).channel)))),QQ=l(e=>Ee(e[0]),(e,t,r,n)=>{let o=Array.isArray(t)?s=>A(s,\"_tag\")&&t.includes(s._tag):Ct(t);return nL(e,o,r,n)}),XQ=l(e=>Ee(e[0]),(e,t,r)=>{let n;return d0(e,o=>(n??=Object.keys(t),A(o,\"_tag\")&&jm(o._tag)&&n.includes(o._tag)?B(o):K(o)),o=>t[o._tag](o),r)}),e9=l(e=>Ee(e[0]),(e,t,r,n,o)=>k(J1(Mn(e),t,r,(s,a)=>n(s,a).channel,o&&((s,a)=>o(s,a).channel)))),t9=l(e=>Ee(e[0]),(e,t,r,n)=>{let o=Object.create(null);for(let a of Object.keys(r)){let i=r[a];o[a]=(c,u)=>i(c,u).channel}let s=n&&((a,i)=>n(a,i).channel);return k(K1(e.channel,t,o,s))}),r9=l(2,(e,t)=>d0(e,r=>Ct(r,t)&&A(r,\"reason\")?B(r.reason):K(r),Qu)),oL=l(2,(e,t)=>k(G1(e.channel,t))),n9=l(3,(e,t,r)=>k(z1(e.channel,t,n=>r(n).channel))),o9=l(3,(e,t,r)=>k(ag(e.channel,t,(n,o)=>r(n,o).channel))),s9=l(2,(e,t)=>k(k1(e.channel,r=>Mn(t())))),a9=l(2,(e,t)=>Kp(e,r=>Yi(t(r)))),i9=e=>k(V1(e.channel)),c9=l(e=>Ee(e[0]),(e,t)=>k(Z1(e.channel,t))),u9=l(e=>Ee(e[0]),(e,t)=>k(Y1(e.channel,t))),f9=l(2,(e,t)=>k(Q1(e.channel,t))),$2=(e,t)=>Ia(j(Hn(t),r=>{let n=Jt.defaultValue(),o=()=>Kp(x0(e,Jt,te(()=>n)),s=>Ia(Xe(j(r(s),a=>(n=a,Ia(Ft(Ol,o())))),()=>g(Qu(s)))));return o()})),l9=l(e=>Ee(e[0]),(e,t,r)=>Jr(()=>{let n=r?.preventFallbackOnPartialStream??!1,o=0,s={attempt:0,stepIndex:0},a=x0(Nm,te(()=>(s={attempt:s.attempt+1,stepIndex:o},s))),i=r?.onEvent===void 0?void 0:Mb(r.onEvent,()=>s),c,u=i===void 0?R:d=>SL(bL(d,j(i.begin,m=>{c=m})),m=>$(()=>{if(c===void 0)return Y;let x=c;return c=void 0,i.end(x,m)})),f=v(),p=Jr(()=>{let d=t.steps[o];if(!d)return Qu(oy(f));let m=a(u(IL(e,d.provide))),x=!1;if(Oe(f)){let y=f.value,S=!1,w=m;m=Jr(()=>S?w:(S=!0,Qu(y))),m=$2(m,vl(d,!1))}else{let y=vl(d,!0);m=y?$2(m,y):m}return Kp(n?EL(m,y=>(x=!0,Y)):m,y=>(o++,n&&x?Qu(y):(f=O(y),p)))});return p})),p9=l(2,(e,t)=>{let r=rt(t);return r===0?Ps:sL(e,(n,o)=>o===r-1)}),d9=l(3,(e,t,r)=>Jr(()=>{let n=rh(t),o=BigInt(0),s=!1;return ef(iL(e,a=>{let i=o+BigInt(a.length);return i>n?(s=!0,!1):(o=i,!0)}),Jr(()=>s?r():Ps))})),m9=l(2,(e,t)=>{let r=rt(t);return r===0?Ps:Xi(e,Os,(n,o)=>(Mx(n,o),n.length>r&&Dp(n,n.length-r),[n,Rs]),{onHalt(n){return Sa(n)}})}),sL=l(e=>Ee(e[0]),(e,t,r)=>Ut(e,(n,o)=>te(()=>{let s=0,a=!1;return I($(()=>a?ee():n),c=>{let u=c.findIndex(f=>t(f,s++));if(u>=0){a=!0;let f=c.slice(0,r?.excludeLast?u:u+1);return Qe(f)?g(f):ee()}return g(c)})}))),aL=l(e=>Ee(e[0]),(e,t,r)=>Ut(e,(n,o)=>te(()=>{let s=0,a=!1;return dr(function*(){if(a)return yield*ee();let i=yield*n;for(let c=0;cUt(e,(r,n)=>te(()=>{let o=0,s=!1,a=I($(()=>s?ee():r),i=>{let c=[];for(let u=0;uUt(e,(r,n)=>te(()=>{let o=!1,s=I($(()=>o?ee():r),a=>{let i=[];for(let c=0;caL(e,(r,n)=>j(t(r,n),o=>!o),{excludeLast:!0})),m0=l(2,(e,t)=>{let r=rt(t);return r===0?e:Ut(e,(n,o)=>te(()=>{let s=0,a=n.pipe(I(i=>s>=r?g(i):(s+=i.length,s<=r?a:g(i.slice(r-s)))));return a}))}),g9=l(2,(e,t)=>m0(cL(e,(r,n)=>!t(r,n)),1)),y9=l(2,(e,t)=>m0(uL(e,(r,n)=>j(t(r,n),o=>!o)),1)),cL=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s=0,a=I(r,i=>{let c=i.findIndex(u=>!t(u,s++));return c===-1?a:(o=!1,g(i.slice(c)))});return $(()=>o?a:r)}))),S9=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s=I(r,a=>{let i=a.findIndex(c=>ce(t(c)));return i===-1?s:(o=!1,g(a.slice(i)))});return $(()=>o?s:r)}))),uL=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s=0,a=dr(function*(){for(;;){let i=yield*r;for(let c=0;co?a:r)}))),b9=l(2,(e,t)=>{let r=rt(t);return r===0?e:Ut(e,(n,o)=>te(()=>{let s=Os(),a=I(n,i=>{Fx(s,i);let c=s.length-r,u=Wi(s,c);return rr(u)?g(u):a});return a}))}),fL=e=>e.channel.pipe(go(be),k),lL=l(2,(e,t)=>(t=En(t),Ut(e,(r,n)=>te(()=>{let o=Rt(),s=0,a,i=!1;return $(function c(){if(i)return ee();if(a===void 0)return I(r,u=>{if(o.length===0&&u.length===t)return g(u);if(o.length+u.length{if(o.length===0)return ee();let c=o;return i=!0,o=[],g(c)}))})))),E9=l(2,(e,t)=>pL(e,t,1)),pL=l(3,(e,t,r)=>{let n=En(t),o=En(r);return Ut(e,(s,a)=>te(()=>{let i=null,c=Os(),u=!1,f=0,p=fi(s,{onSuccess(d){if(Fx(c,d),f>0){let x=c.length;Dp(c,f),f=Math.max(0,f-x)}if(c.length=n;)if(n===o)m.push(Wi(c,n));else{m.push(WD(c,n));let x=c.length;Dp(c,o),f=Math.max(0,o-x)}return g(m)},onFailure(d){return u&&Dp(c,n-o),c.length===0?it(d):(i=d,g(be(Sa(c))))}});return $(()=>i?it(i):p)}))}),I9=l(2,(e,t)=>Xi(e,Rt,(r,n)=>{let o=Rt();for(let s=0;sGw(Sr(e.channel),Sr(t.channel),r,n).pipe(go(be),k)),w9=l(4,(e,t,r,n)=>k(Gw(e.channel,t.channel,r,n))),C9=l(e=>Ee(e[0]),(e,t,r,n)=>k(Vu(e.channel,t,(o,s)=>{let a=Rt();for(let i=0;iEe(e[0]),(e,t,r,n)=>k(Vu(e.channel,t,(o,s)=>{let[a,i]=r(o,s);return o=a,[o,Qe(i)?be(i):Rs]},n?.onHalt?{onHalt(o){let s=n.onHalt(o);return Qe(s)?be(s):Rs}}:void 0))),Rs=Rt(),A9=l(e=>Ee(e[0]),(e,t,r,n)=>e.channel.pipe(Sr,Vu(t,(o,s)=>j(r(o,s),([a,i])=>[a,Qe(i)?be(i):Rt()]),n?.onHalt?{onHalt(o){let s=n.onHalt(o);return Qe(s)?be(s):Rs}}:void 0),k)),k9=l(e=>Ee(e[0]),(e,t,r,n)=>e.channel.pipe(Vu(t,(o,s)=>j(r(o,s),([a,i])=>[a,Qe(i)?be(i):Rs]),n?.onHalt?{onHalt(o){let s=n.onHalt(o);return Qe(s)?be(s):Rs}}:void 0),k)),v9=l(3,(e,t,r)=>Jr(()=>{let n=t();return ef(Yi(n),k(Vu(e.channel,()=>n,(o,s)=>{let a=Rt();for(let i=0;iJr(()=>e.channel.pipe(Sr,B1(t(),r),go(be),k))),_9=l(2,(e,t)=>Ut(e,Se(function*(r,n){let o=yield*Lc,s=kr(We(t)),a,i,c=1/0,u=Wr(),f=Wr(),p=Wr();yield*r.pipe(u.whenOpen,I(m=>(f.openUnsafe(),a=m,c=o.currentTimeMillisUnsafe()+s,Y)),$t({disableYield:!0}),Jn(m=>(i=m,c=o.currentTimeMillisUnsafe(),f.openUnsafe(),p.openUnsafe(),Y)),Nt(n));let d=$(function m(){let x=o.currentTimeMillisUnsafe(),y=c{if(o.currentTimeMillisUnsafe(){if(i){if(a){let m=g(be(Dd(a)));return a=void 0,m}return it(i)}return u.openUnsafe(),f.whenOpen(d)})}))),dL=l(2,(e,t)=>{let r=t.burst??0;return t.strategy===\"enforce\"?R9(e,t.cost,t.units,t.duration,r):P9(e,t.cost,t.units,t.duration,r)}),R9=(e,t,r,n,o)=>Ut(e,s=>hi(a=>{let i=kr(We(n)),c=r+o<0?Number.POSITIVE_INFINITY:r+o,u=r,f=a.currentTimeMillisUnsafe();return g(I(s,function p(d){return I(t(d),m=>{let x=a.currentTimeMillisUnsafe(),S=(x-f)/i,w=u+S*r,E=w<0?c:Math.min(w,c);return m<=E?(u=E-m,f=x,g(d)):I(s,p)})}))})),P9=(e,t,r,n,o)=>Ut(e,s=>hi(a=>{let i=kr(We(n)),c=r+o<0?Number.POSITIVE_INFINITY:r+o,u=r,f=a.monotonicTimeNanosUnsafe();return g(I(s,p=>I(t(p),d=>{let m=a.monotonicTimeNanosUnsafe(),y=Number(m-f)/1e6/i,S=u+y*r,E=Math.min(S,c)-d;if(E>=0)return u=E,f=m,g(p);let M=-E/r,_=Math.max(0,M*i);return _>0?I(sa(_),()=>(u=E,f=m,g(p))):(u=E,f=m,g(p))})))})),M9=l(2,(e,t)=>dL(e,{...t,cost:r=>g(t.cost(r))})),F9=l(2,(e,t)=>fL(lL(e,t))),N9=l(3,(e,t,r)=>h0(e,k2(En(t)),_b(r))),U9=l(e=>Ee(e[0]),(e,t,r)=>mL(e,Se(function*(n,o,s){for(let a=0;aEe(e[0]),(e,t,r)=>Jr(()=>{let n=Fp();return mL(e,Se(function*(o,s,a){for(let i=0;ii0(e,Se(function*(n,o,s){let a=yield*YD();yield*ar(o,po(a));let i=Fp(),c=yield*_2({lookup:u=>di(Pn({capacity:r?.bufferSize??4096}).pipe(Pr(f=>(Np(i,u,f),yn(a,[u,Xu(f)])))),f=>(qu(i,u),Dw(f))),idleTimeToLive:r?.idleTimeToLive??cs}).pipe(gs(s));return yield*Wn({while:Er,body:je(I(n,u=>t(u,c,i))),step:Un}).pipe(xt(u=>Yt(a,u)),Nt(o)),Ku(a)})),L9=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o,s,a=Rt(),i=r.pipe(I(u=>{for(let f=0;fc?ee():i),()=>{c=!0;let u=s;return s=void 0,u&&rr(u)?g(be([o,u])):ee()})}))),$9=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o,s,a=$(()=>{if(s!==void 0){let c=s;return s=void 0,g(c)}return r}).pipe(oa(c=>(o=hs(c),ee()))),i=j($(()=>t.transform(a,n)),([c,u])=>(s=u,be(c)));return $(()=>o||i)}))),B9=l(2,(e,t)=>h0(e,t,wl)),h0=l(3,(e,t,r)=>k(xo(Se(function*(n,o,s){let a=yield*Xo(e.channel,o),i=Wr(!1),c=Symbol(),u=yield*Pn({capacity:0});yield*a.pipe(i.whenOpen,I(h=>(i.closeUnsafe(),yn(u,h))),$t,xt(h=>Yt(u,h)),Nt(s));let f=yield*Lc,p=yield*El(r),d=Wr(!1),m=f.currentTimeMillisUnsafe(),x=0,y=v(),S,w=h=>(d.openUnsafe()&&(x=f.currentTimeMillisUnsafe()),g(h)),E=d.await.pipe(I(()=>p(m,y)),I(([,h])=>sa(h)),I(()=>yn(u,c)),Xe(()=>Dw(u)),I(()=>ui)),M=$(()=>{if(S!==void 0){let h=S;return S=void 0,w(h)}return u.state._tag===\"Open\"&&i.openUnsafe(),I(_s(u),h=>h===c?ee():w(h))}),_=I(([h,b])=>{if(d.isOpen())m+=f.currentTimeMillisUnsafe()-x;else if(u.state._tag===\"Done\")return ee();return y=O(h),S=b,g(be(h))});return $(()=>{if(u.state._tag===\"Done\"&&S===void 0)return u.state.exit;d.closeUnsafe();let h=_($(()=>t.transform(M,s)));return u.state._tag===\"Open\"?Kc(h,E):h})})))),j9=l(2,Se(function*(e,t){let r=rt(t.n),n=yield*z9(t),o=new Array(r),s=yield*_r;for(let a=0;aLe(i,u)),k)}return yield*Vi(e.channel,a=>Wx(n,a)).pipe(cn(a=>Hx(n,a)),Vc),o})),z9=e=>di(e.capacity===\"unbounded\"?qx(e):e.strategy===\"dropping\"?jx(e):e.strategy===\"sliding\"?zx(e):Bx(e),Lp),hL=l(2,(e,t)=>j(kL(e,t),J2)),q9=l(2,(e,t)=>j(U2({acquire:hL(e,t),idleTimeToLive:t.idleTimeToLive}),r=>Ia(D2(r)))),H9=l(2,(e,t)=>k(Vw(e.channel,t))),W9=l(2,(e,t)=>k(Zw(e.channel,t))),J9=l(2,(e,t)=>e.channel.pipe(Zw(A2(t)),A1(([r,n])=>n?rg(n):Gu),k)),K9=e=>pg(CL(e)),G9=e=>Xi(e,Rt,(t,r)=>{let n=py(t,r);return[n,[n]]}),V9=e=>xL(e,W),xL=l(2,(e,t)=>Ut(e,(r,n)=>te(()=>{let o=!0,s;return I(r,function a(i){let c=[],u=0;for(o&&(o=!1,s=i[0],u=1,c.push(s));uUt(e,(r,n)=>te(()=>{let o=!0,s;return I(r,Se(function*a(i){let c=[],u=0;for(o&&(o=!1,s=i[0],u=1,c.push(s));uEe(e[0]),(e,t)=>Jr(()=>{let r=new TextDecoder(t?.encoding);return Kr(e,n=>r.decode(n,{stream:!0}))})),Q9=e=>Jr(()=>{let t=new TextEncoder;return Kr(e,r=>t.encode(r))}),X9=e=>e.channel.pipe(Vw(t2()),k),gL=l(2,(e,t)=>G2(e,(r,n)=>{let o=n===0?[]:[t],s=r.length-1;for(let a=0;aYi(t.start).pipe(ef(gL(e,t.middle)),ef(Yi(t.end)))),t7=l(2,(e,t)=>yL(e,t,Qi(oA([!0,!1])))),yL=l(3,(e,t,r)=>k(ke(Se(function*(n,o){let s=yield*he(Sr(r.channel))(n,o),a=Symbol(),i=!1,c=!1,u=(yield*he(Sr(e.channel))(n,o)).pipe(Xe(()=>(i=!0,g(a)))),f=(yield*he(Sr(t.channel))(n,o)).pipe(Xe(()=>(c=!0,g(a))));return dr(function*(){for(;;){if(i&&c)return yield*ee();let p=yield*s;if(p&&i||!p&&c)continue;let d=yield*p?u:f;if(d!==a)return be(d)}})})))),r7=l(2,(e,t)=>k(s2(e.channel,t))),n7=l(2,(e,t)=>k(a2(e.channel,t))),SL=l(2,(e,t)=>k(qp(e.channel,t))),o7=l(2,(e,t)=>k(i2(e.channel,t))),bL=l(2,(e,t)=>k(c2(e.channel,t))),EL=l(2,(e,t)=>k(Yw(e.channel,r=>t(r[0])))),s7=l(2,(e,t)=>k(u2(e.channel,t))),a7=l(2,(e,t)=>k(f2(e.channel,t))),IL=l(e=>Ee(e[0]),(e,t,r)=>k(l2(e.channel,t,r))),i7=l(2,(e,t)=>k(ug(e.channel,t))),c7=l(3,(e,t,r)=>k(fg(e.channel,t,r))),x0=l(3,(e,t,r)=>k(lg(e.channel,t,r))),TL=l(2,(e,t)=>k(p2(e.channel,t))),u7=l(3,(e,t,r)=>TL(e,n=>Wt(n,t,r(Fe(n,t))))),f7=function(){let e=Ee(arguments[0]),t=e?arguments[1]:arguments[0],r=Js(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return k(Qw(n.channel,t,r))}return n=>k(Qw(n.channel,t,r))},l7=Yi({}),p7=l(3,(e,t,r)=>Kr(e,n=>({...n,[t]:r(n)})));var d7=l(e=>Ee(e[0]),(e,t,r,n)=>tf(e,o=>Kr(r(o),s=>({...o,[t]:s})),n)),m7=l(e=>Ee(e[0]),(e,t,r,n)=>Jp(e,o=>j(r(o),s=>({...o,[t]:s})),n)),h7=l(2,(e,t)=>Kr(e,r=>({[t]:r}))),wL=l(2,(e,t)=>Kb(r=>Xo(e.channel,r).pipe(I(n=>t.transform(n,r)),j(([n])=>n)))),CL=e=>Zi(e.channel,()=>[],(t,r)=>{for(let n=0;nZi(e.channel,()=>0,(t,r)=>t+r.length),g7=e=>Zi(e.channel,()=>0,(t,r)=>{for(let n=0;nZi(e.channel,t,(n,o)=>{for(let s=0;sg2(e.channel,t,(n,o)=>{let s=0,a=n;return j(Wn({while:()=>sr(a,o[s]),step(i){a=i,s++}}),()=>a)})),b7=e=>j(h2(e.channel),_t(pA(0))),E7=e=>j(x2(e.channel),_t(Dd)),I7=l(2,(e,t)=>Vi(e.channel,r=>{let n=0;return Wn({while:()=>nt(r[n++]),step:Un})})),T7=l(2,(e,t)=>m2(e.channel,r=>{let n=!1,o=0;return j(Wn({while:()=>!n&&ot(r[o]),step(s){o++,s||(n=!0)}}),()=>!n)})),AL=l(2,(e,t)=>Vi(e.channel,t)),xg=e=>d2(e.channel),w7=e=>e0(e.channel),C7=e=>Zi(e.channel,()=>\"\",(t,r)=>t+r.join(\"\")),A7=e=>j(Xw(e.channel),t=>t.buffer),k7=e=>Xw(e.channel),g0=l(e=>Ee(e[0]),(e,t,r)=>{let n,o,s=Wr(!1);return new ReadableStream({start(a){o=Ml(vn(AL(e,i=>s.whenOpen(te(()=>{s.closeUnsafe();for(let c=0;c{i._tag===\"Failure\"?a.error(Om(i.cause)):a.close()})},pull(){return new Promise(a=>{n=a,s.openUnsafe()})},cancel(){if(o)return Yb(na(fo(o)))}},r?.strategy)}),v7=l(e=>Ee(e[0]),(e,t)=>g0(e,wr(),t)),O7=l(e=>Ee(e[0]),(e,t)=>j(li(),r=>g0(e,r,t))),y0=l(2,(e,t)=>({[Symbol.asyncIterator](){let r=Qb(t),n=_n(t),o=An(),s,a,i,c,u=p=>{if(c)return c;let d=i;return c=r(Ft(mr(d?fo(d):Y,Le(o,p)),{done:!0,value:void 0})),c},f=async p=>{try{await u(p)}catch(d){await r(Xb(\"Suppressed error while closing Stream async iterator\",d))}};return{async next(){if(c)return c;if(a){let m=a.next();if(!m.done)return m;a=void 0}let p=n(s??I(Xo(e.channel,o),m=>(s=m,m)));i=p;let d=await r($D(p));if(i===p&&(i=void 0),Ke(d))return a=d.value[Symbol.iterator](),a.next();if(ys(d.cause))return u(ht);if(c&&QS(d.cause))return c;throw await f(d),Om(d.cause)},return(){return u(ht)},async throw(p){throw await f(ob(p)),p}}}})),_7=e=>j(li(),t=>y0(e,t)),R7=e=>y0(e,wr()),P7=l(e=>Ee(e[0]),(e,t,r)=>r0(e.channel,t,r)),M7=l(2,(e,t)=>b2(e.channel,t)),kL=l(2,(e,t)=>E2(e.channel,t)),F7=l(2,(e,t)=>y2(e.channel,t)),N7=l(2,(e,t)=>t0(e.channel,t));var S0=fr(\"effect/FileSystem\");var OL=\"~effect/Path\",E0=fr(\"effect/Path\");function _L(e,t){let r=\"\",n=0,o=-1,s=0,a;for(let i=0;i<=e.length;++i){if(i2){let c=r.lastIndexOf(\"/\");if(c!==r.length-1){c===-1?(r=\"\",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf(\"/\")),o=i,s=0;continue}}else if(r.length===2||r.length===1){r=\"\",n=0,o=i,s=0;continue}}t&&(r.length>0?r+=\"/..\":r=\"..\",n=2)}else r.length>0?r+=\"/\"+e.slice(o+1,i):r=e.slice(o+1,i),n=i-o-1;o=i,s=0}else a===46&&s!==-1?++s:s=-1}return r}function U7(e,t){let r=t.dir||t.root,n=t.base||(t.name||\"\")+(t.ext||\"\");return r?r===t.root?r+n:r+e+n:n}function D7(e){if(e.protocol!==\"file:\")return P(new Yu({module:\"Path\",method:\"fromFileUrl\",description:\"URL must be of scheme file\"}));if(e.hostname!==\"\")return P(new Yu({module:\"Path\",method:\"fromFileUrl\",description:\"Invalid file URL host\"}));let t=e.pathname;for(let r=0;r=-1&&!r;o--){let s;if(o>=0)s=arguments[o];else{let a=globalThis.process;n===void 0&&\"process\"in globalThis&&typeof a==\"object\"&&a!==null&&typeof a.cwd==\"function\"&&(n=a.cwd()),s=n}s.length!==0&&(t=s+\"/\"+t,r=s.charCodeAt(0)===47)}return t=_L(t,!r),r?t.length>0?\"/\"+t:\"/\":t.length>0?t:\".\"},L7=47;function $7(e){let t=new URL(\"file://\"),r=RL(e);return e.charCodeAt(e.length-1)===L7&&r[r.length-1]!==\"/\"&&(r+=\"/\"),t.pathname=W7(r),g(t)}var B7=/%/g,j7=/\\\\/g,z7=/\\n/g,q7=/\\r/g,H7=/\\t/g;function W7(e){return e.includes(\"%\")&&(e=e.replace(B7,\"%25\")),e.includes(\"\\\\\")&&(e=e.replace(j7,\"%5C\")),e.includes(`\n`)&&(e=e.replace(z7,\"%0A\")),e.includes(\"\\r\")&&(e=e.replace(q7,\"%0D\")),e.includes(\"\t\")&&(e=e.replace(H7,\"%09\")),e}var b0=E0.of({[OL]:OL,resolve:RL,normalize(e){if(e.length===0)return\".\";let t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=_L(e,!t),e.length===0&&!t&&(e=\".\"),e.length>0&&r&&(e+=\"/\"),t?\"/\"+e:e},isAbsolute(e){return e.length>0&&e.charCodeAt(0)===47},join(){if(arguments.length===0)return\".\";let e;for(let t=0;t0&&(e===void 0?e=r:e+=\"/\"+r)}return e===void 0?\".\":b0.normalize(e)},relative(e,t){if(e===t||(e=b0.resolve(e),t=b0.resolve(t),e===t))return\"\";let r=1;for(;rc){if(t.charCodeAt(s+f)===47)return t.slice(s+f+1);if(f===0)return t.slice(s+f)}else o>c&&(e.charCodeAt(r+f)===47?u=f:f===0&&(u=0));break}let d=e.charCodeAt(r+f),m=t.charCodeAt(s+f);if(d!==m)break;d===47&&(u=f)}let p=\"\";for(f=r+u+1;f<=n;++f)(f===n||e.charCodeAt(f)===47)&&(p.length===0?p+=\"..\":p+=\"/..\");return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},dirname(e){if(e.length===0)return\".\";let t=e.charCodeAt(0),r=t===47,n=-1,o=!0;for(let s=e.length-1;s>=1;--s)if(t=e.charCodeAt(s),t===47){if(!o){n=s;break}}else o=!1;return n===-1?r?\"/\":\".\":r&&n===1?\"//\":e.slice(0,n)},basename(e,t){let r=0,n=-1,o=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return\"\";let a=t.length-1,i=-1;for(s=e.length-1;s>=0;--s){let c=e.charCodeAt(s);if(c===47){if(!o){r=s+1;break}}else i===-1&&(o=!1,i=s+1),a>=0&&(c===t.charCodeAt(a)?--a===-1&&(n=s):(a=-1,n=i))}return r===n?n=i:n===-1&&(n=e.length),e.slice(r,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?\"\":e.slice(r,n)}},extname(e){let t=-1,r=0,n=-1,o=!0,s=0;for(let a=e.length-1;a>=0;--a){let i=e.charCodeAt(a);if(i===47){if(!o){r=a+1;break}continue}n===-1&&(o=!1,n=a+1),i===46?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||n===-1||s===0||s===1&&t===n-1&&t===r+1?\"\":e.slice(t,n)},format:function(t){if(t===null||typeof t!=\"object\")throw new TypeError('The \"pathObject\" argument must be of type Object. Received type '+typeof t);return U7(\"/\",t)},parse(e){let t={root:\"\",dir:\"\",base:\"\",ext:\"\",name:\"\"};if(e.length===0)return t;let r=e.charCodeAt(0),n=r===47,o;n?(t.root=\"/\",o=1):o=0;let s=-1,a=0,i=-1,c=!0,u=e.length-1,f=0;for(;u>=o;--u){if(r=e.charCodeAt(u),r===47){if(!c){a=u+1;break}continue}i===-1&&(c=!1,i=u+1),r===46?s===-1?s=u:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||i===-1||f===0||f===1&&s===i-1&&s===a+1?i!==-1&&(a===0&&n?t.base=t.name=e.slice(1,i):t.base=t.name=e.slice(a,i)):(a===0&&n?(t.name=e.slice(1,s),t.base=e.slice(1,i)):(t.name=e.slice(a,s),t.base=e.slice(a,i)),t.ext=e.slice(s,i)),a>0?t.dir=e.slice(0,a-1):n&&(t.dir=\"/\"),t},sep:\"/\",fromFileUrl:D7,toFileUrl:$7,toNamespacedPath:R});function Gp(e){return{_tag:\"Value\",value:e}}function yg(e,t){return{_tag:\"Record\",keys:e,value:t}}function w0(e,t){return{_tag:\"Array\",length:e,value:t}}var gg=class extends Fr(\"SourceError\"){},ec=Te(\"effect/ConfigProvider\",{defaultValue:()=>LL()}),J7={...er,toJSON(){return{_id:\"ConfigProvider\"}}},K7=e=>e;function ML(e,t){let r=Object.create(J7);return r.load=e,r.mapInput=t,r}function FL(e,t){return ML(r=>e(t(r)),r=>FL(e,n=>r(t(n))))}function NL(e,t){return ML(r=>I(e.load(r),n=>n!==void 0?g(n):t.load(r)),r=>NL(e.mapInput(r),t.mapInput(r)))}function Sg(e){return FL(e,K7)}var T0=l(2,(e,t)=>NL(e,t)),C0=l(2,(e,t)=>e.mapInput(t)),G7=C0(e=>e.map(t=>typeof t==\"number\"?t:T_(t))),V7=l(2,(e,t)=>{let r=typeof t==\"string\"?[t]:t;return C0(e,n=>[...r,...n])}),Z7=e=>Bo(e)?fb(ec)(e):XO(ec)(e),Y7=(e,t)=>fb(ec)(dr(function*(){let r=yield*ec,n=Bo(e)?yield*e:e;return t?.asPrimary?T0(n,r):T0(r,n)}));function Q7(e,t){let r=t?.preserveEmptyStrings===!0;return Sg(n=>g(X7(e,n,r)))}function X7(e,t,r){let n=e;for(let o of t){if(n==null)return;if(Array.isArray(n)){if(typeof o!=\"number\"||!Number.isInteger(o)||o<0||o>=n.length)return;n=n[o];continue}if(ur(n)){if(typeof o!=\"string\"||!Object.hasOwn(n,o))return;n=n[o];continue}return}return eX(n,r)}function eX(e,t){if(e!=null)return typeof e==\"string\"?UL(e,t):typeof e==\"number\"||typeof e==\"boolean\"||typeof e==\"bigint\"?Gp(String(e)):Array.isArray(e)?w0(e.length):ur(e)?yg(new Set(Object.keys(e))):Gp(F(e))}function UL(e,t){let r=DL(e,t);return r===void 0?void 0:Gp(r)}function DL(e,t){return e===\"\"&&!t?void 0:e}function A0(e,t){let r=t?.preserveEmptyStrings===!0,n=tX(e);return Sg(o=>g(rX(n,e,o,r)))}function LL(e){let t=e?.env??{...globalThis.process?.env,...import.meta?.env};return A0(t,{preserveEmptyStrings:e?.preserveEmptyStrings})}function tX(e){let t={};for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=r.split(\"_\"),s=t;for(let a of o){let i=s.children??=Object.create(null);s=i[a]??={}}}return t}function rX(e,t,r,n){let o=r.map(String).join(\"_\"),s=DL(Object.hasOwn(t,o)?t[o]:void 0,n),a=nX(e,r),i=a?.children?Object.keys(a.children):[];if(i.length===0)return s===void 0?void 0:Gp(s);if(i.every(Sc)){let u=Math.max(...i.map(f=>parseInt(f,10)))+1;return w0(u,s)}return yg(new Set(i),s)}function nX(e,t){if(t.length===0)return e;let r=e;for(let n of t)if(r=r?.children?.[String(n)],!r)return;return r}function $L(e,t){let r=sX(e);return t?.expandVariables&&(r=aX(r)),A0(r,{preserveEmptyStrings:t?.preserveEmptyStrings})}var oX=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg;function sX(e){let t=Object.create(null);e=e.replace(/\\r\\n?/gm,`\n`);let r;for(;(r=oX.exec(e))!=null;){let n=r[1],o=r[2]||\"\";o=o.trim();let s=o[0];o=o.replace(/^(['\"`])([\\s\\S]*)\\1$/gm,\"$2\"),s==='\"'&&(o=o.replace(/\\\\n/g,`\n`),o=o.replace(/\\\\r/g,\"\\r\")),t[n]=o}return t}function aX(e){let t=Object.create(null);for(let r of Object.keys(e))t[r]=BL(e[r],e).replace(/\\\\\\$/g,\"$\");return t}function BL(e,t){let r=iX(e,/(?!(?<=\\\\))\\$/g);if(r===-1)return e;let n=e.slice(r),o=/((?!(?<=\\\\))\\${?([\\w]+)(?::-([^}\\\\]*))?}?)/,s=n.match(o);if(s!==null){let[a,i,c,u]=s,f=Object.hasOwn(t,c)&&t[c]!==\"\"?t[c]:u??\"\";return BL(e.replace(i,()=>f),t)}return e}function iX(e,t){let r=Array.from(e.matchAll(t));return r.length>0?r.slice(-1)[0].index:-1}var cX=Se(function*(e){let r=yield*(yield*S0).readFileString(e?.path??\".env\");return $L(r,e)}),uX=Se(function*(e){let t=yield*E0,r=yield*S0,n=e?.rootPath??\"/\",o=e?.preserveEmptyStrings===!0;return Sg(s=>{let a=t.join(n,...s.map(String)),i=r.readFileString(a).pipe(j(u=>UL(u.trim(),o))),c=r.readDirectory(a).pipe(j(u=>yg(new Set(u.map(f=>t.basename(f))))));return i.pipe(oa(u=>c.pipe(oa(f=>I0(u)&&I0(f)?g(void 0):P(I0(u)?f:u)))),Zm(u=>new gg({message:`Failed to read file at ${t.join(n,...s.map(String))}`,cause:u})))})}),I0=e=>e.reason._tag===\"NotFound\";var jL=[\"All\",\"Fatal\",\"Error\",\"Warn\",\"Info\",\"Debug\",\"Trace\",\"None\"];var v0=\"~effect/Config\",HL=e=>A(e,v0),nf=class{_tag=\"ConfigError\";name=\"ConfigError\";cause;constructor(t){this.cause=t}get message(){return this.cause.toString()}toString(){return`ConfigError(${this.message})`}},fX={...hd({label:\"Config\",evaluate(e){return this.parse(e.getRef(ec))}}),[v0]:v0,toJSON(){return{_id:\"Config\"}}};function ts(e){let t=Object.create(fX);return t.evaluator=e,t.parse=r=>nt(e(r,[]),_l),t}var So=(e,t,r)=>e.evaluator(t,r),WL=l(2,(e,t)=>ts((r,n)=>j(So(e,r,n),Cr(t)))),lX=l(2,(e,t)=>ts((r,n)=>I(So(e,r,n),Ar({onSuccess:o=>So(t(o),r,n),onFailure:o=>g(K(o))})))),pX=l(2,(e,t)=>ts((r,n)=>I(So(e,r,n),o=>at(o)?Dr(t(o.success),B):g(K(o.failure))))),dX=l(2,(e,t)=>ts((r,n)=>Hb(So(e,r,n),{onFailure:o=>So(t(o),r,n),onSuccess:o=>ce(o)?So(t(o.failure),r,n):g(o)})));function JL(e){let t=globalThis.Array.isArray(e)?e:Symbol.iterator in e?[...e]:e;return ts((r,n)=>globalThis.Array.isArray(t)?Dr(Jm(t.map(o=>So(o,r,n))),fy):Dr(Jm(Ka(t,o=>So(o,r,n))),fy))}var KL=l(2,(e,t)=>ts((r,n)=>Dr(So(e,r,n),o=>ce(o)?B(t):o))),mX=e=>e.pipe(WL(O),KL(v())),GL=e=>HL(e)?e:JL(Ka(e,t=>GL(t))),hX=e=>Ct(e,\"SourceError\"),xX=()=>\"\",VL=(e,t)=>e.load(t).pipe(Lb,Dr(r=>({provider:e,path:t,node:r,toString:xX}))),qL=(e,t)=>VL(e.provider,[...e.path,t]),k0=(e,t)=>da(Yn,e,new Ce(gt(r=>t(r)),jr())),ZL=e=>{switch(e._tag){case\"Union\":return e.types.every(ZL);case\"Objects\":case\"Arrays\":case\"Suspend\":return!1;default:return!0}},O0=(e,t)=>{switch(e._tag){case\"Objects\":return t?._tag===\"Record\";case\"Arrays\":return t?._tag===\"Array\";case\"Union\":return e.types.some(r=>O0(r,t));case\"Suspend\":return O0(e.thunk(),t);default:return t?.value!==void 0}},gX=Zr(e=>{let t=new WeakSet,r=YM(n=>{switch(t.add(n),n._tag){case\"Objects\":{let o=n.indexSignatures.map(a=>Pi(a.parameter)),s=Se(function*(a){if(a.node?._tag!==\"Record\")return;let i=a.node,c=new Set;for(let f of n.propertySignatures)typeof f.name==\"string\"&&c.add(f.name);if(o.length>0)for(let f of i.keys)o.some(p=>p(f))&&c.add(f);let u={};for(let f of c){let p=yield*qL(a,f);p.node!==void 0&&N(u,f,p)}return u});return k0(n.recur(r,a=>a),s)}case\"Arrays\":{let o=Se(function*(s){if(s.node?._tag!==\"Array\")return;let a=[];for(let i=0;ig(o.node?.value))});return r(e)});function Xt(e,t){let r=Mp(e),n=mn(r.ast),o=et(q(gX(r.ast))),s=typeof t==\"string\"?[t]:t??[];return ts((a,i)=>{let c=[...i,...s];return VL(a,c).pipe(nt(u=>o(u).pipe(Dr(B),Zc(f=>{let p=new nf(new As(c.length>0?new ct(c,f):f));return O0(n,u.node)?P(p):g(K(p))}))),Rl(u=>hX(u)?P(new nf(u)):Rr(u)))})}var yX=co.check(Lu({minimum:1,maximum:65535})),SX=io(jL),YL=e=>Ir(e)||globalThis.Array.isArray(e);function bX(e){return ts(()=>P(new nf(e)))}function EX(e){return ts(()=>g(B(e)))}function IX(e){return Xt(J,e)}function TX(e){return Xt(aw,e)}function wX(e){return Xt(ji,e)}function CX(e){return Xt(Du,e)}function AX(e){return Xt(co,e)}function kX(e,t){return Xt(wt(e),t)}function vX(e,t){return Xt(io(e),t)}function OX(e,t,r){let n=YL(t),o=n?r:t,s=$e(e),a=o?.separator??\",\",i=J.pipe(G(Mp(s),{decode:DP(o),encode:Sh(jr({strict:!1}),oe(c=>c.join(a)))}));return Xt(st([i,s]),n?t:void 0)}function _X(e,t,r,n){let o=YL(r),s=ks(e,t),a=XP(o?n:r),i=J.pipe(G(Mp(s),{decode:a.decode,encode:Sh(jr({strict:!1}),a.encode)}));return Xt(st([s,i]),o?r:void 0)}function RX(e){return Xt(XT,e)}function PX(e){return Xt(lw,e)}function MX(e){return Xt(Bu,e)}function FX(e){return Xt(yX,e)}function NX(e){return Xt(SX,e)}function UX(e){return Xt(vx(J),e)}function DX(e){return Xt(Tx,e)}function LX(e){return Xt($u,e)}var $X=l(2,(e,t)=>ts((r,n)=>So(e,r,[...n,t])));var tc={};Eo(tc,{Console:()=>QL,assert:()=>BX,clear:()=>jX,consoleWith:()=>Bt,count:()=>zX,countReset:()=>qX,debug:()=>HX,dir:()=>WX,dirxml:()=>JX,error:()=>KX,group:()=>GX,info:()=>VX,log:()=>ZX,table:()=>YX,time:()=>QX,timeLog:()=>XX,trace:()=>eee,warn:()=>tee,withGroup:()=>ree,withTime:()=>nee});var QL=HS,Bt=e=>ne(t=>e(t.getRef(QL))),BX=(e,...t)=>Bt(r=>z(()=>{r.assert(e,...t)})),jX=Bt(e=>z(()=>{e.clear()})),zX=e=>Bt(t=>z(()=>{t.count(e)})),qX=e=>Bt(t=>z(()=>{t.countReset(e)})),HX=(...e)=>Bt(t=>z(()=>{t.debug(...e)})),WX=(e,t)=>Bt(r=>z(()=>{r.dir(e,t)})),JX=(...e)=>Bt(t=>z(()=>{t.dirxml(...e)})),KX=(...e)=>Bt(t=>z(()=>{t.error(...e)})),GX=e=>Bt(t=>ri(z(()=>{e?.collapsed?t.groupCollapsed(e.label):t.group(e?.label)}),()=>z(()=>{t.groupEnd()}))),VX=(...e)=>Bt(t=>z(()=>{t.info(...e)})),ZX=(...e)=>Bt(t=>z(()=>{t.log(...e)})),YX=(e,t)=>Bt(r=>z(()=>{r.table(e,t)})),QX=e=>Bt(t=>ri(z(()=>{t.time(e)}),()=>z(()=>{t.timeEnd(e)}))),XX=(e,...t)=>Bt(r=>z(()=>{r.timeLog(e,...t)})),eee=(...e)=>Bt(t=>z(()=>{t.trace(...e)})),tee=(...e)=>Bt(t=>z(()=>{t.warn(...e)})),ree=l(e=>ie(e[0]),(e,t)=>Bt(r=>al(z(()=>{t?.collapsed?r.groupCollapsed(t.label):r.group(t?.label)}),()=>e,()=>z(()=>{r.groupEnd()})))),nee=l(e=>ie(e[0]),(e,t)=>Bt(r=>al(z(()=>{r.time(t)}),()=>e,()=>z(()=>{r.timeEnd(t)}))));var Gr={OK:200,Unauthorized:401,NotFound:404,InternalServerError:500,ServiceUnavailable:503},_0={[Gr.OK]:\"OK\",[Gr.Unauthorized]:\"Unauthorized\",[Gr.NotFound]:\"Not Found\",[Gr.InternalServerError]:\"Internal Server Error\",[Gr.ServiceUnavailable]:\"Service Unavailable\"},oee=e=>{let t=e.startsWith(\"/\"),r=[];for(let o of e.split(\"/\"))if(!(o===\"\"||o===\".\")){if(o===\"..\"){r.length>0&&r.at(-1)!==\"..\"?r.pop():t||r.push(\"..\");continue}r.push(o)}let n=r.join(\"/\");return t?`/${n}`:n||\".\"},Ta=(...e)=>oee(e.filter(Boolean).join(\"/\")),of=e=>{if(e.length===0)return\".\";let t=e.length;for(;t>1&&e[t-1]===\"/\";)t-=1;let r=e.slice(0,t),n=r.lastIndexOf(\"/\");return n<0?\".\":n===0?\"/\":r.slice(0,n)},XL=e=>{if(!e.startsWith(\"/\"))throw new TypeError(\"Path must be absolute\");let t=new URL(\"file:///\");return t.pathname=e.replace(/%/g,\"%25\").replace(/\\\\/g,\"%5C\"),t};var see=/^[A-Za-z0-9_-]+$/u,e$=/[*?[{]/u,bg=(e,t)=>t===e||t.startsWith(`${e.replace(/\\/+$/u,\"\")}/`),sf=class extends Tn.TaggedError(\"FunctionFileSystemError\"){},Fn=(e,t)=>e.lstat(t).pipe(U.catch(()=>U.undefined)),rc=(e,t,r)=>U.all([e.realPath(t),e.realPath(r)],{concurrency:2}).pipe(U.map(([n,o])=>bg(n,o)),U.orElseSucceed(()=>!1)),t$=(e,t,r)=>U.gen(function*(){let n=yield*Fn(e,r);if(n===void 0)return!0;if(n.isSymbolicLink||!(yield*rc(e,t,r)))return!1;if(!n.isDirectory)return!0;let o=yield*e.readDirectory(r).pipe(U.catch(()=>U.undefined));if(o===void 0)return!1;for(let s of o)if(!(yield*t$(e,t,Ta(r,s))))return!1;return!0}),Vp=(e,t)=>t.length===0?\"\":t.startsWith(\"/\")?t:Ta(e,t),R0=[\"deno.json\",\"deno.jsonc\"],r$=e=>R0.includes(e.slice(e.lastIndexOf(\"/\")+1)),aee=(e,t,r)=>U.gen(function*(){let n=of(Ta(r));for(;bg(t,n);){for(let s of R0){let a=Ta(n,s),i=yield*Fn(e,a);if(i!==void 0)return i.isFile&&!i.isSymbolicLink?a:void 0}let o=of(n);if(o===n)break;n=o}}),iee=(e,t,r)=>U.all([e.realPath(t),e.realPath(r)],{concurrency:2}).pipe(U.map(([n,o])=>n===o),U.orElseSucceed(()=>!1)),n$=U.fn(\"Functions.resolveFunctionConfig\")(function*(e){let{root:t,slug:r,overrides:n,fs:o}=e;if(!t.startsWith(\"/\")||!see.test(r)||r===\"_shared\"||(yield*Fn(o,t))===void 0)return;let a=yield*o.realPath(t).pipe(U.orElseSucceed(()=>\"\"));if(!a.startsWith(\"/\"))return;let i=yield*Fn(o,a);if(i===void 0||!i.isDirectory)return;let c=e.filesRoot===void 0?a:yield*o.realPath(e.filesRoot).pipe(U.orElseSucceed(()=>\"\"));if(!c.startsWith(\"/\")||!bg(c,a))return;let u=n.$default,f=n[r],p={...u,...f};if(p.enabled===!1)return;let d=Ta(a,r),m=p?.entrypointPath&&p.entrypointPath.length>0?p.entrypointPath:p.entrypoint&&p.entrypoint.length>0?p.entrypoint:\"index.ts\";if(!m.startsWith(\"/\")){let b=yield*Fn(o,d);if(b===void 0||!b.isDirectory||!(yield*rc(o,a,d)))return}let x=Vp(d,m);if(!(yield*rc(o,c,x)))return;let y=yield*Fn(o,x);if(y===void 0||!y.isFile||y.isSymbolicLink)return;let S=f?.importMapPath??f?.import_map,w=u?.importMapRoot??u?.import_map_root,E=S!==void 0?Vp(d,S):w!==void 0?Vp(a,w):Vp(d,\"\");if(E.length>0){if(!(yield*rc(o,c,E)))return;let b=yield*Fn(o,E);if(b===void 0||!b.isFile||b.isSymbolicLink)return}else for(let b of R0){let T=Ta(d,b),C=yield*Fn(o,T);if(C!==void 0){if(!C.isFile||C.isSymbolicLink||!(yield*rc(o,c,T)))return;E=T;break}}let M=E.length===0?void 0:yield*aee(o,c,x),_=M!==void 0&&(yield*iee(o,M,E)),h=(p.staticFiles??p.static_files??[]).map(b=>Vp(d,b));for(let b of h){if(!bg(c,b))return;let T=b.search(e$),C=T<0?b:b.slice(0,T),L=T<0?of(b):C.slice(0,Math.max(0,C.lastIndexOf(\"/\")))||a;if(!(yield*t$(o,c,L)))return;if(!e$.test(b)){let Q=yield*Fn(o,b);if(Q!==void 0&&(!(yield*rc(o,c,b))||Q.isSymbolicLink))return}}return{entrypointPath:x,importMapPath:E,importMapDiscoveredByRuntime:_,staticFiles:h,verifyJWT:p.verifyJWT??p.verify_jwt??!0,env:p.env}}),cee=e=>Ta(of(e.entrypointPath),\"package.json\"),o$=e=>{let t=new Map,r=new Map;return(n,o)=>{let s=r.get(n);if(s!==void 0)return s;let a=of(o.entrypointPath),i=t.get(a),c=i===void 0||i===n?a:e();return i===void 0&&t.set(a,n),r.set(n,c),c}},s$=U.fn(\"Functions.packageJsonContainedFor\")(function*(e){if(!e.root.startsWith(\"/\"))return!1;let t=yield*Fn(e.fs,e.root);if(t===void 0||!t.isDirectory&&!t.isSymbolicLink)return!1;let r=yield*e.fs.realPath(e.root).pipe(U.orElseSucceed(()=>\"\"));if(!r.startsWith(\"/\"))return!1;let n=yield*Fn(e.fs,r);if(n===void 0||!n.isDirectory)return!1;let o=cee(e.config),s=yield*Fn(e.fs,o);return s===void 0||!s.isFile||s.isSymbolicLink?!1:yield*rc(e.fs,r,o)});var P0=new TextEncoder,Zp=new TextDecoder,Eg=new TextDecoder(\"utf-8\",{fatal:!0}),Wue=2**32;function a$(...e){let t=e.reduce((o,{length:s})=>o+s,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function af(e){let t=new Uint8Array(e.length);for(let r=0;r127)throw new TypeError(\"non-ASCII string encountered in encode()\");t[r]=n}return t}var Ig=(e,t=\"algorithm.name\")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function uee(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function i$(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!=\"number\"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function c$(e,t,r){let n=e.algorithm;if(n.name!==t.name)throw Ig(t.name);if(t.hash&&n.hash?.name!==t.hash)throw Ig(t.hash,\"algorithm.hash\");if(t.namedCurve&&n.namedCurve!==t.namedCurve)throw Ig(t.namedCurve,\"algorithm.namedCurve\");if(t.length!==void 0&&n.length!==t.length)throw Ig(t.length,\"algorithm.length\");uee(e,r)}function fee(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(\", \")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t==\"function\"&&t.name?e+=` Received function ${t.name}`:typeof t==\"object\"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Yp=(e,t,...r)=>fee(`Key for the ${e} algorithm must be `,t,...r);var br=class extends Error{static code=\"ERR_JOSE_GENERIC\";code=\"ERR_JOSE_GENERIC\";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Ms=class extends br{static code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";claim;reason;payload;constructor(t,r,n=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},Qp=class extends br{static code=\"ERR_JWT_EXPIRED\";code=\"ERR_JWT_EXPIRED\";claim;reason;payload;constructor(t,r,n=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},Tg=class extends br{static code=\"ERR_JOSE_ALG_NOT_ALLOWED\";code=\"ERR_JOSE_ALG_NOT_ALLOWED\"},bo=class extends br{static code=\"ERR_JOSE_NOT_SUPPORTED\";code=\"ERR_JOSE_NOT_SUPPORTED\"};var Vr=class extends br{static code=\"ERR_JWS_INVALID\";code=\"ERR_JWS_INVALID\"},cf=class extends br{static code=\"ERR_JWT_INVALID\";code=\"ERR_JWT_INVALID\"};var Xp=class extends br{static code=\"ERR_JWKS_INVALID\";code=\"ERR_JWKS_INVALID\"},uf=class extends br{static code=\"ERR_JWKS_NO_MATCHING_KEY\";code=\"ERR_JWKS_NO_MATCHING_KEY\";constructor(t=\"no applicable key found in the JSON Web Key Set\",r){super(t,r)}},wg=class extends br{[Symbol.asyncIterator]=async function*(){};static code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";constructor(t=\"multiple matching keys found in the JSON Web Key Set\",r){super(t,r)}},Cg=class extends br{static code=\"ERR_JWKS_TIMEOUT\";code=\"ERR_JWKS_TIMEOUT\";constructor(t=\"request timed out\",r){super(t,r)}},Ag=class extends br{static code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";constructor(t=\"signature verification failed\",r){super(t,r)}};var M0=e=>{if(e?.[Symbol.toStringTag]===\"CryptoKey\")return!0;try{return e instanceof CryptoKey}catch{return!1}},lee=e=>e?.[Symbol.toStringTag]===\"KeyObject\",u$=e=>M0(e)||lee(e);function f$(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let n=0;ntypeof o!=\"string\")||new Set(n).size!==n.length)throw new TypeError('\"key_ops\" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}var D0=e=>e[Symbol.toStringTag],pee=(e,t,r)=>{let{alg:n}=e;if(t.use!==void 0){let o=r===\"sign\"||r===\"verify\"?\"sig\":\"enc\";if(t.use!==o)throw new TypeError(`Invalid key for this operation, its \"use\" must be \"${o}\" when present`)}if(t.alg!==void 0&&t.alg!==n)throw new TypeError(`Invalid key for this operation, its \"alg\" must be \"${n}\" when present`);if(Array.isArray(t.key_ops)){let o=r===\"encrypt\"||r===\"decrypt\"?e.ops?.[r===\"encrypt\"?0:1]:r;if(o&&!t.key_ops.includes(o))throw new TypeError(`Invalid key for this operation, its \"key_ops\" must include \"${o}\" when present`)}};function dee(e,t,r){let{alg:n,secret:o}=e,s=r===\"decrypt\"||r===\"sign\";if(o&&t instanceof Uint8Array)return[m$,t];if(wa(t)){let a=p$(t);if(typeof a.kty!=\"string\")throw new TypeError(o?Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(!(o?a.kty===\"oct\"&&typeof a.k==\"string\":a.kty!==\"oct\"&&(s?a.kty===\"AKP\"&&typeof a.priv==\"string\"||typeof a.d==\"string\":a.d===void 0&&a.priv===void 0)))throw new TypeError(o?'JSON Web Key for symmetric algorithms must have JWK \"kty\" (Key Type) equal to \"oct\" and the JWK \"k\" (Key Value) present':`JSON Web Key for this operation must be a ${s?\"private\":\"public\"} JWK`);return pee(e,a,r),[g$,t,a]}if(!u$(t))throw new TypeError(o?Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):Yp(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(o){if(t.type!==\"secret\")throw new TypeError(`${D0(t)} instances for symmetric algorithms must be of type \"secret\"`)}else{if(t.type===\"secret\")throw new TypeError(`${D0(t)} instances for asymmetric algorithms must not be of type \"secret\"`);let a=s?\"private\":\"public\";if((t.type===\"public\"||t.type===\"private\")&&t.type!==a){let i=r===\"sign\"?\"signing\":r===\"verify\"?\"verifying\":`${r.slice(0,-1)}tion`;throw new TypeError(`${D0(t)} instances for asymmetric algorithm ${i} must be of type \"${a}\"`)}}return M0(t)?[h$,t]:[x$,t]}var m$=0,h$=1,x$=2,g$=3,L0,mee={__proto__:null,prime256v1:\"P-256\",secp384r1:\"P-384\",secp521r1:\"P-521\"};function _g(e,t,r){L0||=new WeakMap;let n=L0.get(e);return r&&(n?n[t]=r:L0.set(e,{[t]:r})),r??n?.[t]}var d$=async(e,t,r)=>_g(e,r.alg)??_g(e,r.alg,await Og(r,{...t,alg:r.alg})),hee=(e,t)=>{let r=_g(e,t.alg);if(r)return r;let n=e.type===\"public\",o=t.usages[n?0:1],{asymmetricKeyType:s}=e,a=mee[e.asymmetricKeyDetails?.namedCurve],i=t.resolve?.({crv:a,asymmetricKeyType:s})??t.subtle;return _g(e,t.alg,e.toCryptoKey(i,n,o))};async function y$(e,t,r){let n=dee(e,t,r);switch(n[0]){case m$:case h$:return n[1];case g$:{let o=n[1],s=n[2];if(s.kty===\"oct\")return ed(s.k);if(!Object.isFrozen(o)){let{key_ops:a}=o;Array.isArray(a)&&Object.freeze(a),Object.freeze(o)}return d$(o,s,e)}case x$:{let o=n[1];return o.type===\"secret\"?o.export():\"toCryptoKey\"in o&&typeof o.toCryptoKey==\"function\"?hee(o,e):d$(o,o.export({format:\"jwk\"}),e)}}}function S$(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var b$={__proto__:null,b64:!0};function E$(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!=\"string\")))throw new TypeError(`\"${e}\" option must be an array of strings`);if(t)return new Set(t)}function I$(e,t,r,n,o){if(o.crit!==void 0&&n?.crit===void 0)throw new e('\"crit\" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return[];if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(a=>typeof a!=\"string\"||a.length===0))throw new e('\"crit\" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s=r===void 0?t:{__proto__:null,...r,...t};for(let a of n.crit){if(!(a in s))throw new bo(`Extension Header Parameter \"${a}\" is not recognized`);if(!Object.hasOwn(o,a)||o[a]===void 0)throw new e(`Extension Header Parameter \"${a}\" is missing`);if(s[a]&&(!Object.hasOwn(n,a)||n[a]===void 0))throw new e(`Extension Header Parameter \"${a}\" MUST be integrity protected`)}return n.crit}function T$(e,t){if(t.includes(\"b64\")){let r=e.b64;if(typeof r!=\"boolean\")throw new Vr('The \"b64\" (base64url-encode payload) Header Parameter must be a boolean');return r}return!0}async function xee(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey(\"raw\",t,e.subtle,!1,[r]):(c$(t,e.subtle,r),e.minRsaBits&&i$(e.alg,t),t)}async function w$(e,t,r,n){let o=await xee(e,t,\"verify\");try{return await crypto.subtle.verify(e.signing,o,r,n)}catch{return!1}}var td=[[\"verify\"],[\"sign\"]];function $0(e){let t={name:\"HMAC\",hash:`SHA-${e}`};return{kty:[\"oct\"],secret:!0,subtle:t,signing:t,usages:td}}function ff(e,t){let n={name:t?\"RSA-PSS\":\"RSASSA-PKCS1-v1_5\",hash:`SHA-${e}`};return{kty:[\"RSA\"],subtle:n,signing:t?{...n,saltLength:t}:n,usages:td,minRsaBits:2048}}function B0(e,t){return{kty:[\"EC\"],crv:e,subtle:{name:\"ECDSA\",namedCurve:e},signing:{name:\"ECDSA\",hash:`SHA-${t}`},usages:td}}function C$(){let e={name:\"Ed25519\"};return{kty:[\"OKP\"],crv:\"Ed25519\",subtle:e,signing:e,usages:td}}function j0(e){let r={name:`ML-DSA-${e}`};return{kty:[\"AKP\"],subtle:r,signing:r,usages:td}}var z0=S$({HS256:$0(256),HS384:$0(384),HS512:$0(512),RS256:ff(256),RS384:ff(384),RS512:ff(512),PS256:ff(256,32),PS384:ff(384,48),PS512:ff(512,64),ES256:B0(\"P-256\",256),ES384:B0(\"P-384\",384),ES512:B0(\"P-521\",512),EdDSA:C$(),Ed25519:C$(),\"ML-DSA-44\":j0(44),\"ML-DSA-65\":j0(65),\"ML-DSA-87\":j0(87)});function A$(e){let t=typeof e==\"string\"?z0[e]:void 0;if(!t)throw new bo(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function k$(e){return[e&&E$(\"algorithms\",e.algorithms),e?.crit]}function gee(e,t=e===void 0?{}:vg(e,Vr,\"JWS Protected Header is invalid\")){return t}function yee(e,t,r){let n=T$(e,I$(Vr,b$,r[1],e,t)),o=t.alg;if(typeof o!=\"string\"||!o)throw new Vr('JWS \"alg\" (Algorithm) Header Parameter missing or invalid');if(r[0]&&!r[0].has(o))throw new Tg('\"alg\" (Algorithm) Header Parameter value not allowed');return[n,o]}function See(e){try{return af(e)}catch{throw new Vr(\"JWS Compact Serialization payload must use only ASCII characters\")}}async function bee(e,t,r,n,o,s,a){let i=!1;typeof r==\"function\"&&(r=await r(o,e),i=!0);let c=typeof a==\"string\",u=A$(s),f=a$(n!==void 0?af(n):new Uint8Array,af(\".\"),c?t[2]??=l$(a,\"payload\",Vr):a),p=N0(e.signature,\"signature\",Vr),d=await y$(u,r,\"verify\");if(!await w$(u,d,p,f))throw new Ag;return[c?N0(a,\"payload\",Vr):a,o,c,d,i]}async function v$(e,t,r){if(e instanceof Uint8Array&&(e=Zp.decode(e)),typeof e!=\"string\")throw new Vr(\"Compact JWS must be a string or Uint8Array\");let{0:n,1:o,2:s,length:a}=e.split(\".\");if(a!==3)throw new Vr(\"Invalid Compact JWS\");let i={payload:o,protected:n,signature:s},c=gee(n),[u,f]=yee(c,c,t),p=u?o:See(o);return bee(i,t,r,n,c,f,p)}var Eee=e=>Math.floor(e.getTime()/1e3),Iee={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},Tee=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,lf=\"check_failed\";function q0(){throw new TypeError(\"Invalid time period format\")}function O$(e){typeof e!=\"string\"&&q0();let t=Tee.exec(e);(!t||t[4]&&t[1])&&q0();let r=parseFloat(t[2]),n=Math.round(r*Iee[t[3][0].toLowerCase()]);return Number.isFinite(n)||q0(),t[1]===\"-\"||t[4]===\"ago\"?-n:n}function H0(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}var _$=e=>{let t=e.toLowerCase();return e.includes(\"/\")?t:`application/${t}`},wee=(e,t)=>typeof e==\"string\"?t.includes(e):Array.isArray(e)?t.some(r=>e.includes(r)):!1;function W0(e,t,r=!1){let n=e[t];if(!(n===void 0&&!r)){if(typeof n!=\"number\")throw new Ms(`\"${t}\" claim must be a number`,e,t,\"invalid\");return n}}function J0(e,t){throw new Ms(`unexpected \"${t}\" claim value`,e,t,lf)}function R$(e,t,r={}){let n;try{n=JSON.parse(Eg.decode(t))}catch{}if(!wa(n))throw new cf(\"JWT Claims Set must be a top-level JSON object\");let{typ:o}=r;if(o!==void 0&&(typeof e.typ!=\"string\"||_$(e.typ)!==_$(o)))throw new Ms('unexpected \"typ\" JWT header value',n,\"typ\",lf);let{requiredClaims:s=[],issuer:a,subject:i,audience:c,maxTokenAge:u}=r,f=[...s];u!==void 0&&f.push(\"iat\"),c!==void 0&&f.push(\"aud\"),i!==void 0&&f.push(\"sub\"),a!==void 0&&f.push(\"iss\");for(let E of new Set(f.reverse()))if(!Object.hasOwn(n,E))throw new Ms(`missing required \"${E}\" claim`,n,E,\"missing\");a!==void 0&&!(Array.isArray(a)?a:[a]).includes(n.iss)&&J0(n,\"iss\"),i!==void 0&&n.sub!==i&&J0(n,\"sub\"),c!==void 0&&!wee(n.aud,typeof c==\"string\"?[c]:c)&&J0(n,\"aud\");let{clockTolerance:p}=r,d=0;if(typeof p==\"string\")d=O$(p);else if(p!==void 0){if(typeof p!=\"number\")throw new TypeError(\"Invalid clockTolerance option type\");d=p}H0(\"clockTolerance option\",d);let{currentDate:m}=r,x=H0(\"currentDate option\",Eee(m===void 0?new Date:m)),y=W0(n,\"iat\",u!==void 0),S=W0(n,\"nbf\");if(S!==void 0&&S>x+d)throw new Ms('\"nbf\" claim timestamp check failed',n,\"nbf\",lf);let w=W0(n,\"exp\");if(w!==void 0&&w<=x-d)throw new Qp('\"exp\" claim timestamp check failed',n,\"exp\",lf);if(u!==void 0){let E=x-y,M=H0(\"maxTokenAge option\",typeof u==\"number\"?u:O$(u));if(E-d>M)throw new Qp('\"iat\" claim timestamp check failed (too far in the past)',n,\"iat\",lf);if(E<-d)throw new Ms('\"iat\" claim timestamp check failed (it should be in the past)',n,\"iat\",lf)}return n}async function Rg(e,t,r){let n=await v$(e,k$(r),t);if(!n[2])throw new cf(\"JWTs MUST NOT use unencoded payload\");let s={payload:R$(n[1],n[0],r),protectedHeader:n[1]};return typeof t==\"function\"?{...s,key:n[3]}:s}function Cee(e,t,r,n){let{kty:o,key_ops:s,ext:a,kid:i,alg:c,use:u,crv:f}=U0(e),p=Array.isArray(s)?[...s]:s;return(a===void 0||typeof a==\"boolean\")&&(p===void 0||Array.isArray(p)&&p.every((d,m)=>typeof d==\"string\"&&p.indexOf(d)===m)&&p.includes(\"verify\"))&&t.kty.includes(o)&&(n===void 0||typeof n==\"string\"&&n===i)&&(c===void 0?o!==\"AKP\":r===c)&&(u===void 0||u===\"sig\")&&(!t.crv||f===t.crv)}async function P$(e,t,r){let n=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(n[o]===void 0){let s=await Og(r,{...t,alg:o,ext:!0});if(s.type!==\"public\")throw new Xp(\"JSON Web Key Set members must be public keys\");n[o]=s}return n[o]}function nc(e){let t;try{t=structuredClone(e)}catch{}if(!kg(t))throw new Xp(\"JSON Web Key Set malformed\");let r=new WeakMap;return Object.defineProperty(async(o,s)=>{let{alg:a,kid:i}={...o,...s?.header},c=typeof a==\"string\"?z0[a]:void 0;if(!c||c.secret)throw new bo('Unsupported \"alg\" value for a JSON Web Key Set');let u=t.keys.filter(d=>Cee(d,c,a,i)),{0:f,length:p}=u;if(!p)throw new uf;if(p!==1){let d=new wg;throw d[Symbol.asyncIterator]=async function*(){for(let m of u)try{yield await P$(r,m,c)}catch{}},d}return P$(r,f,c)},\"jwks\",{value:()=>structuredClone(t)})}function Aee(){return typeof WebSocketPair<\"u\"||typeof navigator<\"u\"&&navigator.userAgent===\"Cloudflare-Workers\"||typeof EdgeRuntime<\"u\"&&EdgeRuntime===\"vercel\"}var K0;(typeof navigator>\"u\"||!navigator.userAgent?.startsWith?.(\"Mozilla/5.0 \"))&&(K0=\"jose/v6.2.10\");var F$=Symbol();async function kee(e,t,r,n=fetch){let o=await n(e,{method:\"GET\",signal:r,redirect:\"manual\",headers:t}).catch(s=>{throw s.name===\"TimeoutError\"?new Cg:s});if(o.status!==200)throw new br(\"Expected 200 OK from the JSON Web Key Set HTTP response\");try{return await o.json()}catch{throw new br(\"Failed to parse the JSON Web Key Set HTTP response as JSON\")}}var N$=Symbol();function rd(e,t){return Number.isFinite(e)&&Date.now(){if(d&&Aee()&&(d=void 0),!d){let E=++m,M=d=kee(r,c,AbortSignal.timeout(s),u).then(_=>{let h=nc(_);if(E<=x)return;y=h;let b=Date.now();f&&(f.uat=b,f.jwks=_),p=b,x=E}).finally(()=>{d===M&&(d=void 0)})}await d};return Object.defineProperties(async(E,M)=>{(!y||!rd(p,i))&&await S();try{return await y(E,M)}catch(_){if(_ instanceof uf&&!rd(p,a))return await S(),y(E,M);throw _}},{coolingDown:{get:()=>rd(p,a),enumerable:!0},fresh:{get:()=>rd(p,i),enumerable:!0},reload:{value:S,enumerable:!0},reloading:{get:()=>!!d,enumerable:!0},jwks:{value:()=>y?.jwks(),enumerable:!0}})}function V0(e){let t;if(typeof e==\"string\"){let n=e.split(\".\");(n.length===3||n.length===5)&&([t]=n)}else if(typeof e==\"object\"&&e)if(\"protected\"in e)t=e.protected;else throw new TypeError(\"Token does not contain a Protected Header\");let r=\"Invalid Token or Protected Header formatting\";if(typeof t!=\"string\"||!t)throw new TypeError(r);return vg(t,TypeError,r)}var Oee=new Set([\"HOME\",\"HOSTNAME\",\"PATH\",\"PWD\"]),Nn=U.runSync(U.gen(function*(){let e=t=>t.pipe(Mr.option);return{hostPort:yield*e(Mr.String(\"SUPABASE_INTERNAL_HOST_PORT\")),functionsRoot:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_ROOT\")),filesRoot:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_FILES_ROOT\")),jwtSecret:yield*e(Mr.String(\"SUPABASE_INTERNAL_JWT_SECRET\")),supabaseUrl:yield*e(Mr.String(\"SUPABASE_URL\")),wallclock:yield*e(Mr.String(\"SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC\")),publishableKey:yield*e(Mr.String(\"SUPABASE_INTERNAL_PUBLISHABLE_KEY\")),secretKey:yield*e(Mr.String(\"SUPABASE_INTERNAL_SECRET_KEY\")),functionsConfig:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_CONFIG\")),debug:yield*e(Mr.String(\"SUPABASE_INTERNAL_DEBUG\")),jwks:yield*e(Mr.String(\"SUPABASE_JWKS\"))}}).pipe(U.provideService(rf.ConfigProvider,rf.fromEnvRecord(Deno.env.toObject(),{preserveEmptyStrings:!0})))),df=(e,t=\"\")=>xe.getOrElse(e,()=>t),U$=df(Nn.hostPort,\"8081\"),z$=df(Nn.functionsRoot),_ee=df(Nn.jwtSecret),Ree=df(Nn.supabaseUrl,\"http://127.0.0.1:54321\"),Pee=new URL(\"/auth/v1/.well-known/jwks.json\",Ree),D$=Number.parseInt(df(Nn.wallclock,\"400\"),10),L$=xe.getOrUndefined(Nn.publishableKey),$$=xe.getOrUndefined(Nn.secretKey),Fs={BootError:Gr.ServiceUnavailable,InvalidWorkerResponse:Gr.InternalServerError,WorkerLimit:546},Mee={[Fs.BootError]:\"BOOT_ERROR\",[Fs.InvalidWorkerResponse]:\"WORKER_ERROR\",[Fs.WorkerLimit]:\"WORKER_LIMIT\"},Fee={[Fs.BootError]:\"Worker failed to boot (please check logs)\",[Fs.InvalidWorkerResponse]:\"Function exited due to an error (please check logs)\",[Fs.WorkerLimit]:\"Worker failed to respond due to a resource limit (please check logs)\"},Nee=new Map([[Deno.errors.InvalidWorkerCreation,Fs.BootError],[Deno.errors.InvalidWorkerResponse,Fs.InvalidWorkerResponse],[Deno.errors.WorkerRequestCancelled,Fs.WorkerLimit]]),Uee=e=>{let t=Deno.errors.WorkerAlreadyRetired;return t!==void 0&&e instanceof t},Dee=(s=>(s.MissingAuthHeader=\"UNAUTHORIZED_NO_AUTH_HEADER\",s.InvalidLegacyJWT=\"UNAUTHORIZED_JWT\",s.InvalidAsymmetricJWT=\"UNAUTHORIZED_ASYMMETRIC_JWT\",s.InvalidTokenFormat=\"UNAUTHORIZED_INVALID_JWT_FORMAT\",s.UnsupportedTokenAlgorithm=\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",s))(Dee||{}),Lee=me.Struct({enabled:me.optionalKey(me.Boolean),verifyJWT:me.optionalKey(me.Boolean),verify_jwt:me.optionalKey(me.Boolean),entrypointPath:me.optionalKey(me.String),entrypoint:me.optionalKey(me.String),importMapPath:me.optionalKey(me.String),import_map:me.optionalKey(me.String),importMapRoot:me.optionalKey(me.String),import_map_root:me.optionalKey(me.String),staticFiles:me.optionalKey(me.Array(me.String)),static_files:me.optionalKey(me.Array(me.String)),env:me.optionalKey(me.Record(me.String,me.String))}),$ee=me.Record(me.String,Lee),Bee=me.declare(e=>typeof e==\"object\"&&e!==null&&\"keys\"in e&&Array.isArray(e.keys)&&e.keys.every(t=>typeof t==\"object\"&&t!==null)),jee=()=>xe.match(Nn.functionsConfig,{onNone:()=>({}),onSome:e=>U.runSync(me.decodeEffect(me.fromJsonString($ee))(e).pipe(U.orElseSucceed(()=>({}))))}),Z0=jee();if(xe.getOrUndefined(Nn.debug)===\"true\"){let e=Object.fromEntries(Object.entries(Z0).map(([t,r])=>[t,Object.fromEntries(Object.entries(r).filter(([n])=>n!==\"env\"))]));U.runSync(tc.log(\"Functions config:\",JSON.stringify(e,null,2)))}var oc=(e,t,r={})=>{let n={...r},o=null;return e!=null&&(typeof e==\"object\"?(n[\"Content-Type\"]=\"application/json\",o=JSON.stringify(e)):(n[\"Content-Type\"]=\"text/plain\",o=typeof e==\"string\"?e:JSON.stringify(e)??null)),new Response(o,{status:t,headers:n})},B$=({code:e,message:t=\"Invalid JWT\"})=>oc({code:e,message:t,msg:t},Gr.Unauthorized,{\"sb-error-code\":e,\"Access-Control-Expose-Headers\":\"sb-error-code\"}),zee=e=>{for(let[t,r]of Nee.entries())if(t!==void 0&&e instanceof t)return oc({code:Mee[r],message:Fee[r]},r);return oc({code:_0[Gr.InternalServerError],message:\"Request failed due to an internal server error\"},Gr.InternalServerError)};function qee(e){let t=e.split(\" \");return t.length===2&&t[0]===\"Bearer\"?t[1]:null}var Hee=e=>{let t=e.headers.get(\"authorization\"),r=e.headers.get(\"sb-api-key\")?.replace(\"Bearer\",\"\").trim();if(!t&&!r)return{code:\"UNAUTHORIZED_NO_AUTH_HEADER\",message:\"Missing authorization header\"};let n=qee(t??\"\"),o=!n||n.startsWith(\"sb_\")?r:n;return o||{code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"}},pf=class extends Tn.TaggedError(\"BootstrapOperationError\"){},Wee=U.runSync(xe.match(Nn.jwks,{onNone:()=>U.succeed(xe.some(nc({keys:[]}))),onSome:e=>U.gen(function*(){let t=yield*me.decodeEffect(me.fromJsonString(Bee))(e);return yield*U.try({try:()=>nc(t),catch:r=>new pf({cause:r})})}).pipe(U.option)})),Jee=xe.getOrElse(Wee,()=>G0(Pee)),Ca=e=>U.tryPromise({try:e,catch:t=>new pf({cause:t})}),Kee=e=>U.gen(function*(){return yield*Ca(()=>Rg(e,Jee)),xe.none()}).pipe(U.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_ASYMMETRIC_JWT\"})));function Gee(e,t){return U.gen(function*(){let r=yield*U.try({try:()=>V0(t).alg,catch:n=>new pf({cause:n})});return r?r===\"HS256\"?yield*Ca(()=>Rg(t,new TextEncoder().encode(e))).pipe(U.as(xe.none()),U.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_JWT\"}))):r===\"ES256\"||r===\"RS256\"?yield*Kee(t):xe.some({code:\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",message:`Unsupported JWT algorithm ${r}`}):xe.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})}).pipe(U.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})))}var q$={lstat:e=>Ca(()=>Deno.lstat(e)).pipe(U.mapError(t=>new sf({cause:t})),U.map(t=>({isDirectory:t.isDirectory,isFile:t.isFile,isSymbolicLink:t.isSymlink}))),realPath:e=>Ca(()=>Deno.realPath(e)).pipe(U.mapError(t=>new sf({cause:t}))),readDirectory:e=>es.suspend(()=>es.fromAsyncIterable(Deno.readDir(e),t=>new pf({cause:t})).pipe(es.map(t=>t.name))).pipe(es.runCollect,U.mapError(t=>new sf({cause:t})))},Vee=e=>n$({root:z$,filesRoot:xe.getOrUndefined(Nn.filesRoot),slug:e,overrides:Z0,fs:q$}),j$=new Set,Zee=(e,t)=>t.importMapDiscoveredByRuntime||!r$(t.importMapPath)||j$.has(e)?U.void:U.sync(()=>j$.add(e)).pipe(U.andThen(tc.warn(`[functions] ${e}: ${t.importMapPath} is not the nearest Deno config of ${t.entrypointPath}, so Edge Runtime loads it as a plain import map without comments or jsr:/npm: subpath imports. Move it next to the entrypoint or into a parent directory without a closer deno.json(c).`))),Yee=o$(()=>Deno.makeTempDirSync({prefix:\"supabase-worker-\"})),Qee=e=>e.importMapPath?U.succeed(!1):s$({root:df(Nn.filesRoot,z$),config:e,fs:q$}),H$=e=>es.fromEffectRepeat(Ca(()=>e.read()).pipe(U.flatMap(t=>t.done?Lt.done():U.succeed(t.value)))),Xee=e=>e===void 0?U.void:es.runDrain(H$(e)).pipe(U.ignore);function ete(e,t){let r=new URL(e.url),n=e.headers.get(\"x-forwarded-host\");n&&(r.hostname=n);let o=new Request(r.href,{method:e.method,headers:e.headers,body:t===void 0?null:es.toReadableStream(H$(t)),signal:e.signal,duplex:\"half\"});return o.headers.delete(\"sb-api-key\"),EdgeRuntime.applySupabaseTag(e,o),o}Deno.serve({handler:e=>U.runPromiseExit(U.gen(function*(){let t=yield*U.acquireRelease(U.sync(()=>e.body?.getReader()),u=>U.interruptible(Xee(u))),{pathname:r}=new URL(e.url);if(r===\"/_internal/health\")return oc({message:\"ok\"},Gr.OK);if(r===\"/_internal/metric\")return Response.json(yield*Ca(()=>EdgeRuntime.getRuntimeMetrics()));let n=r.split(\"/\")[1];if(!n)return oc(\"Function not found\",Gr.NotFound);let o=yield*Vee(n);if(!o)return oc(\"Function not found\",Gr.NotFound);if(yield*Zee(n,o),e.method!==\"OPTIONS\"&&o.verifyJWT){let u=Hee(e);if(typeof u!=\"string\")return B$(u);let f=yield*Gee(_ee,u);if(xe.isSome(f))return B$(f.value)}let s={...Deno.env.toObject(),...Object.fromEntries(Object.entries(o.env??{}).filter(([u])=>!u.startsWith(\"SUPABASE_\"))),SUPABASE_FUNCTION_SLUG:n};L$&&(s.SUPABASE_PUBLISHABLE_KEYS=yield*me.encodeEffect(me.fromJsonString(me.Unknown))({default:L$})),$$&&(s.SUPABASE_SECRET_KEYS=yield*me.encodeEffect(me.fromJsonString(me.Unknown))({default:$$}));let a=Object.entries(s).filter(([u])=>!Oee.has(u)&&!u.startsWith(\"SUPABASE_INTERNAL_\")),i=!(yield*Qee(o));return yield*U.gen(function*(){let u=yield*Ca(()=>EdgeRuntime.userWorkers.create({servicePath:Yee(n,o),memoryLimitMb:256,workerTimeoutMs:Number.isFinite(D$)?D$*1e3:4e5,noModuleCache:!0,noNpm:i,envVars:a,forceCreate:!0,customModuleRoot:\"\",cpuTimeSoftLimitMs:1e3,cpuTimeHardLimitMs:2e3,decoratorType:\"tc39\",maybeEntrypoint:XL(o.entrypointPath).href,context:{useReadSyncFileAPI:!0,...o.importMapPath===\"\"||o.importMapDiscoveredByRuntime?{}:{importMapPath:o.importMapPath}},staticPatterns:o.staticFiles}));return yield*Ca(()=>u.fetch(ete(e,t)))}).pipe(U.retry({times:1,while:({cause:u})=>e.body===null&&Uee(u)}),U.catchTag(\"BootstrapOperationError\",({cause:u})=>tc.error(\"[functions] worker error\",u).pipe(U.andThen(U.succeed(zee(u))))))}).pipe(U.scoped),{signal:e.signal}).then(t=>{if(sr.isSuccess(t))return t.value;if(e.signal.aborted&&Lt.hasInterruptsOnly(t.cause))return new Response(null,{status:499});throw Lt.squash(t.cause)}),onListen:()=>{let t=Object.keys(Z0).slice(0,5).map(r=>` - http://127.0.0.1:${U$}/functions/v1/${r}`);U.runSync(tc.log(`Serving functions on http://127.0.0.1:${U$}/functions/v1/${t.length?`\n${t.join(`\n`)}`:\"\"}\nUsing ${Deno.version.deno}`))},onError:()=>oc({code:_0[500],message:\"Request failed due to an internal server error\"},500)});export{Dee as RequestErrors,qee as extractBearerToken,ete as prepareUserRequest};\n"; +export const defaultFunctionsBootstrap = "var eB=Object.defineProperty;var Eo=(e,t)=>{for(var r in t)eB(e,r,{get:t[r],enumerable:!0})};var Z=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let r=e;for(let n=0,o=t.length;nt(r,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(r,n){return arguments.length>=2?t(r,n):function(o){return t(o,r)}};case 3:return function(r,n,o){return arguments.length>=3?t(r,n,o):function(s){return t(s,r,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(n){return t(n,...r)}}}};var R=e=>e;var je=e=>()=>e,Sr=je(!0),yf=je(!1),$g=je(null),bn=je(void 0),$n=bn;function Bg(e,...t){return Z(e,t)}function rC(e,t,r,n,o,s,a,i,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return r(t(e.apply(this,arguments)))};case 4:return function(){return n(r(t(e.apply(this,arguments))))};case 5:return function(){return o(n(r(t(e.apply(this,arguments)))))};case 6:return function(){return s(o(n(r(t(e.apply(this,arguments))))))};case 7:return function(){return a(s(o(n(r(t(e.apply(this,arguments)))))))};case 8:return function(){return i(a(s(o(n(r(t(e.apply(this,arguments))))))))};case 9:return function(){return c(i(a(s(o(n(r(t(e.apply(this,arguments)))))))))}}}function Vr(e){let t=new WeakMap;return r=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),o}}function Pa(e){let t=new WeakMap;return r=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),o!==r&&t.set(o,o),o}}var Ft={};Eo(Ft,{AsyncFiberError:()=>vq,AsyncFiberErrorTypeId:()=>Aq,Done:()=>ub,DoneTypeId:()=>yq,ExceededCapacityError:()=>fb,ExceededCapacityErrorTypeId:()=>Cq,IllegalArgumentError:()=>ml,IllegalArgumentErrorTypeId:()=>Iq,InterruptorStackTrace:()=>XS,NoSuchElementError:()=>gq,NoSuchElementErrorTypeId:()=>xq,ReasonTypeId:()=>tq,StackTrace:()=>QS,TimeoutError:()=>Eq,TimeoutErrorTypeId:()=>Sq,TypeId:()=>eq,UnknownError:()=>Rq,UnknownErrorTypeId:()=>Oq,annotate:()=>Pq,annotations:()=>Mq,combine:()=>aq,die:()=>ci,done:()=>Y,empty:()=>nq,fail:()=>oq,filterInterruptors:()=>dq,findDefect:()=>dl,findDie:()=>uq,findError:()=>ab,findErrorOption:()=>ib,findFail:()=>iq,findInterrupt:()=>lq,fromReasons:()=>oa,hasDies:()=>cq,hasFails:()=>sb,hasInterrupts:()=>fq,hasInterruptsOnly:()=>ob,interrupt:()=>sq,interruptors:()=>pq,isAsyncFiberError:()=>kq,isCause:()=>eb,isDieReason:()=>rb,isDone:()=>qc,isExceededCapacityError:()=>wq,isFailReason:()=>na,isIllegalArgumentError:()=>Tq,isInterruptReason:()=>rq,isNoSuchElementError:()=>hq,isReason:()=>tb,isTimeoutError:()=>bq,isUnknownError:()=>_q,makeDieReason:()=>zc,makeFailReason:()=>jc,makeInterruptReason:()=>nb,map:()=>Ss,pretty:()=>cb,prettyErrors:()=>mq,reasonAnnotations:()=>Mm,squash:()=>Pm});var Sf=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(\"stack\");let r=Object.getPrototypeOf(e),n=r;for(;n!==null&&n!==Object.prototype;){let o=Reflect.ownKeys(n);for(let s=0;snew Uint8Array(e.buffer,e.byteOffset,e.byteLength);var Ma=0,oC=()=>{Ma++};function br(e){return typeof e==\"string\"}function Ef(e){return typeof e==\"number\"}function ad(e){return typeof e==\"boolean\"}function sC(e){return typeof e==\"bigint\"}function jg(e){return typeof e==\"symbol\"}function id(e){return br(e)||Ef(e)||jg(e)}function Zr(e){return typeof e==\"function\"}function aC(e){return e===void 0}function Io(e){return e!==void 0}function cd(e){return e!=null}function iC(e){return!1}function zg(e){return!0}function fr(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}function If(e){return typeof e==\"object\"&&e!==null||Zr(e)}var k=l(2,(e,t)=>If(e)&&t in e),At=l(2,(e,t)=>k(e,\"_tag\")&&e._tag===t);function cC(e){return e instanceof Error}function as(e){return k(e,Symbol.iterator)||br(e)}var se=\"~effect/Hash\",H=e=>{switch(typeof e){case\"number\":return It(e);case\"bigint\":return Re(e.toString(10));case\"string\":return Re(e);case\"function\":case\"object\":{if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?Re(\"Invalid Date\"):Re(e.toISOString());if(e instanceof RegExp)return Re(e.toString());{if(lc.has(e))return ud(e);let t=fC.get(e);if(t!==void 0)return t;if(Wg.has(e))return oC(),Re(\"[Circular]\");Wg.add(e);let r=Ma,n;try{se in e?n=e[se]():typeof e==\"function\"?n=ud(e):e instanceof DataView?n=To(bf(e)):Array.isArray(e)||ArrayBuffer.isView(e)?n=To(e):e instanceof Map?n=tB(e):e instanceof Set?n=rB(e):n=Tf(e)}finally{Wg.delete(e)}return r===Ma&&fC.set(e,n),n}}}return qt(lC(Re(String(e))))},ud=e=>(Hg.has(e)||Hg.set(e,qt(Math.random()*4294967296|0)),Hg.get(e)),lC=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),le=l(2,(e,t)=>lC(Math.imul(e,2654435761)+Math.imul(t,2246822507))),qt=e=>e&3221225471|e>>>1&1073741824;var qg=new DataView(new ArrayBuffer(8)),It=e=>{let t=e|0;return t===e?qt(t):(qg.setFloat64(0,e!==e?NaN:e),qt(le(qg.getInt32(0),qg.getInt32(4))))},Re=e=>{let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return qt(t)},Jg=(e,t)=>{let r=12289;for(let n of t)r^=le(H(n),H(e[n]));return qt(r)},Tf=e=>Jg(e,Sf(e)),pC=(e,t)=>r=>{let n=e;for(let o of r)n^=t(o);return qt(n)},To=e=>{let t=6151;for(let r of e)t=le(t,H(r));return qt(t)},tB=pC(Re(\"Map\"),([e,t])=>le(H(e),H(t))),uC=Re(\"Set\"),rB=pC(uC,e=>le(uC,H(e))),Hg=new WeakMap,fC=new WeakMap,Wg=new WeakSet;var ae=\"~effect/Equal\";function J(){return arguments.length===1?e=>Fa(e,arguments[0]):Fa(arguments[0],arguments[1])}function Fa(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let r=typeof e;return r!==typeof t?!1:r===\"number\"&&e!==e&&t!==t?!0:r!==\"object\"&&r!==\"function\"||lc.has(e)||lc.has(t)?!1:nB(e,t)}function nB(e,t){let r=fd.length;for(let s=r;s-- >0;)if(fd[s]===e&&Kg[s]===t)return!0;if(r)return dC(e,t);let n=mC.get(e);n||mC.set(e,n=new WeakMap);let o=n.get(t);return o===void 0&&n.set(t,o=dC(e,t)),o}function dC(e,t){fd.push(e),Kg.push(t);try{return oB(e,t)}finally{fd.pop(),Kg.pop()}}var fd=[],Kg=[],mC=new WeakMap;function oB(e,t){if(H(e)!==H(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),o=t.getTime();return n===o||Number.isNaN(n)&&Number.isNaN(o)}else if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let r=xC(e);if(r!==xC(t)||typeof e==\"function\"&&!r)return!1;if(r)return e[ae](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:sB(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?hC(bf(e),bf(t)):hC(e,t)}else{if(e instanceof Map)return!(t instanceof Map)||e.size!==t.size?!1:Gg(e,t,iB,cB);if(e instanceof Set)return!(t instanceof Set)||e.size!==t.size?!1:Gg(e,t,H,Fa)}return aB(e,t)}function sB(e,t){for(let r=0;rH(e[0]),cB=(e,t)=>Fa(e[0],t[0])&&Fa(e[1],t[1]),uB=()=>0;function ld(e,t){return wf((r,n)=>e(r[0],n[0])&&t(r[1],n[1]))}function wf(e){return function(r,n){return Gg(r,n,uB,e)}}var xC=e=>k(e,ae),Vg=()=>J;var gC=e=>(lc.add(e),e);var Na=Symbol.for(\"~effect/Redactable\"),fB=e=>k(e,Na);function is(e){return fB(e)?Zg(e):e}function Zg(e){return e[Na](globalThis[pc]?.context??lB)}var pc=\"~effect/Fiber/currentFiber\",yC=new Map,lB={\"~effect/Context\":{},base:yC,depth:0,mapUnsafe:yC,pipe(){return Z(this,arguments)}};function F(e,t){let r=t?.space??0,n=new WeakSet,o=r?typeof r==\"number\"?\" \".repeat(r):r:\"\",s=f=>o.repeat(f),a=(f,p)=>{let d=f?.constructor;return d&&d!==Object.prototype.constructor&&d.name?`${d.name}(${p})`:p},i=f=>{try{return Reflect.ownKeys(f)}catch{return[\"[ownKeys threw]\"]}};function c(f,p=0){try{return u(f,p)}catch{return(typeof f==\"object\"&&f!==null||typeof f==\"function\")&&n.delete(f),\"[inspection threw]\"}}function u(f,p=0){if(typeof f==\"string\")return JSON.stringify(f);if(typeof f==\"number\"||f==null||typeof f==\"boolean\"||typeof f==\"symbol\")return String(f);if(typeof f==\"bigint\")return String(f)+\"n\";if(typeof f==\"object\"||typeof f==\"function\"){if(n.has(f))return pB;n.add(f);let d;if(Na in f)d=c(Zg(f),p);else if(Array.isArray(f))d=!o||f.length<=1?`[${f.map(m=>c(m,p)).join(\",\")}]`:`[\n${s(p+1)}${f.map(m=>c(m,p+1)).join(`,\n`+s(p+1))}\n${s(p)}]`;else if(f instanceof Date)d=Yg(f);else if(!t?.ignoreToString&&k(f,\"toString\")&&typeof f.toString==\"function\"&&f.toString!==Object.prototype.toString&&f.toString!==Array.prototype.toString){let m=dB(f);d=f instanceof Error&&f.cause!==void 0?`${m} (cause: ${c(f.cause,p)})`:m}else if(Symbol.iterator in f)d=`${f.constructor.name}(${c(Array.from(f),p)})`;else{let m=i(f);if(!o||m.length<=1){let x=`{${m.map(y=>`${wo(y)}:${c(bC(f,y),p)}`).join(\",\")}}`;d=a(f,x)}else{let x=`{\n${m.map(y=>`${s(p+1)}${wo(y)}: ${c(bC(f,y),p+1)}`).join(`,\n`)}\n${s(p)}}`;d=a(f,x)}}return n.delete(f),d}return String(f)}return c(e,0)}var pB=\"[Circular]\";function wo(e){return typeof e==\"string\"?JSON.stringify(e):String(e)}function pd(e){return e.map(t=>`[${wo(t)}]`).join(\"\")}function Yg(e){try{return e.toISOString()}catch{return\"Invalid Date\"}}function dB(e){try{let t=e.toString();return typeof t==\"string\"?t:String(t)}catch{return\"[toString threw]\"}}function bC(e,t){try{return e[t]}catch{return\"[property access threw]\"}}function Ua(e,t){let r=[];return JSON.stringify(e,function(n,o){let s=Object.getOwnPropertyDescriptor(this,n)?.value,a=k(s,Na)?is(s):is(o);if(typeof a==\"bigint\")return F(a);if(typeof a!=\"object\"||a===null)return a;let i=a instanceof Error&&!k(a,\"toJSON\")?{...a,name:a.name,message:a.message}:a;for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(a))return;if(r.push(a),i!==a&&r.push(i),!mB(i)||hB(i))return i;let c=new Proxy(i,{get(u,f){let p=Reflect.get(u,f,u);return Object.getOwnPropertyDescriptor(u,f)?.get!==void 0?is(p):p}});return r.push(c),c},t?.space)??\"null\"}function mB(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function hB(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}var Te=Symbol.for(\"nodejs.util.inspect.custom\"),vt=e=>{try{return e=is(e),k(e,\"toJSON\")&&Zr(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(vt):e}catch{return\"[toJSON threw]\"}},IC=(e,t=2)=>{if(typeof e==\"string\")return e;try{return typeof e==\"object\"?Ua(e,{space:t}):F(e,{space:t})}catch{return String(e)}},dc={toJSON(){return vt(this)},[Te](){return this.toJSON()},toString(){return F(this.toJSON())}},EC=class{[Te](){return this.toJSON()}toString(){return F(this.toJSON())}};var gB=()=>{let e=Object.getOwnPropertyDescriptor(Error,\"stackTraceLimit\");return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,\"writable\")?e.writable===!0:e.set!==void 0},yB=gB(),Co=()=>Error.stackTraceLimit,Yr=e=>{yB&&(Error.stackTraceLimit=e)};var Bs=class{constructor(t){this.value=t,this.done=!1}next(t){return this.done?(this.value=t,this):(this.done=!0,{value:this.value,done:!1})}},SB=()=>{let e=\"~effect/Utils/internal\",t={[e]:o=>o()},r={[e]:o=>o()};return Co()!==0&&t[e](()=>new Error().stack)?.includes(e)===!0?t[e]:r[e]},js=SB();function M(e,t,r){t===\"__proto__\"?Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[t]=r}function md(e,t){for(let r of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,r)&&M(e,r,t[r])}var ko=\"~effect/Effect\",Da=\"~effect/Exit\",EB={_A:R,_E:R,_R:R},Qg=`${ko}/identifier`,ue=`${ko}/args`,Ke=`${ko}/evaluate`,_t=`${ko}/successCont`,Qr=`${ko}/failureCont`,La=`${ko}/ensureCont`,ja=Symbol.for(\"effect/Effect/Yield\"),rr={pipe(){return Z(this,arguments)},toJSON(){return{...this}},toString(){return F(this.toJSON(),{ignoreToString:!0,space:2})},[Te](){return this.toJSON()}},wC={[se](){return Jg(this,Object.keys(this))},[ae](e){let t=Object.keys(this),r=Object.keys(e);if(t.length!==r.length)return!1;for(let n=0;nk(e,ko),vf=e=>k(e,Da),Cf=\"~effect/Cause\",mc=\"~effect/Cause/Reason\",xc=e=>k(e,Cf),CC=e=>k(e,mc),Ao=class{constructor(t){this[Cf]=Cf,this.reasons=t}pipe(){return Z(this,arguments)}toJSON(){return{_id:\"Cause\",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${F(this.reasons)})`}[Te](){return this.toJSON()}[ae](t){return xc(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((r,n)=>J(r,t.reasons[n]))}[se](){return To(this.reasons)}},TC=new WeakMap,hc=class{[mc];annotations;_tag;constructor(t,r,n){if(this[mc]=mc,this._tag=t,r!==Of&&typeof n==\"object\"&&n!==null&&r.size>0){let o=TC.get(n);o&&(r=new Map([...o,...r])),TC.set(n,r)}this.annotations=r}annotate(t,r){if(t.mapUnsafe.size===0)return this;let n=new Map(this.annotations);t.mapUnsafe.forEach((s,a)=>{r?.overwrite!==!0&&n.has(a)||n.set(a,s)});let o=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return o.annotations=n,o}pipe(){return Z(this,arguments)}toString(){return F(this)}[Te](){return this.toString()}},Of=new Map,$a=class extends hc{constructor(t,r=Of){super(\"Fail\",r,t),this.error=t}toString(){return`Fail(${F(this.error)})`}toJSON(){return{_tag:\"Fail\",error:this.error}}[ae](t){return jn(t)&&J(this.error,t.error)&&J(this.annotations,t.annotations)}[se](){return le(Re(this._tag))(le(H(this.error))(H(this.annotations)))}},cs=e=>new Ao(e),TB=(e,t)=>{let r=new Map,n=[];for(let o of e.concat(t)){let s=H(o),a=r.get(s);if(a===void 0)r.set(s,[o]);else{if(a.some(i=>J(i,o)))continue;a.push(o)}n.push(o)}return n},za=l(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let r=new Ao(TB(e.reasons,t.reasons));return J(e,r)?e:r}),hd=new Ao([]),gc=e=>new Ao([new $a(e)]),Af=class extends hc{constructor(t,r=Of){super(\"Die\",r,t),this.defect=t}toString(){return`Die(${F(this.defect)})`}toJSON(){return{_tag:\"Die\",defect:this.defect}}[ae](t){return qa(t)&&J(this.defect,t.defect)&&J(this.annotations,t.annotations)}[se](){return le(Re(this._tag))(le(H(this.defect))(H(this.annotations)))}},Xg=e=>new Ao([new Af(e)]),yc=l(e=>xc(e[0]),(e,t,r)=>t.mapUnsafe.size===0?e:new Ao(e.reasons.map(n=>n.annotate(t,r)))),jn=e=>e._tag===\"Fail\",qa=e=>e._tag===\"Die\",Ha=e=>e._tag===\"Interrupt\";function wB(e){return Er(\"Effect.evaluate: Not implemented\")}var Xr=e=>({...IB,[Qg]:e.op,[Ke]:e[Ke]??wB,[_t]:e[_t],[Qr]:e[Qr],[La]:e[La]}),En=e=>{let t=Xr(e),r=function(n){this[ue]=n};return r.prototype=t,function(n){return new r(n)}},AC=e=>{let t={[Da]:Da,_tag:e.op,get[e.prop](){return this[ue]},...Xr(e),toString(){return`${e.op}(${F(this[ue])})`},toJSON(){return{_id:\"Exit\",_tag:e.op,[e.prop]:this[ue]}},[ae](n){return vf(n)&&n._tag===this._tag&&J(this[ue],n[ue])},[se](){return le(Re(e.op),H(this[ue]))}},r=function(n){this[ue]=n};return r.prototype=t,function(n){return new r(n)}},Ae=AC({op:\"Success\",prop:\"value\",[Ke](e){let t=e.getCont(_t);return t?t[_t](this[ue],e,this):e.yieldWith(this)}}),xd={key:\"effect/Cause/StackTrace\"},ey={key:\"effect/Cause/InterruptorStackTrace\"},Ht=AC({op:\"Failure\",prop:\"cause\",[Ke](e){let t=this[ue],r=!1;e.cache.stackFrame&&(t=yc(t,{mapUnsafe:new Map([[xd.key,e.cache.stackFrame]])}),r=!0);let n=e.getCont(Qr),o=e._interruptedCause;if(o&&e.interruptible){let s=!1;for(;n&&e.interruptible;)s||=Qg in n,n=e.getCont(Qr);s&&(t=cs(t.reasons.filter(a=>a._tag!==\"Fail\"))),t=za(t,o),r=!0}return n?n[Qr](t,e,r?void 0:this):e.yieldWith(r?Ht(t):this)}}),en=e=>Ht(gc(e)),Er=e=>Ht(Xg(e)),re=En({op:\"WithFiber\",[Ke](e){return this[ue](e)}}),kC=En({op:\"WithFiberSucceed\",[Ke](e){let t=this[ue](e),r=e.getCont(_t);return r?r[_t](t,e):e.yieldWith(Ae(t))}}),CB=(function(){class e extends globalThis.Error{}let t=Xr({op:\"YieldableError\",[Ke](){return en(this)}});return delete t.toString,Object.assign(e.prototype,t),e})(),_f=(function(){let e=Symbol.for(\"effect/Data/Error/plainArgs\");return class extends CB{constructor(r){super(r?.message,r?.cause?{cause:r.cause}:void 0),r&&(md(this,r),Object.defineProperty(this,e,{value:r,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),us=e=>{class t extends _f{_tag=e}return t.prototype.name=e,t},kf=\"~effect/Cause/NoSuchElementError\",gd=e=>k(e,kf),Bn=class extends us(\"NoSuchElementError\"){[kf]=kf;constructor(t){super({message:t})}},Ba=\"~effect/Cause/Done\",vC=e=>k(e,Ba),OC={[Ba]:Ba,_tag:\"Done\",value:void 0},Wa=e=>e===void 0?OC:{[Ba]:Ba,_tag:\"Done\",value:e},AB=en(OC),_C=e=>e===void 0?AB:en(Wa(e));var yd=e=>Xr({op:e.label,[Ke]:e.evaluate});var xe={};Eo(xe,{Do:()=>fj,all:()=>ZB,andThen:()=>HB,as:()=>JC,asVoid:()=>zB,bind:()=>uj,bindTo:()=>ij,composeK:()=>GB,contains:()=>sj,containsWith:()=>ZC,exists:()=>aj,filter:()=>Va,filterMap:()=>ej,firstSomeOf:()=>BB,flatMap:()=>Ka,flatMapNullishOr:()=>WB,flatten:()=>Ga,fromIterable:()=>FB,fromNullOr:()=>cy,fromNullishOr:()=>Nf,fromUndefinedOr:()=>iy,gen:()=>lj,getFailure:()=>UB,getOrElse:()=>Ff,getOrNull:()=>Rd,getOrThrow:()=>uy,getOrThrowWith:()=>Pd,getOrUndefined:()=>qs,getSuccess:()=>NB,isNone:()=>fe,isOption:()=>wc,isSome:()=>be,let:()=>cj,lift2:()=>nj,liftNullishOr:()=>jB,liftPredicate:()=>oj,liftThrowable:()=>zn,makeCombinerFailFast:()=>YC,makeEquivalence:()=>tj,makeOrder:()=>rj,makeReducer:()=>pj,makeReducerFailFast:()=>dj,map:()=>Rt,match:()=>Wt,none:()=>v,orElse:()=>DB,orElseResult:()=>$B,orElseSome:()=>LB,partitionMap:()=>XB,product:()=>GC,productMany:()=>VB,reduceCompact:()=>YB,some:()=>O,tap:()=>KC,toArray:()=>QB,toRefinement:()=>MB,void:()=>qB,zipLeft:()=>KB,zipRight:()=>JB,zipWith:()=>VC});function RC(e){return{combine:e}}function ry(e,t,r){return{combine:e,initialValue:t,combineAll:r??(n=>{let o=t;for(let s of n)o=e(o,s);return o})}}var nr=e=>(t,r)=>t===r||e(t,r),kB=(e,t)=>e===t,Ja=()=>kB;function FC(e){return nr((t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n{if(t.length!==r.length)return!1;for(let n=0;nl(3,(t,r,n)=>e(t,o=>({...o,[r]:n(o)}))),Ed=e=>l(2,(t,r)=>e(t,n=>({[r]:n}))),Id=(e,t)=>l(3,(r,n,o)=>t(r,s=>e(o(s),a=>({...s,[n]:a}))));var UC=\"~effect/Option\",DC={[UC]:{_A:e=>e},...rr,[Symbol.iterator](){return new Bs(this)}},vB=Object.defineProperty(Object.assign(Object.create(DC),{_tag:\"Some\",_op:\"Some\",[ae](e){return Td(e)&&ny(e)&&J(this.value,e.value)},[se](){return le(H(this._tag))(H(this.value))},toString(){return`some(${F(this.value)})`},toJSON(){return{_id:\"Option\",_tag:this._tag,value:vt(this.value)}}}),\"valueOrUndefined\",{get(){return this.value}}),OB=H(\"None\"),_B=Object.assign(Object.create(DC),{_tag:\"None\",_op:\"None\",valueOrUndefined:void 0,[ae](e){return Td(e)&&wd(e)},[se](){return OB},toString(){return\"none()\"},toJSON(){return{_id:\"Option\",_tag:this._tag}}}),Td=e=>k(e,UC),wd=e=>e._tag===\"None\",ny=e=>e._tag===\"Some\",Rf=Object.create(_B),LC=function(e){this.value=e};LC.prototype=vB;var Pf=e=>new LC(e);var BC=\"~effect/Result\",jC={[BC]:{_A:e=>e,_E:e=>e},...rr,[Symbol.iterator](){return new Bs(this)}},RB=Object.assign(Object.create(jC),{_tag:\"Success\",_op:\"Success\",[ae](e){return Cd(e)&&bc(e)&&J(this.success,e.success)},[se](){return le(H(this._tag))(H(this.success))},toString(){return`success(${F(this.success)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,value:vt(this.success)}}}),PB=Object.assign(Object.create(jC),{_tag:\"Failure\",_op:\"Failure\",[ae](e){return Cd(e)&&Sc(e)&&J(this.failure,e.failure)},[se](){return le(H(this._tag))(H(this.failure))},toString(){return`failure(${F(this.failure)})`},toJSON(){return{_id:\"Result\",_tag:this._tag,failure:vt(this.failure)}}}),Cd=e=>k(e,BC),Sc=e=>e._tag===\"Failure\",bc=e=>e._tag===\"Success\",zC=function(e){this.failure=e};zC.prototype=PB;var Ad=e=>new zC(e),qC=function(e){this.success=e};qC.prototype=RB;var kd=e=>new qC(e),oy=e=>bc(e)?Rf:Pf(e.failure),sy=e=>Sc(e)?Rf:Pf(e.success);function zs(e){return(t,r)=>t===r?0:e(t,r)}var WC=zs((e,t)=>eglobalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:eezs((r,n)=>e(t(r),t(n)))),Ic=ay(fs,e=>e.getTime());var vd=e=>l(2,(t,r)=>e(t,r)===-1),Tc=e=>l(2,(t,r)=>e(t,r)===1),Od=e=>l(2,(t,r)=>e(t,r)!==1),_d=e=>l(2,(t,r)=>e(t,r)!==-1);var v=()=>Rf,O=Pf,wc=Td,fe=wd,be=ny,Wt=l(2,(e,{onNone:t,onSome:r})=>fe(e)?t():r(e.value)),MB=e=>t=>be(e(t)),FB=e=>{for(let t of e)return O(t);return v()},NB=sy,UB=oy,Ff=l(2,(e,t)=>fe(e)?t():e.value),DB=l(2,(e,t)=>fe(e)?t():e),LB=l(2,(e,t)=>fe(e)?O(t()):e),$B=l(2,(e,t)=>fe(e)?Rt(t(),kd):Rt(e,Ad)),BB=e=>{let t=v();for(t of e)if(be(t))return t;return t},Nf=e=>e==null?v():O(e),iy=e=>e===void 0?v():O(e),cy=e=>e===null?v():O(e),jB=e=>(...t)=>Nf(e(...t)),Rd=Ff($g),qs=Ff(bn),zn=e=>(...t)=>{try{return O(e(...t))}catch{return v()}},Pd=l(2,(e,t)=>{if(be(e))return e.value;throw t()}),uy=Pd(()=>new Error(\"getOrThrow called on a None\")),Rt=l(2,(e,t)=>fe(e)?v():O(t(e.value))),JC=l(2,(e,t)=>Rt(e,()=>t)),zB=JC(void 0),qB=O(void 0);var Ka=l(2,(e,t)=>fe(e)?v():t(e.value)),HB=l(2,(e,t)=>Ka(e,r=>{let n=Zr(t)?t(r):t;return wc(n)?n:O(n)})),WB=l(2,(e,t)=>fe(e)?v():Nf(t(e.value))),Ga=Ka(R),JB=l(2,(e,t)=>Ka(e,()=>t)),KB=l(2,(e,t)=>KC(e,()=>t)),GB=l(2,(e,t)=>r=>Ka(e(r),t)),KC=l(2,(e,t)=>Ka(e,r=>Rt(t(r),()=>r))),GC=l(2,(e,t)=>be(e)&&be(t)?O([e.value,t.value]):v()),VB=l(2,(e,t)=>{if(fe(e))return v();let r=[e.value];for(let n of t){if(fe(n))return v();r.push(n.value)}return O(r)}),ZB=e=>{if(Symbol.iterator in e){let r=[];for(let n of e){if(fe(n))return v();r.push(n.value)}return O(r)}let t={};for(let r of Object.keys(e)){let n=e[r];if(fe(n))return v();M(t,r,n.value)}return O(t)},VC=l(3,(e,t,r)=>Rt(GC(e,t),([n,o])=>r(n,o))),YB=l(3,(e,t,r)=>{let n=t;for(let o of e)be(o)&&(n=r(n,o.value));return n}),QB=e=>fe(e)?[]:[e.value],XB=l(2,(e,t)=>{if(fe(e))return[v(),v()];let r=t(e.value);return Sc(r)?[v(),O(r.failure)]:[O(r.success),v()]}),ej=l(2,(e,t)=>{if(fe(e))return v();let r=t(e.value);return bc(r)?O(r.success):v()}),Va=l(2,(e,t)=>fe(e)?v():t(e.value)?O(e.value):v()),tj=e=>nr((t,r)=>fe(t)?fe(r):fe(r)?!1:e(t.value,r.value)),rj=e=>zs((t,r)=>be(t)?be(r)?e(t.value,r.value):1:-1),nj=e=>l(2,(t,r)=>VC(t,r,e)),oj=l(2,(e,t)=>t(e)?O(e):v()),ZC=e=>l(2,(t,r)=>fe(t)?!1:e(t.value,r)),sj=ZC(Vg()),aj=l(2,(e,t)=>fe(e)?!1:t(e.value)),ij=Ed(Rt),cj=bd(Rt);var uj=Id(Rt,Ka),fj=O({}),lj=(...e)=>{let r=(e.length===1?e[0]:e[1].bind(e[0]))(),n=r.next();for(;!n.done;){let o=n.value;if(fe(o))return o;n=r.next(o.value)}return O(n.value)};function pj(e){return ry((t,r)=>fe(t)?r:fe(r)?t:O(e.combine(t.value,r.value)),v())}function YC(e){return RC((t,r)=>fe(t)||fe(r)?v():O(e.combine(t.value,r.value)))}function dj(e){let t=YC(e).combine,r=O(e.initialValue);return ry(t,r,n=>{let o=r;for(let s of n)if(o=t(o,s),fe(o))return o;return o})}var QC=\"~effect/Context/Service\",lr=function(){function e(){}let t=e;Object.setPrototypeOf(t,mj);let r=(n,o)=>(t.key=n,o?.defaultValue&&(t[ly]=ly,t.defaultValue=o.defaultValue),o?.make&&(t.make=o.make),o?.fiberCached&&XC.add(n),t);return arguments.length>0?r(arguments[0],arguments[1]):r},mj={[QC]:QC,...yd({label:\"Service\",evaluate(e){return Ae(Fe(e.context,this))}}),toJSON(){return{_id:\"Service\",key:this.key}},of(e){return e},context(e){return Za(this,e)},use(e){return re(t=>e(Fe(t.context,this)))},useSync(e){return re(t=>Ae(e(Fe(t.context,this))))}},XC=new Set,ly=\"~effect/Context/Reference\",eA=\"~effect/Context\",hj=8,xj=8,py=(e,t,r,n)=>{let o=Object.create(yj);return o.cacheRoot=e??o,o.base=t,o.overlay=r,o.depth=n,o._flat=void 0,o.baseHits=0,o},tA=(e,t)=>{t&&(tA(e,t.parent),e.set(t.key,t.value))},rA=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return tA(t,e.overlay),e._flat=t},gj=(e,t)=>{let r=new Map(e.mapUnsafe);return t(r),Oo(r)},Md=Symbol(),dy=(e,t)=>{let r=e;for(let o=r.overlay;o;o=o.parent)if(o.key===t)return o.value;let n=r.base.get(t);return n===void 0&&!r.base.has(t)?Md:(r.overlay&&++r.baseHits>=r.base.size&&r.baseHits>=xj&&(r.base=rA(r),r.overlay=void 0,r.depth=0),n)},Oo=e=>py(void 0,e,void 0,0),yj={get mapUnsafe(){return rA(this)},...rr,[eA]:{_Services:e=>e},toJSON(){return{_id:\"Context\",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ae](e){if(!Uf(e))return!1;let t=this.mapUnsafe,r=e.mapUnsafe;if(t.size!==r.size)return!1;for(let[n,o]of t)if(!r.has(n)||!J(o,r.get(n)))return!1;return!0},[se](){return It(this.mapUnsafe.size)}},nA=(e,t)=>e.cacheRoot===t.cacheRoot,Uf=e=>k(e,eA);var oA=e=>!!e[ly],Ir=()=>Sj,Sj=Oo(new Map),Za=(e,t)=>Oo(new Map([[e.key,t]])),Jt=l(3,(e,t,r)=>bj(e,t.key,r)),bj=(e,t,r)=>{let n=e,o=XC.has(t)?void 0:n.cacheRoot;if(n.depth>=hj){let s=new Map(n.mapUnsafe);return s.set(t,r),py(o,s,void 0,0)}return py(o,n.base,{key:t,value:r,parent:n.overlay},n.depth+1)};var Fd=l(2,(e,t)=>Df(e,t.key)),Df=(e,t)=>{let r=dy(e,t);return r===Md?void 0:r},_o=l(2,(e,t)=>{let r=dy(e,t.key);if(r===Md){if(oA(t))return sA(t);throw Ej(t)}return r}),Fe=_o,fy=\"~effect/Context/defaultValue\",sA=e=>fy in e?e[fy]:e[fy]=e.defaultValue(),Ej=e=>{let t=new Error(`Service not found${e.key?`: ${String(e.key)}`:\"\"}`);if(t.stack){let r=t.stack.split(`\n`);r.splice(1,3),t.stack=r.join(`\n`)}return t},Nd=l(2,(e,t)=>{let r=dy(e,t.key);return r!==Md?O(r):oA(t)?O(sA(t)):v()}),Ud=l(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:gj(e,r=>t.mapUnsafe.forEach((n,o)=>r.set(o,n)))),aA=(...e)=>{let t=new Map;for(let r=0;r{t.set(o,n)});return Oo(t)};var we=lr;var my=e=>e.length>0;var ot=e=>e>0?Math.floor(e):0,Tn=e=>Math.max(1,ot(e));var B=kd,W=Ad;var iA=Cd,ce=Sc,mt=bc;var Dd=l(2,(e,t)=>ce(e)?W(t(e.failure)):e),Tr=l(2,(e,t)=>mt(e)?B(t(e.success)):e),wr=l(2,(e,{onFailure:t,onSuccess:r})=>ce(e)?t(e.failure):r(e.success));var Lf=l(2,(e,t)=>ce(e)?t(e.failure):e.success);var Tj=l(2,(e,t)=>{if(mt(e))return e.success;throw t(e.failure)}),$f=Tj(R);var Lt=l(2,(e,t)=>ce(e)?W(e.failure):t(e.success));var hy=e=>{if(Symbol.iterator in e){let r=[];for(let n of e){if(ce(n))return n;r.push(n.success)}return B(r)}let t={};for(let r of Object.keys(e)){let n=e[r];if(ce(n))return n;M(t,r,n.success)}return B(t)};var cA=FC;var wj=(e,t)=>{let r=t?.length!==void 0?Tn(t.length):1/0;return{[Symbol.iterator](){let n=0;return{next(){return nAj(wj(()=>e,{length:t}))),fA=e=>Cj(e,1/0);var lA=e=>{let r=e[Symbol.iterator]().next();if(r.done)throw new Error(\"headUnsafe: empty iterable\");return r.value};var pA=l(2,(e,t)=>{let r=0;for(let n of e){let o=t(n,r);if(ad(o)){if(o)return O(n)}else if(be(o))return o;r++}return v()});var Aj=e=>({[Symbol.iterator](){let t=e[Symbol.iterator](),r;function n(){for(;;){if(r===void 0){let s=t.next();if(s.done)return s;r=s.value[Symbol.iterator]()}let o=r.next();if(!o.done)return o;r=void 0}}return{next:n}}});var dA=l(2,(e,t)=>({[Symbol.iterator](){let r=e[Symbol.iterator](),n=0;return{next(){let o=r.next();for(;!o.done;){if(t(o.value,n++))return{done:!1,value:o.value};o=r.next()}return{done:!0,value:void 0}}}}}));var kj=l(2,(e,t)=>Object.hasOwn(e,t));var Ya=l(2,(e,t)=>{let r={...e};for(let n of mA(e))M(r,n,t(e[n],n));return r});var mA=e=>Object.keys(e);var vj=e=>l(2,(t,r)=>{for(let n of mA(t))if(!kj(r,n)||!e(t[n],r[n]))return!1;return!0});var hA=e=>{let t=vj(e);return(r,n)=>t(r,n)&&t(n,r)};var Ld=globalThis.Array;var xA=l(2,(e,t)=>{let r=Tn(e),n=new Ld(r);for(let o=0;oe<=t?xA(t-e+1,r=>e+r):[e];var Ye=e=>Ld.isArray(e)?e:Ld.from(e);var $d=l(2,(e,t)=>[...e,t]),gy=l(2,(e,t)=>Ye(e).concat(Ye(t)));var gA=Ld.isArray;var or=my,tt=my;function Cc(e){let t=Number(e);return String(t)===e&&Number.isInteger(t)&&t>=0&&t<2**32-1}function Oj(e,t){return!Number.isFinite(e)||e<0||e>=t.length}var yA=l(2,(e,t)=>{let r=Math.floor(t);if(Oj(r,e))throw new Error(`Index out of bounds: ${r}`);return e[r]});var Bd=e=>e[e.length-1];var yy=pA;var _j=(e,t)=>{let r=H(t),n=e.get(r);if(n===void 0)return e.set(r,[t]),!0;for(let o of n)if(J(o,t))return!1;return n.push(t),!0};var Pt=()=>[],Ee=e=>[e],wn=l(2,(e,t)=>e.map(t));var jd=l(2,(e,t)=>{let r=Ye(e),n=[];for(let o=0;o{let r=[],n=[],o=0;for(let s of e){let a=t(s,o++);mt(a)?r.push(a.success):n.push(a.failure)}return[r,n]});var SA=Sd;var zd=e=>{let t=Ye(e);if(t.length<2)return[...t];let r=new Map,n=[];for(let o of t)_j(r,o)&&n.push(o);return n};var Hd=\"~effect/Duration\",kc=BigInt(0),CA=BigInt(1),Rj=BigInt(2),Pj=BigInt(10),bA=BigInt(24),qd=BigInt(60),by=BigInt(1e3),EA=BigInt(1e6);var Wd=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),AA=e=>Wd(e*1e6),IA=(e,t)=>{let r=e.indexOf(\".\");if(r===-1)return BigInt(e)*t;let n=e[0]===\"-\",o=e.slice(r+1),s=Pj**BigInt(o.length),a=(BigInt(e.slice(n?1:0,r))*s+BigInt(o))*t,i=a/s+(a%s*Rj>=s?CA:kc);return n?-i:i};var Mj=/^(-?\\d+(?:\\.\\d+)?)\\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Ge=e=>{switch(typeof e){case\"number\":return Js(e);case\"bigint\":return Ro(e);case\"string\":{if(e===\"Infinity\")return ls;if(e===\"-Infinity\")return Ac;let t=Mj.exec(e);if(!t)break;let[r,n,o]=t;if(o===\"nano\"||o===\"nanos\")return Ro(IA(n,CA));if(o===\"micro\"||o===\"micros\")return Ro(IA(n,by));let s=Number(n);switch(o){case\"milli\":case\"millis\":return Js(s);case\"second\":case\"seconds\":return Iy(s);case\"minute\":case\"minutes\":return $j(s);case\"hour\":case\"hours\":return Bj(s);case\"day\":case\"days\":return jj(s);case\"week\":case\"weeks\":return zj(s)}break}case\"object\":{if(e===null)break;if(Hd in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Ef)?TA(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Ws:e[0]===-1/0||e[1]===-1/0?Ac:e[0]===1/0||e[1]===1/0?ls:ar(Wd(e[0]*1e9+e[1]));let t=e,r=0;return t.weeks&&(r+=t.weeks*6048e5),t.days&&(r+=t.days*864e5),t.hours&&(r+=t.hours*36e5),t.minutes&&(r+=t.minutes*6e4),t.seconds&&(r+=t.seconds*1e3),t.milliseconds&&(r+=t.milliseconds),!t.microseconds&&!t.nanoseconds?ar(r):ar(Wd(r*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return TA(e)},TA=e=>{throw new Error(`Invalid Input: ${e}`)},kA=zn(Ge),wA={_tag:\"Millis\",millis:0},Fj={_tag:\"Infinity\"},Nj={_tag:\"NegativeInfinity\"},Uj={[Hd]:Hd,[se](){switch(this.value._tag){case\"Millis\":{let e=this.value.millis*1e6;return Number.isFinite(e)?H(Wd(e)):It(this.value.millis)}case\"Nanos\":return H(this.value.nanos);default:return Tf(this.value)}},[ae](e){return Ey(e)&&Hj(this,e)},toString(){switch(this.value._tag){case\"Infinity\":return\"Infinity\";case\"NegativeInfinity\":return\"-Infinity\";case\"Nanos\":return`${this.value.nanos} nanos`;case\"Millis\":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case\"Millis\":return{_id:\"Duration\",_tag:\"Millis\",millis:this.value.millis};case\"Nanos\":return{_id:\"Duration\",_tag:\"Nanos\",nanos:String(this.value.nanos)};case\"Infinity\":return{_id:\"Duration\",_tag:\"Infinity\"};case\"NegativeInfinity\":return{_id:\"Duration\",_tag:\"NegativeInfinity\"}}},[Te](){return this.toJSON()},pipe(){return Z(this,arguments)}},ar=e=>{let t=Object.create(Uj);return typeof e==\"number\"?isNaN(e)||e===0||Object.is(e,-0)?t.value=wA:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:\"Millis\",millis:e}:t.value={_tag:\"Nanos\",nanos:AA(e)}:t.value=e>0?Fj:Nj:e===kc?t.value=wA:t.value={_tag:\"Nanos\",nanos:e},t},Ey=e=>k(e,Hd),Ks=e=>e.value._tag!==\"Infinity\"&&e.value._tag!==\"NegativeInfinity\",vc=e=>{switch(e.value._tag){case\"Millis\":return e.value.millis===0;case\"Nanos\":return e.value.nanos===kc;case\"Infinity\":case\"NegativeInfinity\":return!1}},Dj=e=>{switch(e.value._tag){case\"Millis\":return e.value.millis<0;case\"Nanos\":return e.value.nanos{switch(e.value._tag){case\"Infinity\":case\"NegativeInfinity\":return ls;case\"Millis\":return e.value.millis<0?ar(-e.value.millis):e;case\"Nanos\":return e.value.nanosar(e);var Js=e=>ar(e),Iy=e=>ar(e*1e3),$j=e=>ar(e*6e4),Bj=e=>ar(e*36e5),jj=e=>ar(e*864e5),zj=e=>ar(e*6048e5),Cr=e=>_A(Ge(e),{onMillis:R,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),vA=e=>_A(Ge(e),{onMillis:t=>t/1e3,onNanos:t=>Number(t)/1e9,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var Jd=e=>{let t=Ge(e);switch(t.value._tag){case\"Infinity\":case\"NegativeInfinity\":throw new Error(\"Cannot convert infinite duration to nanos\");case\"Nanos\":return t.value.nanos;case\"Millis\":return AA(t.value.millis)}},OA=zn(Jd);var _A=l(2,(e,t)=>{switch(e.value._tag){case\"Millis\":return t.onMillis(e.value.millis);case\"Nanos\":return t.onNanos(e.value.nanos);case\"Infinity\":return t.onInfinity();case\"NegativeInfinity\":return(t.onNegativeInfinity??t.onInfinity)()}}),RA=l(3,(e,t,r)=>e.value._tag===\"Infinity\"||e.value._tag===\"NegativeInfinity\"||t.value._tag===\"Infinity\"||t.value._tag===\"NegativeInfinity\"?r.onInfinity(e,t):e.value._tag===\"Millis\"?t.value._tag===\"Millis\"?r.onMillis(e.value.millis,t.value.millis):r.onNanos(Jd(e),t.value.nanos):r.onNanos(e.value.nanos,Jd(t)));var qj=(e,t)=>RA(e,t,{onMillis:(r,n)=>r===n,onNanos:(r,n)=>r===n,onInfinity:(r,n)=>r.value._tag===n.value._tag});var PA=l(2,(e,t)=>RA(e,t,{onMillis:(r,n)=>ar(r-n),onNanos:(r,n)=>ar(r-n),onInfinity:(r,n)=>{let o=r.value._tag,s=n.value._tag;return o===\"Infinity\"?s===\"Infinity\"?Ws:ls:o===\"NegativeInfinity\"?s===\"NegativeInfinity\"?Ws:Ac:s===\"Infinity\"?Ac:ls}}));var Hj=l(2,(e,t)=>qj(e,t)),Wj=e=>{if(e.value._tag===\"Infinity\")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};if(e.value._tag===\"NegativeInfinity\")return{days:-1/0,hours:-1/0,minutes:-1/0,seconds:-1/0,millis:-1/0,nanos:-1/0};let t=Jd(e),r=t{if(e.value._tag===\"Infinity\")return\"Infinity\";if(e.value._tag===\"NegativeInfinity\")return\"-Infinity\";if(vc(e))return\"0\";if(Dj(e))return\"-\"+Ty(Lj(e));let t=Wj(e),r=[];return t.days!==0&&r.push(`${t.days}d`),t.hours!==0&&r.push(`${t.hours}h`),t.minutes!==0&&r.push(`${t.minutes}m`),t.seconds!==0&&r.push(`${t.seconds}s`),t.millis!==0&&r.push(`${t.millis}ms`),t.nanos!==0&&r.push(`${t.nanos}ns`),r.join(\" \")};var wy=l(2,(e,t)=>r=>{let n=e(r);if(ce(n))return W(r);let o=t(n.success);return ce(o)?W(r):o}),MA=e=>t=>{let r=e(t);return ce(r)?v():O(r.success)};var zf=we(\"effect/Scheduler\",{fiberCached:!0,defaultValue:()=>new Qa}),NA=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Jj=\"setImmediate\"in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},UA=e=>{try{return Jj(e)}catch{return NA(e)}},Cy=class{buckets=[];scheduleTask(t,r){let n=this.buckets,o=n.length,s,a=0;for(;ar);a++)s=n[a];s&&s[0]===r?s[1].push(t):a===o?n.push([r,[t]]):n.splice(a,0,[r,[t]])}drain(){let t=this.buckets;return this.buckets=[],t}},Qa=class{executionMode;setImmediate;constructor(t=\"async\",r){this.executionMode=t,this.setImmediate=r??(t===\"sync\"?NA:UA)}shouldYield(t){return t.currentOpCount>=t.cache.maxOpsBeforeYield}makeDispatcher(){return new Ay(this.setImmediate)}},Ay=class{tasks=new Cy;running=void 0;setImmediate;constructor(t=UA){this.setImmediate=t}scheduleTask(t,r){this.tasks.scheduleTask(t,r),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let t=this.tasks.drain();for(let r=0;r0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},DA=we(\"effect/Scheduler/MaxOpsBeforeYield\",{fiberCached:!0,defaultValue:()=>2048}),LA=we(\"effect/Scheduler/PreventSchedulerYield\",{fiberCached:!0,defaultValue:()=>!1});var Cn={};Eo(Cn,{Class:()=>Kd,Error:()=>Gd,TaggedClass:()=>Kj,TaggedError:()=>Fr,taggedEnum:()=>Gj});var Kd=class extends $s{constructor(e){super(),e&&md(this,e)}},Kj=e=>class extends Kd{_tag=e},Gj=()=>new Proxy({},{get(e,t,r){return t===\"$is\"?At:t===\"$match\"?Vj:n=>({...n,_tag:t})}});function Vj(){if(arguments.length===1){let r=arguments[0];return function(n){return r[n._tag](n)}}let e=arguments[0];return arguments[1][e._tag](e)}var Gd=_f,Fr=us;var $A=\"~effect/encoding/EncodingError\",An=class extends Fr(\"EncodingError\"){[$A]=$A};var zA=e=>BA(typeof e==\"string\"?Xj.encode(e):e),vy=e=>{switch(e){case 16:return Yj();case 32:return Qj();default:{let t=\"\";for(let r=e>>>3;r>0;r--)t+=Zj();return t}}},te=Uint8Array.from(\"0123456789abcdef\",e=>e.charCodeAt(0)),Xa=()=>Math.random()*4294967296>>>0,Zj=()=>{let e=Xa();return String.fromCharCode(te[e>>>28],te[e>>>24&15],te[e>>>20&15],te[e>>>16&15],te[e>>>12&15],te[e>>>8&15],te[e>>>4&15],te[e&15])},Yj=()=>{let e=Xa(),t=Xa();return String.fromCharCode(te[e>>>28],te[e>>>24&15],te[e>>>20&15],te[e>>>16&15],te[e>>>12&15],te[e>>>8&15],te[e>>>4&15],te[e&15],te[t>>>28],te[t>>>24&15],te[t>>>20&15],te[t>>>16&15],te[t>>>12&15],te[t>>>8&15],te[t>>>4&15],te[t&15])},Qj=()=>{let e=Xa(),t=Xa(),r=Xa(),n=Xa();return String.fromCharCode(te[e>>>28],te[e>>>24&15],te[e>>>20&15],te[e>>>16&15],te[e>>>12&15],te[e>>>8&15],te[e>>>4&15],te[e&15],te[t>>>28],te[t>>>24&15],te[t>>>20&15],te[t>>>16&15],te[t>>>12&15],te[t>>>8&15],te[t>>>4&15],te[t&15],te[r>>>28],te[r>>>24&15],te[r>>>20&15],te[r>>>16&15],te[r>>>12&15],te[r>>>8&15],te[r>>>4&15],te[r&15],te[n>>>28],te[n>>>24&15],te[n>>>20&15],te[n>>>16&15],te[n>>>12&15],te[n>>>8&15],te[n>>>4&15],te[n&15])},Oy=e=>{let t=new TextEncoder().encode(e);if(t.length%2!==0)return W(new An({module:\"Hex\",kind:\"Decode\",input:e,message:`Length must be a multiple of 2, but is ${t.length}`}));try{let r=t.length/2,n=new Uint8Array(r);for(let o=0;oTr(Oy(e),t=>ez.decode(t)),Xj=new TextEncoder,ez=new TextDecoder,tz=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\")),BA=e=>{let t=\"\";for(let r=0;r{if(48<=e&&e<=57)return e-48;if(97<=e&&e<=102)return e-97+10;if(65<=e&&e<=70)return e-65+10;throw new TypeError(\"Invalid input\")};var Ry=\"effect/Tracer/ParentSpan\",ei=class extends lr()(Ry,{fiberCached:!0}){},rz=e=>e;var Vd=we(\"effect/Tracer/DisablePropagation\",{defaultValue:yf}),WA=we(\"effect/Tracer/CurrentTraceLevel\",{defaultValue:()=>\"Info\"}),JA=we(\"effect/Tracer/MinimumTraceLevel\",{defaultValue:()=>\"All\"}),Py=\"effect/Tracer\",My=we(Py,{fiberCached:!0,defaultValue:()=>Fy}),Fy=rz({span:e=>new _y(e)}),_y=class{_tag=\"Span\";sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(t){this.name=t.name,this.parent=t.parent,this.annotations=t.annotations,this.links=t.links,this.startTime=t.startTime,this.kind=t.kind,this.sampled=t.sampled,this.status={_tag:\"Started\",startTime:t.startTime}}get traceId(){return this._traceId??=qs(this.parent)?.traceId??vy(32)}get spanId(){return this._spanId??=vy(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(t,r){this.status={_tag:\"Ended\",endTime:t,exit:r,startTime:this.status.startTime}}attribute(t,r){this.attributes.set(t,r)}event(t,r,n){this.events.push([t,r,n??{}])}addLinks(t){this.links.push(...t)}};var GA=\"effect/Metric/FiberRuntimeMetrics\";var VA=we(\"effect/ErrorReporter/CurrentErrorReporters\",{defaultValue:()=>new Set}),qf=we(\"effect/References/CurrentStackFrame\",{fiberCached:!0,defaultValue:bn}),Zd=we(\"effect/References/TracerEnabled\",{fiberCached:!0,defaultValue:Sr}),ti=we(\"effect/References/TracerTimingEnabled\",{defaultValue:Sr}),Hf=we(\"effect/References/TracerSpanAnnotations\",{defaultValue:()=>({})}),Wf=we(\"effect/References/TracerSpanLinks\",{defaultValue:()=>[]}),ps=we(\"effect/References/CurrentLogAnnotations\",{defaultValue:()=>({})}),Ny=we(\"effect/References/CurrentLogLevel\",{fiberCached:!0,defaultValue:()=>\"Info\"}),Uy=we(\"effect/References/MinimumLogLevel\",{fiberCached:!0,defaultValue:()=>\"Info\"});var Yd=we(\"effect/References/CurrentLogSpans\",{defaultValue:()=>[]});var Gs=e=>{if(e?.captureStackTrace===!1)return e;if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=\"boolean\")return e;let t=Co();if(t===0&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};Yr(3);let r=new Error;return Yr(t),{...e,captureStackTrace:sz(()=>r.stack)}},Dy=e=>t=>{let r;return()=>{if(r!==void 0)return r;let n=t();if(!n)return;let o=n.split(`\n`);if(o[e]!==void 0)return r=o[e].trim(),r}},sz=Dy(3);var Qd=class extends hc{constructor(t,r=Of){super(\"Interrupt\",r,\"Interrupted\"),this.fiberId=t}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:\"Interrupt\",fiberId:this.fiberId}}[ae](t){return Ha(t)&&this.fiberId===t.fiberId&&this.annotations===t.annotations}[se](){return le(Re(`${this._tag}:${this.fiberId}`))(ud(this.annotations))}},nk=e=>new Qd(e),Zs=e=>new Ao([new Qd(e)]),Gy=e=>e.reasons.some(jn),Vy=e=>{let t=e.reasons.find(jn);return t?B(t):W(e)},Ur=e=>{for(let t=0;te.reasons.some(qa),sk=e=>{let t=e.reasons.find(qa);return t?B(t):W(e)},tl=e=>{let t=e.reasons.find(qa);return t?B(t.defect):W(e)},am=e=>e.reasons.some(Ha),ak=e=>{let t=e.reasons.find(Ha);return t?B(t):W(e)},im=e=>{let t;for(let r=0;r{let t=im(e);return ce(t)?az:t.success},az=new Set,cm=e=>e.reasons.length>0&&e.reasons.every(Ha),ck=e=>Oo(e.annotations),uk=e=>{let t=new Map;for(let r of e.reasons)if(r.annotations.size>0)for(let[n,o]of r.annotations)t.set(n,o);return Oo(t)},fk=l(2,(e,t)=>{let r=!1,n=e.reasons.map(o=>jn(o)?(r=!0,new $a(t(o.error),o.annotations)):o);return r?cs(n):e}),um=e=>{let t;for(let r of e.reasons){if(r._tag===\"Fail\")return r.error;r._tag===\"Die\"&&(t??=r)}return t!==void 0?t.defect:e.reasons.length>0?new globalThis.Error(\"All fibers interrupted without error\"):new globalThis.Error(\"Empty cause\")},Zy=(e,t)=>{let r=[],n=[];if(e.reasons.length===0)return r;let o=Co();o!==0&&Yr(1);try{for(let s of e.reasons){if(s._tag===\"Interrupt\"){n.push(s);continue}r.push($y(s._tag===\"Die\"?s.defect:s.error,s.annotations,t))}if(r.length===0){let s=new Error(\"The fiber was interrupted by:\");s.name=\"InterruptCause\",s.stack=fz(s,n);let a=new globalThis.Error(\"All fibers interrupted without error\",{cause:s});a.name=\"InterruptError\",a.stack=`${a.name}: ${a.message}`,r.push($y(a,n[0].annotations,t))}}finally{o!==0&&Yr(o)}return r},$y=(e,t,r)=>{let n=typeof e,o;if(e&&n===\"object\"){if(o=new globalThis.Error(iz(e),{cause:e.cause?$y(e.cause):void 0}),typeof e.name==\"string\"&&(o.name=e.name),typeof e.stack==\"string\")o.stack=uz(e.stack,o,t);else{let s=`${o.name}: ${o.message}`;o.stack=t?By(s,t):s}r?.includeCauseInStack&&(o.stack=pk(o));for(let s of Object.keys(e))s in o||(o[s]=e[s])}else{o=new globalThis.Error(e?n===\"string\"?e:Ua(e):`Unknown error: ${e}`);let s=`${o.name}: ${o.message}`;o.stack=t?By(s,t):s}return o},iz=e=>{if(typeof e.message==\"string\")return e.message;if(typeof e.toString==\"function\"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Ua(e)},cz=/\\((.*)\\)/g,uz=(e,t,r)=>{let n=`${t.name}: ${t.message}`,o=(e.startsWith(n)?e.slice(n.length):e).split(`\n`),s=[n];for(let a=1;a{let r=t?.get(xd.key);return r&&(e=`${e}\n${lk(r)}`),e},fz=(e,t)=>{let r=[`${e.name}: ${e.message}`];for(let n of t){let o=n.fiberId!==void 0?`#${n.fiberId}`:\"unknown\",s=n.annotations.get(ey.key);r.push(` at fiber (${o})`),s&&r.push(lk(s))}return r.join(`\n`)},lk=e=>{let t=[],r=e,n=0;for(;r&&n<10;){let o=r.stack();if(o){let s=o.matchAll(cz),a=!1;for(let[,i]of s)a=!0,t.push(` at ${r.name} (${i})`);a||t.push(` at ${r.name} (${o.replace(/^at /,\"\")})`)}else t.push(` at ${r.name}`);r=r.parent,n++}return t.join(`\n`)},fm=e=>Zy(e).map(pk).join(`\n`),pk=e=>e.cause?`${e.stack} {\n${dk(e.cause,\" \")}\n}`:e.stack,dk=(e,t)=>{let r=e.stack.split(`\n`),n=`${t}[cause]: ${r[0]}`;for(let o=1,s=r.length;o{try{return globalThis.process?.getBuiltinModule?.(\"node:async_hooks\")?.AsyncResource}catch{return}})(),mk=()=>ZA===void 0?void 0:new ZA(\"effect/Fiber\"),ds=()=>globalThis[pc],Xd=class{constructor(t,r=!0){this.setContext(t),this.id=++pz.id,this.currentOpCount=0,this.interruptible=r,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[Yy](){return lz}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(t){return Fe(this.context,t)}addObserver(t){return this._exit?(t(this._exit),$n):(this._observers===void 0?this._observers=[t]:this._observers.push(t),()=>this.removeObserver(t))}removeObserver(t){if(this._exit||this._observers===void 0)return;let r=this._observers.indexOf(t);r>=0&&this._observers.splice(r,1)}interruptUnsafe(t,r){if(this._exit)return;let n=Zs(t);this.cache.stackFrame&&(n=yc(n,Za(xd,this.cache.stackFrame))),r&&(n=yc(n,r)),this._interruptedCause=this._interruptedCause?za(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(De(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(t){if(this._exit)return;if(this._asyncContext!==void 0){let o=this._asyncContext;return this._asyncContext=void 0,o.runInAsyncScope(this.evaluate,this,t)}else if(this._yielded!==void 0){let o=this._yielded;this._yielded=void 0,o()}let r=this.runLoop(t);if(r===ja){this._asyncContext=mk();return}let n=jy.interruptChildren&&jy.interruptChildren(this);if(n!==void 0)return this.evaluate(V(n,()=>r));if(this._exit=r,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&(this._parent._children?.delete(this),this._parent=void 0),this._observers!==void 0){let o=this._observers;this._observers=void 0;for(let s=0;si)}if(s=a.tracerContext?a.tracerContext(s,this):s[Ke](this),s===ja){let i=this._yielded;if(Da in i)return this._deferredInterrupt=!1,this._yielded=void 0,i;if(this._deferredInterrupt){this._yielded=void 0,i();continue}return ja}}catch(a){if(!k(s,Ke))return Er(`Fiber.runLoop: Not a valid effect: ${String(s)}`);s=Er(a)}}finally{this._running=n,globalThis[pc]=r}}getCont(t){if(this._deferredInterrupt)return this._deferredInterrupt=!1,mz;for(;;){let r=this._stack.pop();if(!r)return;let n=r[La];if(n!==void 0){let o=n.call(r,this);if(o)return o[t]=o,o}if(r[t])return r}}succeedWith(t){if((++this.currentOpCount&hz-1)===0)return Ae(t);let r=this.getCont(_t);return r?r[_t](t,this):this.yieldWith(Ae(t))}yieldWith(t){return this._yielded=t,ja}children(){return this._children??=new Set}pipe(){return Z(this,arguments)}setContext(t){let r=this.context;if(this.context=t,r!==void 0&&nA(r,t))return;let n=t.cacheRoot,o=n._fiberCache??=dz(t);this.cache?.scheduler!==o.scheduler&&(this._dispatcher=void 0),this.cache=o}get currentSpanLocal(){let t=this.cache.span;return t?._tag===\"Span\"?t:void 0}},dz=e=>{let t=Df(e,Py);return{scheduler:Fe(e,zf),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Fe(e,Zd),span:Df(e,Ry),logLevel:Fe(e,Ny),minimumLogLevel:Fe(e,Uy),stackFrame:Fe(e,qf),runtimeMetrics:Df(e,GA),maxOpsBeforeYield:Fe(e,DA),preventYield:Fe(e,LA)}},mz={[_t](e,t){return De(t._interruptedCause)},[Qr](e,t){return De(t._interruptedCause)}},hz=32,jy={interruptChildren:void 0},lm=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(ey.key,e.cache.stackFrame),Oo(t)},xz=e=>{if(!(e._children===void 0||e._children.size===0))return Oc(e._children)},Qy=e=>{let t=e;return t._exit?D(t._exit):ht(r=>t._exit?r(D(t._exit)):z(e.addObserver(n=>r(D(n)))))},pm=e=>ht(t=>{let r=e[Symbol.iterator](),n=[],o;function s(){let a=r.next();for(;!a.done;){if(a.value._exit){n.push(a.value._exit),a=r.next();continue}o=a.value.addObserver(i=>{n.push(i),s()});return}t(D(n))}return s(),z(()=>o?.())}),Xy=e=>{let t=e;return t._exit?t._exit:ht(r=>t._exit?r(t._exit):z(e.addObserver(r)))},hk=e=>ht(t=>{let r=Array.from(e);if(r.length===0)return t(D(Pt()));let n=new Array(r.length),o=Pt(),s=()=>{for(let c=0;c{if(a++,f._tag===\"Failure\")return i=!0,s(),t(f);n[c]=f.value,a===r.length&&t(D(n))};o.push(u),r[c].addObserver(u)}return z(()=>{i=!0,s()})}),rl=e=>re(t=>xk(e,t.id)),xk=l(e=>k(e[0],Yy),(e,t,r)=>re(n=>{let o=lm(n);return o=o&&r?Ud(o,r):o??r,e.interruptUnsafe(t,o),nl(Qy(e))})),Oc=e=>re(t=>{let r=lm(t),n=Pt();for(let o of e)o.interruptUnsafe(t.id,r),n.push(o);return nl(pm(n))});var D=Ae,De=Ht,Qe=en,z=En({op:\"Sync\",[Ke](e){let t=this[ue](),r=e.getCont(_t);return r?r[_t](t,e):e.yieldWith(Ae(t))}}),ne=En({op:\"Suspend\",[Ke](e){return this[ue]()}}),eS=l(e=>e.length>=2||wc(e[0]),(e,t)=>fe(e)?Qe(t?t():new Bn(\"Effect.fromOption: Option.none\")):D(e.value)),Pc=wr({onFailure:Qe,onSuccess:D}),gk=e=>e==null?Qe(new Bn):D(e),tS=En({op:\"Yield\",[Ke](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(pr)},this[ue]??0),e.yieldWith(()=>{t=!0})}}),Mc=tS(0),rS=e=>D(O(e)),oi=D(v()),yk=e=>fe(e)?oi:ke(e.value,O),Sk=e=>ne(()=>De(e())),Ys=e=>Er(e),dm=e=>ne(()=>Qe(e())),pe=D(void 0);var bk=e=>{let t=typeof e==\"function\"?e:e.try,r=typeof e==\"function\"?n=>new Rc(n,\"An error occurred in Effect.try\"):e.catch;return ne(()=>{try{return D(t())}catch(n){return Qe(r(n))}})};var nS=e=>oS(function(t,r){e(r).then(n=>t(D(n)),n=>t(Ys(n)))},e.length!==0),Ek=e=>{let t=typeof e==\"function\"?e:e.try,r=typeof e==\"function\"?n=>new Rc(n,\"An error occurred in Effect.tryPromise\"):e.catch;return oS(function(n,o){let s=a=>ne(()=>{try{return Qe(js(()=>r(a)))}catch(i){return Ys(i)}});try{t(o).then(a=>n(D(a)),a=>n(s(a)))}catch(a){n(s(a))}},t.length!==0)},Ik=e=>re(t=>e(t.id)),Tk=re(D),wk=Ik(D),oS=(function(){let e=Xr({op:\"Async\",[Ke](r){let n=!1,o=!1,s=this.withSignal?new AbortController:void 0,a=this.register.call(r.cache.scheduler,i=>{n||(n=!0,o?r.evaluate(i):o=i)},s?.signal);return o!==!1?o:(o=!0,r._yielded=()=>{n=!0},s===void 0&&a===void 0?ja:(r._stack.push(gz(()=>(n=!0,s?.abort(),a??pr))),ja))}}),t=function(r,n){this.register=r,this.withSignal=n};return t.prototype=e,function(r,n){return new t(r,n)}})(),gz=En({op:\"AsyncFinalizer\",[La](e){e.interruptible&&(e.interruptible=!1,e._stack.push(fl))},[Qr](e,t){return am(e)?V(Ov(Ht(e),this[ue]()),()=>De(e)):De(e)}}),ht=e=>oS(e,e.length>=2),mm=ht($n),Ck=(...e)=>{if(e.length===1){let n=e[0];return ne(()=>ni(n()))}let[t,r]=e;return ne(()=>ni(r.call(t.self)))},sS=(e,...t)=>{let r=t.length===0?function(){return ne(()=>ni(e.apply(this,arguments)))}:function(){let n=ne(()=>ni(e.apply(this,arguments)));for(let o=0;oObject.defineProperty(t,\"length\",{value:e,configurable:!0}),YA=Dy(2),Ak=function(){let e=typeof arguments[0]==\"string\",t=e?arguments[0]:\"Effect.fn\",r=e?arguments[1]:void 0,n=Co(),o;return n!==0&&(Yr(2),o=new globalThis.Error,Yr(n)),e?(s,...a)=>QA(t,s,o,a,e,r):QA(t,arguments[0],o,Array.prototype.slice.call(arguments,1),e,r)},QA=(e,t,r,n,o,s)=>{let a=typeof t==\"function\"?t:n.shift().bind(t.self),i=`${e} (definition)`,c=r?YA(()=>r.stack):bn;return aS(a.length,function(...u){let f=ne(()=>{let m=a.apply(this,arguments);return ie(m)?m:ni(m)});for(let m=0;mJy(f,m)):f,qf,m=>({name:e,stack:d?YA(()=>d.stack):bn,parent:{name:i,stack:c,parent:m}}))})},kk=(e,...t)=>aS(e.length,t.length===0?function(){return XA(()=>e.apply(this,arguments))}:function(){let r=XA(()=>e.apply(this,arguments));for(let n of t)r=n(r,...arguments);return r}),XA=e=>{try{let t=e(),r;for(;;){let n=t.next(r);if(n.done)return D(n.value);let o=n.value;if(o&&o._tag===\"Success\"){r=o.value;continue}else{if(o&&o._tag===\"Failure\")return n.value;{let s=!0;return ne(()=>s?(s=!1,V(n.value,a=>ni(t,a))):ne(()=>ni(e())))}}}}catch(t){return Ys(t)}},ni=(function(){let e=Xr({op:\"Iterator\",[_t](r,n){let o=this.iterator;for(;;){let s=o.next(r);if(s.done)return D(s.value);if(Ne(s.value)){if(s.value._tag===\"Failure\")return s.value}else return n._stack.push(this),s.value;r=s.value.value}},[Ke](r){return this[_t](this.initial,r)}}),t=function(r,n){this.iterator=r,this.initial=n};return t.prototype=e,function(r,n){return new t(r,n)}})(),Ar=l(2,(e,t)=>new ms(e,iS,D(t))),hm=function(e){return e._stack.push(this),this[ue]},yz=Xr({op:\"OnSuccess\",[Ke]:hm}),ms=function(e,t,r){this[ue]=e,this[_t]=t,this.payload=r};ms.prototype=yz;var iS=function(){return this.payload},vk=function(e,t){return t.succeedWith(this.payload)},xm=(()=>{let e=\"~effect/Effect/stackProbe\";return{[e]:function(){return new Error().stack}}[e]()?.includes(\"[as \"+e+\"]\")===!0})(),Sz=function(e,t){let r=this.payload;return t.succeedWith(xm?r(e):js(()=>r(e)))},Ok=function(e){let t=this.payload;return t(e)},bz=function(e){let t=this.payload;return new ms(t(e),vk,e)},Ez=function(e){return new ms(this.payload,vk,e)},Fc=e=>ke(e,O),_k=e=>Dc(e,{onFailure:D,onSuccess:Qe}),Fo=l(2,(e,t)=>new ms(e,ie(t)?iS:Ok,t)),si=l(2,(e,t)=>new ms(e,ie(t)?Ez:bz,t)),nl=e=>new ms(e,iS,pr),Rk=e=>nn(e,Qe),cS=(e,t)=>re(r=>{let n=new Set;return $c(r,()=>n.size===0?void 0:Oc(n)),ht(o=>{let s=Ye(e),a=s.length,i=0,c=!1,u=[],f=(p,d,m)=>{if(i++,p._tag===\"Failure\"){u.push(...p.cause.reasons),i>=a&&o(De(cs(u)));return}let x=!c;c=!0,o(p),x&&t?.onWinner&&t.onWinner({fiber:d,index:m,parentFiber:r})};for(let p=0;p{n.delete(d),f(m,d,p)}),c)break}})}),uS=(e,t)=>re(r=>{let n=new Set;return $c(r,()=>n.size===0?void 0:Oc(n)),ht(o=>{let s=!1,a=0;for(let i of e){if(s)break;let c=a++,u=ra(r,i,!0,!0,!1);n.add(u),u.addObserver(f=>{n.delete(u);let p=!s;s=!0,o(f),p&&t?.onWinner&&t.onWinner({fiber:u,index:c,parentFiber:r})})}})}),Pk=l(e=>ie(e[1]),(e,t,r)=>cS([e,t],r)),fS=l(e=>ie(e[1]),(e,t,r)=>uS([e,t],r)),V=l(2,(e,t)=>new ms(e,Ok,t)),Mk=l(2,(e,t)=>Ne(e)?e._tag===\"Success\"?t.onSuccess(e.value):t.onFailure(e.cause):Mo(e,t)),Ne=e=>e[Da]!==void 0,Fk=l(2,(e,t)=>Ne(e)?e._tag===\"Success\"?t(e.value):e:V(e,t)),Nk=e=>V(e,R),ke=l(2,(e,t)=>new ms(e,Sz,t)),Uk=l(2,(e,t)=>Ne(e)?mS(e,t):ke(e,t)),Dk=l(2,(e,t)=>Ne(e)?hS(e,t):wS(e,t)),Lk=l(2,(e,t)=>Ne(e)?xS(e,t):CS(e,t)),$k=l(2,(e,t)=>{if(Ne(e)){if(e._tag===\"Success\")return e;let r=Ur(e.cause);return ce(r)?e:t(r.success)}return gs(e,t)}),Nc=e=>Ht(Zs(e)),Qs=e=>e._tag===\"Success\",Bk=e=>e._tag===\"Success\"?B(e):W(e),jk=e=>e._tag===\"Success\"?B(e.value):W(e),lS=e=>e._tag===\"Failure\",zk=e=>e._tag===\"Failure\"?B(e):W(e),ol=e=>e._tag===\"Failure\"?B(e.cause):W(e),pS=wy(ol,Ur),qk=wy(ol,tl),dS=e=>e._tag===\"Failure\"&&am(e.cause),Hk=e=>e._tag===\"Failure\"&&sm(e.cause),Wk=e=>e._tag===\"Failure\"&&Gy(e.cause),pr=Ae(void 0),mS=l(2,(e,t)=>e._tag===\"Success\"?Ae(t(e.value)):e),hS=l(2,(e,t)=>{if(e._tag===\"Success\")return e;let r=Ur(e.cause);return ce(r)?e:en(t(r.success))}),xS=l(2,(e,t)=>{if(e._tag===\"Success\")return Ae(t.onSuccess(e.value));let r=Ur(e.cause);return ce(r)?e:en(t.onFailure(r.success))}),Iz=l(2,(e,t)=>Qs(e)?Ae(t):e),Jk=l(2,(e,t)=>Qs(e)?t:e),Kk=l(2,(e,t)=>Qs(e)?t.onSuccess(e.value):t.onFailure(e.cause)),Gk=Iz(void 0),gS=e=>{let t=[];for(let r of e)r._tag===\"Failure\"&&t.push(...r.cause.reasons);return t.length===0?pr:Ht(cs(t))},Vk=e=>Qs(e)?O(e.value):v(),Zk=e=>lS(e)?O(e.cause):v(),Yk=e=>{let t=pS(e);return ce(t)?v():O(t.success)},Qk=e=>e,Xk=e=>re(t=>D(Nd(t.context,e))),Tz=e=>re(t=>eS(Nd(t.context,e))),Uc=l(2,(e,t)=>re(r=>{let n=r.context,o=t(n);return n===o||(r.setContext(o),$c(r,()=>{r.setContext(n)})),e})),hs=l(3,(e,t,r)=>Uc(e,n=>{let o=_o(n,t),s=r(o);return o===s?n:Jt(n,t,s)})),ev=(e,t,r)=>ii(re(n=>{let o=_o(n.context,e),s=t(o);return n.setContext(Jt(n.context,e,s)),ta(_o(n.context,ea),a=>{let i=Nd(n.context,e);if(fe(i))return pe;let c=i.value,u;if(r?.reset===void 0){if(c!==s)return pe;u=o}else u=r.reset(o,s,c);return n.setContext(Jt(n.context,e,u)),pe})})),yS=()=>wz,wz=re(e=>D(e.context)),Xs=e=>re(t=>e(t.context)),tv=l(2,(e,t)=>Uc(e,je(t))),rn=l(2,(e,t)=>Ne(e)?e:Uc(e,Ud(t))),kr=function(){return arguments.length===1?l(2,(e,t)=>ek(e,arguments[0],t)):l(3,(e,t,r)=>ek(e,t,r)).apply(this,arguments)},ek=(e,t,r)=>Uc(e,Jt(t,r)),gm=l(3,(e,t,r)=>V(r,n=>kr(e,t,n))),rv=l(e=>ie(e[1]),(e,t,r)=>SS(e,t,(n,o)=>[n,o],r)),SS=l(e=>ie(e[1]),(e,t,r,n)=>n?.concurrent?ke(ll([e,t],{concurrency:2}),([o,s])=>r(o,s)):V(e,o=>ke(t,s=>r(o,s)))),nv=l(e=>ie(e[0]),(e,t,r)=>BS(e,t,r?n=>Qe(r(n)):()=>Qe(new Bn))),ov=l(2,(e,t)=>V(t,r=>r?Fc(e):oi)),bS=l(2,(e,t)=>Array.from({length:t},()=>e)),sv=l(e=>ie(e[0]),(e,t,r)=>ll(bS(e,t),r)),ym=l(e=>ie(e[0]),(e,t)=>No({while:Sr,body:je(t?.disableYield?e:V(e,r=>Mc)),step:$n})),nn=l(2,(e,t)=>new av(e,t.length!==1?r=>t(r):t)),Cz=Xr({op:\"OnFailure\",[Ke]:hm}),av=function(e,t){this[ue]=e,this[Qr]=t};av.prototype=Cz;var ES=l(3,(e,t,r)=>nn(e,n=>t(n)?r(n):De(n))),xs=l(3,(e,t,r)=>nn(e,n=>{let o=t(n);return ce(o)?De(o.failure):r(o.success,n)})),gs=l(2,(e,t)=>xs(e,Ur,r=>t(r))),iv=e=>Dc(e,{onFailure:t=>gd(t)?oi:Qe(t),onSuccess:rS}),cv=l(2,(e,t)=>xs(e,tl,t)),uv=l(2,(e,t)=>nn(e,r=>Fo(t(r),De(r)))),fv=l(3,(e,t,r)=>ES(e,t,n=>Fo(r(n),De(n)))),Sm=l(3,(e,t,r)=>nn(e,n=>{let o=t(n);return ce(o)?De(n):Fo(r(o.success,n),De(n))})),IS=l(2,(e,t)=>Sm(e,Ur,r=>t(r))),lv=l(3,(e,t,r)=>{let n=Array.isArray(t)?o=>k(o,\"_tag\")&&t.includes(o._tag):At(t);return IS(e,o=>n(o)?r(o):pe)}),pv=l(2,(e,t)=>Sm(e,tl,r=>t(r))),sl=l(e=>ie(e[0]),(e,t,r,n)=>nn(e,o=>{let s=Ur(o);return ce(s)?De(s.failure):t(s.success)?r(s.success):n?n(s.success):De(o)})),bm=l(e=>ie(e[0]),(e,t,r,n)=>nn(e,o=>{let s=Ur(o);if(ce(s))return De(s.failure);let a=t(s.success);return ce(a)?n?n(a.failure):De(o):r(a.success)})),TS=l(e=>ie(e[0]),(e,t,r,n)=>{let o=Array.isArray(t)?s=>k(s,\"_tag\")&&t.includes(s._tag):At(t);return sl(e,o,r,n)}),dv=l(e=>ie(e[0]),(e,t,r)=>{let n;return bm(e,o=>(n??=Object.keys(t),k(o,\"_tag\")&&br(o._tag)&&n.includes(o._tag)?B(o):W(o)),o=>t[o._tag](o),r)}),mv=l(e=>ie(e[0]),(e,t,r,n,o)=>sl(e,s=>At(s,t)&&k(s,\"reason\")&&(o!==void 0||At(s.reason,r)),s=>{let a=s.reason;return At(a,r)?n(a,s):o?o(a,s):Qe(s)})),hv=l(e=>ie(e[0]),(e,t,r,n)=>{let o;return sl(e,s=>At(s,t)&&k(s,\"reason\")&&k(s.reason,\"_tag\")&&br(s.reason._tag)&&(n!==void 0||(o??=Object.keys(r)).includes(s.reason._tag)),s=>{let a=s.reason;return o??=Object.keys(r),o.includes(a._tag)?r[a._tag](a,s):n?n(a,s):Qe(s)})}),xv=l(2,(e,t)=>bm(e,r=>At(r,t)&&k(r,\"reason\")?B(r.reason):W(r),Qe)),wS=l(2,(e,t)=>gs(e,r=>dm(()=>t(r)))),CS=l(2,(e,t)=>Dc(e,{onFailure:r=>dm(()=>t.onFailure(r)),onSuccess:r=>z(()=>t.onSuccess(r))})),AS=e=>gs(e,Ys),gv=l(2,(e,t)=>gs(e,r=>z(()=>t(r)))),yv=e=>ne(()=>{let t=e[Symbol.iterator](),r=t.next();if(r.done)return Ys(new Error(\"Received an empty collection of effects\"));function n(o){let s=t.next();return s.done?o.value:gs(o.value,a=>n(s))}return n(r)}),kS=e=>gs(e,t=>V(Mc,()=>kS(e))),Sv=l(e=>ie(e[0]),(e,t)=>{if(!t?.log)return Dc(e,{onFailure:n=>pe,onSuccess:n=>pe});let r=Jn(t.log===!0?void 0:t.log);return Mo(e,{onFailure(n){let o=Vy(n);return ce(o)?De(o.failure):t.message===void 0?r(n):r(t.message,n)},onSuccess:n=>pe})}),Em=l(e=>ie(e[0]),(e,t)=>{if(!t?.log)return Mo(e,{onFailure:n=>pe,onSuccess:n=>pe});let r=Jn(t.log===!0?void 0:t.log);return Mo(e,{onFailure:n=>t.message===void 0?r(n):r(t.message,n),onSuccess:n=>pe})}),bv=e=>Im(e,{onFailure:v,onSuccess:O}),Vs=e=>al(e,{onFailure:W,onSuccess:B}),Mo=l(2,(e,t)=>new Ev(e,t.onSuccess.length!==1?r=>t.onSuccess(r):t.onSuccess,t.onFailure.length!==1?r=>t.onFailure(r):t.onFailure)),Az=Xr({op:\"OnSuccessAndFailure\",[Ke]:hm}),Ev=function(e,t,r){this[ue]=e,this[_t]=t,this[Qr]=r};Ev.prototype=Az;var kz=function(e,t){let r=this.payload;return t.succeedWith(xm?r.onSuccess(e):js(()=>r.onSuccess(e)))},Iv=(e,t)=>{let r=Xr({op:e,[Ke]:hm,[_t]:kz,[Qr]:t}),n=function(o,s){this[ue]=o,this.payload=s};return n.prototype=r,n},vz=Iv(\"Match\",function(e,t){let r=e.reasons.find(jn);if(r===void 0)return De(e);let n=this.payload;return t.succeedWith(xm?n.onFailure(r.error):js(()=>n.onFailure(r.error)))}),Oz=Iv(\"MatchCause\",function(e,t){let r=this.payload;return t.succeedWith(xm?r.onFailure(e):js(()=>r.onFailure(e)))}),vS=l(2,(e,t)=>new Oz(e,t)),Dc=l(2,(e,t)=>Mo(e,{onFailure:r=>{let n=r.reasons.find(jn);return n?t.onFailure(n.error):De(r)},onSuccess:t.onSuccess})),Im=l(2,(e,t)=>new vz(e,t)),al=l(2,(e,t)=>{if(Ne(e)){if(e._tag===\"Success\")return Ae(t.onSuccess(e.value));let r=Ur(e.cause);return ce(r)?e:Ae(t.onFailure(r.success))}return Im(e,t)}),Tv=l(2,(e,t)=>Ne(e)?e._tag===\"Success\"?Ae(t.onSuccess(e.value)):Ae(t.onFailure(e.cause)):vS(e,t)),il=e=>Ne(e)?Ae(e):_z(e),_z=En({op:\"Exit\",[Ke](e){return e._stack.push(this),this[ue]},[_t](e,t,r){return t.succeedWith(r??Ae(e))},[Qr](e,t,r){return t.succeedWith(r??Ht(e))}}),wv=al({onFailure:()=>!0,onSuccess:()=>!1}),Cv=al({onFailure:()=>!1,onSuccess:()=>!0}),Av=l(2,(e,t)=>Fo(Bc(t),e)),OS=l(2,(e,t)=>V(_S(e,t.duration),r=>fe(r)?t.orElse():D(r.value))),Rz=e=>new Vf(`Operation timed out after '${Ty(e)}'`),kv=l(2,(e,t)=>{let r=Ge(t);return OS(e,{duration:r,orElse:()=>Qe(Rz(r))})}),_S=l(2,(e,t)=>fS(Fc(e),Ar(Bc(t),v()))),vv=e=>Wn(t=>{let r=t.monotonicTimeNanosUnsafe();return ke(e,n=>[Ro(t.monotonicTimeNanosUnsafe()-r),n])}),zy=\"~effect/Scope\",qy=\"~effect/Scope/Closeable\",ea=lr(\"effect/Scope\"),RS=(e,t)=>re(r=>(Nz(r),Tm(e,t)??pe)),Tm=(e,t)=>{let r=e.state;if(r._tag===\"Closed\"||(e.state={_tag:\"Closed\",exit:t},e.parent!==void 0&&tm(e.parent,e),r._tag===\"Empty\"))return;if(r.finalizer!==void 0)return em(r.finalizer,t);let n=r.finalizers;return n.size===1?em(n.values().next().value,t):Pz(e,n,t)},em=(e,t)=>{try{return e(t)}catch(r){return Er(r)}},Ov=(e,t)=>Qs(e)?t:nn(t,r=>De(za(e.cause,r))),Pz=sS(function*(e,t,r){let n=[],o=[],s=Array.from(t.values()),a=ds();for(let i=s.length-1;i>=0;i--){let c=s[i];e.strategy===\"sequential\"?n.push(yield*il(em(c,r))):o.push(ra(a,em(c,r),!0,!0,\"inherit\"))}return o.length>0&&(n=yield*pm(o)),yield*gS(n)});var _v=(e,t)=>{let r=Pv(t,e);return e.state._tag===\"Closed\"?(r.state=e.state,r):(Lc(e,r,n=>RS(r,n)),r)},ta=(e,t)=>ne(()=>e.state._tag===\"Closed\"?t(e.state.exit):(Lc(e,{},t),pe)),Rv=(e,t)=>ta(e,je(t)),Lc=(e,t,r)=>{if(e.state._tag===\"Empty\")e.state={_tag:\"Open\",finalizerKey:t,finalizer:r,finalizers:void 0};else if(e.state._tag===\"Open\"){let n=e.state;n.finalizer!==void 0&&(n.finalizers=new Map([[n.finalizerKey,n.finalizer]]),n.finalizerKey=void 0,n.finalizer=void 0),n.finalizers.set(t,r)}},tm=(e,t)=>{if(e.state._tag!==\"Open\")return;let r=e.state;r.finalizerKey===t?e.state=Hy:r.finalizers!==void 0&&(r.finalizers.delete(t),r.finalizers.size===0&&(e.state=Hy))},wm=e=>Pv(e,void 0),Pv=(e=\"sequential\",t)=>({[qy]:qy,[zy]:zy,strategy:e,parent:t,state:Hy}),Hy={_tag:\"Empty\"};var cl=ea,Mv=kr(ea),PS=e=>re(t=>{let r=t.context,n=wm();return t.setContext(Jt(t.context,ea,n)),$c(t,o=>(t.setContext(r),Tm(n,o))),e});var Cm=e=>ne(()=>{let t=wm();return on(e(t),r=>ne(()=>Tm(t,r)??pe))}),ai=(e,t,r)=>Xs(n=>Hn(o=>V(cl,s=>si(r?.interruptible?o(e):e,a=>ta(s,i=>rn(t(a,i),n)))))),MS=e=>V(cl,t=>Xs(r=>ta(t,n=>rn(e(n),r)))),Fv=(function(){let e=Xr({op:\"OnExit\",[Ke](r){return r._stack.push(this),this.effect},[La](r){r.interruptible&&this.interruptible!==!0&&(r._stack.push(fl),r.interruptible=!1)},[_t](r,n,o){o??=Ae(r);let s;try{s=this.onExit(o)}catch(a){s=Er(a)}return s?V(s,a=>o):o},[Qr](r,n,o){o??=Ht(r);let s;try{s=this.onExit(o)}catch(a){s=Er(a)}return s?V(Ov(o,s),a=>o):o}}),t=function(r,n,o){this.effect=r,this.onExit=n,this.interruptible=o};return t.prototype=e,t})(),qn=(e,t,r)=>new Fv(e,t,r),$c=(e,t)=>{e._stack.push(new Fv(void 0,t,void 0))},on=l(2,qn),Nv=l(2,(e,t)=>on(e,r=>t)),FS=l(3,(e,t,r)=>on(e,n=>t(n)?r(n):pe)),NS=l(3,(e,t,r)=>on(e,n=>{let o=t(n);return ce(o)?pe:r(o.success,n)})),US=l(2,(e,t)=>NS(e,ol,t)),Uv=l(3,(e,t,r)=>FS(e,n=>n._tag!==\"Failure\"?!1:t(n.cause),n=>r(n.cause))),DS=l(3,(e,t,r)=>on(e,n=>{if(n._tag!==\"Failure\")return pe;let o=t(n.cause);return ce(o)?pe:r(o.success,n.cause)})),Dv=l(2,(e,t)=>DS(im,t)(e)),ul=(e,t,r)=>Hn(n=>V(e,o=>qn(ne(()=>n(t(o))),s=>r(o,s),!0))),Lv=e=>ai(e,t=>k(t,Symbol.asyncDispose)?nS(()=>t[Symbol.asyncDispose]()):z(()=>t[Symbol.dispose]())),LS=l(2,(e,t)=>z(()=>$v(e,typeof t==\"function\"?r=>Cr(Ge(t(r))):je(Cr(Ge(t)))))),Mz=je(1/0),$v=(e,t)=>{let r=0,n,o,s=(a,i)=>(i.awaiters++,$c(a,()=>{if(!(--i.awaiters>0||o!==i))return o=void 0,rl(i.fiber)}),Xy(i.fiber));return[re(a=>{if(o!==void 0)return s(a,o);if(n!==void 0&&(r===1/0||a.getRef(Nr).currentTimeMillisUnsafe(){if(o!==c||(o=void 0,dS(u)))return;let f=t(u);r=f===1/0?1/0:i.currentTimeMillisUnsafe()+f,n=u}),!0,!0),c.fiber._exit??s(a,c)}),z(()=>{n=void 0})]},Bv=l(2,(e,t)=>ke(LS(e,t),r=>r[0])),jv=e=>z(()=>$v(e,Mz)[0]),zv=re(e=>De(Zs(e.id))),ii=e=>re(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(fl)),e)),qv=En({op:\"SetInterruptible\",[La](e){if(e.interruptible=this[ue],e._interruptedCause&&e.interruptible)return()=>De(e._interruptedCause)}}),fl=qv(!0),Fz=qv(!1),Hv=e=>{if(e.interruptible=!0,e._stack.push(Fz),e._interruptedCause)return De(e._interruptedCause)},Nz=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(fl))};var Am=e=>re(t=>t.interruptible?e:Hv(t)??e),Hn=e=>re(t=>t.interruptible?(t.interruptible=!1,t._stack.push(fl),e(Am)):e(R)),Wv=e=>re(t=>{if(t.interruptible)return e(R);let r=Hv(t),n=e(ii);return r??n}),Jv=ke(ai(z(()=>new AbortController),e=>z(()=>e.abort())),e=>e.signal),ll=(e,t)=>as(e)?t?.mode===\"result\"?tn(e,Vs,t):tn(e,R,t):t?.discard?t.mode===\"result\"?tn(Object.values(e),Vs,t):tn(Object.values(e),R,t):ne(()=>{let r={};return Ar(tn(Object.entries(e),([n,o])=>ke(t?.mode===\"result\"?Vs(o):o,s=>{M(r,n,s)}),{discard:!0,concurrency:t?.concurrency}),r)}),$S=l(e=>as(e[0])&&!ie(e[0]),(e,t,r)=>ke(tn(e,(n,o)=>Vs(t(n,o)),r),n=>Sy(n,R))),Kv=l(3,(e,t,r)=>{let n=Ye(e);return n.length===0?z(t):ne(()=>{let o=0,s=t();return ke(No({while:()=>or(s,n[o],o),step(a){s=a,o++}}),()=>s)})}),Gv=l(e=>as(e[0])&&!ie(e[0]),(e,t,r)=>V($S(e,t,{concurrency:r?.concurrency}),([n,o])=>or(o)?Qe(o):r?.discard?pe:D(n))),Vv=l(e=>as(e[0])&&!ie(e[0]),(e,t)=>ne(()=>{let r=e[Symbol.iterator](),n=r.next();return n.done?D(v()):Zv(r,0,t,n.value)})),Zv=(e,t,r,n)=>V(r(n,t),o=>{if(o)return D(O(n));let s=e.next();return s.done?D(v()):Zv(e,t+1,r,s.value)}),Yv=l(e=>as(e[0])&&!ie(e[0]),(e,t)=>ne(()=>{let r=e[Symbol.iterator](),n=r.next();return n.done?D(v()):Qv(r,0,t,n.value)})),Qv=(e,t,r,n)=>V(r(n,t),o=>{if(mt(o))return D(O(o.success));let s=e.next();return s.done?D(v()):Qv(e,t+1,r,s.value)}),No=En({op:\"While\",[_t](e,t){return this[ue].step(e),this[ue].while()?(t._stack.push(this),this[ue].body()):pr},[Ke](e){return this[ue].while()?(e._stack.push(this),this[ue].body()):pr}}),tn=l(e=>typeof e[1]==\"function\",(e,t,r)=>ne(()=>{let n=pl(r?.concurrency);if(n===1)return Uz(e,t,r);let o=Ye(e),s=o.length;if(s===0)return r?.discard?pe:D([]);let a=r?.discard?void 0:new Array(s),i=Dz({f:t,out:a},o,{concurrency:n});return i?Ar(i,a):D(a)})),Xv=e=>V(e,t=>{let r=t[Symbol.iterator]().next();return r.done?Qe(new Bn):D(r.value)}),Uz=(e,t,r)=>ne(()=>{let n=r?.discard?void 0:[],o=e[Symbol.iterator](),s=o.next(),a=0;return Ar(No({while:()=>!s.done,body:()=>t(s.value,a++),step:i=>{n&&n.push(i),s=o.next()}}),n)}),pl=e=>e===\"unbounded\"?Number.POSITIVE_INFINITY:Math.max(1,e??1),km=()=>e=>{let t=e.onItem,r=e.step,n=(s,a,i,c,u)=>V(il(u),f=>r(s,a[i],f,i)??o(s,a,i+1,c)??pe),o=(s,a,i=0,c=a.length)=>{for(;i{let t=e.onItem,r=e.step;return(n,o,s)=>{let a=0,i=s.end??o.length,c=s.concurrency,u=!1,f,p,d,m,x,y=w=>{let E=Er(w);return m=E,u=!0,p&&p.size>0?V(ii(Oc(Array.from(p))),()=>m??E):E},S=()=>{let w=!1;for(;!m&&a{p.delete(_);try{if(m){if(b._tag===\"Failure\"){let T=b.cause.reasons.filter(C=>C._tag!==\"Interrupt\");if(T.length>0){let C=cs(T);m=Ht(m._tag===\"Failure\"?za(m.cause,C):C)}}}else{let T=r(n,E,b,h);T&&(m=T,S())}if(w){let T=S();T&&d(T)}else u&&p.size===0&&d(m??pe)}catch(T){d(y(T))}}),p.size{f=ds(),p=new Set,x=U,d=_;let h;try{h=S()}catch(b){return _(y(b))}return h?_(h):ne(()=>(m??=pr,V(p?Oc(p):pe,()=>m?._tag===\"Failure\"?m:pe)))})}if(u=!0,m){if(p&&p.size>0){let E=lm(f);p.forEach(U=>U.interruptUnsafe(f.id,E));return}if(d||m._tag===\"Failure\")return m}else if(d)if(p)p.size===0&&d(pe);else return pr};return S()}},vm=()=>e=>eO(e),Dz=eO({onItem(e,t,r){return e.f(t,r)},step(e,t,r,n){if(r._tag===\"Failure\")return r;e.out&&(e.out[n]=r.value)}}),BS=l(3,(e,t,r)=>V(e,n=>t(n)?D(n):r(n))),jS=l(3,(e,t,r)=>V(e,n=>{let o=t(n);return ce(o)?r(o.failure):D(o.success)})),tO=l(e=>ie(e[0]),(e,t,r)=>jS(e,t,r?n=>Qe(r(n)):()=>Qe(new Bn))),rO=l(e=>as(e[0])&&!ie(e[0]),(e,t,r)=>ne(()=>{let n=[];return Ar(tn(e,(o,s)=>{let a=t(o,s);return typeof a==\"boolean\"?(a&&n.push(o),pe):ke(a,i=>{i&&n.push(o)})},{discard:!0,concurrency:r?.concurrency}),n)})),nO=l(e=>as(e[0])&&!ie(e[0]),(e,t)=>ne(()=>{let r=[];for(let n of e){let o=t(n);mt(o)&&r.push(o.success)}return D(r)})),oO=l(e=>as(e[0])&&!ie(e[0]),(e,t,r)=>ne(()=>{let n=[];return Ar(tn(e,o=>ke(t(o),s=>{mt(s)&&n.push(s.success)}),{discard:!0,concurrency:r?.concurrency}),n)})),sO=D({}),aO=Ed(ke),iO=Id(ke,V),cO=bd(ke);var uO=l(e=>ie(e[0]),(e,t)=>re(r=>(Qz(),D(ra(r,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),ra=(e,t,r=!1,n=!1,o=!1)=>{let s=e,a=o===\"inherit\"?s.interruptible:!o,i=new Xd(s.context,a);return n||(s.children().add(i),i._parent=s),r?i.evaluate(t):(i._asyncContext=mk(),s.currentDispatcher.scheduleTask(()=>i.evaluate(t),0)),i},fO=l(e=>ie(e[0]),(e,t)=>re(r=>D(ra(r,e,t?.startImmediately,!0,t?.uninterruptible)))),lO=e=>re(t=>{let r=t._children&&new Set(t._children),n=t.interruptible;return qn(e,o=>{let s=t._children;if(s===void 0||s.size===0)return pe;r&&(s=dA(s,i=>!r.has(i)));let a=nl(pm(s));return n?Am(a):a})}),zS=l(e=>ie(e[0]),(e,t,r)=>re(n=>{let o=ra(n,e,r?.startImmediately,!0,r?.uninterruptible);if(!o._exit)if(t.state._tag!==\"Closed\"){let s={};Lc(t,s,()=>Ik(i=>i===o.id?pe:rl(o))),o.addObserver(()=>tm(t,s))}else o.interruptUnsafe(n.id,lm(n));return D(o)})),pO=l(e=>ie(e[0]),(e,t)=>V(cl,r=>zS(e,r,t))),ys=e=>(t,r)=>{let n=new Xd(r?.scheduler?Jt(e,zf,r.scheduler):e,r?.uninterruptible!==!0);if(n.evaluate(t),n._exit)return n;if(r?.signal)if(r.signal.aborted)n.interruptUnsafe();else{let o=()=>n.interruptUnsafe();r.signal.addEventListener(\"abort\",o,{once:!0}),n.addObserver(()=>r.signal.removeEventListener(\"abort\",o))}return r?.onFiberStart&&r.onFiberStart(n),n},dO=l(2,(e,t)=>e._exit?e:t.state._tag===\"Closed\"?(e.interruptUnsafe(e.id),e):(tm(t,e),Lc(t,e,()=>rl(e)),e.addObserver(()=>tm(t,e)),e)),mO=ys(Ir()),qS=e=>{let t=ys(e);return(r,n)=>{let o=t(r,n);return n?.onExit&&o.addObserver(n.onExit),s=>o.interruptUnsafe(s)}},hO=qS(Ir()),Om=e=>{let t=ys(e);return(r,n)=>{let o=t(r,n);return new Promise(s=>{o.addObserver(a=>s(a))})}},xO=Om(Ir()),HS=e=>{let t=Om(e);return(r,n)=>t(r,n).then(o=>{if(o._tag===\"Failure\")throw um(o.cause);return o.value})},gO=HS(Ir()),_m=e=>{let t=ys(e);return r=>{if(Ne(r))return r;let n=new Qa(\"sync\"),o=t(r,{scheduler:n});return o._dispatcher?.flush(),o._exit??Er(new Xf(o))}},yO=_m(Ir()),WS=e=>{let t=_m(e);return r=>{let n=t(r);if(n._tag===\"Failure\")throw um(n.cause);return n.value}},SO=WS(Ir()),tk=D(!0),rk=D(!1),Wy=class{waiters=[];scheduled=void 0;_isOpen;constructor(t){this._isOpen=t}scheduleUnsafe(t){if(this.waiters.length===0)return tk;if(this.scheduled===void 0)this.scheduled=this.waiters,t.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let r=0;r{if(this.scheduled===void 0)return;let t=this.scheduled;this.scheduled=void 0;for(let r=0;rthis._isOpen?rk:(this._isOpen=!0,this.scheduleUnsafe(t)));release=re(t=>this._isOpen?rk:this.scheduleUnsafe(t));openUnsafe(){return this._isOpen?!1:(this._isOpen=!0,this.flushWaiters(),!0)}await=ht(t=>this._isOpen?t(pe):(this.waiters.push(t),z(()=>{let r=this.waiters.indexOf(t);r!==-1?this.waiters.splice(r,1):this.scheduled!==void 0&&(r=this.scheduled.indexOf(t),r!==-1&&this.scheduled.splice(r,1))})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=z(()=>this.closeUnsafe());whenOpen=t=>V(this.await,()=>t);isOpen(){return this._isOpen}},JS=e=>new Wy(e??!1),bO=e=>z(()=>JS(e)),EO=re(e=>D(e.getRef(My))),IO=l(2,(e,t)=>kr(e,My,t)),TO=kr(Zd),wO=kr(ti),rm=BigInt(0),Lz={_tag:\"Span\",spanId:\"noop\",traceId:\"noop\",sampled:!1,status:{_tag:\"Ended\",startTime:rm,endTime:rm,exit:pr},attributes:new Map,links:[],kind:\"internal\",attribute(){},event(){},end(){},addLinks(){}},$z=e=>Object.assign(Object.create(Lz),e),CO=e=>e?Fe(e.annotations,Vd)?e._tag===\"Span\"?CO(qs(e.parent)):v():O(e):v(),KS=(e,t,r)=>{let n=!e.cache.tracerEnabled||r?.annotations&&Fe(r.annotations,Vd),o=r?.parent!==void 0?O(r.parent):r?.root?v():CO(e.cache.span),s;if(n)s=$z({name:t,parent:o,annotations:Jt(r?.annotations??Ir(),Vd,!0)});else{let a=e.cache.tracer??Fy,i=e.getRef(Nr),c=e.getRef(ti),u=e.getRef(Hf),f=e.getRef(Wf),p=r?.level??e.getRef(WA),d=r?.links!==void 0?[...f,...r.links]:f.length===0?[]:f.slice();s=a.span({name:t,parent:o,annotations:r?.annotations??Ir(),links:d,startTime:c?i.currentTimeNanosUnsafe():rm,kind:r?.kind??\"internal\",root:r?.root??!1,sampled:r?.sampled??(be(o)&&o.value.sampled===!1?!1:!qO(e.getRef(JA),p))});for(let m in u)s.attribute(m,u[m]);if(r?.attributes!==void 0)for(let m in r.attributes)s.attribute(m,r.attributes[m])}return s},AO=(e,t)=>re(r=>D(KS(r,e,t))),Jf=(e,t)=>ii(re(r=>{let n=_o(r.context,ea),o=KS(r,e,t??{}),s=r.getRef(Nr),a=r.getRef(ti);return Ar(ta(n,i=>Rm(o,i,s,a)),o)})),kO=function(){let e=typeof arguments[0]!=\"string\",t=e?arguments[1]:arguments[0],r=Gs(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return V(Jf(t,r),o=>_c(n,o,r))}return n=>V(Jf(t,r),o=>_c(n,o,r))},Bz=(e,t)=>(t=typeof t==\"function\"?t:bn,hs(qf,r=>({name:e,stack:t,parent:r}))),vO=Hf,OO=Wf,_O=l(e=>ie(e[0]),(e,t,r={})=>{let o=(Array.isArray(t)?t:[t]).map(s=>({span:s,attributes:r}));return hs(e,Wf,s=>[...s,...o])}),Rm=(e,t,r,n)=>z(()=>{e.status._tag!==\"Ended\"&&e.end(n?r.currentTimeNanosUnsafe():rm,t)}),Kf=(e,...t)=>{let r=t.length===1?void 0:t[0],n=t[t.length-1];return re(o=>{let s=KS(o,e,r),a=o.getRef(Nr),i=o.getRef(ti);return $c(o,c=>Rm(s,c,a,i)),n(s)})},Jy=kr(ei),_c=function(){let e=ie(arguments[0]),t=e?arguments[1]:arguments[0],r=e?arguments[2]:arguments[1],n=R;return t._tag===\"Span\"&&(r=Gs(r),n=Bz(t.name,r?.captureStackTrace)),e?Jy(n(arguments[0]),t):o=>Jy(n(o),t)},RO=function(){let e=typeof arguments[0]!=\"string\",t=e?arguments[1]:arguments[0],r=Gs(arguments[2]);if(e){let s=arguments[0];return Kf(t,arguments[2],a=>_c(s,a,r))}let n=typeof arguments[1]==\"function\"?arguments[1]:void 0,o=n?void 0:arguments[1];return(s,...a)=>Kf(t,n?n(...a):o,i=>_c(s,i,r))},PO=l(e=>ie(e[0]),(e,...t)=>hs(e,Hf,r=>{let n=t.length===1?{...r,...t[0]}:{...r};return t.length===1||M(n,t[0],t[1]),n})),MO=(...e)=>re(t=>{let r=t.currentSpanLocal;if(r)if(e.length===1)for(let[n,o]of Object.entries(e[0]))r.attribute(n,o);else r.attribute(e[0],e[1]);return pe}),FO=re(e=>{let t=e.currentSpanLocal;return t?D(t):Qe(new Bn)}),NO=Tz(ei),Nr=we(\"effect/Clock\",{defaultValue:()=>new Ky}),Ly=2**31-1,Ky=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=z(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return jz()}currentTimeNanos=z(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return DO()}monotonicTimeNanos=z(()=>this.monotonicTimeNanosUnsafe());sleep(t){return this.sleepMillis(Cr(t))}sleepMillis(t){return t<=0?Mc:Number.isFinite(t)?ht(r=>{let n=t>Ly?this.sleepMillis(t-Ly):pe,o=setTimeout(()=>r(n),Math.min(t,Ly));return z(()=>clearTimeout(o))}):mm}},UO=BigInt(1e6),DO=(function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==\"function\")return()=>e.bigint();if(typeof performance<\"u\"&&typeof performance.now==\"function\")return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let r=BigInt(Date.now())*UO;return r>t&&(t=r),t}})(),jz=(function(){let e=BigInt(1e9),t;return()=>{let r=DO(),n=BigInt(Date.now())*UO;if(t===void 0)t=n-r;else{let o=t+r;(n>o?n-o:o-n)>e&&(t=n-r)}return t+r}})(),Wn=e=>re(t=>e(t.getRef(Nr))),Bc=e=>Wn(t=>t.sleep(Ge(e))),GS=Wn(e=>e.currentTimeMillis);var Gf=\"~effect/Cause/TimeoutError\",LO=e=>k(e,Gf),Vf=class extends us(\"TimeoutError\"){[Gf]=Gf;constructor(t){super({message:t})}},Zf=\"~effect/Cause/IllegalArgumentError\",$O=e=>k(e,Zf),nm=class extends us(\"IllegalArgumentError\"){[Zf]=Zf;constructor(t){super({message:t})}},Yf=\"~effect/Cause/ExceededCapacityError\",BO=e=>k(e,Yf),om=class extends us(\"ExceededCapacityError\"){[Yf]=Yf;constructor(t){super({message:t})}},Qf=\"~effect/Cause/AsyncFiberError\",jO=e=>k(e,Qf),Xf=class extends us(\"AsyncFiberError\"){[Qf]=Qf;constructor(t){super({message:\"An asynchronous Effect was executed with Effect.runSync\",fiber:t})}},el=\"~effect/Cause/UnknownError\",zO=e=>k(e,el),Rc=class extends us(\"UnknownError\"){[el]=el;constructor(t,r){super({message:r,cause:t})}},VS=we(\"effect/Console\",{defaultValue:()=>globalThis.console}),zz=e=>{switch(e){case\"All\":return Number.MIN_SAFE_INTEGER;case\"Fatal\":return 5e4;case\"Error\":return 4e4;case\"Warn\":return 3e4;case\"Info\":return 2e4;case\"Debug\":return 1e4;case\"Trace\":return 0;case\"None\":return Number.MAX_SAFE_INTEGER}},qz=ay(fs,zz),qO=Tc(qz),ZS=we(\"effect/Logger/CurrentLoggers\",{defaultValue:()=>new Set([Zz,Yz])}),Hz=we(\"effect/Logger/LogToStderr\",{defaultValue:yf}),HO=function(){let e=typeof arguments[0]==\"string\"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return ii(re(t=>{let r=t.getRef(ps),n={...r};for(let o=0;o{let s=t.getRef(ps),a={...s};for(let i=0;i{let t=Object.create(Jz);return t.log=e,t},Kz=e=>e.replace(/[\\s=\"]/g,\"_\"),Gz=(e,t)=>`${Kz(e[0])}=${t-e[1]}ms`;var Jn=e=>(...t)=>{let r;for(let n=0,o=t.length;n{let o=e??n.cache.logLevel;if(qO(n.cache.minimumLogLevel,o))return pe;let s=n.getRef(Nr),a=n.getRef(ZS);if(a.size>0){let i=new Date(s.currentTimeMillisUnsafe());for(let c of a)c.log({cause:r,fiber:n,date:i,logLevel:o,message:t})}return pe})};var ri={bold:\"1\",red:\"31\",green:\"32\",yellow:\"33\",blue:\"34\",cyan:\"36\",white:\"37\",gray:\"90\",black:\"30\",bgBrightRed:\"101\"},kre={None:[],All:[],Trace:[ri.gray],Debug:[ri.blue],Info:[ri.green],Warn:[ri.yellow],Error:[ri.red],Fatal:[ri.bgBrightRed,ri.black]};var Vz=e=>`${e.getHours().toString().padStart(2,\"0\")}:${e.getMinutes().toString().padStart(2,\"0\")}:${e.getSeconds().toString().padStart(2,\"0\")}.${e.getMilliseconds().toString().padStart(3,\"0\")}`;var Zz=WO(({cause:e,date:t,fiber:r,logLevel:n,message:o})=>{let s=Array.isArray(o)?o.slice():[o];e.reasons.length>0&&s.push(fm(e));let a=t.getTime(),i=r.getRef(Yd),c=\"\";for(let d of i)c+=` ${Gz(d,a)}`;let u=r.getRef(ps);Object.keys(u).length>0&&s.push(u);let f=r.getRef(VS);(r.getRef(Hz)?f.error:f.log)(`[${Vz(t)}] ${n.toUpperCase()} (#${r.id})${c}:`,...s)}),Yz=WO(({cause:e,fiber:t,logLevel:r,message:n})=>{let o=t.getRef(Nr),s=t.getRef(ps),a=t.cache.span;if(a===void 0||a._tag===\"ExternalSpan\")return;let i={};for(let[c,u]of Object.entries(s))M(i,c,u);i[\"effect.fiberId\"]=t.id,i[\"effect.logLevel\"]=r.toUpperCase(),e.reasons.length>0&&(i[\"effect.cause\"]=fm(e)),a.event(IC(Array.isArray(n)&&n.length===1?n[0]:n),o.currentTimeNanosUnsafe(),i)});function Qz(){jy.interruptChildren??=xz}var YS=D(void 0);var JO=l(e=>ie(e[0]),(e,t)=>US(e,r=>re(n=>(Xz(n,r,t?.defectsOnly),pe)))),Xz=(e,t,r)=>{let n=e.getRef(VA);if(n.size===0||r&&!sm(t))return;let o={cause:t,fiber:e,timestamp:e.getRef(Nr).currentTimeNanosUnsafe()};n.forEach(s=>s.report(o))};var eq=Cf,tq=mc,eb=xc,tb=CC,na=jn,rb=qa,rq=Ha,oa=cs,nq=hd,oq=gc,ci=Xg,sq=Zs,jc=e=>new $a(e),zc=e=>new Af(e),nb=nk,ob=cm,Ss=fk,aq=za,Pm=um,sb=Gy,iq=Vy,ab=Ur,ib=ok,cq=sm,uq=sk,dl=tl,fq=am,lq=ak,pq=ik,dq=im,mq=Zy,cb=fm,hq=gd,xq=kf,gq=Bn,qc=vC,yq=Ba,ub=Wa,Y=_C,Sq=Gf,bq=LO,Eq=Vf,Iq=Zf,Tq=$O,ml=nm,wq=BO,Cq=Yf,fb=om,Aq=Qf,kq=jO,vq=Xf,Oq=el,_q=zO,Rq=Rc,Pq=yc,Mm=ck,Mq=uk,QS=class extends lr()(\"effect/Cause/StackTrace\"){},XS=class extends lr()(\"effect/Cause/InterruptorStackTrace\"){};var N={};Eo(N,{Do:()=>XH,Transaction:()=>Vc,TypeId:()=>WH,abortSignal:()=>yJ,acquireDisposable:()=>iJ,acquireRelease:()=>gi,acquireUseRelease:()=>Y_,addFinalizer:()=>cJ,all:()=>Ym,andThen:()=>_r,annotateCurrentSpan:()=>OJ,annotateLogs:()=>aK,annotateLogsScoped:()=>iK,annotateSpans:()=>vJ,as:()=>Tt,asSome:()=>eh,asVoid:()=>ia,awaitAllChildren:()=>qJ,bind:()=>rW,bindTo:()=>eW,cached:()=>dJ,cachedInvalidateWithTTL:()=>hJ,cachedWithTTL:()=>mJ,callback:()=>Yc,catch:()=>ca,catchCause:()=>rt,catchCauseFilter:()=>EW,catchCauseIf:()=>bW,catchDefect:()=>Wb,catchEager:()=>ru,catchFilter:()=>yW,catchIf:()=>gW,catchNoSuchElement:()=>SW,catchReason:()=>mW,catchReasons:()=>hW,catchTag:()=>pW,catchTags:()=>dW,clockWith:()=>Si,context:()=>hi,contextWith:()=>Ml,currentParentSpan:()=>RJ,currentSpan:()=>_J,delay:()=>Jb,die:()=>an,effectify:()=>yK,ensuring:()=>yi,eventually:()=>kW,exit:()=>vn,fail:()=>P,failCause:()=>ze,failCauseSync:()=>Is,failSync:()=>Xm,fiber:()=>HJ,fiberId:()=>WJ,filter:()=>Gb,filterMap:()=>qW,filterMapEffect:()=>Vb,filterMapOrElse:()=>WW,filterMapOrFail:()=>KW,filterOrElse:()=>HW,filterOrFail:()=>JW,findFirst:()=>VH,findFirstFilter:()=>ZH,firstSuccessOf:()=>UW,flatMap:()=>I,flatMapEager:()=>st,flatten:()=>qb,flip:()=>fW,fn:()=>QJ,fnUntraced:()=>Se,fnUntracedEager:()=>oE,forEach:()=>sa,forever:()=>$t,forkChild:()=>eu,forkDetach:()=>zJ,forkIn:()=>Ut,forkScoped:()=>tu,fromNullishOr:()=>iW,fromOption:()=>sW,fromResult:()=>Pl,gen:()=>dr,head:()=>YH,ignore:()=>RW,ignoreCause:()=>PW,interrupt:()=>_n,interruptible:()=>xJ,interruptibleMask:()=>gJ,isEffect:()=>jo,isFailure:()=>XW,isSuccess:()=>eJ,let:()=>tW,linkSpans:()=>FJ,log:()=>XJ,logDebug:()=>nK,logError:()=>nE,logFatal:()=>eK,logInfo:()=>rK,logTrace:()=>oK,logWarning:()=>tK,logWithLevel:()=>ih,makeSpan:()=>eE,makeSpanScoped:()=>NJ,map:()=>j,mapBoth:()=>IW,mapBothEager:()=>Vt,mapEager:()=>Dr,mapError:()=>th,mapErrorEager:()=>Ul,match:()=>Zb,matchCause:()=>VW,matchCauseEager:()=>ZW,matchCauseEffect:()=>zo,matchCauseEffectEager:()=>YW,matchEager:()=>GW,matchEffect:()=>QW,never:()=>mi,onError:()=>Vn,onErrorFilter:()=>fJ,onErrorIf:()=>uJ,onExit:()=>un,onExitFilter:()=>pJ,onExitIf:()=>lJ,onExitPrimitive:()=>Fl,onInterrupt:()=>Xb,option:()=>uW,orDie:()=>TW,orElseSucceed:()=>NW,partition:()=>JH,promise:()=>Qm,provide:()=>tJ,provideContext:()=>On,provideService:()=>qo,provideServiceEffect:()=>aJ,race:()=>zW,raceAll:()=>Kb,raceAllFirst:()=>jW,raceFirst:()=>Xc,reduce:()=>KH,repeat:()=>SJ,repeatOrElse:()=>bJ,replicate:()=>EJ,replicateEffect:()=>IJ,request:()=>BJ,requestUnsafe:()=>jJ,result:()=>cW,retry:()=>vW,retryOrElse:()=>OW,runCallback:()=>KJ,runCallbackWith:()=>JJ,runFork:()=>Nl,runForkWith:()=>Rn,runPromise:()=>tE,runPromiseExit:()=>ah,runPromiseExitWith:()=>GJ,runPromiseWith:()=>rE,runSync:()=>VJ,runSyncExit:()=>Wo,runSyncExitWith:()=>YJ,runSyncWith:()=>ZJ,sandbox:()=>_W,satisfiesErrorType:()=>bK,satisfiesServicesType:()=>EK,satisfiesSuccessType:()=>SK,schedule:()=>TJ,scheduleFrom:()=>Q_,scope:()=>xi,scoped:()=>oh,scopedWith:()=>sh,service:()=>Yb,serviceOption:()=>Qb,setContext:()=>rJ,sleep:()=>ua,spanAnnotations:()=>PJ,spanLinks:()=>MJ,succeed:()=>g,succeedNone:()=>aa,succeedSome:()=>zb,suspend:()=>$,sync:()=>X,tap:()=>Rr,tapCause:()=>V_,tapCauseFilter:()=>AW,tapCauseIf:()=>CW,tapDefect:()=>Z_,tapError:()=>rh,tapErrorTag:()=>wW,timed:()=>BW,timeout:()=>DW,timeoutOption:()=>LW,timeoutOrElse:()=>$W,tracer:()=>wJ,track:()=>uK,trackDefects:()=>pK,trackDuration:()=>dK,trackErrors:()=>lK,trackSuccesses:()=>fK,transposeOption:()=>aW,try:()=>Qc,tryPromise:()=>Zc,tx:()=>mK,txRetry:()=>gK,undefined:()=>QH,uninterruptible:()=>Ts,uninterruptibleMask:()=>Ho,unwrapReason:()=>xW,updateContext:()=>nJ,updateService:()=>oJ,updateServiceScoped:()=>sJ,useSpan:()=>UJ,validate:()=>GH,void:()=>Q,when:()=>nh,whileLoop:()=>Gn,withErrorReporting:()=>FW,withExecutionPlan:()=>MW,withFiber:()=>cn,withFiberSucceed:()=>oW,withLogSpan:()=>cK,withLogger:()=>sK,withParentSpan:()=>$J,withSpan:()=>DJ,withSpanScoped:()=>LJ,withTracer:()=>CJ,withTracerEnabled:()=>AJ,withTracerTiming:()=>kJ,yieldNow:()=>Rl,yieldNowWith:()=>nW,zip:()=>Hb,zipWith:()=>lW});var ir={};Eo(ir,{asVoid:()=>Wq,asVoidAll:()=>hb,die:()=>lb,fail:()=>bs,failCause:()=>sn,filterCause:()=>$q,filterFailure:()=>Lq,filterSuccess:()=>Uq,filterValue:()=>Dq,findDefect:()=>jq,findError:()=>Bq,findErrorOption:()=>Gq,getCause:()=>Kq,getSuccess:()=>Jq,hasDies:()=>Nq,hasFails:()=>Fq,hasInterrupts:()=>db,interrupt:()=>pb,isExit:()=>hl,isFailure:()=>Uo,isSuccess:()=>Ve,map:()=>zq,mapBoth:()=>Hq,mapError:()=>qq,match:()=>mb,succeed:()=>vr,void:()=>xt});var hl=vf,vr=Ae,sn=Ht,bs=en,lb=Er,pb=Nc,xt=pr;var Ve=Qs,Uo=lS,Fq=Wk,Nq=Hk,db=dS,Uq=Bk,Dq=jk,Lq=zk,$q=ol,Bq=pS,jq=qk,mb=Kk,zq=mS,qq=hS,Hq=xS,Wq=Gk,hb=gS,Jq=Vk,Kq=Zk,Gq=Yk;var Vq=\"~effect/Deferred\";var Zq={[Vq]:{_A:R,_E:R},pipe(){return Z(this,arguments)}},KO=function(){this.resumes=void 0,this.effect=void 0};KO.prototype=Zq;var ui=()=>new KO;var Fm=e=>ht(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),z(()=>{let r=e.resumes;if(r===void 0)return;let n=r.indexOf(t);n>=0&&r.splice(n,1)})));var Yq=l(2,(e,t)=>z(()=>Do(e,t))),Qq=Yq;var Xq=l(2,(e,t)=>Qq(e,Ht(t)));var xb=l(2,(e,t)=>Xq(e,Zs(t)));var Do=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let r=e.resumes;e.resumes=void 0;for(let n=0;n{let r={observers:0,deferred:ui(),scope:kn(),finalizer:n=>ne(()=>--r.observers>0?pe:(e.map.delete(t),Le(r.scope,n)))};return r},QO=(e,t)=>t.state._tag===\"Closed\"?!1:(e.observers++,Lc(t,{},e.finalizer),!0),t_=e=>k(e,e_),rH={[e_]:{_ROut:R,_E:R,_RIn:R},pipe(){return Z(this,arguments)}},r_=e=>{let t=Object.create(rH);return t.build=e,t},gb=e=>r_((t,r)=>{let n=Nt(r);return on(e(t,n),o=>o._tag===\"Failure\"?Le(n,o):pe)}),nH=e=>{let t=gb((r,n)=>r.getOrElseMemoize(t,n,e));return t},Um=class{get[YO](){return YO}parent;constructor(t){this.parent=t}map=new Map;get(t,r){let n=this.map.get(t);return n?(QO(n,r),n.deferred.effect??Fm(n.deferred)):this.parent?.get(t,r)}getOrElseMemoize(t,r,n){return ne(()=>{let o;return qn(ne(()=>{let s=this.get(t,r);if(s)return s;let a=tH(this,t);return QO(a,r)?(o=a.deferred,this.map.set(t,a),n(this,a.scope)):n(this,r)}),s=>{o&&Do(o,s)})})}},gl=()=>new Um,oH=e=>new Um(e);var xl=class e extends lr()(\"effect/Layer/CurrentMemoMap\"){static forkOrCreate(t){let r=Fd(t,e);return r?oH(r):gl()}},yl=l(3,(e,t,r)=>kr(ke(ne(()=>e.build(t,r)),Jt(xl,t)),xl,t));var Lm=l(2,(e,t)=>re(r=>yl(e,xl.forkOrCreate(r.context),t))),n_=function(){return arguments.length===1?e=>Dm(Za(arguments[0],e)):Dm(Za(arguments[0],arguments[1]))},Dm=e=>r_(je(D(e)));var yb=function(){return arguments.length===1?e=>XO(arguments[0],e):XO(arguments[0],arguments[1])},XO=(e,t)=>sH(ke(t,r=>Za(e,r))),sH=e=>nH((t,r)=>Es(e,r));var o_=(e,t,r)=>{let n=Nt(r,\"parallel\");return tn(e,o=>o.build(t,Nt(n,\"sequential\")),{concurrency:e.length}).pipe(ke(o=>aA(...o)))},s_=(...e)=>gb((t,r)=>o_(e,t,r));var aH=(e,t,r)=>gb((n,o)=>V(Array.isArray(t)?o_(t,n,o):t.build(n,o),s=>e.build(n,o).pipe(rn(s),ke(a=>r(a,s))))),a_=l(2,(e,t)=>aH(e,t,R));var Hc=Nr;var $m=\"~effect/DateTime\",Bm=\"~effect/DateTime/TimeZone\",c_={[$m]:$m,pipe(){return Z(this,arguments)},[Te](){return this.toString()},toJSON(){return Il(this).toJSON()}},cH={...c_,_tag:\"Utc\",[se](){return It(this.epochMilliseconds)},[ae](e){return Jc(e)&&e._tag===\"Utc\"&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${Il(this).toJSON()})`}},uH={...c_,_tag:\"Zoned\",[se](){return le(It(this.epochMilliseconds))(H(this.zone))},[ae](e){return Jc(e)&&e._tag===\"Zoned\"&&this.epochMilliseconds===e.epochMilliseconds&&J(this.zone,e.zone)},toString(){return`DateTime.Zoned(${_b(this)})`}},u_={[Bm]:Bm,[Te](){return this.toString()}},fH={...u_,_tag:\"Named\",[se](){return Re(`Named:${this.id}`)},[ae](e){return li(e)&&e._tag===\"Named\"&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:\"TimeZone\",_tag:\"Named\",id:this.id}}},lH={...u_,_tag:\"Offset\",[se](){return Re(`Offset:${this.offset}`)},[ae](e){return li(e)&&e._tag===\"Offset\"&&this.offset===e.offset},toString(){return`TimeZone.Offset(${kb(this.offset)})`},toJSON(){return{_id:\"TimeZone\",_tag:\"Offset\",offset:this.offset}}},$o=(e,t,r)=>{let n=Object.create(uH);return n.epochMilliseconds=e,n.zone=t,Object.defineProperty(n,\"partsUtc\",{value:r,enumerable:!1,writable:!0}),Object.defineProperty(n,\"adjustedEpochMillis\",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(n,\"partsAdjusted\",{value:void 0,enumerable:!1,writable:!0}),n},Jc=e=>k(e,$m);var li=e=>k(e,Bm),f_=e=>li(e)&&e._tag===\"Offset\",l_=e=>li(e)&&e._tag===\"Named\",p_=e=>e._tag===\"Utc\",Eb=e=>e._tag===\"Zoned\",d_=nr((e,t)=>e.epochMilliseconds===t.epochMilliseconds);var m_=e=>{let t=Object.create(cH);return t.epochMilliseconds=e,Object.defineProperty(t,\"partsUtc\",{value:void 0,enumerable:!1,writable:!0}),t},Wc=e=>{let t=e.getTime();if(Number.isNaN(t))throw new ml(\"Invalid date\");return m_(t)},zm=e=>{if(Jc(e))return e;if(e instanceof Date)return Wc(e);if(typeof e==\"object\"){if(\"epochMilliseconds\"in e)return Wc(new Date(e.epochMilliseconds));let t=new Date(0);return SH(t,e),Wc(t)}else if(typeof e==\"string\"&&!pH(e))return Wc(new Date(e+\"Z\"));return Wc(new Date(e))},pH=e=>/Z|GMT|[+-]\\d{2}$|[+-]\\d{2}:?\\d{2}$|\\]$/.test(e),dH=-864e13+720*60*1e3,mH=864e13-840*60*1e3,Ib=(e,t)=>{let r=t?.timeZone;if(r===void 0&&Jc(e)&&Eb(e))return e;let n=zm(e);if(n.epochMillisecondsmH)throw new RangeError(`Epoch millis out of range: ${n.epochMilliseconds}`);r===void 0&&typeof e==\"object\"&&\"timeZoneId\"in e&&(r=e.timeZoneId);let o;if(r===void 0){let s=new Date(n.epochMilliseconds).getTimezoneOffset()*-60*1e3;o=El(s)}else if(li(r))o=r;else if(typeof r==\"number\")o=El(r);else{let s=Cb(r);if(fe(s))throw new ml(`Invalid time zone: ${r}`);o=s.value}return t?.adjustForTimeZone!==!0?$o(n.epochMilliseconds,o,n.partsUtc):bH(n.epochMilliseconds,o,t?.disambiguation??\"compatible\")},Sb=zn(Ib),h_=zn(zm),hH=/^(.{17,35})\\[(.+)\\]$/,x_=e=>{let t=hH.exec(e);if(t===null){let o=Ob(e);return o!==null?Sb(e,{timeZone:o}):v()}let[,r,n]=t;return Sb(r,{timeZone:n})};var g_=e=>m_(e.epochMilliseconds);var jm=new Map,xH={day:\"numeric\",month:\"numeric\",year:\"numeric\",hour:\"numeric\",minute:\"numeric\",second:\"numeric\",timeZoneName:\"longOffset\",fractionalSecondDigits:3,hourCycle:\"h23\"},gH=e=>{let t=e.resolvedOptions().timeZone,r=jm.get(t);if(r!==void 0)return r;let n=Object.create(fH);return n.id=t,n.format=e,jm.set(t,n),n},Tb=e=>{let t=jm.get(e);if(t!==void 0)return t;try{let r=gH(new Intl.DateTimeFormat(\"en-US\",{...xH,timeZone:e}));return jm.set(e,r),r}catch{throw new ml(`Invalid time zone: ${e}`)}},El=e=>{let t=Object.create(lH);return t.offset=e,t},wb=zn(Tb);var yH=/^(?:GMT|[+-])/,Cb=e=>{if(yH.test(e)){let t=Ob(e);return t===null?v():O(El(t))}return wb(e)},y_=e=>e._tag===\"Offset\"?kb(e.offset):e.id;var Il=e=>new Date(e.epochMilliseconds),qm=e=>{if(e._tag===\"Utc\")return new Date(e.epochMilliseconds);if(e.zone._tag===\"Offset\")return new Date(e.epochMilliseconds+e.zone.offset);if(e.adjustedEpochMilliseconds!==void 0)return new Date(e.adjustedEpochMilliseconds);let t=e.zone.format.formatToParts(e.epochMilliseconds).filter(n=>n.type!==\"literal\"),r=new Date(0);return r.setUTCFullYear(Number(t[2].value),Number(t[0].value)-1,Number(t[1].value)),r.setUTCHours(Number(t[3].value),Number(t[4].value),Number(t[5].value),t[6]?.type===\"fractionalSecond\"?Number(t[6].value):(e.epochMilliseconds%1e3+1e3)%1e3),e.adjustedEpochMilliseconds=r.getTime(),r},Ab=e=>qm(e).getTime()-vb(e),kb=e=>{let t=Math.abs(e),r=Math.floor(t/(3600*1e3)),n=Math.round(t%(3600*1e3)/(60*1e3));return n===60&&(r+=1,n=0),`${e<0?\"-\":\"+\"}${String(r).padStart(2,\"0\")}:${String(n).padStart(2,\"0\")}`},S_=e=>kb(Ab(e)),vb=e=>e.epochMilliseconds;var SH=(e,t)=>{if((t.year!==void 0||t.month!==void 0||t.day!==void 0)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),t.month!==void 0?t.month-1:e.getUTCMonth(),t.day??e.getUTCDate()),t.weekDay!==void 0){let r=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+r)}t.hour!==void 0&&e.setUTCHours(t.hour),t.minute!==void 0&&e.setUTCMinutes(t.minute),t.second!==void 0&&e.setUTCSeconds(t.second),t.millisecond!==void 0&&e.setUTCMilliseconds(t.millisecond)};var i_=1440*60*1e3,bH=(e,t,r)=>{if(t._tag===\"Offset\")return $o(e-t.offset,t);let n=bl(e-i_,e,t),o=bl(e+i_,e,t);if(n===o)return $o(e-n,t);let s=n{let t=EH.exec(e);if(t===null)return null;let[,r,n,o]=t;return(r===\"+\"?1:-1)*(Number(n)*60+Number(o))*60*1e3},bl=(e,t,r)=>{let n=r.format.formatToParts(e).find(s=>s.type===\"timeZoneName\")?.value??\"\";if(n===\"GMT\")return 0;let o=Ob(n);return o===null?Ab($o(t,r)):o};var b_=e=>Il(e).toISOString();var bb=e=>{let t=qm(e);return e._tag===\"Utc\"?t.toISOString():`${t.toISOString().slice(0,-1)}${S_(e)}`},_b=e=>e.zone._tag===\"Offset\"?bb(e):`${bb(e)}[${e.zone.id}]`;var zre=globalThis.Number;var I_=l(2,(e,t)=>{if(!globalThis.Number.isFinite(e)||!globalThis.Number.isFinite(t)||t===0)return NaN;if(globalThis.Number.isInteger(e)&&globalThis.Number.isInteger(t))return e%t;let[r,n]=E_(e),[o,s]=E_(t),a=Math.min(n,s),i=r*BigInt(10)**BigInt(n-a),c=o*BigInt(10)**BigInt(s-a),u=i%c;if(u===BigInt(0))return e<0||Object.is(e,-0)?-0:0;let f=globalThis.Number(`${u}e${a}`);return f===0?Math.sign(e)*globalThis.Number.MIN_VALUE:f});function E_(e){if(globalThis.Number.isInteger(e))return[BigInt(e),0];let t=Math.abs(e).toExponential(),r=t.indexOf(\"e\"),n=t.slice(0,r).replace(\".\",\"\");return[BigInt(n)*(e<0?-BigInt(1):BigInt(1)),globalThis.Number(t.slice(r+1))-n.length+1]}var T_=e=>{let t=Math.ceil(Math.log(e)/Math.log(2));return Math.max(Math.pow(2,t),2)};var Hre=globalThis.String,Hm=br;var w_=e=>e.toUpperCase();var C_=e=>e.trim();var wH=(e,t,r,n,o)=>{let s=e;for(let c of t)s=s.replace(c,\"$1\\0$2\");for(let c of r)s=s.replace(c,\"\\0\");let a=0,i=s.length;for(;s.charAt(a)===\"\\0\";)a++;for(;s.charAt(i-1)===\"\\0\";)i--;return s.slice(a,i).split(\"\\0\").map(o).join(n)};var CH=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],AH=/[^A-Z0-9]+/gi;var A_=e=>wH(e,CH,[AH],\"_\",w_);var He=l(2,(e,t)=>xs(e,kH,r=>t(r))),Bo=e=>e.reasons.some(Rb),Rb=e=>e._tag===\"Fail\"&&qc(e.error),Tl=e=>{let t,r=!1;for(let n of e.reasons)Rb(n)?t??=n.error:n._tag!==\"Interrupt\"&&(r=!0);return t===void 0?W(e):r?W(oa(e.reasons.filter(n=>!Rb(n)))):B(t)};var kH=e=>{let t=Tl(e);return ce(t)?t:B(t.success.value)},Jm=e=>{let t=Tl(e);return ce(t)?sn(t.failure):vr(t.success.value)},Km=l(2,(e,t)=>Mo(e,{onSuccess:t.onSuccess,onFailure:r=>{let n=Tl(r);return ce(n)?t.onFailure(n.failure):t.onDone(n.success.value)}}));var k_=\"~effect/Schedule\";var Gt=we(\"effect/Schedule/CurrentMetadata\",{defaultValue:je({input:void 0,output:void 0,duration:Ws,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),vH={[k_]:{_Out:R,_In:R,_Env:R},pipe(){return Z(this,arguments)}},Pb=e=>k(e,k_),wl=e=>{let t=Object.create(vH);return t.step=e,t},Mb=()=>{let e=0,t,r;return(n,o)=>{r===void 0&&(r=n);let s=n-r,a=t===void 0?0:n-t;return t=n,{input:o,attempt:++e,start:r,now:n,elapsed:s,elapsedSincePrevious:a}}},OH=e=>wl(ke(e,t=>{let r=Mb();return(n,o)=>t(r(n,o))})),di=e=>nn(e.step,t=>D(()=>De(t))),Kn=e=>Wn(t=>ke(di(e),r=>{let n=Mb();return o=>ne(()=>{let s=t.currentTimeMillisUnsafe();return V(r(s,o),([a,i])=>{let c=n(s,o);return c.output=a,c.duration=i,Ar(Bc(i),c)})})})),Cl=e=>ke(Kn(e),t=>r=>ke(t(r),n=>n.output));var Fb=e=>wl(ke(di(e),t=>(r,n)=>Km(t(r,n),{onSuccess:o=>D([n,o[1]]),onFailure:De,onDone:()=>Y(n)}))),v_=e=>Al(kl,({attempt:t})=>D(t<=e)),Nb=e=>{let t=Ge(e);return OH(D(r=>D([r.attempt-1,t])))};var Al=l(2,(e,t)=>wl(ke(di(e),r=>{let n=Mb();return(o,s)=>V(r(o,s),a=>{let[i,c]=a,u=t({...n(o,s),output:i,duration:c});return V(ie(u)?u:D(u),f=>f?D(a):Y(i))})})));var kl=Nb(Ws);var O_=\"~effect/ExecutionPlan\";var _H={[O_]:O_,get captureRequirements(){let e=this;return Xs(t=>D(RH(e.steps.map(r=>({...r,while:r.while?n=>rn(r.while(n),t):void 0,schedule:r.schedule?wl(rn(ke(di(r.schedule),n=>(o,s)=>rn(n(o,s),t)),t)):void 0,provide:t_(r.provide)?a_(r.provide,Dm(t)):r.provide})))))},pipe(){return Z(this,arguments)}},RH=e=>{let t=Object.create(_H);return t.steps=e,t};var Gm=we(\"effect/ExecutionPlan/CurrentMetadata\",{defaultValue:je({attempt:0,stepIndex:0})});var PH=(e,t,r)=>Cm(n=>V(r?.local?yl(t,gl(),n):Lm(t,n),o=>rn(e,o))),Vm=l(e=>ie(e[0]),(e,t,r)=>Uf(t)?rn(e,t):PH(e,Array.isArray(t)?s_(...t):t,r));var R_=e=>e.reasons.every(jn)?Ur(e):W(e),Db=l(3,(e,t,r)=>V(Kn(t),n=>{let o=Gt.defaultValue();return xs(He(ym(si(V(ne(()=>kr(e,Gt,o)),n),s=>z(()=>{o=s})),{disableYield:!0}),s=>D(s)),R_,s=>r(s,o.attempt===0?v():O(o)))})),Lb=l(3,(e,t,r)=>V(Kn(t),n=>{let o=Gt.defaultValue(),s,a=xs(ne(()=>kr(e,Gt,o)),R_,i=>(s=i,V(n(i),c=>(o=c,a))));return He(a,i=>js(()=>r(s,i)))})),P_=l(2,(e,t)=>{let r=typeof t==\"function\"?t(R):Pb(t)?t:Ol(t);return Db(e,r,Qe)}),vl=l(2,(e,t)=>{let r=typeof t==\"function\"?t(R):Pb(t)?t:Ol(t);return Lb(e,r,Qe)}),M_=l(3,(e,t,r)=>V(Kn(r),n=>{let o=Gt.defaultValue(),s=ne(()=>kr(e,Gt,o));return He(V(n(t),a=>{o=a;let i=je(V(s,n));return No({while:Sr,body:i,step(c){o=c}})}),a=>D(a))})),MH=Fb(kl),Ol=e=>{let t=e.schedule?Fb(e.schedule):MH;return e.while&&(t=Al(t,({input:r})=>{let n=e.while(r);return ie(n)?n:D(n)})),e.until&&(t=Al(t,({input:r})=>{let n=e.until(r);return ie(n)?ke(n,o=>!o):D(!n)})),e.times!==void 0&&(t=Al(t,({attempt:r})=>D(r<=e.times))),t};var $b=(e,t)=>{let r=-1,n=0,o=s=>Em(e(s));return{begin:Wn(s=>ne(()=>{let a=t();a.stepIndex!==r&&(r=a.stepIndex,n=0),n++;let i={attempt:a.attempt,stepAttempt:n,stepIndex:a.stepIndex,startNanos:s.monotonicTimeNanosUnsafe()};return Ar(o({_tag:\"AttemptStart\",attempt:i.attempt,stepAttempt:i.stepAttempt,stepIndex:i.stepIndex}),i)})),end:(s,a)=>Wn(i=>{let c=Ro(i.monotonicTimeNanosUnsafe()-s.startNanos);return o(a._tag===\"Success\"?{_tag:\"AttemptSuccess\",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c}:{_tag:\"AttemptFailure\",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c,cause:a.cause})})}},N_=l(e=>ie(e[0]),(e,t,r)=>ne(()=>{let n=0,o={attempt:0,stepIndex:0},s=gm(Gm,z(()=>(o={attempt:o.attempt+1,stepIndex:n},o))),a=r?.onEvent===void 0?void 0:$b(r.onEvent,()=>o),i=a===void 0?R:u=>Hn(f=>V(a.begin,p=>on(f(u),d=>a.end(p,d)))),c;return V(No({while:()=>np?d:(p=!0,Pc(c))),f=vl(f,_l(u,!1))}else{let p=_l(u,!0);f=p?vl(f,p):f}return Vs(f)},step(u){c=u,n++}}),()=>Pc(c))})),_l=(e,t)=>{if(t){if(e.attempts===1||!(e.schedule||e.attempts))return}else return Ol({schedule:e.schedule?e.schedule:e.attempts?void 0:FH,times:e.attempts,while:e.while});return Ol({schedule:e.schedule,while:e.while,times:e.attempts?e.attempts-1:void 0})},FH=v_(1);var NH=\"~effect/Request\",UH=gC({_E:e=>e,_A:e=>e,_R:e=>e}),cne={...wC,[NH]:UH};var D_=e=>e;var $_=l(2,(e,t)=>{let r=n=>ht(o=>{let s=j_(n,e,o,ds());return LH(n,s)});return ie(t)?V(t,r):r(t)}),B_=(e,t)=>{let r=j_(t.resolver,e,t.onExit,{context:t.context,cache:{scheduler:Fe(t.context,zf)}});return()=>z_(t.resolver,r)},Zm=[],Bb=new WeakMap,j_=(e,t,r,n)=>{let o=Bb.get(e);o||(o=new Map,Bb.set(e,o));let s,a=!1,i=D_({request:t,context:n.context,uninterruptible:!1,completeUnsafe(u){a||(a=!0,!(s&&!s.entrySet.delete(i))&&r(u))}});if(e.preCheck!==void 0&&!e.preCheck(i))return i;let c=e.batchKey(i);if(s=o.get(c),!s){if(Zm.length>0)s=Zm.pop(),s.key=c,s.resolver=e,s.map=o;else{let u={key:c,resolver:e,map:o,entrySet:new Set,entries:new Set,delayEffect:V(ne(()=>u.resolver.delay),f=>L_(u)),run:on(ne(()=>u.resolver.runAll(Array.from(u.entries),u.key)),f=>{for(let p of u.entrySet)p.completeUnsafe(f._tag===\"Success\"?Er(new Error(\"Effect.request: RequestResolver did not complete request\",{cause:p.request})):f);return u.entries.clear(),Zm.length<128&&(u.entrySet.clear(),u.key=void 0,u.fiber=void 0,u.resolver=void 0,u.map=void 0,Zm.push(u)),pe})};s=u}o.set(c,s),s.fiber=ys(n.context)(s.delayEffect,{scheduler:n.cache.scheduler})}return s.entrySet.add(i),s.entries.add(i),s.resolver.collectWhile(s.entries)||(s.fiber.interruptUnsafe(n.id),s.fiber=ys(n.context)(L_(s),{scheduler:n.cache.scheduler})),i},z_=(e,t)=>{if(t.uninterruptible)return;let r=Bb.get(e);if(!r)return;let n=e.batchKey(t),o=r.get(n);if(!o||!o.entries.delete(t))return;o.entrySet.delete(t);let s;o.entries.size===0&&(r.delete(n),s=o.fiber),t.completeUnsafe(Nc()),s?.interruptUnsafe()},LH=(e,t)=>z(()=>z_(e,t));function L_(e){return e.map.has(e.key)?(e.map.delete(e.key),e.run):pe}var BH=\"effect/Metric/CurrentMetricAttributes\",jH=we(BH,{defaultValue:()=>({})}),zH=\"effect/Metric/MetricRegistry\",qH=we(zH,{defaultValue:()=>new Map}),q_=\"~effect/Metric\",H_=class{[q_]=q_;#t;#e=\"\";id;description;attributes;constructor(t,r,n){this.id=t,this.description=r,this.attributes=n}valueUnsafe(t){return this.hook(t).get(t)}modifyUnsafe(t,r){return this.hook(r).modify(t,r)}updateUnsafe(t,r){return this.hook(r).update(t,r)}hook(t){let r=Fe(t,jH);r!==this.#t&&(this.#t=r,this.#e=HH(this,W_(this.attributes,r)));let n=Fe(t,qH),o=n.get(this.#e);return aC(o)&&(o={id:this.id,type:this.type,description:this.description,attributes:Object.keys(r).length>0?W_(this.attributes,r):this.attributes,hooks:this.createHooks()},n.set(this.#e,o)),o.hooks}pipe(){return Z(this,arguments)}};var Gc=l(2,(e,t)=>Xs(r=>z(()=>e.updateUnsafe(t,r))));function HH(e,t){let r=Object.entries(t).sort((n,o)=>n[0]o[0]?1:0);return JSON.stringify([e.type,e.id,e.description,r])}function W_(e,t){return{...J_(e),...J_(t)}}function J_(e){return Io(e)&&Array.isArray(e)?e.reduce((t,[r,n])=>(M(t,r,n),t),{}):e}var WH=ko,jo=ie,Ym=ll,JH=$S,KH=Kv,GH=Gv,VH=Vv,ZH=Yv,sa=tn,YH=Xv,Gn=No,Qm=nS,Zc=Ek,g=D,aa=oi,zb=rS,$=ne,X=z,Q=pe;var QH=YS;var Yc=ht,mi=mm,XH=sO,eW=aO,tW=cO;var rW=iO,dr=Ck,P=Qe,Xm=dm,ze=De,Is=Sk,an=Ys,Qc=bk;var Rl=Mc,nW=tS,cn=re,oW=kC,Pl=Pc,sW=eS,aW=yk,iW=gk,I=V,qb=Nk,_r=Fo,Rr=si,cW=Vs,uW=bv,vn=il,j=ke,Tt=Ar,eh=Fc,ia=nl,fW=_k,Hb=rv,lW=SS,ca=gs;var pW=TS,dW=dv,mW=mv,hW=hv,xW=xv,rt=nn,Wb=cv,gW=sl,yW=bm,SW=iv,bW=ES,EW=xs,th=wS,IW=CS,TW=AS,rh=IS,wW=lv,V_=uv,CW=fv,AW=Sm,Z_=pv,kW=kS,vW=vl,OW=Lb,_W=Rk,RW=Sv,PW=Em,MW=N_,FW=JO,NW=gv,UW=yv,DW=kv,LW=_S,$W=OS,Jb=Av,ua=Bc,BW=vv,Kb=cS,jW=uS,zW=Pk,Xc=fS,Gb=rO,qW=nO,Vb=oO,HW=BS,WW=jS,JW=nv,KW=tO,nh=ov,Zb=Im,GW=al,VW=vS,ZW=Tv,YW=Mk,zo=Mo,QW=Dc,XW=wv,eJ=Cv,hi=yS,Ml=Xs,tJ=Vm,On=rn,rJ=tv,Yb=Qk,Qb=Xk,nJ=Uc,oJ=hs,sJ=ev,qo=kr,aJ=gm,xi=cl,oh=PS,sh=Cm,gi=ai,iJ=Lv,Y_=ul,cJ=MS,yi=Nv,Vn=US,uJ=Uv,fJ=DS,Fl=qn,un=on,lJ=FS,pJ=NS,dJ=jv,mJ=Bv,hJ=LS,_n=zv,xJ=Am,Xb=Dv,Ts=ii,Ho=Hn,gJ=Wv,yJ=Jv,$t=ym,SJ=P_,bJ=Db,EJ=bS,IJ=sv,TJ=l(2,(e,t)=>Q_(e,void 0,t)),Q_=M_,wJ=EO,CJ=IO,AJ=TO,kJ=wO,vJ=PO,OJ=MO,_J=FO,RJ=NO,PJ=vO,MJ=OO,FJ=_O,eE=AO,NJ=Jf,UJ=Kf,DJ=RO,LJ=kO,$J=_c,BJ=$_,jJ=B_,eu=uO,Ut=zS,tu=pO,zJ=fO,qJ=lO,HJ=Tk,WJ=wk,Nl=mO,Rn=ys,JJ=qS,KJ=hO,tE=gO,rE=HS,ah=xO,GJ=Om,VJ=SO,ZJ=WS,Wo=yO,YJ=_m,Se=sS,QJ=Ak,Si=Wn,ih=Jn,XJ=Jn(),eK=Jn(\"Fatal\"),tK=Jn(\"Warn\"),nE=Jn(\"Error\"),rK=Jn(\"Info\"),nK=Jn(\"Debug\"),oK=Jn(\"Trace\"),sK=l(2,(e,t)=>hs(e,ZS,r=>new Set([...r,t]))),aK=l(e=>jo(e[0]),(e,...t)=>hs(e,GO,r=>{let n=t.length===1?{...r,...t[0]}:{...r};return t.length===1||M(n,t[0],t[1]),n})),iK=HO,cK=l(2,(e,t)=>V(GS,r=>hs(e,VO,n=>[[t,r],...n]))),uK=l(e=>jo(e[0]),(e,t,r)=>un(e,n=>{let o=r===void 0?n:r(n);return Gc(t,o)})),fK=l(e=>jo(e[0]),(e,t,r)=>Rr(e,n=>{let o=r===void 0?n:r(n);return Gc(t,o)})),lK=l(e=>jo(e[0]),(e,t,r)=>rh(e,n=>{let o=r===void 0?n:r(n);return Gc(t,o)})),pK=l(e=>jo(e[0]),(e,t,r)=>Z_(e,n=>{let o=r===void 0?n:r(n);return Gc(t,o)})),dK=l(e=>jo(e[0]),(e,t,r)=>Si(n=>{let o=n.monotonicTimeNanosUnsafe();return un(e,()=>{let s=n.monotonicTimeNanosUnsafe(),a=PA(Ge(s),Ge(o)),i=r===void 0?a:r(a);return Gc(t,i)})})),Vc=class extends lr()(\"effect/Effect/Transaction\"){},mK=e=>cn(t=>{let r=Fd(t.context,Vc);if(r&&!G_.has(r))return e;r={journal:new Map,retry:!1};let n;return Ho(o=>I(Gn({while:()=>!n,body:je(o(e).pipe(qo(Vc,r),V_(s=>r.retry?cm(s)?o(hK(r)):X(()=>jb(r)):Q),vn)),step(s){if(r.retry||!X_(r))return jb(r);Ve(s)&&xK(t,r),jb(r),G_.add(r),n=s}}),()=>n))}),G_=new WeakSet,X_=e=>{for(let[t,{version:r}]of e.journal)if(t.version!==r)return!1;return!0},hK=e=>Yc(t=>{if(!X_(e))return t(Q);let r={},n=Array.from(e.journal.keys()),o=()=>{for(let a of n)a.pending.delete(r)},s=()=>{o(),t(Q)};for(let a of n)a.pending.set(r,s);return X(o)});function xK(e,t){for(let[r,{value:n,written:o}]of t.journal)if(o){Object.is(n,r.value)||(r.version=r.version+1,r.value=n);for(let s of r.pending.values())e.currentDispatcher.scheduleTask(s,0);r.pending.clear()}}function jb(e){e.retry=!1,e.journal.clear()}var gK=I(Vc,e=>(e.retry=!0,_n)),yK=(e,t,r)=>(...n)=>Yc(o=>{try{e(...n,(s,a)=>{o(s?t?$(()=>P(t(s,n))):P(s):g(a))})}catch(s){o(r?P(r(s,n)):an(s))}}),SK=()=>e=>e,bK=()=>e=>e,EK=()=>e=>e,Dr=Uk,Ul=Dk,Vt=Lk,st=Fk,ru=$k,oE=kk;var eR=/^[+-]?\\d+$/,aE=\"~effect/BigDecimal\",IK={[aE]:aE,[se](){let e=cE(this);return le(Re(String(e.value)),It(e.scale))},[ae](e){return iE(e)&&aR(this,e)===0},toString(){return`BigDecimal(${ws(this)})`},toJSON(){return{_id:\"BigDecimal\",value:String(this.value),scale:this.scale}},[Te](){return this.toJSON()},pipe(){return Z(this,arguments)}},iE=e=>k(e,aE),nR=(e,t)=>{if(!Number.isSafeInteger(t))throw new RangeError(`Scale must be a safe integer, got ${t}`);let r=Object.create(IK);return r.value=e,r.scale=t,r},oR=(e,t)=>{let r=nR(e,t);return r.normalized=r,r};var Zn=BigInt(0),TK=BigInt(1);var wK=BigInt(10),sR=oR(Zn,0);var cE=e=>{if(e.normalized===void 0)if(e.value===Zn)e.normalized=sR;else{let t=`${e.value}`,r=t.length;for(;t[r-1]===\"0\";)r--;e.normalized=oR(BigInt(t.slice(0,r)),e.scale-(t.length-r))}return e.normalized};var CK=100,AK=[TK],sE=(e,t)=>e===t?0:e{let r=`${e.value{if(e.scale===t.scale)return sE(e.value,t.value);let r=rR(e),n=rR(t);if(r!==n)return rCK)return r===-1?tR(t,e):tR(e,t);let a=AK[s]??=wK**BigInt(s);return o>0?sE(e.value,t.value*a):sE(e.value*a,t.value)},nu=zs(aR);var rR=e=>e.value===Zn?0:e.value{if(e===\"\")return O(sR);let t,r,n=e.search(/[eE]/);if(n!==-1){let c=e.slice(n+1);if(t=e.slice(0,n),r=Number(c),t===\"\"||!Number.isSafeInteger(r)||!eR.test(c))return v()}else t=e,r=0;let o,s,a=t.search(/\\./);if(a!==-1){let c=t.slice(0,a),u=t.slice(a+1);o=`${c}${u}`,s=u.length}else o=t,s=0;if(!eR.test(o))return v();let i=s-r;return Number.isSafeInteger(i)?O(nR(BigInt(o),i)):v()};var ws=e=>{let t=cE(e);if(Math.abs(t.scale)>=16)return kK(t);let r=t.value0?n.padStart(t.scale+1,\"0\"):n.padEnd(n.length-t.scale,\"0\"),s=o.length-t.scale,a=t.scale>0?`${o.slice(0,s)}.${o.slice(s)}`:o;return r?`-${a}`:a},kK=e=>{if(vK(e))return\"0e+0\";let t=cE(e),r=`${t.value}`,n=t.value=0?\"+\":\"\"}${a}`};var vK=e=>e.value===Zn;var me={};Eo(me,{Any:()=>tV,Array:()=>$e,ArrayEnsure:()=>pV,BigDecimal:()=>pD,BigDecimalFromString:()=>JZ,BigInt:()=>Bu,BigIntFromString:()=>_Z,Boolean:()=>XT,BooleanFromBit:()=>DZ,BooleanLiterals:()=>nw,ByteSize:()=>Ju,ByteSizeFromBigInt:()=>GZ,ByteSizeFromNumber:()=>VZ,ByteSizeFromString:()=>KZ,Cause:()=>VT,CauseReason:()=>GT,Char:()=>hZ,Chunk:()=>ZZ,Class:()=>zD,Cookie:()=>$D,Cookies:()=>BD,Date:()=>Wu,DateFromMillis:()=>TZ,DateFromString:()=>IZ,DateTimeUtc:()=>Rx,DateTimeUtcFromDate:()=>r5,DateTimeUtcFromMillis:()=>o5,DateTimeUtcFromString:()=>n5,DateTimeZoned:()=>OD,DateTimeZonedFromString:()=>c5,Defect:()=>gZ,Duration:()=>Mx,DurationFromMillis:()=>Y5,DurationFromNanos:()=>Z5,DurationFromString:()=>hw,Enum:()=>X3,Error:()=>qD,ErrorInstance:()=>xZ,Exit:()=>Q5,FalseLiterals:()=>jU,File:()=>sD,Finite:()=>qu,FiniteFromString:()=>OZ,FormData:()=>aD,Graph:()=>r8,HashMap:()=>n8,HashSet:()=>o8,Headers:()=>u8,InetAddress:()=>DD,InetAddressFromString:()=>q5,InetAddressV4:()=>j5,InetAddressV6:()=>z5,Int:()=>lo,IpAddress:()=>Ki,IpAddressFromString:()=>Gu,IpInterface:()=>MD,IpInterfaceFromString:()=>D5,IpLinkLocalAddress:()=>T5,IpLinkLocalAddressFromString:()=>w5,IpLoopbackAddress:()=>E5,IpLoopbackAddressFromString:()=>I5,IpMulticastAddress:()=>u5,IpMulticastAddressFromString:()=>f5,IpNetwork:()=>UD,IpNetworkFromString:()=>B5,IpUnicastAddress:()=>d5,IpUnicastAddressFromString:()=>m5,IpUnspecifiedAddress:()=>C5,IpUnspecifiedAddressFromString:()=>A5,Ipv4Address:()=>Px,Ipv4AddressFromString:()=>dw,Ipv4BroadcastAddress:()=>g5,Ipv4BroadcastAddressFromString:()=>y5,Ipv4Interface:()=>RD,Ipv4InterfaceFromString:()=>N5,Ipv4Network:()=>FD,Ipv4NetworkFromString:()=>L5,Ipv4PrivateAddress:()=>k5,Ipv4PrivateAddressFromString:()=>v5,Ipv6Address:()=>mw,Ipv6AddressFromString:()=>_D,Ipv6Interface:()=>PD,Ipv6InterfaceFromString:()=>U5,Ipv6Network:()=>ND,Ipv6NetworkFromString:()=>$5,Ipv6UniqueLocalAddress:()=>O5,Ipv6UniqueLocalAddressFromString:()=>_5,Json:()=>Nx,JsonFromUrlParamsField:()=>f8,JsonObject:()=>L8,Literal:()=>Ct,Literals:()=>fo,MacAddress:()=>Ji,MacAddressFromString:()=>Ku,MacBroadcastAddress:()=>S5,MacBroadcastAddressFromString:()=>b5,MacLocallyAdministeredAddress:()=>R5,MacLocallyAdministeredAddressFromString:()=>P5,MacMulticastAddress:()=>l5,MacMulticastAddressFromString:()=>p5,MacUnicastAddress:()=>h5,MacUnicastAddressFromString:()=>x5,MacUniversallyAdministeredAddress:()=>M5,MacUniversallyAdministeredAddressFromString:()=>F5,MutableJson:()=>B8,Natural:()=>zi,Never:()=>eV,NonEmptyArray:()=>tw,NonEmptyString:()=>fw,Null:()=>wx,NullOr:()=>rw,NullishOr:()=>PU,Number:()=>Wi,NumberFromString:()=>vZ,ObjectKeyword:()=>oV,Opaque:()=>CV,Option:()=>Gi,OptionFromNullOr:()=>s8,OptionFromNullishOr:()=>i8,OptionFromOptional:()=>d8,OptionFromOptionalKey:()=>p8,OptionFromOptionalNullOr:()=>m8,OptionFromUndefinedOr:()=>a8,PropertyKey:()=>KT,ReadonlyMap:()=>yZ,ReadonlySet:()=>SZ,Record:()=>_s,RecordFromCookies:()=>c8,RecordFromUrlParams:()=>l8,Redacted:()=>Fx,RedactedFromValue:()=>h8,RegExp:()=>bZ,Result:()=>x8,SchemaError:()=>Os,SocketAddress:()=>W5,StandardSchemaV1FailureResult:()=>UZ,String:()=>K,StringForLiteralAutocomplete:()=>rV,StringFromBase64:()=>PZ,StringFromBase64Url:()=>MZ,StringFromHex:()=>FZ,StringFromUriComponent:()=>NZ,Struct:()=>Me,StructWithRest:()=>fV,Symbol:()=>OU,TaggedClass:()=>b8,TaggedError:()=>E8,TaggedStruct:()=>kx,TaggedUnion:()=>wV,TemplateLiteral:()=>Y3,TemplateLiteralParser:()=>Q3,TimeZone:()=>kD,TimeZoneFromString:()=>i5,TimeZoneNamed:()=>CD,TimeZoneNamedFromString:()=>a5,TimeZoneOffset:()=>s5,Tree:()=>D8,Trim:()=>RZ,Trimmed:()=>cD,TrueLiterals:()=>BU,Tuple:()=>Qo,TupleWithRest:()=>lV,URL:()=>Ox,URLFromString:()=>EZ,URLSearchParams:()=>iD,Uint8Array:()=>_x,Uint8ArrayFromBase64:()=>LZ,Uint8ArrayFromBase64Url:()=>$Z,Uint8ArrayFromHex:()=>BZ,Undefined:()=>QT,UndefinedOr:()=>Ax,Union:()=>it,UniqueArray:()=>dV,UniqueSymbol:()=>sV,UnixPathAddress:()=>LD,UnixPathAddressFromString:()=>H5,Unknown:()=>vp,UnknownFromJsonString:()=>CZ,UrlParams:()=>xw,Void:()=>nV,annotate:()=>w3,annotateEncoded:()=>C3,annotateKey:()=>A3,asserts:()=>R3,brand:()=>NU,catchDecoding:()=>gV,catchDecodingWithContext:()=>LU,catchEncoding:()=>yV,catchEncodingWithContext:()=>$U,check:()=>hV,declare:()=>Be,declareConstructor:()=>qr,decode:()=>SV,decodeEffect:()=>P3,decodeExit:()=>M3,decodeOption:()=>N3,decodePromise:()=>D3,decodeResult:()=>U3,decodeSync:()=>L3,decodeTo:()=>G,decodeUnknownEffect:()=>Ex,decodeUnknownExit:()=>bU,decodeUnknownOption:()=>F3,decodeUnknownPromise:()=>IU,decodeUnknownResult:()=>EU,decodeUnknownSync:()=>TU,encode:()=>bV,encodeEffect:()=>$3,encodeExit:()=>B3,encodeKeys:()=>cV,encodeOption:()=>z3,encodePromise:()=>H3,encodeResult:()=>q3,encodeSync:()=>W3,encodeTo:()=>ow,encodeUnknownEffect:()=>Ix,encodeUnknownExit:()=>wU,encodeUnknownOption:()=>j3,encodeUnknownPromise:()=>AU,encodeUnknownResult:()=>CU,encodeUnknownSync:()=>kU,extendTo:()=>uV,fieldsAssign:()=>aV,flip:()=>JT,fromBrand:()=>xV,fromFormData:()=>AZ,fromJsonString:()=>lw,fromURLSearchParams:()=>kZ,instanceOf:()=>ba,is:()=>_3,isBase64:()=>KU,isBase64Url:()=>FV,isBetween:()=>Hu,isBetweenBigDecimal:()=>WZ,isBetweenBigInt:()=>oZ,isBetweenCodePoints:()=>iZ,isBetweenDate:()=>eZ,isBetweenLength:()=>iw,isBetweenProperties:()=>dZ,isBetweenSize:()=>fZ,isCapitalized:()=>BV,isEndingWith:()=>UV,isFinite:()=>zV,isGUID:()=>PV,isGreaterThan:()=>HV,isGreaterThanBigDecimal:()=>jZ,isGreaterThanBigInt:()=>tZ,isGreaterThanDate:()=>ZV,isGreaterThanOrEqualTo:()=>GU,isGreaterThanOrEqualToBigDecimal:()=>zZ,isGreaterThanOrEqualToBigInt:()=>VU,isGreaterThanOrEqualToDate:()=>YV,isIncluding:()=>DV,isInt:()=>vx,isInt32:()=>GV,isLessThan:()=>WV,isLessThanBigDecimal:()=>qZ,isLessThanBigInt:()=>rZ,isLessThanDate:()=>QV,isLessThanOrEqualTo:()=>JV,isLessThanOrEqualToBigDecimal:()=>HZ,isLessThanOrEqualToBigInt:()=>nZ,isLessThanOrEqualToDate:()=>XV,isLowercased:()=>$V,isMaxCodePoints:()=>aZ,isMaxLength:()=>XU,isMaxProperties:()=>pZ,isMaxSize:()=>uZ,isMinCodePoints:()=>sZ,isMinLength:()=>ZU,isMinProperties:()=>lZ,isMinSize:()=>cZ,isMultipleOf:()=>KV,isNonEmpty:()=>QU,isPattern:()=>zu,isPropertyNames:()=>mZ,isSchema:()=>Tx,isSchemaError:()=>hU,isStartingWith:()=>NV,isStringBigInt:()=>vV,isStringFinite:()=>kV,isStringSymbol:()=>OV,isTrimmed:()=>JU,isULID:()=>MV,isUUID:()=>RV,isUint32:()=>VV,isUncapitalized:()=>jV,isUnique:()=>uw,isUniqueKey:()=>eD,isUppercased:()=>LV,link:()=>Oe,linkDecoding:()=>ju,make:()=>q,makeFilter:()=>Ue,makeFilterGroup:()=>AV,makeIsBetween:()=>Mp,makeIsGreaterThan:()=>Op,makeIsGreaterThanOrEqualTo:()=>_p,makeIsLessThan:()=>Rp,makeIsLessThanOrEqualTo:()=>Pp,makeIsMultipleOf:()=>qV,middlewareDecoding:()=>UU,middlewareEncoding:()=>DU,mutable:()=>mV,mutableKey:()=>G3,optional:()=>Lu,optionalKey:()=>qi,overrideToCodecIso:()=>N8,overrideToEquivalence:()=>w8,overrideToFormatter:()=>I8,readonlyKey:()=>V3,refine:()=>FU,required:()=>K3,requiredKey:()=>J3,resolveAnnotations:()=>j8,resolveAnnotationsKey:()=>z8,revealBottom:()=>T3,revealCodec:()=>k3,suspend:()=>MU,tag:()=>Hi,tagDefaultOmit:()=>TV,toCodecArrayFromSingle:()=>_8,toCodecIso:()=>O8,toCodecJson:()=>v8,toCodecStringTree:()=>Np,toDifferJsonPatch:()=>U8,toEncoded:()=>$u,toEncoderXml:()=>R8,toEquivalence:()=>C8,toFormatter:()=>T8,toIso:()=>P8,toIsoFocus:()=>F8,toIsoSource:()=>M8,toJsonSchemaDocument:()=>k8,toRepresentation:()=>A8,toStandardJSONSchemaV1:()=>O3,toStandardSchemaV1:()=>v3,toTaggedUnion:()=>WU,toType:()=>Hr,withArrayLengthConstraints:()=>Cx,withConstructorDefault:()=>zU,withDecodingDefault:()=>HU,withDecodingDefaultKey:()=>sw,withDecodingDefaultType:()=>IV,withDecodingDefaultTypeKey:()=>EV});var uR=globalThis.BigInt;var fR=e=>e>uR(Number.MAX_SAFE_INTEGER)||ee.names.map(t=>[t,e])));var fE=e=>e;var ou=e=>{throw new Error(`Invalid ByteSize: ${e}`)},dR=e=>!Number.isSafeInteger(e)||e<0?ou(`expected a non-negative safe integer, received ${e}`):fE(BigInt(e));var mR=e=>{let t=/^\\s*(\\d+)(?:\\.(\\d+))?\\s*([A-Za-z]+)\\s*$/.exec(e);if(t===null)return ou(`unsupported syntax ${JSON.stringify(e)}`);let r=PK.get(t[3]);if(r===void 0)return ou(`unsupported unit ${JSON.stringify(t[3])}`);let n=t[2]??\"\",o=BigInt(10)**BigInt(n.length),s=BigInt(t[1]+n)*r.factor;return s%o!==uE?ou(`${JSON.stringify(e)} does not represent an integral number of bytes`):fE(s/o)},hR=zn(mR),ch=e=>{switch(typeof e){case\"bigint\":return etypeof e==\"bigint\"?ch(e):dR(e);var gR=e=>typeof e==\"bigint\"&&e>=uE;var uh=e=>e,yR=fR;var bR=\"~effect/Chunk\";function SR(e,t,r,n,o){for(let s=t;snr((t,r)=>{if(t.length!==r.length)return!1;let n=bi(t),o=bi(r);for(let s=0;se},toString(){return`Chunk(${F(bi(this))})`},toJSON(){return{_id:\"Chunk\",values:vt(bi(this))}},[Te](){return this.toJSON()},[ae](e){return lh(e)&&NK(this,e)},[se](){return To(bi(this))},[Symbol.iterator](){switch(this.backing._tag){case\"IArray\":return this.backing.array[Symbol.iterator]();case\"IEmpty\":return ER[Symbol.iterator]();default:return bi(this)[Symbol.iterator]()}},pipe(){return Z(this,arguments)}},mE=e=>{let t=Object.create(UK);switch(t.backing=e,e._tag){case\"IEmpty\":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case\"IConcat\":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case\"IArray\":{t.length=e.array.length,t.depth=0,t.left=Cs,t.right=Cs;break}case\"ISingleton\":{t.length=1,t.depth=0,t.left=Cs,t.right=Cs;break}case\"ISlice\":{t.length=e.length,t.depth=0,t.left=Cs,t.right=Cs;break}}return t},lh=e=>k(e,bR),Cs=mE({_tag:\"IEmpty\"}),DK=()=>Cs;var LK=e=>mE({_tag:\"ISingleton\",a:e}),hE=e=>lh(e)?e:BK(Ye(e)),pE=(e,t,r)=>{switch(e.backing._tag){case\"IArray\":{SR(e.backing.array,0,t,r,e.length);break}case\"IConcat\":{pE(e.left,t,r),pE(e.right,t,r+e.left.length);break}case\"ISingleton\":{t[r]=e.backing.a;break}case\"ISlice\":{SR(bi(e.backing.chunk),e.backing.offset,t,r,e.length);break}}};var $K=e=>{switch(e.backing._tag){case\"IEmpty\":return ER;case\"IArray\":return e.backing.array;default:{let t=new Array(e.length);return pE(e,t,0),e.backing={_tag:\"IArray\",array:t},e.left=Cs,e.right=Cs,e.depth=0,t}}},bi=$K;var BK=e=>e.length===0?DK():e.length===1?LK(e[0]):mE({_tag:\"IArray\",array:e});var IR=e=>e.length;var gE=Jc,TR=li,wR=f_,CR=l_,AR=p_,kR=Eb,vR=d_;var OR=zm;var _R=Ib;var yE=h_,RR=x_;var SE=g_;var bE=Tb,EE=El,PR=wb;var MR=Cb,Dl=y_;var FR=Il;var NR=vb;var UR=b_;var IE=_b;var su=e=>jK(typeof e==\"string\"?zK.encode(e):e),Ei=e=>{let t=HK(e),r=t.length;if(r%4!==0)return W(new An({kind:\"Decode\",module:\"Base64\",input:t,message:`Length must be a multiple of 4, but is ${r}`}));let n=t.indexOf(\"=\");if(n!==-1&&(n$f(u4(e,t,r));function f4(e){let t=aP(e.name,e.valueEncoded,e.options);if(t!==void 0)throw t;let r=e.name+\"=\"+e.valueEncoded;if(e.options===void 0)return r;let n=e.options;if(n.maxAge!==void 0){let o=vA(Ge(n.maxAge));r+=\"; Max-Age=\"+Math.trunc(o)}if(n.domain!==void 0&&(r+=\"; Domain=\"+n.domain),n.path!==void 0&&(r+=\"; Path=\"+n.path),n.priority!==void 0)switch(n.priority){case\"low\":r+=\"; Priority=Low\";break;case\"medium\":r+=\"; Priority=Medium\";break;case\"high\":r+=\"; Priority=High\";break}if(n.expires!==void 0&&(r+=\"; Expires=\"+n.expires.toUTCString()),n.httpOnly&&(r+=\"; HttpOnly\"),n.secure&&(r+=\"; Secure\"),n.partitioned&&(r+=\"; Partitioned\"),n.sameSite!==void 0)switch(n.sameSite){case\"lax\":r+=\"; SameSite=Lax\";break;case\"strict\":r+=\"; SameSite=Strict\";break;case\"none\":r+=\"; SameSite=None\";break}return r}var cP=e=>{let t={},r=Object.values(e.cookies);for(let n=0;nObject.values(e.cookies).map(f4);var l4=e=>{try{return decodeURIComponent(e)}catch{return e}};var Ai=new WeakMap,fP=e=>{if(Ai.has(e))return Ai.get(e);throw new Error(\"Unable to get redacted value\"+(e.label?` with label: \"${e.label}\"`:\"\"))};var lP=\"~effect/Redacted\",qE=e=>k(e,lP),ki=(e,t)=>{let r=Object.create(m4);return t?.label&&(r.label=t.label),Ai.set(r,e),r},m4={[lP]:{_A:e=>e},label:void 0,...rr,toJSON(){return this.toString()},toString(){return``},[se](){return H(Ai.get(this))},[ae](e){return qE(e)&&J(Ai.get(this),Ai.get(e))}},au=fP;var pP=e=>nr((t,r)=>e(au(t),au(r)));var WE=Symbol.for(\"~effect/http/Headers\"),dP=e=>k(e,WE),JE=Object.defineProperties(Object.create(null),{[WE]:{value:WE},[Na]:{value(e){return x4(this,Fe(e,g4))}},toJSON:{value(){return is(this)}},[ae]:{value(e){return KE(this,e)}},[se]:{value(){return Tf(this)}},toString:{value:dc.toString},[Te]:{value:dc[Te]}});var KE=hA(Ja()),h4=Object.create(JE),mP=e=>{if(e===void 0)return h4;if(Symbol.iterator in e){let r=Object.create(JE);for(let[n,o]of e)r[n.toLowerCase()]=o;return r}let t=Object.create(JE);for(let[r,n]of Object.entries(e))Array.isArray(n)?t[r.toLowerCase()]=n.join(\", \"):n!==void 0&&(t[r.toLowerCase()]=n);return t};var x4=l(2,(e,t)=>{let r={...e},n=o=>{if(typeof o==\"string\"){let s=o.toLowerCase();s in e&&(r[s]=ki(e[s]))}else for(let s in e)s.search(o)!==-1&&(r[s]=ki(e[s]))};if(Array.isArray(t))for(let o=0;o[\"authorization\",\"cookie\",\"set-cookie\",\"x-api-key\",\"AWSAccessKeyId\",\"Signature\",\"sig\",\"X-Goog-Signature\"]});var GE=\"~effect/http/UrlParams\",VE=e=>k(e,GE),S4={...rr,[GE]:GE,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:\"UrlParams\",params:Object.fromEntries(this.params)}},[ae](e){return ZE(this,e)},[se](){return To(this.params.flat())}},Sh=e=>{let t=Object.create(S4);return t.params=e,t},hP=e=>{if(VE(e))return e;let t=xP(e),r=[];for(let n=0;n{let t=typeof e[Symbol.iterator]==\"function\"?Ye(e):Object.entries(e),r=[];for(let[n,o]of t)if(Array.isArray(o))for(let s=0;sb4(e.params,t.params)),b4=SA(cA([Ja(),Ja()]));var gP=l(2,(e,t)=>yy(e.params,([r])=>r===t).pipe(Rt(([,r])=>r)));var E4=e=>{let t={};for(let[r,n]of e.params)if(!Object.hasOwn(t,r))M(t,r,n);else{let o=t[r];typeof o==\"string\"?M(t,r,[o,n]):o.push(n)}return t},yP=E4;var YE=\"~effect/Graph\",QE=e=>k(e,YE),SP=e=>e;var T4=(e,t,r)=>(e===\"directed\"?t.source===r.source&&t.target===r.target:t.source===r.source&&t.target===r.target||t.source===r.target&&t.target===r.source)&&J(t.data,r.data),w4=(e,t)=>e===\"directed\"?H(t):qt(le(H(t.data),C4(t.source,t.target))),C4=(e,t)=>le(0,H(e))+le(0,H(t)),A4=Re(\"Graph\"),k4={[YE]:{_N:e=>e,_E:e=>e},[Symbol.iterator](){return this.nodes[Symbol.iterator]()},[Te](){return this.toJSON()},[ae](e){if(k(e,YE)){let t=SP(e);if(this.nodes.size!==t.nodes.size||this.edges.size!==t.edges.size||this.type!==t.type)return!1;for(let[r,n]of this.nodes)if(!t.nodes.has(r)||!J(n,t.nodes.get(r)))return!1;for(let[r,n]of this.edges){let o=t.edges.get(r);if(o===void 0||!T4(this.type,n,o))return!1}return!0}return!1},[se](){let e=A4;e=e^Re(this.type),e=e^It(this.nodes.size),e=e^It(this.edges.size);for(let[t,r]of this.nodes)e^=le(H(t),H(r));for(let[t,r]of this.edges)e^=le(H(t),w4(this.type,r));return qt(e)},toJSON(){return{_id:\"Graph\",nodeCount:this.nodes.size,edgeCount:this.edges.size,type:this.type}},toString(){return`Graph(${this.type}, ${this.nodes.size}, ${this.edges.size})`},pipe(){return Z(this,arguments)}},v4=(e,t)=>{let r=Object.create(k4);return r.type=e,r.mutable=t,r.transforming=!1,r.nodes=new Map,r.edges=new Map,r.adjacency=new Map,r.reverseAdjacency=new Map,r.nextNodeIndex=0,r.nextEdgeIndex=0,r.acyclic=O(!0),r};var Hl=e=>{let t=SP(e);return{type:e.type,nodes:Array.from(t.nodes,([r,n])=>({index:r,data:n})).sort((r,n)=>r.index-n.index),edges:Array.from(t.edges,([r,n])=>({index:r,source:n.source,target:n.target,data:n.data})).sort((r,n)=>r.index-n.index)}},bh=e=>{let t=v4(e.type,!1);for(let r of e.nodes)t.nodes.set(r.index,r.data),t.adjacency.set(r.index,[]),t.reverseAdjacency.set(r.index,[]);for(let r of e.edges)t.edges.set(r.index,{source:r.source,target:r.target,data:r.data}),t.adjacency.get(r.source).push(r.index),t.reverseAdjacency.get(r.target).push(r.index),e.type===\"undirected\"&&(t.adjacency.get(r.target).push(r.index),t.reverseAdjacency.get(r.source).push(r.index));return t.nextNodeIndex=e.nodes.length===0?0:e.nodes[e.nodes.length-1].index+1,t.nextEdgeIndex=e.edges.length===0?0:e.edges[e.edges.length-1].index+1,t.acyclic=v(),t};function As(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function Eh(e){return t=>As(t)?.[e]}var Lr=\"~structural\",vi=\"~identifier\",Wl=\"~sentinels\",Ih=\"~constructor\",bP=[\"title\",\"description\",\"default\",\"examples\",\"readOnly\",\"writeOnly\",\"format\",\"contentEncoding\",\"contentMediaType\",\"contentSchema\"],iu=Eh(\"identifier\"),XE=Eh(vi),eI=Eh(\"title\");var Jl=Vr(e=>{let t=As(e)?.identifier;return typeof t==\"string\"?t:e.getExpected(Jl)}),EP=new Set([Wl,Lr,\"representation\",\"arbitraryConstraint\",\"toJsonSchema\",\"toCode\",\"toEquivalence\",\"toFormatter\",\"toCodec\",\"toCodecJson\",\"toCodecStringTree\",\"toCodecIso\",\"toCodecArbitrary\"]);var ge=Symbol();var Zt=vr,$r=Zt(ge),qe=Zt(ge),Kl=e=>e===ge?v():O(e),tI=e=>e._tag===\"None\"?$r:Zt(e.value);var Zl=\"~effect/SchemaIssue/Issue\";function nI(e){return k(e,Zl)&&e[Zl]===Zl}function _4(e){return Object.hasOwn(e,\"input\")}var fn=class{[Zl]=Zl;constructor(t,r){r?.reportInput===!0&&t!==ge&&(this.input=t)}},IP=class extends fn{_tag=\"Filter\";filter;issue;constructor(e,t,r,n){super(r,n),this.filter=e,this.issue=t}},TP=class extends fn{_tag=\"Encoding\";ast;issue;constructor(e,t,r,n){super(r,n),this.ast=e,this.issue=t}},ut=class extends fn{_tag=\"Pointer\";path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},ma=class extends fn{_tag=\"MissingKey\";annotations;constructor(e){super(),this.annotations=e}},oI=class extends fn{_tag=\"UnexpectedKey\";ast;constructor(e,t,r){super(t,r),this.ast=e}},wt=class extends fn{_tag=\"Composite\";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},ft=class extends fn{_tag=\"InvalidType\";ast;constructor(e,t,r){super(t,r),this.ast=e}},de=class extends fn{_tag=\"InvalidValue\";annotations;constructor(e,t,r){super(t,r),this.annotations=e}};function Br(e,t,r,n,o){return new wt(e,[new ut([t],r)],n,o)}var Yl=class extends fn{_tag=\"Forbidden\";annotations;constructor(e,t,r){super(t,r),this.annotations=e}},Ql=class extends fn{_tag=\"AnyOf\";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},wP=class extends fn{_tag=\"OneOf\";ast;successes;constructor(e,t,r,n){super(r,n),this.ast=e,this.successes=t}};function rI(e,t,r){if(nI(e))return e;if(typeof e==\"string\")return new de({message:e},t,r);let n=typeof e.issue==\"string\"?new de({message:e.issue},t,r):e.issue;return new ut(e.path,n)}function CP(e,t,r){if(e!==void 0)return typeof e==\"boolean\"?e?void 0:new de(void 0,t,r):rI(e,t,r)}function AP(e,t,r,n){return Array.isArray(t)?tt(t)?t.length===1?rI(t[0],r,n):new wt(e,wn(t,o=>rI(o,r,n)),r,n):void 0:CP(t,r,n)}var kP=e=>{let t=uu(e);if(t!==void 0)return t;switch(e._tag){case\"InvalidType\":return da(Jl(e.ast),e);case\"InvalidValue\":{let r=sI(e);if(r!==void 0)return da(r,e);let n=Th(e);return n===void 0?\"Expected a valid value\":`Invalid data ${n}`}case\"MissingKey\":return\"Missing key\";case\"UnexpectedKey\":{let r=Th(e);return r===void 0?\"Expected no excess property\":`Unexpected key with value ${r}`}case\"Forbidden\":return\"Forbidden operation\";case\"OneOf\":{let r=Th(e);return r===void 0?\"Expected exactly one member to match\":`Expected exactly one member to match the input ${r}`}}},vP=e=>uu(e.issue)??uu(e);function OP(e){return t=>({issues:cu(t,[],e?.leafHook??kP,e?.checkHook??vP)})}function Th(e){return _4(e)?F(e.input):void 0}function sI(e){let t=e.annotations?.expected;return typeof t==\"string\"?t:void 0}function da(e,t){let r=Th(t);return r===void 0?`Expected ${e}`:`Expected ${e}, got ${r}`}function cu(e,t,r,n){switch(e._tag){case\"Filter\":{let o=n(e);if(o!==void 0)return[{path:t,message:o}];if(e.issue._tag!==\"InvalidValue\")return cu(e.issue,t,r,n);let s=sI(e.issue);return[{path:t,message:s===void 0?da(aI(e.filter),e):da(s,e.issue)}]}case\"Encoding\":return cu(e.issue,t,r,n);case\"Pointer\":return cu(e.issue,[...t,...e.path],r,n);case\"Composite\":return e.issues.flatMap(o=>cu(o,t,r,n));case\"AnyOf\":return e.issues.length===0?[{path:t,message:uu(e)??da(Jl(e.ast),e)}]:e.issues.flatMap(o=>cu(o,t,r,n));default:return[{path:t,message:r(e)}]}}function aI(e){let t=e.annotations?.expected;if(typeof t==\"string\")return t;switch(e._tag){case\"Filter\":return\"\";case\"FilterGroup\":return e.checks.map(r=>aI(r)).join(\" & \")}}function R4(){return e=>Vl(e,\"\")}var _P=R4();function Vl(e,t){let r;switch(e._tag){case\"Filter\":{let n=vP(e);if(n!==void 0)r=n;else{if(e.issue._tag!==\"InvalidValue\")return Vl(e.issue,t);let o=sI(e.issue);r=o===void 0?da(aI(e.filter),e):da(o,e.issue)}break}case\"Encoding\":return Vl(e.issue,t);case\"Pointer\":return Vl(e.issue,t+pd(e.path));case\"Composite\":case\"AnyOf\":{if(e._tag===\"Composite\"||e.issues.length>0)return e.issues.map(n=>Vl(n,t)).join(`\n`);r=uu(e)??da(Jl(e.ast),e);break}default:r=kP(e);break}return t?`${r}\n at ${t}`:r}function uu(e){if(e._tag===\"Pointer\")return;if(e._tag===\"Encoding\")return uu(e.issue);let r=(e._tag===\"Filter\"?e.filter.annotations:\"annotations\"in e?e.annotations:e.ast.annotations)?.[e._tag===\"MissingKey\"?\"messageMissingKey\":e._tag===\"UnexpectedKey\"?\"messageUnexpectedKey\":\"message\"];if(typeof r==\"string\")return r}function Xl(e){let t;for(let r of e.reasons){if(!na(r)||!nI(r.error))return;t??=r.error}return t}function ln(e,t){let r=Xl(e);if(r===void 0)throw new Error(t,{cause:e});return r}var PP=e=>su(e).replace(/=/g,\"\").replace(/\\+/g,\"-\").replace(/\\//g,\"_\"),iI=e=>{let t=e.replace(/[\\n\\r]/g,\"\"),r=t.length;if(r%4===1)return W(new An({module:\"Base64Url\",kind:\"Decode\",input:t,message:`Length should be a multiple of 4, but is ${r}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(t))return W(new An({module:\"Base64Url\",kind:\"Decode\",input:t,message:\"Invalid input\"}));let n=r%4===2?`${t}==`:r%4===3?`${t}=`:t;return n=n.replace(/-/g,\"+\").replace(/_/g,\"/\"),Ei(n)},MP=e=>Tr(iI(e),t=>P4.decode(t)),P4=new TextDecoder;var FP=(e,t,r)=>{switch(e._tag){case\"Passthrough\":return g(t);case\"Transform\":return g(Rt(t,e.transform));case\"TransformOptional\":return g(e.transform(t));case\"TransformEffect\":return fe(t)?aa:Dr(e.transform(t.value,r),O);case\"TransformOptionalEffect\":return e.transform(t,r)}};var ep=e=>Object.assign(Object.create(Lg),e),wh=(e,t)=>cI((r,n)=>st(FP(e,r,n),o=>FP(t,o,n))),Ch=l(2,(e,t)=>{if(e._tag===\"Passthrough\")return t;if(t._tag===\"Passthrough\")return e;switch(e._tag){case\"Transform\":switch(t._tag){case\"Transform\":return oe(r=>t.transform(e.transform(r)));case\"TransformOptional\":return Oi(r=>t.transform(Rt(r,e.transform)));case\"TransformEffect\":return gt((r,n)=>t.transform(e.transform(r),n));case\"TransformOptionalEffect\":return wh(e,t)}case\"TransformOptional\":switch(t._tag){case\"Transform\":return Oi(r=>Rt(e.transform(r),t.transform));case\"TransformOptional\":return Oi(r=>t.transform(e.transform(r)));case\"TransformEffect\":case\"TransformOptionalEffect\":return wh(e,t)}case\"TransformEffect\":switch(t._tag){case\"Transform\":return gt((r,n)=>Dr(e.transform(r,n),t.transform));case\"TransformOptional\":case\"TransformOptionalEffect\":return wh(e,t);case\"TransformEffect\":return gt((r,n)=>st(e.transform(r,n),o=>t.transform(o,n)))}case\"TransformOptionalEffect\":return wh(e,t)}});function F4(e){return cI((t,r)=>P(e(t,r)))}function Ah(e){return F4((t,r)=>{let n={message:e(t)};return be(t)?new Yl(n,t.value,r):new Yl(n)})}var NP=Ah(()=>\"Encoding is not supported\"),N4=ep({_tag:\"Passthrough\"});function jr(){return N4}function oe(e){return ep({_tag:\"Transform\",transform:e})}function gt(e){return ep({_tag:\"TransformEffect\",transform:e})}function Oi(e){return ep({_tag:\"TransformOptional\",transform:e})}function cI(e){return ep({_tag:\"TransformOptionalEffect\",transform:e})}function uI(){return Oi(()=>v())}function fI(e){return cI(t=>{let r=Va(t,Io);return be(r)?g(r):Dr(e,O)})}function _i(){return oe(globalThis.String)}function kh(){return oe(globalThis.Number)}function UP(){return oe(globalThis.BigInt)}function lI(){return oe(e=>new globalThis.Date(e))}function DP(){return oe(C_)}function LP(e){return gt((t,r)=>Qc({try:()=>JSON.parse(t,e?.reviver),catch:()=>new de({expected:\"a valid JSON string\"},t,r)}))}function $P(e){return gt((t,r)=>Qc({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw new TypeError(\"Value cannot be represented as JSON\");return n},catch:()=>new de({expected:\"a JSON-serializable value\"},t,r)}))}function BP(e){let t=e?.separator??\",\",r=e?.keyValueSeparator??\"=\";return oe(n=>n.split(t).reduce((o,s)=>{if(r===\"\"){let[u,f]=s.split(\"\");return u&&f&&M(o,u,f),o}let a=s.indexOf(r);if(a<=0)return o;let i=s.slice(0,a),c=s.slice(a+r.length);return c&&M(o,i,c),o},{}))}function jP(e){let t=e?.separator??\",\",r=e?.keyValueSeparator??\"=\";return oe(n=>Object.entries(n).map(([o,s])=>`${o}${r}${s}`).join(t))}function zP(e){let t=e?.separator??\",\";return oe(r=>r===\"\"?[]:r.split(t))}function pI(){return oe(su)}function vh(){return oe(PP)}function Oh(){return oe(zA)}function qP(){return gt((e,t)=>Ul(Pl(Ei(e)),()=>new de({expected:\"a valid Base64 string\"},e,t)))}function HP(){return gt((e,t)=>wr(LR(e),{onFailure:()=>P(new de({expected:\"a valid Base64 string\"},e,t)),onSuccess:g}))}function WP(){return gt((e,t)=>wr(iI(e),{onFailure:()=>P(new de({expected:\"a valid Base64Url string\"},e,t)),onSuccess:g}))}function JP(){return gt((e,t)=>wr(MP(e),{onFailure:()=>P(new de({expected:\"a valid Base64Url string\"},e,t)),onSuccess:g}))}function KP(){return gt((e,t)=>wr(Oy(e),{onFailure:()=>P(new de({expected:\"a valid hexadecimal string\"},e,t)),onSuccess:g}))}function GP(){return gt((e,t)=>wr(qA(e),{onFailure:()=>P(new de({expected:\"a valid hexadecimal string\"},e,t)),onSuccess:g}))}function VP(){return oe(encodeURIComponent)}function ZP(){return gt((e,t)=>{try{return g(globalThis.decodeURIComponent(e))}catch{return P(new de({expected:\"a valid URI component\"},e,t))}})}function YP(){return oe(e=>tM(Array.from(e.entries())))}var U4=rM(e=>typeof e==\"string\"||typeof Blob<\"u\"&&e instanceof Blob);function QP(){return oe(e=>{let t=new FormData;return typeof e==\"object\"&&e!==null&&U4(e).forEach(([n,o])=>{t.append(n,o)}),t})}function XP(){return oe(e=>tM(Array.from(e.entries())))}var D4=rM(br);function eM(){return oe(e=>typeof e==\"object\"&&e!==null?new URLSearchParams(D4(e)):new URLSearchParams)}function L4(e){if(e===\"\")return[\"\"];let t=e.replace(/\\[(.*?)\\]/g,\".$1\"),r=t.split(\".\"),n=t.startsWith(\".\")?1:0;return r.slice(n).map(o=>Cc(o)?globalThis.Number(o):o)}function tM(e){let t={},r=new WeakSet,n=new WeakSet;function o(s,a,i){let c=Object.hasOwn(s,a)?s[a]:void 0;if(r.has(c)&&Array.isArray(c)===i)return c;let u=i?[]:{};return r.add(u),M(s,a,u),u}return e.forEach(([s,a])=>{let i=L4(s),c=t;i.forEach((u,f)=>{let p=f===i.length-1;if(Array.isArray(c)&&u===\"\")if(p)c.push(a);else{let d=i[f+1],m=typeof d==\"number\"||d===\"\",x=c.length;c=o(c,x,m)}else if(p){let d=Object.hasOwn(c,u);if(d&&Array.isArray(c[u])&&(r.has(c[u])||n.has(c[u])))c[u].push(a);else if(d){let m=[c[u],a];n.add(m),M(c,u,m)}else M(c,u,a)}else{let d=i[f+1];c=o(c,u,typeof d==\"number\"||d===\"\")}})}),t}function rM(e){return t=>{let r=[];function n(o,s){if(e(s))r.push([o,s]);else if(Array.isArray(s))s.every(e)?s.forEach(i=>{r.push([o,i])}):s.forEach((i,c)=>{n(`${o}[${c}]`,i)});else if(typeof s==\"object\"&&s!==null)for(let[a,i]of Object.entries(s))n(`${o}[${a}]`,i)}for(let[o,s]of Object.entries(t))n(o,s);return r}}var _h=class extends $s{_tag=\"Middleware\";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new _h(this.encode,this.decode)}},tp=\"~effect/SchemaTransformation/Transformation\",ve=class extends $s{[tp]=tp;_tag=\"Transformation\";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new ve(this.encode,this.decode)}};function $4(e){return k(e,tp)&&e[tp]===tp}var Rh=e=>$4(e)?e:new ve(e.decode,e.encode);function Yt(e){return new ve(gt(e.decode),gt(e.encode))}function Pe(e){return new ve(oe(e.decode),oe(e.encode))}function Ph(e){return new ve(Oi(e.decode),Oi(e.encode))}function nM(){return new ve(DP(),jr())}function oM(e){return new ve(BP(e),jP(e))}var B4=new ve(jr(),jr());function lu(){return B4}var pu=new ve(kh(),_i()),Mh=new ve(UP(),_i()),dI=new ve(lI(),oe(Yg)),sM=new ve(lI(),oe(e=>e.getTime()));var mI=Yt({decode:(e,t)=>Wt(hR(e),{onNone:()=>P(new de({expected:\"a valid ByteSize string\"},e,t)),onSome:g}),encode:e=>g(`${e} ${e===BigInt(1)?\"byte\":\"bytes\"}`)}),aM=Yt({decode:(e,t)=>Wt(lE(e),{onNone:()=>P(new de({expected:\"a non-negative bigint byte count\"},e,t)),onSome:g}),encode:e=>g(uh(e))}),iM=Yt({decode:(e,t)=>Wt(lE(e),{onNone:()=>P(new de({expected:\"a non-negative safe-integer byte count\"},e,t)),onSome:g}),encode:(e,t)=>Wt(yR(e),{onNone:()=>P(new de({expected:\"a ByteSize representable as a safe integer\"},e,t)),onSome:g})}),j4=e=>fr(e)&&typeof e.message==\"string\",cM=e=>{let r=Object.hasOwn(e,\"cause\")?new Error(e.message,{cause:fM(e.cause)}):new Error(e.message);return typeof e.name==\"string\"&&e.name!==\"Error\"&&(r.name=e.name),typeof e.stack==\"string\"&&(r.stack=e.stack),r},z4=e=>{try{let t=Ua(e);return t===void 0?F(e):JSON.parse(t)}catch{return F(e)}},q4=(e,t,r)=>{let n={name:e.name,message:typeof e.message==\"string\"?e.message:\"\"};return t?.includeStack&&typeof e.stack==\"string\"&&(n.stack=e.stack),!t?.excludeCause&&e.cause!==void 0&&(n.cause=r(e.cause)),n},uM=e=>{let t=new WeakSet,r=n=>{if(cC(n)){if(t.has(n))return\"[Circular]\";t.add(n);let o=q4(n,e,r);return t.delete(n),o}return z4(n)};return r},fM=e=>j4(e)?cM(e):e,lM=e=>Pe({decode:cM,encode:t=>uM(e)(t)}),pM=e=>Pe({decode:fM,encode:uM(e)});function dM(){return Pe({decode:cy,encode:Rd})}function mM(){return Pe({decode:iy,encode:qs})}function hM(e){return Pe({decode:Nf,encode:e?.onNoneEncoding===null?Rd:qs})}function xM(){return Ph({decode:O,encode:Ga})}function gM(){return Ph({decode:e=>e.pipe(Va(Io),O),encode:Ga})}var hI=Yt({decode:(e,t)=>URL.canParse(e)?g(new URL(e)):P(new de({expected:\"a valid URL string\"},e,t)),encode:e=>g(e.href)});var xI=new ve(qP(),pI()),yM=new ve(HP(),pI()),SM=new ve(JP(),vh()),bM=new ve(GP(),Oh()),EM=new ve(ZP(),VP());function IM(e){return new ve(LP(e??{}),$P(e))}var TM=new ve(YP(),QP()),wM=new ve(XP(),eM());function xa(e){return t=>t._tag===e}var gu=xa(\"Declaration\");var H4=xa(\"Never\");var mu=xa(\"Literal\"),yI=xa(\"UniqueSymbol\");var AI=xa(\"Arrays\"),W4=xa(\"Objects\"),MM=xa(\"Union\"),FM=xa(\"Suspend\"),at=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Go={},Ko=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,r=void 0,n=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=r,this.annotations=n}},CM=\"~effect/Schema\",lt=class{[CM]=CM;annotations;checks;encoding;context;constructor(t=void 0,r=void 0,n=void 0,o=void 0){this.annotations=t,this.checks=r,this.encoding=n,this.context=o}toString(){return`<${this._tag}>`}},yu=class extends lt{_tag=\"Declaration\";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,r,n,o,s,a,i){super(r,n,o,s),this.typeParameters=e,this.run=t,this.encodingChecks=a,this.encodingRun=i}getParser(){let e;return(t,r)=>t===ge?$r:(e??=this.run(this.typeParameters))(t,this,r)}_rebuild(e,t,r,n,o){let s=Pi(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&r===this.encodingChecks&&n===this.run&&o===this.encodingRun?this:new yu(s,n,this.annotations,t,void 0,this.context,r,o)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==\"string\"?e:\"\"}},J4=class extends lt{_tag=\"Null\";getParser(){return qh(this,null)}getExpected(){return\"null\"}},kI=new J4;var K4=class extends lt{_tag=\"Undefined\";getParser(){return qh(this,void 0)}toCodecJson(){return We(this,[NM])}getExpected(){return\"undefined\"}},NM=new at(kI,new ve(oe(()=>{}),oe(()=>null))),vI=new K4;var G4=class extends lt{_tag=\"Void\";getParser(){let e=Zt(void 0);return t=>t===ge?$r:e}toCodecJson(){return We(this,[NM])}getExpected(){return\"void\"}},UM=new G4;var V4=class extends lt{_tag=\"Never\";getParser(){return ro(this,iC)}getExpected(){return\"never\"}},OI=new V4,Z4=class extends lt{_tag=\"Any\";getParser(){return ro(this,zg)}getExpected(){return\"any\"}},DM=new Z4,Y4=class extends lt{_tag=\"Unknown\";getParser(){return ro(this,zg)}getExpected(){return\"unknown\"}},eo=new Y4,Q4=class extends lt{_tag=\"ObjectKeyword\";getParser(){return ro(this,If)}getExpected(){return\"object | array | function\"}},LM=new Q4,$M=class extends lt{_tag=\"Enum\";enums;constructor(e,t,r,n,o){super(t,r,n,o);for(let[,s]of e)if(typeof s==\"number\"&&!globalThis.Number.isFinite(s))throw new Error(`A numeric enum value must be finite, got ${F(s)}`);this.enums=e}getParser(){let e=new Set(this.enums.map(([,t])=>t));return ro(this,t=>e.has(t))}toCodecStringTree(){if(this.enums.some(([e,t])=>typeof t==\"number\")){let e=Object.fromEntries(this.enums.map(([t,r])=>[globalThis.String(r),r]));return We(this,[new at(new zr(Object.keys(e).map(t=>new dn(t))),new ve(oe(t=>e[t]),_i()))])}return this}getExpected(){return this.enums.map(([e,t])=>JSON.stringify(t)).join(\" | \")}};function gI(e){return typeof e==\"number\"?`parts[${e}]`:e}function SI(e,t,r){if(r.has(e))return!0;if(e.encoding)throw new Error(`TemplateLiteral parts cannot have an encoding at ${gI(t)}`);let n;switch(e._tag){case\"String\":case\"Number\":case\"BigInt\":n=!0;break;case\"Literal\":n=!e.checks;break;case\"TemplateLiteral\":{let o=gI(t);n=!e.checks&&e.parts.every((s,a)=>SI(s,`${o}.parts[${a}]`,r));break}case\"Union\":{let o=gI(t);n=!e.checks&&e.types.every((s,a)=>SI(s,`${o}.types[${a}]`,r));break}default:return!1}return n&&r.add(e),n}var _I=class extends lt{_tag=\"TemplateLiteral\";parts;encodedParts;literals;suffixLengths;constructor(e,t,r,n,o){super(t,r,n,o);let s=[],a=[],i=new Set;for(let u=0;u=0;u--)c[u]=c[u+1]+(a[u]?.length??0);this.parts=e,this.encodedParts=s,this.literals=a,this.suffixLengths=c}getParser(e){let t=new Pn(!1,this.parts.map(WI),[]),r=e(ga(pn,t,jM(this)));return(n,o)=>{if(n===ge)return $r;let s=r(n,o);return s._tag===\"Success\"?qe:Vt(s,{onSuccess:()=>n,onFailure:a=>new wt(this,[a],n,o)})}}getExpected(){return\"string\"}matchPart(e,t){return dF(this,e,t)===void 0?void 0:e}};function BM(e){let t=Vr(o=>{if(o._tag!==\"Union\")return o;let s=Pi(o.types,t);return(o.options?.mode??\"anyOf\")===\"anyOf\"&&s===o.types?o:new zr(s,o.options===void 0?void 0:{...o.options,mode:\"anyOf\"},o.annotations,o.checks,void 0,o.context)}),r=new _I(e.map(o=>t(hn(o)))),n=new Pn(!1,e.map(WI),[]);return ga(r,n,jM(r))}function jM(e){return new ve(gt((t,r)=>{let n=dF(e,t,r);return n?g(n):P(new de({expected:\"a string matching template literal parts\"},t,r))}),oe(t=>t.join(\"\")))}var zM=class extends lt{_tag=\"UniqueSymbol\";symbol;constructor(e,t,r,n,o){super(t,r,n,o),this.symbol=e}getParser(){return qh(this,this.symbol)}toCodecStringTree(){let e=globalThis.Symbol.keyFor(this.symbol);return We(this,[new at(e===void 0?OI:new dn(globalThis.String(this.symbol)),xF.transformation)])}getExpected(){return globalThis.String(this.symbol)}},dn=class extends lt{_tag=\"Literal\";literal;constructor(e,t,r,n,o){if(super(t,r,n,o),typeof e==\"number\"&&!globalThis.Number.isFinite(e))throw new Error(`A numeric literal must be finite, got ${F(e)}`);this.literal=e}getParser(){return qh(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==\"bigint\"?AM(this):this}toCodecStringTree(){return typeof this.literal==\"string\"?this:AM(this)}getExpected(){return typeof this.literal==\"string\"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function AM(e){let t=globalThis.String(e.literal);return We(e,[new at(new dn(t),new ve(oe(()=>e.literal),oe(()=>t)))])}var X4=class extends lt{_tag=\"String\";getParser(){return ro(this,br)}matchPart(e,t){let r=this.checks;return r&&!t.disableChecks&&no(r,e,void 0,this,t)?void 0:e}getExpected(){return\"string\"}},pn=new X4,e6=class extends lt{_tag=\"Number\";getParser(){return ro(this,Ef)}matchKey(e,t){return this._match(y6,e,t)}matchPart(e,t){return this._match(TI,e,t)}_match(e,t,r){if(!e.test(t))return;let n=globalThis.Number(t);return r.disableChecks||!this.checks?n:no(this.checks,n,void 0,this,r)?void 0:n}toCodecJson(){return this.checks&&(bI(this.checks,\"effect/schema/isFinite\")||bI(this.checks,\"effect/schema/isInt\"))?this:We(this,[l6])}toCodecStringTree(){return this.toCodecJson()===this?We(this,[S6]):We(this,[b6])}getExpected(){return\"number\"}};function bI(e,t){return e.some(r=>r.annotations?.representation?.id===t||r._tag===\"FilterGroup\"&&bI(r.checks,t))}var RI=new e6,t6=class extends lt{_tag=\"Boolean\";getParser(){return ro(this,ad)}getExpected(){return\"boolean\"}},qM=new t6,r6=class extends lt{_tag=\"Symbol\";getParser(){return ro(this,jg)}matchKey(e,t){return t.disableChecks||!this.checks?e:no(this.checks,e,void 0,this,t)?void 0:e}toCodecStringTree(){return We(this,[xF])}getExpected(){return\"symbol\"}},HM=new r6,n6=class extends lt{_tag=\"BigInt\";getParser(){return ro(this,sC)}matchPart(e,t){if(!wI.test(e))return;let r=globalThis.BigInt(e);return t.disableChecks||!this.checks?r:no(this.checks,r,void 0,this,t)?void 0:r}toCodecStringTree(){return We(this,[I6])}getExpected(){return\"bigint\"}},WM=new n6,Pn=class extends lt{_tag=\"Arrays\";isMutable;elements;rest;encodingChecks;constructor(e,t,r,n,o,s,a,i){super(n,o,s,a),this.isMutable=e,this.elements=t,this.rest=r,this.encodingChecks=i;let c=!1;for(let u=0;u1)throw new Error(\"A required element cannot follow an optional element. ts(1257)\");for(let u=1;u=f?o[p-f+1]:o[0]}let c=f=>{let{input:p,len:d,options:m}=f;if(r.rest.length===0&&d>s)for(let x=s;x{let d=f.length,m={ast:r,getParser:i,input:f,len:d,tailThreshold:Math.max(s,d-a),output:new globalThis.Array(d),issues:void 0,options:p},x=r.rest.length===0?s:Math.max(d,s+a),y=p.concurrency===void 0?1:pl(p.concurrency),S=y===1?s6(m,f,0,x):a6(m,f,{concurrency:y,end:x});if(!S)return c(m);if(Ne(S))return st(S,()=>c(m));let w=!0;return $(()=>w?(w=!1,I(S,()=>c(m))):u(f,p))};return(f,p)=>{if(f===ge)return $r;try{return Array.isArray(f)?(n||(n=r.elements.map(d=>({ast:d,parser:t(d)})),o=r.rest.map(d=>({ast:d,parser:t(d)}))),u(f,p)):P(new ft(r,f,p))}catch(d){return an(d)}}}_rebuild(e,t,r){let n=Pi(this.elements,e),o=Pi(this.rest,e);return n===this.elements&&o===this.rest&&t===this.checks&&r===this.encodingChecks?this:new Pn(this.isMutable,n,o,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return\"array\"}};function o6(e,t,r,n){if(r._tag===\"Failure\")return Nh(e,e.ast,n,r);let o=r===qe?t:r[ue];if(o!==ge)e.output[n]=o;else{let s=e.getParser(e.tailThreshold,n);if(Qt(s.ast))return;let a=new ut([n],new ma(s.ast.context?.annotations));if(e.options.errors===\"all\")e.issues?e.issues.push(a):e.issues=[a];else return bs(new wt(e.ast,[a],e.input,e.options))}}var JM={onItem(e,t,r){let n=r{if(n.cause.reasons.length===0)return n;let o=Xl(n.cause);if(o===void 0)return sn(Ss(n.cause,a=>new wt(t,[new ut([r],a)],e.input,e.options)));let s=new ut([r],o);if(e.options.errors===\"all\")e.issues?e.issues.push(s):e.issues=[s];else return bs(new wt(t,[s],e.input,e.options))},Dh=\"[+-]?\\\\d*\\\\.?\\\\d+(?:[Ee][+-]?\\\\d+)?\";function ha(e,t,r=Go){let n,o;function s(a){switch(a._tag){case\"String\":case\"TemplateLiteral\":return(n??=Object.keys(e)).filter(i=>a.matchPart(i,r)!==void 0);case\"Number\":return(n??=Object.keys(e)).filter(i=>a.matchKey(i,r)!==void 0);case\"Symbol\":return(o??=Object.getOwnPropertySymbols(e)).filter(i=>Object.prototype.propertyIsEnumerable.call(e,i)&&a.matchKey(i,r)!==void 0);case\"Union\":return[...new Set(a.types.flatMap(s))];default:return[]}}return s(HI(hn(t)))}var PI=class{name;type;constructor(e,t){this.name=e,this.type=t}};function KM(e){switch(e._tag){case\"String\":case\"Number\":case\"Symbol\":case\"TemplateLiteral\":return!0;case\"Union\":return e.types.every(KM);default:return!1}}function GM(e){let t=bu(e);switch(t._tag){case\"String\":case\"Number\":case\"Symbol\":case\"TemplateLiteral\":return!0;case\"Union\":return t.types.every(GM);default:return!1}}function i6(e){return KM(e)&&GM(e)}var MI=class{parameter;type;constructor(e,t){if(!i6(e))throw new Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Qt(t)&&!pF(t))throw new Error(\"Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.\")}},np=class extends lt{_tag=\"Objects\";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,r,n,o,s,a){super(r,n,o,s),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=a}getParser(e,t=e){let r=this,n=r.propertySignatures.length,o=r.indexSignatures.length;if(!n&&!o)return ro(r,cd);let s,a,i=()=>(s||(s=r.propertySignatures.map(p=>({parser:t(p.type),name:p.name,type:p.type})),a=o?r.indexSignatures.map(p=>({is:p,parserKey:e(HI(p.parameter)),parserValue:t(p.type)})):void 0),s),c=()=>{let p=new Set(r.propertySignatures.map(S=>typeof S.name==\"number\"?globalThis.String(S.name):S.name)),d=(S,w,E,U,_)=>{if(_._tag===\"Failure\")return Nh(S,r,w,_)??xt;let h=_===qe?U:_[ue];if(E!==ge&&h!==ge){if(n&&(p.has(w)||p.has(typeof E==\"number\"?globalThis.String(E):E)))return xt;M(S.out,E,h)}return xt},m=(S,w,E,U)=>{if(!U){let T=E.parserKey(w,S.options);if(!Ne(T))return I(vn(T),C=>m(S,w,E,C));U=T}if(U._tag===\"Failure\")return Nh(S,r,w,U)??xt;let _=U===qe?w:U[ue],h=S.input[w],b=E.parserValue(h,S.options);return Ne(b)?d(S,w,_,h,b):I(vn(b),T=>d(S,w,_,h,T))},x=(S,w,E)=>{let U=S.input[w],_=E.parserValue(U,S.options);return Ne(_)?d(S,w,w,U,_):I(vn(_),h=>d(S,w,w,U,h))},y=o?vm()({onItem:(S,[w,E])=>E.is.parameter===pn?x(S,w,E):m(S,w,E),step:(S,w,E)=>E._tag===\"Failure\"?E:void 0}):void 0;return oE(function*(S,w){if(S===ge)return ge;if(!(typeof S==\"object\"&&S!==null&&!Array.isArray(S)))return yield*P(new ft(r,S,w));i();let E=S,U={},_={ast:r,input:E,out:U,issues:void 0,options:w},h=w.errors===\"all\",b=w.onExcessProperty===\"error\",T=w.concurrency===void 0?1:pl(w.concurrency),C=o&&b?r.indexSignatures.map(L=>ha(E,L.parameter,w)):void 0;if(b){let L=C?new Set(p):p;if(C)for(let ye of C)for(let _e of ye)L.add(_e);let ee=Reflect.ownKeys(E);for(let ye=0;ye{let x=s[d];return I(vn(m),y=>{let S=EI(p,x,y);if(S)return S;let w=()=>Zt(p.out),E=kM(p,s.slice(d+1));return E?st(E,w):w()})};return(p,d)=>{if(p===ge)return $r;if(d.errors===\"all\"||d.onExcessProperty!==void 0||d.concurrency!==void 0&&pl(d.concurrency)!==1)return(u??=c())(p,d);if(!(typeof p==\"object\"&&p!==null&&!Array.isArray(p)))return P(new ft(r,p,d));let m=i(),x=p,y={},S={ast:r,input:x,out:y,issues:void 0,options:d};try{for(let w=0;w{let i=e(a.type);return i===a.type?a:new PI(a.name,i)}),s=Pi(this.indexSignatures,a=>{let i=t(a.parameter),c=e(a.type);return i===a.parameter&&c===a.type?a:new MI(i,c)});return o===this.propertySignatures&&s===this.indexSignatures&&r===this.checks&&n===this.encodingChecks?this:new np(o,s,this.annotations,r,void 0,this.context,n)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?\"object | array\":\"object\"}};function EI(e,t,r){if(r._tag===\"Failure\")return Nh(e,e.ast,t.name,r);if(r===qe)return;let n=r[ue];if(n!==ge){M(e.out,t.name,n);return}if(delete e.out[t.name],!Qt(t.type)){let o=new ut([t.name],new ma(t.type.context?.annotations));if(e.options.errors===\"all\"){e.issues?e.issues.push(o):e.issues=[o];return}else return bs(new wt(e.ast,[o],e.input,e.options))}}var VM={onItem(e,t){if(!du(e.input,t.name))return t.parser(ge,e.options);let r=e.input[t.name];return M(e.out,t.name,r),t.parser(r,e.options)},step:EI},kM=km()(VM),c6=vm()(VM);function FI(e,t){return e?t?[...e,...t]:e:t}function Lh(e,t,r){return new np(Reflect.ownKeys(e).map(n=>new PI(n,e[n].ast)),[],r,t)}function op(e){return e.ast}function NI(e,t=void 0){return new Pn(!1,e.map(r=>r.ast),[],void 0,t)}function $h(e,t,r){return new zr(e.map(op),t,void 0,r)}function ZM(e,t){if(e.encoding||t.some(s=>s.encoding))throw new Error(\"StructWithRest does not support encodings\");let r=e.propertySignatures,n=e.indexSignatures,o=e.checks;for(let s of t){for(let a of s.propertySignatures)if(r.some(i=>i.name===a.name))throw new Error(`Duplicate identifier: ${JSON.stringify(a.name)}. ts(2300)`);r=r.concat(s.propertySignatures),n=n.concat(s.indexSignatures),o=FI(o,s.checks)}return new np(r,n,void 0,o)}function YM(e,t){if(e.encoding)throw new Error(\"TupleWithRest does not support encodings\");return new Pn(e.isMutable,e.elements,t,void 0,e.checks)}function QM(e){if(e.encoding)throw new Error(\"mutable does not support encodings\");return new Pn(!0,e.elements,e.rest,e.annotations,e.checks,void 0,e.context,e.encodingChecks)}var UI=Pa(e=>{for(;;){if(FM(e))return eo;let t=e.encoding;if(!t)return e.recur?.(UI,R)??e;if(t.some(r=>r.transformation._tag===\"Middleware\"&&r.transformation.decode!==R))return eo;e=t[t.length-1].to}});function XM(e){switch(e._tag){case\"Null\":return[\"null\"];case\"Undefined\":return[\"undefined\"];case\"String\":case\"TemplateLiteral\":return[\"string\"];case\"Number\":return[\"number\"];case\"Boolean\":return[\"boolean\"];case\"Symbol\":case\"UniqueSymbol\":return[\"symbol\"];case\"BigInt\":return[\"bigint\"];case\"Arrays\":return[\"array\"];case\"ObjectKeyword\":return[\"object\",\"array\",\"function\"];case\"Objects\":return e.propertySignatures.length||e.indexSignatures.length?[\"object\"]:[\"string\",\"number\",\"boolean\",\"symbol\",\"bigint\",\"object\",\"array\",\"function\"];case\"Enum\":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case\"Literal\":return[typeof e.literal];case\"Union\":return Array.from(new Set(e.types.flatMap(XM)));default:return[\"null\",\"undefined\",\"string\",\"number\",\"boolean\",\"symbol\",\"bigint\",\"object\",\"array\",\"function\"]}}function hu(e){switch(e._tag){default:return[];case\"Declaration\":{let t=e.annotations?.[Wl];return Array.isArray(t)?t:[]}case\"Objects\":return e.propertySignatures.flatMap(t=>{let r=t.type;if(!Qt(r)){if(mu(r))return[{key:t.name,literal:r.literal}];if(yI(r))return[{key:t.name,literal:r.symbol}]}return[]});case\"Arrays\":return e.elements.flatMap((t,r)=>{if(!Qt(t)){if(mu(t))return[{key:r,literal:t.literal}];if(yI(t))return[{key:r,literal:t.symbol}]}return[]});case\"Union\":{if(e.types.length===0)return[];let t=e.types.map(r=>hu(UI(r)));return t[0].filter(r=>t.every(n=>n.some(o=>o.key===r.key&&o.literal===r.literal)))}case\"Suspend\":return hu(e.thunk())}}var vM=new WeakMap,Fh=Object.freeze([]),OM=e=>e===null?\"null\":Array.isArray(e)?\"array\":typeof e,du=(e,t)=>t===\"__proto__\"?Object.hasOwn(e,t):t in e;function sp(e){let t=vM.get(e);if(t)return t;let r,n=0,o,s,a=!0,i=[];for(let f=0;fc[f]??=Object.freeze(o?.[f]??Fh);if(a&&s)s.forEach(Object.freeze),t=f=>s.get(f)??Fh;else if(r?.size===1&&!o){let[f,[p]]=r.entries().next().value,d=new Map;for(let[x,y]of p)d.set(x,Object.freeze(Array.from(y)));let m=Object.freeze(e.map((x,y)=>y));t=(x,y)=>{if(If(x)){let S=du(x,f)?x[f]:void 0;if(S!==void 0)return d.get(S)??Fh;if(y)return m}return Fh}}else if(r){let f;for(let p of r)(!f||p[1][0].size>f[1][0].size)&&p[1][1].size===n&&(f=p);t=(p,d)=>{let m=OM(p);if(!If(p))return u(m);let x=new Set(o?.[m]),y;if(f){let[S,[w]]=f,E=du(p,S),U=E?p[S]:void 0;if(E&&(!d||U!==void 0)){let _=w.get(U);if(!_)return u(m);for(let h of _)x.add(h);y=S}}if(y===void 0)for(let[S,[w,E]]of r){let U=du(p,S),_=U?p[S]:void 0;if(U&&(!d||_!==void 0)){let h=w.get(_);if(h)for(let b of h)x.add(b)}else if(d)for(let h of E)x.add(h)}for(let[S,[w,E]]of r){if(S===y)continue;let U=du(p,S),_=U?p[S]:void 0;if(U&&(!d||_!==void 0)){let h=w.get(_);for(let b of x)E.has(b)&&!h?.has(b)&&x.delete(b)}}return Array.from(x).sort((S,w)=>S-w)}}else t=f=>{let p=u(OM(f));return s?p.filter(d=>i[d]===void 0||i[d]===f):p};return vM.set(e,t),t}var zr=class extends lt{_tag=\"Union\";types;options;encodingChecks;constructor(e,t,r,n,o,s,a){super(r,n,o,s),this.types=e,this.options=t,this.encodingChecks=a}getParser(e,t){let r=this,n=t!==void 0,o=[],s=i=>o[i]??=e(r.types[i]),a;return(i,c)=>{if(i===ge)return $r;let u=(a??=sp(r.types))(i,n);if(u.length===0)return P(new Ql(r,[],i,c));if(u.length===1){let f=s(u[0])(i,c);return f._tag===\"Success\"?f:Ne(f)?eF(r,f.cause,i,c):u6(r,f,i,c)}return tF(r,s,u,i,c)}}_rebuild(e,t,r){let n=Pi(this.types,e);return n===this.types&&t===this.checks&&r===this.encodingChecks?this:new zr(n,this.options,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let r of this.types){let n=r.matchPart(e,t);if(n!==void 0)return n}}getExpected(e){let t=this.annotations?.expected;if(typeof t==\"string\")return t;if(this.types.length===0)return\"never\";let r=this.types.map(n=>{let o=hn(n);switch(o._tag){case\"Arrays\":{let s=o.elements.filter(mu);if(s.length>0)return`${RM(o.isMutable)}[ ${s.map(a=>e(a)+PM(a.context?.isOptional)).join(\", \")}, ... ]`;break}case\"Objects\":{let s=o.propertySignatures.filter(a=>mu(a.type));if(s.length>0)return`{ ${s.map(a=>`${RM(a.type.context?.isMutable)}${wo(a.name)}${PM(a.type.context?.isOptional)}: ${e(a.type)}`).join(\", \")}, ... }`;break}}return e(o)});return Array.from(new Set(r)).join(\" | \")}};function eF(e,t,r,n){let o=Xl(t);return o?bs(new Ql(e,[o],r,n)):sn(t)}function u6(e,t,r,n){return rt(t,o=>eF(e,o,r,n))}function tF(e,t,r,n,o){let s={ast:e,parser:t,input:n,out:void 0,successes:e.options?.mode===\"oneOf\"?[]:void 0,issues:void 0,options:o},a=f6(s,r);if(!a)return s.out?s.out:P(new Ql(e,s.issues??[],n,o));if(Ne(a))return _M(a,s);let i=!0;return $(()=>i?(i=!1,_M(a,s)):tF(e,t,r,n,o))}function _M(e,t){return st(e,r=>t.out===qe?g(t.input):t.out?t.out:P(new Ql(t.ast,t.issues??[],t.input,t.options)))}var f6=km()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,r){if(r._tag===\"Failure\"){let n=Xl(r.cause);if(n===void 0)return r;e.issues?e.issues.push(n):e.issues=[n]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),bs(new wP(e.ast,e.successes,e.input,e.options));if(e.out=r,e.successes)e.successes.push(e.ast.types[t]);else return xt}}}),rF=new zr([new dn(\"Infinity\"),new dn(\"-Infinity\"),new dn(\"NaN\")]);function RM(e){return e?\"\":\"readonly \"}function PM(e){return e?\"?\":\"\"}var DI=class extends lt{_tag=\"Suspend\";thunk;constructor(e,t,r,n,o){if(r)throw new Error(\"Cannot add checks to Suspend\");super(t,void 0,n,o);let s;this.thunk=()=>s??=e()}getParser(e){let t;return(r,n)=>(t??=e(this.thunk()))(r,n)}recur(e){return new DI(()=>e(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(e){return e(this.thunk())}},Uh=class extends $s{_tag=\"Filter\";run;annotations;aborted;constructor(e,t=void 0,r=!1){super(),this.run=e,this.annotations=t,this.aborted=r}annotate(e){return new Uh(this.run,{...this.annotations,...e},this.aborted)}abort(){return new Uh(this.run,this.annotations,!0)}and(e,t){return new Ri([this,e],t)}},Ri=class extends $s{_tag=\"FilterGroup\";checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new Ri(this.checks,{...this.annotations,...e})}and(e,t){return new Ri([this,e],t)}};function Bh(e,t,r=!1){return new Uh((n,o,s)=>AP(o,e(n,o,s),n,s),t,r)}function jh(e,t){return new Uh((r,n,o)=>e(r)?void 0:new de(void 0,r,o),t,!0)}function LI(e){return Bh(t=>globalThis.Number.isFinite(t),{expected:\"a finite number\",representation:{id:\"effect/schema/isFinite\",payload:null},toJsonSchema:()=>({type:\"number\"}),toCode:()=>({runtime:\"Schema.isFinite()\"}),arbitraryConstraint:{number:\"finite\"},...e})}var $I=Vo(RI,[LI()]),l6=new at(new zr([$I,rF]),new ve(kh(),oe(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function ap(e,t){let r=new globalThis.RegExp(e),n={source:r.source,flags:r.flags};return Bh(o=>(r.lastIndex=0,r.test(o)),{expected:`a string matching the RegExp ${n.source}`,representation:{id:\"effect/schema/isPattern\",payload:n},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[n]},...t})}var II=new WeakMap;function ip(e,t){let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(n=>n===\"context\"||n===\"encoding\")&&II.set(r,Su(e)),r}function Su(e){let t=II.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return II.set(e,r),r}function We(e,t){return e.encoding===t?e:ip(e,{encoding:t})}function Mi(e,t){if(e.context===t)return e;let r=Su(e);return r.context===t&&r.encoding===e.encoding?r:ip(e,{context:t})}function bu(e){return e.encoding?bu(e.encoding[e.encoding.length-1].to):e}function to(e,t){if(e.checks){let r=e.checks[e.checks.length-1];return nF(e,$d(e.checks.slice(0,-1),r.annotate(t)))}return ip(e,{annotations:{...e.annotations,...t}})}function nF(e,t){if(e._tag===\"Suspend\"&&t)throw new Error(\"Cannot add checks to Suspend\");return e.checks===t?e:ip(e,{checks:t})}function Vo(e,t){return nF(e,FI(e.checks,t))}function Eu(e,t){let r=t(e.to);return r===e.to?e:new at(r,e.transformation)}function BI(e,t){let r=e,n=r[r.length-1],o=Eu(n,t);return o===n?e:$d(e.slice(0,e.length-1),o)}function jI(e){return t=>t.encoding?We(t,BI(t.encoding,e)):t}function zh(e,t){return jI(r=>Mi(r,t))(e)}function oF(e){function t(r){return r.encoding?We(r,BI(r.encoding,t)):e(r)}return Vr(t)}function Fi(e,t){function r(n){if(n.encoding){let o=n.encoding[n.encoding.length-1];return t?.stopAt?.(o)?n:We(n,BI(n.encoding,r))}return e(n)}return Pa(r)}function sF(e,t){return zI(e,t,yt(e))}function aF(e,t){return zI(hn(e),t,e)}function zI(e,t,r){let n=new at(e,t);return We(r,r.encoding?[...r.encoding,n]:[n])}function Pi(e,t){let r;for(let n=0;n{let t=e.context?e.context.isOptional===!1?new Ko(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Ko(!0,!1);return p6(Mi(e,t))}),p6=jI(Ni),iF=Vr(e=>Ni(new zr([e,vI]))),qI=Pa(e=>{let t=e.context?e.context.isMutable===!1?new Ko(e.context.isOptional,!0,e.context.constructorDefault,e.context.annotations):e.context:new Ko(!1,!0);return d6(Mi(e,t))}),d6=jI(qI);function cF(e,t){let r=e.context?new Ko(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new Ko(!1,!1,t);return Mi(e,r)}function ga(e,t,r){return zI(e,r,t)}function m6(e){let t=[],r=[];function n(o){switch(o._tag){case\"Literal\":id(o.literal)&&!t.includes(o.literal)&&t.push(o.literal);return;case\"UniqueSymbol\":t.includes(o.symbol)||t.push(o.symbol);return;case\"Never\":return;case\"Union\":for(let s=0;snew PI(o,t)),n.map(o=>new MI(o,t)))}function Qt(e){return e.context?.isOptional??!1}function fF(e){return e.context?.isMutable??!1}function lF(e){return e.annotations?.[Lr]===!0||e._tag===\"FilterGroup\"&&e.checks.every(lF)}function h6(e){function t(n){return lF(n)?[n]:n._tag===\"FilterGroup\"?n.checks.flatMap(t):[]}let r=e.flatMap(t);return or(r)?r:void 0}function x6(e){let t=!0;function r(n){return t=t&&!n.encoding&&!FM(n),t&&\"recur\"in n&&n.recur(r),n}return\"recur\"in e&&e.recur(r),t}var yt=Pa(e=>{let t=Su(e);if(t!==e){let n=yt(t);return n===t&&e.encoding===void 0?e:Mi(n,e.context)}let r=\"recur\"in e?e.recur(yt):e;if(\"encodingChecks\"in r&&r.encodingChecks){let n=x6(e)?r.encodingChecks:AI(r)||W4(r)||gu(r)&&r.typeParameters.length>0?h6(r.encodingChecks):void 0;return ip(r,{encodingChecks:void 0,checks:FI(r.checks,n)})}return r}),hn=Pa(e=>yt(mn(e)));function g6(e,t){let r=t,n=r.length,o=r[n-1],s=[new at(mn(We(e,void 0)),r[0].transformation.flip())];for(let i=1;i{if(e.encoding)return g6(e,e.encoding);let t=Su(e);if(t!==e){let r=mn(t);return r===t?e:Mi(r,e.context)}return\"flip\"in e?e.flip(mn):\"recur\"in e?e.recur(mn):e});function pF(e){switch(e._tag){case\"Undefined\":return!0;case\"Union\":return e.types.some(pF);default:return!1}}function qh(e,t){let r=t===0?qe:Zt(t);return(n,o)=>n===ge?$r:n===t?r:P(new ft(e,n,o))}function ro(e,t){return(r,n)=>r===ge?$r:t(r)?qe:P(new ft(e,r,n))}function dF(e,t,r){let n=e.encodedParts,o=e.literals,s=t.length;for(let u=0;us)return;let a=new Array(n.length),i;function c(u,f){if(u===n.length)return f===s;if(i?.has(u*(s+1)+f))return!1;let p=n[u];if(u===n.length-1){let d=t.slice(f);if(p.matchPart(d,r)!==void 0)return a[u]=d,!0}else if(p._tag===\"Literal\"){let d=o[u];if(t.startsWith(d,f)&&c(u+1,f+d.length))return a[u]=d,!0}else{let d=s-e.suffixLengths[u+1],m=o[u+1],x=m===void 0?d:t.lastIndexOf(m,d);for(;x>=f;){let y=t.slice(f,x);if(p.matchPart(y,r)!==void 0&&c(u+1,x))return a[u]=y,!0;if(x===0)break;x=m===void 0?x-1:t.lastIndexOf(m,x-1)}}return i??=new Set,i.add(u*(s+1)+f),!1}return c(0,0)?a:void 0}var HI=Fi(e=>{switch(e._tag){default:return e;case\"Number\":return e.toCodecStringTree();case\"Union\":return e.recur(HI)}}),Hh=Fi(e=>{switch(e._tag){default:return e;case\"Symbol\":case\"UniqueSymbol\":return e.toCodecStringTree();case\"Union\":return e.recur(Hh)}}),WI=Fi(e=>{switch(e._tag){default:return e;case\"Number\":case\"Literal\":case\"BigInt\":return e.toCodecStringTree();case\"Union\":return e.recur(WI)}}),mF=\"[\\\\s\\\\S]*?\",TI=new globalThis.RegExp(`^${Dh}$`),y6=new globalThis.RegExp(`^(?:${Dh}|Infinity|-Infinity|NaN)$`);function JI(e){return ap(TI,{expected:\"a string representing a finite number\",representation:{id:\"effect/schema/isStringFinite\",payload:null},toJsonSchema:()=>({pattern:TI.source}),...e})}var hF=Vo(pn,[JI()]),S6=new at(hF,pu),b6=new at(new zr([hF,rF]),pu),E6=\"-?\\\\d+\",wI=new globalThis.RegExp(`^${E6}$`);function KI(e){return ap(wI,{expected:\"a string representing a bigint\",representation:{id:\"effect/schema/isStringBigInt\",payload:null},toJsonSchema:()=>({pattern:wI.source}),...e})}var GI=Vo(pn,[KI({expected:\"a string representing a bigint\"})]),I6=new at(GI,Mh),T6=\"Symbol\\\\(([\\\\s\\\\S]*)\\\\)\",CI=new globalThis.RegExp(`^${T6}$`),w6=Vo(pn,[VI()]),xF=new at(w6,new ve(oe(e=>globalThis.Symbol.for(CI.exec(e)[1])),gt((e,t)=>globalThis.Symbol.keyFor(e)!==void 0?g(globalThis.String(e)):P(new Yl({message:\"cannot serialize to string, Symbol is not registered\"},e,t)))));function VI(e){return ap(CI,{expected:\"a string representing a symbol\",representation:{id:\"effect/schema/isStringSymbol\",payload:null},toJsonSchema:()=>({pattern:CI.source}),...e})}function no(e,t,r,n,o){for(let s=0;s0;){let o=n[n.length-1],s=o.keys;if(typeof s==\"number\"){if(o.index(e,t,r)=>Iu(e)?qe:P(new ft(t,e,r)),{representation:{id:\"effect/schema/Json\",payload:null},expected:\"JSON value\",toCodecJson:()=>{},toCodecStringTree:()=>YI}),bF=to(xu,{representation:{id:\"effect/schema/MutableJson\",payload:null}}),ZI=new at(xu,lu()),EF=new at(new zr([new Pn(!1,[],[xu]),new np([],[new MI(pn,xu)])]),lu());function k6(e){return SF(e,A6)}var v6=new yu([],()=>(e,t,r)=>k6(e)?qe:P(new ft(t,e,r)),{expected:\"StringTree\",toCodecStringTree:()=>{}}),YI=new at(v6,lu());var Wh=(e,t,r)=>e===qe?r(t):st(e,r);function TF(e){if(e._tag===\"Middleware\")return(r,n,o)=>{let s=r===qe?e.decode(Zt(Kl(n)),o):e.decode(Dr(r,Kl),o);return IF(s)};let t=e.decode;switch(t._tag){case\"Passthrough\":return(r,n)=>r===qe?Zt(n):r;case\"Transform\":{let r=n=>n===ge?$r:Zt(t.transform(n));return(n,o)=>Wh(n,o,r)}case\"TransformOptional\":{let r=n=>tI(t.transform(Kl(n)));return(n,o)=>Wh(n,o,r)}case\"TransformEffect\":return(r,n,o)=>Wh(r,n,s=>s===ge?$r:t.transform(s,o));case\"TransformOptionalEffect\":return(r,n,o)=>Wh(r,n,s=>IF(t.transform(Kl(s),o)))}}var IF=e=>st(e,tI),wF=(e,t,r,n)=>rt(n,o=>Is(()=>Ss(o,s=>new TP(e,s,t,r))));function O6(e,t){let r=TF(e.link.transformation),n;return(o,s)=>{if(o===ge)return $r;if(e.isConstructed(o))return qe;let a=(n??=t(e.link.to))(o,s);return r(a,o,s)}}function _6(e,t){let r=e.context.constructorDefault;return(n,o)=>{if(n!==ge&&n!==void 0)return t(n,o);let s=r;if(Ne(s)&&s._tag===\"Success\"){let a=t(s[ue],o);return a===qe?s:a}return st(wF(e,n,o,s),a=>{let i=t(a,o);return i===qe?Zt(a):i})}}function QI(e,t){let r=t(e);return e.context?.constructorDefault===void 0?r:_6(e,r)}function up(e,t,r,n,o){if(e._tag===\"Declaration\")for(let x of e.typeParameters)t(x);let s=r?yF(e):void 0,a=s?O6(s,t):n??e.getParser(t,r),i=e.checks,c=e.encoding,u=c?.map(x=>TF(x.transformation)),f=e.encodingChecks;if(!c&&!i&&!f)return a;let p,d=(x,y)=>{let S=a(x,y);if(f&&!y.disableChecks)if(Ne(S)){if(S._tag===\"Success\"){let w=S===qe?x:S[ue];if(x!==ge&&w!==ge){let E=no(f,x,void 0,e,y);E&&(S=P(new wt(e,E,x,y)))}}}else S=I(S,w=>{if(x!==ge&&w!==ge){let E=no(f,x,void 0,e,y);if(E)return P(new wt(e,E,x,y))}return g(w)});if(i&&!y.disableChecks)if(Ne(S)){if(S._tag===\"Success\"){let w=S===qe?x:S[ue];if(w===ge)return S;let E=no(i,w,void 0,e,y);E&&(S=P(new wt(e,E,w,y)))}}else S=I(S,w=>{if(w!==ge){let E=no(i,w,void 0,e,y);if(E)return P(new wt(e,E,w,y))}return g(w)});return S},m=o===void 0?d:o(d);return c?(x,y)=>{let S=p??=c.map(U=>t(U.to)),w=x,E=S[S.length-1](x,y);for(let U=c.length-1;U>=0;U--)if(E=u[U](E,w,y),U!==0){let _=S[U-1];E._tag===\"Success\"?(w=E[ue],E=_(w,y)):E=st(E,h=>{let b=_(h,y);return b===qe?Zt(h):b})}if(E._tag===\"Success\"){let U=E[ue],_=m(U,y);return _===qe?E:_}return E=wF(e,x,y,E),st(E,U=>{let _=m(U,y);return _===qe?Zt(U):_})}:m}var Gh=Symbol(),CF=new WeakMap,AF,Tu=!1;var P6=e=>Tu?Kh(gn,e,\"parser\"):gn(e).parser,kF=e=>Tu?Kh(gn,e,\"makeEffect\"):gn(e).makeEffect,M6=e=>QI(e,kF),Jh=class{ast;constructor(t){this.ast=t}get decodeEffect(){return this.cachedDecodeEffect??=up(this.ast,P6)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=up(this.ast,kF,M6)}},XI=class extends Jh{compiled;resolve;constructor(t,r,n){super(t),this.compiled=r,this.resolve=n}save(t,r){return Object.defineProperty(this,t,{value:r}),r}operation(t){let r=this.compiled;return typeof r==\"function\"?r(this.ast,this.resolve,t):r?.[t]}get is(){return this.save(\"is\",this.operation(\"is\"))}get decode(){return this.save(\"decode\",this.operation(\"decode\"))}get make(){return this.save(\"make\",this.operation(\"make\"))}get decodeEffect(){return this.save(\"decodeEffect\",this.operation(\"decodeEffect\")??up(this.ast,t=>Kh(this.resolve,t,\"parser\")))}get parser(){let t=this.decode;return t===void 0?this.decodeEffect:this.save(\"parser\",F6(t,()=>this.decodeEffect))}get makeEffect(){let t=this.operation(\"makeEffect\");if(t!==void 0)return this.save(\"makeEffect\",t);let r=n=>Kh(this.resolve,n,\"makeEffect\");return this.save(\"makeEffect\",up(this.ast,r,n=>QI(n,r)))}};function F6(e,t){let r;return(n,o)=>{if(n!==ge)try{let s=e(n,o);if(s!==Gh)return s===n?qe:Zt(s)}catch(s){return an(s)}return(r??=t())(n,o)}}function Kh(e,t,r){let n=e(t);if(n.compiled===void 0||Object.hasOwn(n,r))return n[r];let o;return(s,a)=>(o??=n[r])(s,a)}function gn(e){let t=CF.get(e);if(t!==void 0)return t;let r=AF===void 0?new Jh(e):new XI(e,AF(e,gn),gn);return CF.set(e,r),r}function tT(e){let t=e.ast,r;return(n,o)=>(r??=cT(q6,yt(t)))(n,o?.disableChecks?o?.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions)}function Zh(e){let t=tT(e);return(r,n)=>{let o=Wo(t(r,n));return Ve(o)?O(o.value):(ln(o.cause,\"Option adapter can only return none for schema issues\"),v())}}function Yh(e){return j6(yt(e.ast))}function rT(e){return Ui(e.ast)}function U6(e){if(!Tu){let o=wu(ex(e));return s=>{let a=o(s,Go);return Ve(a)?!0:(ln(a.cause,\"Type guard adapter can only return false for schema issues\"),!1)}}let t=gn(e),r=t.is;if(r!==void 0)return o=>{try{return r(o,Go)}catch(s){return ln(ci(s),\"Type guard adapter can only return false for schema issues\"),!1}};let n=t.parser;return o=>{let s=Wo(iT(n(o,Go),o));return Ve(s)?!0:(ln(s.cause,\"Type guard adapter can only return false for schema issues\"),!1)}}function Ui(e){let t=yt(e),r=n=>(r=U6(t),r(n));return n=>r(n)}function vF(e){let t=ex(e);return(r,n)=>{let o=Wo(t(r,n));if(!Ve(o))return ln(o.cause,\"Issue adapter can only return schema issues\")}}function OF(e,t){let r=yt(e.ast),n=gn(r).parser(t,Go),o=Wo(iT(n,t));if(Uo(o)){let s=ln(o.cause,\"Assertion adapter can only throw schema issues\");throw new Error(\"Schema validation failed\",{cause:s})}}function nt(e,t){let r=ex(e.ast);return t===void 0?r:(n,o)=>r(n,aT(t,o))}var nT=nt;function _F(e,t){return wu(nt(e,t))}function oT(e,t){return DF(nt(e,t))}var RF=oT;function PF(e,t){return LF(nt(e,t))}function D6(e,t){return Tu?$F(e.ast,t):uT(nt(e,t))}var Qh=D6;function Di(e,t){let r=ex(mn(e.ast));return t===void 0?r:(n,o)=>r(n,aT(t,o))}var MF=Di;function FF(e,t){return wu(Di(e,t))}function sT(e,t){return DF(Di(e,t))}var NF=sT;function UF(e,t){return LF(Di(e,t))}function L6(e,t){return Tu?$F(mn(e.ast),t):uT(Di(e,t))}var Xh=L6,aT=(e,t)=>t?{...e,...t}:e,Vh=e=>e===ge?P(new de):g(e);function ex(e){return cT(z6,e)}function iT(e,t){return e===qe?g(t):Ne(e)?e[ue]===ge?Vh(ge):e:st(e,Vh)}function cT(e,t){let r;return(n,o)=>{let s=(r??=e(t))(n,o??Go);return s===qe?g(n):Ne(s)?s[ue]===ge?Vh(ge):s:st(s,Vh)}}function wu(e){return(t,r)=>Wo(e(t,r))}function DF(e){let t=wu(e);return(r,n)=>{let o=t(r,n);return Ve(o)?O(o.value):(ln(o.cause,\"Option adapter can only return none for schema issues\"),v())}}function LF(e){let t=wu(e);return(r,n)=>{let o=t(r,n);return Ve(o)?B(o.value):W(ln(o.cause,\"Result adapter can only return schema issues\"))}}function $F(e,t){let r;return(n,o)=>(r??=$6(gn(e),t))(n,o)}function $6(e,t){let r=e.decode,n,o=r===void 0?(s,a=Go)=>(n??=eT(e))(s,a):(s,a=Go)=>{if(s===ge)return(n??=eT(e))(s,a);let i;try{i=r(s,a)}catch(c){throw ln(ci(c),\"Sync adapter can only throw schema issues\"),c}return i!==Gh?i:(n??=eT(e))(s,a)};return t===void 0?o:(s,a)=>o(s,aT(t,a))}function eT(e){return uT(cT(()=>e.decodeEffect,e.ast))}function uT(e){let t=wu(e);return(r,n)=>{let o=t(r,n);if(Ve(o))return o.value;let s=ln(o.cause,\"Sync adapter can only throw schema issues\");throw new Error(\"Schema validation failed\",{cause:s})}}function B6(e,t){let r=Wo(e);if(Ve(r))return r.value;let n=ln(r.cause,t);throw new Error(\"Schema validation failed\",{cause:n})}function j6(e){let t,r;return(n,o)=>{t??=gn(e);let s=o?.disableChecks?o.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions??Go,a=t.make;if(a!==void 0&&n!==ge){let c;try{c=a(n,s)}catch(u){throw ln(ci(u),\"Constructor adapter can only throw schema issues\"),u}if(c!==Gh&&c!==ge)return c}let i=(r??=t.makeEffect)(n,s);return B6(iT(i,n),\"Constructor adapter can only throw schema issues\")}}var z6=e=>gn(e).parser,q6=e=>gn(e).makeEffect;var tx=\"~effect/Schema/Schema\",BF=Symbol(),H6={[tx]:tx,get make(){let e=Yh(this);return Object.defineProperty(this,\"make\",{value:e,enumerable:!0}),e},get makeEffect(){let e=tT(this);return Object.defineProperty(this,\"makeEffect\",{value:e,enumerable:!0}),e},get makeOption(){let e=Zh(this);return Object.defineProperty(this,\"makeOption\",{value:e,enumerable:!0}),e},pipe(){return Z(this,arguments)},annotate(e){return this.rebuild(to(this.ast,e))},annotateKey(e){return this.rebuild(cp(this.ast,e))},check(...e){return this.rebuild(Vo(this.ast,e))},rebuild(e){return oo(e,this[BF])}};function oo(e,t){function r(){}let n=Object.setPrototypeOf(r,H6);return t&&(Object.hasOwn(t,\"name\")||Object.hasOwn(t,\"length\")||Object.hasOwn(t,\"__proto__\"))?Object.defineProperties(n,Object.getOwnPropertyDescriptors({...t})):Object.assign(n,t),n[BF]=t,n.ast=e,n}function fT(e){return e.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}function fp(e){return e.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}function lT(e){return encodeURI(fT(e)).replace(/#/g,\"%23\")}function pT(e){if(e.length===0||e===\"#\")return\"\";if(!e.startsWith(\"#\"))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,\"%\").replace(/#/g,\"%23\")!==t)return;let r=decodeURIComponent(t);return r.startsWith(\"/\")&&!/~(?:[^01]|$)/.test(r)?r:void 0}catch{return}}function zF(e){let t=pT(e);return t===void 0?void 0:t.length===0?[]:t.slice(1).split(\"/\").map(fp)}function qF(e){return e.reduce((t,r)=>`${t}/${lT(r)}`,\"#\")}var J6=\"http://json-schema.org/draft-07/schema#\",HF=\"https://json-schema.org/draft/2020-12/schema\";function WF(e,t){return e===t||e===(t.endsWith(\"#\")?t.slice(0,-1):`${t}#`)}function GF(e){return{dialect:\"draft-07\",...Y6(e,iG)}}function K6(e,t){return r(e,!1,!0);function r(n,o,s=!1){if(!fr(n))return n;let a=o||!s&&YF(n.$id),i={};for(let c of Object.keys(n)){let u=n[c],f=u;switch(c){case\"$defs\":case\"properties\":case\"patternProperties\":case\"dependentSchemas\":f=mT(u,p=>r(p,a))??u;break;case\"allOf\":case\"anyOf\":case\"oneOf\":case\"prefixItems\":f=Array.isArray(u)?u.map(p=>r(p,a)):u;break;case\"not\":case\"additionalProperties\":case\"propertyNames\":case\"unevaluatedProperties\":case\"items\":case\"contains\":case\"unevaluatedItems\":case\"if\":case\"then\":case\"else\":case\"contentSchema\":f=r(u,a)}M(i,c,f)}return t(i,a),i}}function VF(e,t){return K6(e,r=>{G6(r,t)})}function G6(e,t){typeof e.$ref==\"string\"&&M(e,\"$ref\",t(e.$ref,\"$ref\")),typeof e.$dynamicRef==\"string\"&&M(e,\"$dynamicRef\",t(e.$dynamicRef,\"$dynamicRef\"))}function mT(e,t){if(!fr(e))return;let r={};for(let n of Object.keys(e))M(r,n,t(e[n],n));return r}function V6(e,t,r){let n=new Map,o=[],s=dT;function a(d,m=[],x=[]){if(m.length===0&&t?.trackIds){let y=fr(d)?f(d):void 0;s=JF(y,dT)??dT}return u(d,m,x,{sourceRoot:[],targetRoot:[],uri:s})}function i(){for(let[d,m,x]of o){let y=m,S=ZF(m,x);if(S!==void 0){let w=zF(S.hash);if(S.hash=\"\",w!==void 0){let E=n.get(KF(S.href,w));E!==void 0&&(y=Z6(m,E))}}M(d,\"$ref\",y)}}let c=r(a);return i(),c;function u(d,m,x,y){if(typeof d==\"boolean\")return p(m,x,y),t?.booleanAdapter?.(d)??d;if(!fr(d))return d;let S=y,w=f(d);if(m.length>0&&t?.trackIds&&YF(w)){let _=JF(w,y.uri);_!==void 0&&(S={parent:y,sourceRoot:m,targetRoot:x,uri:_})}p(m,x,S);let E=S.uri,U={isDocumentRoot:m.length===0,schema(_,h,b=h){return u(_,[...m,h],[...x,b],S)},schemaAt(_,h,b){return u(_,[...m,...h],[...x,...b],S)},schemaArray(_,h,b=h){return Array.isArray(_)?_.map((T,C)=>u(T,[...m,h,String(C)],[...x,b,String(C)],S)):_},schemaMap(_,h,b=h){return fr(_)?mT(_,(T,C)=>u(T,[...m,h,C],[...x,b,C],S)):_},reference(_,h){typeof h==\"string\"?o.push([_,h,E]):M(_,\"$ref\",h)}};return e(d,U)}function f(d){return t?.ignoreRefSiblings===!0&&typeof d.$ref==\"string\"?void 0:d.$id}function p(d,m,x){x.parent!==void 0&&p(d,m,x.parent),n.set(KF(x.uri,d.slice(x.sourceRoot.length)),m.slice(x.targetRoot.length))}}var dT=\"https://effect.invalid/.json-schema/\";function ZF(e,t){return URL.canParse(e,t)?new URL(e,t):void 0}function JF(e,t){if(typeof e!=\"string\")return;let r=ZF(e,t);if(r!==void 0)return r.hash=\"\",r.href}function Z6(e,t){let r=e.indexOf(\"#\");return r===-1&&t.length===0?e:`${r===-1?e:e.slice(0,r)}${qF(t)}`}function KF(e,t){return`${e}\\0${JSON.stringify(t)}`}function YF(e){return typeof e==\"string\"&&e.length>0&&e[0]!==\"#\"}function Y6(e,t,r){return V6(t,{...r,trackIds:!0},n=>({schema:n(e.schema),definitions:mT(e.definitions,(o,s)=>n(o,[\"$defs\",s],[\"definitions\",s]))}))}var Q6=new Set([\"properties\",\"patternProperties\"]),X6=new Set([\"allOf\",\"anyOf\",\"oneOf\"]),eG=new Set([\"not\",\"additionalProperties\",\"propertyNames\",\"contains\",\"if\",\"then\",\"else\",\"contentSchema\"]);function tG(e,t,r,n,o,s=Q6){let a;if(s.has(t))a=n.schemaMap(r,t);else if(X6.has(t))a=n.schemaArray(r,t);else if(o.has(t))a=n.schema(r,t);else return!1;return M(e,t,a),!0}var QF=[\"$anchor\",\"$defs\",\"$dynamicAnchor\",\"$dynamicRef\",\"$vocabulary\",\"contentSchema\",\"dependentRequired\",\"dependentSchemas\",\"maxContains\",\"minContains\",\"prefixItems\",\"unevaluatedItems\",\"unevaluatedProperties\"],Iie=[...QF,\"deprecated\"],Tie=[...QF,\"$comment\",\"$id\",\"$schema\",\"const\",\"contains\",\"contentEncoding\",\"contentMediaType\",\"else\",\"examples\",\"if\",\"patternProperties\",\"propertyNames\",\"then\"],rG=/^[A-Za-z_][-A-Za-z0-9._]*$/,nG=/^[A-Za-z][-A-Za-z0-9._:]*$/;function Li(e,t,r){throw new Error(`Cannot convert JSON Schema keyword \"${e}\" to ${t}: ${r}`)}function oG(e,t,r,n){for(let o of t)Object.hasOwn(e,o)&&Li(o,r,`it is not active in ${n} but would become active in the target`)}var sG=[\"additionalItems\",\"definitions\",\"dependencies\"];function aG(e,t,r,n,o){r.isDocumentRoot?M(e,\"$schema\",WF(t,HF)?n:t):WF(t,HF)||Li(\"$schema\",o,\"an embedded resource cannot declare a different dialect\")}function iG(e,t){oG(e,sG,\"Draft-07\",\"Draft 2020-12\");let r={},n,o,s;for(let a of Object.keys(e)){let i=e[a];if(!tG(r,a,i,t,eG))switch(a){case\"$ref\":n=i;break;case\"$schema\":aG(r,i,t,J6,\"Draft-07\");break;case\"$id\":case\"$anchor\":break;case\"$defs\":M(r,\"definitions\",t.schemaMap(i,a,\"definitions\"));break;case\"prefixItems\":o=i;break;case\"items\":s=i;break;case\"dependentRequired\":case\"dependentSchemas\":case\"minContains\":case\"maxContains\":break;case\"$dynamicRef\":case\"$dynamicAnchor\":case\"$vocabulary\":case\"unevaluatedProperties\":case\"unevaluatedItems\":Li(a,\"Draft-07\",\"the target dialect has no equivalent\");case\"required\":if(Array.isArray(i)&&i.length===0)break;M(r,a,i);break;default:M(r,a,i)}}if(cG(r,o,s,t),Object.hasOwn(e,\"contains\")){let a=e.minContains,i=e.maxContains;(a!==void 0&&a!==1||i!==void 0)&&Li(\"minContains/maxContains\",\"Draft-07\",\"contains cardinality cannot be represented\"),Object.hasOwn(e,\"minContains\")&&M(r,\"minContains\",a)}else Object.hasOwn(e,\"minContains\")&&M(r,\"minContains\",e.minContains),Object.hasOwn(e,\"maxContains\")&&M(r,\"maxContains\",e.maxContains);return fG(e,r,t,\"draft-07\"),pG(e,r,\"$id\",\"Draft-07\"),uG(r,n,t),r}function cG(e,t,r,n){if(t===void 0){r!==void 0&&M(e,\"items\",n.schema(r,\"items\"));return}M(e,\"items\",n.schemaArray(t,\"prefixItems\",\"items\")),r!==void 0&&M(e,\"additionalItems\",n.schema(r,\"items\",\"additionalItems\"))}function uG(e,t,r){if(t!==void 0)if(typeof t==\"string\"&&Object.keys(e).length>0){let n={};r.reference(n,t),lG(e,n)}else r.reference(e,t)}function fG(e,t,r,n){let o=fr(e.dependentRequired)?e.dependentRequired:void 0,s=fr(e.dependentSchemas)?e.dependentSchemas:void 0;if(o===void 0&&s===void 0)return;let a={},i=new Set([...Object.keys(o??{}),...Object.keys(s??{})]);for(let c of i){let u=o?.[c],f=s?.[c],p=n===\"draft-04\"&&Array.isArray(u)&&u.length===0;f===void 0?p||M(a,c,u):u===void 0||p?M(a,c,r.schemaAt(f,[\"dependentSchemas\",c],[\"dependencies\",c])):M(a,c,{allOf:[r.schemaAt(f,[\"dependentSchemas\",c],[\"dependencies\",c,\"allOf\",\"0\"]),{required:u}]})}Object.keys(a).length>0&&M(t,\"dependencies\",a)}function lG(e,t){Array.isArray(e.allOf)?e.allOf.push(t):M(e,\"allOf\",[t])}function pG(e,t,r,n){let o=e.$id,s=e.$anchor;if(s===void 0){o!==void 0&&M(t,r,o);return}(typeof s!=\"string\"||!rG.test(s))&&Li(\"$anchor\",n,\"the anchor is not valid\"),nG.test(s)||Li(\"$anchor\",n,\"the anchor cannot be represented as a plain-name fragment identifier\"),o===void 0?M(t,r,`#${s}`):Li(\"$anchor\",n,\"it cannot be combined with the schema $id\")}function rx(e){return oo(Cu(e.ast),{schema:e})}var Cu=Fi(e=>{let t=mG(e,Cu),r=e.context;return t===e||r===void 0?t:zh(t,hT(r))});function hT(e){return e.constructorDefault===void 0?e:new Ko(e.isOptional,e.isMutable,void 0,e.annotations)}function tN(e){if(e.propertySignatures.some(t=>typeof t.name!=\"string\"))throw new globalThis.Error(\"Objects property names must be strings\",{cause:e})}function rN(e){return t=>{let r=[...t].sort((o,s)=>e(hn(o))-e(hn(s)));return r.some((o,s)=>o!==t[s])?r:t}}var dG=rN(e=>{switch(e._tag){case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function mG(e,t){switch(e._tag){case\"Declaration\":{let r=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Zr(r))return We(e,[ZI]);let n=e.typeParameters.map(s=>oo(hn(s))),o=r(n);return o===void 0?e:We(e,[Eu(o,t)])}case\"Unknown\":return We(e,[ZI]);case\"ObjectKeyword\":return We(e,[EF]);case\"Undefined\":case\"Void\":case\"Literal\":case\"Number\":return e.toCodecJson();case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return tN(e),e.recur(t,Hh);case\"Union\":{let r=dG(e.types);return r!==e.types?new zr(r,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}function nx(e){return oo(nN(yt(e.ast)))}var nN=Vr(e=>{let t=hG(e,nN);return t!==e&&e.context!==void 0?zh(t,hT(e.context)):t});function hG(e,t){switch(e._tag){case\"Declaration\":{let r=e.annotations?.toCodecIso??e.annotations?.toCodec;if(Zr(r)){let n=r(e.typeParameters.map(o=>oo(o)));return We(e,[Eu(n,t)])}return e}case\"Arrays\":case\"Objects\":case\"Union\":case\"Suspend\":return e.recur(t)}return e}function ox(e){return oo(iN(e.ast),{schema:e})}function oN(e){return oo(cN(e.ast))}var xG=rN(e=>{switch(e._tag){case\"Null\":case\"Boolean\":case\"Number\":case\"BigInt\":case\"Symbol\":case\"UniqueSymbol\":return 0;default:return 1}});function gG(e,t,r){switch(e._tag){case\"Declaration\":{let n=e.typeParameters.map(u=>oo(t(hn(u)))),o=e.annotations?.toCodecStringTree;if(Zr(o)){let u=o(n);return u===void 0?e:We(e,[Eu(u,t)])}let s=e.annotations?.toCodecJson,a=Zr(s)?s(n):void 0,i=a===void 0?e.annotations?.toCodec:void 0,c=a??(Zr(i)?i(n):void 0);return c===void 0?r(e):We(e,[Eu(c,t)])}case\"Null\":return We(e,[yG]);case\"Boolean\":return We(e,[SG]);case\"Unknown\":case\"ObjectKeyword\":return We(e,[YI]);case\"Enum\":case\"Number\":case\"Literal\":case\"UniqueSymbol\":case\"Symbol\":case\"BigInt\":return e.toCodecStringTree();case\"Objects\":return tN(e),e.recur(t,Hh);case\"Union\":{let n=xG(e.types);return n!==e.types?new zr(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case\"Arrays\":case\"Suspend\":return e.recur(t)}return e}var yG=new at(new dn(\"null\"),new ve(oe(()=>null),oe(()=>\"null\"))),SG=new at(new zr([new dn(\"true\"),new dn(\"false\")]),new ve(oe(e=>e===\"true\"),_i())),sN=new ve(oe(e=>typeof e==\"string\"?[e]:e),jr()),aN=e=>e.transformation===sN,iN=Fi(e=>{let t=gG(e,iN,r=>{throw new globalThis.Error(\"Missing structural codec for StringTree\",{cause:r})});return t!==e&&e.context!==void 0?zh(t,hT(e.context)):t},{stopAt:aN}),eN=e=>Qt(e)?Ni(eo):eo,cN=Fi(e=>{let t=bG(e);if(AI(t)){let r=ga(new zr([new Pn(t.isMutable,t.elements.map(eN),t.rest.map(eN)),pn],{mode:\"anyOf\"}),t,sN);return Qt(e)?Ni(r):r}return t},{stopAt:aN});function bG(e){return e._tag===\"Declaration\"||e._tag===\"Arrays\"||e._tag===\"Objects\"||e._tag===\"Union\"||e._tag===\"Suspend\"?e.recur(cN):e}var Cie=globalThis.RegExp;var ks=e=>e.replace(/[/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\");function ya(e,t){return t.length>0&&(e+=`\n at ${pd(t)}`),new Error(e)}function uN(e){return`#/$defs/${lT(e)}`}var EG=new Set([...EP,vi,...bP]);function pp(e,t){if(e===void 0)return;let r={},n=e.title;typeof n==\"string\"&&(r.title=n);let o=e.description,s=e.expected;typeof o==\"string\"?r.description=o:t?.generateDescriptions===!0&&typeof s==\"string\"&&(r.description=s);let a=e.default;Iu(a)&&(r.default=a);let i=e.examples;Array.isArray(i)&&Iu(i)&&(r.examples=i);let c=e.readOnly;typeof c==\"boolean\"&&(r.readOnly=c);let u=e.writeOnly;typeof u==\"boolean\"&&(r.writeOnly=u);let f=e.format;typeof f==\"string\"&&(r.format=f);let p=e.contentEncoding;typeof p==\"string\"&&(r.contentEncoding=p);let d=e.contentMediaType;typeof d==\"string\"&&(r.contentMediaType=d);let m=e.contentSchema;if(Iu(m)&&(r.contentSchema=m),t?.includeAnnotationKey!==void 0)for(let[x,y]of Object.entries(e))EG.has(x)||!t.includeAnnotationKey(x)||Iu(y)&&M(r,x,y);return Object.keys(r).length===0?void 0:r}function lN(e){let t=e.type===\"number\"||e.type===\"integer\"?e.type:void 0,r=e;if(t!==void 0&&(r={...e},delete r.type),Array.isArray(r.allOf)){let n=[],o=!1;for(let s of r.allOf){let a=lN(s);a.type!==void 0&&(o=!0,(t===void 0||a.type===\"integer\")&&(t=a.type)),Object.keys(a.schema).length>0&&n.push(a.schema)}if(o){let{allOf:s,...a}=r;r=n.length===0?a:{...a,allOf:n}}}return{type:t,schema:r}}function IG(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==\"number\")return!1;let t=e.anyOf[1];return t?.type===\"string\"&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(\"NaN\")&&t.enum.includes(\"Infinity\")&&t.enum.includes(\"-Infinity\")}var pN=\"|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|\";function sx(e,t){return Object.keys(e).every(r=>t.includes(`|${r}|`))}function fN(e,t){return typeof e.$ref!=\"string\"&&t.every(r=>!Object.hasOwn(e,r))}var yT=\"|title|description|default|examples|readOnly|writeOnly|\",TG=pN+yT;function dp(e,t,r){if(Object.keys(e).length===0)return t;let n=Object.keys(t);if(n.length===0)return e;let o=e.type===\"number\"||e.type===\"integer\"?e.type:void 0,s=IG(e);if(o!==void 0||s){let i=lN(t);if(i.type!==void 0){let c=o===\"integer\"||i.type===\"integer\"?\"integer\":\"number\",u={...e,type:c};s&&delete u.anyOf;let f=Object.keys(i.schema);return f.length===0?u:sx(i.schema,yT)&&fN(u,f)?{...u,...i.schema}:dp(u,i.schema,r)}}if(r&&fN(e,n))return{...e,...t};let a=Array.isArray(t.allOf)&&n.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...a]}:typeof e.$ref==\"string\"?{allOf:[e,...a]}:{...e,allOf:a}}function gT(e,t=new Set){return typeof e==\"boolean\"?e:t.has(e)?!0:(t.add(e),e.every(r=>gT(r,t)))}function wG(e){return Array.isArray(e)}function CG(e,t,r,n){let o=new Map,s=new Map,a=new WeakMap,i=new Map,c=new Map,u=Object.keys(r);for(let h of u)x(h,[\"references\",h]);let f=wn(e,(h,b)=>E(h,t[b],[]));for(let[h,b]of i.values())if(!gT(h))for(let T of b)Array.isArray(T.oneOf)&&(T.anyOf=T.oneOf,delete T.oneOf);for(let h of u){let b=r[h],T=S(b);if(T===void 0)continue;let C=o.get(h)[0],L=c.get(T),ee=L?.find(ye=>J(o.get(ye)[0],C));ee===void 0?L===void 0?c.set(T,[h]):L.push(h):s.set(h,ee)}let p=wn(f,y),d={};for(let h of u)s.has(h)||M(d,h,y(o.get(h)[0]));return{dialect:\"draft-2020-12\",schemas:p,definitions:d};function m(h){return Array.isArray(h.oneOf)&&i.get(h.oneOf)?.[1].push(h),h}function x(h,b){if(!Object.hasOwn(r,h))throw ya(`Invalid reference ${h}`,[...b,\"$ref\"]);let T=o.get(h);if(T!==void 0)return T;let C=[{},[]];return o.set(h,C),C[0]=E(r[h],[\"references\",h],C[1]),C}function y(h){return VF(h,b=>{let T=pT(b);if(T===void 0){if(/^#(?:\\/|%2f)/i.test(b))throw new Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(b)}`);return b}if(!T.startsWith(\"/$defs/\"))return b;let C=T.indexOf(\"/\",7),L=s.get(fp(T.slice(7,C<0?void 0:C)));return L===void 0?b:b.replace(/^#(?:\\/|%2f).*?(?:\\/|%2f).*?(?=\\/|%2f|$)/i,uN(L))})}function S(h){if(h._tag===\"Reference\")return;let b=h.checks.length===0?h.annotations:h.checks[h.checks.length-1].annotations;return typeof b?.identifier!=\"string\"&&typeof b?.[vi]==\"string\"?b[vi]:void 0}function w(h,b,T,C){let L=h.annotations,ee=L?.toJsonSchema;if(ee!==void 0){let Ze=h.representation?.schemas?.map((gf,X$)=>E(gf,[...T,\"representation\",\"schemas\",X$],C))??[],Ls=ee({type:b,schemas:Ze}),et=wG(Ls);et&&C.push(!1);let zt=et?Ls[0]:Ls,ur=pp(L,n),ss=ur===void 0?zt:{...zt,...ur},_a=ur===void 0?pN:TG;return[ss,h._tag===\"Filter\"&&sx(ss,_a)&&(ur===void 0||sx(ur,yT))?!0:void 0]}if(h._tag===\"Filter\"){C.push(!1);return}let ye=h.checks.flatMap((Ze,Ls)=>{let et=w(Ze,b,[...T,\"checks\",Ls],C);return et===void 0?[]:[et[0]]});if(ye.length===0)return;let _e=pp(L,n),Et={allOf:ye};return[_e===void 0?Et:{...Et,..._e}]}function E(h,b,T){if(h._tag===\"Reference\")return T.push(x(h.$ref,b)[1]),{$ref:uN(h.$ref)};let C=a.get(h);if(C!==void 0)return T.push(C[1]),C[0];let L=[];T.push(L);let ee=U(h,b,L),ye=pp(h.annotations,n);ye!==void 0&&(ee={...ee,...ye});for(let _e=0;_e{if(typeof ee==\"number\"&&!globalThis.Number.isFinite(ee))throw ya(`Invalid numeric enum value ${globalThis.String(ee)}`,[...b,\"enums\",ye,1]);return{type:typeof ee,enum:[ee],title:L}});return C.length===0?{not:{}}:{anyOf:C}}case\"TemplateLiteral\":return{type:\"string\",pattern:`^${h.parts.map(ax).join(\"\")}$`};case\"Arrays\":{if(h.rest.length>1)throw ya(\"Invalid schema representation document\",[...b,\"rest\"]);let C={type:\"array\"},L=h.elements.length,ee=h.elements.map((ye,_e)=>{ye.isOptional&&L--;let Et=E(ye.type,[...b,\"elements\",_e,\"type\"],T),Ze=pp(ye.annotations,n);return Ze===void 0?Et:m(dp(Et,Ze))});if(ee.length>0?(C.prefixItems=ee,C.maxItems=h.elements.length,L>0&&(C.minItems=L)):C.items=!1,h.rest.length===1){delete C.maxItems;let ye=E(h.rest[0],[...b,\"rest\",0],T);Object.keys(ye).length>0?C.items=ye:delete C.items}return C}case\"Objects\":{if(h.propertySignatures.length===0&&h.indexSignatures.length===0)return{not:{type:\"null\"}};let C={type:\"object\"},L={},ee=[];for(let et=0;et0&&(C.properties=L),ee.length>0&&(C.required=ee);let ye={},_e=[],Et=[],Ze=!1;for(let et=0;et0;if(Ls&&(C.patternProperties=ye),Ze&&n?.onExcessProperty===\"error\"){let et=[];h.propertySignatures.length>0&&et.push({enum:Object.keys(L)});for(let zt=0;zt0&&(C.allOf=_e.map(zt=>({type:\"object\",additionalProperties:zt})))}else _e.length===0?C.additionalProperties=Ze||n?.onExcessProperty!==\"error\":_e.length===1&&h.propertySignatures.length===0&&!Ls?C.additionalProperties=_e[0]:_e.length>0&&(C.allOf=_e.map(et=>({type:\"object\",additionalProperties:et})));return typeof C.additionalProperties==\"object\"&&C.additionalProperties!==null&&Object.keys(C.additionalProperties).length===0&&delete C.additionalProperties,C}case\"Union\":{let C=[],L=h.types.map((ye,_e)=>E(ye,[...b,\"types\",_e],C));if(T.push(C),L.length===0)return{not:{}};let ee=h.options?.mode??\"anyOf\";if(ee===\"anyOf\"&&L.length>1){let ye=kG(L);if(ye!==void 0)return ye}return ee===\"oneOf\"&&i.set(L,[C,[]]),{[ee]:L}}}}function _(h,b,T){switch(h._tag){case\"Reference\":{if(!Object.hasOwn(r,h.$ref))throw ya(`Invalid reference ${h.$ref}`,[...b,\"$ref\"]);if(x(h.$ref,b),T.has(h.$ref))return;let C=new Set(T).add(h.$ref);return _(r[h.$ref],[\"references\",h.$ref],C)}case\"String\":{if(h.checks.length===0)return[];if(h.checks.length!==1||h.checks[0]._tag!==\"Filter\"||h.checks[0].annotations?.toJsonSchema===void 0)return;let C=[],L=E(h,b,C);return gT(C)&&L.type===\"string\"&&typeof L.pattern==\"string\"&&sx(L,\"|type|pattern|title|description|default|examples|readOnly|writeOnly|\")?[L.pattern]:void 0}case\"TemplateLiteral\":return h.checks.length===0?[`^${h.parts.map(ax).join(\"\")}$`]:void 0;case\"Union\":{if(h.types.length===0||h.checks.length>0||h.options?.mode===\"oneOf\")return;let C=[];for(let L=0;Le;function so(e){return e===void 0?void 0:{annotations:e}}function mp(e,t){let{references:r,representations:n}=OG([e],t);return{representation:n[0],references:r}}function OG(e,t){let r={},n=new Map,o=new Set,s=new Map,a=new Set;for(let h of e)m(h);let i=t?.referencePolicy??vG;for(let h of s.values())for(let b of h.values()){let T=i({ast:b.ast,occurrences:b.occurrences,identifier:b.identifier});if(T!==void 0){let C=T===b.identifier||!T.endsWith(\"_\")?\"_\":\"\";b.reference=u(T,b,C)}else b.isRecursive&&(b.reference=u(`${b.ast._tag}_`,b,\"\"))}return{representations:wn(e,h=>y(h)),references:r};function u(h,b,T=\"_\"){let C=h,L=0;for(;n.has(C);){if(n.get(C)===b)return C;C=`${h}${T}${++L}`}return n.set(C,b),C}function f(h,b,T){let C=b.fallback;return C!==void 0?XE(h)===C?h:to(h,{[vi]:C}):T===b.identifier?h:to(h,{identifier:T})}function p(h,b){if(!Object.hasOwn(r,h)&&!o.has(h)){o.add(h);let T=S(b);o.delete(h),M(r,h,T)}return{_tag:\"Reference\",$ref:h}}function d(h){let b=bu(h),T=Su(b),C=iu(b),L=C===void 0?(b!==h?iu(h):void 0)??XE(b):void 0;L!==void 0&&(C=`${L}Encoded`);let ee=s.get(T);ee===void 0&&(ee=new Map,s.set(T,ee));let ye=ee.get(C);return ye===void 0&&(ye={ast:T,identifier:C,fallback:L,occurrences:0,isRecursive:!1,reference:void 0},ee.set(C,ye)),ye}function m(h){let b=d(h),T=b.ast;if(b.occurrences++,a.has(b)){b.isRecursive=!0;return}if(!(b.occurrences>1)){switch(a.add(b),x(T.checks),T._tag){case\"Declaration\":case\"Arrays\":case\"Objects\":case\"Union\":T.recur(C=>(m(C),C));break;case\"TemplateLiteral\":T.parts.forEach(m);break;case\"Suspend\":m(T.thunk());break}a.delete(b)}}function x(h){h?.forEach(b=>{b.annotations?.representation?.schemas?.forEach(T=>m(yt(T))),b._tag===\"FilterGroup\"&&x(b.checks)})}function y(h){let b=d(h),T=b.ast,C=b.reference;if(C!==void 0){let L=b.identifier===void 0?T:f(T,b,C);return p(C,L)}return S(T)}function S(h){let b=w(h.checks);switch(h._tag){case\"Declaration\":return{_tag:\"Declaration\",typeParameters:h.typeParameters.map(T=>y(T)),checks:b,...U(h.annotations)};case\"Null\":case\"Undefined\":case\"Void\":case\"Never\":case\"Unknown\":case\"Any\":case\"String\":case\"Boolean\":case\"Number\":case\"BigInt\":case\"Symbol\":case\"ObjectKeyword\":return{_tag:h._tag,checks:b,...so(h.annotations)};case\"Literal\":return{_tag:\"Literal\",literal:h.literal,checks:b,...so(h.annotations)};case\"UniqueSymbol\":return{_tag:\"UniqueSymbol\",symbol:h.symbol,checks:b,...so(h.annotations)};case\"Enum\":return{_tag:\"Enum\",enums:h.enums,checks:b,...so(h.annotations)};case\"TemplateLiteral\":return{_tag:\"TemplateLiteral\",parts:h.parts.map(T=>y(T)),checks:b,...so(h.annotations)};case\"Arrays\":return{_tag:\"Arrays\",elements:h.elements.map(T=>{let C=bu(T),L=C.context?.annotations;return{isOptional:Qt(C),type:y(T),...so(L)}}),rest:h.rest.map(T=>y(T)),checks:b,...so(h.annotations)};case\"Objects\":return{_tag:\"Objects\",propertySignatures:h.propertySignatures.map(T=>{let C=bu(T.type),L=C.context?.annotations;return{name:T.name,type:y(T.type),isOptional:Qt(C),isMutable:fF(C),...so(L)}}),indexSignatures:h.indexSignatures.map(T=>({parameter:y(T.parameter),type:y(T.type)})),checks:b,...so(h.annotations)};case\"Union\":return{_tag:\"Union\",types:h.types.map(T=>y(T)),...h.options===void 0?{}:{options:h.options},checks:b,...so(h.annotations)};case\"Suspend\":return{_tag:\"Suspend\",checks:[],thunk:y(h.thunk()),...so(h.annotations)}}}function w(h){return h?.map(E)??[]}function E(h){switch(h._tag){case\"Filter\":return{_tag:\"Filter\",aborted:h.aborted,..._(h.annotations)};case\"FilterGroup\":return{_tag:\"FilterGroup\",checks:wn(h.checks,E),..._(h.annotations)}}}function U(h){if(h===void 0)return;let{representation:b,...T}=h;return{...b===void 0?void 0:{representation:b},...Object.keys(T).length===0?void 0:{annotations:T}}}function _(h){if(h===void 0)return;let{representation:b,...T}=h,C=b===void 0?void 0:b.schemas===void 0?b:{...b,schemas:b.schemas.map(L=>y(yt(L)))};return{...C===void 0?void 0:{representation:C},...Object.keys(T).length===0?void 0:{annotations:T}}}}function hN(e){return Ve(e)?e.value:{issues:[{message:cb(e.cause)}]}}function gN(e,t){let r=nt(e),n={errors:\"all\",...t?.parseOptions},o=OP(t),s=a=>{let i=new Qa(\"sync\"),c=Nl(Zb(r(a,n),{onFailure:o,onSuccess:f=>({value:f})}),{scheduler:i});c.currentDispatcher?.flush();let u=c.pollUnsafe();return u?hN(u):new Promise(f=>{c.addObserver(p=>{f(hN(p))})})};if(Object.hasOwn(e,\"~standard\")){let a=e;return\"validate\"in a[\"~standard\"]||Object.assign(a[\"~standard\"],{validate:s}),a}return Object.assign(e,{\"~standard\":{version:1,vendor:\"effect\",validate:s}})}function _G(e){let t=mp(Cu(e));return ix(t)}function xN(e,t){let r=_G(e);if(t===\"draft-2020-12\"){let n=r.schema;return Object.keys(r.definitions).length>0&&(n.$defs=r.definitions),n}else if(t===\"draft-07\"){let n=GF(r),o=n.schema;return Object.keys(n.definitions).length>0&&(o.definitions=n.definitions),o}throw new globalThis.Error(`Unsupported target: ${t}`)}function yN(e){let t={input(r){return xN(e.ast,r.target)},output(r){return xN(yt(e.ast),r.target)}};if(Object.hasOwn(e,\"~standard\")){let r=e;return\"jsonSchema\"in r[\"~standard\"]||Object.assign(r[\"~standard\"],{jsonSchema:t}),r}return Object.assign(e,{\"~standard\":{version:1,vendor:\"effect\",jsonSchema:t}})}function bN(e,t){let r=[];return ST(e,t,\"\",r),r}function ST(e,t,r,n){if(!Object.is(e,t)){if(Array.isArray(e)&&Array.isArray(t)){let o=e.length,s=t.length,a=Math.min(o,s);for(let i=0;i=s;i--)n.push({op:\"remove\",path:`${r}/${i}`});for(let i=o;ii)throw new Error(`Array index out of bounds at \"${t.path}\".`);let c=o.slice();return t.op===\"add\"?c.splice(a,0,t.value):t.op===\"remove\"?c.splice(a,1):c[a]=t.value,SN(s,c)}if(cx(o)){if(t.op!==\"add\"&&!Object.hasOwn(o,n))throw new Error(`Property \"${n}\" does not exist at \"${t.path}\".`);let a={...o};return t.op===\"remove\"?delete a[n]:M(a,n,t.value),SN(s,a)}throw new Error(`Cannot ${t.op} at \"${t.path}\" (parent not found or not a container).`)}function FG(e,t){let r=PG(t);if(r.length===0)return null;let n=r[r.length-1],o=[],s=e;for(let a=0;a=s.length)return null;o.push({container:s,token:c}),s=s[c];continue}if(cx(s)){if(!Object.hasOwn(s,i))return null;o.push({container:s,token:i}),s=s[i];continue}return null}return{stack:o,parent:s,lastToken:n}}function SN(e,t){let r=t;for(let n=e.length-1;n>=0;n--){let{container:o,token:s}=e[n];if(Array.isArray(o)){let a=o.slice();a[s]=r,r=a}else{let a={...o};M(a,s,r),r=a}}return r}function wN(e){let t=rx(e),r=Xh(t),n=Qh(t);return{empty:[],diff:(o,s)=>bN(r(o),r(s)),combine:(o,s)=>[...o,...s],patch:(o,s)=>{let a=r(o),i=EN(s,a);return Object.is(i,a)?o:n(i)}}}function CN(e,t){let r=iu(e.ast)??eI(e.ast),n=MF(ox(e));return o=>n(o).pipe(j(s=>UG(s,{rootName:r,...t})))}function UG(e,t){let r=t.rootName??\"root\",n=t.arrayItemName??\"item\",o=t.pretty??!0,s=t.indent??\" \",a=t.sortKeys??!0,i=new Set,c=[];return f(r,e,0),c.join(o?`\n`:\"\");function u(p,d){c.push(o?s.repeat(p)+d:d)}function f(p,d,m,x){let{attrs:y,safe:S}=Au.tagInfo(p,x);if(d===void 0)u(m,`<${S}${y}/>`);else if(typeof d==\"string\")u(m,`<${S}${y}>${Au.escapeText(d)}`);else if(typeof d!=\"object\"||d===null)u(m,`<${S}${y}>${Au.escapeText(F(d))}`);else{if(i.has(d))throw new globalThis.Error(\"Cycle detected while serializing to XML.\",{cause:d});i.add(d);try{if(globalThis.Array.isArray(d)){if(d.length===0){u(m,`<${S}${y}/>`);return}u(m,`<${S}${y}>`);for(let U of d)f(n,U,m+1);u(m,``);return}let w=d,E=Object.keys(w);if(a&&E.sort(),E.length===0){u(m,`<${S}${y}/>`);return}u(m,`<${S}${y}>`);for(let U of E)f(Au.parseTagName(U).safe,w[U],m+1,U);u(m,``)}finally{i.delete(d)}}}}var Au={escapeText(e){return e.replace(/&/g,\"&\").replace(//g,\">\")},escapeAttribute(e){return e.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(//g,\">\")},parseTagName(e){let t=e,r=e;return/^[A-Za-z_]/.test(r)||(r=\"_\"+r),r=r.replace(/[^A-Za-z0-9._-]/g,\"_\"),/^xml/i.test(r)&&(r=\"_\"+r),{safe:r,changed:r!==t}},tagInfo(e,t){let{changed:r,safe:n}=Au.parseTagName(e),s=r||t&&t!==e?` data-name=\"${Au.escapeAttribute(t??e)}\"`:\"\";return{safe:n,attrs:s}}};var bT=Vr(e=>Sa(e));function Sa(e){let t=As(e)?.toEquivalence;if(t)return t(gu(e)?e.typeParameters.map(Sa):[]);switch(e._tag){case\"Never\":return Ja();case\"Declaration\":return LG(e);case\"Null\":case\"Undefined\":case\"Void\":case\"Unknown\":case\"Any\":case\"String\":case\"Number\":case\"Boolean\":case\"BigInt\":case\"Symbol\":case\"Literal\":case\"UniqueSymbol\":case\"ObjectKeyword\":case\"Enum\":case\"TemplateLiteral\":return J;case\"Arrays\":{let r=e.elements.map(Sa),n=e.rest.map(Sa),[o,...s]=n,a=s.length;return nr((i,c)=>{if(!Array.isArray(i)||!Array.isArray(c))return!1;let u=i.length;if(u!==c.length)return!1;let f=0;for(;f0){for(;fSa(o.type)),n=e.indexSignatures.map(o=>Sa(o.type));return nr((o,s)=>{if(!fr(o)||!fr(s))return!1;for(let a=0;a[Ui(s),Sa(e.types[a])]);return nr((s,a)=>{let i=n(s,!1);for(let c=0;c(r??=bT(e.thunk()))(n,o))}}}function LG(e){let t=e.annotations?.representation;if(t===void 0)return J;switch(t.id){case\"effect/schema/Option\":{let[r]=$i(e);return(n,o)=>n._tag===o._tag&&(n._tag===\"None\"||r(n.value,o.value))}case\"effect/schema/Result\":{let[r,n]=$i(e);return(o,s)=>o._tag===s._tag&&(o._tag===\"Success\"?r(o.success,s.success):n(o.failure,s.failure))}case\"effect/schema/CauseReason\":{let[r,n]=$i(e);return kN(r,n)}case\"effect/schema/Cause\":{let[r,n]=$i(e);return AN(r,n)}case\"effect/schema/Exit\":{let[r,n,o]=$i(e),s=AN(n,o);return(a,i)=>a._tag===i._tag&&(a._tag===\"Success\"?r(a.value,i.value):s(a.cause,i.cause))}case\"effect/schema/ReadonlyMap\":{let[r,n]=$i(e);return ld(r,n)}case\"effect/schema/ReadonlySet\":return wf($i(e)[0]);case\"effect/schema/RegExp\":return(r,n)=>r.source===n.source&&r.flags===n.flags;case\"effect/schema/URL\":return(r,n)=>r.toString()===n.toString();default:return J}}function $i(e){return e.typeParameters.map(Sa)}function kN(e,t){return(r,n)=>{if(r._tag!==n._tag)return!1;switch(r._tag){case\"Fail\":return e(r.error,n.error);case\"Die\":return t(r.defect,n.defect);case\"Interrupt\":return r.fiberId===n.fiberId}}}function AN(e,t){let r=Sd(kN(e,t));return(n,o)=>r(n.reasons,o.reasons)}function ON(e,t){return r=>{switch(r._tag){case\"Fail\":return`Fail(${e(r.error)})`;case\"Die\":return`Die(${t(r.defect)})`;case\"Interrupt\":return\"Interrupt\"}}}function vN(e,t){let r=ON(e,t);return n=>`Cause([${n.reasons.map(r).join(\", \")}])`}function _N(e,t){let r=new Map;return n(e);function n(a){let i=r.get(a);return i===void 0&&(i=o(a),r.set(a,i)),i}function o(a){let i=As(a)?.toFormatter;if(typeof i==\"function\")return i(gu(a)?a.typeParameters.map(n):[]);if(t?.onBefore){let c=t.onBefore(a,n);if(c!==void 0)return c}return s(a)}function s(a){switch(a._tag){default:return F;case\"Never\":return()=>\"never\";case\"Void\":return()=>\"void\";case\"Declaration\":{let i=a.annotations?.representation;if(i===void 0)return F;let c=a.typeParameters.map(n);switch(i.id){case\"effect/schema/Option\":{let[u]=c;return Wt({onNone:()=>\"none()\",onSome:f=>`some(${u(f)})`})}case\"effect/schema/Result\":{let[u,f]=c;return wr({onSuccess:p=>`success(${u(p)})`,onFailure:p=>`failure(${f(p)})`})}case\"effect/schema/CauseReason\":return ON(c[0],c[1]);case\"effect/schema/Cause\":return vN(c[0],c[1]);case\"effect/schema/Exit\":{let[u,f,p]=c,d=vN(f,p);return m=>{switch(m._tag){case\"Success\":return`Exit.Success(${u(m.value)})`;case\"Failure\":return`Exit.Failure(${d(m.cause)})`}}}case\"effect/schema/ReadonlyMap\":{let[u,f]=c;return p=>{let d=p.size;if(d===0)return\"ReadonlyMap(0) {}\";let m=globalThis.Array.from(p.entries()).sort().map(([x,y])=>`${u(x)} => ${f(y)}`);return`ReadonlyMap(${d}) { ${m.join(\", \")} }`}}case\"effect/schema/HashMap\":{let[u,f]=c;return p=>{let d=VR(p);if(d===0)return\"HashMap(0) {}\";let m=zl(p).sort().map(([x,y])=>`${u(x)} => ${f(y)}`);return`HashMap(${d}) { ${m.join(\", \")} }`}}case\"effect/schema/ReadonlySet\":{let[u]=c;return f=>{let p=f.size;if(p===0)return\"ReadonlySet(0) {}\";let d=globalThis.Array.from(f.values()).sort().map(m=>`${u(m)}`);return`ReadonlySet(${p}) { ${d.join(\", \")} }`}}case\"effect/schema/HashSet\":{let[u]=c;return f=>{let p=eP(f);if(p===0)return\"HashSet(0) {}\";let d=globalThis.Array.from(f).sort().map(m=>`${u(m)}`);return`HashSet(${p}) { ${d.join(\", \")} }`}}case\"effect/schema/Chunk\":{let[u]=c;return f=>{let p=IR(f);if(p===0)return\"Chunk(0) {}\";let d=globalThis.Array.from(f).sort().map(m=>`${u(m)}`);return`Chunk(${p}) { ${d.join(\", \")} }`}}default:return F}}case\"Arrays\":{let i=a.elements.map(d=>n(d)),c=a.rest.map(n),[u,...f]=c,p=f.length;return d=>{let m=[],x=0;for(;x0){for(;xn(u.type)),c=a.indexSignatures.map(u=>n(u.type));return a.propertySignatures.length===0&&a.indexSignatures.length===0?F:u=>{let f=[],p=new Set;for(let d=0;d0?\"{ \"+f.join(\", \")+\" }\":\"{}\"}}case\"Union\":{let i=yt(a).types,c=sp(i),u=i.map((f,p)=>[Ui(f),n(a.types[p])]);return f=>{let p=c(f,!1);for(let d=0;d(i??=n(a.thunk()))(c)}}}}var ET=l(2,(e,t)=>wT(e,(r,n)=>PN(t,r)?[r,n]:void 0)),IT=l(2,(e,t)=>wT(e,(r,n)=>PN(t,r)?void 0:[r,n])),RN=l(2,(e,t)=>({...e,...t}));var TT=l(2,(e,t)=>wT(e,(r,n)=>[Object.hasOwn(t,r)?t[r]:r,n]));var mr=e=>e;function PN(e,t){return e.some(r=>r===t||typeof r==\"number\"&&String(r)===t)}function wT(e,t){let r={};for(let n of Reflect.ownKeys(e)){if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;let o=t(n,e[n]);if(o){let[s,a]=o;M(r,s,a)}}return r}function NN(e,t){return ao(ku(\"Iso\",e,t))}function MN(e,t){return ao(ku(\"Lens\",e,t))}function ku(e,t,r){return[{_tag:\"PrimitiveNode\",kind:e,get:t,set:r}]}var jG={kind:\"Iso\",get:R,set:R},ux=class{_tag=\"PathNode\";kind=\"Lens\";path;get;set;constructor(t){this.path=t,this.get=r=>{let n=r;for(let o=0;o{let o=fx(n),s=o,a=0;for(;agF(t,r)}};function Bi(e,t){if(e.length===0)return t;if(t.length===0)return e;let r=e.slice();for(let n=0;nr)}modify(t){return r=>Lf(Lt(this.getResult(r),n=>this.replaceResult(t(n),r)),()=>r)}compose(t){return ao(Bi(this.node,t.node))}key(t){return ao(Bi(this.node,[new ux([t])]))}optionalKey(t){return ao(Bi(this.node,ku(\"Lens\",r=>r[t],(r,n)=>{let o=fx(n);return r===void 0?Array.isArray(o)&&(typeof t==\"number\"||typeof t==\"string\"&&Cc(t))?o.splice(Number(t),1):delete o[t]:M(o,t,r),o})))}check(...t){return ao(Bi(this.node,[new hp(t)]))}refine(t,r){return ao(Bi(this.node,[new hp([jh(t,r)])]))}tag(t){let r=W(new de({expected:`${JSON.stringify(t)} tag`}));return ao(Bi(this.node,ku(\"Prism\",n=>n._tag===t?B(n):r,R)))}at(t,...r){let n=W(new ut([t],new ma(void 0)));return ao(Bi(this.node,ku(\"Optional\",o=>Object.hasOwn(o,t)?B(o[t]):n,(o,s)=>{if(Object.hasOwn(s,t)){let a=fx(s);return M(a,t,o),B(a)}else return n})))}pick(t){return this.compose(MN(ET(t),(r,n)=>({...IT(n,t),...r})))}omit(t){return this.compose(MN(IT(t),(r,n)=>({...ET(n,t),...r})))}notUndefined(){return this.refine(Io,{expected:\"a value other than `undefined`\"})}forEach(t){let r=t(lx());return zG(n=>Tr(this.getResult(n),o=>{let s=[];for(let a=0;aLt(this.getResult(o),s=>{let a=[];for(let c=0;cLf(Lt(this.getResult(r),n=>this.replaceResult(n.map(t),r)),()=>r)}},AT=class extends vu{get;set;constructor(t,r,n){super(t,o=>B(r(o)),o=>B(n(o))),this.get=r,this.set=n}replace(t,r){return this.set(t)}modify(t){return r=>this.set(t(this.get(r)))}},kT=class extends vu{get;constructor(t,r,n){super(t,o=>B(r(o)),(o,s)=>B(n(o,s))),this.get=r,this.replace=n}modify(t){return r=>this.replace(t(this.get(r)),r)}},vT=class extends vu{set;constructor(t,r,n){super(t,r,(o,s)=>B(n(o))),this.set=n}replace(t,r){return this.set(t)}modify(t){return r=>Lf(Tr(this.getResult(r),n=>this.set(t(n))),()=>r)}};function ao(e){let t=e[0]??jG;if(e.length>1){let r=e.reduce((n,o)=>WG(n,o.kind),\"Iso\");t={kind:r,get:qG(e,r),set:HG(e,r)}}switch(t.kind){case\"Iso\":return new AT(e,t.get,t.set);case\"Lens\":return new kT(e,t.get,t.set);case\"Prism\":return new vT(e,t.get,t.set);case\"Optional\":return new vu(e,t.get,t.set)}}function fx(e){if(Array.isArray(e))return e.slice();if(typeof e==\"object\"&&e!==null){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw new Error(\"Cannot clone object with non-Object constructor or null prototype\");return{...e}}return e}function qG(e,t){return r=>{for(let n=0;n{for(let n=e.length-1;n>=0;n--)r=e[n].set(r);return r}:(r,n)=>{let o=e.length,s=new Array(o);for(let a=0;a=0;a--){let i=e[a];if(FN(i.kind))r=i.set(r);else if(i.kind===\"Lens\")r=i.set(r,s[a]);else{let c=i.set(r,s[a]);if(ce(c))return c;r=c.success}}return t===\"Optional\"?B(r):r}}function OT(e){return e===\"Prism\"||e===\"Optional\"}function FN(e){return e===\"Iso\"||e===\"Prism\"}function WG(e,t){return e===\"Iso\"?t:t===\"Iso\"||e===t?e:\"Optional\"}var JG=ao([]);function lx(){return JG}function DN(e){let t=nx(e);return NN(Xh(t),Qh(t))}function LN(e){return lx()}function $N(e){return lx()}var Ou=\"~effect/Schema/SchemaError\";function BN(e){return k(e,Ou)&&e[Ou]===Ou}var yn=\"~effect/net/NetAddress\";var io=e=>e.value,co=e=>e,vs=e=>e.bytes,ji=class extends Fr(\"NetAddressError\"){},_u=e=>k(e,yn),hr=e=>_u(e)&&e._tag===\"Ipv4Address\",Yo=e=>_u(e)&&e._tag===\"Ipv6Address\",jN=e=>hr(e)||Yo(e),Ru=e=>hr(e)?32:128,Pu=e=>_u(e)&&e._tag===\"MacAddress\",gp=e=>_u(e)&&e._tag===\"InetAddressV4\",yp=e=>_u(e)&&e._tag===\"InetAddressV6\",_T=e=>gp(e)||yp(e),px=e=>_u(e)&&e._tag===\"UnixPathAddress\",zN=e=>_T(e)||px(e),GG={_tag:\"Ipv4Address\",[yn]:yn,[ae](e){return hr(e)&&io(this)===io(e)},[se](){return qt(le(QG,io(this)|0))},toString(){return uo(this)},toJSON(){return this.toString()},[Te](){return this.toJSON()}},VG={_tag:\"Ipv6Address\",[yn]:yn,[ae](e){if(!Yo(e))return!1;let t=co(this),r=co(e);return t.w0===r.w0&&t.w1===r.w1&&t.w2===r.w2&&t.w3===r.w3},[se](){let e=co(this),t=le(XG,e.w0|0);return t=le(t,e.w1|0),t=le(t,e.w2|0),qt(le(t,e.w3|0))},toString(){return uo(this)},toJSON(){return this.toString()},[Te](){return this.toJSON()}},ZG={_tag:\"MacAddress\",[yn]:yn,[ae](e){return Pu(e)&&YG(vs(this),vs(e))},[se](){return le(e3,To(vs(this)))},toString(){return PT(this)},toJSON(){return this.toString()},[Te](){return this.toJSON()}},YG=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r{let t=Object.create(GG);return t.value=e>>>0,Object.freeze(t)},r3=(e,t,r,n)=>{let o=Object.create(VG);return o.w0=e>>>0,o.w1=t>>>0,o.w2=r>>>0,o.w3=n>>>0,Object.freeze(o)},n3=(e,t,r,n)=>(e<<24|t<<16|r<<8|n)>>>0;var xp=e=>[e>>>24,e>>>16&255,e>>>8&255,e&255],o3=e=>{let t=Object.assign(Object.create(ZG),{bytes:new Uint8Array(e)});return Object.freeze(t)};var St=(e,t)=>W(new ji({input:e,message:t})),s3=e=>e.every(t=>Number.isInteger(t)&&t>=0&&t<=255)?B(t3(n3(e[0],e[1],e[2],e[3]))):St(e,\"octets must be integers from 0 through 255\"),a3=e=>e.every(t=>Number.isInteger(t)&&t>=0&&t<=65535)?B(r3(e[0]*65536+e[1],e[2]*65536+e[3],e[4]*65536+e[5],e[6]*65536+e[7])):St(e,\"segments must be integers from 0 through 65535\");var qN=e=>/^(?:[0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$/.test(e)?B(o3(new Uint8Array(e.split(\":\").map(t=>Number.parseInt(t,16))))):St(e,\"expected six two-digit hexadecimal octets separated by colons\");var Mu=e=>{let t=e.split(\".\");if(t.length!==4||t.some(n=>!/^\\d{1,3}$/.test(n)))return St(e,\"expected exactly four decimal octets\");if(t.some(n=>n.length>1&&n[0]===\"0\"))return St(e,\"leading zeroes are not allowed\");let r=t.map(Number);return r.some(n=>n>255)?St(e,\"octets must be at most 255\"):s3([r[0],r[1],r[2],r[3]])},i3=e=>{if(e.includes(\"[\")||e.includes(\"]\")||e.includes(\"%\"))return St(e,\"brackets and zone identifiers are not valid in a bare IPv6 address\");let t=e.split(\"::\");if(t.length>2)return St(e,\"only one compression marker is allowed\");let r=t[0]===\"\"?[]:t[0].split(\":\"),n=t.length===2&&t[1]!==\"\"?t[1].split(\":\"):[];if(r.some(f=>f===\"\")||n.some(f=>f===\"\"))return St(e,\"empty segments are only valid in the compression marker\");let o=n.length>0?n[n.length-1]:r.length>0?r[r.length-1]:\"\",s;if(o.includes(\".\")){if(t.length===2&&n.length===0)return St(e,\"embedded IPv4 syntax must be trailing\");let f=Tr(Mu(o),p=>{let d=io(p);return[d>>>16,d&65535]});if(ce(f))return f;s=f.success,n.length>0?n.pop():r.pop()}let a=r.length+n.length+(s?2:0);if(t.length===1?a!==8:a>=8)return St(e,t.length===1?\"expected eight segments\":\"compression must replace at least one segment\");let i=f=>/^[0-9a-fA-F]{1,4}$/.test(f)?Number.parseInt(f,16):void 0,c=r.map(i),u=n.map(i);return c.some(f=>f===void 0)||u.some(f=>f===void 0)?St(e,\"segments must contain one through four hexadecimal digits\"):B([...c,...Array(8-a).fill(0),...u,...s??[]])},Sp=e=>Lt(i3(e),t=>a3(t)),bp=e=>e.includes(\":\")?Sp(e):Mu(e);var RT=e=>xp(io(e)),c3=e=>{let{w0:t,w1:r,w2:n,w3:o}=co(e);return[t>>>16,t&65535,r>>>16,r&65535,n>>>16,n&65535,o>>>16,o&65535]},HN=e=>{let{w0:t,w1:r,w2:n,w3:o}=co(e);return[...xp(t),...xp(r),...xp(n),...xp(o)]};var PT=e=>Array.from(vs(e),t=>t.toString(16).padStart(2,\"0\")).join(\":\"),dx=e=>vs(e).every(t=>t===255),u3=e=>(vs(e)[0]&1)!==0,mx=e=>(vs(e)[0]&1)===0,MT=e=>(vs(e)[0]&2)!==0,FT=e=>(vs(e)[0]&2)===0;var uo=e=>{if(hr(e))return RT(e).join(\".\");let t=c3(e);if(f3(e))return`::ffff:${t[6]>>8}.${t[6]&255}.${t[7]>>8}.${t[7]&255}`;let r=-1,n=0,o=-1;for(let i=0;i<=8;i++)i<8&&t[i]===0?o===-1&&(o=i):o!==-1&&(i-o>n&&(r=o,n=i-o),o=-1);if(n<2)return t.map(i=>i.toString(16)).join(\":\");let s=t.slice(0,r).map(i=>i.toString(16)).join(\":\"),a=t.slice(r+n).map(i=>i.toString(16)).join(\":\");return`${s}::${a}`},hx=e=>{if(hr(e))return io(e)===0;let{w0:t,w1:r,w2:n,w3:o}=co(e);return t===0&&r===0&&n===0&&o===0},NT=e=>{if(hr(e))return io(e)>>>24===127;let{w0:t,w1:r,w2:n,w3:o}=co(e);return t===0&&r===0&&n===0&&o===1},Fu=e=>Pu(e)?u3(e):hr(e)?io(e)>>>28===14:co(e).w0>>>24===255,xx=e=>Pu(e)?dx(e):io(e)===4294967295,UT=e=>Pu(e)?mx(e):!Fu(e)&&!hx(e)&&(!hr(e)||!xx(e)),DT=e=>hr(e)?io(e)>>>16===43518:(co(e).w0>>>16&65472)===65152,LT=e=>{let t=io(e);return t>>>24===10||(t>>>16&65520)===44048||t>>>16===49320},$T=e=>(co(e).w0>>>24&254)===252,f3=e=>{let{w0:t,w1:r,w2:n}=co(e);return t===0&&r===0&&n===65535};var l3={_tag:\"InetAddressV4\",[yn]:yn,[ae](e){return gp(e)&&this.port===e.port&&J(this.address,e.address)},[se](){return le(H(this.address),It(this.port))},toString(){return gx(this)},toJSON(){return this.toString()},[Te](){return this.toJSON()}},p3={_tag:\"InetAddressV6\",[yn]:yn,[ae](e){return yp(e)&&this.port===e.port&&this.scopeId===e.scopeId&&J(this.address,e.address)},[se](){return le(le(H(this.address),It(this.port)),It(this.scopeId))},toString(){return gx(this)},toJSON(){return this.toString()},[Te](){return this.toJSON()}},WN=e=>Number.isInteger(e)&&e>=0&&e<=65535,d3=(e,t)=>{if(!WN(t))return St(e,\"port must be an integer from 0 through 65535\");let r=Object.create(l3);return r.address=e,r.port=t,B(Object.freeze(r))},m3=(e,t,r)=>{if(!WN(t))return St(e,\"port must be an integer from 0 through 65535\");let n=r?.scopeId??0;if(!Number.isInteger(n)||n<0||n>4294967295)return St(e,\"scopeId must be an unsigned 32-bit integer\");let o=Object.create(p3);return o.address=e,o.port=t,o.scopeId=n,B(Object.freeze(o))};var JN=e=>{let t,r,n=0,o=e.startsWith(\"[\");if(o){let s=e.indexOf(\"]\");if(s<0||e[s+1]!==\":\"||e.indexOf(\"]\",s+1)!==-1)return St(e,\"expected [IPv6]:port\");t=e.slice(1,s),r=e.slice(s+2);let a=t.indexOf(\"%\");if(a!==-1){let i=t.slice(a+1);if(t.indexOf(\"%\",a+1)!==-1||!/^\\d+$/.test(i))return St(e,\"scope identifier must be decimal\");if(n=Number(i),!Number.isInteger(n)||n>4294967295)return St(e,\"scope identifier must be an unsigned 32-bit integer\");t=t.slice(0,a)}}else{let s=e.lastIndexOf(\":\");if(s<0)return St(e,\"expected host:port or [IPv6]:port\");if(e.indexOf(\":\")!==s)return St(e,\"IPv6 addresses must be bracketed\");t=e.slice(0,s),r=e.slice(s+1)}return/^(0|[1-9]\\d*)$/.test(r)?Lt(bp(t),s=>o!==Yo(s)?St(e,\"only IPv6 addresses use brackets\"):Yo(s)?m3(s,Number(r),{scopeId:n}):d3(s,Number(r))):St(e,\"port must be an unpadded decimal integer\")};var h3=e=>uo(e.address)+(yp(e)&&e.scopeId!==0?`%${e.scopeId}`:\"\");var gx=e=>{let t=h3(e);return gp(e)?`${t}:${e.port}`:`[${t}]:${e.port}`};var x3={_tag:\"UnixPathAddress\",[yn]:yn,[ae](e){return px(e)&&this.path===e.path},[se](){return le(Re(\"UnixPathAddress\"),Re(this.path))},toString(){return this.path},toJSON(){return this.toString()},[Te](){return this.toJSON()}},KN=e=>{let t=Object.create(x3);return t.path=e,Object.freeze(t)};var jT=\"~effect/net/IpInterface\",GN=e=>Ep(e)&&hr(e.address),VN=e=>Ep(e)&&Yo(e.address),Ep=e=>k(e,jT),g3={_tag:\"IpInterface\",[jT]:jT,[ae](e){return Ep(e)&&this.prefixLength===e.prefixLength&&J(this.address,e.address)},[se](){return le(H(this.address),It(this.prefixLength))},toString(){return Tp(this)},toJSON(){return this.toString()},[Te](){return this.toJSON()}},zT=(e,t)=>W(new ji({input:e,message:t})),Ip=(e,t)=>{let r=Ru(e);if(!Number.isInteger(t)||t<0||t>r)return zT(e,`prefix length must be an integer from 0 through ${r}`);let n=Object.assign(Object.create(g3),{address:e,prefixLength:t});return B(Object.freeze(n))},qT=(e,t)=>{let r=e.indexOf(\"/\");if(r===-1&&t?.prefix!==\"required\")return B({address:e,prefixLength:void 0});if(r<=0||r!==e.lastIndexOf(\"/\")||r===e.length-1)return zT(e,\"expected an address and prefix length separated by one slash\");let n=e.slice(r+1);return/^(0|[1-9][0-9]*)$/.test(n)?B({address:e.slice(0,r),prefixLength:Number(n)}):zT(e,\"prefix length must be an unpadded ASCII decimal integer\")},yx=(e,t)=>Lt(qT(e,t),r=>Lt(Mu(r.address),n=>Ip(n,r.prefixLength??Ru(n)))),Sx=(e,t)=>Lt(qT(e,t),r=>Lt(Sp(r.address),n=>Ip(n,r.prefixLength??Ru(n)))),bx=(e,t)=>Lt(qT(e,t),r=>Lt(bp(r.address),n=>Ip(n,r.prefixLength??Ru(n))));var Tp=e=>`${uo(e.address)}/${e.prefixLength}`;var HT=\"~effect/net/IpNetwork\",YN=e=>wp(e)&&hr(e.address),QN=e=>wp(e)&&Yo(e.address),wp=e=>k(e,HT),y3={_tag:\"IpNetwork\",[HT]:HT,[ae](e){return wp(e)&&this.prefixLength===e.prefixLength&&J(this.address,e.address)},[se](){return le(H(this.address),It(this.prefixLength))},toString(){return Cp(this)},toJSON(){return this.toString()},[Te](){return this.toJSON()}},S3=e=>{let t=Object.assign(Object.create(y3),{address:e.address,prefixLength:e.prefixLength});return Object.freeze(t)},b3=e=>hr(e)?RT(e):HN(e);var E3=(e,t)=>{let r=Math.floor(t/8),n=t%8;return e.map((o,s)=>sLt(Ip(e,t),r=>{let n=b3(e),o=E3(n,t);return n.some((s,a)=>s!==o[a])?W(new ji({input:e,message:\"address has non-zero host bits\"})):B(S3(r))});var XN=e=>Lt(yx(e,{prefix:\"required\"}),t=>WT(t.address,t.prefixLength)),eU=e=>Lt(Sx(e,{prefix:\"required\"}),t=>WT(t.address,t.prefixLength)),tU=e=>Lt(bx(e,{prefix:\"required\"}),t=>WT(t.address,t.prefixLength));var Cp=e=>`${uo(e.address)}/${e.prefixLength}`;var Ap=tx;function qr(){return(e,t,r)=>q(new yu(e.map(op),n=>t(n.map(o=>q(o))),r))}function Be(e,t){return qr()([],()=>(r,n,o)=>e(r)?g(r):P(new ft(n,r,o)),t)}function T3(e){return e}function w3(e){return t=>t.annotate(e)}function C3(e){return t=>JT(JT(t).annotate(e))}function A3(e){return t=>t.rebuild(cp(t.ast,e))}function k3(e){return e}var Os=class extends Fr(\"SchemaError\"){[Ou]=Ou;constructor(t){let r=Co();Yr(0);try{super({issue:t})}finally{Yr(r)}}get message(){return _P(this.issue)}toString(){return`SchemaError(${this.message})`}};function hU(e){return BN(e)}function xU(e){return Ne(e)?YT(e):rt(e,t=>Is(()=>Ss(t,r=>new Os(r))))}function YT(e){return Ve(e)?e:sn(Ss(e.cause,t=>new Os(t)))}function gU(e,t){let r;for(let n of e.reasons){if(!na(n)||!hU(n.error))throw new globalThis.Error(t,{cause:e});r??=n.error}if(r===void 0)throw new globalThis.Error(t,{cause:e});return r}function yU(e){return ah(e).then(t=>{if(Ve(t))return t.value;throw gU(t.cause,\"Promise adapter can only reject schema errors\")})}function SU(e){let t=Wo(e);if(Ve(t))return t.value;throw gU(t.cause,\"Sync adapter can only throw schema errors\")}function v3(e,t){return gN(e,t)}function O3(e){return yN(e)}var _3=rT,R3=OF;function Ex(e,t){let r=nt(e,t);return(n,o)=>xU(r(n,o))}var P3=Ex;function bU(e,t){let r=_F(e,t);return(n,o)=>YT(r(n,o))}var M3=bU,F3=oT,N3=RF;function EU(e,t){let r=PF(e,t);return(n,o)=>Dd(r(n,o),s=>new Os(s))}var U3=EU;function IU(e,t){let r=Ex(e,t);return(n,o)=>yU(r(n,o))}var D3=IU;function TU(e,t){let r=Ex(e,t);return(n,o)=>SU(r(n,o))}var L3=TU;function Ix(e,t){let r=Di(e,t);return(n,o)=>xU(r(n,o))}var $3=Ix;function wU(e,t){let r=FF(e,t);return(n,o)=>YT(r(n,o))}var B3=wU,j3=sT,z3=NF;function CU(e,t){let r=UF(e,t);return(n,o)=>Dd(r(n,o),s=>new Os(s))}var q3=CU;function AU(e,t){let r=Ix(e,t);return(n,o)=>yU(r(n,o))}var H3=AU;function kU(e,t){let r=Ix(e,t);return(n,o)=>SU(r(n,o))}var W3=kU,q=oo;function Tx(e){return k(e,Ap)&&e[Ap]===Ap}var qi=mr(e=>q(Ni(e.ast),{schema:e})),J3=mr(e=>e.schema),Lu=mr(e=>{let t=Ax(e);return q(iF(e.ast),{schema:t})}),K3=mr(e=>e.schema.members[0]),G3=mr(e=>q(qI(e.ast),{schema:e})),V3=mr(e=>e.schema),Hr=mr(e=>q(yt(e.ast),{schema:e})),$u=mr(e=>q(hn(e.ast),{schema:e})),kp=\"~effect/Schema/flip\";function Z3(e){return k(e,kp)&&e[kp]===kp}function JT(e){return Z3(e)?e.schema.rebuild(mn(e.ast)):q(mn(e.ast),{[kp]:kp,schema:e})}function Ct(e){let t=q(new dn(e),{literal:e,transform(r){return t.pipe(G(Ct(r),{decode:oe(()=>r),encode:oe(()=>e)}))}});return t}function vU(e){return e.map(t=>Tx(t)?t.ast:new dn(t))}function Y3(e){return q(new _I(vU(e)),{parts:e})}function Q3(e){return q(BM(vU(e)),{parts:e})}function X3(e){return q(new $M(Object.keys(e).filter(t=>typeof e[e[t]]!=\"number\").map(t=>[t,e[t]])),{enums:e})}var eV=q(OI),tV=q(DM),vp=q(eo),wx=q(kI),QT=q(vI),K=q(pn),rV=K,Wi=q(RI),XT=q(qM),OU=q(HM),Bu=q(WM),nV=q(UM),oV=q(LM);function sV(e){return q(new zM(e))}function ew(e,t){return q(e,{fields:t,mapFields(r,n){let o=r(this.fields);return ew(Lh(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Me(e){return ew(Lh(e,void 0),e)}function aV(e){return mr(t=>t.mapFields(RN(e)))}var iV=e=>typeof e==\"symbol\"?e:globalThis.String(e);function cV(e){return function(t){let r={},n=Object.create(null),o=Object.create(null),s=new Set;for(let a of Reflect.ownKeys(t.fields)){let i=$u(t.fields[a]),c=Object.hasOwn(e,a),u=c?e[a]:a,f=iV(u);if(s.has(f))throw new globalThis.Error(`Duplicate encoded keys: ${wo(u)}`);s.add(f),M(r,u,i),c&&(n[a]=u,o[u]=a)}return Me(r).pipe(G(t,Pe({decode:TT(o),encode:TT(n)})))}}function uV(e,t){return r=>{let n=Ya(r.fields,Hr),o=Me({...n,...e});return r.pipe(G(o,Pe({decode:s=>{let a={...s};for(let i in e){let c=t[i],u=c(s);be(u)&&M(a,i,u.value)}return a},encode:s=>{let a={...s};for(let i in e)delete a[i];return a}})))}}function _s(e,t){return q(uF(e.ast,t.ast),{key:e,value:t})}function fV(e,t){return q(ZM(e.ast,t.map(op)),{schema:e,records:t})}function _U(e,t){return q(e,{elements:t,mapElements(r,n){let o=r(this.elements);return _U(NI(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Qo(e){return _U(NI(e),e)}function lV(e,t){return q(YM(e.ast,t.map(op)),{schema:e,rest:t})}var $e=mr(e=>q(new Pn(!1,[],[e.ast]),{value:e}));function Cx(e,t,r){return t!==void 0&&r!==void 0?e.check(iw(t,r)):t!==void 0?e.check(ZU(t)):r!==void 0?e.check(XU(r)):e}var tw=mr(e=>q(new Pn(!1,[e.ast],[e.ast]),{value:e}));function pV(e){let t=$e(e),r=$e(Hr(e)),n=G(Qo([vp]),Pe({decode:o=>[o],encode:([o])=>o}))(e);return q(it([n,t]).pipe(G(r)).ast,{from:it([e,t]),to:r})}function dV(e){return $e(e).check(uw())}var mV=mr(e=>q(QM(e.ast),{schema:e}));function RU(e,t){return q(e,{members:t,mapMembers(r,n){let o=r(this.members);return RU($h(o,this.ast.options,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function it(e,t){return RU($h(e,t,void 0),e)}function fo(e){let t=e.map(Ct);return q($h(t,void 0,void 0),{literals:e,members:t,mapMembers(r){return it(r(this.members))},pick(r){return fo(r)},transform(r){return it(t.map((n,o)=>n.transform(r[o])))}})}var rw=mr(e=>it([e,wx])),Ax=mr(e=>it([e,QT])),PU=mr(e=>it([e,wx,QT]));function MU(e){return q(new DI(()=>e().ast))}function hV(...e){return t=>t.check(...e)}function FU(e,t){return r=>q(Vo(r.ast,[jh(e,t)]),{schema:r})}function NU(e){return t=>q(t.ast,{schema:t,identifier:e})}function xV(e,t){return r=>(t.checks?r.check(...t.checks):r).pipe(NU(e))}function UU(e){return t=>q(sF(t.ast,new _h(e,R)),{schema:t})}function DU(e){return t=>q(aF(t.ast,new _h(R,e)),{schema:t})}function gV(e){return LU(e)}function LU(e){return t=>UU(ru(e))(t)}function yV(e){return $U(e)}function $U(e){return t=>DU(ru(e))(t)}function G(e,t){return r=>q(ga(r.ast,e.ast,t?Rh(t):lu()),{from:r,to:e})}function ju(){return(e,t)=>Oe()(e,{decode:t,encode:NP})}var BU=fo([\"true\",\"yes\",\"on\",\"1\",\"y\"]),jU=fo([\"false\",\"no\",\"off\",\"0\",\"n\"]),nw=fo([...BU.literals,...jU.literals]).pipe(G(XT,Pe({decode:e=>e===\"true\"||e===\"yes\"||e===\"on\"||e===\"1\"||e===\"y\",encode:e=>e?\"true\":\"false\"})));function SV(e){return t=>G(Hr(t),e)(t)}function ow(e,t){return r=>t?G(r,t)(e):G(r)(e)}function bV(e){return t=>G(t,e)($u(t))}function zU(e){return t=>q(cF(t.ast,e),{schema:t})}function qU(e){return rt(e,t=>Is(()=>Ss(t,r=>r.issue)))}function sw(e,t){let r=t?.encodingStrategy===\"omit\"?uI():jr();return n=>qi($u(n)).pipe(G(n,{decode:fI(qU(e)),encode:r}))}function EV(e,t){return r=>Hr(r).pipe(sw(e,t),ow(qi(r)))}function HU(e,t){let r=t?.encodingStrategy===\"omit\"?uI():jr();return n=>Lu($u(n)).pipe(G(n,{decode:fI(qU(e)),encode:r}))}function IV(e,t){return r=>Hr(r).pipe(HU(e,t),ow(Lu(r)))}function Hi(e){return Ct(e).pipe(zU(g(e)))}function TV(e){return Hi(e).pipe(sw(g(e),{encodingStrategy:\"omit\"}))}function kx(e,t){return Me({_tag:Hi(e),...t})}function WU(e){return t=>{let r={},n=[],o=new Set,s={},a=f=>p=>f.includes(p[e]);return i(t),Object.assign(t,{tag:e,cases:r,discriminants:n,isAnyOf:a,guards:s,match:c,matchOrElse:u});function i(f){let p=f.ast;if(MM(p)&&\"members\"in f&&globalThis.Array.isArray(f.members)&&f.members.every(Tx))return f.members.forEach(i);let d=hu(p);if(d.length>0){let m=d.find(x=>x.key===e)?.literal;if(id(m)){let x=typeof m==\"number\"?globalThis.String(m):m;if(o.has(x))throw new globalThis.Error(`Duplicate discriminant: ${globalThis.String(m)}`);o.add(x),n.push(m),M(r,m,f),M(s,m,rT(Hr(f)));return}}throw new globalThis.Error(\"No literal or unique symbol found\")}function c(){if(arguments.length===1){let x=arguments[0];return function(y){let S=y[e];return(Object.hasOwn(x,S)?x[S]:void 0)(y)}}let f=arguments[0],p=arguments[1],d=f[e];return(Object.hasOwn(p,d)?p[d]:void 0)(f)}function u(){if(arguments.length===2){let y=arguments[0],S=arguments[1];return function(w){let E=w[e];return(Object.hasOwn(y,E)?y[E]??S:S)(w)}}let f=arguments[0],p=arguments[1],d=arguments[2],m=f[e];return(Object.hasOwn(p,m)?p[m]??d:d)(f)}}}function wV(e){let t={},r=[];for(let u of Object.keys(e)){let f=kx(u,e[u]);M(t,u,f),r.push(f)}let n=it(r),{tag:o,guards:s,isAnyOf:a,match:i,matchOrElse:c}=WU(\"_tag\")(n);return q(n.ast,{tag:o,cases:t,isAnyOf:a,guards:s,match:i,matchOrElse:c})}function CV(){return e=>e}function ba(e,t){return Be(r=>r instanceof e,t)}function Oe(){return(e,t)=>new at(e.ast,Rh(t))}var Ue=Bh;function AV(e,t=void 0){return new Ri(e,t)}var rU=\"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$\";function JU(e){let t=new globalThis.RegExp(rU);return Ue(r=>r.trim()===r,{expected:\"a string with no leading or trailing whitespace\",representation:{id:\"effect/schema/isTrimmed\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isTrimmed()\"}),arbitraryConstraint:{patterns:[{source:rU,flags:\"\"}]},...e})}function zu(e,t){let r=e.source,n=e.flags,o=/^[dg]*uy?$/.test(n),s=n===\"\"?`new RegExp(${F(r)})`:`new RegExp(${F(r)}, ${F(n)})`;return ap(e,{toJsonSchema:()=>o?{pattern:n.endsWith(\"y\")?`^(?:${r})`:r}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${s})`}),...t})}function kV(e){return JI({toCode:()=>({runtime:\"Schema.isStringFinite()\"}),...e})}function vV(e){return KI({toCode:()=>({runtime:\"Schema.isStringBigInt()\"}),...e})}function OV(e){return VI({toCode:()=>({runtime:\"Schema.isStringSymbol()\"}),...e})}var _V=e=>e?new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/;function RV(e,t){let r=_V(e);return zu(r,{expected:e?`a UUID v${e}`:\"a UUID\",representation:{id:\"effect/schema/isUUID\",payload:{version:e??null}},toJsonSchema:()=>({pattern:r.source,format:\"uuid\"}),toCode:()=>({runtime:e===void 0?\"Schema.isUUID()\":`Schema.isUUID(${e})`}),...t})}var nU=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;function PV(e){return zu(nU,{expected:\"a GUID\",representation:{id:\"effect/schema/isGUID\",payload:null},toJsonSchema:()=>({pattern:nU.source}),toCode:()=>({runtime:\"Schema.isGUID()\"}),...e})}function MV(e){let t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return zu(t,{representation:{id:\"effect/schema/isULID\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isULID()\"}),...e})}function KU(e){let t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return zu(t,{expected:\"a base64 encoded string\",representation:{id:\"effect/schema/isBase64\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isBase64()\"}),...e})}function FV(e){let t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return zu(t,{expected:\"a base64url encoded string\",representation:{id:\"effect/schema/isBase64Url\",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:\"Schema.isBase64Url()\"}),...e})}function aw(e,t,r){if(e.length===0)return t.length===0?{}:[{},!0];let n={pattern:new globalThis.RegExp(r).source};return e===t?n:[n,!0]}function NV(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(`^${ks(e)}`),o=e.replace(/[\\uD800-\\uDBFF]$/,\"\");return Ue(s=>s.startsWith(e),{expected:`a string starting with ${r}`,representation:{id:\"effect/schema/isStartingWith\",payload:{startsWith:e}},toJsonSchema:()=>aw(o,e,`^${ks(o)}`),toCode:()=>({runtime:`Schema.isStartingWith(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}function UV(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(`${ks(e)}$`),o=e.replace(/^[\\uDC00-\\uDFFF]/,\"\");return Ue(s=>s.endsWith(e),{expected:`a string ending with ${r}`,representation:{id:\"effect/schema/isEndingWith\",payload:{endsWith:e}},toJsonSchema:()=>aw(o,e,`${ks(o)}$`),toCode:()=>({runtime:`Schema.isEndingWith(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}function DV(e,t){let r=JSON.stringify(e),n=new globalThis.RegExp(ks(e)),o=e.replace(/^[\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF]$/g,\"\");return Ue(s=>s.includes(e),{expected:`a string including ${r}`,representation:{id:\"effect/schema/isIncluding\",payload:{includes:e}},toJsonSchema:()=>aw(o,e,ks(o)),toCode:()=>({runtime:`Schema.isIncluding(${F(e)})`}),arbitraryConstraint:{patterns:[{source:n.source,flags:n.flags}]},...t})}var oU=\"^[^a-z]*$\";function LV(e){let t=new globalThis.RegExp(oU);return Ue(r=>r.toUpperCase()===r,{expected:\"a string with all characters in uppercase\",representation:{id:\"effect/schema/isUppercased\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isUppercased()\"}),arbitraryConstraint:{patterns:[{source:oU,flags:\"\"}]},...e})}var sU=\"^[^A-Z]*$\";function $V(e){let t=new globalThis.RegExp(sU);return Ue(r=>r.toLowerCase()===r,{expected:\"a string with all characters in lowercase\",representation:{id:\"effect/schema/isLowercased\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isLowercased()\"}),arbitraryConstraint:{patterns:[{source:sU,flags:\"\"}]},...e})}var aU=\"^(?:[^a-z][\\\\s\\\\S]*)?$\";function BV(e){let t=new globalThis.RegExp(aU);return Ue(r=>r.charAt(0).toUpperCase()===r.charAt(0),{expected:\"a string with the first character in uppercase\",representation:{id:\"effect/schema/isCapitalized\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isCapitalized()\"}),arbitraryConstraint:{patterns:[{source:aU,flags:\"\"}]},...e})}var iU=\"^(?:[^A-Z][\\\\s\\\\S]*)?$\";function jV(e){let t=new globalThis.RegExp(iU);return Ue(r=>r.charAt(0).toLowerCase()===r.charAt(0),{expected:\"a string with the first character in lowercase\",representation:{id:\"effect/schema/isUncapitalized\",payload:null},toJsonSchema:()=>[{pattern:t.source},!0],toCode:()=>({runtime:\"Schema.isUncapitalized()\"}),arbitraryConstraint:{patterns:[{source:iU,flags:\"\"}]},...e})}var qu=q($I),zV=LI;function Op(e){let t=Tc(e.order),r=e.formatter??F;return(n,o)=>Ue(s=>t(s,n),{expected:`a value greater than ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n,exclusiveMinimum:!0},...e.annotate?.(n),...o})}function _p(e){let t=_d(e.order),r=e.formatter??F;return(n,o)=>Ue(s=>t(s,n),{expected:`a value greater than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n},...e.annotate?.(n),...o})}function Rp(e){let t=vd(e.order),r=e.formatter??F;return(n,o)=>Ue(s=>t(s,n),{expected:`a value less than ${r(n)}`,arbitraryConstraint:{order:e.order,maximum:n,exclusiveMaximum:!0},...e.annotate?.(n),...o})}function Pp(e){let t=Od(e.order),r=e.formatter??F;return(n,o)=>Ue(s=>t(s,n),{expected:`a value less than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,maximum:n},...e.annotate?.(n),...o})}function Mp(e){let t=_d(e.order),r=Tc(e.order),n=Od(e.order),o=vd(e.order),s=e.formatter??F;return(a,i)=>{let c=a.exclusiveMinimum?r:t,u=a.exclusiveMaximum?o:n;return Ue(f=>c(f,a.minimum)&&u(f,a.maximum),{expected:`a value between ${s(a.minimum)}${a.exclusiveMinimum?\" (excluded)\":\"\"} and ${s(a.maximum)}${a.exclusiveMaximum?\" (excluded)\":\"\"}`,arbitraryConstraint:{order:e.order,minimum:a.minimum,maximum:a.maximum,...a.exclusiveMinimum&&{exclusiveMinimum:!0},...a.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(a),...i})}}function qV(e){return(t,r)=>{let n=e.formatter??F;return Ue(o=>e.remainder(o,t)===e.zero,{expected:`a value that is a multiple of ${n(t)}`,...e.annotate?.(t),...r})}}function Nu(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${F(e)}`);return e}var HV=Op({order:fs,annotate:e=>({representation:{id:\"effect/schema/isGreaterThan\",payload:{exclusiveMinimum:Nu(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${F(e)})`})})}),GU=_p({order:fs,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualTo\",payload:{minimum:Nu(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${F(e)})`})})}),WV=Rp({order:fs,annotate:e=>({representation:{id:\"effect/schema/isLessThan\",payload:{exclusiveMaximum:Nu(e)}},toJsonSchema:()=>({exclusiveMaximum:e}),toCode:()=>({runtime:`Schema.isLessThan(${F(e)})`})})}),JV=Pp({order:fs,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualTo\",payload:{maximum:Nu(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${F(e)})`})})}),Hu=Mp({order:fs,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetween\",payload:{minimum:Nu(e.minimum),maximum:Nu(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>({[t?\"exclusiveMinimum\":\"minimum\"]:e.minimum,[r?\"exclusiveMaximum\":\"maximum\"]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${F(e.minimum)}, maximum: ${F(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}});function KV(e,t){if(!globalThis.Number.isFinite(e)||e===0)throw new globalThis.RangeError(`Expected a finite non-zero number, got ${globalThis.String(e)}`);return e=globalThis.Math.abs(e),Ue(r=>I_(r,e)===0,{expected:`a value that is a multiple of ${e}`,representation:{id:\"effect/schema/isMultipleOf\",payload:{divisor:e}},toJsonSchema:()=>({multipleOf:e}),toCode:()=>({runtime:`Schema.isMultipleOf(${F(e)})`}),...t})}function vx(e){return Ue(t=>globalThis.Number.isSafeInteger(t),{expected:\"an integer\",representation:{id:\"effect/schema/isInt\",payload:null},toJsonSchema:()=>[{type:\"integer\"},!0],toCode:()=>({runtime:\"Schema.isInt()\"}),arbitraryConstraint:{number:\"integer\"},...e})}var lo=Wi.check(vx()),zi=lo.check(GU(0));function GV(e){return new Ri([vx(),Hu({minimum:-2147483648,maximum:2147483647})],{expected:\"a 32-bit integer\",...e})}function VV(e){return new Ri([vx(),Hu({minimum:0,maximum:4294967295})],{expected:\"a 32-bit unsigned integer\",...e})}function Uu(e){if(globalThis.Number.isNaN(e.getTime()))throw new globalThis.RangeError(`Expected a valid Date, got ${F(e)}`);return e.toISOString()}function Du(e){return`new Date(${F(e.getTime())})`}var ZV=Op({order:Ic,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanDate\",payload:{exclusiveMinimum:Uu(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanDate(${Du(e)})`})})}),YV=_p({order:Ic,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualToDate\",payload:{minimum:Uu(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToDate(${Du(e)})`})})}),QV=Rp({order:Ic,annotate:e=>({representation:{id:\"effect/schema/isLessThanDate\",payload:{exclusiveMaximum:Uu(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanDate(${Du(e)})`})})}),XV=Pp({order:Ic,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualToDate\",payload:{maximum:Uu(e)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanOrEqualToDate(${Du(e)})`})})}),eZ=Mp({order:Ic,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetweenDate\",payload:{minimum:Uu(e.minimum),maximum:Uu(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenDate({ minimum: ${Du(e.minimum)}, maximum: ${Du(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}}),tZ=Op({order:Ec,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanBigInt\",payload:{exclusiveMinimum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanBigInt(${F(e)})`})})}),VU=_p({order:Ec,annotate:e=>({representation:{id:\"effect/schema/isGreaterThanOrEqualToBigInt\",payload:{minimum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToBigInt(${F(e)})`})})}),rZ=Rp({order:Ec,annotate:e=>({representation:{id:\"effect/schema/isLessThanBigInt\",payload:{exclusiveMaximum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanBigInt(${F(e)})`})})}),nZ=Pp({order:Ec,annotate:e=>({representation:{id:\"effect/schema/isLessThanOrEqualToBigInt\",payload:{maximum:e.toString(10)}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isLessThanOrEqualToBigInt(${F(e)})`})})}),oZ=Mp({order:Ec,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,r=e.exclusiveMaximum?!0:void 0;return{representation:{id:\"effect/schema/isBetweenBigInt\",payload:{minimum:e.minimum.toString(10),maximum:e.maximum.toString(10),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenBigInt({ minimum: ${F(e.minimum)}, maximum: ${F(e.maximum)}, exclusiveMinimum: ${F(t)}, exclusiveMaximum: ${F(r)} })`})}}});function ZU(e,t){return e=xr(e),YU(e,Math.ceil(e/2),t)}function YU(e,t,r){return Ue(n=>n.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:\"effect/schema/isMinLength\",payload:{minLength:e}},toJsonSchema:({type:n})=>n===\"string\"?e<=1?{minLength:t}:[{minLength:t},!0]:n===\"array\"?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Lr]:!0,arbitraryConstraint:{minLength:e},...r})}function QU(e){return YU(1,1,e)}function XU(e,t){return e=xr(e),Ue(r=>r.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:\"effect/schema/isMaxLength\",payload:{maxLength:e}},toJsonSchema:({type:r})=>r===\"string\"?e===0?{maxLength:e}:[{maxLength:e},!0]:r===\"array\"?{maxItems:e}:r===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[Lr]:!0,arbitraryConstraint:{maxLength:e},...t})}function iw(e,t,r){return e=xr(e),t=xr(t),Ue(n=>n.length>=e&&n.length<=t,{expected:e===t?`a value with a length of ${e}`:`a value with a length between ${e} and ${t}`,representation:{id:\"effect/schema/isBetweenLength\",payload:{minimum:e,maximum:t}},toJsonSchema:({type:n})=>n===\"string\"?t===0||Math.ceil(e/2)>t?{minLength:Math.ceil(e/2),maxLength:t}:[{minLength:Math.ceil(e/2),maxLength:t},!0]:n===\"array\"?{minItems:e,maxItems:t}:n===void 0?[{minLength:Math.ceil(e/2),maxLength:t,minItems:e,maxItems:t},!0]:[{},!0],toCode:()=>({runtime:`Schema.isBetweenLength(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minLength:e,maxLength:t},...r})}function sZ(e,t){return e=xr(e),Ue(r=>cw(r,e)>=e,{expected:`a string with at least ${e} code points`,representation:{id:\"effect/schema/isMinCodePoints\",payload:{minCodePoints:e}},toJsonSchema:()=>({minLength:e}),toCode:()=>({runtime:`Schema.isMinCodePoints(${e})`}),arbitraryConstraint:{minCodePoints:e},...t})}function aZ(e,t){return e=xr(e),Ue(r=>cw(r,e+1)<=e,{expected:`a string with at most ${e} code points`,representation:{id:\"effect/schema/isMaxCodePoints\",payload:{maxCodePoints:e}},toJsonSchema:()=>({maxLength:e}),toCode:()=>({runtime:`Schema.isMaxCodePoints(${e})`}),arbitraryConstraint:{maxCodePoints:e},...t})}function iZ(e,t,r){return e=xr(e),t=xr(t),Ue(n=>{let o=cw(n,t+1);return o>=e&&o<=t},{expected:e===t?`a string with ${e} code points`:`a string with between ${e} and ${t} code points`,representation:{id:\"effect/schema/isBetweenCodePoints\",payload:{minimum:e,maximum:t}},toJsonSchema:()=>({allOf:[{minLength:e},{maxLength:t}]}),toCode:()=>({runtime:`Schema.isBetweenCodePoints(${e}, ${t})`}),arbitraryConstraint:{minCodePoints:e,maxCodePoints:t},...r})}function cw(e,t){if(t===0)return 0;let r=0;for(let n of e)if(++r>=t)break;return r}function xr(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}function cZ(e,t){return e=xr(e),Ue(r=>r.size>=e,{expected:`a value with a size of at least ${e}`,representation:{id:\"effect/schema/isMinSize\",payload:{minSize:e}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isMinSize(${e})`}),[Lr]:!0,arbitraryConstraint:{minSize:e},...t})}function uZ(e,t){return e=xr(e),Ue(r=>r.size<=e,{expected:`a value with a size of at most ${e}`,representation:{id:\"effect/schema/isMaxSize\",payload:{maxSize:e}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isMaxSize(${e})`}),[Lr]:!0,arbitraryConstraint:{maxSize:e},...t})}function fZ(e,t,r){return e=xr(e),t=xr(t),Ue(n=>n.size>=e&&n.size<=t,{expected:e===t?`a value with a size of ${e}`:`a value with a size between ${e} and ${t}`,representation:{id:\"effect/schema/isBetweenSize\",payload:{minimum:e,maximum:t}},toJsonSchema:()=>[{},!0],toCode:()=>({runtime:`Schema.isBetweenSize(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minSize:e,maxSize:t},...r})}function lZ(e,t){return e=xr(e),Ue(r=>Reflect.ownKeys(r).length>=e,{expected:`a value with at least ${e===1?\"1 entry\":`${e} entries`}`,representation:{id:\"effect/schema/isMinProperties\",payload:{minProperties:e}},toJsonSchema:({type:r})=>r===\"object\"?{minProperties:e}:[{minProperties:e},!0],toCode:()=>({runtime:`Schema.isMinProperties(${e})`}),[Lr]:!0,arbitraryConstraint:{minProperties:e},...t})}function pZ(e,t){return e=xr(e),Ue(r=>Reflect.ownKeys(r).length<=e,{expected:`a value with at most ${e===1?\"1 entry\":`${e} entries`}`,representation:{id:\"effect/schema/isMaxProperties\",payload:{maxProperties:e}},toJsonSchema:({type:r})=>r===\"object\"?{maxProperties:e}:[{maxProperties:e},!0],toCode:()=>({runtime:`Schema.isMaxProperties(${e})`}),[Lr]:!0,arbitraryConstraint:{maxProperties:e},...t})}function dZ(e,t,r){return e=xr(e),t=xr(t),Ue(n=>Reflect.ownKeys(n).length>=e&&Reflect.ownKeys(n).length<=t,{expected:e===t?`a value with exactly ${e===1?\"1 entry\":`${e} entries`}`:`a value with between ${e} and ${t} entries`,representation:{id:\"effect/schema/isBetweenProperties\",payload:{minimum:e,maximum:t}},toJsonSchema:({type:n})=>n===\"object\"?{minProperties:e,maxProperties:t}:[{minProperties:e,maxProperties:t},!0],toCode:()=>({runtime:`Schema.isBetweenProperties(${e}, ${t})`}),[Lr]:!0,arbitraryConstraint:{minProperties:e,maxProperties:t},...r})}function mZ(e,t){let r=$u(e),n=vF(r.ast);return Ue((o,s,a)=>{let i=Reflect.ownKeys(o),c=[];for(let u of i){let f=n(u,a);if(f!==void 0&&(c.push(new ut([u],f)),a.errors===\"first\"))break}return or(c)?new wt(s,c,o,a):!0},{expected:\"an object with property names matching the schema\",representation:{id:\"effect/schema/isPropertyNames\",payload:null,schemas:[r.ast]},toJsonSchema:({schemas:o,type:s})=>s===\"object\"?{propertyNames:o[0]}:[{propertyNames:o[0]},!0],toCode:({schemas:o})=>({runtime:`Schema.isPropertyNames(${o[0].runtime})`}),[Lr]:!0,...t})}function uw(e){return Ue(t=>zd(t).length===t.length,{expected:\"an array with unique items\",representation:{id:\"effect/schema/isUnique\",payload:null},toJsonSchema:()=>({uniqueItems:!0}),toCode:()=>({runtime:\"Schema.isUnique()\"}),arbitraryConstraint:{uniqueBy:R},...e})}function eD(e){return Ue(t=>zd(t.map(([r])=>r)).length===t.length,{expected:\"an array with unique keys\",representation:{id:\"effect/schema/isUniqueKey\",payload:null},toCode:()=>({runtime:\"Schema.isUniqueKey()\"}),arbitraryConstraint:{uniqueBy:t=>t[0]},...e})}var fw=K.check(QU()),hZ=K.check(iw(1,1)),tD=e=>(e?.includeStack===!0?1:0)|(e?.excludeCause===!0?2:0),rD=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},cU=[];function xZ(e){let t=tD(e),r=cU[t];if(r!==void 0)return r;let n=rD(t),o=ba(globalThis.Error,{representation:{id:\"effect/schema/Error\",payload:n??null},toCode:()=>({runtime:n!==void 0?`Schema.ErrorInstance(${F(n)})`:\"Schema.ErrorInstance()\",Type:\"globalThis.Error\"}),expected:\"Error\",toCodecJson:()=>Oe()($8,lM(n))});return cU[t]=o,o}var uU=[];function gZ(e){let t=tD(e),r=uU[t];if(r!==void 0)return r;let n=Nx.pipe(G(vp,pM(rD(t))));return uU[t]=n,n}function yZ(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(Qo([n,o]));return(a,i,c)=>a instanceof globalThis.Map?Vt(nt(s)([...a],c),{onSuccess:u=>new globalThis.Map(u),onFailure:u=>Br(i,\"entries\",u,a,c)}):P(new ft(i,a,c))},{representation:{id:\"effect/schema/ReadonlyMap\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.ReadonlyMap(${n[0].runtime}, ${n[1].runtime})`,Type:`globalThis.ReadonlyMap<${n[0].Type}, ${n[1].Type}>`}),expected:\"ReadonlyMap\",toCodec:([n,o])=>Oe()($e(Qo([n,o])),Pe({decode:s=>new globalThis.Map(s),encode:s=>[...s.entries()]}))});return q(r.ast,{key:e,value:t})}function SZ(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>o instanceof globalThis.Set?Vt(nt(n)([...o],a),{onSuccess:i=>new globalThis.Set(i),onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ft(s,o,a))},{representation:{id:\"effect/schema/ReadonlySet\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.ReadonlySet(${r[0].runtime})`,Type:`globalThis.ReadonlySet<${r[0].Type}>`}),expected:\"ReadonlySet\",toCodec:([r])=>Oe()($e(r),Pe({decode:n=>new globalThis.Set(n),encode:n=>[...n.values()]}))});return q(t.ast,{value:e})}var bZ=ba(globalThis.RegExp,{representation:{id:\"effect/schema/RegExp\",payload:null},toCode:()=>({runtime:\"Schema.RegExp\",Type:\"globalThis.RegExp\"}),expected:\"RegExp\",toCodecJson:()=>Oe()(Me({source:K,flags:K}),Yt({decode:(e,t)=>Qc({try:()=>new globalThis.RegExp(e.source,e.flags),catch:()=>new de({expected:\"valid RegExp source and flags\"},e,t)}),encode:e=>g({source:e.source,flags:e.flags})}))}),nD=K.annotate({expected:\"a string that will be decoded as a URL\"}),Ox=ba(globalThis.URL,{representation:{id:\"effect/schema/URL\",payload:null},toCode:()=>({runtime:\"Schema.URL\",Type:\"globalThis.URL\"}),expected:\"URL\",toCodecJson:()=>Oe()(nD,hI)}),EZ=nD.pipe(G(Ox,hI)),oD=K.annotate({expected:\"a string that will be decoded as a Date\"}),Wu=Be(e=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:\"effect/schema/Date\",payload:null},toCode:()=>({runtime:\"Schema.Date\",Type:\"globalThis.Date\"}),expected:\"a valid Date\",toCodecJson:()=>Oe()(oD,dI)}),IZ=oD.pipe(G(Wu,dI)),TZ=lo.pipe(G(Wu,sM)),wZ=K.annotate({expected:\"a string that will be decoded as JSON\",contentMediaType:\"application/json\"});function lw(e,t){return wZ.pipe(G(e,IM(t)))}var CZ=lw(vp),sD=ba(globalThis.File,{representation:{id:\"effect/schema/File\",payload:null},toCode:()=>({runtime:\"Schema.File\",Type:\"globalThis.File\"}),expected:\"File\",toCodecJson:()=>Oe()(Me({data:K.check(KU()),type:K,name:K,lastModified:lo}),Yt({decode:(e,t)=>wr(Ei(e.data),{onFailure:()=>P(new de({expected:\"a valid Base64 string\"},e.data,t)),onSuccess:r=>{let n=new globalThis.Uint8Array(r);return g(new globalThis.File([n],e.name,{type:e.type,lastModified:e.lastModified}))}}),encode:(e,t)=>Zc({try:async()=>{let r=new globalThis.Uint8Array(await e.arrayBuffer());return{data:su(r),type:e.type,name:e.name,lastModified:e.lastModified}},catch:()=>new de({expected:\"a readable File\"},e,t)})}))}),aD=ba(globalThis.FormData,{representation:{id:\"effect/schema/FormData\",payload:null},toCode:()=>({runtime:\"Schema.FormData\",Type:\"globalThis.FormData\"}),expected:\"FormData\",toCodecJson:()=>Oe()($e(Qo([K,it([Me({_tag:Hi(\"String\"),value:K}),Me({_tag:Hi(\"File\"),value:sD})])])),Yt({decode:e=>{let t=new globalThis.FormData;for(let[r,n]of e)t.append(r,n.value);return g(t)},encode:e=>g(globalThis.Array.from(e.entries()).map(([t,r])=>typeof r==\"string\"?[t,{_tag:\"String\",value:r}]:[t,{_tag:\"File\",value:r}]))}))});function AZ(e){return aD.pipe(G(e,TM))}var iD=ba(globalThis.URLSearchParams,{representation:{id:\"effect/schema/URLSearchParams\",payload:null},toCode:()=>({runtime:\"Schema.URLSearchParams\",Type:\"globalThis.URLSearchParams\"}),expected:\"URLSearchParams\",toCodecJson:()=>Oe()(K.annotate({expected:\"a query string that will be decoded as URLSearchParams\"}),Pe({decode:e=>new globalThis.URLSearchParams(e),encode:e=>e.toString()}))});function kZ(e){return iD.pipe(G(e,wM))}var vZ=K.annotate({expected:\"a string that will be decoded as a number\"}).pipe(G(Wi,pu)),OZ=K.annotate({expected:\"a string that will be decoded as a finite number\"}).pipe(G(qu,pu)),_Z=q(GI).pipe(G(Bu,Mh)),cD=K.check(JU()),RZ=K.annotate({expected:\"a string that will be decoded as a trimmed string\"}).pipe(G(cD,nM())),PZ=K.annotate({expected:\"a base64 encoded string that will be decoded as a UTF-8 string\"}).pipe(G(K,yM)),MZ=K.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a UTF-8 string\"}).pipe(G(K,SM)),FZ=K.annotate({expected:\"a hex encoded string that will be decoded as a UTF-8 string\"}).pipe(G(K,bM)),NZ=K.annotate({expected:\"a URI component encoded string that will be decoded as a UTF-8 string\"}).pipe(G(K,EM)),KT=it([qu,OU,K]),UZ=Me({issues:$e(Me({message:K,path:Lu($e(it([KT,Me({key:KT})])))}))}),DZ=fo([0,1]).pipe(G(XT,Pe({decode:e=>e===1,encode:e=>e?1:0}))),uD=K.annotate({expected:\"a base64 encoded string that will be decoded as Uint8Array\",format:\"byte\",contentEncoding:\"base64\"}),_x=ba(globalThis.Uint8Array,{representation:{id:\"effect/schema/Uint8Array\",payload:null},toCode:()=>({runtime:\"Schema.Uint8Array\",Type:\"globalThis.Uint8Array\"}),expected:\"Uint8Array\",toCodecJson:()=>Oe()(uD,xI)}),LZ=uD.pipe(G(_x,xI)),$Z=K.annotate({expected:\"a base64 (URL) encoded string that will be decoded as a Uint8Array\"}).pipe(G(_x,{decode:WP(),encode:vh()})),BZ=K.annotate({expected:\"a hex encoded string that will be decoded as a Uint8Array\"}).pipe(G(_x,{decode:KP(),encode:Oh()})),fD=Yt({decode:(e,t)=>{let r=iR(e);return fe(r)?P(new de({expected:\"a valid BigDecimal string\"},e,t)):g(r.value)},encode:e=>g(ws(e))}),jZ=Op({order:nu,formatter:e=>ws(e)}),zZ=_p({order:nu,formatter:e=>ws(e)}),qZ=Rp({order:nu,formatter:e=>ws(e)}),HZ=Pp({order:nu,formatter:e=>ws(e)}),WZ=Mp({order:nu,formatter:e=>ws(e)}),lD=K.annotate({expected:\"a string that will be decoded as a BigDecimal\"}),pD=Be(iE,{representation:{id:\"effect/schema/BigDecimal\",payload:null},toCode:()=>({runtime:\"Schema.BigDecimal\",Type:\"BigDecimal.BigDecimal\",importDeclarations:['import * as BigDecimal from \"effect/BigDecimal\"']}),expected:\"BigDecimal\",toCodecJson:()=>Oe()(lD,fD),toFormatter:()=>e=>ws(e)}),JZ=lD.pipe(G(pD,fD)),Ju=Be(gR,{representation:{id:\"effect/schema/ByteSize\",payload:null},toCode:()=>({runtime:\"Schema.ByteSize\",Type:\"ByteSize.ByteSize\",importDeclarations:['import * as ByteSize from \"effect/ByteSize\"']}),expected:\"ByteSize\",toCodecJson:()=>Oe()(Bu.check(VU(globalThis.BigInt(0))),Pe({decode:xR,encode:uh})),toCodecStringTree:()=>Oe()(dD,mI)}),dD=K.annotate({expected:\"a string that will be decoded as a ByteSize\"}),KZ=dD.pipe(G(Ju,mI)),GZ=Bu.pipe(G(Ju,aM)),VZ=Wi.pipe(G(Ju,iM));function GT(e,t){let r=qr()([e,t],([n,o])=>(s,a,i)=>{if(!tb(s))return P(new ft(a,s,i));switch(s._tag){case\"Fail\":return Vt(nt(n)(s.error,i),{onSuccess:jc,onFailure:c=>Br(a,\"error\",c,s,i)});case\"Die\":return Vt(nt(o)(s.defect,i),{onSuccess:zc,onFailure:c=>Br(a,\"defect\",c,s,i)});case\"Interrupt\":return g(s)}},{representation:{id:\"effect/schema/CauseReason\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.CauseReason(${n[0].runtime}, ${n[1].runtime})`,Type:`Cause.Failure<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause.Failure\",toCodec:([n,o])=>Oe()(it([Me({_tag:Ct(\"Fail\"),error:n}),Me({_tag:Ct(\"Die\"),defect:o}),Me({_tag:Ct(\"Interrupt\"),fiberId:Ax(qu)})]),Pe({decode:s=>{switch(s._tag){case\"Fail\":return jc(s.error);case\"Die\":return zc(s.defect);case\"Interrupt\":return nb(s.fiberId)}},encode:s=>{switch(s._tag){case\"Fail\":return{_tag:\"Fail\",error:s.error};case\"Die\":return{_tag:\"Die\",defect:s.defect};case\"Interrupt\":return{_tag:\"Interrupt\",fiberId:s.fiberId}}}}))});return q(r.ast,{error:e,defect:t})}function VT(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(GT(n,o));return(a,i,c)=>eb(a)?Vt(nt(s)(a.reasons,c),{onSuccess:oa,onFailure:u=>Br(i,\"failures\",u,a,c)}):P(new ft(i,a,c))},{representation:{id:\"effect/schema/Cause\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Cause(${n[0].runtime}, ${n[1].runtime})`,Type:`Cause.Cause<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Cause from \"effect/Cause\"']}),expected:\"Cause\",toCodec:([n,o])=>Oe()($e(GT(n,o)),Pe({decode:oa,encode:({reasons:s})=>s}))});return q(r.ast,{error:e,defect:t})}function fU(e){return Oe()(e,Pe({decode:hE,encode:Ye}))}function ZZ(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>lh(o)?Vt(nt(n)(Ye(o),a),{onSuccess:hE,onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ft(s,o,a))},{representation:{id:\"effect/schema/Chunk\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Chunk(${r[0].runtime})`,Type:`Chunk.Chunk<${r[0].Type}>`}),expected:\"Chunk\",toCodec:([r])=>fU($e(r)),toCodecArbitrary:({constraint:r,typeParameters:[n]})=>fU(Cx($e(n),r?.minLength,r?.maxLength)),toEquivalence:([r])=>dE(r)});return q(t.ast,{value:e})}function mD(){return gt((e,t)=>Wt(yE(e),{onNone:()=>P(new de({message:\"Invalid DateTime input\"},e,t)),onSome:r=>g(SE(r))}))}var YZ=Pe({decode:e=>EE(e),encode:e=>e.offset}),hD=Yt({decode:(e,t)=>Wt(PR(e),{onNone:()=>P(new de({expected:\"a valid IANA time zone\"},e,t)),onSome:g}),encode:e=>g(e.id)}),xD=Yt({decode:(e,t)=>Wt(MR(e),{onNone:()=>P(new de({expected:\"a valid time zone\"},e,t)),onSome:g}),encode:e=>g(Dl(e))}),gD=Yt({decode:(e,t)=>Wt(yE(e),{onNone:()=>P(new de({expected:\"a valid UTC DateTime string\"},e,t)),onSome:r=>g(SE(r))}),encode:e=>g(UR(e))}),yD=Yt({decode:(e,t)=>Wt(RR(e),{onNone:()=>P(new de({expected:\"a valid Zoned DateTime string\"},e,t)),onSome:g}),encode:e=>g(IE(e))}),SD=-864e13,bD=864e13,QZ=SD+840*60*1e3,XZ=bD-840*60*1e3,e5=-720*60*1e3,t5=840*60*1e3,ED=[\"UTC\",\"Europe/London\",\"America/New_York\",\"Asia/Tokyo\",\"Australia/Sydney\"];function ID(e,t,r){let n=Math.max(t,e?.minimum===void 0?t:e.minimum.epochMilliseconds+(e.exclusiveMinimum===!0?1:0)),o=Math.min(r,e?.maximum===void 0?r:e.maximum.epochMilliseconds-(e.exclusiveMaximum===!0?1:0));return n<=o?[n,o]:[t,r]}function pw(e,t){return lo.check(Hu({minimum:e,maximum:t}))}function TD(){return it([pw(e5,t5),fo(ED)])}var Rx=Be(e=>gE(e)&&AR(e),{representation:{id:\"effect/schema/DateTimeUtc\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeUtc\",Type:\"DateTime.Utc\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Utc\",toCodecArbitrary:({constraint:e})=>{let[t,r]=ID(e,SD,bD);return ju()(pw(t,r),oe(OR))},toCodecJson:()=>Oe()(K,gD),toFormatter:()=>e=>e.toString()}),r5=Wu.pipe(G(Rx,{decode:mD(),encode:oe(FR)})),n5=K.annotate({expected:\"a string that will be decoded as a DateTime.Utc\"}).pipe(G(Rx,gD)),o5=lo.pipe(G(Rx,{decode:mD(),encode:oe(NR)})),s5=Be(wR,{representation:{id:\"effect/schema/TimeZoneOffset\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneOffset\",Type:\"DateTime.TimeZone.Offset\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Offset\",toCodecJson:()=>Oe()(lo,YZ),toFormatter:()=>e=>Dl(e)}),wD=K.annotate({expected:\"an IANA time zone identifier\"}),CD=Be(CR,{representation:{id:\"effect/schema/TimeZoneNamed\",payload:null},toCode:()=>({runtime:\"Schema.TimeZoneNamed\",Type:\"DateTime.TimeZone.Named\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone.Named\",toCodecArbitrary:()=>ju()(fo(ED),oe(bE)),toCodecJson:()=>Oe()(wD,hD),toFormatter:()=>e=>Dl(e)}),a5=wD.pipe(G(CD,hD)),AD=K.annotate({expected:\"a time zone string (IANA identifier or offset like +03:00)\"}),kD=Be(TR,{representation:{id:\"effect/schema/TimeZone\",payload:null},toCode:()=>({runtime:\"Schema.TimeZone\",Type:\"DateTime.TimeZone\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.TimeZone\",toCodecArbitrary:()=>ju()(TD(),oe(e=>typeof e==\"number\"?EE(e):bE(e))),toCodecJson:()=>Oe()(AD,xD),toFormatter:()=>e=>Dl(e)}),i5=AD.pipe(G(kD,xD)),vD=K.annotate({expected:\"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])\"}),OD=Be(e=>gE(e)&&kR(e),{representation:{id:\"effect/schema/DateTimeZoned\",payload:null},toCode:()=>({runtime:\"Schema.DateTimeZoned\",Type:\"DateTime.Zoned\",importDeclarations:['import * as DateTime from \"effect/DateTime\"']}),expected:\"DateTime.Zoned\",toCodecArbitrary:({constraint:e})=>{let[t,r]=ID(e,QZ,XZ);return ju()(Me({epochMilliseconds:pw(t,r),timeZone:TD()}),oe(({epochMilliseconds:n,timeZone:o})=>_R(n,{timeZone:o})))},toCodecJson:()=>Oe()(vD,yD),toFormatter:()=>e=>IE(e),toEquivalence:()=>vR}),c5=vD.pipe(G(OD,yD)),po=(e,t,r,n)=>K.pipe(G(e,Yt({decode:(o,s)=>{let a=t(o);return mt(a)?g(a.success):P(new de({message:a.failure.message},o,s))},encode:o=>g(r(o))}))).annotate({identifier:n}),Ji=Be(Pu,{identifier:\"MacAddress\"}),Ku=po(Ji,qN,PT,\"MacAddressFromString\"),Px=Be(hr,{identifier:\"Ipv4Address\"}),dw=po(Px,Mu,uo,\"Ipv4AddressFromString\"),mw=Be(Yo,{identifier:\"Ipv6Address\"}),_D=po(mw,Sp,uo,\"Ipv6AddressFromString\"),Ki=Be(jN,{identifier:\"IpAddress\"}),Gu=po(Ki,bp,uo,\"IpAddressFromString\"),Xe=(e,t,r,n)=>FU(t,{expected:r})(e).annotate({identifier:n}),u5=Xe(Ki,Fu,\"a multicast address\",\"IpMulticastAddress\"),f5=Xe(Gu,Fu,\"a multicast address\",\"IpMulticastAddressFromString\"),l5=Xe(Ji,Fu,\"a multicast address\",\"MacMulticastAddress\"),p5=Xe(Ku,Fu,\"a multicast address\",\"MacMulticastAddressFromString\"),d5=Xe(Ki,UT,\"a unicast address\",\"IpUnicastAddress\"),m5=Xe(Gu,UT,\"a unicast address\",\"IpUnicastAddressFromString\"),h5=Xe(Ji,mx,\"a unicast address\",\"MacUnicastAddress\"),x5=Xe(Ku,mx,\"a unicast address\",\"MacUnicastAddressFromString\"),g5=Xe(Px,xx,\"a broadcast address\",\"Ipv4BroadcastAddress\"),y5=Xe(dw,xx,\"a broadcast address\",\"Ipv4BroadcastAddressFromString\"),S5=Xe(Ji,dx,\"a broadcast address\",\"MacBroadcastAddress\"),b5=Xe(Ku,dx,\"a broadcast address\",\"MacBroadcastAddressFromString\"),E5=Xe(Ki,NT,\"a loopback address\",\"IpLoopbackAddress\"),I5=Xe(Gu,NT,\"a loopback address\",\"IpLoopbackAddressFromString\"),T5=Xe(Ki,DT,\"a link-local address\",\"IpLinkLocalAddress\"),w5=Xe(Gu,DT,\"a link-local address\",\"IpLinkLocalAddressFromString\"),C5=Xe(Ki,hx,\"an unspecified address\",\"IpUnspecifiedAddress\"),A5=Xe(Gu,hx,\"an unspecified address\",\"IpUnspecifiedAddressFromString\"),k5=Xe(Px,LT,\"a private address\",\"Ipv4PrivateAddress\"),v5=Xe(dw,LT,\"a private address\",\"Ipv4PrivateAddressFromString\"),O5=Xe(mw,$T,\"a unique-local address\",\"Ipv6UniqueLocalAddress\"),_5=Xe(_D,$T,\"a unique-local address\",\"Ipv6UniqueLocalAddressFromString\"),R5=Xe(Ji,MT,\"a locally administered address\",\"MacLocallyAdministeredAddress\"),P5=Xe(Ku,MT,\"a locally administered address\",\"MacLocallyAdministeredAddressFromString\"),M5=Xe(Ji,FT,\"a universally administered address\",\"MacUniversallyAdministeredAddress\"),F5=Xe(Ku,FT,\"a universally administered address\",\"MacUniversallyAdministeredAddressFromString\"),RD=Be(GN,{identifier:\"Ipv4Interface\"}),N5=po(RD,yx,Tp,\"Ipv4InterfaceFromString\"),PD=Be(VN,{identifier:\"Ipv6Interface\"}),U5=po(PD,Sx,Tp,\"Ipv6InterfaceFromString\"),MD=Be(Ep,{identifier:\"IpInterface\"}),D5=po(MD,bx,Tp,\"IpInterfaceFromString\"),FD=Be(YN,{identifier:\"Ipv4Network\"}),L5=po(FD,XN,Cp,\"Ipv4NetworkFromString\"),ND=Be(QN,{identifier:\"Ipv6Network\"}),$5=po(ND,eU,Cp,\"Ipv6NetworkFromString\"),UD=Be(wp,{identifier:\"IpNetwork\"}),B5=po(UD,tU,Cp,\"IpNetworkFromString\"),j5=Be(gp,{identifier:\"InetAddressV4\"}),z5=Be(yp,{identifier:\"InetAddressV6\"}),DD=Be(_T,{identifier:\"InetAddress\"}),q5=po(DD,JN,gx,\"InetAddressFromString\"),LD=Be(px,{identifier:\"UnixPathAddress\"}),H5=K.pipe(G(LD,Pe({decode:KN,encode:e=>e.path}))).annotate({identifier:\"UnixPathAddressFromString\"}),W5=Be(zN,{identifier:\"SocketAddress\"}),J5=Yt({decode:(e,t)=>Wt(kA(e),{onNone:()=>P(new de({expected:\"a valid Duration string\"},e,t)),onSome:g}),encode:e=>g(globalThis.String(e))}),K5=Yt({decode:e=>g(Ro(e)),encode:(e,t)=>Wt(OA(e),{onNone:()=>P(new de({expected:\"a Duration representable as a bigint\"},e,t)),onSome:r=>g(r)})}),G5=Pe({decode:e=>Js(e),encode:e=>Cr(e)}),Mx=Be(Ey,{representation:{id:\"effect/schema/Duration\",payload:null},toCode:()=>({runtime:\"Schema.Duration\",Type:\"Duration.Duration\",importDeclarations:['import * as Duration from \"effect/Duration\"']}),expected:\"Duration\",toCodecJson:()=>Oe()(it([Me({_tag:Ct(\"Infinity\")}),Me({_tag:Ct(\"NegativeInfinity\")}),Me({_tag:Ct(\"Nanos\"),value:Bu}),Me({_tag:Ct(\"Millis\"),value:lo})]),Pe({decode:e=>{switch(e._tag){case\"Infinity\":return ls;case\"NegativeInfinity\":return Ac;case\"Nanos\":return Ro(e.value);case\"Millis\":return Js(e.value)}},encode:e=>{switch(e.value._tag){case\"Infinity\":return{_tag:\"Infinity\"};case\"NegativeInfinity\":return{_tag:\"NegativeInfinity\"};case\"Nanos\":return{_tag:\"Nanos\",value:e.value.nanos};case\"Millis\":return{_tag:\"Millis\",value:e.value.millis}}}}))}),V5=K.annotate({expected:\"a string that will be decoded as a Duration\"}),hw=V5.pipe(G(Mx,J5)),Z5=Bu.pipe(G(Mx,K5)),Y5=Wi.pipe(G(Mx,G5));function Q5(e,t,r){let n=qr()([e,t,r],([o,s,a])=>{let i=VT(s,a);return(c,u,f)=>{if(!hl(c))return P(new ft(u,c,f));switch(c._tag){case\"Success\":return Vt(nt(o)(c.value,f),{onSuccess:vr,onFailure:p=>Br(u,\"value\",p,c,f)});case\"Failure\":return Vt(nt(i)(c.cause,f),{onSuccess:sn,onFailure:p=>Br(u,\"cause\",p,c,f)})}}},{representation:{id:\"effect/schema/Exit\",payload:null},toCode:({typeParameters:o})=>({runtime:`Schema.Exit(${o[0].runtime}, ${o[1].runtime}, ${o[2].runtime})`,Type:`Exit.Exit<${o[0].Type}, ${o[1].Type}, ${o[2].Type}>`,importDeclarations:['import * as Exit from \"effect/Exit\"']}),expected:\"Exit\",toCodec:([o,s,a])=>Oe()(it([Me({_tag:Ct(\"Success\"),value:o}),Me({_tag:Ct(\"Failure\"),cause:VT(s,a)})]),Pe({decode:i=>i._tag===\"Success\"?vr(i.value):sn(i.cause),encode:i=>Ve(i)?{_tag:\"Success\",value:i.value}:{_tag:\"Failure\",cause:i.cause}}))});return q(n.ast,{value:e,error:t,defect:r})}function lU(e,t,r){return Me({type:Ct(e),nodes:$e(Me({index:zi,data:t})),edges:$e(Me({index:zi,source:zi,target:zi,data:r}))})}function pU(e,t){let r=-1,n=new Set;for(let o=0;o{let o=Hl(r),s=Hl(n);if(o.type!==s.type||o.nodes.length!==s.nodes.length||o.edges.length!==s.edges.length)return!1;for(let a=0;a{if(n===null)return bh({type:e,nodes:[],edges:[]});let o=n.nodes.map((s,a)=>({index:a,data:s}));return bh({type:e,nodes:o,edges:n.edges.map(([s,a,i],c)=>({index:c,source:s%o.length,target:a%o.length,data:i}))})}))}function r8(e,t,r){let n=qr()([t,r],([o,s])=>{let a=lU(e,o,s);return(i,c,u)=>!QE(i)||i.mutable||i.type!==e?P(new ft(c,i,u)):I(nt(a)(Hl(i),u),f=>pU(f,u))},{representation:{id:\"effect/schema/Graph\",payload:e},toCode:({typeParameters:o})=>({runtime:`Schema.Graph(${F(e)}, ${o[0].runtime}, ${o[1].runtime})`,Type:`Graph.Graph<${o[0].Type}, ${o[1].Type}, ${F(e)}>`,importDeclarations:['import * as Graph from \"effect/Graph\"']}),expected:`an immutable ${e} Graph`,toCodec:([o,s])=>Oe()(lU(e,o,s),Yt({decode:pU,encode:(a,i)=>X5(a,e,i)})),toCodecArbitrary:({typeParameters:[o,s]})=>t8(e,o,s),toEquivalence:([o,s])=>e8(o,s)});return q(n.ast,{type:e,node:t,edge:r})}function dU(e){return Oe()(e,Pe({decode:PE,encode:zl}))}function n8(e,t){let r=qr()([e,t],([n,o])=>{let s=$e(Qo([n,o]));return(a,i,c)=>GR(a)?Vt(nt(s)(zl(a),c),{onSuccess:PE,onFailure:u=>Br(i,\"entries\",u,a,c)}):P(new ft(i,a,c))},{representation:{id:\"effect/schema/HashMap\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.HashMap(${n[0].runtime}, ${n[1].runtime})`,Type:`HashMap.HashMap<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as HashMap from \"effect/HashMap\"']}),expected:\"HashMap\",toCodec:([n,o])=>dU($e(Qo([n,o]))),toCodecArbitrary:({constraint:n,typeParameters:[o,s]})=>dU(Cx($e(Qo([o,s])).check(eD()),n?.minSize,n?.maxSize)),toEquivalence:([n,o])=>ld(n,o)});return q(r.ast,{key:e,value:t})}function mU(e){return Oe()(e,Pe({decode:NE,encode:Ye}))}function o8(e){let t=qr()([e],([r])=>{let n=$e(r);return(o,s,a)=>XR(o)?Vt(nt(n)(Ye(o),a),{onSuccess:NE,onFailure:i=>Br(s,\"values\",i,o,a)}):P(new ft(s,o,a))},{representation:{id:\"effect/schema/HashSet\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.HashSet(${r[0].runtime})`,Type:`HashSet.HashSet<${r[0].Type}>`}),expected:\"HashSet\",toCodec:([r])=>mU($e(r)),toCodecArbitrary:({constraint:r,typeParameters:[n]})=>mU(Cx($e(n).check(uw()),r?.minSize,r?.maxSize)),toEquivalence:([r])=>wf(r)});return q(t.ast,{value:e})}function Gi(e){let t=qr()([e],([r])=>(n,o,s)=>wc(n)?fe(n)?aa:Vt(nt(r)(n.value,s),{onSuccess:O,onFailure:a=>Br(o,\"value\",a,n,s)}):P(new ft(o,n,s)),{representation:{id:\"effect/schema/Option\",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Option(${r[0].runtime})`,Type:`Option.Option<${r[0].Type}>`,importDeclarations:['import * as Option from \"effect/Option\"']}),expected:\"Option\",toCodec:([r])=>Oe()(it([Me({_tag:Ct(\"Some\"),value:r}),Me({_tag:Ct(\"None\")})]),Pe({decode:n=>n._tag===\"None\"?v():O(n.value),encode:n=>be(n)?{_tag:\"Some\",value:n.value}:{_tag:\"None\"}}))});return q(t.ast,{value:e})}function s8(e){return rw(e).pipe(G(Gi(Hr(e)),dM()))}function a8(e){return Ax(e).pipe(G(Gi(Hr(e)),mM()))}function i8(e,t){return PU(e).pipe(G(Gi(Hr(e)),hM(t)))}var $D=Be(nP,{representation:{id:\"effect/http/Cookie\",payload:null},toCode:()=>({runtime:\"Schema.Cookie\",Type:\"Cookies.Cookie\",importDeclarations:['import * as Cookies from \"effect/http/Cookies\"']}),expected:\"Cookie\"}),BD=Be(rP,{representation:{id:\"effect/http/Cookies\",payload:null},toCode:()=>({runtime:\"Schema.Cookies\",Type:\"Cookies.Cookies\",importDeclarations:['import * as Cookies from \"effect/http/Cookies\"']}),expected:\"Cookies\",toCodecJson:()=>Oe()($e(K),Pe({decode:oP,encode:uP})),toCodecIso:()=>Oe()(_s(K,$D),Pe({decode:jE,encode:e=>e.cookies}))}),c8=BD.pipe(G(_s(K,K),Pe({decode:cP,encode:e=>zE(globalThis.Object.entries(e).map(([t,r])=>iP(t,r)))}))),u8=Be(dP,{representation:{id:\"effect/http/Headers\",payload:null},toCode:()=>({runtime:\"Schema.Headers\",Type:\"Headers.Headers\",importDeclarations:['import * as Headers from \"effect/http/Headers\"']}),expected:\"Headers\",toEquivalence:()=>KE,toCodec:()=>Oe()(_s(K,K),Pe({decode:mP,encode:e=>({...e})}))}),xw=Be(VE,{representation:{id:\"effect/http/UrlParams\",payload:null},toCode:()=>({runtime:\"Schema.UrlParams\",Type:\"UrlParams.UrlParams\",importDeclarations:['import * as UrlParams from \"effect/http/UrlParams\"']}),expected:\"UrlParams\",toEquivalence:()=>ZE,toCodec:()=>Oe()($e(Qo([K,K])),Pe({decode:Sh,encode:e=>e.params}))}),f8=(e,t)=>xw.pipe(G(lw(vp,t),Yt({decode:r=>Wt(gP(r,e),{onNone:()=>P(new ut([e],new ma(void 0))),onSome:g}),encode:r=>g(Sh([[e,r]]))}))),l8=xw.pipe(G(_s(K,it([K,tw(K)])),Pe({decode:yP,encode:hP})));function p8(e){return qi(e).pipe(G(Gi(Hr(e)),xM()))}function d8(e){return Lu(e).pipe(G(Gi(Hr(e)),gM()))}function m8(e,t){let r=t===void 0?\"omit\":t.onNoneEncoding,n=r===null?null:void 0;return Lu(rw(e)).pipe(G(Gi(Hr(e)),Ph({decode:o=>o.pipe(Va(cd),O),encode:r===\"omit\"?Ga:o=>O(Ff(Ga(o),()=>n))})))}function Fx(e,t){let r=typeof t?.label==\"string\"?t.label:void 0,n=t?.disallowJsonEncode===!0,o=r!==void 0?n?{label:r,disallowJsonEncode:!0}:{label:r}:n?{disallowJsonEncode:!0}:void 0,s=r!==void 0?nt(Ct(r)):void 0,a=qr()([e],([i])=>(c,u,f)=>{if(qE(c)){let p=s!==void 0?Ul(s(c.label,f),d=>new ut([\"label\"],d)):Q;return st(p,()=>Vt(nt(i)(au(c),f),{onSuccess:d=>ki(d,{label:c.label}),onFailure:()=>new wt(u,[new ut([\"value\"],new de(void 0,c,f))],c,f)}))}return P(new ft(u,c,f))},{representation:{id:\"effect/schema/Redacted\",payload:o??null},toCode:({typeParameters:i})=>({runtime:o!==void 0?`Schema.Redacted(${i[0].runtime}, ${F(o)})`:`Schema.Redacted(${i[0].runtime})`,Type:`Redacted.Redacted<${i[0].Type}>`,importDeclarations:['import * as Redacted from \"effect/Redacted\"']}),expected:\"Redacted\",toCodecJson:([i])=>Oe()(i,{decode:oe(c=>ki(c,{label:r})),encode:n?Ah(c=>\"Cannot serialize Redacted\"+(be(c)&&typeof c.value.label==\"string\"?` with label: \"${c.value.label}\"`:\"\")):oe(au)}),toEquivalence:([i])=>pP(i)});return q(a.ast,{value:e})}function h8(e,t){return G(Fx(Hr(e),{label:t?.label,disallowJsonEncode:t?.disallowEncode}),{decode:oe(r=>ki(r,{label:t?.label})),encode:t?.disallowEncode?Ah(r=>\"Cannot encode Redacted\"+(be(r)&&typeof r.value.label==\"string\"?` with label: \"${r.value.label}\"`:\"\")):oe(au)})(e)}function x8(e,t){let r=qr()([e,t],([n,o])=>(s,a,i)=>{if(!iA(s))return P(new ft(a,s,i));switch(s._tag){case\"Success\":return Vt(nT(n)(s.success,i),{onSuccess:B,onFailure:c=>Br(a,\"success\",c,s,i)});case\"Failure\":return Vt(nT(o)(s.failure,i),{onSuccess:W,onFailure:c=>Br(a,\"failure\",c,s,i)})}},{representation:{id:\"effect/schema/Result\",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Result(${n[0].runtime}, ${n[1].runtime})`,Type:`Result.Result<${n[0].Type}, ${n[1].Type}>`,importDeclarations:['import * as Result from \"effect/Result\"']}),expected:\"Result\",toCodec:([n,o])=>Oe()(it([Me({_tag:Ct(\"Success\"),success:n}),Me({_tag:Ct(\"Failure\"),failure:o})]),Pe({decode:s=>s._tag===\"Success\"?B(s.success):W(s.failure),encode:s=>mt(s)?{_tag:\"Success\",success:s.success}:{_tag:\"Failure\",failure:s.failure}}))});return q(r.ast,{success:e,failure:t})}var g8=globalThis.Symbol.for(\"immer-draftable\"),ZT={};function gw(e,t,r,n,o){let s=S8(r,t,n),a=jD(t),i=class extends e{constructor(...[c,u]){let p=u?.[\"~payload\"],d=p?.token===ZT?p.value:r.make(c??{},u);super(d,{...u,disableChecks:!0,\"~payload\":{token:ZT,value:d}})}static[Ap]=Ap;get[a](){return a}static[g8]=!0;static identifier=t;static fields=r.fields;static get ast(){return s(this).ast}static pipe(){return Z(this,arguments)}static rebuild(c){return s(this).rebuild(c)}static make(c,u){return Yh(s(this))(c??{},u)}static makeOption(c,u){return Zh(s(this))(c??{},u)}static makeEffect(c,u){return s(this).makeEffect(c??{},u)}static annotate(c){return this.rebuild(to(this.ast,c))}static annotateKey(c){return this.rebuild(cp(this.ast,c))}static check(...c){return this.rebuild(Vo(this.ast,c))}static extend(c){return(u,f)=>{let p=Fp(u)?u:Me(u),d={...r.fields,...p.fields},m=Lh(d,r.ast.checks,{identifier:c});return gw(this,c,ew(Vo(m,p.ast.checks),d),f,o)}}static mapFields(c,u){return r.mapFields(c,u)}};return o!==void 0&&Object.assign(i.prototype,o(t)),i}function y8(e){return new ve(oe(t=>new e(t,{\"~payload\":{token:ZT,value:t}})),jr())}function jD(e){return`~effect/Schema/Class/${e}`}function S8(e,t,r){let n;return o=>{if(n!==void 0)return n;let s=jD(t),a=u=>u instanceof o||k(u,s),i=y8(o),c=q(new yu([e.ast],()=>(u,f,p)=>a(u)?g(u):P(new ft(f,u,p)),{identifier:t,[Ih]:([u])=>({isConstructed:a,link:new at(u,i)}),toCodec:([u])=>new at(u.ast,i),toEquivalence:([u])=>u,toFormatter:([u])=>f=>`${o.identifier}(${u(f)})`,[Wl]:hu(e.ast),...r}));return n=G(c,i)(e)}}function Fp(e){return Tx(e)}var zD=e=>(t,r)=>{let n=Fp(t)?t:Me(t);return gw(Kd,e,n,r,o=>({toString(){return`${o}(${F({...this})})`}}))},b8=e=>(t,r,n)=>{let o=Fp(r)?r.mapFields(s=>({_tag:Hi(t),...s}),{unsafePreserveChecks:!0}):kx(t,r);return zD(e??t)(o,n)},qD=e=>(t,r)=>{let n=Fp(t)?t:Me(t);return gw(_f,e,n,r,s=>({name:s}))},E8=e=>(t,r,n)=>{let o=Fp(r)?r.mapFields(s=>({_tag:Hi(t),...s}),{unsafePreserveChecks:!0}):kx(t,r);return qD(e??t)(o,n)};function I8(e){return t=>t.annotate({toFormatter:e})}function T8(e,t){return _N(e.ast,t)}function w8(e){return t=>t.annotate({toEquivalence:e})}function C8(e){return bT(e.ast)}function A8(e,t){return mp(e.ast,t)}function k8(e,t){let r=mp(Cu(e.ast),t);return ix(r,t)}var v8=rx,O8=nx,Np=ox,_8=oN;function R8(e,t){return CN(e,t)}function P8(e){return DN(e)}function M8(e){return LN(e)}function F8(e){return $N(e)}function N8(e,t){return r=>q(to(r.ast,{toCodecIso:()=>new at(e.ast,Rh(t))}),{schema:r})}function U8(e){return wN(e)}function D8(e){let t=MU(()=>r),r=it([e,$e(t),_s(K,t)]);return r}var Nx=q(to(xu,{toCode:()=>({runtime:\"Schema.Json\",Type:\"Schema.Json\"})})),L8=_s(K,Nx),$8=Me({message:K,name:qi(K),stack:qi(K),cause:qi(Nx)}),B8=q(to(bF,{toCode:()=>({runtime:\"Schema.MutableJson\",Type:\"Schema.MutableJson\"})}));function j8(e){return As(e.ast)}function z8(e){return e.ast.context?.annotations}var HD=\"~effect/MutableHashMap\";var q8={[HD]:HD,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${F(Array.from(this))})`},toJSON(){return{_id:\"MutableHashMap\",values:vt(Array.from(this))}},[Te](){return this.toJSON()},pipe(){return Z(this,arguments)}},Up=()=>{let e=Object.create(q8);return e.backing=new Map,e.buckets=new Map,e};var Xo=l(2,(e,t)=>{if(e.backing.has(t))return O(e.backing.get(t));if(yw(t))return v();let r=H(t),n=e.buckets.get(r);return n===void 0?v():H8(e,n,t)}),yw=e=>typeof e!=\"object\"&&typeof e!=\"function\";var H8=(e,t,r)=>{for(let n=0,o=t.length;n{if(e.backing.has(t)||yw(t))return e.backing.set(t,r),e;let n=H(t),o=e.buckets.get(n);if(o===void 0)return e.buckets.set(n,[t]),e.backing.set(t,r),e;let s=W8(o,t);return s===void 0&&(o.push(t),s=t),e.backing.set(s,r),e}),W8=(e,t)=>{for(let r=0,n=e.length;r{if(yw(t))return e.backing.delete(t),e;let r=H(t),n=e.buckets.get(r);if(n===void 0)return e;for(let o=0,s=n.length;o(e.backing.clear(),e.buckets.clear(),e),WD=e=>e.backing.size;var JD=Qy;var Ea=Xy,KD=hk,mo=rl;var Zu=ds,Ia=dO;var Pr=JS,GD=bO;var VD=\"~effect/MutableRef\",J8={[VD]:VD,...rr,toJSON(){return{_id:\"MutableRef\",current:vt(this.current)}}},Yu=e=>{let t=Object.create(J8);return t.current=e,t};var ZD=e=>e.current;var Lx=l(2,(e,t)=>(e.current=t,e));var Xt=Symbol.for(\"effect/MutableList/Empty\"),Ps=()=>({head:void 0,tail:void 0,length:0}),Ew=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},YD=()=>({array:[],mutable:!0,offset:0,next:void 0}),ho=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=YD(),e.tail=e.tail.next):e.head=e.tail=YD(),e.tail.array.push(t),e.length++},Iw=(e,t)=>{e.head={array:[t],mutable:!0,offset:0,next:e.head},e.tail||(e.tail=e.head),e.length++};var $x=(e,t)=>Bx(e,Ye(t),!Array.isArray(t)),Bx=(e,t,r=!1)=>{if(t.length===0)return 0;let n={array:t,mutable:r,offset:0,next:void 0};return e.head?e.tail=e.tail.next=n:e.head=e.tail=n,e.length+=t.length,t.length},Rs=e=>{e.head=e.tail=void 0,e.length=0},Vi=(e,t)=>{if(t=ot(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let s=e.head.array;return Rs(e),s}let r=new Array(t),n=0,o=e.head;for(;o;){for(;o.offset{if(t=ot(t),t<=0||!e.head)return;if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){Rs(e);return}let r=0,n=e.head;for(;n;){let o=n.array.length-n.offset;if(r+o>t){n.offset+=t-r,e.head=n,e.length-=t,Ew(e);return}r+=o,n=n.next}Rs(e)},Ta=e=>Vi(e,e.length),Zi=e=>{if(!e.head)return Xt;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length?e.head.next?e.head=e.head.next:Rs(e):Ew(e),t},QD=(e,t)=>{if(t=ot(t),t<=0)return[];let r=Math.min(t,e.length),n=new Array(r),o=0,s=e.head;for(;s;){for(let a=s.offset;a{let r=[],n=e.head,o=0;for(;n;){for(let s=n.offset;sTw(e,r=>r!==t);var K8=\"~effect/PubSub\";var G8=\"~effect/PubSub/Subscription\",Jx=e=>X(()=>eY(e.atomicPubSub(),new Map,kn(),Pr(!1),Yu(!1),e.strategy(),Yu(v()))),Kx=e=>Jx({atomicPubSub:()=>Nw(e),strategy:()=>new qx}),Gx=e=>Jx({atomicPubSub:()=>Nw(e),strategy:()=>new Hx}),Vx=e=>Jx({atomicPubSub:()=>Nw(e),strategy:()=>new Fw}),Zx=e=>Jx({atomicPubSub:()=>e1(e),strategy:()=>new Hx}),Nw=e=>{let t=typeof e==\"number\"?{capacity:e}:e;if(tY(t.capacity),t.capacity===1/0)return e1(t);let r=t.replay&&t.replay>0?new Wx(Math.ceil(t.replay)):void 0;return t.capacity===1?new vw(r):T_(t.capacity)===t.capacity?new Aw(t.capacity,r):new ww(t.capacity,r)},e1=e=>{let t=e?.replay;return new _w(t&&t>0?new Wx(Math.ceil(t)):void 0)};var $p=e=>Ts(cn(t=>(Lx(e.shutdownFlag,!0),Le(e.scope,pb(t.id)).pipe(_r(e.strategy.shutdown),nh(e.shutdownHook.open),ia)))),Yx=l(2,(e,t)=>X(()=>V8(e,t))),V8=l(2,(e,t)=>{if(e.shutdownFlag.current||be(e.ended.current))return!1;if(Lx(e.ended,O(t)),e.strategy instanceof qx)for(let[n,o,s]of Ta(e.strategy.publishers))s&&Do(o,vr(!1));let r=vr(t);for(let n of e.subscribers.values())for(let o of n){let s;for(;(s=Zi(o))!==Xt;)Do(s,r)}return e.subscribers.clear(),!0});var Qx=l(2,(e,t)=>$(()=>e.shutdownFlag.current||be(e.ended.current)?g(!1):e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),g(!0)):e.strategy.handleSurplus(e.pubsub,e.subscribers,[t],e.shutdownFlag,e.ended)));var t1=l(2,(e,t)=>$(()=>{if(e.shutdownFlag.current||be(e.ended.current))return g(!1);let r=e.pubsub.publishAll(t);return e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),r.length===0?g(!0):e.strategy.handleSurplus(e.pubsub,e.subscribers,r,e.shutdownFlag,e.ended)})),Bp=e=>Ts(Ml(t=>{let r=Fe(t,Or),n=Nt(e.scope),o=X8(e.pubsub,e.subscribers,e.strategy,e.ended);return Kt(n,Z8(o)).pipe(_r(Lo(r,s=>Le(n,s))),Tt(o))})),Z8=e=>Ts(cn(t=>(Lx(e.shutdownFlag,!0),sa(Ta(e.pollers),r=>xb(r,t.id),{discard:!0,concurrency:\"unbounded\"}).pipe(Rr(()=>X(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),nh(e.shutdownHook.open),ia)))),Xx=e=>$(()=>{if(e.shutdownFlag.current)return _n;if(e.replayWindow.remaining>0){let r=e.replayWindow.take();return g(r)}let t=e.pollers.length===0?e.subscription.poll():Xt;return t===Xt?n1(e):(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),g(t))}),r1=e=>$(function t(r){if(e.shutdownFlag.current)return _n;let n=e.pollers.length===0?e.subscription.pollUpTo(Number.POSITIVE_INFINITY):[];return r&&(n=r.concat(n)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?g(e.replayWindow.takeAll().concat(n)):or(n)?g(n):I(n1(e),o=>t([o]))}),n1=e=>Yc(t=>{if(e.shutdownFlag.current)return t(_n);if(be(e.ended.current)){let o=e.pollers.length===0?e.subscription.poll():Xt;return o!==Xt?(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),t(g(o))):t(g(e.ended.current.value))}let r=ui(),n=e.subscribers.get(e.subscription);return n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),ho(e.pollers,r),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),r.effect?t(r.effect):(r.resumes=[t],X(()=>XD(e.pollers,r)))});var bt=Symbol.for(\"effect/PubSub/AbsentValue\"),Y8=(e,t,r)=>{e.has(t)||e.set(t,new Set),e.get(t).add(r)},Q8=(e,t,r)=>{if(!e.has(t))return;let n=e.get(t);n.delete(r),n.size===0&&e.delete(t)},X8=(e,t,r,n)=>new Pw(e,t,e.subscribe(),Ps(),Pr(!1),Yu(!1),r,e.replayWindow(),n),ww=class{array;replayIndices;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(t,r){this.capacity=t,this.replayBuffer=r,this.array=Array.from({length:t}),this.replayIndices=r?Array.from({length:t}):[],this.subscribers=Array.from({length:t})}replayWindow(){return this.replayBuffer?new Qu(this.replayBuffer):eg}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);if(this.subscriberCount!==0){let n=this.publisherIndex%this.capacity;this.array[n]=t,r!==void 0&&(this.replayIndices[n]=r),this.subscribers[n]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ye(t),n=r.length,o=this.publisherIndex-this.subscribersIndex,s=this.capacity-o,a=Math.min(n,s);if(a===0)return r;let i=0,c=this.publisherIndex+a;for(;this.publisherIndex!==c;){let u=r[i++],f=this.publisherIndex%this.capacity;this.array[f]=u;let p=this.replayBuffer?.offer(u);p!==void 0&&(this.replayIndices[f]=p),this.subscribers[f]=this.subscriberCount,this.publisherIndex+=1}return r.slice(i)}slide(){if(this.subscribersIndex!==this.publisherIndex){let t=this.subscribersIndex%this.capacity,r=this.array[t];this.array[t]=bt,this.subscribers[t]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(r,this.replayIndices[t])}}subscribe(){return this.subscriberCount+=1,new Cw(this,this.publisherIndex,!1)}},Cw=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return Xt;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let t=this.subscriberIndex%this.self.capacity,r=this.self.array[t];return this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1,r}return Xt}pollUpTo(t){if(t=ot(t),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let r=this.self.publisherIndex-this.subscriberIndex,n=Math.min(t,r);if(n<=0)return[];let o=[],s=this.subscriberIndex+n;for(;this.subscriberIndex!==s;){let a=this.subscriberIndex%this.self.capacity,i=this.self.array[a];this.self.subscribers[a]-=1,this.self.subscribers[a]===0&&(this.self.array[a]=bt,this.self.subscribersIndex+=1),o.push(i),this.subscriberIndex+=1}return o}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let t=this.subscriberIndex%this.self.capacity;this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}},Aw=class{array;replayIndices;mask;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(t,r){this.capacity=t,this.replayBuffer=r,this.array=Array.from({length:t}),this.replayIndices=r?Array.from({length:t}):[],this.mask=t-1,this.subscribers=Array.from({length:t})}replayWindow(){return this.replayBuffer?new Qu(this.replayBuffer):eg}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);if(this.subscriberCount!==0){let n=this.publisherIndex&this.mask;this.array[n]=t,r!==void 0&&(this.replayIndices[n]=r),this.subscribers[n]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ye(t),n=r.length,o=this.publisherIndex-this.subscribersIndex,s=this.capacity-o,a=Math.min(n,s);if(a===0)return r;let i=0,c=this.publisherIndex+a;for(;this.publisherIndex!==c;){let u=r[i++],f=this.publisherIndex&this.mask;this.array[f]=u;let p=this.replayBuffer?.offer(u);p!==void 0&&(this.replayIndices[f]=p),this.subscribers[f]=this.subscriberCount,this.publisherIndex+=1}return r.slice(i)}slide(){if(this.subscribersIndex!==this.publisherIndex){let t=this.subscribersIndex&this.mask,r=this.array[t];this.array[t]=bt,this.subscribers[t]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(r,this.replayIndices[t])}}subscribe(){return this.subscriberCount+=1,new kw(this,this.publisherIndex,!1)}},kw=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return Xt;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let t=this.subscriberIndex&this.self.mask,r=this.self.array[t];return this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1,r}return Xt}pollUpTo(t){if(t=ot(t),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let r=this.self.publisherIndex-this.subscriberIndex,n=Math.min(t,r);if(n<=0)return[];let o=[],s=this.subscriberIndex+n;for(;this.subscriberIndex!==s;){let a=this.subscriberIndex&this.self.mask,i=this.self.array[a];this.self.subscribers[a]-=1,this.self.subscribers[a]===0&&(this.self.array[a]=bt,this.self.subscribersIndex+=1),o.push(i),this.subscriberIndex+=1}return o}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let t=this.subscriberIndex&this.self.mask;this.self.subscribers[t]-=1,this.self.subscribers[t]===0&&(this.self.array[t]=bt,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}},vw=class{publisherIndex=0;subscriberCount=0;subscribers=0;value=bt;replayIndex=0;capacity=1;replayBuffer;constructor(t){this.replayBuffer=t}replayWindow(){return this.replayBuffer?new Qu(this.replayBuffer):eg}pipe(){return Z(this,arguments)}isEmpty(){return this.subscribers===0}isFull(){return!this.isEmpty()}size(){return this.isEmpty()?0:1}publish(t){if(this.isFull())return!1;let r=this.replayBuffer?.offer(t);return this.subscriberCount!==0&&(this.value=t,r!==void 0&&(this.replayIndex=r),this.subscribers=this.subscriberCount,this.publisherIndex+=1),!0}publishAll(t){if(this.subscriberCount===0)return this.replayBuffer&&this.replayBuffer.offerAll(t),[];let r=Ye(t);return r.length===0?r:this.publish(r[0])?r.slice(1):r}slide(){if(this.isFull()){let t=this.value;this.subscribers=0,this.value=bt,this.replayBuffer?.slide(t,this.replayIndex)}}subscribe(){return this.subscriberCount+=1,new Ow(this,this.publisherIndex,!1)}},Ow=class{self;subscriberIndex;unsubscribed;constructor(t,r,n){this.self=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){return this.unsubscribed||this.self.subscribers===0||this.subscriberIndex===this.self.publisherIndex}size(){return this.isEmpty()?0:1}poll(){if(this.isEmpty())return Xt;let t=this.self.value;return this.self.subscribers-=1,this.self.subscribers===0&&(this.self.value=bt),this.subscriberIndex=this.self.publisherIndex,t}pollUpTo(t){return ot(t)<1||this.isEmpty()?[]:[this.poll()]}unsubscribe(){this.unsubscribed||(this.unsubscribed=!0,this.self.subscriberCount-=1,this.self.subscribers!==0&&this.subscriberIndex!==this.self.publisherIndex&&(this.self.subscribers-=1,this.self.subscribers===0&&(this.self.value=bt)))}},_w=class{publisherHead={value:bt,replayIndex:void 0,subscribers:0,next:null};publisherTail=this.publisherHead;publisherIndex=0;subscribersIndex=0;capacity=Number.MAX_SAFE_INTEGER;replayBuffer;constructor(t){this.replayBuffer=t}replayWindow(){return this.replayBuffer?new Qu(this.replayBuffer):eg}isEmpty(){return this.publisherHead===this.publisherTail}isFull(){return!1}size(){return this.publisherIndex-this.subscribersIndex}publish(t){let r=this.replayBuffer?.offer(t),n=this.publisherTail.subscribers;if(n!==0){let o={value:t,replayIndex:r,subscribers:n,next:null};this.publisherTail.next=o,this.publisherTail=this.publisherTail.next,this.publisherIndex+=1}return!0}publishAll(t){if(this.publisherTail.subscribers!==0)for(let r of t)this.publish(r);else this.replayBuffer&&this.replayBuffer.offerAll(t);return[]}slide(){if(this.publisherHead!==this.publisherTail){let t=this.publisherHead.next,r=t.value;this.publisherHead=this.publisherHead.next,this.publisherHead.value=bt,this.subscribersIndex+=1,this.replayBuffer?.slide(r,t.replayIndex)}}subscribe(){return this.publisherTail.subscribers+=1,new Rw(this,this.publisherTail,this.publisherIndex,!1)}},Rw=class{self;subscriberHead;subscriberIndex;unsubscribed;constructor(t,r,n,o){this.self=t,this.subscriberHead=r,this.subscriberIndex=n,this.unsubscribed=o}isEmpty(){if(this.unsubscribed)return!0;let t=!0,r=!0;for(;r;)this.subscriberHead===this.self.publisherTail?r=!1:this.subscriberHead.next.value!==bt?(t=!1,r=!1):(this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1);return t}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return Xt;let t=!0,r=Xt;for(;t;)if(this.subscriberHead===this.self.publisherTail)t=!1;else{let n=this.subscriberHead.next.value;n!==bt&&(r=n,this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=bt,this.self.subscribersIndex+=1),t=!1),this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1}return r}pollUpTo(t){t=ot(t);let r=[],n=0;for(;n!==t;){let o=this.poll();o===Xt?n=t:(r.push(o),n+=1)}return r}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.publisherTail.subscribers-=1;this.subscriberHead!==this.self.publisherTail;)this.subscriberHead.next.value!==bt&&(this.subscriberHead.subscribers-=1,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=bt,this.self.subscribersIndex+=1)),this.subscriberHead=this.subscriberHead.next}},Pw=class{[G8]={_A:R};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;ended;constructor(t,r,n,o,s,a,i,c,u){this.pubsub=t,this.subscribers=r,this.subscription=n,this.pollers=o,this.shutdownHook=s,this.shutdownFlag=a,this.strategy=i,this.replayWindow=c,this.ended=u}pipe(){return Z(this,arguments)}},Mw=class{[K8]={_A:R};pubsub;subscribers;scope;shutdownHook;shutdownFlag;strategy;ended;constructor(t,r,n,o,s,a,i){this.pubsub=t,this.subscribers=r,this.scope=n,this.shutdownHook=o,this.shutdownFlag=s,this.strategy=a,this.ended=i}pipe(){return Z(this,arguments)}},eY=(e,t,r,n,o,s,a)=>new Mw(e,t,r,n,o,s,a),tY=e=>{if(e<=0||e!==1/0&&!Number.isInteger(e))throw new Error(`Cannot construct PubSub with capacity of ${e}`)},qx=class{publishers=Ps();get shutdown(){return cn(t=>sa(Ta(this.publishers),([r,n,o])=>o?xb(n,t.id):Q,{concurrency:\"unbounded\",discard:!0}))}handleSurplus(t,r,n,o,s){return Yc(a=>{if(be(s.current))return a(g(!1));let i=ui();return this.offerUnsafe(n,i),this.onPubSubEmptySpaceUnsafe(t,r),this.completeSubscribersUnsafe(t,r),ZD(o)?(this.removeUnsafe(i),a(_n)):i.effect?a(i.effect):(i.resumes=[a],X(()=>this.removeUnsafe(i)))})}onPubSubEmptySpaceUnsafe(t,r){let n=!0;for(;n&&!t.isFull();){let o=Zi(this.publishers);if(o===Xt)n=!1;else{let[s,a]=o,i=t.publish(s);i&&o[2]?Do(a,vr(!0)):i||Iw(this.publishers,o),this.completeSubscribersUnsafe(t,r)}}}completePollersUnsafe(t,r,n,o){return Uw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Dw(this,t,r)}offerUnsafe(t,r){let n=t[Symbol.iterator](),o=n.next();if(!o.done)for(;;){let s=o.value;if(o=n.next(),o.done){ho(this.publishers,[s,r,!0]);break}ho(this.publishers,[s,r,!1])}}removeUnsafe(t){Tw(this.publishers,([r,n])=>n!==t)}},Hx=class{get shutdown(){return Q}handleSurplus(t,r,n,o){return g(!1)}onPubSubEmptySpaceUnsafe(t,r){}completePollersUnsafe(t,r,n,o){return Uw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Dw(this,t,r)}},Fw=class{get shutdown(){return Q}handleSurplus(t,r,n,o,s){return X(()=>be(s.current)?!1:(this.slidingPublishUnsafe(t,n),this.completeSubscribersUnsafe(t,r),!0))}onPubSubEmptySpaceUnsafe(t,r){}completePollersUnsafe(t,r,n,o){return Uw(this,t,r,n,o)}completeSubscribersUnsafe(t,r){return Dw(this,t,r)}slidingPublishUnsafe(t,r){let n=r[Symbol.iterator](),o=n.next();if(!o.done&&t.capacity>0){let s=o.value,a=!0;for(;a;){t.slide();let i=t.publish(s);i&&(o=n.next())&&!o.done?s=o.value:i&&(a=!1)}}}},Uw=(e,t,r,n,o)=>{let s=!0;for(;s&&!n.isEmpty();){let a=Zi(o);if(a===Xt)Q8(r,n,o),o.length===0?s=!1:Y8(r,n,o);else{let i=n.poll();i===Xt?Iw(o,a):(Do(a,vr(i)),e.onPubSubEmptySpaceUnsafe(t,r))}}},Dw=(e,t,r)=>{for(let[n,o]of r)for(let s of o)e.completePollersUnsafe(t,r,n,s)},Wx=class{capacity;head={value:bt,index:0,next:null};tail=this.head;slideValues=[];size=0;index=0;publisherIndex=0;constructor(t){this.capacity=t}slide(t,r){this.slideValues[this.index%this.capacity]={value:t,index:r},this.index++}offer(t){let r=this.publisherIndex++;return this.tail.value=t,this.tail.index=r,this.tail.next={value:bt,index:0,next:null},this.tail=this.tail.next,this.size===this.capacity?this.head=this.head.next:this.size+=1,r}offerAll(t){for(let r of t)this.offer(r)}},Qu=class{buffer;values;index=0;remaining;slideIndex;newestIndex=-1;constructor(t){this.buffer=t,this.remaining=t.size,this.slideIndex=t.index,this.values=new Array(this.remaining);let r=t.head;for(let n=0;nthis.newestIndex&&(this.index=(this.index+1)%this.values.length,this.values[(this.index+this.remaining-1)%this.values.length]=s.value,this.newestIndex=s.index)}this.slideIndex=this.buffer.index}take(){if(this.remaining===0)return;this.sync();let t=this.values[this.index];return this.values[this.index]=bt,this.index=(this.index+1)%this.values.length,this.remaining--,this.remaining===0&&this.close(),t}takeN(t){t=ot(t);let r=Math.min(t,this.remaining),n=new Array(r);for(let o=0;o{},takeN:()=>[],takeAll:()=>[],close:()=>{}};var rY=\"~effect/Queue\",nY=\"~effect/Queue/Enqueue\",oY=\"~effect/Queue/Dequeue\";var $w={_A:R,_E:R},sY={[rY]:$w,[nY]:$w,[oY]:$w,...rr,toJSON(){return{_id:\"effect/Queue\",state:this.state._tag,size:cY(this)}}},Mn=e=>re(t=>{let r=Object.create(sY);return r.dispatcher=t.currentDispatcher,r.capacity=e?.capacity??Number.POSITIVE_INFINITY,r.strategy=e?.strategy??\"suspend\",r.messages=Ps(),r.scheduleRunning=!1,r.state={_tag:\"Open\",takers:new Set,offers:new Set,awaiters:new Set},D(r)}),jp=e=>Mn({capacity:e});var o1=()=>Mn(),Sn=l(2,(e,t)=>ne(()=>rg(e,t)?sg:e.state._tag===\"Open\"&&e.strategy===\"suspend\"?pY(e,t):a1)),rg=(e,t)=>e.state._tag!==\"Open\"?!1:e.messages.length>=e.capacity?e.strategy===\"sliding\"?(Zi(e.messages),ho(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0?(ho(e.messages,t),i1(e),!0):!1:(ho(e.messages,t),tg(e),!0),Yi=l(2,(e,t)=>ht(r=>{let n=ng(e,t);return n.length===0||e.strategy===\"dropping\"?r(Ae(n)):f1(e,{_tag:\"Array\",remaining:n,offset:0,resume:r})})),ng=(e,t)=>{if(e.state._tag!==\"Open\")return Ye(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy===\"sliding\")return $x(e.messages,t),e.strategy===\"sliding\"&&Vi(e.messages,e.messages.length-e.capacity),tg(e),[];let r=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(r===0)return Ye(t);let n=[],o=0;for(let s of t)oz(()=>wa(e,t))),wa=(e,t)=>{if(e.state._tag!==\"Open\")return!1;let r=Ht(t),n=Jk(r,uY);return e.state.offers.size===0&&e.messages.length===0?(ag(e,n),!0):(e.state={...e.state,_tag:\"Closing\",exit:n},tg(e),!0)},jw=e=>Bt(e,gc(Wa())),og=e=>wa(e,gc(Wa()));var Fn=e=>z(()=>aY(e)),aY=e=>{if(e.state._tag===\"Done\")return!1;Rs(e.messages);let t=e.state.offers;ag(e,e.state._tag===\"Open\"?fY:e.state.exit);for(let r of t)l1(r);return!0};var Qi=e=>s1(e,1,Number.POSITIVE_INFINITY);var s1=l(3,(e,t,r)=>(t=ot(t),r=ot(r),c1(()=>lY(e,t,r)??Fo(u1(e,()=>zw(e,t)),s1(e,t,r))))),Ms=e=>c1(()=>iY(e)??Fo(u1(e,()=>zw(e,1)),Ms(e)));var iY=e=>{if(e.state._tag===\"Done\")return e.state.exit;if(e.messages.length>0){let t=Zi(e.messages);return Bw(e),Ae(t)}else if(e.capacity<=0&&e.state.offers.size>0){let t=p1(e.state.offers);return Bw(e),Ae(t)}};var cY=e=>e.state._tag===\"Done\"?0:e.messages.length;var a1=Ae(!1),sg=Ae(!0),uY=en(Wa()),fY=Nc(),i1=e=>{if(!(e.state._tag===\"Done\"||e.state.takers.size===0)){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(pr),e.messages.length===0))break}},tg=e=>{e.scheduleRunning||e.state._tag===\"Done\"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,i1(e)},0))},lY=(e,t,r)=>{if(e.state._tag===\"Done\")return e.state.exit;if(r<=0||t<=0)return Ae([]);if(!zw(e,t))return;let n=e.messages.length>0?Vi(e.messages,r):[p1(e.state.offers)];return Bw(e),Ae(n)},c1=En({op:\"QueueTake\",[Ke](e){let t=this[ue]();return vf(t)?t[Ke](e):t}}),zw=(e,t)=>e.messages.length>=(e.state._tag===\"Closing\"?1:Math.min(t,e.capacity||1))||e.capacity<=0&&e.state._tag!==\"Done\"&&e.state.offers.size>0,u1=(e,t)=>ht(r=>{if(e.state._tag===\"Done\")return r(e.state.exit);if(t())return r(pr);let n={ready:t,resume:r};return e.state.takers.add(n),z(()=>{e.state._tag!==\"Done\"&&e.state.takers.delete(n)})}),pY=(e,t)=>ht(r=>rg(e,t)?r(sg):f1(e,{_tag:\"Single\",message:t,resume:r})),f1=(e,t)=>{if(e.state._tag!==\"Open\")return l1(t);let r=e.state.offers;return r.add(t),z(()=>{e.state._tag!==\"Done\"&&(r.delete(t),e.state._tag===\"Closing\"&&r.size===0&&e.messages.length===0&&ag(e,e.state.exit))})},l1=e=>e._tag===\"Single\"?e.resume(a1):e.resume(Ae(e.remaining.slice(e.offset))),p1=e=>{let t=e.values().next().value;if(t._tag===\"Single\")return e.delete(t),t.resume(sg),t.message;let r=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(Ae([]))),r},Bw=e=>{if(e.state._tag===\"Done\")return Bo(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===\"Closing\"&&e.messages.length===0?(ag(e,e.state.exit),Bo(e.state.exit.cause)):!1;for(let t of e.state.offers){let r=e.capacity-e.messages.length;if(r<=0)break;if(t._tag===\"Single\")ho(e.messages,t.message),e.state.offers.delete(t),t.resume(sg);else{for(;t.offset{if(e.state._tag===\"Done\")return;let r=e.state;e.state={_tag:\"Done\",exit:t};for(let n of r.takers)n.resume(t);r.takers.clear();for(let n of r.awaiters)n(t);r.awaiters.clear()};var ig=e=>new Hw(e),d1=(e,t,r)=>ht(n=>{if(e.free>=t)return n(r);let o=()=>{e.free{e.waiters.delete(o)})}),Hw=class{waiters=new Set;taken=0;permits;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take(t){let r=ne(()=>this.freethis.free0&&t.currentDispatcher.scheduleTask(()=>{for(let n of this.waiters){if(this.free<=0)break;n()}},0),this.free}resize(t){return re(r=>(this.permits=t,this.free<0?pe:(this.releaseUnsafe(r,0),pe)))}release(t){return re(r=>D(this.releaseUnsafe(r,t)))}get releaseAll(){return re(t=>D(this.releaseUnsafe(t,this.taken)))}withPermits(t){return r=>Hn(n=>{let o=ne(()=>{if(this.freeo)}return this.taken+=t,qn(n(r),()=>{this.releaseUnsafe(ds(),t)},!0)});return o})}withPermit=this.withPermits(1);withPermitsIfAvailable(t){return r=>Hn(n=>this.free{this.releaseUnsafe(ds(),t)},!0)))}};var Ww=e=>hl(e)?Ve(e)?Y(e.value):e:g(e);var y1=\"~effect/Channel\",cr=e=>k(e,y1),dY={[y1]:{_Env:R,_InErr:R,_InElem:R,_OutErr:R,_OutElem:R},pipe(){return Z(this,arguments)}},Ce=e=>{let t=Object.create(dY);return t.transform=(r,n)=>rt(e(r,n),o=>g(ze(o))),t},Nn=(e,t)=>Ce((r,n)=>I(he(e)(r,n),o=>t(o,n))),er=e=>Ce((t,r)=>e),go=e=>Ce(Se(function*(t,r){let n=Nt(r),o=a=>Le(n,Jm(a)),s=yield*Vn(e(t,r,n),o);return Vn(s,o)})),he=e=>e.transform,zp=4096,mY=(e,t,r)=>Mn({capacity:r?.bufferSize,strategy:r?.strategy}).pipe(Rr(n=>Kt(e,Fn(n))),Rr(n=>Es(t(n),e).pipe(rt(o=>Bt(n,o)),Ut(e))));var S1=(e,t)=>Ce((r,n)=>j(mY(n,e,t),Qi)),cg=e=>Ce((t,r)=>$(()=>he(e())(t,r))),hY=(e,t,r)=>go(Se(function*(n,o,s){let a=v();yield*Lo(s,c=>be(a)?r(a.value,c):Q);let i=yield*Ts(j(e,c=>(a=O(c),c)));return yield*he(t(i))(n,o)}));var b1=e=>er(X(()=>{let t=e();return $(()=>{let r=t.next();return r.done?Y(r.value):g(r.value)})})),Jw=e=>er(X(()=>{let t=0;return $(()=>t>=e.length?Y():g(e[t++]))}));var Kw=(e,t=zp)=>{let r=Tn(t);return er(X(()=>{let n=e(),o=v();return $(()=>{if(o._tag===\"Some\")return Y(o.value);let s=[];for(;s.lengthKw(()=>e[Symbol.iterator](),t),ug=e=>fg(g(e));var I1=e=>fg(X(e)),Xu=er(g(Y())),T1=er(g(mi)),es=e=>er(g(P(e))),w1=e=>er(Xm(e)),qp=e=>er(ze(e)),C1=e=>er(Is(e)),Gw=e=>qp(ci(e)),fg=e=>er(X(()=>{let t=!1;return $(()=>t?Y():(t=!0,e))}));var A1=e=>er(I(e,()=>Y())),Vw=e=>er(g(I(e,Ww)));var k1=e=>er(g(Qi(e)));var Zw=e=>er(g(Xb(r1(e),()=>Y())));var v1=e=>Ca(j(Bp(e),Zw)),O1=e=>Ca(j(Bp(e),t=>Vw(Xx(t))));var _1=e=>Ce((t,r)=>xY({scope:r,readable:e.evaluate(),onError:e.onError,releaseLockOnEnd:e.releaseLockOnEnd}));var xY=e=>{let t=e.readable.getReader(),r=e.exit??Yu(void 0),n=$(()=>r.current?r.current:zo(Zc({try:()=>t.read(),catch:e.onError}),{onFailure:o=>r.current??ze(o),onSuccess:({done:o,value:s})=>r.current?r.current:o?Y():g(Ee(s))}));return Tt(Kt(e.scope,e.releaseLockOnEnd?X(()=>t.releaseLock()):Qm(()=>t.cancel().catch($n))),n)},gY=(e,t)=>Ce(Se(function*(r,n){let o=e[Symbol.asyncIterator]();return o.return&&(yield*Kt(n,Qm(()=>o.return()))),I(Zc({try:()=>o.next(),catch:t}),s=>s.done?Y(s.value):g(s.value))})),R1=(e,t)=>yo(gY(e,t),Ee),yo=l(2,(e,t)=>Nn(e,r=>X(()=>{let n=0;return j(r,o=>t(o,n++))})));var P1=l(2,(e,t)=>Nn(e,r=>g(He(r,n=>I(t(n),Y))))),M1=e=>e===void 0||e!==\"unbounded\"&&e<=1,lg=l(e=>cr(e[0]),(e,t,r)=>M1(r?.concurrency)?F1(e,t):yY(e,t,r)),F1=(e,t)=>Ce((r,n)=>{let o=0;return j(he(e)(r,n),I(s=>t(s,o++)))}),yY=(e,t,r)=>go(Se(function*(n,o,s){let a=0,i=yield*he(e)(n,o),c=r.concurrency===\"unbounded\"?Number.MAX_SAFE_INTEGER:r.concurrency,u=yield*jp(0);yield*Kt(s,Fn(u));let f=Rn(yield*hi()),p=Ia(s);if(r.unordered){let d=ig(c),m=je(d.release(1)),x=zo({onFailure:y=>I(Bt(u,y),m),onSuccess:y=>I(Sn(u,y),m)});yield*d.take(1).pipe(I(()=>i),I(y=>{let S=a++;return p(f(x($(()=>t(y,S))))),Q}),$t({disableYield:!0}),rt(y=>d.withPermits(c-1)(Bt(u,y))),Ut(s))}else{let d=yield*jp(c-2);yield*Kt(s,Fn(d)),yield*Ms(d).pipe(qb,I(y=>Sn(u,y)),$t({disableYield:!0}),rt(y=>Bt(u,y)),Ut(s));let m,x=y=>{y._tag!==\"Success\"&&(m=y.cause,wa(u,y.cause))};yield*i.pipe(I(y=>{if(m)return ze(m);let S=a++,w=f($(()=>t(y,S)));return p(w),w.addObserver(x),Sn(d,Ea(w))}),$t({disableYield:!0}),rt(y=>Sn(d,sn(y)).pipe(_r(Bt(d,y)))),Ut(s))}return Ms(u)}));var Yw=l(e=>cr(e[0]),(e,t,r)=>M1(r?.concurrency)?SY(e,t):bY(e,t,r)),SY=(e,t)=>Ce((r,n)=>j(he(e)(r,n),o=>{let s,a,i=I(o,u=>(a??=Nt(n),st(he(t(u))(r,a),f=>(s=c(f),s)))),c=He(u=>{if(s=void 0,a.state._tag===\"Empty\")return i;let f=Le(a,xt);return a=void 0,I(f,()=>i)});return $(()=>s??i)})),bY=(e,t,r)=>e.pipe(yo(t),mg(r)),N1=l(2,(e,t)=>Ce((r,n)=>X(()=>{let o,s=Nt(n),a=I(he(e)(r,s),i=>(o=He(i,c=>Le(s,xt).pipe(I(()=>he(t(c))(r,n)),I(u=>(o=u,u)))),o));return $(()=>o??a)})));var Qw=l(4,(e,t,r,n)=>Ce(Se(function*(o,s){let a=yield*he(e)(o,s),i=yield*he(t)(o,s),c=r();return $(()=>{let u=n(c,a,i);return j(u,([f,p])=>(c=p,f))})}))),U1=l(2,(e,t)=>Ce((r,n)=>X(()=>{let o,s=Nt(n),a=I(he(e)(r,s),i=>{let c=i.pipe(Rr(()=>(o=i,Q)),He(u=>Le(s,vr(u)).pipe(_r(he(t(u))(r,n)),I(f=>(o=f,f)))));return o=c,c});return $(()=>o??a)}))),D1=e=>Yw(e,R),gr=e=>Nn(e,t=>{let r,n=0,o=$(function s(){if(r===void 0)return I(t,i=>{switch(i.length){case 0:return s();case 1:return g(i[0]);default:return r=i,g(i[n++])}});let a=r[n++];return n>=r.length&&(r=void 0,n=0),g(a)});return g(o)}),L1=e=>F1(e,Ww),$1=e=>Nn(e,t=>g($t(t,{disableYield:!0}))),B1=l(2,(e,t)=>Kn(typeof t==\"function\"?t(R):t).pipe(j(r=>{let n=Gt.defaultValue();return j1(yg(e,Gt,X(()=>n)),o=>r(o).pipe(j(s=>{n=s}),He(()=>Y(o))))}),Ca)),j1=(e,t)=>Ce((r,n)=>X(()=>{let o,s=()=>{let a=Nt(n);return I(he(e)(r,a),i=>(o=He(i,c=>Le(a,xt).pipe(I(()=>t(c)),I(s))),o))};return $(()=>o??s())})),z1=e=>j1(e,()=>Q),q1=l(2,(e,t)=>Nn(e,(r,n)=>j(Cl(t),o=>Rr(r,o)))),H1=l(2,(e,t)=>Ce((r,n)=>j(he(e)(r,n),o=>I(o,function s(a){return t(a)?g(a):I(o,s)}))));var W1=l(2,(e,t)=>Nn(e,r=>g(I(r,function n(o){let s=[];for(let a=0;aNn(e,r=>g(I(r,function n(o){let s=[];for(let a=0;aNn(e,r=>{let n=I(r,o=>Gb(o,t));return g(I(n,function o(s){return tt(s)?g(s):I(n,o)}))})),G1=l(2,(e,t)=>Nn(e,r=>g(I(r,function n(o){return I(Vb(o,t),s=>tt(s)?g(s):I(r,n))})))),ef=l(e=>cr(e[0]),(e,t,r,n)=>Ce((o,s)=>j(he(e)(o,s),a=>{let i=t(),c,u=0,f,p=zo(a,{onFailure(m){f=m;let x=n?.onHalt&&n.onHalt(i);return x&&x.length>0?g([i,x]):ze(m)},onSuccess(m){let x=r(i,m);return gA(x)?g(x):x}});return $(function m(){if(c===void 0)return f?ze(f):I(p,([y,S])=>(i=y,S.length===0?m():S.length===1?g(S[0]):(c=S,m())));let x=c[u++];return u>=c.length&&(c=void 0,u=0),g(x)})})));var V1=l(3,(e,t,r)=>Ce((n,o)=>j(he(e)(n,o),s=>{let a=t,i=!0;return $(()=>i?(i=!1,g(a)):j(I(s,c=>r(a,c)),c=>(a=c,a)))}))),tf=l(2,(e,t)=>Ce((r,n)=>{let o=Nt(n);return j(he(e)(r,o),s=>{let a=s.pipe(rt(i=>{if(Bo(i))return ze(i);let c=o;return o=Nt(n),Le(c,sn(i)).pipe(_r(he(t(i))(r,o)),I(u=>(a=u,u)))}));return $(()=>a)})})),Z1=l(2,(e,t)=>dg(e,dl,t)),pg=l(2,(e,t)=>tf(e,r=>A1(I(t(r),n=>ze(r))))),Y1=l(3,(e,t,r)=>tf(e,n=>t(n)?r(n):qp(n))),dg=l(3,(e,t,r)=>tf(e,n=>{let o=t(n);return ce(o)?qp(o.failure):r(o.success,n)})),xo=l(2,(e,t)=>dg(e,ab,r=>t(r)));var Q1=l(2,(e,t)=>Nn(e,r=>g(rh(r,n=>qc(n)?Q:ia(t(n)))))),X1=l(e=>cr(e[0]),(e,t,r,n)=>xo(e,o=>t(o)?r(o):n?n(o):es(o))),e2=l(e=>cr(e[0]),(e,t,r,n)=>xo(e,o=>{let s=t(o);return ce(s)?n?n(s.failure):es(s.failure):r(s.success)}));var t2=l(e=>cr(e[0]),(e,t,r,n,o)=>xo(e,s=>{if(At(s,t)&&k(s,\"reason\")){let a=s.reason;return At(a,r)?n(a,s):o?o(a,s):es(s)}return es(s)})),r2=l(e=>cr(e[0]),(e,t,r,n)=>{let o;return xo(e,s=>{if(At(s,t)&&k(s,\"reason\")&&k(s.reason,\"_tag\")&&Hm(s.reason._tag)){let a=s.reason;return o??=new Set(Object.keys(r)),o.has(a._tag)?r[a._tag](a,s):n?n(a,s):es(s)}return es(s)})});var n2=l(2,(e,t)=>xo(e,r=>es(t(r)))),o2=e=>xo(e,Gw),s2=l(e=>cr(e[0]),(e,t)=>{if(!t?.log)return xo(e,()=>Xu);let r=ih(t.log===!0?void 0:t.log);return xo(pg(e,n=>sb(n)?r(n):Q),()=>Xu)}),x1=e=>tf(e,()=>Xu),a2=l(e=>cr(e[0]),(e,t)=>{if(!t?.log)return x1(e);let r=ih(t.log===!0?void 0:t.log);return x1(pg(e,n=>r(n)))}),i2=l(2,(e,t)=>cg(()=>{let r,n=Gt.defaultValue(),o=yg(e,Gt,X(()=>n)),s=r0(o,()=>(r=void 0,Q)),a=typeof t==\"function\"?t(R):t,i=xo(s,Se(function*(c){return r||(r=yield*Kn(a)),n=yield*r(c),i},(c,u)=>He(c,()=>g(es(u))),Ca));return i})),c2=l(e=>cr(e[0]),(e,t,r)=>e.pipe(yo(t),mg({...r,concurrency:r?.concurrency??1,switch:!0}))),mg=l(2,(e,{bufferSize:t=16,concurrency:r,switch:n=!1})=>go(Se(function*(o,s,a){let i=r===\"unbounded\"?Number.MAX_SAFE_INTEGER:Math.max(1,r),c=n?void 0:ig(i),u=yield*GD(!0),f=new Set,p=yield*jp(t);yield*Kt(a,Fn(p));let d=yield*he(e)(o,s);return yield*dr(function*(){for(;;){let m;c&&(f.size=i;){let E=lA(f);f.delete(E),f.size===0&&(yield*u.open),yield*mo(E)}let w=yield*S.pipe(Rr(()=>Rl),I(E=>Sn(p,E)),$t({disableYield:!0}),Vn(Se(function*(E){let U=Jm(E),_=yield*vn(Le(y,U));if(!f.has(w))return;let h=hb([U,_]);Uo(h)&&(yield*Bt(p,h.cause)),f.delete(w),c&&(yield*c.release(1)),f.size===0&&(yield*u.open)})),eu);u.closeUnsafe(),f.add(w)}}).pipe(rt(m=>{let x=Tl(m);return mt(x)?u.whenOpen(Bt(p,m)):Bt(p,m)}),Ut(a)),Ms(p)}))),hg=l(e=>cr(e[0])&&cr(e[1]),(e,t,r)=>go(Se(function*(n,o,s){let a=r?.haltStrategy??\"both\",i=yield*jp(0);yield*Kt(s,Fn(i));let c=0;function u(p,d){if(c++,!Bo(d))return Bt(i,d);switch(a){case\"both\":return c===2?Bt(i,d):Q;case\"left\":case\"right\":return p===a?Bt(i,d):Q;case\"either\":return Bt(i,d)}}let f=(p,d,m)=>he(d)(n,m).pipe(I(x=>x.pipe(I(y=>Sn(i,y)),$t)),Vn(x=>Fl(Jm(x),y=>Le(m,y)).pipe(zo({onFailure:y=>u(p,y),onSuccess:()=>u(p,x)}))),Ut(s));return yield*f(\"left\",e,Nt(s)),yield*f(\"right\",t,Nt(s)),Ms(i)}))),u2=l(2,(e,t)=>hg(e,A1(t),{haltStrategy:\"left\"})),f2=()=>Ce((e,t)=>X(()=>{let r=\"\",n=!1,o=v();function s(c){let u=[];function f(p){r.length===0?u.push(p):(u.push(r+p),r=\"\")}for(let p=0;po._tag===\"Some\"?Y(o.value):Km(e,{onSuccess:i,onFailure:ze,onDone:c=>{if(o=O(c),r.length>0){let u=r;return r=\"\",n=!1,g([u])}return Y(c)}}));function i(c){let u=s(c);return u!==null?g(u):a}return a}));var Xw=l(2,(e,t)=>Ce((r,n)=>I(he(e)(r,n),o=>he(t)(o,n)))),e0=l(2,(e,t)=>Ce((r,n)=>I(he(e)(r,n),o=>{let s=rt(o,a=>Bo(a)?ze(a):an(ub(a)));return j(he(t)(s,n),a=>Wb(a,i=>qc(i)?ze(i.value):an(i)))}))),Ca=e=>Ce((t,r)=>{let n;return g($(()=>n||e.pipe(Es(r),I(o=>he(o)(t,r)),I(o=>n=o))))}),l2=e=>go((t,r,n)=>j(Es(he(e)(t,r),n),Es(n)));var p2=l(2,(e,t)=>Ce(Se(function*(r,n){let o=yield*he(e)(r,n),s=yield*Mn({capacity:t.capacity===\"unbounded\"?void 0:t.capacity,strategy:t.capacity===\"unbounded\"?void 0:t.strategy});return yield*Kt(n,Fn(s)),yield*o.pipe(I(a=>Sn(s,a)),$t({disableYield:!0}),Vn(a=>Bt(s,a)),Ut(n)),Ms(s)}))),d2=l(2,(e,t)=>Ce(Se(function*(r,n){let o=yield*he(e)(r,n),s=yield*Mn({capacity:t.capacity===\"unbounded\"?void 0:t.capacity,strategy:t.capacity===\"unbounded\"?void 0:t.strategy});return yield*Kt(n,Fn(s)),yield*o.pipe(I(a=>Yi(s,a)),$t({disableYield:!0}),Vn(a=>Bt(s,a)),Ut(n)),Qi(s)}))),t0=l(2,(e,t)=>hg(e,er(g(I(t,Y))),{haltStrategy:\"either\"})),m2=l(2,(e,t)=>go(Se(function*(r,n,o){let s=yield*he(e)(r,n),a=yield*Ut(t,o,{startImmediately:!0});return $(()=>{let i=a.pollUnsafe();return i===void 0?s:mb(i,{onFailure:ze,onSuccess:Y})})}))),h2=l(2,(e,t)=>Hp(e,r=>Uo(r)?t(r.cause):Q)),Hp=l(2,(e,t)=>go((r,n,o)=>Lo(o,t).pipe(_r(he(e)(r,n))))),x2=l(2,(e,t)=>Ca(Tt(t,e))),r0=l(2,(e,t)=>Nn(e,r=>X(()=>{let n=!0,o=Rr(r,s=>(n=!1,t(s)));return $(()=>n?o:r)}))),g2=l(2,(e,t)=>Nn(e,r=>g(He(r,n=>I(t,()=>Y(n)))))),y2=l(2,(e,t)=>Hp(e,r=>t)),Xi=(e,t,r)=>$(()=>{let n=kn(),o=he(e)(Y(),n);return He(I(o,t),r||g).pipe(un(s=>Le(n,s)))});var xg=l(2,(e,t)=>Ce((r,n)=>j(On(he(e)(r,n),t),On(t)))),gg=l(3,(e,t,r)=>Ce((n,o)=>j(qo(he(e)(n,o),t,r),qo(t,r)))),yg=l(3,(e,t,r)=>Ce((n,o)=>I(r,s=>he(gg(e,t,s))(n,o)))),S2=l(e=>cr(e[0]),(e,t,r)=>Uf(t)?xg(e,t):Ce((n,o)=>I(r?.local?yl(t,gl(),o):Lm(t,o),s=>j(On(he(e)(n,o),s),On(s))))),b2=l(2,(e,t)=>Ce((r,n)=>Ml(o=>{let s=t(o);return he(xg(e,s))(r,n)})));var n0=function(){let e=cr(arguments[0]),t=e?arguments[1]:arguments[0],r=Gs(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return g1(n,t,r)}return n=>g1(n,t,r)},g1=(e,t,r)=>hY(eE(t,r),n=>gg(e,ei,n),(n,o)=>cn(s=>{let a=s.getRef(Nr),i=s.getRef(ZO);return Rm(n,o,a,i)}));var E2=e=>Xi(e,t=>$t(t,{disableYield:!0})),ec=l(2,(e,t)=>Xi(e,r=>$t(I(r,t),{disableYield:!0}))),I2=l(2,(e,t)=>Xi(e,r=>r.pipe(I(t),I(n=>n?Q:Y()),$t({disableYield:!0})))),o0=e=>j(tc(e,()=>({bytes:0,arrays:[]}),(t,r)=>{for(let n=0;n{let n=new Uint8Array(r),o=0;for(let s=0;s$(()=>{let t=v();return Xi(e,r=>r.pipe(eh,I(n=>(t=n,Y()))),()=>g(t))}),w2=e=>$(()=>{let t=Symbol(),r=t;return Xi(e,n=>$t(I(n,o=>(r=o,Q)),{disableYield:!0}),()=>r===t?aa:zb(r))}),tc=l(3,(e,t,r)=>$(()=>{let n=t();return Xi(e,o=>Gn({while:Sr,body:()=>o,step:s=>{n=r(n,s)}}),()=>g(n))})),C2=l(3,(e,t,r)=>$(()=>{let n=t();return Xi(e,o=>Gn({while:Sr,body:je(o.pipe(I(s=>r(n,s)),j(s=>{n=s}))),step:$n}),()=>g(n))})),s0=Se(function*(e){let t=ig(1),r=yield*hi(),n=Fe(r,Or);return(yield*he(e)(Y(),n)).pipe(On(r),t.withPermits(1))},rt(e=>g(ze(e)))),ts=(e,t)=>he(e)(Y(),t);var a0=l(e=>cr(e[0]),(e,t)=>Ho(r=>ec(e,n=>Yi(t,n)).pipe(r,vn,I(n=>(Ve(n)?og(t):wa(t,n.cause),Q)))));var A2=l(e=>cr(e[0]),Se(function*(e,t){let r=yield*xi,n=yield*Mn({capacity:typeof t.capacity==\"number\"?t.capacity:void 0,strategy:typeof t.capacity==\"number\"?t.strategy:void 0});return yield*Kt(r,Fn(n)),yield*Ut(a0(e,n),r),n}));var k2=e=>gi(e.capacity===\"unbounded\"?Zx(e):e.strategy===\"dropping\"?Gx(e):e.strategy===\"sliding\"?Vx(e):Kx(e),$p),v2=l(2,Se(function*(e,t){let r=yield*k2(t);return yield*tu(i0(e,r,{shutdownOnEnd:t.shutdownOnEnd!==!1})),r})),i0=l(e=>cr(e[0]),(e,t,r)=>ec(e,n=>t1(t,n)).pipe(r?.shutdownOnEnd===!0?yi($p(t)):R)),O2=l(2,Se(function*(e,t){let r=yield*k2(t);return yield*ec(e,n=>Qx(r,n)).pipe(un(n=>Yx(r,n)),tu),r}));var Mr={};Eo(Mr,{Array:()=>DX,Boolean:()=>$X,ByteSize:()=>jX,ConfigError:()=>af,Date:()=>JX,Duration:()=>BX,Finite:()=>MX,Int:()=>FX,Literal:()=>NX,Literals:()=>UX,LogLevel:()=>qX,NonEmptyString:()=>RX,Number:()=>PX,Port:()=>zX,Record:()=>LX,Redacted:()=>HX,String:()=>_X,URL:()=>WX,all:()=>XL,fail:()=>vX,flatMap:()=>SX,isConfig:()=>YL,map:()=>QL,mapEffect:()=>bX,nested:()=>KX,option:()=>IX,orElse:()=>EX,schema:()=>tr,succeed:()=>OX,unwrap:()=>t$,withDefault:()=>e$});var sf={};Eo(sf,{ConfigProvider:()=>ac,SourceError:()=>Tg,constantCase:()=>rX,fromDir:()=>gX,fromDotEnv:()=>xX,fromDotEnvContents:()=>JL,fromEnv:()=>WL,fromEnvRecord:()=>R0,fromUnknown:()=>aX,layer:()=>oX,layerAdd:()=>sX,make:()=>Cg,makeArray:()=>O0,makeRecord:()=>wg,makeValue:()=>Yp,mapInput:()=>_0,nested:()=>nX,orElse:()=>v0});var _2=\"~effect/PlatformError\",rf=class extends Fr(\"BadArgument\"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:\"\"}`}};var R2=class extends Fr(\"PlatformError\"){constructor(t){\"cause\"in t?super({reason:t,cause:t.cause}):super({reason:t})}[_2]=_2;get message(){return this.reason.message}};var IY=\"~effect/Stream\",TY={_R:R,_E:R,_A:R},P2=function(e){this.channel=e};P2.prototype={[IY]:TY,pipe(){return Z(this,arguments)}};var M2=e=>new P2(e);var CY=\"~effect/Sink\";var AY={_A:R,_In:R,_L:R,_E:R,_R:R},kY={[CY]:AY,pipe(){return Z(this,arguments)}};var vY=e=>{let t=Object.create(kY);return t.transform=e,t},F2=e=>Ce((t,r)=>g(I(e.transform(t,r),Y)));var N2=e=>{let t=ot(e);return vY(r=>{let n=[];if(t===0)return g([n]);let o;return r.pipe(I(s=>{if(n.length+s.length<=t)return n.push(...s),n.length===t?Y():Q;for(let a=0;ag([n,o])))})};var ns={};Eo(ns,{DefaultChunkSize:()=>V2,Do:()=>y7,TypeId:()=>G2,accumulate:()=>t7,aggregate:()=>K9,aggregateWithin:()=>b0,as:()=>uQ,bind:()=>b7,bindEffect:()=>E7,bindTo:()=>I7,broadcast:()=>TL,broadcastN:()=>G9,buffer:()=>e9,bufferArray:()=>t9,callback:()=>Q2,catch:()=>Zp,catchCause:()=>uL,catchCauseFilter:()=>l9,catchCauseIf:()=>f9,catchDefect:()=>r9,catchFilter:()=>y0,catchIf:()=>lL,catchReason:()=>i9,catchReasons:()=>c9,catchTag:()=>s9,catchTags:()=>a9,changes:()=>r7,changesWith:()=>wL,changesWithEffect:()=>n7,chunks:()=>yL,collect:()=>e7,combine:()=>_9,combineArray:()=>R9,concat:()=>nc,cross:()=>MQ,crossWith:()=>iL,debounce:()=>D9,decodeText:()=>o7,die:()=>HY,drain:()=>yQ,drainFork:()=>SQ,drop:()=>S0,dropRight:()=>k9,dropUntil:()=>w9,dropUntilEffect:()=>C9,dropWhile:()=>xL,dropWhileEffect:()=>gL,dropWhileFilter:()=>A9,empty:()=>Ns,encodeText:()=>s7,ensuring:()=>d7,fail:()=>nf,failCause:()=>X2,failCauseSync:()=>WY,failSync:()=>qY,filter:()=>JQ,filterEffect:()=>GQ,filterMap:()=>KQ,filterMapEffect:()=>VQ,flatMap:()=>of,flatten:()=>oL,flattenArray:()=>gQ,flattenEffect:()=>lQ,flattenIterable:()=>CQ,flattenTake:()=>AQ,forever:()=>wQ,fromArray:()=>Gp,fromArrayEffect:()=>VY,fromArrays:()=>ZY,fromAsyncIterable:()=>eQ,fromChannel:()=>A,fromEffect:()=>Sg,fromEffectDrain:()=>Z2,fromEffectRepeat:()=>Y2,fromEffectSchedule:()=>$Y,fromEventListener:()=>nQ,fromIterable:()=>oc,fromIterableEffect:()=>KY,fromIterableEffectRepeat:()=>GY,fromIteratorSucceed:()=>JY,fromPubSub:()=>QY,fromPubSubTake:()=>eL,fromPull:()=>rs,fromQueue:()=>YY,fromReadableStream:()=>XY,fromSchedule:()=>tQ,fromSubscription:()=>rQ,groupAdjacentBy:()=>W9,groupBy:()=>q9,groupByKey:()=>H9,grouped:()=>j9,groupedWithin:()=>z9,haltWhen:()=>f7,ignore:()=>h9,ignoreCause:()=>x9,interleave:()=>c7,interleaveWith:()=>AL,interruptWhen:()=>u7,intersperse:()=>CL,intersperseAffixes:()=>i7,isStream:()=>Ie,iterate:()=>sQ,let:()=>S7,limitBytes:()=>b9,make:()=>jY,map:()=>Jr,mapAccum:()=>P9,mapAccumArray:()=>sc,mapAccumArrayEffect:()=>F9,mapAccumEffect:()=>M9,mapArray:()=>rL,mapArrayEffect:()=>pQ,mapBoth:()=>fQ,mapEffect:()=>Vp,mapError:()=>pL,merge:()=>d0,mergeAll:()=>PQ,mergeEffect:()=>bg,mergeLeft:()=>_Q,mergeResult:()=>OQ,mergeRight:()=>RQ,mkArrayBuffer:()=>F7,mkString:()=>M7,mkUint8Array:()=>N7,never:()=>iQ,onEnd:()=>p7,onError:()=>l7,onExit:()=>kL,onFirst:()=>OL,onStart:()=>vL,orDie:()=>m9,orElseIfEmpty:()=>p9,orElseSucceed:()=>d9,paginate:()=>oQ,partition:()=>YQ,partitionEffect:()=>ZQ,partitionQueue:()=>x0,peel:()=>XQ,pipeThrough:()=>X9,pipeThroughChannel:()=>Y9,pipeThroughChannelOrFail:()=>Q9,prepend:()=>vQ,provide:()=>_L,provideContext:()=>m7,provideService:()=>h7,provideServiceEffect:()=>E0,race:()=>WQ,raceAll:()=>cL,range:()=>aQ,rechunk:()=>SL,repeat:()=>bQ,repeatElements:()=>TQ,result:()=>dQ,retry:()=>g9,run:()=>T7,runCollect:()=>PL,runCount:()=>w7,runDrain:()=>Ig,runFold:()=>A7,runFoldEffect:()=>k7,runForEach:()=>_7,runForEachArray:()=>ML,runForEachWhile:()=>R7,runHead:()=>v7,runIntoPubSub:()=>B7,runIntoQueue:()=>q7,runLast:()=>O7,runSum:()=>C7,scan:()=>N9,scanEffect:()=>U9,schedule:()=>EQ,scoped:()=>cQ,service:()=>DY,serviceOption:()=>LY,share:()=>Z9,sliding:()=>v9,slidingSize:()=>bL,split:()=>O9,splitLines:()=>a7,succeed:()=>rc,suspend:()=>Wr,switchMap:()=>xQ,sync:()=>zY,take:()=>S9,takeRight:()=>E9,takeUntil:()=>dL,takeUntilEffect:()=>mL,takeWhile:()=>hL,takeWhileEffect:()=>T9,takeWhileFilter:()=>I9,tap:()=>nL,tapBoth:()=>mQ,tapCause:()=>fL,tapDefect:()=>o9,tapError:()=>g0,tapErrorTag:()=>n9,tapSink:()=>hQ,throttle:()=>B9,throttleEffect:()=>EL,tick:()=>BY,timeout:()=>IQ,timeoutOrElse:()=>sL,toAsyncIterable:()=>$7,toAsyncIterableEffect:()=>L7,toAsyncIterableWith:()=>T0,toChannel:()=>Un,toPubSub:()=>j7,toPubSubTake:()=>FL,toPull:()=>P7,toQueue:()=>z7,toReadableStream:()=>U7,toReadableStreamEffect:()=>D7,toReadableStreamWith:()=>I0,transduce:()=>J9,transformPull:()=>Dt,transformPullBracket:()=>p0,unfold:()=>tL,unwrap:()=>Aa,unwrapReason:()=>u9,updateContext:()=>RL,updateService:()=>x7,when:()=>QQ,withExecutionPlan:()=>y9,withSpan:()=>g7,zip:()=>NQ,zipFlatten:()=>LQ,zipLatest:()=>qQ,zipLatestAll:()=>h0,zipLatestWith:()=>HQ,zipLeft:()=>UQ,zipRight:()=>DQ,zipWith:()=>m0,zipWithArray:()=>Eg,zipWithIndex:()=>$Q,zipWithNext:()=>BQ,zipWithPrevious:()=>jQ,zipWithPreviousAndNext:()=>zQ});var D2=\"~effect/RcMap\",OY=e=>({[D2]:D2,lookup:e.lookup,context:e.context,scope:e.scope,idleTimeToLive:e.idleTimeToLive,capacity:e.capacity,state:{_tag:\"Open\",map:Up()},pipe(){return Z(this,arguments)}}),L2=e=>cn(t=>{let r=t.context,n=Fe(r,Or),o=OY({lookup:e.lookup,context:r,scope:n,idleTimeToLive:typeof e.idleTimeToLive==\"function\"?rC(e.idleTimeToLive,Ge):je(Ge(e.idleTimeToLive??Ws)),capacity:Math.max(e.capacity??Number.POSITIVE_INFINITY,0)});return Tt(Lo(n,()=>{if(o.state._tag===\"Closed\")return Q;let s=o.state.map;return o.state={_tag:\"Closed\"},sa(s,([,a])=>vn(Wp(a))).pipe(Rr(()=>X(()=>{Ux(s)})))}),o)}),u0=l(2,(e,t)=>Ho(r=>{if(e.state._tag===\"Closed\")return _n;let n=e.state,o=Zu(),s=Xo(n.map,t),a;if(s._tag===\"Some\")a=s.value,a.refCount++;else{if(Number.isFinite(e.capacity)&&WD(e.state.map)>=e.capacity)return P(new fb(`RcMap attempted to exceed capacity of ${e.capacity}`));{a={deferred:ui(),scope:kn(),idleTimeToLive:e.idleTimeToLive(t),finalizer:void 0,fiber:void 0,expiresAt:0,refCount:1},a.finalizer=RY(e,t,a),Dp(n.map,t,a);let c=new Map(e.context.mapUnsafe);o.context.mapUnsafe.forEach((f,p)=>{c.set(p,f)}),c.set(Or.key,a.scope);let u=Oo(c);$(()=>e.lookup(t)).pipe(Rn(u),Ia(a.scope)).addObserver(f=>{db(f)&&_Y(e,t,a,u),Do(a.deferred,f)})}}let i=_o(o.context,Or);return Kt(i,a.finalizer).pipe(_r(r(Fm(a.deferred))))}));var _Y=(e,t,r,n)=>{if(e.state._tag===\"Closed\")return;let o=Xo(e.state.map,t);o._tag===\"None\"||o.value!==r||(Vu(e.state.map,t),!(r.refCount>0)&&Wp(r).pipe(Rn(n),Ia(e.scope)))},Wp=e=>e.fiber?mo(e.fiber).pipe(_r(Le(e.scope,xt))):Le(e.scope,xt),RY=(e,t,r)=>cn(n=>{if(r.refCount--,r.refCount>0)return Q;if(e.state._tag===\"Closed\")return Wp(r);let o=Xo(e.state.map,t);if(o._tag===\"None\"||o.value!==r)return Wp(r);if(vc(r.idleTimeToLive))return Vu(e.state.map,t),Wp(r);if(!Ks(r.idleTimeToLive))return Q;let s=n.getRef(Hc);return r.expiresAt=s.currentTimeMillisUnsafe()+Cr(r.idleTimeToLive),r.fiber?Q:(r.fiber=Ho(function a(i){let c=s.currentTimeMillisUnsafe(),u=r.expiresAt-c;if(u<=0){if(e.state._tag===\"Closed\"||r.refCount>0)return Q;let f=Xo(e.state.map,t);return f._tag===\"None\"||f.value!==r?Q:(Vu(e.state.map,t),Le(r.scope,xt))}return I(i(s.sleep(Js(u))),()=>a(i))}).pipe(yi(X(()=>{r.fiber=void 0})),Rn(n.context),Ia(e.scope)),Q)});var f0=l(2,(e,t)=>Si(r=>{if(e.state._tag===\"Closed\")return Q;let n=Xo(e.state.map,t);if(n._tag===\"None\"||vc(n.value.idleTimeToLive))return Q;let o=n.value;return o.expiresAt=r.currentTimeMillisUnsafe()+Cr(o.idleTimeToLive),Q}));var PY=\"~effect/RcRef\",Jp={_tag:\"Empty\"},MY={_tag:\"Closed\"},FY={_A:R,_E:R},l0=class{[PY]=FY;pipe(){return Z(this,arguments)}state=Jp;acquire;context;scope;idleTimeToLive;constructor(t,r,n,o){this.acquire=t,this.context=r,this.scope=n,this.idleTimeToLive=o}},j2=e=>cn(t=>{let r=t.context,n=Fe(r,Or),o=new l0(e.acquire,r,n,e.idleTimeToLive!==void 0?Ge(e.idleTimeToLive):void 0);return Tt(Lo(n,()=>{let s=o.state;return o.state=MY,s._tag===\"Acquired\"?Le(s.scope,xt):s._tag===\"Acquiring\"?mo(s.fiber):Q}),o)}),NY=(e,t)=>{switch(e.state._tag){case\"Closed\":return _n;case\"Acquired\":{let r=e.state;return r.refCount++,r.fiber?Tt(mo(r.fiber),r):g(r)}case\"Acquiring\":{let r=e.state;return r.awaiters++,B2(e,r,t)}case\"Empty\":{let r={_tag:\"Acquiring\",fiber:void 0,awaiters:1,acquired:void 0};e.state=r;let n=kn(),o=On(e.acquire,Jt(e.context,Or,n)).pipe(I(s=>{if(e.state!==r)return _n;let a={_tag:\"Acquired\",value:s,scope:n,fiber:void 0,refCount:r.awaiters,invalidated:!1};return e.state=a,r.acquired=a,g(a)}),un(s=>Ve(s)?Q:(e.state===r&&(e.state=Jp),Le(n,s))));return r.fiber=Rn(Zu().context)(o),B2(e,r,t)}}},B2=(e,t,r)=>un(r(Ea(t.fiber)),n=>{let o=t.acquired;return o!==void 0?Uo(n)?q2(e,o):Q:--t.awaiters>0||e.state!==t?Q:(e.state=Jp,mo(t.fiber))}),z2=e=>{let t=e;return Ho(r=>I(xi,n=>I(NY(t,r),o=>Tt(Lo(n,()=>q2(t,o)),o.value))))},q2=(e,t)=>{if(t.refCount--,t.refCount>0)return Q;let r=e.idleTimeToLive;return r===void 0||t.invalidated?(e.state===t&&(e.state=Jp),Le(t.scope,xt)):Ks(r)?(t.fiber=Ho(n=>I(n(ua(r)),()=>e.state===t&&t.refCount===0?(e.state=Jp,Le(t.scope,xt)):Q)).pipe(yi(X(()=>{t.fiber=void 0})),Rn(e.context),Ia(e.scope)),Q):Q};var H2=j2,W2=z2;var G2=\"~effect/Stream\",Ie=e=>k(e,G2),V2=zp,A=M2,Sg=e=>A(fg(j(e,Ee))),DY=e=>Sg(Yb(e)),LY=e=>Sg(Qb(e)),Z2=e=>rs(g(I(e,()=>Y()))),Y2=e=>rs(g(j(e,Ee))),$Y=(e,t)=>rs(dr(function*(){let r=yield*Kn(t),n=yield*qo(e,Gt,Gt.defaultValue()),o=!0,s=$(()=>r(n)).pipe(I(a=>qo(e,Gt,a)),j(a=>(n=a,Ee(a))));return $(()=>o?(o=!1,g(Ee(n))):s)})),BY=e=>rs(X(()=>{let t=!0,r=g(Ee(void 0)),n=Jb(r,e);return $(()=>t?(t=!1,r):n)})),rs=e=>A(er(e)),Dt=(e,t)=>A(Ce((r,n)=>I(ts(e.channel,n),o=>t(o,n)))),p0=(e,t)=>A(go((r,n,o)=>I(ts(e.channel,n),s=>t(s,n,o)))),Un=e=>e.channel,Q2=(e,t)=>A(S1(e,t)),Ns=A(Xu),rc=e=>A(ug(Ee(e))),jY=(...e)=>Gp(e),zY=e=>A(I1(()=>Ee(e()))),Wr=e=>A(cg(()=>e().channel)),nf=e=>A(es(e)),qY=e=>A(w1(e)),X2=e=>A(qp(e)),HY=e=>A(Gw(e)),WY=e=>A(C1(e)),JY=(e,t)=>A(Kw(()=>e,t)),oc=(e,t)=>Array.isArray(e)&&t?.chunkSize===void 0?Gp(e):A(E1(e,t?.chunkSize)),KY=e=>Aa(j(e,oc)),GY=e=>of(Y2(e),oc),Gp=e=>tt(e)?A(ug(e)):Ns,VY=e=>Aa(j(e,Gp)),ZY=(...e)=>A(Jw(jd(e,tt))),YY=e=>A(k1(e)),QY=e=>A(v1(e)),eL=e=>A(O1(e)),XY=e=>A(_1(e)),eQ=(e,t)=>A(R1(e,t)),tQ=e=>rs(j(Cl(e),t=>He(j(t(void 0),Ee),()=>Y()))),rQ=e=>A(Zw(e)),nQ=(e,t,r)=>Q2(n=>{let o=typeof r==\"object\"&&r.once;function s(a){rg(n,a),o&&og(n)}return gi(X(()=>e.addEventListener(t,s,r)),()=>X(()=>e.removeEventListener(t,s,r)))},{bufferSize:typeof r==\"object\"?r.bufferSize:void 0}),tL=(e,t)=>rs(X(()=>{let r=e;return I($(()=>t(r)),n=>n===void 0?Y():(r=n[1],g(Ee(n[0]))))})),oQ=(e,t)=>rs(X(()=>{let r=e,n=!1;return $(function o(){return n?Y():I(t(r),([s,a])=>(fe(a)?n=!0:r=a.value,tt(s)?g(s):o()))})})),sQ=(e,t)=>tL(e,r=>g([r,t(r)])),aQ=(e,t,r=zp)=>e>t?Ns:rs(X(()=>{let n=Tn(r),o=e,s=!1;return $(()=>{if(s)return Y();let a=t-o+1;if(a>n){let c=xy(o,o+n-1);return o+=n,g(c)}let i=xy(o,o+a-1);return s=!0,g(i)})})),iQ=A(T1),Aa=e=>A(Ca(j(e,Un))),cQ=e=>A(l2(e.channel)),Jr=l(2,(e,t)=>Wr(()=>{let r=0;return A(yo(e.channel,wn(n=>t(n,r++))))})),uQ=l(2,(e,t)=>Jr(e,()=>t)),fQ=l(2,(e,t)=>e.pipe(Jr(t.onElement),pL(t.onError))),rL=l(2,(e,t)=>A(yo(e.channel,t))),Vp=l(e=>Ie(e[0]),(e,t,r)=>e.channel.pipe(gr,lg(t,r),yo(Ee),A)),lQ=l(e=>Ie(e[0]),(e,t)=>Vp(e,R,t)),pQ=l(2,(e,t)=>A(lg(e.channel,t))),dQ=e=>e.pipe(Jr(B),Zp(t=>rc(W(t)))),nL=l(e=>Ie(e[0]),(e,t,r)=>Vp(e,n=>Tt(t(n),n),r)),mQ=l(2,(e,t)=>e.pipe(g0(t.onError),nL(t.onElement,{concurrency:t.concurrency}))),hQ=l(2,(e,t)=>p0(e,Se(function*(r,n,o){let s=Pr(),a=Pr(),i,c,u=!1,f=!1,p=s.whenOpen($(()=>{if(i){let m=i;return i=void 0,f||s.closeUnsafe(),Tt(a.open,m)}return Y()}));yield*$(()=>t.transform(p,o)).pipe(m=>Fl(m,x=>(u=!0,Uo(x)&&(c=x.cause),a.open),!0),Ut(o));let d=r.pipe(I(m=>c?ze(c):u?g(m):(i=m,a.closeUnsafe(),s.openUnsafe(),Tt(a.await,m))),He(()=>c?ze(c):u?Y():(f=!0,a.closeUnsafe(),s.openUnsafe(),I(a.await,()=>c?ze(c):Y()))));return $(()=>c?ze(c):u?r:d)}))),of=l(e=>Ie(e[0]),(e,t,r)=>e.channel.pipe(gr,Yw(n=>t(n).channel,r),A)),xQ=l(e=>Ie(e[0]),(e,t,r)=>e.channel.pipe(gr,c2(n=>t(n).channel,r),A)),oL=l(e=>Ie(e[0]),(e,t)=>of(e,R,t)),gQ=e=>A(gr(e.channel)),yQ=e=>A($1(e.channel)),SQ=l(2,(e,t)=>bg(e,Ig(t))),bQ=l(2,(e,t)=>A(B1(e.channel,t))),EQ=l(2,(e,t)=>e.channel.pipe(gr,q1(t),yo(Ee),A)),IQ=l(2,(e,t)=>sL(e,{duration:t,orElse:()=>Ns})),sL=l(2,(e,t)=>{let r=Ge(t.duration);if(!Ks(r))return e;if(vc(r))return Wr(t.orElse);let n=Symbol();return uL(Wr(()=>{let s=Zu().getRef(Hc),a=Cr(r),i,c=Pr(!1);return d0(Dt(e,(u,f)=>$(()=>(i=s.currentTimeMillisUnsafe()+a,c.openUnsafe(),u)).pipe(j(p=>(c.closeUnsafe(),i=void 0,p)),g)),Z2(dr(function*(){for(;;)if(yield*c.await,!(i===void 0||(yield*ua(i-s.currentTimeMillisUnsafe()),i===void 0)||i-s.currentTimeMillisUnsafe()>0))return yield*an(n)})),{haltStrategy:\"left\"})}),o=>o.reasons.find(a=>a._tag===\"Die\"&&a.defect===n)?t.orElse():X2(o))}),TQ=l(2,(e,t)=>A(Ce((r,n)=>j(he(gr(e.channel))(r,n),o=>{let s,a=dr(function*(){let i=yield*o,c=Ee(i);return s=(yield*Cl(t))(i).pipe(Tt(c),He(f=>(s=void 0,a))),c});return $(()=>s??a)})))),wQ=e=>A(z1(e.channel)),CQ=e=>of(e,oc),AQ=e=>e.channel.pipe(gr,L1,A),nc=l(2,(e,t)=>{let r=A(D1(b1(()=>kQ(e,t))));return aL.set(r,[e,t]),r}),aL=new WeakMap;function*kQ(e,t){let r=[t,e];for(;r.length>0;){let n=r.pop(),o=aL.get(n);o===void 0?yield n.channel:r.push(o[1],o[0])}}var vQ=l(2,(e,t)=>nc(oc(t),e)),d0=l(e=>Ie(e[0])&&Ie(e[1]),(e,t,r)=>A(hg(Un(e),Un(t),r))),bg=l(2,(e,t)=>e.channel.pipe(u2(t),A)),OQ=l(2,(e,t)=>d0(Jr(e,B),Jr(t,W))),_Q=l(2,(e,t)=>bg(e,Ig(t))),RQ=l(2,(e,t)=>bg(t,Ig(e))),PQ=l(2,(e,t)=>oL(oc(e),t)),MQ=l(2,(e,t)=>iL(e,t,(r,n)=>[r,n])),iL=l(3,(e,t,r)=>of(e,n=>Jr(t,o=>r(n,o)))),m0=l(3,(e,t,r)=>Eg(e,t,FQ(r))),FQ=e=>(t,r)=>{let n=Math.min(t.length,r.length),o=[];for(let s=0;sA(go(Se(function*(n,o){let s=yield*ts(e.channel,o),a=yield*ts(t.channel,o),i=dr(function*(){let f=yield*Ut(s,o),p=yield*Ut(a,o);return yield*KD([f,p])}),c={_tag:\"PullBoth\"};return dr(function*(){let[f,p]=c._tag===\"PullBoth\"?yield*i:c._tag===\"PullLeft\"?[yield*s,c.rightArray]:[c.leftArray,yield*a],d=r(f,p);return tt(d[1])?c={_tag:\"PullRight\",leftArray:d[1]}:tt(d[2])?c={_tag:\"PullLeft\",rightArray:d[2]}:c={_tag:\"PullBoth\"},d[0]})})))),NQ=l(2,(e,t)=>m0(e,t,(r,n)=>[r,n])),UQ=l(2,(e,t)=>Eg(e,t,(r,n)=>{let o=Math.min(r.length,n.length),s=r.slice(0,o),a=r.slice(o),i=n.slice(o);return[s,a,i]})),DQ=l(2,(e,t)=>Eg(e,t,(r,n)=>{let o=Math.min(r.length,n.length),s=n.slice(0,o),a=r.slice(o),i=n.slice(o);return[s,a,i]})),LQ=l(2,(e,t)=>m0(e,t,(r,n)=>[...r,n])),$Q=e=>Jr(e,(t,r)=>[t,r]),BQ=e=>sc(e,v,(t,r)=>{let n=0;t._tag===\"None\"&&(n=1,t=O(r[0]));let o=Pt();for(;nsc(e,v,(t,r)=>{let n=Pt();for(let o=0;osc(e,()=>({prev:v(),current:v()}),(t,r)=>{let n=0,o;t.current._tag===\"None\"?(n=1,o=r[0],t.current=O(o)):o=t.current.value;let s=Pt();for(;nA(cg(()=>{let t=[],r=new Set,n=Pr(),o=Pr();return mg(Jw(e.map((s,a)=>s.channel.pipe(gr,lg(i=>(t[a]=i,r.has(a)?g(Ee(t.slice())):(r.add(a),r.sizer.has(a)?Q:o.open)))),{concurrency:\"unbounded\",bufferSize:0}).pipe(t0(o.await))})),qQ=l(2,(e,t)=>h0(e,t)),HQ=l(3,(e,t,r)=>Jr(h0(e,t),([n,o])=>r(n,o))),cL=(...e)=>A(Ce((t,r)=>X(()=>{let n,o=Kb(e.map(s=>{let a=Nt(r);return ts(s.channel,a).pipe(I(i=>Hb(g(i),i)),un(i=>i._tag===\"Success\"?n?Le(a,i):(n=i.value[0],Q):Le(a,i)),j(([,i])=>i))}));return $(()=>n??o)}))),WQ=l(2,(e,t)=>cL(e,t)),JQ=l(2,(e,t)=>A(W1(Un(e),t))),KQ=l(2,(e,t)=>A(J1(Un(e),t))),GQ=l(2,(e,t)=>A(K1(Un(e),t))),VQ=l(2,(e,t)=>A(G1(Un(e),t))),x0=l(e=>Ie(e[0]),Se(function*(e,t,r){let n=yield*xi,o=yield*ts(e.channel,n),s=r?.capacity===\"unbounded\"?void 0:r?.capacity??V2,a=yield*Mn({capacity:s}),i=yield*Mn({capacity:s});return yield*dr(function*(){for(;;){let c=yield*o,u=[],f=[];for(let d=0;d0){let d=ng(a,f);d.length>0&&(p=yield*eu(Yi(a,d)))}if(u.length>0){let d=ng(i,u);d.length>0&&(yield*Yi(i,d))}p&&(yield*Ea(p))}}).pipe(Vn(c=>(wa(a,c),wa(i,c),Q)),Ut(n)),[a,i]})),Kp=e=>A(Ce((t,r)=>Tt(Kt(r,Fn(e)),Qi(e)))),ZQ=l(e=>Ie(e[0]),(e,t,r)=>j(x0(Vp(e,n=>t(n),r),n=>n,r),([n,o])=>[Kp(n),Kp(o)])),YQ=l(e=>Ie(e[0]),(e,t,r)=>j(x0(e,t,{capacity:r?.capacity??16}),([n,o])=>[Kp(n),Kp(o)])),QQ=l(2,(e,t)=>t.pipe(j(r=>r?e:Ns),Aa)),XQ=l(2,Se(function*(e,t){let r,n=yield*s0(e.channel),o=rt(n,c=>(r=c,ze(c))),[s,a]=yield*sh(c=>t.transform(o,c)),i=r?Ns:rs(g(n));return a&&(i=nc(Gp(a),i)),[s,i]})),e9=l(2,(e,t)=>A(d2(e.channel,t))),t9=l(2,(e,t)=>A(p2(e.channel,t))),uL=l(2,(e,t)=>e.channel.pipe(tf(r=>t(r).channel),A)),r9=l(2,(e,t)=>e.channel.pipe(Z1(r=>t(r).channel),A)),fL=l(2,(e,t)=>e.channel.pipe(pg(t),A)),Zp=l(2,(e,t)=>A(xo(e.channel,r=>t(r).channel)));var g0=l(2,(e,t)=>e.channel.pipe(Q1(t),A)),n9=l(3,(e,t,r)=>{let n=Array.isArray(t)?o=>k(o,\"_tag\")&&t.includes(o._tag):At(t);return g0(e,o=>n(o)?r(o):Q)}),o9=l(2,(e,t)=>fL(e,r=>{let n=dl(r);return mt(n)?t(n.success):Q})),lL=l(e=>Ie(e[0]),(e,t,r,n)=>A(X1(Un(e),t,o=>r(o).channel,n&&(o=>n(o).channel)))),y0=l(e=>Ie(e[0]),(e,t,r,n)=>A(e2(Un(e),t,o=>r(o).channel,n&&(o=>n(o).channel)))),s9=l(e=>Ie(e[0]),(e,t,r,n)=>{let o=Array.isArray(t)?s=>k(s,\"_tag\")&&t.includes(s._tag):At(t);return lL(e,o,r,n)}),a9=l(e=>Ie(e[0]),(e,t,r)=>{let n;return y0(e,o=>(n??=Object.keys(t),k(o,\"_tag\")&&Hm(o._tag)&&n.includes(o._tag)?B(o):W(o)),o=>t[o._tag](o),r)}),i9=l(e=>Ie(e[0]),(e,t,r,n,o)=>A(t2(Un(e),t,r,(s,a)=>n(s,a).channel,o&&((s,a)=>o(s,a).channel)))),c9=l(e=>Ie(e[0]),(e,t,r,n)=>{let o=Object.create(null);for(let a of Object.keys(r)){let i=r[a];o[a]=(c,u)=>i(c,u).channel}let s=n&&((a,i)=>n(a,i).channel);return A(r2(e.channel,t,o,s))}),u9=l(2,(e,t)=>y0(e,r=>At(r,t)&&k(r,\"reason\")?B(r.reason):W(r),nf)),pL=l(2,(e,t)=>A(n2(e.channel,t))),f9=l(3,(e,t,r)=>A(Y1(e.channel,t,n=>r(n).channel))),l9=l(3,(e,t,r)=>A(dg(e.channel,t,(n,o)=>r(n,o).channel))),p9=l(2,(e,t)=>A(U1(e.channel,r=>Un(t())))),d9=l(2,(e,t)=>Zp(e,r=>rc(t(r)))),m9=e=>A(o2(e.channel)),h9=l(e=>Ie(e[0]),(e,t)=>A(s2(e.channel,t))),x9=l(e=>Ie(e[0]),(e,t)=>A(a2(e.channel,t))),g9=l(2,(e,t)=>A(i2(e.channel,t))),K2=(e,t)=>Aa(j(Kn(t),r=>{let n=Gt.defaultValue(),o=()=>Zp(E0(e,Gt,X(()=>n)),s=>Aa(He(j(r(s),a=>(n=a,Aa(Tt(Rl,o())))),()=>g(nf(s)))));return o()})),y9=l(e=>Ie(e[0]),(e,t,r)=>Wr(()=>{let n=r?.preventFallbackOnPartialStream??!1,o=0,s={attempt:0,stepIndex:0},a=E0(Gm,X(()=>(s={attempt:s.attempt+1,stepIndex:o},s))),i=r?.onEvent===void 0?void 0:$b(r.onEvent,()=>s),c,u=i===void 0?R:d=>kL(vL(d,j(i.begin,m=>{c=m})),m=>$(()=>{if(c===void 0)return Q;let x=c;return c=void 0,i.end(x,m)})),f=v(),p=Wr(()=>{let d=t.steps[o];if(!d)return nf(uy(f));let m=a(u(_L(e,d.provide))),x=!1;if(be(f)){let y=f.value,S=!1,w=m;m=Wr(()=>S?w:(S=!0,nf(y))),m=K2(m,_l(d,!1))}else{let y=_l(d,!0);m=y?K2(m,y):m}return Zp(n?OL(m,y=>(x=!0,Q)):m,y=>(o++,n&&x?nf(y):(f=O(y),p)))});return p})),S9=l(2,(e,t)=>{let r=ot(t);return r===0?Ns:dL(e,(n,o)=>o===r-1)}),b9=l(3,(e,t,r)=>Wr(()=>{let n=ch(t),o=BigInt(0),s=!1;return nc(hL(e,a=>{let i=o+BigInt(a.length);return i>n?(s=!0,!1):(o=i,!0)}),Wr(()=>s?r():Ns))})),E9=l(2,(e,t)=>{let r=ot(t);return r===0?Ns:sc(e,Ps,(n,o)=>($x(n,o),n.length>r&&jx(n,n.length-r),[n,Fs]),{onHalt(n){return Ta(n)}})}),dL=l(e=>Ie(e[0]),(e,t,r)=>Dt(e,(n,o)=>X(()=>{let s=0,a=!1;return I($(()=>a?Y():n),c=>{let u=c.findIndex(f=>t(f,s++));if(u>=0){a=!0;let f=c.slice(0,r?.excludeLast?u:u+1);return tt(f)?g(f):Y()}return g(c)})}))),mL=l(e=>Ie(e[0]),(e,t,r)=>Dt(e,(n,o)=>X(()=>{let s=0,a=!1;return dr(function*(){if(a)return yield*Y();let i=yield*n;for(let c=0;cDt(e,(r,n)=>X(()=>{let o=0,s=!1,a=I($(()=>s?Y():r),i=>{let c=[];for(let u=0;uDt(e,(r,n)=>X(()=>{let o=!1,s=I($(()=>o?Y():r),a=>{let i=[];for(let c=0;cmL(e,(r,n)=>j(t(r,n),o=>!o),{excludeLast:!0})),S0=l(2,(e,t)=>{let r=ot(t);return r===0?e:Dt(e,(n,o)=>X(()=>{let s=0,a=n.pipe(I(i=>s>=r?g(i):(s+=i.length,s<=r?a:g(i.slice(r-s)))));return a}))}),w9=l(2,(e,t)=>S0(xL(e,(r,n)=>!t(r,n)),1)),C9=l(2,(e,t)=>S0(gL(e,(r,n)=>j(t(r,n),o=>!o)),1)),xL=l(2,(e,t)=>Dt(e,(r,n)=>X(()=>{let o=!0,s=0,a=I(r,i=>{let c=i.findIndex(u=>!t(u,s++));return c===-1?a:(o=!1,g(i.slice(c)))});return $(()=>o?a:r)}))),A9=l(2,(e,t)=>Dt(e,(r,n)=>X(()=>{let o=!0,s=I(r,a=>{let i=a.findIndex(c=>ce(t(c)));return i===-1?s:(o=!1,g(a.slice(i)))});return $(()=>o?s:r)}))),gL=l(2,(e,t)=>Dt(e,(r,n)=>X(()=>{let o=!0,s=0,a=dr(function*(){for(;;){let i=yield*r;for(let c=0;co?a:r)}))),k9=l(2,(e,t)=>{let r=ot(t);return r===0?e:Dt(e,(n,o)=>X(()=>{let s=Ps(),a=I(n,i=>{Bx(s,i);let c=s.length-r,u=Vi(s,c);return or(u)?g(u):a});return a}))}),yL=e=>e.channel.pipe(yo(Ee),A),SL=l(2,(e,t)=>(t=Tn(t),Dt(e,(r,n)=>X(()=>{let o=Pt(),s=0,a,i=!1;return $(function c(){if(i)return Y();if(a===void 0)return I(r,u=>{if(o.length===0&&u.length===t)return g(u);if(o.length+u.length{if(o.length===0)return Y();let c=o;return i=!0,o=[],g(c)}))})))),v9=l(2,(e,t)=>bL(e,t,1)),bL=l(3,(e,t,r)=>{let n=Tn(t),o=Tn(r);return Dt(e,(s,a)=>X(()=>{let i=null,c=Ps(),u=!1,f=0,p=zo(s,{onSuccess(d){if(Bx(c,d),f>0){let x=c.length;jx(c,f),f=Math.max(0,f-x)}if(c.length=n;)if(n===o)m.push(Vi(c,n));else{m.push(QD(c,n));let x=c.length;jx(c,o),f=Math.max(0,o-x)}return g(m)},onFailure(d){return c.length===0||u&&c.length<=n-o?ze(d):(i=d,g(Ee(Ta(c))))}});return $(()=>i?ze(i):p)}))}),O9=l(2,(e,t)=>sc(e,Pt,(r,n)=>{let o=Pt();for(let s=0;sQw(gr(e.channel),gr(t.channel),r,n).pipe(yo(Ee),A)),R9=l(4,(e,t,r,n)=>A(Qw(e.channel,t.channel,r,n))),P9=l(e=>Ie(e[0]),(e,t,r,n)=>A(ef(e.channel,t,(o,s)=>{let a=Pt();for(let i=0;iIe(e[0]),(e,t,r,n)=>A(ef(e.channel,t,(o,s)=>{let[a,i]=r(o,s);return o=a,[o,tt(i)?Ee(i):Fs]},n?.onHalt?{onHalt(o){let s=n.onHalt(o);return tt(s)?Ee(s):Fs}}:void 0))),Fs=Pt(),M9=l(e=>Ie(e[0]),(e,t,r,n)=>e.channel.pipe(gr,ef(t,(o,s)=>j(r(o,s),([a,i])=>[a,tt(i)?Ee(i):Pt()]),n?.onHalt?{onHalt(o){let s=n.onHalt(o);return tt(s)?Ee(s):Fs}}:void 0),A)),F9=l(e=>Ie(e[0]),(e,t,r,n)=>e.channel.pipe(ef(t,(o,s)=>j(r(o,s),([a,i])=>[a,tt(i)?Ee(i):Fs]),n?.onHalt?{onHalt(o){let s=n.onHalt(o);return tt(s)?Ee(s):Fs}}:void 0),A)),N9=l(3,(e,t,r)=>Wr(()=>{let n=t();return nc(rc(n),A(ef(e.channel,()=>n,(o,s)=>{let a=Pt();for(let i=0;iWr(()=>e.channel.pipe(gr,V1(t(),r),yo(Ee),A))),D9=l(2,(e,t)=>Dt(e,Se(function*(r,n){let o=yield*Hc,s=Cr(Ge(t)),a,i,c=1/0,u=Pr(),f=Pr(),p=Pr();yield*r.pipe(u.whenOpen,I(m=>(f.openUnsafe(),a=m,c=o.currentTimeMillisUnsafe()+s,Q)),$t({disableYield:!0}),Vn(m=>(i=m,c=o.currentTimeMillisUnsafe(),f.openUnsafe(),p.openUnsafe(),Q)),Ut(n));let d=$(function m(){let x=o.currentTimeMillisUnsafe(),y=c{if(o.currentTimeMillisUnsafe(){if(i){if(a){let m=g(Ee(Bd(a)));return a=void 0,m}return ze(i)}return u.openUnsafe(),f.whenOpen(d)})}))),EL=l(2,(e,t)=>{let r=t.burst??0;return t.strategy===\"enforce\"?L9(e,t.cost,t.units,t.duration,r):$9(e,t.cost,t.units,t.duration,r)}),L9=(e,t,r,n,o)=>Dt(e,s=>Si(a=>{let i=Cr(Ge(n)),c=r+o<0?Number.POSITIVE_INFINITY:r+o,u=r,f=a.currentTimeMillisUnsafe();return g(I(s,function p(d){return I(t(d),m=>{let x=a.currentTimeMillisUnsafe(),S=(x-f)/i,w=u+S*r,E=w<0?c:Math.min(w,c);return m<=E?(u=E-m,f=x,g(d)):I(s,p)})}))})),$9=(e,t,r,n,o)=>Dt(e,s=>Si(a=>{let i=Cr(Ge(n)),c=r+o<0?Number.POSITIVE_INFINITY:r+o,u=r,f=a.monotonicTimeNanosUnsafe();return g(I(s,p=>I(t(p),d=>{let m=a.monotonicTimeNanosUnsafe(),y=Number(m-f)/1e6/i,S=u+y*r,E=Math.min(S,c)-d;if(E>=0)return u=E,f=m,g(p);let U=-E/r,_=Math.max(0,U*i);return _>0?I(ua(_),()=>(u=E,f=m,g(p))):(u=E,f=m,g(p))})))})),B9=l(2,(e,t)=>EL(e,{...t,cost:r=>g(t.cost(r))})),j9=l(2,(e,t)=>yL(SL(e,t))),z9=l(3,(e,t,r)=>b0(e,N2(Tn(t)),Nb(r))),q9=l(e=>Ie(e[0]),(e,t,r)=>IL(e,Se(function*(n,o,s){for(let a=0;aIe(e[0]),(e,t,r)=>Wr(()=>{let n=Up();return IL(e,Se(function*(o,s,a){for(let i=0;ip0(e,Se(function*(n,o,s){let a=yield*o1();yield*Kt(o,Fn(a));let i=Up(),c=yield*L2({lookup:u=>gi(Mn({capacity:r?.bufferSize??4096}).pipe(Rr(f=>(Dp(i,u,f),Sn(a,[u,Kp(f)])))),f=>(Vu(i,u),jw(f))),idleTimeToLive:r?.idleTimeToLive??ls}).pipe(Es(s));return yield*Gn({while:Sr,body:je(I(n,u=>t(u,c,i))),step:$n}).pipe(rt(u=>Bt(a,u)),Ut(o)),Qi(a)})),W9=l(2,(e,t)=>Dt(e,(r,n)=>X(()=>{let o,s,a=Pt(),i=r.pipe(I(u=>{for(let f=0;fc?Y():i),()=>{c=!0;let u=s;return s=void 0,u&&or(u)?g(Ee([o,u])):Y()})}))),J9=l(2,(e,t)=>Dt(e,(r,n)=>X(()=>{let o,s,a=$(()=>{if(s!==void 0){let c=s;return s=void 0,g(c)}return r}).pipe(ca(c=>(o=bs(c),Y()))),i=j($(()=>t.transform(a,n)),([c,u])=>(s=u,Ee(c)));return $(()=>o||i)}))),K9=l(2,(e,t)=>b0(e,t,kl)),b0=l(3,(e,t,r)=>A(go(Se(function*(n,o,s){let a=yield*ts(e.channel,o),i=Pr(!1),c=Symbol(),u=yield*Mn({capacity:0});yield*a.pipe(i.whenOpen,I(h=>(i.closeUnsafe(),Sn(u,h))),$t,rt(h=>Bt(u,h)),Ut(s));let f=yield*Hc,p=yield*di(r),d=Pr(!1),m=f.currentTimeMillisUnsafe(),x=0,y=v(),S,w=h=>(d.openUnsafe()&&(x=f.currentTimeMillisUnsafe()),g(h)),E=d.await.pipe(I(()=>p(m,y)),I(([,h])=>ua(h)),I(()=>Sn(u,c)),He(()=>jw(u)),I(()=>mi)),U=$(()=>{if(S!==void 0){let h=S;return S=void 0,w(h)}return u.state._tag===\"Open\"&&i.openUnsafe(),I(Ms(u),h=>h===c?Y():w(h))}),_=I(([h,b])=>{if(d.isOpen())m+=f.currentTimeMillisUnsafe()-x;else if(u.state._tag===\"Done\")return Y();return y=O(h),S=b,g(Ee(h))});return $(()=>{if(u.state._tag===\"Done\"&&S===void 0)return u.state.exit;d.closeUnsafe();let h=_($(()=>t.transform(U,s)));return u.state._tag===\"Open\"?Xc(h,E):h})})))),G9=l(2,Se(function*(e,t){let r=ot(t.n),n=yield*V9(t),o=new Array(r),s=yield*Or;for(let a=0;aLe(i,u)),A)}return yield*ec(e.channel,a=>Qx(n,a)).pipe(un(a=>Yx(n,a)),tu),o})),V9=e=>gi(e.capacity===\"unbounded\"?Zx(e):e.strategy===\"dropping\"?Gx(e):e.strategy===\"sliding\"?Vx(e):Kx(e),$p),TL=l(2,(e,t)=>j(FL(e,t),eL)),Z9=l(2,(e,t)=>j(H2({acquire:TL(e,t),idleTimeToLive:t.idleTimeToLive}),r=>Aa(W2(r)))),Y9=l(2,(e,t)=>A(Xw(e.channel,t))),Q9=l(2,(e,t)=>A(e0(e.channel,t))),X9=l(2,(e,t)=>e.channel.pipe(e0(F2(t)),N1(([r,n])=>n?ug(n):Xu),A)),e7=e=>Sg(PL(e)),t7=e=>sc(e,Pt,(t,r)=>{let n=gy(t,r);return[n,[n]]}),r7=e=>wL(e,J),wL=l(2,(e,t)=>Dt(e,(r,n)=>X(()=>{let o=!0,s;return I(r,function a(i){let c=[],u=0;for(o&&(o=!1,s=i[0],u=1,c.push(s));uDt(e,(r,n)=>X(()=>{let o=!0,s;return I(r,Se(function*a(i){let c=[],u=0;for(o&&(o=!1,s=i[0],u=1,c.push(s));uIe(e[0]),(e,t)=>Wr(()=>{let r=new TextDecoder(t?.encoding);return Jr(e,n=>r.decode(n,{stream:!0}))})),s7=e=>Wr(()=>{let t=new TextEncoder;return Jr(e,r=>t.encode(r))}),a7=e=>e.channel.pipe(Xw(f2()),A),CL=l(2,(e,t)=>rL(e,(r,n)=>{let o=n===0?[]:[t],s=r.length-1;for(let a=0;arc(t.start).pipe(nc(CL(e,t.middle)),nc(rc(t.end)))),c7=l(2,(e,t)=>AL(e,t,oc(fA([!0,!1])))),AL=l(3,(e,t,r)=>A(Ce(Se(function*(n,o){let s=yield*he(gr(r.channel))(n,o),a=Symbol(),i=!1,c=!1,u=(yield*he(gr(e.channel))(n,o)).pipe(He(()=>(i=!0,g(a)))),f=(yield*he(gr(t.channel))(n,o)).pipe(He(()=>(c=!0,g(a))));return dr(function*(){for(;;){if(i&&c)return yield*Y();let p=yield*s;if(p&&i||!p&&c)continue;let d=yield*p?u:f;if(d!==a)return Ee(d)}})})))),u7=l(2,(e,t)=>A(t0(e.channel,t))),f7=l(2,(e,t)=>A(m2(e.channel,t))),kL=l(2,(e,t)=>A(Hp(e.channel,t))),l7=l(2,(e,t)=>A(h2(e.channel,t))),vL=l(2,(e,t)=>A(x2(e.channel,t))),OL=l(2,(e,t)=>A(r0(e.channel,r=>t(r[0])))),p7=l(2,(e,t)=>A(g2(e.channel,t))),d7=l(2,(e,t)=>A(y2(e.channel,t))),_L=l(e=>Ie(e[0]),(e,t,r)=>A(S2(e.channel,t,r))),m7=l(2,(e,t)=>A(xg(e.channel,t))),h7=l(3,(e,t,r)=>A(gg(e.channel,t,r))),E0=l(3,(e,t,r)=>A(yg(e.channel,t,r))),RL=l(2,(e,t)=>A(b2(e.channel,t))),x7=l(3,(e,t,r)=>RL(e,n=>Jt(n,t,r(Fe(n,t))))),g7=function(){let e=Ie(arguments[0]),t=e?arguments[1]:arguments[0],r=Gs(e?arguments[2]:arguments[1]);if(e){let n=arguments[0];return A(n0(n.channel,t,r))}return n=>A(n0(n.channel,t,r))},y7=rc({}),S7=l(3,(e,t,r)=>Jr(e,n=>({...n,[t]:r(n)})));var b7=l(e=>Ie(e[0]),(e,t,r,n)=>of(e,o=>Jr(r(o),s=>({...o,[t]:s})),n)),E7=l(e=>Ie(e[0]),(e,t,r,n)=>Vp(e,o=>j(r(o),s=>({...o,[t]:s})),n)),I7=l(2,(e,t)=>Jr(e,r=>({[t]:r}))),T7=l(2,(e,t)=>sh(r=>ts(e.channel,r).pipe(I(n=>t.transform(n,r)),j(([n])=>n)))),PL=e=>tc(e.channel,()=>[],(t,r)=>{for(let n=0;ntc(e.channel,()=>0,(t,r)=>t+r.length),C7=e=>tc(e.channel,()=>0,(t,r)=>{for(let n=0;ntc(e.channel,t,(n,o)=>{for(let s=0;sC2(e.channel,t,(n,o)=>{let s=0,a=n;return j(Gn({while:()=>sr(a,o[s]),step(i){a=i,s++}}),()=>a)})),v7=e=>j(T2(e.channel),Rt(yA(0))),O7=e=>j(w2(e.channel),Rt(Bd)),_7=l(2,(e,t)=>ec(e.channel,r=>{let n=0;return Gn({while:()=>nt(r[n++]),step:$n})})),R7=l(2,(e,t)=>I2(e.channel,r=>{let n=!1,o=0;return j(Gn({while:()=>!n&&ot(r[o]),step(s){o++,s||(n=!0)}}),()=>!n)})),ML=l(2,(e,t)=>ec(e.channel,t)),Ig=e=>E2(e.channel),P7=e=>s0(e.channel),M7=e=>tc(e.channel,()=>\"\",(t,r)=>t+r.join(\"\")),F7=e=>j(o0(e.channel),t=>t.buffer),N7=e=>o0(e.channel),I0=l(e=>Ie(e[0]),(e,t,r)=>{let n,o,s=Pr(!1);return new ReadableStream({start(a){o=Nl(On(ML(e,i=>s.whenOpen(X(()=>{s.closeUnsafe();for(let c=0;c{i._tag===\"Failure\"?a.error(Pm(i.cause)):a.close()})},pull(){return new Promise(a=>{n=a,s.openUnsafe()})},cancel(){if(o)return tE(ia(mo(o)))}},r?.strategy)}),U7=l(e=>Ie(e[0]),(e,t)=>I0(e,Ir(),t)),D7=l(e=>Ie(e[0]),(e,t)=>j(hi(),r=>I0(e,r,t))),T0=l(2,(e,t)=>({[Symbol.asyncIterator](){let r=rE(t),n=Rn(t),o=kn(),s,a,i,c,u=p=>{if(c)return c;let d=i;return c=r(Tt(_r(d?mo(d):Q,Le(o,p)),{done:!0,value:void 0})),c},f=async p=>{try{await u(p)}catch(d){await r(nE(\"Suppressed error while closing Stream async iterator\",d))}};return{async next(){if(c)return c;if(a){let m=a.next();if(!m.done)return m;a=void 0}let p=n(s??I(ts(e.channel,o),m=>(s=m,m)));i=p;let d=await r(JD(p));if(i===p&&(i=void 0),Ve(d))return a=d.value[Symbol.iterator](),a.next();if(Bo(d.cause))return u(xt);if(c&&ob(d.cause))return c;throw await f(d),Pm(d.cause)},return(){return u(xt)},async throw(p){throw await f(lb(p)),p}}}})),L7=e=>j(hi(),t=>T0(e,t)),$7=e=>T0(e,Ir()),B7=l(e=>Ie(e[0]),(e,t,r)=>i0(e.channel,t,r)),j7=l(2,(e,t)=>v2(e.channel,t)),FL=l(2,(e,t)=>O2(e.channel,t)),z7=l(2,(e,t)=>A2(e.channel,t)),q7=l(2,(e,t)=>a0(e.channel,t));var w0=lr(\"effect/FileSystem\");var UL=\"~effect/Path\",A0=lr(\"effect/Path\");function DL(e,t){let r=\"\",n=0,o=-1,s=0,a;for(let i=0;i<=e.length;++i){if(i2){let c=r.lastIndexOf(\"/\");if(c!==r.length-1){c===-1?(r=\"\",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf(\"/\")),o=i,s=0;continue}}else if(r.length===2||r.length===1){r=\"\",n=0,o=i,s=0;continue}}t&&(r.length>0?r+=\"/..\":r=\"..\",n=2)}else r.length>0?r+=\"/\"+e.slice(o+1,i):r=e.slice(o+1,i),n=i-o-1;o=i,s=0}else a===46&&s!==-1?++s:s=-1}return r}function H7(e,t){let r=t.dir||t.root,n=t.base||(t.name||\"\")+(t.ext||\"\");return r?r===t.root?r+n:r+e+n:n}function W7(e){if(e.protocol!==\"file:\")return P(new rf({module:\"Path\",method:\"fromFileUrl\",description:\"URL must be of scheme file\"}));if(e.hostname!==\"\")return P(new rf({module:\"Path\",method:\"fromFileUrl\",description:\"Invalid file URL host\"}));let t=e.pathname;for(let r=0;r=-1&&!r;o--){let s;if(o>=0)s=arguments[o];else{let a=globalThis.process;n===void 0&&\"process\"in globalThis&&typeof a==\"object\"&&a!==null&&typeof a.cwd==\"function\"&&(n=a.cwd()),s=n}s.length!==0&&(t=s+\"/\"+t,r=s.charCodeAt(0)===47)}return t=DL(t,!r),r?t.length>0?\"/\"+t:\"/\":t.length>0?t:\".\"},J7=47;function K7(e){let t=new URL(\"file://\"),r=LL(e);return e.charCodeAt(e.length-1)===J7&&r[r.length-1]!==\"/\"&&(r+=\"/\"),t.pathname=X7(r),g(t)}var G7=/%/g,V7=/\\\\/g,Z7=/\\n/g,Y7=/\\r/g,Q7=/\\t/g;function X7(e){return e.includes(\"%\")&&(e=e.replace(G7,\"%25\")),e.includes(\"\\\\\")&&(e=e.replace(V7,\"%5C\")),e.includes(`\n`)&&(e=e.replace(Z7,\"%0A\")),e.includes(\"\\r\")&&(e=e.replace(Y7,\"%0D\")),e.includes(\"\t\")&&(e=e.replace(Q7,\"%09\")),e}var C0=A0.of({[UL]:UL,resolve:LL,normalize(e){if(e.length===0)return\".\";let t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=DL(e,!t),e.length===0&&!t&&(e=\".\"),e.length>0&&r&&(e+=\"/\"),t?\"/\"+e:e},isAbsolute(e){return e.length>0&&e.charCodeAt(0)===47},join(){if(arguments.length===0)return\".\";let e;for(let t=0;t0&&(e===void 0?e=r:e+=\"/\"+r)}return e===void 0?\".\":C0.normalize(e)},relative(e,t){if(e===t||(e=C0.resolve(e),t=C0.resolve(t),e===t))return\"\";let r=1;for(;rc){if(t.charCodeAt(s+f)===47)return t.slice(s+f+1);if(f===0)return t.slice(s+f)}else o>c&&(e.charCodeAt(r+f)===47?u=f:f===0&&(u=0));break}let d=e.charCodeAt(r+f),m=t.charCodeAt(s+f);if(d!==m)break;d===47&&(u=f)}let p=\"\";for(f=r+u+1;f<=n;++f)(f===n||e.charCodeAt(f)===47)&&(p.length===0?p+=\"..\":p+=\"/..\");return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},dirname(e){if(e.length===0)return\".\";let t=e.charCodeAt(0),r=t===47,n=-1,o=!0;for(let s=e.length-1;s>=1;--s)if(t=e.charCodeAt(s),t===47){if(!o){n=s;break}}else o=!1;return n===-1?r?\"/\":\".\":r&&n===1?\"//\":e.slice(0,n)},basename(e,t){let r=0,n=-1,o=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return\"\";let a=t.length-1,i=-1;for(s=e.length-1;s>=0;--s){let c=e.charCodeAt(s);if(c===47){if(!o){r=s+1;break}}else i===-1&&(o=!1,i=s+1),a>=0&&(c===t.charCodeAt(a)?--a===-1&&(n=s):(a=-1,n=i))}return r===n?n=i:n===-1&&(n=e.length),e.slice(r,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?\"\":e.slice(r,n)}},extname(e){let t=-1,r=0,n=-1,o=!0,s=0;for(let a=e.length-1;a>=0;--a){let i=e.charCodeAt(a);if(i===47){if(!o){r=a+1;break}continue}n===-1&&(o=!1,n=a+1),i===46?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||n===-1||s===0||s===1&&t===n-1&&t===r+1?\"\":e.slice(t,n)},format:function(t){if(t===null||typeof t!=\"object\")throw new TypeError('The \"pathObject\" argument must be of type Object. Received type '+typeof t);return H7(\"/\",t)},parse(e){let t={root:\"\",dir:\"\",base:\"\",ext:\"\",name:\"\"};if(e.length===0)return t;let r=e.charCodeAt(0),n=r===47,o;n?(t.root=\"/\",o=1):o=0;let s=-1,a=0,i=-1,c=!0,u=e.length-1,f=0;for(;u>=o;--u){if(r=e.charCodeAt(u),r===47){if(!c){a=u+1;break}continue}i===-1&&(c=!1,i=u+1),r===46?s===-1?s=u:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||i===-1||f===0||f===1&&s===i-1&&s===a+1?i!==-1&&(a===0&&n?t.base=t.name=e.slice(1,i):t.base=t.name=e.slice(a,i)):(a===0&&n?(t.name=e.slice(1,s),t.base=e.slice(1,i)):(t.name=e.slice(a,s),t.base=e.slice(a,i)),t.ext=e.slice(s,i)),a>0?t.dir=e.slice(0,a-1):n&&(t.dir=\"/\"),t},sep:\"/\",fromFileUrl:W7,toFileUrl:K7,toNamespacedPath:R});function Yp(e){return{_tag:\"Value\",value:e}}function wg(e,t){return{_tag:\"Record\",keys:e,value:t}}function O0(e,t){return{_tag:\"Array\",length:e,value:t}}var Tg=class extends Fr(\"SourceError\"){},ac=we(\"effect/ConfigProvider\",{defaultValue:()=>WL()}),eX={...rr,toJSON(){return{_id:\"ConfigProvider\"}}},tX=e=>e;function BL(e,t){let r=Object.create(eX);return r.load=e,r.mapInput=t,r}function jL(e,t){return BL(r=>e(t(r)),r=>jL(e,n=>r(t(n))))}function zL(e,t){return BL(r=>I(e.load(r),n=>n!==void 0?g(n):t.load(r)),r=>zL(e.mapInput(r),t.mapInput(r)))}function Cg(e){return jL(e,tX)}var v0=l(2,(e,t)=>zL(e,t)),_0=l(2,(e,t)=>e.mapInput(t)),rX=_0(e=>e.map(t=>typeof t==\"number\"?t:A_(t))),nX=l(2,(e,t)=>{let r=typeof t==\"string\"?[t]:t;return _0(e,n=>[...r,...n])}),oX=e=>jo(e)?yb(ac)(e):n_(ac)(e),sX=(e,t)=>yb(ac)(dr(function*(){let r=yield*ac,n=jo(e)?yield*e:e;return t?.asPrimary?v0(n,r):v0(r,n)}));function aX(e,t){let r=t?.preserveEmptyStrings===!0;return Cg(n=>g(iX(e,n,r)))}function iX(e,t,r){let n=e;for(let o of t){if(n==null)return;if(Array.isArray(n)){if(typeof o!=\"number\"||!Number.isInteger(o)||o<0||o>=n.length)return;n=n[o];continue}if(fr(n)){if(typeof o!=\"string\"||!Object.hasOwn(n,o))return;n=n[o];continue}return}return cX(n,r)}function cX(e,t){if(e!=null)return typeof e==\"string\"?qL(e,t):typeof e==\"number\"||typeof e==\"boolean\"||typeof e==\"bigint\"?Yp(String(e)):Array.isArray(e)?O0(e.length):fr(e)?wg(new Set(Object.keys(e))):Yp(F(e))}function qL(e,t){let r=HL(e,t);return r===void 0?void 0:Yp(r)}function HL(e,t){return e===\"\"&&!t?void 0:e}function R0(e,t){let r=t?.preserveEmptyStrings===!0,n=uX(e);return Cg(o=>g(fX(n,e,o,r)))}function WL(e){let t=e?.env??{...globalThis.process?.env,...import.meta?.env};return R0(t,{preserveEmptyStrings:e?.preserveEmptyStrings})}function uX(e){let t={};for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=r.split(\"_\"),s=t;for(let a of o){let i=s.children??=Object.create(null);s=i[a]??={}}}return t}function fX(e,t,r,n){let o=r.map(String).join(\"_\"),s=HL(Object.hasOwn(t,o)?t[o]:void 0,n),a=lX(e,r),i=a?.children?Object.keys(a.children):[];if(i.length===0)return s===void 0?void 0:Yp(s);if(i.every(Cc)){let u=Math.max(...i.map(f=>parseInt(f,10)))+1;return O0(u,s)}return wg(new Set(i),s)}function lX(e,t){if(t.length===0)return e;let r=e;for(let n of t)if(r=r?.children?.[String(n)],!r)return;return r}function JL(e,t){let r=dX(e);return t?.expandVariables&&(r=mX(r)),R0(r,{preserveEmptyStrings:t?.preserveEmptyStrings})}var pX=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg;function dX(e){let t=Object.create(null);e=e.replace(/\\r\\n?/gm,`\n`);let r;for(;(r=pX.exec(e))!=null;){let n=r[1],o=r[2]||\"\";o=o.trim();let s=o[0];o=o.replace(/^(['\"`])([\\s\\S]*)\\1$/gm,\"$2\"),s==='\"'&&(o=o.replace(/\\\\n/g,`\n`),o=o.replace(/\\\\r/g,\"\\r\")),t[n]=o}return t}function mX(e){let t=Object.create(null);for(let r of Object.keys(e))t[r]=KL(e[r],e).replace(/\\\\\\$/g,\"$\");return t}function KL(e,t){let r=hX(e,/(?!(?<=\\\\))\\$/g);if(r===-1)return e;let n=e.slice(r),o=/((?!(?<=\\\\))\\${?([\\w]+)(?::-([^}\\\\]*))?}?)/,s=n.match(o);if(s!==null){let[a,i,c,u]=s,f=Object.hasOwn(t,c)&&t[c]!==\"\"?t[c]:u??\"\";return KL(e.replace(i,()=>f),t)}return e}function hX(e,t){let r=Array.from(e.matchAll(t));return r.length>0?r.slice(-1)[0].index:-1}var xX=Se(function*(e){let r=yield*(yield*w0).readFileString(e?.path??\".env\");return JL(r,e)}),gX=Se(function*(e){let t=yield*A0,r=yield*w0,n=e?.rootPath??\"/\",o=e?.preserveEmptyStrings===!0;return Cg(s=>{let a=t.join(n,...s.map(String)),i=r.readFileString(a).pipe(j(u=>qL(u.trim(),o))),c=r.readDirectory(a).pipe(j(u=>wg(new Set(u.map(f=>t.basename(f))))));return i.pipe(ca(u=>c.pipe(ca(f=>k0(u)&&k0(f)?g(void 0):P(k0(u)?f:u)))),th(u=>new Tg({message:`Failed to read file at ${t.join(n,...s.map(String))}`,cause:u})))})}),k0=e=>e.reason._tag===\"NotFound\";var GL=[\"All\",\"Fatal\",\"Error\",\"Warn\",\"Info\",\"Debug\",\"Trace\",\"None\"];var M0=\"~effect/Config\",YL=e=>k(e,M0),af=class{_tag=\"ConfigError\";name=\"ConfigError\";cause;constructor(t){this.cause=t}get message(){return this.cause.toString()}toString(){return`ConfigError(${this.message})`}},yX={...yd({label:\"Config\",evaluate(e){return this.parse(e.getRef(ac))}}),[M0]:M0,toJSON(){return{_id:\"Config\"}}};function os(e){let t=Object.create(yX);return t.evaluator=e,t.parse=r=>st(e(r,[]),Pl),t}var So=(e,t,r)=>e.evaluator(t,r),QL=l(2,(e,t)=>os((r,n)=>j(So(e,r,n),Tr(t)))),SX=l(2,(e,t)=>os((r,n)=>I(So(e,r,n),wr({onSuccess:o=>So(t(o),r,n),onFailure:o=>g(W(o))})))),bX=l(2,(e,t)=>os((r,n)=>I(So(e,r,n),o=>mt(o)?Dr(t(o.success),B):g(W(o.failure))))),EX=l(2,(e,t)=>os((r,n)=>zo(So(e,r,n),{onFailure:o=>{let s=ib(o);return be(s)&&o.reasons.every(na)?So(t(s.value),r,n):ze(o)},onSuccess:o=>ce(o)?So(t(o.failure),r,n):g(o)})));function XL(e){let t=globalThis.Array.isArray(e)?e:Symbol.iterator in e?[...e]:e;return os((r,n)=>globalThis.Array.isArray(t)?Dr(Ym(t.map(o=>So(o,r,n))),hy):Dr(Ym(Ya(t,o=>So(o,r,n))),hy))}var e$=l(2,(e,t)=>os((r,n)=>Dr(So(e,r,n),o=>ce(o)?B(t):o))),IX=e=>e.pipe(QL(O),e$(v())),t$=e=>YL(e)?e:XL(Ya(e,t=>t$(t))),TX=e=>At(e,\"SourceError\"),wX=()=>\"\",r$=e=>t=>rt(t,r=>ze(oa(r.reasons.map(e)))),n$=(e,t)=>e.load(t).pipe(r$(r=>na(r)?zc(r.error).annotate(Mm(r)):r),Dr(r=>({provider:e,path:t,node:r,toString:wX}))),ZL=(e,t)=>n$(e.provider,[...e.path,t]),P0=(e,t)=>ga(eo,e,new ve(gt(r=>t(r)),jr())),o$=e=>{switch(e._tag){case\"Union\":return e.types.every(o$);case\"Objects\":case\"Arrays\":case\"Suspend\":return!1;default:return!0}},F0=(e,t)=>{switch(e._tag){case\"Objects\":return t?._tag===\"Record\";case\"Arrays\":return t?._tag===\"Array\";case\"Union\":return e.types.some(r=>F0(r,t));case\"Suspend\":return F0(e.thunk(),t);default:return t?.value!==void 0}},CX=Vr(e=>{let t=new WeakSet,r=oF(n=>{switch(t.add(n),n._tag){case\"Objects\":{let o=n.indexSignatures.map(a=>Ui(a.parameter)),s=Se(function*(a){if(a.node?._tag!==\"Record\")return;let i=a.node,c=new Set;for(let f of n.propertySignatures)typeof f.name==\"string\"&&c.add(f.name);if(o.length>0)for(let f of i.keys)o.some(p=>p(f))&&c.add(f);let u={};for(let f of c){let p=yield*ZL(a,f);p.node!==void 0&&M(u,f,p)}return u});return P0(n.recur(r,a=>a),s)}case\"Arrays\":{let o=Se(function*(s){if(s.node?._tag!==\"Array\")return;let a=[];for(let i=0;ig(o.node?.value))});return r(e)});function tr(e,t){let r=Np(e),n=hn(r.ast),o=nt(q(CX(r.ast))),s=typeof t==\"string\"?[t]:t??[];return os((a,i)=>{let c=[...i,...s];return n$(a,c).pipe(st(u=>o(u).pipe(Dr(B),ru(f=>{let p=new af(new Os(c.length>0?new ut(c,f):f));return F0(n,u.node)?P(p):g(W(p))}))),r$(u=>rb(u)&&TX(u.defect)?jc(new af(u.defect)).annotate(Mm(u)):u))})}var AX=lo.check(Hu({minimum:1,maximum:65535})),kX=fo(GL),s$=e=>br(e)||globalThis.Array.isArray(e);function vX(e){return os(()=>P(new af(e)))}function OX(e){return os(()=>g(B(e)))}function _X(e){return tr(K,e)}function RX(e){return tr(fw,e)}function PX(e){return tr(Wi,e)}function MX(e){return tr(qu,e)}function FX(e){return tr(lo,e)}function NX(e,t){return tr(Ct(e),t)}function UX(e,t){return tr(fo(e),t)}function DX(e,t,r){let n=s$(t),o=n?r:t,s=$e(e),a=o?.separator??\",\",i=K.pipe(G(Np(s),{decode:zP(o),encode:Ch(jr({strict:!1}),oe(c=>c.join(a)))}));return tr(it([i,s]),n?t:void 0)}function LX(e,t,r,n){let o=s$(r),s=_s(e,t),a=oM(o?n:r),i=K.pipe(G(Np(s),{decode:a.decode,encode:Ch(jr({strict:!1}),a.encode)}));return tr(it([s,i]),o?r:void 0)}function $X(e){return tr(nw,e)}function BX(e){return tr(hw,e)}function jX(e){return tr(Ju,e)}function zX(e){return tr(AX,e)}function qX(e){return tr(kX,e)}function HX(e){return tr(Fx(K),e)}function WX(e){return tr(Ox,e)}function JX(e){return tr(Wu,e)}var KX=l(2,(e,t)=>os((r,n)=>So(e,r,[...n,t])));var ic={};Eo(ic,{Console:()=>a$,assert:()=>GX,clear:()=>VX,consoleWith:()=>jt,count:()=>ZX,countReset:()=>YX,debug:()=>QX,dir:()=>XX,dirxml:()=>eee,error:()=>tee,group:()=>ree,info:()=>nee,log:()=>oee,table:()=>see,time:()=>aee,timeLog:()=>iee,trace:()=>cee,warn:()=>uee,withGroup:()=>fee,withTime:()=>lee});var a$=VS,jt=e=>re(t=>e(t.getRef(a$))),GX=(e,...t)=>jt(r=>z(()=>{r.assert(e,...t)})),VX=jt(e=>z(()=>{e.clear()})),ZX=e=>jt(t=>z(()=>{t.count(e)})),YX=e=>jt(t=>z(()=>{t.countReset(e)})),QX=(...e)=>jt(t=>z(()=>{t.debug(...e)})),XX=(e,t)=>jt(r=>z(()=>{r.dir(e,t)})),eee=(...e)=>jt(t=>z(()=>{t.dirxml(...e)})),tee=(...e)=>jt(t=>z(()=>{t.error(...e)})),ree=e=>jt(t=>ai(z(()=>{e?.collapsed?t.groupCollapsed(e.label):t.group(e?.label)}),()=>z(()=>{t.groupEnd()}))),nee=(...e)=>jt(t=>z(()=>{t.info(...e)})),oee=(...e)=>jt(t=>z(()=>{t.log(...e)})),see=(e,t)=>jt(r=>z(()=>{r.table(e,t)})),aee=e=>jt(t=>ai(z(()=>{t.time(e)}),()=>z(()=>{t.timeEnd(e)}))),iee=(e,...t)=>jt(r=>z(()=>{r.timeLog(e,...t)})),cee=(...e)=>jt(t=>z(()=>{t.trace(...e)})),uee=(...e)=>jt(t=>z(()=>{t.warn(...e)})),fee=l(e=>ie(e[0]),(e,t)=>jt(r=>ul(z(()=>{t?.collapsed?r.groupCollapsed(t.label):r.group(t?.label)}),()=>e,()=>z(()=>{r.groupEnd()})))),lee=l(e=>ie(e[0]),(e,t)=>jt(r=>ul(z(()=>{r.time(t)}),()=>e,()=>z(()=>{r.timeEnd(t)}))));var Kr={OK:200,Unauthorized:401,NotFound:404,InternalServerError:500,ServiceUnavailable:503},N0={[Kr.OK]:\"OK\",[Kr.Unauthorized]:\"Unauthorized\",[Kr.NotFound]:\"Not Found\",[Kr.InternalServerError]:\"Internal Server Error\",[Kr.ServiceUnavailable]:\"Service Unavailable\"},pee=e=>{let t=e.startsWith(\"/\"),r=[];for(let o of e.split(\"/\"))if(!(o===\"\"||o===\".\")){if(o===\"..\"){r.length>0&&r.at(-1)!==\"..\"?r.pop():t||r.push(\"..\");continue}r.push(o)}let n=r.join(\"/\");return t?`/${n}`:n||\".\"},ka=(...e)=>pee(e.filter(Boolean).join(\"/\")),cf=e=>{if(e.length===0)return\".\";let t=e.length;for(;t>1&&e[t-1]===\"/\";)t-=1;let r=e.slice(0,t),n=r.lastIndexOf(\"/\");return n<0?\".\":n===0?\"/\":r.slice(0,n)},i$=e=>{if(!e.startsWith(\"/\"))throw new TypeError(\"Path must be absolute\");let t=new URL(\"file:///\");return t.pathname=e.replace(/%/g,\"%25\").replace(/\\\\/g,\"%5C\"),t};var dee=/^[A-Za-z0-9_-]+$/u,c$=/[*?[{]/u,Ag=(e,t)=>t===e||t.startsWith(`${e.replace(/\\/+$/u,\"\")}/`),uf=class extends Cn.TaggedError(\"FunctionFileSystemError\"){},Dn=(e,t)=>e.lstat(t).pipe(N.catch(()=>N.undefined)),cc=(e,t,r)=>N.all([e.realPath(t),e.realPath(r)],{concurrency:2}).pipe(N.map(([n,o])=>Ag(n,o)),N.orElseSucceed(()=>!1)),u$=(e,t,r)=>N.gen(function*(){let n=yield*Dn(e,r);if(n===void 0)return!0;if(n.isSymbolicLink||!(yield*cc(e,t,r)))return!1;if(!n.isDirectory)return!0;let o=yield*e.readDirectory(r).pipe(N.catch(()=>N.undefined));if(o===void 0)return!1;for(let s of o)if(!(yield*u$(e,t,ka(r,s))))return!1;return!0}),Qp=(e,t)=>t.length===0?\"\":t.startsWith(\"/\")?t:ka(e,t),U0=[\"deno.json\",\"deno.jsonc\"],f$=e=>U0.includes(e.slice(e.lastIndexOf(\"/\")+1)),mee=(e,t,r)=>N.gen(function*(){let n=cf(ka(r));for(;Ag(t,n);){for(let s of U0){let a=ka(n,s),i=yield*Dn(e,a);if(i!==void 0)return i.isFile&&!i.isSymbolicLink?a:void 0}let o=cf(n);if(o===n)break;n=o}}),hee=(e,t,r)=>N.all([e.realPath(t),e.realPath(r)],{concurrency:2}).pipe(N.map(([n,o])=>n===o),N.orElseSucceed(()=>!1)),l$=N.fn(\"Functions.resolveFunctionConfig\")(function*(e){let{root:t,slug:r,overrides:n,fs:o}=e;if(!t.startsWith(\"/\")||!dee.test(r)||r===\"_shared\"||(yield*Dn(o,t))===void 0)return;let a=yield*o.realPath(t).pipe(N.orElseSucceed(()=>\"\"));if(!a.startsWith(\"/\"))return;let i=yield*Dn(o,a);if(i===void 0||!i.isDirectory)return;let c=e.filesRoot===void 0?a:yield*o.realPath(e.filesRoot).pipe(N.orElseSucceed(()=>\"\"));if(!c.startsWith(\"/\")||!Ag(c,a))return;let u=n.$default,f=n[r],p={...u,...f};if(p.enabled===!1)return;let d=ka(a,r),m=p?.entrypointPath&&p.entrypointPath.length>0?p.entrypointPath:p.entrypoint&&p.entrypoint.length>0?p.entrypoint:\"index.ts\";if(!m.startsWith(\"/\")){let b=yield*Dn(o,d);if(b===void 0||!b.isDirectory||!(yield*cc(o,a,d)))return}let x=Qp(d,m);if(!(yield*cc(o,c,x)))return;let y=yield*Dn(o,x);if(y===void 0||!y.isFile||y.isSymbolicLink)return;let S=f?.importMapPath??f?.import_map,w=u?.importMapRoot??u?.import_map_root,E=S!==void 0?Qp(d,S):w!==void 0?Qp(a,w):Qp(d,\"\");if(E.length>0){if(!(yield*cc(o,c,E)))return;let b=yield*Dn(o,E);if(b===void 0||!b.isFile||b.isSymbolicLink)return}else for(let b of U0){let T=ka(d,b),C=yield*Dn(o,T);if(C!==void 0){if(!C.isFile||C.isSymbolicLink||!(yield*cc(o,c,T)))return;E=T;break}}let U=E.length===0?void 0:yield*mee(o,c,x),_=U!==void 0&&(yield*hee(o,U,E)),h=(p.staticFiles??p.static_files??[]).map(b=>Qp(d,b));for(let b of h){if(!Ag(c,b))return;let T=b.search(c$),C=T<0?b:b.slice(0,T),L=T<0?cf(b):C.slice(0,Math.max(0,C.lastIndexOf(\"/\")))||a;if(!(yield*u$(o,c,L)))return;if(!c$.test(b)){let ee=yield*Dn(o,b);if(ee!==void 0&&(!(yield*cc(o,c,b))||ee.isSymbolicLink))return}}return{entrypointPath:x,importMapPath:E,importMapDiscoveredByRuntime:_,staticFiles:h,verifyJWT:p.verifyJWT??p.verify_jwt??!0,env:p.env}}),xee=e=>ka(cf(e.entrypointPath),\"package.json\"),p$=e=>{let t=new Map,r=new Map;return(n,o)=>{let s=r.get(n);if(s!==void 0)return s;let a=cf(o.entrypointPath),i=t.get(a),c=i===void 0||i===n?a:e();return i===void 0&&t.set(a,n),r.set(n,c),c}},d$=N.fn(\"Functions.packageJsonContainedFor\")(function*(e){if(!e.root.startsWith(\"/\"))return!1;let t=yield*Dn(e.fs,e.root);if(t===void 0||!t.isDirectory&&!t.isSymbolicLink)return!1;let r=yield*e.fs.realPath(e.root).pipe(N.orElseSucceed(()=>\"\"));if(!r.startsWith(\"/\"))return!1;let n=yield*Dn(e.fs,r);if(n===void 0||!n.isDirectory)return!1;let o=xee(e.config),s=yield*Dn(e.fs,o);return s===void 0||!s.isFile||s.isSymbolicLink?!1:yield*cc(e.fs,r,o)});var D0=new TextEncoder,Xp=new TextDecoder,kg=new TextDecoder(\"utf-8\",{fatal:!0}),efe=2**32;function m$(...e){let t=e.reduce((o,{length:s})=>o+s,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function ff(e){let t=new Uint8Array(e.length);for(let r=0;r127)throw new TypeError(\"non-ASCII string encountered in encode()\");t[r]=n}return t}var vg=(e,t=\"algorithm.name\")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function gee(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function h$(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!=\"number\"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function x$(e,t,r){let n=e.algorithm;if(n.name!==t.name)throw vg(t.name);if(t.hash&&n.hash?.name!==t.hash)throw vg(t.hash,\"algorithm.hash\");if(t.namedCurve&&n.namedCurve!==t.namedCurve)throw vg(t.namedCurve,\"algorithm.namedCurve\");if(t.length!==void 0&&n.length!==t.length)throw vg(t.length,\"algorithm.length\");gee(e,r)}function yee(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(\", \")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t==\"function\"&&t.name?e+=` Received function ${t.name}`:typeof t==\"object\"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var ed=(e,t,...r)=>yee(`Key for the ${e} algorithm must be `,t,...r);var yr=class extends Error{static code=\"ERR_JOSE_GENERIC\";code=\"ERR_JOSE_GENERIC\";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Us=class extends yr{static code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";code=\"ERR_JWT_CLAIM_VALIDATION_FAILED\";claim;reason;payload;constructor(t,r,n=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},td=class extends yr{static code=\"ERR_JWT_EXPIRED\";code=\"ERR_JWT_EXPIRED\";claim;reason;payload;constructor(t,r,n=\"unspecified\",o=\"unspecified\"){super(t,{cause:{claim:n,reason:o,payload:r}}),this.claim=n,this.reason=o,this.payload=r}},Og=class extends yr{static code=\"ERR_JOSE_ALG_NOT_ALLOWED\";code=\"ERR_JOSE_ALG_NOT_ALLOWED\"},bo=class extends yr{static code=\"ERR_JOSE_NOT_SUPPORTED\";code=\"ERR_JOSE_NOT_SUPPORTED\"};var Gr=class extends yr{static code=\"ERR_JWS_INVALID\";code=\"ERR_JWS_INVALID\"},lf=class extends yr{static code=\"ERR_JWT_INVALID\";code=\"ERR_JWT_INVALID\"};var rd=class extends yr{static code=\"ERR_JWKS_INVALID\";code=\"ERR_JWKS_INVALID\"},pf=class extends yr{static code=\"ERR_JWKS_NO_MATCHING_KEY\";code=\"ERR_JWKS_NO_MATCHING_KEY\";constructor(t=\"no applicable key found in the JSON Web Key Set\",r){super(t,r)}},_g=class extends yr{[Symbol.asyncIterator]=async function*(){};static code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";code=\"ERR_JWKS_MULTIPLE_MATCHING_KEYS\";constructor(t=\"multiple matching keys found in the JSON Web Key Set\",r){super(t,r)}},Rg=class extends yr{static code=\"ERR_JWKS_TIMEOUT\";code=\"ERR_JWKS_TIMEOUT\";constructor(t=\"request timed out\",r){super(t,r)}},Pg=class extends yr{static code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";code=\"ERR_JWS_SIGNATURE_VERIFICATION_FAILED\";constructor(t=\"signature verification failed\",r){super(t,r)}};var L0=e=>{if(e?.[Symbol.toStringTag]===\"CryptoKey\")return!0;try{return e instanceof CryptoKey}catch{return!1}},See=e=>e?.[Symbol.toStringTag]===\"KeyObject\",g$=e=>L0(e)||See(e);function y$(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let n=0;ntypeof o!=\"string\")||new Set(n).size!==n.length)throw new TypeError('\"key_ops\" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}var z0=e=>e[Symbol.toStringTag],bee=(e,t,r)=>{let{alg:n}=e;if(t.use!==void 0){let o=r===\"sign\"||r===\"verify\"?\"sig\":\"enc\";if(t.use!==o)throw new TypeError(`Invalid key for this operation, its \"use\" must be \"${o}\" when present`)}if(t.alg!==void 0&&t.alg!==n)throw new TypeError(`Invalid key for this operation, its \"alg\" must be \"${n}\" when present`);if(Array.isArray(t.key_ops)){let o=r===\"encrypt\"||r===\"decrypt\"?e.ops?.[r===\"encrypt\"?0:1]:r;if(o&&!t.key_ops.includes(o))throw new TypeError(`Invalid key for this operation, its \"key_ops\" must include \"${o}\" when present`)}};function Eee(e,t,r){let{alg:n,secret:o}=e,s=r===\"decrypt\"||r===\"sign\";if(o&&t instanceof Uint8Array)return[I$,t];if(va(t)){let a=b$(t);if(typeof a.kty!=\"string\")throw new TypeError(o?ed(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):ed(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(!(o?a.kty===\"oct\"&&typeof a.k==\"string\":a.kty!==\"oct\"&&(s?a.kty===\"AKP\"&&typeof a.priv==\"string\"||typeof a.d==\"string\":a.d===void 0&&a.priv===void 0)))throw new TypeError(o?'JSON Web Key for symmetric algorithms must have JWK \"kty\" (Key Type) equal to \"oct\" and the JWK \"k\" (Key Value) present':`JSON Web Key for this operation must be a ${s?\"private\":\"public\"} JWK`);return bee(e,a,r),[C$,t,a]}if(!g$(t))throw new TypeError(o?ed(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\",\"Uint8Array\"):ed(n,t,\"CryptoKey\",\"KeyObject\",\"JSON Web Key\"));if(o){if(t.type!==\"secret\")throw new TypeError(`${z0(t)} instances for symmetric algorithms must be of type \"secret\"`)}else{if(t.type===\"secret\")throw new TypeError(`${z0(t)} instances for asymmetric algorithms must not be of type \"secret\"`);let a=s?\"private\":\"public\";if((t.type===\"public\"||t.type===\"private\")&&t.type!==a){let i=r===\"sign\"?\"signing\":r===\"verify\"?\"verifying\":`${r.slice(0,-1)}tion`;throw new TypeError(`${z0(t)} instances for asymmetric algorithm ${i} must be of type \"${a}\"`)}}return L0(t)?[T$,t]:[w$,t]}var I$=0,T$=1,w$=2,C$=3,q0,Iee={__proto__:null,prime256v1:\"P-256\",secp384r1:\"P-384\",secp521r1:\"P-521\"};function Ug(e,t,r){q0||=new WeakMap;let n=q0.get(e);return r&&(n?n[t]=r:q0.set(e,{[t]:r})),r??n?.[t]}var E$=async(e,t,r)=>Ug(e,r.alg)??Ug(e,r.alg,await Ng(r,{...t,alg:r.alg})),Tee=(e,t)=>{let r=Ug(e,t.alg);if(r)return r;let n=e.type===\"public\",o=t.usages[n?0:1],{asymmetricKeyType:s}=e,a=Iee[e.asymmetricKeyDetails?.namedCurve],i=t.resolve?.({crv:a,asymmetricKeyType:s})??t.subtle;return Ug(e,t.alg,e.toCryptoKey(i,n,o))};async function A$(e,t,r){let n=Eee(e,t,r);switch(n[0]){case I$:case T$:return n[1];case C$:{let o=n[1],s=n[2];if(s.kty===\"oct\")return nd(s.k);if(!Object.isFrozen(o)){let{key_ops:a}=o;Array.isArray(a)&&Object.freeze(a),Object.freeze(o)}return E$(o,s,e)}case w$:{let o=n[1];return o.type===\"secret\"?o.export():\"toCryptoKey\"in o&&typeof o.toCryptoKey==\"function\"?Tee(o,e):E$(o,o.export({format:\"jwk\"}),e)}}}function k$(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var v$={__proto__:null,b64:!0};function O$(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!=\"string\")))throw new TypeError(`\"${e}\" option must be an array of strings`);if(t)return new Set(t)}function _$(e,t,r,n,o){if(o.crit!==void 0&&n?.crit===void 0)throw new e('\"crit\" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return[];if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(a=>typeof a!=\"string\"||a.length===0))throw new e('\"crit\" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s=r===void 0?t:{__proto__:null,...r,...t};for(let a of n.crit){if(!(a in s))throw new bo(`Extension Header Parameter \"${a}\" is not recognized`);if(!Object.hasOwn(o,a)||o[a]===void 0)throw new e(`Extension Header Parameter \"${a}\" is missing`);if(s[a]&&(!Object.hasOwn(n,a)||n[a]===void 0))throw new e(`Extension Header Parameter \"${a}\" MUST be integrity protected`)}return n.crit}function R$(e,t){if(t.includes(\"b64\")){let r=e.b64;if(typeof r!=\"boolean\")throw new Gr('The \"b64\" (base64url-encode payload) Header Parameter must be a boolean');return r}return!0}async function wee(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey(\"raw\",t,e.subtle,!1,[r]):(x$(t,e.subtle,r),e.minRsaBits&&h$(e.alg,t),t)}async function P$(e,t,r,n){let o=await wee(e,t,\"verify\");try{return await crypto.subtle.verify(e.signing,o,r,n)}catch{return!1}}var od=[[\"verify\"],[\"sign\"]];function H0(e){let t={name:\"HMAC\",hash:`SHA-${e}`};return{kty:[\"oct\"],secret:!0,subtle:t,signing:t,usages:od}}function df(e,t){let n={name:t?\"RSA-PSS\":\"RSASSA-PKCS1-v1_5\",hash:`SHA-${e}`};return{kty:[\"RSA\"],subtle:n,signing:t?{...n,saltLength:t}:n,usages:od,minRsaBits:2048}}function W0(e,t){return{kty:[\"EC\"],crv:e,subtle:{name:\"ECDSA\",namedCurve:e},signing:{name:\"ECDSA\",hash:`SHA-${t}`},usages:od}}function M$(){let e={name:\"Ed25519\"};return{kty:[\"OKP\"],crv:\"Ed25519\",subtle:e,signing:e,usages:od}}function J0(e){let r={name:`ML-DSA-${e}`};return{kty:[\"AKP\"],subtle:r,signing:r,usages:od}}var K0=k$({HS256:H0(256),HS384:H0(384),HS512:H0(512),RS256:df(256),RS384:df(384),RS512:df(512),PS256:df(256,32),PS384:df(384,48),PS512:df(512,64),ES256:W0(\"P-256\",256),ES384:W0(\"P-384\",384),ES512:W0(\"P-521\",512),EdDSA:M$(),Ed25519:M$(),\"ML-DSA-44\":J0(44),\"ML-DSA-65\":J0(65),\"ML-DSA-87\":J0(87)});function F$(e){let t=typeof e==\"string\"?K0[e]:void 0;if(!t)throw new bo(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function N$(e){return[e&&O$(\"algorithms\",e.algorithms),e?.crit]}function Cee(e,t=e===void 0?{}:Fg(e,Gr,\"JWS Protected Header is invalid\")){return t}function Aee(e,t,r){let n=R$(e,_$(Gr,v$,r[1],e,t)),o=t.alg;if(typeof o!=\"string\"||!o)throw new Gr('JWS \"alg\" (Algorithm) Header Parameter missing or invalid');if(r[0]&&!r[0].has(o))throw new Og('\"alg\" (Algorithm) Header Parameter value not allowed');return[n,o]}function kee(e){try{return ff(e)}catch{throw new Gr(\"JWS Compact Serialization payload must use only ASCII characters\")}}async function vee(e,t,r,n,o,s,a){let i=!1;typeof r==\"function\"&&(r=await r(o,e),i=!0);let c=typeof a==\"string\",u=F$(s),f=m$(n!==void 0?ff(n):new Uint8Array,ff(\".\"),c?t[2]??=S$(a,\"payload\",Gr):a),p=B0(e.signature,\"signature\",Gr),d=await A$(u,r,\"verify\");if(!await P$(u,d,p,f))throw new Pg;return[c?B0(a,\"payload\",Gr):a,o,c,d,i]}async function U$(e,t,r){if(e instanceof Uint8Array&&(e=Xp.decode(e)),typeof e!=\"string\")throw new Gr(\"Compact JWS must be a string or Uint8Array\");let{0:n,1:o,2:s,length:a}=e.split(\".\");if(a!==3)throw new Gr(\"Invalid Compact JWS\");let i={payload:o,protected:n,signature:s},c=Cee(n),[u,f]=Aee(c,c,t),p=u?o:kee(o);return vee(i,t,r,n,c,f,p)}var Oee=e=>Math.floor(e.getTime()/1e3),_ee={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},Ree=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,mf=\"check_failed\";function G0(){throw new TypeError(\"Invalid time period format\")}function D$(e){typeof e!=\"string\"&&G0();let t=Ree.exec(e);(!t||t[4]&&t[1])&&G0();let r=parseFloat(t[2]),n=Math.round(r*_ee[t[3][0].toLowerCase()]);return Number.isFinite(n)||G0(),t[1]===\"-\"||t[4]===\"ago\"?-n:n}function V0(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}var L$=e=>{let t=e.toLowerCase();return e.includes(\"/\")?t:`application/${t}`},Pee=(e,t)=>typeof e==\"string\"?t.includes(e):Array.isArray(e)?t.some(r=>e.includes(r)):!1;function Z0(e,t,r=!1){let n=e[t];if(!(n===void 0&&!r)){if(typeof n!=\"number\")throw new Us(`\"${t}\" claim must be a number`,e,t,\"invalid\");return n}}function Y0(e,t){throw new Us(`unexpected \"${t}\" claim value`,e,t,mf)}function $$(e,t,r={}){let n;try{n=JSON.parse(kg.decode(t))}catch{}if(!va(n))throw new lf(\"JWT Claims Set must be a top-level JSON object\");let{typ:o}=r;if(o!==void 0&&(typeof e.typ!=\"string\"||L$(e.typ)!==L$(o)))throw new Us('unexpected \"typ\" JWT header value',n,\"typ\",mf);let{requiredClaims:s=[],issuer:a,subject:i,audience:c,maxTokenAge:u}=r,f=[...s];u!==void 0&&f.push(\"iat\"),c!==void 0&&f.push(\"aud\"),i!==void 0&&f.push(\"sub\"),a!==void 0&&f.push(\"iss\");for(let E of new Set(f.reverse()))if(!Object.hasOwn(n,E))throw new Us(`missing required \"${E}\" claim`,n,E,\"missing\");a!==void 0&&!(Array.isArray(a)?a:[a]).includes(n.iss)&&Y0(n,\"iss\"),i!==void 0&&n.sub!==i&&Y0(n,\"sub\"),c!==void 0&&!Pee(n.aud,typeof c==\"string\"?[c]:c)&&Y0(n,\"aud\");let{clockTolerance:p}=r,d=0;if(typeof p==\"string\")d=D$(p);else if(p!==void 0){if(typeof p!=\"number\")throw new TypeError(\"Invalid clockTolerance option type\");d=p}V0(\"clockTolerance option\",d);let{currentDate:m}=r,x=V0(\"currentDate option\",Oee(m===void 0?new Date:m)),y=Z0(n,\"iat\",u!==void 0),S=Z0(n,\"nbf\");if(S!==void 0&&S>x+d)throw new Us('\"nbf\" claim timestamp check failed',n,\"nbf\",mf);let w=Z0(n,\"exp\");if(w!==void 0&&w<=x-d)throw new td('\"exp\" claim timestamp check failed',n,\"exp\",mf);if(u!==void 0){let E=x-y,U=V0(\"maxTokenAge option\",typeof u==\"number\"?u:D$(u));if(E-d>U)throw new td('\"iat\" claim timestamp check failed (too far in the past)',n,\"iat\",mf);if(E<-d)throw new Us('\"iat\" claim timestamp check failed (it should be in the past)',n,\"iat\",mf)}return n}async function Dg(e,t,r){let n=await U$(e,N$(r),t);if(!n[2])throw new lf(\"JWTs MUST NOT use unencoded payload\");let s={payload:$$(n[1],n[0],r),protectedHeader:n[1]};return typeof t==\"function\"?{...s,key:n[3]}:s}function Mee(e,t,r,n){let{kty:o,key_ops:s,ext:a,kid:i,alg:c,use:u,crv:f}=j0(e),p=Array.isArray(s)?[...s]:s;return(a===void 0||typeof a==\"boolean\")&&(p===void 0||Array.isArray(p)&&p.every((d,m)=>typeof d==\"string\"&&p.indexOf(d)===m)&&p.includes(\"verify\"))&&t.kty.includes(o)&&(n===void 0||typeof n==\"string\"&&n===i)&&(c===void 0?o!==\"AKP\":r===c)&&(u===void 0||u===\"sig\")&&(!t.crv||f===t.crv)}async function B$(e,t,r){let n=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(n[o]===void 0){let s=await Ng(r,{...t,alg:o,ext:!0});if(s.type!==\"public\")throw new rd(\"JSON Web Key Set members must be public keys\");n[o]=s}return n[o]}function uc(e){let t;try{t=structuredClone(e)}catch{}if(!Mg(t))throw new rd(\"JSON Web Key Set malformed\");let r=new WeakMap;return Object.defineProperty(async(o,s)=>{let{alg:a,kid:i}={...o,...s?.header},c=typeof a==\"string\"?K0[a]:void 0;if(!c||c.secret)throw new bo('Unsupported \"alg\" value for a JSON Web Key Set');let u=t.keys.filter(d=>Mee(d,c,a,i)),{0:f,length:p}=u;if(!p)throw new pf;if(p!==1){let d=new _g;throw d[Symbol.asyncIterator]=async function*(){for(let m of u)try{yield await B$(r,m,c)}catch{}},d}return B$(r,f,c)},\"jwks\",{value:()=>structuredClone(t)})}function Fee(){return typeof WebSocketPair<\"u\"||typeof navigator<\"u\"&&navigator.userAgent===\"Cloudflare-Workers\"||typeof EdgeRuntime<\"u\"&&EdgeRuntime===\"vercel\"}var Q0;(typeof navigator>\"u\"||!navigator.userAgent?.startsWith?.(\"Mozilla/5.0 \"))&&(Q0=\"jose/v6.2.10\");var z$=Symbol();async function Nee(e,t,r,n=fetch){let o=await n(e,{method:\"GET\",signal:r,redirect:\"manual\",headers:t}).catch(s=>{throw s.name===\"TimeoutError\"?new Rg:s});if(o.status!==200)throw new yr(\"Expected 200 OK from the JSON Web Key Set HTTP response\");try{return await o.json()}catch{throw new yr(\"Failed to parse the JSON Web Key Set HTTP response as JSON\")}}var q$=Symbol();function sd(e,t){return Number.isFinite(e)&&Date.now(){if(d&&Fee()&&(d=void 0),!d){let E=++m,U=d=Nee(r,c,AbortSignal.timeout(s),u).then(_=>{let h=uc(_);if(E<=x)return;y=h;let b=Date.now();f&&(f.uat=b,f.jwks=_),p=b,x=E}).finally(()=>{d===U&&(d=void 0)})}await d};return Object.defineProperties(async(E,U)=>{(!y||!sd(p,i))&&await S();try{return await y(E,U)}catch(_){if(_ instanceof pf&&!sd(p,a))return await S(),y(E,U);throw _}},{coolingDown:{get:()=>sd(p,a),enumerable:!0},fresh:{get:()=>sd(p,i),enumerable:!0},reload:{value:S,enumerable:!0},reloading:{get:()=>!!d,enumerable:!0},jwks:{value:()=>y?.jwks(),enumerable:!0}})}function eC(e){let t;if(typeof e==\"string\"){let n=e.split(\".\");(n.length===3||n.length===5)&&([t]=n)}else if(typeof e==\"object\"&&e)if(\"protected\"in e)t=e.protected;else throw new TypeError(\"Token does not contain a Protected Header\");let r=\"Invalid Token or Protected Header formatting\";if(typeof t!=\"string\"||!t)throw new TypeError(r);return Fg(t,TypeError,r)}var Dee=new Set([\"HOME\",\"HOSTNAME\",\"PATH\",\"PWD\"]),Ln=N.runSync(N.gen(function*(){let e=t=>t.pipe(Mr.option);return{hostPort:yield*e(Mr.String(\"SUPABASE_INTERNAL_HOST_PORT\")),functionsRoot:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_ROOT\")),filesRoot:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_FILES_ROOT\")),jwtSecret:yield*e(Mr.String(\"SUPABASE_INTERNAL_JWT_SECRET\")),supabaseUrl:yield*e(Mr.String(\"SUPABASE_URL\")),wallclock:yield*e(Mr.String(\"SUPABASE_INTERNAL_WALLCLOCK_LIMIT_SEC\")),publishableKey:yield*e(Mr.String(\"SUPABASE_INTERNAL_PUBLISHABLE_KEY\")),secretKey:yield*e(Mr.String(\"SUPABASE_INTERNAL_SECRET_KEY\")),functionsConfig:yield*e(Mr.String(\"SUPABASE_INTERNAL_FUNCTIONS_CONFIG\")),debug:yield*e(Mr.String(\"SUPABASE_INTERNAL_DEBUG\")),jwks:yield*e(Mr.String(\"SUPABASE_JWKS\"))}}).pipe(N.provideService(sf.ConfigProvider,sf.fromEnvRecord(Deno.env.toObject(),{preserveEmptyStrings:!0})))),xf=(e,t=\"\")=>xe.getOrElse(e,()=>t),H$=xf(Ln.hostPort,\"8081\"),Z$=xf(Ln.functionsRoot),Lee=xf(Ln.jwtSecret),$ee=xf(Ln.supabaseUrl,\"http://127.0.0.1:54321\"),Bee=new URL(\"/auth/v1/.well-known/jwks.json\",$ee),W$=Number.parseInt(xf(Ln.wallclock,\"400\"),10),J$=xe.getOrUndefined(Ln.publishableKey),K$=xe.getOrUndefined(Ln.secretKey),Ds={BootError:Kr.ServiceUnavailable,InvalidWorkerResponse:Kr.InternalServerError,WorkerLimit:546},jee={[Ds.BootError]:\"BOOT_ERROR\",[Ds.InvalidWorkerResponse]:\"WORKER_ERROR\",[Ds.WorkerLimit]:\"WORKER_LIMIT\"},zee={[Ds.BootError]:\"Worker failed to boot (please check logs)\",[Ds.InvalidWorkerResponse]:\"Function exited due to an error (please check logs)\",[Ds.WorkerLimit]:\"Worker failed to respond due to a resource limit (please check logs)\"},qee=new Map([[Deno.errors.InvalidWorkerCreation,Ds.BootError],[Deno.errors.InvalidWorkerResponse,Ds.InvalidWorkerResponse],[Deno.errors.WorkerRequestCancelled,Ds.WorkerLimit]]),Hee=e=>{let t=Deno.errors.WorkerAlreadyRetired;return t!==void 0&&e instanceof t},Wee=(s=>(s.MissingAuthHeader=\"UNAUTHORIZED_NO_AUTH_HEADER\",s.InvalidLegacyJWT=\"UNAUTHORIZED_JWT\",s.InvalidAsymmetricJWT=\"UNAUTHORIZED_ASYMMETRIC_JWT\",s.InvalidTokenFormat=\"UNAUTHORIZED_INVALID_JWT_FORMAT\",s.UnsupportedTokenAlgorithm=\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",s))(Wee||{}),Jee=me.Struct({enabled:me.optionalKey(me.Boolean),verifyJWT:me.optionalKey(me.Boolean),verify_jwt:me.optionalKey(me.Boolean),entrypointPath:me.optionalKey(me.String),entrypoint:me.optionalKey(me.String),importMapPath:me.optionalKey(me.String),import_map:me.optionalKey(me.String),importMapRoot:me.optionalKey(me.String),import_map_root:me.optionalKey(me.String),staticFiles:me.optionalKey(me.Array(me.String)),static_files:me.optionalKey(me.Array(me.String)),env:me.optionalKey(me.Record(me.String,me.String))}),Kee=me.Record(me.String,Jee),Gee=me.declare(e=>typeof e==\"object\"&&e!==null&&\"keys\"in e&&Array.isArray(e.keys)&&e.keys.every(t=>typeof t==\"object\"&&t!==null)),Vee=()=>xe.match(Ln.functionsConfig,{onNone:()=>({}),onSome:e=>N.runSync(me.decodeEffect(me.fromJsonString(Kee))(e).pipe(N.orElseSucceed(()=>({}))))}),tC=Vee();if(xe.getOrUndefined(Ln.debug)===\"true\"){let e=Object.fromEntries(Object.entries(tC).map(([t,r])=>[t,Object.fromEntries(Object.entries(r).filter(([n])=>n!==\"env\"))]));N.runSync(ic.log(\"Functions config:\",JSON.stringify(e,null,2)))}var fc=(e,t,r={})=>{let n={...r},o=null;return e!=null&&(typeof e==\"object\"?(n[\"Content-Type\"]=\"application/json\",o=JSON.stringify(e)):(n[\"Content-Type\"]=\"text/plain\",o=typeof e==\"string\"?e:JSON.stringify(e)??null)),new Response(o,{status:t,headers:n})},G$=({code:e,message:t=\"Invalid JWT\"})=>fc({code:e,message:t,msg:t},Kr.Unauthorized,{\"sb-error-code\":e,\"Access-Control-Expose-Headers\":\"sb-error-code\"}),Zee=e=>{for(let[t,r]of qee.entries())if(t!==void 0&&e instanceof t)return fc({code:jee[r],message:zee[r]},r);return fc({code:N0[Kr.InternalServerError],message:\"Request failed due to an internal server error\"},Kr.InternalServerError)};function Yee(e){let t=e.split(\" \");return t.length===2&&t[0]===\"Bearer\"?t[1]:null}var Qee=e=>{let t=e.headers.get(\"authorization\"),r=e.headers.get(\"sb-api-key\")?.replace(\"Bearer\",\"\").trim();if(!t&&!r)return{code:\"UNAUTHORIZED_NO_AUTH_HEADER\",message:\"Missing authorization header\"};let n=Yee(t??\"\"),o=!n||n.startsWith(\"sb_\")?r:n;return o||{code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"}},hf=class extends Cn.TaggedError(\"BootstrapOperationError\"){},Xee=N.runSync(xe.match(Ln.jwks,{onNone:()=>N.succeed(xe.some(uc({keys:[]}))),onSome:e=>N.gen(function*(){let t=yield*me.decodeEffect(me.fromJsonString(Gee))(e);return yield*N.try({try:()=>uc(t),catch:r=>new hf({cause:r})})}).pipe(N.option)})),ete=xe.getOrElse(Xee,()=>X0(Bee)),Oa=e=>N.tryPromise({try:e,catch:t=>new hf({cause:t})}),tte=e=>N.gen(function*(){return yield*Oa(()=>Dg(e,ete)),xe.none()}).pipe(N.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_ASYMMETRIC_JWT\"})));function rte(e,t){return N.gen(function*(){let r=yield*N.try({try:()=>eC(t).alg,catch:n=>new hf({cause:n})});return r?r===\"HS256\"?yield*Oa(()=>Dg(t,new TextEncoder().encode(e))).pipe(N.as(xe.none()),N.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_JWT\"}))):r===\"ES256\"||r===\"RS256\"?yield*tte(t):xe.some({code:\"UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM\",message:`Unsupported JWT algorithm ${r}`}):xe.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})}).pipe(N.orElseSucceed(()=>xe.some({code:\"UNAUTHORIZED_INVALID_JWT_FORMAT\",message:\"Invalid JWT format\"})))}var Y$={lstat:e=>Oa(()=>Deno.lstat(e)).pipe(N.mapError(t=>new uf({cause:t})),N.map(t=>({isDirectory:t.isDirectory,isFile:t.isFile,isSymbolicLink:t.isSymlink}))),realPath:e=>Oa(()=>Deno.realPath(e)).pipe(N.mapError(t=>new uf({cause:t}))),readDirectory:e=>ns.suspend(()=>ns.fromAsyncIterable(Deno.readDir(e),t=>new hf({cause:t})).pipe(ns.map(t=>t.name))).pipe(ns.runCollect,N.mapError(t=>new uf({cause:t})))},nte=e=>l$({root:Z$,filesRoot:xe.getOrUndefined(Ln.filesRoot),slug:e,overrides:tC,fs:Y$}),V$=new Set,ote=(e,t)=>t.importMapDiscoveredByRuntime||!f$(t.importMapPath)||V$.has(e)?N.void:N.sync(()=>V$.add(e)).pipe(N.andThen(ic.warn(`[functions] ${e}: ${t.importMapPath} is not the nearest Deno config of ${t.entrypointPath}, so Edge Runtime loads it as a plain import map without comments or jsr:/npm: subpath imports. Move it next to the entrypoint or into a parent directory without a closer deno.json(c).`))),ste=p$(()=>Deno.makeTempDirSync({prefix:\"supabase-worker-\"})),ate=e=>e.importMapPath?N.succeed(!1):d$({root:xf(Ln.filesRoot,Z$),config:e,fs:Y$}),Q$=e=>ns.fromEffectRepeat(Oa(()=>e.read()).pipe(N.flatMap(t=>t.done?Ft.done():N.succeed(t.value)))),ite=e=>e===void 0?N.void:ns.runDrain(Q$(e)).pipe(N.ignore);function cte(e,t){let r=new URL(e.url),n=e.headers.get(\"x-forwarded-host\");n&&(r.hostname=n);let o=new Request(r.href,{method:e.method,headers:e.headers,body:t===void 0?null:ns.toReadableStream(Q$(t)),signal:e.signal,duplex:\"half\"});return o.headers.delete(\"sb-api-key\"),EdgeRuntime.applySupabaseTag(e,o),o}Deno.serve({handler:e=>N.runPromiseExit(N.gen(function*(){let t=yield*N.acquireRelease(N.sync(()=>e.body?.getReader()),u=>N.interruptible(ite(u))),{pathname:r}=new URL(e.url);if(r===\"/_internal/health\")return fc({message:\"ok\"},Kr.OK);if(r===\"/_internal/metric\")return Response.json(yield*Oa(()=>EdgeRuntime.getRuntimeMetrics()));let n=r.split(\"/\")[1];if(!n)return fc(\"Function not found\",Kr.NotFound);let o=yield*nte(n);if(!o)return fc(\"Function not found\",Kr.NotFound);if(yield*ote(n,o),e.method!==\"OPTIONS\"&&o.verifyJWT){let u=Qee(e);if(typeof u!=\"string\")return G$(u);let f=yield*rte(Lee,u);if(xe.isSome(f))return G$(f.value)}let s={...Deno.env.toObject(),...Object.fromEntries(Object.entries(o.env??{}).filter(([u])=>!u.startsWith(\"SUPABASE_\"))),SUPABASE_FUNCTION_SLUG:n};J$&&(s.SUPABASE_PUBLISHABLE_KEYS=yield*me.encodeEffect(me.fromJsonString(me.Unknown))({default:J$})),K$&&(s.SUPABASE_SECRET_KEYS=yield*me.encodeEffect(me.fromJsonString(me.Unknown))({default:K$}));let a=Object.entries(s).filter(([u])=>!Dee.has(u)&&!u.startsWith(\"SUPABASE_INTERNAL_\")),i=!(yield*ate(o));return yield*N.gen(function*(){let u=yield*Oa(()=>EdgeRuntime.userWorkers.create({servicePath:ste(n,o),memoryLimitMb:256,workerTimeoutMs:Number.isFinite(W$)?W$*1e3:4e5,noModuleCache:!0,noNpm:i,envVars:a,forceCreate:!0,customModuleRoot:\"\",cpuTimeSoftLimitMs:1e3,cpuTimeHardLimitMs:2e3,decoratorType:\"tc39\",maybeEntrypoint:i$(o.entrypointPath).href,context:{useReadSyncFileAPI:!0,...o.importMapPath===\"\"||o.importMapDiscoveredByRuntime?{}:{importMapPath:o.importMapPath}},staticPatterns:o.staticFiles}));return yield*Oa(()=>u.fetch(cte(e,t)))}).pipe(N.retry({times:1,while:({cause:u})=>e.body===null&&Hee(u)}),N.catchTag(\"BootstrapOperationError\",({cause:u})=>ic.error(\"[functions] worker error\",u).pipe(N.andThen(N.succeed(Zee(u))))))}).pipe(N.scoped),{signal:e.signal}).then(t=>{if(ir.isSuccess(t))return t.value;if(e.signal.aborted&&Ft.hasInterruptsOnly(t.cause))return new Response(null,{status:499});throw Ft.squash(t.cause)}),onListen:()=>{let t=Object.keys(tC).slice(0,5).map(r=>` - http://127.0.0.1:${H$}/functions/v1/${r}`);N.runSync(ic.log(`Serving functions on http://127.0.0.1:${H$}/functions/v1/${t.length?`\n${t.join(`\n`)}`:\"\"}\nUsing ${Deno.version.deno}`))},onError:()=>fc({code:N0[500],message:\"Request failed due to an internal server error\"},500)});export{Wee as RequestErrors,Yee as extractBearerToken,cte as prepareUserRequest};\n"; diff --git a/patches/@effect__vitest@4.0.1.patch b/patches/@effect__vitest@4.0.2.patch similarity index 100% rename from patches/@effect__vitest@4.0.1.patch rename to patches/@effect__vitest@4.0.2.patch diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce623e3fa6..64ea955b52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -165,20 +165,20 @@ settings: catalogs: default: '@effect/platform-bun': - specifier: 4.0.1 - version: 4.0.1 + specifier: 4.0.2 + version: 4.0.2 '@effect/platform-node': - specifier: 4.0.1 - version: 4.0.1 + specifier: 4.0.2 + version: 4.0.2 '@effect/sql-pg': - specifier: 4.0.1 - version: 4.0.1 + specifier: 4.0.2 + version: 4.0.2 '@effect/tsgo': specifier: 0.37.0 version: 0.37.0 '@effect/vitest': - specifier: 4.0.1 - version: 4.0.1 + specifier: 4.0.2 + version: 4.0.2 '@supabase/supabase-js': specifier: ^2.110.7 version: 2.112.4 @@ -195,8 +195,8 @@ catalogs: specifier: ^5.0.0 version: 5.0.0 effect: - specifier: 4.0.1 - version: 4.0.1 + specifier: 4.0.2 + version: 4.0.2 knip: specifier: ^6.32.2 version: 6.34.0 @@ -234,7 +234,7 @@ overrides: packageExtensionsChecksum: sha256-gAA6Mc6Jn3jUpogzVWO9hE5trVRioaB8peQBgDbyG6I= patchedDependencies: - '@effect/vitest@4.0.1': 9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146 + '@effect/vitest@4.0.2': 9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146 '@libpg-query/parser@17.6.10': ed67c0ca88b6ced3ec50fd6862f191d6192a246cf20d9c777d45efdb8373bed3 importers: @@ -310,13 +310,13 @@ importers: version: 1.7.0 '@effect/platform-bun': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1) + version: 4.0.2(effect@4.0.2) '@effect/sql-pg': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1) + version: 4.0.2(effect@4.0.2) '@effect/vitest': specifier: 'catalog:' - version: 4.0.1(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) + version: 4.0.2(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.2)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) '@modelcontextprotocol/sdk': specifier: ^1.30.0 version: 1.30.0(supports-color@7.2.0)(zod@4.5.4) @@ -367,7 +367,7 @@ importers: version: 17.4.2 effect: specifier: 'catalog:' - version: 4.0.1 + version: 4.0.2 esbuild: specifier: ^0.28.2 version: 0.28.2 @@ -492,13 +492,13 @@ importers: dependencies: '@effect/platform-bun': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1) + version: 4.0.2(effect@4.0.2) '@effect/platform-node': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1)(redis@6.2.1) + version: 4.0.2(effect@4.0.2)(redis@6.2.1) effect: specifier: 'catalog:' - version: 4.0.1 + version: 4.0.2 devDependencies: '@tsconfig/bun': specifier: 'catalog:' @@ -564,10 +564,10 @@ importers: devDependencies: '@effect/platform-bun': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1) + version: 4.0.2(effect@4.0.2) '@effect/platform-node': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1)(redis@6.2.1) + version: 4.0.2(effect@4.0.2)(redis@6.2.1) '@semantic-release/commit-analyzer': specifier: ^13.0.1 version: 13.0.1(semantic-release@25.0.9(supports-color@7.2.0)(typescript@7.0.2))(supports-color@7.2.0) @@ -585,7 +585,7 @@ importers: version: 5.0.0(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) effect: specifier: 'catalog:' - version: 4.0.1 + version: 4.0.2 semantic-release: specifier: 'catalog:' version: 25.0.9(supports-color@7.2.0)(typescript@7.0.2) @@ -603,20 +603,20 @@ importers: dependencies: '@effect/platform-node': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1)(redis@6.2.1) + version: 4.0.2(effect@4.0.2)(redis@6.2.1) '@effect/sql-pg': specifier: 'catalog:' - version: 4.0.1(effect@4.0.1) + version: 4.0.2(effect@4.0.2) effect: specifier: 'catalog:' - version: 4.0.1 + version: 4.0.2 jose: specifier: ^6.2.10 version: 6.2.10 devDependencies: '@effect/vitest': specifier: 'catalog:' - version: 4.0.1(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) + version: 4.0.2(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.2)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0) '@tsconfig/bun': specifier: 'catalog:' version: 1.0.11 @@ -879,28 +879,28 @@ packages: peerDependencies: '@noble/ciphers': ^1.0.0 - '@effect/platform-bun@4.0.1': - resolution: {integrity: sha512-m+QR4bp39ZWujCuEsUhZADIYIOFZcUHHlmrixENZqZRbEYgaPLMUWiPrRJ69CM4BuuHW8oCOxfMGUU7oSw/o5g==} + '@effect/platform-bun@4.0.2': + resolution: {integrity: sha512-wbQ9jQKtTjqHOYvMrgINWKuP05Q0cXe/Rze2c2gOAakztE34tVzT4aRvvooUR2l+JGWf/hL26nmHXJ4/Urkqiw==} peerDependencies: - effect: ^4.0.1 + effect: ^4.0.2 - '@effect/platform-node-shared@4.0.1': - resolution: {integrity: sha512-VanaejudEhKJ4mpmqnEzdncVUhN6sGSO9ZDND54mRxAlZxj+4dYAWjDTYAy9o4tJo9aALeP2U8cVcOFzEdSeLg==} + '@effect/platform-node-shared@4.0.2': + resolution: {integrity: sha512-xn8aDw9p/QUPt1Yi0C3HUMcycT+MjHfAe19FDUDrUuzcwq0xxskkamVSqbdykF/Dsuus4aZTsCBZA/vkhHIfbQ==} engines: {node: '>=18.0.0'} peerDependencies: - effect: ^4.0.1 + effect: ^4.0.2 - '@effect/platform-node@4.0.1': - resolution: {integrity: sha512-FT0Fu5LO0/XP9zBpj0HqrtJNLluK4StNKqf6TSulUsjp8FPBsDVXGJiDuyoN5J2yVMT7tgvhxSwaDcObWVRIaQ==} + '@effect/platform-node@4.0.2': + resolution: {integrity: sha512-RWesXBQStnFHdD465gR5thFKgXO7FSyCKRZ56nWXB7PedNVzr8vV0nb/3MULLdri493sMz/b/pmGBTb6K8cBjQ==} engines: {node: '>=18.0.0'} peerDependencies: - effect: ^4.0.1 + effect: ^4.0.2 redis: '>=5.0.0 <7.0.0' - '@effect/sql-pg@4.0.1': - resolution: {integrity: sha512-X5aqOxHNWqVXL+vyTQZLYDip65lm5rrZHuNkWyyr672iup1tjYAs5Dn9tHR5h1t0blpJ57j8Ng5G5AUQ8teIqA==} + '@effect/sql-pg@4.0.2': + resolution: {integrity: sha512-i2N5F0L5s1S8Nx2I8V7k+awBinP26b5xiiHL1zn5b6RALNnloiU7FK1yS4dAkmqG9B0EcOVxvJrIpoMWwrB4hw==} peerDependencies: - effect: ^4.0.1 + effect: ^4.0.2 '@effect/tsgo-darwin-arm64@0.37.0': resolution: {integrity: sha512-D9o2NKswmRklu+sG28HkxZAvtvOa0Mt+bLVjJKydF2kVw+gePxiHuTbbI3e4Kqumv4ucLT3TtqU1a2RirC80lA==} @@ -941,10 +941,10 @@ packages: resolution: {integrity: sha512-jCJIUcNgI0vaoylao/mhOv+7hDfaJRwZJSJrg5kA/FCQ4aGDhAYqyQx+hoZh8AW3pzD9Qp1RWtUsVFqOzIOENw==} hasBin: true - '@effect/vitest@4.0.1': - resolution: {integrity: sha512-DbY9kf/018zBxRIX7rJwBnPVPzSarnUpcshm0vfYPFiDkSa7AFrXTh2BlDNUbrdrmqcIOBhVZ7GkEtxf8WiQrg==} + '@effect/vitest@4.0.2': + resolution: {integrity: sha512-Zb72nu7iUy3rNdBp9J1Xu5oUQGwJ8cOYsUwmYgujj88aqyvASRDjOS01SjlcPViqf77csduetKdCJTVndMNfzw==} peerDependencies: - effect: ^4.0.1 + effect: ^4.0.2 vite: '*' vitest: '>=5.0.0 <6.0.0' @@ -3017,6 +3017,9 @@ packages: '@types/ws@8.18.1': resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + '@types/ws@8.18.2': + resolution: {integrity: sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==} + '@typescript/typescript-aix-ppc64@7.0.2': resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} engines: {node: '>=16.20.0'} @@ -3937,8 +3940,8 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - effect@4.0.1: - resolution: {integrity: sha512-b1VlQG9g8fwxE5QnIZuPoOP/0MsqHJSRKxUijjoM80E5q95FXrX5yWtY5XI8G+GJsBQAVSDbLS458z9a++uVvw==} + effect@4.0.2: + resolution: {integrity: sha512-YeYnLqSFrL4+tCOXRrfNP03w8FILoF/wDl+ukraJAGzXrjcS383W7LAAvGBbLatEyktmLxRq+9xJinx7QzXW5A==} emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} @@ -7042,36 +7045,36 @@ snapshots: dependencies: '@noble/ciphers': 1.3.0 - '@effect/platform-bun@4.0.1(effect@4.0.1)': + '@effect/platform-bun@4.0.2(effect@4.0.2)': dependencies: - '@effect/platform-node-shared': 4.0.1(effect@4.0.1) - effect: 4.0.1 + '@effect/platform-node-shared': 4.0.2(effect@4.0.2) + effect: 4.0.2 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node-shared@4.0.1(effect@4.0.1)': + '@effect/platform-node-shared@4.0.2(effect@4.0.2)': dependencies: - '@types/ws': 8.18.1 - effect: 4.0.1 + '@types/ws': 8.18.2 + effect: 4.0.2 ws: 8.22.0 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node@4.0.1(effect@4.0.1)(redis@6.2.1)': + '@effect/platform-node@4.0.2(effect@4.0.2)(redis@6.2.1)': dependencies: - '@effect/platform-node-shared': 4.0.1(effect@4.0.1) - effect: 4.0.1 + '@effect/platform-node-shared': 4.0.2(effect@4.0.2) + effect: 4.0.2 redis: 6.2.1 undici: 8.11.2 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/sql-pg@4.0.1(effect@4.0.1)': + '@effect/sql-pg@4.0.2(effect@4.0.2)': dependencies: - effect: 4.0.1 + effect: 4.0.2 '@effect/tsgo-darwin-arm64@0.37.0': optional: true @@ -7104,9 +7107,9 @@ snapshots: '@effect/tsgo-win32-arm64': 0.37.0 '@effect/tsgo-win32-x64': 0.37.0 - '@effect/vitest@4.0.1(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.1)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0)': + '@effect/vitest@4.0.2(patch_hash=9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146)(effect@4.0.2)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0))(vitest@5.0.0)': dependencies: - effect: 4.0.1 + effect: 4.0.2 vite: 8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0) vitest: 5.0.0(@types/node@26.4.1)(@vitest/coverage-v8@5.0.0)(vite@8.2.2(@types/node@26.4.1)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0)) @@ -8718,6 +8721,10 @@ snapshots: dependencies: '@types/node': 26.4.1 + '@types/ws@8.18.2': + dependencies: + '@types/node': 26.4.1 + '@typescript/typescript-aix-ppc64@7.0.2': optional: true @@ -9583,7 +9590,7 @@ snapshots: ee-first@1.1.1: {} - effect@4.0.1: {} + effect@4.0.2: {} emoji-regex@10.6.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 63be154f94..c23bbd5b1b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -11,18 +11,18 @@ allowBuilds: sharp: true catalog: - "@effect/platform-bun": "4.0.1" - "@effect/platform-node": "4.0.1" - "@effect/sql-pg": "4.0.1" + "@effect/platform-bun": "4.0.2" + "@effect/platform-node": "4.0.2" + "@effect/sql-pg": "4.0.2" "@effect/tsgo": &effect-tsgo-version "0.37.0" - "@effect/vitest": "4.0.1" + "@effect/vitest": "4.0.2" "@supabase/supabase-js": ^2.110.7 "@tsconfig/bun": "^1.0.11" "@types/bun": "^1.4.2" "@types/ws": "8.18.1" "typescript": "^7.0.2" "@vitest/coverage-v8": "^5.0.0" - "effect": "4.0.1" + "effect": "4.0.2" "knip": "^6.32.2" "oxfmt": "^0.65.0" "oxlint": "1.80.0" @@ -102,11 +102,11 @@ minimumReleaseAgeExclude: - "@turbo/linux-arm64@2.10.11" - "@turbo/windows-64@2.10.11" - "@turbo/windows-arm64@2.10.11" - - "@effect/platform-bun@4.0.1" - - "@effect/platform-node@4.0.1" - - "@effect/platform-node-shared@4.0.1" - - "@effect/sql-pg@4.0.1" - - "@effect/vitest@4.0.1" + - "@effect/platform-bun@4.0.2" + - "@effect/platform-node@4.0.2" + - "@effect/platform-node-shared@4.0.2" + - "@effect/sql-pg@4.0.2" + - "@effect/vitest@4.0.2" - "@supabase/pg-delta@1.0.0-alpha.57" - "@supabase/pg-topo@1.0.0-alpha.8" - "@supabase/postgrest-typegen@0.4.0" @@ -115,7 +115,7 @@ minimumReleaseAgeExclude: - "@ark/schema@0.56.4" - "@ark/util@0.56.4" - "arkregex@0.0.10" - - "effect@4.0.1" + - "effect@4.0.2" - "turbo@2.10.11" supportedArchitectures: @@ -134,7 +134,7 @@ supportedArchitectures: - win32 patchedDependencies: - "@effect/vitest@4.0.1": patches/@effect__vitest@4.0.1.patch + "@effect/vitest@4.0.2": patches/@effect__vitest@4.0.2.patch "@libpg-query/parser@17.6.10": patches/@libpg-query__parser@17.6.10.patch virtualStoreType: global From 231c811f597d835693135791da7a93625713f9bb Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Wed, 7 Oct 2026 20:20:57 -0700 Subject: [PATCH 19/28] test(stack): run the CA bundle fixtures one statement at a time The native client rejects batched statements and decodes net.http_get's bigint request id as a bigint, so the test casts it to text. Generated with AI Co-Authored-By: Claude --- .../stack/src/services/Database.integration.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/stack/src/services/Database.integration.test.ts b/packages/stack/src/services/Database.integration.test.ts index 50b2dc6e84..084b37a8bd 100644 --- a/packages/stack/src/services/Database.integration.test.ts +++ b/packages/stack/src/services/Database.integration.test.ts @@ -280,8 +280,9 @@ describe("database component", { timeout: 180_000 }, () => { yield* query( endpoint, config.databasePassword, - "CREATE EXTENSION http WITH SCHEMA extensions; CREATE EXTENSION pg_net", + "CREATE EXTENSION http WITH SCHEMA extensions", ); + yield* query(endpoint, config.databasePassword, "CREATE EXTENSION pg_net"); expect( yield* query( endpoint, @@ -295,7 +296,7 @@ describe("database component", { timeout: 180_000 }, () => { yield* query( endpoint, config.databasePassword, - `SELECT net.http_get('https://127.0.0.1:${trusted.port}/') AS id`, + `SELECT net.http_get('https://127.0.0.1:${trusted.port}/')::text AS id`, ), ); expect( @@ -353,7 +354,12 @@ describe("database component", { timeout: 180_000 }, () => { yield* query( endpoint, config.databasePassword, - `CREATE TABLE server_env (file text, dir text); COPY server_env FROM PROGRAM 'printf "%s\\t%s\\n" "$SSL_CERT_FILE" "$SSL_CERT_DIR"'`, + "CREATE TABLE server_env (file text, dir text)", + ); + yield* query( + endpoint, + config.databasePassword, + `COPY server_env FROM PROGRAM 'printf "%s\\t%s\\n" "$SSL_CERT_FILE" "$SSL_CERT_DIR"'`, ); const [serverEnv] = yield* Schema.decodeUnknownEffect( Schema.Tuple([Schema.Struct({ file: Schema.String, dir: Schema.String })]), From a02c6ebd5bcc05a39c7f5f23d7410ba1be55b4b6 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 10:08:49 +0200 Subject: [PATCH 20/28] fix(deps): restore the platform-node-shared stdin EPIPE listener on 4.0.2 4.0.2 still removes the stdin sink's error listener before the final end() flush, so a child that exits before reading its input raises EPIPE as an uncaught exception on Linux. Effect PRs 7712 and 7714 did not cover this path. --- patches/@effect__platform-node-shared@4.0.2.patch | 15 +++++++++++++++ pnpm-lock.yaml | 7 ++++--- pnpm-workspace.yaml | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 patches/@effect__platform-node-shared@4.0.2.patch diff --git a/patches/@effect__platform-node-shared@4.0.2.patch b/patches/@effect__platform-node-shared@4.0.2.patch new file mode 100644 index 0000000000..e478a007e3 --- /dev/null +++ b/patches/@effect__platform-node-shared@4.0.2.patch @@ -0,0 +1,15 @@ +diff --git a/dist/NodeChildProcessSpawner.js b/dist/NodeChildProcessSpawner.js +index b3e4deaa75124184262437280a97bad2b9e07c9d..4b1f5f5f4c119e738991b6d8b84d59fd425d0833 100644 +--- a/dist/NodeChildProcessSpawner.js ++++ b/dist/NodeChildProcessSpawner.js +@@ -214,6 +214,10 @@ const make = /*#__PURE__*/Effect.gen(function* () { + // sink that will attached to the process handle + let sink = Sink.drain; + if (Predicate.isNotNull(childProcess.stdin)) { ++ // A child that exits before reading its input fails the final flush of `end()` with ++ // EPIPE after the sink's own listener is gone; without a listener Node raises it as an ++ // uncaught exception. The write loop still reports write failures through `onError`. ++ childProcess.stdin.on("error", () => {}); + sink = NodeSink.fromWritable({ + evaluate: () => childProcess.stdin, + onError: error => toPlatformError("fromWritable(stdin)", toError(error), command), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 64ea955b52..c27a5a1d9b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -234,6 +234,7 @@ overrides: packageExtensionsChecksum: sha256-gAA6Mc6Jn3jUpogzVWO9hE5trVRioaB8peQBgDbyG6I= patchedDependencies: + '@effect/platform-node-shared@4.0.2': 90a5d5bd45ffbfc265807a93f30110c9a2fc3393633fe82b92ee628c00a78658 '@effect/vitest@4.0.2': 9c4eb0354e3ac316883a3575b51bed9a215d49f34f117682c427d5137a5a2146 '@libpg-query/parser@17.6.10': ed67c0ca88b6ced3ec50fd6862f191d6192a246cf20d9c777d45efdb8373bed3 @@ -7047,13 +7048,13 @@ snapshots: '@effect/platform-bun@4.0.2(effect@4.0.2)': dependencies: - '@effect/platform-node-shared': 4.0.2(effect@4.0.2) + '@effect/platform-node-shared': 4.0.2(patch_hash=90a5d5bd45ffbfc265807a93f30110c9a2fc3393633fe82b92ee628c00a78658)(effect@4.0.2) effect: 4.0.2 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node-shared@4.0.2(effect@4.0.2)': + '@effect/platform-node-shared@4.0.2(patch_hash=90a5d5bd45ffbfc265807a93f30110c9a2fc3393633fe82b92ee628c00a78658)(effect@4.0.2)': dependencies: '@types/ws': 8.18.2 effect: 4.0.2 @@ -7064,7 +7065,7 @@ snapshots: '@effect/platform-node@4.0.2(effect@4.0.2)(redis@6.2.1)': dependencies: - '@effect/platform-node-shared': 4.0.2(effect@4.0.2) + '@effect/platform-node-shared': 4.0.2(patch_hash=90a5d5bd45ffbfc265807a93f30110c9a2fc3393633fe82b92ee628c00a78658)(effect@4.0.2) effect: 4.0.2 redis: 6.2.1 undici: 8.11.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c23bbd5b1b..4cb7aa366e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -134,6 +134,7 @@ supportedArchitectures: - win32 patchedDependencies: + "@effect/platform-node-shared@4.0.2": patches/@effect__platform-node-shared@4.0.2.patch "@effect/vitest@4.0.2": patches/@effect__vitest@4.0.2.patch "@libpg-query/parser@17.6.10": patches/@libpg-query__parser@17.6.10.patch From 5a2d57368a7ab9b5e1a5726d2b1031787db60b02 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 10:08:50 +0200 Subject: [PATCH 21/28] chore(api): regenerate Management API contracts with effect 4.0.2 The 4.0.2 schema codegen emits code-point length checks and Unicode-flagged patterns. --- packages/api/src/generated/contracts.ts | 1889 +++++++++++++++-------- 1 file changed, 1211 insertions(+), 678 deletions(-) diff --git a/packages/api/src/generated/contracts.ts b/packages/api/src/generated/contracts.ts index 5ee0ac8906..c39cbf9be9 100644 --- a/packages/api/src/generated/contracts.ts +++ b/packages/api/src/generated/contracts.ts @@ -120,6 +120,7 @@ export const BranchResponse_Output = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -244,7 +245,7 @@ export const FunctionResponse_Output = Schema.Struct({ export const OrganizationResponseV1_Output = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `slug` instead." }), slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -253,10 +254,14 @@ export const OrganizationResponseV1_Output = Schema.Struct({ export const V1ProjectWithDatabaseResponse_Output = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `ref` instead." }), ref: Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -264,7 +269,7 @@ export const V1ProjectWithDatabaseResponse_Output = Schema.Struct({ description: "Deprecated: Use `organization_slug` instead.", }), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -313,6 +318,7 @@ export const ThirdPartyAuth_Output = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -358,11 +364,13 @@ export const BinaryInput = Schema.Union([ // operation schemas export const V1AcceptInviteExternalJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -372,6 +380,7 @@ export const V1AcceptInviteExternalJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -388,6 +397,7 @@ export const V1AcceptInviteExternalJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -410,6 +420,7 @@ export const V1AcceptInviteExternalJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -426,6 +437,7 @@ export const V1AcceptInviteExternalJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -443,11 +455,13 @@ export const V1AcceptInviteExternalJitAccessOutput = Schema.Struct({ }); export const V1ActivateCustomHostnameInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -501,16 +515,18 @@ export const V1ActivateCustomHostnameOutput = Schema.Struct({ }); export const V1ActivateVanitySubdomainConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), vanity_subdomain: Schema.String.check( - Schema.isMaxLength(63).annotate({ expected: "a value with a length of at most 63" }), + Schema.isMaxCodePoints(63).annotate({ expected: "a string with at most 63 code points" }), ), }); export const V1ActivateVanitySubdomainConfigOutput = Schema.Struct({ @@ -518,11 +534,13 @@ export const V1ActivateVanitySubdomainConfigOutput = Schema.Struct({ }); export const V1ApplyAMigrationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -535,11 +553,13 @@ export const V1ApplyAMigrationInput = Schema.Struct({ }); export const V1ApplyProjectAddonInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -581,11 +601,13 @@ export const V1ApplyProjectAddonInput = Schema.Struct({ }); export const V1AuthorizeJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -597,6 +619,7 @@ export const V1AuthorizeJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$", + "u", ), ).annotate({ expected: @@ -607,6 +630,7 @@ export const V1AuthorizeJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$", + "u", ), ).annotate({ expected: @@ -621,6 +645,7 @@ export const V1AuthorizeJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -643,6 +668,7 @@ export const V1AuthorizeJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -659,6 +685,7 @@ export const V1AuthorizeJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -678,6 +705,7 @@ export const V1AuthorizeUserInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -693,7 +721,7 @@ export const V1AuthorizeUserInput = Schema.Struct({ code_challenge_method: Schema.optionalKey(Schema.Literals(["plain", "sha256", "S256"])), organization_slug: Schema.optionalKey( Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -703,11 +731,13 @@ export const V1AuthorizeUserInput = Schema.Struct({ }); export const V1BulkCreateSecretsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -717,26 +747,32 @@ export const V1BulkCreateSecretsInput = Schema.Struct({ description: "Secret name must not start with the SUPABASE_ prefix.", }) .check( - Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" }), + Schema.isMaxCodePoints(256).annotate({ + expected: "a string with at most 256 code points", + }), ) .check( - Schema.isPattern(new RegExp("^(?!SUPABASE_).*")).annotate({ + Schema.isPattern(new RegExp("^(?!SUPABASE_).*", "u")).annotate({ expected: "a string matching the RegExp ^(?!SUPABASE_).*", }), ), value: Schema.String.check( - Schema.isMaxLength(24576).annotate({ expected: "a value with a length of at most 24576" }), + Schema.isMaxCodePoints(24576).annotate({ + expected: "a string with at most 24576 code points", + }), ), }), ).check(Schema.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), }); export const V1BulkDeleteSecretsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -744,11 +780,13 @@ export const V1BulkDeleteSecretsInput = Schema.Struct({ }); export const V1BulkUpdateFunctionsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -756,7 +794,7 @@ export const V1BulkUpdateFunctionsInput = Schema.Struct({ Schema.Struct({ id: Schema.String, slug: Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z][A-Za-z0-9_-]*$", }), ), @@ -847,27 +885,31 @@ export const V1BulkUpdateFunctionsOutput = Schema.Struct({ }); export const V1CancelAProjectRestorationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1CheckVanitySubdomainAvailabilityInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), vanity_subdomain: Schema.String.check( - Schema.isMaxLength(63).annotate({ expected: "a value with a length of at most 63" }), + Schema.isMaxCodePoints(63).annotate({ expected: "a string with at most 63 code points" }), ), }); export const V1CheckVanitySubdomainAvailabilityOutput = Schema.Struct({ @@ -875,7 +917,7 @@ export const V1CheckVanitySubdomainAvailabilityOutput = Schema.Struct({ }); export const V1ClaimProjectForOrganizationInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -883,22 +925,26 @@ export const V1ClaimProjectForOrganizationInput = Schema.Struct({ }); export const V1CountActionRunsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1CreateABranchInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -957,6 +1003,7 @@ export const V1CreateABranchOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1026,17 +1073,19 @@ export const V1CreateABranchOutput = Schema.Struct({ }); export const V1CreateAFunctionInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), slug: Schema.optionalKey( Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", }), ), @@ -1098,13 +1147,13 @@ export const V1CreateAFunctionOutput = Schema.Struct({ export const V1CreateAProjectInput = Schema.Struct({ db_pass: Schema.String.annotate({ description: "Database password" }), name: Schema.String.annotate({ description: "Name of your project" }).check( - Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" }), + Schema.isMaxCodePoints(256).annotate({ expected: "a string with at most 256 code points" }), ), organization_id: Schema.optionalKey( Schema.String.annotate({ description: "Deprecated: Use `organization_slug` instead." }), ), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -1236,10 +1285,14 @@ export const V1CreateAProjectInput = Schema.Struct({ export const V1CreateAProjectOutput = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `ref` instead." }), ref: Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1247,7 +1300,7 @@ export const V1CreateAProjectOutput = Schema.Struct({ description: "Deprecated: Use `organization_slug` instead.", }), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -1274,11 +1327,13 @@ export const V1CreateAProjectOutput = Schema.Struct({ }); export const V1CreateASsoProviderInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1354,13 +1409,13 @@ export const V1CreateASsoProviderOutput = Schema.Struct({ }); export const V1CreateAnOrganizationInput = Schema.Struct({ name: Schema.String.check( - Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" }), + Schema.isMaxCodePoints(256).annotate({ expected: "a string with at most 256 code points" }), ), }); export const V1CreateAnOrganizationOutput = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `slug` instead." }), slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -1368,11 +1423,13 @@ export const V1CreateAnOrganizationOutput = Schema.Struct({ }); export const V1CreateLegacySigningKeyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1382,6 +1439,7 @@ export const V1CreateLegacySigningKeyOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1396,11 +1454,13 @@ export const V1CreateLegacySigningKeyOutput = Schema.Struct({ }); export const V1CreateLoginRoleInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1426,22 +1486,26 @@ export const V1CreateLoginRoleOutput = Schema.Struct({ }); export const V1CreateProjectApiKeyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), type: Schema.Literals(["publishable", "secret"]), name: Schema.String.check( - Schema.isMinLength(4).annotate({ expected: "a value with a length of at least 4" }), + Schema.isMinCodePoints(4).annotate({ expected: "a string with at least 4 code points" }), ) - .check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })) .check( - Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$")).annotate({ + Schema.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z_][a-z0-9_]+$", }), ), @@ -1478,11 +1542,13 @@ export const V1CreateProjectApiKeyOutput = Schema.Struct({ }); export const V1CreateProjectClaimTokenInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1496,6 +1562,7 @@ export const V1CreateProjectClaimTokenOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1505,11 +1572,13 @@ export const V1CreateProjectClaimTokenOutput = Schema.Struct({ }); export const V1CreateProjectSigningKeyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1524,6 +1593,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1559,6 +1629,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1590,6 +1661,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1620,6 +1692,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1641,7 +1714,9 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ kty: Schema.Literal("oct"), alg: Schema.optionalKey(Schema.Literal("HS256")), k: Schema.String.check( - Schema.isMinLength(16).annotate({ expected: "a value with a length of at least 16" }), + Schema.isMinCodePoints(16).annotate({ + expected: "a string with at least 16 code points", + }), ), }), ], @@ -1654,6 +1729,7 @@ export const V1CreateProjectSigningKeyOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1668,11 +1744,13 @@ export const V1CreateProjectSigningKeyOutput = Schema.Struct({ }); export const V1CreateProjectTpaIntegrationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1685,6 +1763,7 @@ export const V1CreateProjectTpaIntegrationOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1702,16 +1781,18 @@ export const V1CreateProjectTpaIntegrationOutput = Schema.Struct({ }); export const V1CreateRestorePointInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.String.check( - Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), ), }); export const V1CreateRestorePointOutput = Schema.Struct({ @@ -1721,22 +1802,26 @@ export const V1CreateRestorePointOutput = Schema.Struct({ }); export const V1DeactivateVanitySubdomainConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1DeleteHostnameConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1745,10 +1830,14 @@ export const V1DeleteHostnameConfigInput = Schema.Struct({ export const V1DeleteABranchInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1756,6 +1845,7 @@ export const V1DeleteABranchInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1768,27 +1858,31 @@ export const V1DeleteABranchInput = Schema.Struct({ export const V1DeleteABranchOutput = Schema.Struct({ message: Schema.Literal("ok") }); export const V1DeleteAFunctionInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), function_slug: Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", }), ), }); export const V1DeleteAProjectInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1810,11 +1904,13 @@ export const V1DeleteAProjectOutput = Schema.Struct({ }); export const V1DeleteASsoProviderInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1822,6 +1918,7 @@ export const V1DeleteASsoProviderInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1875,11 +1972,13 @@ export const V1DeleteASsoProviderOutput = Schema.Struct({ }); export const V1DeleteInviteExternalJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1887,6 +1986,7 @@ export const V1DeleteInviteExternalJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1896,11 +1996,13 @@ export const V1DeleteInviteExternalJitAccessInput = Schema.Struct({ }); export const V1DeleteJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1908,6 +2010,7 @@ export const V1DeleteJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1917,11 +2020,13 @@ export const V1DeleteJitAccessInput = Schema.Struct({ }); export const V1DeleteLoginRolesInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1929,11 +2034,13 @@ export const V1DeleteLoginRolesInput = Schema.Struct({ export const V1DeleteLoginRolesOutput = Schema.Struct({ message: Schema.Literal("ok") }); export const V1DeleteNetworkBansInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1949,11 +2056,13 @@ export const V1DeleteNetworkBansInput = Schema.Struct({ }); export const V1DeleteProjectApiKeyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -1961,6 +2070,7 @@ export const V1DeleteProjectApiKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -1996,22 +2106,26 @@ export const V1DeleteProjectApiKeyOutput = Schema.Struct({ }); export const V1DeleteProjectClaimTokenInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1DeleteProjectTpaIntegrationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2019,6 +2133,7 @@ export const V1DeleteProjectTpaIntegrationInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2031,6 +2146,7 @@ export const V1DeleteProjectTpaIntegrationOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2048,17 +2164,19 @@ export const V1DeleteProjectTpaIntegrationOutput = Schema.Struct({ }); export const V1DeployAFunctionInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), slug: Schema.optionalKey( Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z][A-Za-z0-9_-]*$", }), ), @@ -2128,10 +2246,14 @@ export const V1DeployAFunctionOutput = Schema.Struct({ export const V1DiffABranchInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2139,6 +2261,7 @@ export const V1DiffABranchInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2152,33 +2275,39 @@ export const V1DiffABranchInput = Schema.Struct({ export const V1DiffABranchOutput = Schema.String; export const V1DisablePreviewBranchingInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1DisableReadonlyModeTemporarilyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1EnableDatabaseWebhookInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2197,6 +2326,7 @@ export const V1ExchangeOauthTokenInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2248,11 +2378,13 @@ export const V1ExchangeOauthTokenOutput = Schema.Struct({ export const V1GenerateTypescriptTypesInput = Schema.Struct({ included_schemas: Schema.optionalKey(Schema.String), ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2260,11 +2392,13 @@ export const V1GenerateTypescriptTypesInput = Schema.Struct({ export const V1GenerateTypescriptTypesOutput = Schema.Struct({ types: Schema.String }); export const V1GetABranchInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2275,6 +2409,7 @@ export const V1GetABranchOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2345,10 +2480,14 @@ export const V1GetABranchOutput = Schema.Struct({ export const V1GetABranchConfigInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2356,6 +2495,7 @@ export const V1GetABranchConfigInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2400,16 +2540,18 @@ export const V1GetABranchConfigOutput = Schema.Struct({ }); export const V1GetAFunctionInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), function_slug: Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", }), ), @@ -2462,16 +2604,18 @@ export const V1GetAFunctionOutput = Schema.Struct({ }); export const V1GetAFunctionBodyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), function_slug: Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", }), ), @@ -2479,16 +2623,18 @@ export const V1GetAFunctionBodyInput = Schema.Struct({ export const V1GetAFunctionBodyOutput = Schema.Record(Schema.String, Schema.Never); export const V1GetAMigrationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), version: Schema.String.check( - Schema.isPattern(new RegExp("^\\d+$")).annotate({ + Schema.isPattern(new RegExp("^\\d+$", "u")).annotate({ expected: "a string matching the RegExp ^\\d+$", }), ), @@ -2506,6 +2652,7 @@ export const V1GetASnippetInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2546,11 +2693,13 @@ export const V1GetASnippetOutput = Schema.Struct({ }); export const V1GetASsoProviderInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2558,6 +2707,7 @@ export const V1GetASsoProviderInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -2611,11 +2761,13 @@ export const V1GetASsoProviderOutput = Schema.Struct({ }); export const V1GetActionRunInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2651,11 +2803,13 @@ export const V1GetActionRunOutput = Schema.Struct({ }); export const V1GetActionRunLogsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -2664,7 +2818,7 @@ export const V1GetActionRunLogsInput = Schema.Struct({ export const V1GetActionRunLogsOutput = Schema.String; export const V1GetAllProjectsForOrganizationInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -2794,7 +2948,7 @@ export const V1GetAllProjectsForOrganizationOutput = Schema.Struct({ }); export const V1GetAnOrganizationInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -2816,11 +2970,13 @@ export const V1GetAnOrganizationOutput = Schema.Struct({ }); export const V1GetAuthServiceConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3342,6 +3498,7 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -3491,11 +3648,13 @@ export const V1GetAvailableRegionsOutput = Schema.Struct({ }); export const V1GetBackupScheduleInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3505,7 +3664,7 @@ export const V1GetBackupScheduleOutput = Schema.Struct({ description: "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", }).check( Schema.isPattern( - new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$"), + new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", "u"), ).annotate({ expected: "a string matching the RegExp ^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", @@ -3518,11 +3677,13 @@ export const V1GetBackupScheduleOutput = Schema.Struct({ }); export const V1GetDatabaseDiskInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3577,11 +3738,13 @@ export const V1GetDatabaseDiskOutput = Schema.Struct({ }); export const V1GetDatabaseMetadataInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3596,11 +3759,13 @@ export const V1GetDatabaseMetadataOutput = Schema.Struct({ }); export const V1GetDatabaseOpenapiInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3612,11 +3777,13 @@ export const V1GetDatabaseOpenapiOutput = Schema.Record( ); export const V1GetDiskUtilizationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3633,11 +3800,13 @@ export const V1GetDiskUtilizationOutput = Schema.Struct({ }); export const V1GetHostnameConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3691,11 +3860,13 @@ export const V1GetHostnameConfigOutput = Schema.Struct({ }); export const V1GetJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3706,6 +3877,7 @@ export const V1GetJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -3728,6 +3900,7 @@ export const V1GetJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -3744,6 +3917,7 @@ export const V1GetJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -3761,11 +3935,13 @@ export const V1GetJitAccessOutput = Schema.Struct({ }); export const V1GetJitAccessConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3790,11 +3966,13 @@ export const V1GetJitAccessConfigOutput = Schema.Union( ); export const V1GetLegacySigningKeyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3804,6 +3982,7 @@ export const V1GetLegacySigningKeyOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -3818,11 +3997,13 @@ export const V1GetLegacySigningKeyOutput = Schema.Struct({ }); export const V1GetNetworkRestrictionsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -3851,7 +4032,7 @@ export const V1GetNetworkRestrictionsOutput = Schema.Struct({ }); export const V1GetOrganizationEntitlementsInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -3945,7 +4126,7 @@ export const V1GetOrganizationEntitlementsOutput = Schema.Struct({ }); export const V1GetOrganizationProjectClaimInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -3976,6 +4157,7 @@ export const V1GetOrganizationProjectClaimOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -3985,11 +4167,13 @@ export const V1GetOrganizationProjectClaimOutput = Schema.Struct({ }); export const V1GetPerformanceAdvisorsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4081,11 +4265,13 @@ export const V1GetPerformanceAdvisorsOutput = Schema.Struct({ }); export const V1GetPgsodiumConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4097,11 +4283,13 @@ export const V1GetPgsodiumConfigOutput = Schema.Struct({ }); export const V1GetPoolerConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4109,11 +4297,13 @@ export const V1GetPoolerConfigInput = Schema.Struct({ export const V1GetPoolerConfigOutput = Schema.Array(SupavisorConfigResponse_Output); export const V1GetPostgresConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4164,7 +4354,7 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ "cron.log_statement": Schema.optionalKey(Schema.Boolean), log_autovacuum_min_duration: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -4178,7 +4368,7 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ log_replication_commands: Schema.optionalKey(Schema.Boolean), log_startup_progress_interval: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -4324,7 +4514,7 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ shared_buffers: Schema.optionalKey(Schema.String), statement_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -4333,7 +4523,7 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ wal_keep_size: Schema.optionalKey(Schema.String), wal_sender_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -4341,7 +4531,7 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ work_mem: Schema.optionalKey(Schema.String), checkpoint_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: s" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -4350,11 +4540,13 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ }); export const V1GetPostgresUpgradeEligibilityInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4449,11 +4641,13 @@ export const V1GetPostgresUpgradeEligibilityOutput = Schema.Struct({ }); export const V1GetPostgresUpgradeStatusInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4500,11 +4694,13 @@ export const V1GetPostgresUpgradeStatusOutput = Schema.Struct({ }); export const V1GetPostgrestServiceConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4567,11 +4763,13 @@ export const V1GetProfileOutput = Schema.Struct({ }); export const V1GetProjectInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4579,10 +4777,14 @@ export const V1GetProjectInput = Schema.Struct({ export const V1GetProjectOutput = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `ref` instead." }), ref: Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4590,7 +4792,7 @@ export const V1GetProjectOutput = Schema.Struct({ description: "Deprecated: Use `organization_slug` instead.", }), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -4623,11 +4825,13 @@ export const V1GetProjectOutput = Schema.Struct({ }); export const V1GetProjectApiKeyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4635,6 +4839,7 @@ export const V1GetProjectApiKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -4668,11 +4873,13 @@ export const V1GetProjectApiKeyOutput = Schema.Struct({ }); export const V1GetProjectApiKeysInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4681,11 +4888,13 @@ export const V1GetProjectApiKeysInput = Schema.Struct({ export const V1GetProjectApiKeysOutput = Schema.Array(ApiKeyResponse_Output); export const V1GetProjectClaimTokenInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4698,6 +4907,7 @@ export const V1GetProjectClaimTokenOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -4707,11 +4917,13 @@ export const V1GetProjectClaimTokenOutput = Schema.Struct({ }); export const V1GetProjectDiskAutoscaleConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4753,11 +4965,13 @@ export const V1GetProjectDiskAutoscaleConfigOutput = Schema.Struct({ }); export const V1GetProjectFunctionCombinedStatsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4788,11 +5002,13 @@ export const V1GetProjectFunctionCombinedStatsOutput = Schema.Struct({ }); export const V1GetProjectLegacyApiKeysInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4800,11 +5016,13 @@ export const V1GetProjectLegacyApiKeysInput = Schema.Struct({ export const V1GetProjectLegacyApiKeysOutput = Schema.Struct({ enabled: Schema.Boolean }); export const V1GetProjectLogsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4836,22 +5054,26 @@ export const V1GetProjectLogsOutput = Schema.Struct({ }); export const V1GetProjectLogsAllInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1GetProjectPgbouncerConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4944,6 +5166,7 @@ export const V1GetProjectSigningKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -4951,11 +5174,13 @@ export const V1GetProjectSigningKeyInput = Schema.Struct({ }), ), ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4965,6 +5190,7 @@ export const V1GetProjectSigningKeyOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -4979,11 +5205,13 @@ export const V1GetProjectSigningKeyOutput = Schema.Struct({ }); export const V1GetProjectSigningKeysInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -4995,6 +5223,7 @@ export const V1GetProjectSigningKeysOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -5011,11 +5240,13 @@ export const V1GetProjectSigningKeysOutput = Schema.Struct({ }); export const V1GetProjectTpaIntegrationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5023,6 +5254,7 @@ export const V1GetProjectTpaIntegrationInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -5035,6 +5267,7 @@ export const V1GetProjectTpaIntegrationOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -5052,11 +5285,13 @@ export const V1GetProjectTpaIntegrationOutput = Schema.Struct({ }); export const V1GetProjectUsageApiCountInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5106,11 +5341,13 @@ export const V1GetProjectUsageApiCountOutput = Schema.Struct({ }); export const V1GetProjectUsageRequestCountInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5145,11 +5382,13 @@ export const V1GetProjectUsageRequestCountOutput = Schema.Struct({ }); export const V1GetReadonlyModeStatusInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5161,11 +5400,13 @@ export const V1GetReadonlyModeStatusOutput = Schema.Struct({ }); export const V1GetRealtimeConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5332,17 +5573,19 @@ export const V1GetRealtimeConfigOutput = Schema.Struct({ }); export const V1GetRestorePointInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.optionalKey( Schema.String.check( - Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), ), ), }); @@ -5353,11 +5596,13 @@ export const V1GetRestorePointOutput = Schema.Struct({ }); export const V1GetSecurityAdvisorsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5450,11 +5695,13 @@ export const V1GetSecurityAdvisorsOutput = Schema.Struct({ }); export const V1GetServicesHealthInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5493,11 +5740,13 @@ export const V1GetServicesHealthInput = Schema.Struct({ export const V1GetServicesHealthOutput = Schema.Array(V1ServiceHealthResponse_Output); export const V1GetSslEnforcementConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5508,11 +5757,13 @@ export const V1GetSslEnforcementConfigOutput = Schema.Struct({ }); export const V1GetStorageConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5606,11 +5857,13 @@ export const V1GetStorageConfigOutput = Schema.Struct({ }); export const V1GetVanitySubdomainConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5625,11 +5878,13 @@ export const V1GetVanitySubdomainConfigOutput = Schema.Struct({ }); export const V1InviteExternalJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5639,6 +5894,7 @@ export const V1InviteExternalJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -5662,6 +5918,7 @@ export const V1InviteExternalJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -5678,6 +5935,7 @@ export const V1InviteExternalJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -5698,6 +5956,7 @@ export const V1InviteExternalJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -5708,6 +5967,7 @@ export const V1InviteExternalJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -5729,6 +5989,7 @@ export const V1InviteExternalJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -5745,6 +6006,7 @@ export const V1InviteExternalJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -5762,11 +6024,13 @@ export const V1InviteExternalJitAccessOutput = Schema.Struct({ }); export const V1ListActionRunsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5823,11 +6087,13 @@ export const V1ListActionRunsOutput = Schema.Array( ); export const V1ListAllBackupsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5892,11 +6158,13 @@ export const V1ListAllBackupsOutput = Schema.Struct({ }); export const V1ListAllBranchesInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5904,11 +6172,13 @@ export const V1ListAllBranchesInput = Schema.Struct({ export const V1ListAllBranchesOutput = Schema.Array(BranchResponse_Output); export const V1ListAllBucketsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5916,11 +6186,13 @@ export const V1ListAllBucketsInput = Schema.Struct({ export const V1ListAllBucketsOutput = Schema.Array(V1StorageBucketResponse_Output); export const V1ListAllFunctionsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5928,11 +6200,13 @@ export const V1ListAllFunctionsInput = Schema.Struct({ export const V1ListAllFunctionsOutput = Schema.Array(FunctionResponse_Output); export const V1ListAllNetworkBansInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5942,11 +6216,13 @@ export const V1ListAllNetworkBansOutput = Schema.Struct({ }); export const V1ListAllNetworkBansEnrichedInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5966,11 +6242,13 @@ export const V1ListAllProjectsInput = Schema.Record(Schema.String, Schema.Never) export const V1ListAllProjectsOutput = Schema.Array(V1ProjectWithDatabaseResponse_Output); export const V1ListAllSecretsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -5979,11 +6257,13 @@ export const V1ListAllSecretsOutput = Schema.Array(SecretResponse_Output); export const V1ListAllSnippetsInput = Schema.Struct({ project_ref: Schema.optionalKey( Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6022,11 +6302,13 @@ export const V1ListAllSnippetsOutput = Schema.Struct({ }); export const V1ListAllSsoProviderInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6081,11 +6363,13 @@ export const V1ListAllSsoProviderOutput = Schema.Struct({ }); export const V1ListAvailableRestoreVersionsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6101,11 +6385,13 @@ export const V1ListAvailableRestoreVersionsOutput = Schema.Struct({ }); export const V1ListJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6118,6 +6404,7 @@ export const V1ListJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6142,6 +6429,7 @@ export const V1ListJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -6158,6 +6446,7 @@ export const V1ListJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -6180,6 +6469,7 @@ export const V1ListJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6202,6 +6492,7 @@ export const V1ListJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -6218,6 +6509,7 @@ export const V1ListJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -6238,11 +6530,13 @@ export const V1ListJitAccessOutput = Schema.Struct({ }); export const V1ListMigrationHistoryInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6252,7 +6546,7 @@ export const V1ListMigrationHistoryOutput = Schema.Array( ); export const V1ListOrganizationMembersInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -6260,11 +6554,13 @@ export const V1ListOrganizationMembersInput = Schema.Struct({ export const V1ListOrganizationMembersOutput = Schema.Array(V1OrganizationMemberResponse_Output); export const V1ListProjectAddonsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6384,11 +6680,13 @@ export const V1ListProjectAddonsOutput = Schema.Struct({ }); export const V1ListProjectTpaIntegrationsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6397,10 +6695,14 @@ export const V1ListProjectTpaIntegrationsOutput = Schema.Array(ThirdPartyAuth_Ou export const V1MergeABranchInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6408,6 +6710,7 @@ export const V1MergeABranchInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6423,11 +6726,13 @@ export const V1MergeABranchOutput = Schema.Struct({ }); export const V1ModifyDatabaseDiskInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6482,11 +6787,13 @@ export const V1ModifyDatabaseDiskInput = Schema.Struct({ }); export const V1OauthAuthorizeProjectClaimInput = Schema.Struct({ project_ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6494,6 +6801,7 @@ export const V1OauthAuthorizeProjectClaimInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6509,16 +6817,18 @@ export const V1OauthAuthorizeProjectClaimInput = Schema.Struct({ }); export const V1PatchAMigrationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), version: Schema.String.check( - Schema.isPattern(new RegExp("^\\d+$")).annotate({ + Schema.isPattern(new RegExp("^\\d+$", "u")).annotate({ expected: "a string matching the RegExp ^\\d+$", }), ), @@ -6527,11 +6837,13 @@ export const V1PatchAMigrationInput = Schema.Struct({ }); export const V1PatchNetworkRestrictionsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6576,11 +6888,13 @@ export const V1PatchNetworkRestrictionsOutput = Schema.Struct({ }); export const V1PauseAProjectInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6588,10 +6902,14 @@ export const V1PauseAProjectInput = Schema.Struct({ export const V1PushABranchInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6599,6 +6917,7 @@ export const V1PushABranchInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6614,11 +6933,13 @@ export const V1PushABranchOutput = Schema.Struct({ }); export const V1ReadOnlyQueryInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6629,11 +6950,13 @@ export const V1ReadOnlyQueryInput = Schema.Struct({ }); export const V1RemoveAReadReplicaInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6641,11 +6964,13 @@ export const V1RemoveAReadReplicaInput = Schema.Struct({ }); export const V1RemoveProjectAddonInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6680,6 +7005,7 @@ export const V1RemoveProjectSigningKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6687,11 +7013,13 @@ export const V1RemoveProjectSigningKeyInput = Schema.Struct({ }), ), ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6701,6 +7029,7 @@ export const V1RemoveProjectSigningKeyOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6716,10 +7045,14 @@ export const V1RemoveProjectSigningKeyOutput = Schema.Struct({ export const V1ResetABranchInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6727,6 +7060,7 @@ export const V1ResetABranchInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6742,11 +7076,13 @@ export const V1ResetABranchOutput = Schema.Struct({ }); export const V1RestartAProjectInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6754,10 +7090,14 @@ export const V1RestartAProjectInput = Schema.Struct({ export const V1RestoreABranchInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6765,6 +7105,7 @@ export const V1RestoreABranchInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6778,22 +7119,26 @@ export const V1RestoreABranchOutput = Schema.Struct({ }); export const V1RestoreAProjectInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1RestorePhysicalBackupInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6811,11 +7156,13 @@ export const V1RestorePhysicalBackupInput = Schema.Struct({ }); export const V1RestorePitrBackupInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6835,6 +7182,7 @@ export const V1RevokeTokenInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6846,27 +7194,31 @@ export const V1RevokeTokenInput = Schema.Struct({ }); export const V1RollbackMigrationsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), gte: Schema.String.check( - Schema.isPattern(new RegExp("^\\d+$")).annotate({ + Schema.isPattern(new RegExp("^\\d+$", "u")).annotate({ expected: "a string matching the RegExp ^\\d+$", }), ), }); export const V1RunAQueryInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6878,11 +7230,13 @@ export const V1RunAQueryInput = Schema.Struct({ }); export const V1ScrapeProjectMetricsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6890,11 +7244,13 @@ export const V1ScrapeProjectMetricsInput = Schema.Struct({ export const V1ScrapeProjectMetricsOutput = Schema.String; export const V1SetupAReadReplicaInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6921,36 +7277,44 @@ export const V1SetupAReadReplicaInput = Schema.Struct({ }); export const V1ShutdownRealtimeInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), }); export const V1UndoInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.String.check( - Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), ), }); export const V1UpdateABranchConfigInput = Schema.Struct({ branch_id_or_ref: Schema.Union([ Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), + ) + .check( + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -6958,6 +7322,7 @@ export const V1UpdateABranchConfigInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -6997,6 +7362,7 @@ export const V1UpdateABranchConfigOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -7066,22 +7432,24 @@ export const V1UpdateABranchConfigOutput = Schema.Struct({ }); export const V1UpdateAFunctionInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), function_slug: Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", }), ), slug: Schema.optionalKey( Schema.String.check( - Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", }), ), @@ -7142,17 +7510,21 @@ export const V1UpdateAFunctionOutput = Schema.Struct({ }); export const V1UpdateAProjectInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.String.check( Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), - ).check(Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" })), + ).check( + Schema.isMaxCodePoints(256).annotate({ expected: "a string with at most 256 code points" }), + ), }); export const V1UpdateAProjectOutput = Schema.Struct({ id: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) @@ -7171,11 +7543,13 @@ export const V1UpdateAProjectOutput = Schema.Struct({ }); export const V1UpdateASsoProviderInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -7183,6 +7557,7 @@ export const V1UpdateASsoProviderInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -7260,11 +7635,13 @@ export const V1UpdateASsoProviderOutput = Schema.Struct({ }); export const V1UpdateActionRunStatusInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -7294,18 +7671,20 @@ export const V1UpdateActionRunStatusInput = Schema.Struct({ export const V1UpdateActionRunStatusOutput = Schema.Struct({ message: Schema.Literal("ok") }); export const V1UpdateAuthServiceConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), site_url: Schema.optionalKey( Schema.Union([ Schema.String.check( - Schema.isPattern(new RegExp("^[^,]+$")).annotate({ + Schema.isPattern(new RegExp("^[^,]+$", "u")).annotate({ expected: "a string matching the RegExp ^[^,]+$", }), ), @@ -7335,6 +7714,7 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -7476,7 +7856,7 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ saml_external_url: Schema.optionalKey( Schema.Union([ Schema.String.check( - Schema.isPattern(new RegExp("^[^,]+$")).annotate({ + Schema.isPattern(new RegExp("^[^,]+$", "u")).annotate({ expected: "a string matching the RegExp ^[^,]+$", }), ), @@ -7524,7 +7904,10 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ Schema.Union([ Schema.String.check( Schema.isPattern( - new RegExp("^(?:\\s*|\\s*[a-zA-Z0-9_-]+(?:\\s*,+\\s*[a-zA-Z0-9_-]+)*(?:\\s*,+)?\\s*)$"), + new RegExp( + "^(?:\\s*|\\s*[a-zA-Z0-9_-]+(?:\\s*,+\\s*[a-zA-Z0-9_-]+)*(?:\\s*,+)?\\s*)$", + "u", + ), ).annotate({ expected: "a string matching the RegExp ^(?:\\s*|\\s*[a-zA-Z0-9_-]+(?:\\s*,+\\s*[a-zA-Z0-9_-]+)*(?:\\s*,+)?\\s*)$", @@ -7793,7 +8176,7 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ Schema.Union([ Schema.String.check( Schema.isPattern( - new RegExp("^(?:[0-9]{1,15}=(?:[0-9]+,[0-9]{1,15}=|[0-9]{2,}=)*[0-9]+,?)?$"), + new RegExp("^(?:[0-9]{1,15}=(?:[0-9]+,[0-9]{1,15}=|[0-9]{2,}=)*[0-9]+,?)?$", "u"), ).annotate({ expected: "a string matching the RegExp ^(?:[0-9]{1,15}=(?:[0-9]+,[0-9]{1,15}=|[0-9]{2,}=)*[0-9]+,?)?$", @@ -8557,6 +8940,7 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -8605,11 +8989,13 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ }); export const V1UpdateBackupScheduleInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -8617,7 +9003,7 @@ export const V1UpdateBackupScheduleInput = Schema.Struct({ description: "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", }).check( Schema.isPattern( - new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$"), + new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", "u"), ).annotate({ expected: "a string matching the RegExp ^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", @@ -8629,7 +9015,7 @@ export const V1UpdateBackupScheduleOutput = Schema.Struct({ description: "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", }).check( Schema.isPattern( - new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$"), + new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", "u"), ).annotate({ expected: "a string matching the RegExp ^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", @@ -8642,32 +9028,38 @@ export const V1UpdateBackupScheduleOutput = Schema.Struct({ }); export const V1UpdateDatabasePasswordInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), password: Schema.String.check( - Schema.isMinLength(4).annotate({ expected: "a value with a length of at least 4" }), + Schema.isMinCodePoints(4).annotate({ expected: "a string with at least 4 code points" }), ), }); export const V1UpdateDatabasePasswordOutput = Schema.Struct({ message: Schema.String }); export const V1UpdateHostnameConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), custom_hostname: Schema.String.check( Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), - ).check(Schema.isMaxLength(253).annotate({ expected: "a value with a length of at most 253" })), + ).check( + Schema.isMaxCodePoints(253).annotate({ expected: "a string with at most 253 code points" }), + ), }); export const V1UpdateHostnameConfigOutput = Schema.Struct({ status: Schema.optionalKey( @@ -8718,11 +9110,13 @@ export const V1UpdateHostnameConfigOutput = Schema.Struct({ }); export const V1UpdateJitAccessInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -8732,6 +9126,7 @@ export const V1UpdateJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -8755,6 +9150,7 @@ export const V1UpdateJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -8771,6 +9167,7 @@ export const V1UpdateJitAccessInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -8792,6 +9189,7 @@ export const V1UpdateJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -8814,6 +9212,7 @@ export const V1UpdateJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + "u", ), ).annotate({ expected: @@ -8830,6 +9229,7 @@ export const V1UpdateJitAccessOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + "u", ), ).annotate({ expected: @@ -8847,11 +9247,13 @@ export const V1UpdateJitAccessOutput = Schema.Struct({ }); export const V1UpdateJitAccessConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -8877,11 +9279,13 @@ export const V1UpdateJitAccessConfigOutput = Schema.Union( ); export const V1UpdateNetworkRestrictionsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -8912,11 +9316,13 @@ export const V1UpdateNetworkRestrictionsOutput = Schema.Struct({ }); export const V1UpdatePgsodiumConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -8931,11 +9337,13 @@ export const V1UpdatePgsodiumConfigOutput = Schema.Struct({ }); export const V1UpdatePoolerConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -8980,11 +9388,13 @@ export const V1UpdatePoolerConfigOutput = Schema.Struct({ }); export const V1UpdatePostgresConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9033,7 +9443,7 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ "cron.log_statement": Schema.optionalKey(Schema.Boolean), log_autovacuum_min_duration: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9047,7 +9457,7 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ log_replication_commands: Schema.optionalKey(Schema.Boolean), log_startup_progress_interval: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9193,7 +9603,7 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ shared_buffers: Schema.optionalKey(Schema.String), statement_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9202,7 +9612,7 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ wal_keep_size: Schema.optionalKey(Schema.String), wal_sender_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9210,7 +9620,7 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ work_mem: Schema.optionalKey(Schema.String), checkpoint_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: s" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9264,7 +9674,7 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ "cron.log_statement": Schema.optionalKey(Schema.Boolean), log_autovacuum_min_duration: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9278,7 +9688,7 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ log_replication_commands: Schema.optionalKey(Schema.Boolean), log_startup_progress_interval: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9424,7 +9834,7 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ shared_buffers: Schema.optionalKey(Schema.String), statement_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9433,7 +9843,7 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ wal_keep_size: Schema.optionalKey(Schema.String), wal_sender_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9441,7 +9851,7 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ work_mem: Schema.optionalKey(Schema.String), checkpoint_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: s" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u")).annotate({ expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", }), ), @@ -9450,11 +9860,13 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ }); export const V1UpdatePostgrestServiceConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9549,11 +9961,13 @@ export const V1UpdatePostgrestServiceConfigOutput = Schema.Struct({ }); export const V1UpdateProjectApiKeyInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9561,6 +9975,7 @@ export const V1UpdateProjectApiKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -9570,11 +9985,13 @@ export const V1UpdateProjectApiKeyInput = Schema.Struct({ reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), name: Schema.optionalKey( Schema.String.check( - Schema.isMinLength(4).annotate({ expected: "a value with a length of at least 4" }), + Schema.isMinCodePoints(4).annotate({ expected: "a string with at least 4 code points" }), ) - .check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })) .check( - Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$")).annotate({ + Schema.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z_][a-z0-9_]+$", }), ), @@ -9612,11 +10029,13 @@ export const V1UpdateProjectApiKeyOutput = Schema.Struct({ }); export const V1UpdateProjectLegacyApiKeysInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9628,6 +10047,7 @@ export const V1UpdateProjectSigningKeyInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -9635,11 +10055,13 @@ export const V1UpdateProjectSigningKeyInput = Schema.Struct({ }), ), ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9650,6 +10072,7 @@ export const V1UpdateProjectSigningKeyOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -9664,11 +10087,13 @@ export const V1UpdateProjectSigningKeyOutput = Schema.Struct({ }); export const V1UpdateRealtimeConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9817,11 +10242,13 @@ export const V1UpdateRealtimeConfigInput = Schema.Struct({ }); export const V1UpdateSslEnforcementConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9833,11 +10260,13 @@ export const V1UpdateSslEnforcementConfigOutput = Schema.Struct({ }); export const V1UpdateStorageConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9933,11 +10362,13 @@ export const V1UpdateStorageConfigInput = Schema.Struct({ }); export const V1UpgradePostgresVersionInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9949,11 +10380,13 @@ export const V1UpgradePostgresVersionInput = Schema.Struct({ export const V1UpgradePostgresVersionOutput = Schema.Struct({ tracking_id: Schema.String }); export const V1UpsertAMigrationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -9966,11 +10399,13 @@ export const V1UpsertAMigrationInput = Schema.Struct({ }); export const V1VerifyDnsConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -10024,7 +10459,7 @@ export const V1VerifyDnsConfigOutput = Schema.Struct({ }); export const V2AssignOrganizationMemberRoleInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -10032,6 +10467,7 @@ export const V2AssignOrganizationMemberRoleInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -10083,11 +10519,13 @@ export const V2AssignOrganizationMemberRoleOutput = Schema.Struct({ }); export const V2CreateABranchInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -10181,6 +10619,7 @@ export const V2CreateABranchOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -10227,16 +10666,18 @@ export const V2CreateABranchOutput = Schema.Struct({ }); export const V2CreateComputeInstanceUploadInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.String.check( - Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$")).annotate({ + Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", }), ), @@ -10262,11 +10703,13 @@ export const V2CreateComputeInstanceUploadOutput = Schema.Struct({ }); export const V2CreateLogDrainInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -10473,11 +10916,13 @@ export const V2CreateLogDrainOutput = Schema.Struct({ }); export const V2CreateNotebookInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -10487,12 +10932,12 @@ export const V2CreateNotebookInput = Schema.Struct({ name: Schema.String.check( Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), ).check( - Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }), + Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" }), ), description: Schema.optionalKey( Schema.String.check( - Schema.isMaxLength(10000).annotate({ - expected: "a value with a length of at most 10000", + Schema.isMaxCodePoints(10000).annotate({ + expected: "a string with at most 10000 code points", }), ), ), @@ -10823,7 +11268,7 @@ export const V2CreateNotebookOutput = Schema.Struct({ }); export const V2CreateOrganizationInvitationsInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -10838,6 +11283,7 @@ export const V2CreateOrganizationInvitationsInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -10969,6 +11415,7 @@ export const V2CreateOrganizationInvitationsOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -10992,6 +11439,7 @@ export const V2CreateOrganizationInvitationsOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -11004,11 +11452,13 @@ export const V2CreateOrganizationInvitationsOutput = Schema.Struct({ }); export const V2CreatePrivateLinkAssociationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -11019,11 +11469,15 @@ export const V2CreatePrivateLinkAssociationInput = Schema.Struct({ description: "The AWS account ID to add to the project PrivateLink share.", }) .check( - Schema.isMinLength(12).annotate({ expected: "a value with a length of at least 12" }), + Schema.isMinCodePoints(12).annotate({ + expected: "a string with at least 12 code points", + }), ) - .check(Schema.isMaxLength(12).annotate({ expected: "a value with a length of at most 12" })) .check( - Schema.isPattern(new RegExp("^\\d{12}$")).annotate({ + Schema.isMaxCodePoints(12).annotate({ expected: "a string with at most 12 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^\\d{12}$", "u")).annotate({ expected: "a string matching the RegExp ^\\d{12}$", }), ), @@ -11031,7 +11485,9 @@ export const V2CreatePrivateLinkAssociationInput = Schema.Struct({ Schema.String.annotate({ description: "Optional human-readable name for the AWS account.", }).check( - Schema.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" }), + Schema.isMaxCodePoints(128).annotate({ + expected: "a string with at most 128 code points", + }), ), ), database_identifier: Schema.optionalKey( @@ -11052,11 +11508,15 @@ export const V2CreatePrivateLinkAssociationOutput = Schema.Struct({ description: "The AWS account ID this PrivateLink share is associated with.", }) .check( - Schema.isMinLength(12).annotate({ expected: "a value with a length of at least 12" }), + Schema.isMinCodePoints(12).annotate({ + expected: "a string with at least 12 code points", + }), + ) + .check( + Schema.isMaxCodePoints(12).annotate({ expected: "a string with at most 12 code points" }), ) - .check(Schema.isMaxLength(12).annotate({ expected: "a value with a length of at most 12" })) .check( - Schema.isPattern(new RegExp("^\\d{12}$")).annotate({ + Schema.isPattern(new RegExp("^\\d{12}$", "u")).annotate({ expected: "a string matching the RegExp ^\\d{12}$", }), ), @@ -11117,27 +11577,31 @@ export const V2CreatePrivateLinkAssociationOutput = Schema.Struct({ }); export const V2DeleteAComputeInstanceInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.String.check( - Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$")).annotate({ + Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", }), ), }); export const V2DeleteLogDrainInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -11145,6 +11609,7 @@ export const V2DeleteLogDrainInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -11154,11 +11619,13 @@ export const V2DeleteLogDrainInput = Schema.Struct({ }); export const V2DeleteNotebookInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -11166,6 +11633,7 @@ export const V2DeleteNotebookInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -11175,7 +11643,7 @@ export const V2DeleteNotebookInput = Schema.Struct({ }); export const V2DeleteOrganizationInvitationsInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -11190,6 +11658,7 @@ export const V2DeleteOrganizationInvitationsInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -11214,6 +11683,7 @@ export const V2DeleteOrganizationInvitationsOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -11226,11 +11696,13 @@ export const V2DeleteOrganizationInvitationsOutput = Schema.Struct({ }); export const V2DeletePrivateLinkAssociationInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -11238,11 +11710,13 @@ export const V2DeletePrivateLinkAssociationInput = Schema.Struct({ }); export const V2DeletePrivateLinkAssociationForDatabaseInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -11251,16 +11725,18 @@ export const V2DeletePrivateLinkAssociationForDatabaseInput = Schema.Struct({ }); export const V2DeployAComputeInstanceInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.String.check( - Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$")).annotate({ + Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", }), ), @@ -11372,16 +11848,18 @@ export const V2DeployAComputeInstanceOutput = Schema.Struct({ }); export const V2GetAComputeInstanceInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), name: Schema.String.check( - Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$")).annotate({ + Schema.isPattern(new RegExp("^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$", }), ), @@ -11466,11 +11944,13 @@ export const V2GetAComputeInstanceOutput = Schema.Struct({ }); export const V2GetNotebookInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -11478,6 +11958,7 @@ export const V2GetNotebookInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -11626,11 +12107,13 @@ export const V2GetNotebookOutput = Schema.Struct({ }); export const V2GetProjectConfigInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -11689,12 +12172,12 @@ export const V2GetProjectConfigOutput = Schema.Struct({ autovacuum_work_mem: Schema.optionalKey(Schema.String), log_autovacuum_min_duration: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate( - { - expected: - "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", - }, - ), + Schema.isPattern( + new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u"), + ).annotate({ + expected: + "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_checkpoints: Schema.optionalKey(Schema.Boolean), @@ -11706,12 +12189,12 @@ export const V2GetProjectConfigOutput = Schema.Struct({ log_replication_commands: Schema.optionalKey(Schema.Boolean), log_startup_progress_interval: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate( - { - expected: - "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", - }, - ), + Schema.isPattern( + new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u"), + ).annotate({ + expected: + "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_temp_files: Schema.optionalKey(Schema.String), @@ -11857,35 +12340,35 @@ export const V2GetProjectConfigOutput = Schema.Struct({ shared_buffers: Schema.optionalKey(Schema.String), statement_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate( - { - expected: - "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", - }, - ), + Schema.isPattern( + new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u"), + ).annotate({ + expected: + "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), track_commit_timestamp: Schema.optionalKey(Schema.Boolean), wal_keep_size: Schema.optionalKey(Schema.String), wal_sender_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate( - { - expected: - "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", - }, - ), + Schema.isPattern( + new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u"), + ).annotate({ + expected: + "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), work_mem: Schema.optionalKey(Schema.String), checkpoint_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: s" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate( - { - expected: - "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", - }, - ), + Schema.isPattern( + new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", "u"), + ).annotate({ + expected: + "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), hot_standby_feedback: Schema.optionalKey(Schema.Boolean), @@ -12276,11 +12759,13 @@ export const V2GetProjectConfigOutput = Schema.Struct({ }); export const V2ListAllComputeInstancesInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -12367,11 +12852,13 @@ export const V2ListAllComputeInstancesOutput = Schema.Struct({ }); export const V2ListLogDrainsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -12480,11 +12967,13 @@ export const V2ListLogDrainsOutput = Schema.Struct({ }); export const V2ListNotebooksInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -12579,7 +13068,7 @@ export const V2ListNotebooksOutput = Schema.Struct({ }); export const V2ListOrganizationGithubConnectionsInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -12601,13 +13090,17 @@ export const V2ListOrganizationGithubConnectionsInput = Schema.Struct({ after: Schema.optionalKey( Schema.String.annotate({ description: "Project ref" }) .check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ + expected: "a string with at least 20 code points", + }), ) .check( - Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + Schema.isMaxCodePoints(20).annotate({ + expected: "a string with at most 20 code points", + }), ) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -12615,13 +13108,17 @@ export const V2ListOrganizationGithubConnectionsInput = Schema.Struct({ before: Schema.optionalKey( Schema.String.annotate({ description: "Project ref" }) .check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ + expected: "a string with at least 20 code points", + }), ) .check( - Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + Schema.isMaxCodePoints(20).annotate({ + expected: "a string with at most 20 code points", + }), ) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -12633,13 +13130,17 @@ export const V2ListOrganizationGithubConnectionsInput = Schema.Struct({ project_ref: Schema.optionalKey( Schema.String.annotate({ description: "Project ref" }) .check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ + expected: "a string with at least 20 code points", + }), ) .check( - Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + Schema.isMaxCodePoints(20).annotate({ + expected: "a string with at most 20 code points", + }), ) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -12674,13 +13175,17 @@ export const V2ListOrganizationGithubConnectionsOutput = Schema.Struct({ id: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), ref: Schema.String.annotate({ description: "Project ref" }) .check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ + expected: "a string with at least 20 code points", + }), ) .check( - Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + Schema.isMaxCodePoints(20).annotate({ + expected: "a string with at most 20 code points", + }), ) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -12726,7 +13231,7 @@ export const V2ListOrganizationGithubConnectionsOutput = Schema.Struct({ }); export const V2ListOrganizationMembersInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -12750,6 +13255,7 @@ export const V2ListOrganizationMembersInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -12762,6 +13268,7 @@ export const V2ListOrganizationMembersInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -12779,6 +13286,7 @@ export const V2ListOrganizationMembersInput = Schema.Struct({ Schema.isPattern( new RegExp( "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "u", ), ).annotate({ expected: @@ -12797,6 +13305,7 @@ export const V2ListOrganizationMembersOutput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$", + "u", ), ).annotate({ expected: @@ -12869,7 +13378,7 @@ export const V2ListOrganizationMembersOutput = Schema.Struct({ }); export const V2ListOrganizationProjectsInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -12913,11 +13422,15 @@ export const V2ListOrganizationProjectsOutput = Schema.Struct({ type: Schema.Literal("project").annotate({ description: "Resource type." }), id: Schema.String.annotate({ description: "Project ref" }) .check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ + expected: "a string with at least 20 code points", + }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -13029,7 +13542,7 @@ export const V2ListOrganizationProjectsOutput = Schema.Struct({ }); export const V2ListOrganizationRolesInput = Schema.Struct({ slug: Schema.String.check( - Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + Schema.isPattern(new RegExp("^[\\w-]+$", "u")).annotate({ expected: "a string matching the RegExp ^[\\w-]+$", }), ), @@ -13044,11 +13557,13 @@ export const V2ListOrganizationRolesOutput = Schema.Struct({ }); export const V2ListPrivateLinkAssociationsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -13063,13 +13578,17 @@ export const V2ListPrivateLinkAssociationsOutput = Schema.Struct({ description: "The AWS account ID this PrivateLink share is associated with.", }) .check( - Schema.isMinLength(12).annotate({ expected: "a value with a length of at least 12" }), + Schema.isMinCodePoints(12).annotate({ + expected: "a string with at least 12 code points", + }), ) .check( - Schema.isMaxLength(12).annotate({ expected: "a value with a length of at most 12" }), + Schema.isMaxCodePoints(12).annotate({ + expected: "a string with at most 12 code points", + }), ) .check( - Schema.isPattern(new RegExp("^\\d{12}$")).annotate({ + Schema.isPattern(new RegExp("^\\d{12}$", "u")).annotate({ expected: "a string matching the RegExp ^\\d{12}$", }), ), @@ -13131,11 +13650,13 @@ export const V2ListPrivateLinkAssociationsOutput = Schema.Struct({ }); export const V2PreviewAProjectTransferInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -13157,11 +13678,13 @@ export const V2PreviewAProjectTransferOutput = Schema.Struct({ }); export const V2RunProjectAdvisorsInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -13318,11 +13841,13 @@ export const V2RunProjectAdvisorsOutput = Schema.Struct({ }); export const V2TransferAProjectInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -13333,11 +13858,13 @@ export const V2TransferAProjectInput = Schema.Struct({ }); export const V2UpdateLogDrainInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -13345,6 +13872,7 @@ export const V2UpdateLogDrainInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -13556,11 +14084,13 @@ export const V2UpdateLogDrainOutput = Schema.Struct({ }); export const V2UpdateNotebookInput = Schema.Struct({ ref: Schema.String.check( - Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + Schema.isMinCodePoints(20).annotate({ expected: "a string with at least 20 code points" }), ) - .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) .check( - Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + Schema.isMaxCodePoints(20).annotate({ expected: "a string with at most 20 code points" }), + ) + .check( + Schema.isPattern(new RegExp("^[a-z]+$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z]+$", }), ), @@ -13568,6 +14098,7 @@ export const V2UpdateNotebookInput = Schema.Struct({ Schema.isPattern( new RegExp( "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "u", ), ).annotate({ expected: @@ -13581,13 +14112,15 @@ export const V2UpdateNotebookInput = Schema.Struct({ Schema.String.check( Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), ).check( - Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }), + Schema.isMaxCodePoints(255).annotate({ + expected: "a string with at most 255 code points", + }), ), ), description: Schema.optionalKey( Schema.String.check( - Schema.isMaxLength(10000).annotate({ - expected: "a value with a length of at most 10000", + Schema.isMaxCodePoints(10000).annotate({ + expected: "a string with at most 10000 code points", }), ), ), From 527c71dc83ed9563818730108beb3ddf5cde1749 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 10:08:51 +0200 Subject: [PATCH 22/28] fix(stack): accept undefined optional fields in strict command payloads The excess-key check encodes through an Unknown record, which the RPC JSON codec rejects when a nested optional field is explicitly undefined. Encoding now drops undefined entries, as the plain struct codec did. --- .../stack/src/internal/reject-excess-keys.ts | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/stack/src/internal/reject-excess-keys.ts b/packages/stack/src/internal/reject-excess-keys.ts index b95caa1b2d..0dafd0afd7 100644 --- a/packages/stack/src/internal/reject-excess-keys.ts +++ b/packages/stack/src/internal/reject-excess-keys.ts @@ -1,4 +1,18 @@ -import { Schema } from "effect"; +import { Schema, SchemaGetter } from "effect"; + +const stripUndefinedValue = (value: unknown): unknown => { + if (Array.isArray(value)) return value.map(stripUndefinedValue); + if (typeof value === "object" && value !== null) return stripUndefined(Object.entries(value)); + return value; +}; + +/** Drops `undefined` values recursively so optional fields set to `undefined` survive the JSON codec. */ +const stripUndefined = (entries: ReadonlyArray) => + Object.fromEntries( + entries + .filter(([, entry]) => entry !== undefined) + .map(([key, entry]) => [key, stripUndefinedValue(entry)]), + ); /** * Fails decoding when the input carries keys the struct does not declare. Parse-option @@ -14,5 +28,8 @@ export const rejectExcessKeys = >( .map((key) => ({ path: [key], issue: "Expected no excess property" })), ), ), - Schema.decodeTo(struct), + Schema.decodeTo(struct, { + decode: SchemaGetter.passthrough(), + encode: SchemaGetter.transform((input) => stripUndefined(Object.entries(input))), + }), ); From 2056926e7568ba8f6262a3886f8ebf1cdc80b971 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 10:08:52 +0200 Subject: [PATCH 23/28] test(cli): adapt fixtures and span names to effect 4.0.2 The reset e2e fixture runs one statement per query and reads count(*) as int, since the native client rejects batches and decodes int8 as bigint. HTTP client spans are named after the bare method by default. --- .../db-bootstrap/health-check.unit.test.ts | 2 +- .../src/commands/db/reset/reset.stack.e2e.test.ts | 14 +++++++------- .../compute/logs/logs.integration.test.ts | 6 +----- .../telemetry/trace-export.integration.test.ts | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts b/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts index b05716271d..0cf840b676 100644 --- a/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts +++ b/apps/cli/src/command-internal/db-bootstrap/health-check.unit.test.ts @@ -682,7 +682,7 @@ describe("waitForHealthyServices", () => { yield* Fiber.await(fiber); const wait = spans.find((span) => span.name === "HealthCheck.waitHealthyServices"); - expect(spans.map((span) => span.name)).not.toContain("http.client HEAD"); + expect(spans.map((span) => span.name)).not.toContain("HEAD"); expect(wait?.attributes.get("retry.attempt_count")).toBe(2); }), ); diff --git a/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts b/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts index 7ab4d70a95..b06a5eda4b 100644 --- a/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts +++ b/apps/cli/src/commands/db/reset/reset.stack.e2e.test.ts @@ -190,11 +190,11 @@ describe("supabase db reset (stack e2e)", () => { const beforeSqlPort = beforeStatus.endpoints.find(({ name }) => name === "sql")?.port; if (beforeSqlPort === undefined) return yield* Effect.die("database SQL port is missing"); + yield* query(databaseUrl, "create table public.reset_story_stale (value text)"); + yield* query(databaseUrl, "insert into public.reset_story_stale values ('before-reset')"); yield* query( databaseUrl, - `create table public.reset_story_stale (value text); - insert into public.reset_story_stale values ('before-reset'); - create role reset_story_stale_role login password 'stale-password';`, + "create role reset_story_stale_role login password 'stale-password'", ); yield* query(databaseUrl, "create database reset_story_stale_database;"); @@ -227,8 +227,8 @@ describe("supabase db reset (stack e2e)", () => { const rows = yield* query( databaseUrl, `select - (select count(*) from supabase_migrations.schema_migrations where version = '20260920000000') as migration_count, - (select count(*) from public.reset_story_marker where value = 'seeded') as seed_count, + (select count(*)::int from supabase_migrations.schema_migrations where version = '20260920000000') as migration_count, + (select count(*)::int from public.reset_story_marker where value = 'seeded') as seed_count, to_regclass('public.reset_story_stale') as stale_table, to_regclass('auth.users') is not null as auth_users, exists (select 1 from pg_roles where rolname = 'reset_story_stale_role') as stale_role, @@ -236,8 +236,8 @@ describe("supabase db reset (stack e2e)", () => { ); expect(rows).toEqual([ { - migration_count: "1", - seed_count: "1", + migration_count: 1, + seed_count: 1, stale_table: null, auth_users: true, stale_role: false, diff --git a/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts b/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts index a3422d95d8..5c3491a876 100644 --- a/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts +++ b/apps/cli/src/commands/experimental/compute/logs/logs.integration.test.ts @@ -824,11 +824,7 @@ describe("compute logs", () => { Effect.withTracerEnabled(true), ); - expect(spans.map((span) => span.name)).toEqual([ - "compute.logs", - "v1GetProjectLogs", - "http.client GET", - ]); + expect(spans.map((span) => span.name)).toEqual(["compute.logs", "v1GetProjectLogs", "GET"]); expect(spans[0]?.attributes.get("poll.attempt_count")).toBe(4); }).pipe(Effect.scoped, Effect.provide(BunServices.layer)), ); diff --git a/apps/cli/src/shared/telemetry/trace-export.integration.test.ts b/apps/cli/src/shared/telemetry/trace-export.integration.test.ts index d21bbb21dd..1bea2ae639 100644 --- a/apps/cli/src/shared/telemetry/trace-export.integration.test.ts +++ b/apps/cli/src/shared/telemetry/trace-export.integration.test.ts @@ -354,7 +354,7 @@ describe("withTraceExport around a command handler", () => { expect(roots.map((span) => span.name)).toEqual(["cli.run"]); expect(spans.filter((span) => !ids.has(span.parentSpanId ?? span.spanId))).toEqual([]); - expect(spans.some((span) => span.name.startsWith("http.client"))).toBe(true); + expect(spans.some((span) => span.name === "GET")).toBe(true); expect(spans.length).toBeLessThanOrEqual(2000); expect(Math.max(...counts.values())).toBeLessThanOrEqual(200); expect(raw).not.toContain(VALID_TOKEN); From 4e63cff0406f66debeaa2985ec27479e66935660 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 10:24:31 +0200 Subject: [PATCH 24/28] test(stack): assert traced owner requests without header capture Effect 4.0.2 records no HTTP client headers on spans unless a header filter opts in, so the owner tracing test checks for request spans and that the secret appears in no span attribute. --- packages/stack/src/HostProcess.integration.test.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/stack/src/HostProcess.integration.test.ts b/packages/stack/src/HostProcess.integration.test.ts index 6b35a2c40c..817f9f1357 100644 --- a/packages/stack/src/HostProcess.integration.test.ts +++ b/packages/stack/src/HostProcess.integration.test.ts @@ -521,12 +521,9 @@ it.live("keeps the owner secret out of recorded HTTP span attributes", () => Effect.tap(bestEffortShutdown(root)), Effect.withTracer(tracer), ); + const requests = spans.filter((span) => span.attributes.has("http.request.method")); + expect(requests.length, "identity and shutdown requests were traced").toBeGreaterThan(1); const attributes = spans.flatMap((span) => Array.from(span.attributes)); - const authorization = attributes.filter( - ([key]) => key === "http.request.header.authorization", - ); - expect(authorization.length, "identity and shutdown requests were traced").toBeGreaterThan(1); - expect(authorization.every(([, value]) => value === "")).toBe(true); expect(attributes.filter(([, value]) => String(value).includes(access.secret))).toEqual([]); }), ).pipe(Effect.provide(Layer.merge(NodeServices.layer, NodeHttpClient.layerNodeHttp))), From 49cdc2c8e074b15e046e515ca5768bcf786748cd Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 11:31:24 +0200 Subject: [PATCH 25/28] fix(stack): drain the client request body before ending proxied responses Bun resets a Connection: close client when the response completes before its request body is fully read, so an upstream that answers early could truncate the proxied response. The proxy now drains the remaining request body and ends the response afterwards. --- packages/stack/src/HttpProxy.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/stack/src/HttpProxy.ts b/packages/stack/src/HttpProxy.ts index a73b4dafdf..a95abd11e8 100644 --- a/packages/stack/src/HttpProxy.ts +++ b/packages/stack/src/HttpProxy.ts @@ -332,6 +332,7 @@ const forward = Effect.fn("HttpProxy.forward")( // Error listeners remain until collection because destroy may emit errors asynchronously. const cleanup = () => { request.off("aborted", onClientGone); + request.off("end", endResponse); response.off("close", onResponseClose); response.off("finish", onFinish); @@ -355,6 +356,19 @@ const forward = Effect.fn("HttpProxy.forward")( abandon(Effect.fail(errorFor(cause, incoming !== undefined))); const onClientGone = () => abandon(Effect.fail(new HttpProxyDisconnected())); const onFinish = () => finish(Effect.void); + const endResponse = () => { + if (!settled) response.end(); + }; + // Bun resets a `Connection: close` client when the response completes before its request body + // is fully read, so the response ends only once the rest of that body has been drained. + const onUpstreamEnd = () => { + if (outgoing !== undefined) request.unpipe(outgoing); + if (request.readableEnded) endResponse(); + else { + request.once("end", endResponse); + request.resume(); + } + }; // A close after `end()` but before `finish` means the client reset with writes still queued. const onResponseClose = () => { if (!response.writableFinished) onClientGone(); @@ -384,7 +398,8 @@ const forward = Effect.fn("HttpProxy.forward")( if (header !== undefined && !hopByHop.has(name.toLowerCase())) response.setHeader(name, header); } - value.pipe(response); + value.pipe(response, { end: false }); + value.once("end", onUpstreamEnd); }, ); outgoing.on("error", onError); From 7fd581308560a8c77ccd84d7f50872cffe5af313 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 11:31:27 +0200 Subject: [PATCH 26/28] test(stack): drop the wall-clock guard from the interrupted lock holder test The 200ms timeout also covered the fsync-bound save and fired under load. A leaked lock still fails the test through the busy error once the lock retry window ends. --- packages/stack/src/namespace/Namespace.integration.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stack/src/namespace/Namespace.integration.test.ts b/packages/stack/src/namespace/Namespace.integration.test.ts index e06bf70251..69c267ab77 100644 --- a/packages/stack/src/namespace/Namespace.integration.test.ts +++ b/packages/stack/src/namespace/Namespace.integration.test.ts @@ -601,8 +601,8 @@ describe("registry lock", () => { dispatcher.flush(); expect(holder.pollUnsafe()).not.toBeUndefined(); - // No contention wait: a leaked lock would make this block for up to 5 seconds. - yield* second.withLock(second.save(initial)).pipe(Effect.timeout("200 millis")); + // A leaked lock fails here with the busy error once the retry window ends. + yield* second.withLock(second.save(initial)); expect(yield* second.read(initial.id)).toEqual(initial); }), ), From 78ef511c934b6e8d8de0d896c14fdfda722f40f8 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 15:11:59 +0200 Subject: [PATCH 27/28] fix(stack): flush early proxy responses and reject inherited payload keys The proxy flushes upstream response headers immediately, so a client still uploading its body receives an early rejection instead of waiting for the upload to finish. Strict payloads now reject undeclared keys that exist on Object.prototype, such as constructor. Also refreshes the pg driver notes in the CLI database layer and the Config constructor names in the Effect skill. --- .agents/skills/effect/references/CONFIG.md | 6 +-- .../db-connection.sql-pg.layer.ts | 9 ++-- .../stack/src/HttpProxy.integration.test.ts | 46 +++++++++++++++++++ packages/stack/src/HttpProxy.ts | 1 + .../stack/src/StackHost.integration.test.ts | 4 +- .../stack/src/internal/reject-excess-keys.ts | 2 +- 6 files changed, 57 insertions(+), 11 deletions(-) diff --git a/.agents/skills/effect/references/CONFIG.md b/.agents/skills/effect/references/CONFIG.md index c57de4eeb8..5ddc29b101 100644 --- a/.agents/skills/effect/references/CONFIG.md +++ b/.agents/skills/effect/references/CONFIG.md @@ -10,9 +10,9 @@ export const dataDirectoryConfig = Config.schema(AbsolutePath, "APP_DATA_DIR"); export const layerFromEnvironment = Layer.effect( Configuration.Service, Effect.gen(function* () { - const apiKey = yield* Config.redacted("API_KEY"); + const apiKey = yield* Config.Redacted("API_KEY"); const optionalModel = yield* Config.option(Config.String("MODEL")); - const enabled = yield* Config.boolean("FEATURE_ENABLED").pipe(Config.withDefault(false)); + const enabled = yield* Config.Boolean("FEATURE_ENABLED").pipe(Config.withDefault(false)); return Configuration.Service.of({ apiKey, optionalModel, enabled }); }), @@ -23,7 +23,7 @@ export const layerFromEnvironment = Layer.effect( - `Config` is yieldable and reads the current `ConfigProvider` reference. - The default provider is `ConfigProvider.fromEnv()`. -- Use `Config.redacted(...)` for credentials. +- Use `Config.Redacted(...)` for credentials. - Use `Config.schema(...)` or `Config.mapOrFail(...)` for refined values. - Use `Config.option(...)` for semantic absence. - Use `Config.withDefault(...)` for missing-data defaults only; malformed values still fail. diff --git a/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts b/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts index eb437b71cd..05071a657b 100644 --- a/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts +++ b/apps/cli/src/command-internal/db-connection.sql-pg.layer.ts @@ -3,9 +3,8 @@ import type { ConnectionOptions } from "node:tls"; import { Cause, Duration, Effect, Exit, FileSystem, Layer, Scope } from "effect"; import * as Reactivity from "effect/reactivity/Reactivity"; import { ConnectionError, SqlError } from "effect/sql/SqlError"; -// `pg` is `@effect/sql-pg`'s transitive driver; used directly here for COPY and -// extended-protocol batches, which `@effect/sql-pg` does not expose. Keep the direct `pg` -// version in package.json aligned with the one `@effect/sql-pg` resolves. +// `pg` drives the pool behind `makePoolSqlClient` and the raw COPY and extended-protocol batch +// connections; `@effect/sql-pg` only supplies the statement compiler. import * as Pg from "pg"; import { to as pgCopyTo } from "pg-copy-streams"; import { @@ -857,7 +856,7 @@ export const acquirePgPool = ( acquirePgPoolConnection(cfg, options).pipe(Effect.map(({ pool }) => pool)); /** - * Default `DbConnection` layer, backed by `@effect/sql-pg` (pure-JS `pg` driver, no native + * Default `DbConnection` layer, backed by a node-postgres pool (pure-JS `pg` driver, no native * addon, so it bundles under `bun build --compile`). Each `connect` builds a scoped * single-client connection that closes on scope exit. */ @@ -1057,7 +1056,7 @@ const connect = ( return session; }); -/** The active `DbConnection` layer, backed by `@effect/sql-pg`. */ +/** The active `DbConnection` layer, backed by node-postgres. */ export const dbConnectionLayer = Layer.effect( DbConnection, Effect.gen(function* () { diff --git a/packages/stack/src/HttpProxy.integration.test.ts b/packages/stack/src/HttpProxy.integration.test.ts index a9c28018a5..b72cd49e78 100644 --- a/packages/stack/src/HttpProxy.integration.test.ts +++ b/packages/stack/src/HttpProxy.integration.test.ts @@ -1008,6 +1008,52 @@ it.live("disconnects a pending upstream response quietly when its client closes" ).pipe(Effect.provide(Layer.merge(NodeServices.layer, captureErrors(logs)))); }); +it.live("sends an early upstream rejection while the client is still uploading its body", () => + Effect.scoped( + Effect.gen(function* () { + const backend = createServer((_request, response) => { + response.writeHead(413, { "content-length": "0" }); + response.end(); + }); + const address = yield* listen(backend); + const proxy = yield* makeHttpProxy({ host: "127.0.0.1", port: 0 }); + const released = yield* Deferred.make(); + yield* proxy.setRoutes([ + { + id: "upload", + prefix: "/", + target: Effect.acquireRelease(Effect.succeed(address), () => + Deferred.succeed(released, undefined), + ), + }, + ]); + const client = yield* Effect.acquireRelease( + Effect.sync(() => new Socket()), + (socket) => Effect.sync(() => socket.destroy()), + ); + const head = yield* Effect.callback((resume) => { + let received = ""; + client.on("error", (cause) => + resume(Effect.fail(new HttpProxyTestError({ message: cause.message }))), + ); + client.on("data", (chunk: Buffer) => { + received += chunk.toString(); + if (received.includes("\r\n\r\n")) resume(Effect.succeed(received)); + }); + client.connect(proxy.port, "127.0.0.1", () => + client.write( + "POST /upload HTTP/1.1\r\nHost: localhost\r\nContent-Length: 10\r\n\r\nhalf-", + ), + ); + }).pipe(Effect.timeout("5 seconds")); + expect(head).toMatch(/^HTTP\/1\.1 413 /); + expect(yield* Deferred.isDone(released)).toBe(false); + client.write("body!"); + yield* Deferred.await(released).pipe(Effect.timeout("5 seconds")); + }), + ).pipe(Effect.provide(NodeServices.layer)), +); + it.live("stays quiet when a client closes after receiving part of the response", () => { const logs: Array = []; return Effect.scoped( diff --git a/packages/stack/src/HttpProxy.ts b/packages/stack/src/HttpProxy.ts index a95abd11e8..2397b6c1c7 100644 --- a/packages/stack/src/HttpProxy.ts +++ b/packages/stack/src/HttpProxy.ts @@ -398,6 +398,7 @@ const forward = Effect.fn("HttpProxy.forward")( if (header !== undefined && !hopByHop.has(name.toLowerCase())) response.setHeader(name, header); } + response.flushHeaders(); value.pipe(response, { end: false }); value.once("end", onUpstreamEnd); }, diff --git a/packages/stack/src/StackHost.integration.test.ts b/packages/stack/src/StackHost.integration.test.ts index faa75e449d..55bd6c79fa 100644 --- a/packages/stack/src/StackHost.integration.test.ts +++ b/packages/stack/src/StackHost.integration.test.ts @@ -506,7 +506,7 @@ it.live( expect(identity.status).toBe(200); const client = yield* ownerClient(access); const permissiveClient = yield* permissiveCommandClientFor(access); - for (const override of ["args", "env", "pgProve", "stdin"] as const) { + for (const override of ["args", "env", "pgProve", "stdin", "constructor"] as const) { const rejected = yield* permissiveClient .runCommand({ attachmentId: `invalid-${override}`, @@ -518,7 +518,7 @@ it.live( if (Exit.isFailure(rejected)) expect(Cause.pretty(rejected.cause)).toContain("Expected no excess property"); } - for (const override of ["args", "env", "pgProve", "stdin"] as const) { + for (const override of ["args", "env", "pgProve", "stdin", "constructor"] as const) { const rejected = yield* permissiveClient .runCommand({ attachmentId: `invalid-command-${override}`, diff --git a/packages/stack/src/internal/reject-excess-keys.ts b/packages/stack/src/internal/reject-excess-keys.ts index 0dafd0afd7..7edab4c8d7 100644 --- a/packages/stack/src/internal/reject-excess-keys.ts +++ b/packages/stack/src/internal/reject-excess-keys.ts @@ -24,7 +24,7 @@ export const rejectExcessKeys = >( Schema.check( Schema.makeFilter((input) => Object.keys(input) - .filter((key) => !(key in struct.fields)) + .filter((key) => !Object.hasOwn(struct.fields, key)) .map((key) => ({ path: [key], issue: "Expected no excess property" })), ), ), From 6908b56842a7eb034d936bb8d63b0ca6f624c70f Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 9 Oct 2026 15:25:37 +0200 Subject: [PATCH 28/28] fix(stack): bound the request drain behind early proxy responses A client that stops uploading after an early upstream response no longer holds the proxied response open: the proxy ends it once the body drains or after two seconds, like a lingering close. --- .../stack/src/HttpProxy.integration.test.ts | 46 ++++ packages/stack/src/HttpProxy.ts | 209 +++++++++--------- 2 files changed, 154 insertions(+), 101 deletions(-) diff --git a/packages/stack/src/HttpProxy.integration.test.ts b/packages/stack/src/HttpProxy.integration.test.ts index b72cd49e78..1fd848b353 100644 --- a/packages/stack/src/HttpProxy.integration.test.ts +++ b/packages/stack/src/HttpProxy.integration.test.ts @@ -1054,6 +1054,52 @@ it.live("sends an early upstream rejection while the client is still uploading i ).pipe(Effect.provide(NodeServices.layer)), ); +it.live("completes an early chunked rejection when the client stops uploading its body", () => + Effect.scoped( + Effect.gen(function* () { + const backend = createServer((_request, response) => { + response.writeHead(413); + response.write("rejected"); + response.end(); + }); + const address = yield* listen(backend); + const proxy = yield* makeHttpProxy({ host: "127.0.0.1", port: 0 }); + const released = yield* Deferred.make(); + yield* proxy.setRoutes([ + { + id: "upload", + prefix: "/", + target: Effect.acquireRelease(Effect.succeed(address), () => + Deferred.succeed(released, undefined), + ), + }, + ]); + const client = yield* Effect.acquireRelease( + Effect.sync(() => new Socket()), + (socket) => Effect.sync(() => socket.destroy()), + ); + const received = yield* Effect.callback((resume) => { + let received = ""; + client.on("error", (cause) => + resume(Effect.fail(new HttpProxyTestError({ message: cause.message }))), + ); + client.on("data", (chunk: Buffer) => { + received += chunk.toString(); + if (received.endsWith("0\r\n\r\n")) resume(Effect.succeed(received)); + }); + client.connect(proxy.port, "127.0.0.1", () => + client.write( + "POST /upload HTTP/1.1\r\nHost: localhost\r\nContent-Length: 10\r\n\r\nhalf-", + ), + ); + }).pipe(Effect.timeout("10 seconds")); + expect(received).toMatch(/^HTTP\/1\.1 413 /); + expect(received).toContain("rejected"); + yield* Deferred.await(released).pipe(Effect.timeout("5 seconds")); + }), + ).pipe(Effect.provide(NodeServices.layer)), +); + it.live("stays quiet when a client closes after receiving part of the response", () => { const logs: Array = []; return Effect.scoped( diff --git a/packages/stack/src/HttpProxy.ts b/packages/stack/src/HttpProxy.ts index 2397b6c1c7..caeef3c2fe 100644 --- a/packages/stack/src/HttpProxy.ts +++ b/packages/stack/src/HttpProxy.ts @@ -306,6 +306,8 @@ const connectInterruptibly = Effect.fn("HttpProxy.connect")((address: BackendAdd }), ); +const earlyResponseDrain = "2 seconds"; + // Mirrors nginx `proxy_next_upstream error`: a backend that drops a connection before answering // gets one more attempt, but only when nothing sent to the client or upstream would need replaying. const isRetryable = @@ -316,108 +318,113 @@ const isRetryable = !response.destroyed && isReplayable(request); -const forward = Effect.fn("HttpProxy.forward")( - ( - request: IncomingMessage, - response: ServerResponse, - route: HttpRoute, - backend: BackendAddress, - agent: Agent | false, - sent: Sent, - ) => - Effect.callback((resume) => { - let outgoing: ReturnType | undefined; - let incoming: IncomingMessage | undefined; - let settled = false; - // Error listeners remain until collection because destroy may emit errors asynchronously. - const cleanup = () => { - request.off("aborted", onClientGone); - request.off("end", endResponse); - response.off("close", onResponseClose); - response.off("finish", onFinish); - - incoming?.off("aborted", onError); - }; - const finish = (result: Effect.Effect) => { - if (settled) return; - settled = true; - cleanup(); - resume(result); - }; - // Settling first keeps the outcome: destroying a partial upstream response emits - // `aborted` synchronously, which would otherwise resettle as a proxy failure. - const abandon = (result: Effect.Effect) => { - if (settled) return; - finish(result); - outgoing?.destroy(); - incoming?.destroy(); - }; - const onError = (cause: Error) => - abandon(Effect.fail(errorFor(cause, incoming !== undefined))); - const onClientGone = () => abandon(Effect.fail(new HttpProxyDisconnected())); - const onFinish = () => finish(Effect.void); - const endResponse = () => { - if (!settled) response.end(); - }; - // Bun resets a `Connection: close` client when the response completes before its request body - // is fully read, so the response ends only once the rest of that body has been drained. - const onUpstreamEnd = () => { - if (outgoing !== undefined) request.unpipe(outgoing); - if (request.readableEnded) endResponse(); - else { - request.once("end", endResponse); - request.resume(); +const forward = Effect.fn("HttpProxy.forward")(function* ( + request: IncomingMessage, + response: ServerResponse, + route: HttpRoute, + backend: BackendAddress, + agent: Agent | false, + sent: Sent, +) { + const draining = yield* Deferred.make(); + yield* Deferred.await(draining).pipe( + Effect.andThen(Effect.sleep(earlyResponseDrain)), + Effect.andThen(Effect.sync(() => response.end())), + Effect.forkChild, + ); + return yield* Effect.callback((resume) => { + let outgoing: ReturnType | undefined; + let incoming: IncomingMessage | undefined; + let settled = false; + // Error listeners remain until collection because destroy may emit errors asynchronously. + const cleanup = () => { + request.off("aborted", onClientGone); + request.off("end", endResponse); + response.off("close", onResponseClose); + response.off("finish", onFinish); + + incoming?.off("aborted", onError); + }; + const finish = (result: Effect.Effect) => { + if (settled) return; + settled = true; + cleanup(); + resume(result); + }; + // Settling first keeps the outcome: destroying a partial upstream response emits + // `aborted` synchronously, which would otherwise resettle as a proxy failure. + const abandon = (result: Effect.Effect) => { + if (settled) return; + finish(result); + outgoing?.destroy(); + incoming?.destroy(); + }; + const onError = (cause: Error) => abandon(Effect.fail(errorFor(cause, incoming !== undefined))); + const onClientGone = () => abandon(Effect.fail(new HttpProxyDisconnected())); + const onFinish = () => finish(Effect.void); + const endResponse = () => { + if (!settled) response.end(); + }; + // Bun resets a `Connection: close` client when the response completes before its request body + // is fully read, so the response waits, like nginx's lingering close, for a bounded drain. + const onUpstreamEnd = () => { + if (outgoing !== undefined) request.unpipe(outgoing); + if (request.readableEnded) endResponse(); + else { + request.once("end", endResponse); + Deferred.doneUnsafe(draining, Effect.void); + request.resume(); + } + }; + // A close after `end()` but before `finish` means the client reset with writes still queued. + const onResponseClose = () => { + if (!response.writableFinished) onClientGone(); + }; + outgoing = upstreamRequest( + { + host: "path" in backend ? undefined : backend.host, + port: "path" in backend ? undefined : backend.port, + socketPath: "path" in backend ? backend.path : undefined, + agent, + method: request.method, + path: pathFor(request, route), + // Bun ends a streamed upstream response early when the request says Connection: close. + headers: { ...upstreamHeadersFor(request.headers, route), connection: "keep-alive" }, + }, + (value) => { + incoming = value; + value.once("aborted", onError); + value.on("error", onError); + value.on("data", (chunk: Buffer) => { + sent.bytes += chunk.length; + }); + response.once("finish", onFinish); + setCors(response, request); + response.statusCode = value.statusCode ?? 502; + for (const [name, header] of Object.entries(value.headers)) { + if (header !== undefined && !hopByHop.has(name.toLowerCase())) + response.setHeader(name, header); } - }; - // A close after `end()` but before `finish` means the client reset with writes still queued. - const onResponseClose = () => { - if (!response.writableFinished) onClientGone(); - }; - outgoing = upstreamRequest( - { - host: "path" in backend ? undefined : backend.host, - port: "path" in backend ? undefined : backend.port, - socketPath: "path" in backend ? backend.path : undefined, - agent, - method: request.method, - path: pathFor(request, route), - // Bun ends a streamed upstream response early when the request says Connection: close. - headers: { ...upstreamHeadersFor(request.headers, route), connection: "keep-alive" }, - }, - (value) => { - incoming = value; - value.once("aborted", onError); - value.on("error", onError); - value.on("data", (chunk: Buffer) => { - sent.bytes += chunk.length; - }); - response.once("finish", onFinish); - setCors(response, request); - response.statusCode = value.statusCode ?? 502; - for (const [name, header] of Object.entries(value.headers)) { - if (header !== undefined && !hopByHop.has(name.toLowerCase())) - response.setHeader(name, header); - } - response.flushHeaders(); - value.pipe(response, { end: false }); - value.once("end", onUpstreamEnd); - }, - ); - outgoing.on("error", onError); - request.once("aborted", onClientGone); - response.once("close", onResponseClose); - // A retried bodyless request was already drained by the first attempt and emits no - // further `end`, so pipe would never finish the upstream request. - if (request.readableEnded) outgoing.end(); - else request.pipe(outgoing); - return Effect.sync(() => { - settled = true; - cleanup(); - outgoing?.destroy(); - incoming?.destroy(); - }); - }), -); + response.flushHeaders(); + value.pipe(response, { end: false }); + value.once("end", onUpstreamEnd); + }, + ); + outgoing.on("error", onError); + request.once("aborted", onClientGone); + response.once("close", onResponseClose); + // A retried bodyless request was already drained by the first attempt and emits no + // further `end`, so pipe would never finish the upstream request. + if (request.readableEnded) outgoing.end(); + else request.pipe(outgoing); + return Effect.sync(() => { + settled = true; + cleanup(); + outgoing?.destroy(); + incoming?.destroy(); + }); + }); +}); const proxyRequest = Effect.fn("HttpProxy.proxyRequest")( (