@crewx/sdk 0.9.0-rc.17 → 0.9.0-rc.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/account/auth-client.d.ts +61 -0
- package/dist/account/auth-json-v2.d.ts +1 -0
- package/dist/account/auth-json.d.ts +30 -0
- package/dist/account/config.d.ts +37 -0
- package/dist/account/env-bootstrap.d.ts +11 -0
- package/dist/account/errors.d.ts +24 -0
- package/dist/account/index.d.ts +12 -0
- package/dist/account/index.js +2 -0
- package/dist/account/session-manager.d.ts +47 -0
- package/dist/activity-log/builder.d.ts +59 -6
- package/dist/agent/agent-list-view.d.ts +19 -0
- package/dist/agent-interceptor/chain.d.ts +25 -0
- package/dist/agent-interceptor/index.d.ts +6 -0
- package/dist/agent-interceptor/model-runner.d.ts +19 -0
- package/dist/agent-interceptor/program-runner.d.ts +13 -0
- package/dist/agent-interceptor/protocol.d.ts +68 -0
- package/dist/agent-interceptor/run-stop.d.ts +3 -0
- package/dist/agent-interceptor/schema.d.ts +267 -0
- package/dist/agent-interceptor/types.d.ts +88 -0
- package/dist/app/app.d.ts +167 -0
- package/dist/app/backend-env.d.ts +3 -0
- package/dist/app/content-media-types.d.ts +2 -0
- package/dist/app/context.d.ts +2 -0
- package/dist/app/entry.d.ts +9 -0
- package/dist/app/frame.d.ts +55 -0
- package/dist/app/index.d.ts +18 -0
- package/dist/app/index.js +12 -0
- package/dist/app/job-bridge.child.d.ts +1 -0
- package/dist/app/job-bridge.d.ts +67 -0
- package/dist/app/job-bridge.drain.child.d.ts +1 -0
- package/dist/app/job-bridge.example.d.ts +11 -0
- package/dist/app/job-contract.d.ts +40 -0
- package/dist/app/job-wire.d.ts +149 -0
- package/dist/app/protocol.d.ts +9 -0
- package/dist/app/runtime.d.ts +23 -0
- package/dist/app/schedule-contract.d.ts +59 -0
- package/dist/app/tool-mode.d.ts +3 -0
- package/dist/app-artifact-policy/check.d.ts +2 -0
- package/dist/app-artifact-policy/contract.d.ts +54 -0
- package/dist/app-artifact-policy/helper.d.ts +15 -0
- package/dist/app-artifact-policy/index.d.ts +3 -0
- package/dist/app-artifact-policy/index.js +18 -0
- package/dist/app-artifact-policy/paths.d.ts +24 -0
- package/dist/app-artifact-policy/scan.d.ts +47 -0
- package/dist/boxing/box.types.d.ts +4 -0
- package/dist/config/canonicalize-agent-options.d.ts +18 -0
- package/dist/config/default-agent-models.d.ts +11 -0
- package/dist/config/global-settings.d.ts +33 -0
- package/dist/config/migrate-grok-mode.d.ts +6 -0
- package/dist/config/model-compat.d.ts +31 -0
- package/dist/config/models.generated.d.ts +37 -0
- package/dist/config/models.remote.d.ts +1 -0
- package/dist/config/overdrive.d.ts +7 -0
- package/dist/config/pricing.d.ts +6 -3
- package/dist/config/pricing.generated.d.ts +4 -0
- package/dist/config/pricing.types.d.ts +4 -0
- package/dist/config/timeout.config.d.ts +4 -0
- package/dist/config/wi-boards.d.ts +19 -0
- package/dist/context-budget/continuity.d.ts +63 -0
- package/dist/context-budget/index.d.ts +142 -0
- package/dist/conversation/index.d.ts +1 -1
- package/dist/conversation/sqlite-provider.d.ts +6 -3
- package/dist/conversation/to-template-messages.d.ts +9 -0
- package/dist/conversation/types.d.ts +58 -1
- package/dist/desktop/command-runner.d.ts +4 -0
- package/dist/desktop/default-adapters.d.ts +4 -0
- package/dist/desktop/global-install.d.ts +19 -0
- package/dist/desktop/index.d.ts +3 -0
- package/dist/desktop/index.js +3 -0
- package/dist/desktop/install.d.ts +5 -0
- package/dist/desktop/lnk.d.ts +22 -0
- package/dist/desktop/manifest.d.ts +21 -0
- package/dist/desktop/types.d.ts +67 -0
- package/dist/desktop/version.d.ts +1 -0
- package/dist/desktop/windows-paths.d.ts +21 -0
- package/dist/desktop/wrapper.d.ts +18 -0
- package/dist/esm/account/index.js +2 -0
- package/dist/esm/app/index.js +12 -0
- package/dist/esm/app-artifact-policy/index.js +18 -0
- package/dist/esm/desktop/index.js +3 -0
- package/dist/esm/index.js +1175 -224
- package/dist/esm/node/index.js +2 -0
- package/dist/esm/plugins/index.js +527 -214
- package/dist/esm/process/index.js +1 -0
- package/dist/esm/publish/index.js +2 -0
- package/dist/esm/repository/index.js +648 -211
- package/dist/esm/skills/index.js +2 -0
- package/dist/esm/testing/index.js +1 -1
- package/dist/events/types.d.ts +28 -0
- package/dist/facade/Crewx.d.ts +70 -5
- package/dist/facade/task-ticket.d.ts +14 -0
- package/dist/highlight/thread-highlight-prompt.d.ts +2 -0
- package/dist/highlight/thread-highlighter.d.ts +326 -0
- package/dist/index.browser.d.ts +25 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +157 -17
- package/dist/index.js +1175 -224
- package/dist/internal/console-decoder.d.ts +38 -0
- package/dist/internal/windows-spawn.d.ts +10 -0
- package/dist/layout/types.d.ts +18 -1
- package/dist/lifecycle/process-lease.d.ts +80 -0
- package/dist/lifecycle/process-owner.d.ts +20 -0
- package/dist/lifecycle/task-heartbeat.d.ts +41 -0
- package/dist/lifecycle/task-stop.d.ts +82 -0
- package/dist/lifecycle/update-admission.d.ts +45 -0
- package/dist/local-server/base-url.d.ts +18 -0
- package/dist/local-server/index.d.ts +8 -0
- package/dist/local-server/opencode.d.ts +8 -0
- package/dist/local-server/probe.d.ts +3 -0
- package/dist/local-server/runtime.d.ts +26 -0
- package/dist/local-server/types.d.ts +43 -0
- package/dist/mcp-app/agent-access.d.ts +26 -0
- package/dist/mcp-app/app-handoff.d.ts +109 -0
- package/dist/mcp-app/app-icon-read.d.ts +7 -0
- package/dist/mcp-app/app-job-bridge.d.ts +30 -0
- package/dist/mcp-app/app-job-bridge.example.d.ts +36 -0
- package/dist/mcp-app/app-job.d.ts +168 -0
- package/dist/mcp-app/app-schedule.d.ts +85 -0
- package/dist/mcp-app/apps-context.d.ts +32 -0
- package/dist/mcp-app/bundle-provenance.d.ts +3 -0
- package/dist/mcp-app/candidate-registration.d.ts +4 -0
- package/dist/mcp-app/card-handler.d.ts +7 -0
- package/dist/mcp-app/catalog.d.ts +7 -0
- package/dist/mcp-app/content-channel.d.ts +86 -0
- package/dist/mcp-app/content-declarations.d.ts +31 -0
- package/dist/mcp-app/dev-checks.d.ts +31 -0
- package/dist/mcp-app/diagnostic-reason.d.ts +3 -0
- package/dist/mcp-app/discovery.d.ts +164 -0
- package/dist/mcp-app/errors.d.ts +7 -0
- package/dist/mcp-app/index.d.ts +45 -0
- package/dist/mcp-app/installed-app-ref.d.ts +25 -0
- package/dist/mcp-app/model-context.d.ts +29 -0
- package/dist/mcp-app/node-app-discovery-fs.d.ts +23 -0
- package/dist/mcp-app/product-bundle-assets.d.ts +27 -0
- package/dist/mcp-app/product-bundle-loader.d.ts +53 -0
- package/dist/mcp-app/projection.d.ts +14 -0
- package/dist/mcp-app/prompt-cards.d.ts +28 -0
- package/dist/mcp-app/registry.d.ts +28 -0
- package/dist/mcp-app/skill-backend.d.ts +141 -0
- package/dist/mcp-app/state-set.d.ts +9 -0
- package/dist/mcp-app/types.d.ts +490 -0
- package/dist/mcp-app/workspace-app-assets.d.ts +42 -0
- package/dist/mcp-app/workspace-app-scan-cache.d.ts +27 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +76 -0
- package/dist/migrations/0011_far_black_tarantula.sql +1 -0
- package/dist/migrations/0012_blue_turbo.sql +23 -0
- package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
- package/dist/migrations/0014_organic_mongu.sql +73 -0
- package/dist/migrations/0015_panoramic_gorilla_man.sql +71 -0
- package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
- package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
- package/dist/migrations/0018_bored_jackal.sql +33 -0
- package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
- package/dist/migrations/0020_useful_iron_lad.sql +55 -0
- package/dist/migrations/0021_dashing_peter_quill.sql +51 -0
- package/dist/migrations/0022_wandering_bucky.sql +1 -0
- package/dist/migrations/0023_red_payback.sql +1 -0
- package/dist/migrations/0024_storage_metadata.sql +262 -0
- package/dist/migrations/0025_task_heartbeat.sql +8 -0
- package/dist/migrations/0025_thread_app_instance_ledger.sql +2 -0
- package/dist/migrations/0026_mcp_action_source.sql +47 -0
- package/dist/migrations/0027_task_stop_scope_cleanup.sql +5 -0
- package/dist/migrations/0027_ui_instance_active_unique.sql +2 -0
- package/dist/migrations/0029_nice_rhino.sql +1 -0
- package/dist/migrations/0031_petite_arclight.sql +6 -0
- package/dist/migrations/0032_ui_instance_opened_by.sql +1 -0
- package/dist/migrations/0033_thread_creator_boundary_guard.sql +38 -0
- package/dist/migrations/0034_keen_fallen_one.sql +36 -0
- package/dist/migrations/0035_request_log_daily.sql +11 -0
- package/dist/migrations/0036_ui_definition_archive.sql +8 -0
- package/dist/migrations/0037_ui_instance_agent_open_request.sql +1 -0
- package/dist/migrations/0038_task_rating.sql +3 -0
- package/dist/migrations/0039_aspiring_purifiers.sql +9 -0
- package/dist/migrations/0040_task_provider_inputs.sql +53 -0
- package/dist/migrations/0041_tranquil_vivisector.sql +54 -0
- package/dist/migrations/meta/0011_snapshot.json +1342 -0
- package/dist/migrations/meta/0012_snapshot.json +1494 -0
- package/dist/migrations/meta/0013_snapshot.json +1592 -0
- package/dist/migrations/meta/0014_snapshot.json +1975 -0
- package/dist/migrations/meta/0015_snapshot.json +2315 -0
- package/dist/migrations/meta/0016_snapshot.json +2419 -0
- package/dist/migrations/meta/0017_snapshot.json +2419 -0
- package/dist/migrations/meta/0018_snapshot.json +2570 -0
- package/dist/migrations/meta/0020_snapshot.json +2895 -0
- package/dist/migrations/meta/0021_snapshot.json +3031 -0
- package/dist/migrations/meta/0022_snapshot.json +3039 -0
- package/dist/migrations/meta/0023_snapshot.json +3047 -0
- package/dist/migrations/meta/0029_snapshot.json +3206 -0
- package/dist/migrations/meta/0031_snapshot.json +3251 -0
- package/dist/migrations/meta/0034_snapshot.json +3473 -0
- package/dist/migrations/meta/0035_snapshot.json +3547 -0
- package/dist/migrations/meta/0036_snapshot.json +3591 -0
- package/dist/migrations/meta/0037_snapshot.json +3598 -0
- package/dist/migrations/meta/0038_snapshot.json +3626 -0
- package/dist/migrations/meta/0039_snapshot.json +3684 -0
- package/dist/migrations/meta/0040_snapshot.json +3759 -0
- package/dist/migrations/meta/0041_snapshot.json +4156 -0
- package/dist/migrations/meta/_journal.json +217 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +2 -0
- package/dist/paths.d.ts +1 -0
- package/dist/plugin/types.d.ts +1 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +527 -214
- package/dist/plugins/sqlite-tracing.d.ts +46 -0
- package/dist/process/index.d.ts +2 -0
- package/dist/process/index.js +1 -0
- package/dist/process/process-control.d.ts +60 -0
- package/dist/prompt/tag-names.d.ts +22 -0
- package/dist/provider/acp/connection.d.ts +6 -0
- package/dist/provider/acp/meta.d.ts +11 -0
- package/dist/provider/bridge.d.ts +12 -2
- package/dist/provider/classify-task-error.d.ts +2 -0
- package/dist/provider/claude-agent-env.d.ts +1 -0
- package/dist/provider/cli/adapter.types.d.ts +23 -2
- package/dist/provider/cli/adapters/agent-call.util.d.ts +1 -1
- package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -0
- package/dist/provider/cli/adapters/codex-item.d.ts +1 -0
- package/dist/provider/cli/adapters/event-timestamp.util.d.ts +1 -0
- package/dist/provider/cli/adapters/grok.d.ts +2 -0
- package/dist/provider/cli/adapters/index.d.ts +5 -0
- package/dist/provider/cli/index.d.ts +3 -2
- package/dist/provider/cli/meta.d.ts +5 -0
- package/dist/provider/cli/protocol-envelope.d.ts +3 -0
- package/dist/provider/errors.d.ts +5 -1
- package/dist/provider/idle-watchdog.d.ts +19 -0
- package/dist/provider/models.d.ts +17 -12
- package/dist/provider/order.d.ts +1 -1
- package/dist/provider/parse-usage.d.ts +6 -0
- package/dist/provider/provider-selection.d.ts +8 -0
- package/dist/provider/redact-technical-message.d.ts +1 -0
- package/dist/provider/task-error.types.d.ts +17 -0
- package/dist/provider-account/accounts.d.ts +15 -0
- package/dist/provider-account/index.d.ts +5 -0
- package/dist/provider-account/registry.d.ts +30 -0
- package/dist/provider-account/types.d.ts +40 -0
- package/dist/publish/constants.d.ts +6 -0
- package/dist/publish/errors.d.ts +7 -0
- package/dist/publish/index.d.ts +55 -0
- package/dist/publish/index.js +2 -0
- package/dist/publish/manifest.d.ts +47 -0
- package/dist/publish/marketplace-api.constants.d.ts +1 -0
- package/dist/publish/pack.d.ts +6 -0
- package/dist/publish/scan.d.ts +10 -0
- package/dist/publish/secrets.d.ts +6 -0
- package/dist/publish/upload.d.ts +19 -0
- package/dist/remote/execution-profile.d.ts +9 -0
- package/dist/remote/index.d.ts +1 -0
- package/dist/remote/types.d.ts +28 -0
- package/dist/repository/agent-send-history.repository.d.ts +23 -0
- package/dist/repository/agent-suggestion.repository.d.ts +34 -0
- package/dist/repository/base-sqlite-repository.d.ts +1 -0
- package/dist/repository/common-code.repository.d.ts +45 -0
- package/dist/repository/db.d.ts +12 -1
- package/dist/repository/index.d.ts +53 -6
- package/dist/repository/index.js +648 -211
- package/dist/repository/logs-db.d.ts +12 -0
- package/dist/repository/notification.repository.d.ts +58 -0
- package/dist/repository/project.repository.d.ts +90 -0
- package/dist/repository/public-task-answer.d.ts +24 -0
- package/dist/repository/request-log-mover.d.ts +70 -0
- package/dist/repository/request-log.repository.d.ts +7 -3
- package/dist/repository/sidebar-tab.repository.d.ts +86 -0
- package/dist/repository/storage-metadata.repository.d.ts +64 -0
- package/dist/repository/task-log-migration.d.ts +74 -0
- package/dist/repository/task-log.repository.d.ts +44 -0
- package/dist/repository/task-status.d.ts +21 -0
- package/dist/repository/task.repository.d.ts +307 -8
- package/dist/repository/thread-history.repository.d.ts +193 -0
- package/dist/repository/thread-origin-verdict.d.ts +27 -0
- package/dist/repository/thread-title.types.d.ts +29 -0
- package/dist/repository/thread.repository.d.ts +134 -5
- package/dist/repository/usage-backfill.d.ts +62 -0
- package/dist/repository/usage-from-logs.d.ts +21 -0
- package/dist/repository/workspace.repository.d.ts +3 -0
- package/dist/schema/agent-send-history.d.ts +85 -0
- package/dist/schema/agent-suggestions.d.ts +199 -0
- package/dist/schema/common-codes.d.ts +216 -0
- package/dist/schema/index.d.ts +16 -0
- package/dist/schema/notifications.d.ts +303 -0
- package/dist/schema/projects.d.ts +610 -0
- package/dist/schema/request-log-daily.d.ts +151 -0
- package/dist/schema/sidebar-tabs.d.ts +466 -0
- package/dist/schema/storage-metadata.d.ts +181 -0
- package/dist/schema/task-log-events.d.ts +119 -0
- package/dist/schema/task-provider-inputs.d.ts +100 -0
- package/dist/schema/tasks.d.ts +1058 -1
- package/dist/schema/thread-creator-unverified.d.ts +45 -0
- package/dist/schema/thread-history.d.ts +734 -0
- package/dist/schema/threads.d.ts +59 -0
- package/dist/schema/ui-action-receipts.d.ts +358 -0
- package/dist/schema/ui-definition-archive.d.ts +63 -0
- package/dist/schema/ui-instance-repins.d.ts +222 -0
- package/dist/schema/ui-instances.d.ts +324 -0
- package/dist/schema/workspaces.d.ts +17 -0
- package/dist/skills/index.d.ts +15 -0
- package/dist/skills/index.js +2 -0
- package/dist/skills/types.d.ts +18 -0
- package/dist/task-log/anchor-child-tasks.d.ts +7 -0
- package/dist/task-log/delegation-trailer.d.ts +34 -0
- package/dist/template/engine.d.ts +2 -2
- package/dist/template/helpers/exec.browser.d.ts +4 -3
- package/dist/template/helpers/exec.d.ts +4 -3
- package/dist/template/helpers/format-conversation.d.ts +1 -0
- package/dist/template/types.d.ts +20 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +1611 -3
- package/dist/types/task-log.types.d.ts +6 -1
- package/dist/ui-card/index.d.ts +2 -0
- package/dist/ui-card/legacy-card-parser.d.ts +11 -0
- package/dist/ui-instance/definition.d.ts +6 -0
- package/dist/ui-instance/errors.d.ts +18 -0
- package/dist/ui-instance/index.d.ts +11 -0
- package/dist/ui-instance/json.d.ts +19 -0
- package/dist/ui-instance/lineage.d.ts +24 -0
- package/dist/ui-instance/runtime.d.ts +19 -0
- package/dist/ui-instance/store.d.ts +213 -0
- package/dist/ui-instance/types.d.ts +343 -0
- package/dist/ui-plugin/app-icon.d.ts +50 -0
- package/dist/ui-plugin/app-manifest.d.ts +64 -0
- package/dist/ui-plugin/csp.d.ts +28 -0
- package/dist/ui-plugin/index.d.ts +8 -0
- package/dist/ui-plugin/limits.d.ts +27 -0
- package/dist/ui-plugin/manifest.d.ts +3 -0
- package/dist/ui-plugin/types.d.ts +208 -0
- package/dist/ui-plugin/validator.d.ts +18 -0
- package/dist/utils/crewx-executable.d.ts +76 -0
- package/dist/utils/crewx-home.d.ts +1 -0
- package/dist/utils/env-defaults.d.ts +3 -0
- package/dist/utils/id.d.ts +1 -1
- package/dist/utils/local-identity.d.ts +2 -0
- package/dist/utils/runner-env.d.ts +3 -0
- package/dist/utils/timestamp.d.ts +1 -0
- package/dist/utils/workspace.d.ts +1 -0
- package/dist/wi/create.d.ts +48 -0
- package/dist/wi/select.d.ts +20 -0
- package/package.json +63 -3
- package/templates/agents/default.yaml +303 -128
- package/templates/documents/crewx-manual.md +138 -138
- package/templates/documents/crewx-quick-guide.md +8 -7
- package/templates/workflows/wi-default-flow.yaml +65 -0
- package/templates/workflows/wi-plan-flow.yaml +140 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var ci="app-runtime-references/1",li=["INPUT_INVALID","LIMIT_EXCEEDED","PARSE_FAILED","UNSUPPORTED_LOADER","BINDING_AMBIGUOUS","TARGET_OUTSIDE_CLOSURE","BARE_SPECIFIER","BUILTIN_NOT_SELECTED","WORKER_UNSUPPORTED"],L={maxSourceBytesPerArtifact:16777216,maxSourceBytesTotal:33554432,maxExecutableArtifacts:512,maxAstNodesPerArtifact:15e5,maxAstNodesTotal:2e6,maxNestingDepth:512,maxClosurePaths:4096,maxBuiltinSelections:256,maxMetadataBytes:4194304,maxPathLength:1024,maxBuiltinNameLength:256};var at=new Set(`
|
|
2
|
+
_http_agent _http_client _http_common _http_incoming _http_outgoing _http_server _stream_duplex
|
|
3
|
+
_stream_passthrough _stream_readable _stream_transform _stream_wrap _stream_writable _tls_common
|
|
4
|
+
_tls_wrap assert assert/strict async_hooks buffer child_process cluster console constants crypto
|
|
5
|
+
dgram diagnostics_channel dns dns/promises domain events fs fs/promises http http2 https inspector
|
|
6
|
+
inspector/promises module net os path path/posix path/win32 perf_hooks process punycode querystring
|
|
7
|
+
readline readline/promises repl stream stream/consumers stream/promises stream/web string_decoder sys
|
|
8
|
+
timers timers/promises tls trace_events tty url util util/types v8 vm wasi worker_threads zlib
|
|
9
|
+
`.trim().split(/\s+/u)),nt=/^[a-z_][a-z0-9_]*(?:\/[a-z0-9_]+)*$/u,ot=/[\\?#%:\u0000-\u001f\u007f]/u;function Le(e){if(e.length===0)return "path is empty";if(e.startsWith("/"))return "absolute path";if(ot.test(e))return "path has a query, fragment, percent escape or reserved character";if(e.endsWith(".node"))return "native addon path";if(e.split("/").some(i=>i===""||i==="."||i===".."))return "path is not normalized"}function fe(e){return /\.(?:m|c)?js$/u.test(e)}function ut(e){if(e.startsWith("node:")){let t=e.slice(5);return nt.test(t)?t:void 0}return at.has(e)?e:void 0}function ie(e){if(e==="")return te("BARE_SPECIFIER","empty specifier");if(e==="."||e==="..")return te("UNSUPPORTED_LOADER","directory target");if(e.startsWith("./")||e.startsWith("../"))return {kind:"relative"};if(e.startsWith("/"))return te("TARGET_OUTSIDE_CLOSURE","absolute target");if(/^file:/iu.test(e))return te("TARGET_OUTSIDE_CLOSURE","file URL target");if(e.startsWith("node:")){let t=e.slice(5);return nt.test(t)?{kind:"builtin",name:t}:te("BARE_SPECIFIER","invalid built-in name")}return at.has(e)?{kind:"builtin",name:e}:/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(e)?te("BARE_SPECIFIER","URL scheme specifier"):te("BARE_SPECIFIER","bare package specifier")}function Oe(e,t){if(ot.test(t))return {code:"UNSUPPORTED_LOADER",detail:"target has a query, fragment, percent escape or reserved character"};if(t.endsWith("/"))return {code:"UNSUPPORTED_LOADER",detail:"directory target"};let i=e.split("/").slice(0,-1);for(let r of t.split("/"))if(!(r===""||r===".")){if(r===".."){if(i.length===0)return {code:"TARGET_OUTSIDE_CLOSURE",detail:"target escapes the closure root"};i.pop();continue}i.push(r);}return i.length===0?{code:"UNSUPPORTED_LOADER",detail:"target names the closure root"}:{path:i.join("/")}}function Ve(e){let t=0;for(let i=0;i<e.length;i+=1){let r=e.charCodeAt(i);if(r<128)t+=1;else if(r<2048)t+=2;else if(r>=55296&&r<=56319&&i+1<e.length){let s=e.charCodeAt(i+1);s>=56320&&s<=57343?(t+=4,i+=1):t+=3;}else t+=3;}return t}function te(e,t){return {kind:"refused",code:e,detail:t}}var pi=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],dt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],fi="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",mt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",De={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ue="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",di={5:Ue,"5module":Ue+" export import",6:Ue+" const class extends export import super"},xt=/^in(stanceof)?$/,mi=new RegExp("["+mt+"]"),xi=new RegExp("["+mt+fi+"]");function Me(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return false;if(i+=t[r+1],i>=e)return true}return false}function K(e,t){return e<65?e===36:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&mi.test(String.fromCharCode(e)):t===false?false:Me(e,dt)}function $(e,t){return e<48?e===36:e<58?true:e<65?false:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&xi.test(String.fromCharCode(e)):t===false?false:Me(e,dt)||Me(e,pi)}var _=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null;};function U(e,t){return new _(e,{beforeExpr:true,binop:t})}var B={beforeExpr:true},V={startsExpr:true},qe={};function b(e,t){return t===void 0&&(t={}),t.keyword=e,qe[e]=new _(e,t)}var a={num:new _("num",V),regexp:new _("regexp",V),string:new _("string",V),name:new _("name",V),privateId:new _("privateId",V),eof:new _("eof"),bracketL:new _("[",{beforeExpr:true,startsExpr:true}),bracketR:new _("]"),braceL:new _("{",{beforeExpr:true,startsExpr:true}),braceR:new _("}"),parenL:new _("(",{beforeExpr:true,startsExpr:true}),parenR:new _(")"),comma:new _(",",B),semi:new _(";",B),colon:new _(":",B),dot:new _("."),question:new _("?",B),questionDot:new _("?."),arrow:new _("=>",B),template:new _("template"),invalidTemplate:new _("invalidTemplate"),ellipsis:new _("...",B),backQuote:new _("`",V),dollarBraceL:new _("${",{beforeExpr:true,startsExpr:true}),eq:new _("=",{beforeExpr:true,isAssign:true}),assign:new _("_=",{beforeExpr:true,isAssign:true}),incDec:new _("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new _("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:U("||",1),logicalAND:U("&&",2),bitwiseOR:U("|",3),bitwiseXOR:U("^",4),bitwiseAND:U("&",5),equality:U("==/!=/===/!==",6),relational:U("</>/<=/>=",7),bitShift:U("<</>>/>>>",8),plusMin:new _("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:U("%",10),star:U("*",10),slash:U("/",10),starstar:new _("**",{beforeExpr:true}),coalesce:U("??",1),_break:b("break"),_case:b("case",B),_catch:b("catch"),_continue:b("continue"),_debugger:b("debugger"),_default:b("default",B),_do:b("do",{isLoop:true,beforeExpr:true}),_else:b("else",B),_finally:b("finally"),_for:b("for",{isLoop:true}),_function:b("function",V),_if:b("if"),_return:b("return",B),_switch:b("switch"),_throw:b("throw",B),_try:b("try"),_var:b("var"),_const:b("const"),_while:b("while",{isLoop:true}),_with:b("with"),_new:b("new",{beforeExpr:true,startsExpr:true}),_this:b("this",V),_super:b("super",V),_class:b("class",V),_extends:b("extends",B),_export:b("export"),_import:b("import",V),_null:b("null",V),_true:b("true",V),_false:b("false",V),_in:b("in",{beforeExpr:true,binop:7}),_instanceof:b("instanceof",{beforeExpr:true,binop:7}),_typeof:b("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:b("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:b("delete",{beforeExpr:true,prefix:true,startsExpr:true})},D=/\r\n?|\n|\u2028|\u2029/,gi=new RegExp(D.source,"g");function ue(e){return e===10||e===13||e===8232||e===8233}function gt(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(ue(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return -1}var yt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,T=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,vt=Object.prototype,yi=vt.hasOwnProperty,vi=vt.toString,he=Object.hasOwn||(function(e,t){return yi.call(e,t)}),ht=Array.isArray||(function(e){return vi.call(e)==="[object Array]"}),ct=Object.create(null);function J(e){return ct[e]||(ct[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Q(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var bi=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,me=function(t,i){this.line=t,this.column=i;};me.prototype.offset=function(t){return new me(this.line,this.column+t)};var Ee=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile);};function bt(e,t){for(var i=1,r=0;;){var s=gt(e,r,t);if(s<0)return new me(i,t-r);++i,r=s;}}var Fe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,checkPrivateFields:true,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false},lt=false;function _i(e){var t={};for(var i in Fe)t[i]=e&&he(e,i)?e[i]:Fe[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!lt&&typeof console=="object"&&console.warn&&(lt=true,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
10
|
+
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ht(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)};}if(ht(t.onComment)&&(t.onComment=ki(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function ki(e,t){return function(i,r,s,n,o,u){var h={type:i?"Block":"Line",value:r,start:s,end:n};e.locations&&(h.loc=new Ee(this,o,u)),e.ranges&&(h.range=[s,n]),t.push(h);}}var re=1,se=2,Ge=4,_t=8,He=16,kt=32,Ce=64,St=128,ae=256,xe=512,At=1024,we=re|se|ae;function Ke(e,t){return se|(e?Ge:0)|(t?_t:0)}var _e=0,ze=1,Y=2,Et=3,Ct=4,wt=5,R=function(t,i,r){this.options=t=_i(t),this.sourceFile=t.sourceFile,this.keywords=J(di[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==true&&(s=De[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=J(s);var n=(s?s+" ":"")+De.strict;this.reservedWordsStrict=J(n),this.reservedWordsStrictBind=J(n+" "+De.strictBind),this.input=String(i),this.containsEsc=false,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
|
|
11
|
+
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(D).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=a.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=true,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=false,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?se:re),this.regexpState=null,this.privateNameStack=[];},F={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowReturn:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},allowUsing:{configurable:true},inClassStaticBlock:{configurable:true}};R.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};F.inFunction.get=function(){return (this.currentVarScope().flags&se)>0};F.inGenerator.get=function(){return (this.currentVarScope().flags&_t)>0};F.inAsync.get=function(){return (this.currentVarScope().flags&Ge)>0};F.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ae|xe))return false;if(i&se)return (i&Ge)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};F.allowReturn.get=function(){return !!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&re)};F.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return (t&Ce)>0||this.options.allowSuperOutsideMethod};F.allowDirectSuper.get=function(){return (this.currentThisScope().flags&St)>0};F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};F.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ae|xe)||i&se&&!(i&He))return true}return false};F.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return !(t&At||!this.inModule&&t&re)};F.inClassStaticBlock.get=function(){return (this.currentVarScope().flags&ae)>0};R.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};R.parse=function(t,i){return new this(i,t).parse()};R.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};R.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(R.prototype,F);var O=R.prototype,Si=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;O.strictDirective=function(e){if(this.options.ecmaVersion<5)return false;for(;;){T.lastIndex=e,e+=T.exec(this.input)[0].length;var t=Si.exec(this.input.slice(e));if(!t)return false;if((t[1]||t[2])==="use strict"){T.lastIndex=e+t[0].length;var i=T.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||D.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,T.lastIndex=e,e+=T.exec(this.input)[0].length,this.input[e]===";"&&e++;}};O.eat=function(e){return this.type===e?(this.next(),true):false};O.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc};O.eatContextual=function(e){return this.isContextual(e)?(this.next(),true):false};O.expectContextual=function(e){this.eatContextual(e)||this.unexpected();};O.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||D.test(this.input.slice(this.lastTokEnd,this.start))};O.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),true};O.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected();};O.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),true};O.expect=function(e){this.eat(e)||this.unexpected();};O.unexpected=function(e){this.raise(e??this.start,"Unexpected token");};var Ie=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1;};O.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern");}};O.checkExpressionErrors=function(e,t){if(!e)return false;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property");};O.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value");};O.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var f=R.prototype;f.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==a.eof;){var i=this.parseStatement(null,true,t);e.body.push(i);}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined");}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Qe={kind:"loop"},Ai={kind:"switch"};f.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return false;T.lastIndex=this.pos;var t=T.exec(this.input),i=this.pos+t[0].length,r=this.fullCharCodeAt(i);if(r===91||r===92)return true;if(e)return false;if(r===123)return true;if(K(r)){var s=i;do i+=r<=65535?1:2;while($(r=this.fullCharCodeAt(i)));if(r===92)return true;var n=this.input.slice(s,i);if(!xt.test(n))return true}return false};f.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return false;T.lastIndex=this.pos;var e=T.exec(this.input),t=this.pos+e[0].length,i;return !D.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!($(i=this.fullCharCodeAt(t+8))||i===92))};f.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return false;T.lastIndex=this.pos;var i=T.exec(this.input),r=this.pos+i[0].length;if(D.test(this.input.slice(this.pos,r)))return false;if(e){var s=r+5,n;if(this.input.slice(r,s)!=="using"||s===this.input.length||$(n=this.fullCharCodeAt(s))||n===92)return false;T.lastIndex=s;var o=T.exec(this.input);if(r=s+o[0].length,o&&D.test(this.input.slice(s,r)))return false}var u=this.fullCharCodeAt(r);if(!K(u)&&u!==92)return false;var h=r;do r+=u<=65535?1:2;while($(u=this.fullCharCodeAt(r)));if(u===92)return true;var c=this.input.slice(h,r);return !(xt.test(c)||t&&c==="of")};f.isAwaitUsing=function(e){return this.isUsingKeyword(true,e)};f.isUsing=function(e){return this.isUsingKeyword(false,e)};f.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=a._var,n="let"),r){case a._break:case a._continue:return this.parseBreakContinueStatement(s,r.keyword);case a._debugger:return this.parseDebuggerStatement(s);case a._do:return this.parseDoStatement(s);case a._for:return this.parseForStatement(s);case a._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,false,!e);case a._class:return e&&this.unexpected(),this.parseClass(s,true);case a._if:return this.parseIfStatement(s);case a._return:return this.parseReturnStatement(s);case a._switch:return this.parseSwitchStatement(s);case a._throw:return this.parseThrowStatement(s);case a._try:return this.parseTryStatement(s);case a._const:case a._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case a._while:return this.parseWhileStatement(s);case a._with:return this.parseWithStatement(s);case a.braceL:return this.parseBlock(true,s);case a.semi:return this.parseEmptyStatement(s);case a._export:case a._import:if(this.options.ecmaVersion>10&&r===a._import){T.lastIndex=this.pos;var o=T.exec(this.input),u=this.pos+o[0].length,h=this.input.charCodeAt(u);if(h===40||h===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===a._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,true,!e);var c=this.isAwaitUsing(false)?"await using":this.isUsing(false)?"using":null;if(c)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),c==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,false,c),this.semicolon(),this.finishNode(s,"VariableDeclaration");var l=this.value,g=this.parseExpression();return r===a.name&&g.type==="Identifier"&&this.eat(a.colon)?this.parseLabeledStatement(s,l,g,e):this.parseExpressionStatement(s,g)}};f.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(a.semi)||this.insertSemicolon()?e.label=null:this.type!==a.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};f.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};f.parseDoStatement=function(e){return this.next(),this.labels.push(Qe),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(a._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(a.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};f.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Qe),this.enterScope(0),this.expect(a.parenL),this.type===a.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===a._var||this.type===a._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,true,s),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var n=this.isContextual("let"),o=false,u=this.isUsing(true)?"using":this.isAwaitUsing(true)?"await using":null;if(u){var h=this.startNode();return this.next(),u==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(h,true,u),this.finishNode(h,"VariableDeclaration"),this.parseForAfterInit(e,h,t)}var c=this.containsEsc,l=new Ie,g=this.start,E=t>-1?this.parseExprSubscripts(l,"await"):this.parseExpression(true,l);return this.type===a._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===a._in&&this.unexpected(t),e.await=true):o&&this.options.ecmaVersion>=8&&(E.start===g&&!c&&E.type==="Identifier"&&E.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=false)),n&&o&&this.raise(E.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(E,false,l),this.checkLValPattern(E),this.parseForIn(e,E)):(this.checkExpressionErrors(l,true),t>-1&&this.unexpected(t),this.parseFor(e,E))};f.parseForAfterInit=function(e,t,i){return (this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===a._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};f.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,de|(i?0:je),false,t)};f.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};f.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(a.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};f.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(Ai),this.enterScope(At);for(var t,i=false;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var r=this.type===a._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=true,t.test=null),this.expect(a.colon);}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};f.parseThrowStatement=function(e){return this.next(),D.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Ei=[];f.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?kt:0),this.checkLValPattern(e,t?Ct:Y),this.expect(a.parenR),e};f.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var t=this.startNode();this.next(),this.eat(a.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(false),this.exitScope(),e.handler=this.finishNode(t,"CatchClause");}return e.finalizer=this.eat(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};f.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,false,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};f.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Qe),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};f.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};f.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};f.parseLabeledStatement=function(e,t,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var o=n[s];o.name===t&&this.raise(i.start,"Label '"+t+"' is already declared");}for(var u=this.type.isLoop?"loop":this.type===a._switch?"switch":null,h=this.labels.length-1;h>=0;h--){var c=this.labels[h];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};f.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};f.parseBlock=function(e,t,i){for(e===void 0&&(e=true),t===void 0&&(t=this.startNode()),t.body=[],this.expect(a.braceL),e&&this.enterScope(0);this.type!==a.braceR;){var r=this.parseStatement(null);t.body.push(r);}return i&&(this.strict=false),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};f.parseFor=function(e,t){return e.init=t,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};f.parseForIn=function(e,t){var i=this.type===a._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};f.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(a.eq)?s.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==a._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!r&&s.id.type!=="Identifier"&&!(t&&(this.type===a._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(a.comma))break}return e};f.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?ze:Y,false);};var de=1,je=2,It=4;f.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===a.star&&t&je&&this.unexpected(),e.generator=this.eat(a.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&de&&(e.id=t&It&&this.type!==a.name?null:this.parseIdent(),e.id&&!(t&je)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ze:Y:Et));var n=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ke(e.async,e.generator)),t&de||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,false,s),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,t&de?"FunctionDeclaration":"FunctionExpression")};f.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();};f.parseClass=function(e,t){this.next();var i=this.strict;this.strict=true,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),n=false;for(s.body=[],this.expect(a.braceL);this.type!==a.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(s.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(n&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),n=true):o.key&&o.key.type==="PrivateIdentifier"&&Ci(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"));}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};f.parseClassElement=function(e){if(this.eat(a.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=false,n=false,o="method",u=false;if(this.eatContextual("static")){if(t>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===a.star?u=true:r="static";}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon()?n=true:r="async"),!r&&(t>=9||!n)&&this.eat(a.star)&&(s=true),!r&&!n&&!s){var h=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=h:r=h);}if(r?(i.computed=false,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===a.parenL||o!=="method"||s||n){var c=!i.static&&ke(i,"constructor"),l=c&&e;c&&o!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":o,this.parseClassMethod(i,s,n,l);}else this.parseClassField(i);return i};f.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword};f.parseClassElementName=function(e){this.type===a.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=false,e.key=this.parsePrivateIdent()):this.parsePropertyName(e);};f.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&ke(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};f.parseClassField=function(e){return ke(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ke(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(a.eq)?(this.enterScope(xe|Ce),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};f.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ae|Ce);this.type!==a.braceR;){var i=this.parseStatement(null);e.body.push(i);}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};f.parseClassId=function(e,t){this.type===a.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Y,false)):(t===true&&this.unexpected(),e.id=null);};f.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,false):null;};f.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};f.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var o=i[n];he(t,o.name)||(s?s.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"));}};function Ci(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",false):r?true:(e[i]=s,false)}function ke(e,t){var i=e.computed,r=e.key;return !i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}f.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};f.parseExport=function(e,t){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,t);if(this.eat(a._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else {if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else {for(var i=0,r=e.specifiers;i<r.length;i+=1){var s=r[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.");}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);}this.semicolon();}return this.finishNode(e,"ExportNamedDeclaration")};f.parseExportDeclaration=function(e){return this.parseStatement(null)};f.parseExportDefaultDeclaration=function(){var e;if(this.type===a._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,de|It,false,e)}else if(this.type===a._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else {var r=this.parseMaybeAssign();return this.semicolon(),r}};f.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),he(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=true);};f.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var n=s[r];this.checkPatternExport(e,n);}else if(i==="ArrayPattern")for(var o=0,u=t.elements;o<u.length;o+=1){var h=u[o];h&&this.checkPatternExport(e,h);}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument);};f.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id);}};f.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};f.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};f.parseExportSpecifiers=function(e){var t=[],i=true;for(this.expect(a.braceL);!this.eat(a.braceR);){if(i)i=false;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;t.push(this.parseExportSpecifier(e));}return t};f.parseImport=function(e){return this.next(),this.type===a.string?(e.specifiers=Ei,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===a.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};f.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Y),this.finishNode(e,"ImportSpecifier")};f.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Y),this.finishNode(e,"ImportDefaultSpecifier")};f.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Y),this.finishNode(e,"ImportNamespaceSpecifier")};f.parseImportSpecifiers=function(){var e=[],t=true;if(this.type===a.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma)))return e;if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(a.braceL);!this.eat(a.braceR);){if(t)t=false;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;e.push(this.parseImportSpecifier());}return e};f.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);for(var t={},i=true;!this.eat(a.braceR);){if(i)i=false;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;he(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=true,e.push(r);}return e};f.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};f.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);return bi.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(true)};f.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1);};f.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var j=R.prototype;j.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case "Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case "ObjectPattern":case "ArrayPattern":case "AssignmentPattern":case "RestElement":break;case "ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,true);for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token");}break;case "Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case "ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,true),this.toAssignableList(e.elements,t);break;case "SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case "AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case "ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue");}else i&&this.checkPatternErrors(i,true);return e};j.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t);}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start);}return e};j.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(false,e),this.finishNode(t,"SpreadElement")};j.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==a.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};j.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case a.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(a.bracketR,true,true),this.finishNode(e,"ArrayPattern");case a.braceL:return this.parseObj(true)}return this.parseIdent()};j.parseBindingList=function(e,t,i,r){for(var s=[],n=true;!this.eat(e);)if(n?n=false:this.expect(a.comma),t&&this.type===a.comma)s.push(null);else {if(i&&this.afterTrailingComma(e))break;if(this.type===a.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),s.push(o),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r));}return s};j.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};j.parseBindingListItem=function(e){return e};j.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};j.checkLValSimple=function(e,t,i){t===void 0&&(t=_e);var r=t!==_e;switch(e.type){case "Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===Y&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(he(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=true),t!==wt&&this.declareName(e.name,t,e.start));break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case "ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue");}};j.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=_e),e.type){case "ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,t,i);}break;case "ArrayPattern":for(var o=0,u=e.elements;o<u.length;o+=1){var h=u[o];h&&this.checkLValInnerPattern(h,t,i);}break;default:this.checkLValSimple(e,t,i);}};j.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=_e),e.type){case "Property":this.checkLValInnerPattern(e.value,t,i);break;case "AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case "RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i);}};var q=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n;},C={b_stat:new q("{",false),b_expr:new q("{",true),b_tmpl:new q("${",false),p_stat:new q("(",false),p_expr:new q("(",true),q_tmpl:new q("`",true,true,function(e){return e.tryReadTemplateToken()}),f_stat:new q("function",false),f_expr:new q("function",true),f_expr_gen:new q("function",true,false,null,true),f_gen:new q("function",false,false,null,true)},ce=R.prototype;ce.initialContext=function(){return [C.b_stat]};ce.curContext=function(){return this.context[this.context.length-1]};ce.braceIsBlock=function(e){var t=this.curContext();return t===C.f_expr||t===C.f_stat?true:e===a.colon&&(t===C.b_stat||t===C.b_expr)?!t.isExpr:e===a._return||e===a.name&&this.exprAllowed?D.test(this.input.slice(this.lastTokEnd,this.start)):e===a._else||e===a.semi||e===a.eof||e===a.parenR||e===a.arrow?true:e===a.braceL?t===C.b_stat:e===a._var||e===a._const||e===a.name?false:!this.exprAllowed};ce.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return false};ce.updateContext=function(e){var t,i=this.type;i.keyword&&e===a.dot?this.exprAllowed=false:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr;};ce.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e);};a.parenR.updateContext=a.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();e===C.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr;};a.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?C.b_stat:C.b_expr),this.exprAllowed=true;};a.dollarBraceL.updateContext=function(){this.context.push(C.b_tmpl),this.exprAllowed=true;};a.parenL.updateContext=function(e){var t=e===a._if||e===a._for||e===a._with||e===a._while;this.context.push(t?C.p_stat:C.p_expr),this.exprAllowed=true;};a.incDec.updateContext=function(){};a._function.updateContext=a._class.updateContext=function(e){e.beforeExpr&&e!==a._else&&!(e===a.semi&&this.curContext()!==C.p_stat)&&!(e===a._return&&D.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===a.colon||e===a.braceL)&&this.curContext()===C.b_stat)?this.context.push(C.f_expr):this.context.push(C.f_stat),this.exprAllowed=false;};a.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=true;};a.backQuote.updateContext=function(){this.curContext()===C.q_tmpl?this.context.pop():this.context.push(C.q_tmpl),this.exprAllowed=false;};a.star.updateContext=function(e){if(e===a._function){var t=this.context.length-1;this.context[t]===C.f_expr?this.context[t]=C.f_expr_gen:this.context[t]=C.f_gen;}this.exprAllowed=true;};a.name.updateContext=function(e){var t=false;this.options.ecmaVersion>=6&&e!==a.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=true),this.exprAllowed=t;};var m=R.prototype;m.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case "Identifier":s=r.name;break;case "Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=true);return}s="$"+s;var o=t[s];if(o){var u;n==="init"?u=this.strict&&o.init||o.get||o.set:u=o.init||o[n],u&&this.raiseRecoverable(r.start,"Redefinition of property");}else o=t[s]={init:false,get:false,set:false};o[n]=true;}};m.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===a.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(a.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};m.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=false;}var r=false,s=-1,n=-1,o=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ie,r=true);var u=this.start,h=this.startLoc;(this.type===a.parenL||this.type===a.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,u,h)),this.type.isAssign){var l=this.startNodeAt(u,h);return l.operator=this.value,this.type===a.eq&&(c=this.toAssignable(c,false,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===a.eq?this.checkLValPattern(c):this.checkLValSimple(c),l.left=c,this.next(),l.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(l,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,true);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),c};m.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(a.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(a.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};m.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,false,false,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};m.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==a._in)&&n>r){var o=this.type===a.logicalOR||this.type===a.logicalAND,u=this.type===a.coalesce;u&&(n=a.logicalAND.binop);var h=this.value;this.next();var c=this.start,l=this.startLoc,g=this.parseExprOp(this.parseMaybeUnary(null,false,false,s),c,l,n,s),E=this.buildBinary(t,i,e,g,h,o||u);return (o&&this.type===a.coalesce||u&&(this.type===a.logicalOR||this.type===a.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(E,t,i,r,s)}return e};m.buildBinary=function(e,t,i,r,s,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=i,o.operator=s,o.right=r,this.finishNode(o,n?"LogicalExpression":"BinaryExpression")};m.parseMaybeUnary=function(e,t,i,r){var s=this.start,n=this.startLoc,o;if(this.isContextual("await")&&this.canAwait)o=this.parseAwait(r),t=true;else if(this.type.prefix){var u=this.startNode(),h=this.type===a.incDec;u.operator=this.value,u.prefix=true,this.next(),u.argument=this.parseMaybeUnary(null,true,h,r),this.checkExpressionErrors(e,true),h?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&Rt(u.argument)?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&We(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=true,o=this.finishNode(u,h?"UpdateExpression":"UnaryExpression");}else if(!t&&this.type===a.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==a._in&&this.unexpected();else {if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(s,n);c.operator=this.value,c.prefix=false,c.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(c,"UpdateExpression");}}if(!i&&this.eat(a.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,o,this.parseMaybeUnary(null,false,false,r),"**",false);else return o};function Rt(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Rt(e.expression)}function We(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&We(e.expression)||e.type==="ParenthesizedExpression"&&We(e.expression)}m.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,i,r,false,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};m.parseSubscripts=function(e,t,i,r,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=false;;){var u=this.parseSubscript(e,t,i,r,n,o,s);if(u.optional&&(o=true),u===e||u.type==="ArrowFunctionExpression"){if(o){var h=this.startNodeAt(t,i);h.expression=u,u=this.finishNode(h,"ChainExpression");}return u}e=u;}};m.shouldParseAsyncArrow=function(){return !this.canInsertSemicolon()&&this.eat(a.arrow)};m.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,true,r)};m.parseSubscript=function(e,t,i,r,s,n,o){var u=this.options.ecmaVersion>=11,h=u&&this.eat(a.questionDot);r&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(a.bracketL);if(c||h&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var l=this.startNodeAt(t,i);l.object=e,c?(l.property=this.parseExpression(),this.expect(a.bracketR)):this.type===a.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!c,u&&(l.optional=h),e=this.finishNode(l,"MemberExpression");}else if(!r&&this.eat(a.parenL)){var g=new Ie,E=this.yieldPos,y=this.awaitPos,x=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var S=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,false,g);if(s&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(g,false),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=E,this.awaitPos=y,this.awaitIdentPos=x,this.parseSubscriptAsyncArrow(t,i,S,o);this.checkExpressionErrors(g,true),this.yieldPos=E||this.yieldPos,this.awaitPos=y||this.awaitPos,this.awaitIdentPos=x||this.awaitIdentPos;var I=this.startNodeAt(t,i);I.callee=e,I.arguments=S,u&&(I.optional=h),e=this.finishNode(I,"CallExpression");}else if(this.type===a.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var N=this.startNodeAt(t,i);N.tag=e,N.quasi=this.parseTemplate({isTagged:true}),e=this.finishNode(N,"TaggedTemplateExpression");}return e};m.parseExprAtom=function(e,t,i){this.type===a.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case a._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==a.dot&&this.type!==a.bracketL&&this.type!==a.parenL&&this.unexpected(),this.finishNode(r,"Super");case a._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case a.name:var n=this.start,o=this.startLoc,u=this.containsEsc,h=this.parseIdent(false);if(this.options.ecmaVersion>=8&&!u&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(C.f_expr),this.parseFunction(this.startNodeAt(n,o),0,false,true,t);if(s&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(n,o),[h],false,t);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===a.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(false),(this.canInsertSemicolon()||!this.eat(a.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,o),[h],true,t)}return h;case a.regexp:var c=this.value;return r=this.parseLiteral(c.value),r.regex={pattern:c.pattern,flags:c.flags},r;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return r=this.startNode(),r.value=this.type===a._null?null:this.type===a._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case a.parenL:var l=this.start,g=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(g)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),g;case a.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(a.bracketR,true,true,e),this.finishNode(r,"ArrayExpression");case a.braceL:return this.overrideContext(C.b_expr),this.parseObj(false,e);case a._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case a._class:return this.parseClass(this.startNode(),false);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};m.parseExprAtomDefault=function(){this.unexpected();};m.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(t);if(this.type===a.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected();};m.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(a.parenR)?e.options=null:(this.expect(a.comma),this.afterTrailingComma(a.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(a.parenR)||(this.expect(a.comma),this.afterTrailingComma(a.parenR)||this.unexpected())));else if(!this.eat(a.parenR)){var t=this.start;this.eat(a.comma)&&this.eat(a.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t);}return this.finishNode(e,"ImportExpression")};m.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};m.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};m.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e};m.shouldParseArrow=function(e){return !this.canInsertSemicolon()};m.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,h=[],c=true,l=false,g=new Ie,E=this.yieldPos,y=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;)if(c?c=false:this.expect(a.comma),n&&this.afterTrailingComma(a.parenR,true)){l=true;break}else if(this.type===a.ellipsis){x=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(false,g,this.parseParenItem));var S=this.lastTokEnd,I=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(h)&&this.eat(a.arrow))return this.checkPatternErrors(g,false),this.checkYieldAwaitInDefaultParams(),this.yieldPos=E,this.awaitPos=y,this.parseParenArrowList(i,r,h,t);(!h.length||l)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(g,true),this.yieldPos=E||this.yieldPos,this.awaitPos=y||this.awaitPos,h.length>1?(s=this.startNodeAt(o,u),s.expressions=h,this.finishNodeAt(s,"SequenceExpression",S,I)):s=h[0];}else s=this.parseParenExpression();if(this.options.preserveParens){var N=this.startNodeAt(i,r);return N.expression=s,this.finishNode(N,"ParenthesizedExpression")}else return s};m.parseParenItem=function(e){return e};m.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,false,r)};var wi=[];m.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,false,true),r,s,true,false),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,false):e.arguments=wi,this.finishNode(e,"NewExpression")};m.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===a.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
|
|
12
|
+
`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
13
|
+
`),cooked:this.value},this.next(),i.tail=this.type===a.backQuote,this.finishNode(i,"TemplateElement")};m.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=false);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===a.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(a.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(a.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};m.isAsyncProp=function(e){return !e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===a.name||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===a.star)&&!D.test(this.input.slice(this.lastTokEnd,this.start))};m.parseObj=function(e,t){var i=this.startNode(),r=true,s={};for(i.properties=[],this.next();!this.eat(a.braceR);){if(r)r=false;else if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),i.properties.push(n);}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};m.parseProperty=function(e,t){var i=this.startNode(),r,s,n,o;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis))return e?(i.argument=this.parseIdent(false),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(false,t),this.type===a.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=false,i.shorthand=false,(e||t)&&(n=this.start,o=this.startLoc),e||(r=this.eat(a.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=true,r=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(i)):s=false,this.parsePropertyValue(i,e,r,s,n,o,t,u),this.finishNode(i,"Property")};m.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(false),e.kind=t;var i=e.kind==="get"?0:1;if(e.value.params.length!==i){var r=e.value.start;e.kind==="get"?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param");}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params");};m.parsePropertyValue=function(e,t,i,r,s,n,o,u){(i||r)&&this.type===a.colon&&this.unexpected(),this.eat(a.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===a.parenL?(t&&this.unexpected(),e.method=true,e.value=this.parseMethod(i,r),e.kind="init"):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===a.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=true):this.unexpected();};m.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(a.bracketL))return e.computed=true,e.key=this.parseMaybeAssign(),this.expect(a.bracketR),e.key;e.computed=false;}return e.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};m.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=false),this.options.ecmaVersion>=8&&(e.async=false);};m.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ke(t,r.generator)|Ce|(i?St:0)),this.expect(a.parenL),r.params=this.parseBindingList(a.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,false,true,false),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")};m.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(Ke(i,false)|He),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,true),this.parseFunctionBody(e,true,false,r),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};m.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==a.braceL,n=this.strict,o=false;if(s)e.body=this.parseMaybeAssign(r),e.expression=true,this.checkParams(e,false);else {var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||u)&&(o=this.strictDirective(this.end),o&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var h=this.labels;this.labels=[],o&&(this.strict=true),this.checkParams(e,!n&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,wt),e.body=this.parseBlock(false,void 0,o&&!n),e.expression=false,this.adaptDirectivePrologue(e.body.body),this.labels=h;}this.exitScope();};m.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return false}return true};m.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,ze,t?null:i);}};m.parseExprList=function(e,t,i,r){for(var s=[],n=true;!this.eat(e);){if(n)n=false;else if(this.expect(a.comma),t&&this.afterTrailingComma(e))break;var o=void 0;i&&this.type===a.comma?o=null:this.type===a.ellipsis?(o=this.parseSpread(r),r&&this.type===a.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(false,r),s.push(o);}return s};m.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&we)&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"));}};m.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};m.parseIdentNode=function(){var e=this.startNode();return this.type===a.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=a.name):this.unexpected(),e};m.parsePrivateIdent=function(){var e=this.startNode();return this.type===a.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};m.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===a.semi||this.canInsertSemicolon()||this.type!==a.star&&!this.type.startsExpr?(t.delegate=false,t.argument=null):(t.delegate=this.eat(a.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};m.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,true,false,e),this.finishNode(t,"AwaitExpression")};var Se=R.prototype;Se.raise=function(e,t){var i=bt(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};Se.raiseRecoverable=Se.raise;Se.curPosition=function(){if(this.options.locations)return new me(this.curLine,this.pos-this.lineStart)};var ee=R.prototype,Ii=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[];};ee.enterScope=function(e){this.scopeStack.push(new Ii(e));};ee.exitScope=function(){this.scopeStack.pop();};ee.treatFunctionsAsVarInScope=function(e){return e.flags&se||!this.inModule&&e.flags&re};ee.declareName=function(e,t,i){var r=false;if(t===Y){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&re&&delete this.undefinedExports[e];}else if(t===Ct){var n=this.currentScope();n.lexical.push(e);}else if(t===Et){var o=this.currentScope();this.treatFunctionsAsVar?r=o.lexical.indexOf(e)>-1:r=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e);}else for(var u=this.scopeStack.length-1;u>=0;--u){var h=this.scopeStack[u];if(h.lexical.indexOf(e)>-1&&!(h.flags&kt&&h.lexical[0]===e)||!this.treatFunctionsAsVarInScope(h)&&h.functions.indexOf(e)>-1){r=true;break}if(h.var.push(e),this.inModule&&h.flags&re&&delete this.undefinedExports[e],h.flags&we)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared");};ee.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e);};ee.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};ee.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(we|xe|ae))return t}};ee.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(we|xe|ae)&&!(t.flags&He))return t}};var Re=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new Ee(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0]);},ge=R.prototype;ge.startNode=function(){return new Re(this,this.start,this.startLoc)};ge.startNodeAt=function(e,t){return new Re(this,e,t)};function Pt(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}ge.finishNode=function(e,t){return Pt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ge.finishNodeAt=function(e,t,i,r){return Pt.call(this,e,t,i,r)};ge.copyNode=function(e){var t=new Re(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Ri="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Nt="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Tt=Nt+" Extended_Pictographic",Lt=Tt,Ot=Lt+" EBase EComp EMod EPres ExtPict",Vt=Ot,Pi=Vt,Ni={9:Nt,10:Tt,11:Lt,12:Ot,13:Vt,14:Pi},Ti="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Li={9:"",10:"",11:"",12:"",13:"",14:Ti},pt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Dt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ut=Dt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Bt=Ut+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Mt=Bt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ft=Mt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Oi=Ft+" "+Ri,Vi={9:Dt,10:Ut,11:Bt,12:Mt,13:Ft,14:Oi},jt={};function Di(e){var t=jt[e]={binary:J(Ni[e]+" "+pt),binaryOfStrings:J(Li[e]),nonBinary:{General_Category:J(pt),Script:J(Vi[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions;}for(be=0,Be=[9,10,11,12,13,14];be<Be.length;be+=1)ft=Be[be],Di(ft);var ft,be,Be,p=R.prototype,Ae=function(t,i){this.parent=t,this.base=i||this;};Ae.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return true;return false};Ae.prototype.sibling=function(){return new Ae(this.parent,this.base)};var z=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=jt[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=false,this.switchV=false,this.switchN=false,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=false,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null;};z.prototype.reset=function(t,i,r){var s=r.indexOf("v")!==-1,n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=true,this.switchV=true,this.switchN=true):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=false,this.switchN=n&&this.parser.options.ecmaVersion>=9);};z.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t);};z.prototype.at=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return -1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var o=r.charCodeAt(t+1);return o>=56320&&o<=57343?(n<<10)+o-56613888:n};z.prototype.nextIndex=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return s;var n=r.charCodeAt(t),o;return !(i||this.switchU)||n<=55295||n>=57344||t+1>=s||(o=r.charCodeAt(t+1))<56320||o>57343?t+1:t+2};z.prototype.current=function(t){return t===void 0&&(t=false),this.at(this.pos,t)};z.prototype.lookahead=function(t){return t===void 0&&(t=false),this.at(this.nextIndex(this.pos,t),t)};z.prototype.advance=function(t){t===void 0&&(t=false),this.pos=this.nextIndex(this.pos,t);};z.prototype.eat=function(t,i){return i===void 0&&(i=false),this.current(i)===t?(this.advance(i),true):false};z.prototype.eatChars=function(t,i){i===void 0&&(i=false);for(var r=this.pos,s=0,n=t;s<n.length;s+=1){var o=n[s],u=this.at(r,i);if(u===-1||u!==o)return false;r=this.nextIndex(r,i);}return this.pos=r,true};p.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=false,s=false,n=0;n<i.length;n++){var o=i.charAt(n);t.indexOf(o)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(o,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(r=true),o==="v"&&(s=true);}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag");};function Ui(e){for(var t in e)return true;return false}p.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Ui(e.groupNames)&&(e.switchN=true,this.regexp_pattern(e));};p.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=false,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced");}};p.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Ae(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,true)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets");};p.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};p.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),true):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),true):false};p.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=false,e.eat(94)||e.eat(36))return true;if(e.eat(92)){if(e.eat(66)||e.eat(98))return true;e.pos=t;}if(e.eat(40)&&e.eat(63)){var i=false;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,true}return e.pos=t,false};p.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=false),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),true):false};p.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};p.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),true;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i;}return false};p.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};p.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return true;e.pos=t;}return false};p.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var s=0;s<i.length;s++){var n=i.charAt(s);i.indexOf(n,s+1)>-1&&e.raise("Duplicate regular expression modifiers");}if(r){var o=this.regexp_eatModifiers(e);!i&&!o&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u<o.length;u++){var h=o.charAt(u);(o.indexOf(h,u+1)>-1||i.indexOf(h)>-1)&&e.raise("Duplicate regular expression modifiers");}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return true;e.raise("Unterminated group");}}e.pos=t;}return false};p.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,true;e.raise("Unterminated group");}return false};p.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&Bi(i);)t+=Q(i),e.advance();return t};function Bi(e){return e===105||e===109||e===115}p.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};p.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,true)&&e.raise("Nothing to repeat"),false};p.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Wt(t)?(e.lastIntValue=t,e.advance(),true):false};function Wt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}p.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Wt(i);)e.advance();return e.pos!==t};p.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),true):false};p.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,s=i;r<s.length;r+=1){var n=s[r];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name");}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=true;}};p.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return true;e.raise("Invalid capture group name");}return false};p.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Q(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Q(e.lastIntValue);return true}return false};p.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Mi(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Mi(e){return K(e,true)||e===36||e===95}p.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Fi(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Fi(e){return $(e,true)||e===36||e===95||e===8204||e===8205}p.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?true:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),false)};p.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),true;if(i<=e.numCapturingParens)return true;e.pos=t;}return false};p.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),true;e.raise("Invalid named reference");}return false};p.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,false)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};p.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return true;e.pos=t;}return false};p.regexp_eatZero=function(e){return e.current()===48&&!Pe(e.lookahead())?(e.lastIntValue=0,e.advance(),true):false};p.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),true):t===110?(e.lastIntValue=10,e.advance(),true):t===118?(e.lastIntValue=11,e.advance(),true):t===102?(e.lastIntValue=12,e.advance(),true):t===114?(e.lastIntValue=13,e.advance(),true):false};p.regexp_eatControlLetter=function(e){var t=e.current();return qt(t)?(e.lastIntValue=t%32,e.advance(),true):false};function qt(e){return e>=65&&e<=90||e>=97&&e<=122}p.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=false);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(s-55296)*1024+(o-56320)+65536,true}e.pos=n,e.lastIntValue=s;}return true}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&ji(e.lastIntValue))return true;r&&e.raise("Invalid unicode escape"),e.pos=i;}return false};function ji(e){return e>=0&&e<=1114111}p.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?true:e.eat(47)?(e.lastIntValue=47,true):false;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),true):false};p.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return true}return false};var Gt=0,X=1,M=2;p.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Wi(t))return e.lastIntValue=-1,e.advance(),X;var i=false;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===M&&e.raise("Invalid property name"),r;e.raise("Invalid property name");}return Gt};function Wi(e){return e===100||e===68||e===115||e===83||e===119||e===87}p.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),X}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return Gt};p.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){he(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value");};p.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return X;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return M;e.raise("Invalid property name");};p.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ht(t=e.current());)e.lastStringValue+=Q(t),e.advance();return e.lastStringValue!==""};function Ht(e){return qt(e)||e===95}p.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";qi(t=e.current());)e.lastStringValue+=Q(t),e.advance();return e.lastStringValue!==""};function qi(e){return Ht(e)||Pe(e)}p.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};p.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===M&&e.raise("Negated character class may contain strings"),true}return false};p.regexp_classContents=function(e){return e.current()===93?X:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),X)};p.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class");}}};p.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return true;if(e.switchU){var i=e.current();(i===99||Qt(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape");}e.pos=t;}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),true):false};p.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,true;if(e.switchU&&e.eat(45))return e.lastIntValue=45,true;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return true;e.pos=t;}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};p.regexp_classSetExpression=function(e){var t=X,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===M&&(t=M);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==M&&(t=X);continue}e.raise("Invalid character in character class");}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===M&&(t=M);}};p.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),true}e.pos=t;}return false};p.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?X:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};p.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===M&&e.raise("Negated character class may contain strings"),r;e.pos=t;}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t;}return null};p.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t;}return null};p.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===M&&(t=M);return t};p.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?X:M};p.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?true:e.eat(98)?(e.lastIntValue=8,true):(e.pos=t,false);var i=e.current();return i<0||i===e.lookahead()&&Gi(i)||Hi(i)?false:(e.advance(),e.lastIntValue=i,true)};function Gi(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Hi(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}p.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Ki(t)?(e.lastIntValue=t,e.advance(),true):false};function Ki(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}p.regexp_eatClassControlLetter=function(e){var t=e.current();return Pe(t)||t===95?(e.lastIntValue=t%32,e.advance(),true):false};p.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return true;e.switchU&&e.raise("Invalid escape"),e.pos=t;}return false};p.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Pe(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Pe(e){return e>=48&&e<=57}p.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Kt(i=e.current());)e.lastIntValue=16*e.lastIntValue+zt(i),e.advance();return e.pos!==t};function Kt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function zt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}p.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i;}else e.lastIntValue=t;return true}return false};p.regexp_eatOctalDigit=function(e){var t=e.current();return Qt(t)?(e.lastIntValue=t-48,e.advance(),true):(e.lastIntValue=0,false)};function Qt(e){return e>=48&&e<=55}p.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!Kt(s))return e.pos=i,false;e.lastIntValue=16*e.lastIntValue+zt(s),e.advance();}return true};var Xe=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Ee(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end]);},v=R.prototype;v.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Xe(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken();};v.getToken=function(){return this.next(),new Xe(this)};typeof Symbol<"u"&&(v[Symbol.iterator]=function(){var e=this;return {next:function(){var t=e.getToken();return {done:t.type===a.eof,value:t}}}});v.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(a.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos());};v.readToken=function(e){return K(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};v.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888};v.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};v.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=gt(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(true,this.input.slice(t+2,i),t,this.pos,e,this.curPosition());};v.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!ue(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(false,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition());};v.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&yt.test(String.fromCharCode(e)))++this.pos;else break e}}};v.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i);};v.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(true);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(a.ellipsis)):(++this.pos,this.finishToken(a.dot))};v.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(a.assign,2):this.finishOp(a.slash,1)};v.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?a.star:a.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=a.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(a.assign,i+1):this.finishOp(r,i)};v.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(a.assign,3)}return this.finishOp(e===124?a.logicalOR:a.logicalAND,2)}return t===61?this.finishOp(a.assign,2):this.finishOp(e===124?a.bitwiseOR:a.bitwiseAND,1)};v.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(a.assign,2):this.finishOp(a.bitwiseXOR,1)};v.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||D.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(a.incDec,2):t===61?this.finishOp(a.assign,2):this.finishOp(a.plusMin,1)};v.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(a.assign,i+1):this.finishOp(a.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(a.relational,i))};v.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(a.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(a.arrow)):this.finishOp(e===61?a.eq:a.prefix,1)};v.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(a.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(a.assign,3)}return this.finishOp(a.coalesce,2)}}return this.finishOp(a.question,1)};v.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),K(t,true)||t===92))return this.finishToken(a.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Q(t)+"'");};v.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return ++this.pos,this.finishToken(a.parenL);case 41:return ++this.pos,this.finishToken(a.parenR);case 59:return ++this.pos,this.finishToken(a.semi);case 44:return ++this.pos,this.finishToken(a.comma);case 91:return ++this.pos,this.finishToken(a.bracketL);case 93:return ++this.pos,this.finishToken(a.bracketR);case 123:return ++this.pos,this.finishToken(a.braceL);case 125:return ++this.pos,this.finishToken(a.braceR);case 58:return ++this.pos,this.finishToken(a.colon);case 96:if(this.options.ecmaVersion<6)break;return ++this.pos,this.finishToken(a.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(a.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Q(e)+"'");};v.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};v.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(D.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=false;else {if(r==="[")t=true;else if(r==="]"&&t)t=false;else if(r==="/"&&!t)break;e=r==="\\";}++this.pos;}var s=this.input.slice(i,this.pos);++this.pos;var n=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new z(this));u.reset(i,s,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var h=null;try{h=new RegExp(s,o);}catch{}return this.finishToken(a.regexp,{pattern:s,flags:o,value:h})};v.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,o=0,u=0,h=0,c=t??1/0;h<c;++h,++this.pos){var l=this.input.charCodeAt(this.pos),g=void 0;if(r&&l===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),h===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=l;continue}if(l>=97?g=l-97+10:l>=65?g=l-65+10:l>=48&&l<=57?g=l-48:g=1/0,g>=e)break;u=l,o=o*e+g;}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:o};function zi(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Xt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}v.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Xt(this.input.slice(t,this.pos)),++this.pos):K(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,i)};v.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,true)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Xt(this.input.slice(t,this.pos));return ++this.pos,K(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=false),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),K(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=zi(this.input.slice(t,this.pos),i);return this.finishToken(a.num,n)};v.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds");}else t=this.readHexChar(4);return t};v.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(false),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ue(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos);}return t+=this.input.slice(i,this.pos++),this.finishToken(a.string,t)};var Yt={};v.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken();}catch(e){if(e===Yt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=false;};v.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Yt;this.raise(e,t);};v.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===a.template||this.type===a.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(a.dollarBraceL)):(++this.pos,this.finishToken(a.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(a.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(true),t=this.pos;else if(ue(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
14
|
+
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos;}else ++this.pos;}};v.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case "\\":++this.pos;break;case "$":if(this.input[this.pos+1]!=="{")break;case "`":return this.finishToken(a.invalidTemplate,this.input.slice(this.start,this.pos));case "\r":this.input[this.pos+1]===`
|
|
15
|
+
`&&++this.pos;case `
|
|
16
|
+
`:case "\u2028":case "\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template");};v.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return `
|
|
17
|
+
`;case 114:return "\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Q(this.readCodePoint());case 116:return " ";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string");}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return ue(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};v.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};v.readWord1=function(){this.containsEsc=false;for(var e="",t=true,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if($(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=true,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?K:$)(o,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=Q(o),i=this.pos;}else break;t=false;}return e+this.input.slice(i,this.pos)};v.readWord=function(){var e=this.readWord1(),t=a.name;return this.keywords.test(e)&&(t=qe[e]),this.finishToken(t,e)};var Qi="8.16.0";R.acorn={Parser:R,version:Qi,defaultOptions:Fe,Position:me,SourceLocation:Ee,getLineInfo:bt,Node:Re,TokenType:_,tokTypes:a,keywordTypes:qe,TokContext:q,tokContexts:C,isIdentifierChar:$,isIdentifierStart:K,Token:Xe,isNewLine:ue,lineBreak:D,lineBreakG:gi,nonASCIIwhitespace:yt};function Zt(e,t){return R.parse(e,t)}var le=class extends Error{constructor(i){super(`AST limit exceeded: ${i}`);this.limit=i;this.name="ScanLimitError";}limit},Ye=new Set(["require","__require","__crewxCreateRequire","module","eval","Function","Worker","URL","globalThis","global"]),Xi=new Set(["type","start","end","loc","range"]);function k(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"}function d(e,t){let i=e[t];return k(i)?i:void 0}function A(e,t){let i=e[t];return Array.isArray(i)?i:[]}function Ze(e,t){for(let i of Object.keys(e)){if(Xi.has(i)||e.type==="Property"&&e.shorthand===true&&i==="key")continue;let r=e[i];if(Array.isArray(r))for(let s of r)k(s)&&t(s,i);else k(r)&&t(r,i);}}function W(e){return k(e)&&e.type==="Literal"&&typeof e.value=="string"?e.value:void 0}function w(e){return k(e)&&e.type==="Identifier"&&typeof e.name=="string"?e.name:void 0}function Ne(e,t){return Zt(e,{ecmaVersion:"latest",sourceType:t==="esm"?"module":"script",allowHashBang:true,allowReturnOutsideFunction:t==="commonjs"})}function Jt(e,t=Ye){let i=new Set,r=new Set,s=new Set,n=new Map,o=new Map,u=[],h=[],c=[],l=[],g=[],E=[{node:e,parent:void 0,key:"",depth:1}],y=0;for(let x=E.pop();x!==void 0;x=E.pop()){let{node:S,parent:I,key:N,depth:pe}=x;if(pe>L.maxNestingDepth)throw new le("nesting depth");if(y+=1,y>L.maxAstNodesPerArtifact)throw new le("AST node count");switch(Yi(S,{bindings:i,assignments:r,skipped:s}),S.type){case "ImportDeclaration":u.push(S);break;case "ImportExpression":h.push(S);break;case "ExportNamedDeclaration":case "ExportAllDeclaration":d(S,"source")!==void 0&&c.push(S);break;case "MetaProperty":l.push({node:S,parent:I,key:N});break;case "WithStatement":g.push(S);break;case "CallExpression":{let H=w(d(S,"callee"));H!==void 0&&t.has(H)&&n.set(S,{parent:I,key:N});break}case "Identifier":{let H=w(S);if(H===void 0||!t.has(H)||I===void 0||!Zi(S,I,N,s))break;let ve=Ji(S,I,N,i,r),st=o.get(H)??[];st.push({name:H,node:S,parent:I,key:N,role:ve,callSite:ve==="call"?n.get(I):void 0}),o.set(H,st);break}}Ze(S,(H,ve)=>{E.push({node:H,parent:S,key:ve,depth:pe+1});});}return {program:e,uses:o,importDeclarations:u,importExpressions:h,reexports:c,metaUses:l,withStatements:g,nodeCount:y}}function Yi(e,t){switch(e.type){case "VariableDeclarator":Z(d(e,"id"),t.bindings);break;case "FunctionDeclaration":case "FunctionExpression":case "ArrowFunctionExpression":Z(d(e,"id"),t.bindings);for(let i of A(e,"params"))Z(i,t.bindings);break;case "ClassDeclaration":case "ClassExpression":Z(d(e,"id"),t.bindings);break;case "CatchClause":Z(d(e,"param"),t.bindings);break;case "ImportSpecifier":case "ImportDefaultSpecifier":case "ImportNamespaceSpecifier":Z(d(e,"local"),t.bindings);break;case "AssignmentExpression":Z(d(e,"left"),t.assignments);break;case "UpdateExpression":Z(d(e,"argument"),t.assignments);break;case "ForInStatement":case "ForOfStatement":{let i=d(e,"left");i!==void 0&&i.type!=="VariableDeclaration"&&Z(i,t.assignments);break}case "ExportNamedDeclaration":if(d(e,"source")!==void 0)for(let i of A(e,"specifiers")){let r=k(i)?d(i,"local"):void 0;r!==void 0&&t.skipped.add(r);}break;}}function Z(e,t){let i=[e];for(let r=i.pop();r!==void 0;r=i.pop())if(k(r))switch(r.type){case "Identifier":t.add(r);break;case "ObjectPattern":for(let s of A(r,"properties"))k(s)&&i.push(s.type==="RestElement"?s.argument:s.value);break;case "ArrayPattern":for(let s of A(r,"elements"))i.push(s);break;case "AssignmentPattern":i.push(r.left);break;case "RestElement":i.push(r.argument);break;}}function Zi(e,t,i,r){return !(r.has(e)||t.type==="MemberExpression"&&i==="property"&&t.computed!==true||t.type==="Property"&&i==="key"&&t.computed!==true||(t.type==="MethodDefinition"||t.type==="PropertyDefinition")&&i==="key"&&t.computed!==true||(t.type==="LabeledStatement"||t.type==="BreakStatement"||t.type==="ContinueStatement")&&i==="label"||t.type==="MetaProperty"||t.type==="ImportSpecifier"&&i==="imported"||t.type==="ExportSpecifier"&&i==="exported"||t.type==="ExportAllDeclaration"&&i==="exported")}function Ji(e,t,i,r,s){return r.has(e)?"binding":s.has(e)?"assign":t.type==="CallExpression"&&i==="callee"?"call":t.type==="NewExpression"&&i==="callee"?"new":"other"}var $i=['var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {',' get: (a, b) => (typeof require !== "undefined" ? require : a)[b]',"}) : x)(function(x) {",' if (typeof require !== "undefined") return require.apply(this, arguments);',` throw Error('Dynamic require of "' + x + '" is not supported');`,"});"].join(`
|
|
18
|
+
`),$t=new Set(["start","end","loc","range","raw"]);function ei(e){let[t,i]=e;if(!k(t)||!k(i)||t.type!=="ImportDeclaration"||W(d(t,"source"))!=="node:module"||A(t,"attributes").length!==0)return;let r=A(t,"specifiers"),s=r[0];if(r.length!==1||!k(s)||s.type!=="ImportSpecifier"||w(d(s,"imported"))!=="createRequire")return;let n=d(s,"local");if(n===void 0||w(n)!=="__crewxCreateRequire"||i.type!=="VariableDeclaration"||i.kind!=="const")return;let o=A(i,"declarations"),u=o[0];if(o.length!==1||!k(u))return;let h=d(u,"id");if(h===void 0||w(h)!=="require")return;let c=d(u,"init");if(c===void 0||c.type!=="CallExpression"||c.optional===true)return;let l=d(c,"callee");if(l===void 0||w(l)!=="__crewxCreateRequire")return;let g=A(c,"arguments");if(!(g.length!==1||!$e(g[0])))return {importDeclaration:t,importLocal:n,calleeNode:l,requireId:h}}function ti(e){let t=e.filter(o=>k(o)&&o.type==="VariableDeclaration"&&A(o,"declarations").some(u=>k(u)&&w(d(u,"id"))==="__require")),i=t[0];if(t.length!==1||i===void 0)return;let r=er();if(ii(i,r.count)!==r.count||Te(i)!==r.shape)return;let s=A(i,"declarations")[0],n=k(s)?d(s,"id"):void 0;if(n!==void 0)return {bindingId:n,start:i.start,end:i.end}}function $e(e){if(!k(e)||e.type!=="MemberExpression"||e.computed===true||w(d(e,"property"))!=="url")return false;let t=d(e,"object");return t!==void 0&&t.type==="MetaProperty"&&w(d(t,"meta"))==="import"&&w(d(t,"property"))==="meta"}var Je;function er(){if(Je===void 0){let e=A(Ne($i,"commonjs"),"body")[0];if(!k(e))throw new Error("the esbuild helper constant does not parse to a declaration");Je={shape:Te(e),count:ii(e,Number.POSITIVE_INFINITY)};}return Je}function ii(e,t){let i=[e],r=0;for(let s=i.pop();s!==void 0;s=i.pop()){if(r+=1,r>t)return r;for(let n of Object.keys(s)){if($t.has(n)||n==="type")continue;let o=s[n];if(Array.isArray(o))for(let u of o)k(u)&&i.push(u);else k(o)&&i.push(o);}}return r}function Te(e){if(Array.isArray(e))return `[${e.map(Te).join(",")}]`;if(k(e)){let t=Object.keys(e).filter(i=>i!=="type"&&!$t.has(i)).sort().map(i=>`${i}:${Te(e[i])}`);return `${e.type}{${t.join(",")}}`}return String(JSON.stringify(e))}var tr=new Set(["eval","Function","require","module","Worker"]);function ir(e){let t=sr(e);if(!t.ok)return t.refusal;let i=[],r=0;for(let s of t.artifacts){let n=new rt(s.source),o,u;try{let l=Ne(s.source,s.kind);o=cr(l),u=Jt(l,nr(o));}catch(l){return rr(l,s.path,n)}if(r+=u.nodeCount,r>L.maxAstNodesTotal)return G("LIMIT_EXCEEDED",s.path,"AST node count across artifacts exceeds the limit");let h=new it({path:s.path,kind:s.kind,closure:t.closure,builtins:t.builtins},u,o);if(h.run(),h.findings.length>0){let l=h.findings.reduce((g,E)=>E.offset<g.offset?E:g);return G(l.code,s.path,l.detail,n.locate(l.offset))}let c=[...h.references].sort((l,g)=>l.offset-g.offset);for(let l of c)i.push({from:s.path,kind:l.kind,target:l.target,loc:n.locate(l.offset)});}return {ok:true,references:i}}function G(e,t,i,r){return r===void 0?{ok:false,code:e,path:t,detail:i}:{ok:false,code:e,path:t,loc:r,detail:i}}function rr(e,t,i){if(e instanceof le)return G("LIMIT_EXCEEDED",t,`artifact exceeds the ${e.limit} limit`);if(e instanceof RangeError)return G("LIMIT_EXCEEDED",t,"artifact nesting exceeds the parser stack");if(e instanceof SyntaxError){let r=e.pos,s=typeof r=="number"?i.locate(r):void 0;return G("PARSE_FAILED",t,"artifact source does not parse as its declared kind",s)}throw e}function sr(e){if(typeof e!="object"||e===null)return P("","input must be an object");let{artifacts:t,closurePaths:i,builtins:r}=e;if(!Array.isArray(t)||!Array.isArray(i)||!Array.isArray(r))return P("","artifacts, closurePaths and builtins must be arrays");if(t.length>L.maxExecutableArtifacts)return et("too many executable artifacts");if(i.length>L.maxClosurePaths)return et("too many closure paths");if(r.length>L.maxBuiltinSelections)return et("too many built-in selections");let s=new tt,n=[];for(let y of i){if(typeof y!="string")return P("","closure paths must be strings");let x=s.charge(y,L.maxPathLength,"closure path");if(x!==void 0)return {ok:false,refusal:x};n.push(y);}n.sort();for(let y=0;y<n.length;y+=1){let x=n[y],S=Le(x);if(S!==void 0)return P(x,`closure path: ${S}`);if(y>0&&n[y-1]===x)return P(x,"duplicate closure path")}let o=new Set(n),u=new Map,h=[];for(let y of r){if(typeof y!="string")return P("","builtin names must be strings");let x=s.charge(y,L.maxBuiltinNameLength,"built-in name");if(x!==void 0)return {ok:false,refusal:x};h.push(y);}h.sort();for(let y of h){let x=ut(y);if(x===void 0)return P("","builtin name is not a Node built-in module");if(u.has(x))return P("","builtin is selected twice, with and without node:");u.set(x,y);}let c=[];for(let y of t){if(typeof y!="object"||y===null)return P("","artifact must be an object");let x=y,S=x.path;if(typeof S!="string")return P("","artifact path must be a string");let I=s.charge(S,L.maxPathLength,"artifact path");if(I!==void 0)return {ok:false,refusal:I};c.push(x);}c.sort((y,x)=>ar(y.path,x.path));let l=[],g=new Set,E=0;for(let y of c){let x=y.path,S=Le(x);if(S!==void 0)return P(x,`artifact path: ${S}`);if(!fe(x))return P(x,"artifact must be a .js, .mjs or .cjs module");if(g.has(x))return P(x,"duplicate artifact path");g.add(x);let I=y.kind;if(I!=="esm"&&I!=="commonjs")return P(x,"artifact kind must be esm or commonjs");let N=y.source;if(typeof N!="string")return P(x,"artifact source must be a string");let pe=Ve(N);if(pe>L.maxSourceBytesPerArtifact)return {ok:false,refusal:G("LIMIT_EXCEEDED",x,"artifact source exceeds the per-artifact byte limit")};if(E+=pe,E>L.maxSourceBytesTotal)return {ok:false,refusal:G("LIMIT_EXCEEDED",x,"artifact sources exceed the total byte limit")};if(!o.has(x))return P(x,"artifact is not a closure path");l.push({path:x,kind:I,source:N});}for(let y of n)if(fe(y)&&!g.has(y))return P(y,"closure module has no artifact source");return {ok:true,artifacts:l,closure:o,builtins:u}}function P(e,t){return {ok:false,refusal:G("INPUT_INVALID",e,t)}}function et(e){return {ok:false,refusal:G("LIMIT_EXCEEDED","",e)}}var tt=class{bytes=0;charge(t,i,r){if(t.length>i)return G("LIMIT_EXCEEDED","",`${r} exceeds the length limit`);if(this.bytes+=Ve(t),this.bytes>L.maxMetadataBytes)return G("LIMIT_EXCEEDED","","path and name metadata exceeds the aggregate byte limit")}};function ar(e,t){let i=typeof e=="string"?e:"",r=typeof t=="string"?t:"";return i<r?-1:i>r?1:0}function nr(e){let t=new Set(Ye);for(let i of e){let r=w(i);r!==void 0&&t.add(r);}return t}var it=class{constructor(t,i,r){this.environment=t;this.scan=i;this.workerLocals=r;}environment;scan;workerLocals;findings=[];references=[];banner;helper;urlShadowed=false;run(){let t=A(this.scan.program,"body");this.banner=this.environment.kind==="esm"?ei(t):void 0,this.helper=ti(t),this.urlShadowed=this.usesOf("URL").some(i=>i.role==="binding"||i.role==="assign");for(let i of this.scan.importDeclarations)this.checkImportDeclaration(i);for(let i of this.scan.reexports)this.checkReexport(i);for(let i of this.scan.importExpressions)this.checkImportExpression(i);for(let i of this.scan.withStatements)this.refuse("BINDING_AMBIGUOUS",i.start,"with statement can rebind names at run time");this.checkLoaderUses("require"),this.checkLoaderUses("__require"),this.checkBannerLoader(),this.checkWorkerUses(),this.checkMetaUses(),this.checkCodeUses();}usesOf(t){return this.scan.uses.get(t)??[]}refuse(t,i,r){this.findings.push({code:t,offset:i,detail:r});}reference(t,i,r){this.references.push({kind:t,target:i,offset:r});}checkImportDeclaration(t){let i=t.start,r=W(d(t,"source"));if(r===void 0)return this.refuse("UNSUPPORTED_LOADER",i,"import source is not a string literal");if(this.banner!==void 0&&t===this.banner.importDeclaration){let o=this.builtinTarget("module");o.ok?this.reference("import",o.target,i):this.refuse("BUILTIN_NOT_SELECTED",i,"node:module is needed by the App banner and is not selected");return}let s=ie(r);if(s.kind==="builtin"&&s.name==="worker_threads"){let o=hr(t);if(o!==void 0)return this.refuse("WORKER_UNSUPPORTED",i,o)}let n=this.resolveModule(r,ri(t),"import");n.ok?this.reference("import",n.target,i):this.refuse(n.code,i,n.detail);}checkReexport(t){let i=t.start,r=W(d(t,"source"));if(r===void 0)return this.refuse("UNSUPPORTED_LOADER",i,"re-export source is not a string literal");let s=ie(r);if(s.kind==="builtin"&&s.name==="worker_threads"){let o=t.type==="ExportAllDeclaration",u=A(t,"specifiers").some(h=>k(h)&&w(d(h,"local"))==="Worker");if(o||u)return this.refuse("WORKER_UNSUPPORTED",i,"re-export of node:worker_threads would expose Worker")}let n=this.resolveModule(r,ri(t),"import");n.ok?this.reference("reexport",n.target,i):this.refuse(n.code,i,n.detail);}checkImportExpression(t){let i=t.start,r=d(t,"source"),s=W(r),n="dynamic-import";if(s===void 0){let c=ur(r)?si(d(r,"object")):void 0;if(c===void 0)return this.refuse("UNSUPPORTED_LOADER",i,"dynamic import target is not a literal or new URL(literal, import.meta.url).href");if(this.urlShadowed)return this.refuse("BINDING_AMBIGUOUS",i,"URL is declared in this artifact");if(!ai(c))return this.refuse("UNSUPPORTED_LOADER",i,"URL import target must be a relative literal");s=c,n="url-import";}let o=or(d(t,"options")),u=ie(s);if(u.kind==="builtin"&&u.name==="worker_threads")return this.refuse("WORKER_UNSUPPORTED",i,"dynamic import of node:worker_threads would expose Worker");let h=this.resolveModule(s,o,"import");h.ok?this.reference(n,h.target,i):this.refuse(h.code,i,h.detail);}checkLoaderUses(t){let i=t==="require"?this.banner?.requireId:this.helper?.bindingId,r=t==="require"&&this.environment.kind==="commonjs";for(let s of this.usesOf(t)){if(this.helper!==void 0&&s.node.start>=this.helper.start&&s.node.end<=this.helper.end)continue;let n=s.node.start;if(s.role==="binding")s.node!==i&&this.refuse("BINDING_AMBIGUOUS",n,`${t} is declared outside the App banner or esbuild helper`);else if(s.role==="assign")this.refuse("BINDING_AMBIGUOUS",n,`${t} is reassigned`);else {if(hi(s))continue;i===void 0&&!r?this.refuse("UNSUPPORTED_LOADER",n,`${t} is not bound in this artifact`):s.role==="call"?this.checkLoaderCall(t,s):this.refuse("UNSUPPORTED_LOADER",n,`${t} is used other than as a direct call with one string literal`);}}}checkLoaderCall(t,i){let r=i.parent,s=r.start,n=A(r,"arguments"),o=W(n[0]);if(r.optional===true||n.length!==1||o===void 0)return this.refuse("UNSUPPORTED_LOADER",s,`${t} call with a computed or optional argument`);let u=ie(o);if(u.kind==="builtin"&&u.name==="worker_threads"){let c=pr(i.callSite);if(c!==void 0)return this.refuse("WORKER_UNSUPPORTED",s,c)}let h=this.resolveModule(o,"none","require");h.ok?this.reference("require",h.target,s):this.refuse(h.code,s,h.detail);}checkBannerLoader(){for(let t of this.usesOf("__crewxCreateRequire")){let i=this.banner;i!==void 0&&(t.node===i.importLocal||t.role==="call"&&t.node===i.calleeNode)||(t.role==="binding"||t.role==="assign"?this.refuse("BINDING_AMBIGUOUS",t.node.start,"__crewxCreateRequire is declared outside the App banner"):this.refuse("UNSUPPORTED_LOADER",t.node.start,"createRequire is reachable only through the App banner"));}}checkWorkerUses(){let t=new Map;for(let i of this.workerLocals){let r=w(i);if(r===void 0)continue;let s=t.get(r)??new Set;s.size>0&&this.refuse("BINDING_AMBIGUOUS",i.start,`${r} is bound to node:worker_threads more than once`),s.add(i),t.set(r,s);}for(let i of new Set(["Worker",...t.keys()])){let r=t.get(i)??new Set;for(let s of this.usesOf(i)){let n=s.node.start;s.role==="binding"?r.has(s.node)||this.refuse("BINDING_AMBIGUOUS",n,`${i} is declared outside node:worker_threads`):s.role==="assign"?this.refuse("BINDING_AMBIGUOUS",n,`${i} is reassigned`):s.role==="new"&&r.size>0?this.checkWorkerNew(s.parent):s.role==="new"?this.refuse("WORKER_UNSUPPORTED",n,`${i} is not bound to node:worker_threads`):this.refuse("WORKER_UNSUPPORTED",n,`${i} is used other than as new ${i}(new URL(...))`);}}}checkWorkerNew(t){let i=t.start,r=A(t,"arguments");if(r.length<1||r.length>2||r.some(h=>!k(h)||h.type==="SpreadElement"))return this.refuse("WORKER_UNSUPPORTED",i,"Worker takes new URL(relative, import.meta.url) and an optional options object");let s=r[0],n=k(s)?si(s):void 0;if(n===void 0)return this.refuse("WORKER_UNSUPPORTED",i,"Worker target is not new URL(relative, import.meta.url)");if(this.urlShadowed)return this.refuse("BINDING_AMBIGUOUS",i,"URL is declared in this artifact");if(!ai(n))return this.refuse("WORKER_UNSUPPORTED",i,"Worker target must be a relative literal");if(r.length===2){let h=fr(r[1]);if(h!==void 0)return this.refuse("WORKER_UNSUPPORTED",i,h)}let o=Oe(this.environment.path,n);if("code"in o)return this.refuse(o.code,i,o.detail);let u=o.path;if(u.endsWith(".node"))return this.refuse("UNSUPPORTED_LOADER",i,"native addon target");if(!this.environment.closure.has(u))return this.refuse("TARGET_OUTSIDE_CLOSURE",i,"Worker target is not a closure path");if(!fe(u))return this.refuse("WORKER_UNSUPPORTED",i,"Worker target is not a .js, .mjs or .cjs module");this.reference("worker",{path:u},i);}checkMetaUses(){for(let t of this.scan.metaUses){let i=t.parent;i!==void 0&&i.type==="MemberExpression"&&t.key==="object"&&i.computed!==true&&w(d(i,"property"))==="url"||this.refuse("UNSUPPORTED_LOADER",t.node.start,"import.meta is supported only as import.meta.url");}}checkCodeUses(){for(let t of this.usesOf("eval"))this.refuse("UNSUPPORTED_LOADER",t.node.start,"eval runs code from a string");for(let t of this.usesOf("Function"))dr(t)||(t.role==="binding"||t.role==="assign"?this.refuse("BINDING_AMBIGUOUS",t.node.start,"Function is declared or reassigned in this artifact"):this.refuse("UNSUPPORTED_LOADER",t.node.start,"Function can build code from a string; only instanceof and typeof tests are allowed"));for(let t of this.usesOf("module"))ni(t)&&(t.parent.computed===true||w(d(t.parent,"property"))==="require")&&this.refuse("UNSUPPORTED_LOADER",t.node.start,"module.require and computed module access are not supported");for(let t of ["globalThis","global"])for(let i of this.usesOf(t)){if(!ni(i))continue;let r=w(d(i.parent,"property"));(i.parent.computed===true||r!==void 0&&tr.has(r))&&this.refuse("UNSUPPORTED_LOADER",i.node.start,`${t} reaches a loader through a property`);}}resolveModule(t,i,r){let s=ie(t);if(s.kind==="refused")return {ok:false,code:s.code,detail:s.detail};if(s.kind==="builtin")return i!=="none"?{ok:false,code:"UNSUPPORTED_LOADER",detail:"built-in imports take no import attributes"}:s.name==="module"?{ok:false,code:"UNSUPPORTED_LOADER",detail:"node:module is reachable only through the App banner"}:this.builtinTarget(s.name);if(i==="invalid")return {ok:false,code:"UNSUPPORTED_LOADER",detail:"unsupported import attributes"};let n=Oe(this.environment.path,t);if("code"in n)return {ok:false,code:n.code,detail:n.detail};let o=n.path;if(o.endsWith(".node"))return {ok:false,code:"UNSUPPORTED_LOADER",detail:"native addon target"};if(!this.environment.closure.has(o))return {ok:false,code:"TARGET_OUTSIDE_CLOSURE",detail:"target is not a closure path"};if(o.endsWith(".json")){if(r==="import"&&i!=="json")return {ok:false,code:"UNSUPPORTED_LOADER",detail:"JSON import needs the type json attribute"}}else if(fe(o)){if(i==="json")return {ok:false,code:"UNSUPPORTED_LOADER",detail:"type json attribute on a non-JSON target"}}else return {ok:false,code:"UNSUPPORTED_LOADER",detail:"target extension is not .js, .mjs, .cjs or .json"};return {ok:true,target:{path:o}}}builtinTarget(t){let i=this.environment.builtins.get(t);return i===void 0?{ok:false,code:"BUILTIN_NOT_SELECTED",detail:"built-in is not selected by the Host"}:{ok:true,target:{builtin:i}}}};function ri(e){return oi(A(e,"attributes"))}function oi(e){if(e.length===0)return "none";if(e.length!==1)return "invalid";let t=e[0];return k(t)&&ye(t)==="type"&&W(d(t,"value"))==="json"?"json":"invalid"}function or(e){if(e===void 0)return "none";if(e.type!=="ObjectExpression")return "invalid";let t=A(e,"properties");if(t.length===0)return "none";let i=t[0];if(t.length!==1||!k(i)||i.type!=="Property"||ye(i)!=="with")return "invalid";let r=d(i,"value");if(r===void 0||r.type!=="ObjectExpression")return "invalid";let s=A(r,"properties");return s.length===0?"none":oi(s)}function si(e){if(e===void 0||e.type!=="NewExpression"||w(d(e,"callee"))!=="URL")return;let t=A(e,"arguments");if(!(t.length!==2||!$e(t[1])))return W(t[0])}function ur(e){return e!==void 0&&e.type==="MemberExpression"&&e.computed!==true&&w(d(e,"property"))==="href"&&d(e,"object")!==void 0}function ai(e){return e.startsWith("./")||e.startsWith("../")}function ye(e){if(e.computed===true)return;let t=d(e,"key");return w(t)??W(t)}function hr(e){for(let t of A(e,"specifiers"))if(!k(t)||t.type!=="ImportSpecifier")return "default or namespace import of node:worker_threads would expose Worker"}function cr(e){let t=[],i=[e];for(let r=i.pop();r!==void 0;r=i.pop()){if(r.type==="ImportDeclaration"&&ui(d(r,"source")))for(let s of A(r,"specifiers")){if(!k(s)||s.type!=="ImportSpecifier")continue;let n=w(d(s,"imported"))??W(d(s,"imported")),o=d(s,"local");n==="Worker"&&o!==void 0&&t.push(o);}else if(r.type==="VariableDeclarator"&&lr(d(r,"init"))){let s=d(r,"id");if(s?.type==="ObjectPattern")for(let n of A(s,"properties")){if(!k(n)||n.type!=="Property"||ye(n)!=="Worker")continue;let o=d(n,"value");o?.type==="Identifier"&&t.push(o);}}Ze(r,s=>{i.push(s);});}return t}function ui(e){let t=W(e);if(t===void 0)return false;let i=ie(t);return i.kind==="builtin"&&i.name==="worker_threads"}function lr(e){if(e===void 0||e.type!=="CallExpression"||w(d(e,"callee"))!=="require")return false;let t=A(e,"arguments");return t.length===1&&ui(t[0])}function pr(e){let t=e?.parent;if(t===void 0||t.type!=="VariableDeclarator"||e?.key!=="init")return "node:worker_threads must be destructured in a variable declaration";let i=d(t,"id");if(i===void 0||i.type!=="ObjectPattern")return "node:worker_threads must be destructured";for(let r of A(i,"properties")){if(!k(r))continue;if(r.type!=="Property")return "rest element of node:worker_threads may expose Worker";let s=ye(r);if(s===void 0)return "computed key of node:worker_threads may expose Worker";if(s!=="Worker")continue;let n=d(r,"value");if(n===void 0||n.type!=="Identifier")return "Worker must be destructured into a plain identifier"}}function fr(e){if(!k(e)||e.type!=="ObjectExpression")return "Worker options must be an object literal";for(let t of A(e,"properties")){if(!k(t)||t.type!=="Property")return "Worker options must not spread values";let i=ye(t);if(i===void 0)return "Worker options must not use computed keys";if(i==="eval"||i==="execArgv")return "Worker eval and execArgv options are not supported"}}function dr(e){if(e.role!=="other")return false;let{parent:t,key:i}=e;return t.type==="BinaryExpression"&&t.operator==="instanceof"&&i==="right"?true:hi(e)}function hi(e){return e.role==="other"&&e.parent.type==="UnaryExpression"&&e.parent.operator==="typeof"&&e.key==="argument"}function ni(e){return e.role==="other"&&e.parent.type==="MemberExpression"&&e.key==="object"}var rt=class{constructor(t){this.source=t;}source;starts;locate(t){let i=this.lineStarts(),r=0,s=i.length-1;for(;r<s;){let n=r+s+1>>1;i[n]<=t?r=n:s=n-1;}return {offset:t,line:r+1,column:t-i[r]+1}}lineStarts(){if(this.starts===void 0){let t=[0];for(let i=0;i<this.source.length;i+=1){let r=this.source.charCodeAt(i);(r===10||r===8232||r===8233||r===13&&this.source.charCodeAt(i+1)!==10)&&t.push(i+1);}this.starts=t;}return this.starts}};export{L as APP_RUNTIME_LIMITS,ci as APP_RUNTIME_POLICY_VERSION,li as APP_RUNTIME_REFUSAL_CODES,ir as checkAppRuntimeReferences};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import*as p from'path';import p__default,{join}from'path';import {fileURLToPath}from'url';import {createHash}from'crypto';import {readFileSync,unlinkSync,mkdirSync,writeFileSync,existsSync,statSync}from'fs';import {homedir}from'os';import {execFile,spawn}from'child_process';import {StringDecoder}from'string_decoder';import {createRequire}from'module';var B=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var q=()=>fileURLToPath(import.meta.url),Xe=()=>p__default.dirname(q()),P=Xe(),S=q();var m=class extends Error{code;constructor(t,n){super(`${t}: ${n}`),this.code=t,this.name="ShortcutError";}};var Q={existsSync:e=>existsSync(e),readFileSync:e=>readFileSync(e,"utf8"),readBinaryFileSync:e=>new Uint8Array(readFileSync(e)),writeFileSync:(e,t)=>writeFileSync(e,t,"utf8"),mkdirSync:e=>{mkdirSync(e,{recursive:true});},unlinkSync:e=>{unlinkSync(e);}},Z=homedir;function N(e){return typeof e!="string"?void 0:e.trim()||void 0}function T(e){return N(e)?.toLowerCase()??""}function b(e){try{return statSync(e).isFile()}catch{return false}}function Qe(e,t){if(e===t)return true;let n=p__default.relative(e,t);return n!==""&&!n.startsWith("..")&&!p__default.isAbsolute(n)}function Ze(e,t){if(p__default.basename(e)!==".bin")return false;let n=p__default.dirname(e);if(p__default.basename(n)!=="node_modules")return false;let r=p__default.dirname(n);return Qe(r,t)}function ee(e,t={}){if(e.includes("/")||e.includes("\\")||p__default.isAbsolute(e))return e;let n=t.platform??process.platform,r=t.env??process.env,o=p__default.resolve(t.cwd??process.cwd()),c=(t.resolution??"global_first")==="global_first",s=r.PATH??r.Path??process.env.PATH??process.env.Path??"",i=n==="win32"?";":":",a=s.split(i).map(u=>u.trim()).filter(Boolean),l=p__default.extname(e).length>0,d=r.PATHEXT??r.Pathext??process.env.PATHEXT??process.env.Pathext??".EXE;.CMD;.BAT;.COM",f=n==="win32"?l?[""]:d.split(";").map(u=>u.trim()).filter(Boolean).map(u=>u.startsWith(".")?u:`.${u}`):[""];for(let u of a){let E=p__default.resolve(o,u);if(!(c&&Ze(E,o)))for(let h of f){let C=T(h),w=h.toUpperCase();for(let g of [h,C,w]){let R=p__default.join(E,`${e}${g}`);if(b(R))return R}}}return e}function et(e){if(!b(e))return null;try{let t=readFileSync(e,"utf8"),n=p__default.dirname(e),r=[];for(let i of t.matchAll(/"([^"\r\n]*)"/g)){let d=(i[1]??"").match(/%~?dp0%?\s*[\\/]*(.*)$/i)?.[1]?.trim();if(!d)continue;let f=d.replace(/[\\/]+/g,p__default.sep).replace(/^[\\/]+/,""),u=p__default.resolve(n,f);b(u)&&r.push(u);}let o=[],c=new Map;for(let i of t.matchAll(/SET\s+"(\w+)=%~?dp0%?[\\/]?([^"]+)"/gi)){let a=i[1].toUpperCase(),l=i[2].trim().replace(/[\\/]+/g,p__default.sep).replace(/^[\\/]+/,"");c.set(a,p__default.resolve(n,l));}for(let i of t.split(/\r?\n/))if(i.includes("%*"))for(let a of i.matchAll(/"%(\w+)%"/g)){let l=c.get(a[1].toUpperCase());l&&b(l)&&o.push(l);}let s=i=>i.find(a=>{let l=T(p__default.basename(a));return l!=="node.exe"&&l!=="node"})??null;return s(o)??s(r)}catch{return null}}function tt(e,t){if(typeof t=="string")return N(t)||null;if(!t||typeof t!="object")return null;if(e){let n=t[e],r=typeof n=="string"?N(n):void 0;if(r)return r}for(let n of Object.values(t)){let r=typeof n=="string"?N(n):void 0;if(r)return r}return null}function nt(e,t){if(!t)return null;let n=p__default.dirname(e),r=[p__default.resolve(n,"..",t),p__default.resolve(n,"node_modules",t)];for(let o of r){let c=p__default.join(o,"package.json");if(b(c))try{let s=JSON.parse(readFileSync(c,"utf8")),i=tt(t,s.bin);if(!i)continue;let a=p__default.resolve(o,i);if(b(a))return a}catch{}}return null}function rt(e){let t=e.platform??process.platform,n=e.env??process.env,r=e.execPath??process.execPath,o=e.cwd,c=e.resolution;if(t!=="win32")return {command:ee(e.command,{cwd:o,env:n,platform:t,resolution:c}),leadingArgv:[],resolution:"direct"};let s=ee(e.command,{cwd:o,env:n,platform:t,resolution:c}),i=T(p__default.extname(s));if(i===".js"||i===".cjs"||i===".mjs")return {command:r,leadingArgv:[s],resolution:"node-entrypoint",windowsHide:true};if(i===".cmd"||i===".bat"){let a=et(s)??nt(s,e.packageName);return a?T(p__default.extname(a))===".exe"?{command:a,leadingArgv:[],resolution:"exe-entrypoint",windowsHide:true}:{command:r,leadingArgv:[a],resolution:"node-entrypoint",windowsHide:true}:{command:s,leadingArgv:[],resolution:"unresolved-wrapper"}}return {command:s,leadingArgv:[],resolution:"direct",windowsHide:true}}function ot(e){if(e.candidate.resolution!=="unresolved-wrapper")return {command:e.candidate.command,leadingArgv:e.candidate.leadingArgv,resolution:e.candidate.resolution,windowsHide:e.candidate.windowsHide};throw new Error(`${p__default.basename(e.candidate.command)} wrapper resolved, but no executable/Node entrypoint could be resolved without shell execution.`)}function ne(e){let t=rt(e);return ot({candidate:t})}function re(e,t){return {command:e.command,argv:[...e.leadingArgv,...t],resolution:e.resolution,shell:e.shell,windowsHide:e.windowsHide}}var A="\uFFFD",$=8,se=1e3,it=new Map([[437,"ibm437"],[720,"ibm720"],[737,"ibm737"],[775,"ibm775"],[850,"ibm850"],[852,"ibm852"],[855,"ibm855"],[857,"ibm857"],[858,"ibm858"],[862,"ibm862"],[864,"ibm864"],[932,"shift_jis"],[936,"gb18030"],[949,"euc-kr"],[950,"big5"],[866,"ibm866"],[869,"ibm869"],[1250,"windows-1250"],[1251,"windows-1251"],[1252,"windows-1252"],[1253,"windows-1253"],[1254,"windows-1254"],[1255,"windows-1255"],[1256,"windows-1256"],[1257,"windows-1257"],[1258,"windows-1258"]]),D;function U(e){let t=0;for(let n of e)n===A&&(t+=1);return t}function H(e,t){return U(t)<U(e)?t:e}function at(e){let t=e.match(/(?:^|[^0-9])([0-9]{1,5})(?![0-9])/);if(!t)return null;let n=Number(t[1]);return Number.isInteger(n)&&n>0&&n<=65535?n:null}function ct(e){if(e!==65001)return it.get(e)}function lt(e){let t=ct(e);if(!t)return null;try{return new TextDecoder(t)}catch{return null}}function ut(){return new Promise(e=>{let t=false,n,r=o=>{t||(t=true,n&&clearTimeout(n),e(o));};n=setTimeout(()=>r(null),se),n.unref();try{execFile("chcp.com",[],{encoding:"ascii",timeout:se,windowsHide:!0},(c,s)=>{if(c){r(null);return}r(at(String(s)));}).once("error",()=>r(null));}catch{r(null);}})}function ce(){return process.platform!=="win32"?Promise.resolve(null):(D||(D=ut(),D.then(e=>{},()=>{})),D)}function dt(){process.platform==="win32"&&ce();}function ae(e,t){if(t.length>=$)return t.subarray(t.length-$);let n=$-t.length,r=e.length>n?e.subarray(e.length-n):e;return Buffer.concat([r,t])}var k=class{platform;detectCodePage;utf8Decoder=new StringDecoder("utf8");codePage;fallbackDecoder;replayTail=Buffer.alloc(0);pendingUtf8="";pendingFallback="";pendingBytes=Buffer.alloc(0);queue=Promise.resolve();ended=false;constructor(t={}){this.platform=t.platform??process.platform,this.detectCodePage=t.detectCodePage??ce,this.codePage=t.codePage;}write(t){let n=Buffer.from(t);return this.enqueue(()=>this.decodeChunk(n))}end(){return this.enqueue(()=>this.finish())}enqueue(t){let n=this.queue.then(t);return this.queue=n.then(()=>{},()=>{}),n}clearPendingCandidate(){this.pendingUtf8="",this.pendingFallback="",this.pendingBytes=Buffer.alloc(0);}async resolveCodePage(){if(this.codePage!==void 0)return this.codePage;try{this.codePage=await this.detectCodePage();}catch{this.codePage=null;}return this.codePage}async getFallbackDecoder(){if(this.fallbackDecoder!==void 0)return this.fallbackDecoder;let t=await this.resolveCodePage();return this.fallbackDecoder=t===null?null:lt(t),this.fallbackDecoder}async decodeChunk(t){if(this.ended)return "";let n=this.utf8Decoder.write(t),r=n.includes(A);if(r&&(this.utf8Decoder=new StringDecoder("utf8")),this.platform!=="win32")return n;if(this.fallbackDecoder){let a=this.fallbackDecoder.decode(t,{stream:true}),l=ae(this.pendingBytes,t);if(r){let d=this.pendingUtf8+n,f=this.pendingFallback+a;return this.clearPendingCandidate(),H(d,f)}if(U(a)>0){let d=this.pendingUtf8+n;return this.clearPendingCandidate(),this.fallbackDecoder=void 0,this.replayTail=l,d}if(this.pendingUtf8||this.pendingFallback){if(this.pendingUtf8+=n,this.pendingFallback+=a,this.pendingBytes=l,n.length===0||a.length===0)return "";let d=this.pendingUtf8;return this.clearPendingCandidate(),d}return n.length===0&&a.length>0?(this.pendingUtf8=n,this.pendingFallback=a,this.pendingBytes=l,""):n}let o=this.replayTail;if(this.fallbackDecoder===void 0&&(this.replayTail=ae(this.replayTail,t)),!r)return n;let c=this.fallbackDecoder===void 0,s=await this.getFallbackDecoder();if(!s)return this.replayTail=Buffer.alloc(0),n;c&&o.length>0&&s.decode(o,{stream:true}),this.replayTail=Buffer.alloc(0);let i=s.decode(t,{stream:true});return H(n,i)}async finish(){if(this.ended)return "";this.ended=true;let t=this.utf8Decoder.end();if(this.platform!=="win32")return t;if(this.fallbackDecoder===void 0&&t.includes(A)){let c=await this.getFallbackDecoder();c&&this.replayTail.length>0&&(c.decode(this.replayTail,{stream:true}),this.replayTail=Buffer.alloc(0));}let n=this.pendingUtf8+t,r=this.fallbackDecoder?.decode()??"",o=this.pendingFallback+r;return this.clearPendingCandidate(),n.includes(A)?H(n,o):n}};dt();var le=3e3;var pt=2e3,mt=25,ht=100;function fe(e){return e instanceof Error?e:e===void 0?void 0:new Error(String(e))}function ue(e){return typeof e=="object"&&e!==null&&"code"in e?String(e.code):void 0}function wt(e){return Number.isSafeInteger(e)&&e>0}function gt(e,t){return new Promise(n=>{let r;try{r=spawn(e,t,{windowsHide:!0});}catch(l){n({status:null,stdout:"",stderr:"",error:fe(l)});return}let o="",c="",s=false,i,a=setTimeout(()=>{try{r.kill();}catch{}i({status:null,stdout:o,stderr:c,error:new Error(`Command timed out after ${le}ms`)});},le);i=l=>{s||(s=true,clearTimeout(a),n(l));},r.stdout?.setEncoding("utf8"),r.stderr?.setEncoding("utf8"),r.stdout?.on("data",l=>{o+=String(l);}),r.stderr?.on("data",l=>{c+=String(l);}),r.once("error",l=>{i({status:null,stdout:o,stderr:c,error:l});}),r.once("close",l=>{i({status:l,stdout:o,stderr:c});});})}async function Pt(e,t,n){return n.runCommandAsync?n.runCommandAsync(e,t):n.runCommand?n.runCommand(e,t):gt(e,t)}function St(e){return new Promise(t=>{setTimeout(t,Math.max(0,e));})}function Et(){return new Promise(e=>{setImmediate(e);})}function W(e,t=process.kill){try{return t(e,0),"alive"}catch(n){return ue(n)==="ESRCH"?"not_found":ue(n)==="EPERM"?"alive":"unknown"}}function yt(e,t){let n=W(-e,t),r=W(e,t);return n==="alive"||r==="alive"?"alive":n==="unknown"||r==="unknown"?"unknown":"not_found"}async function pe(e,t,n,r){let o=Math.max(0,n),c=Math.max(1,r.pollIntervalMs??mt),s=Date.now()+o,i,a=o===0,l=r.sleep?Promise.resolve().then(()=>r.sleep(o)).then(()=>{},()=>{}):new Promise(d=>{i=setTimeout(d,o);});l.then(()=>{a=true;});try{for(await Et();;){let d=yt(e,t);if(d==="not_found")return d;let f=s-Date.now();if(a||f<=0)return d;await Promise.race([l,St(Math.min(c,f))]);}}finally{i!==void 0&&clearTimeout(i);}}async function de(e,t,n,r,o){let c=await pe(e,t,o.hardConfirmMs??ht,{...o,sleep:void 0});return c==="not_found"?n?{status:"not_found",pid:e,method:r}:{status:"terminated",pid:e,method:r}:c==="alive"?{status:"failed",pid:e,method:r,error:"Process is still running after termination attempt"}:{status:"failed",pid:e,method:r,error:"Unable to verify process termination"}}async function me(e,t={}){let n=t.platform??process.platform,r=n==="win32"?"taskkill":"process-group",o=u=>({status:"failed",pid:e,method:r,error:u});if(!wt(e))return o("Invalid process ID");let c=t.kill??process.kill,s=W(e,c);if(s==="not_found")return {status:"not_found",pid:e,method:r};if(s!=="alive")return o("Unable to determine whether the process is alive");if(n==="win32"){let u;try{u=await Pt("taskkill",["/PID",String(e),"/T","/F"],t);}catch(h){u={status:null,stdout:"",stderr:"",error:fe(h)};}let E=W(e,c);return E==="not_found"?u.status===0&&!u.error?{status:"terminated",pid:e,method:r}:{status:"not_found",pid:e,method:r}:o(E==="alive"?"Process is still running after termination attempt":"Unable to verify process termination")}let i,a=t.signal??"SIGKILL";try{c(-e,a);}catch(u){i=u;}if(a==="SIGKILL")return de(e,c,i,r,t);if(await pe(e,c,t.graceMs??pt,t)==="not_found")return i?{status:"not_found",pid:e,method:r}:{status:"terminated",pid:e,method:r};let d;try{c(-e,"SIGKILL");}catch(u){d=u;}let f=await de(e,c,d,r,t);return f.status==="terminated"?f:f.status==="not_found"?i?f:{status:"terminated",pid:e,method:r}:o(f.error??"Process termination failed")}var Ct=["CREWX_ASSIGNED_TASK_ID","CREWX_DETACHED_RUNNER"];function Rt(e,t){let n={};for(let[r,o]of Object.entries(e))o!==void 0&&(t.includes(r)||(n[r]=o));return n}function he(e){return Rt(e,Ct)}var we=3e4;function ge(e){if(typeof e.pid!="number"){try{e.kill();}catch{}return}me(e.pid,{signal:"SIGKILL"}).then(t=>{if(t.status==="failed")try{e.kill("SIGKILL");}catch{}},()=>{try{e.kill("SIGKILL");}catch{}});}var Pe=(e,t,n={})=>new Promise((r,o)=>{let c=he(n.env??process.env),s=process.platform,i;try{let g=ne({command:e,platform:s,env:c,cwd:n.cwd,allowShellFallback:!1});i=re(g,t);}catch(g){o(g instanceof Error?g:new Error(String(g)));return}let a=spawn(i.command,i.argv,{cwd:n.cwd,env:c,shell:i.shell,windowsHide:i.windowsHide??true,detached:s!=="win32"}),l="",d="",f=false,u=new k({platform:s}),E=new k({platform:s}),h=Promise.resolve(),C=Promise.resolve(),w=setTimeout(()=>{f||(f=true,ge(a),o(new Error(`Command timed out after ${n.timeoutMs??we}ms: ${e} ${t.join(" ")}`)));},n.timeoutMs??we);a.stdout?.on("data",g=>{h=h.then(async()=>{l+=await u.write(g);});}),a.stderr?.on("data",g=>{C=C.then(async()=>{d+=await E.write(g);});}),a.on("error",g=>{f||(f=true,clearTimeout(w),o(g));}),a.on("close",g=>{f||(async()=>{await Promise.all([h,C]);let[R,He]=await Promise.all([u.end(),E.end()]);f||(l+=R,d+=He,f=true,clearTimeout(w),r({code:g??0,stdout:l,stderr:d}));})().catch(R=>{f||(f=true,clearTimeout(w),o(R instanceof Error?R:new Error(String(R))));});});});function kt(){try{return (typeof B=="function"?B:createRequire(S)).resolve("@crewx/sdk/package.json")}catch{return null}}function xt(){let e=[kt(),join(P,"../../package.json"),join(P,"../../../package.json")].filter(t=>!!t);for(let t of e)try{let n=JSON.parse(readFileSync(t,"utf8"));if(n.name==="@crewx/sdk"&&n.version)return n.version}catch{}return "0.0.0"}var Ee=xt();var y=p.win32;function V(e){return y.join(e,".crewx")}function Ce(e){return y.join(V(e),"shortcut.json")}function Re(e){return y.join(V(e),"launcher.json")}function ve(e){return y.join(V(e),"bin","crewx-launcher.cmd")}function _e(e){return y.join(e,"CrewX.lnk")}function X(e,t){return y.normalize(e).toLowerCase()===y.normalize(t).toLowerCase()}var Ot="[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; [Environment]::GetFolderPath('DesktopDirectory')";async function be(e){try{let n=await e.run("powershell",["-NoProfile","-NonInteractive","-Command",Ot],{env:e.env}),r=n.stdout.trim();if(n.code===0&&r)return {dir:r,source:"known-folder"}}catch{}let t=e.env.USERPROFILE||e.env.Userprofile||e.homedir();return t?{dir:y.join(t,"Desktop"),source:"fallback"}:null}function K(e,t){let n=y.resolve(t,"node_modules",".bin").toLowerCase();return e.split(";").filter(r=>r?y.resolve(r).toLowerCase()!==n:true).join(";")}function ke(e){return e?/\\Program Files( \(x86\))?\\/i.test(e)&&/crewx/i.test(e):false}function Lt(e,t){let n=a=>{let[l,...d]=a.split("-"),f=d.join("-")||void 0;return {parts:(l??"").split(".").map(E=>Number.parseInt(E,10)||0),pre:f}},r=n(e),o=n(t),c=Math.max(r.parts.length,o.parts.length);for(let a=0;a<c;a++){let l=r.parts[a]??0,d=o.parts[a]??0;if(l!==d)return l<d?-1:1}if(r.pre===o.pre)return 0;if(!r.pre&&o.pre)return 1;if(r.pre&&!o.pre)return -1;let s=Number.parseInt(r.pre.match(/(\d+)$/)?.[1]??"",10),i=Number.parseInt(o.pre.match(/(\d+)$/)?.[1]??"",10);return !Number.isNaN(s)&&!Number.isNaN(i)&&s!==i?s<i?-1:1:r.pre<o.pre?-1:r.pre>o.pre?1:0}function x(e,t){return Lt(e,t)<0}var Oe=p.win32,Le=1;function Ie(e,t){if(!e.existsSync(t))return null;try{let n=JSON.parse(e.readFileSync(t));return {schema:n.schema??Le,shortcutPath:n.shortcutPath,version:n.version,iconHash:typeof n.iconHash=="string"?n.iconHash:void 0,owned:!!n.owned,declined:!!n.declined,desktopSource:n.desktopSource,updatedAt:n.updatedAt}}catch{return null}}function M(e,t,n){let r={schema:Le,...n,updatedAt:new Date().toISOString()};e.mkdirSync(Oe.dirname(t)),e.writeFileSync(t,JSON.stringify(r,null,2));}function G(e,t){if(!e.existsSync(t))return null;try{let n=JSON.parse(e.readFileSync(t));return {schema:n.schema??0,binPath:n.binPath,updatedAt:n.updatedAt}}catch{return null}}function Ne(e,t,n){e.mkdirSync(Oe.dirname(t)),e.writeFileSync(t,JSON.stringify(n,null,2));}var It=p.win32,O=1;function Nt(e){return e.replace(/%/g,"%%")}function Tt(e){return ["@echo off","setlocal DisableDelayedExpansion","chcp 65001 >nul","",'set "CREWX_WORKDIR=%USERPROFILE%\\crewx"','if not exist "%CREWX_WORKDIR%" mkdir "%CREWX_WORKDIR%" >nul 2>nul','cd /d "%CREWX_WORKDIR%"',"",'set "CREWX_PORT_EFFECTIVE=%CREWX_PORT%"','if "%CREWX_PORT_EFFECTIVE%"=="" set "CREWX_PORT_EFFECTIVE=8150"','set "CREWX_HEALTH_URL=http://127.0.0.1:%CREWX_PORT_EFFECTIVE%/api/v1/health"','set "CREWX_ORIGIN_URL=http://127.0.0.1:%CREWX_PORT_EFFECTIVE%/"',"",e.bakedBinPath?`set "CREWX_FALLBACK_BIN=${Nt(e.bakedBinPath)}"`:'set "CREWX_FALLBACK_BIN="','set "CREWX_RESOLVED_BIN=%CREWX_BIN%"','if "%CREWX_RESOLVED_BIN%"=="" set "CREWX_RESOLVED_BIN=%CREWX_FALLBACK_BIN%"','if "%CREWX_RESOLVED_BIN%"=="" (',` for /f "delims=" %%I in ('where crewx 2^>nul') do (`,' if not defined CREWX_RESOLVED_BIN set "CREWX_RESOLVED_BIN=%%I"'," )",")","",'powershell -NoProfile -NonInteractive -Command "try { $r = Invoke-WebRequest -Uri $env:CREWX_HEALTH_URL -TimeoutSec 1 -UseBasicParsing; if ($r.StatusCode -eq 200) { exit 0 } else { exit 1 } } catch { exit 1 }"',"if %ERRORLEVEL% EQU 0 (",' start "" "%CREWX_ORIGIN_URL%"'," exit /b 0",")","",'if "%CREWX_RESOLVED_BIN%"=="" ('," echo CrewX executable not found. Please reinstall the desktop shortcut."," pause"," exit /b 1",")","",'start "CrewX" /min "%CREWX_RESOLVED_BIN%"',""].join(`\r
|
|
2
|
+
`)}function De(e){let t=G(e.fs,e.launcherManifestPath),n=!!t&&t.schema>=O&&e.fs.existsSync(e.wrapperPath),r=n&&!t.binPath&&!!e.bakedBinPath;if(n&&!r)return {wrapperPath:e.wrapperPath,wrote:false,schema:t.schema};let c=Tt({bakedBinPath:e.bakedBinPath});try{e.fs.mkdirSync(It.dirname(e.wrapperPath)),e.fs.writeFileSync(e.wrapperPath,c),Ne(e.fs,e.launcherManifestPath,{schema:O,binPath:e.bakedBinPath,updatedAt:new Date().toISOString()});}catch(s){throw s instanceof m?s:new m("WRITE_DENIED",`Could not write launcher wrapper: ${s instanceof Error?s.message:String(s)}`)}return {wrapperPath:e.wrapperPath,wrote:true,schema:O}}var Dt=["$ws = New-Object -ComObject WScript.Shell","$sc = $ws.CreateShortcut($env:CREWX_LNK_PATH)","$sc.TargetPath = $env:CREWX_LNK_TARGET","if ($env:CREWX_LNK_WORKDIR) { $sc.WorkingDirectory = $env:CREWX_LNK_WORKDIR }","$sc.WindowStyle = 7","if ($env:CREWX_LNK_ICON) { $sc.IconLocation = $env:CREWX_LNK_ICON }","$sc.Save()"].join("; "),At=["[Console]::OutputEncoding = [System.Text.Encoding]::UTF8","$ws = New-Object -ComObject WScript.Shell","$sc = $ws.CreateShortcut($env:CREWX_LNK_PATH)","[PSCustomObject]@{ TargetPath = $sc.TargetPath; WorkingDirectory = $sc.WorkingDirectory; IconLocation = $sc.IconLocation } | ConvertTo-Json -Compress"].join("; ");async function Ae(e){let t={...e.env,CREWX_LNK_PATH:e.shortcutPath,CREWX_LNK_TARGET:e.targetPath,CREWX_LNK_WORKDIR:e.workingDirectory??"",CREWX_LNK_ICON:e.iconPath??""},n;try{n=await e.run("powershell",["-NoProfile","-NonInteractive","-Command",Dt],{env:t});}catch(r){throw new m("POWERSHELL_UNAVAILABLE",`Could not run PowerShell: ${r instanceof Error?r.message:String(r)}`)}if(n.code!==0)throw new m("POWERSHELL_UNAVAILABLE",`Failed to create desktop shortcut: ${n.stderr||n.stdout}`)}function We(e){let t=e.trim(),n=t.lastIndexOf(",");return n!==-1&&/^-?\d+$/.test(t.slice(n+1).trim())&&(t=t.slice(0,n).trim()),t.length>=2&&t.startsWith('"')&&t.endsWith('"')&&(t=t.slice(1,-1).trim()),t}async function Me(e){try{let t={...e.env,CREWX_LNK_PATH:e.shortcutPath},n=await e.run("powershell",["-NoProfile","-NonInteractive","-Command",At],{env:t});if(n.code!==0||!n.stdout.trim())return null;let r=JSON.parse(n.stdout.trim());return {targetPath:r.TargetPath??"",workingDirectory:r.WorkingDirectory??"",iconLocation:r.IconLocation??""}}catch{return null}}var j=p.win32;async function L(e){let t=K(e.env.PATH??e.env.Path??"",e.cwd),n={...e.env,PATH:t,Path:t},r;try{r=await e.run("npm",["list","-g","crewx","--depth=0","--json"],{env:n});}catch{return {installed:false}}let o;try{o=JSON.parse(r.stdout||"{}");}catch{return {installed:false}}let c=o.dependencies?.crewx;if(!c?.version)return {installed:false};let s;try{let a=await e.run("npm",["prefix","-g"],{env:n});a.code===0&&(s=a.stdout.trim()||void 0);}catch{}let i=s?j.join(s,"crewx.cmd"):void 0;return {installed:true,version:c.version,binPath:i,prefix:s}}var Wt=/EACCES|EPERM|EROFS/,Mt=/ENOTFOUND|ETIMEDOUT|ECONNREFUSED|network|registry/i,Gt=/^\d+\.\d+\.\d+/;function Ft(e){return !!e&&e!=="0.0.0"&&Gt.test(e)}var J=10*6e4;async function Fe(e){if(!Ft(e.targetVersion))throw new m("GLOBAL_INSTALL_FAILED",`RUNNING_VERSION_UNKNOWN: cannot reliably determine the running crewx version to install (got ${JSON.stringify(e.targetVersion)}); refusing to fall back to crewx@latest`);if(e.currentInfo?.installed&&e.currentInfo.version&&!x(e.currentInfo.version,e.targetVersion))return {info:e.currentInfo};let t=K(e.env.PATH??e.env.Path??"",e.cwd),n={...e.env,PATH:t,Path:t},r=`crewx@${e.targetVersion}`;e.onProgress?.({phase:"global-install",message:`Installing crewx globally (npm install -g ${r})`});let o;try{o=await e.run("npm",["install","-g",r,"--no-audit","--no-fund"],{env:n,timeoutMs:J});}catch(s){throw new m("NPM_UNAVAILABLE",`Could not run npm: ${s instanceof Error?s.message:String(s)}`)}if(o.code===0)return {info:await L({env:n,cwd:e.cwd,run:e.run})};let c=`${o.stdout}
|
|
3
|
+
${o.stderr}`;if(Wt.test(c)){e.onProgress?.({phase:"global-install",message:"Permission denied \u2014 retrying with a user-scoped npm prefix"});let s=e.env.LOCALAPPDATA||j.join(e.env.USERPROFILE??"","AppData","Local"),i={...n,npm_config_prefix:j.join(s,"crewx","npm")},a;try{a=await e.run("npm",["install","-g",r,"--no-audit","--no-fund"],{env:i,timeoutMs:J});}catch(l){throw new m("NPM_PERMISSION_DENIED",`Retry with user-scoped prefix failed: ${l instanceof Error?l.message:String(l)}`)}if(a.code===0)return {info:await L({env:i,cwd:e.cwd,run:e.run})};throw new m("NPM_PERMISSION_DENIED",`npm install -g failed after user-scoped prefix retry: ${a.stderr||a.stdout}`)}if(Mt.test(c)){if(!e.installRoot)throw new m("OFFLINE_NO_SOURCE","The npm registry is unreachable and no local installRoot was provided for an offline install");e.onProgress?.({phase:"global-install",message:`Registry unreachable \u2014 installing offline from ${e.installRoot}`});let s;try{s=await e.run("npm",["install","-g",e.installRoot,"--offline","--no-audit","--no-fund"],{env:n,timeoutMs:J});}catch(i){throw new m("GLOBAL_INSTALL_FAILED",`Offline install failed: ${i instanceof Error?i.message:String(i)}`)}if(s.code===0)return {info:await L({env:n,cwd:e.cwd,run:e.run})};throw new m("GLOBAL_INSTALL_FAILED",`Offline install failed: ${s.stderr||s.stdout}`)}throw new m("GLOBAL_INSTALL_FAILED",c.trim()||`npm install -g ${r} failed`)}function $t(e){return e.run??Pe}function Ht(e){return e.fs??Q}async function F(e){let t=e.platform??process.platform,n=e.env??process.env,r=e.homedir??Z,o=$t(e),c=Ht(e),s=e.runningVersion??Ee,i=e.cwd??process.cwd(),a=r(),l=Ce(a),d=Re(a),f=ve(a),u=null;t==="win32"&&(u=await be({env:n,homedir:r,run:o}));let E=u?_e(u.dir):null;return {platform:t,env:n,homedir:r,run:o,fs:c,runningVersion:s,cwd:i,installRoot:e.installRoot,shortcutManifestPath:l,launcherManifestPath:d,wrapperPath:f,desktop:u,shortcutPath:E}}function Be(e){return e?p.win32.normalize(e).toLowerCase().endsWith(`${p.win32.sep}bin${p.win32.sep}crewx.ico`):false}function z(e,t){let n=e.readBinaryFileSync;if(n)try{return createHash("sha256").update(n(t)).digest("hex")}catch{return}}async function Ut(e){try{await e.run("ie4uinit.exe",["-show"],{env:e.env});}catch{}}async function v(e){if(e.platform!=="win32")return {supported:false,state:"unsupported",globalCrewx:null,runningVersion:e.runningVersion,errors:[],manifest:null,iconStale:false};let t=[];e.desktop||t.push("NO_DESKTOP_DIR: could not resolve the Windows Desktop directory");let n=Ie(e.fs,e.shortcutManifestPath),r=G(e.fs,e.launcherManifestPath),o=await L({env:e.env,cwd:e.cwd,run:e.run}),c=e.shortcutPath?e.fs.existsSync(e.shortcutPath):false,s,i=false,a,l;if(!c)s=n?.declined?"declined":"not-installed";else {let d=!!n?.owned&&!!e.shortcutPath&&n.shortcutPath===e.shortcutPath,f=false,u=e.shortcutPath?await Me({run:e.run,env:e.env,shortcutPath:e.shortcutPath}):null;if(d||(u&&X(u.targetPath,e.wrapperPath)?d=true:u&&ke(u.targetPath)&&(f=true)),f)s="foreign",t.push("NSIS_PRESENT: an NSIS-installed CrewX shortcut was detected");else if(!d)s="foreign";else if(n?.version&&x(e.runningVersion,n.version))s="superseded",t.push(`SUPERSEDED: running version ${e.runningVersion} is older than the installed shortcut's version ${n.version}; refusing to modify it`);else {let E=!r||r.schema<O||!e.fs.existsSync(e.wrapperPath);if(u){let h=We(u.iconLocation);if(!(!!h&&e.fs.existsSync(h)))i=true;else {a=h;let w=$e(o,e.fs);w?X(h,w)?(l=z(e.fs,h),i=!l||n?.iconHash!==l):i=true:Be(h)?(l=z(e.fs,h),i=!l||n?.iconHash!==l):i=true;}}s=E||i?"stale":"installed";}}return {supported:true,state:s,shortcutPath:e.shortcutPath??void 0,desktopDir:e.desktop?.dir,desktopSource:e.desktop?.source,wrapperPath:e.wrapperPath,wrapperSchema:r?.schema,globalCrewx:o.installed?o:{installed:false},runningVersion:e.runningVersion,errors:t,manifest:n,iconStale:i,iconPath:a,iconHash:l}}function $e(e,t){if(!e?.installed||!e.prefix)return;let n=p.win32.join(e.prefix,"node_modules","crewx","bin","crewx.ico");return t.existsSync(n)?n:void 0}function _(e){let{manifest:t,iconStale:n,iconPath:r,iconHash:o,...c}=e;return c}async function Vt(e={}){let t=await F(e),n=await v(t);return _(n)}async function Xt(e={}){let t=await F(e);e.onProgress?.({phase:"detect",message:"Checking current shortcut status"});let n=await v(t),r=_(n);if(!r.supported)return {...r,changed:false,installedGlobal:false};if(r.state==="superseded")return {...r,changed:false,installedGlobal:false};if(r.state==="foreign"){if(n.errors.some(w=>w.startsWith("NSIS_PRESENT")))throw new m("NSIS_PRESENT",`An NSIS-installed CrewX shortcut was detected at ${r.shortcutPath}`);if(!e.force)throw new m("FOREIGN_SHORTCUT",`An existing shortcut at ${r.shortcutPath} is not managed by CrewX`)}if(!t.desktop||!t.shortcutPath)throw new m("NO_DESKTOP_DIR","Could not resolve the Windows Desktop directory");let o=false,c=false,s=r.globalCrewx,i=[],a=n.manifest?.iconHash,l=false;if(!!s?.installed&&!!s.version&&x(s.version,t.runningVersion)||!s?.installed&&r.state!=="installed"){let w=await Fe({env:t.env,cwd:t.cwd,run:t.run,targetVersion:t.runningVersion,currentInfo:s??void 0,installRoot:t.installRoot,onProgress:e.onProgress});s=w.info,c=w.info.installed,o=true,c||i.push(`GLOBAL_INSTALL_UNCONFIRMED: npm install -g crewx@${t.runningVersion} exited successfully but a follow-up check could not confirm the global install`);}if(e.onProgress?.({phase:"wrapper",message:"Ensuring launcher wrapper"}),De({fs:t.fs,wrapperPath:t.wrapperPath,launcherManifestPath:t.launcherManifestPath,bakedBinPath:s?.binPath}).wrote&&(o=true),!((r.state==="installed"||r.state==="stale")&&!n.iconStale)){let w=$e(s,t.fs)??(n.iconPath&&Be(n.iconPath)&&t.fs.existsSync(n.iconPath)?n.iconPath:void 0);if(n.iconStale&&!w)throw new m("ICON_UNAVAILABLE",`Could not locate the global CrewX icon (bin\\crewx.ico) to repair the desktop shortcut at ${t.shortcutPath}; the existing shortcut was left untouched`);e.onProgress?.({phase:"lnk",message:"Creating desktop shortcut"}),await Ae({run:t.run,env:t.env,shortcutPath:t.shortcutPath,targetPath:t.wrapperPath,iconPath:w}),o=true,l=n.iconStale;let g=w?z(t.fs,w):void 0;g&&(a=g);}o&&M(t.fs,t.shortcutManifestPath,{shortcutPath:t.shortcutPath,version:t.runningVersion,owned:true,declined:false,desktopSource:t.desktop.source,iconHash:a}),l&&await Ut(t);let h=await v(t),C=_(h);return {...C,errors:[...C.errors,...i],changed:o,installedGlobal:c}}async function Kt(e={}){let t=await F(e),n=await v(t),r=_(n);if(!r.supported)return r;if((r.state==="installed"||r.state==="stale")&&t.shortcutPath)try{t.fs.unlinkSync(t.shortcutPath);}catch{}M(t.fs,t.shortcutManifestPath,{shortcutPath:void 0,version:n.manifest?.version,owned:false,declined:true,desktopSource:void 0,iconHash:void 0});let o=await v(t);return _(o)}async function Jt(e={}){let t=await F(e),n=await v(t),r=_(n);if(!r.supported)return r;M(t.fs,t.shortcutManifestPath,{shortcutPath:n.manifest?.shortcutPath,version:n.manifest?.version,owned:n.manifest?.owned??false,declined:true,desktopSource:n.manifest?.desktopSource,iconHash:n.manifest?.iconHash});let o=await v(t);return _(o)}export{m as ShortcutError,Jt as dismissShortcutNotice,Vt as getShortcutStatus,Xt as installShortcut,ge as killProcessTree,Kt as uninstallShortcut};
|