67router 1.0.3 → 1.0.5
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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +3 -3
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +17 -17
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +3 -3
- package/app/.next-cli-build/server/chunks/1712.js +2 -0
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/6540.js +1 -1
- package/app/.next-cli-build/server/chunks/7037.js +1 -1
- package/app/.next-cli-build/server/chunks/827.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/915.js +2 -2
- package/app/.next-cli-build/server/chunks/9604.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{1321-10507ce87a2d1e74.js → 1321-a966036b7e3ae8c3.js} +1 -1
- package/app/.next-cli-build/static/chunks/5497-3cf29976f188352b.js +7 -0
- package/app/.next-cli-build/static/css/d9ba36d87937fec6.css +1 -0
- package/app/cli/.build-home/AppData/Roaming/67router/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/67router/db/data.sqlite-wal +0 -0
- package/app/package.json +1 -2
- package/app/src/mitm/server.js +193 -51
- package/package.json +3 -4
- package/app/.next-cli-build/server/chunks/1260.js +0 -1
- package/app/.next-cli-build/static/chunks/5497-3353154ebc0a5eb1.js +0 -7
- package/app/.next-cli-build/static/css/1b93179163bad564.css +0 -1
- /package/app/.next-cli-build/static/{eXoiEKu5yWZkk7npUXFrc → RC_KHxUynSqU7uk0euJap}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{eXoiEKu5yWZkk7npUXFrc → RC_KHxUynSqU7uk0euJap}/_ssgManifest.js +0 -0
package/app/src/mitm/server.js
CHANGED
|
@@ -1,60 +1,202 @@
|
|
|
1
|
-
var
|
|
2
|
-
HEADERS: ${JSON.stringify(
|
|
1
|
+
var Qh=Object.defineProperty;var tT=Object.getOwnPropertyDescriptor;var rT=Object.getOwnPropertyNames;var nT=Object.prototype.hasOwnProperty;var NA=(r,e)=>()=>(r&&(e=r(r=0)),e);var l=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),qA=(r,e)=>{for(var t in e)Qh(r,t,{get:e[t],enumerable:!0})},iT=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of rT(e))!nT.call(r,i)&&i!==t&&Qh(r,i,{get:()=>e[i],enumerable:!(n=tT(e,i))||n.enumerable});return r};var g=r=>iT(Qh({},"__esModule",{value:!0}),r);var Es=l((Yq,UA)=>{var sT=require("fs"),Gl=require("path"),RA=require("os"),ey="9router";function MA(){return process.platform==="win32"?Gl.join(process.env.APPDATA||Gl.join(RA.homedir(),"AppData","Roaming"),ey):Gl.join(RA.homedir(),`.${ey}`)}function oT(){let r=process.env.DATA_DIR;if(!r)return MA();try{return sT.mkdirSync(r,{recursive:!0}),r}catch(e){if(e?.code==="EACCES"||e?.code==="EPERM")return console.warn(`[DATA_DIR] '${r}' not writable \u2192 fallback ~/.${ey}`),MA();throw e}}var DA=oT(),aT=Gl.join(DA,"mitm");UA.exports={DATA_DIR:DA,MITM_DIR:aT}});var Ta=l((Zq,VA)=>{var $A=require("fs"),cT=process.env.NODE_ENV==="development",uT=(()=>{if(process.platform==="win32")return null;for(let r of["/usr/sbin/lsof","/usr/bin/lsof","/sbin/lsof"])try{return $A.accessSync(r,$A.constants.X_OK),r}catch{}return"lsof"})(),lT=["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","runtime.us-east-1.kiro.dev","api2.cursor.sh"],LA={antigravity:[":generateContent",":streamGenerateContent"],copilot:["/chat/completions","/v1/messages","/responses"],kiro:["/generateAssistantResponse"],cursor:["/BidiAppend","/RunSSE","/RunPoll","/Run"]};function fT(r,e){return(LA[r]||[]).some(n=>(e.url||"").includes(n))?!0:r==="kiro"?String(e.headers?.["x-amz-target"]||"").includes("GenerateAssistantResponse"):!1}var dT={antigravity:{"gemini-default":"gemini-3.8-flash-medium","gemini-3.5-flash-high":"gemini-3.8-flash-high","gemini-3.5-flash-medium":"gemini-3.8-flash-medium","gemini-3.5-flash-low":"gemini-3.8-flash-low","gemini-3.5-flash-extra-low":"gemini-3.8-flash-low","gemini-3.8-flash":"gemini-3.8-flash-medium","gemini-3.8-flash-high":"gemini-3.8-flash-high","gemini-3.8-flash-medium":"gemini-3.8-flash-medium","gemini-3.8-flash-low":"gemini-3.8-flash-low","gemini-3.7-flash-high":"gemini-3.7-flash-high","gemini-3.7-flash-medium":"gemini-3.7-flash-medium","gemini-3.7-flash-low":"gemini-3.7-flash-low","gemini-3.6-flash-high":"gemini-3.6-flash-high","gemini-3.6-flash-medium":"gemini-3.6-flash-medium","gemini-3.6-flash-low":"gemini-3.6-flash-low","gemini-3.1-pro-high":"gemini-pro-agent","gemini-3-pro-high":"gemini-pro-agent","gemini-3-pro-low":"gemini-3.1-pro-low","claude-sonnet-5-5-high":"claude-sonnet-5-5-high","claude-sonnet-5-5-medium":"claude-sonnet-5-5-medium","claude-sonnet-5-5-low":"claude-sonnet-5-5-low","claude-sonnet-5-5":"claude-sonnet-5-5","claude-sonnet-5.5":"claude-sonnet-5-5","claude-sonnet-5.5-high":"claude-sonnet-5-5-high","claude-sonnet-5.5-medium":"claude-sonnet-5-5-medium","claude-sonnet-5.5-low":"claude-sonnet-5-5-low","claude-sonnet-5-5-thinking":"claude-sonnet-5-5","claude-sonnet-5.5-thinking":"claude-sonnet-5-5","claude-opus-5-5-high":"claude-opus-5-5-high","claude-opus-5-5-medium":"claude-opus-5-5-medium","claude-opus-5-5-low":"claude-opus-5-5-low","claude-opus-5-5":"claude-opus-5-5","claude-opus-5.5":"claude-opus-5-5","claude-opus-5.5-high":"claude-opus-5-5-high","claude-opus-5.5-medium":"claude-opus-5-5-medium","claude-opus-5.5-low":"claude-opus-5-5-low","claude-opus-5-5-thinking":"claude-opus-5-5","claude-opus-5.5-thinking":"claude-opus-5-5","claude-sonnet-4.6":"claude-sonnet-4-6","claude-opus-4.6":"claude-opus-4-6-thinking","claude-opus-4.6-thinking":"claude-opus-4-6-thinking"}},pT={antigravity:[{match:/flash.*extra.*low|extra.*low.*flash|flash.*low|low.*flash/i,alias:"gemini-3.8-flash-low"},{match:/flash.*medium|medium.*flash/i,alias:"gemini-3.8-flash-medium"},{match:/flash.*agent|agent.*flash|flash/i,alias:"gemini-3.8-flash-high"},{match:/pro.*low|low.*pro/i,alias:"gemini-3.1-pro-low"},{match:/gemini.*pro|pro.*gemini/i,alias:"gemini-pro-agent"},{match:/opus.*5[.-]5.*high|5[.-]5.*opus.*high/i,alias:"claude-opus-5-5-high"},{match:/opus.*5[.-]5.*medium|5[.-]5.*opus.*medium/i,alias:"claude-opus-5-5-medium"},{match:/opus.*5[.-]5.*low|5[.-]5.*opus.*low/i,alias:"claude-opus-5-5-low"},{match:/sonnet.*5[.-]5.*high|5[.-]5.*sonnet.*high/i,alias:"claude-sonnet-5-5-high"},{match:/sonnet.*5[.-]5.*medium|5[.-]5.*sonnet.*medium/i,alias:"claude-sonnet-5-5-medium"},{match:/sonnet.*5[.-]5.*low|5[.-]5.*sonnet.*low/i,alias:"claude-sonnet-5-5-low"},{match:/opus.*5[.-]5|5[.-]5.*opus/i,alias:"claude-opus-5-5"},{match:/sonnet.*5[.-]5|5[.-]5.*sonnet/i,alias:"claude-sonnet-5-5"},{match:/opus/i,alias:"claude-opus-4-6-thinking"},{match:/sonnet|claude/i,alias:"claude-sonnet-4-6"},{match:/gpt.*oss|oss/i,alias:"gpt-oss-120b-medium"}]},hT={antigravity:[/^tab[_-]/i]},yT=["recordCodeAssistMetrics","recordTrajectoryAnalytics","fetchAdminControls","listExperiments","fetchUserInfo"];function _T(r){let e=(r||"").split(":")[0];return e==="api.individual.githubcopilot.com"?"copilot":e==="daily-cloudcode-pa.googleapis.com"||e==="cloudcode-pa.googleapis.com"?"antigravity":e==="q.us-east-1.amazonaws.com"||e==="codewhisperer.us-east-1.amazonaws.com"||e==="runtime.us-east-1.kiro.dev"?"kiro":e==="api2.cursor.sh"?"cursor":null}function gT(r){if(!r||r.length===0)return!1;let e=r.slice(0,Math.min(100,r.length)),t=0;for(let n=0;n<e.length;n++){let i=e[n];i<32&&i!==9&&i!==10&&i!==13&&t++,i>126&&t++}return t/e.length>.3}function vT(r,e){let n=r.match(/\/models\/([^/:]+)/)?.[1]||null;if(gT(e))return n;try{let i=JSON.parse(e.toString());if(i.conversationState)return i.conversationState.currentMessage?.userInputMessage?.modelId||null;let s=n||i.model||null,o=String(s).replace(/^models\//,"");if(o==="gemini-3.6-flash-tiered"||o==="gemini-3.7-flash-tiered"||o==="gemini-3.8-flash-tiered"){let a=o.includes("3.8")?"3.8":o.includes("3.7")?"3.7":"3.6",c=i.request?.generationConfig?.thinkingConfig?.thinkingLevel||i.generationConfig?.thinkingConfig?.thinkingLevel,u=["high","medium","low"].includes(String(c).toLowerCase())?String(c).toLowerCase():"medium";return`gemini-${a}-flash-${u}`}return s}catch{return n}}VA.exports={IS_DEV:cT,LSOF_BIN:uT,TARGET_HOSTS:lT,URL_PATTERNS:LA,MODEL_SYNONYMS:dT,MODEL_PATTERNS:pT,MODEL_NO_MAP:hT,LOG_BLACKLIST_URL_PARTS:yT,getToolForHost:_T,isChatRequest:fT,extractModel:vT}});var ri=l((Qq,GA)=>{var ei=require("fs"),Wl=require("path"),ty=require("zlib"),{DATA_DIR:mT}=Es(),{LOG_BLACKLIST_URL_PARTS:AT}=Ta();function HA(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}var bT=r=>console.log(`[${HA()}] [MITM] ${r}`),ST=r=>console.error(`[${HA()}] \u274C [MITM] ${r}`),ti=Wl.join(mT,"logs","mitm");ei.existsSync(ti)||ei.mkdirSync(ti,{recursive:!0});function wT(){try{if(!ei.existsSync(ti))return;for(let r of ei.readdirSync(ti))try{ei.rmSync(Wl.join(ti,r),{recursive:!0,force:!0})}catch{}}catch{}}var CT=/^\s*(\{\s*\}|\[\s*\]|null)?\s*$/;function FA(r,e=80){return String(r).replace(/[^a-zA-Z0-9]/g,"_").substring(0,e)}function KA(r){return r?AT.some(e=>r.includes(e)):!1}function PT(r,e){if(!r||r.length===0)return r;try{let t=(e||"").toLowerCase();if(t.includes("gzip"))return ty.gunzipSync(r);if(t.includes("br"))return ty.brotliDecompressSync(r);if(t.includes("deflate"))return ty.inflateSync(r)}catch{}return r}function xT(r,e,t="raw"){if(KA(r.url))return null;try{let n=new Date().toISOString().replace(/[:.]/g,"-"),i=FA((r.headers.host||"")+r.url),s=Wl.join(ti,`${n}_${t}_${i}.req.json`),o=null;try{o=JSON.parse(e.toString())}catch{}return ei.writeFileSync(s,JSON.stringify({method:r.method,url:r.url,host:r.headers.host,headers:r.headers,body:o??e.toString("utf8")},null,2)),s}catch{return null}}function TT(r,e="raw"){if(KA(r.url))return null;let t=new Date().toISOString().replace(/[:.]/g,"-"),n=FA((r.headers.host||"")+r.url),i=Wl.join(ti,`${t}_${e}_${n}.res.txt`),s=0,o={},a=[];return{writeHeader:(c,u)=>{s=c,o=u||{}},writeChunk:c=>{c!=null&&a.push(Buffer.isBuffer(c)?c:Buffer.from(c))},end:()=>{try{let c=Buffer.concat(a),u=o["content-encoding"]||o["Content-Encoding"],p=PT(c,u).toString("utf8");if(CT.test(p))return;let _={...o};delete _["content-encoding"],delete _["Content-Encoding"];let E=`STATUS: ${s}
|
|
2
|
+
HEADERS: ${JSON.stringify(_,null,2)}
|
|
3
3
|
---BODY---
|
|
4
|
-
${f}`;qt.writeFileSync(n,v)}catch{}},file:n}}Zn.exports={log:Uu,err:Pu,dumpRequest:Ku,createResponseDumper:Mu,clearDumpDir:Ou}});var $=F((dh,ei)=>{ei.exports={options:{usePureJavaScript:!1}}});var ai=F((hh,ri)=>{var Ra={};ri.exports=Ra;var ti={};Ra.encode=function(e,t,a){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(a!==void 0&&typeof a!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=qu(e,t);else{var n=0,s=t.length,i=t.charAt(0),o=[0];for(n=0;n<e.length;++n){for(var u=0,l=e[n];u<o.length;++u)l+=o[u]<<8,o[u]=l%s,l=l/s|0;for(;l>0;)o.push(l%s),l=l/s|0}for(n=0;e[n]===0&&n<e.length-1;++n)r+=i;for(n=o.length-1;n>=0;--n)r+=t[o[n]]}if(a){var c=new RegExp(".{1,"+a+"}","g");r=r.match(c).join(`\r
|
|
5
|
-
`)}return r};Ra.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var a=ti[t];if(!a){a=ti[t]=[];for(var r=0;r<t.length;++r)a[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var n=t.length,s=t.charAt(0),i=[0],r=0;r<e.length;r++){var o=a[e.charCodeAt(r)];if(o===void 0)return;for(var u=0,l=o;u<i.length;++u)l+=i[u]*n,i[u]=l&255,l>>=8;for(;l>0;)i.push(l&255),l>>=8}for(var c=0;e[c]===s&&c<e.length-1;++c)i.push(0);return typeof Buffer<"u"?Buffer.from(i.reverse()):new Uint8Array(i.reverse())};function qu(e,t){var a=0,r=t.length,n=t.charAt(0),s=[0];for(a=0;a<e.length();++a){for(var i=0,o=e.at(a);i<s.length;++i)o+=s[i]<<8,s[i]=o%r,o=o/r|0;for(;o>0;)s.push(o%r),o=o/r|0}var u="";for(a=0;e.at(a)===0&&a<e.length()-1;++a)u+=n;for(a=s.length-1;a>=0;--a)u+=t[s[a]];return u}});var re=F((ph,oi)=>{var ni=$(),ii=ai(),E=oi.exports=ni.util=ni.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){E.nextTick=process.nextTick,typeof setImmediate=="function"?E.setImmediate=setImmediate:E.setImmediate=E.nextTick;return}if(typeof setImmediate=="function"){E.setImmediate=function(){return setImmediate.apply(void 0,arguments)},E.nextTick=function(o){return setImmediate(o)};return}if(E.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(u){if(u.source===window&&u.data===e){u.stopPropagation();var l=t.slice();t.length=0,l.forEach(function(c){c()})}};var i=o,e="forge.setImmediate",t=[];E.setImmediate=function(u){t.push(u),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var a=Date.now(),r=!0,n=document.createElement("div"),t=[];new MutationObserver(function(){var u=t.slice();t.length=0,u.forEach(function(l){l()})}).observe(n,{attributes:!0});var s=E.setImmediate;E.setImmediate=function(u){Date.now()-a>15?(a=Date.now(),s(u)):(t.push(u),t.length===1&&n.setAttribute("a",r=!r))}}E.nextTick=E.setImmediate})();E.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;E.globalScope=(function(){return E.isNodejs?global:typeof self>"u"?window:self})();E.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};E.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};E.isArrayBufferView=function(e){return e&&E.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function xr(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}E.ByteBuffer=La;function La(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(E.isArrayBuffer(e)||E.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var a=0;a<t.length;++a)this.putByte(t[a])}}else(e instanceof La||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}E.ByteStringBuffer=La;var Hu=4096;E.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>Hu&&(this.data.substr(0,1),this._constructedStringLength=0)};E.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};E.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};E.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};E.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var a=this.data;t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return this.data=a,this._optimizeConstructedString(t),this};E.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};E.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(E.encodeUtf8(e))};E.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};E.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};E.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};E.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};E.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};E.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};E.ByteStringBuffer.prototype.putInt=function(e,t){xr(t);var a="";do t-=8,a+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(a)};E.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};E.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};E.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};E.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};E.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};E.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};E.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};E.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};E.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};E.ByteStringBuffer.prototype.getInt=function(e){xr(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};E.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t};E.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};E.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};E.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};E.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};E.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};E.ByteStringBuffer.prototype.copy=function(){var e=E.createBuffer(this.data);return e.read=this.read,e};E.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};E.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};E.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};E.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var a=this.data.charCodeAt(t);a<16&&(e+="0"),e+=a.toString(16)}return e};E.ByteStringBuffer.prototype.toString=function(){return E.decodeUtf8(this.bytes())};function Gu(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var a=E.isArrayBuffer(e),r=E.isArrayBufferView(e);if(a||r){a?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}E.DataBuffer=Gu;E.DataBuffer.prototype.length=function(){return this.write-this.read};E.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};E.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var a=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(a),this.data=new DataView(r.buffer),this};E.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};E.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var a=0;a<t;++a)this.data.setUint8(e);return this};E.DataBuffer.prototype.putBytes=function(e,t){if(E.isArrayBufferView(e)){var a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=a.byteLength-a.byteOffset;this.accommodate(r);var n=new Uint8Array(this.data.buffer,this.write);return n.set(a),this.write+=r,this}if(E.isArrayBuffer(e)){var a=new Uint8Array(e);this.accommodate(a.byteLength);var n=new Uint8Array(this.data.buffer);return n.set(a,this.write),this.write+=a.byteLength,this}if(e instanceof E.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&E.isArrayBufferView(e.data)){var a=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(a.byteLength);var n=new Uint8Array(e.data.byteLength,this.write);return n.set(a),this.write+=a.byteLength,this}if(e instanceof E.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var s;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),s=new Uint8Array(this.data.buffer,this.write),this.write+=E.binary.hex.decode(e,s,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),s=new Uint8Array(this.data.buffer,this.write),this.write+=E.binary.base64.decode(e,s,this.write),this;if(t==="utf8"&&(e=E.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),s=new Uint8Array(this.data.buffer,this.write),this.write+=E.binary.raw.decode(s),this;if(t==="utf16")return this.accommodate(e.length*2),s=new Uint16Array(this.data.buffer,this.write),this.write+=E.text.utf16.encode(s),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};E.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};E.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};E.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};E.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};E.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};E.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};E.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};E.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};E.DataBuffer.prototype.putInt=function(e,t){xr(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};E.DataBuffer.prototype.putSignedInt=function(e,t){return xr(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};E.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};E.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};E.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};E.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};E.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};E.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};E.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};E.DataBuffer.prototype.getInt=function(e){xr(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};E.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t};E.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};E.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};E.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};E.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};E.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};E.DataBuffer.prototype.copy=function(){return new E.DataBuffer(this)};E.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};E.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};E.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};E.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var a=this.data.getUint8(t);a<16&&(e+="0"),e+=a.toString(16)}return e};E.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return E.binary.raw.encode(t);if(e==="hex")return E.binary.hex.encode(t);if(e==="base64")return E.binary.base64.encode(t);if(e==="utf8")return E.text.utf8.decode(t);if(e==="utf16")return E.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};E.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=E.encodeUtf8(e)),new E.ByteBuffer(e)};E.fillString=function(e,t){for(var a="";t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return a};E.xorBytes=function(e,t,a){for(var r="",n="",s="",i=0,o=0;a>0;--a,++i)n=e.charCodeAt(i)^t.charCodeAt(i),o>=10&&(r+=s,s="",o=0),s+=String.fromCharCode(n),++o;return r+=s,r};E.hexToBytes=function(e){var t="",a=0;for(e.length&!0&&(a=1,t+=String.fromCharCode(parseInt(e[0],16)));a<e.length;a+=2)t+=String.fromCharCode(parseInt(e.substr(a,2),16));return t};E.bytesToHex=function(e){return E.createBuffer(e).toHex()};E.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var _t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Nt=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],si="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";E.encode64=function(e,t){for(var a="",r="",n,s,i,o=0;o<e.length;)n=e.charCodeAt(o++),s=e.charCodeAt(o++),i=e.charCodeAt(o++),a+=_t.charAt(n>>2),a+=_t.charAt((n&3)<<4|s>>4),isNaN(s)?a+="==":(a+=_t.charAt((s&15)<<2|i>>6),a+=isNaN(i)?"=":_t.charAt(i&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
|
|
6
|
-
|
|
7
|
-
`,a=a.substr(t));return r+=a,r};E.binary.base64.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),a=a||0;for(var n,s,i,o,u=0,l=a;u<e.length;)n=Nt[e.charCodeAt(u++)-43],s=Nt[e.charCodeAt(u++)-43],i=Nt[e.charCodeAt(u++)-43],o=Nt[e.charCodeAt(u++)-43],r[l++]=n<<2|s>>4,i!==64&&(r[l++]=(s&15)<<4|i>>2,o!==64&&(r[l++]=(i&3)<<6|o));return t?l-a:r.subarray(0,l)};E.binary.base58.encode=function(e,t){return E.binary.baseN.encode(e,si,t)};E.binary.base58.decode=function(e,t){return E.binary.baseN.decode(e,si,t)};E.text={utf8:{},utf16:{}};E.text.utf8.encode=function(e,t,a){e=E.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var n=a,s=0;s<e.length;++s)r[n++]=e.charCodeAt(s);return t?n-a:r};E.text.utf8.decode=function(e){return E.decodeUtf8(String.fromCharCode.apply(null,e))};E.text.utf16.encode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length*2));var n=new Uint16Array(r.buffer);a=a||0;for(var s=a,i=a,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o),s+=2;return t?s-a:r};E.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};E.deflate=function(e,t,a){if(t=E.decode64(e.deflate(E.encode64(t)).rval),a){var r=2,n=t.charCodeAt(1);n&32&&(r=6),t=t.substring(r,t.length-4)}return t};E.inflate=function(e,t,a){var r=e.inflate(E.encode64(t)).rval;return r===null?null:E.decode64(r)};var ka=function(e,t,a){if(!e)throw new Error("WebStorage not available.");var r;if(a===null?r=e.removeItem(t):(a=E.encode64(JSON.stringify(a)),r=e.setItem(t,a)),typeof r<"u"&&r.rval!==!0){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}},Da=function(e,t){if(!e)throw new Error("WebStorage not available.");var a=e.getItem(t);if(e.init)if(a.rval===null){if(a.error){var r=new Error(a.error.message);throw r.id=a.error.id,r.name=a.error.name,r}a=null}else a=a.rval;return a!==null&&(a=JSON.parse(E.decode64(a))),a},zu=function(e,t,a,r){var n=Da(e,t);n===null&&(n={}),n[a]=r,ka(e,t,n)},Qu=function(e,t,a){var r=Da(e,t);return r!==null&&(r=a in r?r[a]:null),r},$u=function(e,t,a){var r=Da(e,t);if(r!==null&&a in r){delete r[a];var n=!0;for(var s in r){n=!1;break}n&&(r=null),ka(e,t,r)}},Yu=function(e,t){ka(e,t,null)},Mr=function(e,t,a){var r=null;typeof a>"u"&&(a=["web","flash"]);var n,s=!1,i=null;for(var o in a){n=a[o];try{if(n==="flash"||n==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),s=n==="flash"}(n==="web"||n==="both")&&(t[0]=localStorage,r=e.apply(this,t),s=!0)}catch(u){i=u}if(s)break}if(!s)throw i;return r};E.setItem=function(e,t,a,r,n){Mr(zu,arguments,n)};E.getItem=function(e,t,a,r){return Mr(Qu,arguments,r)};E.removeItem=function(e,t,a,r){Mr($u,arguments,r)};E.clearItems=function(e,t,a){Mr(Yu,arguments,a)};E.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};E.format=function(e){for(var t=/%./g,a,r,n=0,s=[],i=0;a=t.exec(e);){r=e.substring(i,t.lastIndex-2),r.length>0&&s.push(r),i=t.lastIndex;var o=a[0][1];switch(o){case"s":case"o":n<arguments.length?s.push(arguments[n+++1]):s.push("<?>");break;case"%":s.push("%");break;default:s.push("<%"+o+"?>")}}return s.push(e.substring(i)),s.join("")};E.formatNumber=function(e,t,a,r){var n=e,s=isNaN(t=Math.abs(t))?2:t,i=a===void 0?",":a,o=r===void 0?".":r,u=n<0?"-":"",l=parseInt(n=Math.abs(+n||0).toFixed(s),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+o:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+o)+(s?i+Math.abs(n-l).toFixed(s).slice(2):"")};E.formatSize=function(e){return e>=1073741824?e=E.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=E.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=E.formatNumber(e/1024,0)+" KiB":e=E.formatNumber(e,0)+" bytes",e};E.bytesFromIP=function(e){return e.indexOf(".")!==-1?E.bytesFromIPv4(e):e.indexOf(":")!==-1?E.bytesFromIPv6(e):null};E.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=E.createBuffer(),a=0;a<e.length;++a){var r=parseInt(e[a],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()};E.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(i){return i.length===0&&++t,!0});for(var a=(8-e.length+t)*2,r=E.createBuffer(),n=0;n<8;++n){if(!e[n]||e[n].length===0){r.fillWithByte(0,a),a=0;continue}var s=E.hexToBytes(e[n]);s.length<2&&r.putByte(0),r.putBytes(s)}return r.getBytes()};E.bytesToIP=function(e){return e.length===4?E.bytesToIPv4(e):e.length===16?E.bytesToIPv6(e):null};E.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a));return t.join(".")};E.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],a=[],r=0,n=0;n<e.length;n+=2){for(var s=E.bytesToHex(e[n]+e[n+1]);s[0]==="0"&&s!=="0";)s=s.substr(1);if(s==="0"){var i=a[a.length-1],o=t.length;!i||o!==i.end+1?a.push({start:o,end:o}):(i.end=o,i.end-i.start>a[r].end-a[r].start&&(r=a.length-1))}t.push(s)}if(a.length>0){var u=a[r];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),u.start===0&&t.unshift(""),u.end===7&&t.push(""))}return t.join(":")};E.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in E&&!e.update)return t(null,E.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return E.cores=navigator.hardwareConcurrency,t(null,E.cores);if(typeof Worker>"u")return E.cores=1,t(null,E.cores);if(typeof Blob>"u")return E.cores=2,t(null,E.cores);var a=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(i){for(var o=Date.now(),u=o+4;Date.now()<u;);self.postMessage({st:o,et:u})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(i,o,u){if(o===0){var l=Math.floor(i.reduce(function(c,f){return c+f},0)/i.length);return E.cores=Math.max(1,l),URL.revokeObjectURL(a),t(null,E.cores)}n(u,function(c,f){i.push(s(u,f)),r(i,o-1,u)})}function n(i,o){for(var u=[],l=[],c=0;c<i;++c){var f=new Worker(a);f.addEventListener("message",function(g){if(l.push(g.data),l.length===i){for(var v=0;v<i;++v)u[v].terminate();o(null,l)}}),u.push(f)}for(var c=0;c<i;++c)u[c].postMessage(c)}function s(i,o){for(var u=[],l=0;l<i;++l)for(var c=o[l],f=u[l]=[],g=0;g<i;++g)if(l!==g){var v=o[g];(c.st>v.st&&c.st<v.et||v.st>c.st&&v.st<c.et)&&f.push(g)}return u.reduce(function(y,x){return Math.max(y,x.length)},0)}}});var qr=F((gh,ui)=>{var xe=$();re();ui.exports=xe.cipher=xe.cipher||{};xe.cipher.algorithms=xe.cipher.algorithms||{};xe.cipher.createCipher=function(e,t){var a=e;if(typeof a=="string"&&(a=xe.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new xe.cipher.BlockCipher({algorithm:a,key:t,decrypt:!1})};xe.cipher.createDecipher=function(e,t){var a=e;if(typeof a=="string"&&(a=xe.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new xe.cipher.BlockCipher({algorithm:a,key:t,decrypt:!0})};xe.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),xe.cipher.algorithms[e]=t};xe.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in xe.cipher.algorithms?xe.cipher.algorithms[e]:null};var Ua=xe.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};Ua.prototype.start=function(e){e=e||{};var t={};for(var a in e)t[a]=e[a];t.decrypt=this._decrypt,this._finish=!1,this._input=xe.util.createBuffer(),this.output=e.output||xe.util.createBuffer(),this.mode.start(t)};Ua.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Ua.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(a){return e(this.blockSize,a,!1)},this.mode.unpad=function(a){return e(this.blockSize,a,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))}});var Oa=F((yh,li)=>{var Se=$();re();Se.cipher=Se.cipher||{};var j=li.exports=Se.cipher.modes=Se.cipher.modes||{};j.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};j.ecb.prototype.start=function(e){};j.ecb.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};j.ecb.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};j.ecb.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0};j.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};j.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};j.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=Hr(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};j.cbc.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock};j.cbc.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)};j.cbc.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0};j.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};j.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Se.util.createBuffer(),this._partialBytes=0};j.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Hr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};j.cfb.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32()^this._outBlock[n],t.putInt32(this._inBlock[n]);return}var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);if(s>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};j.cfb.prototype.decrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32(),t.putInt32(this._inBlock[n]^this._outBlock[n]);return}var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(s>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};j.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Se.util.createBuffer(),this._partialBytes=0};j.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Hr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};j.ofb.prototype.encrypt=function(e,t,a){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];return}var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(s>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};j.ofb.prototype.decrypt=j.ofb.prototype.encrypt;j.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Se.util.createBuffer(),this._partialBytes=0};j.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Hr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};j.ctr.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]);else{var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(s>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}Gr(this._inBlock)};j.ctr.prototype.decrypt=j.ctr.prototype.encrypt;j.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Se.util.createBuffer(),this._partialBytes=0,this._R=3774873600};j.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=Se.util.createBuffer(e.iv);this._cipherLength=0;var a;if("additionalData"in e?a=Se.util.createBuffer(e.additionalData):a=Se.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=Se.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=t.length();if(r===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Pa(r*8)))}this._inBlock=this._j0.slice(0),Gr(this._inBlock),this._partialBytes=0,a=Se.util.createBuffer(a),this._aDataLength=Pa(a.length()*8);var n=a.length()%this.blockSize;for(n&&a.fillWithByte(0,this.blockSize-n),this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])};j.gcm.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^=e.getInt32());this._cipherLength+=this.blockSize}else{var s=(this.blockSize-r)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(s<=0||a){if(a){var i=r%this.blockSize;this._cipherLength+=i,this._partialOutput.truncate(this.blockSize-i)}else this._cipherLength+=this.blockSize;for(var n=0;n<this._ints;++n)this._outBlock[n]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!a)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Gr(this._inBlock)};j.gcm.prototype.decrypt=function(e,t,a){var r=e.length();if(r<this.blockSize&&!(a&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Gr(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^this._hashBlock[n]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize};j.gcm.prototype.afterFinish=function(e,t){var a=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=Se.util.createBuffer();var r=this._aDataLength.concat(Pa(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var n=[];this.cipher.encrypt(this._j0,n);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^n[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(a=!1),a};j.gcm.prototype.multiply=function(e,t){for(var a=[0,0,0,0],r=t.slice(0),n=0;n<128;++n){var s=e[n/32|0]&1<<31-n%32;s&&(a[0]^=r[0],a[1]^=r[1],a[2]^=r[2],a[3]^=r[3]),this.pow(r,r)}return a};j.gcm.prototype.pow=function(e,t){for(var a=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,a&&(t[0]^=this._R)};j.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],a=0;a<32;++a){var r=a/8|0,n=e[r]>>>(7-a%8)*4&15,s=this._m[a][n];t[0]^=s[0],t[1]^=s[1],t[2]^=s[2],t[3]^=s[3]}return t};j.gcm.prototype.ghash=function(e,t,a){return t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3],this.tableMultiply(t)};j.gcm.prototype.generateHashTable=function(e,t){for(var a=8/t,r=4*a,n=16*a,s=new Array(n),i=0;i<n;++i){var o=[0,0,0,0],u=i/r|0,l=(r-1-i%r)*t;o[u]=1<<t-1<<l,s[i]=this.generateSubHashTable(this.multiply(o,e),t)}return s};j.gcm.prototype.generateSubHashTable=function(e,t){var a=1<<t,r=a>>>1,n=new Array(a);n[r]=e.slice(0);for(var s=r>>>1;s>0;)this.pow(n[2*s],n[s]=[]),s>>=1;for(s=2;s<r;){for(var i=1;i<s;++i){var o=n[s],u=n[i];n[s+i]=[o[0]^u[0],o[1]^u[1],o[2]^u[2],o[3]^u[3]]}s*=2}for(n[0]=[0,0,0,0],s=r+1;s<a;++s){var l=n[s^r];n[s]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return n};function Hr(e,t){if(typeof e=="string"&&(e=Se.util.createBuffer(e)),Se.util.isArray(e)&&e.length>4){var a=e;e=Se.util.createBuffer();for(var r=0;r<a.length;++r)e.putByte(a[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!Se.util.isArray(e)){for(var n=[],s=t/4,r=0;r<s;++r)n.push(e.getInt32());e=n}return e}function Gr(e){e[e.length-1]=e[e.length-1]+1&4294967295}function Pa(e){return[e/4294967296|0,e&4294967295]}});var wt=F((vh,hi)=>{var le=$();qr();Oa();re();hi.exports=le.aes=le.aes||{};le.aes.startEncrypting=function(e,t,a,r){var n=zr({key:e,output:a,decrypt:!1,mode:r});return n.start(t),n};le.aes.createEncryptionCipher=function(e,t){return zr({key:e,output:null,decrypt:!1,mode:t})};le.aes.startDecrypting=function(e,t,a,r){var n=zr({key:e,output:a,decrypt:!0,mode:r});return n.start(t),n};le.aes.createDecryptionCipher=function(e,t){return zr({key:e,output:null,decrypt:!0,mode:t})};le.aes.Algorithm=function(e,t){Ka||fi();var a=this;a.name=e,a.mode=new t({blockSize:16,cipher:{encrypt:function(r,n){return Fa(a._w,r,n,!1)},decrypt:function(r,n){return Fa(a._w,r,n,!0)}}}),a._init=!1};le.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,a;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=le.util.createBuffer(t);else if(le.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){a=t,t=le.util.createBuffer();for(var r=0;r<a.length;++r)t.putByte(a[r])}if(!le.util.isArray(t)){a=t,t=[];var n=a.length();if(n===16||n===24||n===32){n=n>>>2;for(var r=0;r<n;++r)t.push(a.getInt32())}}if(!le.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var s=this.mode.name,i=["CFB","OFB","CTR","GCM"].indexOf(s)!==-1;this._w=di(t,e.decrypt&&!i),this._init=!0}};le.aes._expandKey=function(e,t){return Ka||fi(),di(e,t)};le.aes._updateBlock=Fa;ir("AES-ECB",le.cipher.modes.ecb);ir("AES-CBC",le.cipher.modes.cbc);ir("AES-CFB",le.cipher.modes.cfb);ir("AES-OFB",le.cipher.modes.ofb);ir("AES-CTR",le.cipher.modes.ctr);ir("AES-GCM",le.cipher.modes.gcm);function ir(e,t){var a=function(){return new le.aes.Algorithm(e,t)};le.cipher.registerAlgorithm(e,a)}var Ka=!1,nr=4,He,Va,ci,zt,ut;function fi(){Ka=!0,ci=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;He=new Array(256),Va=new Array(256),zt=new Array(4),ut=new Array(4);for(var t=0;t<4;++t)zt[t]=new Array(256),ut[t]=new Array(256);for(var a=0,r=0,n,s,i,o,u,l,c,t=0;t<256;++t){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,He[a]=o,Va[o]=a,u=e[o],n=e[a],s=e[n],i=e[s],l=u<<24^o<<16^o<<8^(o^u),c=(n^s^i)<<24^(a^i)<<16^(a^s^i)<<8^(a^n^i);for(var f=0;f<4;++f)zt[f][a]=l,ut[f][o]=c,l=l<<24|l>>>8,c=c<<24|c>>>8;a===0?a=r=1:(a=n^e[e[e[n^i]]],r^=e[e[r]])}}function di(e,t){for(var a=e.slice(0),r,n=1,s=a.length,i=s+6+1,o=nr*i,u=s;u<o;++u)r=a[u-1],u%s===0?(r=He[r>>>16&255]<<24^He[r>>>8&255]<<16^He[r&255]<<8^He[r>>>24]^ci[n]<<24,n++):s>6&&u%s===4&&(r=He[r>>>24]<<24^He[r>>>16&255]<<16^He[r>>>8&255]<<8^He[r&255]),a[u]=a[u-s]^r;if(t){var l,c=ut[0],f=ut[1],g=ut[2],v=ut[3],y=a.slice(0);o=a.length;for(var u=0,x=o-nr;u<o;u+=nr,x-=nr)if(u===0||u===o-nr)y[u]=a[x],y[u+1]=a[x+3],y[u+2]=a[x+2],y[u+3]=a[x+1];else for(var S=0;S<nr;++S)l=a[x+S],y[u+(3&-S)]=c[He[l>>>24]]^f[He[l>>>16&255]]^g[He[l>>>8&255]]^v[He[l&255]];a=y}return a}function Fa(e,t,a,r){var n=e.length/4-1,s,i,o,u,l;r?(s=ut[0],i=ut[1],o=ut[2],u=ut[3],l=Va):(s=zt[0],i=zt[1],o=zt[2],u=zt[3],l=He);var c,f,g,v,y,x,S;c=t[0]^e[0],f=t[r?3:1]^e[1],g=t[2]^e[2],v=t[r?1:3]^e[3];for(var A=3,B=1;B<n;++B)y=s[c>>>24]^i[f>>>16&255]^o[g>>>8&255]^u[v&255]^e[++A],x=s[f>>>24]^i[g>>>16&255]^o[v>>>8&255]^u[c&255]^e[++A],S=s[g>>>24]^i[v>>>16&255]^o[c>>>8&255]^u[f&255]^e[++A],v=s[v>>>24]^i[c>>>16&255]^o[f>>>8&255]^u[g&255]^e[++A],c=y,f=x,g=S;a[0]=l[c>>>24]<<24^l[f>>>16&255]<<16^l[g>>>8&255]<<8^l[v&255]^e[++A],a[r?3:1]=l[f>>>24]<<24^l[g>>>16&255]<<16^l[v>>>8&255]<<8^l[c&255]^e[++A],a[2]=l[g>>>24]<<24^l[v>>>16&255]<<16^l[c>>>8&255]<<8^l[f&255]^e[++A],a[r?1:3]=l[v>>>24]<<24^l[c>>>16&255]<<16^l[f>>>8&255]<<8^l[g&255]^e[++A]}function zr(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="AES-"+t,r;e.decrypt?r=le.cipher.createDecipher(a,e.key):r=le.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(s,i){var o=null;i instanceof le.util.ByteBuffer&&(o=i,i={}),i=i||{},i.output=o,i.iv=s,n.call(r,i)},r}});var Rt=F((mh,pi)=>{var Sr=$();Sr.pki=Sr.pki||{};var Ma=pi.exports=Sr.pki.oids=Sr.oids=Sr.oids||{};function w(e,t){Ma[e]=t,Ma[t]=e}function ae(e,t){Ma[e]=t}w("1.2.840.113549.1.1.1","rsaEncryption");w("1.2.840.113549.1.1.4","md5WithRSAEncryption");w("1.2.840.113549.1.1.5","sha1WithRSAEncryption");w("1.2.840.113549.1.1.7","RSAES-OAEP");w("1.2.840.113549.1.1.8","mgf1");w("1.2.840.113549.1.1.9","pSpecified");w("1.2.840.113549.1.1.10","RSASSA-PSS");w("1.2.840.113549.1.1.11","sha256WithRSAEncryption");w("1.2.840.113549.1.1.12","sha384WithRSAEncryption");w("1.2.840.113549.1.1.13","sha512WithRSAEncryption");w("1.3.101.112","EdDSA25519");w("1.2.840.10040.4.3","dsa-with-sha1");w("1.3.14.3.2.7","desCBC");w("1.3.14.3.2.26","sha1");w("1.3.14.3.2.29","sha1WithRSASignature");w("2.16.840.1.101.3.4.2.1","sha256");w("2.16.840.1.101.3.4.2.2","sha384");w("2.16.840.1.101.3.4.2.3","sha512");w("2.16.840.1.101.3.4.2.4","sha224");w("2.16.840.1.101.3.4.2.5","sha512-224");w("2.16.840.1.101.3.4.2.6","sha512-256");w("1.2.840.113549.2.2","md2");w("1.2.840.113549.2.5","md5");w("1.2.840.113549.1.7.1","data");w("1.2.840.113549.1.7.2","signedData");w("1.2.840.113549.1.7.3","envelopedData");w("1.2.840.113549.1.7.4","signedAndEnvelopedData");w("1.2.840.113549.1.7.5","digestedData");w("1.2.840.113549.1.7.6","encryptedData");w("1.2.840.113549.1.9.1","emailAddress");w("1.2.840.113549.1.9.2","unstructuredName");w("1.2.840.113549.1.9.3","contentType");w("1.2.840.113549.1.9.4","messageDigest");w("1.2.840.113549.1.9.5","signingTime");w("1.2.840.113549.1.9.6","counterSignature");w("1.2.840.113549.1.9.7","challengePassword");w("1.2.840.113549.1.9.8","unstructuredAddress");w("1.2.840.113549.1.9.14","extensionRequest");w("1.2.840.113549.1.9.20","friendlyName");w("1.2.840.113549.1.9.21","localKeyId");w("1.2.840.113549.1.9.22.1","x509Certificate");w("1.2.840.113549.1.12.10.1.1","keyBag");w("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");w("1.2.840.113549.1.12.10.1.3","certBag");w("1.2.840.113549.1.12.10.1.4","crlBag");w("1.2.840.113549.1.12.10.1.5","secretBag");w("1.2.840.113549.1.12.10.1.6","safeContentsBag");w("1.2.840.113549.1.5.13","pkcs5PBES2");w("1.2.840.113549.1.5.12","pkcs5PBKDF2");w("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");w("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");w("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");w("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");w("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");w("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");w("1.2.840.113549.2.7","hmacWithSHA1");w("1.2.840.113549.2.8","hmacWithSHA224");w("1.2.840.113549.2.9","hmacWithSHA256");w("1.2.840.113549.2.10","hmacWithSHA384");w("1.2.840.113549.2.11","hmacWithSHA512");w("1.2.840.113549.3.7","des-EDE3-CBC");w("2.16.840.1.101.3.4.1.2","aes128-CBC");w("2.16.840.1.101.3.4.1.22","aes192-CBC");w("2.16.840.1.101.3.4.1.42","aes256-CBC");w("2.5.4.3","commonName");w("2.5.4.4","surname");w("2.5.4.5","serialNumber");w("2.5.4.6","countryName");w("2.5.4.7","localityName");w("2.5.4.8","stateOrProvinceName");w("2.5.4.9","streetAddress");w("2.5.4.10","organizationName");w("2.5.4.11","organizationalUnitName");w("2.5.4.12","title");w("2.5.4.13","description");w("2.5.4.15","businessCategory");w("2.5.4.17","postalCode");w("2.5.4.42","givenName");w("2.5.4.65","pseudonym");w("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");w("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");w("2.16.840.1.113730.1.1","nsCertType");w("2.16.840.1.113730.1.13","nsComment");ae("2.5.29.1","authorityKeyIdentifier");ae("2.5.29.2","keyAttributes");ae("2.5.29.3","certificatePolicies");ae("2.5.29.4","keyUsageRestriction");ae("2.5.29.5","policyMapping");ae("2.5.29.6","subtreesConstraint");ae("2.5.29.7","subjectAltName");ae("2.5.29.8","issuerAltName");ae("2.5.29.9","subjectDirectoryAttributes");ae("2.5.29.10","basicConstraints");ae("2.5.29.11","nameConstraints");ae("2.5.29.12","policyConstraints");ae("2.5.29.13","basicConstraints");w("2.5.29.14","subjectKeyIdentifier");w("2.5.29.15","keyUsage");ae("2.5.29.16","privateKeyUsagePeriod");w("2.5.29.17","subjectAltName");w("2.5.29.18","issuerAltName");w("2.5.29.19","basicConstraints");ae("2.5.29.20","cRLNumber");ae("2.5.29.21","cRLReason");ae("2.5.29.22","expirationDate");ae("2.5.29.23","instructionCode");ae("2.5.29.24","invalidityDate");ae("2.5.29.25","cRLDistributionPoints");ae("2.5.29.26","issuingDistributionPoint");ae("2.5.29.27","deltaCRLIndicator");ae("2.5.29.28","issuingDistributionPoint");ae("2.5.29.29","certificateIssuer");ae("2.5.29.30","nameConstraints");w("2.5.29.31","cRLDistributionPoints");w("2.5.29.32","certificatePolicies");ae("2.5.29.33","policyMappings");ae("2.5.29.34","policyConstraints");w("2.5.29.35","authorityKeyIdentifier");ae("2.5.29.36","policyConstraints");w("2.5.29.37","extKeyUsage");ae("2.5.29.46","freshestCRL");ae("2.5.29.54","inhibitAnyPolicy");w("1.3.6.1.4.1.11129.2.4.2","timestampList");w("1.3.6.1.5.5.7.1.1","authorityInfoAccess");w("1.3.6.1.5.5.7.3.1","serverAuth");w("1.3.6.1.5.5.7.3.2","clientAuth");w("1.3.6.1.5.5.7.3.3","codeSigning");w("1.3.6.1.5.5.7.3.4","emailProtection");w("1.3.6.1.5.5.7.3.8","timeStamping")});var lt=F((Ch,yi)=>{var de=$();re();Rt();var U=yi.exports=de.asn1=de.asn1||{};U.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};U.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};U.maxDepth=256;U.create=function(e,t,a,r,n){if(de.util.isArray(r)){for(var s=[],i=0;i<r.length;++i)r[i]!==void 0&&s.push(r[i]);r=s}var o={tagClass:e,type:t,constructed:a,composed:a||de.util.isArray(r),value:r};return n&&"bitStringContents"in n&&(o.bitStringContents=n.bitStringContents,o.original=U.copy(o)),o};U.copy=function(e,t){var a;if(de.util.isArray(e)){a=[];for(var r=0;r<e.length;++r)a.push(U.copy(e[r],t));return a}return typeof e=="string"?e:(a={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:U.copy(e.value,t)},t&&!t.excludeBitStringContents&&(a.bitStringContents=e.bitStringContents),a)};U.equals=function(e,t,a){if(de.util.isArray(e)){if(!de.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!U.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var n=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&U.equals(e.value,t.value);return a&&a.includeBitStringContents&&(n=n&&e.bitStringContents===t.bitStringContents),n};U.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var a,r=t&128;return r?a=e.getInt((t&127)<<3):a=t,a}};function Tr(e,t,a){if(a>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=a,r}}var ju=function(e,t){var a=e.getByte();if(t--,a!==128){var r,n=a&128;if(!n)r=a;else{var s=a&127;Tr(e,t,s),r=e.getInt(s<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};U.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=U.maxDepth),typeof e=="string"&&(e=de.util.createBuffer(e));var a=e.length(),r=Qr(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var n=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw n.byteCount=a,n.remaining=e.length(),n}return r};function Qr(e,t,a,r){if(a>=r.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var n;Tr(e,t,2);var s=e.getByte();t--;var i=s&192,o=s&31;n=e.length();var u=ju(e,t);if(t-=n-e.length(),u!==void 0&&u>t){if(r.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=u,l}u=t}var c,f,g=(s&32)===32;if(g)if(c=[],u===void 0)for(;;){if(Tr(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}n=e.length(),c.push(Qr(e,t,a+1,r)),t-=n-e.length()}else for(;u>0;)n=e.length(),c.push(Qr(e,u,a+1,r)),t-=n-e.length(),u-=n-e.length();if(c===void 0&&i===U.Class.UNIVERSAL&&o===U.Type.BITSTRING&&(f=e.bytes(u)),c===void 0&&r.decodeBitStrings&&i===U.Class.UNIVERSAL&&o===U.Type.BITSTRING&&u>1){var v=e.read,y=t,x=0;if(o===U.Type.BITSTRING&&(Tr(e,t,1),x=e.getByte(),t--),x===0)try{n=e.length();var S={strict:!0,decodeBitStrings:!0},A=Qr(e,t,a+1,S),B=n-e.length();t-=B,o==U.Type.BITSTRING&&B++;var b=A.tagClass;B===u&&(b===U.Class.UNIVERSAL||b===U.Class.CONTEXT_SPECIFIC)&&(c=[A])}catch{}c===void 0&&(e.read=v,t=y)}if(c===void 0){if(u===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=t}if(o===U.Type.BMPSTRING)for(c="";u>0;u-=2)Tr(e,t,2),c+=String.fromCharCode(e.getInt16()),t-=2;else c=e.getBytes(u),t-=u}var O=f===void 0?null:{bitStringContents:f};return U.create(i,o,g,c,O)}U.toDer=function(e){var t=de.util.createBuffer(),a=e.tagClass|e.type,r=de.util.createBuffer(),n=!1;if("bitStringContents"in e&&(n=!0,e.original&&(n=U.equals(e,e.original))),n)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?a|=32:r.putByte(0);for(var s=0;s<e.value.length;++s)e.value[s]!==void 0&&r.putBuffer(U.toDer(e.value[s]))}else if(e.type===U.Type.BMPSTRING)for(var s=0;s<e.value.length;++s)r.putInt16(e.value.charCodeAt(s));else e.type===U.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&(e.value.charCodeAt(1)&128)===0||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(a),r.length()<=127)t.putByte(r.length()&127);else{var i=r.length(),o="";do o+=String.fromCharCode(i&255),i=i>>>8;while(i>0);t.putByte(o.length|128);for(var s=o.length-1;s>=0;--s)t.putByte(o.charCodeAt(s))}return t.putBuffer(r),t};U.oidToDer=function(e){var t=e.split("."),a=de.util.createBuffer();a.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,n,s,i,o=2;o<t.length;++o){if(r=!0,n=[],s=parseInt(t[o],10),s>4294967295)throw new Error("OID value too large; max is 32-bits.");do i=s&127,s=s>>>7,r||(i|=128),n.push(i),r=!1;while(s>0);for(var u=n.length-1;u>=0;--u)a.putByte(n[u])}return a};U.derToOid=function(e){var t;typeof e=="string"&&(e=de.util.createBuffer(e));var a=e.getByte();t=Math.floor(a/40)+"."+a%40;for(var r=0;e.length()>0;){if(r>70368744177663)throw new Error("OID value too large; max is 53-bits.");a=e.getByte(),r=r*128,a&128?r+=a&127:(t+="."+(r+a),r=0)}return t};U.utcTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,2),10);a=a>=50?1900+a:2e3+a;var r=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),s=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var u=e.charAt(10),l=10;u!=="+"&&u!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(a,r,n),t.setUTCHours(s,i,o,0),l&&(u=e.charAt(l),u==="+"||u==="-")){var c=parseInt(e.substr(l+1,2),10),f=parseInt(e.substr(l+4,2),10),g=c*60+f;g*=6e4,u==="+"?t.setTime(+t-g):t.setTime(+t+g)}return t};U.generalizedTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),i=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),u=0,l=0,c=!1;e.charAt(e.length-1)==="Z"&&(c=!0);var f=e.length-5,g=e.charAt(f);if(g==="+"||g==="-"){var v=parseInt(e.substr(f+1,2),10),y=parseInt(e.substr(f+4,2),10);l=v*60+y,l*=6e4,g==="+"&&(l*=-1),c=!0}return e.charAt(14)==="."&&(u=parseFloat(e.substr(14),10)*1e3),c?(t.setUTCFullYear(a,r,n),t.setUTCHours(s,i,o,u),t.setTime(+t+l)):(t.setFullYear(a,r,n),t.setHours(s,i,o,u)),t};U.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push((""+e.getUTCFullYear()).substr(2)),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t};U.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push(""+e.getUTCFullYear()),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t};U.integerToDer=function(e){var t=de.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var a=new Error("Integer too large; max is 32-bits.");throw a.integer=e,a};U.derToInteger=function(e){typeof e=="string"&&(e=de.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};U.validate=function(e,t,a,r){var n=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(n=!0,t.value&&de.util.isArray(t.value))for(var s=0,i=0;n&&i<t.value.length;++i){var o=t.value[i];n=!!o.optional;var u=e.value[s];if(!u){o.optional||(n=!1,r&&r.push("["+t.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var l=typeof o.tagClass<"u"&&typeof o.type<"u";if(l&&(u.tagClass!==o.tagClass||u.type!==o.type))if(o.optional){n=!0;continue}else{n=!1,r&&r.push("["+t.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+u.tagClass+","+u.type+")");break}var c=U.validate(u,o,a,r);if(c)++s,n=!0;else if(o.optional)n=!0;else{n=!1;break}}if(n&&a&&(t.capture&&(a[t.capture]=e.value),t.captureAsn1&&(a[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(a[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)){var f;if(e.bitStringContents.length<2)a[t.captureBitStringValue]="";else{var g=e.bitStringContents.charCodeAt(0);if(g!==0)throw new Error("captureBitStringValue only supported for zero unused bits");a[t.captureBitStringValue]=e.bitStringContents.slice(1)}}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return n};var gi=/[^\\u0000-\\u00ff]/;U.prettyPrint=function(e,t,a){var r="";t=t||0,a=a||2,t>0&&(r+=`
|
|
8
|
-
`);for(var n="",s=0;s<t*a;++s)n+=" ";switch(r+=n+"Tag: ",e.tagClass){case U.Class.UNIVERSAL:r+="Universal:";break;case U.Class.APPLICATION:r+="Application:";break;case U.Class.CONTEXT_SPECIFIC:r+="Context-Specific:";break;case U.Class.PRIVATE:r+="Private:";break}if(e.tagClass===U.Class.UNIVERSAL)switch(r+=e.type,e.type){case U.Type.NONE:r+=" (None)";break;case U.Type.BOOLEAN:r+=" (Boolean)";break;case U.Type.INTEGER:r+=" (Integer)";break;case U.Type.BITSTRING:r+=" (Bit string)";break;case U.Type.OCTETSTRING:r+=" (Octet string)";break;case U.Type.NULL:r+=" (Null)";break;case U.Type.OID:r+=" (Object Identifier)";break;case U.Type.ODESC:r+=" (Object Descriptor)";break;case U.Type.EXTERNAL:r+=" (External or Instance of)";break;case U.Type.REAL:r+=" (Real)";break;case U.Type.ENUMERATED:r+=" (Enumerated)";break;case U.Type.EMBEDDED:r+=" (Embedded PDV)";break;case U.Type.UTF8:r+=" (UTF8)";break;case U.Type.ROID:r+=" (Relative Object Identifier)";break;case U.Type.SEQUENCE:r+=" (Sequence)";break;case U.Type.SET:r+=" (Set)";break;case U.Type.PRINTABLESTRING:r+=" (Printable String)";break;case U.Type.IA5String:r+=" (IA5String (ASCII))";break;case U.Type.UTCTIME:r+=" (UTC time)";break;case U.Type.GENERALIZEDTIME:r+=" (Generalized time)";break;case U.Type.BMPSTRING:r+=" (BMP String)";break}else r+=e.type;if(r+=`
|
|
9
|
-
`,r
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`),a+=
|
|
13
|
-
`,a+="-----END
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`+o+t.substr(i+1),s=n-i-1,i=-1,++n}else(t[n]===" "||t[n]===" "||t[n]===",")&&(i=n);return t}function Ju(e){return e.replace(/^\s+/,"")}});var Ir=F((Ah,Bi)=>{var pe=$();qr();Oa();re();Bi.exports=pe.des=pe.des||{};pe.des.startEncrypting=function(e,t,a,r){var n=Jr({key:e,output:a,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n};pe.des.createEncryptionCipher=function(e,t){return Jr({key:e,output:null,decrypt:!1,mode:t})};pe.des.startDecrypting=function(e,t,a,r){var n=Jr({key:e,output:a,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n};pe.des.createDecryptionCipher=function(e,t){return Jr({key:e,output:null,decrypt:!0,mode:t})};pe.des.Algorithm=function(e,t){var a=this;a.name=e,a.mode=new t({blockSize:8,cipher:{encrypt:function(r,n){return Ii(a._keys,r,n,!1)},decrypt:function(r,n){return Ii(a._keys,r,n,!0)}}}),a._init=!1};pe.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=pe.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=o0(t),this._init=!0}};pt("DES-ECB",pe.cipher.modes.ecb);pt("DES-CBC",pe.cipher.modes.cbc);pt("DES-CFB",pe.cipher.modes.cfb);pt("DES-OFB",pe.cipher.modes.ofb);pt("DES-CTR",pe.cipher.modes.ctr);pt("3DES-ECB",pe.cipher.modes.ecb);pt("3DES-CBC",pe.cipher.modes.cbc);pt("3DES-CFB",pe.cipher.modes.cfb);pt("3DES-OFB",pe.cipher.modes.ofb);pt("3DES-CTR",pe.cipher.modes.ctr);function pt(e,t){var a=function(){return new pe.des.Algorithm(e,t)};pe.cipher.registerAlgorithm(e,a)}var Zu=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],e0=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],t0=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],r0=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],a0=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],n0=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],i0=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],s0=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function o0(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],i=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],g=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],v=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],x=e.length()>8?3:1,S=[],A=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],B=0,b,O=0;O<x;O++){var k=e.getInt32(),R=e.getInt32();b=(k>>>4^R)&252645135,R^=b,k^=b<<4,b=(R>>>-16^k)&65535,k^=b,R^=b<<-16,b=(k>>>2^R)&858993459,R^=b,k^=b<<2,b=(R>>>-16^k)&65535,k^=b,R^=b<<-16,b=(k>>>1^R)&1431655765,R^=b,k^=b<<1,b=(R>>>8^k)&16711935,k^=b,R^=b<<8,b=(k>>>1^R)&1431655765,R^=b,k^=b<<1,b=k<<8|R>>>20&240,k=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=b;for(var z=0;z<A.length;++z){A[z]?(k=k<<2|k>>>26,R=R<<2|R>>>26):(k=k<<1|k>>>27,R=R<<1|R>>>27),k&=-15,R&=-15;var Y=t[k>>>28]|a[k>>>24&15]|r[k>>>20&15]|n[k>>>16&15]|s[k>>>12&15]|i[k>>>8&15]|o[k>>>4&15],ne=u[R>>>28]|l[R>>>24&15]|c[R>>>20&15]|f[R>>>16&15]|g[R>>>12&15]|v[R>>>8&15]|y[R>>>4&15];b=(ne>>>16^Y)&65535,S[B++]=Y^b,S[B++]=ne^b<<16}}return S}function Ii(e,t,a,r){var n=e.length===32?3:9,s;n===3?s=r?[30,-2,-2]:[0,32,2]:s=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var i,o=t[0],u=t[1];i=(o>>>4^u)&252645135,u^=i,o^=i<<4,i=(o>>>16^u)&65535,u^=i,o^=i<<16,i=(u>>>2^o)&858993459,o^=i,u^=i<<2,i=(u>>>8^o)&16711935,o^=i,u^=i<<8,i=(o>>>1^u)&1431655765,u^=i,o^=i<<1,o=o<<1|o>>>31,u=u<<1|u>>>31;for(var l=0;l<n;l+=3){for(var c=s[l+1],f=s[l+2],g=s[l];g!=c;g+=f){var v=u^e[g],y=(u>>>4|u<<28)^e[g+1];i=o,o=u,u=i^(e0[v>>>24&63]|r0[v>>>16&63]|n0[v>>>8&63]|s0[v&63]|Zu[y>>>24&63]|t0[y>>>16&63]|a0[y>>>8&63]|i0[y&63])}i=o,o=u,u=i}o=o>>>1|o<<31,u=u>>>1|u<<31,i=(o>>>1^u)&1431655765,u^=i,o^=i<<1,i=(u>>>8^o)&16711935,o^=i,u^=i<<8,i=(u>>>2^o)&858993459,o^=i,u^=i<<2,i=(o>>>16^u)&65535,u^=i,o^=i<<16,i=(o>>>4^u)&252645135,u^=i,o^=i<<4,a[0]=o,a[1]=u}function Jr(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="DES-"+t,r;e.decrypt?r=pe.cipher.createDecipher(a,e.key):r=pe.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(s,i){var o=null;i instanceof pe.util.ByteBuffer&&(o=i,i={}),i=i||{},i.output=o,i.iv=s,n.call(r,i)},r}});var Zr=F((Ih,bi)=>{var Ge=$();sr();dt();re();var u0=Ge.pkcs5=Ge.pkcs5||{},Tt;Ge.util.isNodejs&&!Ge.options.usePureJavaScript&&(Tt=require("crypto"));bi.exports=Ge.pbkdf2=u0.pbkdf2=function(e,t,a,r,n,s){if(typeof n=="function"&&(s=n,n=null),Ge.util.isNodejs&&!Ge.options.usePureJavaScript&&Tt.pbkdf2&&(n===null||typeof n!="object")&&(Tt.pbkdf2Sync.length>4||!n||n==="sha1"))return typeof n!="string"&&(n="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?Tt.pbkdf2Sync.length===4?Tt.pbkdf2(e,t,a,r,function(b,O){if(b)return s(b);s(null,O.toString("binary"))}):Tt.pbkdf2(e,t,a,r,n,function(b,O){if(b)return s(b);s(null,O.toString("binary"))}):Tt.pbkdf2Sync.length===4?Tt.pbkdf2Sync(e,t,a,r).toString("binary"):Tt.pbkdf2Sync(e,t,a,r,n).toString("binary");if((typeof n>"u"||n===null)&&(n="sha1"),typeof n=="string"){if(!(n in Ge.md.algorithms))throw new Error("Unknown hash algorithm: "+n);n=Ge.md[n].create()}var i=n.digestLength;if(r>4294967295*i){var o=new Error("Derived key is too long.");if(s)return s(o);throw o}var u=Math.ceil(r/i),l=r-(u-1)*i,c=Ge.hmac.create();c.start(n,e);var f="",g,v,y;if(!s){for(var x=1;x<=u;++x){c.start(null,null),c.update(t),c.update(Ge.util.int32ToBytes(x)),g=y=c.digest().getBytes();for(var S=2;S<=a;++S)c.start(null,null),c.update(y),v=c.digest().getBytes(),g=Ge.util.xorBytes(g,v,i),y=v;f+=x<u?g:g.substr(0,l)}return f}var x=1,S;function A(){if(x>u)return s(null,f);c.start(null,null),c.update(t),c.update(Ge.util.int32ToBytes(x)),g=y=c.digest().getBytes(),S=2,B()}function B(){if(S<=a)return c.start(null,null),c.update(y),v=c.digest().getBytes(),g=Ge.util.xorBytes(g,v,i),y=v,++S,Ge.util.setImmediate(B);f+=x<u?g:g.substr(0,l),++x,A()}A()}});var Ga=F((Bh,Li)=>{var gt=$();dt();re();var Ni=Li.exports=gt.sha256=gt.sha256||{};gt.md.sha256=gt.md.algorithms.sha256=Ni;Ni.create=function(){wi||l0();var e=null,t=gt.util.createBuffer(),a=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,s=0;s<n;++s)r.fullMessageLength.push(0);return t=gt.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(n,s){s==="utf8"&&(n=gt.util.encodeUtf8(n));var i=n.length;r.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=i[1],i[1]=i[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(n),_i(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=gt.util.createBuffer();n.putBytes(t.bytes());var s=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,i=s&r.blockLength-1;n.putBytes(Ha.substr(0,r.blockLength-i));for(var o,u,l=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)o=r.fullMessageLength[c+1]*8,u=o/4294967296>>>0,l+=u,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};_i(f,a,n);var g=gt.util.createBuffer();return g.putInt32(f.h0),g.putInt32(f.h1),g.putInt32(f.h2),g.putInt32(f.h3),g.putInt32(f.h4),g.putInt32(f.h5),g.putInt32(f.h6),g.putInt32(f.h7),g},r};var Ha=null,wi=!1,Ri=null;function l0(){Ha="\x80",Ha+=gt.util.fillString("\0",64),Ri=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],wi=!0}function _i(e,t,a){for(var r,n,s,i,o,u,l,c,f,g,v,y,x,S,A,B=a.length();B>=64;){for(l=0;l<16;++l)t[l]=a.getInt32();for(;l<64;++l)r=t[l-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,n=t[l-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[l]=r+t[l-7]+n+t[l-16]|0;for(c=e.h0,f=e.h1,g=e.h2,v=e.h3,y=e.h4,x=e.h5,S=e.h6,A=e.h7,l=0;l<64;++l)i=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),o=S^y&(x^S),s=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),u=c&f|g&(c^f),r=A+i+o+Ri[l]+t[l],n=s+u,A=S,S=x,x=y,y=v+r>>>0,v=g,g=f,f=c,c=r+n>>>0;e.h0=e.h0+c|0,e.h1=e.h1+f|0,e.h2=e.h2+g|0,e.h3=e.h3+v|0,e.h4=e.h4+y|0,e.h5=e.h5+x|0,e.h6=e.h6+S|0,e.h7=e.h7+A|0,B-=64}}});var za=F((bh,ki)=>{var yt=$();re();var ea=null;yt.util.isNodejs&&!yt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(ea=require("crypto"));var c0=ki.exports=yt.prng=yt.prng||{};c0.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=e.md,r=new Array(32),n=0;n<32;++n)r[n]=a.create();t.pools=r,t.pool=0,t.generate=function(l,c){if(!c)return t.generateSync(l);var f=t.plugin.cipher,g=t.plugin.increment,v=t.plugin.formatKey,y=t.plugin.formatSeed,x=yt.util.createBuffer();t.key=null,S();function S(A){if(A)return c(A);if(x.length()>=l)return c(null,x.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return yt.util.nextTick(function(){s(S)});var B=f(t.key,t.seed);t.generated+=B.length,x.putBytes(B),t.key=v(f(t.key,g(t.seed))),t.seed=y(f(t.key,t.seed)),yt.util.setImmediate(S)}},t.generateSync=function(l){var c=t.plugin.cipher,f=t.plugin.increment,g=t.plugin.formatKey,v=t.plugin.formatSeed;t.key=null;for(var y=yt.util.createBuffer();y.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&i();var x=c(t.key,t.seed);t.generated+=x.length,y.putBytes(x),t.key=g(c(t.key,f(t.seed))),t.seed=v(c(t.key,t.seed))}return y.getBytes(l)};function s(l){if(t.pools[0].messageLength>=32)return o(),l();var c=32-t.pools[0].messageLength<<5;t.seedFile(c,function(f,g){if(f)return l(f);t.collect(g),o(),l()})}function i(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var c=1,f=0;f<32;++f)t.reseeds%c===0&&(l.update(t.pools[f].digest().getBytes()),t.pools[f].start()),c=c<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var g=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(g),t.generated=0}function u(l){var c=null,f=yt.util.globalScope,g=f.crypto||f.msCrypto;g&&g.getRandomValues&&(c=function(k){return g.getRandomValues(k)});var v=yt.util.createBuffer();if(c)for(;v.length()<l;){var y=Math.max(1,Math.min(l-v.length(),65536)/4),x=new Uint32Array(Math.floor(y));try{c(x);for(var S=0;S<x.length;++S)v.putInt32(x[S])}catch(k){if(!(typeof QuotaExceededError<"u"&&k instanceof QuotaExceededError))throw k}}if(v.length()<l)for(var A,B,b,O=Math.floor(Math.random()*65536);v.length()<l;){B=16807*(O&65535),A=16807*(O>>16),B+=(A&32767)<<16,B+=A>>15,B=(B&2147483647)+(B>>31),O=B&4294967295;for(var S=0;S<3;++S)b=O>>>(S<<3),b^=Math.floor(Math.random()*256),v.putByte(b&255)}return v.getBytes(l)}return ea?(t.seedFile=function(l,c){ea.randomBytes(l,function(f,g){if(f)return c(f);c(null,g.toString())})},t.seedFileSync=function(l){return ea.randomBytes(l).toString()}):(t.seedFile=function(l,c){try{c(null,u(l))}catch(f){c(f)}},t.seedFileSync=u),t.collect=function(l){for(var c=l.length,f=0;f<c;++f)t.pools[t.pool].update(l.substr(f,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(l,c){for(var f="",g=0;g<c;g+=8)f+=String.fromCharCode(l>>g&255);t.collect(f)},t.registerWorker=function(l){if(l===self)t.seedFile=function(f,g){function v(y){var x=y.data;x.forge&&x.forge.prng&&(self.removeEventListener("message",v),g(x.forge.prng.err,x.forge.prng.bytes))}self.addEventListener("message",v),self.postMessage({forge:{prng:{needed:f}}})};else{var c=function(f){var g=f.data;g.forge&&g.forge.prng&&t.seedFile(g.forge.prng.needed,function(v,y){l.postMessage({forge:{prng:{err:v,bytes:y}}})})};l.addEventListener("message",c)}},t}});var tt=F((_h,Qa)=>{var Te=$();wt();Ga();za();re();(function(){if(Te.random&&Te.random.getBytes){Qa.exports=Te.random;return}(function(e){var t={},a=new Array(4),r=Te.util.createBuffer();t.formatKey=function(f){var g=Te.util.createBuffer(f);return f=new Array(4),f[0]=g.getInt32(),f[1]=g.getInt32(),f[2]=g.getInt32(),f[3]=g.getInt32(),Te.aes._expandKey(f,!1)},t.formatSeed=function(f){var g=Te.util.createBuffer(f);return f=new Array(4),f[0]=g.getInt32(),f[1]=g.getInt32(),f[2]=g.getInt32(),f[3]=g.getInt32(),f},t.cipher=function(f,g){return Te.aes._updateBlock(f,g,a,!1),r.putInt32(a[0]),r.putInt32(a[1]),r.putInt32(a[2]),r.putInt32(a[3]),r.getBytes()},t.increment=function(f){return++f[3],f},t.md=Te.md.sha256;function n(){var f=Te.prng.create(t);return f.getBytes=function(g,v){return f.generate(g,v)},f.getBytesSync=function(g){return f.generate(g)},f}var s=n(),i=null,o=Te.util.globalScope,u=o.crypto||o.msCrypto;if(u&&u.getRandomValues&&(i=function(f){return u.getRandomValues(f)}),Te.options.usePureJavaScript||!Te.util.isNodejs&&!i){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var c in navigator)try{typeof navigator[c]=="string"&&(l+=navigator[c])}catch{}s.collect(l),l=null}e&&(e().mousemove(function(f){s.collectInt(f.clientX,16),s.collectInt(f.clientY,16)}),e().keypress(function(f){s.collectInt(f.charCode,8)}))}if(!Te.random)Te.random=s;else for(var c in s)Te.random[c]=s[c];Te.random.createInstance=n,Qa.exports=Te.random})(typeof jQuery<"u"?jQuery:null)})()});var Ya=F((Nh,Pi)=>{var $e=$();re();var $a=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],Di=[1,2,3,5],f0=function(e,t){return e<<t&65535|(e&65535)>>16-t},d0=function(e,t){return(e&65535)>>t|e<<16-t&65535};Pi.exports=$e.rc2=$e.rc2||{};$e.rc2.expandKey=function(e,t){typeof e=="string"&&(e=$e.util.createBuffer(e)),t=t||128;var a=e,r=e.length(),n=t,s=Math.ceil(n/8),i=255>>(n&7),o;for(o=r;o<128;o++)a.putByte($a[a.at(o-1)+a.at(o-r)&255]);for(a.setAt(128-s,$a[a.at(128-s)&i]),o=127-s;o>=0;o--)a.setAt(o,$a[a.at(o+1)^a.at(o+s)]);return a};var Ui=function(e,t,a){var r=!1,n=null,s=null,i=null,o,u,l,c,f=[];for(e=$e.rc2.expandKey(e,t),l=0;l<64;l++)f.push(e.getInt16Le());a?(o=function(y){for(l=0;l<4;l++)y[l]+=f[c]+(y[(l+3)%4]&y[(l+2)%4])+(~y[(l+3)%4]&y[(l+1)%4]),y[l]=f0(y[l],Di[l]),c++},u=function(y){for(l=0;l<4;l++)y[l]+=f[y[(l+3)%4]&63]}):(o=function(y){for(l=3;l>=0;l--)y[l]=d0(y[l],Di[l]),y[l]-=f[c]+(y[(l+3)%4]&y[(l+2)%4])+(~y[(l+3)%4]&y[(l+1)%4]),c--},u=function(y){for(l=3;l>=0;l--)y[l]-=f[y[(l+3)%4]&63]});var g=function(y){var x=[];for(l=0;l<4;l++){var S=n.getInt16Le();i!==null&&(a?S^=i.getInt16Le():i.putInt16Le(S)),x.push(S&65535)}c=a?0:63;for(var A=0;A<y.length;A++)for(var B=0;B<y[A][0];B++)y[A][1](x);for(l=0;l<4;l++)i!==null&&(a?i.putInt16Le(x[l]):x[l]^=i.getInt16Le()),s.putInt16Le(x[l])},v=null;return v={start:function(y,x){y&&typeof y=="string"&&(y=$e.util.createBuffer(y)),r=!1,n=$e.util.createBuffer(),s=x||new $e.util.createBuffer,i=y,v.output=s},update:function(y){for(r||n.putBuffer(y);n.length()>=8;)g([[5,o],[1,u],[6,o],[1,u],[5,o]])},finish:function(y){var x=!0;if(a)if(y)x=y(8,n,!a);else{var S=n.length()===8?8:8-n.length();n.fillWithByte(S,S)}if(x&&(r=!0,v.update()),!a&&(x=n.length()===0,x))if(y)x=y(8,s,!a);else{var A=s.length(),B=s.at(A-1);B>A?x=!1:s.truncate(B)}return x}},v};$e.rc2.startEncrypting=function(e,t,a){var r=$e.rc2.createEncryptionCipher(e,128);return r.start(t,a),r};$e.rc2.createEncryptionCipher=function(e,t){return Ui(e,t,!0)};$e.rc2.startDecrypting=function(e,t,a){var r=$e.rc2.createDecryptionCipher(e,128);return r.start(t,a),r};$e.rc2.createDecryptionCipher=function(e,t){return Ui(e,t,!1)}});var br=F((wh,Gi)=>{var ja=$();Gi.exports=ja.jsbn=ja.jsbn||{};var At,h0=0xdeadbeefcafe,Oi=(h0&16777215)==15715070;function _(e,t,a){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,a):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}ja.jsbn.BigInteger=_;function Z(){return new _(null)}function p0(e,t,a,r,n,s){for(;--s>=0;){var i=t*this.data[e++]+a.data[r]+n;n=Math.floor(i/67108864),a.data[r++]=i&67108863}return n}function g0(e,t,a,r,n,s){for(var i=t&32767,o=t>>15;--s>=0;){var u=this.data[e]&32767,l=this.data[e++]>>15,c=o*u+l*i;u=i*u+((c&32767)<<15)+a.data[r]+(n&1073741823),n=(u>>>30)+(c>>>15)+o*l+(n>>>30),a.data[r++]=u&1073741823}return n}function Vi(e,t,a,r,n,s){for(var i=t&16383,o=t>>14;--s>=0;){var u=this.data[e]&16383,l=this.data[e++]>>14,c=o*u+l*i;u=i*u+((c&16383)<<14)+a.data[r]+n,n=(u>>28)+(c>>14)+o*l,a.data[r++]=u&268435455}return n}typeof navigator>"u"?(_.prototype.am=Vi,At=28):Oi&&navigator.appName=="Microsoft Internet Explorer"?(_.prototype.am=g0,At=30):Oi&&navigator.appName!="Netscape"?(_.prototype.am=p0,At=26):(_.prototype.am=Vi,At=28);_.prototype.DB=At;_.prototype.DM=(1<<At)-1;_.prototype.DV=1<<At;var Wa=52;_.prototype.FV=Math.pow(2,Wa);_.prototype.F1=Wa-At;_.prototype.F2=2*At-Wa;var y0="0123456789abcdefghijklmnopqrstuvwxyz",ta=new Array,ur,rt;ur=48;for(rt=0;rt<=9;++rt)ta[ur++]=rt;ur=97;for(rt=10;rt<36;++rt)ta[ur++]=rt;ur=65;for(rt=10;rt<36;++rt)ta[ur++]=rt;function Fi(e){return y0.charAt(e)}function Ki(e,t){var a=ta[e.charCodeAt(t)];return a??-1}function v0(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function m0(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function Lt(e){var t=Z();return t.fromInt(e),t}function C0(e,t){var a;if(t==16)a=4;else if(t==8)a=3;else if(t==256)a=8;else if(t==2)a=1;else if(t==32)a=5;else if(t==4)a=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,n=!1,s=0;--r>=0;){var i=a==8?e[r]&255:Ki(e,r);if(i<0){e.charAt(r)=="-"&&(n=!0);continue}n=!1,s==0?this.data[this.t++]=i:s+a>this.DB?(this.data[this.t-1]|=(i&(1<<this.DB-s)-1)<<s,this.data[this.t++]=i>>this.DB-s):this.data[this.t-1]|=i<<s,s+=a,s>=this.DB&&(s-=this.DB)}a==8&&(e[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),n&&_.ZERO.subTo(this,this)}function E0(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function x0(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var a=(1<<t)-1,r,n=!1,s="",i=this.t,o=this.DB-i*this.DB%t;if(i-- >0)for(o<this.DB&&(r=this.data[i]>>o)>0&&(n=!0,s=Fi(r));i>=0;)o<t?(r=(this.data[i]&(1<<o)-1)<<t-o,r|=this.data[--i]>>(o+=this.DB-t)):(r=this.data[i]>>(o-=t)&a,o<=0&&(o+=this.DB,--i)),r>0&&(n=!0),n&&(s+=Fi(r));return n?s:"0"}function S0(){var e=Z();return _.ZERO.subTo(this,e),e}function T0(){return this.s<0?this.negate():this}function A0(e){var t=this.s-e.s;if(t!=0)return t;var a=this.t;if(t=a-e.t,t!=0)return this.s<0?-t:t;for(;--a>=0;)if((t=this.data[a]-e.data[a])!=0)return t;return 0}function ra(e){var t=1,a;return(a=e>>>16)!=0&&(e=a,t+=16),(a=e>>8)!=0&&(e=a,t+=8),(a=e>>4)!=0&&(e=a,t+=4),(a=e>>2)!=0&&(e=a,t+=2),(a=e>>1)!=0&&(e=a,t+=1),t}function I0(){return this.t<=0?0:this.DB*(this.t-1)+ra(this.data[this.t-1]^this.s&this.DM)}function B0(e,t){var a;for(a=this.t-1;a>=0;--a)t.data[a+e]=this.data[a];for(a=e-1;a>=0;--a)t.data[a]=0;t.t=this.t+e,t.s=this.s}function b0(e,t){for(var a=e;a<this.t;++a)t.data[a-e]=this.data[a];t.t=Math.max(this.t-e,0),t.s=this.s}function _0(e,t){var a=e%this.DB,r=this.DB-a,n=(1<<r)-1,s=Math.floor(e/this.DB),i=this.s<<a&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+s+1]=this.data[o]>>r|i,i=(this.data[o]&n)<<a;for(o=s-1;o>=0;--o)t.data[o]=0;t.data[s]=i,t.t=this.t+s+1,t.s=this.s,t.clamp()}function N0(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t){t.t=0;return}var r=e%this.DB,n=this.DB-r,s=(1<<r)-1;t.data[0]=this.data[a]>>r;for(var i=a+1;i<this.t;++i)t.data[i-a-1]|=(this.data[i]&s)<<n,t.data[i-a]=this.data[i]>>r;r>0&&(t.data[this.t-a-1]|=(this.s&s)<<n),t.t=this.t-a,t.clamp()}function w0(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]-e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r-=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[a++]=this.DV+r:r>0&&(t.data[a++]=r),t.t=a,t.clamp()}function R0(e,t){var a=this.abs(),r=e.abs(),n=a.t;for(t.t=n+r.t;--n>=0;)t.data[n]=0;for(n=0;n<r.t;++n)t.data[n+a.t]=a.am(0,r.data[n],t,n,0,a.t);t.s=0,t.clamp(),this.s!=e.s&&_.ZERO.subTo(t,t)}function L0(e){for(var t=this.abs(),a=e.t=2*t.t;--a>=0;)e.data[a]=0;for(a=0;a<t.t-1;++a){var r=t.am(a,t.data[a],e,2*a,0,1);(e.data[a+t.t]+=t.am(a+1,2*t.data[a],e,2*a+1,r,t.t-a-1))>=t.DV&&(e.data[a+t.t]-=t.DV,e.data[a+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(a,t.data[a],e,2*a,0,1)),e.s=0,e.clamp()}function k0(e,t,a){var r=e.abs();if(!(r.t<=0)){var n=this.abs();if(n.t<r.t){t?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=Z());var s=Z(),i=this.s,o=e.s,u=this.DB-ra(r.data[r.t-1]);u>0?(r.lShiftTo(u,s),n.lShiftTo(u,a)):(r.copyTo(s),n.copyTo(a));var l=s.t,c=s.data[l-1];if(c!=0){var f=c*(1<<this.F1)+(l>1?s.data[l-2]>>this.F2:0),g=this.FV/f,v=(1<<this.F1)/f,y=1<<this.F2,x=a.t,S=x-l,A=t??Z();for(s.dlShiftTo(S,A),a.compareTo(A)>=0&&(a.data[a.t++]=1,a.subTo(A,a)),_.ONE.dlShiftTo(l,A),A.subTo(s,s);s.t<l;)s.data[s.t++]=0;for(;--S>=0;){var B=a.data[--x]==c?this.DM:Math.floor(a.data[x]*g+(a.data[x-1]+y)*v);if((a.data[x]+=s.am(0,B,a,S,0,l))<B)for(s.dlShiftTo(S,A),a.subTo(A,a);a.data[x]<--B;)a.subTo(A,a)}t!=null&&(a.drShiftTo(l,t),i!=o&&_.ZERO.subTo(t,t)),a.t=l,a.clamp(),u>0&&a.rShiftTo(u,a),i<0&&_.ZERO.subTo(a,a)}}}function D0(e){var t=Z();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(_.ZERO)>0&&e.subTo(t,t),t}function $t(e){this.m=e}function U0(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function P0(e){return e}function O0(e){e.divRemTo(this.m,null,e)}function V0(e,t,a){e.multiplyTo(t,a),this.reduce(a)}function F0(e,t){e.squareTo(t),this.reduce(t)}$t.prototype.convert=U0;$t.prototype.revert=P0;$t.prototype.reduce=O0;$t.prototype.mulTo=V0;$t.prototype.sqrTo=F0;function K0(){if(this.t<1)return 0;var e=this.data[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Yt(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function M0(e){var t=Z();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t}function q0(e){var t=Z();return e.copyTo(t),this.reduce(t),t}function H0(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var a=e.data[t]&32767,r=a*this.mpl+((a*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(a=t+this.m.t,e.data[a]+=this.m.am(0,r,e,t,0,this.m.t);e.data[a]>=e.DV;)e.data[a]-=e.DV,e.data[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function G0(e,t){e.squareTo(t),this.reduce(t)}function z0(e,t,a){e.multiplyTo(t,a),this.reduce(a)}Yt.prototype.convert=M0;Yt.prototype.revert=q0;Yt.prototype.reduce=H0;Yt.prototype.mulTo=z0;Yt.prototype.sqrTo=G0;function Q0(){return(this.t>0?this.data[0]&1:this.s)==0}function $0(e,t){if(e>4294967295||e<1)return _.ONE;var a=Z(),r=Z(),n=t.convert(this),s=ra(e)-1;for(n.copyTo(a);--s>=0;)if(t.sqrTo(a,r),(e&1<<s)>0)t.mulTo(r,n,a);else{var i=a;a=r,r=i}return t.revert(a)}function Y0(e,t){var a;return e<256||t.isEven()?a=new $t(t):a=new Yt(t),this.exp(e,a)}_.prototype.copyTo=v0;_.prototype.fromInt=m0;_.prototype.fromString=C0;_.prototype.clamp=E0;_.prototype.dlShiftTo=B0;_.prototype.drShiftTo=b0;_.prototype.lShiftTo=_0;_.prototype.rShiftTo=N0;_.prototype.subTo=w0;_.prototype.multiplyTo=R0;_.prototype.squareTo=L0;_.prototype.divRemTo=k0;_.prototype.invDigit=K0;_.prototype.isEven=Q0;_.prototype.exp=$0;_.prototype.toString=x0;_.prototype.negate=S0;_.prototype.abs=T0;_.prototype.compareTo=A0;_.prototype.bitLength=I0;_.prototype.mod=D0;_.prototype.modPowInt=Y0;_.ZERO=Lt(0);_.ONE=Lt(1);function j0(){var e=Z();return this.copyTo(e),e}function W0(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function X0(){return this.t==0?this.s:this.data[0]<<24>>24}function J0(){return this.t==0?this.s:this.data[0]<<16>>16}function Z0(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function el(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function tl(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),r=Lt(a),n=Z(),s=Z(),i="";for(this.divRemTo(r,n,s);n.signum()>0;)i=(a+s.intValue()).toString(e).substr(1)+i,n.divRemTo(r,n,s);return s.intValue().toString(e)+i}function rl(e,t){this.fromInt(0),t==null&&(t=10);for(var a=this.chunkSize(t),r=Math.pow(t,a),n=!1,s=0,i=0,o=0;o<e.length;++o){var u=Ki(e,o);if(u<0){e.charAt(o)=="-"&&this.signum()==0&&(n=!0);continue}i=t*i+u,++s>=a&&(this.dMultiply(r),this.dAddOffset(i,0),s=0,i=0)}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(i,0)),n&&_.ZERO.subTo(this,this)}function al(e,t,a){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(_.ONE.shiftLeft(e-1),Xa,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(_.ONE.shiftLeft(e-1),this);else{var r=new Array,n=e&7;r.length=(e>>3)+1,t.nextBytes(r),n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromString(r,256)}}function nl(){var e=this.t,t=new Array;t[0]=this.s;var a=this.DB-e*this.DB%8,r,n=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[n++]=r|this.s<<this.DB-a);e>=0;)a<8?(r=(this.data[e]&(1<<a)-1)<<8-a,r|=this.data[--e]>>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),(r&128)!=0&&(r|=-256),n==0&&(this.s&128)!=(r&128)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t}function il(e){return this.compareTo(e)==0}function sl(e){return this.compareTo(e)<0?this:e}function ol(e){return this.compareTo(e)>0?this:e}function ul(e,t,a){var r,n,s=Math.min(e.t,this.t);for(r=0;r<s;++r)a.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(n=e.s&this.DM,r=s;r<this.t;++r)a.data[r]=t(this.data[r],n);a.t=this.t}else{for(n=this.s&this.DM,r=s;r<e.t;++r)a.data[r]=t(n,e.data[r]);a.t=e.t}a.s=t(this.s,e.s),a.clamp()}function ll(e,t){return e&t}function cl(e){var t=Z();return this.bitwiseTo(e,ll,t),t}function Xa(e,t){return e|t}function fl(e){var t=Z();return this.bitwiseTo(e,Xa,t),t}function Mi(e,t){return e^t}function dl(e){var t=Z();return this.bitwiseTo(e,Mi,t),t}function qi(e,t){return e&~t}function hl(e){var t=Z();return this.bitwiseTo(e,qi,t),t}function pl(){for(var e=Z(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function gl(e){var t=Z();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function yl(e){var t=Z();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function vl(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function ml(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+vl(this.data[e]);return this.s<0?this.t*this.DB:-1}function Cl(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function El(){for(var e=0,t=this.s&this.DM,a=0;a<this.t;++a)e+=Cl(this.data[a]^t);return e}function xl(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function Sl(e,t){var a=_.ONE.shiftLeft(e);return this.bitwiseTo(a,t,a),a}function Tl(e){return this.changeBit(e,Xa)}function Al(e){return this.changeBit(e,qi)}function Il(e){return this.changeBit(e,Mi)}function Bl(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]+e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r+=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[a++]=r:r<-1&&(t.data[a++]=this.DV+r),t.t=a,t.clamp()}function bl(e){var t=Z();return this.addTo(e,t),t}function _l(e){var t=Z();return this.subTo(e,t),t}function Nl(e){var t=Z();return this.multiplyTo(e,t),t}function wl(){var e=Z();return this.squareTo(e),e}function Rl(e){var t=Z();return this.divRemTo(e,t,null),t}function Ll(e){var t=Z();return this.divRemTo(e,null,t),t}function kl(e){var t=Z(),a=Z();return this.divRemTo(e,t,a),new Array(t,a)}function Dl(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function Ul(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function Br(){}function Hi(e){return e}function Pl(e,t,a){e.multiplyTo(t,a)}function Ol(e,t){e.squareTo(t)}Br.prototype.convert=Hi;Br.prototype.revert=Hi;Br.prototype.mulTo=Pl;Br.prototype.sqrTo=Ol;function Vl(e){return this.exp(e,new Br)}function Fl(e,t,a){var r=Math.min(this.t+e.t,t);for(a.s=0,a.t=r;r>0;)a.data[--r]=0;var n;for(n=a.t-this.t;r<n;++r)a.data[r+this.t]=this.am(0,e.data[r],a,r,0,this.t);for(n=Math.min(e.t,t);r<n;++r)this.am(0,e.data[r],a,r,0,t-r);a.clamp()}function Kl(e,t,a){--t;var r=a.t=this.t+e.t-t;for(a.s=0;--r>=0;)a.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)a.data[this.t+r-t]=this.am(t-r,e.data[r],a,0,0,this.t+r-t);a.clamp(),a.drShiftTo(1,a)}function lr(e){this.r2=Z(),this.q3=Z(),_.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Ml(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Z();return e.copyTo(t),this.reduce(t),t}function ql(e){return e}function Hl(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function Gl(e,t){e.squareTo(t),this.reduce(t)}function zl(e,t,a){e.multiplyTo(t,a),this.reduce(a)}lr.prototype.convert=Ml;lr.prototype.revert=ql;lr.prototype.reduce=Hl;lr.prototype.mulTo=zl;lr.prototype.sqrTo=Gl;function Ql(e,t){var a=e.bitLength(),r,n=Lt(1),s;if(a<=0)return n;a<18?r=1:a<48?r=3:a<144?r=4:a<768?r=5:r=6,a<8?s=new $t(t):t.isEven()?s=new lr(t):s=new Yt(t);var i=new Array,o=3,u=r-1,l=(1<<r)-1;if(i[1]=s.convert(this),r>1){var c=Z();for(s.sqrTo(i[1],c);o<=l;)i[o]=Z(),s.mulTo(c,i[o-2],i[o]),o+=2}var f=e.t-1,g,v=!0,y=Z(),x;for(a=ra(e.data[f])-1;f>=0;){for(a>=u?g=e.data[f]>>a-u&l:(g=(e.data[f]&(1<<a+1)-1)<<u-a,f>0&&(g|=e.data[f-1]>>this.DB+a-u)),o=r;(g&1)==0;)g>>=1,--o;if((a-=o)<0&&(a+=this.DB,--f),v)i[g].copyTo(n),v=!1;else{for(;o>1;)s.sqrTo(n,y),s.sqrTo(y,n),o-=2;o>0?s.sqrTo(n,y):(x=n,n=y,y=x),s.mulTo(y,i[g],n)}for(;f>=0&&(e.data[f]&1<<a)==0;)s.sqrTo(n,y),x=n,n=y,y=x,--a<0&&(a=this.DB-1,--f)}return s.revert(n)}function $l(e){var t=this.s<0?this.negate():this.clone(),a=e.s<0?e.negate():e.clone();if(t.compareTo(a)<0){var r=t;t=a,a=r}var n=t.getLowestSetBit(),s=a.getLowestSetBit();if(s<0)return t;for(n<s&&(s=n),s>0&&(t.rShiftTo(s,t),a.rShiftTo(s,a));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=a.getLowestSetBit())>0&&a.rShiftTo(n,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return s>0&&a.lShiftTo(s,a),a}function Yl(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(t==0)a=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)a=(t*a+this.data[r])%e;return a}function jl(e){if(this.signum()==0)return _.ZERO;var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return _.ZERO;for(var a=e.clone(),r=this.clone(),n=Lt(1),s=Lt(0),i=Lt(0),o=Lt(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),t?((!n.isEven()||!s.isEven())&&(n.addTo(this,n),s.subTo(e,s)),n.rShiftTo(1,n)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!o.isEven())&&(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);a.compareTo(r)>=0?(a.subTo(r,a),t&&n.subTo(i,n),s.subTo(o,s)):(r.subTo(a,r),t&&i.subTo(n,i),o.subTo(s,o))}if(r.compareTo(_.ONE)!=0)return _.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var ct=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Wl=(1<<26)/ct[ct.length-1];function Xl(e){var t,a=this.abs();if(a.t==1&&a.data[0]<=ct[ct.length-1]){for(t=0;t<ct.length;++t)if(a.data[0]==ct[t])return!0;return!1}if(a.isEven())return!1;for(t=1;t<ct.length;){for(var r=ct[t],n=t+1;n<ct.length&&r<Wl;)r*=ct[n++];for(r=a.modInt(r);t<n;)if(r%ct[t++]==0)return!1}return a.millerRabin(e)}function Jl(e){var t=this.subtract(_.ONE),a=t.getLowestSetBit();if(a<=0)return!1;for(var r=t.shiftRight(a),n=Zl(),s,i=0;i<e;++i){do s=new _(this.bitLength(),n);while(s.compareTo(_.ONE)<=0||s.compareTo(t)>=0);var o=s.modPow(r,this);if(o.compareTo(_.ONE)!=0&&o.compareTo(t)!=0){for(var u=1;u++<a&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(_.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function Zl(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}_.prototype.chunkSize=Z0;_.prototype.toRadix=tl;_.prototype.fromRadix=rl;_.prototype.fromNumber=al;_.prototype.bitwiseTo=ul;_.prototype.changeBit=Sl;_.prototype.addTo=Bl;_.prototype.dMultiply=Dl;_.prototype.dAddOffset=Ul;_.prototype.multiplyLowerTo=Fl;_.prototype.multiplyUpperTo=Kl;_.prototype.modInt=Yl;_.prototype.millerRabin=Jl;_.prototype.clone=j0;_.prototype.intValue=W0;_.prototype.byteValue=X0;_.prototype.shortValue=J0;_.prototype.signum=el;_.prototype.toByteArray=nl;_.prototype.equals=il;_.prototype.min=sl;_.prototype.max=ol;_.prototype.and=cl;_.prototype.or=fl;_.prototype.xor=dl;_.prototype.andNot=hl;_.prototype.not=pl;_.prototype.shiftLeft=gl;_.prototype.shiftRight=yl;_.prototype.getLowestSetBit=ml;_.prototype.bitCount=El;_.prototype.testBit=xl;_.prototype.setBit=Tl;_.prototype.clearBit=Al;_.prototype.flipBit=Il;_.prototype.add=bl;_.prototype.subtract=_l;_.prototype.multiply=Nl;_.prototype.divide=Rl;_.prototype.remainder=Ll;_.prototype.divideAndRemainder=kl;_.prototype.modPow=Ql;_.prototype.modInverse=jl;_.prototype.pow=Vl;_.prototype.gcd=$l;_.prototype.isProbablePrime=Xl;_.prototype.square=wl});var cr=F((Rh,Yi)=>{var vt=$();dt();re();var Qi=Yi.exports=vt.sha1=vt.sha1||{};vt.md.sha1=vt.md.algorithms.sha1=Qi;Qi.create=function(){$i||ec();var e=null,t=vt.util.createBuffer(),a=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,s=0;s<n;++s)r.fullMessageLength.push(0);return t=vt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(n,s){s==="utf8"&&(n=vt.util.encodeUtf8(n));var i=n.length;r.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=i[1],i[1]=i[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(n),zi(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=vt.util.createBuffer();n.putBytes(t.bytes());var s=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,i=s&r.blockLength-1;n.putBytes(Ja.substr(0,r.blockLength-i));for(var o,u,l=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)o=r.fullMessageLength[c+1]*8,u=o/4294967296>>>0,l+=u,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};zi(f,a,n);var g=vt.util.createBuffer();return g.putInt32(f.h0),g.putInt32(f.h1),g.putInt32(f.h2),g.putInt32(f.h3),g.putInt32(f.h4),g},r};var Ja=null,$i=!1;function ec(){Ja="\x80",Ja+=vt.util.fillString("\0",64),$i=!0}function zi(e,t,a){for(var r,n,s,i,o,u,l,c,f=a.length();f>=64;){for(n=e.h0,s=e.h1,i=e.h2,o=e.h3,u=e.h4,c=0;c<16;++c)r=a.getInt32(),t[c]=r,l=o^s&(i^o),r=(n<<5|n>>>27)+l+u+1518500249+r,u=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=r;for(;c<20;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,l=o^s&(i^o),r=(n<<5|n>>>27)+l+u+1518500249+r,u=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=r;for(;c<32;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,l=s^i^o,r=(n<<5|n>>>27)+l+u+1859775393+r,u=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=r;for(;c<40;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,l=s^i^o,r=(n<<5|n>>>27)+l+u+1859775393+r,u=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=r;for(;c<60;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,l=s&i|o&(s^i),r=(n<<5|n>>>27)+l+u+2400959708+r,u=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=r;for(;c<80;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,l=s^i^o,r=(n<<5|n>>>27)+l+u+3395469782+r,u=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=r;e.h0=e.h0+n|0,e.h1=e.h1+s|0,e.h2=e.h2+i|0,e.h3=e.h3+o|0,e.h4=e.h4+u|0,f-=64}}});var Za=F((Lh,Wi)=>{var mt=$();re();tt();cr();var ji=Wi.exports=mt.pkcs1=mt.pkcs1||{};ji.encode_rsa_oaep=function(e,t,a){var r,n,s,i;typeof a=="string"?(r=a,n=arguments[3]||void 0,s=arguments[4]||void 0):a&&(r=a.label||void 0,n=a.seed||void 0,s=a.md||void 0,a.mgf1&&a.mgf1.md&&(i=a.mgf1.md)),s?s.start():s=mt.md.sha1.create(),i||(i=s);var o=Math.ceil(e.n.bitLength()/8),u=o-2*s.digestLength-2;if(t.length>u){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=u,l}r||(r=""),s.update(r,"raw");for(var c=s.digest(),f="",g=u-t.length,v=0;v<g;v++)f+="\0";var y=c.getBytes()+f+""+t;if(!n)n=mt.random.getBytes(s.digestLength);else if(n.length!==s.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=n.length,l.digestLength=s.digestLength,l}var x=aa(n,o-s.digestLength-1,i),S=mt.util.xorBytes(y,x,y.length),A=aa(S,s.digestLength,i),B=mt.util.xorBytes(n,A,n.length);return"\0"+B+S};ji.decode_rsa_oaep=function(e,t,a){var r,n,s;typeof a=="string"?(r=a,n=arguments[3]||void 0):a&&(r=a.label||void 0,n=a.md||void 0,a.mgf1&&a.mgf1.md&&(s=a.mgf1.md));var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var S=new Error("RSAES-OAEP encoded message length is invalid.");throw S.length=t.length,S.expectedLength=i,S}if(n===void 0?n=mt.md.sha1.create():n.start(),s||(s=n),i<2*n.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),n.update(r,"raw");for(var o=n.digest().getBytes(),u=t.charAt(0),l=t.substring(1,n.digestLength+1),c=t.substring(1+n.digestLength),f=aa(c,n.digestLength,s),g=mt.util.xorBytes(l,f,l.length),v=aa(g,i-n.digestLength-1,s),y=mt.util.xorBytes(c,v,c.length),x=y.substring(0,n.digestLength),S=u!=="\0",A=0;A<n.digestLength;++A)S|=o.charAt(A)!==x.charAt(A);for(var B=1,b=n.digestLength,O=n.digestLength;O<y.length;O++){var k=y.charCodeAt(O),R=k&1^1,z=B?65534:0;S|=k&z,B=B&R,b+=B}if(S||y.charCodeAt(b)!==1)throw new Error("Invalid RSAES-OAEP padding.");return y.substring(b+1)};function aa(e,t,a){a||(a=mt.md.sha1.create());for(var r="",n=Math.ceil(t/a.digestLength),s=0;s<n;++s){var i=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,s&255);a.start(),a.update(e+i),r+=a.digest().getBytes()}return r.substring(0,t)}});var tn=F((kh,en)=>{var kt=$();re();br();tt();(function(){if(kt.prime){en.exports=kt.prime;return}var e=en.exports=kt.prime=kt.prime||{},t=kt.jsbn.BigInteger,a=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var n=function(f,g){return f|g};e.generateProbablePrime=function(f,g,v){typeof g=="function"&&(v=g,g={}),g=g||{};var y=g.algorithm||"PRIMEINC";typeof y=="string"&&(y={name:y}),y.options=y.options||{};var x=g.prng||kt.random,S={nextBytes:function(A){for(var B=x.getBytesSync(A.length),b=0;b<A.length;++b)A[b]=B.charCodeAt(b)}};if(y.name==="PRIMEINC")return s(f,S,y.options,v);throw new Error("Invalid prime generation algorithm: "+y.name)};function s(f,g,v,y){return"workers"in v?u(f,g,v,y):i(f,g,v,y)}function i(f,g,v,y){var x=l(f,g),S=0,A=c(x.bitLength());"millerRabinTests"in v&&(A=v.millerRabinTests);var B=10;"maxBlockTime"in v&&(B=v.maxBlockTime),o(x,f,g,S,A,B,y)}function o(f,g,v,y,x,S,A){var B=+new Date;do{if(f.bitLength()>g&&(f=l(g,v)),f.isProbablePrime(x))return A(null,f);f.dAddOffset(a[y++%8],0)}while(S<0||+new Date-B<S);kt.util.setImmediate(function(){o(f,g,v,y,x,S,A)})}function u(f,g,v,y){if(typeof Worker>"u")return i(f,g,v,y);var x=l(f,g),S=v.workers,A=v.workLoad||100,B=A*30/8,b=v.workerScript||"forge/prime.worker.js";if(S===-1)return kt.util.estimateCores(function(k,R){k&&(R=2),S=R-1,O()});O();function O(){S=Math.max(1,S);for(var k=[],R=0;R<S;++R)k[R]=new Worker(b);for(var z=S,R=0;R<S;++R)k[R].addEventListener("message",ne);var Y=!1;function ne(ie){if(!Y){--z;var ue=ie.data;if(ue.found){for(var fe=0;fe<k.length;++fe)k[fe].terminate();return Y=!0,y(null,new t(ue.prime,16))}x.bitLength()>f&&(x=l(f,g));var qe=x.toString(16);ie.target.postMessage({hex:qe,workLoad:A}),x.dAddOffset(B,0)}}}}function l(f,g){var v=new t(f,g),y=f-1;return v.testBit(y)||v.bitwiseTo(t.ONE.shiftLeft(y),n,v),v.dAddOffset(31-v.mod(r).byteValue(),0),v}function c(f){return f<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2}})()});var _r=F((Dh,as)=>{var M=$();lt();br();Rt();Za();tn();tt();re();typeof ee>"u"&&(ee=M.jsbn.BigInteger);var ee,rn=M.util.isNodejs?require("crypto"):null,T=M.asn1,at=M.util;M.pki=M.pki||{};as.exports=M.pki.rsa=M.rsa=M.rsa||{};var G=M.pki,tc=[6,4,2,4,2,4,6,2],rc={name:"PrivateKeyInfo",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:T.Class.UNIVERSAL,type:T.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},ac={name:"RSAPrivateKey",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},nc={name:"RSAPublicKey",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:T.Class.UNIVERSAL,type:T.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},ic=M.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:T.Class.UNIVERSAL,type:T.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},sc={name:"DigestInfo",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:T.Class.UNIVERSAL,type:T.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:T.Class.UNIVERSAL,type:T.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:T.Class.UNIVERSAL,type:T.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:T.Class.UNIVERSAL,type:T.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},oc=function(e){var t;if(e.algorithm in G.oids)t=G.oids[e.algorithm];else{var a=new Error("Unknown message digest algorithm.");throw a.algorithm=e.algorithm,a}var r=T.oidToDer(t).getBytes(),n=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]),s=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[]);s.value.push(T.create(T.Class.UNIVERSAL,T.Type.OID,!1,r)),s.value.push(T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,""));var i=T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(s),n.value.push(i),T.toDer(n).getBytes()},ts=function(e,t,a){if(a)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(ee.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(ee.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new ee(M.util.bytesToHex(M.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(ee.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var n=e.mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);n.compareTo(s)<0;)n=n.add(t.p);var i=n.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return i=i.multiply(r.modInverse(t.n)).mod(t.n),i};G.rsa.encrypt=function(e,t,a){var r=a,n,s=Math.ceil(t.n.bitLength()/8);a!==!1&&a!==!0?(r=a===2,n=rs(e,t,a)):(n=M.util.createBuffer(),n.putBytes(e));for(var i=new ee(n.toHex(),16),o=ts(i,t,r),u=o.toString(16),l=M.util.createBuffer(),c=s-Math.ceil(u.length/2);c>0;)l.putByte(0),--c;return l.putBytes(M.util.hexToBytes(u)),l.getBytes()};G.rsa.decrypt=function(e,t,a,r){var n=Math.ceil(t.n.bitLength()/8);if(e.length!==n){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=n,s}var i=new ee(M.util.createBuffer(e).toHex(),16);if(i.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=ts(i,t,a),u=o.toString(16),l=M.util.createBuffer(),c=n-Math.ceil(u.length/2);c>0;)l.putByte(0),--c;return l.putBytes(M.util.hexToBytes(u)),r!==!1?na(l.getBytes(),t,a):l.getBytes()};G.rsa.createKeyPairGenerationState=function(e,t,a){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,a=a||{};var r=a.prng||M.random,n={nextBytes:function(o){for(var u=r.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=u.charCodeAt(l)}},s=a.algorithm||"PRIMEINC",i;if(s==="PRIMEINC")i={algorithm:s,state:0,bits:e,rng:n,eInt:t||65537,e:new ee(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},i.e.fromInt(i.eInt);else throw new Error("Invalid key generation algorithm: "+s);return i};G.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var a=new ee(null);a.fromInt(30);for(var r=0,n=function(f,g){return f|g},s=+new Date,i,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var u=e.p===null?e.pBits:e.qBits,l=u-1;e.pqState===0?(e.num=new ee(u,e.rng),e.num.testBit(l)||e.num.bitwiseTo(ee.ONE.shiftLeft(l),n,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>u?e.pqState=0:e.num.isProbablePrime(lc(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(tc[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(ee.ONE).gcd(e.e).compareTo(ee.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(ee.ONE),e.q1=e.q.subtract(ee.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(ee.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var c=e.e.modInverse(e.phi);e.keys={privateKey:G.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:G.rsa.setPublicKey(e.n,e.e)}}i=+new Date,o+=i-s,s=i}return e.keys!==null};G.rsa.generateKeyPair=function(e,t,a,r){if(arguments.length===1?typeof e=="object"?(a=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(a=t,t=void 0):(a=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof a=="function"&&(r=a,a=void 0):(r=a,a=t,t=void 0)),a=a||{},e===void 0&&(e=a.bits||2048),t===void 0&&(t=a.e||65537),!M.options.usePureJavaScript&&!a.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(Xi("generateKeyPair"))return rn.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,u,l){if(o)return r(o);r(null,{privateKey:G.privateKeyFromPem(l),publicKey:G.publicKeyFromPem(u)})});if(Ji("generateKey")&&Ji("exportKey"))return at.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:es(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return at.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){r(o)}).then(function(o){if(o){var u=G.privateKeyFromAsn1(T.fromDer(M.util.createBuffer(o)));r(null,{privateKey:u,publicKey:G.setRsaPublicKey(u.n,u.e)})}});if(Zi("generateKey")&&Zi("exportKey")){var n=at.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:es(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);n.oncomplete=function(o){var u=o.target.result,l=at.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);l.oncomplete=function(c){var f=c.target.result,g=G.privateKeyFromAsn1(T.fromDer(M.util.createBuffer(f)));r(null,{privateKey:g,publicKey:G.setRsaPublicKey(g.n,g.e)})},l.onerror=function(c){r(c)}},n.onerror=function(o){r(o)};return}}else if(Xi("generateKeyPairSync")){var s=rn.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:G.privateKeyFromPem(s.privateKey),publicKey:G.publicKeyFromPem(s.publicKey)}}}var i=G.rsa.createKeyPairGenerationState(e,t,a);if(!r)return G.rsa.stepKeyPairGenerationState(i,0),i.keys;uc(i,a,r)};G.setRsaPublicKey=G.rsa.setPublicKey=function(e,t){var a={n:e,e:t};return a.encrypt=function(r,n,s){if(typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSAES-PKCS1-V1_5"),n==="RSAES-PKCS1-V1_5")n={encode:function(o,u,l){return rs(o,u,2).getBytes()}};else if(n==="RSA-OAEP"||n==="RSAES-OAEP")n={encode:function(o,u){return M.pkcs1.encode_rsa_oaep(u,o,s)}};else if(["RAW","NONE","NULL",null].indexOf(n)!==-1)n={encode:function(o){return o}};else if(typeof n=="string")throw new Error('Unsupported encryption scheme: "'+n+'".');var i=n.encode(r,a,!0);return G.rsa.encrypt(i,a,!0)},a.verify=function(r,n,s,i){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),i===void 0&&(i={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in i||(i._parseAllDigestBytes=!0),"_skipPaddingChecks"in i||(i._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:function(u,l){l=na(l,a,!0,void 0,i);var c=T.fromDer(l,{parseAllBytes:i._parseAllDigestBytes}),f={},g=[];if(!T.validate(c,sc,f,g)||c.value.length!==2){var v=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw v.errors=g,v}var y=T.derToOid(f.algorithmIdentifier);if(!(y===M.oids.md2||y===M.oids.md5||y===M.oids.sha1||y===M.oids.sha224||y===M.oids.sha256||y===M.oids.sha384||y===M.oids.sha512||y===M.oids["sha512-224"]||y===M.oids["sha512-256"])){var v=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw v.oid=y,v}if((y===M.oids.md2||y===M.oids.md5)&&!("parameters"in f))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===f.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(u,l){return l=na(l,a,!0,void 0,i),u===l}});var o=G.rsa.decrypt(n,a,!0,!1);return s.verify(r,o,a.n.bitLength())},a};G.setRsaPrivateKey=G.rsa.setPrivateKey=function(e,t,a,r,n,s,i,o){var u={n:e,e:t,d:a,p:r,q:n,dP:s,dQ:i,qInv:o};return u.decrypt=function(l,c,f){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var g=G.rsa.decrypt(l,u,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:na};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(v,y){return M.pkcs1.decode_rsa_oaep(y,v,f)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(v){return v}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(g,u,!1)},u.sign=function(l,c){var f=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:oc},f=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return l}},f=1);var g=c.encode(l,u.n.bitLength());return G.rsa.encrypt(g,u,f)},u};G.wrapRsaPrivateKey=function(e){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(0).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(G.oids.rsaEncryption).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")]),T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,T.toDer(e).getBytes())])};G.privateKeyFromAsn1=function(e){var t={},a=[];if(T.validate(e,rc,t,a)&&(e=T.fromDer(M.util.createBuffer(t.privateKey))),t={},a=[],!T.validate(e,ac,t,a)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=a,r}var n,s,i,o,u,l,c,f;return n=M.util.createBuffer(t.privateKeyModulus).toHex(),s=M.util.createBuffer(t.privateKeyPublicExponent).toHex(),i=M.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=M.util.createBuffer(t.privateKeyPrime1).toHex(),u=M.util.createBuffer(t.privateKeyPrime2).toHex(),l=M.util.createBuffer(t.privateKeyExponent1).toHex(),c=M.util.createBuffer(t.privateKeyExponent2).toHex(),f=M.util.createBuffer(t.privateKeyCoefficient).toHex(),G.setRsaPrivateKey(new ee(n,16),new ee(s,16),new ee(i,16),new ee(o,16),new ee(u,16),new ee(l,16),new ee(c,16),new ee(f,16))};G.privateKeyToAsn1=G.privateKeyToRSAPrivateKey=function(e){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(0).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.n)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.e)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.d)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.p)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.q)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.dP)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.dQ)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.qInv))])};G.publicKeyFromAsn1=function(e){var t={},a=[];if(T.validate(e,ic,t,a)){var r=T.derToOid(t.publicKeyOid);if(r!==G.oids.rsaEncryption){var n=new Error("Cannot read public key. Unknown OID.");throw n.oid=r,n}e=t.rsaPublicKey}if(a=[],!T.validate(e,nc,t,a)){var n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw n.errors=a,n}var s=M.util.createBuffer(t.publicKeyModulus).toHex(),i=M.util.createBuffer(t.publicKeyExponent).toHex();return G.setRsaPublicKey(new ee(s,16),new ee(i,16))};G.publicKeyToAsn1=G.publicKeyToSubjectPublicKeyInfo=function(e){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(G.oids.rsaEncryption).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")]),T.create(T.Class.UNIVERSAL,T.Type.BITSTRING,!1,[G.publicKeyToRSAPublicKey(e)])])};G.publicKeyToRSAPublicKey=function(e){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.n)),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,Ct(e.e))])};function rs(e,t,a){var r=M.util.createBuffer(),n=Math.ceil(t.n.bitLength()/8);if(e.length>n-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=n-11,s}r.putByte(0),r.putByte(a);var i=n-3-e.length,o;if(a===0||a===1){o=a===0?0:255;for(var u=0;u<i;++u)r.putByte(o)}else for(;i>0;){for(var l=0,c=M.random.getBytes(i),u=0;u<i;++u)o=c.charCodeAt(u),o===0?++l:r.putByte(o);i=l}return r.putByte(0),r.putBytes(e),r}function na(e,t,a,r,n){var s=Math.ceil(t.n.bitLength()/8),i=M.util.createBuffer(e),o=i.getByte(),u=i.getByte();if(o!==0||a&&u!==0&&u!==1||!a&&u!==2||a&&u===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(u===0){l=s-3-r;for(var c=0;c<l;++c)if(i.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(u===1){for(l=0;i.length()>1;){if(i.getByte()!==255){--i.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(l=0;i.length()>1;){if(i.getByte()===0){--i.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var f=i.getByte();if(f!==0||l!==s-3-i.length())throw new Error("Encryption block is invalid.");return i.getBytes()}function uc(e,t,a){typeof t=="function"&&(a=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),n();function n(){s(e.pBits,function(o,u){if(o)return a(o);if(e.p=u,e.q!==null)return i(o,e.q);s(e.qBits,i)})}function s(o,u){M.prime.generateProbablePrime(o,r,u)}function i(o,u){if(o)return a(o);if(e.q=u,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l}if(e.p.subtract(ee.ONE).gcd(e.e).compareTo(ee.ONE)!==0){e.p=null,n();return}if(e.q.subtract(ee.ONE).gcd(e.e).compareTo(ee.ONE)!==0){e.q=null,s(e.qBits,i);return}if(e.p1=e.p.subtract(ee.ONE),e.q1=e.q.subtract(ee.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(ee.ONE)!==0){e.p=e.q=null,n();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,s(e.qBits,i);return}var c=e.e.modInverse(e.phi);e.keys={privateKey:G.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:G.rsa.setPublicKey(e.n,e.e)},a(null,e.keys)}}function Ct(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var a=M.util.hexToBytes(t);return a.length>1&&(a.charCodeAt(0)===0&&(a.charCodeAt(1)&128)===0||a.charCodeAt(0)===255&&(a.charCodeAt(1)&128)===128)?a.substr(1):a}function lc(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function Xi(e){return M.util.isNodejs&&typeof rn[e]=="function"}function Ji(e){return typeof at.globalScope<"u"&&typeof at.globalScope.crypto=="object"&&typeof at.globalScope.crypto.subtle=="object"&&typeof at.globalScope.crypto.subtle[e]=="function"}function Zi(e){return typeof at.globalScope<"u"&&typeof at.globalScope.msCrypto=="object"&&typeof at.globalScope.msCrypto.subtle=="object"&&typeof at.globalScope.msCrypto.subtle[e]=="function"}function es(e){for(var t=M.util.hexToBytes(e.toString(16)),a=new Uint8Array(t.length),r=0;r<t.length;++r)a[r]=t.charCodeAt(r);return a}});var an=F((Uh,us)=>{var V=$();wt();lt();Ir();dt();Rt();Zr();Qt();tt();Ya();_r();re();typeof ns>"u"&&(ns=V.jsbn.BigInteger);var ns,I=V.asn1,Q=V.pki=V.pki||{};us.exports=Q.pbe=V.pbe=V.pbe||{};var jt=Q.oids,cc={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},fc={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},dc={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};Q.encryptPrivateKeyInfo=function(e,t,a){a=a||{},a.saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||"aes128",a.prfAlgorithm=a.prfAlgorithm||"sha1";var r=V.random.getBytesSync(a.saltSize),n=a.count,s=I.integerToDer(n),i,o,u;if(a.algorithm.indexOf("aes")===0||a.algorithm==="des"){var l,c,f;switch(a.algorithm){case"aes128":i=16,l=16,c=jt["aes128-CBC"],f=V.aes.createEncryptionCipher;break;case"aes192":i=24,l=16,c=jt["aes192-CBC"],f=V.aes.createEncryptionCipher;break;case"aes256":i=32,l=16,c=jt["aes256-CBC"],f=V.aes.createEncryptionCipher;break;case"des":i=8,l=8,c=jt.desCBC,f=V.des.createEncryptionCipher;break;default:var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=a.algorithm,g}var v="hmacWith"+a.prfAlgorithm.toUpperCase(),y=os(v),x=V.pkcs5.pbkdf2(t,r,n,i,y),S=V.random.getBytesSync(l),A=f(x);A.start(S),A.update(I.toDer(e)),A.finish(),u=A.output.getBytes();var B=hc(r,s,i,v);o=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(jt.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(jt.pkcs5PBKDF2).getBytes()),B]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(c).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,S)])])])}else if(a.algorithm==="3des"){i=24;var b=new V.util.ByteBuffer(r),x=Q.pbe.generatePkcs12Key(t,b,1,n,i),S=Q.pbe.generatePkcs12Key(t,b,2,n,i),A=V.des.createEncryptionCipher(x);A.start(S),A.update(I.toDer(e)),A.finish(),u=A.output.getBytes(),o=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(jt["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,r),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=a.algorithm,g}var O=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[o,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,u)]);return O};Q.decryptPrivateKeyInfo=function(e,t){var a=null,r={},n=[];if(!I.validate(e,cc,r,n)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}var i=I.derToOid(r.encryptionOid),o=Q.pbe.getCipher(i,r.encryptionParams,t),u=V.util.createBuffer(r.encryptedData);return o.update(u),o.finish()&&(a=I.fromDer(o.output)),a};Q.encryptedPrivateKeyToPem=function(e,t){var a={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(e).getBytes()};return V.pem.encode(a,{maxline:t})};Q.encryptedPrivateKeyFromPem=function(e){var t=V.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var a=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(t.body)};Q.encryptRsaPrivateKey=function(e,t,a){if(a=a||{},!a.legacy){var r=Q.wrapRsaPrivateKey(Q.privateKeyToAsn1(e));return r=Q.encryptPrivateKeyInfo(r,t,a),Q.encryptedPrivateKeyToPem(r)}var n,s,i,o;switch(a.algorithm){case"aes128":n="AES-128-CBC",i=16,s=V.random.getBytesSync(16),o=V.aes.createEncryptionCipher;break;case"aes192":n="AES-192-CBC",i=24,s=V.random.getBytesSync(16),o=V.aes.createEncryptionCipher;break;case"aes256":n="AES-256-CBC",i=32,s=V.random.getBytesSync(16),o=V.aes.createEncryptionCipher;break;case"3des":n="DES-EDE3-CBC",i=24,s=V.random.getBytesSync(8),o=V.des.createEncryptionCipher;break;case"des":n="DES-CBC",i=8,s=V.random.getBytesSync(8),o=V.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+a.algorithm+'".');throw u.algorithm=a.algorithm,u}var l=V.pbe.opensslDeriveBytes(t,s.substr(0,8),i),c=o(l);c.start(s),c.update(I.toDer(Q.privateKeyToAsn1(e))),c.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:n,parameters:V.util.bytesToHex(s).toUpperCase()},body:c.output.getBytes()};return V.pem.encode(f)};Q.decryptRsaPrivateKey=function(e,t){var a=null,r=V.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw n.headerType=n,n}if(r.procType&&r.procType.type==="ENCRYPTED"){var s,i;switch(r.dekInfo.algorithm){case"DES-CBC":s=8,i=V.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,i=V.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,i=V.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,i=V.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,i=V.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,i=function(f){return V.rc2.createDecryptionCipher(f,40)};break;case"RC2-64-CBC":s=8,i=function(f){return V.rc2.createDecryptionCipher(f,64)};break;case"RC2-128-CBC":s=16,i=function(f){return V.rc2.createDecryptionCipher(f,128)};break;default:var n=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw n.algorithm=r.dekInfo.algorithm,n}var o=V.util.hexToBytes(r.dekInfo.parameters),u=V.pbe.opensslDeriveBytes(t,o.substr(0,8),s),l=i(u);if(l.start(o),l.update(V.util.createBuffer(r.body)),l.finish())a=l.output.getBytes();else return a}else a=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?a=Q.decryptPrivateKeyInfo(I.fromDer(a),t):a=I.fromDer(a),a!==null&&(a=Q.privateKeyFromAsn1(a)),a};Q.pbe.generatePkcs12Key=function(e,t,a,r,n,s){var i,o;if(typeof s>"u"||s===null){if(!("sha1"in V.md))throw new Error('"sha1" hash algorithm unavailable.');s=V.md.sha1.create()}var u=s.digestLength,l=s.blockLength,c=new V.util.ByteBuffer,f=new V.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)f.putInt16(e.charCodeAt(o));f.putInt16(0)}var g=f.length(),v=t.length(),y=new V.util.ByteBuffer;y.fillWithByte(a,l);var x=l*Math.ceil(v/l),S=new V.util.ByteBuffer;for(o=0;o<x;o++)S.putByte(t.at(o%v));var A=l*Math.ceil(g/l),B=new V.util.ByteBuffer;for(o=0;o<A;o++)B.putByte(f.at(o%g));var b=S;b.putBuffer(B);for(var O=Math.ceil(n/u),k=1;k<=O;k++){var R=new V.util.ByteBuffer;R.putBytes(y.bytes()),R.putBytes(b.bytes());for(var z=0;z<r;z++)s.start(),s.update(R.getBytes()),R=s.digest();var Y=new V.util.ByteBuffer;for(o=0;o<l;o++)Y.putByte(R.at(o%u));var ne=Math.ceil(v/l)+Math.ceil(g/l),ie=new V.util.ByteBuffer;for(i=0;i<ne;i++){var ue=new V.util.ByteBuffer(b.getBytes(l)),fe=511;for(o=Y.length()-1;o>=0;o--)fe=fe>>8,fe+=Y.at(o)+ue.at(o),ue.setAt(o,fe&255);ie.putBuffer(ue)}b=ie,c.putBuffer(R)}return c.truncate(c.length()-n),c};Q.pbe.getCipher=function(e,t,a){switch(e){case Q.oids.pkcs5PBES2:return Q.pbe.getCipherForPBES2(e,t,a);case Q.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case Q.oids["pbewithSHAAnd40BitRC2-CBC"]:return Q.pbe.getCipherForPKCS12PBE(e,t,a);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};Q.pbe.getCipherForPBES2=function(e,t,a){var r={},n=[];if(!I.validate(t,fc,r,n)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}if(e=I.derToOid(r.kdfOid),e!==Q.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=e,s.supportedOids=["pkcs5PBKDF2"],s}if(e=I.derToOid(r.encOid),e!==Q.oids["aes128-CBC"]&&e!==Q.oids["aes192-CBC"]&&e!==Q.oids["aes256-CBC"]&&e!==Q.oids["des-EDE3-CBC"]&&e!==Q.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=e,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var i=r.kdfSalt,o=V.util.createBuffer(r.kdfIterationCount);o=o.getInt(o.length()<<3);var u,l;switch(Q.oids[e]){case"aes128-CBC":u=16,l=V.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,l=V.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,l=V.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,l=V.des.createDecryptionCipher;break;case"desCBC":u=8,l=V.des.createDecryptionCipher;break}var c=ss(r.prfOid),f=V.pkcs5.pbkdf2(a,i,o,u,c),g=r.encIv,v=l(f);return v.start(g),v};Q.pbe.getCipherForPKCS12PBE=function(e,t,a){var r={},n=[];if(!I.validate(t,dc,r,n)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}var i=V.util.createBuffer(r.salt),o=V.util.createBuffer(r.iterations);o=o.getInt(o.length()<<3);var u,l,c;switch(e){case Q.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,c=V.des.startDecrypting;break;case Q.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,c=function(x,S){var A=V.rc2.createDecryptionCipher(x,40);return A.start(S,null),A};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=e,s}var f=ss(r.prfOid),g=Q.pbe.generatePkcs12Key(a,i,1,o,u,f);f.start();var v=Q.pbe.generatePkcs12Key(a,i,2,o,l,f);return c(g,v)};Q.pbe.opensslDeriveBytes=function(e,t,a,r){if(typeof r>"u"||r===null){if(!("md5"in V.md))throw new Error('"md5" hash algorithm unavailable.');r=V.md.md5.create()}t===null&&(t="");for(var n=[is(r,e+t)],s=16,i=1;s<a;++i,s+=16)n.push(is(r,n[i-1]+e+t));return n.join("").substr(0,a)};function is(e,t){return e.start().update(t).digest().getBytes()}function ss(e){var t;if(!e)t="hmacWithSHA1";else if(t=Q.oids[I.derToOid(e)],!t){var a=new Error("Unsupported PRF OID.");throw a.oid=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}return os(t)}function os(e){var t=V.md;switch(e){case"hmacWithSHA224":t=V.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var a=new Error("Unsupported PRF algorithm.");throw a.algorithm=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function hc(e,t,a,r){var n=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,e),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&n.value.push(I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,V.util.hexToBytes(a.toString(16))),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(Q.oids[r]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.NULL,!1,"")])),n}});var nn=F((Ph,fs)=>{var fr=$();lt();re();var P=fr.asn1,dr=fs.exports=fr.pkcs7asn1=fr.pkcs7asn1||{};fr.pkcs7=fr.pkcs7||{};fr.pkcs7.asn1=dr;var ls={name:"ContentInfo",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:P.Class.UNIVERSAL,type:P.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:P.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};dr.contentInfoValidator=ls;var cs={name:"EncryptedContentInfo",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:P.Class.UNIVERSAL,type:P.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:P.Class.UNIVERSAL,type:P.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:P.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:P.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};dr.envelopedDataValidator={name:"EnvelopedData",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:P.Class.UNIVERSAL,type:P.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:P.Class.UNIVERSAL,type:P.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(cs)};dr.encryptedDataValidator={name:"EncryptedData",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:P.Class.UNIVERSAL,type:P.Type.INTEGER,constructed:!1,capture:"version"}].concat(cs)};var pc={name:"SignerInfo",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:P.Class.UNIVERSAL,type:P.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:P.Class.UNIVERSAL,type:P.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:P.Class.UNIVERSAL,type:P.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:P.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:P.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:P.Class.UNIVERSAL,type:P.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:P.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};dr.signedDataValidator={name:"SignedData",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:P.Class.UNIVERSAL,type:P.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:P.Class.UNIVERSAL,type:P.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},ls,{name:"SignedData.Certificates",tagClass:P.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:P.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:P.Class.UNIVERSAL,type:P.Type.SET,capture:"signerInfos",optional:!0,value:[pc]}]};dr.recipientInfoValidator={name:"RecipientInfo",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:P.Class.UNIVERSAL,type:P.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:P.Class.UNIVERSAL,type:P.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:P.Class.UNIVERSAL,type:P.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:P.Class.UNIVERSAL,type:P.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:P.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:P.Class.UNIVERSAL,type:P.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var sn=F((Oh,ds)=>{var Wt=$();re();Wt.mgf=Wt.mgf||{};var gc=ds.exports=Wt.mgf.mgf1=Wt.mgf1=Wt.mgf1||{};gc.create=function(e){var t={generate:function(a,r){for(var n=new Wt.util.ByteBuffer,s=Math.ceil(r/e.digestLength),i=0;i<s;i++){var o=new Wt.util.ByteBuffer;o.putInt32(i),e.start(),e.update(a+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}};return t}});var ps=F((Vh,hs)=>{var ia=$();sn();hs.exports=ia.mgf=ia.mgf||{};ia.mgf.mgf1=ia.mgf1});var sa=F((Fh,gs)=>{var Xt=$();tt();re();var yc=gs.exports=Xt.pss=Xt.pss||{};yc.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,a=e.mgf,r=t.digestLength,n=e.salt||null;typeof n=="string"&&(n=Xt.util.createBuffer(n));var s;if("saltLength"in e)s=e.saltLength;else if(n!==null)s=n.length();else throw new Error("Salt length not specified or specific salt not given.");if(n!==null&&n.length()!==s)throw new Error("Given salt length does not match length of given salt.");var i=e.prng||Xt.random,o={};return o.encode=function(u,l){var c,f=l-1,g=Math.ceil(f/8),v=u.digest().getBytes();if(g<r+s+2)throw new Error("Message is too long to encrypt.");var y;n===null?y=i.getBytesSync(s):y=n.bytes();var x=new Xt.util.ByteBuffer;x.fillWithByte(0,8),x.putBytes(v),x.putBytes(y),t.start(),t.update(x.getBytes());var S=t.digest().getBytes(),A=new Xt.util.ByteBuffer;A.fillWithByte(0,g-s-r-2),A.putByte(1),A.putBytes(y);var B=A.getBytes(),b=g-r-1,O=a.generate(S,b),k="";for(c=0;c<b;c++)k+=String.fromCharCode(B.charCodeAt(c)^O.charCodeAt(c));var R=65280>>8*g-f&255;return k=String.fromCharCode(k.charCodeAt(0)&~R)+k.substr(1),k+S+"\xBC"},o.verify=function(u,l,c){var f,g=c-1,v=Math.ceil(g/8);if(l=l.substr(-v),v<r+s+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(v-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var y=v-r-1,x=l.substr(0,y),S=l.substr(y,r),A=65280>>8*v-g&255;if((x.charCodeAt(0)&A)!==0)throw new Error("Bits beyond keysize not zero as expected.");var B=a.generate(S,y),b="";for(f=0;f<y;f++)b+=String.fromCharCode(x.charCodeAt(f)^B.charCodeAt(f));b=String.fromCharCode(b.charCodeAt(0)&~A)+b.substr(1);var O=v-r-s-2;for(f=0;f<O;f++)if(b.charCodeAt(f)!==0)throw new Error("Leftmost octets not zero as expected");if(b.charCodeAt(O)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var k=b.substr(-s),R=new Xt.util.ByteBuffer;R.fillWithByte(0,8),R.putBytes(u),R.putBytes(k),t.start(),t.update(R.getBytes());var z=t.digest().getBytes();return S===z},o}});var la=F((Kh,Es)=>{var q=$();wt();lt();Ir();dt();ps();Rt();Qt();sa();_r();re();var d=q.asn1,L=Es.exports=q.pki=q.pki||{},te=L.oids,ge={};ge.CN=te.commonName;ge.commonName="CN";ge.C=te.countryName;ge.countryName="C";ge.L=te.localityName;ge.localityName="L";ge.ST=te.stateOrProvinceName;ge.stateOrProvinceName="ST";ge.O=te.organizationName;ge.organizationName="O";ge.OU=te.organizationalUnitName;ge.organizationalUnitName="OU";ge.E=te.emailAddress;ge.emailAddress="E";var vs=q.pki.rsa.publicKeyValidator,vc={name:"Certificate",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:d.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:d.Class.UNIVERSAL,type:d.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:d.Class.UNIVERSAL,type:d.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:d.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:d.Class.UNIVERSAL,type:d.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:d.Class.UNIVERSAL,type:d.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:d.Class.UNIVERSAL,type:d.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:d.Class.UNIVERSAL,type:d.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},vs,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:d.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:d.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:d.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:d.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},mc={name:"rsapss",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:d.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:d.Class.UNIVERSAL,type:d.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:d.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:d.Class.UNIVERSAL,type:d.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:d.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:d.Class.UNIVERSAL,type:d.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:d.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:d.Class.UNIVERSAL,type:d.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},Cc={name:"CertificationRequestInfo",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:d.Class.UNIVERSAL,type:d.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},vs,{name:"CertificationRequestInfo.attributes",tagClass:d.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:d.Class.UNIVERSAL,type:d.Type.SET,constructed:!0}]}]}]},Ec={name:"CertificationRequest",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[Cc,{name:"CertificationRequest.signatureAlgorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:d.Class.UNIVERSAL,type:d.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:d.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:d.Class.UNIVERSAL,type:d.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};L.RDNAttributesAsArray=function(e,t){for(var a=[],r,n,s,i=0;i<e.value.length;++i){r=e.value[i];for(var o=0;o<r.value.length;++o)s={},n=r.value[o],s.type=d.derToOid(n.value[0].value),s.value=n.value[1].value,s.valueTagClass=n.value[1].type,s.type in te&&(s.name=te[s.type],s.name in ge&&(s.shortName=ge[s.name])),t&&(t.update(s.type),t.update(s.value)),a.push(s)}return a};L.CRIAttributesAsArray=function(e){for(var t=[],a=0;a<e.length;++a)for(var r=e[a],n=d.derToOid(r.value[0].value),s=r.value[1].value,i=0;i<s.length;++i){var o={};if(o.type=n,o.value=s[i].value,o.valueTagClass=s[i].type,o.type in te&&(o.name=te[o.type],o.name in ge&&(o.shortName=ge[o.name])),o.type===te.extensionRequest){o.extensions=[];for(var u=0;u<o.value.length;++u)o.extensions.push(L.certificateExtensionFromAsn1(o.value[u]))}t.push(o)}return t};function Dt(e,t){typeof t=="string"&&(t={shortName:t});for(var a=null,r,n=0;a===null&&n<e.attributes.length;++n)r=e.attributes[n],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(a=r);return a}var oa=function(e,t,a){var r={};if(e!==te["RSASSA-PSS"])return r;a&&(r={hash:{algorithmOid:te.sha1},mgf:{algorithmOid:te.mgf1,hash:{algorithmOid:te.sha1}},saltLength:20});var n={},s=[];if(!d.validate(t,mc,n,s)){var i=new Error("Cannot read RSASSA-PSS parameter block.");throw i.errors=s,i}return n.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=d.derToOid(n.hashOid)),n.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=d.derToOid(n.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=d.derToOid(n.maskGenHashOid)),n.saltLength!==void 0&&(r.saltLength=n.saltLength.charCodeAt(0)),r},ua=function(e){switch(te[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return q.md.sha1.create();case"md5WithRSAEncryption":return q.md.md5.create();case"sha256WithRSAEncryption":return q.md.sha256.create();case"sha384WithRSAEncryption":return q.md.sha384.create();case"sha512WithRSAEncryption":return q.md.sha512.create();case"RSASSA-PSS":return q.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},ms=function(e){var t=e.certificate,a;switch(t.signatureOid){case te.sha1WithRSAEncryption:case te.sha1WithRSASignature:break;case te["RSASSA-PSS"]:var r,n;if(r=te[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||q.md[r]===void 0){var s=new Error("Unsupported MGF hash function.");throw s.oid=t.signatureParameters.mgf.hash.algorithmOid,s.name=r,s}if(n=te[t.signatureParameters.mgf.algorithmOid],n===void 0||q.mgf[n]===void 0){var s=new Error("Unsupported MGF function.");throw s.oid=t.signatureParameters.mgf.algorithmOid,s.name=n,s}if(n=q.mgf[n].create(q.md[r].create()),r=te[t.signatureParameters.hash.algorithmOid],r===void 0||q.md[r]===void 0){var s=new Error("Unsupported RSASSA-PSS hash function.");throw s.oid=t.signatureParameters.hash.algorithmOid,s.name=r,s}a=q.pss.create(q.md[r].create(),n,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,a)};L.certificateFromPem=function(e,t,a){var r=q.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var n=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=d.fromDer(r.body,a);return L.certificateFromAsn1(s,t)};L.certificateToPem=function(e,t){var a={type:"CERTIFICATE",body:d.toDer(L.certificateToAsn1(e)).getBytes()};return q.pem.encode(a,{maxline:t})};L.publicKeyFromPem=function(e){var t=q.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var a=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=d.fromDer(t.body);return L.publicKeyFromAsn1(r)};L.publicKeyToPem=function(e,t){var a={type:"PUBLIC KEY",body:d.toDer(L.publicKeyToAsn1(e)).getBytes()};return q.pem.encode(a,{maxline:t})};L.publicKeyToRSAPublicKeyPem=function(e,t){var a={type:"RSA PUBLIC KEY",body:d.toDer(L.publicKeyToRSAPublicKey(e)).getBytes()};return q.pem.encode(a,{maxline:t})};L.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||q.md.sha1.create(),r=t.type||"RSAPublicKey",n;switch(r){case"RSAPublicKey":n=d.toDer(L.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":n=d.toDer(L.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}a.start(),a.update(n);var s=a.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};L.certificationRequestFromPem=function(e,t,a){var r=q.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var n=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=d.fromDer(r.body,a);return L.certificationRequestFromAsn1(s,t)};L.certificationRequestToPem=function(e,t){var a={type:"CERTIFICATE REQUEST",body:d.toDer(L.certificationRequestToAsn1(e)).getBytes()};return q.pem.encode(a,{maxline:t})};L.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return Dt(e.issuer,t)},e.issuer.addField=function(t){nt([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return Dt(e.subject,t)},e.subject.addField=function(t){nt([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,a){nt(t),e.subject.attributes=t,delete e.subject.uniqueId,a&&(e.subject.uniqueId=a),e.subject.hash=null},e.setIssuer=function(t,a){nt(t),e.issuer.attributes=t,delete e.issuer.uniqueId,a&&(e.issuer.uniqueId=a),e.issuer.hash=null},e.setExtensions=function(t){for(var a=0;a<t.length;++a)Cs(t[a],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var a=null,r,n=0;a===null&&n<e.extensions.length;++n)r=e.extensions[n],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(a=r);return a},e.sign=function(t,a){e.md=a||q.md.sha1.create();var r=te[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=L.getTBSCertificate(e);var s=d.toDer(e.tbsCertificate);e.md.update(s.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var a=!1;if(!e.issued(t)){var r=t.issuer,n=e.subject,s=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw s.expectedIssuer=n.attributes,s.actualIssuer=r.attributes,s}var i=t.md;if(i===null){i=ua({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||L.getTBSCertificate(t),u=d.toDer(o);i.update(u.getBytes())}return i!==null&&(a=ms({certificate:e,md:i,signature:t.signature})),a},e.isIssuer=function(t){var a=!1,r=e.issuer,n=t.subject;if(r.hash&&n.hash)a=r.hash===n.hash;else if(r.attributes.length===n.attributes.length){a=!0;for(var s,i,o=0;a&&o<r.attributes.length;++o)s=r.attributes[o],i=n.attributes[o],(s.type!==i.type||s.value!==i.value)&&(a=!1)}return a},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return L.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=te.subjectKeyIdentifier,a=0;a<e.extensions.length;++a){var r=e.extensions[a];if(r.id===t){var n=e.generateSubjectKeyIdentifier().getBytes();return q.util.hexToBytes(r.subjectKeyIdentifier)===n}}return!1},e};L.certificateFromAsn1=function(e,t){var a={},r=[];if(!d.validate(e,vc,a,r)){var n=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw n.errors=r,n}var s=d.derToOid(a.publicKeyOid);if(s!==L.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=L.createCertificate();i.version=a.certVersion?a.certVersion.charCodeAt(0):0;var o=q.util.createBuffer(a.certSerialNumber);i.serialNumber=o.toHex(),i.signatureOid=q.asn1.derToOid(a.certSignatureOid),i.signatureParameters=oa(i.signatureOid,a.certSignatureParams,!0),i.siginfo.algorithmOid=q.asn1.derToOid(a.certinfoSignatureOid),i.siginfo.parameters=oa(i.siginfo.algorithmOid,a.certinfoSignatureParams,!1),i.signature=a.certSignature;var u=[];if(a.certValidity1UTCTime!==void 0&&u.push(d.utcTimeToDate(a.certValidity1UTCTime)),a.certValidity2GeneralizedTime!==void 0&&u.push(d.generalizedTimeToDate(a.certValidity2GeneralizedTime)),a.certValidity3UTCTime!==void 0&&u.push(d.utcTimeToDate(a.certValidity3UTCTime)),a.certValidity4GeneralizedTime!==void 0&&u.push(d.generalizedTimeToDate(a.certValidity4GeneralizedTime)),u.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(i.validity.notBefore=u[0],i.validity.notAfter=u[1],i.tbsCertificate=a.tbsCertificate,t){i.md=ua({signatureOid:i.signatureOid,type:"certificate"});var l=d.toDer(i.tbsCertificate);i.md.update(l.getBytes())}var c=q.md.sha1.create(),f=d.toDer(a.certIssuer);c.update(f.getBytes()),i.issuer.getField=function(y){return Dt(i.issuer,y)},i.issuer.addField=function(y){nt([y]),i.issuer.attributes.push(y)},i.issuer.attributes=L.RDNAttributesAsArray(a.certIssuer),a.certIssuerUniqueId&&(i.issuer.uniqueId=a.certIssuerUniqueId),i.issuer.hash=c.digest().toHex();var g=q.md.sha1.create(),v=d.toDer(a.certSubject);return g.update(v.getBytes()),i.subject.getField=function(y){return Dt(i.subject,y)},i.subject.addField=function(y){nt([y]),i.subject.attributes.push(y)},i.subject.attributes=L.RDNAttributesAsArray(a.certSubject),a.certSubjectUniqueId&&(i.subject.uniqueId=a.certSubjectUniqueId),i.subject.hash=g.digest().toHex(),a.certExtensions?i.extensions=L.certificateExtensionsFromAsn1(a.certExtensions):i.extensions=[],i.publicKey=L.publicKeyFromAsn1(a.subjectPublicKeyInfo),i};L.certificateExtensionsFromAsn1=function(e){for(var t=[],a=0;a<e.value.length;++a)for(var r=e.value[a],n=0;n<r.value.length;++n)t.push(L.certificateExtensionFromAsn1(r.value[n]));return t};L.certificateExtensionFromAsn1=function(e){var t={};if(t.id=d.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===d.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in te){if(t.name=te[t.id],t.name==="keyUsage"){var a=d.fromDer(t.value),r=0,n=0;a.value.length>1&&(r=a.value.charCodeAt(1),n=a.value.length>2?a.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(n&128)===128}else if(t.name==="basicConstraints"){var a=d.fromDer(t.value);a.value.length>0&&a.value[0].type===d.Type.BOOLEAN?t.cA=a.value[0].value.charCodeAt(0)!==0:t.cA=!1;var s=null;a.value.length>0&&a.value[0].type===d.Type.INTEGER?s=a.value[0].value:a.value.length>1&&(s=a.value[1].value),s!==null&&(t.pathLenConstraint=d.derToInteger(s))}else if(t.name==="extKeyUsage")for(var a=d.fromDer(t.value),i=0;i<a.value.length;++i){var o=d.derToOid(a.value[i].value);o in te?t[te[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var a=d.fromDer(t.value),r=0;a.value.length>1&&(r=a.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var u,a=d.fromDer(t.value),l=0;l<a.value.length;++l){u=a.value[l];var c={type:u.type,value:u.value};switch(t.altNames.push(c),u.type){case 1:case 2:case 6:break;case 7:c.ip=q.util.bytesToIP(u.value);break;case 8:c.oid=d.derToOid(u.value);break;default:}}}else if(t.name==="subjectKeyIdentifier"){var a=d.fromDer(t.value);t.subjectKeyIdentifier=q.util.bytesToHex(a.value)}}return t};L.certificationRequestFromAsn1=function(e,t){var a={},r=[];if(!d.validate(e,Ec,a,r)){var n=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw n.errors=r,n}var s=d.derToOid(a.publicKeyOid);if(s!==L.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=L.createCertificationRequest();if(i.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,i.signatureOid=q.asn1.derToOid(a.csrSignatureOid),i.signatureParameters=oa(i.signatureOid,a.csrSignatureParams,!0),i.siginfo.algorithmOid=q.asn1.derToOid(a.csrSignatureOid),i.siginfo.parameters=oa(i.siginfo.algorithmOid,a.csrSignatureParams,!1),i.signature=a.csrSignature,i.certificationRequestInfo=a.certificationRequestInfo,t){i.md=ua({signatureOid:i.signatureOid,type:"certification request"});var o=d.toDer(i.certificationRequestInfo);i.md.update(o.getBytes())}var u=q.md.sha1.create();return i.subject.getField=function(l){return Dt(i.subject,l)},i.subject.addField=function(l){nt([l]),i.subject.attributes.push(l)},i.subject.attributes=L.RDNAttributesAsArray(a.certificationRequestInfoSubject,u),i.subject.hash=u.digest().toHex(),i.publicKey=L.publicKeyFromAsn1(a.subjectPublicKeyInfo),i.getAttribute=function(l){return Dt(i,l)},i.addAttribute=function(l){nt([l]),i.attributes.push(l)},i.attributes=L.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),i};L.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return Dt(e.subject,t)},e.subject.addField=function(t){nt([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return Dt(e,t)},e.addAttribute=function(t){nt([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){nt(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){nt(t),e.attributes=t},e.sign=function(t,a){e.md=a||q.md.sha1.create();var r=te[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=L.getCertificationRequestInfo(e);var s=d.toDer(e.certificationRequestInfo);e.md.update(s.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,a=e.md;if(a===null){a=ua({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||L.getCertificationRequestInfo(e),n=d.toDer(r);a.update(n.getBytes())}return a!==null&&(t=ms({certificate:e,md:a,signature:e.signature})),t},e};function hr(e){for(var t=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]),a,r,n=e.attributes,s=0;s<n.length;++s){a=n[s];var i=a.value,o=d.Type.PRINTABLESTRING;"valueTagClass"in a&&(o=a.valueTagClass,o===d.Type.UTF8&&(i=q.util.encodeUtf8(i))),r=d.create(d.Class.UNIVERSAL,d.Type.SET,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(a.type).getBytes()),d.create(d.Class.UNIVERSAL,o,!1,i)])]),t.value.push(r)}return t}function nt(e){for(var t,a=0;a<e.length;++a){if(t=e[a],typeof t.name>"u"&&(t.type&&t.type in L.oids?t.name=L.oids[t.type]:t.shortName&&t.shortName in ge&&(t.name=L.oids[ge[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in L.oids)t.type=L.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in ge&&(t.shortName=ge[t.name]),t.type===te.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=d.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(L.certificateExtensionToAsn1(Cs(t.extensions[n])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function Cs(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in L.oids&&(e.name=L.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in L.oids)e.id=L.oids[e.name];else{var a=new Error("Extension ID not specified.");throw a.extension=e,a}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,n=0,s=0;e.digitalSignature&&(n|=128,r=7),e.nonRepudiation&&(n|=64,r=6),e.keyEncipherment&&(n|=32,r=5),e.dataEncipherment&&(n|=16,r=4),e.keyAgreement&&(n|=8,r=3),e.keyCertSign&&(n|=4,r=2),e.cRLSign&&(n|=2,r=1),e.encipherOnly&&(n|=1,r=0),e.decipherOnly&&(s|=128,r=7);var i=String.fromCharCode(r);s!==0?i+=String.fromCharCode(n)+String.fromCharCode(s):n!==0&&(i+=String.fromCharCode(n)),e.value=d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,i)}else if(e.name==="basicConstraints")e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(d.create(d.Class.UNIVERSAL,d.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var u in e)e[u]===!0&&(u in te?o.push(d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(te[u]).getBytes())):u.indexOf(".")!==-1&&o.push(d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(u).getBytes())))}else if(e.name==="nsCertType"){var r=0,n=0;e.client&&(n|=128,r=7),e.server&&(n|=64,r=6),e.email&&(n|=32,r=5),e.objsign&&(n|=16,r=4),e.reserved&&(n|=8,r=3),e.sslCA&&(n|=4,r=2),e.emailCA&&(n|=2,r=1),e.objCA&&(n|=1,r=0);var i=String.fromCharCode(r);n!==0&&(i+=String.fromCharCode(n)),e.value=d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,i)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);for(var l,c=0;c<e.altNames.length;++c){l=e.altNames[c];var i=l.value;if(l.type===7&&l.ip){if(i=q.util.bytesFromIP(l.ip),i===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?i=d.oidToDer(d.oidToDer(l.oid)):i=d.oidToDer(i));e.value.value.push(d.create(d.Class.CONTEXT_SPECIFIC,l.type,!1,i))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=d.create(d.Class.UNIVERSAL,d.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var f=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=f.toHex(),e.value=d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,f.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var g=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!1,g))}if(e.authorityCertIssuer){var v=[d.create(d.Class.CONTEXT_SPECIFIC,4,!0,[hr(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(d.create(d.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var y=q.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(d.create(d.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if(e.name==="cRLDistributionPoints"){e.value=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);for(var o=e.value.value,x=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]),S=d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[]),l,c=0;c<e.altNames.length;++c){l=e.altNames[c];var i=l.value;if(l.type===7&&l.ip){if(i=q.util.bytesFromIP(l.ip),i===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?i=d.oidToDer(d.oidToDer(l.oid)):i=d.oidToDer(i));S.value.push(d.create(d.Class.CONTEXT_SPECIFIC,l.type,!1,i))}x.value.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[S])),o.push(x)}if(typeof e.value>"u"){var a=new Error("Extension value not specified.");throw a.extension=e,a}return e}function on(e,t){switch(e){case te["RSASSA-PSS"]:var a=[];return t.hash.algorithmOid!==void 0&&a.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(t.hash.algorithmOid).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&a.push(d.create(d.Class.CONTEXT_SPECIFIC,1,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(t.mgf.algorithmOid).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(t.mgf.hash.algorithmOid).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&a.push(d.create(d.Class.CONTEXT_SPECIFIC,2,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(t.saltLength).getBytes())])),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,a);default:return d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")}}function xc(e){var t=d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var a=e.attributes,r=0;r<a.length;++r){var n=a[r],s=n.value,i=d.Type.UTF8;"valueTagClass"in n&&(i=n.valueTagClass),i===d.Type.UTF8&&(s=q.util.encodeUtf8(s));var o=!1;"valueConstructed"in n&&(o=n.valueConstructed);var u=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(n.type).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SET,!0,[d.create(d.Class.UNIVERSAL,i,o,s)])]);t.value.push(u)}return t}var Sc=new Date("1950-01-01T00:00:00Z"),Tc=new Date("2050-01-01T00:00:00Z");function ys(e){return e>=Sc&&e<Tc?d.create(d.Class.UNIVERSAL,d.Type.UTCTIME,!1,d.dateToUtcTime(e)):d.create(d.Class.UNIVERSAL,d.Type.GENERALIZEDTIME,!1,d.dateToGeneralizedTime(e))}L.getTBSCertificate=function(e){var t=ys(e.validity.notBefore),a=ys(e.validity.notAfter),r=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.version).getBytes())]),d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,q.util.hexToBytes(e.serialNumber)),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.siginfo.algorithmOid).getBytes()),on(e.siginfo.algorithmOid,e.siginfo.parameters)]),hr(e.issuer),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[t,a]),hr(e.subject),L.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(d.create(d.Class.CONTEXT_SPECIFIC,1,!0,[d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(d.create(d.Class.CONTEXT_SPECIFIC,2,!0,[d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(L.certificateExtensionsToAsn1(e.extensions)),r};L.getCertificationRequestInfo=function(e){var t=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.version).getBytes()),hr(e.subject),L.publicKeyToAsn1(e.publicKey),xc(e)]);return t};L.distinguishedNameToAsn1=function(e){return hr(e)};L.certificateToAsn1=function(e){var t=e.tbsCertificate||L.getTBSCertificate(e);return d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[t,d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.signatureOid).getBytes()),on(e.signatureOid,e.signatureParameters)]),d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.signature)])};L.certificateExtensionsToAsn1=function(e){var t=d.create(d.Class.CONTEXT_SPECIFIC,3,!0,[]),a=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);t.value.push(a);for(var r=0;r<e.length;++r)a.value.push(L.certificateExtensionToAsn1(e[r]));return t};L.certificateExtensionToAsn1=function(e){var t=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[]);t.value.push(d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.id).getBytes())),e.critical&&t.value.push(d.create(d.Class.UNIVERSAL,d.Type.BOOLEAN,!1,"\xFF"));var a=e.value;return typeof e.value!="string"&&(a=d.toDer(a).getBytes()),t.value.push(d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,a)),t};L.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||L.getCertificationRequestInfo(e);return d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[t,d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.signatureOid).getBytes()),on(e.signatureOid,e.signatureParameters)]),d.create(d.Class.UNIVERSAL,d.Type.BITSTRING,!1,"\0"+e.signature)])};L.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(i){var o=a(i.issuer);return o},t.addCertificate=function(i){if(typeof i=="string"&&(i=q.pki.certificateFromPem(i)),r(i.subject),!t.hasCertificate(i))if(i.subject.hash in t.certs){var o=t.certs[i.subject.hash];q.util.isArray(o)||(o=[o]),o.push(i),t.certs[i.subject.hash]=o}else t.certs[i.subject.hash]=i},t.hasCertificate=function(i){typeof i=="string"&&(i=q.pki.certificateFromPem(i));var o=a(i.subject);if(!o)return!1;q.util.isArray(o)||(o=[o]);for(var u=d.toDer(L.certificateToAsn1(i)).getBytes(),l=0;l<o.length;++l){var c=d.toDer(L.certificateToAsn1(o[l])).getBytes();if(u===c)return!0}return!1},t.listAllCertificates=function(){var i=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var u=t.certs[o];if(!q.util.isArray(u))i.push(u);else for(var l=0;l<u.length;++l)i.push(u[l])}return i},t.removeCertificate=function(i){var o;if(typeof i=="string"&&(i=q.pki.certificateFromPem(i)),r(i.subject),!t.hasCertificate(i))return null;var u=a(i.subject);if(!q.util.isArray(u))return o=t.certs[i.subject.hash],delete t.certs[i.subject.hash],o;for(var l=d.toDer(L.certificateToAsn1(i)).getBytes(),c=0;c<u.length;++c){var f=d.toDer(L.certificateToAsn1(u[c])).getBytes();l===f&&(o=u[c],u.splice(c,1))}return u.length===0&&delete t.certs[i.subject.hash],o};function a(i){return r(i),t.certs[i.hash]||null}function r(i){if(!i.hash){var o=q.md.sha1.create();i.attributes=L.RDNAttributesAsArray(hr(i),o),i.hash=o.digest().toHex()}}if(e)for(var n=0;n<e.length;++n){var s=e[n];t.addCertificate(s)}return t};L.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};L.verifyCertificateChain=function(e,t,a){typeof a=="function"&&(a={verify:a}),a=a||{},t=t.slice(0);var r=t.slice(0),n=a.validityCheckDate;typeof n>"u"&&(n=new Date);var s=!0,i=null,o=0;do{var u=t.shift(),l=null,c=!1;if(n&&(n<u.validity.notBefore||n>u.validity.notAfter)&&(i={message:"Certificate is not valid yet or has expired.",error:L.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:n}),i===null){if(l=t[0]||e.getIssuer(u),l===null&&u.isIssuer(u)&&(c=!0,l=u),l){var f=l;q.util.isArray(f)||(f=[f]);for(var g=!1;!g&&f.length>0;){l=f.shift();try{g=l.verify(u)}catch{}}g||(i={message:"Certificate signature is invalid.",error:L.certificateError.bad_certificate})}i===null&&(!l||c)&&!e.hasCertificate(u)&&(i={message:"Certificate is not trusted.",error:L.certificateError.unknown_ca})}if(i===null&&l&&!u.isIssuer(l)&&(i={message:"Certificate issuer is invalid.",error:L.certificateError.bad_certificate}),i===null)for(var v={keyUsage:!0,basicConstraints:!0},y=0;i===null&&y<u.extensions.length;++y){var x=u.extensions[y];x.critical&&!(x.name in v)&&(i={message:"Certificate has an unsupported critical extension.",error:L.certificateError.unsupported_certificate})}if(i===null&&(!s||t.length===0&&(!l||c))){var S=u.getExtension("basicConstraints"),A=u.getExtension("keyUsage");if(A!==null&&(!A.keyCertSign||S===null)&&(i={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:L.certificateError.bad_certificate}),i===null&&S===null&&(i={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:L.certificateError.bad_certificate}),i===null&&S!==null&&!S.cA&&(i={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:L.certificateError.bad_certificate}),i===null&&A!==null&&"pathLenConstraint"in S){var B=o-1;B>S.pathLenConstraint&&(i={message:"Certificate basicConstraints pathLenConstraint violated.",error:L.certificateError.bad_certificate})}}var b=i===null?!0:i.error,O=a.verify?a.verify(b,o,r):b;if(O===!0)i=null;else throw b===!0&&(i={message:"The application rejected the certificate.",error:L.certificateError.bad_certificate}),(O||O===0)&&(typeof O=="object"&&!q.util.isArray(O)?(O.message&&(i.message=O.message),O.error&&(i.error=O.error)):typeof O=="string"&&(i.error=O)),i;s=!1,++o}while(t.length>0);return!0}});var ln=F((Mh,Ss)=>{var ce=$();lt();sr();Rt();nn();an();tt();_r();cr();re();la();var m=ce.asn1,W=ce.pki,wr=Ss.exports=ce.pkcs12=ce.pkcs12||{},xs={name:"ContentInfo",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:m.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},Ac={name:"PFX",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:m.Class.UNIVERSAL,type:m.Type.INTEGER,constructed:!1,capture:"version"},xs,{name:"PFX.macData",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:m.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:m.Class.UNIVERSAL,type:m.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:m.Class.UNIVERSAL,type:m.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:m.Class.UNIVERSAL,type:m.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},Ic={name:"SafeBag",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:m.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:m.Class.UNIVERSAL,type:m.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},Bc={name:"Attribute",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:m.Class.UNIVERSAL,type:m.Type.SET,constructed:!0,capture:"values"}]},bc={name:"CertBag",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:m.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:m.Class.UNIVERSAL,type:m.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Nr(e,t,a,r){for(var n=[],s=0;s<e.length;s++)for(var i=0;i<e[s].safeBags.length;i++){var o=e[s].safeBags[i];if(!(r!==void 0&&o.type!==r)){if(t===null){n.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(a)>=0&&n.push(o)}}return n}wr.pkcs12FromAsn1=function(e,t,a){typeof t=="string"?(a=t,t=!0):t===void 0&&(t=!0);var r={},n=[];if(!m.validate(e,Ac,r,n)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var i={version:r.version.charCodeAt(0),safeContents:[],getBags:function(S){var A={},B;return"localKeyId"in S?B=S.localKeyId:"localKeyIdHex"in S&&(B=ce.util.hexToBytes(S.localKeyIdHex)),B===void 0&&!("friendlyName"in S)&&"bagType"in S&&(A[S.bagType]=Nr(i.safeContents,null,null,S.bagType)),B!==void 0&&(A.localKeyId=Nr(i.safeContents,"localKeyId",B,S.bagType)),"friendlyName"in S&&(A.friendlyName=Nr(i.safeContents,"friendlyName",S.friendlyName,S.bagType)),A},getBagsByFriendlyName:function(S,A){return Nr(i.safeContents,"friendlyName",S,A)},getBagsByLocalKeyId:function(S,A){return Nr(i.safeContents,"localKeyId",S,A)}};if(r.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=r.version.charCodeAt(0),s}if(m.derToOid(r.contentType)!==W.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=m.derToOid(r.contentType),s}var o=r.content.value[0];if(o.tagClass!==m.Class.UNIVERSAL||o.type!==m.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=un(o),r.mac){var u=null,l=0,c=m.derToOid(r.macAlgorithm);switch(c){case W.oids.sha1:u=ce.md.sha1.create(),l=20;break;case W.oids.sha256:u=ce.md.sha256.create(),l=32;break;case W.oids.sha384:u=ce.md.sha384.create(),l=48;break;case W.oids.sha512:u=ce.md.sha512.create(),l=64;break;case W.oids.md5:u=ce.md.md5.create(),l=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+c);var f=new ce.util.ByteBuffer(r.macSalt),g="macIterations"in r?parseInt(ce.util.bytesToHex(r.macIterations),16):1,v=wr.generateKey(a,f,3,g,l,u),y=ce.hmac.create();y.start(u,v),y.update(o.value);var x=y.getMac();if(x.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return _c(i,o.value,t,a),i};function un(e){if(e.composed||e.constructed){for(var t=ce.util.createBuffer(),a=0;a<e.value.length;++a)t.putBytes(e.value[a].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function _c(e,t,a,r){if(t=m.fromDer(t,a),t.tagClass!==m.Class.UNIVERSAL||t.type!==m.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var n=0;n<t.value.length;n++){var s=t.value[n],i={},o=[];if(!m.validate(s,xs,i,o)){var u=new Error("Cannot read ContentInfo.");throw u.errors=o,u}var l={encrypted:!1},c=null,f=i.content.value[0];switch(m.derToOid(i.contentType)){case W.oids.data:if(f.tagClass!==m.Class.UNIVERSAL||f.type!==m.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");c=un(f).value;break;case W.oids.encryptedData:c=Nc(f,r),l.encrypted=!0;break;default:var u=new Error("Unsupported PKCS#12 contentType.");throw u.contentType=m.derToOid(i.contentType),u}l.safeBags=wc(c,a,r),e.safeContents.push(l)}}function Nc(e,t){var a={},r=[];if(!m.validate(e,ce.pkcs7.asn1.encryptedDataValidator,a,r)){var n=new Error("Cannot read EncryptedContentInfo.");throw n.errors=r,n}var s=m.derToOid(a.contentType);if(s!==W.oids.data){var n=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw n.oid=s,n}s=m.derToOid(a.encAlgorithm);var i=W.pbe.getCipher(s,a.encParameter,t),o=un(a.encryptedContentAsn1),u=ce.util.createBuffer(o.value);if(i.update(u),!i.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return i.output.getBytes()}function wc(e,t,a){if(!t&&e.length===0)return[];if(e=m.fromDer(e,t),e.tagClass!==m.Class.UNIVERSAL||e.type!==m.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],n=0;n<e.value.length;n++){var s=e.value[n],i={},o=[];if(!m.validate(s,Ic,i,o)){var u=new Error("Cannot read SafeBag.");throw u.errors=o,u}var l={type:m.derToOid(i.bagId),attributes:Rc(i.bagAttributes)};r.push(l);var c,f,g=i.bagValue.value[0];switch(l.type){case W.oids.pkcs8ShroudedKeyBag:if(g=W.decryptPrivateKeyInfo(g,a),g===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case W.oids.keyBag:try{l.key=W.privateKeyFromAsn1(g)}catch{l.key=null,l.asn1=g}continue;case W.oids.certBag:c=bc,f=function(){if(m.derToOid(i.certId)!==W.oids.x509Certificate){var y=new Error("Unsupported certificate type, only X.509 supported.");throw y.oid=m.derToOid(i.certId),y}var x=m.fromDer(i.cert,t);try{l.cert=W.certificateFromAsn1(x,!0)}catch{l.cert=null,l.asn1=x}};break;default:var u=new Error("Unsupported PKCS#12 SafeBag type.");throw u.oid=l.type,u}if(c!==void 0&&!m.validate(g,c,i,o)){var u=new Error("Cannot read PKCS#12 "+c.name);throw u.errors=o,u}f()}return r}function Rc(e){var t={};if(e!==void 0)for(var a=0;a<e.length;++a){var r={},n=[];if(!m.validate(e[a],Bc,r,n)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=n,s}var i=m.derToOid(r.oid);if(W.oids[i]!==void 0){t[W.oids[i]]=[];for(var o=0;o<r.values.length;++o)t[W.oids[i]].push(r.values[o].value)}}return t}wr.toPkcs12Asn1=function(e,t,a,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var n=r.localKeyId,s;if(n!==null)n=ce.util.hexToBytes(n);else if(r.generateLocalKeyId)if(t){var i=ce.util.isArray(t)?t[0]:t;typeof i=="string"&&(i=W.certificateFromPem(i));var o=ce.md.sha1.create();o.update(m.toDer(W.certificateToAsn1(i)).getBytes()),n=o.digest().getBytes()}else n=ce.random.getBytes(20);var u=[];n!==null&&u.push(m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.localKeyId).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.SET,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,n)])])),"friendlyName"in r&&u.push(m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.friendlyName).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.SET,!0,[m.create(m.Class.UNIVERSAL,m.Type.BMPSTRING,!1,r.friendlyName)])])),u.length>0&&(s=m.create(m.Class.UNIVERSAL,m.Type.SET,!0,u));var l=[],c=[];t!==null&&(ce.util.isArray(t)?c=t:c=[t]);for(var f=[],g=0;g<c.length;++g){t=c[g],typeof t=="string"&&(t=W.certificateFromPem(t));var v=g===0?s:void 0,y=W.certificateToAsn1(t),x=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.certBag).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.x509Certificate).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(y).getBytes())])])]),v]);f.push(x)}if(f.length>0){var S=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,f),A=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.data).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(S).getBytes())])]);l.push(A)}var B=null;if(e!==null){var b=W.wrapRsaPrivateKey(W.privateKeyToAsn1(e));a===null?B=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.keyBag).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):B=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.pkcs8ShroudedKeyBag).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[W.encryptPrivateKeyInfo(b,a,r)]),s]);var O=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[B]),k=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.data).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(O).getBytes())])]);l.push(k)}var R=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,l),z;if(r.useMac){var o=ce.md.sha1.create(),Y=new ce.util.ByteBuffer(ce.random.getBytes(r.saltSize)),ne=r.count,e=wr.generateKey(a,Y,3,ne,20),ie=ce.hmac.create();ie.start(o,e),ie.update(m.toDer(R).getBytes());var ue=ie.getMac();z=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.sha1).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.NULL,!1,"")]),m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,ue.getBytes())]),m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,Y.getBytes()),m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,m.integerToDer(ne).getBytes())])}return m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,m.integerToDer(3).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(W.oids.data).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(R).getBytes())])]),z])};wr.generateKey=ce.pbe.generatePkcs12Key});var fn=F((qh,Ts)=>{var Ut=$();lt();Rt();an();Qt();Zr();ln();sa();_r();re();la();var cn=Ut.asn1,pr=Ts.exports=Ut.pki=Ut.pki||{};pr.pemToDer=function(e){var t=Ut.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Ut.util.createBuffer(t.body)};pr.privateKeyFromPem=function(e){var t=Ut.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=cn.fromDer(t.body);return pr.privateKeyFromAsn1(r)};pr.privateKeyToPem=function(e,t){var a={type:"RSA PRIVATE KEY",body:cn.toDer(pr.privateKeyToAsn1(e)).getBytes()};return Ut.pem.encode(a,{maxline:t})};pr.privateKeyInfoToPem=function(e,t){var a={type:"PRIVATE KEY",body:cn.toDer(e).getBytes()};return Ut.pem.encode(a,{maxline:t})}});var vn=F((Hh,Rs)=>{var N=$();lt();sr();jr();Qt();fn();tt();cr();re();var ha=function(e,t,a,r){var n=N.util.createBuffer(),s=e.length>>1,i=s+(e.length&1),o=e.substr(0,i),u=e.substr(s,i),l=N.util.createBuffer(),c=N.hmac.create();a=t+a;var f=Math.ceil(r/16),g=Math.ceil(r/20);c.start("MD5",o);var v=N.util.createBuffer();l.putBytes(a);for(var y=0;y<f;++y)c.start(null,null),c.update(l.getBytes()),l.putBuffer(c.digest()),c.start(null,null),c.update(l.bytes()+a),v.putBuffer(c.digest());c.start("SHA1",u);var x=N.util.createBuffer();l.clear(),l.putBytes(a);for(var y=0;y<g;++y)c.start(null,null),c.update(l.getBytes()),l.putBuffer(c.digest()),c.start(null,null),c.update(l.bytes()+a),x.putBuffer(c.digest());return n.putBytes(N.util.xorBytes(v.getBytes(),x.getBytes(),r)),n},Lc=function(e,t,a){var r=N.hmac.create();r.start("SHA1",e);var n=N.util.createBuffer();return n.putInt32(t[0]),n.putInt32(t[1]),n.putByte(a.type),n.putByte(a.version.major),n.putByte(a.version.minor),n.putInt16(a.length),n.putBytes(a.fragment.bytes()),r.update(n.getBytes()),r.digest().getBytes()},kc=function(e,t,a){var r=!1;try{var n=e.deflate(t.fragment.getBytes());t.fragment=N.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},Dc=function(e,t,a){var r=!1;try{var n=e.inflate(t.fragment.getBytes());t.fragment=N.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},je=function(e,t){var a=0;switch(t){case 1:a=e.getByte();break;case 2:a=e.getInt16();break;case 3:a=e.getInt24();break;case 4:a=e.getInt32();break}return N.util.createBuffer(e.getBytes(a))},it=function(e,t,a){e.putInt(a.length(),t<<3),e.putBuffer(a)},p={};p.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};p.SupportedVersions=[p.Versions.TLS_1_1,p.Versions.TLS_1_0];p.Version=p.SupportedVersions[0];p.MaxFragment=15360;p.ConnectionEnd={server:0,client:1};p.PRFAlgorithm={tls_prf_sha256:0};p.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};p.CipherType={stream:0,block:1,aead:2};p.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};p.CompressionMethod={none:0,deflate:1};p.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};p.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};p.Alert={};p.Alert.Level={warning:1,fatal:2};p.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};p.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};p.CipherSuites={};p.getCipherSuite=function(e){var t=null;for(var a in p.CipherSuites){var r=p.CipherSuites[a];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};p.handleUnexpected=function(e,t){var a=!e.open&&e.entity===p.ConnectionEnd.client;a||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unexpected_message}})};p.handleHelloRequest=function(e,t,a){!e.handshaking&&e.handshakes>0&&(p.queue(e,p.createAlert(e,{level:p.Alert.Level.warning,description:p.Alert.Description.no_renegotiation})),p.flush(e)),e.process()};p.parseHelloMessage=function(e,t,a){var r=null,n=e.entity===p.ConnectionEnd.client;if(a<38)e.error(e,{message:n?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});else{var s=t.fragment,i=s.length();if(r={version:{major:s.getByte(),minor:s.getByte()},random:N.util.createBuffer(s.getBytes(32)),session_id:je(s,1),extensions:[]},n?(r.cipher_suite=s.getBytes(2),r.compression_method=s.getByte()):(r.cipher_suites=je(s,2),r.compression_methods=je(s,1)),i=a-(i-s.length()),i>0){for(var o=je(s,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:je(o,2)});if(!n)for(var u=0;u<r.extensions.length;++u){var l=r.extensions[u];if(l.type[0]===0&&l.type[1]===0)for(var c=je(l.data,2);c.length()>0;){var f=c.getByte();if(f!==0)break;e.session.extensions.server_name.serverNameList.push(je(c,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.protocol_version}});if(n)e.session.cipherSuite=p.getCipherSuite(r.cipher_suite);else for(var g=N.util.createBuffer(r.cipher_suites.bytes());g.length()>0&&(e.session.cipherSuite=p.getCipherSuite(g.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.handshake_failure},cipherSuite:N.util.bytesToHex(r.cipher_suite)});n?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=p.CompressionMethod.none}return r};p.createSecurityParameters=function(e,t){var a=e.entity===p.ConnectionEnd.client,r=t.random.bytes(),n=a?e.session.sp.client_random:r,s=a?r:p.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:p.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:n,server_random:s}};p.handleServerHello=function(e,t,a){var r=p.parseHelloMessage(e,t,a);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.protocol_version}});e.session.version=e.version;var n=r.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=Bs,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=Pc,e.session.resuming=!1,p.createSecurityParameters(e,r)),e.session.id=n,e.process()}};p.handleClientHello=function(e,t,a){var r=p.parseHelloMessage(e,t,a);if(!e.fail){var n=r.session_id.bytes(),s=null;if(e.sessionCache&&(s=e.sessionCache.getSession(n),s===null?n="":(s.version.major!==r.version.major||s.version.minor>r.version.minor)&&(s=null,n="")),n.length===0&&(n=N.random.getBytes(32)),e.session.id=n,e.session.clientHelloVersion=r.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var i,o=1;o<p.SupportedVersions.length&&(i=p.SupportedVersions[o],!(i.minor<=r.version.minor));++o);e.version={major:i.major,minor:i.minor},e.session.version=e.version}s!==null?(e.expect=gn,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?Hc:pn,e.session.resuming=!1,p.createSecurityParameters(e,r)),e.open=!0,p.queue(e,p.createRecord(e,{type:p.ContentType.handshake,data:p.createServerHello(e)})),e.session.resuming?(p.queue(e,p.createRecord(e,{type:p.ContentType.change_cipher_spec,data:p.createChangeCipherSpec()})),e.state.pending=p.createConnectionState(e),e.state.current.write=e.state.pending.write,p.queue(e,p.createRecord(e,{type:p.ContentType.handshake,data:p.createFinished(e)}))):(p.queue(e,p.createRecord(e,{type:p.ContentType.handshake,data:p.createCertificate(e)})),e.fail||(p.queue(e,p.createRecord(e,{type:p.ContentType.handshake,data:p.createServerKeyExchange(e)})),e.verifyClient!==!1&&p.queue(e,p.createRecord(e,{type:p.ContentType.handshake,data:p.createCertificateRequest(e)})),p.queue(e,p.createRecord(e,{type:p.ContentType.handshake,data:p.createServerHelloDone(e)})))),p.flush(e),e.process()}};p.handleCertificate=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_list:je(r,3)},s,i,o=[];try{for(;n.certificate_list.length()>0;)s=je(n.certificate_list,3),i=N.asn1.fromDer(s),s=N.pki.certificateFromAsn1(i,!0),o.push(s)}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.bad_certificate}})}var u=e.entity===p.ConnectionEnd.client;(u||e.verifyClient===!0)&&o.length===0?e.error(e,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}}):o.length===0?e.expect=u?As:pn:(u?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],p.verifyCertificateChain(e,o)&&(e.expect=u?As:pn)),e.process()};p.handleServerKeyExchange=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unsupported_certificate}});e.expect=Oc,e.process()};p.handleClientKeyExchange=function(e,t,a){if(a<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unsupported_certificate}});var r=t.fragment,n={enc_pre_master_secret:je(r,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=N.pki.privateKeyFromPem(s)}catch(u){e.error(e,{message:"Could not get private key.",cause:u,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}})}if(s===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}});try{var i=e.session.sp;i.pre_master_secret=s.decrypt(n.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==i.pre_master_secret.charCodeAt(0)||o.minor!==i.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{i.pre_master_secret=N.random.getBytes(48)}e.expect=gn,e.session.clientCertificate!==null&&(e.expect=Gc),e.process()};p.handleCertificateRequest=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_types:je(r,1),certificate_authorities:je(r,2)};e.session.certificateRequest=n,e.expect=Vc,e.process()};p.handleCertificateVerify=function(e,t,a){if(a<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var s={signature:je(r,2).getBytes()},i=N.util.createBuffer();i.putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest()),i=i.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(i,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(n),e.session.sha1.update(n)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.handshake_failure}})}e.expect=gn,e.process()};p.handleServerHelloDone=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.insufficient_security}},n=0,s=e.verify(e,r.alert.description,n,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!N.util.isArray(s)?(s.message&&(r.message=s.message),s.alert&&(r.alert.description=s.alert)):typeof s=="number"&&(r.alert.description=s)),e.error(e,r)}e.session.certificateRequest!==null&&(t=p.createRecord(e,{type:p.ContentType.handshake,data:p.createCertificate(e)}),p.queue(e,t)),t=p.createRecord(e,{type:p.ContentType.handshake,data:p.createClientKeyExchange(e)}),p.queue(e,t),e.expect=Mc;var i=function(o,u){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&p.queue(o,p.createRecord(o,{type:p.ContentType.handshake,data:p.createCertificateVerify(o,u)})),p.queue(o,p.createRecord(o,{type:p.ContentType.change_cipher_spec,data:p.createChangeCipherSpec()})),o.state.pending=p.createConnectionState(o),o.state.current.write=o.state.pending.write,p.queue(o,p.createRecord(o,{type:p.ContentType.handshake,data:p.createFinished(o)})),o.expect=Bs,p.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return i(e,null);p.getClientSignature(e,i)};p.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var a=e.entity===p.ConnectionEnd.client;(e.session.resuming&&a||!e.session.resuming&&!a)&&(e.state.pending=p.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&a||e.session.resuming&&!a)&&(e.state.pending=null),e.expect=a?Fc:zc,e.process()};p.handleFinished=function(e,t,a){var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var s=t.fragment.getBytes();r=N.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var i=e.entity===p.ConnectionEnd.client,o=i?"server finished":"client finished",u=e.session.sp,l=12,c=ha;if(r=c(u.master_secret,o,r.getBytes(),l),r.getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.decrypt_error}});e.session.md5.update(n),e.session.sha1.update(n),(e.session.resuming&&i||!e.session.resuming&&!i)&&(p.queue(e,p.createRecord(e,{type:p.ContentType.change_cipher_spec,data:p.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,p.queue(e,p.createRecord(e,{type:p.ContentType.handshake,data:p.createFinished(e)}))),e.expect=i?Kc:Qc,e.handshaking=!1,++e.handshakes,e.peerCertificate=i?e.session.serverCertificate:e.session.clientCertificate,p.flush(e),e.isConnected=!0,e.connected(e),e.process()};p.handleAlert=function(e,t){var a=t.fragment,r={level:a.getByte(),description:a.getByte()},n;switch(r.description){case p.Alert.Description.close_notify:n="Connection closed.";break;case p.Alert.Description.unexpected_message:n="Unexpected message.";break;case p.Alert.Description.bad_record_mac:n="Bad record MAC.";break;case p.Alert.Description.decryption_failed:n="Decryption failed.";break;case p.Alert.Description.record_overflow:n="Record overflow.";break;case p.Alert.Description.decompression_failure:n="Decompression failed.";break;case p.Alert.Description.handshake_failure:n="Handshake failure.";break;case p.Alert.Description.bad_certificate:n="Bad certificate.";break;case p.Alert.Description.unsupported_certificate:n="Unsupported certificate.";break;case p.Alert.Description.certificate_revoked:n="Certificate revoked.";break;case p.Alert.Description.certificate_expired:n="Certificate expired.";break;case p.Alert.Description.certificate_unknown:n="Certificate unknown.";break;case p.Alert.Description.illegal_parameter:n="Illegal parameter.";break;case p.Alert.Description.unknown_ca:n="Unknown certificate authority.";break;case p.Alert.Description.access_denied:n="Access denied.";break;case p.Alert.Description.decode_error:n="Decode error.";break;case p.Alert.Description.decrypt_error:n="Decrypt error.";break;case p.Alert.Description.export_restriction:n="Export restriction.";break;case p.Alert.Description.protocol_version:n="Unsupported protocol version.";break;case p.Alert.Description.insufficient_security:n="Insufficient security.";break;case p.Alert.Description.internal_error:n="Internal error.";break;case p.Alert.Description.user_canceled:n="User canceled.";break;case p.Alert.Description.no_renegotiation:n="Renegotiation not supported.";break;default:n="Unknown error.";break}if(r.description===p.Alert.Description.close_notify)return e.close();e.error(e,{message:n,send:!1,origin:e.entity===p.ConnectionEnd.client?"server":"client",alert:r}),e.process()};p.handleHandshake=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt24();if(n>a.length())return e.fragmented=t,t.fragment=N.util.createBuffer(),a.read-=4,e.process();e.fragmented=null,a.read-=4;var s=a.bytes(n+4);a.read+=4,r in da[e.entity][e.expect]?(e.entity===p.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:N.md.md5.create(),sha1:N.md.sha1.create()}),r!==p.HandshakeType.hello_request&&r!==p.HandshakeType.certificate_verify&&r!==p.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),da[e.entity][e.expect][r](e,t,n)):p.handleUnexpected(e,t)};p.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};p.handleHeartbeat=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt16(),s=a.getBytes(n);if(r===p.HeartbeatMessageType.heartbeat_request){if(e.handshaking||n>s.length)return e.process();p.queue(e,p.createRecord(e,{type:p.ContentType.heartbeat,data:p.createHeartbeat(p.HeartbeatMessageType.heartbeat_response,s)})),p.flush(e)}else if(r===p.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,N.util.createBuffer(s))}e.process()};var Uc=0,Pc=1,As=2,Oc=3,Vc=4,Bs=5,Fc=6,Kc=7,Mc=8,qc=0,Hc=1,pn=2,Gc=3,gn=4,zc=5,Qc=6,h=p.handleUnexpected,bs=p.handleChangeCipherSpec,Ie=p.handleAlert,ze=p.handleHandshake,_s=p.handleApplicationData,Be=p.handleHeartbeat,yn=[];yn[p.ConnectionEnd.client]=[[h,Ie,ze,h,Be],[h,Ie,ze,h,Be],[h,Ie,ze,h,Be],[h,Ie,ze,h,Be],[h,Ie,ze,h,Be],[bs,Ie,h,h,Be],[h,Ie,ze,h,Be],[h,Ie,ze,_s,Be],[h,Ie,ze,h,Be]];yn[p.ConnectionEnd.server]=[[h,Ie,ze,h,Be],[h,Ie,ze,h,Be],[h,Ie,ze,h,Be],[h,Ie,ze,h,Be],[bs,Ie,h,h,Be],[h,Ie,ze,h,Be],[h,Ie,ze,_s,Be],[h,Ie,ze,h,Be]];var Pt=p.handleHelloRequest,$c=p.handleServerHello,Ns=p.handleCertificate,Is=p.handleServerKeyExchange,dn=p.handleCertificateRequest,ca=p.handleServerHelloDone,ws=p.handleFinished,da=[];da[p.ConnectionEnd.client]=[[h,h,$c,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[Pt,h,h,h,h,h,h,h,h,h,h,Ns,Is,dn,ca,h,h,h,h,h,h],[Pt,h,h,h,h,h,h,h,h,h,h,h,Is,dn,ca,h,h,h,h,h,h],[Pt,h,h,h,h,h,h,h,h,h,h,h,h,dn,ca,h,h,h,h,h,h],[Pt,h,h,h,h,h,h,h,h,h,h,h,h,h,ca,h,h,h,h,h,h],[Pt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[Pt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,ws],[Pt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[Pt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]];var Yc=p.handleClientHello,jc=p.handleClientKeyExchange,Wc=p.handleCertificateVerify;da[p.ConnectionEnd.server]=[[h,Yc,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,Ns,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,jc,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,Wc,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,ws],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]];p.generateKeys=function(e,t){var a=ha,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=a(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var n=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===p.Versions.TLS_1_0.major&&e.version.minor===p.Versions.TLS_1_0.minor;s&&(n+=2*t.fixed_iv_length);var i=a(t.master_secret,"key expansion",r,n),o={client_write_MAC_key:i.getBytes(t.mac_key_length),server_write_MAC_key:i.getBytes(t.mac_key_length),client_write_key:i.getBytes(t.enc_key_length),server_write_key:i.getBytes(t.enc_key_length)};return s&&(o.client_write_IV=i.getBytes(t.fixed_iv_length),o.server_write_IV=i.getBytes(t.fixed_iv_length)),o};p.createConnectionState=function(e){var t=e.entity===p.ConnectionEnd.client,a=function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(i){return!0},compressionState:null,compressFunction:function(i){return!0},updateSequenceNumber:function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]}};return s},r={read:a(),write:a()};if(r.read.update=function(s,i){return r.read.cipherFunction(i,r.read)?r.read.compressFunction(s,i,r.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.bad_record_mac}}),!s.fail},r.write.update=function(s,i){return r.write.compressFunction(s,i,r.write)?r.write.cipherFunction(i,r.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}}),!s.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=p.generateKeys(e,n),r.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,r.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,n),n.compression_algorithm){case p.CompressionMethod.none:break;case p.CompressionMethod.deflate:r.read.compressFunction=Dc,r.write.compressFunction=kc;break;default:throw new Error("Unsupported compression algorithm.")}}return r};p.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,a=N.util.createBuffer();return a.putInt32(t),a.putBytes(N.random.getBytes(28)),a};p.createRecord=function(e,t){if(!t.data)return null;var a={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return a};p.createAlert=function(e,t){var a=N.util.createBuffer();return a.putByte(t.level),a.putByte(t.description),p.createRecord(e,{type:p.ContentType.alert,data:a})};p.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=N.util.createBuffer(),a=0;a<e.cipherSuites.length;++a){var r=e.cipherSuites[a];t.putByte(r.id[0]),t.putByte(r.id[1])}var n=t.length(),s=N.util.createBuffer();s.putByte(p.CompressionMethod.none);var i=s.length(),o=N.util.createBuffer();if(e.virtualHost){var u=N.util.createBuffer();u.putByte(0),u.putByte(0);var l=N.util.createBuffer();l.putByte(0),it(l,2,N.util.createBuffer(e.virtualHost));var c=N.util.createBuffer();it(c,2,l),it(u,2,c),o.putBuffer(u)}var f=o.length();f>0&&(f+=2);var g=e.session.id,v=g.length+1+2+4+28+2+n+1+i+f,y=N.util.createBuffer();return y.putByte(p.HandshakeType.client_hello),y.putInt24(v),y.putByte(e.version.major),y.putByte(e.version.minor),y.putBytes(e.session.sp.client_random),it(y,1,N.util.createBuffer(g)),it(y,2,t),it(y,1,s),f>0&&it(y,2,o),y};p.createServerHello=function(e){var t=e.session.id,a=t.length+1+2+4+28+2+1,r=N.util.createBuffer();return r.putByte(p.HandshakeType.server_hello),r.putInt24(a),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),it(r,1,N.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};p.createCertificate=function(e){var t=e.entity===p.ConnectionEnd.client,a=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,a=e.getCertificate(e,r)}var n=N.util.createBuffer();if(a!==null)try{N.util.isArray(a)||(a=[a]);for(var s=null,i=0;i<a.length;++i){var o=N.pem.decode(a[i])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var u=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw u.headerType=o.type,u}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=N.util.createBuffer(o.body);s===null&&(s=N.asn1.fromDer(l.bytes(),!1));var c=N.util.createBuffer();it(c,3,l),n.putBuffer(c)}a=N.pki.certificateFromAsn1(s),t?e.session.clientCertificate=a:e.session.serverCertificate=a}catch(v){return e.error(e,{message:"Could not send certificate list.",cause:v,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.bad_certificate}})}var f=3+n.length(),g=N.util.createBuffer();return g.putByte(p.HandshakeType.certificate),g.putInt24(f),it(g,3,n),g};p.createClientKeyExchange=function(e){var t=N.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(N.random.getBytes(46));var a=e.session.sp;a.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(a.pre_master_secret);var n=t.length+2,s=N.util.createBuffer();return s.putByte(p.HandshakeType.client_key_exchange),s.putInt24(n),s.putInt16(t.length),s.putBytes(t),s};p.createServerKeyExchange=function(e){var t=0,a=N.util.createBuffer();return t>0&&(a.putByte(p.HandshakeType.server_key_exchange),a.putInt24(t)),a};p.getClientSignature=function(e,t){var a=N.util.createBuffer();a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest()),a=a.getBytes(),e.getSignature=e.getSignature||function(r,n,s){var i=null;if(r.getPrivateKey)try{i=r.getPrivateKey(r,r.session.clientCertificate),i=N.pki.privateKeyFromPem(i)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}})}i===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}}):n=i.sign(n,null),s(r,n)},e.getSignature(e,a,t)};p.createCertificateVerify=function(e,t){var a=t.length+2,r=N.util.createBuffer();return r.putByte(p.HandshakeType.certificate_verify),r.putInt24(a),r.putInt16(t.length),r.putBytes(t),r};p.createCertificateRequest=function(e){var t=N.util.createBuffer();t.putByte(1);var a=N.util.createBuffer();for(var r in e.caStore.certs){var n=e.caStore.certs[r],s=N.pki.distinguishedNameToAsn1(n.subject),i=N.asn1.toDer(s);a.putInt16(i.length()),a.putBuffer(i)}var o=1+t.length()+2+a.length(),u=N.util.createBuffer();return u.putByte(p.HandshakeType.certificate_request),u.putInt24(o),it(u,1,t),it(u,2,a),u};p.createServerHelloDone=function(e){var t=N.util.createBuffer();return t.putByte(p.HandshakeType.server_hello_done),t.putInt24(0),t};p.createChangeCipherSpec=function(){var e=N.util.createBuffer();return e.putByte(1),e};p.createFinished=function(e){var t=N.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var a=e.entity===p.ConnectionEnd.client,r=e.session.sp,n=12,s=ha,i=a?"client finished":"server finished";t=s(r.master_secret,i,t.getBytes(),n);var o=N.util.createBuffer();return o.putByte(p.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o};p.createHeartbeat=function(e,t,a){typeof a>"u"&&(a=t.length);var r=N.util.createBuffer();r.putByte(e),r.putInt16(a),r.putBytes(t);var n=r.length(),s=Math.max(16,n-a-3);return r.putBytes(N.random.getBytes(s)),r};p.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===p.ContentType.handshake||t.type===p.ContentType.alert||t.type===p.ContentType.change_cipher_spec))){if(t.type===p.ContentType.handshake){var a=t.fragment.bytes();e.session.md5.update(a),e.session.sha1.update(a),a=null}var r;if(t.fragment.length()<=p.MaxFragment)r=[t];else{r=[];for(var n=t.fragment.bytes();n.length>p.MaxFragment;)r.push(p.createRecord(e,{type:t.type,data:N.util.createBuffer(n.slice(0,p.MaxFragment))})),n=n.slice(p.MaxFragment);n.length>0&&r.push(p.createRecord(e,{type:t.type,data:N.util.createBuffer(n)}))}for(var s=0;s<r.length&&!e.fail;++s){var i=r[s],o=e.state.current.write;o.update(e,i)&&e.records.push(i)}}};p.flush=function(e){for(var t=0;t<e.records.length;++t){var a=e.records[t];e.tlsData.putByte(a.type),e.tlsData.putByte(a.version.major),e.tlsData.putByte(a.version.minor),e.tlsData.putInt16(a.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var hn=function(e){switch(e){case!0:return!0;case N.pki.certificateError.bad_certificate:return p.Alert.Description.bad_certificate;case N.pki.certificateError.unsupported_certificate:return p.Alert.Description.unsupported_certificate;case N.pki.certificateError.certificate_revoked:return p.Alert.Description.certificate_revoked;case N.pki.certificateError.certificate_expired:return p.Alert.Description.certificate_expired;case N.pki.certificateError.certificate_unknown:return p.Alert.Description.certificate_unknown;case N.pki.certificateError.unknown_ca:return p.Alert.Description.unknown_ca;default:return p.Alert.Description.bad_certificate}},Xc=function(e){switch(e){case!0:return!0;case p.Alert.Description.bad_certificate:return N.pki.certificateError.bad_certificate;case p.Alert.Description.unsupported_certificate:return N.pki.certificateError.unsupported_certificate;case p.Alert.Description.certificate_revoked:return N.pki.certificateError.certificate_revoked;case p.Alert.Description.certificate_expired:return N.pki.certificateError.certificate_expired;case p.Alert.Description.certificate_unknown:return N.pki.certificateError.certificate_unknown;case p.Alert.Description.unknown_ca:return N.pki.certificateError.unknown_ca;default:return N.pki.certificateError.bad_certificate}};p.verifyCertificateChain=function(e,t){try{var a={};for(var r in e.verifyOptions)a[r]=e.verifyOptions[r];a.verify=function(s,i,o){var u=hn(s),l=e.verify(e,s,i,o);if(l!==!0){if(typeof l=="object"&&!N.util.isArray(l)){var c=new Error("The application rejected the certificate.");throw c.send=!0,c.alert={level:p.Alert.Level.fatal,description:p.Alert.Description.bad_certificate},l.message&&(c.message=l.message),l.alert&&(c.alert.description=l.alert),c}l!==s&&(l=Xc(l))}return l},N.pki.verifyCertificateChain(e.caStore,t,a)}catch(s){var n=s;(typeof n!="object"||N.util.isArray(n))&&(n={send:!0,alert:{level:p.Alert.Level.fatal,description:hn(s)}}),"send"in n||(n.send=!0),"alert"in n||(n.alert={level:p.Alert.Level.fatal,description:hn(n.error)}),e.error(e,n)}return!e.fail};p.createSessionCache=function(e,t){var a=null;if(e&&e.getSession&&e.setSession&&e.order)a=e;else{a={},a.cache=e||{},a.capacity=Math.max(t||100,1),a.order=[];for(var r in e)a.order.length<=t?a.order.push(r):delete e[r];a.getSession=function(n){var s=null,i=null;if(n?i=N.util.bytesToHex(n):a.order.length>0&&(i=a.order[0]),i!==null&&i in a.cache){s=a.cache[i],delete a.cache[i];for(var o in a.order)if(a.order[o]===i){a.order.splice(o,1);break}}return s},a.setSession=function(n,s){if(a.order.length===a.capacity){var i=a.order.shift();delete a.cache[i]}var i=N.util.bytesToHex(n);a.order.push(i),a.cache[i]=s}}return a};p.createConnection=function(e){var t=null;e.caStore?N.util.isArray(e.caStore)?t=N.pki.createCaStore(e.caStore):t=e.caStore:t=N.pki.createCaStore();var a=e.cipherSuites||null;if(a===null){a=[];for(var r in p.CipherSuites)a.push(p.CipherSuites[r])}var n=e.server?p.ConnectionEnd.server:p.ConnectionEnd.client,s=e.sessionCache?p.createSessionCache(e.sessionCache):null,i={version:{major:p.Version.major,minor:p.Version.minor},entity:n,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:a,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(c,f,g,v){return f},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:N.util.createBuffer(),tlsData:N.util.createBuffer(),data:N.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(c,f){f.origin=f.origin||(c.entity===p.ConnectionEnd.client?"client":"server"),f.send&&(p.queue(c,p.createAlert(c,f.alert)),p.flush(c));var g=f.fatal!==!1;g&&(c.fail=!0),e.error(c,f),g&&c.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};i.reset=function(c){i.version={major:p.Version.major,minor:p.Version.minor},i.record=null,i.session=null,i.peerCertificate=null,i.state={pending:null,current:null},i.expect=i.entity===p.ConnectionEnd.client?Uc:qc,i.fragmented=null,i.records=[],i.open=!1,i.handshakes=0,i.handshaking=!1,i.isConnected=!1,i.fail=!(c||typeof c>"u"),i.input.clear(),i.tlsData.clear(),i.data.clear(),i.state.current=p.createConnectionState(i)},i.reset();var o=function(c,f){var g=f.type-p.ContentType.change_cipher_spec,v=yn[c.entity][c.expect];g in v?v[g](c,f):p.handleUnexpected(c,f)},u=function(c){var f=0,g=c.input,v=g.length();if(v<5)f=5-v;else{c.record={type:g.getByte(),version:{major:g.getByte(),minor:g.getByte()},length:g.getInt16(),fragment:N.util.createBuffer(),ready:!1};var y=c.record.version.major===c.version.major;y&&c.session&&c.session.version&&(y=c.record.version.minor===c.version.minor),y||c.error(c,{message:"Incompatible TLS version.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.protocol_version}})}return f},l=function(c){var f=0,g=c.input,v=g.length();if(v<c.record.length)f=c.record.length-v;else{c.record.fragment.putBytes(g.getBytes(c.record.length)),g.compact();var y=c.state.current.read;y.update(c,c.record)&&(c.fragmented!==null&&(c.fragmented.type===c.record.type?(c.fragmented.fragment.putBuffer(c.record.fragment),c.record=c.fragmented):c.error(c,{message:"Invalid fragmented record.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unexpected_message}})),c.record.ready=!0)}return f};return i.handshake=function(c){if(i.entity!==p.ConnectionEnd.client)i.error(i,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(i.handshaking)i.error(i,{message:"Handshake already in progress.",fatal:!1});else{i.fail&&!i.open&&i.handshakes===0&&(i.fail=!1),i.handshaking=!0,c=c||"";var f=null;c.length>0&&(i.sessionCache&&(f=i.sessionCache.getSession(c)),f===null&&(c="")),c.length===0&&i.sessionCache&&(f=i.sessionCache.getSession(),f!==null&&(c=f.id)),i.session={id:c,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:N.md.md5.create(),sha1:N.md.sha1.create()},f&&(i.version=f.version,i.session.sp=f.sp),i.session.sp.client_random=p.createRandom().getBytes(),i.open=!0,p.queue(i,p.createRecord(i,{type:p.ContentType.handshake,data:p.createClientHello(i)})),p.flush(i)}},i.process=function(c){var f=0;return c&&i.input.putBytes(c),i.fail||(i.record!==null&&i.record.ready&&i.record.fragment.isEmpty()&&(i.record=null),i.record===null&&(f=u(i)),!i.fail&&i.record!==null&&!i.record.ready&&(f=l(i)),!i.fail&&i.record!==null&&i.record.ready&&o(i,i.record)),f},i.prepare=function(c){return p.queue(i,p.createRecord(i,{type:p.ContentType.application_data,data:N.util.createBuffer(c)})),p.flush(i)},i.prepareHeartbeatRequest=function(c,f){return c instanceof N.util.ByteBuffer&&(c=c.bytes()),typeof f>"u"&&(f=c.length),i.expectedHeartbeatPayload=c,p.queue(i,p.createRecord(i,{type:p.ContentType.heartbeat,data:p.createHeartbeat(p.HeartbeatMessageType.heartbeat_request,c,f)})),p.flush(i)},i.close=function(c){if(!i.fail&&i.sessionCache&&i.session){var f={id:i.session.id,version:i.session.version,sp:i.session.sp};f.sp.keys=null,i.sessionCache.setSession(f.id,f)}i.open&&(i.open=!1,i.input.clear(),(i.isConnected||i.handshaking)&&(i.isConnected=i.handshaking=!1,p.queue(i,p.createAlert(i,{level:p.Alert.Level.warning,description:p.Alert.Description.close_notify})),p.flush(i)),i.closed(i)),i.reset(c)},i};Rs.exports=N.tls=N.tls||{};for(fa in p)typeof p[fa]!="function"&&(N.tls[fa]=p[fa]);var fa;N.tls.prf_tls1=ha;N.tls.hmac_sha1=Lc;N.tls.createSessionCache=p.createSessionCache;N.tls.createConnection=p.createConnection});var Ds=F((Gh,ks)=>{var Ot=$();wt();vn();var st=ks.exports=Ot.tls;st.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=st.BulkCipherAlgorithm.aes,e.cipher_type=st.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=st.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:Ls};st.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=st.BulkCipherAlgorithm.aes,e.cipher_type=st.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=st.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:Ls};function Ls(e,t,a){var r=t.entity===Ot.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:Ot.cipher.createDecipher("AES-CBC",r?a.keys.server_write_key:a.keys.client_write_key),iv:r?a.keys.server_write_IV:a.keys.client_write_IV},e.write.cipherState={init:!1,cipher:Ot.cipher.createCipher("AES-CBC",r?a.keys.client_write_key:a.keys.server_write_key),iv:r?a.keys.client_write_IV:a.keys.server_write_IV},e.read.cipherFunction=tf,e.write.cipherFunction=Jc,e.read.macLength=e.write.macLength=a.mac_length,e.read.macFunction=e.write.macFunction=st.hmac_sha1}function Jc(e,t){var a=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var n;e.version.minor===st.Versions.TLS_1_0.minor?n=t.cipherState.init?null:t.cipherState.iv:n=Ot.random.getBytesSync(16),t.cipherState.init=!0;var s=t.cipherState.cipher;return s.start({iv:n}),e.version.minor>=st.Versions.TLS_1_1.minor&&s.output.putBytes(n),s.update(e.fragment),s.finish(Zc)&&(e.fragment=s.output,e.length=e.fragment.length(),a=!0),a}function Zc(e,t,a){if(!a){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function ef(e,t,a){var r=!0;if(a){for(var n=t.length(),s=t.last(),i=n-1-s;i<n-1;++i)r=r&&t.at(i)==s;r&&t.truncate(s+1)}return r}function tf(e,t){var a=!1,r;e.version.minor===st.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var n=t.cipherState.cipher;n.start({iv:r}),n.update(e.fragment),a=n.finish(ef);var s=t.macLength,i=Ot.random.getBytesSync(s),o=n.output.length();o>=s?(e.fragment=n.output.getBytes(o-s),i=n.output.getBytes(s)):e.fragment=n.output.getBytes(),e.fragment=Ot.util.createBuffer(e.fragment),e.length=e.fragment.length();var u=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),a=rf(t.macKey,i,u)&&a,a}function rf(e,t,a){var r=Ot.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(a),a=r.digest().getBytes(),t===a}});var En=F((zh,Vs)=>{var he=$();dt();re();var Rr=Vs.exports=he.sha512=he.sha512||{};he.md.sha512=he.md.algorithms.sha512=Rr;var Ps=he.sha384=he.sha512.sha384=he.sha512.sha384||{};Ps.create=function(){return Rr.create("SHA-384")};he.md.sha384=he.md.algorithms.sha384=Ps;he.sha512.sha256=he.sha512.sha256||{create:function(){return Rr.create("SHA-512/256")}};he.md["sha512/256"]=he.md.algorithms["sha512/256"]=he.sha512.sha256;he.sha512.sha224=he.sha512.sha224||{create:function(){return Rr.create("SHA-512/224")}};he.md["sha512/224"]=he.md.algorithms["sha512/224"]=he.sha512.sha224;Rr.create=function(e){if(Os||af(),typeof e>"u"&&(e="SHA-512"),!(e in Jt))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Jt[e],a=null,r=he.util.createBuffer(),n=new Array(80),s=0;s<80;++s)n[s]=new Array(2);var i=64;switch(e){case"SHA-384":i=48;break;case"SHA-512/256":i=32;break;case"SHA-512/224":i=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:i,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var u=o.messageLengthSize/4,l=0;l<u;++l)o.fullMessageLength.push(0);r=he.util.createBuffer(),a=new Array(t.length);for(var l=0;l<t.length;++l)a[l]=t[l].slice(0);return o},o.start(),o.update=function(u,l){l==="utf8"&&(u=he.util.encodeUtf8(u));var c=u.length;o.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var f=o.fullMessageLength.length-1;f>=0;--f)o.fullMessageLength[f]+=c[1],c[1]=c[0]+(o.fullMessageLength[f]/4294967296>>>0),o.fullMessageLength[f]=o.fullMessageLength[f]>>>0,c[0]=c[1]/4294967296>>>0;return r.putBytes(u),Us(a,n,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var u=he.util.createBuffer();u.putBytes(r.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,c=l&o.blockLength-1;u.putBytes(mn.substr(0,o.blockLength-c));for(var f,g,v=o.fullMessageLength[0]*8,y=0;y<o.fullMessageLength.length-1;++y)f=o.fullMessageLength[y+1]*8,g=f/4294967296>>>0,v+=g,u.putInt32(v>>>0),v=f>>>0;u.putInt32(v);for(var x=new Array(a.length),y=0;y<a.length;++y)x[y]=a[y].slice(0);Us(x,n,u);var S=he.util.createBuffer(),A;e==="SHA-512"?A=x.length:e==="SHA-384"?A=x.length-2:A=x.length-4;for(var y=0;y<A;++y)S.putInt32(x[y][0]),(y!==A-1||e!=="SHA-512/224")&&S.putInt32(x[y][1]);return S},o};var mn=null,Os=!1,Cn=null,Jt=null;function af(){mn="\x80",mn+=he.util.fillString("\0",128),Cn=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],Jt={},Jt["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Jt["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Jt["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Jt["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],Os=!0}function Us(e,t,a){for(var r,n,s,i,o,u,l,c,f,g,v,y,x,S,A,B,b,O,k,R,z,Y,ne,ie,ue,fe,qe,et,se,ye,K,Mt,rr,ve,me,Ee=a.length();Ee>=128;){for(se=0;se<16;++se)t[se][0]=a.getInt32()>>>0,t[se][1]=a.getInt32()>>>0;for(;se<80;++se)Mt=t[se-2],ye=Mt[0],K=Mt[1],r=((ye>>>19|K<<13)^(K>>>29|ye<<3)^ye>>>6)>>>0,n=((ye<<13|K>>>19)^(K<<3|ye>>>29)^(ye<<26|K>>>6))>>>0,ve=t[se-15],ye=ve[0],K=ve[1],s=((ye>>>1|K<<31)^(ye>>>8|K<<24)^ye>>>7)>>>0,i=((ye<<31|K>>>1)^(ye<<24|K>>>8)^(ye<<25|K>>>7))>>>0,rr=t[se-7],me=t[se-16],K=n+rr[1]+i+me[1],t[se][0]=r+rr[0]+s+me[0]+(K/4294967296>>>0)>>>0,t[se][1]=K>>>0;for(x=e[0][0],S=e[0][1],A=e[1][0],B=e[1][1],b=e[2][0],O=e[2][1],k=e[3][0],R=e[3][1],z=e[4][0],Y=e[4][1],ne=e[5][0],ie=e[5][1],ue=e[6][0],fe=e[6][1],qe=e[7][0],et=e[7][1],se=0;se<80;++se)l=((z>>>14|Y<<18)^(z>>>18|Y<<14)^(Y>>>9|z<<23))>>>0,c=((z<<18|Y>>>14)^(z<<14|Y>>>18)^(Y<<23|z>>>9))>>>0,f=(ue^z&(ne^ue))>>>0,g=(fe^Y&(ie^fe))>>>0,o=((x>>>28|S<<4)^(S>>>2|x<<30)^(S>>>7|x<<25))>>>0,u=((x<<4|S>>>28)^(S<<30|x>>>2)^(S<<25|x>>>7))>>>0,v=(x&A|b&(x^A))>>>0,y=(S&B|O&(S^B))>>>0,K=et+c+g+Cn[se][1]+t[se][1],r=qe+l+f+Cn[se][0]+t[se][0]+(K/4294967296>>>0)>>>0,n=K>>>0,K=u+y,s=o+v+(K/4294967296>>>0)>>>0,i=K>>>0,qe=ue,et=fe,ue=ne,fe=ie,ne=z,ie=Y,K=R+n,z=k+r+(K/4294967296>>>0)>>>0,Y=K>>>0,k=b,R=O,b=A,O=B,A=x,B=S,K=n+i,x=r+s+(K/4294967296>>>0)>>>0,S=K>>>0;K=e[0][1]+S,e[0][0]=e[0][0]+x+(K/4294967296>>>0)>>>0,e[0][1]=K>>>0,K=e[1][1]+B,e[1][0]=e[1][0]+A+(K/4294967296>>>0)>>>0,e[1][1]=K>>>0,K=e[2][1]+O,e[2][0]=e[2][0]+b+(K/4294967296>>>0)>>>0,e[2][1]=K>>>0,K=e[3][1]+R,e[3][0]=e[3][0]+k+(K/4294967296>>>0)>>>0,e[3][1]=K>>>0,K=e[4][1]+Y,e[4][0]=e[4][0]+z+(K/4294967296>>>0)>>>0,e[4][1]=K>>>0,K=e[5][1]+ie,e[5][0]=e[5][0]+ne+(K/4294967296>>>0)>>>0,e[5][1]=K>>>0,K=e[6][1]+fe,e[6][0]=e[6][0]+ue+(K/4294967296>>>0)>>>0,e[6][1]=K>>>0,K=e[7][1]+et,e[7][0]=e[7][0]+qe+(K/4294967296>>>0)>>>0,e[7][1]=K>>>0,Ee-=128}}});var Fs=F(xn=>{var nf=$();lt();var Ae=nf.asn1;xn.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};xn.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var Js=F(($h,Xs)=>{var be=$();br();tt();En();re();var zs=Fs(),sf=zs.publicKeyValidator,of=zs.privateKeyValidator;typeof Ks>"u"&&(Ks=be.jsbn.BigInteger);var Ks,Tn=be.util.ByteBuffer,Ye=typeof Buffer>"u"?Uint8Array:Buffer;be.pki=be.pki||{};Xs.exports=be.pki.ed25519=be.ed25519=be.ed25519||{};var X=be.ed25519;X.constants={};X.constants.PUBLIC_KEY_BYTE_LENGTH=32;X.constants.PRIVATE_KEY_BYTE_LENGTH=64;X.constants.SEED_BYTE_LENGTH=32;X.constants.SIGN_BYTE_LENGTH=64;X.constants.HASH_BYTE_LENGTH=64;X.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=be.random.getBytesSync(X.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==X.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+X.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=It({message:t,encoding:"binary"});for(var a=new Ye(X.constants.PUBLIC_KEY_BYTE_LENGTH),r=new Ye(X.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)r[n]=t[n];return ff(a,r),{publicKey:a,privateKey:r}};X.privateKeyFromAsn1=function(e){var t={},a=[],r=be.asn1.validate(e,of,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var s=be.asn1.derToOid(t.privateKeyOid),i=be.oids.EdDSA25519;if(s!==i)throw new Error('Invalid OID "'+s+'"; OID must be "'+i+'".');var o=t.privateKey,u=It({message:be.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:u}};X.publicKeyFromAsn1=function(e){var t={},a=[],r=be.asn1.validate(e,sf,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var s=be.asn1.derToOid(t.publicKeyOid),i=be.oids.EdDSA25519;if(s!==i)throw new Error('Invalid OID "'+s+'"; OID must be "'+i+'".');var o=t.ed25519PublicKey;if(o.length!==X.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return It({message:o,encoding:"binary"})};X.publicKeyFromPrivateKey=function(e){e=e||{};var t=It({message:e.privateKey,encoding:"binary"});if(t.length!==X.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+X.constants.PRIVATE_KEY_BYTE_LENGTH);for(var a=new Ye(X.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<a.length;++r)a[r]=t[32+r];return a};X.sign=function(e){e=e||{};var t=It(e),a=It({message:e.privateKey,encoding:"binary"});if(a.length===X.constants.SEED_BYTE_LENGTH){var r=X.generateKeyPair({seed:a});a=r.privateKey}else if(a.length!==X.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+X.constants.SEED_BYTE_LENGTH+" or "+X.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new Ye(X.constants.SIGN_BYTE_LENGTH+t.length);df(n,t,t.length,a);for(var s=new Ye(X.constants.SIGN_BYTE_LENGTH),i=0;i<s.length;++i)s[i]=n[i];return s};X.verify=function(e){e=e||{};var t=It(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var a=It({message:e.signature,encoding:"binary"});if(a.length!==X.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+X.constants.SIGN_BYTE_LENGTH);var r=It({message:e.publicKey,encoding:"binary"});if(r.length!==X.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+X.constants.PUBLIC_KEY_BYTE_LENGTH);var n=new Ye(X.constants.SIGN_BYTE_LENGTH+t.length),s=new Ye(X.constants.SIGN_BYTE_LENGTH+t.length),i;for(i=0;i<X.constants.SIGN_BYTE_LENGTH;++i)n[i]=a[i];for(i=0;i<t.length;++i)n[i+X.constants.SIGN_BYTE_LENGTH]=t[i];return hf(s,n,n.length,r)>=0};function It(e){var t=e.message;if(t instanceof Uint8Array||t instanceof Ye)return t;var a=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),a="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!a)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,a);t=new Tn(t,a)}else if(!(t instanceof Tn))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new Ye(t.length()),n=0;n<r.length;++n)r[n]=t.at(n);return r}var An=H(),pa=H([1]),uf=H([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),lf=H([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Ms=H([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),qs=H([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Lr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),cf=H([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function kr(e,t){var a=be.md.sha512.create(),r=new Tn(e);a.update(r.getBytes(t),"binary");var n=a.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(n,"binary");for(var s=new Ye(X.constants.HASH_BYTE_LENGTH),i=0;i<64;++i)s[i]=n.charCodeAt(i);return s}function ff(e,t){var a=[H(),H(),H(),H()],r,n=kr(t,32);for(n[0]&=248,n[31]&=127,n[31]|=64,_n(a,n),bn(e,a),r=0;r<32;++r)t[r+32]=e[r];return 0}function df(e,t,a,r){var n,s,i=new Float64Array(64),o=[H(),H(),H(),H()],u=kr(r,32);u[0]&=248,u[31]&=127,u[31]|=64;var l=a+64;for(n=0;n<a;++n)e[64+n]=t[n];for(n=0;n<32;++n)e[32+n]=u[32+n];var c=kr(e.subarray(32),a+32);for(In(c),_n(o,c),bn(e,o),n=32;n<64;++n)e[n]=r[n];var f=kr(e,a+64);for(In(f),n=32;n<64;++n)i[n]=0;for(n=0;n<32;++n)i[n]=c[n];for(n=0;n<32;++n)for(s=0;s<32;s++)i[n+s]+=f[n]*u[s];return Qs(e.subarray(32),i),l}function hf(e,t,a,r){var n,s,i=new Ye(32),o=[H(),H(),H(),H()],u=[H(),H(),H(),H()];if(s=-1,a<64||gf(u,r)||!pf(t,32))return-1;for(n=0;n<a;++n)e[n]=t[n];for(n=0;n<32;++n)e[n+32]=r[n];var l=kr(e,a);if(In(l),js(o,u,l),_n(u,t.subarray(32)),Bn(o,u),bn(i,o),a-=64,$s(t,0,i,0)){for(n=0;n<a;++n)e[n]=0;return-1}for(n=0;n<a;++n)e[n]=t[n+64];return s=a,s}function pf(e,t){var a;for(a=31;a>=0;--a){if(e[t+a]<Lr[a])return!0;if(e[t+a]>Lr[a])return!1}return!1}function Qs(e,t){var a,r,n,s;for(r=63;r>=32;--r){for(a=0,n=r-32,s=r-12;n<s;++n)t[n]+=a-16*t[r]*Lr[n-(r-32)],a=t[n]+128>>8,t[n]-=a*256;t[n]+=a,t[r]=0}for(a=0,n=0;n<32;++n)t[n]+=a-(t[31]>>4)*Lr[n],a=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=a*Lr[n];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function In(e){for(var t=new Float64Array(64),a=0;a<64;++a)t[a]=e[a],e[a]=0;Qs(e,t)}function Bn(e,t){var a=H(),r=H(),n=H(),s=H(),i=H(),o=H(),u=H(),l=H(),c=H();yr(a,e[1],e[0]),yr(c,t[1],t[0]),oe(a,a,c),gr(r,e[0],e[1]),gr(c,t[0],t[1]),oe(r,r,c),oe(n,e[3],t[3]),oe(n,n,lf),oe(s,e[2],t[2]),gr(s,s,s),yr(i,r,a),yr(o,s,n),gr(u,s,n),gr(l,r,a),oe(e[0],i,o),oe(e[1],l,u),oe(e[2],u,o),oe(e[3],i,l)}function Hs(e,t,a){for(var r=0;r<4;++r)Ws(e[r],t[r],a)}function bn(e,t){var a=H(),r=H(),n=H();Cf(n,t[2]),oe(a,t[0],n),oe(r,t[1],n),ga(e,r),e[31]^=Ys(a)<<7}function ga(e,t){var a,r,n,s=H(),i=H();for(a=0;a<16;++a)i[a]=t[a];for(Sn(i),Sn(i),Sn(i),r=0;r<2;++r){for(s[0]=i[0]-65517,a=1;a<15;++a)s[a]=i[a]-65535-(s[a-1]>>16&1),s[a-1]&=65535;s[15]=i[15]-32767-(s[14]>>16&1),n=s[15]>>16&1,s[14]&=65535,Ws(i,s,1-n)}for(a=0;a<16;a++)e[2*a]=i[a]&255,e[2*a+1]=i[a]>>8}function gf(e,t){var a=H(),r=H(),n=H(),s=H(),i=H(),o=H(),u=H();return Vt(e[2],pa),yf(e[1],t),Zt(n,e[1]),oe(s,n,uf),yr(n,n,e[2]),gr(s,e[2],s),Zt(i,s),Zt(o,i),oe(u,o,i),oe(a,u,n),oe(a,a,s),vf(a,a),oe(a,a,n),oe(a,a,s),oe(a,a,s),oe(e[0],a,s),Zt(r,e[0]),oe(r,r,s),Gs(r,n)&&oe(e[0],e[0],cf),Zt(r,e[0]),oe(r,r,s),Gs(r,n)?-1:(Ys(e[0])===t[31]>>7&&yr(e[0],An,e[0]),oe(e[3],e[0],e[1]),0)}function yf(e,t){var a;for(a=0;a<16;++a)e[a]=t[2*a]+(t[2*a+1]<<8);e[15]&=32767}function vf(e,t){var a=H(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)Zt(a,a),r!==1&&oe(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function Gs(e,t){var a=new Ye(32),r=new Ye(32);return ga(a,e),ga(r,t),$s(a,0,r,0)}function $s(e,t,a,r){return mf(e,t,a,r,32)}function mf(e,t,a,r,n){var s,i=0;for(s=0;s<n;++s)i|=e[t+s]^a[r+s];return(1&i-1>>>8)-1}function Ys(e){var t=new Ye(32);return ga(t,e),t[0]&1}function js(e,t,a){var r,n;for(Vt(e[0],An),Vt(e[1],pa),Vt(e[2],pa),Vt(e[3],An),n=255;n>=0;--n)r=a[n/8|0]>>(n&7)&1,Hs(e,t,r),Bn(t,e),Bn(e,e),Hs(e,t,r)}function _n(e,t){var a=[H(),H(),H(),H()];Vt(a[0],Ms),Vt(a[1],qs),Vt(a[2],pa),oe(a[3],Ms,qs),js(e,a,t)}function Vt(e,t){var a;for(a=0;a<16;a++)e[a]=t[a]|0}function Cf(e,t){var a=H(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)Zt(a,a),r!==2&&r!==4&&oe(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function Sn(e){var t,a,r=1;for(t=0;t<16;++t)a=e[t]+r+65535,r=Math.floor(a/65536),e[t]=a-r*65536;e[0]+=r-1+37*(r-1)}function Ws(e,t,a){for(var r,n=~(a-1),s=0;s<16;++s)r=n&(e[s]^t[s]),e[s]^=r,t[s]^=r}function H(e){var t,a=new Float64Array(16);if(e)for(t=0;t<e.length;++t)a[t]=e[t];return a}function gr(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]+a[r]}function yr(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]-a[r]}function Zt(e,t){oe(e,t,t)}function oe(e,t,a){var r,n,s=0,i=0,o=0,u=0,l=0,c=0,f=0,g=0,v=0,y=0,x=0,S=0,A=0,B=0,b=0,O=0,k=0,R=0,z=0,Y=0,ne=0,ie=0,ue=0,fe=0,qe=0,et=0,se=0,ye=0,K=0,Mt=0,rr=0,ve=a[0],me=a[1],Ee=a[2],Ne=a[3],we=a[4],Re=a[5],Le=a[6],ke=a[7],De=a[8],Ue=a[9],Pe=a[10],Oe=a[11],Ve=a[12],Fe=a[13],Ke=a[14],Me=a[15];r=t[0],s+=r*ve,i+=r*me,o+=r*Ee,u+=r*Ne,l+=r*we,c+=r*Re,f+=r*Le,g+=r*ke,v+=r*De,y+=r*Ue,x+=r*Pe,S+=r*Oe,A+=r*Ve,B+=r*Fe,b+=r*Ke,O+=r*Me,r=t[1],i+=r*ve,o+=r*me,u+=r*Ee,l+=r*Ne,c+=r*we,f+=r*Re,g+=r*Le,v+=r*ke,y+=r*De,x+=r*Ue,S+=r*Pe,A+=r*Oe,B+=r*Ve,b+=r*Fe,O+=r*Ke,k+=r*Me,r=t[2],o+=r*ve,u+=r*me,l+=r*Ee,c+=r*Ne,f+=r*we,g+=r*Re,v+=r*Le,y+=r*ke,x+=r*De,S+=r*Ue,A+=r*Pe,B+=r*Oe,b+=r*Ve,O+=r*Fe,k+=r*Ke,R+=r*Me,r=t[3],u+=r*ve,l+=r*me,c+=r*Ee,f+=r*Ne,g+=r*we,v+=r*Re,y+=r*Le,x+=r*ke,S+=r*De,A+=r*Ue,B+=r*Pe,b+=r*Oe,O+=r*Ve,k+=r*Fe,R+=r*Ke,z+=r*Me,r=t[4],l+=r*ve,c+=r*me,f+=r*Ee,g+=r*Ne,v+=r*we,y+=r*Re,x+=r*Le,S+=r*ke,A+=r*De,B+=r*Ue,b+=r*Pe,O+=r*Oe,k+=r*Ve,R+=r*Fe,z+=r*Ke,Y+=r*Me,r=t[5],c+=r*ve,f+=r*me,g+=r*Ee,v+=r*Ne,y+=r*we,x+=r*Re,S+=r*Le,A+=r*ke,B+=r*De,b+=r*Ue,O+=r*Pe,k+=r*Oe,R+=r*Ve,z+=r*Fe,Y+=r*Ke,ne+=r*Me,r=t[6],f+=r*ve,g+=r*me,v+=r*Ee,y+=r*Ne,x+=r*we,S+=r*Re,A+=r*Le,B+=r*ke,b+=r*De,O+=r*Ue,k+=r*Pe,R+=r*Oe,z+=r*Ve,Y+=r*Fe,ne+=r*Ke,ie+=r*Me,r=t[7],g+=r*ve,v+=r*me,y+=r*Ee,x+=r*Ne,S+=r*we,A+=r*Re,B+=r*Le,b+=r*ke,O+=r*De,k+=r*Ue,R+=r*Pe,z+=r*Oe,Y+=r*Ve,ne+=r*Fe,ie+=r*Ke,ue+=r*Me,r=t[8],v+=r*ve,y+=r*me,x+=r*Ee,S+=r*Ne,A+=r*we,B+=r*Re,b+=r*Le,O+=r*ke,k+=r*De,R+=r*Ue,z+=r*Pe,Y+=r*Oe,ne+=r*Ve,ie+=r*Fe,ue+=r*Ke,fe+=r*Me,r=t[9],y+=r*ve,x+=r*me,S+=r*Ee,A+=r*Ne,B+=r*we,b+=r*Re,O+=r*Le,k+=r*ke,R+=r*De,z+=r*Ue,Y+=r*Pe,ne+=r*Oe,ie+=r*Ve,ue+=r*Fe,fe+=r*Ke,qe+=r*Me,r=t[10],x+=r*ve,S+=r*me,A+=r*Ee,B+=r*Ne,b+=r*we,O+=r*Re,k+=r*Le,R+=r*ke,z+=r*De,Y+=r*Ue,ne+=r*Pe,ie+=r*Oe,ue+=r*Ve,fe+=r*Fe,qe+=r*Ke,et+=r*Me,r=t[11],S+=r*ve,A+=r*me,B+=r*Ee,b+=r*Ne,O+=r*we,k+=r*Re,R+=r*Le,z+=r*ke,Y+=r*De,ne+=r*Ue,ie+=r*Pe,ue+=r*Oe,fe+=r*Ve,qe+=r*Fe,et+=r*Ke,se+=r*Me,r=t[12],A+=r*ve,B+=r*me,b+=r*Ee,O+=r*Ne,k+=r*we,R+=r*Re,z+=r*Le,Y+=r*ke,ne+=r*De,ie+=r*Ue,ue+=r*Pe,fe+=r*Oe,qe+=r*Ve,et+=r*Fe,se+=r*Ke,ye+=r*Me,r=t[13],B+=r*ve,b+=r*me,O+=r*Ee,k+=r*Ne,R+=r*we,z+=r*Re,Y+=r*Le,ne+=r*ke,ie+=r*De,ue+=r*Ue,fe+=r*Pe,qe+=r*Oe,et+=r*Ve,se+=r*Fe,ye+=r*Ke,K+=r*Me,r=t[14],b+=r*ve,O+=r*me,k+=r*Ee,R+=r*Ne,z+=r*we,Y+=r*Re,ne+=r*Le,ie+=r*ke,ue+=r*De,fe+=r*Ue,qe+=r*Pe,et+=r*Oe,se+=r*Ve,ye+=r*Fe,K+=r*Ke,Mt+=r*Me,r=t[15],O+=r*ve,k+=r*me,R+=r*Ee,z+=r*Ne,Y+=r*we,ne+=r*Re,ie+=r*Le,ue+=r*ke,fe+=r*De,qe+=r*Ue,et+=r*Pe,se+=r*Oe,ye+=r*Ve,K+=r*Fe,Mt+=r*Ke,rr+=r*Me,s+=38*k,i+=38*R,o+=38*z,u+=38*Y,l+=38*ne,c+=38*ie,f+=38*ue,g+=38*fe,v+=38*qe,y+=38*et,x+=38*se,S+=38*ye,A+=38*K,B+=38*Mt,b+=38*rr,n=1,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=f+n+65535,n=Math.floor(r/65536),f=r-n*65536,r=g+n+65535,n=Math.floor(r/65536),g=r-n*65536,r=v+n+65535,n=Math.floor(r/65536),v=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=x+n+65535,n=Math.floor(r/65536),x=r-n*65536,r=S+n+65535,n=Math.floor(r/65536),S=r-n*65536,r=A+n+65535,n=Math.floor(r/65536),A=r-n*65536,r=B+n+65535,n=Math.floor(r/65536),B=r-n*65536,r=b+n+65535,n=Math.floor(r/65536),b=r-n*65536,r=O+n+65535,n=Math.floor(r/65536),O=r-n*65536,s+=n-1+37*(n-1),n=1,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=f+n+65535,n=Math.floor(r/65536),f=r-n*65536,r=g+n+65535,n=Math.floor(r/65536),g=r-n*65536,r=v+n+65535,n=Math.floor(r/65536),v=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=x+n+65535,n=Math.floor(r/65536),x=r-n*65536,r=S+n+65535,n=Math.floor(r/65536),S=r-n*65536,r=A+n+65535,n=Math.floor(r/65536),A=r-n*65536,r=B+n+65535,n=Math.floor(r/65536),B=r-n*65536,r=b+n+65535,n=Math.floor(r/65536),b=r-n*65536,r=O+n+65535,n=Math.floor(r/65536),O=r-n*65536,s+=n-1+37*(n-1),e[0]=s,e[1]=i,e[2]=o,e[3]=u,e[4]=l,e[5]=c,e[6]=f,e[7]=g,e[8]=v,e[9]=y,e[10]=x,e[11]=S,e[12]=A,e[13]=B,e[14]=b,e[15]=O}});var ro=F((Yh,to)=>{var We=$();re();tt();br();to.exports=We.kem=We.kem||{};var Zs=We.jsbn.BigInteger;We.kem.rsa={};We.kem.rsa.create=function(e,t){t=t||{};var a=t.prng||We.random,r={};return r.encrypt=function(n,s){var i=Math.ceil(n.n.bitLength()/8),o;do o=new Zs(We.util.bytesToHex(a.getBytesSync(i)),16).mod(n.n);while(o.compareTo(Zs.ONE)<=0);o=We.util.hexToBytes(o.toString(16));var u=i-o.length;u>0&&(o=We.util.fillString("\0",u)+o);var l=n.encrypt(o,"NONE"),c=e.generate(o,s);return{encapsulation:l,key:c}},r.decrypt=function(n,s,i){var o=n.decrypt(s,"NONE");return e.generate(o,i)},r};We.kem.kdf1=function(e,t){eo(this,e,0,t||e.digestLength)};We.kem.kdf2=function(e,t){eo(this,e,1,t||e.digestLength)};function eo(e,t,a,r){e.generate=function(n,s){for(var i=new We.util.ByteBuffer,o=Math.ceil(s/r)+a,u=new We.util.ByteBuffer,l=a;l<o;++l){u.putInt32(l),t.start(),t.update(n+u.getBytes());var c=t.digest();i.putBytes(c.getBytes(r))}return i.truncate(i.length()-s),i.getBytes()}}});var so=F((jh,io)=>{var J=$();re();io.exports=J.log=J.log||{};J.log.levels=["none","error","warning","info","debug","verbose","max"];var ya={},Rn=[],Ur=null;J.log.LEVEL_LOCKED=2;J.log.NO_LEVEL_CHECK=4;J.log.INTERPOLATE=8;for(Et=0;Et<J.log.levels.length;++Et)Nn=J.log.levels[Et],ya[Nn]={index:Et,name:Nn.toUpperCase()};var Nn,Et;J.log.logMessage=function(e){for(var t=ya[e.level].index,a=0;a<Rn.length;++a){var r=Rn[a];if(r.flags&J.log.NO_LEVEL_CHECK)r.f(e);else{var n=ya[r.level].index;t<=n&&r.f(r,e)}}};J.log.prepareStandard=function(e){"standard"in e||(e.standard=ya[e.level].name+" ["+e.category+"] "+e.message)};J.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=J.util.format.apply(this,t)}};J.log.prepareStandardFull=function(e){"standardFull"in e||(J.log.prepareStandard(e),e.standardFull=e.standard)};for(wn=["error","warning","info","debug","verbose"],Et=0;Et<wn.length;++Et)(function(t){J.log[t]=function(a,r){var n=Array.prototype.slice.call(arguments).slice(2),s={timestamp:new Date,level:t,category:a,message:r,arguments:n};J.log.logMessage(s)}})(wn[Et]);var wn,Et;J.log.makeLogger=function(e){var t={flags:0,f:e};return J.log.setLevel(t,"none"),t};J.log.setLevel=function(e,t){var a=!1;if(e&&!(e.flags&J.log.LEVEL_LOCKED))for(var r=0;r<J.log.levels.length;++r){var n=J.log.levels[r];if(t==n){e.level=t,a=!0;break}}return a};J.log.lock=function(e,t){typeof t>"u"||t?e.flags|=J.log.LEVEL_LOCKED:e.flags&=~J.log.LEVEL_LOCKED};J.log.addLogger=function(e){Rn.push(e)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(ao={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},Pr=function(e,t){J.log.prepareStandard(t);var a=ao[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),a.apply(console,r)},vr=J.log.makeLogger(Pr)):(Pr=function(t,a){J.log.prepareStandardFull(a),console.log(a.standardFull)},vr=J.log.makeLogger(Pr)),J.log.setLevel(vr,"debug"),J.log.addLogger(vr),Ur=vr):console={log:function(){}};var vr,ao,Pr;Ur!==null&&typeof window<"u"&&window.location&&(Dr=new URL(window.location.href).searchParams,Dr.has("console.level")&&J.log.setLevel(Ur,Dr.get("console.level").slice(-1)[0]),Dr.has("console.lock")&&(no=Dr.get("console.lock").slice(-1)[0],no=="true"&&J.log.lock(Ur)));var Dr,no;J.log.consoleLogger=Ur});var uo=F((Wh,oo)=>{oo.exports=dt();jr();cr();Ga();En()});var fo=F((Xh,co)=>{var D=$();wt();lt();Ir();Rt();Qt();nn();tt();re();la();var C=D.asn1,Qe=co.exports=D.pkcs7=D.pkcs7||{};Qe.messageFromPem=function(e){var t=D.pem.decode(e)[0];if(t.type!=="PKCS7"){var a=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=C.fromDer(t.body);return Qe.messageFromAsn1(r)};Qe.messageToPem=function(e,t){var a={type:"PKCS7",body:C.toDer(e.toAsn1()).getBytes()};return D.pem.encode(a,{maxline:t})};Qe.messageFromAsn1=function(e){var t={},a=[];if(!C.validate(e,Qe.asn1.contentInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=a,r}var n=C.derToOid(t.contentType),s;switch(n){case D.pki.oids.envelopedData:s=Qe.createEnvelopedData();break;case D.pki.oids.encryptedData:s=Qe.createEncryptedData();break;case D.pki.oids.signedData:s=Qe.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+n+" is not (yet) supported.")}return s.fromAsn1(t.content.value[0]),s};Qe.createSignedData=function(){var e=null;return e={type:D.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(kn(e,r,Qe.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,s=0;s<n.length;++s)e.certificates.push(D.pki.certificateFromAsn1(n[s]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],n=0;n<e.certificates.length;++n)r.push(D.pki.certificateToAsn1(e.certificates[n]));var s=[],i=C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(e.version).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&i.value[0].value.push(C.create(C.Class.CONTEXT_SPECIFIC,0,!0,r)),s.length>0&&i.value[0].value.push(C.create(C.Class.CONTEXT_SPECIFIC,1,!0,s)),i.value[0].value.push(C.create(C.Class.UNIVERSAL,C.Type.SET,!0,e.signerInfos)),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.type).getBytes()),i])},addSigner:function(r){var n=r.issuer,s=r.serialNumber;if(r.certificate){var i=r.certificate;typeof i=="string"&&(i=D.pki.certificateFromPem(i)),n=i.issuer.attributes,s=i.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=D.pki.privateKeyFromPem(o));var u=r.digestAlgorithm||D.pki.oids.sha1;switch(u){case D.pki.oids.sha1:case D.pki.oids.sha256:case D.pki.oids.sha384:case D.pki.oids.sha512:case D.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var l=r.authenticatedAttributes||[];if(l.length>0){for(var c=!1,f=!1,g=0;g<l.length;++g){var v=l[g];if(!c&&v.type===D.pki.oids.contentType){if(c=!0,f)break;continue}if(!f&&v.type===D.pki.oids.messageDigest){if(f=!0,c)break;continue}}if(!c||!f)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:n,serialNumber:s,digestAlgorithm:u,signatureAlgorithm:D.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(D.pki.oids.data).getBytes())]),"content"in e)){var n;e.content instanceof D.util.ByteBuffer?n=e.content.bytes():typeof e.content=="string"&&(n=D.util.encodeUtf8(e.content)),r.detached?e.detachedContent=C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,n)]))}if(e.signers.length!==0){var s=t();a(s)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=D.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},n=0;n<e.signers.length;++n){var s=e.signers[n],i=s.digestAlgorithm;i in r||(r[i]=D.md[D.pki.oids[i]].create()),s.authenticatedAttributes.length===0?s.md=r[i]:s.md=D.md[D.pki.oids[i]].create()}e.digestAlgorithmIdentifiers=[];for(var i in r)e.digestAlgorithmIdentifiers.push(C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(i).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.NULL,!1,"")]));return r}function a(r){var n;if(e.detachedContent?n=e.detachedContent:(n=e.contentInfo.value[1],n=n.value[0]),!n)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var s=C.derToOid(e.contentInfo.value[0].value),i=C.toDer(n);i.getByte(),C.getBerValueLength(i),i=i.getBytes();for(var o in r)r[o].start().update(i);for(var u=new Date,l=0;l<e.signers.length;++l){var c=e.signers[l];if(c.authenticatedAttributes.length===0){if(s!==D.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{c.authenticatedAttributesAsn1=C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=C.create(C.Class.UNIVERSAL,C.Type.SET,!0,[]),g=0;g<c.authenticatedAttributes.length;++g){var v=c.authenticatedAttributes[g];v.type===D.pki.oids.messageDigest?v.value=r[c.digestAlgorithm].digest():v.type===D.pki.oids.signingTime&&(v.value||(v.value=u)),f.value.push(Ln(v)),c.authenticatedAttributesAsn1.value.push(Ln(v))}i=C.toDer(f).getBytes(),c.md.start().update(i)}c.signature=c.key.sign(c.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=If(e.signers)}};Qe.createEncryptedData=function(){var e=null;return e={type:D.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:D.pki.oids["aes256-CBC"]},fromAsn1:function(t){kn(e,t,Qe.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),lo(e)}},e};Qe.createEnvelopedData=function(){var e=null;return e={type:D.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:D.pki.oids["aes256-CBC"]},fromAsn1:function(t){var a=kn(e,t,Qe.asn1.envelopedDataValidator);e.recipients=Sf(a.recipientInfos.value)},toAsn1:function(){return C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.type).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(e.version).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SET,!0,Tf(e.recipients)),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,Bf(e.encryptedContent))])])])},findRecipient:function(t){for(var a=t.issuer.attributes,r=0;r<e.recipients.length;++r){var n=e.recipients[r],s=n.issuer;if(n.serialNumber===t.serialNumber&&s.length===a.length){for(var i=!0,o=0;o<a.length;++o)if(s[o].type!==a[o].type||s[o].value!==a[o].value){i=!1;break}if(i)return n}}return null},decrypt:function(t,a){if(e.encryptedContent.key===void 0&&t!==void 0&&a!==void 0)switch(t.encryptedContent.algorithm){case D.pki.oids.rsaEncryption:case D.pki.oids.desCBC:var r=a.decrypt(t.encryptedContent.content);e.encryptedContent.key=D.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}lo(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:D.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,a){if(e.encryptedContent.content===void 0){a=a||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,n,s;switch(a){case D.pki.oids["aes128-CBC"]:r=16,n=16,s=D.aes.createEncryptionCipher;break;case D.pki.oids["aes192-CBC"]:r=24,n=16,s=D.aes.createEncryptionCipher;break;case D.pki.oids["aes256-CBC"]:r=32,n=16,s=D.aes.createEncryptionCipher;break;case D.pki.oids["des-EDE3-CBC"]:r=24,n=8,s=D.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+a)}if(t===void 0)t=D.util.createBuffer(D.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=a,e.encryptedContent.key=t,e.encryptedContent.parameter=D.util.createBuffer(D.random.getBytes(n));var i=s(t);if(i.start(e.encryptedContent.parameter.copy()),i.update(e.content),!i.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=i.output}for(var o=0;o<e.recipients.length;++o){var u=e.recipients[o];if(u.encryptedContent.content===void 0)switch(u.encryptedContent.algorithm){case D.pki.oids.rsaEncryption:u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm)}}}},e};function Ef(e){var t={},a=[];if(!C.validate(e,Qe.asn1.recipientInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=a,r}return{version:t.version.charCodeAt(0),issuer:D.pki.RDNAttributesAsArray(t.issuer),serialNumber:D.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:C.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function xf(e){return C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(e.version).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[D.pki.distinguishedNameToAsn1({attributes:e.issuer}),C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,D.util.hexToBytes(e.serialNumber))]),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.encryptedContent.algorithm).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.NULL,!1,"")]),C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function Sf(e){for(var t=[],a=0;a<e.length;++a)t.push(Ef(e[a]));return t}function Tf(e){for(var t=[],a=0;a<e.length;++a)t.push(xf(e[a]));return t}function Af(e){var t=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(e.version).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[D.pki.distinguishedNameToAsn1({attributes:e.issuer}),C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,D.util.hexToBytes(e.serialNumber))]),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.digestAlgorithm).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.signatureAlgorithm).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.NULL,!1,"")])),t.value.push(C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var a=C.create(C.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var n=e.unauthenticatedAttributes[r];a.values.push(Ln(n))}t.value.push(a)}return t}function If(e){for(var t=[],a=0;a<e.length;++a)t.push(Af(e[a]));return t}function Ln(e){var t;if(e.type===D.pki.oids.contentType)t=C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.value).getBytes());else if(e.type===D.pki.oids.messageDigest)t=C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===D.pki.oids.signingTime){var a=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),n=e.value;if(typeof n=="string"){var s=Date.parse(n);isNaN(s)?n.length===13?n=C.utcTimeToDate(n):n=C.generalizedTimeToDate(n):n=new Date(s)}n>=a&&n<r?t=C.create(C.Class.UNIVERSAL,C.Type.UTCTIME,!1,C.dateToUtcTime(n)):t=C.create(C.Class.UNIVERSAL,C.Type.GENERALIZEDTIME,!1,C.dateToGeneralizedTime(n))}return C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.type).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SET,!0,[t])])}function Bf(e){return[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(D.pki.oids.data).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(e.algorithm).getBytes()),e.parameter?C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,e.content.getBytes())])]}function kn(e,t,a){var r={},n=[];if(!C.validate(t,a,r,n)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}var i=C.derToOid(r.contentType);if(i!==D.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var o="";if(D.util.isArray(r.encryptedContent))for(var u=0;u<r.encryptedContent.length;++u){if(r.encryptedContent[u].type!==C.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=r.encryptedContent[u].value}else o=r.encryptedContent;e.encryptedContent={algorithm:C.derToOid(r.encAlgorithm),parameter:D.util.createBuffer(r.encParameter.value),content:D.util.createBuffer(o)}}if(r.content){var o="";if(D.util.isArray(r.content))for(var u=0;u<r.content.length;++u){if(r.content[u].type!==C.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=r.content[u].value}else o=r.content;e.content=D.util.createBuffer(o)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function lo(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case D.pki.oids["aes128-CBC"]:case D.pki.oids["aes192-CBC"]:case D.pki.oids["aes256-CBC"]:t=D.aes.createDecryptionCipher(e.encryptedContent.key);break;case D.pki.oids.desCBC:case D.pki.oids["des-EDE3-CBC"]:t=D.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}});var po=F((Jh,ho)=>{var Ce=$();wt();sr();jr();cr();re();var ma=ho.exports=Ce.ssh=Ce.ssh||{};ma.privateKeyToPutty=function(e,t,a){a=a||"",t=t||"";var r="ssh-rsa",n=t===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+r+`\r
|
|
18
|
-
`;s+="Encryption: "+n+`\r
|
|
19
|
-
|
|
20
|
-
`;var i=Ce.util.createBuffer();mr(i,r),xt(i,e.e),xt(i,e.n);var o=Ce.util.encode64(i.bytes(),64),u=Math.floor(o.length/66)+1;s+="Public-Lines: "+u+`\r
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Private-MAC: `+B.digest().toHex()+`\r
|
|
25
|
-
`,s};ma.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=Ce.util.createBuffer();return mr(r,a),xt(r,e.e),xt(r,e.n),a+" "+Ce.util.encode64(r.bytes())+" "+t};ma.privateKeyToOpenSSH=function(e,t){return t?Ce.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Ce.pki.privateKeyToPem(e)};ma.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||Ce.md.md5.create(),r="ssh-rsa",n=Ce.util.createBuffer();mr(n,r),xt(n,e.e),xt(n,e.n),a.start(),a.update(n.getBytes());var s=a.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function xt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=Ce.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function mr(e,t){e.putInt32(t.length),e.putString(t)}function va(){for(var e=Ce.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}});var yo=F((Zh,go)=>{go.exports=$();wt();Ds();lt();qr();Ir();Js();sr();ro();so();uo();sn();Zr();Qt();Za();ln();fo();fn();tn();za();sa();tt();Ya();po();vn();re()});var Eo=F((ep,Co)=>{var vo=require("path"),Xe=require("fs"),Je=yo(),{MITM_DIR:Ca}=ar(),Ft=vo.join(Ca,"rootCA.key"),Bt=vo.join(Ca,"rootCA.crt");function mo(e){try{let t=Je.pki.certificateFromPem(Xe.readFileSync(e,"utf8")),a=new Date(Date.now()+720*60*60*1e3);return t.validity.notAfter<a}catch{return!0}}function bf(){let e=Xe.existsSync(Ft)&&Xe.existsSync(Bt);if(e&&!mo(Bt))return console.log("\u2705 Root CA already exists"),{key:Ft,cert:Bt};if(e){console.log("\u{1F510} Root CA expired or expiring soon \u2014 regenerating...");try{Xe.unlinkSync(Ft)}catch{}try{Xe.unlinkSync(Bt)}catch{}}Xe.existsSync(Ca)||Xe.mkdirSync(Ca,{recursive:!0}),console.log("\u{1F510} Generating Root CA certificate...");let t=Je.pki.rsa.generateKeyPair(2048),a=Je.pki.createCertificate();a.publicKey=t.publicKey,a.serialNumber="01",a.validity.notBefore=new Date,a.validity.notAfter=new Date,a.validity.notAfter.setFullYear(a.validity.notBefore.getFullYear()+10);let r=[{name:"commonName",value:"9Router MITM Root CA"},{name:"organizationName",value:"9Router"},{name:"countryName",value:"US"}];a.setSubject(r),a.setIssuer(r),a.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",keyCertSign:!0,cRLSign:!0,critical:!0},{name:"subjectKeyIdentifier"}]),a.sign(t.privateKey,Je.md.sha256.create());let n=Je.pki.privateKeyToPem(t.privateKey),s=Je.pki.certificateToPem(a);return Xe.writeFileSync(Ft,n),Xe.writeFileSync(Bt,s),console.log("\u2705 Root CA generated successfully"),{key:Ft,cert:Bt}}function _f(){if(!Xe.existsSync(Ft)||!Xe.existsSync(Bt))throw new Error("Root CA not found. Generate it first.");let e=Xe.readFileSync(Ft,"utf8"),t=Xe.readFileSync(Bt,"utf8");return{key:Je.pki.privateKeyFromPem(e),cert:Je.pki.certificateFromPem(t)}}function Nf(e,t){let a=Je.pki.rsa.generateKeyPair(2048),r=Je.pki.createCertificate();return r.publicKey=a.publicKey,r.serialNumber=Math.floor(Math.random()*1e6).toString(),r.validity.notBefore=new Date,r.validity.notAfter=new Date,r.validity.notAfter.setFullYear(r.validity.notBefore.getFullYear()+1),r.setSubject([{name:"commonName",value:e}]),r.setIssuer(t.cert.subject.attributes),r.setExtensions([{name:"basicConstraints",cA:!1},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0},{name:"subjectAltName",altNames:[{type:2,value:e},{type:2,value:`*.${e}`}]}]),r.sign(t.key,Je.md.sha256.create()),{key:Je.pki.privateKeyToPem(a.privateKey),cert:Je.pki.certificateToPem(r)}}Co.exports={generateRootCA:bf,loadRootCA:_f,generateLeafCert:Nf,isCertExpired:mo,ROOT_CA_CERT_PATH:Bt,ROOT_CA_KEY_PATH:Ft}});var So=F((np,xo)=>{var tp=require("path"),rp=require("fs"),{MITM_DIR:ap}=ar(),{generateRootCA:wf,loadRootCA:Rf,generateLeafCert:Lf}=Eo();function kf(){return wf()}function Df(e){try{let t=Rf(),a=Lf(e,t);return{key:a.key,cert:a.cert}}catch(t){return console.error(`Failed to generate cert for ${e}:`,t.message),null}}xo.exports={generateCert:kf,getCertForDomain:Df}});var Bo=F((ip,Io)=>{var To=require("fs"),Uf=require("path"),{DATA_DIR:Pf}=ar(),Ao=Uf.join(Pf,"mitm","aliases.json");function Of(){try{return To.existsSync(Ao)?JSON.parse(To.readFileSync(Ao,"utf-8")):null}catch{return null}}function Vf(e){return Of()?.[e]||null}Io.exports={getMitmAlias:Vf}});var No=F((sp,_o)=>{"use strict";var er="2.11.0";function Ff(e){return!e||typeof e!="object"||Array.isArray(e)?!1:String(e.ideName||"").toLowerCase()==="antigravity"||String(e.ideType||"").toUpperCase()==="ANTIGRAVITY"?!0:Object.prototype.hasOwnProperty.call(e,"ideVersion")}function bo(e,t){return typeof e!="string"||!e.includes("antigravity/")?e:e.replace(/antigravity\/[^\s]+/,`antigravity/${t}`)}function Kf(e,t,a){if(!(a?.includes(":generateContent")||a?.includes(":streamGenerateContent")))return{bodyBuffer:e,headers:t,applied:!1,version:er};let n={...t},s=bo(n["user-agent"],er),i=s!==n["user-agent"];i&&(n["user-agent"]=s);try{let o=JSON.parse(e.toString());return Ff(o?.metadata)?(o.metadata.ideVersion=er,{bodyBuffer:Buffer.from(JSON.stringify(o)),headers:n,applied:!0,version:er}):{bodyBuffer:e,headers:n,applied:i,version:er}}catch{return{bodyBuffer:e,headers:n,applied:i,version:er}}}_o.exports={ANTIGRAVITY_IDE_VERSION:er,applyAntigravityIdeVersionOverride:Kf,rewriteAntigravityUserAgent:bo}});var xa=F((up,Lo)=>{var{log:Ea,err:op}=Gt(),wo="http://localhost:20128",Mf=String(process.env.MITM_ROUTER_BASE||wo).trim().replace(/\/+$/,"")||wo,Ro=process.env.ROUTER_API_KEY,qf=new Set(["host","content-length","connection","transfer-encoding","content-type","authorization"]);async function Hf(e,t="/v1/chat/completions",a={}){let r={};for(let[s,i]of Object.entries(a))qf.has(s.toLowerCase())||(r[s]=i);return await fetch(`${Mf}${t}`,{method:"POST",headers:{...r,"Content-Type":"application/json",...Ro&&{Authorization:`Bearer ${Ro}`}},body:JSON.stringify(e)})}async function Gf(e,t,a){let r=e.headers.get("content-type")||"application/json",n=e.status||200,s={"Content-Type":r,"Cache-Control":"no-cache",Connection:"keep-alive"};if(r.includes("text/event-stream")&&(s["X-Accel-Buffering"]="no"),t.writeHead(n,s),a&&a.writeHeader(e.status,Object.fromEntries(e.headers)),!e.body){let u=await e.text().catch(()=>"");a&&(a.writeChunk(u),a.end()),t.end(u);return}let i=e.body.getReader(),o=new TextDecoder;for(;;){let{done:u,value:l}=await i.read();if(u){a&&a.end(),t.end();break}a&&a.writeChunk(l),t.write(o.decode(l,{stream:!0}))}}async function zf(e,t,a,r){let n=e.headers.get("content-type")||"application/json",s={"Content-Type":n,"Cache-Control":"no-cache",Connection:"keep-alive"};if(n.includes("text/event-stream")&&(s["X-Accel-Buffering"]="no"),t.writeHead(200,s),!e.body){t.end(await e.text().catch(()=>""));return}let i=e.body.getReader(),o=new TextDecoder("utf-8",{fatal:!1}),u="";for(;;){let{done:l,value:c}=await i.read();if(l)break;u+=o.decode(c,{stream:!0});let f=u.split(`
|
|
26
|
-
|
|
27
|
-
`)
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
${p}`;ei.writeFileSync(i,E)}catch{}},file:i}}GA.exports={log:bT,err:ST,dumpRequest:xT,createResponseDumper:TT,clearDumpDir:wT}});var zA=l(()=>{var WA;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),n=i(r);typeof t.Reflect<"u"&&(n=i(t.Reflect,n)),e(n,t),typeof t.Reflect>"u"&&(t.Reflect=r);function i(c,u){return function(d,p){Object.defineProperty(c,d,{configurable:!0,writable:!0,value:p}),u&&u(d,p)}}function s(){try{return Function("return this;")()}catch{}}function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}function a(){return s()||o()}})(function(e,t){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!a&&!c,d={create:a?function(){return Zh(Object.create(null))}:c?function(){return Zh({__proto__:null})}:function(){return Zh({})},has:u?function(h,y){return n.call(h,y)}:function(h,y){return y in h},get:u?function(h,y){return n.call(h,y)?h[y]:void 0}:function(h,y){return h[y]}},p=Object.getPrototypeOf(Function),_=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Xx(),E=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Yx(),U=typeof WeakMap=="function"?WeakMap:Zx(),$=i?Symbol.for("@reflect-metadata:registry"):void 0,L=Wx(),Be=zx(L);function Ar(h,y,A,T){if(H(A)){if(!Kl(h))throw new TypeError;if(!Qn(y))throw new TypeError;return xA(h,y)}else{if(!Kl(h))throw new TypeError;if(!pe(y))throw new TypeError;if(!pe(T)&&!H(T)&&!An(T))throw new TypeError;return An(T)&&(T=void 0),A=Mt(A),TA(h,y,A,T)}}e("decorate",Ar);function Sa(h,y){function A(T,D){if(!pe(T))throw new TypeError;if(!H(D)&&!Kx(D))throw new TypeError;Ll(h,y,T,D)}return A}e("metadata",Sa);function Ml(h,y,A,T){if(!pe(A))throw new TypeError;return H(T)||(T=Mt(T)),Ll(h,y,A,T)}e("defineMetadata",Ml);function Kh(h,y,A){if(!pe(y))throw new TypeError;return H(A)||(A=Mt(A)),Ue(h,y,A)}e("hasMetadata",Kh);function wa(h,y,A){if(!pe(y))throw new TypeError;return H(A)||(A=Mt(A)),Zn(h,y,A)}e("hasOwnMetadata",wa);function Gh(h,y,A){if(!pe(y))throw new TypeError;return H(A)||(A=Mt(A)),Ca(h,y,A)}e("getMetadata",Gh);function Wh(h,y,A){if(!pe(y))throw new TypeError;return H(A)||(A=Mt(A)),$l(h,y,A)}e("getOwnMetadata",Wh);function Ps(h,y){if(!pe(h))throw new TypeError;return H(y)||(y=Mt(y)),Vl(h,y)}e("getMetadataKeys",Ps);function Dl(h,y){if(!pe(h))throw new TypeError;return H(y)||(y=Mt(y)),Hl(h,y)}e("getOwnMetadataKeys",Dl);function Ul(h,y,A){if(!pe(y))throw new TypeError;if(H(A)||(A=Mt(A)),!pe(y))throw new TypeError;H(A)||(A=Mt(A));var T=xa(y,A,!1);return H(T)?!1:T.OrdinaryDeleteMetadata(h,y,A)}e("deleteMetadata",Ul);function xA(h,y){for(var A=h.length-1;A>=0;--A){var T=h[A],D=T(y);if(!H(D)&&!An(D)){if(!Qn(D))throw new TypeError;y=D}}return y}function TA(h,y,A,T){for(var D=h.length-1;D>=0;--D){var Oe=h[D],$e=Oe(y,A,T);if(!H($e)&&!An($e)){if(!pe($e))throw new TypeError;T=$e}}return T}function Ue(h,y,A){var T=Zn(h,y,A);if(T)return!0;var D=Yh(y);return An(D)?!1:Ue(h,D,A)}function Zn(h,y,A){var T=xa(y,A,!1);return H(T)?!1:Fl(T.OrdinaryHasOwnMetadata(h,y,A))}function Ca(h,y,A){var T=Zn(h,y,A);if(T)return $l(h,y,A);var D=Yh(y);if(!An(D))return Ca(h,D,A)}function $l(h,y,A){var T=xa(y,A,!1);if(!H(T))return T.OrdinaryGetOwnMetadata(h,y,A)}function Ll(h,y,A,T){var D=xa(A,T,!0);D.OrdinaryDefineOwnMetadata(h,y,A,T)}function Vl(h,y){var A=Hl(h,y),T=Yh(h);if(T===null)return A;var D=Vl(T,y);if(D.length<=0)return A;if(A.length<=0)return D;for(var Oe=new E,$e=[],J=0,k=A;J<k.length;J++){var N=k[J],R=Oe.has(N);R||(Oe.add(N),$e.push(N))}for(var M=0,Y=D;M<Y.length;M++){var N=Y[M],R=Oe.has(N);R||(Oe.add(N),$e.push(N))}return $e}function Hl(h,y){var A=xa(h,y,!1);return A?A.OrdinaryOwnMetadataKeys(h,y):[]}function xs(h){if(h===null)return 1;switch(typeof h){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return h===null?1:6;default:return 6}}function H(h){return h===void 0}function An(h){return h===null}function Pa(h){return typeof h=="symbol"}function pe(h){return typeof h=="object"?h!==null:typeof h=="function"}function Ts(h,y){switch(xs(h)){case 0:return h;case 1:return h;case 2:return h;case 3:return h;case 4:return h;case 5:return h}var A=y===3?"string":y===5?"number":"default",T=EA(h,s);if(T!==void 0){var D=T.call(h,A);if(pe(D))throw new TypeError;return D}return zh(h,A==="default"?"number":A)}function zh(h,y){if(y==="string"){var A=h.toString;if(bn(A)){var T=A.call(h);if(!pe(T))return T}var D=h.valueOf;if(bn(D)){var T=D.call(h);if(!pe(T))return T}}else{var D=h.valueOf;if(bn(D)){var T=D.call(h);if(!pe(T))return T}var Oe=h.toString;if(bn(Oe)){var T=Oe.call(h);if(!pe(T))return T}}throw new TypeError}function Fl(h){return!!h}function Jh(h){return""+h}function Mt(h){var y=Ts(h,3);return Pa(y)?y:Jh(y)}function Kl(h){return Array.isArray?Array.isArray(h):h instanceof Object?h instanceof Array:Object.prototype.toString.call(h)==="[object Array]"}function bn(h){return typeof h=="function"}function Qn(h){return typeof h=="function"}function Kx(h){switch(xs(h)){case 3:return!0;case 4:return!0;default:return!1}}function Xh(h,y){return h===y||h!==h&&y!==y}function EA(h,y){var A=h[y];if(A!=null){if(!bn(A))throw new TypeError;return A}}function IA(h){var y=EA(h,o);if(!bn(y))throw new TypeError;var A=y.call(h);if(!pe(A))throw new TypeError;return A}function kA(h){return h.value}function BA(h){var y=h.next();return y.done?!1:y}function OA(h){var y=h.return;y&&y.call(h)}function Yh(h){var y=Object.getPrototypeOf(h);if(typeof h!="function"||h===p||y!==p)return y;var A=h.prototype,T=A&&Object.getPrototypeOf(A);if(T==null||T===Object.prototype)return y;var D=T.constructor;return typeof D!="function"||D===h?y:D}function Gx(){var h;!H($)&&typeof t.Reflect<"u"&&!($ in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(h=Jx(t.Reflect));var y,A,T,D=new U,Oe={registerProvider:$e,getProvider:k,setProvider:R};return Oe;function $e(M){if(!Object.isExtensible(Oe))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case h===M:break;case H(y):y=M;break;case y===M:break;case H(A):A=M;break;case A===M:break;default:T===void 0&&(T=new E),T.add(M);break}}function J(M,Y){if(!H(y)){if(y.isProviderFor(M,Y))return y;if(!H(A)){if(A.isProviderFor(M,Y))return y;if(!H(T))for(var _e=IA(T);;){var je=BA(_e);if(!je)return;var Qt=kA(je);if(Qt.isProviderFor(M,Y))return OA(_e),Qt}}}if(!H(h)&&h.isProviderFor(M,Y))return h}function k(M,Y){var _e=D.get(M),je;return H(_e)||(je=_e.get(Y)),H(je)&&(je=J(M,Y),H(je)||(H(_e)&&(_e=new _,D.set(M,_e)),_e.set(Y,je))),je}function N(M){if(H(M))throw new TypeError;return y===M||A===M||!H(T)&&T.has(M)}function R(M,Y,_e){if(!N(_e))throw new Error("Metadata provider not registered.");var je=k(M,Y);if(je!==_e){if(!H(je))return!1;var Qt=D.get(M);H(Qt)&&(Qt=new _,D.set(M,Qt)),Qt.set(Y,_e)}return!0}}function Wx(){var h;return!H($)&&pe(t.Reflect)&&Object.isExtensible(t.Reflect)&&(h=t.Reflect[$]),H(h)&&(h=Gx()),!H($)&&pe(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,$,{enumerable:!1,configurable:!1,writable:!1,value:h}),h}function zx(h){var y=new U,A={isProviderFor:function(N,R){var M=y.get(N);return H(M)?!1:M.has(R)},OrdinaryDefineOwnMetadata:$e,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:Oe,OrdinaryOwnMetadataKeys:J,OrdinaryDeleteMetadata:k};return L.registerProvider(A),A;function T(N,R,M){var Y=y.get(N),_e=!1;if(H(Y)){if(!M)return;Y=new _,y.set(N,Y),_e=!0}var je=Y.get(R);if(H(je)){if(!M)return;if(je=new _,Y.set(R,je),!h.setProvider(N,R,A))throw Y.delete(R),_e&&y.delete(N),new Error("Wrong provider for target.")}return je}function D(N,R,M){var Y=T(R,M,!1);return H(Y)?!1:Fl(Y.has(N))}function Oe(N,R,M){var Y=T(R,M,!1);if(!H(Y))return Y.get(N)}function $e(N,R,M,Y){var _e=T(M,Y,!0);_e.set(N,R)}function J(N,R){var M=[],Y=T(N,R,!1);if(H(Y))return M;for(var _e=Y.keys(),je=IA(_e),Qt=0;;){var jA=BA(je);if(!jA)return M.length=Qt,M;var Qx=kA(jA);try{M[Qt]=Qx}catch(eT){try{OA(je)}finally{throw eT}}Qt++}}function k(N,R,M){var Y=T(R,M,!1);if(H(Y)||!Y.delete(N))return!1;if(Y.size===0){var _e=y.get(R);H(_e)||(_e.delete(M),_e.size===0&&y.delete(_e))}return!0}}function Jx(h){var y=h.defineMetadata,A=h.hasOwnMetadata,T=h.getOwnMetadata,D=h.getOwnMetadataKeys,Oe=h.deleteMetadata,$e=new U,J={isProviderFor:function(k,N){var R=$e.get(k);return!H(R)&&R.has(N)?!0:D(k,N).length?(H(R)&&(R=new E,$e.set(k,R)),R.add(N),!0):!1},OrdinaryDefineOwnMetadata:y,OrdinaryHasOwnMetadata:A,OrdinaryGetOwnMetadata:T,OrdinaryOwnMetadataKeys:D,OrdinaryDeleteMetadata:Oe};return J}function xa(h,y,A){var T=L.getProvider(h,y);if(!H(T))return T;if(A){if(L.setProvider(h,y,Be))return Be;throw new Error("Illegal state.")}}function Xx(){var h={},y=[],A=(function(){function J(k,N,R){this._index=0,this._keys=k,this._values=N,this._selector=R}return J.prototype["@@iterator"]=function(){return this},J.prototype[o]=function(){return this},J.prototype.next=function(){var k=this._index;if(k>=0&&k<this._keys.length){var N=this._selector(this._keys[k],this._values[k]);return k+1>=this._keys.length?(this._index=-1,this._keys=y,this._values=y):this._index++,{value:N,done:!1}}return{value:void 0,done:!0}},J.prototype.throw=function(k){throw this._index>=0&&(this._index=-1,this._keys=y,this._values=y),k},J.prototype.return=function(k){return this._index>=0&&(this._index=-1,this._keys=y,this._values=y),{value:k,done:!0}},J})(),T=(function(){function J(){this._keys=[],this._values=[],this._cacheKey=h,this._cacheIndex=-2}return Object.defineProperty(J.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),J.prototype.has=function(k){return this._find(k,!1)>=0},J.prototype.get=function(k){var N=this._find(k,!1);return N>=0?this._values[N]:void 0},J.prototype.set=function(k,N){var R=this._find(k,!0);return this._values[R]=N,this},J.prototype.delete=function(k){var N=this._find(k,!1);if(N>=0){for(var R=this._keys.length,M=N+1;M<R;M++)this._keys[M-1]=this._keys[M],this._values[M-1]=this._values[M];return this._keys.length--,this._values.length--,Xh(k,this._cacheKey)&&(this._cacheKey=h,this._cacheIndex=-2),!0}return!1},J.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=h,this._cacheIndex=-2},J.prototype.keys=function(){return new A(this._keys,this._values,D)},J.prototype.values=function(){return new A(this._keys,this._values,Oe)},J.prototype.entries=function(){return new A(this._keys,this._values,$e)},J.prototype["@@iterator"]=function(){return this.entries()},J.prototype[o]=function(){return this.entries()},J.prototype._find=function(k,N){if(!Xh(this._cacheKey,k)){this._cacheIndex=-1;for(var R=0;R<this._keys.length;R++)if(Xh(this._keys[R],k)){this._cacheIndex=R;break}}return this._cacheIndex<0&&N&&(this._cacheIndex=this._keys.length,this._keys.push(k),this._values.push(void 0)),this._cacheIndex},J})();return T;function D(J,k){return J}function Oe(J,k){return k}function $e(J,k){return[J,k]}}function Yx(){var h=(function(){function y(){this._map=new _}return Object.defineProperty(y.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),y.prototype.has=function(A){return this._map.has(A)},y.prototype.add=function(A){return this._map.set(A,A),this},y.prototype.delete=function(A){return this._map.delete(A)},y.prototype.clear=function(){this._map.clear()},y.prototype.keys=function(){return this._map.keys()},y.prototype.values=function(){return this._map.keys()},y.prototype.entries=function(){return this._map.entries()},y.prototype["@@iterator"]=function(){return this.keys()},y.prototype[o]=function(){return this.keys()},y})();return h}function Zx(){var h=16,y=d.create(),A=T();return(function(){function k(){this._key=T()}return k.prototype.has=function(N){var R=D(N,!1);return R!==void 0?d.has(R,this._key):!1},k.prototype.get=function(N){var R=D(N,!1);return R!==void 0?d.get(R,this._key):void 0},k.prototype.set=function(N,R){var M=D(N,!0);return M[this._key]=R,this},k.prototype.delete=function(N){var R=D(N,!1);return R!==void 0?delete R[this._key]:!1},k.prototype.clear=function(){this._key=T()},k})();function T(){var k;do k="@@WeakMap@@"+J();while(d.has(y,k));return y[k]=!0,k}function D(k,N){if(!n.call(k,A)){if(!N)return;Object.defineProperty(k,A,{value:d.create()})}return k[A]}function Oe(k,N){for(var R=0;R<N;++R)k[R]=Math.random()*255|0;return k}function $e(k){if(typeof Uint8Array=="function"){var N=new Uint8Array(k);return typeof crypto<"u"?crypto.getRandomValues(N):typeof msCrypto<"u"?msCrypto.getRandomValues(N):Oe(N,k),N}return Oe(new Array(k),k)}function J(){var k=$e(h);k[6]=k[6]&79|64,k[8]=k[8]&191|128;for(var N="",R=0;R<h;++R){var M=k[R];(R===4||R===6||R===8)&&(N+="-"),M<16&&(N+="0"),N+=M.toString(16).toLowerCase()}return N}}function Zh(h){return h.__=void 0,delete h.__,h}})})(WA||(WA={}))});var v={};qA(v,{__addDisposableResource:()=>mb,__assign:()=>zl,__asyncDelegator:()=>fb,__asyncGenerator:()=>lb,__asyncValues:()=>db,__await:()=>Is,__awaiter:()=>ib,__classPrivateFieldGet:()=>_b,__classPrivateFieldIn:()=>vb,__classPrivateFieldSet:()=>gb,__createBinding:()=>Xl,__decorate:()=>YA,__disposeResources:()=>Ab,__esDecorate:()=>QA,__exportStar:()=>ob,__extends:()=>JA,__generator:()=>sb,__importDefault:()=>yb,__importStar:()=>hb,__makeTemplateObject:()=>pb,__metadata:()=>nb,__param:()=>ZA,__propKey:()=>tb,__read:()=>iy,__rest:()=>XA,__rewriteRelativeImportExtension:()=>bb,__runInitializers:()=>eb,__setFunctionName:()=>rb,__spread:()=>ab,__spreadArray:()=>ub,__spreadArrays:()=>cb,__values:()=>Jl,default:()=>kT});function JA(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ry(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function XA(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function YA(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function ZA(r,e){return function(t,n){e(t,n,r)}}function QA(r,e,t,n,i,s){function o(Be){if(Be!==void 0&&typeof Be!="function")throw new TypeError("Function expected");return Be}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&r?n.static?r:r.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p,_=!1,E=t.length-1;E>=0;E--){var U={};for(var $ in n)U[$]=$==="access"?{}:n[$];for(var $ in n.access)U.access[$]=n.access[$];U.addInitializer=function(Be){if(_)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(Be||null))};var L=(0,t[E])(a==="accessor"?{get:d.get,set:d.set}:d[c],U);if(a==="accessor"){if(L===void 0)continue;if(L===null||typeof L!="object")throw new TypeError("Object expected");(p=o(L.get))&&(d.get=p),(p=o(L.set))&&(d.set=p),(p=o(L.init))&&i.unshift(p)}else(p=o(L))&&(a==="field"?i.unshift(p):d[c]=p)}u&&Object.defineProperty(u,n.name,d),_=!0}function eb(r,e,t){for(var n=arguments.length>2,i=0;i<e.length;i++)t=n?e[i].call(r,t):e[i].call(r);return n?t:void 0}function tb(r){return typeof r=="symbol"?r:"".concat(r)}function rb(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function nb(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function ib(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{u(n.next(d))}catch(p){o(p)}}function c(d){try{u(n.throw(d))}catch(p){o(p)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function sb(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ob(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Xl(e,r,t)}function Jl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function iy(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s}function ab(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(iy(arguments[e]));return r}function cb(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ub(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}function Is(r){return this instanceof Is?(this.v=r,this):new Is(r)}function lb(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(E){return function(U){return Promise.resolve(U).then(E,p)}}function a(E,U){n[E]&&(i[E]=function($){return new Promise(function(L,Be){s.push([E,$,L,Be])>1||c(E,$)})},U&&(i[E]=U(i[E])))}function c(E,U){try{u(n[E](U))}catch($){_(s[0][3],$)}}function u(E){E.value instanceof Is?Promise.resolve(E.value.v).then(d,p):_(s[0][2],E)}function d(E){c("next",E)}function p(E){c("throw",E)}function _(E,U){E(U),s.shift(),s.length&&c(s[0][0],s[0][1])}}function fb(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=r[i]?function(o){return(t=!t)?{value:Is(r[i](o)),done:!1}:s?s(o):o}:s}}function db(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Jl=="function"?Jl(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function pb(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function hb(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t=ny(r),n=0;n<t.length;n++)t[n]!=="default"&&Xl(e,r,t[n]);return ET(e,r),e}function yb(r){return r&&r.__esModule?r:{default:r}}function _b(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function gb(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}function vb(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function mb(r,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],t&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),r.stack.push({value:e,dispose:n,async:t})}else t&&r.stack.push({async:!0});return e}function Ab(r){function e(s){r.error=r.hasError?new IT(s,r.error,"An error was suppressed during disposal."):s,r.hasError=!0}var t,n=0;function i(){for(;t=r.stack.pop();)try{if(!t.async&&n===1)return n=0,r.stack.push(t),Promise.resolve().then(i);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return n|=2,Promise.resolve(s).then(i,function(o){return e(o),i()})}else n|=1}catch(o){e(o)}if(n===1)return r.hasError?Promise.reject(r.error):Promise.resolve();if(r.hasError)throw r.error}return i()}function bb(r,e){return typeof r=="string"&&/^\.\.?\//.test(r)?r.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,n,i,s,o){return n?e?".jsx":".js":i&&(!s||!o)?t:i+s+"."+o.toLowerCase()+"js"}):r}var ry,zl,Xl,ET,ny,IT,kT,m=NA(()=>{ry=function(r,e){return ry=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},ry(r,e)};zl=function(){return zl=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},zl.apply(this,arguments)};Xl=Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});ET=Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e},ny=function(r){return ny=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},ny(r)};IT=typeof SuppressedError=="function"?SuppressedError:function(r,e,t){var n=new Error(t);return n.name="SuppressedError",n.error=r,n.suppressed=e,n};kT={__extends:JA,__assign:zl,__rest:XA,__decorate:YA,__param:ZA,__esDecorate:QA,__runInitializers:eb,__propKey:tb,__setFunctionName:rb,__metadata:nb,__awaiter:ib,__generator:sb,__createBinding:Xl,__exportStar:ob,__values:Jl,__read:iy,__spread:ab,__spreadArrays:cb,__spreadArray:ub,__await:Is,__asyncGenerator:lb,__asyncDelegator:fb,__asyncValues:db,__makeTemplateObject:pb,__importStar:hb,__importDefault:yb,__classPrivateFieldGet:_b,__classPrivateFieldSet:gb,__classPrivateFieldIn:vb,__addDisposableResource:mb,__disposeResources:Ab,__rewriteRelativeImportExtension:bb}});var oy=l(ks=>{"use strict";var BT="[object ArrayBuffer]",zr=class r{static isArrayBuffer(e){return Object.prototype.toString.call(e)===BT}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=r.toUint8Array(e),i=r.toUint8Array(t);if(n.length!==i.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let o of t)n+=o.byteLength;let i=new Uint8Array(n),s=0;for(let o of t){let a=this.toUint8Array(o);i.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}},sy="string",OT=/^[0-9a-f\s]+$/i,jT=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,NT=/^[a-zA-Z0-9-_]+$/,Yl=class{static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n.buffer}static toString(e){let t=zr.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return decodeURIComponent(escape(n))}},Dt=class{static toString(e,t=!1){let n=zr.toArrayBuffer(e),i=new DataView(n),s="";for(let o=0;o<n.byteLength;o+=2){let a=i.getUint16(o,t);s+=String.fromCharCode(a)}return s}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),t);return n}},Zl=class r{static isHex(e){return typeof e===sy&&OT.test(e)}static isBase64(e){return typeof e===sy&&jT.test(e)}static isBase64Url(e){return typeof e===sy&&NT.test(e)}static ToString(e,t="utf8"){let n=zr.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Dt.toString(n,!0);case"utf16":case"utf16be":return Dt.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Dt.fromString(e,!0);case"utf16":case"utf16be":return Dt.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=zr.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Yl.fromString(e);case"utf16":case"utf16be":return Dt.fromString(e);case"utf16le":case"usc2":return Dt.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Yl.toString(e);case"utf16":case"utf16be":return Dt.toString(e);case"utf16le":case"usc2":return Dt.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let t=zr.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return n}static ToHex(e){let t=zr.toUint8Array(e),n="",i=t.length;for(let s=0;s<i;s++){let o=t[s];o<16&&(n+="0"),n+=o.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i=i+2){let s=t.slice(i,i+2);n[i/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,t=!1){return Dt.toString(e,t)}static FromUtf16String(e,t=!1){return Dt.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Zl.DEFAULT_UTF8_ENCODING="utf8";function qT(r,...e){let t=arguments[0];for(let n=1;n<arguments.length;n++){let i=arguments[n];for(let s in i)t[s]=i[s]}return t}function RT(...r){let e=r.map(i=>i.byteLength).reduce((i,s)=>i+s),t=new Uint8Array(e),n=0;return r.map(i=>new Uint8Array(i)).forEach(i=>{for(let s of i)t[n++]=s}),t.buffer}function MT(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)if(t[i]!==n[i])return!1;return!0}ks.BufferSourceConverter=zr;ks.Convert=Zl;ks.assign=qT;ks.combine=RT;ks.isEqual=MT});var Cb=l(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});function DT(r){return new Date(r.getTime()+r.getTimezoneOffset()*6e4)}function UT(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}function $T(r,e=0,t=r.byteLength-e,n=!1){let i="";for(let s of new Uint8Array(r,e,t)){let o=s.toString(16).toUpperCase();o.length===1&&(i+="0"),i+=o,n&&(i+=" ")}return i.trim()}function LT(r,e,t,n){return e instanceof ArrayBuffer?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error='Wrong parameter: inputBuffer must be "ArrayBuffer"',!1)}function ay(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}function cy(r,e,t=-1){let n=t,i=r,s=0,o=Math.pow(2,e);for(let a=1;a<8;a++){if(r<o){let c;if(n<0)c=new ArrayBuffer(a),s=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let u=new Uint8Array(c);for(let d=a-1;d>=0;d--){let p=Math.pow(2,d*e);u[s-d-1]=Math.floor(i/p),i-=u[s-d-1]*p}return c}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function VT(...r){let e=0,t=0;for(let s of r)e+=s.byteLength;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(new Uint8Array(s),t),t+=s.byteLength;return n}function HT(...r){let e=0,t=0;for(let s of r)e+=s.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(s,t),t+=s.length;return i}function FT(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)t[a]=0;t[0]=r[0]&128;let n=ay(t,8),i=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(i);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=r[a];return s[0]&=127,ay(s,8)-n}function KT(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let o=t-e,a=cy(o,8,n),c=new Uint8Array(a);return c[0]|=128,a}let i=cy(e,8,n),s=new Uint8Array(i);if(s[0]&128){let o=i.slice(0),a=new Uint8Array(o);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let c=0;c<o.byteLength;c++)s[c+1]=a[c];s[0]=0}return i}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function GT(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}function WT(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,i=Array.from({length:n});for(let o=0;o<n;o++)i[o]="0";return i.join("").concat(t)}var Sb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",wb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function zT(r,e=!1,t=!1,n=!1){let i=0,s=0,o=0,a="",c=e?wb:Sb;if(n){let u=0;for(let d=0;d<r.length;d++)if(r.charCodeAt(d)!==0){u=d;break}r=r.slice(u)}for(;i<r.length;){let u=r.charCodeAt(i++);i>=r.length&&(s=1);let d=r.charCodeAt(i++);i>=r.length&&(o=1);let p=r.charCodeAt(i++),_=u>>2,E=(u&3)<<4|d>>4,U=(d&15)<<2|p>>6,$=p&63;s===1?U=$=64:o===1&&($=64),t?U===64?a+=`${c.charAt(_)}${c.charAt(E)}`:$===64?a+=`${c.charAt(_)}${c.charAt(E)}${c.charAt(U)}`:a+=`${c.charAt(_)}${c.charAt(E)}${c.charAt(U)}${c.charAt($)}`:a+=`${c.charAt(_)}${c.charAt(E)}${c.charAt(U)}${c.charAt($)}`}return a}function JT(r,e=!1,t=!1){let n=e?wb:Sb;function i(c){for(let u=0;u<64;u++)if(n.charAt(u)===c)return u;return 64}function s(c){return c===64?0:c}let o=0,a="";for(;o<r.length;){let c=i(r.charAt(o++)),u=o>=r.length?0:i(r.charAt(o++)),d=o>=r.length?0:i(r.charAt(o++)),p=o>=r.length?0:i(r.charAt(o++)),_=s(c)<<2|s(u)>>4,E=(s(u)&15)<<4|s(d)>>2,U=(s(d)&3)<<6|s(p);a+=String.fromCharCode(_),d!==64&&(a+=String.fromCharCode(E)),p!==64&&(a+=String.fromCharCode(U))}if(t){let c=a.length,u=-1;for(let d=c-1;d>=0;d--)if(a.charCodeAt(d)!==0){u=d;break}u!==-1?a=a.slice(0,u+1):a=""}return a}function XT(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}function YT(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let i=0;i<e;i++)n[i]=r.charCodeAt(i);return t}var ZT=Math.log(2);function QT(r){let e=Math.log(r)/ZT,t=Math.floor(e),n=Math.round(e);return t===n?t:n}function eE(r,e){for(let t of e)delete r[t]}Re.arrayBufferToString=XT;Re.bufferToHexCodes=$T;Re.checkBufferParams=LT;Re.clearProps=eE;Re.fromBase64=JT;Re.getParametersValue=UT;Re.getUTCDate=DT;Re.isEqualBuffer=GT;Re.nearestPowerOf2=QT;Re.padNumber=WT;Re.stringToArrayBuffer=YT;Re.toBase64=zT;Re.utilConcatBuf=VT;Re.utilConcatView=HT;Re.utilDecodeTC=FT;Re.utilEncodeTC=KT;Re.utilFromBase=ay;Re.utilToBase=cy});var Sn=l(F=>{"use strict";var tE=oy(),rE=Cb();function Eb(r){var e=Object.create(null);return r&&Object.keys(r).forEach(function(t){if(t!=="default"){var n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:function(){return r[t]}})}}),e.default=r,Object.freeze(e)}var X=Eb(tE),se=Eb(rE);function Ql(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function fy(r){let e=0,t=0;for(let i=0;i<r.length;i++){let s=r[i];e+=s.byteLength}let n=new Uint8Array(e);for(let i=0;i<r.length;i++){let s=r[i];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}function Yr(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Os=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return fy(this.items)}},Ea=[new Uint8Array([1])],Pb="0123456789",uy="name",xb="valueHexView",nE="isHexOnly",iE="idBlock",sE="tagClass",oE="tagNumber",aE="isConstructed",cE="fromBER",uE="toBER",lE="local",lt="",wr=new ArrayBuffer(0),_f=new Uint8Array(0),ka="EndOfContent",Ib="OCTET STRING",kb="BIT STRING";function Cr(r){var e;return e=class extends r{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var i;super(...n);let s=n[0]||{};this.isHexOnly=(i=s.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=s.valueHex?X.BufferSourceConverter.toUint8Array(s.valueHex):_f}fromBER(n,i,s,o){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!Yr(this,a,i,s))return-1;let c=i+s;return this.valueHexView=a.subarray(i,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),i)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",wr)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:X.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var Jr=class{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=lt,warnings:n=[],valueBeforeDecode:i=_f}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=X.BufferSourceConverter.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:X.Convert.ToHex(this.valueBeforeDecodeView)}}};Jr.NAME="baseBlock";var Ge=class extends Jr{fromBER(e,t,n,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Ge.NAME="valueBlock";var ef=class extends Cr(Jr){constructor({idBlock:e={}}={}){var t,n,i,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?X.BufferSourceConverter.toUint8Array(e.valueHex):_f,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",wr}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,i[0]=t}return i.buffer}if(!this.isHexOnly){let i=se.utilToBase(this.tagNumber,7),s=new Uint8Array(i),o=i.byteLength,a=new Uint8Array(o+1);if(a[0]=t|31,!e){for(let c=0;c<o-1;c++)a[c+1]=s[c]|128;a[o]=s[o-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let i=this.valueHexView;for(let s=0;s<i.length-1;s++)n[s+1]=i[s]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,t,n){let i=X.BufferSourceConverter.toUint8Array(e);if(!Yr(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let a=s[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=0;for(;;){let d=c+1;if(d>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c++,(s[d]&128)===0)break}this.blockLength=c+1;let u=this.valueHexView=new Uint8Array(c);for(let d=0;d<c;d++)u[d]=s[d+1]&127;this.blockLength<=9?this.tagNumber=se.utilFromBase(u,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};ef.NAME="identificationBlock";var tf=class extends Jr{constructor({lenBlock:e={}}={}){var t,n,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,n){let i=X.BufferSourceConverter.toUint8Array(e);if(!Yr(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;let o=s[0]&127;if(o>8)return this.error="Too big integer",-1;if(o+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let a=t+1,c=i.subarray(a,a+o);return c[o-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=se.utilFromBase(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let i=se.utilToBase(this.length,8);if(i.byteLength>127)return this.error="Too big length",wr;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let s=new Uint8Array(i);n=new Uint8Array(t),n[0]=i.byteLength|128;for(let o=0;o<i.byteLength;o++)n[o+1]=s[o];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};tf.NAME="lengthBlock";var B={},Le=class extends Jr{constructor({name:e=lt,optional:t=!1,primitiveSchema:n,...i}={},s){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new ef(i),this.lenBlock=new tf(i),this.valueBlock=s?new s(i):new Ge(i)}fromBER(e,t,n,i){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length,i);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new Os;t||Bb(this);let i=this.idBlock.toBER(e);if(n.write(i),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let o=this.lenBlock.toBER(e);n.write(o),n.write(s)}return t?wr:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():X.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=X.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return se.isEqualBuffer(t,n)}};Le.NAME="BaseBlock";function Bb(r){var e;if(r instanceof B.Constructed)for(let t of r.valueBlock.value)Bb(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}var Ba=class extends Le{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=lt,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};Ba.NAME="BaseStringBlock";var rf=class extends Cr(Ge){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};rf.NAME="PrimitiveValueBlock";var Ob,Oa=class extends Le{constructor(e={}){super(e,rf),this.idBlock.isConstructed=!1}};Ob=Oa;B.Primitive=Ob;Oa.NAME="PRIMITIVE";var jb=100,Nb=1e4,qb=16*1024*1024,fE="Maximum ASN.1 nesting depth exceeded",dE="Maximum ASN.1 node count exceeded",pE="Maximum ASN.1 content length exceeded";function uc(r={}){var e,t,n;return{depth:0,maxDepth:(e=r.maxDepth)!==null&&e!==void 0?e:jb,nodesCount:0,maxNodes:(t=r.maxNodes)!==null&&t!==void 0?t:Nb,maxContentLength:(n=r.maxContentLength)!==null&&n!==void 0?n:qb}}function hE(r){let e=new Le({},Ge);return e.error=r,{offset:-1,result:e}}function yE(r){if(r.nodesCount+=1,r.nodesCount>r.maxNodes)return dE}function _E(r,e){if(r>e.maxContentLength)return pE}function dy(r,e,t,n){let i=n.depth+1;if(i>n.maxDepth)return hE(fE);n.depth=i;try{return gf(r,e,t,n)}finally{n.depth-=1}}function gE(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function gf(r,e=0,t=r.length,n=uc()){let i=e,s=new Le({},Ge),o=new Jr;if(!Yr(o,r,e,t))return s.error=o.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let c=yE(n);if(c)return s.error=c,{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};e=u,t-=s.lenBlock.blockLength;let d=s.lenBlock.isIndefiniteForm?t:s.lenBlock.length,p=_E(d,n);if(p)return s.error=p,{offset:-1,result:s};if(!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let _=Le;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};_=B.EndOfContent;break;case 1:_=B.Boolean;break;case 2:_=B.Integer;break;case 3:_=B.BitString;break;case 4:_=B.OctetString;break;case 5:_=B.Null;break;case 6:_=B.ObjectIdentifier;break;case 10:_=B.Enumerated;break;case 12:_=B.Utf8String;break;case 13:_=B.RelativeObjectIdentifier;break;case 14:_=B.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:_=B.Sequence;break;case 17:_=B.Set;break;case 18:_=B.NumericString;break;case 19:_=B.PrintableString;break;case 20:_=B.TeletexString;break;case 21:_=B.VideotexString;break;case 22:_=B.IA5String;break;case 23:_=B.UTCTime;break;case 24:_=B.GeneralizedTime;break;case 25:_=B.GraphicString;break;case 26:_=B.VisibleString;break;case 27:_=B.GeneralString;break;case 28:_=B.UniversalString;break;case 29:_=B.CharacterString;break;case 30:_=B.BmpString;break;case 31:_=B.DATE;break;case 32:_=B.TimeOfDay;break;case 33:_=B.DateTime;break;case 34:_=B.Duration;break;default:{let E=s.idBlock.isConstructed?new B.Constructed:new B.Primitive;E.idBlock=s.idBlock,E.lenBlock=s.lenBlock,E.warnings=s.warnings,s=E}}break;case 2:case 3:case 4:default:_=s.idBlock.isConstructed?B.Constructed:B.Primitive}return s=gE(s,_),u=s.fromBER(r,e,d,n),s.valueBeforeDecodeView=r.subarray(i,i+s.blockLength),{offset:u,result:s}}function vE(r,e={}){if(!r.byteLength){let t=new Le({},Ge);return t.error="Input buffer has zero length",{offset:-1,result:t}}return gf(X.BufferSourceConverter.toUint8Array(r).slice(),0,r.byteLength,uc(e))}function mE(r,e){return r?1:e}var br=class extends Ge{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n,i){let s=X.BufferSourceConverter.toUint8Array(e),o=i??uc();if(!Yr(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let a=t;for(;mE(this.isIndefiniteForm,n)>0;){let c=dy(s,a,n,o);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(a=c.offset,this.blockLength+=c.result.blockLength,n-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===ka)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===ka?this.value.pop():this.warnings.push("No EndOfContent block encoded")),a}toBER(e,t){let n=t||new Os;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?wr:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};br.NAME="ConstructedValueBlock";var Rb,Xr=class extends Le{constructor(e={}){super(e,br),this.idBlock.isConstructed=!0}fromBER(e,t,n,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length,i);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
5
|
+
`).map(i=>` ${i}`).join(`
|
|
6
|
+
`));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
|
|
7
|
+
${e.join(`
|
|
8
|
+
`)}`:`${t} :`}};Rb=Xr;B.Constructed=Rb;Xr.NAME="CONSTRUCTED";var nf=class extends Ge{fromBER(e,t,n){return t}toBER(e){return wr}};nf.override="EndOfContentValueBlock";var Mb,ja=class extends Le{constructor(e={}){super(e,nf),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};Mb=ja;B.EndOfContent=Mb;ja.NAME=ka;var Db,Na=class extends Le{constructor(e={}){super(e,Ge),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){let n=new ArrayBuffer(2);if(!e){let i=new Uint8Array(n);i[0]=5,i[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};Db=Na;B.Null=Db;Na.NAME="NULL";var sf=class extends Cr(Ge){get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=X.BufferSourceConverter.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,n){let i=X.BufferSourceConverter.toUint8Array(e);return Yr(this,i,t,n)?(this.valueHexView=i.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,se.utilDecodeTC.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};sf.NAME="BooleanValueBlock";var Ub,qa=class extends Le{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,sf),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Ub=qa;B.Boolean=Ub;qa.NAME="BOOLEAN";var of=class extends Cr(br){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n,i){let s=0;if(this.isConstructed){if(this.isHexOnly=!1,s=br.prototype.fromBER.call(this,e,t,n,i),s===-1)return s;for(let o=0;o<this.value.length;o++){let a=this.value[o].constructor.NAME;if(a===ka){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Ib)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,s=super.fromBER(e,t,n),this.blockLength=n;return s}toBER(e,t){return this.isConstructed?br.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};of.NAME="OctetStringValueBlock";var py,Ra=class extends Le{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,s;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},of),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let o=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+n);try{if(o.byteLength){let a=i??uc(),c=dy(o,0,o.byteLength,a);c.offset!==-1&&c.offset===n&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,n,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Xr.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=X.Convert.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof py&&e.push(t.valueBlock.valueHexView);return X.BufferSourceConverter.concat(e)}};py=Ra;B.OctetString=py;Ra.NAME=Ib;var af=class extends Cr(br){constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n,i){if(!n)return t;let s=-1;if(this.isConstructed){if(s=br.prototype.fromBER.call(this,e,t,n,i),s===-1)return s;for(let c of this.value){let u=c.constructor.NAME;if(u===ka){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(u!==kb)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return s}let o=X.BufferSourceConverter.toUint8Array(e);if(!Yr(this,o,t,n))return-1;let a=o.subarray(t,t+n);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let c=a.subarray(1);try{if(c.byteLength){let u=i??uc(),d=dy(c,0,c.byteLength,u);d.offset!==-1&&d.offset===n-1&&(this.value=[d.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,t+n}toBER(e,t){if(this.isConstructed)return br.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){let i=new Uint8Array(1);return i[0]=0,i.buffer}let n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};af.NAME="BitStringValueBlock";var $b,Ma=class extends Le{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,s;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},af),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Xr.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let o of t)e.push(o.toString(2).padStart(8,"0"));let n=e.join(""),i=this.constructor.NAME,s=n.substring(0,n.length-this.valueBlock.unusedBits);return`${i} : ${s}`}}};$b=Ma;B.BitString=$b;Ma.NAME=kb;var Lb;function AE(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),i=new Uint8Array(e),s=n.slice(0),o=s.length-1,a=i.slice(0),c=a.length-1,u=0,d=c<o?o:c,p=0;for(let _=d;_>=0;_--,p++){switch(!0){case p<a.length:u=s[o-p]+a[c-p]+t[0];break;default:u=s[o-p]+t[0]}switch(t[0]=u/10,!0){case p>=s.length:s=se.utilConcatView(new Uint8Array([u%10]),s);break;default:s[o-p]=u%10}}return t[0]>0&&(s=se.utilConcatView(t,s)),s}function Tb(r){if(r>=Ea.length)for(let e=Ea.length;e<=r;e++){let t=new Uint8Array([0]),n=Ea[e-1].slice(0);for(let i=n.length-1;i>=0;i--){let s=new Uint8Array([(n[i]<<1)+t[0]]);t[0]=s[0]/10,n[i]=s[0]%10}t[0]>0&&(n=se.utilConcatView(t,n)),Ea.push(n)}return Ea[r]}function bE(r,e){let t=0,n=new Uint8Array(r),i=new Uint8Array(e),s=n.slice(0),o=s.length-1,a=i.slice(0),c=a.length-1,u,d=0;for(let p=c;p>=0;p--,d++)switch(u=s[o-d]-a[c-d]-t,!0){case u<0:t=1,s[o-d]=u+10;break;default:t=0,s[o-d]=u}if(t>0)for(let p=o-c+1;p>=0;p--,d++)if(u=s[o-d]-t,u<0)t=1,s[o-d]=u+10;else{t=0,s[o-d]=u;break}return s.slice()}var Da=class extends Cr(Ge){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=se.utilDecodeTC.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(se.utilEncodeTC(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,i=0){let s=this.fromBER(e,t,n);if(s===-1)return s;let o=this.valueHexView;return o[0]===0&&(o[1]&128)!==0?this.valueHexView=o.subarray(1):i!==0&&o.length<i&&(i-o.length>1&&(i=o.length+1),this.valueHexView=o.subarray(i-o.length)),s}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){let i=super.fromBER(e,t,n);return i===-1||this.setValueHex(),i}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),n=0,i,s=this.valueHexView,o="",a=!1;for(let c=s.byteLength-1;c>=0;c--){i=s[c];for(let u=0;u<8;u++){if((i&1)===1)switch(n){case e:t=bE(Tb(n),t),o="-";break;default:t=AE(t,Tb(n))}n++,i>>=1}}for(let c=0;c<t.length;c++)t[c]&&(a=!0),a&&(o+=Pb.charAt(t[c]));return a===!1&&(o+=Pb.charAt(0)),o}};Lb=Da;Da.NAME="IntegerValueBlock";Object.defineProperty(Lb.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ia,js=class extends Le{constructor(e={}){super(e,Da),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ql(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Ql();let t=BigInt(e),n=new Os,i=t.toString(16).replace(/^-/,""),s=new Uint8Array(X.Convert.FromHex(i));if(t<0){let a=new Uint8Array(s.length+(s[0]&128?1:0));a[0]|=128;let u=BigInt(`0x${X.Convert.ToHex(a)}`)+t,d=X.BufferSourceConverter.toUint8Array(X.Convert.FromHex(u.toString(16)));d[0]|=128,n.write(d)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new Ia({valueHex:n.final()})}convertToDER(){let e=new Ia({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Ia({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};Ia=js;B.Integer=Ia;js.NAME="INTEGER";var Vb,Ua=class extends js{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};Vb=Ua;B.Enumerated=Vb;Ua.NAME="ENUMERATED";var $a=class extends Cr(Ge){constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;let i=X.BufferSourceConverter.toUint8Array(e);if(!Yr(this,i,t,n))return-1;let s=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let o=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];return this.valueHexView=o,(s[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=se.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){Ql();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let n=new Uint8Array(t.length/7);for(let i=0;i<n.length;i++)n[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,s=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength-1;o++)s[o]=i[o]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}let t=se.utilToBase(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",wr;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),s=t.byteLength-1;for(let o=0;o<s;o++)n[o]=i[o]|128;n[s]=i[s]}return n}toString(){let e="";if(this.isHexOnly)e=X.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};$a.NAME="sidBlock";var cf=class extends Ge{constructor({value:e=lt,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let s=new $a;if(i=s.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=s.error,i;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return i}toBER(e){let t=[];for(let n=0;n<this.value.length;n++){let i=this.value[n].toBER(e);if(i.byteLength===0)return this.error=this.value[n].error,wr;t.push(i)}return fy(t)}fromString(e){this.value=[];let t=0,n=0,i="",s=!1;do if(n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1,s){let o=this.value[0],a=0;switch(o.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let c=parseInt(i,10);if(isNaN(c))return;o.valueDec=c+a,s=!1}else{let o=new $a;if(i>Number.MAX_SAFE_INTEGER){Ql();let a=BigInt(i);o.valueBigInt=a}else if(o.valueDec=parseInt(i,10),isNaN(o.valueDec))return;this.value.length||(o.isFirstSid=!0,s=!0),this.value.push(o)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t?(i=`{${i}}`,this.value[n].isFirstSid?e=`2.{${i} - 80}`:e+=i):e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};cf.NAME="ObjectIdentifierValueBlock";var Hb,La=class extends Le{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,cf),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Hb=La;B.ObjectIdentifier=Hb;La.NAME="OBJECT IDENTIFIER";var Va=class extends Cr(Jr){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let i=X.BufferSourceConverter.toUint8Array(e);if(!Yr(this,i,t,n))return-1;let s=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let o=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];return this.valueHexView=o,(s[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=se.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,s=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength-1;o++)s[o]=i[o]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}let t=se.utilToBase(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",wr;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),s=t.byteLength-1;for(let o=0;o<s;o++)n[o]=i[o]|128;n[s]=i[s]}return n.buffer}toString(){let e="";return this.isHexOnly?e=X.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};Va.NAME="relativeSidBlock";var uf=class extends Ge{constructor({value:e=lt,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let s=new Va;if(i=s.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=s.error,i;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return i}toBER(e,t){let n=[];for(let i=0;i<this.value.length;i++){let s=this.value[i].toBER(e);if(s.byteLength===0)return this.error=this.value[i].error,wr;n.push(s)}return fy(n)}fromString(e){this.value=[];let t=0,n=0,i="";do{n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1;let s=new Va;if(s.valueDec=parseInt(i,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(i=`{${i}}`),e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};uf.NAME="RelativeObjectIdentifierValueBlock";var Fb,Ha=class extends Le{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,uf),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Fb=Ha;B.RelativeObjectIdentifier=Fb;Ha.NAME="RelativeObjectIdentifier";var Kb,Fa=class extends Xr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};Kb=Fa;B.Sequence=Kb;Fa.NAME="SEQUENCE";var Gb,Ka=class extends Xr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Gb=Ka;B.Set=Gb;Ka.NAME="SET";var lf=class extends Cr(Ge){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=lt}toJSON(){return{...super.toJSON(),value:this.value}}};lf.NAME="StringValueBlock";var ff=class extends lf{};ff.NAME="SimpleStringValueBlock";var ot=class extends Ba{constructor({...e}={}){super(e,ff)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,X.BufferSourceConverter.toUint8Array(e))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);this.valueBlock.value=e}};ot.NAME="SIMPLE STRING";var df=class extends ot{fromBuffer(e){this.valueBlock.valueHexView=X.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=X.Convert.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=X.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(X.Convert.FromUtf8String(e)),this.valueBlock.value=e}};df.NAME="Utf8StringValueBlock";var Wb,Sr=class extends df{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};Wb=Sr;B.Utf8String=Wb;Sr.NAME="UTF8String";var pf=class extends ot{fromBuffer(e){this.valueBlock.value=X.Convert.ToUtf16String(e),this.valueBlock.valueHexView=X.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(X.Convert.FromUtf16String(e))}};pf.NAME="BmpStringValueBlock";var zb,Ga=class extends pf{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};zb=Ga;B.BmpString=zb;Ga.NAME="BMPString";var hf=class extends ot{fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let i=0;i<n.length;i+=4)n[i]=n[i+3],n[i+1]=n[i+2],n[i+2]=0,n[i+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let i=0;i<t;i++){let s=se.utilToBase(e.charCodeAt(i),8),o=new Uint8Array(s);if(o.length>4)continue;let a=4-o.length;for(let c=o.length-1;c>=0;c--)n[i*4+c+a]=o[c]}this.valueBlock.value=e}};hf.NAME="UniversalStringValueBlock";var Jb,Wa=class extends hf{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};Jb=Wa;B.UniversalString=Jb;Wa.NAME="UniversalString";var Xb,za=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};Xb=za;B.NumericString=Xb;za.NAME="NumericString";var Yb,Ja=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};Yb=Ja;B.PrintableString=Yb;Ja.NAME="PrintableString";var Zb,Xa=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};Zb=Xa;B.TeletexString=Zb;Xa.NAME="TeletexString";var Qb,Ya=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};Qb=Ya;B.VideotexString=Qb;Ya.NAME="VideotexString";var e0,Za=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};e0=Za;B.IA5String=e0;Za.NAME="IA5String";var t0,Qa=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};t0=Qa;B.GraphicString=t0;Qa.NAME="GraphicString";var r0,Ns=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};r0=Ns;B.VisibleString=r0;Ns.NAME="VisibleString";var n0,ec=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};n0=ec;B.GeneralString=n0;ec.NAME="GeneralString";var i0,tc=class extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};i0=tc;B.CharacterString=i0;tc.NAME="CharacterString";var s0,qs=class extends Ns{constructor({value:e,valueDate:t,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let i=0;i<e.length;i++)this.valueBlock.valueHexView[i]=e.charCodeAt(i)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,X.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}let i=parseInt(n[1],10);i>=50?this.year=1900+i:this.year=2e3+i,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=se.padNumber(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=se.padNumber(this.month,2),t[2]=se.padNumber(this.day,2),t[3]=se.padNumber(this.hour,2),t[4]=se.padNumber(this.minute,2),t[5]=se.padNumber(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};s0=qs;B.UTCTime=s0;qs.NAME="UTCTime";var o0,rc=class extends qs{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){let e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,n="",i="",s=0,o,a=0,c=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let p=new Number(e[e.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,_=n.indexOf("+"),E="";if(_===-1&&(_=n.indexOf("-"),p=-1),_!==-1){if(E=n.substring(_+1),n=n.substring(0,_),E.length!==2&&E.length!==4)throw new Error("Wrong input string for conversion");let U=parseInt(E.substring(0,2),10);if(isNaN(U.valueOf()))throw new Error("Wrong input string for conversion");if(a=p*U,E.length===4){if(U=parseInt(E.substring(2,4),10),isNaN(U.valueOf()))throw new Error("Wrong input string for conversion");c=p*U}}}let u=n.indexOf(".");if(u===-1&&(u=n.indexOf(",")),u!==-1){let p=new Number(`0${n.substring(u)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),i=n.substring(0,u)}else i=n;switch(!0){case i.length===8:if(o=/(\d{4})(\d{2})(\d{2})/ig,u!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===12:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===14:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}let d=o.exec(i);if(d===null)throw new Error("Wrong input string for conversion");for(let p=1;p<d.length;p++)switch(p){case 1:this.year=parseInt(d[p],10);break;case 2:this.month=parseInt(d[p],10);break;case 3:this.day=parseInt(d[p],10);break;case 4:this.hour=parseInt(d[p],10)+a;break;case 5:this.minute=parseInt(d[p],10)+c;break;case 6:this.second=parseInt(d[p],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(se.padNumber(this.year,4)),t.push(se.padNumber(this.month,2)),t.push(se.padNumber(this.day,2)),t.push(se.padNumber(this.hour,2)),t.push(se.padNumber(this.minute,2)),t.push(se.padNumber(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(se.padNumber(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};o0=rc;B.GeneralizedTime=o0;rc.NAME="GeneralizedTime";var a0,nc=class extends Sr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};a0=nc;B.DATE=a0;nc.NAME="DATE";var c0,ic=class extends Sr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};c0=ic;B.TimeOfDay=c0;ic.NAME="TimeOfDay";var u0,sc=class extends Sr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};u0=sc;B.DateTime=u0;sc.NAME="DateTime";var l0,oc=class extends Sr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};l0=oc;B.Duration=l0;oc.NAME="Duration";var f0,ac=class extends Sr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};f0=ac;B.TIME=f0;ac.NAME="TIME";var ni=class{constructor({name:e=lt,optional:t=!1}={}){this.name=e,this.optional=t}},yf=class extends ni{constructor({value:e=[],...t}={}){super(t),this.value=e}},cc=class extends ni{constructor({value:e=new ni,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}},ly=class{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=X.BufferSourceConverter.toUint8Array(e)}constructor({data:e=_f}={}){this.dataView=X.BufferSourceConverter.toUint8Array(e)}fromBER(e,t,n){let i=t+n;return this.dataView=X.BufferSourceConverter.toUint8Array(e).subarray(t,i),i}toBER(e){return this.dataView.slice().buffer}};function Bs(r,e,t){if(t instanceof yf){for(let s of t.value)if(Bs(r,e,s).verified)return{verified:!0,result:r};{let s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(uy)&&(s.name=t.name),s}}if(t instanceof ni)return t.hasOwnProperty(uy)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(iE in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cE in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(uE in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let n=t.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(sE)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(oE)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(aE)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(nE in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(xb in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let s=t.idBlock.valueHexView,o=e.idBlock.valueHexView;if(s.length!==o.length)return{verified:!1,result:r};for(let a=0;a<s.length;a++)if(s[a]!==o[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,lt),t.name&&(r[t.name]=e)),t instanceof B.Constructed){let s=0,o={verified:!1,result:{error:"Unknown error"}},a=t.valueBlock.value.length;if(a>0&&t.valueBlock.value[0]instanceof cc&&(a=e.valueBlock.value.length),a===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let c=!0;for(let u=0;u<t.valueBlock.value.length;u++)c=c&&(t.valueBlock.value[u].optional||!1);return c?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,lt),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let c=0;c<a;c++)if(c-s>=e.valueBlock.value.length){if(t.valueBlock.value[c].optional===!1){let u={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,lt),t.name&&(delete r[t.name],u.name=t.name)),u}}else if(t.valueBlock.value[0]instanceof cc){if(o=Bs(r,e.valueBlock.value[c],t.valueBlock.value[0].value),o.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,lt),t.name&&delete r[t.name]),o;if(uy in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let u={};lE in t.valueBlock.value[0]&&t.valueBlock.value[0].local?u=e:u=r,typeof u[t.valueBlock.value[0].name]>"u"&&(u[t.valueBlock.value[0].name]=[]),u[t.valueBlock.value[0].name].push(e.valueBlock.value[c])}}else if(o=Bs(r,e.valueBlock.value[c-s],t.valueBlock.value[c]),o.verified===!1)if(t.valueBlock.value[c].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,lt),t.name&&delete r[t.name]),o;if(o.verified===!1){let c={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,lt),t.name&&(delete r[t.name],c.name=t.name)),c}return{verified:!0,result:r}}if(t.primitiveSchema&&xb in e.valueBlock){let s=gf(e.valueBlock.valueHexView);if(s.offset===-1){let o={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,lt),t.name&&(delete r[t.name],o.name=t.name)),o}return Bs(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function SE(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let t=gf(X.BufferSourceConverter.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Bs(t.result,t.result,e)}F.Any=ni;F.BaseBlock=Le;F.BaseStringBlock=Ba;F.BitString=Ma;F.BmpString=Ga;F.Boolean=qa;F.CharacterString=tc;F.Choice=yf;F.Constructed=Xr;F.DATE=nc;F.DEFAULT_MAX_CONTENT_LENGTH=qb;F.DEFAULT_MAX_DEPTH=jb;F.DEFAULT_MAX_NODES=Nb;F.DateTime=sc;F.Duration=oc;F.EndOfContent=ja;F.Enumerated=Ua;F.GeneralString=ec;F.GeneralizedTime=rc;F.GraphicString=Qa;F.HexBlock=Cr;F.IA5String=Za;F.Integer=js;F.Null=Na;F.NumericString=za;F.ObjectIdentifier=La;F.OctetString=Ra;F.Primitive=Oa;F.PrintableString=Ja;F.RawData=ly;F.RelativeObjectIdentifier=Ha;F.Repeated=cc;F.Sequence=Fa;F.Set=Ka;F.TIME=ac;F.TeletexString=Xa;F.TimeOfDay=ic;F.UTCTime=qs;F.UniversalString=Wa;F.Utf8String=Sr;F.ValueBlock=Ge;F.VideotexString=Ya;F.ViewWriter=Os;F.VisibleString=Ns;F.compareSchema=Bs;F.fromBER=vE;F.verifySchema=SE});var dc=l(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.isArrayBuffer=hy;ft.isSharedArrayBuffer=y0;ft.isArrayBufferLike=lc;ft.isArrayBufferView=_0;ft.isBufferSource=g0;ft.assertBufferSource=fc;ft.toUint8Array=vf;ft.toUint8ArrayCopy=v0;ft.toArrayBuffer=TE;ft.toArrayBufferLike=EE;ft.toView=m0;ft.toViewCopy=IE;var wE="[object ArrayBuffer]",CE="[object SharedArrayBuffer]";function d0(r){return Object.prototype.toString.call(r)}function p0(r){return r===DataView||r.prototype instanceof DataView}function PE(r){return p0(r)?1:r.BYTES_PER_ELEMENT??1}function xE(r){if(ArrayBuffer.isView(r))return!0;if(!r||typeof r!="object")return!1;let e=r;return typeof e.byteOffset=="number"&&typeof e.byteLength=="number"&&lc(e.buffer)}function h0(r){let e=vf(r),t=new Uint8Array(e.byteLength);return t.set(e),t}function hy(r){return d0(r)===wE}function y0(r){return typeof SharedArrayBuffer<"u"&&d0(r)===CE}function lc(r){return hy(r)||y0(r)}function _0(r){return xE(r)}function g0(r){return lc(r)||_0(r)}function fc(r){if(!g0(r))throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}function vf(r){return fc(r),lc(r)?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function v0(r){return h0(r)}function TE(r){if(fc(r),hy(r))return r;let e=new ArrayBuffer(r.byteLength);return new Uint8Array(e).set(vf(r)),e}function EE(r){return fc(r),lc(r)?r:r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:h0(r).buffer}function m0(r,e){if(fc(r),ArrayBuffer.isView(r)&&r.constructor===e)return r;let t=vf(r),n=PE(e);if(t.byteOffset%n!==0||t.byteLength%n!==0)throw new RangeError(`Cannot create ${e.name} over unaligned byte range`);return p0(e)?new e(t.buffer,t.byteOffset,t.byteLength):new e(t.buffer,t.byteOffset,t.byteLength/n)}function IE(r,e){let t=v0(r);return m0(t,e)}});var b0=l(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.concatToUint8Array=A0;Af.concat=kE;var mf=dc();function A0(r){let e=[],t=0;for(let s of r){let o=(0,mf.toUint8Array)(s);e.push(o),t+=o.byteLength}let n=new Uint8Array(t),i=0;for(let s of e)n.set(s,i),i+=s.byteLength;return n}function kE(r,e,...t){let n,i;typeof e=="function"?(n=Array.from(r),i=e):(0,mf.isBufferSource)(r)?n=[r,e,...t].filter(mf.isBufferSource):(n=Array.from(r),e&&n.push(e),n.push(...t));let s=A0(n);return i?(0,mf.toView)(s,i):s.buffer}});var w0=l(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.equal=BE;var S0=dc();function BE(r,e,t={}){let n=(0,S0.toUint8Array)(r),i=(0,S0.toUint8Array)(e);if(!t.constantTime&&n.byteLength!==i.byteLength)return!1;let s=Math.max(n.byteLength,i.byteLength),o=n.byteLength^i.byteLength;for(let a=0;a<s;a++)o|=(n[a]??0)^(i[a]??0);return o===0}});var x0=l(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.indexOf=P0;er.lastIndexOf=RE;er.includes=ME;er.startsWith=DE;er.endsWith=UE;er.slice=$E;er.tail=LE;er.copy=VE;er.compare=HE;var Pr=dc();function bf(r,e,t){let n=Number.isFinite(r)?Math.trunc(r):e;return n<=0?0:n>=t?t:n}function OE(r,e){let t=bf(e?.start,0,r),n=bf(e?.end,r,r);return n>=t?[t,n]:[t,t]}function jE(r,e){let t=bf(e?.start,r,r),n=bf(e?.end,0,r);return t>=n?[n,t]:[t,t]}function C0(r,e,t){let n=Number.isFinite(r)?Math.trunc(r):e;return n<0?Math.max(t+n,0):n>t?t:n}function NE(r){let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t)&255;return e}function qE(r){return new TextEncoder().encode(r)}function Sf(r,e){return typeof r=="string"?e?.encoding==="utf8"?qE(r):NE(r):(0,Pr.toUint8Array)(r)}function wf(r,e,t){for(let n=0;n<e.byteLength;n++)if(r[t+n]!==e[n])return!1;return!0}function P0(r,e,t){let n=(0,Pr.toUint8Array)(r),i=Sf(e,t),[s,o]=OE(n.byteLength,t);if(i.byteLength===0)return s;let a=o-i.byteLength;if(a<s)return-1;for(let c=s;c<=a;c++)if(wf(n,i,c))return c;return-1}function RE(r,e,t){let n=(0,Pr.toUint8Array)(r),i=Sf(e,t),[s,o]=jE(n.byteLength,t);if(i.byteLength===0)return o;let a=o-i.byteLength;if(a<s)return-1;for(let c=a;c>=s;c--)if(wf(n,i,c))return c;return-1}function ME(r,e,t){return P0(r,e,t)!==-1}function DE(r,e,t){let n=(0,Pr.toUint8Array)(r),i=Sf(e,t);return i.byteLength>n.byteLength?!1:wf(n,i,0)}function UE(r,e,t){let n=(0,Pr.toUint8Array)(r),i=Sf(e,t);return i.byteLength>n.byteLength?!1:wf(n,i,n.byteLength-i.byteLength)}function $E(r,e,t){let n=(0,Pr.toUint8Array)(r),i=C0(e,0,n.byteLength),s=C0(t,n.byteLength,n.byteLength);return s<=i?n.subarray(i,i):n.subarray(i,s)}function LE(r,e){let t=(0,Pr.toUint8Array)(r),n=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;return n>=t.byteLength?t:t.subarray(t.byteLength-n)}function VE(r){return(0,Pr.toUint8ArrayCopy)(r)}function HE(r,e){let t=(0,Pr.toUint8Array)(r),n=(0,Pr.toUint8Array)(e),i=Math.min(t.byteLength,n.byteLength);for(let s=0;s<i;s++){if(t[s]<n[s])return-1;if(t[s]>n[s])return 1}return t.byteLength<n.byteLength?-1:t.byteLength>n.byteLength?1:0}});var $t=l(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.tail=V.startsWith=V.slice=V.lastIndexOf=V.indexOf=V.includes=V.endsWith=V.copy=V.compare=V.equal=V.concatToUint8Array=V.concat=V.toViewCopy=V.toView=V.toUint8ArrayCopy=V.toUint8Array=V.toArrayBufferLike=V.toArrayBuffer=V.isSharedArrayBuffer=V.isBufferSource=V.isArrayBufferView=V.isArrayBufferLike=V.isArrayBuffer=V.assertBufferSource=void 0;var Ut=dc();Object.defineProperty(V,"assertBufferSource",{enumerable:!0,get:function(){return Ut.assertBufferSource}});Object.defineProperty(V,"isArrayBuffer",{enumerable:!0,get:function(){return Ut.isArrayBuffer}});Object.defineProperty(V,"isArrayBufferLike",{enumerable:!0,get:function(){return Ut.isArrayBufferLike}});Object.defineProperty(V,"isArrayBufferView",{enumerable:!0,get:function(){return Ut.isArrayBufferView}});Object.defineProperty(V,"isBufferSource",{enumerable:!0,get:function(){return Ut.isBufferSource}});Object.defineProperty(V,"isSharedArrayBuffer",{enumerable:!0,get:function(){return Ut.isSharedArrayBuffer}});Object.defineProperty(V,"toArrayBuffer",{enumerable:!0,get:function(){return Ut.toArrayBuffer}});Object.defineProperty(V,"toArrayBufferLike",{enumerable:!0,get:function(){return Ut.toArrayBufferLike}});Object.defineProperty(V,"toUint8Array",{enumerable:!0,get:function(){return Ut.toUint8Array}});Object.defineProperty(V,"toUint8ArrayCopy",{enumerable:!0,get:function(){return Ut.toUint8ArrayCopy}});Object.defineProperty(V,"toView",{enumerable:!0,get:function(){return Ut.toView}});Object.defineProperty(V,"toViewCopy",{enumerable:!0,get:function(){return Ut.toViewCopy}});var T0=b0();Object.defineProperty(V,"concat",{enumerable:!0,get:function(){return T0.concat}});Object.defineProperty(V,"concatToUint8Array",{enumerable:!0,get:function(){return T0.concatToUint8Array}});var FE=w0();Object.defineProperty(V,"equal",{enumerable:!0,get:function(){return FE.equal}});var Zr=x0();Object.defineProperty(V,"compare",{enumerable:!0,get:function(){return Zr.compare}});Object.defineProperty(V,"copy",{enumerable:!0,get:function(){return Zr.copy}});Object.defineProperty(V,"endsWith",{enumerable:!0,get:function(){return Zr.endsWith}});Object.defineProperty(V,"includes",{enumerable:!0,get:function(){return Zr.includes}});Object.defineProperty(V,"indexOf",{enumerable:!0,get:function(){return Zr.indexOf}});Object.defineProperty(V,"lastIndexOf",{enumerable:!0,get:function(){return Zr.lastIndexOf}});Object.defineProperty(V,"slice",{enumerable:!0,get:function(){return Zr.slice}});Object.defineProperty(V,"startsWith",{enumerable:!0,get:function(){return Zr.startsWith}});Object.defineProperty(V,"tail",{enumerable:!0,get:function(){return Zr.tail}})});var _y=l(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.binary=void 0;ii.encode=E0;ii.decode=I0;ii.is=k0;var KE=$t();function E0(r){let e=(0,KE.toUint8Array)(r),t="";for(let n of e)t+=String.fromCharCode(n);return t}function I0(r){let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t)&255;return e}function k0(r){return typeof r=="string"}ii.binary={encode:E0,decode:I0,is:k0}});var R0=l(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.hex=Pt.formats=void 0;Pt.normalize=pc;Pt.is=j0;Pt.encode=gy;Pt.decode=vy;Pt.parse=N0;Pt.format=q0;var GE=$t(),WE=/^[0-9a-f]$/i,zE=[" "," ",`
|
|
9
|
+
`,"\r",":","-","."];function JE(r){return r.separators==="none"?[]:!r.separators||r.separators==="common"?zE:r.separators}function XE(r){if(!r)throw new TypeError("Hex separators must be non-empty strings")}function YE(r,e,t){for(let n of t)if(r.startsWith(n,e))return n}function ZE(r){let e=/[A-F]/.test(r),t=/[a-f]/.test(r);return e&&!t?"upper":"lower"}function QE(r){let e=/\r\n|\n/.exec(r);if(e)return e[0]===`\r
|
|
10
|
+
`?`\r
|
|
11
|
+
`:`
|
|
12
|
+
`}function B0(r){return r.replace(/[^0-9a-f]/gi,"")}function eI(r){let e=r.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g)??[];if(e.length<3)return;let t=e.filter((o,a)=>a%2===0),n=e.filter((o,a)=>a%2===1),i=n[0];if(!i||n.some(o=>o!==i)||t.some(o=>o.length===0||o.length%2!==0))return;let s=t[0]?.length??0;if(s&&!t.slice(0,-1).some(o=>o.length!==s)&&!((t[t.length-1]?.length??0)>s))return{size:s/2,separator:i}}function tI(r){let e=r.trim(),t=/^0x/i.test(e)?"0x":"",n=t?e.slice(2):e,i=QE(n),s=n.split(/\r\n|\n/).filter(u=>u.length>0),o=s[0]?.trim()??"",a=eI(o),c={case:ZE(e),prefix:t};if(a&&(c.group=a),i&&s.length>1){let u=B0(s[0]??"").length/2;u>0&&s.slice(0,-1).every(d=>B0(d).length/2===u)&&(c.line={bytesPerLine:u,separator:i})}return c}function rI(r,e){let t=e.allowPrefix??!0,n=[...JE(e)].sort((a,c)=>c.length-a.length);for(let a of n)XE(a);let i=r.trim();if(/^0x/i.test(i)){if(!t)throw new TypeError("Hexadecimal text must not include a 0x prefix");i=i.slice(2)}let s="",o=!1;for(let a=0;a<i.length;){let c=i[a]??"";if(WE.test(c)){s+=c,o=!1,a+=1;continue}let u=YE(i,a,n);if(!u)throw new TypeError("Input is not valid hexadecimal text");if(e.strict&&(o||s.length===0))throw new TypeError("Hexadecimal text contains misplaced separators");o=!0,a+=u.length}if(e.strict&&o&&s.length>0)throw new TypeError("Hexadecimal text must not end with a separator");if(s.length%2!==0){if(!e.allowOddLength)throw new TypeError("Hexadecimal text must contain an even number of characters");s=`0${s}`}return s.toLowerCase()}function O0(r,e){if(!e)return r.join("");if(!Number.isInteger(e.size)||e.size<1)throw new RangeError("Hex group size must be a positive integer");let t=[];for(let n=0;n<r.length;n+=e.size)t.push(r.slice(n,n+e.size).join(""));return t.join(e.separator)}function pc(r,e={}){return rI(r,e)}function j0(r,e={}){if(typeof r!="string")return!1;try{return pc(r,e),!0}catch{return!1}}function gy(r,e={}){let t=(0,GE.toUint8Array)(r),n=e.case??"lower",i=Array.from(t,o=>{let a=o.toString(16).padStart(2,"0");return n==="upper"?a.toUpperCase():a}),s="";if(e.line){let o=e.line.bytesPerLine;if(!Number.isInteger(o)||o<1)throw new RangeError("Hex bytesPerLine must be a positive integer");let a=e.line.separator??`
|
|
13
|
+
`,c=[];for(let u=0;u<i.length;u+=o)c.push(O0(i.slice(u,u+o),e.group));s=c.join(a)}else s=O0(i,e.group);return`${e.prefix??""}${s}`}function vy(r,e={}){let t=pc(r,e),n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function N0(r,e={}){let t=pc(r,e);return{bytes:vy(t),format:tI(r),normalized:t}}function q0(r,e){return gy(r,e)}Pt.formats={compact:Object.freeze({}),upper:Object.freeze({case:"upper"}),colon:Object.freeze({group:{size:1,separator:":"}}),colonUpper:Object.freeze({case:"upper",group:{size:1,separator:":"}}),groupsOf4:Object.freeze({group:{size:4,separator:" "}}),prefixed:Object.freeze({prefix:"0x"})};Pt.hex={encode:gy,decode:vy,format:q0,formats:Pt.formats,is:j0,normalize:pc,parse:N0}});var U0=l(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.utf8=void 0;Rs.encode=M0;Rs.decode=D0;var nI=$t();function M0(r){return new TextEncoder().encode(r)}function D0(r){return new TextDecoder("utf-8",{fatal:!1}).decode((0,nI.toUint8Array)(r))}Rs.utf8={encode:M0,decode:D0}});var V0=l(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.utf16=void 0;Ms.encode=$0;Ms.decode=L0;var iI=$t();function $0(r,e={}){let t=new ArrayBuffer(r.length*2),n=new DataView(t);for(let i=0;i<r.length;i++)n.setUint16(i*2,r.charCodeAt(i),e.littleEndian??!1);return new Uint8Array(t)}function L0(r,e={}){let t=(0,iI.toArrayBuffer)(r),n=new DataView(t),i="";for(let s=0;s<t.byteLength;s+=2)i+=String.fromCharCode(n.getUint16(s,e.littleEndian??!1));return i}Ms.utf16={encode:$0,decode:L0}});var Pf=l(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.base64=void 0;Qr.normalize=Cf;Qr.pad=K0;Qr.is=my;Qr.encode=G0;Qr.decode=W0;var sI=$t(),H0=_y(),oI=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function F0(){return globalThis.Buffer}function Cf(r){return r.replace(/[\n\r\t ]/g,"")}function K0(r){let e=r.length%4;return e?r+"=".repeat(4-e):r}function my(r){if(typeof r!="string")return!1;let e=Cf(r);return e===""||oI.test(e)}function G0(r,e){let t=(0,sI.toUint8Array)(r),n=F0();return n?n.from(t).toString("base64"):btoa((0,H0.encode)(t))}function W0(r,e){let t=Cf(r);if(!my(t))throw new TypeError("Input is not valid Base64 text");let n=F0();return n?new Uint8Array(n.from(t,"base64")):(0,H0.decode)(atob(t))}Qr.base64={encode:G0,decode:W0,is:my,normalize:Cf,pad:K0}});var X0=l(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.base64url=void 0;wn.normalize=xf;wn.is=by;wn.encode=z0;wn.decode=J0;var Ay=Pf(),aI=/^[A-Za-z0-9_-]*$/;function xf(r){return r.replace(/[\n\r\t ]/g,"")}function by(r){return typeof r=="string"&&aI.test(xf(r))}function z0(r,e){return Ay.base64.encode(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function J0(r,e){let t=xf(r);if(!by(t))throw new TypeError("Input is not valid Base64Url text");return Ay.base64.decode(Ay.base64.pad(t.replace(/-/g,"+").replace(/_/g,"/")))}wn.base64url={encode:z0,decode:J0,is:by,normalize:xf}});var Us=l(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.base64url=dt.base64=dt.utf16=dt.utf8=dt.hex=dt.binary=void 0;var Ds=(m(),g(v));dt.binary=Ds.__importStar(_y());dt.hex=Ds.__importStar(R0());dt.utf8=Ds.__importStar(U0());dt.utf16=Ds.__importStar(V0());dt.base64=Ds.__importStar(Pf());dt.base64url=Ds.__importStar(X0())});var iS=l(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.pemConverter=pt.pem=void 0;pt.encode=$s;pt.encodeMany=tS;pt.decode=hc;pt.find=rS;pt.findAll=nS;pt.decodeFirst=Sy;pt.parse=wy;pt.format=Cy;var Z0=Pf(),cI=/^[A-Z0-9][A-Z0-9 ._-]*[A-Z0-9]$/i,Y0=/-----BEGIN ([^-]+)-----([\s\S]*?)-----END \1-----/g;function Q0(r){if(!cI.test(r))throw new TypeError(`Invalid PEM label '${r}'`)}function uI(r,e){let t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t}function lI(r){let t=r.trim().replace(/\r\n/g,`
|
|
14
|
+
`).split(`
|
|
15
|
+
`).map(s=>s.trim()).filter(Boolean),n={},i=0;for(;i<t.length;i++){let s=t[i],o=s.indexOf(":");if(o<=0)break;n[s.slice(0,o).trim()]=s.slice(o+1).trim()}return{headers:Object.keys(n).length?n:void 0,base64Lines:t.slice(i),base64Text:t.slice(i).join("")}}function fI(r){return/\r\n/.test(r)?`\r
|
|
16
|
+
`:`
|
|
17
|
+
`}function eS(r,e={}){let t=[],n=e.label,i;for(Y0.lastIndex=0;i=Y0.exec(r);){let s=i[1].trim();if(n&&s!==n)continue;Q0(s);let o=lI(i[2]);t.push({label:s,data:Z0.base64.decode(o.base64Text),headers:o.headers,lineLength:o.base64Lines[0]?.length??64,newline:fI(i[0])})}if(e.strict&&t.length===0)throw new TypeError(n?`No PEM block with label '${n}' was found`:"No PEM blocks were found");return t}function $s(r,e,t={}){Q0(r);let n=t.lineLength??64;if(!Number.isInteger(n)||n<1)throw new RangeError("PEM lineLength must be a positive integer");let i=t.newline??`
|
|
18
|
+
`,s=[`-----BEGIN ${r}-----`];if(t.headers){for(let[o,a]of Object.entries(t.headers))s.push(`${o}: ${a}`);s.push("")}return s.push(...uI(Z0.base64.encode(e),n)),s.push(`-----END ${r}-----`),`${s.join(i)}${i}`}function tS(r,e={}){return r.map(t=>$s(t.label,t.data,{...e,headers:t.headers??e.headers})).join("")}function hc(r,e={}){return eS(r,e).map(({lineLength:t,newline:n,...i})=>i)}function rS(r,e){return hc(r,{label:e})[0]}function nS(r,e){return hc(r,{label:e})}function Sy(r,e){let[t]=hc(r,{label:e,strict:!0});return t.data}function wy(r,e={}){let[t]=eS(r,{...e,strict:!0}),n={label:t.label,headers:t.headers,lineLength:t.lineLength,newline:t.newline};return{bytes:t.data,format:n,normalized:$s(t.label,t.data,n)}}function Cy(r,e){return $s(e.label,r,e)}pt.pem={decode:hc,decodeFirst:Sy,encode:$s,encodeMany:tS,find:rS,findAll:nS,format:Cy,parse:wy};pt.pemConverter={name:"pem",encode:(r,e)=>{if(!e?.label)throw new TypeError("PEM label is required");return $s(e.label,r,e)},decode:(r,e)=>Sy(r,e?.label),format:Cy,is:r=>typeof r=="string"&&/-----BEGIN [^-]+-----/.test(r),parse:wy}});var Tf=l(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.pemConverter=Te.pem=Te.parse=Te.format=Te.findAll=Te.find=Te.encodeMany=Te.encode=Te.decodeFirst=Te.decode=void 0;var xr=iS();Object.defineProperty(Te,"decode",{enumerable:!0,get:function(){return xr.decode}});Object.defineProperty(Te,"decodeFirst",{enumerable:!0,get:function(){return xr.decodeFirst}});Object.defineProperty(Te,"encode",{enumerable:!0,get:function(){return xr.encode}});Object.defineProperty(Te,"encodeMany",{enumerable:!0,get:function(){return xr.encodeMany}});Object.defineProperty(Te,"find",{enumerable:!0,get:function(){return xr.find}});Object.defineProperty(Te,"findAll",{enumerable:!0,get:function(){return xr.findAll}});Object.defineProperty(Te,"format",{enumerable:!0,get:function(){return xr.format}});Object.defineProperty(Te,"parse",{enumerable:!0,get:function(){return xr.parse}});Object.defineProperty(Te,"pem",{enumerable:!0,get:function(){return xr.pem}});Object.defineProperty(Te,"pemConverter",{enumerable:!0,get:function(){return xr.pemConverter}})});var Ty=l(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});xy.createConverterRegistry=hI;function Tr(r){return r.trim().toLowerCase()}function dI(r){return r instanceof Error?r:new Error(String(r))}function sS(r,e,t){for(let n of[t.name,...t.aliases??[]])r.delete(Tr(n));e.delete(Tr(t.name))}function Py(r,e,t){let n=r[t];if(typeof n!="function")throw new Error(`Converter '${e}' does not support ${t}()`);return n}function pI(r,e,t){let n=Tr(t.name||r),i=e.trim();if(!i)return 0;let s=!1;t.is&&(s=t.is(e));let o=!1;try{t.decode(e),o=!0}catch{o=!1}if(!s&&!o)return 0;switch(n){case"pem":return/-----BEGIN [^-]+-----/.test(e)?1:0;case"hex":{let a=i.replace(/^0x/i,"").replace(/[\s:.-]/g,"");return!a||/[^0-9a-f]/i.test(a)||a.length%2!==0?0:/^0x/i.test(i)||/[:\s.-]/.test(i)?.95:/[a-f]/.test(i)||/[A-F]/.test(i)?.8:.45}case"base64url":return/[-_]/.test(i)?.95:/=/.test(i)?.1:.6;case"base64":return/[+/=]/.test(i)?.9:.55;case"binary":case"utf8":case"utf16be":case"utf16le":return 0;default:return s&&o?.75:.5}}function hI(r=[]){let e=new Map,t=new Set,n={register(i,s={}){if(!i.name||!Tr(i.name))throw new TypeError("Converter name is required");let o=[...new Set([i.name,...i.aliases??[]].map(Tr))],a=new Set;for(let c of o){let u=e.get(c);if(u){if(!s.override)throw new Error(`Converter '${c}' is already registered`);a.add(u)}}for(let c of a)sS(e,t,c);for(let c of o)e.set(c,i);return t.add(Tr(i.name)),this},unregister(i){let s=e.get(Tr(i));return s?(sS(e,t,s),!0):!1},has(i){return e.has(Tr(i))},get(i){let s=e.get(Tr(i));if(!s)throw new Error(`Converter '${i}' is not registered`);return s},list(){return[...t].map(i=>this.get(i))},encode(i,s,o){return this.get(i).encode(s,o)},decode(i,s,o){return this.get(i).decode(s,o)},tryDecode(i,s,o){try{return{ok:!0,bytes:this.decode(i,s,o)}}catch(a){return{ok:!1,error:dI(a)}}},normalize(i,s,o){let a=this.get(i);return Py(a,i,"normalize").call(a,s,o)},parse(i,s,o){let a=this.get(i);return Py(a,i,"parse").call(a,s,o)},format(i,s,o){let a=this.get(i);return Py(a,i,"format").call(a,s,o)},transcode(i,s){let o=this.decode(s.from,i,s.fromOptions);return this.encode(s.to,o,s.toOptions)},detect(i,s={}){let o=s.formats?.length?s.formats.map(c=>String(c)):this.list().map(c=>c.name).filter(c=>!["binary","utf8","utf16be","utf16le"].includes(Tr(c))),a=new Map;for(let c of o){let u=this.get(c),d=pI(c,i,u);if(d<=0)continue;let p=u.name,_=a.get(p);(!_||d>_.confidence)&&a.set(p,{format:p,confidence:d})}return[...a.values()].sort((c,u)=>u.confidence-c.confidence)}};for(let i of r)n.register(i);return n}});var Ey=l(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.defaultConverterRegistry=re.defaultConverters=re.utf16leConverter=re.utf16beConverter=re.utf8Converter=re.base64urlConverter=re.base64Converter=re.hexConverter=re.binaryConverter=re.pemConverter=void 0;var we=Us(),yI=Tf(),_I=Tf();Object.defineProperty(re,"pemConverter",{enumerable:!0,get:function(){return _I.pemConverter}});var gI=Ty();re.binaryConverter={name:"binary",aliases:["latin1"],encode:we.binary.encode,decode:we.binary.decode,is:we.binary.is};re.hexConverter={name:"hex",encode:we.hex.encode,decode:we.hex.decode,format:we.hex.format,is:we.hex.is,normalize:we.hex.normalize,parse:we.hex.parse};re.base64Converter={name:"base64",aliases:["b64"],encode:we.base64.encode,decode:we.base64.decode,is:we.base64.is,normalize:we.base64.normalize};re.base64urlConverter={name:"base64url",aliases:["base64-url","b64url"],encode:we.base64url.encode,decode:we.base64url.decode,is:we.base64url.is,normalize:we.base64url.normalize};re.utf8Converter={name:"utf8",aliases:["utf-8"],encode:r=>we.utf8.decode(r),decode:r=>we.utf8.encode(r),is:r=>typeof r=="string"};re.utf16beConverter={name:"utf16be",aliases:["utf16","utf-16","utf-16be"],encode:r=>we.utf16.decode(r),decode:r=>we.utf16.encode(r),is:r=>typeof r=="string"};re.utf16leConverter={name:"utf16le",aliases:["utf-16le","ucs2","usc2"],encode:r=>we.utf16.decode(r,{littleEndian:!0}),decode:r=>we.utf16.encode(r,{littleEndian:!0}),is:r=>typeof r=="string"};re.defaultConverters=[re.binaryConverter,re.hexConverter,re.base64Converter,re.base64urlConverter,re.utf8Converter,re.utf16beConverter,re.utf16leConverter,yI.pemConverter];re.defaultConverterRegistry=(0,gI.createConverterRegistry)(re.defaultConverters)});var oS=l(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.convert=void 0;var Cn=$t(),Ze=Us(),Pn=Ey();function Iy(r,e,...t){return Pn.defaultConverterRegistry.encode(r,e,...t)}function ky(r,e,...t){return Pn.defaultConverterRegistry.decode(r,e,...t)}function vI(r,e,...t){return Pn.defaultConverterRegistry.tryDecode(r,e,...t)}function mI(r,e,...t){return Pn.defaultConverterRegistry.normalize(r,e,...t)}function AI(r,e,...t){return Pn.defaultConverterRegistry.parse(r,e,...t)}function bI(r,e,t){return Pn.defaultConverterRegistry.format(r,e,t)}function SI(r,e){return Pn.defaultConverterRegistry.transcode(r,e)}function wI(r,e){return Pn.defaultConverterRegistry.detect(r,e)}function CI(r){return r.toLowerCase()}Ef.convert={encode:Iy,decode:ky,tryDecode:vI,normalize:mI,parse:AI,format:bI,transcode:SI,detect:wI,to(r,e,...t){return Iy(r,e,...t)},from(r,e,...t){return ky(r,e,...t)},toString(r,e="utf8"){return Iy(e,r)},fromString(r,e="utf8"){return CI(e)==="hex"?(0,Cn.toArrayBuffer)(Ze.hex.decode(r,{allowOddLength:!0})):(0,Cn.toArrayBuffer)(ky(e,r))},toBase64:Ze.base64.encode,fromBase64:r=>(0,Cn.toArrayBuffer)(Ze.base64.decode(r)),toBase64Url:Ze.base64url.encode,fromBase64Url:r=>(0,Cn.toArrayBuffer)(Ze.base64url.decode(r)),toHex:Ze.hex.encode,fromHex:r=>(0,Cn.toArrayBuffer)(Ze.hex.decode(r,{allowOddLength:!0})),toBinary:Ze.binary.encode,fromBinary:r=>(0,Cn.toArrayBuffer)(Ze.binary.decode(r)),toUtf8String:Ze.utf8.decode,fromUtf8String:r=>(0,Cn.toArrayBuffer)(Ze.utf8.encode(r)),toUtf16String:(r,e=!1)=>Ze.utf16.decode(r,{littleEndian:e}),fromUtf16String:(r,e=!1)=>(0,Cn.toArrayBuffer)(Ze.utf16.encode(r,{littleEndian:e})),isHex:Ze.hex.is,isBase64:Ze.base64.is,isBase64Url:Ze.base64url.is,formatString:Ze.base64.normalize}});var By=l(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.convert=he.utf8Converter=he.utf16leConverter=he.utf16beConverter=he.pemConverter=he.hexConverter=he.defaultConverters=he.defaultConverterRegistry=he.binaryConverter=he.base64urlConverter=he.base64Converter=he.createConverterRegistry=void 0;var PI=Ty();Object.defineProperty(he,"createConverterRegistry",{enumerable:!0,get:function(){return PI.createConverterRegistry}});var Er=Ey();Object.defineProperty(he,"base64Converter",{enumerable:!0,get:function(){return Er.base64Converter}});Object.defineProperty(he,"base64urlConverter",{enumerable:!0,get:function(){return Er.base64urlConverter}});Object.defineProperty(he,"binaryConverter",{enumerable:!0,get:function(){return Er.binaryConverter}});Object.defineProperty(he,"defaultConverterRegistry",{enumerable:!0,get:function(){return Er.defaultConverterRegistry}});Object.defineProperty(he,"defaultConverters",{enumerable:!0,get:function(){return Er.defaultConverters}});Object.defineProperty(he,"hexConverter",{enumerable:!0,get:function(){return Er.hexConverter}});Object.defineProperty(he,"pemConverter",{enumerable:!0,get:function(){return Er.pemConverter}});Object.defineProperty(he,"utf16beConverter",{enumerable:!0,get:function(){return Er.utf16beConverter}});Object.defineProperty(he,"utf16leConverter",{enumerable:!0,get:function(){return Er.utf16leConverter}});Object.defineProperty(he,"utf8Converter",{enumerable:!0,get:function(){return Er.utf8Converter}});var xI=oS();Object.defineProperty(he,"convert",{enumerable:!0,get:function(){return xI.convert}})});var aS=l(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.BufferSourceConverter=void 0;var Ir=$t(),Oy=class{static isArrayBuffer(e){return(0,Ir.isArrayBuffer)(e)}static toArrayBuffer(e){return(0,Ir.toArrayBuffer)(e)}static toUint8Array(e){return(0,Ir.toUint8Array)(e)}static toView(e,t){return(0,Ir.toView)(e,t)}static isBufferSource(e){return(0,Ir.isBufferSource)(e)}static isArrayBufferView(e){return(0,Ir.isArrayBufferView)(e)}static isEqual(e,t){return(0,Ir.equal)(e,t)}static concat(e,t,...n){if(Array.isArray(e))return typeof t=="function"?(0,Ir.concat)(e,t):(0,Ir.concat)(e);let i=[e,t,...n].filter(Boolean);return(0,Ir.concat)(i)}};If.BufferSourceConverter=Oy});var uS=l(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.Convert=void 0;var We=By();function cS(r){return r==="ascii"?"binary":r}var jy=class r{static DEFAULT_UTF8_ENCODING="utf8";static isHex(e){return We.convert.isHex(e)}static isBase64(e){return We.convert.isBase64(e)}static isBase64Url(e){return We.convert.isBase64Url(e)}static ToString(e,t="utf8"){return We.convert.toString(e,t)}static FromString(e,t="utf8"){return e?We.convert.fromString(e,t):new ArrayBuffer(0)}static ToBase64(e){return We.convert.toBase64(e)}static FromBase64(e){return We.convert.fromBase64(e)}static FromBase64Url(e){return We.convert.fromBase64Url(e)}static ToBase64Url(e){return We.convert.toBase64Url(e)}static FromUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){return We.convert.fromString(e,cS(t))}static ToUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){return We.convert.toString(e,cS(t))}static FromBinary(e){return We.convert.fromBinary(e)}static ToBinary(e){return We.convert.toBinary(e)}static ToHex(e){return We.convert.toHex(e)}static FromHex(e){return We.convert.fromHex(e)}static ToUtf16String(e,t=!1){return We.convert.toUtf16String(e,t)}static FromUtf16String(e,t=!1){return We.convert.fromUtf16String(e,t)}static Base64Padding(e){let t=4-e.length%4;return t<4?e+"=".repeat(t):e}static formatString(e){return We.convert.formatString(e)}};kf.Convert=jy});var fS=l(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.assign=TI;yc.combine=EI;yc.isEqual=II;var lS=$t();function TI(r,...e){for(let t of e)if(t)for(let n in t)r[n]=t[n];return r}function EI(...r){return(0,lS.concat)(r)}function II(r,e){return(0,lS.equal)(r,e)}});var dS=l(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.isEqual=Lt.combine=Lt.assign=Lt.Convert=Lt.BufferSourceConverter=void 0;var kI=aS();Object.defineProperty(Lt,"BufferSourceConverter",{enumerable:!0,get:function(){return kI.BufferSourceConverter}});var BI=uS();Object.defineProperty(Lt,"Convert",{enumerable:!0,get:function(){return BI.Convert}});var Ny=fS();Object.defineProperty(Lt,"assign",{enumerable:!0,get:function(){return Ny.assign}});Object.defineProperty(Lt,"combine",{enumerable:!0,get:function(){return Ny.combine}});Object.defineProperty(Lt,"isEqual",{enumerable:!0,get:function(){return Ny.isEqual}})});var si=l(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.bytes=void 0;var Ls=(m(),g(v));Ls.__exportStar($t(),en);en.bytes=Ls.__importStar($t());Ls.__exportStar(Us(),en);Ls.__exportStar(Tf(),en);Ls.__exportStar(By(),en);Ls.__exportStar(dS(),en)});var oi=l(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.AsnPropTypes=Vs.AsnTypeTypes=void 0;var pS;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(pS||(Vs.AsnTypeTypes=pS={}));var hS;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null",r[r.RelativeObjectIdentifier=28]="RelativeObjectIdentifier"})(hS||(Vs.AsnPropTypes=hS={}))});var yS=l(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.BitString=void 0;var OI=(m(),g(v)),qy=OI.__importStar(Sn()),Ry=si(),My=class{unusedBits=0;value=new ArrayBuffer(0);constructor(e,t=0){if(e)if(typeof e=="number")this.fromNumber(e);else if((0,Ry.isBufferSource)(e))this.unusedBits=t,this.value=(0,Ry.toArrayBuffer)(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof qy.BitString))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=(0,Ry.toArrayBuffer)(e.valueBlock.valueHex),this}toASN(){return new qy.BitString({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new qy.BitString({name:e})}toNumber(){let e="",t=new Uint8Array(this.value);for(let n of t)e+=n.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let t=e.toString(2),n=t.length+7>>3;this.unusedBits=(n<<3)-t.length;let i=new Uint8Array(n);t=t.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)i[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=i.buffer}};Bf.BitString=My});var _S=l(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.OctetString=void 0;var jI=(m(),g(v)),Dy=jI.__importStar(Sn()),Uy=si(),$y=class{buffer;get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):(0,Uy.isBufferSource)(e)?this.buffer=(0,Uy.toArrayBuffer)(e):Array.isArray(e)?this.buffer=new Uint8Array(e).buffer:this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Dy.OctetString))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=(0,Uy.toArrayBuffer)(e.valueBlock.valueHex),this}toASN(){return new Dy.OctetString({valueHex:this.buffer})}toSchema(e){return new Dy.OctetString({name:e})}};Of.OctetString=$y});var Ly=l(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var gS=(m(),g(v));gS.__exportStar(yS(),jf);gS.__exportStar(_S(),jf)});var _c=l(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.AsnNullConverter=I.AsnGeneralizedTimeConverter=I.AsnUTCTimeConverter=I.AsnCharacterStringConverter=I.AsnGeneralStringConverter=I.AsnVisibleStringConverter=I.AsnGraphicStringConverter=I.AsnIA5StringConverter=I.AsnVideotexStringConverter=I.AsnTeletexStringConverter=I.AsnPrintableStringConverter=I.AsnNumericStringConverter=I.AsnUniversalStringConverter=I.AsnBmpStringConverter=I.AsnUtf8StringConverter=I.AsnConstructedOctetStringConverter=I.AsnOctetStringConverter=I.AsnBooleanConverter=I.AsnRelativeObjectIdentifierConverter=I.AsnObjectIdentifierConverter=I.AsnBitStringConverter=I.AsnIntegerBigIntConverter=I.AsnIntegerArrayBufferConverter=I.AsnEnumeratedConverter=I.AsnIntegerConverter=I.AsnAnyConverter=void 0;I.defaultConverter=RI;var NI=(m(),g(v)),ce=NI.__importStar(Sn()),Nf=si(),Ce=oi(),qI=Ly();I.AsnAnyConverter={fromASN:r=>r instanceof ce.Null?null:(0,Nf.toArrayBuffer)(r.valueBeforeDecodeView),toASN:r=>{if(r===null)return new ce.Null;let e=ce.fromBER(r);if(e.result.error)throw new Error(e.result.error);return e.result}};I.AsnIntegerConverter={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new ce.Integer({value:+r})};I.AsnEnumeratedConverter={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new ce.Enumerated({value:r})};I.AsnIntegerArrayBufferConverter={fromASN:r=>(0,Nf.toArrayBuffer)(r.valueBlock.valueHexView),toASN:r=>new ce.Integer({valueHex:r})};I.AsnIntegerBigIntConverter={fromASN:r=>r.toBigInt(),toASN:r=>ce.Integer.fromBigInt(r)};I.AsnBitStringConverter={fromASN:r=>(0,Nf.toArrayBuffer)(r.valueBlock.valueHexView),toASN:r=>new ce.BitString({valueHex:r})};I.AsnObjectIdentifierConverter={fromASN:r=>r.valueBlock.toString(),toASN:r=>new ce.ObjectIdentifier({value:r})};I.AsnRelativeObjectIdentifierConverter={fromASN:r=>r.valueBlock.toString(),toASN:r=>new ce.RelativeObjectIdentifier({value:r})};I.AsnBooleanConverter={fromASN:r=>r.valueBlock.value,toASN:r=>new ce.Boolean({value:r})};I.AsnOctetStringConverter={fromASN:r=>(0,Nf.toArrayBuffer)(r.valueBlock.valueHexView),toASN:r=>new ce.OctetString({valueHex:r})};I.AsnConstructedOctetStringConverter={fromASN:r=>new qI.OctetString(r.getValue()),toASN:r=>r.toASN()};function Vt(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}I.AsnUtf8StringConverter=Vt(ce.Utf8String);I.AsnBmpStringConverter=Vt(ce.BmpString);I.AsnUniversalStringConverter=Vt(ce.UniversalString);I.AsnNumericStringConverter=Vt(ce.NumericString);I.AsnPrintableStringConverter=Vt(ce.PrintableString);I.AsnTeletexStringConverter=Vt(ce.TeletexString);I.AsnVideotexStringConverter=Vt(ce.VideotexString);I.AsnIA5StringConverter=Vt(ce.IA5String);I.AsnGraphicStringConverter=Vt(ce.GraphicString);I.AsnVisibleStringConverter=Vt(ce.VisibleString);I.AsnGeneralStringConverter=Vt(ce.GeneralString);I.AsnCharacterStringConverter=Vt(ce.CharacterString);I.AsnUTCTimeConverter={fromASN:r=>r.toDate(),toASN:r=>new ce.UTCTime({valueDate:r})};I.AsnGeneralizedTimeConverter={fromASN:r=>r.toDate(),toASN:r=>new ce.GeneralizedTime({valueDate:r})};I.AsnNullConverter={fromASN:()=>null,toASN:()=>new ce.Null};function RI(r){switch(r){case Ce.AsnPropTypes.Any:return I.AsnAnyConverter;case Ce.AsnPropTypes.BitString:return I.AsnBitStringConverter;case Ce.AsnPropTypes.BmpString:return I.AsnBmpStringConverter;case Ce.AsnPropTypes.Boolean:return I.AsnBooleanConverter;case Ce.AsnPropTypes.CharacterString:return I.AsnCharacterStringConverter;case Ce.AsnPropTypes.Enumerated:return I.AsnEnumeratedConverter;case Ce.AsnPropTypes.GeneralString:return I.AsnGeneralStringConverter;case Ce.AsnPropTypes.GeneralizedTime:return I.AsnGeneralizedTimeConverter;case Ce.AsnPropTypes.GraphicString:return I.AsnGraphicStringConverter;case Ce.AsnPropTypes.IA5String:return I.AsnIA5StringConverter;case Ce.AsnPropTypes.Integer:return I.AsnIntegerConverter;case Ce.AsnPropTypes.Null:return I.AsnNullConverter;case Ce.AsnPropTypes.NumericString:return I.AsnNumericStringConverter;case Ce.AsnPropTypes.ObjectIdentifier:return I.AsnObjectIdentifierConverter;case Ce.AsnPropTypes.RelativeObjectIdentifier:return I.AsnRelativeObjectIdentifierConverter;case Ce.AsnPropTypes.OctetString:return I.AsnOctetStringConverter;case Ce.AsnPropTypes.PrintableString:return I.AsnPrintableStringConverter;case Ce.AsnPropTypes.TeletexString:return I.AsnTeletexStringConverter;case Ce.AsnPropTypes.UTCTime:return I.AsnUTCTimeConverter;case Ce.AsnPropTypes.UniversalString:return I.AsnUniversalStringConverter;case Ce.AsnPropTypes.Utf8String:return I.AsnUtf8StringConverter;case Ce.AsnPropTypes.VideotexString:return I.AsnVideotexStringConverter;case Ce.AsnPropTypes.VisibleString:return I.AsnVisibleStringConverter;default:return null}}});var qf=l(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.isConvertible=vS;gc.isTypeOfArray=mS;gc.isArrayEqual=MI;function vS(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:vS(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function mS(r){if(r){let e=Object.getPrototypeOf(r);return e?.prototype?.constructor===Array?!0:mS(e)}return!1}function MI(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)if(t[i]!==n[i])return!1;return!0}});var bS=l(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.AsnSchemaStorage=void 0;var DI=(m(),g(v)),xt=DI.__importStar(Sn()),Hs=oi(),AS=qf(),Vy=class{items=new WeakMap;has(e){return this.items.has(e)}get(e,t=!1){let n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){let t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){let t={type:Hs.AsnTypeTypes.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(t,n),t.items=Object.assign({},t.items,n.items)),t}create(e,t){let n=this.items.get(e)||this.createDefault(e),i=[];for(let s in n.items){let o=n.items[s],a=t?s:"",c;if(typeof o.type=="number"){let d=Hs.AsnPropTypes[o.type],p=xt[d];if(!p)throw new Error(`Cannot get ASN1 class by name '${d}'`);c=new p({name:a})}else(0,AS.isConvertible)(o.type)?c=new o.type().toSchema(a):o.optional?this.get(o.type).type===Hs.AsnTypeTypes.Choice?c=new xt.Any({name:a}):(c=this.create(o.type,!1),c.name=a):c=new xt.Any({name:a});let u=!!o.optional||o.defaultValue!==void 0;if(o.repeated){c.name="";let d=o.repeated==="set"?xt.Set:xt.Sequence;c=new d({name:"",value:[new xt.Repeated({name:a,value:c})]})}if(o.context!==null&&o.context!==void 0)if(o.implicit)if(typeof o.type=="number"||(0,AS.isConvertible)(o.type)){let d=o.repeated?xt.Constructed:xt.Primitive;i.push(new d({name:a,optional:u,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);let d=!!o.repeated,p=d?c:this.get(o.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,i.push(new xt.Constructed({name:d?"":a,optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:p}))}else i.push(new xt.Constructed({optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:[c]}));else c.optional=u,i.push(c)}switch(n.type){case Hs.AsnTypeTypes.Sequence:return new xt.Sequence({value:i,name:""});case Hs.AsnTypeTypes.Set:return new xt.Set({value:i,name:""});case Hs.AsnTypeTypes.Choice:return new xt.Choice({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){let t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}};Rf.AsnSchemaStorage=Vy});var Df=l(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.schemaStorage=void 0;var UI=bS();Mf.schemaStorage=new UI.AsnSchemaStorage});var SS=l(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.AsnProp=at.AsnSequenceType=at.AsnSetType=at.AsnChoiceType=at.AsnType=void 0;var $I=(m(),g(v)),LI=$I.__importStar(_c()),Hy=oi(),xn=Df(),VI=r=>e=>{let t;xn.schemaStorage.has(e)?t=xn.schemaStorage.get(e):(t=xn.schemaStorage.createDefault(e),xn.schemaStorage.set(e,t)),Object.assign(t,r)};at.AsnType=VI;var HI=()=>(0,at.AsnType)({type:Hy.AsnTypeTypes.Choice});at.AsnChoiceType=HI;var FI=r=>(0,at.AsnType)({type:Hy.AsnTypeTypes.Set,...r});at.AsnSetType=FI;var KI=r=>(0,at.AsnType)({type:Hy.AsnTypeTypes.Sequence,...r});at.AsnSequenceType=KI;var GI=r=>(e,t)=>{let n;xn.schemaStorage.has(e.constructor)?n=xn.schemaStorage.get(e.constructor):(n=xn.schemaStorage.createDefault(e.constructor),xn.schemaStorage.set(e.constructor,n));let i=Object.assign({},r);if(typeof i.type=="number"&&!i.converter){let s=LI.defaultConverter(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);i.converter=s}i.raw=r.raw,n.items[t]=i};at.AsnProp=GI});var wS=l(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.AsnSchemaValidationError=void 0;var Fy=class extends Error{schemas=[]};Uf.AsnSchemaValidationError=Fy});var Gy=l(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});var WI=(m(),g(v));WI.__exportStar(wS(),Ky)});var Jy=l($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.AsnParser=void 0;var CS=(m(),g(v)),ht=CS.__importStar(Sn()),zI=si(),Tn=oi(),Wy=CS.__importStar(_c()),vc=Gy(),mc=qf(),ai=Df(),zy=class{static parse(e,t,n){let i=ht.fromBER((0,zI.toArrayBuffer)(e),n?.berOptions);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t,n)}static fromASN(e,t,n){try{if((0,mc.isConvertible)(t))return new t().fromASN(e);let i=ai.schemaStorage.get(t);ai.schemaStorage.cache(t);let s=i.schema,o=this.handleChoiceTypes(e,i,t,s,n);if(o?.result)return o.result;o?.targetSchema&&(s=o.targetSchema);let a=this.handleSequenceTypes(e,i,t,s),c=new t;return(0,mc.isTypeOfArray)(t)?this.handleArrayTypes(e,i,t,n):(this.processSchemaItems(i,a,c,n),c)}catch(i){throw i instanceof vc.AsnSchemaValidationError&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,n,i,s){if(e.constructor===ht.Constructed&&t.type===Tn.AsnTypeTypes.Choice&&e.idBlock.tagClass===3)for(let o in t.items){let a=t.items[o];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&ai.schemaStorage.has(a.type)){let c=ai.schemaStorage.get(a.type);if(c&&c.type===Tn.AsnTypeTypes.Sequence){let u=new ht.Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in u.valueBlock){u.valueBlock.value=e.valueBlock.value;let d=this.fromASN(u,a.type,s),p=new n;return p[o]=d,{result:p}}}}}else if(e.constructor===ht.Constructed&&t.type!==Tn.AsnTypeTypes.Choice){let o=new ht.Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(let a in t.items)delete e[a];return{targetSchema:o}}return null}static handleSequenceTypes(e,t,n,i){if(t.type===Tn.AsnTypeTypes.Sequence){let s=ht.compareSchema({},e,i);if(!s.verified)throw new vc.AsnSchemaValidationError(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{let s=ht.compareSchema({},e,i);if(!s.verified)throw new vc.AsnSchemaValidationError(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,t,n){let i=e.slice(t);if(i.length===1&&i[0].constructor.name==="Sequence"){let s=i[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(i=s.valueBlock.value)}if(typeof n.type=="number"){let s=Wy.defaultConverter(n.type);if(!s)throw new Error(`No converter for ASN.1 type ${n.type}`);return i.filter(o=>o&&o.valueBlock).map(o=>{try{return s.fromASN(o)}catch{return}}).filter(o=>o!==void 0)}else return i.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,n.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,t){let n=Wy.defaultConverter(t.type);if(!n)throw new Error(`No converter for ASN.1 type ${t.type}`);return n.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&ai.schemaStorage.has(e.type)&&ai.schemaStorage.get(e.type).type===Tn.AsnTypeTypes.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(n){if(n instanceof vc.AsnSchemaValidationError&&/Wrong values for Choice type/.test(n.message))return{processed:!1};throw n}}static handleArrayTypes(e,t,n,i){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let s=t.itemType;if(typeof s=="number"){let o=Wy.defaultConverter(s);if(!o)throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);return n.from(e.valueBlock.value,a=>o.fromASN(a))}else return n.from(e.valueBlock.value,o=>this.fromASN(o,s,i))}static processSchemaItems(e,t,n,i){for(let s in e.items){let o=t.result[s];if(!o)continue;let a=e.items[s],c=a.type,u;typeof c=="number"||(0,mc.isConvertible)(c)?u=this.processPrimitiveSchemaItem(o,a,c,i):u=this.processComplexSchemaItem(o,a,c,i),u&&typeof u=="object"&&"value"in u&&"raw"in u?(n[s]=u.value,n[`${s}Raw`]=u.raw):n[s]=u}}static processPrimitiveSchemaItem(e,t,n,i){let s=t.converter??((0,mc.isConvertible)(n)?new n:null);if(!s)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,s,i):this.processSinglePrimitiveItem(e,t,n,s,i)}static processRepeatedPrimitiveItem(e,t,n,i){if(t.implicit){let s=t.repeated==="sequence"?ht.Sequence:ht.Set,o=new s;o.valueBlock=e.valueBlock;let a=ht.fromBER(o.toBER(!1),i?.berOptions);if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let c=a.result.valueBlock.value;return Array.from(c,u=>n.fromASN(u))}else return Array.from(e,s=>n.fromASN(s))}static processSinglePrimitiveItem(e,t,n,i,s){let o=e;if(t.implicit){let a;if((0,mc.isConvertible)(n))a=new n().toSchema("");else{let c=Tn.AsnPropTypes[n],u=ht[c];if(!u)throw new Error(`Cannot get '${c}' class from asn1js module`);a=new u}a.valueBlock=o.valueBlock,o=ht.fromBER(a.toBER(!1),s?.berOptions).result}return i.fromASN(o)}static processComplexSchemaItem(e,t,n,i){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,s=>this.fromASN(s,n,i))}else{let s=this.handleImplicitTagging(e,t,n);if(this.isOptionalChoiceField(t))try{return this.fromASN(s,n,i)}catch(o){if(o instanceof vc.AsnSchemaValidationError&&/Wrong values for Choice type/.test(o.message))return;throw o}else{let o=this.fromASN(s,n,i);return t.raw?{value:o,raw:e.valueBeforeDecodeView}:o}}}static handleImplicitTagging(e,t,n){if(t.implicit&&typeof t.context=="number"){let i=ai.schemaStorage.get(n);if(i.type===Tn.AsnTypeTypes.Sequence){let s=new ht.Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(i.type===Tn.AsnTypeTypes.Set){let s=new ht.Set;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}};$f.AsnParser=zy});var Zy=l(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.AsnSerializer=void 0;var xS=(m(),g(v)),tr=xS.__importStar(Sn()),JI=si(),XI=xS.__importStar(_c()),Lf=oi(),Xy=qf(),PS=Df(),Yy=class r{static serialize(e){return e instanceof tr.BaseBlock?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&(0,Xy.isConvertible)(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let t=e.constructor,n=PS.schemaStorage.get(t);PS.schemaStorage.cache(t);let i=[];if(n.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){let o=XI.defaultConverter(n.itemType);if(!o)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);i=e.map(a=>o.toASN(a))}else i=e.map(o=>this.toAsnItem({type:n.itemType},"[]",t,o))}else for(let o in n.items){let a=n.items[o],c=e[o];if(c===void 0||a.defaultValue===c||typeof a.defaultValue=="object"&&typeof c=="object"&&(0,Xy.isArrayEqual)(this.serialize(a.defaultValue),this.serialize(c)))continue;let u=r.toAsnItem(a,o,t,c);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||(0,Xy.isConvertible)(a.type))){let d={};d.valueHex=u instanceof tr.Null?(0,JI.toArrayBuffer)(u.valueBeforeDecodeView):u.valueBlock.toBER(),i.push(new tr.Primitive({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...d}))}else i.push(new tr.Constructed({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:u.valueBlock.value}));else i.push(new tr.Constructed({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:[u]}));else a.repeated?i=i.concat(u):i.push(u)}let s;switch(n.type){case Lf.AsnTypeTypes.Sequence:s=new tr.Sequence({value:i});break;case Lf.AsnTypeTypes.Set:s=new tr.Set({value:i});break;case Lf.AsnTypeTypes.Choice:if(!i[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=i[0];break}return s}static toAsnItem(e,t,n,i){let s;if(typeof e.type=="number"){let o=e.converter;if(!o)throw new Error(`Property '${t}' doesn't have converter for type ${Lf.AsnPropTypes[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let a=Array.from(i,u=>o.toASN(u)),c=e.repeated==="sequence"?tr.Sequence:tr.Set;s=new c({value:a})}else s=o.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let o=Array.from(i,c=>this.toASN(c)),a=e.repeated==="sequence"?tr.Sequence:tr.Set;s=new a({value:o})}else s=this.toASN(i);return s}};Vf.AsnSerializer=Yy});var TS=l(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.AsnArray=void 0;var Qy=class extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(let t of e)this.push(t)}}};Hf.AsnArray=Qy});var IS=l(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.AsnConvert=void 0;var YI=(m(),g(v)),ZI=YI.__importStar(Sn()),ES=si(),QI=Jy(),ek=Zy(),e_=class r{static serialize(e){return ek.AsnSerializer.serialize(e)}static parse(e,t,n){return QI.AsnParser.parse(e,t,n)}static toString(e,t){let n=(0,ES.isBufferSource)(e)?(0,ES.toArrayBuffer)(e):r.serialize(e),i=ZI.fromBER(n,t?.berOptions);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}};Ff.AsnConvert=e_});var C=l(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.AsnSerializer=ge.AsnParser=ge.AsnPropTypes=ge.AsnTypeTypes=ge.AsnSetType=ge.AsnSequenceType=ge.AsnChoiceType=ge.AsnType=ge.AsnProp=void 0;var Ac=(m(),g(v));Ac.__exportStar(_c(),ge);Ac.__exportStar(Ly(),ge);var bc=SS();Object.defineProperty(ge,"AsnProp",{enumerable:!0,get:function(){return bc.AsnProp}});Object.defineProperty(ge,"AsnType",{enumerable:!0,get:function(){return bc.AsnType}});Object.defineProperty(ge,"AsnChoiceType",{enumerable:!0,get:function(){return bc.AsnChoiceType}});Object.defineProperty(ge,"AsnSequenceType",{enumerable:!0,get:function(){return bc.AsnSequenceType}});Object.defineProperty(ge,"AsnSetType",{enumerable:!0,get:function(){return bc.AsnSetType}});var kS=oi();Object.defineProperty(ge,"AsnTypeTypes",{enumerable:!0,get:function(){return kS.AsnTypeTypes}});Object.defineProperty(ge,"AsnPropTypes",{enumerable:!0,get:function(){return kS.AsnPropTypes}});var tk=Jy();Object.defineProperty(ge,"AsnParser",{enumerable:!0,get:function(){return tk.AsnParser}});var rk=Zy();Object.defineProperty(ge,"AsnSerializer",{enumerable:!0,get:function(){return rk.AsnSerializer}});Ac.__exportStar(Gy(),ge);Ac.__exportStar(TS(),ge);Ac.__exportStar(IS(),ge)});var BS=l(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.IpConverter=void 0;var nk=Us(),t_=class{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.map(n=>{let i=parseInt(n,10);if(isNaN(i)||i<0||i>255)throw new Error("Invalid IPv4 address part");return i})}static parseIPv6(e){let n=this.expandIPv6(e).split(":");if(n.length!==8)throw new Error("Invalid IPv6 address");return n.reduce((i,s)=>{let o=parseInt(s,16);if(isNaN(o)||o<0||o>65535)throw new Error("Invalid IPv6 address part");return i.push(o>>8&255),i.push(o&255),i},[])}static expandIPv6(e){if(!e.includes("::"))return e;let t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");let n=t[0]?t[0].split(":"):[],i=t[1]?t[1].split(":"):[],s=8-(n.length+i.length);if(s<0)throw new Error("Invalid IPv6 address");return[...n,...Array(s).fill("0"),...i].join(":")}static formatIPv6(e){let t=[];for(let n=0;n<16;n+=2)t.push((e[n]<<8|e[n+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){let t=e.split(":"),n=-1,i=0,s=-1,o=0;for(let a=0;a<t.length;a++)t[a]==="0"?(s===-1&&(s=a),o++):(o>i&&(n=s,i=o),s=-1,o=0);if(o>i&&(n=s,i=o),i>1){let a=t.slice(0,n).join(":"),c=t.slice(n+i).join(":");return`${a}::${c}`}return e}static parseCIDR(e){let[t,n]=e.split("/"),i=parseInt(n,10);if(this.isIPv4(t)){if(i<0||i>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),i]}else{if(i<0||i>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),i]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;let t=parseInt(e.slice(8),16).toString(2).split("").reduce((i,s)=>i+ +s,0),n=e.slice(0,8).replace(/(.{2})/g,i=>`${parseInt(i,16)}.`);return n=n.slice(0,-1),`${n}/${t}`}static toString(e){let t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){let n=t.length/2,i=t.slice(0,n),s=t.slice(n);if(t.every(c=>c===0))return t.length===8?"0.0.0.0/0":"::/0";let a=s.reduce((c,u)=>c+(u.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(i).join(".")}/${a}`:`${this.formatIPv6(i)}/${a}`}return this.decodeIP(nk.hex.encode(e))}static fromString(e){if(e.includes("/")){let[n,i]=this.parseCIDR(e),s=new Uint8Array(n.length),o=i;for(let c=0;c<s.length;c++)o>=8?(s[c]=255,o-=8):o>0&&(s[c]=255<<8-o,o=0);let a=new Uint8Array(n.length*2);return a.set(n,0),a.set(s,n.length),a.buffer}let t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}};Kf.IpConverter=t_});var Ks=l(Ve=>{"use strict";var r_,n_,i_;Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Name=Ve.RDNSequence=Ve.RelativeDistinguishedName=Ve.AttributeTypeAndValue=Ve.AttributeValue=Ve.DirectoryString=void 0;var yt=(m(),g(v)),oe=C(),ik=Us(),tn=class{teletexString;printableString;universalString;utf8String;bmpString;constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};Ve.DirectoryString=tn;yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.TeletexString})],tn.prototype,"teletexString",void 0);yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.PrintableString})],tn.prototype,"printableString",void 0);yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.UniversalString})],tn.prototype,"universalString",void 0);yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.Utf8String})],tn.prototype,"utf8String",void 0);yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.BmpString})],tn.prototype,"bmpString",void 0);Ve.DirectoryString=tn=yt.__decorate([(0,oe.AsnType)({type:oe.AsnTypeTypes.Choice})],tn);var ci=class extends tn{ia5String;anyValue;constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?ik.hex.encode(this.anyValue):super.toString())}};Ve.AttributeValue=ci;yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.IA5String})],ci.prototype,"ia5String",void 0);yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.Any})],ci.prototype,"anyValue",void 0);Ve.AttributeValue=ci=yt.__decorate([(0,oe.AsnType)({type:oe.AsnTypeTypes.Choice})],ci);var Fs=class{type="";value=new ci;constructor(e={}){Object.assign(this,e)}};Ve.AttributeTypeAndValue=Fs;yt.__decorate([(0,oe.AsnProp)({type:oe.AsnPropTypes.ObjectIdentifier})],Fs.prototype,"type",void 0);yt.__decorate([(0,oe.AsnProp)({type:ci})],Fs.prototype,"value",void 0);var Gf=r_=class extends oe.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,r_.prototype)}};Ve.RelativeDistinguishedName=Gf;Ve.RelativeDistinguishedName=Gf=r_=yt.__decorate([(0,oe.AsnType)({type:oe.AsnTypeTypes.Set,itemType:Fs})],Gf);var Wf=n_=class extends oe.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,n_.prototype)}};Ve.RDNSequence=Wf;Ve.RDNSequence=Wf=n_=yt.__decorate([(0,oe.AsnType)({type:oe.AsnTypeTypes.Sequence,itemType:Gf})],Wf);var s_=i_=class extends Wf{constructor(e){super(e),Object.setPrototypeOf(this,i_.prototype)}};Ve.Name=s_;Ve.Name=s_=i_=yt.__decorate([(0,oe.AsnType)({type:oe.AsnTypeTypes.Sequence})],s_)});var ui=l(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.GeneralName=Ht.EDIPartyName=Ht.OtherName=Ht.AsnIpConverter=void 0;var _t=(m(),g(v)),ve=C(),OS=BS(),zf=Ks();Ht.AsnIpConverter={fromASN:r=>OS.IpConverter.toString(ve.AsnOctetStringConverter.fromASN(r)),toASN:r=>ve.AsnOctetStringConverter.toASN(OS.IpConverter.fromString(r))};var Gs=class{typeId="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Ht.OtherName=Gs;_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.ObjectIdentifier})],Gs.prototype,"typeId",void 0);_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Any,context:0})],Gs.prototype,"value",void 0);var Ws=class{nameAssigner;partyName=new zf.DirectoryString;constructor(e={}){Object.assign(this,e)}};Ht.EDIPartyName=Ws;_t.__decorate([(0,ve.AsnProp)({type:zf.DirectoryString,optional:!0,context:0,implicit:!0})],Ws.prototype,"nameAssigner",void 0);_t.__decorate([(0,ve.AsnProp)({type:zf.DirectoryString,context:1,implicit:!0})],Ws.prototype,"partyName",void 0);var Ft=class{otherName;rfc822Name;dNSName;x400Address;directoryName;ediPartyName;uniformResourceIdentifier;iPAddress;registeredID;constructor(e={}){Object.assign(this,e)}};Ht.GeneralName=Ft;_t.__decorate([(0,ve.AsnProp)({type:Gs,context:0,implicit:!0})],Ft.prototype,"otherName",void 0);_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.IA5String,context:1,implicit:!0})],Ft.prototype,"rfc822Name",void 0);_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.IA5String,context:2,implicit:!0})],Ft.prototype,"dNSName",void 0);_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Any,context:3,implicit:!0})],Ft.prototype,"x400Address",void 0);_t.__decorate([(0,ve.AsnProp)({type:zf.Name,context:4,implicit:!1})],Ft.prototype,"directoryName",void 0);_t.__decorate([(0,ve.AsnProp)({type:Ws,context:5})],Ft.prototype,"ediPartyName",void 0);_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.IA5String,context:6,implicit:!0})],Ft.prototype,"uniformResourceIdentifier",void 0);_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.OctetString,context:7,implicit:!0,converter:Ht.AsnIpConverter})],Ft.prototype,"iPAddress",void 0);_t.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.ObjectIdentifier,context:8,implicit:!0})],Ft.prototype,"registeredID",void 0);Ht.GeneralName=Ft=_t.__decorate([(0,ve.AsnType)({type:ve.AsnTypeTypes.Choice})],Ft)});var ye=l(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.id_alg_unsigned=W.id_ce=W.id_ad_caRepository=W.id_ad_timeStamping=W.id_ad_caIssuers=W.id_ad_ocsp=W.id_qt_unotice=W.id_qt_csp=W.id_ad=W.id_kp=W.id_qt=W.id_pe=W.id_pkix=void 0;W.id_pkix="1.3.6.1.5.5.7";W.id_pe=`${W.id_pkix}.1`;W.id_qt=`${W.id_pkix}.2`;W.id_kp=`${W.id_pkix}.3`;W.id_ad=`${W.id_pkix}.48`;W.id_qt_csp=`${W.id_qt}.1`;W.id_qt_unotice=`${W.id_qt}.2`;W.id_ad_ocsp=`${W.id_ad}.1`;W.id_ad_caIssuers=`${W.id_ad}.2`;W.id_ad_timeStamping=`${W.id_ad}.3`;W.id_ad_caRepository=`${W.id_ad}.5`;W.id_ce="2.5.29";W.id_alg_unsigned="1.3.6.1.5.5.7.6.36"});var u_=l(rn=>{"use strict";var o_;Object.defineProperty(rn,"__esModule",{value:!0});rn.AuthorityInfoAccessSyntax=rn.AccessDescription=rn.id_pe_authorityInfoAccess=void 0;var c_=(m(),g(v)),zs=C(),jS=ui(),sk=ye();rn.id_pe_authorityInfoAccess=`${sk.id_pe}.1`;var Js=class{accessMethod="";accessLocation=new jS.GeneralName;constructor(e={}){Object.assign(this,e)}};rn.AccessDescription=Js;c_.__decorate([(0,zs.AsnProp)({type:zs.AsnPropTypes.ObjectIdentifier})],Js.prototype,"accessMethod",void 0);c_.__decorate([(0,zs.AsnProp)({type:jS.GeneralName})],Js.prototype,"accessLocation",void 0);var a_=o_=class extends zs.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,o_.prototype)}};rn.AuthorityInfoAccessSyntax=a_;rn.AuthorityInfoAccessSyntax=a_=o_=c_.__decorate([(0,zs.AsnType)({type:zs.AsnTypeTypes.Sequence,itemType:Js})],a_)});var f_=l(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.AuthorityKeyIdentifier=En.KeyIdentifier=En.id_ce_authorityKeyIdentifier=void 0;var l_=(m(),g(v)),Xs=C(),ok=ui(),ak=ye();En.id_ce_authorityKeyIdentifier=`${ak.id_ce}.35`;var Jf=class extends Xs.OctetString{};En.KeyIdentifier=Jf;var Ys=class{keyIdentifier;authorityCertIssuer;authorityCertSerialNumber;constructor(e={}){e&&Object.assign(this,e)}};En.AuthorityKeyIdentifier=Ys;l_.__decorate([(0,Xs.AsnProp)({type:Jf,context:0,optional:!0,implicit:!0})],Ys.prototype,"keyIdentifier",void 0);l_.__decorate([(0,Xs.AsnProp)({type:ok.GeneralName,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ys.prototype,"authorityCertIssuer",void 0);l_.__decorate([(0,Xs.AsnProp)({type:Xs.AsnPropTypes.Integer,context:2,optional:!0,implicit:!0,converter:Xs.AsnIntegerArrayBufferConverter})],Ys.prototype,"authorityCertSerialNumber",void 0)});var qS=l(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.BasicConstraints=Zs.id_ce_basicConstraints=void 0;var NS=(m(),g(v)),Xf=C(),ck=ye();Zs.id_ce_basicConstraints=`${ck.id_ce}.19`;var Sc=class{cA=!1;pathLenConstraint;constructor(e={}){Object.assign(this,e)}};Zs.BasicConstraints=Sc;NS.__decorate([(0,Xf.AsnProp)({type:Xf.AsnPropTypes.Boolean,defaultValue:!1})],Sc.prototype,"cA",void 0);NS.__decorate([(0,Xf.AsnProp)({type:Xf.AsnPropTypes.Integer,optional:!0})],Sc.prototype,"pathLenConstraint",void 0)});var Cc=l(wc=>{"use strict";var d_;Object.defineProperty(wc,"__esModule",{value:!0});wc.GeneralNames=void 0;var uk=(m(),g(v)),p_=C(),lk=ui(),h_=d_=class extends p_.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,d_.prototype)}};wc.GeneralNames=h_;wc.GeneralNames=h_=d_=uk.__decorate([(0,p_.AsnType)({type:p_.AsnTypeTypes.Sequence,itemType:lk.GeneralName})],h_)});var MS=l(li=>{"use strict";var y_;Object.defineProperty(li,"__esModule",{value:!0});li.CertificateIssuer=li.id_ce_certificateIssuer=void 0;var fk=(m(),g(v)),RS=C(),dk=Cc(),pk=ye();li.id_ce_certificateIssuer=`${pk.id_ce}.29`;var __=y_=class extends dk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,y_.prototype)}};li.CertificateIssuer=__;li.CertificateIssuer=__=y_=fk.__decorate([(0,RS.AsnType)({type:RS.AsnTypeTypes.Sequence})],__)});var DS=l(Se=>{"use strict";var g_;Object.defineProperty(Se,"__esModule",{value:!0});Se.CertificatePolicies=Se.PolicyInformation=Se.PolicyQualifierInfo=Se.Qualifier=Se.UserNotice=Se.NoticeReference=Se.DisplayText=Se.id_ce_certificatePolicies_anyPolicy=Se.id_ce_certificatePolicies=void 0;var Qe=(m(),g(v)),ne=C(),hk=ye();Se.id_ce_certificatePolicies=`${hk.id_ce}.32`;Se.id_ce_certificatePolicies_anyPolicy=`${Se.id_ce_certificatePolicies}.0`;var kr=class{ia5String;visibleString;bmpString;utf8String;constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};Se.DisplayText=kr;Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.IA5String})],kr.prototype,"ia5String",void 0);Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.VisibleString})],kr.prototype,"visibleString",void 0);Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.BmpString})],kr.prototype,"bmpString",void 0);Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.Utf8String})],kr.prototype,"utf8String",void 0);Se.DisplayText=kr=Qe.__decorate([(0,ne.AsnType)({type:ne.AsnTypeTypes.Choice})],kr);var Qs=class{organization=new kr;noticeNumbers=[];constructor(e={}){Object.assign(this,e)}};Se.NoticeReference=Qs;Qe.__decorate([(0,ne.AsnProp)({type:kr})],Qs.prototype,"organization",void 0);Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.Integer,repeated:"sequence"})],Qs.prototype,"noticeNumbers",void 0);var eo=class{noticeRef;explicitText;constructor(e={}){Object.assign(this,e)}};Se.UserNotice=eo;Qe.__decorate([(0,ne.AsnProp)({type:Qs,optional:!0})],eo.prototype,"noticeRef",void 0);Qe.__decorate([(0,ne.AsnProp)({type:kr,optional:!0})],eo.prototype,"explicitText",void 0);var Pc=class{cPSuri;userNotice;constructor(e={}){Object.assign(this,e)}};Se.Qualifier=Pc;Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.IA5String})],Pc.prototype,"cPSuri",void 0);Qe.__decorate([(0,ne.AsnProp)({type:eo})],Pc.prototype,"userNotice",void 0);Se.Qualifier=Pc=Qe.__decorate([(0,ne.AsnType)({type:ne.AsnTypeTypes.Choice})],Pc);var to=class{policyQualifierId="";qualifier=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Se.PolicyQualifierInfo=to;Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.ObjectIdentifier})],to.prototype,"policyQualifierId",void 0);Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.Any})],to.prototype,"qualifier",void 0);var ro=class{policyIdentifier="";policyQualifiers;constructor(e={}){Object.assign(this,e)}};Se.PolicyInformation=ro;Qe.__decorate([(0,ne.AsnProp)({type:ne.AsnPropTypes.ObjectIdentifier})],ro.prototype,"policyIdentifier",void 0);Qe.__decorate([(0,ne.AsnProp)({type:to,repeated:"sequence",optional:!0})],ro.prototype,"policyQualifiers",void 0);var v_=g_=class extends ne.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,g_.prototype)}};Se.CertificatePolicies=v_;Se.CertificatePolicies=v_=g_=Qe.__decorate([(0,ne.AsnType)({type:ne.AsnTypeTypes.Sequence,itemType:ro})],v_)});var m_=l(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.CRLNumber=fi.id_ce_cRLNumber=void 0;var US=(m(),g(v)),Yf=C(),yk=ye();fi.id_ce_cRLNumber=`${yk.id_ce}.20`;var Zf=class{value;constructor(e=0){this.value=e}};fi.CRLNumber=Zf;US.__decorate([(0,Yf.AsnProp)({type:Yf.AsnPropTypes.Integer})],Zf.prototype,"value",void 0);fi.CRLNumber=Zf=US.__decorate([(0,Yf.AsnType)({type:Yf.AsnTypeTypes.Choice})],Zf)});var LS=l(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.BaseCRLNumber=di.id_ce_deltaCRLIndicator=void 0;var _k=(m(),g(v)),$S=C(),gk=ye(),vk=m_();di.id_ce_deltaCRLIndicator=`${gk.id_ce}.27`;var A_=class extends vk.CRLNumber{};di.BaseCRLNumber=A_;di.BaseCRLNumber=A_=_k.__decorate([(0,$S.AsnType)({type:$S.AsnTypeTypes.Choice})],A_)});var ed=l(rt=>{"use strict";var b_;Object.defineProperty(rt,"__esModule",{value:!0});rt.CRLDistributionPoints=rt.DistributionPoint=rt.DistributionPointName=rt.Reason=rt.ReasonFlags=rt.id_ce_cRLDistributionPoints=void 0;var hi=(m(),g(v)),nr=C(),mk=Ks(),VS=ui(),Ak=ye();rt.id_ce_cRLDistributionPoints=`${Ak.id_ce}.31`;var rr;(function(r){r[r.unused=1]="unused",r[r.keyCompromise=2]="keyCompromise",r[r.cACompromise=4]="cACompromise",r[r.affiliationChanged=8]="affiliationChanged",r[r.superseded=16]="superseded",r[r.cessationOfOperation=32]="cessationOfOperation",r[r.certificateHold=64]="certificateHold",r[r.privilegeWithdrawn=128]="privilegeWithdrawn",r[r.aACompromise=256]="aACompromise"})(rr||(rt.ReasonFlags=rr={}));var Qf=class extends nr.BitString{toJSON(){let e=[],t=this.toNumber();return t&rr.aACompromise&&e.push("aACompromise"),t&rr.affiliationChanged&&e.push("affiliationChanged"),t&rr.cACompromise&&e.push("cACompromise"),t&rr.certificateHold&&e.push("certificateHold"),t&rr.cessationOfOperation&&e.push("cessationOfOperation"),t&rr.keyCompromise&&e.push("keyCompromise"),t&rr.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&rr.superseded&&e.push("superseded"),t&rr.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}};rt.Reason=Qf;var no=class{fullName;nameRelativeToCRLIssuer;constructor(e={}){Object.assign(this,e)}};rt.DistributionPointName=no;hi.__decorate([(0,nr.AsnProp)({type:VS.GeneralName,context:0,repeated:"sequence",implicit:!0})],no.prototype,"fullName",void 0);hi.__decorate([(0,nr.AsnProp)({type:mk.RelativeDistinguishedName,context:1,implicit:!0})],no.prototype,"nameRelativeToCRLIssuer",void 0);rt.DistributionPointName=no=hi.__decorate([(0,nr.AsnType)({type:nr.AsnTypeTypes.Choice})],no);var pi=class{distributionPoint;reasons;cRLIssuer;constructor(e={}){Object.assign(this,e)}};rt.DistributionPoint=pi;hi.__decorate([(0,nr.AsnProp)({type:no,context:0,optional:!0})],pi.prototype,"distributionPoint",void 0);hi.__decorate([(0,nr.AsnProp)({type:Qf,context:1,optional:!0,implicit:!0})],pi.prototype,"reasons",void 0);hi.__decorate([(0,nr.AsnProp)({type:VS.GeneralName,context:2,optional:!0,repeated:"sequence",implicit:!0})],pi.prototype,"cRLIssuer",void 0);var S_=b_=class extends nr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,b_.prototype)}};rt.CRLDistributionPoints=S_;rt.CRLDistributionPoints=S_=b_=hi.__decorate([(0,nr.AsnType)({type:nr.AsnTypeTypes.Sequence,itemType:pi})],S_)});var KS=l(yi=>{"use strict";var w_;Object.defineProperty(yi,"__esModule",{value:!0});yi.FreshestCRL=yi.id_ce_freshestCRL=void 0;var bk=(m(),g(v)),HS=C(),Sk=ye(),FS=ed();yi.id_ce_freshestCRL=`${Sk.id_ce}.46`;var C_=w_=class extends FS.CRLDistributionPoints{constructor(e){super(e),Object.setPrototypeOf(this,w_.prototype)}};yi.FreshestCRL=C_;yi.FreshestCRL=C_=w_=bk.__decorate([(0,HS.AsnType)({type:HS.AsnTypeTypes.Sequence,itemType:FS.DistributionPoint})],C_)});var WS=l(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.IssuingDistributionPoint=io.id_ce_issuingDistributionPoint=void 0;var so=(m(),g(v)),Br=C(),wk=ye(),GS=ed();io.id_ce_issuingDistributionPoint=`${wk.id_ce}.28`;var Tt=class r{static ONLY=!1;distributionPoint;onlyContainsUserCerts=r.ONLY;onlyContainsCACerts=r.ONLY;onlySomeReasons;indirectCRL=r.ONLY;onlyContainsAttributeCerts=r.ONLY;constructor(e={}){Object.assign(this,e)}};io.IssuingDistributionPoint=Tt;so.__decorate([(0,Br.AsnProp)({type:GS.DistributionPointName,context:0,optional:!0})],Tt.prototype,"distributionPoint",void 0);so.__decorate([(0,Br.AsnProp)({type:Br.AsnPropTypes.Boolean,context:1,defaultValue:Tt.ONLY,implicit:!0})],Tt.prototype,"onlyContainsUserCerts",void 0);so.__decorate([(0,Br.AsnProp)({type:Br.AsnPropTypes.Boolean,context:2,defaultValue:Tt.ONLY,implicit:!0})],Tt.prototype,"onlyContainsCACerts",void 0);so.__decorate([(0,Br.AsnProp)({type:GS.Reason,context:3,optional:!0,implicit:!0})],Tt.prototype,"onlySomeReasons",void 0);so.__decorate([(0,Br.AsnProp)({type:Br.AsnPropTypes.Boolean,context:4,defaultValue:Tt.ONLY,implicit:!0})],Tt.prototype,"indirectCRL",void 0);so.__decorate([(0,Br.AsnProp)({type:Br.AsnPropTypes.Boolean,context:5,defaultValue:Tt.ONLY,implicit:!0})],Tt.prototype,"onlyContainsAttributeCerts",void 0)});var JS=l(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.CRLReason=nn.CRLReasons=nn.id_ce_cRLReasons=void 0;var zS=(m(),g(v)),td=C(),Ck=ye();nn.id_ce_cRLReasons=`${Ck.id_ce}.21`;var xc;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(xc||(nn.CRLReasons=xc={}));var rd=class{reason=xc.unspecified;constructor(e=xc.unspecified){this.reason=e}toJSON(){return xc[this.reason]}toString(){return this.toJSON()}};nn.CRLReason=rd;zS.__decorate([(0,td.AsnProp)({type:td.AsnPropTypes.Enumerated})],rd.prototype,"reason",void 0);nn.CRLReason=rd=zS.__decorate([(0,td.AsnType)({type:td.AsnTypeTypes.Choice})],rd)});var XS=l(Ee=>{"use strict";var P_;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.id_kp_OCSPSigning=Ee.id_kp_timeStamping=Ee.id_kp_emailProtection=Ee.id_kp_codeSigning=Ee.id_kp_clientAuth=Ee.id_kp_serverAuth=Ee.anyExtendedKeyUsage=Ee.ExtendedKeyUsage=Ee.id_ce_extKeyUsage=void 0;var Pk=(m(),g(v)),nd=C(),_i=ye();Ee.id_ce_extKeyUsage=`${_i.id_ce}.37`;var x_=P_=class extends nd.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,P_.prototype)}};Ee.ExtendedKeyUsage=x_;Ee.ExtendedKeyUsage=x_=P_=Pk.__decorate([(0,nd.AsnType)({type:nd.AsnTypeTypes.Sequence,itemType:nd.AsnPropTypes.ObjectIdentifier})],x_);Ee.anyExtendedKeyUsage=`${Ee.id_ce_extKeyUsage}.0`;Ee.id_kp_serverAuth=`${_i.id_kp}.1`;Ee.id_kp_clientAuth=`${_i.id_kp}.2`;Ee.id_kp_codeSigning=`${_i.id_kp}.3`;Ee.id_kp_emailProtection=`${_i.id_kp}.4`;Ee.id_kp_timeStamping=`${_i.id_kp}.8`;Ee.id_kp_OCSPSigning=`${_i.id_kp}.9`});var ZS=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.InhibitAnyPolicy=gi.id_ce_inhibitAnyPolicy=void 0;var YS=(m(),g(v)),Tc=C(),xk=ye();gi.id_ce_inhibitAnyPolicy=`${xk.id_ce}.54`;var id=class{value;constructor(e=new ArrayBuffer(0)){this.value=e}};gi.InhibitAnyPolicy=id;YS.__decorate([(0,Tc.AsnProp)({type:Tc.AsnPropTypes.Integer,converter:Tc.AsnIntegerArrayBufferConverter})],id.prototype,"value",void 0);gi.InhibitAnyPolicy=id=YS.__decorate([(0,Tc.AsnType)({type:Tc.AsnTypeTypes.Choice})],id)});var e1=l(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.InvalidityDate=vi.id_ce_invalidityDate=void 0;var QS=(m(),g(v)),sd=C(),Tk=ye();vi.id_ce_invalidityDate=`${Tk.id_ce}.24`;var od=class{value=new Date;constructor(e){e&&(this.value=e)}};vi.InvalidityDate=od;QS.__decorate([(0,sd.AsnProp)({type:sd.AsnPropTypes.GeneralizedTime})],od.prototype,"value",void 0);vi.InvalidityDate=od=QS.__decorate([(0,sd.AsnType)({type:sd.AsnTypeTypes.Choice})],od)});var r1=l(mi=>{"use strict";var T_;Object.defineProperty(mi,"__esModule",{value:!0});mi.IssueAlternativeName=mi.id_ce_issuerAltName=void 0;var Ek=(m(),g(v)),t1=C(),Ik=Cc(),kk=ye();mi.id_ce_issuerAltName=`${kk.id_ce}.18`;var E_=T_=class extends Ik.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,T_.prototype)}};mi.IssueAlternativeName=E_;mi.IssueAlternativeName=E_=T_=Ek.__decorate([(0,t1.AsnType)({type:t1.AsnTypeTypes.Sequence})],E_)});var n1=l(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.KeyUsage=In.KeyUsageFlags=In.id_ce_keyUsage=void 0;var Bk=C(),Ok=ye();In.id_ce_keyUsage=`${Ok.id_ce}.15`;var ir;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(ir||(In.KeyUsageFlags=ir={}));var I_=class extends Bk.BitString{toJSON(){let e=this.toNumber(),t=[];return e&ir.cRLSign&&t.push("crlSign"),e&ir.dataEncipherment&&t.push("dataEncipherment"),e&ir.decipherOnly&&t.push("decipherOnly"),e&ir.digitalSignature&&t.push("digitalSignature"),e&ir.encipherOnly&&t.push("encipherOnly"),e&ir.keyAgreement&&t.push("keyAgreement"),e&ir.keyCertSign&&t.push("keyCertSign"),e&ir.keyEncipherment&&t.push("keyEncipherment"),e&ir.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}};In.KeyUsage=I_});var s1=l(sr=>{"use strict";var k_;Object.defineProperty(sr,"__esModule",{value:!0});sr.NameConstraints=sr.GeneralSubtrees=sr.GeneralSubtree=sr.id_ce_nameConstraints=void 0;var oo=(m(),g(v)),Or=C(),i1=ui(),jk=ye();sr.id_ce_nameConstraints=`${jk.id_ce}.30`;var Ai=class{base=new i1.GeneralName;minimum=0;maximum;constructor(e={}){Object.assign(this,e)}};sr.GeneralSubtree=Ai;oo.__decorate([(0,Or.AsnProp)({type:i1.GeneralName})],Ai.prototype,"base",void 0);oo.__decorate([(0,Or.AsnProp)({type:Or.AsnPropTypes.Integer,context:0,defaultValue:0,implicit:!0})],Ai.prototype,"minimum",void 0);oo.__decorate([(0,Or.AsnProp)({type:Or.AsnPropTypes.Integer,context:1,optional:!0,implicit:!0})],Ai.prototype,"maximum",void 0);var Ec=k_=class extends Or.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,k_.prototype)}};sr.GeneralSubtrees=Ec;sr.GeneralSubtrees=Ec=k_=oo.__decorate([(0,Or.AsnType)({type:Or.AsnTypeTypes.Sequence,itemType:Ai})],Ec);var Ic=class{permittedSubtrees;excludedSubtrees;constructor(e={}){Object.assign(this,e)}};sr.NameConstraints=Ic;oo.__decorate([(0,Or.AsnProp)({type:Ec,context:0,optional:!0,implicit:!0})],Ic.prototype,"permittedSubtrees",void 0);oo.__decorate([(0,Or.AsnProp)({type:Ec,context:1,optional:!0,implicit:!0})],Ic.prototype,"excludedSubtrees",void 0)});var a1=l(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.PolicyConstraints=co.id_ce_policyConstraints=void 0;var o1=(m(),g(v)),ao=C(),Nk=ye();co.id_ce_policyConstraints=`${Nk.id_ce}.36`;var kc=class{requireExplicitPolicy;inhibitPolicyMapping;constructor(e={}){Object.assign(this,e)}};co.PolicyConstraints=kc;o1.__decorate([(0,ao.AsnProp)({type:ao.AsnPropTypes.Integer,context:0,implicit:!0,optional:!0,converter:ao.AsnIntegerArrayBufferConverter})],kc.prototype,"requireExplicitPolicy",void 0);o1.__decorate([(0,ao.AsnProp)({type:ao.AsnPropTypes.Integer,context:1,implicit:!0,optional:!0,converter:ao.AsnIntegerArrayBufferConverter})],kc.prototype,"inhibitPolicyMapping",void 0)});var c1=l(sn=>{"use strict";var B_;Object.defineProperty(sn,"__esModule",{value:!0});sn.PolicyMappings=sn.PolicyMapping=sn.id_ce_policyMappings=void 0;var j_=(m(),g(v)),bi=C(),qk=ye();sn.id_ce_policyMappings=`${qk.id_ce}.33`;var uo=class{issuerDomainPolicy="";subjectDomainPolicy="";constructor(e={}){Object.assign(this,e)}};sn.PolicyMapping=uo;j_.__decorate([(0,bi.AsnProp)({type:bi.AsnPropTypes.ObjectIdentifier})],uo.prototype,"issuerDomainPolicy",void 0);j_.__decorate([(0,bi.AsnProp)({type:bi.AsnPropTypes.ObjectIdentifier})],uo.prototype,"subjectDomainPolicy",void 0);var O_=B_=class extends bi.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,B_.prototype)}};sn.PolicyMappings=O_;sn.PolicyMappings=O_=B_=j_.__decorate([(0,bi.AsnType)({type:bi.AsnTypeTypes.Sequence,itemType:uo})],O_)});var l1=l(Si=>{"use strict";var N_;Object.defineProperty(Si,"__esModule",{value:!0});Si.SubjectAlternativeName=Si.id_ce_subjectAltName=void 0;var Rk=(m(),g(v)),u1=C(),Mk=Cc(),Dk=ye();Si.id_ce_subjectAltName=`${Dk.id_ce}.17`;var q_=N_=class extends Mk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,N_.prototype)}};Si.SubjectAlternativeName=q_;Si.SubjectAlternativeName=q_=N_=Rk.__decorate([(0,u1.AsnType)({type:u1.AsnTypeTypes.Sequence})],q_)});var R_=l(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.Attribute=void 0;var f1=(m(),g(v)),ad=C(),Bc=class{type="";values=[];constructor(e={}){Object.assign(this,e)}};cd.Attribute=Bc;f1.__decorate([(0,ad.AsnProp)({type:ad.AsnPropTypes.ObjectIdentifier})],Bc.prototype,"type",void 0);f1.__decorate([(0,ad.AsnProp)({type:ad.AsnPropTypes.Any,repeated:"set"})],Bc.prototype,"values",void 0)});var d1=l(wi=>{"use strict";var M_;Object.defineProperty(wi,"__esModule",{value:!0});wi.SubjectDirectoryAttributes=wi.id_ce_subjectDirectoryAttributes=void 0;var Uk=(m(),g(v)),D_=C(),$k=R_(),Lk=ye();wi.id_ce_subjectDirectoryAttributes=`${Lk.id_ce}.9`;var U_=M_=class extends D_.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,M_.prototype)}};wi.SubjectDirectoryAttributes=U_;wi.SubjectDirectoryAttributes=U_=M_=Uk.__decorate([(0,D_.AsnType)({type:D_.AsnTypeTypes.Sequence,itemType:$k.Attribute})],U_)});var p1=l(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.SubjectKeyIdentifier=lo.id_ce_subjectKeyIdentifier=void 0;var Vk=ye(),Hk=f_();lo.id_ce_subjectKeyIdentifier=`${Vk.id_ce}.14`;var $_=class extends Hk.KeyIdentifier{};lo.SubjectKeyIdentifier=$_});var y1=l(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.PrivateKeyUsagePeriod=fo.id_ce_privateKeyUsagePeriod=void 0;var h1=(m(),g(v)),ud=C(),Fk=ye();fo.id_ce_privateKeyUsagePeriod=`${Fk.id_ce}.16`;var Oc=class{notBefore;notAfter;constructor(e={}){Object.assign(this,e)}};fo.PrivateKeyUsagePeriod=Oc;h1.__decorate([(0,ud.AsnProp)({type:ud.AsnPropTypes.GeneralizedTime,context:0,implicit:!0,optional:!0})],Oc.prototype,"notBefore",void 0);h1.__decorate([(0,ud.AsnProp)({type:ud.AsnPropTypes.GeneralizedTime,context:1,implicit:!0,optional:!0})],Oc.prototype,"notAfter",void 0)});var g1=l(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.EntrustVersionInfo=jr.EntrustInfo=jr.EntrustInfoFlags=jr.id_entrust_entrustVersInfo=void 0;var _1=(m(),g(v)),ld=C();jr.id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var jc;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(jc||(jr.EntrustInfoFlags=jc={}));var Nc=class extends ld.BitString{toJSON(){let e=[],t=this.toNumber();return t&jc.pKIXCertificate&&e.push("pKIXCertificate"),t&jc.newExtensions&&e.push("newExtensions"),t&jc.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}};jr.EntrustInfo=Nc;var qc=class{entrustVers="";entrustInfoFlags=new Nc;constructor(e={}){Object.assign(this,e)}};jr.EntrustVersionInfo=qc;_1.__decorate([(0,ld.AsnProp)({type:ld.AsnPropTypes.GeneralString})],qc.prototype,"entrustVers",void 0);_1.__decorate([(0,ld.AsnProp)({type:Nc})],qc.prototype,"entrustInfoFlags",void 0)});var v1=l(Ci=>{"use strict";var L_;Object.defineProperty(Ci,"__esModule",{value:!0});Ci.SubjectInfoAccessSyntax=Ci.id_pe_subjectInfoAccess=void 0;var Kk=(m(),g(v)),V_=C(),Gk=ye(),Wk=u_();Ci.id_pe_subjectInfoAccess=`${Gk.id_pe}.11`;var H_=L_=class extends V_.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,L_.prototype)}};Ci.SubjectInfoAccessSyntax=H_;Ci.SubjectInfoAccessSyntax=H_=L_=Kk.__decorate([(0,V_.AsnType)({type:V_.AsnTypeTypes.Sequence,itemType:Wk.AccessDescription})],H_)});var m1=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});var me=(m(),g(v));me.__exportStar(u_(),ue);me.__exportStar(f_(),ue);me.__exportStar(qS(),ue);me.__exportStar(MS(),ue);me.__exportStar(DS(),ue);me.__exportStar(LS(),ue);me.__exportStar(ed(),ue);me.__exportStar(KS(),ue);me.__exportStar(WS(),ue);me.__exportStar(m_(),ue);me.__exportStar(JS(),ue);me.__exportStar(XS(),ue);me.__exportStar(ZS(),ue);me.__exportStar(e1(),ue);me.__exportStar(r1(),ue);me.__exportStar(n1(),ue);me.__exportStar(s1(),ue);me.__exportStar(a1(),ue);me.__exportStar(c1(),ue);me.__exportStar(l1(),ue);me.__exportStar(d1(),ue);me.__exportStar(p1(),ue);me.__exportStar(y1(),ue);me.__exportStar(g1(),ue);me.__exportStar(v1(),ue)});var Pi=l(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.AlgorithmIdentifier=void 0;var A1=(m(),g(v)),fd=C(),zk=$t(),Rc=class r{algorithm="";parameters;constructor(e={}){Object.assign(this,e)}isEqual(e){return e instanceof r&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&(0,zk.equal)(e.parameters,this.parameters)||e.parameters===this.parameters)}};dd.AlgorithmIdentifier=Rc;A1.__decorate([(0,fd.AsnProp)({type:fd.AsnPropTypes.ObjectIdentifier})],Rc.prototype,"algorithm",void 0);A1.__decorate([(0,fd.AsnProp)({type:fd.AsnPropTypes.Any,optional:!0})],Rc.prototype,"parameters",void 0)});var K_=l(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.SubjectPublicKeyInfo=void 0;var b1=(m(),g(v)),F_=C(),S1=Pi(),Mc=class{algorithm=new S1.AlgorithmIdentifier;subjectPublicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};pd.SubjectPublicKeyInfo=Mc;b1.__decorate([(0,F_.AsnProp)({type:S1.AlgorithmIdentifier})],Mc.prototype,"algorithm",void 0);b1.__decorate([(0,F_.AsnProp)({type:F_.AsnPropTypes.BitString})],Mc.prototype,"subjectPublicKey",void 0)});var hd=l(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.Time=void 0;var G_=(m(),g(v)),po=C(),Dc=class{utcTime;generalTime;constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let t=new Date(e);t.setMilliseconds(0),t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){let e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};Uc.Time=Dc;G_.__decorate([(0,po.AsnProp)({type:po.AsnPropTypes.UTCTime})],Dc.prototype,"utcTime",void 0);G_.__decorate([(0,po.AsnProp)({type:po.AsnPropTypes.GeneralizedTime})],Dc.prototype,"generalTime",void 0);Uc.Time=Dc=G_.__decorate([(0,po.AsnType)({type:po.AsnTypeTypes.Choice})],Dc)});var W_=l(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.Validity=void 0;var w1=(m(),g(v)),C1=C(),ho=hd(),$c=class{notBefore=new ho.Time(new Date);notAfter=new ho.Time(new Date);constructor(e){e&&(this.notBefore=new ho.Time(e.notBefore),this.notAfter=new ho.Time(e.notAfter))}};yd.Validity=$c;w1.__decorate([(0,C1.AsnProp)({type:ho.Time})],$c.prototype,"notBefore",void 0);w1.__decorate([(0,C1.AsnProp)({type:ho.Time})],$c.prototype,"notAfter",void 0)});var gd=l(xi=>{"use strict";var z_;Object.defineProperty(xi,"__esModule",{value:!0});xi.Extensions=xi.Extension=void 0;var _d=(m(),g(v)),Nr=C(),kn=class r{static CRITICAL=!1;extnID="";critical=r.CRITICAL;extnValue=new Nr.OctetString;constructor(e={}){Object.assign(this,e)}};xi.Extension=kn;_d.__decorate([(0,Nr.AsnProp)({type:Nr.AsnPropTypes.ObjectIdentifier})],kn.prototype,"extnID",void 0);_d.__decorate([(0,Nr.AsnProp)({type:Nr.AsnPropTypes.Boolean,defaultValue:kn.CRITICAL})],kn.prototype,"critical",void 0);_d.__decorate([(0,Nr.AsnProp)({type:Nr.OctetString})],kn.prototype,"extnValue",void 0);var J_=z_=class extends Nr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,z_.prototype)}};xi.Extensions=J_;xi.Extensions=J_=z_=_d.__decorate([(0,Nr.AsnType)({type:Nr.AsnTypeTypes.Sequence,itemType:kn})],J_)});var X_=l(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.Version=void 0;var P1;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(P1||(vd.Version=P1={}))});var Y_=l(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.TBSCertificate=void 0;var qr=(m(),g(v)),ct=C(),x1=Pi(),md=Ks(),T1=K_(),E1=W_(),Jk=gd(),I1=X_(),Et=class{version=I1.Version.v1;serialNumber=new ArrayBuffer(0);signature=new x1.AlgorithmIdentifier;issuer=new md.Name;validity=new E1.Validity;subject=new md.Name;subjectPublicKeyInfo=new T1.SubjectPublicKeyInfo;issuerUniqueID;subjectUniqueID;extensions;constructor(e={}){Object.assign(this,e)}};Ad.TBSCertificate=Et;qr.__decorate([(0,ct.AsnProp)({type:ct.AsnPropTypes.Integer,context:0,defaultValue:I1.Version.v1})],Et.prototype,"version",void 0);qr.__decorate([(0,ct.AsnProp)({type:ct.AsnPropTypes.Integer,converter:ct.AsnIntegerArrayBufferConverter})],Et.prototype,"serialNumber",void 0);qr.__decorate([(0,ct.AsnProp)({type:x1.AlgorithmIdentifier})],Et.prototype,"signature",void 0);qr.__decorate([(0,ct.AsnProp)({type:md.Name})],Et.prototype,"issuer",void 0);qr.__decorate([(0,ct.AsnProp)({type:E1.Validity})],Et.prototype,"validity",void 0);qr.__decorate([(0,ct.AsnProp)({type:md.Name})],Et.prototype,"subject",void 0);qr.__decorate([(0,ct.AsnProp)({type:T1.SubjectPublicKeyInfo})],Et.prototype,"subjectPublicKeyInfo",void 0);qr.__decorate([(0,ct.AsnProp)({type:ct.AsnPropTypes.BitString,context:1,implicit:!0,optional:!0})],Et.prototype,"issuerUniqueID",void 0);qr.__decorate([(0,ct.AsnProp)({type:ct.AsnPropTypes.BitString,context:2,implicit:!0,optional:!0})],Et.prototype,"subjectUniqueID",void 0);qr.__decorate([(0,ct.AsnProp)({type:Jk.Extensions,context:3,optional:!0})],Et.prototype,"extensions",void 0)});var O1=l(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.Certificate=void 0;var Z_=(m(),g(v)),bd=C(),k1=Pi(),B1=Y_(),yo=class{tbsCertificate=new B1.TBSCertificate;tbsCertificateRaw;signatureAlgorithm=new k1.AlgorithmIdentifier;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Sd.Certificate=yo;Z_.__decorate([(0,bd.AsnProp)({type:B1.TBSCertificate,raw:!0})],yo.prototype,"tbsCertificate",void 0);Z_.__decorate([(0,bd.AsnProp)({type:k1.AlgorithmIdentifier})],yo.prototype,"signatureAlgorithm",void 0);Z_.__decorate([(0,bd.AsnProp)({type:bd.AsnPropTypes.BitString})],yo.prototype,"signatureValue",void 0)});var Q_=l(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.TBSCertList=_o.RevokedCertificate=void 0;var Mr=(m(),g(v)),It=C(),j1=Pi(),N1=Ks(),Lc=hd(),q1=gd(),Ti=class{userCertificate=new ArrayBuffer(0);revocationDate=new Lc.Time;crlEntryExtensions;constructor(e={}){Object.assign(this,e)}};_o.RevokedCertificate=Ti;Mr.__decorate([(0,It.AsnProp)({type:It.AsnPropTypes.Integer,converter:It.AsnIntegerArrayBufferConverter})],Ti.prototype,"userCertificate",void 0);Mr.__decorate([(0,It.AsnProp)({type:Lc.Time})],Ti.prototype,"revocationDate",void 0);Mr.__decorate([(0,It.AsnProp)({type:q1.Extension,optional:!0,repeated:"sequence"})],Ti.prototype,"crlEntryExtensions",void 0);var Rr=class{version;signature=new j1.AlgorithmIdentifier;issuer=new N1.Name;thisUpdate=new Lc.Time;nextUpdate;revokedCertificates;crlExtensions;constructor(e={}){Object.assign(this,e)}};_o.TBSCertList=Rr;Mr.__decorate([(0,It.AsnProp)({type:It.AsnPropTypes.Integer,optional:!0})],Rr.prototype,"version",void 0);Mr.__decorate([(0,It.AsnProp)({type:j1.AlgorithmIdentifier})],Rr.prototype,"signature",void 0);Mr.__decorate([(0,It.AsnProp)({type:N1.Name})],Rr.prototype,"issuer",void 0);Mr.__decorate([(0,It.AsnProp)({type:Lc.Time})],Rr.prototype,"thisUpdate",void 0);Mr.__decorate([(0,It.AsnProp)({type:Lc.Time,optional:!0})],Rr.prototype,"nextUpdate",void 0);Mr.__decorate([(0,It.AsnProp)({type:Ti,repeated:"sequence",optional:!0})],Rr.prototype,"revokedCertificates",void 0);Mr.__decorate([(0,It.AsnProp)({type:q1.Extension,optional:!0,context:0,repeated:"sequence"})],Rr.prototype,"crlExtensions",void 0)});var D1=l(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.CertificateList=void 0;var eg=(m(),g(v)),wd=C(),R1=Pi(),M1=Q_(),go=class{tbsCertList=new M1.TBSCertList;tbsCertListRaw;signatureAlgorithm=new R1.AlgorithmIdentifier;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Cd.CertificateList=go;eg.__decorate([(0,wd.AsnProp)({type:M1.TBSCertList,raw:!0})],go.prototype,"tbsCertList",void 0);eg.__decorate([(0,wd.AsnProp)({type:R1.AlgorithmIdentifier})],go.prototype,"signatureAlgorithm",void 0);eg.__decorate([(0,wd.AsnProp)({type:wd.AsnPropTypes.BitString})],go.prototype,"signature",void 0)});var Q=l(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});var nt=(m(),g(v));nt.__exportStar(m1(),ze);nt.__exportStar(Pi(),ze);nt.__exportStar(R_(),ze);nt.__exportStar(O1(),ze);nt.__exportStar(D1(),ze);nt.__exportStar(gd(),ze);nt.__exportStar(ui(),ze);nt.__exportStar(Cc(),ze);nt.__exportStar(Ks(),ze);nt.__exportStar(ye(),ze);nt.__exportStar(K_(),ze);nt.__exportStar(Q_(),ze);nt.__exportStar(Y_(),ze);nt.__exportStar(hd(),ze);nt.__exportStar(X_(),ze);nt.__exportStar(W_(),ze)});var Hc=l(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.IssuerAndSerialNumber=void 0;var U1=(m(),g(v)),Pd=C(),$1=Q(),Vc=class{issuer=new $1.Name;serialNumber=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};xd.IssuerAndSerialNumber=Vc;U1.__decorate([(0,Pd.AsnProp)({type:$1.Name})],Vc.prototype,"issuer",void 0);U1.__decorate([(0,Pd.AsnProp)({type:Pd.AsnPropTypes.Integer,converter:Pd.AsnIntegerArrayBufferConverter})],Vc.prototype,"serialNumber",void 0)});var rg=l(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.SignerIdentifier=void 0;var tg=(m(),g(v)),Td=C(),Xk=Q(),Yk=Hc(),Fc=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};Kc.SignerIdentifier=Fc;tg.__decorate([(0,Td.AsnProp)({type:Xk.SubjectKeyIdentifier,context:0,implicit:!0})],Fc.prototype,"subjectKeyIdentifier",void 0);tg.__decorate([(0,Td.AsnProp)({type:Yk.IssuerAndSerialNumber})],Fc.prototype,"issuerAndSerialNumber",void 0);Kc.SignerIdentifier=Fc=tg.__decorate([(0,Td.AsnType)({type:Td.AsnTypeTypes.Choice})],Fc)});var Dr=l(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.KeyDerivationAlgorithmIdentifier=Ie.MessageAuthenticationCodeAlgorithm=Ie.ContentEncryptionAlgorithmIdentifier=Ie.KeyEncryptionAlgorithmIdentifier=Ie.SignatureAlgorithmIdentifier=Ie.DigestAlgorithmIdentifier=Ie.CMSVersion=void 0;var vo=(m(),g(v)),mo=Q(),Kt=C(),L1;(function(r){r[r.v0=0]="v0",r[r.v1=1]="v1",r[r.v2=2]="v2",r[r.v3=3]="v3",r[r.v4=4]="v4",r[r.v5=5]="v5"})(L1||(Ie.CMSVersion=L1={}));var ng=class extends mo.AlgorithmIdentifier{};Ie.DigestAlgorithmIdentifier=ng;Ie.DigestAlgorithmIdentifier=ng=vo.__decorate([(0,Kt.AsnType)({type:Kt.AsnTypeTypes.Sequence})],ng);var ig=class extends mo.AlgorithmIdentifier{};Ie.SignatureAlgorithmIdentifier=ig;Ie.SignatureAlgorithmIdentifier=ig=vo.__decorate([(0,Kt.AsnType)({type:Kt.AsnTypeTypes.Sequence})],ig);var sg=class extends mo.AlgorithmIdentifier{};Ie.KeyEncryptionAlgorithmIdentifier=sg;Ie.KeyEncryptionAlgorithmIdentifier=sg=vo.__decorate([(0,Kt.AsnType)({type:Kt.AsnTypeTypes.Sequence})],sg);var og=class extends mo.AlgorithmIdentifier{};Ie.ContentEncryptionAlgorithmIdentifier=og;Ie.ContentEncryptionAlgorithmIdentifier=og=vo.__decorate([(0,Kt.AsnType)({type:Kt.AsnTypeTypes.Sequence})],og);var ag=class extends mo.AlgorithmIdentifier{};Ie.MessageAuthenticationCodeAlgorithm=ag;Ie.MessageAuthenticationCodeAlgorithm=ag=vo.__decorate([(0,Kt.AsnType)({type:Kt.AsnTypeTypes.Sequence})],ag);var cg=class extends mo.AlgorithmIdentifier{};Ie.KeyDerivationAlgorithmIdentifier=cg;Ie.KeyDerivationAlgorithmIdentifier=cg=vo.__decorate([(0,Kt.AsnType)({type:Kt.AsnTypeTypes.Sequence})],cg)});var kd=l(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.Attribute=void 0;var V1=(m(),g(v)),Ed=C(),Gc=class{attrType="";attrValues=[];constructor(e={}){Object.assign(this,e)}};Id.Attribute=Gc;V1.__decorate([(0,Ed.AsnProp)({type:Ed.AsnPropTypes.ObjectIdentifier})],Gc.prototype,"attrType",void 0);V1.__decorate([(0,Ed.AsnProp)({type:Ed.AsnPropTypes.Any,repeated:"set"})],Gc.prototype,"attrValues",void 0)});var Bd=l(Ei=>{"use strict";var ug;Object.defineProperty(Ei,"__esModule",{value:!0});Ei.SignerInfos=Ei.SignerInfo=void 0;var Bn=(m(),g(v)),kt=C(),H1=rg(),Wc=Dr(),F1=kd(),or=class{version=Wc.CMSVersion.v0;sid=new H1.SignerIdentifier;digestAlgorithm=new Wc.DigestAlgorithmIdentifier;signedAttrs;signedAttrsRaw;signatureAlgorithm=new Wc.SignatureAlgorithmIdentifier;signature=new kt.OctetString;unsignedAttrs;constructor(e={}){Object.assign(this,e)}};Ei.SignerInfo=or;Bn.__decorate([(0,kt.AsnProp)({type:kt.AsnPropTypes.Integer})],or.prototype,"version",void 0);Bn.__decorate([(0,kt.AsnProp)({type:H1.SignerIdentifier})],or.prototype,"sid",void 0);Bn.__decorate([(0,kt.AsnProp)({type:Wc.DigestAlgorithmIdentifier})],or.prototype,"digestAlgorithm",void 0);Bn.__decorate([(0,kt.AsnProp)({type:F1.Attribute,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],or.prototype,"signedAttrs",void 0);Bn.__decorate([(0,kt.AsnProp)({type:Wc.SignatureAlgorithmIdentifier})],or.prototype,"signatureAlgorithm",void 0);Bn.__decorate([(0,kt.AsnProp)({type:kt.OctetString})],or.prototype,"signature",void 0);Bn.__decorate([(0,kt.AsnProp)({type:F1.Attribute,repeated:"set",context:1,implicit:!0,optional:!0})],or.prototype,"unsignedAttrs",void 0);var lg=ug=class extends kt.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ug.prototype)}};Ei.SignerInfos=lg;Ei.SignerInfos=lg=ug=Bn.__decorate([(0,kt.AsnType)({type:kt.AsnTypeTypes.Set,itemType:or})],lg)});var G1=l(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CounterSignature=Ii.id_counterSignature=void 0;var Zk=(m(),g(v)),K1=C(),Qk=Bd();Ii.id_counterSignature="1.2.840.113549.1.9.6";var fg=class extends Qk.SignerInfo{};Ii.CounterSignature=fg;Ii.CounterSignature=fg=Zk.__decorate([(0,K1.AsnType)({type:K1.AsnTypeTypes.Sequence})],fg)});var W1=l(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.MessageDigest=Ao.id_messageDigest=void 0;var eB=C();Ao.id_messageDigest="1.2.840.113549.1.9.4";var dg=class extends eB.OctetString{};Ao.MessageDigest=dg});var J1=l(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.SigningTime=ki.id_signingTime=void 0;var tB=(m(),g(v)),rB=Q(),z1=C();ki.id_signingTime="1.2.840.113549.1.9.5";var pg=class extends rB.Time{};ki.SigningTime=pg;ki.SigningTime=pg=tB.__decorate([(0,z1.AsnType)({type:z1.AsnTypeTypes.Choice})],pg)});var X1=l(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.id_contentType=void 0;var hg=(m(),g(v));hg.__exportStar(G1(),Bi);hg.__exportStar(W1(),Bi);hg.__exportStar(J1(),Bi);Bi.id_contentType="1.2.840.113549.1.9.3"});var Y1=l(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.ACClearAttrs=void 0;var yg=(m(),g(v)),Od=C(),_g=Q(),bo=class{acIssuer=new _g.GeneralName;acSerial=0;attrs=[];constructor(e={}){Object.assign(this,e)}};jd.ACClearAttrs=bo;yg.__decorate([(0,Od.AsnProp)({type:_g.GeneralName})],bo.prototype,"acIssuer",void 0);yg.__decorate([(0,Od.AsnProp)({type:Od.AsnPropTypes.Integer})],bo.prototype,"acSerial",void 0);yg.__decorate([(0,Od.AsnProp)({type:_g.Attribute,repeated:"sequence"})],bo.prototype,"attrs",void 0)});var mg=l(zc=>{"use strict";var gg;Object.defineProperty(zc,"__esModule",{value:!0});zc.AttrSpec=void 0;var nB=(m(),g(v)),Nd=C(),vg=gg=class extends Nd.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,gg.prototype)}};zc.AttrSpec=vg;zc.AttrSpec=vg=gg=nB.__decorate([(0,Nd.AsnType)({type:Nd.AsnTypeTypes.Sequence,itemType:Nd.AsnPropTypes.ObjectIdentifier})],vg)});var Q1=l(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.AAControls=void 0;var qd=(m(),g(v)),So=C(),Z1=mg(),Oi=class{pathLenConstraint;permittedAttrs;excludedAttrs;permitUnSpecified=!0;constructor(e={}){Object.assign(this,e)}};Rd.AAControls=Oi;qd.__decorate([(0,So.AsnProp)({type:So.AsnPropTypes.Integer,optional:!0})],Oi.prototype,"pathLenConstraint",void 0);qd.__decorate([(0,So.AsnProp)({type:Z1.AttrSpec,implicit:!0,context:0,optional:!0})],Oi.prototype,"permittedAttrs",void 0);qd.__decorate([(0,So.AsnProp)({type:Z1.AttrSpec,implicit:!0,context:1,optional:!0})],Oi.prototype,"excludedAttrs",void 0);qd.__decorate([(0,So.AsnProp)({type:So.AsnPropTypes.Boolean,defaultValue:!0})],Oi.prototype,"permitUnSpecified",void 0)});var Jc=l(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.IssuerSerial=void 0;var Ag=(m(),g(v)),wo=C(),ew=Q(),Co=class{issuer=new ew.GeneralNames;serial=new ArrayBuffer(0);issuerUID=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Md.IssuerSerial=Co;Ag.__decorate([(0,wo.AsnProp)({type:ew.GeneralNames})],Co.prototype,"issuer",void 0);Ag.__decorate([(0,wo.AsnProp)({type:wo.AsnPropTypes.Integer,converter:wo.AsnIntegerArrayBufferConverter})],Co.prototype,"serial",void 0);Ag.__decorate([(0,wo.AsnProp)({type:wo.AsnPropTypes.BitString,optional:!0})],Co.prototype,"issuerUID",void 0)});var Xc=l(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ObjectDigestInfo=Po.DigestedObjectType=void 0;var Dd=(m(),g(v)),ji=C(),tw=Q(),bg;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(bg||(Po.DigestedObjectType=bg={}));var Ni=class{digestedObjectType=bg.publicKey;otherObjectTypeID;digestAlgorithm=new tw.AlgorithmIdentifier;objectDigest=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Po.ObjectDigestInfo=Ni;Dd.__decorate([(0,ji.AsnProp)({type:ji.AsnPropTypes.Enumerated})],Ni.prototype,"digestedObjectType",void 0);Dd.__decorate([(0,ji.AsnProp)({type:ji.AsnPropTypes.ObjectIdentifier,optional:!0})],Ni.prototype,"otherObjectTypeID",void 0);Dd.__decorate([(0,ji.AsnProp)({type:tw.AlgorithmIdentifier})],Ni.prototype,"digestAlgorithm",void 0);Dd.__decorate([(0,ji.AsnProp)({type:ji.AsnPropTypes.BitString})],Ni.prototype,"objectDigest",void 0)});var Cg=l(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.V2Form=void 0;var Sg=(m(),g(v)),wg=C(),iB=Q(),sB=Jc(),oB=Xc(),xo=class{issuerName;baseCertificateID;objectDigestInfo;constructor(e={}){Object.assign(this,e)}};Ud.V2Form=xo;Sg.__decorate([(0,wg.AsnProp)({type:iB.GeneralNames,optional:!0})],xo.prototype,"issuerName",void 0);Sg.__decorate([(0,wg.AsnProp)({type:sB.IssuerSerial,context:0,implicit:!0,optional:!0})],xo.prototype,"baseCertificateID",void 0);Sg.__decorate([(0,wg.AsnProp)({type:oB.ObjectDigestInfo,context:1,implicit:!0,optional:!0})],xo.prototype,"objectDigestInfo",void 0)});var xg=l(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.AttCertIssuer=void 0;var Pg=(m(),g(v)),$d=C(),aB=Q(),cB=Cg(),Yc=class{v1Form;v2Form;constructor(e={}){Object.assign(this,e)}};Zc.AttCertIssuer=Yc;Pg.__decorate([(0,$d.AsnProp)({type:aB.GeneralName,repeated:"sequence"})],Yc.prototype,"v1Form",void 0);Pg.__decorate([(0,$d.AsnProp)({type:cB.V2Form,context:0,implicit:!0})],Yc.prototype,"v2Form",void 0);Zc.AttCertIssuer=Yc=Pg.__decorate([(0,$d.AsnType)({type:$d.AsnTypeTypes.Choice})],Yc)});var Tg=l(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.AttCertValidityPeriod=void 0;var rw=(m(),g(v)),Ld=C(),Qc=class{notBeforeTime=new Date;notAfterTime=new Date;constructor(e={}){Object.assign(this,e)}};Vd.AttCertValidityPeriod=Qc;rw.__decorate([(0,Ld.AsnProp)({type:Ld.AsnPropTypes.GeneralizedTime})],Qc.prototype,"notBeforeTime",void 0);rw.__decorate([(0,Ld.AsnProp)({type:Ld.AsnPropTypes.GeneralizedTime})],Qc.prototype,"notAfterTime",void 0)});var kg=l(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.Holder=void 0;var Eg=(m(),g(v)),Ig=C(),uB=Q(),lB=Jc(),fB=Xc(),To=class{baseCertificateID;entityName;objectDigestInfo;constructor(e={}){Object.assign(this,e)}};Hd.Holder=To;Eg.__decorate([(0,Ig.AsnProp)({type:lB.IssuerSerial,implicit:!0,context:0,optional:!0})],To.prototype,"baseCertificateID",void 0);Eg.__decorate([(0,Ig.AsnProp)({type:uB.GeneralNames,implicit:!0,context:1,optional:!0})],To.prototype,"entityName",void 0);Eg.__decorate([(0,Ig.AsnProp)({type:fB.ObjectDigestInfo,implicit:!0,context:2,optional:!0})],To.prototype,"objectDigestInfo",void 0)});var Og=l(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.AttributeCertificateInfo=Eo.AttCertVersion=void 0;var on=(m(),g(v)),Bt=C(),Fd=Q(),nw=kg(),iw=xg(),sw=Tg(),Bg;(function(r){r[r.v2=1]="v2"})(Bg||(Eo.AttCertVersion=Bg={}));var Gt=class{version=Bg.v2;holder=new nw.Holder;issuer=new iw.AttCertIssuer;signature=new Fd.AlgorithmIdentifier;serialNumber=new ArrayBuffer(0);attrCertValidityPeriod=new sw.AttCertValidityPeriod;attributes=[];issuerUniqueID;extensions;constructor(e={}){Object.assign(this,e)}};Eo.AttributeCertificateInfo=Gt;on.__decorate([(0,Bt.AsnProp)({type:Bt.AsnPropTypes.Integer})],Gt.prototype,"version",void 0);on.__decorate([(0,Bt.AsnProp)({type:nw.Holder})],Gt.prototype,"holder",void 0);on.__decorate([(0,Bt.AsnProp)({type:iw.AttCertIssuer})],Gt.prototype,"issuer",void 0);on.__decorate([(0,Bt.AsnProp)({type:Fd.AlgorithmIdentifier})],Gt.prototype,"signature",void 0);on.__decorate([(0,Bt.AsnProp)({type:Bt.AsnPropTypes.Integer,converter:Bt.AsnIntegerArrayBufferConverter})],Gt.prototype,"serialNumber",void 0);on.__decorate([(0,Bt.AsnProp)({type:sw.AttCertValidityPeriod})],Gt.prototype,"attrCertValidityPeriod",void 0);on.__decorate([(0,Bt.AsnProp)({type:Fd.Attribute,repeated:"sequence"})],Gt.prototype,"attributes",void 0);on.__decorate([(0,Bt.AsnProp)({type:Bt.AsnPropTypes.BitString,optional:!0})],Gt.prototype,"issuerUniqueID",void 0);on.__decorate([(0,Bt.AsnProp)({type:Fd.Extensions,optional:!0})],Gt.prototype,"extensions",void 0)});var cw=l(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.AttributeCertificate=void 0;var jg=(m(),g(v)),Kd=C(),ow=Q(),aw=Og(),Io=class{acinfo=new aw.AttributeCertificateInfo;signatureAlgorithm=new ow.AlgorithmIdentifier;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Gd.AttributeCertificate=Io;jg.__decorate([(0,Kd.AsnProp)({type:aw.AttributeCertificateInfo})],Io.prototype,"acinfo",void 0);jg.__decorate([(0,Kd.AsnProp)({type:ow.AlgorithmIdentifier})],Io.prototype,"signatureAlgorithm",void 0);jg.__decorate([(0,Kd.AsnProp)({type:Kd.AsnPropTypes.BitString})],Io.prototype,"signatureValue",void 0)});var qg=l(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.ClassList=ko.ClassListFlags=void 0;var dB=C(),uw;(function(r){r[r.unmarked=1]="unmarked",r[r.unclassified=2]="unclassified",r[r.restricted=4]="restricted",r[r.confidential=8]="confidential",r[r.secret=16]="secret",r[r.topSecret=32]="topSecret"})(uw||(ko.ClassListFlags=uw={}));var Ng=class extends dB.BitString{};ko.ClassList=Ng});var Rg=l(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.SecurityCategory=void 0;var lw=(m(),g(v)),Wd=C(),eu=class{type="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};zd.SecurityCategory=eu;lw.__decorate([(0,Wd.AsnProp)({type:Wd.AsnPropTypes.ObjectIdentifier,implicit:!0,context:0})],eu.prototype,"type",void 0);lw.__decorate([(0,Wd.AsnProp)({type:Wd.AsnPropTypes.Any,implicit:!0,context:1})],eu.prototype,"value",void 0)});var fw=l(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.Clearance=void 0;var Mg=(m(),g(v)),Jd=C(),tu=qg(),pB=Rg(),Bo=class{policyId="";classList=new tu.ClassList(tu.ClassListFlags.unclassified);securityCategories;constructor(e={}){Object.assign(this,e)}};Xd.Clearance=Bo;Mg.__decorate([(0,Jd.AsnProp)({type:Jd.AsnPropTypes.ObjectIdentifier})],Bo.prototype,"policyId",void 0);Mg.__decorate([(0,Jd.AsnProp)({type:tu.ClassList,defaultValue:new tu.ClassList(tu.ClassListFlags.unclassified)})],Bo.prototype,"classList",void 0);Mg.__decorate([(0,Jd.AsnProp)({type:pB.SecurityCategory,repeated:"set"})],Bo.prototype,"securityCategories",void 0)});var dw=l(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.IetfAttrSyntax=Oo.IetfAttrSyntaxValueChoices=void 0;var nu=(m(),g(v)),On=C(),hB=Q(),qi=class{cotets;oid;string;constructor(e={}){Object.assign(this,e)}};Oo.IetfAttrSyntaxValueChoices=qi;nu.__decorate([(0,On.AsnProp)({type:On.OctetString})],qi.prototype,"cotets",void 0);nu.__decorate([(0,On.AsnProp)({type:On.AsnPropTypes.ObjectIdentifier})],qi.prototype,"oid",void 0);nu.__decorate([(0,On.AsnProp)({type:On.AsnPropTypes.Utf8String})],qi.prototype,"string",void 0);var ru=class{policyAuthority;values=[];constructor(e={}){Object.assign(this,e)}};Oo.IetfAttrSyntax=ru;nu.__decorate([(0,On.AsnProp)({type:hB.GeneralNames,implicit:!0,context:0,optional:!0})],ru.prototype,"policyAuthority",void 0);nu.__decorate([(0,On.AsnProp)({type:qi,repeated:"sequence"})],ru.prototype,"values",void 0)});var pw=l(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.id_at_clearance=ee.id_at_role=ee.id_at=ee.id_aca_encAttrs=ee.id_aca_group=ee.id_aca_chargingIdentity=ee.id_aca_accessIdentity=ee.id_aca_authenticationInfo=ee.id_aca=ee.id_ce_targetInformation=ee.id_pe_ac_proxying=ee.id_pe_aaControls=ee.id_pe_ac_auditIdentity=void 0;var iu=Q();ee.id_pe_ac_auditIdentity=`${iu.id_pe}.4`;ee.id_pe_aaControls=`${iu.id_pe}.6`;ee.id_pe_ac_proxying=`${iu.id_pe}.10`;ee.id_ce_targetInformation=`${iu.id_ce}.55`;ee.id_aca=`${iu.id_pkix}.10`;ee.id_aca_authenticationInfo=`${ee.id_aca}.1`;ee.id_aca_accessIdentity=`${ee.id_aca}.2`;ee.id_aca_chargingIdentity=`${ee.id_aca}.3`;ee.id_aca_group=`${ee.id_aca}.4`;ee.id_aca_encAttrs=`${ee.id_aca}.6`;ee.id_at="2.5.4";ee.id_at_role=`${ee.id_at}.72`;ee.id_at_clearance="2.5.1.5.55"});var Lg=l(Ur=>{"use strict";var Dg;Object.defineProperty(Ur,"__esModule",{value:!0});Ur.Targets=Ur.Target=Ur.TargetCert=void 0;var jn=(m(),g(v)),ar=C(),$g=Q(),hw=Jc(),yB=Xc(),Ri=class{targetCertificate=new hw.IssuerSerial;targetName;certDigestInfo;constructor(e={}){Object.assign(this,e)}};Ur.TargetCert=Ri;jn.__decorate([(0,ar.AsnProp)({type:hw.IssuerSerial})],Ri.prototype,"targetCertificate",void 0);jn.__decorate([(0,ar.AsnProp)({type:$g.GeneralName,optional:!0})],Ri.prototype,"targetName",void 0);jn.__decorate([(0,ar.AsnProp)({type:yB.ObjectDigestInfo,optional:!0})],Ri.prototype,"certDigestInfo",void 0);var Mi=class{targetName;targetGroup;targetCert;constructor(e={}){Object.assign(this,e)}};Ur.Target=Mi;jn.__decorate([(0,ar.AsnProp)({type:$g.GeneralName,context:0,implicit:!0})],Mi.prototype,"targetName",void 0);jn.__decorate([(0,ar.AsnProp)({type:$g.GeneralName,context:1,implicit:!0})],Mi.prototype,"targetGroup",void 0);jn.__decorate([(0,ar.AsnProp)({type:Ri,context:2,implicit:!0})],Mi.prototype,"targetCert",void 0);Ur.Target=Mi=jn.__decorate([(0,ar.AsnType)({type:ar.AsnTypeTypes.Choice})],Mi);var Ug=Dg=class extends ar.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Dg.prototype)}};Ur.Targets=Ug;Ur.Targets=Ug=Dg=jn.__decorate([(0,ar.AsnType)({type:ar.AsnTypeTypes.Sequence,itemType:Mi})],Ug)});var yw=l(su=>{"use strict";var Vg;Object.defineProperty(su,"__esModule",{value:!0});su.ProxyInfo=void 0;var _B=(m(),g(v)),Hg=C(),gB=Lg(),Fg=Vg=class extends Hg.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Vg.prototype)}};su.ProxyInfo=Fg;su.ProxyInfo=Fg=Vg=_B.__decorate([(0,Hg.AsnType)({type:Hg.AsnTypeTypes.Sequence,itemType:gB.Targets})],Fg)});var mw=l(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.RoleSyntax=void 0;var _w=(m(),g(v)),gw=C(),vw=Q(),ou=class{roleAuthority;roleName;constructor(e={}){Object.assign(this,e)}};Yd.RoleSyntax=ou;_w.__decorate([(0,gw.AsnProp)({type:vw.GeneralNames,implicit:!0,context:0,optional:!0})],ou.prototype,"roleAuthority",void 0);_w.__decorate([(0,gw.AsnProp)({type:vw.GeneralName,implicit:!0,context:1})],ou.prototype,"roleName",void 0)});var Aw=l(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.SvceAuthInfo=void 0;var Kg=(m(),g(v)),Zd=C(),Qd=Q(),jo=class{service=new Qd.GeneralName;ident=new Qd.GeneralName;authInfo;constructor(e={}){Object.assign(this,e)}};ep.SvceAuthInfo=jo;Kg.__decorate([(0,Zd.AsnProp)({type:Qd.GeneralName})],jo.prototype,"service",void 0);Kg.__decorate([(0,Zd.AsnProp)({type:Qd.GeneralName})],jo.prototype,"ident",void 0);Kg.__decorate([(0,Zd.AsnProp)({type:Zd.OctetString,optional:!0})],jo.prototype,"authInfo",void 0)});var Gg=l(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});var Me=(m(),g(v));Me.__exportStar(Y1(),ke);Me.__exportStar(Q1(),ke);Me.__exportStar(xg(),ke);Me.__exportStar(Tg(),ke);Me.__exportStar(mg(),ke);Me.__exportStar(cw(),ke);Me.__exportStar(Og(),ke);Me.__exportStar(qg(),ke);Me.__exportStar(fw(),ke);Me.__exportStar(kg(),ke);Me.__exportStar(dw(),ke);Me.__exportStar(Jc(),ke);Me.__exportStar(Xc(),ke);Me.__exportStar(pw(),ke);Me.__exportStar(yw(),ke);Me.__exportStar(mw(),ke);Me.__exportStar(Rg(),ke);Me.__exportStar(Aw(),ke);Me.__exportStar(Lg(),ke);Me.__exportStar(Cg(),ke)});var tp=l($r=>{"use strict";var Wg;Object.defineProperty($r,"__esModule",{value:!0});$r.CertificateSet=$r.CertificateChoices=$r.OtherCertificateFormat=void 0;var Ui=(m(),g(v)),Wt=C(),vB=Q(),mB=Gg(),No=class{otherCertFormat="";otherCert=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};$r.OtherCertificateFormat=No;Ui.__decorate([(0,Wt.AsnProp)({type:Wt.AsnPropTypes.ObjectIdentifier})],No.prototype,"otherCertFormat",void 0);Ui.__decorate([(0,Wt.AsnProp)({type:Wt.AsnPropTypes.Any})],No.prototype,"otherCert",void 0);var Di=class{certificate;v2AttrCert;other;constructor(e={}){Object.assign(this,e)}};$r.CertificateChoices=Di;Ui.__decorate([(0,Wt.AsnProp)({type:vB.Certificate})],Di.prototype,"certificate",void 0);Ui.__decorate([(0,Wt.AsnProp)({type:mB.AttributeCertificate,context:2,implicit:!0})],Di.prototype,"v2AttrCert",void 0);Ui.__decorate([(0,Wt.AsnProp)({type:No,context:3,implicit:!0})],Di.prototype,"other",void 0);$r.CertificateChoices=Di=Ui.__decorate([(0,Wt.AsnType)({type:Wt.AsnTypeTypes.Choice})],Di);var zg=Wg=class extends Wt.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Wg.prototype)}};$r.CertificateSet=zg;$r.CertificateSet=zg=Wg=Ui.__decorate([(0,Wt.AsnType)({type:Wt.AsnTypeTypes.Set,itemType:Di})],zg)});var Sw=l(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.ContentInfo=void 0;var bw=(m(),g(v)),rp=C(),au=class{contentType="";content=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};np.ContentInfo=au;bw.__decorate([(0,rp.AsnProp)({type:rp.AsnPropTypes.ObjectIdentifier})],au.prototype,"contentType",void 0);bw.__decorate([(0,rp.AsnProp)({type:rp.AsnPropTypes.Any,context:0})],au.prototype,"content",void 0)});var Jg=l($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.EncapsulatedContentInfo=$i.EncapsulatedContent=void 0;var uu=(m(),g(v)),an=C(),qo=class{single;any;constructor(e={}){Object.assign(this,e)}};$i.EncapsulatedContent=qo;uu.__decorate([(0,an.AsnProp)({type:an.OctetString})],qo.prototype,"single",void 0);uu.__decorate([(0,an.AsnProp)({type:an.AsnPropTypes.Any})],qo.prototype,"any",void 0);$i.EncapsulatedContent=qo=uu.__decorate([(0,an.AsnType)({type:an.AsnTypeTypes.Choice})],qo);var cu=class{eContentType="";eContent;constructor(e={}){Object.assign(this,e)}};$i.EncapsulatedContentInfo=cu;uu.__decorate([(0,an.AsnProp)({type:an.AsnPropTypes.ObjectIdentifier})],cu.prototype,"eContentType",void 0);uu.__decorate([(0,an.AsnProp)({type:qo,context:0,optional:!0})],cu.prototype,"eContent",void 0)});var Xg=l(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.EncryptedContentInfo=Li.EncryptedContent=void 0;var Do=(m(),g(v)),cr=C(),ww=Dr(),Ro=class{value;constructedValue;constructor(e={}){Object.assign(this,e)}};Li.EncryptedContent=Ro;Do.__decorate([(0,cr.AsnProp)({type:cr.OctetString,context:0,implicit:!0,optional:!0})],Ro.prototype,"value",void 0);Do.__decorate([(0,cr.AsnProp)({type:cr.OctetString,converter:cr.AsnConstructedOctetStringConverter,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Ro.prototype,"constructedValue",void 0);Li.EncryptedContent=Ro=Do.__decorate([(0,cr.AsnType)({type:cr.AsnTypeTypes.Choice})],Ro);var Mo=class{contentType="";contentEncryptionAlgorithm=new ww.ContentEncryptionAlgorithmIdentifier;encryptedContent;constructor(e={}){Object.assign(this,e)}};Li.EncryptedContentInfo=Mo;Do.__decorate([(0,cr.AsnProp)({type:cr.AsnPropTypes.ObjectIdentifier})],Mo.prototype,"contentType",void 0);Do.__decorate([(0,cr.AsnProp)({type:ww.ContentEncryptionAlgorithmIdentifier})],Mo.prototype,"contentEncryptionAlgorithm",void 0);Do.__decorate([(0,cr.AsnProp)({type:Ro,optional:!0})],Mo.prototype,"encryptedContent",void 0)});var Yg=l(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.OtherKeyAttribute=void 0;var Cw=(m(),g(v)),ip=C(),lu=class{keyAttrId="";keyAttr;constructor(e={}){Object.assign(this,e)}};sp.OtherKeyAttribute=lu;Cw.__decorate([(0,ip.AsnProp)({type:ip.AsnPropTypes.ObjectIdentifier})],lu.prototype,"keyAttrId",void 0);Cw.__decorate([(0,ip.AsnProp)({type:ip.AsnPropTypes.Any,optional:!0})],lu.prototype,"keyAttr",void 0)});var ev=l(He=>{"use strict";var Zg;Object.defineProperty(He,"__esModule",{value:!0});He.KeyAgreeRecipientInfo=He.OriginatorIdentifierOrKey=He.OriginatorPublicKey=He.RecipientEncryptedKeys=He.RecipientEncryptedKey=He.KeyAgreeRecipientIdentifier=He.RecipientKeyIdentifier=void 0;var De=(m(),g(v)),ie=C(),du=Q(),Qg=Dr(),Pw=Hc(),AB=Yg(),Vi=class{subjectKeyIdentifier=new du.SubjectKeyIdentifier;date;other;constructor(e={}){Object.assign(this,e)}};He.RecipientKeyIdentifier=Vi;De.__decorate([(0,ie.AsnProp)({type:du.SubjectKeyIdentifier})],Vi.prototype,"subjectKeyIdentifier",void 0);De.__decorate([(0,ie.AsnProp)({type:ie.AsnPropTypes.GeneralizedTime,optional:!0})],Vi.prototype,"date",void 0);De.__decorate([(0,ie.AsnProp)({type:AB.OtherKeyAttribute,optional:!0})],Vi.prototype,"other",void 0);var Hi=class{rKeyId;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};He.KeyAgreeRecipientIdentifier=Hi;De.__decorate([(0,ie.AsnProp)({type:Vi,context:0,implicit:!0,optional:!0})],Hi.prototype,"rKeyId",void 0);De.__decorate([(0,ie.AsnProp)({type:Pw.IssuerAndSerialNumber,optional:!0})],Hi.prototype,"issuerAndSerialNumber",void 0);He.KeyAgreeRecipientIdentifier=Hi=De.__decorate([(0,ie.AsnType)({type:ie.AsnTypeTypes.Choice})],Hi);var Uo=class{rid=new Hi;encryptedKey=new ie.OctetString;constructor(e={}){Object.assign(this,e)}};He.RecipientEncryptedKey=Uo;De.__decorate([(0,ie.AsnProp)({type:Hi})],Uo.prototype,"rid",void 0);De.__decorate([(0,ie.AsnProp)({type:ie.OctetString})],Uo.prototype,"encryptedKey",void 0);var fu=Zg=class extends ie.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Zg.prototype)}};He.RecipientEncryptedKeys=fu;He.RecipientEncryptedKeys=fu=Zg=De.__decorate([(0,ie.AsnType)({type:ie.AsnTypeTypes.Sequence,itemType:Uo})],fu);var $o=class{algorithm=new du.AlgorithmIdentifier;publicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};He.OriginatorPublicKey=$o;De.__decorate([(0,ie.AsnProp)({type:du.AlgorithmIdentifier})],$o.prototype,"algorithm",void 0);De.__decorate([(0,ie.AsnProp)({type:ie.AsnPropTypes.BitString})],$o.prototype,"publicKey",void 0);var Nn=class{subjectKeyIdentifier;originatorKey;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};He.OriginatorIdentifierOrKey=Nn;De.__decorate([(0,ie.AsnProp)({type:du.SubjectKeyIdentifier,context:0,implicit:!0,optional:!0})],Nn.prototype,"subjectKeyIdentifier",void 0);De.__decorate([(0,ie.AsnProp)({type:$o,context:1,implicit:!0,optional:!0})],Nn.prototype,"originatorKey",void 0);De.__decorate([(0,ie.AsnProp)({type:Pw.IssuerAndSerialNumber,optional:!0})],Nn.prototype,"issuerAndSerialNumber",void 0);He.OriginatorIdentifierOrKey=Nn=De.__decorate([(0,ie.AsnType)({type:ie.AsnTypeTypes.Choice})],Nn);var qn=class{version=Qg.CMSVersion.v3;originator=new Nn;ukm;keyEncryptionAlgorithm=new Qg.KeyEncryptionAlgorithmIdentifier;recipientEncryptedKeys=new fu;constructor(e={}){Object.assign(this,e)}};He.KeyAgreeRecipientInfo=qn;De.__decorate([(0,ie.AsnProp)({type:ie.AsnPropTypes.Integer})],qn.prototype,"version",void 0);De.__decorate([(0,ie.AsnProp)({type:Nn,context:0})],qn.prototype,"originator",void 0);De.__decorate([(0,ie.AsnProp)({type:ie.OctetString,context:1,optional:!0})],qn.prototype,"ukm",void 0);De.__decorate([(0,ie.AsnProp)({type:Qg.KeyEncryptionAlgorithmIdentifier})],qn.prototype,"keyEncryptionAlgorithm",void 0);De.__decorate([(0,ie.AsnProp)({type:fu})],qn.prototype,"recipientEncryptedKeys",void 0)});var rv=l(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.KeyTransRecipientInfo=Gi.RecipientIdentifier=void 0;var Wi=(m(),g(v)),ur=C(),bB=Q(),tv=Dr(),SB=Hc(),Fi=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};Gi.RecipientIdentifier=Fi;Wi.__decorate([(0,ur.AsnProp)({type:bB.SubjectKeyIdentifier,context:0,implicit:!0})],Fi.prototype,"subjectKeyIdentifier",void 0);Wi.__decorate([(0,ur.AsnProp)({type:SB.IssuerAndSerialNumber})],Fi.prototype,"issuerAndSerialNumber",void 0);Gi.RecipientIdentifier=Fi=Wi.__decorate([(0,ur.AsnType)({type:ur.AsnTypeTypes.Choice})],Fi);var Ki=class{version=tv.CMSVersion.v0;rid=new Fi;keyEncryptionAlgorithm=new tv.KeyEncryptionAlgorithmIdentifier;encryptedKey=new ur.OctetString;constructor(e={}){Object.assign(this,e)}};Gi.KeyTransRecipientInfo=Ki;Wi.__decorate([(0,ur.AsnProp)({type:ur.AsnPropTypes.Integer})],Ki.prototype,"version",void 0);Wi.__decorate([(0,ur.AsnProp)({type:Fi})],Ki.prototype,"rid",void 0);Wi.__decorate([(0,ur.AsnProp)({type:tv.KeyEncryptionAlgorithmIdentifier})],Ki.prototype,"keyEncryptionAlgorithm",void 0);Wi.__decorate([(0,ur.AsnProp)({type:ur.OctetString})],Ki.prototype,"encryptedKey",void 0)});var iv=l(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.KEKRecipientInfo=Lo.KEKIdentifier=void 0;var Ji=(m(),g(v)),Ot=C(),wB=Yg(),nv=Dr(),Rn=class{keyIdentifier=new Ot.OctetString;date;other;constructor(e={}){Object.assign(this,e)}};Lo.KEKIdentifier=Rn;Ji.__decorate([(0,Ot.AsnProp)({type:Ot.OctetString})],Rn.prototype,"keyIdentifier",void 0);Ji.__decorate([(0,Ot.AsnProp)({type:Ot.AsnPropTypes.GeneralizedTime,optional:!0})],Rn.prototype,"date",void 0);Ji.__decorate([(0,Ot.AsnProp)({type:wB.OtherKeyAttribute,optional:!0})],Rn.prototype,"other",void 0);var zi=class{version=nv.CMSVersion.v4;kekid=new Rn;keyEncryptionAlgorithm=new nv.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Ot.OctetString;constructor(e={}){Object.assign(this,e)}};Lo.KEKRecipientInfo=zi;Ji.__decorate([(0,Ot.AsnProp)({type:Ot.AsnPropTypes.Integer})],zi.prototype,"version",void 0);Ji.__decorate([(0,Ot.AsnProp)({type:Rn})],zi.prototype,"kekid",void 0);Ji.__decorate([(0,Ot.AsnProp)({type:nv.KeyEncryptionAlgorithmIdentifier})],zi.prototype,"keyEncryptionAlgorithm",void 0);Ji.__decorate([(0,Ot.AsnProp)({type:Ot.OctetString})],zi.prototype,"encryptedKey",void 0)});var sv=l(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.PasswordRecipientInfo=void 0;var ap=(m(),g(v)),Xi=C(),op=Dr(),Yi=class{version=op.CMSVersion.v0;keyDerivationAlgorithm;keyEncryptionAlgorithm=new op.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Xi.OctetString;constructor(e={}){Object.assign(this,e)}};cp.PasswordRecipientInfo=Yi;ap.__decorate([(0,Xi.AsnProp)({type:Xi.AsnPropTypes.Integer})],Yi.prototype,"version",void 0);ap.__decorate([(0,Xi.AsnProp)({type:op.KeyDerivationAlgorithmIdentifier,context:0,optional:!0})],Yi.prototype,"keyDerivationAlgorithm",void 0);ap.__decorate([(0,Xi.AsnProp)({type:op.KeyEncryptionAlgorithmIdentifier})],Yi.prototype,"keyEncryptionAlgorithm",void 0);ap.__decorate([(0,Xi.AsnProp)({type:Xi.OctetString})],Yi.prototype,"encryptedKey",void 0)});var ov=l(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.RecipientInfo=Zi.OtherRecipientInfo=void 0;var Dn=(m(),g(v)),lr=C(),CB=ev(),PB=rv(),xB=iv(),TB=sv(),Vo=class{oriType="";oriValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Zi.OtherRecipientInfo=Vo;Dn.__decorate([(0,lr.AsnProp)({type:lr.AsnPropTypes.ObjectIdentifier})],Vo.prototype,"oriType",void 0);Dn.__decorate([(0,lr.AsnProp)({type:lr.AsnPropTypes.Any})],Vo.prototype,"oriValue",void 0);var Mn=class{ktri;kari;kekri;pwri;ori;constructor(e={}){Object.assign(this,e)}};Zi.RecipientInfo=Mn;Dn.__decorate([(0,lr.AsnProp)({type:PB.KeyTransRecipientInfo,optional:!0})],Mn.prototype,"ktri",void 0);Dn.__decorate([(0,lr.AsnProp)({type:CB.KeyAgreeRecipientInfo,context:1,implicit:!0,optional:!0})],Mn.prototype,"kari",void 0);Dn.__decorate([(0,lr.AsnProp)({type:xB.KEKRecipientInfo,context:2,implicit:!0,optional:!0})],Mn.prototype,"kekri",void 0);Dn.__decorate([(0,lr.AsnProp)({type:TB.PasswordRecipientInfo,context:3,implicit:!0,optional:!0})],Mn.prototype,"pwri",void 0);Dn.__decorate([(0,lr.AsnProp)({type:Vo,context:4,implicit:!0,optional:!0})],Mn.prototype,"ori",void 0);Zi.RecipientInfo=Mn=Dn.__decorate([(0,lr.AsnType)({type:lr.AsnTypeTypes.Choice})],Mn)});var lv=l(pu=>{"use strict";var av;Object.defineProperty(pu,"__esModule",{value:!0});pu.RecipientInfos=void 0;var EB=(m(),g(v)),cv=C(),IB=ov(),uv=av=class extends cv.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,av.prototype)}};pu.RecipientInfos=uv;pu.RecipientInfos=uv=av=EB.__decorate([(0,cv.AsnType)({type:cv.AsnTypeTypes.Set,itemType:IB.RecipientInfo})],uv)});var up=l(Je=>{"use strict";var fv;Object.defineProperty(Je,"__esModule",{value:!0});Je.RevocationInfoChoices=Je.RevocationInfoChoice=Je.OtherRevocationInfoFormat=Je.id_ri_scvp=Je.id_ri_ocsp_response=Je.id_ri=void 0;var yu=(m(),g(v)),Lr=C(),kB=Q();Je.id_ri=`${kB.id_pkix}.16`;Je.id_ri_ocsp_response=`${Je.id_ri}.2`;Je.id_ri_scvp=`${Je.id_ri}.4`;var Qi=class{otherRevInfoFormat="";otherRevInfo=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Je.OtherRevocationInfoFormat=Qi;yu.__decorate([(0,Lr.AsnProp)({type:Lr.AsnPropTypes.ObjectIdentifier})],Qi.prototype,"otherRevInfoFormat",void 0);yu.__decorate([(0,Lr.AsnProp)({type:Lr.AsnPropTypes.Any})],Qi.prototype,"otherRevInfo",void 0);var hu=class{other=new Qi;constructor(e={}){Object.assign(this,e)}};Je.RevocationInfoChoice=hu;yu.__decorate([(0,Lr.AsnProp)({type:Qi,context:1,implicit:!0})],hu.prototype,"other",void 0);Je.RevocationInfoChoice=hu=yu.__decorate([(0,Lr.AsnType)({type:Lr.AsnTypeTypes.Choice})],hu);var dv=fv=class extends Lr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,fv.prototype)}};Je.RevocationInfoChoices=dv;Je.RevocationInfoChoices=dv=fv=yu.__decorate([(0,Lr.AsnType)({type:Lr.AsnTypeTypes.Set,itemType:hu})],dv)});var pv=l(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.OriginatorInfo=void 0;var xw=(m(),g(v)),Tw=C(),BB=tp(),OB=up(),_u=class{certs;crls;constructor(e={}){Object.assign(this,e)}};lp.OriginatorInfo=_u;xw.__decorate([(0,Tw.AsnProp)({type:BB.CertificateSet,context:0,implicit:!0,optional:!0})],_u.prototype,"certs",void 0);xw.__decorate([(0,Tw.AsnProp)({type:OB.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],_u.prototype,"crls",void 0)});var kw=l(es=>{"use strict";var hv;Object.defineProperty(es,"__esModule",{value:!0});es.EnvelopedData=es.UnprotectedAttributes=void 0;var Ho=(m(),g(v)),cn=C(),jB=Dr(),NB=kd(),Ew=lv(),qB=pv(),Iw=Xg(),fp=hv=class extends cn.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,hv.prototype)}};es.UnprotectedAttributes=fp;es.UnprotectedAttributes=fp=hv=Ho.__decorate([(0,cn.AsnType)({type:cn.AsnTypeTypes.Set,itemType:NB.Attribute})],fp);var Un=class{version=jB.CMSVersion.v0;originatorInfo;recipientInfos=new Ew.RecipientInfos;encryptedContentInfo=new Iw.EncryptedContentInfo;unprotectedAttrs;constructor(e={}){Object.assign(this,e)}};es.EnvelopedData=Un;Ho.__decorate([(0,cn.AsnProp)({type:cn.AsnPropTypes.Integer})],Un.prototype,"version",void 0);Ho.__decorate([(0,cn.AsnProp)({type:qB.OriginatorInfo,context:0,implicit:!0,optional:!0})],Un.prototype,"originatorInfo",void 0);Ho.__decorate([(0,cn.AsnProp)({type:Ew.RecipientInfos})],Un.prototype,"recipientInfos",void 0);Ho.__decorate([(0,cn.AsnProp)({type:Iw.EncryptedContentInfo})],Un.prototype,"encryptedContentInfo",void 0);Ho.__decorate([(0,cn.AsnProp)({type:fp,context:1,implicit:!0,optional:!0})],Un.prototype,"unprotectedAttrs",void 0)});var Bw=l(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.id_authData=it.id_encryptedData=it.id_digestedData=it.id_envelopedData=it.id_signedData=it.id_data=it.id_ct_contentInfo=void 0;it.id_ct_contentInfo="1.2.840.113549.1.9.16.1.6";it.id_data="1.2.840.113549.1.7.1";it.id_signedData="1.2.840.113549.1.7.2";it.id_envelopedData="1.2.840.113549.1.7.3";it.id_digestedData="1.2.840.113549.1.7.5";it.id_encryptedData="1.2.840.113549.1.7.6";it.id_authData="1.2.840.113549.1.9.16.1.2"});var qw=l(ts=>{"use strict";var yv;Object.defineProperty(ts,"__esModule",{value:!0});ts.SignedData=ts.DigestAlgorithmIdentifiers=void 0;var rs=(m(),g(v)),Vr=C(),RB=tp(),Ow=Dr(),jw=Jg(),MB=up(),Nw=Bd(),gu=yv=class extends Vr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,yv.prototype)}};ts.DigestAlgorithmIdentifiers=gu;ts.DigestAlgorithmIdentifiers=gu=yv=rs.__decorate([(0,Vr.AsnType)({type:Vr.AsnTypeTypes.Set,itemType:Ow.DigestAlgorithmIdentifier})],gu);var un=class{version=Ow.CMSVersion.v0;digestAlgorithms=new gu;encapContentInfo=new jw.EncapsulatedContentInfo;certificates;crls;signerInfos=new Nw.SignerInfos;constructor(e={}){Object.assign(this,e)}};ts.SignedData=un;rs.__decorate([(0,Vr.AsnProp)({type:Vr.AsnPropTypes.Integer})],un.prototype,"version",void 0);rs.__decorate([(0,Vr.AsnProp)({type:gu})],un.prototype,"digestAlgorithms",void 0);rs.__decorate([(0,Vr.AsnProp)({type:jw.EncapsulatedContentInfo})],un.prototype,"encapContentInfo",void 0);rs.__decorate([(0,Vr.AsnProp)({type:RB.CertificateSet,context:0,implicit:!0,optional:!0})],un.prototype,"certificates",void 0);rs.__decorate([(0,Vr.AsnProp)({type:MB.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],un.prototype,"crls",void 0);rs.__decorate([(0,Vr.AsnProp)({type:Nw.SignerInfos})],un.prototype,"signerInfos",void 0)});var vu=l(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});var Ne=(m(),g(v));Ne.__exportStar(X1(),Pe);Ne.__exportStar(kd(),Pe);Ne.__exportStar(tp(),Pe);Ne.__exportStar(Sw(),Pe);Ne.__exportStar(Jg(),Pe);Ne.__exportStar(Xg(),Pe);Ne.__exportStar(kw(),Pe);Ne.__exportStar(Hc(),Pe);Ne.__exportStar(iv(),Pe);Ne.__exportStar(ev(),Pe);Ne.__exportStar(rv(),Pe);Ne.__exportStar(Bw(),Pe);Ne.__exportStar(pv(),Pe);Ne.__exportStar(sv(),Pe);Ne.__exportStar(ov(),Pe);Ne.__exportStar(lv(),Pe);Ne.__exportStar(up(),Pe);Ne.__exportStar(qw(),Pe);Ne.__exportStar(rg(),Pe);Ne.__exportStar(Bd(),Pe);Ne.__exportStar(Dr(),Pe)});var _v=l(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.id_sect571r1=K.id_sect571k1=K.id_secp521r1=K.id_sect409r1=K.id_sect409k1=K.id_secp384r1=K.id_sect283r1=K.id_sect283k1=K.id_secp256r1=K.id_sect233r1=K.id_sect233k1=K.id_secp224r1=K.id_sect163r2=K.id_sect163k1=K.id_secp192r1=K.id_ecdsaWithSHA512=K.id_ecdsaWithSHA384=K.id_ecdsaWithSHA256=K.id_ecdsaWithSHA224=K.id_ecdsaWithSHA1=K.id_ecMQV=K.id_ecDH=K.id_ecPublicKey=void 0;K.id_ecPublicKey="1.2.840.10045.2.1";K.id_ecDH="1.3.132.1.12";K.id_ecMQV="1.3.132.1.13";K.id_ecdsaWithSHA1="1.2.840.10045.4.1";K.id_ecdsaWithSHA224="1.2.840.10045.4.3.1";K.id_ecdsaWithSHA256="1.2.840.10045.4.3.2";K.id_ecdsaWithSHA384="1.2.840.10045.4.3.3";K.id_ecdsaWithSHA512="1.2.840.10045.4.3.4";K.id_secp192r1="1.2.840.10045.3.1.1";K.id_sect163k1="1.3.132.0.1";K.id_sect163r2="1.3.132.0.15";K.id_secp224r1="1.3.132.0.33";K.id_sect233k1="1.3.132.0.26";K.id_sect233r1="1.3.132.0.27";K.id_secp256r1="1.2.840.10045.3.1.7";K.id_sect283k1="1.3.132.0.16";K.id_sect283r1="1.3.132.0.17";K.id_secp384r1="1.3.132.0.34";K.id_sect409k1="1.3.132.0.36";K.id_sect409r1="1.3.132.0.37";K.id_secp521r1="1.3.132.0.35";K.id_sect571k1="1.3.132.0.38";K.id_sect571r1="1.3.132.0.39"});var Rw=l(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.ecdsaWithSHA512=zt.ecdsaWithSHA384=zt.ecdsaWithSHA256=zt.ecdsaWithSHA224=zt.ecdsaWithSHA1=void 0;var DB=(m(),g(v)),UB=Q(),mu=DB.__importStar(_v());function Au(r){return new UB.AlgorithmIdentifier({algorithm:r})}zt.ecdsaWithSHA1=Au(mu.id_ecdsaWithSHA1);zt.ecdsaWithSHA224=Au(mu.id_ecdsaWithSHA224);zt.ecdsaWithSHA256=Au(mu.id_ecdsaWithSHA256);zt.ecdsaWithSHA384=Au(mu.id_ecdsaWithSHA384);zt.ecdsaWithSHA512=Au(mu.id_ecdsaWithSHA512)});var mv=l(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.SpecifiedECDomain=et.ECPVer=et.Curve=et.FieldElement=et.ECPoint=et.FieldID=void 0;var gt=(m(),g(v)),ae=C(),Fo=class{fieldType;parameters;constructor(e={}){Object.assign(this,e)}};et.FieldID=Fo;gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.ObjectIdentifier})],Fo.prototype,"fieldType",void 0);gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.Any})],Fo.prototype,"parameters",void 0);et.FieldID=Fo=gt.__decorate([(0,ae.AsnType)({type:ae.AsnTypeTypes.Sequence})],Fo);var dp=class extends ae.OctetString{};et.ECPoint=dp;var gv=class extends ae.OctetString{};et.FieldElement=gv;var ns=class{a;b;seed;constructor(e={}){Object.assign(this,e)}};et.Curve=ns;gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.OctetString})],ns.prototype,"a",void 0);gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.OctetString})],ns.prototype,"b",void 0);gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.BitString,optional:!0})],ns.prototype,"seed",void 0);et.Curve=ns=gt.__decorate([(0,ae.AsnType)({type:ae.AsnTypeTypes.Sequence})],ns);var vv;(function(r){r[r.ecpVer1=1]="ecpVer1"})(vv||(et.ECPVer=vv={}));var ln=class{version=vv.ecpVer1;fieldID;curve;base;order;cofactor;constructor(e={}){Object.assign(this,e)}};et.SpecifiedECDomain=ln;gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.Integer})],ln.prototype,"version",void 0);gt.__decorate([(0,ae.AsnProp)({type:Fo})],ln.prototype,"fieldID",void 0);gt.__decorate([(0,ae.AsnProp)({type:ns})],ln.prototype,"curve",void 0);gt.__decorate([(0,ae.AsnProp)({type:dp})],ln.prototype,"base",void 0);gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.Integer,converter:ae.AsnIntegerArrayBufferConverter})],ln.prototype,"order",void 0);gt.__decorate([(0,ae.AsnProp)({type:ae.AsnPropTypes.Integer,optional:!0})],ln.prototype,"cofactor",void 0);et.SpecifiedECDomain=ln=gt.__decorate([(0,ae.AsnType)({type:ae.AsnTypeTypes.Sequence})],ln)});var Av=l(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.ECParameters=void 0;var pp=(m(),g(v)),is=C(),$B=mv(),Ko=class{namedCurve;implicitCurve;specifiedCurve;constructor(e={}){Object.assign(this,e)}};bu.ECParameters=Ko;pp.__decorate([(0,is.AsnProp)({type:is.AsnPropTypes.ObjectIdentifier})],Ko.prototype,"namedCurve",void 0);pp.__decorate([(0,is.AsnProp)({type:is.AsnPropTypes.Null})],Ko.prototype,"implicitCurve",void 0);pp.__decorate([(0,is.AsnProp)({type:$B.SpecifiedECDomain})],Ko.prototype,"specifiedCurve",void 0);bu.ECParameters=Ko=pp.__decorate([(0,is.AsnType)({type:is.AsnTypeTypes.Choice})],Ko)});var Mw=l(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.ECPrivateKey=void 0;var hp=(m(),g(v)),$n=C(),LB=Av(),ss=class{version=1;privateKey=new $n.OctetString;parameters;publicKey;constructor(e={}){Object.assign(this,e)}};yp.ECPrivateKey=ss;hp.__decorate([(0,$n.AsnProp)({type:$n.AsnPropTypes.Integer})],ss.prototype,"version",void 0);hp.__decorate([(0,$n.AsnProp)({type:$n.OctetString})],ss.prototype,"privateKey",void 0);hp.__decorate([(0,$n.AsnProp)({type:LB.ECParameters,context:0,optional:!0})],ss.prototype,"parameters",void 0);hp.__decorate([(0,$n.AsnProp)({type:$n.AsnPropTypes.BitString,context:1,optional:!0})],ss.prototype,"publicKey",void 0)});var Uw=l(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.ECDSASigValue=void 0;var Dw=(m(),g(v)),Go=C(),Su=class{r=new ArrayBuffer(0);s=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};_p.ECDSASigValue=Su;Dw.__decorate([(0,Go.AsnProp)({type:Go.AsnPropTypes.Integer,converter:Go.AsnIntegerArrayBufferConverter})],Su.prototype,"r",void 0);Dw.__decorate([(0,Go.AsnProp)({type:Go.AsnPropTypes.Integer,converter:Go.AsnIntegerArrayBufferConverter})],Su.prototype,"s",void 0)});var $w=l(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});var Wo=(m(),g(v));Wo.__exportStar(Rw(),Ln);Wo.__exportStar(Av(),Ln);Wo.__exportStar(Mw(),Ln);Wo.__exportStar(Uw(),Ln);Wo.__exportStar(_v(),Ln);Wo.__exportStar(mv(),Ln)});var wu=l(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.id_mgf1=O.id_md5=O.id_md2=O.id_sha512_256=O.id_sha512_224=O.id_sha512=O.id_sha384=O.id_sha256=O.id_sha224=O.id_sha1=O.id_sha512_256WithRSAEncryption=O.id_sha512_224WithRSAEncryption=O.id_sha512WithRSAEncryption=O.id_sha384WithRSAEncryption=O.id_sha256WithRSAEncryption=O.id_ssha224WithRSAEncryption=O.id_sha224WithRSAEncryption=O.id_sha1WithRSAEncryption=O.id_md5WithRSAEncryption=O.id_md2WithRSAEncryption=O.id_RSASSA_PSS=O.id_pSpecified=O.id_RSAES_OAEP=O.id_rsaEncryption=O.id_pkcs_1=void 0;O.id_pkcs_1="1.2.840.113549.1.1";O.id_rsaEncryption=`${O.id_pkcs_1}.1`;O.id_RSAES_OAEP=`${O.id_pkcs_1}.7`;O.id_pSpecified=`${O.id_pkcs_1}.9`;O.id_RSASSA_PSS=`${O.id_pkcs_1}.10`;O.id_md2WithRSAEncryption=`${O.id_pkcs_1}.2`;O.id_md5WithRSAEncryption=`${O.id_pkcs_1}.4`;O.id_sha1WithRSAEncryption=`${O.id_pkcs_1}.5`;O.id_sha224WithRSAEncryption=`${O.id_pkcs_1}.14`;O.id_ssha224WithRSAEncryption=O.id_sha224WithRSAEncryption;O.id_sha256WithRSAEncryption=`${O.id_pkcs_1}.11`;O.id_sha384WithRSAEncryption=`${O.id_pkcs_1}.12`;O.id_sha512WithRSAEncryption=`${O.id_pkcs_1}.13`;O.id_sha512_224WithRSAEncryption=`${O.id_pkcs_1}.15`;O.id_sha512_256WithRSAEncryption=`${O.id_pkcs_1}.16`;O.id_sha1="1.3.14.3.2.26";O.id_sha224="2.16.840.1.101.3.4.2.4";O.id_sha256="2.16.840.1.101.3.4.2.1";O.id_sha384="2.16.840.1.101.3.4.2.2";O.id_sha512="2.16.840.1.101.3.4.2.3";O.id_sha512_224="2.16.840.1.101.3.4.2.5";O.id_sha512_256="2.16.840.1.101.3.4.2.6";O.id_md2="1.2.840.113549.2.2";O.id_md5="1.2.840.113549.2.5";O.id_mgf1=`${O.id_pkcs_1}.8`});var gp=l(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.sha512_256WithRSAEncryption=G.sha512_224WithRSAEncryption=G.sha512WithRSAEncryption=G.sha384WithRSAEncryption=G.sha256WithRSAEncryption=G.sha224WithRSAEncryption=G.sha1WithRSAEncryption=G.md5WithRSAEncryption=G.md2WithRSAEncryption=G.rsaEncryption=G.pSpecifiedEmpty=G.mgf1SHA1=G.sha512_256=G.sha512_224=G.sha512=G.sha384=G.sha256=G.sha224=G.sha1=G.md4=G.md2=void 0;var VB=(m(),g(v)),bv=C(),Sv=Q(),qe=VB.__importStar(wu());function Fe(r){return new Sv.AlgorithmIdentifier({algorithm:r,parameters:null})}G.md2=Fe(qe.id_md2);G.md4=Fe(qe.id_md5);G.sha1=Fe(qe.id_sha1);G.sha224=Fe(qe.id_sha224);G.sha256=Fe(qe.id_sha256);G.sha384=Fe(qe.id_sha384);G.sha512=Fe(qe.id_sha512);G.sha512_224=Fe(qe.id_sha512_224);G.sha512_256=Fe(qe.id_sha512_256);G.mgf1SHA1=new Sv.AlgorithmIdentifier({algorithm:qe.id_mgf1,parameters:bv.AsnConvert.serialize(G.sha1)});G.pSpecifiedEmpty=new Sv.AlgorithmIdentifier({algorithm:qe.id_pSpecified,parameters:bv.AsnConvert.serialize(bv.AsnOctetStringConverter.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});G.rsaEncryption=Fe(qe.id_rsaEncryption);G.md2WithRSAEncryption=Fe(qe.id_md2WithRSAEncryption);G.md5WithRSAEncryption=Fe(qe.id_md5WithRSAEncryption);G.sha1WithRSAEncryption=Fe(qe.id_sha1WithRSAEncryption);G.sha224WithRSAEncryption=Fe(qe.id_sha512_224WithRSAEncryption);G.sha256WithRSAEncryption=Fe(qe.id_sha512_256WithRSAEncryption);G.sha384WithRSAEncryption=Fe(qe.id_sha384WithRSAEncryption);G.sha512WithRSAEncryption=Fe(qe.id_sha512WithRSAEncryption);G.sha512_224WithRSAEncryption=Fe(qe.id_sha512_224WithRSAEncryption);G.sha512_256WithRSAEncryption=Fe(qe.id_sha512_256WithRSAEncryption)});var Vw=l(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.RSAES_OAEP=Jo.RsaEsOaepParams=void 0;var wv=(m(),g(v)),Cu=C(),os=Q(),Lw=wu(),zo=gp(),as=class{hashAlgorithm=new os.AlgorithmIdentifier(zo.sha1);maskGenAlgorithm=new os.AlgorithmIdentifier({algorithm:Lw.id_mgf1,parameters:Cu.AsnConvert.serialize(zo.sha1)});pSourceAlgorithm=new os.AlgorithmIdentifier(zo.pSpecifiedEmpty);constructor(e={}){Object.assign(this,e)}};Jo.RsaEsOaepParams=as;wv.__decorate([(0,Cu.AsnProp)({type:os.AlgorithmIdentifier,context:0,defaultValue:zo.sha1})],as.prototype,"hashAlgorithm",void 0);wv.__decorate([(0,Cu.AsnProp)({type:os.AlgorithmIdentifier,context:1,defaultValue:zo.mgf1SHA1})],as.prototype,"maskGenAlgorithm",void 0);wv.__decorate([(0,Cu.AsnProp)({type:os.AlgorithmIdentifier,context:2,defaultValue:zo.pSpecifiedEmpty})],as.prototype,"pSourceAlgorithm",void 0);Jo.RSAES_OAEP=new os.AlgorithmIdentifier({algorithm:Lw.id_RSAES_OAEP,parameters:Cu.AsnConvert.serialize(new as)})});var Fw=l(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.RSASSA_PSS=Xo.RsaSaPssParams=void 0;var mp=(m(),g(v)),Vn=C(),Pu=Q(),Hw=wu(),vp=gp(),Hn=class{hashAlgorithm=new Pu.AlgorithmIdentifier(vp.sha1);maskGenAlgorithm=new Pu.AlgorithmIdentifier({algorithm:Hw.id_mgf1,parameters:Vn.AsnConvert.serialize(vp.sha1)});saltLength=20;trailerField=1;constructor(e={}){Object.assign(this,e)}};Xo.RsaSaPssParams=Hn;mp.__decorate([(0,Vn.AsnProp)({type:Pu.AlgorithmIdentifier,context:0,defaultValue:vp.sha1})],Hn.prototype,"hashAlgorithm",void 0);mp.__decorate([(0,Vn.AsnProp)({type:Pu.AlgorithmIdentifier,context:1,defaultValue:vp.mgf1SHA1})],Hn.prototype,"maskGenAlgorithm",void 0);mp.__decorate([(0,Vn.AsnProp)({type:Vn.AsnPropTypes.Integer,context:2,defaultValue:20})],Hn.prototype,"saltLength",void 0);mp.__decorate([(0,Vn.AsnProp)({type:Vn.AsnPropTypes.Integer,context:3,defaultValue:1})],Hn.prototype,"trailerField",void 0);Xo.RSASSA_PSS=new Pu.AlgorithmIdentifier({algorithm:Hw.id_RSASSA_PSS,parameters:Vn.AsnConvert.serialize(new Hn)})});var Ww=l(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.DigestInfo=void 0;var Kw=(m(),g(v)),Gw=Q(),Ap=C(),xu=class{digestAlgorithm=new Gw.AlgorithmIdentifier;digest=new Ap.OctetString;constructor(e={}){Object.assign(this,e)}};bp.DigestInfo=xu;Kw.__decorate([(0,Ap.AsnProp)({type:Gw.AlgorithmIdentifier})],xu.prototype,"digestAlgorithm",void 0);Kw.__decorate([(0,Ap.AsnProp)({type:Ap.OctetString})],xu.prototype,"digest",void 0)});var zw=l(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});var Cv=(m(),g(v));Cv.__exportStar(Vw(),Tu);Cv.__exportStar(Fw(),Tu);Cv.__exportStar(Ww(),Tu)});var Tv=l(us=>{"use strict";var Pv;Object.defineProperty(us,"__esModule",{value:!0});us.OtherPrimeInfos=us.OtherPrimeInfo=void 0;var Sp=(m(),g(v)),Jt=C(),cs=class{prime=new ArrayBuffer(0);exponent=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};us.OtherPrimeInfo=cs;Sp.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.Integer,converter:Jt.AsnIntegerArrayBufferConverter})],cs.prototype,"prime",void 0);Sp.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.Integer,converter:Jt.AsnIntegerArrayBufferConverter})],cs.prototype,"exponent",void 0);Sp.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.Integer,converter:Jt.AsnIntegerArrayBufferConverter})],cs.prototype,"coefficient",void 0);var xv=Pv=class extends Jt.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Pv.prototype)}};us.OtherPrimeInfos=xv;us.OtherPrimeInfos=xv=Pv=Sp.__decorate([(0,Jt.AsnType)({type:Jt.AsnTypeTypes.Sequence,itemType:cs})],xv)});var Jw=l(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.RSAPrivateKey=void 0;var Hr=(m(),g(v)),le=C(),HB=Tv(),jt=class{version=0;modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);privateExponent=new ArrayBuffer(0);prime1=new ArrayBuffer(0);prime2=new ArrayBuffer(0);exponent1=new ArrayBuffer(0);exponent2=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);otherPrimeInfos;constructor(e={}){Object.assign(this,e)}};wp.RSAPrivateKey=jt;Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer})],jt.prototype,"version",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"modulus",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"publicExponent",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"privateExponent",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"prime1",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"prime2",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"exponent1",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"exponent2",void 0);Hr.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,converter:le.AsnIntegerArrayBufferConverter})],jt.prototype,"coefficient",void 0);Hr.__decorate([(0,le.AsnProp)({type:HB.OtherPrimeInfos,optional:!0})],jt.prototype,"otherPrimeInfos",void 0)});var Yw=l(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.RSAPublicKey=void 0;var Xw=(m(),g(v)),Yo=C(),Eu=class{modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Cp.RSAPublicKey=Eu;Xw.__decorate([(0,Yo.AsnProp)({type:Yo.AsnPropTypes.Integer,converter:Yo.AsnIntegerArrayBufferConverter})],Eu.prototype,"modulus",void 0);Xw.__decorate([(0,Yo.AsnProp)({type:Yo.AsnPropTypes.Integer,converter:Yo.AsnIntegerArrayBufferConverter})],Eu.prototype,"publicExponent",void 0)});var Ev=l(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});var Zo=(m(),g(v));Zo.__exportStar(zw(),Fn);Zo.__exportStar(gp(),Fn);Zo.__exportStar(wu(),Fn);Zo.__exportStar(Tv(),Fn);Zo.__exportStar(Jw(),Fn);Zo.__exportStar(Yw(),Fn)});var Pp={};qA(Pp,{__assign:()=>kv,__asyncDelegator:()=>rO,__asyncGenerator:()=>tO,__asyncValues:()=>nO,__await:()=>Iu,__awaiter:()=>JB,__classPrivateFieldGet:()=>aO,__classPrivateFieldSet:()=>cO,__createBinding:()=>YB,__decorate:()=>GB,__exportStar:()=>ZB,__extends:()=>FB,__generator:()=>XB,__importDefault:()=>oO,__importStar:()=>sO,__makeTemplateObject:()=>iO,__metadata:()=>zB,__param:()=>WB,__read:()=>Zw,__rest:()=>KB,__spread:()=>QB,__spreadArrays:()=>eO,__values:()=>Bv});function FB(r,e){Iv(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function KB(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function GB(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function WB(r,e){return function(t,n){e(t,n,r)}}function zB(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function JB(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{u(n.next(d))}catch(p){o(p)}}function c(d){try{u(n.throw(d))}catch(p){o(p)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function XB(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function YB(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function ZB(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Bv(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zw(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s}function QB(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Zw(arguments[e]));return r}function eO(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Iu(r){return this instanceof Iu?(this.v=r,this):new Iu(r)}function tO(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(_){n[_]&&(i[_]=function(E){return new Promise(function(U,$){s.push([_,E,U,$])>1||a(_,E)})})}function a(_,E){try{c(n[_](E))}catch(U){p(s[0][3],U)}}function c(_){_.value instanceof Iu?Promise.resolve(_.value.v).then(u,d):p(s[0][2],_)}function u(_){a("next",_)}function d(_){a("throw",_)}function p(_,E){_(E),s.shift(),s.length&&a(s[0][0],s[0][1])}}function rO(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=r[i]?function(o){return(t=!t)?{value:Iu(r[i](o)),done:i==="return"}:s?s(o):o}:s}}function nO(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Bv=="function"?Bv(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function iO(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function sO(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function oO(r){return r&&r.__esModule?r:{default:r}}function aO(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function cO(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var Iv,kv,xp=NA(()=>{Iv=function(r,e){return Iv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Iv(r,e)};kv=function(){return kv=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},kv.apply(this,arguments)}});var Nv=l(jv=>{"use strict";Object.defineProperty(jv,"__esModule",{value:!0});var Ov;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(Ov||(Ov={}));jv.default=Ov});var Qw=l(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});var uO=Nv();Object.defineProperty(qv,"Lifecycle",{enumerable:!0,get:function(){return uO.default}})});var ls=l(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.defineInjectionTokenMetadata=fr.getParamInfo=fr.INJECTION_TOKEN_METADATA_KEY=void 0;fr.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function lO(r){let e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(fr.INJECTION_TOKEN_METADATA_KEY,r)||{};return Object.keys(t).forEach(n=>{e[+n]=t[n]}),e}fr.getParamInfo=lO;function fO(r,e){return function(t,n,i){let s=Reflect.getOwnMetadata(fr.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:r,transform:e.transformToken,transformArgs:e.args||[]}:r,Reflect.defineMetadata(fr.INJECTION_TOKEN_METADATA_KEY,s,t)}}fr.defineInjectionTokenMetadata=fO});var Rv=l(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});Tp.isClassProvider=void 0;function dO(r){return!!r.useClass}Tp.isClassProvider=dO});var Mv=l(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.isFactoryProvider=void 0;function pO(r){return!!r.useFactory}Ep.isFactoryProvider=pO});var kp=l(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.delay=Qo.DelayedConstructor=void 0;var Ip=class{constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let t={},n=!1,i,s=()=>(n||(i=e(this.wrap()),n=!0),i);return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},n=i=>{t[i]=(...s)=>{s[0]=e();let o=Reflect[i];return o(...s)}};return this.reflectMethods.forEach(n),t}};Qo.DelayedConstructor=Ip;function hO(r){if(typeof r>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new Ip(r)}Qo.delay=hO});var Bp=l(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.isConstructorToken=Fr.isTransformDescriptor=Fr.isTokenDescriptor=Fr.isNormalToken=void 0;var yO=kp();function _O(r){return typeof r=="string"||typeof r=="symbol"}Fr.isNormalToken=_O;function gO(r){return typeof r=="object"&&"token"in r&&"multiple"in r}Fr.isTokenDescriptor=gO;function vO(r){return typeof r=="object"&&"token"in r&&"transform"in r}Fr.isTransformDescriptor=vO;function mO(r){return typeof r=="function"||r instanceof yO.DelayedConstructor}Fr.isConstructorToken=mO});var Dv=l(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.isTokenProvider=void 0;function AO(r){return!!r.useToken}Op.isTokenProvider=AO});var Uv=l(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.isValueProvider=void 0;function bO(r){return r.useValue!=null}jp.isValueProvider=bO});var $v=l(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var SO=Rv();Object.defineProperty(fs,"isClassProvider",{enumerable:!0,get:function(){return SO.isClassProvider}});var wO=Mv();Object.defineProperty(fs,"isFactoryProvider",{enumerable:!0,get:function(){return wO.isFactoryProvider}});var CO=Bp();Object.defineProperty(fs,"isNormalToken",{enumerable:!0,get:function(){return CO.isNormalToken}});var PO=Dv();Object.defineProperty(fs,"isTokenProvider",{enumerable:!0,get:function(){return PO.isTokenProvider}});var xO=Uv();Object.defineProperty(fs,"isValueProvider",{enumerable:!0,get:function(){return xO.isValueProvider}})});var eC=l(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.isProvider=void 0;var TO=Rv(),EO=Uv(),IO=Dv(),kO=Mv();function BO(r){return TO.isClassProvider(r)||EO.isValueProvider(r)||IO.isTokenProvider(r)||kO.isFactoryProvider(r)}Np.isProvider=BO});var Hv=l(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var Lv=class{constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let t=this._registryMap.get(e);return t[t.length-1]||null}set(e,t){this.ensure(e),this._registryMap.get(e).push(t)}setAll(e,t){this._registryMap.set(e,t)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};Vv.default=Lv});var tC=l(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var OO=Hv(),Fv=class extends OO.default{};Kv.default=Fv});var rC=l(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});var Gv=class{constructor(){this.scopedResolutions=new Map}};Wv.default=Gv});var zv=l(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.formatErrorCtor=void 0;function jO(r,e){return r===null?`at position #${e}`:`"${r.split(",")[e].trim()}" at position #${e}`}function NO(r,e,t=" "){return[r,...e.message.split(`
|
|
19
|
+
`).map(n=>t+n)].join(`
|
|
20
|
+
`)}function qO(r,e,t){let[,n=null]=r.toString().match(/constructor\(([\w, ]+)\)/)||[],i=jO(n,e);return NO(`Cannot inject the dependency ${i} of "${r.name}" constructor. Reason:`,t)}qp.formatErrorCtor=qO});var nC=l(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.isDisposable=void 0;function RO(r){return!(typeof r.dispose!="function"||r.dispose.length>0)}Rp.isDisposable=RO});var sC=l(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.PostResolutionInterceptors=ds.PreResolutionInterceptors=void 0;var iC=Hv(),Mp=class extends iC.default{};ds.PreResolutionInterceptors=Mp;var Dp=class extends iC.default{};ds.PostResolutionInterceptors=Dp;var Jv=class{constructor(){this.preResolution=new Mp,this.postResolution=new Dp}};ds.default=Jv});var Kn=l(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.instance=fn.typeInfo=void 0;var MO=(xp(),g(Pp)),ut=$v(),DO=eC(),Up=Bp(),UO=tC(),vt=Nv(),$p=rC(),$O=zv(),LO=kp(),VO=nC(),HO=sC();fn.typeInfo=new Map;var Xv=class r{constructor(e){this.parent=e,this._registry=new UO.default,this.interceptors=new HO.default,this.disposed=!1,this.disposables=new Set}register(e,t,n={lifecycle:vt.default.Transient}){this.ensureNotDisposed();let i;if(DO.isProvider(t)?i=t:i={useClass:t},ut.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let a=o.useToken;if(s.includes(a))throw new Error(`Token registration cycle detected! ${[...s,a].join(" -> ")}`);s.push(a);let c=this._registry.get(a);c&&ut.isTokenProvider(c.provider)?o=c.provider:o=null}}if((n.lifecycle===vt.default.Singleton||n.lifecycle==vt.default.ContainerScoped||n.lifecycle==vt.default.ResolutionScoped)&&(ut.isValueProvider(i)||ut.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${vt.default[n.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:n}),this}registerType(e,t){return this.ensureNotDisposed(),ut.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),ut.isNormalToken(e)){if(ut.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:vt.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:vt.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let n=e;return t&&!ut.isNormalToken(t)&&(n=t),this.register(e,{useClass:n},{lifecycle:vt.default.Singleton})}resolve(e,t=new $p.default,n=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&ut.isNormalToken(e)){if(n)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),i){let s=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(Up.isConstructorToken(e)){let s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,t){if(this.interceptors.preResolution.has(e)){let n=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&n.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,n)}}executePostResolutionInterceptor(e,t,n){if(this.interceptors.postResolution.has(e)){let i=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&i.push(s),s.callback(e,t,n);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===vt.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let n=e.options.lifecycle===vt.default.Singleton,i=e.options.lifecycle===vt.default.ContainerScoped,s=n||i,o;return ut.isValueProvider(e.provider)?o=e.provider.useValue:ut.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):ut.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):ut.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===vt.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new $p.default,n=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&ut.isNormalToken(e)){if(n)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(a=>this.resolveRegistration(a,t));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(n=>!ut.isValueProvider(n.provider)).map(n=>(n.instance=void 0,n)))}createChildContainer(){this.ensureNotDisposed();let e=new r(this);for(let[t,n]of this._registry.entries())n.some(({options:i})=>i.lifecycle===vt.default.ContainerScoped)&&e._registry.setAll(t,n.map(i=>i.options.lifecycle===vt.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,n={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:n})}afterResolution(e,t,n={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:n})}dispose(){return MO.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let n=t.dispose();n&&e.push(n)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,t){if(e instanceof LO.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let n=(()=>{let i=fn.typeInfo.get(e);if(!i||i.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=i.map(this.resolveParams(t,e));return new e(...s)})();return VO.isDisposable(n)&&this.disposables.add(n),n}resolveParams(e,t){return(n,i)=>{try{return Up.isTokenDescriptor(n)?Up.isTransformDescriptor(n)?n.multiple?this.resolve(n.transform).transform(this.resolveAll(n.token,new $p.default,n.isOptional),...n.transformArgs):this.resolve(n.transform).transform(this.resolve(n.token,e,n.isOptional),...n.transformArgs):n.multiple?this.resolveAll(n.token,new $p.default,n.isOptional):this.resolve(n.token,e,n.isOptional):Up.isTransformDescriptor(n)?this.resolve(n.transform,e).transform(this.resolve(n.token,e),...n.transformArgs):this.resolve(n,e)}catch(s){throw new Error($O.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};fn.instance=new Xv;fn.default=fn.instance});var oC=l(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var FO=ls(),dn=Kn(),Yv=Bp(),KO=zv();function GO(){return function(r){let e=FO.getParamInfo(r);return class extends r{constructor(...t){super(...t.concat(e.slice(t.length).map((n,i)=>{try{return Yv.isTokenDescriptor(n)?Yv.isTransformDescriptor(n)?n.multiple?dn.instance.resolve(n.transform).transform(dn.instance.resolveAll(n.token),...n.transformArgs):dn.instance.resolve(n.transform).transform(dn.instance.resolve(n.token),...n.transformArgs):n.multiple?dn.instance.resolveAll(n.token):dn.instance.resolve(n.token):Yv.isTransformDescriptor(n)?dn.instance.resolve(n.transform).transform(dn.instance.resolve(n.token),...n.transformArgs):dn.instance.resolve(n)}catch(s){let o=i+t.length;throw new Error(KO.formatErrorCtor(r,o,s))}})))}}}}Zv.default=GO});var aC=l(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var WO=ls();function zO(r,e){let t={token:r,multiple:!1,isOptional:e&&e.isOptional};return WO.defineInjectionTokenMetadata(t)}Qv.default=zO});var Lp=l(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var JO=ls(),XO=Kn(),cC=Kn();function YO(r){return function(e){XO.typeInfo.set(e,JO.getParamInfo(e)),r&&r.token&&(Array.isArray(r.token)?r.token.forEach(t=>{cC.instance.register(t,e)}):cC.instance.register(r.token,e))}}em.default=YO});var uC=l(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});var ZO=(xp(),g(Pp)),QO=Kn();function ej(r=[]){return function(e){return r.forEach(t=>{var{token:n,options:i}=t,s=ZO.__rest(t,["token","options"]);return QO.instance.register(n,s,i)}),e}}tm.default=ej});var lC=l(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var tj=Lp(),rj=Kn();function nj(){return function(r){tj.default()(r),rj.instance.registerSingleton(r)}}rm.default=nj});var fC=l(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var ij=ls();function sj(r,e){let t={token:r,multiple:!0,isOptional:e&&e.isOptional};return ij.defineInjectionTokenMetadata(t)}nm.default=sj});var dC=l(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var oj=ls();function aj(r,e,...t){let n={token:r,multiple:!0,transform:e,transformArgs:t};return oj.defineInjectionTokenMetadata(n)}im.default=aj});var pC=l(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});var cj=ls();function uj(r,e,...t){return cj.defineInjectionTokenMetadata(r,{transformToken:e,args:t})}sm.default=uj});var hC=l(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var lj=Lp(),fj=Kn();function dj(r,e){return function(t){lj.default()(t),fj.instance.register(e||t,t,{lifecycle:r})}}om.default=dj});var yC=l(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});var pj=oC();Object.defineProperty(dr,"autoInjectable",{enumerable:!0,get:function(){return pj.default}});var hj=aC();Object.defineProperty(dr,"inject",{enumerable:!0,get:function(){return hj.default}});var yj=Lp();Object.defineProperty(dr,"injectable",{enumerable:!0,get:function(){return yj.default}});var _j=uC();Object.defineProperty(dr,"registry",{enumerable:!0,get:function(){return _j.default}});var gj=lC();Object.defineProperty(dr,"singleton",{enumerable:!0,get:function(){return gj.default}});var vj=fC();Object.defineProperty(dr,"injectAll",{enumerable:!0,get:function(){return vj.default}});var mj=dC();Object.defineProperty(dr,"injectAllWithTransform",{enumerable:!0,get:function(){return mj.default}});var Aj=pC();Object.defineProperty(dr,"injectWithTransform",{enumerable:!0,get:function(){return Aj.default}});var bj=hC();Object.defineProperty(dr,"scoped",{enumerable:!0,get:function(){return bj.default}})});var _C=l(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});function Sj(r){let e;return t=>(e==null&&(e=r(t)),e)}am.default=Sj});var gC=l(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});function wj(r){let e=new WeakMap;return t=>{let n=e.get(t);return n==null&&(n=r(t),e.set(t,n)),n}}cm.default=wj});var vC=l(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});function Cj(r,e,t,n=!0){let i,s;return o=>{let a=r(o);return(!n||s!==a)&&((s=a)?i=o.resolve(e):i=o.resolve(t)),i}}um.default=Cj});var mC=l(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});var Pj=_C();Object.defineProperty(ku,"instanceCachingFactory",{enumerable:!0,get:function(){return Pj.default}});var xj=gC();Object.defineProperty(ku,"instancePerContainerCachingFactory",{enumerable:!0,get:function(){return xj.default}});var Tj=vC();Object.defineProperty(ku,"predicateAwareClassFactory",{enumerable:!0,get:function(){return Tj.default}})});var AC=l(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});var lm=(xp(),g(Pp));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Ej=Qw();Object.defineProperty(Gn,"Lifecycle",{enumerable:!0,get:function(){return Ej.Lifecycle}});lm.__exportStar(yC(),Gn);lm.__exportStar(mC(),Gn);lm.__exportStar($v(),Gn);var Ij=kp();Object.defineProperty(Gn,"delay",{enumerable:!0,get:function(){return Ij.delay}});var kj=Kn();Object.defineProperty(Gn,"container",{enumerable:!0,get:function(){return kj.instance}})});var hm=l(hs=>{"use strict";var fm;Object.defineProperty(hs,"__esModule",{value:!0});hs.PKCS12AttrSet=hs.PKCS12Attribute=void 0;var pm=(m(),g(v)),ps=C(),ea=class{attrId="";attrValues=[];constructor(e={}){Object.assign(e)}};hs.PKCS12Attribute=ea;pm.__decorate([(0,ps.AsnProp)({type:ps.AsnPropTypes.ObjectIdentifier})],ea.prototype,"attrId",void 0);pm.__decorate([(0,ps.AsnProp)({type:ps.AsnPropTypes.Any,repeated:"set"})],ea.prototype,"attrValues",void 0);var dm=fm=class extends ps.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,fm.prototype)}};hs.PKCS12AttrSet=dm;hs.PKCS12AttrSet=dm=fm=pm.__decorate([(0,ps.AsnType)({type:ps.AsnTypeTypes.Sequence,itemType:ea})],dm)});var bC=l(Bu=>{"use strict";var ym;Object.defineProperty(Bu,"__esModule",{value:!0});Bu.AuthenticatedSafe=void 0;var Bj=(m(),g(v)),_m=C(),Oj=vu(),gm=ym=class extends _m.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ym.prototype)}};Bu.AuthenticatedSafe=gm;Bu.AuthenticatedSafe=gm=ym=Bj.__decorate([(0,_m.AsnType)({type:_m.AsnTypeTypes.Sequence,itemType:Oj.ContentInfo})],gm)});var vm=l(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.id_bagtypes=te.id_pbewithSHAAnd40BitRC2_CBC=te.id_pbeWithSHAAnd128BitRC2_CBC=te.id_pbeWithSHAAnd2_KeyTripleDES_CBC=te.id_pbeWithSHAAnd3_KeyTripleDES_CBC=te.id_pbeWithSHAAnd40BitRC4=te.id_pbeWithSHAAnd128BitRC4=te.id_pkcs_12PbeIds=te.id_pkcs_12=te.id_pkcs=te.id_rsadsi=void 0;te.id_rsadsi="1.2.840.113549";te.id_pkcs=`${te.id_rsadsi}.1`;te.id_pkcs_12=`${te.id_pkcs}.12`;te.id_pkcs_12PbeIds=`${te.id_pkcs_12}.1`;te.id_pbeWithSHAAnd128BitRC4=`${te.id_pkcs_12PbeIds}.1`;te.id_pbeWithSHAAnd40BitRC4=`${te.id_pkcs_12PbeIds}.2`;te.id_pbeWithSHAAnd3_KeyTripleDES_CBC=`${te.id_pkcs_12PbeIds}.3`;te.id_pbeWithSHAAnd2_KeyTripleDES_CBC=`${te.id_pkcs_12PbeIds}.4`;te.id_pbeWithSHAAnd128BitRC2_CBC=`${te.id_pkcs_12PbeIds}.5`;te.id_pbewithSHAAnd40BitRC2_CBC=`${te.id_pkcs_12PbeIds}.6`;te.id_bagtypes=`${te.id_pkcs_12}.10.1`});var Vp=l(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.id_pkcs_9=st.id_SafeContents=st.id_SecretBag=st.id_CRLBag=st.id_certBag=st.id_pkcs8ShroudedKeyBag=st.id_keyBag=void 0;var ta=vm();st.id_keyBag=`${ta.id_bagtypes}.1`;st.id_pkcs8ShroudedKeyBag=`${ta.id_bagtypes}.2`;st.id_certBag=`${ta.id_bagtypes}.3`;st.id_CRLBag=`${ta.id_bagtypes}.4`;st.id_SecretBag=`${ta.id_bagtypes}.5`;st.id_SafeContents=`${ta.id_bagtypes}.6`;st.id_pkcs_9="1.2.840.113549.1.9"});var wC=l(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.id_sdsiCertificate=Xt.id_x509Certificate=Xt.id_certTypes=Xt.CertBag=void 0;var SC=(m(),g(v)),Hp=C(),jj=Vp(),Ou=class{certId="";certValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Xt.CertBag=Ou;SC.__decorate([(0,Hp.AsnProp)({type:Hp.AsnPropTypes.ObjectIdentifier})],Ou.prototype,"certId",void 0);SC.__decorate([(0,Hp.AsnProp)({type:Hp.AsnPropTypes.Any,context:0})],Ou.prototype,"certValue",void 0);Xt.id_certTypes=`${jj.id_pkcs_9}.22`;Xt.id_x509Certificate=`${Xt.id_certTypes}.1`;Xt.id_sdsiCertificate=`${Xt.id_certTypes}.2`});var PC=l(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.id_x509CRL=pn.id_crlTypes=pn.CRLBag=void 0;var CC=(m(),g(v)),Fp=C(),Nj=Vp(),ju=class{crlId="";crltValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};pn.CRLBag=ju;CC.__decorate([(0,Fp.AsnProp)({type:Fp.AsnPropTypes.ObjectIdentifier})],ju.prototype,"crlId",void 0);CC.__decorate([(0,Fp.AsnProp)({type:Fp.AsnPropTypes.Any,context:0})],ju.prototype,"crltValue",void 0);pn.id_crlTypes=`${Nj.id_pkcs_9}.23`;pn.id_x509CRL=`${pn.id_crlTypes}.1`});var EC=l(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.EncryptedPrivateKeyInfo=ra.EncryptedData=void 0;var xC=(m(),g(v)),mm=C(),TC=Q(),Nu=class extends mm.OctetString{};ra.EncryptedData=Nu;var qu=class{encryptionAlgorithm=new TC.AlgorithmIdentifier;encryptedData=new Nu;constructor(e={}){Object.assign(this,e)}};ra.EncryptedPrivateKeyInfo=qu;xC.__decorate([(0,mm.AsnProp)({type:TC.AlgorithmIdentifier})],qu.prototype,"encryptionAlgorithm",void 0);xC.__decorate([(0,mm.AsnProp)({type:Nu})],qu.prototype,"encryptedData",void 0)});var IC=l(pr=>{"use strict";var Am;Object.defineProperty(pr,"__esModule",{value:!0});pr.PrivateKeyInfo=pr.Attributes=pr.PrivateKey=pr.Version=void 0;var Mu=(m(),g(v)),hn=C(),Sm=Q(),bm;(function(r){r[r.v1=0]="v1"})(bm||(pr.Version=bm={}));var Ru=class extends hn.OctetString{};pr.PrivateKey=Ru;var Kp=Am=class extends hn.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Am.prototype)}};pr.Attributes=Kp;pr.Attributes=Kp=Am=Mu.__decorate([(0,hn.AsnType)({type:hn.AsnTypeTypes.Sequence,itemType:Sm.Attribute})],Kp);var ys=class{version=bm.v1;privateKeyAlgorithm=new Sm.AlgorithmIdentifier;privateKey=new Ru;attributes;constructor(e={}){Object.assign(this,e)}};pr.PrivateKeyInfo=ys;Mu.__decorate([(0,hn.AsnProp)({type:hn.AsnPropTypes.Integer})],ys.prototype,"version",void 0);Mu.__decorate([(0,hn.AsnProp)({type:Sm.AlgorithmIdentifier})],ys.prototype,"privateKeyAlgorithm",void 0);Mu.__decorate([(0,hn.AsnProp)({type:Ru})],ys.prototype,"privateKey",void 0);Mu.__decorate([(0,hn.AsnProp)({type:Kp,implicit:!0,context:0,optional:!0})],ys.prototype,"attributes",void 0)});var Wp=l(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});var kC=(m(),g(v));kC.__exportStar(EC(),Gp);kC.__exportStar(IC(),Gp)});var OC=l(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.KeyBag=void 0;var qj=(m(),g(v)),Rj=Wp(),BC=C(),wm=class extends Rj.PrivateKeyInfo{};Du.KeyBag=wm;Du.KeyBag=wm=qj.__decorate([(0,BC.AsnType)({type:BC.AsnTypeTypes.Sequence})],wm)});var NC=l(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.PKCS8ShroudedKeyBag=void 0;var Mj=(m(),g(v)),Dj=Wp(),jC=C(),Cm=class extends Dj.EncryptedPrivateKeyInfo{};Uu.PKCS8ShroudedKeyBag=Cm;Uu.PKCS8ShroudedKeyBag=Cm=Mj.__decorate([(0,jC.AsnType)({type:jC.AsnTypeTypes.Sequence})],Cm)});var RC=l(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});Jp.SecretBag=void 0;var qC=(m(),g(v)),zp=C(),$u=class{secretTypeId="";secretValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Jp.SecretBag=$u;qC.__decorate([(0,zp.AsnProp)({type:zp.AsnPropTypes.ObjectIdentifier})],$u.prototype,"secretTypeId",void 0);qC.__decorate([(0,zp.AsnProp)({type:zp.AsnPropTypes.Any,context:0})],$u.prototype,"secretValue",void 0)});var MC=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});var na=(m(),g(v));na.__exportStar(wC(),Wn);na.__exportStar(PC(),Wn);na.__exportStar(OC(),Wn);na.__exportStar(NC(),Wn);na.__exportStar(RC(),Wn);na.__exportStar(Vp(),Wn)});var xm=l(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});Xp.MacData=void 0;var Pm=(m(),g(v)),DC=Ev(),ia=C(),sa=class{mac=new DC.DigestInfo;macSalt=new ia.OctetString;iterations=1;constructor(e={}){Object.assign(this,e)}};Xp.MacData=sa;Pm.__decorate([(0,ia.AsnProp)({type:DC.DigestInfo})],sa.prototype,"mac",void 0);Pm.__decorate([(0,ia.AsnProp)({type:ia.OctetString})],sa.prototype,"macSalt",void 0);Pm.__decorate([(0,ia.AsnProp)({type:ia.AsnPropTypes.Integer,defaultValue:1})],sa.prototype,"iterations",void 0)});var LC=l(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});Zp.PFX=void 0;var Tm=(m(),g(v)),Yp=C(),UC=vu(),$C=xm(),oa=class{version=3;authSafe=new UC.ContentInfo;macData=new $C.MacData;constructor(e={}){Object.assign(this,e)}};Zp.PFX=oa;Tm.__decorate([(0,Yp.AsnProp)({type:Yp.AsnPropTypes.Integer})],oa.prototype,"version",void 0);Tm.__decorate([(0,Yp.AsnProp)({type:UC.ContentInfo})],oa.prototype,"authSafe",void 0);Tm.__decorate([(0,Yp.AsnProp)({type:$C.MacData,optional:!0})],oa.prototype,"macData",void 0)});var VC=l(gs=>{"use strict";var Em;Object.defineProperty(gs,"__esModule",{value:!0});gs.SafeContents=gs.SafeBag=void 0;var Qp=(m(),g(v)),zn=C(),Uj=hm(),_s=class{bagId="";bagValue=new ArrayBuffer(0);bagAttributes;constructor(e={}){Object.assign(this,e)}};gs.SafeBag=_s;Qp.__decorate([(0,zn.AsnProp)({type:zn.AsnPropTypes.ObjectIdentifier})],_s.prototype,"bagId",void 0);Qp.__decorate([(0,zn.AsnProp)({type:zn.AsnPropTypes.Any,context:0})],_s.prototype,"bagValue",void 0);Qp.__decorate([(0,zn.AsnProp)({type:Uj.PKCS12Attribute,repeated:"set",optional:!0})],_s.prototype,"bagAttributes",void 0);var Im=Em=class extends zn.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Em.prototype)}};gs.SafeContents=Im;gs.SafeContents=Im=Em=Qp.__decorate([(0,zn.AsnType)({type:zn.AsnTypeTypes.Sequence,itemType:_s})],Im)});var HC=l(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});var vs=(m(),g(v));vs.__exportStar(hm(),yn);vs.__exportStar(bC(),yn);vs.__exportStar(MC(),yn);vs.__exportStar(xm(),yn);vs.__exportStar(vm(),yn);vs.__exportStar(LC(),yn);vs.__exportStar(VC(),yn)});var FC=l(f=>{"use strict";var km,Bm,Om;Object.defineProperty(f,"__esModule",{value:!0});f.DateOfBirth=f.UnstructuredAddress=f.UnstructuredName=f.EmailAddress=f.EncryptedPrivateKeyInfo=f.UserPKCS12=f.Pkcs7PDU=f.PKCS9String=f.id_at_pseudonym=f.crlTypes=f.id_certTypes=f.id_smime=f.id_pkcs9_mr_signingTimeMatch=f.id_pkcs9_mr_caseIgnoreMatch=f.id_pkcs9_sx_signingTime=f.id_pkcs9_sx_pkcs9String=f.id_pkcs9_at_countryOfResidence=f.id_pkcs9_at_countryOfCitizenship=f.id_pkcs9_at_gender=f.id_pkcs9_at_placeOfBirth=f.id_pkcs9_at_dateOfBirth=f.id_ietf_at=f.id_pkcs9_at_pkcs7PDU=f.id_pkcs9_at_sequenceNumber=f.id_pkcs9_at_randomNonce=f.id_pkcs9_at_encryptedPrivateKeyInfo=f.id_pkcs9_at_pkcs15Token=f.id_pkcs9_at_userPKCS12=f.id_pkcs9_at_localKeyId=f.id_pkcs9_at_friendlyName=f.id_pkcs9_at_smimeCapabilities=f.id_pkcs9_at_extensionRequest=f.id_pkcs9_at_signingDescription=f.id_pkcs9_at_extendedCertificateAttributes=f.id_pkcs9_at_unstructuredAddress=f.id_pkcs9_at_challengePassword=f.id_pkcs9_at_counterSignature=f.id_pkcs9_at_signingTime=f.id_pkcs9_at_messageDigest=f.id_pkcs9_at_contentType=f.id_pkcs9_at_unstructuredName=f.id_pkcs9_at_emailAddress=f.id_pkcs9_oc_naturalPerson=f.id_pkcs9_oc_pkcsEntity=f.id_pkcs9_mr=f.id_pkcs9_sx=f.id_pkcs9_at=f.id_pkcs9_oc=f.id_pkcs9_mo=f.id_pkcs9=void 0;f.SMIMECapabilities=f.SMIMECapability=f.SigningDescription=f.LocalKeyId=f.FriendlyName=f.ExtendedCertificateAttributes=f.ExtensionRequest=f.ChallengePassword=f.CounterSignature=f.SequenceNumber=f.RandomNonce=f.SigningTime=f.MessageDigest=f.ContentType=f.Pseudonym=f.CountryOfResidence=f.CountryOfCitizenship=f.Gender=f.PlaceOfBirth=void 0;var Z=(m(),g(v)),j=C(),Ym=Z.__importStar(vu()),$j=Z.__importStar(HC()),Lj=Z.__importStar(Wp()),_n=Z.__importStar(Q()),Vj=Z.__importStar(Gg());f.id_pkcs9="1.2.840.113549.1.9";f.id_pkcs9_mo=`${f.id_pkcs9}.0`;f.id_pkcs9_oc=`${f.id_pkcs9}.24`;f.id_pkcs9_at=`${f.id_pkcs9}.25`;f.id_pkcs9_sx=`${f.id_pkcs9}.26`;f.id_pkcs9_mr=`${f.id_pkcs9}.27`;f.id_pkcs9_oc_pkcsEntity=`${f.id_pkcs9_oc}.1`;f.id_pkcs9_oc_naturalPerson=`${f.id_pkcs9_oc}.2`;f.id_pkcs9_at_emailAddress=`${f.id_pkcs9}.1`;f.id_pkcs9_at_unstructuredName=`${f.id_pkcs9}.2`;f.id_pkcs9_at_contentType=`${f.id_pkcs9}.3`;f.id_pkcs9_at_messageDigest=`${f.id_pkcs9}.4`;f.id_pkcs9_at_signingTime=`${f.id_pkcs9}.5`;f.id_pkcs9_at_counterSignature=`${f.id_pkcs9}.6`;f.id_pkcs9_at_challengePassword=`${f.id_pkcs9}.7`;f.id_pkcs9_at_unstructuredAddress=`${f.id_pkcs9}.8`;f.id_pkcs9_at_extendedCertificateAttributes=`${f.id_pkcs9}.9`;f.id_pkcs9_at_signingDescription=`${f.id_pkcs9}.13`;f.id_pkcs9_at_extensionRequest=`${f.id_pkcs9}.14`;f.id_pkcs9_at_smimeCapabilities=`${f.id_pkcs9}.15`;f.id_pkcs9_at_friendlyName=`${f.id_pkcs9}.20`;f.id_pkcs9_at_localKeyId=`${f.id_pkcs9}.21`;f.id_pkcs9_at_userPKCS12="2.16.840.1.113730.3.1.216";f.id_pkcs9_at_pkcs15Token=`${f.id_pkcs9_at}.1`;f.id_pkcs9_at_encryptedPrivateKeyInfo=`${f.id_pkcs9_at}.2`;f.id_pkcs9_at_randomNonce=`${f.id_pkcs9_at}.3`;f.id_pkcs9_at_sequenceNumber=`${f.id_pkcs9_at}.4`;f.id_pkcs9_at_pkcs7PDU=`${f.id_pkcs9_at}.5`;f.id_ietf_at="1.3.6.1.5.5.7.9";f.id_pkcs9_at_dateOfBirth=`${f.id_ietf_at}.1`;f.id_pkcs9_at_placeOfBirth=`${f.id_ietf_at}.2`;f.id_pkcs9_at_gender=`${f.id_ietf_at}.3`;f.id_pkcs9_at_countryOfCitizenship=`${f.id_ietf_at}.4`;f.id_pkcs9_at_countryOfResidence=`${f.id_ietf_at}.5`;f.id_pkcs9_sx_pkcs9String=`${f.id_pkcs9_sx}.1`;f.id_pkcs9_sx_signingTime=`${f.id_pkcs9_sx}.2`;f.id_pkcs9_mr_caseIgnoreMatch=`${f.id_pkcs9_mr}.1`;f.id_pkcs9_mr_signingTimeMatch=`${f.id_pkcs9_mr}.2`;f.id_smime=`${f.id_pkcs9}.16`;f.id_certTypes=`${f.id_pkcs9}.22`;f.crlTypes=`${f.id_pkcs9}.23`;f.id_at_pseudonym=`${Vj.id_at}.65`;var Lu=class extends _n.DirectoryString{ia5String;constructor(e={}){super(e)}toString(){return{}.toString(),this.ia5String||super.toString()}};f.PKCS9String=Lu;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.IA5String})],Lu.prototype,"ia5String",void 0);f.PKCS9String=Lu=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Lu);var jm=class extends Ym.ContentInfo{};f.Pkcs7PDU=jm;f.Pkcs7PDU=jm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Sequence})],jm);var Nm=class extends $j.PFX{};f.UserPKCS12=Nm;f.UserPKCS12=Nm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Sequence})],Nm);var qm=class extends Lj.EncryptedPrivateKeyInfo{};f.EncryptedPrivateKeyInfo=qm;f.EncryptedPrivateKeyInfo=qm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Sequence})],qm);var eh=class{value;constructor(e=""){this.value=e}toString(){return this.value}};f.EmailAddress=eh;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.IA5String})],eh.prototype,"value",void 0);f.EmailAddress=eh=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],eh);var Rm=class extends Lu{};f.UnstructuredName=Rm;f.UnstructuredName=Rm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Rm);var Mm=class extends _n.DirectoryString{};f.UnstructuredAddress=Mm;f.UnstructuredAddress=Mm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Mm);var th=class{value;constructor(e=new Date){this.value=e}};f.DateOfBirth=th;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.GeneralizedTime})],th.prototype,"value",void 0);f.DateOfBirth=th=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],th);var Dm=class extends _n.DirectoryString{};f.PlaceOfBirth=Dm;f.PlaceOfBirth=Dm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Dm);var rh=class{value;constructor(e="M"){this.value=e}toString(){return this.value}};f.Gender=rh;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.PrintableString})],rh.prototype,"value",void 0);f.Gender=rh=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],rh);var Vu=class{value;constructor(e=""){this.value=e}toString(){return this.value}};f.CountryOfCitizenship=Vu;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.PrintableString})],Vu.prototype,"value",void 0);f.CountryOfCitizenship=Vu=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Vu);var Um=class extends Vu{};f.CountryOfResidence=Um;f.CountryOfResidence=Um=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Um);var $m=class extends _n.DirectoryString{};f.Pseudonym=$m;f.Pseudonym=$m=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],$m);var nh=class{value;constructor(e=""){this.value=e}toString(){return this.value}};f.ContentType=nh;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.ObjectIdentifier})],nh.prototype,"value",void 0);f.ContentType=nh=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],nh);var Lm=class extends j.OctetString{};f.MessageDigest=Lm;var Vm=class extends _n.Time{};f.SigningTime=Vm;f.SigningTime=Vm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Vm);var Hm=class extends j.OctetString{};f.RandomNonce=Hm;var ih=class{value;constructor(e=0){this.value=e}toString(){return this.value.toString()}};f.SequenceNumber=ih;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.Integer})],ih.prototype,"value",void 0);f.SequenceNumber=ih=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],ih);var Fm=class extends Ym.SignerInfo{};f.CounterSignature=Fm;f.CounterSignature=Fm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Sequence})],Fm);var Km=class extends _n.DirectoryString{};f.ChallengePassword=Km;f.ChallengePassword=Km=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],Km);var Gm=km=class extends _n.Extensions{constructor(e){super(e),Object.setPrototypeOf(this,km.prototype)}};f.ExtensionRequest=Gm;f.ExtensionRequest=Gm=km=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Sequence})],Gm);var Wm=Bm=class extends j.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Bm.prototype)}};f.ExtendedCertificateAttributes=Wm;f.ExtendedCertificateAttributes=Wm=Bm=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Set,itemType:Ym.Attribute})],Wm);var sh=class{value;constructor(e=""){this.value=e}toString(){return this.value}};f.FriendlyName=sh;Z.__decorate([(0,j.AsnProp)({type:j.AsnPropTypes.BmpString})],sh.prototype,"value",void 0);f.FriendlyName=sh=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Choice})],sh);var zm=class extends j.OctetString{};f.LocalKeyId=zm;var Jm=class extends _n.DirectoryString{};f.SigningDescription=Jm;var oh=class extends _n.AlgorithmIdentifier{};f.SMIMECapability=oh;f.SMIMECapability=oh=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Sequence})],oh);var Xm=Om=class extends j.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Om.prototype)}};f.SMIMECapabilities=Xm;f.SMIMECapabilities=Xm=Om=Z.__decorate([(0,j.AsnType)({type:j.AsnTypeTypes.Sequence,itemType:oh})],Xm)});var tA=l(Hu=>{"use strict";var Zm;Object.defineProperty(Hu,"__esModule",{value:!0});Hu.Attributes=void 0;var Hj=(m(),g(v)),Qm=C(),Fj=Q(),eA=Zm=class extends Qm.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Zm.prototype)}};Hu.Attributes=eA;Hu.Attributes=eA=Zm=Hj.__decorate([(0,Qm.AsnType)({type:Qm.AsnTypeTypes.Sequence,itemType:Fj.Attribute})],eA)});var rA=l(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.CertificationRequestInfo=void 0;var ch=(m(),g(v)),Fu=C(),ah=Q(),KC=tA(),ms=class{version=0;subject=new ah.Name;subjectPKInfo=new ah.SubjectPublicKeyInfo;attributes=new KC.Attributes;constructor(e={}){Object.assign(this,e)}};uh.CertificationRequestInfo=ms;ch.__decorate([(0,Fu.AsnProp)({type:Fu.AsnPropTypes.Integer})],ms.prototype,"version",void 0);ch.__decorate([(0,Fu.AsnProp)({type:ah.Name})],ms.prototype,"subject",void 0);ch.__decorate([(0,Fu.AsnProp)({type:ah.SubjectPublicKeyInfo})],ms.prototype,"subjectPKInfo",void 0);ch.__decorate([(0,Fu.AsnProp)({type:KC.Attributes,implicit:!0,context:0,optional:!0})],ms.prototype,"attributes",void 0)});var zC=l(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.CertificationRequest=void 0;var nA=(m(),g(v)),lh=C(),GC=Q(),WC=rA(),aa=class{certificationRequestInfo=new WC.CertificationRequestInfo;certificationRequestInfoRaw;signatureAlgorithm=new GC.AlgorithmIdentifier;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};fh.CertificationRequest=aa;nA.__decorate([(0,lh.AsnProp)({type:WC.CertificationRequestInfo,raw:!0})],aa.prototype,"certificationRequestInfo",void 0);nA.__decorate([(0,lh.AsnProp)({type:GC.AlgorithmIdentifier})],aa.prototype,"signatureAlgorithm",void 0);nA.__decorate([(0,lh.AsnProp)({type:lh.AsnPropTypes.BitString})],aa.prototype,"signature",void 0)});var JC=l(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});var iA=(m(),g(v));iA.__exportStar(tA(),Ku);iA.__exportStar(zC(),Ku);iA.__exportStar(rA(),Ku)});var jP=l(x=>{"use strict";zA();var S=C(),q=Q(),P=oy(),w=(m(),g(v)),Kj=vu(),Ph=$w(),At=Ev(),de=AC(),fA=FC(),xh=JC();function Nl(r){var e=Object.create(null);return r&&Object.keys(r).forEach(function(t){if(t!=="default"){var n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:function(){return r[t]}})}}),e.default=r,Object.freeze(e)}var b=Nl(q),mt=Nl(Kj),Ae=Nl(Ph),fe=Nl(At),ya=Nl(fA),Aa="crypto.algorithm",Th=class{getAlgorithms(){return de.container.resolveAll(Aa)}toAsnAlgorithm(e){({...e});for(let t of this.getAlgorithms()){let n=t.toAsnAlgorithm(e);if(n)return n}if(/^[0-9.]+$/.test(e.name)){let t=new q.AlgorithmIdentifier({algorithm:e.name});if("parameters"in e){let n=e;t.parameters=n.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(let n of this.getAlgorithms()){let i=n.toWebAlgorithm(e);if(i)return i}return{name:e.algorithm,parameters:e.parameters}}},_r="crypto.algorithmProvider";de.container.registerSingleton(_r,Th);var hh,Ct="1.3.36.3.3.2.8.1.1",XC=`${Ct}.1`,YC=`${Ct}.2`,ZC=`${Ct}.3`,QC=`${Ct}.4`,eP=`${Ct}.5`,tP=`${Ct}.6`,rP=`${Ct}.7`,nP=`${Ct}.8`,iP=`${Ct}.9`,sP=`${Ct}.10`,oP=`${Ct}.11`,aP=`${Ct}.12`,cP=`${Ct}.13`,uP=`${Ct}.14`,lP="brainpoolP160r1",fP="brainpoolP160t1",dP="brainpoolP192r1",pP="brainpoolP192t1",hP="brainpoolP224r1",yP="brainpoolP224t1",_P="brainpoolP256r1",gP="brainpoolP256t1",vP="brainpoolP320r1",mP="brainpoolP320t1",AP="brainpoolP384r1",bP="brainpoolP384t1",SP="brainpoolP512r1",wP="brainpoolP512t1",xe="ECDSA";x.EcAlgorithm=hh=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case xe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Ae.ecdsaWithSHA1;case"sha-256":return Ae.ecdsaWithSHA256;case"sha-384":return Ae.ecdsaWithSHA384;case"sha-512":return Ae.ecdsaWithSHA512}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=Ae.id_secp256r1;break;case"K-256":t=hh.SECP256K1;break;case"P-384":t=Ae.id_secp384r1;break;case"P-521":t=Ae.id_secp521r1;break;case lP:t=XC;break;case fP:t=YC;break;case dP:t=ZC;break;case pP:t=QC;break;case hP:t=eP;break;case yP:t=tP;break;case _P:t=rP;break;case gP:t=nP;break;case vP:t=iP;break;case mP:t=sP;break;case AP:t=oP;break;case bP:t=aP;break;case SP:t=cP;break;case wP:t=uP;break}if(t)return new q.AlgorithmIdentifier({algorithm:Ae.id_ecPublicKey,parameters:S.AsnConvert.serialize(new Ae.ECParameters({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case Ae.id_ecdsaWithSHA1:return{name:xe,hash:{name:"SHA-1"}};case Ae.id_ecdsaWithSHA256:return{name:xe,hash:{name:"SHA-256"}};case Ae.id_ecdsaWithSHA384:return{name:xe,hash:{name:"SHA-384"}};case Ae.id_ecdsaWithSHA512:return{name:xe,hash:{name:"SHA-512"}};case Ae.id_ecPublicKey:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(S.AsnConvert.parse(e.parameters,Ae.ECParameters).namedCurve){case Ae.id_secp256r1:return{name:xe,namedCurve:"P-256"};case hh.SECP256K1:return{name:xe,namedCurve:"K-256"};case Ae.id_secp384r1:return{name:xe,namedCurve:"P-384"};case Ae.id_secp521r1:return{name:xe,namedCurve:"P-521"};case XC:return{name:xe,namedCurve:lP};case YC:return{name:xe,namedCurve:fP};case ZC:return{name:xe,namedCurve:dP};case QC:return{name:xe,namedCurve:pP};case eP:return{name:xe,namedCurve:hP};case tP:return{name:xe,namedCurve:yP};case rP:return{name:xe,namedCurve:_P};case nP:return{name:xe,namedCurve:gP};case iP:return{name:xe,namedCurve:vP};case sP:return{name:xe,namedCurve:mP};case oP:return{name:xe,namedCurve:AP};case aP:return{name:xe,namedCurve:bP};case cP:return{name:xe,namedCurve:SP};case uP:return{name:xe,namedCurve:wP}}}}return null}};x.EcAlgorithm.SECP256K1="1.3.132.0.10";x.EcAlgorithm=hh=w.__decorate([de.injectable()],x.EcAlgorithm);de.container.registerSingleton(Aa,x.EcAlgorithm);var IP=Symbol("name"),kP=Symbol("value"),z=class{constructor(e,t={},n=""){this[IP]=e,this[kP]=n;for(let i in t)this[i]=t[i]}};z.NAME=IP;z.VALUE=kP;var Eh=class{static toTextObject(e){let t=new z("Algorithm Identifier",{},Yt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case Ae.id_ecPublicKey:{let n=new x.EcAlgorithm().toWebAlgorithm(e);n&&"namedCurve"in n?t["Named Curve"]=n.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}},Yt=class{static toString(e){let t=this.items[e];return t||e}};Yt.items={[fe.id_sha1]:"sha1",[fe.id_sha224]:"sha224",[fe.id_sha256]:"sha256",[fe.id_sha384]:"sha384",[fe.id_sha512]:"sha512",[fe.id_rsaEncryption]:"rsaEncryption",[fe.id_sha1WithRSAEncryption]:"sha1WithRSAEncryption",[fe.id_sha224WithRSAEncryption]:"sha224WithRSAEncryption",[fe.id_sha256WithRSAEncryption]:"sha256WithRSAEncryption",[fe.id_sha384WithRSAEncryption]:"sha384WithRSAEncryption",[fe.id_sha512WithRSAEncryption]:"sha512WithRSAEncryption",[Ae.id_ecPublicKey]:"ecPublicKey",[Ae.id_ecdsaWithSHA1]:"ecdsaWithSHA1",[Ae.id_ecdsaWithSHA224]:"ecdsaWithSHA224",[Ae.id_ecdsaWithSHA256]:"ecdsaWithSHA256",[Ae.id_ecdsaWithSHA384]:"ecdsaWithSHA384",[Ae.id_ecdsaWithSHA512]:"ecdsaWithSHA512",[b.id_kp_serverAuth]:"TLS WWW server authentication",[b.id_kp_clientAuth]:"TLS WWW client authentication",[b.id_kp_codeSigning]:"Code Signing",[b.id_kp_emailProtection]:"E-mail Protection",[b.id_kp_timeStamping]:"Time Stamping",[b.id_kp_OCSPSigning]:"OCSP Signing",[mt.id_signedData]:"Signed Data"};var gr=class{static serialize(e){return this.serializeObj(e).join(`
|
|
21
|
+
`)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){let n=[],i=this.pad(t++),s="",o=e[z.VALUE];o&&(s=` ${o}`),n.push(`${i}${e[z.NAME]}:${s}`),i=this.pad(t);for(let a in e){if(typeof a=="symbol")continue;let c=e[a],u=a?`${a}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")n.push(`${i}${u}${c}`);else if(c instanceof Date)n.push(`${i}${u}${c.toUTCString()}`);else if(Array.isArray(c))for(let d of c)d[z.NAME]=a,n.push(...this.serializeObj(d,t));else if(c instanceof z)c[z.NAME]=a,n.push(...this.serializeObj(c,t));else if(P.BufferSourceConverter.isBufferSource(c))a?(n.push(`${i}${u}`),n.push(...this.serializeBufferSource(c,t+1))):n.push(...this.serializeBufferSource(c,t));else if("toTextObject"in c){let d=c.toTextObject();d[z.NAME]=a,n.push(...this.serializeObj(d,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return n}static serializeBufferSource(e,t=0){let n=this.pad(t),i=P.BufferSourceConverter.toUint8Array(e),s=[];for(let o=0;o<i.length;){let a=[];for(let c=0;c<16&&o<i.length;c++){c===8&&a.push("");let u=i[o++].toString(16).padStart(2,"0");a.push(u)}s.push(`${n}${a.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}};gr.oidSerializer=Yt;gr.algorithmSerializer=Eh;var ca,Kr=class r{get rawData(){return w.__classPrivateFieldGet(this,ca,"f")||w.__classPrivateFieldSet(this,ca,S.AsnConvert.serialize(this.asn),"f"),w.__classPrivateFieldGet(this,ca,"f")}constructor(...e){ca.set(this,void 0),P.BufferSourceConverter.isBufferSource(e[0])?(this.asn=S.AsnConvert.parse(e[0],e[1]),w.__classPrivateFieldSet(this,ca,P.BufferSourceConverter.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof r?P.isEqual(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return S.AsnConvert.toString(this.rawData);case"text":return gr.serialize(this.toTextObject());case"hex":return P.Convert.ToHex(this.rawData);case"base64":return P.Convert.ToBase64(this.rawData);case"base64url":return P.Convert.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){let e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new z(this.getTextName(),{},e)}};ca=new WeakMap;Kr.NAME="ASN";var bt=class r extends Kr{constructor(...e){let t;P.BufferSourceConverter.isBufferSource(e[0])?t=P.BufferSourceConverter.toArrayBuffer(e[0]):t=S.AsnConvert.serialize(new q.Extension({extnID:e[0],critical:e[1],extnValue:new S.OctetString(P.BufferSourceConverter.toArrayBuffer(e[2]))})),super(t,q.Extension)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[z.NAME]===r.NAME&&(e[z.NAME]=Yt.toString(this.type)),e}},BP,_a=class r{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[BP]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(r.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(r.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,t){return this.items.forEach(e,t)}has(e){return this.items.has(e)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(e=r.DEFAULT){let t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if(typeof e=="string"){if(!t)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(r.DEFAULT,e);return this}};BP=Symbol.toStringTag;_a.DEFAULT="default";var be=new _a,Gj=/^[0-2](?:\.[1-9][0-9]*)+$/;function Wj(r){return new RegExp(Gj).test(r)}var Al=class{constructor(e={}){this.items={};for(let t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Wj(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}},St=new Al;St.register("CN","2.5.4.3");St.register("L","2.5.4.7");St.register("ST","2.5.4.8");St.register("O","2.5.4.10");St.register("OU","2.5.4.11");St.register("C","2.5.4.6");St.register("DC","0.9.2342.19200300.100.1.25");St.register("E","1.2.840.113549.1.9.1");St.register("G","2.5.4.42");St.register("I","2.5.4.43");St.register("SN","2.5.4.4");St.register("T","2.5.4.12");function zj(r,e){return`\\${P.Convert.ToHex(P.Convert.FromUtf8String(e)).toUpperCase()}`}function Jj(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,zj)}var Ke=class r{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,t={}){this.extraNames=new Al,this.asn=new q.Name;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n];this.extraNames.register(n,i)}typeof e=="string"?this.asn=this.fromString(e):e instanceof q.Name?this.asn=e:P.BufferSourceConverter.isBufferSource(e)?this.asn=S.AsnConvert.parse(e,q.Name):this.asn=this.fromJSON(e)}getField(e){let t=this.extraNames.findId(e)||St.findId(e),n=[];for(let i of this.asn)for(let s of i)s.type===t&&n.push(s.value.toString());return n}getName(e){return this.extraNames.get(e)||St.get(e)}toString(){return this.asn.map(e=>e.map(t=>{let n=this.getName(t.type)||t.type,i=t.value.anyValue?`#${P.Convert.ToHex(t.value.anyValue)}`:Jj(t.value.toString());return`${n}=${i}`}).join("+")).join(", ")}toJSON(){var e;let t=[];for(let n of this.asn){let i={};for(let s of n){let o=this.getName(s.type)||s.type;(e=i[o])!==null&&e!==void 0||(i[o]=[]),i[o].push(s.value.anyValue?`#${P.Convert.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(i)}return t}fromString(e){let t=new q.Name,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g,i=null,s=",";for(;i=n.exec(`${e},`);){let[,o,a]=i,c=a[a.length-1];(c===","||c==="+")&&(a=a.slice(0,a.length-1),i[3]=c);let u=i[3];o=this.getTypeOid(o);let d=this.createAttribute(o,a);s==="+"?t[t.length-1].push(d):t.push(new q.RelativeDistinguishedName([d])),s=u}return t}fromJSON(e){let t=new q.Name;for(let n of e){let i=new q.RelativeDistinguishedName;for(let s in n){let o=this.getTypeOid(s),a=n[s];for(let c of a){let u=this.createAttribute(o,c);i.push(u)}}t.push(i)}return t}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,t){let n=new q.AttributeTypeAndValue({type:e});if(typeof t=="object")for(let i in t)switch(i){case"ia5String":n.value.ia5String=t[i];break;case"utf8String":n.value.utf8String=t[i];break;case"universalString":n.value.universalString=t[i];break;case"bmpString":n.value.bmpString=t[i];break;case"printableString":n.value.printableString=t[i];break}else if(t[0]==="#")n.value.anyValue=P.Convert.FromHex(t.slice(1));else{let i=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?n.value.ia5String=i:r.isPrintableString(i)?n.value.printableString=i:n.value.utf8String=i}return n}processStringValue(e){let t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,`
|
|
22
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return S.AsnConvert.serialize(this.asn)}async getThumbprint(...e){var t;let n,i="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(i=e[0]||i,n=e[1]||be.get()):n=e[0]||be.get(),await n.subtle.digest(i,this.toArrayBuffer())}},OP="Cannot initialize GeneralName from ASN.1 data.",CP=`${OP} Unsupported string format in use.`,Xj=`${OP} Value doesn't match to GUID regular expression.`,PP=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,xP="1.3.6.1.4.1.311.25.1",TP="1.3.6.1.4.1.311.20.2.3",yh="dns",_h="dn",gh="email",vh="ip",mh="url",Ah="guid",bh="upn",Gu="id",hr=class extends Kr{constructor(...e){let t;if(e.length===2)switch(e[0]){case _h:{let n=new Ke(e[1]).toArrayBuffer(),i=S.AsnConvert.parse(n,b.Name);t=new b.GeneralName({directoryName:i});break}case yh:t=new b.GeneralName({dNSName:e[1]});break;case gh:t=new b.GeneralName({rfc822Name:e[1]});break;case Ah:{let n=new RegExp(PP,"i").exec(e[1]);if(!n)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");let i=n.slice(1).map((s,o)=>o<3?P.Convert.ToHex(new Uint8Array(P.Convert.FromHex(s)).reverse()):s).join("");t=new b.GeneralName({otherName:new b.OtherName({typeId:xP,value:S.AsnConvert.serialize(new S.OctetString(P.Convert.FromHex(i)))})});break}case vh:t=new b.GeneralName({iPAddress:e[1]});break;case Gu:t=new b.GeneralName({registeredID:e[1]});break;case bh:{t=new b.GeneralName({otherName:new b.OtherName({typeId:TP,value:S.AsnConvert.serialize(S.AsnUtf8StringConverter.toASN(e[1]))})});break}case mh:t=new b.GeneralName({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else P.BufferSourceConverter.isBufferSource(e[0])?t=S.AsnConvert.parse(e[0],b.GeneralName):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=yh,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=gh,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=vh,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=mh,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Gu,this.value=e.registeredID;else if(e.directoryName!=null)this.type=_h,this.value=new Ke(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===xP){this.type=Ah;let t=S.AsnConvert.parse(e.otherName.value,S.OctetString),n=new RegExp(PP,"i").exec(P.Convert.ToHex(t));if(!n)throw new Error(Xj);this.value=n.slice(1).map((i,s)=>s<3?P.Convert.ToHex(new Uint8Array(P.Convert.FromHex(i)).reverse()):i).join("-")}else if(e.otherName.typeId===TP)this.type=bh,this.value=S.AsnConvert.parse(e.otherName.value,b.DirectoryString).toString();else throw new Error(CP);else throw new Error(CP)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case _h:case yh:case Ah:case vh:case Gu:case bh:case mh:e=this.type.toUpperCase();break;case gh:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Gu&&(t=Yt.toString(t)),new z(e,void 0,t)}},Gr=class extends Kr{constructor(e){let t;if(e instanceof b.GeneralNames)t=e;else if(Array.isArray(e)){let n=[];for(let i of e)if(i instanceof b.GeneralName)n.push(i);else{let s=S.AsnConvert.parse(new hr(i.type,i.value).rawData,b.GeneralName);n.push(s)}t=new b.GeneralNames(n)}else if(P.BufferSourceConverter.isBufferSource(e))t=S.AsnConvert.parse(e,b.GeneralNames);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){let t=[];for(let n of e){let i=null;try{i=new hr(n)}catch{continue}t.push(i)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){let e=super.toTextObjectEmpty();for(let t of this.items){let n=t.toTextObject(),i=e[n[z.NAME]];Array.isArray(i)||(i=[],e[n[z.NAME]]=i),i.push(n)}return e}};Gr.NAME="GeneralNames";var ml="-{5}",bl="\\n",Yj=`[^${bl}]+`,Zj=`${ml}BEGIN (${Yj}(?=${ml}))${ml}`,Qj=`${ml}END \\1${ml}`,ga="\\n",eN=`[^:${bl}]+`,tN=`(?:[^${bl}]+${ga}(?: +[^${bl}]+${ga})*)`,rN="[a-zA-Z0-9=+/]+",nN=`(?:${rN}${ga})+`,EP=`${Zj}${ga}(?:((?:${eN}: ${tN})+))?${ga}?(${nN})${Qj}`,Xe=class{static isPem(e){return typeof e=="string"&&new RegExp(EP,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");let t=new RegExp(EP,"g"),n=[],i=null;for(;i=t.exec(e);){let s=i[3].replace(new RegExp(`[${bl}]+`,"g"),""),o={type:i[1],headers:[],rawData:P.Convert.FromBase64(s)},a=i[2];if(a){let c=a.split(new RegExp(ga,"g")),u=null;for(let d of c){let[p,_]=d.split(/:(.*)/);if(_===void 0){if(!u)throw new Error("Cannot parse PEM string. Incorrect header value");u.value+=p.trim()}else u&&o.headers.push(u),u={key:p,value:_.trim()}}u&&o.headers.push(u)}n.push(o)}return n}static decode(e){return this.decodeWithHeaders(e).map(n=>n.rawData)}static decodeFirst(e){let t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){let n=new Array;return t?e.forEach(i=>{if(!P.BufferSourceConverter.isBufferSource(i))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");n.push(this.encodeStruct({type:t,rawData:P.BufferSourceConverter.toArrayBuffer(i)}))}):e.forEach(i=>{if(!("type"in i))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");n.push(this.encodeStruct(i))}),n.join(`
|
|
23
|
+
`)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:P.BufferSourceConverter.toArrayBuffer(e)})}}static encodeStruct(e){var t;let n=e.type.toLocaleUpperCase(),i=[];if(i.push(`-----BEGIN ${n}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(let u of e.headers)i.push(`${u.key}: ${u.value}`);i.push("")}let s=P.Convert.ToBase64(e.rawData),o,a=0,c=Array();for(;a<s.length&&(s.length-a<64?o=s.substring(a):(o=s.substring(a,a+64),a+=64),o.length!==0);)if(c.push(o),o.length<64)break;return i.push(...c),i.push(`-----END ${n}-----`),i.join(`
|
|
24
|
+
`)}};Xe.CertificateTag="CERTIFICATE";Xe.CrlTag="CRL";Xe.CertificateRequestTag="CERTIFICATE REQUEST";Xe.PublicKeyTag="PUBLIC KEY";Xe.PrivateKeyTag="PRIVATE KEY";var wt=class r extends Kr{static isAsnEncoded(e){return P.BufferSourceConverter.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Xe.isPem(e))return Xe.decode(e)[0];if(P.Convert.isHex(e))return P.Convert.FromHex(e);if(P.Convert.isBase64(e))return P.Convert.FromBase64(e);if(P.Convert.isBase64Url(e))return P.Convert.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{let t=P.BufferSourceConverter.toUint8Array(e);if(t.length>0&&t[0]===48)return P.BufferSourceConverter.toArrayBuffer(e);let n=P.Convert.ToBinary(e);if(Xe.isPem(n))return Xe.decode(n)[0];if(P.Convert.isHex(n))return P.Convert.FromHex(n);if(P.Convert.isBase64(n))return P.Convert.FromBase64(n);if(P.Convert.isBase64Url(n))return P.Convert.FromBase64Url(n);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){r.isAsnEncoded(e[0])?super(r.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Xe.encode(this.rawData,this.tag);default:return super.toString(e)}}},yr=class r extends wt{static async create(e,t=be.get()){if(e instanceof r)return e;if(_a.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");let n=await t.subtle.exportKey("spki",e);return new r(n)}else{if(e.publicKey)return e.publicKey;if(P.BufferSourceConverter.isBufferSource(e))return new r(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){wt.isAsnEncoded(e)?super(e,q.SubjectPublicKeyInfo):super(e),this.tag=Xe.PublicKeyTag}async export(...e){let t,n=["verify"],i={hash:"SHA-256",...this.algorithm};e.length>1?(i=e[0]||i,n=e[1]||n,t=e[2]||be.get()):t=e[0]||be.get();let s=this.rawData,o=S.AsnConvert.parse(this.rawData,q.SubjectPublicKeyInfo);return o.algorithm.algorithm===At.id_RSASSA_PSS&&(s=iN(o,s)),t.subtle.importKey("spki",s,i,!0,n)}onInit(e){let t=de.container.resolve(_r),n=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case At.id_rsaEncryption:{let i=S.AsnConvert.parse(e.subjectPublicKey,At.RSAPublicKey),s=P.BufferSourceConverter.toUint8Array(i.modulus);n.publicExponent=P.BufferSourceConverter.toUint8Array(i.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let n,i="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(i=e[0]||i,n=e[1]||be.get()):n=e[0]||be.get(),await n.subtle.digest(i,this.rawData)}async getKeyIdentifier(...e){let t,n="SHA-1";e.length===1?typeof e[0]=="string"?(n=e[0],t=be.get()):t=e[0]:e.length===2?(n=e[0],t=e[1]):t=be.get();let i=S.AsnConvert.parse(this.rawData,q.SubjectPublicKeyInfo);return await t.subtle.digest(n,i.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),t=S.AsnConvert.parse(this.rawData,q.SubjectPublicKeyInfo);switch(e.Algorithm=gr.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case Ph.id_ecPublicKey:e["EC Point"]=t.subjectPublicKey;break;case At.id_rsaEncryption:default:e["Raw Data"]=t.subjectPublicKey}return e}};function iN(r,e){return r.algorithm=new q.AlgorithmIdentifier({algorithm:At.id_rsaEncryption,parameters:null}),e=S.AsnConvert.serialize(r),e}var Sl=class r extends bt{static async create(e,t=!1,n=be.get()){if("name"in e&&"serialNumber"in e)return new r(e,t);let s=await(await yr.create(e,n)).getKeyIdentifier(n);return new r(P.Convert.ToHex(s),t)}constructor(...e){if(P.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){let t=new b.AuthorityKeyIdentifier({keyIdentifier:new b.KeyIdentifier(P.Convert.FromHex(e[0]))});super(b.id_ce_authorityKeyIdentifier,e[1],S.AsnConvert.serialize(t))}else{let t=e[0],n=t.name instanceof Gr?S.AsnConvert.parse(t.name.rawData,b.GeneralNames):t.name,i=new b.AuthorityKeyIdentifier({authorityCertIssuer:n,authorityCertSerialNumber:P.Convert.FromHex(t.serialNumber)});super(b.id_ce_authorityKeyIdentifier,e[1],S.AsnConvert.serialize(i))}}onInit(e){super.onInit(e);let t=S.AsnConvert.parse(e.extnValue,b.AuthorityKeyIdentifier);t.keyIdentifier&&(this.keyId=P.Convert.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?P.Convert.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),t=S.AsnConvert.parse(this.value,b.AuthorityKeyIdentifier);return t.authorityCertIssuer&&(e["Authority Issuer"]=new Gr(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}};Sl.NAME="Authority Key Identifier";var wl=class extends bt{constructor(...e){if(P.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=S.AsnConvert.parse(this.value,q.BasicConstraints);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{let t=new q.BasicConstraints({cA:e[0],pathLenConstraint:e[1]});super(q.id_ce_basicConstraints,e[2],S.AsnConvert.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}};wl.NAME="Basic Constraints";x.ExtendedKeyUsage=void 0;(function(r){r.serverAuth="1.3.6.1.5.5.7.3.1",r.clientAuth="1.3.6.1.5.5.7.3.2",r.codeSigning="1.3.6.1.5.5.7.3.3",r.emailProtection="1.3.6.1.5.5.7.3.4",r.timeStamping="1.3.6.1.5.5.7.3.8",r.ocspSigning="1.3.6.1.5.5.7.3.9"})(x.ExtendedKeyUsage||(x.ExtendedKeyUsage={}));var Cl=class extends bt{constructor(...e){if(P.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=S.AsnConvert.parse(this.value,b.ExtendedKeyUsage);this.usages=t.map(n=>n)}else{let t=new b.ExtendedKeyUsage(e[0]);super(b.id_ce_extKeyUsage,e[1],S.AsnConvert.serialize(t)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Yt.toString(t)).join(", "),e}};Cl.NAME="Extended Key Usages";x.KeyUsageFlags=void 0;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(x.KeyUsageFlags||(x.KeyUsageFlags={}));var Pl=class extends bt{constructor(...e){if(P.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=S.AsnConvert.parse(this.value,q.KeyUsage);this.usages=t.toNumber()}else{let t=new q.KeyUsage(e[0]);super(q.id_ce_keyUsage,e[1],S.AsnConvert.serialize(t)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=S.AsnConvert.parse(this.value,q.KeyUsage);return e[""]=t.toJSON().join(", "),e}};Pl.NAME="Key Usages";var xl=class r extends bt{static async create(e,t=!1,n=be.get()){let s=await(await yr.create(e,n)).getKeyIdentifier(n);return new r(P.Convert.ToHex(s),t)}constructor(...e){if(P.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=S.AsnConvert.parse(this.value,b.SubjectKeyIdentifier);this.keyId=P.Convert.ToHex(t)}else{let t=typeof e[0]=="string"?P.Convert.FromHex(e[0]):e[0],n=new b.SubjectKeyIdentifier(t);super(b.id_ce_subjectKeyIdentifier,e[1],S.AsnConvert.serialize(n)),this.keyId=P.Convert.ToHex(t)}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=S.AsnConvert.parse(this.value,b.SubjectKeyIdentifier);return e[""]=t,e}};xl.NAME="Subject Key Identifier";var Tl=class extends bt{constructor(...e){P.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(b.id_ce_subjectAltName,e[1],new Gr(e[0]||[]).rawData)}onInit(e){super.onInit(e);let t=S.AsnConvert.parse(e.extnValue,b.SubjectAlternativeName);this.names=new Gr(t)}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(let n in t)e[n]=t[n];return e}};Tl.NAME="Subject Alternative Name";var Ye=class{static register(e,t){this.items.set(e,t)}static create(e){let t=new bt(e),n=this.items.get(t.type);return n?new n(e):t}};Ye.items=new Map;var El=class extends bt{constructor(...e){var t;if(P.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let n=S.AsnConvert.parse(this.value,b.CertificatePolicies);this.policies=n.map(i=>i.policyIdentifier)}else{let n=e[0],i=(t=e[1])!==null&&t!==void 0?t:!1,s=new b.CertificatePolicies(n.map(o=>new b.PolicyInformation({policyIdentifier:o})));super(b.id_ce_certificatePolicies,i,S.AsnConvert.serialize(s)),this.policies=n}}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new z("",{},Yt.toString(t))),e}};El.NAME="Certificate Policies";Ye.register(b.id_ce_certificatePolicies,El);var Il=class extends bt{constructor(...e){var t;if(P.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){let i=e[0].map(o=>new b.DistributionPoint({distributionPoint:new b.DistributionPointName({fullName:[new b.GeneralName({uniformResourceIdentifier:o})]})})),s=new b.CRLDistributionPoints(i);super(b.id_ce_cRLDistributionPoints,e[1],S.AsnConvert.serialize(s))}else{let n=new b.CRLDistributionPoints(e[0]);super(b.id_ce_cRLDistributionPoints,e[1],S.AsnConvert.serialize(n))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);let t=S.AsnConvert.parse(e.extnValue,b.CRLDistributionPoints);this.distributionPoints=t}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var n;let i={};return t.distributionPoint&&(i[""]=(n=t.distributionPoint.fullName)===null||n===void 0?void 0:n.map(s=>new hr(s).toString()).join(", ")),t.reasons&&(i.Reasons=t.reasons.toString()),t.cRLIssuer&&(i["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),i}),e}};Il.NAME="CRL Distribution Points";var kl=class extends bt{constructor(...e){var t,n,i,s;if(P.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof b.AuthorityInfoAccessSyntax){let o=new b.AuthorityInfoAccessSyntax(e[0]);super(b.id_pe_authorityInfoAccess,e[1],S.AsnConvert.serialize(o))}else{let o=e[0],a=new b.AuthorityInfoAccessSyntax;ph(a,o,b.id_ad_ocsp,"ocsp"),ph(a,o,b.id_ad_caIssuers,"caIssuers"),ph(a,o,b.id_ad_timeStamping,"timeStamping"),ph(a,o,b.id_ad_caRepository,"caRepository"),super(b.id_pe_authorityInfoAccess,e[1],S.AsnConvert.serialize(a))}(t=this.ocsp)!==null&&t!==void 0||(this.ocsp=[]),(n=this.caIssuers)!==null&&n!==void 0||(this.caIssuers=[]),(i=this.timeStamping)!==null&&i!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],S.AsnConvert.parse(e.extnValue,b.AuthorityInfoAccessSyntax).forEach(n=>{switch(n.accessMethod){case b.id_ad_ocsp:this.ocsp.push(new hr(n.accessLocation));break;case b.id_ad_caIssuers:this.caIssuers.push(new hr(n.accessLocation));break;case b.id_ad_timeStamping:this.timeStamping.push(new hr(n.accessLocation));break;case b.id_ad_caRepository:this.caRepository.push(new hr(n.accessLocation));break}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&dh(e,"OCSP",this.ocsp),this.caIssuers.length&&dh(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&dh(e,"Time Stamping",this.timeStamping),this.caRepository.length&&dh(e,"CA Repository",this.caRepository),e}};kl.NAME="Authority Info Access";function dh(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{let n=new z("");t.forEach((i,s)=>{let o=i.toTextObject(),a=`${o[z.NAME]} ${s+1}`,c=n[a];Array.isArray(c)||(c=[],n[a]=c),c.push(o)}),r[e]=n}}function ph(r,e,t,n){let i=e[n];i&&(Array.isArray(i)?i:[i]).forEach(o=>{typeof o=="string"&&(o=new hr("url",o)),r.push(new b.AccessDescription({accessMethod:t,accessLocation:S.AsnConvert.parse(o.rawData,b.GeneralName)}))})}var Bl=class extends bt{constructor(...e){P.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(b.id_ce_issuerAltName,e[1],new Gr(e[0]||[]).rawData)}onInit(e){super.onInit(e);let t=S.AsnConvert.parse(e.extnValue,b.GeneralNames);this.names=new Gr(t)}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(let n in t)e[n]=t[n];return e}};Bl.NAME="Issuer Alternative Name";var As=class r extends Kr{constructor(...e){let t;if(P.BufferSourceConverter.isBufferSource(e[0]))t=P.BufferSourceConverter.toArrayBuffer(e[0]);else{let n=e[0],i=Array.isArray(e[1])?e[1].map(s=>P.BufferSourceConverter.toArrayBuffer(s)):[];t=S.AsnConvert.serialize(new q.Attribute({type:n,values:i}))}super(t,q.Attribute)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new z("",{"":t})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[z.NAME]===r.NAME&&(e[z.NAME]=Yt.toString(this.type)),e}};As.NAME="Attribute";var Ol=class extends As{constructor(...e){var t;if(P.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=new ya.ChallengePassword({printableString:e[0]});super(ya.id_pkcs9_at_challengePassword,[S.AsnConvert.serialize(n)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let t=S.AsnConvert.parse(this.values[0],ya.ChallengePassword);this.password=t.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[z.VALUE]=this.password,e}};Ol.NAME="Challenge Password";var va=class extends As{constructor(...e){var t;if(P.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=e[0],i=new b.Extensions;for(let s of n)i.push(S.AsnConvert.parse(s.rawData,b.Extension));super(ya.id_pkcs9_at_extensionRequest,[S.AsnConvert.serialize(i)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let t=S.AsnConvert.parse(this.values[0],b.Extensions);this.items=t.map(n=>Ye.create(S.AsnConvert.serialize(n)))}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.items.map(n=>n.toTextObject());for(let n of t)e[n[z.NAME]]=n;return e}};va.NAME="Extensions";var bs=class{static register(e,t){this.items.set(e,t)}static create(e){let t=new As(e),n=this.items.get(t.type);return n?new n(e):t}};bs.items=new Map;var gn="crypto.signatureFormatter",Ih=class{toAsnSignature(e,t){return P.BufferSourceConverter.toArrayBuffer(t)}toWebSignature(e,t){return P.BufferSourceConverter.toArrayBuffer(t)}},Sh;x.RsaAlgorithm=Sh=class{static createPssParams(e,t){let n=Sh.getHashAlgorithm(e);return n?new fe.RsaSaPssParams({hashAlgorithm:n,maskGenAlgorithm:new q.AlgorithmIdentifier({algorithm:fe.id_mgf1,parameters:S.AsnConvert.serialize(n)}),saltLength:t}):null}static getHashAlgorithm(e){let t=de.container.resolve(_r);return typeof e=="string"?t.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?t.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let t;if(typeof e.hash=="string")t=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")t=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new q.AlgorithmIdentifier({algorithm:fe.id_sha1WithRSAEncryption,parameters:null});case"sha-256":return new q.AlgorithmIdentifier({algorithm:fe.id_sha256WithRSAEncryption,parameters:null});case"sha-384":return new q.AlgorithmIdentifier({algorithm:fe.id_sha384WithRSAEncryption,parameters:null});case"sha-512":return new q.AlgorithmIdentifier({algorithm:fe.id_sha512WithRSAEncryption,parameters:null})}}else return new q.AlgorithmIdentifier({algorithm:fe.id_rsaEncryption,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");let t=Sh.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new q.AlgorithmIdentifier({algorithm:fe.id_RSASSA_PSS,parameters:S.AsnConvert.serialize(t)})}else return new q.AlgorithmIdentifier({algorithm:fe.id_RSASSA_PSS,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case fe.id_rsaEncryption:return{name:"RSASSA-PKCS1-v1_5"};case fe.id_sha1WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case fe.id_sha256WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case fe.id_sha384WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case fe.id_sha512WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case fe.id_RSASSA_PSS:if(e.parameters){let t=S.AsnConvert.parse(e.parameters,fe.RsaSaPssParams);return{name:"RSA-PSS",hash:de.container.resolve(_r).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};x.RsaAlgorithm=Sh=w.__decorate([de.injectable()],x.RsaAlgorithm);de.container.registerSingleton(Aa,x.RsaAlgorithm);x.ShaAlgorithm=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new q.AlgorithmIdentifier({algorithm:At.id_sha1});case"sha-256":return new q.AlgorithmIdentifier({algorithm:At.id_sha256});case"sha-384":return new q.AlgorithmIdentifier({algorithm:At.id_sha384});case"sha-512":return new q.AlgorithmIdentifier({algorithm:At.id_sha512})}return null}toWebAlgorithm(e){switch(e.algorithm){case At.id_sha1:return{name:"SHA-1"};case At.id_sha256:return{name:"SHA-256"};case At.id_sha384:return{name:"SHA-384"};case At.id_sha512:return{name:"SHA-512"}}return null}};x.ShaAlgorithm=w.__decorate([de.injectable()],x.ShaAlgorithm);de.container.registerSingleton(Aa,x.ShaAlgorithm);var Wr=class r{addPadding(e,t){let n=P.BufferSourceConverter.toUint8Array(t),i=new Uint8Array(e);return i.set(n,e-n.length),i.buffer}removePadding(e,t=!1){let n=P.BufferSourceConverter.toUint8Array(e);for(let i=0;i<n.length;i++)if(n[i]){n=n.slice(i);break}if(t&&n[0]>127){let i=new Uint8Array(n.length+1);return i.set(n,1),i.buffer}return n.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){let n=e.namedCurve,i=r.namedCurveSize.get(n)||r.defaultNamedCurveSize,s=new Ph.ECDSASigValue,o=P.BufferSourceConverter.toUint8Array(t);return s.r=this.removePadding(o.slice(0,i),!0),s.s=this.removePadding(o.slice(i,i+i),!0),S.AsnConvert.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){let n=S.AsnConvert.parse(t,Ph.ECDSASigValue),i=e.namedCurve,s=r.namedCurveSize.get(i)||r.defaultNamedCurveSize,o=this.addPadding(s,this.removePadding(n.r)),a=this.addPadding(s,this.removePadding(n.s));return P.combine(o,a)}return null}};Wr.namedCurveSize=new Map;Wr.defaultNamedCurveSize=32;var wh="1.3.101.110",sA="1.3.101.111",Ch="1.3.101.112",oA="1.3.101.113";x.EdAlgorithm=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=Ch;break;case"x25519":t=wh;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=Ch;break;case"ed448":t=oA;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=wh;break;case"x448":t=sA;break}}return t?new q.AlgorithmIdentifier({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case Ch:return{name:"Ed25519"};case oA:return{name:"EdDSA",namedCurve:"Ed448"};case wh:return{name:"X25519"};case sA:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};x.EdAlgorithm=w.__decorate([de.injectable()],x.EdAlgorithm);de.container.registerSingleton(Aa,x.EdAlgorithm);var Wu,zu,Ju,Xu,Yu,Zu,Qu,ua,jl=class extends wt{get subjectName(){return w.__classPrivateFieldGet(this,zu,"f")||w.__classPrivateFieldSet(this,zu,new Ke(this.asn.certificationRequestInfo.subject),"f"),w.__classPrivateFieldGet(this,zu,"f")}get subject(){return w.__classPrivateFieldGet(this,Ju,"f")||w.__classPrivateFieldSet(this,Ju,this.subjectName.toString(),"f"),w.__classPrivateFieldGet(this,Ju,"f")}get signatureAlgorithm(){if(!w.__classPrivateFieldGet(this,Xu,"f")){let e=de.container.resolve(_r);w.__classPrivateFieldSet(this,Xu,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return w.__classPrivateFieldGet(this,Xu,"f")}get signature(){return w.__classPrivateFieldGet(this,Yu,"f")||w.__classPrivateFieldSet(this,Yu,this.asn.signature,"f"),w.__classPrivateFieldGet(this,Yu,"f")}get publicKey(){return w.__classPrivateFieldGet(this,Zu,"f")||w.__classPrivateFieldSet(this,Zu,new yr(this.asn.certificationRequestInfo.subjectPKInfo),"f"),w.__classPrivateFieldGet(this,Zu,"f")}get attributes(){return w.__classPrivateFieldGet(this,Qu,"f")||w.__classPrivateFieldSet(this,Qu,this.asn.certificationRequestInfo.attributes.map(e=>bs.create(S.AsnConvert.serialize(e))),"f"),w.__classPrivateFieldGet(this,Qu,"f")}get extensions(){if(!w.__classPrivateFieldGet(this,ua,"f")){w.__classPrivateFieldSet(this,ua,[],"f");let e=this.getAttribute(fA.id_pkcs9_at_extensionRequest);e instanceof va&&w.__classPrivateFieldSet(this,ua,e.items,"f")}return w.__classPrivateFieldGet(this,ua,"f")}get tbs(){return w.__classPrivateFieldGet(this,Wu,"f")||w.__classPrivateFieldSet(this,Wu,this.asn.certificationRequestInfoRaw||S.AsnConvert.serialize(this.asn.certificationRequestInfo),"f"),w.__classPrivateFieldGet(this,Wu,"f")}constructor(e){let t=wt.isAsnEncoded(e)?[e,xh.CertificationRequest]:[e];super(t[0],t[1]),Wu.set(this,void 0),zu.set(this,void 0),Ju.set(this,void 0),Xu.set(this,void 0),Yu.set(this,void 0),Zu.set(this,void 0),Qu.set(this,void 0),ua.set(this,void 0),this.tag=Xe.CertificateRequestTag}onInit(e){}getAttribute(e){for(let t of this.attributes)if(t.type===e)return t;return null}getAttributes(e){return this.attributes.filter(t=>t.type===e)}getExtension(e){for(let t of this.extensions)if(t.type===e)return t;return null}getExtensions(e){return this.extensions.filter(t=>t.type===e)}async verify(e=be.get()){let t={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(t,["verify"],e),i=de.container.resolveAll(gn).reverse(),s=null;for(let a of i)if(s=a.toWebSignature(t,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,n,s,this.tbs)}toTextObject(){let e=this.toTextObjectEmpty(),t=S.AsnConvert.parse(this.rawData,xh.CertificationRequest),n=t.certificationRequestInfo,i=new z("",{Version:`${q.Version[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let s=new z("");for(let o of this.attributes){let a=o.toTextObject();s[a[z.NAME]]=a}i.Attributes=s}return e.Data=i,e.Signature=new z("",{Algorithm:gr.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}};Wu=new WeakMap,zu=new WeakMap,Ju=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,Zu=new WeakMap,Qu=new WeakMap,ua=new WeakMap;jl.NAME="PKCS#10 Certificate Request";var aA=class{static async create(e,t=be.get()){if(!e.keys.privateKey)throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty");if(!e.keys.publicKey)throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty");let n=await t.subtle.exportKey("spki",e.keys.publicKey),i=new xh.CertificationRequest({certificationRequestInfo:new xh.CertificationRequestInfo({subjectPKInfo:S.AsnConvert.parse(n,q.SubjectPublicKeyInfo)})});if(e.name){let p=e.name instanceof Ke?e.name:new Ke(e.name);i.certificationRequestInfo.subject=S.AsnConvert.parse(p.toArrayBuffer(),q.Name)}if(e.attributes)for(let p of e.attributes)i.certificationRequestInfo.attributes.push(S.AsnConvert.parse(p.rawData,q.Attribute));if(e.extensions&&e.extensions.length){let p=new q.Attribute({type:fA.id_pkcs9_at_extensionRequest}),_=new q.Extensions;for(let E of e.extensions)_.push(S.AsnConvert.parse(E.rawData,q.Extension));p.values.push(S.AsnConvert.serialize(_)),i.certificationRequestInfo.attributes.push(p)}let s={...e.signingAlgorithm,...e.keys.privateKey.algorithm},o=de.container.resolve(_r);i.signatureAlgorithm=o.toAsnAlgorithm(s);let a=S.AsnConvert.serialize(i.certificationRequestInfo),c=await t.subtle.sign(s,e.keys.privateKey,a),u=de.container.resolveAll(gn).reverse(),d=null;for(let p of u)if(d=p.toAsnSignature(s,c),d)break;if(!d)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return i.signature=d,new jl(S.AsnConvert.serialize(i))}},el,tl,rl,nl,il,sl,ol,al,cl,ul,la,ll,Jn=class extends wt{get publicKey(){return w.__classPrivateFieldGet(this,ll,"f")||w.__classPrivateFieldSet(this,ll,new yr(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),w.__classPrivateFieldGet(this,ll,"f")}get serialNumber(){if(!w.__classPrivateFieldGet(this,tl,"f")){let e=this.asn.tbsCertificate,t=new Uint8Array(e.serialNumber);t.length>1&&t[0]===0&&t[1]>127&&(t=t.slice(1)),w.__classPrivateFieldSet(this,tl,P.Convert.ToHex(t),"f")}return w.__classPrivateFieldGet(this,tl,"f")}get subjectName(){return w.__classPrivateFieldGet(this,rl,"f")||w.__classPrivateFieldSet(this,rl,new Ke(this.asn.tbsCertificate.subject),"f"),w.__classPrivateFieldGet(this,rl,"f")}get subject(){return w.__classPrivateFieldGet(this,nl,"f")||w.__classPrivateFieldSet(this,nl,this.subjectName.toString(),"f"),w.__classPrivateFieldGet(this,nl,"f")}get issuerName(){return w.__classPrivateFieldGet(this,il,"f")||w.__classPrivateFieldSet(this,il,new Ke(this.asn.tbsCertificate.issuer),"f"),w.__classPrivateFieldGet(this,il,"f")}get issuer(){return w.__classPrivateFieldGet(this,sl,"f")||w.__classPrivateFieldSet(this,sl,this.issuerName.toString(),"f"),w.__classPrivateFieldGet(this,sl,"f")}get notBefore(){if(!w.__classPrivateFieldGet(this,ol,"f")){let e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");w.__classPrivateFieldSet(this,ol,e,"f")}return w.__classPrivateFieldGet(this,ol,"f")}get notAfter(){if(!w.__classPrivateFieldGet(this,al,"f")){let e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");w.__classPrivateFieldSet(this,al,e,"f")}return w.__classPrivateFieldGet(this,al,"f")}get signatureAlgorithm(){if(!w.__classPrivateFieldGet(this,cl,"f")){let e=de.container.resolve(_r);w.__classPrivateFieldSet(this,cl,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return w.__classPrivateFieldGet(this,cl,"f")}get signature(){return w.__classPrivateFieldGet(this,ul,"f")||w.__classPrivateFieldSet(this,ul,this.asn.signatureValue,"f"),w.__classPrivateFieldGet(this,ul,"f")}get extensions(){return w.__classPrivateFieldGet(this,la,"f")||(w.__classPrivateFieldSet(this,la,[],"f"),this.asn.tbsCertificate.extensions&&w.__classPrivateFieldSet(this,la,this.asn.tbsCertificate.extensions.map(e=>Ye.create(S.AsnConvert.serialize(e))),"f")),w.__classPrivateFieldGet(this,la,"f")}get tbs(){return w.__classPrivateFieldGet(this,el,"f")||w.__classPrivateFieldSet(this,el,this.asn.tbsCertificateRaw||S.AsnConvert.serialize(this.asn.tbsCertificate),"f"),w.__classPrivateFieldGet(this,el,"f")}constructor(e){let t=wt.isAsnEncoded(e)?[e,q.Certificate]:[e];super(t[0],t[1]),el.set(this,void 0),tl.set(this,void 0),rl.set(this,void 0),nl.set(this,void 0),il.set(this,void 0),sl.set(this,void 0),ol.set(this,void 0),al.set(this,void 0),cl.set(this,void 0),ul.set(this,void 0),la.set(this,void 0),ll.set(this,void 0),this.tag=Xe.CertificateTag}onInit(e){}getExtension(e){for(let t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e={},t=be.get()){let n,i,s=e.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(n,["verify"],t);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},i=await s.publicKey.export(n,["verify"],t);else if(s instanceof yr)n={...s.algorithm,...this.signatureAlgorithm},i=await s.export(n,["verify"],t);else if(P.BufferSourceConverter.isBufferSource(s)){let u=new yr(s);n={...u.algorithm,...this.signatureAlgorithm},i=await u.export(n,["verify"],t)}else n={...s.algorithm,...this.signatureAlgorithm},i=s}catch{return!1}let o=de.container.resolveAll(gn).reverse(),a=null;for(let u of o)if(a=u.toWebSignature(n,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let c=await t.subtle.verify(this.signatureAlgorithm,i,a,this.tbs);if(e.signatureOnly)return c;{let d=(e.date||new Date).getTime();return c&&this.notBefore.getTime()<d&&d<this.notAfter.getTime()}}async getThumbprint(...e){let t,n="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(n=e[0]||n,t=e[1])),t??(t=be.get()),await t.subtle.digest(n,this.rawData)}async isSelfSigned(e=be.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),t=S.AsnConvert.parse(this.rawData,q.Certificate),n=t.tbsCertificate,i=new z("",{Version:`${q.Version[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":gr.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new z("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(i["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(i["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){let s=new z("");for(let o of this.extensions){let a=o.toTextObject();s[a[z.NAME]]=a}i.Extensions=s}return e.Data=i,e.Signature=new z("",{Algorithm:gr.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}};el=new WeakMap,tl=new WeakMap,rl=new WeakMap,nl=new WeakMap,il=new WeakMap,sl=new WeakMap,ol=new WeakMap,al=new WeakMap,cl=new WeakMap,ul=new WeakMap,la=new WeakMap,ll=new WeakMap;Jn.NAME="Certificate";var kh=class extends Array{constructor(e){if(super(),wt.isAsnEncoded(e))this.import(e);else if(e instanceof Jn)this.push(e);else if(Array.isArray(e))for(let t of e)this.push(t)}export(e){let t=new mt.SignedData;t.version=1,t.encapContentInfo.eContentType=mt.id_data,t.encapContentInfo.eContent=new mt.EncapsulatedContent({single:new S.OctetString}),t.certificates=new mt.CertificateSet(this.map(s=>new mt.CertificateChoices({certificate:S.AsnConvert.parse(s.rawData,q.Certificate)})));let n=new mt.ContentInfo({contentType:mt.id_signedData,content:S.AsnConvert.serialize(t)}),i=S.AsnConvert.serialize(n);return e==="raw"?i:this.toString(e)}import(e){let t=wt.toArrayBuffer(e),n=S.AsnConvert.parse(t,mt.ContentInfo);if(n.contentType!==mt.id_signedData)throw new TypeError("Cannot parse CMS package. Incoming data is not a SignedData object.");let i=S.AsnConvert.parse(n.content,mt.SignedData);this.clear();for(let s of i.certificates||[])s.certificate&&this.push(new Jn(s.certificate))}clear(){for(;this.pop(););}toString(e="pem"){let t=this.export("raw");switch(e){case"pem":return Xe.encode(t,"CMS");case"pem-chain":return this.map(n=>n.toString("pem")).join(`
|
|
25
|
+
`);case"asn":return S.AsnConvert.toString(t);case"hex":return P.Convert.ToHex(t);case"base64":return P.Convert.ToBase64(t);case"base64url":return P.Convert.ToBase64Url(t);case"text":return gr.serialize(this.toTextObject());default:throw TypeError("Argument 'format' is unsupported value")}}toTextObject(){let e=S.AsnConvert.parse(this.export("raw"),mt.ContentInfo),t=S.AsnConvert.parse(e.content,mt.SignedData);return new z("X509Certificates",{"Content Type":Yt.toString(e.contentType),Content:new z("",{Version:`${mt.CMSVersion[t.version]} (${t.version})`,Certificates:new z("",{Certificate:this.map(i=>i.toTextObject())})})})}},cA=class{constructor(e={}){this.certificates=[],e.certificates&&(this.certificates=e.certificates)}async build(e,t=be.get()){let n=new kh(e),i=e;for(;i=await this.findIssuer(i,t);){let s=await i.getThumbprint(t);for(let o of n){let a=await o.getThumbprint(t);if(P.isEqual(s,a))throw new Error("Cannot build a certificate chain. Circular dependency.")}n.push(i)}return n}async findIssuer(e,t=be.get()){if(!await e.isSelfSigned(t)){let n=e.getExtension(b.id_ce_authorityKeyIdentifier);for(let i of this.certificates)if(i.subject===e.issuer){if(n){if(n.keyId){let s=i.getExtension(b.id_ce_subjectKeyIdentifier);if(s&&s.keyId!==n.keyId)continue}else if(n.certId){let s=i.getExtension(b.id_ce_subjectAltName);if(s&&!(n.certId.serialNumber===i.serialNumber&&P.isEqual(S.AsnConvert.serialize(n.certId.name),S.AsnConvert.serialize(s))))continue}}try{let s={...i.publicKey.algorithm,...e.signatureAlgorithm},o=await i.publicKey.export(s,["verify"],t);if(!await e.verify({publicKey:o,signatureOnly:!0},t))continue}catch{continue}return i}}return null}};function dA(r,e=be.get()){let t=P.BufferSourceConverter.toUint8Array(P.Convert.FromHex(r||"")),n=t&&t.length&&t.some(s=>s>0)?new Uint8Array(t):void 0;n||(n=e.getRandomValues(new Uint8Array(16)));let i=0;for(;i<n.length-1&&n[i]===0;)i++;if(n=n.slice(i),n[0]>127){let s=new Uint8Array(n.length+1);s[0]=0,s.set(n,1),n=s}return n.buffer}var uA=class{static async createSelfSigned(e,t=be.get()){if(!e.keys.privateKey)throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty");if(!e.keys.publicKey)throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty");return this.create({serialNumber:e.serialNumber,subject:e.name,issuer:e.name,notBefore:e.notBefore,notAfter:e.notAfter,publicKey:e.keys.publicKey,signingKey:e.keys.privateKey,signingAlgorithm:e.signingAlgorithm,extensions:e.extensions},t)}static async create(e,t=be.get()){var n;let i;e.publicKey instanceof yr?i=e.publicKey.rawData:"publicKey"in e.publicKey?i=e.publicKey.publicKey.rawData:P.BufferSourceConverter.isBufferSource(e.publicKey)?i=e.publicKey:i=await t.subtle.exportKey("spki",e.publicKey);let s=dA(e.serialNumber,t),o=e.notBefore||new Date,a=e.notAfter||new Date(o.getTime()+31536e6),c=new b.Certificate({tbsCertificate:new b.TBSCertificate({version:b.Version.v3,serialNumber:s,validity:new b.Validity({notBefore:o,notAfter:a}),extensions:new b.Extensions(((n=e.extensions)===null||n===void 0?void 0:n.map(L=>S.AsnConvert.parse(L.rawData,b.Extension)))||[]),subjectPublicKeyInfo:S.AsnConvert.parse(i,b.SubjectPublicKeyInfo)})});if(e.subject){let L=e.subject instanceof Ke?e.subject:new Ke(e.subject);c.tbsCertificate.subject=S.AsnConvert.parse(L.toArrayBuffer(),b.Name)}if(e.issuer){let L=e.issuer instanceof Ke?e.issuer:new Ke(e.issuer);c.tbsCertificate.issuer=S.AsnConvert.parse(L.toArrayBuffer(),b.Name)}let u={hash:"SHA-256"},d="signingKey"in e?{...u,...e.signingAlgorithm,...e.signingKey.algorithm}:{...u,...e.signingAlgorithm},p=de.container.resolve(_r);c.tbsCertificate.signature=c.signatureAlgorithm=p.toAsnAlgorithm(d);let _=S.AsnConvert.serialize(c.tbsCertificate),E="signingKey"in e?await t.subtle.sign(d,e.signingKey,_):e.signature,U=de.container.resolveAll(gn).reverse(),$=null;for(let L of U)if($=L.toAsnSignature(d,E),$)break;if(!$)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return c.signatureValue=$,new Jn(S.AsnConvert.serialize(c))}},fl,dl,fa,da,pa;x.X509CrlReason=void 0;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(x.X509CrlReason||(x.X509CrlReason={}));var ma=class extends Kr{get serialNumber(){return w.__classPrivateFieldGet(this,fl,"f")||w.__classPrivateFieldSet(this,fl,P.Convert.ToHex(this.asn.userCertificate),"f"),w.__classPrivateFieldGet(this,fl,"f")}get revocationDate(){return w.__classPrivateFieldGet(this,dl,"f")||w.__classPrivateFieldSet(this,dl,this.asn.revocationDate.getTime(),"f"),w.__classPrivateFieldGet(this,dl,"f")}get reason(){return w.__classPrivateFieldGet(this,fa,"f")===void 0&&this.extensions,w.__classPrivateFieldGet(this,fa,"f")}get invalidity(){return w.__classPrivateFieldGet(this,da,"f")===void 0&&this.extensions,w.__classPrivateFieldGet(this,da,"f")}get extensions(){return w.__classPrivateFieldGet(this,pa,"f")||(w.__classPrivateFieldSet(this,pa,[],"f"),this.asn.crlEntryExtensions&&w.__classPrivateFieldSet(this,pa,this.asn.crlEntryExtensions.map(e=>{let t=Ye.create(S.AsnConvert.serialize(e));switch(t.type){case q.id_ce_cRLReasons:w.__classPrivateFieldGet(this,fa,"f")===void 0&&w.__classPrivateFieldSet(this,fa,S.AsnConvert.parse(t.value,q.CRLReason).reason,"f");break;case q.id_ce_invalidityDate:w.__classPrivateFieldGet(this,da,"f")===void 0&&w.__classPrivateFieldSet(this,da,S.AsnConvert.parse(t.value,q.InvalidityDate).value,"f");break}return t}),"f")),w.__classPrivateFieldGet(this,pa,"f")}constructor(...e){let t;if(P.BufferSourceConverter.isBufferSource(e[0])?t=P.BufferSourceConverter.toArrayBuffer(e[0]):typeof e[0]=="string"?t=S.AsnConvert.serialize(new q.RevokedCertificate({userCertificate:dA(e[0]),revocationDate:new q.Time(e[1]),crlEntryExtensions:e[2]})):e[0]instanceof q.RevokedCertificate&&(t=e[0]),!t)throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments.");super(t,q.RevokedCertificate),fl.set(this,void 0),dl.set(this,void 0),fa.set(this,void 0),da.set(this,void 0),pa.set(this,void 0)}onInit(e){}};fl=new WeakMap,dl=new WeakMap,fa=new WeakMap,da=new WeakMap,pa=new WeakMap;var pl,hl,yl,_l,gl,vl,ha,Bh=class extends wt{get version(){return this.asn.tbsCertList.version}get signatureAlgorithm(){if(!w.__classPrivateFieldGet(this,hl,"f")){let e=de.container.resolve(_r);w.__classPrivateFieldSet(this,hl,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return w.__classPrivateFieldGet(this,hl,"f")}get signature(){return this.asn.signature}get issuer(){return this.issuerName.toString()}get issuerName(){return w.__classPrivateFieldGet(this,yl,"f")||w.__classPrivateFieldSet(this,yl,new Ke(this.asn.tbsCertList.issuer),"f"),w.__classPrivateFieldGet(this,yl,"f")}get thisUpdate(){if(!w.__classPrivateFieldGet(this,_l,"f")){let e=this.asn.tbsCertList.thisUpdate.getTime();if(!e)throw new Error("Cannot get 'thisUpdate' value");w.__classPrivateFieldSet(this,_l,e,"f")}return w.__classPrivateFieldGet(this,_l,"f")}get nextUpdate(){var e;return w.__classPrivateFieldGet(this,gl,"f")===void 0&&w.__classPrivateFieldSet(this,gl,((e=this.asn.tbsCertList.nextUpdate)===null||e===void 0?void 0:e.getTime())||void 0,"f"),w.__classPrivateFieldGet(this,gl,"f")}get entries(){var e;return w.__classPrivateFieldGet(this,vl,"f")||w.__classPrivateFieldSet(this,vl,((e=this.asn.tbsCertList.revokedCertificates)===null||e===void 0?void 0:e.map(t=>new ma(t)))||[],"f"),w.__classPrivateFieldGet(this,vl,"f")}get extensions(){return w.__classPrivateFieldGet(this,ha,"f")||(w.__classPrivateFieldSet(this,ha,[],"f"),this.asn.tbsCertList.crlExtensions&&w.__classPrivateFieldSet(this,ha,this.asn.tbsCertList.crlExtensions.map(e=>Ye.create(S.AsnConvert.serialize(e))),"f")),w.__classPrivateFieldGet(this,ha,"f")}get tbs(){return w.__classPrivateFieldGet(this,pl,"f")||w.__classPrivateFieldSet(this,pl,this.asn.tbsCertListRaw||S.AsnConvert.serialize(this.asn.tbsCertList),"f"),w.__classPrivateFieldGet(this,pl,"f")}get tbsCertListSignatureAlgorithm(){return this.asn.tbsCertList.signature}get certListSignatureAlgorithm(){return this.asn.signatureAlgorithm}constructor(e){super(e,wt.isAsnEncoded(e)?q.CertificateList:void 0),this.tag=Xe.CrlTag,pl.set(this,void 0),hl.set(this,void 0),yl.set(this,void 0),_l.set(this,void 0),gl.set(this,void 0),vl.set(this,void 0),ha.set(this,void 0)}onInit(e){}getExtension(e){for(let t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e,t=be.get()){if(!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm))throw new Error("algorithm identifier in the sequence tbsCertList and CertificateList mismatch");let n,i,s=e.publicKey;try{s instanceof Jn?(n={...s.publicKey.algorithm,...s.signatureAlgorithm},i=await s.publicKey.export(n,["verify"])):s instanceof yr?(n={...s.algorithm,...this.signatureAlgorithm},i=await s.export(n,["verify"])):(n={...s.algorithm,...this.signatureAlgorithm},i=s)}catch{return!1}let o=de.container.resolveAll(gn).reverse(),a=null;for(let c of o)if(a=c.toWebSignature(n,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return await t.subtle.verify(this.signatureAlgorithm,i,a,this.tbs)}async getThumbprint(...e){let t,n="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(n=e[0]||n,t=e[1])),t??(t=be.get()),await t.subtle.digest(n,this.rawData)}findRevoked(e){let t=typeof e=="string"?e:e.serialNumber,n=dA(t);for(let i of this.asn.tbsCertList.revokedCertificates||[])if(P.BufferSourceConverter.isEqual(i.userCertificate,n))return new ma(S.AsnConvert.serialize(i));return null}};pl=new WeakMap,hl=new WeakMap,yl=new WeakMap,_l=new WeakMap,gl=new WeakMap,vl=new WeakMap,ha=new WeakMap;var lA=class{static async create(e,t=be.get()){var n;let i=e.issuer instanceof Ke?e.issuer:new Ke(e.issuer),s=new b.CertificateList({tbsCertList:new b.TBSCertList({version:b.Version.v2,issuer:S.AsnConvert.parse(i.toArrayBuffer(),b.Name),thisUpdate:new q.Time(e.thisUpdate||new Date)})});if(e.nextUpdate&&(s.tbsCertList.nextUpdate=new q.Time(e.nextUpdate)),e.extensions&&e.extensions.length&&(s.tbsCertList.crlExtensions=new b.Extensions(e.extensions.map(_=>S.AsnConvert.parse(_.rawData,b.Extension))||[])),e.entries&&e.entries.length){s.tbsCertList.revokedCertificates=[];for(let _ of e.entries){let E=wt.toArrayBuffer(_.serialNumber);if(s.tbsCertList.revokedCertificates.findIndex(L=>P.isEqual(L.userCertificate,E))>-1)throw new Error(`Certificate serial number ${_.serialNumber} already exists in tbsCertList`);let $=new q.RevokedCertificate({userCertificate:E,revocationDate:new q.Time(_.revocationDate||new Date)});if("extensions"in _&&(!((n=_.extensions)===null||n===void 0)&&n.length)?$.crlEntryExtensions=_.extensions.map(L=>S.AsnConvert.parse(L.rawData,b.Extension)):$.crlEntryExtensions=[],!(_ instanceof ma)&&(_.reason&&$.crlEntryExtensions.push(new b.Extension({extnID:b.id_ce_cRLReasons,critical:!1,extnValue:new S.OctetString(S.AsnConvert.serialize(new b.CRLReason(_.reason)))})),_.invalidity&&$.crlEntryExtensions.push(new b.Extension({extnID:b.id_ce_invalidityDate,critical:!1,extnValue:new S.OctetString(S.AsnConvert.serialize(new b.InvalidityDate(_.invalidity)))})),_.issuer)){let L=e.issuer instanceof Ke?e.issuer:new Ke(e.issuer);$.crlEntryExtensions.push(new b.Extension({extnID:b.id_ce_certificateIssuer,critical:!1,extnValue:new S.OctetString(S.AsnConvert.serialize(S.AsnConvert.parse(L.toArrayBuffer(),b.Name)))}))}s.tbsCertList.revokedCertificates.push($)}}let o={...e.signingAlgorithm,...e.signingKey.algorithm},a=de.container.resolve(_r);s.tbsCertList.signature=s.signatureAlgorithm=a.toAsnAlgorithm(o);let c=S.AsnConvert.serialize(s.tbsCertList),u=await t.subtle.sign(o,e.signingKey,c),d=de.container.resolveAll(gn).reverse(),p=null;for(let _ of d)if(p=_.toAsnSignature(o,u),p)break;if(!p)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return s.signature=p,new Bh(S.AsnConvert.serialize(s))}};Ye.register(b.id_ce_basicConstraints,wl);Ye.register(b.id_ce_extKeyUsage,Cl);Ye.register(b.id_ce_keyUsage,Pl);Ye.register(b.id_ce_subjectKeyIdentifier,xl);Ye.register(b.id_ce_authorityKeyIdentifier,Sl);Ye.register(b.id_ce_subjectAltName,Tl);Ye.register(b.id_ce_cRLDistributionPoints,Il);Ye.register(b.id_pe_authorityInfoAccess,kl);Ye.register(b.id_ce_issuerAltName,Bl);bs.register(ya.id_pkcs9_at_challengePassword,Ol);bs.register(ya.id_pkcs9_at_extensionRequest,va);de.container.registerSingleton(gn,Ih);de.container.registerSingleton(gn,Wr);Wr.namedCurveSize.set("P-256",32);Wr.namedCurveSize.set("K-256",32);Wr.namedCurveSize.set("P-384",48);Wr.namedCurveSize.set("P-521",66);x.AlgorithmProvider=Th;x.AsnData=Kr;x.AsnDefaultSignatureFormatter=Ih;x.AsnEcSignatureFormatter=Wr;x.Attribute=As;x.AttributeFactory=bs;x.AuthorityInfoAccessExtension=kl;x.AuthorityKeyIdentifierExtension=Sl;x.BasicConstraintsExtension=wl;x.CRLDistributionPointsExtension=Il;x.CertificatePolicyExtension=El;x.ChallengePasswordAttribute=Ol;x.CryptoProvider=_a;x.DN=_h;x.DNS=yh;x.DefaultAlgorithmSerializer=Eh;x.EMAIL=gh;x.ExtendedKeyUsageExtension=Cl;x.Extension=bt;x.ExtensionFactory=Ye;x.ExtensionsAttribute=va;x.GUID=Ah;x.GeneralName=hr;x.GeneralNames=Gr;x.IP=vh;x.IssuerAlternativeNameExtension=Bl;x.KeyUsagesExtension=Pl;x.Name=Ke;x.NameIdentifier=Al;x.OidSerializer=Yt;x.PemConverter=Xe;x.PemData=wt;x.Pkcs10CertificateRequest=jl;x.Pkcs10CertificateRequestGenerator=aA;x.PublicKey=yr;x.REGISTERED_ID=Gu;x.SubjectAlternativeNameExtension=Tl;x.SubjectKeyIdentifierExtension=xl;x.TextConverter=gr;x.TextObject=z;x.UPN=bh;x.URL=mh;x.X509Certificate=Jn;x.X509CertificateGenerator=uA;x.X509Certificates=kh;x.X509ChainBuilder=cA;x.X509Crl=Bh;x.X509CrlEntry=ma;x.X509CrlGenerator=lA;x.cryptoProvider=be;x.diAlgorithm=Aa;x.diAlgorithmProvider=_r;x.diAsnSignatureFormatter=gn;x.idEd25519=Ch;x.idEd448=oA;x.idX25519=wh;x.idX448=sA});var HP=l(VP=>{var{X509CertificateGenerator:pA,X509Certificate:hA,cryptoProvider:sN,X509ChainBuilder:oN,BasicConstraintsExtension:NP,KeyUsagesExtension:qP,KeyUsageFlags:vr,ExtendedKeyUsageExtension:RP,ExtendedKeyUsage:Ss,SubjectAlternativeNameExtension:MP,GeneralName:R8}=jP(),_A=require("crypto"),Zt=_A.webcrypto;sN.set(Zt);function DP(r){var e=parseInt(r[0],16);return e<8?r:(e-=8,e.toString()+r.substring(1))}function Oh(r){switch(r){case"sha256":return"SHA-256";case"sha384":return"SHA-384";case"sha512":return"SHA-512";default:return"SHA-1"}}function UP(r,e){let t=Oh(r);return e==="ec"?{name:"ECDSA",hash:t}:{name:"RSASSA-PKCS1-v1_5",hash:t}}function $P(r){let e=r.keyType||"rsa",t=Oh(r.algorithm||"sha1");return e==="ec"?{name:"ECDSA",namedCurve:r.curve||"P-256"}:{name:"RSASSA-PKCS1-v1_5",modulusLength:r.keySize||2048,publicExponent:new Uint8Array([1,0,1]),hash:t}}function aN(r,e){if(!r||r.length===0)return[new NP(!1,void 0,!0),new qP(vr.digitalSignature|vr.keyEncipherment,!0),new RP([Ss.serverAuth,Ss.clientAuth],!1),new MP([{type:"dns",value:e},...e==="localhost"?[{type:"ip",value:"127.0.0.1"}]:[]],!1)];let t=[];for(let n of r){let i=n.critical||!1;switch(n.name){case"basicConstraints":t.push(new NP(n.cA||!1,n.pathLenConstraint,i));break;case"keyUsage":let s=0;n.digitalSignature&&(s|=vr.digitalSignature),(n.nonRepudiation||n.contentCommitment)&&(s|=vr.nonRepudiation),n.keyEncipherment&&(s|=vr.keyEncipherment),n.dataEncipherment&&(s|=vr.dataEncipherment),n.keyAgreement&&(s|=vr.keyAgreement),n.keyCertSign&&(s|=vr.keyCertSign),n.cRLSign&&(s|=vr.cRLSign),n.encipherOnly&&(s|=vr.encipherOnly),n.decipherOnly&&(s|=vr.decipherOnly),t.push(new qP(s,i));break;case"extKeyUsage":let o=[];n.serverAuth&&o.push(Ss.serverAuth),n.clientAuth&&o.push(Ss.clientAuth),n.codeSigning&&o.push(Ss.codeSigning),n.emailProtection&&o.push(Ss.emailProtection),n.timeStamping&&o.push(Ss.timeStamping),t.push(new RP(o,i));break;case"subjectAltName":let a=(n.altNames||[]).map(c=>{switch(c.type){case 1:return{type:"email",value:c.value};case 2:return{type:"dns",value:c.value};case 6:return{type:"url",value:c.value};case 7:return{type:"ip",value:c.ip||c.value};default:return c.ip?{type:"ip",value:c.ip}:c.dns?{type:"dns",value:c.dns}:c.email?{type:"email",value:c.email}:c.uri||c.url?{type:"url",value:c.uri||c.url}:{type:"dns",value:c.value}}});t.push(new MP(a,i));break;default:console.warn(`Unknown extension "${n.name}" ignored`)}}return t}function yA(r){let e={commonName:"CN",countryName:"C",ST:"ST",localityName:"L",organizationName:"O",OU:"OU"};return r.map(t=>{let n=t.name||t.shortName;return`${e[n]||n}=${t.value}`}).join(", ")}function cN(r){return{prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521","P-256":"P-256","P-384":"P-384","P-521":"P-521"}[r]||r}function uN(r){let e=r.asymmetricKeyDetails;return e&&e.namedCurve?cN(e.namedCurve):"P-256"}async function LP(r,e,t){let n=_A.createPrivateKey(r),i=n.asymmetricKeyType,s=t||i,a=n.export({type:"pkcs8",format:"pem"}).replace(/-----BEGIN PRIVATE KEY-----/,"").replace(/-----END PRIVATE KEY-----/,"").replace(/\s/g,""),c=Buffer.from(a,"base64"),u;return s==="ec"?u={name:"ECDSA",namedCurve:uN(n)}:u={name:"RSASSA-PKCS1-v1_5",hash:Oh(e)},await Zt.subtle.importKey("pkcs8",c,u,!0,["sign"])}async function lN(r,e,t,n){let i=r.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),s=Buffer.from(i,"base64"),o;return t==="ec"?o={name:"ECDSA",namedCurve:n||"P-256"}:o={name:"RSASSA-PKCS1-v1_5",hash:Oh(e)},await Zt.subtle.importKey("spki",s,o,!0,["verify"])}async function fN(r,e,t,n){let{privateKey:i,publicKey:s}=r,o=Zt.getRandomValues(new Uint8Array(9)),a=DP(Buffer.from(o).toString("hex")),c=t.notBeforeDate||new Date,u;t.notAfterDate?u=t.notAfterDate:(u=new Date(c),u.setDate(u.getDate()+365)),e=e||[{name:"commonName",value:"example.org"},{name:"countryName",value:"US"},{shortName:"ST",value:"Virginia"},{name:"localityName",value:"Blacksburg"},{name:"organizationName",value:"Test"},{shortName:"OU",value:"Test"}];let d=yA(e),p=t.keyType||"rsa",_=UP(t.algorithm,p),E=e.find(Ue=>Ue.name==="commonName"||Ue.shortName==="CN"),U=E?E.value:"localhost",$=aN(t.extensions,U),L;if(n){let Ue=new hA(n.cert),Zn=await LP(n.key,t.algorithm||"sha256",p);L=await pA.create({serialNumber:a,subject:d,issuer:Ue.subject,notBefore:c,notAfter:u,signingAlgorithm:_,publicKey:s,signingKey:Zn,extensions:$})}else L=await pA.createSelfSigned({serialNumber:a,name:d,notBefore:c,notAfter:u,signingAlgorithm:_,keys:{privateKey:i,publicKey:s},extensions:$});let Be=L.rawData,Ar=await Zt.subtle.digest("SHA-1",Be),Sa=Buffer.from(Ar).toString("hex").match(/.{2}/g).join(":"),Ml=await Zt.subtle.exportKey("pkcs8",i),Kh=await Zt.subtle.exportKey("spki",s),wa;t.passphrase?wa=_A.createPrivateKey({key:Buffer.from(Ml),format:"der",type:"pkcs8"}).export({type:"pkcs8",format:"pem",cipher:"aes-256-cbc",passphrase:t.passphrase}):wa=`-----BEGIN PRIVATE KEY-----
|
|
26
|
+
`+Buffer.from(Ml).toString("base64").match(/.{1,64}/g).join(`
|
|
27
|
+
`)+`
|
|
28
|
+
-----END PRIVATE KEY-----
|
|
29
|
+
`;let Gh=`-----BEGIN PUBLIC KEY-----
|
|
30
|
+
`+Buffer.from(Kh).toString("base64").match(/.{1,64}/g).join(`
|
|
31
|
+
`)+`
|
|
32
|
+
-----END PUBLIC KEY-----
|
|
33
|
+
`,Wh=L.toString("pem"),Ps={private:wa,public:Gh,cert:Wh,fingerprint:Sa};if(t&&t.clientCertificate){let Ue=typeof t.clientCertificate=="object"?t.clientCertificate:{},Zn=Ue.keySize||t.clientCertificateKeySize||2048,Ca=Ue.algorithm||t.algorithm||"sha1",$l=Ue.cn||t.clientCertificateCN||"John Doe jdoe123",Ll=Ue.keyType||p,Vl=Ue.curve||t.curve||"P-256",Hl=$P({keyType:Ll,keySize:Zn,algorithm:Ca,curve:Vl}),xs=await Zt.subtle.generateKey(Hl,!0,["sign","verify"]),H=Zt.getRandomValues(new Uint8Array(9)),An=DP(Buffer.from(H).toString("hex")),Pa=Ue.notBeforeDate||new Date,pe;Ue.notAfterDate?pe=Ue.notAfterDate:(pe=new Date(Pa),pe.setFullYear(Pa.getFullYear()+1));let Ts=JSON.parse(JSON.stringify(e));for(let Qn=0;Qn<Ts.length;Qn++)Ts[Qn].name==="commonName"&&(Ts[Qn]={name:"commonName",value:$l});let zh=yA(Ts),Fl=yA(e),Jh=UP(Ca,p),Mt=await pA.create({serialNumber:An,subject:zh,issuer:Fl,notBefore:Pa,notAfter:pe,signingAlgorithm:Jh,publicKey:xs.publicKey,signingKey:i}),Kl=await Zt.subtle.exportKey("pkcs8",xs.privateKey),bn=await Zt.subtle.exportKey("spki",xs.publicKey);Ps.clientprivate=`-----BEGIN PRIVATE KEY-----
|
|
34
|
+
`+Buffer.from(Kl).toString("base64").match(/.{1,64}/g).join(`
|
|
35
|
+
`)+`
|
|
36
|
+
-----END PRIVATE KEY-----
|
|
37
|
+
`,Ps.clientpublic=`-----BEGIN PUBLIC KEY-----
|
|
38
|
+
`+Buffer.from(bn).toString("base64").match(/.{1,64}/g).join(`
|
|
39
|
+
`)+`
|
|
40
|
+
-----END PUBLIC KEY-----
|
|
41
|
+
`,Ps.clientcert=Mt.toString("pem")}let Dl=new hA(L.rawData),Ul=[Dl];if(n){let Ue=new hA(n.cert);Ul.push(Ue)}if((await new oN({certificates:Ul}).build(Dl)).length===0)throw new Error("Certificate could not be verified.");return Ps}VP.generate=async function(e,t){e=e||void 0,t=t||{};let n=t.keyType||"rsa",i=t.curve||"P-256",s;if(t.keyPair)s={privateKey:await LP(t.keyPair.privateKey,t.algorithm||"sha1",n),publicKey:await lN(t.keyPair.publicKey,t.algorithm||"sha1",n,i)};else{let o=$P(t);s=await Zt.subtle.generateKey(o,!0,["sign","verify"])}return await fN(s,e,t,t.ca)}});var zP=l((D8,WP)=>{var FP=require("path"),Nt=require("fs"),{X509Certificate:dN}=require("crypto"),KP=HP(),{MITM_DIR:jh}=Es(),Xn=FP.join(jh,"rootCA.key"),vn=FP.join(jh,"rootCA.crt");function GP(r){try{let e=Nt.readFileSync(r,"utf8"),t=new dN(e),n=new Date(Date.now()+720*60*60*1e3);return new Date(t.validTo)<n}catch{return!0}}async function pN(){let r=Nt.existsSync(Xn)&&Nt.existsSync(vn);if(r&&!GP(vn))return console.log("\u2705 Root CA already exists"),{key:Xn,cert:vn};if(r){console.log("\u{1F510} Root CA expired or expiring soon \u2014 regenerating...");try{Nt.unlinkSync(Xn)}catch{}try{Nt.unlinkSync(vn)}catch{}}Nt.existsSync(jh)||Nt.mkdirSync(jh,{recursive:!0}),console.log("\u{1F510} Generating Root CA certificate...");let e=new Date,t=new Date;t.setFullYear(e.getFullYear()+10);let n=[{name:"commonName",value:"9Router MITM Root CA"},{name:"organizationName",value:"9Router"},{name:"countryName",value:"US"}],i=await KP.generate(n,{keySize:2048,algorithm:"sha256",notBeforeDate:e,notAfterDate:t,extensions:[{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",keyCertSign:!0,cRLSign:!0,critical:!0}]});return Nt.writeFileSync(Xn,i.private),Nt.writeFileSync(vn,i.cert),console.log("\u2705 Root CA generated successfully"),{key:Xn,cert:vn}}function hN(){if(!Nt.existsSync(Xn)||!Nt.existsSync(vn))throw new Error("Root CA not found. Generate it first.");let r=Nt.readFileSync(Xn,"utf8"),e=Nt.readFileSync(vn,"utf8");return{key:r,cert:e}}async function yN(r,e){let t=new Date,n=new Date;n.setFullYear(t.getFullYear()+1);let i=await KP.generate([{name:"commonName",value:r}],{keySize:2048,algorithm:"sha256",notBeforeDate:t,notAfterDate:n,ca:{key:e.key,cert:e.cert},extensions:[{name:"basicConstraints",cA:!1},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0},{name:"subjectAltName",altNames:[{type:2,value:r},{type:2,value:`*.${r}`}]}]});return{key:i.private,cert:i.cert}}WP.exports={generateRootCA:pN,loadRootCA:hN,generateLeafCert:yN,isCertExpired:GP,ROOT_CA_CERT_PATH:vn,ROOT_CA_KEY_PATH:Xn}});var XP=l((V8,JP)=>{var U8=require("path"),$8=require("fs"),{MITM_DIR:L8}=Es(),{generateRootCA:_N,loadRootCA:gN,generateLeafCert:vN}=zP();async function mN(){return await _N()}async function AN(r){try{let e=gN(),t=await vN(r,e);return{key:t.key,cert:t.cert}}catch(e){return console.error(`Failed to generate cert for ${r}:`,e.message),null}}JP.exports={generateCert:mN,getCertForDomain:AN}});var ex=l((H8,QP)=>{var YP=require("fs"),bN=require("path"),{DATA_DIR:SN}=Es(),ZP=bN.join(SN,"mitm","aliases.json");function wN(){try{return YP.existsSync(ZP)?JSON.parse(YP.readFileSync(ZP,"utf-8")):null}catch{return null}}function CN(r){return wN()?.[r]||null}QP.exports={getMitmAlias:CN}});var nx=l((F8,rx)=>{"use strict";var ws="2.11.0";function PN(r){return!r||typeof r!="object"||Array.isArray(r)?!1:String(r.ideName||"").toLowerCase()==="antigravity"||String(r.ideType||"").toUpperCase()==="ANTIGRAVITY"?!0:Object.prototype.hasOwnProperty.call(r,"ideVersion")}function tx(r,e){return typeof r!="string"||!r.includes("antigravity/")?r:r.replace(/antigravity\/[^\s]+/,`antigravity/${e}`)}function xN(r,e,t){if(!(t?.includes(":generateContent")||t?.includes(":streamGenerateContent")))return{bodyBuffer:r,headers:e,applied:!1,version:ws};let i={...e},s=tx(i["user-agent"],ws),o=s!==i["user-agent"];o&&(i["user-agent"]=s);try{let a=JSON.parse(r.toString());return PN(a?.metadata)?(a.metadata.ideVersion=ws,{bodyBuffer:Buffer.from(JSON.stringify(a)),headers:i,applied:!0,version:ws}):{bodyBuffer:r,headers:i,applied:o,version:ws}}catch{return{bodyBuffer:r,headers:i,applied:o,version:ws}}}rx.exports={ANTIGRAVITY_IDE_VERSION:ws,applyAntigravityIdeVersionOverride:xN,rewriteAntigravityUserAgent:tx}});var qh=l((G8,ox)=>{var{log:Nh,err:K8}=ri(),ix="http://localhost:20128",TN=String(process.env.MITM_ROUTER_BASE||ix).trim().replace(/\/+$/,"")||ix,sx=process.env.ROUTER_API_KEY,EN=new Set(["host","content-length","connection","transfer-encoding","content-type","authorization"]);async function IN(r,e="/v1/chat/completions",t={}){let n={};for(let[s,o]of Object.entries(t))EN.has(s.toLowerCase())||(n[s]=o);return await fetch(`${TN}${e}`,{method:"POST",headers:{...n,"Content-Type":"application/json",...sx&&{Authorization:`Bearer ${sx}`}},body:JSON.stringify(r)})}async function kN(r,e,t){let n=r.headers.get("content-type")||"application/json",i=r.status||200,s={"Content-Type":n,"Cache-Control":"no-cache",Connection:"keep-alive"};if(n.includes("text/event-stream")&&(s["X-Accel-Buffering"]="no"),e.writeHead(i,s),t&&t.writeHeader(r.status,Object.fromEntries(r.headers)),!r.body){let c=await r.text().catch(()=>"");t&&(t.writeChunk(c),t.end()),e.end(c);return}let o=r.body.getReader(),a=new TextDecoder;for(;;){let{done:c,value:u}=await o.read();if(c){t&&t.end(),e.end();break}t&&t.writeChunk(u),e.write(a.decode(u,{stream:!0}))}}async function BN(r,e,t,n){let i=r.headers.get("content-type")||"application/json",s={"Content-Type":i,"Cache-Control":"no-cache",Connection:"keep-alive"};if(i.includes("text/event-stream")&&(s["X-Accel-Buffering"]="no"),e.writeHead(200,s),!r.body){e.end(await r.text().catch(()=>""));return}let o=r.body.getReader(),a=new TextDecoder("utf-8",{fatal:!1}),c="";for(;;){let{done:u,value:d}=await o.read();if(u)break;c+=a.decode(d,{stream:!0});let p=c.split(`
|
|
42
|
+
`);c=p.pop()||"";for(let _ of p){let E=_.trim();if(!E||!E.startsWith("data:"))continue;let U=E.slice(5).trim();if(U!=="[DONE]"){process.env.DEBUG_MITM&&Nh(`[SSE in] ${U.slice(0,200)}`);try{let $=JSON.parse(U),L=t($,n);if(L!=null){let Be=Array.isArray(L)?L:[L];for(let Ar of Be){if(process.env.DEBUG_MITM){let Sa=Ar.length||Ar.byteLength||0;Nh(`[write binary frame] (${Sa}B) first 20B: ${Array.from(Ar.slice(0,20)).join(",")}`)}e.write(Buffer.from(Ar))}}}catch{}}}}try{let u=t(null,n);if(u!=null){let d=Array.isArray(u)?u:[u];for(let p of d)e.write(p)}}catch{}e.end()}async function ON(r,e,t,n){let i={"Content-Type":"application/vnd.amazon.eventstream","Cache-Control":"no-cache",Connection:"keep-alive"};if(e.writeHead(200,i),!r.body){e.end(await r.text().catch(()=>""));return}let s=r.body.getReader(),o=new TextDecoder("utf-8",{fatal:!1}),a="";for(;;){let{done:c,value:u}=await s.read();if(c)break;a+=o.decode(u,{stream:!0});let d=a.split(`
|
|
43
|
+
`);a=d.pop()||"";for(let p of d){let _=p.trim();if(!_||!_.startsWith("data:"))continue;let E=_.slice(5).trim();if(E!=="[DONE]"){process.env.DEBUG_MITM&&Nh(`[SSE in] ${E.slice(0,200)}`);try{let U=JSON.parse(E),$=t(U,n);if($!=null){let L=Array.isArray($)?$:[$];for(let Be of L){if(process.env.DEBUG_MITM){let Ar=Be.length||Be.byteLength||0;Nh(`[write binary frame] (${Ar}B) first 20B: ${Array.from(Be.slice(0,20)).join(",")}`)}e.write(Buffer.from(Be))}}}catch{}}}}try{let c=t(null,n);if(c!=null){let u=Array.isArray(c)?c:[c];for(let d of u)e.write(d)}}catch{}e.end()}ox.exports={fetchRouter:IN,pipeSSE:kN,pipeTransformedSSE:BN,pipeTransformedEventStream:ON}});var cx=l((W8,ax)=>{var{err:jN,createResponseDumper:NN}=ri(),{IS_DEV:qN}=Ta(),{fetchRouter:RN,pipeSSE:MN}=qh();async function DN(r,e,t,n){let i=qN?NN(r,"intercept-antigravity"):null,s=r.url.includes(":streamGenerateContent");try{let o=JSON.parse(t.toString());o.model&&(o.model=n);let a=await RN(o,"/v1/chat/completions",r.headers);await MN(a,e,i)}catch(o){jN(`[antigravity] ${o.message}`),i&&(i.writeChunk(`
|
|
44
|
+
[ERROR] ${o.message}
|
|
45
|
+
`),i.end()),s?(e.headersSent||e.writeHead(200,{"Content-Type":"text/event-stream"}),e.end(`data: ${JSON.stringify({error:{message:o.message}})}\r
|
|
30
46
|
\r
|
|
31
|
-
`)):(
|
|
32
|
-
`)}catch{}}var
|
|
33
|
-
`);
|
|
47
|
+
`)):(e.headersSent||e.writeHead(500,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{message:o.message,type:"mitm_error"}})))}}ax.exports={intercept:DN}});var lx=l((z8,ux)=>{var{err:UN}=ri(),{fetchRouter:$N,pipeSSE:LN}=qh(),VN={"/chat/completions":"/v1/chat/completions","/v1/messages":"/v1/messages","/responses":"/v1/responses"};function HN(r){for(let[e,t]of Object.entries(VN))if(r.includes(e))return t;return"/v1/chat/completions"}async function FN(r,e,t,n){try{let i=JSON.parse(t.toString());i.model=n;let s=HN(r.url),o=await $N(i,s,r.headers);await LN(o,e)}catch(i){UN(`[copilot] ${i.message}`),e.headersSent||e.writeHead(500,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{message:i.message,type:"mitm_error"}}))}}ux.exports={intercept:FN}});var gx=l((J8,_x)=>{var{err:KN}=ri(),{IS_DEV:GN}=Ta(),{fetchRouter:WN,pipeTransformedEventStream:zN}=qh(),JN=require("fs"),XN=require("path"),YN=XN.join(__dirname,"../../../data/logs/mitm/kiro-debug.log");function fx(r){if(GN)try{JN.appendFileSync(YN,`${new Date().toISOString()} ${r}
|
|
48
|
+
`)}catch{}}var ZN=(()=>{let r=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;r[e]=t}return r})();function dx(r){let e=4294967295;for(let t=0;t<r.length;t++)e=e>>>8^ZN[(e^r[t])&255];return(e^4294967295)>>>0}function QN(r){return{modelId:r||null,toolCallInit:{},hasToolCalls:!1,finishSent:!1,usage:null,inThink:!1,thinkBuf:"",initialSent:!1}}function yx(r,e){if(!r)return{thinking:null,text:null};let t=r;e.inThink&&e.thinkBuf&&(t=e.thinkBuf+t,e.thinkBuf="",e.inThink=!1);let n=/<thinking>|<think>/i,i=t.match(n);if(!i)return{thinking:null,text:t};let s=i[0].toLowerCase(),o=s==="<think>"?"</think>":"</thinking>",a=i.index,c=t.indexOf(o,a+s.length);if(c===-1)return e.inThink=!0,e.thinkBuf=t.slice(a),{thinking:null,text:t.slice(0,a).trim()||null};let u=t.slice(a+s.length,c),d=t.slice(0,a).trim(),p=t.slice(c+o.length).trim(),_=[d,p].filter(Boolean).join(""),E=_?yx(_,{inThink:!1,thinkBuf:""}):{thinking:null,text:null};return{thinking:u||null,text:E.text||null}}function gA(r,e){let t=Buffer.from(r,"utf8"),n=Buffer.from(e,"utf8"),i=Buffer.alloc(1+t.length+1+2+n.length),s=0;return i[s++]=t.length,t.copy(i,s),s+=t.length,i[s++]=7,i.writeUInt16BE(n.length,s),s+=2,n.copy(i,s),i}function mr(r,e,t="application/json"){let n=Buffer.from(typeof e=="string"?e:JSON.stringify(e),"utf8"),i=Buffer.concat([gA(":message-type","event"),gA(":event-type",r),gA(":content-type",t)]),s=i.length,o=12+s+n.length+4,a=Buffer.alloc(o);return a.writeUInt32BE(o,0),a.writeUInt32BE(s,4),a.writeUInt32BE(dx(a.slice(0,8)),8),i.copy(a,12),n.copy(a,12+s),a.writeUInt32BE(dx(a.slice(0,o-4)),o-4),a}function eq(r=""){return mr("initial-response",{conversationId:r||""},"application/x-amz-json-1.0")}function Rh(r,e){let t=e==null?[]:Array.isArray(e)?e:[e];if(r.initialSent)return t.length===0?null:t.length===1?t[0]:t;r.initialSent=!0;let n=[eq(""),...t];return n.length===1?n[0]:n}var px=new Map([["png","image/png"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["gif","image/gif"],["webp","image/webp"]]);function tq(r){if(typeof r=="string")return r;if(r==null)return"{}";try{return JSON.stringify(r)}catch{return"{}"}}function hx(r){let e=[],t=r.userInputMessageContext?.toolResults||[];for(let o of t){let a=(o.content||[]).map(c=>c.text||"").join(`
|
|
49
|
+
`);e.push({role:"tool",tool_call_id:o.toolUseId||"",content:a})}let i=(Array.isArray(r.images)?r.images:[]).filter(o=>o!==null&&typeof o=="object"&&!Array.isArray(o)&&o.source!==null&&typeof o.source=="object"&&!Array.isArray(o.source)&&px.has(o.format)&&typeof o.source.bytes=="string"&&o.source.bytes.length>0).map(o=>({type:"image_url",image_url:{url:`data:${px.get(o.format)};base64,${o.source.bytes}`}})),s=(r.content||"").trim();if(i.length>0){let o=[];s&&o.push({type:"text",text:s}),o.push(...i),e.push({role:"user",content:o})}else(s||t.length===0)&&e.push({role:"user",content:s});return e}function rq(r){let e=r.toolUses||[];return e.length>0?{role:"assistant",content:r.content||null,tool_calls:e.map(t=>({id:t.toolUseId||`call_${Date.now()}`,type:"function",function:{name:t.name||"",arguments:tq(t.input)}}))}:{role:"assistant",content:r.content||""}}function nq(r){let e=r.conversationState||{},t=e.history||[],n=e.currentMessage,i=[];for(let s of t)s.userInputMessage?i.push(...hx(s.userInputMessage)):s.assistantResponseMessage&&i.push(rq(s.assistantResponseMessage));return n?.userInputMessage&&i.push(...hx(n.userInputMessage)),i}function iq(r){let e=r.conversationState||{},t=e.currentMessage?.userInputMessage?.userInputMessageContext?.tools||[],n=e.history?.find(s=>s.userInputMessage?.userInputMessageContext?.tools)?.userInputMessage?.userInputMessageContext?.tools||[],i=t.length>0?t:n;return i.length?i.map(s=>{let o=s.toolSpecification||s;return{type:"function",function:{name:o.name||"",description:o.description||`Tool: ${o.name||"unknown"}`,parameters:o.inputSchema?.json||{type:"object",properties:{},required:[]}}}}):[]}function sq(r,e){if(!r){if(e.finishSent)return null;if(e.inThink&&e.thinkBuf){e.inThink=!1;let o=e.thinkBuf;return e.thinkBuf="",Rh(e,mr("reasoningContentEvent",{content:o,modelId:e.modelId||"kiro-unknown"}))}return Rh(e,mr("messageStopEvent",{}))}let t=[],n=r.choices?.[0],i=n?.delta||{};!e.modelId&&r.model&&(e.modelId=r.model);let s=e.modelId||"unknown";if(r.usage&&(e.usage=r.usage),i.tool_calls){e.hasToolCalls=!0;for(let o of i.tool_calls){let a=o.index??0;if(o.id&&o.function?.name&&!e.toolCallInit[a]&&(e.toolCallInit[a]={id:o.id,name:o.function.name},fx(`toolUseEvent init: ${o.function.name} (${o.id})`),t.push(mr("toolUseEvent",{name:o.function.name,toolUseId:o.id}))),o.function?.arguments){let c=e.toolCallInit[a];fx(`toolUseEvent fragment: ${o.function.arguments.slice(0,100)}`),t.push(mr("toolUseEvent",{input:o.function.arguments,name:c?.name||o.function?.name||"",toolUseId:c?.id||o.id||""}))}}}if(i.reasoning_content&&t.push(mr("reasoningContentEvent",{content:i.reasoning_content,modelId:s})),i.content){let{thinking:o,text:a}=yx(i.content,e);o&&t.push(mr("reasoningContentEvent",{content:o,modelId:s})),a&&t.push(mr("assistantResponseEvent",{content:a,modelId:s}))}if(n?.finish_reason){let o=oq(e);o&&t.push(...Array.isArray(o)?o:[o])}return t.length===0?e.initialSent?null:Rh(e,null):Rh(e,t.length===1?t[0]:t)}function oq(r){let e=[];if(r.hasToolCalls)for(let t of Object.keys(r.toolCallInit).sort()){let n=r.toolCallInit[t];e.push(mr("toolUseEvent",{name:n.name,stop:!0,toolUseId:n.id}))}else e.push(mr("messageStopEvent",{}));return r.finishSent=!0,r.usage&&e.push(mr("usageEvent",{inputTokens:r.usage.prompt_tokens||0,outputTokens:r.usage.completion_tokens||0})),r.toolCallInit={},e.length>0?e:null}async function aq(r,e,t,n){try{if(cq(t))throw new Error(`Binary EventStream format detected (${t.length}B) - request should use passthrough instead of intercept`);let i=JSON.parse(t.toString()),s=nq(i);if(s.length===0)throw new Error("codeWhispererToMessages produced 0 messages \u2014 check request body");let o=iq(i),a={model:n,messages:s,stream:!0,...o.length>0&&{tools:o,tool_choice:"auto"}},c=await WN(a,"/v1/chat/completions",r.headers),u=QN(n);await zN(c,e,sq,u)}catch(i){KN(`[Kiro MITM] Request processing failed: ${i.message}`),e.headersSent||e.writeHead(500,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{message:i.message,type:"mitm_error",handler:"kiro"}}))}}function cq(r){if(!r||r.length<12)return!1;let e=r.readUInt32BE(0),t=r.readUInt32BE(4);return e>12&&e<1e6&&t<e-12}_x.exports={intercept:aq}});var mx=l((X8,vx)=>{async function uq(r,e){e.writeHead(501,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{message:"Cursor MITM support is coming soon.",type:"not_implemented"}}))}vx.exports={intercept:uq}});var bx=l((Y8,Ax)=>{var lq={antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["runtime.us-east-1.kiro.dev","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]};Ax.exports={TOOL_HOSTS:lq}});var Tx=l((Z8,xx)=>{var{exec:Sx,execSync:fq}=require("child_process"),wx=process.platform==="win32";function Cx(){if(wx)try{return fq("net session >nul 2>&1",{windowsHide:!0,stdio:"ignore"}),!0}catch{return!1}return typeof process.getuid=="function"&&process.getuid()===0}function Px(r){return`'${String(r).replace(/'/g,"''")}'`}function dq(r){if(!wx)return Promise.reject(new Error("Windows-only"));let e=Buffer.from(r,"utf16le").toString("base64");if(Cx())return new Promise((n,i)=>{Sx(`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand ${e}`,{windowsHide:!0},(s,o,a)=>{s?i(new Error(a||s.message)):n(o)})});let t=`
|
|
34
50
|
$proc = Start-Process powershell -ArgumentList @(
|
|
35
51
|
'-NoProfile','-NonInteractive','-ExecutionPolicy','Bypass',
|
|
36
|
-
'-WindowStyle','Hidden','-EncodedCommand','${
|
|
52
|
+
'-WindowStyle','Hidden','-EncodedCommand','${e}'
|
|
37
53
|
) -Verb RunAs -Wait -PassThru -WindowStyle Hidden;
|
|
38
54
|
if ($proc.ExitCode -ne 0) { throw "Elevated command exited with code $($proc.ExitCode)" }
|
|
39
|
-
`;return new Promise((
|
|
40
|
-
`),s.stdin.end())})}async function
|
|
41
|
-
`),
|
|
42
|
-
${
|
|
43
|
-
`;
|
|
44
|
-
`),
|
|
45
|
-
${
|
|
46
|
-
`.replace(/'/g,"'\\''");await
|
|
55
|
+
`;return new Promise((n,i)=>{Sx(`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command ${Px(t)}`,{windowsHide:!0},(s,o,a)=>{if(s){let c=a||s.message;c.includes("canceled by the user")||c.includes("operation was canceled")?i(new Error("User canceled UAC prompt")):i(new Error(c))}else n(o)})})}xx.exports={isAdmin:Cx,runElevatedPowerShell:dq,quotePs:Px}});var Rx=l((rU,qx)=>{var{exec:Q8,spawn:Ex,execSync:ql}=require("child_process"),tt=require("fs"),pq=require("path"),eU=require("os"),{log:Mh,err:hq}=ri(),{TOOL_HOSTS:Yn}=bx(),{runElevatedPowerShell:Ix,isAdmin:tU}=Tx();function kx(r,e,t){let n=`${r}.9router.new`,i=`${r}.9router.bak`;try{tt.writeFileSync(n,t,"utf8");try{tt.unlinkSync(i)}catch{}tt.renameSync(r,i);try{tt.renameSync(n,r)}catch(s){try{tt.renameSync(i,r)}catch{tt.writeFileSync(r,e,"utf8")}throw s}try{tt.unlinkSync(i)}catch{}}finally{try{tt.unlinkSync(n)}catch{}}}var mn=process.platform==="win32",Bx=process.platform==="darwin",qt=mn?pq.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"):"/etc/hosts";function Dh(){if(mn)return!1;try{return ql("command -v sudo",{stdio:"ignore",windowsHide:!0}),!0}catch{return!1}}function Ox(){if(mn||!Dh())return!0;try{return ql("sudo -n true",{stdio:"ignore",windowsHide:!0}),!0}catch{return!1}}function yq(){return!mn&&Dh()&&!Ox()}function Rl(r,e){return new Promise((t,n)=>{let i=Dh(),s=i?Ex("sudo",["-S","sh","-c",r],{stdio:["pipe","pipe","pipe"],windowsHide:!0}):Ex("sh",["-c",r],{stdio:["ignore","pipe","pipe"],windowsHide:!0}),o="",a="";s.stdout.on("data",c=>{o+=c}),s.stderr.on("data",c=>{a+=c}),s.on("close",c=>{c===0?t(o):n(new Error(a||`Exit code ${c}`))}),i&&(s.stdin.write(`${e}
|
|
56
|
+
`),s.stdin.end())})}async function jx(r){mn||(Bx?await Rl("dscacheutil -flushcache && killall -HUP mDNSResponder",r):await Rl("resolvectl flush-caches 2>/dev/null || true",r))}function vA(r=null){try{let e=tt.readFileSync(qt,"utf8");return r?e.includes(r):Yn.antigravity.every(t=>e.includes(t))}catch{return!1}}function _q(){try{let r=tt.readFileSync(qt,"utf8"),e={};for(let[t,n]of Object.entries(Yn))e[t]=n.every(i=>r.includes(i));return e}catch{return Object.fromEntries(Object.keys(Yn).map(r=>[r,!1]))}}async function gq(r,e){let t=Yn[r];if(!t)throw new Error(`Unknown tool: ${r}`);let n=t.filter(i=>!vA(i));if(n.length===0){Mh(`\u{1F310} DNS ${r}: already active`);return}try{if(mn){let i=tt.readFileSync(qt,"utf8"),s=i.replace(/[\r\n\s]+$/g,""),o=n.map(c=>`127.0.0.1 ${c}`).join(`\r
|
|
57
|
+
`),a=`${s}\r
|
|
58
|
+
${o}\r
|
|
59
|
+
`;kx(qt,i,a),await Ix("ipconfig /flushdns | Out-Null")}else{let s=tt.readFileSync(qt,"utf8").replace(/[\r\n\s]+$/g,""),o=n.map(u=>`127.0.0.1 ${u}`).join(`
|
|
60
|
+
`),c=`${s}
|
|
61
|
+
${o}
|
|
62
|
+
`.replace(/'/g,"'\\''");await Rl(`printf '%s' '${c}' | tee ${qt} > /dev/null`,e),await jx(e)}Mh(`\u{1F310} DNS ${r}: \u2705 added ${n.join(", ")}`)}catch(i){let s=i.message?.includes("incorrect password")?"Wrong sudo password":`Failed to add DNS entry: ${i.message}`;throw new Error(s)}}async function Nx(r,e){let t=Yn[r];if(!t)throw new Error(`Unknown tool: ${r}`);let n=t.filter(i=>vA(i));if(n.length===0){Mh(`\u{1F310} DNS ${r}: already inactive`);return}try{if(mn){let i=tt.readFileSync(qt,"utf8"),o=i.split(/\r?\n/).filter(a=>!n.some(c=>a.includes(c))).join(`\r
|
|
47
63
|
`).replace(/[\r\n\s]+$/g,"")+`\r
|
|
48
|
-
`;
|
|
64
|
+
`;kx(qt,i,o),await Ix("ipconfig /flushdns | Out-Null")}else{let a=(tt.readFileSync(qt,"utf8").split(/\r?\n/).filter(c=>!n.some(u=>c.includes(u))).join(`
|
|
49
65
|
`).replace(/[\r\n\s]+$/g,"")+`
|
|
50
|
-
`).replace(/'/g,"'\\''");await
|
|
66
|
+
`).replace(/'/g,"'\\''");await Rl(`printf '%s' '${a}' | tee ${qt} > /dev/null`,e),await jx(e)}Mh(`\u{1F310} DNS ${r}: \u2705 removed ${n.join(", ")}`)}catch(i){let s=i.message?.includes("incorrect password")?"Wrong sudo password":`Failed to remove DNS entry: ${i.message}`;throw new Error(s)}}async function vq(r){for(let e of Object.keys(Yn))try{await Nx(e,r)}catch(t){hq(`DNS ${e}: failed to remove \u2014 ${t.message}`)}}function mq(){try{if(!tt.existsSync(qt))return;let r=Object.values(Yn).flat(),e=tt.readFileSync(qt,"utf8"),t=mn?`\r
|
|
51
67
|
`:`
|
|
52
|
-
`,
|
|
53
|
-
${
|
|
54
|
-
[ERROR h2] ${
|
|
55
|
-
`),
|
|
56
|
-
[ERROR h2-stream] ${
|
|
57
|
-
`),
|
|
58
|
-
[ERROR] ${
|
|
59
|
-
`),
|
|
60
|
-
`).filter(
|
|
68
|
+
`,i=e.split(/\r?\n/).filter(s=>!r.some(o=>s.includes(o))).join(t).replace(/[\r\n\s]+$/g,"")+t;if(i===e)return;if(tt.writeFileSync(qt,i,"utf8"),mn)try{ql("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}else if(Bx)try{ql("dscacheutil -flushcache && killall -HUP mDNSResponder",{stdio:"ignore"})}catch{}else try{ql("resolvectl flush-caches 2>/dev/null || true",{stdio:"ignore"})}catch{}}catch{}}qx.exports={TOOL_HOSTS:Yn,addDNSEntry:gq,removeDNSEntry:Nx,removeAllDNSEntries:vq,removeAllDNSEntriesSync:mq,execWithPassword:Rl,isSudoAvailable:Dh,canRunSudoWithoutPassword:Ox,isSudoPasswordRequired:yq,checkDNSEntry:vA,checkAllDNSStatus:_q}});var Lx=require("https"),Aq=require("http2"),wA=require("tls"),Uh=require("fs"),$h=require("path"),bq=require("dns"),{promisify:Sq}=require("util"),{execSync:mA}=require("child_process"),{log:Fh,err:Rt,dumpRequest:wq,createResponseDumper:Cq,clearDumpDir:Pq}=ri(),{IS_DEV:xq,LSOF_BIN:Tq,TARGET_HOSTS:Eq,URL_PATTERNS:nU,MODEL_SYNONYMS:Iq,MODEL_PATTERNS:kq,MODEL_NO_MAP:Bq,getToolForHost:Vx,isChatRequest:Oq,extractModel:jq}=Ta(),{DATA_DIR:iU,MITM_DIR:Lh}=Es(),{generateCert:Nq,getCertForDomain:qq}=XP(),{getMitmAlias:Rq}=ex(),{applyAntigravityIdeVersionOverride:Mq}=nx(),ba=443,Mx=process.platform==="win32",Hx=xq;Pq();var Dx={name:"x-request-source",value:"local"},Dq={"cloudcode-pa.googleapis.com":"daily-cloudcode-pa.googleapis.com"},Ux={antigravity:cx(),copilot:lx(),kiro:gx(),cursor:mx()},AA=new Map,Vh=new Map,Fx;function Uq(r,e){try{if(AA.has(r))return e(null,AA.get(r));if(Vh.has(r)){Vh.get(r).then(n=>e(null,n)).catch(n=>e(n));return}let t=(async()=>{let n=await qq(r);if(!n)throw new Error(`Failed to generate cert for ${r}`);let i=wA.createSecureContext({key:n.key,cert:`${n.cert}
|
|
69
|
+
${Fx}`});return AA.set(r,i),i})().finally(()=>{Vh.delete(r)});Vh.set(r,t),t.then(n=>e(null,n)).catch(n=>{Rt(`SNI error for ${r}: ${n.message}`),e(n)})}catch(t){Rt(`SNI error for ${r}: ${t.message}`),e(t)}}var bA={},$q=300*1e3;async function CA(r){let e=bA[r];if(e&&Date.now()-e.ts<$q)return e.ip;let t=new bq.Resolver;t.setServers(["8.8.8.8"]);let i=await Sq(t.resolve4.bind(t))(r);return bA[r]={ip:i[0],ts:Date.now()},bA[r].ip}function Lq(r){return new Promise((e,t)=>{let n=[];r.on("data",i=>n.push(i)),r.on("end",()=>e(Buffer.concat(n))),r.on("error",t)})}function Vq(r,e){if(!e)return null;try{let t=Rq(r);if(!t)return null;let n=String(e).replace(/^models\//,""),i=Iq?.[r]?.[n]||n;if(t[i])return t[i];let s=Object.keys(t).find(a=>a&&t[a]&&(i.startsWith(a)||a.startsWith(i)));if(s)return t[s];let o=kq?.[r]||[];for(let{match:a,alias:c}of o)if(a.test(i)&&t[c])return t[c];return null}catch{return null}}async function Cs(r,e,t,n){let i=(r.headers.host||Eq[0]).split(":")[0],o=(r.url.includes(":generateContent")||r.url.includes(":streamGenerateContent"))&&Dq[i]||i,a=Hx?Cq(r,"passthrough"):null,u=Vx(r.headers.host)==="antigravity"?Mq(t,r.headers,r.url):{bodyBuffer:t,headers:r.headers},d=u.bodyBuffer,p={...u.headers,host:o};d!==t&&(p["content-length"]=String(d.length));try{if(await Hq(o)==="h2")return await Fq(r,e,d,p,o,n,a)}catch(_){Rt(`[mitm] ALPN negotiate failed: ${_.message}, fallback to HTTP/1.1`)}return Kq(r,e,d,p,o,n,a)}var SA=new Map;async function Hq(r){if(SA.has(r))return SA.get(r);let e=await CA(r);return new Promise((t,n)=>{let i=wA.connect({host:e,port:443,servername:r,ALPNProtocols:["h2","http/1.1"],rejectUnauthorized:!1},()=>{let s=i.alpnProtocol||"http/1.1";SA.set(r,s),Fh(`\u{1F517} [mitm] ALPN ${r} \u2192 ${s}`),i.end(),t(s)});i.once("error",n),i.setTimeout(5e3,()=>{i.destroy(new Error("ALPN timeout"))})})}async function Fq(r,e,t,n,i,s,o){let a=await CA(i),c={};for(let[u,d]of Object.entries(n)){let p=u.toLowerCase();p==="host"||p==="connection"||p==="keep-alive"||p==="transfer-encoding"||p==="upgrade"||p==="proxy-connection"||(c[p]=d)}return c[":method"]=r.method,c[":path"]=r.url,c[":scheme"]="https",c[":authority"]=i,new Promise(u=>{let d=Aq.connect(`https://${i}`,{createConnection:()=>wA.connect({host:a,port:443,servername:i,ALPNProtocols:["h2"],rejectUnauthorized:!1})});d.once("error",_=>{Rt(`[mitm] http2 client error: ${_.message}`),o&&(o.writeChunk(`
|
|
70
|
+
[ERROR h2] ${_.message}
|
|
71
|
+
`),o.end()),e.headersSent||e.writeHead(502),e.writableEnded||e.end("Bad Gateway");try{d.close()}catch{}u()});let p=d.request(c,{endStream:t.length===0});t.length>0&&p.end(t),p.once("response",_=>{let E=_[":status"],U={};for(let[L,Be]of Object.entries(_))L.startsWith(":")||L==="connection"||L==="keep-alive"||L==="transfer-encoding"||(U[L]=Be);e.writeHead(E,U),o&&o.writeHeader(E,U);let $=[];p.on("data",L=>{o&&o.writeChunk(L),s&&$.push(L),e.write(L)}),p.on("end",()=>{if(o&&o.end(),e.writableEnded||e.end(),s)try{s(Buffer.concat($),U)}catch{}try{d.close()}catch{}u()})}),p.once("error",_=>{Rt(`[mitm] http2 stream error: ${_.message}`),o&&(o.writeChunk(`
|
|
72
|
+
[ERROR h2-stream] ${_.message}
|
|
73
|
+
`),o.end()),e.headersSent||e.writeHead(502),e.writableEnded||e.end();try{d.close()}catch{}u()})})}async function Kq(r,e,t,n,i,s,o){let a=await CA(i),c=Lx.request({hostname:a,port:443,path:r.url,method:r.method,headers:n,servername:i,rejectUnauthorized:!1},u=>{if(e.writeHead(u.statusCode,u.headers),o&&o.writeHeader(u.statusCode,u.headers),!s&&!o){u.pipe(e);return}let d=[];u.on("data",p=>{o&&o.writeChunk(p),s&&d.push(p),e.write(p)}),u.on("end",()=>{if(o&&o.end(),e.end(),s)try{s(Buffer.concat(d),u.headers)}catch{}})});c.on("error",u=>{Rt(`Passthrough error: ${u.message}`),o&&(o.writeChunk(`
|
|
74
|
+
[ERROR] ${u.message}
|
|
75
|
+
`),o.end()),e.headersSent||e.writeHead(502),e.end("Bad Gateway")}),t.length>0&&c.write(t),c.end()}var Hh;async function Gq(r,e){try{if(r.url==="/_mitm_health"){e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({ok:!0,pid:process.pid}));return}let t=await Lq(r);if(Hx&&wq(r,t,"raw"),r.headers[Dx.name]===Dx.value)return Cs(r,e,t);let n=Vx(r.headers.host);if(!n||!Oq(n,r))return Cs(r,e,t);if(n==="cursor")return Ux[n].intercept(r,e,t,null,Cs);let i=jq(r.url,t);if(i&&(Bq[n]||[]).some(o=>o.test(i)))return Cs(r,e,t);let s=Vq(n,i);return s?Ux[n].intercept(r,e,t,s,Cs):Cs(r,e,t)}catch(t){Rt(`Unhandled error: ${t.message}`),e.headersSent||e.writeHead(500,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{message:t.message,type:"mitm_error"}}))}}function Wq(r){try{let e=[];if(Mx){let t=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-NetTCPConnection -LocalPort ${r} -State Listen -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess"`,n=mA(t,{encoding:"utf-8",windowsHide:!0}).trim();if(!n)return;e=n.split(/\r?\n/).map(i=>i.trim()).filter(i=>i&&Number(i)!==process.pid&&Number(i)>4)}else{let t=mA(`${Tq} -nP -iTCP:${r} -sTCP:LISTEN -t`,{encoding:"utf-8",windowsHide:!0}).trim();if(!t)return;e=t.split(`
|
|
76
|
+
`).filter(n=>n&&Number(n)!==process.pid)}if(e.length===0)return;e.forEach(t=>{try{Mx?mA(`taskkill /F /PID ${t}`,{windowsHide:!0}):process.kill(Number(t),"SIGKILL")}catch(n){Rt(`Failed to kill PID ${t}: ${n.message}`)}}),Fh(`Killed ${e.length} process(es) on port ${r}`)}catch(e){if(e.status!==1)throw e}}async function zq(){try{(!Uh.existsSync($h.join(Lh,"rootCA.key"))||!Uh.existsSync($h.join(Lh,"rootCA.crt")))&&(Fh("Root CA missing, generating..."),await Nq());let r=Uh.readFileSync($h.join(Lh,"rootCA.key")),e=Uh.readFileSync($h.join(Lh,"rootCA.crt"));Fx=e.toString("utf8");let t={key:r,cert:e,SNICallback:Uq};Hh=Lx.createServer(t,Gq);try{Wq(ba)}catch(n){Rt(`Cannot kill process on port ${ba}: ${n.message}`),process.exit(1)}Hh.listen(ba,()=>Fh(`\u{1F680} Server ready on :${ba}`)),Hh.on("error",n=>{n.code==="EADDRINUSE"?Rt(`Port ${ba} already in use`):n.code==="EACCES"?Rt(`Permission denied for port ${ba}`):Rt(n.message),process.exit(1)})}catch(r){Rt(`Root CA initialization failed: ${r.message}`),process.exit(1)}}zq();var{removeAllDNSEntriesSync:Jq}=Rx(),$x=!1,PA=()=>{if($x)return;$x=!0,Jq();let r=setTimeout(()=>process.exit(0),1500);Hh.close(()=>{clearTimeout(r),process.exit(0)})};process.on("SIGTERM",PA);process.on("SIGINT",PA);process.platform==="win32"&&process.on("SIGBREAK",PA);
|
|
77
|
+
/*! Bundled license information:
|
|
78
|
+
|
|
79
|
+
reflect-metadata/Reflect.js:
|
|
80
|
+
(*! *****************************************************************************
|
|
81
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
82
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
83
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
84
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
85
|
+
|
|
86
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
87
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
88
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
89
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
90
|
+
|
|
91
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
92
|
+
and limitations under the License.
|
|
93
|
+
***************************************************************************** *)
|
|
94
|
+
|
|
95
|
+
pvtsutils/build/index.js:
|
|
96
|
+
(*!
|
|
97
|
+
* MIT License
|
|
98
|
+
*
|
|
99
|
+
* Copyright (c) 2017-2024 Peculiar Ventures, LLC
|
|
100
|
+
*
|
|
101
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
102
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
103
|
+
* in the Software without restriction, including without limitation the rights
|
|
104
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
105
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
106
|
+
* furnished to do so, subject to the following conditions:
|
|
107
|
+
*
|
|
108
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
109
|
+
* copies or substantial portions of the Software.
|
|
110
|
+
*
|
|
111
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
112
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
113
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
114
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
115
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
116
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
117
|
+
* SOFTWARE.
|
|
118
|
+
*
|
|
119
|
+
*)
|
|
120
|
+
|
|
121
|
+
pvutils/build/utils.js:
|
|
122
|
+
(*!
|
|
123
|
+
Copyright (c) Peculiar Ventures, LLC
|
|
124
|
+
*)
|
|
125
|
+
|
|
126
|
+
asn1js/build/index.js:
|
|
127
|
+
(*!
|
|
128
|
+
* Copyright (c) 2014, GMO GlobalSign
|
|
129
|
+
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
130
|
+
* All rights reserved.
|
|
131
|
+
*
|
|
132
|
+
* Author 2014-2019, Yury Strozhevsky
|
|
133
|
+
*
|
|
134
|
+
* Redistribution and use in source and binary forms, with or without modification,
|
|
135
|
+
* are permitted provided that the following conditions are met:
|
|
136
|
+
*
|
|
137
|
+
* * Redistributions of source code must retain the above copyright notice, this
|
|
138
|
+
* list of conditions and the following disclaimer.
|
|
139
|
+
*
|
|
140
|
+
* * Redistributions in binary form must reproduce the above copyright notice, this
|
|
141
|
+
* list of conditions and the following disclaimer in the documentation and/or
|
|
142
|
+
* other materials provided with the distribution.
|
|
143
|
+
*
|
|
144
|
+
* * Neither the name of the copyright holder nor the names of its
|
|
145
|
+
* contributors may be used to endorse or promote products derived from
|
|
146
|
+
* this software without specific prior written permission.
|
|
147
|
+
*
|
|
148
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
149
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
150
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
151
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
152
|
+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
153
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
154
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
155
|
+
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
156
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
157
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
158
|
+
*
|
|
159
|
+
*)
|
|
160
|
+
|
|
161
|
+
tslib/tslib.es6.js:
|
|
162
|
+
(*! *****************************************************************************
|
|
163
|
+
Copyright (c) Microsoft Corporation.
|
|
164
|
+
|
|
165
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
166
|
+
purpose with or without fee is hereby granted.
|
|
167
|
+
|
|
168
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
169
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
170
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
171
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
172
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
173
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
174
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
175
|
+
***************************************************************************** *)
|
|
176
|
+
|
|
177
|
+
@peculiar/x509/build/x509.cjs.js:
|
|
178
|
+
(*!
|
|
179
|
+
* MIT License
|
|
180
|
+
*
|
|
181
|
+
* Copyright (c) Peculiar Ventures. All rights reserved.
|
|
182
|
+
*
|
|
183
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
184
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
185
|
+
* in the Software without restriction, including without limitation the rights
|
|
186
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
187
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
188
|
+
* furnished to do so, subject to the following conditions:
|
|
189
|
+
*
|
|
190
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
191
|
+
* copies or substantial portions of the Software.
|
|
192
|
+
*
|
|
193
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
194
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
195
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
196
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
197
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
198
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
199
|
+
* SOFTWARE.
|
|
200
|
+
*
|
|
201
|
+
*)
|
|
202
|
+
*/
|