@capgo/cli 8.86.1 → 8.87.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +980 -975
- package/dist/notify-app-ready-worker.js +37 -37
- package/dist/onboarding-worker.js +143 -143
- package/dist/package.json +2 -2
- package/dist/src/app/builder-checklist.d.ts +26 -0
- package/dist/src/app/todo.d.ts +16 -0
- package/dist/src/build/onboarding/command.d.ts +2 -0
- package/dist/src/build/onboarding/ui/app-selection-gate.d.ts +1 -1
- package/dist/src/build/onboarding/ui/shell.d.ts +1 -0
- package/dist/src/init/builder-setup.d.ts +60 -0
- package/dist/src/init/command.d.ts +1 -1
- package/dist/src/sdk.js +191 -191
- package/dist/src/shared/cli-user-error.d.ts +1 -1
- package/dist/updater-installed-worker.js +37 -37
- package/package.json +2 -2
- package/skills/native-builds/SKILL.md +1 -0
- package/skills/usage/SKILL.md +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{createRequire as uC}from"node:module";var AC=Object.create;var{getPrototypeOf:RC,defineProperty:E2,getOwnPropertyNames:XH,getOwnPropertyDescriptor:SC}=Object,QH=Object.prototype.hasOwnProperty;function YH(D){return this[D]}var TC,bC,h$=(D,$,U)=>{var I=D!=null&&typeof D==="object";if(I){var F=$?TC??=new WeakMap:bC??=new WeakMap,J=F.get(D);if(J)return J}U=D!=null?AC(RC(D)):{};let X=$||!D||!D.__esModule?E2(U,"default",{value:D,enumerable:!0}):U;for(let Q of XH(D))if(!QH.call(X,Q))E2(X,Q,{get:YH.bind(D,Q),enumerable:!0});if(I)F.set(D,X);return X},x0=(D)=>{var $=(JH??=new WeakMap).get(D),U;if($)return $;if($=E2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var I of XH(D))if(!QH.call($,I))E2($,I,{get:YH.bind(D,I),enumerable:!(U=SC(D,I))||U.enumerable})}return JH.set(D,$),$},JH,C=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var PC=(D)=>D;function CC(D,$){this[D]=PC.bind(null,$)}var X$=(D,$)=>{for(var U in $)E2(D,U,{get:$[U],enumerable:!0,configurable:!0,set:CC.bind($,U)})};var T=(D,$)=>()=>(D&&($=D(D=0)),$);var o=uC(import.meta.url);var t$;var A1=T(()=>{t$={name:"@capgo/cli",type:"module",version:"8.86.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:settings-parity && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var ZD;var Z6=T(()=>{ZD=class ZD extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as _C}from"node:os";import{version as xC}from"node:process";function KH(D){BH=D}function fC(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function WH(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function yC(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function HF(D,$){if($===void 0||$===null){if(qF.has(D.toLowerCase()))throw new ZD(WH(D));throw new ZD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(qF.has(D.toLowerCase()))throw new ZD(WH(D));throw new ZD(`HTTP header "${D}" is missing or invalid.`)}if(!fC($)){if(qF.has(D.toLowerCase()))throw new ZD(yC(D));throw new ZD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function J0(D){let $={capgo_api:gC,"x-cli-version":t$.version,"x-cli-command":BH,"x-cli-node":xC,"x-cli-os":_C()};if(D)for(let[U,I]of Object.entries(D))$[U]=HF(U,I);return $}var gC="2025-10-01",BH="",qF;var d3=T(()=>{A1();Z6();qF=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as V$}from"fs";var v2=(D=".",$="unknown")=>{let U=`${D}/bun.lockb`,I=`${D}/bun.lock`,F=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(V$(U)||V$(I))return"bun";if(V$(F)||V$(J))return"pnpm";if(V$(X))return"yarn";if(V$(Q)||V$(Y))return"npm";return $},c3=(D=v2(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},GH=(D=".",$="npx")=>{let U=`${D}/bun.lockb`,I=`${D}/bun.lock`,F=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(V$(U)||V$(I))return"bunx";if(V$(F)||V$(J))return"pnpm exec";if(V$(X))return"yarn dlx";if(V$(Q)||V$(Y))return"npx";return $};var qH=()=>{};var HH,NH=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},zH=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var LH=T(()=>{HH=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let U=0;D.lastIndex=0;while(D.test($))U+=1;return $.length-U}})()});var mC,hC,wH,nC,ZH,iC,lC,dC,MH=(D,$={},U={})=>{let I=$.limit??1/0,F=$.ellipsis??"",J=$?.ellipsisWidth??(F?MH(F,dC,U).width:0),X=0,Q=U.controlWidth??0,Y=U.tabWidth??8,W=U.emojiWidth??2,B=2,K=U.regularWidth??1,q=U.wideWidth??2,H=[[iC,K],[mC,0],[hC,Q],[nC,Y],[ZH,W],[wH,q]],G=0,z=0,N=D.length,M=0,Z=!1,L=N,v=Math.max(0,I-J),A=0,V=0,b=0,y=0;D:while(!0){if(V>A||z>=N&&z>G){let _=D.slice(A,V)||D.slice(G,z);M=0;for(let n of _.replaceAll(lC,"")){let m=n.codePointAt(0)||0;if(NH(m))y=2;else if(zH(m))y=q;else y=K;if(b+y>v)L=Math.min(L,Math.max(A,G)+M);if(b+y>I){Z=!0;break D}M+=n.length,b+=y}A=V=0}if(z>=N)break D;for(let _=0,n=H.length;_<n;_++){let[m,UD]=H[_];if(m.lastIndex=z,m.test(D)){if(M=m===wH?HH(D.slice(z,m.lastIndex)):m===ZH?1:m.lastIndex-z,y=M*UD,b+y>v)L=Math.min(L,z+Math.floor((v-b)/UD));if(b+y>I){Z=!0;break D}b+=y,A=G,V=z,z=G=m.lastIndex;continue D}}z+=1}return{width:Z?v:b,index:Z?L:N,truncated:Z,ellipsed:Z&&I>=J}},OH;var EH=T(()=>{LH();mC=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,hC=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wH=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,nC=/\t{1,1000}/y,ZH=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,iC=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,lC=/\p{M}+/gu,dC={limit:1/0,ellipsis:""},OH=MH});var cC,pC=(D,$={})=>{return OH(D,cC,$).width},X0;var NF=T(()=>{EH();cC={limit:1/0,ellipsis:"",ellipsisWidth:0},X0=pC});function g0(D,$,U){return String(D).normalize().split(sC).map((I)=>aC(I,$,U)).join(`
|
|
1
|
+
import{createRequire as uC}from"node:module";var AC=Object.create;var{getPrototypeOf:RC,defineProperty:E2,getOwnPropertyNames:XH,getOwnPropertyDescriptor:SC}=Object,QH=Object.prototype.hasOwnProperty;function YH(D){return this[D]}var TC,bC,h$=(D,$,U)=>{var I=D!=null&&typeof D==="object";if(I){var F=$?TC??=new WeakMap:bC??=new WeakMap,J=F.get(D);if(J)return J}U=D!=null?AC(RC(D)):{};let X=$||!D||!D.__esModule?E2(U,"default",{value:D,enumerable:!0}):U;for(let Q of XH(D))if(!QH.call(X,Q))E2(X,Q,{get:YH.bind(D,Q),enumerable:!0});if(I)F.set(D,X);return X},x0=(D)=>{var $=(JH??=new WeakMap).get(D),U;if($)return $;if($=E2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var I of XH(D))if(!QH.call($,I))E2($,I,{get:YH.bind(D,I),enumerable:!(U=SC(D,I))||U.enumerable})}return JH.set(D,$),$},JH,C=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var PC=(D)=>D;function CC(D,$){this[D]=PC.bind(null,$)}var X$=(D,$)=>{for(var U in $)E2(D,U,{get:$[U],enumerable:!0,configurable:!0,set:CC.bind($,U)})};var T=(D,$)=>()=>(D&&($=D(D=0)),$);var B4D=(D)=>Promise.all(D),o=uC(import.meta.url);var t$;var A1=T(()=>{t$={name:"@capgo/cli",type:"module",version:"8.87.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:settings-parity && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var ZD;var Z6=T(()=>{ZD=class ZD extends Error{context;constructor(D,$,U){super(D,U!==void 0?{cause:U}:void 0);this.name="CliUserError",this.context=$}}});import{platform as _C}from"node:os";import{version as xC}from"node:process";function KH(D){BH=D}function fC(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function WH(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function yC(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function HF(D,$){if($===void 0||$===null){if(qF.has(D.toLowerCase()))throw new ZD(WH(D));throw new ZD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(qF.has(D.toLowerCase()))throw new ZD(WH(D));throw new ZD(`HTTP header "${D}" is missing or invalid.`)}if(!fC($)){if(qF.has(D.toLowerCase()))throw new ZD(yC(D));throw new ZD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function J0(D){let $={capgo_api:gC,"x-cli-version":t$.version,"x-cli-command":BH,"x-cli-node":xC,"x-cli-os":_C()};if(D)for(let[U,I]of Object.entries(D))$[U]=HF(U,I);return $}var gC="2025-10-01",BH="",qF;var d3=T(()=>{A1();Z6();qF=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as V$}from"fs";var v2=(D=".",$="unknown")=>{let U=`${D}/bun.lockb`,I=`${D}/bun.lock`,F=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(V$(U)||V$(I))return"bun";if(V$(F)||V$(J))return"pnpm";if(V$(X))return"yarn";if(V$(Q)||V$(Y))return"npm";return $},c3=(D=v2(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},GH=(D=".",$="npx")=>{let U=`${D}/bun.lockb`,I=`${D}/bun.lock`,F=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(V$(U)||V$(I))return"bunx";if(V$(F)||V$(J))return"pnpm exec";if(V$(X))return"yarn dlx";if(V$(Q)||V$(Y))return"npx";return $};var qH=()=>{};var HH,NH=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},zH=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var LH=T(()=>{HH=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let U=0;D.lastIndex=0;while(D.test($))U+=1;return $.length-U}})()});var mC,hC,wH,nC,ZH,iC,lC,dC,MH=(D,$={},U={})=>{let I=$.limit??1/0,F=$.ellipsis??"",J=$?.ellipsisWidth??(F?MH(F,dC,U).width:0),X=0,Q=U.controlWidth??0,Y=U.tabWidth??8,W=U.emojiWidth??2,B=2,K=U.regularWidth??1,q=U.wideWidth??2,H=[[iC,K],[mC,0],[hC,Q],[nC,Y],[ZH,W],[wH,q]],G=0,z=0,N=D.length,M=0,Z=!1,L=N,v=Math.max(0,I-J),A=0,V=0,b=0,y=0;D:while(!0){if(V>A||z>=N&&z>G){let _=D.slice(A,V)||D.slice(G,z);M=0;for(let n of _.replaceAll(lC,"")){let m=n.codePointAt(0)||0;if(NH(m))y=2;else if(zH(m))y=q;else y=K;if(b+y>v)L=Math.min(L,Math.max(A,G)+M);if(b+y>I){Z=!0;break D}M+=n.length,b+=y}A=V=0}if(z>=N)break D;for(let _=0,n=H.length;_<n;_++){let[m,UD]=H[_];if(m.lastIndex=z,m.test(D)){if(M=m===wH?HH(D.slice(z,m.lastIndex)):m===ZH?1:m.lastIndex-z,y=M*UD,b+y>v)L=Math.min(L,z+Math.floor((v-b)/UD));if(b+y>I){Z=!0;break D}b+=y,A=G,V=z,z=G=m.lastIndex;continue D}}z+=1}return{width:Z?v:b,index:Z?L:N,truncated:Z,ellipsed:Z&&I>=J}},OH;var EH=T(()=>{LH();mC=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,hC=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wH=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,nC=/\t{1,1000}/y,ZH=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,iC=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,lC=/\p{M}+/gu,dC={limit:1/0,ellipsis:""},OH=MH});var cC,pC=(D,$={})=>{return OH(D,cC,$).width},X0;var NF=T(()=>{EH();cC={limit:1/0,ellipsis:"",ellipsisWidth:0},X0=pC});function g0(D,$,U){return String(D).normalize().split(sC).map((I)=>aC(I,$,U)).join(`
|
|
2
2
|
`)}var p3="\x1B",RH="",rC=39,LF="\x07",SH="[",oC="]",TH="m",wF,vH,VH=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},jH=(D)=>`${p3}${SH}${D}${TH}`,AH=(D)=>`${p3}${wF}${D}${LF}`,zF=(D,$,U)=>{let I=$[Symbol.iterator](),F=!1,J=!1,X=D.at(-1),Q=X===void 0?0:X0(X),Y=I.next(),W=I.next(),B=0;while(!Y.done){let K=Y.value,q=X0(K);if(Q+q<=U)D[D.length-1]+=K;else D.push(K),Q=0;if(K===p3||K===RH)F=!0,J=$.startsWith(wF,B+1);if(F){if(J){if(K===LF)F=!1,J=!1}else if(K===TH)F=!1}else if(Q+=q,Q===U&&!W.done)D.push(""),Q=0;Y=W,W=I.next(),B+=K.length}if(X=D.at(-1),!Q&&X!==void 0&&X.length&&D.length>1)D[D.length-2]+=D.pop()},tC=(D)=>{let $=D.split(" "),U=$.length;while(U){if(X0($[U-1]))break;U--}if(U===$.length)return D;return $.slice(0,U).join(" ")+$.slice(U).join("")},aC=(D,$,U={})=>{if(U.trim!==!1&&D.trim()==="")return"";let I="",F,J,X=D.split(" "),Q=[""],Y=0;for(let K=0;K<X.length;K++){let q=X[K];if(U.trim!==!1){let G=Q.at(-1)??"",z=G.trimStart();if(G.length!==z.length)Q[Q.length-1]=z,Y=X0(z)}if(K!==0){if(Y>=$&&(U.wordWrap===!1||U.trim===!1))Q.push(""),Y=0;if(Y||U.trim===!1)Q[Q.length-1]+=" ",Y++}let H=X0(q);if(U.hard&&H>$){let G=$-Y,z=1+Math.floor((H-G-1)/$);if(Math.floor((H-1)/$)<z)Q.push("");zF(Q,q,$),Y=X0(Q.at(-1)??"");continue}if(Y+H>$&&Y&&H){if(U.wordWrap===!1&&Y<$){zF(Q,q,$),Y=X0(Q.at(-1)??"");continue}Q.push(""),Y=0}if(Y+H>$&&U.wordWrap===!1){zF(Q,q,$),Y=X0(Q.at(-1)??"");continue}Q[Q.length-1]+=q,Y+=H}if(U.trim!==!1)Q=Q.map((K)=>tC(K));let W=Q.join(`
|
|
3
3
|
`),B=!1;for(let K=0;K<W.length;K++){let q=W[K];if(I+=q,!B){if(B=q>="\uD800"&&q<="\uDBFF",B)continue}else B=!1;if(q===p3||q===RH){vH.lastIndex=K+1;let G=vH.exec(W)?.groups;if(G?.code!==void 0){let z=Number.parseFloat(G.code);F=z===rC?void 0:z}else if(G?.uri!==void 0)J=G.uri.length===0?void 0:G.uri}if(W[K+1]===`
|
|
4
4
|
`){if(J)I+=AH("");let H=F?VH(F):void 0;if(F&&H)I+=jH(H)}else if(q===`
|
|
5
|
-
`){if(F&&VH(F))I+=jH(F);if(J)I+=AH(J)}}return I},sC;var ZF=T(()=>{NF();wF=`${oC}8;;`,vH=new RegExp(`(?:\\${SH}(?<code>\\d+)m|\\${wF}(?<uri>.*)${LF})`,"y"),sC=/\r?\n/});var OF=C((
|
|
5
|
+
`){if(F&&VH(F))I+=jH(F);if(J)I+=AH(J)}}return I},sC;var ZF=T(()=>{NF();wF=`${oC}8;;`,vH=new RegExp(`(?:\\${SH}(?<code>\\d+)m|\\${wF}(?<uri>.*)${LF})`,"y"),sC=/\r?\n/});var OF=C((T4D,bH)=>{var MF={to(D,$){if(!$)return`\x1B[${D+1}G`;return`\x1B[${$+1};${D+1}H`},move(D,$){let U="";if(D<0)U+=`\x1B[${-D}D`;else if(D>0)U+=`\x1B[${D}C`;if($<0)U+=`\x1B[${-$}A`;else if($>0)U+=`\x1B[${$}B`;return U},up:(D=1)=>`\x1B[${D}A`,down:(D=1)=>`\x1B[${D}B`,forward:(D=1)=>`\x1B[${D}C`,backward:(D=1)=>`\x1B[${D}D`,nextLine:(D=1)=>"\x1B[E".repeat(D),prevLine:(D=1)=>"\x1B[F".repeat(D),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},eC={up:(D=1)=>"\x1B[S".repeat(D),down:(D=1)=>"\x1B[T".repeat(D)},Du={screen:"\x1B[2J",up:(D=1)=>"\x1B[1J".repeat(D),down:(D=1)=>"\x1B[J".repeat(D),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(D){let $="";for(let U=0;U<D;U++)$+=this.line+(U<D-1?MF.up():"");if(D)$+=MF.left;return $}};bH.exports={cursor:MF,scroll:eC,erase:Du,beep:"\x07"}});import{styleText as S1}from"node:util";import{stdout as jF,stdin as kH}from"node:process";import*as f0 from"node:readline";import $u from"node:readline";import{ReadStream as PH}from"node:tty";function R1(D,$,U){if(!U.some((X)=>!X.disabled))return D;let I=D+$,F=Math.max(U.length-1,0),J=I<0?F:I>F?0:I;return U[J]?.disabled?R1(J,$<0?-1:1,U):J}function r3(D,$,U,I){let F=I.split(`
|
|
6
6
|
`),J=0,X=D;for(let Y of F){if(X<=Y.length)break;X-=Y.length+1,J++}for(J=Math.max(0,Math.min(F.length-1,J+U)),X=Math.min(X,F[J].length)+$;X<0&&J>0;)J--,X+=F[J].length+1;for(;X>F[J].length&&J<F.length-1;)X-=F[J].length+1,J++;X=Math.max(0,Math.min(F[J].length,X));let Q=0;for(let Y=0;Y<J;Y++)Q+=F[Y].length+1;return Q+X}function AF(D,$){if(typeof D=="string")return cD.aliases.get(D)===$;for(let U of D)if(U!==void 0&&AF(U,$))return!0;return!1}function Iu(D,$){if(D===$)return;let U=D.split(`
|
|
7
7
|
`),I=$.split(`
|
|
8
8
|
`),F=Math.max(U.length,I.length),J=[];for(let X=0;X<F;X++)U[X]!==I[X]&&J.push(X);return{lines:J,numLinesBefore:U.length,numLinesAfter:I.length,numLines:F}}function M6(D){return D===vF}function o3(D,$){let U=D;U.isTTY&&U.setRawMode($)}function _H({input:D=kH,output:$=jF,overwrite:U=!0,hideCursor:I=!0}={}){let F=f0.createInterface({input:D,output:$,prompt:"",tabSize:1});f0.emitKeypressEvents(D,F),D instanceof PH&&D.isTTY&&D.setRawMode(!0);let J=(X,{name:Q,sequence:Y})=>{let W=String(X);if(AF([W,Q,Y],"cancel")){I&&$.write(Q$.cursor.show),process.exit(0);return}if(!U)return;f0.moveCursor($,Q==="return"?0:-1,Q==="return"?-1:0,()=>{f0.clearLine($,1,()=>{D.once("keypress",J)})})};return I&&$.write(Q$.cursor.hide),D.once("keypress",J),()=>{D.off("keypress",J),I&&$.write(Q$.cursor.show),D instanceof PH&&D.isTTY&&!Ju&&D.setRawMode(!1),F.terminal=!1,F.close()}}function V2(D,$,U,I=U,F=U,J){let X=a3(D??jF);return g0($,X-U.length,{hard:!0,trim:!1}).split(`
|
|
@@ -17,7 +17,7 @@ import{createRequire as uC}from"node:module";var AC=Object.create;var{getPrototy
|
|
|
17
17
|
${I}`:`${$}${S1("inverse",U)}${I}`}get cursor(){return this._cursor}#D(D){if(this.userInput.length===0){this._setUserInput(D);return}this._setUserInput(this.userInput.slice(0,this.cursor)+D+this.userInput.slice(this.cursor))}#J(D){let $=this.value??"";switch(D){case"up":this._cursor=r3(this._cursor,0,-1,$);return;case"down":this._cursor=r3(this._cursor,0,1,$);return;case"left":this._cursor=r3(this._cursor,-1,0,$);return;case"right":this._cursor=r3(this._cursor,1,0,$);return}}_shouldSubmit(D,$){if(this.#I)return this.focused==="submit"?!0:(this.#D(`
|
|
18
18
|
`),this._cursor++,!1);let U=this.#$;return this.#$=!0,U&&this.cursor===this.userInput.length?(this.userInput[this.cursor-1]===`
|
|
19
19
|
`&&(this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--),!0):(this.#D(`
|
|
20
|
-
`),this._cursor++,!1)}constructor(D){let $=D.initialUserInput??D.initialValue;super({...D,initialUserInput:$},!1),$!==void 0&&(this._cursor=$.length),this.#I=D.showSubmit??!1,this.on("key",(U,I)=>{if(I?.name&&Hu.has(I.name)){this.#$=!1,this.#J(I.name);return}if(U==="\t"&&this.#I){this.focused=this.focused==="editor"?"submit":"editor";return}if(I?.name!=="return"){if(this.#$=!1,I?.name==="backspace"&&this.cursor>0){this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--;return}if(I?.name==="delete"&&this.cursor<this.userInput.length){this._setUserInput(this.userInput.slice(0,this.cursor)+this.userInput.slice(this.cursor+1));return}U&&(this.#I&&this.focused==="submit"&&(this.focused="editor"),this.#D(U??""),this._cursor++)}}),this.on("userInput",(U)=>{this._setValue(U)}),this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.value===void 0&&(this.value="")})}};mH=class extends M0{_mask="•";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let $=this.userInput;if(this.cursor>=$.length)return`${this.masked}${S1(["inverse","hidden"],"_")}`;let U=this.masked,I=U.slice(0,this.cursor),F=U.slice(this.cursor,this.cursor+1),J=U.slice(this.cursor+1);return`${I}${S1("inverse",F)}${J}`}clear(){this._clearUserInput()}constructor({mask:$,...U}){super(U),this._mask=$??"•",this.on("userInput",(I)=>{this._setValue(I)}),this.on("finalize",()=>{this.value===void 0&&(this.value="")})}},hH=class extends M0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let $=this._selectedValue;this.value=$===void 0?void 0:$.value}constructor($){super($,!1),this.options=$.options;let U=this.options.findIndex(({value:F})=>F===$.initialValue),I=U===-1?0:U;this.cursor=this.options[I]?.disabled?R1(I,1,this.options):I,this.changeValue(),this.on("cursor",(F)=>{switch(F){case"left":case"up":this.cursor=R1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=R1(this.cursor,1,this.options);break}this.changeValue()})}};TF=class TF extends M0{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let D=this.userInput;if(this.cursor>=D.length)return`${this.userInput}█`;let $=D.slice(0,this.cursor),U=D.slice(this.cursor,this.cursor+1),I=D.slice(this.cursor+1);return`${$}${S1("inverse",U)}${I}`}get cursor(){return this._cursor}constructor(D){super({...D,initialUserInput:D.initialUserInput??D.initialValue}),this.on("userInput",($)=>{this._setValue($)}),this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.value===void 0&&(this.value="")})}}});import{styleText as d,stripVTControlCharacters as
|
|
20
|
+
`),this._cursor++,!1)}constructor(D){let $=D.initialUserInput??D.initialValue;super({...D,initialUserInput:$},!1),$!==void 0&&(this._cursor=$.length),this.#I=D.showSubmit??!1,this.on("key",(U,I)=>{if(I?.name&&Hu.has(I.name)){this.#$=!1,this.#J(I.name);return}if(U==="\t"&&this.#I){this.focused=this.focused==="editor"?"submit":"editor";return}if(I?.name!=="return"){if(this.#$=!1,I?.name==="backspace"&&this.cursor>0){this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--;return}if(I?.name==="delete"&&this.cursor<this.userInput.length){this._setUserInput(this.userInput.slice(0,this.cursor)+this.userInput.slice(this.cursor+1));return}U&&(this.#I&&this.focused==="submit"&&(this.focused="editor"),this.#D(U??""),this._cursor++)}}),this.on("userInput",(U)=>{this._setValue(U)}),this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.value===void 0&&(this.value="")})}};mH=class extends M0{_mask="•";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let $=this.userInput;if(this.cursor>=$.length)return`${this.masked}${S1(["inverse","hidden"],"_")}`;let U=this.masked,I=U.slice(0,this.cursor),F=U.slice(this.cursor,this.cursor+1),J=U.slice(this.cursor+1);return`${I}${S1("inverse",F)}${J}`}clear(){this._clearUserInput()}constructor({mask:$,...U}){super(U),this._mask=$??"•",this.on("userInput",(I)=>{this._setValue(I)}),this.on("finalize",()=>{this.value===void 0&&(this.value="")})}},hH=class extends M0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let $=this._selectedValue;this.value=$===void 0?void 0:$.value}constructor($){super($,!1),this.options=$.options;let U=this.options.findIndex(({value:F})=>F===$.initialValue),I=U===-1?0:U;this.cursor=this.options[I]?.disabled?R1(I,1,this.options):I,this.changeValue(),this.on("cursor",(F)=>{switch(F){case"left":case"up":this.cursor=R1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=R1(this.cursor,1,this.options);break}this.changeValue()})}};TF=class TF extends M0{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let D=this.userInput;if(this.cursor>=D.length)return`${this.userInput}█`;let $=D.slice(0,this.cursor),U=D.slice(this.cursor,this.cursor+1),I=D.slice(this.cursor+1);return`${$}${S1("inverse",U)}${I}`}get cursor(){return this._cursor}constructor(D){super({...D,initialUserInput:D.initialUserInput??D.initialValue}),this.on("userInput",($)=>{this._setValue($)}),this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.value===void 0&&(this.value="")})}}});import{styleText as d,stripVTControlCharacters as h4D}from"node:util";import a$ from"node:process";function Nu(){if(a$.platform!=="win32")return a$.env.TERM!=="linux";return Boolean(a$.env.CI)||Boolean(a$.env.WT_SESSION)||Boolean(a$.env.TERMINUS_SUBLIME)||a$.env.ConEmuTask==="{cmd::Cmder}"||a$.env.TERM_PROGRAM==="Terminus-Sublime"||a$.env.TERM_PROGRAM==="vscode"||a$.env.TERM==="xterm-256color"||a$.env.TERM==="alacritty"||a$.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function ju(D,$){let U=[`${$?`${d("cyan",wD)} `:""}${D.join(" • ")}`];return $&&U.push(d("cyan",O0)),U}var j2,PF,zu=()=>process.env.CI==="true",RD=(D,$)=>PF?D:$,Lu,iH,lH,uF,wu,wD,O0,d4D,c4D,CF,e3,p4D,r4D,o4D,Zu,t4D,a4D,s4D,e4D,D2D,$2D,Mu,Ou,Eu,vu,D9=(D)=>{switch(D){case"initial":case"active":return d("cyan",Lu);case"cancel":return d("red",iH);case"error":return d("yellow",lH);case"submit":return d("green",uF)}},Vu=(D)=>{switch(D){case"initial":case"active":return d("cyan",wD);case"cancel":return d("red",wD);case"error":return d("yellow",wD);case"submit":return d("green",wD)}},nH=(D,$,U,I,F,J=!1)=>{let X=$,Q=0;if(J)for(let Y=I-1;Y>=U;Y--){let W=D[Y];if(W&&(X-=W.length),Q++,X<=F)break}else for(let Y=U;Y<I;Y++){let W=D[Y];if(W&&(X-=W.length),Q++,X<=F)break}return{lineCount:X,removals:Q}},Au=({cursor:D,options:$,style:U,output:I=process.stdout,maxItems:F=Number.POSITIVE_INFINITY,columnPadding:J=0,rowPadding:X=4})=>{let Q=a3(I)-J,Y=RF(I),W=d("dim","..."),B=Math.max(Y-X,0),K=Math.max(Math.min(F,B),5),q=0;D>=K-3&&(q=Math.max(Math.min(D-K+3,$.length-K),0));let H=K<$.length&&q>0,G=K<$.length&&q+K<$.length,z=Math.min(q+K,$.length),N=[],M=0;H&&M++,G&&M++;let Z=q+(H?1:0),L=z-(G?1:0);for(let A=Z;A<L;A++){let V=$[A],b=V?U(V,A===D):"",y=g0(b,Q,{hard:!0,trim:!1}).split(`
|
|
21
21
|
`);N.push(y),M+=y.length}if(M>B){let A=0,V=0,b=M,y=D-Z,_=B,n=()=>nH(N,b,0,y,_),m=()=>nH(N,b,y+1,N.length,_,!0);H?({lineCount:b,removals:A}=n(),b>_&&(G||(_-=1),{lineCount:b,removals:V}=m())):(G||(_-=1),{lineCount:b,removals:V}=m(),b>_&&(_-=1,{lineCount:b,removals:A}=n())),A>0&&(H=!0,N.splice(0,A)),V>0&&(G=!0,N.splice(N.length-V,V))}let v=[];H&&v.push(W);for(let A of N)for(let V of A)v.push(V);return G&&v.push(W),v},T1=(D)=>{let $=D.active??"Yes",U=D.inactive??"No";return new SF({active:$,inactive:U,signal:D.signal,input:D.input,output:D.output,initialValue:D.initialValue??!0,render(){let I=D.withGuide??cD.withGuide,F=`${D9(this.state)} `,J=I?`${d("gray",wD)} `:"",X=V2(D.output,D.message,J,F),Q=`${I?`${d("gray",wD)}
|
|
22
22
|
`:""}${X}
|
|
23
23
|
`,Y=this.value?$:U;switch(this.state){case"submit":{let W=I?`${d("gray",wD)} `:"";return`${Q}${W}${d("dim",Y)}`}case"cancel":{let W=I?`${d("gray",wD)} `:"";return`${Q}${W}${d(["strikethrough","dim"],Y)}${I?`
|
|
@@ -25,13 +25,13 @@ ${d("gray",wD)}`:""}`}default:{let W=I?`${d("cyan",wD)} `:"",B=I?d("cyan",O0):"
|
|
|
25
25
|
${d("cyan",wD)} `:`
|
|
26
26
|
`:` ${d("dim","/")} `}${this.value?`${d("dim",e3)} ${d("dim",U)}`:`${d("green",CF)} ${U}`}
|
|
27
27
|
${B}
|
|
28
|
-
`}}}}).prompt()}
|
|
28
|
+
`}}}}).prompt()},U2D,vD,F2D=(D="",$)=>{let U=$?.output??process.stdout,I=$?.withGuide??cD.withGuide?`${d("gray",O0)} `:"";U.write(`${I}${d("red",D)}
|
|
29
29
|
|
|
30
30
|
`)},$9=(D="",$)=>{let U=$?.output??process.stdout,I=$?.withGuide??cD.withGuide?`${d("gray",wu)} `:"";U.write(`${I}${D}
|
|
31
31
|
`)},A2=(D="",$)=>{let U=$?.output??process.stdout,I=$?.withGuide??cD.withGuide?`${d("gray",wD)}
|
|
32
32
|
${d("gray",O0)} `:"";U.write(`${I}${D}
|
|
33
33
|
|
|
34
|
-
`)},
|
|
34
|
+
`)},I2D=(D)=>new mH({validate:D.validate,mask:D.mask??Zu,signal:D.signal,input:D.input,output:D.output,render(){let $=D.withGuide??cD.withGuide,U=`${$?`${d("gray",wD)}
|
|
35
35
|
`:""}${D9(this.state)} ${D.message}
|
|
36
36
|
`,I=this.userInputWithCursor,F=this.masked;switch(this.state){case"error":{let J=$?`${d("yellow",wD)} `:"",X=$?`${d("yellow",O0)} `:"",Q=F??"";return D.clearOnError&&this.clear(),`${U.trim()}
|
|
37
37
|
${J}${Q}
|
|
@@ -44,7 +44,7 @@ ${X}
|
|
|
44
44
|
`);a.length>1&&U.write(j2.cursor.up(a.length-1)),U.write(j2.cursor.to(0)),U.write(j2.erase.down())},_=(a)=>a.replace(/\.+$/,""),n=(a)=>{let DD=(performance.now()-a)/1000,E=Math.floor(DD/60),w=Math.floor(DD%60);return E>0?`[${E}m ${w}s]`:`[${w}s]`},m=Y.withGuide??cD.withGuide,UD=(a="")=>{q=!0,B=_H({output:U}),G=_(a),N=performance.now(),m&&U.write(`${d("gray",wD)}
|
|
45
45
|
`);let DD=0,E=0;V(),K=setInterval(()=>{if(W&&G===z)return;y(),z=G;let w=Z(J[DD]),O;if(W)O=`${w} ${G}...`;else if(D==="timer")O=`${w} ${G} ${n(N)}`;else{let k=".".repeat(Math.floor(E)).slice(0,3);O=`${w} ${G}${k}`}let S=g0(O,M,{hard:!0,trim:!1});U.write(S),DD=DD+1<J.length?DD+1:0,E=E<4?E+0.125:0},X)},s=(a="",DD=0,E=!1)=>{if(!q)return;q=!1,clearInterval(K),y();let w=DD===0?d("green",uF):DD===1?d("red",iH):d("red",lH);G=a??G,E||(D==="timer"?U.write(`${w} ${G} ${n(N)}
|
|
46
46
|
`):U.write(`${w} ${G}
|
|
47
|
-
`)),b(),B()};return{start:UD,stop:(a="")=>s(a,0),message:(a="")=>{G=_(a??G)},cancel:(a="")=>s(a,1),error:(a="")=>s(a,2),clear:()=>s("",0,!0),get isCancelled(){return H}}},
|
|
47
|
+
`)),b(),B()};return{start:UD,stop:(a="")=>s(a,0),message:(a="")=>{G=_(a??G)},cancel:(a="")=>s(a,1),error:(a="")=>s(a,2),clear:()=>s("",0,!0),get isCancelled(){return H}}},J2D,Su,s3=(D,$)=>D.includes(`
|
|
48
48
|
`)?D.split(`
|
|
49
49
|
`).map((U)=>$(U)).join(`
|
|
50
50
|
`):$(D),dH=(D)=>{let $=(I,F)=>{if(I===void 0)return"";let J=I.label??String(I.value);switch(F){case"disabled":return`${d("gray",e3)} ${s3(J,(X)=>d("gray",X))}${I.hint?` ${d("dim",`(${I.hint??"disabled"})`)}`:""}`;case"selected":return`${s3(J,(X)=>d("dim",X))}`;case"active":return`${d("green",CF)} ${J}${I.hint?` ${d("dim",`(${I.hint})`)}`:""}`;case"cancelled":return`${s3(J,(X)=>d(["strikethrough","dim"],X))}`;default:return`${d("dim",e3)} ${s3(J,(X)=>d("dim",X))}`}},U=D.showInstructions??!0;return new hH({options:D.options,signal:D.signal,input:D.input,output:D.output,initialValue:D.initialValue,render(){let I=D.withGuide??cD.withGuide,F=`${D9(this.state)} `,J=`${Vu(this.state)} `,X=V2(D.output,D.message,J,F),Q=`${I?`${d("gray",wD)}
|
|
@@ -55,7 +55,7 @@ ${d("gray",wD)}`:""}`}default:{let Y=I?`${d("cyan",wD)} `:"",W=Q.split(`
|
|
|
55
55
|
`),q=B.length+1;return`${Q}${Y}${Au({output:D.output,cursor:this.cursor,options:this.options,maxItems:D.maxItems,columnPadding:Y.length,rowPadding:W+q,style:(H,G)=>$(H,H.disabled?"disabled":G?"active":"inactive")}).join(`
|
|
56
56
|
${Y}`)}
|
|
57
57
|
${K}
|
|
58
|
-
`}}}}).prompt()},
|
|
58
|
+
`}}}}).prompt()},X2D,Q2D=(D)=>new TF({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,output:D.output,signal:D.signal,input:D.input,render(){let $=D?.withGuide??cD.withGuide,U=`${`${$?`${d("gray",wD)}
|
|
59
59
|
`:""}${D9(this.state)} `}${D.message}
|
|
60
60
|
`,I=D.placeholder&&D.placeholder.length>0?d("inverse",D.placeholder[0])+d("dim",D.placeholder.slice(1)):d(["inverse","hidden"],"_"),F=this.userInput?this.userInputWithCursor:I,J=this.value??"";switch(this.state){case"error":{let X=this.error?` ${d("yellow",this.error)}`:"",Q=$?`${d("yellow",wD)} `:"",Y=$?d("yellow",O0):"";return`${U.trim()}
|
|
61
61
|
${Q}${F}
|
|
@@ -63,49 +63,49 @@ ${Y}${X}
|
|
|
63
63
|
`}case"submit":{let X=J?` ${d("dim",J)}`:"",Q=$?d("gray",wD):"";return`${U}${Q}${X}`}case"cancel":{let X=J?` ${d(["strikethrough","dim"],J)}`:"",Q=$?d("gray",wD):"";return`${U}${Q}${X}${J.trim()?`
|
|
64
64
|
${Q}`:""}`}default:{let X=$?`${d("cyan",wD)} `:"",Q=$?d("cyan",O0):"";return`${U}${X}${F}
|
|
65
65
|
${Q}
|
|
66
|
-
`}}}}).prompt();var y0=T(()=>{bF();bF();ZF();NF();j2=h$(OF(),1);PF=Nu(),Lu=RD("◆","*"),iH=RD("■","x"),lH=RD("▲","x"),uF=RD("◇","o"),wu=RD("┌","T"),wD=RD("│","|"),O0=RD("└","—"),
|
|
66
|
+
`}}}}).prompt();var y0=T(()=>{bF();bF();ZF();NF();j2=h$(OF(),1);PF=Nu(),Lu=RD("◆","*"),iH=RD("■","x"),lH=RD("▲","x"),uF=RD("◇","o"),wu=RD("┌","T"),wD=RD("│","|"),O0=RD("└","—"),d4D=RD("┐","T"),c4D=RD("┘","—"),CF=RD("●",">"),e3=RD("○"," "),p4D=RD("◻","[•]"),r4D=RD("◼","[+]"),o4D=RD("◻","[ ]"),Zu=RD("▪","•"),t4D=RD("─","-"),a4D=RD("╮","+"),s4D=RD("├","+"),e4D=RD("╯","+"),D2D=RD("╰","+"),$2D=RD("╭","+"),Mu=RD("●","•"),Ou=RD("◆","*"),Eu=RD("▲","!"),vu=RD("■","x");U2D=[`${d("dim","↑/↓")} to navigate`,`${d("dim","Space:")} select`,`${d("dim","Enter:")} confirm`],vD={message:(D=[],{symbol:$=d("gray",wD),secondarySymbol:U=d("gray",wD),output:I=process.stdout,spacing:F=1,withGuide:J}={})=>{let X=[],Q=J??cD.withGuide,Y=Q?U:"",W=Q?`${$} `:"",B=Q?`${U} `:"";for(let q=0;q<F;q++)X.push(Y);let K=Array.isArray(D)?D:D.split(`
|
|
67
67
|
`);if(K.length>0){let[q,...H]=K;q.length>0?X.push(`${W}${q}`):X.push(Q?$:"");for(let G of H)G.length>0?X.push(`${B}${G}`):X.push(Q?U:"")}I.write(`${X.join(`
|
|
68
68
|
`)}
|
|
69
|
-
`)},info:(D,$)=>{vD.message(D,{...$,symbol:d("blue",Mu)})},success:(D,$)=>{vD.message(D,{...$,symbol:d("green",Ou)})},step:(D,$)=>{vD.message(D,{...$,symbol:d("green",uF)})},warn:(D,$)=>{vD.message(D,{...$,symbol:d("yellow",Eu)})},warning:(D,$)=>{vD.warn(D,$)},error:(D,$)=>{vD.message(D,{...$,symbol:d("red",vu)})}},I2D={light:RD("─","-"),heavy:RD("━","="),block:RD("█","#")},Su=[`${d("dim","↑/↓")} to navigate`,`${d("dim","Enter:")} confirm`],J2D=`${d("gray",wD)} `});function U9(D,$){if(isNaN(D)||isNaN($))throw Error("Cannot compare against non-numbers");return D===$?0:D<$?-1:1}function rH(D=[],$=[]){if(D.length&&!$.length)return-1;if(!D.length&&$.length)return 1;return 0}function F9(D=[],$=[]){let U=Math.max(D.length,$.length);for(let I=0;I<U;I++){let F=D[I],J=$[I];if(F===void 0&&J===void 0)return 0;if(J===void 0)return 1;if(F===void 0)return-1;if(typeof F==="string"&&typeof J==="number")return 1;if(typeof F==="number"&&typeof J==="string")return-1;if(F<J)return-1;if(F>J)return 1}return 0}function _F(D){return typeof D==="number"&&!Number.isNaN(D)&&(!Number.isFinite(D)||0<=D&&D<=Number.MAX_SAFE_INTEGER)}function j$(D){return D.split(".").filter(Boolean).map(($)=>{if(Cu.test($)){let U=Number($);if(_F(U))return U}return $})}function Q0(D){return D.split(".").filter(Boolean)}function J9(D,$){let U=Number(D);if(!_F(U))throw TypeError($);return U}function E0(D){return Number.isNaN(D.major)&&Number.isNaN(D.minor)&&Number.isNaN(D.patch)&&(D.prerelease===void 0||D.prerelease.length===0)&&(D.build===void 0||D.build.length===0)}var P1="0|[1-9]\\d*",Tu="\\d*[a-zA-Z-][a-zA-Z0-9-]*",bu,cH,oH,pH="[0-9A-Za-z-]+",tH,aH,sH,eH="(?:<|>)?=?",Pu="x|X|\\*",kF,I9,DN,$N,xF=256,Cu;var u$=T(()=>{bu=`(?<major>${P1})\\.(?<minor>${P1})\\.(?<patch>${P1})`,cH=`(?:${P1}|${Tu})`,oH=`(?:-(?<prerelease>${cH}(?:\\.${cH})*))`,tH=`(?:\\+(?<buildmetadata>${pH}(?:\\.${pH})*))`,aH=`v?${bu}${oH}?${tH}?`,sH=new RegExp(`^${aH}$`),kF=`${P1}|${Pu}`,I9=`[v=\\s]*(?<major>${kF})(?:\\.(?<minor>${kF})(?:\\.(?<patch>${kF})${oH}?${tH}?)?)?`,DN=new RegExp(`^(?<operator>~>?|\\^|${eH})\\s*${I9}$`),$N=new RegExp(`^(?<operator>${eH})\\s*(${aH})$|^$`);Cu=new RegExp(`^${P1}$`)});function G$(D,$){if(D===$)return 0;return U9(D.major,$.major)||U9(D.minor,$.minor)||U9(D.patch,$.patch)||rH(D.prerelease,$.prerelease)||F9(D.prerelease,$.prerelease)}var n$=T(()=>{u$()});function q2D(D,$){let U=D.prerelease?.length||$.prerelease?.length;if(D.major!==$.major)return U?"premajor":"major";if(D.minor!==$.minor)return U?"preminor":"minor";if(D.patch!==$.patch)return U?"prepatch":"patch";if(F9(D.prerelease,$.prerelease)!==0)return"prerelease"}var UN=T(()=>{u$()});function gF(D){return D.toFixed(0)}function fF(D){let $=gF(D.major),U=gF(D.minor),I=gF(D.patch),F=D.prerelease?.join(".")??"",J=D.build?.join(".")??"";return[[`${$}.${U}.${I}`,F].filter((Y)=>Y).join("-"),J].filter((Y)=>Y).join("+")}function uu(D,$){if(E0($))return!0;let U=G$(D,$);switch($.operator){case"=":case void 0:return U===0;case"!=":return U!==0;case">":return U>0;case"<":return U<0;case">=":return U>=0;case"<=":return U<=0}}function X9(D,$){for(let U of $)if(!uu(D,U))return!1;if(!D.prerelease?.length)return!0;for(let U of $){if(E0(U))continue;if(!U.prerelease?.length)continue;let{major:I,minor:F,patch:J}=U;if(D.major===I&&D.minor===F&&D.patch===J)return!0}return!1}var Q9=T(()=>{u$();n$()});function R2(D,$){return $.some((U)=>X9(D,U))}var S2=T(()=>{Q9()});function ku(D=[]){let $=[...D],U=$.length;while(U>=0){let I=$[U];if(typeof I==="number"){$[U]=I+1;break}U-=1}if(U===-1)$.push(0);return $}function T2(D=[],$){let U=ku(D);if(!$)return U;let I=j$($);if(I.every((F)=>typeof F==="string")){if(I.every((F,J)=>F===U[J])&&typeof U[I.length]==="number")return U;I=[...I,0]}return I}function E2D(D,$,U={}){let I=U.build!==void 0?Q0(U.build):D.build??[];switch($){case"premajor":return{major:D.major+1,minor:0,patch:0,prerelease:T2(D.prerelease,U.prerelease),build:I};case"preminor":return{major:D.major,minor:D.minor+1,patch:0,prerelease:T2(D.prerelease,U.prerelease),build:I};case"prepatch":return{major:D.major,minor:D.minor,patch:D.patch+1,prerelease:T2(D.prerelease,U.prerelease),build:I};case"prerelease":{let J=(D.prerelease??[]).length===0?D.patch+1:D.patch;return{major:D.major,minor:D.minor,patch:J,prerelease:T2(D.prerelease,U.prerelease),build:I}}case"major":return{major:(D.prerelease??[]).length===0||D.minor!==0||D.patch!==0?D.major+1:D.major,minor:0,patch:0,prerelease:[],build:I};case"minor":{let J=(D.prerelease??[]).length===0||D.patch!==0?D.minor+1:D.minor;return{major:D.major,minor:J,patch:0,prerelease:[],build:I}}case"patch":{let J=(D.prerelease??[]).length===0?D.patch+1:D.patch;return{major:D.major,minor:D.minor,patch:J,prerelease:[],build:I}}case"pre":return{major:D.major,minor:D.minor,patch:D.patch,prerelease:T2(D.prerelease,U.prerelease),build:I};default:throw TypeError(`Cannot increment version: invalid argument ${$}`)}}var FN=T(()=>{u$()});var Y9,C1;var b2=T(()=>{Y9={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},C1={operator:void 0,...Y9}});var yF=T(()=>{b2();u$()});function _u(D,$){return G$(D,$)>0}var mF=T(()=>{n$()});var IN=T(()=>{S2();mF()});function O6(D,$){return G$(D,$)<0}var hF=T(()=>{n$()});var JN=T(()=>{S2();hF()});function xu(D){let U=D.match($N)?.groups;if(!U)return null;let{operator:I}=U;return{operator:I||void 0,...Y9}}function TD(D){return!D||D.toLowerCase()==="x"||D==="*"}function gu(D){if(TD(D.major))return;if(TD(D.minor))return{operator:">=",major:+D.major,minor:0,patch:0,prerelease:[],build:[]};if(TD(D.patch))return{operator:">=",major:+D.major,minor:+D.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:D.prerelease?j$(D.prerelease):[],build:[]}}function fu(D){if(TD(D.major))return;if(TD(D.minor))return{operator:"<",major:+D.major+1,minor:0,patch:0,prerelease:[],build:[]};if(TD(D.patch))return{operator:"<",major:+D.major,minor:+D.minor+1,patch:0,prerelease:[],build:[]};if(D.prerelease)return{operator:"<=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:j$(D.prerelease),build:[]};return{operator:"<=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:[],build:[]}}function yu(D){let $=D.match(new RegExp(`^${I9}`)),U=$?.groups;if(!U)return null;let I=$[0].length,F=D.slice(I).match(/^\s+-\s+/);if(!F)return null;let J=F[0].length,Q=D.slice(I+J).match(new RegExp(`^${I9}\\s*$`))?.groups,Y=gu(U),W=fu(Q);return[Y,W].filter(Boolean)}function mu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0},{operator:"<",major:F+1,minor:0,patch:0}];if(I){if(F===0)return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F,minor:J+1,patch:0}];return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F+1,minor:0,patch:0}]}let Q=j$(D.prerelease??"");if(F===0){if(J===0)return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F,minor:J,patch:X+1}];return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F,minor:J+1,patch:0}]}return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F+1,minor:0,patch:0}]}function hu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0},{operator:"<",major:F+1,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F,minor:J+1,patch:0}];let Q=j$(D.prerelease??"");return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F,minor:J+1,patch:0}]}function nu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[{operator:"<",major:0,minor:0,patch:0}];if(U){if(I)return[{operator:"<",major:F,minor:0,patch:0}];return[{operator:"<",major:F,minor:0,patch:0}]}if(I)return[{operator:"<",major:F,minor:J,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:"<",major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function iu(D){let $=TD(D.minor),U=TD(D.patch),I=+D.major,F=+D.minor,J=+D.patch;if($)return[{operator:"<",major:I+1,minor:0,patch:0}];if(U)return[{operator:"<",major:I,minor:F+1,patch:0}];let X=j$(D.prerelease??""),Q=Q0(D.build??"");return[{operator:"<=",major:I,minor:F,patch:J,prerelease:X,build:Q}]}function lu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[{operator:"<",major:0,minor:0,patch:0}];if(U)return[{operator:">=",major:F+1,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J+1,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:">",major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function du(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function cu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0},{operator:"<",major:F+1,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F,minor:J+1,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:D.operator==="="?"=":void 0,major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function pu(D){let $=D.match(DN)?.groups;if(!$)return xu(D);switch($.operator){case"^":return mu($);case"~":case"~>":return hu($);case"<":return nu($);case"<=":return iu($);case">":return lu($);case">=":return du($);default:return cu($)}}function ru(D){return D.split(/\s+/).flatMap(pu)}function W9(D){let $=D.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((U)=>yu(U)||ru(U));if($.some((U)=>U.includes(null)))throw TypeError(`Cannot parse version range: range "${D}" is invalid`);return $}var nF=T(()=>{u$();b2()});function s$(D){if(typeof D!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof D}`);if(D.length>xF)throw TypeError(`Cannot parse version as version length is too long: length is ${D.length}, max length is ${xF}`);D=D.trim();let $=D.match(sH)?.groups;if(!$)throw TypeError(`Cannot parse version: ${D}`);let U=J9($.major,`Cannot parse version ${D}: invalid major version`),I=J9($.minor,`Cannot parse version ${D}: invalid minor version`),F=J9($.patch,`Cannot parse version ${D}: invalid patch version`),J=$.prerelease?j$($.prerelease):[],X=$.buildmetadata?Q0($.buildmetadata):[];return{major:U,minor:I,patch:F,prerelease:J,build:X}}var B9=T(()=>{u$();u$()});function XN(D,$){let U=D.operator,I=$.operator;if(U===void 0){if(E0(D))return!0;return R2(D,[[$]])}if(I===void 0){if(E0($))return!0;return R2($,[[D]])}let F=G$(D,$);return(U===">="||U===">")&&(I===">="||I===">")||(U==="<="||U==="<")&&(I==="<="||I==="<")||F===0&&((U===">="||U==="<=")&&(I===">="||I==="<="))||F===-1&&(U===">="||U===">")&&(I==="<="||I==="<")||F===1&&(U==="<="||U==="<")&&(I===">="||I===">")}function ou(D){return D.every(($)=>{return $.some((U)=>tu(U))})}function tu(D){for(let $=0;$<D.length-1;$++){let U=D[$];for(let I of D.slice($+1))if(!XN(U,I))return!1}return!0}function QN(D,$){return ou([D,$])&&D.some((U)=>{return $.some((I)=>{return U.every((F)=>{return I.every((J)=>XN(F,J))})})})}var YN=T(()=>{u$();n$();S2()});var WN=T(()=>{nF()});var BN=T(()=>{b2();b2();yF()});function P2(D){try{return s$(D),!0}catch{return!1}}var KN=T(()=>{B9()});var GN=T(()=>{B9()});var qN=T(()=>{u$()});var HN=T(()=>{n$()});var NN=T(()=>{n$()});var zN=T(()=>{Q9();u$();n$()});function Z8D(D,$){return G$(D,$)>=0}var LN=T(()=>{n$()});var wN=T(()=>{Q9();u$();n$()});var ZN=T(()=>{n$()});var iF=T(()=>{n$();UN();S2();FN();yF();IN();JN();nF();B9();YN();WN();BN();KN();GN();qN();HN();NN();mF();zN();LN();hF();wN();ZN()});var A$=C((e8D,q9)=>{var MN,ON,EN,vN,VN,jN,AN,RN,SN,TN,bN,PN,CN,K9,lF,uN,kN,_N,u1,xN,gN,fN,yN,mN,hN,nN,iN,lN,G9,dN,cN,pN;(function(D){var $=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(I){D(U($,U(I)))});else if(typeof q9==="object"&&typeof e8D==="object")D(U($,U(e8D)));else D(U($));function U(I,F){if(I!==$)if(typeof Object.create==="function")Object.defineProperty(I,"__esModule",{value:!0});else I.__esModule=!0;return function(J,X){return I[J]=F?F(J,X):X}}})(function(D){var $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,X){J.__proto__=X}||function(J,X){for(var Q in X)if(Object.prototype.hasOwnProperty.call(X,Q))J[Q]=X[Q]};MN=function(J,X){if(typeof X!=="function"&&X!==null)throw TypeError("Class extends value "+String(X)+" is not a constructor or null");$(J,X);function Q(){this.constructor=J}J.prototype=X===null?Object.create(X):(Q.prototype=X.prototype,new Q)},ON=Object.assign||function(J){for(var X,Q=1,Y=arguments.length;Q<Y;Q++){X=arguments[Q];for(var W in X)if(Object.prototype.hasOwnProperty.call(X,W))J[W]=X[W]}return J},EN=function(J,X){var Q={};for(var Y in J)if(Object.prototype.hasOwnProperty.call(J,Y)&&X.indexOf(Y)<0)Q[Y]=J[Y];if(J!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var W=0,Y=Object.getOwnPropertySymbols(J);W<Y.length;W++)if(X.indexOf(Y[W])<0&&Object.prototype.propertyIsEnumerable.call(J,Y[W]))Q[Y[W]]=J[Y[W]]}return Q},vN=function(J,X,Q,Y){var W=arguments.length,B=W<3?X:Y===null?Y=Object.getOwnPropertyDescriptor(X,Q):Y,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")B=Reflect.decorate(J,X,Q,Y);else for(var q=J.length-1;q>=0;q--)if(K=J[q])B=(W<3?K(B):W>3?K(X,Q,B):K(X,Q))||B;return W>3&&B&&Object.defineProperty(X,Q,B),B},VN=function(J,X){return function(Q,Y){X(Q,Y,J)}},jN=function(J,X,Q,Y,W,B){function K(V){if(V!==void 0&&typeof V!=="function")throw TypeError("Function expected");return V}var q=Y.kind,H=q==="getter"?"get":q==="setter"?"set":"value",G=!X&&J?Y.static?J:J.prototype:null,z=X||(G?Object.getOwnPropertyDescriptor(G,Y.name):{}),N,M=!1;for(var Z=Q.length-1;Z>=0;Z--){var L={};for(var v in Y)L[v]=v==="access"?{}:Y[v];for(var v in Y.access)L.access[v]=Y.access[v];L.addInitializer=function(V){if(M)throw TypeError("Cannot add initializers after decoration has completed");B.push(K(V||null))};var A=(0,Q[Z])(q==="accessor"?{get:z.get,set:z.set}:z[H],L);if(q==="accessor"){if(A===void 0)continue;if(A===null||typeof A!=="object")throw TypeError("Object expected");if(N=K(A.get))z.get=N;if(N=K(A.set))z.set=N;if(N=K(A.init))W.unshift(N)}else if(N=K(A))if(q==="field")W.unshift(N);else z[H]=N}if(G)Object.defineProperty(G,Y.name,z);M=!0},AN=function(J,X,Q){var Y=arguments.length>2;for(var W=0;W<X.length;W++)Q=Y?X[W].call(J,Q):X[W].call(J);return Y?Q:void 0},RN=function(J){return typeof J==="symbol"?J:"".concat(J)},SN=function(J,X,Q){if(typeof X==="symbol")X=X.description?"[".concat(X.description,"]"):"";return Object.defineProperty(J,"name",{configurable:!0,value:Q?"".concat(Q," ",X):X})},TN=function(J,X){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(J,X)},bN=function(J,X,Q,Y){function W(B){return B instanceof Q?B:new Q(function(K){K(B)})}return new(Q||(Q=Promise))(function(B,K){function q(z){try{G(Y.next(z))}catch(N){K(N)}}function H(z){try{G(Y.throw(z))}catch(N){K(N)}}function G(z){z.done?B(z.value):W(z.value).then(q,H)}G((Y=Y.apply(J,X||[])).next())})},PN=function(J,X){var Q={label:0,sent:function(){if(B[0]&1)throw B[1];return B[1]},trys:[],ops:[]},Y,W,B,K=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return K.next=q(0),K.throw=q(1),K.return=q(2),typeof Symbol==="function"&&(K[Symbol.iterator]=function(){return this}),K;function q(G){return function(z){return H([G,z])}}function H(G){if(Y)throw TypeError("Generator is already executing.");while(K&&(K=0,G[0]&&(Q=0)),Q)try{if(Y=1,W&&(B=G[0]&2?W.return:G[0]?W.throw||((B=W.return)&&B.call(W),0):W.next)&&!(B=B.call(W,G[1])).done)return B;if(W=0,B)G=[G[0]&2,B.value];switch(G[0]){case 0:case 1:B=G;break;case 4:return Q.label++,{value:G[1],done:!1};case 5:Q.label++,W=G[1],G=[0];continue;case 7:G=Q.ops.pop(),Q.trys.pop();continue;default:if((B=Q.trys,!(B=B.length>0&&B[B.length-1]))&&(G[0]===6||G[0]===2)){Q=0;continue}if(G[0]===3&&(!B||G[1]>B[0]&&G[1]<B[3])){Q.label=G[1];break}if(G[0]===6&&Q.label<B[1]){Q.label=B[1],B=G;break}if(B&&Q.label<B[2]){Q.label=B[2],Q.ops.push(G);break}if(B[2])Q.ops.pop();Q.trys.pop();continue}G=X.call(J,Q)}catch(z){G=[6,z],W=0}finally{Y=B=0}if(G[0]&5)throw G[1];return{value:G[0]?G[1]:void 0,done:!0}}},CN=function(J,X){for(var Q in J)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(X,Q))G9(X,J,Q)},G9=Object.create?function(J,X,Q,Y){if(Y===void 0)Y=Q;var W=Object.getOwnPropertyDescriptor(X,Q);if(!W||("get"in W?!X.__esModule:W.writable||W.configurable))W={enumerable:!0,get:function(){return X[Q]}};Object.defineProperty(J,Y,W)}:function(J,X,Q,Y){if(Y===void 0)Y=Q;J[Y]=X[Q]},K9=function(J){var X=typeof Symbol==="function"&&Symbol.iterator,Q=X&&J[X],Y=0;if(Q)return Q.call(J);if(J&&typeof J.length==="number")return{next:function(){if(J&&Y>=J.length)J=void 0;return{value:J&&J[Y++],done:!J}}};throw TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")},lF=function(J,X){var Q=typeof Symbol==="function"&&J[Symbol.iterator];if(!Q)return J;var Y=Q.call(J),W,B=[],K;try{while((X===void 0||X-- >0)&&!(W=Y.next()).done)B.push(W.value)}catch(q){K={error:q}}finally{try{if(W&&!W.done&&(Q=Y.return))Q.call(Y)}finally{if(K)throw K.error}}return B},uN=function(){for(var J=[],X=0;X<arguments.length;X++)J=J.concat(lF(arguments[X]));return J},kN=function(){for(var J=0,X=0,Q=arguments.length;X<Q;X++)J+=arguments[X].length;for(var Y=Array(J),W=0,X=0;X<Q;X++)for(var B=arguments[X],K=0,q=B.length;K<q;K++,W++)Y[W]=B[K];return Y},_N=function(J,X,Q){if(Q||arguments.length===2){for(var Y=0,W=X.length,B;Y<W;Y++)if(B||!(Y in X)){if(!B)B=Array.prototype.slice.call(X,0,Y);B[Y]=X[Y]}}return J.concat(B||Array.prototype.slice.call(X))},u1=function(J){return this instanceof u1?(this.v=J,this):new u1(J)},xN=function(J,X,Q){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var Y=Q.apply(J,X||[]),W,B=[];return W=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),q("next"),q("throw"),q("return",K),W[Symbol.asyncIterator]=function(){return this},W;function K(Z){return function(L){return Promise.resolve(L).then(Z,N)}}function q(Z,L){if(Y[Z]){if(W[Z]=function(v){return new Promise(function(A,V){B.push([Z,v,A,V])>1||H(Z,v)})},L)W[Z]=L(W[Z])}}function H(Z,L){try{G(Y[Z](L))}catch(v){M(B[0][3],v)}}function G(Z){Z.value instanceof u1?Promise.resolve(Z.value.v).then(z,N):M(B[0][2],Z)}function z(Z){H("next",Z)}function N(Z){H("throw",Z)}function M(Z,L){if(Z(L),B.shift(),B.length)H(B[0][0],B[0][1])}},gN=function(J){var X,Q;return X={},Y("next"),Y("throw",function(W){throw W}),Y("return"),X[Symbol.iterator]=function(){return this},X;function Y(W,B){X[W]=J[W]?function(K){return(Q=!Q)?{value:u1(J[W](K)),done:!1}:B?B(K):K}:B}},fN=function(J){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var X=J[Symbol.asyncIterator],Q;return X?X.call(J):(J=typeof K9==="function"?K9(J):J[Symbol.iterator](),Q={},Y("next"),Y("throw"),Y("return"),Q[Symbol.asyncIterator]=function(){return this},Q);function Y(B){Q[B]=J[B]&&function(K){return new Promise(function(q,H){K=J[B](K),W(q,H,K.done,K.value)})}}function W(B,K,q,H){Promise.resolve(H).then(function(G){B({value:G,done:q})},K)}},yN=function(J,X){if(Object.defineProperty)Object.defineProperty(J,"raw",{value:X});else J.raw=X;return J};var U=Object.create?function(J,X){Object.defineProperty(J,"default",{enumerable:!0,value:X})}:function(J,X){J.default=X},I=function(J){return I=Object.getOwnPropertyNames||function(X){var Q=[];for(var Y in X)if(Object.prototype.hasOwnProperty.call(X,Y))Q[Q.length]=Y;return Q},I(J)};mN=function(J){if(J&&J.__esModule)return J;var X={};if(J!=null){for(var Q=I(J),Y=0;Y<Q.length;Y++)if(Q[Y]!=="default")G9(X,J,Q[Y])}return U(X,J),X},hN=function(J){return J&&J.__esModule?J:{default:J}},nN=function(J,X,Q,Y){if(Q==="a"&&!Y)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?J!==X||!Y:!X.has(J))throw TypeError("Cannot read private member from an object whose class did not declare it");return Q==="m"?Y:Q==="a"?Y.call(J):Y?Y.value:X.get(J)},iN=function(J,X,Q,Y,W){if(Y==="m")throw TypeError("Private method is not writable");if(Y==="a"&&!W)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?J!==X||!W:!X.has(J))throw TypeError("Cannot write private member to an object whose class did not declare it");return Y==="a"?W.call(J,Q):W?W.value=Q:X.set(J,Q),Q},lN=function(J,X){if(X===null||typeof X!=="object"&&typeof X!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof J==="function"?X===J:J.has(X)},dN=function(J,X,Q){if(X!==null&&X!==void 0){if(typeof X!=="object"&&typeof X!=="function")throw TypeError("Object expected.");var Y,W;if(Q){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");Y=X[Symbol.asyncDispose]}if(Y===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(Y=X[Symbol.dispose],Q)W=Y}if(typeof Y!=="function")throw TypeError("Object not disposable.");if(W)Y=function(){try{W.call(this)}catch(B){return Promise.reject(B)}};J.stack.push({value:X,dispose:Y,async:Q})}else if(Q)J.stack.push({async:!0});return X};var F=typeof SuppressedError==="function"?SuppressedError:function(J,X,Q){var Y=Error(Q);return Y.name="SuppressedError",Y.error=J,Y.suppressed=X,Y};cN=function(J){function X(B){J.error=J.hasError?new F(B,J.error,"An error was suppressed during disposal."):B,J.hasError=!0}var Q,Y=0;function W(){while(Q=J.stack.pop())try{if(!Q.async&&Y===1)return Y=0,J.stack.push(Q),Promise.resolve().then(W);if(Q.dispose){var B=Q.dispose.call(Q.value);if(Q.async)return Y|=2,Promise.resolve(B).then(W,function(K){return X(K),W()})}else Y|=1}catch(K){X(K)}if(Y===1)return J.hasError?Promise.reject(J.error):Promise.resolve();if(J.hasError)throw J.error}return W()},pN=function(J,X){if(typeof J==="string"&&/^\.\.?\//.test(J))return J.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(Q,Y,W,B,K){return Y?X?".jsx":".js":W&&(!B||!K)?Q:W+B+"."+K.toLowerCase()+"js"});return J},D("__extends",MN),D("__assign",ON),D("__rest",EN),D("__decorate",vN),D("__param",VN),D("__esDecorate",jN),D("__runInitializers",AN),D("__propKey",RN),D("__setFunctionName",SN),D("__metadata",TN),D("__awaiter",bN),D("__generator",PN),D("__exportStar",CN),D("__createBinding",G9),D("__values",K9),D("__read",lF),D("__spread",uN),D("__spreadArrays",kN),D("__spreadArray",_N),D("__await",u1),D("__asyncGenerator",xN),D("__asyncDelegator",gN),D("__asyncValues",fN),D("__makeTemplateObject",yN),D("__importStar",mN),D("__importDefault",hN),D("__classPrivateFieldGet",nN),D("__classPrivateFieldSet",iN),D("__classPrivateFieldIn",lN),D("__addDisposableResource",dN),D("__disposeResources",cN),D("__rewriteRelativeImportExtension",pN)})});var tN=C((rN)=>{Object.defineProperty(rN,"__esModule",{value:!0});rN.resolveFetch=void 0;var au=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)};rN.resolveFetch=au});var dF=C(($z)=>{Object.defineProperty($z,"__esModule",{value:!0});$z.FunctionRegion=$z.FunctionsHttpError=$z.FunctionsRelayError=$z.FunctionsFetchError=$z.FunctionsError=void 0;class C2 extends Error{constructor(D,$="FunctionsError",U){super(D);this.name=$,this.context=U}toJSON(){return{name:this.name,message:this.message,context:this.context}}}$z.FunctionsError=C2;class sN extends C2{constructor(D){super("Failed to send a request to the Edge Function","FunctionsFetchError",D)}}$z.FunctionsFetchError=sN;class eN extends C2{constructor(D){super("Relay Error invoking the Edge Function","FunctionsRelayError",D)}}$z.FunctionsRelayError=eN;class Dz extends C2{constructor(D){super("Edge Function returned a non-2xx status code","FunctionsHttpError",D)}}$z.FunctionsHttpError=Dz;var aN;(function(D){D.Any="any",D.ApNortheast1="ap-northeast-1",D.ApNortheast2="ap-northeast-2",D.ApSouth1="ap-south-1",D.ApSoutheast1="ap-southeast-1",D.ApSoutheast2="ap-southeast-2",D.CaCentral1="ca-central-1",D.EuCentral1="eu-central-1",D.EuWest1="eu-west-1",D.EuWest2="eu-west-2",D.EuWest3="eu-west-3",D.SaEast1="sa-east-1",D.UsEast1="us-east-1",D.UsWest1="us-west-1",D.UsWest2="us-west-2"})(aN||($z.FunctionRegion=aN={}))});var Xz=C((Iz)=>{Object.defineProperty(Iz,"__esModule",{value:!0});Iz.FunctionsClient=void 0;var Uk=A$(),Fk=tN(),k1=dF();class Fz{constructor(D,{headers:$={},customFetch:U,region:I=k1.FunctionRegion.Any}={}){this.url=D,this.headers=$,this.region=I,this.fetch=(0,Fk.resolveFetch)(U)}setAuth(D){this.headers.Authorization=`Bearer ${D}`}invoke(D){return Uk.__awaiter(this,arguments,void 0,function*($,U={}){var I,F;let J,X,Q;try{let{headers:Y,method:W,body:B,signal:K,timeout:q}=U,H={},{region:G}=U;if(!G)G=this.region;let z=new URL(`${this.url}/${$}`);if(G&&G!=="any")H["x-region"]=G,z.searchParams.set("forceFunctionRegion",G);let N,M=!!Y&&Object.keys(Y).some((b)=>b.toLowerCase()==="content-type");if(B&&!M)if(typeof Blob<"u"&&B instanceof Blob||B instanceof ArrayBuffer)H["Content-Type"]="application/octet-stream",N=B;else if(typeof B==="string")H["Content-Type"]="text/plain",N=B;else if(typeof FormData<"u"&&B instanceof FormData)N=B;else H["Content-Type"]="application/json",N=JSON.stringify(B);else if(B&&typeof B!=="string"&&!(typeof Blob<"u"&&B instanceof Blob)&&!(B instanceof ArrayBuffer)&&!(typeof FormData<"u"&&B instanceof FormData))N=JSON.stringify(B);else N=B;let Z=K;if(q)if(X=new AbortController,J=setTimeout(()=>X.abort(),q),K)Z=X.signal,Q=()=>X.abort(),K.addEventListener("abort",Q);else Z=X.signal;let L=yield this.fetch(z.toString(),{method:W||"POST",headers:Object.assign(Object.assign(Object.assign({},H),this.headers),Y),body:N,signal:Z}).catch((b)=>{throw new k1.FunctionsFetchError(b)}),v=L.headers.get("x-relay-error");if(v&&v==="true")throw new k1.FunctionsRelayError(L);if(!L.ok)throw new k1.FunctionsHttpError(L);let A=((I=L.headers.get("Content-Type"))!==null&&I!==void 0?I:"text/plain").split(";")[0].trim().toLowerCase(),V;if(A==="application/json")V=yield L.json();else if(A==="application/octet-stream"||A==="application/pdf")V=yield L.blob();else if(A==="text/event-stream")V=L;else if(A==="multipart/form-data")V=yield L.formData();else V=yield L.text();return{data:V,error:null,response:L}}catch(Y){return{data:null,error:Y,response:Y instanceof k1.FunctionsHttpError||Y instanceof k1.FunctionsRelayError?Y.context:void 0}}finally{if(J)clearTimeout(J);if(Q)(F=U.signal)===null||F===void 0||F.removeEventListener("abort",Q)}})}}Iz.FunctionsClient=Fz});var Qz=C((m0)=>{Object.defineProperty(m0,"__esModule",{value:!0});m0.FunctionRegion=m0.FunctionsRelayError=m0.FunctionsHttpError=m0.FunctionsFetchError=m0.FunctionsError=m0.FunctionsClient=void 0;var Ik=Xz();Object.defineProperty(m0,"FunctionsClient",{enumerable:!0,get:function(){return Ik.FunctionsClient}});var u2=dF();Object.defineProperty(m0,"FunctionsError",{enumerable:!0,get:function(){return u2.FunctionsError}});Object.defineProperty(m0,"FunctionsFetchError",{enumerable:!0,get:function(){return u2.FunctionsFetchError}});Object.defineProperty(m0,"FunctionsHttpError",{enumerable:!0,get:function(){return u2.FunctionsHttpError}});Object.defineProperty(m0,"FunctionsRelayError",{enumerable:!0,get:function(){return u2.FunctionsRelayError}});Object.defineProperty(m0,"FunctionRegion",{enumerable:!0,get:function(){return u2.FunctionRegion}})});function Wz(D,$){return new Promise((U)=>{if($===null||$===void 0?void 0:$.aborted){U();return}let I=setTimeout(()=>{$===null||$===void 0||$.removeEventListener("abort",F),U()},D);function F(){clearTimeout(I),U()}$===null||$===void 0||$.addEventListener("abort",F)})}function Qk(D,$,U,I){if(!I||U>=3)return!1;if(!Gz.includes(D))return!1;if(!Xk.includes($))return!1;return!0}function k2(D){return k2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},k2(D)}function Kk(D,$){if(k2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(k2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function Gk(D){var $=Kk(D,"string");return k2($)=="symbol"?$:$+""}function qk(D,$,U){return($=Gk($))in D?Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[$]=U,D}function Kz(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function H9(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Kz(Object(U),!0).forEach(function(I){qk(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Kz(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}var Yz=(D)=>Math.min(1000*2**D,30000),Xk,Gz,cF,Yk=class{constructor(D){var $,U,I,F,J;if(this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=D.method,this.url=D.url,this.headers=new Headers(D.headers),this.schema=D.schema,this.body=D.body,this.shouldThrowOnError=($=D.shouldThrowOnError)!==null&&$!==void 0?$:!1,this.signal=D.signal,this.isMaybeSingle=(U=D.isMaybeSingle)!==null&&U!==void 0?U:!1,this.shouldStripNulls=(I=D.shouldStripNulls)!==null&&I!==void 0?I:!1,this.urlLengthLimit=(F=D.urlLengthLimit)!==null&&F!==void 0?F:8000,this.retryEnabled=(J=D.retry)!==null&&J!==void 0?J:!0,D.fetch)this.fetch=D.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(D,$){return this.headers=new Headers(this.headers),this.headers.set(D,$),this}retry(D){return this.retryEnabled=D,this}then(D,$){var U=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");if(this.shouldStripNulls){let X=this.headers.get("Accept");if(X==="application/vnd.pgrst.object+json")this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped");else if(!X||X==="application/json")this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let I=this.fetch,J=(async()=>{let X=0;while(!0){let W={};if(U.headers.forEach((K,q)=>{W[q]=K}),X>0)W["X-Retry-Count"]=String(X);let B;try{B=await I(U.url.toString(),{method:U.method,headers:W,body:JSON.stringify(U.body,(K,q)=>typeof q==="bigint"?q.toString():q),signal:U.signal})}catch(K){if((K===null||K===void 0?void 0:K.name)==="AbortError"||(K===null||K===void 0?void 0:K.code)==="ABORT_ERR")throw K;if(!Gz.includes(U.method))throw K;if(U.retryEnabled&&X<3){let q=Yz(X);X++,await Wz(q,U.signal);continue}throw K}if(Qk(U.method,B.status,X,U.retryEnabled)){var Q,Y;let K=(Q=(Y=B.headers)===null||Y===void 0?void 0:Y.get("Retry-After"))!==null&&Q!==void 0?Q:null,q=K!==null?Math.max(0,parseInt(K,10)||0)*1000:Yz(X);await B.text(),X++,await Wz(q,U.signal);continue}return await U.processResponse(B)}})();if(!this.shouldThrowOnError)J=J.catch((X)=>{var Q;let Y="",W="",B="",K=X===null||X===void 0?void 0:X.cause;if(K){var q,H,G,z;let Z=(q=K===null||K===void 0?void 0:K.message)!==null&&q!==void 0?q:"",L=(H=K===null||K===void 0?void 0:K.code)!==null&&H!==void 0?H:"";if(Y=`${(G=X===null||X===void 0?void 0:X.name)!==null&&G!==void 0?G:"FetchError"}: ${X===null||X===void 0?void 0:X.message}`,Y+=`
|
|
69
|
+
`)},info:(D,$)=>{vD.message(D,{...$,symbol:d("blue",Mu)})},success:(D,$)=>{vD.message(D,{...$,symbol:d("green",Ou)})},step:(D,$)=>{vD.message(D,{...$,symbol:d("green",uF)})},warn:(D,$)=>{vD.message(D,{...$,symbol:d("yellow",Eu)})},warning:(D,$)=>{vD.warn(D,$)},error:(D,$)=>{vD.message(D,{...$,symbol:d("red",vu)})}},J2D={light:RD("─","-"),heavy:RD("━","="),block:RD("█","#")},Su=[`${d("dim","↑/↓")} to navigate`,`${d("dim","Enter:")} confirm`],X2D=`${d("gray",wD)} `});function U9(D,$){if(isNaN(D)||isNaN($))throw Error("Cannot compare against non-numbers");return D===$?0:D<$?-1:1}function rH(D=[],$=[]){if(D.length&&!$.length)return-1;if(!D.length&&$.length)return 1;return 0}function F9(D=[],$=[]){let U=Math.max(D.length,$.length);for(let I=0;I<U;I++){let F=D[I],J=$[I];if(F===void 0&&J===void 0)return 0;if(J===void 0)return 1;if(F===void 0)return-1;if(typeof F==="string"&&typeof J==="number")return 1;if(typeof F==="number"&&typeof J==="string")return-1;if(F<J)return-1;if(F>J)return 1}return 0}function _F(D){return typeof D==="number"&&!Number.isNaN(D)&&(!Number.isFinite(D)||0<=D&&D<=Number.MAX_SAFE_INTEGER)}function j$(D){return D.split(".").filter(Boolean).map(($)=>{if(Cu.test($)){let U=Number($);if(_F(U))return U}return $})}function Q0(D){return D.split(".").filter(Boolean)}function J9(D,$){let U=Number(D);if(!_F(U))throw TypeError($);return U}function E0(D){return Number.isNaN(D.major)&&Number.isNaN(D.minor)&&Number.isNaN(D.patch)&&(D.prerelease===void 0||D.prerelease.length===0)&&(D.build===void 0||D.build.length===0)}var P1="0|[1-9]\\d*",Tu="\\d*[a-zA-Z-][a-zA-Z0-9-]*",bu,cH,oH,pH="[0-9A-Za-z-]+",tH,aH,sH,eH="(?:<|>)?=?",Pu="x|X|\\*",kF,I9,DN,$N,xF=256,Cu;var u$=T(()=>{bu=`(?<major>${P1})\\.(?<minor>${P1})\\.(?<patch>${P1})`,cH=`(?:${P1}|${Tu})`,oH=`(?:-(?<prerelease>${cH}(?:\\.${cH})*))`,tH=`(?:\\+(?<buildmetadata>${pH}(?:\\.${pH})*))`,aH=`v?${bu}${oH}?${tH}?`,sH=new RegExp(`^${aH}$`),kF=`${P1}|${Pu}`,I9=`[v=\\s]*(?<major>${kF})(?:\\.(?<minor>${kF})(?:\\.(?<patch>${kF})${oH}?${tH}?)?)?`,DN=new RegExp(`^(?<operator>~>?|\\^|${eH})\\s*${I9}$`),$N=new RegExp(`^(?<operator>${eH})\\s*(${aH})$|^$`);Cu=new RegExp(`^${P1}$`)});function G$(D,$){if(D===$)return 0;return U9(D.major,$.major)||U9(D.minor,$.minor)||U9(D.patch,$.patch)||rH(D.prerelease,$.prerelease)||F9(D.prerelease,$.prerelease)}var n$=T(()=>{u$()});function H2D(D,$){let U=D.prerelease?.length||$.prerelease?.length;if(D.major!==$.major)return U?"premajor":"major";if(D.minor!==$.minor)return U?"preminor":"minor";if(D.patch!==$.patch)return U?"prepatch":"patch";if(F9(D.prerelease,$.prerelease)!==0)return"prerelease"}var UN=T(()=>{u$()});function gF(D){return D.toFixed(0)}function fF(D){let $=gF(D.major),U=gF(D.minor),I=gF(D.patch),F=D.prerelease?.join(".")??"",J=D.build?.join(".")??"";return[[`${$}.${U}.${I}`,F].filter((Y)=>Y).join("-"),J].filter((Y)=>Y).join("+")}function uu(D,$){if(E0($))return!0;let U=G$(D,$);switch($.operator){case"=":case void 0:return U===0;case"!=":return U!==0;case">":return U>0;case"<":return U<0;case">=":return U>=0;case"<=":return U<=0}}function X9(D,$){for(let U of $)if(!uu(D,U))return!1;if(!D.prerelease?.length)return!0;for(let U of $){if(E0(U))continue;if(!U.prerelease?.length)continue;let{major:I,minor:F,patch:J}=U;if(D.major===I&&D.minor===F&&D.patch===J)return!0}return!1}var Q9=T(()=>{u$();n$()});function R2(D,$){return $.some((U)=>X9(D,U))}var S2=T(()=>{Q9()});function ku(D=[]){let $=[...D],U=$.length;while(U>=0){let I=$[U];if(typeof I==="number"){$[U]=I+1;break}U-=1}if(U===-1)$.push(0);return $}function T2(D=[],$){let U=ku(D);if(!$)return U;let I=j$($);if(I.every((F)=>typeof F==="string")){if(I.every((F,J)=>F===U[J])&&typeof U[I.length]==="number")return U;I=[...I,0]}return I}function v2D(D,$,U={}){let I=U.build!==void 0?Q0(U.build):D.build??[];switch($){case"premajor":return{major:D.major+1,minor:0,patch:0,prerelease:T2(D.prerelease,U.prerelease),build:I};case"preminor":return{major:D.major,minor:D.minor+1,patch:0,prerelease:T2(D.prerelease,U.prerelease),build:I};case"prepatch":return{major:D.major,minor:D.minor,patch:D.patch+1,prerelease:T2(D.prerelease,U.prerelease),build:I};case"prerelease":{let J=(D.prerelease??[]).length===0?D.patch+1:D.patch;return{major:D.major,minor:D.minor,patch:J,prerelease:T2(D.prerelease,U.prerelease),build:I}}case"major":return{major:(D.prerelease??[]).length===0||D.minor!==0||D.patch!==0?D.major+1:D.major,minor:0,patch:0,prerelease:[],build:I};case"minor":{let J=(D.prerelease??[]).length===0||D.patch!==0?D.minor+1:D.minor;return{major:D.major,minor:J,patch:0,prerelease:[],build:I}}case"patch":{let J=(D.prerelease??[]).length===0?D.patch+1:D.patch;return{major:D.major,minor:D.minor,patch:J,prerelease:[],build:I}}case"pre":return{major:D.major,minor:D.minor,patch:D.patch,prerelease:T2(D.prerelease,U.prerelease),build:I};default:throw TypeError(`Cannot increment version: invalid argument ${$}`)}}var FN=T(()=>{u$()});var Y9,C1;var b2=T(()=>{Y9={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},C1={operator:void 0,...Y9}});var yF=T(()=>{b2();u$()});function _u(D,$){return G$(D,$)>0}var mF=T(()=>{n$()});var IN=T(()=>{S2();mF()});function O6(D,$){return G$(D,$)<0}var hF=T(()=>{n$()});var JN=T(()=>{S2();hF()});function xu(D){let U=D.match($N)?.groups;if(!U)return null;let{operator:I}=U;return{operator:I||void 0,...Y9}}function TD(D){return!D||D.toLowerCase()==="x"||D==="*"}function gu(D){if(TD(D.major))return;if(TD(D.minor))return{operator:">=",major:+D.major,minor:0,patch:0,prerelease:[],build:[]};if(TD(D.patch))return{operator:">=",major:+D.major,minor:+D.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:D.prerelease?j$(D.prerelease):[],build:[]}}function fu(D){if(TD(D.major))return;if(TD(D.minor))return{operator:"<",major:+D.major+1,minor:0,patch:0,prerelease:[],build:[]};if(TD(D.patch))return{operator:"<",major:+D.major,minor:+D.minor+1,patch:0,prerelease:[],build:[]};if(D.prerelease)return{operator:"<=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:j$(D.prerelease),build:[]};return{operator:"<=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:[],build:[]}}function yu(D){let $=D.match(new RegExp(`^${I9}`)),U=$?.groups;if(!U)return null;let I=$[0].length,F=D.slice(I).match(/^\s+-\s+/);if(!F)return null;let J=F[0].length,Q=D.slice(I+J).match(new RegExp(`^${I9}\\s*$`))?.groups,Y=gu(U),W=fu(Q);return[Y,W].filter(Boolean)}function mu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0},{operator:"<",major:F+1,minor:0,patch:0}];if(I){if(F===0)return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F,minor:J+1,patch:0}];return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F+1,minor:0,patch:0}]}let Q=j$(D.prerelease??"");if(F===0){if(J===0)return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F,minor:J,patch:X+1}];return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F,minor:J+1,patch:0}]}return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F+1,minor:0,patch:0}]}function hu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0},{operator:"<",major:F+1,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F,minor:J+1,patch:0}];let Q=j$(D.prerelease??"");return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q},{operator:"<",major:F,minor:J+1,patch:0}]}function nu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[{operator:"<",major:0,minor:0,patch:0}];if(U){if(I)return[{operator:"<",major:F,minor:0,patch:0}];return[{operator:"<",major:F,minor:0,patch:0}]}if(I)return[{operator:"<",major:F,minor:J,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:"<",major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function iu(D){let $=TD(D.minor),U=TD(D.patch),I=+D.major,F=+D.minor,J=+D.patch;if($)return[{operator:"<",major:I+1,minor:0,patch:0}];if(U)return[{operator:"<",major:I,minor:F+1,patch:0}];let X=j$(D.prerelease??""),Q=Q0(D.build??"");return[{operator:"<=",major:I,minor:F,patch:J,prerelease:X,build:Q}]}function lu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[{operator:"<",major:0,minor:0,patch:0}];if(U)return[{operator:">=",major:F+1,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J+1,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:">",major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function du(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:">=",major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function cu(D){let $=TD(D.major),U=TD(D.minor),I=TD(D.patch),F=+D.major,J=+D.minor,X=+D.patch;if($)return[C1];if(U)return[{operator:">=",major:F,minor:0,patch:0},{operator:"<",major:F+1,minor:0,patch:0}];if(I)return[{operator:">=",major:F,minor:J,patch:0},{operator:"<",major:F,minor:J+1,patch:0}];let Q=j$(D.prerelease??""),Y=Q0(D.build??"");return[{operator:D.operator==="="?"=":void 0,major:F,minor:J,patch:X,prerelease:Q,build:Y}]}function pu(D){let $=D.match(DN)?.groups;if(!$)return xu(D);switch($.operator){case"^":return mu($);case"~":case"~>":return hu($);case"<":return nu($);case"<=":return iu($);case">":return lu($);case">=":return du($);default:return cu($)}}function ru(D){return D.split(/\s+/).flatMap(pu)}function W9(D){let $=D.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((U)=>yu(U)||ru(U));if($.some((U)=>U.includes(null)))throw TypeError(`Cannot parse version range: range "${D}" is invalid`);return $}var nF=T(()=>{u$();b2()});function s$(D){if(typeof D!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof D}`);if(D.length>xF)throw TypeError(`Cannot parse version as version length is too long: length is ${D.length}, max length is ${xF}`);D=D.trim();let $=D.match(sH)?.groups;if(!$)throw TypeError(`Cannot parse version: ${D}`);let U=J9($.major,`Cannot parse version ${D}: invalid major version`),I=J9($.minor,`Cannot parse version ${D}: invalid minor version`),F=J9($.patch,`Cannot parse version ${D}: invalid patch version`),J=$.prerelease?j$($.prerelease):[],X=$.buildmetadata?Q0($.buildmetadata):[];return{major:U,minor:I,patch:F,prerelease:J,build:X}}var B9=T(()=>{u$();u$()});function XN(D,$){let U=D.operator,I=$.operator;if(U===void 0){if(E0(D))return!0;return R2(D,[[$]])}if(I===void 0){if(E0($))return!0;return R2($,[[D]])}let F=G$(D,$);return(U===">="||U===">")&&(I===">="||I===">")||(U==="<="||U==="<")&&(I==="<="||I==="<")||F===0&&((U===">="||U==="<=")&&(I===">="||I==="<="))||F===-1&&(U===">="||U===">")&&(I==="<="||I==="<")||F===1&&(U==="<="||U==="<")&&(I===">="||I===">")}function ou(D){return D.every(($)=>{return $.some((U)=>tu(U))})}function tu(D){for(let $=0;$<D.length-1;$++){let U=D[$];for(let I of D.slice($+1))if(!XN(U,I))return!1}return!0}function QN(D,$){return ou([D,$])&&D.some((U)=>{return $.some((I)=>{return U.every((F)=>{return I.every((J)=>XN(F,J))})})})}var YN=T(()=>{u$();n$();S2()});var WN=T(()=>{nF()});var BN=T(()=>{b2();b2();yF()});function P2(D){try{return s$(D),!0}catch{return!1}}var KN=T(()=>{B9()});var GN=T(()=>{B9()});var qN=T(()=>{u$()});var HN=T(()=>{n$()});var NN=T(()=>{n$()});var zN=T(()=>{Q9();u$();n$()});function M8D(D,$){return G$(D,$)>=0}var LN=T(()=>{n$()});var wN=T(()=>{Q9();u$();n$()});var ZN=T(()=>{n$()});var iF=T(()=>{n$();UN();S2();FN();yF();IN();JN();nF();B9();YN();WN();BN();KN();GN();qN();HN();NN();mF();zN();LN();hF();wN();ZN()});var A$=C((D3D,q9)=>{var MN,ON,EN,vN,VN,jN,AN,RN,SN,TN,bN,PN,CN,K9,lF,uN,kN,_N,u1,xN,gN,fN,yN,mN,hN,nN,iN,lN,G9,dN,cN,pN;(function(D){var $=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(I){D(U($,U(I)))});else if(typeof q9==="object"&&typeof D3D==="object")D(U($,U(D3D)));else D(U($));function U(I,F){if(I!==$)if(typeof Object.create==="function")Object.defineProperty(I,"__esModule",{value:!0});else I.__esModule=!0;return function(J,X){return I[J]=F?F(J,X):X}}})(function(D){var $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,X){J.__proto__=X}||function(J,X){for(var Q in X)if(Object.prototype.hasOwnProperty.call(X,Q))J[Q]=X[Q]};MN=function(J,X){if(typeof X!=="function"&&X!==null)throw TypeError("Class extends value "+String(X)+" is not a constructor or null");$(J,X);function Q(){this.constructor=J}J.prototype=X===null?Object.create(X):(Q.prototype=X.prototype,new Q)},ON=Object.assign||function(J){for(var X,Q=1,Y=arguments.length;Q<Y;Q++){X=arguments[Q];for(var W in X)if(Object.prototype.hasOwnProperty.call(X,W))J[W]=X[W]}return J},EN=function(J,X){var Q={};for(var Y in J)if(Object.prototype.hasOwnProperty.call(J,Y)&&X.indexOf(Y)<0)Q[Y]=J[Y];if(J!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var W=0,Y=Object.getOwnPropertySymbols(J);W<Y.length;W++)if(X.indexOf(Y[W])<0&&Object.prototype.propertyIsEnumerable.call(J,Y[W]))Q[Y[W]]=J[Y[W]]}return Q},vN=function(J,X,Q,Y){var W=arguments.length,B=W<3?X:Y===null?Y=Object.getOwnPropertyDescriptor(X,Q):Y,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")B=Reflect.decorate(J,X,Q,Y);else for(var q=J.length-1;q>=0;q--)if(K=J[q])B=(W<3?K(B):W>3?K(X,Q,B):K(X,Q))||B;return W>3&&B&&Object.defineProperty(X,Q,B),B},VN=function(J,X){return function(Q,Y){X(Q,Y,J)}},jN=function(J,X,Q,Y,W,B){function K(V){if(V!==void 0&&typeof V!=="function")throw TypeError("Function expected");return V}var q=Y.kind,H=q==="getter"?"get":q==="setter"?"set":"value",G=!X&&J?Y.static?J:J.prototype:null,z=X||(G?Object.getOwnPropertyDescriptor(G,Y.name):{}),N,M=!1;for(var Z=Q.length-1;Z>=0;Z--){var L={};for(var v in Y)L[v]=v==="access"?{}:Y[v];for(var v in Y.access)L.access[v]=Y.access[v];L.addInitializer=function(V){if(M)throw TypeError("Cannot add initializers after decoration has completed");B.push(K(V||null))};var A=(0,Q[Z])(q==="accessor"?{get:z.get,set:z.set}:z[H],L);if(q==="accessor"){if(A===void 0)continue;if(A===null||typeof A!=="object")throw TypeError("Object expected");if(N=K(A.get))z.get=N;if(N=K(A.set))z.set=N;if(N=K(A.init))W.unshift(N)}else if(N=K(A))if(q==="field")W.unshift(N);else z[H]=N}if(G)Object.defineProperty(G,Y.name,z);M=!0},AN=function(J,X,Q){var Y=arguments.length>2;for(var W=0;W<X.length;W++)Q=Y?X[W].call(J,Q):X[W].call(J);return Y?Q:void 0},RN=function(J){return typeof J==="symbol"?J:"".concat(J)},SN=function(J,X,Q){if(typeof X==="symbol")X=X.description?"[".concat(X.description,"]"):"";return Object.defineProperty(J,"name",{configurable:!0,value:Q?"".concat(Q," ",X):X})},TN=function(J,X){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(J,X)},bN=function(J,X,Q,Y){function W(B){return B instanceof Q?B:new Q(function(K){K(B)})}return new(Q||(Q=Promise))(function(B,K){function q(z){try{G(Y.next(z))}catch(N){K(N)}}function H(z){try{G(Y.throw(z))}catch(N){K(N)}}function G(z){z.done?B(z.value):W(z.value).then(q,H)}G((Y=Y.apply(J,X||[])).next())})},PN=function(J,X){var Q={label:0,sent:function(){if(B[0]&1)throw B[1];return B[1]},trys:[],ops:[]},Y,W,B,K=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return K.next=q(0),K.throw=q(1),K.return=q(2),typeof Symbol==="function"&&(K[Symbol.iterator]=function(){return this}),K;function q(G){return function(z){return H([G,z])}}function H(G){if(Y)throw TypeError("Generator is already executing.");while(K&&(K=0,G[0]&&(Q=0)),Q)try{if(Y=1,W&&(B=G[0]&2?W.return:G[0]?W.throw||((B=W.return)&&B.call(W),0):W.next)&&!(B=B.call(W,G[1])).done)return B;if(W=0,B)G=[G[0]&2,B.value];switch(G[0]){case 0:case 1:B=G;break;case 4:return Q.label++,{value:G[1],done:!1};case 5:Q.label++,W=G[1],G=[0];continue;case 7:G=Q.ops.pop(),Q.trys.pop();continue;default:if((B=Q.trys,!(B=B.length>0&&B[B.length-1]))&&(G[0]===6||G[0]===2)){Q=0;continue}if(G[0]===3&&(!B||G[1]>B[0]&&G[1]<B[3])){Q.label=G[1];break}if(G[0]===6&&Q.label<B[1]){Q.label=B[1],B=G;break}if(B&&Q.label<B[2]){Q.label=B[2],Q.ops.push(G);break}if(B[2])Q.ops.pop();Q.trys.pop();continue}G=X.call(J,Q)}catch(z){G=[6,z],W=0}finally{Y=B=0}if(G[0]&5)throw G[1];return{value:G[0]?G[1]:void 0,done:!0}}},CN=function(J,X){for(var Q in J)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(X,Q))G9(X,J,Q)},G9=Object.create?function(J,X,Q,Y){if(Y===void 0)Y=Q;var W=Object.getOwnPropertyDescriptor(X,Q);if(!W||("get"in W?!X.__esModule:W.writable||W.configurable))W={enumerable:!0,get:function(){return X[Q]}};Object.defineProperty(J,Y,W)}:function(J,X,Q,Y){if(Y===void 0)Y=Q;J[Y]=X[Q]},K9=function(J){var X=typeof Symbol==="function"&&Symbol.iterator,Q=X&&J[X],Y=0;if(Q)return Q.call(J);if(J&&typeof J.length==="number")return{next:function(){if(J&&Y>=J.length)J=void 0;return{value:J&&J[Y++],done:!J}}};throw TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")},lF=function(J,X){var Q=typeof Symbol==="function"&&J[Symbol.iterator];if(!Q)return J;var Y=Q.call(J),W,B=[],K;try{while((X===void 0||X-- >0)&&!(W=Y.next()).done)B.push(W.value)}catch(q){K={error:q}}finally{try{if(W&&!W.done&&(Q=Y.return))Q.call(Y)}finally{if(K)throw K.error}}return B},uN=function(){for(var J=[],X=0;X<arguments.length;X++)J=J.concat(lF(arguments[X]));return J},kN=function(){for(var J=0,X=0,Q=arguments.length;X<Q;X++)J+=arguments[X].length;for(var Y=Array(J),W=0,X=0;X<Q;X++)for(var B=arguments[X],K=0,q=B.length;K<q;K++,W++)Y[W]=B[K];return Y},_N=function(J,X,Q){if(Q||arguments.length===2){for(var Y=0,W=X.length,B;Y<W;Y++)if(B||!(Y in X)){if(!B)B=Array.prototype.slice.call(X,0,Y);B[Y]=X[Y]}}return J.concat(B||Array.prototype.slice.call(X))},u1=function(J){return this instanceof u1?(this.v=J,this):new u1(J)},xN=function(J,X,Q){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var Y=Q.apply(J,X||[]),W,B=[];return W=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),q("next"),q("throw"),q("return",K),W[Symbol.asyncIterator]=function(){return this},W;function K(Z){return function(L){return Promise.resolve(L).then(Z,N)}}function q(Z,L){if(Y[Z]){if(W[Z]=function(v){return new Promise(function(A,V){B.push([Z,v,A,V])>1||H(Z,v)})},L)W[Z]=L(W[Z])}}function H(Z,L){try{G(Y[Z](L))}catch(v){M(B[0][3],v)}}function G(Z){Z.value instanceof u1?Promise.resolve(Z.value.v).then(z,N):M(B[0][2],Z)}function z(Z){H("next",Z)}function N(Z){H("throw",Z)}function M(Z,L){if(Z(L),B.shift(),B.length)H(B[0][0],B[0][1])}},gN=function(J){var X,Q;return X={},Y("next"),Y("throw",function(W){throw W}),Y("return"),X[Symbol.iterator]=function(){return this},X;function Y(W,B){X[W]=J[W]?function(K){return(Q=!Q)?{value:u1(J[W](K)),done:!1}:B?B(K):K}:B}},fN=function(J){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var X=J[Symbol.asyncIterator],Q;return X?X.call(J):(J=typeof K9==="function"?K9(J):J[Symbol.iterator](),Q={},Y("next"),Y("throw"),Y("return"),Q[Symbol.asyncIterator]=function(){return this},Q);function Y(B){Q[B]=J[B]&&function(K){return new Promise(function(q,H){K=J[B](K),W(q,H,K.done,K.value)})}}function W(B,K,q,H){Promise.resolve(H).then(function(G){B({value:G,done:q})},K)}},yN=function(J,X){if(Object.defineProperty)Object.defineProperty(J,"raw",{value:X});else J.raw=X;return J};var U=Object.create?function(J,X){Object.defineProperty(J,"default",{enumerable:!0,value:X})}:function(J,X){J.default=X},I=function(J){return I=Object.getOwnPropertyNames||function(X){var Q=[];for(var Y in X)if(Object.prototype.hasOwnProperty.call(X,Y))Q[Q.length]=Y;return Q},I(J)};mN=function(J){if(J&&J.__esModule)return J;var X={};if(J!=null){for(var Q=I(J),Y=0;Y<Q.length;Y++)if(Q[Y]!=="default")G9(X,J,Q[Y])}return U(X,J),X},hN=function(J){return J&&J.__esModule?J:{default:J}},nN=function(J,X,Q,Y){if(Q==="a"&&!Y)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?J!==X||!Y:!X.has(J))throw TypeError("Cannot read private member from an object whose class did not declare it");return Q==="m"?Y:Q==="a"?Y.call(J):Y?Y.value:X.get(J)},iN=function(J,X,Q,Y,W){if(Y==="m")throw TypeError("Private method is not writable");if(Y==="a"&&!W)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?J!==X||!W:!X.has(J))throw TypeError("Cannot write private member to an object whose class did not declare it");return Y==="a"?W.call(J,Q):W?W.value=Q:X.set(J,Q),Q},lN=function(J,X){if(X===null||typeof X!=="object"&&typeof X!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof J==="function"?X===J:J.has(X)},dN=function(J,X,Q){if(X!==null&&X!==void 0){if(typeof X!=="object"&&typeof X!=="function")throw TypeError("Object expected.");var Y,W;if(Q){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");Y=X[Symbol.asyncDispose]}if(Y===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(Y=X[Symbol.dispose],Q)W=Y}if(typeof Y!=="function")throw TypeError("Object not disposable.");if(W)Y=function(){try{W.call(this)}catch(B){return Promise.reject(B)}};J.stack.push({value:X,dispose:Y,async:Q})}else if(Q)J.stack.push({async:!0});return X};var F=typeof SuppressedError==="function"?SuppressedError:function(J,X,Q){var Y=Error(Q);return Y.name="SuppressedError",Y.error=J,Y.suppressed=X,Y};cN=function(J){function X(B){J.error=J.hasError?new F(B,J.error,"An error was suppressed during disposal."):B,J.hasError=!0}var Q,Y=0;function W(){while(Q=J.stack.pop())try{if(!Q.async&&Y===1)return Y=0,J.stack.push(Q),Promise.resolve().then(W);if(Q.dispose){var B=Q.dispose.call(Q.value);if(Q.async)return Y|=2,Promise.resolve(B).then(W,function(K){return X(K),W()})}else Y|=1}catch(K){X(K)}if(Y===1)return J.hasError?Promise.reject(J.error):Promise.resolve();if(J.hasError)throw J.error}return W()},pN=function(J,X){if(typeof J==="string"&&/^\.\.?\//.test(J))return J.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(Q,Y,W,B,K){return Y?X?".jsx":".js":W&&(!B||!K)?Q:W+B+"."+K.toLowerCase()+"js"});return J},D("__extends",MN),D("__assign",ON),D("__rest",EN),D("__decorate",vN),D("__param",VN),D("__esDecorate",jN),D("__runInitializers",AN),D("__propKey",RN),D("__setFunctionName",SN),D("__metadata",TN),D("__awaiter",bN),D("__generator",PN),D("__exportStar",CN),D("__createBinding",G9),D("__values",K9),D("__read",lF),D("__spread",uN),D("__spreadArrays",kN),D("__spreadArray",_N),D("__await",u1),D("__asyncGenerator",xN),D("__asyncDelegator",gN),D("__asyncValues",fN),D("__makeTemplateObject",yN),D("__importStar",mN),D("__importDefault",hN),D("__classPrivateFieldGet",nN),D("__classPrivateFieldSet",iN),D("__classPrivateFieldIn",lN),D("__addDisposableResource",dN),D("__disposeResources",cN),D("__rewriteRelativeImportExtension",pN)})});var tN=C((rN)=>{Object.defineProperty(rN,"__esModule",{value:!0});rN.resolveFetch=void 0;var au=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)};rN.resolveFetch=au});var dF=C(($z)=>{Object.defineProperty($z,"__esModule",{value:!0});$z.FunctionRegion=$z.FunctionsHttpError=$z.FunctionsRelayError=$z.FunctionsFetchError=$z.FunctionsError=void 0;class C2 extends Error{constructor(D,$="FunctionsError",U){super(D);this.name=$,this.context=U}toJSON(){return{name:this.name,message:this.message,context:this.context}}}$z.FunctionsError=C2;class sN extends C2{constructor(D){super("Failed to send a request to the Edge Function","FunctionsFetchError",D)}}$z.FunctionsFetchError=sN;class eN extends C2{constructor(D){super("Relay Error invoking the Edge Function","FunctionsRelayError",D)}}$z.FunctionsRelayError=eN;class Dz extends C2{constructor(D){super("Edge Function returned a non-2xx status code","FunctionsHttpError",D)}}$z.FunctionsHttpError=Dz;var aN;(function(D){D.Any="any",D.ApNortheast1="ap-northeast-1",D.ApNortheast2="ap-northeast-2",D.ApSouth1="ap-south-1",D.ApSoutheast1="ap-southeast-1",D.ApSoutheast2="ap-southeast-2",D.CaCentral1="ca-central-1",D.EuCentral1="eu-central-1",D.EuWest1="eu-west-1",D.EuWest2="eu-west-2",D.EuWest3="eu-west-3",D.SaEast1="sa-east-1",D.UsEast1="us-east-1",D.UsWest1="us-west-1",D.UsWest2="us-west-2"})(aN||($z.FunctionRegion=aN={}))});var Xz=C((Iz)=>{Object.defineProperty(Iz,"__esModule",{value:!0});Iz.FunctionsClient=void 0;var Uk=A$(),Fk=tN(),k1=dF();class Fz{constructor(D,{headers:$={},customFetch:U,region:I=k1.FunctionRegion.Any}={}){this.url=D,this.headers=$,this.region=I,this.fetch=(0,Fk.resolveFetch)(U)}setAuth(D){this.headers.Authorization=`Bearer ${D}`}invoke(D){return Uk.__awaiter(this,arguments,void 0,function*($,U={}){var I,F;let J,X,Q;try{let{headers:Y,method:W,body:B,signal:K,timeout:q}=U,H={},{region:G}=U;if(!G)G=this.region;let z=new URL(`${this.url}/${$}`);if(G&&G!=="any")H["x-region"]=G,z.searchParams.set("forceFunctionRegion",G);let N,M=!!Y&&Object.keys(Y).some((b)=>b.toLowerCase()==="content-type");if(B&&!M)if(typeof Blob<"u"&&B instanceof Blob||B instanceof ArrayBuffer)H["Content-Type"]="application/octet-stream",N=B;else if(typeof B==="string")H["Content-Type"]="text/plain",N=B;else if(typeof FormData<"u"&&B instanceof FormData)N=B;else H["Content-Type"]="application/json",N=JSON.stringify(B);else if(B&&typeof B!=="string"&&!(typeof Blob<"u"&&B instanceof Blob)&&!(B instanceof ArrayBuffer)&&!(typeof FormData<"u"&&B instanceof FormData))N=JSON.stringify(B);else N=B;let Z=K;if(q)if(X=new AbortController,J=setTimeout(()=>X.abort(),q),K)Z=X.signal,Q=()=>X.abort(),K.addEventListener("abort",Q);else Z=X.signal;let L=yield this.fetch(z.toString(),{method:W||"POST",headers:Object.assign(Object.assign(Object.assign({},H),this.headers),Y),body:N,signal:Z}).catch((b)=>{throw new k1.FunctionsFetchError(b)}),v=L.headers.get("x-relay-error");if(v&&v==="true")throw new k1.FunctionsRelayError(L);if(!L.ok)throw new k1.FunctionsHttpError(L);let A=((I=L.headers.get("Content-Type"))!==null&&I!==void 0?I:"text/plain").split(";")[0].trim().toLowerCase(),V;if(A==="application/json")V=yield L.json();else if(A==="application/octet-stream"||A==="application/pdf")V=yield L.blob();else if(A==="text/event-stream")V=L;else if(A==="multipart/form-data")V=yield L.formData();else V=yield L.text();return{data:V,error:null,response:L}}catch(Y){return{data:null,error:Y,response:Y instanceof k1.FunctionsHttpError||Y instanceof k1.FunctionsRelayError?Y.context:void 0}}finally{if(J)clearTimeout(J);if(Q)(F=U.signal)===null||F===void 0||F.removeEventListener("abort",Q)}})}}Iz.FunctionsClient=Fz});var Qz=C((m0)=>{Object.defineProperty(m0,"__esModule",{value:!0});m0.FunctionRegion=m0.FunctionsRelayError=m0.FunctionsHttpError=m0.FunctionsFetchError=m0.FunctionsError=m0.FunctionsClient=void 0;var Ik=Xz();Object.defineProperty(m0,"FunctionsClient",{enumerable:!0,get:function(){return Ik.FunctionsClient}});var u2=dF();Object.defineProperty(m0,"FunctionsError",{enumerable:!0,get:function(){return u2.FunctionsError}});Object.defineProperty(m0,"FunctionsFetchError",{enumerable:!0,get:function(){return u2.FunctionsFetchError}});Object.defineProperty(m0,"FunctionsHttpError",{enumerable:!0,get:function(){return u2.FunctionsHttpError}});Object.defineProperty(m0,"FunctionsRelayError",{enumerable:!0,get:function(){return u2.FunctionsRelayError}});Object.defineProperty(m0,"FunctionRegion",{enumerable:!0,get:function(){return u2.FunctionRegion}})});function Wz(D,$){return new Promise((U)=>{if($===null||$===void 0?void 0:$.aborted){U();return}let I=setTimeout(()=>{$===null||$===void 0||$.removeEventListener("abort",F),U()},D);function F(){clearTimeout(I),U()}$===null||$===void 0||$.addEventListener("abort",F)})}function Qk(D,$,U,I){if(!I||U>=3)return!1;if(!Gz.includes(D))return!1;if(!Xk.includes($))return!1;return!0}function k2(D){return k2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},k2(D)}function Kk(D,$){if(k2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(k2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function Gk(D){var $=Kk(D,"string");return k2($)=="symbol"?$:$+""}function qk(D,$,U){return($=Gk($))in D?Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[$]=U,D}function Kz(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function H9(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Kz(Object(U),!0).forEach(function(I){qk(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Kz(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}var Yz=(D)=>Math.min(1000*2**D,30000),Xk,Gz,cF,Yk=class{constructor(D){var $,U,I,F,J;if(this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=D.method,this.url=D.url,this.headers=new Headers(D.headers),this.schema=D.schema,this.body=D.body,this.shouldThrowOnError=($=D.shouldThrowOnError)!==null&&$!==void 0?$:!1,this.signal=D.signal,this.isMaybeSingle=(U=D.isMaybeSingle)!==null&&U!==void 0?U:!1,this.shouldStripNulls=(I=D.shouldStripNulls)!==null&&I!==void 0?I:!1,this.urlLengthLimit=(F=D.urlLengthLimit)!==null&&F!==void 0?F:8000,this.retryEnabled=(J=D.retry)!==null&&J!==void 0?J:!0,D.fetch)this.fetch=D.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(D,$){return this.headers=new Headers(this.headers),this.headers.set(D,$),this}retry(D){return this.retryEnabled=D,this}then(D,$){var U=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");if(this.shouldStripNulls){let X=this.headers.get("Accept");if(X==="application/vnd.pgrst.object+json")this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped");else if(!X||X==="application/json")this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let I=this.fetch,J=(async()=>{let X=0;while(!0){let W={};if(U.headers.forEach((K,q)=>{W[q]=K}),X>0)W["X-Retry-Count"]=String(X);let B;try{B=await I(U.url.toString(),{method:U.method,headers:W,body:JSON.stringify(U.body,(K,q)=>typeof q==="bigint"?q.toString():q),signal:U.signal})}catch(K){if((K===null||K===void 0?void 0:K.name)==="AbortError"||(K===null||K===void 0?void 0:K.code)==="ABORT_ERR")throw K;if(!Gz.includes(U.method))throw K;if(U.retryEnabled&&X<3){let q=Yz(X);X++,await Wz(q,U.signal);continue}throw K}if(Qk(U.method,B.status,X,U.retryEnabled)){var Q,Y;let K=(Q=(Y=B.headers)===null||Y===void 0?void 0:Y.get("Retry-After"))!==null&&Q!==void 0?Q:null,q=K!==null?Math.max(0,parseInt(K,10)||0)*1000:Yz(X);await B.text(),X++,await Wz(q,U.signal);continue}return await U.processResponse(B)}})();if(!this.shouldThrowOnError)J=J.catch((X)=>{var Q;let Y="",W="",B="",K=X===null||X===void 0?void 0:X.cause;if(K){var q,H,G,z;let Z=(q=K===null||K===void 0?void 0:K.message)!==null&&q!==void 0?q:"",L=(H=K===null||K===void 0?void 0:K.code)!==null&&H!==void 0?H:"";if(Y=`${(G=X===null||X===void 0?void 0:X.name)!==null&&G!==void 0?G:"FetchError"}: ${X===null||X===void 0?void 0:X.message}`,Y+=`
|
|
70
70
|
|
|
71
71
|
Caused by: ${(z=K===null||K===void 0?void 0:K.name)!==null&&z!==void 0?z:"Error"}: ${Z}`,L)Y+=` (${L})`;if(K===null||K===void 0?void 0:K.stack)Y+=`
|
|
72
|
-
${K.stack}`}else{var N;Y=(N=X===null||X===void 0?void 0:X.stack)!==null&&N!==void 0?N:""}let M=this.url.toString().length;if((X===null||X===void 0?void 0:X.name)==="AbortError"||(X===null||X===void 0?void 0:X.code)==="ABORT_ERR"){if(B="",W="Request was aborted (timeout or manual cancellation)",M>this.urlLengthLimit)W+=`. Note: Your request URL is ${M} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`}else if((K===null||K===void 0?void 0:K.name)==="HeadersOverflowError"||(K===null||K===void 0?void 0:K.code)==="UND_ERR_HEADERS_OVERFLOW"){if(B="",W="HTTP headers exceeded server limits (typically 16KB)",M>this.urlLengthLimit)W+=`. Your request URL is ${M} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`}return{success:!1,error:{message:`${(Q=X===null||X===void 0?void 0:X.name)!==null&&Q!==void 0?Q:"FetchError"}: ${X===null||X===void 0?void 0:X.message}`,details:Y,hint:W,code:B},data:null,count:null,status:0,statusText:""}});return J.then(D,$)}async processResponse(D){var $=this;let U=null,I=null,F=null,J=D.status,X=D.statusText;if(D.ok){var Q,Y;if($.method!=="HEAD"){var W;let q=await D.text();if(q==="");else if($.headers.get("Accept")==="text/csv")I=q;else if($.headers.get("Accept")&&((W=$.headers.get("Accept"))===null||W===void 0?void 0:W.includes("application/vnd.pgrst.plan+text")))I=q;else try{I=JSON.parse(q)}catch(H){if(U={message:q},I=null,$.shouldThrowOnError)throw new cF({message:q,details:"",hint:"",code:""})}}let B=(Q=$.headers.get("Prefer"))===null||Q===void 0?void 0:Q.match(/count=(exact|planned|estimated)/),K=(Y=D.headers.get("content-range"))===null||Y===void 0?void 0:Y.split("/");if(B&&K&&K.length>1)F=parseInt(K[1]);if($.isMaybeSingle&&Array.isArray(I))if(I.length>1)U={code:"PGRST116",details:`Results contain ${I.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},I=null,F=null,J=406,X="Not Acceptable";else if(I.length===1)I=I[0];else I=null}else{let B=await D.text();try{if(U=JSON.parse(B),Array.isArray(U)&&D.status===404)I=[],U=null,J=200,X="OK"}catch(K){if(D.status===404&&B==="")J=204,X="No Content";else U={message:B}}if(U&&$.shouldThrowOnError)throw new cF(U)}return{success:U===null,error:U,data:I,count:F,status:J,statusText:X}}returns(){return this}overrideTypes(){return this}},Wk,Bz,_1,Bk=class{constructor(D,{headers:$={},schema:U,fetch:I,urlLengthLimit:F=8000,retry:J}){this.url=D,this.headers=new Headers($),this.schema=U,this.fetch=I,this.urlLengthLimit=F,this.retry=J}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(D,$){let{head:U=!1,count:I}=$!==null&&$!==void 0?$:{},F=U?"HEAD":"GET",J=!1,X=(D!==null&&D!==void 0?D:"*").split("").map((W)=>{if(/\s/.test(W)&&!J)return"";if(W==='"')J=!J;return W}).join(""),{url:Q,headers:Y}=this.cloneRequestState();if(Q.searchParams.set("select",X),I)Y.append("Prefer",`count=${I}`);return new _1({method:F,url:Q,headers:Y,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(D,{count:$,defaultToNull:U=!0}={}){var I;let F="POST",{url:J,headers:X}=this.cloneRequestState();if($)X.append("Prefer",`count=${$}`);if(!U)X.append("Prefer","missing=default");if(Array.isArray(D)){let Q=D.reduce((Y,W)=>Y.concat(Object.keys(W)),[]);if(Q.length>0){let Y=[...new Set(Q)].map((W)=>`"${W}"`);J.searchParams.set("columns",Y.join(","))}}return new _1({method:"POST",url:J,headers:X,schema:this.schema,body:D,fetch:(I=this.fetch)!==null&&I!==void 0?I:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(D,{onConflict:$,ignoreDuplicates:U=!1,count:I,defaultToNull:F=!0}={}){var J;let X="POST",{url:Q,headers:Y}=this.cloneRequestState();if(Y.append("Prefer",`resolution=${U?"ignore":"merge"}-duplicates`),$!==void 0)Q.searchParams.set("on_conflict",$);if(I)Y.append("Prefer",`count=${I}`);if(!F)Y.append("Prefer","missing=default");if(Array.isArray(D)){let W=D.reduce((B,K)=>B.concat(Object.keys(K)),[]);if(W.length>0){let B=[...new Set(W)].map((K)=>`"${K}"`);Q.searchParams.set("columns",B.join(","))}}return new _1({method:"POST",url:Q,headers:Y,schema:this.schema,body:D,fetch:(J=this.fetch)!==null&&J!==void 0?J:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(D,{count:$}={}){var U;let I="PATCH",{url:F,headers:J}=this.cloneRequestState();if($)J.append("Prefer",`count=${$}`);return new _1({method:"PATCH",url:F,headers:J,schema:this.schema,body:D,fetch:(U=this.fetch)!==null&&U!==void 0?U:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:D}={}){var $;let U="DELETE",{url:I,headers:F}=this.cloneRequestState();if(D)F.append("Prefer",`count=${D}`);return new _1({method:"DELETE",url:I,headers:F,schema:this.schema,fetch:($=this.fetch)!==null&&$!==void 0?$:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},qz=class D{constructor($,{headers:U={},schema:I,fetch:F,timeout:J,urlLengthLimit:X=8000,retry:Q}={}){this.url=$,this.headers=new Headers(U),this.schemaName=I,this.urlLengthLimit=X;let Y=F!==null&&F!==void 0?F:globalThis.fetch;if(J!==void 0&&J>0)this.fetch=(W,B)=>{let K=new AbortController,q=setTimeout(()=>K.abort(),J),H=B===null||B===void 0?void 0:B.signal;if(H){if(H.aborted)return clearTimeout(q),Y(W,B);let G=()=>{clearTimeout(q),K.abort()};return H.addEventListener("abort",G,{once:!0}),Y(W,H9(H9({},B),{},{signal:K.signal})).finally(()=>{clearTimeout(q),H.removeEventListener("abort",G)})}return Y(W,H9(H9({},B),{},{signal:K.signal})).finally(()=>clearTimeout(q))};else this.fetch=Y;this.retry=Q}from($){if(!$||typeof $!=="string"||$.trim()==="")throw Error("Invalid relation name: relation must be a non-empty string.");return new Bk(new URL(`${this.url}/${$}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema($){return new D(this.url,{headers:this.headers,schema:$,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc($,U={},{head:I=!1,get:F=!1,count:J}={}){var X;let Q,Y=new URL(`${this.url}/rpc/${$}`),W,B=(H)=>H!==null&&typeof H==="object"&&(!Array.isArray(H)||H.some(B)),K=I&&Object.values(U).some(B);if(K)Q="POST",W=U;else if(I||F)Q=I?"HEAD":"GET",Object.entries(U).filter(([H,G])=>G!==void 0).map(([H,G])=>[H,Array.isArray(G)?`{${G.join(",")}}`:`${G}`]).forEach(([H,G])=>{Y.searchParams.append(H,G)});else Q="POST",W=U;let q=new Headers(this.headers);if(K)q.set("Prefer",J?`count=${J},return=minimal`:"return=minimal");else if(J)q.set("Prefer",`count=${J}`);return new _1({method:Q,url:Y,headers:q,schema:this.schemaName,body:W,fetch:(X=this.fetch)!==null&&X!==void 0?X:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};var Hz=T(()=>{Xk=[520,503],Gz=["GET","HEAD","OPTIONS"],cF=class extends Error{constructor(D){super(D.message);this.name="PostgrestError",this.details=D.details,this.hint=D.hint,this.code=D.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};Wk=class extends Yk{throwOnError(){return super.throwOnError()}select(D){let $=!1,U=(D!==null&&D!==void 0?D:"*").split("").map((I)=>{if(/\s/.test(I)&&!$)return"";if(I==='"')$=!$;return I}).join("");return this.url.searchParams.set("select",U),this.headers.append("Prefer","return=representation"),this}order(D,{ascending:$=!0,nullsFirst:U,foreignTable:I,referencedTable:F=I}={}){let J=F?`${F}.order`:"order",X=this.url.searchParams.get(J);return this.url.searchParams.set(J,`${X?`${X},`:""}${D}.${$?"asc":"desc"}${U===void 0?"":U?".nullsfirst":".nullslast"}`),this}limit(D,{foreignTable:$,referencedTable:U=$}={}){let I=typeof U>"u"?"limit":`${U}.limit`;return this.url.searchParams.set(I,`${D}`),this}range(D,$,{foreignTable:U,referencedTable:I=U}={}){let F=typeof I>"u"?"offset":`${I}.offset`,J=typeof I>"u"?"limit":`${I}.limit`;return this.url.searchParams.set(F,`${D}`),this.url.searchParams.set(J,`${$-D+1}`),this}abortSignal(D){return this.signal=D,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:D=!1,verbose:$=!1,settings:U=!1,buffers:I=!1,wal:F=!1,format:J="text"}={}){var X;let Q=[D?"analyze":null,$?"verbose":null,U?"settings":null,I?"buffers":null,F?"wal":null].filter(Boolean).join("|"),Y=(X=this.headers.get("Accept"))!==null&&X!==void 0?X:"application/json";if(this.headers.set("Accept",`application/vnd.pgrst.plan+${J}; for="${Y}"; options=${Q};`),J==="json")return this;else return this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(D){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${D}`),this}},Bz=new RegExp("[,()]"),_1=class extends Wk{throwOnError(){return super.throwOnError()}eq(D,$){return this.url.searchParams.append(D,`eq.${$}`),this}neq(D,$){return this.url.searchParams.append(D,`neq.${$}`),this}gt(D,$){return this.url.searchParams.append(D,`gt.${$}`),this}gte(D,$){return this.url.searchParams.append(D,`gte.${$}`),this}lt(D,$){return this.url.searchParams.append(D,`lt.${$}`),this}lte(D,$){return this.url.searchParams.append(D,`lte.${$}`),this}like(D,$){return this.url.searchParams.append(D,`like.${$}`),this}likeAllOf(D,$){return this.url.searchParams.append(D,`like(all).{${$.join(",")}}`),this}likeAnyOf(D,$){return this.url.searchParams.append(D,`like(any).{${$.join(",")}}`),this}ilike(D,$){return this.url.searchParams.append(D,`ilike.${$}`),this}ilikeAllOf(D,$){return this.url.searchParams.append(D,`ilike(all).{${$.join(",")}}`),this}ilikeAnyOf(D,$){return this.url.searchParams.append(D,`ilike(any).{${$.join(",")}}`),this}regexMatch(D,$){return this.url.searchParams.append(D,`match.${$}`),this}regexIMatch(D,$){return this.url.searchParams.append(D,`imatch.${$}`),this}is(D,$){return this.url.searchParams.append(D,`is.${$}`),this}isDistinct(D,$){return this.url.searchParams.append(D,`isdistinct.${$}`),this}in(D,$){let U=Array.from(new Set($)).map((I)=>{if(typeof I==="string"&&Bz.test(I))return`"${I}"`;else return`${I}`}).join(",");return this.url.searchParams.append(D,`in.(${U})`),this}notIn(D,$){let U=Array.from(new Set($)).map((I)=>{if(typeof I==="string"&&Bz.test(I))return`"${I}"`;else return`${I}`}).join(",");return this.url.searchParams.append(D,`not.in.(${U})`),this}contains(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cs.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cs.{${$.join(",")}}`);else this.url.searchParams.append(D,`cs.${JSON.stringify($)}`);return this}containedBy(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cd.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cd.{${$.join(",")}}`);else this.url.searchParams.append(D,`cd.${JSON.stringify($)}`);return this}rangeGt(D,$){return this.url.searchParams.append(D,`sr.${$}`),this}rangeGte(D,$){return this.url.searchParams.append(D,`nxl.${$}`),this}rangeLt(D,$){return this.url.searchParams.append(D,`sl.${$}`),this}rangeLte(D,$){return this.url.searchParams.append(D,`nxr.${$}`),this}rangeAdjacent(D,$){return this.url.searchParams.append(D,`adj.${$}`),this}overlaps(D,$){if(typeof $==="string")this.url.searchParams.append(D,`ov.${$}`);else this.url.searchParams.append(D,`ov.{${$.join(",")}}`);return this}textSearch(D,$,{config:U,type:I}={}){let F="";if(I==="plain")F="pl";else if(I==="phrase")F="ph";else if(I==="websearch")F="w";let J=U===void 0?"":`(${U})`;return this.url.searchParams.append(D,`${F}fts${J}.${$}`),this}match(D){return Object.entries(D).filter(([$,U])=>U!==void 0).forEach(([$,U])=>{this.url.searchParams.append($,`eq.${U}`)}),this}not(D,$,U){return this.url.searchParams.append(D,`not.${$}.${U}`),this}or(D,{foreignTable:$,referencedTable:U=$}={}){let I=U?`${U}.or`:"or";return this.url.searchParams.append(I,`(${D})`),this}filter(D,$,U){return this.url.searchParams.append(D,`${$}.${U}`),this}}});class pF{constructor(){}connect(){}disconnect(){}}function Hk(D,$,U){let I=new URL($,D);if(U){for(let[F,J]of Object.entries(U))if(J!==void 0)I.searchParams.set(F,J)}return I.toString()}async function Nk(D){if(!D||D.type==="none")return{};if(D.type==="bearer")return{Authorization:`Bearer ${D.token}`};if(D.type==="header")return{[D.name]:D.value};if(D.type==="custom")return await D.getHeaders();return{}}function zk(D){let $=D.fetchImpl??globalThis.fetch;return{async request({method:U,path:I,query:F,body:J,headers:X}){let Q=Hk(D.baseUrl,I,F),Y=await Nk(D.auth),W=await $(Q,{method:U,headers:{...J?{"Content-Type":"application/json"}:{},...Y,...X},body:J?JSON.stringify(J):void 0}),B=await W.text(),K=(W.headers.get("content-type")||"").includes("application/json"),q=K&&B?JSON.parse(B):B;if(!W.ok){let H=K?q:void 0,G=H?.error;throw new _2(G?.message??`Request failed with status ${W.status}`,{status:W.status,icebergType:G?.type,icebergCode:G?.code,details:H})}return{status:W.status,headers:W.headers,data:q}}}}function N9(D){return D.join("\x1F")}function x1(D){return D.join("\x1F")}var _2,Lk=class{constructor(D,$=""){this.client=D,this.prefix=$}async listNamespaces(D){let $=D?{parent:N9(D.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:$})).data.namespaces.map((I)=>({namespace:I}))}async createNamespace(D,$){let U={namespace:D.namespace,properties:$?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:U})).data}async dropNamespace(D){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${N9(D.namespace)}`})}async loadNamespaceMetadata(D){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${N9(D.namespace)}`})).data.properties}}async namespaceExists(D){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${N9(D.namespace)}`}),!0}catch($){if($ instanceof _2&&$.status===404)return!1;throw $}}async createNamespaceIfNotExists(D,$){try{return await this.createNamespace(D,$)}catch(U){if(U instanceof _2&&U.status===409)return;throw U}}},wk=class{constructor(D,$="",U){this.client=D,this.prefix=$,this.accessDelegation=U}async listTables(D){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables`})).data.identifiers}async createTable(D,$){let U={};if(this.accessDelegation)U["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables`,body:$,headers:U})).data.metadata}async updateTable(D,$){let U=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,body:$});return{"metadata-location":U.data["metadata-location"],metadata:U.data.metadata}}async dropTable(D,$){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,query:{purgeRequested:String($?.purge??!1)}})}async loadTable(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,headers:$})).data.metadata}async tableExists(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,headers:$}),!0}catch(U){if(U instanceof _2&&U.status===404)return!1;throw U}}async createTableIfNotExists(D,$){try{return await this.createTable(D,$)}catch(U){if(U instanceof _2&&U.status===409)return await this.loadTable({namespace:D.namespace,name:$.name});throw U}}},Nz=class{constructor(D){let $="v1";if(D.catalogName)$+=`/${D.catalogName}`;let U=D.baseUrl.endsWith("/")?D.baseUrl:`${D.baseUrl}/`;this.client=zk({baseUrl:U,auth:D.auth,fetchImpl:D.fetch}),this.accessDelegation=D.accessDelegation?.join(","),this.namespaceOps=new Lk(this.client,$),this.tableOps=new wk(this.client,$,this.accessDelegation)}async listNamespaces(D){return this.namespaceOps.listNamespaces(D)}async createNamespace(D,$){return this.namespaceOps.createNamespace(D,$)}async dropNamespace(D){await this.namespaceOps.dropNamespace(D)}async loadNamespaceMetadata(D){return this.namespaceOps.loadNamespaceMetadata(D)}async listTables(D){return this.tableOps.listTables(D)}async createTable(D,$){return this.tableOps.createTable(D,$)}async updateTable(D,$){return this.tableOps.updateTable(D,$)}async dropTable(D,$){await this.tableOps.dropTable(D,$)}async loadTable(D){return this.tableOps.loadTable(D)}async namespaceExists(D){return this.namespaceOps.namespaceExists(D)}async tableExists(D){return this.tableOps.tableExists(D)}async createNamespaceIfNotExists(D,$){return this.namespaceOps.createNamespaceIfNotExists(D,$)}async createTableIfNotExists(D,$){return this.tableOps.createTableIfNotExists(D,$)}};var zz=T(()=>{_2=class extends Error{constructor(D,$){super(D);this.name="IcebergError",this.status=$.status,this.icebergType=$.icebergType,this.icebergCode=$.icebergCode,this.details=$.details,this.isCommitStateUnknown=$.icebergType==="CommitStateUnknownException"||[500,502,504].includes($.status)&&$.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}}});function g2(D){return g2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},g2(D)}function Zk(D,$){if(g2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(g2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function Mk(D){var $=Zk(D,"string");return g2($)=="symbol"?$:$+""}function Ok(D,$,U){return($=Mk($))in D?Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[$]=U,D}function Lz(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function ID(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Lz(Object(U),!0).forEach(function(I){Ok(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Lz(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function Z9(D){return typeof D==="object"&&D!==null&&"__isStorageError"in D}function L9(D,$,U){let I=ID({},D),F=$.toLowerCase();for(let J of Object.keys(I))if(J.toLowerCase()===F)delete I[J];return I[F]=U,I}function Ek(D){let $={};for(let[U,I]of Object.entries(D))$[U.toLowerCase()]=I;return $}async function x2(D,$,U,I,F,J,X){return new Promise((Q,Y)=>{D(U,Rk($,I,F,J)).then((W)=>{if(!W.ok)throw W;if(I===null||I===void 0?void 0:I.noResolveJson)return W;if(X==="vectors"){let B=W.headers.get("content-type");if(W.headers.get("content-length")==="0"||W.status===204)return{};if(!B||!B.includes("application/json"))return{}}return W.json()}).then((W)=>Q(W)).catch((W)=>Ak(W,Y,I,X))})}function Ez(D="storage"){return{get:async($,U,I,F)=>{return x2($,"GET",U,I,F,void 0,D)},post:async($,U,I,F,J)=>{return x2($,"POST",U,F,J,I,D)},put:async($,U,I,F,J)=>{return x2($,"PUT",U,F,J,I,D)},head:async($,U,I,F)=>{return x2($,"HEAD",U,ID(ID({},I),{},{noResolveJson:!0}),F,void 0,D)},remove:async($,U,I,F,J)=>{return x2($,"DELETE",U,F,J,I,D)}}}var w9,z9,Mz,vk=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},Vk=(D)=>{if(typeof D!=="object"||D===null)return!1;let $=Object.getPrototypeOf(D);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in D)&&!(Symbol.iterator in D)},oF=(D)=>{if(Array.isArray(D))return D.map((U)=>oF(U));else if(typeof D==="function"||D!==Object(D))return D;let $={};return Object.entries(D).forEach(([U,I])=>{let F=U.replace(/([-_][a-z])/gi,(J)=>J.toUpperCase().replace(/[-_]/g,""));$[F]=oF(I)}),$},jk=(D)=>{if(!D||typeof D!=="string")return!1;if(D.length===0||D.length>100)return!1;if(D.trim()!==D)return!1;if(D.includes("/")||D.includes("\\"))return!1;return/^[\w!.\*'() &$@=;:+,?-]+$/.test(D)},Oz=(D)=>D.split("/").map(encodeURIComponent).join("/"),wz=(D)=>{if(typeof D==="object"&&D!==null){let $=D;if(typeof $.msg==="string")return $.msg;if(typeof $.message==="string")return $.message;if(typeof $.error_description==="string")return $.error_description;if(typeof $.error==="string")return $.error;if(typeof $.error==="object"&&$.error!==null){let U=$.error;if(typeof U.message==="string")return U.message}}return JSON.stringify(D)},Ak=async(D,$,U,I)=>{if(D!==null&&typeof D==="object"&&"json"in D&&typeof D.json==="function"){let F=D,J=parseInt(String(F.status),10);if(!Number.isFinite(J))J=500;F.json().then((X)=>{let Q=(X===null||X===void 0?void 0:X.statusCode)||(X===null||X===void 0?void 0:X.code)||J+"";$(new z9(wz(X),J,Q,I))}).catch(()=>{let X=J+"";$(new z9(F.statusText||`HTTP ${J} error`,J,X,I))})}else $(new Mz(wz(D),D,I))},Rk=(D,$,U,I)=>{let F={method:D,headers:($===null||$===void 0?void 0:$.headers)||{}};if(D==="GET"||D==="HEAD"||!I)return ID(ID({},F),U);if(Vk(I)){var J;let X=($===null||$===void 0?void 0:$.headers)||{},Q;for(let[Y,W]of Object.entries(X))if(Y.toLowerCase()==="content-type")Q=W;F.headers=L9(X,"Content-Type",(J=Q)!==null&&J!==void 0?J:"application/json"),F.body=JSON.stringify(I)}else F.body=I;if($===null||$===void 0?void 0:$.duplex)F.duplex=$.duplex;return ID(ID({},F),U)},Sk,f2,e$,tF,Tk,y2,k$,g1=class{constructor(D,$={},U,I="storage"){this.shouldThrowOnError=!1,this.url=D,this.headers=Ek($),this.fetch=vk(U),this.namespace=I}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(D,$){return this.headers=L9(this.headers,D,$),this}async handleOperation(D){var $=this;try{return{data:await D(),error:null}}catch(U){if($.shouldThrowOnError)throw U;if(Z9(U))return{data:null,error:U};throw U}}},vz,bk=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$,this[vz]="StreamDownloadBuilder",this.promise=null}then(D,$){return this.getPromise().then(D,$)}catch(D){return this.getPromise().catch(D)}finally(D){return this.getPromise().finally(D)}getPromise(){if(!this.promise)this.promise=this.execute();return this.promise}async execute(){var D=this;try{return{data:(await D.downloadFn()).body,error:null}}catch($){if(D.shouldThrowOnError)throw $;if(Z9($))return{data:null,error:$};throw $}}},Vz,Pk=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$,this[Vz]="BlobDownloadBuilder",this.promise=null}asStream(){return new bk(this.downloadFn,this.shouldThrowOnError)}then(D,$){return this.getPromise().then(D,$)}catch(D){return this.getPromise().catch(D)}finally(D){return this.getPromise().finally(D)}getPromise(){if(!this.promise)this.promise=this.execute();return this.promise}async execute(){var D=this;try{return{data:await(await D.downloadFn()).blob(),error:null}}catch($){if(D.shouldThrowOnError)throw $;if(Z9($))return{data:null,error:$};throw $}}},rF,Zz,Ck,uk="2.110.8",m2,kk,_k,xk,gk,fk,yk,mk,hk,jz;var Az=T(()=>{zz();w9=class extends Error{constructor(D,$="storage",U,I){super(D);this.__isStorageError=!0,this.namespace=$,this.name=$==="vectors"?"StorageVectorsError":"StorageError",this.status=U,this.statusCode=I}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};z9=class extends w9{constructor(D,$,U,I="storage"){super(D,I,$,U);this.name=I==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=$,this.statusCode=U}toJSON(){return ID({},super.toJSON())}},Mz=class extends w9{constructor(D,$,U="storage"){super(D,U);this.name=U==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=$}};Sk=Ez("storage"),{get:f2,post:e$,put:tF,head:Tk,remove:y2}=Sk,k$=Ez("vectors");vz=Symbol.toStringTag;Vz=Symbol.toStringTag;rF={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Zz={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Ck=class extends g1{constructor(D,$={},U,I){super(D,$,I,"storage");this.bucketId=U}async uploadOrUpdate(D,$,U,I){var F=this;return F.handleOperation(async()=>{let J,X=ID(ID({},Zz),I),Q=ID(ID({},F.headers),D==="POST"&&{"x-upsert":String(X.upsert)}),Y=X.metadata;if(typeof Blob<"u"&&U instanceof Blob){if(J=new FormData,J.append("cacheControl",X.cacheControl),Y)J.append("metadata",F.encodeMetadata(Y));J.append("",U)}else if(typeof FormData<"u"&&U instanceof FormData){if(J=U,!J.has("cacheControl"))J.append("cacheControl",X.cacheControl);if(Y&&!J.has("metadata"))J.append("metadata",F.encodeMetadata(Y))}else{if(J=U,Q["cache-control"]=`max-age=${X.cacheControl}`,Q["content-type"]=X.contentType,Y)Q["x-metadata"]=F.toBase64(F.encodeMetadata(Y));if((typeof ReadableStream<"u"&&J instanceof ReadableStream||J&&typeof J==="object"&&("pipe"in J)&&typeof J.pipe==="function")&&!X.duplex)X.duplex="half"}if(I===null||I===void 0?void 0:I.headers)for(let[q,H]of Object.entries(I.headers))Q=L9(Q,q,H);let W=F._removeEmptyFolders($),B=F._getFinalPath(W),K=await(D=="PUT"?tF:e$)(F.fetch,`${F.url}/object/${B}`,J,ID({headers:Q},(X===null||X===void 0?void 0:X.duplex)?{duplex:X.duplex}:{}));return{path:W,id:K.Id,fullPath:K.Key}})}async upload(D,$,U){return this.uploadOrUpdate("POST",D,$,U)}async uploadToSignedUrl(D,$,U,I){var F=this;let J=F._removeEmptyFolders(D),X=F._getFinalPath(J),Q=new URL(F.url+`/object/upload/sign/${X}`);return Q.searchParams.set("token",$),F.handleOperation(async()=>{let Y,W=ID(ID({},Zz),I),B=ID(ID({},F.headers),{"x-upsert":String(W.upsert)}),K=W.metadata;if(typeof Blob<"u"&&U instanceof Blob){if(Y=new FormData,Y.append("cacheControl",W.cacheControl),K)Y.append("metadata",F.encodeMetadata(K));Y.append("",U)}else if(typeof FormData<"u"&&U instanceof FormData){if(Y=U,!Y.has("cacheControl"))Y.append("cacheControl",W.cacheControl);if(K&&!Y.has("metadata"))Y.append("metadata",F.encodeMetadata(K))}else{if(Y=U,B["cache-control"]=`max-age=${W.cacheControl}`,B["content-type"]=W.contentType,K)B["x-metadata"]=F.toBase64(F.encodeMetadata(K));if((typeof ReadableStream<"u"&&Y instanceof ReadableStream||Y&&typeof Y==="object"&&("pipe"in Y)&&typeof Y.pipe==="function")&&!W.duplex)W.duplex="half"}if(I===null||I===void 0?void 0:I.headers)for(let[q,H]of Object.entries(I.headers))B=L9(B,q,H);return{path:J,fullPath:(await tF(F.fetch,Q.toString(),Y,ID({headers:B},(W===null||W===void 0?void 0:W.duplex)?{duplex:W.duplex}:{}))).Key}})}async createSignedUploadUrl(D,$){var U=this;return U.handleOperation(async()=>{let I=U._getFinalPath(D),F=ID({},U.headers);if($===null||$===void 0?void 0:$.upsert)F["x-upsert"]="true";let J=await e$(U.fetch,`${U.url}/object/upload/sign/${I}`,{},{headers:F}),X=new URL(U.url+J.url),Q=X.searchParams.get("token");if(!Q)throw new w9("No token returned by API");return{signedUrl:X.toString(),path:D,token:Q}})}async update(D,$,U){return this.uploadOrUpdate("PUT",D,$,U)}async move(D,$,U){var I=this;return I.handleOperation(async()=>{return await e$(I.fetch,`${I.url}/object/move`,{bucketId:I.bucketId,sourceKey:D,destinationKey:$,destinationBucket:U===null||U===void 0?void 0:U.destinationBucket},{headers:I.headers})})}async copy(D,$,U){var I=this;return I.handleOperation(async()=>{return{path:(await e$(I.fetch,`${I.url}/object/copy`,{bucketId:I.bucketId,sourceKey:D,destinationKey:$,destinationBucket:U===null||U===void 0?void 0:U.destinationBucket},{headers:I.headers})).Key}})}async createSignedUrl(D,$,U){var I=this;return I.handleOperation(async()=>{let F=I._getFinalPath(D),J=typeof(U===null||U===void 0?void 0:U.transform)==="object"&&U.transform!==null&&Object.keys(U.transform).length>0,X=await e$(I.fetch,`${I.url}/object/sign/${F}`,ID({expiresIn:$},J?{transform:U.transform}:{}),{headers:I.headers}),Q=new URLSearchParams;if(U===null||U===void 0?void 0:U.download)Q.set("download",U.download===!0?"":U.download);if((U===null||U===void 0?void 0:U.cacheNonce)!=null)Q.set("cacheNonce",String(U.cacheNonce));let Y=Q.toString();return{signedUrl:encodeURI(`${I.url}${X.signedURL}${Y?`&${Y}`:""}`)}})}async createSignedUrls(D,$,U){var I=this;return I.handleOperation(async()=>{let F=await e$(I.fetch,`${I.url}/object/sign/${I.bucketId}`,{expiresIn:$,paths:D},{headers:I.headers}),J=new URLSearchParams;if(U===null||U===void 0?void 0:U.download)J.set("download",U.download===!0?"":U.download);if((U===null||U===void 0?void 0:U.cacheNonce)!=null)J.set("cacheNonce",String(U.cacheNonce));let X=J.toString();return F.map((Q)=>ID(ID({},Q),{},{signedUrl:Q.signedURL?encodeURI(`${I.url}${Q.signedURL}${X?`&${X}`:""}`):null}))})}download(D,$,U){let I=typeof($===null||$===void 0?void 0:$.transform)==="object"&&$.transform!==null&&Object.keys($.transform).length>0?"render/image/authenticated":"object",F=new URLSearchParams;if($===null||$===void 0?void 0:$.transform)this.applyTransformOptsToQuery(F,$.transform);if(($===null||$===void 0?void 0:$.cacheNonce)!=null)F.set("cacheNonce",String($.cacheNonce));let J=F.toString(),X=this._getFinalPath(D);return new Pk(()=>f2(this.fetch,`${this.url}/${I}/${X}${J?`?${J}`:""}`,{headers:this.headers,noResolveJson:!0},U),this.shouldThrowOnError)}async info(D){var $=this;let U=$._getFinalPath(D);return $.handleOperation(async()=>{return oF(await f2($.fetch,`${$.url}/object/info/${U}`,{headers:$.headers}))})}async exists(D){var $=this;let U=$._getFinalPath(D);try{return await Tk($.fetch,`${$.url}/object/${U}`,{headers:$.headers}),{data:!0,error:null}}catch(F){if($.shouldThrowOnError)throw F;if(Z9(F)){var I;let J=F instanceof z9?F.status:F instanceof Mz?(I=F.originalError)===null||I===void 0?void 0:I.status:void 0;if(J!==void 0&&[400,404].includes(J))return{data:!1,error:F}}throw F}}getPublicUrl(D,$){let U=this._getFinalPath(D),I=new URLSearchParams;if($===null||$===void 0?void 0:$.download)I.set("download",$.download===!0?"":$.download);if($===null||$===void 0?void 0:$.transform)this.applyTransformOptsToQuery(I,$.transform);if(($===null||$===void 0?void 0:$.cacheNonce)!=null)I.set("cacheNonce",String($.cacheNonce));let F=I.toString(),J=typeof($===null||$===void 0?void 0:$.transform)==="object"&&$.transform!==null&&Object.keys($.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${J}/public/${U}`)+(F?`?${F}`:"")}}}async remove(D){var $=this;return $.handleOperation(async()=>{return await y2($.fetch,`${$.url}/object/${$.bucketId}`,{prefixes:D},{headers:$.headers})})}async purgeCache(D,$,U){var I=this;return I.handleOperation(async()=>{let F=Oz(I._getFinalPath(D)),J=new URLSearchParams;if($===null||$===void 0?void 0:$.transformations)J.set("transformations","true");let X=J.toString();return await y2(I.fetch,`${I.url}/cdn/${F}${X?`?${X}`:""}`,{},{headers:I.headers},U)})}async list(D,$,U){var I=this;return I.handleOperation(async()=>{let F=($===null||$===void 0?void 0:$.sortBy)?ID(ID({},rF.sortBy),$.sortBy):rF.sortBy,J=ID(ID(ID({},rF),$),{},{sortBy:F,prefix:D||""});return await e$(I.fetch,`${I.url}/object/list/${I.bucketId}`,J,{headers:I.headers},U)})}async listV2(D,$){var U=this;return U.handleOperation(async()=>{let I=ID({},D);return await e$(U.fetch,`${U.url}/object/list-v2/${U.bucketId}`,I,{headers:U.headers},$)})}encodeMetadata(D){return JSON.stringify(D)}toBase64(D){if(typeof Buffer<"u")return Buffer.from(D).toString("base64");return btoa(D)}_getFinalPath(D){return`${this.bucketId}/${D.replace(/^\/+/,"")}`}_removeEmptyFolders(D){return D.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(D,$){if($.width)D.set("width",$.width.toString());if($.height)D.set("height",$.height.toString());if($.resize)D.set("resize",$.resize);if($.format)D.set("format",$.format);if($.quality)D.set("quality",$.quality.toString());return D}},m2={"X-Client-Info":`storage-js/${uk}`},kk=class extends g1{constructor(D,$={},U,I){let F=new URL(D);if(I===null||I===void 0?void 0:I.useNewHostname){if(/supabase\.(co|in|red)$/.test(F.hostname)&&!F.hostname.includes("storage.supabase."))F.hostname=F.hostname.replace("supabase.","storage.supabase.")}let J=F.href.replace(/\/$/,""),X=ID(ID({},m2),$);super(J,X,U,"storage")}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let U=$.listBucketOptionsToQueryString(D);return await f2($.fetch,`${$.url}/bucket${U}`,{headers:$.headers})})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await f2($.fetch,`${$.url}/bucket/${D}`,{headers:$.headers})})}async createBucket(D,$={public:!1}){var U=this;return U.handleOperation(async()=>{return await e$(U.fetch,`${U.url}/bucket`,{id:D,name:D,type:$.type,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:U.headers})})}async updateBucket(D,$){var U=this;return U.handleOperation(async()=>{return await tF(U.fetch,`${U.url}/bucket/${D}`,{id:D,name:D,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:U.headers})})}async emptyBucket(D){var $=this;return $.handleOperation(async()=>{return await e$($.fetch,`${$.url}/bucket/${D}/empty`,{},{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await y2($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}async purgeBucketCache(D,$,U){var I=this;return I.handleOperation(async()=>{let F=new URLSearchParams;if($===null||$===void 0?void 0:$.transformations)F.set("transformations","true");let J=F.toString();return await y2(I.fetch,`${I.url}/cdn/${Oz(D)}${J?`?${J}`:""}`,{},{headers:I.headers},U)})}listBucketOptionsToQueryString(D){let $={};if(D){if("limit"in D)$.limit=String(D.limit);if("offset"in D)$.offset=String(D.offset);if(D.search)$.search=D.search;if(D.sortColumn)$.sortColumn=D.sortColumn;if(D.sortOrder)$.sortOrder=D.sortOrder}return Object.keys($).length>0?"?"+new URLSearchParams($).toString():""}},_k=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),$);super(I,F,U,"storage")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await e$($.fetch,`${$.url}/bucket`,{name:D},{headers:$.headers})})}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let U=new URLSearchParams;if((D===null||D===void 0?void 0:D.limit)!==void 0)U.set("limit",D.limit.toString());if((D===null||D===void 0?void 0:D.offset)!==void 0)U.set("offset",D.offset.toString());if(D===null||D===void 0?void 0:D.sortColumn)U.set("sortColumn",D.sortColumn);if(D===null||D===void 0?void 0:D.sortOrder)U.set("sortOrder",D.sortOrder);if(D===null||D===void 0?void 0:D.search)U.set("search",D.search);let I=U.toString(),F=I?`${$.url}/bucket?${I}`:`${$.url}/bucket`;return await f2($.fetch,F,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await y2($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}from(D){var $=this;if(!jk(D))throw new w9("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let U=new Nz({baseUrl:this.url,catalogName:D,auth:{type:"custom",getHeaders:async()=>$.headers},fetch:this.fetch}),I=this.shouldThrowOnError;return new Proxy(U,{get(F,J){let X=F[J];if(typeof X!=="function")return X;return async(...Q)=>{try{return{data:await X.apply(F,Q),error:null}}catch(Y){if(I)throw Y;return{data:null,error:Y}}}}})}},xk=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),{},{"Content-Type":"application/json"},$);super(I,F,U,"vectors")}async createIndex(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/CreateIndex`,D,{headers:$.headers})||{}})}async getIndex(D,$){var U=this;return U.handleOperation(async()=>{return await k$.post(U.fetch,`${U.url}/GetIndex`,{vectorBucketName:D,indexName:$},{headers:U.headers})})}async listIndexes(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/ListIndexes`,D,{headers:$.headers})})}async deleteIndex(D,$){var U=this;return U.handleOperation(async()=>{return await k$.post(U.fetch,`${U.url}/DeleteIndex`,{vectorBucketName:D,indexName:$},{headers:U.headers})||{}})}},gk=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),{},{"Content-Type":"application/json"},$);super(I,F,U,"vectors")}async putVectors(D){var $=this;if(D.vectors.length<1||D.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/PutVectors`,D,{headers:$.headers})||{}})}async getVectors(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/GetVectors`,D,{headers:$.headers})})}async listVectors(D){var $=this;if(D.segmentCount!==void 0){if(D.segmentCount<1||D.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(D.segmentIndex!==void 0){if(D.segmentIndex<0||D.segmentIndex>=D.segmentCount)throw Error(`segmentIndex must be between 0 and ${D.segmentCount-1}`)}}return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/ListVectors`,D,{headers:$.headers})})}async queryVectors(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/QueryVectors`,D,{headers:$.headers})})}async deleteVectors(D){var $=this;if(D.keys.length<1||D.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/DeleteVectors`,D,{headers:$.headers})||{}})}},fk=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),{},{"Content-Type":"application/json"},$);super(I,F,U,"vectors")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/CreateVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/GetVectorBucket`,{vectorBucketName:D},{headers:$.headers})})}async listBuckets(D={}){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/ListVectorBuckets`,D,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/DeleteVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}},yk=class extends fk{constructor(D,$={}){super(D,$.headers||{},$.fetch)}from(D){return new mk(this.url,this.headers,D,this.fetch)}async createBucket(D){var $=()=>super.createBucket,U=this;return $().call(U,D)}async getBucket(D){var $=()=>super.getBucket,U=this;return $().call(U,D)}async listBuckets(D={}){var $=()=>super.listBuckets,U=this;return $().call(U,D)}async deleteBucket(D){var $=()=>super.deleteBucket,U=this;return $().call(U,D)}},mk=class extends xk{constructor(D,$,U,I){super(D,$,I);this.vectorBucketName=U}async createIndex(D){var $=()=>super.createIndex,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName}))}async listIndexes(D={}){var $=()=>super.listIndexes,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName}))}async getIndex(D){var $=()=>super.getIndex,U=this;return $().call(U,U.vectorBucketName,D)}async deleteIndex(D){var $=()=>super.deleteIndex,U=this;return $().call(U,U.vectorBucketName,D)}index(D){return new hk(this.url,this.headers,this.vectorBucketName,D,this.fetch)}},hk=class extends gk{constructor(D,$,U,I,F){super(D,$,F);this.vectorBucketName=U,this.indexName=I}async putVectors(D){var $=()=>super.putVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async getVectors(D){var $=()=>super.getVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async listVectors(D={}){var $=()=>super.listVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async queryVectors(D){var $=()=>super.queryVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async deleteVectors(D){var $=()=>super.deleteVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}},jz=class extends kk{constructor(D,$={},U,I){super(D,$,U,I)}from(D){return new Ck(this.url,this.headers,D,this.fetch)}get vectors(){return new yk(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new _k(this.url+"/iceberg",this.headers,this.fetch)}}});class Rz{constructor(D){return this.options=D,new Proxy(this,ik)}}var nk=()=>Promise.resolve({data:{session:null,user:null},error:null}),ik,aF;var sF=T(()=>{ik={get:(D,$)=>{if($==="constructor")return D.constructor;if($==="then"||$==="catch"||$==="finally")return;if(typeof $==="symbol")return;if($==="getSession")return()=>Promise.resolve({data:{session:null,user:null},error:null});if($==="onAuthStateChange")return()=>({data:{subscription:{unsubscribe:()=>{}}},error:null});return nk}};aF=class aF extends Rz{}});function ak(D,$,U,I){function F(J){return J instanceof U?J:new U(function(X){X(J)})}return new(U||(U=Promise))(function(J,X){function Q(B){try{W(I.next(B))}catch(K){X(K)}}function Y(B){try{W(I.throw(B))}catch(K){X(K)}}function W(B){B.done?J(B.value):F(B.value).then(Q,Y)}W((I=I.apply(D,$||[])).next())})}function ek(){if(eF===null)eF=import(sk).catch(()=>null);return eF}function D_(){return ak(this,void 0,void 0,function*(){try{let D=yield ek();if(!D||!D.propagation||!D.context)return null;let $={};D.propagation.inject(D.context.active(),$);let U=$.traceparent;if(!U)return null;return{traceparent:U,tracestate:$.tracestate,baggage:$.baggage}}catch(D){return null}})}function $_(D){if(!D||typeof D!=="string")return null;let $=D.split("-");if($.length!==4)return null;let[U,I,F,J]=$;if(U.length!==2||I.length!==32||F.length!==16||J.length!==2)return null;let X=/^[0-9a-f]+$/i;if(!X.test(U)||!X.test(I)||!X.test(F)||!X.test(J))return null;if(I==="00000000000000000000000000000000"||F==="0000000000000000")return null;return{version:U,traceId:I,parentId:F,traceFlags:J,isSampled:(parseInt(J,16)&1)===1}}function U_(D,$){if(!D||!$||$.length===0)return!1;let U;if(D instanceof URL)U=D;else try{U=new URL(D)}catch(I){return!1}for(let I of $)try{if(typeof I==="string"){if(F_(U.hostname,I))return!0}else if(I instanceof RegExp){if(I.test(U.hostname))return!0}else if(typeof I==="function"){if(I(U))return!0}}catch(F){continue}return!1}function F_(D,$){if($===D)return!0;if($.startsWith("*.")){let U=$.slice(2);if(D.endsWith(U)){if(D===U||D.endsWith("."+U))return!0}}return!1}function I_(D){let $=[];try{let U=new URL(D);$.push(U.hostname)}catch(U){}return $.push("*.supabase.co","*.supabase.in"),$.push("localhost","127.0.0.1","[::1]"),$}function l2(D){return l2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},l2(D)}function J_(D,$){if(l2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(l2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function X_(D){var $=J_(D,"string");return l2($)=="symbol"?$:$+""}function Q_(D,$,U){return($=X_($))in D?Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[$]=U,D}function Sz(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function yD(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Sz(Object(U),!0).forEach(function(I){Q_(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Sz(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}async function G_(D,$,U){if(!U_(typeof D==="string"?D:D instanceof URL?D:D.url,$))return null;let I=await D_();if(!I||!I.traceparent)return null;if(U){let F=$_(I.traceparent);if(F&&!F.isSampled)return null}return I}function Pz(D){return typeof D==="boolean"?{enabled:D}:D}function q_(D){return D.endsWith("/")?D:D+"/"}function H_(D,$){var U,I,F,J,X,Q;let{db:Y,auth:W,realtime:B,global:K}=D,{db:q,auth:H,realtime:G,global:z}=$,N=Pz(D.tracePropagation),M=Pz($.tracePropagation),Z={db:yD(yD({},q),Y),auth:yD(yD({},H),W),realtime:yD(yD({},G),B),storage:{},global:yD(yD(yD({},z),K),{},{headers:yD(yD({},(U=z===null||z===void 0?void 0:z.headers)!==null&&U!==void 0?U:{}),(I=K===null||K===void 0?void 0:K.headers)!==null&&I!==void 0?I:{})}),tracePropagation:{enabled:(F=(J=N===null||N===void 0?void 0:N.enabled)!==null&&J!==void 0?J:M===null||M===void 0?void 0:M.enabled)!==null&&F!==void 0?F:!1,respectSamplingDecision:(X=(Q=N===null||N===void 0?void 0:N.respectSamplingDecision)!==null&&Q!==void 0?Q:M===null||M===void 0?void 0:M.respectSamplingDecision)!==null&&X!==void 0?X:!0},accessToken:async()=>""};if(D.accessToken)Z.accessToken=D.accessToken;else delete Z.accessToken;return Z}function N_(D){let $=D===null||D===void 0?void 0:D.trim();if(!$)throw Error("supabaseUrl is required.");if(!$.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(q_($))}catch(U){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}function w_(){if(typeof window<"u"||globalThis.Deno!==void 0)return!1;let D=globalThis.process;if(!D)return!1;let $=D.version;if($===void 0||$===null)return!1;let U=$.match(/^v(\d+)\./);if(!U)return!1;return parseInt(U[1],10)<=20}var i$,lk="2.110.8",h2="",M9,n2,i2,Cz,dk,ck,pk,rk,ok,tk,eF=null,sk="@opentelemetry/api",Y_=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},W_=()=>{return Headers},uz=(D)=>D.startsWith("sb_publishable_")||D.startsWith("sb_secret_"),B_="sb_temp_",Tz,K_=(D)=>{var $,U;if(!D.startsWith("sb_")||uz(D)||D.startsWith(B_))return;let I=($=(U=D.match(/^sb_[a-zA-Z0-9]+_/))===null||U===void 0?void 0:U[0])!==null&&$!==void 0?$:"unknown";if(Tz.has(I))return;Tz.add(I),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.")},bz=(D,$,U,I,F,J)=>{let X=Y_(I),Q=W_(),Y=(F===null||F===void 0?void 0:F.enabled)===!0,W=(F===null||F===void 0?void 0:F.respectSamplingDecision)!==!1,B=Y?I_($):null,K=!((J===null||J===void 0?void 0:J.omitApiKeyAsBearer)&&uz(D));return async(q,H)=>{let G=await U(),z=new Q(H===null||H===void 0?void 0:H.headers);if(!z.has("apikey"))z.set("apikey",D);if(!z.has("Authorization")){let N=G!==null&&G!==void 0?G:K?D:null;if(N)z.set("Authorization",`Bearer ${N}`)}if(B){let N=await G_(q,B,W);if(N){if(N.traceparent&&!z.has("traceparent"))z.set("traceparent",N.traceparent);if(N.tracestate&&!z.has("tracestate"))z.set("tracestate",N.tracestate);if(N.baggage&&!z.has("baggage"))z.set("baggage",N.baggage)}}return X(q,yD(yD({},H),{},{headers:z}))}},z_,L_=class{constructor(D,$,U){var I,F;this.supabaseUrl=D,this.supabaseKey=$;let J=N_(D);if(!$)throw Error("supabaseKey is required.");K_($),this.realtimeUrl=new URL("realtime/v1",J),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",J),this.storageUrl=new URL("storage/v1",J),this.functionsUrl=new URL("functions/v1",J);let X=`sb-${J.hostname.split(".")[0]}-auth-token`,Q={db:pk,realtime:ok,auth:yD(yD({},rk),{},{storageKey:X}),global:ck,tracePropagation:tk},Y=H_(U!==null&&U!==void 0?U:{},Q);if(this.settings=Y,this.storageKey=(I=Y.auth.storageKey)!==null&&I!==void 0?I:"",this.headers=(F=Y.global.headers)!==null&&F!==void 0?F:{},!Y.accessToken){var W;this.auth=this._initSupabaseAuthClient((W=Y.auth)!==null&&W!==void 0?W:{},this.headers,Y.global.fetch)}else this.accessToken=Y.accessToken,this.auth=new Proxy({},{get:(B,K)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(K)} is not possible`)}});if(this.fetch=bz($,D,this._getSessionToken.bind(this),Y.global.fetch,Y.tracePropagation),this.functionsFetch=bz($,D,this._getSessionToken.bind(this),Y.global.fetch,Y.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(yD({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},Y.realtime)),this.accessToken)Promise.resolve(this.accessToken()).then((B)=>this.realtime.setAuth(B)).catch((B)=>console.warn("Failed to set initial Realtime auth token:",B));if(this.rest=new qz(new URL("rest/v1",J).href,{headers:this.headers,schema:Y.db.schema,fetch:this.fetch,timeout:Y.db.timeout,urlLengthLimit:Y.db.urlLengthLimit}),this.storage=new jz(this.storageUrl.href,this.headers,this.fetch,U===null||U===void 0?void 0:U.storage),!Y.accessToken)this._listenForAuthEvents()}get functions(){return new i$.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(D){return this.rest.from(D)}schema(D){return this.rest.schema(D)}rpc(D,$={},U={head:!1,get:!1,count:void 0}){return this.rest.rpc(D,$,U)}channel(D,$={config:{}}){return this.realtime.channel(D,$)}getChannels(){return this.realtime.getChannels()}removeChannel(D){return this.realtime.removeChannel(D)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var D=this,$,U;if(D.accessToken)return await D.accessToken();let{data:I}=await D.auth.getSession();return($=(U=I.session)===null||U===void 0?void 0:U.access_token)!==null&&$!==void 0?$:null}async _getAccessToken(){var D=this,$;return($=await D._getSessionToken())!==null&&$!==void 0?$:D.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:D,persistSession:$,detectSessionInUrl:U,storage:I,userStorage:F,storageKey:J,flowType:X,lock:Q,debug:Y,throwOnError:W,experimental:B,lockAcquireTimeout:K,skipAutoInitialize:q},H,G){let z={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new z_({url:this.authUrl.href,headers:yD(yD({},z),H),storageKey:J,autoRefreshToken:D,persistSession:$,detectSessionInUrl:U,storage:I,userStorage:F,flowType:X,lock:Q,debug:Y,throwOnError:W,experimental:B,fetch:G,lockAcquireTimeout:K,skipAutoInitialize:q,hasCustomAuthorizationHeader:Object.keys(this.headers).some((N)=>N.toLowerCase()==="authorization")})}_initRealtimeClient(D){return new pF(this.realtimeUrl.href,yD(yD({},D),{},{params:yD(yD({},{apikey:this.supabaseKey}),D===null||D===void 0?void 0:D.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((D,$)=>{this._handleTokenChanged(D,"CLIENT",$===null||$===void 0?void 0:$.access_token)})}_handleTokenChanged(D,$,U){if((D==="TOKEN_REFRESHED"||D==="SIGNED_IN"||D==="INITIAL_SESSION")&&this.changedAccessToken!==U)this.changedAccessToken=U,this.realtime.setAuth(U);else if(D==="SIGNED_OUT"){if(this.realtime.setAuth(),$=="STORAGE")this.auth.signOut();this.changedAccessToken=void 0}}},kz=(D,$,U)=>{return new L_(D,$,U)};var _z=T(()=>{Hz();Az();sF();i$=h$(Qz(),1);sF();if(typeof Deno<"u")h2="deno",M9=(n2=Deno.version)===null||n2===void 0?void 0:n2.deno;else if(typeof document<"u")h2="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")h2="react-native";else{h2="node";let D=globalThis.process;M9=D===null||D===void 0||(i2=D.version)===null||i2===void 0?void 0:i2.replace(/^v/,"")}Cz=[`runtime=${h2}`];if(M9)Cz.push(`runtime-version=${M9}`);dk={"X-Client-Info":`supabase-js/${lk}; ${Cz.join("; ")}`},ck={headers:dk},pk={schema:"public"},rk={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ok={},tk={enabled:!1,respectSamplingDecision:!0};Tz=new Set;z_=class extends aF{constructor(D){super(D)}};if(w_())console.warn("⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715")});var DI=C((o3D,xz)=>{xz.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var O9=C((fz)=>{var gz={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function Z_(D){return function(...$){if($.length)D=D.replace(/\{(\d)\}/g,(U,I)=>$[I]||"");return Error("ADM-ZIP: "+D)}}for(let D of Object.keys(gz))fz[D]=Z_(gz[D])});var iz=C((a3D,nz)=>{var M_=o("fs"),dD=o("path"),yz=DI(),O_=O9(),E_=typeof process==="object"&&process.platform==="win32",mz=(D)=>typeof D==="object"&&D!==null,hz=new Uint32Array(256).map((D,$)=>{for(let U=0;U<8;U++)if(($&1)!==0)$=3988292384^$>>>1;else $>>>=1;return $>>>0});function gD(D){if(this.sep=dD.sep,this.fs=M_,mz(D)){if(mz(D.fs)&&typeof D.fs.statSync==="function")this.fs=D.fs}}nz.exports=gD;gD.prototype.makeDir=function(D){let $=this;function U(I){let F=I.split($.sep)[0];I.split($.sep).forEach(function(J){if(!J||J.substr(-1,1)===":")return;F+=$.sep+J;var X;try{X=$.fs.statSync(F)}catch(Q){if(Q.message&&Q.message.startsWith("ENOENT"))$.fs.mkdirSync(F);else throw Q}if(X&&X.isFile())throw O_.FILE_IN_THE_WAY(`"${F}"`)})}U(D)};gD.prototype.writeFileTo=function(D,$,U,I){let F=this;if(F.fs.existsSync(D)){if(!U)return!1;var J=F.fs.statSync(D);if(J.isDirectory())return!1}var X=dD.dirname(D);if(!F.fs.existsSync(X))F.makeDir(X);var Q;try{Q=F.fs.openSync(D,"w",438)}catch(Y){F.fs.chmodSync(D,438),Q=F.fs.openSync(D,"w",438)}if(Q)try{F.fs.writeSync(Q,$,0,$.length,0)}finally{F.fs.closeSync(Q)}return F.fs.chmodSync(D,I||438),!0};gD.prototype.writeFileToAsync=function(D,$,U,I,F){if(typeof I==="function")F=I,I=void 0;let J=this;J.fs.exists(D,function(X){if(X&&!U)return F(!1);J.fs.stat(D,function(Q,Y){if(X&&Y&&Y.isDirectory())return F(!1);var W=dD.dirname(D);J.fs.exists(W,function(B){if(!B)try{J.makeDir(W)}catch(q){return F(!1)}let K=function(q){J.fs.write(q,$,0,$.length,0,function(H){J.fs.close(q,function(){if(H)return F(!1);J.fs.chmod(D,I||438,function(){F(!0)})})})};J.fs.open(D,"w",438,function(q,H){if(q)J.fs.chmod(D,438,function(){J.fs.open(D,"w",438,function(G,z){if(G||!z)return F(!1);K(z)})});else if(H)K(H);else F(!1)})})})})};gD.prototype.findFiles=function(D){let $=this;function U(I,F,J,X){if(typeof F==="boolean")J=F,F=void 0;let Q=[];return $.fs.readdirSync(I).forEach(function(Y){let W=dD.join(I,Y),B=$.fs.statSync(W);if(!F||F.test(W))Q.push(dD.normalize(W)+(B.isDirectory()?$.sep:""));if(B.isDirectory()&&J){let K=$.fs.realpathSync(W);if(!X.has(K))X.add(K),Q=Q.concat(U(W,F,J,X))}}),Q}return U(D,void 0,!0,new Set([$.fs.realpathSync(D)]))};gD.prototype.findFilesAsync=function(D,$){let U=this,I=[],F=!1,J=function(Q){if(F)return;F=!0,$(Q,Q?void 0:I)},X=function(Q,Y,W){U.fs.readdir(Q,function(B,K){if(B)return W(B);let q=K.length;if(!q)return W();K.forEach(function(H){let G=dD.join(Q,H);U.fs.stat(G,function(z,N){if(z)return W(z);if(!N){if(!--q)W();return}if(I.push(dD.normalize(G)+(N.isDirectory()?U.sep:"")),!N.isDirectory()){if(!--q)W();return}U.fs.realpath(G,function(M,Z){if(M)return W(M);if(Y.has(Z)){if(!--q)W();return}Y.add(Z),X(G,Y,function(L){if(L)return W(L);if(!--q)W()})})})})})};U.fs.realpath(D,function(Q,Y){if(Q)return J(Q);X(D,new Set([Y]),J)})};gD.prototype.getAttributes=function(){};gD.prototype.setAttributes=function(){};gD.crc32update=function(D,$){return hz[(D^$)&255]^D>>>8};gD.crc32=function(D){if(typeof D==="string")D=Buffer.from(D,"utf8");let $=D.length,U=-1;for(let I=0;I<$;)U=gD.crc32update(U,D[I++]);return~U>>>0};gD.methodToString=function(D){switch(D){case yz.STORED:return"STORED ("+D+")";case yz.DEFLATED:return"DEFLATED ("+D+")";default:return"UNSUPPORTED ("+D+")"}};gD.canonical=function(D){if(!D)return"";let $=dD.posix.normalize("/"+D.split("\\").join("/"));return dD.join(".",$)};gD.zipnamefix=function(D){if(!D)return"";let $=dD.posix.normalize("/"+D.split("\\").join("/"));return dD.posix.join(".",$)};gD.findLast=function(D,$){if(!Array.isArray(D))throw TypeError("arr is not array");let U=D.length>>>0;for(let I=U-1;I>=0;I--)if($(D[I],I,D))return D[I];return};gD.sanitize=function(D,$){D=dD.resolve(dD.normalize(D));var U=$.split("/");for(var I=0,F=U.length;I<F;I++){var J=dD.normalize(dD.join(D,U.slice(I,F).join(dD.sep)));if(J===D||J.startsWith(D+dD.sep))return J}return dD.normalize(dD.join(D,dD.basename($)))};gD.toBuffer=function($,U){if(Buffer.isBuffer($))return $;else if($ instanceof Uint8Array)return Buffer.from($);else return typeof $==="string"?U($):Buffer.alloc(0)};gD.readBigUInt64LE=function(D,$){let U=D.readUInt32LE($);return D.readUInt32LE($+4)*4294967296+U};gD.writeBigUInt64LE=function(D,$,U){let I=$>>>0,F=Math.floor($/4294967296)>>>0;D.writeUInt32LE(I,U),D.writeUInt32LE(F,U+4)};gD.fromDOS2Date=function(D){return new Date((D>>25&127)+1980,Math.max((D>>21&15)-1,0),Math.max(D>>16&31,1),D>>11&31,D>>5&63,(D&31)<<1)};gD.fromDate2DOS=function(D){let $=0,U=0;if(D.getFullYear()>1979)$=(D.getFullYear()-1980&127)<<9|D.getMonth()+1<<5|D.getDate(),U=D.getHours()<<11|D.getMinutes()<<5|D.getSeconds()>>1;return $<<16|U};gD.isWin=E_;gD.crcTable=hz});var dz=C((s3D,lz)=>{var v_=o("path");lz.exports=function(D,{fs:$}){var U=D||"",I=J(),F=null;function J(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}if(U&&$.existsSync(U))F=$.statSync(U),I.directory=F.isDirectory(),I.mtime=F.mtime,I.atime=F.atime,I.executable=(73&F.mode)!==0,I.readonly=(128&F.mode)===0,I.hidden=v_.basename(U)[0]===".";else console.warn("Invalid path: "+U);return{get directory(){return I.directory},get readOnly(){return I.readonly},get hidden(){return I.hidden},get mtime(){return I.mtime},get atime(){return I.atime},get executable(){return I.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:U,isDirectory:I.directory,isReadOnly:I.readonly,isHidden:I.hidden,isExecutable:I.executable,mTime:I.mtime,aTime:I.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var pz=C((e3D,cz)=>{cz.exports={efs:!0,encode:(D)=>Buffer.from(D,"utf8"),decode:(D)=>D.toString("utf8")}});var y1=C((D9D,f1)=>{f1.exports=iz();f1.exports.Constants=DI();f1.exports.Errors=O9();f1.exports.FileAttr=dz();f1.exports.decoder=pz()});var oz=C(($9D,rz)=>{var h0=y1(),p=h0.Constants;rz.exports=function(){var D=20,$=10,U=0,I=0,F=0,J=0,X=0,Q=0,Y=0,W=0,B=0,K=0,q=0,H=0,G=0;D|=h0.isWin?2560:768,U|=p.FLG_EFS;let z={extraLen:0},N=(L)=>Math.max(0,L)>>>0,M=(L)=>Math.max(0,L)&65535,Z=(L)=>Math.max(0,L)&255;return F=h0.fromDate2DOS(new Date),{get made(){return D},set made(L){D=L},get version(){return $},set version(L){$=L},get flags(){return U},set flags(L){U=L},get flags_efs(){return(U&p.FLG_EFS)>0},set flags_efs(L){if(L)U|=p.FLG_EFS;else U&=~p.FLG_EFS},get flags_desc(){return(U&p.FLG_DESC)>0},set flags_desc(L){if(L)U|=p.FLG_DESC;else U&=~p.FLG_DESC},get method(){return I},set method(L){switch(L){case p.STORED:this.version=10;break;case p.DEFLATED:default:this.version=20}I=L},get time(){return h0.fromDOS2Date(this.timeval)},set time(L){L=new Date(L),this.timeval=h0.fromDate2DOS(L)},get timeval(){return F},set timeval(L){F=N(L)},get timeHighByte(){return Z(F>>>8)},get crc(){return J},set crc(L){J=N(L)},get compressedSize(){return X},set compressedSize(L){X=N(L)},get size(){return Q},set size(L){Q=N(L)},get fileNameLength(){return Y},set fileNameLength(L){Y=L},get extraLength(){return W},set extraLength(L){W=L},get extraLocalLength(){return z.extraLen},set extraLocalLength(L){z.extraLen=L},get commentLength(){return B},set commentLength(L){B=L},get diskNumStart(){return K},set diskNumStart(L){K=N(L)},get inAttr(){return q},set inAttr(L){q=N(L)},get attr(){return H},set attr(L){H=N(L)},get fileAttr(){return(H||0)>>16&4095},get offset(){return G},set offset(L){G=N(L)},get encrypted(){return(U&p.FLG_ENC)===p.FLG_ENC},get centralHeaderSize(){return p.CENHDR+Y+W+B},get realDataOffset(){return G+p.LOCHDR+z.fnameLen+z.extraLen},get localHeader(){return z},loadLocalHeaderFromBinary:function(L){var v=L.slice(G,G+p.LOCHDR);if(v.readUInt32LE(0)!==p.LOCSIG)throw h0.Errors.INVALID_LOC();z.version=v.readUInt16LE(p.LOCVER),z.flags=v.readUInt16LE(p.LOCFLG),z.flags_desc=(z.flags&p.FLG_DESC)>0,z.method=v.readUInt16LE(p.LOCHOW),z.time=v.readUInt32LE(p.LOCTIM),z.crc=v.readUInt32LE(p.LOCCRC),z.compressedSize=v.readUInt32LE(p.LOCSIZ),z.size=v.readUInt32LE(p.LOCLEN),z.fnameLen=v.readUInt16LE(p.LOCNAM),z.extraLen=v.readUInt16LE(p.LOCEXT);let A=G+p.LOCHDR+z.fnameLen,V=A+z.extraLen;return L.slice(A,V)},loadFromBinary:function(L){if(L.length!==p.CENHDR||L.readUInt32LE(0)!==p.CENSIG)throw h0.Errors.INVALID_CEN();D=L.readUInt16LE(p.CENVEM),$=L.readUInt16LE(p.CENVER),U=L.readUInt16LE(p.CENFLG),I=L.readUInt16LE(p.CENHOW),F=L.readUInt32LE(p.CENTIM),J=L.readUInt32LE(p.CENCRC),X=L.readUInt32LE(p.CENSIZ),Q=L.readUInt32LE(p.CENLEN),Y=L.readUInt16LE(p.CENNAM),W=L.readUInt16LE(p.CENEXT),B=L.readUInt16LE(p.CENCOM),K=L.readUInt16LE(p.CENDSK),q=L.readUInt16LE(p.CENATT),H=L.readUInt32LE(p.CENATX),G=L.readUInt32LE(p.CENOFF)},localHeaderToBinary:function(){var L=Buffer.alloc(p.LOCHDR);return L.writeUInt32LE(p.LOCSIG,0),L.writeUInt16LE($,p.LOCVER),L.writeUInt16LE(U&~p.FLG_DESC,p.LOCFLG),L.writeUInt16LE(I,p.LOCHOW),L.writeUInt32LE(F,p.LOCTIM),L.writeUInt32LE(J,p.LOCCRC),L.writeUInt32LE(X,p.LOCSIZ),L.writeUInt32LE(Q,p.LOCLEN),L.writeUInt16LE(Y,p.LOCNAM),L.writeUInt16LE(z.extraLen,p.LOCEXT),L},centralHeaderToBinary:function(){var L=Buffer.alloc(p.CENHDR+Y+W+B);return L.writeUInt32LE(p.CENSIG,0),L.writeUInt16LE(D,p.CENVEM),L.writeUInt16LE($,p.CENVER),L.writeUInt16LE(U&~p.FLG_DESC,p.CENFLG),L.writeUInt16LE(I,p.CENHOW),L.writeUInt32LE(F,p.CENTIM),L.writeUInt32LE(J,p.CENCRC),L.writeUInt32LE(X,p.CENSIZ),L.writeUInt32LE(Q,p.CENLEN),L.writeUInt16LE(Y,p.CENNAM),L.writeUInt16LE(W,p.CENEXT),L.writeUInt16LE(B,p.CENCOM),L.writeUInt16LE(K,p.CENDSK),L.writeUInt16LE(q,p.CENATT),L.writeUInt32LE(H,p.CENATX),L.writeUInt32LE(G,p.CENOFF),L},toJSON:function(){let L=function(v){return v+" bytes"};return{made:D,version:$,flags:U,method:h0.methodToString(I),time:this.time,crc:"0x"+J.toString(16).toUpperCase(),compressedSize:L(X),size:L(Q),fileNameLength:L(Y),extraLength:L(W),commentLength:L(B),diskNumStart:K,inAttr:q,attr:H,offset:G,centralHeaderSize:L(p.CENHDR+Y+W+B)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var az=C((U9D,tz)=>{var l$=y1(),$D=l$.Constants;tz.exports=function(){var D=0,$=0,U=0,I=0,F=0;let J=()=>D>$D.EF_ZIP64_OR_16||$>$D.EF_ZIP64_OR_16||U>$D.EF_ZIP64_OR_32||I>$D.EF_ZIP64_OR_32;return{get diskEntries(){return D},set diskEntries(X){D=$=X},get totalEntries(){return $},set totalEntries(X){$=D=X},get size(){return U},set size(X){U=X},get offset(){return I},set offset(X){I=X},get commentLength(){return F},set commentLength(X){F=X},get mainHeaderSize(){return(J()?$D.ZIP64HDR+$D.END64HDR:0)+$D.ENDHDR+F},loadFromBinary:function(X){if((X.length!==$D.ENDHDR||X.readUInt32LE(0)!==$D.ENDSIG)&&(X.length<$D.ZIP64HDR||X.readUInt32LE(0)!==$D.ZIP64SIG))throw l$.Errors.INVALID_END();if(X.readUInt32LE(0)===$D.ENDSIG)D=X.readUInt16LE($D.ENDSUB),$=X.readUInt16LE($D.ENDTOT),U=X.readUInt32LE($D.ENDSIZ),I=X.readUInt32LE($D.ENDOFF),F=X.readUInt16LE($D.ENDCOM);else D=l$.readBigUInt64LE(X,$D.ZIP64SUB),$=l$.readBigUInt64LE(X,$D.ZIP64TOT),U=l$.readBigUInt64LE(X,$D.ZIP64SIZB),I=l$.readBigUInt64LE(X,$D.ZIP64OFF),F=0},toBinary:function(){if(!J()){var X=Buffer.alloc($D.ENDHDR+F);return X.writeUInt32LE($D.ENDSIG,0),X.writeUInt32LE(0,4),X.writeUInt16LE(D,$D.ENDSUB),X.writeUInt16LE($,$D.ENDTOT),X.writeUInt32LE(U,$D.ENDSIZ),X.writeUInt32LE(I,$D.ENDOFF),X.writeUInt16LE(F,$D.ENDCOM),X.fill(" ",$D.ENDHDR),X}var X=Buffer.alloc(this.mainHeaderSize);let Q=0;X.writeUInt32LE($D.ZIP64SIG,Q),l$.writeBigUInt64LE(X,$D.ZIP64HDR-$D.ZIP64LEAD,Q+$D.ZIP64SIZE),X.writeUInt16LE(45,Q+$D.ZIP64VEM),X.writeUInt16LE(45,Q+$D.ZIP64VER),X.writeUInt32LE(0,Q+$D.ZIP64DSK),X.writeUInt32LE(0,Q+$D.ZIP64DSKDIR),l$.writeBigUInt64LE(X,D,Q+$D.ZIP64SUB),l$.writeBigUInt64LE(X,$,Q+$D.ZIP64TOT),l$.writeBigUInt64LE(X,U,Q+$D.ZIP64SIZB),l$.writeBigUInt64LE(X,I,Q+$D.ZIP64OFF);let Y=I+U;return Q+=$D.ZIP64HDR,X.writeUInt32LE($D.END64SIG,Q),X.writeUInt32LE(0,Q+$D.END64START),l$.writeBigUInt64LE(X,Y,Q+$D.END64OFF),X.writeUInt32LE(1,Q+$D.END64NUMDISKS),Q+=$D.END64HDR,X.writeUInt32LE($D.ENDSIG,Q),X.writeUInt32LE(0,Q+4),X.writeUInt16LE(Math.min(D,$D.EF_ZIP64_OR_16),Q+$D.ENDSUB),X.writeUInt16LE(Math.min($,$D.EF_ZIP64_OR_16),Q+$D.ENDTOT),X.writeUInt32LE(Math.min(U,$D.EF_ZIP64_OR_32),Q+$D.ENDSIZ),X.writeUInt32LE(Math.min(I,$D.EF_ZIP64_OR_32),Q+$D.ENDOFF),X.writeUInt16LE(F,Q+$D.ENDCOM),X.fill(" ",Q+$D.ENDHDR),X},toJSON:function(){let X=function(Q,Y){let W=Q.toString(16).toUpperCase();while(W.length<Y)W="0"+W;return"0x"+W};return{diskEntries:D,totalEntries:$,size:U+" bytes",offset:X(I,4),commentLength:F}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var $I=C((V_)=>{V_.EntryHeader=oz();V_.MainHeader=az()});var ez=C((I9D,sz)=>{sz.exports=function(D){var $=o("zlib"),U={chunkSize:(parseInt(D.length/1024)+1)*1024};return{deflate:function(){return $.deflateRawSync(D,U)},deflateAsync:function(I){var F=$.createDeflateRaw(U),J=[],X=0;F.on("data",function(Q){J.push(Q),X+=Q.length}),F.on("end",function(){var Q=Buffer.alloc(X),Y=0;Q.fill(0);for(var W=0;W<J.length;W++){var B=J[W];B.copy(Q,Y),Y+=B.length}I&&I(Q)}),F.end(D)}}}});var $L=C((J9D,DL)=>{var R_=+(process?.versions?.node??"").split(".")[0]||0;DL.exports=function(D,$){var U=o("zlib");let I=R_>=15&&$>0?{maxOutputLength:$}:{};return{inflate:function(){return U.inflateRawSync(D,I)},inflateAsync:function(F){var J=U.createInflateRaw(I),X=[],Q=0;J.on("data",function(Y){X.push(Y),Q+=Y.length}),J.on("end",function(){var Y=Buffer.alloc(Q),W=0;Y.fill(0);for(var B=0;B<X.length;B++){var K=X[B];K.copy(Y,W),W+=K.length}F&&F(Y)}),J.end(D)}}}});var XL=C((X9D,JL)=>{var{randomFillSync:UL}=o("crypto"),S_=O9(),T_=new Uint32Array(256).map((D,$)=>{for(let U=0;U<8;U++)if(($&1)!==0)$=$>>>1^3988292384;else $>>>=1;return $>>>0}),IL=(D,$)=>Math.imul(D,$)>>>0,FL=(D,$)=>{return T_[(D^$)&255]^D>>>8},d2=()=>{if(typeof UL==="function")return UL(Buffer.alloc(12));else return d2.node()};d2.node=()=>{let D=Buffer.alloc(12),$=D.length;for(let U=0;U<$;U++)D[U]=Math.random()*256&255;return D};var E9={genSalt:d2};function v9(D){let $=Buffer.isBuffer(D)?D:Buffer.from(D);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let U=0;U<$.length;U++)this.updateKeys($[U])}v9.prototype.updateKeys=function(D){let $=this.keys;return $[0]=FL($[0],D),$[1]+=$[0]&255,$[1]=IL($[1],134775813)+1,$[2]=FL($[2],$[1]>>>24),D};v9.prototype.next=function(){let D=(this.keys[2]|2)>>>0;return IL(D,D^1)>>8&255};function b_(D){let $=new v9(D);return function(U){let I=Buffer.alloc(U.length),F=0;for(let J of U)I[F++]=$.updateKeys(J^$.next());return I}}function P_(D){let $=new v9(D);return function(U,I,F=0){if(!I)I=Buffer.alloc(U.length);for(let J of U){let X=$.next();I[F++]=J^X,$.updateKeys(J)}return I}}function C_(D,$,U){if(!D||!Buffer.isBuffer(D)||D.length<12)return Buffer.alloc(0);let I=b_(U),F=I(D.slice(0,12)),J=($.flags&8)===8?$.timeHighByte:$.crc>>>24;if(F[11]!==J)throw S_.WRONG_PASSWORD();return I(D.slice(12))}function u_(D){if(Buffer.isBuffer(D)&&D.length>=12)E9.genSalt=function(){return D.slice(0,12)};else if(D==="node")E9.genSalt=d2.node;else E9.genSalt=d2}function k_(D,$,U,I=!1){if(D==null)D=Buffer.alloc(0);if(!Buffer.isBuffer(D))D=Buffer.from(D.toString());let F=P_(U),J=E9.genSalt();if(J[11]=$.crc>>>24&255,I)J[10]=$.crc>>>16&255;let X=Buffer.alloc(D.length+12);return F(J,X),F(D,X,12)}JL.exports={decrypt:C_,encrypt:k_,_salter:u_}});var QL=C((__)=>{__.Deflater=ez();__.Inflater=$L();__.ZipCrypto=XL()});var FI=C((Y9D,YL)=>{var bD=y1(),y_=$I(),_$=bD.Constants,UI=QL();YL.exports=function(D,$){var U=new y_.EntryHeader,I=Buffer.alloc(0),F=Buffer.alloc(0),J=!1,X=null,Q=Buffer.alloc(0),Y=Buffer.alloc(0),W=!0;let B=D,K=typeof B.decoder==="object"?B.decoder:bD.decoder;W=K.hasOwnProperty("efs")?K.efs:!1;function q(){if(!$||!($ instanceof Uint8Array))return Buffer.alloc(0);return Y=U.loadLocalHeaderFromBinary($),$.slice(U.realDataOffset,U.realDataOffset+U.compressedSize)}function H(L){let v=U.flags_desc||U.localHeader.flags_desc?U.crc:U.localHeader.crc;return bD.crc32(L)===v}function G(L,v,A){if(typeof v>"u"&&typeof L==="string")A=L,L=void 0;if(J){if(L&&v)v(Buffer.alloc(0),bD.Errors.DIRECTORY_CONTENT_ERROR());return Buffer.alloc(0)}var V=q();if(V.length===0){if(L&&v)v(V);return V}if(U.encrypted){if(typeof A!=="string"&&!Buffer.isBuffer(A))throw bD.Errors.INVALID_PASS_PARAM();V=UI.ZipCrypto.decrypt(V,U,A)}var b;switch(U.method){case bD.Constants.STORED:if(b=Buffer.alloc(V.length),V.copy(b),!H(b)){if(L&&v)v(b,bD.Errors.BAD_CRC());throw bD.Errors.BAD_CRC()}else{if(L&&v)v(b);return b}case bD.Constants.DEFLATED:var y=new UI.Inflater(V,U.size);if(!L){if(b=y.inflate(),!H(b))throw bD.Errors.BAD_CRC(`"${K.decode(I)}"`);return b}else y.inflateAsync(function(_){if(v)if(!H(_))v(_,bD.Errors.BAD_CRC());else v(_)});break;default:if(L&&v)v(Buffer.alloc(0),bD.Errors.UNKNOWN_METHOD());throw bD.Errors.UNKNOWN_METHOD()}}function z(L,v){if((!X||!X.length)&&Buffer.isBuffer($)){if(L&&v)v(q());return q()}if(X.length&&!J){var A;switch(U.method){case bD.Constants.STORED:if(U.compressedSize=U.size,A=Buffer.alloc(X.length),X.copy(A),L&&v)v(A);return A;default:case bD.Constants.DEFLATED:var V=new UI.Deflater(X);if(!L){var b=V.deflate();return U.compressedSize=b.length,b}else V.deflateAsync(function(y){A=Buffer.alloc(y.length),U.compressedSize=y.length,y.copy(A),v&&v(A)});V=null;break}}else if(L&&v)v(Buffer.alloc(0));else return Buffer.alloc(0)}function N(L,v){return bD.readBigUInt64LE(L,v)}function M(L){try{var v=0,A,V,b;while(v+4<L.length)if(A=L.readUInt16LE(v),v+=2,V=L.readUInt16LE(v),v+=2,b=L.slice(v,v+V),v+=V,_$.ID_ZIP64===A)Z(b)}catch(y){throw bD.Errors.EXTRA_FIELD_PARSE_ERROR()}}function Z(L){var v,A,V,b;if(L.length>=_$.EF_ZIP64_SCOMP){if(v=N(L,_$.EF_ZIP64_SUNCOMP),U.size===_$.EF_ZIP64_OR_32)U.size=v}if(L.length>=_$.EF_ZIP64_RHO){if(A=N(L,_$.EF_ZIP64_SCOMP),U.compressedSize===_$.EF_ZIP64_OR_32)U.compressedSize=A}if(L.length>=_$.EF_ZIP64_DSN){if(V=N(L,_$.EF_ZIP64_RHO),U.offset===_$.EF_ZIP64_OR_32)U.offset=V}if(L.length>=_$.EF_ZIP64_DSN+4){if(b=L.readUInt32LE(_$.EF_ZIP64_DSN),U.diskNumStart===_$.EF_ZIP64_OR_16)U.diskNumStart=b}}return{get entryName(){return K.decode(I)},get rawEntryName(){return I},set entryName(L){I=bD.toBuffer(L,K.encode);var v=I[I.length-1];J=v===47||v===92,U.fileNameLength=I.length},get efs(){if(typeof W==="function")return W(this.entryName);else return W},get extra(){return Q},set extra(L){Q=L,U.extraLength=L.length,M(L)},get comment(){return K.decode(F)},set comment(L){if(F=bD.toBuffer(L,K.encode),U.commentLength=F.length,F.length>65535)throw bD.Errors.COMMENT_TOO_LONG()},get name(){let L=K.decode(I);return J?L.replace(/[/\\]$/,"").split("/").pop():L.split("/").pop()},get isDirectory(){return J},getCompressedData:function(){return z(!1,null)},getCompressedDataAsync:function(L){z(!0,L)},setData:function(L){if(X=bD.toBuffer(L,bD.decoder.encode),!J&&X.length)U.size=X.length,U.method=bD.Constants.DEFLATED,U.crc=bD.crc32(L),U.changed=!0;else U.method=bD.Constants.STORED},getData:function(L){if(U.changed)return X;else return G(!1,null,L)},getDataAsync:function(L,v){if(U.changed)L(X);else G(!0,L,v)},set attr(L){U.attr=L},get attr(){return U.attr},set header(L){U.loadFromBinary(L)},get header(){return U},packCentralHeader:function(){U.flags_efs=this.efs,U.extraLength=Q.length;var L=U.centralHeaderToBinary(),v=bD.Constants.CENHDR;return I.copy(L,v),v+=I.length,Q.copy(L,v),v+=U.extraLength,F.copy(L,v),L},packLocalHeader:function(){let L=0;U.flags_efs=this.efs,U.extraLocalLength=Y.length;let v=U.localHeaderToBinary(),A=Buffer.alloc(v.length+I.length+U.extraLocalLength);return v.copy(A,L),L+=v.length,I.copy(A,L),L+=I.length,Y.copy(A,L),L+=Y.length,A},toJSON:function(){let L=function(v){return"<"+(v&&v.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:U.toJSON(),compressedData:L($),data:L(X)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var KL=C((W9D,BL)=>{var WL=FI(),m_=$I(),q$=y1();BL.exports=function(D,$){var U=[],I=Object.create(null),F=Buffer.alloc(0),J=new m_.MainHeader,X=!1,Q=null;let Y=new Set,W=$,{noSort:B,decoder:K}=W;if(D)G(W.readEntries);else X=!0;function q(){let N=new Set;for(let M of Object.keys(I)){let Z=M.split("/");if(Z.pop(),!Z.length)continue;for(let L=0;L<Z.length;L++){let v=Z.slice(0,L+1).join("/")+"/";N.add(v)}}for(let M of N)if(!(M in I)){let Z=new WL(W);Z.entryName=M,Z.attr=16,Z.temporary=!0,U.push(Z),I[Z.entryName]=Z,Y.add(Z)}}function H(){if(X=!0,I=Object.create(null),J.diskEntries>(D.length-J.offset)/q$.Constants.CENHDR)throw q$.Errors.DISK_ENTRY_TOO_LARGE();U=Array(J.diskEntries);var N=J.offset;for(var M=0;M<U.length;M++){var Z=N,L=new WL(W,D);if(L.header=D.slice(Z,Z+=q$.Constants.CENHDR),L.entryName=D.slice(Z,Z+=L.header.fileNameLength),L.header.extraLength)L.extra=D.slice(Z,Z+=L.header.extraLength);if(L.header.commentLength)L.comment=D.slice(Z,Z+L.header.commentLength);N+=L.header.centralHeaderSize,U[M]=L,I[L.entryName]=L}Y.clear(),q()}function G(N){var M=D.length-q$.Constants.ENDHDR,Z=Math.max(0,M-65535),L=Z,v=D.length,A=-1,V=0;if(typeof W.trailingSpace==="boolean"?W.trailingSpace:!1)Z=0;for(M;M>=L;M--){if(D[M]!==80)continue;if(D.readUInt32LE(M)===q$.Constants.ENDSIG){A=M,V=M,v=M+q$.Constants.ENDHDR,L=M-q$.Constants.END64HDR;continue}if(D.readUInt32LE(M)===q$.Constants.END64SIG){L=Z;continue}if(D.readUInt32LE(M)===q$.Constants.ZIP64SIG){A=M,v=M+q$.readBigUInt64LE(D,M+q$.Constants.ZIP64SIZE)+q$.Constants.ZIP64LEAD;break}}if(A==-1)throw q$.Errors.INVALID_FORMAT();if(J.loadFromBinary(D.slice(A,v)),J.commentLength)F=D.slice(V+q$.Constants.ENDHDR);if(N)H()}function z(){if(U.length>1&&!B)U=U.map((N)=>({entry:N,key:N.entryName.toLowerCase()})).sort((N,M)=>N.key.localeCompare(M.key)).map((N)=>N.entry)}return{get entries(){if(!X)H();return U.filter((N)=>!Y.has(N))},get comment(){return K.decode(F)},set comment(N){F=q$.toBuffer(N,K.encode),J.commentLength=F.length},getEntryCount:function(){if(!X)return J.diskEntries;return U.length},forEach:function(N){this.entries.forEach(N)},getEntry:function(N){if(!X)H();return I[N]||null},setEntry:function(N){if(!X)H();U.push(N),I[N.entryName]=N,J.totalEntries=U.length},deleteFile:function(N,M=!0){if(!X)H();let Z=I[N];this.getEntryChildren(Z,M).map((v)=>v.entryName).forEach(this.deleteEntry)},deleteEntry:function(N){if(!X)H();let M=I[N],Z=U.indexOf(M);if(Z>=0)U.splice(Z,1),delete I[N],J.totalEntries=U.length},getEntryChildren:function(N,M=!0){if(!X)H();if(typeof N==="object")if(N.isDirectory&&M){let Z=[],L=N.entryName;for(let v of U)if(v.entryName.startsWith(L))Z.push(v);return Z}else return[N];return[]},getChildCount:function(N){if(N&&N.isDirectory){let M=this.getEntryChildren(N);return M.includes(N)?M.length-1:M.length}return 0},compressToBuffer:function(){if(!X)H();z();let N=[],M=[],Z=0,L=0;J.size=0,J.offset=0;let v=0;for(let b of this.entries){let y=b.getCompressedData();b.header.offset=L;let _=b.packLocalHeader(),n=_.length+y.length;L+=n,N.push(_),N.push(y);let m=b.packCentralHeader();M.push(m),J.size+=m.length,Z+=n+m.length,v++}Z+=J.mainHeaderSize,J.offset=L,J.totalEntries=v,L=0;let A=Buffer.alloc(Z);for(let b of N)b.copy(A,L),L+=b.length;for(let b of M)b.copy(A,L),L+=b.length;let V=J.toBinary();if(F)F.copy(V,V.length-F.length);return V.copy(A,L),D=A,X=!1,A},toAsyncBuffer:function(N,M,Z,L){try{if(!X)H();z();let v=[],A=[],V=0,b=0,y=0;J.size=0,J.offset=0;let _=function(n){if(n.length>0){let m=n.shift(),UD=m.entryName+m.extra.toString();if(Z)Z(UD);m.getCompressedDataAsync(function(s){if(L)L(UD);m.header.offset=b;let a=m.packLocalHeader(),DD=a.length+s.length;b+=DD,v.push(a),v.push(s);let E=m.packCentralHeader();A.push(E),J.size+=E.length,V+=DD+E.length,y++,_(n)})}else{V+=J.mainHeaderSize,J.offset=b,J.totalEntries=y,b=0;let m=Buffer.alloc(V);v.forEach(function(s){s.copy(m,b),b+=s.length}),A.forEach(function(s){s.copy(m,b),b+=s.length});let UD=J.toBinary();if(F)F.copy(UD,UD.length-F.length);UD.copy(m,b),D=m,X=!1,N(m)}};_(Array.from(this.entries))}catch(v){M(v)}}}}});var HL=C((B9D,qL)=>{var hD=y1(),mD=o("path"),h_=FI(),n_=KL(),E6=(...D)=>hD.findLast(D,($)=>typeof $==="boolean"),GL=(...D)=>hD.findLast(D,($)=>typeof $==="string"),i_=(...D)=>hD.findLast(D,($)=>typeof $==="function"),l_={noSort:!1,readEntries:!1,method:hD.Constants.NONE,fs:null};qL.exports=function(D,$){let U=null,I=Object.assign(Object.create(null),l_);if(D&&typeof D==="object"){if(!(D instanceof Uint8Array)){if(Object.assign(I,D),D=I.input?I.input:void 0,I.input)delete I.input}if(Buffer.isBuffer(D))U=D,I.method=hD.Constants.BUFFER,D=void 0}Object.assign(I,$);let F=new hD(I),J=(G)=>{G.filter((z)=>z.attr).sort((z,N)=>N.path.length-z.path.length).forEach((z)=>F.fs.chmodSync(z.path,z.attr))};if(typeof I.decoder!=="object"||typeof I.decoder.encode!=="function"||typeof I.decoder.decode!=="function")I.decoder=hD.decoder;if(D&&typeof D==="string")if(F.fs.existsSync(D))I.method=hD.Constants.FILE,I.filename=D,U=F.fs.readFileSync(D);else throw hD.Errors.INVALID_FILENAME();let X=new n_(U,I),{canonical:Q,sanitize:Y,zipnamefix:W}=hD;function B(G){if(G&&X){var z;if(typeof G==="string")z=X.getEntry(mD.posix.normalize(G));if(typeof G==="object"&&typeof G.entryName<"u"&&typeof G.header<"u")z=X.getEntry(G.entryName);if(z)return z}return null}function K(G){let{join:z,normalize:N,sep:M}=mD.posix;return z(mD.isAbsolute(G)?"/":".",N(M+G.split("\\").join(M)+M))}function q(G){if(G instanceof RegExp)return function(z){return function(N){return z.test(N)}}(G);else if(typeof G!=="function")return()=>!0;return G}let H=(G,z)=>{let N=z.slice(-1);return N=N===F.sep?F.sep:"",mD.relative(G,z)+N};return{readFile:function(G,z){var N=B(G);return N&&N.getData(z)||null},childCount:function(G){let z=B(G);if(z)return X.getChildCount(z)},readFileAsync:function(G,z){var N=B(G);if(N)N.getDataAsync(z);else z(null,"getEntry failed for:"+G)},readAsText:function(G,z){var N=B(G);if(N){var M=N.getData();if(M&&M.length)return M.toString(z||"utf8")}return""},readAsTextAsync:function(G,z,N){var M=B(G);if(M)M.getDataAsync(function(Z,L){if(L){z(Z,L);return}if(Z&&Z.length)z(Z.toString(N||"utf8"));else z("")});else z("")},deleteFile:function(G,z=!0){var N=B(G);if(N)X.deleteFile(N.entryName,z)},deleteEntry:function(G){var z=B(G);if(z)X.deleteEntry(z.entryName)},addZipComment:function(G){X.comment=G},getZipComment:function(){return X.comment||""},addZipEntryComment:function(G,z){var N=B(G);if(N)N.comment=z},getZipEntryComment:function(G){var z=B(G);if(z)return z.comment||"";return""},updateFile:function(G,z){var N=B(G);if(N)N.setData(z)},addLocalFile:function(G,z,N,M){if(F.fs.existsSync(G)){z=z?K(z):"";let Z=mD.win32.basename(mD.win32.normalize(G));z+=N?N:Z;let L=F.fs.statSync(G),v=L.isFile()?F.fs.readFileSync(G):Buffer.alloc(0);if(L.isDirectory())z+=F.sep;this.addFile(z,v,M,L)}else throw hD.Errors.FILE_NOT_FOUND(G)},addLocalFileAsync:function(G,z){G=typeof G==="object"?G:{localPath:G};let N=mD.resolve(G.localPath),{comment:M}=G,{zipPath:Z,zipName:L}=G,v=this;F.fs.stat(N,function(A,V){if(A)return z(A,!1);Z=Z?K(Z):"";let b=mD.win32.basename(mD.win32.normalize(N));if(Z+=L?L:b,V.isFile())F.fs.readFile(N,function(y,_){if(y)return z(y,!1);return v.addFile(Z,_,M,V),setImmediate(z,void 0,!0)});else if(V.isDirectory())return Z+=F.sep,v.addFile(Z,Buffer.alloc(0),M,V),setImmediate(z,void 0,!0)})},addLocalFolder:function(G,z,N){if(N=q(N),z=z?K(z):"",G=mD.normalize(G),F.fs.existsSync(G)){let M=F.findFiles(G),Z=this;if(M.length)for(let L of M){let v=mD.join(z,H(G,L));if(N(v))Z.addLocalFile(L,mD.dirname(v))}}else throw hD.Errors.FILE_NOT_FOUND(G)},addLocalFolderAsync:function(G,z,N,M){M=q(M),N=N?K(N):"",G=mD.normalize(G);var Z=this;F.fs.open(G,"r",function(L){if(L&&L.code==="ENOENT")z(void 0,hD.Errors.FILE_NOT_FOUND(G));else if(L)z(void 0,L);else{var v=F.findFiles(G),A=-1,V=function(){if(A+=1,A<v.length){var b=v[A],y=H(G,b).split("\\").join("/");if(y=y.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),M(y))F.fs.stat(b,function(_,n){if(_)z(void 0,_);if(n.isFile())F.fs.readFile(b,function(m,UD){if(m)z(void 0,m);else Z.addFile(N+y,UD,"",n),V()});else Z.addFile(N+y+"/",Buffer.alloc(0),"",n),V()});else process.nextTick(()=>{V()})}else z(!0,void 0)};V()}})},addLocalFolderAsync2:function(G,z){let N=this;G=typeof G==="object"?G:{localPath:G};let M=mD.resolve(K(G.localPath)),{zipPath:Z,filter:L,namefix:v}=G;if(L instanceof RegExp)L=function(b){return function(y){return b.test(y)}}(L);else if(typeof L!=="function")L=function(){return!0};if(Z=Z?K(Z):"",v==="latin1")v=(b)=>b.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"");if(typeof v!=="function")v=(b)=>b;let A=(b)=>mD.join(Z,v(H(M,b))),V=(b)=>mD.win32.basename(mD.win32.normalize(v(b)));F.fs.open(M,"r",function(b){if(b&&b.code==="ENOENT")z(void 0,hD.Errors.FILE_NOT_FOUND(M));else if(b)z(void 0,b);else F.findFilesAsync(M,function(y,_){if(y)return z(y);if(_=_.filter((n)=>L(A(n))),!_.length)z(void 0,!1);setImmediate(_.reverse().reduce(function(n,m){return function(UD,s){if(UD||s===!1)return setImmediate(n,UD,!1);N.addLocalFileAsync({localPath:m,zipPath:mD.dirname(A(m)),zipName:V(m)},n)}},z))})})},addLocalFolderPromise:function(G,z){return new Promise((N,M)=>{this.addLocalFolderAsync2(Object.assign({localPath:G},z),(Z,L)=>{if(Z)M(Z);if(L)N(this)})})},addFile:function(G,z,N,M){G=W(G);let Z=B(G),L=Z!=null;if(!L)Z=new h_(I),Z.entryName=G;Z.comment=N||"";let v=typeof M==="object"&&M instanceof F.fs.Stats;if(v)Z.header.time=M.mtime;var A=Z.isDirectory?16:0;let V=Z.isDirectory?16384:32768;if(v)V|=4095&M.mode;else if(typeof M==="number")V|=4095&M;else V|=Z.isDirectory?493:420;if(A=(A|V<<16)>>>0,Z.attr=A,Z.setData(z),!L)X.setEntry(Z);return Z},getEntries:function(G){return X.password=G,X?X.entries:[]},getEntry:function(G){return B(G)},getEntryCount:function(){return X.getEntryCount()},forEach:function(G){return X.forEach(G)},extractEntryTo:function(G,z,N,M,Z,L){M=E6(!1,M),Z=E6(!1,Z),N=E6(!0,N),L=GL(Z,L);var v=B(G);if(!v)throw hD.Errors.NO_ENTRY();var A=Q(v.entryName),V=Y(z,L&&!v.isDirectory?Q(L):N?A:mD.basename(A));if(v.isDirectory){var b=X.getEntryChildren(v);return b.forEach(function(n){if(n.isDirectory)return;var m=n.getData();if(!m)throw hD.Errors.CANT_EXTRACT_FILE();var UD=Q(N?n.entryName:n.entryName.substring(v.entryName.length)),s=Y(z,UD);let a=Z?n.header.fileAttr:void 0;F.writeFileTo(s,m,M,a)}),!0}var y=v.getData(X.password);if(!y)throw hD.Errors.CANT_EXTRACT_FILE();if(F.fs.existsSync(V)&&!M)throw hD.Errors.CANT_OVERRIDE();let _=Z?G.header.fileAttr:void 0;return F.writeFileTo(V,y,M,_),!0},test:function(G){if(!X)return!1;for(var z of X.entries)try{if(z.isDirectory)continue;var N=z.getData(G);if(!N)return!1}catch(M){return!1}return!0},extractAllTo:function(G,z,N,M){if(N=E6(!1,N),M=GL(N,M),z=E6(!1,z),!X)throw hD.Errors.NO_ZIP();let Z=[];X.entries.forEach(function(L){var v=Y(G,Q(L.entryName));if(L.isDirectory){if(F.makeDir(v),N)Z.push({path:v,attr:L.header.fileAttr});return}var A=L.getData(M);if(!A)throw hD.Errors.CANT_EXTRACT_FILE();let V=N?L.header.fileAttr:void 0;F.writeFileTo(v,A,z,V);try{F.fs.utimesSync(v,L.header.time,L.header.time)}catch(b){}}),J(Z)},extractAllToAsync:function(G,z,N,M){if(M=i_(z,N,M),N=E6(!1,N),z=E6(!1,z),!M)return new Promise((y,_)=>{this.extractAllToAsync(G,z,N,function(n){if(n)_(n);else y(this)})});if(!X){M(hD.Errors.NO_ZIP());return}G=mD.resolve(G);let Z=(y)=>Y(G,mD.normalize(Q(y.entryName))),L=(y,_)=>Error(y+': "'+_+'"'),v=[],A=[];X.entries.forEach((y)=>{if(y.isDirectory)v.push(y);else A.push(y)});let V=[];for(let y of v){let _=Z(y),n=N?y.header.fileAttr:void 0;try{F.makeDir(_)}catch(m){M(L("Unable to create folder",_));continue}if(n)V.push({path:_,attr:n});try{F.fs.utimesSync(_,y.header.time,y.header.time)}catch(m){}}let b=(y)=>{if(!y)try{J(V)}catch(_){return M(L("Unable to set folder permissions",_.path||""))}M(y)};A.reverse().reduce(function(y,_){return function(n){if(n)y(n);else{let m=mD.normalize(Q(_.entryName)),UD=Y(G,m);_.getDataAsync(function(s,a){if(a)y(a);else if(!s)y(hD.Errors.CANT_EXTRACT_FILE());else{let DD=N?_.header.fileAttr:void 0;F.writeFileToAsync(UD,s,z,DD,function(E){if(!E)return y(L("Unable to write file",UD));F.fs.utimes(UD,_.header.time,_.header.time,function(){y()})})}})}}},b)()},writeZip:function(G,z){if(arguments.length===1){if(typeof G==="function")z=G,G=""}if(!G&&I.filename)G=I.filename;if(!G)return;var N=X.compressToBuffer();if(N){var M=F.writeFileTo(G,N,!0);if(typeof z==="function")z(!M?Error("failed"):null,"")}},writeZipPromise:function(G,z){let{overwrite:N,perm:M}=Object.assign({overwrite:!0},z);return new Promise((Z,L)=>{if(!G&&I.filename)G=I.filename;if(!G)L("ADM-ZIP: ZIP File Name Missing");this.toBufferPromise().then((v)=>{let A=(V)=>V?Z(V):L("ADM-ZIP: Wasn't able to write zip file");F.writeFileToAsync(G,v,N,M,A)},L)})},toBufferPromise:function(){return new Promise((G,z)=>{X.toAsyncBuffer(G,z)})},toBuffer:function(G,z,N,M){if(typeof G==="function")return X.toAsyncBuffer(G,z,N,M),null;return X.compressToBuffer()}}}});var NL=C((K9D,d_)=>{d_.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Alpic",constant:"ALPIC",env:"ALPIC_HOST"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var XI=C((II)=>{var zL=NL(),iD=process.env;Object.defineProperty(II,"_vendors",{value:zL.map(function(D){return D.constant})});II.name=null;II.isPR=null;II.id=null;if(iD.CI!=="false")zL.forEach(function(D){let U=(Array.isArray(D.env)?D.env:[D.env]).every(function(I){return LL(I)});if(II[D.constant]=U,!U)return;II.name=D.name,II.isPR=c_(D),II.id=D.constant});II.isCI=!!(iD.CI!=="false"&&(iD.BUILD_ID||iD.BUILD_NUMBER||iD.CI||iD.CI_APP_ID||iD.CI_BUILD_ID||iD.CI_BUILD_NUMBER||iD.CI_NAME||iD.CONTINUOUS_INTEGRATION||iD.RUN_ID||II.name||!1));function LL(D){if(typeof D==="string")return!!iD[D];if("env"in D)return iD[D.env]&&iD[D.env].includes(D.includes);if("any"in D)return D.any.some(function($){return!!iD[$]});return Object.keys(D).every(function($){return iD[$]===D[$]})}function c_(D){switch(typeof D.pr){case"string":return!!iD[D.pr];case"object":if("env"in D.pr)if("any"in D.pr)return D.pr.any.some(function($){return iD[D.pr.env]===$});else return D.pr.env in iD&&iD[D.pr.env]!==D.pr.ne;else if("any"in D.pr)return D.pr.any.some(function($){return!!iD[$]});else return LL(D.pr);default:return null}}});var vL=C((q9D,EL)=>{var OL={};EL.exports=OL;var ML={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(ML).forEach(function(D){var $=ML[D],U=OL[D]=[];U.open="\x1B["+$[0]+"m",U.close="\x1B["+$[1]+"m"})});var jL=C((H9D,VL)=>{VL.exports=function(D,$){$=$||process.argv;var U=$.indexOf("--"),I=/^-{1,2}/.test(D)?"":"--",F=$.indexOf(I+D);return F!==-1&&(U===-1?!0:F<U)}});var RL=C((N9D,AL)=>{var r_=o("os"),D0=jL(),H$=process.env,m1=void 0;if(D0("no-color")||D0("no-colors")||D0("color=false"))m1=!1;else if(D0("color")||D0("colors")||D0("color=true")||D0("color=always"))m1=!0;if("FORCE_COLOR"in H$)m1=H$.FORCE_COLOR.length===0||parseInt(H$.FORCE_COLOR,10)!==0;function o_(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function t_(D){if(m1===!1)return 0;if(D0("color=16m")||D0("color=full")||D0("color=truecolor"))return 3;if(D0("color=256"))return 2;if(D&&!D.isTTY&&m1!==!0)return 0;var $=m1?1:0;if(process.platform==="win32"){var U=r_.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in H$){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(F){return F in H$})||H$.CI_NAME==="codeship")return 1;return $}if("TEAMCITY_VERSION"in H$)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(H$.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in H$){var I=parseInt((H$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(H$.TERM_PROGRAM){case"iTerm.app":return I>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(H$.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(H$.TERM))return 1;if("COLORTERM"in H$)return 1;if(H$.TERM==="dumb")return $;return $}function QI(D){var $=t_(D);return o_($)}AL.exports={supportsColor:QI,stdout:QI(process.stdout),stderr:QI(process.stderr)}});var TL=C((z9D,SL)=>{SL.exports=function($,U){var I="";$=$||"Run the trap, drop the bass",$=$.split("");var F={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return $.forEach(function(J){J=J.toLowerCase();var X=F[J]||[" "],Q=Math.floor(Math.random()*X.length);if(typeof F[J]<"u")I+=F[J][Q];else I+=J}),I}});var PL=C((L9D,bL)=>{bL.exports=function($,U){$=$||" he is here ";var I={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},F=[].concat(I.up,I.down,I.mid);function J(Y){var W=Math.floor(Math.random()*Y);return W}function X(Y){var W=!1;return F.filter(function(B){W=B===Y}),W}function Q(Y,W){var B="",K,q;W=W||{},W.up=typeof W.up<"u"?W.up:!0,W.mid=typeof W.mid<"u"?W.mid:!0,W.down=typeof W.down<"u"?W.down:!0,W.size=typeof W.size<"u"?W.size:"maxi",Y=Y.split("");for(q in Y){if(X(q))continue;switch(B=B+Y[q],K={up:0,down:0,mid:0},W.size){case"mini":K.up=J(8),K.mid=J(2),K.down=J(8);break;case"maxi":K.up=J(16)+3,K.mid=J(4)+1,K.down=J(64)+3;break;default:K.up=J(8)+1,K.mid=J(6)/2,K.down=J(8)+1;break}var H=["up","mid","down"];for(var G in H){var z=H[G];for(var N=0;N<=K[z];N++)if(W[z])B=B+I[z][J(I[z].length)]}}return B}return Q($,U)}});var uL=C((w9D,CL)=>{CL.exports=function(D){return function($,U,I){if($===" ")return $;switch(U%3){case 0:return D.red($);case 1:return D.white($);case 2:return D.blue($)}}}});var _L=C((Z9D,kL)=>{kL.exports=function(D){return function($,U,I){return U%2===0?$:D.inverse($)}}});var gL=C((M9D,xL)=>{xL.exports=function(D){var $=["red","yellow","green","blue","magenta"];return function(U,I,F){if(U===" ")return U;else return D[$[I++%$.length]](U)}}});var yL=C((O9D,fL)=>{fL.exports=function(D){var $=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(U,I,F){return U===" "?U:D[$[Math.round(Math.random()*($.length-2))]](U)}}});var lL=C((v9D,iL)=>{var HD={};iL.exports=HD;HD.themes={};var a_=o("util"),v6=HD.styles=vL(),mL=Object.defineProperties,s_=new RegExp(/[\r\n]+/g);HD.supportsColor=RL().supportsColor;if(typeof HD.enabled>"u")HD.enabled=HD.supportsColor()!==!1;HD.enable=function(){HD.enabled=!0};HD.disable=function(){HD.enabled=!1};HD.stripColors=HD.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var E9D=HD.stylize=function($,U){if(!HD.enabled)return $+"";var I=v6[U];if(!I&&U in HD)return HD[U]($);return I.open+$+I.close},e_=/[|\\{}()[\]^$+*?.]/g,Dx=function(D){if(typeof D!=="string")throw TypeError("Expected a string");return D.replace(e_,"\\$&")};function hL(D){var $=function U(){return Ux.apply(U,arguments)};return $._styles=D,$.__proto__=$x,$}var nL=function(){var D={};return v6.grey=v6.gray,Object.keys(v6).forEach(function($){v6[$].closeRe=new RegExp(Dx(v6[$].close),"g"),D[$]={get:function(){return hL(this._styles.concat($))}}}),D}(),$x=mL(function(){},nL);function Ux(){var D=Array.prototype.slice.call(arguments),$=D.map(function(X){if(X!=null&&X.constructor===String)return X;else return a_.inspect(X)}).join(" ");if(!HD.enabled||!$)return $;var U=$.indexOf(`
|
|
73
|
-
`)!=-1,I=this._styles,F=I.length;while(F--){var J=v6[I[F]];if($=J.open+$.replace(J.closeRe,J.open)+J.close,U)$=$.replace(s_,function(X){return J.close+X+J.open})}return $}HD.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var $ in D)(function(U){HD[U]=function(I){if(typeof D[U]==="object"){var F=I;for(var J in D[U])F=HD[D[U][J]](F);return F}return HD[D[U]](I)}})($)};function Fx(){var D={};return Object.keys(nL).forEach(function($){D[$]={get:function(){return hL([$])}}}),D}var Ix=function($,U){var I=U.split("");return I=I.map($),I.join("")};HD.trap=TL();HD.zalgo=PL();HD.maps={};HD.maps.america=uL()(HD);HD.maps.zebra=_L()(HD);HD.maps.rainbow=gL()(HD);HD.maps.random=yL()(HD);for(YI in HD.maps)(function(D){HD[D]=function($){return Ix(HD.maps[D],$)}})(YI);var YI;mL(HD,Fx())});var cL=C((
|
|
72
|
+
${K.stack}`}else{var N;Y=(N=X===null||X===void 0?void 0:X.stack)!==null&&N!==void 0?N:""}let M=this.url.toString().length;if((X===null||X===void 0?void 0:X.name)==="AbortError"||(X===null||X===void 0?void 0:X.code)==="ABORT_ERR"){if(B="",W="Request was aborted (timeout or manual cancellation)",M>this.urlLengthLimit)W+=`. Note: Your request URL is ${M} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`}else if((K===null||K===void 0?void 0:K.name)==="HeadersOverflowError"||(K===null||K===void 0?void 0:K.code)==="UND_ERR_HEADERS_OVERFLOW"){if(B="",W="HTTP headers exceeded server limits (typically 16KB)",M>this.urlLengthLimit)W+=`. Your request URL is ${M} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`}return{success:!1,error:{message:`${(Q=X===null||X===void 0?void 0:X.name)!==null&&Q!==void 0?Q:"FetchError"}: ${X===null||X===void 0?void 0:X.message}`,details:Y,hint:W,code:B},data:null,count:null,status:0,statusText:""}});return J.then(D,$)}async processResponse(D){var $=this;let U=null,I=null,F=null,J=D.status,X=D.statusText;if(D.ok){var Q,Y;if($.method!=="HEAD"){var W;let q=await D.text();if(q==="");else if($.headers.get("Accept")==="text/csv")I=q;else if($.headers.get("Accept")&&((W=$.headers.get("Accept"))===null||W===void 0?void 0:W.includes("application/vnd.pgrst.plan+text")))I=q;else try{I=JSON.parse(q)}catch(H){if(U={message:q},I=null,$.shouldThrowOnError)throw new cF({message:q,details:"",hint:"",code:""})}}let B=(Q=$.headers.get("Prefer"))===null||Q===void 0?void 0:Q.match(/count=(exact|planned|estimated)/),K=(Y=D.headers.get("content-range"))===null||Y===void 0?void 0:Y.split("/");if(B&&K&&K.length>1)F=parseInt(K[1]);if($.isMaybeSingle&&Array.isArray(I))if(I.length>1)U={code:"PGRST116",details:`Results contain ${I.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},I=null,F=null,J=406,X="Not Acceptable";else if(I.length===1)I=I[0];else I=null}else{let B=await D.text();try{if(U=JSON.parse(B),Array.isArray(U)&&D.status===404)I=[],U=null,J=200,X="OK"}catch(K){if(D.status===404&&B==="")J=204,X="No Content";else U={message:B}}if(U&&$.shouldThrowOnError)throw new cF(U)}return{success:U===null,error:U,data:I,count:F,status:J,statusText:X}}returns(){return this}overrideTypes(){return this}},Wk,Bz,_1,Bk=class{constructor(D,{headers:$={},schema:U,fetch:I,urlLengthLimit:F=8000,retry:J}){this.url=D,this.headers=new Headers($),this.schema=U,this.fetch=I,this.urlLengthLimit=F,this.retry=J}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(D,$){let{head:U=!1,count:I}=$!==null&&$!==void 0?$:{},F=U?"HEAD":"GET",J=!1,X=(D!==null&&D!==void 0?D:"*").split("").map((W)=>{if(/\s/.test(W)&&!J)return"";if(W==='"')J=!J;return W}).join(""),{url:Q,headers:Y}=this.cloneRequestState();if(Q.searchParams.set("select",X),I)Y.append("Prefer",`count=${I}`);return new _1({method:F,url:Q,headers:Y,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(D,{count:$,defaultToNull:U=!0}={}){var I;let F="POST",{url:J,headers:X}=this.cloneRequestState();if($)X.append("Prefer",`count=${$}`);if(!U)X.append("Prefer","missing=default");if(Array.isArray(D)){let Q=D.reduce((Y,W)=>Y.concat(Object.keys(W)),[]);if(Q.length>0){let Y=[...new Set(Q)].map((W)=>`"${W}"`);J.searchParams.set("columns",Y.join(","))}}return new _1({method:"POST",url:J,headers:X,schema:this.schema,body:D,fetch:(I=this.fetch)!==null&&I!==void 0?I:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(D,{onConflict:$,ignoreDuplicates:U=!1,count:I,defaultToNull:F=!0}={}){var J;let X="POST",{url:Q,headers:Y}=this.cloneRequestState();if(Y.append("Prefer",`resolution=${U?"ignore":"merge"}-duplicates`),$!==void 0)Q.searchParams.set("on_conflict",$);if(I)Y.append("Prefer",`count=${I}`);if(!F)Y.append("Prefer","missing=default");if(Array.isArray(D)){let W=D.reduce((B,K)=>B.concat(Object.keys(K)),[]);if(W.length>0){let B=[...new Set(W)].map((K)=>`"${K}"`);Q.searchParams.set("columns",B.join(","))}}return new _1({method:"POST",url:Q,headers:Y,schema:this.schema,body:D,fetch:(J=this.fetch)!==null&&J!==void 0?J:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(D,{count:$}={}){var U;let I="PATCH",{url:F,headers:J}=this.cloneRequestState();if($)J.append("Prefer",`count=${$}`);return new _1({method:"PATCH",url:F,headers:J,schema:this.schema,body:D,fetch:(U=this.fetch)!==null&&U!==void 0?U:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:D}={}){var $;let U="DELETE",{url:I,headers:F}=this.cloneRequestState();if(D)F.append("Prefer",`count=${D}`);return new _1({method:"DELETE",url:I,headers:F,schema:this.schema,fetch:($=this.fetch)!==null&&$!==void 0?$:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},qz=class D{constructor($,{headers:U={},schema:I,fetch:F,timeout:J,urlLengthLimit:X=8000,retry:Q}={}){this.url=$,this.headers=new Headers(U),this.schemaName=I,this.urlLengthLimit=X;let Y=F!==null&&F!==void 0?F:globalThis.fetch;if(J!==void 0&&J>0)this.fetch=(W,B)=>{let K=new AbortController,q=setTimeout(()=>K.abort(),J),H=B===null||B===void 0?void 0:B.signal;if(H){if(H.aborted)return clearTimeout(q),Y(W,B);let G=()=>{clearTimeout(q),K.abort()};return H.addEventListener("abort",G,{once:!0}),Y(W,H9(H9({},B),{},{signal:K.signal})).finally(()=>{clearTimeout(q),H.removeEventListener("abort",G)})}return Y(W,H9(H9({},B),{},{signal:K.signal})).finally(()=>clearTimeout(q))};else this.fetch=Y;this.retry=Q}from($){if(!$||typeof $!=="string"||$.trim()==="")throw Error("Invalid relation name: relation must be a non-empty string.");return new Bk(new URL(`${this.url}/${$}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema($){return new D(this.url,{headers:this.headers,schema:$,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc($,U={},{head:I=!1,get:F=!1,count:J}={}){var X;let Q,Y=new URL(`${this.url}/rpc/${$}`),W,B=(H)=>H!==null&&typeof H==="object"&&(!Array.isArray(H)||H.some(B)),K=I&&Object.values(U).some(B);if(K)Q="POST",W=U;else if(I||F)Q=I?"HEAD":"GET",Object.entries(U).filter(([H,G])=>G!==void 0).map(([H,G])=>[H,Array.isArray(G)?`{${G.join(",")}}`:`${G}`]).forEach(([H,G])=>{Y.searchParams.append(H,G)});else Q="POST",W=U;let q=new Headers(this.headers);if(K)q.set("Prefer",J?`count=${J},return=minimal`:"return=minimal");else if(J)q.set("Prefer",`count=${J}`);return new _1({method:Q,url:Y,headers:q,schema:this.schemaName,body:W,fetch:(X=this.fetch)!==null&&X!==void 0?X:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};var Hz=T(()=>{Xk=[520,503],Gz=["GET","HEAD","OPTIONS"],cF=class extends Error{constructor(D){super(D.message);this.name="PostgrestError",this.details=D.details,this.hint=D.hint,this.code=D.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};Wk=class extends Yk{throwOnError(){return super.throwOnError()}select(D){let $=!1,U=(D!==null&&D!==void 0?D:"*").split("").map((I)=>{if(/\s/.test(I)&&!$)return"";if(I==='"')$=!$;return I}).join("");return this.url.searchParams.set("select",U),this.headers.append("Prefer","return=representation"),this}order(D,{ascending:$=!0,nullsFirst:U,foreignTable:I,referencedTable:F=I}={}){let J=F?`${F}.order`:"order",X=this.url.searchParams.get(J);return this.url.searchParams.set(J,`${X?`${X},`:""}${D}.${$?"asc":"desc"}${U===void 0?"":U?".nullsfirst":".nullslast"}`),this}limit(D,{foreignTable:$,referencedTable:U=$}={}){let I=typeof U>"u"?"limit":`${U}.limit`;return this.url.searchParams.set(I,`${D}`),this}range(D,$,{foreignTable:U,referencedTable:I=U}={}){let F=typeof I>"u"?"offset":`${I}.offset`,J=typeof I>"u"?"limit":`${I}.limit`;return this.url.searchParams.set(F,`${D}`),this.url.searchParams.set(J,`${$-D+1}`),this}abortSignal(D){return this.signal=D,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:D=!1,verbose:$=!1,settings:U=!1,buffers:I=!1,wal:F=!1,format:J="text"}={}){var X;let Q=[D?"analyze":null,$?"verbose":null,U?"settings":null,I?"buffers":null,F?"wal":null].filter(Boolean).join("|"),Y=(X=this.headers.get("Accept"))!==null&&X!==void 0?X:"application/json";if(this.headers.set("Accept",`application/vnd.pgrst.plan+${J}; for="${Y}"; options=${Q};`),J==="json")return this;else return this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(D){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${D}`),this}},Bz=new RegExp("[,()]"),_1=class extends Wk{throwOnError(){return super.throwOnError()}eq(D,$){return this.url.searchParams.append(D,`eq.${$}`),this}neq(D,$){return this.url.searchParams.append(D,`neq.${$}`),this}gt(D,$){return this.url.searchParams.append(D,`gt.${$}`),this}gte(D,$){return this.url.searchParams.append(D,`gte.${$}`),this}lt(D,$){return this.url.searchParams.append(D,`lt.${$}`),this}lte(D,$){return this.url.searchParams.append(D,`lte.${$}`),this}like(D,$){return this.url.searchParams.append(D,`like.${$}`),this}likeAllOf(D,$){return this.url.searchParams.append(D,`like(all).{${$.join(",")}}`),this}likeAnyOf(D,$){return this.url.searchParams.append(D,`like(any).{${$.join(",")}}`),this}ilike(D,$){return this.url.searchParams.append(D,`ilike.${$}`),this}ilikeAllOf(D,$){return this.url.searchParams.append(D,`ilike(all).{${$.join(",")}}`),this}ilikeAnyOf(D,$){return this.url.searchParams.append(D,`ilike(any).{${$.join(",")}}`),this}regexMatch(D,$){return this.url.searchParams.append(D,`match.${$}`),this}regexIMatch(D,$){return this.url.searchParams.append(D,`imatch.${$}`),this}is(D,$){return this.url.searchParams.append(D,`is.${$}`),this}isDistinct(D,$){return this.url.searchParams.append(D,`isdistinct.${$}`),this}in(D,$){let U=Array.from(new Set($)).map((I)=>{if(typeof I==="string"&&Bz.test(I))return`"${I}"`;else return`${I}`}).join(",");return this.url.searchParams.append(D,`in.(${U})`),this}notIn(D,$){let U=Array.from(new Set($)).map((I)=>{if(typeof I==="string"&&Bz.test(I))return`"${I}"`;else return`${I}`}).join(",");return this.url.searchParams.append(D,`not.in.(${U})`),this}contains(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cs.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cs.{${$.join(",")}}`);else this.url.searchParams.append(D,`cs.${JSON.stringify($)}`);return this}containedBy(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cd.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cd.{${$.join(",")}}`);else this.url.searchParams.append(D,`cd.${JSON.stringify($)}`);return this}rangeGt(D,$){return this.url.searchParams.append(D,`sr.${$}`),this}rangeGte(D,$){return this.url.searchParams.append(D,`nxl.${$}`),this}rangeLt(D,$){return this.url.searchParams.append(D,`sl.${$}`),this}rangeLte(D,$){return this.url.searchParams.append(D,`nxr.${$}`),this}rangeAdjacent(D,$){return this.url.searchParams.append(D,`adj.${$}`),this}overlaps(D,$){if(typeof $==="string")this.url.searchParams.append(D,`ov.${$}`);else this.url.searchParams.append(D,`ov.{${$.join(",")}}`);return this}textSearch(D,$,{config:U,type:I}={}){let F="";if(I==="plain")F="pl";else if(I==="phrase")F="ph";else if(I==="websearch")F="w";let J=U===void 0?"":`(${U})`;return this.url.searchParams.append(D,`${F}fts${J}.${$}`),this}match(D){return Object.entries(D).filter(([$,U])=>U!==void 0).forEach(([$,U])=>{this.url.searchParams.append($,`eq.${U}`)}),this}not(D,$,U){return this.url.searchParams.append(D,`not.${$}.${U}`),this}or(D,{foreignTable:$,referencedTable:U=$}={}){let I=U?`${U}.or`:"or";return this.url.searchParams.append(I,`(${D})`),this}filter(D,$,U){return this.url.searchParams.append(D,`${$}.${U}`),this}}});class pF{constructor(){}connect(){}disconnect(){}}function Hk(D,$,U){let I=new URL($,D);if(U){for(let[F,J]of Object.entries(U))if(J!==void 0)I.searchParams.set(F,J)}return I.toString()}async function Nk(D){if(!D||D.type==="none")return{};if(D.type==="bearer")return{Authorization:`Bearer ${D.token}`};if(D.type==="header")return{[D.name]:D.value};if(D.type==="custom")return await D.getHeaders();return{}}function zk(D){let $=D.fetchImpl??globalThis.fetch;return{async request({method:U,path:I,query:F,body:J,headers:X}){let Q=Hk(D.baseUrl,I,F),Y=await Nk(D.auth),W=await $(Q,{method:U,headers:{...J?{"Content-Type":"application/json"}:{},...Y,...X},body:J?JSON.stringify(J):void 0}),B=await W.text(),K=(W.headers.get("content-type")||"").includes("application/json"),q=K&&B?JSON.parse(B):B;if(!W.ok){let H=K?q:void 0,G=H?.error;throw new _2(G?.message??`Request failed with status ${W.status}`,{status:W.status,icebergType:G?.type,icebergCode:G?.code,details:H})}return{status:W.status,headers:W.headers,data:q}}}}function N9(D){return D.join("\x1F")}function x1(D){return D.join("\x1F")}var _2,Lk=class{constructor(D,$=""){this.client=D,this.prefix=$}async listNamespaces(D){let $=D?{parent:N9(D.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:$})).data.namespaces.map((I)=>({namespace:I}))}async createNamespace(D,$){let U={namespace:D.namespace,properties:$?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:U})).data}async dropNamespace(D){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${N9(D.namespace)}`})}async loadNamespaceMetadata(D){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${N9(D.namespace)}`})).data.properties}}async namespaceExists(D){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${N9(D.namespace)}`}),!0}catch($){if($ instanceof _2&&$.status===404)return!1;throw $}}async createNamespaceIfNotExists(D,$){try{return await this.createNamespace(D,$)}catch(U){if(U instanceof _2&&U.status===409)return;throw U}}},wk=class{constructor(D,$="",U){this.client=D,this.prefix=$,this.accessDelegation=U}async listTables(D){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables`})).data.identifiers}async createTable(D,$){let U={};if(this.accessDelegation)U["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables`,body:$,headers:U})).data.metadata}async updateTable(D,$){let U=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,body:$});return{"metadata-location":U.data["metadata-location"],metadata:U.data.metadata}}async dropTable(D,$){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,query:{purgeRequested:String($?.purge??!1)}})}async loadTable(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,headers:$})).data.metadata}async tableExists(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${x1(D.namespace)}/tables/${D.name}`,headers:$}),!0}catch(U){if(U instanceof _2&&U.status===404)return!1;throw U}}async createTableIfNotExists(D,$){try{return await this.createTable(D,$)}catch(U){if(U instanceof _2&&U.status===409)return await this.loadTable({namespace:D.namespace,name:$.name});throw U}}},Nz=class{constructor(D){let $="v1";if(D.catalogName)$+=`/${D.catalogName}`;let U=D.baseUrl.endsWith("/")?D.baseUrl:`${D.baseUrl}/`;this.client=zk({baseUrl:U,auth:D.auth,fetchImpl:D.fetch}),this.accessDelegation=D.accessDelegation?.join(","),this.namespaceOps=new Lk(this.client,$),this.tableOps=new wk(this.client,$,this.accessDelegation)}async listNamespaces(D){return this.namespaceOps.listNamespaces(D)}async createNamespace(D,$){return this.namespaceOps.createNamespace(D,$)}async dropNamespace(D){await this.namespaceOps.dropNamespace(D)}async loadNamespaceMetadata(D){return this.namespaceOps.loadNamespaceMetadata(D)}async listTables(D){return this.tableOps.listTables(D)}async createTable(D,$){return this.tableOps.createTable(D,$)}async updateTable(D,$){return this.tableOps.updateTable(D,$)}async dropTable(D,$){await this.tableOps.dropTable(D,$)}async loadTable(D){return this.tableOps.loadTable(D)}async namespaceExists(D){return this.namespaceOps.namespaceExists(D)}async tableExists(D){return this.tableOps.tableExists(D)}async createNamespaceIfNotExists(D,$){return this.namespaceOps.createNamespaceIfNotExists(D,$)}async createTableIfNotExists(D,$){return this.tableOps.createTableIfNotExists(D,$)}};var zz=T(()=>{_2=class extends Error{constructor(D,$){super(D);this.name="IcebergError",this.status=$.status,this.icebergType=$.icebergType,this.icebergCode=$.icebergCode,this.details=$.details,this.isCommitStateUnknown=$.icebergType==="CommitStateUnknownException"||[500,502,504].includes($.status)&&$.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}}});function g2(D){return g2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},g2(D)}function Zk(D,$){if(g2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(g2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function Mk(D){var $=Zk(D,"string");return g2($)=="symbol"?$:$+""}function Ok(D,$,U){return($=Mk($))in D?Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[$]=U,D}function Lz(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function ID(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Lz(Object(U),!0).forEach(function(I){Ok(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Lz(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function Z9(D){return typeof D==="object"&&D!==null&&"__isStorageError"in D}function L9(D,$,U){let I=ID({},D),F=$.toLowerCase();for(let J of Object.keys(I))if(J.toLowerCase()===F)delete I[J];return I[F]=U,I}function Ek(D){let $={};for(let[U,I]of Object.entries(D))$[U.toLowerCase()]=I;return $}async function x2(D,$,U,I,F,J,X){return new Promise((Q,Y)=>{D(U,Rk($,I,F,J)).then((W)=>{if(!W.ok)throw W;if(I===null||I===void 0?void 0:I.noResolveJson)return W;if(X==="vectors"){let B=W.headers.get("content-type");if(W.headers.get("content-length")==="0"||W.status===204)return{};if(!B||!B.includes("application/json"))return{}}return W.json()}).then((W)=>Q(W)).catch((W)=>Ak(W,Y,I,X))})}function Ez(D="storage"){return{get:async($,U,I,F)=>{return x2($,"GET",U,I,F,void 0,D)},post:async($,U,I,F,J)=>{return x2($,"POST",U,F,J,I,D)},put:async($,U,I,F,J)=>{return x2($,"PUT",U,F,J,I,D)},head:async($,U,I,F)=>{return x2($,"HEAD",U,ID(ID({},I),{},{noResolveJson:!0}),F,void 0,D)},remove:async($,U,I,F,J)=>{return x2($,"DELETE",U,F,J,I,D)}}}var w9,z9,Mz,vk=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},Vk=(D)=>{if(typeof D!=="object"||D===null)return!1;let $=Object.getPrototypeOf(D);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in D)&&!(Symbol.iterator in D)},oF=(D)=>{if(Array.isArray(D))return D.map((U)=>oF(U));else if(typeof D==="function"||D!==Object(D))return D;let $={};return Object.entries(D).forEach(([U,I])=>{let F=U.replace(/([-_][a-z])/gi,(J)=>J.toUpperCase().replace(/[-_]/g,""));$[F]=oF(I)}),$},jk=(D)=>{if(!D||typeof D!=="string")return!1;if(D.length===0||D.length>100)return!1;if(D.trim()!==D)return!1;if(D.includes("/")||D.includes("\\"))return!1;return/^[\w!.\*'() &$@=;:+,?-]+$/.test(D)},Oz=(D)=>D.split("/").map(encodeURIComponent).join("/"),wz=(D)=>{if(typeof D==="object"&&D!==null){let $=D;if(typeof $.msg==="string")return $.msg;if(typeof $.message==="string")return $.message;if(typeof $.error_description==="string")return $.error_description;if(typeof $.error==="string")return $.error;if(typeof $.error==="object"&&$.error!==null){let U=$.error;if(typeof U.message==="string")return U.message}}return JSON.stringify(D)},Ak=async(D,$,U,I)=>{if(D!==null&&typeof D==="object"&&"json"in D&&typeof D.json==="function"){let F=D,J=parseInt(String(F.status),10);if(!Number.isFinite(J))J=500;F.json().then((X)=>{let Q=(X===null||X===void 0?void 0:X.statusCode)||(X===null||X===void 0?void 0:X.code)||J+"";$(new z9(wz(X),J,Q,I))}).catch(()=>{let X=J+"";$(new z9(F.statusText||`HTTP ${J} error`,J,X,I))})}else $(new Mz(wz(D),D,I))},Rk=(D,$,U,I)=>{let F={method:D,headers:($===null||$===void 0?void 0:$.headers)||{}};if(D==="GET"||D==="HEAD"||!I)return ID(ID({},F),U);if(Vk(I)){var J;let X=($===null||$===void 0?void 0:$.headers)||{},Q;for(let[Y,W]of Object.entries(X))if(Y.toLowerCase()==="content-type")Q=W;F.headers=L9(X,"Content-Type",(J=Q)!==null&&J!==void 0?J:"application/json"),F.body=JSON.stringify(I)}else F.body=I;if($===null||$===void 0?void 0:$.duplex)F.duplex=$.duplex;return ID(ID({},F),U)},Sk,f2,e$,tF,Tk,y2,k$,g1=class{constructor(D,$={},U,I="storage"){this.shouldThrowOnError=!1,this.url=D,this.headers=Ek($),this.fetch=vk(U),this.namespace=I}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(D,$){return this.headers=L9(this.headers,D,$),this}async handleOperation(D){var $=this;try{return{data:await D(),error:null}}catch(U){if($.shouldThrowOnError)throw U;if(Z9(U))return{data:null,error:U};throw U}}},vz,bk=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$,this[vz]="StreamDownloadBuilder",this.promise=null}then(D,$){return this.getPromise().then(D,$)}catch(D){return this.getPromise().catch(D)}finally(D){return this.getPromise().finally(D)}getPromise(){if(!this.promise)this.promise=this.execute();return this.promise}async execute(){var D=this;try{return{data:(await D.downloadFn()).body,error:null}}catch($){if(D.shouldThrowOnError)throw $;if(Z9($))return{data:null,error:$};throw $}}},Vz,Pk=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$,this[Vz]="BlobDownloadBuilder",this.promise=null}asStream(){return new bk(this.downloadFn,this.shouldThrowOnError)}then(D,$){return this.getPromise().then(D,$)}catch(D){return this.getPromise().catch(D)}finally(D){return this.getPromise().finally(D)}getPromise(){if(!this.promise)this.promise=this.execute();return this.promise}async execute(){var D=this;try{return{data:await(await D.downloadFn()).blob(),error:null}}catch($){if(D.shouldThrowOnError)throw $;if(Z9($))return{data:null,error:$};throw $}}},rF,Zz,Ck,uk="2.110.8",m2,kk,_k,xk,gk,fk,yk,mk,hk,jz;var Az=T(()=>{zz();w9=class extends Error{constructor(D,$="storage",U,I){super(D);this.__isStorageError=!0,this.namespace=$,this.name=$==="vectors"?"StorageVectorsError":"StorageError",this.status=U,this.statusCode=I}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};z9=class extends w9{constructor(D,$,U,I="storage"){super(D,I,$,U);this.name=I==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=$,this.statusCode=U}toJSON(){return ID({},super.toJSON())}},Mz=class extends w9{constructor(D,$,U="storage"){super(D,U);this.name=U==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=$}};Sk=Ez("storage"),{get:f2,post:e$,put:tF,head:Tk,remove:y2}=Sk,k$=Ez("vectors");vz=Symbol.toStringTag;Vz=Symbol.toStringTag;rF={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Zz={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Ck=class extends g1{constructor(D,$={},U,I){super(D,$,I,"storage");this.bucketId=U}async uploadOrUpdate(D,$,U,I){var F=this;return F.handleOperation(async()=>{let J,X=ID(ID({},Zz),I),Q=ID(ID({},F.headers),D==="POST"&&{"x-upsert":String(X.upsert)}),Y=X.metadata;if(typeof Blob<"u"&&U instanceof Blob){if(J=new FormData,J.append("cacheControl",X.cacheControl),Y)J.append("metadata",F.encodeMetadata(Y));J.append("",U)}else if(typeof FormData<"u"&&U instanceof FormData){if(J=U,!J.has("cacheControl"))J.append("cacheControl",X.cacheControl);if(Y&&!J.has("metadata"))J.append("metadata",F.encodeMetadata(Y))}else{if(J=U,Q["cache-control"]=`max-age=${X.cacheControl}`,Q["content-type"]=X.contentType,Y)Q["x-metadata"]=F.toBase64(F.encodeMetadata(Y));if((typeof ReadableStream<"u"&&J instanceof ReadableStream||J&&typeof J==="object"&&("pipe"in J)&&typeof J.pipe==="function")&&!X.duplex)X.duplex="half"}if(I===null||I===void 0?void 0:I.headers)for(let[q,H]of Object.entries(I.headers))Q=L9(Q,q,H);let W=F._removeEmptyFolders($),B=F._getFinalPath(W),K=await(D=="PUT"?tF:e$)(F.fetch,`${F.url}/object/${B}`,J,ID({headers:Q},(X===null||X===void 0?void 0:X.duplex)?{duplex:X.duplex}:{}));return{path:W,id:K.Id,fullPath:K.Key}})}async upload(D,$,U){return this.uploadOrUpdate("POST",D,$,U)}async uploadToSignedUrl(D,$,U,I){var F=this;let J=F._removeEmptyFolders(D),X=F._getFinalPath(J),Q=new URL(F.url+`/object/upload/sign/${X}`);return Q.searchParams.set("token",$),F.handleOperation(async()=>{let Y,W=ID(ID({},Zz),I),B=ID(ID({},F.headers),{"x-upsert":String(W.upsert)}),K=W.metadata;if(typeof Blob<"u"&&U instanceof Blob){if(Y=new FormData,Y.append("cacheControl",W.cacheControl),K)Y.append("metadata",F.encodeMetadata(K));Y.append("",U)}else if(typeof FormData<"u"&&U instanceof FormData){if(Y=U,!Y.has("cacheControl"))Y.append("cacheControl",W.cacheControl);if(K&&!Y.has("metadata"))Y.append("metadata",F.encodeMetadata(K))}else{if(Y=U,B["cache-control"]=`max-age=${W.cacheControl}`,B["content-type"]=W.contentType,K)B["x-metadata"]=F.toBase64(F.encodeMetadata(K));if((typeof ReadableStream<"u"&&Y instanceof ReadableStream||Y&&typeof Y==="object"&&("pipe"in Y)&&typeof Y.pipe==="function")&&!W.duplex)W.duplex="half"}if(I===null||I===void 0?void 0:I.headers)for(let[q,H]of Object.entries(I.headers))B=L9(B,q,H);return{path:J,fullPath:(await tF(F.fetch,Q.toString(),Y,ID({headers:B},(W===null||W===void 0?void 0:W.duplex)?{duplex:W.duplex}:{}))).Key}})}async createSignedUploadUrl(D,$){var U=this;return U.handleOperation(async()=>{let I=U._getFinalPath(D),F=ID({},U.headers);if($===null||$===void 0?void 0:$.upsert)F["x-upsert"]="true";let J=await e$(U.fetch,`${U.url}/object/upload/sign/${I}`,{},{headers:F}),X=new URL(U.url+J.url),Q=X.searchParams.get("token");if(!Q)throw new w9("No token returned by API");return{signedUrl:X.toString(),path:D,token:Q}})}async update(D,$,U){return this.uploadOrUpdate("PUT",D,$,U)}async move(D,$,U){var I=this;return I.handleOperation(async()=>{return await e$(I.fetch,`${I.url}/object/move`,{bucketId:I.bucketId,sourceKey:D,destinationKey:$,destinationBucket:U===null||U===void 0?void 0:U.destinationBucket},{headers:I.headers})})}async copy(D,$,U){var I=this;return I.handleOperation(async()=>{return{path:(await e$(I.fetch,`${I.url}/object/copy`,{bucketId:I.bucketId,sourceKey:D,destinationKey:$,destinationBucket:U===null||U===void 0?void 0:U.destinationBucket},{headers:I.headers})).Key}})}async createSignedUrl(D,$,U){var I=this;return I.handleOperation(async()=>{let F=I._getFinalPath(D),J=typeof(U===null||U===void 0?void 0:U.transform)==="object"&&U.transform!==null&&Object.keys(U.transform).length>0,X=await e$(I.fetch,`${I.url}/object/sign/${F}`,ID({expiresIn:$},J?{transform:U.transform}:{}),{headers:I.headers}),Q=new URLSearchParams;if(U===null||U===void 0?void 0:U.download)Q.set("download",U.download===!0?"":U.download);if((U===null||U===void 0?void 0:U.cacheNonce)!=null)Q.set("cacheNonce",String(U.cacheNonce));let Y=Q.toString();return{signedUrl:encodeURI(`${I.url}${X.signedURL}${Y?`&${Y}`:""}`)}})}async createSignedUrls(D,$,U){var I=this;return I.handleOperation(async()=>{let F=await e$(I.fetch,`${I.url}/object/sign/${I.bucketId}`,{expiresIn:$,paths:D},{headers:I.headers}),J=new URLSearchParams;if(U===null||U===void 0?void 0:U.download)J.set("download",U.download===!0?"":U.download);if((U===null||U===void 0?void 0:U.cacheNonce)!=null)J.set("cacheNonce",String(U.cacheNonce));let X=J.toString();return F.map((Q)=>ID(ID({},Q),{},{signedUrl:Q.signedURL?encodeURI(`${I.url}${Q.signedURL}${X?`&${X}`:""}`):null}))})}download(D,$,U){let I=typeof($===null||$===void 0?void 0:$.transform)==="object"&&$.transform!==null&&Object.keys($.transform).length>0?"render/image/authenticated":"object",F=new URLSearchParams;if($===null||$===void 0?void 0:$.transform)this.applyTransformOptsToQuery(F,$.transform);if(($===null||$===void 0?void 0:$.cacheNonce)!=null)F.set("cacheNonce",String($.cacheNonce));let J=F.toString(),X=this._getFinalPath(D);return new Pk(()=>f2(this.fetch,`${this.url}/${I}/${X}${J?`?${J}`:""}`,{headers:this.headers,noResolveJson:!0},U),this.shouldThrowOnError)}async info(D){var $=this;let U=$._getFinalPath(D);return $.handleOperation(async()=>{return oF(await f2($.fetch,`${$.url}/object/info/${U}`,{headers:$.headers}))})}async exists(D){var $=this;let U=$._getFinalPath(D);try{return await Tk($.fetch,`${$.url}/object/${U}`,{headers:$.headers}),{data:!0,error:null}}catch(F){if($.shouldThrowOnError)throw F;if(Z9(F)){var I;let J=F instanceof z9?F.status:F instanceof Mz?(I=F.originalError)===null||I===void 0?void 0:I.status:void 0;if(J!==void 0&&[400,404].includes(J))return{data:!1,error:F}}throw F}}getPublicUrl(D,$){let U=this._getFinalPath(D),I=new URLSearchParams;if($===null||$===void 0?void 0:$.download)I.set("download",$.download===!0?"":$.download);if($===null||$===void 0?void 0:$.transform)this.applyTransformOptsToQuery(I,$.transform);if(($===null||$===void 0?void 0:$.cacheNonce)!=null)I.set("cacheNonce",String($.cacheNonce));let F=I.toString(),J=typeof($===null||$===void 0?void 0:$.transform)==="object"&&$.transform!==null&&Object.keys($.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${J}/public/${U}`)+(F?`?${F}`:"")}}}async remove(D){var $=this;return $.handleOperation(async()=>{return await y2($.fetch,`${$.url}/object/${$.bucketId}`,{prefixes:D},{headers:$.headers})})}async purgeCache(D,$,U){var I=this;return I.handleOperation(async()=>{let F=Oz(I._getFinalPath(D)),J=new URLSearchParams;if($===null||$===void 0?void 0:$.transformations)J.set("transformations","true");let X=J.toString();return await y2(I.fetch,`${I.url}/cdn/${F}${X?`?${X}`:""}`,{},{headers:I.headers},U)})}async list(D,$,U){var I=this;return I.handleOperation(async()=>{let F=($===null||$===void 0?void 0:$.sortBy)?ID(ID({},rF.sortBy),$.sortBy):rF.sortBy,J=ID(ID(ID({},rF),$),{},{sortBy:F,prefix:D||""});return await e$(I.fetch,`${I.url}/object/list/${I.bucketId}`,J,{headers:I.headers},U)})}async listV2(D,$){var U=this;return U.handleOperation(async()=>{let I=ID({},D);return await e$(U.fetch,`${U.url}/object/list-v2/${U.bucketId}`,I,{headers:U.headers},$)})}encodeMetadata(D){return JSON.stringify(D)}toBase64(D){if(typeof Buffer<"u")return Buffer.from(D).toString("base64");return btoa(D)}_getFinalPath(D){return`${this.bucketId}/${D.replace(/^\/+/,"")}`}_removeEmptyFolders(D){return D.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(D,$){if($.width)D.set("width",$.width.toString());if($.height)D.set("height",$.height.toString());if($.resize)D.set("resize",$.resize);if($.format)D.set("format",$.format);if($.quality)D.set("quality",$.quality.toString());return D}},m2={"X-Client-Info":`storage-js/${uk}`},kk=class extends g1{constructor(D,$={},U,I){let F=new URL(D);if(I===null||I===void 0?void 0:I.useNewHostname){if(/supabase\.(co|in|red)$/.test(F.hostname)&&!F.hostname.includes("storage.supabase."))F.hostname=F.hostname.replace("supabase.","storage.supabase.")}let J=F.href.replace(/\/$/,""),X=ID(ID({},m2),$);super(J,X,U,"storage")}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let U=$.listBucketOptionsToQueryString(D);return await f2($.fetch,`${$.url}/bucket${U}`,{headers:$.headers})})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await f2($.fetch,`${$.url}/bucket/${D}`,{headers:$.headers})})}async createBucket(D,$={public:!1}){var U=this;return U.handleOperation(async()=>{return await e$(U.fetch,`${U.url}/bucket`,{id:D,name:D,type:$.type,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:U.headers})})}async updateBucket(D,$){var U=this;return U.handleOperation(async()=>{return await tF(U.fetch,`${U.url}/bucket/${D}`,{id:D,name:D,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:U.headers})})}async emptyBucket(D){var $=this;return $.handleOperation(async()=>{return await e$($.fetch,`${$.url}/bucket/${D}/empty`,{},{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await y2($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}async purgeBucketCache(D,$,U){var I=this;return I.handleOperation(async()=>{let F=new URLSearchParams;if($===null||$===void 0?void 0:$.transformations)F.set("transformations","true");let J=F.toString();return await y2(I.fetch,`${I.url}/cdn/${Oz(D)}${J?`?${J}`:""}`,{},{headers:I.headers},U)})}listBucketOptionsToQueryString(D){let $={};if(D){if("limit"in D)$.limit=String(D.limit);if("offset"in D)$.offset=String(D.offset);if(D.search)$.search=D.search;if(D.sortColumn)$.sortColumn=D.sortColumn;if(D.sortOrder)$.sortOrder=D.sortOrder}return Object.keys($).length>0?"?"+new URLSearchParams($).toString():""}},_k=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),$);super(I,F,U,"storage")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await e$($.fetch,`${$.url}/bucket`,{name:D},{headers:$.headers})})}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let U=new URLSearchParams;if((D===null||D===void 0?void 0:D.limit)!==void 0)U.set("limit",D.limit.toString());if((D===null||D===void 0?void 0:D.offset)!==void 0)U.set("offset",D.offset.toString());if(D===null||D===void 0?void 0:D.sortColumn)U.set("sortColumn",D.sortColumn);if(D===null||D===void 0?void 0:D.sortOrder)U.set("sortOrder",D.sortOrder);if(D===null||D===void 0?void 0:D.search)U.set("search",D.search);let I=U.toString(),F=I?`${$.url}/bucket?${I}`:`${$.url}/bucket`;return await f2($.fetch,F,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await y2($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}from(D){var $=this;if(!jk(D))throw new w9("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let U=new Nz({baseUrl:this.url,catalogName:D,auth:{type:"custom",getHeaders:async()=>$.headers},fetch:this.fetch}),I=this.shouldThrowOnError;return new Proxy(U,{get(F,J){let X=F[J];if(typeof X!=="function")return X;return async(...Q)=>{try{return{data:await X.apply(F,Q),error:null}}catch(Y){if(I)throw Y;return{data:null,error:Y}}}}})}},xk=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),{},{"Content-Type":"application/json"},$);super(I,F,U,"vectors")}async createIndex(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/CreateIndex`,D,{headers:$.headers})||{}})}async getIndex(D,$){var U=this;return U.handleOperation(async()=>{return await k$.post(U.fetch,`${U.url}/GetIndex`,{vectorBucketName:D,indexName:$},{headers:U.headers})})}async listIndexes(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/ListIndexes`,D,{headers:$.headers})})}async deleteIndex(D,$){var U=this;return U.handleOperation(async()=>{return await k$.post(U.fetch,`${U.url}/DeleteIndex`,{vectorBucketName:D,indexName:$},{headers:U.headers})||{}})}},gk=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),{},{"Content-Type":"application/json"},$);super(I,F,U,"vectors")}async putVectors(D){var $=this;if(D.vectors.length<1||D.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/PutVectors`,D,{headers:$.headers})||{}})}async getVectors(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/GetVectors`,D,{headers:$.headers})})}async listVectors(D){var $=this;if(D.segmentCount!==void 0){if(D.segmentCount<1||D.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(D.segmentIndex!==void 0){if(D.segmentIndex<0||D.segmentIndex>=D.segmentCount)throw Error(`segmentIndex must be between 0 and ${D.segmentCount-1}`)}}return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/ListVectors`,D,{headers:$.headers})})}async queryVectors(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/QueryVectors`,D,{headers:$.headers})})}async deleteVectors(D){var $=this;if(D.keys.length<1||D.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/DeleteVectors`,D,{headers:$.headers})||{}})}},fk=class extends g1{constructor(D,$={},U){let I=D.replace(/\/$/,""),F=ID(ID({},m2),{},{"Content-Type":"application/json"},$);super(I,F,U,"vectors")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/CreateVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/GetVectorBucket`,{vectorBucketName:D},{headers:$.headers})})}async listBuckets(D={}){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/ListVectorBuckets`,D,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await k$.post($.fetch,`${$.url}/DeleteVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}},yk=class extends fk{constructor(D,$={}){super(D,$.headers||{},$.fetch)}from(D){return new mk(this.url,this.headers,D,this.fetch)}async createBucket(D){var $=()=>super.createBucket,U=this;return $().call(U,D)}async getBucket(D){var $=()=>super.getBucket,U=this;return $().call(U,D)}async listBuckets(D={}){var $=()=>super.listBuckets,U=this;return $().call(U,D)}async deleteBucket(D){var $=()=>super.deleteBucket,U=this;return $().call(U,D)}},mk=class extends xk{constructor(D,$,U,I){super(D,$,I);this.vectorBucketName=U}async createIndex(D){var $=()=>super.createIndex,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName}))}async listIndexes(D={}){var $=()=>super.listIndexes,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName}))}async getIndex(D){var $=()=>super.getIndex,U=this;return $().call(U,U.vectorBucketName,D)}async deleteIndex(D){var $=()=>super.deleteIndex,U=this;return $().call(U,U.vectorBucketName,D)}index(D){return new hk(this.url,this.headers,this.vectorBucketName,D,this.fetch)}},hk=class extends gk{constructor(D,$,U,I,F){super(D,$,F);this.vectorBucketName=U,this.indexName=I}async putVectors(D){var $=()=>super.putVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async getVectors(D){var $=()=>super.getVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async listVectors(D={}){var $=()=>super.listVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async queryVectors(D){var $=()=>super.queryVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}async deleteVectors(D){var $=()=>super.deleteVectors,U=this;return $().call(U,ID(ID({},D),{},{vectorBucketName:U.vectorBucketName,indexName:U.indexName}))}},jz=class extends kk{constructor(D,$={},U,I){super(D,$,U,I)}from(D){return new Ck(this.url,this.headers,D,this.fetch)}get vectors(){return new yk(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new _k(this.url+"/iceberg",this.headers,this.fetch)}}});class Rz{constructor(D){return this.options=D,new Proxy(this,ik)}}var nk=()=>Promise.resolve({data:{session:null,user:null},error:null}),ik,aF;var sF=T(()=>{ik={get:(D,$)=>{if($==="constructor")return D.constructor;if($==="then"||$==="catch"||$==="finally")return;if(typeof $==="symbol")return;if($==="getSession")return()=>Promise.resolve({data:{session:null,user:null},error:null});if($==="onAuthStateChange")return()=>({data:{subscription:{unsubscribe:()=>{}}},error:null});return nk}};aF=class aF extends Rz{}});function ak(D,$,U,I){function F(J){return J instanceof U?J:new U(function(X){X(J)})}return new(U||(U=Promise))(function(J,X){function Q(B){try{W(I.next(B))}catch(K){X(K)}}function Y(B){try{W(I.throw(B))}catch(K){X(K)}}function W(B){B.done?J(B.value):F(B.value).then(Q,Y)}W((I=I.apply(D,$||[])).next())})}function ek(){if(eF===null)eF=import(sk).catch(()=>null);return eF}function D_(){return ak(this,void 0,void 0,function*(){try{let D=yield ek();if(!D||!D.propagation||!D.context)return null;let $={};D.propagation.inject(D.context.active(),$);let U=$.traceparent;if(!U)return null;return{traceparent:U,tracestate:$.tracestate,baggage:$.baggage}}catch(D){return null}})}function $_(D){if(!D||typeof D!=="string")return null;let $=D.split("-");if($.length!==4)return null;let[U,I,F,J]=$;if(U.length!==2||I.length!==32||F.length!==16||J.length!==2)return null;let X=/^[0-9a-f]+$/i;if(!X.test(U)||!X.test(I)||!X.test(F)||!X.test(J))return null;if(I==="00000000000000000000000000000000"||F==="0000000000000000")return null;return{version:U,traceId:I,parentId:F,traceFlags:J,isSampled:(parseInt(J,16)&1)===1}}function U_(D,$){if(!D||!$||$.length===0)return!1;let U;if(D instanceof URL)U=D;else try{U=new URL(D)}catch(I){return!1}for(let I of $)try{if(typeof I==="string"){if(F_(U.hostname,I))return!0}else if(I instanceof RegExp){if(I.test(U.hostname))return!0}else if(typeof I==="function"){if(I(U))return!0}}catch(F){continue}return!1}function F_(D,$){if($===D)return!0;if($.startsWith("*.")){let U=$.slice(2);if(D.endsWith(U)){if(D===U||D.endsWith("."+U))return!0}}return!1}function I_(D){let $=[];try{let U=new URL(D);$.push(U.hostname)}catch(U){}return $.push("*.supabase.co","*.supabase.in"),$.push("localhost","127.0.0.1","[::1]"),$}function l2(D){return l2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},l2(D)}function J_(D,$){if(l2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(l2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function X_(D){var $=J_(D,"string");return l2($)=="symbol"?$:$+""}function Q_(D,$,U){return($=X_($))in D?Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[$]=U,D}function Sz(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function yD(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Sz(Object(U),!0).forEach(function(I){Q_(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Sz(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}async function G_(D,$,U){if(!U_(typeof D==="string"?D:D instanceof URL?D:D.url,$))return null;let I=await D_();if(!I||!I.traceparent)return null;if(U){let F=$_(I.traceparent);if(F&&!F.isSampled)return null}return I}function Pz(D){return typeof D==="boolean"?{enabled:D}:D}function q_(D){return D.endsWith("/")?D:D+"/"}function H_(D,$){var U,I,F,J,X,Q;let{db:Y,auth:W,realtime:B,global:K}=D,{db:q,auth:H,realtime:G,global:z}=$,N=Pz(D.tracePropagation),M=Pz($.tracePropagation),Z={db:yD(yD({},q),Y),auth:yD(yD({},H),W),realtime:yD(yD({},G),B),storage:{},global:yD(yD(yD({},z),K),{},{headers:yD(yD({},(U=z===null||z===void 0?void 0:z.headers)!==null&&U!==void 0?U:{}),(I=K===null||K===void 0?void 0:K.headers)!==null&&I!==void 0?I:{})}),tracePropagation:{enabled:(F=(J=N===null||N===void 0?void 0:N.enabled)!==null&&J!==void 0?J:M===null||M===void 0?void 0:M.enabled)!==null&&F!==void 0?F:!1,respectSamplingDecision:(X=(Q=N===null||N===void 0?void 0:N.respectSamplingDecision)!==null&&Q!==void 0?Q:M===null||M===void 0?void 0:M.respectSamplingDecision)!==null&&X!==void 0?X:!0},accessToken:async()=>""};if(D.accessToken)Z.accessToken=D.accessToken;else delete Z.accessToken;return Z}function N_(D){let $=D===null||D===void 0?void 0:D.trim();if(!$)throw Error("supabaseUrl is required.");if(!$.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(q_($))}catch(U){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}function w_(){if(typeof window<"u"||globalThis.Deno!==void 0)return!1;let D=globalThis.process;if(!D)return!1;let $=D.version;if($===void 0||$===null)return!1;let U=$.match(/^v(\d+)\./);if(!U)return!1;return parseInt(U[1],10)<=20}var i$,lk="2.110.8",h2="",M9,n2,i2,Cz,dk,ck,pk,rk,ok,tk,eF=null,sk="@opentelemetry/api",Y_=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},W_=()=>{return Headers},uz=(D)=>D.startsWith("sb_publishable_")||D.startsWith("sb_secret_"),B_="sb_temp_",Tz,K_=(D)=>{var $,U;if(!D.startsWith("sb_")||uz(D)||D.startsWith(B_))return;let I=($=(U=D.match(/^sb_[a-zA-Z0-9]+_/))===null||U===void 0?void 0:U[0])!==null&&$!==void 0?$:"unknown";if(Tz.has(I))return;Tz.add(I),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.")},bz=(D,$,U,I,F,J)=>{let X=Y_(I),Q=W_(),Y=(F===null||F===void 0?void 0:F.enabled)===!0,W=(F===null||F===void 0?void 0:F.respectSamplingDecision)!==!1,B=Y?I_($):null,K=!((J===null||J===void 0?void 0:J.omitApiKeyAsBearer)&&uz(D));return async(q,H)=>{let G=await U(),z=new Q(H===null||H===void 0?void 0:H.headers);if(!z.has("apikey"))z.set("apikey",D);if(!z.has("Authorization")){let N=G!==null&&G!==void 0?G:K?D:null;if(N)z.set("Authorization",`Bearer ${N}`)}if(B){let N=await G_(q,B,W);if(N){if(N.traceparent&&!z.has("traceparent"))z.set("traceparent",N.traceparent);if(N.tracestate&&!z.has("tracestate"))z.set("tracestate",N.tracestate);if(N.baggage&&!z.has("baggage"))z.set("baggage",N.baggage)}}return X(q,yD(yD({},H),{},{headers:z}))}},z_,L_=class{constructor(D,$,U){var I,F;this.supabaseUrl=D,this.supabaseKey=$;let J=N_(D);if(!$)throw Error("supabaseKey is required.");K_($),this.realtimeUrl=new URL("realtime/v1",J),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",J),this.storageUrl=new URL("storage/v1",J),this.functionsUrl=new URL("functions/v1",J);let X=`sb-${J.hostname.split(".")[0]}-auth-token`,Q={db:pk,realtime:ok,auth:yD(yD({},rk),{},{storageKey:X}),global:ck,tracePropagation:tk},Y=H_(U!==null&&U!==void 0?U:{},Q);if(this.settings=Y,this.storageKey=(I=Y.auth.storageKey)!==null&&I!==void 0?I:"",this.headers=(F=Y.global.headers)!==null&&F!==void 0?F:{},!Y.accessToken){var W;this.auth=this._initSupabaseAuthClient((W=Y.auth)!==null&&W!==void 0?W:{},this.headers,Y.global.fetch)}else this.accessToken=Y.accessToken,this.auth=new Proxy({},{get:(B,K)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(K)} is not possible`)}});if(this.fetch=bz($,D,this._getSessionToken.bind(this),Y.global.fetch,Y.tracePropagation),this.functionsFetch=bz($,D,this._getSessionToken.bind(this),Y.global.fetch,Y.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(yD({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},Y.realtime)),this.accessToken)Promise.resolve(this.accessToken()).then((B)=>this.realtime.setAuth(B)).catch((B)=>console.warn("Failed to set initial Realtime auth token:",B));if(this.rest=new qz(new URL("rest/v1",J).href,{headers:this.headers,schema:Y.db.schema,fetch:this.fetch,timeout:Y.db.timeout,urlLengthLimit:Y.db.urlLengthLimit}),this.storage=new jz(this.storageUrl.href,this.headers,this.fetch,U===null||U===void 0?void 0:U.storage),!Y.accessToken)this._listenForAuthEvents()}get functions(){return new i$.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(D){return this.rest.from(D)}schema(D){return this.rest.schema(D)}rpc(D,$={},U={head:!1,get:!1,count:void 0}){return this.rest.rpc(D,$,U)}channel(D,$={config:{}}){return this.realtime.channel(D,$)}getChannels(){return this.realtime.getChannels()}removeChannel(D){return this.realtime.removeChannel(D)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var D=this,$,U;if(D.accessToken)return await D.accessToken();let{data:I}=await D.auth.getSession();return($=(U=I.session)===null||U===void 0?void 0:U.access_token)!==null&&$!==void 0?$:null}async _getAccessToken(){var D=this,$;return($=await D._getSessionToken())!==null&&$!==void 0?$:D.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:D,persistSession:$,detectSessionInUrl:U,storage:I,userStorage:F,storageKey:J,flowType:X,lock:Q,debug:Y,throwOnError:W,experimental:B,lockAcquireTimeout:K,skipAutoInitialize:q},H,G){let z={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new z_({url:this.authUrl.href,headers:yD(yD({},z),H),storageKey:J,autoRefreshToken:D,persistSession:$,detectSessionInUrl:U,storage:I,userStorage:F,flowType:X,lock:Q,debug:Y,throwOnError:W,experimental:B,fetch:G,lockAcquireTimeout:K,skipAutoInitialize:q,hasCustomAuthorizationHeader:Object.keys(this.headers).some((N)=>N.toLowerCase()==="authorization")})}_initRealtimeClient(D){return new pF(this.realtimeUrl.href,yD(yD({},D),{},{params:yD(yD({},{apikey:this.supabaseKey}),D===null||D===void 0?void 0:D.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((D,$)=>{this._handleTokenChanged(D,"CLIENT",$===null||$===void 0?void 0:$.access_token)})}_handleTokenChanged(D,$,U){if((D==="TOKEN_REFRESHED"||D==="SIGNED_IN"||D==="INITIAL_SESSION")&&this.changedAccessToken!==U)this.changedAccessToken=U,this.realtime.setAuth(U);else if(D==="SIGNED_OUT"){if(this.realtime.setAuth(),$=="STORAGE")this.auth.signOut();this.changedAccessToken=void 0}}},kz=(D,$,U)=>{return new L_(D,$,U)};var _z=T(()=>{Hz();Az();sF();i$=h$(Qz(),1);sF();if(typeof Deno<"u")h2="deno",M9=(n2=Deno.version)===null||n2===void 0?void 0:n2.deno;else if(typeof document<"u")h2="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")h2="react-native";else{h2="node";let D=globalThis.process;M9=D===null||D===void 0||(i2=D.version)===null||i2===void 0?void 0:i2.replace(/^v/,"")}Cz=[`runtime=${h2}`];if(M9)Cz.push(`runtime-version=${M9}`);dk={"X-Client-Info":`supabase-js/${lk}; ${Cz.join("; ")}`},ck={headers:dk},pk={schema:"public"},rk={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ok={},tk={enabled:!1,respectSamplingDecision:!0};Tz=new Set;z_=class extends aF{constructor(D){super(D)}};if(w_())console.warn("⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715")});var DI=C((t3D,xz)=>{xz.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var O9=C((fz)=>{var gz={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function Z_(D){return function(...$){if($.length)D=D.replace(/\{(\d)\}/g,(U,I)=>$[I]||"");return Error("ADM-ZIP: "+D)}}for(let D of Object.keys(gz))fz[D]=Z_(gz[D])});var iz=C((s3D,nz)=>{var M_=o("fs"),dD=o("path"),yz=DI(),O_=O9(),E_=typeof process==="object"&&process.platform==="win32",mz=(D)=>typeof D==="object"&&D!==null,hz=new Uint32Array(256).map((D,$)=>{for(let U=0;U<8;U++)if(($&1)!==0)$=3988292384^$>>>1;else $>>>=1;return $>>>0});function gD(D){if(this.sep=dD.sep,this.fs=M_,mz(D)){if(mz(D.fs)&&typeof D.fs.statSync==="function")this.fs=D.fs}}nz.exports=gD;gD.prototype.makeDir=function(D){let $=this;function U(I){let F=I.split($.sep)[0];I.split($.sep).forEach(function(J){if(!J||J.substr(-1,1)===":")return;F+=$.sep+J;var X;try{X=$.fs.statSync(F)}catch(Q){if(Q.message&&Q.message.startsWith("ENOENT"))$.fs.mkdirSync(F);else throw Q}if(X&&X.isFile())throw O_.FILE_IN_THE_WAY(`"${F}"`)})}U(D)};gD.prototype.writeFileTo=function(D,$,U,I){let F=this;if(F.fs.existsSync(D)){if(!U)return!1;var J=F.fs.statSync(D);if(J.isDirectory())return!1}var X=dD.dirname(D);if(!F.fs.existsSync(X))F.makeDir(X);var Q;try{Q=F.fs.openSync(D,"w",438)}catch(Y){F.fs.chmodSync(D,438),Q=F.fs.openSync(D,"w",438)}if(Q)try{F.fs.writeSync(Q,$,0,$.length,0)}finally{F.fs.closeSync(Q)}return F.fs.chmodSync(D,I||438),!0};gD.prototype.writeFileToAsync=function(D,$,U,I,F){if(typeof I==="function")F=I,I=void 0;let J=this;J.fs.exists(D,function(X){if(X&&!U)return F(!1);J.fs.stat(D,function(Q,Y){if(X&&Y&&Y.isDirectory())return F(!1);var W=dD.dirname(D);J.fs.exists(W,function(B){if(!B)try{J.makeDir(W)}catch(q){return F(!1)}let K=function(q){J.fs.write(q,$,0,$.length,0,function(H){J.fs.close(q,function(){if(H)return F(!1);J.fs.chmod(D,I||438,function(){F(!0)})})})};J.fs.open(D,"w",438,function(q,H){if(q)J.fs.chmod(D,438,function(){J.fs.open(D,"w",438,function(G,z){if(G||!z)return F(!1);K(z)})});else if(H)K(H);else F(!1)})})})})};gD.prototype.findFiles=function(D){let $=this;function U(I,F,J,X){if(typeof F==="boolean")J=F,F=void 0;let Q=[];return $.fs.readdirSync(I).forEach(function(Y){let W=dD.join(I,Y),B=$.fs.statSync(W);if(!F||F.test(W))Q.push(dD.normalize(W)+(B.isDirectory()?$.sep:""));if(B.isDirectory()&&J){let K=$.fs.realpathSync(W);if(!X.has(K))X.add(K),Q=Q.concat(U(W,F,J,X))}}),Q}return U(D,void 0,!0,new Set([$.fs.realpathSync(D)]))};gD.prototype.findFilesAsync=function(D,$){let U=this,I=[],F=!1,J=function(Q){if(F)return;F=!0,$(Q,Q?void 0:I)},X=function(Q,Y,W){U.fs.readdir(Q,function(B,K){if(B)return W(B);let q=K.length;if(!q)return W();K.forEach(function(H){let G=dD.join(Q,H);U.fs.stat(G,function(z,N){if(z)return W(z);if(!N){if(!--q)W();return}if(I.push(dD.normalize(G)+(N.isDirectory()?U.sep:"")),!N.isDirectory()){if(!--q)W();return}U.fs.realpath(G,function(M,Z){if(M)return W(M);if(Y.has(Z)){if(!--q)W();return}Y.add(Z),X(G,Y,function(L){if(L)return W(L);if(!--q)W()})})})})})};U.fs.realpath(D,function(Q,Y){if(Q)return J(Q);X(D,new Set([Y]),J)})};gD.prototype.getAttributes=function(){};gD.prototype.setAttributes=function(){};gD.crc32update=function(D,$){return hz[(D^$)&255]^D>>>8};gD.crc32=function(D){if(typeof D==="string")D=Buffer.from(D,"utf8");let $=D.length,U=-1;for(let I=0;I<$;)U=gD.crc32update(U,D[I++]);return~U>>>0};gD.methodToString=function(D){switch(D){case yz.STORED:return"STORED ("+D+")";case yz.DEFLATED:return"DEFLATED ("+D+")";default:return"UNSUPPORTED ("+D+")"}};gD.canonical=function(D){if(!D)return"";let $=dD.posix.normalize("/"+D.split("\\").join("/"));return dD.join(".",$)};gD.zipnamefix=function(D){if(!D)return"";let $=dD.posix.normalize("/"+D.split("\\").join("/"));return dD.posix.join(".",$)};gD.findLast=function(D,$){if(!Array.isArray(D))throw TypeError("arr is not array");let U=D.length>>>0;for(let I=U-1;I>=0;I--)if($(D[I],I,D))return D[I];return};gD.sanitize=function(D,$){D=dD.resolve(dD.normalize(D));var U=$.split("/");for(var I=0,F=U.length;I<F;I++){var J=dD.normalize(dD.join(D,U.slice(I,F).join(dD.sep)));if(J===D||J.startsWith(D+dD.sep))return J}return dD.normalize(dD.join(D,dD.basename($)))};gD.toBuffer=function($,U){if(Buffer.isBuffer($))return $;else if($ instanceof Uint8Array)return Buffer.from($);else return typeof $==="string"?U($):Buffer.alloc(0)};gD.readBigUInt64LE=function(D,$){let U=D.readUInt32LE($);return D.readUInt32LE($+4)*4294967296+U};gD.writeBigUInt64LE=function(D,$,U){let I=$>>>0,F=Math.floor($/4294967296)>>>0;D.writeUInt32LE(I,U),D.writeUInt32LE(F,U+4)};gD.fromDOS2Date=function(D){return new Date((D>>25&127)+1980,Math.max((D>>21&15)-1,0),Math.max(D>>16&31,1),D>>11&31,D>>5&63,(D&31)<<1)};gD.fromDate2DOS=function(D){let $=0,U=0;if(D.getFullYear()>1979)$=(D.getFullYear()-1980&127)<<9|D.getMonth()+1<<5|D.getDate(),U=D.getHours()<<11|D.getMinutes()<<5|D.getSeconds()>>1;return $<<16|U};gD.isWin=E_;gD.crcTable=hz});var dz=C((e3D,lz)=>{var v_=o("path");lz.exports=function(D,{fs:$}){var U=D||"",I=J(),F=null;function J(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}if(U&&$.existsSync(U))F=$.statSync(U),I.directory=F.isDirectory(),I.mtime=F.mtime,I.atime=F.atime,I.executable=(73&F.mode)!==0,I.readonly=(128&F.mode)===0,I.hidden=v_.basename(U)[0]===".";else console.warn("Invalid path: "+U);return{get directory(){return I.directory},get readOnly(){return I.readonly},get hidden(){return I.hidden},get mtime(){return I.mtime},get atime(){return I.atime},get executable(){return I.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:U,isDirectory:I.directory,isReadOnly:I.readonly,isHidden:I.hidden,isExecutable:I.executable,mTime:I.mtime,aTime:I.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var pz=C((D9D,cz)=>{cz.exports={efs:!0,encode:(D)=>Buffer.from(D,"utf8"),decode:(D)=>D.toString("utf8")}});var y1=C(($9D,f1)=>{f1.exports=iz();f1.exports.Constants=DI();f1.exports.Errors=O9();f1.exports.FileAttr=dz();f1.exports.decoder=pz()});var oz=C((U9D,rz)=>{var h0=y1(),p=h0.Constants;rz.exports=function(){var D=20,$=10,U=0,I=0,F=0,J=0,X=0,Q=0,Y=0,W=0,B=0,K=0,q=0,H=0,G=0;D|=h0.isWin?2560:768,U|=p.FLG_EFS;let z={extraLen:0},N=(L)=>Math.max(0,L)>>>0,M=(L)=>Math.max(0,L)&65535,Z=(L)=>Math.max(0,L)&255;return F=h0.fromDate2DOS(new Date),{get made(){return D},set made(L){D=L},get version(){return $},set version(L){$=L},get flags(){return U},set flags(L){U=L},get flags_efs(){return(U&p.FLG_EFS)>0},set flags_efs(L){if(L)U|=p.FLG_EFS;else U&=~p.FLG_EFS},get flags_desc(){return(U&p.FLG_DESC)>0},set flags_desc(L){if(L)U|=p.FLG_DESC;else U&=~p.FLG_DESC},get method(){return I},set method(L){switch(L){case p.STORED:this.version=10;break;case p.DEFLATED:default:this.version=20}I=L},get time(){return h0.fromDOS2Date(this.timeval)},set time(L){L=new Date(L),this.timeval=h0.fromDate2DOS(L)},get timeval(){return F},set timeval(L){F=N(L)},get timeHighByte(){return Z(F>>>8)},get crc(){return J},set crc(L){J=N(L)},get compressedSize(){return X},set compressedSize(L){X=N(L)},get size(){return Q},set size(L){Q=N(L)},get fileNameLength(){return Y},set fileNameLength(L){Y=L},get extraLength(){return W},set extraLength(L){W=L},get extraLocalLength(){return z.extraLen},set extraLocalLength(L){z.extraLen=L},get commentLength(){return B},set commentLength(L){B=L},get diskNumStart(){return K},set diskNumStart(L){K=N(L)},get inAttr(){return q},set inAttr(L){q=N(L)},get attr(){return H},set attr(L){H=N(L)},get fileAttr(){return(H||0)>>16&4095},get offset(){return G},set offset(L){G=N(L)},get encrypted(){return(U&p.FLG_ENC)===p.FLG_ENC},get centralHeaderSize(){return p.CENHDR+Y+W+B},get realDataOffset(){return G+p.LOCHDR+z.fnameLen+z.extraLen},get localHeader(){return z},loadLocalHeaderFromBinary:function(L){var v=L.slice(G,G+p.LOCHDR);if(v.readUInt32LE(0)!==p.LOCSIG)throw h0.Errors.INVALID_LOC();z.version=v.readUInt16LE(p.LOCVER),z.flags=v.readUInt16LE(p.LOCFLG),z.flags_desc=(z.flags&p.FLG_DESC)>0,z.method=v.readUInt16LE(p.LOCHOW),z.time=v.readUInt32LE(p.LOCTIM),z.crc=v.readUInt32LE(p.LOCCRC),z.compressedSize=v.readUInt32LE(p.LOCSIZ),z.size=v.readUInt32LE(p.LOCLEN),z.fnameLen=v.readUInt16LE(p.LOCNAM),z.extraLen=v.readUInt16LE(p.LOCEXT);let A=G+p.LOCHDR+z.fnameLen,V=A+z.extraLen;return L.slice(A,V)},loadFromBinary:function(L){if(L.length!==p.CENHDR||L.readUInt32LE(0)!==p.CENSIG)throw h0.Errors.INVALID_CEN();D=L.readUInt16LE(p.CENVEM),$=L.readUInt16LE(p.CENVER),U=L.readUInt16LE(p.CENFLG),I=L.readUInt16LE(p.CENHOW),F=L.readUInt32LE(p.CENTIM),J=L.readUInt32LE(p.CENCRC),X=L.readUInt32LE(p.CENSIZ),Q=L.readUInt32LE(p.CENLEN),Y=L.readUInt16LE(p.CENNAM),W=L.readUInt16LE(p.CENEXT),B=L.readUInt16LE(p.CENCOM),K=L.readUInt16LE(p.CENDSK),q=L.readUInt16LE(p.CENATT),H=L.readUInt32LE(p.CENATX),G=L.readUInt32LE(p.CENOFF)},localHeaderToBinary:function(){var L=Buffer.alloc(p.LOCHDR);return L.writeUInt32LE(p.LOCSIG,0),L.writeUInt16LE($,p.LOCVER),L.writeUInt16LE(U&~p.FLG_DESC,p.LOCFLG),L.writeUInt16LE(I,p.LOCHOW),L.writeUInt32LE(F,p.LOCTIM),L.writeUInt32LE(J,p.LOCCRC),L.writeUInt32LE(X,p.LOCSIZ),L.writeUInt32LE(Q,p.LOCLEN),L.writeUInt16LE(Y,p.LOCNAM),L.writeUInt16LE(z.extraLen,p.LOCEXT),L},centralHeaderToBinary:function(){var L=Buffer.alloc(p.CENHDR+Y+W+B);return L.writeUInt32LE(p.CENSIG,0),L.writeUInt16LE(D,p.CENVEM),L.writeUInt16LE($,p.CENVER),L.writeUInt16LE(U&~p.FLG_DESC,p.CENFLG),L.writeUInt16LE(I,p.CENHOW),L.writeUInt32LE(F,p.CENTIM),L.writeUInt32LE(J,p.CENCRC),L.writeUInt32LE(X,p.CENSIZ),L.writeUInt32LE(Q,p.CENLEN),L.writeUInt16LE(Y,p.CENNAM),L.writeUInt16LE(W,p.CENEXT),L.writeUInt16LE(B,p.CENCOM),L.writeUInt16LE(K,p.CENDSK),L.writeUInt16LE(q,p.CENATT),L.writeUInt32LE(H,p.CENATX),L.writeUInt32LE(G,p.CENOFF),L},toJSON:function(){let L=function(v){return v+" bytes"};return{made:D,version:$,flags:U,method:h0.methodToString(I),time:this.time,crc:"0x"+J.toString(16).toUpperCase(),compressedSize:L(X),size:L(Q),fileNameLength:L(Y),extraLength:L(W),commentLength:L(B),diskNumStart:K,inAttr:q,attr:H,offset:G,centralHeaderSize:L(p.CENHDR+Y+W+B)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var az=C((F9D,tz)=>{var l$=y1(),$D=l$.Constants;tz.exports=function(){var D=0,$=0,U=0,I=0,F=0;let J=()=>D>$D.EF_ZIP64_OR_16||$>$D.EF_ZIP64_OR_16||U>$D.EF_ZIP64_OR_32||I>$D.EF_ZIP64_OR_32;return{get diskEntries(){return D},set diskEntries(X){D=$=X},get totalEntries(){return $},set totalEntries(X){$=D=X},get size(){return U},set size(X){U=X},get offset(){return I},set offset(X){I=X},get commentLength(){return F},set commentLength(X){F=X},get mainHeaderSize(){return(J()?$D.ZIP64HDR+$D.END64HDR:0)+$D.ENDHDR+F},loadFromBinary:function(X){if((X.length!==$D.ENDHDR||X.readUInt32LE(0)!==$D.ENDSIG)&&(X.length<$D.ZIP64HDR||X.readUInt32LE(0)!==$D.ZIP64SIG))throw l$.Errors.INVALID_END();if(X.readUInt32LE(0)===$D.ENDSIG)D=X.readUInt16LE($D.ENDSUB),$=X.readUInt16LE($D.ENDTOT),U=X.readUInt32LE($D.ENDSIZ),I=X.readUInt32LE($D.ENDOFF),F=X.readUInt16LE($D.ENDCOM);else D=l$.readBigUInt64LE(X,$D.ZIP64SUB),$=l$.readBigUInt64LE(X,$D.ZIP64TOT),U=l$.readBigUInt64LE(X,$D.ZIP64SIZB),I=l$.readBigUInt64LE(X,$D.ZIP64OFF),F=0},toBinary:function(){if(!J()){var X=Buffer.alloc($D.ENDHDR+F);return X.writeUInt32LE($D.ENDSIG,0),X.writeUInt32LE(0,4),X.writeUInt16LE(D,$D.ENDSUB),X.writeUInt16LE($,$D.ENDTOT),X.writeUInt32LE(U,$D.ENDSIZ),X.writeUInt32LE(I,$D.ENDOFF),X.writeUInt16LE(F,$D.ENDCOM),X.fill(" ",$D.ENDHDR),X}var X=Buffer.alloc(this.mainHeaderSize);let Q=0;X.writeUInt32LE($D.ZIP64SIG,Q),l$.writeBigUInt64LE(X,$D.ZIP64HDR-$D.ZIP64LEAD,Q+$D.ZIP64SIZE),X.writeUInt16LE(45,Q+$D.ZIP64VEM),X.writeUInt16LE(45,Q+$D.ZIP64VER),X.writeUInt32LE(0,Q+$D.ZIP64DSK),X.writeUInt32LE(0,Q+$D.ZIP64DSKDIR),l$.writeBigUInt64LE(X,D,Q+$D.ZIP64SUB),l$.writeBigUInt64LE(X,$,Q+$D.ZIP64TOT),l$.writeBigUInt64LE(X,U,Q+$D.ZIP64SIZB),l$.writeBigUInt64LE(X,I,Q+$D.ZIP64OFF);let Y=I+U;return Q+=$D.ZIP64HDR,X.writeUInt32LE($D.END64SIG,Q),X.writeUInt32LE(0,Q+$D.END64START),l$.writeBigUInt64LE(X,Y,Q+$D.END64OFF),X.writeUInt32LE(1,Q+$D.END64NUMDISKS),Q+=$D.END64HDR,X.writeUInt32LE($D.ENDSIG,Q),X.writeUInt32LE(0,Q+4),X.writeUInt16LE(Math.min(D,$D.EF_ZIP64_OR_16),Q+$D.ENDSUB),X.writeUInt16LE(Math.min($,$D.EF_ZIP64_OR_16),Q+$D.ENDTOT),X.writeUInt32LE(Math.min(U,$D.EF_ZIP64_OR_32),Q+$D.ENDSIZ),X.writeUInt32LE(Math.min(I,$D.EF_ZIP64_OR_32),Q+$D.ENDOFF),X.writeUInt16LE(F,Q+$D.ENDCOM),X.fill(" ",Q+$D.ENDHDR),X},toJSON:function(){let X=function(Q,Y){let W=Q.toString(16).toUpperCase();while(W.length<Y)W="0"+W;return"0x"+W};return{diskEntries:D,totalEntries:$,size:U+" bytes",offset:X(I,4),commentLength:F}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var $I=C((V_)=>{V_.EntryHeader=oz();V_.MainHeader=az()});var ez=C((J9D,sz)=>{sz.exports=function(D){var $=o("zlib"),U={chunkSize:(parseInt(D.length/1024)+1)*1024};return{deflate:function(){return $.deflateRawSync(D,U)},deflateAsync:function(I){var F=$.createDeflateRaw(U),J=[],X=0;F.on("data",function(Q){J.push(Q),X+=Q.length}),F.on("end",function(){var Q=Buffer.alloc(X),Y=0;Q.fill(0);for(var W=0;W<J.length;W++){var B=J[W];B.copy(Q,Y),Y+=B.length}I&&I(Q)}),F.end(D)}}}});var $L=C((X9D,DL)=>{var R_=+(process?.versions?.node??"").split(".")[0]||0;DL.exports=function(D,$){var U=o("zlib");let I=R_>=15&&$>0?{maxOutputLength:$}:{};return{inflate:function(){return U.inflateRawSync(D,I)},inflateAsync:function(F){var J=U.createInflateRaw(I),X=[],Q=0;J.on("data",function(Y){X.push(Y),Q+=Y.length}),J.on("end",function(){var Y=Buffer.alloc(Q),W=0;Y.fill(0);for(var B=0;B<X.length;B++){var K=X[B];K.copy(Y,W),W+=K.length}F&&F(Y)}),J.end(D)}}}});var XL=C((Q9D,JL)=>{var{randomFillSync:UL}=o("crypto"),S_=O9(),T_=new Uint32Array(256).map((D,$)=>{for(let U=0;U<8;U++)if(($&1)!==0)$=$>>>1^3988292384;else $>>>=1;return $>>>0}),IL=(D,$)=>Math.imul(D,$)>>>0,FL=(D,$)=>{return T_[(D^$)&255]^D>>>8},d2=()=>{if(typeof UL==="function")return UL(Buffer.alloc(12));else return d2.node()};d2.node=()=>{let D=Buffer.alloc(12),$=D.length;for(let U=0;U<$;U++)D[U]=Math.random()*256&255;return D};var E9={genSalt:d2};function v9(D){let $=Buffer.isBuffer(D)?D:Buffer.from(D);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let U=0;U<$.length;U++)this.updateKeys($[U])}v9.prototype.updateKeys=function(D){let $=this.keys;return $[0]=FL($[0],D),$[1]+=$[0]&255,$[1]=IL($[1],134775813)+1,$[2]=FL($[2],$[1]>>>24),D};v9.prototype.next=function(){let D=(this.keys[2]|2)>>>0;return IL(D,D^1)>>8&255};function b_(D){let $=new v9(D);return function(U){let I=Buffer.alloc(U.length),F=0;for(let J of U)I[F++]=$.updateKeys(J^$.next());return I}}function P_(D){let $=new v9(D);return function(U,I,F=0){if(!I)I=Buffer.alloc(U.length);for(let J of U){let X=$.next();I[F++]=J^X,$.updateKeys(J)}return I}}function C_(D,$,U){if(!D||!Buffer.isBuffer(D)||D.length<12)return Buffer.alloc(0);let I=b_(U),F=I(D.slice(0,12)),J=($.flags&8)===8?$.timeHighByte:$.crc>>>24;if(F[11]!==J)throw S_.WRONG_PASSWORD();return I(D.slice(12))}function u_(D){if(Buffer.isBuffer(D)&&D.length>=12)E9.genSalt=function(){return D.slice(0,12)};else if(D==="node")E9.genSalt=d2.node;else E9.genSalt=d2}function k_(D,$,U,I=!1){if(D==null)D=Buffer.alloc(0);if(!Buffer.isBuffer(D))D=Buffer.from(D.toString());let F=P_(U),J=E9.genSalt();if(J[11]=$.crc>>>24&255,I)J[10]=$.crc>>>16&255;let X=Buffer.alloc(D.length+12);return F(J,X),F(D,X,12)}JL.exports={decrypt:C_,encrypt:k_,_salter:u_}});var QL=C((__)=>{__.Deflater=ez();__.Inflater=$L();__.ZipCrypto=XL()});var FI=C((W9D,YL)=>{var bD=y1(),y_=$I(),_$=bD.Constants,UI=QL();YL.exports=function(D,$){var U=new y_.EntryHeader,I=Buffer.alloc(0),F=Buffer.alloc(0),J=!1,X=null,Q=Buffer.alloc(0),Y=Buffer.alloc(0),W=!0;let B=D,K=typeof B.decoder==="object"?B.decoder:bD.decoder;W=K.hasOwnProperty("efs")?K.efs:!1;function q(){if(!$||!($ instanceof Uint8Array))return Buffer.alloc(0);return Y=U.loadLocalHeaderFromBinary($),$.slice(U.realDataOffset,U.realDataOffset+U.compressedSize)}function H(L){let v=U.flags_desc||U.localHeader.flags_desc?U.crc:U.localHeader.crc;return bD.crc32(L)===v}function G(L,v,A){if(typeof v>"u"&&typeof L==="string")A=L,L=void 0;if(J){if(L&&v)v(Buffer.alloc(0),bD.Errors.DIRECTORY_CONTENT_ERROR());return Buffer.alloc(0)}var V=q();if(V.length===0){if(L&&v)v(V);return V}if(U.encrypted){if(typeof A!=="string"&&!Buffer.isBuffer(A))throw bD.Errors.INVALID_PASS_PARAM();V=UI.ZipCrypto.decrypt(V,U,A)}var b;switch(U.method){case bD.Constants.STORED:if(b=Buffer.alloc(V.length),V.copy(b),!H(b)){if(L&&v)v(b,bD.Errors.BAD_CRC());throw bD.Errors.BAD_CRC()}else{if(L&&v)v(b);return b}case bD.Constants.DEFLATED:var y=new UI.Inflater(V,U.size);if(!L){if(b=y.inflate(),!H(b))throw bD.Errors.BAD_CRC(`"${K.decode(I)}"`);return b}else y.inflateAsync(function(_){if(v)if(!H(_))v(_,bD.Errors.BAD_CRC());else v(_)});break;default:if(L&&v)v(Buffer.alloc(0),bD.Errors.UNKNOWN_METHOD());throw bD.Errors.UNKNOWN_METHOD()}}function z(L,v){if((!X||!X.length)&&Buffer.isBuffer($)){if(L&&v)v(q());return q()}if(X.length&&!J){var A;switch(U.method){case bD.Constants.STORED:if(U.compressedSize=U.size,A=Buffer.alloc(X.length),X.copy(A),L&&v)v(A);return A;default:case bD.Constants.DEFLATED:var V=new UI.Deflater(X);if(!L){var b=V.deflate();return U.compressedSize=b.length,b}else V.deflateAsync(function(y){A=Buffer.alloc(y.length),U.compressedSize=y.length,y.copy(A),v&&v(A)});V=null;break}}else if(L&&v)v(Buffer.alloc(0));else return Buffer.alloc(0)}function N(L,v){return bD.readBigUInt64LE(L,v)}function M(L){try{var v=0,A,V,b;while(v+4<L.length)if(A=L.readUInt16LE(v),v+=2,V=L.readUInt16LE(v),v+=2,b=L.slice(v,v+V),v+=V,_$.ID_ZIP64===A)Z(b)}catch(y){throw bD.Errors.EXTRA_FIELD_PARSE_ERROR()}}function Z(L){var v,A,V,b;if(L.length>=_$.EF_ZIP64_SCOMP){if(v=N(L,_$.EF_ZIP64_SUNCOMP),U.size===_$.EF_ZIP64_OR_32)U.size=v}if(L.length>=_$.EF_ZIP64_RHO){if(A=N(L,_$.EF_ZIP64_SCOMP),U.compressedSize===_$.EF_ZIP64_OR_32)U.compressedSize=A}if(L.length>=_$.EF_ZIP64_DSN){if(V=N(L,_$.EF_ZIP64_RHO),U.offset===_$.EF_ZIP64_OR_32)U.offset=V}if(L.length>=_$.EF_ZIP64_DSN+4){if(b=L.readUInt32LE(_$.EF_ZIP64_DSN),U.diskNumStart===_$.EF_ZIP64_OR_16)U.diskNumStart=b}}return{get entryName(){return K.decode(I)},get rawEntryName(){return I},set entryName(L){I=bD.toBuffer(L,K.encode);var v=I[I.length-1];J=v===47||v===92,U.fileNameLength=I.length},get efs(){if(typeof W==="function")return W(this.entryName);else return W},get extra(){return Q},set extra(L){Q=L,U.extraLength=L.length,M(L)},get comment(){return K.decode(F)},set comment(L){if(F=bD.toBuffer(L,K.encode),U.commentLength=F.length,F.length>65535)throw bD.Errors.COMMENT_TOO_LONG()},get name(){let L=K.decode(I);return J?L.replace(/[/\\]$/,"").split("/").pop():L.split("/").pop()},get isDirectory(){return J},getCompressedData:function(){return z(!1,null)},getCompressedDataAsync:function(L){z(!0,L)},setData:function(L){if(X=bD.toBuffer(L,bD.decoder.encode),!J&&X.length)U.size=X.length,U.method=bD.Constants.DEFLATED,U.crc=bD.crc32(L),U.changed=!0;else U.method=bD.Constants.STORED},getData:function(L){if(U.changed)return X;else return G(!1,null,L)},getDataAsync:function(L,v){if(U.changed)L(X);else G(!0,L,v)},set attr(L){U.attr=L},get attr(){return U.attr},set header(L){U.loadFromBinary(L)},get header(){return U},packCentralHeader:function(){U.flags_efs=this.efs,U.extraLength=Q.length;var L=U.centralHeaderToBinary(),v=bD.Constants.CENHDR;return I.copy(L,v),v+=I.length,Q.copy(L,v),v+=U.extraLength,F.copy(L,v),L},packLocalHeader:function(){let L=0;U.flags_efs=this.efs,U.extraLocalLength=Y.length;let v=U.localHeaderToBinary(),A=Buffer.alloc(v.length+I.length+U.extraLocalLength);return v.copy(A,L),L+=v.length,I.copy(A,L),L+=I.length,Y.copy(A,L),L+=Y.length,A},toJSON:function(){let L=function(v){return"<"+(v&&v.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:U.toJSON(),compressedData:L($),data:L(X)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var KL=C((B9D,BL)=>{var WL=FI(),m_=$I(),q$=y1();BL.exports=function(D,$){var U=[],I=Object.create(null),F=Buffer.alloc(0),J=new m_.MainHeader,X=!1,Q=null;let Y=new Set,W=$,{noSort:B,decoder:K}=W;if(D)G(W.readEntries);else X=!0;function q(){let N=new Set;for(let M of Object.keys(I)){let Z=M.split("/");if(Z.pop(),!Z.length)continue;for(let L=0;L<Z.length;L++){let v=Z.slice(0,L+1).join("/")+"/";N.add(v)}}for(let M of N)if(!(M in I)){let Z=new WL(W);Z.entryName=M,Z.attr=16,Z.temporary=!0,U.push(Z),I[Z.entryName]=Z,Y.add(Z)}}function H(){if(X=!0,I=Object.create(null),J.diskEntries>(D.length-J.offset)/q$.Constants.CENHDR)throw q$.Errors.DISK_ENTRY_TOO_LARGE();U=Array(J.diskEntries);var N=J.offset;for(var M=0;M<U.length;M++){var Z=N,L=new WL(W,D);if(L.header=D.slice(Z,Z+=q$.Constants.CENHDR),L.entryName=D.slice(Z,Z+=L.header.fileNameLength),L.header.extraLength)L.extra=D.slice(Z,Z+=L.header.extraLength);if(L.header.commentLength)L.comment=D.slice(Z,Z+L.header.commentLength);N+=L.header.centralHeaderSize,U[M]=L,I[L.entryName]=L}Y.clear(),q()}function G(N){var M=D.length-q$.Constants.ENDHDR,Z=Math.max(0,M-65535),L=Z,v=D.length,A=-1,V=0;if(typeof W.trailingSpace==="boolean"?W.trailingSpace:!1)Z=0;for(M;M>=L;M--){if(D[M]!==80)continue;if(D.readUInt32LE(M)===q$.Constants.ENDSIG){A=M,V=M,v=M+q$.Constants.ENDHDR,L=M-q$.Constants.END64HDR;continue}if(D.readUInt32LE(M)===q$.Constants.END64SIG){L=Z;continue}if(D.readUInt32LE(M)===q$.Constants.ZIP64SIG){A=M,v=M+q$.readBigUInt64LE(D,M+q$.Constants.ZIP64SIZE)+q$.Constants.ZIP64LEAD;break}}if(A==-1)throw q$.Errors.INVALID_FORMAT();if(J.loadFromBinary(D.slice(A,v)),J.commentLength)F=D.slice(V+q$.Constants.ENDHDR);if(N)H()}function z(){if(U.length>1&&!B)U=U.map((N)=>({entry:N,key:N.entryName.toLowerCase()})).sort((N,M)=>N.key.localeCompare(M.key)).map((N)=>N.entry)}return{get entries(){if(!X)H();return U.filter((N)=>!Y.has(N))},get comment(){return K.decode(F)},set comment(N){F=q$.toBuffer(N,K.encode),J.commentLength=F.length},getEntryCount:function(){if(!X)return J.diskEntries;return U.length},forEach:function(N){this.entries.forEach(N)},getEntry:function(N){if(!X)H();return I[N]||null},setEntry:function(N){if(!X)H();U.push(N),I[N.entryName]=N,J.totalEntries=U.length},deleteFile:function(N,M=!0){if(!X)H();let Z=I[N];this.getEntryChildren(Z,M).map((v)=>v.entryName).forEach(this.deleteEntry)},deleteEntry:function(N){if(!X)H();let M=I[N],Z=U.indexOf(M);if(Z>=0)U.splice(Z,1),delete I[N],J.totalEntries=U.length},getEntryChildren:function(N,M=!0){if(!X)H();if(typeof N==="object")if(N.isDirectory&&M){let Z=[],L=N.entryName;for(let v of U)if(v.entryName.startsWith(L))Z.push(v);return Z}else return[N];return[]},getChildCount:function(N){if(N&&N.isDirectory){let M=this.getEntryChildren(N);return M.includes(N)?M.length-1:M.length}return 0},compressToBuffer:function(){if(!X)H();z();let N=[],M=[],Z=0,L=0;J.size=0,J.offset=0;let v=0;for(let b of this.entries){let y=b.getCompressedData();b.header.offset=L;let _=b.packLocalHeader(),n=_.length+y.length;L+=n,N.push(_),N.push(y);let m=b.packCentralHeader();M.push(m),J.size+=m.length,Z+=n+m.length,v++}Z+=J.mainHeaderSize,J.offset=L,J.totalEntries=v,L=0;let A=Buffer.alloc(Z);for(let b of N)b.copy(A,L),L+=b.length;for(let b of M)b.copy(A,L),L+=b.length;let V=J.toBinary();if(F)F.copy(V,V.length-F.length);return V.copy(A,L),D=A,X=!1,A},toAsyncBuffer:function(N,M,Z,L){try{if(!X)H();z();let v=[],A=[],V=0,b=0,y=0;J.size=0,J.offset=0;let _=function(n){if(n.length>0){let m=n.shift(),UD=m.entryName+m.extra.toString();if(Z)Z(UD);m.getCompressedDataAsync(function(s){if(L)L(UD);m.header.offset=b;let a=m.packLocalHeader(),DD=a.length+s.length;b+=DD,v.push(a),v.push(s);let E=m.packCentralHeader();A.push(E),J.size+=E.length,V+=DD+E.length,y++,_(n)})}else{V+=J.mainHeaderSize,J.offset=b,J.totalEntries=y,b=0;let m=Buffer.alloc(V);v.forEach(function(s){s.copy(m,b),b+=s.length}),A.forEach(function(s){s.copy(m,b),b+=s.length});let UD=J.toBinary();if(F)F.copy(UD,UD.length-F.length);UD.copy(m,b),D=m,X=!1,N(m)}};_(Array.from(this.entries))}catch(v){M(v)}}}}});var HL=C((K9D,qL)=>{var hD=y1(),mD=o("path"),h_=FI(),n_=KL(),E6=(...D)=>hD.findLast(D,($)=>typeof $==="boolean"),GL=(...D)=>hD.findLast(D,($)=>typeof $==="string"),i_=(...D)=>hD.findLast(D,($)=>typeof $==="function"),l_={noSort:!1,readEntries:!1,method:hD.Constants.NONE,fs:null};qL.exports=function(D,$){let U=null,I=Object.assign(Object.create(null),l_);if(D&&typeof D==="object"){if(!(D instanceof Uint8Array)){if(Object.assign(I,D),D=I.input?I.input:void 0,I.input)delete I.input}if(Buffer.isBuffer(D))U=D,I.method=hD.Constants.BUFFER,D=void 0}Object.assign(I,$);let F=new hD(I),J=(G)=>{G.filter((z)=>z.attr).sort((z,N)=>N.path.length-z.path.length).forEach((z)=>F.fs.chmodSync(z.path,z.attr))};if(typeof I.decoder!=="object"||typeof I.decoder.encode!=="function"||typeof I.decoder.decode!=="function")I.decoder=hD.decoder;if(D&&typeof D==="string")if(F.fs.existsSync(D))I.method=hD.Constants.FILE,I.filename=D,U=F.fs.readFileSync(D);else throw hD.Errors.INVALID_FILENAME();let X=new n_(U,I),{canonical:Q,sanitize:Y,zipnamefix:W}=hD;function B(G){if(G&&X){var z;if(typeof G==="string")z=X.getEntry(mD.posix.normalize(G));if(typeof G==="object"&&typeof G.entryName<"u"&&typeof G.header<"u")z=X.getEntry(G.entryName);if(z)return z}return null}function K(G){let{join:z,normalize:N,sep:M}=mD.posix;return z(mD.isAbsolute(G)?"/":".",N(M+G.split("\\").join(M)+M))}function q(G){if(G instanceof RegExp)return function(z){return function(N){return z.test(N)}}(G);else if(typeof G!=="function")return()=>!0;return G}let H=(G,z)=>{let N=z.slice(-1);return N=N===F.sep?F.sep:"",mD.relative(G,z)+N};return{readFile:function(G,z){var N=B(G);return N&&N.getData(z)||null},childCount:function(G){let z=B(G);if(z)return X.getChildCount(z)},readFileAsync:function(G,z){var N=B(G);if(N)N.getDataAsync(z);else z(null,"getEntry failed for:"+G)},readAsText:function(G,z){var N=B(G);if(N){var M=N.getData();if(M&&M.length)return M.toString(z||"utf8")}return""},readAsTextAsync:function(G,z,N){var M=B(G);if(M)M.getDataAsync(function(Z,L){if(L){z(Z,L);return}if(Z&&Z.length)z(Z.toString(N||"utf8"));else z("")});else z("")},deleteFile:function(G,z=!0){var N=B(G);if(N)X.deleteFile(N.entryName,z)},deleteEntry:function(G){var z=B(G);if(z)X.deleteEntry(z.entryName)},addZipComment:function(G){X.comment=G},getZipComment:function(){return X.comment||""},addZipEntryComment:function(G,z){var N=B(G);if(N)N.comment=z},getZipEntryComment:function(G){var z=B(G);if(z)return z.comment||"";return""},updateFile:function(G,z){var N=B(G);if(N)N.setData(z)},addLocalFile:function(G,z,N,M){if(F.fs.existsSync(G)){z=z?K(z):"";let Z=mD.win32.basename(mD.win32.normalize(G));z+=N?N:Z;let L=F.fs.statSync(G),v=L.isFile()?F.fs.readFileSync(G):Buffer.alloc(0);if(L.isDirectory())z+=F.sep;this.addFile(z,v,M,L)}else throw hD.Errors.FILE_NOT_FOUND(G)},addLocalFileAsync:function(G,z){G=typeof G==="object"?G:{localPath:G};let N=mD.resolve(G.localPath),{comment:M}=G,{zipPath:Z,zipName:L}=G,v=this;F.fs.stat(N,function(A,V){if(A)return z(A,!1);Z=Z?K(Z):"";let b=mD.win32.basename(mD.win32.normalize(N));if(Z+=L?L:b,V.isFile())F.fs.readFile(N,function(y,_){if(y)return z(y,!1);return v.addFile(Z,_,M,V),setImmediate(z,void 0,!0)});else if(V.isDirectory())return Z+=F.sep,v.addFile(Z,Buffer.alloc(0),M,V),setImmediate(z,void 0,!0)})},addLocalFolder:function(G,z,N){if(N=q(N),z=z?K(z):"",G=mD.normalize(G),F.fs.existsSync(G)){let M=F.findFiles(G),Z=this;if(M.length)for(let L of M){let v=mD.join(z,H(G,L));if(N(v))Z.addLocalFile(L,mD.dirname(v))}}else throw hD.Errors.FILE_NOT_FOUND(G)},addLocalFolderAsync:function(G,z,N,M){M=q(M),N=N?K(N):"",G=mD.normalize(G);var Z=this;F.fs.open(G,"r",function(L){if(L&&L.code==="ENOENT")z(void 0,hD.Errors.FILE_NOT_FOUND(G));else if(L)z(void 0,L);else{var v=F.findFiles(G),A=-1,V=function(){if(A+=1,A<v.length){var b=v[A],y=H(G,b).split("\\").join("/");if(y=y.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),M(y))F.fs.stat(b,function(_,n){if(_)z(void 0,_);if(n.isFile())F.fs.readFile(b,function(m,UD){if(m)z(void 0,m);else Z.addFile(N+y,UD,"",n),V()});else Z.addFile(N+y+"/",Buffer.alloc(0),"",n),V()});else process.nextTick(()=>{V()})}else z(!0,void 0)};V()}})},addLocalFolderAsync2:function(G,z){let N=this;G=typeof G==="object"?G:{localPath:G};let M=mD.resolve(K(G.localPath)),{zipPath:Z,filter:L,namefix:v}=G;if(L instanceof RegExp)L=function(b){return function(y){return b.test(y)}}(L);else if(typeof L!=="function")L=function(){return!0};if(Z=Z?K(Z):"",v==="latin1")v=(b)=>b.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"");if(typeof v!=="function")v=(b)=>b;let A=(b)=>mD.join(Z,v(H(M,b))),V=(b)=>mD.win32.basename(mD.win32.normalize(v(b)));F.fs.open(M,"r",function(b){if(b&&b.code==="ENOENT")z(void 0,hD.Errors.FILE_NOT_FOUND(M));else if(b)z(void 0,b);else F.findFilesAsync(M,function(y,_){if(y)return z(y);if(_=_.filter((n)=>L(A(n))),!_.length)z(void 0,!1);setImmediate(_.reverse().reduce(function(n,m){return function(UD,s){if(UD||s===!1)return setImmediate(n,UD,!1);N.addLocalFileAsync({localPath:m,zipPath:mD.dirname(A(m)),zipName:V(m)},n)}},z))})})},addLocalFolderPromise:function(G,z){return new Promise((N,M)=>{this.addLocalFolderAsync2(Object.assign({localPath:G},z),(Z,L)=>{if(Z)M(Z);if(L)N(this)})})},addFile:function(G,z,N,M){G=W(G);let Z=B(G),L=Z!=null;if(!L)Z=new h_(I),Z.entryName=G;Z.comment=N||"";let v=typeof M==="object"&&M instanceof F.fs.Stats;if(v)Z.header.time=M.mtime;var A=Z.isDirectory?16:0;let V=Z.isDirectory?16384:32768;if(v)V|=4095&M.mode;else if(typeof M==="number")V|=4095&M;else V|=Z.isDirectory?493:420;if(A=(A|V<<16)>>>0,Z.attr=A,Z.setData(z),!L)X.setEntry(Z);return Z},getEntries:function(G){return X.password=G,X?X.entries:[]},getEntry:function(G){return B(G)},getEntryCount:function(){return X.getEntryCount()},forEach:function(G){return X.forEach(G)},extractEntryTo:function(G,z,N,M,Z,L){M=E6(!1,M),Z=E6(!1,Z),N=E6(!0,N),L=GL(Z,L);var v=B(G);if(!v)throw hD.Errors.NO_ENTRY();var A=Q(v.entryName),V=Y(z,L&&!v.isDirectory?Q(L):N?A:mD.basename(A));if(v.isDirectory){var b=X.getEntryChildren(v);return b.forEach(function(n){if(n.isDirectory)return;var m=n.getData();if(!m)throw hD.Errors.CANT_EXTRACT_FILE();var UD=Q(N?n.entryName:n.entryName.substring(v.entryName.length)),s=Y(z,UD);let a=Z?n.header.fileAttr:void 0;F.writeFileTo(s,m,M,a)}),!0}var y=v.getData(X.password);if(!y)throw hD.Errors.CANT_EXTRACT_FILE();if(F.fs.existsSync(V)&&!M)throw hD.Errors.CANT_OVERRIDE();let _=Z?G.header.fileAttr:void 0;return F.writeFileTo(V,y,M,_),!0},test:function(G){if(!X)return!1;for(var z of X.entries)try{if(z.isDirectory)continue;var N=z.getData(G);if(!N)return!1}catch(M){return!1}return!0},extractAllTo:function(G,z,N,M){if(N=E6(!1,N),M=GL(N,M),z=E6(!1,z),!X)throw hD.Errors.NO_ZIP();let Z=[];X.entries.forEach(function(L){var v=Y(G,Q(L.entryName));if(L.isDirectory){if(F.makeDir(v),N)Z.push({path:v,attr:L.header.fileAttr});return}var A=L.getData(M);if(!A)throw hD.Errors.CANT_EXTRACT_FILE();let V=N?L.header.fileAttr:void 0;F.writeFileTo(v,A,z,V);try{F.fs.utimesSync(v,L.header.time,L.header.time)}catch(b){}}),J(Z)},extractAllToAsync:function(G,z,N,M){if(M=i_(z,N,M),N=E6(!1,N),z=E6(!1,z),!M)return new Promise((y,_)=>{this.extractAllToAsync(G,z,N,function(n){if(n)_(n);else y(this)})});if(!X){M(hD.Errors.NO_ZIP());return}G=mD.resolve(G);let Z=(y)=>Y(G,mD.normalize(Q(y.entryName))),L=(y,_)=>Error(y+': "'+_+'"'),v=[],A=[];X.entries.forEach((y)=>{if(y.isDirectory)v.push(y);else A.push(y)});let V=[];for(let y of v){let _=Z(y),n=N?y.header.fileAttr:void 0;try{F.makeDir(_)}catch(m){M(L("Unable to create folder",_));continue}if(n)V.push({path:_,attr:n});try{F.fs.utimesSync(_,y.header.time,y.header.time)}catch(m){}}let b=(y)=>{if(!y)try{J(V)}catch(_){return M(L("Unable to set folder permissions",_.path||""))}M(y)};A.reverse().reduce(function(y,_){return function(n){if(n)y(n);else{let m=mD.normalize(Q(_.entryName)),UD=Y(G,m);_.getDataAsync(function(s,a){if(a)y(a);else if(!s)y(hD.Errors.CANT_EXTRACT_FILE());else{let DD=N?_.header.fileAttr:void 0;F.writeFileToAsync(UD,s,z,DD,function(E){if(!E)return y(L("Unable to write file",UD));F.fs.utimes(UD,_.header.time,_.header.time,function(){y()})})}})}}},b)()},writeZip:function(G,z){if(arguments.length===1){if(typeof G==="function")z=G,G=""}if(!G&&I.filename)G=I.filename;if(!G)return;var N=X.compressToBuffer();if(N){var M=F.writeFileTo(G,N,!0);if(typeof z==="function")z(!M?Error("failed"):null,"")}},writeZipPromise:function(G,z){let{overwrite:N,perm:M}=Object.assign({overwrite:!0},z);return new Promise((Z,L)=>{if(!G&&I.filename)G=I.filename;if(!G)L("ADM-ZIP: ZIP File Name Missing");this.toBufferPromise().then((v)=>{let A=(V)=>V?Z(V):L("ADM-ZIP: Wasn't able to write zip file");F.writeFileToAsync(G,v,N,M,A)},L)})},toBufferPromise:function(){return new Promise((G,z)=>{X.toAsyncBuffer(G,z)})},toBuffer:function(G,z,N,M){if(typeof G==="function")return X.toAsyncBuffer(G,z,N,M),null;return X.compressToBuffer()}}}});var NL=C((G9D,d_)=>{d_.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Alpic",constant:"ALPIC",env:"ALPIC_HOST"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var XI=C((II)=>{var zL=NL(),iD=process.env;Object.defineProperty(II,"_vendors",{value:zL.map(function(D){return D.constant})});II.name=null;II.isPR=null;II.id=null;if(iD.CI!=="false")zL.forEach(function(D){let U=(Array.isArray(D.env)?D.env:[D.env]).every(function(I){return LL(I)});if(II[D.constant]=U,!U)return;II.name=D.name,II.isPR=c_(D),II.id=D.constant});II.isCI=!!(iD.CI!=="false"&&(iD.BUILD_ID||iD.BUILD_NUMBER||iD.CI||iD.CI_APP_ID||iD.CI_BUILD_ID||iD.CI_BUILD_NUMBER||iD.CI_NAME||iD.CONTINUOUS_INTEGRATION||iD.RUN_ID||II.name||!1));function LL(D){if(typeof D==="string")return!!iD[D];if("env"in D)return iD[D.env]&&iD[D.env].includes(D.includes);if("any"in D)return D.any.some(function($){return!!iD[$]});return Object.keys(D).every(function($){return iD[$]===D[$]})}function c_(D){switch(typeof D.pr){case"string":return!!iD[D.pr];case"object":if("env"in D.pr)if("any"in D.pr)return D.pr.any.some(function($){return iD[D.pr.env]===$});else return D.pr.env in iD&&iD[D.pr.env]!==D.pr.ne;else if("any"in D.pr)return D.pr.any.some(function($){return!!iD[$]});else return LL(D.pr);default:return null}}});var vL=C((H9D,EL)=>{var OL={};EL.exports=OL;var ML={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(ML).forEach(function(D){var $=ML[D],U=OL[D]=[];U.open="\x1B["+$[0]+"m",U.close="\x1B["+$[1]+"m"})});var jL=C((N9D,VL)=>{VL.exports=function(D,$){$=$||process.argv;var U=$.indexOf("--"),I=/^-{1,2}/.test(D)?"":"--",F=$.indexOf(I+D);return F!==-1&&(U===-1?!0:F<U)}});var RL=C((z9D,AL)=>{var r_=o("os"),D0=jL(),H$=process.env,m1=void 0;if(D0("no-color")||D0("no-colors")||D0("color=false"))m1=!1;else if(D0("color")||D0("colors")||D0("color=true")||D0("color=always"))m1=!0;if("FORCE_COLOR"in H$)m1=H$.FORCE_COLOR.length===0||parseInt(H$.FORCE_COLOR,10)!==0;function o_(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function t_(D){if(m1===!1)return 0;if(D0("color=16m")||D0("color=full")||D0("color=truecolor"))return 3;if(D0("color=256"))return 2;if(D&&!D.isTTY&&m1!==!0)return 0;var $=m1?1:0;if(process.platform==="win32"){var U=r_.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in H$){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(F){return F in H$})||H$.CI_NAME==="codeship")return 1;return $}if("TEAMCITY_VERSION"in H$)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(H$.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in H$){var I=parseInt((H$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(H$.TERM_PROGRAM){case"iTerm.app":return I>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(H$.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(H$.TERM))return 1;if("COLORTERM"in H$)return 1;if(H$.TERM==="dumb")return $;return $}function QI(D){var $=t_(D);return o_($)}AL.exports={supportsColor:QI,stdout:QI(process.stdout),stderr:QI(process.stderr)}});var TL=C((L9D,SL)=>{SL.exports=function($,U){var I="";$=$||"Run the trap, drop the bass",$=$.split("");var F={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return $.forEach(function(J){J=J.toLowerCase();var X=F[J]||[" "],Q=Math.floor(Math.random()*X.length);if(typeof F[J]<"u")I+=F[J][Q];else I+=J}),I}});var PL=C((w9D,bL)=>{bL.exports=function($,U){$=$||" he is here ";var I={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},F=[].concat(I.up,I.down,I.mid);function J(Y){var W=Math.floor(Math.random()*Y);return W}function X(Y){var W=!1;return F.filter(function(B){W=B===Y}),W}function Q(Y,W){var B="",K,q;W=W||{},W.up=typeof W.up<"u"?W.up:!0,W.mid=typeof W.mid<"u"?W.mid:!0,W.down=typeof W.down<"u"?W.down:!0,W.size=typeof W.size<"u"?W.size:"maxi",Y=Y.split("");for(q in Y){if(X(q))continue;switch(B=B+Y[q],K={up:0,down:0,mid:0},W.size){case"mini":K.up=J(8),K.mid=J(2),K.down=J(8);break;case"maxi":K.up=J(16)+3,K.mid=J(4)+1,K.down=J(64)+3;break;default:K.up=J(8)+1,K.mid=J(6)/2,K.down=J(8)+1;break}var H=["up","mid","down"];for(var G in H){var z=H[G];for(var N=0;N<=K[z];N++)if(W[z])B=B+I[z][J(I[z].length)]}}return B}return Q($,U)}});var uL=C((Z9D,CL)=>{CL.exports=function(D){return function($,U,I){if($===" ")return $;switch(U%3){case 0:return D.red($);case 1:return D.white($);case 2:return D.blue($)}}}});var _L=C((M9D,kL)=>{kL.exports=function(D){return function($,U,I){return U%2===0?$:D.inverse($)}}});var gL=C((O9D,xL)=>{xL.exports=function(D){var $=["red","yellow","green","blue","magenta"];return function(U,I,F){if(U===" ")return U;else return D[$[I++%$.length]](U)}}});var yL=C((E9D,fL)=>{fL.exports=function(D){var $=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(U,I,F){return U===" "?U:D[$[Math.round(Math.random()*($.length-2))]](U)}}});var lL=C((V9D,iL)=>{var HD={};iL.exports=HD;HD.themes={};var a_=o("util"),v6=HD.styles=vL(),mL=Object.defineProperties,s_=new RegExp(/[\r\n]+/g);HD.supportsColor=RL().supportsColor;if(typeof HD.enabled>"u")HD.enabled=HD.supportsColor()!==!1;HD.enable=function(){HD.enabled=!0};HD.disable=function(){HD.enabled=!1};HD.stripColors=HD.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var v9D=HD.stylize=function($,U){if(!HD.enabled)return $+"";var I=v6[U];if(!I&&U in HD)return HD[U]($);return I.open+$+I.close},e_=/[|\\{}()[\]^$+*?.]/g,Dx=function(D){if(typeof D!=="string")throw TypeError("Expected a string");return D.replace(e_,"\\$&")};function hL(D){var $=function U(){return Ux.apply(U,arguments)};return $._styles=D,$.__proto__=$x,$}var nL=function(){var D={};return v6.grey=v6.gray,Object.keys(v6).forEach(function($){v6[$].closeRe=new RegExp(Dx(v6[$].close),"g"),D[$]={get:function(){return hL(this._styles.concat($))}}}),D}(),$x=mL(function(){},nL);function Ux(){var D=Array.prototype.slice.call(arguments),$=D.map(function(X){if(X!=null&&X.constructor===String)return X;else return a_.inspect(X)}).join(" ");if(!HD.enabled||!$)return $;var U=$.indexOf(`
|
|
73
|
+
`)!=-1,I=this._styles,F=I.length;while(F--){var J=v6[I[F]];if($=J.open+$.replace(J.closeRe,J.open)+J.close,U)$=$.replace(s_,function(X){return J.close+X+J.open})}return $}HD.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var $ in D)(function(U){HD[U]=function(I){if(typeof D[U]==="object"){var F=I;for(var J in D[U])F=HD[D[U][J]](F);return F}return HD[D[U]](I)}})($)};function Fx(){var D={};return Object.keys(nL).forEach(function($){D[$]={get:function(){return hL([$])}}}),D}var Ix=function($,U){var I=U.split("");return I=I.map($),I.join("")};HD.trap=TL();HD.zalgo=PL();HD.maps={};HD.maps.america=uL()(HD);HD.maps.zebra=_L()(HD);HD.maps.rainbow=gL()(HD);HD.maps.random=yL()(HD);for(YI in HD.maps)(function(D){HD[D]=function($){return Ix(HD.maps[D],$)}})(YI);var YI;mL(HD,Fx())});var cL=C((j9D,dL)=>{var Jx=lL();dL.exports=Jx});var pL=C((Xx)=>{Xx.indent=function($){return Array($+1).join(" ")};Xx.getMaxIndexLength=function(D){var $=0;return Object.getOwnPropertyNames(D).forEach(function(U){if(D[U]===void 0)return;$=Math.max($,U.length)}),$}});var rL=C((R9D,Wx)=>{Wx.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var tL=C((qx)=>{var Y0=cL(),n0=pL(),Bx=/[^\w\s\n\r\v\t\.,]/i;qx.version=rL().version;var WI=function(D,$){return D!==void 0||$.renderUndefined},V9=function(D,$,U){if(typeof D==="boolean"||typeof D==="number"||typeof D==="function"||D===null||D===void 0||D instanceof Date)return!0;if(typeof D==="string"&&D.indexOf(`
|
|
74
74
|
`)===-1)return!0;if(U.inlineArrays&&!$){if(Array.isArray(D)&&V9(D[0],!0,U))return!0}return!1},Kx=function(D,$){if($.noColor)return D;if(typeof D==="string")return $.stringColor?Y0[$.stringColor](D):D;var U=D+"";if(D===!0)return Y0.green(U);if(D===!1)return Y0.red(U);if(D===null||D===void 0)return Y0.grey(U);if(typeof D==="number")if(D>=0)return Y0[$.positiveNumberColor](U);else return Y0[$.negativeNumberColor](U);if(typeof D==="function")return"function() {}";if(Array.isArray(D))return D.join(", ");return U},BI=function(D,$){if(D.multilineStringColor===null||D.noColor)return $;else return Y0[D.multilineStringColor]($)},Gx=function(D,$,U){var I=D.split(`
|
|
75
75
|
`);return I=I.map(function(F){return n0.indent($)+BI(U,F)}),I.join(`
|
|
76
76
|
`)},h1=function(D,$,U){if(typeof D==="string"&&D.match(Bx)&&$.escape)D=JSON.stringify(D);if(!WI(D,$))return[];if(V9(D,!1,$))return[n0.indent(U)+Kx(D,$)];if(typeof D==="string")return[n0.indent(U)+BI($,'"""'),Gx(D,U+$.defaultIndentation,$),n0.indent(U)+BI($,'"""')];if(Array.isArray(D)){if(D.length===0)return[n0.indent(U)+$.emptyArrayMsg];var I=[];return D.forEach(function(Q){if(!WI(Q,$))return;var Y="- ";if(!$.noColor)Y=Y0[$.dashColor](Y);if(Y=n0.indent(U)+Y,V9(Q,!1,$))Y+=h1(Q,$,0)[0],I.push(Y);else I.push(Y),I.push.apply(I,h1(Q,$,U+$.defaultIndentation))}),I}if(D instanceof Error)return h1({message:D.message,stack:D.stack.split(`
|
|
77
77
|
`)},$,U);var F=$.noAlign?0:n0.getMaxIndexLength(D),J,X=[];return Object.getOwnPropertyNames(D).forEach(function(Q){if(!WI(D[Q],$))return;if(J=Q+": ",!$.noColor)J=Y0[$.keysColor](J);if(J=n0.indent(U)+J,V9(D[Q],!1,$)){var Y=$.noAlign?0:F-Q.length;J+=h1(D[Q],$,Y)[0],X.push(J)}else X.push(J),X.push.apply(X,h1(D[Q],$,U+$.defaultIndentation))}),X};qx.render=function($,U,I){return I=I||0,U=U||{},U.emptyArrayMsg=U.emptyArrayMsg||"(empty array)",U.keysColor=U.keysColor||"green",U.dashColor=U.dashColor||"green",U.numberColor=U.numberColor||"blue",U.positiveNumberColor=U.positiveNumberColor||U.numberColor,U.negativeNumberColor=U.negativeNumberColor||U.numberColor,U.defaultIndentation=U.defaultIndentation||2,U.noColor=!!U.noColor,U.noAlign=!!U.noAlign,U.escape=!!U.escape,U.renderUndefined=!!U.renderUndefined,U.stringColor=U.stringColor||null,U.multilineStringColor=U.multilineStringColor||null,h1($,U,I).join(`
|
|
78
78
|
`)};qx.renderString=function($,U,I){var F="",J;if(typeof $!=="string"||$==="")return"";if($[0]!=="{"&&$[0]!=="["){var X;if($.indexOf("{")===-1)X=$.indexOf("[");else if($.indexOf("[")===-1)X=$.indexOf("{");else if($.indexOf("{")<$.indexOf("["))X=$.indexOf("{");else X=$.indexOf("[");F+=$.substr(0,X)+`
|
|
79
|
-
`,$=$.substr(X)}try{J=JSON.parse($)}catch(Q){return Y0.red("Error:")+" Not valid JSON!"}return F+=qx.render(J,U,I),F}});var qI=C((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});sL.default=void 0;function n1(D){return n1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},n1(D)}function aL(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,Lx(I.key),I)}}function zx(D,$,U){if($)aL(D.prototype,$);if(U)aL(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Lx(D){var $=wx(D,"string");return n1($)=="symbol"?$:$+""}function wx(D,$){if(n1(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(n1(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function Zx(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Mx(D,$,U){return $=p2($),Ox(D,GI()?Reflect.construct($,U||[],p2(D).constructor):$.apply(D,U))}function Ox(D,$){if($&&(n1($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Ex(D)}function Ex(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function vx(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)c2(D,$)}function KI(D){var $=typeof Map==="function"?new Map:void 0;return KI=function(I){if(I===null||!jx(I))return I;if(typeof I!=="function")throw TypeError("Super expression must either be null or a function");if(typeof $<"u"){if($.has(I))return $.get(I);$.set(I,F)}function F(){return Vx(I,arguments,p2(this).constructor)}return F.prototype=Object.create(I.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),c2(F,I)},KI(D)}function Vx(D,$,U){if(GI())return Reflect.construct.apply(null,arguments);var I=[null];I.push.apply(I,$);var F=new(D.bind.apply(D,I));return U&&c2(F,U.prototype),F}function GI(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(GI=function(){return!!D})()}function jx(D){try{return Function.toString.call(D).indexOf("[native code]")!==-1}catch($){return typeof D==="function"}}function c2(D,$){return c2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,F){return I.__proto__=F,I},c2(D,$)}function p2(D){return p2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},p2(D)}var Ax=function(D){function $(U){var I,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,X=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(Zx(this,$),I=Mx(this,$,[U]),I.originalRequest=J,I.originalResponse=X,I.causingError=F,F!=null)U+=", caused by ".concat(F.toString());if(J!=null){var Q=J.getHeader("X-Request-ID")||"n/a",Y=J.getMethod(),W=J.getURL(),B=X?X.getStatus():"n/a",K=X?X.getBody()||"":"n/a";U+=", originated from request (method: ".concat(Y,", url: ").concat(W,", response code: ").concat(B,", response text: ").concat(K,", request id: ").concat(Q,")")}return I.message=U,I}return vx($,D),zx($)}(KI(Error)),S9D=sL.default=Ax});var HI=C(($w)=>{Object.defineProperty($w,"__esModule",{value:!0});$w.enableDebugLog=Rx;$w.log=Sx;var Dw=!1;function Rx(){Dw=!0}function Sx(D){if(!Dw)return;console.log(D)}});var Jw=C((Fw)=>{Object.defineProperty(Fw,"__esModule",{value:!0});Fw.default=void 0;function r2(D){return r2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},r2(D)}function Px(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Uw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,ux(I.key),I)}}function Cx(D,$,U){if($)Uw(D.prototype,$);if(U)Uw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function ux(D){var $=kx(D,"string");return r2($)=="symbol"?$:$+""}function kx(D,$){if(r2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(r2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var P9D=Fw.default=function(){function D(){Px(this,D)}return Cx(D,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(U){return Promise.resolve([])}},{key:"removeUpload",value:function(U){return Promise.resolve()}},{key:"addUpload",value:function(U,I){return Promise.resolve(null)}}])}()});var Xw=C((NI,zI)=>{(function(D,$){typeof NI==="object"&&typeof zI<"u"?zI.exports=$():typeof define==="function"&&define.amd?define($):function(){var U=D.Base64,I=$();if(I.noConflict=function(){return D.Base64=U,I},D.Meteor)Base64=I;D.Base64=I}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:NI,function(){var D="3.7.8",$=D,U=typeof Buffer==="function",I=typeof TextDecoder==="function"?new TextDecoder:void 0,F=typeof TextEncoder==="function"?new TextEncoder:void 0,J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",X=Array.prototype.slice.call(J),Q=function(P){var h={};return P.forEach(function(BD,qD){return h[BD]=qD}),h}(X),Y=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,W=String.fromCharCode.bind(String),B=typeof Uint8Array.from==="function"?Uint8Array.from.bind(Uint8Array):function(P){return new Uint8Array(Array.prototype.slice.call(P,0))},K=function(P){return P.replace(/=/g,"").replace(/[+\/]/g,function(h){return h=="+"?"-":"_"})},q=function(P){return P.replace(/[^A-Za-z0-9\+\/]/g,"")},H=function(P){var h,BD,qD,LD,Z0="",GF=P.length%3;for(var l3=0;l3<P.length;){if((BD=P.charCodeAt(l3++))>255||(qD=P.charCodeAt(l3++))>255||(LD=P.charCodeAt(l3++))>255)throw TypeError("invalid character found");h=BD<<16|qD<<8|LD,Z0+=X[h>>18&63]+X[h>>12&63]+X[h>>6&63]+X[h&63]}return GF?Z0.slice(0,GF-3)+"===".substring(GF):Z0},G=typeof btoa==="function"?function(P){return btoa(P)}:U?function(P){return Buffer.from(P,"binary").toString("base64")}:H,z=U?function(P){return Buffer.from(P).toString("base64")}:function(P){var h=4096,BD=[];for(var qD=0,LD=P.length;qD<LD;qD+=h)BD.push(W.apply(null,P.subarray(qD,qD+h)));return G(BD.join(""))},N=function(P,h){if(h===void 0)h=!1;return h?K(z(P)):z(P)},M=function(P){if(P.length<2){var h=P.charCodeAt(0);return h<128?P:h<2048?W(192|h>>>6)+W(128|h&63):W(224|h>>>12&15)+W(128|h>>>6&63)+W(128|h&63)}else{var h=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return W(240|h>>>18&7)+W(128|h>>>12&63)+W(128|h>>>6&63)+W(128|h&63)}},Z=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,L=function(P){return P.replace(Z,M)},v=U?function(P){return Buffer.from(P,"utf8").toString("base64")}:F?function(P){return z(F.encode(P))}:function(P){return G(L(P))},A=function(P,h){if(h===void 0)h=!1;return h?K(v(P)):v(P)},V=function(P){return A(P,!0)},b=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,y=function(P){switch(P.length){case 4:var h=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),BD=h-65536;return W((BD>>>10)+55296)+W((BD&1023)+56320);case 3:return W((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return W((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},_=function(P){return P.replace(b,y)},n=function(P){if(P=P.replace(/\s+/g,""),!Y.test(P))throw TypeError("malformed base64.");P+="==".slice(2-(P.length&3));var h,BD,qD,LD=[];for(var Z0=0;Z0<P.length;)if(h=Q[P.charAt(Z0++)]<<18|Q[P.charAt(Z0++)]<<12|(BD=Q[P.charAt(Z0++)])<<6|(qD=Q[P.charAt(Z0++)]),BD===64)LD.push(W(h>>16&255));else if(qD===64)LD.push(W(h>>16&255,h>>8&255));else LD.push(W(h>>16&255,h>>8&255,h&255));return LD.join("")},m=typeof atob==="function"?function(P){return atob(q(P))}:U?function(P){return Buffer.from(P,"base64").toString("binary")}:n,UD=U?function(P){return B(Buffer.from(P,"base64"))}:function(P){return B(m(P).split("").map(function(h){return h.charCodeAt(0)}))},s=function(P){return UD(DD(P))},a=U?function(P){return Buffer.from(P,"base64").toString("utf8")}:I?function(P){return I.decode(UD(P))}:function(P){return _(m(P))},DD=function(P){return q(P.replace(/[-_]/g,function(h){return h=="-"?"+":"/"}))},E=function(P){return a(DD(P))},w=function(P){if(typeof P!=="string")return!1;var h=P.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(h)||!/[^\s0-9a-zA-Z\-_]/.test(h)},O=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}},S=function(){var P=function(h,BD){return Object.defineProperty(String.prototype,h,O(BD))};P("fromBase64",function(){return E(this)}),P("toBase64",function(h){return A(this,h)}),P("toBase64URI",function(){return A(this,!0)}),P("toBase64URL",function(){return A(this,!0)}),P("toUint8Array",function(){return s(this)})},k=function(){var P=function(h,BD){return Object.defineProperty(Uint8Array.prototype,h,O(BD))};P("toBase64",function(h){return N(this,h)}),P("toBase64URI",function(){return N(this,!0)}),P("toBase64URL",function(){return N(this,!0)})},u=function(){S(),k()},t={version:D,VERSION:$,atob:m,atobPolyfill:n,btoa:G,btoaPolyfill:H,fromBase64:E,toBase64:A,encode:A,encodeURI:V,encodeURL:V,utob:L,btou:_,decode:E,isValid:w,fromUint8Array:N,toUint8Array:s,extendString:S,extendUint8Array:k,extendBuiltins:u};return t.Base64={},Object.keys(t).forEach(function(P){return t.Base64[P]=t[P]}),t})});var Yw=C((u9D,Qw)=>{Qw.exports=function($,U){if(U=U.split(":")[0],$=+$,!$)return!1;switch(U){case"http":case"ws":return $!==80;case"https":case"wss":return $!==443;case"ftp":return $!==21;case"gopher":return $!==70;case"file":return!1}return $!==0}});var Kw=C((yx)=>{var _x=Object.prototype.hasOwnProperty,xx;function Ww(D){try{return decodeURIComponent(D.replace(/\+/g," "))}catch($){return null}}function Bw(D){try{return encodeURIComponent(D)}catch($){return null}}function gx(D){var $=/([^=?#&]+)=?([^&]*)/g,U={},I;while(I=$.exec(D)){var F=Ww(I[1]),J=Ww(I[2]);if(F===null||J===null||F in U)continue;U[F]=J}return U}function fx(D,$){$=$||"";var U=[],I,F;if(typeof $!=="string")$="?";for(F in D)if(_x.call(D,F)){if(I=D[F],!I&&(I===null||I===xx||isNaN(I)))I="";if(F=Bw(F),I=Bw(I),F===null||I===null)continue;U.push(F+"="+I)}return U.length?$+U.join("&"):""}yx.stringify=fx;yx.parse=gx});var Zw=C((_9D,ww)=>{var qw=Yw(),j9=Kw(),nx=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Hw=/[\n\r\t]/g,ix=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Nw=/:\d+$/,lx=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,dx=/^[a-zA-Z]:/;function wI(D){return(D?D:"").toString().replace(nx,"")}var LI=[["#","hash"],["?","query"],function($,U){return W0(U.protocol)?$.replace(/\\/g,"/"):$},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Gw={hash:1,query:1};function zw(D){var $;if(typeof window<"u")$=window;else if(typeof global<"u")$=global;else if(typeof self<"u")$=self;else $={};var U=$.location||{};D=D||U;var I={},F=typeof D,J;if(D.protocol==="blob:")I=new B0(unescape(D.pathname),{});else if(F==="string"){I=new B0(D,{});for(J in Gw)delete I[J]}else if(F==="object"){for(J in D){if(J in Gw)continue;I[J]=D[J]}if(I.slashes===void 0)I.slashes=ix.test(D.href)}return I}function W0(D){return D==="file:"||D==="ftp:"||D==="http:"||D==="https:"||D==="ws:"||D==="wss:"}function Lw(D,$){D=wI(D),D=D.replace(Hw,""),$=$||{};var U=lx.exec(D),I=U[1]?U[1].toLowerCase():"",F=!!U[2],J=!!U[3],X=0,Q;if(F)if(J)Q=U[2]+U[3]+U[4],X=U[2].length+U[3].length;else Q=U[2]+U[4],X=U[2].length;else if(J)Q=U[3]+U[4],X=U[3].length;else Q=U[4];if(I==="file:"){if(X>=2)Q=Q.slice(2)}else if(W0(I))Q=U[4];else if(I){if(F)Q=Q.slice(2)}else if(X>=2&&W0($.protocol))Q=U[4];return{protocol:I,slashes:F||W0(I),slashesCount:X,rest:Q}}function cx(D,$){if(D==="")return $;var U=($||"/").split("/").slice(0,-1).concat(D.split("/")),I=U.length,F=U[I-1],J=!1,X=0;while(I--)if(U[I]===".")U.splice(I,1);else if(U[I]==="..")U.splice(I,1),X++;else if(X){if(I===0)J=!0;U.splice(I,1),X--}if(J)U.unshift("");if(F==="."||F==="..")U.push("");return U.join("/")}function B0(D,$,U){if(D=wI(D),D=D.replace(Hw,""),!(this instanceof B0))return new B0(D,$,U);var I,F,J,X,Q,Y,W=LI.slice(),B=typeof $,K=this,q=0;if(B!=="object"&&B!=="string")U=$,$=null;if(U&&typeof U!=="function")U=j9.parse;if($=zw($),F=Lw(D||"",$),I=!F.protocol&&!F.slashes,K.slashes=F.slashes||I&&$.slashes,K.protocol=F.protocol||$.protocol||"",D=F.rest,F.protocol==="file:"&&(F.slashesCount!==2||dx.test(D))||!F.slashes&&(F.protocol||F.slashesCount<2||!W0(K.protocol)))W[3]=[/(.*)/,"pathname"];for(;q<W.length;q++){if(X=W[q],typeof X==="function"){D=X(D,K);continue}if(J=X[0],Y=X[1],J!==J)K[Y]=D;else if(typeof J==="string"){if(Q=J==="@"?D.lastIndexOf(J):D.indexOf(J),~Q)if(typeof X[2]==="number")K[Y]=D.slice(0,Q),D=D.slice(Q+X[2]);else K[Y]=D.slice(Q),D=D.slice(0,Q)}else if(Q=J.exec(D))K[Y]=Q[1],D=D.slice(0,Q.index);if(K[Y]=K[Y]||(I&&X[3]?$[Y]||"":""),X[4])K[Y]=K[Y].toLowerCase()}if(U)K.query=U(K.query);if(I&&$.slashes&&K.pathname.charAt(0)!=="/"&&(K.pathname!==""||$.pathname!==""))K.pathname=cx(K.pathname,$.pathname);if(K.pathname.charAt(0)!=="/"&&W0(K.protocol))K.pathname="/"+K.pathname;if(!qw(K.port,K.protocol))K.host=K.hostname,K.port="";if(K.username=K.password="",K.auth){if(Q=K.auth.indexOf(":"),~Q)K.username=K.auth.slice(0,Q),K.username=encodeURIComponent(decodeURIComponent(K.username)),K.password=K.auth.slice(Q+1),K.password=encodeURIComponent(decodeURIComponent(K.password));else K.username=encodeURIComponent(decodeURIComponent(K.auth));K.auth=K.password?K.username+":"+K.password:K.username}K.origin=K.protocol!=="file:"&&W0(K.protocol)&&K.host?K.protocol+"//"+K.host:"null",K.href=K.toString()}function px(D,$,U){var I=this;switch(D){case"query":if(typeof $==="string"&&$.length)$=(U||j9.parse)($);I[D]=$;break;case"port":if(I[D]=$,!qw($,I.protocol))I.host=I.hostname,I[D]="";else if($)I.host=I.hostname+":"+$;break;case"hostname":if(I[D]=$,I.port)$+=":"+I.port;I.host=$;break;case"host":if(I[D]=$,Nw.test($))$=$.split(":"),I.port=$.pop(),I.hostname=$.join(":");else I.hostname=$,I.port="";break;case"protocol":I.protocol=$.toLowerCase(),I.slashes=!U;break;case"pathname":case"hash":if($){var F=D==="pathname"?"/":"#";I[D]=$.charAt(0)!==F?F+$:$}else I[D]=$;break;case"username":case"password":I[D]=encodeURIComponent($);break;case"auth":var J=$.indexOf(":");if(~J)I.username=$.slice(0,J),I.username=encodeURIComponent(decodeURIComponent(I.username)),I.password=$.slice(J+1),I.password=encodeURIComponent(decodeURIComponent(I.password));else I.username=encodeURIComponent(decodeURIComponent($))}for(var X=0;X<LI.length;X++){var Q=LI[X];if(Q[4])I[Q[1]]=I[Q[1]].toLowerCase()}return I.auth=I.password?I.username+":"+I.password:I.username,I.origin=I.protocol!=="file:"&&W0(I.protocol)&&I.host?I.protocol+"//"+I.host:"null",I.href=I.toString(),I}function rx(D){if(!D||typeof D!=="function")D=j9.stringify;var $,U=this,I=U.host,F=U.protocol;if(F&&F.charAt(F.length-1)!==":")F+=":";var J=F+(U.protocol&&U.slashes||W0(U.protocol)?"//":"");if(U.username){if(J+=U.username,U.password)J+=":"+U.password;J+="@"}else if(U.password)J+=":"+U.password,J+="@";else if(U.protocol!=="file:"&&W0(U.protocol)&&!I&&U.pathname!=="/")J+="@";if(I[I.length-1]===":"||Nw.test(U.hostname)&&!U.port)I+=":";if(J+=I+U.pathname,$=typeof U.query==="object"?D(U.query):U.query,$)J+=$.charAt(0)!=="?"?"?"+$:$;if(U.hash)J+=U.hash;return J}B0.prototype={set:px,toString:rx};B0.extractProtocol=Lw;B0.location=zw;B0.trimLeft=wI;B0.qs=j9;ww.exports=B0});var Ow=C((Mw)=>{Object.defineProperty(Mw,"__esModule",{value:!0});Mw.default=ox;function ox(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(D){var $=Math.random()*16|0,U=D==="x"?$:$&3|8;return U.toString(16)})}});var fw=C((xw)=>{Object.defineProperty(xw,"__esModule",{value:!0});xw.default=void 0;var ax=Xw(),sx=OI(Zw()),A9=OI(qI()),V6=HI(),ex=OI(Ow());function OI(D){return D&&D.__esModule?D:{default:D}}function ZI(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ZI=function(){return $};var D,$={},U=Object.prototype,I=U.hasOwnProperty,F=Object.defineProperty||function(E,w,O){E[w]=O.value},J=typeof Symbol=="function"?Symbol:{},X=J.iterator||"@@iterator",Q=J.asyncIterator||"@@asyncIterator",Y=J.toStringTag||"@@toStringTag";function W(E,w,O){return Object.defineProperty(E,w,{value:O,enumerable:!0,configurable:!0,writable:!0}),E[w]}try{W({},"")}catch(E){W=function(O,S,k){return O[S]=k}}function B(E,w,O,S){var k=w&&w.prototype instanceof M?w:M,u=Object.create(k.prototype),t=new a(S||[]);return F(u,"_invoke",{value:n(E,O,t)}),u}function K(E,w,O){try{return{type:"normal",arg:E.call(w,O)}}catch(S){return{type:"throw",arg:S}}}$.wrap=B;var q="suspendedStart",H="suspendedYield",G="executing",z="completed",N={};function M(){}function Z(){}function L(){}var v={};W(v,X,function(){return this});var A=Object.getPrototypeOf,V=A&&A(A(DD([])));V&&V!==U&&I.call(V,X)&&(v=V);var b=L.prototype=M.prototype=Object.create(v);function y(E){["next","throw","return"].forEach(function(w){W(E,w,function(O){return this._invoke(w,O)})})}function _(E,w){function O(k,u,t,P){var h=K(E[k],E,u);if(h.type!=="throw"){var BD=h.arg,qD=BD.value;return qD&&j6(qD)=="object"&&I.call(qD,"__await")?w.resolve(qD.__await).then(function(LD){O("next",LD,t,P)},function(LD){O("throw",LD,t,P)}):w.resolve(qD).then(function(LD){BD.value=LD,t(BD)},function(LD){return O("throw",LD,t,P)})}P(h.arg)}var S;F(this,"_invoke",{value:function(u,t){function P(){return new w(function(h,BD){O(u,t,h,BD)})}return S=S?S.then(P,P):P()}})}function n(E,w,O){var S=q;return function(k,u){if(S===G)throw Error("Generator is already running");if(S===z){if(k==="throw")throw u;return{value:D,done:!0}}for(O.method=k,O.arg=u;;){var t=O.delegate;if(t){var P=m(t,O);if(P){if(P===N)continue;return P}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(S===q)throw S=z,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);S=G;var h=K(E,w,O);if(h.type==="normal"){if(S=O.done?z:H,h.arg===N)continue;return{value:h.arg,done:O.done}}h.type==="throw"&&(S=z,O.method="throw",O.arg=h.arg)}}}function m(E,w){var O=w.method,S=E.iterator[O];if(S===D)return w.delegate=null,O==="throw"&&E.iterator.return&&(w.method="return",w.arg=D,m(E,w),w.method==="throw")||O!=="return"&&(w.method="throw",w.arg=TypeError("The iterator does not provide a '"+O+"' method")),N;var k=K(S,E.iterator,w.arg);if(k.type==="throw")return w.method="throw",w.arg=k.arg,w.delegate=null,N;var u=k.arg;return u?u.done?(w[E.resultName]=u.value,w.next=E.nextLoc,w.method!=="return"&&(w.method="next",w.arg=D),w.delegate=null,N):u:(w.method="throw",w.arg=TypeError("iterator result is not an object"),w.delegate=null,N)}function UD(E){var w={tryLoc:E[0]};1 in E&&(w.catchLoc=E[1]),2 in E&&(w.finallyLoc=E[2],w.afterLoc=E[3]),this.tryEntries.push(w)}function s(E){var w=E.completion||{};w.type="normal",delete w.arg,E.completion=w}function a(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(UD,this),this.reset(!0)}function DD(E){if(E||E===""){var w=E[X];if(w)return w.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var O=-1,S=function k(){for(;++O<E.length;)if(I.call(E,O))return k.value=E[O],k.done=!1,k;return k.value=D,k.done=!0,k};return S.next=S}}throw TypeError(j6(E)+" is not iterable")}return Z.prototype=L,F(b,"constructor",{value:L,configurable:!0}),F(L,"constructor",{value:Z,configurable:!0}),Z.displayName=W(L,Y,"GeneratorFunction"),$.isGeneratorFunction=function(E){var w=typeof E=="function"&&E.constructor;return!!w&&(w===Z||(w.displayName||w.name)==="GeneratorFunction")},$.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,L):(E.__proto__=L,W(E,Y,"GeneratorFunction")),E.prototype=Object.create(b),E},$.awrap=function(E){return{__await:E}},y(_.prototype),W(_.prototype,Q,function(){return this}),$.AsyncIterator=_,$.async=function(E,w,O,S,k){k===void 0&&(k=Promise);var u=new _(B(E,w,O,S),k);return $.isGeneratorFunction(w)?u:u.next().then(function(t){return t.done?t.value:u.next()})},y(b),W(b,Y,"Generator"),W(b,X,function(){return this}),W(b,"toString",function(){return"[object Generator]"}),$.keys=function(E){var w=Object(E),O=[];for(var S in w)O.push(S);return O.reverse(),function k(){for(;O.length;){var u=O.pop();if(u in w)return k.value=u,k.done=!1,k}return k.done=!0,k}},$.values=DD,a.prototype={constructor:a,reset:function(w){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(s),!w)for(var O in this)O.charAt(0)==="t"&&I.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=D)},stop:function(){this.done=!0;var w=this.tryEntries[0].completion;if(w.type==="throw")throw w.arg;return this.rval},dispatchException:function(w){if(this.done)throw w;var O=this;function S(BD,qD){return t.type="throw",t.arg=w,O.next=BD,qD&&(O.method="next",O.arg=D),!!qD}for(var k=this.tryEntries.length-1;k>=0;--k){var u=this.tryEntries[k],t=u.completion;if(u.tryLoc==="root")return S("end");if(u.tryLoc<=this.prev){var P=I.call(u,"catchLoc"),h=I.call(u,"finallyLoc");if(P&&h){if(this.prev<u.catchLoc)return S(u.catchLoc,!0);if(this.prev<u.finallyLoc)return S(u.finallyLoc)}else if(P){if(this.prev<u.catchLoc)return S(u.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return S(u.finallyLoc)}}}},abrupt:function(w,O){for(var S=this.tryEntries.length-1;S>=0;--S){var k=this.tryEntries[S];if(k.tryLoc<=this.prev&&I.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var u=k;break}}u&&(w==="break"||w==="continue")&&u.tryLoc<=O&&O<=u.finallyLoc&&(u=null);var t=u?u.completion:{};return t.type=w,t.arg=O,u?(this.method="next",this.next=u.finallyLoc,N):this.complete(t)},complete:function(w,O){if(w.type==="throw")throw w.arg;return w.type==="break"||w.type==="continue"?this.next=w.arg:w.type==="return"?(this.rval=this.arg=w.arg,this.method="return",this.next="end"):w.type==="normal"&&O&&(this.next=O),N},finish:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.finallyLoc===w)return this.complete(S.completion,S.afterLoc),s(S),N}},catch:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.tryLoc===w){var k=S.completion;if(k.type==="throw"){var u=k.arg;s(S)}return u}}throw Error("illegal catch attempt")},delegateYield:function(w,O,S){return this.delegate={iterator:DD(w),resultName:O,nextLoc:S},this.method==="next"&&(this.arg=D),N}},$}function Ew(D,$,U,I,F,J,X){try{var Q=D[J](X),Y=Q.value}catch(W){U(W);return}if(Q.done)$(Y);else Promise.resolve(Y).then(I,F)}function Dg(D){return function(){var $=this,U=arguments;return new Promise(function(I,F){var J=D.apply($,U);function X(Y){Ew(J,I,F,X,Q,"next",Y)}function Q(Y){Ew(J,I,F,X,Q,"throw",Y)}X(void 0)})}}function Pw(D,$){return Fg(D)||Ug(D,$)||Cw(D,$)||$g()}function $g(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
79
|
+
`,$=$.substr(X)}try{J=JSON.parse($)}catch(Q){return Y0.red("Error:")+" Not valid JSON!"}return F+=qx.render(J,U,I),F}});var qI=C((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});sL.default=void 0;function n1(D){return n1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},n1(D)}function aL(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,Lx(I.key),I)}}function zx(D,$,U){if($)aL(D.prototype,$);if(U)aL(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Lx(D){var $=wx(D,"string");return n1($)=="symbol"?$:$+""}function wx(D,$){if(n1(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(n1(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function Zx(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Mx(D,$,U){return $=p2($),Ox(D,GI()?Reflect.construct($,U||[],p2(D).constructor):$.apply(D,U))}function Ox(D,$){if($&&(n1($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Ex(D)}function Ex(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function vx(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)c2(D,$)}function KI(D){var $=typeof Map==="function"?new Map:void 0;return KI=function(I){if(I===null||!jx(I))return I;if(typeof I!=="function")throw TypeError("Super expression must either be null or a function");if(typeof $<"u"){if($.has(I))return $.get(I);$.set(I,F)}function F(){return Vx(I,arguments,p2(this).constructor)}return F.prototype=Object.create(I.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),c2(F,I)},KI(D)}function Vx(D,$,U){if(GI())return Reflect.construct.apply(null,arguments);var I=[null];I.push.apply(I,$);var F=new(D.bind.apply(D,I));return U&&c2(F,U.prototype),F}function GI(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(GI=function(){return!!D})()}function jx(D){try{return Function.toString.call(D).indexOf("[native code]")!==-1}catch($){return typeof D==="function"}}function c2(D,$){return c2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,F){return I.__proto__=F,I},c2(D,$)}function p2(D){return p2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},p2(D)}var Ax=function(D){function $(U){var I,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,X=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(Zx(this,$),I=Mx(this,$,[U]),I.originalRequest=J,I.originalResponse=X,I.causingError=F,F!=null)U+=", caused by ".concat(F.toString());if(J!=null){var Q=J.getHeader("X-Request-ID")||"n/a",Y=J.getMethod(),W=J.getURL(),B=X?X.getStatus():"n/a",K=X?X.getBody()||"":"n/a";U+=", originated from request (method: ".concat(Y,", url: ").concat(W,", response code: ").concat(B,", response text: ").concat(K,", request id: ").concat(Q,")")}return I.message=U,I}return vx($,D),zx($)}(KI(Error)),T9D=sL.default=Ax});var HI=C(($w)=>{Object.defineProperty($w,"__esModule",{value:!0});$w.enableDebugLog=Rx;$w.log=Sx;var Dw=!1;function Rx(){Dw=!0}function Sx(D){if(!Dw)return;console.log(D)}});var Jw=C((Fw)=>{Object.defineProperty(Fw,"__esModule",{value:!0});Fw.default=void 0;function r2(D){return r2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},r2(D)}function Px(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Uw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,ux(I.key),I)}}function Cx(D,$,U){if($)Uw(D.prototype,$);if(U)Uw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function ux(D){var $=kx(D,"string");return r2($)=="symbol"?$:$+""}function kx(D,$){if(r2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(r2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var C9D=Fw.default=function(){function D(){Px(this,D)}return Cx(D,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(U){return Promise.resolve([])}},{key:"removeUpload",value:function(U){return Promise.resolve()}},{key:"addUpload",value:function(U,I){return Promise.resolve(null)}}])}()});var Xw=C((NI,zI)=>{(function(D,$){typeof NI==="object"&&typeof zI<"u"?zI.exports=$():typeof define==="function"&&define.amd?define($):function(){var U=D.Base64,I=$();if(I.noConflict=function(){return D.Base64=U,I},D.Meteor)Base64=I;D.Base64=I}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:NI,function(){var D="3.7.8",$=D,U=typeof Buffer==="function",I=typeof TextDecoder==="function"?new TextDecoder:void 0,F=typeof TextEncoder==="function"?new TextEncoder:void 0,J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",X=Array.prototype.slice.call(J),Q=function(P){var h={};return P.forEach(function(BD,qD){return h[BD]=qD}),h}(X),Y=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,W=String.fromCharCode.bind(String),B=typeof Uint8Array.from==="function"?Uint8Array.from.bind(Uint8Array):function(P){return new Uint8Array(Array.prototype.slice.call(P,0))},K=function(P){return P.replace(/=/g,"").replace(/[+\/]/g,function(h){return h=="+"?"-":"_"})},q=function(P){return P.replace(/[^A-Za-z0-9\+\/]/g,"")},H=function(P){var h,BD,qD,LD,Z0="",GF=P.length%3;for(var l3=0;l3<P.length;){if((BD=P.charCodeAt(l3++))>255||(qD=P.charCodeAt(l3++))>255||(LD=P.charCodeAt(l3++))>255)throw TypeError("invalid character found");h=BD<<16|qD<<8|LD,Z0+=X[h>>18&63]+X[h>>12&63]+X[h>>6&63]+X[h&63]}return GF?Z0.slice(0,GF-3)+"===".substring(GF):Z0},G=typeof btoa==="function"?function(P){return btoa(P)}:U?function(P){return Buffer.from(P,"binary").toString("base64")}:H,z=U?function(P){return Buffer.from(P).toString("base64")}:function(P){var h=4096,BD=[];for(var qD=0,LD=P.length;qD<LD;qD+=h)BD.push(W.apply(null,P.subarray(qD,qD+h)));return G(BD.join(""))},N=function(P,h){if(h===void 0)h=!1;return h?K(z(P)):z(P)},M=function(P){if(P.length<2){var h=P.charCodeAt(0);return h<128?P:h<2048?W(192|h>>>6)+W(128|h&63):W(224|h>>>12&15)+W(128|h>>>6&63)+W(128|h&63)}else{var h=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return W(240|h>>>18&7)+W(128|h>>>12&63)+W(128|h>>>6&63)+W(128|h&63)}},Z=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,L=function(P){return P.replace(Z,M)},v=U?function(P){return Buffer.from(P,"utf8").toString("base64")}:F?function(P){return z(F.encode(P))}:function(P){return G(L(P))},A=function(P,h){if(h===void 0)h=!1;return h?K(v(P)):v(P)},V=function(P){return A(P,!0)},b=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,y=function(P){switch(P.length){case 4:var h=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),BD=h-65536;return W((BD>>>10)+55296)+W((BD&1023)+56320);case 3:return W((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return W((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},_=function(P){return P.replace(b,y)},n=function(P){if(P=P.replace(/\s+/g,""),!Y.test(P))throw TypeError("malformed base64.");P+="==".slice(2-(P.length&3));var h,BD,qD,LD=[];for(var Z0=0;Z0<P.length;)if(h=Q[P.charAt(Z0++)]<<18|Q[P.charAt(Z0++)]<<12|(BD=Q[P.charAt(Z0++)])<<6|(qD=Q[P.charAt(Z0++)]),BD===64)LD.push(W(h>>16&255));else if(qD===64)LD.push(W(h>>16&255,h>>8&255));else LD.push(W(h>>16&255,h>>8&255,h&255));return LD.join("")},m=typeof atob==="function"?function(P){return atob(q(P))}:U?function(P){return Buffer.from(P,"base64").toString("binary")}:n,UD=U?function(P){return B(Buffer.from(P,"base64"))}:function(P){return B(m(P).split("").map(function(h){return h.charCodeAt(0)}))},s=function(P){return UD(DD(P))},a=U?function(P){return Buffer.from(P,"base64").toString("utf8")}:I?function(P){return I.decode(UD(P))}:function(P){return _(m(P))},DD=function(P){return q(P.replace(/[-_]/g,function(h){return h=="-"?"+":"/"}))},E=function(P){return a(DD(P))},w=function(P){if(typeof P!=="string")return!1;var h=P.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(h)||!/[^\s0-9a-zA-Z\-_]/.test(h)},O=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}},S=function(){var P=function(h,BD){return Object.defineProperty(String.prototype,h,O(BD))};P("fromBase64",function(){return E(this)}),P("toBase64",function(h){return A(this,h)}),P("toBase64URI",function(){return A(this,!0)}),P("toBase64URL",function(){return A(this,!0)}),P("toUint8Array",function(){return s(this)})},k=function(){var P=function(h,BD){return Object.defineProperty(Uint8Array.prototype,h,O(BD))};P("toBase64",function(h){return N(this,h)}),P("toBase64URI",function(){return N(this,!0)}),P("toBase64URL",function(){return N(this,!0)})},u=function(){S(),k()},t={version:D,VERSION:$,atob:m,atobPolyfill:n,btoa:G,btoaPolyfill:H,fromBase64:E,toBase64:A,encode:A,encodeURI:V,encodeURL:V,utob:L,btou:_,decode:E,isValid:w,fromUint8Array:N,toUint8Array:s,extendString:S,extendUint8Array:k,extendBuiltins:u};return t.Base64={},Object.keys(t).forEach(function(P){return t.Base64[P]=t[P]}),t})});var Yw=C((k9D,Qw)=>{Qw.exports=function($,U){if(U=U.split(":")[0],$=+$,!$)return!1;switch(U){case"http":case"ws":return $!==80;case"https":case"wss":return $!==443;case"ftp":return $!==21;case"gopher":return $!==70;case"file":return!1}return $!==0}});var Kw=C((yx)=>{var _x=Object.prototype.hasOwnProperty,xx;function Ww(D){try{return decodeURIComponent(D.replace(/\+/g," "))}catch($){return null}}function Bw(D){try{return encodeURIComponent(D)}catch($){return null}}function gx(D){var $=/([^=?#&]+)=?([^&]*)/g,U={},I;while(I=$.exec(D)){var F=Ww(I[1]),J=Ww(I[2]);if(F===null||J===null||F in U)continue;U[F]=J}return U}function fx(D,$){$=$||"";var U=[],I,F;if(typeof $!=="string")$="?";for(F in D)if(_x.call(D,F)){if(I=D[F],!I&&(I===null||I===xx||isNaN(I)))I="";if(F=Bw(F),I=Bw(I),F===null||I===null)continue;U.push(F+"="+I)}return U.length?$+U.join("&"):""}yx.stringify=fx;yx.parse=gx});var Zw=C((x9D,ww)=>{var qw=Yw(),j9=Kw(),nx=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Hw=/[\n\r\t]/g,ix=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Nw=/:\d+$/,lx=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,dx=/^[a-zA-Z]:/;function wI(D){return(D?D:"").toString().replace(nx,"")}var LI=[["#","hash"],["?","query"],function($,U){return W0(U.protocol)?$.replace(/\\/g,"/"):$},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Gw={hash:1,query:1};function zw(D){var $;if(typeof window<"u")$=window;else if(typeof global<"u")$=global;else if(typeof self<"u")$=self;else $={};var U=$.location||{};D=D||U;var I={},F=typeof D,J;if(D.protocol==="blob:")I=new B0(unescape(D.pathname),{});else if(F==="string"){I=new B0(D,{});for(J in Gw)delete I[J]}else if(F==="object"){for(J in D){if(J in Gw)continue;I[J]=D[J]}if(I.slashes===void 0)I.slashes=ix.test(D.href)}return I}function W0(D){return D==="file:"||D==="ftp:"||D==="http:"||D==="https:"||D==="ws:"||D==="wss:"}function Lw(D,$){D=wI(D),D=D.replace(Hw,""),$=$||{};var U=lx.exec(D),I=U[1]?U[1].toLowerCase():"",F=!!U[2],J=!!U[3],X=0,Q;if(F)if(J)Q=U[2]+U[3]+U[4],X=U[2].length+U[3].length;else Q=U[2]+U[4],X=U[2].length;else if(J)Q=U[3]+U[4],X=U[3].length;else Q=U[4];if(I==="file:"){if(X>=2)Q=Q.slice(2)}else if(W0(I))Q=U[4];else if(I){if(F)Q=Q.slice(2)}else if(X>=2&&W0($.protocol))Q=U[4];return{protocol:I,slashes:F||W0(I),slashesCount:X,rest:Q}}function cx(D,$){if(D==="")return $;var U=($||"/").split("/").slice(0,-1).concat(D.split("/")),I=U.length,F=U[I-1],J=!1,X=0;while(I--)if(U[I]===".")U.splice(I,1);else if(U[I]==="..")U.splice(I,1),X++;else if(X){if(I===0)J=!0;U.splice(I,1),X--}if(J)U.unshift("");if(F==="."||F==="..")U.push("");return U.join("/")}function B0(D,$,U){if(D=wI(D),D=D.replace(Hw,""),!(this instanceof B0))return new B0(D,$,U);var I,F,J,X,Q,Y,W=LI.slice(),B=typeof $,K=this,q=0;if(B!=="object"&&B!=="string")U=$,$=null;if(U&&typeof U!=="function")U=j9.parse;if($=zw($),F=Lw(D||"",$),I=!F.protocol&&!F.slashes,K.slashes=F.slashes||I&&$.slashes,K.protocol=F.protocol||$.protocol||"",D=F.rest,F.protocol==="file:"&&(F.slashesCount!==2||dx.test(D))||!F.slashes&&(F.protocol||F.slashesCount<2||!W0(K.protocol)))W[3]=[/(.*)/,"pathname"];for(;q<W.length;q++){if(X=W[q],typeof X==="function"){D=X(D,K);continue}if(J=X[0],Y=X[1],J!==J)K[Y]=D;else if(typeof J==="string"){if(Q=J==="@"?D.lastIndexOf(J):D.indexOf(J),~Q)if(typeof X[2]==="number")K[Y]=D.slice(0,Q),D=D.slice(Q+X[2]);else K[Y]=D.slice(Q),D=D.slice(0,Q)}else if(Q=J.exec(D))K[Y]=Q[1],D=D.slice(0,Q.index);if(K[Y]=K[Y]||(I&&X[3]?$[Y]||"":""),X[4])K[Y]=K[Y].toLowerCase()}if(U)K.query=U(K.query);if(I&&$.slashes&&K.pathname.charAt(0)!=="/"&&(K.pathname!==""||$.pathname!==""))K.pathname=cx(K.pathname,$.pathname);if(K.pathname.charAt(0)!=="/"&&W0(K.protocol))K.pathname="/"+K.pathname;if(!qw(K.port,K.protocol))K.host=K.hostname,K.port="";if(K.username=K.password="",K.auth){if(Q=K.auth.indexOf(":"),~Q)K.username=K.auth.slice(0,Q),K.username=encodeURIComponent(decodeURIComponent(K.username)),K.password=K.auth.slice(Q+1),K.password=encodeURIComponent(decodeURIComponent(K.password));else K.username=encodeURIComponent(decodeURIComponent(K.auth));K.auth=K.password?K.username+":"+K.password:K.username}K.origin=K.protocol!=="file:"&&W0(K.protocol)&&K.host?K.protocol+"//"+K.host:"null",K.href=K.toString()}function px(D,$,U){var I=this;switch(D){case"query":if(typeof $==="string"&&$.length)$=(U||j9.parse)($);I[D]=$;break;case"port":if(I[D]=$,!qw($,I.protocol))I.host=I.hostname,I[D]="";else if($)I.host=I.hostname+":"+$;break;case"hostname":if(I[D]=$,I.port)$+=":"+I.port;I.host=$;break;case"host":if(I[D]=$,Nw.test($))$=$.split(":"),I.port=$.pop(),I.hostname=$.join(":");else I.hostname=$,I.port="";break;case"protocol":I.protocol=$.toLowerCase(),I.slashes=!U;break;case"pathname":case"hash":if($){var F=D==="pathname"?"/":"#";I[D]=$.charAt(0)!==F?F+$:$}else I[D]=$;break;case"username":case"password":I[D]=encodeURIComponent($);break;case"auth":var J=$.indexOf(":");if(~J)I.username=$.slice(0,J),I.username=encodeURIComponent(decodeURIComponent(I.username)),I.password=$.slice(J+1),I.password=encodeURIComponent(decodeURIComponent(I.password));else I.username=encodeURIComponent(decodeURIComponent($))}for(var X=0;X<LI.length;X++){var Q=LI[X];if(Q[4])I[Q[1]]=I[Q[1]].toLowerCase()}return I.auth=I.password?I.username+":"+I.password:I.username,I.origin=I.protocol!=="file:"&&W0(I.protocol)&&I.host?I.protocol+"//"+I.host:"null",I.href=I.toString(),I}function rx(D){if(!D||typeof D!=="function")D=j9.stringify;var $,U=this,I=U.host,F=U.protocol;if(F&&F.charAt(F.length-1)!==":")F+=":";var J=F+(U.protocol&&U.slashes||W0(U.protocol)?"//":"");if(U.username){if(J+=U.username,U.password)J+=":"+U.password;J+="@"}else if(U.password)J+=":"+U.password,J+="@";else if(U.protocol!=="file:"&&W0(U.protocol)&&!I&&U.pathname!=="/")J+="@";if(I[I.length-1]===":"||Nw.test(U.hostname)&&!U.port)I+=":";if(J+=I+U.pathname,$=typeof U.query==="object"?D(U.query):U.query,$)J+=$.charAt(0)!=="?"?"?"+$:$;if(U.hash)J+=U.hash;return J}B0.prototype={set:px,toString:rx};B0.extractProtocol=Lw;B0.location=zw;B0.trimLeft=wI;B0.qs=j9;ww.exports=B0});var Ow=C((Mw)=>{Object.defineProperty(Mw,"__esModule",{value:!0});Mw.default=ox;function ox(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(D){var $=Math.random()*16|0,U=D==="x"?$:$&3|8;return U.toString(16)})}});var fw=C((xw)=>{Object.defineProperty(xw,"__esModule",{value:!0});xw.default=void 0;var ax=Xw(),sx=OI(Zw()),A9=OI(qI()),V6=HI(),ex=OI(Ow());function OI(D){return D&&D.__esModule?D:{default:D}}function ZI(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ZI=function(){return $};var D,$={},U=Object.prototype,I=U.hasOwnProperty,F=Object.defineProperty||function(E,w,O){E[w]=O.value},J=typeof Symbol=="function"?Symbol:{},X=J.iterator||"@@iterator",Q=J.asyncIterator||"@@asyncIterator",Y=J.toStringTag||"@@toStringTag";function W(E,w,O){return Object.defineProperty(E,w,{value:O,enumerable:!0,configurable:!0,writable:!0}),E[w]}try{W({},"")}catch(E){W=function(O,S,k){return O[S]=k}}function B(E,w,O,S){var k=w&&w.prototype instanceof M?w:M,u=Object.create(k.prototype),t=new a(S||[]);return F(u,"_invoke",{value:n(E,O,t)}),u}function K(E,w,O){try{return{type:"normal",arg:E.call(w,O)}}catch(S){return{type:"throw",arg:S}}}$.wrap=B;var q="suspendedStart",H="suspendedYield",G="executing",z="completed",N={};function M(){}function Z(){}function L(){}var v={};W(v,X,function(){return this});var A=Object.getPrototypeOf,V=A&&A(A(DD([])));V&&V!==U&&I.call(V,X)&&(v=V);var b=L.prototype=M.prototype=Object.create(v);function y(E){["next","throw","return"].forEach(function(w){W(E,w,function(O){return this._invoke(w,O)})})}function _(E,w){function O(k,u,t,P){var h=K(E[k],E,u);if(h.type!=="throw"){var BD=h.arg,qD=BD.value;return qD&&j6(qD)=="object"&&I.call(qD,"__await")?w.resolve(qD.__await).then(function(LD){O("next",LD,t,P)},function(LD){O("throw",LD,t,P)}):w.resolve(qD).then(function(LD){BD.value=LD,t(BD)},function(LD){return O("throw",LD,t,P)})}P(h.arg)}var S;F(this,"_invoke",{value:function(u,t){function P(){return new w(function(h,BD){O(u,t,h,BD)})}return S=S?S.then(P,P):P()}})}function n(E,w,O){var S=q;return function(k,u){if(S===G)throw Error("Generator is already running");if(S===z){if(k==="throw")throw u;return{value:D,done:!0}}for(O.method=k,O.arg=u;;){var t=O.delegate;if(t){var P=m(t,O);if(P){if(P===N)continue;return P}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(S===q)throw S=z,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);S=G;var h=K(E,w,O);if(h.type==="normal"){if(S=O.done?z:H,h.arg===N)continue;return{value:h.arg,done:O.done}}h.type==="throw"&&(S=z,O.method="throw",O.arg=h.arg)}}}function m(E,w){var O=w.method,S=E.iterator[O];if(S===D)return w.delegate=null,O==="throw"&&E.iterator.return&&(w.method="return",w.arg=D,m(E,w),w.method==="throw")||O!=="return"&&(w.method="throw",w.arg=TypeError("The iterator does not provide a '"+O+"' method")),N;var k=K(S,E.iterator,w.arg);if(k.type==="throw")return w.method="throw",w.arg=k.arg,w.delegate=null,N;var u=k.arg;return u?u.done?(w[E.resultName]=u.value,w.next=E.nextLoc,w.method!=="return"&&(w.method="next",w.arg=D),w.delegate=null,N):u:(w.method="throw",w.arg=TypeError("iterator result is not an object"),w.delegate=null,N)}function UD(E){var w={tryLoc:E[0]};1 in E&&(w.catchLoc=E[1]),2 in E&&(w.finallyLoc=E[2],w.afterLoc=E[3]),this.tryEntries.push(w)}function s(E){var w=E.completion||{};w.type="normal",delete w.arg,E.completion=w}function a(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(UD,this),this.reset(!0)}function DD(E){if(E||E===""){var w=E[X];if(w)return w.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var O=-1,S=function k(){for(;++O<E.length;)if(I.call(E,O))return k.value=E[O],k.done=!1,k;return k.value=D,k.done=!0,k};return S.next=S}}throw TypeError(j6(E)+" is not iterable")}return Z.prototype=L,F(b,"constructor",{value:L,configurable:!0}),F(L,"constructor",{value:Z,configurable:!0}),Z.displayName=W(L,Y,"GeneratorFunction"),$.isGeneratorFunction=function(E){var w=typeof E=="function"&&E.constructor;return!!w&&(w===Z||(w.displayName||w.name)==="GeneratorFunction")},$.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,L):(E.__proto__=L,W(E,Y,"GeneratorFunction")),E.prototype=Object.create(b),E},$.awrap=function(E){return{__await:E}},y(_.prototype),W(_.prototype,Q,function(){return this}),$.AsyncIterator=_,$.async=function(E,w,O,S,k){k===void 0&&(k=Promise);var u=new _(B(E,w,O,S),k);return $.isGeneratorFunction(w)?u:u.next().then(function(t){return t.done?t.value:u.next()})},y(b),W(b,Y,"Generator"),W(b,X,function(){return this}),W(b,"toString",function(){return"[object Generator]"}),$.keys=function(E){var w=Object(E),O=[];for(var S in w)O.push(S);return O.reverse(),function k(){for(;O.length;){var u=O.pop();if(u in w)return k.value=u,k.done=!1,k}return k.done=!0,k}},$.values=DD,a.prototype={constructor:a,reset:function(w){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(s),!w)for(var O in this)O.charAt(0)==="t"&&I.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=D)},stop:function(){this.done=!0;var w=this.tryEntries[0].completion;if(w.type==="throw")throw w.arg;return this.rval},dispatchException:function(w){if(this.done)throw w;var O=this;function S(BD,qD){return t.type="throw",t.arg=w,O.next=BD,qD&&(O.method="next",O.arg=D),!!qD}for(var k=this.tryEntries.length-1;k>=0;--k){var u=this.tryEntries[k],t=u.completion;if(u.tryLoc==="root")return S("end");if(u.tryLoc<=this.prev){var P=I.call(u,"catchLoc"),h=I.call(u,"finallyLoc");if(P&&h){if(this.prev<u.catchLoc)return S(u.catchLoc,!0);if(this.prev<u.finallyLoc)return S(u.finallyLoc)}else if(P){if(this.prev<u.catchLoc)return S(u.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return S(u.finallyLoc)}}}},abrupt:function(w,O){for(var S=this.tryEntries.length-1;S>=0;--S){var k=this.tryEntries[S];if(k.tryLoc<=this.prev&&I.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var u=k;break}}u&&(w==="break"||w==="continue")&&u.tryLoc<=O&&O<=u.finallyLoc&&(u=null);var t=u?u.completion:{};return t.type=w,t.arg=O,u?(this.method="next",this.next=u.finallyLoc,N):this.complete(t)},complete:function(w,O){if(w.type==="throw")throw w.arg;return w.type==="break"||w.type==="continue"?this.next=w.arg:w.type==="return"?(this.rval=this.arg=w.arg,this.method="return",this.next="end"):w.type==="normal"&&O&&(this.next=O),N},finish:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.finallyLoc===w)return this.complete(S.completion,S.afterLoc),s(S),N}},catch:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.tryLoc===w){var k=S.completion;if(k.type==="throw"){var u=k.arg;s(S)}return u}}throw Error("illegal catch attempt")},delegateYield:function(w,O,S){return this.delegate={iterator:DD(w),resultName:O,nextLoc:S},this.method==="next"&&(this.arg=D),N}},$}function Ew(D,$,U,I,F,J,X){try{var Q=D[J](X),Y=Q.value}catch(W){U(W);return}if(Q.done)$(Y);else Promise.resolve(Y).then(I,F)}function Dg(D){return function(){var $=this,U=arguments;return new Promise(function(I,F){var J=D.apply($,U);function X(Y){Ew(J,I,F,X,Q,"next",Y)}function Q(Y){Ew(J,I,F,X,Q,"throw",Y)}X(void 0)})}}function Pw(D,$){return Fg(D)||Ug(D,$)||Cw(D,$)||$g()}function $g(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
80
80
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ug(D,$){var U=D==null?null:typeof Symbol<"u"&&D[Symbol.iterator]||D["@@iterator"];if(U!=null){var I,F,J,X,Q=[],Y=!0,W=!1;try{if(J=(U=U.call(D)).next,$===0){if(Object(U)!==U)return;Y=!1}else for(;!(Y=(I=J.call(U)).done)&&(Q.push(I.value),Q.length!==$);Y=!0);}catch(B){W=!0,F=B}finally{try{if(!Y&&U.return!=null&&(X=U.return(),Object(X)!==X))return}finally{if(W)throw F}}return Q}}function Fg(D){if(Array.isArray(D))return D}function j6(D){return j6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},j6(D)}function Ig(D,$){var U=typeof Symbol<"u"&&D[Symbol.iterator]||D["@@iterator"];if(!U){if(Array.isArray(D)||(U=Cw(D))||$&&D&&typeof D.length==="number"){if(U)D=U;var I=0,F=function(){};return{s:F,n:function(){if(I>=D.length)return{done:!0};return{done:!1,value:D[I++]}},e:function(W){throw W},f:F}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
81
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var J=!0,X=!1,Q;return{s:function(){U=U.call(D)},n:function(){var W=U.next();return J=W.done,W},e:function(W){X=!0,Q=W},f:function(){try{if(!J&&U.return!=null)U.return()}finally{if(X)throw Q}}}}function Cw(D,$){if(!D)return;if(typeof D==="string")return vw(D,$);var U=Object.prototype.toString.call(D).slice(8,-1);if(U==="Object"&&D.constructor)U=D.constructor.name;if(U==="Map"||U==="Set")return Array.from(D);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return vw(D,$)}function vw(D,$){if($==null||$>D.length)$=D.length;for(var U=0,I=Array($);U<$;U++)I[U]=D[U];return I}function Vw(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function i1(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Vw(Object(U),!0).forEach(function(I){Jg(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Vw(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function Jg(D,$,U){if($=uw($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function Xg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function jw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,uw(I.key),I)}}function Qg(D,$,U){if($)jw(D.prototype,$);if(U)jw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function uw(D){var $=Yg(D,"string");return j6($)=="symbol"?$:$+""}function Yg(D,$){if(j6(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(j6(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var R9="tus-v1",S9="ietf-draft-03",o2="ietf-draft-05",Wg={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:_w,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1000,3000,5000],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:R9},kw=function(){function D($,U){if(Xg(this,D),"resume"in U)console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead.");this.options=U,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=$,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return Qg(D,[{key:"findPreviousUploads",value:function(){var U=this;return this.options.fingerprint(this.file,this.options).then(function(I){return U._urlStorage.findUploadsByFingerprint(I)})}},{key:"resumeFromPreviousUpload",value:function(U){this.url=U.uploadUrl||null,this._parallelUploadUrls=U.parallelUploadUrls||null,this._urlStorageKey=U.urlStorageKey}},{key:"start",value:function(){var U=this,I=this.file;if(!I){this._emitError(Error("tus: no file or stream to upload provided"));return}if(![R9,S9,o2].includes(this.options.protocol)){this._emitError(Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(Error("tus: neither an endpoint or an upload URL is provided"));return}var F=this.options.retryDelays;if(F!=null&&Object.prototype.toString.call(F)!=="[object Array]"){this._emitError(Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var J=0,X=["uploadUrl","uploadSize","uploadLengthDeferred"];J<X.length;J++){var Q=X[J];if(this.options[Q]){this._emitError(Error("tus: cannot use the ".concat(Q," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(I,this.options).then(function(Y){if(Y==null)(0,V6.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage.");else(0,V6.log)("Calculated fingerprint: ".concat(Y));if(U._fingerprint=Y,U._source)return U._source;return U.options.fileReader.openFile(I,U.options.chunkSize)}).then(function(Y){if(U._source=Y,U.options.uploadLengthDeferred)U._size=null;else if(U.options.uploadSize!=null){if(U._size=Number(U.options.uploadSize),Number.isNaN(U._size)){U._emitError(Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(U._size=U._source.size,U._size==null){U._emitError(Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}if(U.options.parallelUploads>1||U._parallelUploadUrls!=null)U._startParallelUpload();else U._startSingleUpload()}).catch(function(Y){U._emitError(Y)})}},{key:"_startParallelUpload",value:function(){var U,I=this,F=this._size,J=0;this._parallelUploads=[];var X=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,Q=(U=this.options.parallelUploadBoundaries)!==null&&U!==void 0?U:Kg(this._source.size,X);if(this._parallelUploadUrls)Q.forEach(function(B,K){B.uploadUrl=I._parallelUploadUrls[K]||null});this._parallelUploadUrls=Array(Q.length);var Y=Q.map(function(B,K){var q=0;return I._source.slice(B.start,B.end).then(function(H){var G=H.value;return new Promise(function(z,N){var M=i1(i1({},I.options),{},{uploadUrl:B.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:I.options.metadataForPartialUploads,headers:i1(i1({},I.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:z,onError:N,onProgress:function(v){J=J-q+v,q=v,I._emitProgress(J,F)},onUploadUrlAvailable:function(){if(I._parallelUploadUrls[K]=Z.url,I._parallelUploadUrls.filter(function(v){return Boolean(v)}).length===Q.length)I._saveUploadInUrlStorage()}}),Z=new D(G,M);Z.start(),I._parallelUploads.push(Z)})})}),W;Promise.all(Y).then(function(){W=I._openRequest("POST",I.options.endpoint),W.setHeader("Upload-Concat","final;".concat(I._parallelUploadUrls.join(" ")));var B=Aw(I.options.metadata);if(B!=="")W.setHeader("Upload-Metadata",B);return I._sendRequest(W,null)}).then(function(B){if(!l1(B.getStatus(),200)){I._emitHttpError(W,B,"tus: unexpected response while creating upload");return}var K=B.getHeader("Location");if(K==null){I._emitHttpError(W,B,"tus: invalid or missing Location header");return}I.url=bw(I.options.endpoint,K),(0,V6.log)("Created upload at ".concat(I.url)),I._emitSuccess(B)}).catch(function(B){I._emitError(B)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,V6.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,V6.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,V6.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(U){var I=this;if(this._parallelUploads!=null){var F=Ig(this._parallelUploads),J;try{for(F.s();!(J=F.n()).done;){var X=J.value;X.abort(U)}}catch(Q){F.e(Q)}finally{F.f()}}if(this._req!==null)this._req.abort();if(this._aborted=!0,this._retryTimeout!=null)clearTimeout(this._retryTimeout),this._retryTimeout=null;if(!U||this.url==null)return Promise.resolve();return D.terminate(this.url,this.options).then(function(){return I._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(U,I,F,J){this._emitError(new A9.default(F,J,U,I))}},{key:"_emitError",value:function(U){var I=this;if(this._aborted)return;if(this.options.retryDelays!=null){var F=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(F)this._retryAttempt=0;if(Tw(U,this._retryAttempt,this.options)){var J=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){I.start()},J);return}}if(typeof this.options.onError==="function")this.options.onError(U);else throw U}},{key:"_emitSuccess",value:function(U){if(this.options.removeFingerprintOnSuccess)this._removeFromUrlStorage();if(typeof this.options.onSuccess==="function")this.options.onSuccess({lastResponse:U})}},{key:"_emitProgress",value:function(U,I){if(typeof this.options.onProgress==="function")this.options.onProgress(U,I)}},{key:"_emitChunkComplete",value:function(U,I,F){if(typeof this.options.onChunkComplete==="function")this.options.onChunkComplete(U,I,F)}},{key:"_createUpload",value:function(){var U=this;if(!this.options.endpoint){this._emitError(Error("tus: unable to create upload because no endpoint is provided"));return}var I=this._openRequest("POST",this.options.endpoint);if(this.options.uploadLengthDeferred)I.setHeader("Upload-Defer-Length","1");else I.setHeader("Upload-Length","".concat(this._size));var F=Aw(this.options.metadata);if(F!=="")I.setHeader("Upload-Metadata",F);var J;if(this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred)this._offset=0,J=this._addChunkToRequest(I);else{if(this.options.protocol===S9||this.options.protocol===o2)I.setHeader("Upload-Complete","?0");J=this._sendRequest(I,null)}J.then(function(X){if(!l1(X.getStatus(),200)){U._emitHttpError(I,X,"tus: unexpected response while creating upload");return}var Q=X.getHeader("Location");if(Q==null){U._emitHttpError(I,X,"tus: invalid or missing Location header");return}if(U.url=bw(U.options.endpoint,Q),(0,V6.log)("Created upload at ".concat(U.url)),typeof U.options.onUploadUrlAvailable==="function")U.options.onUploadUrlAvailable();if(U._size===0){U._emitSuccess(X),U._source.close();return}U._saveUploadInUrlStorage().then(function(){if(U.options.uploadDataDuringCreation)U._handleUploadResponse(I,X);else U._offset=0,U._performUpload()})}).catch(function(X){U._emitHttpError(I,null,"tus: failed to create upload",X)})}},{key:"_resumeUpload",value:function(){var U=this,I=this._openRequest("HEAD",this.url),F=this._sendRequest(I,null);F.then(function(J){var X=J.getStatus();if(!l1(X,200)){if(X===423){U._emitHttpError(I,J,"tus: upload is currently locked; retry later");return}if(l1(X,400))U._removeFromUrlStorage();if(!U.options.endpoint){U._emitHttpError(I,J,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}U.url=null,U._createUpload();return}var Q=Number.parseInt(J.getHeader("Upload-Offset"),10);if(Number.isNaN(Q)){U._emitHttpError(I,J,"tus: invalid or missing offset value");return}var Y=Number.parseInt(J.getHeader("Upload-Length"),10);if(Number.isNaN(Y)&&!U.options.uploadLengthDeferred&&U.options.protocol===R9){U._emitHttpError(I,J,"tus: invalid or missing length value");return}if(typeof U.options.onUploadUrlAvailable==="function")U.options.onUploadUrlAvailable();U._saveUploadInUrlStorage().then(function(){if(Q===Y){U._emitProgress(Y,Y),U._emitSuccess(J);return}U._offset=Q,U._performUpload()})}).catch(function(J){U._emitHttpError(I,null,"tus: failed to resume upload",J)})}},{key:"_performUpload",value:function(){var U=this;if(this._aborted)return;var I;if(this.options.overridePatchMethod)I=this._openRequest("POST",this.url),I.setHeader("X-HTTP-Method-Override","PATCH");else I=this._openRequest("PATCH",this.url);I.setHeader("Upload-Offset","".concat(this._offset));var F=this._addChunkToRequest(I);F.then(function(J){if(!l1(J.getStatus(),200)){U._emitHttpError(I,J,"tus: unexpected response while uploading chunk");return}U._handleUploadResponse(I,J)}).catch(function(J){if(U._aborted)return;U._emitHttpError(I,null,"tus: failed to upload chunk at offset ".concat(U._offset),J)})}},{key:"_addChunkToRequest",value:function(U){var I=this,F=this._offset,J=this._offset+this.options.chunkSize;if(U.setProgressHandler(function(X){I._emitProgress(F+X,I._size)}),this.options.protocol===R9)U.setHeader("Content-Type","application/offset+octet-stream");else if(this.options.protocol===o2)U.setHeader("Content-Type","application/partial-upload");if((J===Number.POSITIVE_INFINITY||J>this._size)&&!this.options.uploadLengthDeferred)J=this._size;return this._source.slice(F,J).then(function(X){var{value:Q,done:Y}=X,W=Q!==null&&Q!==void 0&&Q.size?Q.size:0;if(I.options.uploadLengthDeferred&&Y)I._size=I._offset+W,U.setHeader("Upload-Length","".concat(I._size));var B=I._offset+W;if(!I.options.uploadLengthDeferred&&Y&&B!==I._size)return Promise.reject(Error("upload was configured with a size of ".concat(I._size," bytes, but the source is done after ").concat(B," bytes")));if(Q===null)return I._sendRequest(U);if(I.options.protocol===S9||I.options.protocol===o2)U.setHeader("Upload-Complete",Y?"?1":"?0");return I._emitProgress(I._offset,I._size),I._sendRequest(U,Q)})}},{key:"_handleUploadResponse",value:function(U,I){var F=Number.parseInt(I.getHeader("Upload-Offset"),10);if(Number.isNaN(F)){this._emitHttpError(U,I,"tus: invalid or missing offset value");return}if(this._emitProgress(F,this._size),this._emitChunkComplete(F-this._offset,F,this._size),this._offset=F,F===this._size){this._emitSuccess(I),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(U,I){var F=Rw(U,I,this.options);return this._req=F,F}},{key:"_removeFromUrlStorage",value:function(){var U=this;if(!this._urlStorageKey)return;this._urlStorage.removeUpload(this._urlStorageKey).catch(function(I){U._emitError(I)}),this._urlStorageKey=null}},{key:"_saveUploadInUrlStorage",value:function(){var U=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var I={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};if(this._parallelUploads)I.parallelUploadUrls=this._parallelUploadUrls;else I.uploadUrl=this.url;return this._urlStorage.addUpload(this._fingerprint,I).then(function(F){U._urlStorageKey=F})}},{key:"_sendRequest",value:function(U){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Sw(U,I,this.options)}}],[{key:"terminate",value:function(U){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=Rw("DELETE",U,I);return Sw(F,null,I).then(function(J){if(J.getStatus()===204)return;throw new A9.default("tus: unexpected response while terminating upload",null,F,J)}).catch(function(J){if(!(J instanceof A9.default))J=new A9.default("tus: failed to terminate upload",J,F,null);if(!Tw(J,0,I))throw J;var X=I.retryDelays[0],Q=I.retryDelays.slice(1),Y=i1(i1({},I),{},{retryDelays:Q});return new Promise(function(W){return setTimeout(W,X)}).then(function(){return D.terminate(U,Y)})})}}])}();function Aw(D){return Object.entries(D).map(function($){var U=Pw($,2),I=U[0],F=U[1];return"".concat(I," ").concat(ax.Base64.encode(String(F)))}).join(",")}function l1(D,$){return D>=$&&D<$+100}function Rw(D,$,U){var I=U.httpStack.createRequest(D,$);if(U.protocol===S9)I.setHeader("Upload-Draft-Interop-Version","5");else if(U.protocol===o2)I.setHeader("Upload-Draft-Interop-Version","6");else I.setHeader("Tus-Resumable","1.0.0");var F=U.headers||{};for(var J=0,X=Object.entries(F);J<X.length;J++){var Q=Pw(X[J],2),Y=Q[0],W=Q[1];I.setHeader(Y,W)}if(U.addRequestId){var B=(0,ex.default)();I.setHeader("X-Request-ID",B)}return I}function Sw(D,$,U){return MI.apply(this,arguments)}function MI(){return MI=Dg(ZI().mark(function D($,U,I){var F;return ZI().wrap(function(X){while(!0)switch(X.prev=X.next){case 0:if(typeof I.onBeforeRequest!=="function"){X.next=3;break}return X.next=3,I.onBeforeRequest($);case 3:return X.next=5,$.send(U);case 5:if(F=X.sent,typeof I.onAfterResponse!=="function"){X.next=9;break}return X.next=9,I.onAfterResponse($,F);case 9:return X.abrupt("return",F);case 10:case"end":return X.stop()}},D)})),MI.apply(this,arguments)}function Bg(){var D=!0;if(typeof navigator<"u"&&navigator.onLine===!1)D=!1;return D}function Tw(D,$,U){if(U.retryDelays==null||$>=U.retryDelays.length||D.originalRequest==null)return!1;if(U&&typeof U.onShouldRetry==="function")return U.onShouldRetry(D,$,U);return _w(D)}function _w(D){var $=D.originalResponse?D.originalResponse.getStatus():0;return(!l1($,400)||$===409||$===423)&&Bg()}function bw(D,$){return new sx.default($,D).toString()}function Kg(D,$){var U=Math.floor(D/$),I=[];for(var F=0;F<$;F++)I.push({start:U*F,end:U*(F+1)});return I[$-1].end=D,I}kw.defaultOptions=Wg;var g9D=xw.default=kw});var mw=C((y9D,yw)=>{var K0=(D)=>D!==null&&typeof D==="object"&&typeof D.pipe==="function";K0.writable=(D)=>K0(D)&&D.writable!==!1&&typeof D._write==="function"&&typeof D._writableState==="object";K0.readable=(D)=>K0(D)&&D.readable!==!1&&typeof D._read==="function"&&typeof D._readableState==="object";K0.duplex=(D)=>K0.writable(D)&&K0.readable(D);K0.transform=(D)=>K0.duplex(D)&&typeof D._transform==="function";yw.exports=K0});var lw=C((nw)=>{Object.defineProperty(nw,"__esModule",{value:!0});nw.default=void 0;function t2(D){return t2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},t2(D)}function Gg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function hw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,Hg(I.key),I)}}function qg(D,$,U){if($)hw(D.prototype,$);if(U)hw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Hg(D){var $=Ng(D,"string");return t2($)=="symbol"?$:$+""}function Ng(D,$){if(t2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(t2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var m9D=nw.default=function(){function D($){Gg(this,D),this._buffer=$,this.size=$.length}return qg(D,[{key:"slice",value:function(U,I){var F=this._buffer.slice(U,I);F.size=F.length;var J=I>=this.size;return Promise.resolve({value:F,done:J})}},{key:"close",value:function(){}}])}()});var ow=C((rw)=>{Object.defineProperty(rw,"__esModule",{value:!0});rw.default=Og;var pw=o("fs");function A6(D){return A6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},A6(D)}function EI(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */EI=function(){return $};var D,$={},U=Object.prototype,I=U.hasOwnProperty,F=Object.defineProperty||function(E,w,O){E[w]=O.value},J=typeof Symbol=="function"?Symbol:{},X=J.iterator||"@@iterator",Q=J.asyncIterator||"@@asyncIterator",Y=J.toStringTag||"@@toStringTag";function W(E,w,O){return Object.defineProperty(E,w,{value:O,enumerable:!0,configurable:!0,writable:!0}),E[w]}try{W({},"")}catch(E){W=function(O,S,k){return O[S]=k}}function B(E,w,O,S){var k=w&&w.prototype instanceof M?w:M,u=Object.create(k.prototype),t=new a(S||[]);return F(u,"_invoke",{value:n(E,O,t)}),u}function K(E,w,O){try{return{type:"normal",arg:E.call(w,O)}}catch(S){return{type:"throw",arg:S}}}$.wrap=B;var q="suspendedStart",H="suspendedYield",G="executing",z="completed",N={};function M(){}function Z(){}function L(){}var v={};W(v,X,function(){return this});var A=Object.getPrototypeOf,V=A&&A(A(DD([])));V&&V!==U&&I.call(V,X)&&(v=V);var b=L.prototype=M.prototype=Object.create(v);function y(E){["next","throw","return"].forEach(function(w){W(E,w,function(O){return this._invoke(w,O)})})}function _(E,w){function O(k,u,t,P){var h=K(E[k],E,u);if(h.type!=="throw"){var BD=h.arg,qD=BD.value;return qD&&A6(qD)=="object"&&I.call(qD,"__await")?w.resolve(qD.__await).then(function(LD){O("next",LD,t,P)},function(LD){O("throw",LD,t,P)}):w.resolve(qD).then(function(LD){BD.value=LD,t(BD)},function(LD){return O("throw",LD,t,P)})}P(h.arg)}var S;F(this,"_invoke",{value:function(u,t){function P(){return new w(function(h,BD){O(u,t,h,BD)})}return S=S?S.then(P,P):P()}})}function n(E,w,O){var S=q;return function(k,u){if(S===G)throw Error("Generator is already running");if(S===z){if(k==="throw")throw u;return{value:D,done:!0}}for(O.method=k,O.arg=u;;){var t=O.delegate;if(t){var P=m(t,O);if(P){if(P===N)continue;return P}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(S===q)throw S=z,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);S=G;var h=K(E,w,O);if(h.type==="normal"){if(S=O.done?z:H,h.arg===N)continue;return{value:h.arg,done:O.done}}h.type==="throw"&&(S=z,O.method="throw",O.arg=h.arg)}}}function m(E,w){var O=w.method,S=E.iterator[O];if(S===D)return w.delegate=null,O==="throw"&&E.iterator.return&&(w.method="return",w.arg=D,m(E,w),w.method==="throw")||O!=="return"&&(w.method="throw",w.arg=TypeError("The iterator does not provide a '"+O+"' method")),N;var k=K(S,E.iterator,w.arg);if(k.type==="throw")return w.method="throw",w.arg=k.arg,w.delegate=null,N;var u=k.arg;return u?u.done?(w[E.resultName]=u.value,w.next=E.nextLoc,w.method!=="return"&&(w.method="next",w.arg=D),w.delegate=null,N):u:(w.method="throw",w.arg=TypeError("iterator result is not an object"),w.delegate=null,N)}function UD(E){var w={tryLoc:E[0]};1 in E&&(w.catchLoc=E[1]),2 in E&&(w.finallyLoc=E[2],w.afterLoc=E[3]),this.tryEntries.push(w)}function s(E){var w=E.completion||{};w.type="normal",delete w.arg,E.completion=w}function a(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(UD,this),this.reset(!0)}function DD(E){if(E||E===""){var w=E[X];if(w)return w.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var O=-1,S=function k(){for(;++O<E.length;)if(I.call(E,O))return k.value=E[O],k.done=!1,k;return k.value=D,k.done=!0,k};return S.next=S}}throw TypeError(A6(E)+" is not iterable")}return Z.prototype=L,F(b,"constructor",{value:L,configurable:!0}),F(L,"constructor",{value:Z,configurable:!0}),Z.displayName=W(L,Y,"GeneratorFunction"),$.isGeneratorFunction=function(E){var w=typeof E=="function"&&E.constructor;return!!w&&(w===Z||(w.displayName||w.name)==="GeneratorFunction")},$.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,L):(E.__proto__=L,W(E,Y,"GeneratorFunction")),E.prototype=Object.create(b),E},$.awrap=function(E){return{__await:E}},y(_.prototype),W(_.prototype,Q,function(){return this}),$.AsyncIterator=_,$.async=function(E,w,O,S,k){k===void 0&&(k=Promise);var u=new _(B(E,w,O,S),k);return $.isGeneratorFunction(w)?u:u.next().then(function(t){return t.done?t.value:u.next()})},y(b),W(b,Y,"Generator"),W(b,X,function(){return this}),W(b,"toString",function(){return"[object Generator]"}),$.keys=function(E){var w=Object(E),O=[];for(var S in w)O.push(S);return O.reverse(),function k(){for(;O.length;){var u=O.pop();if(u in w)return k.value=u,k.done=!1,k}return k.done=!0,k}},$.values=DD,a.prototype={constructor:a,reset:function(w){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(s),!w)for(var O in this)O.charAt(0)==="t"&&I.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=D)},stop:function(){this.done=!0;var w=this.tryEntries[0].completion;if(w.type==="throw")throw w.arg;return this.rval},dispatchException:function(w){if(this.done)throw w;var O=this;function S(BD,qD){return t.type="throw",t.arg=w,O.next=BD,qD&&(O.method="next",O.arg=D),!!qD}for(var k=this.tryEntries.length-1;k>=0;--k){var u=this.tryEntries[k],t=u.completion;if(u.tryLoc==="root")return S("end");if(u.tryLoc<=this.prev){var P=I.call(u,"catchLoc"),h=I.call(u,"finallyLoc");if(P&&h){if(this.prev<u.catchLoc)return S(u.catchLoc,!0);if(this.prev<u.finallyLoc)return S(u.finallyLoc)}else if(P){if(this.prev<u.catchLoc)return S(u.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return S(u.finallyLoc)}}}},abrupt:function(w,O){for(var S=this.tryEntries.length-1;S>=0;--S){var k=this.tryEntries[S];if(k.tryLoc<=this.prev&&I.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var u=k;break}}u&&(w==="break"||w==="continue")&&u.tryLoc<=O&&O<=u.finallyLoc&&(u=null);var t=u?u.completion:{};return t.type=w,t.arg=O,u?(this.method="next",this.next=u.finallyLoc,N):this.complete(t)},complete:function(w,O){if(w.type==="throw")throw w.arg;return w.type==="break"||w.type==="continue"?this.next=w.arg:w.type==="return"?(this.rval=this.arg=w.arg,this.method="return",this.next="end"):w.type==="normal"&&O&&(this.next=O),N},finish:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.finallyLoc===w)return this.complete(S.completion,S.afterLoc),s(S),N}},catch:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.tryLoc===w){var k=S.completion;if(k.type==="throw"){var u=k.arg;s(S)}return u}}throw Error("illegal catch attempt")},delegateYield:function(w,O,S){return this.delegate={iterator:DD(w),resultName:O,nextLoc:S},this.method==="next"&&(this.arg=D),N}},$}function zg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function dw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,wg(I.key),I)}}function Lg(D,$,U){if($)dw(D.prototype,$);if(U)dw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function wg(D){var $=Zg(D,"string");return A6($)=="symbol"?$:$+""}function Zg(D,$){if(A6(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(A6(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function cw(D,$,U,I,F,J,X){try{var Q=D[J](X),Y=Q.value}catch(W){U(W);return}if(Q.done)$(Y);else Promise.resolve(Y).then(I,F)}function Mg(D){return function(){var $=this,U=arguments;return new Promise(function(I,F){var J=D.apply($,U);function X(Y){cw(J,I,F,X,Q,"next",Y)}function Q(Y){cw(J,I,F,X,Q,"throw",Y)}X(void 0)})}}function Og(D){return vI.apply(this,arguments)}function vI(){return vI=Mg(EI().mark(function D($){var U,I,F,J,X,Q,Y;return EI().wrap(function(B){while(!0)switch(B.prev=B.next){case 0:return I=$.path.toString(),B.next=3,pw.promises.stat(I);case 3:return F=B.sent,J=F.size,X=(U=$.start)!==null&&U!==void 0?U:0,Q=Number.isFinite($.end)?$.end+1:J,Y=Q-X,B.abrupt("return",new Eg($,I,Y));case 9:case"end":return B.stop()}},D)})),vI.apply(this,arguments)}var Eg=function(){function D($,U,I){zg(this,D),this._stream=$,this._path=U,this.size=I}return Lg(D,[{key:"slice",value:function(U,I){var F,J=(F=this._stream.start)!==null&&F!==void 0?F:0,X=(0,pw.createReadStream)(this._path,{start:J+U,end:J+I-1,autoClose:!0});X.size=Math.min(I-U,this.size);var Q=X.size>=this.size;return Promise.resolve({value:X,done:Q})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var jI=C((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});ew.default=void 0;function R6(D){return R6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},R6(D)}function a2(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a2=function(){return $};var D,$={},U=Object.prototype,I=U.hasOwnProperty,F=Object.defineProperty||function(E,w,O){E[w]=O.value},J=typeof Symbol=="function"?Symbol:{},X=J.iterator||"@@iterator",Q=J.asyncIterator||"@@asyncIterator",Y=J.toStringTag||"@@toStringTag";function W(E,w,O){return Object.defineProperty(E,w,{value:O,enumerable:!0,configurable:!0,writable:!0}),E[w]}try{W({},"")}catch(E){W=function(O,S,k){return O[S]=k}}function B(E,w,O,S){var k=w&&w.prototype instanceof M?w:M,u=Object.create(k.prototype),t=new a(S||[]);return F(u,"_invoke",{value:n(E,O,t)}),u}function K(E,w,O){try{return{type:"normal",arg:E.call(w,O)}}catch(S){return{type:"throw",arg:S}}}$.wrap=B;var q="suspendedStart",H="suspendedYield",G="executing",z="completed",N={};function M(){}function Z(){}function L(){}var v={};W(v,X,function(){return this});var A=Object.getPrototypeOf,V=A&&A(A(DD([])));V&&V!==U&&I.call(V,X)&&(v=V);var b=L.prototype=M.prototype=Object.create(v);function y(E){["next","throw","return"].forEach(function(w){W(E,w,function(O){return this._invoke(w,O)})})}function _(E,w){function O(k,u,t,P){var h=K(E[k],E,u);if(h.type!=="throw"){var BD=h.arg,qD=BD.value;return qD&&R6(qD)=="object"&&I.call(qD,"__await")?w.resolve(qD.__await).then(function(LD){O("next",LD,t,P)},function(LD){O("throw",LD,t,P)}):w.resolve(qD).then(function(LD){BD.value=LD,t(BD)},function(LD){return O("throw",LD,t,P)})}P(h.arg)}var S;F(this,"_invoke",{value:function(u,t){function P(){return new w(function(h,BD){O(u,t,h,BD)})}return S=S?S.then(P,P):P()}})}function n(E,w,O){var S=q;return function(k,u){if(S===G)throw Error("Generator is already running");if(S===z){if(k==="throw")throw u;return{value:D,done:!0}}for(O.method=k,O.arg=u;;){var t=O.delegate;if(t){var P=m(t,O);if(P){if(P===N)continue;return P}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(S===q)throw S=z,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);S=G;var h=K(E,w,O);if(h.type==="normal"){if(S=O.done?z:H,h.arg===N)continue;return{value:h.arg,done:O.done}}h.type==="throw"&&(S=z,O.method="throw",O.arg=h.arg)}}}function m(E,w){var O=w.method,S=E.iterator[O];if(S===D)return w.delegate=null,O==="throw"&&E.iterator.return&&(w.method="return",w.arg=D,m(E,w),w.method==="throw")||O!=="return"&&(w.method="throw",w.arg=TypeError("The iterator does not provide a '"+O+"' method")),N;var k=K(S,E.iterator,w.arg);if(k.type==="throw")return w.method="throw",w.arg=k.arg,w.delegate=null,N;var u=k.arg;return u?u.done?(w[E.resultName]=u.value,w.next=E.nextLoc,w.method!=="return"&&(w.method="next",w.arg=D),w.delegate=null,N):u:(w.method="throw",w.arg=TypeError("iterator result is not an object"),w.delegate=null,N)}function UD(E){var w={tryLoc:E[0]};1 in E&&(w.catchLoc=E[1]),2 in E&&(w.finallyLoc=E[2],w.afterLoc=E[3]),this.tryEntries.push(w)}function s(E){var w=E.completion||{};w.type="normal",delete w.arg,E.completion=w}function a(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(UD,this),this.reset(!0)}function DD(E){if(E||E===""){var w=E[X];if(w)return w.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var O=-1,S=function k(){for(;++O<E.length;)if(I.call(E,O))return k.value=E[O],k.done=!1,k;return k.value=D,k.done=!0,k};return S.next=S}}throw TypeError(R6(E)+" is not iterable")}return Z.prototype=L,F(b,"constructor",{value:L,configurable:!0}),F(L,"constructor",{value:Z,configurable:!0}),Z.displayName=W(L,Y,"GeneratorFunction"),$.isGeneratorFunction=function(E){var w=typeof E=="function"&&E.constructor;return!!w&&(w===Z||(w.displayName||w.name)==="GeneratorFunction")},$.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,L):(E.__proto__=L,W(E,Y,"GeneratorFunction")),E.prototype=Object.create(b),E},$.awrap=function(E){return{__await:E}},y(_.prototype),W(_.prototype,Q,function(){return this}),$.AsyncIterator=_,$.async=function(E,w,O,S,k){k===void 0&&(k=Promise);var u=new _(B(E,w,O,S),k);return $.isGeneratorFunction(w)?u:u.next().then(function(t){return t.done?t.value:u.next()})},y(b),W(b,Y,"Generator"),W(b,X,function(){return this}),W(b,"toString",function(){return"[object Generator]"}),$.keys=function(E){var w=Object(E),O=[];for(var S in w)O.push(S);return O.reverse(),function k(){for(;O.length;){var u=O.pop();if(u in w)return k.value=u,k.done=!1,k}return k.done=!0,k}},$.values=DD,a.prototype={constructor:a,reset:function(w){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(s),!w)for(var O in this)O.charAt(0)==="t"&&I.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=D)},stop:function(){this.done=!0;var w=this.tryEntries[0].completion;if(w.type==="throw")throw w.arg;return this.rval},dispatchException:function(w){if(this.done)throw w;var O=this;function S(BD,qD){return t.type="throw",t.arg=w,O.next=BD,qD&&(O.method="next",O.arg=D),!!qD}for(var k=this.tryEntries.length-1;k>=0;--k){var u=this.tryEntries[k],t=u.completion;if(u.tryLoc==="root")return S("end");if(u.tryLoc<=this.prev){var P=I.call(u,"catchLoc"),h=I.call(u,"finallyLoc");if(P&&h){if(this.prev<u.catchLoc)return S(u.catchLoc,!0);if(this.prev<u.finallyLoc)return S(u.finallyLoc)}else if(P){if(this.prev<u.catchLoc)return S(u.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return S(u.finallyLoc)}}}},abrupt:function(w,O){for(var S=this.tryEntries.length-1;S>=0;--S){var k=this.tryEntries[S];if(k.tryLoc<=this.prev&&I.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var u=k;break}}u&&(w==="break"||w==="continue")&&u.tryLoc<=O&&O<=u.finallyLoc&&(u=null);var t=u?u.completion:{};return t.type=w,t.arg=O,u?(this.method="next",this.next=u.finallyLoc,N):this.complete(t)},complete:function(w,O){if(w.type==="throw")throw w.arg;return w.type==="break"||w.type==="continue"?this.next=w.arg:w.type==="return"?(this.rval=this.arg=w.arg,this.method="return",this.next="end"):w.type==="normal"&&O&&(this.next=O),N},finish:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.finallyLoc===w)return this.complete(S.completion,S.afterLoc),s(S),N}},catch:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.tryLoc===w){var k=S.completion;if(k.type==="throw"){var u=k.arg;s(S)}return u}}throw Error("illegal catch attempt")},delegateYield:function(w,O,S){return this.delegate={iterator:DD(w),resultName:O,nextLoc:S},this.method==="next"&&(this.arg=D),N}},$}function Vg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function tw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,Ag(I.key),I)}}function jg(D,$,U){if($)tw(D.prototype,$);if(U)tw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Ag(D){var $=Rg(D,"string");return R6($)=="symbol"?$:$+""}function Rg(D,$){if(R6(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(R6(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function aw(D,$,U,I,F,J,X){try{var Q=D[J](X),Y=Q.value}catch(W){U(W);return}if(Q.done)$(Y);else Promise.resolve(Y).then(I,F)}function sw(D){return function(){var $=this,U=arguments;return new Promise(function(I,F){var J=D.apply($,U);function X(Y){aw(J,I,F,X,Q,"next",Y)}function Q(Y){aw(J,I,F,X,Q,"throw",Y)}X(void 0)})}}function Sg(D,$){return VI.apply(this,arguments)}function VI(){return VI=sw(a2().mark(function D($,U){return a2().wrap(function(F){while(!0)switch(F.prev=F.next){case 0:return F.abrupt("return",new Promise(function(J,X){var Q=function(B){$.off("readable",Y),X(B)},Y=function W(){var B=$.read(U);if(B!==null)$.off("error",Q),$.off("readable",W),J(B)};$.once("error",Q),$.on("readable",Y)}));case 1:case"end":return F.stop()}},D)})),VI.apply(this,arguments)}var i9D=ew.default=function(){function D($){var U=this;Vg(this,D),this._stream=$,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,$.pause(),$.on("end",function(){U._ended=!0}),$.on("error",function(I){U._error=I})}return jg(D,[{key:"slice",value:function(){var $=sw(a2().mark(function I(F,J){var X,Q,Y,W,B;return a2().wrap(function(q){while(!0)switch(q.prev=q.next){case 0:if(!(F<this._bufPos)){q.next=2;break}throw Error("cannot slice from position which we already seeked away");case 2:if(!(F>this._bufPos+this._buf.length)){q.next=4;break}throw Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){q.next=6;break}throw this._error;case 6:if(F<this._bufPos+this._buf.length)Q=F-this._bufPos,Y=Math.min(this._buf.length,J-this._bufPos),X=this._buf.slice(Q,Y);else X=Buffer.alloc(0);if(!this._ended){q.next=10;break}return X.size=X.length,q.abrupt("return",{value:X,done:!0});case 10:if(W=J-F,!(W>X.length)){q.next=16;break}return q.next=14,Sg(this._stream,W-X.length);case 14:B=q.sent,X=Buffer.concat([X,B]);case 16:return this._buf=X,this._bufPos=F,X.size=X.length,q.abrupt("return",{value:X,done:this._ended});case 20:case"end":return q.stop()}},I,this)}));function U(I,F){return $.apply(this,arguments)}return U}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var IZ=C((UZ)=>{Object.defineProperty(UZ,"__esModule",{value:!0});UZ.default=void 0;var Tg=o("fs"),bg=T9(mw()),Pg=T9(lw()),Cg=T9(ow()),ug=T9(jI());function T9(D){return D&&D.__esModule?D:{default:D}}function s2(D){return s2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},s2(D)}function kg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function $Z(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,xg(I.key),I)}}function _g(D,$,U){if($)$Z(D.prototype,$);if(U)$Z(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function xg(D){var $=gg(D,"string");return s2($)=="symbol"?$:$+""}function gg(D,$){if(s2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(s2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var d9D=UZ.default=function(){function D(){kg(this,D)}return _g(D,[{key:"openFile",value:function(U,I){if(Buffer.isBuffer(U))return Promise.resolve(new Pg.default(U));if(U instanceof Tg.ReadStream&&U.path!=null)return(0,Cg.default)(U);if(bg.default.readable(U)){if(I=Number(I),!Number.isFinite(I))return Promise.reject(Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"));return Promise.resolve(new ug.default(U))}return Promise.reject(Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var WZ=C((YZ)=>{Object.defineProperty(YZ,"__esModule",{value:!0});YZ.default=mg;var fg=o("crypto"),JZ=QZ(o("fs")),yg=QZ(o("path"));function XZ(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(XZ=function(I){return I?U:$})(D)}function QZ(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=XZ($);if(U&&U.has(D))return U.get(D);var I={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in D)if(J!=="default"&&{}.hasOwnProperty.call(D,J)){var X=F?Object.getOwnPropertyDescriptor(D,J):null;X&&(X.get||X.set)?Object.defineProperty(I,J,X):I[J]=D[J]}return I.default=D,U&&U.set(D,I),I}function mg(D,$){if(Buffer.isBuffer(D)){var U=65536,I=D.slice(0,Math.min(U,D.length)),F=(0,fg.createHash)("md5").update(I).digest("hex"),J=["node-buffer",F,D.length,$.endpoint].join("-");return Promise.resolve(J)}if(D instanceof JZ.ReadStream&&D.path!=null)return new Promise(function(X,Q){var Y=yg.resolve(D.path);JZ.stat(D.path,function(W,B){if(W){Q(W);return}var K=["node-file",Y,B.size,B.mtime.getTime(),$.endpoint].join("-");X(K)})});return Promise.resolve(null)}});var HZ=C((r9D,qZ)=>{var GZ="Expected a function",BZ=NaN,ng="[object Symbol]",ig=/^\s+|\s+$/g,lg=/^[-+]0x[0-9a-f]+$/i,dg=/^0b[01]+$/i,cg=/^0o[0-7]+$/i,pg=parseInt,rg=typeof global=="object"&&global&&global.Object===Object&&global,og=typeof self=="object"&&self&&self.Object===Object&&self,tg=rg||og||Function("return this")(),ag=Object.prototype,sg=ag.toString,eg=Math.max,Df=Math.min,AI=function(){return tg.Date.now()};function $f(D,$,U){var I,F,J,X,Q,Y,W=0,B=!1,K=!1,q=!0;if(typeof D!="function")throw TypeError(GZ);if($=KZ($)||0,b9(U))B=!!U.leading,K="maxWait"in U,J=K?eg(KZ(U.maxWait)||0,$):J,q="trailing"in U?!!U.trailing:q;function H(V){var b=I,y=F;return I=F=void 0,W=V,X=D.apply(y,b),X}function G(V){return W=V,Q=setTimeout(M,$),B?H(V):X}function z(V){var b=V-Y,y=V-W,_=$-b;return K?Df(_,J-y):_}function N(V){var b=V-Y,y=V-W;return Y===void 0||b>=$||b<0||K&&y>=J}function M(){var V=AI();if(N(V))return Z(V);Q=setTimeout(M,z(V))}function Z(V){if(Q=void 0,q&&I)return H(V);return I=F=void 0,X}function L(){if(Q!==void 0)clearTimeout(Q);W=0,I=Y=F=Q=void 0}function v(){return Q===void 0?X:Z(AI())}function A(){var V=AI(),b=N(V);if(I=arguments,F=this,Y=V,b){if(Q===void 0)return G(Y);if(K)return Q=setTimeout(M,$),H(Y)}if(Q===void 0)Q=setTimeout(M,$);return X}return A.cancel=L,A.flush=v,A}function Uf(D,$,U){var I=!0,F=!0;if(typeof D!="function")throw TypeError(GZ);if(b9(U))I="leading"in U?!!U.leading:I,F="trailing"in U?!!U.trailing:F;return $f(D,$,{leading:I,maxWait:$,trailing:F})}function b9(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Ff(D){return!!D&&typeof D=="object"}function If(D){return typeof D=="symbol"||Ff(D)&&sg.call(D)==ng}function KZ(D){if(typeof D=="number")return D;if(If(D))return BZ;if(b9(D)){var $=typeof D.valueOf=="function"?D.valueOf():D;D=b9($)?$+"":$}if(typeof D!="string")return D===0?D:+D;D=D.replace(ig,"");var U=dg.test(D);return U||cg.test(D)?pg(D.slice(2),U?2:8):lg.test(D)?BZ:+D}qZ.exports=Uf});var jZ=C((vZ)=>{Object.defineProperty(vZ,"__esModule",{value:!0});vZ.default=void 0;var Jf=MZ(o("http")),Xf=MZ(o("https")),LZ=o("stream"),Qf=o("url"),wZ=Yf(HZ());function Yf(D){return D&&D.__esModule?D:{default:D}}function ZZ(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(ZZ=function(I){return I?U:$})(D)}function MZ(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=ZZ($);if(U&&U.has(D))return U.get(D);var I={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in D)if(J!=="default"&&{}.hasOwnProperty.call(D,J)){var X=F?Object.getOwnPropertyDescriptor(D,J):null;X&&(X.get||X.set)?Object.defineProperty(I,J,X):I[J]=D[J]}return I.default=D,U&&U.set(D,I),I}function Wf(D,$,U){return $=P9($),Bf(D,OZ()?Reflect.construct($,U||[],P9(D).constructor):$.apply(D,U))}function Bf(D,$){if($&&(d1($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Kf(D)}function Kf(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function OZ(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(OZ=function(){return!!D})()}function P9(D){return P9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},P9(D)}function Gf(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)RI(D,$)}function RI(D,$){return RI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,F){return I.__proto__=F,I},RI(D,$)}function NZ(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function e2(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?NZ(Object(U),!0).forEach(function(I){qf(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):NZ(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function qf(D,$,U){if($=EZ($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function d1(D){return d1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},d1(D)}function C9(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function zZ(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,EZ(I.key),I)}}function u9(D,$,U){if($)zZ(D.prototype,$);if(U)zZ(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function EZ(D){var $=Hf(D,"string");return d1($)=="symbol"?$:$+""}function Hf(D,$){if(d1(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(d1(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var o9D=vZ.default=function(){function D(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C9(this,D),this._requestOptions=$}return u9(D,[{key:"createRequest",value:function(U,I){return new Nf(U,I,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),Nf=function(){function D($,U,I){C9(this,D),this._method=$,this._url=U,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=I||{}}return u9(D,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(U,I){this._headers[U]=I}},{key:"getHeader",value:function(U){return this._headers[U]}},{key:"setProgressHandler",value:function(U){this._progressHandler=U}},{key:"send",value:function(){var U=this,I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(F,J){var X=e2(e2(e2({},(0,Qf.parse)(U._url)),U._requestOptions),{},{method:U._method,headers:e2(e2({},U._requestOptions.headers||{}),U._headers)});if(I!==null&&I!==void 0&&I.size)X.headers["Content-Length"]=I.size;var Q=X.protocol==="https:"?Xf:Jf;U._request=Q.request(X);var Y=U._request;if(Y.on("response",function(W){var B=[];W.on("data",function(K){B.push(K)}),W.on("end",function(){var K=Buffer.concat(B).toString("utf8");F(new zf(W,K))})}),Y.on("error",function(W){J(W)}),I instanceof LZ.Readable)I.pipe(new Lf(U._progressHandler)).pipe(Y);else if(I instanceof Uint8Array)wf(Y,I,U._progressHandler);else Y.end(I)})}},{key:"abort",value:function(){if(this._request!==null)this._request.abort();return Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),zf=function(){function D($,U){C9(this,D),this._response=$,this._body=U}return u9(D,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(U){return this._response.headers[U.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),Lf=function(D){function $(U){var I;return C9(this,$),I=Wf(this,$),I._onprogress=(0,wZ.default)(U,100,{leading:!0,trailing:!1}),I._position=0,I}return Gf($,D),u9($,[{key:"_transform",value:function(I,F,J){this._position+=I.length,this._onprogress(this._position),J(null,I)}}])}(LZ.Transform),wf=function($,U,I){I=(0,wZ.default)(I,100,{leading:!0,trailing:!1});var F=0;function J(){var X=Math.min($.writableHighWaterMark,U.length-F),Q=U.subarray(F,F+X);F+=Q.length;var Y=$.write(Q);if(!Y)$.once("drain",J),I(F);else if(F<U.length)J();else $.end()}J()}});var AZ=C((Zf)=>{Zf.expectReceive=function(D,$,U){var I;if(U.root(D,$,U),I=this.message,D.hasOwnProperty("expected"))I+=" Expected "+D.expected+".";if(D.hasOwnProperty("received"))I+=" Received: "+D.received+".";this.message=I};Zf.root=function(D,$,U){var I=this,F,J={stackLength:Error.stackTraceLimit,rootOnly:!0},X="",Q=Error.stackTraceLimit,Y;function W(){Y[0]=I.toString(),I.stack=Y.join(`
|
|
81
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var J=!0,X=!1,Q;return{s:function(){U=U.call(D)},n:function(){var W=U.next();return J=W.done,W},e:function(W){X=!0,Q=W},f:function(){try{if(!J&&U.return!=null)U.return()}finally{if(X)throw Q}}}}function Cw(D,$){if(!D)return;if(typeof D==="string")return vw(D,$);var U=Object.prototype.toString.call(D).slice(8,-1);if(U==="Object"&&D.constructor)U=D.constructor.name;if(U==="Map"||U==="Set")return Array.from(D);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return vw(D,$)}function vw(D,$){if($==null||$>D.length)$=D.length;for(var U=0,I=Array($);U<$;U++)I[U]=D[U];return I}function Vw(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function i1(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?Vw(Object(U),!0).forEach(function(I){Jg(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):Vw(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function Jg(D,$,U){if($=uw($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function Xg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function jw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,uw(I.key),I)}}function Qg(D,$,U){if($)jw(D.prototype,$);if(U)jw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function uw(D){var $=Yg(D,"string");return j6($)=="symbol"?$:$+""}function Yg(D,$){if(j6(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(j6(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var R9="tus-v1",S9="ietf-draft-03",o2="ietf-draft-05",Wg={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:_w,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1000,3000,5000],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:R9},kw=function(){function D($,U){if(Xg(this,D),"resume"in U)console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead.");this.options=U,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=$,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return Qg(D,[{key:"findPreviousUploads",value:function(){var U=this;return this.options.fingerprint(this.file,this.options).then(function(I){return U._urlStorage.findUploadsByFingerprint(I)})}},{key:"resumeFromPreviousUpload",value:function(U){this.url=U.uploadUrl||null,this._parallelUploadUrls=U.parallelUploadUrls||null,this._urlStorageKey=U.urlStorageKey}},{key:"start",value:function(){var U=this,I=this.file;if(!I){this._emitError(Error("tus: no file or stream to upload provided"));return}if(![R9,S9,o2].includes(this.options.protocol)){this._emitError(Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(Error("tus: neither an endpoint or an upload URL is provided"));return}var F=this.options.retryDelays;if(F!=null&&Object.prototype.toString.call(F)!=="[object Array]"){this._emitError(Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var J=0,X=["uploadUrl","uploadSize","uploadLengthDeferred"];J<X.length;J++){var Q=X[J];if(this.options[Q]){this._emitError(Error("tus: cannot use the ".concat(Q," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(I,this.options).then(function(Y){if(Y==null)(0,V6.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage.");else(0,V6.log)("Calculated fingerprint: ".concat(Y));if(U._fingerprint=Y,U._source)return U._source;return U.options.fileReader.openFile(I,U.options.chunkSize)}).then(function(Y){if(U._source=Y,U.options.uploadLengthDeferred)U._size=null;else if(U.options.uploadSize!=null){if(U._size=Number(U.options.uploadSize),Number.isNaN(U._size)){U._emitError(Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(U._size=U._source.size,U._size==null){U._emitError(Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}if(U.options.parallelUploads>1||U._parallelUploadUrls!=null)U._startParallelUpload();else U._startSingleUpload()}).catch(function(Y){U._emitError(Y)})}},{key:"_startParallelUpload",value:function(){var U,I=this,F=this._size,J=0;this._parallelUploads=[];var X=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,Q=(U=this.options.parallelUploadBoundaries)!==null&&U!==void 0?U:Kg(this._source.size,X);if(this._parallelUploadUrls)Q.forEach(function(B,K){B.uploadUrl=I._parallelUploadUrls[K]||null});this._parallelUploadUrls=Array(Q.length);var Y=Q.map(function(B,K){var q=0;return I._source.slice(B.start,B.end).then(function(H){var G=H.value;return new Promise(function(z,N){var M=i1(i1({},I.options),{},{uploadUrl:B.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:I.options.metadataForPartialUploads,headers:i1(i1({},I.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:z,onError:N,onProgress:function(v){J=J-q+v,q=v,I._emitProgress(J,F)},onUploadUrlAvailable:function(){if(I._parallelUploadUrls[K]=Z.url,I._parallelUploadUrls.filter(function(v){return Boolean(v)}).length===Q.length)I._saveUploadInUrlStorage()}}),Z=new D(G,M);Z.start(),I._parallelUploads.push(Z)})})}),W;Promise.all(Y).then(function(){W=I._openRequest("POST",I.options.endpoint),W.setHeader("Upload-Concat","final;".concat(I._parallelUploadUrls.join(" ")));var B=Aw(I.options.metadata);if(B!=="")W.setHeader("Upload-Metadata",B);return I._sendRequest(W,null)}).then(function(B){if(!l1(B.getStatus(),200)){I._emitHttpError(W,B,"tus: unexpected response while creating upload");return}var K=B.getHeader("Location");if(K==null){I._emitHttpError(W,B,"tus: invalid or missing Location header");return}I.url=bw(I.options.endpoint,K),(0,V6.log)("Created upload at ".concat(I.url)),I._emitSuccess(B)}).catch(function(B){I._emitError(B)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,V6.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,V6.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,V6.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(U){var I=this;if(this._parallelUploads!=null){var F=Ig(this._parallelUploads),J;try{for(F.s();!(J=F.n()).done;){var X=J.value;X.abort(U)}}catch(Q){F.e(Q)}finally{F.f()}}if(this._req!==null)this._req.abort();if(this._aborted=!0,this._retryTimeout!=null)clearTimeout(this._retryTimeout),this._retryTimeout=null;if(!U||this.url==null)return Promise.resolve();return D.terminate(this.url,this.options).then(function(){return I._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(U,I,F,J){this._emitError(new A9.default(F,J,U,I))}},{key:"_emitError",value:function(U){var I=this;if(this._aborted)return;if(this.options.retryDelays!=null){var F=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(F)this._retryAttempt=0;if(Tw(U,this._retryAttempt,this.options)){var J=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){I.start()},J);return}}if(typeof this.options.onError==="function")this.options.onError(U);else throw U}},{key:"_emitSuccess",value:function(U){if(this.options.removeFingerprintOnSuccess)this._removeFromUrlStorage();if(typeof this.options.onSuccess==="function")this.options.onSuccess({lastResponse:U})}},{key:"_emitProgress",value:function(U,I){if(typeof this.options.onProgress==="function")this.options.onProgress(U,I)}},{key:"_emitChunkComplete",value:function(U,I,F){if(typeof this.options.onChunkComplete==="function")this.options.onChunkComplete(U,I,F)}},{key:"_createUpload",value:function(){var U=this;if(!this.options.endpoint){this._emitError(Error("tus: unable to create upload because no endpoint is provided"));return}var I=this._openRequest("POST",this.options.endpoint);if(this.options.uploadLengthDeferred)I.setHeader("Upload-Defer-Length","1");else I.setHeader("Upload-Length","".concat(this._size));var F=Aw(this.options.metadata);if(F!=="")I.setHeader("Upload-Metadata",F);var J;if(this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred)this._offset=0,J=this._addChunkToRequest(I);else{if(this.options.protocol===S9||this.options.protocol===o2)I.setHeader("Upload-Complete","?0");J=this._sendRequest(I,null)}J.then(function(X){if(!l1(X.getStatus(),200)){U._emitHttpError(I,X,"tus: unexpected response while creating upload");return}var Q=X.getHeader("Location");if(Q==null){U._emitHttpError(I,X,"tus: invalid or missing Location header");return}if(U.url=bw(U.options.endpoint,Q),(0,V6.log)("Created upload at ".concat(U.url)),typeof U.options.onUploadUrlAvailable==="function")U.options.onUploadUrlAvailable();if(U._size===0){U._emitSuccess(X),U._source.close();return}U._saveUploadInUrlStorage().then(function(){if(U.options.uploadDataDuringCreation)U._handleUploadResponse(I,X);else U._offset=0,U._performUpload()})}).catch(function(X){U._emitHttpError(I,null,"tus: failed to create upload",X)})}},{key:"_resumeUpload",value:function(){var U=this,I=this._openRequest("HEAD",this.url),F=this._sendRequest(I,null);F.then(function(J){var X=J.getStatus();if(!l1(X,200)){if(X===423){U._emitHttpError(I,J,"tus: upload is currently locked; retry later");return}if(l1(X,400))U._removeFromUrlStorage();if(!U.options.endpoint){U._emitHttpError(I,J,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}U.url=null,U._createUpload();return}var Q=Number.parseInt(J.getHeader("Upload-Offset"),10);if(Number.isNaN(Q)){U._emitHttpError(I,J,"tus: invalid or missing offset value");return}var Y=Number.parseInt(J.getHeader("Upload-Length"),10);if(Number.isNaN(Y)&&!U.options.uploadLengthDeferred&&U.options.protocol===R9){U._emitHttpError(I,J,"tus: invalid or missing length value");return}if(typeof U.options.onUploadUrlAvailable==="function")U.options.onUploadUrlAvailable();U._saveUploadInUrlStorage().then(function(){if(Q===Y){U._emitProgress(Y,Y),U._emitSuccess(J);return}U._offset=Q,U._performUpload()})}).catch(function(J){U._emitHttpError(I,null,"tus: failed to resume upload",J)})}},{key:"_performUpload",value:function(){var U=this;if(this._aborted)return;var I;if(this.options.overridePatchMethod)I=this._openRequest("POST",this.url),I.setHeader("X-HTTP-Method-Override","PATCH");else I=this._openRequest("PATCH",this.url);I.setHeader("Upload-Offset","".concat(this._offset));var F=this._addChunkToRequest(I);F.then(function(J){if(!l1(J.getStatus(),200)){U._emitHttpError(I,J,"tus: unexpected response while uploading chunk");return}U._handleUploadResponse(I,J)}).catch(function(J){if(U._aborted)return;U._emitHttpError(I,null,"tus: failed to upload chunk at offset ".concat(U._offset),J)})}},{key:"_addChunkToRequest",value:function(U){var I=this,F=this._offset,J=this._offset+this.options.chunkSize;if(U.setProgressHandler(function(X){I._emitProgress(F+X,I._size)}),this.options.protocol===R9)U.setHeader("Content-Type","application/offset+octet-stream");else if(this.options.protocol===o2)U.setHeader("Content-Type","application/partial-upload");if((J===Number.POSITIVE_INFINITY||J>this._size)&&!this.options.uploadLengthDeferred)J=this._size;return this._source.slice(F,J).then(function(X){var{value:Q,done:Y}=X,W=Q!==null&&Q!==void 0&&Q.size?Q.size:0;if(I.options.uploadLengthDeferred&&Y)I._size=I._offset+W,U.setHeader("Upload-Length","".concat(I._size));var B=I._offset+W;if(!I.options.uploadLengthDeferred&&Y&&B!==I._size)return Promise.reject(Error("upload was configured with a size of ".concat(I._size," bytes, but the source is done after ").concat(B," bytes")));if(Q===null)return I._sendRequest(U);if(I.options.protocol===S9||I.options.protocol===o2)U.setHeader("Upload-Complete",Y?"?1":"?0");return I._emitProgress(I._offset,I._size),I._sendRequest(U,Q)})}},{key:"_handleUploadResponse",value:function(U,I){var F=Number.parseInt(I.getHeader("Upload-Offset"),10);if(Number.isNaN(F)){this._emitHttpError(U,I,"tus: invalid or missing offset value");return}if(this._emitProgress(F,this._size),this._emitChunkComplete(F-this._offset,F,this._size),this._offset=F,F===this._size){this._emitSuccess(I),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(U,I){var F=Rw(U,I,this.options);return this._req=F,F}},{key:"_removeFromUrlStorage",value:function(){var U=this;if(!this._urlStorageKey)return;this._urlStorage.removeUpload(this._urlStorageKey).catch(function(I){U._emitError(I)}),this._urlStorageKey=null}},{key:"_saveUploadInUrlStorage",value:function(){var U=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var I={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};if(this._parallelUploads)I.parallelUploadUrls=this._parallelUploadUrls;else I.uploadUrl=this.url;return this._urlStorage.addUpload(this._fingerprint,I).then(function(F){U._urlStorageKey=F})}},{key:"_sendRequest",value:function(U){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Sw(U,I,this.options)}}],[{key:"terminate",value:function(U){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=Rw("DELETE",U,I);return Sw(F,null,I).then(function(J){if(J.getStatus()===204)return;throw new A9.default("tus: unexpected response while terminating upload",null,F,J)}).catch(function(J){if(!(J instanceof A9.default))J=new A9.default("tus: failed to terminate upload",J,F,null);if(!Tw(J,0,I))throw J;var X=I.retryDelays[0],Q=I.retryDelays.slice(1),Y=i1(i1({},I),{},{retryDelays:Q});return new Promise(function(W){return setTimeout(W,X)}).then(function(){return D.terminate(U,Y)})})}}])}();function Aw(D){return Object.entries(D).map(function($){var U=Pw($,2),I=U[0],F=U[1];return"".concat(I," ").concat(ax.Base64.encode(String(F)))}).join(",")}function l1(D,$){return D>=$&&D<$+100}function Rw(D,$,U){var I=U.httpStack.createRequest(D,$);if(U.protocol===S9)I.setHeader("Upload-Draft-Interop-Version","5");else if(U.protocol===o2)I.setHeader("Upload-Draft-Interop-Version","6");else I.setHeader("Tus-Resumable","1.0.0");var F=U.headers||{};for(var J=0,X=Object.entries(F);J<X.length;J++){var Q=Pw(X[J],2),Y=Q[0],W=Q[1];I.setHeader(Y,W)}if(U.addRequestId){var B=(0,ex.default)();I.setHeader("X-Request-ID",B)}return I}function Sw(D,$,U){return MI.apply(this,arguments)}function MI(){return MI=Dg(ZI().mark(function D($,U,I){var F;return ZI().wrap(function(X){while(!0)switch(X.prev=X.next){case 0:if(typeof I.onBeforeRequest!=="function"){X.next=3;break}return X.next=3,I.onBeforeRequest($);case 3:return X.next=5,$.send(U);case 5:if(F=X.sent,typeof I.onAfterResponse!=="function"){X.next=9;break}return X.next=9,I.onAfterResponse($,F);case 9:return X.abrupt("return",F);case 10:case"end":return X.stop()}},D)})),MI.apply(this,arguments)}function Bg(){var D=!0;if(typeof navigator<"u"&&navigator.onLine===!1)D=!1;return D}function Tw(D,$,U){if(U.retryDelays==null||$>=U.retryDelays.length||D.originalRequest==null)return!1;if(U&&typeof U.onShouldRetry==="function")return U.onShouldRetry(D,$,U);return _w(D)}function _w(D){var $=D.originalResponse?D.originalResponse.getStatus():0;return(!l1($,400)||$===409||$===423)&&Bg()}function bw(D,$){return new sx.default($,D).toString()}function Kg(D,$){var U=Math.floor(D/$),I=[];for(var F=0;F<$;F++)I.push({start:U*F,end:U*(F+1)});return I[$-1].end=D,I}kw.defaultOptions=Wg;var f9D=xw.default=kw});var mw=C((m9D,yw)=>{var K0=(D)=>D!==null&&typeof D==="object"&&typeof D.pipe==="function";K0.writable=(D)=>K0(D)&&D.writable!==!1&&typeof D._write==="function"&&typeof D._writableState==="object";K0.readable=(D)=>K0(D)&&D.readable!==!1&&typeof D._read==="function"&&typeof D._readableState==="object";K0.duplex=(D)=>K0.writable(D)&&K0.readable(D);K0.transform=(D)=>K0.duplex(D)&&typeof D._transform==="function";yw.exports=K0});var lw=C((nw)=>{Object.defineProperty(nw,"__esModule",{value:!0});nw.default=void 0;function t2(D){return t2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},t2(D)}function Gg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function hw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,Hg(I.key),I)}}function qg(D,$,U){if($)hw(D.prototype,$);if(U)hw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Hg(D){var $=Ng(D,"string");return t2($)=="symbol"?$:$+""}function Ng(D,$){if(t2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(t2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var h9D=nw.default=function(){function D($){Gg(this,D),this._buffer=$,this.size=$.length}return qg(D,[{key:"slice",value:function(U,I){var F=this._buffer.slice(U,I);F.size=F.length;var J=I>=this.size;return Promise.resolve({value:F,done:J})}},{key:"close",value:function(){}}])}()});var ow=C((rw)=>{Object.defineProperty(rw,"__esModule",{value:!0});rw.default=Og;var pw=o("fs");function A6(D){return A6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},A6(D)}function EI(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */EI=function(){return $};var D,$={},U=Object.prototype,I=U.hasOwnProperty,F=Object.defineProperty||function(E,w,O){E[w]=O.value},J=typeof Symbol=="function"?Symbol:{},X=J.iterator||"@@iterator",Q=J.asyncIterator||"@@asyncIterator",Y=J.toStringTag||"@@toStringTag";function W(E,w,O){return Object.defineProperty(E,w,{value:O,enumerable:!0,configurable:!0,writable:!0}),E[w]}try{W({},"")}catch(E){W=function(O,S,k){return O[S]=k}}function B(E,w,O,S){var k=w&&w.prototype instanceof M?w:M,u=Object.create(k.prototype),t=new a(S||[]);return F(u,"_invoke",{value:n(E,O,t)}),u}function K(E,w,O){try{return{type:"normal",arg:E.call(w,O)}}catch(S){return{type:"throw",arg:S}}}$.wrap=B;var q="suspendedStart",H="suspendedYield",G="executing",z="completed",N={};function M(){}function Z(){}function L(){}var v={};W(v,X,function(){return this});var A=Object.getPrototypeOf,V=A&&A(A(DD([])));V&&V!==U&&I.call(V,X)&&(v=V);var b=L.prototype=M.prototype=Object.create(v);function y(E){["next","throw","return"].forEach(function(w){W(E,w,function(O){return this._invoke(w,O)})})}function _(E,w){function O(k,u,t,P){var h=K(E[k],E,u);if(h.type!=="throw"){var BD=h.arg,qD=BD.value;return qD&&A6(qD)=="object"&&I.call(qD,"__await")?w.resolve(qD.__await).then(function(LD){O("next",LD,t,P)},function(LD){O("throw",LD,t,P)}):w.resolve(qD).then(function(LD){BD.value=LD,t(BD)},function(LD){return O("throw",LD,t,P)})}P(h.arg)}var S;F(this,"_invoke",{value:function(u,t){function P(){return new w(function(h,BD){O(u,t,h,BD)})}return S=S?S.then(P,P):P()}})}function n(E,w,O){var S=q;return function(k,u){if(S===G)throw Error("Generator is already running");if(S===z){if(k==="throw")throw u;return{value:D,done:!0}}for(O.method=k,O.arg=u;;){var t=O.delegate;if(t){var P=m(t,O);if(P){if(P===N)continue;return P}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(S===q)throw S=z,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);S=G;var h=K(E,w,O);if(h.type==="normal"){if(S=O.done?z:H,h.arg===N)continue;return{value:h.arg,done:O.done}}h.type==="throw"&&(S=z,O.method="throw",O.arg=h.arg)}}}function m(E,w){var O=w.method,S=E.iterator[O];if(S===D)return w.delegate=null,O==="throw"&&E.iterator.return&&(w.method="return",w.arg=D,m(E,w),w.method==="throw")||O!=="return"&&(w.method="throw",w.arg=TypeError("The iterator does not provide a '"+O+"' method")),N;var k=K(S,E.iterator,w.arg);if(k.type==="throw")return w.method="throw",w.arg=k.arg,w.delegate=null,N;var u=k.arg;return u?u.done?(w[E.resultName]=u.value,w.next=E.nextLoc,w.method!=="return"&&(w.method="next",w.arg=D),w.delegate=null,N):u:(w.method="throw",w.arg=TypeError("iterator result is not an object"),w.delegate=null,N)}function UD(E){var w={tryLoc:E[0]};1 in E&&(w.catchLoc=E[1]),2 in E&&(w.finallyLoc=E[2],w.afterLoc=E[3]),this.tryEntries.push(w)}function s(E){var w=E.completion||{};w.type="normal",delete w.arg,E.completion=w}function a(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(UD,this),this.reset(!0)}function DD(E){if(E||E===""){var w=E[X];if(w)return w.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var O=-1,S=function k(){for(;++O<E.length;)if(I.call(E,O))return k.value=E[O],k.done=!1,k;return k.value=D,k.done=!0,k};return S.next=S}}throw TypeError(A6(E)+" is not iterable")}return Z.prototype=L,F(b,"constructor",{value:L,configurable:!0}),F(L,"constructor",{value:Z,configurable:!0}),Z.displayName=W(L,Y,"GeneratorFunction"),$.isGeneratorFunction=function(E){var w=typeof E=="function"&&E.constructor;return!!w&&(w===Z||(w.displayName||w.name)==="GeneratorFunction")},$.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,L):(E.__proto__=L,W(E,Y,"GeneratorFunction")),E.prototype=Object.create(b),E},$.awrap=function(E){return{__await:E}},y(_.prototype),W(_.prototype,Q,function(){return this}),$.AsyncIterator=_,$.async=function(E,w,O,S,k){k===void 0&&(k=Promise);var u=new _(B(E,w,O,S),k);return $.isGeneratorFunction(w)?u:u.next().then(function(t){return t.done?t.value:u.next()})},y(b),W(b,Y,"Generator"),W(b,X,function(){return this}),W(b,"toString",function(){return"[object Generator]"}),$.keys=function(E){var w=Object(E),O=[];for(var S in w)O.push(S);return O.reverse(),function k(){for(;O.length;){var u=O.pop();if(u in w)return k.value=u,k.done=!1,k}return k.done=!0,k}},$.values=DD,a.prototype={constructor:a,reset:function(w){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(s),!w)for(var O in this)O.charAt(0)==="t"&&I.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=D)},stop:function(){this.done=!0;var w=this.tryEntries[0].completion;if(w.type==="throw")throw w.arg;return this.rval},dispatchException:function(w){if(this.done)throw w;var O=this;function S(BD,qD){return t.type="throw",t.arg=w,O.next=BD,qD&&(O.method="next",O.arg=D),!!qD}for(var k=this.tryEntries.length-1;k>=0;--k){var u=this.tryEntries[k],t=u.completion;if(u.tryLoc==="root")return S("end");if(u.tryLoc<=this.prev){var P=I.call(u,"catchLoc"),h=I.call(u,"finallyLoc");if(P&&h){if(this.prev<u.catchLoc)return S(u.catchLoc,!0);if(this.prev<u.finallyLoc)return S(u.finallyLoc)}else if(P){if(this.prev<u.catchLoc)return S(u.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return S(u.finallyLoc)}}}},abrupt:function(w,O){for(var S=this.tryEntries.length-1;S>=0;--S){var k=this.tryEntries[S];if(k.tryLoc<=this.prev&&I.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var u=k;break}}u&&(w==="break"||w==="continue")&&u.tryLoc<=O&&O<=u.finallyLoc&&(u=null);var t=u?u.completion:{};return t.type=w,t.arg=O,u?(this.method="next",this.next=u.finallyLoc,N):this.complete(t)},complete:function(w,O){if(w.type==="throw")throw w.arg;return w.type==="break"||w.type==="continue"?this.next=w.arg:w.type==="return"?(this.rval=this.arg=w.arg,this.method="return",this.next="end"):w.type==="normal"&&O&&(this.next=O),N},finish:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.finallyLoc===w)return this.complete(S.completion,S.afterLoc),s(S),N}},catch:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.tryLoc===w){var k=S.completion;if(k.type==="throw"){var u=k.arg;s(S)}return u}}throw Error("illegal catch attempt")},delegateYield:function(w,O,S){return this.delegate={iterator:DD(w),resultName:O,nextLoc:S},this.method==="next"&&(this.arg=D),N}},$}function zg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function dw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,wg(I.key),I)}}function Lg(D,$,U){if($)dw(D.prototype,$);if(U)dw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function wg(D){var $=Zg(D,"string");return A6($)=="symbol"?$:$+""}function Zg(D,$){if(A6(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(A6(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function cw(D,$,U,I,F,J,X){try{var Q=D[J](X),Y=Q.value}catch(W){U(W);return}if(Q.done)$(Y);else Promise.resolve(Y).then(I,F)}function Mg(D){return function(){var $=this,U=arguments;return new Promise(function(I,F){var J=D.apply($,U);function X(Y){cw(J,I,F,X,Q,"next",Y)}function Q(Y){cw(J,I,F,X,Q,"throw",Y)}X(void 0)})}}function Og(D){return vI.apply(this,arguments)}function vI(){return vI=Mg(EI().mark(function D($){var U,I,F,J,X,Q,Y;return EI().wrap(function(B){while(!0)switch(B.prev=B.next){case 0:return I=$.path.toString(),B.next=3,pw.promises.stat(I);case 3:return F=B.sent,J=F.size,X=(U=$.start)!==null&&U!==void 0?U:0,Q=Number.isFinite($.end)?$.end+1:J,Y=Q-X,B.abrupt("return",new Eg($,I,Y));case 9:case"end":return B.stop()}},D)})),vI.apply(this,arguments)}var Eg=function(){function D($,U,I){zg(this,D),this._stream=$,this._path=U,this.size=I}return Lg(D,[{key:"slice",value:function(U,I){var F,J=(F=this._stream.start)!==null&&F!==void 0?F:0,X=(0,pw.createReadStream)(this._path,{start:J+U,end:J+I-1,autoClose:!0});X.size=Math.min(I-U,this.size);var Q=X.size>=this.size;return Promise.resolve({value:X,done:Q})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var jI=C((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});ew.default=void 0;function R6(D){return R6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},R6(D)}function a2(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a2=function(){return $};var D,$={},U=Object.prototype,I=U.hasOwnProperty,F=Object.defineProperty||function(E,w,O){E[w]=O.value},J=typeof Symbol=="function"?Symbol:{},X=J.iterator||"@@iterator",Q=J.asyncIterator||"@@asyncIterator",Y=J.toStringTag||"@@toStringTag";function W(E,w,O){return Object.defineProperty(E,w,{value:O,enumerable:!0,configurable:!0,writable:!0}),E[w]}try{W({},"")}catch(E){W=function(O,S,k){return O[S]=k}}function B(E,w,O,S){var k=w&&w.prototype instanceof M?w:M,u=Object.create(k.prototype),t=new a(S||[]);return F(u,"_invoke",{value:n(E,O,t)}),u}function K(E,w,O){try{return{type:"normal",arg:E.call(w,O)}}catch(S){return{type:"throw",arg:S}}}$.wrap=B;var q="suspendedStart",H="suspendedYield",G="executing",z="completed",N={};function M(){}function Z(){}function L(){}var v={};W(v,X,function(){return this});var A=Object.getPrototypeOf,V=A&&A(A(DD([])));V&&V!==U&&I.call(V,X)&&(v=V);var b=L.prototype=M.prototype=Object.create(v);function y(E){["next","throw","return"].forEach(function(w){W(E,w,function(O){return this._invoke(w,O)})})}function _(E,w){function O(k,u,t,P){var h=K(E[k],E,u);if(h.type!=="throw"){var BD=h.arg,qD=BD.value;return qD&&R6(qD)=="object"&&I.call(qD,"__await")?w.resolve(qD.__await).then(function(LD){O("next",LD,t,P)},function(LD){O("throw",LD,t,P)}):w.resolve(qD).then(function(LD){BD.value=LD,t(BD)},function(LD){return O("throw",LD,t,P)})}P(h.arg)}var S;F(this,"_invoke",{value:function(u,t){function P(){return new w(function(h,BD){O(u,t,h,BD)})}return S=S?S.then(P,P):P()}})}function n(E,w,O){var S=q;return function(k,u){if(S===G)throw Error("Generator is already running");if(S===z){if(k==="throw")throw u;return{value:D,done:!0}}for(O.method=k,O.arg=u;;){var t=O.delegate;if(t){var P=m(t,O);if(P){if(P===N)continue;return P}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(S===q)throw S=z,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);S=G;var h=K(E,w,O);if(h.type==="normal"){if(S=O.done?z:H,h.arg===N)continue;return{value:h.arg,done:O.done}}h.type==="throw"&&(S=z,O.method="throw",O.arg=h.arg)}}}function m(E,w){var O=w.method,S=E.iterator[O];if(S===D)return w.delegate=null,O==="throw"&&E.iterator.return&&(w.method="return",w.arg=D,m(E,w),w.method==="throw")||O!=="return"&&(w.method="throw",w.arg=TypeError("The iterator does not provide a '"+O+"' method")),N;var k=K(S,E.iterator,w.arg);if(k.type==="throw")return w.method="throw",w.arg=k.arg,w.delegate=null,N;var u=k.arg;return u?u.done?(w[E.resultName]=u.value,w.next=E.nextLoc,w.method!=="return"&&(w.method="next",w.arg=D),w.delegate=null,N):u:(w.method="throw",w.arg=TypeError("iterator result is not an object"),w.delegate=null,N)}function UD(E){var w={tryLoc:E[0]};1 in E&&(w.catchLoc=E[1]),2 in E&&(w.finallyLoc=E[2],w.afterLoc=E[3]),this.tryEntries.push(w)}function s(E){var w=E.completion||{};w.type="normal",delete w.arg,E.completion=w}function a(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(UD,this),this.reset(!0)}function DD(E){if(E||E===""){var w=E[X];if(w)return w.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var O=-1,S=function k(){for(;++O<E.length;)if(I.call(E,O))return k.value=E[O],k.done=!1,k;return k.value=D,k.done=!0,k};return S.next=S}}throw TypeError(R6(E)+" is not iterable")}return Z.prototype=L,F(b,"constructor",{value:L,configurable:!0}),F(L,"constructor",{value:Z,configurable:!0}),Z.displayName=W(L,Y,"GeneratorFunction"),$.isGeneratorFunction=function(E){var w=typeof E=="function"&&E.constructor;return!!w&&(w===Z||(w.displayName||w.name)==="GeneratorFunction")},$.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,L):(E.__proto__=L,W(E,Y,"GeneratorFunction")),E.prototype=Object.create(b),E},$.awrap=function(E){return{__await:E}},y(_.prototype),W(_.prototype,Q,function(){return this}),$.AsyncIterator=_,$.async=function(E,w,O,S,k){k===void 0&&(k=Promise);var u=new _(B(E,w,O,S),k);return $.isGeneratorFunction(w)?u:u.next().then(function(t){return t.done?t.value:u.next()})},y(b),W(b,Y,"Generator"),W(b,X,function(){return this}),W(b,"toString",function(){return"[object Generator]"}),$.keys=function(E){var w=Object(E),O=[];for(var S in w)O.push(S);return O.reverse(),function k(){for(;O.length;){var u=O.pop();if(u in w)return k.value=u,k.done=!1,k}return k.done=!0,k}},$.values=DD,a.prototype={constructor:a,reset:function(w){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(s),!w)for(var O in this)O.charAt(0)==="t"&&I.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=D)},stop:function(){this.done=!0;var w=this.tryEntries[0].completion;if(w.type==="throw")throw w.arg;return this.rval},dispatchException:function(w){if(this.done)throw w;var O=this;function S(BD,qD){return t.type="throw",t.arg=w,O.next=BD,qD&&(O.method="next",O.arg=D),!!qD}for(var k=this.tryEntries.length-1;k>=0;--k){var u=this.tryEntries[k],t=u.completion;if(u.tryLoc==="root")return S("end");if(u.tryLoc<=this.prev){var P=I.call(u,"catchLoc"),h=I.call(u,"finallyLoc");if(P&&h){if(this.prev<u.catchLoc)return S(u.catchLoc,!0);if(this.prev<u.finallyLoc)return S(u.finallyLoc)}else if(P){if(this.prev<u.catchLoc)return S(u.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return S(u.finallyLoc)}}}},abrupt:function(w,O){for(var S=this.tryEntries.length-1;S>=0;--S){var k=this.tryEntries[S];if(k.tryLoc<=this.prev&&I.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var u=k;break}}u&&(w==="break"||w==="continue")&&u.tryLoc<=O&&O<=u.finallyLoc&&(u=null);var t=u?u.completion:{};return t.type=w,t.arg=O,u?(this.method="next",this.next=u.finallyLoc,N):this.complete(t)},complete:function(w,O){if(w.type==="throw")throw w.arg;return w.type==="break"||w.type==="continue"?this.next=w.arg:w.type==="return"?(this.rval=this.arg=w.arg,this.method="return",this.next="end"):w.type==="normal"&&O&&(this.next=O),N},finish:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.finallyLoc===w)return this.complete(S.completion,S.afterLoc),s(S),N}},catch:function(w){for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O];if(S.tryLoc===w){var k=S.completion;if(k.type==="throw"){var u=k.arg;s(S)}return u}}throw Error("illegal catch attempt")},delegateYield:function(w,O,S){return this.delegate={iterator:DD(w),resultName:O,nextLoc:S},this.method==="next"&&(this.arg=D),N}},$}function Vg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function tw(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,Ag(I.key),I)}}function jg(D,$,U){if($)tw(D.prototype,$);if(U)tw(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Ag(D){var $=Rg(D,"string");return R6($)=="symbol"?$:$+""}function Rg(D,$){if(R6(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(R6(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function aw(D,$,U,I,F,J,X){try{var Q=D[J](X),Y=Q.value}catch(W){U(W);return}if(Q.done)$(Y);else Promise.resolve(Y).then(I,F)}function sw(D){return function(){var $=this,U=arguments;return new Promise(function(I,F){var J=D.apply($,U);function X(Y){aw(J,I,F,X,Q,"next",Y)}function Q(Y){aw(J,I,F,X,Q,"throw",Y)}X(void 0)})}}function Sg(D,$){return VI.apply(this,arguments)}function VI(){return VI=sw(a2().mark(function D($,U){return a2().wrap(function(F){while(!0)switch(F.prev=F.next){case 0:return F.abrupt("return",new Promise(function(J,X){var Q=function(B){$.off("readable",Y),X(B)},Y=function W(){var B=$.read(U);if(B!==null)$.off("error",Q),$.off("readable",W),J(B)};$.once("error",Q),$.on("readable",Y)}));case 1:case"end":return F.stop()}},D)})),VI.apply(this,arguments)}var l9D=ew.default=function(){function D($){var U=this;Vg(this,D),this._stream=$,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,$.pause(),$.on("end",function(){U._ended=!0}),$.on("error",function(I){U._error=I})}return jg(D,[{key:"slice",value:function(){var $=sw(a2().mark(function I(F,J){var X,Q,Y,W,B;return a2().wrap(function(q){while(!0)switch(q.prev=q.next){case 0:if(!(F<this._bufPos)){q.next=2;break}throw Error("cannot slice from position which we already seeked away");case 2:if(!(F>this._bufPos+this._buf.length)){q.next=4;break}throw Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){q.next=6;break}throw this._error;case 6:if(F<this._bufPos+this._buf.length)Q=F-this._bufPos,Y=Math.min(this._buf.length,J-this._bufPos),X=this._buf.slice(Q,Y);else X=Buffer.alloc(0);if(!this._ended){q.next=10;break}return X.size=X.length,q.abrupt("return",{value:X,done:!0});case 10:if(W=J-F,!(W>X.length)){q.next=16;break}return q.next=14,Sg(this._stream,W-X.length);case 14:B=q.sent,X=Buffer.concat([X,B]);case 16:return this._buf=X,this._bufPos=F,X.size=X.length,q.abrupt("return",{value:X,done:this._ended});case 20:case"end":return q.stop()}},I,this)}));function U(I,F){return $.apply(this,arguments)}return U}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var IZ=C((UZ)=>{Object.defineProperty(UZ,"__esModule",{value:!0});UZ.default=void 0;var Tg=o("fs"),bg=T9(mw()),Pg=T9(lw()),Cg=T9(ow()),ug=T9(jI());function T9(D){return D&&D.__esModule?D:{default:D}}function s2(D){return s2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},s2(D)}function kg(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function $Z(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,xg(I.key),I)}}function _g(D,$,U){if($)$Z(D.prototype,$);if(U)$Z(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function xg(D){var $=gg(D,"string");return s2($)=="symbol"?$:$+""}function gg(D,$){if(s2(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(s2(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var c9D=UZ.default=function(){function D(){kg(this,D)}return _g(D,[{key:"openFile",value:function(U,I){if(Buffer.isBuffer(U))return Promise.resolve(new Pg.default(U));if(U instanceof Tg.ReadStream&&U.path!=null)return(0,Cg.default)(U);if(bg.default.readable(U)){if(I=Number(I),!Number.isFinite(I))return Promise.reject(Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"));return Promise.resolve(new ug.default(U))}return Promise.reject(Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var WZ=C((YZ)=>{Object.defineProperty(YZ,"__esModule",{value:!0});YZ.default=mg;var fg=o("crypto"),JZ=QZ(o("fs")),yg=QZ(o("path"));function XZ(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(XZ=function(I){return I?U:$})(D)}function QZ(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=XZ($);if(U&&U.has(D))return U.get(D);var I={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in D)if(J!=="default"&&{}.hasOwnProperty.call(D,J)){var X=F?Object.getOwnPropertyDescriptor(D,J):null;X&&(X.get||X.set)?Object.defineProperty(I,J,X):I[J]=D[J]}return I.default=D,U&&U.set(D,I),I}function mg(D,$){if(Buffer.isBuffer(D)){var U=65536,I=D.slice(0,Math.min(U,D.length)),F=(0,fg.createHash)("md5").update(I).digest("hex"),J=["node-buffer",F,D.length,$.endpoint].join("-");return Promise.resolve(J)}if(D instanceof JZ.ReadStream&&D.path!=null)return new Promise(function(X,Q){var Y=yg.resolve(D.path);JZ.stat(D.path,function(W,B){if(W){Q(W);return}var K=["node-file",Y,B.size,B.mtime.getTime(),$.endpoint].join("-");X(K)})});return Promise.resolve(null)}});var HZ=C((o9D,qZ)=>{var GZ="Expected a function",BZ=NaN,ng="[object Symbol]",ig=/^\s+|\s+$/g,lg=/^[-+]0x[0-9a-f]+$/i,dg=/^0b[01]+$/i,cg=/^0o[0-7]+$/i,pg=parseInt,rg=typeof global=="object"&&global&&global.Object===Object&&global,og=typeof self=="object"&&self&&self.Object===Object&&self,tg=rg||og||Function("return this")(),ag=Object.prototype,sg=ag.toString,eg=Math.max,Df=Math.min,AI=function(){return tg.Date.now()};function $f(D,$,U){var I,F,J,X,Q,Y,W=0,B=!1,K=!1,q=!0;if(typeof D!="function")throw TypeError(GZ);if($=KZ($)||0,b9(U))B=!!U.leading,K="maxWait"in U,J=K?eg(KZ(U.maxWait)||0,$):J,q="trailing"in U?!!U.trailing:q;function H(V){var b=I,y=F;return I=F=void 0,W=V,X=D.apply(y,b),X}function G(V){return W=V,Q=setTimeout(M,$),B?H(V):X}function z(V){var b=V-Y,y=V-W,_=$-b;return K?Df(_,J-y):_}function N(V){var b=V-Y,y=V-W;return Y===void 0||b>=$||b<0||K&&y>=J}function M(){var V=AI();if(N(V))return Z(V);Q=setTimeout(M,z(V))}function Z(V){if(Q=void 0,q&&I)return H(V);return I=F=void 0,X}function L(){if(Q!==void 0)clearTimeout(Q);W=0,I=Y=F=Q=void 0}function v(){return Q===void 0?X:Z(AI())}function A(){var V=AI(),b=N(V);if(I=arguments,F=this,Y=V,b){if(Q===void 0)return G(Y);if(K)return Q=setTimeout(M,$),H(Y)}if(Q===void 0)Q=setTimeout(M,$);return X}return A.cancel=L,A.flush=v,A}function Uf(D,$,U){var I=!0,F=!0;if(typeof D!="function")throw TypeError(GZ);if(b9(U))I="leading"in U?!!U.leading:I,F="trailing"in U?!!U.trailing:F;return $f(D,$,{leading:I,maxWait:$,trailing:F})}function b9(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Ff(D){return!!D&&typeof D=="object"}function If(D){return typeof D=="symbol"||Ff(D)&&sg.call(D)==ng}function KZ(D){if(typeof D=="number")return D;if(If(D))return BZ;if(b9(D)){var $=typeof D.valueOf=="function"?D.valueOf():D;D=b9($)?$+"":$}if(typeof D!="string")return D===0?D:+D;D=D.replace(ig,"");var U=dg.test(D);return U||cg.test(D)?pg(D.slice(2),U?2:8):lg.test(D)?BZ:+D}qZ.exports=Uf});var jZ=C((vZ)=>{Object.defineProperty(vZ,"__esModule",{value:!0});vZ.default=void 0;var Jf=MZ(o("http")),Xf=MZ(o("https")),LZ=o("stream"),Qf=o("url"),wZ=Yf(HZ());function Yf(D){return D&&D.__esModule?D:{default:D}}function ZZ(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(ZZ=function(I){return I?U:$})(D)}function MZ(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=ZZ($);if(U&&U.has(D))return U.get(D);var I={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in D)if(J!=="default"&&{}.hasOwnProperty.call(D,J)){var X=F?Object.getOwnPropertyDescriptor(D,J):null;X&&(X.get||X.set)?Object.defineProperty(I,J,X):I[J]=D[J]}return I.default=D,U&&U.set(D,I),I}function Wf(D,$,U){return $=P9($),Bf(D,OZ()?Reflect.construct($,U||[],P9(D).constructor):$.apply(D,U))}function Bf(D,$){if($&&(d1($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Kf(D)}function Kf(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function OZ(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(OZ=function(){return!!D})()}function P9(D){return P9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},P9(D)}function Gf(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)RI(D,$)}function RI(D,$){return RI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,F){return I.__proto__=F,I},RI(D,$)}function NZ(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function e2(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?NZ(Object(U),!0).forEach(function(I){qf(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):NZ(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function qf(D,$,U){if($=EZ($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function d1(D){return d1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},d1(D)}function C9(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function zZ(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,EZ(I.key),I)}}function u9(D,$,U){if($)zZ(D.prototype,$);if(U)zZ(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function EZ(D){var $=Hf(D,"string");return d1($)=="symbol"?$:$+""}function Hf(D,$){if(d1(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(d1(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var t9D=vZ.default=function(){function D(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C9(this,D),this._requestOptions=$}return u9(D,[{key:"createRequest",value:function(U,I){return new Nf(U,I,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),Nf=function(){function D($,U,I){C9(this,D),this._method=$,this._url=U,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=I||{}}return u9(D,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(U,I){this._headers[U]=I}},{key:"getHeader",value:function(U){return this._headers[U]}},{key:"setProgressHandler",value:function(U){this._progressHandler=U}},{key:"send",value:function(){var U=this,I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(F,J){var X=e2(e2(e2({},(0,Qf.parse)(U._url)),U._requestOptions),{},{method:U._method,headers:e2(e2({},U._requestOptions.headers||{}),U._headers)});if(I!==null&&I!==void 0&&I.size)X.headers["Content-Length"]=I.size;var Q=X.protocol==="https:"?Xf:Jf;U._request=Q.request(X);var Y=U._request;if(Y.on("response",function(W){var B=[];W.on("data",function(K){B.push(K)}),W.on("end",function(){var K=Buffer.concat(B).toString("utf8");F(new zf(W,K))})}),Y.on("error",function(W){J(W)}),I instanceof LZ.Readable)I.pipe(new Lf(U._progressHandler)).pipe(Y);else if(I instanceof Uint8Array)wf(Y,I,U._progressHandler);else Y.end(I)})}},{key:"abort",value:function(){if(this._request!==null)this._request.abort();return Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),zf=function(){function D($,U){C9(this,D),this._response=$,this._body=U}return u9(D,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(U){return this._response.headers[U.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),Lf=function(D){function $(U){var I;return C9(this,$),I=Wf(this,$),I._onprogress=(0,wZ.default)(U,100,{leading:!0,trailing:!1}),I._position=0,I}return Gf($,D),u9($,[{key:"_transform",value:function(I,F,J){this._position+=I.length,this._onprogress(this._position),J(null,I)}}])}(LZ.Transform),wf=function($,U,I){I=(0,wZ.default)(I,100,{leading:!0,trailing:!1});var F=0;function J(){var X=Math.min($.writableHighWaterMark,U.length-F),Q=U.subarray(F,F+X);F+=Q.length;var Y=$.write(Q);if(!Y)$.once("drain",J),I(F);else if(F<U.length)J();else $.end()}J()}});var AZ=C((Zf)=>{Zf.expectReceive=function(D,$,U){var I;if(U.root(D,$,U),I=this.message,D.hasOwnProperty("expected"))I+=" Expected "+D.expected+".";if(D.hasOwnProperty("received"))I+=" Received: "+D.received+".";this.message=I};Zf.root=function(D,$,U){var I=this,F,J={stackLength:Error.stackTraceLimit,rootOnly:!0},X="",Q=Error.stackTraceLimit,Y;function W(){Y[0]=I.toString(),I.stack=Y.join(`
|
|
82
82
|
`)}if(!$||typeof $!=="object")$={};if($.hasOwnProperty("stackLength")&&typeof $.stackLength==="number"&&!isNaN($.stackLength)&&$.stackLength>=0)J.stackLength=$.stackLength;if(!$.hasOwnProperty("rootOnly"))J.rootOnly=$.rootOnly;if(!J.rootOnly||this.CustomError.parent===Error)Object.keys(D).forEach(function(B){switch(B){case"code":F=D.code||void 0;break;case"message":X=D.message||"";break;default:I[B]=D[B]}}),Error.stackTraceLimit=J.stackLength+2,Y=Error().stack.split(`
|
|
83
83
|
`),Y.splice(0,3),Y.unshift(""),Error.stackTraceLimit=Q,this.stack=Y.join(`
|
|
84
|
-
`),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return F},set:function(B){F=B,W()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return X},set:function(B){X=B,W()}}),W()}});var TZ=C((s9D,SZ)=>{SZ.exports=S6;S6.factory=AZ();var bI=S6("CustomError");bI.order=S6(bI,{message:"Arguments out of order.",code:"EOARG"});function S6(D,$,U,I){var F,J;if($=k9(arguments,1,Error,RZ,[SI,_9]),U=k9(arguments,2,{},SI,[_9]),I=k9(arguments,3,TI,_9,[]),D=k9(arguments,0,$===Error?"Error":$.prototype.CustomError.name,Ef,[RZ,SI,_9]),J=$===Error,J&&I===TI)I=S6.factory.root;return F=function(X,Q){var Y,W,B,K,q,H;if(!(this instanceof F))return new F(X,Q);if(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:D,writable:!1}),typeof X==="string")X={message:X};if(!X)X={};W=this.CustomError.chain.slice(0).reverse().map(function(G){return G.properties}),W.push(X),W.unshift({}),H=Object.assign.apply(Object,W),Y=this,B={},Object.keys(S6.factory).forEach(function(G){B[G]=function(z,N){S6.factory[G].call(Y,z,N,B)}});for(K=this.CustomError.chain.length-1;K>=0;K--)if(q=this.CustomError.chain[K],q.factory!==TI)q.factory.call(this,H,Q,B)},F.prototype=Object.create($.prototype),F.prototype.constructor=F,F.prototype.name=D,F.prototype.CustomError={chain:J?[]:$.prototype.CustomError.chain.slice(0),factory:I,name:D,parent:$,properties:U},F.prototype.CustomError.chain.unshift(F.prototype.CustomError),F.prototype.toString=function(){var X=this.CustomError.chain[this.CustomError.chain.length-1].name;if(this.code)X+=" "+this.code;if(this.message)X+=": "+this.message;return X},F}function k9(D,$,U,I,F){var J=-1,X=-1,Q,Y,W=$<D.length?$:D.length,B;for(Q=0;Q<=W;Q++){if(B=D[Q],J===-1){for(Y=0;Y<F.length;Y++)if(F[Y](B))J=Q}if(X===-1&&I(B))X=Q}if(X!==-1&&J!==-1&&J<X)throw new bI.order;return X!==-1?D[X]:U}function _9(D){return typeof D==="function"&&D!==Error&&!D.prototype.CustomError}function Ef(D){return typeof D==="string"}function RZ(D){return typeof D==="function"&&(D===Error||D.prototype.CustomError)}function SI(D){return D&&typeof D==="object"}function TI(){}});var kZ=C((p1,c1)=>{var vf=1/0,Vf="[object Symbol]",D8={function:!0,object:!0},jf=D8[typeof p1]&&p1&&!p1.nodeType?p1:void 0,Af=D8[typeof c1]&&c1&&!c1.nodeType?c1:void 0,Rf=x9(jf&&Af&&typeof global=="object"&&global),Sf=x9(D8[typeof self]&&self),bZ=x9(D8[typeof window]&&window),PI=x9(D8[typeof p1]&&p1),Tf=Rf||bZ!==(PI&&PI.window)&&bZ||Sf||PI||Function("return this")();function x9(D){return D&&D.Object===Object?D:null}var bf=Object.prototype,Pf=bf.toString,PZ=Tf.Symbol,CZ=PZ?PZ.prototype:void 0,uZ=CZ?CZ.toString:void 0;function Cf(D){if(typeof D=="string")return D;if(kf(D))return uZ?uZ.call(D):"";var $=D+"";return $=="0"&&1/D==-vf?"-0":$}function uf(D){return!!D&&typeof D=="object"}function kf(D){return typeof D=="symbol"||uf(D)&&Pf.call(D)==Vf}c1.exports=Cf});var hZ=C((o1,r1)=>{var _f=kZ(),xf="Expected a function",xZ="__lodash_hash_undefined__",gf="[object Function]",ff="[object GeneratorFunction]",yf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,mf=/[\\^$.*+?()[\]{}|]/g,hf=/\\(\\)?/g,nf=/^\[object .+?Constructor\]$/,U8={function:!0,object:!0},lf=U8[typeof o1]&&o1&&!o1.nodeType?o1:void 0,df=U8[typeof r1]&&r1&&!r1.nodeType?r1:void 0,cf=g9(lf&&df&&typeof global=="object"&&global),pf=g9(U8[typeof self]&&self),_Z=g9(U8[typeof window]&&window),CI=g9(U8[typeof o1]&&o1),rf=cf||_Z!==(CI&&CI.window)&&_Z||pf||CI||Function("return this")();function g9(D){return D&&D.Object===Object?D:null}function of(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}var tf=Array.prototype,gZ=Object.prototype,fZ=Function.prototype.toString,uI=gZ.hasOwnProperty,af=gZ.toString,sf=RegExp("^"+fZ.call(uI).replace(mf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ef=tf.splice,Dy=yZ(rf,"Map"),$8=yZ(Object,"create");function T6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function $y(){this.__data__=$8?$8(null):{}}function Uy(D){return this.has(D)&&delete this.__data__[D]}function Fy(D){var $=this.__data__;if($8){var U=$[D];return U===xZ?void 0:U}return uI.call($,D)?$[D]:void 0}function Iy(D){var $=this.__data__;return $8?$[D]!==void 0:uI.call($,D)}function Jy(D,$){var U=this.__data__;return U[D]=$8&&$===void 0?xZ:$,this}T6.prototype.clear=$y;T6.prototype.delete=Uy;T6.prototype.get=Fy;T6.prototype.has=Iy;T6.prototype.set=Jy;function t1(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function Xy(){this.__data__=[]}function Qy(D){var $=this.__data__,U=f9($,D);if(U<0)return!1;var I=$.length-1;if(U==I)$.pop();else ef.call($,U,1);return!0}function Yy(D){var $=this.__data__,U=f9($,D);return U<0?void 0:$[U][1]}function Wy(D){return f9(this.__data__,D)>-1}function By(D,$){var U=this.__data__,I=f9(U,D);if(I<0)U.push([D,$]);else U[I][1]=$;return this}t1.prototype.clear=Xy;t1.prototype.delete=Qy;t1.prototype.get=Yy;t1.prototype.has=Wy;t1.prototype.set=By;function b6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function Ky(){this.__data__={hash:new T6,map:new(Dy||t1),string:new T6}}function Gy(D){return y9(this,D).delete(D)}function qy(D){return y9(this,D).get(D)}function Hy(D){return y9(this,D).has(D)}function Ny(D,$){return y9(this,D).set(D,$),this}b6.prototype.clear=Ky;b6.prototype.delete=Gy;b6.prototype.get=qy;b6.prototype.has=Hy;b6.prototype.set=Ny;function f9(D,$){var U=D.length;while(U--)if(Zy(D[U][0],$))return U;return-1}function y9(D,$){var U=D.__data__;return zy($)?U[typeof $=="string"?"string":"hash"]:U.map}function yZ(D,$){var U=D[$];return Oy(U)?U:void 0}function zy(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}var Ly=kI(function(D){var $=[];return Ey(D).replace(yf,function(U,I,F,J){$.push(F?J.replace(hf,"$1"):I||U)}),$});function wy(D){if(D!=null){try{return fZ.call(D)}catch($){}try{return D+""}catch($){}}return""}function kI(D,$){if(typeof D!="function"||$&&typeof $!="function")throw TypeError(xf);var U=function(){var I=arguments,F=$?$.apply(this,I):I[0],J=U.cache;if(J.has(F))return J.get(F);var X=D.apply(this,I);return U.cache=J.set(F,X),X};return U.cache=new(kI.Cache||b6),U}kI.Cache=b6;function Zy(D,$){return D===$||D!==D&&$!==$}function My(D){var $=mZ(D)?af.call(D):"";return $==gf||$==ff}function mZ(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Oy(D){if(!mZ(D))return!1;var $=My(D)||of(D)?sf:nf;return $.test(wy(D))}function Ey(D){return D==null?"":_f(D)}r1.exports=Ly});var LM=C((e1,s1)=>{var vy=hZ(),Vy=200,dI="__lodash_hash_undefined__",l9=1,D4=2,jy=1/0,pZ=9007199254740991,m9="[object Arguments]",gI="[object Array]",rZ="[object Boolean]",oZ="[object Date]",tZ="[object Error]",aZ="[object Function]",Ay="[object GeneratorFunction]",F8="[object Map]",sZ="[object Number]",a1="[object Object]",nZ="[object Promise]",eZ="[object RegExp]",I8="[object Set]",cI="[object String]",DM="[object Symbol]",fI="[object WeakMap]",$M="[object ArrayBuffer]",h9="[object DataView]",Ry="[object Float32Array]",Sy="[object Float64Array]",Ty="[object Int8Array]",by="[object Int16Array]",Py="[object Int32Array]",Cy="[object Uint8Array]",uy="[object Uint8ClampedArray]",ky="[object Uint16Array]",_y="[object Uint32Array]",xy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gy=/^\w*$/,fy=/[\\^$.*+?()[\]{}|]/g,yy=/^\[object .+?Constructor\]$/,my=/^(?:0|[1-9]\d*)$/,CD={};CD[Ry]=CD[Sy]=CD[Ty]=CD[by]=CD[Py]=CD[Cy]=CD[uy]=CD[ky]=CD[_y]=!0;CD[m9]=CD[gI]=CD[$M]=CD[rZ]=CD[h9]=CD[oZ]=CD[tZ]=CD[aZ]=CD[F8]=CD[sZ]=CD[a1]=CD[eZ]=CD[I8]=CD[cI]=CD[fI]=!1;var X8={function:!0,object:!0},hy=X8[typeof e1]&&e1&&!e1.nodeType?e1:void 0,ny=X8[typeof s1]&&s1&&!s1.nodeType?s1:void 0,iy=d9(hy&&ny&&typeof global=="object"&&global),ly=d9(X8[typeof self]&&self),iZ=d9(X8[typeof window]&&window),_I=d9(X8[typeof e1]&&e1),u6=iy||iZ!==(_I&&_I.window)&&iZ||ly||_I||Function("return this")();function dy(D,$){var U=-1,I=D.length,F=Array(I);while(++U<I)F[U]=$(D[U],U,D);return F}function cy(D,$){var U=-1,I=D.length;while(++U<I)if($(D[U],U,D))return!0;return!1}function py(D,$){var U=-1,I=Array(D);while(++U<D)I[U]=$(U);return I}function ry(D,$){return dy($,function(U){return[U,D[U]]})}function d9(D){return D&&D.Object===Object?D:null}function yI(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}function UM(D){var $=-1,U=Array(D.size);return D.forEach(function(I,F){U[++$]=[F,I]}),U}function oy(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=I}),U}function ty(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=[I,I]}),U}var ay=Array.prototype,c9=Object.prototype,FM=Function.prototype.toString,P6=c9.hasOwnProperty,k6=c9.toString,sy=RegExp("^"+FM.call(P6).replace(fy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lZ=u6.Symbol,dZ=u6.Uint8Array,ey=c9.propertyIsEnumerable,Dm=ay.splice,$m=Object.getPrototypeOf,Um=Object.keys,mI=$4(u6,"DataView"),n9=$4(u6,"Map"),hI=$4(u6,"Promise"),nI=$4(u6,"Set"),iI=$4(u6,"WeakMap"),J8=$4(Object,"create"),Fm=x6(mI),Im=x6(n9),Jm=x6(hI),Xm=x6(nI),Qm=x6(iI),cZ=lZ?lZ.prototype:void 0,xI=cZ?cZ.valueOf:void 0;function C6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function Ym(){this.__data__=J8?J8(null):{}}function Wm(D){return this.has(D)&&delete this.__data__[D]}function Bm(D){var $=this.__data__;if(J8){var U=$[D];return U===dI?void 0:U}return P6.call($,D)?$[D]:void 0}function Km(D){var $=this.__data__;return J8?$[D]!==void 0:P6.call($,D)}function Gm(D,$){var U=this.__data__;return U[D]=J8&&$===void 0?dI:$,this}C6.prototype.clear=Ym;C6.prototype.delete=Wm;C6.prototype.get=Bm;C6.prototype.has=Km;C6.prototype.set=Gm;function j0(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function qm(){this.__data__=[]}function Hm(D){var $=this.__data__,U=p9($,D);if(U<0)return!1;var I=$.length-1;if(U==I)$.pop();else Dm.call($,U,1);return!0}function Nm(D){var $=this.__data__,U=p9($,D);return U<0?void 0:$[U][1]}function zm(D){return p9(this.__data__,D)>-1}function Lm(D,$){var U=this.__data__,I=p9(U,D);if(I<0)U.push([D,$]);else U[I][1]=$;return this}j0.prototype.clear=qm;j0.prototype.delete=Hm;j0.prototype.get=Nm;j0.prototype.has=zm;j0.prototype.set=Lm;function _6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function wm(){this.__data__={hash:new C6,map:new(n9||j0),string:new C6}}function Zm(D){return r9(this,D).delete(D)}function Mm(D){return r9(this,D).get(D)}function Om(D){return r9(this,D).has(D)}function Em(D,$){return r9(this,D).set(D,$),this}_6.prototype.clear=wm;_6.prototype.delete=Zm;_6.prototype.get=Mm;_6.prototype.has=Om;_6.prototype.set=Em;function i9(D){var $=-1,U=D?D.length:0;this.__data__=new _6;while(++$<U)this.add(D[$])}function vm(D){return this.__data__.set(D,dI),this}function Vm(D){return this.__data__.has(D)}i9.prototype.add=i9.prototype.push=vm;i9.prototype.has=Vm;function V0(D){this.__data__=new j0(D)}function jm(){this.__data__=new j0}function Am(D){return this.__data__.delete(D)}function Rm(D){return this.__data__.get(D)}function Sm(D){return this.__data__.has(D)}function Tm(D,$){var U=this.__data__;if(U instanceof j0&&U.__data__.length==Vy)U=this.__data__=new _6(U.__data__);return U.set(D,$),this}V0.prototype.clear=jm;V0.prototype.delete=Am;V0.prototype.get=Rm;V0.prototype.has=Sm;V0.prototype.set=Tm;function p9(D,$){var U=D.length;while(U--)if(rm(D[U][0],$))return U;return-1}function IM(D,$){$=o9($,D)?[$]:QM($);var U=0,I=$.length;while(D!=null&&U<I)D=D[t9($[U++])];return U&&U==I?D:void 0}function JM(D,$){return P6.call(D,$)||typeof D=="object"&&$ in D&&im(D)===null}function bm(D,$){return $ in Object(D)}function pI(D,$,U,I,F){if(D===$)return!0;if(D==null||$==null||!s9(D)&&!Q8($))return D!==D&&$!==$;return Pm(D,$,pI,U,I,F)}function Pm(D,$,U,I,F,J){var X=i0(D),Q=i0($),Y=gI,W=gI;if(!X)Y=v0(D),Y=Y==m9?a1:Y;if(!Q)W=v0($),W=W==m9?a1:W;var B=Y==a1&&!yI(D),K=W==a1&&!yI($),q=Y==W;if(q&&!B)return J||(J=new V0),X||am(D)?YM(D,$,U,I,F,J):ym(D,$,Y,U,I,F,J);if(!(F&D4)){var H=B&&P6.call(D,"__wrapped__"),G=K&&P6.call($,"__wrapped__");if(H||G){var z=H?D.value():D,N=G?$.value():$;return J||(J=new V0),U(z,N,I,F,J)}}if(!q)return!1;return J||(J=new V0),mm(D,$,U,I,F,J)}function Cm(D,$,U,I){var F=U.length,J=F,X=!I;if(D==null)return!J;D=Object(D);while(F--){var Q=U[F];if(X&&Q[2]?Q[1]!==D[Q[0]]:!(Q[0]in D))return!1}while(++F<J){Q=U[F];var Y=Q[0],W=D[Y],B=Q[1];if(X&&Q[2]){if(W===void 0&&!(Y in D))return!1}else{var K=new V0;if(I)var q=I(W,B,Y,D,$,K);if(!(q===void 0?pI(B,W,I,l9|D4,K):q))return!1}}return!0}function um(D){if(typeof D=="function")return D;if(D==null)return $h;if(typeof D=="object")return i0(D)?xm(D[0],D[1]):_m(D);return Uh(D)}function km(D){return Um(Object(D))}function _m(D){var $=nm(D);if($.length==1&&$[0][2])return KM($[0][0],$[0][1]);return function(U){return U===D||Cm(U,D,$)}}function xm(D,$){if(o9(D)&&BM($))return KM(t9(D),$);return function(U){var I=sm(U,D);return I===void 0&&I===$?em(U,D):pI($,I,void 0,l9|D4)}}function XM(D){return function($){return $==null?void 0:$[D]}}function gm(D){return function($){return IM($,D)}}function QM(D){return i0(D)?D:vy(D)}function fm(D){return function($){var U=v0($);if(U==F8)return UM($);if(U==I8)return ty($);return ry($,D($))}}function YM(D,$,U,I,F,J){var X=F&D4,Q=D.length,Y=$.length;if(Q!=Y&&!(X&&Y>Q))return!1;var W=J.get(D);if(W)return W==$;var B=-1,K=!0,q=F&l9?new i9:void 0;J.set(D,$);while(++B<Q){var H=D[B],G=$[B];if(I)var z=X?I(G,H,B,$,D,J):I(H,G,B,D,$,J);if(z!==void 0){if(z)continue;K=!1;break}if(q){if(!cy($,function(N,M){if(!q.has(M)&&(H===N||U(H,N,I,F,J)))return q.add(M)})){K=!1;break}}else if(!(H===G||U(H,G,I,F,J))){K=!1;break}}return J.delete(D),K}function ym(D,$,U,I,F,J,X){switch(U){case h9:if(D.byteLength!=$.byteLength||D.byteOffset!=$.byteOffset)return!1;D=D.buffer,$=$.buffer;case $M:if(D.byteLength!=$.byteLength||!I(new dZ(D),new dZ($)))return!1;return!0;case rZ:case oZ:return+D==+$;case tZ:return D.name==$.name&&D.message==$.message;case sZ:return D!=+D?$!=+$:D==+$;case eZ:case cI:return D==$+"";case F8:var Q=UM;case I8:var Y=J&D4;if(Q||(Q=oy),D.size!=$.size&&!Y)return!1;var W=X.get(D);if(W)return W==$;return J|=l9,X.set(D,$),YM(Q(D),Q($),I,F,J,X);case DM:if(xI)return xI.call(D)==xI.call($)}return!1}function mm(D,$,U,I,F,J){var X=F&D4,Q=lI(D),Y=Q.length,W=lI($),B=W.length;if(Y!=B&&!X)return!1;var K=Y;while(K--){var q=Q[K];if(!(X?q in $:JM($,q)))return!1}var H=J.get(D);if(H)return H==$;var G=!0;J.set(D,$);var z=X;while(++K<Y){q=Q[K];var N=D[q],M=$[q];if(I)var Z=X?I(M,N,q,$,D,J):I(N,M,q,D,$,J);if(!(Z===void 0?N===M||U(N,M,I,F,J):Z)){G=!1;break}z||(z=q=="constructor")}if(G&&!z){var L=D.constructor,v=$.constructor;if(L!=v&&(("constructor"in D)&&("constructor"in $))&&!(typeof L=="function"&&L instanceof L&&typeof v=="function"&&v instanceof v))G=!1}return J.delete(D),G}var hm=XM("length");function r9(D,$){var U=D.__data__;return cm($)?U[typeof $=="string"?"string":"hash"]:U.map}function nm(D){var $=Dh(D),U=$.length;while(U--)$[U][2]=BM($[U][1]);return $}function $4(D,$){var U=D[$];return tm(U)?U:void 0}function im(D){return $m(Object(D))}function v0(D){return k6.call(D)}if(mI&&v0(new mI(new ArrayBuffer(1)))!=h9||n9&&v0(new n9)!=F8||hI&&v0(hI.resolve())!=nZ||nI&&v0(new nI)!=I8||iI&&v0(new iI)!=fI)v0=function(D){var $=k6.call(D),U=$==a1?D.constructor:void 0,I=U?x6(U):void 0;if(I)switch(I){case Fm:return h9;case Im:return F8;case Jm:return nZ;case Xm:return I8;case Qm:return fI}return $};function lm(D,$,U){$=o9($,D)?[$]:QM($);var I,F=-1,X=$.length;while(++F<X){var J=t9($[F]);if(!(I=D!=null&&U(D,J)))break;D=D[J]}if(I)return I;var X=D?D.length:0;return!!X&&a9(X)&&WM(J,X)&&(i0(D)||NM(D)||GM(D))}function dm(D){var $=D?D.length:void 0;if(a9($)&&(i0(D)||NM(D)||GM(D)))return py($,String);return null}function WM(D,$){return $=$==null?pZ:$,!!$&&(typeof D=="number"||my.test(D))&&(D>-1&&D%1==0&&D<$)}function o9(D,$){if(i0(D))return!1;var U=typeof D;if(U=="number"||U=="symbol"||U=="boolean"||D==null||zM(D))return!0;return gy.test(D)||!xy.test(D)||$!=null&&D in Object($)}function cm(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}function pm(D){var $=D&&D.constructor,U=typeof $=="function"&&$.prototype||c9;return D===U}function BM(D){return D===D&&!s9(D)}function KM(D,$){return function(U){if(U==null)return!1;return U[D]===$&&($!==void 0||(D in Object(U)))}}function t9(D){if(typeof D=="string"||zM(D))return D;var $=D+"";return $=="0"&&1/D==-jy?"-0":$}function x6(D){if(D!=null){try{return FM.call(D)}catch($){}try{return D+""}catch($){}}return""}function rm(D,$){return D===$||D!==D&&$!==$}function GM(D){return om(D)&&P6.call(D,"callee")&&(!ey.call(D,"callee")||k6.call(D)==m9)}var i0=Array.isArray;function qM(D){return D!=null&&a9(hm(D))&&!HM(D)}function om(D){return Q8(D)&&qM(D)}function HM(D){var $=s9(D)?k6.call(D):"";return $==aZ||$==Ay}function a9(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=pZ}function s9(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Q8(D){return!!D&&typeof D=="object"}function tm(D){if(!s9(D))return!1;var $=HM(D)||yI(D)?sy:yy;return $.test(x6(D))}function NM(D){return typeof D=="string"||!i0(D)&&Q8(D)&&k6.call(D)==cI}function zM(D){return typeof D=="symbol"||Q8(D)&&k6.call(D)==DM}function am(D){return Q8(D)&&a9(D.length)&&!!CD[k6.call(D)]}function sm(D,$,U){var I=D==null?void 0:IM(D,$);return I===void 0?U:I}function em(D,$){return D!=null&&lm(D,$,bm)}function lI(D){var $=pm(D);if(!($||qM(D)))return km(D);var U=dm(D),I=!!U,F=U||[],J=F.length;for(var X in D)if(JM(D,X)&&!(I&&(X=="length"||WM(X,J)))&&!($&&X=="constructor"))F.push(X);return F}var Dh=fm(lI);function $h(D){return D}function Uh(D){return o9(D)?XM(t9(D)):gm(D)}s1.exports=um});var EM=C((F4,U4)=>{var Fh=1/0,Ih="[object Function]",Jh="[object GeneratorFunction]",Xh=/[\\^$.*+?()[\]{}|]/g,Qh=/^\[object .+?Constructor\]$/,Y8={function:!0,object:!0},Yh=Y8[typeof F4]&&F4&&!F4.nodeType?F4:void 0,Wh=Y8[typeof U4]&&U4&&!U4.nodeType?U4:void 0,Bh=e9(Yh&&Wh&&typeof global=="object"&&global),Kh=e9(Y8[typeof self]&&self),wM=e9(Y8[typeof window]&&window),rI=e9(Y8[typeof F4]&&F4),Gh=Bh||wM!==(rI&&rI.window)&&wM||Kh||rI||Function("return this")();function e9(D){return D&&D.Object===Object?D:null}function qh(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}function Hh(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=I}),U}var ZM=Object.prototype,MM=Function.prototype.toString,Nh=ZM.hasOwnProperty,zh=ZM.toString,Lh=RegExp("^"+MM.call(Nh).replace(Xh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oI=Zh(Gh,"Set"),wh=!(oI&&1/Hh(new oI([,-0]))[1]==Fh)?vh:function(D){return new oI(D)};function Zh(D,$){var U=D[$];return Eh(U)?U:void 0}function Mh(D){if(D!=null){try{return MM.call(D)}catch($){}try{return D+""}catch($){}}return""}function Oh(D){var $=OM(D)?zh.call(D):"";return $==Ih||$==Jh}function OM(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Eh(D){if(!OM(D))return!1;var $=Oh(D)||qh(D)?Lh:Qh;return $.test(Mh(D))}function vh(){}U4.exports=wh});var VM=C((J4,I4)=>{var W8={function:!0,object:!0},Vh=W8[typeof J4]&&J4&&!J4.nodeType?J4:void 0,jh=W8[typeof I4]&&I4&&!I4.nodeType?I4:void 0,Ah=D5(Vh&&jh&&typeof global=="object"&&global),Rh=D5(W8[typeof self]&&self),vM=D5(W8[typeof window]&&window),tI=D5(W8[typeof J4]&&J4),Sh=Ah||vM!==(tI&&tI.window)&&vM||Rh||tI||Function("return this")();function D5(D){return D&&D.Object===Object?D:null}I4.exports=Sh});var bM=C((I5D,TM)=>{var Th=EM(),bh=VM(),Ph=200,aI="__lodash_hash_undefined__",Ch="[object Function]",uh="[object GeneratorFunction]",kh=/[\\^$.*+?()[\]{}|]/g,_h=/^\[object .+?Constructor\]$/;function xh(D,$){return!!D.length&&fh(D,$,0)>-1}function gh(D,$,U){var I=-1,F=D.length;while(++I<F)if(U($,D[I]))return!0;return!1}function fh(D,$,U){if($!==$)return mh(D,U);var I=U-1,F=D.length;while(++I<F)if(D[I]===$)return I;return-1}function yh(D,$){return D.has($)}function mh(D,$,U){var I=D.length,F=$+(U?0:-1);while(U?F--:++F<I){var J=D[F];if(J!==J)return F}return-1}function hh(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}function nh(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=I}),U}var ih=Array.prototype,jM=Object.prototype,AM=Function.prototype.toString,sI=jM.hasOwnProperty,lh=jM.toString,dh=RegExp("^"+AM.call(sI).replace(kh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ch=ih.splice,ph=RM(bh,"Map"),B8=RM(Object,"create");function g6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function rh(){this.__data__=B8?B8(null):{}}function oh(D){return this.has(D)&&delete this.__data__[D]}function th(D){var $=this.__data__;if(B8){var U=$[D];return U===aI?void 0:U}return sI.call($,D)?$[D]:void 0}function ah(D){var $=this.__data__;return B8?$[D]!==void 0:sI.call($,D)}function sh(D,$){var U=this.__data__;return U[D]=B8&&$===void 0?aI:$,this}g6.prototype.clear=rh;g6.prototype.delete=oh;g6.prototype.get=th;g6.prototype.has=ah;g6.prototype.set=sh;function X4(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function eh(){this.__data__=[]}function Dn(D){var $=this.__data__,U=U5($,D);if(U<0)return!1;var I=$.length-1;if(U==I)$.pop();else ch.call($,U,1);return!0}function $n(D){var $=this.__data__,U=U5($,D);return U<0?void 0:$[U][1]}function Un(D){return U5(this.__data__,D)>-1}function Fn(D,$){var U=this.__data__,I=U5(U,D);if(I<0)U.push([D,$]);else U[I][1]=$;return this}X4.prototype.clear=eh;X4.prototype.delete=Dn;X4.prototype.get=$n;X4.prototype.has=Un;X4.prototype.set=Fn;function Q4(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function In(){this.__data__={hash:new g6,map:new(ph||X4),string:new g6}}function Jn(D){return F5(this,D).delete(D)}function Xn(D){return F5(this,D).get(D)}function Qn(D){return F5(this,D).has(D)}function Yn(D,$){return F5(this,D).set(D,$),this}Q4.prototype.clear=In;Q4.prototype.delete=Jn;Q4.prototype.get=Xn;Q4.prototype.has=Qn;Q4.prototype.set=Yn;function $5(D){var $=-1,U=D?D.length:0;this.__data__=new Q4;while(++$<U)this.add(D[$])}function Wn(D){return this.__data__.set(D,aI),this}function Bn(D){return this.__data__.has(D)}$5.prototype.add=$5.prototype.push=Wn;$5.prototype.has=Bn;function U5(D,$){var U=D.length;while(U--)if(Hn(D[U][0],$))return U;return-1}function Kn(D,$,U){var I=-1,F=xh,J=D.length,X=!0,Q=[],Y=Q;if(U)X=!1,F=gh;else if(J>=Ph){var W=$?null:Th(D);if(W)return nh(W);X=!1,F=yh,Y=new $5}else Y=$?[]:Q;D:while(++I<J){var B=D[I],K=$?$(B):B;if(B=U||B!==0?B:0,X&&K===K){var q=Y.length;while(q--)if(Y[q]===K)continue D;if($)Y.push(K);Q.push(B)}else if(!F(Y,K,U)){if(Y!==Q)Y.push(K);Q.push(B)}}return Q}function F5(D,$){var U=D.__data__;return Gn($)?U[typeof $=="string"?"string":"hash"]:U.map}function RM(D,$){var U=D[$];return zn(U)?U:void 0}function Gn(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}function qn(D){if(D!=null){try{return AM.call(D)}catch($){}try{return D+""}catch($){}}return""}function Hn(D,$){return D===$||D!==D&&$!==$}function Nn(D){var $=SM(D)?lh.call(D):"";return $==Ch||$==uh}function SM(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function zn(D){if(!SM(D))return!1;var $=Nn(D)||hh(D)?dh:_h;return $.test(qn(D))}TM.exports=Kn});var CM=C((J5D,PM)=>{var Ln=LM(),wn=bM();function Zn(D,$){return D&&D.length?wn(D,Ln($)):[]}PM.exports=Zn});var kM=C((X5D,uM)=>{var Mn=TZ(),On=CM(),En=Mn("MultiError");uM.exports=eI;function eI(D){if(!(this instanceof eI))return new eI(D);if(D=Array.isArray(D)?D:[D],D=On(D,function(U){return U.stack}),D.length===1)return D[0];var $=new En({message:D.map(function(U){return U.message}).join("; "),errors:D.reduce(function(U,I){return U.concat(I.errors||I)},[])});return $.__defineGetter__("stack",function(){return D.map(function(U){return U.stack}).join(`
|
|
84
|
+
`),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return F},set:function(B){F=B,W()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return X},set:function(B){X=B,W()}}),W()}});var TZ=C((e9D,SZ)=>{SZ.exports=S6;S6.factory=AZ();var bI=S6("CustomError");bI.order=S6(bI,{message:"Arguments out of order.",code:"EOARG"});function S6(D,$,U,I){var F,J;if($=k9(arguments,1,Error,RZ,[SI,_9]),U=k9(arguments,2,{},SI,[_9]),I=k9(arguments,3,TI,_9,[]),D=k9(arguments,0,$===Error?"Error":$.prototype.CustomError.name,Ef,[RZ,SI,_9]),J=$===Error,J&&I===TI)I=S6.factory.root;return F=function(X,Q){var Y,W,B,K,q,H;if(!(this instanceof F))return new F(X,Q);if(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:D,writable:!1}),typeof X==="string")X={message:X};if(!X)X={};W=this.CustomError.chain.slice(0).reverse().map(function(G){return G.properties}),W.push(X),W.unshift({}),H=Object.assign.apply(Object,W),Y=this,B={},Object.keys(S6.factory).forEach(function(G){B[G]=function(z,N){S6.factory[G].call(Y,z,N,B)}});for(K=this.CustomError.chain.length-1;K>=0;K--)if(q=this.CustomError.chain[K],q.factory!==TI)q.factory.call(this,H,Q,B)},F.prototype=Object.create($.prototype),F.prototype.constructor=F,F.prototype.name=D,F.prototype.CustomError={chain:J?[]:$.prototype.CustomError.chain.slice(0),factory:I,name:D,parent:$,properties:U},F.prototype.CustomError.chain.unshift(F.prototype.CustomError),F.prototype.toString=function(){var X=this.CustomError.chain[this.CustomError.chain.length-1].name;if(this.code)X+=" "+this.code;if(this.message)X+=": "+this.message;return X},F}function k9(D,$,U,I,F){var J=-1,X=-1,Q,Y,W=$<D.length?$:D.length,B;for(Q=0;Q<=W;Q++){if(B=D[Q],J===-1){for(Y=0;Y<F.length;Y++)if(F[Y](B))J=Q}if(X===-1&&I(B))X=Q}if(X!==-1&&J!==-1&&J<X)throw new bI.order;return X!==-1?D[X]:U}function _9(D){return typeof D==="function"&&D!==Error&&!D.prototype.CustomError}function Ef(D){return typeof D==="string"}function RZ(D){return typeof D==="function"&&(D===Error||D.prototype.CustomError)}function SI(D){return D&&typeof D==="object"}function TI(){}});var kZ=C((p1,c1)=>{var vf=1/0,Vf="[object Symbol]",D8={function:!0,object:!0},jf=D8[typeof p1]&&p1&&!p1.nodeType?p1:void 0,Af=D8[typeof c1]&&c1&&!c1.nodeType?c1:void 0,Rf=x9(jf&&Af&&typeof global=="object"&&global),Sf=x9(D8[typeof self]&&self),bZ=x9(D8[typeof window]&&window),PI=x9(D8[typeof p1]&&p1),Tf=Rf||bZ!==(PI&&PI.window)&&bZ||Sf||PI||Function("return this")();function x9(D){return D&&D.Object===Object?D:null}var bf=Object.prototype,Pf=bf.toString,PZ=Tf.Symbol,CZ=PZ?PZ.prototype:void 0,uZ=CZ?CZ.toString:void 0;function Cf(D){if(typeof D=="string")return D;if(kf(D))return uZ?uZ.call(D):"";var $=D+"";return $=="0"&&1/D==-vf?"-0":$}function uf(D){return!!D&&typeof D=="object"}function kf(D){return typeof D=="symbol"||uf(D)&&Pf.call(D)==Vf}c1.exports=Cf});var hZ=C((o1,r1)=>{var _f=kZ(),xf="Expected a function",xZ="__lodash_hash_undefined__",gf="[object Function]",ff="[object GeneratorFunction]",yf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,mf=/[\\^$.*+?()[\]{}|]/g,hf=/\\(\\)?/g,nf=/^\[object .+?Constructor\]$/,U8={function:!0,object:!0},lf=U8[typeof o1]&&o1&&!o1.nodeType?o1:void 0,df=U8[typeof r1]&&r1&&!r1.nodeType?r1:void 0,cf=g9(lf&&df&&typeof global=="object"&&global),pf=g9(U8[typeof self]&&self),_Z=g9(U8[typeof window]&&window),CI=g9(U8[typeof o1]&&o1),rf=cf||_Z!==(CI&&CI.window)&&_Z||pf||CI||Function("return this")();function g9(D){return D&&D.Object===Object?D:null}function of(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}var tf=Array.prototype,gZ=Object.prototype,fZ=Function.prototype.toString,uI=gZ.hasOwnProperty,af=gZ.toString,sf=RegExp("^"+fZ.call(uI).replace(mf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ef=tf.splice,Dy=yZ(rf,"Map"),$8=yZ(Object,"create");function T6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function $y(){this.__data__=$8?$8(null):{}}function Uy(D){return this.has(D)&&delete this.__data__[D]}function Fy(D){var $=this.__data__;if($8){var U=$[D];return U===xZ?void 0:U}return uI.call($,D)?$[D]:void 0}function Iy(D){var $=this.__data__;return $8?$[D]!==void 0:uI.call($,D)}function Jy(D,$){var U=this.__data__;return U[D]=$8&&$===void 0?xZ:$,this}T6.prototype.clear=$y;T6.prototype.delete=Uy;T6.prototype.get=Fy;T6.prototype.has=Iy;T6.prototype.set=Jy;function t1(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function Xy(){this.__data__=[]}function Qy(D){var $=this.__data__,U=f9($,D);if(U<0)return!1;var I=$.length-1;if(U==I)$.pop();else ef.call($,U,1);return!0}function Yy(D){var $=this.__data__,U=f9($,D);return U<0?void 0:$[U][1]}function Wy(D){return f9(this.__data__,D)>-1}function By(D,$){var U=this.__data__,I=f9(U,D);if(I<0)U.push([D,$]);else U[I][1]=$;return this}t1.prototype.clear=Xy;t1.prototype.delete=Qy;t1.prototype.get=Yy;t1.prototype.has=Wy;t1.prototype.set=By;function b6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function Ky(){this.__data__={hash:new T6,map:new(Dy||t1),string:new T6}}function Gy(D){return y9(this,D).delete(D)}function qy(D){return y9(this,D).get(D)}function Hy(D){return y9(this,D).has(D)}function Ny(D,$){return y9(this,D).set(D,$),this}b6.prototype.clear=Ky;b6.prototype.delete=Gy;b6.prototype.get=qy;b6.prototype.has=Hy;b6.prototype.set=Ny;function f9(D,$){var U=D.length;while(U--)if(Zy(D[U][0],$))return U;return-1}function y9(D,$){var U=D.__data__;return zy($)?U[typeof $=="string"?"string":"hash"]:U.map}function yZ(D,$){var U=D[$];return Oy(U)?U:void 0}function zy(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}var Ly=kI(function(D){var $=[];return Ey(D).replace(yf,function(U,I,F,J){$.push(F?J.replace(hf,"$1"):I||U)}),$});function wy(D){if(D!=null){try{return fZ.call(D)}catch($){}try{return D+""}catch($){}}return""}function kI(D,$){if(typeof D!="function"||$&&typeof $!="function")throw TypeError(xf);var U=function(){var I=arguments,F=$?$.apply(this,I):I[0],J=U.cache;if(J.has(F))return J.get(F);var X=D.apply(this,I);return U.cache=J.set(F,X),X};return U.cache=new(kI.Cache||b6),U}kI.Cache=b6;function Zy(D,$){return D===$||D!==D&&$!==$}function My(D){var $=mZ(D)?af.call(D):"";return $==gf||$==ff}function mZ(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Oy(D){if(!mZ(D))return!1;var $=My(D)||of(D)?sf:nf;return $.test(wy(D))}function Ey(D){return D==null?"":_f(D)}r1.exports=Ly});var LM=C((e1,s1)=>{var vy=hZ(),Vy=200,dI="__lodash_hash_undefined__",l9=1,D4=2,jy=1/0,pZ=9007199254740991,m9="[object Arguments]",gI="[object Array]",rZ="[object Boolean]",oZ="[object Date]",tZ="[object Error]",aZ="[object Function]",Ay="[object GeneratorFunction]",F8="[object Map]",sZ="[object Number]",a1="[object Object]",nZ="[object Promise]",eZ="[object RegExp]",I8="[object Set]",cI="[object String]",DM="[object Symbol]",fI="[object WeakMap]",$M="[object ArrayBuffer]",h9="[object DataView]",Ry="[object Float32Array]",Sy="[object Float64Array]",Ty="[object Int8Array]",by="[object Int16Array]",Py="[object Int32Array]",Cy="[object Uint8Array]",uy="[object Uint8ClampedArray]",ky="[object Uint16Array]",_y="[object Uint32Array]",xy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gy=/^\w*$/,fy=/[\\^$.*+?()[\]{}|]/g,yy=/^\[object .+?Constructor\]$/,my=/^(?:0|[1-9]\d*)$/,CD={};CD[Ry]=CD[Sy]=CD[Ty]=CD[by]=CD[Py]=CD[Cy]=CD[uy]=CD[ky]=CD[_y]=!0;CD[m9]=CD[gI]=CD[$M]=CD[rZ]=CD[h9]=CD[oZ]=CD[tZ]=CD[aZ]=CD[F8]=CD[sZ]=CD[a1]=CD[eZ]=CD[I8]=CD[cI]=CD[fI]=!1;var X8={function:!0,object:!0},hy=X8[typeof e1]&&e1&&!e1.nodeType?e1:void 0,ny=X8[typeof s1]&&s1&&!s1.nodeType?s1:void 0,iy=d9(hy&&ny&&typeof global=="object"&&global),ly=d9(X8[typeof self]&&self),iZ=d9(X8[typeof window]&&window),_I=d9(X8[typeof e1]&&e1),u6=iy||iZ!==(_I&&_I.window)&&iZ||ly||_I||Function("return this")();function dy(D,$){var U=-1,I=D.length,F=Array(I);while(++U<I)F[U]=$(D[U],U,D);return F}function cy(D,$){var U=-1,I=D.length;while(++U<I)if($(D[U],U,D))return!0;return!1}function py(D,$){var U=-1,I=Array(D);while(++U<D)I[U]=$(U);return I}function ry(D,$){return dy($,function(U){return[U,D[U]]})}function d9(D){return D&&D.Object===Object?D:null}function yI(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}function UM(D){var $=-1,U=Array(D.size);return D.forEach(function(I,F){U[++$]=[F,I]}),U}function oy(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=I}),U}function ty(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=[I,I]}),U}var ay=Array.prototype,c9=Object.prototype,FM=Function.prototype.toString,P6=c9.hasOwnProperty,k6=c9.toString,sy=RegExp("^"+FM.call(P6).replace(fy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lZ=u6.Symbol,dZ=u6.Uint8Array,ey=c9.propertyIsEnumerable,Dm=ay.splice,$m=Object.getPrototypeOf,Um=Object.keys,mI=$4(u6,"DataView"),n9=$4(u6,"Map"),hI=$4(u6,"Promise"),nI=$4(u6,"Set"),iI=$4(u6,"WeakMap"),J8=$4(Object,"create"),Fm=x6(mI),Im=x6(n9),Jm=x6(hI),Xm=x6(nI),Qm=x6(iI),cZ=lZ?lZ.prototype:void 0,xI=cZ?cZ.valueOf:void 0;function C6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function Ym(){this.__data__=J8?J8(null):{}}function Wm(D){return this.has(D)&&delete this.__data__[D]}function Bm(D){var $=this.__data__;if(J8){var U=$[D];return U===dI?void 0:U}return P6.call($,D)?$[D]:void 0}function Km(D){var $=this.__data__;return J8?$[D]!==void 0:P6.call($,D)}function Gm(D,$){var U=this.__data__;return U[D]=J8&&$===void 0?dI:$,this}C6.prototype.clear=Ym;C6.prototype.delete=Wm;C6.prototype.get=Bm;C6.prototype.has=Km;C6.prototype.set=Gm;function j0(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function qm(){this.__data__=[]}function Hm(D){var $=this.__data__,U=p9($,D);if(U<0)return!1;var I=$.length-1;if(U==I)$.pop();else Dm.call($,U,1);return!0}function Nm(D){var $=this.__data__,U=p9($,D);return U<0?void 0:$[U][1]}function zm(D){return p9(this.__data__,D)>-1}function Lm(D,$){var U=this.__data__,I=p9(U,D);if(I<0)U.push([D,$]);else U[I][1]=$;return this}j0.prototype.clear=qm;j0.prototype.delete=Hm;j0.prototype.get=Nm;j0.prototype.has=zm;j0.prototype.set=Lm;function _6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function wm(){this.__data__={hash:new C6,map:new(n9||j0),string:new C6}}function Zm(D){return r9(this,D).delete(D)}function Mm(D){return r9(this,D).get(D)}function Om(D){return r9(this,D).has(D)}function Em(D,$){return r9(this,D).set(D,$),this}_6.prototype.clear=wm;_6.prototype.delete=Zm;_6.prototype.get=Mm;_6.prototype.has=Om;_6.prototype.set=Em;function i9(D){var $=-1,U=D?D.length:0;this.__data__=new _6;while(++$<U)this.add(D[$])}function vm(D){return this.__data__.set(D,dI),this}function Vm(D){return this.__data__.has(D)}i9.prototype.add=i9.prototype.push=vm;i9.prototype.has=Vm;function V0(D){this.__data__=new j0(D)}function jm(){this.__data__=new j0}function Am(D){return this.__data__.delete(D)}function Rm(D){return this.__data__.get(D)}function Sm(D){return this.__data__.has(D)}function Tm(D,$){var U=this.__data__;if(U instanceof j0&&U.__data__.length==Vy)U=this.__data__=new _6(U.__data__);return U.set(D,$),this}V0.prototype.clear=jm;V0.prototype.delete=Am;V0.prototype.get=Rm;V0.prototype.has=Sm;V0.prototype.set=Tm;function p9(D,$){var U=D.length;while(U--)if(rm(D[U][0],$))return U;return-1}function IM(D,$){$=o9($,D)?[$]:QM($);var U=0,I=$.length;while(D!=null&&U<I)D=D[t9($[U++])];return U&&U==I?D:void 0}function JM(D,$){return P6.call(D,$)||typeof D=="object"&&$ in D&&im(D)===null}function bm(D,$){return $ in Object(D)}function pI(D,$,U,I,F){if(D===$)return!0;if(D==null||$==null||!s9(D)&&!Q8($))return D!==D&&$!==$;return Pm(D,$,pI,U,I,F)}function Pm(D,$,U,I,F,J){var X=i0(D),Q=i0($),Y=gI,W=gI;if(!X)Y=v0(D),Y=Y==m9?a1:Y;if(!Q)W=v0($),W=W==m9?a1:W;var B=Y==a1&&!yI(D),K=W==a1&&!yI($),q=Y==W;if(q&&!B)return J||(J=new V0),X||am(D)?YM(D,$,U,I,F,J):ym(D,$,Y,U,I,F,J);if(!(F&D4)){var H=B&&P6.call(D,"__wrapped__"),G=K&&P6.call($,"__wrapped__");if(H||G){var z=H?D.value():D,N=G?$.value():$;return J||(J=new V0),U(z,N,I,F,J)}}if(!q)return!1;return J||(J=new V0),mm(D,$,U,I,F,J)}function Cm(D,$,U,I){var F=U.length,J=F,X=!I;if(D==null)return!J;D=Object(D);while(F--){var Q=U[F];if(X&&Q[2]?Q[1]!==D[Q[0]]:!(Q[0]in D))return!1}while(++F<J){Q=U[F];var Y=Q[0],W=D[Y],B=Q[1];if(X&&Q[2]){if(W===void 0&&!(Y in D))return!1}else{var K=new V0;if(I)var q=I(W,B,Y,D,$,K);if(!(q===void 0?pI(B,W,I,l9|D4,K):q))return!1}}return!0}function um(D){if(typeof D=="function")return D;if(D==null)return $h;if(typeof D=="object")return i0(D)?xm(D[0],D[1]):_m(D);return Uh(D)}function km(D){return Um(Object(D))}function _m(D){var $=nm(D);if($.length==1&&$[0][2])return KM($[0][0],$[0][1]);return function(U){return U===D||Cm(U,D,$)}}function xm(D,$){if(o9(D)&&BM($))return KM(t9(D),$);return function(U){var I=sm(U,D);return I===void 0&&I===$?em(U,D):pI($,I,void 0,l9|D4)}}function XM(D){return function($){return $==null?void 0:$[D]}}function gm(D){return function($){return IM($,D)}}function QM(D){return i0(D)?D:vy(D)}function fm(D){return function($){var U=v0($);if(U==F8)return UM($);if(U==I8)return ty($);return ry($,D($))}}function YM(D,$,U,I,F,J){var X=F&D4,Q=D.length,Y=$.length;if(Q!=Y&&!(X&&Y>Q))return!1;var W=J.get(D);if(W)return W==$;var B=-1,K=!0,q=F&l9?new i9:void 0;J.set(D,$);while(++B<Q){var H=D[B],G=$[B];if(I)var z=X?I(G,H,B,$,D,J):I(H,G,B,D,$,J);if(z!==void 0){if(z)continue;K=!1;break}if(q){if(!cy($,function(N,M){if(!q.has(M)&&(H===N||U(H,N,I,F,J)))return q.add(M)})){K=!1;break}}else if(!(H===G||U(H,G,I,F,J))){K=!1;break}}return J.delete(D),K}function ym(D,$,U,I,F,J,X){switch(U){case h9:if(D.byteLength!=$.byteLength||D.byteOffset!=$.byteOffset)return!1;D=D.buffer,$=$.buffer;case $M:if(D.byteLength!=$.byteLength||!I(new dZ(D),new dZ($)))return!1;return!0;case rZ:case oZ:return+D==+$;case tZ:return D.name==$.name&&D.message==$.message;case sZ:return D!=+D?$!=+$:D==+$;case eZ:case cI:return D==$+"";case F8:var Q=UM;case I8:var Y=J&D4;if(Q||(Q=oy),D.size!=$.size&&!Y)return!1;var W=X.get(D);if(W)return W==$;return J|=l9,X.set(D,$),YM(Q(D),Q($),I,F,J,X);case DM:if(xI)return xI.call(D)==xI.call($)}return!1}function mm(D,$,U,I,F,J){var X=F&D4,Q=lI(D),Y=Q.length,W=lI($),B=W.length;if(Y!=B&&!X)return!1;var K=Y;while(K--){var q=Q[K];if(!(X?q in $:JM($,q)))return!1}var H=J.get(D);if(H)return H==$;var G=!0;J.set(D,$);var z=X;while(++K<Y){q=Q[K];var N=D[q],M=$[q];if(I)var Z=X?I(M,N,q,$,D,J):I(N,M,q,D,$,J);if(!(Z===void 0?N===M||U(N,M,I,F,J):Z)){G=!1;break}z||(z=q=="constructor")}if(G&&!z){var L=D.constructor,v=$.constructor;if(L!=v&&(("constructor"in D)&&("constructor"in $))&&!(typeof L=="function"&&L instanceof L&&typeof v=="function"&&v instanceof v))G=!1}return J.delete(D),G}var hm=XM("length");function r9(D,$){var U=D.__data__;return cm($)?U[typeof $=="string"?"string":"hash"]:U.map}function nm(D){var $=Dh(D),U=$.length;while(U--)$[U][2]=BM($[U][1]);return $}function $4(D,$){var U=D[$];return tm(U)?U:void 0}function im(D){return $m(Object(D))}function v0(D){return k6.call(D)}if(mI&&v0(new mI(new ArrayBuffer(1)))!=h9||n9&&v0(new n9)!=F8||hI&&v0(hI.resolve())!=nZ||nI&&v0(new nI)!=I8||iI&&v0(new iI)!=fI)v0=function(D){var $=k6.call(D),U=$==a1?D.constructor:void 0,I=U?x6(U):void 0;if(I)switch(I){case Fm:return h9;case Im:return F8;case Jm:return nZ;case Xm:return I8;case Qm:return fI}return $};function lm(D,$,U){$=o9($,D)?[$]:QM($);var I,F=-1,X=$.length;while(++F<X){var J=t9($[F]);if(!(I=D!=null&&U(D,J)))break;D=D[J]}if(I)return I;var X=D?D.length:0;return!!X&&a9(X)&&WM(J,X)&&(i0(D)||NM(D)||GM(D))}function dm(D){var $=D?D.length:void 0;if(a9($)&&(i0(D)||NM(D)||GM(D)))return py($,String);return null}function WM(D,$){return $=$==null?pZ:$,!!$&&(typeof D=="number"||my.test(D))&&(D>-1&&D%1==0&&D<$)}function o9(D,$){if(i0(D))return!1;var U=typeof D;if(U=="number"||U=="symbol"||U=="boolean"||D==null||zM(D))return!0;return gy.test(D)||!xy.test(D)||$!=null&&D in Object($)}function cm(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}function pm(D){var $=D&&D.constructor,U=typeof $=="function"&&$.prototype||c9;return D===U}function BM(D){return D===D&&!s9(D)}function KM(D,$){return function(U){if(U==null)return!1;return U[D]===$&&($!==void 0||(D in Object(U)))}}function t9(D){if(typeof D=="string"||zM(D))return D;var $=D+"";return $=="0"&&1/D==-jy?"-0":$}function x6(D){if(D!=null){try{return FM.call(D)}catch($){}try{return D+""}catch($){}}return""}function rm(D,$){return D===$||D!==D&&$!==$}function GM(D){return om(D)&&P6.call(D,"callee")&&(!ey.call(D,"callee")||k6.call(D)==m9)}var i0=Array.isArray;function qM(D){return D!=null&&a9(hm(D))&&!HM(D)}function om(D){return Q8(D)&&qM(D)}function HM(D){var $=s9(D)?k6.call(D):"";return $==aZ||$==Ay}function a9(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=pZ}function s9(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Q8(D){return!!D&&typeof D=="object"}function tm(D){if(!s9(D))return!1;var $=HM(D)||yI(D)?sy:yy;return $.test(x6(D))}function NM(D){return typeof D=="string"||!i0(D)&&Q8(D)&&k6.call(D)==cI}function zM(D){return typeof D=="symbol"||Q8(D)&&k6.call(D)==DM}function am(D){return Q8(D)&&a9(D.length)&&!!CD[k6.call(D)]}function sm(D,$,U){var I=D==null?void 0:IM(D,$);return I===void 0?U:I}function em(D,$){return D!=null&&lm(D,$,bm)}function lI(D){var $=pm(D);if(!($||qM(D)))return km(D);var U=dm(D),I=!!U,F=U||[],J=F.length;for(var X in D)if(JM(D,X)&&!(I&&(X=="length"||WM(X,J)))&&!($&&X=="constructor"))F.push(X);return F}var Dh=fm(lI);function $h(D){return D}function Uh(D){return o9(D)?XM(t9(D)):gm(D)}s1.exports=um});var EM=C((F4,U4)=>{var Fh=1/0,Ih="[object Function]",Jh="[object GeneratorFunction]",Xh=/[\\^$.*+?()[\]{}|]/g,Qh=/^\[object .+?Constructor\]$/,Y8={function:!0,object:!0},Yh=Y8[typeof F4]&&F4&&!F4.nodeType?F4:void 0,Wh=Y8[typeof U4]&&U4&&!U4.nodeType?U4:void 0,Bh=e9(Yh&&Wh&&typeof global=="object"&&global),Kh=e9(Y8[typeof self]&&self),wM=e9(Y8[typeof window]&&window),rI=e9(Y8[typeof F4]&&F4),Gh=Bh||wM!==(rI&&rI.window)&&wM||Kh||rI||Function("return this")();function e9(D){return D&&D.Object===Object?D:null}function qh(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}function Hh(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=I}),U}var ZM=Object.prototype,MM=Function.prototype.toString,Nh=ZM.hasOwnProperty,zh=ZM.toString,Lh=RegExp("^"+MM.call(Nh).replace(Xh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oI=Zh(Gh,"Set"),wh=!(oI&&1/Hh(new oI([,-0]))[1]==Fh)?vh:function(D){return new oI(D)};function Zh(D,$){var U=D[$];return Eh(U)?U:void 0}function Mh(D){if(D!=null){try{return MM.call(D)}catch($){}try{return D+""}catch($){}}return""}function Oh(D){var $=OM(D)?zh.call(D):"";return $==Ih||$==Jh}function OM(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Eh(D){if(!OM(D))return!1;var $=Oh(D)||qh(D)?Lh:Qh;return $.test(Mh(D))}function vh(){}U4.exports=wh});var VM=C((J4,I4)=>{var W8={function:!0,object:!0},Vh=W8[typeof J4]&&J4&&!J4.nodeType?J4:void 0,jh=W8[typeof I4]&&I4&&!I4.nodeType?I4:void 0,Ah=D5(Vh&&jh&&typeof global=="object"&&global),Rh=D5(W8[typeof self]&&self),vM=D5(W8[typeof window]&&window),tI=D5(W8[typeof J4]&&J4),Sh=Ah||vM!==(tI&&tI.window)&&vM||Rh||tI||Function("return this")();function D5(D){return D&&D.Object===Object?D:null}I4.exports=Sh});var bM=C((J5D,TM)=>{var Th=EM(),bh=VM(),Ph=200,aI="__lodash_hash_undefined__",Ch="[object Function]",uh="[object GeneratorFunction]",kh=/[\\^$.*+?()[\]{}|]/g,_h=/^\[object .+?Constructor\]$/;function xh(D,$){return!!D.length&&fh(D,$,0)>-1}function gh(D,$,U){var I=-1,F=D.length;while(++I<F)if(U($,D[I]))return!0;return!1}function fh(D,$,U){if($!==$)return mh(D,U);var I=U-1,F=D.length;while(++I<F)if(D[I]===$)return I;return-1}function yh(D,$){return D.has($)}function mh(D,$,U){var I=D.length,F=$+(U?0:-1);while(U?F--:++F<I){var J=D[F];if(J!==J)return F}return-1}function hh(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch(U){}return $}function nh(D){var $=-1,U=Array(D.size);return D.forEach(function(I){U[++$]=I}),U}var ih=Array.prototype,jM=Object.prototype,AM=Function.prototype.toString,sI=jM.hasOwnProperty,lh=jM.toString,dh=RegExp("^"+AM.call(sI).replace(kh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ch=ih.splice,ph=RM(bh,"Map"),B8=RM(Object,"create");function g6(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function rh(){this.__data__=B8?B8(null):{}}function oh(D){return this.has(D)&&delete this.__data__[D]}function th(D){var $=this.__data__;if(B8){var U=$[D];return U===aI?void 0:U}return sI.call($,D)?$[D]:void 0}function ah(D){var $=this.__data__;return B8?$[D]!==void 0:sI.call($,D)}function sh(D,$){var U=this.__data__;return U[D]=B8&&$===void 0?aI:$,this}g6.prototype.clear=rh;g6.prototype.delete=oh;g6.prototype.get=th;g6.prototype.has=ah;g6.prototype.set=sh;function X4(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function eh(){this.__data__=[]}function Dn(D){var $=this.__data__,U=U5($,D);if(U<0)return!1;var I=$.length-1;if(U==I)$.pop();else ch.call($,U,1);return!0}function $n(D){var $=this.__data__,U=U5($,D);return U<0?void 0:$[U][1]}function Un(D){return U5(this.__data__,D)>-1}function Fn(D,$){var U=this.__data__,I=U5(U,D);if(I<0)U.push([D,$]);else U[I][1]=$;return this}X4.prototype.clear=eh;X4.prototype.delete=Dn;X4.prototype.get=$n;X4.prototype.has=Un;X4.prototype.set=Fn;function Q4(D){var $=-1,U=D?D.length:0;this.clear();while(++$<U){var I=D[$];this.set(I[0],I[1])}}function In(){this.__data__={hash:new g6,map:new(ph||X4),string:new g6}}function Jn(D){return F5(this,D).delete(D)}function Xn(D){return F5(this,D).get(D)}function Qn(D){return F5(this,D).has(D)}function Yn(D,$){return F5(this,D).set(D,$),this}Q4.prototype.clear=In;Q4.prototype.delete=Jn;Q4.prototype.get=Xn;Q4.prototype.has=Qn;Q4.prototype.set=Yn;function $5(D){var $=-1,U=D?D.length:0;this.__data__=new Q4;while(++$<U)this.add(D[$])}function Wn(D){return this.__data__.set(D,aI),this}function Bn(D){return this.__data__.has(D)}$5.prototype.add=$5.prototype.push=Wn;$5.prototype.has=Bn;function U5(D,$){var U=D.length;while(U--)if(Hn(D[U][0],$))return U;return-1}function Kn(D,$,U){var I=-1,F=xh,J=D.length,X=!0,Q=[],Y=Q;if(U)X=!1,F=gh;else if(J>=Ph){var W=$?null:Th(D);if(W)return nh(W);X=!1,F=yh,Y=new $5}else Y=$?[]:Q;D:while(++I<J){var B=D[I],K=$?$(B):B;if(B=U||B!==0?B:0,X&&K===K){var q=Y.length;while(q--)if(Y[q]===K)continue D;if($)Y.push(K);Q.push(B)}else if(!F(Y,K,U)){if(Y!==Q)Y.push(K);Q.push(B)}}return Q}function F5(D,$){var U=D.__data__;return Gn($)?U[typeof $=="string"?"string":"hash"]:U.map}function RM(D,$){var U=D[$];return zn(U)?U:void 0}function Gn(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}function qn(D){if(D!=null){try{return AM.call(D)}catch($){}try{return D+""}catch($){}}return""}function Hn(D,$){return D===$||D!==D&&$!==$}function Nn(D){var $=SM(D)?lh.call(D):"";return $==Ch||$==uh}function SM(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function zn(D){if(!SM(D))return!1;var $=Nn(D)||hh(D)?dh:_h;return $.test(qn(D))}TM.exports=Kn});var CM=C((X5D,PM)=>{var Ln=LM(),wn=bM();function Zn(D,$){return D&&D.length?wn(D,Ln($)):[]}PM.exports=Zn});var kM=C((Q5D,uM)=>{var Mn=TZ(),On=CM(),En=Mn("MultiError");uM.exports=eI;function eI(D){if(!(this instanceof eI))return new eI(D);if(D=Array.isArray(D)?D:[D],D=On(D,function(U){return U.stack}),D.length===1)return D[0];var $=new En({message:D.map(function(U){return U.message}).join("; "),errors:D.reduce(function(U,I){return U.concat(I.errors||I)},[])});return $.__defineGetter__("stack",function(){return D.map(function(U){return U.stack}).join(`
|
|
85
85
|
|
|
86
86
|
`)}),$.__defineSetter__("stack",function(U){return[U].concat($.stack).join(`
|
|
87
87
|
|
|
88
|
-
`)}),$}});var xM=C((
|
|
89
|
-
GFS4: `),console.error(D)};if(!fD[$$]){if(DJ=global[$$]||[],iM(fD,DJ),fD.close=function(D){function $(U,I){return D.call(fD,U,function(F){if(!F)nM();if(typeof I==="function")I.apply(this,arguments)})}return Object.defineProperty($,Y5,{value:D}),$}(fD.close),fD.closeSync=function(D){function $(U){D.apply(fD,arguments),nM()}return Object.defineProperty($,Y5,{value:D}),$}(fD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){f6(fD[$$]),o("assert").equal(fD[$$].length,0)})}var DJ;if(!global[$$])iM(global,fD[$$]);FJ.exports=$J(Pn(fD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!fD.__patched)FJ.exports=$J(fD),fD.__patched=!0;function $J(D){Tn(D),D.gracefulify=$J,D.createReadStream=A,D.createWriteStream=V;var $=D.readFile;D.readFile=U;function U(_,n,m){if(typeof n==="function")m=n,n=null;return UD(_,n,m);function UD(s,a,DD,E){return $(s,a,function(w){if(w&&(w.code==="EMFILE"||w.code==="ENFILE"))Y4([UD,[s,a,DD],w,E||Date.now(),Date.now()]);else if(typeof DD==="function")DD.apply(this,arguments)})}}var I=D.writeFile;D.writeFile=F;function F(_,n,m,UD){if(typeof m==="function")UD=m,m=null;return s(_,n,m,UD);function s(a,DD,E,w,O){return I(a,DD,E,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var J=D.appendFile;if(J)D.appendFile=X;function X(_,n,m,UD){if(typeof m==="function")UD=m,m=null;return s(_,n,m,UD);function s(a,DD,E,w,O){return J(a,DD,E,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var Q=D.copyFile;if(Q)D.copyFile=Y;function Y(_,n,m,UD){if(typeof m==="function")UD=m,m=0;return s(_,n,m,UD);function s(a,DD,E,w,O){return Q(a,DD,E,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var W=D.readdir;D.readdir=K;var B=/^v[0-5]\./;function K(_,n,m){if(typeof n==="function")m=n,n=null;var UD=B.test(process.version)?function(DD,E,w,O){return W(DD,s(DD,E,w,O))}:function(DD,E,w,O){return W(DD,E,s(DD,E,w,O))};return UD(_,n,m);function s(a,DD,E,w){return function(O,S){if(O&&(O.code==="EMFILE"||O.code==="ENFILE"))Y4([UD,[a,DD,E],O,w||Date.now(),Date.now()]);else{if(S&&S.sort)S.sort();if(typeof E==="function")E.call(this,O,S)}}}}if(process.version.substr(0,4)==="v0.8"){var q=bn(D);M=q.ReadStream,L=q.WriteStream}var H=D.ReadStream;if(H)M.prototype=Object.create(H.prototype),M.prototype.open=Z;var G=D.WriteStream;if(G)L.prototype=Object.create(G.prototype),L.prototype.open=v;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});var z=M;Object.defineProperty(D,"FileReadStream",{get:function(){return z},set:function(_){z=_},enumerable:!0,configurable:!0});var N=L;Object.defineProperty(D,"FileWriteStream",{get:function(){return N},set:function(_){N=_},enumerable:!0,configurable:!0});function M(_,n){if(this instanceof M)return H.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function Z(){var _=this;y(_.path,_.flags,_.mode,function(n,m){if(n){if(_.autoClose)_.destroy();_.emit("error",n)}else _.fd=m,_.emit("open",m),_.read()})}function L(_,n){if(this instanceof L)return G.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function v(){var _=this;y(_.path,_.flags,_.mode,function(n,m){if(n)_.destroy(),_.emit("error",n);else _.fd=m,_.emit("open",m)})}function A(_,n){return new D.ReadStream(_,n)}function V(_,n){return new D.WriteStream(_,n)}var b=D.open;D.open=y;function y(_,n,m,UD){if(typeof m==="function")UD=m,m=null;return s(_,n,m,UD);function s(a,DD,E,w,O){return b(a,DD,E,function(S,k){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}return D}function Y4(D){f6("ENQUEUE",D[0].name,D[1]),fD[$$].push(D),UJ()}var Q5;function nM(){var D=Date.now();for(var $=0;$<fD[$$].length;++$)if(fD[$$][$].length>2)fD[$$][$][3]=D,fD[$$][$][4]=D;UJ()}function UJ(){if(clearTimeout(Q5),Q5=void 0,fD[$$].length===0)return;var D=fD[$$].shift(),$=D[0],U=D[1],I=D[2],F=D[3],J=D[4];if(F===void 0)f6("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-F>=60000){f6("TIMEOUT",$.name,U);var X=U.pop();if(typeof X==="function")X.call(null,I)}else{var Q=Date.now()-J,Y=Math.max(J-F,1),W=Math.min(Y*1.2,100);if(Q>=W)f6("RETRY",$.name,U),$.apply(null,U.concat([F]));else fD[$$].push(D)}if(Q5===void 0)Q5=setTimeout(UJ,0)}});var dM=C((K5D,lM)=>{function d$(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}lM.exports=d$;d$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};d$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};d$.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var I=this,F=setTimeout(function(){if(I._attempts++,I._operationTimeoutCb){if(I._timeout=setTimeout(function(){I._operationTimeoutCb(I._attempts)},I._operationTimeout),I._options.unref)I._timeout.unref()}I._fn(I._attempts)},U);if(this._options.unref)F.unref();return!0};d$.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};d$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};d$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};d$.prototype.start=d$.prototype.try;d$.prototype.errors=function(){return this._errors};d$.prototype.attempts=function(){return this._attempts};d$.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var I=0;I<this._errors.length;I++){var F=this._errors[I],J=F.message,X=(D[J]||0)+1;if(D[J]=X,X>=U)$=F,U=X}return $}});var pM=C((kn)=>{var un=dM();kn.operation=function(D){var $=kn.timeouts(D);return new un($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};kn.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var I=[];for(var F=0;F<$.retries;F++)I.push(this.createTimeout(F,$));if(D&&D.forever&&!I.length)I.push(this.createTimeout(F,$));return I.sort(function(J,X){return J-X}),I};kn.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,I=Math.round(U*$.minTimeout*Math.pow($.factor,D));return I=Math.min(I,$.maxTimeout),I};kn.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var I in D)if(typeof D[I]==="function")U.push(I)}for(var F=0;F<U.length;F++){var J=U[F],X=D[J];D[J]=function(Y){var W=kn.operation($),B=Array.prototype.slice.call(arguments,1),K=B.pop();B.push(function(q){if(W.retry(q))return;if(q)arguments[0]=W.mainError();K.apply(this,arguments)}),W.attempt(function(){Y.apply(D,B)})}.bind(D,X),D[J].options=$}}});var rM=C((q5D,W5)=>{W5.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")W5.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")W5.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var YJ=C((H5D,B4)=>{var kD=global.process,y6=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!y6(kD))B4.exports=function(){return function(){}};else{if(IJ=o("assert"),m6=rM(),JJ=/^win/i.test(kD.platform),W4=o("events"),typeof W4!=="function")W4=W4.EventEmitter;if(kD.__signal_exit_emitter__)pD=kD.__signal_exit_emitter__;else pD=kD.__signal_exit_emitter__=new W4,pD.count=0,pD.emitted={};if(!pD.infinite)pD.setMaxListeners(1/0),pD.infinite=!0;B4.exports=function(D,$){if(!y6(global.process))return function(){};if(IJ.equal(typeof D,"function","a callback must be provided for exit handler"),h6===!1)B5();var U="exit";if($&&$.alwaysLast)U="afterexit";var I=function(){if(pD.removeListener(U,D),pD.listeners("exit").length===0&&pD.listeners("afterexit").length===0)K8()};return pD.on(U,D),I},K8=function(){if(!h6||!y6(global.process))return;h6=!1,m6.forEach(function($){try{kD.removeListener($,G8[$])}catch(U){}}),kD.emit=q8,kD.reallyExit=K5,pD.count-=1},B4.exports.unload=K8,c0=function($,U,I){if(pD.emitted[$])return;pD.emitted[$]=!0,pD.emit($,U,I)},G8={},m6.forEach(function(D){G8[D]=function(){if(!y6(global.process))return;var U=kD.listeners(D);if(U.length===pD.count){if(K8(),c0("exit",null,D),c0("afterexit",null,D),JJ&&D==="SIGHUP")D="SIGINT";kD.kill(kD.pid,D)}}}),B4.exports.signals=function(){return m6},h6=!1,B5=function(){if(h6||!y6(global.process))return;h6=!0,pD.count+=1,m6=m6.filter(function($){try{return kD.on($,G8[$]),!0}catch(U){return!1}}),kD.emit=QJ,kD.reallyExit=XJ},B4.exports.load=B5,K5=kD.reallyExit,XJ=function($){if(!y6(global.process))return;kD.exitCode=$||0,c0("exit",kD.exitCode,null),c0("afterexit",kD.exitCode,null),K5.call(kD,kD.exitCode)},q8=kD.emit,QJ=function($,U){if($==="exit"&&y6(global.process)){if(U!==void 0)kD.exitCode=U;var I=q8.apply(this,arguments);return c0("exit",kD.exitCode,null),c0("afterexit",kD.exitCode,null),I}else return q8.apply(this,arguments)}}var IJ,m6,JJ,W4,pD,K8,c0,G8,h6,B5,K5,XJ,q8,QJ});var tM=C((mn,WJ)=>{var oM=Symbol();function fn(D,$,U){let I=$[oM];if(I)return $.stat(D,(J,X)=>{if(J)return U(J);U(null,X.mtime,I)});let F=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,F,F,(J)=>{if(J)return U(J);$.stat(D,(X,Q)=>{if(X)return U(X);let Y=Q.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,oM,{value:Y}),U(null,Q.mtime,Y)})})}function yn(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}mn.probe=fn;mn.getMtime=yn});var $O=C((tn,N8)=>{var ln=o("path"),GJ=d0(),dn=pM(),cn=YJ(),aM=tM(),A0={};function H8(D,$){return $.lockfilePath||`${D}.lock`}function qJ(D,$,U){if(!$.realpath)return U(null,ln.resolve(D));$.fs.realpath(D,U)}function KJ(D,$,U){let I=H8(D,$);$.fs.mkdir(I,(F)=>{if(!F)return aM.probe(I,$.fs,(J,X,Q)=>{if(J)return $.fs.rmdir(I,()=>{}),U(J);U(null,X,Q)});if(F.code!=="EEXIST")return U(F);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(I,(J,X)=>{if(J){if(J.code==="ENOENT")return KJ(D,{...$,stale:0},U);return U(J)}if(!sM(X,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));eM(D,$,(Q)=>{if(Q)return U(Q);KJ(D,{...$,stale:0},U)})})})}function sM(D,$){return D.mtime.getTime()<Date.now()-$.stale}function eM(D,$,U){$.fs.rmdir(H8(D,$),(I)=>{if(I&&I.code!=="ENOENT")return U(I);U()})}function G5(D,$){let U=A0[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(I,F)=>{let J=U.lastUpdate+$.stale<Date.now();if(I){if(I.code==="ENOENT"||J)return BJ(D,U,Object.assign(I,{code:"ECOMPROMISED"}));return U.updateDelay=1000,G5(D,$)}if(U.mtime.getTime()!==F.mtime.getTime())return BJ(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let Q=aM.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,Q,Q,(Y)=>{let W=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(Y){if(Y.code==="ENOENT"||W)return BJ(D,U,Object.assign(Y,{code:"ECOMPROMISED"}));return U.updateDelay=1000,G5(D,$)}U.mtime=Q,U.lastUpdate=Date.now(),U.updateDelay=null,G5(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function BJ(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(A0[D]===$)delete A0[D];$.options.onCompromised(U)}function pn(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:GJ,onCompromised:(I)=>{throw I},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),qJ(D,$,(I,F)=>{if(I)return U(I);let J=dn.operation($.retries);J.attempt(()=>{KJ(F,$,(X,Q,Y)=>{if(J.retry(X))return;if(X)return U(J.mainError());let W=A0[F]={lockfilePath:H8(F,$),mtime:Q,mtimePrecision:Y,options:$,lastUpdate:Date.now()};G5(F,$),U(null,(B)=>{if(W.released)return B&&B(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));DO(F,{...$,realpath:!1},B)})})})})}function DO(D,$,U){$={fs:GJ,realpath:!0,...$},qJ(D,$,(I,F)=>{if(I)return U(I);let J=A0[F];if(!J)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));J.updateTimeout&&clearTimeout(J.updateTimeout),J.released=!0,delete A0[F],eM(F,$,U)})}function rn(D,$,U){$={stale:1e4,realpath:!0,fs:GJ,...$},$.stale=Math.max($.stale||0,2000),qJ(D,$,(I,F)=>{if(I)return U(I);$.fs.stat(H8(F,$),(J,X)=>{if(J)return J.code==="ENOENT"?U(null,!1):U(J);return U(null,!sM(X,$))})})}function on(){return A0}cn(()=>{for(let D in A0){let $=A0[D].options;try{$.fs.rmdirSync(H8(D,$))}catch(U){}}});tn.lock=pn;tn.unlock=DO;tn.check=rn;tn.getLocks=on});var FO=C((N5D,UO)=>{var $i=d0();function Ui(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((I)=>{U[I]=(...F)=>{let J=F.pop(),X;try{X=D[`${I}Sync`](...F)}catch(Q){return J(Q)}J(null,X)}}),U}function Fi(D){return(...$)=>new Promise((U,I)=>{$.push((F,J)=>{if(F)I(F);else U(J)}),D(...$)})}function Ii(D){return(...$)=>{let U,I;if($.push((F,J)=>{U=F,I=J}),D(...$),U)throw U;return I}}function Ji(D){if(D={...D},D.fs=Ui(D.fs||$i),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}UO.exports={toPromise:Fi,toSync:Ii,toSyncOptions:Ji}});var JO=C((z5D,p0)=>{var K4=$O(),{toPromise:q5,toSync:H5,toSyncOptions:HJ}=FO();async function IO(D,$){let U=await q5(K4.lock)(D,$);return q5(U)}function Xi(D,$){let U=H5(K4.lock)(D,HJ($));return H5(U)}function Qi(D,$){return q5(K4.unlock)(D,$)}function Yi(D,$){return H5(K4.unlock)(D,HJ($))}function Wi(D,$){return q5(K4.check)(D,$)}function Bi(D,$){return H5(K4.check)(D,HJ($))}p0.exports=IO;p0.exports.lock=IO;p0.exports.unlock=Qi;p0.exports.lockSync=Xi;p0.exports.unlockSync=Yi;p0.exports.check=Wi;p0.exports.checkSync=Bi});var GO=C((BO)=>{Object.defineProperty(BO,"__esModule",{value:!0});BO.canStoreURLs=BO.FileUrlStorage=void 0;var XO=o("fs"),Ki=qi(kM()),QO=Gi(JO());function WO(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(WO=function(I){return I?U:$})(D)}function Gi(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=WO($);if(U&&U.has(D))return U.get(D);var I={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in D)if(J!=="default"&&{}.hasOwnProperty.call(D,J)){var X=F?Object.getOwnPropertyDescriptor(D,J):null;X&&(X.get||X.set)?Object.defineProperty(I,J,X):I[J]=D[J]}return I.default=D,U&&U.set(D,I),I}function qi(D){return D&&D.__esModule?D:{default:D}}function z8(D){return z8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},z8(D)}function Hi(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function YO(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,zi(I.key),I)}}function Ni(D,$,U){if($)YO(D.prototype,$);if(U)YO(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function zi(D){var $=Li(D,"string");return z8($)=="symbol"?$:$+""}function Li(D,$){if(z8(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(z8(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var L5D=BO.canStoreURLs=!0,w5D=BO.FileUrlStorage=function(){function D($){Hi(this,D),this.path=$}return Ni(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(I,F){U._getItems("tus::",function(J,X){if(J)F(J);else I(X)})})}},{key:"findUploadsByFingerprint",value:function(U){var I=this;return new Promise(function(F,J){I._getItems("tus::".concat(U),function(X,Q){if(X)J(X);else F(Q)})})}},{key:"removeUpload",value:function(U){var I=this;return new Promise(function(F,J){I._removeItem(U,function(X){if(X)J(X);else F()})})}},{key:"addUpload",value:function(U,I){var F=this,J=Math.round(Math.random()*1000000000000),X="tus::".concat(U,"::").concat(J);return new Promise(function(Q,Y){F._setItem(X,I,function(W){if(W)Y(W);else Q(X)})})}},{key:"_setItem",value:function(U,I,F){var J=this;QO.lock(this.path,this._lockfileOptions()).then(function(X){F=J._releaseAndCb(X,F),J._getData(function(Q,Y){if(Q){F(Q);return}Y[U]=I,J._writeData(Y,function(W){return F(W)})})}).catch(F)}},{key:"_getItems",value:function(U,I){this._getData(function(F,J){if(F){I(F);return}var X=Object.keys(J).filter(function(Q){return Q.startsWith(U)}).map(function(Q){var Y=J[Q];return Y.urlStorageKey=Q,Y});I(null,X)})}},{key:"_removeItem",value:function(U,I){var F=this;QO.lock(this.path,this._lockfileOptions()).then(function(J){I=F._releaseAndCb(J,I),F._getData(function(X,Q){if(X){I(X);return}delete Q[U],F._writeData(Q,function(Y){return I(Y)})})}).catch(I)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,I){return function(F){if(F){U().then(function(){return I(F)}).catch(function(J){return I((0,Ki.default)([F,J]))});return}U().then(I).catch(I)}}},{key:"_writeData",value:function(U,I){var F={encoding:"utf8",mode:432,flag:"w"};(0,XO.writeFile)(this.path,JSON.stringify(U),F,function(J){return I(J)})}},{key:"_getData",value:function(U){(0,XO.readFile)(this.path,"utf8",function(I,F){if(I){if(I.code==="ENOENT")U(null,{});else U(I);return}try{F=!F.trim().length?{}:JSON.parse(F)}catch(J){U(J);return}U(null,F)})}}])}()});var vO=C((r0)=>{Object.defineProperty(r0,"__esModule",{value:!0});Object.defineProperty(r0,"DefaultHttpStack",{enumerable:!0,get:function(){return zO.default}});Object.defineProperty(r0,"DetailedError",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(r0,"FileUrlStorage",{enumerable:!0,get:function(){return LO.FileUrlStorage}});Object.defineProperty(r0,"StreamSource",{enumerable:!0,get:function(){return Vi.default}});r0.Upload=void 0;Object.defineProperty(r0,"canStoreURLs",{enumerable:!0,get:function(){return LO.canStoreURLs}});r0.defaultOptions=void 0;Object.defineProperty(r0,"enableDebugLog",{enumerable:!0,get:function(){return Mi.enableDebugLog}});r0.isSupported=void 0;var Zi=n6(qI()),Mi=HI(),Oi=n6(Jw()),NJ=n6(fw()),Ei=n6(IZ()),vi=n6(WZ()),zO=n6(jZ()),Vi=n6(jI()),LO=GO();function n6(D){return D&&D.__esModule?D:{default:D}}function q4(D){return q4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},q4(D)}function ji(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function qO(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,ZO(I.key),I)}}function Ai(D,$,U){if($)qO(D.prototype,$);if(U)qO(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Ri(D,$,U){return $=N5($),Si(D,wO()?Reflect.construct($,U||[],N5(D).constructor):$.apply(D,U))}function Si(D,$){if($&&(q4($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Ti(D)}function Ti(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function wO(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(wO=function(){return!!D})()}function N5(D){return N5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},N5(D)}function bi(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)zJ(D,$)}function zJ(D,$){return zJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,F){return I.__proto__=F,I},zJ(D,$)}function HO(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function G4(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?HO(Object(U),!0).forEach(function(I){Pi(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):HO(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function Pi(D,$,U){if($=ZO($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function ZO(D){var $=Ci(D,"string");return q4($)=="symbol"?$:$+""}function Ci(D,$){if(q4(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(q4(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var NO=r0.defaultOptions=G4(G4({},NJ.default.defaultOptions),{},{httpStack:new zO.default,fileReader:new Ei.default,urlStorage:new Oi.default,fingerprint:vi.default}),M5D=r0.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ji(this,$),I=G4(G4({},NO),I),Ri(this,$,[U,I])}return bi($,D),Ai($,null,[{key:"terminate",value:function(I){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F=G4(G4({},NO),F),NJ.default.terminate(I,F)}}])}(NJ.default),O5D=r0.isSupported=!0});import{execFileSync as gi}from"child_process";import fi from"path";function _i(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function xi(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function hi(D,$){let U=[],I=jO($.command);for(let F of D)for(let J of F.process??[]){if(!J.pattern.test(I))continue;U.push(ni(F,J,{...$,command:I}))}return U}function ni(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function VO(D,$){try{return gi("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function jO(D){return fi.basename(D.trim()).replace(/^-+/,"")}function AO(D={}){let $=D.agents??ui,U=D.strategies??ii(D.experimentalProcessTree),I={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},F=U.flatMap((X)=>X.detect(I)),J=li($,F,I.env);if(J===void 0)return{detected:!1};return{detected:!0,agent:J}}function ii(D=!1){let $=[new ki];if(D)$.push(new mi);return $}function li(D,$,U){let I=new Set($.map((F)=>F.agent.id));for(let F of D){if(!I.has(F.id))continue;return{id:F.id,name:F.name,...di(F,U)}}return}function di(D,$){for(let U of D.sessionEnv??[]){let I=$[U];if(I!==void 0&&I.length>0)return{sessionId:I}}return{}}var ui,ki=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let I of U.env??[]){let F=D.env[I.name];if(F===void 0||!_i(F,I.value))continue;$.push(xi(U,I,F))}return $}},yi=class{read(D){let $=VO(D,"comm"),U=Number.parseInt(VO(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:jO($)}}},mi=class{constructor(D=new yi){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let I=0;I<D.maxProcessDepth;I+=1){let F=this.reader.read(U);if(F===void 0)break;if($.push(...hi(D.agents,F)),F.ppid===void 0||F.ppid<=1||F.ppid===U)break;U=F.ppid}return $}};var RO=T(()=>{ui=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as ci,release as pi}from"node:os";import{arch as ri,env as oi,version as ti}from"node:process";function u5D(D){LJ=D}function k5D(){return LJ}function SO(D=oi){let $=AO({env:D}),U={cli_version:t$.version,node_version:ti,os_platform:ci(),os_arch:ri,os_release:pi(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:L8.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:LJ,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(L8.name)U.ci_provider=L8.name;return U}var L8,LJ="cli";var TO=T(()=>{RO();A1();L8=h$(XI(),1)});import{AsyncLocalStorage as ai}from"node:async_hooks";function g5D(D,$){return PO.run(D,()=>Promise.resolve($()))}function si(){return PO.getStore()}function f5D(){CO=!0}function uO(){return CO}function y5D(D){kO=D}function bO(D){try{kO?.(D)}catch{}}function h5D(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let I="/functions/v1/",F=U.indexOf(I);if(F>=0){let W=U.slice(F+I.length),B=0,K=W.length;while(B<K&&W[B]==="/")B+=1;while(K>B&&W[K-1]==="/")K-=1;let q=W.slice(B,K);return q?`${$} functions:${q}`:`${$} functions`}let J="/rest/v1/",X=U.indexOf(J),Q=X>=0?U.slice(X+J.length):U.replace(/^\//,"");if(Q.startsWith("rpc/"))return`rpc:${Q.slice(4).split("/")[0]}`;let Y=Q.split("/")[0]||U;return`${$} ${Y}`}function ei(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([I])=>I.toLowerCase()==="capgkey")?.[1];return $.capgkey}function _O(){return async($,U)=>{let I=(U?.method??"GET").toUpperCase(),F=typeof $==="string"?$:$ instanceof URL?$.href:$.url,J=si(),X=ei(U),Q=Date.now();try{let Y=await globalThis.fetch($,U);return bO({url:F,method:I,status:Y.status,ok:Y.ok,durationMs:Date.now()-Q,source:J,apikey:X}),Y}catch(Y){throw bO({url:F,method:I,status:0,ok:!1,durationMs:Date.now()-Q,source:J,apikey:X,error:Y}),Y}}}var PO,CO=!1,kO,m5D=5000;var xO=T(()=>{PO=new ai});function Dl(D,$){if(!P2(D)||!P2($))return!1;return O6(s$(D),s$($))}function $l(D,$,U){let I=U?.trim()?`
|
|
88
|
+
`)}),$}});var xM=C((Y5D,_M)=>{var l0=o("constants"),vn=process.cwd,I5=null,Vn=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!I5)I5=vn.call(process);return I5};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(J5=process.chdir,process.chdir=function(D){I5=null,J5.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,J5)}var J5;_M.exports=jn;function jn(D){if(l0.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)U(D);if(D.chown=J(D.chown),D.fchown=J(D.fchown),D.lchown=J(D.lchown),D.chmod=I(D.chmod),D.fchmod=I(D.fchmod),D.lchmod=I(D.lchmod),D.chownSync=X(D.chownSync),D.fchownSync=X(D.fchownSync),D.lchownSync=X(D.lchownSync),D.chmodSync=F(D.chmodSync),D.fchmodSync=F(D.fchmodSync),D.lchmodSync=F(D.lchmodSync),D.stat=Q(D.stat),D.fstat=Q(D.fstat),D.lstat=Q(D.lstat),D.statSync=Y(D.statSync),D.fstatSync=Y(D.fstatSync),D.lstatSync=Y(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(B,K,q){if(q)process.nextTick(q)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(B,K,q,H){if(H)process.nextTick(H)},D.lchownSync=function(){};if(Vn==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(B){function K(q,H,G){var z=Date.now(),N=0;B(q,H,function M(Z){if(Z&&(Z.code==="EACCES"||Z.code==="EPERM"||Z.code==="EBUSY")&&Date.now()-z<60000){if(setTimeout(function(){D.stat(H,function(L,v){if(L&&L.code==="ENOENT")B(q,H,M);else G(Z)})},N),N<100)N+=10;return}if(G)G(Z)})}if(Object.setPrototypeOf)Object.setPrototypeOf(K,B);return K}(D.rename);D.read=typeof D.read!=="function"?D.read:function(B){function K(q,H,G,z,N,M){var Z;if(M&&typeof M==="function"){var L=0;Z=function(v,A,V){if(v&&v.code==="EAGAIN"&&L<10)return L++,B.call(D,q,H,G,z,N,Z);M.apply(this,arguments)}}return B.call(D,q,H,G,z,N,Z)}if(Object.setPrototypeOf)Object.setPrototypeOf(K,B);return K}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(B){return function(K,q,H,G,z){var N=0;while(!0)try{return B.call(D,K,q,H,G,z)}catch(M){if(M.code==="EAGAIN"&&N<10){N++;continue}throw M}}}(D.readSync);function $(B){B.lchmod=function(K,q,H){B.open(K,l0.O_WRONLY|l0.O_SYMLINK,q,function(G,z){if(G){if(H)H(G);return}B.fchmod(z,q,function(N){B.close(z,function(M){if(H)H(N||M)})})})},B.lchmodSync=function(K,q){var H=B.openSync(K,l0.O_WRONLY|l0.O_SYMLINK,q),G=!0,z;try{z=B.fchmodSync(H,q),G=!1}finally{if(G)try{B.closeSync(H)}catch(N){}else B.closeSync(H)}return z}}function U(B){if(l0.hasOwnProperty("O_SYMLINK")&&B.futimes)B.lutimes=function(K,q,H,G){B.open(K,l0.O_SYMLINK,function(z,N){if(z){if(G)G(z);return}B.futimes(N,q,H,function(M){B.close(N,function(Z){if(G)G(M||Z)})})})},B.lutimesSync=function(K,q,H){var G=B.openSync(K,l0.O_SYMLINK),z,N=!0;try{z=B.futimesSync(G,q,H),N=!1}finally{if(N)try{B.closeSync(G)}catch(M){}else B.closeSync(G)}return z};else if(B.futimes)B.lutimes=function(K,q,H,G){if(G)process.nextTick(G)},B.lutimesSync=function(){}}function I(B){if(!B)return B;return function(K,q,H){return B.call(D,K,q,function(G){if(W(G))G=null;if(H)H.apply(this,arguments)})}}function F(B){if(!B)return B;return function(K,q){try{return B.call(D,K,q)}catch(H){if(!W(H))throw H}}}function J(B){if(!B)return B;return function(K,q,H,G){return B.call(D,K,q,H,function(z){if(W(z))z=null;if(G)G.apply(this,arguments)})}}function X(B){if(!B)return B;return function(K,q,H){try{return B.call(D,K,q,H)}catch(G){if(!W(G))throw G}}}function Q(B){if(!B)return B;return function(K,q,H){if(typeof q==="function")H=q,q=null;function G(z,N){if(N){if(N.uid<0)N.uid+=4294967296;if(N.gid<0)N.gid+=4294967296}if(H)H.apply(this,arguments)}return q?B.call(D,K,q,G):B.call(D,K,G)}}function Y(B){if(!B)return B;return function(K,q){var H=q?B.call(D,K,q):B.call(D,K);if(H){if(H.uid<0)H.uid+=4294967296;if(H.gid<0)H.gid+=4294967296}return H}}function W(B){if(!B)return!0;if(B.code==="ENOSYS")return!0;var K=!process.getuid||process.getuid()!==0;if(K){if(B.code==="EINVAL"||B.code==="EPERM")return!0}return!1}}});var yM=C((W5D,fM)=>{var gM=o("stream").Stream;fM.exports=An;function An(D){return{ReadStream:$,WriteStream:U};function $(I,F){if(!(this instanceof $))return new $(I,F);gM.call(this);var J=this;this.path=I,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,F=F||{};var X=Object.keys(F);for(var Q=0,Y=X.length;Q<Y;Q++){var W=X[Q];this[W]=F[W]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){J._read()});return}D.open(this.path,this.flags,this.mode,function(B,K){if(B){J.emit("error",B),J.readable=!1;return}J.fd=K,J.emit("open",K),J._read()})}function U(I,F){if(!(this instanceof U))return new U(I,F);gM.call(this),this.path=I,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,F=F||{};var J=Object.keys(F);for(var X=0,Q=J.length;X<Q;X++){var Y=J[X];this[Y]=F[Y]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var hM=C((B5D,mM)=>{mM.exports=Sn;var Rn=Object.getPrototypeOf||function(D){return D.__proto__};function Sn(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:Rn(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(U){Object.defineProperty($,U,Object.getOwnPropertyDescriptor(D,U))}),$}});var d0=C((K5D,FJ)=>{var fD=o("fs"),Tn=xM(),bn=yM(),Pn=hM(),X5=o("util"),$$,Y5;if(typeof Symbol==="function"&&typeof Symbol.for==="function")$$=Symbol.for("graceful-fs.queue"),Y5=Symbol.for("graceful-fs.previous");else $$="___graceful-fs.queue",Y5="___graceful-fs.previous";function Cn(){}function iM(D,$){Object.defineProperty(D,$$,{get:function(){return $}})}var f6=Cn;if(X5.debuglog)f6=X5.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))f6=function(){var D=X5.format.apply(X5,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
89
|
+
GFS4: `),console.error(D)};if(!fD[$$]){if(DJ=global[$$]||[],iM(fD,DJ),fD.close=function(D){function $(U,I){return D.call(fD,U,function(F){if(!F)nM();if(typeof I==="function")I.apply(this,arguments)})}return Object.defineProperty($,Y5,{value:D}),$}(fD.close),fD.closeSync=function(D){function $(U){D.apply(fD,arguments),nM()}return Object.defineProperty($,Y5,{value:D}),$}(fD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){f6(fD[$$]),o("assert").equal(fD[$$].length,0)})}var DJ;if(!global[$$])iM(global,fD[$$]);FJ.exports=$J(Pn(fD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!fD.__patched)FJ.exports=$J(fD),fD.__patched=!0;function $J(D){Tn(D),D.gracefulify=$J,D.createReadStream=A,D.createWriteStream=V;var $=D.readFile;D.readFile=U;function U(_,n,m){if(typeof n==="function")m=n,n=null;return UD(_,n,m);function UD(s,a,DD,E){return $(s,a,function(w){if(w&&(w.code==="EMFILE"||w.code==="ENFILE"))Y4([UD,[s,a,DD],w,E||Date.now(),Date.now()]);else if(typeof DD==="function")DD.apply(this,arguments)})}}var I=D.writeFile;D.writeFile=F;function F(_,n,m,UD){if(typeof m==="function")UD=m,m=null;return s(_,n,m,UD);function s(a,DD,E,w,O){return I(a,DD,E,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var J=D.appendFile;if(J)D.appendFile=X;function X(_,n,m,UD){if(typeof m==="function")UD=m,m=null;return s(_,n,m,UD);function s(a,DD,E,w,O){return J(a,DD,E,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var Q=D.copyFile;if(Q)D.copyFile=Y;function Y(_,n,m,UD){if(typeof m==="function")UD=m,m=0;return s(_,n,m,UD);function s(a,DD,E,w,O){return Q(a,DD,E,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var W=D.readdir;D.readdir=K;var B=/^v[0-5]\./;function K(_,n,m){if(typeof n==="function")m=n,n=null;var UD=B.test(process.version)?function(DD,E,w,O){return W(DD,s(DD,E,w,O))}:function(DD,E,w,O){return W(DD,E,s(DD,E,w,O))};return UD(_,n,m);function s(a,DD,E,w){return function(O,S){if(O&&(O.code==="EMFILE"||O.code==="ENFILE"))Y4([UD,[a,DD,E],O,w||Date.now(),Date.now()]);else{if(S&&S.sort)S.sort();if(typeof E==="function")E.call(this,O,S)}}}}if(process.version.substr(0,4)==="v0.8"){var q=bn(D);M=q.ReadStream,L=q.WriteStream}var H=D.ReadStream;if(H)M.prototype=Object.create(H.prototype),M.prototype.open=Z;var G=D.WriteStream;if(G)L.prototype=Object.create(G.prototype),L.prototype.open=v;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});var z=M;Object.defineProperty(D,"FileReadStream",{get:function(){return z},set:function(_){z=_},enumerable:!0,configurable:!0});var N=L;Object.defineProperty(D,"FileWriteStream",{get:function(){return N},set:function(_){N=_},enumerable:!0,configurable:!0});function M(_,n){if(this instanceof M)return H.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function Z(){var _=this;y(_.path,_.flags,_.mode,function(n,m){if(n){if(_.autoClose)_.destroy();_.emit("error",n)}else _.fd=m,_.emit("open",m),_.read()})}function L(_,n){if(this instanceof L)return G.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function v(){var _=this;y(_.path,_.flags,_.mode,function(n,m){if(n)_.destroy(),_.emit("error",n);else _.fd=m,_.emit("open",m)})}function A(_,n){return new D.ReadStream(_,n)}function V(_,n){return new D.WriteStream(_,n)}var b=D.open;D.open=y;function y(_,n,m,UD){if(typeof m==="function")UD=m,m=null;return s(_,n,m,UD);function s(a,DD,E,w,O){return b(a,DD,E,function(S,k){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))Y4([s,[a,DD,E,w],S,O||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}return D}function Y4(D){f6("ENQUEUE",D[0].name,D[1]),fD[$$].push(D),UJ()}var Q5;function nM(){var D=Date.now();for(var $=0;$<fD[$$].length;++$)if(fD[$$][$].length>2)fD[$$][$][3]=D,fD[$$][$][4]=D;UJ()}function UJ(){if(clearTimeout(Q5),Q5=void 0,fD[$$].length===0)return;var D=fD[$$].shift(),$=D[0],U=D[1],I=D[2],F=D[3],J=D[4];if(F===void 0)f6("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-F>=60000){f6("TIMEOUT",$.name,U);var X=U.pop();if(typeof X==="function")X.call(null,I)}else{var Q=Date.now()-J,Y=Math.max(J-F,1),W=Math.min(Y*1.2,100);if(Q>=W)f6("RETRY",$.name,U),$.apply(null,U.concat([F]));else fD[$$].push(D)}if(Q5===void 0)Q5=setTimeout(UJ,0)}});var dM=C((G5D,lM)=>{function d$(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}lM.exports=d$;d$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};d$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};d$.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var I=this,F=setTimeout(function(){if(I._attempts++,I._operationTimeoutCb){if(I._timeout=setTimeout(function(){I._operationTimeoutCb(I._attempts)},I._operationTimeout),I._options.unref)I._timeout.unref()}I._fn(I._attempts)},U);if(this._options.unref)F.unref();return!0};d$.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};d$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};d$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};d$.prototype.start=d$.prototype.try;d$.prototype.errors=function(){return this._errors};d$.prototype.attempts=function(){return this._attempts};d$.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var I=0;I<this._errors.length;I++){var F=this._errors[I],J=F.message,X=(D[J]||0)+1;if(D[J]=X,X>=U)$=F,U=X}return $}});var pM=C((kn)=>{var un=dM();kn.operation=function(D){var $=kn.timeouts(D);return new un($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};kn.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var I=[];for(var F=0;F<$.retries;F++)I.push(this.createTimeout(F,$));if(D&&D.forever&&!I.length)I.push(this.createTimeout(F,$));return I.sort(function(J,X){return J-X}),I};kn.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,I=Math.round(U*$.minTimeout*Math.pow($.factor,D));return I=Math.min(I,$.maxTimeout),I};kn.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var I in D)if(typeof D[I]==="function")U.push(I)}for(var F=0;F<U.length;F++){var J=U[F],X=D[J];D[J]=function(Y){var W=kn.operation($),B=Array.prototype.slice.call(arguments,1),K=B.pop();B.push(function(q){if(W.retry(q))return;if(q)arguments[0]=W.mainError();K.apply(this,arguments)}),W.attempt(function(){Y.apply(D,B)})}.bind(D,X),D[J].options=$}}});var rM=C((H5D,W5)=>{W5.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")W5.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")W5.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var YJ=C((N5D,B4)=>{var kD=global.process,y6=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!y6(kD))B4.exports=function(){return function(){}};else{if(IJ=o("assert"),m6=rM(),JJ=/^win/i.test(kD.platform),W4=o("events"),typeof W4!=="function")W4=W4.EventEmitter;if(kD.__signal_exit_emitter__)pD=kD.__signal_exit_emitter__;else pD=kD.__signal_exit_emitter__=new W4,pD.count=0,pD.emitted={};if(!pD.infinite)pD.setMaxListeners(1/0),pD.infinite=!0;B4.exports=function(D,$){if(!y6(global.process))return function(){};if(IJ.equal(typeof D,"function","a callback must be provided for exit handler"),h6===!1)B5();var U="exit";if($&&$.alwaysLast)U="afterexit";var I=function(){if(pD.removeListener(U,D),pD.listeners("exit").length===0&&pD.listeners("afterexit").length===0)K8()};return pD.on(U,D),I},K8=function(){if(!h6||!y6(global.process))return;h6=!1,m6.forEach(function($){try{kD.removeListener($,G8[$])}catch(U){}}),kD.emit=q8,kD.reallyExit=K5,pD.count-=1},B4.exports.unload=K8,c0=function($,U,I){if(pD.emitted[$])return;pD.emitted[$]=!0,pD.emit($,U,I)},G8={},m6.forEach(function(D){G8[D]=function(){if(!y6(global.process))return;var U=kD.listeners(D);if(U.length===pD.count){if(K8(),c0("exit",null,D),c0("afterexit",null,D),JJ&&D==="SIGHUP")D="SIGINT";kD.kill(kD.pid,D)}}}),B4.exports.signals=function(){return m6},h6=!1,B5=function(){if(h6||!y6(global.process))return;h6=!0,pD.count+=1,m6=m6.filter(function($){try{return kD.on($,G8[$]),!0}catch(U){return!1}}),kD.emit=QJ,kD.reallyExit=XJ},B4.exports.load=B5,K5=kD.reallyExit,XJ=function($){if(!y6(global.process))return;kD.exitCode=$||0,c0("exit",kD.exitCode,null),c0("afterexit",kD.exitCode,null),K5.call(kD,kD.exitCode)},q8=kD.emit,QJ=function($,U){if($==="exit"&&y6(global.process)){if(U!==void 0)kD.exitCode=U;var I=q8.apply(this,arguments);return c0("exit",kD.exitCode,null),c0("afterexit",kD.exitCode,null),I}else return q8.apply(this,arguments)}}var IJ,m6,JJ,W4,pD,K8,c0,G8,h6,B5,K5,XJ,q8,QJ});var tM=C((mn,WJ)=>{var oM=Symbol();function fn(D,$,U){let I=$[oM];if(I)return $.stat(D,(J,X)=>{if(J)return U(J);U(null,X.mtime,I)});let F=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,F,F,(J)=>{if(J)return U(J);$.stat(D,(X,Q)=>{if(X)return U(X);let Y=Q.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,oM,{value:Y}),U(null,Q.mtime,Y)})})}function yn(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}mn.probe=fn;mn.getMtime=yn});var $O=C((tn,N8)=>{var ln=o("path"),GJ=d0(),dn=pM(),cn=YJ(),aM=tM(),A0={};function H8(D,$){return $.lockfilePath||`${D}.lock`}function qJ(D,$,U){if(!$.realpath)return U(null,ln.resolve(D));$.fs.realpath(D,U)}function KJ(D,$,U){let I=H8(D,$);$.fs.mkdir(I,(F)=>{if(!F)return aM.probe(I,$.fs,(J,X,Q)=>{if(J)return $.fs.rmdir(I,()=>{}),U(J);U(null,X,Q)});if(F.code!=="EEXIST")return U(F);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(I,(J,X)=>{if(J){if(J.code==="ENOENT")return KJ(D,{...$,stale:0},U);return U(J)}if(!sM(X,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));eM(D,$,(Q)=>{if(Q)return U(Q);KJ(D,{...$,stale:0},U)})})})}function sM(D,$){return D.mtime.getTime()<Date.now()-$.stale}function eM(D,$,U){$.fs.rmdir(H8(D,$),(I)=>{if(I&&I.code!=="ENOENT")return U(I);U()})}function G5(D,$){let U=A0[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(I,F)=>{let J=U.lastUpdate+$.stale<Date.now();if(I){if(I.code==="ENOENT"||J)return BJ(D,U,Object.assign(I,{code:"ECOMPROMISED"}));return U.updateDelay=1000,G5(D,$)}if(U.mtime.getTime()!==F.mtime.getTime())return BJ(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let Q=aM.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,Q,Q,(Y)=>{let W=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(Y){if(Y.code==="ENOENT"||W)return BJ(D,U,Object.assign(Y,{code:"ECOMPROMISED"}));return U.updateDelay=1000,G5(D,$)}U.mtime=Q,U.lastUpdate=Date.now(),U.updateDelay=null,G5(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function BJ(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(A0[D]===$)delete A0[D];$.options.onCompromised(U)}function pn(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:GJ,onCompromised:(I)=>{throw I},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),qJ(D,$,(I,F)=>{if(I)return U(I);let J=dn.operation($.retries);J.attempt(()=>{KJ(F,$,(X,Q,Y)=>{if(J.retry(X))return;if(X)return U(J.mainError());let W=A0[F]={lockfilePath:H8(F,$),mtime:Q,mtimePrecision:Y,options:$,lastUpdate:Date.now()};G5(F,$),U(null,(B)=>{if(W.released)return B&&B(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));DO(F,{...$,realpath:!1},B)})})})})}function DO(D,$,U){$={fs:GJ,realpath:!0,...$},qJ(D,$,(I,F)=>{if(I)return U(I);let J=A0[F];if(!J)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));J.updateTimeout&&clearTimeout(J.updateTimeout),J.released=!0,delete A0[F],eM(F,$,U)})}function rn(D,$,U){$={stale:1e4,realpath:!0,fs:GJ,...$},$.stale=Math.max($.stale||0,2000),qJ(D,$,(I,F)=>{if(I)return U(I);$.fs.stat(H8(F,$),(J,X)=>{if(J)return J.code==="ENOENT"?U(null,!1):U(J);return U(null,!sM(X,$))})})}function on(){return A0}cn(()=>{for(let D in A0){let $=A0[D].options;try{$.fs.rmdirSync(H8(D,$))}catch(U){}}});tn.lock=pn;tn.unlock=DO;tn.check=rn;tn.getLocks=on});var FO=C((z5D,UO)=>{var $i=d0();function Ui(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((I)=>{U[I]=(...F)=>{let J=F.pop(),X;try{X=D[`${I}Sync`](...F)}catch(Q){return J(Q)}J(null,X)}}),U}function Fi(D){return(...$)=>new Promise((U,I)=>{$.push((F,J)=>{if(F)I(F);else U(J)}),D(...$)})}function Ii(D){return(...$)=>{let U,I;if($.push((F,J)=>{U=F,I=J}),D(...$),U)throw U;return I}}function Ji(D){if(D={...D},D.fs=Ui(D.fs||$i),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}UO.exports={toPromise:Fi,toSync:Ii,toSyncOptions:Ji}});var JO=C((L5D,p0)=>{var K4=$O(),{toPromise:q5,toSync:H5,toSyncOptions:HJ}=FO();async function IO(D,$){let U=await q5(K4.lock)(D,$);return q5(U)}function Xi(D,$){let U=H5(K4.lock)(D,HJ($));return H5(U)}function Qi(D,$){return q5(K4.unlock)(D,$)}function Yi(D,$){return H5(K4.unlock)(D,HJ($))}function Wi(D,$){return q5(K4.check)(D,$)}function Bi(D,$){return H5(K4.check)(D,HJ($))}p0.exports=IO;p0.exports.lock=IO;p0.exports.unlock=Qi;p0.exports.lockSync=Xi;p0.exports.unlockSync=Yi;p0.exports.check=Wi;p0.exports.checkSync=Bi});var GO=C((BO)=>{Object.defineProperty(BO,"__esModule",{value:!0});BO.canStoreURLs=BO.FileUrlStorage=void 0;var XO=o("fs"),Ki=qi(kM()),QO=Gi(JO());function WO(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(WO=function(I){return I?U:$})(D)}function Gi(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=WO($);if(U&&U.has(D))return U.get(D);var I={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in D)if(J!=="default"&&{}.hasOwnProperty.call(D,J)){var X=F?Object.getOwnPropertyDescriptor(D,J):null;X&&(X.get||X.set)?Object.defineProperty(I,J,X):I[J]=D[J]}return I.default=D,U&&U.set(D,I),I}function qi(D){return D&&D.__esModule?D:{default:D}}function z8(D){return z8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},z8(D)}function Hi(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function YO(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,zi(I.key),I)}}function Ni(D,$,U){if($)YO(D.prototype,$);if(U)YO(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function zi(D){var $=Li(D,"string");return z8($)=="symbol"?$:$+""}function Li(D,$){if(z8(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(z8(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var w5D=BO.canStoreURLs=!0,Z5D=BO.FileUrlStorage=function(){function D($){Hi(this,D),this.path=$}return Ni(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(I,F){U._getItems("tus::",function(J,X){if(J)F(J);else I(X)})})}},{key:"findUploadsByFingerprint",value:function(U){var I=this;return new Promise(function(F,J){I._getItems("tus::".concat(U),function(X,Q){if(X)J(X);else F(Q)})})}},{key:"removeUpload",value:function(U){var I=this;return new Promise(function(F,J){I._removeItem(U,function(X){if(X)J(X);else F()})})}},{key:"addUpload",value:function(U,I){var F=this,J=Math.round(Math.random()*1000000000000),X="tus::".concat(U,"::").concat(J);return new Promise(function(Q,Y){F._setItem(X,I,function(W){if(W)Y(W);else Q(X)})})}},{key:"_setItem",value:function(U,I,F){var J=this;QO.lock(this.path,this._lockfileOptions()).then(function(X){F=J._releaseAndCb(X,F),J._getData(function(Q,Y){if(Q){F(Q);return}Y[U]=I,J._writeData(Y,function(W){return F(W)})})}).catch(F)}},{key:"_getItems",value:function(U,I){this._getData(function(F,J){if(F){I(F);return}var X=Object.keys(J).filter(function(Q){return Q.startsWith(U)}).map(function(Q){var Y=J[Q];return Y.urlStorageKey=Q,Y});I(null,X)})}},{key:"_removeItem",value:function(U,I){var F=this;QO.lock(this.path,this._lockfileOptions()).then(function(J){I=F._releaseAndCb(J,I),F._getData(function(X,Q){if(X){I(X);return}delete Q[U],F._writeData(Q,function(Y){return I(Y)})})}).catch(I)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,I){return function(F){if(F){U().then(function(){return I(F)}).catch(function(J){return I((0,Ki.default)([F,J]))});return}U().then(I).catch(I)}}},{key:"_writeData",value:function(U,I){var F={encoding:"utf8",mode:432,flag:"w"};(0,XO.writeFile)(this.path,JSON.stringify(U),F,function(J){return I(J)})}},{key:"_getData",value:function(U){(0,XO.readFile)(this.path,"utf8",function(I,F){if(I){if(I.code==="ENOENT")U(null,{});else U(I);return}try{F=!F.trim().length?{}:JSON.parse(F)}catch(J){U(J);return}U(null,F)})}}])}()});var vO=C((r0)=>{Object.defineProperty(r0,"__esModule",{value:!0});Object.defineProperty(r0,"DefaultHttpStack",{enumerable:!0,get:function(){return zO.default}});Object.defineProperty(r0,"DetailedError",{enumerable:!0,get:function(){return Zi.default}});Object.defineProperty(r0,"FileUrlStorage",{enumerable:!0,get:function(){return LO.FileUrlStorage}});Object.defineProperty(r0,"StreamSource",{enumerable:!0,get:function(){return Vi.default}});r0.Upload=void 0;Object.defineProperty(r0,"canStoreURLs",{enumerable:!0,get:function(){return LO.canStoreURLs}});r0.defaultOptions=void 0;Object.defineProperty(r0,"enableDebugLog",{enumerable:!0,get:function(){return Mi.enableDebugLog}});r0.isSupported=void 0;var Zi=n6(qI()),Mi=HI(),Oi=n6(Jw()),NJ=n6(fw()),Ei=n6(IZ()),vi=n6(WZ()),zO=n6(jZ()),Vi=n6(jI()),LO=GO();function n6(D){return D&&D.__esModule?D:{default:D}}function q4(D){return q4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},q4(D)}function ji(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function qO(D,$){for(var U=0;U<$.length;U++){var I=$[U];if(I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I)I.writable=!0;Object.defineProperty(D,ZO(I.key),I)}}function Ai(D,$,U){if($)qO(D.prototype,$);if(U)qO(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Ri(D,$,U){return $=N5($),Si(D,wO()?Reflect.construct($,U||[],N5(D).constructor):$.apply(D,U))}function Si(D,$){if($&&(q4($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Ti(D)}function Ti(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function wO(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(wO=function(){return!!D})()}function N5(D){return N5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},N5(D)}function bi(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)zJ(D,$)}function zJ(D,$){return zJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,F){return I.__proto__=F,I},zJ(D,$)}function HO(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);$&&(I=I.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,I)}return U}function G4(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?HO(Object(U),!0).forEach(function(I){Pi(D,I,U[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):HO(Object(U)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(U,I))})}return D}function Pi(D,$,U){if($=ZO($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function ZO(D){var $=Ci(D,"string");return q4($)=="symbol"?$:$+""}function Ci(D,$){if(q4(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var I=U.call(D,$||"default");if(q4(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var NO=r0.defaultOptions=G4(G4({},NJ.default.defaultOptions),{},{httpStack:new zO.default,fileReader:new Ei.default,urlStorage:new Oi.default,fingerprint:vi.default}),O5D=r0.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ji(this,$),I=G4(G4({},NO),I),Ri(this,$,[U,I])}return bi($,D),Ai($,null,[{key:"terminate",value:function(I){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F=G4(G4({},NO),F),NJ.default.terminate(I,F)}}])}(NJ.default),E5D=r0.isSupported=!0});import{execFileSync as gi}from"child_process";import fi from"path";function _i(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function xi(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function hi(D,$){let U=[],I=jO($.command);for(let F of D)for(let J of F.process??[]){if(!J.pattern.test(I))continue;U.push(ni(F,J,{...$,command:I}))}return U}function ni(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function VO(D,$){try{return gi("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function jO(D){return fi.basename(D.trim()).replace(/^-+/,"")}function AO(D={}){let $=D.agents??ui,U=D.strategies??ii(D.experimentalProcessTree),I={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},F=U.flatMap((X)=>X.detect(I)),J=li($,F,I.env);if(J===void 0)return{detected:!1};return{detected:!0,agent:J}}function ii(D=!1){let $=[new ki];if(D)$.push(new mi);return $}function li(D,$,U){let I=new Set($.map((F)=>F.agent.id));for(let F of D){if(!I.has(F.id))continue;return{id:F.id,name:F.name,...di(F,U)}}return}function di(D,$){for(let U of D.sessionEnv??[]){let I=$[U];if(I!==void 0&&I.length>0)return{sessionId:I}}return{}}var ui,ki=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let I of U.env??[]){let F=D.env[I.name];if(F===void 0||!_i(F,I.value))continue;$.push(xi(U,I,F))}return $}},yi=class{read(D){let $=VO(D,"comm"),U=Number.parseInt(VO(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:jO($)}}},mi=class{constructor(D=new yi){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let I=0;I<D.maxProcessDepth;I+=1){let F=this.reader.read(U);if(F===void 0)break;if($.push(...hi(D.agents,F)),F.ppid===void 0||F.ppid<=1||F.ppid===U)break;U=F.ppid}return $}};var RO=T(()=>{ui=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as ci,release as pi}from"node:os";import{arch as ri,env as oi,version as ti}from"node:process";function k5D(D){LJ=D}function _5D(){return LJ}function SO(D=oi){let $=AO({env:D}),U={cli_version:t$.version,node_version:ti,os_platform:ci(),os_arch:ri,os_release:pi(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:L8.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:LJ,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(L8.name)U.ci_provider=L8.name;return U}var L8,LJ="cli";var TO=T(()=>{RO();A1();L8=h$(XI(),1)});import{AsyncLocalStorage as ai}from"node:async_hooks";function f5D(D,$){return PO.run(D,()=>Promise.resolve($()))}function si(){return PO.getStore()}function y5D(){CO=!0}function uO(){return CO}function m5D(D){kO=D}function bO(D){try{kO?.(D)}catch{}}function n5D(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let I="/functions/v1/",F=U.indexOf(I);if(F>=0){let W=U.slice(F+I.length),B=0,K=W.length;while(B<K&&W[B]==="/")B+=1;while(K>B&&W[K-1]==="/")K-=1;let q=W.slice(B,K);return q?`${$} functions:${q}`:`${$} functions`}let J="/rest/v1/",X=U.indexOf(J),Q=X>=0?U.slice(X+J.length):U.replace(/^\//,"");if(Q.startsWith("rpc/"))return`rpc:${Q.slice(4).split("/")[0]}`;let Y=Q.split("/")[0]||U;return`${$} ${Y}`}function ei(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([I])=>I.toLowerCase()==="capgkey")?.[1];return $.capgkey}function _O(){return async($,U)=>{let I=(U?.method??"GET").toUpperCase(),F=typeof $==="string"?$:$ instanceof URL?$.href:$.url,J=si(),X=ei(U),Q=Date.now();try{let Y=await globalThis.fetch($,U);return bO({url:F,method:I,status:Y.status,ok:Y.ok,durationMs:Date.now()-Q,source:J,apikey:X}),Y}catch(Y){throw bO({url:F,method:I,status:0,ok:!1,durationMs:Date.now()-Q,source:J,apikey:X,error:Y}),Y}}}var PO,CO=!1,kO,h5D=5000;var xO=T(()=>{PO=new ai});function Dl(D,$){if(!P2(D)||!P2($))return!1;return O6(s$(D),s$($))}function $l(D,$,U){let I=U?.trim()?`
|
|
90
90
|
${U.trim()}`:"";return`This Capgo API requires @capgo/cli@${$} or newer. You are using @capgo/cli@${D}.${I}
|
|
91
91
|
Please update: npx @capgo/cli@latest`}function gO(D,$,U=!1){let I=$||t$.version,F=D.minCliVersion?.trim();if(!F||!Dl(I,F))return;let J=$l(I,F,D.minCliVersionReason);if(!U)vD.error(J);throw new ZD(J,{minCliVersion:F,currentVersion:I})}var fO=T(()=>{y0();iF();A1();Z6()});function yO(D,$){let I=["normal","bold","dim","italic","underline","strikethrough"].indexOf(D),F="\x1B[";return"\x1B["+I+"m"+$+"\x1B[0m"}var w8;var mO=T(()=>{w8=class w8{title=null;headers=[];rows=[];static narrowTheme={top:["╔","═","╤","╗"],row:["║"," ","│","║"],div:["╟","─","┼","╢"],bot:["╚","═","╧","╝"]};static wideTheme={top:["╔═","═","═╤═","═╗"],row:["║ "," "," │ "," ║"],div:["╟─","─","─┼─","─╢"],bot:["╚═","═","═╧═","═╝"]};static roundTheme={top:["╭─","─","─┬─","─╮"],row:["│ "," "," │ "," │"],div:["├─","─","─┼─","─┤"],bot:["╰─","─","─┴─","─╯"]};theme=w8.wideTheme;columnWidth(){let D=[this.headers,...this.rows].filter((U)=>U.length>0),$=D[0].map((U)=>this.cast(U).length);for(let U of D.slice(1))for(let I=0;I<$.length;I++){let F=this.cast(U[I]).length;if(F>$[I])$[I]=F}return $}cast(D){if(typeof D==="object")return"obj";if(D!==void 0&&typeof D.toString==="function")return D.toString();else return""}renderTitle(){return"[ "+this.title+" ]"}renderLine(D){let $=this.columnWidth();return D[0]+$.map((U)=>D[1].repeat(U)).join(D[2])+D[3]}renderCell(D,$,U=!1){let I=this.cast(D),F=U?yO("bold",I):I,J=$-I.length,X=this.theme.row[1];switch(typeof D){case"number":return X.repeat(J)+F;case"string":return F+X.repeat(J);case"boolean":case"object":return X.repeat(Math.ceil(J/2))+yO("italic",I)+X.repeat(Math.floor(J/2));default:return X.repeat(J)}}renderRow(D,$=!1){let U=this.theme.row,I=this.columnWidth();return U[0]+D.map((F,J)=>this.renderCell(F,I[J],$)).join(U[2])+U[3]}toString(){let D=this.theme,$=this.headers.length>0,U=this.rows.length>0;return[this.title?this.renderTitle():"",$||U?this.renderLine(D.top):"",$?this.renderRow(this.headers,!0):"",$&&U?this.renderLine(D.div):"",...this.rows.map((I)=>this.renderRow(I)),$||U?this.renderLine(D.bot):""].filter((I)=>I.length>0).join(`
|
|
92
92
|
`)}}});var hO=T(()=>{mO()});async function nO(D){try{let U=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,I=await fetch(U,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!I.ok)return null;return(await I.json())["dist-tags"]?.latest||null}catch{return null}}async function Ul(){let D=await nO("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:t$.version,latestVersion:D,isOutdated:!!D&&D!==t$.version,majorVersion:$}}async function iO(D={warn:($)=>vD.warning($)}){let{isOutdated:$,currentVersion:U,latestVersion:I,majorVersion:F}=await Ul();if($)D.warn(`\uD83D\uDEA8 You are using @capgo/cli@${U} it's not the latest version.
|
|
93
|
-
Please use @capgo/cli@${I}" or @capgo/cli@${F} to keep up to date with the latest features and bug fixes.`)}var lO=T(()=>{y0();A1()});function cO(D,$,U=new Date,I=300000){return{appId:D,devicesId:$?[$]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date(U.getTime()-I).toISOString()}}function pO(D,$=!1){if($)return!1;let U=D.replace(/\r|\n/g,"");return U==="c"||U==="C"}var dO=5000,wJ="Press C to continue if you already verified the update in the Capgo dashboard";var Kl={};X$(Kl,{waitLog:()=>tO,sendCliEvent:()=>H4,getStats:()=>oO,debugApp:()=>Bl,cancelCommand:()=>rO});import Fl from"node:process";function Il(D,$){return new Promise((U)=>{if($?.aborted){U();return}let I=()=>{clearTimeout(F),U()},F=setTimeout(()=>{$?.removeEventListener("abort",I),U()},D);$?.addEventListener("abort",I,{once:!0})})}function Jl(D){return new Date(D||"").toLocaleTimeString()}function Xl(D,$){let U=D,I=U?.cause?.name,F=U?.cause?.code||U?.code,J=(U?.message||"").toLowerCase();if(F==="UND_ERR_CONNECT_TIMEOUT"||I==="UND_ERR_CONNECT_TIMEOUT"||/connect timeout/.test(J)||/timed out/.test(J))return`Cannot reach ${$} (connection timeout after 10s). Check VPN/firewall/network rules or update API host settings in capacitor.config.json.`;if(F==="ENOTFOUND"||F==="ECONNREFUSED"||J.includes("fetch failed"))return`Cannot reach ${$} (network error). Verify internet connectivity and that ${$} is reachable from this machine.`;if(J.startsWith("http error! status: "))return U?.message||"Capgo API returned an HTTP error.";return Y$(D)}async function H4(D,$,U,I,F,J){await N4(U,{channel:D,event:I,org_id:$,tracking_version:2,...F||J?{tags:{...F?{"app-id":F}:{},...J}}:{}})}async function rO(D,$,U,I){if(!M6($))return;throw await H4(D,U,I,"canceled"),vD.warn("Command cancelled"),new ZD("Command cancelled")}async function oO(D,$,U,I){let J=`${(await i6()).hostApi}/private/stats`;try{let X=U?{...$,rangeStart:U}:{...$},Q=await fetch(J,{method:"POST",headers:J0({"Content-Type":"application/json",capgkey:D}),body:JSON.stringify(X),signal:I});if(!Q.ok)throw Error(`HTTP error! status: ${Q.status}`);let Y=await Q.json();if(Y?.length>0)return Y}catch(X){if(I?.aborted||X instanceof Error&&X.name==="AbortError")return[];vD.error(`Cannot get stats: ${Xl(X,J)}`)}return[]}function Ql(D){let $={get:{summary:()=>"Update request by device. Waiting for download…",level:"info",trackingEvent:"done"},delete:{summary:()=>"Bundle deleted on device",level:"info"},set:{summary:()=>"Bundle set on device ❤️",level:"info",trackingEvent:"set",stop:!0},NoChannelOrOverride:{summary:()=>"No default channel/override; create it in channel settings",level:"error"},needPlanUpgrade:{summary:({baseUrl:U})=>`Out of quota. Upgrade plan: ${U}/settings/organization/plans`,level:"error"},missingBundle:{summary:()=>"Requested bundle not found on server",level:"error"},noNew:{summary:()=>"Device already has latest available version",level:"info"},disablePlatformIos:{summary:()=>"iOS platform disabled in channel",level:"error"},disablePlatformAndroid:{summary:()=>"Android platform disabled in channel",level:"error"},disableAutoUpdate:{summary:()=>"Automatic updates disabled in channel",level:"error"},disableAutoUpdateToMajor:{summary:()=>"Auto-update to major versions disabled",level:"error"},disableAutoUpdateToMinor:{summary:()=>"Auto-update to minor versions disabled",level:"error"},disableAutoUpdateToPatch:{summary:()=>"Auto-update to patch versions disabled",level:"error"},disableAutoUpdateUnderNative:{summary:()=>"Channel update version is lower than device native",level:"error"},disableDevBuild:{summary:()=>"Dev build updates disabled in channel",level:"error"},disableProdBuild:{summary:()=>"Prod build updates disabled in channel",level:"error"},disableEmulator:{summary:()=>"Emulator updates disabled in channel",level:"error"},disableDevice:{summary:()=>"Physical device updates disabled in channel",level:"error"},cannotGetBundle:{summary:()=>"Cannot retrieve bundle from channel",level:"error"},cannotUpdateViaPrivateChannel:{summary:()=>"No access to private channel",level:"error"},channelMisconfigured:{summary:()=>"Channel configuration invalid or incomplete",level:"error"},disableAutoUpdateMetadata:{summary:()=>"Auto-update on metadata disabled",level:"error"},set_fail:{summary:()=>"Bundle set failed. Possibly corrupted",level:"error"},reset:{summary:()=>"Device reset to builtin bundle",level:"warn"},update_fail:{summary:()=>"Installed bundle failed to call notifyAppReady",level:"error"},checksum_fail:{summary:()=>"Downloaded bundle checksum validation failed",level:"error"},windows_path_fail:{summary:()=>"Bundle contains illegal Windows-style paths",level:"error"},canonical_path_fail:{summary:()=>"Bundle contains non-canonical paths",level:"error"},directory_path_fail:{summary:()=>"Bundle ZIP contains invalid directory paths",level:"error"},unzip_fail:{summary:()=>"Failed to unzip bundle on device",level:"error"},low_mem_fail:{summary:()=>"Download failed due to low device memory",level:"error"},app_moved_to_background:{summary:()=>"App moved to background",level:"info"},app_moved_to_foreground:{summary:()=>"App moved to foreground",level:"info"},decrypt_fail:{summary:()=>"Failed to decrypt downloaded bundle",level:"error"},getChannel:{summary:()=>"Queried current channel on device",level:"info"},setChannel:{summary:()=>"Channel set on device",level:"info"},InvalidIp:{summary:()=>"Device appears in Google datacenter; blocking recent updates (<4h)",level:"warn"},uninstall:{summary:()=>"App uninstalled or Capgo data cleared on device",level:"warn"}};if(D.action.startsWith("download_")){let U=D.action.split("_")[1];if(U==="complete")return{summary:()=>"Download complete; relaunch app to apply",level:"info",trackingEvent:"downloaded"};if(U==="fail")return{summary:()=>"Download failed on device",level:"error"};return{summary:()=>`Downloading ${U}%`,level:"info"}}return $[D.action]||null}async function Yl(D,$,U,I,F,J){let X=Ql(D);if(!X)return{};if(X.trackingEvent)await H4($,U,I,X.trackingEvent);let Q=Jl(D.created_at),Y=D.action,W=D.version_id?`(version #${D.version_id})`:"",B=D.version?` (version ${D.version})`:W,K=`${X.summary({data:D,baseAppUrl:F,baseUrl:J})}${B}`;return{row:[Q,D.device_id,Y,K],stop:X.stop}}function Wl(D){return new Promise(($)=>{let U=Fl.stdin,I=Boolean(U.isTTY&&typeof U.setRawMode==="function"),F=I?U.isRaw:void 0,J=U.readableFlowing===!0,X=()=>{Y(),$()},Q=(W)=>{let B=String(W);if(B==="\x03"||pO(B))X()},Y=()=>{if(U.off("data",Q),D.removeEventListener("abort",X),I&&F!==void 0)U.setRawMode(F);if(!J)U.pause()};if(D.addEventListener("abort",X,{once:!0}),I)U.setRawMode(!0),U.resume();if(U.isTTY)U.on("data",Q)})}async function tO(D,$,U,I,F={}){let J=await i6(),X=`${J.hostWeb}/app/${U}`;await H4(D,I,$,"Use waitlog",U);let Q=cO(U,F.deviceId,F.now,F.lookbackMs),Y=null,W=new Set,B=F.spinner??b1(),K=F.logInfo??((v)=>{vD.info(v)}),q=F.sleep??Il,H=F.pollMs??dO,G=`${J.host}/docs/plugins/updater/debugging/#sent-from-the-backend`,z=`Waiting for logs (expect ~30s delay). ${wJ}. More info: ${G}`;B.start(z);let N=new AbortController,M=F.waitForSkip?F.waitForSkip(N.signal):Wl(N.signal),L=(async()=>{let v=!0;while(!N.signal.aborted){if(!v)await q(H,N.signal);if(v=!1,N.signal.aborted)return"aborted";let A=await oO($,Q,Y,N.signal);if(N.signal.aborted)return"aborted";if(A.length===0)continue;let V=A.reduce((n,m)=>{let UD=new Date(m.created_at).getTime();return Math.max(n,UD)},Y?new Date(Y).getTime():0);if(V>0)Y=new Date(V).toISOString();let b=A.filter((n)=>{let m=`${n.app_id}|${n.device_id}|${n.action}|${n.version_id}|${n.created_at}`;if(W.has(m))return!1;return W.add(m),!0}).sort((n,m)=>new Date(n.created_at).getTime()-new Date(m.created_at).getTime()),y=new w8;y.headers=["Time","Device","Key","Message"],y.theme=w8.roundTheme,y.rows=[];let _=!1;for(let n of b){let{row:m,stop:UD}=await Yl(n,D,I,$,X,J.hostWeb);if(m)y.rows.push(m);if(UD)_=!0}if(N.signal.aborted)return"aborted";if(y.rows.length){if(B.stop(""),K(y.toString()),!_)B.start(z)}if(_)return"set"}return"aborted"})();try{let v=await Promise.race([L,M.then(()=>"skip")]);if(N.abort(),await L,v==="skip")return B.stop("Skipped waiting for logs"),K("You can confirm the update in the Capgo dashboard anytime."),{skipped:!0};return B.stop("Stop watching logs"),{skipped:!1}}catch(v){throw N.abort(),await L.catch(()=>{return}),B.stop("Stop watching logs"),v}}async function Bl(D,$){$9("Debug Live update in Capgo"),await iO(),$.apikey=$.apikey||sO();let U=await ZJ();D=DE(D,U?.config);let I=$.device;if(!$.apikey)throw vD.error("Missing API key, you need to provide an API key to delete your app"),Error("Missing API key");if(!D)throw vD.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new ZD("Missing appId");let F=await eO($.apikey,D,{supaHost:$.supaHost,supaAnon:$.supaAnon}),J=await T1({message:"Automatic check if update working in device ?"});if(await rO("debug",J,F,$.apikey),J)vD.info(`Wait logs sent to Capgo from ${D} device, Please background your app and open it again \uD83D\uDCAA`),vD.info(wJ),await tO("debug",$.apikey,D,F,{deviceId:I}),A2("Done ✅");else A2("Canceled ❌")}var aO=T(()=>{y0();hO();d3();lO();Z6();MJ()});import{AsyncLocalStorage as Gl}from"node:async_hooks";function q7D(){return OJ.getStore()??$E}function UE(){let D=OJ.getStore();return D===$E?void 0:D}function H7D(D,$){if(!D)return $();return OJ.run(D,$)}var $E,OJ;var FE=T(()=>{y0();$E={info:(D)=>vD.info(D),warn:(D)=>vD.warn(D),error:(D)=>vD.error(D),success:(D)=>vD.success(D),intro:$9,outro:A2,spinner:b1},OJ=new Gl});var JE=C((z7D,IE)=>{var z4=1000,L4=z4*60,w4=L4*60,l6=w4*24,ql=l6*7,Hl=l6*365.25;IE.exports=function(D,$){$=$||{};var U=typeof D;if(U==="string"&&D.length>0)return Nl(D);else if(U==="number"&&isFinite(D))return $.long?Ll(D):zl(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function Nl(D){if(D=String(D),D.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!$)return;var U=parseFloat($[1]),I=($[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return U*Hl;case"weeks":case"week":case"w":return U*ql;case"days":case"day":case"d":return U*l6;case"hours":case"hour":case"hrs":case"hr":case"h":return U*w4;case"minutes":case"minute":case"mins":case"min":case"m":return U*L4;case"seconds":case"second":case"secs":case"sec":case"s":return U*z4;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return U;default:return}}function zl(D){var $=Math.abs(D);if($>=l6)return Math.round(D/l6)+"d";if($>=w4)return Math.round(D/w4)+"h";if($>=L4)return Math.round(D/L4)+"m";if($>=z4)return Math.round(D/z4)+"s";return D+"ms"}function Ll(D){var $=Math.abs(D);if($>=l6)return z5(D,$,l6,"day");if($>=w4)return z5(D,$,w4,"hour");if($>=L4)return z5(D,$,L4,"minute");if($>=z4)return z5(D,$,z4,"second");return D+" ms"}function z5(D,$,U,I){var F=$>=U*1.5;return Math.round(D/U)+" "+I+(F?"s":"")}});var EJ=C((L7D,XE)=>{function wl(D){U.debug=U,U.default=U,U.coerce=Y,U.disable=X,U.enable=F,U.enabled=Q,U.humanize=JE(),U.destroy=W,Object.keys(D).forEach((B)=>{U[B]=D[B]}),U.names=[],U.skips=[],U.formatters={};function $(B){let K=0;for(let q=0;q<B.length;q++)K=(K<<5)-K+B.charCodeAt(q),K|=0;return U.colors[Math.abs(K)%U.colors.length]}U.selectColor=$;function U(B){let K,q=null,H,G;function z(...N){if(!z.enabled)return;let M=z,Z=Number(new Date),L=Z-(K||Z);if(M.diff=L,M.prev=K,M.curr=Z,K=Z,N[0]=U.coerce(N[0]),typeof N[0]!=="string")N.unshift("%O");let v=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(V,b)=>{if(V==="%%")return"%";v++;let y=U.formatters[b];if(typeof y==="function"){let _=N[v];V=y.call(M,_),N.splice(v,1),v--}return V}),U.formatArgs.call(M,N),(M.log||U.log).apply(M,N)}if(z.namespace=B,z.useColors=U.useColors(),z.color=U.selectColor(B),z.extend=I,z.destroy=U.destroy,Object.defineProperty(z,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(q!==null)return q;if(H!==U.namespaces)H=U.namespaces,G=U.enabled(B);return G},set:(N)=>{q=N}}),typeof U.init==="function")U.init(z);return z}function I(B,K){let q=U(this.namespace+(typeof K>"u"?":":K)+B);return q.log=this.log,q}function F(B){U.save(B),U.namespaces=B,U.names=[],U.skips=[];let K=(typeof B==="string"?B:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let q of K)if(q[0]==="-")U.skips.push(q.slice(1));else U.names.push(q)}function J(B,K){let q=0,H=0,G=-1,z=0;while(q<B.length)if(H<K.length&&(K[H]===B[q]||K[H]==="*"))if(K[H]==="*")G=H,z=q,H++;else q++,H++;else if(G!==-1)H=G+1,z++,q=z;else return!1;while(H<K.length&&K[H]==="*")H++;return H===K.length}function X(){let B=[...U.names,...U.skips.map((K)=>"-"+K)].join(",");return U.enable(""),B}function Q(B){for(let K of U.skips)if(J(B,K))return!1;for(let K of U.names)if(J(B,K))return!0;return!1}function Y(B){if(B instanceof Error)return B.stack||B.message;return B}function W(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return U.enable(U.load()),U}XE.exports=wl});var YE=C((QE,L5)=>{QE.formatArgs=Ml;QE.save=Ol;QE.load=El;QE.useColors=Zl;QE.storage=vl();QE.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();QE.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Zl(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ml(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+L5.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let U=0,I=0;D[0].replace(/%[a-zA-Z%]/g,(F)=>{if(F==="%%")return;if(U++,F==="%c")I=U}),D.splice(I,0,$)}QE.log=console.debug||console.log||(()=>{});function Ol(D){try{if(D)QE.storage.setItem("debug",D);else QE.storage.removeItem("debug")}catch($){}}function El(){let D;try{D=QE.storage.getItem("debug")||QE.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function vl(){try{return localStorage}catch(D){}}L5.exports=EJ()(QE);var{formatters:Vl}=L5.exports;Vl.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var BE=C((Z7D,WE)=>{WE.exports=(D,$=process.argv)=>{let U=D.startsWith("-")?"":D.length===1?"-":"--",I=$.indexOf(U+D),F=$.indexOf("--");return I!==-1&&(F===-1||I<F)}});var qE=C((M7D,GE)=>{var Cl=o("os"),KE=o("tty"),c$=BE(),{env:tD}=process,o0;if(c$("no-color")||c$("no-colors")||c$("color=false")||c$("color=never"))o0=0;else if(c$("color")||c$("colors")||c$("color=true")||c$("color=always"))o0=1;if("FORCE_COLOR"in tD)if(tD.FORCE_COLOR==="true")o0=1;else if(tD.FORCE_COLOR==="false")o0=0;else o0=tD.FORCE_COLOR.length===0?1:Math.min(parseInt(tD.FORCE_COLOR,10),3);function vJ(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function VJ(D,$){if(o0===0)return 0;if(c$("color=16m")||c$("color=full")||c$("color=truecolor"))return 3;if(c$("color=256"))return 2;if(D&&!$&&o0===void 0)return 0;let U=o0||0;if(tD.TERM==="dumb")return U;if(process.platform==="win32"){let I=Cl.release().split(".");if(Number(I[0])>=10&&Number(I[2])>=10586)return Number(I[2])>=14931?3:2;return 1}if("CI"in tD){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((I)=>(I in tD))||tD.CI_NAME==="codeship")return 1;return U}if("TEAMCITY_VERSION"in tD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(tD.TEAMCITY_VERSION)?1:0;if(tD.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in tD){let I=parseInt((tD.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(tD.TERM_PROGRAM){case"iTerm.app":return I>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(tD.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(tD.TERM))return 1;if("COLORTERM"in tD)return 1;return U}function ul(D){let $=VJ(D,D&&D.isTTY);return vJ($)}GE.exports={supportsColor:ul,stdout:vJ(VJ(!0,KE.isatty(1))),stderr:vJ(VJ(!0,KE.isatty(2)))}});var LE=C((NE,Z5)=>{var kl=o("tty"),w5=o("util");NE.init=hl;NE.log=fl;NE.formatArgs=xl;NE.save=yl;NE.load=ml;NE.useColors=_l;NE.destroy=w5.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");NE.colors=[6,2,3,4,5,1];try{let D=qE();if(D&&(D.stderr||D).level>=2)NE.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}NE.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let U=$.substring(6).toLowerCase().replace(/_([a-z])/g,(F,J)=>{return J.toUpperCase()}),I=process.env[$];if(/^(yes|on|true|enabled)$/i.test(I))I=!0;else if(/^(no|off|false|disabled)$/i.test(I))I=!1;else if(I==="null")I=null;else I=Number(I);return D[U]=I,D},{});function _l(){return"colors"in NE.inspectOpts?Boolean(NE.inspectOpts.colors):kl.isatty(process.stderr.fd)}function xl(D){let{namespace:$,useColors:U}=this;if(U){let I=this.color,F="\x1B[3"+(I<8?I:"8;5;"+I),J=` ${F};1m${$} \x1B[0m`;D[0]=J+D[0].split(`
|
|
93
|
+
Please use @capgo/cli@${I}" or @capgo/cli@${F} to keep up to date with the latest features and bug fixes.`)}var lO=T(()=>{y0();A1()});function cO(D,$,U=new Date,I=300000){return{appId:D,devicesId:$?[$]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date(U.getTime()-I).toISOString()}}function pO(D,$=!1){if($)return!1;let U=D.replace(/\r|\n/g,"");return U==="c"||U==="C"}var dO=5000,wJ="Press C to continue if you already verified the update in the Capgo dashboard";var Kl={};X$(Kl,{waitLog:()=>tO,sendCliEvent:()=>H4,getStats:()=>oO,debugApp:()=>Bl,cancelCommand:()=>rO});import Fl from"node:process";function Il(D,$){return new Promise((U)=>{if($?.aborted){U();return}let I=()=>{clearTimeout(F),U()},F=setTimeout(()=>{$?.removeEventListener("abort",I),U()},D);$?.addEventListener("abort",I,{once:!0})})}function Jl(D){return new Date(D||"").toLocaleTimeString()}function Xl(D,$){let U=D,I=U?.cause?.name,F=U?.cause?.code||U?.code,J=(U?.message||"").toLowerCase();if(F==="UND_ERR_CONNECT_TIMEOUT"||I==="UND_ERR_CONNECT_TIMEOUT"||/connect timeout/.test(J)||/timed out/.test(J))return`Cannot reach ${$} (connection timeout after 10s). Check VPN/firewall/network rules or update API host settings in capacitor.config.json.`;if(F==="ENOTFOUND"||F==="ECONNREFUSED"||J.includes("fetch failed"))return`Cannot reach ${$} (network error). Verify internet connectivity and that ${$} is reachable from this machine.`;if(J.startsWith("http error! status: "))return U?.message||"Capgo API returned an HTTP error.";return Y$(D)}async function H4(D,$,U,I,F,J){await N4(U,{channel:D,event:I,org_id:$,tracking_version:2,...F||J?{tags:{...F?{"app-id":F}:{},...J}}:{}})}async function rO(D,$,U,I){if(!M6($))return;throw await H4(D,U,I,"canceled"),vD.warn("Command cancelled"),new ZD("Command cancelled")}async function oO(D,$,U,I){let J=`${(await i6()).hostApi}/private/stats`;try{let X=U?{...$,rangeStart:U}:{...$},Q=await fetch(J,{method:"POST",headers:J0({"Content-Type":"application/json",capgkey:D}),body:JSON.stringify(X),signal:I});if(!Q.ok)throw Error(`HTTP error! status: ${Q.status}`);let Y=await Q.json();if(Y?.length>0)return Y}catch(X){if(I?.aborted||X instanceof Error&&X.name==="AbortError")return[];vD.error(`Cannot get stats: ${Xl(X,J)}`)}return[]}function Ql(D){let $={get:{summary:()=>"Update request by device. Waiting for download…",level:"info",trackingEvent:"done"},delete:{summary:()=>"Bundle deleted on device",level:"info"},set:{summary:()=>"Bundle set on device ❤️",level:"info",trackingEvent:"set",stop:!0},NoChannelOrOverride:{summary:()=>"No default channel/override; create it in channel settings",level:"error"},needPlanUpgrade:{summary:({baseUrl:U})=>`Out of quota. Upgrade plan: ${U}/settings/organization/plans`,level:"error"},missingBundle:{summary:()=>"Requested bundle not found on server",level:"error"},noNew:{summary:()=>"Device already has latest available version",level:"info"},disablePlatformIos:{summary:()=>"iOS platform disabled in channel",level:"error"},disablePlatformAndroid:{summary:()=>"Android platform disabled in channel",level:"error"},disableAutoUpdate:{summary:()=>"Automatic updates disabled in channel",level:"error"},disableAutoUpdateToMajor:{summary:()=>"Auto-update to major versions disabled",level:"error"},disableAutoUpdateToMinor:{summary:()=>"Auto-update to minor versions disabled",level:"error"},disableAutoUpdateToPatch:{summary:()=>"Auto-update to patch versions disabled",level:"error"},disableAutoUpdateUnderNative:{summary:()=>"Channel update version is lower than device native",level:"error"},disableDevBuild:{summary:()=>"Dev build updates disabled in channel",level:"error"},disableProdBuild:{summary:()=>"Prod build updates disabled in channel",level:"error"},disableEmulator:{summary:()=>"Emulator updates disabled in channel",level:"error"},disableDevice:{summary:()=>"Physical device updates disabled in channel",level:"error"},cannotGetBundle:{summary:()=>"Cannot retrieve bundle from channel",level:"error"},cannotUpdateViaPrivateChannel:{summary:()=>"No access to private channel",level:"error"},channelMisconfigured:{summary:()=>"Channel configuration invalid or incomplete",level:"error"},disableAutoUpdateMetadata:{summary:()=>"Auto-update on metadata disabled",level:"error"},set_fail:{summary:()=>"Bundle set failed. Possibly corrupted",level:"error"},reset:{summary:()=>"Device reset to builtin bundle",level:"warn"},update_fail:{summary:()=>"Installed bundle failed to call notifyAppReady",level:"error"},checksum_fail:{summary:()=>"Downloaded bundle checksum validation failed",level:"error"},windows_path_fail:{summary:()=>"Bundle contains illegal Windows-style paths",level:"error"},canonical_path_fail:{summary:()=>"Bundle contains non-canonical paths",level:"error"},directory_path_fail:{summary:()=>"Bundle ZIP contains invalid directory paths",level:"error"},unzip_fail:{summary:()=>"Failed to unzip bundle on device",level:"error"},low_mem_fail:{summary:()=>"Download failed due to low device memory",level:"error"},app_moved_to_background:{summary:()=>"App moved to background",level:"info"},app_moved_to_foreground:{summary:()=>"App moved to foreground",level:"info"},decrypt_fail:{summary:()=>"Failed to decrypt downloaded bundle",level:"error"},getChannel:{summary:()=>"Queried current channel on device",level:"info"},setChannel:{summary:()=>"Channel set on device",level:"info"},InvalidIp:{summary:()=>"Device appears in Google datacenter; blocking recent updates (<4h)",level:"warn"},uninstall:{summary:()=>"App uninstalled or Capgo data cleared on device",level:"warn"}};if(D.action.startsWith("download_")){let U=D.action.split("_")[1];if(U==="complete")return{summary:()=>"Download complete; relaunch app to apply",level:"info",trackingEvent:"downloaded"};if(U==="fail")return{summary:()=>"Download failed on device",level:"error"};return{summary:()=>`Downloading ${U}%`,level:"info"}}return $[D.action]||null}async function Yl(D,$,U,I,F,J){let X=Ql(D);if(!X)return{};if(X.trackingEvent)await H4($,U,I,X.trackingEvent);let Q=Jl(D.created_at),Y=D.action,W=D.version_id?`(version #${D.version_id})`:"",B=D.version?` (version ${D.version})`:W,K=`${X.summary({data:D,baseAppUrl:F,baseUrl:J})}${B}`;return{row:[Q,D.device_id,Y,K],stop:X.stop}}function Wl(D){return new Promise(($)=>{let U=Fl.stdin,I=Boolean(U.isTTY&&typeof U.setRawMode==="function"),F=I?U.isRaw:void 0,J=U.readableFlowing===!0,X=()=>{Y(),$()},Q=(W)=>{let B=String(W);if(B==="\x03"||pO(B))X()},Y=()=>{if(U.off("data",Q),D.removeEventListener("abort",X),I&&F!==void 0)U.setRawMode(F);if(!J)U.pause()};if(D.addEventListener("abort",X,{once:!0}),I)U.setRawMode(!0),U.resume();if(U.isTTY)U.on("data",Q)})}async function tO(D,$,U,I,F={}){let J=await i6(),X=`${J.hostWeb}/app/${U}`;await H4(D,I,$,"Use waitlog",U);let Q=cO(U,F.deviceId,F.now,F.lookbackMs),Y=null,W=new Set,B=F.spinner??b1(),K=F.logInfo??((v)=>{vD.info(v)}),q=F.sleep??Il,H=F.pollMs??dO,G=`${J.host}/docs/plugins/updater/debugging/#sent-from-the-backend`,z=`Waiting for logs (expect ~30s delay). ${wJ}. More info: ${G}`;B.start(z);let N=new AbortController,M=F.waitForSkip?F.waitForSkip(N.signal):Wl(N.signal),L=(async()=>{let v=!0;while(!N.signal.aborted){if(!v)await q(H,N.signal);if(v=!1,N.signal.aborted)return"aborted";let A=await oO($,Q,Y,N.signal);if(N.signal.aborted)return"aborted";if(A.length===0)continue;let V=A.reduce((n,m)=>{let UD=new Date(m.created_at).getTime();return Math.max(n,UD)},Y?new Date(Y).getTime():0);if(V>0)Y=new Date(V).toISOString();let b=A.filter((n)=>{let m=`${n.app_id}|${n.device_id}|${n.action}|${n.version_id}|${n.created_at}`;if(W.has(m))return!1;return W.add(m),!0}).sort((n,m)=>new Date(n.created_at).getTime()-new Date(m.created_at).getTime()),y=new w8;y.headers=["Time","Device","Key","Message"],y.theme=w8.roundTheme,y.rows=[];let _=!1;for(let n of b){let{row:m,stop:UD}=await Yl(n,D,I,$,X,J.hostWeb);if(m)y.rows.push(m);if(UD)_=!0}if(N.signal.aborted)return"aborted";if(y.rows.length){if(B.stop(""),K(y.toString()),!_)B.start(z)}if(_)return"set"}return"aborted"})();try{let v=await Promise.race([L,M.then(()=>"skip")]);if(N.abort(),await L,v==="skip")return B.stop("Skipped waiting for logs"),K("You can confirm the update in the Capgo dashboard anytime."),{skipped:!0};return B.stop("Stop watching logs"),{skipped:!1}}catch(v){throw N.abort(),await L.catch(()=>{return}),B.stop("Stop watching logs"),v}}async function Bl(D,$){$9("Debug Live update in Capgo"),await iO(),$.apikey=$.apikey||sO();let U=await ZJ();D=DE(D,U?.config);let I=$.device;if(!$.apikey)throw vD.error("Missing API key, you need to provide an API key to delete your app"),Error("Missing API key");if(!D)throw vD.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new ZD("Missing appId");let F=await eO($.apikey,D,{supaHost:$.supaHost,supaAnon:$.supaAnon}),J=await T1({message:"Automatic check if update working in device ?"});if(await rO("debug",J,F,$.apikey),J)vD.info(`Wait logs sent to Capgo from ${D} device, Please background your app and open it again \uD83D\uDCAA`),vD.info(wJ),await tO("debug",$.apikey,D,F,{deviceId:I}),A2("Done ✅");else A2("Canceled ❌")}var aO=T(()=>{y0();hO();d3();lO();Z6();MJ()});import{AsyncLocalStorage as Gl}from"node:async_hooks";function H7D(){return OJ.getStore()??$E}function UE(){let D=OJ.getStore();return D===$E?void 0:D}function N7D(D,$){if(!D)return $();return OJ.run(D,$)}var $E,OJ;var FE=T(()=>{y0();$E={info:(D)=>vD.info(D),warn:(D)=>vD.warn(D),error:(D)=>vD.error(D),success:(D)=>vD.success(D),intro:$9,outro:A2,spinner:b1},OJ=new Gl});var JE=C((L7D,IE)=>{var z4=1000,L4=z4*60,w4=L4*60,l6=w4*24,ql=l6*7,Hl=l6*365.25;IE.exports=function(D,$){$=$||{};var U=typeof D;if(U==="string"&&D.length>0)return Nl(D);else if(U==="number"&&isFinite(D))return $.long?Ll(D):zl(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function Nl(D){if(D=String(D),D.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!$)return;var U=parseFloat($[1]),I=($[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return U*Hl;case"weeks":case"week":case"w":return U*ql;case"days":case"day":case"d":return U*l6;case"hours":case"hour":case"hrs":case"hr":case"h":return U*w4;case"minutes":case"minute":case"mins":case"min":case"m":return U*L4;case"seconds":case"second":case"secs":case"sec":case"s":return U*z4;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return U;default:return}}function zl(D){var $=Math.abs(D);if($>=l6)return Math.round(D/l6)+"d";if($>=w4)return Math.round(D/w4)+"h";if($>=L4)return Math.round(D/L4)+"m";if($>=z4)return Math.round(D/z4)+"s";return D+"ms"}function Ll(D){var $=Math.abs(D);if($>=l6)return z5(D,$,l6,"day");if($>=w4)return z5(D,$,w4,"hour");if($>=L4)return z5(D,$,L4,"minute");if($>=z4)return z5(D,$,z4,"second");return D+" ms"}function z5(D,$,U,I){var F=$>=U*1.5;return Math.round(D/U)+" "+I+(F?"s":"")}});var EJ=C((w7D,XE)=>{function wl(D){U.debug=U,U.default=U,U.coerce=Y,U.disable=X,U.enable=F,U.enabled=Q,U.humanize=JE(),U.destroy=W,Object.keys(D).forEach((B)=>{U[B]=D[B]}),U.names=[],U.skips=[],U.formatters={};function $(B){let K=0;for(let q=0;q<B.length;q++)K=(K<<5)-K+B.charCodeAt(q),K|=0;return U.colors[Math.abs(K)%U.colors.length]}U.selectColor=$;function U(B){let K,q=null,H,G;function z(...N){if(!z.enabled)return;let M=z,Z=Number(new Date),L=Z-(K||Z);if(M.diff=L,M.prev=K,M.curr=Z,K=Z,N[0]=U.coerce(N[0]),typeof N[0]!=="string")N.unshift("%O");let v=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(V,b)=>{if(V==="%%")return"%";v++;let y=U.formatters[b];if(typeof y==="function"){let _=N[v];V=y.call(M,_),N.splice(v,1),v--}return V}),U.formatArgs.call(M,N),(M.log||U.log).apply(M,N)}if(z.namespace=B,z.useColors=U.useColors(),z.color=U.selectColor(B),z.extend=I,z.destroy=U.destroy,Object.defineProperty(z,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(q!==null)return q;if(H!==U.namespaces)H=U.namespaces,G=U.enabled(B);return G},set:(N)=>{q=N}}),typeof U.init==="function")U.init(z);return z}function I(B,K){let q=U(this.namespace+(typeof K>"u"?":":K)+B);return q.log=this.log,q}function F(B){U.save(B),U.namespaces=B,U.names=[],U.skips=[];let K=(typeof B==="string"?B:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let q of K)if(q[0]==="-")U.skips.push(q.slice(1));else U.names.push(q)}function J(B,K){let q=0,H=0,G=-1,z=0;while(q<B.length)if(H<K.length&&(K[H]===B[q]||K[H]==="*"))if(K[H]==="*")G=H,z=q,H++;else q++,H++;else if(G!==-1)H=G+1,z++,q=z;else return!1;while(H<K.length&&K[H]==="*")H++;return H===K.length}function X(){let B=[...U.names,...U.skips.map((K)=>"-"+K)].join(",");return U.enable(""),B}function Q(B){for(let K of U.skips)if(J(B,K))return!1;for(let K of U.names)if(J(B,K))return!0;return!1}function Y(B){if(B instanceof Error)return B.stack||B.message;return B}function W(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return U.enable(U.load()),U}XE.exports=wl});var YE=C((QE,L5)=>{QE.formatArgs=Ml;QE.save=Ol;QE.load=El;QE.useColors=Zl;QE.storage=vl();QE.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();QE.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Zl(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ml(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+L5.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let U=0,I=0;D[0].replace(/%[a-zA-Z%]/g,(F)=>{if(F==="%%")return;if(U++,F==="%c")I=U}),D.splice(I,0,$)}QE.log=console.debug||console.log||(()=>{});function Ol(D){try{if(D)QE.storage.setItem("debug",D);else QE.storage.removeItem("debug")}catch($){}}function El(){let D;try{D=QE.storage.getItem("debug")||QE.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function vl(){try{return localStorage}catch(D){}}L5.exports=EJ()(QE);var{formatters:Vl}=L5.exports;Vl.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var BE=C((M7D,WE)=>{WE.exports=(D,$=process.argv)=>{let U=D.startsWith("-")?"":D.length===1?"-":"--",I=$.indexOf(U+D),F=$.indexOf("--");return I!==-1&&(F===-1||I<F)}});var qE=C((O7D,GE)=>{var Cl=o("os"),KE=o("tty"),c$=BE(),{env:tD}=process,o0;if(c$("no-color")||c$("no-colors")||c$("color=false")||c$("color=never"))o0=0;else if(c$("color")||c$("colors")||c$("color=true")||c$("color=always"))o0=1;if("FORCE_COLOR"in tD)if(tD.FORCE_COLOR==="true")o0=1;else if(tD.FORCE_COLOR==="false")o0=0;else o0=tD.FORCE_COLOR.length===0?1:Math.min(parseInt(tD.FORCE_COLOR,10),3);function vJ(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function VJ(D,$){if(o0===0)return 0;if(c$("color=16m")||c$("color=full")||c$("color=truecolor"))return 3;if(c$("color=256"))return 2;if(D&&!$&&o0===void 0)return 0;let U=o0||0;if(tD.TERM==="dumb")return U;if(process.platform==="win32"){let I=Cl.release().split(".");if(Number(I[0])>=10&&Number(I[2])>=10586)return Number(I[2])>=14931?3:2;return 1}if("CI"in tD){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((I)=>(I in tD))||tD.CI_NAME==="codeship")return 1;return U}if("TEAMCITY_VERSION"in tD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(tD.TEAMCITY_VERSION)?1:0;if(tD.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in tD){let I=parseInt((tD.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(tD.TERM_PROGRAM){case"iTerm.app":return I>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(tD.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(tD.TERM))return 1;if("COLORTERM"in tD)return 1;return U}function ul(D){let $=VJ(D,D&&D.isTTY);return vJ($)}GE.exports={supportsColor:ul,stdout:vJ(VJ(!0,KE.isatty(1))),stderr:vJ(VJ(!0,KE.isatty(2)))}});var LE=C((NE,Z5)=>{var kl=o("tty"),w5=o("util");NE.init=hl;NE.log=fl;NE.formatArgs=xl;NE.save=yl;NE.load=ml;NE.useColors=_l;NE.destroy=w5.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");NE.colors=[6,2,3,4,5,1];try{let D=qE();if(D&&(D.stderr||D).level>=2)NE.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}NE.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let U=$.substring(6).toLowerCase().replace(/_([a-z])/g,(F,J)=>{return J.toUpperCase()}),I=process.env[$];if(/^(yes|on|true|enabled)$/i.test(I))I=!0;else if(/^(no|off|false|disabled)$/i.test(I))I=!1;else if(I==="null")I=null;else I=Number(I);return D[U]=I,D},{});function _l(){return"colors"in NE.inspectOpts?Boolean(NE.inspectOpts.colors):kl.isatty(process.stderr.fd)}function xl(D){let{namespace:$,useColors:U}=this;if(U){let I=this.color,F="\x1B[3"+(I<8?I:"8;5;"+I),J=` ${F};1m${$} \x1B[0m`;D[0]=J+D[0].split(`
|
|
94
94
|
`).join(`
|
|
95
95
|
`+J),D.push(F+"m+"+Z5.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=gl()+$+" "+D[0]}function gl(){if(NE.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function fl(...D){return process.stderr.write(w5.formatWithOptions(NE.inspectOpts,...D)+`
|
|
96
96
|
`)}function yl(D){if(D)process.env.DEBUG=D;else delete process.env.DEBUG}function ml(){return process.env.DEBUG}function hl(D){D.inspectOpts={};let $=Object.keys(NE.inspectOpts);for(let U=0;U<$.length;U++)D.inspectOpts[$[U]]=NE.inspectOpts[$[U]]}Z5.exports=EJ()(NE);var{formatters:HE}=Z5.exports;HE.o=function(D){return this.inspectOpts.colors=this.useColors,w5.inspect(D,this.inspectOpts).split(`
|
|
97
|
-
`).map(($)=>$.trim()).join(" ")};HE.O=function(D){return this.inspectOpts.colors=this.useColors,w5.inspect(D,this.inspectOpts)}});var AJ=C((
|
|
97
|
+
`).map(($)=>$.trim()).join(" ")};HE.O=function(D){return this.inspectOpts.colors=this.useColors,w5.inspect(D,this.inspectOpts)}});var AJ=C((v7D,jJ)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)jJ.exports=YE();else jJ.exports=LE()});var aD=C((ol)=>{ol.fromCallback=function(D){return Object.defineProperty(function(...$){if(typeof $[$.length-1]==="function")D.apply(this,$);else return new Promise((U,I)=>{$.push((F,J)=>F!=null?I(F):U(J)),D.apply(this,$)})},"name",{value:D.name})};ol.fromPromise=function(D){return Object.defineProperty(function(...$){let U=$[$.length-1];if(typeof U!=="function")return D.apply(this,$);else $.pop(),D.apply(this,$).then((I)=>U(null,I),U)},"name",{value:D.name})}});var z$=C((RJ)=>{var wE=aD().fromCallback,N$=d0(),sl=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((D)=>{return typeof N$[D]==="function"});Object.assign(RJ,N$);sl.forEach((D)=>{RJ[D]=wE(N$[D])});RJ.exists=function(D,$){if(typeof $==="function")return N$.exists(D,$);return new Promise((U)=>{return N$.exists(D,U)})};RJ.read=function(D,$,U,I,F,J){if(typeof J==="function")return N$.read(D,$,U,I,F,J);return new Promise((X,Q)=>{N$.read(D,$,U,I,F,(Y,W,B)=>{if(Y)return Q(Y);X({bytesRead:W,buffer:B})})})};RJ.write=function(D,$,...U){if(typeof U[U.length-1]==="function")return N$.write(D,$,...U);return new Promise((I,F)=>{N$.write(D,$,...U,(J,X,Q)=>{if(J)return F(J);I({bytesWritten:X,buffer:Q})})})};RJ.readv=function(D,$,...U){if(typeof U[U.length-1]==="function")return N$.readv(D,$,...U);return new Promise((I,F)=>{N$.readv(D,$,...U,(J,X,Q)=>{if(J)return F(J);I({bytesRead:X,buffers:Q})})})};RJ.writev=function(D,$,...U){if(typeof U[U.length-1]==="function")return N$.writev(D,$,...U);return new Promise((I,F)=>{N$.writev(D,$,...U,(J,X,Q)=>{if(J)return F(J);I({bytesWritten:X,buffers:Q})})})};if(typeof N$.realpath.native==="function")RJ.realpath.native=wE(N$.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var ME=C((Jd,ZE)=>{var Id=o("path");Jd.checkPath=function($){if(process.platform==="win32"){if(/[<>:"|?*]/.test($.replace(Id.parse($).root,""))){let I=Error(`Path contains invalid characters: ${$}`);throw I.code="EINVAL",I}}}});var VE=C((Qd,SJ)=>{var OE=z$(),{checkPath:EE}=ME(),vE=(D)=>{let $={mode:511};if(typeof D==="number")return D;return{...$,...D}.mode};Qd.makeDir=async(D,$)=>{return EE(D),OE.mkdir(D,{mode:vE($),recursive:!0})};Qd.makeDirSync=(D,$)=>{return EE(D),OE.mkdirSync(D,{mode:vE($),recursive:!0})}});var $0=C((R7D,jE)=>{var Bd=aD().fromPromise,{makeDir:Kd,makeDirSync:TJ}=VE(),bJ=Bd(Kd);jE.exports={mkdirs:bJ,mkdirsSync:TJ,mkdirp:bJ,mkdirpSync:TJ,ensureDir:bJ,ensureDirSync:TJ}});var t0=C((S7D,RE)=>{var Gd=aD().fromPromise,AE=z$();function qd(D){return AE.access(D).then(()=>!0).catch(()=>!1)}RE.exports={pathExists:Gd(qd),pathExistsSync:AE.existsSync}});var PJ=C((T7D,SE)=>{var Z4=z$(),Hd=aD().fromPromise;async function Nd(D,$,U){let I=await Z4.open(D,"r+"),F=null;try{await Z4.futimes(I,$,U)}catch(J){F=J}finally{try{await Z4.close(I)}catch(J){if(!F)F=J}}if(F)throw F}function zd(D,$,U){let I=Z4.openSync(D,"r+"),F=null;try{Z4.futimesSync(I,$,U)}catch(J){F=J}finally{try{Z4.closeSync(I)}catch(J){if(!F)F=J}}if(F)throw F}SE.exports={utimesMillis:Hd(Nd),utimesMillisSync:zd}});var c6=C((b7D,CE)=>{var M4=z$(),sD=o("path"),TE=aD().fromPromise;function Ld(D,$,U){let I=U.dereference?(F)=>M4.stat(F,{bigint:!0}):(F)=>M4.lstat(F,{bigint:!0});return Promise.all([I(D),I($).catch((F)=>{if(F.code==="ENOENT")return null;throw F})]).then(([F,J])=>({srcStat:F,destStat:J}))}function wd(D,$,U){let I,F=U.dereference?(X)=>M4.statSync(X,{bigint:!0}):(X)=>M4.lstatSync(X,{bigint:!0}),J=F(D);try{I=F($)}catch(X){if(X.code==="ENOENT")return{srcStat:J,destStat:null};throw X}return{srcStat:J,destStat:I}}async function Zd(D,$,U,I){let{srcStat:F,destStat:J}=await Ld(D,$,I);if(J){if(M8(F,J)){let X=sD.basename(D),Q=sD.basename($);if(U==="move"&&X!==Q&&X.toLowerCase()===Q.toLowerCase())return{srcStat:F,destStat:J,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(F.isDirectory()&&!J.isDirectory())throw Error(`Cannot overwrite non-directory '${$}' with directory '${D}'.`);if(!F.isDirectory()&&J.isDirectory())throw Error(`Cannot overwrite directory '${$}' with non-directory '${D}'.`)}if(F.isDirectory()&&CJ(D,$))throw Error(M5(D,$,U));return{srcStat:F,destStat:J}}function Md(D,$,U,I){let{srcStat:F,destStat:J}=wd(D,$,I);if(J){if(M8(F,J)){let X=sD.basename(D),Q=sD.basename($);if(U==="move"&&X!==Q&&X.toLowerCase()===Q.toLowerCase())return{srcStat:F,destStat:J,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(F.isDirectory()&&!J.isDirectory())throw Error(`Cannot overwrite non-directory '${$}' with directory '${D}'.`);if(!F.isDirectory()&&J.isDirectory())throw Error(`Cannot overwrite directory '${$}' with non-directory '${D}'.`)}if(F.isDirectory()&&CJ(D,$))throw Error(M5(D,$,U));return{srcStat:F,destStat:J}}async function bE(D,$,U,I){let F=sD.resolve(sD.dirname(D)),J=sD.resolve(sD.dirname(U));if(J===F||J===sD.parse(J).root)return;let X;try{X=await M4.stat(J,{bigint:!0})}catch(Q){if(Q.code==="ENOENT")return;throw Q}if(M8($,X))throw Error(M5(D,U,I));return bE(D,$,J,I)}function PE(D,$,U,I){let F=sD.resolve(sD.dirname(D)),J=sD.resolve(sD.dirname(U));if(J===F||J===sD.parse(J).root)return;let X;try{X=M4.statSync(J,{bigint:!0})}catch(Q){if(Q.code==="ENOENT")return;throw Q}if(M8($,X))throw Error(M5(D,U,I));return PE(D,$,J,I)}function M8(D,$){return $.ino!==void 0&&$.dev!==void 0&&$.ino===D.ino&&$.dev===D.dev}function CJ(D,$){let U=sD.resolve(D).split(sD.sep).filter((F)=>F),I=sD.resolve($).split(sD.sep).filter((F)=>F);return U.every((F,J)=>I[J]===F)}function M5(D,$,U){return`Cannot ${U} '${D}' to a subdirectory of itself, '${$}'.`}CE.exports={checkPaths:TE(Zd),checkPathsSync:Md,checkParentPaths:TE(bE),checkParentPathsSync:PE,isSrcSubdir:CJ,areIdentical:M8}});var kE=C((P7D,uE)=>{async function Od(D,$){let U=[];for await(let I of D)U.push($(I).then(()=>null,(F)=>F??Error("unknown error")));await Promise.all(U.map((I)=>I.then((F)=>{if(F!==null)throw F})))}uE.exports={asyncIteratorConcurrentProcess:Od}});var yE=C((C7D,fE)=>{var W$=z$(),O8=o("path"),{mkdirs:Ed}=$0(),{pathExists:vd}=t0(),{utimesMillis:Vd}=PJ(),E8=c6(),{asyncIteratorConcurrentProcess:jd}=kE();async function Ad(D,$,U={}){if(typeof U==="function")U={filter:U};if(U.clobber="clobber"in U?!!U.clobber:!0,U.overwrite="overwrite"in U?!!U.overwrite:U.clobber,U.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
98
98
|
|
|
99
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:I,destStat:F}=await E8.checkPaths(D,$,"copy",U);if(await E8.checkParentPaths(D,I,$,"copy"),!await xE(D,$,U))return;let X=O8.dirname($);if(!await vd(X))await Ed(X);await gE(F,D,$,U)}async function xE(D,$,U){if(!U.filter)return!0;return U.filter(D,$)}async function gE(D,$,U,I){let J=await(I.dereference?W$.stat:W$.lstat)($);if(J.isDirectory())return bd(J,D,$,U,I);if(J.isFile()||J.isCharacterDevice()||J.isBlockDevice())return Rd(J,D,$,U,I);if(J.isSymbolicLink())return Pd(D,$,U,I);if(J.isSocket())throw Error(`Cannot copy a socket file: ${$}`);if(J.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${$}`);throw Error(`Unknown file: ${$}`)}async function Rd(D,$,U,I,F){if(!$)return _E(D,U,I,F);if(F.overwrite)return await W$.unlink(I),_E(D,U,I,F);if(F.errorOnExist)throw Error(`'${I}' already exists`)}async function _E(D,$,U,I){if(await W$.copyFile($,U),I.preserveTimestamps){if(Sd(D.mode))await Td(U,D.mode);let F=await W$.stat($);await Vd(U,F.atime,F.mtime)}return W$.chmod(U,D.mode)}function Sd(D){return(D&128)===0}function Td(D,$){return W$.chmod(D,$|128)}async function bd(D,$,U,I,F){if(!$)await W$.mkdir(I);if(await jd(await W$.opendir(U),async(J)=>{let X=O8.join(U,J.name),Q=O8.join(I,J.name);if(await xE(X,Q,F)){let{destStat:W}=await E8.checkPaths(X,Q,"copy",F);await gE(W,X,Q,F)}}),!$)await W$.chmod(I,D.mode)}async function Pd(D,$,U,I){let F=await W$.readlink($);if(I.dereference)F=O8.resolve(process.cwd(),F);if(!D)return W$.symlink(F,U);let J=null;try{J=await W$.readlink(U)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return W$.symlink(F,U);throw X}if(I.dereference)J=O8.resolve(process.cwd(),J);if(F!==J){if(E8.isSrcSubdir(F,J))throw Error(`Cannot copy '${F}' to a subdirectory of itself, '${J}'.`);if(E8.isSrcSubdir(J,F))throw Error(`Cannot overwrite '${J}' with '${F}'.`)}return await W$.unlink(U),W$.symlink(F,U)}fE.exports=Ad});var lE=C((
|
|
99
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:I,destStat:F}=await E8.checkPaths(D,$,"copy",U);if(await E8.checkParentPaths(D,I,$,"copy"),!await xE(D,$,U))return;let X=O8.dirname($);if(!await vd(X))await Ed(X);await gE(F,D,$,U)}async function xE(D,$,U){if(!U.filter)return!0;return U.filter(D,$)}async function gE(D,$,U,I){let J=await(I.dereference?W$.stat:W$.lstat)($);if(J.isDirectory())return bd(J,D,$,U,I);if(J.isFile()||J.isCharacterDevice()||J.isBlockDevice())return Rd(J,D,$,U,I);if(J.isSymbolicLink())return Pd(D,$,U,I);if(J.isSocket())throw Error(`Cannot copy a socket file: ${$}`);if(J.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${$}`);throw Error(`Unknown file: ${$}`)}async function Rd(D,$,U,I,F){if(!$)return _E(D,U,I,F);if(F.overwrite)return await W$.unlink(I),_E(D,U,I,F);if(F.errorOnExist)throw Error(`'${I}' already exists`)}async function _E(D,$,U,I){if(await W$.copyFile($,U),I.preserveTimestamps){if(Sd(D.mode))await Td(U,D.mode);let F=await W$.stat($);await Vd(U,F.atime,F.mtime)}return W$.chmod(U,D.mode)}function Sd(D){return(D&128)===0}function Td(D,$){return W$.chmod(D,$|128)}async function bd(D,$,U,I,F){if(!$)await W$.mkdir(I);if(await jd(await W$.opendir(U),async(J)=>{let X=O8.join(U,J.name),Q=O8.join(I,J.name);if(await xE(X,Q,F)){let{destStat:W}=await E8.checkPaths(X,Q,"copy",F);await gE(W,X,Q,F)}}),!$)await W$.chmod(I,D.mode)}async function Pd(D,$,U,I){let F=await W$.readlink($);if(I.dereference)F=O8.resolve(process.cwd(),F);if(!D)return W$.symlink(F,U);let J=null;try{J=await W$.readlink(U)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return W$.symlink(F,U);throw X}if(I.dereference)J=O8.resolve(process.cwd(),J);if(F!==J){if(E8.isSrcSubdir(F,J))throw Error(`Cannot copy '${F}' to a subdirectory of itself, '${J}'.`);if(E8.isSrcSubdir(J,F))throw Error(`Cannot overwrite '${J}' with '${F}'.`)}return await W$.unlink(U),W$.symlink(F,U)}fE.exports=Ad});var lE=C((u7D,iE)=>{var L$=d0(),v8=o("path"),Cd=$0().mkdirsSync,ud=PJ().utimesMillisSync,V8=c6();function kd(D,$,U){if(typeof U==="function")U={filter:U};if(U=U||{},U.clobber="clobber"in U?!!U.clobber:!0,U.overwrite="overwrite"in U?!!U.overwrite:U.clobber,U.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
100
100
|
|
|
101
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:I,destStat:F}=V8.checkPathsSync(D,$,"copy",U);if(V8.checkParentPathsSync(D,I,$,"copy"),U.filter&&!U.filter(D,$))return;let J=v8.dirname($);if(!L$.existsSync(J))Cd(J);return mE(F,D,$,U)}function mE(D,$,U,I){let J=(I.dereference?L$.statSync:L$.lstatSync)($);if(J.isDirectory())return hd(J,D,$,U,I);else if(J.isFile()||J.isCharacterDevice()||J.isBlockDevice())return _d(J,D,$,U,I);else if(J.isSymbolicLink())return ld(D,$,U,I);else if(J.isSocket())throw Error(`Cannot copy a socket file: ${$}`);else if(J.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${$}`);throw Error(`Unknown file: ${$}`)}function _d(D,$,U,I,F){if(!$)return hE(D,U,I,F);return xd(D,U,I,F)}function xd(D,$,U,I){if(I.overwrite)return L$.unlinkSync(U),hE(D,$,U,I);else if(I.errorOnExist)throw Error(`'${U}' already exists`)}function hE(D,$,U,I){if(L$.copyFileSync($,U),I.preserveTimestamps)gd(D.mode,$,U);return uJ(U,D.mode)}function gd(D,$,U){if(fd(D))yd(U,D);return md($,U)}function fd(D){return(D&128)===0}function yd(D,$){return uJ(D,$|128)}function uJ(D,$){return L$.chmodSync(D,$)}function md(D,$){let U=L$.statSync(D);return ud($,U.atime,U.mtime)}function hd(D,$,U,I,F){if(!$)return nd(D.mode,U,I,F);return nE(U,I,F)}function nd(D,$,U,I){return L$.mkdirSync(U),nE($,U,I),uJ(U,D)}function nE(D,$,U){let I=L$.opendirSync(D);try{let F;while((F=I.readSync())!==null)id(F.name,D,$,U)}finally{I.closeSync()}}function id(D,$,U,I){let F=v8.join($,D),J=v8.join(U,D);if(I.filter&&!I.filter(F,J))return;let{destStat:X}=V8.checkPathsSync(F,J,"copy",I);return mE(X,F,J,I)}function ld(D,$,U,I){let F=L$.readlinkSync($);if(I.dereference)F=v8.resolve(process.cwd(),F);if(!D)return L$.symlinkSync(F,U);else{let J;try{J=L$.readlinkSync(U)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return L$.symlinkSync(F,U);throw X}if(I.dereference)J=v8.resolve(process.cwd(),J);if(F!==J){if(V8.isSrcSubdir(F,J))throw Error(`Cannot copy '${F}' to a subdirectory of itself, '${J}'.`);if(V8.isSrcSubdir(J,F))throw Error(`Cannot overwrite '${J}' with '${F}'.`)}return dd(F,U)}}function dd(D,$){return L$.unlinkSync($),L$.symlinkSync(D,$)}iE.exports=kd});var O5=C((
|
|
102
|
-
`,finalEOL:U=!0,replacer:I=null,spaces:F}={}){let J=U?$:"",X=JSON.stringify(D,I,F);if(X===void 0)throw TypeError(`Converting ${typeof D} value to JSON is not supported`);return X.replace(/\n/g,$)+J}function Ec(D){if(Buffer.isBuffer(D))D=D.toString("utf8");return D.replace(/^\uFEFF/,"")}Rv.exports={stringify:Oc,stripBom:Ec}});var Pv=C((i7D,bv)=>{var O4;try{O4=d0()}catch(D){O4=o("fs")}var v5=aD(),{stringify:Sv,stripBom:Tv}=E5();async function vc(D,$={}){if(typeof $==="string")$={encoding:$};let U=$.fs||O4,I="throws"in $?$.throws:!0,F=await v5.fromCallback(U.readFile)(D,$);F=Tv(F);let J;try{J=JSON.parse(F,$?$.reviver:null)}catch(X){if(I)throw X.message=`${D}: ${X.message}`,X;else return null}return J}var Vc=v5.fromPromise(vc);function jc(D,$={}){if(typeof $==="string")$={encoding:$};let U=$.fs||O4,I="throws"in $?$.throws:!0;try{let F=U.readFileSync(D,$);return F=Tv(F),JSON.parse(F,$.reviver)}catch(F){if(I)throw F.message=`${D}: ${F.message}`,F;else return null}}async function Ac(D,$,U={}){let I=U.fs||O4,F=Sv($,U);await v5.fromCallback(I.writeFile)(D,F,U)}var Rc=v5.fromPromise(Ac);function Sc(D,$,U={}){let I=U.fs||O4,F=Sv($,U);return I.writeFileSync(D,F,U)}bv.exports={readFile:Vc,readFileSync:jc,writeFile:Rc,writeFileSync:Sc}});var uv=C((l7D,Cv)=>{var V5=Pv();Cv.exports={readJson:V5.readFile,readJsonSync:V5.readFileSync,writeJson:V5.writeFile,writeJsonSync:V5.writeFileSync}});var j5=C((d7D,xv)=>{var Tc=aD().fromPromise,kJ=z$(),kv=o("path"),_v=$0(),bc=t0().pathExists;async function Pc(D,$,U="utf-8"){let I=kv.dirname(D);if(!await bc(I))await _v.mkdirs(I);return kJ.writeFile(D,$,U)}function Cc(D,...$){let U=kv.dirname(D);if(!kJ.existsSync(U))_v.mkdirsSync(U);kJ.writeFileSync(D,...$)}xv.exports={outputFile:Tc(Pc),outputFileSync:Cc}});var fv=C((c7D,gv)=>{var{stringify:uc}=E5(),{outputFile:kc}=j5();async function _c(D,$,U={}){let I=uc($,U);await kc(D,I,U)}gv.exports=_c});var mv=C((p7D,yv)=>{var{stringify:xc}=E5(),{outputFileSync:gc}=j5();function fc(D,$,U){let I=xc($,U);gc(D,I,U)}yv.exports=fc});var nv=C((r7D,hv)=>{var yc=aD().fromPromise,w$=uv();w$.outputJson=yc(fv());w$.outputJsonSync=mv();w$.outputJSON=w$.outputJson;w$.outputJSONSync=w$.outputJsonSync;w$.writeJSON=w$.writeJson;w$.writeJSONSync=w$.writeJsonSync;w$.readJSON=w$.readJson;w$.readJSONSync=w$.readJsonSync;hv.exports=w$});var pv=C((o7D,cv)=>{var mc=z$(),iv=o("path"),{copy:hc}=O5(),{remove:dv}=j8(),{mkdirp:nc}=$0(),{pathExists:ic}=t0(),lv=c6();async function lc(D,$,U={}){let I=U.overwrite||U.clobber||!1,{srcStat:F,isChangingCase:J=!1}=await lv.checkPaths(D,$,"move",U);await lv.checkParentPaths(D,F,$,"move");let X=iv.dirname($);if(iv.parse(X).root!==X)await nc(X);return dc(D,$,I,J)}async function dc(D,$,U,I){if(!I){if(U)await dv($);else if(await ic($))throw Error("dest already exists.")}try{await mc.rename(D,$)}catch(F){if(F.code!=="EXDEV")throw F;await cc(D,$,U)}}async function cc(D,$,U){return await hc(D,$,{overwrite:U,errorOnExist:!0,preserveTimestamps:!0}),dv(D)}cv.exports=lc});var sv=C((t7D,av)=>{var ov=d0(),xJ=o("path"),pc=O5().copySync,tv=j8().removeSync,rc=$0().mkdirpSync,rv=c6();function oc(D,$,U){U=U||{};let I=U.overwrite||U.clobber||!1,{srcStat:F,isChangingCase:J=!1}=rv.checkPathsSync(D,$,"move",U);if(rv.checkParentPathsSync(D,F,$,"move"),!tc($))rc(xJ.dirname($));return ac(D,$,I,J)}function tc(D){let $=xJ.dirname(D);return xJ.parse($).root===$}function ac(D,$,U,I){if(I)return _J(D,$,U);if(U)return tv($),_J(D,$,U);if(ov.existsSync($))throw Error("dest already exists.");return _J(D,$,U)}function _J(D,$,U){try{ov.renameSync(D,$)}catch(I){if(I.code!=="EXDEV")throw I;return sc(D,$,U)}}function sc(D,$,U){return pc(D,$,{overwrite:U,errorOnExist:!0,preserveTimestamps:!0}),tv(D)}av.exports=oc});var DV=C((a7D,ev)=>{var ec=aD().fromPromise;ev.exports={move:ec(pv()),moveSync:sv()}});var E4=C((s7D,$V)=>{$V.exports={...z$(),...O5(),...$v(),...Av(),...nv(),...$0(),...DV(),...j5(),...t0(),...j8()}});var YV=C((e7D,QV)=>{var gJ,FV,IV,JV,XV=!0;if(typeof process<"u")({FORCE_COLOR:gJ,NODE_DISABLE_COLORS:FV,NO_COLOR:IV,TERM:JV}=process.env||{}),XV=process.stdout&&process.stdout.isTTY;var VD={enabled:!FV&&IV==null&&JV!=="dumb"&&(gJ!=null&&gJ!=="0"||XV),reset:PD(0,0),bold:PD(1,22),dim:PD(2,22),italic:PD(3,23),underline:PD(4,24),inverse:PD(7,27),hidden:PD(8,28),strikethrough:PD(9,29),black:PD(30,39),red:PD(31,39),green:PD(32,39),yellow:PD(33,39),blue:PD(34,39),magenta:PD(35,39),cyan:PD(36,39),white:PD(37,39),gray:PD(90,39),grey:PD(90,39),bgBlack:PD(40,49),bgRed:PD(41,49),bgGreen:PD(42,49),bgYellow:PD(43,49),bgBlue:PD(44,49),bgMagenta:PD(45,49),bgCyan:PD(46,49),bgWhite:PD(47,49)};function UV(D,$){let U=0,I,F="",J="";for(;U<D.length;U++)if(I=D[U],F+=I.open,J+=I.close,~$.indexOf(I.close))$=$.replace(I.rgx,I.close+I.open);return F+$+J}function Dp(D,$){let U={has:D,keys:$};return U.reset=VD.reset.bind(U),U.bold=VD.bold.bind(U),U.dim=VD.dim.bind(U),U.italic=VD.italic.bind(U),U.underline=VD.underline.bind(U),U.inverse=VD.inverse.bind(U),U.hidden=VD.hidden.bind(U),U.strikethrough=VD.strikethrough.bind(U),U.black=VD.black.bind(U),U.red=VD.red.bind(U),U.green=VD.green.bind(U),U.yellow=VD.yellow.bind(U),U.blue=VD.blue.bind(U),U.magenta=VD.magenta.bind(U),U.cyan=VD.cyan.bind(U),U.white=VD.white.bind(U),U.gray=VD.gray.bind(U),U.grey=VD.grey.bind(U),U.bgBlack=VD.bgBlack.bind(U),U.bgRed=VD.bgRed.bind(U),U.bgGreen=VD.bgGreen.bind(U),U.bgYellow=VD.bgYellow.bind(U),U.bgBlue=VD.bgBlue.bind(U),U.bgMagenta=VD.bgMagenta.bind(U),U.bgCyan=VD.bgCyan.bind(U),U.bgWhite=VD.bgWhite.bind(U),U}function PD(D,$){let U={open:`\x1B[${D}m`,close:`\x1B[${$}m`,rgx:new RegExp(`\\x1b\\[${$}m`,"g")};return function(I){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf(D)||(this.has.push(D),this.keys.push(U)),I===void 0?this:VD.enabled?UV(this.keys,I+""):I+"";return I===void 0?Dp([D],[U]):VD.enabled?UV([U],I+""):I+""}}QV.exports=VD});var v4=C((WV)=>{Object.defineProperty(WV,"__esModule",{value:!0});WV.ancillary=WV.failure=WV.success=WV.input=WV.weak=WV.strong=void 0;var $p=A$(),G0=$p.__importDefault(YV());WV.strong=G0.default.bold;WV.weak=G0.default.dim;WV.input=G0.default.cyan;WV.success=G0.default.green;WV.failure=G0.default.red;WV.ancillary=G0.default.cyan;var Up={strong:WV.strong,weak:WV.weak,input:WV.input,success:WV.success,failure:WV.failure,ancillary:WV.ancillary,log:{DEBUG:G0.default.magenta,INFO:G0.default.cyan,WARN:G0.default.yellow,ERROR:G0.default.red}};WV.default=Up});var yJ=C((NV)=>{Object.defineProperty(NV,"__esModule",{value:!0});NV.EscapeCode=void 0;var U0="\x1B[";class U${}NV.EscapeCode=U$;U$.cursorLeft=()=>`${U0}G`;U$.cursorUp=(D=1)=>`${U0}${D}A`;U$.cursorDown=(D=1)=>`${U0}${D}B`;U$.cursorForward=(D=1)=>`${U0}${D}C`;U$.cursorBackward=(D=1)=>`${U0}${D}D`;U$.cursorHide=()=>`${U0}?25l`;U$.cursorShow=()=>`${U0}?25h`;U$.eraseLine=()=>`${U0}2K`;U$.eraseLines=(D)=>{let $="";for(let U=0;U<D;U++)if($+=U$.eraseLine(),U<D-1)$+=U$.cursorUp();return`${$}${U$.cursorLeft()}`};U$.eraseUp=()=>`${U0}1J`;U$.eraseDown=()=>`${U0}J`;U$.eraseScreen=()=>`${U0}2J`});var MV=C((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});wV.Cursor=void 0;var Ip=A$(),Jp=Ip.__importDefault(YJ()),LV=yJ();class F${static show(){if(F$.stream.isTTY)F$._isVisible=!0,F$.stream.write(LV.EscapeCode.cursorShow())}static hide(){if(F$.stream.isTTY){if(!F$._listenerAttached)(0,Jp.default)(()=>{F$.show()}),F$._listenerAttached=!0;F$._isVisible=!1,F$.stream.write(LV.EscapeCode.cursorHide())}}static toggle(){if(F$._isVisible)F$.hide();else F$.show()}}wV.Cursor=F$;F$.stream=process.stderr;F$._isVisible=!0;F$._listenerAttached=!1});var hJ=C((FUD,mJ)=>{var OV=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};mJ.exports=OV;mJ.exports.default=OV});var vV=C((IUD,EV)=>{var Xp=(D)=>D&&D.exact?new RegExp(`^${"[\uD800-\uDBFF][\uDC00-\uDFFF]"}$`):new RegExp("[\uD800-\uDBFF][\uDC00-\uDFFF]","g");EV.exports=Xp});var jV=C((JUD,VV)=>{VV.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var nJ=C((XUD,RV)=>{var R8=jV(),AV={};for(let D of Object.keys(R8))AV[R8[D]]=D;var e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};RV.exports=e;for(let D of Object.keys(e)){if(!("channels"in e[D]))throw Error("missing channels property: "+D);if(!("labels"in e[D]))throw Error("missing channel labels property: "+D);if(e[D].labels.length!==e[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:$,labels:U}=e[D];delete e[D].channels,delete e[D].labels,Object.defineProperty(e[D],"channels",{value:$}),Object.defineProperty(e[D],"labels",{value:U})}e.rgb.hsl=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255,F=Math.min($,U,I),J=Math.max($,U,I),X=J-F,Q,Y;if(J===F)Q=0;else if($===J)Q=(U-I)/X;else if(U===J)Q=2+(I-$)/X;else if(I===J)Q=4+($-U)/X;if(Q=Math.min(Q*60,360),Q<0)Q+=360;let W=(F+J)/2;if(J===F)Y=0;else if(W<=0.5)Y=X/(J+F);else Y=X/(2-J-F);return[Q,Y*100,W*100]};e.rgb.hsv=function(D){let $,U,I,F,J,X=D[0]/255,Q=D[1]/255,Y=D[2]/255,W=Math.max(X,Q,Y),B=W-Math.min(X,Q,Y),K=function(q){return(W-q)/6/B+0.5};if(B===0)F=0,J=0;else{if(J=B/W,$=K(X),U=K(Q),I=K(Y),X===W)F=I-U;else if(Q===W)F=0.3333333333333333+$-I;else if(Y===W)F=0.6666666666666666+U-$;if(F<0)F+=1;else if(F>1)F-=1}return[F*360,J*100,W*100]};e.rgb.hwb=function(D){let $=D[0],U=D[1],I=D[2],F=e.rgb.hsl(D)[0],J=0.00392156862745098*Math.min($,Math.min(U,I));return I=1-0.00392156862745098*Math.max($,Math.max(U,I)),[F,J*100,I*100]};e.rgb.cmyk=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255,F=Math.min(1-$,1-U,1-I),J=(1-$-F)/(1-F)||0,X=(1-U-F)/(1-F)||0,Q=(1-I-F)/(1-F)||0;return[J*100,X*100,Q*100,F*100]};function Qp(D,$){return(D[0]-$[0])**2+(D[1]-$[1])**2+(D[2]-$[2])**2}e.rgb.keyword=function(D){let $=AV[D];if($)return $;let U=1/0,I;for(let F of Object.keys(R8)){let J=R8[F],X=Qp(D,J);if(X<U)U=X,I=F}return I};e.keyword.rgb=function(D){return R8[D]};e.rgb.xyz=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255;$=$>0.04045?(($+0.055)/1.055)**2.4:$/12.92,U=U>0.04045?((U+0.055)/1.055)**2.4:U/12.92,I=I>0.04045?((I+0.055)/1.055)**2.4:I/12.92;let F=$*0.4124+U*0.3576+I*0.1805,J=$*0.2126+U*0.7152+I*0.0722,X=$*0.0193+U*0.1192+I*0.9505;return[F*100,J*100,X*100]};e.rgb.lab=function(D){let $=e.rgb.xyz(D),U=$[0],I=$[1],F=$[2];U/=95.047,I/=100,F/=108.883,U=U>0.008856?U**0.3333333333333333:7.787*U+0.13793103448275862,I=I>0.008856?I**0.3333333333333333:7.787*I+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862;let J=116*I-16,X=500*(U-I),Q=200*(I-F);return[J,X,Q]};e.hsl.rgb=function(D){let $=D[0]/360,U=D[1]/100,I=D[2]/100,F,J,X;if(U===0)return X=I*255,[X,X,X];if(I<0.5)F=I*(1+U);else F=I+U-I*U;let Q=2*I-F,Y=[0,0,0];for(let W=0;W<3;W++){if(J=$+0.3333333333333333*-(W-1),J<0)J++;if(J>1)J--;if(6*J<1)X=Q+(F-Q)*6*J;else if(2*J<1)X=F;else if(3*J<2)X=Q+(F-Q)*(0.6666666666666666-J)*6;else X=Q;Y[W]=X*255}return Y};e.hsl.hsv=function(D){let $=D[0],U=D[1]/100,I=D[2]/100,F=U,J=Math.max(I,0.01);I*=2,U*=I<=1?I:2-I,F*=J<=1?J:2-J;let X=(I+U)/2,Q=I===0?2*F/(J+F):2*U/(I+U);return[$,Q*100,X*100]};e.hsv.rgb=function(D){let $=D[0]/60,U=D[1]/100,I=D[2]/100,F=Math.floor($)%6,J=$-Math.floor($),X=255*I*(1-U),Q=255*I*(1-U*J),Y=255*I*(1-U*(1-J));switch(I*=255,F){case 0:return[I,Y,X];case 1:return[Q,I,X];case 2:return[X,I,Y];case 3:return[X,Q,I];case 4:return[Y,X,I];case 5:return[I,X,Q]}};e.hsv.hsl=function(D){let $=D[0],U=D[1]/100,I=D[2]/100,F=Math.max(I,0.01),J,X;X=(2-U)*I;let Q=(2-U)*F;return J=U*F,J/=Q<=1?Q:2-Q,J=J||0,X/=2,[$,J*100,X*100]};e.hwb.rgb=function(D){let $=D[0]/360,U=D[1]/100,I=D[2]/100,F=U+I,J;if(F>1)U/=F,I/=F;let X=Math.floor(6*$),Q=1-I;if(J=6*$-X,(X&1)!==0)J=1-J;let Y=U+J*(Q-U),W,B,K;switch(X){default:case 6:case 0:W=Q,B=Y,K=U;break;case 1:W=Y,B=Q,K=U;break;case 2:W=U,B=Q,K=Y;break;case 3:W=U,B=Y,K=Q;break;case 4:W=Y,B=U,K=Q;break;case 5:W=Q,B=U,K=Y;break}return[W*255,B*255,K*255]};e.cmyk.rgb=function(D){let $=D[0]/100,U=D[1]/100,I=D[2]/100,F=D[3]/100,J=1-Math.min(1,$*(1-F)+F),X=1-Math.min(1,U*(1-F)+F),Q=1-Math.min(1,I*(1-F)+F);return[J*255,X*255,Q*255]};e.xyz.rgb=function(D){let $=D[0]/100,U=D[1]/100,I=D[2]/100,F,J,X;return F=$*3.2406+U*-1.5372+I*-0.4986,J=$*-0.9689+U*1.8758+I*0.0415,X=$*0.0557+U*-0.204+I*1.057,F=F>0.0031308?1.055*F**0.4166666666666667-0.055:F*12.92,J=J>0.0031308?1.055*J**0.4166666666666667-0.055:J*12.92,X=X>0.0031308?1.055*X**0.4166666666666667-0.055:X*12.92,F=Math.min(Math.max(0,F),1),J=Math.min(Math.max(0,J),1),X=Math.min(Math.max(0,X),1),[F*255,J*255,X*255]};e.xyz.lab=function(D){let $=D[0],U=D[1],I=D[2];$/=95.047,U/=100,I/=108.883,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,U=U>0.008856?U**0.3333333333333333:7.787*U+0.13793103448275862,I=I>0.008856?I**0.3333333333333333:7.787*I+0.13793103448275862;let F=116*U-16,J=500*($-U),X=200*(U-I);return[F,J,X]};e.lab.xyz=function(D){let $=D[0],U=D[1],I=D[2],F,J,X;J=($+16)/116,F=U/500+J,X=J-I/200;let Q=J**3,Y=F**3,W=X**3;return J=Q>0.008856?Q:(J-0.13793103448275862)/7.787,F=Y>0.008856?Y:(F-0.13793103448275862)/7.787,X=W>0.008856?W:(X-0.13793103448275862)/7.787,F*=95.047,J*=100,X*=108.883,[F,J,X]};e.lab.lch=function(D){let $=D[0],U=D[1],I=D[2],F;if(F=Math.atan2(I,U)*360/2/Math.PI,F<0)F+=360;let X=Math.sqrt(U*U+I*I);return[$,X,F]};e.lch.lab=function(D){let $=D[0],U=D[1],F=D[2]/360*2*Math.PI,J=U*Math.cos(F),X=U*Math.sin(F);return[$,J,X]};e.rgb.ansi16=function(D,$=null){let[U,I,F]=D,J=$===null?e.rgb.hsv(D)[2]:$;if(J=Math.round(J/50),J===0)return 30;let X=30+(Math.round(F/255)<<2|Math.round(I/255)<<1|Math.round(U/255));if(J===2)X+=60;return X};e.hsv.ansi16=function(D){return e.rgb.ansi16(e.hsv.rgb(D),D[2])};e.rgb.ansi256=function(D){let $=D[0],U=D[1],I=D[2];if($===U&&U===I){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(U/255*5)+Math.round(I/255*5)};e.ansi16.rgb=function(D){let $=D%10;if($===0||$===7){if(D>50)$+=3.5;return $=$/10.5*255,[$,$,$]}let U=(~~(D>50)+1)*0.5,I=($&1)*U*255,F=($>>1&1)*U*255,J=($>>2&1)*U*255;return[I,F,J]};e.ansi256.rgb=function(D){if(D>=232){let J=(D-232)*10+8;return[J,J,J]}D-=16;let $,U=Math.floor(D/36)/5*255,I=Math.floor(($=D%36)/6)/5*255,F=$%6/5*255;return[U,I,F]};e.rgb.hex=function(D){let U=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(U.length)+U};e.hex.rgb=function(D){let $=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!$)return[0,0,0];let U=$[0];if($[0].length===3)U=U.split("").map((Q)=>{return Q+Q}).join("");let I=parseInt(U,16),F=I>>16&255,J=I>>8&255,X=I&255;return[F,J,X]};e.rgb.hcg=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255,F=Math.max(Math.max($,U),I),J=Math.min(Math.min($,U),I),X=F-J,Q,Y;if(X<1)Q=J/(1-X);else Q=0;if(X<=0)Y=0;else if(F===$)Y=(U-I)/X%6;else if(F===U)Y=2+(I-$)/X;else Y=4+($-U)/X;return Y/=6,Y%=1,[Y*360,X*100,Q*100]};e.hsl.hcg=function(D){let $=D[1]/100,U=D[2]/100,I=U<0.5?2*$*U:2*$*(1-U),F=0;if(I<1)F=(U-0.5*I)/(1-I);return[D[0],I*100,F*100]};e.hsv.hcg=function(D){let $=D[1]/100,U=D[2]/100,I=$*U,F=0;if(I<1)F=(U-I)/(1-I);return[D[0],I*100,F*100]};e.hcg.rgb=function(D){let $=D[0]/360,U=D[1]/100,I=D[2]/100;if(U===0)return[I*255,I*255,I*255];let F=[0,0,0],J=$%1*6,X=J%1,Q=1-X,Y=0;switch(Math.floor(J)){case 0:F[0]=1,F[1]=X,F[2]=0;break;case 1:F[0]=Q,F[1]=1,F[2]=0;break;case 2:F[0]=0,F[1]=1,F[2]=X;break;case 3:F[0]=0,F[1]=Q,F[2]=1;break;case 4:F[0]=X,F[1]=0,F[2]=1;break;default:F[0]=1,F[1]=0,F[2]=Q}return Y=(1-U)*I,[(U*F[0]+Y)*255,(U*F[1]+Y)*255,(U*F[2]+Y)*255]};e.hcg.hsv=function(D){let $=D[1]/100,U=D[2]/100,I=$+U*(1-$),F=0;if(I>0)F=$/I;return[D[0],F*100,I*100]};e.hcg.hsl=function(D){let $=D[1]/100,I=D[2]/100*(1-$)+0.5*$,F=0;if(I>0&&I<0.5)F=$/(2*I);else if(I>=0.5&&I<1)F=$/(2*(1-I));return[D[0],F*100,I*100]};e.hcg.hwb=function(D){let $=D[1]/100,U=D[2]/100,I=$+U*(1-$);return[D[0],(I-$)*100,(1-I)*100]};e.hwb.hcg=function(D){let $=D[1]/100,I=1-D[2]/100,F=I-$,J=0;if(F<1)J=(I-F)/(1-F);return[D[0],F*100,J*100]};e.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};e.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};e.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};e.gray.hsl=function(D){return[0,0,D[0]]};e.gray.hsv=e.gray.hsl;e.gray.hwb=function(D){return[0,100,D[0]]};e.gray.cmyk=function(D){return[0,0,0,D[0]]};e.gray.lab=function(D){return[D[0],0,0]};e.gray.hex=function(D){let $=Math.round(D[0]/100*255)&255,I=(($<<16)+($<<8)+$).toString(16).toUpperCase();return"000000".substring(I.length)+I};e.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var TV=C((QUD,SV)=>{var A5=nJ();function Yp(){let D={},$=Object.keys(A5);for(let U=$.length,I=0;I<U;I++)D[$[I]]={distance:-1,parent:null};return D}function Wp(D){let $=Yp(),U=[D];$[D].distance=0;while(U.length){let I=U.pop(),F=Object.keys(A5[I]);for(let J=F.length,X=0;X<J;X++){let Q=F[X],Y=$[Q];if(Y.distance===-1)Y.distance=$[I].distance+1,Y.parent=I,U.unshift(Q)}}return $}function Bp(D,$){return function(U){return $(D(U))}}function Kp(D,$){let U=[$[D].parent,D],I=A5[$[D].parent][D],F=$[D].parent;while($[F].parent)U.unshift($[F].parent),I=Bp(A5[$[F].parent][F],I),F=$[F].parent;return I.conversion=U,I}SV.exports=function(D){let $=Wp(D),U={},I=Object.keys($);for(let F=I.length,J=0;J<F;J++){let X=I[J];if($[X].parent===null)continue;U[X]=Kp(X,$)}return U}});var PV=C((YUD,bV)=>{var iJ=nJ(),Gp=TV(),V4={},qp=Object.keys(iJ);function Hp(D){let $=function(...U){let I=U[0];if(I===void 0||I===null)return I;if(I.length>1)U=I;return D(U)};if("conversion"in D)$.conversion=D.conversion;return $}function Np(D){let $=function(...U){let I=U[0];if(I===void 0||I===null)return I;if(I.length>1)U=I;let F=D(U);if(typeof F==="object")for(let J=F.length,X=0;X<J;X++)F[X]=Math.round(F[X]);return F};if("conversion"in D)$.conversion=D.conversion;return $}qp.forEach((D)=>{V4[D]={},Object.defineProperty(V4[D],"channels",{value:iJ[D].channels}),Object.defineProperty(V4[D],"labels",{value:iJ[D].labels});let $=Gp(D);Object.keys($).forEach((I)=>{let F=$[I];V4[D][I]=Np(F),V4[D][I].raw=Hp(F)})});bV.exports=V4});var dJ=C((WUD,xV)=>{var CV=(D,$)=>(...U)=>{return`\x1B[${D(...U)+$}m`},uV=(D,$)=>(...U)=>{let I=D(...U);return`\x1B[${38+$};5;${I}m`},kV=(D,$)=>(...U)=>{let I=D(...U);return`\x1B[${38+$};2;${I[0]};${I[1]};${I[2]}m`},R5=(D)=>D,_V=(D,$,U)=>[D,$,U],j4=(D,$,U)=>{Object.defineProperty(D,$,{get:()=>{let I=U();return Object.defineProperty(D,$,{value:I,enumerable:!0,configurable:!0}),I},enumerable:!0,configurable:!0})},lJ,A4=(D,$,U,I)=>{if(lJ===void 0)lJ=PV();let F=I?10:0,J={};for(let[X,Q]of Object.entries(lJ)){let Y=X==="ansi16"?"ansi":X;if(X===$)J[Y]=D(U,F);else if(typeof Q==="object")J[Y]=D(Q[$],F)}return J};function zp(){let D=new Map,$={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};$.color.gray=$.color.blackBright,$.bgColor.bgGray=$.bgColor.bgBlackBright,$.color.grey=$.color.blackBright,$.bgColor.bgGrey=$.bgColor.bgBlackBright;for(let[U,I]of Object.entries($)){for(let[F,J]of Object.entries(I))$[F]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},I[F]=$[F],D.set(J[0],J[1]);Object.defineProperty($,U,{value:I,enumerable:!1})}return Object.defineProperty($,"codes",{value:D,enumerable:!1}),$.color.close="\x1B[39m",$.bgColor.close="\x1B[49m",j4($.color,"ansi",()=>A4(CV,"ansi16",R5,!1)),j4($.color,"ansi256",()=>A4(uV,"ansi256",R5,!1)),j4($.color,"ansi16m",()=>A4(kV,"rgb",_V,!1)),j4($.bgColor,"ansi",()=>A4(CV,"ansi16",R5,!0)),j4($.bgColor,"ansi256",()=>A4(uV,"ansi256",R5,!0)),j4($.bgColor,"ansi16m",()=>A4(kV,"rgb",_V,!0)),$}Object.defineProperty(xV,"exports",{enumerable:!0,get:zp})});var hV=C((BUD,mV)=>{var Lp=hJ(),wp=vV(),gV=dJ(),yV=["\x1B",""],S5=(D)=>`${yV[0]}[${D}m`,fV=(D,$,U)=>{let I=[];D=[...D];for(let F of D){let J=F;if(F.includes(";"))F=F.split(";")[0][0]+"0";let X=gV.codes.get(Number.parseInt(F,10));if(X){let Q=D.indexOf(X.toString());if(Q===-1)I.push(S5($?X:J));else D.splice(Q,1)}else if($){I.push(S5(0));break}else I.push(S5(J))}if($){if(I=I.filter((F,J)=>I.indexOf(F)===J),U!==void 0){let F=S5(gV.codes.get(Number.parseInt(U,10)));I=I.reduce((J,X)=>X===F?[X,...J]:[...J,X],[])}}return I.join("")};mV.exports=(D,$,U)=>{let I=[...D],F=[],J=typeof U==="number"?U:I.length,X=!1,Q,Y=0,W="";for(let[B,K]of I.entries()){let q=!1;if(yV.includes(K)){let H=/\d[^m]*/.exec(D.slice(B,B+18));if(Q=H&&H.length>0?H[0]:void 0,Y<J){if(X=!0,Q!==void 0)F.push(Q)}}else if(X&&K==="m")X=!1,q=!0;if(!X&&!q)Y++;if(!wp({exact:!0}).test(K)&&Lp(K.codePointAt())){if(Y++,typeof U!=="number")J++}if(Y>$&&Y<=J)W+=K;else if(Y===$&&!X&&Q!==void 0)W=fV(F);else if(Y>=J){W+=fV(F,!0,Q);break}}return W}});var iV=C((KUD,nV)=>{nV.exports=({onlyFirst:D=!1}={})=>{let $=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp($,D?void 0:"g")}});var T5=C((GUD,lV)=>{var Zp=iV();lV.exports=(D)=>typeof D==="string"?D.replace(Zp(),""):D});var cV=C((qUD,dV)=>{dV.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var pJ=C((HUD,cJ)=>{var Mp=T5(),Op=hJ(),Ep=cV(),pV=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=Mp(D),D.length===0)return 0;D=D.replace(Ep()," ");let $=0;for(let U=0;U<D.length;U++){let I=D.codePointAt(U);if(I<=31||I>=127&&I<=159)continue;if(I>=768&&I<=879)continue;if(I>65535)U++;$+=Op(I)?2:1}return $};cJ.exports=pV;cJ.exports.default=pV});var aV=C((NUD,tV)=>{var S8=pJ(),vp=T5(),Vp=dJ(),b5=new Set(["\x1B",""]),rV=(D)=>`${b5.values().next().value}[${D}m`,oV=(D)=>`${b5.values().next().value}]8;;${D}\x07`,jp=(D)=>D.split(" ").map(($)=>S8($)),rJ=(D,$,U)=>{let I=[...$],F=!1,J=!1,X=S8(vp(D[D.length-1]));for(let[Q,Y]of I.entries()){let W=S8(Y);if(X+W<=U)D[D.length-1]+=Y;else D.push(Y),X=0;if(b5.has(Y))F=!0,J=I.slice(Q+1).join("").startsWith("]8;;");if(F){if(J){if(Y==="\x07")F=!1,J=!1}else if(Y==="m")F=!1;continue}if(X+=W,X===U&&Q<I.length-1)D.push(""),X=0}if(!X&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},Ap=(D)=>{let $=D.split(" "),U=$.length;while(U>0){if(S8($[U-1])>0)break;U--}if(U===$.length)return D;return $.slice(0,U).join(" ")+$.slice(U).join("")},Rp=(D,$,U={})=>{if(U.trim!==!1&&D.trim()==="")return"";let I="",F,J,X=jp(D),Q=[""];for(let[W,B]of D.split(" ").entries()){if(U.trim!==!1)Q[Q.length-1]=Q[Q.length-1].trimStart();let K=S8(Q[Q.length-1]);if(W!==0){if(K>=$&&(U.wordWrap===!1||U.trim===!1))Q.push(""),K=0;if(K>0||U.trim===!1)Q[Q.length-1]+=" ",K++}if(U.hard&&X[W]>$){let q=$-K,H=1+Math.floor((X[W]-q-1)/$);if(Math.floor((X[W]-1)/$)<H)Q.push("");rJ(Q,B,$);continue}if(K+X[W]>$&&K>0&&X[W]>0){if(U.wordWrap===!1&&K<$){rJ(Q,B,$);continue}Q.push("")}if(K+X[W]>$&&U.wordWrap===!1){rJ(Q,B,$);continue}Q[Q.length-1]+=B}if(U.trim!==!1)Q=Q.map(Ap);let Y=[...Q.join(`
|
|
101
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:I,destStat:F}=V8.checkPathsSync(D,$,"copy",U);if(V8.checkParentPathsSync(D,I,$,"copy"),U.filter&&!U.filter(D,$))return;let J=v8.dirname($);if(!L$.existsSync(J))Cd(J);return mE(F,D,$,U)}function mE(D,$,U,I){let J=(I.dereference?L$.statSync:L$.lstatSync)($);if(J.isDirectory())return hd(J,D,$,U,I);else if(J.isFile()||J.isCharacterDevice()||J.isBlockDevice())return _d(J,D,$,U,I);else if(J.isSymbolicLink())return ld(D,$,U,I);else if(J.isSocket())throw Error(`Cannot copy a socket file: ${$}`);else if(J.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${$}`);throw Error(`Unknown file: ${$}`)}function _d(D,$,U,I,F){if(!$)return hE(D,U,I,F);return xd(D,U,I,F)}function xd(D,$,U,I){if(I.overwrite)return L$.unlinkSync(U),hE(D,$,U,I);else if(I.errorOnExist)throw Error(`'${U}' already exists`)}function hE(D,$,U,I){if(L$.copyFileSync($,U),I.preserveTimestamps)gd(D.mode,$,U);return uJ(U,D.mode)}function gd(D,$,U){if(fd(D))yd(U,D);return md($,U)}function fd(D){return(D&128)===0}function yd(D,$){return uJ(D,$|128)}function uJ(D,$){return L$.chmodSync(D,$)}function md(D,$){let U=L$.statSync(D);return ud($,U.atime,U.mtime)}function hd(D,$,U,I,F){if(!$)return nd(D.mode,U,I,F);return nE(U,I,F)}function nd(D,$,U,I){return L$.mkdirSync(U),nE($,U,I),uJ(U,D)}function nE(D,$,U){let I=L$.opendirSync(D);try{let F;while((F=I.readSync())!==null)id(F.name,D,$,U)}finally{I.closeSync()}}function id(D,$,U,I){let F=v8.join($,D),J=v8.join(U,D);if(I.filter&&!I.filter(F,J))return;let{destStat:X}=V8.checkPathsSync(F,J,"copy",I);return mE(X,F,J,I)}function ld(D,$,U,I){let F=L$.readlinkSync($);if(I.dereference)F=v8.resolve(process.cwd(),F);if(!D)return L$.symlinkSync(F,U);else{let J;try{J=L$.readlinkSync(U)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return L$.symlinkSync(F,U);throw X}if(I.dereference)J=v8.resolve(process.cwd(),J);if(F!==J){if(V8.isSrcSubdir(F,J))throw Error(`Cannot copy '${F}' to a subdirectory of itself, '${J}'.`);if(V8.isSrcSubdir(J,F))throw Error(`Cannot overwrite '${J}' with '${F}'.`)}return dd(F,U)}}function dd(D,$){return L$.unlinkSync($),L$.symlinkSync(D,$)}iE.exports=kd});var O5=C((k7D,dE)=>{var cd=aD().fromPromise;dE.exports={copy:cd(yE()),copySync:lE()}});var j8=C((_7D,pE)=>{var cE=d0(),pd=aD().fromCallback;function rd(D,$){cE.rm(D,{recursive:!0,force:!0},$)}function od(D){cE.rmSync(D,{recursive:!0,force:!0})}pE.exports={remove:pd(rd),removeSync:od}});var $v=C((x7D,Dv)=>{var td=aD().fromPromise,tE=z$(),aE=o("path"),sE=$0(),eE=j8(),rE=td(async function($){let U;try{U=await tE.readdir($)}catch{return sE.mkdirs($)}return Promise.all(U.map((I)=>eE.remove(aE.join($,I))))});function oE(D){let $;try{$=tE.readdirSync(D)}catch{return sE.mkdirsSync(D)}$.forEach((U)=>{U=aE.join(D,U),eE.removeSync(U)})}Dv.exports={emptyDirSync:oE,emptydirSync:oE,emptyDir:rE,emptydir:rE}});var Jv=C((g7D,Iv)=>{var ad=aD().fromPromise,Uv=o("path"),R0=z$(),Fv=$0();async function sd(D){let $;try{$=await R0.stat(D)}catch{}if($&&$.isFile())return;let U=Uv.dirname(D),I=null;try{I=await R0.stat(U)}catch(F){if(F.code==="ENOENT"){await Fv.mkdirs(U),await R0.writeFile(D,"");return}else throw F}if(I.isDirectory())await R0.writeFile(D,"");else await R0.readdir(U)}function ed(D){let $;try{$=R0.statSync(D)}catch{}if($&&$.isFile())return;let U=Uv.dirname(D);try{if(!R0.statSync(U).isDirectory())R0.readdirSync(U)}catch(I){if(I&&I.code==="ENOENT")Fv.mkdirsSync(U);else throw I}R0.writeFileSync(D,"")}Iv.exports={createFile:ad(sd),createFileSync:ed}});var Bv=C((f7D,Wv)=>{var Dc=aD().fromPromise,Xv=o("path"),a0=z$(),Qv=$0(),{pathExists:$c}=t0(),{areIdentical:Yv}=c6();async function Uc(D,$){let U;try{U=await a0.lstat($,{bigint:!0})}catch{}let I;try{I=await a0.lstat(D,{bigint:!0})}catch(X){throw X.message=X.message.replace("lstat","ensureLink"),X}if(U&&Yv(I,U))return;let F=Xv.dirname($);if(!await $c(F))await Qv.mkdirs(F);await a0.link(D,$)}function Fc(D,$){let U;try{U=a0.lstatSync($,{bigint:!0})}catch{}try{let J=a0.lstatSync(D,{bigint:!0});if(U&&Yv(J,U))return}catch(J){throw J.message=J.message.replace("lstat","ensureLink"),J}let I=Xv.dirname($);if(a0.existsSync(I))return a0.linkSync(D,$);return Qv.mkdirsSync(I),a0.linkSync(D,$)}Wv.exports={createLink:Dc(Uc),createLinkSync:Fc}});var Gv=C((y7D,Kv)=>{var s0=o("path"),A8=z$(),{pathExists:Ic}=t0(),Jc=aD().fromPromise;async function Xc(D,$){if(s0.isAbsolute(D)){try{await A8.lstat(D)}catch(J){throw J.message=J.message.replace("lstat","ensureSymlink"),J}return{toCwd:D,toDst:D}}let U=s0.dirname($),I=s0.join(U,D);if(await Ic(I))return{toCwd:I,toDst:D};try{await A8.lstat(D)}catch(J){throw J.message=J.message.replace("lstat","ensureSymlink"),J}return{toCwd:D,toDst:s0.relative(U,D)}}function Qc(D,$){if(s0.isAbsolute(D)){if(!A8.existsSync(D))throw Error("absolute srcpath does not exist");return{toCwd:D,toDst:D}}let U=s0.dirname($),I=s0.join(U,D);if(A8.existsSync(I))return{toCwd:I,toDst:D};if(!A8.existsSync(D))throw Error("relative srcpath does not exist");return{toCwd:D,toDst:s0.relative(U,D)}}Kv.exports={symlinkPaths:Jc(Xc),symlinkPathsSync:Qc}});var Nv=C((m7D,Hv)=>{var qv=z$(),Yc=aD().fromPromise;async function Wc(D,$){if($)return $;let U;try{U=await qv.lstat(D)}catch{return"file"}return U&&U.isDirectory()?"dir":"file"}function Bc(D,$){if($)return $;let U;try{U=qv.lstatSync(D)}catch{return"file"}return U&&U.isDirectory()?"dir":"file"}Hv.exports={symlinkType:Yc(Wc),symlinkTypeSync:Bc}});var wv=C((h7D,Lv)=>{var Kc=aD().fromPromise,e0=o("path"),R$=z$(),{mkdirs:Gc,mkdirsSync:qc}=$0(),{symlinkPaths:Hc,symlinkPathsSync:Nc}=Gv(),{symlinkType:zc,symlinkTypeSync:Lc}=Nv(),{pathExists:wc}=t0(),{areIdentical:zv}=c6();async function Zc(D,$,U){let I;try{I=await R$.lstat($)}catch{}if(I&&I.isSymbolicLink()){let Q;if(e0.isAbsolute(D))Q=await R$.stat(D,{bigint:!0});else{let W=e0.dirname($),B=e0.join(W,D);try{Q=await R$.stat(B,{bigint:!0})}catch{Q=await R$.stat(D,{bigint:!0})}}let Y=await R$.stat($,{bigint:!0});if(zv(Q,Y))return}let F=await Hc(D,$);D=F.toDst;let J=await zc(F.toCwd,U),X=e0.dirname($);if(!await wc(X))await Gc(X);return R$.symlink(D,$,J)}function Mc(D,$,U){let I;try{I=R$.lstatSync($)}catch{}if(I&&I.isSymbolicLink()){let Q;if(e0.isAbsolute(D))Q=R$.statSync(D,{bigint:!0});else{let W=e0.dirname($),B=e0.join(W,D);try{Q=R$.statSync(B,{bigint:!0})}catch{Q=R$.statSync(D,{bigint:!0})}}let Y=R$.statSync($,{bigint:!0});if(zv(Q,Y))return}let F=Nc(D,$);D=F.toDst,U=Lc(F.toCwd,U);let J=e0.dirname($);if(R$.existsSync(J))return R$.symlinkSync(D,$,U);return qc(J),R$.symlinkSync(D,$,U)}Lv.exports={createSymlink:Kc(Zc),createSymlinkSync:Mc}});var Av=C((n7D,jv)=>{var{createFile:Zv,createFileSync:Mv}=Jv(),{createLink:Ov,createLinkSync:Ev}=Bv(),{createSymlink:vv,createSymlinkSync:Vv}=wv();jv.exports={createFile:Zv,createFileSync:Mv,ensureFile:Zv,ensureFileSync:Mv,createLink:Ov,createLinkSync:Ev,ensureLink:Ov,ensureLinkSync:Ev,createSymlink:vv,createSymlinkSync:Vv,ensureSymlink:vv,ensureSymlinkSync:Vv}});var E5=C((i7D,Rv)=>{function Oc(D,{EOL:$=`
|
|
102
|
+
`,finalEOL:U=!0,replacer:I=null,spaces:F}={}){let J=U?$:"",X=JSON.stringify(D,I,F);if(X===void 0)throw TypeError(`Converting ${typeof D} value to JSON is not supported`);return X.replace(/\n/g,$)+J}function Ec(D){if(Buffer.isBuffer(D))D=D.toString("utf8");return D.replace(/^\uFEFF/,"")}Rv.exports={stringify:Oc,stripBom:Ec}});var Pv=C((l7D,bv)=>{var O4;try{O4=d0()}catch(D){O4=o("fs")}var v5=aD(),{stringify:Sv,stripBom:Tv}=E5();async function vc(D,$={}){if(typeof $==="string")$={encoding:$};let U=$.fs||O4,I="throws"in $?$.throws:!0,F=await v5.fromCallback(U.readFile)(D,$);F=Tv(F);let J;try{J=JSON.parse(F,$?$.reviver:null)}catch(X){if(I)throw X.message=`${D}: ${X.message}`,X;else return null}return J}var Vc=v5.fromPromise(vc);function jc(D,$={}){if(typeof $==="string")$={encoding:$};let U=$.fs||O4,I="throws"in $?$.throws:!0;try{let F=U.readFileSync(D,$);return F=Tv(F),JSON.parse(F,$.reviver)}catch(F){if(I)throw F.message=`${D}: ${F.message}`,F;else return null}}async function Ac(D,$,U={}){let I=U.fs||O4,F=Sv($,U);await v5.fromCallback(I.writeFile)(D,F,U)}var Rc=v5.fromPromise(Ac);function Sc(D,$,U={}){let I=U.fs||O4,F=Sv($,U);return I.writeFileSync(D,F,U)}bv.exports={readFile:Vc,readFileSync:jc,writeFile:Rc,writeFileSync:Sc}});var uv=C((d7D,Cv)=>{var V5=Pv();Cv.exports={readJson:V5.readFile,readJsonSync:V5.readFileSync,writeJson:V5.writeFile,writeJsonSync:V5.writeFileSync}});var j5=C((c7D,xv)=>{var Tc=aD().fromPromise,kJ=z$(),kv=o("path"),_v=$0(),bc=t0().pathExists;async function Pc(D,$,U="utf-8"){let I=kv.dirname(D);if(!await bc(I))await _v.mkdirs(I);return kJ.writeFile(D,$,U)}function Cc(D,...$){let U=kv.dirname(D);if(!kJ.existsSync(U))_v.mkdirsSync(U);kJ.writeFileSync(D,...$)}xv.exports={outputFile:Tc(Pc),outputFileSync:Cc}});var fv=C((p7D,gv)=>{var{stringify:uc}=E5(),{outputFile:kc}=j5();async function _c(D,$,U={}){let I=uc($,U);await kc(D,I,U)}gv.exports=_c});var mv=C((r7D,yv)=>{var{stringify:xc}=E5(),{outputFileSync:gc}=j5();function fc(D,$,U){let I=xc($,U);gc(D,I,U)}yv.exports=fc});var nv=C((o7D,hv)=>{var yc=aD().fromPromise,w$=uv();w$.outputJson=yc(fv());w$.outputJsonSync=mv();w$.outputJSON=w$.outputJson;w$.outputJSONSync=w$.outputJsonSync;w$.writeJSON=w$.writeJson;w$.writeJSONSync=w$.writeJsonSync;w$.readJSON=w$.readJson;w$.readJSONSync=w$.readJsonSync;hv.exports=w$});var pv=C((t7D,cv)=>{var mc=z$(),iv=o("path"),{copy:hc}=O5(),{remove:dv}=j8(),{mkdirp:nc}=$0(),{pathExists:ic}=t0(),lv=c6();async function lc(D,$,U={}){let I=U.overwrite||U.clobber||!1,{srcStat:F,isChangingCase:J=!1}=await lv.checkPaths(D,$,"move",U);await lv.checkParentPaths(D,F,$,"move");let X=iv.dirname($);if(iv.parse(X).root!==X)await nc(X);return dc(D,$,I,J)}async function dc(D,$,U,I){if(!I){if(U)await dv($);else if(await ic($))throw Error("dest already exists.")}try{await mc.rename(D,$)}catch(F){if(F.code!=="EXDEV")throw F;await cc(D,$,U)}}async function cc(D,$,U){return await hc(D,$,{overwrite:U,errorOnExist:!0,preserveTimestamps:!0}),dv(D)}cv.exports=lc});var sv=C((a7D,av)=>{var ov=d0(),xJ=o("path"),pc=O5().copySync,tv=j8().removeSync,rc=$0().mkdirpSync,rv=c6();function oc(D,$,U){U=U||{};let I=U.overwrite||U.clobber||!1,{srcStat:F,isChangingCase:J=!1}=rv.checkPathsSync(D,$,"move",U);if(rv.checkParentPathsSync(D,F,$,"move"),!tc($))rc(xJ.dirname($));return ac(D,$,I,J)}function tc(D){let $=xJ.dirname(D);return xJ.parse($).root===$}function ac(D,$,U,I){if(I)return _J(D,$,U);if(U)return tv($),_J(D,$,U);if(ov.existsSync($))throw Error("dest already exists.");return _J(D,$,U)}function _J(D,$,U){try{ov.renameSync(D,$)}catch(I){if(I.code!=="EXDEV")throw I;return sc(D,$,U)}}function sc(D,$,U){return pc(D,$,{overwrite:U,errorOnExist:!0,preserveTimestamps:!0}),tv(D)}av.exports=oc});var DV=C((s7D,ev)=>{var ec=aD().fromPromise;ev.exports={move:ec(pv()),moveSync:sv()}});var E4=C((e7D,$V)=>{$V.exports={...z$(),...O5(),...$v(),...Av(),...nv(),...$0(),...DV(),...j5(),...t0(),...j8()}});var YV=C((DUD,QV)=>{var gJ,FV,IV,JV,XV=!0;if(typeof process<"u")({FORCE_COLOR:gJ,NODE_DISABLE_COLORS:FV,NO_COLOR:IV,TERM:JV}=process.env||{}),XV=process.stdout&&process.stdout.isTTY;var VD={enabled:!FV&&IV==null&&JV!=="dumb"&&(gJ!=null&&gJ!=="0"||XV),reset:PD(0,0),bold:PD(1,22),dim:PD(2,22),italic:PD(3,23),underline:PD(4,24),inverse:PD(7,27),hidden:PD(8,28),strikethrough:PD(9,29),black:PD(30,39),red:PD(31,39),green:PD(32,39),yellow:PD(33,39),blue:PD(34,39),magenta:PD(35,39),cyan:PD(36,39),white:PD(37,39),gray:PD(90,39),grey:PD(90,39),bgBlack:PD(40,49),bgRed:PD(41,49),bgGreen:PD(42,49),bgYellow:PD(43,49),bgBlue:PD(44,49),bgMagenta:PD(45,49),bgCyan:PD(46,49),bgWhite:PD(47,49)};function UV(D,$){let U=0,I,F="",J="";for(;U<D.length;U++)if(I=D[U],F+=I.open,J+=I.close,~$.indexOf(I.close))$=$.replace(I.rgx,I.close+I.open);return F+$+J}function Dp(D,$){let U={has:D,keys:$};return U.reset=VD.reset.bind(U),U.bold=VD.bold.bind(U),U.dim=VD.dim.bind(U),U.italic=VD.italic.bind(U),U.underline=VD.underline.bind(U),U.inverse=VD.inverse.bind(U),U.hidden=VD.hidden.bind(U),U.strikethrough=VD.strikethrough.bind(U),U.black=VD.black.bind(U),U.red=VD.red.bind(U),U.green=VD.green.bind(U),U.yellow=VD.yellow.bind(U),U.blue=VD.blue.bind(U),U.magenta=VD.magenta.bind(U),U.cyan=VD.cyan.bind(U),U.white=VD.white.bind(U),U.gray=VD.gray.bind(U),U.grey=VD.grey.bind(U),U.bgBlack=VD.bgBlack.bind(U),U.bgRed=VD.bgRed.bind(U),U.bgGreen=VD.bgGreen.bind(U),U.bgYellow=VD.bgYellow.bind(U),U.bgBlue=VD.bgBlue.bind(U),U.bgMagenta=VD.bgMagenta.bind(U),U.bgCyan=VD.bgCyan.bind(U),U.bgWhite=VD.bgWhite.bind(U),U}function PD(D,$){let U={open:`\x1B[${D}m`,close:`\x1B[${$}m`,rgx:new RegExp(`\\x1b\\[${$}m`,"g")};return function(I){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf(D)||(this.has.push(D),this.keys.push(U)),I===void 0?this:VD.enabled?UV(this.keys,I+""):I+"";return I===void 0?Dp([D],[U]):VD.enabled?UV([U],I+""):I+""}}QV.exports=VD});var v4=C((WV)=>{Object.defineProperty(WV,"__esModule",{value:!0});WV.ancillary=WV.failure=WV.success=WV.input=WV.weak=WV.strong=void 0;var $p=A$(),G0=$p.__importDefault(YV());WV.strong=G0.default.bold;WV.weak=G0.default.dim;WV.input=G0.default.cyan;WV.success=G0.default.green;WV.failure=G0.default.red;WV.ancillary=G0.default.cyan;var Up={strong:WV.strong,weak:WV.weak,input:WV.input,success:WV.success,failure:WV.failure,ancillary:WV.ancillary,log:{DEBUG:G0.default.magenta,INFO:G0.default.cyan,WARN:G0.default.yellow,ERROR:G0.default.red}};WV.default=Up});var yJ=C((NV)=>{Object.defineProperty(NV,"__esModule",{value:!0});NV.EscapeCode=void 0;var U0="\x1B[";class U${}NV.EscapeCode=U$;U$.cursorLeft=()=>`${U0}G`;U$.cursorUp=(D=1)=>`${U0}${D}A`;U$.cursorDown=(D=1)=>`${U0}${D}B`;U$.cursorForward=(D=1)=>`${U0}${D}C`;U$.cursorBackward=(D=1)=>`${U0}${D}D`;U$.cursorHide=()=>`${U0}?25l`;U$.cursorShow=()=>`${U0}?25h`;U$.eraseLine=()=>`${U0}2K`;U$.eraseLines=(D)=>{let $="";for(let U=0;U<D;U++)if($+=U$.eraseLine(),U<D-1)$+=U$.cursorUp();return`${$}${U$.cursorLeft()}`};U$.eraseUp=()=>`${U0}1J`;U$.eraseDown=()=>`${U0}J`;U$.eraseScreen=()=>`${U0}2J`});var MV=C((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});wV.Cursor=void 0;var Ip=A$(),Jp=Ip.__importDefault(YJ()),LV=yJ();class F${static show(){if(F$.stream.isTTY)F$._isVisible=!0,F$.stream.write(LV.EscapeCode.cursorShow())}static hide(){if(F$.stream.isTTY){if(!F$._listenerAttached)(0,Jp.default)(()=>{F$.show()}),F$._listenerAttached=!0;F$._isVisible=!1,F$.stream.write(LV.EscapeCode.cursorHide())}}static toggle(){if(F$._isVisible)F$.hide();else F$.show()}}wV.Cursor=F$;F$.stream=process.stderr;F$._isVisible=!0;F$._listenerAttached=!1});var hJ=C((IUD,mJ)=>{var OV=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};mJ.exports=OV;mJ.exports.default=OV});var vV=C((JUD,EV)=>{var Xp=(D)=>D&&D.exact?new RegExp(`^${"[\uD800-\uDBFF][\uDC00-\uDFFF]"}$`):new RegExp("[\uD800-\uDBFF][\uDC00-\uDFFF]","g");EV.exports=Xp});var jV=C((XUD,VV)=>{VV.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var nJ=C((QUD,RV)=>{var R8=jV(),AV={};for(let D of Object.keys(R8))AV[R8[D]]=D;var e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};RV.exports=e;for(let D of Object.keys(e)){if(!("channels"in e[D]))throw Error("missing channels property: "+D);if(!("labels"in e[D]))throw Error("missing channel labels property: "+D);if(e[D].labels.length!==e[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:$,labels:U}=e[D];delete e[D].channels,delete e[D].labels,Object.defineProperty(e[D],"channels",{value:$}),Object.defineProperty(e[D],"labels",{value:U})}e.rgb.hsl=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255,F=Math.min($,U,I),J=Math.max($,U,I),X=J-F,Q,Y;if(J===F)Q=0;else if($===J)Q=(U-I)/X;else if(U===J)Q=2+(I-$)/X;else if(I===J)Q=4+($-U)/X;if(Q=Math.min(Q*60,360),Q<0)Q+=360;let W=(F+J)/2;if(J===F)Y=0;else if(W<=0.5)Y=X/(J+F);else Y=X/(2-J-F);return[Q,Y*100,W*100]};e.rgb.hsv=function(D){let $,U,I,F,J,X=D[0]/255,Q=D[1]/255,Y=D[2]/255,W=Math.max(X,Q,Y),B=W-Math.min(X,Q,Y),K=function(q){return(W-q)/6/B+0.5};if(B===0)F=0,J=0;else{if(J=B/W,$=K(X),U=K(Q),I=K(Y),X===W)F=I-U;else if(Q===W)F=0.3333333333333333+$-I;else if(Y===W)F=0.6666666666666666+U-$;if(F<0)F+=1;else if(F>1)F-=1}return[F*360,J*100,W*100]};e.rgb.hwb=function(D){let $=D[0],U=D[1],I=D[2],F=e.rgb.hsl(D)[0],J=0.00392156862745098*Math.min($,Math.min(U,I));return I=1-0.00392156862745098*Math.max($,Math.max(U,I)),[F,J*100,I*100]};e.rgb.cmyk=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255,F=Math.min(1-$,1-U,1-I),J=(1-$-F)/(1-F)||0,X=(1-U-F)/(1-F)||0,Q=(1-I-F)/(1-F)||0;return[J*100,X*100,Q*100,F*100]};function Qp(D,$){return(D[0]-$[0])**2+(D[1]-$[1])**2+(D[2]-$[2])**2}e.rgb.keyword=function(D){let $=AV[D];if($)return $;let U=1/0,I;for(let F of Object.keys(R8)){let J=R8[F],X=Qp(D,J);if(X<U)U=X,I=F}return I};e.keyword.rgb=function(D){return R8[D]};e.rgb.xyz=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255;$=$>0.04045?(($+0.055)/1.055)**2.4:$/12.92,U=U>0.04045?((U+0.055)/1.055)**2.4:U/12.92,I=I>0.04045?((I+0.055)/1.055)**2.4:I/12.92;let F=$*0.4124+U*0.3576+I*0.1805,J=$*0.2126+U*0.7152+I*0.0722,X=$*0.0193+U*0.1192+I*0.9505;return[F*100,J*100,X*100]};e.rgb.lab=function(D){let $=e.rgb.xyz(D),U=$[0],I=$[1],F=$[2];U/=95.047,I/=100,F/=108.883,U=U>0.008856?U**0.3333333333333333:7.787*U+0.13793103448275862,I=I>0.008856?I**0.3333333333333333:7.787*I+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862;let J=116*I-16,X=500*(U-I),Q=200*(I-F);return[J,X,Q]};e.hsl.rgb=function(D){let $=D[0]/360,U=D[1]/100,I=D[2]/100,F,J,X;if(U===0)return X=I*255,[X,X,X];if(I<0.5)F=I*(1+U);else F=I+U-I*U;let Q=2*I-F,Y=[0,0,0];for(let W=0;W<3;W++){if(J=$+0.3333333333333333*-(W-1),J<0)J++;if(J>1)J--;if(6*J<1)X=Q+(F-Q)*6*J;else if(2*J<1)X=F;else if(3*J<2)X=Q+(F-Q)*(0.6666666666666666-J)*6;else X=Q;Y[W]=X*255}return Y};e.hsl.hsv=function(D){let $=D[0],U=D[1]/100,I=D[2]/100,F=U,J=Math.max(I,0.01);I*=2,U*=I<=1?I:2-I,F*=J<=1?J:2-J;let X=(I+U)/2,Q=I===0?2*F/(J+F):2*U/(I+U);return[$,Q*100,X*100]};e.hsv.rgb=function(D){let $=D[0]/60,U=D[1]/100,I=D[2]/100,F=Math.floor($)%6,J=$-Math.floor($),X=255*I*(1-U),Q=255*I*(1-U*J),Y=255*I*(1-U*(1-J));switch(I*=255,F){case 0:return[I,Y,X];case 1:return[Q,I,X];case 2:return[X,I,Y];case 3:return[X,Q,I];case 4:return[Y,X,I];case 5:return[I,X,Q]}};e.hsv.hsl=function(D){let $=D[0],U=D[1]/100,I=D[2]/100,F=Math.max(I,0.01),J,X;X=(2-U)*I;let Q=(2-U)*F;return J=U*F,J/=Q<=1?Q:2-Q,J=J||0,X/=2,[$,J*100,X*100]};e.hwb.rgb=function(D){let $=D[0]/360,U=D[1]/100,I=D[2]/100,F=U+I,J;if(F>1)U/=F,I/=F;let X=Math.floor(6*$),Q=1-I;if(J=6*$-X,(X&1)!==0)J=1-J;let Y=U+J*(Q-U),W,B,K;switch(X){default:case 6:case 0:W=Q,B=Y,K=U;break;case 1:W=Y,B=Q,K=U;break;case 2:W=U,B=Q,K=Y;break;case 3:W=U,B=Y,K=Q;break;case 4:W=Y,B=U,K=Q;break;case 5:W=Q,B=U,K=Y;break}return[W*255,B*255,K*255]};e.cmyk.rgb=function(D){let $=D[0]/100,U=D[1]/100,I=D[2]/100,F=D[3]/100,J=1-Math.min(1,$*(1-F)+F),X=1-Math.min(1,U*(1-F)+F),Q=1-Math.min(1,I*(1-F)+F);return[J*255,X*255,Q*255]};e.xyz.rgb=function(D){let $=D[0]/100,U=D[1]/100,I=D[2]/100,F,J,X;return F=$*3.2406+U*-1.5372+I*-0.4986,J=$*-0.9689+U*1.8758+I*0.0415,X=$*0.0557+U*-0.204+I*1.057,F=F>0.0031308?1.055*F**0.4166666666666667-0.055:F*12.92,J=J>0.0031308?1.055*J**0.4166666666666667-0.055:J*12.92,X=X>0.0031308?1.055*X**0.4166666666666667-0.055:X*12.92,F=Math.min(Math.max(0,F),1),J=Math.min(Math.max(0,J),1),X=Math.min(Math.max(0,X),1),[F*255,J*255,X*255]};e.xyz.lab=function(D){let $=D[0],U=D[1],I=D[2];$/=95.047,U/=100,I/=108.883,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,U=U>0.008856?U**0.3333333333333333:7.787*U+0.13793103448275862,I=I>0.008856?I**0.3333333333333333:7.787*I+0.13793103448275862;let F=116*U-16,J=500*($-U),X=200*(U-I);return[F,J,X]};e.lab.xyz=function(D){let $=D[0],U=D[1],I=D[2],F,J,X;J=($+16)/116,F=U/500+J,X=J-I/200;let Q=J**3,Y=F**3,W=X**3;return J=Q>0.008856?Q:(J-0.13793103448275862)/7.787,F=Y>0.008856?Y:(F-0.13793103448275862)/7.787,X=W>0.008856?W:(X-0.13793103448275862)/7.787,F*=95.047,J*=100,X*=108.883,[F,J,X]};e.lab.lch=function(D){let $=D[0],U=D[1],I=D[2],F;if(F=Math.atan2(I,U)*360/2/Math.PI,F<0)F+=360;let X=Math.sqrt(U*U+I*I);return[$,X,F]};e.lch.lab=function(D){let $=D[0],U=D[1],F=D[2]/360*2*Math.PI,J=U*Math.cos(F),X=U*Math.sin(F);return[$,J,X]};e.rgb.ansi16=function(D,$=null){let[U,I,F]=D,J=$===null?e.rgb.hsv(D)[2]:$;if(J=Math.round(J/50),J===0)return 30;let X=30+(Math.round(F/255)<<2|Math.round(I/255)<<1|Math.round(U/255));if(J===2)X+=60;return X};e.hsv.ansi16=function(D){return e.rgb.ansi16(e.hsv.rgb(D),D[2])};e.rgb.ansi256=function(D){let $=D[0],U=D[1],I=D[2];if($===U&&U===I){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(U/255*5)+Math.round(I/255*5)};e.ansi16.rgb=function(D){let $=D%10;if($===0||$===7){if(D>50)$+=3.5;return $=$/10.5*255,[$,$,$]}let U=(~~(D>50)+1)*0.5,I=($&1)*U*255,F=($>>1&1)*U*255,J=($>>2&1)*U*255;return[I,F,J]};e.ansi256.rgb=function(D){if(D>=232){let J=(D-232)*10+8;return[J,J,J]}D-=16;let $,U=Math.floor(D/36)/5*255,I=Math.floor(($=D%36)/6)/5*255,F=$%6/5*255;return[U,I,F]};e.rgb.hex=function(D){let U=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(U.length)+U};e.hex.rgb=function(D){let $=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!$)return[0,0,0];let U=$[0];if($[0].length===3)U=U.split("").map((Q)=>{return Q+Q}).join("");let I=parseInt(U,16),F=I>>16&255,J=I>>8&255,X=I&255;return[F,J,X]};e.rgb.hcg=function(D){let $=D[0]/255,U=D[1]/255,I=D[2]/255,F=Math.max(Math.max($,U),I),J=Math.min(Math.min($,U),I),X=F-J,Q,Y;if(X<1)Q=J/(1-X);else Q=0;if(X<=0)Y=0;else if(F===$)Y=(U-I)/X%6;else if(F===U)Y=2+(I-$)/X;else Y=4+($-U)/X;return Y/=6,Y%=1,[Y*360,X*100,Q*100]};e.hsl.hcg=function(D){let $=D[1]/100,U=D[2]/100,I=U<0.5?2*$*U:2*$*(1-U),F=0;if(I<1)F=(U-0.5*I)/(1-I);return[D[0],I*100,F*100]};e.hsv.hcg=function(D){let $=D[1]/100,U=D[2]/100,I=$*U,F=0;if(I<1)F=(U-I)/(1-I);return[D[0],I*100,F*100]};e.hcg.rgb=function(D){let $=D[0]/360,U=D[1]/100,I=D[2]/100;if(U===0)return[I*255,I*255,I*255];let F=[0,0,0],J=$%1*6,X=J%1,Q=1-X,Y=0;switch(Math.floor(J)){case 0:F[0]=1,F[1]=X,F[2]=0;break;case 1:F[0]=Q,F[1]=1,F[2]=0;break;case 2:F[0]=0,F[1]=1,F[2]=X;break;case 3:F[0]=0,F[1]=Q,F[2]=1;break;case 4:F[0]=X,F[1]=0,F[2]=1;break;default:F[0]=1,F[1]=0,F[2]=Q}return Y=(1-U)*I,[(U*F[0]+Y)*255,(U*F[1]+Y)*255,(U*F[2]+Y)*255]};e.hcg.hsv=function(D){let $=D[1]/100,U=D[2]/100,I=$+U*(1-$),F=0;if(I>0)F=$/I;return[D[0],F*100,I*100]};e.hcg.hsl=function(D){let $=D[1]/100,I=D[2]/100*(1-$)+0.5*$,F=0;if(I>0&&I<0.5)F=$/(2*I);else if(I>=0.5&&I<1)F=$/(2*(1-I));return[D[0],F*100,I*100]};e.hcg.hwb=function(D){let $=D[1]/100,U=D[2]/100,I=$+U*(1-$);return[D[0],(I-$)*100,(1-I)*100]};e.hwb.hcg=function(D){let $=D[1]/100,I=1-D[2]/100,F=I-$,J=0;if(F<1)J=(I-F)/(1-F);return[D[0],F*100,J*100]};e.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};e.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};e.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};e.gray.hsl=function(D){return[0,0,D[0]]};e.gray.hsv=e.gray.hsl;e.gray.hwb=function(D){return[0,100,D[0]]};e.gray.cmyk=function(D){return[0,0,0,D[0]]};e.gray.lab=function(D){return[D[0],0,0]};e.gray.hex=function(D){let $=Math.round(D[0]/100*255)&255,I=(($<<16)+($<<8)+$).toString(16).toUpperCase();return"000000".substring(I.length)+I};e.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var TV=C((YUD,SV)=>{var A5=nJ();function Yp(){let D={},$=Object.keys(A5);for(let U=$.length,I=0;I<U;I++)D[$[I]]={distance:-1,parent:null};return D}function Wp(D){let $=Yp(),U=[D];$[D].distance=0;while(U.length){let I=U.pop(),F=Object.keys(A5[I]);for(let J=F.length,X=0;X<J;X++){let Q=F[X],Y=$[Q];if(Y.distance===-1)Y.distance=$[I].distance+1,Y.parent=I,U.unshift(Q)}}return $}function Bp(D,$){return function(U){return $(D(U))}}function Kp(D,$){let U=[$[D].parent,D],I=A5[$[D].parent][D],F=$[D].parent;while($[F].parent)U.unshift($[F].parent),I=Bp(A5[$[F].parent][F],I),F=$[F].parent;return I.conversion=U,I}SV.exports=function(D){let $=Wp(D),U={},I=Object.keys($);for(let F=I.length,J=0;J<F;J++){let X=I[J];if($[X].parent===null)continue;U[X]=Kp(X,$)}return U}});var PV=C((WUD,bV)=>{var iJ=nJ(),Gp=TV(),V4={},qp=Object.keys(iJ);function Hp(D){let $=function(...U){let I=U[0];if(I===void 0||I===null)return I;if(I.length>1)U=I;return D(U)};if("conversion"in D)$.conversion=D.conversion;return $}function Np(D){let $=function(...U){let I=U[0];if(I===void 0||I===null)return I;if(I.length>1)U=I;let F=D(U);if(typeof F==="object")for(let J=F.length,X=0;X<J;X++)F[X]=Math.round(F[X]);return F};if("conversion"in D)$.conversion=D.conversion;return $}qp.forEach((D)=>{V4[D]={},Object.defineProperty(V4[D],"channels",{value:iJ[D].channels}),Object.defineProperty(V4[D],"labels",{value:iJ[D].labels});let $=Gp(D);Object.keys($).forEach((I)=>{let F=$[I];V4[D][I]=Np(F),V4[D][I].raw=Hp(F)})});bV.exports=V4});var dJ=C((BUD,xV)=>{var CV=(D,$)=>(...U)=>{return`\x1B[${D(...U)+$}m`},uV=(D,$)=>(...U)=>{let I=D(...U);return`\x1B[${38+$};5;${I}m`},kV=(D,$)=>(...U)=>{let I=D(...U);return`\x1B[${38+$};2;${I[0]};${I[1]};${I[2]}m`},R5=(D)=>D,_V=(D,$,U)=>[D,$,U],j4=(D,$,U)=>{Object.defineProperty(D,$,{get:()=>{let I=U();return Object.defineProperty(D,$,{value:I,enumerable:!0,configurable:!0}),I},enumerable:!0,configurable:!0})},lJ,A4=(D,$,U,I)=>{if(lJ===void 0)lJ=PV();let F=I?10:0,J={};for(let[X,Q]of Object.entries(lJ)){let Y=X==="ansi16"?"ansi":X;if(X===$)J[Y]=D(U,F);else if(typeof Q==="object")J[Y]=D(Q[$],F)}return J};function zp(){let D=new Map,$={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};$.color.gray=$.color.blackBright,$.bgColor.bgGray=$.bgColor.bgBlackBright,$.color.grey=$.color.blackBright,$.bgColor.bgGrey=$.bgColor.bgBlackBright;for(let[U,I]of Object.entries($)){for(let[F,J]of Object.entries(I))$[F]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},I[F]=$[F],D.set(J[0],J[1]);Object.defineProperty($,U,{value:I,enumerable:!1})}return Object.defineProperty($,"codes",{value:D,enumerable:!1}),$.color.close="\x1B[39m",$.bgColor.close="\x1B[49m",j4($.color,"ansi",()=>A4(CV,"ansi16",R5,!1)),j4($.color,"ansi256",()=>A4(uV,"ansi256",R5,!1)),j4($.color,"ansi16m",()=>A4(kV,"rgb",_V,!1)),j4($.bgColor,"ansi",()=>A4(CV,"ansi16",R5,!0)),j4($.bgColor,"ansi256",()=>A4(uV,"ansi256",R5,!0)),j4($.bgColor,"ansi16m",()=>A4(kV,"rgb",_V,!0)),$}Object.defineProperty(xV,"exports",{enumerable:!0,get:zp})});var hV=C((KUD,mV)=>{var Lp=hJ(),wp=vV(),gV=dJ(),yV=["\x1B",""],S5=(D)=>`${yV[0]}[${D}m`,fV=(D,$,U)=>{let I=[];D=[...D];for(let F of D){let J=F;if(F.includes(";"))F=F.split(";")[0][0]+"0";let X=gV.codes.get(Number.parseInt(F,10));if(X){let Q=D.indexOf(X.toString());if(Q===-1)I.push(S5($?X:J));else D.splice(Q,1)}else if($){I.push(S5(0));break}else I.push(S5(J))}if($){if(I=I.filter((F,J)=>I.indexOf(F)===J),U!==void 0){let F=S5(gV.codes.get(Number.parseInt(U,10)));I=I.reduce((J,X)=>X===F?[X,...J]:[...J,X],[])}}return I.join("")};mV.exports=(D,$,U)=>{let I=[...D],F=[],J=typeof U==="number"?U:I.length,X=!1,Q,Y=0,W="";for(let[B,K]of I.entries()){let q=!1;if(yV.includes(K)){let H=/\d[^m]*/.exec(D.slice(B,B+18));if(Q=H&&H.length>0?H[0]:void 0,Y<J){if(X=!0,Q!==void 0)F.push(Q)}}else if(X&&K==="m")X=!1,q=!0;if(!X&&!q)Y++;if(!wp({exact:!0}).test(K)&&Lp(K.codePointAt())){if(Y++,typeof U!=="number")J++}if(Y>$&&Y<=J)W+=K;else if(Y===$&&!X&&Q!==void 0)W=fV(F);else if(Y>=J){W+=fV(F,!0,Q);break}}return W}});var iV=C((GUD,nV)=>{nV.exports=({onlyFirst:D=!1}={})=>{let $=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp($,D?void 0:"g")}});var T5=C((qUD,lV)=>{var Zp=iV();lV.exports=(D)=>typeof D==="string"?D.replace(Zp(),""):D});var cV=C((HUD,dV)=>{dV.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var pJ=C((NUD,cJ)=>{var Mp=T5(),Op=hJ(),Ep=cV(),pV=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=Mp(D),D.length===0)return 0;D=D.replace(Ep()," ");let $=0;for(let U=0;U<D.length;U++){let I=D.codePointAt(U);if(I<=31||I>=127&&I<=159)continue;if(I>=768&&I<=879)continue;if(I>65535)U++;$+=Op(I)?2:1}return $};cJ.exports=pV;cJ.exports.default=pV});var aV=C((zUD,tV)=>{var S8=pJ(),vp=T5(),Vp=dJ(),b5=new Set(["\x1B",""]),rV=(D)=>`${b5.values().next().value}[${D}m`,oV=(D)=>`${b5.values().next().value}]8;;${D}\x07`,jp=(D)=>D.split(" ").map(($)=>S8($)),rJ=(D,$,U)=>{let I=[...$],F=!1,J=!1,X=S8(vp(D[D.length-1]));for(let[Q,Y]of I.entries()){let W=S8(Y);if(X+W<=U)D[D.length-1]+=Y;else D.push(Y),X=0;if(b5.has(Y))F=!0,J=I.slice(Q+1).join("").startsWith("]8;;");if(F){if(J){if(Y==="\x07")F=!1,J=!1}else if(Y==="m")F=!1;continue}if(X+=W,X===U&&Q<I.length-1)D.push(""),X=0}if(!X&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},Ap=(D)=>{let $=D.split(" "),U=$.length;while(U>0){if(S8($[U-1])>0)break;U--}if(U===$.length)return D;return $.slice(0,U).join(" ")+$.slice(U).join("")},Rp=(D,$,U={})=>{if(U.trim!==!1&&D.trim()==="")return"";let I="",F,J,X=jp(D),Q=[""];for(let[W,B]of D.split(" ").entries()){if(U.trim!==!1)Q[Q.length-1]=Q[Q.length-1].trimStart();let K=S8(Q[Q.length-1]);if(W!==0){if(K>=$&&(U.wordWrap===!1||U.trim===!1))Q.push(""),K=0;if(K>0||U.trim===!1)Q[Q.length-1]+=" ",K++}if(U.hard&&X[W]>$){let q=$-K,H=1+Math.floor((X[W]-q-1)/$);if(Math.floor((X[W]-1)/$)<H)Q.push("");rJ(Q,B,$);continue}if(K+X[W]>$&&K>0&&X[W]>0){if(U.wordWrap===!1&&K<$){rJ(Q,B,$);continue}Q.push("")}if(K+X[W]>$&&U.wordWrap===!1){rJ(Q,B,$);continue}Q[Q.length-1]+=B}if(U.trim!==!1)Q=Q.map(Ap);let Y=[...Q.join(`
|
|
103
103
|
`)];for(let[W,B]of Y.entries()){if(I+=B,b5.has(B)){let{groups:q}=new RegExp("(?:\\[(?<code>\\d+)m|\\]8;;(?<uri>.*)\x07)").exec(Y.slice(W).join(""))||{groups:{}};if(q.code!==void 0){let H=Number.parseFloat(q.code);F=H===39?void 0:H}else if(q.uri!==void 0)J=q.uri.length===0?void 0:q.uri}let K=Vp.codes.get(Number(F));if(Y[W+1]===`
|
|
104
104
|
`){if(J)I+=oV("");if(F&&K)I+=rV(K)}else if(B===`
|
|
105
105
|
`){if(F&&K)I+=rV(F);if(J)I+=oV(J)}}return I};tV.exports=(D,$,U)=>{return String(D).normalize().replace(/\r\n/g,`
|
|
106
106
|
`).split(`
|
|
107
107
|
`).map((I)=>Rp(I,$,U)).join(`
|
|
108
|
-
`)}});var Dj=C((
|
|
108
|
+
`)}});var Dj=C((LUD,eV)=>{var Sp=o("os"),sV=Sp.homedir();eV.exports=(D)=>{if(typeof D!=="string")throw TypeError(`Expected a string, got ${typeof D}`);return sV?D.replace(/^~(?=$|\/|\\)/,sV):D}});var Wj=C((Xj)=>{Object.defineProperty(Xj,"__esModule",{value:!0});Xj.columnar=Xj.generateFillSpaceStringList=Xj.expandPath=Xj.prettyPath=Xj.wordWrap=Xj.indent=Xj.TTY_WIDTH=Xj.stripAnsi=Xj.stringWidth=Xj.sliceAnsi=void 0;var $j=A$(),Tp=$j.__importStar(o("os")),S0=$j.__importStar(o("path")),Uj=hV();Xj.sliceAnsi=Uj;var P5=pJ();Xj.stringWidth=P5;var bp=T5();Xj.stripAnsi=bp;var Pp=aV(),Cp=Dj(),up=80,kp=120;Xj.TTY_WIDTH=process.stdout.columns?Math.max(up,Math.min(process.stdout.columns,kp)):1/0;function Fj(D=4){return" ".repeat(D)}Xj.indent=Fj;function _p(D,{width:$=Xj.TTY_WIDTH,indentation:U=0,append:I=""}){return Pp(D,$-U-I.length,{trim:!0}).split(`
|
|
109
109
|
`).join(`${I}
|
|
110
110
|
${Fj(U)}`)}Xj.wordWrap=_p;function xp(D){D=Ij(D);let $=process.cwd(),U=S0.dirname(D),I=Tp.homedir(),F=Math.abs(U.split(S0.sep).length-$.split(S0.sep).length);if($===U)return"."+S0.sep+S0.basename(D);else if(U.startsWith($))return"."+S0.sep+D.substring($.length+1);else if(F<=2){let J=S0.relative($,D);return J?J:"."}else if(D===I)return"~";else if(D.indexOf(I)===0)return"~"+S0.sep+D.substring(I.length+1);return D}Xj.prettyPath=xp;function Ij(D){return S0.resolve(Cp(D))}Xj.expandPath=Ij;function Jj(D,$=1,U=" "){if($<2)$=2;let I=Math.max(...D.map((X)=>P5(X))),F=I>$?I+1:$,J=U.repeat(F);return D.map((X)=>Uj(J,0,F-P5(X)))}Xj.generateFillSpaceStringList=Jj;function gp(D,{hsep:$="-",vsep:U="|",headers:I}){let F=I?!0:!1;if(!D[0])return"";let J=I?I.length:D[0].length,X=I?I.map((B)=>[B]):D[0].map(()=>[]);for(let B of D){let K=0,q=B.map((H)=>{let G=H.split(`
|
|
111
111
|
`);return K=Math.max(K,G.length),G});for(let H in B)if(X[H])X[H].push(...q[H],...Array(K-q[H].length).fill(""))}let Q=X.map((B,K)=>{if(K<J-1){let q=Jj(B);return B.map((H,G)=>`${H}${q[G]}${U===""?"":`${U} `}`)}else return B}),Y=0,W=Q.reduce((B,K)=>{return B.map((q,H)=>{let G=B[H]+K[H];return Y=Math.max(Y,P5(G)),G})});if(F&&$!=="")W.splice(1,0,$.repeat(Y));return W.join(`
|
|
@@ -154,12 +154,12 @@ Please follow the Upgrade Guide to move ${s6.default.strong("public")} inside th
|
|
|
154
154
|
const config: CapacitorConfig = ${(0,Ya.formatJSObject)(D)};
|
|
155
155
|
|
|
156
156
|
export default config;
|
|
157
|
-
`}});var l5,U6,vA,VA,jA,AA,RA,SA,TA,bA,OX,EX;var vX=T(()=>{l5=h$(EA(),1),U6=h$(y5(),1),vA=h$(qX(),1),VA=h$(b8(),1),jA=VA.requireTS,AA=vA.formatJSObject,RA=l5.loadConfig,SA=l5.writeConfig,TA=U6.findMonorepoRoot,bA=U6.findNXMonorepoRoot,OX=U6.isMonorepo,EX=U6.isNXMonorepo});import{Buffer as PA}from"node:buffer";import{createHash as Aa}from"node:crypto";function Sa(D){let $=4294967295;for(let U=0;U<D.length;U++){let I=D[U];$=Ra[($^I)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function CA(D,$="sha256"){let U=PA.isBuffer(D)?D:PA.from(D);if($==="crc32")return Sa(U);let I=Aa($);return I.update(U),I.digest("hex")}var Ra;var uA=T(()=>{Ra=(()=>{let D=[];for(let $=0;$<256;$++){let U=$;for(let I=0;I<8;I++)U=U&1?3988292384^U>>>1:U>>>1;D[$]=U}return D})()});import{AsyncLocalStorage as Ta}from"node:async_hooks";import{existsSync as RX,realpathSync as kA,statSync as fA}from"node:fs";import{readFile as ba,writeFile as Pa}from"node:fs/promises";import{createRequire as SX}from"node:module";import{basename as Ca,extname as TX,isAbsolute as ua,relative as ka,resolve as T4,sep as _a}from"node:path";import{cwd as VX}from"node:process";import{pathToFileURL as _A}from"node:url";function d5(D,$,U=!1){if(U){let I=$?.path;vD.error(typeof I==="string"?`${D}: ${I}`:D)}throw new ZD(D,$)}function
|
|
157
|
+
`}});var l5,U6,vA,VA,jA,AA,RA,SA,TA,bA,OX,EX;var vX=T(()=>{l5=h$(EA(),1),U6=h$(y5(),1),vA=h$(qX(),1),VA=h$(b8(),1),jA=VA.requireTS,AA=vA.formatJSObject,RA=l5.loadConfig,SA=l5.writeConfig,TA=U6.findMonorepoRoot,bA=U6.findNXMonorepoRoot,OX=U6.isMonorepo,EX=U6.isNXMonorepo});import{Buffer as PA}from"node:buffer";import{createHash as Aa}from"node:crypto";function Sa(D){let $=4294967295;for(let U=0;U<D.length;U++){let I=D[U];$=Ra[($^I)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function CA(D,$="sha256"){let U=PA.isBuffer(D)?D:PA.from(D);if($==="crc32")return Sa(U);let I=Aa($);return I.update(U),I.digest("hex")}var Ra;var uA=T(()=>{Ra=(()=>{let D=[];for(let $=0;$<256;$++){let U=$;for(let I=0;I<8;I++)U=U&1?3988292384^U>>>1:U>>>1;D[$]=U}return D})()});import{AsyncLocalStorage as Ta}from"node:async_hooks";import{existsSync as RX,realpathSync as kA,statSync as fA}from"node:fs";import{readFile as ba,writeFile as Pa}from"node:fs/promises";import{createRequire as SX}from"node:module";import{basename as Ca,extname as TX,isAbsolute as ua,relative as ka,resolve as T4,sep as _a}from"node:path";import{cwd as VX}from"node:process";import{pathToFileURL as _A}from"node:url";function d5(D,$,U=!1){if(U){let I=$?.path;vD.error(typeof I==="string"?`${D}: ${I}`:D)}throw new ZD(D,$)}function tUD(D){yA=D}function jX(){let D=mA.getStore();return D===void 0?yA:D.filePath}function aUD(D,$){return mA.run({filePath:D},$)}function sUD(D,$=VX(),U){let I=U?.logError??!1;if(D===void 0)return;if(!D.trim())d5("Capacitor config path must not be empty",void 0,I);let F=T4($,D);if(!RX(F)||!fA(F).isFile())d5("Capacitor config path does not exist",{path:F},I);if(!xa.test(Ca(F)))d5("Capacitor config path must point to a capacitor.config.*.ts, capacitor.config.*.js, or capacitor.config.*.json file",{path:F},I);let J=kA($),X=kA(F),Q=ka(J,X);if(Q===".."||Q.startsWith(`..${_a}`)||ua(Q))d5("Capacitor config path must stay within the current working directory",{path:F},I);return X}function AX(D){if(D===null||typeof D!=="object")return!1;let $=D;return typeof $.transpileModule==="function"&&typeof $.ModuleKind?.CommonJS==="number"}function fa(D){for(let $ of ga){let U=T4(D,$);if(RX(U)&&fA(U).isFile())return U}return}function ya(D){let $=T4(D,"package.json");try{return SX(RX($)?$:T4(D,"capacitor.config.ts"))("typescript")}catch{return}}function ma(D){return!AX(ya(D))}function ha(){if(c5===void 0)try{c5=SX(import.meta.url)("typescript")}catch{c5=null}return c5}function gA(){if(process.versions.bun)return!0;let D=Number(process.versions.node.split(".")[0]);return Number.isFinite(D)&&D>=22}async function hA(D){let $=TX(D);if($===".json")return JSON.parse(await ba(D,"utf8"));let U=SX(D);if($===".js"){let Q=U(D),Y=Q.default??Q;return typeof Y==="function"?await Y():await Y}let I;try{I=U("typescript")}catch{I=void 0}let F=AX(I)?I:ha(),J;if(AX(F))try{J=await Promise.resolve(jA(F,D))}catch(Q){if(!gA())throw Q;J=await xA(_A(T4(D)).href)}else if(gA())J=await xA(_A(T4(D)).href);else throw Error("Could not load a usable TypeScript compiler for the Capacitor config");let X=J.default??J;return typeof X==="function"?await X():await X}async function na(D,$){if(TX($)===".js"){let U=`/** @type {import('@capacitor/cli').CapacitorConfig} */
|
|
158
158
|
const config = ${AA(D)}
|
|
159
159
|
|
|
160
160
|
module.exports = config
|
|
161
|
-
`;await Pa($,U);return}await SA(D,$)}async function bX(){let D=fa(VX());if(D&&TX(D)===".ts"&&ma(VX()))return{config:await hA(D),path:jX()??D};let $=await RA();return{config:$.app.extConfig,path:jX()??$.app.extConfigFilePath}}async function PX(){let D=jX();if(D)return{config:await hA(D),path:D};return bX()}async function CX(D,$,U=!1){let I=await PX();if(!I)return;let{config:F}=I;if(F){if(!F.plugins)F.plugins={extConfig:{},[D]:{}};if(!F.plugins[D])F.plugins[D]={};if(!U)F.plugins[D]=$.config.plugins?.[D];else F=$.config;await na(F,I.path)}}async function
|
|
162
|
-
`).slice(1).map((I)=>{let F=I.trim(),J=F.startsWith("at ")?F.slice(3):F,X=$,Q=J,Y=J.lastIndexOf(" (");if(Y!==-1&&J.endsWith(")"))X=J.slice(0,Y).trim()||$,Q=J.slice(Y+2,-1);else{let K=J.lastIndexOf(" "),q=K===-1?"":J.slice(K+1);if(/:\d+:\d+$/.test(q))X=J.slice(0,K).trim()||$,Q=q}let W=Q.lastIndexOf(":"),B=W===-1?-1:Q.lastIndexOf(":",W-1);if(W===-1||B===-1)return{function:$,platform:"custom",lang:"javascript"};return{function:X,filename:Is(Q.slice(0,B)),lineno:Number.parseInt(Q.slice(B+1,W),10),colno:Number.parseInt(Q.slice(W+1),10),platform:"custom",lang:"javascript"}}).filter(Boolean);return U&&U.length>0?U:[{function:$,platform:"custom",lang:"javascript"}]}function Qs(D){if(!D||typeof D!=="object"||!("code"in D))return;let{code:$}=D;return typeof $==="string"?$:void 0}function Ws(D){if(!D||typeof D!=="object")return;let $=D;if(typeof $.status==="number")return $.status;if(typeof $.statusCode==="number")return $.statusCode;let U=$.context&&typeof $.context==="object"?$.context.status:void 0;return typeof U==="number"?U:void 0}function Bs(D){let $=(D instanceof Error?D.message:typeof D==="string"?D:"").toLowerCase();if(Ys.some((U)=>$.includes(U)))return!0;return Ws(D)===401}function cA(D){if(D instanceof ZD){if(Ds.has(D.message))return!0;return!1}if(Bs(D))return!1;return!Qs(D)?.startsWith("commander.")}function WFD(D){let $=[],U=D;while(U?.parent){let I=U.name();if(I)$.push(I);U=U.parent}return $.reverse().join(" ")||"unknown"}function Ks(D=lA(kX(),".capgo-credentials")){if(uX)return uX;let $=lA(D,"install-id"),U;try{let I=ia($)?da($,"utf8").trim():"";if(I)U=I;else U=iA(),la(D,{recursive:!0}),ca($,U,{encoding:"utf8",mode:384})}catch{U=iA()}return uX=U,U}async function pA(D){let $=$s();if(!$)return!1;let U=e6.CAPGO_CLI_POSTHOG_API_HOST?.trim()||e6.POSTHOG_API_HOST?.trim()||aa,I;try{I=Us(U)}catch{return!1}let F=Fs(D.error),J=Js(F.message),X=Ks(),Q=Xs(F.stack,D.functionName),Y=[D.functionName,D.kind,F.name||"Error",String(D.status??1)].join(":"),W={token:$,event:"$exception",properties:{distinct_id:X,$exception_list:[{type:F.name||"Error",value:J,mechanism:{handled:!0,synthetic:!1},stacktrace:{type:"raw",frames:Q}}],$exception_fingerprint:Y,architecture:oa,cli_version:t$.version,error_kind:D.kind,function_name:D.functionName,is_ci:Boolean(e6.CI),node_version:ta,os_platform:pa(),os_release:ra(),runtime:"cli",status:D.status},timestamp:new Date().toISOString()};try{let B=new AbortController,K=setTimeout(()=>B.abort(),ea);try{return(await fetch(I,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W),signal:B.signal})).ok}finally{clearTimeout(K)}}catch{return!1}}var aa="https://eu.i.posthog.com/i/v0/e/",sa="phc_NXDyDajQaTQVwb25DEhIVZfxVUn4R0Y348Z7vWYHZUi",ea=1500,_X="iOS sync validation failed. Delete your iOS folder, then rerun the add and sync commands above and retry.",Ds,Ys,uX;var xX=T(()=>{A1();Z6();Ds=new Set([_X]);Ys=["invalid_apikey","invalid apikey","no_key_provided","no key provided","invalid api key or insufficient permissions","does not exist, run first"]});import{env as Gs}from"node:process";function Ns(D,$){return`${D} ${$.join(" ")}`}function zs(D){let[$=""]=D.npm_config_user_agent?.trim().toLowerCase().split(/\s+/,1)??[],[U,I]=$.split("/",2);if(U==="bun")return"bunx";if(U==="pnpm")return"pnpm dlx";if(U==="yarn"){let J=Number.parseInt(I??"",10);return Number.isNaN(J)||J<2?"npx -y":"yarn dlx"}if(U==="npm")return"npx -y";let F=D.npm_execpath?.toLowerCase()??"";if(F.includes("pnpm"))return"pnpm dlx";if(F.includes("yarn"))return"npx -y";if(F.includes("bun"))return"bunx";return"npx -y"}function rA(D=Gs){return Ns(zs(D),["@capgo/cli@latest","login"])}function GFD(D){let $=D.trim().replaceAll(qs," ");if(!Hs.has($))throw Error(`Unsupported package manager runner: "${D}"`);let U=$.split(" ").map((J)=>J.trim()).filter(Boolean),[I=D,...F]=U;return{command:I,args:F}}var qs,Hs;var oA=T(()=>{qs=/\s+/g,Hs=new Set(["bunx","npx","pnpm exec","yarn dlx"])});var x={};X$(x,{unwrapMessage:()=>b4,uint8ArrayToHex:()=>is,uint8ArrayToBase64url:()=>hs,uint8ArrayToBase64:()=>UR,toZod:()=>x8,stringifyPrimitive:()=>g,slugify:()=>yX,shallowClone:()=>f8,safeExtend:()=>ks,required:()=>gs,rawShape:()=>k4,randomString:()=>Rs,propertyKeyTypes:()=>y8,promiseAllObject:()=>As,primitiveTypes:()=>hX,prefixIssues:()=>S$,pick:()=>Ps,partial:()=>xs,parsedType:()=>f,own:()=>J6,optionalKeys:()=>nX,omit:()=>Cs,objectClone:()=>Es,numKeys:()=>Ss,nullish:()=>p5,normalizeParams:()=>i,mergeDefs:()=>F0,merge:()=>_s,members:()=>lX,jsonStringifyReplacer:()=>C4,joinValues:()=>R,issue:()=>_4,isPlainObject:()=>p$,isObject:()=>$1,installLazyProp:()=>rs,hide:()=>l8,hexToUint8Array:()=>ns,getSizableOrigin:()=>n8,getParsedType:()=>Ts,getLengthableOrigin:()=>i8,getEnumValues:()=>P4,getElementAtPath:()=>js,floatSafeRemainder:()=>g8,finalizeIssue:()=>T$,extend:()=>us,explicitlyAborted:()=>iX,escapeRegex:()=>r$,esc:()=>Z$,derived:()=>ls,defineLazyInternal:()=>KD,defineLazy:()=>fX,createTransparentProxy:()=>bs,constantCatch:()=>dX,codePointLength:()=>U1,cloneDef:()=>Vs,clone:()=>MD,cleanRegex:()=>b0,cleanEnum:()=>ys,captureStackTrace:()=>r5,cached:()=>u4,base64urlToUint8Array:()=>ms,base64ToUint8Array:()=>$R,attachSchema:()=>t5,assignProp:()=>I$,assertNotEqual:()=>ws,assertNever:()=>Ms,assertIs:()=>Zs,assertEqual:()=>Ls,assert:()=>Os,allowsEval:()=>mX,aborted:()=>M$,NUMBER_FORMAT_RANGES:()=>m8,Class:()=>FR,CONSTANT_CATCH:()=>a5,BIGINT_FORMAT_RANGES:()=>h8});function Ls(D){return D}function ws(D){return D}function x8(){return(D)=>D}function Zs(D){}function Ms(D){throw Error("Unexpected value in exhaustive check")}function Os(D){}function P4(D){let $=Object.values(D).filter((I)=>typeof I==="number");return Object.entries(D).filter(([I,F])=>$.indexOf(+I)===-1).map(([I,F])=>F)}function R(D,$="|"){return D.map((U)=>g(U)).join($)}function C4(D,$){if(typeof $==="bigint")return $.toString();return $}class aA{constructor(D){this._getter=D,this._value=void 0}get value(){let D=this._getter;if(D!==void 0)this._value=D(),this._getter=void 0;return this._value}}function u4(D){return new aA(D)}function p5(D){return D===null||D===void 0}function b0(D){let $=D.startsWith("^")?1:0,U=D.endsWith("$")?D.length-1:D.length;return D.slice($,U)}function g8(D,$){let U=D/$,I=Math.round(U),F=4*Number.EPSILON*Math.max(Math.abs(U),1);if(Math.abs(U-I)<F)return 0;return U-I}function fX(D,$,U){let I=void 0;Object.defineProperty(D,$,{get(){if(I===tA)return;if(I===void 0)I=tA,I=U();return I},set(F){Object.defineProperty(D,$,{value:F})},configurable:!0})}function Es(D){return Object.create(Object.getPrototypeOf(D),Object.getOwnPropertyDescriptors(D))}function I$(D,$,U){Object.defineProperty(D,$,{value:U,writable:!0,enumerable:!0,configurable:!0})}function k4(D){let $=Object.getOwnPropertyDescriptor(D,"shape");return $?.get?$.get.raw:$?.value}function T0(D){return k4(D._zod.def)??D._zod.def.shape}function sA(D,$,U){Object.defineProperty(D,$,{get(){let I=U();return I$(this,$,I),I},enumerable:!0,configurable:!0})}function eA(D,$,U){if($ in D)I$(D,$,U);else D[$]=U}function D1(D,$,U,I){let F=T0($);for(let J of U){let X=Object.getOwnPropertyDescriptor(F,J);if(!X.enumerable)continue;if(X.get)sA(D,J,()=>{let Q=$._zod.def.shape[J];return I?I(Q,J):Q});else eA(D,J,I?I(X.value,J):X.value)}}function vs(D,$){for(let U of Reflect.ownKeys($)){let I=Object.getOwnPropertyDescriptor($,U);if(!I.enumerable)continue;if(I.get)sA(D,U,()=>$[U]);else eA(D,U,I.value)}}function F0(...D){let $={};for(let U of D){let I=Object.getOwnPropertyDescriptors(U);Object.assign($,I)}return Object.defineProperties({},$)}function Vs(D){return F0(D._zod.def)}function js(D,$){if(!$)return D;return $.reduce((U,I)=>U?.[I],D)}function As(D){let $=Object.keys(D),U=$.map((I)=>D[I]);return Promise.all(U).then((I)=>{let F={};for(let J=0;J<$.length;J++)F[$[J]]=I[J];return F})}function Rs(D=10){let U="";for(let I=0;I<D;I++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Z$(D){return JSON.stringify(D)}function yX(D){return D.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function $1(D){return typeof D==="object"&&D!==null&&!Array.isArray(D)}function p$(D){if($1(D)===!1)return!1;let $=D.constructor;if($===void 0)return!0;if(typeof $!=="function")return!0;let U=$.prototype;if($1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function f8(D){if(p$(D))return{...D};if(Array.isArray(D))return[...D];if(D instanceof Map)return new Map(D);if(D instanceof Set)return new Set(D);return D}function Ss(D){let $=0;for(let U in D)if(Object.prototype.hasOwnProperty.call(D,U))$++;return $}function r$(D){return D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function MD(D,$,U){let I=new D._zod.constr($??D._zod.def);if(!$||U?.parent)I._zod.parent=D;return I}function i(D){let $=D;if(!$)return{};if(typeof $==="string")return{error:()=>$};if($?.message!==void 0){if($?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");$.error=$.message}if(delete $.message,typeof $.error==="string")return{...$,error:()=>$.error};return $}function bs(D){let $;return new Proxy({},{get(U,I,F){return $??($=D()),Reflect.get($,I,F)},set(U,I,F,J){return $??($=D()),Reflect.set($,I,F,J)},has(U,I){return $??($=D()),Reflect.has($,I)},deleteProperty(U,I){return $??($=D()),Reflect.deleteProperty($,I)},ownKeys(U){return $??($=D()),Reflect.ownKeys($)},getOwnPropertyDescriptor(U,I){return $??($=D()),Reflect.getOwnPropertyDescriptor($,I)},defineProperty(U,I,F){return $??($=D()),Reflect.defineProperty($,I,F)}})}function g(D){if(typeof D==="bigint")return D.toString()+"n";if(typeof D==="string")return`"${D}"`;return`${D}`}function nX(D){return Object.keys(D).filter(($)=>{return D[$]._zod.optin!==void 0&&D[$]._zod.optout==="optional"})}function Ps(D,$){let U=D._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let J={};return D1(J,D,o5(D,$)),MD(D,F0(U,{shape:J,checks:[]}))}function o5(D,$){let U=T0(D),I=[];for(let F of Reflect.ownKeys($)){if(!Object.getOwnPropertyDescriptor(U,F)?.enumerable)throw Error(`Unrecognized key: "${String(F)}"`);if($[F])I.push(F)}return I}function Cs(D,$){let U=D._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let J=new Set(o5(D,$)),X={};return D1(X,D,Reflect.ownKeys(T0(D)).filter((Q)=>!J.has(Q))),MD(D,F0(U,{shape:X,checks:[]}))}function us(D,$){if(!p$($))throw Error("Invalid input to extend: expected a plain object");let U=D._zod.def.checks;if(U&&U.length>0){let F=T0(D);for(let J of Reflect.ownKeys($))if(Object.getOwnPropertyDescriptor(F,J)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return MD(D,F0(D._zod.def,{shape:DR(D,$)}))}function DR(D,$){let U={};return D1(U,D,Reflect.ownKeys(T0(D))),vs(U,$),U}function ks(D,$){if(!p$($))throw Error("Invalid input to safeExtend: expected a plain object");return MD(D,F0(D._zod.def,{shape:DR(D,$)}))}function _s(D,$){if(!$?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(D._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let U={};D1(U,D,Reflect.ownKeys(T0(D))),D1(U,$,Reflect.ownKeys(T0($)));let I=F0(D._zod.def,{shape:U,get catchall(){return $._zod.def.catchall},checks:$._zod.def.checks??[]});return MD(D,I)}function xs(D,$,U,I="partial"){let J=$._zod.def.checks;if(J&&J.length>0)throw Error(`.${I}() cannot be used on object schemas containing refinements`);let Q=U?new Set(o5($,U)):void 0,Y={};return D1(Y,$,Reflect.ownKeys(T0($)),D&&((W,B)=>Q&&!Q.has(B)?W:new D({type:"optional",innerType:W}))),MD($,F0($._zod.def,{shape:Y,checks:[]}))}function gs(D,$,U){let I=U?new Set(o5($,U)):void 0,F={};return D1(F,$,Reflect.ownKeys(T0($)),(J,X)=>I&&!I.has(X)?J:new D({type:"nonoptional",innerType:J})),MD($,F0($._zod.def,{shape:F}))}function M$(D,$=0){if(D.aborted===!0)return!0;for(let U=$;U<D.issues.length;U++)if(D.issues[U]?.continue!==!0)return!0;return!1}function iX(D,$=0){if(D.aborted===!0)return!0;for(let U=$;U<D.issues.length;U++)if(D.issues[U]?.continue===!1)return!0;return!1}function S$(D,$){return $.map((U)=>{var I;return(I=U).path??(I.path=[]),U.path.unshift(D),U})}function b4(D){return typeof D==="string"?D:D?.message}function t5(D,$,U){var I;for(let F=$;F<D.length;F++)(I=D[F]).schema??(I.schema=U)}function T$(D,$,U){var I;let F=D.inst?._zod?.traits;if(F?.has("$ZodType"))if(F.has("$ZodCheck"))(I=D).schema??(I.schema=D.inst);else D.schema=D.inst;let J=D.schema!==D.inst?D.schema?._zod.def?.error:void 0,X=D.message?D.message:b4(D.inst?._zod.def?.error?.(D))??b4(J?.(D))??b4($?.error?.(D))??b4(U.customError?.(D))??b4(U.localeError?.(D))??"Invalid input",Q={};for(let Y of Object.keys(D)){if(Y==="inst"||Y==="schema"||Y==="continue"||Y==="input"||Y==="__proto__")continue;Q[Y]=D[Y]}if(Q.path??(Q.path=[]),Q.message=X,$?.reportInput)Q.input=D.input;return Q}function n8(D){if(D instanceof Set)return"set";if(D instanceof Map)return"map";if(D instanceof File)return"file";return"unknown"}function U1(D){let $=D.length;if(!fs.test(D))return $;let U=$;for(let I=0;I<$-1;I++)if((D.charCodeAt(I)&64512)===55296&&(D.charCodeAt(I+1)&64512)===56320)U--,I++;return U}function i8(D){if(Array.isArray(D))return"array";if(typeof D==="string")return"string";return"unknown"}function f(D){let $=typeof D;switch($){case"number":return Number.isNaN(D)?"nan":"number";case"object":{if(D===null)return"null";if(Array.isArray(D))return"array";let U=D;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return $}function _4(...D){let[$,U,I]=D;if(typeof $==="string")return{message:$,code:"custom",input:U,inst:I};return{...$}}function ys(D){return Object.entries(D).filter(([$,U])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}function $R(D){let $=atob(D),U=new Uint8Array($.length);for(let I=0;I<$.length;I++)U[I]=$.charCodeAt(I);return U}function UR(D){let $="";for(let U=0;U<D.length;U++)$+=String.fromCharCode(D[U]);return btoa($)}function ms(D){let $=D.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-$.length%4)%4);return $R($+U)}function hs(D){return UR(D).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ns(D){let $=D.replace(/^0x/,"");if($.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array($.length/2);for(let I=0;I<$.length;I+=2)U[I/2]=Number.parseInt($.slice(I,I+2),16);return U}function is(D){return Array.from(D).map(($)=>$.toString(16).padStart(2,"0")).join("")}class FR{constructor(...D){}}function lX(D,$){for(let U in $){let I=Object.getOwnPropertyDescriptor($,U);if(I.get)Object.defineProperty(D,U,{...I,enumerable:!1});else ds(D,U,I.value)}}function J6(D,$,U,I=!0){return Object.defineProperty(D,$,{configurable:!0,writable:!0,enumerable:I,value:U}),U}function l8(D,$,U){return J6(D,$,U,!1)}function ls(D,$){for(let U in D){let I=D[U];Object.defineProperty($,U,{configurable:!0,enumerable:!0,get(){return J6(this,U,I(this))},set(F){J6(this,U,F)}})}return $}function ds(D,$,U){Object.defineProperty(D,$,{configurable:!0,get(){return this==null?U:J6(this,$,U.bind(this))},set(I){J6(this,$,I)}})}function cs(D,$){let U=Object.getPrototypeOf(D);return $ in U?void 0:U}function KD(D,$,U){let I=Object.getPrototypeOf(D._zod);if($ in I&&gX!==D._zod){gX=void 0;return}gX=D._zod,Object.defineProperty(I,$,{configurable:!0,get(){Object.defineProperty(this,$,ps);let F=I6;I6=!1;try{let J=U(this);if(I6)delete this[$];else Object.defineProperty(this,$,{configurable:!0,writable:!0,value:J});return I6=I6||F,J}catch(J){throw delete this[$],I6=I6||F,J}},set(F){Object.defineProperty(this,$,{configurable:!0,writable:!0,value:F})}})}function rs(D,$,U,I){let F=cs(D,$);if(!F)return;Object.defineProperty(F,$,{configurable:!0,get(){let J={configurable:!0,writable:!0,enumerable:I,value:void 0};return Object.defineProperty(this,$,J),J.value=U(this),Object.defineProperty(this,$,J),J.value},set(J){Object.defineProperty(this,$,{configurable:!0,writable:!0,enumerable:I,value:J})}})}function dX(D){let $=()=>D;return $[a5]=!0,$}var tA,r5,mX,Ts=(D)=>{let $=typeof D;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(D)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(D))return"array";if(D===null)return"null";if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return"promise";if(typeof Map<"u"&&D instanceof Map)return"map";if(typeof Set<"u"&&D instanceof Set)return"set";if(typeof Date<"u"&&D instanceof Date)return"date";if(typeof File<"u"&&D instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},y8,hX,m8,h8,fs,gX,I6=!1,ps,a5="~constantCatch";var c=T(()=>{X6();tA=Symbol("evaluating");r5="captureStackTrace"in Error?Error.captureStackTrace:(...D)=>{};mX=u4(()=>{if(eD.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(D){return!1}});y8=new Set(["string","number","symbol"]),hX=new Set(["string","number","bigint","boolean","symbol","undefined"]);m8=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),h8={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};fs=/[\uD800-\uDBFF]/;ps={configurable:!0,get(){I6=!0;return}}});function os(D){let $=JR;if($){let U=$.stackTraceLimit;if(typeof U==="number"){try{$.stackTraceLimit=0}catch{return JR=null,new D}try{return new D}finally{$.stackTraceLimit=U}}}return new D}function j(D,$,U,I){let F={};function J(q){this.def=q,this.constr=K,this.traits=new Set}J.prototype=F;let X=U,Q=X&&new WeakSet;function Y(q,H){if(!q._zod){cX.value=new J(H);try{Object.defineProperty(q,"_zod",cX)}finally{cX.value=void 0}}else if(q._zod.traits.has(D))return;if(q._zod.traits.add(D),$(q,H),Q){let z=Object.getPrototypeOf(q),N=q._zod.constr.prototype,M=z;while(M&&M!==N)M=Object.getPrototypeOf(M);let Z=M??z;if(!Q.has(Z))Q.add(Z),lX(Z,X)}let G=K.prototype;for(let z in G){if(!Object.prototype.hasOwnProperty.call(G,z))continue;if(!(z in q))q[z]=G[z].bind(q)}}let W=I?.Parent??Object;class B extends W{}Object.defineProperty(B,"name",{value:D});function K(q){let H=I?.Parent?os(B):this;Y(H,q);let G=H._zod.deferred;if(G){for(let N of G)N();H._zod.deferred=void 0}let z=globalThis.__zod_globalConfig?.postProcessor;if(z)z(H);return H}return Object.defineProperty(K,"init",{value:Y}),Object.defineProperty(K,Symbol.hasInstance,{value:(q)=>{if(I?.Parent&&q instanceof I.Parent)return!0;return q?._zod?.traits?.has(D)}}),Object.defineProperty(K,"name",{value:D}),K}function nD(D){if(D)Object.assign(eD,D);return eD}var IR,pX,cX,JR,rX,x$,F1,eD;var X6=T(()=>{c();pX=Object.freeze({status:"aborted"}),cX={value:void 0,enumerable:!1},JR="captureStackTrace"in Error?Error:null;rX=Symbol("zod_brand");x$=class x$ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};F1=class F1 extends Error{constructor(D){super(`Encountered unidirectional transform during encode: ${D}`);this.name="ZodEncodeError"}};(IR=globalThis).__zod_globalConfig??(IR.__zod_globalConfig={});eD=globalThis.__zod_globalConfig});function ts(){let D=this._zod;return D.message??(D.message=JSON.stringify(D.def,C4,2)),D.message}function as(D){this._zod.message=D}function es(D,$,U){if(!Object.prototype.hasOwnProperty.call(D,$))if($==="__proto__")Object.defineProperty(D,$,{value:U(),writable:!0,enumerable:!0,configurable:!0});else D[$]=U();return D[$]}function d8(D,$=(U)=>U.message){let U={},I=[];for(let F of D.issues)if(F.path.length>0)es(U,F.path[0],()=>[]).push($(F));else I.push($(F));return{formErrors:I,fieldErrors:U}}function c8(D,$=(U)=>U.message){let U={_errors:[]},I=(F,J=[])=>{for(let X of F.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((Q)=>I({issues:Q},[...J,...X.path]));else if(X.code==="invalid_key")I({issues:X.issues},[...J,...X.path]);else if(X.code==="invalid_element")I({issues:X.issues},[...J,...X.path]);else{let Q=[...J,...X.path];if(Q.length===0)U._errors.push($(X));else{let Y=U,W=0;while(W<Q.length){let B=Q[W],K=W===Q.length-1;if(B==="_errors"){if(K)Y._errors.push($(X));W++;continue}if(!Object.prototype.hasOwnProperty.call(Y,B))Object.defineProperty(Y,B,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let q=Y[B];if(K)q._errors.push($(X));Y=q,W++}}}};return I(D),U}function sX(D,$=(U)=>U.message){let U={errors:[]},I=(F,J=[])=>{var X;for(let Q of F.issues)if(Q.code==="invalid_union"&&Q.errors.length)Q.errors.map((Y)=>I({issues:Y},[...J,...Q.path]));else if(Q.code==="invalid_key")I({issues:Q.issues},[...J,...Q.path]);else if(Q.code==="invalid_element")I({issues:Q.issues},[...J,...Q.path]);else{let Y=[...J,...Q.path];if(Y.length===0){U.errors.push($(Q));continue}let W=U,B=0;while(B<Y.length){let K=Y[B],q=B===Y.length-1;if(typeof K==="string"){if(W.properties??(W.properties={}),!Object.prototype.hasOwnProperty.call(W.properties,K))Object.defineProperty(W.properties,K,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0});W=W.properties[K]}else W.items??(W.items=[]),(X=W.items)[K]??(X[K]={errors:[]}),W=W.items[K];if(q)W.errors.push($(Q));B++}}};return I(D),U}function YR(D){let $=[],U=D.map((I)=>typeof I==="object"?I.key:I);for(let I of U)if(typeof I==="number")$.push(`[${I}]`);else if(typeof I==="symbol")$.push(`[${JSON.stringify(String(I))}]`);else if(/[^\w$]/.test(I))$.push(`[${JSON.stringify(I)}]`);else{if($.length)$.push(".");$.push(I)}return $.join("")}function eX(D){let $=[],U=[...D.issues].sort((I,F)=>(I.path??[]).length-(F.path??[]).length);for(let I of U)if($.push(`✖ ${I.message}`),I.path?.length)$.push(` → at ${YR(I.path)}`);return $.join(`
|
|
161
|
+
`;await Pa($,U);return}await SA(D,$)}async function bX(){let D=fa(VX());if(D&&TX(D)===".ts"&&ma(VX()))return{config:await hA(D),path:jX()??D};let $=await RA();return{config:$.app.extConfig,path:jX()??$.app.extConfigFilePath}}async function PX(){let D=jX();if(D)return{config:await hA(D),path:D};return bX()}async function CX(D,$,U=!1){let I=await PX();if(!I)return;let{config:F}=I;if(F){if(!F.plugins)F.plugins={extConfig:{},[D]:{}};if(!F.plugins[D])F.plugins[D]={};if(!U)F.plugins[D]=$.config.plugins?.[D];else F=$.config;await na(F,I.path)}}async function eUD(D,$=!1){await CX("CapacitorUpdater",D,$)}var xA,yA,mA,xa,ga,c5;var nA=T(()=>{y0();vX();Z6();xA=Function("specifier","return import(specifier)"),mA=new Ta,xa=/^capacitor\.config(?:\.[^.]+)*\.(?:ts|js|json)$/;ga=["capacitor.config.ts","capacitor.config.js","capacitor.config.json"]});function F6(D){let $=D.length;while($>0&&D[$-1]==="/")$-=1;return D.slice(0,$)}import{randomUUID as iA}from"node:crypto";import{existsSync as ia,mkdirSync as la,readFileSync as da,writeFileSync as ca}from"node:fs";import{homedir as kX,platform as pa,release as ra}from"node:os";import{join as lA}from"node:path";import{arch as oa,cwd as dA,env as e6,version as ta}from"node:process";function _8(D){return D==="1"||D?.toLowerCase()==="true"||D?.toLowerCase()==="yes"}function $s(){if(_8(e6.CAPGO_DISABLE_TELEMETRY)||_8(e6.CAPGO_DISABLE_POSTHOG))return;return e6.CAPGO_CLI_POSTHOG_API_KEY?.trim()||e6.POSTHOG_API_KEY?.trim()||sa}function Us(D){let $=F6(D);if($.endsWith("/i/v0/e"))return`${$}/`;let U=$.replace(/\/capture$/,"/");return new URL("i/v0/e/",U.endsWith("/")?U:`${U}/`).toString()}function Fs(D){if(D instanceof Error)return{cause:D.cause,message:D.message,name:D.name||"Error",stack:D.stack};if(typeof D==="string")return{message:D,name:"Error",stack:void 0};try{return{message:JSON.stringify(D)??String(D),name:"Error",stack:void 0}}catch{return{message:String(D),name:"Error",stack:void 0}}}function Is(D){let $=D,U=dA(),I=kX();if(U)$=$.replaceAll(U,"<cwd>");if(I)$=$.replaceAll(I,"~");return $}function Js(D){let $=D,U=dA(),I=kX();if(U)$=$.replaceAll(U,"<cwd>");if(I)$=$.replaceAll(I,"~");return $.replace(/<cwd>\/[^\s"',)]+/g,"<cwd>/<path>").replace(/~\/[^\s"',)]+/g,"~/<path>").replace(/[\w.%+-]+@[\w.-]+\.[A-Z]{2,}/gi,"<email>").replace(/(https?:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,"$1<redacted>@").replace(/\b[a-z][\w-]*(?:\.[\w-]+){1,}\b/gi,"<app_id>").replace(/\b[a-z]:\\[^\s"',)]+/gi,"<path>").replace(/(^|[\s"'(])\/[^\s"',)]+/g,"$1<path>").replace(/(--(?:token|api[-_]?key|key|password|secret|private[-_]?key|jwt|session|auth)(?:=|\s+))("[^"]+"|'[^']+'|\S+)/gi,"$1<redacted>").replace(/\b((?:token|api[-_]?key|password|secret|authorization)\s*[:=]\s*)[^\s,;]+/gi,"$1<redacted>")}function Xs(D,$){let U=D?.split(`
|
|
162
|
+
`).slice(1).map((I)=>{let F=I.trim(),J=F.startsWith("at ")?F.slice(3):F,X=$,Q=J,Y=J.lastIndexOf(" (");if(Y!==-1&&J.endsWith(")"))X=J.slice(0,Y).trim()||$,Q=J.slice(Y+2,-1);else{let K=J.lastIndexOf(" "),q=K===-1?"":J.slice(K+1);if(/:\d+:\d+$/.test(q))X=J.slice(0,K).trim()||$,Q=q}let W=Q.lastIndexOf(":"),B=W===-1?-1:Q.lastIndexOf(":",W-1);if(W===-1||B===-1)return{function:$,platform:"custom",lang:"javascript"};return{function:X,filename:Is(Q.slice(0,B)),lineno:Number.parseInt(Q.slice(B+1,W),10),colno:Number.parseInt(Q.slice(W+1),10),platform:"custom",lang:"javascript"}}).filter(Boolean);return U&&U.length>0?U:[{function:$,platform:"custom",lang:"javascript"}]}function Qs(D){if(!D||typeof D!=="object"||!("code"in D))return;let{code:$}=D;return typeof $==="string"?$:void 0}function Ws(D){if(!D||typeof D!=="object")return;let $=D;if(typeof $.status==="number")return $.status;if(typeof $.statusCode==="number")return $.statusCode;let U=$.context&&typeof $.context==="object"?$.context.status:void 0;return typeof U==="number"?U:void 0}function Bs(D){let $=(D instanceof Error?D.message:typeof D==="string"?D:"").toLowerCase();if(Ys.some((U)=>$.includes(U)))return!0;return Ws(D)===401}function cA(D){if(D instanceof ZD){if(Ds.has(D.message))return!0;return!1}if(Bs(D))return!1;return!Qs(D)?.startsWith("commander.")}function BFD(D){let $=[],U=D;while(U?.parent){let I=U.name();if(I)$.push(I);U=U.parent}return $.reverse().join(" ")||"unknown"}function Ks(D=lA(kX(),".capgo-credentials")){if(uX)return uX;let $=lA(D,"install-id"),U;try{let I=ia($)?da($,"utf8").trim():"";if(I)U=I;else U=iA(),la(D,{recursive:!0}),ca($,U,{encoding:"utf8",mode:384})}catch{U=iA()}return uX=U,U}async function pA(D){let $=$s();if(!$)return!1;let U=e6.CAPGO_CLI_POSTHOG_API_HOST?.trim()||e6.POSTHOG_API_HOST?.trim()||aa,I;try{I=Us(U)}catch{return!1}let F=Fs(D.error),J=Js(F.message),X=Ks(),Q=Xs(F.stack,D.functionName),Y=[D.functionName,D.kind,F.name||"Error",String(D.status??1)].join(":"),W={token:$,event:"$exception",properties:{distinct_id:X,$exception_list:[{type:F.name||"Error",value:J,mechanism:{handled:!0,synthetic:!1},stacktrace:{type:"raw",frames:Q}}],$exception_fingerprint:Y,architecture:oa,cli_version:t$.version,error_kind:D.kind,function_name:D.functionName,is_ci:Boolean(e6.CI),node_version:ta,os_platform:pa(),os_release:ra(),runtime:"cli",status:D.status},timestamp:new Date().toISOString()};try{let B=new AbortController,K=setTimeout(()=>B.abort(),ea);try{return(await fetch(I,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W),signal:B.signal})).ok}finally{clearTimeout(K)}}catch{return!1}}var aa="https://eu.i.posthog.com/i/v0/e/",sa="phc_NXDyDajQaTQVwb25DEhIVZfxVUn4R0Y348Z7vWYHZUi",ea=1500,_X="iOS sync validation failed. Delete your iOS folder, then rerun the add and sync commands above and retry.",Ds,Ys,uX;var xX=T(()=>{A1();Z6();Ds=new Set([_X]);Ys=["invalid_apikey","invalid apikey","no_key_provided","no key provided","invalid api key or insufficient permissions","does not exist, run first"]});import{env as Gs}from"node:process";function Ns(D,$){return`${D} ${$.join(" ")}`}function zs(D){let[$=""]=D.npm_config_user_agent?.trim().toLowerCase().split(/\s+/,1)??[],[U,I]=$.split("/",2);if(U==="bun")return"bunx";if(U==="pnpm")return"pnpm dlx";if(U==="yarn"){let J=Number.parseInt(I??"",10);return Number.isNaN(J)||J<2?"npx -y":"yarn dlx"}if(U==="npm")return"npx -y";let F=D.npm_execpath?.toLowerCase()??"";if(F.includes("pnpm"))return"pnpm dlx";if(F.includes("yarn"))return"npx -y";if(F.includes("bun"))return"bunx";return"npx -y"}function rA(D=Gs){return Ns(zs(D),["@capgo/cli@latest","login"])}function qFD(D){let $=D.trim().replaceAll(qs," ");if(!Hs.has($))throw Error(`Unsupported package manager runner: "${D}"`);let U=$.split(" ").map((J)=>J.trim()).filter(Boolean),[I=D,...F]=U;return{command:I,args:F}}var qs,Hs;var oA=T(()=>{qs=/\s+/g,Hs=new Set(["bunx","npx","pnpm exec","yarn dlx"])});var x={};X$(x,{unwrapMessage:()=>b4,uint8ArrayToHex:()=>is,uint8ArrayToBase64url:()=>hs,uint8ArrayToBase64:()=>UR,toZod:()=>x8,stringifyPrimitive:()=>g,slugify:()=>yX,shallowClone:()=>f8,safeExtend:()=>ks,required:()=>gs,rawShape:()=>k4,randomString:()=>Rs,propertyKeyTypes:()=>y8,promiseAllObject:()=>As,primitiveTypes:()=>hX,prefixIssues:()=>S$,pick:()=>Ps,partial:()=>xs,parsedType:()=>f,own:()=>J6,optionalKeys:()=>nX,omit:()=>Cs,objectClone:()=>Es,numKeys:()=>Ss,nullish:()=>p5,normalizeParams:()=>i,mergeDefs:()=>F0,merge:()=>_s,members:()=>lX,jsonStringifyReplacer:()=>C4,joinValues:()=>R,issue:()=>_4,isPlainObject:()=>p$,isObject:()=>$1,installLazyProp:()=>rs,hide:()=>l8,hexToUint8Array:()=>ns,getSizableOrigin:()=>n8,getParsedType:()=>Ts,getLengthableOrigin:()=>i8,getEnumValues:()=>P4,getElementAtPath:()=>js,floatSafeRemainder:()=>g8,finalizeIssue:()=>T$,extend:()=>us,explicitlyAborted:()=>iX,escapeRegex:()=>r$,esc:()=>Z$,derived:()=>ls,defineLazyInternal:()=>KD,defineLazy:()=>fX,createTransparentProxy:()=>bs,constantCatch:()=>dX,codePointLength:()=>U1,cloneDef:()=>Vs,clone:()=>MD,cleanRegex:()=>b0,cleanEnum:()=>ys,captureStackTrace:()=>r5,cached:()=>u4,base64urlToUint8Array:()=>ms,base64ToUint8Array:()=>$R,attachSchema:()=>t5,assignProp:()=>I$,assertNotEqual:()=>ws,assertNever:()=>Ms,assertIs:()=>Zs,assertEqual:()=>Ls,assert:()=>Os,allowsEval:()=>mX,aborted:()=>M$,NUMBER_FORMAT_RANGES:()=>m8,Class:()=>FR,CONSTANT_CATCH:()=>a5,BIGINT_FORMAT_RANGES:()=>h8});function Ls(D){return D}function ws(D){return D}function x8(){return(D)=>D}function Zs(D){}function Ms(D){throw Error("Unexpected value in exhaustive check")}function Os(D){}function P4(D){let $=Object.values(D).filter((I)=>typeof I==="number");return Object.entries(D).filter(([I,F])=>$.indexOf(+I)===-1).map(([I,F])=>F)}function R(D,$="|"){return D.map((U)=>g(U)).join($)}function C4(D,$){if(typeof $==="bigint")return $.toString();return $}class aA{constructor(D){this._getter=D,this._value=void 0}get value(){let D=this._getter;if(D!==void 0)this._value=D(),this._getter=void 0;return this._value}}function u4(D){return new aA(D)}function p5(D){return D===null||D===void 0}function b0(D){let $=D.startsWith("^")?1:0,U=D.endsWith("$")?D.length-1:D.length;return D.slice($,U)}function g8(D,$){let U=D/$,I=Math.round(U),F=4*Number.EPSILON*Math.max(Math.abs(U),1);if(Math.abs(U-I)<F)return 0;return U-I}function fX(D,$,U){let I=void 0;Object.defineProperty(D,$,{get(){if(I===tA)return;if(I===void 0)I=tA,I=U();return I},set(F){Object.defineProperty(D,$,{value:F})},configurable:!0})}function Es(D){return Object.create(Object.getPrototypeOf(D),Object.getOwnPropertyDescriptors(D))}function I$(D,$,U){Object.defineProperty(D,$,{value:U,writable:!0,enumerable:!0,configurable:!0})}function k4(D){let $=Object.getOwnPropertyDescriptor(D,"shape");return $?.get?$.get.raw:$?.value}function T0(D){return k4(D._zod.def)??D._zod.def.shape}function sA(D,$,U){Object.defineProperty(D,$,{get(){let I=U();return I$(this,$,I),I},enumerable:!0,configurable:!0})}function eA(D,$,U){if($ in D)I$(D,$,U);else D[$]=U}function D1(D,$,U,I){let F=T0($);for(let J of U){let X=Object.getOwnPropertyDescriptor(F,J);if(!X.enumerable)continue;if(X.get)sA(D,J,()=>{let Q=$._zod.def.shape[J];return I?I(Q,J):Q});else eA(D,J,I?I(X.value,J):X.value)}}function vs(D,$){for(let U of Reflect.ownKeys($)){let I=Object.getOwnPropertyDescriptor($,U);if(!I.enumerable)continue;if(I.get)sA(D,U,()=>$[U]);else eA(D,U,I.value)}}function F0(...D){let $={};for(let U of D){let I=Object.getOwnPropertyDescriptors(U);Object.assign($,I)}return Object.defineProperties({},$)}function Vs(D){return F0(D._zod.def)}function js(D,$){if(!$)return D;return $.reduce((U,I)=>U?.[I],D)}function As(D){let $=Object.keys(D),U=$.map((I)=>D[I]);return Promise.all(U).then((I)=>{let F={};for(let J=0;J<$.length;J++)F[$[J]]=I[J];return F})}function Rs(D=10){let U="";for(let I=0;I<D;I++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Z$(D){return JSON.stringify(D)}function yX(D){return D.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function $1(D){return typeof D==="object"&&D!==null&&!Array.isArray(D)}function p$(D){if($1(D)===!1)return!1;let $=D.constructor;if($===void 0)return!0;if(typeof $!=="function")return!0;let U=$.prototype;if($1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function f8(D){if(p$(D))return{...D};if(Array.isArray(D))return[...D];if(D instanceof Map)return new Map(D);if(D instanceof Set)return new Set(D);return D}function Ss(D){let $=0;for(let U in D)if(Object.prototype.hasOwnProperty.call(D,U))$++;return $}function r$(D){return D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function MD(D,$,U){let I=new D._zod.constr($??D._zod.def);if(!$||U?.parent)I._zod.parent=D;return I}function i(D){let $=D;if(!$)return{};if(typeof $==="string")return{error:()=>$};if($?.message!==void 0){if($?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");$.error=$.message}if(delete $.message,typeof $.error==="string")return{...$,error:()=>$.error};return $}function bs(D){let $;return new Proxy({},{get(U,I,F){return $??($=D()),Reflect.get($,I,F)},set(U,I,F,J){return $??($=D()),Reflect.set($,I,F,J)},has(U,I){return $??($=D()),Reflect.has($,I)},deleteProperty(U,I){return $??($=D()),Reflect.deleteProperty($,I)},ownKeys(U){return $??($=D()),Reflect.ownKeys($)},getOwnPropertyDescriptor(U,I){return $??($=D()),Reflect.getOwnPropertyDescriptor($,I)},defineProperty(U,I,F){return $??($=D()),Reflect.defineProperty($,I,F)}})}function g(D){if(typeof D==="bigint")return D.toString()+"n";if(typeof D==="string")return`"${D}"`;return`${D}`}function nX(D){return Object.keys(D).filter(($)=>{return D[$]._zod.optin!==void 0&&D[$]._zod.optout==="optional"})}function Ps(D,$){let U=D._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let J={};return D1(J,D,o5(D,$)),MD(D,F0(U,{shape:J,checks:[]}))}function o5(D,$){let U=T0(D),I=[];for(let F of Reflect.ownKeys($)){if(!Object.getOwnPropertyDescriptor(U,F)?.enumerable)throw Error(`Unrecognized key: "${String(F)}"`);if($[F])I.push(F)}return I}function Cs(D,$){let U=D._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let J=new Set(o5(D,$)),X={};return D1(X,D,Reflect.ownKeys(T0(D)).filter((Q)=>!J.has(Q))),MD(D,F0(U,{shape:X,checks:[]}))}function us(D,$){if(!p$($))throw Error("Invalid input to extend: expected a plain object");let U=D._zod.def.checks;if(U&&U.length>0){let F=T0(D);for(let J of Reflect.ownKeys($))if(Object.getOwnPropertyDescriptor(F,J)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return MD(D,F0(D._zod.def,{shape:DR(D,$)}))}function DR(D,$){let U={};return D1(U,D,Reflect.ownKeys(T0(D))),vs(U,$),U}function ks(D,$){if(!p$($))throw Error("Invalid input to safeExtend: expected a plain object");return MD(D,F0(D._zod.def,{shape:DR(D,$)}))}function _s(D,$){if(!$?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(D._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let U={};D1(U,D,Reflect.ownKeys(T0(D))),D1(U,$,Reflect.ownKeys(T0($)));let I=F0(D._zod.def,{shape:U,get catchall(){return $._zod.def.catchall},checks:$._zod.def.checks??[]});return MD(D,I)}function xs(D,$,U,I="partial"){let J=$._zod.def.checks;if(J&&J.length>0)throw Error(`.${I}() cannot be used on object schemas containing refinements`);let Q=U?new Set(o5($,U)):void 0,Y={};return D1(Y,$,Reflect.ownKeys(T0($)),D&&((W,B)=>Q&&!Q.has(B)?W:new D({type:"optional",innerType:W}))),MD($,F0($._zod.def,{shape:Y,checks:[]}))}function gs(D,$,U){let I=U?new Set(o5($,U)):void 0,F={};return D1(F,$,Reflect.ownKeys(T0($)),(J,X)=>I&&!I.has(X)?J:new D({type:"nonoptional",innerType:J})),MD($,F0($._zod.def,{shape:F}))}function M$(D,$=0){if(D.aborted===!0)return!0;for(let U=$;U<D.issues.length;U++)if(D.issues[U]?.continue!==!0)return!0;return!1}function iX(D,$=0){if(D.aborted===!0)return!0;for(let U=$;U<D.issues.length;U++)if(D.issues[U]?.continue===!1)return!0;return!1}function S$(D,$){return $.map((U)=>{var I;return(I=U).path??(I.path=[]),U.path.unshift(D),U})}function b4(D){return typeof D==="string"?D:D?.message}function t5(D,$,U){var I;for(let F=$;F<D.length;F++)(I=D[F]).schema??(I.schema=U)}function T$(D,$,U){var I;let F=D.inst?._zod?.traits;if(F?.has("$ZodType"))if(F.has("$ZodCheck"))(I=D).schema??(I.schema=D.inst);else D.schema=D.inst;let J=D.schema!==D.inst?D.schema?._zod.def?.error:void 0,X=D.message?D.message:b4(D.inst?._zod.def?.error?.(D))??b4(J?.(D))??b4($?.error?.(D))??b4(U.customError?.(D))??b4(U.localeError?.(D))??"Invalid input",Q={};for(let Y of Object.keys(D)){if(Y==="inst"||Y==="schema"||Y==="continue"||Y==="input"||Y==="__proto__")continue;Q[Y]=D[Y]}if(Q.path??(Q.path=[]),Q.message=X,$?.reportInput)Q.input=D.input;return Q}function n8(D){if(D instanceof Set)return"set";if(D instanceof Map)return"map";if(D instanceof File)return"file";return"unknown"}function U1(D){let $=D.length;if(!fs.test(D))return $;let U=$;for(let I=0;I<$-1;I++)if((D.charCodeAt(I)&64512)===55296&&(D.charCodeAt(I+1)&64512)===56320)U--,I++;return U}function i8(D){if(Array.isArray(D))return"array";if(typeof D==="string")return"string";return"unknown"}function f(D){let $=typeof D;switch($){case"number":return Number.isNaN(D)?"nan":"number";case"object":{if(D===null)return"null";if(Array.isArray(D))return"array";let U=D;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return $}function _4(...D){let[$,U,I]=D;if(typeof $==="string")return{message:$,code:"custom",input:U,inst:I};return{...$}}function ys(D){return Object.entries(D).filter(([$,U])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}function $R(D){let $=atob(D),U=new Uint8Array($.length);for(let I=0;I<$.length;I++)U[I]=$.charCodeAt(I);return U}function UR(D){let $="";for(let U=0;U<D.length;U++)$+=String.fromCharCode(D[U]);return btoa($)}function ms(D){let $=D.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-$.length%4)%4);return $R($+U)}function hs(D){return UR(D).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ns(D){let $=D.replace(/^0x/,"");if($.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array($.length/2);for(let I=0;I<$.length;I+=2)U[I/2]=Number.parseInt($.slice(I,I+2),16);return U}function is(D){return Array.from(D).map(($)=>$.toString(16).padStart(2,"0")).join("")}class FR{constructor(...D){}}function lX(D,$){for(let U in $){let I=Object.getOwnPropertyDescriptor($,U);if(I.get)Object.defineProperty(D,U,{...I,enumerable:!1});else ds(D,U,I.value)}}function J6(D,$,U,I=!0){return Object.defineProperty(D,$,{configurable:!0,writable:!0,enumerable:I,value:U}),U}function l8(D,$,U){return J6(D,$,U,!1)}function ls(D,$){for(let U in D){let I=D[U];Object.defineProperty($,U,{configurable:!0,enumerable:!0,get(){return J6(this,U,I(this))},set(F){J6(this,U,F)}})}return $}function ds(D,$,U){Object.defineProperty(D,$,{configurable:!0,get(){return this==null?U:J6(this,$,U.bind(this))},set(I){J6(this,$,I)}})}function cs(D,$){let U=Object.getPrototypeOf(D);return $ in U?void 0:U}function KD(D,$,U){let I=Object.getPrototypeOf(D._zod);if($ in I&&gX!==D._zod){gX=void 0;return}gX=D._zod,Object.defineProperty(I,$,{configurable:!0,get(){Object.defineProperty(this,$,ps);let F=I6;I6=!1;try{let J=U(this);if(I6)delete this[$];else Object.defineProperty(this,$,{configurable:!0,writable:!0,value:J});return I6=I6||F,J}catch(J){throw delete this[$],I6=I6||F,J}},set(F){Object.defineProperty(this,$,{configurable:!0,writable:!0,value:F})}})}function rs(D,$,U,I){let F=cs(D,$);if(!F)return;Object.defineProperty(F,$,{configurable:!0,get(){let J={configurable:!0,writable:!0,enumerable:I,value:void 0};return Object.defineProperty(this,$,J),J.value=U(this),Object.defineProperty(this,$,J),J.value},set(J){Object.defineProperty(this,$,{configurable:!0,writable:!0,enumerable:I,value:J})}})}function dX(D){let $=()=>D;return $[a5]=!0,$}var tA,r5,mX,Ts=(D)=>{let $=typeof D;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(D)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(D))return"array";if(D===null)return"null";if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return"promise";if(typeof Map<"u"&&D instanceof Map)return"map";if(typeof Set<"u"&&D instanceof Set)return"set";if(typeof Date<"u"&&D instanceof Date)return"date";if(typeof File<"u"&&D instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},y8,hX,m8,h8,fs,gX,I6=!1,ps,a5="~constantCatch";var c=T(()=>{X6();tA=Symbol("evaluating");r5="captureStackTrace"in Error?Error.captureStackTrace:(...D)=>{};mX=u4(()=>{if(eD.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(D){return!1}});y8=new Set(["string","number","symbol"]),hX=new Set(["string","number","bigint","boolean","symbol","undefined"]);m8=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),h8={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};fs=/[\uD800-\uDBFF]/;ps={configurable:!0,get(){I6=!0;return}}});function os(D){let $=JR;if($){let U=$.stackTraceLimit;if(typeof U==="number"){try{$.stackTraceLimit=0}catch{return JR=null,new D}try{return new D}finally{$.stackTraceLimit=U}}}return new D}function j(D,$,U,I){let F={};function J(q){this.def=q,this.constr=K,this.traits=new Set}J.prototype=F;let X=U,Q=X&&new WeakSet;function Y(q,H){if(!q._zod){cX.value=new J(H);try{Object.defineProperty(q,"_zod",cX)}finally{cX.value=void 0}}else if(q._zod.traits.has(D))return;if(q._zod.traits.add(D),$(q,H),Q){let z=Object.getPrototypeOf(q),N=q._zod.constr.prototype,M=z;while(M&&M!==N)M=Object.getPrototypeOf(M);let Z=M??z;if(!Q.has(Z))Q.add(Z),lX(Z,X)}let G=K.prototype;for(let z in G){if(!Object.prototype.hasOwnProperty.call(G,z))continue;if(!(z in q))q[z]=G[z].bind(q)}}let W=I?.Parent??Object;class B extends W{}Object.defineProperty(B,"name",{value:D});function K(q){let H=I?.Parent?os(B):this;Y(H,q);let G=H._zod.deferred;if(G){for(let N of G)N();H._zod.deferred=void 0}let z=globalThis.__zod_globalConfig?.postProcessor;if(z)z(H);return H}return Object.defineProperty(K,"init",{value:Y}),Object.defineProperty(K,Symbol.hasInstance,{value:(q)=>{if(I?.Parent&&q instanceof I.Parent)return!0;return q?._zod?.traits?.has(D)}}),Object.defineProperty(K,"name",{value:D}),K}function nD(D){if(D)Object.assign(eD,D);return eD}var IR,pX,cX,JR,rX,x$,F1,eD;var X6=T(()=>{c();pX=Object.freeze({status:"aborted"}),cX={value:void 0,enumerable:!1},JR="captureStackTrace"in Error?Error:null;rX=Symbol("zod_brand");x$=class x$ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};F1=class F1 extends Error{constructor(D){super(`Encountered unidirectional transform during encode: ${D}`);this.name="ZodEncodeError"}};(IR=globalThis).__zod_globalConfig??(IR.__zod_globalConfig={});eD=globalThis.__zod_globalConfig});function ts(){let D=this._zod;return D.message??(D.message=JSON.stringify(D.def,C4,2)),D.message}function as(D){this._zod.message=D}function es(D,$,U){if(!Object.prototype.hasOwnProperty.call(D,$))if($==="__proto__")Object.defineProperty(D,$,{value:U(),writable:!0,enumerable:!0,configurable:!0});else D[$]=U();return D[$]}function d8(D,$=(U)=>U.message){let U={},I=[];for(let F of D.issues)if(F.path.length>0)es(U,F.path[0],()=>[]).push($(F));else I.push($(F));return{formErrors:I,fieldErrors:U}}function c8(D,$=(U)=>U.message){let U={_errors:[]},I=(F,J=[])=>{for(let X of F.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((Q)=>I({issues:Q},[...J,...X.path]));else if(X.code==="invalid_key")I({issues:X.issues},[...J,...X.path]);else if(X.code==="invalid_element")I({issues:X.issues},[...J,...X.path]);else{let Q=[...J,...X.path];if(Q.length===0)U._errors.push($(X));else{let Y=U,W=0;while(W<Q.length){let B=Q[W],K=W===Q.length-1;if(B==="_errors"){if(K)Y._errors.push($(X));W++;continue}if(!Object.prototype.hasOwnProperty.call(Y,B))Object.defineProperty(Y,B,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let q=Y[B];if(K)q._errors.push($(X));Y=q,W++}}}};return I(D),U}function sX(D,$=(U)=>U.message){let U={errors:[]},I=(F,J=[])=>{var X;for(let Q of F.issues)if(Q.code==="invalid_union"&&Q.errors.length)Q.errors.map((Y)=>I({issues:Y},[...J,...Q.path]));else if(Q.code==="invalid_key")I({issues:Q.issues},[...J,...Q.path]);else if(Q.code==="invalid_element")I({issues:Q.issues},[...J,...Q.path]);else{let Y=[...J,...Q.path];if(Y.length===0){U.errors.push($(Q));continue}let W=U,B=0;while(B<Y.length){let K=Y[B],q=B===Y.length-1;if(typeof K==="string"){if(W.properties??(W.properties={}),!Object.prototype.hasOwnProperty.call(W.properties,K))Object.defineProperty(W.properties,K,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0});W=W.properties[K]}else W.items??(W.items=[]),(X=W.items)[K]??(X[K]={errors:[]}),W=W.items[K];if(q)W.errors.push($(Q));B++}}};return I(D),U}function YR(D){let $=[],U=D.map((I)=>typeof I==="object"?I.key:I);for(let I of U)if(typeof I==="number")$.push(`[${I}]`);else if(typeof I==="symbol")$.push(`[${JSON.stringify(String(I))}]`);else if(/[^\w$]/.test(I))$.push(`[${JSON.stringify(I)}]`);else{if($.length)$.push(".");$.push(I)}return $.join("")}function eX(D){let $=[],U=[...D.issues].sort((I,F)=>(I.path??[]).length-(F.path??[]).length);for(let I of U)if($.push(`✖ ${I.message}`),I.path?.length)$.push(` → at ${YR(I.path)}`);return $.join(`
|
|
163
163
|
`)}var ss,tX,XR,QR=(D,$)=>{D.name="$ZodError",tX.value=$,Object.defineProperty(D,"issues",tX),tX.value=void 0,Object.defineProperty(D,"message",ss);let U=Object.getPrototypeOf(D);if(!XR.has(U))XR.add(U),Object.defineProperty(U,"toString",{configurable:!0,enumerable:!1,get(){let I=()=>this.message;return Object.defineProperty(this,"toString",{value:I,configurable:!0,writable:!0}),I},set(I){Object.defineProperty(this,"toString",{value:I,configurable:!0,writable:!0})}})},aX,b$;var DQ=T(()=>{X6();c();ss={get:ts,set:as,enumerable:!0,configurable:!0},tX={value:void 0,enumerable:!1},XR=new WeakSet([Object.prototype,Error.prototype]),aX=j("$ZodError",QR),b$=j("$ZodError",QR,void 0,{Parent:Error})});function s5(D,$){return{callee:$?.callee??D,Err:$?.Err}}function WR(D,$,U){let I;return{success:!1,get error(){if(!I)I=new D($.map((F)=>T$(F,U,nD()))),$=void 0,U=void 0;return I},set error(F){I=F,$=void 0,U=void 0}}}function Je(D,$,U){let I=U?{...U,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},F=D._zod.bag.fallbackRun,J;if(F)I[Ie]=!0,J=F({value:$,issues:[]},I);else J=D._zod.run({value:$,issues:[]},I);if(J instanceof Promise)throw new x$;return J.issues.length===0}var x4=(D)=>{let $=(U,I,F,J)=>{let X=F?{...F,async:!1}:{async:!1},Q=U._zod.run({value:I,issues:[]},X);if(Q instanceof Promise)throw new x$;if(Q.issues.length){let Y=new(J?.Err??D)(Q.issues.map((W)=>T$(W,X,nD())));throw r5(Y,J?.callee??$),Y}return Q.value};return $},e5,g4=(D)=>{let $=async(U,I,F,J)=>{let X=F?{...F,async:!0}:{async:!0},Q=U._zod.run({value:I,issues:[]},X);if(Q instanceof Promise)Q=await Q;if(Q.issues.length){let Y=new(J?.Err??D)(Q.issues.map((W)=>T$(W,X,nD())));throw r5(Y,J?.callee??$),Y}return Q.value};return $},D7,f4=(D)=>($,U,I)=>{let F=I?{...I,async:!1}:{async:!1},J=$._zod.run({value:U,issues:[]},F);if(J instanceof Promise)throw new x$;return J.issues.length?WR(D,J.issues,F):{success:!0,data:J.value}},$e,y4=(D)=>async($,U,I)=>{let F=I?{...I,async:!0}:{async:!0},J=$._zod.run({value:U,issues:[]},F);if(J instanceof Promise)J=await J;return J.issues.length?WR(D,J.issues,F):{success:!0,data:J.value}},Ue,Fe,Ie,p8=(D,$,U)=>{let I=D._zod.bag.validator;if(I!==void 0){if(I($)!==Fe)return!0;if(I.definite===!0&&U===void 0)return!1}return Je(D,$,U)},r8=async(D,$,U)=>{let I=U?{...U,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},F=D._zod.run({value:$,issues:[]},I);if(F instanceof Promise)F=await F;return F.issues.length===0},$7=(D)=>{let $=x4(D),U=(I,F,J,X)=>{let Q=J?{...J,direction:"backward"}:{direction:"backward"};return $(I,F,Q,s5(U,X))};return U},Xe,U7=(D)=>{let $=x4(D),U=(I,F,J,X)=>{return $(I,F,J,s5(U,X))};return U},Qe,F7=(D)=>{let $=g4(D),U=async(I,F,J,X)=>{let Q=J?{...J,direction:"backward"}:{direction:"backward"};return await $(I,F,Q,s5(U,X))};return U},Ye,I7=(D)=>{let $=g4(D),U=async(I,F,J,X)=>{return await $(I,F,J,s5(U,X))};return U},We,J7=(D)=>($,U,I)=>{let F=I?{...I,direction:"backward"}:{direction:"backward"};return f4(D)($,U,F)},Be,X7=(D)=>($,U,I)=>{return f4(D)($,U,I)},Ke,Q7=(D)=>async($,U,I)=>{let F=I?{...I,direction:"backward"}:{direction:"backward"};return y4(D)($,U,F)},Ge,Y7=(D)=>async($,U,I)=>{return y4(D)($,U,I)},qe;var $Q=T(()=>{X6();DQ();c();e5=x4(b$),D7=g4(b$),$e=f4(b$);Ue=y4(b$),Fe=Symbol.for("zod.compile.invalid"),Ie=Symbol.for("zod.compile.fallback");Xe=$7(b$),Qe=U7(b$),Ye=F7(b$),We=I7(b$),Be=J7(b$),Ke=X7(b$),Ge=Q7(b$),qe=Y7(b$)});var o$={};X$(o$,{xid:()=>XQ,uuid7:()=>Le,uuid6:()=>ze,uuid4:()=>Ne,uuid:()=>I1,uppercase:()=>_Q,unicodeEmail:()=>BR,undefined:()=>uQ,ulid:()=>JQ,time:()=>AQ,string:()=>TQ,sha512_hex:()=>xe,sha512_base64url:()=>fe,sha512_base64:()=>ge,sha384_hex:()=>ue,sha384_base64url:()=>_e,sha384_base64:()=>ke,sha256_hex:()=>be,sha256_base64url:()=>Ce,sha256_base64:()=>Pe,sha1_hex:()=>Re,sha1_base64url:()=>Te,sha1_base64:()=>Se,rfc5322Email:()=>Ze,number:()=>q0,null:()=>CQ,nanoidOfLength:()=>WQ,nanoid:()=>YQ,md5_hex:()=>Ve,md5_base64url:()=>Ae,md5_base64:()=>je,mac:()=>zQ,lowercase:()=>kQ,ksuid:()=>QQ,ipv6:()=>NQ,ipv4:()=>HQ,integer:()=>t8,idnEmail:()=>Me,iban:()=>B7,httpProtocol:()=>o8,html5Email:()=>we,hostname:()=>OQ,hex:()=>xQ,guid:()=>KQ,extendedDuration:()=>He,emoji:()=>qQ,email:()=>GQ,e164:()=>vQ,duration:()=>BQ,domain:()=>EQ,datetime:()=>RQ,date:()=>jQ,currencyCode:()=>VQ,cuid2:()=>IQ,cuid:()=>FQ,creditCard:()=>W7,cidrv6:()=>wQ,cidrv4:()=>LQ,browserEmail:()=>Oe,boolean:()=>PQ,bigint:()=>bQ,base64url:()=>MQ,base64:()=>ZQ,anyString:()=>SQ});function WQ(D){return new RegExp(`^[a-zA-Z0-9_-]{${D}}$`)}function qQ(){return new RegExp(Ee,"u")}function ve(D){return new RegExp(`^${D}$`)}function UQ(D){return typeof D.precision==="number"?D.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":D.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${D.precision}}`:D.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function AQ(D){return new RegExp(`^${UQ(D)}$`)}function RQ(D){let $=["Z"];if(D.offset)$.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${UQ({precision:D.precision,seconds:!0})}(?:${$.join("|")})`,I=D.local?`${U}|${UQ({precision:D.precision})}`:U;return new RegExp(`^${KR}T(?:${I})$`)}function a8(D,$){return new RegExp(`^[A-Za-z0-9+/]{${D}}${$}$`)}function s8(D){return new RegExp(`^[A-Za-z0-9_-]{${D}}$`)}var FQ,IQ,JQ,XQ,QQ,YQ,BQ,He,KQ,I1=(D)=>{if(!D)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${D}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Ne,ze,Le,GQ,we,Ze,BR,Me,Oe,Ee="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",HQ,NQ,zQ=(D)=>{let $=r$(D??":");return new RegExp(`^(?:[0-9A-F]{2}${$}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${$}){5}[0-9a-f]{2}$`)},LQ,wQ,ZQ,MQ,OQ,EQ,o8,vQ,W7,VQ,B7,KR="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",jQ,SQ,TQ=(D)=>{let $=D?`[\\s\\S]{${D?.minimum??0},${D?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${$}$`)},bQ,t8,q0,PQ,CQ,uQ,kQ,_Q,xQ,Ve,je,Ae,Re,Se,Te,be,Pe,Ce,ue,ke,_e,xe,ge,fe;var J1=T(()=>{c();FQ=/^[cC][0-9a-z]{6,}$/,IQ=/^[0-9a-z]+$/,JQ=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,XQ=/^[0-9a-vA-V]{20}$/,QQ=/^[A-Za-z0-9]{27}$/,YQ=/^[a-zA-Z0-9_-]{21}$/;BQ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,He=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KQ=/^([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})$/,Ne=I1(4),ze=I1(6),Le=I1(7),GQ=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,we=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ze=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,BR=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Me=BR,Oe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;HQ=/^(?:(?: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])$/,NQ=/^(([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}|:))$/,LQ=/^((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])$/,wQ=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ZQ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,MQ=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,OQ=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,EQ=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,o8=/^https?$/,vQ=/^\+[1-9]\d{6,14}$/,W7=/^\d(?:[ -]?\d){11,18}$/,VQ=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,B7=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;jQ=ve(KR);SQ=/^[\s\S]{0,}$/,bQ=/^-?\d+n?$/,t8=/^-?\d+$/,q0=/^-?\d+(?:\.\d+)?$/,PQ=/^(?:true|false)$/i,CQ=/^null$/i,uQ=/^undefined$/i,kQ=/^[^A-Z]*$/,_Q=/^[^a-z]*$/,xQ=/^[0-9a-fA-F]*$/;Ve=/^[0-9a-fA-F]{32}$/,je=a8(22,"=="),Ae=s8(22),Re=/^[0-9a-fA-F]{40}$/,Se=a8(27,"="),Te=s8(27),be=/^[0-9a-fA-F]{64}$/,Pe=a8(43,"="),Ce=s8(43),ue=/^[0-9a-fA-F]{96}$/,ke=a8(64,""),_e=s8(64),xe=/^[0-9a-fA-F]{128}$/,ge=a8(86,"=="),fe=s8(86)});function G7(D,$,U){if(D.issues.length)$.issues.push(...S$(U,D.issues))}var SD,gQ=(D)=>{let $=D.value;return!p5($)&&$.size!==void 0},fQ=(D)=>{let $=D.value;return!p5($)&&$.length!==void 0},K7,q7,H7,yQ,mQ,hQ,nQ,iQ,lQ,dQ,cQ,pQ,m4,rQ,oQ,tQ,aQ,sQ,eQ,DY,$Y,UY,FY;var N7=T(()=>{X6();J1();c();SD=j("$ZodCheck",(D,$)=>{var U;D._zod??(D._zod={}),D._zod.def=$,(U=D._zod).onattach??(U.onattach=[])}),K7={number:"number",bigint:"bigint",object:"date"},q7=j("$ZodCheckLessThan",(D,$)=>{SD.init(D,$);let U=K7[typeof $.value];D._zod.check=(I)=>{if($.inclusive?I.value<=$.value:I.value<$.value)return;I.issues.push({origin:K7[typeof I.value]??U,code:"too_big",maximum:typeof $.value==="object"?$.value.getTime():$.value,input:I.value,inclusive:$.inclusive,inst:D,continue:!$.abort})}}),H7=j("$ZodCheckGreaterThan",(D,$)=>{SD.init(D,$);let U=K7[typeof $.value];D._zod.check=(I)=>{if($.inclusive?I.value>=$.value:I.value>$.value)return;I.issues.push({origin:K7[typeof I.value]??U,code:"too_small",minimum:typeof $.value==="object"?$.value.getTime():$.value,input:I.value,inclusive:$.inclusive,inst:D,continue:!$.abort})}}),yQ=j("$ZodCheckMultipleOf",(D,$)=>{SD.init(D,$),D._zod.check=(U)=>{if(typeof U.value!==typeof $.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?$.value!==BigInt(0)&&U.value%$.value===BigInt(0):g8(U.value,$.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:$.value,input:U.value,inst:D,continue:!$.abort})}}),mQ=j("$ZodCheckNumberFormat",(D,$)=>{SD.init(D,$),$.format=$.format||"float64";let U=$.format?.includes("int"),I=U?"int":"number",[F,J]=m8[$.format];D._zod.check=(X)=>{let Q=X.value;if(U){if(!Number.isInteger(Q)){X.issues.push({expected:I,format:$.format,code:"invalid_type",continue:!1,input:Q,inst:D});return}if(!Number.isSafeInteger(Q)){if(Q>0)X.issues.push({input:Q,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:D,origin:I,inclusive:!0,continue:!$.abort});else X.issues.push({input:Q,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:D,origin:I,inclusive:!0,continue:!$.abort});return}}if(Q<F)X.issues.push({origin:"number",input:Q,code:"too_small",minimum:F,inclusive:!0,inst:D,continue:!$.abort});if(Q>J)X.issues.push({origin:"number",input:Q,code:"too_big",maximum:J,inclusive:!0,inst:D,continue:!$.abort})}}),hQ=j("$ZodCheckBigIntFormat",(D,$)=>{SD.init(D,$);let[U,I]=h8[$.format];D._zod.check=(F)=>{let J=F.value;if(J<U)F.issues.push({origin:"bigint",input:J,code:"too_small",minimum:U,inclusive:!0,inst:D,continue:!$.abort});if(J>I)F.issues.push({origin:"bigint",input:J,code:"too_big",maximum:I,inclusive:!0,inst:D,continue:!$.abort})}}),nQ=j("$ZodCheckMaxSize",(D,$)=>{var U;SD.init(D,$),(U=D._zod.def).when??(U.when=gQ),D._zod.check=(I)=>{let F=I.value;if(F.size<=$.maximum)return;I.issues.push({origin:n8(F),code:"too_big",maximum:$.maximum,inclusive:!0,input:F,inst:D,continue:!$.abort})}}),iQ=j("$ZodCheckMinSize",(D,$)=>{var U;SD.init(D,$),(U=D._zod.def).when??(U.when=gQ),D._zod.check=(I)=>{let F=I.value;if(F.size>=$.minimum)return;I.issues.push({origin:n8(F),code:"too_small",minimum:$.minimum,inclusive:!0,input:F,inst:D,continue:!$.abort})}}),lQ=j("$ZodCheckSizeEquals",(D,$)=>{var U;SD.init(D,$),(U=D._zod.def).when??(U.when=gQ),D._zod.check=(I)=>{let F=I.value,J=F.size;if(J===$.size)return;let X=J>$.size;I.issues.push({origin:n8(F),...X?{code:"too_big",maximum:$.size}:{code:"too_small",minimum:$.size},inclusive:!0,exact:!0,input:I.value,inst:D,continue:!$.abort})}}),dQ=j("$ZodCheckMaxLength",(D,$)=>{var U;SD.init(D,$),(U=D._zod.def).when??(U.when=fQ),D._zod.check=(I)=>{let F=I.value,J=F.length;if((typeof F==="string"&&J>$.maximum?U1(F):J)<=$.maximum)return;let Q=i8(F);I.issues.push({origin:Q,code:"too_big",maximum:$.maximum,inclusive:!0,input:F,inst:D,continue:!$.abort})}}),cQ=j("$ZodCheckMinLength",(D,$)=>{var U;SD.init(D,$),(U=D._zod.def).when??(U.when=fQ),D._zod.check=(I)=>{let F=I.value,J=F.length;if((typeof F==="string"&&J>=$.minimum&&J<$.minimum*2?U1(F):J)>=$.minimum)return;let Q=i8(F);I.issues.push({origin:Q,code:"too_small",minimum:$.minimum,inclusive:!0,input:F,inst:D,continue:!$.abort})}}),pQ=j("$ZodCheckLengthEquals",(D,$)=>{var U;SD.init(D,$),(U=D._zod.def).when??(U.when=fQ),D._zod.check=(I)=>{let F=I.value,J=F.length,X=typeof F==="string"&&J>=$.length&&J<=$.length*2?U1(F):J;if(X===$.length)return;let Q=i8(F),Y=X>$.length;I.issues.push({origin:Q,...Y?{code:"too_big",maximum:$.length}:{code:"too_small",minimum:$.length},inclusive:!0,exact:!0,input:I.value,inst:D,continue:!$.abort})}}),m4=j("$ZodCheckStringFormat",(D,$)=>{var U,I;if(SD.init(D,$),$.pattern)(U=D._zod).check??(U.check=(F)=>{if($.pattern.lastIndex=0,$.pattern.test(F.value))return;F.issues.push({origin:"string",code:"invalid_format",format:$.format,input:F.value,...$.pattern?{pattern:$.pattern.toString()}:{},inst:D,continue:!$.abort})});else(I=D._zod).check??(I.check=()=>{})}),rQ=j("$ZodCheckRegex",(D,$)=>{m4.init(D,$),D._zod.check=(U)=>{if($.pattern.lastIndex=0,$.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:$.pattern.toString(),inst:D,continue:!$.abort})}}),oQ=j("$ZodCheckLowerCase",(D,$)=>{$.pattern??($.pattern=kQ),m4.init(D,$)}),tQ=j("$ZodCheckUpperCase",(D,$)=>{$.pattern??($.pattern=_Q),m4.init(D,$)}),aQ=j("$ZodCheckIncludes",(D,$)=>{SD.init(D,$);let U=r$($.includes),I=new RegExp(typeof $.position==="number"?`^.{${$.position},}${U}`:U);$.pattern=I,D._zod.check=(F)=>{if(F.value.includes($.includes,$.position))return;F.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:$.includes,input:F.value,inst:D,continue:!$.abort})}}),sQ=j("$ZodCheckStartsWith",(D,$)=>{SD.init(D,$);let U=new RegExp(`^${r$($.prefix)}.*`);$.pattern??($.pattern=U),D._zod.check=(I)=>{if(I.value.startsWith($.prefix))return;I.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:$.prefix,input:I.value,inst:D,continue:!$.abort})}}),eQ=j("$ZodCheckEndsWith",(D,$)=>{SD.init(D,$);let U=new RegExp(`.*${r$($.suffix)}$`);$.pattern??($.pattern=U),D._zod.check=(I)=>{if(I.value.endsWith($.suffix))return;I.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:$.suffix,input:I.value,inst:D,continue:!$.abort})}});DY=j("$ZodCheckProperty",(D,$)=>{SD.init(D,$),D._zod.check=(U)=>{let I=$.schema._zod.run({value:U.value[$.property],issues:[]},{});if(I instanceof Promise)return I.then((F)=>G7(F,U,$.property));G7(I,U,$.property);return}}),$Y=j("$ZodCheckProperties",(D,$)=>{SD.init(D,$),l8(D,Symbol.iterator,function*(){yield D});let U;D._zod.check=(I)=>{if(I.value==null){I.issues.push({expected:"object",code:"invalid_type",input:I.value,inst:D});return}U??(U=Reflect.ownKeys($.shape).map((X)=>[X,$.shape[X]]));let F=I.value,J;for(let[X,Q]of U){let Y=Q._zod.run({value:F[X],issues:[]},{});if(Y instanceof Promise)J??(J=[]),J.push(Y.then((W)=>G7(W,I,X)));else G7(Y,I,X)}if(J)return Promise.all(J).then(()=>{return});return}}),UY=j("$ZodCheckMimeType",(D,$)=>{SD.init(D,$);let U=new Set($.mime);D._zod.check=(I)=>{if(U.has(I.value.type))return;I.issues.push({code:"invalid_value",values:$.mime,input:I.value.type,inst:D,continue:!$.abort})}}),FY=j("$ZodCheckOverwrite",(D,$)=>{SD.init(D,$),D._zod.check=(U)=>{U.value=$.tx(U.value)}})});class h4{constructor(D=[],$={}){this.content=[],this.indent=0,this.args=D,this.closed=$}indented(D){this.indent+=1;try{D(this)}finally{this.indent-=1}}write(D){if(typeof D==="function"){D(this,{execution:"sync"}),D(this,{execution:"async"});return}let U=D.split(`
|
|
164
164
|
`).filter((J)=>J),I=Math.min(...U.map((J)=>J.length-J.trimStart().length)),F=U.map((J)=>J.slice(I)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of F)this.content.push(J)}compile(){let D=Function,$=this?.content??[""];return new D(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
165
165
|
${$.join(`
|
|
@@ -220,7 +220,7 @@ ${Y}`:Y:"",B=Function,K=`return (input) => {
|
|
|
220
220
|
${Y}
|
|
221
221
|
}`,q;try{q=new B(...X,K)(...Q)}catch(H){throw new ND(`this schema (generated code failed to evaluate: ${H.message})`)}if($?.debug)q.code=W;return q.definite=I.definite,q}function JD(D,$){for(let[I,F]of D.constants)if(F===$)return I;let U=`c${D.constantCounter++}`;return D.constants.set(U,$),U}function W1(D,$){return D.definite=!1,JD(D,$)}function FD(D){return`v${D.varCounter++}`}function X$D(D,$){let U=D._zod.run({value:$,issues:[]},{});if(U&&typeof U.then==="function")return O$;let I=U;return I.issues.length===0?I.value:O$}function K$(D,$,U,I,F=!0){let J=D.content.length,X=$.constants.size,Q=$.constantCounter,Y=$.varCounter;try{return _D(D,$,U,I,F)}catch(W){if(!(W instanceof ND)||!W.islandable)throw W;if(D.content.length=J,$.constants.size>X){let B=Array.from($.constants.keys()).slice(X);for(let K of B)$.constants.delete(K)}return $.constantCounter=Q,$.varCounter=Y,Q$D(D,$,U,I)}}function Q$D(D,$,U,I){$.definite=!1;let F=JD($,U),J=JD($,X$D),X=FD($);return D.write(`const ${X} = ${J}(${F}, ${I});`),D.write(`if (${X} === INVALID) return INVALID;`),X}function W$D(D,$,U,I){let F=U._zod.def.checks;if(!F||F.length===0)return I;let J=I;for(let X of F){let Q=X._zod.def;if(Q.when&&!Y$D.has(Q.check))throw new ND('check with a custom "when" condition');switch(Q.check){case"greater_than":B$D(D,$,Q,J);break;case"less_than":K$D(D,$,Q,J);break;case"multiple_of":G$D(D,$,Q,J);break;case"number_format":$T(D,Q,J);break;case"min_length":{let Y=Q1(Q.minimum,"min_length"),W=xB(D,$,J,`${J}.length >= ${Y} && ${J}.length < ${Q.minimum*2}`);D.write(`if (${W} < ${Y}) return INVALID;`);break}case"max_length":{let Y=Q1(Q.maximum,"max_length"),W=xB(D,$,J,`${J}.length > ${Y}`);D.write(`if (${W} > ${Y}) return INVALID;`);break}case"length_equals":{let Y=Q1(Q.length,"length_equals"),W=xB(D,$,J,`${J}.length >= ${Y} && ${J}.length <= ${Q.length*2}`);D.write(`if (${W} !== ${Y}) return INVALID;`);break}case"min_size":D.write(`if (${J}.size < ${Q1(Q.minimum,"min_size")}) return INVALID;`);break;case"max_size":D.write(`if (${J}.size > ${Q1(Q.maximum,"max_size")}) return INVALID;`);break;case"size_equals":D.write(`if (${J}.size !== ${Q1(Q.size,"size_equals")}) return INVALID;`);break;case"string_format":J=UT(D,$,Q,J);break;case"custom":J=w$D(D,$,X,J);break;case"bigint_format":q$D(D,Q,J);break;case"mime_type":H$D(D,$,Q,J);break;case"property":z$D(D,$,Q,J);break;case"properties":N$D(D,$,Q,J);break;case"overwrite":{let Y=FD($);L$D(D,$,X,J,Y),J=Y;break}default:throw new ND(`check type ${Q.check}`)}}return J}function xB(D,$,U,I){let F=JD($,U1),J=FD($);return D.write(`const ${J} = typeof ${U} === "string" && ${I} ? ${F}(${U}) : ${U}.length;`),J}function Q1(D,$){if(typeof D!=="number"||!Number.isFinite(D))throw new ND(`${$} bound of type ${typeof D}`);return`${D}`}function DT(D,$){if(typeof $==="bigint")return`${$}n`;if(typeof $==="number"){if(Number.isNaN($))throw new ND("comparison check with NaN bound");return`${$}`}if($ instanceof Date){if(Number.isNaN($.getTime()))throw new ND("comparison check with Invalid Date bound");return JD(D,$)}throw new ND(`comparison check bound of type ${typeof $}`)}function B$D(D,$,U,I){let F=U.inclusive?"<":"<=";D.write(`if (${I} ${F} ${DT($,U.value)}) return INVALID;`)}function K$D(D,$,U,I){let F=U.inclusive?">":">=";D.write(`if (${I} ${F} ${DT($,U.value)}) return INVALID;`)}function G$D(D,$,U,I){if(typeof U.value==="bigint"){if(U.value===BigInt(0))throw new ND("multiple_of check with a zero divisor");D.write(`if (${I} % ${U.value}n !== 0n) return INVALID;`)}else{let F=JD($,g8);D.write(`if (${F}(${I}, ${Q1(U.value,"multiple_of")}) !== 0) return INVALID;`)}}function $T(D,$,U){let I=$.format;switch(I){case"safeint":D.write(`if (!Number.isSafeInteger(${U})) return INVALID;`);break;case"int32":D.write(`if (!Number.isInteger(${U}) || ${U} < -2147483648 || ${U} > 2147483647) return INVALID;`);break;case"uint32":D.write(`if (!Number.isInteger(${U}) || ${U} < 0 || ${U} > 4294967295) return INVALID;`);break;case"float32":D.write(`if (!Number.isFinite(${U}) || ${U} < -3.4028234663852886e38 || ${U} > 3.4028234663852886e38) return INVALID;`);break;case"float64":D.write(`if (!Number.isFinite(${U})) return INVALID;`);break;default:throw new ND(`number format ${I}`)}}function q$D(D,$,U){let I=$.format;if(!I)return;switch(I){case"int64":D.write(`if (${U} < -9223372036854775808n || ${U} > 9223372036854775807n) return INVALID;`);break;case"uint64":D.write(`if (${U} < 0n || ${U} > 18446744073709551615n) return INVALID;`);break;default:throw new ND(`bigint format ${I}`)}}function H$D(D,$,U,I){let F=U.mime;if(F&&F.length>0){let J=JD($,new Set(F));D.write(`if (!${J}.has(${I}.type)) return INVALID;`)}}function N$D(D,$,U,I){if(U.when)throw new ND('check with a custom "when" condition');D.write(`if (${I} == null) return INVALID;`);let F=U.shape;for(let J of Reflect.ownKeys(F)){let X=typeof J==="symbol"?JD($,J):Z$(J),Q=FD($);D.write(`const ${Q} = ${I}[${X}];`),K$(D,$,F[J],Q,!1)}}function z$D(D,$,U,I){let F=`${I}[${JSON.stringify(U.property)}]`;_D(D,$,U.schema,F)}function L$D(D,$,U,I,F){let J=U._zod.def.tx;if(!J)throw new ND("overwrite check without a transform function");if(B1(J))throw new H0("z.compile: async overwrite transforms are not supported");let X=JD($,J);D.write(`const ${F} = ${X}(${I});`)}function gB(){throw new x$}function mB(D){this.issues.push(D)}function w$D(D,$,U,I){let F=U._zod.def;if(F.fn){if(B1(F.fn))throw new H0("z.compile: async .refine() predicates are not supported");let J=W1($,F.fn),X=JD($,gB),Q=FD($);return D.write(`const ${Q} = ${J}(${I});`),D.write(`if (${Q} instanceof Promise) ${X}();`),D.write(`if (!${Q}) return INVALID;`),I}if(U._zod.check){if(B1(U._zod.check))throw new H0("z.compile: async .superRefine() / check functions are not supported");let J=U._zod.check,Q=W1($,(W)=>{let B={value:W,issues:[],addIssue:mB};if(J(B)instanceof Promise)gB();return B.issues.length===0?B.value:O$}),Y=FD($);return D.write(`const ${Y} = ${Q}(${I});`),D.write(`if (${Y} === INVALID) return INVALID;`),Y}throw new ND("custom check without a predicate or check function")}function UT(D,$,U,I,F=!0){let J=U.format;if(J==="base64"){let W=JD($,U3);return D.write(`if (!${W}(${I})) return INVALID;`),I}if(J==="base64url"){let W=JD($,A7);return D.write(`if (!${W}(${I})) return INVALID;`),I}if(J==="jwt"){let W=JD($,T7),B=JD($,U.alg??null);return D.write(`if (!${W}(${I}, ${B})) return INVALID;`),I}if(J==="ipv6"){let W=JD($,$3);return D.write(`if (!${W}(${I})) return INVALID;`),I}if(J==="cidrv6"){let W=JD($,V7);return D.write(`if (!${W}(${I})) return INVALID;`),I}if(J==="credit_card"){let W=JD($,R7);return D.write(`if (!${W}(${I})) return INVALID;`),I}if(J==="iban"){let W=JD($,S7);return D.write(`if (!${W}(${I})) return INVALID;`),I}let X=U;if(J==="url"||J==="httpurl"||X.normalize||X.hostname!==void 0||X.protocol!==void 0){let W=JD($,O7),B=JD($,U),K=FD($),q=FD($);if(D.write(`const ${K} = ${I}.trim();`),D.write(`const ${q} = ${W}(${K}, ${B});`),D.write(`if (typeof ${q} === "number") return INVALID;`),X.hostname!==void 0){let z=JD($,E7);D.write(`if (!${z}(${q}, ${B}.hostname)) return INVALID;`)}if(X.protocol!==void 0){let z=JD($,v7);D.write(`if (!${z}(${q}, ${B}.protocol)) return INVALID;`)}if(!F)return null;let H=FD($),G=X.normalize?`${q}.href`:`${JD($,D3)}(${K})`;return D.write(`const ${H} = ${G};`),H}let Q=U.fn;if(Q){if(B1(Q))throw new ND(`async string format ${J}`);let W=JD($,Q);return D.write(`if (!${W}(${I})) return INVALID;`),I}if(Z$D.has(J)&&U.pattern){let W=JD($,U.pattern);return D.write(`${W}.lastIndex = 0;`),D.write(`if (!${W}.test(${I})) return INVALID;`),I}let Y=U.format;switch(Y){case"regex":throw new ND("regex format without a pattern");case"lowercase":D.write(`if (${I} !== ${I}.toLowerCase()) return INVALID;`);break;case"uppercase":D.write(`if (${I} !== ${I}.toUpperCase()) return INVALID;`);break;case"includes":D.write(`if (!${I}.includes(${Z$(U.includes)})) return INVALID;`);break;case"starts_with":{let W=U.prefix;D.write(`if (${I}.slice(0, ${W.length}) !== ${Z$(W)}) return INVALID;`);break}case"ends_with":{let W=U.suffix;D.write(`if (${I}.slice(-${W.length}) !== ${Z$(W)}) return INVALID;`);break}default:throw new ND(`string format ${Y}`)}return I}function _D(D,$,U,I,F=!0){let J=U._zod.def,X=J.type;if(J.coerce)throw new ND(`coercion (z.coerce.${X}())`);let Q=F||!!J.checks?.length,Y;switch(X){case"string":Y=M$D(D,$,U,I,Q);break;case"number":Y=O$D(D,U,I);break;case"boolean":Y=E$D(D,I);break;case"bigint":Y=v$D(D,U,I);break;case"symbol":Y=V$D(D,I);break;case"undefined":Y=j$D(D,I);break;case"null":Y=A$D(D,I);break;case"any":case"unknown":Y=I;break;case"never":D.write("return INVALID;"),Y=I;break;case"void":Y=R$D(D,I);break;case"nan":Y=S$D(D,I);break;case"date":Y=T$D(D,I);break;case"object":Y=b$D(D,$,U,I,Q);break;case"optional":Y=P$D(D,$,U,I,Q);break;case"nullable":Y=k$D(D,$,U,I,Q);break;case"array":Y=_$D(D,$,U,I,Q);break;case"literal":Y=x$D(D,$,U,I);break;case"enum":Y=g$D(D,$,U,I);break;case"readonly":{let W=aS(D,$,U,I),B=FD($);D.write(`const ${B} = Object.freeze(${W});`),Y=B;break}case"success":aS(D,$,U,I),Y="true";break;case"default":case"prefault":Y=f$D(D,$,U,I);break;case"nonoptional":Y=y$D(D,$,U,I);break;case"tuple":Y=m$D(D,$,U,I);break;case"union":Y=h$D(D,$,U,I);break;case"intersection":Y=l$D(D,$,U,I);break;case"record":Y=d$D(D,$,U,I);break;case"map":Y=p$D(D,$,U,I);break;case"set":Y=r$D(D,$,U,I);break;case"file":Y=o$D(D,I);break;case"template_literal":Y=t$D(D,$,U,I);break;case"lazy":Y=a$D(D,$,U,I);break;case"pipe":Y=s$D(D,$,U,I);break;case"custom":Y=e$D(D,$,U,I);break;case"transform":Y=U0D(D,$,U,I);break;case"catch":Y=$0D(D,$,U,I);break;default:throw new ND(`schema type ${X}`)}if(Y===null)return null;return W$D(D,$,U,Y)}function M$D(D,$,U,I,F=!0){D.write(`if (typeof ${I} !== "string") return INVALID;`);let J=U._zod.def;if(J.format===void 0)return I;return UT(D,$,J,I,F)}function O$D(D,$,U){D.write(`if (typeof ${U} !== "number" || !Number.isFinite(${U})) return INVALID;`);let I=$._zod.def;if(I.check==="number_format"&&I.format)$T(D,{format:I.format},U);return U}function E$D(D,$){return D.write(`if (typeof ${$} !== "boolean") return INVALID;`),$}function v$D(D,$,U){D.write(`if (typeof ${U} !== "bigint") return INVALID;`);let I=$._zod.def;if(I.format)switch(I.format){case"int64":D.write(`if (${U} < -9223372036854775808n || ${U} > 9223372036854775807n) return INVALID;`);break;case"uint64":D.write(`if (${U} < 0n || ${U} > 18446744073709551615n) return INVALID;`);break}return U}function V$D(D,$){return D.write(`if (typeof ${$} !== "symbol") return INVALID;`),$}function j$D(D,$){return D.write(`if (${$} !== undefined) return INVALID;`),$}function A$D(D,$){return D.write(`if (${$} !== null) return INVALID;`),$}function R$D(D,$){return D.write(`if (${$} !== undefined) return INVALID;`),$}function S$D(D,$){return D.write(`if (typeof ${$} !== "number" || !Number.isNaN(${$})) return INVALID;`),$}function T$D(D,$){return D.write(`if (!(${$} instanceof Date) || Number.isNaN(${$}.getTime())) return INVALID;`),$}function b$D(D,$,U,I,F=!0){let J=U._zod.def;D.write(`if (typeof ${I} !== "object" || ${I} === null || Array.isArray(${I})) return INVALID;`);let X=J.shape,Q=Object.keys(X),Y=Object.getOwnPropertySymbols(X),W=Y.length?[...Q,...Y]:Q,B=(Z)=>typeof Z==="symbol"?JD($,Z):Z$(Z),K=(Z)=>typeof Z==="symbol"?`[${B(Z)}]`:Z$(Z),q=X;if(Q.includes("__proto__"))throw new ND('object shape key "__proto__"');let H=new Map;for(let Z of W){let L=q[Z],v=B(Z),A=FD($);if(D.write(`const ${A} = ${I}[${v}];`),L._zod.optin!==void 0){let V=FD($);if(D.write(`let ${V} = (() => {`),D.indented((b)=>{let y=K$(b,$,L,A);b.write(`return ${y};`)}),D.write("})();"),L._zod.optout==="optional")D.write(`if (${V} === INVALID) {`),D.indented((b)=>{b.write(`if (${v} in ${I}) return INVALID;`),b.write(`${V} = undefined;`)}),D.write("}");else D.write(`if (${V} === INVALID) return INVALID;`);H.set(Z,V)}else{if(u$D(L))D.write(`if (!(${v} in ${I})) return INVALID;`);let V=K$(D,$,L,A,F);if(V!==null)H.set(Z,V)}}let G=J.catchall,z="none";if(G){let Z=G._zod.def.type;if(Z==="never"){let L=Q.map((v)=>`k !== ${Z$(v)}`).join(" && ")||"true";D.write(`for (const k in ${I}) {`),D.indented((v)=>{v.write(`if (${L}) return INVALID;`)}),D.write("}")}else if((Z==="unknown"||Z==="any")&&!G._zod.def.checks?.length)z="passthrough";else z="schema"}let N=FD($),M=W.some((Z)=>tS(q[Z])||fB(q[Z]));if(!F){if(z==="schema"){let Z=Q.length>0?JD($,new Set(Q)):null;D.write(`for (const k in ${I}) {`),D.indented((L)=>{if(L.write('if (k === "__proto__") continue;'),Z)L.write(`if (${Z}.has(k)) continue;`);let v=FD($);L.write(`const ${v} = ${I}[k];`),K$(L,$,G,v,!1)}),D.write("}")}return null}if(!M){let Z=W.map((L)=>`${K(L)}: ${H.get(L)}`).join(", ");D.write(`const ${N} = { ${Z} };`)}else{D.write(`const ${N} = {};`);for(let Z of W){let L=B(Z),v=H.get(Z);if(fB(q[Z]))D.write(`if (${L} in ${I}) ${N}[${L}] = ${v};`);else if(tS(q[Z]))D.write(`if (${v} !== undefined || ${L} in ${I}) ${N}[${L}] = ${v};`);else D.write(`${N}[${L}] = ${v};`)}}if(z!=="none"){let Z=Q.length>0?JD($,new Set(Q)):null;D.write(`for (const k in ${I}) {`),D.indented((L)=>{if(L.write('if (k === "__proto__") continue;'),Z)L.write(`if (${Z}.has(k)) continue;`);if(z==="passthrough")L.write(`${N}[k] = ${I}[k];`);else{let v=FD($);L.write(`const ${v} = ${I}[k];`);let A=K$(L,$,G,v);L.write(`${N}[k] = ${A};`)}}),D.write("}")}return N}function P$D(D,$,U,I,F=!0){let J=U._zod.def;if(C$D(U))return _D(D,$,J.innerType,I,F);if(J.innerType._zod.optin==="defaulted"){let Q=FD($),Y=FD($);return D.write(`let ${Q};`),D.write(`if (${I} === undefined) {`),D.indented((W)=>{W.write(`const ${Y} = (() => {`),W.indented((B)=>{let K=_D(B,$,J.innerType,I);B.write(`return ${K};`)}),W.write("})();"),W.write(`if (${Y} !== INVALID) ${Q} = ${Y};`)}),D.write("} else {"),D.indented((W)=>{let B=_D(W,$,J.innerType,I);W.write(`${Q} = ${B};`)}),D.write("}"),Q}let X=F?FD($):null;if(X)D.write(`let ${X};`);return D.write(`if (${I} !== undefined) {`),D.indented((Q)=>{let Y=_D(Q,$,J.innerType,I,F);if(X&&Y!==null)Q.write(`${X} = ${Y};`)}),D.write("}"),X}function C$D(D){return D._zod.traits?.has("$ZodExactOptional")===!0}function u$D(D){return D._zod.optin===void 0&&Y1(D)}function Y1(D){if(D._zod.def.coerce)return!0;let $=D._zod.def;switch($.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return $.innerType?Y1($.innerType):!1;case"literal":return!!$.values?.includes(void 0);case"enum":return!!D._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return $.innerType?Y1($.innerType):!0;case"catch":return!0;case"union":return $.options?$.options.some(Y1):!0;case"intersection":if(!$.left||!$.right)return!0;return Y1($.left)&&Y1($.right);case"pipe":return $.in?Y1($.in):!0;default:return!0}}function fB(D){return D._zod.optin==="optional"&&D._zod.optout==="optional"}function tS(D){return(D._zod.optin!=="defaulted"||D._zod.optout==="optional")&&c4(D)}function c4(D){let $=D._zod.def;switch($.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!$.values?.includes(void 0);case"enum":return!!D._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return $.innerType?c4($.innerType):!0;case"union":return $.options?$.options.some(c4):!0;case"intersection":return!$.left||!$.right||c4($.left)||c4($.right);case"pipe":return $.out?c4($.out):!0;default:return!0}}function k$D(D,$,U,I,F=!0){let J=U._zod.def,X=F?FD($):null;if(X)D.write(`let ${X} = null;`);return D.write(`if (${I} !== null) {`),D.indented((Q)=>{let Y=_D(Q,$,J.innerType,I,F);if(X&&Y!==null)Q.write(`${X} = ${Y};`)}),D.write("}"),X}function _$D(D,$,U,I,F=!0){let J=U._zod.def;D.write(`if (!Array.isArray(${I})) return INVALID;`);let X=F?FD($):null,Q=FD($),Y=FD($);if(X)D.write(`const ${X} = new Array(${I}.length);`);return D.write(`for (let ${Q} = 0; ${Q} < ${I}.length; ${Q}++) {`),D.indented((W)=>{W.write(`const ${Y} = ${I}[${Q}];`);let B=K$(W,$,J.element,Y,F);if(X&&B!==null)W.write(`${X}[${Q}] = ${B};`)}),D.write("}"),X}function x$D(D,$,U,I){let J=U._zod.def.values;if(J.length!==1){let Q=JD($,new Set(J));return D.write(`if (!${Q}.has(${I})) return INVALID;`),I}let X=J[0];if(typeof X==="number"&&Number.isNaN(X)){let Q=JD($,new Set(J));return D.write(`if (!${Q}.has(${I})) return INVALID;`),I}if(typeof X==="string")D.write(`if (${I} !== ${Z$(X)}) return INVALID;`);else if(typeof X==="number"||typeof X==="boolean")D.write(`if (${I} !== ${X}) return INVALID;`);else if(X===null)D.write(`if (${I} !== null) return INVALID;`);else if(X===void 0)D.write(`if (${I} !== undefined) return INVALID;`);else if(typeof X==="bigint")D.write(`if (${I} !== ${X}n) return INVALID;`);else throw new ND(`literal type ${typeof X}`);return I}function g$D(D,$,U,I){let F=U._zod.values;if(!F)throw new ND("enum schema without enumerated values");let J=JD($,F);return D.write(`if (!${J}.has(${I})) return INVALID;`),I}function aS(D,$,U,I){let F=U._zod.def;return _D(D,$,F.innerType,I)}function f$D(D,$,U,I){let F=U._zod.def,X=Object.getOwnPropertyDescriptor(U._zod.def,"defaultValue")?()=>U._zod.def.defaultValue:void 0;if(U._zod.def.type==="prefault"){if(!X)return _D(D,$,F.innerType,I);let Y=JD($,X),W=FD($);return D.write(`let ${W} = ${I};`),D.write(`if (${I} === undefined) ${W} = ${Y}();`),_D(D,$,F.innerType,W)}let Q=FD($);if(X){let Y=JD($,X),W=JD($,f8);D.write(`let ${Q};`),D.write(`if (${I} === undefined) {`),D.indented((B)=>{B.write(`${Q} = ${W}(${Y}());`)}),D.write("} else {"),D.indented((B)=>{let K=_D(B,$,F.innerType,I);B.write(`${Q} = ${K} === undefined ? ${W}(${Y}()) : ${K};`)}),D.write("}")}else D.write(`let ${Q};`),D.write(`if (${I} !== undefined) {`),D.indented((Y)=>{let W=_D(Y,$,F.innerType,I);Y.write(`${Q} = ${W};`)}),D.write("}");return Q}function y$D(D,$,U,I){let F=U._zod.def,J=_D(D,$,F.innerType,I),X=FD($);return D.write(`const ${X} = ${J};`),D.write(`if (${X} === undefined) return INVALID;`),X}function m$D(D,$,U,I){let F=U._zod.def,J=F.items,X=F.rest;D.write(`if (!Array.isArray(${I})) return INVALID;`);let Q=sS(J,"optin"),Y=sS(J,"optout");if(X)D.write(`if (${I}.length < ${Q}) return INVALID;`);else D.write(`if (${I}.length < ${Q} || ${I}.length > ${J.length}) return INVALID;`);let W=FD($);D.write(`const ${W} = [];`);for(let B=0;B<J.length;B++){let K=J[B];if(B>=Y)D.write(`if (${W}.length === ${B}) {`),D.indented((q)=>{q.write(`if (${B} < ${I}.length) {`),q.indented((H)=>{let G=FD($);H.write(`const ${G} = ${I}[${B}];`);let z=K$(H,$,K,G);H.write(`${W}[${B}] = ${z};`)}),q.write("} else {"),q.indented((H)=>{if(fB(K)){H.write(`${W}.length = ${B};`);return}let G=FD($),z=FD($);H.write(`const ${G} = undefined;`),H.write(`const ${z} = (() => {`),H.indented((N)=>{let M=K$(N,$,K,G);N.write(`return ${M};`)}),H.write("})();"),H.write(`if (${z} === INVALID || ${z} === undefined) ${W}.length = ${B};`),H.write(`else ${W}[${B}] = ${z};`)}),q.write("}")}),D.write("}");else{let q=FD($);D.write(`const ${q} = ${I}[${B}];`);let H=K$(D,$,K,q);D.write(`${W}[${B}] = ${H};`)}}if(X){let B=FD($),K=FD($);D.write(`for (let ${B} = ${J.length}; ${B} < ${I}.length; ${B}++) {`),D.indented((q)=>{q.write(`const ${K} = ${I}[${B}];`);let H=K$(q,$,X,K);q.write(`${W}[${B}] = ${H};`)}),D.write("}")}return W}function sS(D,$){for(let U=D.length-1;U>=0;U--)if(!($==="optin"?D[U]._zod.optin!==void 0:D[U]._zod.optout==="optional"))return U+1;return 0}function h$D(D,$,U,I){let F=U._zod.def,J=F.options;if(F.discriminator)return n$D(D,$,F,I);if(F.inclusive===!1)throw new ND("exclusive unions (z.xor)");if(J.length===0)return D.write("return INVALID;"),I;if(J.length===1)return _D(D,$,J[0],I);if(J.every((Y)=>Y._zod.def.type==="literal"&&!Y._zod.def.checks?.length)){let Y=new Set(J.flatMap((B)=>B._zod.def.values)),W=JD($,Y);return D.write(`if (!${W}.has(${I})) return INVALID;`),I}let Q=FD($);D.write(`let ${Q};`);for(let Y=0;Y<J.length;Y++){let W=J[Y];if(Y===0)D.write(`${Q} = (() => {`);else D.write(`if (${Q} === INVALID) ${Q} = (() => {`);D.indented((B)=>{let K=_D(B,$,W,I);B.write(`return ${K};`)}),D.write("})();")}return D.write(`if (${Q} === INVALID) return INVALID;`),Q}function n$D(D,$,U,I){if(U.unionFallback)throw new ND("discriminated union with unionFallback");if(U.options.length===0)return D.write("return INVALID;"),I;let F=FD($),J=FD($);D.write(`const ${F} = ${I}?.[${Z$(U.discriminator)}];`),D.write(`let ${J};`);let X=!0,Q=new Set;for(let Y of U.options){let W=Y._zod.propValues?.[U.discriminator];if(!W||W.size===0)throw new ND("discriminated union option without static discriminator values");for(let q of W){if(Q.has(q))throw new ND(`duplicate discriminator value ${String(q)}`);Q.add(q)}let B=Array.from(W,(q)=>i$D($,F,q)),K=X?"if":"else if";D.write(`${K} (${B.join(" || ")}) {`),D.indented((q)=>{let H=_D(q,$,Y,I);q.write(`${J} = ${H};`)}),D.write("}"),X=!1}return D.write("else { return INVALID; }"),J}function i$D(D,$,U){if(typeof U==="string")return`${$} === ${Z$(U)}`;if(typeof U==="number"){if(Number.isNaN(U))return`Number.isNaN(${$})`;return`${$} === ${U}`}if(typeof U==="boolean")return`${$} === ${U}`;if(U===null)return`${$} === null`;if(U===void 0)return`${$} === undefined`;if(typeof U==="bigint")return`${$} === ${U}n`;if(typeof U==="symbol"){let I=JD(D,U);return`${$} === ${I}`}throw new ND(`literal discriminator value ${String(U)}`)}function l$D(D,$,U,I){let F=U._zod.def;$.definite=!1;let J=K$(D,$,F.left,I),X=K$(D,$,F.right,I),Q=JD($,n4),Y=FD($);return D.write(`const ${Y} = ${Q}(${J}, ${X});`),D.write(`if (!${Y}.valid) return INVALID;`),`${Y}.data`}function d$D(D,$,U,I){let F=U._zod.def,J=JD($,p$);D.write(`if (!${J}(${I})) return INVALID;`);let X=FD($),Q=FD($),Y=FD($);D.write(`const ${X} = {};`);let W=F,B=W.partial?void 0:F.keyType._zod.values;if(B){let H=[];for(let z of B){if(!(typeof z==="string"||typeof z==="number"||typeof z==="symbol"))throw new ND(`record key value ${String(z)}`);let N=typeof z==="number"?z.toString():z;if(N==="__proto__")throw new ND('record key "__proto__"');H.push(N);let M=JD($,z),Z=_D(D,$,F.keyType,M),L=FD($);D.write(`const ${L} = ${I}[${c$D($,N)}];`);let v=K$(D,$,F.valueType,L);D.write(`${X}[${Z}] = ${v};`)}let G=JD($,new Set(H));return D.write(`for (const ${Q} in ${I}) {`),D.indented((z)=>{if(z.write(`if (${G}.has(${Q})) continue;`),W.mode==="loose")z.write(`if (${Q} !== "__proto__") ${X}[${Q}] = ${I}[${Q}];`);else z.write("return INVALID;")}),D.write("}"),X}let K=F.keyType._zod.def;if(!(K.type==="string"&&K.format===void 0&&!K.coerce&&(K.checks?.length??0)===0)){let H=F.mode==="loose",G=n7(F.keyType);if(G.definite===!1)$.definite=!1;let z=JD($,G),N=JD($,q0),M=FD($);return eS(D,$,I,Q,(Z)=>{if(Z.write(`let ${M} = ${z}(${Q});`),Z.write(`if (${M} === INVALID && typeof ${Q} === "string" && ${N}.test(${Q})) ${M} = ${z}(Number(${Q}));`),H)Z.write(`if (${M} === INVALID) { ${X}[${Q}] = ${I}[${Q}]; continue; }`);else Z.write(`if (${M} === INVALID) return INVALID;`);Z.write(`if (${M} === "__proto__") continue;`);let L=FD($);Z.write(`const ${L} = ${I}[${Q}];`);let v=K$(Z,$,F.valueType,L);Z.write(`${X}[${M}] = ${v};`)}),X}return eS(D,$,I,Q,(H)=>{H.write(`const ${Y} = ${I}[${Q}];`);let G=K$(H,$,F.valueType,Y);H.write(`${X}[${Q}] = ${G};`)},"return INVALID;"),X}function eS(D,$,U,I,F,J){let X=JD($,Object.prototype.propertyIsEnumerable),Q=FD($),Y=FD($),W=FD($);D.write(`const ${Q} = Object.getOwnPropertySymbols(${U});`),D.write(`const ${Y} = Object.getOwnPropertyNames(${U});`),D.write(`for (let ${W} = 0; ${W} < ${Y}.length; ${W}++) {`),D.indented((B)=>{B.write(`const ${I} = ${Y}[${W}];`),B.write(`if (${I} === "__proto__" || !${X}.call(${U}, ${I})) continue;`),F(B)}),D.write("}"),D.write(`for (let ${W} = 0; ${W} < ${Q}.length; ${W}++) {`),D.indented((B)=>{if(B.write(`const ${I} = ${Q}[${W}];`),B.write(`if (!${X}.call(${U}, ${I})) continue;`),J)B.write(J);else F(B)}),D.write("}")}function c$D(D,$){if(typeof $==="string")return Z$($);return JD(D,$)}function p$D(D,$,U,I){let F=U._zod.def;D.write(`if (!(${I} instanceof Map)) return INVALID;`);let J=FD($),X=FD($),Q=FD($);return D.write(`const ${J} = new Map();`),D.write(`for (const [${X}, ${Q}] of ${I}) {`),D.indented((Y)=>{let W=_D(Y,$,F.keyType,X),B=_D(Y,$,F.valueType,Q);Y.write(`${J}.set(${W}, ${B});`)}),D.write("}"),J}function r$D(D,$,U,I){let F=U._zod.def;D.write(`if (!(${I} instanceof Set)) return INVALID;`);let J=FD($),X=FD($);return D.write(`const ${J} = new Set();`),D.write(`for (const ${X} of ${I}) {`),D.indented((Q)=>{let Y=_D(Q,$,F.valueType,X);Q.write(`${J}.add(${Y});`)}),D.write("}"),J}function o$D(D,$){return D.write(`if (!(${$} instanceof File)) return INVALID;`),$}function t$D(D,$,U,I){D.write(`if (typeof ${I} !== "string") return INVALID;`);let F=U._zod.pattern;if(F){let J=JD($,F);D.write(`${J}.lastIndex = 0;`),D.write(`if (!${J}.test(${I})) return INVALID;`)}return I}function a$D(D,$,U,I){let F=U._zod.def,J=W1($,F.getter),X=JD($,{parser:null});D.write(`if (!${X}.parser) {`),D.indented((Y)=>{Y.write(`const inner = ${J}();`),Y.write(`${X}.parser = function(input) {`),Y.indented((W)=>{W.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),W.write("return result.issues.length === 0 ? result.value : INVALID;")}),Y.write("};")}),D.write("}");let Q=FD($);return D.write(`const ${Q} = ${X}.parser(${I});`),D.write(`if (${Q} === INVALID) return INVALID;`),Q}function s$D(D,$,U,I){let F=U._zod.def,J=_D(D,$,F.in,I);if(F.transform){if(B1(F.transform))throw new H0("z.compile: async transforms in pipes are not supported");let X=F.transform,Y=W1($,(B)=>{let K={value:B,issues:[],addIssue:mB},q=X(B,K);if(q instanceof Promise)return O$;return K.issues.length===0?q:O$}),W=FD($);return D.write(`const ${W} = ${Y}(${J});`),D.write(`if (${W} === INVALID) return INVALID;`),_D(D,$,F.out,W)}else return _D(D,$,F.out,J)}function B1(D){return typeof D==="function"&&(D.constructor.name==="AsyncFunction"||D[Symbol.toStringTag]==="AsyncFunction")}function e$D(D,$,U,I){let F=U._zod.def;if(F.fn){if(B1(F.fn))throw new H0("z.compile: async custom predicates are not supported");let J=W1($,F.fn),X=JD($,gB),Q=FD($);D.write(`const ${Q} = ${J}(${I});`),D.write(`if (${Q} instanceof Promise) ${X}();`),D.write(`if (!${Q}) return INVALID;`)}else throw new ND("custom schema without a predicate function");return I}function D0D(D,$,U){let I=D._zod.run({value:U,issues:[]},{});if(I&&typeof I.then==="function")return O$;let F=I;if(F.issues.length===0)return F.value;return $()}function $0D(D,$,U,I){let F=U._zod.def;if(!F.catchValue[a5])throw new ND("catch with a callback (only a constant catch value compiles)",!1);let J=FD($);D.write(`let ${J} = (() => {`),D.indented((W)=>{let B=K$(W,$,F.innerType,I);W.write(`return ${B};`)}),D.write("})();");let X=JD($,F.innerType),Q=W1($,F.catchValue),Y=JD($,D0D);return D.write(`if (${J} === INVALID) {`),D.indented((W)=>{W.write(`${J} = ${Y}(${X}, ${Q}, ${I});`),W.write(`if (${J} === INVALID) return INVALID;`)}),D.write("}"),J}function U0D(D,$,U,I){let F=U._zod.def;if(F.transform){if(B1(F.transform))throw new H0("z.compile: async transforms are not supported");let J=F.transform,Q=W1($,(W)=>{let B={value:W,issues:[],addIssue:mB},K=J(W,B);if(K instanceof Promise)return O$;return B.issues.length===0?K:O$}),Y=FD($);return D.write(`const ${Y} = ${Q}(${I});`),D.write(`if (${Y} === INVALID) return INVALID;`),Y}return I}var O$,oS,H0,ND,Y$D,Z$D;var FT=T(()=>{X6();EW();J1();i4();c();O$=Symbol.for("zod.compile.invalid"),oS=Symbol.for("zod.compile.fallback");H0=class H0 extends Error{constructor(D="z.compile does not support async refinements, transforms, or checks"){super(D);this.name="ZodCompileAsyncError"}};ND=class ND extends Error{constructor(D,$=!0){super(`z.compile does not support ${D}; this schema must use the runtime parser`);this.name="ZodCompileUnsupportedError",this.islandable=$}};Y$D=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);Z$D=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function i7(D){if(D.checks)D.checks=[...D.checks];return D}function hB(D,$){return new D(i7({type:"string",...i($)}))}function nB(D,$){return new D(i7({type:"string",coerce:!0,...i($)}))}function l7(D,$){return new D({type:"string",format:"email",check:"string_format",abort:!1,...i($)})}function d7(D,$){return new D({type:"string",format:"guid",check:"string_format",abort:!1,...i($)})}function c7(D,$){return new D({type:"string",format:"uuid",check:"string_format",abort:!1,...i($)})}function p7(D,$){return new D({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...i($)})}function r7(D,$){return new D({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...i($)})}function o7(D,$){return new D({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...i($)})}function L3(D,$){return new D({type:"string",format:"url",check:"string_format",abort:!1,...i($)})}function t7(D,$){return new D({type:"string",format:"emoji",check:"string_format",abort:!1,...i($)})}function a7(D,$){return new D({type:"string",format:"nanoid",check:"string_format",abort:!1,...i($)})}function s7(D,$){return new D({type:"string",format:"cuid",check:"string_format",abort:!1,...i($)})}function e7(D,$){return new D({type:"string",format:"cuid2",check:"string_format",abort:!1,...i($)})}function DU(D,$){return new D({type:"string",format:"ulid",check:"string_format",abort:!1,...i($)})}function $U(D,$){return new D({type:"string",format:"xid",check:"string_format",abort:!1,...i($)})}function UU(D,$){return new D({type:"string",format:"ksuid",check:"string_format",abort:!1,...i($)})}function FU(D,$){return new D({type:"string",format:"ipv4",check:"string_format",abort:!1,...i($)})}function IU(D,$){return new D({type:"string",format:"ipv6",check:"string_format",abort:!1,...i($)})}function iB(D,$){return new D({type:"string",format:"mac",check:"string_format",abort:!1,...i($)})}function JU(D,$){return new D({type:"string",format:"cidrv4",check:"string_format",abort:!1,...i($)})}function XU(D,$){return new D({type:"string",format:"cidrv6",check:"string_format",abort:!1,...i($)})}function QU(D,$){return new D({type:"string",format:"base64",check:"string_format",abort:!1,...i($)})}function YU(D,$){return new D({type:"string",format:"base64url",check:"string_format",abort:!1,...i($)})}function WU(D,$){return new D({type:"string",format:"e164",check:"string_format",abort:!1,...i($)})}function lB(D,$){return new D({type:"string",format:"credit_card",check:"string_format",abort:!1,...i($)})}function dB(D,$){return new D({type:"string",format:"iban",check:"string_format",abort:!1,...i($)})}function BU(D,$){return new D({type:"string",format:"jwt",check:"string_format",abort:!1,...i($)})}function w3(D,$){return new D({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...i($)})}function Z3(D,$){return new D({type:"string",format:"date",check:"string_format",...i($)})}function M3(D,$){return new D({type:"string",format:"time",check:"string_format",precision:null,...i($)})}function O3(D,$){return new D({type:"string",format:"duration",check:"string_format",...i($)})}function pB(D,$){return new D(i7({type:"number",checks:[],...i($)}))}function rB(D,$){return new D(i7({type:"number",coerce:!0,checks:[],...i($)}))}function oB(D,$){return new D({type:"number",check:"number_format",abort:!1,format:"safeint",...i($)})}function tB(D,$){return new D({type:"number",check:"number_format",abort:!1,format:"float32",...i($)})}function aB(D,$){return new D({type:"number",check:"number_format",abort:!1,format:"float64",...i($)})}function sB(D,$){return new D({type:"number",check:"number_format",abort:!1,format:"int32",...i($)})}function eB(D,$){return new D({type:"number",check:"number_format",abort:!1,format:"uint32",...i($)})}function DK(D,$){return new D({type:"boolean",...i($)})}function $K(D,$){return new D({type:"boolean",coerce:!0,...i($)})}function UK(D,$){return new D({type:"bigint",...i($)})}function FK(D,$){return new D({type:"bigint",coerce:!0,...i($)})}function IK(D,$){return new D({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...i($)})}function JK(D,$){return new D({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...i($)})}function XK(D,$){return new D({type:"symbol",...i($)})}function QK(D,$){return new D({type:"undefined",...i($)})}function YK(D,$){return new D({type:"null",...i($)})}function WK(D){return new D({type:"any"})}function BK(D){return new D({type:"unknown"})}function KK(D,$){return new D({type:"never",...i($)})}function GK(D,$){return new D({type:"void",...i($)})}function qK(D,$){return new D({type:"date",...i($)})}function HK(D,$){return new D({type:"date",coerce:!0,...i($)})}function NK(D,$){return new D({type:"nan",...i($)})}function N0(D,$){return new q7({check:"less_than",...i($),value:D,inclusive:!1})}function g$(D,$){return new q7({check:"less_than",...i($),value:D,inclusive:!0})}function z0(D,$){return new H7({check:"greater_than",...i($),value:D,inclusive:!1})}function f$(D,$){return new H7({check:"greater_than",...i($),value:D,inclusive:!0})}function KU(D){return z0(0,D)}function GU(D){return N0(0,D)}function qU(D){return g$(0,D)}function HU(D){return f$(0,D)}function Q6(D,$){return new yQ({check:"multiple_of",...i($),value:D})}function Y6(D,$){return new nQ({check:"max_size",...i($),maximum:D})}function L0(D,$){return new iQ({check:"min_size",...i($),minimum:D})}function K1(D,$){return new lQ({check:"size_equals",...i($),size:D})}function G1(D,$){return new dQ({check:"max_length",...i($),maximum:D})}function P0(D,$){return new cQ({check:"min_length",...i($),minimum:D})}function q1(D,$){return new pQ({check:"length_equals",...i($),length:D})}function p4(D,$){return new rQ({check:"string_format",format:"regex",...i($),pattern:D})}function r4(D){return new oQ({check:"string_format",format:"lowercase",...i(D)})}function o4(D){return new tQ({check:"string_format",format:"uppercase",...i(D)})}function t4(D,$){return new aQ({check:"string_format",format:"includes",...i($),includes:D})}function a4(D,$){return new sQ({check:"string_format",format:"starts_with",...i($),prefix:D})}function s4(D,$){return new eQ({check:"string_format",format:"ends_with",...i($),suffix:D})}function NU(D,$,U){return new DY({check:"property",property:D,schema:$,...i(U)})}function e4(D,$){return new $Y({check:"properties",shape:D,...i($)})}function D2(D,$){return new UY({check:"mime_type",mime:D,...i($)})}function I0(D){return new FY({check:"overwrite",tx:D})}function $2(D){return I0(($)=>$.normalize(D))}function U2(){return I0((D)=>D.trim())}function F2(){return I0((D)=>D.toLowerCase())}function I2(){return I0((D)=>D.toUpperCase())}function J2(){return I0((D)=>yX(D))}function zK(D,$,U){return new D({type:"array",element:$,...i(U)})}function F0D(D,$,U){return new D({type:"union",options:$,...i(U)})}function I0D(D,$,U){return new D({type:"union",options:$,inclusive:!1,...i(U)})}function J0D(D,$,U,I){return new D({type:"union",options:U,discriminator:$,...i(I)})}function X0D(D,$,U){return new D({type:"intersection",left:$,right:U})}function Q0D(D,$,U,I){let F=U instanceof XD;return new D({type:"tuple",items:$,rest:F?U:null,...i(F?I:U)})}function Y0D(D,$,U,I){return new D({type:"record",keyType:$,valueType:U,...i(I)})}function W0D(D,$,U,I){return new D({type:"map",keyType:$,valueType:U,...i(I)})}function B0D(D,$,U){return new D({type:"set",valueType:$,...i(U)})}function K0D(D,$,U){let I=Array.isArray($)?Object.fromEntries($.map((F)=>[F,F])):$;return new D({type:"enum",entries:I,...i(U)})}function G0D(D,$,U){return new D({type:"enum",entries:$,...i(U)})}function q0D(D,$,U){return new D({type:"literal",values:Array.isArray($)?$:[$],...i(U)})}function LK(D,$){return new D({type:"file",...i($)})}function H0D(D,$){return new D({type:"transform",transform:$})}function N0D(D,$){return new D({type:"optional",innerType:$})}function z0D(D,$){return new D({type:"nullable",innerType:$})}function L0D(D,$,U){return new D({type:"default",innerType:$,get defaultValue(){return typeof U==="function"?U():f8(U)}})}function w0D(D,$,U){return new D({type:"nonoptional",innerType:$,...i(U)})}function Z0D(D,$){return new D({type:"success",innerType:$})}function M0D(D,$,U){return new D({type:"catch",innerType:$,catchValue:typeof U==="function"?U:dX(U)})}function O0D(D,$,U){return new D({type:"pipe",in:$,out:U})}function E0D(D,$){return new D({type:"readonly",innerType:$})}function v0D(D,$,U){return new D({type:"template_literal",parts:$,...i(U)})}function V0D(D,$){return new D({type:"lazy",getter:$})}function j0D(D,$){return new D({type:"promise",innerType:$})}function wK(D,$,U){let I=i(U);return I.abort??(I.abort=!0),new D({type:"custom",check:"custom",fn:$,...I})}function ZK(D,$,U){return new D({type:"custom",check:"custom",fn:$,...i(U)})}function MK(D,$){let U=IT((I)=>{return I.addIssue=(F)=>{if(typeof F==="string")I.issues.push(_4(F,I.value,U._zod.def));else{let J=F;if(J.fatal)J.continue=!1;if(J.code??(J.code="custom"),!("input"in J))J.input=I.value;J.inst??(J.inst=U),J.continue??(J.continue=!U._zod.def.abort),I.issues.push(_4(J))}},D(I.value,I)},$);return U}function IT(D,$){let U=new SD({check:"custom",...i($)});return U._zod.check=D,U}function OK(D){let $=new SD({check:"describe"});return $._zod.onattach=[(U)=>{let I=J$.get(U)??{};J$.add(U,{...I,description:D})}],$._zod.check=()=>{},$}function EK(D){let $=new SD({check:"meta"});return $._zod.onattach=[(U)=>{let I=J$.get(U)??{};J$.add(U,{...I,...D})}],$._zod.check=()=>{},$}function vK(D,$){let U=i($),I=U.truthy??["true","1","yes","on","y","enabled"],F=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")I=I.map((H)=>typeof H==="string"?H.toLowerCase():H),F=F.map((H)=>typeof H==="string"?H.toLowerCase():H);let J=new Set(I),X=new Set(F),Q=D.Codec??X3,Y=D.Boolean??I3,B=new(D.String??X1)({type:"string",error:U.error}),K=new Y({type:"boolean",error:U.error}),q=new Q({type:"pipe",in:B,out:K,transform:(H,G)=>{let z=H;if(U.case!=="sensitive")z=z.toLowerCase();if(J.has(z))return!0;else if(X.has(z))return!1;else return G.issues.push({code:"invalid_value",expected:"stringbool",values:[...J,...X],input:G.value,inst:q,continue:!1}),{}},reverseTransform:(H,G)=>{if(H===!0)return I[0]||"true";else return F[0]||"false"},error:U.error});return q._zod.bag.truthy=I,q._zod.bag.falsy=F,q._zod.bag.case=U.case??"insensitive",q}function H1(D,$,U,I={}){let F=i(I),J={check:"string_format",type:"string",format:$,fn:typeof U==="function"?U:(Q)=>U.test(Q),...F};if(U instanceof RegExp)J.pattern=U;return new D(J)}var cB;var JT=T(()=>{N7();z3();i4();c();cB={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function E3(D,...$){for(let U of $)for(let I of Reflect.ownKeys(U))if(Object.prototype.propertyIsEnumerable.call(U,I))I$(D,I,U[I]);return D}function W6(D){let $=D?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";return{processors:D.processors??{},metadataRegistry:D?.metadata??J$,target:$,unrepresentable:D?.unrepresentable??"throw",override:D?.override??(()=>{}),io:D?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:D?.cycles??"ref",reused:D?.reused??"inline",intersections:[],deferred:[],external:D?.external??void 0}}function rD(D,$,U,I,F){let J=typeof $.unrepresentable==="function"?$.unrepresentable({zodSchema:D,path:I.path,message:F}):$.unrepresentable;if(J==="any")return!1;if(J===void 0||J==="throw")throw Error(F);return Object.assign(U,J),!0}function ED(D,$,U={path:[],schemaPath:[]}){var I;let F=D._zod.def,J=$.seen.get(D);if(J){if(J.count++,U.schemaPath.includes(D))J.cycle=U.path;return J.schema}let X={schema:{},count:1,cycle:void 0,path:U.path};$.seen.set(D,X),$.sharedDefsExtractedFor=void 0,$.sharedEmitDoneFor=void 0;let Q=D._zod.toJSONSchema?.();if(Q)X.schema=Q;else{let B={...U,schemaPath:[...U.schemaPath,D],path:U.path};if(D._zod.processJSONSchema)D._zod.processJSONSchema($,X.schema,B);else{let q=X.schema,H=$.processors[F.type];if(!H)throw Error(`[toJSONSchema]: Non-representable type encountered: ${F.type}`);H(D,$,q,B)}let K=D._zod.parent;if(K){if(!X.ref)X.ref=K;ED(K,$,B),$.seen.get(K).isParent=!0}}let Y=$.metadataRegistry.get(D);if(Y)E3(X.schema,Y);if($.io==="input"&&E$(D))delete X.schema.examples,delete X.schema.default;if($.io==="input"&&"_prefault"in X.schema)(I=X.schema).default??(I.default=X.schema._prefault);return delete X.schema._prefault,$.seen.get(D).schema}function XT(D){return D.replace(/~/g,"~0").replace(/\//g,"~1")}function B6(D,$){let U=D.seen.get($);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");if(D.external&&D.sharedDefsExtractedFor===D.external)return;let I=new Map;for(let X of D.seen.entries()){let Q=D.metadataRegistry.get(X[0])?.id;if(Q){let Y=I.get(Q);if(Y&&Y!==X[0])throw Error(`Duplicate schema id "${Q}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);I.set(Q,X[0])}}let F=(X)=>{let Q=D.target==="draft-2020-12"?"$defs":"definitions";if(D.external){let K=D.external.registry.get(X[0])?.id,q=D.external.uri??((G)=>G);if(K)return{ref:q(K)};let H=X[1].defId??X[1].schema.id??`schema${D.counter++}`;return X[1].defId=H,{defId:H,ref:`${q("__shared")}#/${Q}/${XT(H)}`}}let Y="#",W=`${Y}/${Q}/`;if(X[1]===U&&!X[1].schema.id)return{ref:Y};let B=X[1].schema.id??`__schema${D.counter++}`;return{defId:B,ref:W+XT(B)}},J=(X)=>{if(X[1].schema.$ref)return;let Q=X[1],{ref:Y,defId:W}=F(X);if(Q.def={...Q.schema},W)Q.defId=W;let B=Q.schema;for(let K in B)delete B[K];B.$ref=Y};if(D.cycles==="throw")for(let X of D.seen.entries()){let Q=X[1];if(Q.cycle)throw Error(`Cycle detected: #/${Q.cycle?.join("/")}/<root>
|
|
222
222
|
|
|
223
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of D.seen.entries()){let Q=X[1];if($===X[0]){J(X);continue}if(D.external){let W=D.external.registry.get(X[0])?.id;if($!==X[0]&&W){J(X);continue}}if(D.metadataRegistry.get(X[0])?.id){J(X);continue}if(Q.cycle){J(X);continue}if(Q.count>1){if(D.reused==="ref")J(X)}}if(D.external)D.sharedDefsExtractedFor=D.external}function WT(D){let $=D.anyOf;if(!Array.isArray($)||$.length===0||D.type!==void 0)return;let U=[];for(let I of $){if(!I||typeof I!=="object")return;WT(I);let F=Object.keys(I);if(F.length!==1||F[0]!=="type")return;let J=I.type;for(let X of Array.isArray(J)?J:[J]){if(typeof X!=="string")return;if(!U.includes(X))U.push(X)}}delete D.anyOf,D.type=U.length===1?U[0]:U}function YT(D){let $=D.additionalProperties;if($===void 0||$===!1||typeof $!=="object"||$===null)return null;return Object.keys($).length?$:null}function VK(D){let $=[];for(let J of D){if(typeof J!=="object"||J.type!=="object")return null;for(let X in J)if(!BT.has(X))return null;$.push(J)}let U={},I=new Set;for(let J of $){for(let X in J.properties){if(Object.prototype.hasOwnProperty.call(U,X))continue;let Q=[];for(let W of $){let B=W.properties?.[X]??YT(W);if(B===null||B===void 0)continue;if(!Q.some((K)=>JSON.stringify(K)===JSON.stringify(B)))Q.push(B)}let Y=Q.length===1?Q[0]:VK(Q)??{allOf:Q};I$(U,X,Y)}for(let X of J.required??[])I.add(X)}let F={type:"object",properties:U};if(I.size)F.required=[...I];if($.every((J)=>J.additionalProperties===!1))F.additionalProperties=!1;else{let J=[];for(let X of $){let Q=YT(X);if(Q&&!J.some((Y)=>JSON.stringify(Y)===JSON.stringify(Q)))J.push(Q)}if(J.length===1)F.additionalProperties=J[0];else if(J.length>1)F.additionalProperties={allOf:J}}return F}function A0D(D){let $=D.allOf;if(!Array.isArray($)||$.length<2)return;for(let F of BT)if(F in D)return;let U=$.filter((F)=>QT.some((J)=>Array.isArray(F[J]))),I=null;if(!U.length)I=VK($);else{let F=U[0],J=QT.find((Y)=>Array.isArray(F[Y]));if(Object.keys(F).length!==1)return;let X=$.filter((Y)=>Y!==F),Q=F[J].map((Y)=>VK([...X,Y]));if(Q.some((Y)=>!Y))return;I={[J]:Q}}if(!I)return;delete D.allOf,E3(D,I)}function K6(D,$){let U=D.seen.get($);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let I=(Q)=>{let Y=D.seen.get(Q);if(Y.ref===null)return;let W=Y.def??Y.schema,B={...W},K=Y.ref;if(Y.ref=null,K){I(K);let H=D.seen.get(K),G=H.schema;if(G.$ref&&(D.target==="draft-07"||D.target==="draft-04"||D.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(G);else E3(W,G);if(E3(W,B),Q._zod.parent===K)for(let N in W){if(N==="$ref"||N==="allOf")continue;if(!(N in B))delete W[N]}if(G.$ref&&H.def)for(let N in W){if(N==="$ref"||N==="allOf")continue;if(N in H.def&&JSON.stringify(W[N])===JSON.stringify(H.def[N]))delete W[N]}}let q=Q._zod.parent;if(q&&q!==K){I(q);let H=D.seen.get(q);if(H?.schema.$ref){if(W.$ref=H.schema.$ref,H.def)for(let G in W){if(G==="$ref"||G==="allOf")continue;if(G in H.def&&JSON.stringify(W[G])===JSON.stringify(H.def[G]))delete W[G]}}}D.override({zodSchema:Q,jsonSchema:W,path:Y.path??[]})};if(!D.external||D.sharedEmitDoneFor!==D.external){for(let Q of[...D.seen.entries()].reverse())I(Q[0]);if(D.target!=="openapi-3.0")for(let Q of D.seen.entries())WT(Q[1].def??Q[1].schema);for(let Q of D.deferred)Q();if(D.intersections.length){let Q=new Map;for(let Y of D.seen.values())for(let W of[Y.schema,Y.def]){let B=W?.allOf;if(!Array.isArray(B))continue;let K=Q.get(B);if(K)K.push(W);else Q.set(B,[W])}for(let Y of D.intersections)for(let W of Q.get(Y)??[])A0D(W)}}let F={};if(D.target==="draft-2020-12")F.$schema="https://json-schema.org/draft/2020-12/schema";else if(D.target==="draft-07")F.$schema="http://json-schema.org/draft-07/schema#";else if(D.target==="draft-04")F.$schema="http://json-schema.org/draft-04/schema#";else if(D.target==="openapi-3.0");if(D.external?.uri){let Q=D.external.registry.get($)?.id;if(!Q)throw Error("Schema is missing an `id` property");F.$id=D.external.uri(Q)}E3(F,U.defId?U.schema:U.def??U.schema);let J=D.metadataRegistry.get($)?.id;if(J!==void 0&&F.id===J)delete F.id;let X=D.external?.defs??{};if(!D.external||D.sharedEmitDoneFor!==D.external)for(let Q of D.seen.entries()){let Y=Q[1];if(Y.def&&Y.defId){if(Y.def.id===Y.defId)delete Y.def.id;I$(X,Y.defId,Y.def)}}if(D.external)D.sharedEmitDoneFor=D.external;if(D.external);else if(Object.keys(X).length>0)if(D.target==="draft-2020-12")F.$defs=X;else F.definitions=X;try{let Q=JSON.parse(JSON.stringify(F));return Object.defineProperty(Q,"~standard",{value:{...$["~standard"],jsonSchema:{input:X2($,"input",D.processors),output:X2($,"output",D.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function E$(D,$){let U=$??{seen:new Set};if(U.seen.has(D))return!1;U.seen.add(D);let I=D._zod.def;if(I.type==="transform")return!0;if(I.type==="array")return E$(I.element,U);if(I.type==="set")return E$(I.valueType,U);if(I.type==="lazy")return E$(I.getter(),U);if(I.type==="promise"||I.type==="optional"||I.type==="nonoptional"||I.type==="nullable"||I.type==="readonly"||I.type==="default"||I.type==="prefault"||I.type==="catch")return E$(I.innerType,U);if(I.type==="intersection")return E$(I.left,U)||E$(I.right,U);if(I.type==="record"||I.type==="map")return E$(I.keyType,U)||E$(I.valueType,U);if(I.type==="pipe"){if(D._zod.traits.has("$ZodCodec"))return!0;return E$(I.in,U)||E$(I.out,U)}if(I.type==="object"){for(let F in I.shape)if(E$(I.shape[F],U))return!0;return!1}if(I.type==="union"){for(let F of I.options)if(E$(F,U))return!0;return!1}if(I.type==="tuple"){for(let F of I.items)if(E$(F,U))return!0;if(I.rest&&E$(I.rest,U))return!0;return!1}return!1}var BT,QT,jK=(D,$={})=>(U)=>{let I=W6({...U,processors:$});return ED(D,I),B6(I,D),K6(I,D)},X2=(D,$,U={})=>(I)=>{let{libraryOptions:F,target:J}=I??{},X=W6({...F??{},target:J,io:$,processors:U});return ED(D,X),B6(X,D),K6(X,D)};var v3=T(()=>{z3();c();BT=new Set(["type","properties","required","additionalProperties"]),QT=["oneOf","anyOf"]});function oD(D){let $={},U=D._zod.def,I=D._zod.traits.has("$ZodCheck")?[D,...U.checks??[]]:U.checks??[];for(let J of I)R0D[J._zod.def.check]?.($,J._zod.def);let F=D._zod.bag;if(F.minimum!==void 0)Q2($,"minimum",F.minimum);if(F.exclusiveMinimum!==void 0)Q2($,"exclusiveMinimum",F.exclusiveMinimum);if(F.maximum!==void 0)Y2($,"maximum",F.maximum);if(F.exclusiveMaximum!==void 0)Y2($,"exclusiveMaximum",F.exclusiveMaximum);if(F.multipleOf!==void 0)NT($,F.multipleOf);if(F.format!==void 0){if($.format??($.format=F.format),F.format.includes("int"))$.isInt=!0}if(F.mime)LT($,F.mime);for(let J of F.patterns??[])zT($,J);return $}function V3(D){let $=D._zod.def;if($.type==="pipe"&&$.in._zod.traits.has("$ZodTransform"))return V3($.out);if($.type==="catch")return V3($.innerType);return D._zod.optin}function AK(D,$,U){if($.$ref){if(U.has($))return $;U.add($);let G=D.get($)?.def;if(!G)return $;let z=AK(D,G,U);return z===G?$:z}for(let G of["anyOf","oneOf"]){let z=$[G];if(!Array.isArray(z))continue;let N=z.map((M)=>AK(D,M,U));if(N.some((M,Z)=>M!==z[Z]))$={...$,[G]:N}}let I=Array.isArray($.type)?$.type:[$.type],F=!I.includes("string")&&I.some((G)=>G==="number"||G==="integer"),J=$.enum??($.const!==void 0?[$.const]:void 0);if(!F&&!J?.some((G)=>typeof G==="number"))return $;let{minimum:X,maximum:Q,exclusiveMinimum:Y,exclusiveMaximum:W,multipleOf:B,format:K,id:q,...H}=$;if(H.enum)H.enum=H.enum.map((G)=>typeof G==="number"?String(G):G);else if(typeof H.const==="number")H.const=String(H.const);if(!F)return H;if(H.type="string",!J)H.pattern=(I.includes("number")?q0:t8).source;return H}function b0D(D){let $=new Map;for(let I of D.seen.values())if(I.def&&!$.has(I.schema))$.set(I.schema,I);let U=new Map;for(let I of RK.get(D)??[]){let F=D.seen.get(I),J=(F?.def??F?.schema)?.propertyNames;if(!J||J===!0||U.has(J))continue;let X=AK($,J,new Set);if(X!==J)U.set(J,X)}if(!U.size)return;for(let I of D.seen.values())for(let F of[I.schema,I.def]){let J=F&&U.get(F.propertyNames);if(J)F.propertyNames=J}}function MT(D,$,U,I,F){let J=!1,X=JSON.stringify(D,(Q,Y)=>{if(typeof Y!=="bigint")return Y;return J=!0,null});if(!J)return JSON.parse(X);return rD($,U,I,F,"BigInt defaults cannot be represented in JSON Schema"),IG}function ZU(D,$){if("_idmap"in D){let I=D,F=W6({...$,processors:zU}),J={};for(let Y of I._idmap.entries()){let[W,B]=Y;ED(B,F)}let X={},Q={registry:I,uri:$?.uri,defs:J};F.external=Q;for(let Y of I._idmap.entries()){let[W,B]=Y;B6(F,B),I$(X,W,K6(F,B))}if(Object.keys(J).length>0){let Y=F.target==="draft-2020-12"?"$defs":"definitions";X.__shared={[Y]:J}}return{schemas:X}}let U=W6({...$,processors:zU});return ED(D,U),B6(U,D),K6(U,D)}var Q2=(D,$,U)=>{if(D[$]===void 0||U>D[$])D[$]=U},Y2=(D,$,U)=>{if(D[$]===void 0||U<D[$])D[$]=U},KT=(D,$)=>{Q2(D,"minimum",$),Y2(D,"maximum",$)},NT=(D,$)=>{if(D.multipleOf??(D.multipleOf=[]),!D.multipleOf.includes($))D.multipleOf.push($)},zT=(D,$)=>{D.patterns??(D.patterns=new Set),D.patterns.add($)},LT=(D,$)=>{D.mime=D.mime?D.mime.filter((U)=>$.includes(U)):[...$]},wT=(D,$)=>{if(D.format=$,$.includes("int"))D.isInt=!0},GT=(D,$)=>Q2(D,"minimum",$.minimum),qT=(D,$)=>Y2(D,"maximum",$.maximum),HT=(D)=>($,U)=>{wT($,U.format);let[I,F]=D[U.format];Q2($,"minimum",I),Y2($,"maximum",F)},R0D,S0D,T0D,ZT=(D)=>T0D.get(D)??D,SK=(D,$,U,I)=>{let F=U;F.type="string";let{minimum:J,maximum:X,format:Q,patterns:Y,contentEncoding:W,laxFormat:B}=oD(D);if(typeof J==="number")F.minLength=J;if(typeof X==="number")F.maxLength=X;if(Q){if(F.format=S0D[Q]??Q,F.format==="")delete F.format;if(Q==="time"||B)delete F.format}if(W)F.contentEncoding=W;if(Y&&Y.size>0){let K=[...Y].map(ZT);if(K.length===1)F.pattern=K[0].source;else if(K.length>1)F.allOf=[...K.map((q)=>({...$.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"?{type:"string"}:{},pattern:q.source}))]}},TK=(D,$,U,I)=>{let F=U,{minimum:J,maximum:X,multipleOf:Q,exclusiveMaximum:Y,exclusiveMinimum:W,isInt:B}=oD(D);F.type=B?"integer":"number";let K=typeof W==="number"&&W>=(J??Number.NEGATIVE_INFINITY),q=typeof Y==="number"&&Y<=(X??Number.POSITIVE_INFINITY),H=$.target==="draft-04"||$.target==="openapi-3.0";if(K)if(H)F.minimum=W,F.exclusiveMinimum=!0;else F.exclusiveMinimum=W;else if(typeof J==="number")F.minimum=J;if(q)if(H)F.maximum=Y,F.exclusiveMaximum=!0;else F.exclusiveMaximum=Y;else if(typeof X==="number")F.maximum=X;if(Q){let G=new Set;for(let M of Q)if(Number.isFinite(M)&&M!==0)G.add(Math.abs(M));else rD(D,$,F,I,`A multipleOf divisor of ${M} cannot be represented in JSON Schema`);let[z,...N]=G;if(z!==void 0)F.multipleOf=z;if(N.length)F.allOf=[...F.allOf??[],...N.map((M)=>({multipleOf:M}))]}},bK=(D,$,U,I)=>{U.type="boolean"},PK=(D,$,U,I)=>{rD(D,$,U,I,"BigInt cannot be represented in JSON Schema")},CK=(D,$,U,I)=>{rD(D,$,U,I,"Symbols cannot be represented in JSON Schema")},uK=(D,$,U,I)=>{if($.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},kK=(D,$,U,I)=>{rD(D,$,U,I,"Undefined cannot be represented in JSON Schema")},_K=(D,$,U,I)=>{rD(D,$,U,I,"Void cannot be represented in JSON Schema")},xK=(D,$,U,I)=>{U.not={}},gK=(D,$,U,I)=>{},fK=(D,$,U,I)=>{},yK=(D,$,U,I)=>{rD(D,$,U,I,"Date cannot be represented in JSON Schema")},mK=(D,$,U,I)=>{let F=D._zod.def,J=P4(F.entries);if(J.length===0){U.not={};return}if(J.every((X)=>typeof X==="number"))U.type="number";if(J.every((X)=>typeof X==="string"))U.type="string";U.enum=J},hK=(D,$,U,I)=>{let F=D._zod.def;if(F.values.length===0){U.not={};return}let J=[];for(let X of F.values)if(X===void 0){if(rD(D,$,U,I,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof X==="bigint"){if(rD(D,$,U,I,"BigInt literals cannot be represented in JSON Schema"))return;J.push(Number(X))}else J.push(X);if(J.length===0);else if(J.length===1){let X=J[0];if(U.type=X===null?"null":typeof X,$.target==="draft-04"||$.target==="openapi-3.0")U.enum=[X];else U.const=X}else{if(J.every((X)=>typeof X==="number"))U.type="number";if(J.every((X)=>typeof X==="string"))U.type="string";if(J.every((X)=>typeof X==="boolean"))U.type="boolean";if(J.every((X)=>X===null))U.type="null";U.enum=J}},nK=(D,$,U,I)=>{rD(D,$,U,I,"NaN cannot be represented in JSON Schema")},iK=(D,$,U,I)=>{let F=U,J=D._zod.pattern;if(!J)throw Error("Pattern not found in template literal");F.type="string",F.pattern=J.source},lK=(D,$,U,I)=>{let F=U;F.type="string",F.format="binary",F.contentEncoding="binary";let{minimum:J,maximum:X,mime:Q}=oD(D);if(J!==void 0)F.minLength=J;if(X!==void 0)F.maxLength=X;if(!Q)return;if(Q.length===0)F.not={};else if(Q.length===1)F.contentMediaType=Q[0];else F.anyOf=Q.map((Y)=>({contentMediaType:Y}))},dK=(D,$,U,I)=>{U.type="boolean"},cK=(D,$,U,I)=>{rD(D,$,U,I,"Custom types cannot be represented in JSON Schema")},pK=(D,$,U,I)=>{rD(D,$,U,I,"Function types cannot be represented in JSON Schema")},rK=(D,$,U,I)=>{rD(D,$,U,I,"Transforms cannot be represented in JSON Schema")},oK=(D,$,U,I)=>{rD(D,$,U,I,"Map cannot be represented in JSON Schema")},tK=(D,$,U,I)=>{rD(D,$,U,I,"Set cannot be represented in JSON Schema")},aK=(D,$,U,I)=>{let F=U,J=D._zod.def,{minimum:X,maximum:Q}=oD(D);if(typeof X==="number")F.minItems=X;if(typeof Q==="number")F.maxItems=Q;F.type="array",F.items=ED(J.element,$,{...I,path:[...I.path,"items"]})},sK=(D,$,U,I)=>{let F=U,J=D._zod.def,X=J.shape;if(Object.getOwnPropertySymbols(X).length&&rD(D,$,F,I,"Symbol keys cannot be represented in JSON Schema"))return;F.type="object",F.properties={};for(let W in X)I$(F.properties,W,ED(X[W],$,{...I,path:[...I.path,"properties",W]}));let Y=[];for(let W of Object.keys(X)){let B=J.shape[W];if($.io==="input"?V3(B)===void 0:B._zod.optout===void 0)Y.push(W)}if(Y.length>0)F.required=Y;if(J.catchall?._zod.def.type==="never")F.additionalProperties=!1;else if(!J.catchall){if($.io==="output")F.additionalProperties=!1}else if(J.catchall)F.additionalProperties=ED(J.catchall,$,{...I,path:[...I.path,"additionalProperties"]})},LU=(D,$,U,I)=>{let F=D._zod.def,J=F.inclusive===!1,X=F.options.map((Q,Y)=>ED(Q,$,{...I,path:[...I.path,J?"oneOf":"anyOf",Y]}));if(J)U.oneOf=X;else U.anyOf=X},eK=(D,$,U,I)=>{let F=D._zod.def,J=ED(F.left,$,{...I,path:[...I.path,"allOf",0]}),X=ED(F.right,$,{...I,path:[...I.path,"allOf",1]}),Q=(W)=>("allOf"in W)&&Object.keys(W).length===1,Y=[...Q(J)?J.allOf:[J],...Q(X)?X.allOf:[X]];U.allOf=Y,$.intersections.push(Y)},DG=(D,$,U,I)=>{let F=U,J=D._zod.def;F.type="array";let X=$.target==="draft-2020-12"?"prefixItems":"items",Q=$.target==="draft-2020-12"?"items":$.target==="openapi-3.0"?"items":"additionalItems",Y=J.items.map((z,N)=>ED(z,$,{...I,path:[...I.path,X,N]})),W=J.rest?ED(J.rest,$,{...I,path:[...I.path,Q,...$.target==="openapi-3.0"?[J.items.length]:[]]}):null,B=J.items.length;while(B>0){let z=J.items[B-1];if(!($.io==="input"?V3(z)!==void 0:z._zod.optout==="optional"))break;B--}let K=J.items.length,q=!J.rest;if($.target==="draft-2020-12"){if(F.prefixItems=Y,q)F.items=!1;else if(W)F.items=W;if(B>0)F.minItems=B;if(q)F.maxItems=K}else if($.target==="openapi-3.0"){if(F.items={anyOf:Y},W)F.items.anyOf.push(W);if(B>0)F.minItems=B;if(q)F.maxItems=K}else{if(F.items=Y,q)F.additionalItems=!1;else if(W)F.additionalItems=W;if(B>0)F.minItems=B;if(q)F.maxItems=K}let{minimum:H,maximum:G}=oD(D);if(typeof H==="number")F.minItems=H;if(typeof G==="number")F.maxItems=G},RK,$G=(D,$,U,I)=>{let F=U,J=D._zod.def;F.type="object";let X=J.keyType,Q=oD(X).patterns;if(J.mode==="loose"&&Q&&Q.size>0){let B=ED(J.valueType,$,{...I,path:[...I.path,"patternProperties","*"]});F.patternProperties={};for(let K of Q)I$(F.patternProperties,ZT(K).source,B)}else{if($.target==="draft-07"||$.target==="draft-2020-12"){F.propertyNames=ED(J.keyType,$,{...I,path:[...I.path,"propertyNames"]});let B=RK.get($);if(!B)B=[],RK.set($,B),$.deferred.push(()=>b0D($));B.push(D)}F.additionalProperties=ED(J.valueType,$,{...I,path:[...I.path,"additionalProperties"]})}let Y=X._zod.values,W=$.io==="input"&&V3(J.valueType)!==void 0;if(Y&&!J.partial&&!W){let B=[...Y].filter((K)=>typeof K==="string"||typeof K==="number");if(B.length>0)F.required=B.map(String)}},UG=(D,$,U,I)=>{let F=D._zod.def,J=ED(F.innerType,$,I),X=$.seen.get(D);if($.target==="openapi-3.0")X.ref=F.innerType,U.nullable=!0;else U.anyOf=[J,{type:"null"}]},FG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType},IG,JG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType;let X=MT(F.defaultValue,D,$,U,I);if(X!==IG)U.default=X},XG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);if(J.ref=F.innerType,$.io!=="input")return;let X=MT(F.defaultValue,D,$,U,I);if(X!==IG)U._prefault=X},QG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType;let X;try{X=F.catchValue(void 0)}catch{rD(D,$,U,I,"Dynamic catch values are not supported in JSON Schema");return}U.default=X},YG=(D,$,U,I)=>{let F=D._zod.def,J=F.in._zod.traits.has("$ZodTransform"),X=$.io==="input"?J?F.out:F.in:F.out;ED(X,$,I);let Q=$.seen.get(D);Q.ref=X},WG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType,U.readOnly=!0},BG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType},wU=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType},KG=(D,$,U,I)=>{let F=D._zod.innerType;ED(F,$,I);let J=$.seen.get(D);J.ref=F},zU;var j3=T(()=>{J1();i4();v3();c();R0D={greater_than:(D,$)=>Q2(D,$.inclusive?"minimum":"exclusiveMinimum",$.value),less_than:(D,$)=>Y2(D,$.inclusive?"maximum":"exclusiveMaximum",$.value),multiple_of:(D,$)=>NT(D,$.value),number_format:HT(m8),bigint_format:HT(h8),min_length:GT,max_length:qT,length_equals:(D,$)=>KT(D,$.length),min_size:GT,max_size:qT,size_equals:(D,$)=>KT(D,$.size),string_format:(D,$)=>{if(wT(D,$.format),$.pattern)zT(D,$.pattern);if($.format==="base64"||$.format==="base64url")D.contentEncoding=$.format;if($.local||$.precision===-1)D.laxFormat=!0},mime_type:(D,$)=>LT(D,$.mime)};S0D={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},T0D=new Map([[j7,ZQ],[F3,MQ]]);RK=new WeakMap;IG=Symbol();zU={string:SK,number:TK,boolean:bK,bigint:PK,symbol:CK,null:uK,undefined:kK,void:_K,never:xK,any:gK,unknown:fK,date:yK,enum:mK,literal:hK,nan:nK,template_literal:iK,file:lK,success:dK,custom:cK,function:pK,transform:rK,map:oK,set:tK,array:aK,object:sK,union:LU,intersection:eK,tuple:DG,record:$G,nullable:UG,nonoptional:FG,default:JG,prefault:XG,catch:QG,pipe:YG,readonly:WG,promise:BG,optional:wU,lazy:KG}});class GG{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(D){this.ctx.counter=D}get seen(){return this.ctx.seen}constructor(D){let $=D?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";this.ctx=W6({processors:zU,target:$,...D?.metadata&&{metadata:D.metadata},...D?.unrepresentable&&{unrepresentable:D.unrepresentable},...D?.override&&{override:D.override},...D?.io&&{io:D.io}})}process(D,$={path:[],schemaPath:[]}){return ED(D,this.ctx,$)}emit(D,$){if($){if($.cycles)this.ctx.cycles=$.cycles;if($.reused)this.ctx.reused=$.reused;if($.external)this.ctx.external=$.external}this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,B6(this.ctx,D);let U=K6(this.ctx,D),{"~standard":I,...F}=U;return F}}var OT=T(()=>{j3();v3()});var ET={};var vT=()=>{};var C0={};X$(C0,{withParser:()=>h7,version:()=>IY,validateURL:()=>O7,validateAsync:()=>r8,validate:()=>p8,util:()=>x,urlProtocolOk:()=>v7,urlHostnameOk:()=>E7,treeifyError:()=>sX,toZod:()=>x8,toJSONSchema:()=>ZU,toDotPath:()=>YR,stripTabAndNewline:()=>D3,standardProps:()=>M7,safeParseAsync:()=>Ue,safeParse:()=>$e,safeEncodeAsync:()=>Ge,safeEncode:()=>Be,safeDecodeAsync:()=>qe,safeDecode:()=>Ke,registry:()=>m7,regexes:()=>o$,processSchema:()=>ED,process:()=>ED,prettifyError:()=>eX,parseURLObject:()=>TR,parseAsync:()=>D7,parse:()=>e5,meta:()=>EK,mergeValues:()=>n4,memoizer:()=>B3,locales:()=>N3,isValidJWT:()=>T7,isValidIPv6:()=>$3,isValidIBAN:()=>S7,isValidCreditCard:()=>R7,isValidCIDRv6:()=>V7,isValidBase64URL:()=>A7,isValidBase64:()=>U3,isRecursiveSchema:()=>f7,isBackEdge:()=>y7,initializeContext:()=>W6,handleUnrepresentable:()=>rD,globalRegistry:()=>J$,globalConfig:()=>eD,getDiscriminatedOption:()=>oY,formatError:()=>c8,flattenError:()=>d8,finalize:()=>K6,extractDefs:()=>B6,encodeAsync:()=>Ye,encode:()=>Xe,describe:()=>OK,decodeAsync:()=>We,decode:()=>Qe,createToJSONSchemaMethod:()=>jK,createStandardJSONSchemaMethod:()=>X2,config:()=>nD,compileFn:()=>n7,compile:()=>yB,clone:()=>MD,canParseURL:()=>KY,base64urlCharset:()=>F3,base64Charset:()=>j7,_xor:()=>I0D,_xid:()=>$U,_void:()=>GK,_uuidv7:()=>o7,_uuidv6:()=>r7,_uuidv4:()=>p7,_uuid:()=>c7,_url:()=>L3,_uppercase:()=>o4,_unknown:()=>BK,_union:()=>F0D,_undefined:()=>QK,_ulid:()=>DU,_uint64:()=>JK,_uint32:()=>eB,_tuple:()=>Q0D,_trim:()=>U2,_transform:()=>H0D,_toUpperCase:()=>I2,_toLowerCase:()=>F2,_templateLiteral:()=>v0D,_symbol:()=>XK,_superRefine:()=>MK,_success:()=>Z0D,_stringbool:()=>vK,_stringFormat:()=>H1,_string:()=>hB,_startsWith:()=>a4,_slugify:()=>J2,_size:()=>K1,_set:()=>B0D,_safeParseAsync:()=>y4,_safeParse:()=>f4,_safeEncodeAsync:()=>Q7,_safeEncode:()=>J7,_safeDecodeAsync:()=>Y7,_safeDecode:()=>X7,_regex:()=>p4,_refine:()=>ZK,_record:()=>Y0D,_readonly:()=>E0D,_property:()=>NU,_properties:()=>e4,_promise:()=>j0D,_positive:()=>KU,_pipe:()=>O0D,_parseAsync:()=>g4,_parse:()=>x4,_overwrite:()=>I0,_optional:()=>N0D,_number:()=>pB,_nullable:()=>z0D,_null:()=>YK,_normalize:()=>$2,_nonpositive:()=>qU,_nonoptional:()=>w0D,_nonnegative:()=>HU,_never:()=>KK,_negative:()=>GU,_nativeEnum:()=>G0D,_nanoid:()=>a7,_nan:()=>NK,_multipleOf:()=>Q6,_minSize:()=>L0,_minLength:()=>P0,_min:()=>f$,_mime:()=>D2,_maxSize:()=>Y6,_maxLength:()=>G1,_max:()=>g$,_map:()=>W0D,_mac:()=>iB,_lte:()=>g$,_lt:()=>N0,_lowercase:()=>r4,_literal:()=>q0D,_length:()=>q1,_lazy:()=>V0D,_ksuid:()=>UU,_jwt:()=>BU,_isoTime:()=>M3,_isoDuration:()=>O3,_isoDateTime:()=>w3,_isoDate:()=>Z3,_ipv6:()=>IU,_ipv4:()=>FU,_intersection:()=>X0D,_int64:()=>IK,_int32:()=>sB,_int:()=>oB,_includes:()=>t4,_iban:()=>dB,_guid:()=>d7,_gte:()=>f$,_gt:()=>z0,_float64:()=>aB,_float32:()=>tB,_file:()=>LK,_enum:()=>K0D,_endsWith:()=>s4,_encodeAsync:()=>F7,_encode:()=>$7,_emoji:()=>t7,_email:()=>l7,_e164:()=>WU,_discriminatedUnion:()=>J0D,_default:()=>L0D,_decodeAsync:()=>I7,_decode:()=>U7,_date:()=>qK,_custom:()=>wK,_cuid2:()=>e7,_cuid:()=>s7,_creditCard:()=>lB,_coercedString:()=>nB,_coercedNumber:()=>rB,_coercedDate:()=>HK,_coercedBoolean:()=>$K,_coercedBigint:()=>FK,_cidrv6:()=>XU,_cidrv4:()=>JU,_check:()=>IT,_catch:()=>M0D,_boolean:()=>DK,_bigint:()=>UK,_base64url:()=>YU,_base64:()=>QU,_array:()=>zK,_any:()=>WK,ZodCompileUnsupportedError:()=>ND,ZodCompileAsyncError:()=>H0,URL_UNPARSEABLE:()=>e8,URL_BAD_FORMAT:()=>BY,TimePrecision:()=>cB,NEVER:()=>pX,JSONSchemaGenerator:()=>GG,JSONSchema:()=>ET,INVALID:()=>O$,Doc:()=>h4,$output:()=>uB,$input:()=>kB,$constructor:()=>j,$brand:()=>rX,$ZodXor:()=>rY,$ZodXID:()=>wY,$ZodVoid:()=>lY,$ZodUnknown:()=>nY,$ZodUnion:()=>J3,$ZodUndefined:()=>yY,$ZodUUID:()=>YY,$ZodURL:()=>GY,$ZodULID:()=>LY,$ZodType:()=>XD,$ZodTuple:()=>C7,$ZodTransform:()=>IW,$ZodTemplateLiteral:()=>NW,$ZodSymbol:()=>fY,$ZodSuccess:()=>BW,$ZodStringFormat:()=>OD,$ZodString:()=>X1,$ZodSet:()=>DW,$ZodRegistry:()=>_B,$ZodRecord:()=>sY,$ZodRealError:()=>b$,$ZodReadonly:()=>HW,$ZodPromise:()=>LW,$ZodPreprocess:()=>qW,$ZodPrefault:()=>YW,$ZodPipe:()=>k7,$ZodOptional:()=>u7,$ZodObjectJIT:()=>pY,$ZodObject:()=>CR,$ZodNumberFormat:()=>xY,$ZodNumber:()=>b7,$ZodNullable:()=>XW,$ZodNull:()=>mY,$ZodNonOptional:()=>WW,$ZodNever:()=>iY,$ZodNanoID:()=>HY,$ZodNaN:()=>GW,$ZodMap:()=>eY,$ZodMAC:()=>AY,$ZodLiteral:()=>UW,$ZodLazy:()=>Q3,$ZodKSUID:()=>ZY,$ZodJWT:()=>kY,$ZodIntersection:()=>aY,$ZodISOTime:()=>EY,$ZodISODuration:()=>vY,$ZodISODateTime:()=>MY,$ZodISODate:()=>OY,$ZodIPv6:()=>jY,$ZodIPv4:()=>VY,$ZodIBAN:()=>uY,$ZodGUID:()=>QY,$ZodFunction:()=>zW,$ZodFile:()=>FW,$ZodExactOptional:()=>JW,$ZodError:()=>aX,$ZodEnum:()=>$W,$ZodEncodeError:()=>F1,$ZodEmoji:()=>qY,$ZodEmail:()=>WY,$ZodE164:()=>PY,$ZodDiscriminatedUnion:()=>tY,$ZodDefault:()=>QW,$ZodDate:()=>dY,$ZodCyclicError:()=>OW,$ZodCustomStringFormat:()=>_Y,$ZodCustom:()=>wW,$ZodCreditCard:()=>CY,$ZodCodec:()=>X3,$ZodCheckUpperCase:()=>tQ,$ZodCheckStringFormat:()=>m4,$ZodCheckStartsWith:()=>sQ,$ZodCheckSizeEquals:()=>lQ,$ZodCheckRegex:()=>rQ,$ZodCheckProperty:()=>DY,$ZodCheckProperties:()=>$Y,$ZodCheckOverwrite:()=>FY,$ZodCheckNumberFormat:()=>mQ,$ZodCheckMultipleOf:()=>yQ,$ZodCheckMinSize:()=>iQ,$ZodCheckMinLength:()=>cQ,$ZodCheckMimeType:()=>UY,$ZodCheckMaxSize:()=>nQ,$ZodCheckMaxLength:()=>dQ,$ZodCheckLowerCase:()=>oQ,$ZodCheckLessThan:()=>q7,$ZodCheckLengthEquals:()=>pQ,$ZodCheckIncludes:()=>aQ,$ZodCheckGreaterThan:()=>H7,$ZodCheckEndsWith:()=>eQ,$ZodCheckBigIntFormat:()=>hQ,$ZodCheck:()=>SD,$ZodCatch:()=>KW,$ZodCUID2:()=>zY,$ZodCUID:()=>NY,$ZodCIDRv6:()=>SY,$ZodCIDRv4:()=>RY,$ZodBoolean:()=>I3,$ZodBigIntFormat:()=>gY,$ZodBigInt:()=>P7,$ZodBase64URL:()=>bY,$ZodBase64:()=>TY,$ZodAsyncError:()=>x$,$ZodArray:()=>cY,$ZodAny:()=>hY});var y$=T(()=>{c();c();J1();CB();j3();OT();vT();X6();$Q();DQ();i4();EW();N7();JY();z3();FT();JT();v3()});var MU={};X$(MU,{uppercase:()=>o4,trim:()=>U2,toUpperCase:()=>I2,toLowerCase:()=>F2,startsWith:()=>a4,slugify:()=>J2,size:()=>K1,regex:()=>p4,property:()=>NU,properties:()=>e4,positive:()=>KU,overwrite:()=>I0,normalize:()=>$2,nonpositive:()=>qU,nonnegative:()=>HU,negative:()=>GU,multipleOf:()=>Q6,minSize:()=>L0,minLength:()=>P0,mime:()=>D2,maxSize:()=>Y6,maxLength:()=>G1,lte:()=>g$,lt:()=>N0,lowercase:()=>r4,length:()=>q1,includes:()=>t4,gte:()=>f$,gt:()=>z0,endsWith:()=>s4});var OU=T(()=>{y$()});function EU(D,$,U){Object.defineProperty(D,$,{configurable:!0,enumerable:!1,get(){let I=U(this);return Object.defineProperty(this,$,{value:I,configurable:!0,writable:!0}),I},set(I){Object.defineProperty(this,$,{value:I,configurable:!0,writable:!0})}})}var VT,jT=(D,$)=>{aX.init(D,$),D.name="ZodError";let U=Object.getPrototypeOf(D);if(VT.has(U))return;VT.add(U),EU(U,"format",(I)=>(F)=>c8(I,F)),EU(U,"flatten",(I)=>(F)=>d8(I,F)),EU(U,"addIssue",(I)=>(F)=>{I.issues.push(F),I.message=JSON.stringify(I.issues,C4,2)}),EU(U,"addIssues",(I)=>(F)=>{I.issues.push(...F),I.message=JSON.stringify(I.issues,C4,2)}),Object.defineProperty(U,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})},C0D,P$;var qG=T(()=>{y$();y$();c();VT=new WeakSet([Object.prototype,Error.prototype]);C0D=j("ZodError",jT),P$=j("ZodError",jT,void 0,{Parent:Error})});var HG,NG,zG,LG,wG,ZG,MG,OG,EG,vG,VG,jG;var AG=T(()=>{y$();qG();y$();HG=x4(P$),NG=g4(P$),zG=f4(P$),LG=y4(P$),wG=$7(P$),ZG=U7(P$),MG=F7(P$),OG=I7(P$),EG=J7(P$),vG=X7(P$),VG=Q7(P$),jG=Y7(P$)});var z2={};X$(z2,{xor:()=>Zb,xid:()=>yT,void:()=>qb,uuidv7:()=>PT,uuidv6:()=>bT,uuidv4:()=>TT,uuid:()=>ST,url:()=>CT,unknown:()=>N1,union:()=>N2,undefined:()=>Kb,ulid:()=>fT,uint64:()=>Wb,uint32:()=>Xb,tuple:()=>cG,transform:()=>cU,templateLiteral:()=>ub,symbol:()=>Bb,superRefine:()=>Zq,success:()=>Tb,stringbool:()=>hb,stringFormat:()=>sT,string:()=>A3,strictObject:()=>Lb,set:()=>Vb,refine:()=>wq,record:()=>pG,readonly:()=>Gq,promise:()=>kb,preprocess:()=>ib,prefault:()=>Iq,pipe:()=>VU,partialRecord:()=>Ob,optional:()=>z1,object:()=>zb,number:()=>bG,nullish:()=>Sb,nullable:()=>R3,null:()=>_G,nonoptional:()=>Jq,never:()=>lU,nativeEnum:()=>jb,nanoid:()=>_T,nan:()=>bb,meta:()=>yb,map:()=>vb,mac:()=>nT,looseRecord:()=>Eb,looseObject:()=>wb,literal:()=>Ab,lazy:()=>Nq,ksuid:()=>mT,keyof:()=>Nb,jwt:()=>aT,json:()=>nb,ipv6:()=>iT,ipv4:()=>hT,invertCodec:()=>Cb,intersection:()=>lG,int64:()=>Yb,int32:()=>Jb,int:()=>vU,instanceof:()=>mb,iban:()=>tT,httpUrl:()=>uT,hostname:()=>eT,hex:()=>Db,hash:()=>Ub,guid:()=>RT,function:()=>_b,float64:()=>Ib,float32:()=>Fb,file:()=>Rb,exactOptional:()=>eG,enum:()=>dU,emoji:()=>kT,email:()=>AT,e164:()=>rT,discriminatedUnion:()=>Mb,describe:()=>fb,date:()=>Hb,custom:()=>gb,currencyCode:()=>$b,cuid2:()=>gT,cuid:()=>xT,creditCard:()=>oT,codec:()=>Pb,cidrv6:()=>dT,cidrv4:()=>lT,check:()=>xb,catch:()=>Yq,boolean:()=>PG,bigint:()=>Qb,base64url:()=>pT,base64:()=>cT,array:()=>b3,any:()=>Gb,_function:()=>_b,_default:()=>Uq,_ZodString:()=>jU,ZodXor:()=>hG,ZodXID:()=>uU,ZodVoid:()=>yG,ZodUnknown:()=>gG,ZodUnion:()=>C3,ZodUndefined:()=>uG,ZodUUID:()=>w0,ZodURL:()=>S3,ZodULID:()=>CU,ZodType:()=>WD,ZodTuple:()=>dG,ZodTransform:()=>sG,ZodTemplateLiteral:()=>qq,ZodSymbol:()=>CG,ZodSuccess:()=>Xq,ZodStringFormat:()=>AD,ZodString:()=>K2,ZodSet:()=>oG,ZodRecord:()=>W2,ZodReadonly:()=>Kq,ZodPromise:()=>zq,ZodPreprocess:()=>Bq,ZodPrefault:()=>Fq,ZodPipe:()=>k3,ZodOptional:()=>u3,ZodObject:()=>P3,ZodNumberFormat:()=>Z1,ZodNumber:()=>G2,ZodNullable:()=>Dq,ZodNull:()=>kG,ZodNonOptional:()=>rU,ZodNever:()=>fG,ZodNanoID:()=>TU,ZodNaN:()=>Wq,ZodMap:()=>rG,ZodMAC:()=>RG,ZodLiteral:()=>tG,ZodLazy:()=>Hq,ZodKSUID:()=>kU,ZodJWT:()=>nU,ZodIntersection:()=>iG,ZodInstanceOf:()=>Mq,ZodISOTime:()=>H6,ZodISODuration:()=>N6,ZodISODateTime:()=>G6,ZodISODate:()=>q6,ZodIPv6:()=>xU,ZodIPv4:()=>_U,ZodIBAN:()=>TG,ZodGUID:()=>RU,ZodFunction:()=>Lq,ZodFile:()=>aG,ZodExactOptional:()=>pU,ZodEnum:()=>B2,ZodEmoji:()=>SU,ZodEmail:()=>AU,ZodE164:()=>hU,ZodDiscriminatedUnion:()=>nG,ZodDefault:()=>$q,ZodDate:()=>T3,ZodCustomStringFormat:()=>w1,ZodCustom:()=>x3,ZodCreditCard:()=>SG,ZodCodec:()=>_3,ZodCatch:()=>Qq,ZodCUID2:()=>PU,ZodCUID:()=>bU,ZodCIDRv6:()=>fU,ZodCIDRv4:()=>gU,ZodBoolean:()=>q2,ZodBigIntFormat:()=>iU,ZodBigInt:()=>H2,ZodBase64URL:()=>mU,ZodBase64:()=>yU,ZodArray:()=>mG,ZodAny:()=>xG});function k0D(){if(!eD.localeError)nD(K3())}function L1(){if(!eD.memoizer)nD({memoizer:B3()})}function A3(D){return hB(K2,D)}function AT(D){return l7(AU,D)}function RT(D){return d7(RU,D)}function ST(D){return c7(w0,D)}function TT(D){return p7(w0,D)}function bT(D){return r7(w0,D)}function PT(D){return o7(w0,D)}function CT(D){return L3(S3,D)}function uT(D){return L3(S3,{protocol:o8,hostname:EQ,...x.normalizeParams(D)})}function kT(D){return t7(SU,D)}function _T(D){return a7(TU,D)}function xT(D){return s7(bU,D)}function gT(D){return e7(PU,D)}function fT(D){return DU(CU,D)}function yT(D){return $U(uU,D)}function mT(D){return UU(kU,D)}function hT(D){return FU(_U,D)}function nT(D){return iB(RG,D)}function iT(D){return IU(xU,D)}function lT(D){return JU(gU,D)}function dT(D){return XU(fU,D)}function cT(D){return QU(yU,D)}function pT(D){return YU(mU,D)}function rT(D){return WU(hU,D)}function oT(D){return lB(SG,D)}function tT(D){return dB(TG,D)}function aT(D){return BU(nU,D)}function sT(D,$,U={}){return H1(w1,D,$,U)}function eT(D){return H1(w1,"hostname",OQ,D)}function Db(D){return H1(w1,"hex",xQ,D)}function $b(D){return H1(w1,"currency_code",VQ,D)}function Ub(D,$){let U=$?.enc??"hex",I=`${D}_${U}`,F=o$[I];if(!F)throw Error(`Unrecognized hash format: ${I}`);return H1(w1,I,F,$)}function bG(D){return pB(G2,D)}function vU(D){return oB(Z1,D)}function Fb(D){return tB(Z1,D)}function Ib(D){return aB(Z1,D)}function Jb(D){return sB(Z1,D)}function Xb(D){return eB(Z1,D)}function PG(D){return DK(q2,D)}function Qb(D){return UK(H2,D)}function Yb(D){return IK(iU,D)}function Wb(D){return JK(iU,D)}function Bb(D){return XK(CG,D)}function Kb(D){return QK(uG,D)}function _G(D){return YK(kG,D)}function Gb(){return WK(xG)}function N1(){return BK(gG)}function lU(D){return KK(fG,D)}function qb(D){return GK(yG,D)}function Hb(D){return qK(T3,D)}function b3(D,$){return zK(mG,D,$)}function Nb(D){let $=D._zod.def.shape;return dU(Object.keys($))}function zb(D,$){let U={type:"object",shape:D??{},...x.normalizeParams($)};return new P3(U)}function Lb(D,$){return new P3({type:"object",shape:D,catchall:lU(),...x.normalizeParams($)})}function wb(D,$){return new P3({type:"object",shape:D,catchall:N1(),...x.normalizeParams($)})}function N2(D,$){return new C3({type:"union",options:D,...x.normalizeParams($)})}function Zb(D,$){return new hG({type:"union",options:D,inclusive:!1,...x.normalizeParams($)})}function Mb(D,$,U){return new nG({type:"union",options:$,discriminator:D,...x.normalizeParams(U)})}function lG(D,$){return new iG({type:"intersection",left:D,right:$})}function cG(D,$,U){let I=$ instanceof XD,F=I?U:$;return new dG({type:"tuple",items:D,rest:I?$:null,...x.normalizeParams(F)})}function pG(D,$,U){if(!$||!$._zod)return new W2({type:"record",keyType:A3(),valueType:D,...x.normalizeParams($)});return new W2({type:"record",keyType:D,valueType:$,...x.normalizeParams(U)})}function Ob(D,$,U){return new W2({type:"record",keyType:D,valueType:$,...x.normalizeParams(U),partial:!0})}function Eb(D,$,U){return new W2({type:"record",keyType:D,valueType:$,mode:"loose",...x.normalizeParams(U)})}function vb(D,$,U){return new rG({type:"map",keyType:D,valueType:$,...x.normalizeParams(U)})}function Vb(D,$){return new oG({type:"set",valueType:D,...x.normalizeParams($)})}function dU(D,$){let U=Array.isArray(D)?Object.fromEntries(D.map((I)=>[I,I])):D;return new B2({type:"enum",entries:U,...x.normalizeParams($)})}function jb(D,$){return new B2({type:"enum",entries:D,...x.normalizeParams($)})}function Ab(D,$){return new tG({type:"literal",values:Array.isArray(D)?D:[D],...x.normalizeParams($)})}function Rb(D){return LK(aG,D)}function cU(D){return new sG({type:"transform",transform:D})}function z1(D){return new u3({type:"optional",innerType:D})}function eG(D){return new pU({type:"optional",innerType:D})}function R3(D){return new Dq({type:"nullable",innerType:D})}function Sb(D){return z1(R3(D))}function Uq(D,$){return new $q({type:"default",innerType:D,get defaultValue(){return typeof $==="function"?$():x.shallowClone($)}})}function Iq(D,$){return new Fq({type:"prefault",innerType:D,get defaultValue(){return typeof $==="function"?$():x.shallowClone($)}})}function Jq(D,$){return new rU({type:"nonoptional",innerType:D,...x.normalizeParams($)})}function Tb(D){return new Xq({type:"success",innerType:D})}function Yq(D,$){return new Qq({type:"catch",innerType:D,catchValue:typeof $==="function"?$:x.constantCatch($)})}function bb(D){return NK(Wq,D)}function VU(D,$){return new k3({type:"pipe",in:D,out:$})}function Pb(D,$,U){return new _3({type:"pipe",in:D,out:$,transform:U.decode,reverseTransform:U.encode})}function Cb(D){let $=D._zod.def;return new _3({type:"pipe",in:$.out,out:$.in,transform:$.reverseTransform,reverseTransform:$.transform})}function Gq(D){return new Kq({type:"readonly",innerType:D})}function ub(D,$){return new qq({type:"template_literal",parts:D,...x.normalizeParams($)})}function Nq(D){return new Hq({type:"lazy",getter:D})}function kb(D){return new zq({type:"promise",innerType:D})}function _b(D){return new Lq({type:"function",input:Array.isArray(D?.input)?cG(D?.input):D?.input??b3(N1()),output:D?.output??N1()})}function xb(D){let $=new SD({check:"custom"});return $._zod.check=D,$}function gb(D,$){return wK(x3,D??(()=>!0),$)}function wq(D,$={}){return ZK(x3,D,$)}function Zq(D,$){return MK(D,$)}function mb(D,$={}){let U=new Mq({type:"custom",check:"custom",fn:(I)=>I instanceof D,abort:!0,...x.normalizeParams($)});return U._zod.bag.Class=D,U._zod.check=(I)=>{if(!(I.value instanceof D))I.issues.push({code:"invalid_type",expected:D.name,input:I.value,inst:U,path:[...U._zod.def.path??[]]})},U}function nb(D){let $=Nq(()=>{return N2([A3(D),bG(),PG(),_G(),b3($),pG(A3(),$)])});return $}function ib(D,$){return new Bq({type:"pipe",in:cU(D),out:$})}var WD,jU,K2,AD,G6,q6,H6,N6,AU,RU,w0,S3,SU,TU,bU,PU,CU,uU,kU,_U,RG,xU,gU,fU,yU,mU,hU,SG,TG,nU,w1,G2,Z1,q2,H2,iU,CG,uG,kG,xG,gG,fG,yG,T3,mG,P3,C3,hG,nG,iG,dG,W2,rG,oG,B2,tG,aG,sG,u3,pU,Dq,$q,Fq,rU,Xq,Qq,Wq,k3,_3,Bq,Kq,qq,Hq,zq,Lq,x3,fb,yb,Mq,hb=(...D)=>vK({Codec:_3,Boolean:q2,String:K2},...D);var z6=T(()=>{y$();y$();j3();J1();v3();kW();OU();AG();WD=j("ZodType",(D,$)=>{return k0D(),XD.init(D,$),D.def=$,D.type=$.type,D},{check(...D){let $=this.def;return this.clone(x.mergeDefs($,{checks:[...$.checks??[],...D.map((U)=>typeof U==="function"?{_zod:{check:U,def:{check:"custom"},onattach:[]}}:U)]}),{parent:!0})},with(...D){return this.check(...D)},clone(D,$){return MD(this,D,$)},brand(){return this},register(D,$){return D.add(this,$),this},refine(D,$){return this.check(wq(D,$))},superRefine(D,$){return this.check(Zq(D,$))},overwrite(D){return this.check(I0(D))},optional(){return z1(this)},exactOptional(){return eG(this)},nullable(){return R3(this)},nullish(){return z1(R3(this))},nonoptional(D){return Jq(this,D)},array(){return b3(this)},or(D){return N2([this,D])},and(D){return lG(this,D)},transform(D){return VU(this,cU(D))},default(D){return Uq(this,D)},prefault(D){return Iq(this,D)},catch(D){return Yq(this,D)},pipe(D){return VU(this,D)},readonly(){return Gq(this)},describe(D){let $=this.clone();return J$.add($,{description:D}),$},meta(...D){if(D.length===0)return J$.get(this);let $=this.clone();return J$.add($,D[0]),$},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(D,...$){return $.length===0?D(this):D(this,...$)},get "~standard"(){return x.hide(this,"~standard",{...M7(this),jsonSchema:{input:X2(this,"input"),output:X2(this,"output")}})},set "~standard"(D){x.own(this,"~standard",D)},parse:function D($,U){return HG(this,$,U,{callee:D})},parseAsync:async function D($,U){return await NG(this,$,U,{callee:D})},safeParse(D,$){return zG(this,D,$)},async safeParseAsync(D,$){return LG(this,D,$)},get spa(){return this?.safeParseAsync},set spa(D){x.own(this,"spa",D)},validate(D,$){return p8(this,D,$)},validateAsync(D,$){return r8(this,D,$)},encode:function D($,U){return wG(this,$,U,{callee:D})},decode:function D($,U){return ZG(this,$,U,{callee:D})},encodeAsync:async function D($,U){return await MG(this,$,U,{callee:D})},decodeAsync:async function D($,U){return await OG(this,$,U,{callee:D})},safeEncode(D,$){return EG(this,D,$)},safeDecode(D,$){return vG(this,D,$)},async safeEncodeAsync(D,$){return VG(this,D,$)},async safeDecodeAsync(D,$){return jG(this,D,$)},toJSONSchema(D){return jK(this,{})(D)},get description(){return J$.get(this)?.description},get _def(){return this._zod.def}}),jU=j("_ZodString",(D,$)=>{X1.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>SK(D,U,I,F)},x.derived({format:(D)=>oD(D).format??null,minLength:(D)=>oD(D).minimum??null,maxLength:(D)=>oD(D).maximum??null},{regex(...D){return this.check(p4(...D))},includes(...D){return this.check(t4(...D))},startsWith(...D){return this.check(a4(...D))},endsWith(...D){return this.check(s4(...D))},min(...D){return this.check(P0(...D))},max(...D){return this.check(G1(...D))},length(...D){return this.check(q1(...D))},nonempty(...D){return this.check(P0(1,...D))},lowercase(D){return this.check(r4(D))},uppercase(D){return this.check(o4(D))},trim(){return this.check(U2())},normalize(...D){return this.check($2(...D))},toLowerCase(){return this.check(F2())},toUpperCase(){return this.check(I2())},slugify(){return this.check(J2())}})),K2=j("ZodString",(D,$)=>{X1.init(D,$),jU.init(D,$)},{email(D){return this.check(l7(AU,D))},url(D){return this.check(L3(S3,D))},jwt(D){return this.check(BU(nU,D))},emoji(D){return this.check(t7(SU,D))},guid(D){return this.check(d7(RU,D))},uuid(D){return this.check(c7(w0,D))},uuidv4(D){return this.check(p7(w0,D))},uuidv6(D){return this.check(r7(w0,D))},uuidv7(D){return this.check(o7(w0,D))},nanoid(D){return this.check(a7(TU,D))},cuid(D){return this.check(s7(bU,D))},cuid2(D){return this.check(e7(PU,D))},ulid(D){return this.check(DU(CU,D))},base64(D){return this.check(QU(yU,D))},base64url(D){return this.check(YU(mU,D))},xid(D){return this.check($U(uU,D))},ksuid(D){return this.check(UU(kU,D))},ipv4(D){return this.check(FU(_U,D))},ipv6(D){return this.check(IU(xU,D))},cidrv4(D){return this.check(JU(gU,D))},cidrv6(D){return this.check(XU(fU,D))},e164(D){return this.check(WU(hU,D))},datetime(D){return this.check(w3(G6,D))},date(D){return this.check(Z3(q6,D))},time(D){return this.check(M3(H6,D))},duration(D){return this.check(O3(N6,D))}});AD=j("ZodStringFormat",(D,$)=>{OD.init(D,$),jU.init(D,$)}),G6=j("ZodISODateTime",(D,$)=>{MY.init(D,$),AD.init(D,$)}),q6=j("ZodISODate",(D,$)=>{OY.init(D,$),AD.init(D,$)}),H6=j("ZodISOTime",(D,$)=>{EY.init(D,$),AD.init(D,$)}),N6=j("ZodISODuration",(D,$)=>{vY.init(D,$),AD.init(D,$)}),AU=j("ZodEmail",(D,$)=>{WY.init(D,$),AD.init(D,$)});RU=j("ZodGUID",(D,$)=>{QY.init(D,$),AD.init(D,$)});w0=j("ZodUUID",(D,$)=>{YY.init(D,$),AD.init(D,$)});S3=j("ZodURL",(D,$)=>{GY.init(D,$),AD.init(D,$)});SU=j("ZodEmoji",(D,$)=>{qY.init(D,$),AD.init(D,$)});TU=j("ZodNanoID",(D,$)=>{HY.init(D,$),AD.init(D,$)});bU=j("ZodCUID",(D,$)=>{NY.init(D,$),AD.init(D,$)});PU=j("ZodCUID2",(D,$)=>{zY.init(D,$),AD.init(D,$)});CU=j("ZodULID",(D,$)=>{LY.init(D,$),AD.init(D,$)});uU=j("ZodXID",(D,$)=>{wY.init(D,$),AD.init(D,$)});kU=j("ZodKSUID",(D,$)=>{ZY.init(D,$),AD.init(D,$)});_U=j("ZodIPv4",(D,$)=>{VY.init(D,$),AD.init(D,$)});RG=j("ZodMAC",(D,$)=>{AY.init(D,$),AD.init(D,$)});xU=j("ZodIPv6",(D,$)=>{jY.init(D,$),AD.init(D,$)});gU=j("ZodCIDRv4",(D,$)=>{RY.init(D,$),AD.init(D,$)});fU=j("ZodCIDRv6",(D,$)=>{SY.init(D,$),AD.init(D,$)});yU=j("ZodBase64",(D,$)=>{TY.init(D,$),AD.init(D,$)});mU=j("ZodBase64URL",(D,$)=>{bY.init(D,$),AD.init(D,$)});hU=j("ZodE164",(D,$)=>{PY.init(D,$),AD.init(D,$)});SG=j("ZodCreditCard",(D,$)=>{CY.init(D,$),AD.init(D,$)});TG=j("ZodIBAN",(D,$)=>{uY.init(D,$),AD.init(D,$)});nU=j("ZodJWT",(D,$)=>{kY.init(D,$),AD.init(D,$)});w1=j("ZodCustomStringFormat",(D,$)=>{_Y.init(D,$),AD.init(D,$)});G2=j("ZodNumber",(D,$)=>{b7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>TK(D,U,I,F),D.isFinite=!0},x.derived({minValue:(D)=>{let{minimum:$,exclusiveMinimum:U}=oD(D);return Math.max($??Number.NEGATIVE_INFINITY,U??Number.NEGATIVE_INFINITY)},maxValue:(D)=>{let{maximum:$,exclusiveMaximum:U}=oD(D);return Math.min($??Number.POSITIVE_INFINITY,U??Number.POSITIVE_INFINITY)},isInt:(D)=>{let{isInt:$,multipleOf:U}=oD(D);return!!$||!!U?.some(Number.isSafeInteger)},format:(D)=>oD(D).format??null},{gt(D,$){return this.check(z0(D,$))},gte(D,$){return this.check(f$(D,$))},min(D,$){return this.check(f$(D,$))},lt(D,$){return this.check(N0(D,$))},lte(D,$){return this.check(g$(D,$))},max(D,$){return this.check(g$(D,$))},int(D){return this.check(vU(D))},safe(D){return this.check(vU(D))},positive(D){return this.check(z0(0,D))},nonnegative(D){return this.check(f$(0,D))},negative(D){return this.check(N0(0,D))},nonpositive(D){return this.check(g$(0,D))},multipleOf(D,$){return this.check(Q6(D,$))},step(D,$){return this.check(Q6(D,$))},finite(){return this}}));Z1=j("ZodNumberFormat",(D,$)=>{xY.init(D,$),G2.init(D,$)});q2=j("ZodBoolean",(D,$)=>{I3.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>bK(D,U,I,F)});H2=j("ZodBigInt",(D,$)=>{P7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>PK(D,U,I,F)},x.derived({minValue:(D)=>oD(D).minimum??null,maxValue:(D)=>oD(D).maximum??null,format:(D)=>oD(D).format??null},{gte(D,$){return this.check(f$(D,$))},min(D,$){return this.check(f$(D,$))},gt(D,$){return this.check(z0(D,$))},lt(D,$){return this.check(N0(D,$))},lte(D,$){return this.check(g$(D,$))},max(D,$){return this.check(g$(D,$))},positive(D){return this.check(z0(BigInt(0),D))},negative(D){return this.check(N0(BigInt(0),D))},nonpositive(D){return this.check(g$(BigInt(0),D))},nonnegative(D){return this.check(f$(BigInt(0),D))},multipleOf(D,$){return this.check(Q6(D,$))}}));iU=j("ZodBigIntFormat",(D,$)=>{gY.init(D,$),H2.init(D,$)});CG=j("ZodSymbol",(D,$)=>{fY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>CK(D,U,I,F)});uG=j("ZodUndefined",(D,$)=>{yY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>kK(D,U,I,F)});kG=j("ZodNull",(D,$)=>{mY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>uK(D,U,I,F)});xG=j("ZodAny",(D,$)=>{hY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>gK(D,U,I,F)});gG=j("ZodUnknown",(D,$)=>{nY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>fK(D,U,I,F)});fG=j("ZodNever",(D,$)=>{iY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>xK(D,U,I,F)});yG=j("ZodVoid",(D,$)=>{lY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>_K(D,U,I,F)});T3=j("ZodDate",(D,$)=>{dY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>yK(D,U,I,F),D.min=(U,I)=>D.check(f$(U,I)),D.max=(U,I)=>D.check(g$(U,I))},x.derived({minDate:(D)=>{let{minimum:$}=oD(D);return $?new Date($):null},maxDate:(D)=>{let{maximum:$}=oD(D);return $?new Date($):null}},{}));mG=j("ZodArray",(D,$)=>{L1(),cY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>aK(D,U,I,F),D.element=$.element},{min(D,$){return this.check(P0(D,$))},nonempty(D){return this.check(P0(1,D))},max(D,$){return this.check(G1(D,$))},length(D,$){return this.check(q1(D,$))},unwrap(){return this.element}});P3=j("ZodObject",(D,$)=>{L1(),pY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>sK(D,U,I,F),x.installLazyProp(D,"shape",(U)=>U._zod.def.shape,!1)},{keyof(){return dU(Object.keys(this._zod.def.shape))},catchall(D){return this.clone(x.mergeDefs(this._zod.def,{catchall:D}))},passthrough(){return this.clone(x.mergeDefs(this._zod.def,{catchall:N1()}))},loose(){return this.clone(x.mergeDefs(this._zod.def,{catchall:N1()}))},strict(){return this.clone(x.mergeDefs(this._zod.def,{catchall:lU()}))},strip(){return this.clone(x.mergeDefs(this._zod.def,{catchall:void 0}))},extend(D){return x.extend(this,D)},safeExtend(D){return x.safeExtend(this,D)},merge(D){return x.merge(this,D)},pick(D){return x.pick(this,D)},omit(D){return x.omit(this,D)},partial(...D){return x.partial(u3,this,D[0])},exactPartial(...D){return x.partial(pU,this,D[0],"exactPartial")},required(...D){return x.required(rU,this,D[0])}});C3=j("ZodUnion",(D,$)=>{J3.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>LU(D,U,I,F),D.options=$.options});hG=j("ZodXor",(D,$)=>{C3.init(D,$),rY.init(D,$),D._zod.processJSONSchema=(U,I,F)=>LU(D,U,I,F),D.options=$.options});nG=j("ZodDiscriminatedUnion",(D,$)=>{C3.init(D,$),tY.init(D,$)});iG=j("ZodIntersection",(D,$)=>{aY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>eK(D,U,I,F)});dG=j("ZodTuple",(D,$)=>{L1(),C7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>DG(D,U,I,F)},{rest(D){return this.clone({...this._zod.def,rest:D})},partial(){let D=this._zod.def;if(D.checks?.length)throw Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...D,items:D.items.map(($)=>new u3({type:"optional",innerType:$}))})}});W2=j("ZodRecord",(D,$)=>{L1(),sY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>$G(D,U,I,F),D.keyType=$.keyType,D.valueType=$.valueType});rG=j("ZodMap",(D,$)=>{L1(),eY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>oK(D,U,I,F),D.keyType=$.keyType,D.valueType=$.valueType,D.min=(...U)=>D.check(L0(...U)),D.nonempty=(U)=>D.check(L0(1,U)),D.max=(...U)=>D.check(Y6(...U)),D.size=(...U)=>D.check(K1(...U))});oG=j("ZodSet",(D,$)=>{L1(),DW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>tK(D,U,I,F),D.min=(...U)=>D.check(L0(...U)),D.nonempty=(U)=>D.check(L0(1,U)),D.max=(...U)=>D.check(Y6(...U)),D.size=(...U)=>D.check(K1(...U))});B2=j("ZodEnum",(D,$)=>{$W.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(I,F,J)=>mK(D,I,F,J),D.enum=$.entries,D.options=[...D._zod.values];let U=new Set(Object.keys($.entries));D.extract=(I,F)=>{let J={};for(let X of I)if(U.has(X))J[X]=$.entries[X];else throw Error(`Key ${X} not found in enum`);return new B2({...$,checks:[],...x.normalizeParams(F),entries:J})},D.exclude=(I,F)=>{let J={...$.entries};for(let X of I)if(U.has(X))delete J[X];else throw Error(`Key ${X} not found in enum`);return new B2({...$,checks:[],...x.normalizeParams(F),entries:J})}});tG=j("ZodLiteral",(D,$)=>{UW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>hK(D,U,I,F),D.values=new Set($.values),Object.defineProperty(D,"value",{get(){if($.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return $.values[0]}})});aG=j("ZodFile",(D,$)=>{FW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>lK(D,U,I,F),D.min=(U,I)=>D.check(L0(U,I)),D.max=(U,I)=>D.check(Y6(U,I)),D.mime=(U,I)=>D.check(D2(Array.isArray(U)?U:[U],I))});sG=j("ZodTransform",(D,$)=>{L1(),IW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>rK(D,U,I,F),D._zod.parse=(U,I)=>{if(I.direction==="backward")throw new F1(D.constructor.name);U.addIssue=(J)=>{if(typeof J==="string")U.issues.push(x.issue(J,U.value,$));else{let X=J;if(X.fatal)X.continue=!1;if(X.code??(X.code="custom"),!("input"in X))X.input=U.value;X.inst??(X.inst=D),U.issues.push(x.issue(X))}};let F=$.transform(U.value,U);if(F instanceof Promise)return F.then((J)=>{return U.value=J,U});return U.value=F,U}});u3=j("ZodOptional",(D,$)=>{u7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>wU(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});pU=j("ZodExactOptional",(D,$)=>{JW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>wU(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Dq=j("ZodNullable",(D,$)=>{XW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>UG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});$q=j("ZodDefault",(D,$)=>{QW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>JG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType,D.removeDefault=D.unwrap});Fq=j("ZodPrefault",(D,$)=>{YW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>XG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});rU=j("ZodNonOptional",(D,$)=>{WW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>FG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Xq=j("ZodSuccess",(D,$)=>{BW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>dK(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Qq=j("ZodCatch",(D,$)=>{KW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>QG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType,D.removeCatch=D.unwrap});Wq=j("ZodNaN",(D,$)=>{GW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>nK(D,U,I,F)});k3=j("ZodPipe",(D,$)=>{k7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>YG(D,U,I,F),D.in=$.in,D.out=$.out});_3=j("ZodCodec",(D,$)=>{k3.init(D,$),X3.init(D,$)});Bq=j("ZodPreprocess",(D,$)=>{k3.init(D,$),qW.init(D,$)}),Kq=j("ZodReadonly",(D,$)=>{HW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>WG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});qq=j("ZodTemplateLiteral",(D,$)=>{NW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>iK(D,U,I,F)});Hq=j("ZodLazy",(D,$)=>{Q3.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>KG(D,U,I,F),D.unwrap=()=>D._zod.def.getter()});zq=j("ZodPromise",(D,$)=>{LW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>BG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Lq=j("ZodFunction",(D,$)=>{zW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>pK(D,U,I,F)});x3=j("ZodCustom",(D,$)=>{wW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>cK(D,U,I,F)});fb=OK,yb=EK,Mq=j("ZodInstanceOf",(D,$)=>{x3.init(D,$)},{properties(D,$){return this.check(e4(D,$))}})});function x0D(D){nD({customError:D})}function g0D(){return nD().customError}var _0D,Oq;var lb=T(()=>{y$();_0D={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(D){})(Oq||(Oq={}))});var g3={};X$(g3,{time:()=>m0D,duration:()=>h0D,datetime:()=>f0D,date:()=>y0D,ZodISOTime:()=>H6,ZodISODuration:()=>N6,ZodISODateTime:()=>G6,ZodISODate:()=>q6});function f0D(D){return w3(G6,D)}function y0D(D){return Z3(q6,D)}function m0D(D){return M3(H6,D)}function h0D(D){return O3(N6,D)}var oU=T(()=>{y$();z6();z6()});function i0D(D,$){let U=D.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return $??"draft-2020-12"}function db(D,$){return D.map((U,I)=>I<$?U:U.optional())}function l0D(D){return D.replace(/~1/g,"/").replace(/~0/g,"~")}function d0D(D,$){if(!D.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=D.slice(1).split("/").filter(Boolean);if(U.length===0)return $.rootSchema;let I=$.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===I){let F=U[1]===void 0?void 0:l0D(U[1]);if(!F||!$.defs[F])throw Error(`Reference not found: ${D}`);return $.defs[F]}throw Error(`Reference not found: ${D}`)}function c0D(D,$){return r.transform((I)=>I).check((I)=>{let F=I.value;if(typeof F!=="object"||F===null||Array.isArray(F))return;let J=Object.getOwnPropertyNames(F);if($.minProperties!==void 0&&J.length<$.minProperties)I.issues.push({origin:"object",code:"too_small",minimum:$.minProperties,inclusive:!0,message:`Too small: expected object to have >=${$.minProperties} properties`,input:F,inst:D,continue:!0});if($.maxProperties!==void 0&&J.length>$.maxProperties)I.issues.push({origin:"object",code:"too_big",maximum:$.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${$.maxProperties} properties`,input:F,inst:D,continue:!0});if($.keySchema)for(let X of J){let Q=$.keySchema.safeParse(X);if(Q.success)continue;I.issues.push({code:"invalid_key",origin:"record",issues:Q.error.issues,input:X,path:[X],continue:!0})}}).pipe(D)}function Eq(D,$){if(D===null)return"z";let U=typeof D;if(U!=="object"){if(U==="number"&&Number.isNaN(D))return null;let I=String(D);return`${U[0]}${I.length}:${I}`}if($.has(D))return null;$.add(D);try{if(Array.isArray(D)){let J=[];for(let X of D){let Q=Eq(X,$);if(Q===null)return null;J.push(Q)}return`a${J.length}:[${J.join(",")}]`}let I=Object.keys(D).sort(),F=[];for(let J of I){let X=Eq(D[J],$);if(X===null)return null;F.push(`${J.length}:${J}=${X}`)}return`o${F.length}:{${F.join(",")}}`}finally{$.delete(D)}}function f3(D){if(typeof D!=="object"||D===null)return!1;if(Array.isArray(D))return D.some(f3);if(typeof D.$ref==="string")return!0;return Object.entries(D).some(([$,U])=>{if(p0D.has($))return f3(U);if(!r0D.has($)||typeof U!=="object"||U===null)return!1;return Object.values(U).some(f3)})}function cb(D){return D===1?"element":"elements"}function o0D(D,$){return r.transform((I)=>I).check((I)=>{let F=I.value;if(!Array.isArray(F))return;if($.uniqueItems===!0){let J=new Map;for(let X=0;X<F.length;X++){let Q=Eq(F[X],new Set);if(Q===null)continue;let Y=J.get(Q);if(Y===void 0){J.set(Q,X);continue}I.issues.push({code:"custom",message:`Array items must be unique: element at index ${X} duplicates the one at index ${Y}`,input:F,path:[X],continue:!0})}}if($.containsSchema){let J=$.minContains??1,X=$.maxContains!==void 0?$.maxContains+1:Number.POSITIVE_INFINITY,Q=0;for(let Y of F)if($.containsSchema.safeParse(Y).success&&++Q>=X)break;if(Q<J)I.issues.push({code:"custom",message:`Array must contain at least ${J} matching ${cb(J)}; found ${Q}`,input:F,continue:!0});if($.maxContains!==void 0&&Q>$.maxContains)I.issues.push({code:"custom",message:`Array must contain at most ${$.maxContains} matching ${cb($.maxContains)}`,input:F,continue:!0})}}).pipe(D)}function pb(D,$){if(D===!1)return;if(D===void 0||D===!0)return r.any();return v$(D,$)}function rb(D,$){if(D.not!==void 0){if(typeof D.not==="object"&&Object.keys(D.not).length===0)return r.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(D.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(D.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(D.if!==void 0||D.then!==void 0||D.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(D.dependentSchemas!==void 0||D.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(D.$ref){let F=D.$ref;if($.refs.has(F))return $.refs.get(F);if($.processing.has(F))return r.lazy(()=>{if(!$.refs.has(F))throw Error(`Circular reference not resolved: ${F}`);return $.refs.get(F)});$.processing.add(F);let J=d0D(F,$),X=v$(J,$);return $.refs.set(F,X),$.processing.delete(F),X}if(D.enum!==void 0){let F=D.enum;if($.version==="openapi-3.0"&&D.nullable===!0&&F.length===1&&F[0]===null)return r.null();if(F.length===0)return r.never();if(F.length===1)return r.literal(F[0]);if(F.every((X)=>typeof X==="string"))return r.enum(F);let J=F.map((X)=>r.literal(X));if(J.length<2)return J[0];return r.union([J[0],J[1],...J.slice(2)])}if(D.const!==void 0)return r.literal(D.const);let U=D.type;if(Array.isArray(U)){let F=U.map((J)=>{let X={...D,type:J};return rb(X,$)});if(F.length===0)return r.never();if(F.length===1)return F[0];return r.union(F)}if(!U)return r.any();let I;switch(U){case"string":{let F=r.string();if(D.format){let J=D.format;if(J==="email")F=F.check(r.email());else if(J==="uri"||J==="uri-reference")F=F.check(r.url());else if(J==="uuid"||J==="guid")F=F.check(r.uuid());else if(J==="date-time")F=F.check(r.iso.datetime({offset:!0}));else if(J==="date")F=F.check(r.iso.date());else if(J==="time")F=F.check(r.regex(t0D));else if(J==="duration")F=F.check(r.iso.duration());else if(J==="hostname")F=F.check(r.hostname());else if(J==="ipv4")F=F.check(r.ipv4());else if(J==="ipv6")F=F.check(r.ipv6());else if(J==="mac")F=F.check(r.mac());else if(J==="cidr")F=F.check(r.cidrv4());else if(J==="cidr-v6")F=F.check(r.cidrv6());else if(J==="base64")F=F.check(r.base64());else if(J==="base64url")F=F.check(r.base64url());else if(J==="e164")F=F.check(r.e164());else if(J==="credit_card")F=F.check(r.creditCard());else if(J==="iban")F=F.check(r.iban());else if(J==="jwt")F=F.check(r.jwt());else if(J==="emoji")F=F.check(r.emoji());else if(J==="nanoid")F=F.check(r.nanoid());else if(J==="cuid")F=F.check(r.cuid());else if(J==="cuid2")F=F.check(r.cuid2());else if(J==="ulid")F=F.check(r.ulid());else if(J==="xid")F=F.check(r.xid());else if(J==="ksuid")F=F.check(r.ksuid())}if(typeof D.minLength==="number")F=F.min(D.minLength);if(typeof D.maxLength==="number")F=F.max(D.maxLength);if(D.pattern)F=F.regex(new RegExp(D.pattern));I=F;break}case"number":case"integer":{let F=U==="integer"?r.number().int():r.number();if(typeof D.minimum==="number"&&D.exclusiveMinimum!==!0)F=F.min(D.minimum);if(typeof D.maximum==="number"&&D.exclusiveMaximum!==!0)F=F.max(D.maximum);if(typeof D.exclusiveMinimum==="number")F=F.gt(D.exclusiveMinimum);else if(D.exclusiveMinimum===!0&&typeof D.minimum==="number")F=F.gt(D.minimum);if(typeof D.exclusiveMaximum==="number")F=F.lt(D.exclusiveMaximum);else if(D.exclusiveMaximum===!0&&typeof D.maximum==="number")F=F.lt(D.maximum);if(typeof D.multipleOf==="number")F=F.multipleOf(D.multipleOf);I=F;break}case"boolean":{I=r.boolean();break}case"null":{I=r.null();break}case"object":{let F={},J=D.properties||{},X=new Set(D.required||[]),Q=typeof D.additionalProperties==="object"?v$(D.additionalProperties,$):void 0;for(let[K,q]of Object.entries(J)){let H=v$(q,$);I$(F,K,X.has(K)?H:H.optional())}if(D.patternProperties){let K=D.patternProperties,q=Object.keys(K),H=[];for(let z of q){let N=v$(K[z],$),M=r.string().regex(new RegExp(z));H.push(r.looseRecord(M,N))}let G=[];if(Object.keys(F).length>0)G.push(r.object(F).passthrough());if(G.push(...H),G.length===0)I=r.object({}).passthrough();else if(G.length===1)I=G[0];else{let z=r.intersection(G[0],G[1]);for(let N=2;N<G.length;N++)z=r.intersection(z,G[N]);I=z}if(D.additionalProperties===!1){let z=Object.keys(F),N=q.map((Z)=>new RegExp(Z)),M=I;I=I.check((Z)=>{if(!p$(Z.value))return;let L=[];for(let v of Object.keys(Z.value)){if(z.includes(v))continue;if(N.some((A)=>A.test(v)))continue;L.push(v)}if(L.length)Z.issues.push({code:"unrecognized_keys",keys:L,input:Z.value,inst:M})})}}else{let K=r.object(F);if(D.additionalProperties===!1)I=K.strict();else if(Q)I=K.catchall(Q);else I=K.passthrough()}let Y=D.propertyNames!==void 0&&D.propertyNames!==!0,W=typeof D.minProperties==="number"?D.minProperties:void 0,B=typeof D.maxProperties==="number"?D.maxProperties:void 0;if(Y||W!==void 0||B!==void 0){let K;if(Y){let q=typeof D.propertyNames==="object"&&D.propertyNames.type===void 0?{type:"string",...D.propertyNames}:D.propertyNames;K=v$(q,$)}I=c0D(I,{keySchema:K,minProperties:W,maxProperties:B})}break}case"array":{let{prefixItems:F,items:J}=D;if(F&&Array.isArray(F)){let X=typeof D.minItems==="number"?D.minItems:0,Q=F.map((K)=>v$(K,$)),Y=db(Q,X),W=!Array.isArray(J)?pb(J,$):void 0,B=r.tuple(Y);if(I=W?B.rest(W):B,typeof D.minItems==="number")I=I.check(r.minLength(D.minItems));if(typeof D.maxItems==="number")I=I.check(r.maxLength(D.maxItems))}else if(Array.isArray(J)){let X=typeof D.minItems==="number"?D.minItems:0,Q=J.map((K)=>v$(K,$)),Y=db(Q,X),W=pb(D.additionalItems,$),B=r.tuple(Y);if(I=W?B.rest(W):B,typeof D.minItems==="number")I=I.check(r.minLength(D.minItems));if(typeof D.maxItems==="number")I=I.check(r.maxLength(D.maxItems))}else if(J!==void 0){let X=v$(J,$),Q=r.array(X);if(typeof D.minItems==="number")Q=Q.min(D.minItems);if(typeof D.maxItems==="number")Q=Q.max(D.maxItems);I=Q}else I=r.array(r.any());if(D.uniqueItems===!0||D.contains!==void 0)I=o0D(I,{uniqueItems:D.uniqueItems===!0,containsSchema:D.contains!==void 0?v$(D.contains,$):void 0,minContains:typeof D.minContains==="number"?D.minContains:void 0,maxContains:typeof D.maxContains==="number"?D.maxContains:void 0});break}default:throw Error(`Unsupported type: ${U}`)}return I}function v$(D,$){if(typeof D==="boolean")return D?r.any():r.never();let U=rb(D,$),I=D.type||D.enum!==void 0||D.const!==void 0;if(D.anyOf&&Array.isArray(D.anyOf)){let Q=D.anyOf.map((W)=>v$(W,$)),Y=r.union(Q);U=I?r.intersection(U,Y):Y}if(D.oneOf&&Array.isArray(D.oneOf)){let Q=D.oneOf.map((W)=>v$(W,$)),Y=r.xor(Q);U=I?r.intersection(U,Y):Y}if(D.allOf&&Array.isArray(D.allOf))if(D.allOf.length===0)U=I?U:r.any();else{let Q=I?U:v$(D.allOf[0],$),Y=I?0:1;for(let W=Y;W<D.allOf.length;W++)Q=r.intersection(Q,v$(D.allOf[W],$));U=Q}if(D.nullable===!0&&$.version==="openapi-3.0")U=r.nullable(U);if(D.readOnly===!0)U=r.readonly(U);if(D.default!==void 0)U=U.default(D.default);let F={},J=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let Q of J)if(Q in D)F[Q]=D[Q];let X=["contentEncoding","contentMediaType","contentSchema"];for(let Q of X)if(Q in D)F[Q]=D[Q];if(D.type==="object"&&D.$ref===void 0){if(D.propertyNames!==void 0&&!f3(D.propertyNames))F.propertyNames=D.propertyNames;for(let Q of["minProperties","maxProperties"])if(D[Q]!==void 0)F[Q]=D[Q]}if(D.type==="array"&&D.$ref===void 0){if(D.contains!==void 0&&!f3(D.contains))F.contains=D.contains;for(let Q of["uniqueItems","minContains","maxContains"])if(D[Q]!==void 0)F[Q]=D[Q]}for(let Q of Object.keys(D))if(!n0D.has(Q))I$(F,Q,D[Q]);if(Object.keys(F).length>0)$.registry.add(U,F);if(D.description)U=U.describe(D.description);return U}function ob(D,$){if(typeof D==="boolean")return D?r.any():r.never();let U;try{U=JSON.parse(JSON.stringify(D))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let I=i0D(U,$?.defaultTarget),F=U.$defs||U.definitions||{},J={version:I,defs:F,refs:new Map,processing:new Set,rootSchema:U,registry:$?.registry??J$};return v$(U,J)}var r,n0D,p0D,r0D,t0D;var tb=T(()=>{z3();c();OU();oU();z6();r={...z2,...MU,iso:g3},n0D=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);p0D=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),r0D=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);t0D=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function y3(D,$){let U=typeof $==="function"?$:(X,Q)=>{let Y=$[X._zod.def.type];return Y?Y(X,Q):X},I=new Map;function F(X){let Q=I.get(X);if(Q===ab)return new Q3({type:"lazy",getter:()=>I.get(X)});if(Q!==void 0)return Q;I.set(X,ab);let Y=J(X),W=U(Y,Y!==X);return I.set(X,W),W}function J(X){let Q=X._zod.def,Y=Q.type;switch(Y){case"object":{let W=Q.shape,B=Object.keys(W),K=!1,q={};for(let G of B){let z=F(W[G]);if(z!==W[G])K=!0;q[G]=z}let H=Q.catchall;if(Q.catchall){if(H=F(Q.catchall),H!==Q.catchall)K=!0}return K?MD(X,{...Q,shape:q,catchall:H}):X}case"array":{let W=F(Q.element);return W===Q.element?X:MD(X,{...Q,element:W})}case"tuple":{let W=Q.items,B=!1,K=[];for(let H of W){let G=F(H);if(G!==H)B=!0;K.push(G)}let q=Q.rest;if(Q.rest){if(q=F(Q.rest),q!==Q.rest)B=!0}return B?MD(X,{...Q,items:K,rest:q}):X}case"record":case"map":{let W=F(Q.keyType),B=F(Q.valueType);return W===Q.keyType&&B===Q.valueType?X:MD(X,{...Q,keyType:W,valueType:B})}case"set":{let W=F(Q.valueType);return W===Q.valueType?X:MD(X,{...Q,valueType:W})}case"union":{let W=Q.options,B=!1,K=[];for(let q of W){let H=F(q);if(H!==q)B=!0;K.push(H)}return B?MD(X,{...Q,options:K}):X}case"intersection":{let W=F(Q.left),B=F(Q.right);return W===Q.left&&B===Q.right?X:MD(X,{...Q,left:W,right:B})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let W=F(Q.innerType);return W===Q.innerType?X:MD(X,{...Q,innerType:W})}case"pipe":{let W=F(Q.in),B=F(Q.out);return W===Q.in&&B===Q.out?X:MD(X,{...Q,in:W,out:B})}case"function":{let W=F(Q.input),B=F(Q.output);return W===Q.input&&B===Q.output?X:MD(X,{...Q,input:W,output:B})}case"lazy":{let W=Q.getter,{_cachedInner:B,...K}=Q;return MD(X,{...K,getter:()=>F(W())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return X;default:return X}}return F(D)}var ab;var vq=T(()=>{i4();c();ab=Symbol("z.visit/resolving")});function sb(D){return y3(D,{object:($)=>$.partial(),union:($)=>{let U=$._zod.def;return U.discriminator===void 0?$:N2(U.options)}})}var eb=T(()=>{vq();z6()});function a0D(D,$){if(!$?.length)return D;let U=D._zod.def;return MD(D,F0(U,{checks:[...U.checks??[],...$]}),{parent:!0})}function DP(D){return a0D(D.out,D.checks)}function s0D(D){return D.in._zod.traits.has("$ZodTransform")?DP(D):D.in}function $P(D){return y3(D,{pipe:($)=>s0D($._zod.def),default:($,U)=>U?z1($._zod.def.innerType):$,catch:($,U)=>U?$._zod.def.innerType:$})}function UP(D){return y3(D,{pipe:($)=>DP($._zod.def),prefault:($,U)=>U?$._zod.def.innerType:$})}var FP=T(()=>{c();vq();z6()});var Vq={};X$(Vq,{string:()=>e0D,number:()=>D6D,date:()=>F6D,boolean:()=>$6D,bigint:()=>U6D});function e0D(D){return nB(K2,D)}function D6D(D){return rB(G2,D)}function $6D(D){return $K(q2,D)}function U6D(D){return FK(H2,D)}function F6D(D){return HK(T3,D)}var IP=T(()=>{y$();z6()});var zD={};X$(zD,{xor:()=>Zb,xid:()=>yT,withParser:()=>h7,void:()=>qb,validateAsync:()=>r8,validate:()=>p8,uuidv7:()=>PT,uuidv6:()=>bT,uuidv4:()=>TT,uuid:()=>ST,util:()=>x,url:()=>CT,uppercase:()=>o4,unknown:()=>N1,union:()=>N2,undefined:()=>Kb,ulid:()=>fT,uint64:()=>Wb,uint32:()=>Xb,tuple:()=>cG,trim:()=>U2,treeifyError:()=>sX,transform:()=>cU,toZod:()=>x8,toUpperCase:()=>I2,toLowerCase:()=>F2,toJSONSchema:()=>ZU,templateLiteral:()=>ub,symbol:()=>Bb,superRefine:()=>Zq,success:()=>Tb,stringbool:()=>hb,stringFormat:()=>sT,string:()=>A3,strictObject:()=>Lb,startsWith:()=>a4,slugify:()=>J2,size:()=>K1,setErrorMap:()=>x0D,set:()=>Vb,safeParseAsync:()=>LG,safeParse:()=>zG,safeEncodeAsync:()=>VG,safeEncode:()=>EG,safeDecodeAsync:()=>jG,safeDecode:()=>vG,registry:()=>m7,regexes:()=>o$,regex:()=>p4,refine:()=>wq,record:()=>pG,readonly:()=>Gq,property:()=>NU,properties:()=>e4,promise:()=>kb,prettifyError:()=>eX,preprocess:()=>ib,prefault:()=>Iq,positive:()=>KU,pipe:()=>VU,partialRecord:()=>Ob,parseAsync:()=>NG,parse:()=>HG,overwrite:()=>I0,output:()=>UP,optional:()=>z1,object:()=>zb,number:()=>bG,nullish:()=>Sb,nullable:()=>R3,null:()=>_G,normalize:()=>$2,nonpositive:()=>qU,nonoptional:()=>Jq,nonnegative:()=>HU,never:()=>lU,negative:()=>GU,nativeEnum:()=>jb,nanoid:()=>_T,nan:()=>bb,multipleOf:()=>Q6,minSize:()=>L0,minLength:()=>P0,mime:()=>D2,meta:()=>yb,memoizer:()=>B3,maxSize:()=>Y6,maxLength:()=>G1,map:()=>vb,mac:()=>nT,lte:()=>g$,lt:()=>N0,lowercase:()=>r4,looseRecord:()=>Eb,looseObject:()=>wb,locales:()=>N3,literal:()=>Ab,length:()=>q1,lazy:()=>Nq,ksuid:()=>mT,keyof:()=>Nb,jwt:()=>aT,json:()=>nb,iso:()=>g3,ipv6:()=>iT,ipv4:()=>hT,invertCodec:()=>Cb,intersection:()=>lG,int64:()=>Yb,int32:()=>Jb,int:()=>vU,instanceof:()=>mb,input:()=>$P,includes:()=>t4,iban:()=>tT,httpUrl:()=>uT,hostname:()=>eT,hex:()=>Db,hash:()=>Ub,guid:()=>RT,gte:()=>f$,gt:()=>z0,globalRegistry:()=>J$,getErrorMap:()=>g0D,getDiscriminatedOption:()=>oY,function:()=>_b,fromJSONSchema:()=>ob,formatError:()=>c8,float64:()=>Ib,float32:()=>Fb,flattenError:()=>d8,file:()=>Rb,exactOptional:()=>eG,enum:()=>dU,endsWith:()=>s4,encodeAsync:()=>MG,encode:()=>wG,emoji:()=>kT,email:()=>AT,e164:()=>rT,discriminatedUnion:()=>Mb,describe:()=>fb,deepPartial:()=>sb,decodeAsync:()=>OG,decode:()=>ZG,date:()=>Hb,custom:()=>gb,currencyCode:()=>$b,cuid2:()=>gT,cuid:()=>xT,creditCard:()=>oT,core:()=>C0,config:()=>nD,compile:()=>yB,coerce:()=>Vq,codec:()=>Pb,clone:()=>MD,cidrv6:()=>dT,cidrv4:()=>lT,check:()=>xb,catch:()=>Yq,boolean:()=>PG,bigint:()=>Qb,base64url:()=>pT,base64:()=>cT,array:()=>b3,any:()=>Gb,_function:()=>_b,_default:()=>Uq,_ZodString:()=>jU,ZodXor:()=>hG,ZodXID:()=>uU,ZodVoid:()=>yG,ZodUnknown:()=>gG,ZodUnion:()=>C3,ZodUndefined:()=>uG,ZodUUID:()=>w0,ZodURL:()=>S3,ZodULID:()=>CU,ZodType:()=>WD,ZodTuple:()=>dG,ZodTransform:()=>sG,ZodTemplateLiteral:()=>qq,ZodSymbol:()=>CG,ZodSuccess:()=>Xq,ZodStringFormat:()=>AD,ZodString:()=>K2,ZodSet:()=>oG,ZodRecord:()=>W2,ZodRealError:()=>P$,ZodReadonly:()=>Kq,ZodPromise:()=>zq,ZodPreprocess:()=>Bq,ZodPrefault:()=>Fq,ZodPipe:()=>k3,ZodOptional:()=>u3,ZodObject:()=>P3,ZodNumberFormat:()=>Z1,ZodNumber:()=>G2,ZodNullable:()=>Dq,ZodNull:()=>kG,ZodNonOptional:()=>rU,ZodNever:()=>fG,ZodNanoID:()=>TU,ZodNaN:()=>Wq,ZodMap:()=>rG,ZodMAC:()=>RG,ZodLiteral:()=>tG,ZodLazy:()=>Hq,ZodKSUID:()=>kU,ZodJWT:()=>nU,ZodIssueCode:()=>_0D,ZodIntersection:()=>iG,ZodInstanceOf:()=>Mq,ZodISOTime:()=>H6,ZodISODuration:()=>N6,ZodISODateTime:()=>G6,ZodISODate:()=>q6,ZodIPv6:()=>xU,ZodIPv4:()=>_U,ZodIBAN:()=>TG,ZodGUID:()=>RU,ZodFunction:()=>Lq,ZodFirstPartyTypeKind:()=>Oq,ZodFile:()=>aG,ZodExactOptional:()=>pU,ZodError:()=>C0D,ZodEnum:()=>B2,ZodEmoji:()=>SU,ZodEmail:()=>AU,ZodE164:()=>hU,ZodDiscriminatedUnion:()=>nG,ZodDefault:()=>$q,ZodDate:()=>T3,ZodCustomStringFormat:()=>w1,ZodCustom:()=>x3,ZodCreditCard:()=>SG,ZodCompileUnsupportedError:()=>ND,ZodCompileAsyncError:()=>H0,ZodCodec:()=>_3,ZodCatch:()=>Qq,ZodCUID2:()=>PU,ZodCUID:()=>bU,ZodCIDRv6:()=>fU,ZodCIDRv4:()=>gU,ZodBoolean:()=>q2,ZodBigIntFormat:()=>iU,ZodBigInt:()=>H2,ZodBase64URL:()=>mU,ZodBase64:()=>yU,ZodArray:()=>mG,ZodAny:()=>xG,TimePrecision:()=>cB,NEVER:()=>pX,INVALID:()=>O$,$output:()=>uB,$input:()=>kB,$brand:()=>rX});var jq=T(()=>{y$();y$();j3();tb();eb();FP();CB();oU();oU();IP();z6();OU();qG();AG();lb()});var JP=T(()=>{jq();jq()});function UQD(D,$,U){let I=U.filter((J)=>D[J]===!0);if(I.length<2)return;let F=String(I[0]);for(let J of I.slice(1))$.addIssue({code:"custom",message:`not used together with "${F}"`,path:[J]})}var XP,I6D,FQD,IQD,JQD,XQD;var QP=T(()=>{JP();XP=zD.object({name:zD.string().min(1),version:zD.string().min(1),requested_version:zD.string().optional(),ios_checksum:zD.string().optional(),android_checksum:zD.string().optional()}),I6D=zD.enum(["new_plugin","removed_plugin","version_mismatch","requested_version_changed","ios_code_changed","android_code_changed","both_platforms_changed","platform_checksum_metadata_changed"]),FQD=zD.object({name:zD.string(),localVersion:zD.string().optional(),remoteVersion:zD.string().optional(),localRequestedVersion:zD.string().optional(),remoteRequestedVersion:zD.string().optional(),localIosChecksum:zD.string().optional(),remoteIosChecksum:zD.string().optional(),localAndroidChecksum:zD.string().optional(),remoteAndroidChecksum:zD.string().optional()}),IQD=zD.object({compatible:zD.boolean(),reasons:I6D.array(),message:zD.string()}),JQD=zD.object({isSecurityPolicyError:zD.boolean(),errorCode:zD.string(),message:zD.string()}),XQD=zD.record(zD.string(),zD.string()).transform((D,$)=>{if(D===null||typeof D!=="object"||Array.isArray(D)||Object.getPrototypeOf(D)!==Object.prototype)return $.addIssue({code:"custom",message:"a plain object of locale keys to release notes"}),zD.NEVER;let U=Object.create(null);for(let[I,F]of Object.entries(D)){let J=I.trim(),X=F.trim();if(!J)return $.addIssue({code:"custom",message:"a non-empty locale key"}),zD.NEVER;if(!X)return $.addIssue({code:"custom",message:"a non-empty release note"}),zD.NEVER;if(Object.hasOwn(U,J))return $.addIssue({code:"custom",message:`a unique locale key (duplicate after trim: "${J}")`}),zD.NEVER;U[J]=X}return U})});function J6D(D){if(typeof D?.then==="function")throw TypeError("Expected synchronous schema validation result");return D}function Aq(D,$){let U=J6D(D["~standard"].validate($));if(U.issues)return{success:!1,error:new YP(U.issues)};return{success:!0,data:U.value}}function YQD(D,$){let U=Aq(D,$);if(!U.success)throw U.error;return U.data}var YP;var WP=T(()=>{YP=class YP extends Error{issues;constructor(D){super(D.map(($)=>$.message).join("; ")||"Schema validation failed");this.name="SchemaError",this.issues=D}}});function BP(D){let $=D;if(typeof $.status==="number")return $.status;let U=$.context&&typeof $.context==="object"?$.context.status:void 0;return typeof U==="number"?U:void 0}function X6D(D){if(!D||typeof D!=="object")return;let $=BP(D);if($!==void 0)return $;let U=D.cause;if(U&&typeof U==="object")return BP(U);return}function Q6D(D){let $=[],U=new Set,I=D;if(typeof D==="string")return D;while(I){if(typeof I==="string"){$.push(I);break}if(typeof I!=="object")break;if(U.has(I))break;if(U.add(I),I instanceof Error){$.push(I.message),I=I.cause;continue}let F=I;if(typeof F.message==="string")$.push(F.message);I=F.cause}return $.join(" ")}function Y6D(D){return Q6D(D)}function KP(D){if(D&&typeof D==="object"&&"code"in D){let I=D.code;if(typeof I==="string"&&I.startsWith("commander."))return"commander"}let $=X6D(D);if($!==void 0){if($===401)return"unauthorized";if($===403)return"forbidden";if($===404)return"not_found";if($===413)return"payload_too_large";if($===429)return"rate_limited";if($>=500)return"server_error"}let U=Y6D(D).toLowerCase();if(/econnrefused|econnreset|enotfound|eai_again|fetch failed|failed to fetch|connect timeout|und_err/.test(U))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(U))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(U))return"validation_error";return"unknown"}function BQD(D){if(D===401)return"unauthorized";if(D===403)return"forbidden";if(D===404)return"not_found";if(D===408||D===504)return"timeout";if(D===413)return"payload_too_large";if(D===429)return"rate_limited";if(D===400||D===422)return"validation_error";if(D>=500)return"server_error";return"unknown"}function L2(D){let $=KP(D);return $==="network_error"||$==="timeout"}var Rq=()=>{};function G6D(D){return new Promise(($)=>setTimeout($,D))}async function qP(D){let $={data:null,error:null};for(let U=1;U<=GP;U++){if($=await D(),!$.error)return $;if(!L2($.error))return $;if(U<GP)await G6D(K6D[U-1]??1000)}return $}async function HP(D){if(!D.silent)vD.warn(B6D);let $=new Sq;if(cA($))await pA({error:$,functionName:D.telemetryFunctionName,kind:"unhandled_error",status:0})}function NP(D){if(L2(D))throw new Sq;let $=D.message??"unknown error";throw Error(`Cannot check 2FA compliance: ${$}`)}var W6D="Cannot reach Capgo to verify 2FA compliance. Check your network connection and try again.",B6D="Could not verify 2FA compliance due to a network error. Continuing — Capgo will still enforce 2FA on this action if required.",GP=3,K6D,Sq;var zP=T(()=>{y0();xX();Rq();K6D=[500,1000];Sq=class Sq extends Error{constructor(D=W6D){super(D);this.name="TwoFactorComplianceNetworkError"}}});function tU(D){let $=D.replace(q6D,"[REDACTED PRIVATE KEY]");for(let{re:U,replace:I}of H6D)$=$.replace(U,I);return $}var q6D,H6D;var LP=T(()=>{q6D=/-----BEGIN [^-]+-----[\s\S]*?-----END [^-]+-----/g,H6D=[{re:/(authorization\s*:\s*bearer\s+)[\w.\-+/=]+/gi,replace:"$1[REDACTED]"},{re:/\bcapg_[A-Za-z0-9]{8,}\b/g,replace:"[REDACTED]"},{re:/(capgkey\s*[=:]\s*)[\w-]{6,}/gi,replace:"$1[REDACTED]"},{re:/\b(api[_-]?key|secret|token|password|passwd|pwd)(\s*[=:]\s*)["']?[\w.\-+/=]{6,}["']?/gi,replace:"$1$2[REDACTED]"},{re:/("(?:access_token|refresh_token|id_token|client_secret|private[_-]?key|apple_key_content|api[_-]?key|token|secret|password|p8|pem)"\s*:\s*")[^"]+(")/gi,replace:"$1[REDACTED]$2"}]});function N6D(D){return Object.values(aU).includes(D)}function Tq(D){let $="",U="";if(typeof D==="string")$=D,U=D;else if(D&&typeof D==="object"){let I=D;$=String(I.error||I.code||I.errorCode||""),U=String(I.message||I.error||"")}if(N6D($))return{isSecurityPolicyError:!0,errorCode:$,message:wP[$]||U};for(let[I,F]of Object.entries(wP))if(U.includes(I))return{isSecurityPolicyError:!0,errorCode:I,message:F};return{isSecurityPolicyError:!1,errorCode:$,message:U}}function ZP(D){let $=Tq(D);if($.isSecurityPolicyError)return`
|
|
223
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of D.seen.entries()){let Q=X[1];if($===X[0]){J(X);continue}if(D.external){let W=D.external.registry.get(X[0])?.id;if($!==X[0]&&W){J(X);continue}}if(D.metadataRegistry.get(X[0])?.id){J(X);continue}if(Q.cycle){J(X);continue}if(Q.count>1){if(D.reused==="ref")J(X)}}if(D.external)D.sharedDefsExtractedFor=D.external}function WT(D){let $=D.anyOf;if(!Array.isArray($)||$.length===0||D.type!==void 0)return;let U=[];for(let I of $){if(!I||typeof I!=="object")return;WT(I);let F=Object.keys(I);if(F.length!==1||F[0]!=="type")return;let J=I.type;for(let X of Array.isArray(J)?J:[J]){if(typeof X!=="string")return;if(!U.includes(X))U.push(X)}}delete D.anyOf,D.type=U.length===1?U[0]:U}function YT(D){let $=D.additionalProperties;if($===void 0||$===!1||typeof $!=="object"||$===null)return null;return Object.keys($).length?$:null}function VK(D){let $=[];for(let J of D){if(typeof J!=="object"||J.type!=="object")return null;for(let X in J)if(!BT.has(X))return null;$.push(J)}let U={},I=new Set;for(let J of $){for(let X in J.properties){if(Object.prototype.hasOwnProperty.call(U,X))continue;let Q=[];for(let W of $){let B=W.properties?.[X]??YT(W);if(B===null||B===void 0)continue;if(!Q.some((K)=>JSON.stringify(K)===JSON.stringify(B)))Q.push(B)}let Y=Q.length===1?Q[0]:VK(Q)??{allOf:Q};I$(U,X,Y)}for(let X of J.required??[])I.add(X)}let F={type:"object",properties:U};if(I.size)F.required=[...I];if($.every((J)=>J.additionalProperties===!1))F.additionalProperties=!1;else{let J=[];for(let X of $){let Q=YT(X);if(Q&&!J.some((Y)=>JSON.stringify(Y)===JSON.stringify(Q)))J.push(Q)}if(J.length===1)F.additionalProperties=J[0];else if(J.length>1)F.additionalProperties={allOf:J}}return F}function A0D(D){let $=D.allOf;if(!Array.isArray($)||$.length<2)return;for(let F of BT)if(F in D)return;let U=$.filter((F)=>QT.some((J)=>Array.isArray(F[J]))),I=null;if(!U.length)I=VK($);else{let F=U[0],J=QT.find((Y)=>Array.isArray(F[Y]));if(Object.keys(F).length!==1)return;let X=$.filter((Y)=>Y!==F),Q=F[J].map((Y)=>VK([...X,Y]));if(Q.some((Y)=>!Y))return;I={[J]:Q}}if(!I)return;delete D.allOf,E3(D,I)}function K6(D,$){let U=D.seen.get($);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let I=(Q)=>{let Y=D.seen.get(Q);if(Y.ref===null)return;let W=Y.def??Y.schema,B={...W},K=Y.ref;if(Y.ref=null,K){I(K);let H=D.seen.get(K),G=H.schema;if(G.$ref&&(D.target==="draft-07"||D.target==="draft-04"||D.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(G);else E3(W,G);if(E3(W,B),Q._zod.parent===K)for(let N in W){if(N==="$ref"||N==="allOf")continue;if(!(N in B))delete W[N]}if(G.$ref&&H.def)for(let N in W){if(N==="$ref"||N==="allOf")continue;if(N in H.def&&JSON.stringify(W[N])===JSON.stringify(H.def[N]))delete W[N]}}let q=Q._zod.parent;if(q&&q!==K){I(q);let H=D.seen.get(q);if(H?.schema.$ref){if(W.$ref=H.schema.$ref,H.def)for(let G in W){if(G==="$ref"||G==="allOf")continue;if(G in H.def&&JSON.stringify(W[G])===JSON.stringify(H.def[G]))delete W[G]}}}D.override({zodSchema:Q,jsonSchema:W,path:Y.path??[]})};if(!D.external||D.sharedEmitDoneFor!==D.external){for(let Q of[...D.seen.entries()].reverse())I(Q[0]);if(D.target!=="openapi-3.0")for(let Q of D.seen.entries())WT(Q[1].def??Q[1].schema);for(let Q of D.deferred)Q();if(D.intersections.length){let Q=new Map;for(let Y of D.seen.values())for(let W of[Y.schema,Y.def]){let B=W?.allOf;if(!Array.isArray(B))continue;let K=Q.get(B);if(K)K.push(W);else Q.set(B,[W])}for(let Y of D.intersections)for(let W of Q.get(Y)??[])A0D(W)}}let F={};if(D.target==="draft-2020-12")F.$schema="https://json-schema.org/draft/2020-12/schema";else if(D.target==="draft-07")F.$schema="http://json-schema.org/draft-07/schema#";else if(D.target==="draft-04")F.$schema="http://json-schema.org/draft-04/schema#";else if(D.target==="openapi-3.0");if(D.external?.uri){let Q=D.external.registry.get($)?.id;if(!Q)throw Error("Schema is missing an `id` property");F.$id=D.external.uri(Q)}E3(F,U.defId?U.schema:U.def??U.schema);let J=D.metadataRegistry.get($)?.id;if(J!==void 0&&F.id===J)delete F.id;let X=D.external?.defs??{};if(!D.external||D.sharedEmitDoneFor!==D.external)for(let Q of D.seen.entries()){let Y=Q[1];if(Y.def&&Y.defId){if(Y.def.id===Y.defId)delete Y.def.id;I$(X,Y.defId,Y.def)}}if(D.external)D.sharedEmitDoneFor=D.external;if(D.external);else if(Object.keys(X).length>0)if(D.target==="draft-2020-12")F.$defs=X;else F.definitions=X;try{let Q=JSON.parse(JSON.stringify(F));return Object.defineProperty(Q,"~standard",{value:{...$["~standard"],jsonSchema:{input:X2($,"input",D.processors),output:X2($,"output",D.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function E$(D,$){let U=$??{seen:new Set};if(U.seen.has(D))return!1;U.seen.add(D);let I=D._zod.def;if(I.type==="transform")return!0;if(I.type==="array")return E$(I.element,U);if(I.type==="set")return E$(I.valueType,U);if(I.type==="lazy")return E$(I.getter(),U);if(I.type==="promise"||I.type==="optional"||I.type==="nonoptional"||I.type==="nullable"||I.type==="readonly"||I.type==="default"||I.type==="prefault"||I.type==="catch")return E$(I.innerType,U);if(I.type==="intersection")return E$(I.left,U)||E$(I.right,U);if(I.type==="record"||I.type==="map")return E$(I.keyType,U)||E$(I.valueType,U);if(I.type==="pipe"){if(D._zod.traits.has("$ZodCodec"))return!0;return E$(I.in,U)||E$(I.out,U)}if(I.type==="object"){for(let F in I.shape)if(E$(I.shape[F],U))return!0;return!1}if(I.type==="union"){for(let F of I.options)if(E$(F,U))return!0;return!1}if(I.type==="tuple"){for(let F of I.items)if(E$(F,U))return!0;if(I.rest&&E$(I.rest,U))return!0;return!1}return!1}var BT,QT,jK=(D,$={})=>(U)=>{let I=W6({...U,processors:$});return ED(D,I),B6(I,D),K6(I,D)},X2=(D,$,U={})=>(I)=>{let{libraryOptions:F,target:J}=I??{},X=W6({...F??{},target:J,io:$,processors:U});return ED(D,X),B6(X,D),K6(X,D)};var v3=T(()=>{z3();c();BT=new Set(["type","properties","required","additionalProperties"]),QT=["oneOf","anyOf"]});function oD(D){let $={},U=D._zod.def,I=D._zod.traits.has("$ZodCheck")?[D,...U.checks??[]]:U.checks??[];for(let J of I)R0D[J._zod.def.check]?.($,J._zod.def);let F=D._zod.bag;if(F.minimum!==void 0)Q2($,"minimum",F.minimum);if(F.exclusiveMinimum!==void 0)Q2($,"exclusiveMinimum",F.exclusiveMinimum);if(F.maximum!==void 0)Y2($,"maximum",F.maximum);if(F.exclusiveMaximum!==void 0)Y2($,"exclusiveMaximum",F.exclusiveMaximum);if(F.multipleOf!==void 0)NT($,F.multipleOf);if(F.format!==void 0){if($.format??($.format=F.format),F.format.includes("int"))$.isInt=!0}if(F.mime)LT($,F.mime);for(let J of F.patterns??[])zT($,J);return $}function V3(D){let $=D._zod.def;if($.type==="pipe"&&$.in._zod.traits.has("$ZodTransform"))return V3($.out);if($.type==="catch")return V3($.innerType);return D._zod.optin}function AK(D,$,U){if($.$ref){if(U.has($))return $;U.add($);let G=D.get($)?.def;if(!G)return $;let z=AK(D,G,U);return z===G?$:z}for(let G of["anyOf","oneOf"]){let z=$[G];if(!Array.isArray(z))continue;let N=z.map((M)=>AK(D,M,U));if(N.some((M,Z)=>M!==z[Z]))$={...$,[G]:N}}let I=Array.isArray($.type)?$.type:[$.type],F=!I.includes("string")&&I.some((G)=>G==="number"||G==="integer"),J=$.enum??($.const!==void 0?[$.const]:void 0);if(!F&&!J?.some((G)=>typeof G==="number"))return $;let{minimum:X,maximum:Q,exclusiveMinimum:Y,exclusiveMaximum:W,multipleOf:B,format:K,id:q,...H}=$;if(H.enum)H.enum=H.enum.map((G)=>typeof G==="number"?String(G):G);else if(typeof H.const==="number")H.const=String(H.const);if(!F)return H;if(H.type="string",!J)H.pattern=(I.includes("number")?q0:t8).source;return H}function b0D(D){let $=new Map;for(let I of D.seen.values())if(I.def&&!$.has(I.schema))$.set(I.schema,I);let U=new Map;for(let I of RK.get(D)??[]){let F=D.seen.get(I),J=(F?.def??F?.schema)?.propertyNames;if(!J||J===!0||U.has(J))continue;let X=AK($,J,new Set);if(X!==J)U.set(J,X)}if(!U.size)return;for(let I of D.seen.values())for(let F of[I.schema,I.def]){let J=F&&U.get(F.propertyNames);if(J)F.propertyNames=J}}function MT(D,$,U,I,F){let J=!1,X=JSON.stringify(D,(Q,Y)=>{if(typeof Y!=="bigint")return Y;return J=!0,null});if(!J)return JSON.parse(X);return rD($,U,I,F,"BigInt defaults cannot be represented in JSON Schema"),IG}function ZU(D,$){if("_idmap"in D){let I=D,F=W6({...$,processors:zU}),J={};for(let Y of I._idmap.entries()){let[W,B]=Y;ED(B,F)}let X={},Q={registry:I,uri:$?.uri,defs:J};F.external=Q;for(let Y of I._idmap.entries()){let[W,B]=Y;B6(F,B),I$(X,W,K6(F,B))}if(Object.keys(J).length>0){let Y=F.target==="draft-2020-12"?"$defs":"definitions";X.__shared={[Y]:J}}return{schemas:X}}let U=W6({...$,processors:zU});return ED(D,U),B6(U,D),K6(U,D)}var Q2=(D,$,U)=>{if(D[$]===void 0||U>D[$])D[$]=U},Y2=(D,$,U)=>{if(D[$]===void 0||U<D[$])D[$]=U},KT=(D,$)=>{Q2(D,"minimum",$),Y2(D,"maximum",$)},NT=(D,$)=>{if(D.multipleOf??(D.multipleOf=[]),!D.multipleOf.includes($))D.multipleOf.push($)},zT=(D,$)=>{D.patterns??(D.patterns=new Set),D.patterns.add($)},LT=(D,$)=>{D.mime=D.mime?D.mime.filter((U)=>$.includes(U)):[...$]},wT=(D,$)=>{if(D.format=$,$.includes("int"))D.isInt=!0},GT=(D,$)=>Q2(D,"minimum",$.minimum),qT=(D,$)=>Y2(D,"maximum",$.maximum),HT=(D)=>($,U)=>{wT($,U.format);let[I,F]=D[U.format];Q2($,"minimum",I),Y2($,"maximum",F)},R0D,S0D,T0D,ZT=(D)=>T0D.get(D)??D,SK=(D,$,U,I)=>{let F=U;F.type="string";let{minimum:J,maximum:X,format:Q,patterns:Y,contentEncoding:W,laxFormat:B}=oD(D);if(typeof J==="number")F.minLength=J;if(typeof X==="number")F.maxLength=X;if(Q){if(F.format=S0D[Q]??Q,F.format==="")delete F.format;if(Q==="time"||B)delete F.format}if(W)F.contentEncoding=W;if(Y&&Y.size>0){let K=[...Y].map(ZT);if(K.length===1)F.pattern=K[0].source;else if(K.length>1)F.allOf=[...K.map((q)=>({...$.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"?{type:"string"}:{},pattern:q.source}))]}},TK=(D,$,U,I)=>{let F=U,{minimum:J,maximum:X,multipleOf:Q,exclusiveMaximum:Y,exclusiveMinimum:W,isInt:B}=oD(D);F.type=B?"integer":"number";let K=typeof W==="number"&&W>=(J??Number.NEGATIVE_INFINITY),q=typeof Y==="number"&&Y<=(X??Number.POSITIVE_INFINITY),H=$.target==="draft-04"||$.target==="openapi-3.0";if(K)if(H)F.minimum=W,F.exclusiveMinimum=!0;else F.exclusiveMinimum=W;else if(typeof J==="number")F.minimum=J;if(q)if(H)F.maximum=Y,F.exclusiveMaximum=!0;else F.exclusiveMaximum=Y;else if(typeof X==="number")F.maximum=X;if(Q){let G=new Set;for(let M of Q)if(Number.isFinite(M)&&M!==0)G.add(Math.abs(M));else rD(D,$,F,I,`A multipleOf divisor of ${M} cannot be represented in JSON Schema`);let[z,...N]=G;if(z!==void 0)F.multipleOf=z;if(N.length)F.allOf=[...F.allOf??[],...N.map((M)=>({multipleOf:M}))]}},bK=(D,$,U,I)=>{U.type="boolean"},PK=(D,$,U,I)=>{rD(D,$,U,I,"BigInt cannot be represented in JSON Schema")},CK=(D,$,U,I)=>{rD(D,$,U,I,"Symbols cannot be represented in JSON Schema")},uK=(D,$,U,I)=>{if($.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},kK=(D,$,U,I)=>{rD(D,$,U,I,"Undefined cannot be represented in JSON Schema")},_K=(D,$,U,I)=>{rD(D,$,U,I,"Void cannot be represented in JSON Schema")},xK=(D,$,U,I)=>{U.not={}},gK=(D,$,U,I)=>{},fK=(D,$,U,I)=>{},yK=(D,$,U,I)=>{rD(D,$,U,I,"Date cannot be represented in JSON Schema")},mK=(D,$,U,I)=>{let F=D._zod.def,J=P4(F.entries);if(J.length===0){U.not={};return}if(J.every((X)=>typeof X==="number"))U.type="number";if(J.every((X)=>typeof X==="string"))U.type="string";U.enum=J},hK=(D,$,U,I)=>{let F=D._zod.def;if(F.values.length===0){U.not={};return}let J=[];for(let X of F.values)if(X===void 0){if(rD(D,$,U,I,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof X==="bigint"){if(rD(D,$,U,I,"BigInt literals cannot be represented in JSON Schema"))return;J.push(Number(X))}else J.push(X);if(J.length===0);else if(J.length===1){let X=J[0];if(U.type=X===null?"null":typeof X,$.target==="draft-04"||$.target==="openapi-3.0")U.enum=[X];else U.const=X}else{if(J.every((X)=>typeof X==="number"))U.type="number";if(J.every((X)=>typeof X==="string"))U.type="string";if(J.every((X)=>typeof X==="boolean"))U.type="boolean";if(J.every((X)=>X===null))U.type="null";U.enum=J}},nK=(D,$,U,I)=>{rD(D,$,U,I,"NaN cannot be represented in JSON Schema")},iK=(D,$,U,I)=>{let F=U,J=D._zod.pattern;if(!J)throw Error("Pattern not found in template literal");F.type="string",F.pattern=J.source},lK=(D,$,U,I)=>{let F=U;F.type="string",F.format="binary",F.contentEncoding="binary";let{minimum:J,maximum:X,mime:Q}=oD(D);if(J!==void 0)F.minLength=J;if(X!==void 0)F.maxLength=X;if(!Q)return;if(Q.length===0)F.not={};else if(Q.length===1)F.contentMediaType=Q[0];else F.anyOf=Q.map((Y)=>({contentMediaType:Y}))},dK=(D,$,U,I)=>{U.type="boolean"},cK=(D,$,U,I)=>{rD(D,$,U,I,"Custom types cannot be represented in JSON Schema")},pK=(D,$,U,I)=>{rD(D,$,U,I,"Function types cannot be represented in JSON Schema")},rK=(D,$,U,I)=>{rD(D,$,U,I,"Transforms cannot be represented in JSON Schema")},oK=(D,$,U,I)=>{rD(D,$,U,I,"Map cannot be represented in JSON Schema")},tK=(D,$,U,I)=>{rD(D,$,U,I,"Set cannot be represented in JSON Schema")},aK=(D,$,U,I)=>{let F=U,J=D._zod.def,{minimum:X,maximum:Q}=oD(D);if(typeof X==="number")F.minItems=X;if(typeof Q==="number")F.maxItems=Q;F.type="array",F.items=ED(J.element,$,{...I,path:[...I.path,"items"]})},sK=(D,$,U,I)=>{let F=U,J=D._zod.def,X=J.shape;if(Object.getOwnPropertySymbols(X).length&&rD(D,$,F,I,"Symbol keys cannot be represented in JSON Schema"))return;F.type="object",F.properties={};for(let W in X)I$(F.properties,W,ED(X[W],$,{...I,path:[...I.path,"properties",W]}));let Y=[];for(let W of Object.keys(X)){let B=J.shape[W];if($.io==="input"?V3(B)===void 0:B._zod.optout===void 0)Y.push(W)}if(Y.length>0)F.required=Y;if(J.catchall?._zod.def.type==="never")F.additionalProperties=!1;else if(!J.catchall){if($.io==="output")F.additionalProperties=!1}else if(J.catchall)F.additionalProperties=ED(J.catchall,$,{...I,path:[...I.path,"additionalProperties"]})},LU=(D,$,U,I)=>{let F=D._zod.def,J=F.inclusive===!1,X=F.options.map((Q,Y)=>ED(Q,$,{...I,path:[...I.path,J?"oneOf":"anyOf",Y]}));if(J)U.oneOf=X;else U.anyOf=X},eK=(D,$,U,I)=>{let F=D._zod.def,J=ED(F.left,$,{...I,path:[...I.path,"allOf",0]}),X=ED(F.right,$,{...I,path:[...I.path,"allOf",1]}),Q=(W)=>("allOf"in W)&&Object.keys(W).length===1,Y=[...Q(J)?J.allOf:[J],...Q(X)?X.allOf:[X]];U.allOf=Y,$.intersections.push(Y)},DG=(D,$,U,I)=>{let F=U,J=D._zod.def;F.type="array";let X=$.target==="draft-2020-12"?"prefixItems":"items",Q=$.target==="draft-2020-12"?"items":$.target==="openapi-3.0"?"items":"additionalItems",Y=J.items.map((z,N)=>ED(z,$,{...I,path:[...I.path,X,N]})),W=J.rest?ED(J.rest,$,{...I,path:[...I.path,Q,...$.target==="openapi-3.0"?[J.items.length]:[]]}):null,B=J.items.length;while(B>0){let z=J.items[B-1];if(!($.io==="input"?V3(z)!==void 0:z._zod.optout==="optional"))break;B--}let K=J.items.length,q=!J.rest;if($.target==="draft-2020-12"){if(F.prefixItems=Y,q)F.items=!1;else if(W)F.items=W;if(B>0)F.minItems=B;if(q)F.maxItems=K}else if($.target==="openapi-3.0"){if(F.items={anyOf:Y},W)F.items.anyOf.push(W);if(B>0)F.minItems=B;if(q)F.maxItems=K}else{if(F.items=Y,q)F.additionalItems=!1;else if(W)F.additionalItems=W;if(B>0)F.minItems=B;if(q)F.maxItems=K}let{minimum:H,maximum:G}=oD(D);if(typeof H==="number")F.minItems=H;if(typeof G==="number")F.maxItems=G},RK,$G=(D,$,U,I)=>{let F=U,J=D._zod.def;F.type="object";let X=J.keyType,Q=oD(X).patterns;if(J.mode==="loose"&&Q&&Q.size>0){let B=ED(J.valueType,$,{...I,path:[...I.path,"patternProperties","*"]});F.patternProperties={};for(let K of Q)I$(F.patternProperties,ZT(K).source,B)}else{if($.target==="draft-07"||$.target==="draft-2020-12"){F.propertyNames=ED(J.keyType,$,{...I,path:[...I.path,"propertyNames"]});let B=RK.get($);if(!B)B=[],RK.set($,B),$.deferred.push(()=>b0D($));B.push(D)}F.additionalProperties=ED(J.valueType,$,{...I,path:[...I.path,"additionalProperties"]})}let Y=X._zod.values,W=$.io==="input"&&V3(J.valueType)!==void 0;if(Y&&!J.partial&&!W){let B=[...Y].filter((K)=>typeof K==="string"||typeof K==="number");if(B.length>0)F.required=B.map(String)}},UG=(D,$,U,I)=>{let F=D._zod.def,J=ED(F.innerType,$,I),X=$.seen.get(D);if($.target==="openapi-3.0")X.ref=F.innerType,U.nullable=!0;else U.anyOf=[J,{type:"null"}]},FG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType},IG,JG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType;let X=MT(F.defaultValue,D,$,U,I);if(X!==IG)U.default=X},XG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);if(J.ref=F.innerType,$.io!=="input")return;let X=MT(F.defaultValue,D,$,U,I);if(X!==IG)U._prefault=X},QG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType;let X;try{X=F.catchValue(void 0)}catch{rD(D,$,U,I,"Dynamic catch values are not supported in JSON Schema");return}U.default=X},YG=(D,$,U,I)=>{let F=D._zod.def,J=F.in._zod.traits.has("$ZodTransform"),X=$.io==="input"?J?F.out:F.in:F.out;ED(X,$,I);let Q=$.seen.get(D);Q.ref=X},WG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType,U.readOnly=!0},BG=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType},wU=(D,$,U,I)=>{let F=D._zod.def;ED(F.innerType,$,I);let J=$.seen.get(D);J.ref=F.innerType},KG=(D,$,U,I)=>{let F=D._zod.innerType;ED(F,$,I);let J=$.seen.get(D);J.ref=F},zU;var j3=T(()=>{J1();i4();v3();c();R0D={greater_than:(D,$)=>Q2(D,$.inclusive?"minimum":"exclusiveMinimum",$.value),less_than:(D,$)=>Y2(D,$.inclusive?"maximum":"exclusiveMaximum",$.value),multiple_of:(D,$)=>NT(D,$.value),number_format:HT(m8),bigint_format:HT(h8),min_length:GT,max_length:qT,length_equals:(D,$)=>KT(D,$.length),min_size:GT,max_size:qT,size_equals:(D,$)=>KT(D,$.size),string_format:(D,$)=>{if(wT(D,$.format),$.pattern)zT(D,$.pattern);if($.format==="base64"||$.format==="base64url")D.contentEncoding=$.format;if($.local||$.precision===-1)D.laxFormat=!0},mime_type:(D,$)=>LT(D,$.mime)};S0D={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},T0D=new Map([[j7,ZQ],[F3,MQ]]);RK=new WeakMap;IG=Symbol();zU={string:SK,number:TK,boolean:bK,bigint:PK,symbol:CK,null:uK,undefined:kK,void:_K,never:xK,any:gK,unknown:fK,date:yK,enum:mK,literal:hK,nan:nK,template_literal:iK,file:lK,success:dK,custom:cK,function:pK,transform:rK,map:oK,set:tK,array:aK,object:sK,union:LU,intersection:eK,tuple:DG,record:$G,nullable:UG,nonoptional:FG,default:JG,prefault:XG,catch:QG,pipe:YG,readonly:WG,promise:BG,optional:wU,lazy:KG}});class GG{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(D){this.ctx.counter=D}get seen(){return this.ctx.seen}constructor(D){let $=D?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";this.ctx=W6({processors:zU,target:$,...D?.metadata&&{metadata:D.metadata},...D?.unrepresentable&&{unrepresentable:D.unrepresentable},...D?.override&&{override:D.override},...D?.io&&{io:D.io}})}process(D,$={path:[],schemaPath:[]}){return ED(D,this.ctx,$)}emit(D,$){if($){if($.cycles)this.ctx.cycles=$.cycles;if($.reused)this.ctx.reused=$.reused;if($.external)this.ctx.external=$.external}this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,B6(this.ctx,D);let U=K6(this.ctx,D),{"~standard":I,...F}=U;return F}}var OT=T(()=>{j3();v3()});var ET={};var vT=()=>{};var C0={};X$(C0,{withParser:()=>h7,version:()=>IY,validateURL:()=>O7,validateAsync:()=>r8,validate:()=>p8,util:()=>x,urlProtocolOk:()=>v7,urlHostnameOk:()=>E7,treeifyError:()=>sX,toZod:()=>x8,toJSONSchema:()=>ZU,toDotPath:()=>YR,stripTabAndNewline:()=>D3,standardProps:()=>M7,safeParseAsync:()=>Ue,safeParse:()=>$e,safeEncodeAsync:()=>Ge,safeEncode:()=>Be,safeDecodeAsync:()=>qe,safeDecode:()=>Ke,registry:()=>m7,regexes:()=>o$,processSchema:()=>ED,process:()=>ED,prettifyError:()=>eX,parseURLObject:()=>TR,parseAsync:()=>D7,parse:()=>e5,meta:()=>EK,mergeValues:()=>n4,memoizer:()=>B3,locales:()=>N3,isValidJWT:()=>T7,isValidIPv6:()=>$3,isValidIBAN:()=>S7,isValidCreditCard:()=>R7,isValidCIDRv6:()=>V7,isValidBase64URL:()=>A7,isValidBase64:()=>U3,isRecursiveSchema:()=>f7,isBackEdge:()=>y7,initializeContext:()=>W6,handleUnrepresentable:()=>rD,globalRegistry:()=>J$,globalConfig:()=>eD,getDiscriminatedOption:()=>oY,formatError:()=>c8,flattenError:()=>d8,finalize:()=>K6,extractDefs:()=>B6,encodeAsync:()=>Ye,encode:()=>Xe,describe:()=>OK,decodeAsync:()=>We,decode:()=>Qe,createToJSONSchemaMethod:()=>jK,createStandardJSONSchemaMethod:()=>X2,config:()=>nD,compileFn:()=>n7,compile:()=>yB,clone:()=>MD,canParseURL:()=>KY,base64urlCharset:()=>F3,base64Charset:()=>j7,_xor:()=>I0D,_xid:()=>$U,_void:()=>GK,_uuidv7:()=>o7,_uuidv6:()=>r7,_uuidv4:()=>p7,_uuid:()=>c7,_url:()=>L3,_uppercase:()=>o4,_unknown:()=>BK,_union:()=>F0D,_undefined:()=>QK,_ulid:()=>DU,_uint64:()=>JK,_uint32:()=>eB,_tuple:()=>Q0D,_trim:()=>U2,_transform:()=>H0D,_toUpperCase:()=>I2,_toLowerCase:()=>F2,_templateLiteral:()=>v0D,_symbol:()=>XK,_superRefine:()=>MK,_success:()=>Z0D,_stringbool:()=>vK,_stringFormat:()=>H1,_string:()=>hB,_startsWith:()=>a4,_slugify:()=>J2,_size:()=>K1,_set:()=>B0D,_safeParseAsync:()=>y4,_safeParse:()=>f4,_safeEncodeAsync:()=>Q7,_safeEncode:()=>J7,_safeDecodeAsync:()=>Y7,_safeDecode:()=>X7,_regex:()=>p4,_refine:()=>ZK,_record:()=>Y0D,_readonly:()=>E0D,_property:()=>NU,_properties:()=>e4,_promise:()=>j0D,_positive:()=>KU,_pipe:()=>O0D,_parseAsync:()=>g4,_parse:()=>x4,_overwrite:()=>I0,_optional:()=>N0D,_number:()=>pB,_nullable:()=>z0D,_null:()=>YK,_normalize:()=>$2,_nonpositive:()=>qU,_nonoptional:()=>w0D,_nonnegative:()=>HU,_never:()=>KK,_negative:()=>GU,_nativeEnum:()=>G0D,_nanoid:()=>a7,_nan:()=>NK,_multipleOf:()=>Q6,_minSize:()=>L0,_minLength:()=>P0,_min:()=>f$,_mime:()=>D2,_maxSize:()=>Y6,_maxLength:()=>G1,_max:()=>g$,_map:()=>W0D,_mac:()=>iB,_lte:()=>g$,_lt:()=>N0,_lowercase:()=>r4,_literal:()=>q0D,_length:()=>q1,_lazy:()=>V0D,_ksuid:()=>UU,_jwt:()=>BU,_isoTime:()=>M3,_isoDuration:()=>O3,_isoDateTime:()=>w3,_isoDate:()=>Z3,_ipv6:()=>IU,_ipv4:()=>FU,_intersection:()=>X0D,_int64:()=>IK,_int32:()=>sB,_int:()=>oB,_includes:()=>t4,_iban:()=>dB,_guid:()=>d7,_gte:()=>f$,_gt:()=>z0,_float64:()=>aB,_float32:()=>tB,_file:()=>LK,_enum:()=>K0D,_endsWith:()=>s4,_encodeAsync:()=>F7,_encode:()=>$7,_emoji:()=>t7,_email:()=>l7,_e164:()=>WU,_discriminatedUnion:()=>J0D,_default:()=>L0D,_decodeAsync:()=>I7,_decode:()=>U7,_date:()=>qK,_custom:()=>wK,_cuid2:()=>e7,_cuid:()=>s7,_creditCard:()=>lB,_coercedString:()=>nB,_coercedNumber:()=>rB,_coercedDate:()=>HK,_coercedBoolean:()=>$K,_coercedBigint:()=>FK,_cidrv6:()=>XU,_cidrv4:()=>JU,_check:()=>IT,_catch:()=>M0D,_boolean:()=>DK,_bigint:()=>UK,_base64url:()=>YU,_base64:()=>QU,_array:()=>zK,_any:()=>WK,ZodCompileUnsupportedError:()=>ND,ZodCompileAsyncError:()=>H0,URL_UNPARSEABLE:()=>e8,URL_BAD_FORMAT:()=>BY,TimePrecision:()=>cB,NEVER:()=>pX,JSONSchemaGenerator:()=>GG,JSONSchema:()=>ET,INVALID:()=>O$,Doc:()=>h4,$output:()=>uB,$input:()=>kB,$constructor:()=>j,$brand:()=>rX,$ZodXor:()=>rY,$ZodXID:()=>wY,$ZodVoid:()=>lY,$ZodUnknown:()=>nY,$ZodUnion:()=>J3,$ZodUndefined:()=>yY,$ZodUUID:()=>YY,$ZodURL:()=>GY,$ZodULID:()=>LY,$ZodType:()=>XD,$ZodTuple:()=>C7,$ZodTransform:()=>IW,$ZodTemplateLiteral:()=>NW,$ZodSymbol:()=>fY,$ZodSuccess:()=>BW,$ZodStringFormat:()=>OD,$ZodString:()=>X1,$ZodSet:()=>DW,$ZodRegistry:()=>_B,$ZodRecord:()=>sY,$ZodRealError:()=>b$,$ZodReadonly:()=>HW,$ZodPromise:()=>LW,$ZodPreprocess:()=>qW,$ZodPrefault:()=>YW,$ZodPipe:()=>k7,$ZodOptional:()=>u7,$ZodObjectJIT:()=>pY,$ZodObject:()=>CR,$ZodNumberFormat:()=>xY,$ZodNumber:()=>b7,$ZodNullable:()=>XW,$ZodNull:()=>mY,$ZodNonOptional:()=>WW,$ZodNever:()=>iY,$ZodNanoID:()=>HY,$ZodNaN:()=>GW,$ZodMap:()=>eY,$ZodMAC:()=>AY,$ZodLiteral:()=>UW,$ZodLazy:()=>Q3,$ZodKSUID:()=>ZY,$ZodJWT:()=>kY,$ZodIntersection:()=>aY,$ZodISOTime:()=>EY,$ZodISODuration:()=>vY,$ZodISODateTime:()=>MY,$ZodISODate:()=>OY,$ZodIPv6:()=>jY,$ZodIPv4:()=>VY,$ZodIBAN:()=>uY,$ZodGUID:()=>QY,$ZodFunction:()=>zW,$ZodFile:()=>FW,$ZodExactOptional:()=>JW,$ZodError:()=>aX,$ZodEnum:()=>$W,$ZodEncodeError:()=>F1,$ZodEmoji:()=>qY,$ZodEmail:()=>WY,$ZodE164:()=>PY,$ZodDiscriminatedUnion:()=>tY,$ZodDefault:()=>QW,$ZodDate:()=>dY,$ZodCyclicError:()=>OW,$ZodCustomStringFormat:()=>_Y,$ZodCustom:()=>wW,$ZodCreditCard:()=>CY,$ZodCodec:()=>X3,$ZodCheckUpperCase:()=>tQ,$ZodCheckStringFormat:()=>m4,$ZodCheckStartsWith:()=>sQ,$ZodCheckSizeEquals:()=>lQ,$ZodCheckRegex:()=>rQ,$ZodCheckProperty:()=>DY,$ZodCheckProperties:()=>$Y,$ZodCheckOverwrite:()=>FY,$ZodCheckNumberFormat:()=>mQ,$ZodCheckMultipleOf:()=>yQ,$ZodCheckMinSize:()=>iQ,$ZodCheckMinLength:()=>cQ,$ZodCheckMimeType:()=>UY,$ZodCheckMaxSize:()=>nQ,$ZodCheckMaxLength:()=>dQ,$ZodCheckLowerCase:()=>oQ,$ZodCheckLessThan:()=>q7,$ZodCheckLengthEquals:()=>pQ,$ZodCheckIncludes:()=>aQ,$ZodCheckGreaterThan:()=>H7,$ZodCheckEndsWith:()=>eQ,$ZodCheckBigIntFormat:()=>hQ,$ZodCheck:()=>SD,$ZodCatch:()=>KW,$ZodCUID2:()=>zY,$ZodCUID:()=>NY,$ZodCIDRv6:()=>SY,$ZodCIDRv4:()=>RY,$ZodBoolean:()=>I3,$ZodBigIntFormat:()=>gY,$ZodBigInt:()=>P7,$ZodBase64URL:()=>bY,$ZodBase64:()=>TY,$ZodAsyncError:()=>x$,$ZodArray:()=>cY,$ZodAny:()=>hY});var y$=T(()=>{c();c();J1();CB();j3();OT();vT();X6();$Q();DQ();i4();EW();N7();JY();z3();FT();JT();v3()});var MU={};X$(MU,{uppercase:()=>o4,trim:()=>U2,toUpperCase:()=>I2,toLowerCase:()=>F2,startsWith:()=>a4,slugify:()=>J2,size:()=>K1,regex:()=>p4,property:()=>NU,properties:()=>e4,positive:()=>KU,overwrite:()=>I0,normalize:()=>$2,nonpositive:()=>qU,nonnegative:()=>HU,negative:()=>GU,multipleOf:()=>Q6,minSize:()=>L0,minLength:()=>P0,mime:()=>D2,maxSize:()=>Y6,maxLength:()=>G1,lte:()=>g$,lt:()=>N0,lowercase:()=>r4,length:()=>q1,includes:()=>t4,gte:()=>f$,gt:()=>z0,endsWith:()=>s4});var OU=T(()=>{y$()});function EU(D,$,U){Object.defineProperty(D,$,{configurable:!0,enumerable:!1,get(){let I=U(this);return Object.defineProperty(this,$,{value:I,configurable:!0,writable:!0}),I},set(I){Object.defineProperty(this,$,{value:I,configurable:!0,writable:!0})}})}var VT,jT=(D,$)=>{aX.init(D,$),D.name="ZodError";let U=Object.getPrototypeOf(D);if(VT.has(U))return;VT.add(U),EU(U,"format",(I)=>(F)=>c8(I,F)),EU(U,"flatten",(I)=>(F)=>d8(I,F)),EU(U,"addIssue",(I)=>(F)=>{I.issues.push(F),I.message=JSON.stringify(I.issues,C4,2)}),EU(U,"addIssues",(I)=>(F)=>{I.issues.push(...F),I.message=JSON.stringify(I.issues,C4,2)}),Object.defineProperty(U,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})},C0D,P$;var qG=T(()=>{y$();y$();c();VT=new WeakSet([Object.prototype,Error.prototype]);C0D=j("ZodError",jT),P$=j("ZodError",jT,void 0,{Parent:Error})});var HG,NG,zG,LG,wG,ZG,MG,OG,EG,vG,VG,jG;var AG=T(()=>{y$();qG();y$();HG=x4(P$),NG=g4(P$),zG=f4(P$),LG=y4(P$),wG=$7(P$),ZG=U7(P$),MG=F7(P$),OG=I7(P$),EG=J7(P$),vG=X7(P$),VG=Q7(P$),jG=Y7(P$)});var z2={};X$(z2,{xor:()=>Zb,xid:()=>yT,void:()=>qb,uuidv7:()=>PT,uuidv6:()=>bT,uuidv4:()=>TT,uuid:()=>ST,url:()=>CT,unknown:()=>N1,union:()=>N2,undefined:()=>Kb,ulid:()=>fT,uint64:()=>Wb,uint32:()=>Xb,tuple:()=>cG,transform:()=>cU,templateLiteral:()=>ub,symbol:()=>Bb,superRefine:()=>Zq,success:()=>Tb,stringbool:()=>hb,stringFormat:()=>sT,string:()=>A3,strictObject:()=>Lb,set:()=>Vb,refine:()=>wq,record:()=>pG,readonly:()=>Gq,promise:()=>kb,preprocess:()=>ib,prefault:()=>Iq,pipe:()=>VU,partialRecord:()=>Ob,optional:()=>z1,object:()=>zb,number:()=>bG,nullish:()=>Sb,nullable:()=>R3,null:()=>_G,nonoptional:()=>Jq,never:()=>lU,nativeEnum:()=>jb,nanoid:()=>_T,nan:()=>bb,meta:()=>yb,map:()=>vb,mac:()=>nT,looseRecord:()=>Eb,looseObject:()=>wb,literal:()=>Ab,lazy:()=>Nq,ksuid:()=>mT,keyof:()=>Nb,jwt:()=>aT,json:()=>nb,ipv6:()=>iT,ipv4:()=>hT,invertCodec:()=>Cb,intersection:()=>lG,int64:()=>Yb,int32:()=>Jb,int:()=>vU,instanceof:()=>mb,iban:()=>tT,httpUrl:()=>uT,hostname:()=>eT,hex:()=>Db,hash:()=>Ub,guid:()=>RT,function:()=>_b,float64:()=>Ib,float32:()=>Fb,file:()=>Rb,exactOptional:()=>eG,enum:()=>dU,emoji:()=>kT,email:()=>AT,e164:()=>rT,discriminatedUnion:()=>Mb,describe:()=>fb,date:()=>Hb,custom:()=>gb,currencyCode:()=>$b,cuid2:()=>gT,cuid:()=>xT,creditCard:()=>oT,codec:()=>Pb,cidrv6:()=>dT,cidrv4:()=>lT,check:()=>xb,catch:()=>Yq,boolean:()=>PG,bigint:()=>Qb,base64url:()=>pT,base64:()=>cT,array:()=>b3,any:()=>Gb,_function:()=>_b,_default:()=>Uq,_ZodString:()=>jU,ZodXor:()=>hG,ZodXID:()=>uU,ZodVoid:()=>yG,ZodUnknown:()=>gG,ZodUnion:()=>C3,ZodUndefined:()=>uG,ZodUUID:()=>w0,ZodURL:()=>S3,ZodULID:()=>CU,ZodType:()=>WD,ZodTuple:()=>dG,ZodTransform:()=>sG,ZodTemplateLiteral:()=>qq,ZodSymbol:()=>CG,ZodSuccess:()=>Xq,ZodStringFormat:()=>AD,ZodString:()=>K2,ZodSet:()=>oG,ZodRecord:()=>W2,ZodReadonly:()=>Kq,ZodPromise:()=>zq,ZodPreprocess:()=>Bq,ZodPrefault:()=>Fq,ZodPipe:()=>k3,ZodOptional:()=>u3,ZodObject:()=>P3,ZodNumberFormat:()=>Z1,ZodNumber:()=>G2,ZodNullable:()=>Dq,ZodNull:()=>kG,ZodNonOptional:()=>rU,ZodNever:()=>fG,ZodNanoID:()=>TU,ZodNaN:()=>Wq,ZodMap:()=>rG,ZodMAC:()=>RG,ZodLiteral:()=>tG,ZodLazy:()=>Hq,ZodKSUID:()=>kU,ZodJWT:()=>nU,ZodIntersection:()=>iG,ZodInstanceOf:()=>Mq,ZodISOTime:()=>H6,ZodISODuration:()=>N6,ZodISODateTime:()=>G6,ZodISODate:()=>q6,ZodIPv6:()=>xU,ZodIPv4:()=>_U,ZodIBAN:()=>TG,ZodGUID:()=>RU,ZodFunction:()=>Lq,ZodFile:()=>aG,ZodExactOptional:()=>pU,ZodEnum:()=>B2,ZodEmoji:()=>SU,ZodEmail:()=>AU,ZodE164:()=>hU,ZodDiscriminatedUnion:()=>nG,ZodDefault:()=>$q,ZodDate:()=>T3,ZodCustomStringFormat:()=>w1,ZodCustom:()=>x3,ZodCreditCard:()=>SG,ZodCodec:()=>_3,ZodCatch:()=>Qq,ZodCUID2:()=>PU,ZodCUID:()=>bU,ZodCIDRv6:()=>fU,ZodCIDRv4:()=>gU,ZodBoolean:()=>q2,ZodBigIntFormat:()=>iU,ZodBigInt:()=>H2,ZodBase64URL:()=>mU,ZodBase64:()=>yU,ZodArray:()=>mG,ZodAny:()=>xG});function k0D(){if(!eD.localeError)nD(K3())}function L1(){if(!eD.memoizer)nD({memoizer:B3()})}function A3(D){return hB(K2,D)}function AT(D){return l7(AU,D)}function RT(D){return d7(RU,D)}function ST(D){return c7(w0,D)}function TT(D){return p7(w0,D)}function bT(D){return r7(w0,D)}function PT(D){return o7(w0,D)}function CT(D){return L3(S3,D)}function uT(D){return L3(S3,{protocol:o8,hostname:EQ,...x.normalizeParams(D)})}function kT(D){return t7(SU,D)}function _T(D){return a7(TU,D)}function xT(D){return s7(bU,D)}function gT(D){return e7(PU,D)}function fT(D){return DU(CU,D)}function yT(D){return $U(uU,D)}function mT(D){return UU(kU,D)}function hT(D){return FU(_U,D)}function nT(D){return iB(RG,D)}function iT(D){return IU(xU,D)}function lT(D){return JU(gU,D)}function dT(D){return XU(fU,D)}function cT(D){return QU(yU,D)}function pT(D){return YU(mU,D)}function rT(D){return WU(hU,D)}function oT(D){return lB(SG,D)}function tT(D){return dB(TG,D)}function aT(D){return BU(nU,D)}function sT(D,$,U={}){return H1(w1,D,$,U)}function eT(D){return H1(w1,"hostname",OQ,D)}function Db(D){return H1(w1,"hex",xQ,D)}function $b(D){return H1(w1,"currency_code",VQ,D)}function Ub(D,$){let U=$?.enc??"hex",I=`${D}_${U}`,F=o$[I];if(!F)throw Error(`Unrecognized hash format: ${I}`);return H1(w1,I,F,$)}function bG(D){return pB(G2,D)}function vU(D){return oB(Z1,D)}function Fb(D){return tB(Z1,D)}function Ib(D){return aB(Z1,D)}function Jb(D){return sB(Z1,D)}function Xb(D){return eB(Z1,D)}function PG(D){return DK(q2,D)}function Qb(D){return UK(H2,D)}function Yb(D){return IK(iU,D)}function Wb(D){return JK(iU,D)}function Bb(D){return XK(CG,D)}function Kb(D){return QK(uG,D)}function _G(D){return YK(kG,D)}function Gb(){return WK(xG)}function N1(){return BK(gG)}function lU(D){return KK(fG,D)}function qb(D){return GK(yG,D)}function Hb(D){return qK(T3,D)}function b3(D,$){return zK(mG,D,$)}function Nb(D){let $=D._zod.def.shape;return dU(Object.keys($))}function zb(D,$){let U={type:"object",shape:D??{},...x.normalizeParams($)};return new P3(U)}function Lb(D,$){return new P3({type:"object",shape:D,catchall:lU(),...x.normalizeParams($)})}function wb(D,$){return new P3({type:"object",shape:D,catchall:N1(),...x.normalizeParams($)})}function N2(D,$){return new C3({type:"union",options:D,...x.normalizeParams($)})}function Zb(D,$){return new hG({type:"union",options:D,inclusive:!1,...x.normalizeParams($)})}function Mb(D,$,U){return new nG({type:"union",options:$,discriminator:D,...x.normalizeParams(U)})}function lG(D,$){return new iG({type:"intersection",left:D,right:$})}function cG(D,$,U){let I=$ instanceof XD,F=I?U:$;return new dG({type:"tuple",items:D,rest:I?$:null,...x.normalizeParams(F)})}function pG(D,$,U){if(!$||!$._zod)return new W2({type:"record",keyType:A3(),valueType:D,...x.normalizeParams($)});return new W2({type:"record",keyType:D,valueType:$,...x.normalizeParams(U)})}function Ob(D,$,U){return new W2({type:"record",keyType:D,valueType:$,...x.normalizeParams(U),partial:!0})}function Eb(D,$,U){return new W2({type:"record",keyType:D,valueType:$,mode:"loose",...x.normalizeParams(U)})}function vb(D,$,U){return new rG({type:"map",keyType:D,valueType:$,...x.normalizeParams(U)})}function Vb(D,$){return new oG({type:"set",valueType:D,...x.normalizeParams($)})}function dU(D,$){let U=Array.isArray(D)?Object.fromEntries(D.map((I)=>[I,I])):D;return new B2({type:"enum",entries:U,...x.normalizeParams($)})}function jb(D,$){return new B2({type:"enum",entries:D,...x.normalizeParams($)})}function Ab(D,$){return new tG({type:"literal",values:Array.isArray(D)?D:[D],...x.normalizeParams($)})}function Rb(D){return LK(aG,D)}function cU(D){return new sG({type:"transform",transform:D})}function z1(D){return new u3({type:"optional",innerType:D})}function eG(D){return new pU({type:"optional",innerType:D})}function R3(D){return new Dq({type:"nullable",innerType:D})}function Sb(D){return z1(R3(D))}function Uq(D,$){return new $q({type:"default",innerType:D,get defaultValue(){return typeof $==="function"?$():x.shallowClone($)}})}function Iq(D,$){return new Fq({type:"prefault",innerType:D,get defaultValue(){return typeof $==="function"?$():x.shallowClone($)}})}function Jq(D,$){return new rU({type:"nonoptional",innerType:D,...x.normalizeParams($)})}function Tb(D){return new Xq({type:"success",innerType:D})}function Yq(D,$){return new Qq({type:"catch",innerType:D,catchValue:typeof $==="function"?$:x.constantCatch($)})}function bb(D){return NK(Wq,D)}function VU(D,$){return new k3({type:"pipe",in:D,out:$})}function Pb(D,$,U){return new _3({type:"pipe",in:D,out:$,transform:U.decode,reverseTransform:U.encode})}function Cb(D){let $=D._zod.def;return new _3({type:"pipe",in:$.out,out:$.in,transform:$.reverseTransform,reverseTransform:$.transform})}function Gq(D){return new Kq({type:"readonly",innerType:D})}function ub(D,$){return new qq({type:"template_literal",parts:D,...x.normalizeParams($)})}function Nq(D){return new Hq({type:"lazy",getter:D})}function kb(D){return new zq({type:"promise",innerType:D})}function _b(D){return new Lq({type:"function",input:Array.isArray(D?.input)?cG(D?.input):D?.input??b3(N1()),output:D?.output??N1()})}function xb(D){let $=new SD({check:"custom"});return $._zod.check=D,$}function gb(D,$){return wK(x3,D??(()=>!0),$)}function wq(D,$={}){return ZK(x3,D,$)}function Zq(D,$){return MK(D,$)}function mb(D,$={}){let U=new Mq({type:"custom",check:"custom",fn:(I)=>I instanceof D,abort:!0,...x.normalizeParams($)});return U._zod.bag.Class=D,U._zod.check=(I)=>{if(!(I.value instanceof D))I.issues.push({code:"invalid_type",expected:D.name,input:I.value,inst:U,path:[...U._zod.def.path??[]]})},U}function nb(D){let $=Nq(()=>{return N2([A3(D),bG(),PG(),_G(),b3($),pG(A3(),$)])});return $}function ib(D,$){return new Bq({type:"pipe",in:cU(D),out:$})}var WD,jU,K2,AD,G6,q6,H6,N6,AU,RU,w0,S3,SU,TU,bU,PU,CU,uU,kU,_U,RG,xU,gU,fU,yU,mU,hU,SG,TG,nU,w1,G2,Z1,q2,H2,iU,CG,uG,kG,xG,gG,fG,yG,T3,mG,P3,C3,hG,nG,iG,dG,W2,rG,oG,B2,tG,aG,sG,u3,pU,Dq,$q,Fq,rU,Xq,Qq,Wq,k3,_3,Bq,Kq,qq,Hq,zq,Lq,x3,fb,yb,Mq,hb=(...D)=>vK({Codec:_3,Boolean:q2,String:K2},...D);var z6=T(()=>{y$();y$();j3();J1();v3();kW();OU();AG();WD=j("ZodType",(D,$)=>{return k0D(),XD.init(D,$),D.def=$,D.type=$.type,D},{check(...D){let $=this.def;return this.clone(x.mergeDefs($,{checks:[...$.checks??[],...D.map((U)=>typeof U==="function"?{_zod:{check:U,def:{check:"custom"},onattach:[]}}:U)]}),{parent:!0})},with(...D){return this.check(...D)},clone(D,$){return MD(this,D,$)},brand(){return this},register(D,$){return D.add(this,$),this},refine(D,$){return this.check(wq(D,$))},superRefine(D,$){return this.check(Zq(D,$))},overwrite(D){return this.check(I0(D))},optional(){return z1(this)},exactOptional(){return eG(this)},nullable(){return R3(this)},nullish(){return z1(R3(this))},nonoptional(D){return Jq(this,D)},array(){return b3(this)},or(D){return N2([this,D])},and(D){return lG(this,D)},transform(D){return VU(this,cU(D))},default(D){return Uq(this,D)},prefault(D){return Iq(this,D)},catch(D){return Yq(this,D)},pipe(D){return VU(this,D)},readonly(){return Gq(this)},describe(D){let $=this.clone();return J$.add($,{description:D}),$},meta(...D){if(D.length===0)return J$.get(this);let $=this.clone();return J$.add($,D[0]),$},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(D,...$){return $.length===0?D(this):D(this,...$)},get "~standard"(){return x.hide(this,"~standard",{...M7(this),jsonSchema:{input:X2(this,"input"),output:X2(this,"output")}})},set "~standard"(D){x.own(this,"~standard",D)},parse:function D($,U){return HG(this,$,U,{callee:D})},parseAsync:async function D($,U){return await NG(this,$,U,{callee:D})},safeParse(D,$){return zG(this,D,$)},async safeParseAsync(D,$){return LG(this,D,$)},get spa(){return this?.safeParseAsync},set spa(D){x.own(this,"spa",D)},validate(D,$){return p8(this,D,$)},validateAsync(D,$){return r8(this,D,$)},encode:function D($,U){return wG(this,$,U,{callee:D})},decode:function D($,U){return ZG(this,$,U,{callee:D})},encodeAsync:async function D($,U){return await MG(this,$,U,{callee:D})},decodeAsync:async function D($,U){return await OG(this,$,U,{callee:D})},safeEncode(D,$){return EG(this,D,$)},safeDecode(D,$){return vG(this,D,$)},async safeEncodeAsync(D,$){return VG(this,D,$)},async safeDecodeAsync(D,$){return jG(this,D,$)},toJSONSchema(D){return jK(this,{})(D)},get description(){return J$.get(this)?.description},get _def(){return this._zod.def}}),jU=j("_ZodString",(D,$)=>{X1.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>SK(D,U,I,F)},x.derived({format:(D)=>oD(D).format??null,minLength:(D)=>oD(D).minimum??null,maxLength:(D)=>oD(D).maximum??null},{regex(...D){return this.check(p4(...D))},includes(...D){return this.check(t4(...D))},startsWith(...D){return this.check(a4(...D))},endsWith(...D){return this.check(s4(...D))},min(...D){return this.check(P0(...D))},max(...D){return this.check(G1(...D))},length(...D){return this.check(q1(...D))},nonempty(...D){return this.check(P0(1,...D))},lowercase(D){return this.check(r4(D))},uppercase(D){return this.check(o4(D))},trim(){return this.check(U2())},normalize(...D){return this.check($2(...D))},toLowerCase(){return this.check(F2())},toUpperCase(){return this.check(I2())},slugify(){return this.check(J2())}})),K2=j("ZodString",(D,$)=>{X1.init(D,$),jU.init(D,$)},{email(D){return this.check(l7(AU,D))},url(D){return this.check(L3(S3,D))},jwt(D){return this.check(BU(nU,D))},emoji(D){return this.check(t7(SU,D))},guid(D){return this.check(d7(RU,D))},uuid(D){return this.check(c7(w0,D))},uuidv4(D){return this.check(p7(w0,D))},uuidv6(D){return this.check(r7(w0,D))},uuidv7(D){return this.check(o7(w0,D))},nanoid(D){return this.check(a7(TU,D))},cuid(D){return this.check(s7(bU,D))},cuid2(D){return this.check(e7(PU,D))},ulid(D){return this.check(DU(CU,D))},base64(D){return this.check(QU(yU,D))},base64url(D){return this.check(YU(mU,D))},xid(D){return this.check($U(uU,D))},ksuid(D){return this.check(UU(kU,D))},ipv4(D){return this.check(FU(_U,D))},ipv6(D){return this.check(IU(xU,D))},cidrv4(D){return this.check(JU(gU,D))},cidrv6(D){return this.check(XU(fU,D))},e164(D){return this.check(WU(hU,D))},datetime(D){return this.check(w3(G6,D))},date(D){return this.check(Z3(q6,D))},time(D){return this.check(M3(H6,D))},duration(D){return this.check(O3(N6,D))}});AD=j("ZodStringFormat",(D,$)=>{OD.init(D,$),jU.init(D,$)}),G6=j("ZodISODateTime",(D,$)=>{MY.init(D,$),AD.init(D,$)}),q6=j("ZodISODate",(D,$)=>{OY.init(D,$),AD.init(D,$)}),H6=j("ZodISOTime",(D,$)=>{EY.init(D,$),AD.init(D,$)}),N6=j("ZodISODuration",(D,$)=>{vY.init(D,$),AD.init(D,$)}),AU=j("ZodEmail",(D,$)=>{WY.init(D,$),AD.init(D,$)});RU=j("ZodGUID",(D,$)=>{QY.init(D,$),AD.init(D,$)});w0=j("ZodUUID",(D,$)=>{YY.init(D,$),AD.init(D,$)});S3=j("ZodURL",(D,$)=>{GY.init(D,$),AD.init(D,$)});SU=j("ZodEmoji",(D,$)=>{qY.init(D,$),AD.init(D,$)});TU=j("ZodNanoID",(D,$)=>{HY.init(D,$),AD.init(D,$)});bU=j("ZodCUID",(D,$)=>{NY.init(D,$),AD.init(D,$)});PU=j("ZodCUID2",(D,$)=>{zY.init(D,$),AD.init(D,$)});CU=j("ZodULID",(D,$)=>{LY.init(D,$),AD.init(D,$)});uU=j("ZodXID",(D,$)=>{wY.init(D,$),AD.init(D,$)});kU=j("ZodKSUID",(D,$)=>{ZY.init(D,$),AD.init(D,$)});_U=j("ZodIPv4",(D,$)=>{VY.init(D,$),AD.init(D,$)});RG=j("ZodMAC",(D,$)=>{AY.init(D,$),AD.init(D,$)});xU=j("ZodIPv6",(D,$)=>{jY.init(D,$),AD.init(D,$)});gU=j("ZodCIDRv4",(D,$)=>{RY.init(D,$),AD.init(D,$)});fU=j("ZodCIDRv6",(D,$)=>{SY.init(D,$),AD.init(D,$)});yU=j("ZodBase64",(D,$)=>{TY.init(D,$),AD.init(D,$)});mU=j("ZodBase64URL",(D,$)=>{bY.init(D,$),AD.init(D,$)});hU=j("ZodE164",(D,$)=>{PY.init(D,$),AD.init(D,$)});SG=j("ZodCreditCard",(D,$)=>{CY.init(D,$),AD.init(D,$)});TG=j("ZodIBAN",(D,$)=>{uY.init(D,$),AD.init(D,$)});nU=j("ZodJWT",(D,$)=>{kY.init(D,$),AD.init(D,$)});w1=j("ZodCustomStringFormat",(D,$)=>{_Y.init(D,$),AD.init(D,$)});G2=j("ZodNumber",(D,$)=>{b7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>TK(D,U,I,F),D.isFinite=!0},x.derived({minValue:(D)=>{let{minimum:$,exclusiveMinimum:U}=oD(D);return Math.max($??Number.NEGATIVE_INFINITY,U??Number.NEGATIVE_INFINITY)},maxValue:(D)=>{let{maximum:$,exclusiveMaximum:U}=oD(D);return Math.min($??Number.POSITIVE_INFINITY,U??Number.POSITIVE_INFINITY)},isInt:(D)=>{let{isInt:$,multipleOf:U}=oD(D);return!!$||!!U?.some(Number.isSafeInteger)},format:(D)=>oD(D).format??null},{gt(D,$){return this.check(z0(D,$))},gte(D,$){return this.check(f$(D,$))},min(D,$){return this.check(f$(D,$))},lt(D,$){return this.check(N0(D,$))},lte(D,$){return this.check(g$(D,$))},max(D,$){return this.check(g$(D,$))},int(D){return this.check(vU(D))},safe(D){return this.check(vU(D))},positive(D){return this.check(z0(0,D))},nonnegative(D){return this.check(f$(0,D))},negative(D){return this.check(N0(0,D))},nonpositive(D){return this.check(g$(0,D))},multipleOf(D,$){return this.check(Q6(D,$))},step(D,$){return this.check(Q6(D,$))},finite(){return this}}));Z1=j("ZodNumberFormat",(D,$)=>{xY.init(D,$),G2.init(D,$)});q2=j("ZodBoolean",(D,$)=>{I3.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>bK(D,U,I,F)});H2=j("ZodBigInt",(D,$)=>{P7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>PK(D,U,I,F)},x.derived({minValue:(D)=>oD(D).minimum??null,maxValue:(D)=>oD(D).maximum??null,format:(D)=>oD(D).format??null},{gte(D,$){return this.check(f$(D,$))},min(D,$){return this.check(f$(D,$))},gt(D,$){return this.check(z0(D,$))},lt(D,$){return this.check(N0(D,$))},lte(D,$){return this.check(g$(D,$))},max(D,$){return this.check(g$(D,$))},positive(D){return this.check(z0(BigInt(0),D))},negative(D){return this.check(N0(BigInt(0),D))},nonpositive(D){return this.check(g$(BigInt(0),D))},nonnegative(D){return this.check(f$(BigInt(0),D))},multipleOf(D,$){return this.check(Q6(D,$))}}));iU=j("ZodBigIntFormat",(D,$)=>{gY.init(D,$),H2.init(D,$)});CG=j("ZodSymbol",(D,$)=>{fY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>CK(D,U,I,F)});uG=j("ZodUndefined",(D,$)=>{yY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>kK(D,U,I,F)});kG=j("ZodNull",(D,$)=>{mY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>uK(D,U,I,F)});xG=j("ZodAny",(D,$)=>{hY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>gK(D,U,I,F)});gG=j("ZodUnknown",(D,$)=>{nY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>fK(D,U,I,F)});fG=j("ZodNever",(D,$)=>{iY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>xK(D,U,I,F)});yG=j("ZodVoid",(D,$)=>{lY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>_K(D,U,I,F)});T3=j("ZodDate",(D,$)=>{dY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>yK(D,U,I,F),D.min=(U,I)=>D.check(f$(U,I)),D.max=(U,I)=>D.check(g$(U,I))},x.derived({minDate:(D)=>{let{minimum:$}=oD(D);return $?new Date($):null},maxDate:(D)=>{let{maximum:$}=oD(D);return $?new Date($):null}},{}));mG=j("ZodArray",(D,$)=>{L1(),cY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>aK(D,U,I,F),D.element=$.element},{min(D,$){return this.check(P0(D,$))},nonempty(D){return this.check(P0(1,D))},max(D,$){return this.check(G1(D,$))},length(D,$){return this.check(q1(D,$))},unwrap(){return this.element}});P3=j("ZodObject",(D,$)=>{L1(),pY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>sK(D,U,I,F),x.installLazyProp(D,"shape",(U)=>U._zod.def.shape,!1)},{keyof(){return dU(Object.keys(this._zod.def.shape))},catchall(D){return this.clone(x.mergeDefs(this._zod.def,{catchall:D}))},passthrough(){return this.clone(x.mergeDefs(this._zod.def,{catchall:N1()}))},loose(){return this.clone(x.mergeDefs(this._zod.def,{catchall:N1()}))},strict(){return this.clone(x.mergeDefs(this._zod.def,{catchall:lU()}))},strip(){return this.clone(x.mergeDefs(this._zod.def,{catchall:void 0}))},extend(D){return x.extend(this,D)},safeExtend(D){return x.safeExtend(this,D)},merge(D){return x.merge(this,D)},pick(D){return x.pick(this,D)},omit(D){return x.omit(this,D)},partial(...D){return x.partial(u3,this,D[0])},exactPartial(...D){return x.partial(pU,this,D[0],"exactPartial")},required(...D){return x.required(rU,this,D[0])}});C3=j("ZodUnion",(D,$)=>{J3.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>LU(D,U,I,F),D.options=$.options});hG=j("ZodXor",(D,$)=>{C3.init(D,$),rY.init(D,$),D._zod.processJSONSchema=(U,I,F)=>LU(D,U,I,F),D.options=$.options});nG=j("ZodDiscriminatedUnion",(D,$)=>{C3.init(D,$),tY.init(D,$)});iG=j("ZodIntersection",(D,$)=>{aY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>eK(D,U,I,F)});dG=j("ZodTuple",(D,$)=>{L1(),C7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>DG(D,U,I,F)},{rest(D){return this.clone({...this._zod.def,rest:D})},partial(){let D=this._zod.def;if(D.checks?.length)throw Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...D,items:D.items.map(($)=>new u3({type:"optional",innerType:$}))})}});W2=j("ZodRecord",(D,$)=>{L1(),sY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>$G(D,U,I,F),D.keyType=$.keyType,D.valueType=$.valueType});rG=j("ZodMap",(D,$)=>{L1(),eY.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>oK(D,U,I,F),D.keyType=$.keyType,D.valueType=$.valueType,D.min=(...U)=>D.check(L0(...U)),D.nonempty=(U)=>D.check(L0(1,U)),D.max=(...U)=>D.check(Y6(...U)),D.size=(...U)=>D.check(K1(...U))});oG=j("ZodSet",(D,$)=>{L1(),DW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>tK(D,U,I,F),D.min=(...U)=>D.check(L0(...U)),D.nonempty=(U)=>D.check(L0(1,U)),D.max=(...U)=>D.check(Y6(...U)),D.size=(...U)=>D.check(K1(...U))});B2=j("ZodEnum",(D,$)=>{$W.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(I,F,J)=>mK(D,I,F,J),D.enum=$.entries,D.options=[...D._zod.values];let U=new Set(Object.keys($.entries));D.extract=(I,F)=>{let J={};for(let X of I)if(U.has(X))J[X]=$.entries[X];else throw Error(`Key ${X} not found in enum`);return new B2({...$,checks:[],...x.normalizeParams(F),entries:J})},D.exclude=(I,F)=>{let J={...$.entries};for(let X of I)if(U.has(X))delete J[X];else throw Error(`Key ${X} not found in enum`);return new B2({...$,checks:[],...x.normalizeParams(F),entries:J})}});tG=j("ZodLiteral",(D,$)=>{UW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>hK(D,U,I,F),D.values=new Set($.values),Object.defineProperty(D,"value",{get(){if($.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return $.values[0]}})});aG=j("ZodFile",(D,$)=>{FW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>lK(D,U,I,F),D.min=(U,I)=>D.check(L0(U,I)),D.max=(U,I)=>D.check(Y6(U,I)),D.mime=(U,I)=>D.check(D2(Array.isArray(U)?U:[U],I))});sG=j("ZodTransform",(D,$)=>{L1(),IW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>rK(D,U,I,F),D._zod.parse=(U,I)=>{if(I.direction==="backward")throw new F1(D.constructor.name);U.addIssue=(J)=>{if(typeof J==="string")U.issues.push(x.issue(J,U.value,$));else{let X=J;if(X.fatal)X.continue=!1;if(X.code??(X.code="custom"),!("input"in X))X.input=U.value;X.inst??(X.inst=D),U.issues.push(x.issue(X))}};let F=$.transform(U.value,U);if(F instanceof Promise)return F.then((J)=>{return U.value=J,U});return U.value=F,U}});u3=j("ZodOptional",(D,$)=>{u7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>wU(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});pU=j("ZodExactOptional",(D,$)=>{JW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>wU(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Dq=j("ZodNullable",(D,$)=>{XW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>UG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});$q=j("ZodDefault",(D,$)=>{QW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>JG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType,D.removeDefault=D.unwrap});Fq=j("ZodPrefault",(D,$)=>{YW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>XG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});rU=j("ZodNonOptional",(D,$)=>{WW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>FG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Xq=j("ZodSuccess",(D,$)=>{BW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>dK(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Qq=j("ZodCatch",(D,$)=>{KW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>QG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType,D.removeCatch=D.unwrap});Wq=j("ZodNaN",(D,$)=>{GW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>nK(D,U,I,F)});k3=j("ZodPipe",(D,$)=>{k7.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>YG(D,U,I,F),D.in=$.in,D.out=$.out});_3=j("ZodCodec",(D,$)=>{k3.init(D,$),X3.init(D,$)});Bq=j("ZodPreprocess",(D,$)=>{k3.init(D,$),qW.init(D,$)}),Kq=j("ZodReadonly",(D,$)=>{HW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>WG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});qq=j("ZodTemplateLiteral",(D,$)=>{NW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>iK(D,U,I,F)});Hq=j("ZodLazy",(D,$)=>{Q3.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>KG(D,U,I,F),D.unwrap=()=>D._zod.def.getter()});zq=j("ZodPromise",(D,$)=>{LW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>BG(D,U,I,F),D.unwrap=()=>D._zod.def.innerType});Lq=j("ZodFunction",(D,$)=>{zW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>pK(D,U,I,F)});x3=j("ZodCustom",(D,$)=>{wW.init(D,$),WD.init(D,$),D._zod.processJSONSchema=(U,I,F)=>cK(D,U,I,F)});fb=OK,yb=EK,Mq=j("ZodInstanceOf",(D,$)=>{x3.init(D,$)},{properties(D,$){return this.check(e4(D,$))}})});function x0D(D){nD({customError:D})}function g0D(){return nD().customError}var _0D,Oq;var lb=T(()=>{y$();_0D={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(D){})(Oq||(Oq={}))});var g3={};X$(g3,{time:()=>m0D,duration:()=>h0D,datetime:()=>f0D,date:()=>y0D,ZodISOTime:()=>H6,ZodISODuration:()=>N6,ZodISODateTime:()=>G6,ZodISODate:()=>q6});function f0D(D){return w3(G6,D)}function y0D(D){return Z3(q6,D)}function m0D(D){return M3(H6,D)}function h0D(D){return O3(N6,D)}var oU=T(()=>{y$();z6();z6()});function i0D(D,$){let U=D.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return $??"draft-2020-12"}function db(D,$){return D.map((U,I)=>I<$?U:U.optional())}function l0D(D){return D.replace(/~1/g,"/").replace(/~0/g,"~")}function d0D(D,$){if(!D.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=D.slice(1).split("/").filter(Boolean);if(U.length===0)return $.rootSchema;let I=$.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===I){let F=U[1]===void 0?void 0:l0D(U[1]);if(!F||!$.defs[F])throw Error(`Reference not found: ${D}`);return $.defs[F]}throw Error(`Reference not found: ${D}`)}function c0D(D,$){return r.transform((I)=>I).check((I)=>{let F=I.value;if(typeof F!=="object"||F===null||Array.isArray(F))return;let J=Object.getOwnPropertyNames(F);if($.minProperties!==void 0&&J.length<$.minProperties)I.issues.push({origin:"object",code:"too_small",minimum:$.minProperties,inclusive:!0,message:`Too small: expected object to have >=${$.minProperties} properties`,input:F,inst:D,continue:!0});if($.maxProperties!==void 0&&J.length>$.maxProperties)I.issues.push({origin:"object",code:"too_big",maximum:$.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${$.maxProperties} properties`,input:F,inst:D,continue:!0});if($.keySchema)for(let X of J){let Q=$.keySchema.safeParse(X);if(Q.success)continue;I.issues.push({code:"invalid_key",origin:"record",issues:Q.error.issues,input:X,path:[X],continue:!0})}}).pipe(D)}function Eq(D,$){if(D===null)return"z";let U=typeof D;if(U!=="object"){if(U==="number"&&Number.isNaN(D))return null;let I=String(D);return`${U[0]}${I.length}:${I}`}if($.has(D))return null;$.add(D);try{if(Array.isArray(D)){let J=[];for(let X of D){let Q=Eq(X,$);if(Q===null)return null;J.push(Q)}return`a${J.length}:[${J.join(",")}]`}let I=Object.keys(D).sort(),F=[];for(let J of I){let X=Eq(D[J],$);if(X===null)return null;F.push(`${J.length}:${J}=${X}`)}return`o${F.length}:{${F.join(",")}}`}finally{$.delete(D)}}function f3(D){if(typeof D!=="object"||D===null)return!1;if(Array.isArray(D))return D.some(f3);if(typeof D.$ref==="string")return!0;return Object.entries(D).some(([$,U])=>{if(p0D.has($))return f3(U);if(!r0D.has($)||typeof U!=="object"||U===null)return!1;return Object.values(U).some(f3)})}function cb(D){return D===1?"element":"elements"}function o0D(D,$){return r.transform((I)=>I).check((I)=>{let F=I.value;if(!Array.isArray(F))return;if($.uniqueItems===!0){let J=new Map;for(let X=0;X<F.length;X++){let Q=Eq(F[X],new Set);if(Q===null)continue;let Y=J.get(Q);if(Y===void 0){J.set(Q,X);continue}I.issues.push({code:"custom",message:`Array items must be unique: element at index ${X} duplicates the one at index ${Y}`,input:F,path:[X],continue:!0})}}if($.containsSchema){let J=$.minContains??1,X=$.maxContains!==void 0?$.maxContains+1:Number.POSITIVE_INFINITY,Q=0;for(let Y of F)if($.containsSchema.safeParse(Y).success&&++Q>=X)break;if(Q<J)I.issues.push({code:"custom",message:`Array must contain at least ${J} matching ${cb(J)}; found ${Q}`,input:F,continue:!0});if($.maxContains!==void 0&&Q>$.maxContains)I.issues.push({code:"custom",message:`Array must contain at most ${$.maxContains} matching ${cb($.maxContains)}`,input:F,continue:!0})}}).pipe(D)}function pb(D,$){if(D===!1)return;if(D===void 0||D===!0)return r.any();return v$(D,$)}function rb(D,$){if(D.not!==void 0){if(typeof D.not==="object"&&Object.keys(D.not).length===0)return r.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(D.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(D.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(D.if!==void 0||D.then!==void 0||D.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(D.dependentSchemas!==void 0||D.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(D.$ref){let F=D.$ref;if($.refs.has(F))return $.refs.get(F);if($.processing.has(F))return r.lazy(()=>{if(!$.refs.has(F))throw Error(`Circular reference not resolved: ${F}`);return $.refs.get(F)});$.processing.add(F);let J=d0D(F,$),X=v$(J,$);return $.refs.set(F,X),$.processing.delete(F),X}if(D.enum!==void 0){let F=D.enum;if($.version==="openapi-3.0"&&D.nullable===!0&&F.length===1&&F[0]===null)return r.null();if(F.length===0)return r.never();if(F.length===1)return r.literal(F[0]);if(F.every((X)=>typeof X==="string"))return r.enum(F);let J=F.map((X)=>r.literal(X));if(J.length<2)return J[0];return r.union([J[0],J[1],...J.slice(2)])}if(D.const!==void 0)return r.literal(D.const);let U=D.type;if(Array.isArray(U)){let F=U.map((J)=>{let X={...D,type:J};return rb(X,$)});if(F.length===0)return r.never();if(F.length===1)return F[0];return r.union(F)}if(!U)return r.any();let I;switch(U){case"string":{let F=r.string();if(D.format){let J=D.format;if(J==="email")F=F.check(r.email());else if(J==="uri"||J==="uri-reference")F=F.check(r.url());else if(J==="uuid"||J==="guid")F=F.check(r.uuid());else if(J==="date-time")F=F.check(r.iso.datetime({offset:!0}));else if(J==="date")F=F.check(r.iso.date());else if(J==="time")F=F.check(r.regex(t0D));else if(J==="duration")F=F.check(r.iso.duration());else if(J==="hostname")F=F.check(r.hostname());else if(J==="ipv4")F=F.check(r.ipv4());else if(J==="ipv6")F=F.check(r.ipv6());else if(J==="mac")F=F.check(r.mac());else if(J==="cidr")F=F.check(r.cidrv4());else if(J==="cidr-v6")F=F.check(r.cidrv6());else if(J==="base64")F=F.check(r.base64());else if(J==="base64url")F=F.check(r.base64url());else if(J==="e164")F=F.check(r.e164());else if(J==="credit_card")F=F.check(r.creditCard());else if(J==="iban")F=F.check(r.iban());else if(J==="jwt")F=F.check(r.jwt());else if(J==="emoji")F=F.check(r.emoji());else if(J==="nanoid")F=F.check(r.nanoid());else if(J==="cuid")F=F.check(r.cuid());else if(J==="cuid2")F=F.check(r.cuid2());else if(J==="ulid")F=F.check(r.ulid());else if(J==="xid")F=F.check(r.xid());else if(J==="ksuid")F=F.check(r.ksuid())}if(typeof D.minLength==="number")F=F.min(D.minLength);if(typeof D.maxLength==="number")F=F.max(D.maxLength);if(D.pattern)F=F.regex(new RegExp(D.pattern));I=F;break}case"number":case"integer":{let F=U==="integer"?r.number().int():r.number();if(typeof D.minimum==="number"&&D.exclusiveMinimum!==!0)F=F.min(D.minimum);if(typeof D.maximum==="number"&&D.exclusiveMaximum!==!0)F=F.max(D.maximum);if(typeof D.exclusiveMinimum==="number")F=F.gt(D.exclusiveMinimum);else if(D.exclusiveMinimum===!0&&typeof D.minimum==="number")F=F.gt(D.minimum);if(typeof D.exclusiveMaximum==="number")F=F.lt(D.exclusiveMaximum);else if(D.exclusiveMaximum===!0&&typeof D.maximum==="number")F=F.lt(D.maximum);if(typeof D.multipleOf==="number")F=F.multipleOf(D.multipleOf);I=F;break}case"boolean":{I=r.boolean();break}case"null":{I=r.null();break}case"object":{let F={},J=D.properties||{},X=new Set(D.required||[]),Q=typeof D.additionalProperties==="object"?v$(D.additionalProperties,$):void 0;for(let[K,q]of Object.entries(J)){let H=v$(q,$);I$(F,K,X.has(K)?H:H.optional())}if(D.patternProperties){let K=D.patternProperties,q=Object.keys(K),H=[];for(let z of q){let N=v$(K[z],$),M=r.string().regex(new RegExp(z));H.push(r.looseRecord(M,N))}let G=[];if(Object.keys(F).length>0)G.push(r.object(F).passthrough());if(G.push(...H),G.length===0)I=r.object({}).passthrough();else if(G.length===1)I=G[0];else{let z=r.intersection(G[0],G[1]);for(let N=2;N<G.length;N++)z=r.intersection(z,G[N]);I=z}if(D.additionalProperties===!1){let z=Object.keys(F),N=q.map((Z)=>new RegExp(Z)),M=I;I=I.check((Z)=>{if(!p$(Z.value))return;let L=[];for(let v of Object.keys(Z.value)){if(z.includes(v))continue;if(N.some((A)=>A.test(v)))continue;L.push(v)}if(L.length)Z.issues.push({code:"unrecognized_keys",keys:L,input:Z.value,inst:M})})}}else{let K=r.object(F);if(D.additionalProperties===!1)I=K.strict();else if(Q)I=K.catchall(Q);else I=K.passthrough()}let Y=D.propertyNames!==void 0&&D.propertyNames!==!0,W=typeof D.minProperties==="number"?D.minProperties:void 0,B=typeof D.maxProperties==="number"?D.maxProperties:void 0;if(Y||W!==void 0||B!==void 0){let K;if(Y){let q=typeof D.propertyNames==="object"&&D.propertyNames.type===void 0?{type:"string",...D.propertyNames}:D.propertyNames;K=v$(q,$)}I=c0D(I,{keySchema:K,minProperties:W,maxProperties:B})}break}case"array":{let{prefixItems:F,items:J}=D;if(F&&Array.isArray(F)){let X=typeof D.minItems==="number"?D.minItems:0,Q=F.map((K)=>v$(K,$)),Y=db(Q,X),W=!Array.isArray(J)?pb(J,$):void 0,B=r.tuple(Y);if(I=W?B.rest(W):B,typeof D.minItems==="number")I=I.check(r.minLength(D.minItems));if(typeof D.maxItems==="number")I=I.check(r.maxLength(D.maxItems))}else if(Array.isArray(J)){let X=typeof D.minItems==="number"?D.minItems:0,Q=J.map((K)=>v$(K,$)),Y=db(Q,X),W=pb(D.additionalItems,$),B=r.tuple(Y);if(I=W?B.rest(W):B,typeof D.minItems==="number")I=I.check(r.minLength(D.minItems));if(typeof D.maxItems==="number")I=I.check(r.maxLength(D.maxItems))}else if(J!==void 0){let X=v$(J,$),Q=r.array(X);if(typeof D.minItems==="number")Q=Q.min(D.minItems);if(typeof D.maxItems==="number")Q=Q.max(D.maxItems);I=Q}else I=r.array(r.any());if(D.uniqueItems===!0||D.contains!==void 0)I=o0D(I,{uniqueItems:D.uniqueItems===!0,containsSchema:D.contains!==void 0?v$(D.contains,$):void 0,minContains:typeof D.minContains==="number"?D.minContains:void 0,maxContains:typeof D.maxContains==="number"?D.maxContains:void 0});break}default:throw Error(`Unsupported type: ${U}`)}return I}function v$(D,$){if(typeof D==="boolean")return D?r.any():r.never();let U=rb(D,$),I=D.type||D.enum!==void 0||D.const!==void 0;if(D.anyOf&&Array.isArray(D.anyOf)){let Q=D.anyOf.map((W)=>v$(W,$)),Y=r.union(Q);U=I?r.intersection(U,Y):Y}if(D.oneOf&&Array.isArray(D.oneOf)){let Q=D.oneOf.map((W)=>v$(W,$)),Y=r.xor(Q);U=I?r.intersection(U,Y):Y}if(D.allOf&&Array.isArray(D.allOf))if(D.allOf.length===0)U=I?U:r.any();else{let Q=I?U:v$(D.allOf[0],$),Y=I?0:1;for(let W=Y;W<D.allOf.length;W++)Q=r.intersection(Q,v$(D.allOf[W],$));U=Q}if(D.nullable===!0&&$.version==="openapi-3.0")U=r.nullable(U);if(D.readOnly===!0)U=r.readonly(U);if(D.default!==void 0)U=U.default(D.default);let F={},J=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let Q of J)if(Q in D)F[Q]=D[Q];let X=["contentEncoding","contentMediaType","contentSchema"];for(let Q of X)if(Q in D)F[Q]=D[Q];if(D.type==="object"&&D.$ref===void 0){if(D.propertyNames!==void 0&&!f3(D.propertyNames))F.propertyNames=D.propertyNames;for(let Q of["minProperties","maxProperties"])if(D[Q]!==void 0)F[Q]=D[Q]}if(D.type==="array"&&D.$ref===void 0){if(D.contains!==void 0&&!f3(D.contains))F.contains=D.contains;for(let Q of["uniqueItems","minContains","maxContains"])if(D[Q]!==void 0)F[Q]=D[Q]}for(let Q of Object.keys(D))if(!n0D.has(Q))I$(F,Q,D[Q]);if(Object.keys(F).length>0)$.registry.add(U,F);if(D.description)U=U.describe(D.description);return U}function ob(D,$){if(typeof D==="boolean")return D?r.any():r.never();let U;try{U=JSON.parse(JSON.stringify(D))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let I=i0D(U,$?.defaultTarget),F=U.$defs||U.definitions||{},J={version:I,defs:F,refs:new Map,processing:new Set,rootSchema:U,registry:$?.registry??J$};return v$(U,J)}var r,n0D,p0D,r0D,t0D;var tb=T(()=>{z3();c();OU();oU();z6();r={...z2,...MU,iso:g3},n0D=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);p0D=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),r0D=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);t0D=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function y3(D,$){let U=typeof $==="function"?$:(X,Q)=>{let Y=$[X._zod.def.type];return Y?Y(X,Q):X},I=new Map;function F(X){let Q=I.get(X);if(Q===ab)return new Q3({type:"lazy",getter:()=>I.get(X)});if(Q!==void 0)return Q;I.set(X,ab);let Y=J(X),W=U(Y,Y!==X);return I.set(X,W),W}function J(X){let Q=X._zod.def,Y=Q.type;switch(Y){case"object":{let W=Q.shape,B=Object.keys(W),K=!1,q={};for(let G of B){let z=F(W[G]);if(z!==W[G])K=!0;q[G]=z}let H=Q.catchall;if(Q.catchall){if(H=F(Q.catchall),H!==Q.catchall)K=!0}return K?MD(X,{...Q,shape:q,catchall:H}):X}case"array":{let W=F(Q.element);return W===Q.element?X:MD(X,{...Q,element:W})}case"tuple":{let W=Q.items,B=!1,K=[];for(let H of W){let G=F(H);if(G!==H)B=!0;K.push(G)}let q=Q.rest;if(Q.rest){if(q=F(Q.rest),q!==Q.rest)B=!0}return B?MD(X,{...Q,items:K,rest:q}):X}case"record":case"map":{let W=F(Q.keyType),B=F(Q.valueType);return W===Q.keyType&&B===Q.valueType?X:MD(X,{...Q,keyType:W,valueType:B})}case"set":{let W=F(Q.valueType);return W===Q.valueType?X:MD(X,{...Q,valueType:W})}case"union":{let W=Q.options,B=!1,K=[];for(let q of W){let H=F(q);if(H!==q)B=!0;K.push(H)}return B?MD(X,{...Q,options:K}):X}case"intersection":{let W=F(Q.left),B=F(Q.right);return W===Q.left&&B===Q.right?X:MD(X,{...Q,left:W,right:B})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let W=F(Q.innerType);return W===Q.innerType?X:MD(X,{...Q,innerType:W})}case"pipe":{let W=F(Q.in),B=F(Q.out);return W===Q.in&&B===Q.out?X:MD(X,{...Q,in:W,out:B})}case"function":{let W=F(Q.input),B=F(Q.output);return W===Q.input&&B===Q.output?X:MD(X,{...Q,input:W,output:B})}case"lazy":{let W=Q.getter,{_cachedInner:B,...K}=Q;return MD(X,{...K,getter:()=>F(W())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return X;default:return X}}return F(D)}var ab;var vq=T(()=>{i4();c();ab=Symbol("z.visit/resolving")});function sb(D){return y3(D,{object:($)=>$.partial(),union:($)=>{let U=$._zod.def;return U.discriminator===void 0?$:N2(U.options)}})}var eb=T(()=>{vq();z6()});function a0D(D,$){if(!$?.length)return D;let U=D._zod.def;return MD(D,F0(U,{checks:[...U.checks??[],...$]}),{parent:!0})}function DP(D){return a0D(D.out,D.checks)}function s0D(D){return D.in._zod.traits.has("$ZodTransform")?DP(D):D.in}function $P(D){return y3(D,{pipe:($)=>s0D($._zod.def),default:($,U)=>U?z1($._zod.def.innerType):$,catch:($,U)=>U?$._zod.def.innerType:$})}function UP(D){return y3(D,{pipe:($)=>DP($._zod.def),prefault:($,U)=>U?$._zod.def.innerType:$})}var FP=T(()=>{c();vq();z6()});var Vq={};X$(Vq,{string:()=>e0D,number:()=>D6D,date:()=>F6D,boolean:()=>$6D,bigint:()=>U6D});function e0D(D){return nB(K2,D)}function D6D(D){return rB(G2,D)}function $6D(D){return $K(q2,D)}function U6D(D){return FK(H2,D)}function F6D(D){return HK(T3,D)}var IP=T(()=>{y$();z6()});var zD={};X$(zD,{xor:()=>Zb,xid:()=>yT,withParser:()=>h7,void:()=>qb,validateAsync:()=>r8,validate:()=>p8,uuidv7:()=>PT,uuidv6:()=>bT,uuidv4:()=>TT,uuid:()=>ST,util:()=>x,url:()=>CT,uppercase:()=>o4,unknown:()=>N1,union:()=>N2,undefined:()=>Kb,ulid:()=>fT,uint64:()=>Wb,uint32:()=>Xb,tuple:()=>cG,trim:()=>U2,treeifyError:()=>sX,transform:()=>cU,toZod:()=>x8,toUpperCase:()=>I2,toLowerCase:()=>F2,toJSONSchema:()=>ZU,templateLiteral:()=>ub,symbol:()=>Bb,superRefine:()=>Zq,success:()=>Tb,stringbool:()=>hb,stringFormat:()=>sT,string:()=>A3,strictObject:()=>Lb,startsWith:()=>a4,slugify:()=>J2,size:()=>K1,setErrorMap:()=>x0D,set:()=>Vb,safeParseAsync:()=>LG,safeParse:()=>zG,safeEncodeAsync:()=>VG,safeEncode:()=>EG,safeDecodeAsync:()=>jG,safeDecode:()=>vG,registry:()=>m7,regexes:()=>o$,regex:()=>p4,refine:()=>wq,record:()=>pG,readonly:()=>Gq,property:()=>NU,properties:()=>e4,promise:()=>kb,prettifyError:()=>eX,preprocess:()=>ib,prefault:()=>Iq,positive:()=>KU,pipe:()=>VU,partialRecord:()=>Ob,parseAsync:()=>NG,parse:()=>HG,overwrite:()=>I0,output:()=>UP,optional:()=>z1,object:()=>zb,number:()=>bG,nullish:()=>Sb,nullable:()=>R3,null:()=>_G,normalize:()=>$2,nonpositive:()=>qU,nonoptional:()=>Jq,nonnegative:()=>HU,never:()=>lU,negative:()=>GU,nativeEnum:()=>jb,nanoid:()=>_T,nan:()=>bb,multipleOf:()=>Q6,minSize:()=>L0,minLength:()=>P0,mime:()=>D2,meta:()=>yb,memoizer:()=>B3,maxSize:()=>Y6,maxLength:()=>G1,map:()=>vb,mac:()=>nT,lte:()=>g$,lt:()=>N0,lowercase:()=>r4,looseRecord:()=>Eb,looseObject:()=>wb,locales:()=>N3,literal:()=>Ab,length:()=>q1,lazy:()=>Nq,ksuid:()=>mT,keyof:()=>Nb,jwt:()=>aT,json:()=>nb,iso:()=>g3,ipv6:()=>iT,ipv4:()=>hT,invertCodec:()=>Cb,intersection:()=>lG,int64:()=>Yb,int32:()=>Jb,int:()=>vU,instanceof:()=>mb,input:()=>$P,includes:()=>t4,iban:()=>tT,httpUrl:()=>uT,hostname:()=>eT,hex:()=>Db,hash:()=>Ub,guid:()=>RT,gte:()=>f$,gt:()=>z0,globalRegistry:()=>J$,getErrorMap:()=>g0D,getDiscriminatedOption:()=>oY,function:()=>_b,fromJSONSchema:()=>ob,formatError:()=>c8,float64:()=>Ib,float32:()=>Fb,flattenError:()=>d8,file:()=>Rb,exactOptional:()=>eG,enum:()=>dU,endsWith:()=>s4,encodeAsync:()=>MG,encode:()=>wG,emoji:()=>kT,email:()=>AT,e164:()=>rT,discriminatedUnion:()=>Mb,describe:()=>fb,deepPartial:()=>sb,decodeAsync:()=>OG,decode:()=>ZG,date:()=>Hb,custom:()=>gb,currencyCode:()=>$b,cuid2:()=>gT,cuid:()=>xT,creditCard:()=>oT,core:()=>C0,config:()=>nD,compile:()=>yB,coerce:()=>Vq,codec:()=>Pb,clone:()=>MD,cidrv6:()=>dT,cidrv4:()=>lT,check:()=>xb,catch:()=>Yq,boolean:()=>PG,bigint:()=>Qb,base64url:()=>pT,base64:()=>cT,array:()=>b3,any:()=>Gb,_function:()=>_b,_default:()=>Uq,_ZodString:()=>jU,ZodXor:()=>hG,ZodXID:()=>uU,ZodVoid:()=>yG,ZodUnknown:()=>gG,ZodUnion:()=>C3,ZodUndefined:()=>uG,ZodUUID:()=>w0,ZodURL:()=>S3,ZodULID:()=>CU,ZodType:()=>WD,ZodTuple:()=>dG,ZodTransform:()=>sG,ZodTemplateLiteral:()=>qq,ZodSymbol:()=>CG,ZodSuccess:()=>Xq,ZodStringFormat:()=>AD,ZodString:()=>K2,ZodSet:()=>oG,ZodRecord:()=>W2,ZodRealError:()=>P$,ZodReadonly:()=>Kq,ZodPromise:()=>zq,ZodPreprocess:()=>Bq,ZodPrefault:()=>Fq,ZodPipe:()=>k3,ZodOptional:()=>u3,ZodObject:()=>P3,ZodNumberFormat:()=>Z1,ZodNumber:()=>G2,ZodNullable:()=>Dq,ZodNull:()=>kG,ZodNonOptional:()=>rU,ZodNever:()=>fG,ZodNanoID:()=>TU,ZodNaN:()=>Wq,ZodMap:()=>rG,ZodMAC:()=>RG,ZodLiteral:()=>tG,ZodLazy:()=>Hq,ZodKSUID:()=>kU,ZodJWT:()=>nU,ZodIssueCode:()=>_0D,ZodIntersection:()=>iG,ZodInstanceOf:()=>Mq,ZodISOTime:()=>H6,ZodISODuration:()=>N6,ZodISODateTime:()=>G6,ZodISODate:()=>q6,ZodIPv6:()=>xU,ZodIPv4:()=>_U,ZodIBAN:()=>TG,ZodGUID:()=>RU,ZodFunction:()=>Lq,ZodFirstPartyTypeKind:()=>Oq,ZodFile:()=>aG,ZodExactOptional:()=>pU,ZodError:()=>C0D,ZodEnum:()=>B2,ZodEmoji:()=>SU,ZodEmail:()=>AU,ZodE164:()=>hU,ZodDiscriminatedUnion:()=>nG,ZodDefault:()=>$q,ZodDate:()=>T3,ZodCustomStringFormat:()=>w1,ZodCustom:()=>x3,ZodCreditCard:()=>SG,ZodCompileUnsupportedError:()=>ND,ZodCompileAsyncError:()=>H0,ZodCodec:()=>_3,ZodCatch:()=>Qq,ZodCUID2:()=>PU,ZodCUID:()=>bU,ZodCIDRv6:()=>fU,ZodCIDRv4:()=>gU,ZodBoolean:()=>q2,ZodBigIntFormat:()=>iU,ZodBigInt:()=>H2,ZodBase64URL:()=>mU,ZodBase64:()=>yU,ZodArray:()=>mG,ZodAny:()=>xG,TimePrecision:()=>cB,NEVER:()=>pX,INVALID:()=>O$,$output:()=>uB,$input:()=>kB,$brand:()=>rX});var jq=T(()=>{y$();y$();j3();tb();eb();FP();CB();oU();oU();IP();z6();OU();qG();AG();lb()});var JP=T(()=>{jq();jq()});function FQD(D,$,U){let I=U.filter((J)=>D[J]===!0);if(I.length<2)return;let F=String(I[0]);for(let J of I.slice(1))$.addIssue({code:"custom",message:`not used together with "${F}"`,path:[J]})}var XP,I6D,IQD,JQD,XQD,QQD;var QP=T(()=>{JP();XP=zD.object({name:zD.string().min(1),version:zD.string().min(1),requested_version:zD.string().optional(),ios_checksum:zD.string().optional(),android_checksum:zD.string().optional()}),I6D=zD.enum(["new_plugin","removed_plugin","version_mismatch","requested_version_changed","ios_code_changed","android_code_changed","both_platforms_changed","platform_checksum_metadata_changed"]),IQD=zD.object({name:zD.string(),localVersion:zD.string().optional(),remoteVersion:zD.string().optional(),localRequestedVersion:zD.string().optional(),remoteRequestedVersion:zD.string().optional(),localIosChecksum:zD.string().optional(),remoteIosChecksum:zD.string().optional(),localAndroidChecksum:zD.string().optional(),remoteAndroidChecksum:zD.string().optional()}),JQD=zD.object({compatible:zD.boolean(),reasons:I6D.array(),message:zD.string()}),XQD=zD.object({isSecurityPolicyError:zD.boolean(),errorCode:zD.string(),message:zD.string()}),QQD=zD.record(zD.string(),zD.string()).transform((D,$)=>{if(D===null||typeof D!=="object"||Array.isArray(D)||Object.getPrototypeOf(D)!==Object.prototype)return $.addIssue({code:"custom",message:"a plain object of locale keys to release notes"}),zD.NEVER;let U=Object.create(null);for(let[I,F]of Object.entries(D)){let J=I.trim(),X=F.trim();if(!J)return $.addIssue({code:"custom",message:"a non-empty locale key"}),zD.NEVER;if(!X)return $.addIssue({code:"custom",message:"a non-empty release note"}),zD.NEVER;if(Object.hasOwn(U,J))return $.addIssue({code:"custom",message:`a unique locale key (duplicate after trim: "${J}")`}),zD.NEVER;U[J]=X}return U})});function J6D(D){if(typeof D?.then==="function")throw TypeError("Expected synchronous schema validation result");return D}function Aq(D,$){let U=J6D(D["~standard"].validate($));if(U.issues)return{success:!1,error:new YP(U.issues)};return{success:!0,data:U.value}}function WQD(D,$){let U=Aq(D,$);if(!U.success)throw U.error;return U.data}var YP;var WP=T(()=>{YP=class YP extends Error{issues;constructor(D){super(D.map(($)=>$.message).join("; ")||"Schema validation failed");this.name="SchemaError",this.issues=D}}});function BP(D){let $=D;if(typeof $.status==="number")return $.status;let U=$.context&&typeof $.context==="object"?$.context.status:void 0;return typeof U==="number"?U:void 0}function X6D(D){if(!D||typeof D!=="object")return;let $=BP(D);if($!==void 0)return $;let U=D.cause;if(U&&typeof U==="object")return BP(U);return}function Q6D(D){let $=[],U=new Set,I=D;if(typeof D==="string")return D;while(I){if(typeof I==="string"){$.push(I);break}if(typeof I!=="object")break;if(U.has(I))break;if(U.add(I),I instanceof Error){$.push(I.message),I=I.cause;continue}let F=I;if(typeof F.message==="string")$.push(F.message);I=F.cause}return $.join(" ")}function Y6D(D){return Q6D(D)}function KP(D){if(D&&typeof D==="object"&&"code"in D){let I=D.code;if(typeof I==="string"&&I.startsWith("commander."))return"commander"}let $=X6D(D);if($!==void 0){if($===401)return"unauthorized";if($===403)return"forbidden";if($===404)return"not_found";if($===413)return"payload_too_large";if($===429)return"rate_limited";if($>=500)return"server_error"}let U=Y6D(D).toLowerCase();if(/econnrefused|econnreset|enotfound|eai_again|fetch failed|failed to fetch|connect timeout|und_err/.test(U))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(U))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(U))return"validation_error";return"unknown"}function KQD(D){if(D===401)return"unauthorized";if(D===403)return"forbidden";if(D===404)return"not_found";if(D===408||D===504)return"timeout";if(D===413)return"payload_too_large";if(D===429)return"rate_limited";if(D===400||D===422)return"validation_error";if(D>=500)return"server_error";return"unknown"}function L2(D){let $=KP(D);return $==="network_error"||$==="timeout"}var Rq=()=>{};function G6D(D){return new Promise(($)=>setTimeout($,D))}async function qP(D){let $={data:null,error:null};for(let U=1;U<=GP;U++){if($=await D(),!$.error)return $;if(!L2($.error))return $;if(U<GP)await G6D(K6D[U-1]??1000)}return $}async function HP(D){if(!D.silent)vD.warn(B6D);let $=new Sq;if(cA($))await pA({error:$,functionName:D.telemetryFunctionName,kind:"unhandled_error",status:0})}function NP(D){if(L2(D))throw new Sq;let $=D.message??"unknown error";throw Error(`Cannot check 2FA compliance: ${$}`)}var W6D="Cannot reach Capgo to verify 2FA compliance. Check your network connection and try again.",B6D="Could not verify 2FA compliance due to a network error. Continuing — Capgo will still enforce 2FA on this action if required.",GP=3,K6D,Sq;var zP=T(()=>{y0();xX();Rq();K6D=[500,1000];Sq=class Sq extends Error{constructor(D=W6D){super(D);this.name="TwoFactorComplianceNetworkError"}}});function tU(D){let $=D.replace(q6D,"[REDACTED PRIVATE KEY]");for(let{re:U,replace:I}of H6D)$=$.replace(U,I);return $}var q6D,H6D;var LP=T(()=>{q6D=/-----BEGIN [^-]+-----[\s\S]*?-----END [^-]+-----/g,H6D=[{re:/(authorization\s*:\s*bearer\s+)[\w.\-+/=]+/gi,replace:"$1[REDACTED]"},{re:/\bcapg_[A-Za-z0-9]{8,}\b/g,replace:"[REDACTED]"},{re:/(capgkey\s*[=:]\s*)[\w-]{6,}/gi,replace:"$1[REDACTED]"},{re:/\b(api[_-]?key|secret|token|password|passwd|pwd)(\s*[=:]\s*)["']?[\w.\-+/=]{6,}["']?/gi,replace:"$1$2[REDACTED]"},{re:/("(?:access_token|refresh_token|id_token|client_secret|private[_-]?key|apple_key_content|api[_-]?key|token|secret|password|p8|pem)"\s*:\s*")[^"]+(")/gi,replace:"$1[REDACTED]$2"}]});function N6D(D){return Object.values(aU).includes(D)}function Tq(D){let $="",U="";if(typeof D==="string")$=D,U=D;else if(D&&typeof D==="object"){let I=D;$=String(I.error||I.code||I.errorCode||""),U=String(I.message||I.error||"")}if(N6D($))return{isSecurityPolicyError:!0,errorCode:$,message:wP[$]||U};for(let[I,F]of Object.entries(wP))if(U.includes(I))return{isSecurityPolicyError:!0,errorCode:I,message:F};return{isSecurityPolicyError:!1,errorCode:$,message:U}}function ZP(D){let $=Tq(D);if($.isSecurityPolicyError)return`
|
|
224
224
|
❌ Security Policy Error: ${$.errorCode}
|
|
225
225
|
|
|
226
226
|
${$.message}
|
|
@@ -243,24 +243,24 @@ Please generate a new API key with a shorter expiration:
|
|
|
243
243
|
2. Create a new API key with a valid expiration date
|
|
244
244
|
3. Update your CLI configuration with: capgo login [new-key]
|
|
245
245
|
4. Try this command again`}});import OP from"node:fs";function z6D(){try{return OP.statSync("/.dockerenv"),!0}catch{return!1}}function L6D(){try{return OP.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Pq(){if(bq===void 0)bq=z6D()||L6D();return bq}var bq;var EP=()=>{};import w6D from"node:fs";function M1(){if(Cq===void 0)Cq=Z6D()||Pq();return Cq}var Cq,Z6D=()=>{try{return w6D.statSync("/run/.containerenv"),!0}catch{return!1}};var uq=T(()=>{EP()});import VP from"node:process";import M6D from"node:os";import kq from"node:fs";var vP=()=>{if(VP.platform!=="linux")return!1;if(M6D.release().toLowerCase().includes("microsoft")){if(M1())return!1;return!0}try{if(kq.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!M1()}catch{}if(kq.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||kq.existsSync("/run/WSL"))return!M1();return!1},u0;var _q=T(()=>{uq();u0=VP.env.__IS_WSL_TEST__?vP:vP()});import jP from"node:process";import{Buffer as O6D}from"node:buffer";import{promisify as E6D}from"node:util";import v6D from"node:child_process";var V6D,xq=()=>`${jP.env.SYSTEMROOT||jP.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,m$=async(D,$={})=>{let{powerShellPath:U,...I}=$,F=m$.encodeCommand(D);return V6D(U??xq(),[...m$.argumentsPrefix,F],{encoding:"utf8",...I})};var gq=T(()=>{V6D=E6D(v6D.execFile);m$.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];m$.encodeCommand=(D)=>O6D.from(D,"utf16le").toString("base64");m$.escapeArgument=(D)=>`'${String(D).replaceAll("'","''")}'`});function AP(D){for(let $ of D.split(`
|
|
246
|
-
`)){if(/^\s*#/.test($))continue;let U=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec($);if(!U)continue;return U.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}import{promisify as j6D}from"node:util";import A6D from"node:child_process";import fq,{constants as SP}from"node:fs/promises";var R6D,S6D,T6D=async()=>{return`${await S6D()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},sU,RP,TP=async()=>{return RP??=(async()=>{try{let D=await sU();return await fq.access(D,SP.X_OK),!0}catch{return!1}})(),RP},bP=async()=>{let D=await sU(),$=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:U}=await m$($,{powerShellPath:D});return U.trim()},PP=async(D)=>{if(/^[a-z]+:\/\//i.test(D))return D;try{let{stdout:$}=await R6D("wslpath",["-aw",D],{encoding:"utf8"});return $.trim()}catch{return D}};var CP=T(()=>{_q();gq();_q();R6D=j6D(A6D.execFile),S6D=(()=>{let $;return async function(){if($)return $;let U="/etc/wsl.conf",I=!1;try{await fq.access(U,SP.F_OK),I=!0}catch{}if(!I)return"/mnt/";let F=await fq.readFile(U,{encoding:"utf8"}),J=AP(F);if(J===void 0)return"/mnt/";return $=J,$=$.endsWith("/")?$:`${$}/`,$}})(),sU=u0?T6D:xq});function O1(D,$,U){let I=(F)=>Object.defineProperty(D,$,{value:F,enumerable:!0,writable:!0});return Object.defineProperty(D,$,{configurable:!0,enumerable:!0,get(){let F=U();return I(F),F},set(F){I(F)}}),D}import{promisify as b6D}from"node:util";import P6D from"node:process";import{execFile as C6D}from"node:child_process";async function yq(){if(P6D.platform!=="darwin")throw Error("macOS only");let{stdout:D}=await u6D("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),U=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(D)?.groups.id??"com.apple.Safari";if(U==="com.apple.safari")return"com.apple.Safari";return U}var u6D;var uP=T(()=>{u6D=b6D(C6D)});import k6D from"node:process";import{promisify as _6D}from"node:util";import{execFile as x6D,execFileSync as
|
|
247
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var xP=T(()=>{_P()});import{promisify as f6D}from"node:util";import{execFile as y6D}from"node:child_process";async function hq(D=m6D){let{stdout:$}=await D("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),U=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec($);if(!U)throw new gP(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:I}=U.groups,F=I.lastIndexOf("."),J=I.lastIndexOf("-"),X=F===-1?void 0:I.slice(0,F),Q=J===-1?void 0:I.slice(0,J);return eU[I]??eU[X]??eU[Q]??{name:I,id:I}}var m6D,eU,DF,gP;var nq=T(()=>{m6D=f6D(y6D),eU={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},DF=new Map(Object.entries(eU));gP=class gP extends Error{}});import{promisify as h6D}from"node:util";import iq from"node:process";import{execFile as n6D}from"node:child_process";async function lq(){if(iq.platform==="darwin"){let D=await yq();return{name:await mq(D),id:D}}if(iq.platform==="linux"){let{stdout:D}=await i6D("xdg-mime",["query","default","x-scheme-handler/http"]),$=D.trim();return{name:l6D($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(iq.platform==="win32")return hq();throw Error("Only macOS, Linux, and Windows are supported")}var i6D,l6D=(D)=>D.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());var fP=T(()=>{uP();xP();nq();nq();i6D=h6D(n6D)});import dq from"node:process";var d6D,yP;var mP=T(()=>{d6D=Boolean(dq.env.SSH_CONNECTION||dq.env.SSH_CLIENT||dq.env.SSH_TTY),yP=d6D});var cP={};X$(cP,{openApp:()=>a6D,default:()=>s6D,apps:()=>E1});import cq from"node:process";import dP from"node:path";import{fileURLToPath as c6D}from"node:url";import p6D from"node:child_process";import r6D,{constants as o6D}from"node:fs/promises";function lP(D){if(typeof D==="string"||Array.isArray(D))return D;let{[nP]:$}=D;if(!$)throw Error(`${nP} is not supported`);return $}function h3({[w2]:D},{wsl:$}={}){if($&&u0)return lP($);if(!D)throw Error(`${w2} is not supported`);return lP(D)}var $F,pq,hP,w2,nP,iP=async(D,$)=>{if(D.length===0)return;let U=[];for(let I of D)try{return await $(I)}catch(F){U.push(F)}throw AggregateError(U,"Failed to open in all supported apps")},m3=async(D)=>{D={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...D};let $=D[$F]===!0;if(delete D[$F],Array.isArray(D.app))return iP(D.app,(W)=>m3({...D,app:W,[$F]:!0}));let{name:U,arguments:I=[]}=D.app??{};if(I=[...I],Array.isArray(U))return iP(U,(W)=>m3({...D,app:{name:W,arguments:I},[$F]:!0}));if(U==="browser"||U==="browserPrivate"){let W={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},B={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},K;if(u0){let q=await bP();K=DF.get(q)??{}}else K=await lq();if(K.id in W){let q=W[K.id.toLowerCase()];if(U==="browserPrivate"){if(q==="safari")throw Error("Safari doesn't support opening in private mode via command line");I.push(B[q])}return m3({...D,app:{name:E1[q],arguments:I}})}throw Error(`${K.name} is not supported as a default browser`)}let F,J=[],X={},Q=!1;if(u0&&!M1()&&!yP&&!U)Q=await TP();if(w2==="darwin"){if(F="open",D.wait)J.push("--wait-apps");if(D.background)J.push("--background");if(D.newInstance)J.push("--new");if(U)J.push("-a",U)}else if(w2==="win32"||Q){if(F=await sU(),J.push(...m$.argumentsPrefix),!u0)X.windowsVerbatimArguments=!0;if(u0&&D.target)D.target=await PP(D.target);let W=["$ProgressPreference = 'SilentlyContinue';","Start"];if(D.wait)W.push("-Wait");if(U){if(W.push(m$.escapeArgument(U)),D.target)I.push(D.target)}else if(D.target)W.push(m$.escapeArgument(D.target));if(I.length>0)I=I.map((B)=>m$.escapeArgument(B)),W.push("-ArgumentList",I.join(","));if(D.target=m$.encodeCommand(W.join(" ")),!D.wait)X.stdio="ignore"}else{if(U)F=U;else{let W=!pq||pq==="/",B=!1;try{await r6D.access(hP,o6D.X_OK),B=!0}catch{}F=cq.versions.electron??(w2==="android"||W||!B)?"xdg-open":hP}if(I.length>0)J.push(...I);if(!D.wait)X.stdio="ignore",X.detached=!0}if(w2==="darwin"&&I.length>0)J.push("--args",...I);if(D.target)J.push(D.target);let Y=p6D.spawn(F,J,X);if(D.wait)return new Promise((W,B)=>{Y.once("error",B),Y.once("close",(K)=>{if(!D.allowNonzeroExitCode&&K!==0){B(Error(`Exited with code ${K}`));return}W(Y)})});if($)return new Promise((W,B)=>{Y.once("error",B),Y.once("spawn",()=>{Y.once("close",(K)=>{if(Y.off("error",B),K!==0){B(Error(`Exited with code ${K}`));return}Y.unref(),W(Y)})})});return Y.unref(),new Promise((W,B)=>{Y.once("error",B),Y.once("spawn",()=>{Y.off("error",B),W(Y)})})},t6D=(D,$)=>{if(typeof D!=="string")throw TypeError("Expected a `target`");return m3({...$,target:D})},a6D=(D,$)=>{if(typeof D!=="string"&&!Array.isArray(D))throw TypeError("Expected a valid `name`");let{arguments:U=[]}=$??{};if(U!==void 0&&U!==null&&!Array.isArray(U))throw TypeError("Expected `appArguments` as Array type");return m3({...$,app:{name:D,arguments:U}})},E1,s6D;var pP=T(()=>{CP();gq();fP();uq();mP();$F=Symbol("fallbackAttempt"),pq=import.meta.url?dP.dirname(c6D(import.meta.url)):"",hP=dP.join(pq,"xdg-open"),{platform:w2,arch:nP}=cq;E1={browser:"browser",browserPrivate:"browserPrivate"};O1(E1,"chrome",()=>h3({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));O1(E1,"brave",()=>h3({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));O1(E1,"firefox",()=>h3({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));O1(E1,"edge",()=>h3({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));O1(E1,"safari",()=>h3({darwin:"Safari"}));s6D=t6D});import{spawn as e6D}from"node:child_process";import{existsSync as QD,readdirSync as O2,readFileSync as lD,statSync as D1D}from"node:fs";import{homedir as DC,platform as $C}from"node:os";import j1,{dirname as k0,join as GD,relative as UC,resolve as uD,sep as FC}from"node:path";import{cwd as D$,env as V1,stdin as IC,stdout as JC}from"node:process";function UF(D,$){let U=UE();if(U)U[D]($);else vD[D]($)}function QC(D=""){if(!D)return QF;return`${QF}${D.startsWith("/")?D:`/${D}`}`}function
|
|
248
|
-
`)}function
|
|
246
|
+
`)){if(/^\s*#/.test($))continue;let U=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec($);if(!U)continue;return U.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}import{promisify as j6D}from"node:util";import A6D from"node:child_process";import fq,{constants as SP}from"node:fs/promises";var R6D,S6D,T6D=async()=>{return`${await S6D()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},sU,RP,TP=async()=>{return RP??=(async()=>{try{let D=await sU();return await fq.access(D,SP.X_OK),!0}catch{return!1}})(),RP},bP=async()=>{let D=await sU(),$=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:U}=await m$($,{powerShellPath:D});return U.trim()},PP=async(D)=>{if(/^[a-z]+:\/\//i.test(D))return D;try{let{stdout:$}=await R6D("wslpath",["-aw",D],{encoding:"utf8"});return $.trim()}catch{return D}};var CP=T(()=>{_q();gq();_q();R6D=j6D(A6D.execFile),S6D=(()=>{let $;return async function(){if($)return $;let U="/etc/wsl.conf",I=!1;try{await fq.access(U,SP.F_OK),I=!0}catch{}if(!I)return"/mnt/";let F=await fq.readFile(U,{encoding:"utf8"}),J=AP(F);if(J===void 0)return"/mnt/";return $=J,$=$.endsWith("/")?$:`${$}/`,$}})(),sU=u0?T6D:xq});function O1(D,$,U){let I=(F)=>Object.defineProperty(D,$,{value:F,enumerable:!0,writable:!0});return Object.defineProperty(D,$,{configurable:!0,enumerable:!0,get(){let F=U();return I(F),F},set(F){I(F)}}),D}import{promisify as b6D}from"node:util";import P6D from"node:process";import{execFile as C6D}from"node:child_process";async function yq(){if(P6D.platform!=="darwin")throw Error("macOS only");let{stdout:D}=await u6D("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),U=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(D)?.groups.id??"com.apple.Safari";if(U==="com.apple.safari")return"com.apple.Safari";return U}var u6D;var uP=T(()=>{u6D=b6D(C6D)});import k6D from"node:process";import{promisify as _6D}from"node:util";import{execFile as x6D,execFileSync as eQD}from"node:child_process";async function kP(D,{humanReadableOutput:$=!0,signal:U}={}){if(k6D.platform!=="darwin")throw Error("macOS only");let I=$?[]:["-ss"],F={};if(U)F.signal=U;let{stdout:J}=await g6D("osascript",["-e",D,I],F);return J.trim()}var g6D;var _P=T(()=>{g6D=_6D(x6D)});async function mq(D){return kP(`tell application "Finder" to set app_path to application file id "${D}" as string
|
|
247
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var xP=T(()=>{_P()});import{promisify as f6D}from"node:util";import{execFile as y6D}from"node:child_process";async function hq(D=m6D){let{stdout:$}=await D("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),U=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec($);if(!U)throw new gP(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:I}=U.groups,F=I.lastIndexOf("."),J=I.lastIndexOf("-"),X=F===-1?void 0:I.slice(0,F),Q=J===-1?void 0:I.slice(0,J);return eU[I]??eU[X]??eU[Q]??{name:I,id:I}}var m6D,eU,DF,gP;var nq=T(()=>{m6D=f6D(y6D),eU={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},DF=new Map(Object.entries(eU));gP=class gP extends Error{}});import{promisify as h6D}from"node:util";import iq from"node:process";import{execFile as n6D}from"node:child_process";async function lq(){if(iq.platform==="darwin"){let D=await yq();return{name:await mq(D),id:D}}if(iq.platform==="linux"){let{stdout:D}=await i6D("xdg-mime",["query","default","x-scheme-handler/http"]),$=D.trim();return{name:l6D($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(iq.platform==="win32")return hq();throw Error("Only macOS, Linux, and Windows are supported")}var i6D,l6D=(D)=>D.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());var fP=T(()=>{uP();xP();nq();nq();i6D=h6D(n6D)});import dq from"node:process";var d6D,yP;var mP=T(()=>{d6D=Boolean(dq.env.SSH_CONNECTION||dq.env.SSH_CLIENT||dq.env.SSH_TTY),yP=d6D});var cP={};X$(cP,{openApp:()=>a6D,default:()=>s6D,apps:()=>E1});import cq from"node:process";import dP from"node:path";import{fileURLToPath as c6D}from"node:url";import p6D from"node:child_process";import r6D,{constants as o6D}from"node:fs/promises";function lP(D){if(typeof D==="string"||Array.isArray(D))return D;let{[nP]:$}=D;if(!$)throw Error(`${nP} is not supported`);return $}function h3({[w2]:D},{wsl:$}={}){if($&&u0)return lP($);if(!D)throw Error(`${w2} is not supported`);return lP(D)}var $F,pq,hP,w2,nP,iP=async(D,$)=>{if(D.length===0)return;let U=[];for(let I of D)try{return await $(I)}catch(F){U.push(F)}throw AggregateError(U,"Failed to open in all supported apps")},m3=async(D)=>{D={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...D};let $=D[$F]===!0;if(delete D[$F],Array.isArray(D.app))return iP(D.app,(W)=>m3({...D,app:W,[$F]:!0}));let{name:U,arguments:I=[]}=D.app??{};if(I=[...I],Array.isArray(U))return iP(U,(W)=>m3({...D,app:{name:W,arguments:I},[$F]:!0}));if(U==="browser"||U==="browserPrivate"){let W={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},B={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},K;if(u0){let q=await bP();K=DF.get(q)??{}}else K=await lq();if(K.id in W){let q=W[K.id.toLowerCase()];if(U==="browserPrivate"){if(q==="safari")throw Error("Safari doesn't support opening in private mode via command line");I.push(B[q])}return m3({...D,app:{name:E1[q],arguments:I}})}throw Error(`${K.name} is not supported as a default browser`)}let F,J=[],X={},Q=!1;if(u0&&!M1()&&!yP&&!U)Q=await TP();if(w2==="darwin"){if(F="open",D.wait)J.push("--wait-apps");if(D.background)J.push("--background");if(D.newInstance)J.push("--new");if(U)J.push("-a",U)}else if(w2==="win32"||Q){if(F=await sU(),J.push(...m$.argumentsPrefix),!u0)X.windowsVerbatimArguments=!0;if(u0&&D.target)D.target=await PP(D.target);let W=["$ProgressPreference = 'SilentlyContinue';","Start"];if(D.wait)W.push("-Wait");if(U){if(W.push(m$.escapeArgument(U)),D.target)I.push(D.target)}else if(D.target)W.push(m$.escapeArgument(D.target));if(I.length>0)I=I.map((B)=>m$.escapeArgument(B)),W.push("-ArgumentList",I.join(","));if(D.target=m$.encodeCommand(W.join(" ")),!D.wait)X.stdio="ignore"}else{if(U)F=U;else{let W=!pq||pq==="/",B=!1;try{await r6D.access(hP,o6D.X_OK),B=!0}catch{}F=cq.versions.electron??(w2==="android"||W||!B)?"xdg-open":hP}if(I.length>0)J.push(...I);if(!D.wait)X.stdio="ignore",X.detached=!0}if(w2==="darwin"&&I.length>0)J.push("--args",...I);if(D.target)J.push(D.target);let Y=p6D.spawn(F,J,X);if(D.wait)return new Promise((W,B)=>{Y.once("error",B),Y.once("close",(K)=>{if(!D.allowNonzeroExitCode&&K!==0){B(Error(`Exited with code ${K}`));return}W(Y)})});if($)return new Promise((W,B)=>{Y.once("error",B),Y.once("spawn",()=>{Y.once("close",(K)=>{if(Y.off("error",B),K!==0){B(Error(`Exited with code ${K}`));return}Y.unref(),W(Y)})})});return Y.unref(),new Promise((W,B)=>{Y.once("error",B),Y.once("spawn",()=>{Y.off("error",B),W(Y)})})},t6D=(D,$)=>{if(typeof D!=="string")throw TypeError("Expected a `target`");return m3({...$,target:D})},a6D=(D,$)=>{if(typeof D!=="string"&&!Array.isArray(D))throw TypeError("Expected a valid `name`");let{arguments:U=[]}=$??{};if(U!==void 0&&U!==null&&!Array.isArray(U))throw TypeError("Expected `appArguments` as Array type");return m3({...$,app:{name:D,arguments:U}})},E1,s6D;var pP=T(()=>{CP();gq();fP();uq();mP();$F=Symbol("fallbackAttempt"),pq=import.meta.url?dP.dirname(c6D(import.meta.url)):"",hP=dP.join(pq,"xdg-open"),{platform:w2,arch:nP}=cq;E1={browser:"browser",browserPrivate:"browserPrivate"};O1(E1,"chrome",()=>h3({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));O1(E1,"brave",()=>h3({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));O1(E1,"firefox",()=>h3({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));O1(E1,"edge",()=>h3({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));O1(E1,"safari",()=>h3({darwin:"Safari"}));s6D=t6D});import{spawn as e6D}from"node:child_process";import{existsSync as QD,readdirSync as O2,readFileSync as lD,statSync as D1D}from"node:fs";import{homedir as DC,platform as $C}from"node:os";import j1,{dirname as k0,join as GD,relative as UC,resolve as uD,sep as FC}from"node:path";import{cwd as D$,env as V1,stdin as IC,stdout as JC}from"node:process";function UF(D,$){let U=UE();if(U)U[D]($);else vD[D]($)}function QC(D=""){if(!D)return QF;return`${QF}${D.startsWith("/")?D:`/${D}`}`}function IWD(D){let $=Q1D.toLocaleString("en-US");return[`Delta updates cannot upload this bundle: it has ${D.toLocaleString("en-US")} files, and Capgo allows at most ${$} files per delta (manifest) upload.`,"Delta mode tracks and uploads each file individually so devices can download only what changed. Very large file counts are not supported on that path.","What you can do:","1. Upload a full zip instead: npx @capgo/cli@latest bundle upload --no-delta","2. Or reduce files in your web build output (remove unused assets, avoid copying large trees into dist).","See https://capgo.app/docs/faq/#are-there-delta-update-file-path-limitations"].join(`
|
|
248
|
+
`)}function XWD(D){return[`Bundle upload timed out after ${Math.round(D/1000)}s.`,"The standard upload has to finish the whole transfer within this window and does not retry, so a large bundle or a slow connection can trip it.","What you can do:","1. Retry with the resumable upload, which uploads in chunks and retries automatically: npx @capgo/cli@latest bundle upload --tus","2. Or raise the limit for the standard upload: npx @capgo/cli@latest bundle upload --timeout <milliseconds>"].join(`
|
|
249
249
|
`)}function Y$(D){if(!D)return"Unknown error";if(Tq(D).isSecurityPolicyError)return ZP(D);let U=D;if(typeof D==="string")return D;if(D instanceof Error){let I=U.message||U.cause?.message||U.stack||D.name,F=U.cause?.name,J=I.toLowerCase();if(J.includes("fetch failed")||J.includes("failed to fetch")||J.includes("connect timeout")||J.includes("network")||F?.startsWith("UND_ERR"))return`Network error: ${I}${U.code?` (code ${U.code})`:""}. Check your network connection and API endpoint availability.`;let X=U.status||U.statusCode;return[I,U.code?`Code: ${U.code}`:void 0,X?`Status: ${X}`:void 0].filter(Boolean).join(" | ")||D.name}if(U.message){let I=[U.message,U.code?`Code: ${U.code}`:void 0,U.status||U.statusCode?`Status: ${U.status||U.statusCode}`:void 0].filter(Boolean).join(" | "),F=U.message.toLowerCase();if(F.includes("fetch failed")||F.includes("failed to fetch")||U.error==="Failed to fetch")return`Network error: ${I}. Check your network connection and API endpoint availability.`;if(U.details||U.hint||U.error)return`${I}${I?" | ":""}${U.error?typeof U.error==="string"?U.error:U.error.message??"":""}${U.details?`Details: ${U.details}`:""}${U.hint?`Hint: ${U.hint}`:""}`.trim();return I}if(typeof U.error==="string"&&U.error.length>0)return U.error;if(U.error&&typeof U.error==="object"&&typeof U.error.message==="string"&&U.error.message.length>0)return U.error.message;return`
|
|
250
|
-
${XC.default.render(D)}`}function rq(D){if(typeof D!=="string"&&typeof D!=="number")return;return tU(String(D)).slice(0,YC)}function W1D(D){if(typeof D==="string")return tU(D).slice(0,YC);if(!D||typeof D!=="object")return String(D);let $=D,U=rq($.name),I=rq($.message),F=U&&I?`${U}: ${I}`:I||U||Object.prototype.toString.call(D),J=[["code",$.code],["errno",$.errno],["syscall",$.syscall],["address",$.address],["port",$.port]].map(([X,Q])=>{let Y=rq(Q);return Y?`${X}=${Y}`:void 0}).filter(Boolean);return`${F}${J.length>0?` (${J.join(", ")})`:""}`}function
|
|
251
|
-
`))}async function
|
|
252
|
-
`)[0].trim()}async function
|
|
250
|
+
${XC.default.render(D)}`}function rq(D){if(typeof D!=="string"&&typeof D!=="number")return;return tU(String(D)).slice(0,YC)}function W1D(D){if(typeof D==="string")return tU(D).slice(0,YC);if(!D||typeof D!=="object")return String(D);let $=D,U=rq($.name),I=rq($.message),F=U&&I?`${U}: ${I}`:I||U||Object.prototype.toString.call(D),J=[["code",$.code],["errno",$.errno],["syscall",$.syscall],["address",$.address],["port",$.port]].map(([X,Q])=>{let Y=rq(Q);return Y?`${X}=${Y}`:void 0}).filter(Boolean);return`${F}${J.length>0?` (${J.join(", ")})`:""}`}function YWD(D){let $=[],U=new Set,I=0,F=(J,X,Q)=>{if(I>=Y1D)return;if(J&&typeof J==="object"){if(U.has(J))return;U.add(J)}I++;let Y=" ".repeat(Q);if($.push(`${Y}${X}${W1D(J)}`),!J||typeof J!=="object")return;let W=J,B=[W.causingError,W.cause].filter((K,q,H)=>K!==void 0&&K!==null&&H.indexOf(K)===q);for(let K of B)F(K,"Caused by: ",Q+1);if(Array.isArray(W.errors))W.errors.forEach((K,q)=>{F(K,`Contained error ${q+1}: `,Q+1)})};return F(D,"",0),tU($.join(`
|
|
251
|
+
`))}async function WWD(D,$,U=!1){let{data:I,error:F}=await qP(()=>D.rpc("reject_access_due_to_2fa_for_org",{org_id:$}));if(F){if(!U&&!L2(F))l.error(`Cannot check 2FA compliance: ${F.message}`);if(L2(F)){await HP({silent:U,telemetryFunctionName:"check2FAAccessForOrg"});return}NP(F)}if(I){if(!U)l.error(`\uD83D\uDD10 Access Denied: 2FA Required. Enable 2FA at ${QC("/settings/account")}`);throw Error("2FA required for this organization")}}function BWD({silent:D=!1,stdinIsTTY:$=!!IC.isTTY,stdoutIsTTY:U=!!JC.isTTY,ci:I=$H.isCI}={}){return!D&&$&&U&&!I}function B1D(D={}){let $=D.ci??$H.isCI,U=D.stdinIsTTY??!!IC.isTTY,I=D.stdoutIsTTY??!!JC.isTTY,F=D.platform??$C(),J="display"in D?D.display:V1.DISPLAY;if($||!U||!I)return!1;if(F==="linux"&&!J)return!1;return!0}async function K1D(D){if(!B1D())return;try{await(await Promise.resolve().then(() => (pP(),cP))).default(D)}catch($){if($?.code==="ENOENT")return}}function KWD(D){return OX(D)||EX(D)}function _0(D){if(OX(D))return TA(D);else if(EX(D))return bA(D);return D}function WC(D=_0(D$()),$=void 0){let U=$?.split(",")[0],I=U??GD(D,C$);if(!QD(I)){let J=U?`Package.json at ${I} does not exist`:`No package.json found at ${I}. Run this command from your project root (the folder that contains package.json), or pass --package-json <path> to point at it (for example in a monorepo).`;throw l.error(J),Error(J)}let F=lD(I);return JSON.parse(F)}function GWD(D=_0(D$()),$=void 0){return WC(D,$).scripts}function qWD(D=_0(D$()),$=void 0){return WC(D,$).version??""}function G1D(D){let $=D.replace("^","").replace("~","");if(P2($))try{let U=s$($);return fF(U)}catch{return $}return $}async function HWD(D,$=D$(),U){let I=U?U.split(",").map((X)=>X.trim()).filter(Boolean):[],F=[],J=(X)=>{let Q=uD(X);if(!F.includes(Q))F.push(Q)};for(let X of I){let Q=uD($,X);if(QD(Q))J(k0(Q))}J(uD($)),J(D$());for(let X of F)try{let Q=`${D}/package.json`,{createRequire:Y}=await import("node:module"),B=Y(GD(X,"package.json")).resolve(Q),K=JSON.parse(lD(B,"utf-8"));if(K.version)return K.version}catch{}for(let X of F){let Q=X,Y=j1.parse(Q).root;while(Q!==Y){let W=GD(Q,"node_modules",D,C$);if(QD(W))try{let K=JSON.parse(lD(W,"utf-8"));if(K.version)return K.version}catch{}let B=k0(Q);if(B===Q)break;Q=B}}if(D==="@capgo/capacitor-updater"){let X=null,Q=GD($,"ios","App","Podfile");if(QD(Q))try{let W=lD(Q,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(W?.[1])X=uD(GD($,"ios","App",W[1]))}catch{}if(!X){let Y=GD($,"android","capacitor.settings.gradle");if(QD(Y))try{let B=lD(Y,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(B?.[1])X=uD(GD($,"android",B[1])).replace(/\/android$/,"")}catch{}}if(X){let Y=GD(X,C$);if(QD(Y))try{let W=JSON.parse(lD(Y,"utf-8"));if(W.version)return W.version}catch{}}}try{let X=U?U.split(",").map((W)=>W.trim()).filter(Boolean).join(","):U,Y=(await BF($,X)).get(D);if(Y)return Y}catch{}return null}async function BF(D=_0(D$()),$=void 0){let U=$?.split(",").map((J)=>J.trim()).filter(Boolean);if(U??=[GD(D,C$)],U){for(let J of U)if(!QD(J)){let X=`Package.json at ${J} does not exist`;throw l.error(X),Error(X)}}let I=new Map,{createRequire:F}=await import("node:module");for(let J of U){let X=lD(J),Q=JSON.parse(X),Y=k0(J),W=(B,K)=>{try{let z=F(GD(Y,"package.json")).resolve(`${B}/package.json`),N=JSON.parse(lD(z,"utf-8"));if(N.version)return N.version}catch{}let q=Y,H=j1.parse(q).root;while(q!==H){let G=GD(q,"node_modules",B,C$);if(QD(G))try{let N=JSON.parse(lD(G,"utf-8"));if(N.version)return N.version}catch{}let z=k0(q);if(z===q)break;q=z}return G1D(K)};for(let B in Q.dependencies)I.set(B,W(B,Q.dependencies[B]));for(let B in Q.devDependencies)I.set(B,W(B,Q.devDependencies[B]))}return I}async function q1D(D=_0(D$()),$=void 0){let U=$?.split(",").map((F)=>F.trim()).filter(Boolean);if(U??=[GD(D,C$)],U){for(let F of U)if(!QD(F)){let J=`Package.json at ${F} does not exist`;throw l.error(J),Error(J)}}let I=new Map;for(let F of U){let J=lD(F),X=JSON.parse(J);for(let Q in X.dependencies??{})if(typeof X.dependencies[Q]==="string")I.set(Q,X.dependencies[Q]);for(let Q in X.devDependencies??{})if(typeof X.devDependencies[Q]==="string")I.set(Q,X.devDependencies[Q])}return I}function H1D(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&QD(D.path)}async function BC(D,$=!1){let U=N1D;try{let I=await D();if(!H1D(I)){if(!$)l.error(U);throw new ZD(U)}return I}catch(I){if(I instanceof ZD)throw I;let F=Y$(I);if(!$)l.error(`${U}: ${F}`);throw new ZD(U,{cause:F})}}function ZJ(D=!1){return BC(bX,D)}function z1D(D=!1){return BC(PX,D)}async function L1D(D,$){let U=await z1D();if(U?.config)U.config.plugins??={},U.config.plugins.extConfig??={},U.config.plugins[D]??={},U.config.plugins[D]={...U.config.plugins[D],...$},await CX(D,U);return U}async function NWD(D){return L1D("CapacitorUpdater",D)}async function i6(D=!1){try{let $=await ZJ(D),U={host:$?.config?.plugins?.CapacitorUpdater?.localHost||rP,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||QF,hostFilesApi:$?.config?.plugins?.CapacitorUpdater?.localApiFiles||oP,hostApi:$?.config?.plugins?.CapacitorUpdater?.localApi||XF};if($?.config?.plugins?.CapacitorUpdater?.localSupa&&$?.config?.plugins?.CapacitorUpdater?.localSupaAnon){if(!D)l.info("Using custom supabase instance from capacitor.config.json");U.supaKey=$?.config?.plugins?.CapacitorUpdater?.localSupaAnon,U.supaHost=$?.config?.plugins?.CapacitorUpdater?.localSupa}return U}catch{return{host:rP,hostWeb:QF,hostFilesApi:oP,hostApi:XF}}}function aP(D){return typeof D==="object"&&D!==null}function w1D(D){if(!aP(D))return!1;let $=D.capacitor;if(aP($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function Z1D(D){if(QD(GD(D,"plugin.xml")))return!0;let $=GD(D,C$);if(!QD($))return!1;try{return w1D(JSON.parse(lD($,"utf-8")))}catch{return!1}}async function i3(D=!1,$){let U=(F)=>{let J={...F};return gO(J,void 0,D),J};if(!$&&oq)return U(oq);if(!$&&FF)return FF.then(U);let I=(async()=>{let F=await i6(D);try{let J=qC(),X=await fetch(`${F.hostApi}/private/config`,{...$?{signal:$}:{},headers:J0(J?{capgkey:J}:void 0)});if(!X.ok)throw Error(`HTTP error! status: ${X.status}`);let Y={...await X.json(),...F};if(!$)oq=Y;return{...Y}}catch{if(!D)l.info(`Local config ${Y$(F)}`);return{...F}}finally{if(!$)FF=null}})();if(!$)FF=I;return I.then(U)}async function zWD(){let D=await i6();try{let $=qC(),U=await fetch(`${D.hostFilesApi}/files/config`,{headers:J0($?{capgkey:$}:void 0)});if(!U.ok)throw Error(`HTTP error! status: ${U.status}`);return await U.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:I1D,maxChunkSize:J1D,alertUploadSize:F1D}}}function M2(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw Error("Invalid Supabase host protocol");let U=$.hostname==="localhost"||$.hostname==="127.0.0.1"||$.hostname==="[::1]";if($.protocol==="http:"&&!U)throw Error("Supabase host must use HTTPS (HTTP is only allowed for localhost)");if($.username||$.password)throw Error("Supabase host must not include credentials");if($.search||$.hash)throw Error("Supabase host must not include query parameters or fragments");let I=F6($.pathname);return`${$.origin}${I}`}function M1D(D){if(!D||typeof D!=="object")return"";let $=D;return[$.error,$.message,$.status].filter(Boolean).join(" | ")}function sP(D,$){let U=D.indexOf($);if(U<0)return D;return D.slice(U+$.length).replace(/^:\s*/,"").split(`
|
|
252
|
+
`)[0].trim()}async function LWD(D){let $=await GC(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let U=D instanceof Error?D.message:String(D??"");if(U.includes("CHANNEL_ZIP_REQUIRED"))return sP(U,"CHANNEL_ZIP_REQUIRED");if(U.includes("CHANNEL_DELTA_REQUIRED"))return sP(U,"CHANNEL_DELTA_REQUIRED");return null}function n3(D){if(!D)return!1;try{let $=new URL(M2(D)).hostname.toLowerCase();return $==="sb.capgo.app"||$==="xvwzpoazmxkqosrdewyv.supabase.co"||$==="ibwjdnhknbkcqfbabwei.supabase.co"||$==="aucsybvnhavogdmzwtcw.supabase.co"}catch{return!1}}function O1D(D){if(D.supaHost&&D.supaKey&&D.hostApi===XF&&!n3(D.supaHost))return`${M2(D.supaHost)}/functions/v1`;return D.hostApi}function wWD(D){let $=D?.context;return typeof $?.status==="number"?$.status:void 0}async function GC(D){let $=D?.context;if(!$||typeof $.clone!=="function")return null;try{let U=await $.clone().text();try{return JSON.parse(U)}catch{return U?{message:U}:null}}catch{return null}}async function ZWD(D){let $=await GC(D);if($){let U=M1D($);if(U)return U}return Y$(D)}async function KF(D,$){let U=($.method??"POST").toUpperCase(),I,F=$.supaAnon;if($.supaHost&&$.supaAnon&&!n3($.supaHost))I=`${M2($.supaHost)}/functions/v1`;else{let Q=await i3(!0);if(F=$.supaAnon??Q.supaKey,Q.supaHost&&Q.supaKey&&Q.hostApi===XF&&!n3(Q.supaHost)&&!($.supaHost&&n3($.supaHost)))I=`${M2(Q.supaHost)}/functions/v1`;else if($.useFilesHost)I=Q.hostFilesApi;else I=Q.hostApi}let J=I.includes("/functions/v1"),X=`${F6(I)}/${D.replace(/^\//,"")}`;try{let Q=await fetch(X,{method:U,redirect:"error",headers:J0({"Content-Type":"application/json",Authorization:J&&F?`Bearer ${F}`:$.apikey,capgkey:$.apikey}),body:U==="GET"||U==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!Q.ok)return{data:null,error:new i$.FunctionsHttpError(Q)};return{data:(Q.headers.get("content-type")??"").includes("application/json")?await Q.json().catch(()=>null):await Q.text().catch(()=>null),error:null}}catch(Q){return{data:null,error:Q instanceof Error?Q:Error(String(Q))}}}async function MWD(D,$=!0){if(D?.supaHost&&D?.supaAnon){if(n3(D.supaHost))return(await i6($)).hostApi;return`${M2(D.supaHost)}/functions/v1`}let U=await i6($);if(U.supaHost&&U.supaKey)return O1D(U);return(await i3($)).hostApi}async function OWD(D,$,U,I=!1,F=!0,J){let X=await i3(I,J);if($&&U){if(!I)l.info("Using custom supabase instance from provided options");X.supaHost=$,X.supaKey=U}if(!X.supaHost||!X.supaKey){if(!I)l.error(tP);throw new ZD(tP,{missingSupaHost:!X.supaHost,missingSupaKey:!X.supaKey})}let Q=M2(X.supaHost);return kz(Q,X.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:HF("capgkey",D)},...uO()&&F?{fetch:_O()}:{}}})}async function E1D(D,$){let{data:U}=await D.rpc("is_paying_org",{orgid:$}).single();return U||!1}async function v1D(D,$){let{data:U}=await D.rpc("is_trial_org",{orgid:$}).single();return U||0}async function V1D(D,$,U){let{data:I}=await D.rpc("has_usage_credits_org",U?{orgid:$,appid:U}:{orgid:$}).single();return I||!1}function j1D(D){let{trialDays:$,isPaying:U,hasCredits:I,warning:F=!0}=D;return!!F&&$>0&&!U&&!I}async function A1D(D,$){let{data:U,error:I}=await D.rpc("is_allowed_action_org",{orgid:$}).single();if(I)throw Error(`Cannot validate plan: ${Y$(I)}`);return U===!0}async function tq(D,$,U,I){let{data:F,error:J}=I?await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U,appid:I}):await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U});if(J){if(I&&J.code==="PGRST202")return A1D(D,$);throw Error(`Cannot validate plan: ${Y$(J)}`)}return F===!0}async function R1D(D,$,U,I){if(I){if(await tq(D,$,U,I))return"allowed";if(await tq(D,$,U))return"permission_denied";return"billing_denied"}return await tq(D,$,U)?"allowed":"billing_denied"}async function S1D(D,$){throw l.error(`You need to upgrade your plan to continue to use capgo.
|
|
253
253
|
Upgrade here: ${D}
|
|
254
|
-
`),await K1D(D),new ZD($)}async function T1D(){throw l.error("Cannot validate plan usage for this app. The API key may lack permission to read app billing details."),new ZD("Plan validation permission denied")}async function
|
|
254
|
+
`),await K1D(D),new ZD($)}async function T1D(){throw l.error("Cannot validate plan usage for this app. The API key may lack permission to read app billing details."),new ZD("Plan validation permission denied")}async function EWD(D,$,U){let{data:I,error:F}=await D.rpc("get_organization_cli_warnings",{orgid:$,cli_version:U});if(F){l.error(`Cannot get cli warnings: ${Y$(F)}`);return}if(I.length>0){l.warn(`Found ${I.length} cli warnings for your organization.`);let J=null;for(let X of I){if(typeof X!=="object"||typeof X.message!=="string"||typeof X.fatal!=="boolean"){l.error(`Invalid cli warning: ${X}`);continue}let Q=X;if(Q.fatal)l.error(`${Q.message.replaceAll("\\n",`
|
|
255
255
|
`)}`),J=Error(Q.message);else l.warn(`${Q.message.replaceAll("\\n",`
|
|
256
|
-
`)}`)}if(J)throw l.error("Please fix the warnings and try again."),J;l.info("End of cli warnings.")}}async function
|
|
256
|
+
`)}`)}if(J)throw l.error("Please fix the warnings and try again."),J;l.info("End of cli warnings.")}}async function vWD(D,$,U,I=!0){let F=await i3(),J=`${F.hostWeb}/settings/organization/plans`,X=await R1D(D,$,["storage"],U);if(X==="permission_denied")await T1D();if(X==="billing_denied")await S1D(J,"Plan upgrade required for upload");let[Q,Y,W]=await Promise.all([v1D(D,$),E1D(D,$),V1D(D,$,U)]);if(j1D({trialDays:Q,isPaying:Y,hasCredits:W,warning:I}))l.warn(`WARNING !!
|
|
257
257
|
Trial expires in ${Q} days, upgrade here: ${F.hostWeb}/settings/organization/plans
|
|
258
|
-
`)}function YF(D){try{if(!QD(D))return;return lD(D,"utf8").trim()||void 0}catch{return}}function qC(){let D=V1.CAPGO_TOKEN?.trim();if(D)return D;let $=YF(`${DC()}/.capgo`);if($)return $;return YF(".capgo")}function sO(D=!1,$=(U)=>l.info(U)){let U=V1.CAPGO_TOKEN?.trim();if(U){if(!D)$("Use CAPGO_TOKEN environment variable");return U}let F=`${DC()}/.capgo`,J=YF(F);if(J){if(!D)$(`Use global API key ${F}`)}else if(F=".capgo",J=YF(F),J&&!D)$(`Use local API key ${F}`);if(!J){let Q=`No Capgo API key found. Run \`${rA()}\` first, then retry this command.`;throw l.error(Q),new ZD(Q)}return J}async function*UH(D){let $=await O2(D,{withFileTypes:!0});for(let U of $){let I=uD(D,U.name);if(U.isDirectory()&&!U.name.startsWith(".")&&!U.name.startsWith("node_modules")&&!U.name.startsWith("dist"))yield*UH(I);else yield I}}function vWD(D){let U=(D.endsWith(".br")?D.slice(0,-3):D).split(".").pop()?.toLowerCase()||"";return{html:"text/html",htm:"text/html",js:"application/javascript",mjs:"application/javascript",cjs:"application/javascript",css:"text/css",json:"application/json",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",mp4:"video/mp4",webm:"video/webm",xml:"application/xml",txt:"text/plain",md:"text/markdown",pdf:"application/pdf",wasm:"application/wasm",map:"application/json"}[U]||"application/octet-stream"}function L6(D,$){return`${D}-${$?"ts":"js"}`}function w6(D,$){if(!$)l.info(`Found ${D} project`)}function b1D(D){if(QD(uD(D,"angular.json")))return"angular";if(QD(uD(D,"nuxt.config.js"))||QD(uD(D,"nuxt.config.ts")))return"nuxtjs";if(QD(uD(D,"next.config.js"))||QD(uD(D,"next.config.mjs"))||QD(uD(D,"next.config.ts")))return"nextjs";if(QD(uD(D,"svelte.config.js"))||QD(uD(D,"svelte.config.ts")))return"sveltekit";if(QD(uD(D,"vue.config.js"))||QD(uD(D,"vue.config.ts")))return"vue"}function HC(D){if(D.get("@angular/core"))return"angular";if(D.get("nuxt"))return"nuxtjs";if(D.get("next"))return"nextjs";if(D.get("@sveltejs/kit"))return"sveltekit";if(D.get("svelte"))return"svelte";if(D.get("vue"))return"vue";if(D.get("react"))return"react"}async function P1D(D,$){let U=QD(uD(D,"tsconfig.json")),I=b1D(D);if(I)return w6(I,$),L6(I,U);let F=uD(D,C$);if(!QD(F))return;let J=await BF(void 0,F),X=HC(J);if(!X)return;return w6(X,$),L6(X,U)}function aq(D,$){if(!$)return;let U=uD($);if(!D.includes(U))D.push(U)}function C1D(D){let $=D,U=j1.parse($).root;while(!0){if(QD(uD($,C$)))return $;if($===U)return;let I=k0($);if(I===$)return;$=I}}function u1D(D){let $=[],U=D?.split(",").map((I)=>I.trim()).filter(Boolean)[0];if(U)aq($,k0(uD(U)));return aq($,C1D(D$())),aq($,_0(D$())),$}async function VWD(D){let $=D$(),U=!1,I=D?.quiet??!1;for(let J of u1D(D?.packageJsonPath)){let X=await P1D(J,I);if(X)return X}let F=uD($,"tsconfig.json");if(QD(F))U=!0;for await(let J of UH($)){if(J.includes("angular.json"))return w6("angular",I),L6("angular",U);if(J.includes("nuxt.config.js")||J.includes("nuxt.config.ts"))return w6("nuxtjs",I),L6("nuxtjs",U);if(J.includes("next.config.js")||J.includes("next.config.mjs")||J.includes("next.config.ts"))return w6("nextjs",I),L6("nextjs",U);if(J.includes("svelte.config.js")||J.includes("svelte.config.ts"))return w6("sveltekit",I),L6("sveltekit",U);if(J.includes("vue.config.js")||J.includes("vue.config.ts"))return w6("vue",I),L6("vue",U);if(J.includes(C$)){let X=k0(J),Q=await BF(X),Y=HC(Q);if(Y)return w6(Y,I),L6(Y,U)}}return"unknown"}function jWD(D,$,U=D$()){if(D==="angular-js"||D==="angular-ts")return $?"src/main.ts":"src/main.js";if(D==="nextjs-js"||D==="nextjs-ts")return $?"src/app/layout.tsx":"src/app/layout.js";if(D==="svelte-js"||D==="svelte-ts")return $?"src/main.ts":"src/main.js";if(D==="vue-js"||D==="vue-ts")return $?"src/main.ts":"src/main.js";if(D==="react-js"||D==="react-ts"){let I=$?"src/main.tsx":"src/main.js",F=$?"src/index.tsx":"src/index.js";if(QD(uD(U,I)))return I;return F}return null}async function AWD(D){let $=D.replace(/-(?:ts|js)$/,"");if($==="angular")return l.info("Angular project detected"),"build";if($==="nuxtjs")return l.info("Nuxtjs project detected"),"generate";if($==="nextjs"){if(l.info("Nextjs project detected"),l.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),l.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),!await T1({message:"Do you want to continue?"}))throw l.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}if($==="sveltekit"){if(l.info("Sveltekit project detected"),l.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),l.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adapter"),!await T1({message:"Do you want to continue?"}))throw l.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}return"build"}async function RWD(D=!1,$=D$()){let U=/(main|index)\.(ts|tsx|js|jsx)$/,I="",F=uD($),J=F.split("/").length;for await(let X of UH(F))if(X.split("/").length-J<=2&&U.test(X)){if(I=X,!D)l.info(`Found main file here ${X}`);break}return I}function SWD(D,$){return D.from("app_versions").upsert($,{onConflict:"name,app_id"}).eq("app_id",$.app_id).eq("name",$.name)}async function TWD(D,$,U,I){let F={app_id:$,name:U,version:0};try{let J=await KF("files/upload_link",{apikey:D,body:F,useFilesHost:!0,supaHost:I?.supaHost,supaAnon:I?.supaAnon});if(J.error){if(J.error instanceof i$.FunctionsHttpError){let X=await J.error.context.json().catch(()=>({}));l.error(`Upload URL error: ${X.status||JSON.stringify(X)}`)}else l.error(`Cannot get upload url: ${J.error.message}`);return""}return J.data?.url??""}catch(J){l.error(`Cannot get upload url ${Y$(J)}`)}return""}async function*NC(D){let $=O2(D,{withFileTypes:!0});for(let U of $){let I=GD(D,U.name);if(U.isDirectory())yield*NC(I);else yield I}}function uWD(D,$="5.10.0",U="6.25.0",I="7.25.0"){if(D.major===5&&O6(D,s$($)))return!0;if(D.major===6&&O6(D,s$(U)))return!0;if(D.major===7&&O6(D,s$(I)))return!0;return!1}async function kWD(D){let $=[],U=[".DS_Store",".git",".gitignore","node_modules","package-lock.json","tsconfig.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json"];for await(let I of NC(D)){if(U.some((Q)=>I.includes(Q))){l.info(`Ignoring file ${I}, please ensure you have only required files in your dist folder`);continue}let F=lD(I);if(F.length===0){l.info(`Ignoring empty file ${I}, please ensure you have only required files in your dist folder`);continue}let J=await CA(F,"sha256"),X=UC(D,I);if(X.startsWith("/"))X=X.substring(1);$.push({file:X,hash:J})}return $}async function _WD(D){if($C()==="win32")return _1D(D);else return k1D(D)}function k1D(D){let $=new DH.default;return $.addLocalFolder(D),$.toBuffer()}async function _1D(D){l.info("Zipping file windows mode");let $=new DH.default,U=(I,F)=>{let J=O2(I);for(let X of J){let Q=GD(I,X),Y=D1D(Q);if(Y.isFile()){let W=lD(Q);$.addFile(GD(F,X).split(FC).join("/"),W)}else if(Y.isDirectory())U(Q,GD(F,X))}};return U(D,""),$.toBuffer()}function x1D(D){let $=eq();return`App ${D} does not exist, run first \`${$.runner} @capgo/cli app add ${D}\` to create it`}function g1D(D){let U=D?.originalResponse?.getBody?.(),I=D instanceof Error?D.message:String(D??"");return`${U??""} ${I}`.includes("app_not_found")}async function xWD(D,$,U,I,F,J,X,Q){return new Promise((Y,W)=>{N4(D,{channel:"app",event:"App TUS upload",org_id:U,tracking_version:2,tags:{"app-id":I}}),new WF.Upload($,{endpoint:`${X.hostFilesApi}/files/upload/attachments/`,chunkSize:Q,retryDelays:[...X1D],metadataForPartialUploads:{filename:`orgs/${U}/apps/${I}/${F}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${U}/apps/${I}/${F}.zip`,filetype:"application/zip"},headers:J0({Authorization:D}),onError(K){if(l.error(`Error uploading bundle: ${K.message}`),g1D(K)){W(Error(x1D(I)));return}if(K instanceof WF.DetailedError){let q=K.originalResponse?.getBody(),H=K.originalResponse?.getStatus(),G=K.originalRequest?.getURL(),z=(()=>{try{let N=JSON.parse(q||'{"error": "unknown error"}');return N.status||N.error||N.message||"unknown error"}catch{return q||K.message}})();W(Error(`TUS upload failed (status ${H??"unknown"}, url ${G??"unknown"}): ${z}`))}else W(Error(`TUS upload failed: ${K.message||K.toString()}`))},onProgress(K,q){let H=(K/q*100).toFixed(2);J.message(`Uploaded ${H}%`)},async onSuccess(){await N4(D,{channel:"app",event:"App TUS done",org_id:U,tracking_version:2,tags:{"app-id":I}}).catch(),Y(!0)}}).start()})}async function gWD(D,$,U,I){let J=await KF("private/delete_failed_version",{apikey:D,method:"DELETE",body:{app_id:$,name:U},supaHost:I?.supaHost,supaAnon:I?.supaAnon});if(J.error){if(J.error instanceof i$.FunctionsHttpError){let X=await J.error.context.json().catch(()=>({}));throw Error(X.status||X.message||JSON.stringify(X))}throw Error(J.error.message)}}async function fWD(D,$,U,I,F){let X=await KF("private/set_manifest",{apikey:D,body:{app_id:$,name:U,manifest:I},supaHost:F?.supaHost,supaAnon:F?.supaAnon});if(X.error){if(X.error instanceof i$.FunctionsHttpError){let Q=await X.error.context.json().catch(()=>({}));throw Error(Q.error||Q.status||Q.message||JSON.stringify(Q))}throw Error(X.error.message)}}async function yWD(D,$){if(!$.app_id||!$.name||!$.created_by)return l.error("missing app_id, name, or created_by"),Promise.reject(Error("missing app_id, name, or created_by"));let{data:U,error:I}=await D.from("channels").select().eq("app_id",$.app_id).eq("name",$.name).single();if(U&&!I)return D.from("channels").update($).eq("app_id",$.app_id).eq("name",$.name).select().single();return D.from("channels").insert($).select().single()}async function N4(D,$,U,I,F,J){if((_8(V1.CAPGO_DISABLE_TELEMETRY)||_8(V1.CAPGO_DISABLE_POSTHOG))&&!$.notifyConsole)return;try{let Q={};try{Q=SO()}catch(H){if(U)l.error(`Failed to enrich event tags, sending caller tags only: ${Y$(H)}`)}let Y={...$,nonPersonTags:{...Q,...$.nonPersonTags??{}}};if(U)l.info(`Get remove config: for ${$.event}`);let W=F??(await i3(!0,I)).hostApi;if(U)l.info(`Sending analytics event: ${JSON.stringify(Y)}`);let B=new AbortController,K=setTimeout(()=>B.abort(),1e4),q=I?typeof AbortSignal.any==="function"?AbortSignal.any([B.signal,I]):I:B.signal;try{let H=await fetch(`${F6(W)}/private/events`,{method:"POST",body:JSON.stringify(Y),headers:J0({"Content-Type":"application/json",capgkey:D}),signal:q,redirect:J});if(clearTimeout(K),!H.ok)throw Error(`HTTP error! status: ${H.status}`);let G=await H.json();if(G.error&&U)l.error(`Failed to send analytics event: ${G.error}`)}finally{clearTimeout(K)}}catch(Q){if(U)l.error("Failed to send Stats event details:"),l.error(Y$(Q))}}function f1D(D){if(l.error(`
|
|
258
|
+
`)}function YF(D){try{if(!QD(D))return;return lD(D,"utf8").trim()||void 0}catch{return}}function qC(){let D=V1.CAPGO_TOKEN?.trim();if(D)return D;let $=YF(`${DC()}/.capgo`);if($)return $;return YF(".capgo")}function sO(D=!1,$=(U)=>l.info(U)){let U=V1.CAPGO_TOKEN?.trim();if(U){if(!D)$("Use CAPGO_TOKEN environment variable");return U}let F=`${DC()}/.capgo`,J=YF(F);if(J){if(!D)$(`Use global API key ${F}`)}else if(F=".capgo",J=YF(F),J&&!D)$(`Use local API key ${F}`);if(!J){let Q=`No Capgo API key found. Run \`${rA()}\` first, then retry this command.`;throw l.error(Q),new ZD(Q)}return J}async function*UH(D){let $=await O2(D,{withFileTypes:!0});for(let U of $){let I=uD(D,U.name);if(U.isDirectory()&&!U.name.startsWith(".")&&!U.name.startsWith("node_modules")&&!U.name.startsWith("dist"))yield*UH(I);else yield I}}function VWD(D){let U=(D.endsWith(".br")?D.slice(0,-3):D).split(".").pop()?.toLowerCase()||"";return{html:"text/html",htm:"text/html",js:"application/javascript",mjs:"application/javascript",cjs:"application/javascript",css:"text/css",json:"application/json",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",mp4:"video/mp4",webm:"video/webm",xml:"application/xml",txt:"text/plain",md:"text/markdown",pdf:"application/pdf",wasm:"application/wasm",map:"application/json"}[U]||"application/octet-stream"}function L6(D,$){return`${D}-${$?"ts":"js"}`}function w6(D,$){if(!$)l.info(`Found ${D} project`)}function b1D(D){if(QD(uD(D,"angular.json")))return"angular";if(QD(uD(D,"nuxt.config.js"))||QD(uD(D,"nuxt.config.ts")))return"nuxtjs";if(QD(uD(D,"next.config.js"))||QD(uD(D,"next.config.mjs"))||QD(uD(D,"next.config.ts")))return"nextjs";if(QD(uD(D,"svelte.config.js"))||QD(uD(D,"svelte.config.ts")))return"sveltekit";if(QD(uD(D,"vue.config.js"))||QD(uD(D,"vue.config.ts")))return"vue"}function HC(D){if(D.get("@angular/core"))return"angular";if(D.get("nuxt"))return"nuxtjs";if(D.get("next"))return"nextjs";if(D.get("@sveltejs/kit"))return"sveltekit";if(D.get("svelte"))return"svelte";if(D.get("vue"))return"vue";if(D.get("react"))return"react"}async function P1D(D,$){let U=QD(uD(D,"tsconfig.json")),I=b1D(D);if(I)return w6(I,$),L6(I,U);let F=uD(D,C$);if(!QD(F))return;let J=await BF(void 0,F),X=HC(J);if(!X)return;return w6(X,$),L6(X,U)}function aq(D,$){if(!$)return;let U=uD($);if(!D.includes(U))D.push(U)}function C1D(D){let $=D,U=j1.parse($).root;while(!0){if(QD(uD($,C$)))return $;if($===U)return;let I=k0($);if(I===$)return;$=I}}function u1D(D){let $=[],U=D?.split(",").map((I)=>I.trim()).filter(Boolean)[0];if(U)aq($,k0(uD(U)));return aq($,C1D(D$())),aq($,_0(D$())),$}async function jWD(D){let $=D$(),U=!1,I=D?.quiet??!1;for(let J of u1D(D?.packageJsonPath)){let X=await P1D(J,I);if(X)return X}let F=uD($,"tsconfig.json");if(QD(F))U=!0;for await(let J of UH($)){if(J.includes("angular.json"))return w6("angular",I),L6("angular",U);if(J.includes("nuxt.config.js")||J.includes("nuxt.config.ts"))return w6("nuxtjs",I),L6("nuxtjs",U);if(J.includes("next.config.js")||J.includes("next.config.mjs")||J.includes("next.config.ts"))return w6("nextjs",I),L6("nextjs",U);if(J.includes("svelte.config.js")||J.includes("svelte.config.ts"))return w6("sveltekit",I),L6("sveltekit",U);if(J.includes("vue.config.js")||J.includes("vue.config.ts"))return w6("vue",I),L6("vue",U);if(J.includes(C$)){let X=k0(J),Q=await BF(X),Y=HC(Q);if(Y)return w6(Y,I),L6(Y,U)}}return"unknown"}function AWD(D,$,U=D$()){if(D==="angular-js"||D==="angular-ts")return $?"src/main.ts":"src/main.js";if(D==="nextjs-js"||D==="nextjs-ts")return $?"src/app/layout.tsx":"src/app/layout.js";if(D==="svelte-js"||D==="svelte-ts")return $?"src/main.ts":"src/main.js";if(D==="vue-js"||D==="vue-ts")return $?"src/main.ts":"src/main.js";if(D==="react-js"||D==="react-ts"){let I=$?"src/main.tsx":"src/main.js",F=$?"src/index.tsx":"src/index.js";if(QD(uD(U,I)))return I;return F}return null}async function RWD(D){let $=D.replace(/-(?:ts|js)$/,"");if($==="angular")return l.info("Angular project detected"),"build";if($==="nuxtjs")return l.info("Nuxtjs project detected"),"generate";if($==="nextjs"){if(l.info("Nextjs project detected"),l.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),l.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),!await T1({message:"Do you want to continue?"}))throw l.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}if($==="sveltekit"){if(l.info("Sveltekit project detected"),l.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),l.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adapter"),!await T1({message:"Do you want to continue?"}))throw l.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}return"build"}async function SWD(D=!1,$=D$()){let U=/(main|index)\.(ts|tsx|js|jsx)$/,I="",F=uD($),J=F.split("/").length;for await(let X of UH(F))if(X.split("/").length-J<=2&&U.test(X)){if(I=X,!D)l.info(`Found main file here ${X}`);break}return I}function TWD(D,$){return D.from("app_versions").upsert($,{onConflict:"name,app_id"}).eq("app_id",$.app_id).eq("name",$.name)}async function bWD(D,$,U,I){let F={app_id:$,name:U,version:0};try{let J=await KF("files/upload_link",{apikey:D,body:F,useFilesHost:!0,supaHost:I?.supaHost,supaAnon:I?.supaAnon});if(J.error){if(J.error instanceof i$.FunctionsHttpError){let X=await J.error.context.json().catch(()=>({}));l.error(`Upload URL error: ${X.status||JSON.stringify(X)}`)}else l.error(`Cannot get upload url: ${J.error.message}`);return""}return J.data?.url??""}catch(J){l.error(`Cannot get upload url ${Y$(J)}`)}return""}async function*NC(D){let $=O2(D,{withFileTypes:!0});for(let U of $){let I=GD(D,U.name);if(U.isDirectory())yield*NC(I);else yield I}}function kWD(D,$="5.10.0",U="6.25.0",I="7.25.0"){if(D.major===5&&O6(D,s$($)))return!0;if(D.major===6&&O6(D,s$(U)))return!0;if(D.major===7&&O6(D,s$(I)))return!0;return!1}async function _WD(D){let $=[],U=[".DS_Store",".git",".gitignore","node_modules","package-lock.json","tsconfig.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json"];for await(let I of NC(D)){if(U.some((Q)=>I.includes(Q))){l.info(`Ignoring file ${I}, please ensure you have only required files in your dist folder`);continue}let F=lD(I);if(F.length===0){l.info(`Ignoring empty file ${I}, please ensure you have only required files in your dist folder`);continue}let J=await CA(F,"sha256"),X=UC(D,I);if(X.startsWith("/"))X=X.substring(1);$.push({file:X,hash:J})}return $}async function xWD(D){if($C()==="win32")return _1D(D);else return k1D(D)}function k1D(D){let $=new DH.default;return $.addLocalFolder(D),$.toBuffer()}async function _1D(D){l.info("Zipping file windows mode");let $=new DH.default,U=(I,F)=>{let J=O2(I);for(let X of J){let Q=GD(I,X),Y=D1D(Q);if(Y.isFile()){let W=lD(Q);$.addFile(GD(F,X).split(FC).join("/"),W)}else if(Y.isDirectory())U(Q,GD(F,X))}};return U(D,""),$.toBuffer()}function x1D(D){let $=eq();return`App ${D} does not exist, run first \`${$.runner} @capgo/cli app add ${D}\` to create it`}function g1D(D){let U=D?.originalResponse?.getBody?.(),I=D instanceof Error?D.message:String(D??"");return`${U??""} ${I}`.includes("app_not_found")}async function gWD(D,$,U,I,F,J,X,Q){return new Promise((Y,W)=>{N4(D,{channel:"app",event:"App TUS upload",org_id:U,tracking_version:2,tags:{"app-id":I}}),new WF.Upload($,{endpoint:`${X.hostFilesApi}/files/upload/attachments/`,chunkSize:Q,retryDelays:[...X1D],metadataForPartialUploads:{filename:`orgs/${U}/apps/${I}/${F}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${U}/apps/${I}/${F}.zip`,filetype:"application/zip"},headers:J0({Authorization:D}),onError(K){if(l.error(`Error uploading bundle: ${K.message}`),g1D(K)){W(Error(x1D(I)));return}if(K instanceof WF.DetailedError){let q=K.originalResponse?.getBody(),H=K.originalResponse?.getStatus(),G=K.originalRequest?.getURL(),z=(()=>{try{let N=JSON.parse(q||'{"error": "unknown error"}');return N.status||N.error||N.message||"unknown error"}catch{return q||K.message}})();W(Error(`TUS upload failed (status ${H??"unknown"}, url ${G??"unknown"}): ${z}`))}else W(Error(`TUS upload failed: ${K.message||K.toString()}`))},onProgress(K,q){let H=(K/q*100).toFixed(2);J.message(`Uploaded ${H}%`)},async onSuccess(){await N4(D,{channel:"app",event:"App TUS done",org_id:U,tracking_version:2,tags:{"app-id":I}}).catch(),Y(!0)}}).start()})}async function fWD(D,$,U,I){let J=await KF("private/delete_failed_version",{apikey:D,method:"DELETE",body:{app_id:$,name:U},supaHost:I?.supaHost,supaAnon:I?.supaAnon});if(J.error){if(J.error instanceof i$.FunctionsHttpError){let X=await J.error.context.json().catch(()=>({}));throw Error(X.status||X.message||JSON.stringify(X))}throw Error(J.error.message)}}async function yWD(D,$,U,I,F){let X=await KF("private/set_manifest",{apikey:D,body:{app_id:$,name:U,manifest:I},supaHost:F?.supaHost,supaAnon:F?.supaAnon});if(X.error){if(X.error instanceof i$.FunctionsHttpError){let Q=await X.error.context.json().catch(()=>({}));throw Error(Q.error||Q.status||Q.message||JSON.stringify(Q))}throw Error(X.error.message)}}async function mWD(D,$){if(!$.app_id||!$.name||!$.created_by)return l.error("missing app_id, name, or created_by"),Promise.reject(Error("missing app_id, name, or created_by"));let{data:U,error:I}=await D.from("channels").select().eq("app_id",$.app_id).eq("name",$.name).single();if(U&&!I)return D.from("channels").update($).eq("app_id",$.app_id).eq("name",$.name).select().single();return D.from("channels").insert($).select().single()}async function N4(D,$,U,I,F,J){if((_8(V1.CAPGO_DISABLE_TELEMETRY)||_8(V1.CAPGO_DISABLE_POSTHOG))&&!$.notifyConsole)return;try{let Q={};try{Q=SO()}catch(H){if(U)l.error(`Failed to enrich event tags, sending caller tags only: ${Y$(H)}`)}let Y={...$,nonPersonTags:{...Q,...$.nonPersonTags??{}}};if(U)l.info(`Get remove config: for ${$.event}`);let W=F??(await i3(!0,I)).hostApi;if(U)l.info(`Sending analytics event: ${JSON.stringify(Y)}`);let B=new AbortController,K=setTimeout(()=>B.abort(),1e4),q=I?typeof AbortSignal.any==="function"?AbortSignal.any([B.signal,I]):I:B.signal;try{let H=await fetch(`${F6(W)}/private/events`,{method:"POST",body:JSON.stringify(Y),headers:J0({"Content-Type":"application/json",capgkey:D}),signal:q,redirect:J});if(clearTimeout(K),!H.ok)throw Error(`HTTP error! status: ${H.status}`);let G=await H.json();if(G.error&&U)l.error(`Failed to send analytics event: ${G.error}`)}finally{clearTimeout(K)}}catch(Q){if(U)l.error("Failed to send Stats event details:"),l.error(Y$(Q))}}function f1D(D){if(l.error(`
|
|
259
259
|
\uD83D\uDD10 Access Denied: Two-Factor Authentication Required`),l.error("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"),D)l.error(`
|
|
260
260
|
The organization "${D}" requires all members to have 2FA enabled.`);else l.error(`
|
|
261
261
|
This organization requires all members to have 2FA enabled.`);throw l.error(`
|
|
262
262
|
To regain access:`),l.error(` 1. Go to ${QC("/settings/account")}`),l.error(" 2. Enable Two-Factor Authentication on your account"),l.error(" 3. Try your command again"),l.error(`
|
|
263
263
|
For more information, visit: https://capgo.app/docs/webapp/2fa-enforcement/
|
|
264
|
-
`),Error("2FA required for this organization")}async function y1D(D,$,U,I){return(await Promise.all(U.map(async(J)=>{return await zC(D,$,I,{orgId:J.gid})?J:null}))).filter((J)=>J!==null)}async function m1D(D,$,U){let{error:I,data:F}=await D.rpc("get_orgs_v7");if(I)throw l.error("Cannot get the list of organizations - exiting"),l.error(Y$(I)),Error("Cannot get the list of organizations");if(F.length===0)throw l.error("Could not get organization please create an organization first"),Error("No organizations available");let J=await y1D(D,$,F,U);if(J.length===0)throw l.error(`Could not find organization with permission: ${U}`),Error("Could not find organization with required permission");return{allOrganizations:F,allowedOrganizations:J}}async function
|
|
264
|
+
`),Error("2FA required for this organization")}async function y1D(D,$,U,I){return(await Promise.all(U.map(async(J)=>{return await zC(D,$,I,{orgId:J.gid})?J:null}))).filter((J)=>J!==null)}async function m1D(D,$,U){let{error:I,data:F}=await D.rpc("get_orgs_v7");if(I)throw l.error("Cannot get the list of organizations - exiting"),l.error(Y$(I)),Error("Cannot get the list of organizations");if(F.length===0)throw l.error("Could not get organization please create an organization first"),Error("No organizations available");let J=await y1D(D,$,F,U);if(J.length===0)throw l.error(`Could not find organization with permission: ${U}`),Error("Could not find organization with required permission");return{allOrganizations:F,allowedOrganizations:J}}async function hWD(D,$,U){let{allOrganizations:I,allowedOrganizations:F}=await m1D(D,$,U),J=F.length>1?await dH({message:"Please pick the organization that you want to insert to",options:F.map((Y)=>{let W=Y.enforcing_2fa&&!Y["2fa_has_access"]?" ⚠️ (2FA required)":"";return{value:Y.gid,label:`${Y.name}${W}`}})}):F[0].gid;if(M6(J))throw l.warn("Canceled organization selection, exiting"),new ZD("Organization selection cancelled");let X=J,Q=I.find((Y)=>Y.gid===X);if(Q.enforcing_2fa&&!Q["2fa_has_access"])f1D(Q.name);return l.info(`Using the organization "${Q.name}" as the app owner`),Q}async function h1D(D,$,U=!1){let{data:I,error:F}=await D.rpc("request_actor_user_id"),J=(I||"").toString();if(F){if(!U)l.error(F.message);throw F}if(!J){if(!U)l.error("Capgo authentication failed: invalid Capgo API key or insufficient Capgo permissions.");throw Error("Capgo authentication failed: invalid Capgo API key or insufficient Capgo permissions.")}return J}async function zC(D,$,U,I={}){let{data:F,error:J}=await D.rpc("cli_check_permission",{apikey:$,permission_key:U,org_id:I.orgId??null,app_id:I.appId??null,channel_id:I.channelId??null});if(J)throw l.error(`Cannot check permission ${U}`),l.error(Y$(J)),Error(`Cannot check permission ${U}`);return!!F}async function n1D(D,$,U,I={},F={}){if(await zC(D,$,U,I))return;let X=F.message||`Insufficient permissions for ${U}`;if(!F.silent)l.error(X);throw new ZD(`Insufficient permissions for ${U}`,{permissionKey:U,...I})}async function nWD(D,$,U,I,F,J){await h1D(D,$,J),await n1D(D,$,U,{orgId:I},{message:F,silent:J})}async function eO(D,$,U){let{data:I,error:F}=await KF(`app/${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,supaHost:U?.supaHost,supaAnon:U?.supaAnon});if(!I?.owner_org||F){let J=Y$(F);throw l.error(`Cannot get organization id for app id ${$}: ${J}`),new ZD("Cannot get organization id for app",{appId:$,cause:J})}return I.owner_org}function iWD(D){return new Date(D||"").toLocaleString()}function eq(){if(sq)return{pm:v1,command:Z2,installCommand:`${v1} ${Z2}`,runner:JF};let D=_0(D$());return v1=v2(D,"npm"),Z2=c3(v1),sq=!0,JF=GH(D),{pm:v1,command:Z2,installCommand:`${v1} ${Z2}`,runner:JF}}function lWD(D){v1=D.pm,Z2=D.command,JF=D.runner,sq=!0}function i1D(D,$){return{summary:`Best fix: recreate and sync ${$==="ios"?"iOS":"Android"} with this one-line command.`,command:`rm -rf ${$} && ${D} cap add ${$} && ${D} cap sync ${$}`}}function LC(D){return O2(D,{withFileTypes:!0}).flatMap((I)=>{let F=GD(D,I.name);if(I.isDirectory())return LC(F);else return F.split(`node_modules${FC}`)[1]||F})}function wC(D){if(!QD(D))return[];try{return O2(D,{withFileTypes:!0}).flatMap((I)=>{let F=GD(D,I.name);if(I.isDirectory())return wC(F);else return F})}catch{return[]}}function l1D(D,$){let U=[];if($==="ios"){try{let J=O2(D);for(let X of J)if(X.endsWith(".podspec"))U.push(GD(D,X))}catch{}let I=GD(D,"Package.swift"),F=GD(D,"ios","Package.swift");if(QD(I))U.push(I);if(QD(F))U.push(F)}else if($==="android"){let I=GD(D,"android"),F=GD(I,"build.gradle"),J=GD(I,"build.gradle.kts");if(QD(F))U.push(F);if(QD(J))U.push(J)}return U}async function d1D(D){let $=GD(D,"ios"),U=GD(D,"android"),I=async(X,Q)=>{let Y=QD(X)?wC(X).filter((H)=>KC.test(H)):[],W=l1D(D,Q),B=[...Y,...W].sort((H,G)=>H.localeCompare(G));if(B.length===0)return;let{createHash:K}=await import("node:crypto"),q=K("sha256");for(let H of B)try{let G=UC(D,H);q.update(G);let z=lD(H);q.update(z)}catch{}return q.digest("hex")},[F,J]=await Promise.all([I($,"ios"),I(U,"android")]);return{ios_checksum:F,android_checksum:J}}function c1D(D){let $=[],U=D,I=j1.parse(U).root;while(!0){if($.push(GD(U,"node_modules")),U===I)break;let F=k0(U);if(F===U)break;U=F}return $}async function p1D(D,$){let U=$?$.split(",").map((K)=>K.trim()).filter(Boolean):[],I;try{I=await BF("",D)}catch(K){throw l.error("Invalid package.json, JSON parsing failed"),l.error(`json parse error: ${Y$(K)}`),K instanceof Error?K:Error("Invalid package.json")}let F=D?D.split(",")[0].trim():void 0,J=!F?_0(D$()):j1.resolve(F).replace(C$,"");if(!I)throw l.error("Missing dependencies section in package.json"),Error("Missing dependencies section in package.json");for(let[K,q]of Object.entries(I))if(typeof q!=="string")throw l.error(`Invalid dependency ${K}: ${q}, expected string, got ${typeof q}`),Error(`Invalid dependency ${K}: expected string version`);let X=U.length===0?c1D(D$()):U;if(!X.some((K)=>QD(K))){let K=v2(J,"npm"),q=c3(K);throw l.error(`Missing node_modules folder at ${X.join(", ")}, please run ${K} ${q}`),Error("Missing node_modules folder")}let Y=!1,W=await q1D(_0(D$()),D),B=await Promise.all(Array.from(I.entries()).map(async([K,q])=>{let H=!1,G=!1,z=q,N=W.get(K)??q,M;for(let v of X){let A=GD(v,K);if(QD(A)){H=!0,M=A;try{let V=GD(A,C$);if(QD(V)){let b=JSON.parse(lD(V,"utf-8"));if(b.version)z=b.version}}catch{}if(!Z1D(A))continue;try{if(LC(A).some((b)=>KC.test(b))){G=!0;break}}catch(V){throw l.error(`Error reading node_modules files for ${K} package in ${v}`),l.error(Y$(V)),V instanceof Error?V:Error(`Error reading node_modules files for ${K}`)}}}if(!H){Y=!0;let v=v2(J,"npm"),A=c3(v);return l.error(`Missing dependency ${K}, please run ${v} ${A}`),{name:K,version:z,requested_version:N}}let Z,L;if(G&&M){let v=await d1D(M);Z=v.ios_checksum,L=v.android_checksum}return{name:K,version:z,requested_version:N,native:G,ios_checksum:Z,android_checksum:L}}));if(Y||B.some((K)=>K.native===void 0))throw l.error("Missing dependencies or invalid dependencies"),l.error("If you use monorepo, workspace or any special package manager you can use the --package-json [path,] and --node-modules [path,] options to make the command work properly"),Error("Missing dependencies or invalid dependencies");return B}async function dWD(D,$,U){let{data:I,error:F}=await D.from("channels").select("version:app_versions!channels_version_fkey(checksum)").eq("name",U).eq("app_id",$).single(),J=I;if(F||J===null||!J.version||!J.version.checksum)return null;return J.version.checksum}function eP(D){if(!D)throw l.error("Error parsing native packages, perhaps the metadata does not exist in Capgo?"),Error("Error parsing native packages");for(let U of D){let I=Aq(XP,U);if(!I.success){let F=I.error.issues.map((J)=>`${(J.path??[]).join(".")}: ${J.message}`).join(", ");throw l.error(`Invalid remote native package data: ${F}`),Error(`Invalid remote native package data: ${F}`)}}return new Map(D.map((U)=>[U.name,U]))}async function ZC(D,$,U){let{data:I,error:F}=await D.from("channels").select(`version:app_versions!channels_version_fkey(
|
|
265
265
|
native_packages
|
|
266
|
-
)`).eq("name",U).eq("app_id",$).maybeSingle();if(F){let X=F.code==="PGRST116"||F.message?.includes("Cannot coerce")?`Multiple channels matched for app "${$}" and channel "${U}". Contact support if this persists.`:F.message;throw l.error(`Error fetching native packages: ${X}`),Error(`Error fetching native packages: ${X}`)}if(!I)return eP([]);return eP(I.version?.native_packages??[])}function DE(D,$){return D||$?.plugins?.CapacitorUpdater?.appId||$?.appId}function r1D(D){let $=[];if(!D.localVersion)return{compatible:!0,reasons:[],message:"Package only exists on remote (will be removed)"};if(!D.remoteVersion)return $.push("new_plugin"),{compatible:!1,reasons:$,message:"New native plugin added (requires app store update)"};let U=!1;try{let K=W9(D.localVersion),q=W9(D.remoteVersion);U=QN(K,q)}catch{U=!1}if(!U)$.push("version_mismatch");if(D.localRequestedVersion&&D.remoteRequestedVersion&&D.localRequestedVersion.trim()!==D.remoteRequestedVersion.trim())$.push("requested_version_changed");let I=(K)=>typeof K==="string"&&K.trim().length>0,F=I(D.localIosChecksum)&&I(D.remoteIosChecksum)&&D.localIosChecksum!==D.remoteIosChecksum,J=I(D.localAndroidChecksum)&&I(D.remoteAndroidChecksum)&&D.localAndroidChecksum!==D.remoteAndroidChecksum;if(F&&J)$.push("both_platforms_changed");else if(F)$.push("ios_code_changed");else if(J)$.push("android_code_changed");let X=I(D.localIosChecksum)!==I(D.remoteIosChecksum),Q=I(D.localAndroidChecksum)!==I(D.remoteAndroidChecksum);if(X||Q)$.push("platform_checksum_metadata_changed");let Y=[],W=(K)=>K!=="requested_version_changed";for(let K of $)switch(K){case"version_mismatch":Y.push(`version changed: ${D.remoteVersion} → ${D.localVersion}`);break;case"requested_version_changed":Y.push(`requested version changed: ${D.remoteRequestedVersion??"unknown"} → ${D.localRequestedVersion??"unknown"}`);break;case"ios_code_changed":Y.push("iOS native code changed");break;case"android_code_changed":Y.push("Android native code changed");break;case"both_platforms_changed":Y.push("iOS and Android native code changed");break;case"platform_checksum_metadata_changed":Y.push("iOS/Android checksum metadata appeared or disappeared (may be Capgo CLI change — verify native code)");break;case"new_plugin":Y.push("new plugin (requires app store update)");break;case"removed_plugin":Y.push("plugin removed");break}if(!$.some(W))return{compatible:!0,reasons:$,message:Y.length>0?Y.join(", "):"Compatible"};return{compatible:!1,reasons:$,message:Y.join(", ")}}function dWD(D){return r1D(D).compatible}async function cWD(D,$,U,I,F){let J=await p1D(I,F),X=await ZC(D,$,U),Q=J.filter((W)=>!!W.native).map((W)=>{let B=X.get(W.name);if(B)return{name:W.name,localVersion:W.version,localRequestedVersion:W.requested_version,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,localIosChecksum:W.ios_checksum,remoteIosChecksum:B.ios_checksum,localAndroidChecksum:W.android_checksum,remoteAndroidChecksum:B.android_checksum};return{name:W.name,localVersion:W.version,localRequestedVersion:W.requested_version,remoteVersion:void 0,localIosChecksum:W.ios_checksum,localAndroidChecksum:W.android_checksum}}),Y=[...X].filter(([W])=>!J.some((B)=>B.name===W)).map(([W,B])=>({name:W,localVersion:void 0,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,remoteIosChecksum:B.ios_checksum,remoteAndroidChecksum:B.android_checksum}));return Q.push(...Y),{finalCompatibility:Q,localDependencies:J}}async function pWD(D,$,U,I){let F=await ZC(D,$,U),J=I.map((Q)=>{let Y=F.get(Q.name);if(Y)return{name:Q.name,localVersion:Q.version,localRequestedVersion:Q.requested_version,remoteVersion:Y.version,remoteRequestedVersion:Y.requested_version,localIosChecksum:Q.ios_checksum,remoteIosChecksum:Y.ios_checksum,localAndroidChecksum:Q.android_checksum,remoteAndroidChecksum:Y.android_checksum};return{name:Q.name,localVersion:Q.version,localRequestedVersion:Q.requested_version,remoteVersion:void 0,localIosChecksum:Q.ios_checksum,localAndroidChecksum:Q.android_checksum}}),X=[...F].filter(([Q])=>!I.some((Y)=>Y.name===Q)).map(([Q,Y])=>({name:Q,localVersion:void 0,remoteVersion:Y.version,remoteRequestedVersion:Y.requested_version,remoteIosChecksum:Y.ios_checksum,remoteAndroidChecksum:Y.android_checksum}));return J.push(...X),{finalCompatibility:J,localDependencies:I}}function MC(D){if(!QD(D))return null;try{return JSON.parse(lD(D,"utf-8"))}catch{return null}}function IF(D){if(!D)return!1;return/@capgo\/capacitor-updater|CapgoCapacitorUpdater|CapacitorUpdaterPlugin/.test(D)}function o1D(D){let $=MC(D);if(!$)return!1;let U=$.packageClassList;return Array.isArray(U)&&U.includes("CapacitorUpdaterPlugin")}function t1D(D,$){if(!$)return GD(D,C$);return j1.isAbsolute($)?$:uD(D,$)}function a1D(D=D$(),$){let U=t1D(D,$),I=j1.basename(U)===C$?k0(U):U,F=[GD(I,"ios","App"),GD(D,"ios","App")].find((V)=>QD(V));if(!F)return{shouldCheck:!1,valid:!0,details:[]};let J=MC(U),X={...J?.dependencies,...J?.devDependencies,...J?.optionalDependencies},Q=Object.hasOwn(X,"@capgo/capacitor-updater"),Y=[I,D].some((V)=>QD(GD(V,"node_modules","@capgo","capacitor-updater"))),W=GD(F,"Podfile"),B=GD(F,"CapApp-SPM","Package.swift"),K=QD(W)?lD(W,"utf-8"):void 0,q=QD(B)?lD(B,"utf-8"):void 0,H=IF(K)||IF(q),G=GD(F,"Podfile.lock"),z=GD(F,"App","capacitor.plugins.json"),N=GD(F,"App","capacitor.config.json"),M=QD(G)?lD(G,"utf-8"):void 0,Z=QD(z)?lD(z,"utf-8"):void 0,L=IF(M)||IF(Z)||o1D(N);if(!(Q||Y||H||L))return{shouldCheck:!1,valid:!0,details:[]};let A=[];if(!H)A.push(`Missing @capgo/capacitor-updater in iOS dependency files (${W} or ${B})`);if(!L)A.push(`Missing @capgo/capacitor-updater in iOS native project outputs (${G}, ${z}, or ${N})`);return{shouldCheck:!0,valid:H&&L,details:A}}function s1D(D,$,U){if(!D.shouldCheck||D.valid)return;let I=i1D($,"ios");U?.(),l.error("Capgo iOS dependency sync verification failed.");for(let F of D.details)l.error(F);throw l.error("Stop here to avoid testing on a broken native iOS project."),l.warn(I.summary),l.info(I.command),new ZD(_X)}async function rWD(D,$,U,I){let F=await T1({message:"Would you like to sync your project with Capacitor now? This is recommended to ensure encrypted updates work properly."});if(M6(F)){if(D&&$&&U)await H4("onboarding-v2",$,U,"canceled");throw l.warn("Canceled Capacitor sync"),new ZD("Capacitor sync cancelled")}if(F){let J=eq(),X=b1();X.start("Running the command...");let Q;try{await new Promise((Y,W)=>{let B=e6D(J.runner,["cap","sync"],{stdio:"pipe"});B.on("close",(K)=>{if(K===0)Y();else W(Error(`Command failed with exit code ${K}`))}),B.on("error",(K)=>{W(K)})})}catch(Y){Q=Y,l.error(`Failed to run Capacitor sync: ${Y}`),l.warn(`Please run "${J.runner} cap sync" manually to ensure encrypted updates work properly`)}if(I?.validateIosUpdater)s1D(a1D(D$(),I.packageJsonPath),J.runner,()=>X.stop("iOS sync check failed ❌"));if(Q){X.stop("Error");return}X.stop("Capacitor sync completed ✅")}else{let J=eq();l.warn("⚠️ Important: If you upload encrypted bundles without syncing, updates will fail!"),l.info(`Remember to run "${J.runner} cap sync" before uploading encrypted bundles`)}}var DH,$H,XC,WF,l,$1D=".capgo_key",U1D=".capgo_key_v2",DWD,$WD,rP="https://capgo.app",oP="https://files.capgo.app",XF="https://api.capgo.app",QF="https://console.capgo.app",UWD=120000,F1D=20971520,I1D=1073741824,J1D=103809024,X1D,Q1D=1e4,IWD="BundleUploadTimeoutError",C$="package.json",tP="Cannot connect to server please try again later",XWD,Y1D=12,YC=2000,N1D="No capacitor config file found, run `cap init` first",KC,oq=null,FF=null,bWD="5.10.0",PWD="6.25.0",CWD="7.0.30",sq=!1,v1="npm",Z2="install",JF="npx";var MJ=T(()=>{qH();y0();iF();_z();d3();TO();xO();fO();aO();FE();vX();uA();nA();xX();oA();QP();WP();Z6();Rq();zP();LP();MP();DH=h$(HL(),1),$H=h$(XI(),1),XC=h$(tL(),1),WF=h$(vO(),1);l={error:(D)=>UF("error",D),info:(D)=>UF("info",D),success:(D)=>UF("success",D),warn:(D)=>UF("warn",D)},DWD=`${$1D}.pub`,$WD=`${U1D}.pub`;X1D=[0,1000,3000,5000,1e4];XWD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i;KC=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/});import{exit as Y4D}from"node:process";import{workerData as W4D}from"node:worker_threads";d3();MJ();async function OC(D,$){let{project:U,apiHost:I,anonKey:F,apikey:J,command:X,attemptId:Q}=D;KH(X);let Y=async(G,z,N={})=>{try{await N4(J,{channel:$.channel,event:G,tracking_version:2,timestamp:new Date(z),tags:{app_id:U.appId},nonPersonTags:{attempt_id:Q,command_path:X,...N}},!1,AbortSignal.timeout(500),I,"error")}catch{}};await Y("scan_started",Date.now());let W=Date.now(),B=W,K="error",q="not_attempted",H;try{if(K=$.scan(U),B=Date.now(),K!=="found")return;q="failed";let G=await fetch(`${F6(I)}/app/${encodeURIComponent(U.appId)}`,{method:"PUT",headers:J0({"Content-Type":"application/json",Authorization:I.includes("/functions/v1")&&F?`Bearer ${F}`:J,capgkey:J}),body:JSON.stringify({onboarding:{steps:{[$.step]:{status:"done"}}}}),redirect:"error"});H=G.status,q=G.ok?"success":"rejected",await G.body?.cancel()}finally{if(K==="error")B=Date.now();await Y("scan_ended",B,{result:K,duration_ms:B-W,todo_report_status:q,...H===void 0?{}:{todo_report_http_status:H}})}}import{join as Q4D}from"node:path";import{existsSync as EC,readFileSync as FH}from"node:fs";import{createRequire as e1D}from"node:module";import{dirname as IH,join as D4D}from"node:path";import $4D from"node:process";var U4D="@capgo/capacitor-updater",F4D="@capacitor/splash-screen";function I4D(D){if(!EC(D))return null;try{return JSON.parse(FH(D,"utf-8"))}catch{return null}}function J4D(D,$){let U=I4D(D);if(!U)return{version:null,section:null};let I=["dependencies","devDependencies","optionalDependencies"];for(let F of I){let J=U[F];if(!J||!Object.hasOwn(J,$))continue;let X=J[$];return{version:typeof X==="string"?X:String(X),section:F}}return{version:null,section:null}}function X4D(D,$){let I=IH(D);while(!0){let F=D4D(I,"node_modules",$,"package.json");if(EC(F))try{let X=JSON.parse(FH(F,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}let J=IH(I);if(J===I)break;I=J}if(!$4D.versions.pnp)return null;try{let J=e1D(D).resolve(`${$}/package.json`),X=JSON.parse(FH(J,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}return null}function vC(D,$){let U=IH(D),I=J4D(D,$),F=X4D(D,$),J=[];if(!I.version)J.push(`Missing ${$} in ${D}`);if(!F)J.push(`Cannot resolve ${$} from ${U}/node_modules`);return{packageJsonPath:D,projectDir:U,declaredVersion:I.version,declaredIn:I.section,installedVersion:F,ready:J.length===0,details:J}}function VC(D){return vC(D,U4D)}function FBD(D){return vC(D,F4D)}function jC(D){return VC(Q4D(D.dir,"package.json")).ready?"found":"not_found"}OC(W4D,{channel:"updater-installed",step:"add_updater",scan:jC}).catch(()=>{}).finally(()=>Y4D(0));
|
|
266
|
+
)`).eq("name",U).eq("app_id",$).maybeSingle();if(F){let X=F.code==="PGRST116"||F.message?.includes("Cannot coerce")?`Multiple channels matched for app "${$}" and channel "${U}". Contact support if this persists.`:F.message;throw l.error(`Error fetching native packages: ${X}`),Error(`Error fetching native packages: ${X}`)}if(!I)return eP([]);return eP(I.version?.native_packages??[])}function DE(D,$){return D||$?.plugins?.CapacitorUpdater?.appId||$?.appId}function r1D(D){let $=[];if(!D.localVersion)return{compatible:!0,reasons:[],message:"Package only exists on remote (will be removed)"};if(!D.remoteVersion)return $.push("new_plugin"),{compatible:!1,reasons:$,message:"New native plugin added (requires app store update)"};let U=!1;try{let K=W9(D.localVersion),q=W9(D.remoteVersion);U=QN(K,q)}catch{U=!1}if(!U)$.push("version_mismatch");if(D.localRequestedVersion&&D.remoteRequestedVersion&&D.localRequestedVersion.trim()!==D.remoteRequestedVersion.trim())$.push("requested_version_changed");let I=(K)=>typeof K==="string"&&K.trim().length>0,F=I(D.localIosChecksum)&&I(D.remoteIosChecksum)&&D.localIosChecksum!==D.remoteIosChecksum,J=I(D.localAndroidChecksum)&&I(D.remoteAndroidChecksum)&&D.localAndroidChecksum!==D.remoteAndroidChecksum;if(F&&J)$.push("both_platforms_changed");else if(F)$.push("ios_code_changed");else if(J)$.push("android_code_changed");let X=I(D.localIosChecksum)!==I(D.remoteIosChecksum),Q=I(D.localAndroidChecksum)!==I(D.remoteAndroidChecksum);if(X||Q)$.push("platform_checksum_metadata_changed");let Y=[],W=(K)=>K!=="requested_version_changed";for(let K of $)switch(K){case"version_mismatch":Y.push(`version changed: ${D.remoteVersion} → ${D.localVersion}`);break;case"requested_version_changed":Y.push(`requested version changed: ${D.remoteRequestedVersion??"unknown"} → ${D.localRequestedVersion??"unknown"}`);break;case"ios_code_changed":Y.push("iOS native code changed");break;case"android_code_changed":Y.push("Android native code changed");break;case"both_platforms_changed":Y.push("iOS and Android native code changed");break;case"platform_checksum_metadata_changed":Y.push("iOS/Android checksum metadata appeared or disappeared (may be Capgo CLI change — verify native code)");break;case"new_plugin":Y.push("new plugin (requires app store update)");break;case"removed_plugin":Y.push("plugin removed");break}if(!$.some(W))return{compatible:!0,reasons:$,message:Y.length>0?Y.join(", "):"Compatible"};return{compatible:!1,reasons:$,message:Y.join(", ")}}function cWD(D){return r1D(D).compatible}async function pWD(D,$,U,I,F){let J=await p1D(I,F),X=await ZC(D,$,U),Q=J.filter((W)=>!!W.native).map((W)=>{let B=X.get(W.name);if(B)return{name:W.name,localVersion:W.version,localRequestedVersion:W.requested_version,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,localIosChecksum:W.ios_checksum,remoteIosChecksum:B.ios_checksum,localAndroidChecksum:W.android_checksum,remoteAndroidChecksum:B.android_checksum};return{name:W.name,localVersion:W.version,localRequestedVersion:W.requested_version,remoteVersion:void 0,localIosChecksum:W.ios_checksum,localAndroidChecksum:W.android_checksum}}),Y=[...X].filter(([W])=>!J.some((B)=>B.name===W)).map(([W,B])=>({name:W,localVersion:void 0,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,remoteIosChecksum:B.ios_checksum,remoteAndroidChecksum:B.android_checksum}));return Q.push(...Y),{finalCompatibility:Q,localDependencies:J}}async function rWD(D,$,U,I){let F=await ZC(D,$,U),J=I.map((Q)=>{let Y=F.get(Q.name);if(Y)return{name:Q.name,localVersion:Q.version,localRequestedVersion:Q.requested_version,remoteVersion:Y.version,remoteRequestedVersion:Y.requested_version,localIosChecksum:Q.ios_checksum,remoteIosChecksum:Y.ios_checksum,localAndroidChecksum:Q.android_checksum,remoteAndroidChecksum:Y.android_checksum};return{name:Q.name,localVersion:Q.version,localRequestedVersion:Q.requested_version,remoteVersion:void 0,localIosChecksum:Q.ios_checksum,localAndroidChecksum:Q.android_checksum}}),X=[...F].filter(([Q])=>!I.some((Y)=>Y.name===Q)).map(([Q,Y])=>({name:Q,localVersion:void 0,remoteVersion:Y.version,remoteRequestedVersion:Y.requested_version,remoteIosChecksum:Y.ios_checksum,remoteAndroidChecksum:Y.android_checksum}));return J.push(...X),{finalCompatibility:J,localDependencies:I}}function MC(D){if(!QD(D))return null;try{return JSON.parse(lD(D,"utf-8"))}catch{return null}}function IF(D){if(!D)return!1;return/@capgo\/capacitor-updater|CapgoCapacitorUpdater|CapacitorUpdaterPlugin/.test(D)}function o1D(D){let $=MC(D);if(!$)return!1;let U=$.packageClassList;return Array.isArray(U)&&U.includes("CapacitorUpdaterPlugin")}function t1D(D,$){if(!$)return GD(D,C$);return j1.isAbsolute($)?$:uD(D,$)}function a1D(D=D$(),$){let U=t1D(D,$),I=j1.basename(U)===C$?k0(U):U,F=[GD(I,"ios","App"),GD(D,"ios","App")].find((V)=>QD(V));if(!F)return{shouldCheck:!1,valid:!0,details:[]};let J=MC(U),X={...J?.dependencies,...J?.devDependencies,...J?.optionalDependencies},Q=Object.hasOwn(X,"@capgo/capacitor-updater"),Y=[I,D].some((V)=>QD(GD(V,"node_modules","@capgo","capacitor-updater"))),W=GD(F,"Podfile"),B=GD(F,"CapApp-SPM","Package.swift"),K=QD(W)?lD(W,"utf-8"):void 0,q=QD(B)?lD(B,"utf-8"):void 0,H=IF(K)||IF(q),G=GD(F,"Podfile.lock"),z=GD(F,"App","capacitor.plugins.json"),N=GD(F,"App","capacitor.config.json"),M=QD(G)?lD(G,"utf-8"):void 0,Z=QD(z)?lD(z,"utf-8"):void 0,L=IF(M)||IF(Z)||o1D(N);if(!(Q||Y||H||L))return{shouldCheck:!1,valid:!0,details:[]};let A=[];if(!H)A.push(`Missing @capgo/capacitor-updater in iOS dependency files (${W} or ${B})`);if(!L)A.push(`Missing @capgo/capacitor-updater in iOS native project outputs (${G}, ${z}, or ${N})`);return{shouldCheck:!0,valid:H&&L,details:A}}function s1D(D,$,U){if(!D.shouldCheck||D.valid)return;let I=i1D($,"ios");U?.(),l.error("Capgo iOS dependency sync verification failed.");for(let F of D.details)l.error(F);throw l.error("Stop here to avoid testing on a broken native iOS project."),l.warn(I.summary),l.info(I.command),new ZD(_X)}async function oWD(D,$,U,I){let F=await T1({message:"Would you like to sync your project with Capacitor now? This is recommended to ensure encrypted updates work properly."});if(M6(F)){if(D&&$&&U)await H4("onboarding-v2",$,U,"canceled");throw l.warn("Canceled Capacitor sync"),new ZD("Capacitor sync cancelled")}if(F){let J=eq(),X=b1();X.start("Running the command...");let Q;try{await new Promise((Y,W)=>{let B=e6D(J.runner,["cap","sync"],{stdio:"pipe"});B.on("close",(K)=>{if(K===0)Y();else W(Error(`Command failed with exit code ${K}`))}),B.on("error",(K)=>{W(K)})})}catch(Y){Q=Y,l.error(`Failed to run Capacitor sync: ${Y}`),l.warn(`Please run "${J.runner} cap sync" manually to ensure encrypted updates work properly`)}if(I?.validateIosUpdater)s1D(a1D(D$(),I.packageJsonPath),J.runner,()=>X.stop("iOS sync check failed ❌"));if(Q){X.stop("Error");return}X.stop("Capacitor sync completed ✅")}else{let J=eq();l.warn("⚠️ Important: If you upload encrypted bundles without syncing, updates will fail!"),l.info(`Remember to run "${J.runner} cap sync" before uploading encrypted bundles`)}}var DH,$H,XC,WF,l,$1D=".capgo_key",U1D=".capgo_key_v2",$WD,UWD,rP="https://capgo.app",oP="https://files.capgo.app",XF="https://api.capgo.app",QF="https://console.capgo.app",FWD=120000,F1D=20971520,I1D=1073741824,J1D=103809024,X1D,Q1D=1e4,JWD="BundleUploadTimeoutError",C$="package.json",tP="Cannot connect to server please try again later",QWD,Y1D=12,YC=2000,N1D="No capacitor config file found, run `cap init` first",KC,oq=null,FF=null,PWD="5.10.0",CWD="6.25.0",uWD="7.0.30",sq=!1,v1="npm",Z2="install",JF="npx";var MJ=T(()=>{qH();y0();iF();_z();d3();TO();xO();fO();aO();FE();vX();uA();nA();xX();oA();QP();WP();Z6();Rq();zP();LP();MP();DH=h$(HL(),1),$H=h$(XI(),1),XC=h$(tL(),1),WF=h$(vO(),1);l={error:(D)=>UF("error",D),info:(D)=>UF("info",D),success:(D)=>UF("success",D),warn:(D)=>UF("warn",D)},$WD=`${$1D}.pub`,UWD=`${U1D}.pub`;X1D=[0,1000,3000,5000,1e4];QWD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i;KC=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/});import{exit as Y4D}from"node:process";import{workerData as W4D}from"node:worker_threads";d3();MJ();async function OC(D,$){let{project:U,apiHost:I,anonKey:F,apikey:J,command:X,attemptId:Q}=D;KH(X);let Y=async(G,z,N={})=>{try{await N4(J,{channel:$.channel,event:G,tracking_version:2,timestamp:new Date(z),tags:{app_id:U.appId},nonPersonTags:{attempt_id:Q,command_path:X,...N}},!1,AbortSignal.timeout(500),I,"error")}catch{}};await Y("scan_started",Date.now());let W=Date.now(),B=W,K="error",q="not_attempted",H;try{if(K=$.scan(U),B=Date.now(),K!=="found")return;q="failed";let G=await fetch(`${F6(I)}/app/${encodeURIComponent(U.appId)}`,{method:"PUT",headers:J0({"Content-Type":"application/json",Authorization:I.includes("/functions/v1")&&F?`Bearer ${F}`:J,capgkey:J}),body:JSON.stringify({onboarding:{steps:{[$.step]:{status:"done"}}}}),redirect:"error"});H=G.status,q=G.ok?"success":"rejected",await G.body?.cancel()}finally{if(K==="error")B=Date.now();await Y("scan_ended",B,{result:K,duration_ms:B-W,todo_report_status:q,...H===void 0?{}:{todo_report_http_status:H}})}}import{join as Q4D}from"node:path";import{existsSync as EC,readFileSync as FH}from"node:fs";import{createRequire as e1D}from"node:module";import{dirname as IH,join as D4D}from"node:path";import $4D from"node:process";var U4D="@capgo/capacitor-updater",F4D="@capacitor/splash-screen";function I4D(D){if(!EC(D))return null;try{return JSON.parse(FH(D,"utf-8"))}catch{return null}}function J4D(D,$){let U=I4D(D);if(!U)return{version:null,section:null};let I=["dependencies","devDependencies","optionalDependencies"];for(let F of I){let J=U[F];if(!J||!Object.hasOwn(J,$))continue;let X=J[$];return{version:typeof X==="string"?X:String(X),section:F}}return{version:null,section:null}}function X4D(D,$){let I=IH(D);while(!0){let F=D4D(I,"node_modules",$,"package.json");if(EC(F))try{let X=JSON.parse(FH(F,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}let J=IH(I);if(J===I)break;I=J}if(!$4D.versions.pnp)return null;try{let J=e1D(D).resolve(`${$}/package.json`),X=JSON.parse(FH(J,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}return null}function vC(D,$){let U=IH(D),I=J4D(D,$),F=X4D(D,$),J=[];if(!I.version)J.push(`Missing ${$} in ${D}`);if(!F)J.push(`Cannot resolve ${$} from ${U}/node_modules`);return{packageJsonPath:D,projectDir:U,declaredVersion:I.version,declaredIn:I.section,installedVersion:F,ready:J.length===0,details:J}}function VC(D){return vC(D,U4D)}function IBD(D){return vC(D,F4D)}function jC(D){return VC(Q4D(D.dir,"package.json")).ready?"found":"not_found"}OC(W4D,{channel:"updater-installed",step:"add_updater",scan:jC}).catch(()=>{}).finally(()=>Y4D(0));
|