@nocobase/plugin-ai 2.1.0-alpha.26 → 2.1.0-alpha.27
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/build.config.ts +16 -0
- package/dist/ai/ai-employees/dara.js +1 -0
- package/dist/ai/docs/nocobase/ai/ai-quick-start.md +60 -0
- package/dist/ai/docs/nocobase/ai/claude-code/index.md +107 -0
- package/dist/ai/docs/nocobase/ai/codex/index.md +104 -0
- package/dist/ai/docs/nocobase/ai/hermes-agent/index.md +124 -0
- package/dist/ai/docs/nocobase/ai/index.md +102 -0
- package/dist/ai/docs/nocobase/ai/install-upgrade-migration.mdx +407 -0
- package/dist/ai/docs/nocobase/ai/mcp/index.md +167 -0
- package/dist/ai/docs/nocobase/ai/openclaw/index.md +112 -0
- package/dist/ai/docs/nocobase/ai/opencode/index.md +106 -0
- package/dist/ai/docs/nocobase/ai/quick-start.mdx +175 -0
- package/dist/ai/docs/nocobase/ai/workbuddy/index.md +119 -0
- package/dist/ai/docs/nocobase/ai-builder/acl.md +92 -0
- package/dist/ai/docs/nocobase/ai-builder/data-modeling.md +95 -0
- package/dist/ai/docs/nocobase/ai-builder/dsl-reconciler.md +90 -0
- package/dist/ai/docs/nocobase/ai-builder/env-bootstrap.md +116 -0
- package/dist/ai/docs/nocobase/ai-builder/index.md +127 -0
- package/dist/ai/docs/nocobase/ai-builder/plugin-manage.md +80 -0
- package/dist/ai/docs/nocobase/ai-builder/publish.md +95 -0
- package/dist/ai/docs/nocobase/ai-builder/security.md +233 -0
- package/dist/ai/docs/nocobase/ai-builder/ui-builder.md +100 -0
- package/dist/ai/docs/nocobase/ai-builder/workflow.md +171 -0
- package/dist/ai/docs/nocobase/ai-dev/capabilities.md +234 -0
- package/dist/ai/docs/nocobase/ai-dev/index.md +102 -0
- package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +147 -0
- package/dist/ai/docs/nocobase/ai-employees/configuration/admin-configuration.md +278 -0
- package/dist/ai/docs/nocobase/ai-employees/configuration/prompt-engineering-guide.md +319 -0
- package/dist/ai/docs/nocobase/ai-employees/features/built-in-employee.md +231 -0
- package/dist/ai/docs/nocobase/ai-employees/features/collaborate.md +34 -0
- package/dist/ai/docs/nocobase/ai-employees/features/enable-ai-employee.md +20 -0
- package/dist/ai/docs/nocobase/ai-employees/features/llm-service.md +41 -0
- package/dist/ai/docs/nocobase/ai-employees/features/mcp.md +68 -0
- package/dist/ai/docs/nocobase/ai-employees/features/new-ai-employees.md +43 -0
- package/dist/ai/docs/nocobase/ai-employees/features/pick-block.md +29 -0
- package/dist/ai/docs/nocobase/ai-employees/features/skills.md +39 -0
- package/dist/ai/docs/nocobase/ai-employees/features/task.md +41 -0
- package/dist/ai/docs/nocobase/ai-employees/features/tools.md +60 -0
- package/dist/ai/docs/nocobase/ai-employees/features/web-search.md +39 -0
- package/dist/ai/docs/nocobase/ai-employees/file-manager.md +18 -0
- package/dist/ai/docs/nocobase/ai-employees/index.md +72 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/index.md +25 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base.md +82 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/rag.md +29 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-database.md +32 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-store.md +24 -0
- package/dist/ai/docs/nocobase/ai-employees/permission.md +211 -0
- package/dist/ai/docs/nocobase/ai-employees/quick-start.md +89 -0
- package/dist/ai/docs/nocobase/ai-employees/scenarios/business-report.md +46 -0
- package/dist/ai/docs/nocobase/ai-employees/scenarios/viz-crm.md +248 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/employee/approval.md +31 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/employee/configuration.md +133 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/llm/chat.md +88 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/llm/multimodal-chat.md +21 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/llm/structured-output.md +59 -0
- package/dist/ai/docs/nocobase/api/acl/acl.md +7 -0
- package/dist/ai/docs/nocobase/api/app/env.md +288 -0
- package/dist/ai/docs/nocobase/api/auth/auth-manager.md +175 -0
- package/dist/ai/docs/nocobase/api/auth/auth.md +103 -0
- package/dist/ai/docs/nocobase/api/auth/base-auth.md +70 -0
- package/dist/ai/docs/nocobase/api/cache/cache-manager.md +194 -0
- package/dist/ai/docs/nocobase/api/cache/cache.md +60 -0
- package/dist/ai/docs/nocobase/api/cli/api/dynamic.md +47 -0
- package/dist/ai/docs/nocobase/api/cli/api/index.md +49 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/create.md +40 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/destroy.md +39 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/get.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/index.md +55 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/list.md +46 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/query.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/update.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/app/down.md +37 -0
- package/dist/ai/docs/nocobase/api/cli/app/index.md +42 -0
- package/dist/ai/docs/nocobase/api/cli/app/logs.md +38 -0
- package/dist/ai/docs/nocobase/api/cli/app/restart.md +46 -0
- package/dist/ai/docs/nocobase/api/cli/app/start.md +47 -0
- package/dist/ai/docs/nocobase/api/cli/app/stop.md +37 -0
- package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +39 -0
- package/dist/ai/docs/nocobase/api/cli/db/index.md +39 -0
- package/dist/ai/docs/nocobase/api/cli/db/logs.md +37 -0
- package/dist/ai/docs/nocobase/api/cli/db/ps.md +34 -0
- package/dist/ai/docs/nocobase/api/cli/db/start.md +36 -0
- package/dist/ai/docs/nocobase/api/cli/db/stop.md +36 -0
- package/dist/ai/docs/nocobase/api/cli/env/add.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/env/auth.md +37 -0
- package/dist/ai/docs/nocobase/api/cli/env/index.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/env/info.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/env/list.md +33 -0
- package/dist/ai/docs/nocobase/api/cli/env/remove.md +35 -0
- package/dist/ai/docs/nocobase/api/cli/env/update.md +40 -0
- package/dist/ai/docs/nocobase/api/cli/env/use.md +32 -0
- package/dist/ai/docs/nocobase/api/cli/index.md +153 -0
- package/dist/ai/docs/nocobase/api/cli/init.md +98 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/disable.md +35 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/enable.md +35 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/index.md +36 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/list.md +34 -0
- package/dist/ai/docs/nocobase/api/cli/scaffold/index.md +34 -0
- package/dist/ai/docs/nocobase/api/cli/scaffold/migration.md +35 -0
- package/dist/ai/docs/nocobase/api/cli/scaffold/plugin.md +34 -0
- package/dist/ai/docs/nocobase/api/cli/self/check.md +34 -0
- package/dist/ai/docs/nocobase/api/cli/self/index.md +35 -0
- package/dist/ai/docs/nocobase/api/cli/self/update.md +37 -0
- package/dist/ai/docs/nocobase/api/cli/skills/check.md +33 -0
- package/dist/ai/docs/nocobase/api/cli/skills/index.md +38 -0
- package/dist/ai/docs/nocobase/api/cli/skills/install.md +36 -0
- package/dist/ai/docs/nocobase/api/cli/skills/remove.md +36 -0
- package/dist/ai/docs/nocobase/api/cli/skills/update.md +36 -0
- package/dist/ai/docs/nocobase/api/cli/source/build.md +40 -0
- package/dist/ai/docs/nocobase/api/cli/source/dev.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/source/download.md +59 -0
- package/dist/ai/docs/nocobase/api/cli/source/index.md +39 -0
- package/dist/ai/docs/nocobase/api/cli/source/test.md +53 -0
- package/dist/ai/docs/nocobase/api/client/application.md +1 -0
- package/dist/ai/docs/nocobase/api/client/plugin.md +5 -0
- package/dist/ai/docs/nocobase/api/data-source-manager/data-source-manager.md +56 -0
- package/dist/ai/docs/nocobase/api/data-source-manager/data-source.md +79 -0
- package/dist/ai/docs/nocobase/api/data-source-manager/i-collection-manager.md +110 -0
- package/dist/ai/docs/nocobase/api/data-source-manager/i-collection.md +69 -0
- package/dist/ai/docs/nocobase/api/data-source-manager/i-field.md +33 -0
- package/dist/ai/docs/nocobase/api/data-source-manager/i-model.md +15 -0
- package/dist/ai/docs/nocobase/api/data-source-manager/i-repository.md +62 -0
- package/dist/ai/docs/nocobase/api/database/collection.md +514 -0
- package/dist/ai/docs/nocobase/api/database/field.md +558 -0
- package/dist/ai/docs/nocobase/api/database/index.md +1193 -0
- package/dist/ai/docs/nocobase/api/database/interfaces/base-interface.md +29 -0
- package/dist/ai/docs/nocobase/api/database/operators.md +808 -0
- package/dist/ai/docs/nocobase/api/database/relation-repository/belongs-to-many-repository.md +191 -0
- package/dist/ai/docs/nocobase/api/database/relation-repository/belongs-to-repository.md +4 -0
- package/dist/ai/docs/nocobase/api/database/relation-repository/has-many-repository.md +134 -0
- package/dist/ai/docs/nocobase/api/database/relation-repository/has-one-repository.md +187 -0
- package/dist/ai/docs/nocobase/api/database/relation-repository/index.md +48 -0
- package/dist/ai/docs/nocobase/api/database/repository.md +677 -0
- package/dist/ai/docs/nocobase/api/database/shared/create-options.md +22 -0
- package/dist/ai/docs/nocobase/api/database/shared/destroy-options.md +17 -0
- package/dist/ai/docs/nocobase/api/database/shared/find-one.md +9 -0
- package/dist/ai/docs/nocobase/api/database/shared/find-options.md +1 -0
- package/dist/ai/docs/nocobase/api/database/shared/transaction.md +1 -0
- package/dist/ai/docs/nocobase/api/database/shared/update-options.md +24 -0
- package/dist/ai/docs/nocobase/api/database/shared.md +8 -0
- package/dist/ai/docs/nocobase/api/flow-engine/data-source-manager.md +1 -0
- package/dist/ai/docs/nocobase/api/flow-engine/flow-context.md +176 -0
- package/dist/ai/docs/nocobase/api/flow-engine/flow-engine.md +6 -0
- package/dist/ai/docs/nocobase/api/flow-engine/flow-model.md +7 -0
- package/dist/ai/docs/nocobase/api/flow-engine/flow-resource.md +1 -0
- package/dist/ai/docs/nocobase/api/flow-engine/resource.md +384 -0
- package/dist/ai/docs/nocobase/api/index.md +4 -0
- package/dist/ai/docs/nocobase/api/logger/logger.md +165 -0
- package/dist/ai/docs/nocobase/api/sdk/auth.md +70 -0
- package/dist/ai/docs/nocobase/api/sdk/index.md +151 -0
- package/dist/ai/docs/nocobase/api/sdk/storage.md +54 -0
- package/dist/ai/docs/nocobase/api/server/app-command.md +9 -0
- package/dist/ai/docs/nocobase/api/server/application.md +1 -0
- package/dist/ai/docs/nocobase/api/server/audit-manager.md +141 -0
- package/dist/ai/docs/nocobase/api/server/context.md +17 -0
- package/dist/ai/docs/nocobase/api/server/migration.md +305 -0
- package/dist/ai/docs/nocobase/api/server/plugin.md +13 -0
- package/dist/ai/docs/nocobase/api/telemetry/metric.md +105 -0
- package/dist/ai/docs/nocobase/api/telemetry/telemetry.md +67 -0
- package/dist/ai/docs/nocobase/api/telemetry/trace.md +91 -0
- package/dist/ai/docs/nocobase/auth-verification/2fa/index.md +50 -0
- package/dist/ai/docs/nocobase/auth-verification/api-keys/index.md +44 -0
- package/dist/ai/docs/nocobase/auth-verification/auth/authenticators.md +35 -0
- package/dist/ai/docs/nocobase/auth-verification/auth/dev/api.md +112 -0
- package/dist/ai/docs/nocobase/auth-verification/auth/dev/index.md +193 -0
- package/dist/ai/docs/nocobase/auth-verification/auth/index.md +20 -0
- package/dist/ai/docs/nocobase/auth-verification/auth/password.md +127 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-cas/index.md +44 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-dingtalk/index.md +72 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-ldap/index.md +59 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-oidc/examples/google.md +27 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-oidc/examples/microsoft.md +50 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-oidc/index.md +96 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-saml/examples/google.md +49 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-saml/index.md +67 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-sms/index.md +60 -0
- package/dist/ai/docs/nocobase/auth-verification/auth-wecom/index.md +144 -0
- package/dist/ai/docs/nocobase/auth-verification/index.md +1 -0
- package/dist/ai/docs/nocobase/auth-verification/verification/dev/api.md +63 -0
- package/dist/ai/docs/nocobase/auth-verification/verification/dev/scene.md +13 -0
- package/dist/ai/docs/nocobase/auth-verification/verification/dev/sms-type.md +95 -0
- package/dist/ai/docs/nocobase/auth-verification/verification/dev/type.md +11 -0
- package/dist/ai/docs/nocobase/auth-verification/verification/index.md +37 -0
- package/dist/ai/docs/nocobase/auth-verification/verification/sms.md +71 -0
- package/dist/ai/docs/nocobase/auth-verification/verification-totp/index.md +48 -0
- package/dist/ai/docs/nocobase/calculation-engine/formula.md +323 -0
- package/dist/ai/docs/nocobase/calculation-engine/index.md +30 -0
- package/dist/ai/docs/nocobase/calculation-engine/math.md +298 -0
- package/dist/ai/docs/nocobase/changelog/2.1.0-beta-24.md +134 -0
- package/dist/ai/docs/nocobase/cluster-mode/development.md +141 -0
- package/dist/ai/docs/nocobase/cluster-mode/index.md +36 -0
- package/dist/ai/docs/nocobase/cluster-mode/kubernetes.md +386 -0
- package/dist/ai/docs/nocobase/cluster-mode/operations.md +63 -0
- package/dist/ai/docs/nocobase/cluster-mode/preparations.md +164 -0
- package/dist/ai/docs/nocobase/cluster-mode/services-splitting.md +85 -0
- package/dist/ai/docs/nocobase/data-sources/calendar/calendar-collection.md +14 -0
- package/dist/ai/docs/nocobase/data-sources/calendar/index.md +111 -0
- package/dist/ai/docs/nocobase/data-sources/collection-comment/index.md +66 -0
- package/dist/ai/docs/nocobase/data-sources/collection-expression/collection.md +23 -0
- package/dist/ai/docs/nocobase/data-sources/collection-fdw/enable-federated.md +40 -0
- package/dist/ai/docs/nocobase/data-sources/collection-fdw/index.md +72 -0
- package/dist/ai/docs/nocobase/data-sources/collection-sql/index.md +58 -0
- package/dist/ai/docs/nocobase/data-sources/collection-tree/index.md +18 -0
- package/dist/ai/docs/nocobase/data-sources/collection-view/index.md +12 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/china-region.md +11 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/collection-select.md +11 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/json.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/nano-id.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/snowflake-id.md +9 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/sort.md +21 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/uuid.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/index.md +12 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/m2m/index.md +54 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/m2o/index.md +42 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/o2m/index.md +46 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/o2o/index.md +70 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/color.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/email.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/icon.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/input.md +22 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/integer.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/number.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/password.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/percent.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/phone.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/textarea.md +22 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/url.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox-group.md +9 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/china-region.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/multiple-select.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/radio-group.md +9 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/select.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/date.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime-without-tz.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/index.md +72 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/time.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/unix-timestamp.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/circle.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/line.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/point.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/polygon.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/index.md +36 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/field-attachment.md +21 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/markdown.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/rich-text.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-at.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-by.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/space.md +17 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/table-oid.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-at.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-by.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/validation.md +115 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection.md +19 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/data-source.md +1 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/index.md +53 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/main-vs-external-data-sources.md +165 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mariadb/index.md +18 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mssql/index.md +18 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mysql/index.md +18 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-external-oracle/index.md +40 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-external-postgres/index.md +18 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-kingbase/index.md +121 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-main/general-collection.md +30 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-main/index.md +100 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-main/inheritance-collection.md +22 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-manager/external-database.md +101 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-manager/index.md +42 -0
- package/dist/ai/docs/nocobase/data-sources/data-source-rest-api/index.md +283 -0
- package/dist/ai/docs/nocobase/data-sources/development/index.md +6 -0
- package/dist/ai/docs/nocobase/data-sources/field-attachment-url/index.md +27 -0
- package/dist/ai/docs/nocobase/data-sources/field-china-region/index.md +19 -0
- package/dist/ai/docs/nocobase/data-sources/field-encryption/index.md +100 -0
- package/dist/ai/docs/nocobase/data-sources/field-formula/index.md +17 -0
- package/dist/ai/docs/nocobase/data-sources/field-m2m-array/index.md +46 -0
- package/dist/ai/docs/nocobase/data-sources/field-markdown-vditor/index.md +13 -0
- package/dist/ai/docs/nocobase/data-sources/field-sequence/index.md +17 -0
- package/dist/ai/docs/nocobase/data-sources/field-signature/index.md +36 -0
- package/dist/ai/docs/nocobase/data-sources/field-sort/index.md +163 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/development/index.md +138 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/field-attachment.md +19 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/file-collection.md +40 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/http-api.md +195 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/index.md +37 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/storage/aliyun-oss.md +33 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/storage/amazon-s3.md +10 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/storage/index.md +61 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/storage/local.md +20 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/storage/s3-pro.md +383 -0
- package/dist/ai/docs/nocobase/data-sources/file-manager/storage/tencent-cos.md +33 -0
- package/dist/ai/docs/nocobase/data-sources/graph-collection-manager/index.md +22 -0
- package/dist/ai/docs/nocobase/data-sources/index.md +53 -0
- package/dist/ai/docs/nocobase/data-visualization/best-practices.md +3 -0
- package/dist/ai/docs/nocobase/data-visualization/faq.md +30 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/chart-events.md +80 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/chart-options.md +100 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/context-variables.md +28 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/custom-chart-options.md +172 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/data-query.md +95 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/filters-and-linkage.md +23 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/preview-and-save.md +36 -0
- package/dist/ai/docs/nocobase/data-visualization/guide/sql-data-query.md +76 -0
- package/dist/ai/docs/nocobase/data-visualization/index.md +26 -0
- package/dist/ai/docs/nocobase/data-visualization/quick-start.md +95 -0
- package/dist/ai/docs/nocobase/database/index.md +5 -0
- package/dist/ai/docs/nocobase/development/index.md +49 -0
- package/dist/ai/docs/nocobase/email-manager/advanced/auto-save-draft.md +17 -0
- package/dist/ai/docs/nocobase/email-manager/advanced/batch-send.md +40 -0
- package/dist/ai/docs/nocobase/email-manager/advanced/label.md +18 -0
- package/dist/ai/docs/nocobase/email-manager/advanced/note.md +14 -0
- package/dist/ai/docs/nocobase/email-manager/advanced/todo.md +13 -0
- package/dist/ai/docs/nocobase/email-manager/configuration/faq.md +39 -0
- package/dist/ai/docs/nocobase/email-manager/configuration/gmail.md +198 -0
- package/dist/ai/docs/nocobase/email-manager/configuration/guide.md +56 -0
- package/dist/ai/docs/nocobase/email-manager/configuration/outlook.md +106 -0
- package/dist/ai/docs/nocobase/email-manager/index.md +11 -0
- package/dist/ai/docs/nocobase/email-manager/usage/alias.md +34 -0
- package/dist/ai/docs/nocobase/email-manager/usage/configuration.md +101 -0
- package/dist/ai/docs/nocobase/email-manager/usage/guide.md +100 -0
- package/dist/ai/docs/nocobase/email-manager/usage/signature.md +25 -0
- package/dist/ai/docs/nocobase/email-manager/usage/template.md +25 -0
- package/dist/ai/docs/nocobase/file-manager/development/index.md +172 -0
- package/dist/ai/docs/nocobase/file-manager/field-attachment.md +21 -0
- package/dist/ai/docs/nocobase/file-manager/file-collection.md +34 -0
- package/dist/ai/docs/nocobase/file-manager/file-preview/index.md +11 -0
- package/dist/ai/docs/nocobase/file-manager/file-preview/ms-office.md +60 -0
- package/dist/ai/docs/nocobase/file-manager/http-api.md +188 -0
- package/dist/ai/docs/nocobase/file-manager/index.md +18 -0
- package/dist/ai/docs/nocobase/file-manager/storage/aliyun-oss.md +37 -0
- package/dist/ai/docs/nocobase/file-manager/storage/amazon-s3.md +33 -0
- package/dist/ai/docs/nocobase/file-manager/storage/index.md +69 -0
- package/dist/ai/docs/nocobase/file-manager/storage/local.md +20 -0
- package/dist/ai/docs/nocobase/file-manager/storage/s3-pro.md +387 -0
- package/dist/ai/docs/nocobase/file-manager/storage/tencent-cos.md +33 -0
- package/dist/ai/docs/nocobase/flow-engine/add-sub-model.md +174 -0
- package/dist/ai/docs/nocobase/flow-engine/create-flow-model.md +89 -0
- package/dist/ai/docs/nocobase/flow-engine/create-mock-client.md +85 -0
- package/dist/ai/docs/nocobase/flow-engine/definitions/action-definition.md +495 -0
- package/dist/ai/docs/nocobase/flow-engine/definitions/event-definition.md +461 -0
- package/dist/ai/docs/nocobase/flow-engine/definitions/flow-definition.md +259 -0
- package/dist/ai/docs/nocobase/flow-engine/definitions/model-definition.md +397 -0
- package/dist/ai/docs/nocobase/flow-engine/definitions/step-definition.md +403 -0
- package/dist/ai/docs/nocobase/flow-engine/event-flow.md +94 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-context.md +90 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-definition.md +5 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-engine-and-plugins.md +80 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model-lifecycle.md +48 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model-options.md +1 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model-renderer.md +200 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model-repository.md +81 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model-settings.md +101 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model-usage.md +1 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model-vs-react-component.md +74 -0
- package/dist/ai/docs/nocobase/flow-engine/flow-model.md +45 -0
- package/dist/ai/docs/nocobase/flow-engine/index.md +59 -0
- package/dist/ai/docs/nocobase/flow-engine/js-model/js-action.md +1 -0
- package/dist/ai/docs/nocobase/flow-engine/js-model/js-block.md +2 -0
- package/dist/ai/docs/nocobase/flow-engine/js-model/js-column.md +1 -0
- package/dist/ai/docs/nocobase/flow-engine/js-model/js-field.md +1 -0
- package/dist/ai/docs/nocobase/flow-engine/js-model/js-item.md +1 -0
- package/dist/ai/docs/nocobase/flow-engine/learning-roadmap.md +3 -0
- package/dist/ai/docs/nocobase/flow-engine/model-definition.md +63 -0
- package/dist/ai/docs/nocobase/flow-engine/observable.md +50 -0
- package/dist/ai/docs/nocobase/flow-engine/quickstart.md +310 -0
- package/dist/ai/docs/nocobase/flow-engine/register-flow-model.md +42 -0
- package/dist/ai/docs/nocobase/flow-engine/runjs-extension-points.md +249 -0
- package/dist/ai/docs/nocobase/flow-engine/ui-schema.md +272 -0
- package/dist/ai/docs/nocobase/flow-engine/uischema.md +9 -0
- package/dist/ai/docs/nocobase/flow-engine/what-is-flow-engine.md +59 -0
- package/dist/ai/docs/nocobase/get-started/deployment/cluster.md +5 -0
- package/dist/ai/docs/nocobase/get-started/deployment/common-commands/docker-compose.md +1 -0
- package/dist/ai/docs/nocobase/get-started/deployment/common-commands/pm2.md +1 -0
- package/dist/ai/docs/nocobase/get-started/deployment/internal.md +1 -0
- package/dist/ai/docs/nocobase/get-started/deployment/intranet/create-nocobase-app.mdx +386 -0
- package/dist/ai/docs/nocobase/get-started/deployment/intranet/docker.mdx +5 -0
- package/dist/ai/docs/nocobase/get-started/deployment/production.md +42 -0
- package/dist/ai/docs/nocobase/get-started/deployment/static-resource-proxy/caddy.md +1 -0
- package/dist/ai/docs/nocobase/get-started/deployment/static-resource-proxy/cdn.md +1 -0
- package/dist/ai/docs/nocobase/get-started/deployment/static-resource-proxy/nginx.md +1 -0
- package/dist/ai/docs/nocobase/get-started/how-nocobase-works.mdx +6 -0
- package/dist/ai/docs/nocobase/get-started/install-upgrade-plugins.mdx +89 -0
- package/dist/ai/docs/nocobase/get-started/installation/create-nocobase-app.mdx +230 -0
- package/dist/ai/docs/nocobase/get-started/installation/docker.mdx +620 -0
- package/dist/ai/docs/nocobase/get-started/installation/env.md +479 -0
- package/dist/ai/docs/nocobase/get-started/installation/git.mdx +112 -0
- package/dist/ai/docs/nocobase/get-started/quickstart.md +58 -0
- package/dist/ai/docs/nocobase/get-started/system-requirements.md +88 -0
- package/dist/ai/docs/nocobase/get-started/translations.md +329 -0
- package/dist/ai/docs/nocobase/get-started/upgrading/create-nocobase-app.md +53 -0
- package/dist/ai/docs/nocobase/get-started/upgrading/docker.md +76 -0
- package/dist/ai/docs/nocobase/get-started/upgrading/git.md +61 -0
- package/dist/ai/docs/nocobase/guide/index.md +109 -0
- package/dist/ai/docs/nocobase/index.md +75 -0
- package/dist/ai/docs/nocobase/integration/api-doc/index.md +59 -0
- package/dist/ai/docs/nocobase/integration/api-keys/index.md +42 -0
- package/dist/ai/docs/nocobase/integration/api-keys/usage.md +291 -0
- package/dist/ai/docs/nocobase/integration/block-iframe/index.md +291 -0
- package/dist/ai/docs/nocobase/integration/embed/index.md +30 -0
- package/dist/ai/docs/nocobase/integration/fdw/enable-federated.md +39 -0
- package/dist/ai/docs/nocobase/integration/fdw/index.md +66 -0
- package/dist/ai/docs/nocobase/integration/index.md +85 -0
- package/dist/ai/docs/nocobase/integration/sso/index.md +135 -0
- package/dist/ai/docs/nocobase/integration/workflow-http-request/index.md +325 -0
- package/dist/ai/docs/nocobase/integration/workflow-webhook/index.md +248 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/action-settings/assign-values.md +39 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/action-settings/bind-workflow.md +43 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/action-settings/double-check.md +18 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/action-settings/edit-button.md +21 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/action-settings/edit-popup.md +33 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/action-settings/linkage-rule.md +65 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/index.md +43 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/permission.md +79 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/add-child.md +9 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/add-new.md +22 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/ai-employee.md +1 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/bulk-edit.md +54 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/bulk-update.md +40 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/custom-request.md +37 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/delete.md +20 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/duplicate.md +95 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/edit.md +25 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/export-attachments.md +46 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/export-pro.md +93 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/export.md +36 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/filter.md +34 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/import-pro.md +136 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/import.md +237 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/js-action.md +97 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/js-item.md +170 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/link.md +32 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/pop-up.md +25 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/refresh.md +4 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/submit.md +29 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/trigger-workflow.md +1 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/update-record.md +39 -0
- package/dist/ai/docs/nocobase/interface-builder/actions/types/view.md +19 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/block-delete.md +8 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/block-height.md +41 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/block-layout.md +39 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/block-linkage-rule.md +37 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/block-title.md +8 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/data-loading-method.md +15 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/data-scope.md +43 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/drag-sort.md +45 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/field-linkage-rule.md +57 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/block-settings/sorting-rule.md +30 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/calendar.md +129 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/chart.md +17 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/details.md +100 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/form.md +87 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/grid-card.md +87 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/kanban.md +141 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/list.md +91 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/table.md +159 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/filter-blocks/form.md +99 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/filter-blocks/tree.md +57 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/index.md +85 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/other-blocks/action-panel.md +41 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/other-blocks/iframe.md +195 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/other-blocks/js-block.md +113 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/other-blocks/markdown.md +67 -0
- package/dist/ai/docs/nocobase/interface-builder/event-flow.md +261 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/association-field.md +75 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/data-scope.md +48 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/default-value.md +120 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/edit-description.md +16 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/edit-title.md +12 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/edit-tooltip.md +16 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/field-component.md +27 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/number-format.md +32 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/pattern.md +52 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/required.md +35 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/show-label.md +14 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/title-field.md +28 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/validation-rules.md +48 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/generic/detail-form-item.md +68 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/generic/filter-form-item.md +29 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/generic/form-item.md +57 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/generic/table-column.md +92 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/index.md +38 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/cascade-select.md +42 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/date-picker.md +30 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/file-manager.md +14 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/js-column.md +98 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/js-field.md +139 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/js-item.md +91 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/picker.md +35 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/select.md +65 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/sub-detail.md +39 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/sub-form.md +42 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/sub-table-popup.md +64 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/sub-table.md +56 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/specific/title.md +52 -0
- package/dist/ai/docs/nocobase/interface-builder/form-drafts.md +19 -0
- package/dist/ai/docs/nocobase/interface-builder/index.md +58 -0
- package/dist/ai/docs/nocobase/interface-builder/linkage-rule.md +118 -0
- package/dist/ai/docs/nocobase/interface-builder/runjs.md +71 -0
- package/dist/ai/docs/nocobase/interface-builder/ui-templates.md +167 -0
- package/dist/ai/docs/nocobase/interface-builder/variables.md +267 -0
- package/dist/ai/docs/nocobase/log-and-monitor/logger/index.md +152 -0
- package/dist/ai/docs/nocobase/log-and-monitor/logger/overview.md +44 -0
- package/dist/ai/docs/nocobase/log-and-monitor/telemetry/exporter-http.md +23 -0
- package/dist/ai/docs/nocobase/log-and-monitor/telemetry/exporter-prometheus.md +55 -0
- package/dist/ai/docs/nocobase/log-and-monitor/telemetry/index.md +67 -0
- package/dist/ai/docs/nocobase/multi-app/multi-app/index.md +66 -0
- package/dist/ai/docs/nocobase/multi-app/multi-app/local.md +106 -0
- package/dist/ai/docs/nocobase/multi-app/multi-app/remote.md +232 -0
- package/dist/ai/docs/nocobase/multi-app/multi-space/index.md +132 -0
- package/dist/ai/docs/nocobase/notification-manager/development/api.md +152 -0
- package/dist/ai/docs/nocobase/notification-manager/development/extension.md +300 -0
- package/dist/ai/docs/nocobase/notification-manager/index.md +43 -0
- package/dist/ai/docs/nocobase/notification-manager/notification-email/index.md +32 -0
- package/dist/ai/docs/nocobase/notification-manager/notification-in-app-message/index.md +60 -0
- package/dist/ai/docs/nocobase/notification-manager/wecom/index.md +34 -0
- package/dist/ai/docs/nocobase/ops-management/backup-manager/index.mdx +191 -0
- package/dist/ai/docs/nocobase/ops-management/migration-manager/index.md +197 -0
- package/dist/ai/docs/nocobase/ops-management/release-management/index.md +52 -0
- package/dist/ai/docs/nocobase/ops-management/variables-and-secrets/index.md +271 -0
- package/dist/ai/docs/nocobase/plugin-development/ai-development.md +7 -0
- package/dist/ai/docs/nocobase/plugin-development/build.md +86 -0
- package/dist/ai/docs/nocobase/plugin-development/client/acl.md +13 -0
- package/dist/ai/docs/nocobase/plugin-development/client/appendix/cheatsheet.md +108 -0
- package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +297 -0
- package/dist/ai/docs/nocobase/plugin-development/client/component/i18n.md +186 -0
- package/dist/ai/docs/nocobase/plugin-development/client/component/index.md +260 -0
- package/dist/ai/docs/nocobase/plugin-development/client/component/styles-themes.md +279 -0
- package/dist/ai/docs/nocobase/plugin-development/client/component-vs-flow-model.md +135 -0
- package/dist/ai/docs/nocobase/plugin-development/client/context.md +8 -0
- package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +492 -0
- package/dist/ai/docs/nocobase/plugin-development/client/ctx/index.md +112 -0
- package/dist/ai/docs/nocobase/plugin-development/client/ctx/what-is-context.md +9 -0
- package/dist/ai/docs/nocobase/plugin-development/client/data-source-manager.md +8 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-action.md +274 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-block.md +201 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-field.md +171 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/fullstack-plugin.md +514 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/index.md +31 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/settings-page.md +406 -0
- package/dist/ai/docs/nocobase/plugin-development/client/flow-engine/action.md +134 -0
- package/dist/ai/docs/nocobase/plugin-development/client/flow-engine/block.md +197 -0
- package/dist/ai/docs/nocobase/plugin-development/client/flow-engine/field.md +79 -0
- package/dist/ai/docs/nocobase/plugin-development/client/flow-engine/index.md +245 -0
- package/dist/ai/docs/nocobase/plugin-development/client/i18n.md +57 -0
- package/dist/ai/docs/nocobase/plugin-development/client/index.md +58 -0
- package/dist/ai/docs/nocobase/plugin-development/client/logger.md +128 -0
- package/dist/ai/docs/nocobase/plugin-development/client/plugin.md +133 -0
- package/dist/ai/docs/nocobase/plugin-development/client/request.md +174 -0
- package/dist/ai/docs/nocobase/plugin-development/client/resource.md +8 -0
- package/dist/ai/docs/nocobase/plugin-development/client/router.md +244 -0
- package/dist/ai/docs/nocobase/plugin-development/client/test.md +14 -0
- package/dist/ai/docs/nocobase/plugin-development/common/i18n.md +135 -0
- package/dist/ai/docs/nocobase/plugin-development/dependency-management.md +136 -0
- package/dist/ai/docs/nocobase/plugin-development/index.md +97 -0
- package/dist/ai/docs/nocobase/plugin-development/languages.md +123 -0
- package/dist/ai/docs/nocobase/plugin-development/lifecycle.md +12 -0
- package/dist/ai/docs/nocobase/plugin-development/plugin-upgrade-guide.md +2 -0
- package/dist/ai/docs/nocobase/plugin-development/project-structure.md +122 -0
- package/dist/ai/docs/nocobase/plugin-development/server/acl.md +188 -0
- package/dist/ai/docs/nocobase/plugin-development/server/app.md +15 -0
- package/dist/ai/docs/nocobase/plugin-development/server/cache.md +238 -0
- package/dist/ai/docs/nocobase/plugin-development/server/collection-options.md +1470 -0
- package/dist/ai/docs/nocobase/plugin-development/server/collections.md +230 -0
- package/dist/ai/docs/nocobase/plugin-development/server/command.md +164 -0
- package/dist/ai/docs/nocobase/plugin-development/server/context.md +138 -0
- package/dist/ai/docs/nocobase/plugin-development/server/cron-job-manager.md +101 -0
- package/dist/ai/docs/nocobase/plugin-development/server/data-source-manager.md +83 -0
- package/dist/ai/docs/nocobase/plugin-development/server/database.md +135 -0
- package/dist/ai/docs/nocobase/plugin-development/server/event.md +117 -0
- package/dist/ai/docs/nocobase/plugin-development/server/i18n.md +145 -0
- package/dist/ai/docs/nocobase/plugin-development/server/index.md +37 -0
- package/dist/ai/docs/nocobase/plugin-development/server/logger.md +120 -0
- package/dist/ai/docs/nocobase/plugin-development/server/middleware.md +163 -0
- package/dist/ai/docs/nocobase/plugin-development/server/migration.md +213 -0
- package/dist/ai/docs/nocobase/plugin-development/server/plugin.md +109 -0
- package/dist/ai/docs/nocobase/plugin-development/server/resource-manager.md +236 -0
- package/dist/ai/docs/nocobase/plugin-development/server/telemetry.md +118 -0
- package/dist/ai/docs/nocobase/plugin-development/server/test.md +226 -0
- package/dist/ai/docs/nocobase/plugin-development/write-your-first-plugin.md +161 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-acl/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-edit/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-update/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-custom-request/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-duplicate/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-export/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-export-pro/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-import/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-import-pro/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-print/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-template-print/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai-gigachat/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai-knowledge-base/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-doc/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-keys/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-app-supervisor/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-async-task-manager/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-audit-logger/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-audit-logs/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-cas/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-dingtalk/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-ldap/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-oidc/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-saml/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-sms/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-wecom/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backup-restore/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backups/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-grid-card/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-iframe/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-list/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-markdown/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-multi-step-form/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-template/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-tree/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-workbench/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-calendar/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-charts/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-client/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-fdw/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-sql/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-tree/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-comments/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-custom-brand/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-custom-variables/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-clickhouse/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-doris/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-mariadb/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-mssql/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-mysql/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-oracle/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-postgres/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-kingbase/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-main/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-manager/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-rest-api/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization-echarts/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-departments/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-email-manager/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-embed/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-environment-variables/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-error-handler/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-attachment-url/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-china-region/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-code/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-component-mask/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-encryption/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-formula/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-m2m-array/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-markdown-vditor/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sequence/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-signature/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sort/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-manager/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-previewer-office/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-storage-s3-pro/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-flow-engine/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-form-drafts/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-gantt/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-graph-collection-manager/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ip-restriction/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-kanban/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-license/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-locale-tester/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-localization/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-lock-adapter-redis/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-logger/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-map/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-migration-manager/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile-client/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-manager/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-share-collection/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-keyword-filter/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-space/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-email/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-in-app-message/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-manager/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-password-policy/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-public-forms/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-pubsub-adapter-redis/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-queue-adapter-rabbitmq/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-queue-adapter-redis/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-record-history/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-request-encryption/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-snapshot-field/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-system-settings/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-telemetry/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-telemetry-prometheus/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-text-copy/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-theme-editor/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-two-factor-authentication/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-schema-storage/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-templates/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-user-data-sync/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-users/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-verification/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-verification-totp-authenticator/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workerid-allocator-redis/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-action-trigger/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-aggregate/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-approval/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-cc/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-custom-action-trigger/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-date-calculation/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-delay/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-dynamic-calculation/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-javascript/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-json-query/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-json-variable-mapping/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-loop/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-mailer/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-manual/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-notification/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-parallel/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request-interceptor/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-response-message/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-sql/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-subflow/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-test/index.md +12 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-variable/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-webhook/index.md +15 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/preset-cluster/index.md +16 -0
- package/dist/ai/docs/nocobase/plugins/index.mdx +8 -0
- package/dist/ai/docs/nocobase/record-history/index.md +99 -0
- package/dist/ai/docs/nocobase/routes/index.md +65 -0
- package/dist/ai/docs/nocobase/runjs/context/block-model.md +90 -0
- package/dist/ai/docs/nocobase/runjs/context/collection-field.md +132 -0
- package/dist/ai/docs/nocobase/runjs/context/collection.md +100 -0
- package/dist/ai/docs/nocobase/runjs/context/data-source-manager.md +120 -0
- package/dist/ai/docs/nocobase/runjs/context/data-source.md +136 -0
- package/dist/ai/docs/nocobase/runjs/context/element.md +104 -0
- package/dist/ai/docs/nocobase/runjs/context/exit-all.md +96 -0
- package/dist/ai/docs/nocobase/runjs/context/exit.md +104 -0
- package/dist/ai/docs/nocobase/runjs/context/filter-manager.md +102 -0
- package/dist/ai/docs/nocobase/runjs/context/form.md +169 -0
- package/dist/ai/docs/nocobase/runjs/context/get-model.md +85 -0
- package/dist/ai/docs/nocobase/runjs/context/get-value.md +65 -0
- package/dist/ai/docs/nocobase/runjs/context/get-var.md +157 -0
- package/dist/ai/docs/nocobase/runjs/context/i18n.md +80 -0
- package/dist/ai/docs/nocobase/runjs/context/import-async.md +488 -0
- package/dist/ai/docs/nocobase/runjs/context/init-resource.md +74 -0
- package/dist/ai/docs/nocobase/runjs/context/libs.md +109 -0
- package/dist/ai/docs/nocobase/runjs/context/location.md +88 -0
- package/dist/ai/docs/nocobase/runjs/context/logger.md +85 -0
- package/dist/ai/docs/nocobase/runjs/context/make-resource.md +90 -0
- package/dist/ai/docs/nocobase/runjs/context/message.md +107 -0
- package/dist/ai/docs/nocobase/runjs/context/modal.md +115 -0
- package/dist/ai/docs/nocobase/runjs/context/model.md +85 -0
- package/dist/ai/docs/nocobase/runjs/context/notification.md +106 -0
- package/dist/ai/docs/nocobase/runjs/context/off.md +48 -0
- package/dist/ai/docs/nocobase/runjs/context/on.md +80 -0
- package/dist/ai/docs/nocobase/runjs/context/open-view.md +120 -0
- package/dist/ai/docs/nocobase/runjs/context/render.md +114 -0
- package/dist/ai/docs/nocobase/runjs/context/request.md +163 -0
- package/dist/ai/docs/nocobase/runjs/context/require-async.md +110 -0
- package/dist/ai/docs/nocobase/runjs/context/resource.md +92 -0
- package/dist/ai/docs/nocobase/runjs/context/route.md +76 -0
- package/dist/ai/docs/nocobase/runjs/context/router.md +111 -0
- package/dist/ai/docs/nocobase/runjs/context/set-value.md +73 -0
- package/dist/ai/docs/nocobase/runjs/context/sql.md +200 -0
- package/dist/ai/docs/nocobase/runjs/context/t.md +82 -0
- package/dist/ai/docs/nocobase/runjs/context/view.md +131 -0
- package/dist/ai/docs/nocobase/runjs/document.md +1 -0
- package/dist/ai/docs/nocobase/runjs/import-modules.md +110 -0
- package/dist/ai/docs/nocobase/runjs/index.md +65 -0
- package/dist/ai/docs/nocobase/runjs/jsx.md +84 -0
- package/dist/ai/docs/nocobase/runjs/model/form-block-model.md +1 -0
- package/dist/ai/docs/nocobase/runjs/render.md +64 -0
- package/dist/ai/docs/nocobase/runjs/resource/api-resource.md +155 -0
- package/dist/ai/docs/nocobase/runjs/resource/multi-record-resource.md +188 -0
- package/dist/ai/docs/nocobase/runjs/resource/single-record-resource.md +169 -0
- package/dist/ai/docs/nocobase/runjs/resource/sql-resource.md +170 -0
- package/dist/ai/docs/nocobase/runjs/window.md +20 -0
- package/dist/ai/docs/nocobase/security/audit-logger/index.md +101 -0
- package/dist/ai/docs/nocobase/security/guide.md +296 -0
- package/dist/ai/docs/nocobase/security/ip-restriction/index.md +56 -0
- package/dist/ai/docs/nocobase/security/password-policy/index.md +112 -0
- package/dist/ai/docs/nocobase/security/password-policy/lockout.md +26 -0
- package/dist/ai/docs/nocobase/security/token-policy/index.md +67 -0
- package/dist/ai/docs/nocobase/solution/crm/changelog.md +62 -0
- package/dist/ai/docs/nocobase/solution/crm/design.md +921 -0
- package/dist/ai/docs/nocobase/solution/crm/guide/guide-customers-emails.md +178 -0
- package/dist/ai/docs/nocobase/solution/crm/guide/guide-leads.md +238 -0
- package/dist/ai/docs/nocobase/solution/crm/guide/guide-opportunities.md +248 -0
- package/dist/ai/docs/nocobase/solution/crm/guide/guide-overview.md +210 -0
- package/dist/ai/docs/nocobase/solution/crm/guide/guide-products-orders.md +153 -0
- package/dist/ai/docs/nocobase/solution/crm/guide/guide-roles.md +131 -0
- package/dist/ai/docs/nocobase/solution/crm/guide/index.md +58 -0
- package/dist/ai/docs/nocobase/solution/crm/index.md +142 -0
- package/dist/ai/docs/nocobase/solution/crm/installation.md +160 -0
- package/dist/ai/docs/nocobase/solution/crm/more.md +5 -0
- package/dist/ai/docs/nocobase/solution/crm/v1.md +90 -0
- package/dist/ai/docs/nocobase/solution/ticket-system/changelog.md +30 -0
- package/dist/ai/docs/nocobase/solution/ticket-system/design.md +690 -0
- package/dist/ai/docs/nocobase/solution/ticket-system/index.md +177 -0
- package/dist/ai/docs/nocobase/solution/ticket-system/installation.md +133 -0
- package/dist/ai/docs/nocobase/solution/ticket-system/more.md +3 -0
- package/dist/ai/docs/nocobase/system-management/custom-brand/index.md +34 -0
- package/dist/ai/docs/nocobase/system-management/language-settings/index.md +13 -0
- package/dist/ai/docs/nocobase/system-management/localization/index.md +79 -0
- package/dist/ai/docs/nocobase/system-management/plugin-manager/index.md +14 -0
- package/dist/ai/docs/nocobase/system-management/system-settings/index.md +6 -0
- package/dist/ai/docs/nocobase/system-management/theme-editor/index.md +57 -0
- package/dist/ai/docs/nocobase/template-print/advanced/advanced-features.md +246 -0
- package/dist/ai/docs/nocobase/template-print/advanced/conditionals.md +431 -0
- package/dist/ai/docs/nocobase/template-print/configuration.md +76 -0
- package/dist/ai/docs/nocobase/template-print/faq.md +97 -0
- package/dist/ai/docs/nocobase/template-print/http-api.md +142 -0
- package/dist/ai/docs/nocobase/template-print/index.md +121 -0
- package/dist/ai/docs/nocobase/template-print/install.md +97 -0
- package/dist/ai/docs/nocobase/template-print/scenes.md +378 -0
- package/dist/ai/docs/nocobase/template-print/syntax/basic-usage.md +107 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/array-formatting.md +87 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/currency-formatting.md +47 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/date-formatting.md +187 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/index.md +108 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/media-field-formatting.md +35 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/number-formatting.md +203 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/text-formatting.md +333 -0
- package/dist/ai/docs/nocobase/template-print/syntax/formatters/time-interval-formatting.md +36 -0
- package/dist/ai/docs/nocobase/template-print/syntax/loops.md +451 -0
- package/dist/ai/docs/nocobase/tutorials/index.md +1 -0
- package/dist/ai/docs/nocobase/tutorials/v1/01-getting-started.md +187 -0
- package/dist/ai/docs/nocobase/tutorials/v1/02-designing-system.md +78 -0
- package/dist/ai/docs/nocobase/tutorials/v1/03-task-data.md +152 -0
- package/dist/ai/docs/nocobase/tutorials/v1/04-plugins.md +207 -0
- package/dist/ai/docs/nocobase/tutorials/v1/05-tabs-dynamic-blocks.md +135 -0
- package/dist/ai/docs/nocobase/tutorials/v1/06-user-permissions.md +190 -0
- package/dist/ai/docs/nocobase/tutorials/v1/07-workflow.md +159 -0
- package/dist/ai/docs/nocobase/tutorials/v1/08-project-overview.md +75 -0
- package/dist/ai/docs/nocobase/tutorials/v1/09-knowledge-base.md +198 -0
- package/dist/ai/docs/nocobase/tutorials/v1/10-dashboard-charts.md +234 -0
- package/dist/ai/docs/nocobase/tutorials/v1/11-dashboard-filters.md +176 -0
- package/dist/ai/docs/nocobase/tutorials/v1/12-subtasks-workhours.md +190 -0
- package/dist/ai/docs/nocobase/tutorials/v1/13-meeting-rooms.md +346 -0
- package/dist/ai/docs/nocobase/tutorials/v1/14-user-review.md +208 -0
- package/dist/ai/docs/nocobase/tutorials/v1/15-crm-lead-conversion.md +214 -0
- package/dist/ai/docs/nocobase/tutorials/v1/16-markdown-tips.md +121 -0
- package/dist/ai/docs/nocobase/tutorials/v1/17-crm-overview.md +136 -0
- package/dist/ai/docs/nocobase/tutorials/v1/18-lead-followup.md +253 -0
- package/dist/ai/docs/nocobase/tutorials/v1/19-crm-sales-cloud.md +42 -0
- package/dist/ai/docs/nocobase/tutorials/v1/20-api-keys.md +258 -0
- package/dist/ai/docs/nocobase/tutorials/v1/21-markdown-variables.md +231 -0
- package/dist/ai/docs/nocobase/tutorials/v1/22-deploy-faster.md +378 -0
- package/dist/ai/docs/nocobase/tutorials/v1/23-crm-pipeline.md +220 -0
- package/dist/ai/docs/nocobase/tutorials/v1/24-crm-demo-deploy.md +135 -0
- package/dist/ai/docs/nocobase/tutorials/v1/index.md +50 -0
- package/dist/ai/docs/nocobase/tutorials/v2/01-getting-started.md +176 -0
- package/dist/ai/docs/nocobase/tutorials/v2/02-data-modeling.md +319 -0
- package/dist/ai/docs/nocobase/tutorials/v2/03-building-pages.md +240 -0
- package/dist/ai/docs/nocobase/tutorials/v2/04-forms-and-details.md +279 -0
- package/dist/ai/docs/nocobase/tutorials/v2/05-roles-and-permissions.md +198 -0
- package/dist/ai/docs/nocobase/tutorials/v2/06-workflows.md +326 -0
- package/dist/ai/docs/nocobase/tutorials/v2/07-dashboard.md +270 -0
- package/dist/ai/docs/nocobase/tutorials/v2/index.md +93 -0
- package/dist/ai/docs/nocobase/ui-development-action/index.md +2 -0
- package/dist/ai/docs/nocobase/ui-development-action/write-an-action-plugin.md +0 -0
- package/dist/ai/docs/nocobase/ui-development-block/index.md +69 -0
- package/dist/ai/docs/nocobase/ui-development-block/write-a-block-plugin.md +116 -0
- package/dist/ai/docs/nocobase/ui-development-field/index.md +2 -0
- package/dist/ai/docs/nocobase/ui-development-field/write-a-field-plugin.md +0 -0
- package/dist/ai/docs/nocobase/users-permissions/acl/dev/permission-tab.md +68 -0
- package/dist/ai/docs/nocobase/users-permissions/acl/permissions.md +56 -0
- package/dist/ai/docs/nocobase/users-permissions/acl/role.md +43 -0
- package/dist/ai/docs/nocobase/users-permissions/acl/ui.md +239 -0
- package/dist/ai/docs/nocobase/users-permissions/acl/union.md +171 -0
- package/dist/ai/docs/nocobase/users-permissions/departments/index.md +106 -0
- package/dist/ai/docs/nocobase/users-permissions/departments/role.md +26 -0
- package/dist/ai/docs/nocobase/users-permissions/sync/dev/resource.md +63 -0
- package/dist/ai/docs/nocobase/users-permissions/sync/dev/source.md +146 -0
- package/dist/ai/docs/nocobase/users-permissions/sync/index.md +54 -0
- package/dist/ai/docs/nocobase/users-permissions/sync/sources/api.md +75 -0
- package/dist/ai/docs/nocobase/users-permissions/sync/sources/wecom.md +65 -0
- package/dist/ai/docs/nocobase/users-permissions/user.md +64 -0
- package/dist/ai/docs/nocobase/workflow/advanced/executions.md +66 -0
- package/dist/ai/docs/nocobase/workflow/advanced/options.md +33 -0
- package/dist/ai/docs/nocobase/workflow/advanced/revisions.md +25 -0
- package/dist/ai/docs/nocobase/workflow/advanced/variables.md +66 -0
- package/dist/ai/docs/nocobase/workflow/development/api.md +382 -0
- package/dist/ai/docs/nocobase/workflow/development/index.md +12 -0
- package/dist/ai/docs/nocobase/workflow/development/node.md +413 -0
- package/dist/ai/docs/nocobase/workflow/development/trigger.md +109 -0
- package/dist/ai/docs/nocobase/workflow/getting-started.md +123 -0
- package/dist/ai/docs/nocobase/workflow/index.md +43 -0
- package/dist/ai/docs/nocobase/workflow/nodes/aggregate.md +75 -0
- package/dist/ai/docs/nocobase/workflow/nodes/approval.md +172 -0
- package/dist/ai/docs/nocobase/workflow/nodes/calculation.md +45 -0
- package/dist/ai/docs/nocobase/workflow/nodes/cc.md +81 -0
- package/dist/ai/docs/nocobase/workflow/nodes/condition.md +41 -0
- package/dist/ai/docs/nocobase/workflow/nodes/create.md +49 -0
- package/dist/ai/docs/nocobase/workflow/nodes/date-calculation.md +138 -0
- package/dist/ai/docs/nocobase/workflow/nodes/delay.md +40 -0
- package/dist/ai/docs/nocobase/workflow/nodes/destroy.md +41 -0
- package/dist/ai/docs/nocobase/workflow/nodes/end.md +27 -0
- package/dist/ai/docs/nocobase/workflow/nodes/index.md +45 -0
- package/dist/ai/docs/nocobase/workflow/nodes/javascript.md +165 -0
- package/dist/ai/docs/nocobase/workflow/nodes/json-query.md +147 -0
- package/dist/ai/docs/nocobase/workflow/nodes/json-variable-mapping.md +85 -0
- package/dist/ai/docs/nocobase/workflow/nodes/loop.md +149 -0
- package/dist/ai/docs/nocobase/workflow/nodes/mailer.md +51 -0
- package/dist/ai/docs/nocobase/workflow/nodes/manual.md +247 -0
- package/dist/ai/docs/nocobase/workflow/nodes/multi-conditions.md +95 -0
- package/dist/ai/docs/nocobase/workflow/nodes/output.md +31 -0
- package/dist/ai/docs/nocobase/workflow/nodes/parallel.md +41 -0
- package/dist/ai/docs/nocobase/workflow/nodes/query.md +46 -0
- package/dist/ai/docs/nocobase/workflow/nodes/request.md +117 -0
- package/dist/ai/docs/nocobase/workflow/nodes/response-message.md +63 -0
- package/dist/ai/docs/nocobase/workflow/nodes/response.md +27 -0
- package/dist/ai/docs/nocobase/workflow/nodes/sql.md +94 -0
- package/dist/ai/docs/nocobase/workflow/nodes/subflow.md +67 -0
- package/dist/ai/docs/nocobase/workflow/nodes/update.md +52 -0
- package/dist/ai/docs/nocobase/workflow/nodes/variable.md +104 -0
- package/dist/ai/docs/nocobase/workflow/triggers/approval.md +355 -0
- package/dist/ai/docs/nocobase/workflow/triggers/collection.md +99 -0
- package/dist/ai/docs/nocobase/workflow/triggers/custom-action.md +228 -0
- package/dist/ai/docs/nocobase/workflow/triggers/index.md +26 -0
- package/dist/ai/docs/nocobase/workflow/triggers/post-action.md +213 -0
- package/dist/ai/docs/nocobase/workflow/triggers/pre-action.md +204 -0
- package/dist/ai/docs/nocobase/workflow/triggers/schedule.md +85 -0
- package/dist/ai/docs/nocobase/workflow/triggers/webhook.md +93 -0
- package/dist/ai/skills/document-search/SKILLS.md +95 -41
- package/dist/ai/tools/sub-agents/shared.js +3 -1
- package/dist/client/119.78774f3ad953af49.js +10 -0
- package/dist/client/228.a3df2921c8beb766.js +10 -0
- package/dist/client/343.6f36d97dd122c5b6.js +10 -0
- package/dist/client/559.c119db3f985a695f.js +10 -0
- package/dist/client/646.85a5f27994307223.js +10 -0
- package/dist/client/792.2e48eab4767d662a.js +10 -0
- package/dist/client/ai-employees/ai-coding/tools/context-tools.d.ts +4 -0
- package/dist/client/ai-employees/ai-coding/ui/CodeToolCard.d.ts +17 -0
- package/dist/client/ai-employees/types.d.ts +2 -0
- package/dist/client/index.js +5 -5
- package/dist/client/llm-providers/mimo/ModelSettings.d.ts +10 -0
- package/dist/client/llm-providers/mimo/index.d.ts +10 -0
- package/dist/collections/ai-employees.d.ts +7 -0
- package/dist/collections/ai-employees.js +13 -0
- package/dist/externalVersion.js +15 -15
- package/dist/locale/en-US.json +10 -2
- package/dist/locale/zh-CN.json +10 -2
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/250.index.cjs.js +30 -0
- package/dist/node_modules/just-bash/417.index.cjs.js +19 -0
- package/dist/node_modules/just-bash/LICENSE +201 -0
- package/dist/node_modules/just-bash/dist/Bash.d.ts +229 -0
- package/dist/node_modules/just-bash/dist/ast/types.d.ts +609 -0
- package/dist/node_modules/just-bash/dist/banned-patterns-test.d.ts +1 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/alias-3GODYSFD.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/awk2-DB6QZAC5.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/base64-43M2R3GA.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/basename-KBUKWB2E.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/bash-6ZHZ6BX7.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/cat-XZIJZXKP.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chmod-N5CQATDW.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-22NDZXS5.js +33 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-26NO42TF.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-2HVFB2TU.js +287 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-3MBAUIBB.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-3Y32LPNT.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-4CFAYBLV.js +21 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-4OALHZXB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-4PRVMER6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-4VDEBYW7.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-54G6AE72.js +32 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-5G2VOPPJ.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-5WFYIUU2.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-6KZRLMG3.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-7ADG3DNO.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-7BORMNPQ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-7G3MC56B.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-A5UGPLEI.js +21 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-AAW7UMPO.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ARI4VLCN.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-AXWFPG37.js +10 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-AZ3RUDR2.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-BGGF3ELU.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-BYDV4VEF.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-CGE2EHYP.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-CM4532DS.js +36 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-CQG2HEAL.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-D5WP4CKS.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-DOXYBGNA.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-DU4S5MUI.js +13 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-EJQKHROT.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-EONWONZV.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-EPPBDXOG.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-EUXCM6C4.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-F3LGZXLQ.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-FA2CHD73.js +16 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-FLPVVSN5.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-FSZWFMB4.js +16 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-GO6FXSC4.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-GOJZHH3L.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-GTNBSMZR.js +23 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-IDGH4PGU.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ITA43A73.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-JBABAK44.js +4 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-JDNI5HBX.js +33 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-JLX6YWGA.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-JQBC3FXE.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-JTF74J6E.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-KCMUAACL.js +19 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-KGOUQS5A.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-L6XUBS6H.js +84 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-LCDPWJBA.js +15 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-LGJM5YFT.js +17 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-LIYVQA3X.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-LJKIWB5F.js +4 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-LMK6G2HH.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-LOJMXC4F.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-LTL632J4.js +140 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-MAVV76T4.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-MO4RPBN2.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-MRP4ZCD7.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-N43DJTSI.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-NAX7MTAR.js +21 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-NSUMEERA.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-NTW6IA45.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-OBH7XN5N.js +1 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-OBI37ZY4.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-OOJCYVYF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ORUYSLP4.js +16 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-OXHVTSNH.js +74 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-PNI5NMXP.js +100 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-PPBQJBC2.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-PQNTKMH3.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-PS4LOXE5.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-PXVBSPBE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-RA3TG4UK.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-RBQGQWGV.js +10 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-RJSAGJQJ.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-RLNOQILG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ROJPSS6N.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-RT7TRQVZ.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-S3QAKT3R.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-S7OHMN3F.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-SGA7Y45Z.js +17 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-SXRVLCZ4.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-TEFXEYX3.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-THALLNXT.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-TTNNO45C.js +17 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-V7ZOPVQS.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-VNER2XXL.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-WLBA7L7U.js +23 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-WWZVR5NN.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-WXMBDX4P.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-XXCTETRW.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-XY5HGZW5.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-YEKSVVRC.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-YLE2OYY6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-YMMJLYIX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-YTIURC67.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-YU6OGPZR.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-YWZOGBFE.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ZA4HUKJ3.js +13 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ZKC5HQYO.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ZSVBYEY4.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/chunk-ZUDPEMHG.js +63 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/clear-KRGKPFOI.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/column-XGV32UPN.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/comm-R3F3Z5DX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/cp-XH2ZB7WT.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/curl-2DCNBIKJ.js +26 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/cut-5EY2XPXX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/date-WUPBL2TL.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/diff-5NUI5BHG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/dirname-5FAOMLBL.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/du-LDAPXSGF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/echo-2MUAOGUE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/env-NTPN5QYM.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/expand-26XPP5KB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/expansion-QUT3FT7V.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/expr-G4EF4POQ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/file-MMSHRWCJ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/find-7CVMEZBO.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/flag-coverage-QMWFYZRC.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/fold-XSVNTAWH.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/grep-7BJ7HFBM.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/gzip-LHOO65AN.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/head-YMNRW3F3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/help-DVG4AAGE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/history-UUKG55YW.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/hostname-WY6RKE32.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/html-to-markdown-V6PK6S5U.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/join-Y4Q5WVVE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/jq-DVZM2CEN.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/js-exec-RWEELTC2.js +97 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/js-exec-worker.js +4380 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/ln-EGC4HRXZ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/ls-WONXDVOX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/md5sum-NCLXV2S3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/mkdir-Z47OISSR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/mv-OY7X62QC.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/nl-XH3L75DR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/od-52FBC34W.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/paste-3UVLMQ2K.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/printf-NA7DYZBO.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/pwd-6VBAPL3Y.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/python3-JUJKPBFB.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/readlink-BD5VFOC5.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/rev-UHEPS2UL.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/rg-DK6FRF6Q.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/rm-L3NZOLLG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/rmdir-5KLM4EA6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/sed-WWXBUNG3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/seq-V7KBLSQ7.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/sha1sum-BHNJ5ALF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/sleep-ND6FZRZ4.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/sort-7GENYU2I.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/split-YWV64TJH.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/sqlite3-CVNFMP3Z.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/stat-XS2LXYS2.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/strings-XXKZCWY5.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/tac-T42SKDDI.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/tail-V537TDFR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/tar-GTGFEWDS.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/tee-HK2SYCAR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/time-5R4QWCYF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/timeout-Z24MNWOP.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/touch-DWKSZGOQ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/tr-4FPGAEVB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/tree-HEKABARE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/true-DP5UZP52.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/unexpand-OYZ7KOYR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/uniq-TMSAIZM3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/wc-ZIV3TFVG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/which-5PO4LAOG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/whoami-E7PN2UWC.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/worker.js +3136 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/xan-3G6YA5O6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/xan-view-6J5MMMQB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/xargs-SCYIFXOW.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/chunks/yq-CWUVVSHY.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/just-bash.js +754 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/alias-3GODYSFD.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/awk2-DB6QZAC5.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/base64-43M2R3GA.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/basename-KBUKWB2E.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/bash-6ZHZ6BX7.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/cat-XZIJZXKP.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chmod-N5CQATDW.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-22NDZXS5.js +33 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-26NO42TF.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-2HVFB2TU.js +287 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-3MBAUIBB.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-3Y32LPNT.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-4CFAYBLV.js +21 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-4OALHZXB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-4PRVMER6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-4VDEBYW7.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-54G6AE72.js +32 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-5WFYIUU2.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-6KZRLMG3.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-7ADG3DNO.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-7BORMNPQ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-7G3MC56B.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-A5UGPLEI.js +21 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-AAW7UMPO.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ARI4VLCN.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-AXWFPG37.js +10 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-AZ3RUDR2.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-BGGF3ELU.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-BYDV4VEF.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-CGE2EHYP.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-CM4532DS.js +36 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-CQG2HEAL.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-D5WP4CKS.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-DOXYBGNA.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-DU4S5MUI.js +13 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-EJQKHROT.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-EONWONZV.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-EPPBDXOG.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-EUXCM6C4.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-F3LGZXLQ.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-FA2CHD73.js +16 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-FLPVVSN5.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-FSZWFMB4.js +16 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-GO6FXSC4.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-GOJZHH3L.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-GTNBSMZR.js +23 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-HC7WB764.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-IDGH4PGU.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ITA43A73.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-JBABAK44.js +4 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-JDNI5HBX.js +33 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-JLX6YWGA.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-JQBC3FXE.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-JTF74J6E.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-KCMUAACL.js +19 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-KGOUQS5A.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-L6XUBS6H.js +84 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-LCDPWJBA.js +15 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-LGJM5YFT.js +17 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-LIYVQA3X.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-LJKIWB5F.js +4 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-LMK6G2HH.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-LOJMXC4F.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-LTL632J4.js +140 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-MAVV76T4.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-MO4RPBN2.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-MRP4ZCD7.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-N43DJTSI.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-NAX7MTAR.js +21 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-NSUMEERA.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-NTW6IA45.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-OBH7XN5N.js +1 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-OBI37ZY4.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-OOJCYVYF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ORUYSLP4.js +16 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-OXHVTSNH.js +74 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-PNI5NMXP.js +100 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-PPBQJBC2.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-PQNTKMH3.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-PS4LOXE5.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-RA3TG4UK.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-RBQGQWGV.js +10 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-RLNOQILG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ROJPSS6N.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-RT7TRQVZ.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-S3QAKT3R.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-S7OHMN3F.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-SGA7Y45Z.js +17 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-SXRVLCZ4.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-TEFXEYX3.js +3 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-THALLNXT.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-TTNNO45C.js +17 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-V7ZOPVQS.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-VNER2XXL.js +7 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-WLBA7L7U.js +23 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-WWZVR5NN.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-WXMBDX4P.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-XXCTETRW.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-XY5HGZW5.js +8 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-YEKSVVRC.js +11 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-YLE2OYY6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-YMMJLYIX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-YTIURC67.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-YU6OGPZR.js +5 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-YWZOGBFE.js +9 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +13 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +14 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ZSVBYEY4.js +6 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/chunk-ZUDPEMHG.js +63 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/clear-KRGKPFOI.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/column-XGV32UPN.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/comm-R3F3Z5DX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/cp-XH2ZB7WT.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/curl-2DCNBIKJ.js +26 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/cut-5EY2XPXX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/date-WUPBL2TL.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/diff-5NUI5BHG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/dirname-5FAOMLBL.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/du-LDAPXSGF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/echo-2MUAOGUE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/env-NTPN5QYM.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/expand-26XPP5KB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/expansion-QUT3FT7V.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/expr-G4EF4POQ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/file-MMSHRWCJ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/find-7CVMEZBO.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/flag-coverage-QMWFYZRC.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/fold-XSVNTAWH.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/grep-7BJ7HFBM.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/gzip-LHOO65AN.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/head-YMNRW3F3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/help-DVG4AAGE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/history-UUKG55YW.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/hostname-WY6RKE32.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/html-to-markdown-V6PK6S5U.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/join-Y4Q5WVVE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/jq-DVZM2CEN.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/js-exec-AKWY6BP5.js +97 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/ln-EGC4HRXZ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/ls-WONXDVOX.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/mkdir-Z47OISSR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/mv-OY7X62QC.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/nl-XH3L75DR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/od-52FBC34W.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/paste-3UVLMQ2K.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/printf-NA7DYZBO.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/pwd-6VBAPL3Y.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/python3-RRCCYJKA.js +12 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/readlink-BD5VFOC5.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/rev-UHEPS2UL.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/rg-DK6FRF6Q.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/rm-L3NZOLLG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/rmdir-5KLM4EA6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/sed-WWXBUNG3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/seq-V7KBLSQ7.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/sleep-ND6FZRZ4.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/sort-7GENYU2I.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/split-YWV64TJH.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/sqlite3-CVNFMP3Z.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/stat-XS2LXYS2.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/strings-XXKZCWY5.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/tac-T42SKDDI.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/tail-V537TDFR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/tar-GTGFEWDS.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/tee-HK2SYCAR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/time-5R4QWCYF.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/timeout-Z24MNWOP.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/touch-DWKSZGOQ.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/tr-4FPGAEVB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/tree-HEKABARE.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/true-DP5UZP52.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/uniq-TMSAIZM3.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/wc-ZIV3TFVG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/which-5PO4LAOG.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/whoami-E7PN2UWC.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/xan-3G6YA5O6.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/xan-view-6J5MMMQB.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/xargs-SCYIFXOW.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/chunks/yq-CWUVVSHY.js +2 -0
- package/dist/node_modules/just-bash/dist/bin/shell/shell.js +733 -0
- package/dist/node_modules/just-bash/dist/browser.d.ts +23 -0
- package/dist/node_modules/just-bash/dist/bundle/browser.js +1513 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/alias-JE7RI5QX.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/awk2-RRKCSTJR.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/base64-4YMZCVJ5.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/basename-AA2KJYZQ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/bash-IJWYRKFO.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/cat-RDUMLXKC.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chmod-SYMGL4JA.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-24IMIIXA.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-3THT3N7L.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-3ZUFRYJ4.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-43RSSTFA.js +73 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-44UOCSGV.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-4GTNDTRF.js +7 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-4HHKTUW3.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-4Q4SM6WR.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-55VFSPNA.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-5PYKJV42.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-5QMZ5MUS.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-5QVNJEHU.js +8 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-5V6VZH6T.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-62RKD26F.js +20 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-64BAICW3.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-74CEPOFO.js +22 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-75FNCC7W.js +286 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-7L36YK2X.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-7TSDKFEO.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-A4HU7SVR.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-A4JSPFCI.js +6 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-A5O5YHGN.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-A65PWWJC.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-A7A2DBEE.js +6 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-A7ICOL4V.js +13 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-ALLTKNUZ.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-APT7OOP2.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-B53Y5JFV.js +8 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-BAQA74XA.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-CWQS3NFK.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-D4J545R4.js +11 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-D6CWQ5DW.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-D7MEQ3VN.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-DBKNVD4L.js +9 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-DCAAORBQ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-DXB73IDG.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-EEXR5ZDP.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-EIZGF4BS.js +8 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-F23WWYKW.js +16 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-GCTKCWKD.js +3 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-GFQRA5P5.js +7 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-GJTDUJ5Q.js +10 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-GOV5EKKI.js +9 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-GXVXFKBA.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-HDQ56CKY.js +15 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-HJQJAYMS.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-HJWBQKYG.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-HL6NGDO2.js +22 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-HP7NBOKN.js +20 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-HWBSOZZR.js +35 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-HWKDQ44K.js +3 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-I57KEIP3.js +10 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-IPJHKYVM.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-JVPRLUMK.js +7 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-KMEYNNUA.js +15 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-KX3P26DQ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-LL3S3NLB.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-LTZRCH7N.js +31 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-LWEGUNWT.js +7 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-MDDMCKUK.js +6 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-MDLLFABN.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-MHTUABJP.js +8 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-MIZPJHVH.js +7 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-MLXIYONF.js +15 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-MYE6AGBJ.js +16 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-NAERJDUW.js +8 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-NCNPKYJZ.js +2 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-NRZWEENR.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-NUFRM6SI.js +0 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-NUYSJFDK.js +7 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-OCLXQMOG.js +6 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-OCS6LSEM.js +13 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-OJDRYQWQ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-PBXLG62G.js +8 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-PP6PSHAB.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-PXTK5WE2.js +20 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-PYDZ2LCK.js +16 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-PYSFUGCK.js +10 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-QCDB2VPH.js +6 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-QJ7O6ZN3.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-R6QSAL5T.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-R6VWJ2ZL.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-RAFHQYLP.js +139 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-RPNGRAAP.js +7 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-RQ254MFG.js +12 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-SDNKECQQ.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-T56QNPHK.js +14 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-TLSUDHID.js +6 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-TOMNU26N.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-TXBZCHCQ.js +5 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-U6NMAV24.js +32 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-V7TAPXDL.js +27 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-VBEY5J6R.js +99 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-VJFXDYWH.js +10 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-VOBGTVA6.js +6 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-VYOJP4TV.js +13 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-WKFATFPP.js +4 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-X2AJGDEF.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-XIZSGUXJ.js +62 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-XKQRETAK.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-XVDPCNWR.js +11 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-YSHZL3MF.js +32 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-YTNYSM6T.js +11 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-Z6LRHWXI.js +13 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/chunk-Z7JVV2SM.js +12 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/clear-5CZ5X4YR.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/column-WLPMMSTS.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/comm-5SLSESQG.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/cp-XOYR4ABJ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/curl-47BFPSFW.js +25 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/cut-OPC3VAGB.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/date-DD7FVA2V.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/diff-HJF2MPDN.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/dirname-LEMTZZFS.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/du-WO2ENHXQ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/echo-O45JWWI2.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/env-5EPCWSXR.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/expand-DTNXU4LQ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/expansion-UGGADTZC.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/expr-DNFUYZGY.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/file-IGDTDPLG.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/find-KNMMLVJD.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/flag-coverage-XLSDDMFQ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/fold-LDSORVYE.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/grep-2UMHPO7Y.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/gzip-AQXSGOVS.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/head-HT2B6D2J.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/help-VVWX7SA5.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/history-J4QRNGRO.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/hostname-BK6HG2DE.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/join-GG2LDHE5.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/jq-LCDWFF5Y.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/js-exec-VXN6TZ7U.js +96 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/js-exec-worker.js +4380 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/ln-4TRFBYAT.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/ls-KSXFZCWH.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/md5sum-INMIK4DX.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/mkdir-TDEMSB6C.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/mv-Z6MORUFL.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/nl-U5YJDM32.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/od-VJEF2UR5.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/paste-7N6AFSDS.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/printf-CX64KX2P.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/pwd-D4OZ7N27.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/python3-BFV3N3GY.js +11 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/readlink-MI4GCHJF.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/rev-XOSYPP45.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/rg-KYSTAD4Q.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/rm-RTZG23RL.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/rmdir-XTQXT7RK.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/sed-OFX3F4FE.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/seq-RN5ZUASB.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/sha1sum-VJPNLNU6.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/sha256sum-PI32XWXY.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/sleep-VZFPZFWA.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/sort-DCNRDA7U.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/split-SITCSYCZ.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/sqlite3-56UMWEY3.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/stat-BT5A227F.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/strings-7PLOGTPD.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/tac-SJGXQ4T2.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/tail-S5ULNTJU.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/tar-LYLTEJV3.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/tee-O7VXZDCO.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/time-DEUO3QV2.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/timeout-VRKMCG72.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/touch-DX2IJOQ4.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/tr-2HXZRDSW.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/tree-LYXBS7DC.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/true-WHJNXCHG.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/unexpand-RGTMIGZM.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/uniq-SUNANL47.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/wc-TQB3VNOX.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/which-XZHEH76L.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/whoami-DGKU3D2X.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/worker.js +3136 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/xan-EY6QWK2V.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/xan-view-OW2TB7Z3.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/xargs-I6EZUCYF.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/chunks/yq-M7NFNNED.js +1 -0
- package/dist/node_modules/just-bash/dist/bundle/index.cjs +70 -0
- package/dist/node_modules/just-bash/dist/bundle/index.js +709 -0
- package/dist/node_modules/just-bash/dist/commands/alias/alias.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/commands/awk/ast.d.ts +202 -0
- package/dist/node_modules/just-bash/dist/commands/awk/awk2.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/awk/builtins.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/context.d.ts +75 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/expressions.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/fields.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/index.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/interpreter.d.ts +54 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/statements.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/type-coercion.d.ts +32 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/types.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/commands/awk/interpreter/variables.d.ts +35 -0
- package/dist/node_modules/just-bash/dist/commands/awk/lexer.d.ts +100 -0
- package/dist/node_modules/just-bash/dist/commands/awk/parser2-print.d.ts +35 -0
- package/dist/node_modules/just-bash/dist/commands/awk/parser2.d.ts +81 -0
- package/dist/node_modules/just-bash/dist/commands/base64/base64.d.ts +7 -0
- package/dist/node_modules/just-bash/dist/commands/basename/basename.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/bash/bash.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/commands/browser-excluded.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/commands/cat/cat.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/chmod/chmod.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/clear/clear.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/column/column.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/comm/comm.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/cp/cp.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/curl/curl.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/curl/form.d.ts +21 -0
- package/dist/node_modules/just-bash/dist/commands/curl/help.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/curl/parse.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/curl/response-formatting.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/commands/curl/types.d.ts +31 -0
- package/dist/node_modules/just-bash/dist/commands/cut/cut.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/date/date.d.ts +7 -0
- package/dist/node_modules/just-bash/dist/commands/diff/diff.d.ts +7 -0
- package/dist/node_modules/just-bash/dist/commands/dirname/dirname.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/du/du.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/duration.d.ts +5 -0
- package/dist/node_modules/just-bash/dist/commands/echo/echo.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/env/env.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/commands/expand/expand.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/expand/unexpand.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/expr/expr.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/file/file.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/find/find.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/find/matcher.d.ts +69 -0
- package/dist/node_modules/just-bash/dist/commands/find/parser.d.ts +2 -0
- package/dist/node_modules/just-bash/dist/commands/find/types.d.ts +88 -0
- package/dist/node_modules/just-bash/dist/commands/flag-coverage.d.ts +2 -0
- package/dist/node_modules/just-bash/dist/commands/fold/fold.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/format-mode.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/fuzz-flags-types.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/commands/fuzz-flags.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/grep/grep.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/gzip/gzip.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/commands/head/head-tail-shared.d.ts +38 -0
- package/dist/node_modules/just-bash/dist/commands/head/head.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/help/help.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/help.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/commands/history/history.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/hostname/hostname.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/html-to-markdown/html-to-markdown.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/join/join.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/jq/jq.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/js-exec/fetch-polyfill.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/commands/js-exec/js-exec-worker.d.ts +30 -0
- package/dist/node_modules/just-bash/dist/commands/js-exec/js-exec.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/js-exec/module-shims.d.ts +29 -0
- package/dist/node_modules/just-bash/dist/commands/js-exec/path-polyfill.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/commands/ln/ln.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/ls/ls.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/md5sum/checksum.d.ts +7 -0
- package/dist/node_modules/just-bash/dist/commands/md5sum/md5sum.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/md5sum/sha1sum.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/md5sum/sha256sum.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/mkdir/mkdir.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/mv/mv.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/nl/nl.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/od/od.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/paste/paste.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/printf/escapes.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/commands/printf/printf.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/printf/strftime.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/pwd/pwd.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/python3/python3.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/commands/python3/worker.d.ts +28 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/array-builtins.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/control-builtins.d.ts +18 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/date-builtins.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/format-builtins.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/index-builtins.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/index.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/math-builtins.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/navigation-builtins.d.ts +18 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/object-builtins.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/path-builtins.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/sql-builtins.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/string-builtins.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/builtins/type-builtins.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/evaluator.d.ts +40 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/index.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/parser-types.d.ts +171 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/parser.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/path-operations.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/safe-object.d.ts +83 -0
- package/dist/node_modules/just-bash/dist/commands/query-engine/value-operations.d.ts +41 -0
- package/dist/node_modules/just-bash/dist/commands/readlink/readlink.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/registry.d.ts +56 -0
- package/dist/node_modules/just-bash/dist/commands/rev/rev.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/commands/rg/file-types.d.ts +49 -0
- package/dist/node_modules/just-bash/dist/commands/rg/gitignore.d.ts +98 -0
- package/dist/node_modules/just-bash/dist/commands/rg/rg-options.d.ts +61 -0
- package/dist/node_modules/just-bash/dist/commands/rg/rg-parser.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/commands/rg/rg-search.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/rg/rg.d.ts +14 -0
- package/dist/node_modules/just-bash/dist/commands/rm/rm.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/rmdir/rmdir.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/search-engine/index.d.ts +10 -0
- package/dist/node_modules/just-bash/dist/commands/search-engine/matcher.d.ts +60 -0
- package/dist/node_modules/just-bash/dist/commands/search-engine/regex.d.ts +33 -0
- package/dist/node_modules/just-bash/dist/commands/sed/executor.d.ts +7 -0
- package/dist/node_modules/just-bash/dist/commands/sed/lexer.d.ts +86 -0
- package/dist/node_modules/just-bash/dist/commands/sed/parser.d.ts +18 -0
- package/dist/node_modules/just-bash/dist/commands/sed/sed-regex.d.ts +23 -0
- package/dist/node_modules/just-bash/dist/commands/sed/sed.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/sed/types.d.ts +216 -0
- package/dist/node_modules/just-bash/dist/commands/seq/seq.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/commands/sleep/sleep.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/sort/comparator.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/commands/sort/parser.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/sort/sort.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/sort/types.d.ts +30 -0
- package/dist/node_modules/just-bash/dist/commands/split/split.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/sqlite3/formatters.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/sqlite3/sqlite3.d.ts +22 -0
- package/dist/node_modules/just-bash/dist/commands/sqlite3/worker.d.ts +45 -0
- package/dist/node_modules/just-bash/dist/commands/stat/stat.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/strings/strings.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/tac/tac.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/tail/tail.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/tar/archive.d.ts +135 -0
- package/dist/node_modules/just-bash/dist/commands/tar/bzip2-compress.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/commands/tar/tar-options.d.ts +37 -0
- package/dist/node_modules/just-bash/dist/commands/tar/tar.d.ts +10 -0
- package/dist/node_modules/just-bash/dist/commands/tee/tee.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/time/time.d.ts +27 -0
- package/dist/node_modules/just-bash/dist/commands/timeout/timeout.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/touch/touch.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/tr/tr.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/tree/tree.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/true/true.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/commands/uniq/uniq.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/wc/wc.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/which/which.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/whoami/whoami.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/worker-bridge/bridge-handler.d.ts +71 -0
- package/dist/node_modules/just-bash/dist/commands/worker-bridge/protocol.d.ts +140 -0
- package/dist/node_modules/just-bash/dist/commands/worker-bridge/sync-backend.d.ts +81 -0
- package/dist/node_modules/just-bash/dist/commands/xan/aggregation.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/commands/xan/column-selection.d.ts +19 -0
- package/dist/node_modules/just-bash/dist/commands/xan/csv.d.ts +37 -0
- package/dist/node_modules/just-bash/dist/commands/xan/moonblade-parser.d.ts +80 -0
- package/dist/node_modules/just-bash/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/xan/moonblade-tokenizer.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/commands/xan/subcommands.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-agg.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-columns.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-core.d.ts +10 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-data.d.ts +52 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-filter.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-map.d.ts +11 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-reshape.d.ts +40 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-simple.d.ts +40 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan-view.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/commands/xan/xan.d.ts +10 -0
- package/dist/node_modules/just-bash/dist/commands/xargs/xargs.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/commands/yq/formats.d.ts +64 -0
- package/dist/node_modules/just-bash/dist/commands/yq/yq.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/custom-commands.d.ts +42 -0
- package/dist/node_modules/just-bash/dist/fs/encoding.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/fs/in-memory-fs/in-memory-fs.d.ts +73 -0
- package/dist/node_modules/just-bash/dist/fs/in-memory-fs/index.d.ts +1 -0
- package/dist/node_modules/just-bash/dist/fs/init.d.ts +22 -0
- package/dist/node_modules/just-bash/dist/fs/interface.d.ts +229 -0
- package/dist/node_modules/just-bash/dist/fs/mountable-fs/index.d.ts +1 -0
- package/dist/node_modules/just-bash/dist/fs/mountable-fs/mountable-fs.d.ts +116 -0
- package/dist/node_modules/just-bash/dist/fs/overlay-fs/index.d.ts +1 -0
- package/dist/node_modules/just-bash/dist/fs/overlay-fs/overlay-fs.d.ts +163 -0
- package/dist/node_modules/just-bash/dist/fs/path-utils.d.ts +46 -0
- package/dist/node_modules/just-bash/dist/fs/read-write-fs/index.d.ts +1 -0
- package/dist/node_modules/just-bash/dist/fs/read-write-fs/read-write-fs.d.ts +96 -0
- package/dist/node_modules/just-bash/dist/fs/real-fs-utils.d.ts +90 -0
- package/dist/node_modules/just-bash/dist/fs/sanitize-error.d.ts +19 -0
- package/dist/node_modules/just-bash/dist/index.d.cts +27 -0
- package/dist/node_modules/just-bash/dist/index.d.ts +27 -0
- package/dist/node_modules/just-bash/dist/interpreter/alias-expansion.d.ts +23 -0
- package/dist/node_modules/just-bash/dist/interpreter/arithmetic.d.ts +24 -0
- package/dist/node_modules/just-bash/dist/interpreter/assignment-expansion.d.ts +24 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtin-dispatch.d.ts +39 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/break.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/cd.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/compgen.d.ts +26 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/complete.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/compopt.d.ts +28 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/continue.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/declare-array-parsing.d.ts +14 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/declare-print.d.ts +39 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/declare.d.ts +35 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/dirs.d.ts +29 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/eval.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/exit.d.ts +5 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/export.d.ts +14 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/getopts.d.ts +18 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/hash.d.ts +19 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/help.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/index.d.ts +45 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/let.d.ts +18 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/local.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/mapfile.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/read.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/return.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/set.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/shift.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/shopt.d.ts +7 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/source.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/unset.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/interpreter/builtins/variable-assignment.d.ts +66 -0
- package/dist/node_modules/just-bash/dist/interpreter/command-resolution.d.ts +43 -0
- package/dist/node_modules/just-bash/dist/interpreter/conditionals.d.ts +17 -0
- package/dist/node_modules/just-bash/dist/interpreter/control-flow.d.ts +21 -0
- package/dist/node_modules/just-bash/dist/interpreter/defense-aware-command-context.d.ts +6 -0
- package/dist/node_modules/just-bash/dist/interpreter/errors.d.ts +158 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/analysis.d.ts +37 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/arith-text-expansion.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/array-pattern-ops.d.ts +21 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/array-prefix-suffix.d.ts +46 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/array-slice-transform.d.ts +36 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/array-word-expansion.d.ts +39 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/brace-range.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/command-substitution.d.ts +23 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/glob-escape.d.ts +32 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/indirect-expansion.d.ts +42 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/parameter-ops.d.ts +113 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/pattern-expansion.d.ts +23 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/pattern-removal.d.ts +18 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/pattern.d.ts +23 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/positional-params.d.ts +59 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/prompt.d.ts +39 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/quoting.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/tilde.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/unquoted-expansion.d.ts +76 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/variable-attrs.d.ts +19 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/variable.d.ts +36 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/word-glob-expansion.d.ts +33 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion/word-split.d.ts +29 -0
- package/dist/node_modules/just-bash/dist/interpreter/expansion.d.ts +53 -0
- package/dist/node_modules/just-bash/dist/interpreter/functions.d.ts +12 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/array.d.ts +43 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/condition.d.ts +22 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/errors.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/file-tests.d.ts +33 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/ifs.d.ts +104 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/loop.d.ts +24 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/nameref.d.ts +65 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/quoting.d.ts +24 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/readonly.d.ts +45 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/regex.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/result.d.ts +60 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/shell-constants.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/shellopts.d.ts +28 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/statements.d.ts +20 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/string-compare.d.ts +24 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/string-tests.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/tilde.d.ts +13 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/variable-tests.d.ts +9 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/word-matching.d.ts +26 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/word-parts.d.ts +22 -0
- package/dist/node_modules/just-bash/dist/interpreter/helpers/xtrace.d.ts +18 -0
- package/dist/node_modules/just-bash/dist/interpreter/index.d.ts +3 -0
- package/dist/node_modules/just-bash/dist/interpreter/interpreter.d.ts +77 -0
- package/dist/node_modules/just-bash/dist/interpreter/pipeline-execution.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/interpreter/redirections.d.ts +51 -0
- package/dist/node_modules/just-bash/dist/interpreter/simple-command-assignments.d.ts +29 -0
- package/dist/node_modules/just-bash/dist/interpreter/subshell-group.d.ts +32 -0
- package/dist/node_modules/just-bash/dist/interpreter/type-command.d.ts +37 -0
- package/dist/node_modules/just-bash/dist/interpreter/types.d.ts +344 -0
- package/dist/node_modules/just-bash/dist/limits.d.ts +52 -0
- package/dist/node_modules/just-bash/dist/network/allow-list/shared.d.ts +57 -0
- package/dist/node_modules/just-bash/dist/network/allow-list.d.ts +59 -0
- package/dist/node_modules/just-bash/dist/network/fetch.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/network/index.d.ts +7 -0
- package/dist/node_modules/just-bash/dist/network/types.d.ts +155 -0
- package/dist/node_modules/just-bash/dist/parser/arithmetic-parser.d.ts +23 -0
- package/dist/node_modules/just-bash/dist/parser/arithmetic-primaries.d.ts +45 -0
- package/dist/node_modules/just-bash/dist/parser/command-parser.d.ts +10 -0
- package/dist/node_modules/just-bash/dist/parser/compound-parser.d.ts +28 -0
- package/dist/node_modules/just-bash/dist/parser/conditional-parser.d.ts +8 -0
- package/dist/node_modules/just-bash/dist/parser/expansion-parser.d.ts +16 -0
- package/dist/node_modules/just-bash/dist/parser/lexer.d.ts +197 -0
- package/dist/node_modules/just-bash/dist/parser/parser-substitution.d.ts +62 -0
- package/dist/node_modules/just-bash/dist/parser/parser.d.ts +135 -0
- package/dist/node_modules/just-bash/dist/parser/types.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/parser/word-parser.d.ts +33 -0
- package/dist/node_modules/just-bash/dist/sandbox/Command.d.ts +35 -0
- package/dist/node_modules/just-bash/dist/sandbox/Sandbox.d.ts +90 -0
- package/dist/node_modules/just-bash/dist/sandbox/index.d.ts +2 -0
- package/dist/node_modules/just-bash/dist/shell-metadata.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/timers.d.ts +4 -0
- package/dist/node_modules/just-bash/dist/types.d.ts +198 -0
- package/dist/node_modules/just-bash/dist/utils/args.d.ts +55 -0
- package/dist/node_modules/just-bash/dist/utils/constants.d.ts +15 -0
- package/dist/node_modules/just-bash/dist/utils/file-reader.d.ts +67 -0
- package/dist/node_modules/just-bash/dist/utils/glob.d.ts +25 -0
- package/dist/node_modules/just-bash/dist/vitest-setup.d.ts +1 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/GzipHandler.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/GzipHandler.js +19 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +26 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/ZipHandler.js +233 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/ZipToken.d.ts +94 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/ZipToken.js +117 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/index.d.ts +3 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/lib/index.js +2 -0
- package/dist/node_modules/just-bash/node_modules/@tokenizer/inflate/package.json +76 -0
- package/dist/node_modules/just-bash/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
- package/dist/node_modules/just-bash/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/dist/node_modules/just-bash/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/dist/node_modules/just-bash/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
- package/dist/node_modules/just-bash/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/dist/node_modules/just-bash/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/dist/node_modules/just-bash/node_modules/balanced-match/package.json +68 -0
- package/dist/node_modules/just-bash/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
- package/dist/node_modules/just-bash/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/dist/node_modules/just-bash/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/brace-expansion/dist/esm/index.js +197 -0
- package/dist/node_modules/just-bash/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/dist/node_modules/just-bash/node_modules/brace-expansion/package.json +64 -0
- package/dist/node_modules/just-bash/node_modules/debug/package.json +64 -0
- package/dist/node_modules/just-bash/node_modules/debug/src/browser.js +272 -0
- package/dist/node_modules/just-bash/node_modules/debug/src/common.js +292 -0
- package/dist/node_modules/just-bash/node_modules/debug/src/index.js +10 -0
- package/dist/node_modules/just-bash/node_modules/debug/src/node.js +263 -0
- package/dist/node_modules/just-bash/node_modules/diff/dist/diff.js +1782 -0
- package/dist/node_modules/just-bash/node_modules/diff/dist/diff.min.js +1 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/convert/dmp.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/convert/dmp.js +24 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/convert/xml.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/convert/xml.js +34 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/array.d.ts +19 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/array.js +40 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/base.d.ts +20 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/base.js +265 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/character.d.ts +19 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/character.js +31 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/css.d.ts +18 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/css.js +34 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/json.d.ts +24 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/json.js +105 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/line.d.ts +24 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/line.js +89 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/sentence.d.ts +21 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/sentence.js +67 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/word.d.ts +35 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/diff/word.js +312 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/index.d.ts +20 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/index.js +64 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/package.json +1 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/apply.d.ts +62 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/apply.js +267 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/create.d.ts +122 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/create.js +251 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/line-endings.d.ts +17 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/line-endings.js +61 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/parse.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/parse.js +150 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/reverse.d.ts +9 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/patch/reverse.js +37 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/types.d.ts +213 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/array.d.ts +3 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/array.js +21 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/distance-iterator.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/distance-iterator.js +40 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/params.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/params.js +17 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/string.d.ts +30 -0
- package/dist/node_modules/just-bash/node_modules/diff/libcjs/util/string.js +200 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/convert/dmp.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/convert/dmp.js +21 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/convert/xml.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/convert/xml.js +31 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/array.d.ts +19 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/array.js +16 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/base.d.ts +20 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/base.js +253 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/character.d.ts +19 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/character.js +7 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/css.d.ts +18 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/css.js +10 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/json.d.ts +24 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/json.js +78 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/line.d.ts +24 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/line.js +65 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/sentence.d.ts +21 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/sentence.js +43 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/word.d.ts +35 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/diff/word.js +281 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/index.d.ts +20 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/index.js +30 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/package.json +1 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/apply.d.ts +62 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/apply.js +257 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/create.d.ts +122 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/create.js +228 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/line-endings.d.ts +17 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/line-endings.js +44 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/parse.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/parse.js +147 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/reverse.d.ts +9 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/patch/reverse.js +23 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/types.d.ts +213 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/types.js +1 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/array.d.ts +3 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/array.js +17 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/distance-iterator.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/distance-iterator.js +37 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/params.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/params.js +14 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/string.d.ts +30 -0
- package/dist/node_modules/just-bash/node_modules/diff/libesm/util/string.js +184 -0
- package/dist/node_modules/just-bash/node_modules/diff/package.json +130 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/package.json +92 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/fxp.d.ts +445 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/util.js +68 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +104 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/validator.js +425 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +285 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +134 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js +0 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +379 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +46 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +629 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +71 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlparser/node2json.js +119 -0
- package/dist/node_modules/just-bash/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +40 -0
- package/dist/node_modules/just-bash/node_modules/file-type/core.d.ts +253 -0
- package/dist/node_modules/just-bash/node_modules/file-type/core.js +2899 -0
- package/dist/node_modules/just-bash/node_modules/file-type/index.d.ts +98 -0
- package/dist/node_modules/just-bash/node_modules/file-type/index.js +163 -0
- package/dist/node_modules/just-bash/node_modules/file-type/license +9 -0
- package/dist/node_modules/just-bash/node_modules/file-type/package.json +290 -0
- package/dist/node_modules/just-bash/node_modules/file-type/supported.js +360 -0
- package/dist/node_modules/just-bash/node_modules/file-type/util.js +60 -0
- package/dist/node_modules/just-bash/node_modules/ini/lib/ini.js +280 -0
- package/dist/node_modules/just-bash/node_modules/ini/package.json +45 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/ast.d.ts +22 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/ast.js +845 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/index.d.ts +174 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/index.js +1127 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/ast.d.ts +22 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/ast.js +841 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/index.d.ts +174 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/index.js +1114 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/package.json +3 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/dist/node_modules/just-bash/node_modules/minimatch/package.json +73 -0
- package/dist/node_modules/just-bash/node_modules/sprintf-js/dist/.gitattributes +4 -0
- package/dist/node_modules/just-bash/node_modules/sprintf-js/dist/angular-sprintf.min.js +3 -0
- package/dist/node_modules/just-bash/node_modules/sprintf-js/dist/sprintf.min.js +3 -0
- package/dist/node_modules/just-bash/node_modules/sprintf-js/package.json +35 -0
- package/dist/node_modules/just-bash/node_modules/sprintf-js/src/angular-sprintf.js +24 -0
- package/dist/node_modules/just-bash/node_modules/sprintf-js/src/sprintf.js +231 -0
- package/dist/node_modules/just-bash/node_modules/strnum/package.json +31 -0
- package/dist/node_modules/just-bash/node_modules/strnum/strnum.js +161 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/LICENSE.txt +21 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/AbstractTokenizer.d.ts +76 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/AbstractTokenizer.js +111 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/BlobTokenizer.js +53 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/BufferTokenizer.js +52 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/FileTokenizer.d.ts +37 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/FileTokenizer.js +61 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +34 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/ReadStreamTokenizer.js +107 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/core.d.ts +40 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/core.js +62 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/index.d.ts +16 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/index.js +22 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/AbstractStreamReader.js +71 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/Deferred.js +10 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/Errors.js +16 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/StreamReader.d.ts +29 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/StreamReader.js +83 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamByobReader.js +27 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +62 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +14 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/index.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/stream/index.js +5 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/types.d.ts +139 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/lib/types.js +1 -0
- package/dist/node_modules/just-bash/node_modules/strtok3/package.json +94 -0
- package/dist/node_modules/just-bash/node_modules/token-types/LICENSE.txt +9 -0
- package/dist/node_modules/just-bash/node_modules/token-types/lib/index.d.ts +135 -0
- package/dist/node_modules/just-bash/node_modules/token-types/lib/index.js +401 -0
- package/dist/node_modules/just-bash/node_modules/token-types/package.json +81 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/composer.js +217 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/errors.js +57 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/index.js +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/log.js +11 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/Alias.js +114 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/parse/lexer.js +717 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/parse/parser.js +967 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +64 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/util.js +11 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/dist/visit.js +233 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/index.js +5 -0
- package/dist/node_modules/just-bash/node_modules/yaml/browser/package.json +3 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/cli.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/composer.js +222 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/Document.js +337 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/doc/directives.js +178 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/errors.d.ts +21 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/errors.js +62 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/index.d.ts +25 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/index.js +50 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/log.d.ts +3 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/log.js +19 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Alias.js +116 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Scalar.d.ts +43 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/options.d.ts +350 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/cst.js +112 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/lexer.js +719 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/parse/parser.js +972 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/public-api.js +107 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/tags.js +99 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/test-events.js +134 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/util.d.ts +16 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/util.js +28 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/visit.d.ts +102 -0
- package/dist/node_modules/just-bash/node_modules/yaml/dist/visit.js +236 -0
- package/dist/node_modules/just-bash/node_modules/yaml/package.json +97 -0
- package/dist/node_modules/just-bash/node_modules/yaml/util.js +2 -0
- package/dist/node_modules/just-bash/package.json +1 -0
- package/dist/node_modules/just-bash/vendor/cpython-emscripten/python.cjs +2 -0
- package/dist/node_modules/just-bash/vendor/cpython-emscripten/python.wasm +0 -0
- package/dist/node_modules/just-bash/vendor/cpython-emscripten/python313.zip +0 -0
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-employee.js +9 -3
- package/dist/server/llm-providers/common/reasoning.d.ts +0 -7
- package/dist/server/llm-providers/common/reasoning.js +18 -36
- package/dist/server/llm-providers/mimo.d.ts +37 -0
- package/dist/server/llm-providers/mimo.js +156 -0
- package/dist/server/migrations/20260428175558-update-ai-employee-category.d.ts +14 -0
- package/dist/server/migrations/20260428175558-update-ai-employee-category.js +55 -0
- package/dist/server/migrations/20260429175132-ai-employee-deprecated-orin.d.ts +14 -0
- package/dist/server/migrations/20260429175132-ai-employee-deprecated-orin.js +53 -0
- package/dist/server/plugin.d.ts +2 -0
- package/dist/server/plugin.js +5 -3
- package/dist/server/resource/aiEmployees.js +10 -1
- package/dist/server/tools/docs.d.ts +7 -24
- package/dist/server/tools/docs.js +197 -400
- package/npm-shims/@mongodb-js/zstd/index.d.ts +2 -0
- package/npm-shims/@mongodb-js/zstd/index.js +6 -0
- package/npm-shims/@mongodb-js/zstd/package.json +9 -0
- package/npm-shims/node-liblzma/index.js +10 -0
- package/npm-shims/node-liblzma/package.json +9 -0
- package/package.json +4 -2
- package/dist/client/228.b18148eb1009d2fb.js +0 -10
- package/dist/client/343.83f7d96664e4e038.js +0 -10
- package/dist/client/559.133d286a0a0a1d93.js +0 -10
- package/dist/client/646.cba98d80e9e6ea74.js +0 -10
- package/dist/client/792.ae8ad1fcae9fd974.js +0 -10
- package/dist/node_modules/fast-glob/LICENSE +0 -21
- package/dist/node_modules/fast-glob/out/index.d.ts +0 -40
- package/dist/node_modules/fast-glob/out/index.js +0 -37
- package/dist/node_modules/fast-glob/out/managers/tasks.d.ts +0 -22
- package/dist/node_modules/fast-glob/out/managers/tasks.js +0 -110
- package/dist/node_modules/fast-glob/out/providers/async.d.ts +0 -9
- package/dist/node_modules/fast-glob/out/providers/async.js +0 -23
- package/dist/node_modules/fast-glob/out/providers/filters/deep.d.ts +0 -16
- package/dist/node_modules/fast-glob/out/providers/filters/deep.js +0 -62
- package/dist/node_modules/fast-glob/out/providers/filters/entry.d.ts +0 -16
- package/dist/node_modules/fast-glob/out/providers/filters/entry.js +0 -63
- package/dist/node_modules/fast-glob/out/providers/filters/error.d.ts +0 -8
- package/dist/node_modules/fast-glob/out/providers/filters/error.js +0 -15
- package/dist/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +0 -33
- package/dist/node_modules/fast-glob/out/providers/matchers/matcher.js +0 -45
- package/dist/node_modules/fast-glob/out/providers/matchers/partial.d.ts +0 -4
- package/dist/node_modules/fast-glob/out/providers/matchers/partial.js +0 -38
- package/dist/node_modules/fast-glob/out/providers/provider.d.ts +0 -19
- package/dist/node_modules/fast-glob/out/providers/provider.js +0 -48
- package/dist/node_modules/fast-glob/out/providers/stream.d.ts +0 -11
- package/dist/node_modules/fast-glob/out/providers/stream.js +0 -31
- package/dist/node_modules/fast-glob/out/providers/sync.d.ts +0 -9
- package/dist/node_modules/fast-glob/out/providers/sync.js +0 -23
- package/dist/node_modules/fast-glob/out/providers/transformers/entry.d.ts +0 -8
- package/dist/node_modules/fast-glob/out/providers/transformers/entry.js +0 -26
- package/dist/node_modules/fast-glob/out/readers/async.d.ts +0 -10
- package/dist/node_modules/fast-glob/out/readers/async.js +0 -35
- package/dist/node_modules/fast-glob/out/readers/reader.d.ts +0 -15
- package/dist/node_modules/fast-glob/out/readers/reader.js +0 -33
- package/dist/node_modules/fast-glob/out/readers/stream.d.ts +0 -14
- package/dist/node_modules/fast-glob/out/readers/stream.js +0 -55
- package/dist/node_modules/fast-glob/out/readers/sync.d.ts +0 -12
- package/dist/node_modules/fast-glob/out/readers/sync.js +0 -43
- package/dist/node_modules/fast-glob/out/settings.d.ts +0 -164
- package/dist/node_modules/fast-glob/out/settings.js +0 -59
- package/dist/node_modules/fast-glob/out/types/index.d.ts +0 -31
- package/dist/node_modules/fast-glob/out/utils/array.d.ts +0 -2
- package/dist/node_modules/fast-glob/out/utils/array.js +0 -22
- package/dist/node_modules/fast-glob/out/utils/errno.d.ts +0 -2
- package/dist/node_modules/fast-glob/out/utils/errno.js +0 -7
- package/dist/node_modules/fast-glob/out/utils/fs.d.ts +0 -4
- package/dist/node_modules/fast-glob/out/utils/fs.js +0 -19
- package/dist/node_modules/fast-glob/out/utils/index.d.ts +0 -8
- package/dist/node_modules/fast-glob/out/utils/index.js +0 -17
- package/dist/node_modules/fast-glob/out/utils/path.d.ts +0 -13
- package/dist/node_modules/fast-glob/out/utils/path.js +0 -68
- package/dist/node_modules/fast-glob/out/utils/pattern.d.ts +0 -47
- package/dist/node_modules/fast-glob/out/utils/pattern.js +0 -188
- package/dist/node_modules/fast-glob/out/utils/stream.d.ts +0 -4
- package/dist/node_modules/fast-glob/out/utils/stream.js +0 -17
- package/dist/node_modules/fast-glob/out/utils/string.d.ts +0 -2
- package/dist/node_modules/fast-glob/out/utils/string.js +0 -11
- package/dist/node_modules/fast-glob/package.json +0 -1
- package/dist/node_modules/flexsearch/LICENSE +0 -201
- package/dist/node_modules/flexsearch/dist/db/clickhouse/index.cjs +0 -727
- package/dist/node_modules/flexsearch/dist/db/indexeddb/index.cjs +0 -680
- package/dist/node_modules/flexsearch/dist/db/mongodb/index.cjs +0 -710
- package/dist/node_modules/flexsearch/dist/db/postgres/index.cjs +0 -932
- package/dist/node_modules/flexsearch/dist/db/redis/index.cjs +0 -591
- package/dist/node_modules/flexsearch/dist/db/sqlite/index.cjs +0 -871
- package/dist/node_modules/flexsearch/dist/flexsearch.bundle.debug.js +0 -2926
- package/dist/node_modules/flexsearch/dist/flexsearch.bundle.min.js +0 -8
- package/dist/node_modules/flexsearch/dist/flexsearch.bundle.module.debug.js +0 -2922
- package/dist/node_modules/flexsearch/dist/flexsearch.bundle.module.min.js +0 -108
- package/dist/node_modules/flexsearch/dist/flexsearch.compact.debug.js +0 -1652
- package/dist/node_modules/flexsearch/dist/flexsearch.compact.min.js +0 -58
- package/dist/node_modules/flexsearch/dist/flexsearch.compact.module.debug.js +0 -1648
- package/dist/node_modules/flexsearch/dist/flexsearch.compact.module.min.js +0 -59
- package/dist/node_modules/flexsearch/dist/flexsearch.es5.debug.js +0 -3944
- package/dist/node_modules/flexsearch/dist/flexsearch.es5.min.js +0 -144
- package/dist/node_modules/flexsearch/dist/flexsearch.light.debug.js +0 -651
- package/dist/node_modules/flexsearch/dist/flexsearch.light.min.js +0 -28
- package/dist/node_modules/flexsearch/dist/flexsearch.light.module.debug.js +0 -647
- package/dist/node_modules/flexsearch/dist/flexsearch.light.module.min.js +0 -29
- package/dist/node_modules/flexsearch/dist/lang/de.min.js +0 -2
- package/dist/node_modules/flexsearch/dist/lang/en.min.js +0 -2
- package/dist/node_modules/flexsearch/dist/lang/fr.min.js +0 -3
- package/dist/node_modules/flexsearch/dist/module/async.js +0 -72
- package/dist/node_modules/flexsearch/dist/module/bundle.js +0 -330
- package/dist/node_modules/flexsearch/dist/module/cache.js +0 -118
- package/dist/node_modules/flexsearch/dist/module/charset/cjk.js +0 -8
- package/dist/node_modules/flexsearch/dist/module/charset/exact.js +0 -10
- package/dist/node_modules/flexsearch/dist/module/charset/latin/advanced.js +0 -15
- package/dist/node_modules/flexsearch/dist/module/charset/latin/balance.js +0 -10
- package/dist/node_modules/flexsearch/dist/module/charset/latin/extra.js +0 -14
- package/dist/node_modules/flexsearch/dist/module/charset/latin/soundex.js +0 -53
- package/dist/node_modules/flexsearch/dist/module/charset/normalize.js +0 -5
- package/dist/node_modules/flexsearch/dist/module/charset/polyfill.js +0 -1
- package/dist/node_modules/flexsearch/dist/module/charset.js +0 -40
- package/dist/node_modules/flexsearch/dist/module/common.js +0 -135
- package/dist/node_modules/flexsearch/dist/module/compress.js +0 -64
- package/dist/node_modules/flexsearch/dist/module/db/clickhouse/index.js +0 -569
- package/dist/node_modules/flexsearch/dist/module/db/indexeddb/index.js +0 -516
- package/dist/node_modules/flexsearch/dist/module/db/interface.js +0 -51
- package/dist/node_modules/flexsearch/dist/module/db/mongodb/index.js +0 -571
- package/dist/node_modules/flexsearch/dist/module/db/postgres/index.js +0 -624
- package/dist/node_modules/flexsearch/dist/module/db/redis/index.js +0 -461
- package/dist/node_modules/flexsearch/dist/module/db/sqlite/index.js +0 -707
- package/dist/node_modules/flexsearch/dist/module/document/add.js +0 -228
- package/dist/node_modules/flexsearch/dist/module/document/highlight.js +0 -448
- package/dist/node_modules/flexsearch/dist/module/document/search.js +0 -515
- package/dist/node_modules/flexsearch/dist/module/document.js +0 -485
- package/dist/node_modules/flexsearch/dist/module/encoder.js +0 -453
- package/dist/node_modules/flexsearch/dist/module/index/add.js +0 -229
- package/dist/node_modules/flexsearch/dist/module/index/remove.js +0 -101
- package/dist/node_modules/flexsearch/dist/module/index/search.js +0 -326
- package/dist/node_modules/flexsearch/dist/module/index.js +0 -184
- package/dist/node_modules/flexsearch/dist/module/intersect.js +0 -272
- package/dist/node_modules/flexsearch/dist/module/keystore.js +0 -349
- package/dist/node_modules/flexsearch/dist/module/lang/de.js +0 -43
- package/dist/node_modules/flexsearch/dist/module/lang/en.js +0 -40
- package/dist/node_modules/flexsearch/dist/module/lang/fr.js +0 -27
- package/dist/node_modules/flexsearch/dist/module/preset.js +0 -53
- package/dist/node_modules/flexsearch/dist/module/profiler.js +0 -9
- package/dist/node_modules/flexsearch/dist/module/resolve/and.js +0 -84
- package/dist/node_modules/flexsearch/dist/module/resolve/default.js +0 -76
- package/dist/node_modules/flexsearch/dist/module/resolve/handler.js +0 -216
- package/dist/node_modules/flexsearch/dist/module/resolve/not.js +0 -89
- package/dist/node_modules/flexsearch/dist/module/resolve/or.js +0 -49
- package/dist/node_modules/flexsearch/dist/module/resolve/xor.js +0 -124
- package/dist/node_modules/flexsearch/dist/module/resolver.js +0 -257
- package/dist/node_modules/flexsearch/dist/module/serialize.js +0 -468
- package/dist/node_modules/flexsearch/dist/module/type.js +0 -305
- package/dist/node_modules/flexsearch/dist/module/worker/handler.js +0 -77
- package/dist/node_modules/flexsearch/dist/module/worker/node.js +0 -73
- package/dist/node_modules/flexsearch/dist/module/worker/worker.js +0 -2
- package/dist/node_modules/flexsearch/dist/module/worker.js +0 -146
- package/dist/node_modules/flexsearch/dist/module-debug/async.js +0 -72
- package/dist/node_modules/flexsearch/dist/module-debug/bundle.js +0 -330
- package/dist/node_modules/flexsearch/dist/module-debug/cache.js +0 -118
- package/dist/node_modules/flexsearch/dist/module-debug/charset/cjk.js +0 -8
- package/dist/node_modules/flexsearch/dist/module-debug/charset/exact.js +0 -10
- package/dist/node_modules/flexsearch/dist/module-debug/charset/latin/advanced.js +0 -15
- package/dist/node_modules/flexsearch/dist/module-debug/charset/latin/balance.js +0 -10
- package/dist/node_modules/flexsearch/dist/module-debug/charset/latin/extra.js +0 -14
- package/dist/node_modules/flexsearch/dist/module-debug/charset/latin/soundex.js +0 -53
- package/dist/node_modules/flexsearch/dist/module-debug/charset/normalize.js +0 -5
- package/dist/node_modules/flexsearch/dist/module-debug/charset/polyfill.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-debug/charset.js +0 -40
- package/dist/node_modules/flexsearch/dist/module-debug/common.js +0 -135
- package/dist/node_modules/flexsearch/dist/module-debug/compress.js +0 -64
- package/dist/node_modules/flexsearch/dist/module-debug/db/clickhouse/index.js +0 -569
- package/dist/node_modules/flexsearch/dist/module-debug/db/indexeddb/index.js +0 -516
- package/dist/node_modules/flexsearch/dist/module-debug/db/interface.js +0 -51
- package/dist/node_modules/flexsearch/dist/module-debug/db/mongodb/index.js +0 -571
- package/dist/node_modules/flexsearch/dist/module-debug/db/postgres/index.js +0 -624
- package/dist/node_modules/flexsearch/dist/module-debug/db/redis/index.js +0 -461
- package/dist/node_modules/flexsearch/dist/module-debug/db/sqlite/index.js +0 -707
- package/dist/node_modules/flexsearch/dist/module-debug/document/add.js +0 -229
- package/dist/node_modules/flexsearch/dist/module-debug/document/highlight.js +0 -458
- package/dist/node_modules/flexsearch/dist/module-debug/document/search.js +0 -537
- package/dist/node_modules/flexsearch/dist/module-debug/document.js +0 -489
- package/dist/node_modules/flexsearch/dist/module-debug/encoder.js +0 -457
- package/dist/node_modules/flexsearch/dist/module-debug/index/add.js +0 -229
- package/dist/node_modules/flexsearch/dist/module-debug/index/remove.js +0 -101
- package/dist/node_modules/flexsearch/dist/module-debug/index/search.js +0 -326
- package/dist/node_modules/flexsearch/dist/module-debug/index.js +0 -190
- package/dist/node_modules/flexsearch/dist/module-debug/intersect.js +0 -272
- package/dist/node_modules/flexsearch/dist/module-debug/keystore.js +0 -349
- package/dist/node_modules/flexsearch/dist/module-debug/lang/de.js +0 -43
- package/dist/node_modules/flexsearch/dist/module-debug/lang/en.js +0 -40
- package/dist/node_modules/flexsearch/dist/module-debug/lang/fr.js +0 -27
- package/dist/node_modules/flexsearch/dist/module-debug/preset.js +0 -56
- package/dist/node_modules/flexsearch/dist/module-debug/profiler.js +0 -9
- package/dist/node_modules/flexsearch/dist/module-debug/resolve/and.js +0 -84
- package/dist/node_modules/flexsearch/dist/module-debug/resolve/default.js +0 -76
- package/dist/node_modules/flexsearch/dist/module-debug/resolve/handler.js +0 -228
- package/dist/node_modules/flexsearch/dist/module-debug/resolve/not.js +0 -89
- package/dist/node_modules/flexsearch/dist/module-debug/resolve/or.js +0 -49
- package/dist/node_modules/flexsearch/dist/module-debug/resolve/xor.js +0 -124
- package/dist/node_modules/flexsearch/dist/module-debug/resolver.js +0 -261
- package/dist/node_modules/flexsearch/dist/module-debug/serialize.js +0 -468
- package/dist/node_modules/flexsearch/dist/module-debug/type.js +0 -305
- package/dist/node_modules/flexsearch/dist/module-debug/worker/handler.js +0 -85
- package/dist/node_modules/flexsearch/dist/module-debug/worker/node.js +0 -73
- package/dist/node_modules/flexsearch/dist/module-debug/worker/worker.js +0 -2
- package/dist/node_modules/flexsearch/dist/module-debug/worker.js +0 -148
- package/dist/node_modules/flexsearch/dist/module-min/async.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/bundle.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/cache.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/cjk.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/exact.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/latin/advanced.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/latin/balance.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/latin/extra.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/latin/soundex.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/normalize.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset/polyfill.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/charset.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/common.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/compress.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/db/clickhouse/index.js +0 -130
- package/dist/node_modules/flexsearch/dist/module-min/db/indexeddb/index.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/db/interface.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/db/mongodb/index.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/db/postgres/index.js +0 -135
- package/dist/node_modules/flexsearch/dist/module-min/db/redis/index.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/db/sqlite/index.js +0 -119
- package/dist/node_modules/flexsearch/dist/module-min/document/add.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/document/highlight.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/document/search.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/document.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/encoder.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/index/add.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/index/remove.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/index/search.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/index.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/intersect.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/keystore.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/lang/de.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/lang/en.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/lang/fr.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/preset.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/profiler.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/resolve/and.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/resolve/default.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/resolve/handler.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/resolve/not.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/resolve/or.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/resolve/xor.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/resolver.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/serialize.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/type.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/worker/handler.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/worker/node.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/worker/worker.js +0 -1
- package/dist/node_modules/flexsearch/dist/module-min/worker.js +0 -1
- package/dist/node_modules/flexsearch/dist/node/node.js +0 -84
- package/dist/node_modules/flexsearch/index.d.ts +0 -1140
- package/dist/node_modules/flexsearch/node.js +0 -84
- package/dist/node_modules/flexsearch/package.json +0 -1
- package/dist/node_modules/flexsearch/src/async.js +0 -78
- package/dist/node_modules/flexsearch/src/bundle.js +0 -392
- package/dist/node_modules/flexsearch/src/cache.js +0 -125
- package/dist/node_modules/flexsearch/src/charset/cjk.js +0 -14
- package/dist/node_modules/flexsearch/src/charset/exact.js +0 -12
- package/dist/node_modules/flexsearch/src/charset/latin/advanced.js +0 -34
- package/dist/node_modules/flexsearch/src/charset/latin/balance.js +0 -47
- package/dist/node_modules/flexsearch/src/charset/latin/extra.js +0 -17
- package/dist/node_modules/flexsearch/src/charset/latin/soundex.js +0 -55
- package/dist/node_modules/flexsearch/src/charset/normalize.js +0 -11
- package/dist/node_modules/flexsearch/src/charset/old/arabic/default.js +0 -15
- package/dist/node_modules/flexsearch/src/charset/old/cjk/default.js +0 -13
- package/dist/node_modules/flexsearch/src/charset/old/cyrillic/default.js +0 -13
- package/dist/node_modules/flexsearch/src/charset/old/greek/default.js +0 -39
- package/dist/node_modules/flexsearch/src/charset/polyfill.js +0 -233
- package/dist/node_modules/flexsearch/src/charset.js +0 -41
- package/dist/node_modules/flexsearch/src/common.js +0 -142
- package/dist/node_modules/flexsearch/src/compress.js +0 -78
- package/dist/node_modules/flexsearch/src/config.js +0 -56
- package/dist/node_modules/flexsearch/src/db/clickhouse/index.js +0 -704
- package/dist/node_modules/flexsearch/src/db/clickhouse/package.json +0 -10
- package/dist/node_modules/flexsearch/src/db/indexeddb/index.js +0 -709
- package/dist/node_modules/flexsearch/src/db/interface.js +0 -62
- package/dist/node_modules/flexsearch/src/db/mongodb/index.js +0 -714
- package/dist/node_modules/flexsearch/src/db/mongodb/package.json +0 -10
- package/dist/node_modules/flexsearch/src/db/postgres/index.js +0 -1008
- package/dist/node_modules/flexsearch/src/db/postgres/package.json +0 -10
- package/dist/node_modules/flexsearch/src/db/redis/index.js +0 -587
- package/dist/node_modules/flexsearch/src/db/redis/package.json +0 -10
- package/dist/node_modules/flexsearch/src/db/sqlite/index.js +0 -848
- package/dist/node_modules/flexsearch/src/db/sqlite/package.json +0 -10
- package/dist/node_modules/flexsearch/src/document/add.js +0 -267
- package/dist/node_modules/flexsearch/src/document/highlight.js +0 -838
- package/dist/node_modules/flexsearch/src/document/search.js +0 -661
- package/dist/node_modules/flexsearch/src/document.js +0 -581
- package/dist/node_modules/flexsearch/src/encoder.js +0 -637
- package/dist/node_modules/flexsearch/src/index/add.js +0 -330
- package/dist/node_modules/flexsearch/src/index/remove.js +0 -173
- package/dist/node_modules/flexsearch/src/index/search.js +0 -436
- package/dist/node_modules/flexsearch/src/index.js +0 -290
- package/dist/node_modules/flexsearch/src/intersect.js +0 -718
- package/dist/node_modules/flexsearch/src/keystore.js +0 -441
- package/dist/node_modules/flexsearch/src/lang/de.js +0 -207
- package/dist/node_modules/flexsearch/src/lang/en.js +0 -337
- package/dist/node_modules/flexsearch/src/lang/fr.js +0 -233
- package/dist/node_modules/flexsearch/src/preset.js +0 -63
- package/dist/node_modules/flexsearch/src/profiler.js +0 -24
- package/dist/node_modules/flexsearch/src/resolve/and.js +0 -108
- package/dist/node_modules/flexsearch/src/resolve/default.js +0 -91
- package/dist/node_modules/flexsearch/src/resolve/handler.js +0 -287
- package/dist/node_modules/flexsearch/src/resolve/not.js +0 -104
- package/dist/node_modules/flexsearch/src/resolve/or.js +0 -65
- package/dist/node_modules/flexsearch/src/resolve/xor.js +0 -140
- package/dist/node_modules/flexsearch/src/resolver.js +0 -307
- package/dist/node_modules/flexsearch/src/serialize.js +0 -526
- package/dist/node_modules/flexsearch/src/type.js +0 -306
- package/dist/node_modules/flexsearch/src/worker/handler.js +0 -100
- package/dist/node_modules/flexsearch/src/worker/node.js +0 -84
- package/dist/node_modules/flexsearch/src/worker/worker.js +0 -2
- package/dist/node_modules/flexsearch/src/worker.js +0 -207
- package/dist/node_modules/flexsearch/task/babel.bundle.json +0 -47
- package/dist/node_modules/flexsearch/task/babel.debug.json +0 -47
- package/dist/node_modules/flexsearch/task/babel.js +0 -144
- package/dist/node_modules/flexsearch/task/babel.min.json +0 -49
- package/dist/node_modules/flexsearch/task/build.js +0 -513
- /package/dist/node_modules/{fast-glob/out/types/index.js → just-bash/node_modules/diff/libcjs/types.js} +0 -0
|
@@ -0,0 +1,1513 @@
|
|
|
1
|
+
var k7=Object.create;var La=Object.defineProperty;var N7=Object.getOwnPropertyDescriptor;var I7=Object.getOwnPropertyNames;var $7=Object.getPrototypeOf,O7=Object.prototype.hasOwnProperty;var qn=(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 v=(e,t)=>()=>(e&&(t=e(e=0)),t);var Oi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),J=(e,t)=>{for(var n in t)La(e,n,{get:t[n],enumerable:!0})},R7=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of I7(t))!O7.call(e,s)&&s!==n&&La(e,s,{get:()=>t[s],enumerable:!(r=N7(t,s))||r.enumerable});return e};var Af=(e,t,n)=>(n=e!=null?k7($7(e)):{},R7(t||!e||!e.__esModule?La(n,"default",{value:e,enumerable:!0}):n,e));function Sf(){let e=[{prop:"Function",target:globalThis,violationType:"function_constructor",strategy:"throw",reason:"Function constructor allows arbitrary code execution"},{prop:"eval",target:globalThis,violationType:"eval",strategy:"throw",reason:"eval() allows arbitrary code execution"},{prop:"setTimeout",target:globalThis,violationType:"setTimeout",strategy:"throw",reason:"setTimeout with string argument allows code execution"},{prop:"setInterval",target:globalThis,violationType:"setInterval",strategy:"throw",reason:"setInterval with string argument allows code execution"},{prop:"setImmediate",target:globalThis,violationType:"setImmediate",strategy:"throw",reason:"setImmediate could be used to escape sandbox context"},{prop:"env",target:process,violationType:"process_env",strategy:"throw",reason:"process.env could leak sensitive environment variables",allowedKeys:new Set(["NODE_V8_COVERAGE","NODE_DEBUG","NODE_DEBUG_NATIVE","NODE_COMPILE_CACHE","WATCH_REPORT_DEPENDENCIES","FORCE_COLOR","DEBUG","UNDICI_NO_FG","JEST_WORKER_ID","__MINIMATCH_TESTING_PLATFORM__","LOG_TOKENS","LOG_STREAM"])},{prop:"binding",target:process,violationType:"process_binding",strategy:"throw",reason:"process.binding provides access to native Node.js modules"},{prop:"_linkedBinding",target:process,violationType:"process_binding",strategy:"throw",reason:"process._linkedBinding provides access to native Node.js modules"},{prop:"dlopen",target:process,violationType:"process_dlopen",strategy:"throw",reason:"process.dlopen allows loading native addons"},{prop:"getBuiltinModule",target:process,violationType:"process_get_builtin_module",strategy:"throw",reason:"process.getBuiltinModule allows loading native Node.js modules (fs, child_process, vm)"},{prop:"exit",target:process,violationType:"process_exit",strategy:"throw",reason:"process.exit could terminate the interpreter"},{prop:"abort",target:process,violationType:"process_exit",strategy:"throw",reason:"process.abort could crash the interpreter"},{prop:"kill",target:process,violationType:"process_kill",strategy:"throw",reason:"process.kill could signal other processes"},{prop:"setuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setuid could escalate privileges"},{prop:"setgid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgid could escalate privileges"},{prop:"seteuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.seteuid could escalate effective user privileges"},{prop:"setegid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setegid could escalate effective group privileges"},{prop:"initgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.initgroups could modify supplementary group IDs"},{prop:"setgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgroups could modify supplementary group IDs"},{prop:"umask",target:process,violationType:"process_umask",strategy:"throw",reason:"process.umask could modify file creation permissions"},{prop:"argv",target:process,violationType:"process_argv",strategy:"throw",reason:"process.argv may contain secrets in CLI arguments"},{prop:"cwd",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.cwd could disclose real host working directory path"},{prop:"chdir",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.chdir could confuse the interpreter's CWD tracking"},{prop:"report",target:process,violationType:"process_report",strategy:"throw",reason:"process.report could disclose full environment, host paths, and system info"},{prop:"loadEnvFile",target:process,violationType:"process_env",strategy:"throw",reason:"process.loadEnvFile could load env files bypassing env proxy"},{prop:"setUncaughtExceptionCaptureCallback",target:process,violationType:"process_exception_handler",strategy:"throw",reason:"setUncaughtExceptionCaptureCallback could intercept security errors"},{prop:"send",target:process,violationType:"process_send",strategy:"throw",reason:"process.send could communicate with parent process in IPC contexts"},{prop:"channel",target:process,violationType:"process_channel",strategy:"throw",reason:"process.channel could access IPC channel to parent process"},{prop:"cpuUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.cpuUsage could enable timing side-channel attacks"},{prop:"memoryUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.memoryUsage could enable timing side-channel attacks"},{prop:"hrtime",target:process,violationType:"process_timing",strategy:"throw",reason:"process.hrtime could enable timing side-channel attacks"},{prop:"WeakRef",target:globalThis,violationType:"weak_ref",strategy:"throw",reason:"WeakRef could be used to leak references outside sandbox"},{prop:"FinalizationRegistry",target:globalThis,violationType:"finalization_registry",strategy:"throw",reason:"FinalizationRegistry could be used to leak references outside sandbox"},{prop:"Reflect",target:globalThis,violationType:"reflect",strategy:"freeze",reason:"Reflect provides introspection capabilities"},{prop:"Proxy",target:globalThis,violationType:"proxy",strategy:"throw",reason:"Proxy allows intercepting and modifying object behavior"},{prop:"WebAssembly",target:globalThis,violationType:"webassembly",strategy:"throw",reason:"WebAssembly allows executing arbitrary compiled code"},{prop:"SharedArrayBuffer",target:globalThis,violationType:"shared_array_buffer",strategy:"throw",reason:"SharedArrayBuffer could enable side-channel communication or timing attacks"},{prop:"Atomics",target:globalThis,violationType:"atomics",strategy:"throw",reason:"Atomics could enable side-channel communication or timing attacks"},{prop:"performance",target:globalThis,violationType:"performance_timing",strategy:"throw",reason:"performance.now() provides sub-millisecond timing for side-channel attacks"},{prop:"stdout",target:process,violationType:"process_stdout",strategy:"throw",reason:"process.stdout could bypass interpreter output to write to host stdout"},{prop:"stderr",target:process,violationType:"process_stderr",strategy:"throw",reason:"process.stderr could bypass interpreter output to write to host stderr"},{prop:"__defineGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineGetter__ allows prototype pollution via getter injection"},{prop:"__defineSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineSetter__ allows prototype pollution via setter injection"},{prop:"__lookupGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupGetter__ enables introspection for prototype pollution attacks"},{prop:"__lookupSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupSetter__ enables introspection for prototype pollution attacks"},{prop:"JSON",target:globalThis,violationType:"json_mutation",strategy:"freeze",reason:"Freeze JSON to prevent mutation of parsing/serialization"},{prop:"Math",target:globalThis,violationType:"math_mutation",strategy:"freeze",reason:"Freeze Math to prevent mutation of math utilities"}];try{let t=Object.getPrototypeOf(async()=>{}).constructor;t&&t!==Function&&e.push({prop:"constructor",target:Object.getPrototypeOf(async()=>{}),violationType:"async_function_constructor",strategy:"throw",reason:"AsyncFunction constructor allows arbitrary async code execution"})}catch{}try{let t=Object.getPrototypeOf(function*(){}).constructor;t&&t!==Function&&e.push({prop:"constructor",target:Object.getPrototypeOf(function*(){}),violationType:"generator_function_constructor",strategy:"throw",reason:"GeneratorFunction constructor allows arbitrary generator code execution"})}catch{}try{let t=Object.getPrototypeOf(async function*(){}).constructor;t&&t!==Function&&t!==Object.getPrototypeOf(async()=>{}).constructor&&e.push({prop:"constructor",target:Object.getPrototypeOf(async function*(){}),violationType:"async_generator_function_constructor",strategy:"throw",reason:"AsyncGeneratorFunction constructor allows arbitrary async generator code execution"})}catch{}return e.filter(t=>{try{return t.target[t.prop]!==void 0}catch{return!1}})}var Cf=v(()=>{"use strict"});function vf(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function D7(e,t,...n){return Fe.run(e,()=>t(...n))}function _7(e){return e===void 0?{...Ma,enabled:!1}:typeof e=="boolean"?{...Ma,enabled:e}:{...Ma,...e}}var rr,Ua,T7,he,Fe,P7,Ma,wt,an=v(()=>{"use strict";Cf();rr=!0;Ua=null;if(!rr)try{let{AsyncLocalStorage:e}=qn("node:async_hooks");Ua=e}catch{}T7=`
|
|
2
|
+
|
|
3
|
+
This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`,he=class extends Error{violation;constructor(t,n){super(t+T7),this.violation=n,this.name="SecurityViolationError"}},Fe=!rr&&Ua?new Ua:null,P7=1e3;Ma={enabled:!0,auditMode:!1};wt=class e{static instance=null;static importHooksRegistered=!1;static trustedExecutionDepth=new Map;config;refCount=0;patchFailures=[];activeExecutionIds=new Set;contextCache=new Map;originalDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(t){this.config=t}static getInstance(t){let n=_7(t);if(!e.instance)e.instance=new e(n);else{let r=e.instance.config;if(n.enabled!==r.enabled||n.auditMode!==r.auditMode)throw new Error(`DefenseInDepthBox config conflict: requested {enabled: ${n.enabled}, auditMode: ${n.auditMode}} but singleton already has {enabled: ${r.enabled}, auditMode: ${r.auditMode}}. All Bash instances must use the same defense-in-depth security settings, or call DefenseInDepthBox.resetInstance() between incompatible configurations.`)}return e.instance}static resetInstance(){e.instance&&(e.instance.forceDeactivate(),e.instance=null),e.trustedExecutionDepth.clear()}static isInSandboxedContext(){return Fe?Fe?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(Fe)return Fe?.getStore()?.executionId}static enterTrustedScope(t){let n=e.trustedExecutionDepth.get(t)??0;e.trustedExecutionDepth.set(t,n+1)}static leaveTrustedScope(t){let n=e.trustedExecutionDepth.get(t);if(n){if(n===1){e.trustedExecutionDepth.delete(t);return}e.trustedExecutionDepth.set(t,n-1)}}static isTrustedScopeActive(t){return t?(e.trustedExecutionDepth.get(t)??0)>0:!1}isExecutionIdActive(t){return this.activeExecutionIds.has(t)}getCachedContext(t){let n=this.contextCache.get(t);return n||(n={sandboxActive:!0,executionId:t},this.contextCache.set(t,n)),n}getPreferredActiveExecutionId(){if(this.activeExecutionIds.size!==0)for(let t of this.activeExecutionIds)return t}static bindCurrentContext(t){if(!Fe)return t;let n=e.instance,r=Fe.getStore(),s=r?.sandboxActive===!0?r.executionId:n?.getPreferredActiveExecutionId();if(!s)return t;let i=n?.getCachedContext(s)??{sandboxActive:!0,executionId:s};return((...o)=>{let a=e.instance;if(!(a&&!a.isExecutionIdActive(s)&&(a.recordViolation("bound_callback_after_deactivate","bound callback","Bound callback blocked after originating execution was deactivated"),!a.config.auditMode)))return D7(i,t,...o)})}isEnabled(){return this.config.enabled===!0&&Fe!==null&&!rr}updateConfig(t){this.config={...this.config,...t}}activate(){if(rr||!this.config.enabled||!Fe){let r=vf(),s=!1;return{run:i=>s?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):i(),deactivate:()=>{s=!0},executionId:r}}this.refCount++,this.refCount===1&&(this.applyPatches(),this.activationTime=Date.now());let t=vf(),n=!1;return{run:r=>n?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):(this.activeExecutionIds.add(t),Fe.run({sandboxActive:!0,executionId:t},r)),deactivate:()=>{n||(n=!0,this.activeExecutionIds.delete(t),this.contextCache.delete(t),this.refCount--,this.refCount===0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount<0&&(this.refCount=0))},executionId:t}}forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0}isActive(){return this.refCount>0}getStats(){return{violationsBlocked:this.violations.length,violations:[...this.violations],activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}getPatchFailures(){return[...this.patchFailures]}clearViolations(){this.violations=[]}getPathForTarget(t,n){return t===globalThis?`globalThis.${n}`:t===process?`process.${n}`:t===Error?`Error.${n}`:t===Function.prototype?`Function.prototype.${n}`:t===Object.prototype?`Object.prototype.${n}`:`<object>.${n}`}static runTrusted(t){if(!Fe)return t();let n=Fe.getStore();if(!n)return t();let{executionId:r}=n;return Fe.run({...n,trusted:!0},()=>{e.enterTrustedScope(r);try{let s=t();return typeof s=="object"&&s!==null&&"finally"in s&&typeof s.finally=="function"?s.finally(()=>{e.leaveTrustedScope(r)}):(e.leaveTrustedScope(r),s)}catch(s){throw e.leaveTrustedScope(r),s}})}static async runTrustedAsync(t){if(!Fe)return t();let n=Fe.getStore();if(!n)return t();let{executionId:r}=n;return Fe.run({...n,trusted:!0},async()=>{e.enterTrustedScope(r);try{return await t()}finally{e.leaveTrustedScope(r)}})}shouldBlock(){if(rr||this.config.auditMode||!Fe)return!1;let t=Fe?.getStore();return!(t?.sandboxActive!==!0||t.trusted||e.isTrustedScopeActive(t.executionId))}recordViolation(t,n,r){let s={timestamp:Date.now(),type:t,message:r,path:n,stack:new Error().stack,executionId:Fe?.getStore()?.executionId};if(this.violations.length<P7&&this.violations.push(s),this.config.onViolation)try{this.config.onViolation(s)}catch(i){console.debug("[DefenseInDepthBox] onViolation callback threw:",i instanceof Error?i.message:i)}return s}createBlockingProxy(t,n,r){let s=this;return new Proxy(t,{apply(i,o,a){if(s.shouldBlock()){let l=`${n} is blocked during script execution`,c=s.recordViolation(r,n,l);throw new he(l,c)}return s.config.auditMode&&Fe?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} called (audit mode)`),Reflect.apply(i,o,a)},construct(i,o,a){if(s.shouldBlock()){let l=`${n} constructor is blocked during script execution`,c=s.recordViolation(r,n,l);throw new he(l,c)}return s.config.auditMode&&Fe?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} constructor called (audit mode)`),Reflect.construct(i,o,a)}})}createBlockingObjectProxy(t,n,r,s){let i=this;return new Proxy(t,{get(o,a,l){if(i.shouldBlock()){if(s&&typeof a=="string"&&s.has(a))return Reflect.get(o,a,l);let c=`${n}.${String(a)}`,u=`${c} is blocked during script execution`,f=i.recordViolation(r,c,u);throw new he(u,f)}if(i.config.auditMode&&Fe?.getStore()?.sandboxActive===!0){let c=`${n}.${String(a)}`;i.recordViolation(r,c,`${c} accessed (audit mode)`)}return Reflect.get(o,a,l)},set(o,a,l,c){if(i.shouldBlock()){let u=`${n}.${String(a)}`,f=`${u} modification is blocked during script execution`,p=i.recordViolation(r,u,f);throw new he(f,p)}return Reflect.set(o,a,l,c)},ownKeys(o){if(i.shouldBlock()){let a=`${n} enumeration is blocked during script execution`,l=i.recordViolation(r,n,a);throw new he(a,l)}return Reflect.ownKeys(o)},getOwnPropertyDescriptor(o,a){if(i.shouldBlock()){let l=`${n}.${String(a)}`,c=`${l} descriptor access is blocked during script execution`,u=i.recordViolation(r,l,c);throw new he(c,u)}return Reflect.getOwnPropertyDescriptor(o,a)},has(o,a){if(i.shouldBlock()){let l=`${n}.${String(a)}`,c=`${l} existence check is blocked during script execution`,u=i.recordViolation(r,l,c);throw new he(c,u)}return Reflect.has(o,a)},deleteProperty(o,a){if(i.shouldBlock()){let l=`${n}.${String(a)}`,c=`${l} deletion is blocked during script execution`,u=i.recordViolation(r,l,c);throw new he(c,u)}return Reflect.deleteProperty(o,a)},setPrototypeOf(o,a){if(i.shouldBlock()){let l=`${n} setPrototypeOf is blocked during script execution`,c=i.recordViolation(r,n,l);throw new he(l,c)}return Reflect.setPrototypeOf(o,a)},defineProperty(o,a,l){if(i.shouldBlock()){let c=`${n}.${String(a)}`,u=`${c} defineProperty is blocked during script execution`,f=i.recordViolation(r,c,u);throw new he(u,f)}return Reflect.defineProperty(o,a,l)}})}applyPatches(){this.patchFailures=[];let t=Sf(),n=new Set(["process_send","process_channel","process_stdout","process_stderr"]);for(let i of t)n.has(i.violationType)||this.applyPatch(i);this.protectConstructorChain(),this.protectErrorPrepareStackTrace(),this.protectPromiseThen(),this.protectDynamicImport(),this.protectModuleLoad(),this.protectModuleResolveFilename(),this.protectProcessMainModule(),this.protectProcessExecPath(),this.lockWellKnownSymbols(),this.protectProxyRevocable();let r=["Function.prototype.constructor","Module._load"],s=this.patchFailures.filter(i=>r.includes(i));if(s.length>0)throw this.restorePatches(),new Error(`DefenseInDepthBox: critical patches failed: ${s.join(", ")}`)}protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,"Function.prototype.constructor","function_constructor");try{let t=Object.getPrototypeOf(async()=>{}).constructor;t&&t!==Function&&this.patchPrototypeConstructor(t.prototype,"AsyncFunction.prototype.constructor","async_function_constructor")}catch(t){this.patchFailures.push("AsyncFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:",t instanceof Error?t.message:t)}try{let t=Object.getPrototypeOf(function*(){}).constructor;t&&t!==Function&&this.patchPrototypeConstructor(t.prototype,"GeneratorFunction.prototype.constructor","generator_function_constructor")}catch(t){this.patchFailures.push("GeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:",t instanceof Error?t.message:t)}try{let t=Object.getPrototypeOf(async function*(){}).constructor,n=Object.getPrototypeOf(async()=>{}).constructor;t&&t!==Function&&t!==n&&this.patchPrototypeConstructor(t.prototype,"AsyncGeneratorFunction.prototype.constructor","async_generator_function_constructor")}catch(t){this.patchFailures.push("AsyncGeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:",t instanceof Error?t.message:t)}}protectErrorPrepareStackTrace(){let t=this;try{let n=Object.getOwnPropertyDescriptor(Error,"prepareStackTrace");this.originalDescriptors.push({target:Error,prop:"prepareStackTrace",descriptor:n});let r=n?.value;Object.defineProperty(Error,"prepareStackTrace",{get(){return r},set(s){if(t.shouldBlock()){let i="Error.prepareStackTrace modification is blocked during script execution",o=t.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",i);throw new he(i,o)}t.config.auditMode&&Fe?.getStore()?.sandboxActive===!0&&t.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),r=s},configurable:!0})}catch(n){this.patchFailures.push("Error.prepareStackTrace"),console.debug("[DefenseInDepthBox] Could not protect Error.prepareStackTrace:",n instanceof Error?n.message:n)}}protectPromiseThen(){let t=this;try{let i=function(...o){return Fe.run(this.captured,()=>{if(!this.box.isExecutionIdActive(this.executionId)){if(this.box.recordViolation("promise_then_after_deactivate","Promise.then","Promise.then callback is blocked after defense deactivation"),this.box.config.auditMode)return Reflect.apply(this.cb,void 0,o);if(this.kind==="fulfilled")return o[0];throw o[0]}return Reflect.apply(this.cb,void 0,o)})};var n=i;let r=Object.getOwnPropertyDescriptor(Promise.prototype,"then");this.originalDescriptors.push({target:Promise.prototype,prop:"then",descriptor:r});let s=r?.value;if(typeof s!="function")return;Object.defineProperty(Promise.prototype,"then",{value:function(a,l){if(!Fe)return Reflect.apply(s,this,[a,l]);let c=Fe.getStore(),u=c?.sandboxActive===!0&&c.trusted!==!0?c.executionId:void 0;if(!u)return Reflect.apply(s,this,[a,l]);let f=t.getCachedContext(u),p=(h,d)=>typeof h!="function"?h:i.bind({box:t,executionId:u,captured:f,cb:h,kind:d});return Reflect.apply(s,this,[p(a,"fulfilled"),p(l,"rejected")])},writable:!0,configurable:!0})}catch(r){this.patchFailures.push("Promise.prototype.then"),console.debug("[DefenseInDepthBox] Could not protect Promise.prototype.then:",r instanceof Error?r.message:r)}}patchPrototypeConstructor(t,n,r){let s=this;try{let i=Object.getOwnPropertyDescriptor(t,"constructor");this.originalDescriptors.push({target:t,prop:"constructor",descriptor:i});let o=i?.value;Object.defineProperty(t,"constructor",{get(){if(s.shouldBlock()){let a=`${n} access is blocked during script execution`,l=s.recordViolation(r,n,a);throw new he(a,l)}return s.config.auditMode&&Fe?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} accessed (audit mode)`),o},set(a){if(s.shouldBlock()){let l=`${n} modification is blocked during script execution`,c=s.recordViolation(r,n,l);throw new he(l,c)}Object.defineProperty(this,"constructor",{value:a,writable:!0,configurable:!0})},configurable:!0})}catch(i){this.patchFailures.push(n),console.debug(`[DefenseInDepthBox] Could not patch ${n}:`,i instanceof Error?i.message:i)}}protectProcessMainModule(){if(typeof process>"u")return;let t=this;try{let n=Object.getOwnPropertyDescriptor(process,"mainModule");this.originalDescriptors.push({target:process,prop:"mainModule",descriptor:n});let r=n?.value;r!==void 0&&Object.defineProperty(process,"mainModule",{get(){if(t.shouldBlock()){let s="process.mainModule access is blocked during script execution",i=t.recordViolation("process_main_module","process.mainModule",s);throw new he(s,i)}return t.config.auditMode&&Fe?.getStore()?.sandboxActive===!0&&t.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),r},set(s){if(t.shouldBlock()){let i="process.mainModule modification is blocked during script execution",o=t.recordViolation("process_main_module","process.mainModule",i);throw new he(i,o)}Object.defineProperty(process,"mainModule",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(n){this.patchFailures.push("process.mainModule"),console.debug("[DefenseInDepthBox] Could not protect process.mainModule:",n instanceof Error?n.message:n)}}protectProcessExecPath(){if(typeof process>"u")return;let t=this;try{let n=Object.getOwnPropertyDescriptor(process,"execPath");this.originalDescriptors.push({target:process,prop:"execPath",descriptor:n});let r=n?.value??process.execPath;Object.defineProperty(process,"execPath",{get(){if(t.shouldBlock()){let s="process.execPath access is blocked during script execution",i=t.recordViolation("process_exec_path","process.execPath",s);throw new he(s,i)}return t.config.auditMode&&Fe?.getStore()?.sandboxActive===!0&&t.recordViolation("process_exec_path","process.execPath","process.execPath accessed (audit mode)"),r},set(s){if(t.shouldBlock()){let i="process.execPath modification is blocked during script execution",o=t.recordViolation("process_exec_path","process.execPath",i);throw new he(i,o)}Object.defineProperty(process,"execPath",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(n){this.patchFailures.push("process.execPath"),console.debug("[DefenseInDepthBox] Could not protect process.execPath:",n instanceof Error?n.message:n)}}lockWellKnownSymbols(){let t=(n,r)=>{try{let s=Object.getOwnPropertyDescriptor(n,r);if(s?.configurable){if("value"in s){Object.defineProperty(n,r,{...s,configurable:!1,writable:!1});return}Object.defineProperty(n,r,{...s,configurable:!1})}}catch{}};for(let n of[Array,Map,Set,RegExp,Promise])t(n,Symbol.species);for(let n of[Array.prototype,String.prototype,Map.prototype,Set.prototype])t(n,Symbol.iterator);t(Symbol.prototype,Symbol.toPrimitive),t(Date.prototype,Symbol.toPrimitive);for(let n of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])t(RegExp.prototype,n);t(Function.prototype,Symbol.hasInstance),t(Array.prototype,Symbol.unscopables);for(let n of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])t(n,Symbol.toStringTag);try{let n=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");this.originalDescriptors.push({target:Error,prop:"stackTraceLimit",descriptor:n}),Object.defineProperty(Error,"stackTraceLimit",{value:Error.stackTraceLimit,writable:!1,configurable:!0})}catch{}}protectProxyRevocable(){let t=this;try{let n=Proxy.revocable;if(typeof n!="function")return;let r=Object.getOwnPropertyDescriptor(Proxy,"revocable");this.originalDescriptors.push({target:Proxy,prop:"revocable",descriptor:r}),Object.defineProperty(Proxy,"revocable",{value:function(i,o){if(t.shouldBlock()){let a="Proxy.revocable is blocked during script execution",l=t.recordViolation("proxy","Proxy.revocable",a);throw new he(a,l)}return t.config.auditMode&&Fe?.getStore()?.sandboxActive===!0&&t.recordViolation("proxy","Proxy.revocable","Proxy.revocable called (audit mode)"),n(i,o)},writable:!1,configurable:!0})}catch(n){this.patchFailures.push("Proxy.revocable"),console.debug("[DefenseInDepthBox] Could not protect Proxy.revocable:",n instanceof Error?n.message:n)}}protectDynamicImport(){if(!(rr||e.importHooksRegistered))try{let t=this,n=qn("node:module"),r=new Set;for(let o of n.builtinModules??[]){let a=o.startsWith("node:")?o.slice(5):o;r.add(a);let l=a.indexOf("/");l>0&&r.add(a.slice(0,l))}let s=o=>{if(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.startsWith("file:")||o.startsWith("data:")||o.startsWith("blob:")||o.startsWith("http:")||o.startsWith("https:"))return!1;let a=o.startsWith("node:")?o.slice(5):o;if(!a)return!1;if(typeof n.isBuiltin=="function"&&n.isBuiltin(a)||r.has(a))return!0;let l=a.indexOf("/");return l>0&&r.has(a.slice(0,l))},i=()=>{let o=Fe?.getStore();return t.config.auditMode===!0&&o?.sandboxActive===!0&&o.trusted!==!0&&!e.isTrustedScopeActive(o.executionId)};if(typeof n.registerHooks=="function"){n.registerHooks({resolve(o,a,l){if(o.startsWith("data:")||o.startsWith("blob:"))throw new Error(`dynamic import of ${o.startsWith("data:")?"data:":"blob:"} URLs is blocked by defense-in-depth`);if(s(o)){let c=`import(${o})`,u=`dynamic import of Node.js builtin '${o}' is blocked during script execution`;if(t.shouldBlock()){let f=t.recordViolation("dynamic_import_builtin",c,u);throw new he(u,f)}i()&&t.recordViolation("dynamic_import_builtin",c,`dynamic import of Node.js builtin '${o}' called (audit mode)`)}return l(o,a)}}),e.importHooksRegistered=!0;return}if(typeof n.register=="function"){let o=["export async function resolve(specifier, context, nextResolve) {",' if (specifier.startsWith("data:") || specifier.startsWith("blob:")) {',' throw new Error("dynamic import of " + (specifier.startsWith("data:") ? "data:" : "blob:") + " URLs is blocked by defense-in-depth");'," }"," return nextResolve(specifier, context);","}"].join(`
|
|
4
|
+
`);n.register(`data:text/javascript,${encodeURIComponent(o)}`),e.importHooksRegistered=!0}}catch(t){console.debug("[DefenseInDepthBox] Could not register import() hooks:",t instanceof Error?t.message:t)}}protectModuleLoad(){if(!rr)try{let t=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(t=o.constructor)}if(!t&&typeof qn<"u"&&typeof qn.main<"u"&&(t=qn.main.constructor),!t||typeof t._load!="function")return;let n=t._load,r=Object.getOwnPropertyDescriptor(t,"_load");this.originalDescriptors.push({target:t,prop:"_load",descriptor:r});let i=this.createBlockingProxy(n,"Module._load","module_load");Object.defineProperty(t,"_load",{value:i,writable:!0,configurable:!0})}catch(t){this.patchFailures.push("Module._load"),console.debug("[DefenseInDepthBox] Could not protect Module._load:",t instanceof Error?t.message:t)}}protectModuleResolveFilename(){if(!rr)try{let t=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(t=o.constructor)}if(!t&&typeof qn<"u"&&typeof qn.main<"u"&&(t=qn.main.constructor),!t||typeof t._resolveFilename!="function")return;let n=t._resolveFilename,r=Object.getOwnPropertyDescriptor(t,"_resolveFilename");this.originalDescriptors.push({target:t,prop:"_resolveFilename",descriptor:r});let i=this.createBlockingProxy(n,"Module._resolveFilename","module_resolve_filename");Object.defineProperty(t,"_resolveFilename",{value:i,writable:!0,configurable:!0})}catch(t){this.patchFailures.push("Module._resolveFilename"),console.debug("[DefenseInDepthBox] Could not protect Module._resolveFilename:",t instanceof Error?t.message:t)}}applyPatch(t){let{target:n,prop:r,violationType:s,strategy:i}=t;try{let o=n[r];if(o===void 0)return;let a=Object.getOwnPropertyDescriptor(n,r);if(this.originalDescriptors.push({target:n,prop:r,descriptor:a}),i==="freeze")typeof o=="object"&&o!==null&&Object.freeze(o);else{let l=this.getPathForTarget(n,r),c=typeof o=="function"?this.createBlockingProxy(o,l,s):this.createBlockingObjectProxy(o,l,s,t.allowedKeys);Object.defineProperty(n,r,{value:c,writable:!0,configurable:!0})}}catch(o){let a=this.getPathForTarget(n,r);this.patchFailures.push(a),console.debug(`[DefenseInDepthBox] Could not patch ${a}:`,o instanceof Error?o.message:o)}}restorePatches(){for(let t=this.originalDescriptors.length-1;t>=0;t--){let{target:n,prop:r,descriptor:s}=this.originalDescriptors[t];try{s?Object.defineProperty(n,r,s):delete n[r]}catch(i){let o=this.getPathForTarget(n,r);console.debug(`[DefenseInDepthBox] Could not restore ${o}:`,i instanceof Error?i.message:i)}}this.originalDescriptors=[]}}});function M7(e){return typeof e!="function"?e:wt.bindCurrentContext(e)}var F7,L7,kv,Nv,Sr,Qr,zs=v(()=>{"use strict";an();F7=globalThis.setTimeout.bind(globalThis),L7=globalThis.clearTimeout.bind(globalThis),kv=globalThis.setInterval.bind(globalThis),Nv=globalThis.clearInterval.bind(globalThis);Sr=((e,t,...n)=>F7(M7(e),t,...n)),Qr=L7});var kf={};J(kf,{echoCommand:()=>B7,flagsForFuzzing:()=>W7});function U7(e){let t="",n=0;for(;n<e.length;)if(e[n]==="\\"){if(n+1>=e.length){t+="\\";break}let r=e[n+1];switch(r){case"\\":t+="\\",n+=2;break;case"n":t+=`
|
|
5
|
+
`,n+=2;break;case"t":t+=" ",n+=2;break;case"r":t+="\r",n+=2;break;case"a":t+="\x07",n+=2;break;case"b":t+="\b",n+=2;break;case"f":t+="\f",n+=2;break;case"v":t+="\v",n+=2;break;case"e":case"E":t+="\x1B",n+=2;break;case"c":return{output:t,stop:!0};case"0":{let s="",i=n+2;for(;i<e.length&&i<n+5&&/[0-7]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\0";else{let o=parseInt(s,8)%256;t+=String.fromCharCode(o)}n=i;break}case"x":{let s="",i=n+2;for(;i<e.length&&i<n+4&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\\x",n+=2;else{let o=parseInt(s,16);t+=String.fromCharCode(o),n=i}break}case"u":{let s="",i=n+2;for(;i<e.length&&i<n+6&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\\u",n+=2;else{let o=parseInt(s,16);t+=String.fromCodePoint(o),n=i}break}case"U":{let s="",i=n+2;for(;i<e.length&&i<n+10&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\\U",n+=2;else{let o=parseInt(s,16);try{t+=String.fromCodePoint(o)}catch{t+=`\\U${s}`}n=i}break}default:t+=`\\${r}`,n+=2}}else t+=e[n],n++;return{output:t,stop:!1}}var B7,W7,Nf=v(()=>{"use strict";B7={name:"echo",async execute(e,t){let n=!1,r=t.xpgEcho??!1,s=0;for(;s<e.length;){let o=e[s];if(o==="-n")n=!0,s++;else if(o==="-e")r=!0,s++;else if(o==="-E")r=!1,s++;else if(o==="-ne"||o==="-en")n=!0,r=!0,s++;else break}let i=e.slice(s).join(" ");if(r){let o=U7(i);if(i=o.output,o.stop)return{stdout:i,stderr:"",exitCode:0}}return n||(i+=`
|
|
6
|
+
`),{stdout:i,stderr:"",exitCode:0}}},W7={name:"echo",flags:[{flag:"-n",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-E",type:"boolean"}],stdinType:"none",needsArgs:!0}});function U(e){let t=`${e.name} - ${e.summary}
|
|
7
|
+
|
|
8
|
+
`;if(t+=`Usage: ${e.usage}
|
|
9
|
+
`,e.description){if(t+=`
|
|
10
|
+
Description:
|
|
11
|
+
`,typeof e.description=="string")for(let n of e.description.split(`
|
|
12
|
+
`))t+=n?` ${n}
|
|
13
|
+
`:`
|
|
14
|
+
`;else if(e.description.length>0)for(let n of e.description)t+=n?` ${n}
|
|
15
|
+
`:`
|
|
16
|
+
`}if(e.options&&e.options.length>0){t+=`
|
|
17
|
+
Options:
|
|
18
|
+
`;for(let n of e.options)t+=` ${n}
|
|
19
|
+
`}if(e.examples&&e.examples.length>0){t+=`
|
|
20
|
+
Examples:
|
|
21
|
+
`;for(let n of e.examples)t+=` ${n}
|
|
22
|
+
`}if(e.notes&&e.notes.length>0){t+=`
|
|
23
|
+
Notes:
|
|
24
|
+
`;for(let n of e.notes)t+=` ${n}
|
|
25
|
+
`}return{stdout:t,stderr:"",exitCode:0}}function B(e){return e.includes("--help")}function Z(e,t){return{stdout:"",stderr:t.startsWith("--")?`${e}: unrecognized option '${t}'
|
|
26
|
+
`:`${e}: invalid option -- '${t.replace(/^-/,"")}'
|
|
27
|
+
`,exitCode:1}}var ne=v(()=>{"use strict"});function Ee(e,t,n){let r=new Map,s=new Map;for(let[l,c]of Object.entries(n)){let u={name:l,type:c.type};c.short&&r.set(c.short,u),c.long&&s.set(c.long,u)}let i=Object.create(null);for(let[l,c]of Object.entries(n))c.default!==void 0?i[l]=c.default:c.type==="boolean"&&(i[l]=!1);let o=[],a=!1;for(let l=0;l<t.length;l++){let c=t[l];if(a||!c.startsWith("-")||c==="-"){o.push(c);continue}if(c==="--"){a=!0;continue}if(c.startsWith("--")){let u=c.indexOf("="),f,p;u!==-1?(f=c.slice(2,u),p=c.slice(u+1)):f=c.slice(2);let h=s.get(f);if(!h)return{ok:!1,error:Z(e,c)};let{name:d,type:m}=h;if(m==="boolean")i[d]=!0;else{if(p===void 0){if(l+1>=t.length)return{ok:!1,error:{stdout:"",stderr:`${e}: option '--${f}' requires an argument
|
|
28
|
+
`,exitCode:1}};p=t[++l]}i[d]=m==="number"?parseInt(p,10):p}}else{let u=c.slice(1);for(let f=0;f<u.length;f++){let p=u[f],h=r.get(p);if(!h)return{ok:!1,error:Z(e,`-${p}`)};let{name:d,type:m}=h;if(m==="boolean")i[d]=!0;else{let g;if(f+1<u.length)g=u.slice(f+1);else if(l+1<t.length)g=t[++l];else return{ok:!1,error:{stdout:"",stderr:`${e}: option requires an argument -- '${p}'
|
|
29
|
+
`,exitCode:1}};i[d]=m==="number"?parseInt(g,10):g;break}}}}return{ok:!0,result:{flags:i,positional:o}}}var st=v(()=>{"use strict";ne()});var Xr=v(()=>{"use strict"});async function Cr(e,t,n){let{cmdName:r,allowStdinMarker:s=!0,stopOnError:i=!1,batchSize:o=100}=n;if(t.length===0)return{files:[{filename:"",content:e.stdin}],stderr:"",exitCode:0};let a=[],l="",c=0;for(let u=0;u<t.length;u+=o){let f=t.slice(u,u+o),p=await Promise.all(f.map(async h=>{if(s&&h==="-")return{filename:"-",content:e.stdin,error:null};try{let d=e.fs.resolvePath(e.cwd,h),m=await e.fs.readFile(d,"binary");return{filename:h,content:m,error:null}}catch{return{filename:h,content:"",error:`${r}: ${h}: No such file or directory
|
|
30
|
+
`}}}));for(let h of p)if(h.error){if(l+=h.error,c=1,i)return{files:a,stderr:l,exitCode:c}}else a.push({filename:h.filename,content:h.content})}return{files:a,stderr:l,exitCode:c}}async function Yr(e,t,n){let r=await Cr(e,t,{...n,stopOnError:!0});return r.exitCode!==0?{ok:!1,error:{stdout:"",stderr:r.stderr,exitCode:r.exitCode}}:{ok:!0,content:r.files.map(i=>i.content).join("")}}var vr=v(()=>{"use strict";Xr()});var If={};J(If,{catCommand:()=>j7,flagsForFuzzing:()=>V7});function G7(e,t){let n=e.split(`
|
|
31
|
+
`),r=e.endsWith(`
|
|
32
|
+
`),s=r?n.slice(0,-1):n;return{content:s.map((o,a)=>`${String(t+a).padStart(6," ")} ${o}`).join(`
|
|
33
|
+
`)+(r?`
|
|
34
|
+
`:""),nextLineNumber:t+s.length}}var z7,H7,j7,V7,$f=v(()=>{"use strict";st();vr();ne();z7={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-n, --number number all output lines"," --help display this help and exit"]},H7={number:{short:"n",long:"number",type:"boolean"}},j7={name:"cat",async execute(e,t){if(B(e))return U(z7);let n=Ee("cat",e,H7);if(!n.ok)return n.error;let r=n.result.flags.number,s=n.result.positional,i=await Cr(t,s,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),o="",a=1;for(let{content:c}of i.files)if(r){let u=G7(c,a);o+=u.content,a=u.nextLineNumber}else o+=c;let l=s.length>0&&s.some(c=>c!=="-");return{stdout:o,stderr:i.stderr,exitCode:i.exitCode,...l?{stdoutEncoding:"binary"}:{}}}};V7={name:"cat",flags:[{flag:"-n",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-t",type:"boolean"}],stdinType:"text",needsFiles:!0}});function Ri(e){return e instanceof vt||e instanceof kt||e instanceof xt}var Ct,vt,kt,xt,Bt,$t,ge,De,Ot,Rn,Jr,Q,es,Tn,Jt,xe=v(()=>{"use strict";Ct=class extends Error{stdout;stderr;constructor(t,n="",r=""){super(t),this.stdout=n,this.stderr=r}prependOutput(t,n){this.stdout=t+this.stdout,this.stderr=n+this.stderr}},vt=class extends Ct{levels;name="BreakError";constructor(t=1,n="",r=""){super("break",n,r),this.levels=t}},kt=class extends Ct{levels;name="ContinueError";constructor(t=1,n="",r=""){super("continue",n,r),this.levels=t}},xt=class extends Ct{exitCode;name="ReturnError";constructor(t=0,n="",r=""){super("return",n,r),this.exitCode=t}},Bt=class extends Ct{exitCode;name="ErrexitError";constructor(t,n="",r=""){super(`errexit: command exited with status ${t}`,n,r),this.exitCode=t}},$t=class extends Ct{varName;name="NounsetError";constructor(t,n=""){super(`${t}: unbound variable`,n,`bash: ${t}: unbound variable
|
|
35
|
+
`),this.varName=t}},ge=class extends Ct{exitCode;name="ExitError";constructor(t,n="",r=""){super("exit",n,r),this.exitCode=t}},De=class extends Ct{name="ArithmeticError";fatal;constructor(t,n="",r="",s=!1){super(t,n,r),this.stderr=r||`bash: ${t}
|
|
36
|
+
`,this.fatal=s}},Ot=class extends Ct{name="BadSubstitutionError";constructor(t,n="",r=""){super(t,n,r),this.stderr=r||`bash: ${t}: bad substitution
|
|
37
|
+
`}},Rn=class extends Ct{name="GlobError";constructor(t,n="",r=""){super(`no match: ${t}`,n,r),this.stderr=r||`bash: no match: ${t}
|
|
38
|
+
`}},Jr=class extends Ct{name="BraceExpansionError";constructor(t,n="",r=""){super(t,n,r),this.stderr=r||`bash: ${t}
|
|
39
|
+
`}},Q=class extends Ct{limitType;name="ExecutionLimitError";static EXIT_CODE=126;constructor(t,n,r="",s=""){super(t,r,s),this.limitType=n,this.stderr=s||`bash: ${t}
|
|
40
|
+
`}},es=class extends Ct{name="ExecutionAbortedError";constructor(t="",n=""){super("execution aborted",t,n)}},Tn=class extends Ct{name="SubshellExitError";constructor(t="",n=""){super("subshell exit",t,n)}};Jt=class extends Ct{exitCode;name="PosixFatalError";constructor(t,n="",r=""){super("posix fatal error",n,r),this.exitCode=t}}});function qe(e){return e instanceof Error?e.message:String(e)}var en=v(()=>{"use strict"});function Ti(e,t,n){let r=e;n>=0&&r.length>n&&(r=r.slice(0,n));let s=Math.abs(t);return s>r.length&&(t<0?r=r.padEnd(s," "):r=r.padStart(s," ")),r}function Of(e,t){let n=t,r=0,s=-1,i=!1;for(n<e.length&&e[n]==="-"&&(i=!0,n++);n<e.length&&/\d/.test(e[n]);)r=r*10+parseInt(e[n],10),n++;if(n<e.length&&e[n]===".")for(n++,s=0;n<e.length&&/\d/.test(e[n]);)s=s*10+parseInt(e[n],10),n++;return i&&r>0&&(r=-r),[r,s,n-t]}function Pi(e){let t="",n=0;for(;n<e.length;)if(e[n]==="\\"&&n+1<e.length)switch(e[n+1]){case"n":t+=`
|
|
41
|
+
`,n+=2;break;case"t":t+=" ",n+=2;break;case"r":t+="\r",n+=2;break;case"\\":t+="\\",n+=2;break;case"a":t+="\x07",n+=2;break;case"b":t+="\b",n+=2;break;case"f":t+="\f",n+=2;break;case"v":t+="\v",n+=2;break;case"e":case"E":t+="\x1B",n+=2;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let s="",i=n+1;for(;i<e.length&&i<n+4&&/[0-7]/.test(e[i]);)s+=e[i],i++;t+=String.fromCharCode(parseInt(s,8)),n=i;break}case"x":{let s=[],i=n;for(;i+3<e.length&&e[i]==="\\"&&e[i+1]==="x"&&/[0-9a-fA-F]{2}/.test(e.slice(i+2,i+4));)s.push(parseInt(e.slice(i+2,i+4),16)),i+=4;if(s.length>0){try{let o=new TextDecoder("utf-8",{fatal:!0});t+=o.decode(new Uint8Array(s))}catch{for(let o of s)t+=String.fromCharCode(o)}n=i}else t+=e[n],n++;break}case"u":{let s="",i=n+2;for(;i<e.length&&i<n+6&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;s?(t+=String.fromCodePoint(parseInt(s,16)),n=i):(t+="\\u",n+=2);break}case"U":{let s="",i=n+2;for(;i<e.length&&i<n+10&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;s?(t+=String.fromCodePoint(parseInt(s,16)),n=i):(t+="\\U",n+=2);break}default:t+=e[n],n++}else t+=e[n],n++;return t}var Ba=v(()=>{"use strict"});function Pf(e,t,n){let r=new Date(t*1e3),s="",i=0;for(;i<e.length;)if(e[i]==="%"&&i+1<e.length){let o=e[i+1],a=Z7(r,o,n);a!==null?(s+=a,i+=2):(s+=e[i],i++)}else s+=e[i],i++;return s}function q7(e,t){let n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",hour12:!1,timeZone:t};try{let s=new Intl.DateTimeFormat("en-US",n).formatToParts(e),i=l=>s.find(c=>c.type===l)?.value??"",o=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),a=i("weekday");return{year:Number.parseInt(i("year"),10)||e.getFullYear(),month:Number.parseInt(i("month"),10)||e.getMonth()+1,day:Number.parseInt(i("day"),10)||e.getDate(),hour:Number.parseInt(i("hour"),10)||e.getHours(),minute:Number.parseInt(i("minute"),10)||e.getMinutes(),second:Number.parseInt(i("second"),10)||e.getSeconds(),weekday:o.get(a)??e.getDay()}}catch{return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),weekday:e.getDay()}}}function Z7(e,t,n){let r=q7(e,n),s=(l,c=2)=>String(l).padStart(c,"0"),i=Df(r.year,r.month,r.day),o=Rf(r.year,r.month,r.day,r.weekday,0),a=Rf(r.year,r.month,r.day,r.weekday,1);switch(t){case"a":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][r.weekday];case"A":return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][r.weekday];case"b":case"h":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.month-1];case"B":return["January","February","March","April","May","June","July","August","September","October","November","December"][r.month-1];case"c":return`${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][r.weekday]} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.month-1]} ${String(r.day).padStart(2," ")} ${s(r.hour)}:${s(r.minute)}:${s(r.second)} ${r.year}`;case"C":return s(Math.floor(r.year/100));case"d":return s(r.day);case"D":return`${s(r.month)}/${s(r.day)}/${s(r.year%100)}`;case"e":return String(r.day).padStart(2," ");case"F":return`${r.year}-${s(r.month)}-${s(r.day)}`;case"g":return s(Tf(r.year,r.month,r.day)%100);case"G":return String(Tf(r.year,r.month,r.day));case"H":return s(r.hour);case"I":return s(r.hour%12||12);case"j":return String(i).padStart(3,"0");case"k":return String(r.hour).padStart(2," ");case"l":return String(r.hour%12||12).padStart(2," ");case"m":return s(r.month);case"M":return s(r.minute);case"n":return`
|
|
42
|
+
`;case"N":return"000000000";case"p":return r.hour<12?"AM":"PM";case"P":return r.hour<12?"am":"pm";case"r":return`${s(r.hour%12||12)}:${s(r.minute)}:${s(r.second)} ${r.hour<12?"AM":"PM"}`;case"R":return`${s(r.hour)}:${s(r.minute)}`;case"s":return String(Math.floor(e.getTime()/1e3));case"S":return s(r.second);case"t":return" ";case"T":return`${s(r.hour)}:${s(r.minute)}:${s(r.second)}`;case"u":return String(r.weekday===0?7:r.weekday);case"U":return s(o);case"V":return s(X7(r.year,r.month,r.day));case"w":return String(r.weekday);case"W":return s(a);case"x":return`${s(r.month)}/${s(r.day)}/${s(r.year%100)}`;case"X":return`${s(r.hour)}:${s(r.minute)}:${s(r.second)}`;case"y":return s(r.year%100);case"Y":return String(r.year);case"z":return K7(e,n);case"Z":return Q7(e,n);case"%":return"%";default:return null}}function K7(e,t){if(!t){let o=-e.getTimezoneOffset(),a=o>=0?"+":"-",l=Math.floor(Math.abs(o)/60),c=Math.abs(o)%60;return`${a}${String(l).padStart(2,"0")}${String(c).padStart(2,"0")}`}try{let l=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).formatToParts(e).find(c=>c.type==="timeZoneName");if(l){let c=l.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(c)return`${c[1]}${c[2]}${c[3]}`;if(l.value==="GMT"||l.value==="UTC")return"+0000"}}catch{}let n=-e.getTimezoneOffset(),r=n>=0?"+":"-",s=Math.floor(Math.abs(n)/60),i=Math.abs(n)%60;return`${r}${String(s).padStart(2,"0")}${String(i).padStart(2,"0")}`}function Q7(e,t){try{return new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"short"}).formatToParts(e).find(i=>i.type==="timeZoneName")?.value??"UTC"}catch{return"UTC"}}function Df(e,t,n){let r=[31,28,31,30,31,30,31,31,30,31,30,31];(e%4===0&&e%100!==0||e%400===0)&&(r[1]=29);let i=n;for(let o=0;o<t-1;o++)i+=r[o];return i}function Rf(e,t,n,r,s){let i=Df(e,t,n),l=(new Date(e,0,1).getDay()-s+7)%7,c=(r-s+7)%7,u=i-1+l;return Math.floor((u-c+7)/7)}function X7(e,t,n){let r=new Date(e,t-1,n,12,0,0);r.setDate(r.getDate()+3-(r.getDay()+6)%7);let s=new Date(r.getFullYear(),0,4);s.setDate(s.getDate()+3-(s.getDay()+6)%7);let i=r.getTime()-s.getTime();return 1+Math.round(i/(10080*60*1e3))}function Tf(e,t,n){let r=new Date(e,t-1,n,12,0,0);return r.setDate(r.getDate()+3-(r.getDay()+6)%7),r.getFullYear()}var _f=v(()=>{"use strict"});var Lf={};J(Lf,{flagsForFuzzing:()=>u4,printfCommand:()=>e4});import{sprintf as ts}from"sprintf-js";function Y7(e){let t="",n=0;for(;n<e.length;){let r=e[n];if(r<128){t+=String.fromCharCode(r),n++;continue}if((r&224)===192){if(n+1<e.length&&(e[n+1]&192)===128&&r>=194){let s=(r&31)<<6|e[n+1]&63;t+=String.fromCharCode(s),n+=2;continue}t+=String.fromCharCode(r),n++;continue}if((r&240)===224){if(n+2<e.length&&(e[n+1]&192)===128&&(e[n+2]&192)===128){if(r===224&&e[n+1]<160){t+=String.fromCharCode(r),n++;continue}let s=(r&15)<<12|(e[n+1]&63)<<6|e[n+2]&63;if(s>=55296&&s<=57343){t+=String.fromCharCode(r),n++;continue}t+=String.fromCharCode(s),n+=3;continue}t+=String.fromCharCode(r),n++;continue}if((r&248)===240&&r<=244){if(n+3<e.length&&(e[n+1]&192)===128&&(e[n+2]&192)===128&&(e[n+3]&192)===128){if(r===240&&e[n+1]<144){t+=String.fromCharCode(r),n++;continue}let s=(r&7)<<18|(e[n+1]&63)<<12|(e[n+2]&63)<<6|e[n+3]&63;if(s>1114111){t+=String.fromCharCode(r),n++;continue}t+=String.fromCodePoint(s),n+=4;continue}t+=String.fromCharCode(r),n++;continue}t+=String.fromCharCode(r),n++}return t}function t4(e,t,n,r){let s="",i=0,o=0,a=!1,l="";for(;i<e.length;)if(e[i]==="%"&&i+1<e.length){let c=i;if(i++,e[i]==="%"){s+="%",i++;continue}let u=e.slice(c).match(/^%(-?\d*)(?:\.(\d+))?\(([^)]*)\)T/);if(u){let A=u[1]?parseInt(u[1],10):0,$=u[2]?parseInt(u[2],10):-1,O=u[3],F=u[0],P=t[n+o]||"";o++;let M;P===""||P==="-1"||P==="-2"?M=Math.floor(Date.now()/1e3):M=parseInt(P,10)||0;let C=Pf(O,M,r);if($>=0&&C.length>$&&(C=C.slice(0,$)),A!==0){let N=Math.abs(A);C.length<N&&(A<0?C=C.padEnd(N," "):C=C.padStart(N," "))}s+=C,i=c+F.length;continue}for(;i<e.length&&"+-0 #'".includes(e[i]);)i++;let f=!1;if(e[i]==="*")f=!0,i++;else for(;i<e.length&&/\d/.test(e[i]);)i++;let p=!1;if(e[i]===".")if(i++,e[i]==="*")p=!0,i++;else for(;i<e.length&&/\d/.test(e[i]);)i++;i<e.length&&"hlL".includes(e[i])&&i++;let h=e[i]||"";i++;let m=e.slice(c,i);if(f){let A=parseInt(t[n+o]||"0",10);o++,m=m.replace("*",String(A))}if(p){let A=parseInt(t[n+o]||"0",10);o++,m=m.replace(".*",`.${A}`)}let g=t[n+o]||"";o++;let{value:y,parseError:w,parseErrMsg:b,stopped:x}=n4(m,h,g);if(s+=y,w&&(a=!0,b&&(l=b)),x)return{result:s,argsConsumed:o,error:a,errMsg:l,stopped:!0}}else s+=e[i],i++;return{result:s,argsConsumed:o,error:a,errMsg:l,stopped:!1}}function n4(e,t,n){let r=!1,s="";switch(t){case"d":case"i":{let i=Di(n);return r=gn,r&&(s=`printf: ${n}: invalid number
|
|
43
|
+
`),{value:Ff(e,i),parseError:r,parseErrMsg:s}}case"o":{let i=Di(n);return r=gn,r&&(s=`printf: ${n}: invalid number
|
|
44
|
+
`),{value:r4(e,i),parseError:r,parseErrMsg:s}}case"u":{let i=Di(n);r=gn,r&&(s=`printf: ${n}: invalid number
|
|
45
|
+
`);let o=i<0?i>>>0:i;return{value:Ff(e.replace("u","d"),o),parseError:r,parseErrMsg:s}}case"x":case"X":{let i=Di(n);return r=gn,r&&(s=`printf: ${n}: invalid number
|
|
46
|
+
`),{value:s4(e,i),parseError:r,parseErrMsg:s}}case"e":case"E":case"f":case"F":case"g":case"G":{let i=parseFloat(n)||0;return{value:l4(e,t,i),parseError:!1,parseErrMsg:""}}case"c":{if(n==="")return{value:"",parseError:!1,parseErrMsg:""};let a=new TextEncoder().encode(n)[0];return{value:String.fromCharCode(a),parseError:!1,parseErrMsg:""}}case"s":return{value:o4(e,n),parseError:!1,parseErrMsg:""};case"q":return{value:a4(e,n),parseError:!1,parseErrMsg:""};case"b":{let i=c4(n);return{value:i.value,parseError:!1,parseErrMsg:"",stopped:i.stopped}}default:try{return{value:ts(e,n),parseError:!1,parseErrMsg:""}}catch{return{value:"",parseError:!0,parseErrMsg:`printf: [sprintf] unexpected placeholder
|
|
47
|
+
`}}}}function Di(e){gn=!1;let t=e.trimStart(),n=t!==t.trimEnd();if(e=t.trimEnd(),e.startsWith("'")&&e.length>=2||e.startsWith('"')&&e.length>=2)return e.charCodeAt(1);if(e.startsWith("\\'")&&e.length>=3||e.startsWith('\\"')&&e.length>=3)return e.charCodeAt(2);if(e.startsWith("+")&&(e=e.slice(1)),e.startsWith("0x")||e.startsWith("0X")){let r=parseInt(e,16);return Number.isNaN(r)?(gn=!0,0):(n&&(gn=!0),r)}if(e.startsWith("0")&&e.length>1&&/^-?0[0-7]+$/.test(e))return n&&(gn=!0),parseInt(e,8)||0;if(/^\d+#/.test(e)){gn=!0;let r=e.match(/^(\d+)#/);return r?parseInt(r[1],10):0}if(e!==""&&!/^-?\d+$/.test(e)){gn=!0;let r=parseInt(e,10);return Number.isNaN(r)?0:r}return n&&(gn=!0),parseInt(e,10)||0}function Ff(e,t){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!n)return ts(e.replace(/\.\d*/,""),t);let r=n[1]||"",s=n[2]?parseInt(n[2],10):0,i=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,o=t<0,a=Math.abs(t),l=String(a);i>=0&&(l=l.padStart(i,"0"));let c="";o?c="-":r.includes("+")?c="+":r.includes(" ")&&(c=" ");let u=c+l;return s>u.length&&(r.includes("-")?u=u.padEnd(s," "):r.includes("0")&&i<0?u=c+l.padStart(s-c.length,"0"):u=u.padStart(s," ")),u}function r4(e,t){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!n)return ts(e,t);let r=n[1]||"",s=n[2]?parseInt(n[2],10):0,i=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,o=Math.abs(t).toString(8);i>=0&&(o=o.padStart(i,"0")),r.includes("#")&&!o.startsWith("0")&&(o=`0${o}`);let a=o;return s>a.length&&(r.includes("-")?a=a.padEnd(s," "):r.includes("0")&&i<0?a=a.padStart(s,"0"):a=a.padStart(s," ")),a}function s4(e,t){let n=e.includes("X"),r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!r)return ts(e,t);let s=r[1]||"",i=r[2]?parseInt(r[2],10):0,o=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,a=Math.abs(t).toString(16);n&&(a=a.toUpperCase()),o>=0&&(a=a.padStart(o,"0"));let l="";s.includes("#")&&t!==0&&(l=n?"0X":"0x");let c=l+a;return i>c.length&&(s.includes("-")?c=c.padEnd(i," "):s.includes("0")&&o<0?c=l+a.padStart(i-l.length,"0"):c=c.padStart(i," ")),c}function i4(e){if(e==="")return"''";if(/^[a-zA-Z0-9_./-]+$/.test(e))return e;if(/[\x00-\x1f\x7f-\xff]/.test(e)){let r="$'";for(let s of e){let i=s.charCodeAt(0);s==="'"?r+="\\'":s==="\\"?r+="\\\\":s===`
|
|
48
|
+
`?r+="\\n":s===" "?r+="\\t":s==="\r"?r+="\\r":s==="\x07"?r+="\\a":s==="\b"?r+="\\b":s==="\f"?r+="\\f":s==="\v"?r+="\\v":s==="\x1B"?r+="\\E":i<32||i>=127&&i<=255?r+=`\\${i.toString(8).padStart(3,"0")}`:s==='"'?r+='\\"':r+=s}return r+="'",r}let n="";for(let r of e)" |&;<>()$`\\\"'*?[#~=%!{}".includes(r)?n+=`\\${r}`:n+=r;return n}function o4(e,t){let n=e.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!n)return ts(e.replace(/0+(?=\d)/,""),t);let r=n[1]==="-",s=n[2]?parseInt(n[2],10):0,i=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,o=r?-s:s;return Ti(t,o,i)}function a4(e,t){let n=i4(t),r=e.match(/^%(-?)(\d*)q$/);if(!r)return n;let s=r[1]==="-",i=r[2]?parseInt(r[2],10):0,o=n;return i>o.length&&(s?o=o.padEnd(i," "):o=o.padStart(i," ")),o}function l4(e,t,n){let r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!r)return ts(e,n);let s=r[1]||"",i=r[2]?parseInt(r[2],10):0,o=r[3]!==void 0?r[4]?parseInt(r[4],10):0:6,a,l=t.toLowerCase();if(l==="e"?(a=n.toExponential(o),a=a.replace(/e([+-])(\d)$/,"e$10$2"),t==="E"&&(a=a.toUpperCase())):l==="f"?(a=n.toFixed(o),s.includes("#")&&o===0&&!a.includes(".")&&(a+=".")):l==="g"?(a=n.toPrecision(o||1),s.includes("#")||(a=a.replace(/\.?0+$/,""),a=a.replace(/\.?0+e/,"e")),a=a.replace(/e([+-])(\d)$/,"e$10$2"),t==="G"&&(a=a.toUpperCase())):a=n.toString(),n>=0&&(s.includes("+")?a=`+${a}`:s.includes(" ")&&(a=` ${a}`)),i>a.length)if(s.includes("-"))a=a.padEnd(i," ");else if(s.includes("0")){let c=a.match(/^[+ -]/)?.[0]||"",u=c?a.slice(1):a;a=c+u.padStart(i-c.length,"0")}else a=a.padStart(i," ");return a}function c4(e){let t="",n=0;for(;n<e.length;)if(e[n]==="\\"&&n+1<e.length)switch(e[n+1]){case"n":t+=`
|
|
49
|
+
`,n+=2;break;case"t":t+=" ",n+=2;break;case"r":t+="\r",n+=2;break;case"\\":t+="\\",n+=2;break;case"a":t+="\x07",n+=2;break;case"b":t+="\b",n+=2;break;case"f":t+="\f",n+=2;break;case"v":t+="\v",n+=2;break;case"c":return{value:t,stopped:!0};case"x":{let s=[],i=n;for(;i+1<e.length&&e[i]==="\\"&&e[i+1]==="x";){let o="",a=i+2;for(;a<e.length&&a<i+4&&/[0-9a-fA-F]/.test(e[a]);)o+=e[a],a++;if(o)s.push(parseInt(o,16)),i=a;else break}s.length>0?(t+=Y7(s),n=i):(t+="\\x",n+=2);break}case"u":{let s="",i=n+2;for(;i<e.length&&i<n+6&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;s?(t+=String.fromCodePoint(parseInt(s,16)),n=i):(t+="\\u",n+=2);break}case"0":{let s="",i=n+2;for(;i<e.length&&i<n+5&&/[0-7]/.test(e[i]);)s+=e[i],i++;s?t+=String.fromCharCode(parseInt(s,8)):t+="\0",n=i;break}case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let s="",i=n+1;for(;i<e.length&&i<n+4&&/[0-7]/.test(e[i]);)s+=e[i],i++;t+=String.fromCharCode(parseInt(s,8)),n=i;break}default:t+=e[n],n++}else t+=e[n],n++;return{value:t,stopped:!1}}var J7,e4,gn,u4,Mf=v(()=>{"use strict";xe();en();ne();Ba();_f();J7={name:"printf",summary:"format and print data",usage:"printf [-v var] FORMAT [ARGUMENT...]",options:[" -v var assign the output to shell variable VAR rather than display it"," --help display this help and exit"],notes:["FORMAT controls the output like in C printf.","Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)","Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)","Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)","Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)"]},e4={name:"printf",async execute(e,t){if(B(e))return U(J7);if(e.length===0)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
50
|
+
`,exitCode:2};let n=null,r=0;for(;r<e.length;){let o=e[r];if(o==="--"){r++;break}if(o==="-v"){if(r+1>=e.length)return{stdout:"",stderr:`printf: -v: option requires an argument
|
|
51
|
+
`,exitCode:1};if(n=e[r+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[a-zA-Z0-9_@*"'$]+\])?$/.test(n))return{stdout:"",stderr:`printf: \`${n}': not a valid identifier
|
|
52
|
+
`,exitCode:2};r+=2}else{if(o.startsWith("-")&&o!=="-")break;break}}if(r>=e.length)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
53
|
+
`,exitCode:1};let s=e[r],i=e.slice(r+1);try{let o=Pi(s),a="",l=0,c=!1,u="",f=t.env.get("TZ"),p=t.limits?.maxStringLength;do{let{result:h,argsConsumed:d,error:m,errMsg:g,stopped:y}=t4(o,i,l,f);if(a+=h,p!==void 0&&p>0&&a.length>p)throw new Q(`printf: output size limit exceeded (${p} bytes)`,"string_length");if(l+=d,m&&(c=!0,g&&(u=g)),y)break}while(l<i.length&&l>0);if(l===0&&i.length>0,n){let h=n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(['"]?)(.+?)\2\]$/);if(h){let d=h[1],m=h[3];m=m.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(g,y)=>t.env.get(y)??""),t.env.set(`${d}_${m}`,a)}else t.env.set(n,a);return{stdout:"",stderr:u,exitCode:c?1:0}}return{stdout:a,stderr:u,exitCode:c?1:0}}catch(o){if(o instanceof Q)throw o;return{stdout:"",stderr:`printf: ${qe(o)}
|
|
54
|
+
`,exitCode:1}}}};gn=!1;u4={name:"printf",flags:[{flag:"-v",type:"value",valueHint:"string"}],stdinType:"none",needsArgs:!0}});var Wf={};J(Wf,{flagsForFuzzing:()=>m4,lsCommand:()=>h4});import{minimatch as Uf}from"minimatch";function _i(e){if(e<1024)return String(e);if(e<1024*1024){let n=e/1024;return n<10?`${n.toFixed(1)}K`:`${Math.round(n)}K`}if(e<1024*1024*1024){let n=e/1048576;return n<10?`${n.toFixed(1)}M`:`${Math.round(n)}M`}let t=e/(1024*1024*1024);return t<10?`${t.toFixed(1)}G`:`${Math.round(t)}G`}function Fi(e){let n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],r=String(e.getDate()).padStart(2," "),s=new Date,i=new Date(s.getTime()-4320*60*60*1e3);if(e>i){let a=String(e.getHours()).padStart(2,"0"),l=String(e.getMinutes()).padStart(2,"0");return`${n} ${r} ${a}:${l}`}let o=e.getFullYear();return`${n} ${r} ${o}`}function kr(e){return e.isDirectory?"/":e.isSymbolicLink?"@":(e.mode&73)!==0?"*":""}async function d4(e,t,n,r,s,i=!1,o=!1,a=!1,l=!1){let c=n||r,u=t.fs.getAllPaths(),f=t.fs.resolvePath(t.cwd,"."),p=[];for(let h of u){let d=h.startsWith(f)&&h.slice(f.length+1)||h;if(Uf(d,e)||Uf(h,e)){let m=d.split("/").pop()||d;if(!c&&m.startsWith("."))continue;p.push(d||h)}}if(p.length===0)return{stdout:"",stderr:`ls: ${e}: No such file or directory
|
|
55
|
+
`,exitCode:2};if(a){let h=[];for(let d of p){let m=t.fs.resolvePath(t.cwd,d);try{let g=await t.fs.stat(m);h.push({path:d,size:g.size??0})}catch{h.push({path:d,size:0})}}h.sort((d,m)=>m.size-d.size),p.length=0,p.push(...h.map(d=>d.path))}else p.sort();if(i&&p.reverse(),s){let h=[];for(let d of p){let m=t.fs.resolvePath(t.cwd,d);try{let g=await t.fs.stat(m),y=g.isDirectory?"drwxr-xr-x":"-rw-r--r--",w=l?kr(await t.fs.lstat(m)):g.isDirectory?"/":"",b=g.size??0,x=o?_i(b).padStart(5):String(b).padStart(5),A=g.mtime??new Date(0),$=Fi(A);h.push(`${y} 1 user user ${x} ${$} ${d}${w}`)}catch{h.push(`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${d}`)}}return{stdout:`${h.join(`
|
|
56
|
+
`)}
|
|
57
|
+
`,stderr:"",exitCode:0}}if(l){let h=[];for(let d of p){let m=t.fs.resolvePath(t.cwd,d);try{let g=await t.fs.lstat(m);h.push(`${d}${kr(g)}`)}catch{h.push(d)}}return{stdout:`${h.join(`
|
|
58
|
+
`)}
|
|
59
|
+
`,stderr:"",exitCode:0}}return{stdout:`${p.join(`
|
|
60
|
+
`)}
|
|
61
|
+
`,stderr:"",exitCode:0}}async function Bf(e,t,n,r,s,i,o,a=!1,l=!1,c=!1,u=!1,f=!1){let p=n||r,h=t.fs.resolvePath(t.cwd,e);try{let d=await t.fs.stat(h);if(!d.isDirectory){let y=u?kr(await t.fs.lstat(h)):"";if(s){let w=d.size??0,b=l?_i(w).padStart(5):String(w).padStart(5),x=d.mtime??new Date(0),A=Fi(x);return{stdout:`-rw-r--r-- 1 user user ${b} ${A} ${e}${y}
|
|
62
|
+
`,stderr:"",exitCode:0}}return{stdout:`${e}${y}
|
|
63
|
+
`,stderr:"",exitCode:0}}let m=await t.fs.readdir(h);if(p||(m=m.filter(y=>!y.startsWith("."))),c){let y=[];for(let w of m){let b=h==="/"?`/${w}`:`${h}/${w}`;try{let x=await t.fs.stat(b);y.push({name:w,size:x.size??0})}catch{y.push({name:w,size:0})}}y.sort((w,b)=>b.size-w.size),m=y.map(w=>w.name)}else m.sort();n&&(m=[".","..",...m]),a&&m.reverse();let g="";if((i||o)&&(g+=`${e}:
|
|
64
|
+
`),s){g+=`total ${m.length}
|
|
65
|
+
`;let y=m.filter(A=>A==="."||A===".."),w=m.filter(A=>A!=="."&&A!=="..");for(let A of y)g+=`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${A}
|
|
66
|
+
`;let b=[];for(let A=0;A<w.length;A+=100){let $=w.slice(A,A+100),O=await Promise.all($.map(async F=>{let P=h==="/"?`/${F}`:`${h}/${F}`;try{let M=await t.fs.stat(P),C=M.isDirectory?"drwxr-xr-x":"-rw-r--r--",N=u?kr(await t.fs.lstat(P)):M.isDirectory?"/":"",R=M.size??0,I=l?_i(R).padStart(5):String(R).padStart(5),T=M.mtime??new Date(0),L=Fi(T);return{name:F,line:`${C} 1 user user ${I} ${L} ${F}${N}
|
|
67
|
+
`}}catch{return{name:F,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${F}
|
|
68
|
+
`}}}));b.push(...O)}let x=new Map(w.map((A,$)=>[A,$]));b.sort((A,$)=>(x.get(A.name)??0)-(x.get($.name)??0));for(let{line:A}of b)g+=A}else if(u){let y=[],w=m.filter(x=>x!=="."&&x!==".."),b=m.filter(x=>x==="."||x==="..");for(let x of b)y.push(`${x}/`);for(let x=0;x<w.length;x+=100){let A=w.slice(x,x+100),$=await Promise.all(A.map(async O=>{let F=h==="/"?`/${O}`:`${h}/${O}`;try{let P=await t.fs.lstat(F);return`${O}${kr(P)}`}catch{return O}}));y.push(...$)}g+=y.join(`
|
|
69
|
+
`)+(y.length?`
|
|
70
|
+
`:"")}else g+=m.join(`
|
|
71
|
+
`)+(m.length?`
|
|
72
|
+
`:"");if(i){let y=m.filter(x=>x!=="."&&x!==".."),w=[];if(t.fs.readdirWithFileTypes)w=(await t.fs.readdirWithFileTypes(h)).filter(A=>A.isDirectory&&y.includes(A.name)).map(A=>({name:A.name,isDirectory:!0}));else for(let x=0;x<y.length;x+=100){let A=y.slice(x,x+100),$=await Promise.all(A.map(async O=>{let F=h==="/"?`/${O}`:`${h}/${O}`;try{let P=await t.fs.stat(F);return{name:O,isDirectory:P.isDirectory}}catch{return{name:O,isDirectory:!1}}}));w.push(...$.filter(O=>O.isDirectory))}w.sort((x,A)=>x.name.localeCompare(A.name)),a&&w.reverse();let b=[];for(let x=0;x<w.length;x+=100){let A=w.slice(x,x+100),$=await Promise.all(A.map(async O=>{let F=e==="."?`./${O.name}`:`${e}/${O.name}`,P=await Bf(F,t,n,r,s,i,!1,a,l,c,u,!0);return{name:O.name,result:P}}));b.push(...$)}b.sort((x,A)=>x.name.localeCompare(A.name)),a&&b.reverse();for(let{result:x}of b)g+=`
|
|
73
|
+
`,g+=x.stdout}return{stdout:g,stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`ls: ${e}: No such file or directory
|
|
74
|
+
`,exitCode:2}}}var f4,p4,h4,m4,zf=v(()=>{"use strict";st();Xr();ne();f4={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-F, --classify append indicator (one of */=>@) to entries","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},p4={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},classifyFiles:{short:"F",long:"classify",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},h4={name:"ls",async execute(e,t){if(B(e))return U(f4);let n=Ee("ls",e,p4);if(!n.ok)return n.error;let r=n.result.flags.showAll,s=n.result.flags.showAlmostAll,i=n.result.flags.longFormat,o=n.result.flags.humanReadable,a=n.result.flags.recursive,l=n.result.flags.reverse,c=n.result.flags.sortBySize,u=n.result.flags.classifyFiles,f=n.result.flags.directoryOnly,p=n.result.flags.sortByTime;n.result.flags.onePerLine;let h=n.result.positional;h.length===0&&h.push(".");let d="",m="",g=0;for(let y=0;y<h.length;y++){let w=h[y];if(y>0&&d&&!d.endsWith(`
|
|
75
|
+
|
|
76
|
+
`)&&(d+=`
|
|
77
|
+
`),f){let b=t.fs.resolvePath(t.cwd,w);try{let x=await t.fs.stat(b);if(i){let A=x.isDirectory?"drwxr-xr-x":"-rw-r--r--",$=u?kr(await t.fs.lstat(b)):x.isDirectory?"/":"",O=x.size??0,F=o?_i(O).padStart(5):String(O).padStart(5),P=x.mtime??new Date(0),M=Fi(P);d+=`${A} 1 user user ${F} ${M} ${w}${$}
|
|
78
|
+
`}else{let A=u?kr(await t.fs.lstat(b)):"";d+=`${w}${A}
|
|
79
|
+
`}}catch{m+=`ls: cannot access '${w}': No such file or directory
|
|
80
|
+
`,g=2}continue}if(w.includes("*")||w.includes("?")||w.includes("[")){let b=await d4(w,t,r,s,i,l,o,c,u);d+=b.stdout,m+=b.stderr,b.exitCode!==0&&(g=b.exitCode)}else{let b=await Bf(w,t,r,s,i,a,h.length>1,l,o,c,u);d+=b.stdout,m+=b.stderr,b.exitCode!==0&&(g=b.exitCode)}}return{stdout:d,stderr:m,exitCode:g}}};m4={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0}});function g4(e,t,n){if(!e)return e;let r=e.replace(/\n\s+at\s.*/g,"");return n&&(r=r.replace(/\bfile:\/\/\/?[^\s'",)}\]:]+/g,"<path>")),r=r.replace(t?/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap|workspace|root|srv|mnt|app))\b[^\s'",)}\]:]*/g:/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,"<path>"),r=r.replace(/node:internal\/[^\s'",)}\]:]+/g,"<internal>"),r=r.replace(/[A-Z]:\\[^\s'",)}\]:]+/g,"<path>"),n&&(r=r.replace(/\\\\[^\s\\]+\\[^\s'",)}\]:]+/g,"<path>")),r}function Be(e){return g4(e,!1,!1)}var yn=v(()=>{"use strict"});var Hf={};J(Hf,{flagsForFuzzing:()=>b4,mkdirCommand:()=>w4});var y4,w4,b4,jf=v(()=>{"use strict";yn();en();st();y4={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},w4={name:"mkdir",async execute(e,t){let n=Ee("mkdir",e,y4);if(!n.ok)return n.error;let r=n.result.flags.recursive,s=n.result.flags.verbose,i=n.result.positional;if(i.length===0)return{stdout:"",stderr:`mkdir: missing operand
|
|
81
|
+
`,exitCode:1};let o="",a="",l=0;for(let c of i)try{let u=t.fs.resolvePath(t.cwd,c);await t.fs.mkdir(u,{recursive:r}),s&&(o+=`mkdir: created directory '${c}'
|
|
82
|
+
`)}catch(u){let f=qe(u);f.includes("ENOENT")||f.includes("no such file")?a+=`mkdir: cannot create directory '${c}': No such file or directory
|
|
83
|
+
`:f.includes("EEXIST")||f.includes("already exists")?a+=`mkdir: cannot create directory '${c}': File exists
|
|
84
|
+
`:a+=`mkdir: cannot create directory '${c}': ${Be(f)}
|
|
85
|
+
`,l=1}return{stdout:o,stderr:a,exitCode:l}}},b4={name:"mkdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}});var qf={};J(qf,{flagsForFuzzing:()=>C4,rmdirCommand:()=>A4});async function S4(e,t,n,r){let s="",i="",a=e.fs.resolvePath(e.cwd,t),l=await Gf(e,a,t,r);if(s+=l.stdout,i+=l.stderr,l.exitCode!==0)return{stdout:s,stderr:i,exitCode:l.exitCode};if(n){let c=a,u=t;for(;;){let f=Vf(c),p=Vf(u);if(f===c||f==="/"||f==="."||p==="."||p==="")break;let h=await Gf(e,f,p,r);if(s+=h.stdout,h.exitCode!==0)break;c=f,u=p}}return{stdout:s,stderr:i,exitCode:0}}async function Gf(e,t,n,r){try{if(!await e.fs.exists(t))return{stdout:"",stderr:`rmdir: failed to remove '${n}': No such file or directory
|
|
86
|
+
`,exitCode:1};if(!(await e.fs.stat(t)).isDirectory)return{stdout:"",stderr:`rmdir: failed to remove '${n}': Not a directory
|
|
87
|
+
`,exitCode:1};if((await e.fs.readdir(t)).length>0)return{stdout:"",stderr:`rmdir: failed to remove '${n}': Directory not empty
|
|
88
|
+
`,exitCode:1};await e.fs.rm(t,{recursive:!1,force:!1});let a="";return r&&(a=`rmdir: removing directory, '${n}'
|
|
89
|
+
`),{stdout:a,stderr:"",exitCode:0}}catch(s){let i=qe(s);return{stdout:"",stderr:`rmdir: failed to remove '${n}': ${i}
|
|
90
|
+
`,exitCode:1}}}function Vf(e){let t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n===-1?".":n===0?"/":t.substring(0,n)}var x4,E4,A4,C4,Zf=v(()=>{"use strict";en();st();x4=`Usage: rmdir [-pv] DIRECTORY...
|
|
91
|
+
Remove empty directories.
|
|
92
|
+
|
|
93
|
+
Options:
|
|
94
|
+
-p, --parents Remove DIRECTORY and its ancestors
|
|
95
|
+
-v, --verbose Output a diagnostic for every directory processed`,E4={parents:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},help:{long:"help",type:"boolean"}},A4={name:"rmdir",async execute(e,t){let n=Ee("rmdir",e,E4);if(!n.ok)return n.error;if(n.result.flags.help)return{stdout:`${x4}
|
|
96
|
+
`,stderr:"",exitCode:0};let r=n.result.flags.parents,s=n.result.flags.verbose,i=n.result.positional;if(i.length===0)return{stdout:"",stderr:`rmdir: missing operand
|
|
97
|
+
`,exitCode:1};let o="",a="",l=0;for(let c of i){let u=await S4(t,c,r,s);o+=u.stdout,a+=u.stderr,u.exitCode!==0&&(l=u.exitCode)}return{stdout:o,stderr:a,exitCode:l}}};C4={name:"rmdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}});var Kf={};J(Kf,{flagsForFuzzing:()=>N4,touchCommand:()=>k4});function v4(e){let t=e.replace(/\//g,"-"),n=new Date(t);if(!Number.isNaN(n.getTime()))return n;let r=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(r){let[,i,o,a]=r;if(n=new Date(Number.parseInt(i,10),Number.parseInt(o,10)-1,Number.parseInt(a,10)),!Number.isNaN(n.getTime()))return n}let s=t.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(s){let[,i,o,a,l,c,u]=s;if(n=new Date(Number.parseInt(i,10),Number.parseInt(o,10)-1,Number.parseInt(a,10),Number.parseInt(l,10),Number.parseInt(c,10),Number.parseInt(u,10)),!Number.isNaN(n.getTime()))return n}return null}var k4,N4,Qf=v(()=>{"use strict";en();ne();k4={name:"touch",async execute(e,t){let n=[],r=null,s=!1;for(let l=0;l<e.length;l++){let c=e[l];if(c==="--"){n.push(...e.slice(l+1));break}else if(c==="-d"||c==="--date"){if(l+1>=e.length)return{stdout:"",stderr:`touch: option requires an argument -- 'd'
|
|
98
|
+
`,exitCode:1};r=e[++l]}else if(c.startsWith("--date="))r=c.slice(7);else if(c==="-c"||c==="--no-create")s=!0;else if(c==="-a"||c==="-m"||c==="-r"||c==="-t")(c==="-r"||c==="-t")&&l++;else{if(c.startsWith("--"))return Z("touch",c);if(c.startsWith("-")&&c.length>1){let u=!1;for(let f of c.slice(1))if(f==="c")s=!0;else if(!(f==="a"||f==="m"))if(f==="d"){if(l+1>=e.length)return{stdout:"",stderr:`touch: option requires an argument -- 'd'
|
|
99
|
+
`,exitCode:1};r=e[++l],u=!0;break}else if(f==="r"||f==="t"){l++,u=!0;break}else return Z("touch",`-${f}`);if(u)continue}else n.push(c)}}if(n.length===0)return{stdout:"",stderr:`touch: missing file operand
|
|
100
|
+
`,exitCode:1};let i=null;if(r!==null&&(i=v4(r),i===null))return{stdout:"",stderr:`touch: invalid date format '${r}'
|
|
101
|
+
`,exitCode:1};let o="",a=0;for(let l of n)try{let c=t.fs.resolvePath(t.cwd,l);if(!await t.fs.exists(c)){if(s)continue;await t.fs.writeFile(c,"")}let f=i??new Date;await t.fs.utimes(c,f,f)}catch(c){o+=`touch: cannot touch '${l}': ${qe(c)}
|
|
102
|
+
`,a=1}return{stdout:"",stderr:o,exitCode:a}}},N4={name:"touch",flags:[{flag:"-c",type:"boolean"},{flag:"-a",type:"boolean"},{flag:"-m",type:"boolean"},{flag:"-d",type:"value",valueHint:"string"}],needsArgs:!0}});var Xf={};J(Xf,{flagsForFuzzing:()=>O4,rmCommand:()=>$4});var I4,$4,O4,Yf=v(()=>{"use strict";yn();en();st();I4={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},$4={name:"rm",async execute(e,t){let n=Ee("rm",e,I4);if(!n.ok)return n.error;let r=n.result.flags.recursive||n.result.flags.recursiveUpper,s=n.result.flags.force,i=n.result.flags.verbose,o=n.result.positional;if(o.length===0)return s?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
|
|
103
|
+
`,exitCode:1};let a="",l="",c=0;for(let u of o)try{let f=t.fs.resolvePath(t.cwd,u);if((await t.fs.stat(f)).isDirectory&&!r){l+=`rm: cannot remove '${u}': Is a directory
|
|
104
|
+
`,c=1;continue}await t.fs.rm(f,{recursive:r,force:s}),i&&(a+=`removed '${u}'
|
|
105
|
+
`)}catch(f){if(!s){let p=qe(f);p.includes("ENOENT")||p.includes("no such file")?l+=`rm: cannot remove '${u}': No such file or directory
|
|
106
|
+
`:p.includes("ENOTEMPTY")||p.includes("not empty")?l+=`rm: cannot remove '${u}': Directory not empty
|
|
107
|
+
`:l+=`rm: cannot remove '${u}': ${Be(p)}
|
|
108
|
+
`,c=1}}return{stdout:a,stderr:l,exitCode:c}}},O4={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}});var Jf={};J(Jf,{cpCommand:()=>P4,flagsForFuzzing:()=>D4});var R4,T4,P4,D4,e1=v(()=>{"use strict";en();st();ne();R4={name:"cp",summary:"copy files and directories",usage:"cp [OPTION]... SOURCE... DEST",options:["-r, -R, --recursive copy directories recursively","-n, --no-clobber do not overwrite an existing file","-p, --preserve preserve file attributes","-v, --verbose explain what is being done"," --help display this help and exit"]},T4={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},preserve:{short:"p",long:"preserve",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},P4={name:"cp",async execute(e,t){if(B(e))return U(R4);let n=Ee("cp",e,T4);if(!n.ok)return n.error;let r=n.result.flags.recursive||n.result.flags.recursiveUpper,s=n.result.flags.noClobber,i=n.result.flags.preserve,o=n.result.flags.verbose,a=n.result.positional;if(a.length<2)return{stdout:"",stderr:`cp: missing destination file operand
|
|
109
|
+
`,exitCode:1};let l=a.pop()??"",c=a,u=t.fs.resolvePath(t.cwd,l),f="",p="",h=0,d=!1;try{d=(await t.fs.stat(u)).isDirectory}catch{}if(c.length>1&&!d)return{stdout:"",stderr:`cp: target '${l}' is not a directory
|
|
110
|
+
`,exitCode:1};for(let m of c)try{let g=t.fs.resolvePath(t.cwd,m),y=await t.fs.stat(g),w=u;if(d){let b=m.split("/").pop()||m;w=u==="/"?`/${b}`:`${u}/${b}`}if(y.isDirectory&&!r){p+=`cp: -r not specified; omitting directory '${m}'
|
|
111
|
+
`,h=1;continue}if(s)try{await t.fs.stat(w);continue}catch{}await t.fs.cp(g,w,{recursive:r}),o&&(f+=`'${m}' -> '${w}'
|
|
112
|
+
`)}catch(g){let y=qe(g);y.includes("ENOENT")||y.includes("no such file")?p+=`cp: cannot stat '${m}': No such file or directory
|
|
113
|
+
`:p+=`cp: cannot copy '${m}': ${y}
|
|
114
|
+
`,h=1}return{stdout:f,stderr:p,exitCode:h}}},D4={name:"cp",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var t1={};J(t1,{flagsForFuzzing:()=>M4,mvCommand:()=>L4});var _4,F4,L4,M4,n1=v(()=>{"use strict";en();st();ne();_4={name:"mv",summary:"move (rename) files",usage:"mv [OPTION]... SOURCE... DEST",options:["-f, --force do not prompt before overwriting","-n, --no-clobber do not overwrite an existing file","-v, --verbose explain what is being done"," --help display this help and exit"]},F4={force:{short:"f",long:"force",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},L4={name:"mv",async execute(e,t){if(B(e))return U(_4);let n=Ee("mv",e,F4);if(!n.ok)return n.error;let r=n.result.flags.force,s=n.result.flags.noClobber,i=n.result.flags.verbose,o=n.result.positional;if(s&&(r=!1),o.length<2)return{stdout:"",stderr:`mv: missing destination file operand
|
|
115
|
+
`,exitCode:1};let a=o.pop()??"",l=o,c=t.fs.resolvePath(t.cwd,a),u="",f="",p=0,h=!1;try{h=(await t.fs.stat(c)).isDirectory}catch{}if(l.length>1&&!h)return{stdout:"",stderr:`mv: target '${a}' is not a directory
|
|
116
|
+
`,exitCode:1};for(let d of l)try{let m=t.fs.resolvePath(t.cwd,d),g=c;if(h){let y=d.split("/").pop()||d;g=c==="/"?`/${y}`:`${c}/${y}`}if(s)try{await t.fs.stat(g);continue}catch{}if(await t.fs.mv(m,g),i){let y=h?`${a}/${d.split("/").pop()||d}`:a;u+=`renamed '${d}' -> '${y}'
|
|
117
|
+
`}}catch(m){let g=qe(m);g.includes("ENOENT")||g.includes("no such file")?f+=`mv: cannot stat '${d}': No such file or directory
|
|
118
|
+
`:f+=`mv: cannot move '${d}': ${g}
|
|
119
|
+
`,p=1}return{stdout:u,stderr:f,exitCode:p}}},M4={name:"mv",flags:[{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var r1={};J(r1,{flagsForFuzzing:()=>W4,lnCommand:()=>B4});var U4,B4,W4,s1=v(()=>{"use strict";yn();ne();U4={name:"ln",summary:"make links between files",usage:"ln [OPTIONS] TARGET LINK_NAME",options:["-s create a symbolic link instead of a hard link","-f remove existing destination files","-n treat LINK_NAME as a normal file if it is a symbolic link to a directory","-v print name of each linked file"," --help display this help and exit"]},B4={name:"ln",async execute(e,t){if(B(e))return U(U4);let n=!1,r=!1,s=!1,i=0;for(;i<e.length&&e[i].startsWith("-");){let f=e[i];if(f==="-s"||f==="--symbolic")n=!0,i++;else if(f==="-f"||f==="--force")r=!0,i++;else if(f==="-v"||f==="--verbose")s=!0,i++;else if(f==="-n"||f==="--no-dereference")i++;else if(/^-[sfvn]+$/.test(f))f.includes("s")&&(n=!0),f.includes("f")&&(r=!0),f.includes("v")&&(s=!0),i++;else if(f==="--"){i++;break}else return Z("ln",f)}let o=e.slice(i);if(o.length<2)return{stdout:"",stderr:`ln: missing file operand
|
|
120
|
+
`,exitCode:1};let a=o[0],l=o[1],c=t.fs.resolvePath(t.cwd,l);if(await t.fs.exists(c))if(r)try{await t.fs.rm(c,{force:!0})}catch{return{stdout:"",stderr:`ln: cannot remove '${l}': Permission denied
|
|
121
|
+
`,exitCode:1}}else return{stdout:"",stderr:`ln: failed to create ${n?"symbolic ":""}link '${l}': File exists
|
|
122
|
+
`,exitCode:1};try{if(n)await t.fs.symlink(a,c);else{let f=t.fs.resolvePath(t.cwd,a);if(!await t.fs.exists(f))return{stdout:"",stderr:`ln: failed to access '${a}': No such file or directory
|
|
123
|
+
`,exitCode:1};await t.fs.link(f,c)}}catch(f){let p=f;return p.message.includes("EPERM")?{stdout:"",stderr:`ln: '${a}': hard link not allowed for directory
|
|
124
|
+
`,exitCode:1}:{stdout:"",stderr:`ln: ${Be(p.message)}
|
|
125
|
+
`,exitCode:1}}let u="";return s&&(u=`'${l}' -> '${a}'
|
|
126
|
+
`),{stdout:u,stderr:"",exitCode:0}}},W4={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var o1={};J(o1,{chmodCommand:()=>H4,flagsForFuzzing:()=>j4});async function i1(e,t,n,r,s){let i="",o=await e.fs.readdir(t);for(let a of o){let l=t==="/"?`/${a}`:`${t}/${a}`,c;if(n!==void 0)c=n;else if(r!==void 0){let f=await e.fs.stat(l);c=Wa(r,f.mode)}else c=420;await e.fs.chmod(l,c),s&&(i+=`mode of '${l}' changed to ${c.toString(8).padStart(4,"0")}
|
|
127
|
+
`),(await e.fs.stat(l)).isDirectory&&(i+=await i1(e,l,n,r,s))}return i}function Wa(e,t=420){if(/^[0-7]+$/.test(e))return parseInt(e,8);let n=t&4095,r=e.split(",");for(let s of r){let i=s.match(/^([ugoa]*)([+\-=])([rwxXst]*)$/);if(!i)throw new Error(`Invalid mode: ${e}`);let o=i[1]||"a",a=i[2],l=i[3];(o==="a"||o==="")&&(o="ugo");let c=0;l.includes("r")&&(c|=4),l.includes("w")&&(c|=2),(l.includes("x")||l.includes("X"))&&(c|=1);let u=0;l.includes("s")&&(o.includes("u")&&(u|=2048),o.includes("g")&&(u|=1024)),l.includes("t")&&(u|=512);for(let f of o){let p=0;f==="u"?p=6:f==="g"?p=3:f==="o"&&(p=0);let h=c<<p;a==="+"?n|=h:a==="-"?n&=~h:a==="="&&(n&=~(7<<p),n|=h)}a==="+"?n|=u:a==="-"?n&=~u:a==="="&&(l.includes("s")&&(o.includes("u")&&(n&=-2049,n|=u&2048),o.includes("g")&&(n&=-1025,n|=u&1024)),l.includes("t")&&(n&=-513,n|=u&512))}return n}var z4,H4,j4,a1=v(()=>{"use strict";ne();z4={name:"chmod",summary:"change file mode bits",usage:"chmod [OPTIONS] MODE FILE...",options:["-R change files recursively","-v output a diagnostic for every file processed"," --help display this help and exit"]},H4={name:"chmod",async execute(e,t){if(B(e))return U(z4);if(e.length<2)return{stdout:"",stderr:`chmod: missing operand
|
|
128
|
+
`,exitCode:1};let n=!1,r=!1,s=0;for(;s<e.length&&e[s].startsWith("-");){let p=e[s];if(p==="-R"||p==="--recursive")n=!0,s++;else if(p==="-v"||p==="--verbose")r=!0,s++;else if(p==="--"){s++;break}else{if(/^[+-]?[rwxugo]+/.test(p)||/^\d+$/.test(p))break;if(/^-[Rv]+$/.test(p)){p.includes("R")&&(n=!0),p.includes("v")&&(r=!0),s++;continue}return Z("chmod",p)}}if(e.length-s<2)return{stdout:"",stderr:`chmod: missing operand
|
|
129
|
+
`,exitCode:1};let i=e[s],o=e.slice(s+1),a=/^[0-7]+$/.test(i),l;if(a)l=parseInt(i,8);else try{Wa(i,420)}catch{return{stdout:"",stderr:`chmod: invalid mode: '${i}'
|
|
130
|
+
`,exitCode:1}}let c="",u="",f=!1;for(let p of o){let h=t.fs.resolvePath(t.cwd,p);try{let d;if(a&&l!==void 0)d=l;else{let m=await t.fs.stat(h);d=Wa(i,m.mode)}if(await t.fs.chmod(h,d),r&&(c+=`mode of '${p}' changed to ${d.toString(8).padStart(4,"0")}
|
|
131
|
+
`),n&&(await t.fs.stat(h)).isDirectory){let g=await i1(t,h,a?l:void 0,a?void 0:i,r);c+=g}}catch{u+=`chmod: cannot access '${p}': No such file or directory
|
|
132
|
+
`,f=!0}}return{stdout:c,stderr:u,exitCode:f?1:0}}};j4={name:"chmod",flags:[{flag:"-R",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var l1={};J(l1,{flagsForFuzzing:()=>V4,pwdCommand:()=>G4});var G4,V4,c1=v(()=>{"use strict";G4={name:"pwd",async execute(e,t){let n=!1;for(let s of e)if(s==="-P")n=!0;else if(s==="-L")n=!1;else{if(s==="--")break;s.startsWith("-")}let r=t.cwd;if(n)try{r=await t.fs.realpath(t.cwd)}catch{}return{stdout:`${r}
|
|
133
|
+
`,stderr:"",exitCode:0}}},V4={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]}});var u1={};J(u1,{flagsForFuzzing:()=>K4,readlinkCommand:()=>Z4});var q4,Z4,K4,f1=v(()=>{"use strict";ne();q4={name:"readlink",summary:"print resolved symbolic links or canonical file names",usage:"readlink [OPTIONS] FILE...",options:["-f canonicalize by following every symlink in every component of the given name recursively"," --help display this help and exit"]},Z4={name:"readlink",async execute(e,t){if(B(e))return U(q4);let n=!1,r=0;for(;r<e.length&&e[r].startsWith("-");){let a=e[r];if(a==="-f"||a==="--canonicalize")n=!0,r++;else if(a==="--"){r++;break}else return Z("readlink",a)}let s=e.slice(r);if(s.length===0)return{stdout:"",stderr:`readlink: missing operand
|
|
134
|
+
`,exitCode:1};let i="",o=!1;for(let a of s){let l=t.fs.resolvePath(t.cwd,a);try{if(n){let c=l,u=new Set;for(;!u.has(c);){u.add(c);try{let f=await t.fs.readlink(c);if(f.startsWith("/"))c=f;else{let p=c.substring(0,c.lastIndexOf("/"))||"/";c=t.fs.resolvePath(p,f)}}catch{break}}i+=`${c}
|
|
135
|
+
`}else{let c=await t.fs.readlink(l);i+=`${c}
|
|
136
|
+
`}}catch{n?i+=`${l}
|
|
137
|
+
`:o=!0}}return{stdout:i,stderr:"",exitCode:o?1:0}}},K4={name:"readlink",flags:[{flag:"-f",type:"boolean"},{flag:"-e",type:"boolean"}],needsArgs:!0}});function Li(e,t){let n=10,r=null,s=!1,i=!1,o=!1,a=[];for(let l=0;l<e.length;l++){let c=e[l];if(c==="-n"&&l+1<e.length){let u=e[++l];t==="tail"&&u.startsWith("+")?(o=!0,n=parseInt(u.slice(1),10)):n=parseInt(u,10)}else if(t==="tail"&&c.startsWith("-n+"))o=!0,n=parseInt(c.slice(3),10);else if(c.startsWith("-n"))n=parseInt(c.slice(2),10);else if(c==="-c"&&l+1<e.length)r=parseInt(e[++l],10);else if(c.startsWith("-c"))r=parseInt(c.slice(2),10);else if(c.startsWith("--bytes="))r=parseInt(c.slice(8),10);else if(c.startsWith("--lines="))n=parseInt(c.slice(8),10);else if(c==="-q"||c==="--quiet"||c==="--silent")s=!0;else if(c==="-v"||c==="--verbose")i=!0;else if(c.match(/^-\d+$/))n=parseInt(c.slice(1),10);else{if(c.startsWith("--"))return{ok:!1,error:Z(t,c)};if(c.startsWith("-")&&c!=="-")return{ok:!1,error:Z(t,c)};a.push(c)}}return r!==null&&(Number.isNaN(r)||r<0)?{ok:!1,error:{stdout:"",stderr:`${t}: invalid number of bytes
|
|
138
|
+
`,exitCode:1}}:Number.isNaN(n)||n<0?{ok:!1,error:{stdout:"",stderr:`${t}: invalid number of lines
|
|
139
|
+
`,exitCode:1}}:{ok:!0,options:{lines:n,bytes:r,quiet:s,verbose:i,files:a,fromLine:o}}}async function Mi(e,t,n,r){let{quiet:s,verbose:i,files:o}=t;if(o.length===0)return{stdout:r(e.stdin),stderr:"",exitCode:0};let a="",l="",c=0,u=i||!s&&o.length>1,f=0;for(let p=0;p<o.length;p++){let h=o[p];try{let d=e.fs.resolvePath(e.cwd,h),m=await e.fs.readFile(d);u&&(f>0&&(a+=`
|
|
140
|
+
`),a+=`==> ${h} <==
|
|
141
|
+
`),a+=r(m),f++}catch{l+=`${n}: ${h}: No such file or directory
|
|
142
|
+
`,c=1}}return{stdout:a,stderr:l,exitCode:c}}function p1(e,t,n){if(n!==null)return e.slice(0,n);if(t===0)return"";let r=0,s=0,i=e.length;for(;r<i&&s<t;){let o=e.indexOf(`
|
|
143
|
+
`,r);if(o===-1)return`${e}
|
|
144
|
+
`;s++,r=o+1}return r>0?e.slice(0,r):""}function h1(e,t,n,r){if(n!==null)return e.slice(-n);let s=e.length;if(s===0)return"";if(r){let l=0,c=1;for(;l<s&&c<t;){let f=e.indexOf(`
|
|
145
|
+
`,l);if(f===-1)break;c++,l=f+1}let u=e.slice(l);return u.endsWith(`
|
|
146
|
+
`)?u:`${u}
|
|
147
|
+
`}if(t===0)return"";let i=s-1;e[i]===`
|
|
148
|
+
`&&i--;let o=0;for(;i>=0&&o<t;){if(e[i]===`
|
|
149
|
+
`&&(o++,o===t)){i++;break}i--}i<0&&(i=0);let a=e.slice(i);return e[s-1]===`
|
|
150
|
+
`?a:`${a}
|
|
151
|
+
`}var za=v(()=>{"use strict";ne()});var d1={};J(d1,{flagsForFuzzing:()=>Y4,headCommand:()=>X4});var Q4,X4,Y4,m1=v(()=>{"use strict";ne();za();Q4={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},X4={name:"head",async execute(e,t){if(B(e))return U(Q4);let n=Li(e,"head");if(!n.ok)return n.error;let{lines:r,bytes:s}=n.options;return Mi(t,n.options,"head",i=>p1(i,r,s))}},Y4={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0}});var g1={};J(g1,{flagsForFuzzing:()=>t3,tailCommand:()=>e3});var J4,e3,t3,y1=v(()=>{"use strict";za();ne();J4={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},e3={name:"tail",async execute(e,t){if(B(e))return U(J4);let n=Li(e,"tail");if(!n.ok)return n.error;let{lines:r,bytes:s,fromLine:i}=n.options;return Mi(t,n.options,"tail",o=>h1(o,r,s,i??!1))}},t3={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0}});var b1={};J(b1,{flagsForFuzzing:()=>i3,wcCommand:()=>s3});function w1(e){let t=e.length,n=0,r=0,s=!1;for(let i=0;i<t;i++){let o=e[i];o===`
|
|
152
|
+
`?(n++,s&&(r++,s=!1)):o===" "||o===" "||o==="\r"?s&&(r++,s=!1):s=!0}return s&&r++,{lines:n,words:r,chars:t}}function Ha(e,t,n,r,s,i){let o=[];t&&o.push(String(e.lines).padStart(i)),n&&o.push(String(e.words).padStart(i)),r&&o.push(String(e.chars).padStart(i));let a=o.join(" ");return s&&(a+=` ${s}`),a}var n3,r3,s3,i3,x1=v(()=>{"use strict";st();vr();ne();n3={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},r3={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},s3={name:"wc",async execute(e,t){if(B(e))return U(n3);let n=Ee("wc",e,r3);if(!n.ok)return n.error;let{lines:r,words:s}=n.result.flags,i=n.result.flags.bytes||n.result.flags.chars,o=n.result.positional;!r&&!s&&!i&&(r=s=i=!0);let a=await Cr(t,o,{cmdName:"wc",stopOnError:!1});if(o.length===0){let y=w1(a.files[0].content);return{stdout:`${Ha(y,r,s,i,"",0)}
|
|
153
|
+
`,stderr:"",exitCode:0}}let l=[],c=0,u=0,f=0;for(let{filename:y,content:w}of a.files){let b=w1(w);c+=b.lines,u+=b.words,f+=b.chars,l.push({filename:y,stats:b})}let p=o.length>1?c:Math.max(...l.map(y=>y.stats.lines)),h=o.length>1?u:Math.max(...l.map(y=>y.stats.words)),d=o.length>1?f:Math.max(...l.map(y=>y.stats.chars)),m=o.length>1?3:0;r&&(m=Math.max(m,String(p).length)),s&&(m=Math.max(m,String(h).length)),i&&(m=Math.max(m,String(d).length));let g="";for(let{filename:y,stats:w}of l)g+=`${Ha(w,r,s,i,y,m)}
|
|
154
|
+
`;return o.length>1&&(g+=`${Ha({lines:c,words:u,chars:f},r,s,i,"total",m)}
|
|
155
|
+
`),{stdout:g,stderr:a.stderr,exitCode:a.exitCode}}};i3={name:"wc",flags:[{flag:"-l",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-m",type:"boolean"}],stdinType:"text",needsFiles:!0}});function Hs(e,t){let n=t?"d":"-",r=[e&256?"r":"-",e&128?"w":"-",e&64?"x":"-",e&32?"r":"-",e&16?"w":"-",e&8?"x":"-",e&4?"r":"-",e&2?"w":"-",e&1?"x":"-"];return n+r.join("")}var ja=v(()=>{"use strict"});var E1={};J(E1,{flagsForFuzzing:()=>c3,statCommand:()=>l3});var o3,a3,l3,c3,A1=v(()=>{"use strict";st();ja();ne();o3={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},a3={format:{short:"c",type:"string"}},l3={name:"stat",async execute(e,t){if(B(e))return U(o3);let n=Ee("stat",e,a3);if(!n.ok)return n.error;let r=n.result.flags.format??null,s=n.result.positional;if(s.length===0)return{stdout:"",stderr:`stat: missing operand
|
|
156
|
+
`,exitCode:1};let i="",o="",a=!1;for(let l of s){let c=t.fs.resolvePath(t.cwd,l);try{let u=await t.fs.stat(c);if(r){let f=r,p=u.mode.toString(8),h=Hs(u.mode,u.isDirectory);f=f.replace(/%n/g,l),f=f.replace(/%N/g,`'${l}'`),f=f.replace(/%s/g,String(u.size)),f=f.replace(/%F/g,u.isDirectory?"directory":"regular file"),f=f.replace(/%a/g,p),f=f.replace(/%A/g,h),f=f.replace(/%u/g,"1000"),f=f.replace(/%U/g,"user"),f=f.replace(/%g/g,"1000"),f=f.replace(/%G/g,"group"),i+=`${f}
|
|
157
|
+
`}else{let f=u.mode.toString(8).padStart(4,"0"),p=Hs(u.mode,u.isDirectory);i+=` File: ${l}
|
|
158
|
+
`,i+=` Size: ${u.size} Blocks: ${Math.ceil(u.size/512)}
|
|
159
|
+
`,i+=`Access: (${f}/${p})
|
|
160
|
+
`,i+=`Modify: ${u.mtime.toISOString()}
|
|
161
|
+
`}}catch{o+=`stat: cannot stat '${l}': No such file or directory
|
|
162
|
+
`,a=!0}}return{stdout:i,stderr:o,exitCode:a?1:0}}},c3={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0}});var j,D,k,ln,ae,Ie,z1,sr,Ui,Ga,rs,Dn,Va,qa,Ze,ss,We,Za,wn,Ka,Bi,pe,Qa,Wi,js,u3,f3,Xa,Ya,_,Ja,ns,el,tl,Ne,S1,C1,v1,k1,N1,I1,$1,O1,R1,T1,P1,D1,_1,F1,L1,M1,U1,B1,W1,Pn,Gs,nl,rl,sl,il,ol,ir,H1=v(()=>{j=class e{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static MATCH_NL=e.CLASS_NL|e.DOT_NL;static PERL=e.CLASS_NL|e.ONE_LINE|e.PERL_X|e.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2},D=class{static CODES=new Map([["\x07",7],["\b",8],[" ",9],[`
|
|
163
|
+
`,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(t){let n=String.fromCodePoint(t).toUpperCase();if(n.length>1)return t;let r=String.fromCodePoint(n.codePointAt(0)).toLowerCase();return r.length>1||r.codePointAt(0)!==t?t:n.codePointAt(0)}static toLowerCase(t){let n=String.fromCodePoint(t).toLowerCase();if(n.length>1)return t;let r=String.fromCodePoint(n.codePointAt(0)).toUpperCase();return r.length>1||r.codePointAt(0)!==t?t:n.codePointAt(0)}},k=class{SIZE=3;constructor(t){this.data=t}getLo(t){return this.data[t*this.SIZE]}getHi(t){return this.data[t*this.SIZE+1]}getStride(t){return this.data[t*this.SIZE+2]}get(t){let n=t*this.SIZE;return[this.data[n],this.data[n+1],this.data[n+2]]}get length(){return this.data.length/this.SIZE}},ln=class e{static CASE_ORBIT=new Map([[75,107],[107,8490],[8490,75],[83,115],[115,383],[383,83],[181,924],[924,956],[956,181],[197,229],[229,8491],[8491,197],[452,453],[453,454],[454,452],[455,456],[456,457],[457,455],[458,459],[459,460],[460,458],[497,498],[498,499],[499,497],[837,921],[921,953],[953,8126],[8126,837],[914,946],[946,976],[976,914],[917,949],[949,1013],[1013,917],[920,952],[952,977],[977,1012],[1012,920],[922,954],[954,1008],[1008,922],[928,960],[960,982],[982,928],[929,961],[961,1009],[1009,929],[931,962],[962,963],[963,931],[934,966],[966,981],[981,934],[937,969],[969,8486],[8486,937],[1042,1074],[1074,7296],[7296,1042],[1044,1076],[1076,7297],[7297,1044],[1054,1086],[1086,7298],[7298,1054],[1057,1089],[1089,7299],[7299,1057],[1058,1090],[1090,7300],[7300,7301],[7301,1058],[1066,1098],[1098,7302],[7302,1066],[1122,1123],[1123,7303],[7303,1122],[7304,42570],[42570,42571],[42571,7304],[7776,7777],[7777,7835],[7835,7776],[223,7838],[7838,223],[8064,8072],[8072,8064],[8065,8073],[8073,8065],[8066,8074],[8074,8066],[8067,8075],[8075,8067],[8068,8076],[8076,8068],[8069,8077],[8077,8069],[8070,8078],[8078,8070],[8071,8079],[8079,8071],[8080,8088],[8088,8080],[8081,8089],[8089,8081],[8082,8090],[8090,8082],[8083,8091],[8091,8083],[8084,8092],[8092,8084],[8085,8093],[8093,8085],[8086,8094],[8094,8086],[8087,8095],[8095,8087],[8096,8104],[8104,8096],[8097,8105],[8105,8097],[8098,8106],[8106,8098],[8099,8107],[8107,8099],[8100,8108],[8108,8100],[8101,8109],[8109,8101],[8102,8110],[8110,8102],[8103,8111],[8111,8103],[8115,8124],[8124,8115],[8131,8140],[8140,8131],[912,8147],[8147,912],[944,8163],[8163,944],[8179,8188],[8188,8179],[64261,64262],[64262,64261],[66560,66600],[66600,66560],[66561,66601],[66601,66561],[66562,66602],[66602,66562],[66563,66603],[66603,66563],[66564,66604],[66604,66564],[66565,66605],[66605,66565],[66566,66606],[66606,66566],[66567,66607],[66607,66567],[66568,66608],[66608,66568],[66569,66609],[66609,66569],[66570,66610],[66610,66570],[66571,66611],[66611,66571],[66572,66612],[66612,66572],[66573,66613],[66613,66573],[66574,66614],[66614,66574],[66575,66615],[66615,66575],[66576,66616],[66616,66576],[66577,66617],[66617,66577],[66578,66618],[66618,66578],[66579,66619],[66619,66579],[66580,66620],[66620,66580],[66581,66621],[66621,66581],[66582,66622],[66622,66582],[66583,66623],[66623,66583],[66584,66624],[66624,66584],[66585,66625],[66625,66585],[66586,66626],[66626,66586],[66587,66627],[66627,66587],[66588,66628],[66628,66588],[66589,66629],[66629,66589],[66590,66630],[66630,66590],[66591,66631],[66631,66591],[66592,66632],[66632,66592],[66593,66633],[66633,66593],[66594,66634],[66634,66594],[66595,66635],[66635,66595],[66596,66636],[66636,66596],[66597,66637],[66637,66597],[66598,66638],[66638,66598],[66599,66639],[66639,66599],[66736,66776],[66776,66736],[66737,66777],[66777,66737],[66738,66778],[66778,66738],[66739,66779],[66779,66739],[66740,66780],[66780,66740],[66741,66781],[66781,66741],[66742,66782],[66782,66742],[66743,66783],[66783,66743],[66744,66784],[66784,66744],[66745,66785],[66785,66745],[66746,66786],[66786,66746],[66747,66787],[66787,66747],[66748,66788],[66788,66748],[66749,66789],[66789,66749],[66750,66790],[66790,66750],[66751,66791],[66791,66751],[66752,66792],[66792,66752],[66753,66793],[66793,66753],[66754,66794],[66794,66754],[66755,66795],[66795,66755],[66756,66796],[66796,66756],[66757,66797],[66797,66757],[66758,66798],[66798,66758],[66759,66799],[66799,66759],[66760,66800],[66800,66760],[66761,66801],[66801,66761],[66762,66802],[66802,66762],[66763,66803],[66803,66763],[66764,66804],[66804,66764],[66765,66805],[66805,66765],[66766,66806],[66806,66766],[66767,66807],[66807,66767],[66768,66808],[66808,66768],[66769,66809],[66809,66769],[66770,66810],[66810,66770],[66771,66811],[66811,66771],[66928,66967],[66967,66928],[66929,66968],[66968,66929],[66930,66969],[66969,66930],[66931,66970],[66970,66931],[66932,66971],[66971,66932],[66933,66972],[66972,66933],[66934,66973],[66973,66934],[66935,66974],[66974,66935],[66936,66975],[66975,66936],[66937,66976],[66976,66937],[66938,66977],[66977,66938],[66940,66979],[66979,66940],[66941,66980],[66980,66941],[66942,66981],[66981,66942],[66943,66982],[66982,66943],[66944,66983],[66983,66944],[66945,66984],[66984,66945],[66946,66985],[66985,66946],[66947,66986],[66986,66947],[66948,66987],[66987,66948],[66949,66988],[66988,66949],[66950,66989],[66989,66950],[66951,66990],[66990,66951],[66952,66991],[66991,66952],[66953,66992],[66992,66953],[66954,66993],[66993,66954],[66956,66995],[66995,66956],[66957,66996],[66996,66957],[66958,66997],[66997,66958],[66959,66998],[66998,66959],[66960,66999],[66999,66960],[66961,67e3],[67e3,66961],[66962,67001],[67001,66962],[66964,67003],[67003,66964],[66965,67004],[67004,66965],[68736,68800],[68800,68736],[68737,68801],[68801,68737],[68738,68802],[68802,68738],[68739,68803],[68803,68739],[68740,68804],[68804,68740],[68741,68805],[68805,68741],[68742,68806],[68806,68742],[68743,68807],[68807,68743],[68744,68808],[68808,68744],[68745,68809],[68809,68745],[68746,68810],[68810,68746],[68747,68811],[68811,68747],[68748,68812],[68812,68748],[68749,68813],[68813,68749],[68750,68814],[68814,68750],[68751,68815],[68815,68751],[68752,68816],[68816,68752],[68753,68817],[68817,68753],[68754,68818],[68818,68754],[68755,68819],[68819,68755],[68756,68820],[68820,68756],[68757,68821],[68821,68757],[68758,68822],[68822,68758],[68759,68823],[68823,68759],[68760,68824],[68824,68760],[68761,68825],[68825,68761],[68762,68826],[68826,68762],[68763,68827],[68827,68763],[68764,68828],[68828,68764],[68765,68829],[68829,68765],[68766,68830],[68830,68766],[68767,68831],[68831,68767],[68768,68832],[68832,68768],[68769,68833],[68833,68769],[68770,68834],[68834,68770],[68771,68835],[68835,68771],[68772,68836],[68836,68772],[68773,68837],[68837,68773],[68774,68838],[68838,68774],[68775,68839],[68839,68775],[68776,68840],[68840,68776],[68777,68841],[68841,68777],[68778,68842],[68842,68778],[68779,68843],[68843,68779],[68780,68844],[68844,68780],[68781,68845],[68845,68781],[68782,68846],[68846,68782],[68783,68847],[68847,68783],[68784,68848],[68848,68784],[68785,68849],[68849,68785],[68786,68850],[68850,68786],[68944,68976],[68976,68944],[68945,68977],[68977,68945],[68946,68978],[68978,68946],[68947,68979],[68979,68947],[68948,68980],[68980,68948],[68949,68981],[68981,68949],[68950,68982],[68982,68950],[68951,68983],[68983,68951],[68952,68984],[68984,68952],[68953,68985],[68985,68953],[68954,68986],[68986,68954],[68955,68987],[68987,68955],[68956,68988],[68988,68956],[68957,68989],[68989,68957],[68958,68990],[68990,68958],[68959,68991],[68991,68959],[68960,68992],[68992,68960],[68961,68993],[68993,68961],[68962,68994],[68994,68962],[68963,68995],[68995,68963],[68964,68996],[68996,68964],[68965,68997],[68997,68965],[71840,71872],[71872,71840],[71841,71873],[71873,71841],[71842,71874],[71874,71842],[71843,71875],[71875,71843],[71844,71876],[71876,71844],[71845,71877],[71877,71845],[71846,71878],[71878,71846],[71847,71879],[71879,71847],[71848,71880],[71880,71848],[71849,71881],[71881,71849],[71850,71882],[71882,71850],[71851,71883],[71883,71851],[71852,71884],[71884,71852],[71853,71885],[71885,71853],[71854,71886],[71886,71854],[71855,71887],[71887,71855],[71856,71888],[71888,71856],[71857,71889],[71889,71857],[71858,71890],[71890,71858],[71859,71891],[71891,71859],[71860,71892],[71892,71860],[71861,71893],[71893,71861],[71862,71894],[71894,71862],[71863,71895],[71895,71863],[71864,71896],[71896,71864],[71865,71897],[71897,71865],[71866,71898],[71898,71866],[71867,71899],[71899,71867],[71868,71900],[71900,71868],[71869,71901],[71901,71869],[71870,71902],[71902,71870],[71871,71903],[71903,71871],[93760,93792],[93792,93760],[93761,93793],[93793,93761],[93762,93794],[93794,93762],[93763,93795],[93795,93763],[93764,93796],[93796,93764],[93765,93797],[93797,93765],[93766,93798],[93798,93766],[93767,93799],[93799,93767],[93768,93800],[93800,93768],[93769,93801],[93801,93769],[93770,93802],[93802,93770],[93771,93803],[93803,93771],[93772,93804],[93804,93772],[93773,93805],[93805,93773],[93774,93806],[93806,93774],[93775,93807],[93807,93775],[93776,93808],[93808,93776],[93777,93809],[93809,93777],[93778,93810],[93810,93778],[93779,93811],[93811,93779],[93780,93812],[93812,93780],[93781,93813],[93813,93781],[93782,93814],[93814,93782],[93783,93815],[93815,93783],[93784,93816],[93816,93784],[93785,93817],[93817,93785],[93786,93818],[93818,93786],[93787,93819],[93819,93787],[93788,93820],[93820,93788],[93789,93821],[93821,93789],[93790,93822],[93822,93790],[93791,93823],[93823,93791],[125184,125218],[125218,125184],[125185,125219],[125219,125185],[125186,125220],[125220,125186],[125187,125221],[125221,125187],[125188,125222],[125222,125188],[125189,125223],[125223,125189],[125190,125224],[125224,125190],[125191,125225],[125225,125191],[125192,125226],[125226,125192],[125193,125227],[125227,125193],[125194,125228],[125228,125194],[125195,125229],[125229,125195],[125196,125230],[125230,125196],[125197,125231],[125231,125197],[125198,125232],[125232,125198],[125199,125233],[125233,125199],[125200,125234],[125234,125200],[125201,125235],[125235,125201],[125202,125236],[125236,125202],[125203,125237],[125237,125203],[125204,125238],[125238,125204],[125205,125239],[125239,125205],[125206,125240],[125240,125206],[125207,125241],[125241,125207],[125208,125242],[125242,125208],[125209,125243],[125243,125209],[125210,125244],[125244,125210],[125211,125245],[125245,125211],[125212,125246],[125246,125212],[125213,125247],[125247,125213],[125214,125248],[125248,125214],[125215,125249],[125249,125215],[125216,125250],[125250,125216],[125217,125251],[125251,125217]]);static C=new k(new Uint32Array([0,31,1,127,159,1,173,888,715,889,896,7,897,899,1,907,909,2,930,1328,398,1367,1368,1,1419,1420,1,1424,1480,56,1481,1487,1,1515,1518,1,1525,1541,1,1564,1757,193,1806,1807,1,1867,1868,1,1970,1983,1,2043,2044,1,2094,2095,1,2111,2140,29,2141,2143,2,2155,2159,1,2191,2198,1,2274,2436,162,2445,2446,1,2449,2450,1,2473,2481,8,2483,2485,1,2490,2491,1,2501,2502,1,2505,2506,1,2511,2518,1,2520,2523,1,2526,2532,6,2533,2559,26,2560,2564,4,2571,2574,1,2577,2578,1,2601,2609,8,2612,2618,3,2619,2621,2,2627,2630,1,2633,2634,1,2638,2640,1,2642,2648,1,2653,2655,2,2656,2661,1,2679,2688,1,2692,2702,10,2706,2729,23,2737,2740,3,2746,2747,1,2758,2766,4,2767,2769,2,2770,2783,1,2788,2789,1,2802,2808,1,2816,2820,4,2829,2830,1,2833,2834,1,2857,2865,8,2868,2874,6,2875,2885,10,2886,2889,3,2890,2894,4,2895,2900,1,2904,2907,1,2910,2916,6,2917,2936,19,2937,2945,1,2948,2955,7,2956,2957,1,2961,2966,5,2967,2968,1,2971,2973,2,2976,2978,1,2981,2983,1,2987,2989,1,3002,3005,1,3011,3013,1,3017,3022,5,3023,3025,2,3026,3030,1,3032,3045,1,3067,3071,1,3085,3089,4,3113,3130,17,3131,3141,10,3145,3150,5,3151,3156,1,3159,3163,4,3164,3166,2,3167,3172,5,3173,3184,11,3185,3190,1,3213,3217,4,3241,3252,11,3258,3259,1,3269,3273,4,3278,3284,1,3287,3292,1,3295,3300,5,3301,3312,11,3316,3327,1,3341,3345,4,3397,3401,4,3408,3411,1,3428,3429,1,3456,3460,4,3479,3481,1,3506,3516,10,3518,3519,1,3527,3529,1,3531,3534,1,3541,3543,2,3552,3557,1,3568,3569,1,3573,3584,1,3643,3646,1,3676,3712,1,3715,3717,2,3723,3748,25,3750,3774,24,3775,3781,6,3783,3791,8,3802,3803,1,3808,3839,1,3912,3949,37,3950,3952,1,3992,4029,37,4045,4059,14,4060,4095,1,4294,4296,2,4297,4300,1,4302,4303,1,4681,4686,5,4687,4695,8,4697,4702,5,4703,4745,42,4750,4751,1,4785,4790,5,4791,4799,8,4801,4806,5,4807,4823,16,4881,4886,5,4887,4955,68,4956,4989,33,4990,4991,1,5018,5023,1,5110,5111,1,5118,5119,1,5789,5791,1,5881,5887,1,5910,5918,1,5943,5951,1,5972,5983,1,5997,6001,4,6004,6015,1,6110,6111,1,6122,6127,1,6138,6143,1,6158,6170,12,6171,6175,1,6265,6271,1,6315,6319,1,6390,6399,1,6431,6444,13,6445,6447,1,6460,6463,1,6465,6467,1,6510,6511,1,6517,6527,1,6572,6575,1,6602,6607,1,6619,6621,1,6684,6685,1,6751,6781,30,6782,6794,12,6795,6799,1,6810,6815,1,6830,6831,1,6863,6911,1,6989,7156,167,7157,7163,1,7224,7226,1,7242,7244,1,7307,7311,1,7355,7356,1,7368,7375,1,7419,7423,1,7958,7959,1,7966,7967,1,8006,8007,1,8014,8015,1,8024,8030,2,8062,8063,1,8117,8133,16,8148,8149,1,8156,8176,20,8177,8181,4,8191,8203,12,8204,8207,1,8234,8238,1,8288,8303,1,8306,8307,1,8335,8349,14,8350,8351,1,8385,8399,1,8433,8447,1,8588,8591,1,9258,9279,1,9291,9311,1,11124,11125,1,11158,11508,350,11509,11512,1,11558,11560,2,11561,11564,1,11566,11567,1,11624,11630,1,11633,11646,1,11671,11679,1,11687,11743,8,11870,11903,1,11930,12020,90,12021,12031,1,12246,12271,1,12352,12439,87,12440,12544,104,12545,12548,1,12592,12687,95,12774,12782,1,12831,42125,29294,42126,42127,1,42183,42191,1,42540,42559,1,42744,42751,1,42958,42959,1,42962,42964,2,42973,42993,1,43053,43055,1,43066,43071,1,43128,43135,1,43206,43213,1,43226,43231,1,43348,43358,1,43389,43391,1,43470,43482,12,43483,43485,1,43519,43575,56,43576,43583,1,43598,43599,1,43610,43611,1,43715,43738,1,43767,43776,1,43783,43784,1,43791,43792,1,43799,43807,1,43815,43823,8,43884,43887,1,44014,44015,1,44026,44031,1,55204,55215,1,55239,55242,1,55292,63743,1,64110,64111,1,64218,64255,1,64263,64274,1,64280,64284,1,64311,64317,6,64319,64325,3,64451,64466,1,64912,64913,1,64968,64974,1,64976,65007,1,65050,65055,1,65107,65127,20,65132,65135,1,65141,65277,136,65278,65280,1,65471,65473,1,65480,65481,1,65488,65489,1,65496,65497,1,65501,65503,1,65511,65519,8,65520,65531,1,65534,65535,1,65548,65575,27,65595,65598,3,65614,65615,1,65630,65663,1,65787,65791,1,65795,65798,1,65844,65846,1,65935,65949,14,65950,65951,1,65953,65999,1,66046,66175,1,66205,66207,1,66257,66271,1,66300,66303,1,66340,66348,1,66379,66383,1,66427,66431,1,66462,66500,38,66501,66503,1,66518,66559,1,66718,66719,1,66730,66735,1,66772,66775,1,66812,66815,1,66856,66863,1,66916,66926,1,66939,66955,16,66963,66966,3,66978,66994,16,67002,67005,3,67006,67007,1,67060,67071,1,67383,67391,1,67414,67423,1,67432,67455,1,67462,67505,43,67515,67583,1,67590,67591,1,67593,67638,45,67641,67643,1,67645,67646,1,67670,67743,73,67744,67750,1,67760,67807,1,67827,67830,3,67831,67834,1,67868,67870,1,67898,67902,1,67904,67967,1,68024,68027,1,68048,68049,1,68100,68103,3,68104,68107,1,68116,68120,4,68150,68151,1,68155,68158,1,68169,68175,1,68185,68191,1,68256,68287,1,68327,68330,1,68343,68351,1,68406,68408,1,68438,68439,1,68467,68471,1,68498,68504,1,68509,68520,1,68528,68607,1,68681,68735,1,68787,68799,1,68851,68857,1,68904,68911,1,68922,68927,1,68966,68968,1,68998,69005,1,69008,69215,1,69247,69290,43,69294,69295,1,69298,69313,1,69317,69371,1,69416,69423,1,69466,69487,1,69514,69551,1,69580,69599,1,69623,69631,1,69710,69713,1,69750,69758,1,69821,69827,6,69828,69839,1,69865,69871,1,69882,69887,1,69941,69960,19,69961,69967,1,70007,70015,1,70112,70133,21,70134,70143,1,70162,70210,48,70211,70271,1,70279,70281,2,70286,70302,16,70314,70319,1,70379,70383,1,70394,70399,1,70404,70413,9,70414,70417,3,70418,70441,23,70449,70452,3,70458,70469,11,70470,70473,3,70474,70478,4,70479,70481,2,70482,70486,1,70488,70492,1,70500,70501,1,70509,70511,1,70517,70527,1,70538,70540,2,70541,70543,2,70582,70593,11,70595,70596,1,70598,70603,5,70614,70617,3,70618,70624,1,70627,70655,1,70748,70754,6,70755,70783,1,70856,70863,1,70874,71039,1,71094,71095,1,71134,71167,1,71237,71247,1,71258,71263,1,71277,71295,1,71354,71359,1,71370,71375,1,71396,71423,1,71451,71452,1,71468,71471,1,71495,71679,1,71740,71839,1,71923,71934,1,71943,71944,1,71946,71947,1,71956,71959,3,71990,71993,3,71994,72007,13,72008,72015,1,72026,72095,1,72104,72105,1,72152,72153,1,72165,72191,1,72264,72271,1,72355,72367,1,72441,72447,1,72458,72639,1,72674,72687,1,72698,72703,1,72713,72759,46,72774,72783,1,72813,72815,1,72848,72849,1,72872,72887,15,72888,72959,1,72967,72970,3,73015,73017,1,73019,73022,3,73032,73039,1,73050,73055,1,73062,73065,3,73103,73106,3,73113,73119,1,73130,73439,1,73465,73471,1,73489,73531,42,73532,73533,1,73563,73647,1,73649,73663,1,73714,73726,1,74650,74751,1,74863,74869,6,74870,74879,1,75076,77711,1,77811,77823,1,78896,78911,1,78934,78943,1,82939,82943,1,83527,90367,1,90426,92159,1,92729,92735,1,92767,92778,11,92779,92781,1,92863,92874,11,92875,92879,1,92910,92911,1,92918,92927,1,92998,93007,1,93018,93026,8,93048,93052,1,93072,93503,1,93562,93759,1,93851,93951,1,94027,94030,1,94088,94094,1,94112,94175,1,94181,94191,1,94194,94207,1,100344,100351,1,101590,101630,1,101641,110575,1,110580,110588,8,110591,110883,292,110884,110897,1,110899,110927,1,110931,110932,1,110934,110947,1,110952,110959,1,111356,113663,1,113771,113775,1,113789,113791,1,113801,113807,1,113818,113819,1,113824,117759,1,118010,118015,1,118452,118527,1,118574,118575,1,118599,118607,1,118724,118783,1,119030,119039,1,119079,119080,1,119155,119162,1,119275,119295,1,119366,119487,1,119508,119519,1,119540,119551,1,119639,119647,1,119673,119807,1,119893,119965,72,119968,119969,1,119971,119972,1,119975,119976,1,119981,119994,13,119996,120004,8,120070,120075,5,120076,120085,9,120093,120122,29,120127,120133,6,120135,120137,1,120145,120486,341,120487,120780,293,120781,121484,703,121485,121498,1,121504,121520,16,121521,122623,1,122655,122660,1,122667,122879,1,122887,122905,18,122906,122914,8,122917,122923,6,122924,122927,1,122990,123022,1,123024,123135,1,123181,123183,1,123198,123199,1,123210,123213,1,123216,123535,1,123567,123583,1,123642,123646,1,123648,124111,1,124154,124367,1,124411,124414,1,124416,124895,1,124903,124908,5,124911,124927,16,125125,125126,1,125143,125183,1,125260,125263,1,125274,125277,1,125280,126064,1,126133,126208,1,126270,126463,1,126468,126496,28,126499,126501,2,126502,126504,2,126515,126520,5,126522,126524,2,126525,126529,1,126531,126534,1,126536,126540,2,126544,126547,3,126549,126550,1,126552,126560,2,126563,126565,2,126566,126571,5,126579,126589,5,126591,126602,11,126620,126624,1,126628,126634,6,126652,126703,1,126706,126975,1,127020,127023,1,127124,127135,1,127151,127152,1,127168,127184,16,127222,127231,1,127406,127461,1,127491,127503,1,127548,127551,1,127561,127567,1,127570,127583,1,127590,127743,1,128728,128731,1,128749,128751,1,128765,128767,1,128887,128890,1,128986,128991,1,129004,129007,1,129009,129023,1,129036,129039,1,129096,129103,1,129114,129119,1,129160,129167,1,129198,129199,1,129212,129215,1,129218,129279,1,129620,129631,1,129646,129647,1,129661,129663,1,129674,129678,1,129735,129741,1,129757,129758,1,129770,129775,1,129785,129791,1,129939,130042,103,130043,131071,1,173792,173823,1,177978,177983,1,178206,178207,1,183970,183983,1,191457,191471,1,192094,194559,1,195102,196607,1,201547,201551,1,205744,917759,1,918e3,1114111,1]));static Cc=new k(new Uint32Array([0,31,1,127,159,1]));static Cf=new k(new Uint32Array([173,1536,1363,1537,1541,1,1564,1757,193,1807,2192,385,2193,2274,81,6158,8203,2045,8204,8207,1,8234,8238,1,8288,8292,1,8294,8303,1,65279,65529,250,65530,65531,1,69821,69837,16,78896,78911,1,113824,113827,1,119155,119162,1,917505,917536,31,917537,917631,1]));static Co=new k(new Uint32Array([57344,63743,1,983040,1048573,1,1048576,1114109,1]));static Cs=new k(new Uint32Array([55296,57343,1]));static L=new k(new Uint32Array([65,90,1,97,122,1,170,181,11,186,192,6,193,214,1,216,246,1,248,705,1,710,721,1,736,740,1,748,750,2,880,884,1,886,887,1,890,893,1,895,902,7,904,906,1,908,910,2,911,929,1,931,1013,1,1015,1153,1,1162,1327,1,1329,1366,1,1369,1376,7,1377,1416,1,1488,1514,1,1519,1522,1,1568,1610,1,1646,1647,1,1649,1747,1,1749,1765,16,1766,1774,8,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2036,2037,1,2042,2048,6,2049,2069,1,2074,2084,10,2088,2112,24,2113,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2249,1,2308,2361,1,2365,2384,19,2392,2401,1,2417,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3654,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3782,3804,22,3805,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4256,18,4257,4293,1,4295,4301,6,4304,4346,1,4348,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5024,5109,1,5112,5117,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6103,6108,5,6176,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6823,6917,94,6918,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7293,1,7296,7306,1,7312,7354,1,7357,7359,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,7424,6,7425,7615,1,7680,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8124,1,8126,8130,4,8131,8132,1,8134,8140,1,8144,8147,1,8150,8155,1,8160,8172,1,8178,8180,1,8182,8188,1,8305,8319,14,8336,8348,1,8450,8455,5,8458,8467,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8495,8505,1,8508,8511,1,8517,8521,1,8526,8579,53,8580,11264,2684,11265,11492,1,11499,11502,1,11506,11507,1,11520,11557,1,11559,11565,6,11568,11623,1,11631,11648,17,11649,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11823,12293,470,12294,12337,43,12338,12341,1,12347,12348,1,12353,12438,1,12445,12447,1,12449,12538,1,12540,12543,1,12549,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,42124,1,42192,42237,1,42240,42508,1,42512,42527,1,42538,42539,1,42560,42606,1,42623,42653,1,42656,42725,1,42775,42783,1,42786,42888,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43471,43488,17,43489,43492,1,43494,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43741,1,43744,43754,1,43762,43764,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43866,1,43868,43881,1,43888,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65313,65338,1,65345,65370,1,65382,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66560,66717,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68736,68786,1,68800,68850,1,68864,68899,1,68938,68965,1,68975,68997,1,69248,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71840,71903,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,92992,92995,1,93027,93047,1,93053,93071,1,93504,93548,1,93760,93823,1,93952,94026,1,94032,94099,67,94100,94111,1,94176,94177,1,94179,94208,29,94209,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120512,1,120514,120538,1,120540,120570,1,120572,120596,1,120598,120628,1,120630,120654,1,120656,120686,1,120688,120712,1,120714,120744,1,120746,120770,1,120772,120779,1,122624,122654,1,122661,122666,1,122928,122989,1,123136,123180,1,123191,123197,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124139,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125184,125251,1,125259,126464,1205,126465,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static foldL=new k(new Uint32Array([837,837,1]));static Ll=new k(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,311,2,312,328,2,329,375,2,378,382,2,383,384,1,387,389,2,392,396,4,397,402,5,405,409,4,410,411,1,414,417,3,419,421,2,424,426,2,427,429,2,432,436,4,438,441,3,442,445,3,446,447,1,454,460,3,462,476,2,477,495,2,496,499,3,501,505,4,507,563,2,564,569,1,572,575,3,576,578,2,583,591,2,592,659,1,661,687,1,881,883,2,887,891,4,892,893,1,912,940,28,941,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1020,1072,52,1073,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1376,1416,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7424,118,7425,7467,1,7531,7543,1,7545,7578,1,7681,7829,2,7830,7837,1,7839,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8016,8023,1,8032,8039,1,8048,8061,1,8064,8071,1,8080,8087,1,8096,8103,1,8112,8116,1,8118,8119,1,8126,8130,4,8131,8132,1,8134,8135,1,8144,8147,1,8150,8151,1,8160,8167,1,8178,8180,1,8182,8183,1,8458,8462,4,8463,8467,4,8495,8505,5,8508,8509,1,8518,8521,1,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11377,11379,2,11380,11382,2,11383,11387,1,11393,11491,2,11492,11500,8,11502,11507,5,11520,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42800,42801,1,42803,42865,2,42866,42872,1,42874,42876,2,42879,42887,2,42892,42894,2,42897,42899,2,42900,42901,1,42903,42921,2,42927,42933,6,42935,42947,2,42952,42954,2,42957,42961,4,42963,42971,2,42998,43002,4,43824,43866,1,43872,43880,1,43888,43967,1,64256,64262,1,64275,64279,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,119834,119859,1,119886,119892,1,119894,119911,1,119938,119963,1,119990,119993,1,119995,119997,2,119998,120003,1,120005,120015,1,120042,120067,1,120094,120119,1,120146,120171,1,120198,120223,1,120250,120275,1,120302,120327,1,120354,120379,1,120406,120431,1,120458,120485,1,120514,120538,1,120540,120545,1,120572,120596,1,120598,120603,1,120630,120654,1,120656,120661,1,120688,120712,1,120714,120719,1,120746,120770,1,120772,120777,1,120779,122624,1845,122625,122633,1,122635,122654,1,122661,122666,1,125218,125251,1]));static foldLl=new k(new Uint32Array([65,90,1,192,214,1,216,222,1,256,302,2,306,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,453,1,455,456,1,458,459,1,461,475,2,478,494,2,497,498,1,500,502,2,503,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,837,880,43,882,886,4,895,902,7,904,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,984,9,986,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8072,8079,1,8088,8095,1,8104,8111,1,8120,8124,1,8136,8140,1,8152,8155,1,8168,8172,1,8184,8188,1,8486,8490,4,8491,8498,7,8579,11264,2685,11265,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,125184,125217,1]));static Lm=new k(new Uint32Array([688,705,1,710,721,1,736,740,1,748,750,2,884,890,6,1369,1600,231,1765,1766,1,2036,2037,1,2042,2074,32,2084,2088,4,2249,2417,168,3654,3782,128,4348,6103,1755,6211,6823,612,7288,7293,1,7468,7530,1,7544,7579,35,7580,7615,1,8305,8319,14,8336,8348,1,11388,11389,1,11631,11823,192,12293,12337,44,12338,12341,1,12347,12445,98,12446,12540,94,12541,12542,1,40981,42232,1251,42233,42237,1,42508,42623,115,42652,42653,1,42775,42783,1,42864,42888,24,42994,42996,1,43e3,43001,1,43471,43494,23,43632,43741,109,43763,43764,1,43868,43871,1,43881,65392,21511,65438,65439,1,67456,67461,1,67463,67504,1,67506,67514,1,68942,68975,33,92992,92995,1,93504,93506,1,93547,93548,1,94099,94111,1,94176,94177,1,94179,110576,16397,110577,110579,1,110581,110587,1,110589,110590,1,122928,122989,1,123191,123197,1,124139,125259,1120]));static Lo=new k(new Uint32Array([170,186,16,443,448,5,449,451,1,660,1488,828,1489,1514,1,1519,1522,1,1568,1599,1,1601,1610,1,1646,1647,1,1649,1747,1,1749,1774,25,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2048,2069,1,2112,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2248,1,2308,2361,1,2365,2384,19,2392,2401,1,2418,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3653,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3804,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4352,114,4353,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6108,6176,68,6177,6210,1,6212,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6917,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7287,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,8501,1083,8502,8504,1,11568,11623,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,12294,12348,54,12353,12438,1,12447,12449,2,12450,12538,1,12543,12549,6,12550,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,40980,1,40982,42124,1,42192,42231,1,42240,42507,1,42512,42527,1,42538,42539,1,42606,42656,50,42657,42725,1,42895,42999,104,43003,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43488,43492,1,43495,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43631,1,43633,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43740,1,43744,43754,1,43762,43777,15,43778,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43968,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65382,65391,1,65393,65437,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66640,66717,1,66816,66855,1,66864,66915,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68864,68899,1,68938,68941,1,68943,69248,305,69249,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,93027,93047,1,93053,93071,1,93507,93546,1,93952,94026,1,94032,94208,176,94209,100343,1,100352,101589,1,101631,101640,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,122634,123136,502,123137,123180,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124138,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static Lt=new k(new Uint32Array([453,459,3,498,8072,7574,8073,8079,1,8088,8095,1,8104,8111,1,8124,8140,16,8188,8188,1]));static foldLt=new k(new Uint32Array([452,454,2,455,457,2,458,460,2,497,499,2,8064,8071,1,8080,8087,1,8096,8103,1,8115,8131,16,8179,8179,1]));static Lu=new k(new Uint32Array([65,90,1,192,214,1,216,222,1,256,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,461,3,463,475,2,478,494,2,497,500,3,502,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,880,882,2,886,895,9,902,904,2,905,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,978,3,979,980,1,984,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8120,8123,1,8136,8139,1,8152,8155,1,8168,8172,1,8184,8187,1,8450,8455,5,8459,8461,1,8464,8466,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8496,8499,1,8510,8511,1,8517,8579,62,11264,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,119808,119833,1,119860,119885,1,119912,119937,1,119964,119966,2,119967,119973,3,119974,119977,3,119978,119980,1,119982,119989,1,120016,120041,1,120068,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120120,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120172,120197,1,120224,120249,1,120276,120301,1,120328,120353,1,120380,120405,1,120432,120457,1,120488,120512,1,120546,120570,1,120604,120628,1,120662,120686,1,120720,120744,1,120778,125184,4406,125185,125217,1]));static Upper=this.Lu;static foldLu=new k(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,303,2,307,311,2,314,328,2,331,375,2,378,382,2,383,384,1,387,389,2,392,396,4,402,405,3,409,411,1,414,417,3,419,421,2,424,429,5,432,436,4,438,441,3,445,447,2,453,454,1,456,457,1,459,460,1,462,476,2,477,495,2,498,499,1,501,505,4,507,543,2,547,563,2,572,575,3,576,578,2,583,591,2,592,596,1,598,599,1,601,603,2,604,608,4,609,611,2,612,614,1,616,620,1,623,625,2,626,629,3,637,640,3,642,643,1,647,652,1,658,669,11,670,837,167,881,883,2,887,891,4,892,893,1,940,943,1,945,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1072,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1377,1414,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7545,239,7549,7566,17,7681,7829,2,7835,7841,6,7843,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8017,8023,2,8032,8039,1,8048,8061,1,8112,8113,1,8126,8144,18,8145,8160,15,8161,8165,4,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11379,11382,3,11393,11491,2,11500,11502,2,11507,11520,13,11521,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42803,42863,2,42874,42876,2,42879,42887,2,42892,42897,5,42899,42900,1,42903,42921,2,42933,42947,2,42952,42954,2,42957,42961,4,42967,42971,2,42998,43859,861,43888,43967,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,125218,125251,1]));static M=new k(new Uint32Array([768,879,1,1155,1161,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2307,1,2362,2364,1,2366,2383,1,2385,2391,1,2402,2403,1,2433,2435,1,2492,2494,2,2495,2500,1,2503,2504,1,2507,2509,1,2519,2530,11,2531,2558,27,2561,2563,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2672,31,2673,2677,4,2689,2691,1,2748,2750,2,2751,2757,1,2759,2761,1,2763,2765,1,2786,2787,1,2810,2815,1,2817,2819,1,2876,2878,2,2879,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2914,2915,1,2946,3006,60,3007,3010,1,3014,3016,1,3018,3021,1,3031,3072,41,3073,3076,1,3132,3134,2,3135,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3203,1,3260,3262,2,3263,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3298,3299,1,3315,3328,13,3329,3331,1,3387,3388,1,3390,3396,1,3398,3400,1,3402,3405,1,3415,3426,11,3427,3457,30,3458,3459,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3570,3571,1,3633,3636,3,3637,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3902,3903,1,3953,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4139,101,4140,4158,1,4182,4185,1,4190,4192,1,4194,4196,1,4199,4205,1,4209,4212,1,4226,4237,1,4239,4250,11,4251,4253,1,4957,4959,1,5906,5909,1,5938,5940,1,5970,5971,1,6002,6003,1,6068,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6443,1,6448,6459,1,6679,6683,1,6741,6750,1,6752,6780,1,6783,6832,49,6833,6862,1,6912,6916,1,6964,6980,1,7019,7027,1,7040,7042,1,7073,7085,1,7142,7155,1,7204,7223,1,7376,7378,1,7380,7400,1,7405,7412,7,7415,7417,1,7616,7679,1,8400,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12335,1,12441,12442,1,42607,42610,1,42612,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43043,24,43044,43047,1,43052,43136,84,43137,43188,51,43189,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43347,1,43392,43395,1,43443,43456,1,43493,43561,68,43562,43574,1,43587,43596,9,43597,43643,46,43644,43645,1,43696,43698,2,43699,43700,1,43703,43704,1,43710,43711,1,43713,43755,42,43756,43759,1,43765,43766,1,44003,44010,1,44012,44013,1,64286,65024,738,65025,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69632,69634,1,69688,69702,1,69744,69747,3,69748,69759,11,69760,69762,1,69808,69818,1,69826,69888,62,69889,69890,1,69927,69940,1,69957,69958,1,70003,70016,13,70017,70018,1,70067,70080,1,70089,70092,1,70094,70095,1,70188,70199,1,70206,70209,3,70367,70378,1,70400,70403,1,70459,70460,1,70462,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70502,3,70503,70508,1,70512,70516,1,70584,70592,1,70594,70597,3,70599,70602,1,70604,70608,1,70610,70625,15,70626,70709,83,70710,70726,1,70750,70832,82,70833,70851,1,71087,71093,1,71096,71104,1,71132,71133,1,71216,71232,1,71339,71351,1,71453,71467,1,71724,71738,1,71984,71989,1,71991,71992,1,71995,71998,1,72e3,72002,2,72003,72145,142,72146,72151,1,72154,72160,1,72164,72193,29,72194,72202,1,72243,72249,1,72251,72254,1,72263,72273,10,72274,72283,1,72330,72345,1,72751,72758,1,72760,72767,1,72850,72871,1,72873,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73098,67,73099,73102,1,73104,73105,1,73107,73111,1,73459,73462,1,73472,73473,1,73475,73524,49,73525,73530,1,73534,73538,1,73562,78912,5350,78919,78933,1,90398,90415,1,92912,92916,1,92976,92982,1,94031,94033,2,94034,94087,1,94095,94098,1,94180,94192,12,94193,113821,19628,113822,118528,4706,118529,118573,1,118576,118598,1,119141,119145,1,119149,119154,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]));static foldM=new k(new Uint32Array([921,953,32,8126,8126,1]));static Mc=new k(new Uint32Array([2307,2363,56,2366,2368,1,2377,2380,1,2382,2383,1,2434,2435,1,2494,2496,1,2503,2504,1,2507,2508,1,2519,2563,44,2622,2624,1,2691,2750,59,2751,2752,1,2761,2763,2,2764,2818,54,2819,2878,59,2880,2887,7,2888,2891,3,2892,2903,11,3006,3007,1,3009,3010,1,3014,3016,1,3018,3020,1,3031,3073,42,3074,3075,1,3137,3140,1,3202,3203,1,3262,3264,2,3265,3268,1,3271,3272,1,3274,3275,1,3285,3286,1,3315,3330,15,3331,3390,59,3391,3392,1,3398,3400,1,3402,3404,1,3415,3458,43,3459,3535,76,3536,3537,1,3544,3551,1,3570,3571,1,3902,3903,1,3967,4139,172,4140,4145,5,4152,4155,3,4156,4182,26,4183,4194,11,4195,4196,1,4199,4205,1,4227,4228,1,4231,4236,1,4239,4250,11,4251,4252,1,5909,5940,31,6070,6078,8,6079,6085,1,6087,6088,1,6435,6438,1,6441,6443,1,6448,6449,1,6451,6456,1,6681,6682,1,6741,6743,2,6753,6755,2,6756,6765,9,6766,6770,1,6916,6965,49,6971,6973,2,6974,6977,1,6979,6980,1,7042,7073,31,7078,7079,1,7082,7143,61,7146,7148,1,7150,7154,4,7155,7204,49,7205,7211,1,7220,7221,1,7393,7415,22,12334,12335,1,43043,43044,1,43047,43136,89,43137,43188,51,43189,43203,1,43346,43347,1,43395,43444,49,43445,43450,5,43451,43454,3,43455,43456,1,43567,43568,1,43571,43572,1,43597,43643,46,43645,43755,110,43758,43759,1,43765,44003,238,44004,44006,2,44007,44009,2,44010,44012,2,69632,69634,2,69762,69808,46,69809,69810,1,69815,69816,1,69932,69957,25,69958,70018,60,70067,70069,1,70079,70080,1,70094,70188,94,70189,70190,1,70194,70195,1,70197,70368,171,70369,70370,1,70402,70403,1,70462,70463,1,70465,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70584,85,70585,70586,1,70594,70597,3,70599,70602,1,70604,70605,1,70607,70709,102,70710,70711,1,70720,70721,1,70725,70832,107,70833,70834,1,70841,70843,2,70844,70846,1,70849,71087,238,71088,71089,1,71096,71099,1,71102,71216,114,71217,71218,1,71227,71228,1,71230,71340,110,71342,71343,1,71350,71454,104,71456,71457,1,71462,71724,262,71725,71726,1,71736,71984,248,71985,71989,1,71991,71992,1,71997,72e3,3,72002,72145,143,72146,72147,1,72156,72159,1,72164,72249,85,72279,72280,1,72343,72751,408,72766,72873,107,72881,72884,3,73098,73102,1,73107,73108,1,73110,73461,351,73462,73475,13,73524,73525,1,73534,73535,1,73537,90410,16873,90411,90412,1,94033,94087,1,94192,94193,1,119141,119142,1,119149,119154,1]));static Me=new k(new Uint32Array([1160,1161,1,6846,8413,1567,8414,8416,1,8418,8420,1,42608,42610,1]));static Mn=new k(new Uint32Array([768,879,1,1155,1159,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2306,1,2362,2364,2,2369,2376,1,2381,2385,4,2386,2391,1,2402,2403,1,2433,2492,59,2497,2500,1,2509,2530,21,2531,2558,27,2561,2562,1,2620,2625,5,2626,2631,5,2632,2635,3,2636,2637,1,2641,2672,31,2673,2677,4,2689,2690,1,2748,2753,5,2754,2757,1,2759,2760,1,2765,2786,21,2787,2810,23,2811,2815,1,2817,2876,59,2879,2881,2,2882,2884,1,2893,2901,8,2902,2914,12,2915,2946,31,3008,3021,13,3072,3076,4,3132,3134,2,3135,3136,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3260,59,3263,3270,7,3276,3277,1,3298,3299,1,3328,3329,1,3387,3388,1,3393,3396,1,3405,3426,21,3427,3457,30,3530,3538,8,3539,3540,1,3542,3633,91,3636,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3953,3966,1,3968,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4141,103,4142,4144,1,4146,4151,1,4153,4154,1,4157,4158,1,4184,4185,1,4190,4192,1,4209,4212,1,4226,4229,3,4230,4237,7,4253,4957,704,4958,4959,1,5906,5908,1,5938,5939,1,5970,5971,1,6002,6003,1,6068,6069,1,6071,6077,1,6086,6089,3,6090,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6434,1,6439,6440,1,6450,6457,7,6458,6459,1,6679,6680,1,6683,6742,59,6744,6750,1,6752,6754,2,6757,6764,1,6771,6780,1,6783,6832,49,6833,6845,1,6847,6862,1,6912,6915,1,6964,6966,2,6967,6970,1,6972,6978,6,7019,7027,1,7040,7041,1,7074,7077,1,7080,7081,1,7083,7085,1,7142,7144,2,7145,7149,4,7151,7153,1,7212,7219,1,7222,7223,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8400,8412,1,8417,8421,4,8422,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12333,1,12441,12442,1,42607,42612,5,42613,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43045,26,43046,43052,6,43204,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43345,1,43392,43394,1,43443,43446,3,43447,43449,1,43452,43453,1,43493,43561,68,43562,43566,1,43569,43570,1,43573,43574,1,43587,43596,9,43644,43696,52,43698,43700,1,43703,43704,1,43710,43711,1,43713,43756,43,43757,43766,9,44005,44008,3,44013,64286,20273,65024,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69633,69688,55,69689,69702,1,69744,69747,3,69748,69759,11,69760,69761,1,69811,69814,1,69817,69818,1,69826,69888,62,69889,69890,1,69927,69931,1,69933,69940,1,70003,70016,13,70017,70070,53,70071,70078,1,70089,70092,1,70095,70191,96,70192,70193,1,70196,70198,2,70199,70206,7,70209,70367,158,70371,70378,1,70400,70401,1,70459,70460,1,70464,70502,38,70503,70508,1,70512,70516,1,70587,70592,1,70606,70610,2,70625,70626,1,70712,70719,1,70722,70724,1,70726,70750,24,70835,70840,1,70842,70847,5,70848,70850,2,70851,71090,239,71091,71093,1,71100,71101,1,71103,71104,1,71132,71133,1,71219,71226,1,71229,71231,2,71232,71339,107,71341,71344,3,71345,71349,1,71351,71453,102,71455,71458,3,71459,71461,1,71463,71467,1,71727,71735,1,71737,71738,1,71995,71996,1,71998,72003,5,72148,72151,1,72154,72155,1,72160,72193,33,72194,72202,1,72243,72248,1,72251,72254,1,72263,72273,10,72274,72278,1,72281,72283,1,72330,72342,1,72344,72345,1,72752,72758,1,72760,72765,1,72767,72850,83,72851,72871,1,72874,72880,1,72882,72883,1,72885,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73104,73,73105,73109,4,73111,73459,348,73460,73472,12,73473,73526,53,73527,73530,1,73536,73538,2,73562,78912,5350,78919,78933,1,90398,90409,1,90413,90415,1,92912,92916,1,92976,92982,1,94031,94095,64,94096,94098,1,94180,113821,19641,113822,118528,4706,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]));static foldMn=new k(new Uint32Array([921,953,32,8126,8126,1]));static N=new k(new Uint32Array([48,57,1,178,179,1,185,188,3,189,190,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2548,2553,1,2662,2671,1,2790,2799,1,2918,2927,1,2930,2935,1,3046,3058,1,3174,3183,1,3192,3198,1,3302,3311,1,3416,3422,1,3430,3448,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3891,1,4160,4169,1,4240,4249,1,4969,4988,1,5870,5872,1,6112,6121,1,6128,6137,1,6160,6169,1,6470,6479,1,6608,6618,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,8304,8308,4,8309,8313,1,8320,8329,1,8528,8578,1,8581,8585,1,9312,9371,1,9450,9471,1,10102,10131,1,11517,12295,778,12321,12329,1,12344,12346,1,12690,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,42528,42537,1,42726,42735,1,43056,43061,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,65799,65843,1,65856,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,66369,66378,9,66513,66517,1,66720,66729,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,68912,68921,1,68928,68937,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70113,70132,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71483,1,71904,71922,1,72016,72025,1,72688,72697,1,72784,72812,1,73040,73049,1,73120,73129,1,73552,73561,1,73664,73684,1,74752,74862,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93019,93025,1,93552,93561,1,93824,93846,1,118e3,118009,1,119488,119507,1,119520,119539,1,119648,119672,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125127,125135,1,125264,125273,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1,130032,130041,1]));static Nd=new k(new Uint32Array([48,57,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2662,2671,1,2790,2799,1,2918,2927,1,3046,3055,1,3174,3183,1,3302,3311,1,3430,3439,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3881,1,4160,4169,1,4240,4249,1,6112,6121,1,6160,6169,1,6470,6479,1,6608,6617,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,42528,42537,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,66720,66729,1,68912,68921,1,68928,68937,1,69734,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71481,1,71904,71913,1,72016,72025,1,72688,72697,1,72784,72793,1,73040,73049,1,73120,73129,1,73552,73561,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93552,93561,1,118e3,118009,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125264,125273,1,130032,130041,1]));static Nl=new k(new Uint32Array([5870,5872,1,8544,8578,1,8581,8584,1,12295,12321,26,12322,12329,1,12344,12346,1,42726,42735,1,65856,65908,1,66369,66378,9,66513,66517,1,74752,74862,1]));static No=new k(new Uint32Array([178,179,1,185,188,3,189,190,1,2548,2553,1,2930,2935,1,3056,3058,1,3192,3198,1,3416,3422,1,3440,3448,1,3882,3891,1,4969,4988,1,6128,6137,1,6618,8304,1686,8308,8313,1,8320,8329,1,8528,8543,1,8585,9312,727,9313,9371,1,9450,9471,1,10102,10131,1,11517,12690,1173,12691,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,43056,43061,1,65799,65843,1,65909,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69733,1,70113,70132,1,71482,71483,1,71914,71922,1,72794,72812,1,73664,73684,1,93019,93025,1,93824,93846,1,119488,119507,1,119520,119539,1,119648,119672,1,125127,125135,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1]));static P=new k(new Uint32Array([33,35,1,37,42,1,44,47,1,58,59,1,63,64,1,91,93,1,95,123,28,125,161,36,167,171,4,182,183,1,187,191,4,894,903,9,1370,1375,1,1417,1418,1,1470,1472,2,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3898,38,3899,3901,1,3973,4048,75,4049,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5120,5742,622,5787,5788,1,5867,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8208,829,8209,8231,1,8240,8259,1,8261,8273,1,8275,8286,1,8317,8318,1,8333,8334,1,8968,8971,1,9001,9002,1,10088,10101,1,10181,10182,1,10214,10223,1,10627,10648,1,10712,10715,1,10748,10749,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11822,1,11824,11855,1,11858,11869,1,12289,12291,1,12296,12305,1,12308,12319,1,12336,12349,13,12448,12539,91,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,64830,20819,64831,65040,209,65041,65049,1,65072,65106,1,65108,65121,1,65123,65128,5,65130,65131,1,65281,65283,1,65285,65290,1,65292,65295,1,65306,65307,1,65311,65312,1,65339,65341,1,65343,65371,28,65373,65375,2,65376,65381,1,65792,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,68974,69293,319,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]));static Pc=new k(new Uint32Array([95,8255,8160,8256,8276,20,65075,65076,1,65101,65103,1,65343,65343,1]));static Pd=new k(new Uint32Array([45,1418,1373,1470,5120,3650,6150,8208,2058,8209,8213,1,11799,11802,3,11834,11835,1,11840,11869,29,12316,12336,20,12448,65073,52625,65074,65112,38,65123,65293,170,68974,69293,319]));static Pe=new k(new Uint32Array([41,93,52,125,3899,3774,3901,5788,1887,8262,8318,56,8334,8969,635,8971,9002,31,10089,10101,2,10182,10215,33,10217,10223,2,10628,10648,2,10713,10715,2,10749,11811,1062,11813,11817,2,11862,11868,2,12297,12305,2,12309,12315,2,12318,12319,1,64830,65048,218,65078,65092,2,65096,65114,18,65116,65118,2,65289,65341,52,65373,65379,3]));static Pf=new k(new Uint32Array([187,8217,8030,8221,8250,29,11779,11781,2,11786,11789,3,11805,11809,4]));static Pi=new k(new Uint32Array([171,8216,8045,8219,8220,1,8223,8249,26,11778,11780,2,11785,11788,3,11804,11808,4]));static Po=new k(new Uint32Array([33,35,1,37,39,1,42,46,2,47,58,11,59,63,4,64,92,28,161,167,6,182,183,1,191,894,703,903,1370,467,1371,1375,1,1417,1472,55,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3973,113,4048,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5742,5867,125,5868,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6149,1,6151,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8214,835,8215,8224,9,8225,8231,1,8240,8248,1,8251,8254,1,8257,8259,1,8263,8273,1,8275,8277,2,8278,8286,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11782,5,11783,11784,1,11787,11790,3,11791,11798,1,11800,11801,1,11803,11806,3,11807,11818,11,11819,11822,1,11824,11833,1,11836,11839,1,11841,11843,2,11844,11855,1,11858,11860,1,12289,12291,1,12349,12539,190,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,65040,21029,65041,65046,1,65049,65072,23,65093,65094,1,65097,65100,1,65104,65106,1,65108,65111,1,65119,65121,1,65128,65130,2,65131,65281,150,65282,65283,1,65285,65287,1,65290,65294,2,65295,65306,11,65307,65311,4,65312,65340,28,65377,65380,3,65381,65792,411,65793,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]));static Ps=new k(new Uint32Array([40,91,51,123,3898,3775,3900,5787,1887,8218,8222,4,8261,8317,56,8333,8968,635,8970,9001,31,10088,10100,2,10181,10214,33,10216,10222,2,10627,10647,2,10712,10714,2,10748,11810,1062,11812,11816,2,11842,11861,19,11863,11867,2,12296,12304,2,12308,12314,2,12317,64831,52514,65047,65077,30,65079,65091,2,65095,65113,18,65115,65117,2,65288,65339,51,65371,65375,4,65378,65378,1]));static S=new k(new Uint32Array([36,43,7,60,62,1,94,96,2,124,126,2,162,166,1,168,169,1,172,174,2,175,177,1,180,184,4,215,247,32,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,1014,113,1154,1421,267,1422,1423,1,1542,1544,1,1547,1550,3,1551,1758,207,1769,1789,20,1790,2038,248,2046,2047,1,2184,2546,362,2547,2554,7,2555,2801,246,2928,3059,131,3060,3066,1,3199,3407,208,3449,3647,198,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6107,366,6464,6622,158,6623,6655,1,7009,7018,1,7028,7036,1,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,8260,8274,14,8314,8316,1,8330,8332,1,8352,8384,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8472,1,8478,8483,1,8485,8489,2,8494,8506,12,8507,8512,5,8513,8516,1,8522,8525,1,8527,8586,59,8587,8592,5,8593,8967,1,8972,9e3,1,9003,9257,1,9280,9290,1,9372,9449,1,9472,10087,1,10132,10180,1,10183,10213,1,10224,10626,1,10649,10711,1,10716,10747,1,10750,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12443,12444,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,42752,42774,1,42784,42785,1,42889,42890,1,43048,43051,1,43062,43065,1,43639,43641,1,43867,43882,15,43883,64297,20414,64434,64450,1,64832,64847,1,64975,65020,45,65021,65023,1,65122,65124,2,65125,65126,1,65129,65284,155,65291,65308,17,65309,65310,1,65342,65344,2,65372,65374,2,65504,65510,1,65512,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,69006,710,69007,71487,2480,73685,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,123647,432,126124,126128,4,126254,126704,450,126705,126976,271,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]));static Sc=new k(new Uint32Array([36,162,126,163,165,1,1423,1547,124,2046,2047,1,2546,2547,1,2555,2801,246,3065,3647,582,6107,8352,2245,8353,8384,1,43064,65020,21956,65129,65284,155,65504,65505,1,65509,65510,1,73693,73696,1,123647,126128,2481]));static Sk=new k(new Uint32Array([94,96,2,168,175,7,180,184,4,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,2184,1283,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,12443,12444,1,42752,42774,1,42784,42785,1,42889,42890,1,43867,43882,15,43883,64434,20551,64435,64450,1,65342,65344,2,65507,127995,62488,127996,127999,1]));static Sm=new k(new Uint32Array([43,60,17,61,62,1,124,126,2,172,177,5,215,247,32,1014,1542,528,1543,1544,1,8260,8274,14,8314,8316,1,8330,8332,1,8472,8512,40,8513,8516,1,8523,8592,69,8593,8596,1,8602,8603,1,8608,8614,3,8622,8654,32,8655,8658,3,8660,8692,32,8693,8959,1,8992,8993,1,9084,9115,31,9116,9139,1,9180,9185,1,9655,9665,10,9720,9727,1,9839,10176,337,10177,10180,1,10183,10213,1,10224,10239,1,10496,10626,1,10649,10711,1,10716,10747,1,10750,11007,1,11056,11076,1,11079,11084,1,64297,65122,825,65124,65126,1,65291,65308,17,65309,65310,1,65372,65374,2,65506,65513,7,65514,65516,1,69006,69007,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,126704,126705,1]));static So=new k(new Uint32Array([166,169,3,174,176,2,1154,1421,267,1422,1550,128,1551,1758,207,1769,1789,20,1790,2038,248,2554,2928,374,3059,3064,1,3066,3199,133,3407,3449,42,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6464,723,6622,6655,1,7009,7018,1,7028,7036,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8478,7,8479,8483,1,8485,8489,2,8494,8506,12,8507,8522,15,8524,8525,1,8527,8586,59,8587,8597,10,8598,8601,1,8604,8607,1,8609,8610,1,8612,8613,1,8615,8621,1,8623,8653,1,8656,8657,1,8659,8661,2,8662,8691,1,8960,8967,1,8972,8991,1,8994,9e3,1,9003,9083,1,9085,9114,1,9140,9179,1,9186,9257,1,9280,9290,1,9372,9449,1,9472,9654,1,9656,9664,1,9666,9719,1,9728,9838,1,9840,10087,1,10132,10175,1,10240,10495,1,11008,11055,1,11077,11078,1,11085,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,43048,43051,1,43062,43063,1,43065,43639,574,43640,43641,1,64832,64847,1,64975,65021,46,65022,65023,1,65508,65512,4,65517,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,71487,3191,73685,73692,1,73697,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,126124,2909,126254,126976,722,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,127994,1,128e3,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]));static Z=new k(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8232,8233,1,8239,8287,48,12288,12288,1]));static Zl=new k(new Uint32Array([8232,8232,1]));static Zp=new k(new Uint32Array([8233,8233,1]));static Zs=new k(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8239,8287,48,12288,12288,1]));static Adlam=new k(new Uint32Array([125184,125259,1,125264,125273,1,125278,125279,1]));static Ahom=new k(new Uint32Array([71424,71450,1,71453,71467,1,71472,71494,1]));static Anatolian_Hieroglyphs=new k(new Uint32Array([82944,83526,1]));static Arabic=new k(new Uint32Array([1536,1540,1,1542,1547,1,1549,1562,1,1564,1566,1,1568,1599,1,1601,1610,1,1622,1647,1,1649,1756,1,1758,1791,1,1872,1919,1,2160,2190,1,2192,2193,1,2199,2273,1,2275,2303,1,64336,64450,1,64467,64829,1,64832,64911,1,64914,64967,1,64975,65008,33,65009,65023,1,65136,65140,1,65142,65276,1,69216,69246,1,69314,69316,1,69372,69375,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1]));static Armenian=new k(new Uint32Array([1329,1366,1,1369,1418,1,1421,1423,1,64275,64279,1]));static Avestan=new k(new Uint32Array([68352,68405,1,68409,68415,1]));static Balinese=new k(new Uint32Array([6912,6988,1,6990,7039,1]));static Bamum=new k(new Uint32Array([42656,42743,1,92160,92728,1]));static Bassa_Vah=new k(new Uint32Array([92880,92909,1,92912,92917,1]));static Batak=new k(new Uint32Array([7104,7155,1,7164,7167,1]));static Bengali=new k(new Uint32Array([2432,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1]));static Bhaiksuki=new k(new Uint32Array([72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1]));static Bopomofo=new k(new Uint32Array([746,747,1,12549,12591,1,12704,12735,1]));static Brahmi=new k(new Uint32Array([69632,69709,1,69714,69749,1,69759,69759,1]));static Braille=new k(new Uint32Array([10240,10495,1]));static Buginese=new k(new Uint32Array([6656,6683,1,6686,6687,1]));static Buhid=new k(new Uint32Array([5952,5971,1]));static Canadian_Aboriginal=new k(new Uint32Array([5120,5759,1,6320,6389,1,72368,72383,1]));static Carian=new k(new Uint32Array([66208,66256,1]));static Caucasian_Albanian=new k(new Uint32Array([66864,66915,1,66927,66927,1]));static Chakma=new k(new Uint32Array([69888,69940,1,69942,69959,1]));static Cham=new k(new Uint32Array([43520,43574,1,43584,43597,1,43600,43609,1,43612,43615,1]));static Cherokee=new k(new Uint32Array([5024,5109,1,5112,5117,1,43888,43967,1]));static Chorasmian=new k(new Uint32Array([69552,69579,1]));static Common=new k(new Uint32Array([0,64,1,91,96,1,123,169,1,171,185,1,187,191,1,215,247,32,697,735,1,741,745,1,748,767,1,884,894,10,901,903,2,1541,1548,7,1563,1567,4,1600,1757,157,2274,2404,130,2405,3647,1242,4053,4056,1,4347,5867,1520,5868,5869,1,5941,5942,1,6146,6147,1,6149,7379,1230,7393,7401,8,7402,7404,1,7406,7411,1,7413,7415,1,7418,8192,774,8193,8203,1,8206,8292,1,8294,8304,1,8308,8318,1,8320,8334,1,8352,8384,1,8448,8485,1,8487,8489,1,8492,8497,1,8499,8525,1,8527,8543,1,8585,8587,1,8592,9257,1,9280,9290,1,9312,10239,1,10496,11123,1,11126,11157,1,11159,11263,1,11776,11869,1,12272,12292,1,12294,12296,2,12297,12320,1,12336,12343,1,12348,12351,1,12443,12444,1,12448,12539,91,12540,12688,148,12689,12703,1,12736,12773,1,12783,12832,49,12833,12895,1,12927,13007,1,13055,13144,89,13145,13311,1,19904,19967,1,42752,42785,1,42888,42890,1,43056,43065,1,43310,43471,161,43867,43882,15,43883,64830,20947,64831,65040,209,65041,65049,1,65072,65106,1,65108,65126,1,65128,65131,1,65279,65281,2,65282,65312,1,65339,65344,1,65371,65381,1,65392,65438,46,65439,65504,65,65505,65510,1,65512,65518,1,65529,65533,1,65792,65794,1,65799,65843,1,65847,65855,1,65936,65948,1,66e3,66044,1,66273,66299,1,113824,113827,1,117760,118009,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119142,1,119146,119162,1,119171,119172,1,119180,119209,1,119214,119274,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,120831,1,126065,126132,1,126209,126269,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127487,1,127489,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,917505,917536,31,917537,917631,1]));static foldCommon=new k(new Uint32Array([924,956,32]));static Coptic=new k(new Uint32Array([994,1007,1,11392,11507,1,11513,11519,1]));static Cuneiform=new k(new Uint32Array([73728,74649,1,74752,74862,1,74864,74868,1,74880,75075,1]));static Cypriot=new k(new Uint32Array([67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3]));static Cypro_Minoan=new k(new Uint32Array([77712,77810,1]));static Cyrillic=new k(new Uint32Array([1024,1156,1,1159,1327,1,7296,7306,1,7467,7544,77,11744,11775,1,42560,42655,1,65070,65071,1,122928,122989,1,123023,123023,1]));static Deseret=new k(new Uint32Array([66560,66639,1]));static Devanagari=new k(new Uint32Array([2304,2384,1,2389,2403,1,2406,2431,1,43232,43263,1,72448,72457,1]));static Dives_Akuru=new k(new Uint32Array([71936,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1]));static Dogra=new k(new Uint32Array([71680,71739,1]));static Duployan=new k(new Uint32Array([113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1]));static Egyptian_Hieroglyphs=new k(new Uint32Array([77824,78933,1,78944,82938,1]));static Elbasan=new k(new Uint32Array([66816,66855,1]));static Elymaic=new k(new Uint32Array([69600,69622,1]));static Ethiopic=new k(new Uint32Array([4608,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,124896,124902,1,124904,124907,1,124909,124910,1,124912,124926,1]));static Garay=new k(new Uint32Array([68928,68965,1,68969,68997,1,69006,69007,1]));static Georgian=new k(new Uint32Array([4256,4293,1,4295,4301,6,4304,4346,1,4348,4351,1,7312,7354,1,7357,7359,1,11520,11557,1,11559,11565,6]));static Glagolitic=new k(new Uint32Array([11264,11359,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1]));static Gothic=new k(new Uint32Array([66352,66378,1]));static Grantha=new k(new Uint32Array([70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70460,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1]));static Greek=new k(new Uint32Array([880,883,1,885,887,1,890,893,1,895,900,5,902,904,2,905,906,1,908,910,2,911,929,1,931,993,1,1008,1023,1,7462,7466,1,7517,7521,1,7526,7530,1,7615,7936,321,7937,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8486,43877,35391,65856,65934,1,65952,119296,53344,119297,119365,1]));static foldGreek=new k(new Uint32Array([181,837,656]));static Gujarati=new k(new Uint32Array([2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1]));static Gunjala_Gondi=new k(new Uint32Array([73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1]));static Gurmukhi=new k(new Uint32Array([2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1]));static Gurung_Khema=new k(new Uint32Array([90368,90425,1]));static Han=new k(new Uint32Array([11904,11929,1,11931,12019,1,12032,12245,1,12293,12295,2,12321,12329,1,12344,12347,1,13312,19903,1,19968,40959,1,63744,64109,1,64112,64217,1,94178,94179,1,94192,94193,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static Hangul=new k(new Uint32Array([4352,4607,1,12334,12335,1,12593,12686,1,12800,12830,1,12896,12926,1,43360,43388,1,44032,55203,1,55216,55238,1,55243,55291,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1]));static Hanifi_Rohingya=new k(new Uint32Array([68864,68903,1,68912,68921,1]));static Hanunoo=new k(new Uint32Array([5920,5940,1]));static Hatran=new k(new Uint32Array([67808,67826,1,67828,67829,1,67835,67839,1]));static Hebrew=new k(new Uint32Array([1425,1479,1,1488,1514,1,1519,1524,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64335,1]));static Hiragana=new k(new Uint32Array([12353,12438,1,12445,12447,1,110593,110879,1,110898,110928,30,110929,110930,1,127488,127488,1]));static Imperial_Aramaic=new k(new Uint32Array([67648,67669,1,67671,67679,1]));static Inherited=new k(new Uint32Array([768,879,1,1157,1158,1,1611,1621,1,1648,2385,737,2386,2388,1,6832,6862,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8204,8205,1,8400,8432,1,12330,12333,1,12441,12442,1,65024,65039,1,65056,65069,1,66045,66272,227,70459,118528,48069,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,917760,917999,1]));static foldInherited=new k(new Uint32Array([921,953,32,8126,8126,1]));static Inscriptional_Pahlavi=new k(new Uint32Array([68448,68466,1,68472,68479,1]));static Inscriptional_Parthian=new k(new Uint32Array([68416,68437,1,68440,68447,1]));static Javanese=new k(new Uint32Array([43392,43469,1,43472,43481,1,43486,43487,1]));static Kaithi=new k(new Uint32Array([69760,69826,1,69837,69837,1]));static Kannada=new k(new Uint32Array([3200,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1]));static Katakana=new k(new Uint32Array([12449,12538,1,12541,12543,1,12784,12799,1,13008,13054,1,13056,13143,1,65382,65391,1,65393,65437,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110880,288,110881,110882,1,110933,110948,15,110949,110951,1]));static Kawi=new k(new Uint32Array([73472,73488,1,73490,73530,1,73534,73562,1]));static Kayah_Li=new k(new Uint32Array([43264,43309,1,43311,43311,1]));static Kharoshthi=new k(new Uint32Array([68096,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1]));static Khitan_Small_Script=new k(new Uint32Array([94180,101120,6940,101121,101589,1,101631,101631,1]));static Khmer=new k(new Uint32Array([6016,6109,1,6112,6121,1,6128,6137,1,6624,6655,1]));static Khojki=new k(new Uint32Array([70144,70161,1,70163,70209,1]));static Khudawadi=new k(new Uint32Array([70320,70378,1,70384,70393,1]));static Kirat_Rai=new k(new Uint32Array([93504,93561,1]));static Lao=new k(new Uint32Array([3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1]));static Latin=new k(new Uint32Array([65,90,1,97,122,1,170,186,16,192,214,1,216,246,1,248,696,1,736,740,1,7424,7461,1,7468,7516,1,7522,7525,1,7531,7543,1,7545,7614,1,7680,7935,1,8305,8319,14,8336,8348,1,8490,8491,1,8498,8526,28,8544,8584,1,11360,11391,1,42786,42887,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43007,1,43824,43866,1,43868,43876,1,43878,43881,1,64256,64262,1,65313,65338,1,65345,65370,1,67456,67461,1,67463,67504,1,67506,67514,1,122624,122654,1,122661,122666,1]));static Lepcha=new k(new Uint32Array([7168,7223,1,7227,7241,1,7245,7247,1]));static Limbu=new k(new Uint32Array([6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6479,1]));static Linear_A=new k(new Uint32Array([67072,67382,1,67392,67413,1,67424,67431,1]));static Linear_B=new k(new Uint32Array([65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1]));static Lisu=new k(new Uint32Array([42192,42239,1,73648,73648,1]));static Lycian=new k(new Uint32Array([66176,66204,1]));static Lydian=new k(new Uint32Array([67872,67897,1,67903,67903,1]));static Mahajani=new k(new Uint32Array([69968,70006,1]));static Makasar=new k(new Uint32Array([73440,73464,1]));static Malayalam=new k(new Uint32Array([3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1]));static Mandaic=new k(new Uint32Array([2112,2139,1,2142,2142,1]));static Manichaean=new k(new Uint32Array([68288,68326,1,68331,68342,1]));static Marchen=new k(new Uint32Array([72816,72847,1,72850,72871,1,72873,72886,1]));static Masaram_Gondi=new k(new Uint32Array([72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1]));static Medefaidrin=new k(new Uint32Array([93760,93850,1]));static Meetei_Mayek=new k(new Uint32Array([43744,43766,1,43968,44013,1,44016,44025,1]));static Mende_Kikakui=new k(new Uint32Array([124928,125124,1,125127,125142,1]));static Meroitic_Cursive=new k(new Uint32Array([68e3,68023,1,68028,68047,1,68050,68095,1]));static Meroitic_Hieroglyphs=new k(new Uint32Array([67968,67999,1]));static Miao=new k(new Uint32Array([93952,94026,1,94031,94087,1,94095,94111,1]));static Modi=new k(new Uint32Array([71168,71236,1,71248,71257,1]));static Mongolian=new k(new Uint32Array([6144,6145,1,6148,6150,2,6151,6169,1,6176,6264,1,6272,6314,1,71264,71276,1]));static Mro=new k(new Uint32Array([92736,92766,1,92768,92777,1,92782,92783,1]));static Multani=new k(new Uint32Array([70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1]));static Myanmar=new k(new Uint32Array([4096,4255,1,43488,43518,1,43616,43647,1,71376,71395,1]));static Nabataean=new k(new Uint32Array([67712,67742,1,67751,67759,1]));static Nag_Mundari=new k(new Uint32Array([124112,124153,1]));static Nandinagari=new k(new Uint32Array([72096,72103,1,72106,72151,1,72154,72164,1]));static New_Tai_Lue=new k(new Uint32Array([6528,6571,1,6576,6601,1,6608,6618,1,6622,6623,1]));static Newa=new k(new Uint32Array([70656,70747,1,70749,70753,1]));static Nko=new k(new Uint32Array([1984,2042,1,2045,2047,1]));static Nushu=new k(new Uint32Array([94177,110960,16783,110961,111355,1]));static Nyiakeng_Puachue_Hmong=new k(new Uint32Array([123136,123180,1,123184,123197,1,123200,123209,1,123214,123215,1]));static Ogham=new k(new Uint32Array([5760,5788,1]));static Ol_Chiki=new k(new Uint32Array([7248,7295,1]));static Ol_Onal=new k(new Uint32Array([124368,124410,1,124415,124415,1]));static Old_Hungarian=new k(new Uint32Array([68736,68786,1,68800,68850,1,68858,68863,1]));static Old_Italic=new k(new Uint32Array([66304,66339,1,66349,66351,1]));static Old_North_Arabian=new k(new Uint32Array([68224,68255,1]));static Old_Permic=new k(new Uint32Array([66384,66426,1]));static Old_Persian=new k(new Uint32Array([66464,66499,1,66504,66517,1]));static Old_Sogdian=new k(new Uint32Array([69376,69415,1]));static Old_South_Arabian=new k(new Uint32Array([68192,68223,1]));static Old_Turkic=new k(new Uint32Array([68608,68680,1]));static Old_Uyghur=new k(new Uint32Array([69488,69513,1]));static Oriya=new k(new Uint32Array([2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1]));static Osage=new k(new Uint32Array([66736,66771,1,66776,66811,1]));static Osmanya=new k(new Uint32Array([66688,66717,1,66720,66729,1]));static Pahawh_Hmong=new k(new Uint32Array([92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1]));static Palmyrene=new k(new Uint32Array([67680,67711,1]));static Pau_Cin_Hau=new k(new Uint32Array([72384,72440,1]));static Phags_Pa=new k(new Uint32Array([43072,43127,1]));static Phoenician=new k(new Uint32Array([67840,67867,1,67871,67871,1]));static Psalter_Pahlavi=new k(new Uint32Array([68480,68497,1,68505,68508,1,68521,68527,1]));static Rejang=new k(new Uint32Array([43312,43347,1,43359,43359,1]));static Runic=new k(new Uint32Array([5792,5866,1,5870,5880,1]));static Samaritan=new k(new Uint32Array([2048,2093,1,2096,2110,1]));static Saurashtra=new k(new Uint32Array([43136,43205,1,43214,43225,1]));static Sharada=new k(new Uint32Array([70016,70111,1]));static Shavian=new k(new Uint32Array([66640,66687,1]));static Siddham=new k(new Uint32Array([71040,71093,1,71096,71133,1]));static SignWriting=new k(new Uint32Array([120832,121483,1,121499,121503,1,121505,121519,1]));static Sinhala=new k(new Uint32Array([3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,70113,70132,1]));static Sogdian=new k(new Uint32Array([69424,69465,1]));static Sora_Sompeng=new k(new Uint32Array([69840,69864,1,69872,69881,1]));static Soyombo=new k(new Uint32Array([72272,72354,1]));static Sundanese=new k(new Uint32Array([7040,7103,1,7360,7367,1]));static Sunuwar=new k(new Uint32Array([72640,72673,1,72688,72697,1]));static Syloti_Nagri=new k(new Uint32Array([43008,43052,1]));static Syriac=new k(new Uint32Array([1792,1805,1,1807,1866,1,1869,1871,1,2144,2154,1]));static Tagalog=new k(new Uint32Array([5888,5909,1,5919,5919,1]));static Tagbanwa=new k(new Uint32Array([5984,5996,1,5998,6e3,1,6002,6003,1]));static Tai_Le=new k(new Uint32Array([6480,6509,1,6512,6516,1]));static Tai_Tham=new k(new Uint32Array([6688,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1]));static Tai_Viet=new k(new Uint32Array([43648,43714,1,43739,43743,1]));static Takri=new k(new Uint32Array([71296,71353,1,71360,71369,1]));static Tamil=new k(new Uint32Array([2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,73664,73713,1,73727,73727,1]));static Tangsa=new k(new Uint32Array([92784,92862,1,92864,92873,1]));static Tangut=new k(new Uint32Array([94176,94208,32,94209,100343,1,100352,101119,1,101632,101640,1]));static Telugu=new k(new Uint32Array([3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3199,1]));static Thaana=new k(new Uint32Array([1920,1969,1]));static Thai=new k(new Uint32Array([3585,3642,1,3648,3675,1]));static Tibetan=new k(new Uint32Array([3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4052,1,4057,4058,1]));static Tifinagh=new k(new Uint32Array([11568,11623,1,11631,11632,1,11647,11647,1]));static Tirhuta=new k(new Uint32Array([70784,70855,1,70864,70873,1]));static Todhri=new k(new Uint32Array([67008,67059,1]));static Toto=new k(new Uint32Array([123536,123566,1]));static Tulu_Tigalari=new k(new Uint32Array([70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1]));static Ugaritic=new k(new Uint32Array([66432,66461,1,66463,66463,1]));static Vai=new k(new Uint32Array([42240,42539,1]));static Vithkuqi=new k(new Uint32Array([66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1]));static Wancho=new k(new Uint32Array([123584,123641,1,123647,123647,1]));static Warang_Citi=new k(new Uint32Array([71840,71922,1,71935,71935,1]));static Yezidi=new k(new Uint32Array([69248,69289,1,69291,69293,1,69296,69297,1]));static Yi=new k(new Uint32Array([40960,42124,1,42128,42182,1]));static Zanabazar_Square=new k(new Uint32Array([72192,72263,1]));static CATEGORIES=new Map([["C",e.C],["Cc",e.Cc],["Cf",e.Cf],["Co",e.Co],["Cs",e.Cs],["L",e.L],["Ll",e.Ll],["Lm",e.Lm],["Lo",e.Lo],["Lt",e.Lt],["Lu",e.Lu],["M",e.M],["Mc",e.Mc],["Me",e.Me],["Mn",e.Mn],["N",e.N],["Nd",e.Nd],["Nl",e.Nl],["No",e.No],["P",e.P],["Pc",e.Pc],["Pd",e.Pd],["Pe",e.Pe],["Pf",e.Pf],["Pi",e.Pi],["Po",e.Po],["Ps",e.Ps],["S",e.S],["Sc",e.Sc],["Sk",e.Sk],["Sm",e.Sm],["So",e.So],["Z",e.Z],["Zl",e.Zl],["Zp",e.Zp],["Zs",e.Zs]]);static SCRIPTS=new Map([["Adlam",e.Adlam],["Ahom",e.Ahom],["Anatolian_Hieroglyphs",e.Anatolian_Hieroglyphs],["Arabic",e.Arabic],["Armenian",e.Armenian],["Avestan",e.Avestan],["Balinese",e.Balinese],["Bamum",e.Bamum],["Bassa_Vah",e.Bassa_Vah],["Batak",e.Batak],["Bengali",e.Bengali],["Bhaiksuki",e.Bhaiksuki],["Bopomofo",e.Bopomofo],["Brahmi",e.Brahmi],["Braille",e.Braille],["Buginese",e.Buginese],["Buhid",e.Buhid],["Canadian_Aboriginal",e.Canadian_Aboriginal],["Carian",e.Carian],["Caucasian_Albanian",e.Caucasian_Albanian],["Chakma",e.Chakma],["Cham",e.Cham],["Cherokee",e.Cherokee],["Chorasmian",e.Chorasmian],["Common",e.Common],["Coptic",e.Coptic],["Cuneiform",e.Cuneiform],["Cypriot",e.Cypriot],["Cypro_Minoan",e.Cypro_Minoan],["Cyrillic",e.Cyrillic],["Deseret",e.Deseret],["Devanagari",e.Devanagari],["Dives_Akuru",e.Dives_Akuru],["Dogra",e.Dogra],["Duployan",e.Duployan],["Egyptian_Hieroglyphs",e.Egyptian_Hieroglyphs],["Elbasan",e.Elbasan],["Elymaic",e.Elymaic],["Ethiopic",e.Ethiopic],["Garay",e.Garay],["Georgian",e.Georgian],["Glagolitic",e.Glagolitic],["Gothic",e.Gothic],["Grantha",e.Grantha],["Greek",e.Greek],["Gujarati",e.Gujarati],["Gunjala_Gondi",e.Gunjala_Gondi],["Gurmukhi",e.Gurmukhi],["Gurung_Khema",e.Gurung_Khema],["Han",e.Han],["Hangul",e.Hangul],["Hanifi_Rohingya",e.Hanifi_Rohingya],["Hanunoo",e.Hanunoo],["Hatran",e.Hatran],["Hebrew",e.Hebrew],["Hiragana",e.Hiragana],["Imperial_Aramaic",e.Imperial_Aramaic],["Inherited",e.Inherited],["Inscriptional_Pahlavi",e.Inscriptional_Pahlavi],["Inscriptional_Parthian",e.Inscriptional_Parthian],["Javanese",e.Javanese],["Kaithi",e.Kaithi],["Kannada",e.Kannada],["Katakana",e.Katakana],["Kawi",e.Kawi],["Kayah_Li",e.Kayah_Li],["Kharoshthi",e.Kharoshthi],["Khitan_Small_Script",e.Khitan_Small_Script],["Khmer",e.Khmer],["Khojki",e.Khojki],["Khudawadi",e.Khudawadi],["Kirat_Rai",e.Kirat_Rai],["Lao",e.Lao],["Latin",e.Latin],["Lepcha",e.Lepcha],["Limbu",e.Limbu],["Linear_A",e.Linear_A],["Linear_B",e.Linear_B],["Lisu",e.Lisu],["Lycian",e.Lycian],["Lydian",e.Lydian],["Mahajani",e.Mahajani],["Makasar",e.Makasar],["Malayalam",e.Malayalam],["Mandaic",e.Mandaic],["Manichaean",e.Manichaean],["Marchen",e.Marchen],["Masaram_Gondi",e.Masaram_Gondi],["Medefaidrin",e.Medefaidrin],["Meetei_Mayek",e.Meetei_Mayek],["Mende_Kikakui",e.Mende_Kikakui],["Meroitic_Cursive",e.Meroitic_Cursive],["Meroitic_Hieroglyphs",e.Meroitic_Hieroglyphs],["Miao",e.Miao],["Modi",e.Modi],["Mongolian",e.Mongolian],["Mro",e.Mro],["Multani",e.Multani],["Myanmar",e.Myanmar],["Nabataean",e.Nabataean],["Nag_Mundari",e.Nag_Mundari],["Nandinagari",e.Nandinagari],["New_Tai_Lue",e.New_Tai_Lue],["Newa",e.Newa],["Nko",e.Nko],["Nushu",e.Nushu],["Nyiakeng_Puachue_Hmong",e.Nyiakeng_Puachue_Hmong],["Ogham",e.Ogham],["Ol_Chiki",e.Ol_Chiki],["Ol_Onal",e.Ol_Onal],["Old_Hungarian",e.Old_Hungarian],["Old_Italic",e.Old_Italic],["Old_North_Arabian",e.Old_North_Arabian],["Old_Permic",e.Old_Permic],["Old_Persian",e.Old_Persian],["Old_Sogdian",e.Old_Sogdian],["Old_South_Arabian",e.Old_South_Arabian],["Old_Turkic",e.Old_Turkic],["Old_Uyghur",e.Old_Uyghur],["Oriya",e.Oriya],["Osage",e.Osage],["Osmanya",e.Osmanya],["Pahawh_Hmong",e.Pahawh_Hmong],["Palmyrene",e.Palmyrene],["Pau_Cin_Hau",e.Pau_Cin_Hau],["Phags_Pa",e.Phags_Pa],["Phoenician",e.Phoenician],["Psalter_Pahlavi",e.Psalter_Pahlavi],["Rejang",e.Rejang],["Runic",e.Runic],["Samaritan",e.Samaritan],["Saurashtra",e.Saurashtra],["Sharada",e.Sharada],["Shavian",e.Shavian],["Siddham",e.Siddham],["SignWriting",e.SignWriting],["Sinhala",e.Sinhala],["Sogdian",e.Sogdian],["Sora_Sompeng",e.Sora_Sompeng],["Soyombo",e.Soyombo],["Sundanese",e.Sundanese],["Sunuwar",e.Sunuwar],["Syloti_Nagri",e.Syloti_Nagri],["Syriac",e.Syriac],["Tagalog",e.Tagalog],["Tagbanwa",e.Tagbanwa],["Tai_Le",e.Tai_Le],["Tai_Tham",e.Tai_Tham],["Tai_Viet",e.Tai_Viet],["Takri",e.Takri],["Tamil",e.Tamil],["Tangsa",e.Tangsa],["Tangut",e.Tangut],["Telugu",e.Telugu],["Thaana",e.Thaana],["Thai",e.Thai],["Tibetan",e.Tibetan],["Tifinagh",e.Tifinagh],["Tirhuta",e.Tirhuta],["Todhri",e.Todhri],["Toto",e.Toto],["Tulu_Tigalari",e.Tulu_Tigalari],["Ugaritic",e.Ugaritic],["Vai",e.Vai],["Vithkuqi",e.Vithkuqi],["Wancho",e.Wancho],["Warang_Citi",e.Warang_Citi],["Yezidi",e.Yezidi],["Yi",e.Yi],["Zanabazar_Square",e.Zanabazar_Square]]);static FOLD_CATEGORIES=new Map([["L",e.foldL],["Ll",e.foldLl],["Lt",e.foldLt],["Lu",e.foldLu],["M",e.foldM],["Mn",e.foldMn]]);static FOLD_SCRIPT=new Map([["Common",e.foldCommon],["Greek",e.foldGreek],["Inherited",e.foldInherited]]);static Print=new k(new Uint32Array([33,126,1,161,172,1,174,887,1,890,895,1,900,906,1,908,910,2,911,929,1,931,1327,1,1329,1366,1,1369,1418,1,1421,1423,1,1425,1479,1,1488,1514,1,1519,1524,1,1542,1563,1,1565,1756,1,1758,1805,1,1808,1866,1,1869,1969,1,1984,2042,1,2045,2093,1,2096,2110,1,2112,2139,1,2142,2144,2,2145,2154,1,2160,2190,1,2199,2273,1,2275,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1,2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1,2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1,2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1,2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1,3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1,3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,3585,3642,1,3647,3675,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1,3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4058,1,4096,4293,1,4295,4301,6,4304,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,5024,5109,1,5112,5117,1,5120,5759,1,5761,5788,1,5792,5880,1,5888,5909,1,5919,5942,1,5952,5971,1,5984,5996,1,5998,6e3,1,6002,6003,1,6016,6109,1,6112,6121,1,6128,6137,1,6144,6157,1,6159,6169,1,6176,6264,1,6272,6314,1,6320,6389,1,6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6608,6618,1,6622,6683,1,6686,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1,6832,6862,1,6912,6988,1,6990,7155,1,7164,7223,1,7227,7241,1,7245,7306,1,7312,7354,1,7357,7367,1,7376,7418,1,7424,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8208,8231,1,8240,8286,1,8304,8305,1,8308,8334,1,8336,8348,1,8352,8384,1,8400,8432,1,8448,8587,1,8592,9257,1,9280,9290,1,9312,11123,1,11126,11157,1,11159,11507,1,11513,11557,1,11559,11565,6,11568,11623,1,11631,11632,1,11647,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11744,11869,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12289,12351,1,12353,12438,1,12441,12543,1,12549,12591,1,12593,12686,1,12688,12773,1,12783,12830,1,12832,42124,1,42128,42182,1,42192,42539,1,42560,42743,1,42752,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43052,1,43056,43065,1,43072,43127,1,43136,43205,1,43214,43225,1,43232,43347,1,43359,43388,1,43392,43469,1,43471,43481,1,43486,43518,1,43520,43574,1,43584,43597,1,43600,43609,1,43612,43714,1,43739,43766,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43883,1,43888,44013,1,44016,44025,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64450,1,64467,64911,1,64914,64967,1,64975,65008,33,65009,65049,1,65056,65106,1,65108,65126,1,65128,65131,1,65136,65140,1,65142,65276,1,65281,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65504,65510,1,65512,65518,1,65532,65533,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,65792,65794,1,65799,65843,1,65847,65934,1,65936,65948,1,65952,66e3,48,66001,66045,1,66176,66204,1,66208,66256,1,66272,66299,1,66304,66339,1,66349,66378,1,66384,66426,1,66432,66461,1,66463,66499,1,66504,66517,1,66560,66717,1,66720,66729,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66927,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67671,67742,1,67751,67759,1,67808,67826,1,67828,67829,1,67835,67867,1,67871,67897,1,67903,67968,65,67969,68023,1,68028,68047,1,68050,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1,68192,68255,1,68288,68326,1,68331,68342,1,68352,68405,1,68409,68437,1,68440,68466,1,68472,68497,1,68505,68508,1,68521,68527,1,68608,68680,1,68736,68786,1,68800,68850,1,68858,68903,1,68912,68921,1,68928,68965,1,68969,68997,1,69006,69007,1,69216,69246,1,69248,69289,1,69291,69293,1,69296,69297,1,69314,69316,1,69372,69415,1,69424,69465,1,69488,69513,1,69552,69579,1,69600,69622,1,69632,69709,1,69714,69749,1,69759,69820,1,69822,69826,1,69840,69864,1,69872,69881,1,69888,69940,1,69942,69959,1,69968,70006,1,70016,70111,1,70113,70132,1,70144,70161,1,70163,70209,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1,70320,70378,1,70384,70393,1,70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70459,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1,70656,70747,1,70749,70753,1,70784,70855,1,70864,70873,1,71040,71093,1,71096,71133,1,71168,71236,1,71248,71257,1,71264,71276,1,71296,71353,1,71360,71369,1,71376,71395,1,71424,71450,1,71453,71467,1,71472,71494,1,71680,71739,1,71840,71922,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1,72096,72103,1,72106,72151,1,72154,72164,1,72192,72263,1,72272,72354,1,72368,72440,1,72448,72457,1,72640,72673,1,72688,72697,1,72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1,72816,72847,1,72850,72871,1,72873,72886,1,72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1,73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1,73440,73464,1,73472,73488,1,73490,73530,1,73534,73562,1,73648,73664,16,73665,73713,1,73727,74649,1,74752,74862,1,74864,74868,1,74880,75075,1,77712,77810,1,77824,78895,1,78912,78933,1,78944,82938,1,82944,83526,1,90368,90425,1,92160,92728,1,92736,92766,1,92768,92777,1,92782,92862,1,92864,92873,1,92880,92909,1,92912,92917,1,92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1,93504,93561,1,93760,93850,1,93952,94026,1,94031,94087,1,94095,94111,1,94176,94180,1,94192,94193,1,94208,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1,117760,118009,1,118016,118451,1,118528,118573,1,118576,118598,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119154,1,119163,119274,1,119296,119365,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,121483,1,121499,121503,1,121505,121519,1,122624,122654,1,122661,122666,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,122928,122989,1,123023,123136,113,123137,123180,1,123184,123197,1,123200,123209,1,123214,123215,1,123536,123566,1,123584,123641,1,123647,124112,465,124113,124153,1,124368,124410,1,124415,124896,481,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125127,125142,1,125184,125259,1,125264,125273,1,125278,125279,1,126065,126132,1,126209,126269,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1,917760,917999,1]))},ae=class{static MAX_RUNE=1114111;static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static is32(t,n){let r=0,s=t.length;for(;r<s;){let i=r+Math.floor((s-r)/2),o=t.getLo(i),a=t.getHi(i);if(o<=n&&n<=a){let l=t.getStride(i);return(n-o)%l===0}n<o?s=i:r=i+1}return!1}static is(t,n){if(n<=this.MAX_LATIN1){for(let r=0;r<t.length;r++){let s=t.getHi(r);if(n>s)continue;let i=t.getLo(r);if(n<i)return!1;let o=t.getStride(r);return(n-i)%o===0}return!1}return t.length>0&&n>=t.getLo(0)&&this.is32(t,n)}static isUpper(t){if(t<=this.MAX_LATIN1){let n=String.fromCodePoint(t);return n.toUpperCase()===n&&n.toLowerCase()!==n}return this.is(ln.Upper,t)}static isPrint(t){return t<=this.MAX_LATIN1?t>=32&&t<this.MAX_ASCII||t>=161&&t!==173:this.is(ln.Print,t)}static simpleFold(t){if(ln.CASE_ORBIT.has(t))return ln.CASE_ORBIT.get(t);let n=D.toLowerCase(t);return n!==t?n:D.toUpperCase(t)}static equalsIgnoreCase(t,n){if(t<0||n<0||t===n)return!0;if(t<=this.MAX_ASCII&&n<=this.MAX_ASCII)return D.CODES.get("A")<=t&&t<=D.CODES.get("Z")&&(t|=32),D.CODES.get("A")<=n&&n<=D.CODES.get("Z")&&(n|=32),t===n;for(let r=this.simpleFold(t);r!==t;r=this.simpleFold(r))if(r===n)return!0;return!1}},Ie=class{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isalnum(t){return D.CODES.get("0")<=t&&t<=D.CODES.get("9")||D.CODES.get("a")<=t&&t<=D.CODES.get("z")||D.CODES.get("A")<=t&&t<=D.CODES.get("Z")}static unhex(t){return D.CODES.get("0")<=t&&t<=D.CODES.get("9")?t-D.CODES.get("0"):D.CODES.get("a")<=t&&t<=D.CODES.get("f")?t-D.CODES.get("a")+10:D.CODES.get("A")<=t&&t<=D.CODES.get("F")?t-D.CODES.get("A")+10:-1}static escapeRune(t){let n="";if(ae.isPrint(t))this.METACHARACTERS.indexOf(String.fromCodePoint(t))>=0&&(n+="\\"),n+=String.fromCodePoint(t);else switch(t){case D.CODES.get('"'):n+='\\"';break;case D.CODES.get("\\"):n+="\\\\";break;case D.CODES.get(" "):n+="\\t";break;case D.CODES.get(`
|
|
164
|
+
`):n+="\\n";break;case D.CODES.get("\r"):n+="\\r";break;case D.CODES.get("\b"):n+="\\b";break;case D.CODES.get("\f"):n+="\\f";break;default:{let r=t.toString(16);t<256?(n+="\\x",r.length===1&&(n+="0"),n+=r):n+=`\\x{${r}}`;break}}return n}static stringToRunes(t){return String(t).split("").map(n=>n.codePointAt(0))}static runeToString(t){return String.fromCodePoint(t)}static isWordRune(t){return D.CODES.get("a")<=t&&t<=D.CODES.get("z")||D.CODES.get("A")<=t&&t<=D.CODES.get("Z")||D.CODES.get("0")<=t&&t<=D.CODES.get("9")||t===D.CODES.get("_")}static emptyOpContext(t,n){let r=0;return t<0&&(r|=this.EMPTY_BEGIN_TEXT|this.EMPTY_BEGIN_LINE),t===D.CODES.get(`
|
|
165
|
+
`)&&(r|=this.EMPTY_BEGIN_LINE),n<0&&(r|=this.EMPTY_END_TEXT|this.EMPTY_END_LINE),n===D.CODES.get(`
|
|
166
|
+
`)&&(r|=this.EMPTY_END_LINE),this.isWordRune(t)!==this.isWordRune(n)?r|=this.EMPTY_WORD_BOUNDARY:r|=this.EMPTY_NO_WORD_BOUNDARY,r}static quoteMeta(t){return t.split("").map(n=>this.METACHARACTERS.indexOf(n)>=0?`\\${n}`:n).join("")}static charCount(t){return t>ae.MAX_BMP?2:1}static stringToUtf8ByteArray(t){if(globalThis.TextEncoder)return Array.from(new TextEncoder().encode(t));{let n=[],r=0;for(let s=0;s<t.length;s++){let i=t.charCodeAt(s);i<128?n[r++]=i:i<2048?(n[r++]=i>>6|192,n[r++]=i&63|128):(i&64512)===55296&&s+1<t.length&&(t.charCodeAt(s+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++s)&1023),n[r++]=i>>18|240,n[r++]=i>>12&63|128,n[r++]=i>>6&63|128,n[r++]=i&63|128):(n[r++]=i>>12|224,n[r++]=i>>6&63|128,n[r++]=i&63|128)}return n}}static utf8ByteArrayToString(t){if(globalThis.TextDecoder)return new TextDecoder("utf-8").decode(new Uint8Array(t));{let n=[],r=0,s=0;for(;r<t.length;){let i=t[r++];if(i<128)n[s++]=String.fromCharCode(i);else if(i>191&&i<224){let o=t[r++];n[s++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=t[r++],a=t[r++],l=t[r++],c=((i&7)<<18|(o&63)<<12|(a&63)<<6|l&63)-65536;n[s++]=String.fromCharCode(55296+(c>>10)),n[s++]=String.fromCharCode(56320+(c&1023))}else{let o=t[r++],a=t[r++];n[s++]=String.fromCharCode((i&15)<<12|(o&63)<<6|a&63)}}return n.join("")}}},z1=(e=[],t=0)=>{let n={};for(let r=0;r<e.length;r++){let s=e[r],i=t+r;n[s]=i,n[i]=s}return Object.freeze(n)},sr=class e{static Encoding=z1(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===e.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===e.Encoding.UTF_16}},Ui=class extends sr{constructor(t=null){super(),this.bytes=t}getEncoding(){return sr.Encoding.UTF_8}asCharSequence(){return Ie.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},Ga=class extends sr{constructor(t=null){super(),this.charSequence=t}getEncoding(){return sr.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return this.charSequence.toString().split("").map(t=>t.codePointAt(0))}length(){return this.charSequence.length}},rs=class{static utf16(t){return new Ga(t)}static utf8(t){return Array.isArray(t)?new Ui(t):new Ui(Ie.stringToUtf8ByteArray(t))}},Dn=class{static EOF(){return-8}canCheckPrefix(){return!0}endPos(){return this.end}},Va=class extends Dn{constructor(t,n=0,r=t.length){super(),this.bytes=t,this.start=n,this.end=r}step(t){if(t+=this.start,t>=this.end)return Dn.EOF();let n=this.bytes[t++]&255;return(n&128)===0?n<<3|1:(n&224)===192?(n=n&31,t>=this.end?Dn.EOF():(n=n<<6|this.bytes[t++]&63,n<<3|2)):(n&240)===224?(n=n&15,t+1>=this.end?Dn.EOF():(n=n<<6|this.bytes[t++]&63,n=n<<6|this.bytes[t++]&63,n<<3|3)):(n=n&7,t+2>=this.end?Dn.EOF():(n=n<<6|this.bytes[t++]&63,n=n<<6|this.bytes[t++]&63,n=n<<6|this.bytes[t++]&63,n<<3|4))}index(t,n){n+=this.start;let r=this.indexOf(this.bytes,t.prefixUTF8,n);return r<0?r:r-n}context(t){t+=this.start;let n=-1;if(t>this.start&&t<=this.end){let s=t-1;if(n=this.bytes[s--],n>=128){let i=t-4;for(i<this.start&&(i=this.start);s>=i&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start),n=this.step(s)>>3}}let r=t<this.end?this.step(t)>>3:-1;return Ie.emptyOpContext(n,r)}indexOf(t,n,r=0){let s=n.length;if(s===0)return-1;let i=t.length;for(let o=r;o<=i-s;o++)for(let a=0;a<s&&t[o+a]===n[a];a++)if(a===s-1)return o;return-1}},qa=class extends Dn{constructor(t,n=0,r=t.length){super(),this.charSequence=t,this.start=n,this.end=r}step(t){if(t+=this.start,t<this.end){let n=this.charSequence.codePointAt(t);return n<<3|Ie.charCount(n)}else return Dn.EOF()}index(t,n){n+=this.start;let r=this.charSequence.indexOf(t.prefix,n);return r<0?r:r-n}context(t){t+=this.start;let n=t>0&&t<=this.charSequence.length?this.charSequence.codePointAt(t-1):-1,r=t<this.charSequence.length?this.charSequence.codePointAt(t):-1;return Ie.emptyOpContext(n,r)}},Ze=class{static fromUTF8(t,n=0,r=t.length){return new Va(t,n,r)}static fromUTF16(t,n=0,r=t.length){return new qa(t,n,r)}},ss=class extends Error{constructor(t){super(t),this.name="RE2JSException"}},We=class extends ss{constructor(t,n=null){let r=`error parsing regexp: ${t}`;n&&(r+=`: \`${n}\``),super(r),this.name="RE2JSSyntaxException",this.message=r,this.error=t,this.input=n}getDescription(){return this.error}getPattern(){return this.input}},Za=class extends ss{constructor(t){super(t),this.name="RE2JSCompileException"}},wn=class extends ss{constructor(t){super(t),this.name="RE2JSGroupException"}},Ka=class extends ss{constructor(t){super(t),this.name="RE2JSFlagsException"}},Bi=class{static quoteReplacement(t,n=!1){return n?t.indexOf("\\")<0&&t.indexOf("$")<0?t:t.split("").map(r=>{let s=r.codePointAt(0);return s===D.CODES.get("\\")||s===D.CODES.get("$")?`\\${r}`:r}).join(""):t.indexOf("$")<0?t:t.split("").map(r=>r.codePointAt(0)===D.CODES.get("$")?"$$":r).join("")}constructor(t,n){if(t===null)throw new Error("pattern is null");this.patternInput=t;let r=this.patternInput.re2();this.patternGroupCount=r.numberOfCapturingGroups(),this.groups=[],this.namedGroups=r.namedGroups,this.numberOfInstructions=r.numberOfInstructions(),n instanceof sr?this.resetMatcherInput(n):Array.isArray(n)?this.resetMatcherInput(rs.utf8(n)):this.resetMatcherInput(rs.utf16(n))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(t){if(t===null)throw new Error("input is null");return this.matcherInput=t,this.reset(),this}start(t=0){if(typeof t=="string"){let n=this.namedGroups[t];if(!Number.isFinite(n))throw new wn(`group '${t}' not found`);t=n}return this.loadGroup(t),this.groups[2*t]}end(t=0){if(typeof t=="string"){let n=this.namedGroups[t];if(!Number.isFinite(n))throw new wn(`group '${t}' not found`);t=n}return this.loadGroup(t),this.groups[2*t+1]}programSize(){return this.numberOfInstructions}group(t=0){if(typeof t=="string"){let s=this.namedGroups[t];if(!Number.isFinite(s))throw new wn(`group '${t}' not found`);t=s}let n=this.start(t),r=this.end(t);return n<0&&r<0?null:this.substring(n,r)}groupCount(){return this.patternGroupCount}loadGroup(t){if(t<0||t>this.patternGroupCount)throw new wn(`Group index out of bounds: ${t}`);if(!this.hasMatch)throw new wn("perhaps no match attempted");if(t===0||this.hasGroups)return;let n=this.groups[1]+1;n>this.matcherInputLength&&(n=this.matcherInputLength);let r=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],n,this.anchorFlag,1+this.patternGroupCount);if(!r[0])throw new wn("inconsistency in matching group data");this.groups=r[1],this.hasGroups=!0}matches(){return this.genMatch(0,j.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,j.ANCHOR_START)}find(t=null){if(t!==null){if(t<0||t>this.matcherInputLength)throw new wn(`start index out of bounds: ${t}`);return this.reset(),this.genMatch(t,0)}return t=0,this.hasMatch&&(t=this.groups[1],this.groups[0]===this.groups[1]&&t++),this.genMatch(t,j.UNANCHORED)}genMatch(t,n){let r=this.patternInput.re2().matchMachineInput(this.matcherInput,t,this.matcherInputLength,n,1);return r[0]?(this.groups=r[1],this.hasMatch=!0,this.hasGroups=!1,this.anchorFlag=n,!0):!1}substring(t,n){return this.matcherInput.isUTF8Encoding()?Ie.utf8ByteArrayToString(this.matcherInput.asBytes().slice(t,n)):this.matcherInput.asCharSequence().substring(t,n).toString()}inputLength(){return this.matcherInputLength}appendReplacement(t,n=!1){let r="",s=this.start(),i=this.end();return this.appendPos<s&&(r+=this.substring(this.appendPos,s)),this.appendPos=i,r+=n?this.appendReplacementInternalJava(t):this.appendReplacementInternalJs(t),r}appendReplacementInternalJava(t){let n="",r=0,s=t.length;for(let i=0;i<s-1;i++){if(t.codePointAt(i)===D.CODES.get("\\")){r<i&&(n+=t.substring(r,i)),i++,r=i;continue}if(t.codePointAt(i)===D.CODES.get("$")){let o=t.codePointAt(i+1);if(D.CODES.get("0")<=o&&o<=D.CODES.get("9")){let a=o-D.CODES.get("0");for(r<i&&(n+=t.substring(r,i)),i+=2;i<s&&(o=t.codePointAt(i),!(o<D.CODES.get("0")||o>D.CODES.get("9")||a*10+o-D.CODES.get("0")>this.patternGroupCount));i++)a=a*10+o-D.CODES.get("0");if(a>this.patternGroupCount)throw new wn(`n > number of groups: ${a}`);let l=this.group(a);l!==null&&(n+=l),r=i,i--;continue}else if(o===D.CODES.get("{")){r<i&&(n+=t.substring(r,i)),i++;let a=i+1;for(;a<t.length&&t.codePointAt(a)!==D.CODES.get("}")&&t.codePointAt(a)!==D.CODES.get(" ");)a++;if(a===t.length||t.codePointAt(a)!==D.CODES.get("}"))throw new wn("named capture group is missing trailing '}'");let l=t.substring(i+1,a);n+=this.group(l),r=a+1}}}return r<s&&(n+=t.substring(r,s)),n}appendReplacementInternalJs(t){let n="",r=0,s=t.length;for(let i=0;i<s-1;i++)if(t.codePointAt(i)===D.CODES.get("$")){let o=t.codePointAt(i+1);if(D.CODES.get("$")===o){r<i&&(n+=t.substring(r,i)),n+="$",i++,r=i+1;continue}else if(D.CODES.get("&")===o){r<i&&(n+=t.substring(r,i));let a=this.group(0);a!==null?n+=a:n+="$&",i++,r=i+1;continue}else if(D.CODES.get("1")<=o&&o<=D.CODES.get("9")){let a=o-D.CODES.get("0");for(r<i&&(n+=t.substring(r,i)),i+=2;i<s&&(o=t.codePointAt(i),!(o<D.CODES.get("0")||o>D.CODES.get("9")||a*10+o-D.CODES.get("0")>this.patternGroupCount));i++)a=a*10+o-D.CODES.get("0");if(a>this.patternGroupCount){n+=`$${a}`,r=i,i--;continue}let l=this.group(a);l!==null&&(n+=l),r=i,i--;continue}else if(o===D.CODES.get("<")){r<i&&(n+=t.substring(r,i)),i++;let a=i+1;for(;a<t.length&&t.codePointAt(a)!==D.CODES.get(">")&&t.codePointAt(a)!==D.CODES.get(" ");)a++;if(a===t.length||t.codePointAt(a)!==D.CODES.get(">")){n+=t.substring(i-1,a+1),r=a+1;continue}let l=t.substring(i+1,a);Object.prototype.hasOwnProperty.call(this.namedGroups,l)?n+=this.group(l):n+=`$<${l}>`,r=a+1}}return r<s&&(n+=t.substring(r,s)),n}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(t,n=!1){return this.replace(t,!0,n)}replaceFirst(t,n=!1){return this.replace(t,!1,n)}replace(t,n=!0,r=!1){let s="";for(this.reset();this.find()&&(s+=this.appendReplacement(t,r),!!n););return s+=this.appendTail(),s}},pe=class e{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static isRuneOp(t){return e.RUNE<=t&&t<=e.RUNE_ANY_NOT_NL}static escapeRunes(t){let n='"';for(let r of t)n+=Ie.escapeRune(r);return n+='"',n}constructor(t){this.op=t,this.out=0,this.arg=0,this.runes=[]}matchRune(t){if(this.runes.length===1){let s=this.runes[0];return(this.arg&j.FOLD_CASE)!==0?ae.equalsIgnoreCase(s,t):t===s}for(let s=0;s<this.runes.length&&s<=8;s+=2){if(t<this.runes[s])return!1;if(t<=this.runes[s+1])return!0}let n=0,r=this.runes.length/2|0;for(;n<r;){let s=n+((r-n)/2|0);if(this.runes[2*s]<=t){if(t<=this.runes[2*s+1])return!0;n=s+1}else r=s}return!1}toString(){switch(this.op){case e.ALT:return`alt -> ${this.out}, ${this.arg}`;case e.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case e.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case e.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case e.MATCH:return"match";case e.FAIL:return"fail";case e.NOP:return`nop -> ${this.out}`;case e.RUNE:return this.runes===null?"rune <null>":["rune ",e.escapeRunes(this.runes),(this.arg&j.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case e.RUNE1:return`rune1 ${e.escapeRunes(this.runes)} -> ${this.out}`;case e.RUNE_ANY:return`any -> ${this.out}`;case e.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},Qa=class{constructor(){this.inst=null,this.cap=[]}},Wi=class{constructor(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}contains(t){let n=this.sparse[t];return n<this.size&&this.densePcs[n]===t}isEmpty(){return this.size===0}add(t){let n=this.size++;return this.sparse[t]=n,this.denseThreads[n]=null,this.densePcs[n]=t,n}clear(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}toString(){let t="{";for(let n=0;n<this.size;n++)n!==0&&(t+=", "),t+=this.densePcs[n];return t+="}",t}},js=class e{static fromRE2(t){let n=new e;return n.prog=t.prog,n.re2=t,n.q0=new Wi(n.prog.numInst()),n.q1=new Wi(n.prog.numInst()),n.pool=[],n.poolSize=0,n.matched=!1,n.matchcap=Array(n.prog.numCap<2?2:n.prog.numCap).fill(0),n.ncap=0,n}static fromMachine(t){let n=new e;return n.re2=t.re2,n.prog=t.prog,n.q0=t.q0,n.q1=t.q1,n.pool=t.pool,n.poolSize=t.poolSize,n.matched=t.matched,n.matchcap=t.matchcap,n.ncap=t.ncap,n}init(t){this.ncap=t,t>this.matchcap.length?this.initNewCap(t):this.resetCap(t)}resetCap(t){for(let n=0;n<this.poolSize;n++){let r=this.pool[n];r.cap=Array(t).fill(0)}}initNewCap(t){for(let n=0;n<this.poolSize;n++){let r=this.pool[n];r.cap=Array(t).fill(0)}this.matchcap=Array(t).fill(0)}submatches(){return this.ncap===0?Ie.emptyInts():this.matchcap.slice(0,this.ncap)}alloc(t){let n;return this.poolSize>0?(this.poolSize--,n=this.pool[this.poolSize]):n=new Qa,n.inst=t,n}freeQueue(t,n=0){let r=t.size-n,s=this.poolSize+r;this.pool.length<s&&(this.pool=this.pool.slice(0,Math.max(this.pool.length*2,s)));for(let i=n;i<t.size;i++){let o=t.denseThreads[i];o!==null&&(this.pool[this.poolSize]=o,this.poolSize++)}t.clear()}freeThread(t){this.pool.length<=this.poolSize&&(this.pool=this.pool.slice(0,this.pool.length*2)),this.pool[this.poolSize]=t,this.poolSize++}match(t,n,r){let s=this.re2.cond;if(s===Ie.EMPTY_ALL||(r===j.ANCHOR_START||r===j.ANCHOR_BOTH)&&n!==0)return!1;this.matched=!1,this.matchcap=Array(this.prog.numCap).fill(-1);let i=this.q0,o=this.q1,a=t.step(n),l=a>>3,c=a&7,u=-1,f=0;a!==Dn.EOF()&&(a=t.step(n+c),u=a>>3,f=a&7);let p;for(n===0?p=Ie.emptyOpContext(-1,l):p=t.context(n);;){if(i.isEmpty()){if((s&Ie.EMPTY_BEGIN_TEXT)!==0&&n!==0||this.matched)break;if(this.re2.prefix.length!==0&&u!==this.re2.prefixRune&&t.canCheckPrefix()){let m=t.index(this.re2,n);if(m<0)break;n+=m,a=t.step(n),l=a>>3,c=a&7,a=t.step(n+c),u=a>>3,f=a&7}}!this.matched&&(n===0||r===j.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=n),this.add(i,this.prog.start,n,this.matchcap,p,null));let h=n+c;if(p=t.context(h),this.step(i,o,n,h,l,p,r,n===t.endPos()),c===0||this.ncap===0&&this.matched)break;n+=c,l=u,c=f,l!==-1&&(a=t.step(n+c),u=a>>3,f=a&7);let d=i;i=o,o=d}return this.freeQueue(o),this.matched}step(t,n,r,s,i,o,a,l){let c=this.re2.longest;for(let u=0;u<t.size;u++){let f=t.denseThreads[u];if(f===null)continue;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<f.cap[0]){this.freeThread(f);continue}let p=f.inst,h=!1;switch(p.op){case pe.MATCH:if(a===j.ANCHOR_BOTH&&!l)break;this.ncap>0&&(!c||!this.matched||this.matchcap[1]<r)&&(f.cap[1]=r,this.matchcap=f.cap.slice(0,this.ncap)),c||this.freeQueue(t,u+1),this.matched=!0;break;case pe.RUNE:h=p.matchRune(i);break;case pe.RUNE1:h=i===p.runes[0];break;case pe.RUNE_ANY:h=!0;break;case pe.RUNE_ANY_NOT_NL:h=i!==D.CODES.get(`
|
|
167
|
+
`);break;default:throw new Error("bad inst")}h&&(f=this.add(n,p.out,s,f.cap,o,f)),f!==null&&(this.freeThread(f),t.denseThreads[u]=null)}t.clear()}add(t,n,r,s,i,o){if(n===0||t.contains(n))return o;let a=t.add(n),l=this.prog.inst[n];switch(l.op){case pe.FAIL:break;case pe.ALT:case pe.ALT_MATCH:o=this.add(t,l.out,r,s,i,o),o=this.add(t,l.arg,r,s,i,o);break;case pe.EMPTY_WIDTH:(l.arg&~i)===0&&(o=this.add(t,l.out,r,s,i,o));break;case pe.NOP:o=this.add(t,l.out,r,s,i,o);break;case pe.CAPTURE:if(l.arg<this.ncap){let c=s[l.arg];s[l.arg]=r,this.add(t,l.out,r,s,i,null),s[l.arg]=c}else o=this.add(t,l.out,r,s,i,o);break;case pe.MATCH:case pe.RUNE:case pe.RUNE1:case pe.RUNE_ANY:case pe.RUNE_ANY_NOT_NL:o===null?o=this.alloc(l):o.inst=l,this.ncap>0&&o.cap!==s&&(o.cap=s.slice(0,this.ncap)),t.denseThreads[a]=o,o=null;break;default:throw new Error("unhandled")}return o}},u3=e=>{let t=-2128831035;for(let n=0;n<e.length;n++)t^=e[n],t=Math.imul(t,16777619);return t},f3=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},Xa=class{constructor(t,n){this.nfaStates=t,this.isMatch=n,this.nextAscii=new Array(ae.MAX_ASCII+1).fill(null),this.nextMap=new Map}},Ya=class{constructor(t){this.prog=t,this.stateCache=new Map,this.stateCount=0,this.startState=null,this.stateLimit=1e4}computeClosure(t){let n=new Set,r=[...t],s=!1;for(;r.length>0;){let o=r.pop();if(n.has(o))continue;n.add(o);let a=this.prog.getInst(o);switch(a.op){case pe.MATCH:s=!0;break;case pe.ALT:case pe.ALT_MATCH:r.push(a.out),r.push(a.arg);break;case pe.NOP:case pe.CAPTURE:r.push(a.out);break;case pe.EMPTY_WIDTH:return null}}return{pcs:Int32Array.from(n).sort(),isMatch:s}}getState(t){let n=this.computeClosure(t);if(!n)return null;let r=n.pcs,s=u3(r),i=this.stateCache.get(s);if(i)for(let a=0;a<i.length;a++){let l=i[a];if(f3(l.nfaStates,r))return l}else i=[],this.stateCache.set(s,i);if(this.stateCount>=this.stateLimit)return this.stateCache.clear(),this.stateCount=0,this.startState=null,null;let o=new Xa(r,n.isMatch);return i.push(o),this.stateCount++,o}step(t,n,r){if(r===j.UNANCHORED&&n<=ae.MAX_ASCII){let o=t.nextAscii[n];if(o!==null)return o}else{let o=n+(r===j.UNANCHORED?0:ae.MAX_RUNE+1);if(t.nextMap.has(o))return t.nextMap.get(o)}let s=[];for(let o=0;o<t.nfaStates.length;o++){let a=t.nfaStates[o],l=this.prog.getInst(a);pe.isRuneOp(l.op)&&l.matchRune(n)&&s.push(l.out)}r===j.UNANCHORED&&s.push(this.prog.start);let i=this.getState(s);if(r===j.UNANCHORED&&n<=ae.MAX_ASCII)t.nextAscii[n]=i;else{let o=n+(r===j.UNANCHORED?0:ae.MAX_RUNE+1);t.nextMap.set(o,i)}return i}match(t,n,r){if((r===j.ANCHOR_START||r===j.ANCHOR_BOTH)&&n!==0)return!1;if(!this.startState&&(this.startState=this.getState([this.prog.start]),!this.startState))return null;let s=t.endPos(),i=this.startState;if(i.isMatch)if(r===j.ANCHOR_BOTH){if(n===s)return!0}else return!0;let o=n;for(;o<s;){let a=t.step(o),l=a>>3,c=a&7;if(c===0)break;if(i=this.step(i,l,r),i===null)return null;if(i.isMatch)if(r===j.ANCHOR_BOTH){if(o+c===s)return!0}else return!0;if(i.nfaStates.length===0&&r!==j.UNANCHORED)return!1;o+=c}return!1}},_=class e{static Op=z1(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(t){return t>=e.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(t){return t===D.CODES.get("-")?"\\":""}static fromRegexp(t){let n=new e(t.op);return n.flags=t.flags,n.subs=t.subs,n.runes=t.runes,n.cap=t.cap,n.min=t.min,n.max=t.max,n.name=t.name,n.namedGroups=t.namedGroups,n}constructor(t){this.op=t,this.flags=0,this.subs=e.emptySubs(),this.runes=[],this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups={}}reinit(){this.flags=0,this.subs=e.emptySubs(),this.runes=[],this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups={}}toString(){return this.appendTo()}appendTo(){let t="";switch(this.op){case e.Op.NO_MATCH:t+="[^\\x00-\\x{10FFFF}]";break;case e.Op.EMPTY_MATCH:t+="(?:)";break;case e.Op.STAR:case e.Op.PLUS:case e.Op.QUEST:case e.Op.REPEAT:{let n=this.subs[0];switch(n.op>e.Op.CAPTURE||n.op===e.Op.LITERAL&&n.runes.length>1?t+=`(?:${n.appendTo()})`:t+=n.appendTo(),this.op){case e.Op.STAR:t+="*";break;case e.Op.PLUS:t+="+";break;case e.Op.QUEST:t+="?";break;case e.Op.REPEAT:t+=`{${this.min}`,this.min!==this.max&&(t+=",",this.max>=0&&(t+=this.max)),t+="}";break}(this.flags&j.NON_GREEDY)!==0&&(t+="?");break}case e.Op.CONCAT:{for(let n of this.subs)n.op===e.Op.ALTERNATE?t+=`(?:${n.appendTo()})`:t+=n.appendTo();break}case e.Op.ALTERNATE:{let n="";for(let r of this.subs)t+=n,n="|",t+=r.appendTo();break}case e.Op.LITERAL:(this.flags&j.FOLD_CASE)!==0&&(t+="(?i:");for(let n of this.runes)t+=Ie.escapeRune(n);(this.flags&j.FOLD_CASE)!==0&&(t+=")");break;case e.Op.ANY_CHAR_NOT_NL:t+="(?-s:.)";break;case e.Op.ANY_CHAR:t+="(?s:.)";break;case e.Op.CAPTURE:this.name===null||this.name.length===0?t+="(":t+=`(?P<${this.name}>`,this.subs[0].op!==e.Op.EMPTY_MATCH&&(t+=this.subs[0].appendTo()),t+=")";break;case e.Op.BEGIN_TEXT:t+="\\A";break;case e.Op.END_TEXT:(this.flags&j.WAS_DOLLAR)!==0?t+="(?-m:$)":t+="\\z";break;case e.Op.BEGIN_LINE:t+="^";break;case e.Op.END_LINE:t+="$";break;case e.Op.WORD_BOUNDARY:t+="\\b";break;case e.Op.NO_WORD_BOUNDARY:t+="\\B";break;case e.Op.CHAR_CLASS:if(this.runes.length%2!==0){t+="[invalid char class]";break}if(t+="[",this.runes.length===0)t+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===ae.MAX_RUNE){t+="^";for(let n=1;n<this.runes.length-1;n+=2){let r=this.runes[n]+1,s=this.runes[n+1]-1;t+=e.quoteIfHyphen(r),t+=Ie.escapeRune(r),r!==s&&(t+="-",t+=e.quoteIfHyphen(s),t+=Ie.escapeRune(s))}}else for(let n=0;n<this.runes.length;n+=2){let r=this.runes[n],s=this.runes[n+1];t+=e.quoteIfHyphen(r),t+=Ie.escapeRune(r),r!==s&&(t+="-",t+=e.quoteIfHyphen(s),t+=Ie.escapeRune(s))}t+="]";break;default:t+=this.op;break}return t}maxCap(){let t=0;if(this.op===e.Op.CAPTURE&&(t=this.cap),this.subs!==null)for(let n of this.subs){let r=n.maxCap();t<r&&(t=r)}return t}equals(t){if(!(t!==null&&t instanceof e)||this.op!==t.op)return!1;switch(this.op){case e.Op.END_TEXT:{if((this.flags&j.WAS_DOLLAR)!==(t.flags&j.WAS_DOLLAR))return!1;break}case e.Op.LITERAL:case e.Op.CHAR_CLASS:{if(this.runes===null&&t.runes===null)break;if(this.runes===null||t.runes===null||this.runes.length!==t.runes.length)return!1;for(let n=0;n<this.runes.length;n++)if(this.runes[n]!==t.runes[n])return!1;break}case e.Op.ALTERNATE:case e.Op.CONCAT:{if(this.subs.length!==t.subs.length)return!1;for(let n=0;n<this.subs.length;++n)if(!this.subs[n].equals(t.subs[n]))return!1;break}case e.Op.STAR:case e.Op.PLUS:case e.Op.QUEST:{if((this.flags&j.NON_GREEDY)!==(t.flags&j.NON_GREEDY)||!this.subs[0].equals(t.subs[0]))return!1;break}case e.Op.REPEAT:{if((this.flags&j.NON_GREEDY)!==(t.flags&j.NON_GREEDY)||this.min!==t.min||this.max!==t.max||!this.subs[0].equals(t.subs[0]))return!1;break}case e.Op.CAPTURE:{if(this.cap!==t.cap||(this.name===null?t.name!==null:this.name!==t.name)||!this.subs[0].equals(t.subs[0]))return!1;break}}return!0}},Ja=class{constructor(){this.inst=[],this.start=0,this.numCap=2}getInst(t){return this.inst[t]}numInst(){return this.inst.length}addInst(t){this.inst.push(new pe(t))}skipNop(t){let n=this.inst[t];for(;n.op===pe.NOP||n.op===pe.CAPTURE;)n=this.inst[t],t=n.out;return n}prefix(){let t="",n=this.skipNop(this.start);if(!pe.isRuneOp(n.op)||n.runes.length!==1)return[n.op===pe.MATCH,t];for(;pe.isRuneOp(n.op)&&n.runes.length===1&&(n.arg&j.FOLD_CASE)===0;)t+=String.fromCodePoint(n.runes[0]),n=this.skipNop(n.out);return[n.op===pe.MATCH,t]}startCond(){let t=0,n=this.start;e:for(;;){let r=this.inst[n];switch(r.op){case pe.EMPTY_WIDTH:t|=r.arg;break;case pe.FAIL:return-1;case pe.CAPTURE:case pe.NOP:break;default:break e}n=r.out}return t}next(t){let n=this.inst[t>>1];return(t&1)===0?n.out:n.arg}patch(t,n){for(;t!==0;){let r=this.inst[t>>1];(t&1)===0?(t=r.out,r.out=n):(t=r.arg,r.arg=n)}}append(t,n){if(t===0)return n;if(n===0)return t;let r=t;for(;;){let i=this.next(r);if(i===0)break;r=i}let s=this.inst[r>>1];return(r&1)===0?s.out=n:s.arg=n,t}toString(){let t="";for(let n=0;n<this.inst.length;n++){let r=t.length;t+=n,n===this.start&&(t+="*"),t+=" ".substring(t.length-r),t+=this.inst[n],t+=`
|
|
168
|
+
`}return t}},ns=class{constructor(t=0,n=0,r=!1){this.i=t,this.out=n,this.nullable=r}},el=class e{static ANY_RUNE_NOT_NL(){return[0,D.CODES.get(`
|
|
169
|
+
`)-1,D.CODES.get(`
|
|
170
|
+
`)+1,ae.MAX_RUNE]}static ANY_RUNE(){return[0,ae.MAX_RUNE]}static compileRegexp(t){let n=new e,r=n.compile(t);return n.prog.patch(r.out,n.newInst(pe.MATCH).i),n.prog.start=r.i,n.prog}constructor(){this.prog=new Ja,this.newInst(pe.FAIL)}newInst(t){return this.prog.addInst(t),new ns(this.prog.numInst()-1,0,!0)}nop(){let t=this.newInst(pe.NOP);return t.out=t.i<<1,t}fail(){return new ns}cap(t){let n=this.newInst(pe.CAPTURE);return n.out=n.i<<1,this.prog.getInst(n.i).arg=t,this.prog.numCap<t+1&&(this.prog.numCap=t+1),n}cat(t,n){return t.i===0||n.i===0?this.fail():(this.prog.patch(t.out,n.i),new ns(t.i,n.out,t.nullable&&n.nullable))}alt(t,n){if(t.i===0)return n;if(n.i===0)return t;let r=this.newInst(pe.ALT),s=this.prog.getInst(r.i);return s.out=t.i,s.arg=n.i,r.out=this.prog.append(t.out,n.out),r.nullable=t.nullable||n.nullable,r}loop(t,n){let r=this.newInst(pe.ALT),s=this.prog.getInst(r.i);return n?(s.arg=t.i,r.out=r.i<<1):(s.out=t.i,r.out=r.i<<1|1),this.prog.patch(t.out,r.i),r}quest(t,n){let r=this.newInst(pe.ALT),s=this.prog.getInst(r.i);return n?(s.arg=t.i,r.out=r.i<<1):(s.out=t.i,r.out=r.i<<1|1),r.out=this.prog.append(r.out,t.out),r}star(t,n){return t.nullable?this.quest(this.plus(t,n),n):this.loop(t,n)}plus(t,n){return new ns(t.i,this.loop(t,n).out,t.nullable)}empty(t){let n=this.newInst(pe.EMPTY_WIDTH);return this.prog.getInst(n.i).arg=t,n.out=n.i<<1,n}rune(t,n){let r=this.newInst(pe.RUNE);r.nullable=!1;let s=this.prog.getInst(r.i);return s.runes=t,n&=j.FOLD_CASE,(t.length!==1||ae.simpleFold(t[0])===t[0])&&(n&=-2),s.arg=n,r.out=r.i<<1,(n&j.FOLD_CASE)===0&&t.length===1||t.length===2&&t[0]===t[1]?s.op=pe.RUNE1:t.length===2&&t[0]===0&&t[1]===ae.MAX_RUNE?s.op=pe.RUNE_ANY:t.length===4&&t[0]===0&&t[1]===D.CODES.get(`
|
|
171
|
+
`)-1&&t[2]===D.CODES.get(`
|
|
172
|
+
`)+1&&t[3]===ae.MAX_RUNE&&(s.op=pe.RUNE_ANY_NOT_NL),r}compile(t){switch(t.op){case _.Op.NO_MATCH:return this.fail();case _.Op.EMPTY_MATCH:return this.nop();case _.Op.LITERAL:if(t.runes.length===0)return this.nop();{let n=null;for(let r of t.runes){let s=this.rune([r],t.flags);n=n===null?s:this.cat(n,s)}return n}case _.Op.CHAR_CLASS:return this.rune(t.runes,t.flags);case _.Op.ANY_CHAR_NOT_NL:return this.rune(e.ANY_RUNE_NOT_NL(),0);case _.Op.ANY_CHAR:return this.rune(e.ANY_RUNE(),0);case _.Op.BEGIN_LINE:return this.empty(Ie.EMPTY_BEGIN_LINE);case _.Op.END_LINE:return this.empty(Ie.EMPTY_END_LINE);case _.Op.BEGIN_TEXT:return this.empty(Ie.EMPTY_BEGIN_TEXT);case _.Op.END_TEXT:return this.empty(Ie.EMPTY_END_TEXT);case _.Op.WORD_BOUNDARY:return this.empty(Ie.EMPTY_WORD_BOUNDARY);case _.Op.NO_WORD_BOUNDARY:return this.empty(Ie.EMPTY_NO_WORD_BOUNDARY);case _.Op.CAPTURE:{let n=this.cap(t.cap<<1),r=this.compile(t.subs[0]),s=this.cap(t.cap<<1|1);return this.cat(this.cat(n,r),s)}case _.Op.STAR:return this.star(this.compile(t.subs[0]),(t.flags&j.NON_GREEDY)!==0);case _.Op.PLUS:return this.plus(this.compile(t.subs[0]),(t.flags&j.NON_GREEDY)!==0);case _.Op.QUEST:return this.quest(this.compile(t.subs[0]),(t.flags&j.NON_GREEDY)!==0);case _.Op.CONCAT:{if(t.subs.length===0)return this.nop();{let n=null;for(let r of t.subs){let s=this.compile(r);n=n===null?s:this.cat(n,s)}return n}}case _.Op.ALTERNATE:{if(t.subs.length===0)return this.nop();{let n=null;for(let r of t.subs){let s=this.compile(r);n=n===null?s:this.alt(n,s)}return n}}default:throw new Za("regexp: unhandled case in compile")}}},tl=class e{static simplify(t){if(t===null)return null;switch(t.op){case _.Op.CAPTURE:case _.Op.CONCAT:case _.Op.ALTERNATE:{let n=t;for(let r=0;r<t.subs.length;r++){let s=t.subs[r],i=e.simplify(s);n===t&&i!==s&&(n=_.fromRegexp(t),n.runes=[],n.subs=t.subs.slice(0,t.subs.length)),n!==t&&(n.subs[r]=i)}return n}case _.Op.STAR:case _.Op.PLUS:case _.Op.QUEST:{let n=e.simplify(t.subs[0]);return e.simplify1(t.op,t.flags,n,t)}case _.Op.REPEAT:{if(t.min===0&&t.max===0)return new _(_.Op.EMPTY_MATCH);let n=e.simplify(t.subs[0]);if(t.max===-1){if(t.min===0)return e.simplify1(_.Op.STAR,t.flags,n,null);if(t.min===1)return e.simplify1(_.Op.PLUS,t.flags,n,null);let s=new _(_.Op.CONCAT),i=[];for(let o=0;o<t.min-1;o++)i.push(n);return i.push(e.simplify1(_.Op.PLUS,t.flags,n,null)),s.subs=i.slice(0),s}if(t.min===1&&t.max===1)return n;let r=null;if(t.min>0){r=[];for(let s=0;s<t.min;s++)r.push(n)}if(t.max>t.min){let s=e.simplify1(_.Op.QUEST,t.flags,n,null);for(let i=t.min+1;i<t.max;i++){let o=new _(_.Op.CONCAT);o.subs=[n,s],s=e.simplify1(_.Op.QUEST,t.flags,o,null)}if(r===null)return s;r.push(s)}if(r!==null){let s=new _(_.Op.CONCAT);return s.subs=r.slice(0),s}return new _(_.Op.NO_MATCH)}}return t}static simplify1(t,n,r,s){return r.op===_.Op.EMPTY_MATCH||t===r.op&&(n&j.NON_GREEDY)===(r.flags&j.NON_GREEDY)?r:(s!==null&&s.op===t&&(s.flags&j.NON_GREEDY)===(n&j.NON_GREEDY)&&r===s.subs[0]||(s=new _(t),s.flags=n,s.subs=[r]),s)}},Ne=class{constructor(t,n){this.sign=t,this.cls=n}},S1=[48,57],C1=[9,10,12,13,32,32],v1=[48,57,65,90,95,95,97,122],k1=new Map([["\\d",new Ne(1,S1)],["\\D",new Ne(-1,S1)],["\\s",new Ne(1,C1)],["\\S",new Ne(-1,C1)],["\\w",new Ne(1,v1)],["\\W",new Ne(-1,v1)]]),N1=[48,57,65,90,97,122],I1=[65,90,97,122],$1=[0,127],O1=[9,9,32,32],R1=[0,31,127,127],T1=[48,57],P1=[33,126],D1=[97,122],_1=[32,126],F1=[33,47,58,64,91,96,123,126],L1=[9,13,32,32],M1=[65,90],U1=[48,57,65,90,95,95,97,122],B1=[48,57,65,70,97,102],W1=new Map([["[:alnum:]",new Ne(1,N1)],["[:^alnum:]",new Ne(-1,N1)],["[:alpha:]",new Ne(1,I1)],["[:^alpha:]",new Ne(-1,I1)],["[:ascii:]",new Ne(1,$1)],["[:^ascii:]",new Ne(-1,$1)],["[:blank:]",new Ne(1,O1)],["[:^blank:]",new Ne(-1,O1)],["[:cntrl:]",new Ne(1,R1)],["[:^cntrl:]",new Ne(-1,R1)],["[:digit:]",new Ne(1,T1)],["[:^digit:]",new Ne(-1,T1)],["[:graph:]",new Ne(1,P1)],["[:^graph:]",new Ne(-1,P1)],["[:lower:]",new Ne(1,D1)],["[:^lower:]",new Ne(-1,D1)],["[:print:]",new Ne(1,_1)],["[:^print:]",new Ne(-1,_1)],["[:punct:]",new Ne(1,F1)],["[:^punct:]",new Ne(-1,F1)],["[:space:]",new Ne(1,L1)],["[:^space:]",new Ne(-1,L1)],["[:upper:]",new Ne(1,M1)],["[:^upper:]",new Ne(-1,M1)],["[:word:]",new Ne(1,U1)],["[:^word:]",new Ne(-1,U1)],["[:xdigit:]",new Ne(1,B1)],["[:^xdigit:]",new Ne(-1,B1)]]),Pn=class e{static charClassToString(t,n){let r="[";for(let s=0;s<n;s+=2){s>0&&(r+=" ");let i=t[s],o=t[s+1];i===o?r+=`0x${i.toString(16)}`:r+=`0x${i.toString(16)}-0x${o.toString(16)}`}return r+="]",r}static cmp(t,n,r,s){let i=t[n]-r;return i!==0?i:s-t[n+1]}static qsortIntPair(t,n,r){let s=((n+r)/2|0)&-2,i=t[s],o=t[s+1],a=n,l=r;for(;a<=l;){for(;a<r&&e.cmp(t,a,i,o)<0;)a+=2;for(;l>n&&e.cmp(t,l,i,o)>0;)l-=2;if(a<=l){if(a!==l){let c=t[a];t[a]=t[l],t[l]=c,c=t[a+1],t[a+1]=t[l+1],t[l+1]=c}a+=2,l-=2}}n<l&&e.qsortIntPair(t,n,l),a<r&&e.qsortIntPair(t,a,r)}constructor(t=Ie.emptyInts()){this.r=t,this.len=t.length}toArray(){return this.len===this.r.length?this.r:this.r.slice(0,this.len)}cleanClass(){if(this.len<4)return this;e.qsortIntPair(this.r,0,this.len-2);let t=2;for(let n=2;n<this.len;n+=2){let r=this.r[n],s=this.r[n+1];if(r<=this.r[t-1]+1){s>this.r[t-1]&&(this.r[t-1]=s);continue}this.r[t]=r,this.r[t+1]=s,t+=2}return this.len=t,this}appendLiteral(t,n){return(n&j.FOLD_CASE)!==0?this.appendFoldedRange(t,t):this.appendRange(t,t)}appendRange(t,n){if(this.len>0){for(let r=2;r<=4;r+=2)if(this.len>=r){let s=this.r[this.len-r],i=this.r[this.len-r+1];if(t<=i+1&&s<=n+1)return t<s&&(this.r[this.len-r]=t),n>i&&(this.r[this.len-r+1]=n),this}}return this.r[this.len++]=t,this.r[this.len++]=n,this}appendFoldedRange(t,n){if(t<=ae.MIN_FOLD&&n>=ae.MAX_FOLD)return this.appendRange(t,n);if(n<ae.MIN_FOLD||t>ae.MAX_FOLD)return this.appendRange(t,n);t<ae.MIN_FOLD&&(this.appendRange(t,ae.MIN_FOLD-1),t=ae.MIN_FOLD),n>ae.MAX_FOLD&&(this.appendRange(ae.MAX_FOLD+1,n),n=ae.MAX_FOLD);for(let r=t;r<=n;r++){this.appendRange(r,r);for(let s=ae.simpleFold(r);s!==r;s=ae.simpleFold(s))this.appendRange(s,s)}return this}appendClass(t){for(let n=0;n<t.length;n+=2)this.appendRange(t[n],t[n+1]);return this}appendFoldedClass(t){for(let n=0;n<t.length;n+=2)this.appendFoldedRange(t[n],t[n+1]);return this}appendNegatedClass(t){let n=0;for(let r=0;r<t.length;r+=2){let s=t[r],i=t[r+1];n<=s-1&&this.appendRange(n,s-1),n=i+1}return n<=ae.MAX_RUNE&&this.appendRange(n,ae.MAX_RUNE),this}appendTable(t){for(let n=0;n<t.length;++n){let r=t.getLo(n),s=t.getHi(n),i=t.getStride(n);if(i===1){this.appendRange(r,s);continue}for(let o=r;o<=s;o+=i)this.appendRange(o,o)}return this}appendNegatedTable(t){let n=0;for(let r=0;r<t.length;++r){let s=t.getLo(r),i=t.getHi(r),o=t.getStride(r);if(o===1){n<=s-1&&this.appendRange(n,s-1),n=i+1;continue}for(let a=s;a<=i;a+=o)n<=a-1&&this.appendRange(n,a-1),n=a+1}return n<=ae.MAX_RUNE&&this.appendRange(n,ae.MAX_RUNE),this}appendTableWithSign(t,n){return n<0?this.appendNegatedTable(t):this.appendTable(t)}negateClass(){let t=0,n=0;for(let r=0;r<this.len;r+=2){let s=this.r[r],i=this.r[r+1];t<=s-1&&(this.r[n]=t,this.r[n+1]=s-1,n+=2),t=i+1}return this.len=n,t<=ae.MAX_RUNE&&(this.r[this.len++]=t,this.r[this.len++]=ae.MAX_RUNE),this}appendClassWithSign(t,n){return n<0?this.appendNegatedClass(t):this.appendClass(t)}appendGroup(t,n){let r=t.cls;return n&&(r=new e().appendFoldedClass(r).cleanClass().toArray()),this.appendClassWithSign(r,t.sign)}toString(){return e.charClassToString(this.r,this.len)}},Gs=class e{static of(t,n){return new e(t,n)}constructor(t,n){this.first=t,this.second=n}},nl=class{constructor(t){this.str=t,this.position=0}pos(){return this.position}rewindTo(t){this.position=t}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(t){this.position+=t}skipString(t){this.position+=t.length}pop(){let t=this.str.codePointAt(this.position);return this.position+=Ie.charCount(t),t}lookingAt(t){return this.rest().startsWith(t)}rest(){return this.str.substring(this.position)}from(t){return this.str.substring(t,this.position)}toString(){return this.rest()}},rl=class e{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static MAX_HEIGHT=1e3;static MAX_SIZE=3355443;static MAX_RUNES=33554432;static ANY_TABLE=new k(new Uint32Array([0,ae.MAX_RUNE,1]));static unicodeTable(t){return t==="Any"?Gs.of(e.ANY_TABLE,e.ANY_TABLE):ln.CATEGORIES.has(t)?Gs.of(ln.CATEGORIES.get(t),ln.FOLD_CATEGORIES.get(t)):ln.SCRIPTS.has(t)?Gs.of(ln.SCRIPTS.get(t),ln.FOLD_SCRIPT.get(t)):null}static minFoldRune(t){if(t<ae.MIN_FOLD||t>ae.MAX_FOLD)return t;let n=t,r=t;for(t=ae.simpleFold(t);t!==r;t=ae.simpleFold(t))n>t&&(n=t);return n}static leadingRegexp(t){if(t.op===_.Op.EMPTY_MATCH)return null;if(t.op===_.Op.CONCAT&&t.subs.length>0){let n=t.subs[0];return n.op===_.Op.EMPTY_MATCH?null:n}return t}static literalRegexp(t,n){let r=new _(_.Op.LITERAL);return r.flags=n,r.runes=Ie.stringToRunes(t),r}static parse(t,n){return new e(t,n).parseInternal()}static parseRepeat(t){let n=t.pos();if(!t.more()||!t.lookingAt("{"))return-1;t.skip(1);let r=e.parseInt(t);if(r===-1||!t.more())return-1;let s;if(!t.lookingAt(","))s=r;else{if(t.skip(1),!t.more())return-1;if(t.lookingAt("}"))s=-1;else if((s=e.parseInt(t))===-1)return-1}if(!t.more()||!t.lookingAt("}"))return-1;if(t.skip(1),r<0||r>1e3||s===-2||s>1e3||s>=0&&r>s)throw new We(e.ERR_INVALID_REPEAT_SIZE,t.from(n));return r<<16|s&ae.MAX_BMP}static isValidCaptureName(t){if(t.length===0)return!1;for(let n=0;n<t.length;n++){let r=t.codePointAt(n);if(r!==D.CODES.get("_")&&!Ie.isalnum(r))return!1}return!0}static parseInt(t){let n=t.pos();for(;t.more()&&t.peek()>=D.CODES.get("0")&&t.peek()<=D.CODES.get("9");)t.skip(1);let r=t.from(n);return r.length===0||r.length>1&&r.codePointAt(0)===D.CODES.get("0")?-1:r.length>8?-2:parseFloat(r,10)}static isCharClass(t){return t.op===_.Op.LITERAL&&t.runes.length===1||t.op===_.Op.CHAR_CLASS||t.op===_.Op.ANY_CHAR_NOT_NL||t.op===_.Op.ANY_CHAR}static matchRune(t,n){switch(t.op){case _.Op.LITERAL:return t.runes.length===1&&t.runes[0]===n;case _.Op.CHAR_CLASS:for(let r=0;r<t.runes.length;r+=2)if(t.runes[r]<=n&&n<=t.runes[r+1])return!0;return!1;case _.Op.ANY_CHAR_NOT_NL:return n!==D.CODES.get(`
|
|
173
|
+
`);case _.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(t,n){switch(t.op){case _.Op.ANY_CHAR:break;case _.Op.ANY_CHAR_NOT_NL:e.matchRune(n,D.CODES.get(`
|
|
174
|
+
`))&&(t.op=_.Op.ANY_CHAR);break;case _.Op.CHAR_CLASS:n.op===_.Op.LITERAL?t.runes=new Pn(t.runes).appendLiteral(n.runes[0],n.flags).toArray():t.runes=new Pn(t.runes).appendClass(n.runes).toArray();break;case _.Op.LITERAL:if(n.runes[0]===t.runes[0]&&n.flags===t.flags)break;t.op=_.Op.CHAR_CLASS,t.runes=new Pn().appendLiteral(t.runes[0],t.flags).appendLiteral(n.runes[0],n.flags).toArray();break}}static parseEscape(t){let n=t.pos();if(t.skip(1),!t.more())throw new We(e.ERR_TRAILING_BACKSLASH);let r=t.pop();e:switch(r){case D.CODES.get("1"):case D.CODES.get("2"):case D.CODES.get("3"):case D.CODES.get("4"):case D.CODES.get("5"):case D.CODES.get("6"):case D.CODES.get("7"):if(!t.more()||t.peek()<D.CODES.get("0")||t.peek()>D.CODES.get("7"))break;case D.CODES.get("0"):{let s=r-D.CODES.get("0");for(let i=1;i<3&&!(!t.more()||t.peek()<D.CODES.get("0")||t.peek()>D.CODES.get("7"));i++)s=s*8+t.peek()-D.CODES.get("0"),t.skip(1);return s}case D.CODES.get("x"):{if(!t.more())break;if(r=t.pop(),r===D.CODES.get("{")){let o=0,a=0;for(;;){if(!t.more())break e;if(r=t.pop(),r===D.CODES.get("}"))break;let l=Ie.unhex(r);if(l<0||(a=a*16+l,a>ae.MAX_RUNE))break e;o++}if(o===0)break e;return a}let s=Ie.unhex(r);if(!t.more())break;r=t.pop();let i=Ie.unhex(r);if(s<0||i<0)break;return s*16+i}case D.CODES.get("a"):return D.CODES.get("\x07");case D.CODES.get("f"):return D.CODES.get("\f");case D.CODES.get("n"):return D.CODES.get(`
|
|
175
|
+
`);case D.CODES.get("r"):return D.CODES.get("\r");case D.CODES.get("t"):return D.CODES.get(" ");case D.CODES.get("v"):return D.CODES.get("\v");default:if(r<=ae.MAX_ASCII&&!Ie.isalnum(r))return r;break}throw new We(e.ERR_INVALID_ESCAPE,t.from(n))}static parseClassChar(t,n){if(!t.more())throw new We(e.ERR_MISSING_BRACKET,t.from(n));return t.lookingAt("\\")?e.parseEscape(t):t.pop()}static concatRunes(t,n){return[...t,...n]}constructor(t,n=0){this.wholeRegexp=t,this.flags=n,this.numCap=0,this.namedGroups={},this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null}newRegexp(t){let n=this.free;return n!==null&&n.subs!==null&&n.subs.length>0?(this.free=n.subs[0],n.reinit(),n.op=t):(n=new _(t),this.numRegexp+=1),n}reuse(t){this.height!==null&&Object.prototype.hasOwnProperty.call(this.height,t)&&delete this.height[t],t.subs!==null&&t.subs.length>0&&(t.subs[0]=this.free),this.free=t}checkLimits(t){if(this.numRunes>e.MAX_RUNES)throw new We(e.ERR_LARGE);this.checkSize(t),this.checkHeight(t)}checkSize(t){if(this.size===null){if(this.repeats===0&&(this.repeats=1),t.op===_.Op.REPEAT){let n=t.max;n===-1&&(n=t.min),n<=0&&(n=1),n>e.MAX_SIZE/this.repeats?this.repeats=e.MAX_SIZE:this.repeats*=n}if(this.numRegexp<e.MAX_SIZE/this.repeats)return;this.size={};for(let n of this.stack)this.checkSize(n)}if(this.calcSize(t,!0)>e.MAX_SIZE)throw new We(e.ERR_LARGE)}calcSize(t,n=!1){if(!n&&Object.prototype.hasOwnProperty.call(this.size,t))return this.size[t];let r=0;switch(t.op){case _.Op.LITERAL:{r=t.runes.length;break}case _.Op.CAPTURE:case _.Op.STAR:{r=2+this.calcSize(t.subs[0]);break}case _.Op.PLUS:case _.Op.QUEST:{r=1+this.calcSize(t.subs[0]);break}case _.Op.CONCAT:{for(let s of t.subs)r=r+this.calcSize(s);break}case _.Op.ALTERNATE:{for(let s of t.subs)r=r+this.calcSize(s);t.subs.length>1&&(r=r+t.subs.length-1);break}case _.Op.REPEAT:{let s=this.calcSize(t.subs[0]);if(t.max===-1){t.min===0?r=2+s:r=1+t.min*s;break}r=t.max*s+(t.max-t.min);break}}return r=Math.max(1,r),this.size[t]=r,r}checkHeight(t){if(!(this.numRegexp<e.MAX_HEIGHT)){if(this.height===null){this.height={};for(let n of this.stack)this.checkHeight(n)}if(this.calcHeight(t,!0)>e.MAX_HEIGHT)throw new We(e.ERR_NESTING_DEPTH)}}calcHeight(t,n=!1){if(!n&&Object.prototype.hasOwnProperty.call(this.height,t))return this.height[t];let r=1;for(let s of t.subs){let i=this.calcHeight(s);r<1+i&&(r=1+i)}return this.height[t]=r,r}pop(){return this.stack.pop()}popToPseudo(){let t=this.stack.length,n=t;for(;n>0&&!_.isPseudoOp(this.stack[n-1].op);)n--;let r=this.stack.slice(n,t);return this.stack=this.stack.slice(0,n),r}push(t){if(this.numRunes+=t.runes.length,t.op===_.Op.CHAR_CLASS&&t.runes.length===2&&t.runes[0]===t.runes[1]){if(this.maybeConcat(t.runes[0],this.flags&-2))return null;t.op=_.Op.LITERAL,t.runes=[t.runes[0]],t.flags=this.flags&-2}else if(t.op===_.Op.CHAR_CLASS&&t.runes.length===4&&t.runes[0]===t.runes[1]&&t.runes[2]===t.runes[3]&&ae.simpleFold(t.runes[0])===t.runes[2]&&ae.simpleFold(t.runes[2])===t.runes[0]||t.op===_.Op.CHAR_CLASS&&t.runes.length===2&&t.runes[0]+1===t.runes[1]&&ae.simpleFold(t.runes[0])===t.runes[1]&&ae.simpleFold(t.runes[1])===t.runes[0]){if(this.maybeConcat(t.runes[0],this.flags|j.FOLD_CASE))return null;t.op=_.Op.LITERAL,t.runes=[t.runes[0]],t.flags=this.flags|j.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(t),this.checkLimits(t),t}maybeConcat(t,n){let r=this.stack.length;if(r<2)return!1;let s=this.stack[r-1],i=this.stack[r-2];return s.op!==_.Op.LITERAL||i.op!==_.Op.LITERAL||(s.flags&j.FOLD_CASE)!==(i.flags&j.FOLD_CASE)?!1:(i.runes=e.concatRunes(i.runes,s.runes),t>=0?(s.runes=[t],s.flags=n,!0):(this.pop(),this.reuse(s),!1))}newLiteral(t,n){let r=this.newRegexp(_.Op.LITERAL);return r.flags=n,(n&j.FOLD_CASE)!==0&&(t=e.minFoldRune(t)),r.runes=[t],r}literal(t){this.push(this.newLiteral(t,this.flags))}op(t){let n=this.newRegexp(t);return n.flags=this.flags,this.push(n)}repeat(t,n,r,s,i,o){let a=this.flags;if((a&j.PERL_X)!==0&&(i.more()&&i.lookingAt("?")&&(i.skip(1),a^=j.NON_GREEDY),o!==-1))throw new We(e.ERR_INVALID_REPEAT_OP,i.from(o));let l=this.stack.length;if(l===0)throw new We(e.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let c=this.stack[l-1];if(_.isPseudoOp(c.op))throw new We(e.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let u=this.newRegexp(t);if(u.min=n,u.max=r,u.flags=a,u.subs=[c],this.stack[l-1]=u,this.checkLimits(u),t===_.Op.REPEAT&&(n>=2||r>=2)&&!this.repeatIsValid(u,1e3))throw new We(e.ERR_INVALID_REPEAT_SIZE,i.from(s))}repeatIsValid(t,n){if(t.op===_.Op.REPEAT){let r=t.max;if(r===0)return!0;if(r<0&&(r=t.min),r>n)return!1;r>0&&(n=Math.trunc(n/r))}for(let r of t.subs)if(!this.repeatIsValid(r,n))return!1;return!0}concat(){this.maybeConcat(-1,0);let t=this.popToPseudo();return t.length===0?this.push(this.newRegexp(_.Op.EMPTY_MATCH)):this.push(this.collapse(t,_.Op.CONCAT))}alternate(){let t=this.popToPseudo();return t.length>0&&this.cleanAlt(t[t.length-1]),t.length===0?this.push(this.newRegexp(_.Op.NO_MATCH)):this.push(this.collapse(t,_.Op.ALTERNATE))}cleanAlt(t){t.op===_.Op.CHAR_CLASS&&(t.runes=new Pn(t.runes).cleanClass().toArray(),t.runes.length===2&&t.runes[0]===0&&t.runes[1]===ae.MAX_RUNE?(t.runes=[],t.op=_.Op.ANY_CHAR):t.runes.length===4&&t.runes[0]===0&&t.runes[1]===D.CODES.get(`
|
|
176
|
+
`)-1&&t.runes[2]===D.CODES.get(`
|
|
177
|
+
`)+1&&t.runes[3]===ae.MAX_RUNE&&(t.runes=[],t.op=_.Op.ANY_CHAR_NOT_NL))}collapse(t,n){if(t.length===1)return t[0];let r=0;for(let a of t)r+=a.op===n?a.subs.length:1;let s=new Array(r).fill(null),i=0;for(let a of t)a.op===n?(s.splice(i,a.subs.length,...a.subs),i+=a.subs.length,this.reuse(a)):s[i++]=a;let o=this.newRegexp(n);if(o.subs=s,n===_.Op.ALTERNATE&&(o.subs=this.factor(o.subs),o.subs.length===1)){let a=o;o=o.subs[0],this.reuse(a)}return o}factor(t){if(t.length<2)return t;let n=0,r=t.length,s=0,i=null,o=0,a=0,l=0;for(let u=0;u<=r;u++){let f=null,p=0,h=0;if(u<r){let d=t[n+u];if(d.op===_.Op.CONCAT&&d.subs.length>0&&(d=d.subs[0]),d.op===_.Op.LITERAL&&(f=d.runes,p=d.runes.length,h=d.flags&j.FOLD_CASE),h===a){let m=0;for(;m<o&&m<p&&i[m]===f[m];)m++;if(m>0){o=m;continue}}}if(u!==l)if(u===l+1)t[s++]=t[n+l];else{let d=this.newRegexp(_.Op.LITERAL);d.flags=a,d.runes=i.slice(0,o);for(let y=l;y<u;y++)t[n+y]=this.removeLeadingString(t[n+y],o),this.checkLimits(t[n+y]);let m=this.collapse(t.slice(n+l,n+u),_.Op.ALTERNATE),g=this.newRegexp(_.Op.CONCAT);g.subs=[d,m],t[s++]=g}l=u,i=f,o=p,a=h}r=s,n=0,l=0,s=0;let c=null;for(let u=0;u<=r;u++){let f=null;if(!(u<r&&(f=e.leadingRegexp(t[n+u]),c!==null&&c.equals(f)&&(e.isCharClass(c)||c.op===_.Op.REPEAT&&c.min===c.max&&e.isCharClass(c.subs[0]))))){if(u!==l)if(u===l+1)t[s++]=t[n+l];else{let p=c;for(let m=l;m<u;m++){let g=m!==l;t[n+m]=this.removeLeadingRegexp(t[n+m],g),this.checkLimits(t[n+m])}let h=this.collapse(t.slice(n+l,n+u),_.Op.ALTERNATE),d=this.newRegexp(_.Op.CONCAT);d.subs=[p,h],t[s++]=d}l=u,c=f}}r=s,n=0,l=0,s=0;for(let u=0;u<=r;u++)if(!(u<r&&e.isCharClass(t[n+u]))){if(u!==l)if(u===l+1)t[s++]=t[n+l];else{let f=l;for(let h=l+1;h<u;h++){let d=t[n+f],m=t[n+h];(d.op<m.op||d.op===m.op&&(d.runes!==null?d.runes.length:0)<(m.runes!==null?m.runes.length:0))&&(f=h)}let p=t[n+l];t[n+l]=t[n+f],t[n+f]=p;for(let h=l+1;h<u;h++)e.mergeCharClass(t[n+l],t[n+h]),this.reuse(t[n+h]);this.cleanAlt(t[n+l]),t[s++]=t[n+l]}u<r&&(t[s++]=t[n+u]),l=u+1}r=s,n=0,l=0,s=0;for(let u=0;u<r;++u)u+1<r&&t[n+u].op===_.Op.EMPTY_MATCH&&t[n+u+1].op===_.Op.EMPTY_MATCH||(t[s++]=t[n+u]);return r=s,n=0,t.slice(n,r)}removeLeadingString(t,n){if(t.op===_.Op.CONCAT&&t.subs.length>0){let r=this.removeLeadingString(t.subs[0],n);if(t.subs[0]=r,r.op===_.Op.EMPTY_MATCH)switch(this.reuse(r),t.subs.length){case 0:case 1:t.op=_.Op.EMPTY_MATCH,t.subs=null;break;case 2:{let s=t;t=t.subs[1],this.reuse(s);break}default:t.subs=t.subs.slice(1,t.subs.length);break}return t}return t.op===_.Op.LITERAL&&(t.runes=t.runes.slice(n,t.runes.length),t.runes.length===0&&(t.op=_.Op.EMPTY_MATCH)),t}removeLeadingRegexp(t,n){if(t.op===_.Op.CONCAT&&t.subs.length>0){switch(n&&this.reuse(t.subs[0]),t.subs=t.subs.slice(1,t.subs.length),t.subs.length){case 0:{t.op=_.Op.EMPTY_MATCH,t.subs=_.emptySubs();break}case 1:{let r=t;t=t.subs[0],this.reuse(r);break}}return t}return n&&this.reuse(t),this.newRegexp(_.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&j.LITERAL)!==0)return e.literalRegexp(this.wholeRegexp,this.flags);let t=-1,n=-1,r=-1,s=new nl(this.wholeRegexp);for(;s.more();){let o=-1;e:switch(s.peek()){case D.CODES.get("("):if((this.flags&j.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(_.Op.LEFT_PAREN).cap=++this.numCap,s.skip(1);break;case D.CODES.get("|"):this.parseVerticalBar(),s.skip(1);break;case D.CODES.get(")"):this.parseRightParen(),s.skip(1);break;case D.CODES.get("^"):(this.flags&j.ONE_LINE)!==0?this.op(_.Op.BEGIN_TEXT):this.op(_.Op.BEGIN_LINE),s.skip(1);break;case D.CODES.get("$"):(this.flags&j.ONE_LINE)!==0?this.op(_.Op.END_TEXT).flags|=j.WAS_DOLLAR:this.op(_.Op.END_LINE),s.skip(1);break;case D.CODES.get("."):(this.flags&j.DOT_NL)!==0?this.op(_.Op.ANY_CHAR):this.op(_.Op.ANY_CHAR_NOT_NL),s.skip(1);break;case D.CODES.get("["):this.parseClass(s);break;case D.CODES.get("*"):case D.CODES.get("+"):case D.CODES.get("?"):{o=s.pos();let a=null;switch(s.pop()){case D.CODES.get("*"):a=_.Op.STAR;break;case D.CODES.get("+"):a=_.Op.PLUS;break;case D.CODES.get("?"):a=_.Op.QUEST;break}this.repeat(a,n,r,o,s,t);break}case D.CODES.get("{"):{o=s.pos();let a=e.parseRepeat(s);if(a<0){s.rewindTo(o),this.literal(s.pop());break}n=a>>16,r=(a&ae.MAX_BMP)<<16>>16,this.repeat(_.Op.REPEAT,n,r,o,s,t);break}case D.CODES.get("\\"):{let a=s.pos();if(s.skip(1),(this.flags&j.PERL_X)!==0&&s.more())switch(s.pop()){case D.CODES.get("A"):this.op(_.Op.BEGIN_TEXT);break e;case D.CODES.get("b"):this.op(_.Op.WORD_BOUNDARY);break e;case D.CODES.get("B"):this.op(_.Op.NO_WORD_BOUNDARY);break e;case D.CODES.get("C"):throw new We(e.ERR_INVALID_ESCAPE,"\\C");case D.CODES.get("Q"):{let f=s.rest(),p=f.indexOf("\\E");p>=0&&(f=f.substring(0,p)),s.skipString(f),s.skipString("\\E");let h=0;for(;h<f.length;){let d=f.codePointAt(h);this.literal(d),h+=Ie.charCount(d)}break e}case D.CODES.get("z"):this.op(_.Op.END_TEXT);break e;default:s.rewindTo(a);break}let l=this.newRegexp(_.Op.CHAR_CLASS);if(l.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){let u=new Pn;if(this.parseUnicodeClass(s,u)){l.runes=u.toArray(),this.push(l);break e}}let c=new Pn;if(this.parsePerlClassEscape(s,c)){l.runes=c.toArray(),this.push(l);break e}s.rewindTo(a),this.reuse(l),this.literal(e.parseEscape(s));break}default:this.literal(s.pop());break}t=o}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new We(e.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(t){let n=t.pos(),r=t.rest();if(r.startsWith("(?P<")||r.startsWith("(?<")){let a=r.charAt(2)==="P"?4:3,l=r.indexOf(">");if(l<0)throw new We(e.ERR_INVALID_NAMED_CAPTURE,r);let c=r.substring(a,l);if(t.skipString(c),t.skip(a+1),!e.isValidCaptureName(c))throw new We(e.ERR_INVALID_NAMED_CAPTURE,r.substring(0,l+1));let u=this.op(_.Op.LEFT_PAREN);if(u.cap=++this.numCap,this.namedGroups[c])throw new We(e.ERR_DUPLICATE_NAMED_CAPTURE,c);this.namedGroups[c]=this.numCap,u.name=c;return}t.skip(2);let s=this.flags,i=1,o=!1;e:for(;t.more();){let a=t.pop();switch(a){case D.CODES.get("i"):s|=j.FOLD_CASE,o=!0;break;case D.CODES.get("m"):s&=-17,o=!0;break;case D.CODES.get("s"):s|=j.DOT_NL,o=!0;break;case D.CODES.get("U"):s|=j.NON_GREEDY,o=!0;break;case D.CODES.get("-"):if(i<0)break e;i=-1,s=~s,o=!1;break;case D.CODES.get(":"):case D.CODES.get(")"):if(i<0){if(!o)break e;s=~s}a===D.CODES.get(":")&&this.op(_.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new We(e.ERR_INVALID_PERL_OP,t.from(n))}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(_.Op.VERTICAL_BAR)}swapVerticalBar(){let t=this.stack.length;if(t>=3&&this.stack[t-2].op===_.Op.VERTICAL_BAR&&e.isCharClass(this.stack[t-1])&&e.isCharClass(this.stack[t-3])){let n=this.stack[t-1],r=this.stack[t-3];if(n.op>r.op){let s=r;r=n,n=s,this.stack[t-3]=r}return e.mergeCharClass(r,n),this.reuse(n),this.pop(),!0}if(t>=2){let n=this.stack[t-1],r=this.stack[t-2];if(r.op===_.Op.VERTICAL_BAR)return t>=3&&this.cleanAlt(this.stack[t-3]),this.stack[t-2]=n,this.stack[t-1]=r,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new We(e.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let n=this.pop(),r=this.pop();if(r.op!==_.Op.LEFT_PAREN)throw new We(e.ERR_UNEXPECTED_PAREN,this.wholeRegexp);this.flags=r.flags,r.cap===0?this.push(n):(r.op=_.Op.CAPTURE,r.subs=[n],this.push(r))}parsePerlClassEscape(t,n){let r=t.pos();if((this.flags&j.PERL_X)===0||!t.more()||t.pop()!==D.CODES.get("\\")||!t.more())return!1;t.pop();let s=t.from(r),i=k1.has(s)?k1.get(s):null;return i===null?!1:(n.appendGroup(i,(this.flags&j.FOLD_CASE)!==0),!0)}parseNamedClass(t,n){let r=t.rest(),s=r.indexOf(":]");if(s<0)return!1;let i=r.substring(0,s+2);t.skipString(i);let o=W1.has(i)?W1.get(i):null;if(o===null)throw new We(e.ERR_INVALID_CHAR_RANGE,i);return n.appendGroup(o,(this.flags&j.FOLD_CASE)!==0),!0}parseUnicodeClass(t,n){let r=t.pos();if((this.flags&j.UNICODE_GROUPS)===0||!t.lookingAt("\\p")&&!t.lookingAt("\\P"))return!1;t.skip(1);let s=1,i=t.pop();if(i===D.CODES.get("P")&&(s=-1),!t.more())throw t.rewindTo(r),new We(e.ERR_INVALID_CHAR_RANGE,t.rest());i=t.pop();let o;if(i!==D.CODES.get("{"))o=Ie.runeToString(i);else{let u=t.rest(),f=u.indexOf("}");if(f<0)throw t.rewindTo(r),new We(e.ERR_INVALID_CHAR_RANGE,t.rest());o=u.substring(0,f),t.skipString(o),t.skip(1)}o.length!==0&&o.codePointAt(0)===D.CODES.get("^")&&(s=0-s,o=o.substring(1));let a=e.unicodeTable(o);if(a===null)throw new We(e.ERR_INVALID_CHAR_RANGE,t.from(r));let l=a.first,c=a.second;if((this.flags&j.FOLD_CASE)===0||c===null)n.appendTableWithSign(l,s);else{let u=new Pn().appendTable(l).appendTable(c).cleanClass().toArray();n.appendClassWithSign(u,s)}return!0}parseClass(t){let n=t.pos();t.skip(1);let r=this.newRegexp(_.Op.CHAR_CLASS);r.flags=this.flags;let s=new Pn,i=1;t.more()&&t.lookingAt("^")&&(i=-1,t.skip(1),(this.flags&j.CLASS_NL)===0&&s.appendRange(D.CODES.get(`
|
|
178
|
+
`),D.CODES.get(`
|
|
179
|
+
`)));let o=!0;for(;!t.more()||t.peek()!==D.CODES.get("]")||o;){if(t.more()&&t.lookingAt("-")&&(this.flags&j.PERL_X)===0&&!o){let u=t.rest();if(u==="-"||!u.startsWith("-]"))throw t.rewindTo(n),new We(e.ERR_INVALID_CHAR_RANGE,t.rest())}o=!1;let a=t.pos();if(t.lookingAt("[:")){if(this.parseNamedClass(t,s))continue;t.rewindTo(a)}if(this.parseUnicodeClass(t,s)||this.parsePerlClassEscape(t,s))continue;t.rewindTo(a);let l=e.parseClassChar(t,n),c=l;if(t.more()&&t.lookingAt("-")){if(t.skip(1),t.more()&&t.lookingAt("]"))t.skip(-1);else if(c=e.parseClassChar(t,n),c<l)throw new We(e.ERR_INVALID_CHAR_RANGE,t.from(a))}(this.flags&j.FOLD_CASE)===0?s.appendRange(l,c):s.appendFoldedRange(l,c)}t.skip(1),s.cleanClass(),i<0&&s.negateClass(),r.runes=s.toArray(),this.push(r)}},sl=class{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}compareAndSet(t,n){return this.value===t?(this.value=n,!0):!1}},il=class e{static initTest(t){let n=e.compile(t),r=new e(n.expr,n.prog,n.numSubexp,n.longest);return r.cond=n.cond,r.prefix=n.prefix,r.prefixUTF8=n.prefixUTF8,r.prefixComplete=n.prefixComplete,r.prefixRune=n.prefixRune,r}static compile(t){return e.compileImpl(t,j.PERL,!1)}static compilePOSIX(t){return e.compileImpl(t,j.POSIX,!0)}static compileImpl(t,n,r){let s=rl.parse(t,n),i=s.maxCap();s=tl.simplify(s);let o=el.compileRegexp(s),a=new e(t,o,i,r),[l,c]=o.prefix();return a.prefixComplete=l,a.prefix=c,a.prefixUTF8=Ie.stringToUtf8ByteArray(a.prefix),a.prefix.length>0&&(a.prefixRune=a.prefix.codePointAt(0)),a.namedGroups=s.namedGroups,a}static match(t,n){return e.compile(t).match(n)}constructor(t,n,r=0,s=0){this.expr=t,this.prog=n,this.numSubexp=r,this.longest=s,this.cond=n.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new sl,this.dfa=new Ya(n)}executeEngine(t,n,r,s){if(s>0)return this.doExecuteNFA(t,n,r,s);let i=this.dfa.match(t,n,r);return i!==null?i?[]:null:this.doExecuteNFA(t,n,r,s)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){let t;do t=this.pooled.get();while(t&&!this.pooled.compareAndSet(t,t.next));return t}reset(){this.pooled.set(null)}put(t,n){let r=this.pooled.get();do r=this.pooled.get(),!n&&r&&(t=js.fromMachine(t),n=!0),t.next!==r&&(t.next=r);while(!this.pooled.compareAndSet(r,t))}toString(){return this.expr}doExecuteNFA(t,n,r,s){let i=this.get(),o=!1;i?i.next!==null&&(i=js.fromMachine(i),o=!0):(i=js.fromRE2(this),o=!0),i.init(s);let a=i.match(t,n,r)?i.submatches():null;return this.put(i,o),a}match(t){return this.executeEngine(Ze.fromUTF16(t),0,j.UNANCHORED,0)!==null}matchWithGroup(t,n,r,s,i){return t instanceof sr||(t=rs.utf16(t)),this.matchMachineInput(t,n,r,s,i)}matchMachineInput(t,n,r,s,i){if(n>r)return[!1,null];let o=t.isUTF16Encoding()?Ze.fromUTF16(t.asCharSequence(),0,r):Ze.fromUTF8(t.asBytes(),0,r),a=this.executeEngine(o,n,s,2*i);return a===null?[!1,null]:[!0,a]}matchUTF8(t){return this.executeEngine(Ze.fromUTF8(t),0,j.UNANCHORED,0)!==null}replaceAll(t,n){return this.replaceAllFunc(t,()=>n,2*t.length+1)}replaceFirst(t,n){return this.replaceAllFunc(t,()=>n,1)}replaceAllFunc(t,n,r){let s=0,i=0,o="",a=Ze.fromUTF16(t),l=0;for(;i<=t.length;){let c=this.executeEngine(a,i,j.UNANCHORED,2);if(c===null||c.length===0)break;o+=t.substring(s,c[0]),(c[1]>s||c[0]===0)&&(o+=n(t.substring(c[0],c[1])),l++),s=c[1];let u=a.step(i)&7;if(i+u>c[1]?i+=u:i+1>c[1]?i++:i=c[1],l>=r)break}return o+=t.substring(s),o}pad(t){if(t===null)return null;let n=(1+this.numSubexp)*2;if(t.length<n){let r=new Array(n).fill(-1);for(let s=0;s<t.length;s++)r[s]=t[s];t=r}return t}allMatches(t,n,r=s=>s){let s=[],i=t.endPos();n<0&&(n=i+1);let o=0,a=0,l=-1;for(;a<n&&o<=i;){let c=this.executeEngine(t,o,j.UNANCHORED,this.prog.numCap);if(c===null||c.length===0)break;let u=!0;if(c[1]===o){c[0]===l&&(u=!1);let f=t.step(o);f<0?o=i+1:o+=f&7}else o=c[1];l=c[1],u&&(s.push(r(this.pad(c))),a++)}return s}findUTF8(t){let n=this.executeEngine(Ze.fromUTF8(t),0,j.UNANCHORED,2);return n===null?null:t.slice(n[0],n[1])}findUTF8Index(t){let n=this.executeEngine(Ze.fromUTF8(t),0,j.UNANCHORED,2);return n===null?null:n.slice(0,2)}find(t){let n=this.executeEngine(Ze.fromUTF16(t),0,j.UNANCHORED,2);return n===null?"":t.substring(n[0],n[1])}findIndex(t){return this.executeEngine(Ze.fromUTF16(t),0,j.UNANCHORED,2)}findUTF8Submatch(t){let n=this.executeEngine(Ze.fromUTF8(t),0,j.UNANCHORED,this.prog.numCap);if(n===null)return null;let r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<n.length&&n[2*s]>=0&&(r[s]=t.slice(n[2*s],n[2*s+1]));return r}findUTF8SubmatchIndex(t){return this.pad(this.executeEngine(Ze.fromUTF8(t),0,j.UNANCHORED,this.prog.numCap))}findSubmatch(t){let n=this.executeEngine(Ze.fromUTF16(t),0,j.UNANCHORED,this.prog.numCap);if(n===null)return null;let r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<n.length&&n[2*s]>=0&&(r[s]=t.substring(n[2*s],n[2*s+1]));return r}findSubmatchIndex(t){return this.pad(this.executeEngine(Ze.fromUTF16(t),0,j.UNANCHORED,this.prog.numCap))}findAllUTF8(t,n){let r=this.allMatches(Ze.fromUTF8(t),n,s=>t.slice(s[0],s[1]));return r.length===0?null:r}findAllUTF8Index(t,n){let r=this.allMatches(Ze.fromUTF8(t),n,s=>s.slice(0,2));return r.length===0?null:r}findAll(t,n){let r=this.allMatches(Ze.fromUTF16(t),n,s=>t.substring(s[0],s[1]));return r.length===0?null:r}findAllIndex(t,n){let r=this.allMatches(Ze.fromUTF16(t),n,s=>s.slice(0,2));return r.length===0?null:r}findAllUTF8Submatch(t,n){let r=this.allMatches(Ze.fromUTF8(t),n,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=t.slice(s[2*o],s[2*o+1]));return i});return r.length===0?null:r}findAllUTF8SubmatchIndex(t,n){let r=this.allMatches(Ze.fromUTF8(t),n);return r.length===0?null:r}findAllSubmatch(t,n){let r=this.allMatches(Ze.fromUTF16(t),n,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=t.substring(s[2*o],s[2*o+1]));return i});return r.length===0?null:r}findAllSubmatchIndex(t,n){let r=this.allMatches(Ze.fromUTF16(t),n);return r.length===0?null:r}},ol=class e{static isUpperCaseAlpha(t){return"A"<=t&&t<="Z"}static isHexadecimal(t){return"0"<=t&&t<="9"||"A"<=t&&t<="F"||"a"<=t&&t<="f"}static getUtf8CharSize(t){let n=t.charCodeAt(0);return n<128?1:n<2048?2:n<65536?3:4}static translate(t){if(typeof t!="string")return t;let n="",r=!1,s=t.length;s===0&&(n="(?:)",r=!0);let i=0;for(;i<s;){let o=t[i];if(o==="\\"){if(i+1<s)switch(o=t[i+1],o){case"\\":{n+="\\\\",i+=2;continue}case"c":{if(i+2<s){let l=t[i+2];if(e.isUpperCaseAlpha(l)){n+="\\x",n+=(l.charCodeAt(0)-64>>4).toString(16).toUpperCase(),n+=(l.charCodeAt(0)-64&15).toString(16).toUpperCase(),i+=3,r=!0;continue}}n+="\\c",i+=2;continue}case"u":{if(i+2<s){let l=t[i+2];if(e.isHexadecimal(l)){n+="\\x{"+l,i+=3;for(let c=0;c<3&&i<s&&(l=t[i],!!e.isHexadecimal(l));++i,++c)n+=l;n+="}",r=!0;continue}else if(l==="{"){n+="\\x",i+=2,r=!0;continue}}n+="\\u",i+=2;continue}default:{n+="\\";let l=e.getUtf8CharSize(o);n+=t.substring(i+1,i+1+l),i+=l+1;continue}}}else if(o==="/"){n+="\\/",i+=1,r=!0;continue}else if(o==="("&&i+2<s&&t[i+1]==="?"&&t[i+2]==="<"&&(i+3>=s||t[i+3]!=="="&&t[i+3]!=="!")){n+="(?P<",i+=3,r=!0;continue}let a=e.getUtf8CharSize(o);n+=t.substring(i,i+a),i+=a}return r?n:t}},ir=class e{static CASE_INSENSITIVE=1;static DOTALL=2;static MULTILINE=4;static DISABLE_UNICODE_GROUPS=8;static LONGEST_MATCH=16;static quote(t){return Ie.quoteMeta(t)}static quoteReplacement(t,n=!1){return Bi.quoteReplacement(t,n)}static translateRegExp(t){return ol.translate(t)}static compile(t,n=0){let r=t;if((n&e.CASE_INSENSITIVE)!==0&&(r=`(?i)${r}`),(n&e.DOTALL)!==0&&(r=`(?s)${r}`),(n&e.MULTILINE)!==0&&(r=`(?m)${r}`),(n&~(e.MULTILINE|e.DOTALL|e.CASE_INSENSITIVE|e.DISABLE_UNICODE_GROUPS|e.LONGEST_MATCH))!==0)throw new Ka("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");let s=j.PERL;(n&e.DISABLE_UNICODE_GROUPS)!==0&&(s&=-129);let i=new e(t,n);return i.re2Input=il.compileImpl(r,s,(n&e.LONGEST_MATCH)!==0),i}static matches(t,n){return e.compile(t).testExact(n)}static initTest(t,n,r){if(t==null)throw new Error("pattern is null");if(r==null)throw new Error("re2 is null");let s=new e(t,n);return s.re2Input=r,s}constructor(t,n){this.patternInput=t,this.flagsInput=n}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(t){return this.testExact(t)}matcher(t){return Array.isArray(t)&&(t=rs.utf8(t)),new Bi(this,t)}test(t){return Array.isArray(t)?this.re2Input.matchUTF8(t):this.re2Input.match(t)}testExact(t){let n=Array.isArray(t)?Ze.fromUTF8(t):Ze.fromUTF16(t);return this.re2Input.executeEngine(n,0,j.ANCHOR_BOTH,0)!==null}split(t,n=0){let r=this.matcher(t),s=[],i=0,o=0;for(;r.find();){if(o===0&&r.end()===0){o=r.end();continue}if(n>0&&s.length===n-1)break;if(o===r.start()){if(n===0){i+=1,o=r.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(r.substring(o,r.start())),o=r.end()}if(n===0&&o!==r.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(r.substring(o,r.inputLength()))}return(n!==0||s.length===0)&&s.push(r.substring(o,r.inputLength())),s}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(t){return this===t?!0:t===null||this.constructor!==t.constructor?!1:this.flagsInput===t.flagsInput&&this.patternInput===t.patternInput}}});function p3(e){let t=0;return e.includes("i")&&(t|=ir.CASE_INSENSITIVE),e.includes("m")&&(t|=ir.MULTILINE),e.includes("s")&&(t|=ir.DOTALL),t}function h3(e){return ir.translateRegExp(e)}function K(e,t=""){return new zi(e,t)}var zi,Zn,j1=v(()=>{"use strict";H1();zi=class{_re2;_pattern;_flags;_global;_ignoreCase;_multiline;_lastIndex=0;_nativeRegex=null;constructor(t,n=""){this._pattern=t,this._flags=n,this._global=n.includes("g"),this._ignoreCase=n.includes("i"),this._multiline=n.includes("m");try{let r=h3(t),s=p3(n);this._re2=ir.compile(r,s)}catch(r){if(r instanceof We){let s=r.message||"",i="";throw s.includes("(?=")||s.includes("(?!")||s.includes("(?<")||s.includes("(?<!")||t.includes("(?=")||t.includes("(?!")||t.includes("(?<=")||t.includes("(?<!")?i=" Lookahead (?=, ?!) and lookbehind (?<=, ?<!) assertions are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support these features.":(s.includes("backreference")||/\\[1-9]/.test(t))&&(i=" Backreferences (\\1, \\2, etc.) are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support backreferences."),new SyntaxError(`Invalid regular expression: /${t}/: ${s}${i}`)}throw r}}test(t){return this._global&&(this._lastIndex=0),this._re2.matcher(t).find()}exec(t){let n=this._re2.matcher(t),r=this._global?this._lastIndex:0;if(!n.find(r))return this._global&&(this._lastIndex=0),null;let s=this._re2.groupCount(),i=[];i.push(n.group(0)??"");for(let l=1;l<=s;l++){let c=n.group(l);i.push(c)}let o=i;o.index=n.start(0),o.input=t;let a=this._re2.namedGroups();if(a&&Object.keys(a).length>0){let l=Object.create(null);for(let[c,u]of Object.entries(a)){let f=n.group(u);f!==null&&(l[c]=f)}o.groups=l}return this._global&&(this._lastIndex=n.end(0),n.start(0)===n.end(0)&&this._lastIndex++),o}match(t){if(this._global&&(this._lastIndex=0),!this._global)return this.exec(t);let n=[],r=this._re2.matcher(t),s=0;for(;r.find(s);){let i=r.group(0)??"";if(n.push(i),s=r.end(0),r.start(0)===r.end(0)&&s++,s>t.length)break}return n.length>0?n:null}replace(t,n){if(this._global&&(this._lastIndex=0),typeof n=="string"){let c=this._re2.matcher(t);return this._global?c.replaceAll(n,!0):c.replaceFirst(n,!0)}let r=[],s=this._re2.matcher(t),i=0,o=0,a=this._re2.groupCount(),l=this._re2.namedGroups();for(;s.find(o);){r.push(t.slice(i,s.start(0)));let c=[],u=s.group(0)??"";for(let f=1;f<=a;f++)c.push(s.group(f));if(c.push(s.start(0)),c.push(t),l&&Object.keys(l).length>0){let f=Object.create(null);for(let[p,h]of Object.entries(l))f[p]=s.group(h)??"";c.push(f)}if(r.push(n(u,...c)),i=s.end(0),o=i,s.start(0)===s.end(0)&&o++,!this._global||o>t.length)break}return r.push(t.slice(i)),r.join("")}split(t,n){return n===void 0||n<0?this._re2.split(t,-1):n===0?[]:this._re2.split(t,-1).slice(0,n)}search(t){let n=this._re2.matcher(t);return n.find()?n.start(0):-1}*matchAll(t){if(!this._global)throw new Error("matchAll requires global flag");this._lastIndex=0;let n=this._re2.matcher(t),r=this._re2.groupCount(),s=this._re2.namedGroups(),i=0;for(;n.find(i);){let o=[];o.push(n.group(0)??"");for(let l=1;l<=r;l++)o.push(n.group(l));let a=o;if(a.index=n.start(0),a.input=t,s&&Object.keys(s).length>0){let l=Object.create(null);for(let[c,u]of Object.entries(s)){let f=n.group(u);f!==null&&(l[c]=f)}a.groups=l}if(yield a,i=n.end(0),n.start(0)===n.end(0)&&i++,i>t.length)break}}get native(){if(!this._nativeRegex)try{this._nativeRegex=new RegExp(this._pattern,this._flags)}catch{this._nativeRegex=new RegExp("",this._flags),Object.defineProperty(this._nativeRegex,"source",{value:this._pattern,writable:!1})}return this._nativeRegex}get source(){return this._pattern}get flags(){return this._flags}get global(){return this._global}get ignoreCase(){return this._ignoreCase}get multiline(){return this._multiline}get lastIndex(){return this._lastIndex}set lastIndex(t){this._lastIndex=t}};Zn=class{_regex;constructor(t){this._regex=t}test(t){return this._regex.global&&(this._regex.lastIndex=0),this._regex.test(t)}exec(t){return this._regex.exec(t)}match(t){return this._regex.global&&(this._regex.lastIndex=0),t.match(this._regex)}replace(t,n){return this._regex.global&&(this._regex.lastIndex=0),t.replace(this._regex,n)}split(t,n){return t.split(this._regex,n)}search(t){return t.search(this._regex)}*matchAll(t){if(!this._regex.global)throw new Error("matchAll requires global flag");this._regex.lastIndex=0;let n=this._regex.exec(t);for(;n!==null;)yield n,n[0].length===0&&this._regex.lastIndex++,n=this._regex.exec(t)}get native(){return this._regex}get source(){return this._regex.source}get flags(){return this._regex.flags}get global(){return this._regex.global}get ignoreCase(){return this._regex.ignoreCase}get multiline(){return this._regex.multiline}get lastIndex(){return this._regex.lastIndex}set lastIndex(t){this._regex.lastIndex=t}}});var Ve=v(()=>{"use strict";j1()});function Rt(e,t,n){let r=typeof n=="boolean"?{ignoreCase:n}:n??{},s=t;r.stripQuotes&&(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))&&(s=s.slice(1,-1));let i=r.ignoreCase?`i:${s}`:s,o=Vs.get(i);if(!o){if(o=m3(s,r.ignoreCase),Vs.size>=d3){let a=Vs.keys().next().value;a!==void 0&&Vs.delete(a)}Vs.set(i,o)}return o.test(e)}function m3(e,t){let n="^";for(let r=0;r<e.length;r++){let s=e[r];if(s==="*")n+=".*";else if(s==="?")n+=".";else if(s==="["){let i=r+1;for(;i<e.length&&e[i]!=="]";)i++;n+=e.slice(r,i+1),r=i}else s==="."||s==="+"||s==="^"||s==="$"||s==="{"||s==="}"||s==="("||s===")"||s==="|"||s==="\\"?n+=`\\${s}`:n+=s}return n+="$",K(n,t?"i":"")}var d3,Vs,al=v(()=>{"use strict";Ve();d3=2048,Vs=new Map});function G1(e,t){return e.replace(/\$(&|\d+|<([^>]+)>)/g,(n,r,s)=>{if(r==="&")return t[0];if(s!==void 0)return t.groups?.[s]??"";let i=parseInt(r,10);return t[i]??""})}function is(e,t,n={}){let{invertMatch:r=!1,showLineNumbers:s=!1,countOnly:i=!1,countMatches:o=!1,filename:a="",onlyMatching:l=!1,beforeContext:c=0,afterContext:u=0,maxCount:f=0,contextSeparator:p="--",showColumn:h=!1,vimgrep:d=!1,showByteOffset:m=!1,replace:g=null,passthru:y=!1,multiline:w=!1,kResetGroup:b}=n;if(w)return g3(e,t,{invertMatch:r,showLineNumbers:s,countOnly:i,countMatches:o,filename:a,onlyMatching:l,beforeContext:c,afterContext:u,maxCount:f,contextSeparator:p,showColumn:h,showByteOffset:m,replace:g,kResetGroup:b});let x=e.split(`
|
|
180
|
+
`),A=x.length,$=A>0&&x[A-1]===""?A-1:A;if(i||o){let N=0,R=(o||l)&&!r;for(let T=0;T<$;T++)if(t.lastIndex=0,R)for(let L=t.exec(x[T]);L!==null;L=t.exec(x[T]))N++,L[0].length===0&&t.lastIndex++;else t.test(x[T])!==r&&N++;return{output:`${a?`${a}:${N}`:String(N)}
|
|
181
|
+
`,matched:N>0,matchCount:N}}if(c===0&&u===0&&!y){let N=[],R=!1,I=0,T=0;for(let L=0;L<$&&!(f>0&&I>=f);L++){let me=x[L];if(t.lastIndex=0,t.test(me)!==r)if(R=!0,I++,l){t.lastIndex=0;for(let re=t.exec(me);re!==null;re=t.exec(me)){let W=b!==void 0?re[b]??"":re[0],q=g!==null?G1(g,re):W,fe=a?`${a}:`:"";m&&(fe+=`${T+re.index}:`),s&&(fe+=`${L+1}:`),h&&(fe+=`${re.index+1}:`),N.push(fe+q),re[0].length===0&&t.lastIndex++}}else if(d){t.lastIndex=0;for(let re=t.exec(me);re!==null;re=t.exec(me)){let W=a?`${a}:`:"";m&&(W+=`${T+re.index}:`),s&&(W+=`${L+1}:`),h&&(W+=`${re.index+1}:`),N.push(W+me),re[0].length===0&&t.lastIndex++}}else{t.lastIndex=0;let re=t.exec(me),W=re?re.index+1:1,q=me;g!==null&&(t.lastIndex=0,q=t.replace(me,(...ie)=>{if(ie[0].length===0)return"";let G=ie,Oe=ie[ie.length-1];return typeof Oe=="object"&&Oe!==null?(G.groups=Oe,G.input=ie[ie.length-2],G.index=ie[ie.length-3]):(G.input=ie[ie.length-1],G.index=ie[ie.length-2]),G1(g,G)}));let fe=a?`${a}:`:"";m&&(fe+=`${T+(re?re.index:0)}:`),s&&(fe+=`${L+1}:`),h&&(fe+=`${W}:`),N.push(fe+q)}T+=me.length+1}return{output:N.length>0?`${N.join(`
|
|
182
|
+
`)}
|
|
183
|
+
`:"",matched:R,matchCount:I}}if(y){let N=[],R=!1,I=0;for(let T=0;T<$;T++){let L=x[T];t.lastIndex=0;let ue=t.test(L)!==r;ue&&(R=!0,I++);let re=ue?":":"-",W=a?`${a}${re}`:"";s&&(W+=`${T+1}${re}`),N.push(W+L)}return{output:N.length>0?`${N.join(`
|
|
184
|
+
`)}
|
|
185
|
+
`:"",matched:R,matchCount:I}}let O=[],F=0,P=new Set,M=-1,C=[];for(let N=0;N<$&&!(f>0&&F>=f);N++)t.lastIndex=0,t.test(x[N])!==r&&(C.push(N),F++);for(let N of C){let R=Math.max(0,N-c);M>=0&&R>M+1&&O.push(p);for(let T=R;T<N;T++)if(!P.has(T)){P.add(T),M=T;let L=x[T];s&&(L=`${T+1}-${L}`),a&&(L=`${a}-${L}`),O.push(L)}if(!P.has(N)){P.add(N),M=N;let T=x[N];if(l){t.lastIndex=0;for(let L=t.exec(T);L!==null;L=t.exec(T)){let me=b!==void 0?L[b]??"":L[0],ue=g!==null?g:me,re=a?`${a}:`:"";s&&(re+=`${N+1}:`),h&&(re+=`${L.index+1}:`),O.push(re+ue),L[0].length===0&&t.lastIndex++}}else{let L=T;s&&(L=`${N+1}:${L}`),a&&(L=`${a}:${L}`),O.push(L)}}let I=Math.min($-1,N+u);for(let T=N+1;T<=I;T++)if(!P.has(T)){P.add(T),M=T;let L=x[T];s&&(L=`${T+1}-${L}`),a&&(L=`${a}-${L}`),O.push(L)}}return{output:O.length>0?`${O.join(`
|
|
186
|
+
`)}
|
|
187
|
+
`:"",matched:F>0,matchCount:F}}function g3(e,t,n){let{invertMatch:r,showLineNumbers:s,countOnly:i,countMatches:o,filename:a,onlyMatching:l,beforeContext:c,afterContext:u,maxCount:f,contextSeparator:p,showColumn:h,showByteOffset:d,replace:m,kResetGroup:g}=n,y=e.split(`
|
|
188
|
+
`),w=y.length,b=w>0&&y[w-1]===""?w-1:w,x=[0];for(let C=0;C<e.length;C++)e[C]===`
|
|
189
|
+
`&&x.push(C+1);let A=C=>{let N=0;for(let R=0;R<x.length&&!(x[R]>C);R++)N=R;return N},$=C=>{let N=A(C);return C-x[N]+1},O=[];t.lastIndex=0;for(let C=t.exec(e);C!==null&&!(f>0&&O.length>=f);C=t.exec(e)){let N=A(C.index),R=A(C.index+Math.max(0,C[0].length-1)),I=g!==void 0?C[g]??"":C[0];O.push({startLine:N,endLine:R,byteOffset:C.index,column:$(C.index),matchText:I}),C[0].length===0&&t.lastIndex++}if(i||o){let C;if(o)C=r?0:O.length;else{let R=new Set;for(let I of O)for(let T=I.startLine;T<=I.endLine;T++)R.add(T);C=r?b-R.size:R.size}return{output:`${a?`${a}:${C}`:String(C)}
|
|
190
|
+
`,matched:C>0,matchCount:C}}if(r){let C=new Set;for(let R of O)for(let I=R.startLine;I<=R.endLine;I++)C.add(I);let N=[];for(let R=0;R<b;R++)if(!C.has(R)){let I=y[R];s&&(I=`${R+1}:${I}`),a&&(I=`${a}:${I}`),N.push(I)}return{output:N.length>0?`${N.join(`
|
|
191
|
+
`)}
|
|
192
|
+
`:"",matched:N.length>0,matchCount:N.length}}if(O.length===0)return{output:"",matched:!1,matchCount:0};let F=new Set,P=-1,M=[];for(let C of O){let N=Math.max(0,C.startLine-c),R=Math.min(b-1,C.endLine+u);P>=0&&N>P+1&&M.push(p);for(let I=N;I<C.startLine;I++)if(!F.has(I)){F.add(I),P=I;let T=y[I];s&&(T=`${I+1}-${T}`),a&&(T=`${a}-${T}`),M.push(T)}if(l){let I=m!==null?m:C.matchText,T=a?`${a}:`:"";d&&(T+=`${C.byteOffset}:`),s&&(T+=`${C.startLine+1}:`),h&&(T+=`${C.column}:`),M.push(T+I);for(let L=C.startLine;L<=C.endLine;L++)F.add(L),P=L}else for(let I=C.startLine;I<=C.endLine&&I<b;I++)if(!F.has(I)){F.add(I),P=I;let T=y[I];m!==null&&I===C.startLine&&(t.lastIndex=0,T=t.replace(T,m));let L=a?`${a}:`:"";d&&I===C.startLine&&(L+=`${C.byteOffset}:`),s&&(L+=`${I+1}:`),h&&I===C.startLine&&(L+=`${C.column}:`),M.push(L+T)}for(let I=C.endLine+1;I<=R;I++)if(!F.has(I)){F.add(I),P=I;let T=y[I];s&&(T=`${I+1}-${T}`),a&&(T=`${a}-${T}`),M.push(T)}}return{output:M.length>0?`${M.join(`
|
|
193
|
+
`)}
|
|
194
|
+
`:"",matched:!0,matchCount:O.length}}var V1=v(()=>{"use strict"});function q1(e){let t="",n=0;for(;n<e.length;){if(e.slice(n,n+7)==="[[:<:]]"){t+="\\b",n+=7;continue}if(e.slice(n,n+7)==="[[:>:]]"){t+="\\b",n+=7;continue}if(e[n]==="["){let r="[";for(n++,n<e.length&&(e[n]==="^"||e[n]==="!")&&(r+="^",n++),n<e.length&&e[n]==="]"&&(r+="\\]",n++);n<e.length&&e[n]!=="]";){if(e[n]==="["&&n+1<e.length&&e[n+1]===":"){let s=e.indexOf(":]",n+2);if(s!==-1){let i=e.slice(n+2,s),o=y3.get(i);if(o){r+=o,n=s+2;continue}}}if(e[n]==="\\"&&n+1<e.length){r+=e[n]+e[n+1],n+=2;continue}r+=e[n],n++}n<e.length&&e[n]==="]"&&(r+="]",n++),t+=r;continue}if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++}return t}function qs(e,t){let n,r;switch(t.mode){case"fixed":n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(n=q1(e),n=n.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),t.mode==="perl"){n=w3(n),n=b3(n),n=x3(n);let o=C3(n);n=o.pattern,r=o.kResetGroup}break}default:n=q1(e),n=N3(n);break}t.wholeWord&&(n=`\\b(?:${n})\\b`),t.lineRegexp&&(n=`^${n}$`);let s=/\\u\{[0-9A-Fa-f]+\}/.test(n),i="g"+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.multilineDotall?"s":"")+(s?"u":"");return{regex:K(n,i),kResetGroup:r}}function w3(e){let t="",n=0;for(;n<e.length;)if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="Q"){n+=2;let r="";for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="E"){n+=2;break}r+=e[n],n++}t+=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else t+=e[n],n++;return t}function b3(e){return e.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function x3(e){let t="",n=0;for(;n<e.length;){if(e[n]==="("&&n+1<e.length&&e[n+1]==="?"){let r=e.slice(n).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(r){let s=r[1]||"",i=r[2]||"",o=r[3];if(o===":"){let a=n+r[0].length-1,l=E3(e,n);if(l!==-1){let c=e.slice(a+1,l),u=A3(c,s,i);t+=`(?:${u})`,n=l+1;continue}}else if(o===")"||o===""){n+=r[0].length;continue}}}t+=e[n],n++}return t}function E3(e,t){let n=0,r=t;for(;r<e.length;){if(e[r]==="\\"){r+=2;continue}if(e[r]==="["){for(r++;r<e.length&&e[r]!=="]";)e[r]==="\\"&&r++,r++;r++;continue}if(e[r]==="(")n++;else if(e[r]===")"&&(n--,n===0))return r;r++}return-1}function A3(e,t,n){let r=e;return t.includes("i")&&(r=S3(r)),r}function S3(e){let t="",n=0;for(;n<e.length;){let r=e[n];if(r==="\\"){n+1<e.length?(t+=r+e[n+1],n+=2):(t+=r,n++);continue}if(r==="["){t+=r,n++,n<e.length&&e[n]==="^"&&(t+=e[n],n++);let s=[];for(;n<e.length&&e[n]!=="]";)if(e[n]==="\\")s.push(e[n]),n++,n<e.length&&(s.push(e[n]),n++);else if(e[n]==="-"&&s.length>0&&n+1<e.length&&e[n+1]!=="]"){let i=s[s.length-1],o=e[n+1];s.push("-"),s.push(o),/[a-z]/.test(i)&&/[a-z]/.test(o)?(s.push(i.toUpperCase()),s.push("-"),s.push(o.toUpperCase())):/[A-Z]/.test(i)&&/[A-Z]/.test(o)&&(s.push(i.toLowerCase()),s.push("-"),s.push(o.toLowerCase())),n+=2}else{let i=e[n];if(s.push(i),/[a-zA-Z]/.test(i)){let o=i===i.toLowerCase()?i.toUpperCase():i.toLowerCase();s.includes(o)||s.push(o)}n++}t+=s.join(""),n<e.length&&(t+=e[n],n++);continue}if(/[a-zA-Z]/.test(r)){let s=r.toLowerCase(),i=r.toUpperCase();t+=`[${i}${s}]`}else t+=r;n++}return t}function C3(e){let t=v3(e);if(t===-1)return{pattern:e};let n=e.slice(0,t),r=e.slice(t+2),s=k3(n);return{pattern:`(?:${n})(${r})`,kResetGroup:s+1}}function v3(e){let t=0;for(;t<e.length-1;)if(e[t]==="\\"){if(e[t+1]==="K"){let n=0,r=t-1;for(;r>=0&&e[r]==="\\";)n++,r--;if(n%2===0)return t}t+=2}else t++;return-1}function k3(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"){n+=2;continue}if(e[n]==="["){for(n++;n<e.length&&e[n]!=="]";)e[n]==="\\"&&n++,n++;n++;continue}if(e[n]==="(")if(n+1<e.length&&e[n+1]==="?"){if(n+2<e.length){let r=e[n+2];if(r===":"||r==="="||r==="!"){n++;continue}if(r==="<"&&n+3<e.length){let s=e[n+3];if(s==="="||s==="!"){n++;continue}t++,n++;continue}}}else t++;n++}return t}function ll(e){let t=e.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return t=t.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),t=t.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),t}function N3(e){let t="",n=0,r=!0,s=0;for(;n<e.length;){let i=e[n];if(i==="["){for(t+=i,n++,n<e.length&&(e[n]==="^"||e[n]==="!")&&(t+=e[n],n++),n<e.length&&e[n]==="]"&&(t+=e[n],n++);n<e.length&&e[n]!=="]";)e[n]==="\\"&&n+1<e.length?(t+=e[n]+e[n+1],n+=2):(t+=e[n],n++);n<e.length&&e[n]==="]"&&(t+=e[n],n++),r=!1;continue}if(i==="\\"&&n+1<e.length){let o=e[n+1];if(o==="|"){t+="|",n+=2,r=!0;continue}if(o==="("){t+="(",n+=2,s++,r=!0;continue}if(o===")"){t+=")",n+=2,s=Math.max(0,s-1),r=!1;continue}if(o==="{"){let l=e.slice(n).match(/^\\{(\d+)(,(\d*)?)?\\}/);if(l){let c=l[1],u=l[2]!==void 0,f=l[3]||"";u?t+=`{${c},${f}}`:t+=`{${c}}`,n+=l[0].length,r=!1;continue}t+="\\{",n+=2,r=!1;continue}if(o==="}"){t+="\\}",n+=2,r=!1;continue}t+=i+o,n+=2,r=!1;continue}if(i==="*"&&r){t+="\\*",n++;continue}if(i==="^"){if(r){t+="^",n++;continue}t+="\\^",n++;continue}if(i==="$"){let o=n===e.length-1,a=n+2<e.length&&e[n+1]==="\\"&&e[n+2]===")";o||a?t+="$":t+="\\$",n++,r=!1;continue}i==="+"||i==="?"||i==="|"||i==="("||i===")"||i==="{"||i==="}"?t+=`\\${i}`:t+=i,n++,r=!1}return t}var y3,Z1=v(()=>{"use strict";Ve();y3=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]])});var cl=v(()=>{"use strict";V1();Z1()});var ji={};J(ji,{egrepCommand:()=>R3,egrepFlagsForFuzzing:()=>D3,fgrepCommand:()=>O3,fgrepFlagsForFuzzing:()=>P3,flagsForFuzzing:()=>T3,grepCommand:()=>ul});async function Q1(e,t,n,r,s=0){if(s>=K1)return;let i=n.fs.resolvePath(n.cwd,e);try{if(!(await n.fs.stat(i)).isDirectory){let l=e.split("/").pop()||"";if(t){let c=t.replace(/^\//,"");Rt(l,c,{stripQuotes:!0})&&r.push(e)}return}let a=await n.fs.readdir(i);for(let l of a){let c=e==="."?l:`${e}/${l}`,u=n.fs.resolvePath(n.cwd,c);if((await n.fs.stat(u)).isDirectory)await Q1(c,t,n,r,s+1);else if(t){let p=t.replace(/^\//,"");Rt(l,p,{stripQuotes:!0})&&r.push(c)}}}catch{}}async function $3(e,t){let n=[],r=e.lastIndexOf("/"),s,i;if(r===-1?(s=t.cwd,i=e):(s=e.slice(0,r)||"/",i=e.slice(r+1)),e.includes("**")){let a=[],l=e.split("**"),c=l[0].replace(/\/$/,"")||".",u=l[1]||"";return await Q1(c,u,t,a),a.map(f=>({path:f}))}let o=t.fs.resolvePath(t.cwd,s);try{if(t.fs.readdirWithFileTypes){let a=await t.fs.readdirWithFileTypes(o);for(let l of a)if(Rt(l.name,i,{stripQuotes:!0})){let c=r===-1?l.name:`${s}/${l.name}`;n.push({path:c,isFile:l.isFile})}}else{let a=await t.fs.readdir(o);for(let l of a)if(Rt(l,i,{stripQuotes:!0})){let c=r===-1?l:`${s}/${l}`;n.push({path:c})}}}catch{}return n.sort((a,l)=>a.path.localeCompare(l.path))}async function Hi(e,t,n=[],r=[],s=[],i,o=0){if(o>=K1)return[];let a=t.fs.resolvePath(t.cwd,e),l=[];try{let c,u;if(i!==void 0)c=i,u=!i;else{let p=await t.fs.stat(a);c=p.isFile,u=p.isDirectory}if(c){let p=e.split("/").pop()||e;return r.length>0&&r.some(h=>Rt(p,h,{stripQuotes:!0}))?[]:n.length>0&&!n.some(h=>Rt(p,h,{stripQuotes:!0}))?[]:[{path:e,isFile:!0}]}if(!u)return[];let f=e.split("/").pop()||e;if(s.length>0&&s.some(p=>Rt(f,p,{stripQuotes:!0})))return[];if(t.fs.readdirWithFileTypes){let p=await t.fs.readdirWithFileTypes(a);for(let h of p){if(h.name.startsWith("."))continue;let d=e==="."?h.name:`${e}/${h.name}`,m=await Hi(d,t,n,r,s,h.isFile,o+1);l.push(...m)}}else{let p=await t.fs.readdir(a);for(let h of p){if(h.startsWith("."))continue;let d=e==="."?h:`${e}/${h}`,m=await Hi(d,t,n,r,s,void 0,o+1);l.push(...m)}}}catch{}return l}var I3,ul,K1,O3,R3,T3,P3,D3,Gi=v(()=>{"use strict";al();ne();cl();I3={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},ul={name:"grep",async execute(e,t){if(B(e))return U(I3);let n=!1,r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1,u=!1,f=!1,p=!1,h=!1,d=!1,m=!1,g=!1,y=0,w=0,b=0,x=[],A=[],$=[],O=null,F=[];for(let W=0;W<e.length;W++){let q=e[W];if(q.startsWith("-")&&q!=="-"){if(q==="-e"&&W+1<e.length){O=e[++W];continue}if(q.startsWith("--include=")){x.push(q.slice(10));continue}if(q.startsWith("--exclude=")){A.push(q.slice(10));continue}if(q.startsWith("--exclude-dir=")){$.push(q.slice(14));continue}if(q.startsWith("--max-count=")){y=parseInt(q.slice(12),10);continue}let fe=q.match(/^-m(\d+)$/);if(fe){y=parseInt(fe[1],10);continue}if(q==="-m"&&W+1<e.length){y=parseInt(e[++W],10);continue}let ie=q.match(/^-([ABC])(\d+)$/);if(ie){let G=parseInt(ie[2],10);ie[1]==="A"?b=G:ie[1]==="B"?w=G:ie[1]==="C"&&(w=G,b=G);continue}if((q==="-A"||q==="-B"||q==="-C")&&W+1<e.length){let G=parseInt(e[++W],10);q==="-A"?b=G:q==="-B"?w=G:(w=G,b=G);continue}let ke=q.startsWith("--")?[q]:q.slice(1).split("");for(let G of ke)if(G==="i"||G==="--ignore-case")n=!0;else if(G==="n"||G==="--line-number")r=!0;else if(G==="v"||G==="--invert-match")s=!0;else if(G==="c"||G==="--count")i=!0;else if(G==="l"||G==="--files-with-matches")o=!0;else if(G==="L"||G==="--files-without-match")a=!0;else if(G==="r"||G==="R"||G==="--recursive")l=!0;else if(G==="w"||G==="--word-regexp")c=!0;else if(G==="x"||G==="--line-regexp")u=!0;else if(G==="E"||G==="--extended-regexp")f=!0;else if(G==="P"||G==="--perl-regexp")p=!0;else if(G==="F"||G==="--fixed-strings")h=!0;else if(G==="o"||G==="--only-matching")d=!0;else if(G==="h"||G==="--no-filename")m=!0;else if(G==="q"||G==="--quiet"||G==="--silent")g=!0;else{if(G.startsWith("--"))return Z("grep",G);if(G.length===1)return Z("grep",`-${G}`)}}else O===null?O=q:F.push(q)}if(O===null)return{stdout:"",stderr:`grep: missing pattern
|
|
195
|
+
`,exitCode:2};let P=h?"fixed":f?"extended":p?"perl":"basic",M,C;try{let W=qs(O,{mode:P,ignoreCase:n,wholeWord:c,lineRegexp:u});M=W.regex,C=W.kResetGroup}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${O}
|
|
196
|
+
`,exitCode:2}}if(F.length===0&&t.stdin!==void 0){let W=is(t.stdin,M,{invertMatch:s,showLineNumbers:r,countOnly:i,filename:"",onlyMatching:d,beforeContext:w,afterContext:b,maxCount:y,kResetGroup:C});return g?{stdout:"",stderr:"",exitCode:W.matched?0:1}:{stdout:W.output,stderr:"",exitCode:W.matched?0:1}}if(F.length===0)return{stdout:"",stderr:`grep: no input files
|
|
197
|
+
`,exitCode:2};let N="",R="",I=!1,T=!1,L=[];for(let W of F)if(W.includes("*")||W.includes("?")||W.includes("[")){let q=await $3(W,t);if(l)for(let fe of q){let ie=await Hi(fe.path,t,x,A,$,fe.isFile);L.push(...ie)}else L.push(...q)}else if(l){let q=await Hi(W,t,x,A,$);L.push(...q)}else L.push({path:W});let me=(L.length>1||l)&&!m,ue=50;for(let W=0;W<L.length;W+=ue){let q=L.slice(W,W+ue),fe=await Promise.all(q.map(async ie=>{let ke=ie.path,G=ke.split("/").pop()||ke;if(A.length>0&&!l&&A.some(Oe=>Rt(G,Oe,{stripQuotes:!0}))||x.length>0&&!l&&!x.some(Oe=>Rt(G,Oe,{stripQuotes:!0})))return null;try{let Oe=t.fs.resolvePath(t.cwd,ke),Ge=!1;if(ie.isFile===void 0?Ge=(await t.fs.stat(Oe)).isDirectory:Ge=!ie.isFile,Ge)return l?null:{error:`grep: ${ke}: Is a directory
|
|
198
|
+
`};let et=await t.fs.readFile(Oe),ct=is(et,M,{invertMatch:s,showLineNumbers:r,countOnly:i,filename:me?ke:"",onlyMatching:d,beforeContext:w,afterContext:b,maxCount:y,kResetGroup:C});return{file:ke,result:ct}}catch{return{error:`grep: ${ke}: No such file or directory
|
|
199
|
+
`}}}));for(let ie of fe){if(ie===null)continue;if("error"in ie&&ie.error){R+=ie.error,ie.error.includes("Is a directory")||(T=!0);continue}if(!("file"in ie)||!ie.result)continue;let{file:ke,result:G}=ie;if(G.matched){if(I=!0,g)return{stdout:"",stderr:"",exitCode:0};o?N+=`${ke}
|
|
200
|
+
`:a||(N+=G.output)}else a?N+=`${ke}
|
|
201
|
+
`:i&&!o&&(N+=G.output)}}let re;return T?re=2:a?re=N.length>0?0:1:re=I?0:1,g?{stdout:"",stderr:"",exitCode:re}:{stdout:N,stderr:R,exitCode:re}}},K1=256;O3={name:"fgrep",async execute(e,t){return ul.execute(["-F",...e],t)}},R3={name:"egrep",async execute(e,t){return ul.execute(["-E",...e],t)}},T3={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},P3={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},D3={name:"egrep",flags:[],stdinType:"text",needsArgs:!0}});function Y1(e,t){if(Array.isArray(e))throw new TypeError(`${t}: expected object, got array`);if(Object.getPrototypeOf(e)!==null)throw new TypeError(`${t}: expected null-prototype object, got prototypal object`)}function Te(e){return!X1.has(e)}function Ue(e,t,n){Y1(e,"safeSet"),Te(t)&&(e[t]=n)}function _n(e,t){return Y1(e,"safeHasOwn"),Object.hasOwn(e,t)}function os(e){let t=new WeakMap,n=r=>{if(r===null||typeof r!="object"||r instanceof Date)return r;let s=t.get(r);if(s!==void 0)return s;if(Array.isArray(r)){let o=[];t.set(r,o);for(let a of r)o.push(n(a));return o}let i=Object.create(null);t.set(r,i);for(let o of Object.keys(r))i[o]=n(r[o]);return i};return n(e)}function ze(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function J1(e){return Object.assign(Object.create(null),e)}function mt(e){return Object.assign(Object.create(null),e)}function fl(...e){return Object.assign(Object.create(null),...e)}var X1,Zk,bn=v(()=>{"use strict";X1=new Set(["__proto__","constructor","prototype"]),Zk=new Set([...X1,"__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])});function tp(){let e=[];for(let[t,n]of Object.entries(ep).sort()){let r=[];for(let s of n.extensions)r.push(`*${s}`);for(let s of n.globs)r.push(s);e.push(`${t}: ${r.join(", ")}`)}return`${e.join(`
|
|
202
|
+
`)}
|
|
203
|
+
`}var ep,Zs,pl=v(()=>{"use strict";Ve();bn();ep=J1({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),Zs=class{types;constructor(){this.types=new Map(Object.entries(ep).map(([t,n])=>[t,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(t){let n=t.indexOf(":");if(n===-1)return;let r=t.slice(0,n),s=t.slice(n+1);if(s.startsWith("include:")){let i=s.slice(8),o=this.types.get(i);if(o){let a=this.types.get(r)||{extensions:[],globs:[]};a.extensions.push(...o.extensions),a.globs.push(...o.globs),this.types.set(r,a)}}else{let i=this.types.get(r)||{extensions:[],globs:[]};if(s.startsWith("*.")&&!s.slice(2).includes("*")){let o=s.slice(1);i.extensions.includes(o)||i.extensions.push(o)}else i.globs.includes(s)||i.globs.push(s);this.types.set(r,i)}}clearType(t){let n=this.types.get(t);n&&(n.extensions=[],n.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,n){let r=t.toLowerCase();for(let s of n){if(s==="all"){if(this.matchesAnyType(t))return!0;continue}let i=this.types.get(s);if(i){for(let o of i.extensions)if(r.endsWith(o))return!0;for(let o of i.globs)if(o.includes("*")){let a=o.replace(/\./g,"\\.").replace(/\*/g,".*");if(K(`^${a}$`,"i").test(t))return!0}else if(r===o.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let r of this.types.values()){for(let s of r.extensions)if(n.endsWith(s))return!0;for(let s of r.globs)if(s.includes("*")){let i=s.replace(/\./g,"\\.").replace(/\*/g,".*");if(K(`^${i}$`,"i").test(t))return!0}else if(n===s.toLowerCase())return!0}return!1}}});function np(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}var rp=v(()=>{"use strict"});function _3(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return n*1024;case"M":return n*1024*1024;case"G":return n*1024*1024*1024;default:return n}}function F3(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
|
|
204
|
+
`,exitCode:1}}function sp(e){return null}function U3(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function B3(e,t,n){let r=e[t];for(let s of ip){if(r.startsWith(`--${s.long}=`)){let i=r.slice(`--${s.long}=`.length),o=Vi(n,s,i);return o?{newIndex:t,error:o}:{newIndex:t}}if(s.short&&r.startsWith(`-${s.short}`)&&r.length>2){let i=r.slice(2),o=Vi(n,s,i);return o?{newIndex:t,error:o}:{newIndex:t}}if(s.short&&r===`-${s.short}`||r===`--${s.long}`){if(t+1>=e.length)return null;let i=e[t+1],o=Vi(n,s,i);return o?{newIndex:t+1,error:o}:{newIndex:t+1}}}return null}function W3(e){return ip.find(t=>t.short===e)}function Vi(e,t,n){if(t.validate){let s=t.validate(n);if(s)return s}let r=t.parse?t.parse(n):n;t.multi?e[t.target].push(r):e[t.target]=r}function z3(e,t){let n=e[t];if(n==="--sort"&&t+1<e.length){let r=e[t+1];if(r==="path"||r==="none")return{value:r,newIndex:t+1}}if(n.startsWith("--sort=")){let r=n.slice(7);if(r==="path"||r==="none")return{value:r,newIndex:t}}return null}function H3(e,t){let n=e[t],r=n.match(/^-([ABC])(\d+)$/);return r?{flag:r[1],value:parseInt(r[2],10),newIndex:t}:(n==="-A"||n==="-B"||n==="-C")&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function j3(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function op(e){let t=np(),n=null,r=[],s=-1,i=-1,o=-1,a=!1;for(let l=0;l<e.length;l++){let c=e[l];if(c.startsWith("-")&&c!=="-"){let u=H3(e,l);if(u){let{flag:g,value:y,newIndex:w}=u;g==="A"?s=Math.max(s,y):g==="B"?i=Math.max(i,y):o=y,l=w;continue}let f=j3(c);if(f!==null){t.maxCount=f;continue}let p=B3(e,l,t);if(p){if(p.error)return{success:!1,error:p.error};l=p.newIndex;continue}let h=z3(e,l);if(h){t.sort=h.value,l=h.newIndex;continue}let d=c.startsWith("--")?[c]:c.slice(1).split(""),m=!1;for(let g of d){if(M3.has(g)){t.lineNumber=!0,a=!0;continue}if(g==="u"||g==="--unrestricted"){U3(t);continue}if(g==="P"||g==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
|
|
205
|
+
`,exitCode:1}};if(g.length===1){let w=W3(g);if(w){if(l+1>=e.length)return{success:!1,error:Z("rg",`-${g}`)};let b=Vi(t,w,e[l+1]);if(b)return{success:!1,error:b};l++,m=!0;continue}}let y=L3.get(g);if(y){y(t);continue}if(g.startsWith("--"))return{success:!1,error:Z("rg",g)};if(g.length===1)return{success:!1,error:Z("rg",`-${g}`)}}}else n===null&&t.patterns.length===0&&t.patternFiles.length===0?n=c:r.push(c)}return(s>=0||o>=0)&&(t.afterContext=Math.max(s>=0?s:0,o>=0?o:0)),(i>=0||o>=0)&&(t.beforeContext=Math.max(i>=0?i:0,o>=0?o:0)),n!==null&&t.patterns.push(n),(t.column||t.vimgrep)&&(a=!0),{success:!0,options:t,paths:r,explicitLineNumbers:a}}var ip,L3,M3,ap=v(()=>{"use strict";ne();rp();ip=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:sp},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:sp},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:_3,validate:F3},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",target:"maxDepth",parse:()=>1/0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],L3=new Map([["i",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["--ignore-case",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["s",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["--case-sensitive",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["S",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["--smart-case",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["F",e=>{e.fixedStrings=!0}],["--fixed-strings",e=>{e.fixedStrings=!0}],["w",e=>{e.wordRegexp=!0}],["--word-regexp",e=>{e.wordRegexp=!0}],["x",e=>{e.lineRegexp=!0}],["--line-regexp",e=>{e.lineRegexp=!0}],["v",e=>{e.invertMatch=!0}],["--invert-match",e=>{e.invertMatch=!0}],["U",e=>{e.multiline=!0}],["--multiline",e=>{e.multiline=!0}],["--multiline-dotall",e=>{e.multilineDotall=!0,e.multiline=!0}],["c",e=>{e.count=!0}],["--count",e=>{e.count=!0}],["--count-matches",e=>{e.countMatches=!0}],["l",e=>{e.filesWithMatches=!0}],["--files",e=>{e.files=!0}],["--files-with-matches",e=>{e.filesWithMatches=!0}],["--files-without-match",e=>{e.filesWithoutMatch=!0}],["--stats",e=>{e.stats=!0}],["o",e=>{e.onlyMatching=!0}],["--only-matching",e=>{e.onlyMatching=!0}],["q",e=>{e.quiet=!0}],["--quiet",e=>{e.quiet=!0}],["N",e=>{e.lineNumber=!1}],["--no-line-number",e=>{e.lineNumber=!1}],["H",e=>{e.withFilename=!0}],["--with-filename",e=>{e.withFilename=!0}],["I",e=>{e.noFilename=!0}],["--no-filename",e=>{e.noFilename=!0}],["0",e=>{e.nullSeparator=!0}],["--null",e=>{e.nullSeparator=!0}],["b",e=>{e.byteOffset=!0}],["--byte-offset",e=>{e.byteOffset=!0}],["--column",e=>{e.column=!0,e.lineNumber=!0}],["--no-column",e=>{e.column=!1}],["--vimgrep",e=>{e.vimgrep=!0,e.column=!0,e.lineNumber=!0}],["--json",e=>{e.json=!0}],["--hidden",e=>{e.hidden=!0}],["--no-ignore",e=>{e.noIgnore=!0}],["--no-ignore-dot",e=>{e.noIgnoreDot=!0}],["--no-ignore-vcs",e=>{e.noIgnoreVcs=!0}],["L",e=>{e.followSymlinks=!0}],["--follow",e=>{e.followSymlinks=!0}],["z",e=>{e.searchZip=!0}],["--search-zip",e=>{e.searchZip=!0}],["a",e=>{e.searchBinary=!0}],["--text",e=>{e.searchBinary=!0}],["--heading",e=>{e.heading=!0}],["--passthru",e=>{e.passthru=!0}],["--include-zero",e=>{e.includeZero=!0}],["--glob-case-insensitive",e=>{e.globCaseInsensitive=!0}]]),M3=new Set(["n","--line-number"])});function G3(e){return`'${e.replace(/'/g,"'\\''")}'`}function tn(e){return e.map(G3).join(" ")}var Nr=v(()=>{"use strict"});async function hl(e,t,n=!1,r=!1,s=[]){let i=new Qs(e,t,n,r);await i.load(t);for(let o of s)try{let a=e.resolvePath(t,o),l=await e.readFile(a);i.addPatternsFromContent(l,t)}catch{}return i}var Ks,Qs,lp=v(()=>{"use strict";Ve();Ks=class{patterns=[];basePath;constructor(t="/"){this.basePath=t}parse(t){let n=t.split(`
|
|
206
|
+
`);for(let r of n){let s=r.replace(/\s+$/,"");if(!s||s.startsWith("#"))continue;let i=!1;s.startsWith("!")&&(i=!0,s=s.slice(1));let o=!1;s.endsWith("/")&&(o=!0,s=s.slice(0,-1));let a=!1;s.startsWith("/")?(a=!0,s=s.slice(1)):s.includes("/")&&!s.startsWith("**/")&&(a=!0);let l=this.patternToRegex(s,a);this.patterns.push({pattern:r,regex:l,negated:i,directoryOnly:o,rooted:a})}}patternToRegex(t,n){let r="";n?r="^":r="(?:^|/)";let s=0;for(;s<t.length;){let i=t[s];if(i==="*")t[s+1]==="*"?t[s+2]==="/"?(r+="(?:.*/)?",s+=3):(s+2>=t.length,r+=".*",s+=2):(r+="[^/]*",s++);else if(i==="?")r+="[^/]",s++;else if(i==="["){let o=s+1;for(o<t.length&&t[o]==="!"&&o++,o<t.length&&t[o]==="]"&&o++;o<t.length&&t[o]!=="]";)o++;if(o<t.length){let a=t.slice(s,o+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),r+=a,s=o+1}else r+="\\[",s++}else i==="/"?(r+="/",s++):(r+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s++)}return r+="(?:/.*)?$",K(r)}matches(t,n){let r=t.replace(/^\.\//,"");r=r.replace(/^\//,"");let s=!1;for(let i of this.patterns)i.directoryOnly&&!n||i.regex.test(r)&&(s=!i.negated);return s}isWhitelisted(t,n){let r=t.replace(/^\.\//,"");r=r.replace(/^\//,"");for(let s of this.patterns)if(!(s.directoryOnly&&!n)&&s.negated&&s.regex.test(r))return!0;return!1}getBasePath(){return this.basePath}},Qs=class{parsers=[];fs;skipDotIgnore;skipVcsIgnore;loadedDirs=new Set;constructor(t,n,r=!1,s=!1){this.fs=t,this.skipDotIgnore=r,this.skipVcsIgnore=s}async load(t){let n=[],r=t;for(;;){n.unshift(r);let i=this.fs.resolvePath(r,"..");if(i===r)break;r=i}let s=[];this.skipVcsIgnore||s.push(".gitignore"),this.skipDotIgnore||s.push(".rgignore",".ignore");for(let i of n){this.loadedDirs.add(i);for(let o of s){let a=this.fs.resolvePath(i,o);try{let l=await this.fs.readFile(a),c=new Ks(i);c.parse(l),this.parsers.push(c)}catch{}}}}async loadForDirectory(t){if(this.loadedDirs.has(t))return;this.loadedDirs.add(t);let n=[];this.skipVcsIgnore||n.push(".gitignore"),this.skipDotIgnore||n.push(".rgignore",".ignore");for(let r of n){let s=this.fs.resolvePath(t,r);try{let i=await this.fs.readFile(s),o=new Ks(t);o.parse(i),this.parsers.push(o)}catch{}}}addPatternsFromContent(t,n){let r=new Ks(n);r.parse(t),this.parsers.push(r)}matches(t,n){for(let r of this.parsers){let s=r.getBasePath();if(!t.startsWith(s))continue;let i=t.slice(s.length).replace(/^\//,"");if(r.matches(i,n))return!0}return!1}isWhitelisted(t,n){for(let r of this.parsers){let s=r.getBasePath();if(!t.startsWith(s))continue;let i=t.slice(s.length).replace(/^\//,"");if(r.isWhitelisted(i,n))return!0}return!1}static isCommonIgnored(t){return new Set(["node_modules",".git",".svn",".hg","__pycache__",".pytest_cache",".mypy_cache","venv",".venv",".next",".nuxt",".cargo"]).has(t)}}});import{gunzipSync as V3}from"node:zlib";function q3(e){return e.length>=2&&e[0]===31&&e[1]===139}function Z3(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r==="["&&!t?t=!0:r==="]"&&t&&(t=!1)}return t?`rg: glob '${e}' has an unclosed character class`:null}async function cp(e){let{ctx:t,options:n,paths:r,explicitLineNumbers:s}=e;for(let g of n.globs){let y=g.startsWith("!")?g.slice(1):g,w=Z3(y);if(w)return{stdout:"",stderr:`${w}
|
|
207
|
+
`,exitCode:1}}if(n.files){let g=[...n.patterns,...r];return X3(t,g,n)}let i=[...n.patterns];for(let g of n.patternFiles)try{let y;if(g==="-")y=t.stdin;else{let b=t.fs.resolvePath(t.cwd,g);y=await t.fs.readFile(b)}let w=y.split(`
|
|
208
|
+
`).filter(b=>b.length>0);i.push(...w)}catch{return{stdout:"",stderr:`rg: ${g}: No such file or directory
|
|
209
|
+
`,exitCode:2}}if(i.length===0)return n.patternFiles.length>0?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`rg: no pattern given
|
|
210
|
+
`,exitCode:2};let o=r.length===0?["."]:r,a=K3(n,i),l,c;try{let g=Q3(i,n,a);l=g.regex,c=g.kResetGroup}catch{return{stdout:"",stderr:`rg: invalid regex: ${i.join(", ")}
|
|
211
|
+
`,exitCode:2}}let u=null;n.noIgnore||(u=await hl(t.fs,t.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let f=new Zs;for(let g of n.typeClear)f.clearType(g);for(let g of n.typeAdd)f.addType(g);let{files:p,singleExplicitFile:h}=await up(t,o,n,u,f);if(p.length===0)return{stdout:"",stderr:"",exitCode:1};let d=!n.noFilename&&(n.withFilename||!h||p.length>1),m=n.lineNumber;return s||(h&&p.length===1&&(m=!1),n.onlyMatching&&(m=!1)),e8(t,p,l,n,d,m,c)}function K3(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(n=>/[A-Z]/.test(n)):!1}function Q3(e,t,n){let r;return e.length===1?r=e[0]:r=e.map(s=>t.fixedStrings?s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):`(?:${s})`).join("|"),qs(r,{mode:t.fixedStrings&&e.length===1?"fixed":"perl",ignoreCase:n,wholeWord:t.wordRegexp,lineRegexp:t.lineRegexp,multiline:t.multiline,multilineDotall:t.multilineDotall})}async function up(e,t,n,r,s){let i=[],o=0,a=0;for(let c of t){let u=e.fs.resolvePath(e.cwd,c);try{let f=await e.fs.stat(u);if(f.isFile){if(o++,n.maxFilesize>0&&f.size>n.maxFilesize)continue;pp(c,n,r,u,s)&&i.push(c)}else f.isDirectory&&(a++,await fp(e,c,u,0,n,r,s,i))}catch{}}return{files:n.sort==="path"?i.sort():i,singleExplicitFile:o===1&&a===0}}async function fp(e,t,n,r,s,i,o,a){if(!(r>=s.maxDepth)){i&&await i.loadForDirectory(n);try{let l=e.fs.readdirWithFileTypes?await e.fs.readdirWithFileTypes(n):(await e.fs.readdir(n)).map(c=>({name:c,isFile:void 0}));for(let c of l){let u=c.name;if(!s.noIgnore&&Qs.isCommonIgnored(u))continue;let f=u.startsWith("."),p=t==="."?u:t==="./"?`./${u}`:t.endsWith("/")?`${t}${u}`:`${t}/${u}`,h=e.fs.resolvePath(n,u),d,m,g=!1;if(c.isFile!==void 0&&"isDirectory"in c){let b=c;if(g=b.isSymbolicLink===!0,g&&!s.followSymlinks)continue;if(g&&s.followSymlinks)try{let x=await e.fs.stat(h);d=x.isFile,m=x.isDirectory}catch{continue}else d=b.isFile,m=b.isDirectory}else try{let b=e.fs.lstat?await e.fs.lstat(h):await e.fs.stat(h);if(g=b.isSymbolicLink===!0,g&&!s.followSymlinks)continue;let x=g&&s.followSymlinks?await e.fs.stat(h):b;d=x.isFile,m=x.isDirectory}catch{continue}if(!i?.matches(h,m)&&!(f&&!s.hidden&&!i?.isWhitelisted(h,m))){if(m)await fp(e,p,h,r+1,s,i,o,a);else if(d){if(s.maxFilesize>0)try{if((await e.fs.stat(h)).size>s.maxFilesize)continue}catch{continue}pp(p,s,i,h,o)&&a.push(p)}}}}catch{}}}function pp(e,t,n,r,s){let i=e.split("/").pop()||e;if(n?.matches(r,!1)||t.types.length>0&&!s.matchesType(i,t.types)||t.typesNot.length>0&&s.matchesType(i,t.typesNot))return!1;if(t.globs.length>0){let o=t.globCaseInsensitive,a=t.globs.filter(c=>!c.startsWith("!")),l=t.globs.filter(c=>c.startsWith("!")).map(c=>c.slice(1));if(a.length>0){let c=!1;for(let u of a)if(xn(i,u,o)||xn(e,u,o)){c=!0;break}if(!c)return!1}for(let c of l)if(c.startsWith("/")){let u=c.slice(1);if(xn(e,u,o))return!1}else if(xn(i,c,o)||xn(e,c,o))return!1}if(t.iglobs.length>0){let o=t.iglobs.filter(l=>!l.startsWith("!")),a=t.iglobs.filter(l=>l.startsWith("!")).map(l=>l.slice(1));if(o.length>0){let l=!1;for(let c of o)if(xn(i,c,!0)||xn(e,c,!0)){l=!0;break}if(!l)return!1}for(let l of a)if(l.startsWith("/")){let c=l.slice(1);if(xn(e,c,!0))return!1}else if(xn(i,l,!0)||xn(e,l,!0))return!1}return!0}function xn(e,t,n=!1){let r="^";for(let s=0;s<t.length;s++){let i=t[s];if(i==="*")t[s+1]==="*"?(r+=".*",s++):r+="[^/]*";else if(i==="?")r+="[^/]";else if(i==="["){let o=s+1;for(o<t.length&&t[o]==="!"&&o++,o<t.length&&t[o]==="]"&&o++;o<t.length&&t[o]!=="]";)o++;if(o<t.length){let a=t.slice(s,o+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),r+=a,s=o}else r+="\\["}else r+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return r+="$",K(r,n?"i":"").test(e)}async function X3(e,t,n){let r=null;n.noIgnore||(r=await hl(e.fs,e.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let s=new Zs;for(let c of n.typeClear)s.clearType(c);for(let c of n.typeAdd)s.addType(c);let i=t.length===0?["."]:t,{files:o}=await up(e,i,n,r,s);if(o.length===0)return{stdout:"",stderr:"",exitCode:1};if(n.quiet)return{stdout:"",stderr:"",exitCode:0};let a=n.nullSeparator?"\0":`
|
|
212
|
+
`;return{stdout:o.map(c=>c+a).join(""),stderr:"",exitCode:0}}function Y3(e,t){if(t.length===0)return!0;for(let n of t)if(xn(e,n,!1))return!0;return!1}async function J3(e,t,n,r){try{if(r.preprocessor&&e.exec){let o=n.split("/").pop()||n;if(Y3(o,r.preprocessorGlobs)){let a=await e.exec(tn([r.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[t]});if(a.exitCode===0&&a.stdout){let l=a.stdout.slice(0,8192);return{content:a.stdout,isBinary:l.includes("\0")}}}}if(r.searchZip&&n.endsWith(".gz")){let o=await e.fs.readFileBuffer(t);if(q3(o))try{let a=V3(o),l=new TextDecoder().decode(a),c=l.slice(0,8192);return{content:l,isBinary:c.includes("\0")}}catch{return null}}let s=await e.fs.readFile(t),i=s.slice(0,8192);return{content:s,isBinary:i.includes("\0")}}catch{return null}}async function e8(e,t,n,r,s,i,o){let a="",l=!1,c=[],u=0,f=0,p=0,h=50;e:for(let g=0;g<t.length;g+=h){let y=t.slice(g,g+h),w=await Promise.all(y.map(async b=>{let x=e.fs.resolvePath(e.cwd,b),A=await J3(e,x,b,r);if(!A)return null;let{content:$,isBinary:O}=A;if(p+=$.length,O&&!r.searchBinary)return null;let F=s&&!r.heading?b:"",P=is($,n,{invertMatch:r.invertMatch,showLineNumbers:i,countOnly:r.count,countMatches:r.countMatches,filename:F,onlyMatching:r.onlyMatching,beforeContext:r.beforeContext,afterContext:r.afterContext,maxCount:r.maxCount,contextSeparator:r.contextSeparator,showColumn:r.column,vimgrep:r.vimgrep,showByteOffset:r.byteOffset,replace:r.replace!==null?ll(r.replace):null,passthru:r.passthru,multiline:r.multiline,kResetGroup:o});return r.json&&P.matched?{file:b,result:P,content:$,isBinary:!1}:{file:b,result:P}}));for(let b of w){if(!b)continue;let{file:x,result:A}=b;if(A.matched){if(l=!0,f++,u+=A.matchCount,r.quiet&&!r.json)break e;if(r.json&&!r.quiet){let $=b.content||"";c.push(JSON.stringify({type:"begin",data:{path:{text:x}}}));let O=$.split(`
|
|
213
|
+
`);n.lastIndex=0;let F=0;for(let P=0;P<O.length;P++){let M=O[P];n.lastIndex=0;let C=[];for(let N=n.exec(M);N!==null;N=n.exec(M)){let R={match:{text:N[0]},start:N.index,end:N.index+N[0].length};r.replace!==null&&(R.replacement={text:r.replace}),C.push(R),N[0].length===0&&n.lastIndex++}if(C.length>0){let N={type:"match",data:{path:{text:x},lines:{text:`${M}
|
|
214
|
+
`},line_number:P+1,absolute_offset:F,submatches:C}};c.push(JSON.stringify(N))}F+=M.length+1}c.push(JSON.stringify({type:"end",data:{path:{text:x},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:1,searches_with_match:1,bytes_searched:$.length,bytes_printed:0,matched_lines:A.matchCount,matches:A.matchCount}}}))}else if(r.filesWithMatches){let $=r.nullSeparator?"\0":`
|
|
215
|
+
`;a+=`${x}${$}`}else r.filesWithoutMatch||(r.heading&&!r.noFilename&&(a+=`${x}
|
|
216
|
+
`),a+=A.output)}else if(r.filesWithoutMatch){let $=r.nullSeparator?"\0":`
|
|
217
|
+
`;a+=`${x}${$}`}else r.includeZero&&(r.count||r.countMatches)&&(a+=A.output)}}r.json&&(c.push(JSON.stringify({type:"summary",data:{elapsed_total:{secs:0,nanos:0,human:"0s"},stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:t.length,searches_with_match:f,bytes_searched:p,bytes_printed:0,matched_lines:u,matches:u}}})),a=`${c.join(`
|
|
218
|
+
`)}
|
|
219
|
+
`);let d=r.quiet&&!r.json?"":a;if(r.stats&&!r.json){let g=["",`${u} matches`,`${u} matched lines`,`${f} files contained matches`,`${t.length} files searched`,`${p} bytes searched`].join(`
|
|
220
|
+
`);d+=`${g}
|
|
221
|
+
`}let m;return r.filesWithoutMatch?m=a.length>0?0:1:m=l?0:1,{stdout:d,stderr:"",exitCode:m}}var hp=v(()=>{"use strict";Nr();Ve();cl();pl();lp()});var dp={};J(dp,{flagsForFuzzing:()=>r8,rgCommand:()=>n8});var t8,n8,r8,mp=v(()=>{"use strict";ne();pl();ap();hp();t8={name:"rg",summary:"recursively search for a pattern",usage:"rg [OPTIONS] PATTERN [PATH ...]",description:`rg (ripgrep) recursively searches directories for a regex pattern.
|
|
222
|
+
Unlike grep, rg is recursive by default and respects .gitignore files.
|
|
223
|
+
|
|
224
|
+
EXAMPLES:
|
|
225
|
+
rg foo Search for 'foo' in current directory
|
|
226
|
+
rg foo src/ Search in src/ directory
|
|
227
|
+
rg -i foo Case-insensitive search
|
|
228
|
+
rg -w foo Match whole words only
|
|
229
|
+
rg -t js foo Search only JavaScript files
|
|
230
|
+
rg -g '*.ts' foo Search files matching glob
|
|
231
|
+
rg --hidden foo Include hidden files
|
|
232
|
+
rg -l foo List files with matches only`,options:["-e, --regexp PATTERN search for PATTERN (can be used multiple times)","-f, --file FILE read patterns from FILE, one per line","-i, --ignore-case case-insensitive search","-s, --case-sensitive case-sensitive search (overrides smart-case)","-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)","-F, --fixed-strings treat pattern as literal string","-w, --word-regexp match whole words only","-x, --line-regexp match whole lines only","-v, --invert-match select non-matching lines","-r, --replace TEXT replace matches with TEXT","-c, --count print count of matching lines per file"," --count-matches print count of individual matches per file","-l, --files-with-matches print only file names with matches"," --files-without-match print file names without matches"," --files list files that would be searched","-o, --only-matching print only matching parts","-m, --max-count NUM stop after NUM matches per file","-q, --quiet suppress output, exit 0 on match"," --stats print search statistics","-n, --line-number print line numbers (default: on)","-N, --no-line-number do not print line numbers","-I, --no-filename suppress the prefixing of file names","-0, --null use NUL as filename separator","-b, --byte-offset show byte offset of each match"," --column show column number of first match"," --vimgrep show results in vimgrep format"," --json show results in JSON Lines format","-A NUM print NUM lines after each match","-B NUM print NUM lines before each match","-C NUM print NUM lines before and after each match"," --context-separator SEP separator for context groups (default: --)","-U, --multiline match patterns across lines","-z, --search-zip search in compressed files (gzip only)","-g, --glob GLOB include files matching GLOB","-t, --type TYPE only search files of TYPE (e.g., js, py, ts)","-T, --type-not TYPE exclude files of TYPE","-L, --follow follow symbolic links","-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)","-a, --text search binary files as text"," --hidden search hidden files and directories"," --no-ignore don't respect .gitignore/.ignore files","-d, --max-depth NUM maximum search depth"," --sort TYPE sort files (path, none)"," --heading show file path above matches"," --passthru print all lines (non-matches use - separator)"," --include-zero include files with 0 matches in count output"," --type-list list all available file types"," --help display this help and exit"]},n8={name:"rg",async execute(e,t){if(B(e))return U(t8);if(e.includes("--type-list"))return{stdout:tp(),stderr:"",exitCode:0};let n=op(e);return n.success?cp({ctx:t,options:n.options,paths:n.paths,explicitLineNumbers:n.explicitLineNumbers}):n.error}},r8={name:"rg",flags:[{flag:"-i",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-N",type:"boolean"},{flag:"--hidden",type:"boolean"},{flag:"--no-ignore",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-g",type:"value",valueHint:"pattern"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-T",type:"value",valueHint:"string"}],needsArgs:!0}});function rt(e,t,n){if(!e||wt.isInSandboxedContext())return;let r=`${t} ${n} attempted outside defense context`;throw new he(r,{timestamp:Date.now(),type:"missing_defense_context",message:r,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:wt.getCurrentExecutionId()})}async function Tt(e,t,n,r){rt(e,t,`${n} (pre-await)`);let s=await r();return rt(e,t,`${n} (post-await)`),s}var Fn=v(()=>{"use strict";an()});function ml(e){let t="",n=0,r=!1;for(;n<e.length;){if(e[n]==="["&&!r){if(e[n+1]==="["&&e[n+2]===":"){let s=e.indexOf(":]]",n+3);if(s!==-1){let i=e.slice(n+3,s),o=dl.get(i);if(o){t+=`[${o}]`,n=s+3;continue}}}if(e[n+1]==="^"&&e[n+2]==="["&&e[n+3]===":"){let s=e.indexOf(":]]",n+4);if(s!==-1){let i=e.slice(n+4,s),o=dl.get(i);if(o){t+=`[^${o}]`,n=s+3;continue}}}t+="[",n++,r=!0,n<e.length&&e[n]==="^"&&(t+="^",n++),n<e.length&&e[n]==="]"&&(t+="\\]",n++);continue}if(r){if(e[n]==="]"){t+="]",n++,r=!1;continue}if(e[n]==="["&&e[n+1]===":"){let s=e.indexOf(":]",n+2);if(s!==-1){let i=e.slice(n+2,s),o=dl.get(i);if(o){t+=o,n=s+2;continue}}}if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++;continue}if(e[n]==="\\"&&n+1<e.length){let s=e[n+1];if(s==="+"||s==="?"||s==="|"){t+=s,n+=2;continue}if(s==="("||s===")"){t+=s,n+=2;continue}if(s==="{"||s==="}"){t+=s,n+=2;continue}if(s==="t"){t+=" ",n+=2;continue}if(s==="n"){t+=`
|
|
233
|
+
`,n+=2;continue}if(s==="r"){t+="\r",n+=2;continue}t+=e[n]+s,n+=2;continue}if(e[n]==="+"||e[n]==="?"||e[n]==="|"||e[n]==="("||e[n]===")"){t+=`\\${e[n]}`,n++;continue}if(e[n]==="^"&&!(t===""||t.endsWith("("))){t+="\\^",n++;continue}if(e[n]==="$"){let s=n===e.length-1,i=n+2<e.length&&e[n+1]==="\\"&&e[n+2]===")";if(!s&&!i){t+="\\$",n++;continue}}t+=e[n],n++}return t}function gl(e){let t="",n=!1;for(let r=0;r<e.length;r++)e[r]==="["&&!n?(n=!0,t+="[",r++,r<e.length&&e[r]==="^"&&(t+="^",r++),r<e.length&&e[r]==="]"&&(t+="]",r++),r--):e[r]==="]"&&n?(n=!1,t+="]"):!n&&e[r]==="{"&&e[r+1]===","?(t+="{0,",r++):t+=e[r];return t}function gp(e){let t="";for(let n=0;n<e.length;n++){let r=e[n],s=r.charCodeAt(0);r==="\\"?t+="\\\\":r===" "?t+="\\t":r===`
|
|
234
|
+
`?t+=`$
|
|
235
|
+
`:r==="\r"?t+="\\r":r==="\x07"?t+="\\a":r==="\b"?t+="\\b":r==="\f"?t+="\\f":r==="\v"?t+="\\v":s<32||s>=127?t+=`\\${s.toString(8).padStart(3,"0")}`:t+=r}return`${t}$`}var dl,yp=v(()=>{"use strict";dl=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]])});function bp(e,t,n){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:e,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:t,pendingFileReads:[],pendingFileWrites:[],rangeStates:n||new Map,linesConsumedInCycle:0}}function i8(e){return typeof e=="object"&&"first"in e&&"step"in e}function o8(e){return typeof e=="object"&&"offset"in e}function as(e,t,n,r,s){if(e==="$")return t===n;if(typeof e=="number")return t===e;if(i8(e)){let{first:i,step:o}=e;return o===0?t===i:(t-i)%o===0&&t>=i}if(typeof e=="object"&&"pattern"in e)try{let i=e.pattern;i===""&&s?.lastPattern?i=s.lastPattern:i!==""&&s&&(s.lastPattern=i);let o=gl(ml(i));return K(o).test(r)}catch{return!1}return!1}function yl(e){let t=n=>n===void 0?"undefined":n==="$"?"$":typeof n=="number"?String(n):"pattern"in n?`/${n.pattern}/`:"first"in n?`${n.first}~${n.step}`:"unknown";return`${t(e.start)},${t(e.end)}`}function a8(e,t,n,r,s,i){if(!e||!e.start&&!e.end)return!0;let o=e.start,a=e.end;if(o!==void 0&&a===void 0)return as(o,t,n,r,i);if(o!==void 0&&a!==void 0){let l=typeof o=="object"&&"pattern"in o,c=typeof a=="object"&&"pattern"in a,u=o8(a);if(u&&s){let p=yl(e),h=s.get(p);if(h||(h={active:!1},s.set(p,h)),h.active){let d=h.startLine||t;return t>=d+a.offset&&(h.active=!1,s.set(p,h)),!0}else return as(o,t,n,r,i)?(h.active=!0,h.startLine=t,s.set(p,h),a.offset===0&&(h.active=!1,s.set(p,h)),!0):!1}if(!l&&!c&&!u){let p=typeof o=="number"?o:o==="$"?n:1,h=typeof a=="number"?a:n;if(p<=h)return t>=p&&t<=h;if(s){let d=yl(e),m=s.get(d);return m||(m={active:!1},s.set(d,m)),!m.completed&&t>=p?(m.completed=!0,s.set(d,m),!0):!1}return!1}if(s){let p=yl(e),h=s.get(p);if(h||(h={active:!1},s.set(p,h)),h.active)return as(a,t,n,r,i)&&(h.active=!1,typeof o=="number"&&(h.completed=!0),s.set(p,h)),!0;{if(h.completed)return!1;let d=!1;return typeof o=="number"?d=t>=o:d=as(o,t,n,r,i),d?(h.active=!0,h.startLine=t,s.set(p,h),as(a,t,n,r,i)&&(h.active=!1,typeof o=="number"&&(h.completed=!0),s.set(p,h)),!0):!1}}return as(o,t,n,r,i)}return!0}function Ir(e,t,n,r,s,i){let o=a8(e,t,n,r,s,i);return e?.negated?!o:o}function l8(e,t,n,r){let s="",i=0,o=!1;for(;i<=e.length;){t.lastIndex=i;let a=t.exec(e);if(!a){s+=e.slice(i);break}if(a.index!==i){s+=e.slice(i,a.index),i=a.index,o=!1;continue}let l=a[0],c=a.slice(1);if(o&&l.length===0){if(i<e.length)s+=e[i],i++;else break;o=!1;continue}if(s+=r(l,c),o=!1,l.length===0)if(i<e.length)s+=e[i],i++;else break;else i+=l.length,o=!0}return s}function wl(e,t,n){let r="",s=0;for(;s<e.length;){if(e[s]==="\\"&&s+1<e.length){let i=e[s+1];if(i==="&"){r+="&",s+=2;continue}if(i==="n"){r+=`
|
|
236
|
+
`,s+=2;continue}if(i==="t"){r+=" ",s+=2;continue}if(i==="r"){r+="\r",s+=2;continue}let o=parseInt(i,10);if(o===0){r+=t,s+=2;continue}if(o>=1&&o<=9){r+=n[o-1]||"",s+=2;continue}r+=i,s+=2;continue}if(e[s]==="&"){r+=t,s++;continue}r+=e[s],s++}return r}function wp(e,t,n){if(t>0&&e.length>t)throw new Q(`sed: ${n} size limit exceeded (${t} bytes)`,"string_length")}function c8(e,t,n){let{lineNumber:r,totalLines:s,patternSpace:i}=t;if(e.type==="label"){t.coverage?.hit(`sed:cmd:${e.type}`);return}if(Ir(e.address,r,s,i,t.rangeStates,t))switch(t.coverage?.hit(`sed:cmd:${e.type}`),e.type){case"substitute":{let o=e,a="";o.global&&(a+="g"),o.ignoreCase&&(a+="i");let l=o.pattern;l===""&&t.lastPattern?l=t.lastPattern:l!==""&&(t.lastPattern=l);let c=gl(o.extendedRegex?l:ml(l));try{let u=K(c,a),f=u.test(t.patternSpace);if(u.lastIndex=0,f){if(t.substitutionMade=!0,o.nthOccurrence&&o.nthOccurrence>0&&!o.global){let p=0,h=o.nthOccurrence,d=K(c,`g${o.ignoreCase?"i":""}`);t.patternSpace=d.replace(t.patternSpace,(m,...g)=>{if(p++,p===h){let y=g.slice(0,-2);return wl(o.replacement,m,y)}return m})}else if(o.global){let p=K(c,`g${o.ignoreCase?"i":""}`);t.patternSpace=l8(t.patternSpace,p,o.replacement,(h,d)=>wl(o.replacement,h,d))}else t.patternSpace=u.replace(t.patternSpace,(p,...h)=>{let d=h.slice(0,-2);return wl(o.replacement,p,d)});o.printOnMatch&&t.lineNumberOutput.push(t.patternSpace)}}catch{}break}case"print":t.lineNumberOutput.push(t.patternSpace);break;case"printFirstLine":{let o=t.patternSpace.indexOf(`
|
|
237
|
+
`);o!==-1?t.lineNumberOutput.push(t.patternSpace.slice(0,o)):t.lineNumberOutput.push(t.patternSpace);break}case"delete":t.deleted=!0;break;case"deleteFirstLine":{let o=t.patternSpace.indexOf(`
|
|
238
|
+
`);o!==-1?(t.patternSpace=t.patternSpace.slice(o+1),t.restartCycle=!0,t.inDRestartedCycle=!0):t.deleted=!0;break}case"zap":t.patternSpace="";break;case"append":t.appendBuffer.push(e.text);break;case"insert":t.appendBuffer.unshift(`__INSERT__${e.text}`);break;case"change":t.deleted=!0,t.changedText=e.text;break;case"hold":t.holdSpace=t.patternSpace;break;case"holdAppend":t.holdSpace?t.holdSpace+=`
|
|
239
|
+
${t.patternSpace}`:t.holdSpace=t.patternSpace,wp(t.holdSpace,n?.maxStringLength??0,"hold space");break;case"get":t.patternSpace=t.holdSpace;break;case"getAppend":t.patternSpace+=`
|
|
240
|
+
${t.holdSpace}`,wp(t.patternSpace,n?.maxStringLength??0,"pattern space");break;case"exchange":{let o=t.patternSpace;t.patternSpace=t.holdSpace,t.holdSpace=o;break}case"next":t.printed=!0;break;case"quit":t.quit=!0,e.exitCode!==void 0&&(t.exitCode=e.exitCode);break;case"quitSilent":t.quit=!0,t.quitSilent=!0,e.exitCode!==void 0&&(t.exitCode=e.exitCode);break;case"list":{let o=gp(t.patternSpace);t.lineNumberOutput.push(o);break}case"printFilename":t.currentFilename&&t.lineNumberOutput.push(t.currentFilename);break;case"version":{let o=[4,8,0];if(e.minVersion){let a=e.minVersion.split("."),l=[],c=!1;for(let u of a){let f=parseInt(u,10);if(Number.isNaN(f)||f<0){t.quit=!0,t.exitCode=1,t.errorMessage=`sed: invalid version string: ${e.minVersion}`,c=!0;break}l.push(f)}if(!c){for(;l.length<3;)l.push(0);for(let u=0;u<3;u++){if(l[u]>o[u]){t.quit=!0,t.exitCode=1,t.errorMessage=`sed: this is not GNU sed version ${e.minVersion}`;break}if(l[u]<o[u])break}}}break}case"readFile":t.pendingFileReads.push({filename:e.filename,wholeFile:!0});break;case"readFileLine":t.pendingFileReads.push({filename:e.filename,wholeFile:!1});break;case"writeFile":t.pendingFileWrites.push({filename:e.filename,content:`${t.patternSpace}
|
|
241
|
+
`});break;case"writeFirstLine":{let o=t.patternSpace.indexOf(`
|
|
242
|
+
`),a=o!==-1?t.patternSpace.slice(0,o):t.patternSpace;t.pendingFileWrites.push({filename:e.filename,content:`${a}
|
|
243
|
+
`});break}case"execute":t.errorMessage="sed: e command (shell execution) is not supported in sandboxed environment",t.quit=!0;break;case"transliterate":t.patternSpace=u8(t.patternSpace,e);break;case"lineNumber":t.lineNumberOutput.push(String(t.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function u8(e,t){let n="";for(let r of e){let s=t.source.indexOf(r);s!==-1?n+=t.dest[s]:n+=r}return n}function bl(e,t,n,r){let s=new Map;for(let l=0;l<e.length;l++){let c=e[l];c.type==="label"&&s.set(c.name,l)}let i=r?.maxIterations??s8,o=0,a=0;for(;a<e.length;){if(o++,o>i)throw new Q(`sed: command execution exceeded maximum iterations (${i})`,"iterations");if(t.deleted||t.quit||t.quitSilent||t.restartCycle)break;let l=e[a];if(l.type==="next"){if(Ir(l.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t))if(t.coverage?.hit("sed:cmd:next"),t.nCommandOutput.push(t.patternSpace),n&&n.currentLineIndex+t.linesConsumedInCycle+1<n.lines.length){t.linesConsumedInCycle++;let c=n.lines[n.currentLineIndex+t.linesConsumedInCycle];t.patternSpace=c,t.lineNumber=n.currentLineIndex+t.linesConsumedInCycle+1,t.substitutionMade=!1}else{t.quit=!0,t.deleted=!0;break}a++;continue}if(l.type==="nextAppend"){if(Ir(l.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t))if(t.coverage?.hit("sed:cmd:nextAppend"),n&&n.currentLineIndex+t.linesConsumedInCycle+1<n.lines.length){t.linesConsumedInCycle++;let c=n.lines[n.currentLineIndex+t.linesConsumedInCycle];t.patternSpace+=`
|
|
244
|
+
${c}`,t.lineNumber=n.currentLineIndex+t.linesConsumedInCycle+1}else{t.quit=!0;break}a++;continue}if(l.type==="branch"){let c=l;if(Ir(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)){if(t.coverage?.hit("sed:cmd:branch"),c.label){let u=s.get(c.label);if(u!==void 0){a=u;continue}t.branchRequest=c.label;break}break}a++;continue}if(l.type==="branchOnSubst"){let c=l;if(Ir(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:branchOnSubst"),t.substitutionMade)){if(t.substitutionMade=!1,c.label){let u=s.get(c.label);if(u!==void 0){a=u;continue}t.branchRequest=c.label;break}break}a++;continue}if(l.type==="branchOnNoSubst"){let c=l;if(Ir(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:branchOnNoSubst"),!t.substitutionMade)){if(c.label){let u=s.get(c.label);if(u!==void 0){a=u;continue}t.branchRequest=c.label;break}break}a++;continue}if(l.type==="group"){let c=l;if(Ir(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:group"),bl(c.commands,t,n,r),t.branchRequest)){let u=s.get(t.branchRequest);if(u!==void 0){t.branchRequest=void 0,a=u;continue}break}a++;continue}c8(l,t,r),a++}return t.linesConsumedInCycle}var s8,xp=v(()=>{"use strict";xe();Ve();yp();s8=1e4});var ee,qi,Ep=v(()=>{"use strict";(function(e){e.NUMBER="NUMBER",e.DOLLAR="DOLLAR",e.PATTERN="PATTERN",e.STEP="STEP",e.RELATIVE_OFFSET="RELATIVE_OFFSET",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.COMMA="COMMA",e.NEGATION="NEGATION",e.COMMAND="COMMAND",e.SUBSTITUTE="SUBSTITUTE",e.TRANSLITERATE="TRANSLITERATE",e.LABEL_DEF="LABEL_DEF",e.BRANCH="BRANCH",e.BRANCH_ON_SUBST="BRANCH_ON_SUBST",e.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",e.TEXT_CMD="TEXT_CMD",e.FILE_READ="FILE_READ",e.FILE_READ_LINE="FILE_READ_LINE",e.FILE_WRITE="FILE_WRITE",e.FILE_WRITE_LINE="FILE_WRITE_LINE",e.EXECUTE="EXECUTE",e.VERSION="VERSION",e.EOF="EOF",e.ERROR="ERROR"})(ee||(ee={}));qi=class{input;pos=0;line=1;column=1;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&t.push(n)}return t.push(this.makeToken(ee.EOF,"")),t}makeToken(t,n,r){return{type:t,value:n,line:this.line,column:this.column,...r}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
|
|
245
|
+
`?(this.line++,this.column=1):this.column++,t}readEscapedString(t){let n="";for(;this.pos<this.input.length&&this.peek()!==t;)if(this.peek()==="\\"){this.advance();let r=this.advance();r==="n"?n+=`
|
|
246
|
+
`:r==="t"?n+=" ":n+=r}else{if(this.peek()===`
|
|
247
|
+
`)return null;n+=this.advance()}return n}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.peek();if(t===" "||t===" "||t==="\r")this.advance();else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
|
|
248
|
+
`;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let t=this.line,n=this.column,r=this.peek();return r===`
|
|
249
|
+
`?(this.advance(),{type:ee.NEWLINE,value:`
|
|
250
|
+
`,line:t,column:n}):r===";"?(this.advance(),{type:ee.SEMICOLON,value:";",line:t,column:n}):r==="{"?(this.advance(),{type:ee.LBRACE,value:"{",line:t,column:n}):r==="}"?(this.advance(),{type:ee.RBRACE,value:"}",line:t,column:n}):r===","?(this.advance(),{type:ee.COMMA,value:",",line:t,column:n}):r==="!"?(this.advance(),{type:ee.NEGATION,value:"!",line:t,column:n}):r==="$"?(this.advance(),{type:ee.DOLLAR,value:"$",line:t,column:n}):this.isDigit(r)?this.readNumber():r==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():r==="/"?this.readPattern():r===":"?this.readLabelDef():this.readCommand()}readNumber(){let t=this.line,n=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="~"){this.advance();let s="";for(;this.isDigit(this.peek());)s+=this.advance();let i=parseInt(r,10),o=parseInt(s,10)||0;return{type:ee.STEP,value:`${i}~${o}`,first:i,step:o,line:t,column:n}}return{type:ee.NUMBER,value:parseInt(r,10),line:t,column:n}}readRelativeOffset(){let t=this.line,n=this.column;this.advance();let r="";for(;this.isDigit(this.peek());)r+=this.advance();let s=parseInt(r,10)||0;return{type:ee.RELATIVE_OFFSET,value:`+${s}`,offset:s,line:t,column:n}}readPattern(){let t=this.line,n=this.column;this.advance();let r="",s=!1;for(;this.pos<this.input.length;){let i=this.peek();if(i==="/"&&!s)break;if(i==="\\")r+=this.advance(),this.pos<this.input.length&&this.peek()!==`
|
|
251
|
+
`&&(r+=this.advance());else{if(i===`
|
|
252
|
+
`)break;i==="["&&!s?(s=!0,r+=this.advance(),this.peek()==="^"&&(r+=this.advance()),this.peek()==="]"&&(r+=this.advance())):i==="]"&&s?(s=!1,r+=this.advance()):r+=this.advance()}}return this.peek()==="/"&&this.advance(),{type:ee.PATTERN,value:r,pattern:r,line:t,column:n}}readLabelDef(){let t=this.line,n=this.column;for(this.advance();this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
|
|
253
|
+
`||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:ee.LABEL_DEF,value:r,label:r,line:t,column:n}}readCommand(){let t=this.line,n=this.column,r=this.advance();switch(r){case"s":return this.readSubstitute(t,n);case"y":return this.readTransliterate(t,n);case"a":case"i":case"c":return this.readTextCommand(r,t,n);case"b":return this.readBranch(ee.BRANCH,"b",t,n);case"t":return this.readBranch(ee.BRANCH_ON_SUBST,"t",t,n);case"T":return this.readBranch(ee.BRANCH_ON_NO_SUBST,"T",t,n);case"r":return this.readFileCommand(ee.FILE_READ,"r",t,n);case"R":return this.readFileCommand(ee.FILE_READ_LINE,"R",t,n);case"w":return this.readFileCommand(ee.FILE_WRITE,"w",t,n);case"W":return this.readFileCommand(ee.FILE_WRITE_LINE,"W",t,n);case"e":return this.readExecute(t,n);case"p":case"P":case"d":case"D":case"h":case"H":case"g":case"G":case"x":case"n":case"N":case"q":case"Q":case"z":case"=":case"l":case"F":return{type:ee.COMMAND,value:r,line:t,column:n};case"v":return this.readVersion(t,n);default:return{type:ee.ERROR,value:r,line:t,column:n}}}readSubstitute(t,n){let r=this.advance();if(!r||r===`
|
|
254
|
+
`)return{type:ee.ERROR,value:"s",line:t,column:n};let s="",i=!1;for(;this.pos<this.input.length;){let l=this.peek();if(l===r&&!i)break;if(l==="\\")this.advance(),this.pos<this.input.length&&this.peek()!==`
|
|
255
|
+
`?this.peek()===r&&!i?s+=this.advance():(s+="\\",s+=this.advance()):s+="\\";else{if(l===`
|
|
256
|
+
`)break;l==="["&&!i?(i=!0,s+=this.advance(),this.peek()==="^"&&(s+=this.advance()),this.peek()==="]"&&(s+=this.advance())):l==="]"&&i?(i=!1,s+=this.advance()):s+=this.advance()}}if(this.peek()!==r)return{type:ee.ERROR,value:"unterminated substitution pattern",line:t,column:n};this.advance();let o="";for(;this.pos<this.input.length&&this.peek()!==r;)if(this.peek()==="\\")if(this.advance(),this.pos<this.input.length){let l=this.peek();l==="\\"?(this.advance(),this.pos<this.input.length&&this.peek()===`
|
|
257
|
+
`?(o+=`
|
|
258
|
+
`,this.advance()):o+="\\"):l===`
|
|
259
|
+
`?(o+=`
|
|
260
|
+
`,this.advance()):o+=`\\${this.advance()}`}else o+="\\";else{if(this.peek()===`
|
|
261
|
+
`)break;o+=this.advance()}this.peek()===r&&this.advance();let a="";for(;this.pos<this.input.length;){let l=this.peek();if(l==="g"||l==="i"||l==="p"||l==="I"||this.isDigit(l))a+=this.advance();else break}return{type:ee.SUBSTITUTE,value:`s${r}${s}${r}${o}${r}${a}`,pattern:s,replacement:o,flags:a,line:t,column:n}}readTransliterate(t,n){let r=this.advance();if(!r||r===`
|
|
262
|
+
`)return{type:ee.ERROR,value:"y",line:t,column:n};let s=this.readEscapedString(r);if(s===null||this.peek()!==r)return{type:ee.ERROR,value:"unterminated transliteration source",line:t,column:n};this.advance();let i=this.readEscapedString(r);if(i===null||this.peek()!==r)return{type:ee.ERROR,value:"unterminated transliteration dest",line:t,column:n};this.advance();let o=this.peek();for(;o===" "||o===" ";)this.advance(),o=this.peek();return o!==""&&o!==";"&&o!==`
|
|
263
|
+
`&&o!=="}"?{type:ee.ERROR,value:"extra text at the end of a transform command",line:t,column:n}:{type:ee.TRANSLITERATE,value:`y${r}${s}${r}${i}${r}`,source:s,dest:i,line:t,column:n}}readTextCommand(t,n,r){let s=!1;this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===`
|
|
264
|
+
`||this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&(s=!0,this.advance()),(this.peek()===" "||this.peek()===" ")&&this.advance(),this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&this.advance(),s&&this.peek()===`
|
|
265
|
+
`&&this.advance();let i="";for(;this.pos<this.input.length;){let o=this.peek();if(o===`
|
|
266
|
+
`){if(i.endsWith("\\")){i=`${i.slice(0,-1)}
|
|
267
|
+
`,this.advance();continue}break}if(o==="\\"&&this.pos+1<this.input.length){let a=this.input[this.pos+1];if(a==="n"){i+=`
|
|
268
|
+
`,this.advance(),this.advance();continue}if(a==="t"){i+=" ",this.advance(),this.advance();continue}if(a==="r"){i+="\r",this.advance(),this.advance();continue}}i+=this.advance()}return{type:ee.TEXT_CMD,value:t,text:i,line:n,column:r}}readBranch(t,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let o=this.peek();if(o===" "||o===" "||o===`
|
|
269
|
+
`||o===";"||o==="}"||o==="{")break;i+=this.advance()}return{type:t,value:n,label:i||void 0,line:r,column:s}}readVersion(t,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
|
|
270
|
+
`||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:ee.VERSION,value:"v",label:r||void 0,line:t,column:n}}readFileCommand(t,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let o=this.peek();if(o===`
|
|
271
|
+
`||o===";")break;i+=this.advance()}return{type:t,value:n,filename:i.trim(),line:r,column:s}}readExecute(t,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
|
|
272
|
+
`||s===";")break;r+=this.advance()}return{type:ee.EXECUTE,value:"e",command:r.trim()||void 0,line:t,column:n}}isDigit(t){return t>="0"&&t<="9"}}});function Ap(e,t=!1){let n=!1,r=!1,s=[];for(let l=0;l<e.length;l++){let c=e[l];if(s.length===0&&l===0){let u=c.match(/^#([nr]+)\s*(?:\n|$)/i);if(u){let f=u[1].toLowerCase();f.includes("n")&&(n=!0),f.includes("r")&&(r=!0),c=c.slice(u[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let u=s[s.length-1];s[s.length-1]=`${u}
|
|
273
|
+
${c}`}else s.push(c)}let i=s.join(`
|
|
274
|
+
`),a=new xl([i],t||r).parse();if(!a.error&&a.commands.length>0){let l=f8(a.commands);if(l)return{commands:[],error:l,silentMode:n,extendedRegexMode:r}}return{...a,silentMode:n,extendedRegexMode:r}}function f8(e){let t=new Set;Sp(e,t);let n=Cp(e,t);if(n)return`undefined label '${n}'`}function Sp(e,t){for(let n of e)n.type==="label"?t.add(n.name):n.type==="group"&&Sp(n.commands,t)}function Cp(e,t){for(let n of e){if((n.type==="branch"||n.type==="branchOnSubst"||n.type==="branchOnNoSubst")&&n.label&&!t.has(n.label))return n.label;if(n.type==="group"){let r=Cp(n.commands,t);if(r)return r}}}var xl,vp=v(()=>{"use strict";Ep();xl=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(t,n=!1){this.scripts=t,this.extendedRegex=n}parse(){let t=[];for(let n of this.scripts){let r=new qi(n);for(this.tokens=r.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(ee.NEWLINE)||this.check(ee.SEMICOLON)){this.advance();continue}let s=this.pos,i=this.parseCommand();if(i.error)return{commands:[],error:i.error};if(i.command&&t.push(i.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:t}}parseCommand(){let t=this.parseAddressRange();if(t?.error)return{command:null,error:t.error};let n=t?.address;for(this.check(ee.NEGATION)&&(this.advance(),n&&(n.negated=!0));this.check(ee.NEWLINE)||this.check(ee.SEMICOLON);)this.advance();if(this.isAtEnd())return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null};let r=this.peek();switch(r.type){case ee.COMMAND:return this.parseSimpleCommand(r,n);case ee.SUBSTITUTE:return this.parseSubstituteFromToken(r,n);case ee.TRANSLITERATE:return this.parseTransliterateFromToken(r,n);case ee.LABEL_DEF:return this.advance(),{command:{type:"label",name:r.label||""}};case ee.BRANCH:return this.advance(),{command:{type:"branch",address:n,label:r.label}};case ee.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:n,label:r.label}};case ee.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:n,label:r.label}};case ee.TEXT_CMD:return this.advance(),this.parseTextCommand(r,n);case ee.FILE_READ:return this.advance(),{command:{type:"readFile",address:n,filename:r.filename||""}};case ee.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:n,filename:r.filename||""}};case ee.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:n,filename:r.filename||""}};case ee.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:n,filename:r.filename||""}};case ee.EXECUTE:return this.advance(),{command:{type:"execute",address:n,command:r.command}};case ee.VERSION:return this.advance(),{command:{type:"version",address:n,minVersion:r.label}};case ee.LBRACE:return this.parseGroup(n);case ee.RBRACE:return{command:null};case ee.ERROR:return{command:null,error:`invalid command: ${r.value}`};default:return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(t,n){this.advance();let r=t.value;switch(r){case"p":return{command:{type:"print",address:n}};case"P":return{command:{type:"printFirstLine",address:n}};case"d":return{command:{type:"delete",address:n}};case"D":return{command:{type:"deleteFirstLine",address:n}};case"h":return{command:{type:"hold",address:n}};case"H":return{command:{type:"holdAppend",address:n}};case"g":return{command:{type:"get",address:n}};case"G":return{command:{type:"getAppend",address:n}};case"x":return{command:{type:"exchange",address:n}};case"n":return{command:{type:"next",address:n}};case"N":return{command:{type:"nextAppend",address:n}};case"q":return{command:{type:"quit",address:n}};case"Q":return{command:{type:"quitSilent",address:n}};case"z":return{command:{type:"zap",address:n}};case"=":return{command:{type:"lineNumber",address:n}};case"l":return{command:{type:"list",address:n}};case"F":return{command:{type:"printFilename",address:n}};default:return{command:null,error:`unknown command: ${r}`}}}parseSubstituteFromToken(t,n){this.advance();let r=t.flags||"",s,i=r.match(/(\d+)/);return i&&(s=parseInt(i[1],10)),{command:{type:"substitute",address:n,pattern:t.pattern||"",replacement:t.replacement||"",global:r.includes("g"),ignoreCase:r.includes("i")||r.includes("I"),printOnMatch:r.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(t,n){this.advance();let r=t.source||"",s=t.dest||"";return r.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:n,source:r,dest:s}}}parseTextCommand(t,n){let r=t.value,s=t.text||"";switch(r){case"a":return{command:{type:"append",address:n,text:s}};case"i":return{command:{type:"insert",address:n,text:s}};case"c":return{command:{type:"change",address:n,text:s}};default:return{command:null,error:`unknown text command: ${r}`}}}parseGroup(t){this.advance();let n=[];for(;!this.isAtEnd()&&!this.check(ee.RBRACE);){if(this.check(ee.NEWLINE)||this.check(ee.SEMICOLON)){this.advance();continue}let r=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&n.push(s.command),this.pos===r&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(ee.RBRACE)?(this.advance(),{command:{type:"group",address:t,commands:n}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(ee.COMMA))return{error:"expected context address"};let t=this.parseAddress();if(t===void 0)return;let n;if(this.check(ee.RELATIVE_OFFSET))n={offset:this.advance().offset||0};else if(this.check(ee.COMMA)&&(this.advance(),n=this.parseAddress(),n===void 0))return{error:"expected context address"};return{address:{start:t,end:n}}}parseAddress(){let t=this.peek();switch(t.type){case ee.NUMBER:return this.advance(),t.value;case ee.DOLLAR:return this.advance(),"$";case ee.PATTERN:return this.advance(),{pattern:t.pattern||t.value};case ee.STEP:return this.advance(),{first:t.first||0,step:t.step||0};case ee.RELATIVE_OFFSET:return this.advance(),{offset:t.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:ee.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(t){return this.peek().type===t}isAtEnd(){return this.peek().type===ee.EOF}}});var kp={};J(kp,{flagsForFuzzing:()=>d8,sedCommand:()=>h8});async function El(e,t,n,r={}){let{limits:s,filename:i,fs:o,cwd:a,coverage:l,requireDefenseContext:c}=r;rt(c,"sed","processing entry");let u=(M,C)=>Tt(c,"sed",M,C),f=e.endsWith(`
|
|
275
|
+
`),p=e.split(`
|
|
276
|
+
`);p.length>0&&p[p.length-1]===""&&p.pop();let h=p.length,d="",m,g=!1,y=s?.maxStringLength??0,w=M=>{if(d+=M,y>0&&d.length>y)throw new Q(`sed: output size limit exceeded (${y} bytes)`,"string_length")},b="",x,A=new Map,$=new Map,O=new Map,F=new Map,P=s?{maxIterations:s.maxSedIterations,maxStringLength:y}:void 0;for(let M=0;M<p.length;M++){let C={...bp(h,i,A),patternSpace:p[M],holdSpace:b,lastPattern:x,lineNumber:M+1,totalLines:h,substitutionMade:!1,coverage:l},N={lines:p,currentLineIndex:M},R=0,I=1e4;C.linesConsumedInCycle=0;do{if(R++,R>I)break;if(C.restartCycle=!1,C.pendingFileReads=[],C.pendingFileWrites=[],bl(t,C,N,P),o&&a){for(let W of C.pendingFileReads){let q=o.resolvePath(a,W.filename);try{if(W.wholeFile){let fe=await u("read command file",()=>o.readFile(q));C.appendBuffer.push(fe.replace(/\n$/,""))}else{if(!$.has(q)){let ke=await u("read command file line cache",()=>o.readFile(q));$.set(q,ke.split(`
|
|
277
|
+
`)),O.set(q,0)}let fe=$.get(q),ie=O.get(q);fe&&ie!==void 0&&ie<fe.length&&(C.appendBuffer.push(fe[ie]),O.set(q,ie+1))}}catch(fe){if(fe instanceof he)throw fe}}for(let W of C.pendingFileWrites){let q=o.resolvePath(a,W.filename),fe=F.get(q)||"";F.set(q,fe+W.content)}}}while(C.restartCycle&&!C.deleted&&!C.quit&&!C.quitSilent);if(M+=C.linesConsumedInCycle,b=C.holdSpace,x=C.lastPattern,!n)for(let W of C.nCommandOutput)w(`${W}
|
|
278
|
+
`);let T=C.lineNumberOutput.length>0;for(let W of C.lineNumberOutput)w(`${W}
|
|
279
|
+
`);let L=[],me=[];for(let W of C.appendBuffer)W.startsWith("__INSERT__")?L.push(W.slice(10)):me.push(W);for(let W of L)w(`${W}
|
|
280
|
+
`);let ue=!1;!C.deleted&&!C.quitSilent?n?C.printed&&(w(`${C.patternSpace}
|
|
281
|
+
`),ue=!0):(w(`${C.patternSpace}
|
|
282
|
+
`),ue=!0):C.changedText!==void 0&&(w(`${C.changedText}
|
|
283
|
+
`),ue=!0);for(let W of me)w(`${W}
|
|
284
|
+
`);if(g=(T||ue)&&me.length===0,C.quit||C.quitSilent){if(C.exitCode!==void 0&&(m=C.exitCode),C.errorMessage)return{output:"",exitCode:m||1,errorMessage:C.errorMessage};break}}if(o&&a)for(let[M,C]of F)try{await u("flush pending file writes",()=>o.writeFile(M,C))}catch(N){if(N instanceof he)throw N}return!f&&g&&d.endsWith(`
|
|
285
|
+
`)&&(d=d.slice(0,-1)),{output:d,exitCode:m}}var p8,h8,d8,Np=v(()=>{"use strict";yn();xe();Fn();an();ne();xp();vp();p8={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
|
|
286
|
+
s/regexp/replacement/[flags] substitute
|
|
287
|
+
d delete pattern space
|
|
288
|
+
p print pattern space
|
|
289
|
+
a\\ text append text after line
|
|
290
|
+
i\\ text insert text before line
|
|
291
|
+
c\\ text change (replace) line with text
|
|
292
|
+
h copy pattern space to hold space
|
|
293
|
+
H append pattern space to hold space
|
|
294
|
+
g copy hold space to pattern space
|
|
295
|
+
G append hold space to pattern space
|
|
296
|
+
x exchange pattern and hold spaces
|
|
297
|
+
n read next line into pattern space
|
|
298
|
+
N append next line to pattern space
|
|
299
|
+
y/source/dest/ transliterate characters
|
|
300
|
+
= print line number
|
|
301
|
+
l list pattern space (escape special chars)
|
|
302
|
+
b [label] branch to label
|
|
303
|
+
t [label] branch on substitution
|
|
304
|
+
T [label] branch if no substitution
|
|
305
|
+
:label define label
|
|
306
|
+
q quit
|
|
307
|
+
Q quit without printing
|
|
308
|
+
|
|
309
|
+
Addresses:
|
|
310
|
+
N line number
|
|
311
|
+
$ last line
|
|
312
|
+
/regexp/ lines matching regexp
|
|
313
|
+
N,M range from line N to M
|
|
314
|
+
first~step every step-th line starting at first`};h8={name:"sed",async execute(e,t){rt(t.requireDefenseContext,"sed","execution entry");let n=(m,g)=>Tt(t.requireDefenseContext,"sed",m,g);if(B(e))return U(p8);let r=[],s=[],i=!1,o=!1,a=!1,l=[];for(let m=0;m<e.length;m++){let g=e[m];if(g==="-n"||g==="--quiet"||g==="--silent")i=!0;else if(g==="-i"||g==="--in-place")o=!0;else if(g.startsWith("-i"))o=!0;else if(g==="-E"||g==="-r"||g==="--regexp-extended")a=!0;else if(g==="-e")m+1<e.length&&r.push(e[++m]);else if(g==="-f")m+1<e.length&&s.push(e[++m]);else{if(g.startsWith("--"))return Z("sed",g);if(g==="-")l.push(g);else if(g.startsWith("-")&&g.length>1){for(let y of g.slice(1))if(y!=="n"&&y!=="e"&&y!=="f"&&y!=="i"&&y!=="E"&&y!=="r")return Z("sed",`-${y}`);g.includes("n")&&(i=!0),g.includes("i")&&(o=!0),(g.includes("E")||g.includes("r"))&&(a=!0),g.includes("e")&&!g.includes("n")&&!g.includes("i")&&m+1<e.length&&r.push(e[++m]),g.includes("f")&&!g.includes("e")&&m+1<e.length&&s.push(e[++m])}else!g.startsWith("-")&&r.length===0&&s.length===0?r.push(g):g.startsWith("-")||l.push(g)}}for(let m of s){let g=t.fs.resolvePath(t.cwd,m);try{let y=await n("script file read",()=>t.fs.readFile(g));for(let w of y.split(`
|
|
315
|
+
`)){let b=w.trim();b&&!b.startsWith("#")&&r.push(b)}}catch(y){if(y instanceof he)throw y;return{stdout:"",stderr:`sed: couldn't open file ${m}: No such file or directory
|
|
316
|
+
`,exitCode:1}}}if(r.length===0)return{stdout:"",stderr:`sed: no script specified
|
|
317
|
+
`,exitCode:1};let{commands:c,error:u,silentMode:f}=Ap(r,a);if(u)return{stdout:"",stderr:`sed: ${u}
|
|
318
|
+
`,exitCode:1};let p=!!(i||f);if(o){if(l.length===0)return{stdout:"",stderr:`sed: -i requires at least one file argument
|
|
319
|
+
`,exitCode:1};for(let m of l){if(m==="-")continue;let g=t.fs.resolvePath(t.cwd,m);try{let y=await n("in-place input read",()=>t.fs.readFile(g)),w=await n("in-place processing",()=>El(y,c,p,{limits:t.limits,filename:m,fs:t.fs,cwd:t.cwd,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext}));if(w.errorMessage)return{stdout:"",stderr:`${w.errorMessage}
|
|
320
|
+
`,exitCode:w.exitCode??1};await n("in-place output write",()=>t.fs.writeFile(g,w.output))}catch(y){if(y instanceof he)throw y;return y instanceof Q?{stdout:"",stderr:`sed: ${Be(y.message)}
|
|
321
|
+
`,exitCode:Q.EXIT_CODE}:{stdout:"",stderr:`sed: ${m}: No such file or directory
|
|
322
|
+
`,exitCode:1}}}return{stdout:"",stderr:"",exitCode:0}}let h="";if(l.length===0){h=t.stdin;try{let m=await n("stdin processing",()=>El(h,c,p,{limits:t.limits,fs:t.fs,cwd:t.cwd,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext}));return{stdout:m.output,stderr:m.errorMessage?`${m.errorMessage}
|
|
323
|
+
`:"",exitCode:m.exitCode??0}}catch(m){if(m instanceof he)throw m;if(m instanceof Q)return{stdout:"",stderr:`sed: ${Be(m.message)}
|
|
324
|
+
`,exitCode:Q.EXIT_CODE};throw m}}let d=!1;for(let m of l){let g;if(m==="-")d?g="":(g=t.stdin,d=!0);else{let y=t.fs.resolvePath(t.cwd,m);try{g=await n("input file read",()=>t.fs.readFile(y))}catch(w){if(w instanceof he)throw w;return w instanceof Q?{stdout:"",stderr:`sed: ${Be(w.message)}
|
|
325
|
+
`,exitCode:Q.EXIT_CODE}:{stdout:"",stderr:`sed: ${m}: No such file or directory
|
|
326
|
+
`,exitCode:1}}}h.length>0&&g.length>0&&!h.endsWith(`
|
|
327
|
+
`)&&(h+=`
|
|
328
|
+
`),h+=g}try{let m=await n("final processing",()=>El(h,c,p,{limits:t.limits,filename:l.length===1?l[0]:void 0,fs:t.fs,cwd:t.cwd,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext}));return{stdout:m.output,stderr:m.errorMessage?`${m.errorMessage}
|
|
329
|
+
`:"",exitCode:m.exitCode??0}}catch(m){if(m instanceof he)throw m;if(m instanceof Q)return{stdout:"",stderr:`sed: ${Be(m.message)}
|
|
330
|
+
`,exitCode:Q.EXIT_CODE};throw m}}},d8={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0}});function Et(e){return Object.assign(Object.create(null),Object.fromEntries(e))}function cn(e,t){return Object.assign(Object.create(null),Object.fromEntries(e),t)}function $r(...e){return Object.assign(Object.create(null),...e)}var Kn=v(()=>{"use strict"});function Al(e={}){let{fieldSep:t=y8,maxIterations:n=m8,maxRecursionDepth:r=g8,maxOutputSize:s=0,fs:i,cwd:o,exec:a,coverage:l,requireDefenseContext:c}=e;return{FS:" ",OFS:" ",ORS:`
|
|
331
|
+
`,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:r,maxOutputSize:s,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:i,cwd:o,exec:a,coverage:l,requireDefenseContext:c}}var m8,g8,y8,Ip=v(()=>{"use strict";Ve();m8=1e4,g8=100,y8=new Zn(/\s+/)});function $p(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}var Op=v(()=>{"use strict"});function un(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function At(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}async function Zi(e,t){if(e.type==="regex")return e.pattern;let n=At(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function Tp(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(un(await t.evalExpr(e.index)))}`:"$0":"$0"}function Pp(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return At(t.vars[e]??"")}function Dp(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let r=parseInt(e.slice(1),10)-1;for(;n.fields.length<=r;)n.fields.push("");n.fields[r]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function w8(e,t,n){return e.length===0?t.line.length:At(await n.evalExpr(e[0])).length}async function b8(e,t,n){if(e.length<2)return"";let r=At(await n.evalExpr(e[0])),s=Math.floor(un(await n.evalExpr(e[1])))-1;if(e.length>=3){let i=Math.floor(un(await n.evalExpr(e[2])));return r.substr(Math.max(0,s),i)}return r.substr(Math.max(0,s))}async function x8(e,t,n){if(e.length<2)return 0;let r=At(await n.evalExpr(e[0])),s=At(await n.evalExpr(e[1])),i=r.indexOf(s);return i===-1?0:i+1}async function E8(e,t,n){if(e.length<2)return 0;let r=At(await n.evalExpr(e[0])),s=e[1];if(s.type!=="variable")return 0;let i=s.name,o=t.FS;if(e.length>=3){let l=e[2];if(l.type==="regex")o=K(l.pattern);else{let c=At(await n.evalExpr(l));o=c===" "?K("\\s+"):c}}else t.FS===" "&&(o=K("\\s+"));let a=typeof o=="string"?r.split(o):o.split(r);t.arrays[i]=Object.create(null);for(let l=0;l<a.length;l++)t.arrays[i][String(l+1)]=a[l];return a.length}async function A8(e,t,n){if(e.length<2)return 0;let r=await Zi(e[0],n),s=At(await n.evalExpr(e[1])),i=await Tp(e[2],n),o=Pp(i,t);try{let l=K(r).replace(o,_p(s)),c=l!==o?1:0;return Dp(i,l,t),c}catch{return 0}}async function S8(e,t,n){if(e.length<2)return 0;let r=await Zi(e[0],n),s=At(await n.evalExpr(e[1])),i=await Tp(e[2],n),o=Pp(i,t);try{let a=K(r,"g"),l=a.match(o),c=l?l.length:0,u=a.replace(o,_p(s));return Dp(i,u,t),c}catch{return 0}}function _p(e){return t=>{let n="",r=0;for(;r<e.length;)if(e[r]==="\\"&&r+1<e.length){let s=e[r+1];s==="&"?(n+="&",r+=2):s==="\\"?(n+="\\",r+=2):(n+=e[r+1],r+=2)}else e[r]==="&"?(n+=t,r++):(n+=e[r],r++);return n}}async function C8(e,t,n){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let r=At(await n.evalExpr(e[0])),s=await Zi(e[1],n);try{let o=K(s).exec(r);if(o)return t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART}catch{}return t.RSTART=0,t.RLENGTH=-1,0}async function v8(e,t,n){if(e.length<3)return"";let r=await Zi(e[0],n),s=At(await n.evalExpr(e[1])),i=At(await n.evalExpr(e[2])),o=e.length>=4?At(await n.evalExpr(e[3])):t.line;try{let a=i.toLowerCase()==="g",l=a?0:parseInt(i,10)||1;if(a)return K(r,"g").replace(o,(u,...f)=>Rp(s,u,f.slice(0,-2)));{let c=0;return K(r,"g").replace(o,(f,...p)=>(c++,c===l?Rp(s,f,p.slice(0,-2)):f))}}catch{return o}}function Rp(e,t,n){let r="",s=0;for(;s<e.length;)if(e[s]==="\\"&&s+1<e.length){let i=e[s+1];if(i==="&")r+="&",s+=2;else if(i==="0")r+=t,s+=2;else if(i>="1"&&i<="9"){let o=parseInt(i,10)-1;r+=n[o]||"",s+=2}else i==="n"?(r+=`
|
|
332
|
+
`,s+=2):i==="t"?(r+=" ",s+=2):(r+=i,s+=2)}else e[s]==="&"?(r+=t,s++):(r+=e[s],s++);return r}async function k8(e,t,n){return e.length===0?"":At(await n.evalExpr(e[0])).toLowerCase()}async function N8(e,t,n){return e.length===0?"":At(await n.evalExpr(e[0])).toUpperCase()}async function I8(e,t,n){if(e.length===0)return"";let r=At(await n.evalExpr(e[0])),s=[];for(let i=1;i<e.length;i++)s.push(await n.evalExpr(e[i]));return Ki(r,s)}async function $8(e,t,n){return e.length===0?0:Math.floor(un(await n.evalExpr(e[0])))}async function O8(e,t,n){return e.length===0?0:Math.sqrt(un(await n.evalExpr(e[0])))}async function R8(e,t,n){return e.length===0?0:Math.sin(un(await n.evalExpr(e[0])))}async function T8(e,t,n){return e.length===0?0:Math.cos(un(await n.evalExpr(e[0])))}async function P8(e,t,n){let r=e.length>0?un(await n.evalExpr(e[0])):0,s=e.length>1?un(await n.evalExpr(e[1])):0;return Math.atan2(r,s)}async function D8(e,t,n){return e.length===0?0:Math.log(un(await n.evalExpr(e[0])))}async function _8(e,t,n){return e.length===0?1:Math.exp(un(await n.evalExpr(e[0])))}function F8(e,t,n){return t.random?t.random():Math.random()}async function L8(e,t,n){let r=e.length>0?un(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=r,r}function M8(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function Sl(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}function Ki(e,t){let n=0,r="",s=0;for(;s<e.length;)if(e[s]==="%"&&s+1<e.length){let i=s+1,o="",a="",l="",c,u=i;for(;i<e.length&&/\d/.test(e[i]);)i++;i>u&&e[i]==="$"?(c=parseInt(e.substring(u,i),10)-1,i++):i=u;let f=()=>{if(i<e.length){if(i+1<e.length&&(e[i]==="h"&&e[i+1]==="h"||e[i]==="l"&&e[i+1]==="l")){i+=2;return}/[lzjh]/.test(e[i])&&i++}};for(;i<e.length&&/[-+ #0]/.test(e[i]);)o+=e[i++];if(e[i]==="*"){let m=t[n++],g=m!==void 0?Math.floor(Number(m)):0;g<0?(o+="-",a=String(Math.min(-g,Or))):a=String(Math.min(g,Or)),i++}else for(;i<e.length&&/\d/.test(e[i]);)a+=e[i++];if(a&&parseInt(a,10)>Or&&(a=String(Or)),e[i]==="."){if(i++,e[i]==="*"){let m=t[n++];l=String(Math.min(m!==void 0?Math.floor(Number(m)):0,Or)),i++}else for(;i<e.length&&/\d/.test(e[i]);)l+=e[i++];l&&parseInt(l,10)>Or&&(l=String(Or))}f();let p=e[i],d=t[c!==void 0?c:n];switch(p){case"s":{let m=d!==void 0?String(d):"";if(l&&(m=m.substring(0,parseInt(l,10))),a){let g=parseInt(a,10);o.includes("-")?m=m.padEnd(g):m=m.padStart(g)}r+=m,c===void 0&&n++;break}case"d":case"i":{let m=d!==void 0?Math.floor(Number(d)):0;Number.isNaN(m)&&(m=0);let g=m<0,y=Math.abs(m).toString();if(l){let x=parseInt(l,10);y=y.padStart(x,"0")}let w="";g?w="-":o.includes("+")?w="+":o.includes(" ")&&(w=" ");let b=w+y;if(a){let x=parseInt(a,10);o.includes("-")?b=b.padEnd(x):o.includes("0")&&!l?b=w+y.padStart(x-w.length,"0"):b=b.padStart(x)}r+=b,c===void 0&&n++;break}case"f":{let m=d!==void 0?Number(d):0;Number.isNaN(m)&&(m=0);let g=l?parseInt(l,10):6,y=m.toFixed(g);if(a){let w=parseInt(a,10);o.includes("-")?y=y.padEnd(w):y=y.padStart(w)}r+=y,c===void 0&&n++;break}case"e":case"E":{let m=d!==void 0?Number(d):0;Number.isNaN(m)&&(m=0);let g=l?parseInt(l,10):6,y=m.toExponential(g);if(p==="E"&&(y=y.toUpperCase()),a){let w=parseInt(a,10);o.includes("-")?y=y.padEnd(w):y=y.padStart(w)}r+=y,c===void 0&&n++;break}case"g":case"G":{let m=d!==void 0?Number(d):0;Number.isNaN(m)&&(m=0);let g=l?parseInt(l,10):6,y=m!==0?Math.floor(Math.log10(Math.abs(m))):0,w;if(m===0?w="0":y<-4||y>=g?(w=m.toExponential(g-1),p==="G"&&(w=w.toUpperCase())):w=m.toPrecision(g),w.includes(".")&&(w=w.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),w.includes("e")&&(w=w.replace(/\.?0+e/,"e")),a){let b=parseInt(a,10);o.includes("-")?w=w.padEnd(b):w=w.padStart(b)}r+=w,c===void 0&&n++;break}case"x":case"X":{let m=d!==void 0?Math.floor(Number(d)):0;Number.isNaN(m)&&(m=0);let g=Math.abs(m).toString(16);if(p==="X"&&(g=g.toUpperCase()),l){let b=parseInt(l,10);g=g.padStart(b,"0")}let y=m<0?"-":"",w=y+g;if(a){let b=parseInt(a,10);o.includes("-")?w=w.padEnd(b):o.includes("0")&&!l?w=y+g.padStart(b-y.length,"0"):w=w.padStart(b)}r+=w,c===void 0&&n++;break}case"o":{let m=d!==void 0?Math.floor(Number(d)):0;Number.isNaN(m)&&(m=0);let g=Math.abs(m).toString(8);if(l){let b=parseInt(l,10);g=g.padStart(b,"0")}let y=m<0?"-":"",w=y+g;if(a){let b=parseInt(a,10);o.includes("-")?w=w.padEnd(b):o.includes("0")&&!l?w=y+g.padStart(b-y.length,"0"):w=w.padStart(b)}r+=w,c===void 0&&n++;break}case"c":{typeof d=="number"?r+=String.fromCharCode(d):r+=String(d??"").charAt(0)||"",c===void 0&&n++;break}case"%":r+="%";break;default:r+=e.substring(s,i+1)}s=i+1}else if(e[s]==="\\"&&s+1<e.length){let i=e[s+1];switch(i){case"n":r+=`
|
|
333
|
+
`;break;case"t":r+=" ";break;case"r":r+="\r";break;case"\\":r+="\\";break;default:r+=i}s+=2}else r+=e[s++];return r}var Or,Fp,Cl=v(()=>{"use strict";Ve();Or=1e4;Fp=new Map([["length",w8],["substr",b8],["index",x8],["split",E8],["sub",A8],["gsub",S8],["match",C8],["gensub",v8],["tolower",k8],["toupper",N8],["sprintf",I8],["int",$8],["sqrt",O8],["sin",R8],["cos",T8],["atan2",P8],["log",D8],["exp",_8],["rand",F8],["srand",L8],["system",M8("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",Sl("systime")],["mktime",Sl("mktime")],["strftime",Sl("strftime")]])});function Pt(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function Ye(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function _e(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function vl(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function Xs(e,t){try{return K(e).test(t)}catch{return!1}}var ls=v(()=>{"use strict";Ve()});function Lp(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function Qi(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function kl(e,t,n){if(t===0)e.line=_e(n),e.fields=Lp(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=_e(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function cs(e,t){e.line=t,e.fields=Lp(e,t),e.NF=e.fields.length}function Mp(e,t){if(e.FS=t,t===" ")e.fieldSep=new Zn(/\s+/);else try{e.fieldSep=K(t)}catch{e.fieldSep=K(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}var Xi=v(()=>{"use strict";Ve();ls()});function Yi(e,t){switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return e.vars[t]??""}function us(e,t,n){switch(t){case"FS":Mp(e,_e(n));return;case"OFS":e.OFS=_e(n);return;case"ORS":e.ORS=_e(n);return;case"OFMT":e.OFMT=_e(n);return;case"NR":e.NR=Math.floor(Ye(n));return;case"NF":{let r=Math.floor(Ye(n));if(r<e.NF)e.fields=e.fields.slice(0,r),e.line=e.fields.join(e.OFS);else if(r>e.NF){for(;e.fields.length<r;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=r;return}case"FNR":e.FNR=Math.floor(Ye(n));return;case"FILENAME":e.FILENAME=_e(n);return;case"RSTART":e.RSTART=Math.floor(Ye(n));return;case"RLENGTH":e.RLENGTH=Math.floor(Ye(n));return;case"SUBSEP":e.SUBSEP=_e(n);return}e.vars[t]=n}function Ys(e,t){let n=t,r=new Set,s=e.arrayAliases.get(n);for(;s!==void 0&&!r.has(n);)r.add(n),n=s,s=e.arrayAliases.get(n);return n}function Ji(e,t,n){if(t==="ARGV")return e.ARGV[n]??"";if(t==="ENVIRON")return e.ENVIRON[n]??"";let r=Ys(e,t);return e.arrays[r]?.[n]??""}function Nl(e,t,n,r){let s=Ys(e,t);e.arrays[s]||(e.arrays[s]=Object.create(null)),e.arrays[s][n]=r}function Up(e,t,n){if(t==="ARGV")return e.ARGV[n]!==void 0;if(t==="ENVIRON")return e.ENVIRON[n]!==void 0;let r=Ys(e,t);return e.arrays[r]?.[n]!==void 0}function Bp(e,t,n){let r=Ys(e,t);e.arrays[r]&&delete e.arrays[r][n]}function Wp(e,t){let n=Ys(e,t);delete e.arrays[n]}var Il=v(()=>{"use strict";Xi();ls()});function Hp(e){zp=e}function Wt(e,t){rt(e.requireDefenseContext,"awk",t)}function Pe(e,t,n){return Tt(e.requireDefenseContext,"awk",t,n)}async function le(e,t){switch(Wt(e,"expression evaluation"),e.coverage?.hit(`awk:expr:${t.type}`),t.type){case"number":return t.value;case"string":return t.value;case"regex":return Xs(t.pattern,e.line)?1:0;case"field":return U8(e,t);case"variable":return Yi(e,t.name);case"array_access":return B8(e,t);case"binary":return W8(e,t);case"unary":return j8(e,t);case"ternary":return Pt(await Pe(e,"ternary condition evaluation",()=>le(e,t.condition)))?await Pe(e,"ternary consequent evaluation",()=>le(e,t.consequent)):await Pe(e,"ternary alternate evaluation",()=>le(e,t.alternate));case"call":return G8(e,t.name,t.args);case"assignment":return q8(e,t);case"pre_increment":return Z8(e,t.operand);case"pre_decrement":return K8(e,t.operand);case"post_increment":return Q8(e,t.operand);case"post_decrement":return X8(e,t.operand);case"in":return Y8(e,t.key,t.array);case"getline":return J8(e,t.variable,t.file,t.command);case"tuple":return n9(e,t.elements);default:return""}}async function U8(e,t){Wt(e,"field reference evaluation");let n=Math.floor(Ye(await Pe(e,"field index evaluation",()=>le(e,t.index))));return Qi(e,n)}async function B8(e,t){Wt(e,"array access evaluation");let n=_e(await Pe(e,"array key evaluation",()=>le(e,t.key)));return Ji(e,t.array,n)}async function W8(e,t){Wt(e,"binary expression evaluation");let n=t.operator;if(n==="||")return Pt(await Pe(e,"logical-or left evaluation",()=>le(e,t.left)))||Pt(await Pe(e,"logical-or right evaluation",()=>le(e,t.right)))?1:0;if(n==="&&")return Pt(await Pe(e,"logical-and left evaluation",()=>le(e,t.left)))&&Pt(await Pe(e,"logical-and right evaluation",()=>le(e,t.right)))?1:0;if(n==="~"){let a=await Pe(e,"regex left evaluation",()=>le(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let l=t.right.type==="regex"?t.right.pattern:_e(await Pe(e,"regex right evaluation",()=>le(e,t.right)));try{return K(l).test(_e(a))?1:0}catch{return 0}}if(n==="!~"){let a=await Pe(e,"negated-regex left evaluation",()=>le(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let l=t.right.type==="regex"?t.right.pattern:_e(await Pe(e,"negated-regex right evaluation",()=>le(e,t.right)));try{return K(l).test(_e(a))?0:1}catch{return 1}}let r=await Pe(e,"binary left evaluation",()=>le(e,t.left)),s=await Pe(e,"binary right evaluation",()=>le(e,t.right));if(n===" "){let a=_e(r)+_e(s);if(e.maxOutputSize>0&&a.length>e.maxOutputSize)throw new Q(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output);return a}if(z8(n))return H8(r,s,n);let i=Ye(r),o=Ye(s);return $p(i,o,n)}function z8(e){return["<","<=",">",">=","==","!="].includes(e)}function H8(e,t,n){let r=vl(e),s=vl(t);if(r&&s){let a=Ye(e),l=Ye(t);switch(n){case"<":return a<l?1:0;case"<=":return a<=l?1:0;case">":return a>l?1:0;case">=":return a>=l?1:0;case"==":return a===l?1:0;case"!=":return a!==l?1:0}}let i=_e(e),o=_e(t);switch(n){case"<":return i<o?1:0;case"<=":return i<=o?1:0;case">":return i>o?1:0;case">=":return i>=o?1:0;case"==":return i===o?1:0;case"!=":return i!==o?1:0}return 0}async function j8(e,t){Wt(e,"unary expression evaluation");let n=await Pe(e,"unary operand evaluation",()=>le(e,t.operand));switch(t.operator){case"!":return Pt(n)?0:1;case"-":return-Ye(n);case"+":return+Ye(n);default:return n}}async function G8(e,t,n){Wt(e,"function call evaluation");let r=Fp.get(t);if(r)return r(n,e,{evalExpr:i=>le(e,i)});let s=e.functions.get(t);return s?V8(e,s,n):""}async function V8(e,t,n){if(Wt(e,"user function call"),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new Q(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let r=Object.create(null);for(let a of t.params)r[a]=e.vars[a];let s=[];for(let a=0;a<t.params.length;a++){let l=t.params[a];if(a<n.length){let c=n[a];c.type==="variable"&&(e.arrayAliases.set(l,c.name),s.push(l));let u=await Pe(e,"user function argument evaluation",()=>le(e,c));e.vars[l]=u}else e.vars[l]=""}e.hasReturn=!1,e.returnValue=void 0;let i=zp;i&&await Pe(e,"user function body execution",()=>i(e,t.body.statements));let o=e.returnValue??"";for(let a of t.params)r[a]!==void 0?e.vars[a]=r[a]:delete e.vars[a];for(let a of s)e.arrayAliases.delete(a);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,o}async function q8(e,t){Wt(e,"assignment evaluation");let n=await Pe(e,"assignment value evaluation",()=>le(e,t.value)),r=t.target,s=t.operator,i;if(s==="=")i=n;else{let o;if(r.type==="field"){let c=Math.floor(Ye(await Pe(e,"assignment field index",()=>le(e,r.index))));o=Qi(e,c)}else if(r.type==="variable")o=Yi(e,r.name);else{let c=_e(await Pe(e,"assignment array key",()=>le(e,r.key)));o=Ji(e,r.array,c)}let a=Ye(o),l=Ye(n);switch(s){case"+=":i=a+l;break;case"-=":i=a-l;break;case"*=":i=a*l;break;case"/=":i=l!==0?a/l:0;break;case"%=":i=l!==0?a%l:0;break;case"^=":i=a**l;break;default:i=n}}if(r.type==="field"){let o=Math.floor(Ye(await Pe(e,"assignment target field index",()=>le(e,r.index))));kl(e,o,i)}else if(r.type==="variable")us(e,r.name,i);else{let o=_e(await Pe(e,"assignment target array key",()=>le(e,r.key)));Nl(e,r.array,o,i)}return i}async function eo(e,t,n,r){Wt(e,"inc/dec evaluation");let s;if(t.type==="field"){let i=Math.floor(Ye(await Pe(e,"inc/dec field index",()=>le(e,t.index))));s=Ye(Qi(e,i)),kl(e,i,s+n)}else if(t.type==="variable")s=Ye(Yi(e,t.name)),us(e,t.name,s+n);else{let i=_e(await Pe(e,"inc/dec array key",()=>le(e,t.key)));s=Ye(Ji(e,t.array,i)),Nl(e,t.array,i,s+n)}return r?s+n:s}async function Z8(e,t){return eo(e,t,1,!0)}async function K8(e,t){return eo(e,t,-1,!0)}async function Q8(e,t){return eo(e,t,1,!1)}async function X8(e,t){return eo(e,t,-1,!1)}async function Y8(e,t,n){Wt(e,"in-expression evaluation");let r;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let s=[];for(let i of t.elements)s.push(_e(await Pe(e,"tuple key element evaluation",()=>le(e,i))));r=s.join(e.SUBSEP)}else r=_e(await Pe(e,"in-expression key evaluation",()=>le(e,t)));return Up(e,n,r)?1:0}async function J8(e,t,n,r){if(Wt(e,"getline evaluation"),r)return e9(e,t,r);if(n)return t9(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let s=e.lineIndex+1;if(s>=e.lines.length)return 0;let i=e.lines[s];return t?us(e,t,i):cs(e,i),e.NR++,e.lineIndex=s,1}async function e9(e,t,n){let r=e.exec;if(!r)return-1;Wt(e,"getline command source");let s=_e(await Pe(e,"getline command expression",()=>le(e,n))),i=`__cmd_${s}`,o=`__cmdi_${s}`,a,l;if(e.vars[i]===void 0)try{a=(await Pe(e,"getline command exec",()=>r(s))).stdout.split(`
|
|
334
|
+
`),a.length>0&&a[a.length-1]===""&&a.pop(),e.vars[i]=JSON.stringify(a),e.vars[o]=-1,l=-1}catch(f){if(f instanceof he)throw f;return-1}else a=JSON.parse(e.vars[i]),l=e.vars[o];let c=l+1;if(c>=a.length)return 0;let u=a[c];return e.vars[o]=c,t?us(e,t,u):cs(e,u),1}async function t9(e,t,n){let r=e.fs;if(!r||!e.cwd)return-1;Wt(e,"getline file source");let s=_e(await Pe(e,"getline filename evaluation",()=>le(e,n)));if(s==="/dev/null")return 0;let i=r.resolvePath(e.cwd,s),o=`__fc_${i}`,a=`__fi_${i}`,l,c;if(e.vars[o]===void 0)try{l=(await Pe(e,"getline file read",()=>r.readFile(i))).split(`
|
|
335
|
+
`),l.length>0&&l[l.length-1]===""&&l.pop(),e.vars[o]=JSON.stringify(l),e.vars[a]=-1,c=-1}catch(p){if(p instanceof he)throw p;return-1}else l=JSON.parse(e.vars[o]),c=e.vars[a];let u=c+1;if(u>=l.length)return 0;let f=l[u];return e.vars[a]=u,t?us(e,t,f):cs(e,f),1}async function n9(e,t){if(Wt(e,"tuple evaluation"),t.length===0)return"";for(let n=0;n<t.length-1;n++)await Pe(e,"tuple intermediate element",()=>le(e,t[n]));return Pe(e,"tuple final element",()=>le(e,t[t.length-1]))}var zp,$l=v(()=>{"use strict";xe();Ve();Fn();an();Op();Cl();Xi();ls();Il();zp=null});function Ol(e){if(e.maxOutputSize>0&&e.output.length>e.maxOutputSize)throw new Q(`awk: output size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output)}function En(e,t){rt(e.requireDefenseContext,"awk",t)}function $e(e,t,n){return Tt(e.requireDefenseContext,"awk",t,n)}async function fs(e,t){En(e,"block execution");for(let n of t)if(await $e(e,"statement execution",()=>Rr(e,n)),r9(e))break}function r9(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}async function Rr(e,t){switch(En(e,"single statement execution"),e.coverage?.hit(`awk:stmt:${t.type}`),t.type){case"block":await $e(e,"nested block statement",()=>fs(e,t.statements));break;case"expr_stmt":await $e(e,"expression statement",()=>le(e,t.expression));break;case"print":await $e(e,"print statement",()=>s9(e,t.args,t.output));break;case"printf":await $e(e,"printf statement",()=>i9(e,t.format,t.args,t.output));break;case"if":await $e(e,"if statement",()=>o9(e,t));break;case"while":await $e(e,"while statement",()=>a9(e,t));break;case"do_while":await $e(e,"do-while statement",()=>l9(e,t));break;case"for":await $e(e,"for statement",()=>c9(e,t));break;case"for_in":await $e(e,"for-in statement",()=>u9(e,t));break;case"break":e.loopBreak=!0;break;case"continue":e.loopContinue=!0;break;case"next":e.shouldNext=!0;break;case"nextfile":e.shouldNextFile=!0;break;case"exit":e.shouldExit=!0;{let n=t.code;e.exitCode=n?Math.floor(Ye(await $e(e,"exit code expression",()=>le(e,n)))):0}break;case"return":e.hasReturn=!0;{let n=t.value;e.returnValue=n?await $e(e,"return expression",()=>le(e,n)):""}break;case"delete":await $e(e,"delete statement",()=>f9(e,t.target));break}}async function s9(e,t,n){En(e,"print execution");let r=[];for(let i of t){let o=await $e(e,"print argument evaluation",()=>le(e,i));typeof o=="number"?Number.isInteger(o)&&Math.abs(o)<Number.MAX_SAFE_INTEGER?r.push(String(o)):r.push(Ki(e.OFMT,[o])):r.push(_e(o))}let s=r.join(e.OFS)+e.ORS;n?await $e(e,"print redirection write",()=>jp(e,n.redirect,n.file,s)):(e.output+=s,Ol(e))}async function i9(e,t,n,r){En(e,"printf execution");let s=_e(await $e(e,"printf format evaluation",()=>le(e,t))),i=[];for(let a of n)i.push(await $e(e,"printf argument evaluation",()=>le(e,a)));let o=Ki(s,i);r?await $e(e,"printf redirection write",()=>jp(e,r.redirect,r.file,o)):(e.output+=o,Ol(e))}async function jp(e,t,n,r){En(e,"file write execution");let s=e.fs;if(!s||!e.cwd){e.output+=r,Ol(e);return}let i=_e(await $e(e,"redirection filename evaluation",()=>le(e,n))),o=s.resolvePath(e.cwd,i);t===">"?e.openedFiles.has(o)?await $e(e,"redirection append write",()=>s.appendFile(o,r)):(await $e(e,"redirection overwrite write",()=>s.writeFile(o,r)),e.openedFiles.add(o)):(e.openedFiles.has(o)||e.openedFiles.add(o),await $e(e,"redirection append mode write",()=>s.appendFile(o,r)))}async function o9(e,t){if(En(e,"if execution"),Pt(await $e(e,"if condition evaluation",()=>le(e,t.condition))))await $e(e,"if consequent execution",()=>Rr(e,t.consequent));else if(t.alternate){let n=t.alternate;await $e(e,"if alternate execution",()=>Rr(e,n))}}async function a9(e,t){En(e,"while execution");let n=0;for(;Pt(await $e(e,"while condition evaluation",()=>le(e,t.condition)));){if(n++,n>e.maxIterations)throw new Q(`awk: while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await $e(e,"while body execution",()=>Rr(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function l9(e,t){En(e,"do-while execution");let n=0;do{if(n++,n>e.maxIterations)throw new Q(`awk: do-while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await $e(e,"do-while body execution",()=>Rr(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}while(Pt(await $e(e,"do-while condition evaluation",()=>le(e,t.condition))))}async function c9(e,t){En(e,"for execution");let n=t.init,r=t.condition,s=t.update;n&&await $e(e,"for init evaluation",()=>le(e,n));let i=0;for(;!r||Pt(await $e(e,"for condition evaluation",()=>le(e,r)));){if(i++,i>e.maxIterations)throw new Q(`awk: for loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await $e(e,"for body execution",()=>Rr(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break;s&&await $e(e,"for update evaluation",()=>le(e,s))}}async function u9(e,t){En(e,"for-in execution");let n=e.arrays[t.array];if(n)for(let r of Object.keys(n)){if(e.vars[t.variable]=r,e.loopContinue=!1,await $e(e,"for-in body execution",()=>Rr(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function f9(e,t){if(En(e,"delete execution"),t.type==="array_access"){let n=_e(await $e(e,"delete key evaluation",()=>le(e,t.key)));Bp(e,t.array,n)}else t.type==="variable"&&Wp(e,t.name)}var Gp=v(()=>{"use strict";xe();Fn();Cl();$l();ls();Il();Hp(fs)});var Js,Vp=v(()=>{"use strict";Fn();$l();Xi();Gp();ls();Js=class{ctx;program=null;rangeStates=[];constructor(t){this.ctx=t}assertDefenseContext(t){rt(this.ctx.requireDefenseContext,"awk",t)}withDefenseContext(t,n){return Tt(this.ctx.requireDefenseContext,"awk",t,n)}execute(t){this.assertDefenseContext("program initialization"),this.program=t,this.ctx.output="";for(let n of t.functions)this.ctx.functions.set(n.name,n);this.rangeStates=t.rules.map(()=>!1)}async executeBegin(){if(this.assertDefenseContext("BEGIN execution entry"),!!this.program){for(let t of this.program.rules)if(t.pattern?.type==="begin"&&(await this.withDefenseContext("BEGIN block execution",()=>fs(this.ctx,t.action.statements)),this.ctx.shouldExit))break}}async executeLine(t){if(this.assertDefenseContext("line execution entry"),!(!this.program||this.ctx.shouldExit)){cs(this.ctx,t),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;for(let n=0;n<this.program.rules.length&&!(this.ctx.shouldExit||this.ctx.shouldNext||this.ctx.shouldNextFile);n++){let r=this.program.rules[n];r.pattern?.type==="begin"||r.pattern?.type==="end"||await this.withDefenseContext("rule match",()=>this.matchesRule(r,n))&&await this.withDefenseContext("rule block execution",()=>fs(this.ctx,r.action.statements))}}}async executeEnd(){if(this.assertDefenseContext("END execution entry"),!!this.program&&!this.ctx.inEndBlock){this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;for(let t of this.program.rules)if(t.pattern?.type==="end"&&(await this.withDefenseContext("END block execution",()=>fs(this.ctx,t.action.statements)),this.ctx.shouldExit))break;this.ctx.inEndBlock=!1}}getOutput(){return this.ctx.output}getExitCode(){return this.ctx.exitCode}getContext(){return this.ctx}async matchesRule(t,n){this.assertDefenseContext("rule matching");let r=t.pattern;if(!r)return!0;switch(r.type){case"begin":case"end":return!1;case"regex_pattern":return Xs(r.pattern,this.ctx.line);case"expr_pattern":return Pt(await this.withDefenseContext("expression pattern evaluation",()=>le(this.ctx,r.expression)));case"range":{let s=await this.withDefenseContext("range start pattern",()=>this.matchPattern(r.start)),i=await this.withDefenseContext("range end pattern",()=>this.matchPattern(r.end));return this.rangeStates[n]?(i&&(this.rangeStates[n]=!1),!0):s?(this.rangeStates[n]=!0,i&&(this.rangeStates[n]=!1),!0):!1}default:return!1}}async matchPattern(t){switch(this.assertDefenseContext("pattern matching"),t.type){case"regex_pattern":return Xs(t.pattern,this.ctx.line);case"expr_pattern":return Pt(await this.withDefenseContext("nested expression pattern",()=>le(this.ctx,t.expression)));default:return!1}}}});var qp=v(()=>{"use strict";Ip();Vp()});function h9(e){return e.replace(/\[\[:space:\]\]/g,"[ \\t\\n\\r\\f\\v]").replace(/\[\[:blank:\]\]/g,"[ \\t]").replace(/\[\[:alpha:\]\]/g,"[a-zA-Z]").replace(/\[\[:digit:\]\]/g,"[0-9]").replace(/\[\[:alnum:\]\]/g,"[a-zA-Z0-9]").replace(/\[\[:upper:\]\]/g,"[A-Z]").replace(/\[\[:lower:\]\]/g,"[a-z]").replace(/\[\[:punct:\]\]/g,"[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~]").replace(/\[\[:xdigit:\]\]/g,"[0-9A-Fa-f]").replace(/\[\[:graph:\]\]/g,"[!-~]").replace(/\[\[:print:\]\]/g,"[ -~]").replace(/\[\[:cntrl:\]\]/g,"[\\x00-\\x1f\\x7f]")}var S,p9,to,Zp=v(()=>{"use strict";(function(e){e.NUMBER="NUMBER",e.STRING="STRING",e.REGEX="REGEX",e.IDENT="IDENT",e.BEGIN="BEGIN",e.END="END",e.IF="IF",e.ELSE="ELSE",e.WHILE="WHILE",e.DO="DO",e.FOR="FOR",e.IN="IN",e.BREAK="BREAK",e.CONTINUE="CONTINUE",e.NEXT="NEXT",e.NEXTFILE="NEXTFILE",e.EXIT="EXIT",e.RETURN="RETURN",e.DELETE="DELETE",e.FUNCTION="FUNCTION",e.PRINT="PRINT",e.PRINTF="PRINTF",e.GETLINE="GETLINE",e.PLUS="PLUS",e.MINUS="MINUS",e.STAR="STAR",e.SLASH="SLASH",e.PERCENT="PERCENT",e.CARET="CARET",e.EQ="EQ",e.NE="NE",e.LT="LT",e.GT="GT",e.LE="LE",e.GE="GE",e.MATCH="MATCH",e.NOT_MATCH="NOT_MATCH",e.AND="AND",e.OR="OR",e.NOT="NOT",e.ASSIGN="ASSIGN",e.PLUS_ASSIGN="PLUS_ASSIGN",e.MINUS_ASSIGN="MINUS_ASSIGN",e.STAR_ASSIGN="STAR_ASSIGN",e.SLASH_ASSIGN="SLASH_ASSIGN",e.PERCENT_ASSIGN="PERCENT_ASSIGN",e.CARET_ASSIGN="CARET_ASSIGN",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.QUESTION="QUESTION",e.COLON="COLON",e.COMMA="COMMA",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.LBRACKET="LBRACKET",e.RBRACKET="RBRACKET",e.DOLLAR="DOLLAR",e.APPEND="APPEND",e.PIPE="PIPE",e.EOF="EOF"})(S||(S={}));p9=new Map([["BEGIN",S.BEGIN],["END",S.END],["if",S.IF],["else",S.ELSE],["while",S.WHILE],["do",S.DO],["for",S.FOR],["in",S.IN],["break",S.BREAK],["continue",S.CONTINUE],["next",S.NEXT],["nextfile",S.NEXTFILE],["exit",S.EXIT],["return",S.RETURN],["delete",S.DELETE],["function",S.FUNCTION],["print",S.PRINT],["printf",S.PRINTF],["getline",S.GETLINE]]);to=class{input;pos=0;line=1;column=1;lastTokenType=null;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&(t.push(n),this.lastTokenType=n.type)}return t.push(this.makeToken(S.EOF,"")),t}makeToken(t,n){return{type:t,value:n,line:this.line,column:this.column}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
|
|
336
|
+
`?(this.line++,this.column=1):this.column++,t}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.peek();if(t===" "||t===" "||t==="\r")this.advance();else if(t==="\\")if(this.peek(1)===`
|
|
337
|
+
`)this.advance(),this.advance();else break;else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
|
|
338
|
+
`;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let t=this.line,n=this.column,r=this.peek();return r===`
|
|
339
|
+
`?(this.advance(),{type:S.NEWLINE,value:`
|
|
340
|
+
`,line:t,column:n}):r==='"'?this.readString():r==="/"&&this.canBeRegex()?this.readRegex():this.isDigit(r)||r==="."&&this.isDigit(this.peek(1))?this.readNumber():this.isAlpha(r)||r==="_"?this.readIdentifier():this.readOperator()}canBeRegex(){return new Set([null,S.NEWLINE,S.SEMICOLON,S.LBRACE,S.RBRACE,S.LPAREN,S.LBRACKET,S.COMMA,S.ASSIGN,S.PLUS_ASSIGN,S.MINUS_ASSIGN,S.STAR_ASSIGN,S.SLASH_ASSIGN,S.PERCENT_ASSIGN,S.CARET_ASSIGN,S.AND,S.OR,S.NOT,S.MATCH,S.NOT_MATCH,S.QUESTION,S.COLON,S.LT,S.GT,S.LE,S.GE,S.EQ,S.NE,S.PLUS,S.MINUS,S.STAR,S.PERCENT,S.CARET,S.PRINT,S.PRINTF,S.IF,S.WHILE,S.DO,S.FOR,S.RETURN]).has(this.lastTokenType)}readString(){let t=this.line,n=this.column;this.advance();let r="";for(;this.pos<this.input.length&&this.peek()!=='"';)if(this.peek()==="\\"){this.advance();let s=this.advance();switch(s){case"n":r+=`
|
|
341
|
+
`;break;case"t":r+=" ";break;case"r":r+="\r";break;case"f":r+="\f";break;case"b":r+="\b";break;case"v":r+="\v";break;case"a":r+="\x07";break;case"\\":r+="\\";break;case'"':r+='"';break;case"/":r+="/";break;case"x":{let i="";for(;i.length<2&&/[0-9a-fA-F]/.test(this.peek());)i+=this.advance();i.length>0?r+=String.fromCharCode(parseInt(i,16)):r+="x";break}default:if(/[0-7]/.test(s)){let i=s;for(;i.length<3&&/[0-7]/.test(this.peek());)i+=this.advance();r+=String.fromCharCode(parseInt(i,8))}else r+=s}}else r+=this.advance();return this.peek()==='"'&&this.advance(),{type:S.STRING,value:r,line:t,column:n}}readRegex(){let t=this.line,n=this.column;this.advance();let r="";for(;this.pos<this.input.length&&this.peek()!=="/";)if(this.peek()==="\\")r+=this.advance(),this.pos<this.input.length&&(r+=this.advance());else{if(this.peek()===`
|
|
342
|
+
`)break;r+=this.advance()}return this.peek()==="/"&&this.advance(),r=h9(r),{type:S.REGEX,value:r,line:t,column:n}}readNumber(){let t=this.line,n=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="."&&this.isDigit(this.peek(1)))for(r+=this.advance();this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(r+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(r+=this.advance());this.isDigit(this.peek());)r+=this.advance();return{type:S.NUMBER,value:parseFloat(r),line:t,column:n}}readIdentifier(){let t=this.line,n=this.column,r="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)r+=this.advance();let s=p9.get(r);return s!==void 0?{type:s,value:r,line:t,column:n}:{type:S.IDENT,value:r,line:t,column:n}}readOperator(){let t=this.line,n=this.column,r=this.advance(),s=this.peek();switch(r){case"+":return s==="+"?(this.advance(),{type:S.INCREMENT,value:"++",line:t,column:n}):s==="="?(this.advance(),{type:S.PLUS_ASSIGN,value:"+=",line:t,column:n}):{type:S.PLUS,value:"+",line:t,column:n};case"-":return s==="-"?(this.advance(),{type:S.DECREMENT,value:"--",line:t,column:n}):s==="="?(this.advance(),{type:S.MINUS_ASSIGN,value:"-=",line:t,column:n}):{type:S.MINUS,value:"-",line:t,column:n};case"*":return s==="*"?(this.advance(),{type:S.CARET,value:"**",line:t,column:n}):s==="="?(this.advance(),{type:S.STAR_ASSIGN,value:"*=",line:t,column:n}):{type:S.STAR,value:"*",line:t,column:n};case"/":return s==="="?(this.advance(),{type:S.SLASH_ASSIGN,value:"/=",line:t,column:n}):{type:S.SLASH,value:"/",line:t,column:n};case"%":return s==="="?(this.advance(),{type:S.PERCENT_ASSIGN,value:"%=",line:t,column:n}):{type:S.PERCENT,value:"%",line:t,column:n};case"^":return s==="="?(this.advance(),{type:S.CARET_ASSIGN,value:"^=",line:t,column:n}):{type:S.CARET,value:"^",line:t,column:n};case"=":return s==="="?(this.advance(),{type:S.EQ,value:"==",line:t,column:n}):{type:S.ASSIGN,value:"=",line:t,column:n};case"!":return s==="="?(this.advance(),{type:S.NE,value:"!=",line:t,column:n}):s==="~"?(this.advance(),{type:S.NOT_MATCH,value:"!~",line:t,column:n}):{type:S.NOT,value:"!",line:t,column:n};case"<":return s==="="?(this.advance(),{type:S.LE,value:"<=",line:t,column:n}):{type:S.LT,value:"<",line:t,column:n};case">":return s==="="?(this.advance(),{type:S.GE,value:">=",line:t,column:n}):s===">"?(this.advance(),{type:S.APPEND,value:">>",line:t,column:n}):{type:S.GT,value:">",line:t,column:n};case"&":return s==="&"?(this.advance(),{type:S.AND,value:"&&",line:t,column:n}):{type:S.IDENT,value:"&",line:t,column:n};case"|":return s==="|"?(this.advance(),{type:S.OR,value:"||",line:t,column:n}):{type:S.PIPE,value:"|",line:t,column:n};case"~":return{type:S.MATCH,value:"~",line:t,column:n};case"?":return{type:S.QUESTION,value:"?",line:t,column:n};case":":return{type:S.COLON,value:":",line:t,column:n};case",":return{type:S.COMMA,value:",",line:t,column:n};case";":return{type:S.SEMICOLON,value:";",line:t,column:n};case"(":return{type:S.LPAREN,value:"(",line:t,column:n};case")":return{type:S.RPAREN,value:")",line:t,column:n};case"{":return{type:S.LBRACE,value:"{",line:t,column:n};case"}":return{type:S.RBRACE,value:"}",line:t,column:n};case"[":return{type:S.LBRACKET,value:"[",line:t,column:n};case"]":return{type:S.RBRACKET,value:"]",line:t,column:n};case"$":return{type:S.DOLLAR,value:"$",line:t,column:n};default:return{type:S.IDENT,value:r,line:t,column:n}}}isDigit(t){return t>="0"&&t<="9"}isAlpha(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isAlphaNumeric(t){return this.isDigit(t)||this.isAlpha(t)}}});function Jp(e){e.expect(X.PRINT);let t=[];if(e.check(X.NEWLINE)||e.check(X.SEMICOLON)||e.check(X.RBRACE)||e.check(X.PIPE)||e.check(X.GT)||e.check(X.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(t.push(no(e));e.check(X.COMMA);)e.advance(),t.push(no(e));let n;return e.check(X.GT)?(e.advance(),n={redirect:">",file:e.parsePrimary()}):e.check(X.APPEND)&&(e.advance(),n={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:n}}function no(e){return d9(e)?Rl(e,!0):Rl(e,!1)}function Rl(e,t){let n=t?e.parseTernary():m9(e);if(e.match(X.ASSIGN,X.PLUS_ASSIGN,X.MINUS_ASSIGN,X.STAR_ASSIGN,X.SLASH_ASSIGN,X.PERCENT_ASSIGN,X.CARET_ASSIGN)){let r=e.advance(),s=Rl(e,t);if(n.type!=="variable"&&n.type!=="field"&&n.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(r.value)??"=",target:n,value:s}}return n}function d9(e){let t=0,n=e.pos;for(;n<e.tokens.length;){let r=e.tokens[n];if(r.type===X.LPAREN&&t++,r.type===X.RPAREN&&t--,r.type===X.QUESTION&&t===0)return!0;if(r.type===X.NEWLINE||r.type===X.SEMICOLON||r.type===X.RBRACE||r.type===X.COMMA||r.type===X.PIPE)return!1;n++}return!1}function m9(e){let t=Kp(e);for(;e.check(X.OR);){e.advance();let n=Kp(e);t={type:"binary",operator:"||",left:t,right:n}}return t}function Kp(e){let t=Qp(e);for(;e.check(X.AND);){e.advance();let n=Qp(e);t={type:"binary",operator:"&&",left:t,right:n}}return t}function Qp(e){let t=g9(e);if(e.check(X.IN)){e.advance();let n=String(e.expect(X.IDENT).value);return{type:"in",key:t,array:n}}return t}function g9(e){let t=Xp(e);for(;y9(e)&&!w9(e);){let n=Xp(e);t={type:"binary",operator:" ",left:t,right:n}}return t}function Xp(e){let t=Yp(e);for(;e.match(X.MATCH,X.NOT_MATCH);){let n=e.advance().type===X.MATCH?"~":"!~",r=Yp(e);t={type:"binary",operator:n,left:t,right:r}}return t}function Yp(e){let t=e.parseAddSub();for(;e.match(X.LT,X.LE,X.GE,X.EQ,X.NE);){let n=e.advance(),r=e.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:r}}return t}function y9(e){return e.match(X.NUMBER,X.STRING,X.IDENT,X.DOLLAR,X.LPAREN,X.NOT,X.MINUS,X.PLUS,X.INCREMENT,X.DECREMENT)}function w9(e){return e.match(X.AND,X.OR,X.QUESTION,X.ASSIGN,X.PLUS_ASSIGN,X.MINUS_ASSIGN,X.STAR_ASSIGN,X.SLASH_ASSIGN,X.PERCENT_ASSIGN,X.CARET_ASSIGN,X.COMMA,X.SEMICOLON,X.NEWLINE,X.RBRACE,X.RPAREN,X.RBRACKET,X.COLON,X.PIPE,X.APPEND,X.GT,X.IN)}function eh(e){e.expect(X.PRINTF);let t=e.check(X.LPAREN);t&&(e.advance(),e.skipNewlines());let n=t?e.parseExpression():no(e),r=[];for(;e.check(X.COMMA);)e.advance(),t&&e.skipNewlines(),r.push(t?e.parseExpression():no(e));t&&(e.skipNewlines(),e.expect(X.RPAREN));let s;return e.check(X.GT)?(e.advance(),s={redirect:">",file:e.parsePrimary()}):e.check(X.APPEND)&&(e.advance(),s={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:n,args:r,output:s}}var X,th=v(()=>{"use strict";X={LPAREN:"LPAREN",RPAREN:"RPAREN",QUESTION:"QUESTION",NEWLINE:"NEWLINE",SEMICOLON:"SEMICOLON",RBRACE:"RBRACE",COMMA:"COMMA",PIPE:"PIPE",GT:"GT",APPEND:"APPEND",AND:"AND",OR:"OR",ASSIGN:"ASSIGN",PLUS_ASSIGN:"PLUS_ASSIGN",MINUS_ASSIGN:"MINUS_ASSIGN",STAR_ASSIGN:"STAR_ASSIGN",SLASH_ASSIGN:"SLASH_ASSIGN",PERCENT_ASSIGN:"PERCENT_ASSIGN",CARET_ASSIGN:"CARET_ASSIGN",RBRACKET:"RBRACKET",COLON:"COLON",IN:"IN",PRINT:"PRINT",PRINTF:"PRINTF",IDENT:"IDENT",LT:"LT",LE:"LE",GE:"GE",EQ:"EQ",NE:"NE",MATCH:"MATCH",NOT_MATCH:"NOT_MATCH",NUMBER:"NUMBER",STRING:"STRING",DOLLAR:"DOLLAR",NOT:"NOT",MINUS:"MINUS",PLUS:"PLUS",INCREMENT:"INCREMENT",DECREMENT:"DECREMENT"}});var ro,nh=v(()=>{"use strict";Zp();th();ro=class{tokens=[];pos=0;parse(t){let n=new to(t);return this.tokens=n.tokenize(),this.pos=0,this.parseProgram()}setPos(t){this.pos=t}current(){return this.tokens[this.pos]||{type:S.EOF,value:"",line:0,column:0}}advance(){let t=this.current();return this.pos<this.tokens.length&&this.pos++,t}match(...t){return t.includes(this.current().type)}check(t){return this.current().type===t}expect(t,n){if(!this.check(t)){let r=this.current();throw new Error(n||`Expected ${t}, got ${r.type} at line ${r.line}:${r.column}`)}return this.advance()}skipNewlines(){for(;this.check(S.NEWLINE);)this.advance()}skipTerminators(){for(;this.check(S.NEWLINE)||this.check(S.SEMICOLON);)this.advance()}parseProgram(){let t=[],n=[];for(this.skipNewlines();!this.check(S.EOF)&&(this.skipNewlines(),!this.check(S.EOF));)this.check(S.FUNCTION)?t.push(this.parseFunction()):n.push(this.parseRule()),this.skipTerminators();return{functions:t,rules:n}}parseFunction(){this.expect(S.FUNCTION);let t=this.expect(S.IDENT).value;this.expect(S.LPAREN);let n=[];if(!this.check(S.RPAREN))for(n.push(this.expect(S.IDENT).value);this.check(S.COMMA);)this.advance(),n.push(this.expect(S.IDENT).value);this.expect(S.RPAREN),this.skipNewlines();let r=this.parseBlock();return{name:t,params:n,body:r}}parseRule(){let t;if(this.check(S.BEGIN))this.advance(),t={type:"begin"};else if(this.check(S.END))this.advance(),t={type:"end"};else if(this.check(S.LBRACE))t=void 0;else if(this.check(S.REGEX)){let r=this.advance();if(this.check(S.AND)||this.check(S.OR)){let s={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:r.value}};t={type:"expr_pattern",expression:this.parseLogicalOrRest(s)}}else{let s={type:"regex_pattern",pattern:r.value};if(this.check(S.COMMA)){this.advance();let i;this.check(S.REGEX)?i={type:"regex_pattern",pattern:this.advance().value}:i={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:i}}else t=s}}else{let s={type:"expr_pattern",expression:this.parseExpression()};if(this.check(S.COMMA)){this.advance();let i;this.check(S.REGEX)?i={type:"regex_pattern",pattern:this.advance().value}:i={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:i}}else t=s}this.skipNewlines();let n;return this.check(S.LBRACE)?n=this.parseBlock():n={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:t,action:n}}parseBlock(){this.expect(S.LBRACE),this.skipNewlines();let t=[];for(;!this.check(S.RBRACE)&&!this.check(S.EOF);)t.push(this.parseStatement()),this.skipTerminators();return this.expect(S.RBRACE),{type:"block",statements:t}}parseStatement(){if(this.check(S.SEMICOLON)||this.check(S.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(S.LBRACE))return this.parseBlock();if(this.check(S.IF))return this.parseIf();if(this.check(S.WHILE))return this.parseWhile();if(this.check(S.DO))return this.parseDoWhile();if(this.check(S.FOR))return this.parseFor();if(this.check(S.BREAK))return this.advance(),{type:"break"};if(this.check(S.CONTINUE))return this.advance(),{type:"continue"};if(this.check(S.NEXT))return this.advance(),{type:"next"};if(this.check(S.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(S.EXIT)){this.advance();let n;return!this.check(S.NEWLINE)&&!this.check(S.SEMICOLON)&&!this.check(S.RBRACE)&&!this.check(S.EOF)&&(n=this.parseExpression()),{type:"exit",code:n}}if(this.check(S.RETURN)){this.advance();let n;return!this.check(S.NEWLINE)&&!this.check(S.SEMICOLON)&&!this.check(S.RBRACE)&&!this.check(S.EOF)&&(n=this.parseExpression()),{type:"return",value:n}}if(this.check(S.DELETE)){this.advance();let n=this.parsePrimary();if(n.type!=="array_access"&&n.type!=="variable")throw new Error("delete requires array element or array");return{type:"delete",target:n}}return this.check(S.PRINT)?Jp(this):this.check(S.PRINTF)?eh(this):{type:"expr_stmt",expression:this.parseExpression()}}parseIf(){this.expect(S.IF),this.expect(S.LPAREN);let t=this.parseExpression();this.expect(S.RPAREN),this.skipNewlines();let n=this.parseStatement();this.skipTerminators();let r;return this.check(S.ELSE)&&(this.advance(),this.skipNewlines(),r=this.parseStatement()),{type:"if",condition:t,consequent:n,alternate:r}}parseWhile(){this.expect(S.WHILE),this.expect(S.LPAREN);let t=this.parseExpression();this.expect(S.RPAREN),this.skipNewlines();let n=this.parseStatement();return{type:"while",condition:t,body:n}}parseDoWhile(){this.expect(S.DO),this.skipNewlines();let t=this.parseStatement();this.skipNewlines(),this.expect(S.WHILE),this.expect(S.LPAREN);let n=this.parseExpression();return this.expect(S.RPAREN),{type:"do_while",body:t,condition:n}}parseFor(){if(this.expect(S.FOR),this.expect(S.LPAREN),this.check(S.IDENT)){let i=this.advance();if(this.check(S.IN)){this.advance();let o=this.expect(S.IDENT).value;this.expect(S.RPAREN),this.skipNewlines();let a=this.parseStatement();return{type:"for_in",variable:i.value,array:o,body:a}}this.pos--}let t;this.check(S.SEMICOLON)||(t=this.parseExpression()),this.expect(S.SEMICOLON);let n;this.check(S.SEMICOLON)||(n=this.parseExpression()),this.expect(S.SEMICOLON);let r;this.check(S.RPAREN)||(r=this.parseExpression()),this.expect(S.RPAREN),this.skipNewlines();let s=this.parseStatement();return{type:"for",init:t,condition:n,update:r,body:s}}parseExpression(){return this.parseAssignment()}parseAssignment(){let t=this.parseTernary();if(this.match(S.ASSIGN,S.PLUS_ASSIGN,S.MINUS_ASSIGN,S.STAR_ASSIGN,S.SLASH_ASSIGN,S.PERCENT_ASSIGN,S.CARET_ASSIGN)){let n=this.advance(),r=this.parseAssignment();if(t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid assignment target");let s=new Set(["=","+=","-=","*=","/=","%=","^="]),i=n.value;if(!s.has(i))throw new Error(`Unknown assignment operator: ${i}`);return{type:"assignment",operator:i,target:t,value:r}}return t}parseTernary(){let t=this.parsePipeGetline();if(this.check(S.QUESTION)){this.advance();let n=this.parseExpression();this.expect(S.COLON);let r=this.parseExpression();t={type:"ternary",condition:t,consequent:n,alternate:r}}return t}parsePipeGetline(){let t=this.parseOr();if(this.check(S.PIPE)){if(this.advance(),!this.check(S.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();let n;return this.check(S.IDENT)&&(n=this.advance().value),{type:"getline",command:t,variable:n}}return t}parseOr(){let t=this.parseAnd();for(;this.check(S.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalOrRest(t){for(t=this.parseLogicalAndRest(t);this.check(S.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalAndRest(t){for(;this.check(S.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseAnd(){let t=this.parseIn();for(;this.check(S.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseIn(){let t=this.parseConcatenation();if(this.check(S.IN)){this.advance();let n=this.expect(S.IDENT).value;return{type:"in",key:t,array:n}}return t}parseConcatenation(){let t=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){let n=this.parseMatch();t={type:"binary",operator:" ",left:t,right:n}}return t}parseMatch(){let t=this.parseComparison();for(;this.match(S.MATCH,S.NOT_MATCH);){let n=this.advance().type===S.MATCH?"~":"!~",r=this.parseComparison();t={type:"binary",operator:n,left:t,right:r}}return t}parseComparison(){let t=this.parseAddSub();for(;this.match(S.LT,S.LE,S.GT,S.GE,S.EQ,S.NE);){let n=this.advance(),r=this.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:r}}return t}canStartExpression(){return this.match(S.NUMBER,S.STRING,S.IDENT,S.DOLLAR,S.LPAREN,S.NOT,S.MINUS,S.PLUS,S.INCREMENT,S.DECREMENT)}isConcatTerminator(){return this.match(S.AND,S.OR,S.QUESTION,S.ASSIGN,S.PLUS_ASSIGN,S.MINUS_ASSIGN,S.STAR_ASSIGN,S.SLASH_ASSIGN,S.PERCENT_ASSIGN,S.CARET_ASSIGN,S.COMMA,S.SEMICOLON,S.NEWLINE,S.RBRACE,S.RPAREN,S.RBRACKET,S.COLON,S.PIPE,S.APPEND,S.IN)}parseAddSub(){let t=this.parseMulDiv();for(;this.match(S.PLUS,S.MINUS);){let n=this.advance().value,r=this.parseMulDiv();t={type:"binary",operator:n,left:t,right:r}}return t}parseMulDiv(){let t=this.parseUnary();for(;this.match(S.STAR,S.SLASH,S.PERCENT);){let n=this.advance(),r=this.parseUnary();t={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(n.value)??"*",left:t,right:r}}return t}parseUnary(){if(this.check(S.INCREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(S.DECREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(S.NOT,S.MINUS,S.PLUS)){let t=this.advance().value,n=this.parseUnary();return{type:"unary",operator:t,operand:n}}return this.parsePower()}parsePower(){let t=this.parsePostfix();if(this.check(S.CARET)){this.advance();let n=this.parsePower();t={type:"binary",operator:"^",left:t,right:n}}return t}parsePostfix(){let t=this.parsePrimary();if(this.check(S.INCREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:t}}if(this.check(S.DECREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:t}}return t}parseFieldIndex(){if(this.check(S.INCREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(S.DECREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(S.NOT,S.MINUS,S.PLUS)){let t=this.advance().value,n=this.parseFieldIndex();return{type:"unary",operator:t,operand:n}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let t=this.parseFieldIndexPrimary();if(this.check(S.CARET)){this.advance();let n=this.parseFieldIndexPower();t={type:"binary",operator:"^",left:t,right:n}}return t}parseFieldIndexPrimary(){if(this.check(S.NUMBER))return{type:"number",value:this.advance().value};if(this.check(S.STRING))return{type:"string",value:this.advance().value};if(this.check(S.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(S.LPAREN)){this.advance();let t=this.parseExpression();return this.expect(S.RPAREN),t}if(this.check(S.IDENT)){let t=this.advance().value;if(this.check(S.LPAREN)){this.advance();let n=[];if(!this.check(S.RPAREN))for(n.push(this.parseExpression());this.check(S.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(S.RPAREN),{type:"call",name:t,args:n}}if(this.check(S.LBRACKET)){this.advance();let n=this.parseExpression();if(this.check(S.COMMA)){let r=[n];for(;this.check(S.COMMA);)this.advance(),r.push(this.parseExpression());this.expect(S.RBRACKET);let s=r.reduce((i,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:i,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:t,key:s}}return this.expect(S.RBRACKET),{type:"array_access",array:t,key:n}}return{type:"variable",name:t}}throw new Error(`Unexpected token in field index: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}parsePrimary(){if(this.check(S.NUMBER))return{type:"number",value:this.advance().value};if(this.check(S.STRING))return{type:"string",value:this.advance().value};if(this.check(S.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(S.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(S.LPAREN)){this.advance();let t=this.parseExpression();if(this.check(S.COMMA)){let n=[t];for(;this.check(S.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(S.RPAREN),{type:"tuple",elements:n}}return this.expect(S.RPAREN),t}if(this.check(S.GETLINE)){this.advance();let t,n;return this.check(S.IDENT)&&(t=this.advance().value),this.check(S.LT)&&(this.advance(),n=this.parsePrimary()),{type:"getline",variable:t,file:n}}if(this.check(S.IDENT)){let t=this.advance().value;if(this.check(S.LPAREN)){this.advance();let n=[];if(this.skipNewlines(),!this.check(S.RPAREN))for(n.push(this.parseExpression());this.check(S.COMMA);)this.advance(),this.skipNewlines(),n.push(this.parseExpression());return this.skipNewlines(),this.expect(S.RPAREN),{type:"call",name:t,args:n}}if(this.check(S.LBRACKET)){this.advance();let n=[this.parseExpression()];for(;this.check(S.COMMA);)this.advance(),n.push(this.parseExpression());this.expect(S.RBRACKET);let r;if(n.length===1)r=n[0];else{r=n[0];for(let s=1;s<n.length;s++)r={type:"binary",operator:" ",left:{type:"binary",operator:" ",left:r,right:{type:"variable",name:"SUBSEP"}},right:n[s]}}return{type:"array_access",array:t,key:r}}return{type:"variable",name:t}}throw new Error(`Unexpected token: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}}});var ih={};J(ih,{awkCommand2:()=>x9,flagsForFuzzing:()=>E9});function Tl(e){return e.replace(/\\t/g," ").replace(/\\n/g,`
|
|
343
|
+
`).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function rh(e){if(e===" ")return K("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return K(e)}catch{return K(sh(e))}return K(sh(e))}function sh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var b9,x9,E9,oh=v(()=>{"use strict";Kn();xe();Ve();Fn();an();ne();qp();nh();b9={name:"awk",summary:"pattern scanning and text processing language",usage:"awk [OPTIONS] 'PROGRAM' [FILE...]",options:["-F FS use FS as field separator","-v VAR=VAL assign VAL to variable VAR"," --help display this help and exit"]},x9={name:"awk",async execute(e,t){rt(t.requireDefenseContext,"awk","execution entry");let n=(y,w)=>Tt(t.requireDefenseContext,"awk",y,w);if(B(e))return U(b9);let r=new Zn(/\s+/),s=" ",i=Object.create(null),o=0;for(let y=0;y<e.length;y++){let w=e[y];if(w==="-F"&&y+1<e.length)s=Tl(e[++y]),r=rh(s),o=y+1;else if(w.startsWith("-F"))s=Tl(w.slice(2)),r=rh(s),o=y+1;else if(w==="-v"&&y+1<e.length){let b=e[++y],x=b.indexOf("=");if(x>0){let A=b.slice(0,x),$=Tl(b.slice(x+1));i[A]=$}o=y+1}else{if(w.startsWith("--"))return Z("awk",w);if(w.startsWith("-")&&w.length>1){let b=w[1];if(b!=="F"&&b!=="v")return Z("awk",`-${b}`);o=y+1}else if(!w.startsWith("-")){o=y;break}}}if(o>=e.length)return{stdout:"",stderr:`awk: missing program
|
|
344
|
+
`,exitCode:1};let a=e[o],l=e.slice(o+1),c=new ro,u;try{u=c.parse(a)}catch(y){return{stdout:"",stderr:`awk: ${y instanceof Error?y.message:String(y)}
|
|
345
|
+
`,exitCode:1}}let f={readFile:t.fs.readFile.bind(t.fs),writeFile:t.fs.writeFile.bind(t.fs),appendFile:async(y,w)=>{try{let b=await n("appendFile read",()=>t.fs.readFile(y));await n("appendFile write",()=>t.fs.writeFile(y,b+w))}catch(b){if(b instanceof he)throw b;await n("appendFile create",()=>t.fs.writeFile(y,w))}},resolvePath:t.fs.resolvePath.bind(t.fs)},p=t.exec,h=Al({fieldSep:r,maxIterations:t.limits?.maxAwkIterations,maxOutputSize:t.limits?.maxStringLength,fs:f,cwd:t.cwd,exec:p?y=>n("command pipe exec",()=>p(y,{cwd:t.cwd,signal:t.signal})):void 0,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext});h.FS=s,h.vars=Object.assign(Object.create(null),i),h.ARGC=l.length+1,h.ARGV=Object.create(null),h.ARGV[0]="awk";for(let y=0;y<l.length;y++)h.ARGV[String(y+1)]=l[y];h.ENVIRON=Et(t.env);let d=new Js(h);d.execute(u);let m=u.rules.some(y=>y.pattern?.type!=="begin"&&y.pattern?.type!=="end"),g=u.rules.some(y=>y.pattern?.type==="end");try{if(await n("BEGIN execution",()=>d.executeBegin()),h.shouldExit)return await n("END execution after BEGIN exit",()=>d.executeEnd()),{stdout:d.getOutput(),stderr:"",exitCode:d.getExitCode()};if(!m&&!g)return{stdout:d.getOutput(),stderr:"",exitCode:d.getExitCode()};let y=[];if(l.length>0)for(let w of l)try{let b=t.fs.resolvePath(t.cwd,w),A=(await n("input file read",()=>t.fs.readFile(b))).split(`
|
|
346
|
+
`);A.length>0&&A[A.length-1]===""&&A.pop(),y.push({filename:w,lines:A})}catch(b){if(b instanceof he)throw b;return{stdout:"",stderr:`awk: ${w}: No such file or directory
|
|
347
|
+
`,exitCode:1}}else{let w=t.stdin.split(`
|
|
348
|
+
`);w.length>0&&w[w.length-1]===""&&w.pop(),y.push({filename:"",lines:w})}for(let w of y){for(h.FILENAME=w.filename,h.FNR=0,h.lines=w.lines,h.lineIndex=-1,h.shouldNextFile=!1;h.lineIndex<w.lines.length-1;){h.lineIndex++;let b=h.lineIndex;if(await n("line execution",()=>d.executeLine(w.lines[b])),h.shouldExit||h.shouldNextFile)break}if(h.shouldExit)break}return await n("END execution",()=>d.executeEnd()),{stdout:d.getOutput(),stderr:"",exitCode:d.getExitCode()}}catch(y){if(y instanceof he)throw y;let w=y instanceof Error?y.message:String(y),b=y instanceof Q?Q.EXIT_CODE:2;return{stdout:d.getOutput(),stderr:`awk: ${w}
|
|
349
|
+
`,exitCode:b}}}};E9={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0}});function ah(e){let t=e.trim(),n=t.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!n){let o=parseFloat(t);return Number.isNaN(o)?0:o}let r=parseFloat(n[1]),s=(n[2]||"").toLowerCase(),i=A9.get(s)??1;return r*i}function lh(e){let t=e.trim().toLowerCase().slice(0,3);return S9.get(t)??0}function C9(e,t){let n=e.split(/(\d+)/),r=t.split(/(\d+)/),s=Math.max(n.length,r.length);for(let i=0;i<s;i++){let o=n[i]||"",a=r[i]||"",l=/^\d+$/.test(o)?parseInt(o,10):null,c=/^\d+$/.test(a)?parseInt(a,10):null;if(l!==null&&c!==null){if(l!==c)return l-c}else if(o!==a)return o.localeCompare(a)}return 0}function ch(e){return e.replace(/[^a-zA-Z0-9\s]/g,"")}function Pl(e,t,n){let r=n!==null?n:/\s+/,s=e.split(r),i=t.startField-1;if(i>=s.length)return"";if(t.endField===void 0){let l=s[i]||"";return t.startChar!==void 0&&(l=l.slice(t.startChar-1)),t.ignoreLeading&&(l=l.trimStart()),l}let o=Math.min(t.endField-1,s.length-1),a="";for(let l=i;l<=o&&l<s.length;l++){let c=s[l]||"";if(l===i&&t.startChar!==void 0&&(c=c.slice(t.startChar-1)),l===o&&t.endChar!==void 0){let u=l===i&&t.startChar!==void 0?t.endChar-t.startChar+1:t.endChar;c=c.slice(0,u)}l>i&&(a+=n||" "),a+=c}return t.ignoreLeading&&(a=a.trimStart()),a}function uh(e,t,n){let r=e,s=t;if(n.dictionaryOrder&&(r=ch(r),s=ch(s)),n.ignoreCase&&(r=r.toLowerCase(),s=s.toLowerCase()),n.monthSort){let i=lh(r),o=lh(s);return i-o}if(n.humanNumeric){let i=ah(r),o=ah(s);return i-o}if(n.versionSort)return C9(r,s);if(n.numeric){let i=parseFloat(r)||0,o=parseFloat(s)||0;return i-o}return r.localeCompare(s)}function fh(e){let{keys:t,fieldDelimiter:n,numeric:r,ignoreCase:s,reverse:i,humanNumeric:o,versionSort:a,dictionaryOrder:l,monthSort:c,ignoreLeadingBlanks:u,stable:f}=e;return(p,h)=>{let d=p,m=h;if(u&&(d=d.trimStart(),m=m.trimStart()),t.length===0){let y=uh(d,m,{numeric:r,ignoreCase:s,humanNumeric:o,versionSort:a,dictionaryOrder:l,monthSort:c});if(y!==0)return i?-y:y;if(!f){let w=p.localeCompare(h);return i?-w:w}return 0}for(let g of t){let y=Pl(d,g,n),w=Pl(m,g,n);g.ignoreLeading&&(y=y.trimStart(),w=w.trimStart());let b={numeric:g.numeric??r,ignoreCase:g.ignoreCase??s,humanNumeric:g.humanNumeric??o,versionSort:g.versionSort??a,dictionaryOrder:g.dictionaryOrder??l,monthSort:g.monthSort??c},x=g.reverse??i,A=uh(y,w,b);if(A!==0)return x?-A:A}if(!f){let g=p.localeCompare(h);return i?-g:g}return 0}}function ph(e,t){if(t.keys.length===0){if(t.ignoreCase){let s=new Set;return e.filter(i=>{let o=i.toLowerCase();return s.has(o)?!1:(s.add(o),!0)})}return[...new Set(e)]}let n=t.keys[0],r=new Set;return e.filter(s=>{let i=Pl(s,n,t.fieldDelimiter);return(n.ignoreCase??t.ignoreCase)&&(i=i.toLowerCase()),r.has(i)?!1:(r.add(i),!0)})}var A9,S9,hh=v(()=>{"use strict";A9=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),S9=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]])});function so(e){let t={startField:1},n="",r=e,s=r.match(/([bdfhMnrV]+)$/);s&&(n=s[1],r=r.slice(0,-n.length)),n.includes("n")&&(t.numeric=!0),n.includes("r")&&(t.reverse=!0),n.includes("f")&&(t.ignoreCase=!0),n.includes("b")&&(t.ignoreLeading=!0),n.includes("h")&&(t.humanNumeric=!0),n.includes("V")&&(t.versionSort=!0),n.includes("d")&&(t.dictionaryOrder=!0),n.includes("M")&&(t.monthSort=!0);let i=r.split(",");if(i.length===0||i[0]==="")return null;let o=i[0].split("."),a=parseInt(o[0],10);if(Number.isNaN(a)||a<1)return null;if(t.startField=a,o.length>1&&o[1]){let l=parseInt(o[1],10);!Number.isNaN(l)&&l>=1&&(t.startChar=l)}if(i.length>1&&i[1]){let l=i[1],c=l.match(/([bdfhMnrV]+)$/);if(c){let f=c[1];f.includes("n")&&(t.numeric=!0),f.includes("r")&&(t.reverse=!0),f.includes("f")&&(t.ignoreCase=!0),f.includes("b")&&(t.ignoreLeading=!0),f.includes("h")&&(t.humanNumeric=!0),f.includes("V")&&(t.versionSort=!0),f.includes("d")&&(t.dictionaryOrder=!0),f.includes("M")&&(t.monthSort=!0),l=l.slice(0,-f.length)}let u=l.split(".");if(u[0]){let f=parseInt(u[0],10);if(!Number.isNaN(f)&&f>=1&&(t.endField=f),u.length>1&&u[1]){let p=parseInt(u[1],10);!Number.isNaN(p)&&p>=1&&(t.endChar=p)}}}return t}var dh=v(()=>{"use strict"});var mh={};J(mh,{flagsForFuzzing:()=>N9,sortCommand:()=>k9});var v9,k9,N9,gh=v(()=>{"use strict";vr();ne();hh();dh();v9={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
|
|
350
|
+
F is a field number (1-indexed)
|
|
351
|
+
C is a character position within the field (1-indexed)
|
|
352
|
+
OPTS can be: b d f h M n r V (per-key modifiers)
|
|
353
|
+
|
|
354
|
+
Examples:
|
|
355
|
+
-k1 sort by first field
|
|
356
|
+
-k2,2 sort by second field only
|
|
357
|
+
-k1.3 sort by first field starting at 3rd character
|
|
358
|
+
-k1,2n sort by fields 1-2 numerically
|
|
359
|
+
-k2 -k1 sort by field 2, then by field 1`},k9={name:"sort",async execute(e,t){if(B(e))return U(v9);let n={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},r=[];for(let c=0;c<e.length;c++){let u=e[c];if(u==="-r"||u==="--reverse")n.reverse=!0;else if(u==="-n"||u==="--numeric-sort")n.numeric=!0;else if(u==="-u"||u==="--unique")n.unique=!0;else if(u==="-f"||u==="--ignore-case")n.ignoreCase=!0;else if(u==="-h"||u==="--human-numeric-sort")n.humanNumeric=!0;else if(u==="-V"||u==="--version-sort")n.versionSort=!0;else if(u==="-d"||u==="--dictionary-order")n.dictionaryOrder=!0;else if(u==="-M"||u==="--month-sort")n.monthSort=!0;else if(u==="-b"||u==="--ignore-leading-blanks")n.ignoreLeadingBlanks=!0;else if(u==="-s"||u==="--stable")n.stable=!0;else if(u==="-c"||u==="--check")n.checkOnly=!0;else if(u==="-o"||u==="--output")n.outputFile=e[++c]||null;else if(u.startsWith("-o"))n.outputFile=u.slice(2)||null;else if(u.startsWith("--output="))n.outputFile=u.slice(9)||null;else if(u==="-t"||u==="--field-separator")n.fieldDelimiter=e[++c]||null;else if(u.startsWith("-t"))n.fieldDelimiter=u.slice(2)||null;else if(u.startsWith("--field-separator="))n.fieldDelimiter=u.slice(18)||null;else if(u==="-k"||u==="--key"){let f=e[++c];if(f){let p=so(f);p&&n.keys.push(p)}}else if(u.startsWith("-k")){let f=so(u.slice(2));f&&n.keys.push(f)}else if(u.startsWith("--key=")){let f=so(u.slice(6));f&&n.keys.push(f)}else{if(u.startsWith("--"))return Z("sort",u);if(u.startsWith("-")&&!u.startsWith("--")){let f=!1;for(let p of u.slice(1))if(p==="r")n.reverse=!0;else if(p==="n")n.numeric=!0;else if(p==="u")n.unique=!0;else if(p==="f")n.ignoreCase=!0;else if(p==="h")n.humanNumeric=!0;else if(p==="V")n.versionSort=!0;else if(p==="d")n.dictionaryOrder=!0;else if(p==="M")n.monthSort=!0;else if(p==="b")n.ignoreLeadingBlanks=!0;else if(p==="s")n.stable=!0;else if(p==="c")n.checkOnly=!0;else{f=!0;break}if(f)return Z("sort",u)}else r.push(u)}}let s=await Yr(t,r,{cmdName:"sort"});if(!s.ok)return s.error;let o=s.content.split(`
|
|
360
|
+
`);o.length>0&&o[o.length-1]===""&&o.pop();let a=fh(n);if(n.checkOnly){let c=r.length>0?r[0]:"-";for(let u=1;u<o.length;u++)if(a(o[u-1],o[u])>0)return{stdout:"",stderr:`sort: ${c}:${u+1}: disorder: ${o[u]}
|
|
361
|
+
`,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}o.sort(a),n.unique&&(o=ph(o,n));let l=o.length>0?`${o.join(`
|
|
362
|
+
`)}
|
|
363
|
+
`:"";if(n.outputFile){let c=t.fs.resolvePath(t.cwd,n.outputFile);return await t.fs.writeFile(c,l,"binary"),{stdout:"",stderr:"",exitCode:0}}return{stdout:l,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},N9={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0}});var yh={};J(yh,{flagsForFuzzing:()=>R9,uniqCommand:()=>O9});var I9,$9,O9,R9,wh=v(()=>{"use strict";st();vr();ne();I9={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},$9={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},O9={name:"uniq",async execute(e,t){if(B(e))return U(I9);let n=Ee("uniq",e,$9);if(!n.ok)return n.error;let{count:r,duplicatesOnly:s,uniqueOnly:i,ignoreCase:o}=n.result.flags,a=n.result.positional,l=await Yr(t,a,{cmdName:"uniq"});if(!l.ok)return l.error;let u=l.content.split(`
|
|
364
|
+
`);if(u.length>0&&u[u.length-1]===""&&u.pop(),u.length===0)return{stdout:"",stderr:"",exitCode:0};let f=[],p=u[0],h=1,d=(y,w)=>o?y.toLowerCase()===w.toLowerCase():y===w;for(let y=1;y<u.length;y++)d(u[y],p)?h++:(f.push({line:p,count:h}),p=u[y],h=1);f.push({line:p,count:h});let m=f;s?m=f.filter(y=>y.count>1):i&&(m=f.filter(y=>y.count===1));let g="";for(let{line:y,count:w}of m)r?g+=`${String(w).padStart(4)} ${y}
|
|
365
|
+
`:g+=`${y}
|
|
366
|
+
`;return{stdout:g,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},R9={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0}});var bh={};J(bh,{commCommand:()=>P9,flagsForFuzzing:()=>D9});var T9,P9,D9,xh=v(()=>{"use strict";ne();T9={name:"comm",summary:"compare two sorted files line by line",usage:"comm [OPTION]... FILE1 FILE2",options:["-1 suppress column 1 (lines unique to FILE1)","-2 suppress column 2 (lines unique to FILE2)","-3 suppress column 3 (lines that appear in both files)"," --help display this help and exit"]},P9={name:"comm",async execute(e,t){if(B(e))return U(T9);let n=!1,r=!1,s=!1,i=[];for(let g of e)if(g==="-1")n=!0;else if(g==="-2")r=!0;else if(g==="-3")s=!0;else if(g==="-12"||g==="-21")n=!0,r=!0;else if(g==="-13"||g==="-31")n=!0,s=!0;else if(g==="-23"||g==="-32")r=!0,s=!0;else if(g==="-123"||g==="-132"||g==="-213"||g==="-231"||g==="-312"||g==="-321")n=!0,r=!0,s=!0;else{if(g.startsWith("-")&&g!=="-")return Z("comm",g);i.push(g)}if(i.length!==2)return{stdout:"",stderr:`comm: missing operand
|
|
367
|
+
Try 'comm --help' for more information.
|
|
368
|
+
`,exitCode:1};let o=async g=>{if(g==="-")return t.stdin;try{let y=t.fs.resolvePath(t.cwd,g);return await t.fs.readFile(y)}catch{return null}},a=await o(i[0]);if(a===null)return{stdout:"",stderr:`comm: ${i[0]}: No such file or directory
|
|
369
|
+
`,exitCode:1};let l=await o(i[1]);if(l===null)return{stdout:"",stderr:`comm: ${i[1]}: No such file or directory
|
|
370
|
+
`,exitCode:1};let c=a.split(`
|
|
371
|
+
`),u=l.split(`
|
|
372
|
+
`);c.length>0&&c[c.length-1]===""&&c.pop(),u.length>0&&u[u.length-1]===""&&u.pop();let f=0,p=0,h="",d=n?"":" ",m=(n?"":" ")+(r?"":" ");for(;f<c.length||p<u.length;)f>=c.length?(r||(h+=`${d}${u[p]}
|
|
373
|
+
`),p++):p>=u.length?(n||(h+=`${c[f]}
|
|
374
|
+
`),f++):c[f]<u[p]?(n||(h+=`${c[f]}
|
|
375
|
+
`),f++):c[f]>u[p]?(r||(h+=`${d}${u[p]}
|
|
376
|
+
`),p++):(s||(h+=`${m}${c[f]}
|
|
377
|
+
`),f++,p++);return{stdout:h,stderr:"",exitCode:0}}},D9={name:"comm",flags:[{flag:"-1",type:"boolean"},{flag:"-2",type:"boolean"},{flag:"-3",type:"boolean"}],needsArgs:!0,minArgs:2}});var Eh={};J(Eh,{cutCommand:()=>M9,flagsForFuzzing:()=>U9});function F9(e){let t=[],n=e.split(",");for(let r of n)if(r.includes("-")){let[s,i]=r.split("-");t.push({start:s?parseInt(s,10):1,end:i?parseInt(i,10):null})}else{let s=parseInt(r,10);t.push({start:s,end:s})}return t}function L9(e,t){let n=[];for(let r of t){let s=r.start-1,i=r.end===null?e.length:r.end;for(let o=s;o<i&&o<e.length;o++)o>=0&&!n.includes(e[o])&&n.push(e[o])}return n}var _9,M9,U9,Ah=v(()=>{"use strict";vr();ne();_9={name:"cut",summary:"remove sections from each line of files",usage:"cut [OPTION]... [FILE]...",options:["-c LIST select only these characters","-d DELIM use DELIM instead of TAB for field delimiter","-f LIST select only these fields","-s, --only-delimited do not print lines without delimiters"," --help display this help and exit"]};M9={name:"cut",async execute(e,t){if(B(e))return U(_9);let n=" ",r=null,s=null,i=!1,o=[];for(let p=0;p<e.length;p++){let h=e[p];if(h==="-d")n=e[++p]||" ";else if(h.startsWith("-d"))n=h.slice(2);else if(h==="-f")r=e[++p];else if(h.startsWith("-f"))r=h.slice(2);else if(h==="-c")s=e[++p];else if(h.startsWith("-c"))s=h.slice(2);else if(h==="-s"||h==="--only-delimited")i=!0;else{if(h.startsWith("--"))return Z("cut",h);if(h.startsWith("-")){let d=!1;for(let m of h.slice(1))if(m==="s")i=!0;else if(!"dfc".includes(m)){d=!0;break}if(d)return Z("cut",h)}else o.push(h)}}if(!r&&!s)return{stdout:"",stderr:`cut: you must specify a list of bytes, characters, or fields
|
|
378
|
+
`,exitCode:1};let a=await Yr(t,o,{cmdName:"cut"});if(!a.ok)return a.error;let c=a.content.split(`
|
|
379
|
+
`);c.length>0&&c[c.length-1]===""&&c.pop();let u=F9(r||s||"1"),f="";for(let p of c)if(s){let h=p.split(""),d=[];for(let m of u){let g=m.start-1,y=m.end===null?h.length:m.end;for(let w=g;w<y&&w<h.length;w++)w>=0&&d.push(h[w])}f+=`${d.join("")}
|
|
380
|
+
`}else{if(i&&!p.includes(n))continue;let h=p.split(n),d=L9(h,u);f+=`${d.join(n)}
|
|
381
|
+
`}return{stdout:f,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},U9={name:"cut",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-f",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"string"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Ch={};J(Ch,{flagsForFuzzing:()=>H9,pasteCommand:()=>z9});function Sh(e,t){if(e.length===0)return"";if(e.length===1)return e[0];let n=e[0];for(let r=1;r<e.length;r++){let s=(r-1)%t.length;n+=t[s]+e[r]}return n}var B9,W9,z9,H9,vh=v(()=>{"use strict";st();ne();B9={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},W9={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},z9={name:"paste",async execute(e,t){if(B(e))return U(B9);let n=Ee("paste",e,W9);if(!n.ok)return n.error;let r=n.result.flags.delimiter,s=n.result.flags.serial,i=n.result.positional;if(i.length===0)return{stdout:"",stderr:`usage: paste [-s] [-d delimiters] file ...
|
|
382
|
+
`,exitCode:1};let o=t.stdin?t.stdin.split(`
|
|
383
|
+
`):[""];o.length>0&&o[o.length-1]===""&&o.pop();let a=i.filter(f=>f==="-").length,l=[],c=0;for(let f of i)if(f==="-"){let p=[];for(let h=c;h<o.length;h+=a)p.push(o[h]);l.push(p),c++}else{let p=t.fs.resolvePath(t.cwd,f);try{let d=(await t.fs.readFile(p)).split(`
|
|
384
|
+
`);d.length>0&&d[d.length-1]===""&&d.pop(),l.push(d)}catch{return{stdout:"",stderr:`paste: ${f}: No such file or directory
|
|
385
|
+
`,exitCode:1}}}let u="";if(s)for(let f of l)f&&(u+=`${Sh(f,r)}
|
|
386
|
+
`);else{let f=Math.max(...l.map(p=>p?.length??0));for(let p=0;p<f;p++){let h=[];for(let d of l)h.push(d?.[p]??"");u+=`${Sh(h,r)}
|
|
387
|
+
`}}return{stdout:u,stderr:"",exitCode:0}}};H9={name:"paste",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Nh={};J(Nh,{flagsForFuzzing:()=>Z9,trCommand:()=>q9});function kh(e){let t="",n=0;for(;n<e.length;){if(e[n]==="["&&e[n+1]===":"){let r=!1;for(let[s,i]of G9)if(e.slice(n).startsWith(s)){t+=i,n+=s.length,r=!0;break}if(r)continue}if(e[n]==="\\"&&n+1<e.length){let r=e[n+1];r==="n"?t+=`
|
|
388
|
+
`:r==="t"?t+=" ":r==="r"?t+="\r":t+=r,n+=2;continue}if(n+2<e.length&&e[n+1]==="-"){let r=e.charCodeAt(n),s=e.charCodeAt(n+2);if(s-r>65536)throw new Error(`tr: character range too large: '${e[n]}-${e[n+2]}'`);for(let i=r;i<=s;i++)t+=String.fromCharCode(i);n+=3;continue}t+=e[n],n++}return t}var j9,G9,V9,q9,Z9,Ih=v(()=>{"use strict";yn();st();ne();j9={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
|
|
389
|
+
a-z character range
|
|
390
|
+
[:alnum:] all letters and digits
|
|
391
|
+
[:alpha:] all letters
|
|
392
|
+
[:digit:] all digits
|
|
393
|
+
[:lower:] all lowercase letters
|
|
394
|
+
[:upper:] all uppercase letters
|
|
395
|
+
[:space:] all whitespace
|
|
396
|
+
[:blank:] horizontal whitespace
|
|
397
|
+
[:punct:] all punctuation
|
|
398
|
+
[:print:] all printable characters
|
|
399
|
+
[:graph:] all printable characters except space
|
|
400
|
+
[:cntrl:] all control characters
|
|
401
|
+
[:xdigit:] all hexadecimal digits
|
|
402
|
+
\\n, \\t, \\r escape sequences`},G9=new Map([["[:alnum:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"],["[:alpha:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"],["[:blank:]"," "],["[:cntrl:]",Array.from({length:32},(e,t)=>String.fromCharCode(t)).join("").concat("\x7F")],["[:digit:]","0123456789"],["[:graph:]",Array.from({length:94},(e,t)=>String.fromCharCode(33+t)).join("")],["[:lower:]","abcdefghijklmnopqrstuvwxyz"],["[:print:]",Array.from({length:95},(e,t)=>String.fromCharCode(32+t)).join("")],["[:punct:]","!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"],["[:space:]",`
|
|
403
|
+
\r\f\v`],["[:upper:]","ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["[:xdigit:]","0123456789ABCDEFabcdef"]]);V9={complement:{short:"c",long:"complement",type:"boolean"},complementUpper:{short:"C",type:"boolean"},delete:{short:"d",long:"delete",type:"boolean"},squeeze:{short:"s",long:"squeeze-repeats",type:"boolean"}},q9={name:"tr",async execute(e,t){if(B(e))return U(j9);let n=Ee("tr",e,V9);if(!n.ok)return n.error;let r=n.result.flags.complement||n.result.flags.complementUpper,s=n.result.flags.delete,i=n.result.flags.squeeze,o=n.result.positional;if(o.length<1)return{stdout:"",stderr:`tr: missing operand
|
|
404
|
+
`,exitCode:1};if(!s&&!i&&o.length<2)return{stdout:"",stderr:`tr: missing operand after SET1
|
|
405
|
+
`,exitCode:1};let a,l;try{a=kh(o[0]),l=o.length>1?kh(o[1]):""}catch(p){return{stdout:"",stderr:`${Be(p.message)}
|
|
406
|
+
`,exitCode:1}}let c=t.stdin,u=p=>{let h=a.includes(p);return r?!h:h},f="";if(s)for(let p of c)u(p)||(f+=p);else if(i&&o.length===1){let p="";for(let h of c)u(h)&&h===p||(f+=h,p=h)}else{if(r){let p=l.length>0?l[l.length-1]:"";for(let h of c)a.includes(h)?f+=h:f+=p}else{let p=new Map;for(let h=0;h<a.length;h++){let d=h<l.length?l[h]:l[l.length-1];p.set(a[h],d)}for(let h of c)f+=p.get(h)??h}if(i){let p="",h="";for(let d of f)l.includes(d)&&d===h||(p+=d,h=d);f=p}}return{stdout:f,stderr:"",exitCode:0}}},Z9={name:"tr",flags:[{flag:"-c",type:"boolean"},{flag:"-C",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-s",type:"boolean"}],stdinType:"text",needsArgs:!0}});var $h={};J($h,{flagsForFuzzing:()=>Y9,rev:()=>X9});function Q9(e){return Array.from(e).reverse().join("")}var K9,X9,Y9,Oh=v(()=>{"use strict";ne();K9={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};X9={name:"rev",execute:async(e,t)=>{if(B(e))return U(K9);let n=[];for(let i of e)if(i==="--"){let o=e.indexOf(i);n.push(...e.slice(o+1));break}else{if(i.startsWith("-")&&i!=="-")return Z("rev",i);n.push(i)}let r="",s=i=>{let o=i.split(`
|
|
407
|
+
`),a=i.endsWith(`
|
|
408
|
+
`)&&o[o.length-1]==="";return a&&o.pop(),o.map(Q9).join(`
|
|
409
|
+
`)+(a?`
|
|
410
|
+
`:"")};if(n.length===0){let i=t.stdin??"";r=s(i)}else for(let i of n)if(i==="-"){let o=t.stdin??"";r+=s(o)}else{let o=t.fs.resolvePath(t.cwd,i),a=await t.fs.readFile(o);if(a===null)return{exitCode:1,stdout:r,stderr:`rev: ${i}: No such file or directory
|
|
411
|
+
`};r+=s(a)}return{exitCode:0,stdout:r,stderr:""}}},Y9={name:"rev",flags:[],stdinType:"text",needsFiles:!0}});var Th={};J(Th,{flagsForFuzzing:()=>rw,nl:()=>nw});function ew(e,t,n){let r=String(e);switch(t){case"ln":return r.padEnd(n);case"rn":return r.padStart(n);case"rz":return r.padStart(n,"0");default:return t}}function tw(e,t){switch(t){case"a":return!0;case"t":return e.trim().length>0;case"n":return!1;default:return t}}function Rh(e,t,n){if(e==="")return{output:"",nextNumber:n};let r=e.split(`
|
|
412
|
+
`),s=[],i=n,o=e.endsWith(`
|
|
413
|
+
`)&&r[r.length-1]==="";o&&r.pop();for(let a of r)if(tw(a,t.bodyStyle)){let l=ew(i,t.numberFormat,t.width);s.push(`${l}${t.separator}${a}`),i+=t.increment}else{let l=" ".repeat(t.width);s.push(`${l}${t.separator}${a}`)}return{output:s.join(`
|
|
414
|
+
`)+(o?`
|
|
415
|
+
`:""),nextNumber:i}}var J9,nw,rw,Ph=v(()=>{"use strict";ne();J9={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};nw={name:"nl",execute:async(e,t)=>{if(B(e))return U(J9);let n={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},r=[],s=0;for(;s<e.length;){let a=e[s];if(a==="-b"&&s+1<e.length){let l=e[s+1];if(l!=="a"&&l!=="t"&&l!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${l}'
|
|
416
|
+
`};n.bodyStyle=l,s+=2}else if(a.startsWith("-b")){let l=a.slice(2);if(l!=="a"&&l!=="t"&&l!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${l}'
|
|
417
|
+
`};n.bodyStyle=l,s++}else if(a==="-n"&&s+1<e.length){let l=e[s+1];if(l!=="ln"&&l!=="rn"&&l!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${l}'
|
|
418
|
+
`};n.numberFormat=l,s+=2}else if(a.startsWith("-n")){let l=a.slice(2);if(l!=="ln"&&l!=="rn"&&l!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${l}'
|
|
419
|
+
`};n.numberFormat=l,s++}else if(a==="-w"&&s+1<e.length){let l=parseInt(e[s+1],10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${e[s+1]}'
|
|
420
|
+
`};n.width=l,s+=2}else if(a.startsWith("-w")){let l=parseInt(a.slice(2),10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${a.slice(2)}'
|
|
421
|
+
`};n.width=l,s++}else if(a==="-s"&&s+1<e.length)n.separator=e[s+1],s+=2;else if(a.startsWith("-s"))n.separator=a.slice(2),s++;else if(a==="-v"&&s+1<e.length){let l=parseInt(e[s+1],10);if(Number.isNaN(l))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${e[s+1]}'
|
|
422
|
+
`};n.startNumber=l,s+=2}else if(a.startsWith("-v")){let l=parseInt(a.slice(2),10);if(Number.isNaN(l))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${a.slice(2)}'
|
|
423
|
+
`};n.startNumber=l,s++}else if(a==="-i"&&s+1<e.length){let l=parseInt(e[s+1],10);if(Number.isNaN(l))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${e[s+1]}'
|
|
424
|
+
`};n.increment=l,s+=2}else if(a.startsWith("-i")){let l=parseInt(a.slice(2),10);if(Number.isNaN(l))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${a.slice(2)}'
|
|
425
|
+
`};n.increment=l,s++}else if(a==="--"){r.push(...e.slice(s+1));break}else{if(a.startsWith("-")&&a!=="-")return Z("nl",a);r.push(a),s++}}let i="",o=n.startNumber;if(r.length===0){let a=t.stdin??"";i=Rh(a,n,o).output}else for(let a of r){let l=t.fs.resolvePath(t.cwd,a),c=await t.fs.readFile(l);if(c===null)return{exitCode:1,stdout:i,stderr:`nl: ${a}: No such file or directory
|
|
426
|
+
`};let u=Rh(c,n,o);i+=u.output,o=u.nextNumber}return{exitCode:0,stdout:i,stderr:""}}},rw={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}});var _h={};J(_h,{flagsForFuzzing:()=>lw,fold:()=>aw});function iw(e,t,n){return n?new TextEncoder().encode(e).length:e===" "?8-t%8:e==="\b"?-1:1}function ow(e,t){if(e.length===0)return e;let{width:n,breakAtSpaces:r,countBytes:s}=t,i=[],o="",a=0,l=-1,c=0;for(let u=0;u<e.length;u++){let f=e[u],p=iw(f,a,s);a+p>n&&o.length>0?r&&l>=0?(i.push(o.slice(0,l+1)),o=o.slice(l+1)+f,a=a-c-1+p,l=-1,c=0):(i.push(o),o=f,a=p,l=-1,c=0):(o+=f,a+=p,(f===" "||f===" ")&&(l=o.length-1,c=a-p))}return o.length>0&&i.push(o),i.join(`
|
|
427
|
+
`)}function Dh(e,t){if(e==="")return"";let n=e.split(`
|
|
428
|
+
`),r=e.endsWith(`
|
|
429
|
+
`)&&n[n.length-1]==="";return r&&n.pop(),n.map(i=>ow(i,t)).join(`
|
|
430
|
+
`)+(r?`
|
|
431
|
+
`:"")}var sw,aw,lw,Fh=v(()=>{"use strict";ne();sw={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};aw={name:"fold",execute:async(e,t)=>{if(B(e))return U(sw);let n={width:80,breakAtSpaces:!1,countBytes:!1},r=[],s=0;for(;s<e.length;){let o=e[s];if(o==="-w"&&s+1<e.length){let a=parseInt(e[s+1],10);if(Number.isNaN(a)||a<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${e[s+1]}'
|
|
432
|
+
`};n.width=a,s+=2}else if(o.startsWith("-w")&&o.length>2){let a=parseInt(o.slice(2),10);if(Number.isNaN(a)||a<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${o.slice(2)}'
|
|
433
|
+
`};n.width=a,s++}else if(o==="-s")n.breakAtSpaces=!0,s++;else if(o==="-b")n.countBytes=!0,s++;else if(o==="-bs"||o==="-sb")n.breakAtSpaces=!0,n.countBytes=!0,s++;else if(o.match(/^-[sb]+w\d+$/)){o.includes("s")&&(n.breakAtSpaces=!0),o.includes("b")&&(n.countBytes=!0);let a=o.replace(/^-[sb]+w/,""),l=parseInt(a,10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${a}'
|
|
434
|
+
`};n.width=l,s++}else if(o.match(/^-[sb]+w$/)&&s+1<e.length){o.includes("s")&&(n.breakAtSpaces=!0),o.includes("b")&&(n.countBytes=!0);let a=parseInt(e[s+1],10);if(Number.isNaN(a)||a<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${e[s+1]}'
|
|
435
|
+
`};n.width=a,s+=2}else if(o==="--"){r.push(...e.slice(s+1));break}else if(o.startsWith("-")&&o!=="-"){let a=o.slice(1),l=!1;for(let c of a)if(c==="s")n.breakAtSpaces=!0;else if(c==="b")n.countBytes=!0;else{l=!0;break}if(l)return Z("fold",o);s++}else r.push(o),s++}let i="";if(r.length===0){let o=t.stdin??"";i=Dh(o,n)}else for(let o of r){let a=t.fs.resolvePath(t.cwd,o),l=await t.fs.readFile(a);if(l===null)return{exitCode:1,stdout:i,stderr:`fold: ${o}: No such file or directory
|
|
436
|
+
`};i+=Dh(l,n)}return{exitCode:0,stdout:i,stderr:""}}},lw={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Mh={};J(Mh,{expand:()=>pw,flagsForFuzzing:()=>hw});function io(e){let t=e.split(",").map(r=>r.trim()),n=[];for(let r of t){let s=parseInt(r,10);if(Number.isNaN(s)||s<1)return null;n.push(s)}for(let r=1;r<n.length;r++)if(n[r]<=n[r-1])return null;return n}function uw(e,t){if(t.length===1){let n=t[0];return n-e%n}for(let n of t)if(n>e)return n-e;if(t.length>=2){let n=t[t.length-1]-t[t.length-2],r=t[t.length-1],s=Math.floor((e-r)/n)+1;return r+s*n-e}return 1}function fw(e,t){let{tabStops:n,leadingOnly:r}=t,s="",i=0,o=!0;for(let a of e)if(a===" ")if(r&&!o)s+=a,i++;else{let l=uw(i,n);s+=" ".repeat(l),i+=l}else a!==" "&&a!==" "&&(o=!1),s+=a,i++;return s}function Lh(e,t){if(e==="")return"";let n=e.split(`
|
|
437
|
+
`),r=e.endsWith(`
|
|
438
|
+
`)&&n[n.length-1]==="";return r&&n.pop(),n.map(i=>fw(i,t)).join(`
|
|
439
|
+
`)+(r?`
|
|
440
|
+
`:"")}var cw,pw,hw,Uh=v(()=>{"use strict";ne();cw={name:"expand",summary:"convert tabs to spaces",usage:"expand [OPTION]... [FILE]...",description:"Convert TABs in each FILE to spaces, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-i Only convert leading tabs on each line"],examples:["expand file.txt # Convert all tabs to 8 spaces","expand -t 4 file.txt # Use 4-space tabs","expand -t 4,8,12 file.txt # Custom tab stops"]};pw={name:"expand",execute:async(e,t)=>{if(B(e))return U(cw);let n={tabStops:[8],leadingOnly:!1},r=[],s=0;for(;s<e.length;){let o=e[s];if(o==="-t"&&s+1<e.length){let a=io(e[s+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${e[s+1]}'
|
|
441
|
+
`};n.tabStops=a,s+=2}else if(o.startsWith("-t")&&o.length>2){let a=io(o.slice(2));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${o.slice(2)}'
|
|
442
|
+
`};n.tabStops=a,s++}else if(o==="--tabs"&&s+1<e.length){let a=io(e[s+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${e[s+1]}'
|
|
443
|
+
`};n.tabStops=a,s+=2}else if(o.startsWith("--tabs=")){let a=io(o.slice(7));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${o.slice(7)}'
|
|
444
|
+
`};n.tabStops=a,s++}else if(o==="-i"||o==="--initial")n.leadingOnly=!0,s++;else if(o==="--"){r.push(...e.slice(s+1));break}else{if(o.startsWith("-")&&o!=="-")return Z("expand",o);r.push(o),s++}}let i="";if(r.length===0){let o=t.stdin??"";i=Lh(o,n)}else for(let o of r){let a=t.fs.resolvePath(t.cwd,o),l=await t.fs.readFile(a);if(l===null)return{exitCode:1,stdout:i,stderr:`expand: ${o}: No such file or directory
|
|
445
|
+
`};i+=Lh(l,n)}return{exitCode:0,stdout:i,stderr:""}}},hw={name:"expand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0}});var zh={};J(zh,{flagsForFuzzing:()=>yw,unexpand:()=>gw});function oo(e){let t=e.split(",").map(r=>r.trim()),n=[];for(let r of t){let s=parseInt(r,10);if(Number.isNaN(s)||s<1)return null;n.push(s)}for(let r=1;r<n.length;r++)if(n[r]<=n[r-1])return null;return n}function Bh(e,t){if(t.length===1){let n=t[0];return e+(n-e%n)}for(let n of t)if(n>e)return n;if(t.length>=2){let n=t[t.length-1]-t[t.length-2],r=t[t.length-1],s=Math.floor((e-r)/n)+1;return r+s*n}return-1}function mw(e,t){let{tabStops:n,allBlanks:r}=t,s="",i=0,o="",a=0,l=!0,c=()=>{if(o.length===0)return;let u=a+o.length;if(!r&&!l){s+=o,o="";return}let f=a,p="";for(;f<u;){let d=Bh(f,n);if(d<=u&&d>f)p+=" ",f=d;else break}let h=u-f;h>0&&(p+=" ".repeat(h)),s+=p,o=""};for(let u of e)u===" "?(o.length===0&&(a=i),o+=u,i++):u===" "?(c(),s+=u,i=Bh(i,n)):(c(),s+=u,i++,l=!1);return c(),s}function Wh(e,t){if(e==="")return"";let n=e.split(`
|
|
446
|
+
`),r=e.endsWith(`
|
|
447
|
+
`)&&n[n.length-1]==="";return r&&n.pop(),n.map(i=>mw(i,t)).join(`
|
|
448
|
+
`)+(r?`
|
|
449
|
+
`:"")}var dw,gw,yw,Hh=v(()=>{"use strict";ne();dw={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};gw={name:"unexpand",execute:async(e,t)=>{if(B(e))return U(dw);let n={tabStops:[8],allBlanks:!1},r=[],s=0;for(;s<e.length;){let o=e[s];if(o==="-t"&&s+1<e.length){let a=oo(e[s+1]);if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${e[s+1]}'
|
|
450
|
+
`};n.tabStops=a,s+=2}else if(o.startsWith("-t")&&o.length>2){let a=oo(o.slice(2));if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${o.slice(2)}'
|
|
451
|
+
`};n.tabStops=a,s++}else if(o==="--tabs"&&s+1<e.length){let a=oo(e[s+1]);if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${e[s+1]}'
|
|
452
|
+
`};n.tabStops=a,s+=2}else if(o.startsWith("--tabs=")){let a=oo(o.slice(7));if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${o.slice(7)}'
|
|
453
|
+
`};n.tabStops=a,s++}else if(o==="-a"||o==="--all")n.allBlanks=!0,s++;else if(o==="--"){r.push(...e.slice(s+1));break}else{if(o.startsWith("-")&&o!=="-")return Z("unexpand",o);r.push(o),s++}}let i="";if(r.length===0){let o=t.stdin??"";i=Wh(o,n)}else for(let o of r){let a=t.fs.resolvePath(t.cwd,o),l=await t.fs.readFile(a);if(l===null)return{exitCode:1,stdout:i,stderr:`unexpand: ${o}: No such file or directory
|
|
454
|
+
`};i+=Wh(l,n)}return{exitCode:0,stdout:i,stderr:""}}},yw={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Vh={};J(Vh,{flagsForFuzzing:()=>Ew,strings:()=>xw});function bw(e){return e>=32&&e<=126||e===9}function jh(e,t){if(t===null)return"";switch(t){case"o":return`${e.toString(8).padStart(7," ")} `;case"x":return`${e.toString(16).padStart(7," ")} `;case"d":return`${e.toString(10).padStart(7," ")} `;default:return t}}function Gh(e,t){let n=[],r="",s=0,i=typeof e=="string"?new TextEncoder().encode(e):e;for(let o=0;o<i.length;o++){let a=i[o];if(bw(a))r.length===0&&(s=o),r+=String.fromCharCode(a);else{if(r.length>=t.minLength){let l=jh(s,t.offsetFormat);n.push(`${l}${r}`)}r=""}}if(r.length>=t.minLength){let o=jh(s,t.offsetFormat);n.push(`${o}${r}`)}return n}var ww,xw,Ew,qh=v(()=>{"use strict";ne();ww={name:"strings",summary:"print the sequences of printable characters in files",usage:"strings [OPTION]... [FILE]...",description:"For each FILE, print the printable character sequences that are at least MIN characters long. If no FILE is specified, standard input is read.",options:["-n MIN Print sequences of at least MIN characters (default: 4)","-t FORMAT Print offset before each string (o=octal, x=hex, d=decimal)","-a Scan the entire file (default behavior)","-e ENCODING Select character encoding (s=7-bit, S=8-bit)"],examples:["strings file.bin # Extract strings (min 4 chars)","strings -n 8 file.bin # Extract strings (min 8 chars)","strings -t x file.bin # Show hex offset","echo 'hello' | strings # Read from stdin"]};xw={name:"strings",execute:async(e,t)=>{if(B(e))return U(ww);let n={minLength:4,offsetFormat:null},r=[],s=0;for(;s<e.length;){let o=e[s];if(o==="-n"&&s+1<e.length){let a=Number.parseInt(e[s+1],10);if(Number.isNaN(a)||a<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${e[s+1]}'
|
|
455
|
+
`};n.minLength=a,s+=2}else if(o.match(/^-n\d+$/)){let a=Number.parseInt(o.slice(2),10);if(Number.isNaN(a)||a<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${o.slice(2)}'
|
|
456
|
+
`};n.minLength=a,s++}else if(o.match(/^-\d+$/)){let a=Number.parseInt(o.slice(1),10);if(Number.isNaN(a)||a<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${o.slice(1)}'
|
|
457
|
+
`};n.minLength=a,s++}else if(o==="-t"&&s+1<e.length){let a=e[s+1];if(a!=="o"&&a!=="x"&&a!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${a}'
|
|
458
|
+
`};n.offsetFormat=a,s+=2}else if(o.startsWith("-t")&&o.length===3){let a=o[2];if(a!=="o"&&a!=="x"&&a!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${a}'
|
|
459
|
+
`};n.offsetFormat=a,s++}else if(o==="-a"||o==="--all"||o==="-")o==="-"&&r.push(o),s++;else if(o==="-e"&&s+1<e.length){let a=e[s+1];if(a!=="s"&&a!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${a}'
|
|
460
|
+
`};s+=2}else if(o.startsWith("-e")&&o.length===3){let a=o[2];if(a!=="s"&&a!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${a}'
|
|
461
|
+
`};s++}else if(o==="--"){r.push(...e.slice(s+1));break}else{if(o.startsWith("-")&&o!=="-")return Z("strings",o);r.push(o),s++}}let i="";if(r.length===0){let o=t.stdin??"",a=Gh(o,n);i=a.length>0?`${a.join(`
|
|
462
|
+
`)}
|
|
463
|
+
`:""}else for(let o of r){let a;if(o==="-")a=t.stdin??"";else{let c=t.fs.resolvePath(t.cwd,o);if(a=await t.fs.readFile(c),a===null)return{exitCode:1,stdout:i,stderr:`strings: ${o}: No such file or directory
|
|
464
|
+
`}}let l=Gh(a,n);l.length>0&&(i+=`${l.join(`
|
|
465
|
+
`)}
|
|
466
|
+
`)}return{exitCode:0,stdout:i,stderr:""}}},Ew={name:"strings",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-a",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsFiles:!0}});var Qh={};J(Qh,{flagsForFuzzing:()=>Iw,split:()=>Nw});function Kh(e){let t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;let n=Number.parseInt(t[1],10);if(Number.isNaN(n)||n<1)return null;let r=(t[2]||"").toUpperCase(),i=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(r);return i===void 0?null:n*i}function Sw(e,t,n){if(t)return e.toString().padStart(n,"0");let r="abcdefghijklmnopqrstuvwxyz",s="",i=e;for(let o=0;o<n;o++)s=r[i%26]+s,i=Math.floor(i/26);return s}function Cw(e,t){let n=e.split(`
|
|
467
|
+
`),r=e.endsWith(`
|
|
468
|
+
`)&&n[n.length-1]==="";r&&n.pop();let s=[];for(let i=0;i<n.length;i+=t){let o=n.slice(i,i+t),l=i+t>=n.length&&!r?o.join(`
|
|
469
|
+
`):`${o.join(`
|
|
470
|
+
`)}
|
|
471
|
+
`;s.push({content:l,hasContent:!0})}return s}function vw(e,t){let r=new TextEncoder().encode(e),s=new TextDecoder,i=[];for(let o=0;o<r.length;o+=t){let a=r.slice(o,o+t);i.push({content:s.decode(a),hasContent:a.length>0})}return i}function kw(e,t){let r=new TextEncoder().encode(e),s=new TextDecoder,i=[],o=Math.ceil(r.length/t);for(let a=0;a<t;a++){let l=a*o,c=Math.min(l+o,r.length),u=r.slice(l,c);i.push({content:s.decode(u),hasContent:u.length>0})}return i}var Aw,Zh,Nw,Iw,Xh=v(()=>{"use strict";ne();Aw={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},Zh=1e5;Nw={name:"split",execute:async(e,t)=>{if(B(e))return U(Aw);let n={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},r=[],s=0;for(;s<e.length;){let c=e[s];if(c==="-l"&&s+1<e.length){let u=Number.parseInt(e[s+1],10);if(Number.isNaN(u)||u<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${e[s+1]}'
|
|
472
|
+
`};n.mode="lines",n.lines=u,s+=2}else if(c.match(/^-l\d+$/)){let u=Number.parseInt(c.slice(2),10);if(Number.isNaN(u)||u<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${c.slice(2)}'
|
|
473
|
+
`};n.mode="lines",n.lines=u,s++}else if(c==="-b"&&s+1<e.length){let u=Kh(e[s+1]);if(u===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${e[s+1]}'
|
|
474
|
+
`};n.mode="bytes",n.bytes=u,s+=2}else if(c.match(/^-b.+$/)){let u=Kh(c.slice(2));if(u===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${c.slice(2)}'
|
|
475
|
+
`};n.mode="bytes",n.bytes=u,s++}else if(c==="-n"&&s+1<e.length){let u=Number.parseInt(e[s+1],10);if(Number.isNaN(u)||u<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${e[s+1]}'
|
|
476
|
+
`};n.mode="chunks",n.chunks=u,s+=2}else if(c.match(/^-n\d+$/)){let u=Number.parseInt(c.slice(2),10);if(Number.isNaN(u)||u<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${c.slice(2)}'
|
|
477
|
+
`};n.mode="chunks",n.chunks=u,s++}else if(c==="-a"&&s+1<e.length){let u=Number.parseInt(e[s+1],10);if(Number.isNaN(u)||u<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${e[s+1]}'
|
|
478
|
+
`};n.suffixLength=u,s+=2}else if(c.match(/^-a\d+$/)){let u=Number.parseInt(c.slice(2),10);if(Number.isNaN(u)||u<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${c.slice(2)}'
|
|
479
|
+
`};n.suffixLength=u,s++}else if(c==="-d"||c==="--numeric-suffixes")n.useNumericSuffix=!0,s++;else if(c.startsWith("--additional-suffix="))n.additionalSuffix=c.slice(20),s++;else if(c==="--additional-suffix"&&s+1<e.length)n.additionalSuffix=e[s+1],s+=2;else if(c==="--"){r.push(...e.slice(s+1));break}else{if(c.startsWith("-")&&c!=="-")return Z("split",c);r.push(c),s++}}let i="-",o="x";r.length>=1&&(i=r[0]),r.length>=2&&(o=r[1]);let a;if(i==="-")a=t.stdin??"";else{let c=t.fs.resolvePath(t.cwd,i),u=await t.fs.readFile(c);if(u===null)return{exitCode:1,stdout:"",stderr:`split: ${i}: No such file or directory
|
|
480
|
+
`};a=u}if(a==="")return{exitCode:0,stdout:"",stderr:""};let l;switch(n.mode){case"lines":l=Cw(a,n.lines);break;case"bytes":l=vw(a,n.bytes);break;case"chunks":l=kw(a,n.chunks);break;default:return n.mode}if(l.length>Zh)return{exitCode:1,stdout:"",stderr:`split: too many output files (${l.length}), limit is ${Zh}
|
|
481
|
+
`};for(let c=0;c<l.length;c++){let u=l[c];if(!u.hasContent)continue;let f=Sw(c,n.useNumericSuffix,n.suffixLength),p=`${o}${f}${n.additionalSuffix}`,h=t.fs.resolvePath(t.cwd,p);await t.fs.writeFile(h,u.content)}return{exitCode:0,stdout:"",stderr:""}}},Iw={name:"split",flags:[{flag:"-l",type:"value",valueHint:"number"},{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-d",type:"boolean"},{flag:"-a",type:"value",valueHint:"number"}],needsFiles:!0}});var Jh={};J(Jh,{column:()=>Dw,flagsForFuzzing:()=>_w});function Yh(e,t,n){return t?n?e.split(t):e.split(t).filter(r=>r.length>0):n?e.split(/[ \t]/):e.split(/[ \t]+/).filter(r=>r.length>0)}function Rw(e){let t=[];for(let n of e)for(let r=0;r<n.length;r++){let s=n[r].length;(t[r]===void 0||s>t[r])&&(t[r]=s)}return t}function Tw(e,t){if(e.length===0)return"";let n=Rw(e),r=[];for(let s of e){let i=[];for(let o=0;o<s.length;o++)o===s.length-1?i.push(s[o]):i.push(s[o].padEnd(n[o]));r.push(i.join(t))}return r.join(`
|
|
482
|
+
`)}function Pw(e,t,n){if(e.length===0)return"";let r=Math.max(...e.map(c=>c.length)),s=n.length,i=r+s,o=Math.max(1,Math.floor((t+s)/i)),a=Math.ceil(e.length/o),l=[];for(let c=0;c<a;c++){let u=[];for(let f=0;f<o;f++){let p=f*a+c;p<e.length&&(f===o-1||(f+1)*a+c>=e.length?u.push(e[p]):u.push(e[p].padEnd(r)))}l.push(u.join(n))}return l.join(`
|
|
483
|
+
`)}var $w,Ow,Dw,_w,ed=v(()=>{"use strict";st();ne();$w={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},Ow={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};Dw={name:"column",execute:async(e,t)=>{if(B(e))return U($w);let n=Ee("column",e,Ow);if(!n.ok)return n.error;let{table:r,separator:s,outputSep:i,width:o,noMerge:a}=n.result.flags,l=n.result.positional,c=i??" ",u;if(l.length===0)u=t.stdin??"";else{let m=[];for(let g of l)if(g==="-")m.push(t.stdin??"");else{let y=t.fs.resolvePath(t.cwd,g),w=await t.fs.readFile(y);if(w===null)return{exitCode:1,stdout:"",stderr:`column: ${g}: No such file or directory
|
|
484
|
+
`};m.push(w)}u=m.join("")}if(u===""||u.trim()==="")return{exitCode:0,stdout:"",stderr:""};let f=u.split(`
|
|
485
|
+
`);u.endsWith(`
|
|
486
|
+
`)&&f[f.length-1]===""&&f.pop();let h=f.filter(m=>m.trim().length>0),d;if(r){let m=h.map(g=>Yh(g,s,a));d=Tw(m,c)}else{let m=[];for(let g of h){let y=Yh(g,s,a);m.push(...y)}d=Pw(m,o,c)}return d.length>0&&(d+=`
|
|
487
|
+
`),{exitCode:0,stdout:d,stderr:""}}},_w={name:"column",flags:[{flag:"-t",type:"boolean"},{flag:"-s",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-n",type:"boolean"}],stdinType:"text",needsFiles:!0}});var td={};J(td,{flagsForFuzzing:()=>Ww,join:()=>Bw});function Lw(e,t){return t?e.split(t):e.split(/[ \t]+/).filter(n=>n.length>0)}function Mw(e,t,n,r){let s=Lw(e,t),i=s[n-1]??"";return r&&(i=i.toLowerCase()),{fields:s,joinKey:i,original:e}}function Dl(e,t,n){let r=n.separator??" ";if(n.outputFormat){let o=[];for(let{file:a,field:l}of n.outputFormat){let c=a===1?e:t;c&&l===0?o.push(c.joinKey):c&&c.fields[l-1]!==void 0?o.push(c.fields[l-1]):o.push(n.emptyString)}return o.join(r)}let s=[],i=e?.joinKey??t?.joinKey??"";if(s.push(i),e)for(let o=0;o<e.fields.length;o++)o!==n.field1-1&&s.push(e.fields[o]);if(t)for(let o=0;o<t.fields.length;o++)o!==n.field2-1&&s.push(t.fields[o]);return s.join(r)}function Uw(e){let t=e.split(","),n=[];for(let r of t){let s=r.trim().match(/^(\d+)\.(\d+)$/);if(!s)return null;let i=Number.parseInt(s[1],10),o=Number.parseInt(s[2],10);if(i!==1&&i!==2)return null;n.push({file:i,field:o})}return n}var Fw,Bw,Ww,nd=v(()=>{"use strict";ne();Fw={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};Bw={name:"join",execute:async(e,t)=>{if(B(e))return U(Fw);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},r=[],s=0;for(;s<e.length;){let p=e[s];if(p==="-1"&&s+1<e.length){let h=Number.parseInt(e[s+1],10);if(Number.isNaN(h)||h<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${e[s+1]}'
|
|
488
|
+
`};n.field1=h,s+=2}else if(p==="-2"&&s+1<e.length){let h=Number.parseInt(e[s+1],10);if(Number.isNaN(h)||h<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${e[s+1]}'
|
|
489
|
+
`};n.field2=h,s+=2}else if((p==="-t"||p==="--field-separator")&&s+1<e.length)n.separator=e[s+1],s+=2;else if(p.startsWith("-t")&&p.length>2)n.separator=p.slice(2),s++;else if(p==="-a"&&s+1<e.length){let h=Number.parseInt(e[s+1],10);if(h!==1&&h!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${e[s+1]}'
|
|
490
|
+
`};n.printUnpairable.add(h),s+=2}else if(p.match(/^-a[12]$/))n.printUnpairable.add(Number.parseInt(p[2],10)),s++;else if(p==="-v"&&s+1<e.length){let h=Number.parseInt(e[s+1],10);if(h!==1&&h!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${e[s+1]}'
|
|
491
|
+
`};n.onlyUnpairable.add(h),s+=2}else if(p.match(/^-v[12]$/))n.onlyUnpairable.add(Number.parseInt(p[2],10)),s++;else if(p==="-e"&&s+1<e.length)n.emptyString=e[s+1],s+=2;else if(p==="-o"&&s+1<e.length){let h=Uw(e[s+1]);if(!h)return{exitCode:1,stdout:"",stderr:`join: invalid field spec: '${e[s+1]}'
|
|
492
|
+
`};n.outputFormat=h,s+=2}else if(p==="-i"||p==="--ignore-case")n.ignoreCase=!0,s++;else if(p==="--"){r.push(...e.slice(s+1));break}else{if(p.startsWith("-")&&p!=="-")return Z("join",p);r.push(p),s++}}if(r.length!==2)return{exitCode:1,stdout:"",stderr:r.length<2?`join: missing file operand
|
|
493
|
+
`:`join: extra operand
|
|
494
|
+
`};let i=[];for(let p of r)if(p==="-")i.push(t.stdin??"");else{let h=t.fs.resolvePath(t.cwd,p),d=await t.fs.readFile(h);if(d===null)return{exitCode:1,stdout:"",stderr:`join: ${p}: No such file or directory
|
|
495
|
+
`};i.push(d)}let o=(p,h)=>{let d=p.split(`
|
|
496
|
+
`);return p.endsWith(`
|
|
497
|
+
`)&&d[d.length-1]===""&&d.pop(),d.filter(m=>m.length>0).map(m=>Mw(m,n.separator,h,n.ignoreCase))},a=o(i[0],n.field1),l=o(i[1],n.field2),c=new Map;for(let p of l){let h=c.get(p.joinKey);h?h.push(p):c.set(p.joinKey,[p])}let u=[],f=new Set;for(let p of a){let h=c.get(p.joinKey);if(h&&h.length>0){if(f.add(p.joinKey),n.onlyUnpairable.size===0)for(let d of h)u.push(Dl(p,d,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&u.push(Dl(p,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let p of l)f.has(p.joinKey)||u.push(Dl(null,p,n));return{exitCode:0,stdout:u.length>0?`${u.join(`
|
|
498
|
+
`)}
|
|
499
|
+
`:"",stderr:""}}},Ww={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2}});var rd={};J(rd,{flagsForFuzzing:()=>Gw,teeCommand:()=>jw});var zw,Hw,jw,Gw,sd=v(()=>{"use strict";st();ne();zw={name:"tee",summary:"read from stdin and write to stdout and files",usage:"tee [OPTION]... [FILE]...",options:["-a, --append append to the given FILEs, do not overwrite"," --help display this help and exit"]},Hw={append:{short:"a",long:"append",type:"boolean"}},jw={name:"tee",async execute(e,t){if(B(e))return U(zw);let n=Ee("tee",e,Hw);if(!n.ok)return n.error;let{append:r}=n.result.flags,s=n.result.positional,i=t.stdin,o="",a=0;for(let l of s)try{let c=t.fs.resolvePath(t.cwd,l);r?await t.fs.appendFile(c,i):await t.fs.writeFile(c,i)}catch{o+=`tee: ${l}: No such file or directory
|
|
500
|
+
`,a=1}return{stdout:i,stderr:o,exitCode:a}}},Gw={name:"tee",flags:[{flag:"-a",type:"boolean"}],stdinType:"text",needsArgs:!0}});function fn(e,t){switch(e.type){case"name":{let n=e.pattern,r=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let s=r[1],i=t.name;if(e.ignoreCase){if(!i.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!i.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Rt(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,r=t.relativePath,s=n.split("/");for(let o=0;o<s.length-1;o++){let a=s[o];if(a&&a!=="."&&a!==".."&&!a.includes("*")&&!a.includes("?")&&!a.includes("[")){let l=`/${a}/`;if(e.ignoreCase){if(!r.toLowerCase().includes(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(l))return{matches:!1,pruned:!1,printed:!1}}}let i=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(i){let o=i[1];if(e.ignoreCase){if(!r.toLowerCase().endsWith(o.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(o))return{matches:!1,pruned:!1,printed:!1}}return{matches:Rt(r,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:K(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let r=(Date.now()-t.mtime)/(1e3*60*60*24),s;return e.comparison==="more"?s=r>e.days:e.comparison==="less"?s=r<e.days:s=Math.floor(r)===e.days,{matches:s,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let r;return e.comparison==="more"?r=t.size>n:e.comparison==="less"?r=t.size<n:e.unit==="b"?r=Math.ceil(t.size/512)===e.value:r=t.size===n,{matches:r,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,r=e.mode&511,s;return e.matchType==="exact"?s=n===r:e.matchType==="all"?s=(n&r)===r:s=(n&r)!==0,{matches:s,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=fn(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=fn(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let r=fn(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:n.printed||r.printed}}case"or":{let n=fn(e.left,t);if(n.matches)return n;let r=fn(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:r.printed}}}}function ei(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return ei(e.expr);case"and":case"or":return ei(e.left)||ei(e.right)}}function ti(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return ti(e.expr);case"and":case"or":return ti(e.left)||ti(e.right);default:return!1}}function id(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=Vw(e);if(qw(e)&&n.length===1){let i=n[0].split("/").filter(o=>o.length>0);if(i.length>=2)for(let o=i.length-2;o>=0;o--){let a=i[o];if(!a.includes("*")&&!a.includes("?")&&!a.includes("[")&&a!=="."&&a!==".."){let l=i[o+1];if(l&&(l.includes("*")||l.includes("?"))){t.terminalDirName=a;let c=l.match(/^\*(\.[a-zA-Z0-9]+)$/);c&&(t.requiredExtension=c[1])}break}}}return t}function Vw(e){let t=[],n=r=>{r.type==="path"?t.push(r.pattern):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right))};return n(e),t}function qw(e){let t=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?t(n.expr):n.type==="and"||n.type==="or"?t(n.left)||t(n.right):!1;return t(e)}function od(e){let t=[],n=r=>{r&&(r.type==="newer"?t.push(r.refPath):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right)))};return n(e),t}function ni(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return ni(e.expr);case"and":case"or":return ni(e.left)&&ni(e.right)}}function Tr(e,t,n,r,s){switch(e.type){case"name":{let i=e.pattern,o=i.match(/^\*(\.[a-zA-Z0-9]+)$/);if(o){let a=o[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Rt(t,i,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let i=e.pattern,o=i.split("/");for(let l=0;l<o.length-1;l++){let c=o[l];if(c&&c!=="."&&c!==".."&&!c.includes("*")&&!c.includes("?")&&!c.includes("[")){let u=`/${c}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(u))return{matches:!1,pruned:!1,printed:!1}}}let a=i.match(/\*(\.[a-zA-Z0-9]+)$/);if(a){let l=a[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(l))return{matches:!1,pruned:!1,printed:!1}}return{matches:Rt(n,i,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let i=e.ignoreCase?"i":"";return{matches:K(e.pattern,i).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:r,pruned:!1,printed:!1}:e.fileType==="d"?{matches:s,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let i=Tr(e.expr,t,n,r,s);return{matches:!i.matches,pruned:i.pruned,printed:!1}}case"and":{let i=Tr(e.left,t,n,r,s);if(!i.matches)return{matches:!1,pruned:i.pruned,printed:!1};let o=Tr(e.right,t,n,r,s);return{matches:o.matches,pruned:i.pruned||o.pruned,printed:i.printed||o.printed}}case"or":{let i=Tr(e.left,t,n,r,s);if(i.matches)return i;let o=Tr(e.right,t,n,r,s);return{matches:o.matches,pruned:i.pruned||o.pruned,printed:o.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function ri(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return ri(e.expr);case"and":case"or":return ri(e.left)||ri(e.right);default:return!1}}function or(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return or(e.expr);case"and":case"or":return or(e.left)&&or(e.right)}}function ad(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!or(e))return _l(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:fn(e,n).pruned}}function _l(e,t){switch(e.type){case"or":{if(or(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(fn(e.left,n).pruned)return{shouldPrune:!0}}return _l(e.right,t)}case"and":{if(or(e.left)&&or(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:fn(e,n).pruned}}if(or(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return fn(e.left,n).matches?_l(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}var ld=v(()=>{"use strict";Ve();al()});function cd(e,t){let n=[],r=[],s=t;for(;s<e.length;){let o=e[s];if(o==="("||o==="\\("){n.push({type:"lparen"}),s++;continue}if(o===")"||o==="\\)"){n.push({type:"rparen"}),s++;continue}if(o==="-name"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s]}});else if(o==="-iname"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}});else if(o==="-path"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s]}});else if(o==="-ipath"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}});else if(o==="-regex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}});else if(o==="-iregex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}});else if(o==="-type"&&s+1<e.length){let a=e[++s];if(a==="f"||a==="d")n.push({type:"expr",expr:{type:"type",fileType:a}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${a}
|
|
501
|
+
`,actions:[]}}else if(o==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(o==="-mtime"&&s+1<e.length){let a=e[++s],l="exact",c=a;a.startsWith("+")?(l="more",c=a.slice(1)):a.startsWith("-")&&(l="less",c=a.slice(1));let u=parseInt(c,10);Number.isNaN(u)||n.push({type:"expr",expr:{type:"mtime",days:u,comparison:l}})}else if(o==="-newer"&&s+1<e.length){let a=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:a}})}else if(o==="-size"&&s+1<e.length){let a=e[++s],l="exact",c=a;a.startsWith("+")?(l="more",c=a.slice(1)):a.startsWith("-")&&(l="less",c=a.slice(1));let u=c.match(/^(\d+)([ckMGb])?$/);if(u){let f=parseInt(u[1],10),p=u[2]||"b";n.push({type:"expr",expr:{type:"size",value:f,unit:p,comparison:l}})}}else if(o==="-perm"&&s+1<e.length){let a=e[++s],l="exact",c=a;a.startsWith("-")?(l="all",c=a.slice(1)):a.startsWith("/")&&(l="any",c=a.slice(1));let u=parseInt(c,8);Number.isNaN(u)||n.push({type:"expr",expr:{type:"perm",mode:u,matchType:l}})}else if(o==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(o==="-not"||o==="!")n.push({type:"not"});else if(o==="-o"||o==="-or")n.push({type:"op",op:"or"});else if(o==="-a"||o==="-and")n.push({type:"op",op:"and"});else if(o==="-maxdepth"||o==="-mindepth")s++;else if(o!=="-depth")if(o==="-exec"){let a=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)a.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let l=e[s]==="+";r.push({type:"exec",command:a,batchMode:l})}else if(o==="-print")n.push({type:"expr",expr:{type:"print"}}),r.push({type:"print"});else if(o==="-print0")r.push({type:"print0"});else if(o==="-printf"&&s+1<e.length){let a=e[++s];r.push({type:"printf",format:a})}else if(o==="-delete")r.push({type:"delete"});else{if(o.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${o}'
|
|
502
|
+
`,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:r};let i=Zw(n);return i.error?{expr:null,pathIndex:s,error:i.error,actions:r}:{expr:i.expr,pathIndex:s,actions:r}}function Zw(e){let t=0;function n(){let a=r();if(!a)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="or"){t++;let c=r();if(!c)return a;a={type:"or",left:a,right:c}}else break}return a}function r(){let a=s();if(!a)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="and"){t++;let c=s();if(!c)return a;a={type:"and",left:a,right:c}}else if(l.type==="expr"||l.type==="not"||l.type==="lparen"){let c=s();if(!c)return a;a={type:"and",left:a,right:c}}else break}return a}function s(){if(t<e.length&&e[t].type==="not"){t++;let a=s();return a?{type:"not",expr:a}:null}return i()}function i(){if(t>=e.length)return null;let a=e[t];if(a.type==="lparen"){t++;let l=n();return t<e.length&&e[t].type==="rparen"&&t++,l}return a.type==="expr"?(t++,a.expr):(a.type==="rparen",null)}return{expr:n()}}var ud=v(()=>{"use strict"});var pd={};J(pd,{findCommand:()=>Jw,flagsForFuzzing:()=>rb});function Kw(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function Qw(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}function eb(e,t){let n=Pi(e),r="",s=0;for(;s<n.length;)if(n[s]==="%"&&s+1<n.length){if(s++,n[s]==="%"){r+="%",s++;continue}let[i,o,a]=Of(n,s);if(s+=a,s>=n.length){r+="%";break}let l=n[s],c;switch(l){case"f":c=t.name,s++;break;case"h":{let u=t.path.lastIndexOf("/");c=u>0?t.path.slice(0,u):".",s++;break}case"p":c=t.path,s++;break;case"P":{let u=t.startingPoint;t.path===u?c="":t.path.startsWith(`${u}/`)?c=t.path.slice(u.length+1):u==="."&&t.path.startsWith("./")?c=t.path.slice(2):c=t.path,s++;break}case"s":c=String(t.size),s++;break;case"d":c=String(t.depth),s++;break;case"m":c=(t.mode&511).toString(8),s++;break;case"M":c=Hs(t.mode,t.isDirectory),s++;break;case"t":{let u=new Date(t.mtime);c=tb(u),s++;break}case"T":{if(s+1<n.length){let u=n[s+1],f=new Date(t.mtime);c=nb(f,u),s+=2}else c="%T",s++;break}default:r+=`%${i!==0||o!==-1?`${i}.${o}`:""}${l}`,s++;continue}r+=Ti(c,i,o)}else r+=n[s],s++;return r}function tb(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=t[e.getDay()],s=n[e.getMonth()],i=String(e.getDate()).padStart(2," "),o=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0"),c=e.getFullYear();return`${r} ${s} ${i} ${o}:${a}:${l} ${c}`}function nb(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var fd,Xw,Yw,Jw,rb,hd=v(()=>{"use strict";Nr();ja();ne();Ba();ld();ud();fd=500;Xw={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},Yw=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),Jw={name:"find",async execute(e,t){if(B(e))return U(Xw);let n=[],r=null,s=null,i=!1,o=!1;for(let N=0;N<e.length;N++){let R=e[N];if(R==="-maxdepth"&&N+1<e.length)o=!0,r=parseInt(e[++N],10);else if(R==="-mindepth"&&N+1<e.length)o=!0,s=parseInt(e[++N],10);else if(R==="-depth")o=!0,i=!0;else if(R==="-exec")for(o=!0,N++;N<e.length&&e[N]!==";"&&e[N]!=="+";)N++;else!R.startsWith("-")&&R!==";"&&R!=="+"&&R!=="("&&R!==")"&&R!=="\\("&&R!=="\\)"&&R!=="!"?o||n.push(R):Yw.has(R)?(o=!0,N++):(R.startsWith("-")||R==="("||R==="\\("||R==="!")&&(o=!0)}n.length===0&&n.push(".");let{expr:a,error:l,actions:c}=cd(e,0);if(l)return{stdout:"",stderr:l,exitCode:1};let u=c.some(N=>N.type==="print"),f=c.length===0,p=[],h=c.some(N=>N.type==="printf"),d=[],m="",g=0,y=od(a),w=new Map;for(let N of y){let R=t.fs.resolvePath(t.cwd,N);try{let I=await t.fs.stat(R);w.set(N,I.mtime?.getTime()??Date.now())}catch{}}let b=c.some(N=>{if(N.type!=="printf")return!1;let R=N.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(R)}),x=ei(a)||b,A=ti(a),$=id(a),O=ri(a),F=ni(a),P=typeof t.fs.readdirWithFileTypes=="function";for(let N of n){let me=function(W){let fe=s===null||W.depth>=s,ie=!1;if(fe&&a!==null){let G=Date.now(),Oe;if(F)Oe=Tr(a,W.name,W.relativePath,W.isFile,W.isDirectory);else{let Ge={name:W.name,relativePath:W.relativePath,isFile:W.isFile,isDirectory:W.isDirectory,isEmpty:W.isEmpty,mtime:W.stat?.mtime?.getTime()??Date.now(),size:W.stat?.size??0,mode:W.stat?.mode??420,newerRefTimes:w};Oe=fn(a,Ge)}fe=Oe.matches,ie=u?Oe.printed:fe,I.evalCalls++,I.evalTime+=Date.now()-G}else fe&&(ie=!0);return ie?{print:!0,printfData:h?{path:W.relativePath,name:W.name,size:W.stat?.size??0,mtime:W.stat?.mtime?.getTime()??Date.now(),mode:W.stat?.mode??420,isDirectory:W.isDirectory,depth:W.depth,startingPoint:N}:null}:{print:!1,printfData:null}};var C=me;N.length>1&&N.endsWith("/")&&(N=N.slice(0,-1));let R=t.fs.resolvePath(t.cwd,N);try{await t.fs.stat(R)}catch{m+=`find: ${N}: No such file or directory
|
|
503
|
+
`,g=1;continue}let I=Kw(),T=Date.now();async function L(W){let{path:q,depth:fe,typeInfo:ie}=W;if(I.nodeCount++,fe>(r??256))return null;let ke,G,Oe;if(ie&&!x)ke=ie.isFile,G=ie.isDirectory;else{try{let Ar=Date.now();Oe=await t.fs.stat(q),I.statCalls++,I.statTime+=Date.now()-Ar}catch{return null}if(!Oe)return null;ke=Oe.isFile,G=Oe.isDirectory}let Ge;q===R?Ge=N.split("/").pop()||N:Ge=q.split("/").pop()||"";let et=q===R?N:N==="."?`./${q.slice(R==="/"?R.length:R.length+1)}`:N+q.slice(R.length),ct=[],dt=null,ut=null,ft=!1;G&&O&&!i&&(ft=ad(a,{name:Ge,relativePath:et,isFile:ke,isDirectory:G}).shouldPrune,ft&&I.earlyPrunes++);let Xt=fe>=(r??256),Yt=$.terminalDirName!==null&&Ge===$.terminalDirName,Ws=!Xt&&!Yt&&!ft;if(G&&((Ws||A||Yt)&&!ft)){let Ar=Date.now();if(P&&t.fs.readdirWithFileTypes){if(dt=await t.fs.readdirWithFileTypes(q),ut=dt.map(Ut=>Ut.name),I.readdirCalls++,I.readdirTime+=Date.now()-Ar,Ws)ct=dt.map((Ut,on)=>({path:q==="/"?`/${Ut.name}`:`${q}/${Ut.name}`,depth:fe+1,typeInfo:{isFile:Ut.isFile,isDirectory:Ut.isDirectory},resultIndex:on}));else if(Yt){let Ut=$.requiredExtension;ct=dt.filter(on=>on.isFile&&(!Ut||on.name.endsWith(Ut))).map((on,v7)=>({path:q==="/"?`/${on.name}`:`${q}/${on.name}`,depth:fe+1,typeInfo:{isFile:on.isFile,isDirectory:on.isDirectory},resultIndex:v7}))}}else ut=await t.fs.readdir(q),I.readdirCalls++,I.readdirTime+=Date.now()-Ar,Ws&&(ct=ut.map((Ut,on)=>({path:q==="/"?`/${Ut}`:`${q}/${Ut}`,depth:fe+1,resultIndex:on})))}let $i=ke?(Oe?.size??0)===0:ut!==null&&ut.length===0,Kr=ft;if(!i&&a!==null&&!ft&&O){let Ar=Date.now(),Ut={name:Ge,relativePath:et,isFile:ke,isDirectory:G,isEmpty:$i,mtime:Oe?.mtime?.getTime()??Date.now(),size:Oe?.size??0,mode:Oe?.mode??420,newerRefTimes:w};Kr=fn(a,Ut).pruned,I.evalCalls++,I.evalTime+=Date.now()-Ar}return{relativePath:et,name:Ge,isFile:ke,isDirectory:G,isEmpty:$i,stat:Oe,depth:fe,children:Kr?[]:ct,pruned:Kr}}async function ue(){let W={paths:[],printfData:[]};if(i){let Oe=function(Ge){let et={paths:[],printfData:[]},ct=ie[Ge];if(!ct)return et;for(let ft of ct.childIndices){let Xt=Oe(ft);et.paths.push(...Xt.paths),et.printfData.push(...Xt.printfData)}let{print:dt,printfData:ut}=me(ct.node);return dt&&(et.paths.push(ct.node.relativePath),ut&&et.printfData.push(ut)),et};var q=Oe;let ie=[],ke=[{item:{path:R,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],G=new Map;for(;ke.length>0;){let Ge=Date.now(),et=ke.splice(0,fd),ct=await Promise.all(et.map(dt=>L(dt.item)));I.batchCount++,I.batchTime+=Date.now()-Ge;for(let dt=0;dt<et.length;dt++){let ut=ct[dt],ft=et[dt];if(!ut)continue;let Xt=ie.length;if(ft.parentIndex>=0){let Yt=G.get(ft.parentIndex)||[];Yt.push(Xt),G.set(ft.parentIndex,Yt)}ie.push({node:ut,parentIndex:ft.parentIndex,childIndices:[]});for(let Yt=0;Yt<ut.children.length;Yt++)ke.push({item:ut.children[Yt],parentIndex:Xt,childOrderInParent:Yt})}}for(let[Ge,et]of G)Ge>=0&&Ge<ie.length&&(ie[Ge].childIndices=et);if(ie.length>0){let Ge=Oe(0);W.paths.push(...Ge.paths),W.printfData.push(...Ge.printfData)}}else{let Ge=function(et){let ct=ie.get(et);ct&&(W.paths.push(ct.path),ct.printfData&&W.printfData.push(ct.printfData));let dt=Oe.get(et);if(dt)for(let ut of dt)Ge(ut)};var fe=Ge;let ie=new Map,ke=0,G=[{item:{path:R,depth:0,resultIndex:0},orderIndex:ke++}],Oe=new Map;for(;G.length>0;){let et=Date.now(),ct=G.splice(0,fd),dt=await Promise.all(ct.map(async({item:ut,orderIndex:ft})=>{let Xt=await L(ut);return Xt?{node:Xt,orderIndex:ft}:null}));I.batchCount++,I.batchTime+=Date.now()-et;for(let ut of dt){if(!ut)continue;let{node:ft,orderIndex:Xt}=ut,{print:Yt,printfData:Ws}=me(ft);if(Yt&&ie.set(Xt,{path:ft.relativePath,printfData:Ws}),ft.children.length>0){let Fa=[];for(let $i of ft.children){let Kr=ke++;Fa.push(Kr),G.push({item:$i,orderIndex:Kr})}Oe.set(Xt,Fa)}}}Ge(0)}return W}let re=await ue();if(p.push(...re.paths),d.push(...re.printfData),t.trace){let W=Date.now()-T;Qw(t.trace,I,W),t.trace({category:"find",name:"searchPath",durationMs:W,details:{path:N,resultsFound:re.paths.length}})}}let M="";if(c.length>0)for(let N of c)switch(N.type){case"print":M+=p.length>0?`${p.join(`
|
|
504
|
+
`)}
|
|
505
|
+
`:"";break;case"print0":M+=p.length>0?`${p.join("\0")}\0`:"";break;case"delete":{let R=[...p].sort((I,T)=>T.length-I.length);for(let I of R){let T=t.fs.resolvePath(t.cwd,I);try{await t.fs.rm(T,{recursive:!1})}catch(L){let me=L instanceof Error?L.message:String(L);m+=`find: cannot delete '${I}': ${me}
|
|
506
|
+
`,g=1}}break}case"printf":for(let R of d)M+=eb(N.format,R);break;case"exec":if(!t.exec)return{stdout:"",stderr:`find: -exec not supported in this context
|
|
507
|
+
`,exitCode:1};if(N.batchMode){let R=[];for(let T of N.command)T==="{}"?R.push(...p):R.push(T);let I=await t.exec(tn([R[0]]),{cwd:t.cwd,signal:t.signal,args:R.slice(1)});M+=I.stdout,m+=I.stderr,I.exitCode!==0&&(g=I.exitCode)}else for(let R of p){let I=N.command.map(L=>L==="{}"?R:L),T=await t.exec(tn([I[0]]),{cwd:t.cwd,signal:t.signal,args:I.slice(1)});M+=T.stdout,m+=T.stderr,T.exitCode!==0&&(g=T.exitCode)}break}else f&&(M=p.length>0?`${p.join(`
|
|
508
|
+
`)}
|
|
509
|
+
`:"");return{stdout:M,stderr:m,exitCode:g}}};rb={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0}});var dd={};J(dd,{basenameCommand:()=>ib,flagsForFuzzing:()=>ob});var sb,ib,ob,md=v(()=>{"use strict";ne();sb={name:"basename",summary:"strip directory and suffix from filenames",usage:`basename NAME [SUFFIX]
|
|
510
|
+
basename OPTION... NAME...`,options:["-a, --multiple support multiple arguments","-s, --suffix=SUFFIX remove a trailing SUFFIX"," --help display this help and exit"]},ib={name:"basename",async execute(e,t){if(B(e))return U(sb);let n=!1,r="",s=[];for(let o=0;o<e.length;o++){let a=e[o];a==="-a"||a==="--multiple"?n=!0:a==="-s"&&o+1<e.length?(r=e[++o],n=!0):a.startsWith("--suffix=")?(r=a.slice(9),n=!0):a.startsWith("-")||s.push(a)}if(s.length===0)return{stdout:"",stderr:`basename: missing operand
|
|
511
|
+
`,exitCode:1};!n&&s.length>=2&&(r=s.pop()??"");let i=[];for(let o of s){let a=o.replace(/\/+$/,""),l=a.split("/").pop()||a;r&&l.endsWith(r)&&(l=l.slice(0,-r.length)),i.push(l)}return{stdout:`${i.join(`
|
|
512
|
+
`)}
|
|
513
|
+
`,stderr:"",exitCode:0}}},ob={name:"basename",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"value",valueHint:"string"}],needsArgs:!0}});var gd={};J(gd,{dirnameCommand:()=>lb,flagsForFuzzing:()=>cb});var ab,lb,cb,yd=v(()=>{"use strict";ne();ab={name:"dirname",summary:"strip last component from file name",usage:"dirname [OPTION] NAME...",options:[" --help display this help and exit"]},lb={name:"dirname",async execute(e,t){if(B(e))return U(ab);let n=e.filter(s=>!s.startsWith("-"));if(n.length===0)return{stdout:"",stderr:`dirname: missing operand
|
|
514
|
+
`,exitCode:1};let r=[];for(let s of n){let i=s.replace(/\/+$/,""),o=i.lastIndexOf("/");o===-1?r.push("."):o===0?r.push("/"):r.push(i.slice(0,o))}return{stdout:`${r.join(`
|
|
515
|
+
`)}
|
|
516
|
+
`,stderr:"",exitCode:0}}},cb={name:"dirname",flags:[],needsArgs:!0}});var bd={};J(bd,{flagsForFuzzing:()=>db,treeCommand:()=>pb});async function hb(e,t,n,r,s){let i={output:"",stderr:"",dirCount:0,fileCount:0},o=e.fs.resolvePath(e.cwd,t);try{if(!(await e.fs.stat(o)).isDirectory)return i.output=`${t}
|
|
517
|
+
`,i.fileCount=1,i}catch{return i.stderr=`tree: ${t}: No such file or directory
|
|
518
|
+
`,i}if(i.output=`${t}
|
|
519
|
+
`,n.maxDepth!==null&&s>=n.maxDepth)return i;try{let a=[];if(e.fs.readdirWithFileTypes)a=(await e.fs.readdirWithFileTypes(o)).map(u=>({name:u.name,isDirectory:u.isDirectory}));else{let c=await e.fs.readdir(o);for(let u=0;u<c.length;u+=100){let f=c.slice(u,u+100),p=await Promise.all(f.map(async h=>{let d=o==="/"?`/${h}`:`${o}/${h}`;try{let m=await e.fs.stat(d);return{name:h,isDirectory:m.isDirectory}}catch{return null}}));a.push(...p.filter(h=>h!==null))}}let l=a.filter(c=>!(!n.showHidden&&c.name.startsWith(".")||n.directoriesOnly&&!c.isDirectory));l.sort((c,u)=>c.name.localeCompare(u.name));for(let c=0;c<l.length;c++){let u=l[c],f=o==="/"?`/${u.name}`:`${o}/${u.name}`,p=c===l.length-1,h=p?"`-- ":"|-- ",d=r+(p?" ":"| ");if(u.isDirectory){i.dirCount++;let m=n.fullPath?f:u.name;if(i.output+=`${r+h+m}
|
|
520
|
+
`,n.maxDepth===null||s+1<n.maxDepth){let g=await wd(e,f,n,d,s+1);i.output+=g.output,i.dirCount+=g.dirCount,i.fileCount+=g.fileCount}}else{i.fileCount++;let m=n.fullPath?f:u.name;i.output+=`${r+h+m}
|
|
521
|
+
`}}}catch{i.stderr=`tree: ${t}: Permission denied
|
|
522
|
+
`}return i}async function wd(e,t,n,r,s){let i={output:"",stderr:"",dirCount:0,fileCount:0};if(n.maxDepth!==null&&s>=n.maxDepth)return i;try{let o=[];if(e.fs.readdirWithFileTypes)o=(await e.fs.readdirWithFileTypes(t)).map(c=>({name:c.name,isDirectory:c.isDirectory}));else{let l=await e.fs.readdir(t);for(let c=0;c<l.length;c+=100){let u=l.slice(c,c+100),f=await Promise.all(u.map(async p=>{let h=t==="/"?`/${p}`:`${t}/${p}`;try{let d=await e.fs.stat(h);return{name:p,isDirectory:d.isDirectory}}catch{return null}}));o.push(...f.filter(p=>p!==null))}}let a=o.filter(l=>!(!n.showHidden&&l.name.startsWith(".")||n.directoriesOnly&&!l.isDirectory));a.sort((l,c)=>l.name.localeCompare(c.name));for(let l=0;l<a.length;l++){let c=a[l],u=t==="/"?`/${c.name}`:`${t}/${c.name}`,f=l===a.length-1,p=f?"`-- ":"|-- ",h=r+(f?" ":"| ");if(c.isDirectory){i.dirCount++;let d=n.fullPath?u:c.name;i.output+=`${r+p+d}
|
|
523
|
+
`;let m=await wd(e,u,n,h,s+1);i.output+=m.output,i.dirCount+=m.dirCount,i.fileCount+=m.fileCount}else{i.fileCount++;let d=n.fullPath?u:c.name;i.output+=`${r+p+d}
|
|
524
|
+
`}}}catch{}return i}var ub,fb,pb,db,xd=v(()=>{"use strict";st();Xr();ne();ub={name:"tree",summary:"list contents of directories in a tree-like format",usage:"tree [OPTION]... [DIRECTORY]...",options:["-a include hidden files","-d list directories only","-L LEVEL limit depth of directory tree","-f print full path prefix for each file"," --help display this help and exit"]},fb={showHidden:{short:"a",type:"boolean"},directoriesOnly:{short:"d",type:"boolean"},fullPath:{short:"f",type:"boolean"},maxDepth:{short:"L",type:"number"}},pb={name:"tree",async execute(e,t){if(B(e))return U(ub);let n=Ee("tree",e,fb);if(!n.ok)return n.error;let r={showHidden:n.result.flags.showHidden,directoriesOnly:n.result.flags.directoriesOnly,maxDepth:n.result.flags.maxDepth??null,fullPath:n.result.flags.fullPath},s=n.result.positional;s.length===0&&s.push(".");let i="",o="",a=0,l=0;for(let c of s){let u=await hb(t,c,r,"",0);i+=u.output,o+=u.stderr,a+=u.dirCount,l+=u.fileCount}return i+=`
|
|
525
|
+
${a} director${a===1?"y":"ies"}`,r.directoriesOnly||(i+=`, ${l} file${l===1?"":"s"}`),i+=`
|
|
526
|
+
`,{stdout:i,stderr:o,exitCode:o?1:0}}};db={name:"tree",flags:[{flag:"-a",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-L",type:"value",valueHint:"number"}],needsFiles:!0}});var Ad={};J(Ad,{duCommand:()=>yb,flagsForFuzzing:()=>bb});async function Ed(e,t,n,r,s){let i={output:"",totalSize:0,stderr:""};if(s>wb)return i;try{let o=await e.fs.stat(t);if(!o.isDirectory)return i.totalSize=o.size,(r.allFiles||s===0)&&(i.output=ao(o.size,r.humanReadable)+" "+n+`
|
|
527
|
+
`),i;let a=0,l=[];if(e.fs.readdirWithFileTypes){let f=await e.fs.readdirWithFileTypes(t),p=f.filter(d=>d.isFile),h=f.filter(d=>d.isDirectory);for(let d=0;d<p.length;d+=100){let m=p.slice(d,d+100),g=await Promise.all(m.map(async y=>{let w=t==="/"?`/${y.name}`:`${t}/${y.name}`;try{let b=await e.fs.stat(w);return{name:y.name,isDirectory:!1,size:b.size}}catch{return{name:y.name,isDirectory:!1,size:0}}}));l.push(...g)}l.push(...h.map(d=>({name:d.name,isDirectory:!0})))}else{let f=await e.fs.readdir(t);for(let p=0;p<f.length;p+=100){let h=f.slice(p,p+100),d=await Promise.all(h.map(async m=>{let g=t==="/"?`/${m}`:`${t}/${m}`;try{let y=await e.fs.stat(g);return{name:m,isDirectory:y.isDirectory,size:y.isDirectory?void 0:y.size}}catch{return{name:m,isDirectory:!1,size:0}}}));l.push(...d)}}l.sort((f,p)=>f.name.localeCompare(p.name));let c=l.filter(f=>!f.isDirectory);for(let f of c){let p=f.size??0;if(a+=p,r.allFiles&&!r.summarize){let h=n==="."?f.name:`${n}/${f.name}`;i.output+=ao(p,r.humanReadable)+" "+h+`
|
|
528
|
+
`}}let u=l.filter(f=>f.isDirectory);for(let f=0;f<u.length;f+=100){let p=u.slice(f,f+100),h=await Promise.all(p.map(async d=>{let m=t==="/"?`/${d.name}`:`${t}/${d.name}`,g=n==="."?d.name:`${n}/${d.name}`;return{name:d.name,result:await Ed(e,m,g,r,s+1)}}));h.sort((d,m)=>d.name.localeCompare(m.name));for(let{result:d}of h)a+=d.totalSize,r.summarize||(r.maxDepth===null||s+1<=r.maxDepth)&&(i.output+=d.output)}i.totalSize=a,(r.summarize||r.maxDepth===null||s<=r.maxDepth)&&(i.output+=`${ao(a,r.humanReadable)} ${n}
|
|
529
|
+
`)}catch{i.stderr=`du: cannot read directory '${n}': Permission denied
|
|
530
|
+
`}return i}function ao(e,t){return t?e<1024?`${e}`:e<1024*1024?`${(e/1024).toFixed(1)}K`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)}M`:`${(e/(1024*1024*1024)).toFixed(1)}G`:String(Math.ceil(e/1024)||1)}var mb,gb,yb,wb,bb,Sd=v(()=>{"use strict";st();Xr();ne();mb={name:"du",summary:"estimate file space usage",usage:"du [OPTION]... [FILE]...",options:["-a write counts for all files, not just directories","-h print sizes in human readable format","-s display only a total for each argument","-c produce a grand total","--max-depth=N print total for directory only if N or fewer levels deep"," --help display this help and exit"]},gb={allFiles:{short:"a",type:"boolean"},humanReadable:{short:"h",type:"boolean"},summarize:{short:"s",type:"boolean"},grandTotal:{short:"c",type:"boolean"},maxDepth:{long:"max-depth",type:"number"}},yb={name:"du",async execute(e,t){if(B(e))return U(mb);let n=Ee("du",e,gb);if(!n.ok)return n.error;let r={allFiles:n.result.flags.allFiles,humanReadable:n.result.flags.humanReadable,summarize:n.result.flags.summarize,grandTotal:n.result.flags.grandTotal,maxDepth:n.result.flags.maxDepth??null},s=n.result.positional;s.length===0&&s.push(".");let i="",o="",a=0;for(let l of s){let c=t.fs.resolvePath(t.cwd,l);try{await t.fs.stat(c);let u=await Ed(t,c,l,r,0);i+=u.output,a+=u.totalSize,o+=u.stderr}catch{o+=`du: cannot access '${l}': No such file or directory
|
|
531
|
+
`}}return r.grandTotal&&s.length>0&&(i+=`${ao(a,r.humanReadable)} total
|
|
532
|
+
`),{stdout:i,stderr:o,exitCode:o?1:0}}},wb=1e3;bb={name:"du",flags:[{flag:"-a",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"--max-depth",type:"value",valueHint:"number"}],needsFiles:!0}});var Fl={};J(Fl,{envCommand:()=>Eb,flagsForFuzzing:()=>Cb,printenvCommand:()=>Sb,printenvFlagsForFuzzing:()=>vb});var xb,Eb,Ab,Sb,Cb,vb,Ll=v(()=>{"use strict";Kn();ne();xb={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},Eb={name:"env",async execute(e,t){if(B(e))return U(xb);let n=!1,r=[],s=new Map,i=-1;for(let l=0;l<e.length;l++){let c=e[l];if(c==="-i"||c==="--ignore-environment")n=!0;else if(c==="-u"&&l+1<e.length)r.push(e[++l]);else if(c.startsWith("-u"))r.push(c.slice(2));else if(c.startsWith("--unset="))r.push(c.slice(8));else{if(c.startsWith("--")&&c!=="--")return Z("env",c);if(c.startsWith("-")&&c!=="-"){for(let u of c.slice(1))if(u!=="i"&&u!=="u")return Z("env",`-${u}`);c.includes("i")&&(n=!0)}else if(c.includes("=")&&i===-1){let u=c.indexOf("="),f=c.slice(0,u),p=c.slice(u+1);s.set(f,p)}else{i=l;break}}}let o;if(n)o=new Map(s);else{o=new Map(t.env);for(let l of r)o.delete(l);for(let[l,c]of s)o.set(l,c)}if(i===-1){let l=[];for(let[c,u]of o)l.push(`${c}=${u}`);return{stdout:l.join(`
|
|
533
|
+
`)+(l.length>0?`
|
|
534
|
+
`:""),stderr:"",exitCode:0}}if(!t.exec)return{stdout:"",stderr:`env: command execution not supported in this context
|
|
535
|
+
`,exitCode:1};let a=e.slice(i);return t.exec("command",{cwd:t.cwd,env:Et(o),replaceEnv:!0,stdin:t.stdin,signal:t.signal,args:a})}},Ab={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},Sb={name:"printenv",async execute(e,t){if(B(e))return U(Ab);let n=e.filter(i=>!i.startsWith("-"));if(n.length===0){let i=[];for(let[o,a]of t.env)i.push(`${o}=${a}`);return{stdout:i.join(`
|
|
536
|
+
`)+(i.length>0?`
|
|
537
|
+
`:""),stderr:"",exitCode:0}}let r=[],s=0;for(let i of n){let o=t.env.get(i);o!==void 0?r.push(o):s=1}return{stdout:r.join(`
|
|
538
|
+
`)+(r.length>0?`
|
|
539
|
+
`:""),stderr:"",exitCode:s}}},Cb={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},vb={name:"printenv",flags:[]}});var Ml={};J(Ml,{aliasCommand:()=>Nb,flagsForFuzzing:()=>$b,unaliasCommand:()=>Ib,unaliasFlagsForFuzzing:()=>Ob});var kb,ps,Nb,Ib,$b,Ob,Ul=v(()=>{"use strict";ne();kb={name:"alias",summary:"define or display aliases",usage:"alias [name[=value] ...]",options:[" --help display this help and exit"]},ps="BASH_ALIAS_",Nb={name:"alias",async execute(e,t){if(B(e))return U(kb);if(e.length===0){let r="";for(let[s,i]of t.env)if(s.startsWith(ps)){let o=s.slice(ps.length);r+=`alias ${o}='${i}'
|
|
540
|
+
`}return{stdout:r,stderr:"",exitCode:0}}let n=e[0]==="--"?e.slice(1):e;for(let r of n){let s=r.indexOf("=");if(s===-1){let i=ps+r;return t.env.get(i)?{stdout:`alias ${r}='${t.env.get(i)}'
|
|
541
|
+
`,stderr:"",exitCode:0}:{stdout:"",stderr:`alias: ${r}: not found
|
|
542
|
+
`,exitCode:1}}else{let i=r.slice(0,s),o=r.slice(s+1);(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))&&(o=o.slice(1,-1)),t.env.set(ps+i,o)}}return{stdout:"",stderr:"",exitCode:0}}},Ib={name:"unalias",async execute(e,t){if(B(e))return U({name:"unalias",summary:"remove alias definitions",usage:"unalias name [name ...]",options:["-a remove all aliases"," --help display this help and exit"]});if(e.length===0)return{stdout:"",stderr:`unalias: usage: unalias [-a] name [name ...]
|
|
543
|
+
`,exitCode:1};if(e[0]==="-a"){for(let i of t.env.keys())i.startsWith(ps)&&t.env.delete(i);return{stdout:"",stderr:"",exitCode:0}}let n=e[0]==="--"?e.slice(1):e,r=!1,s="";for(let i of n){let o=ps+i;t.env.get(o)?t.env.delete(o):(s+=`unalias: ${i}: not found
|
|
544
|
+
`,r=!0)}return{stdout:"",stderr:s,exitCode:r?1:0}}},$b={name:"alias",flags:[]},Ob={name:"unalias",flags:[{flag:"-a",type:"boolean"}]}});var vd={};J(vd,{flagsForFuzzing:()=>Pb,historyCommand:()=>Tb});var Rb,Cd,Tb,Pb,kd=v(()=>{"use strict";ne();Rb={name:"history",summary:"display command history",usage:"history [n]",options:["-c clear the history list"," --help display this help and exit"]},Cd="BASH_HISTORY",Tb={name:"history",async execute(e,t){if(B(e))return U(Rb);let n=t.env.get(Cd)||"[]",r;try{r=JSON.parse(n)}catch{r=[]}if(e[0]==="-c")return t.env.set(Cd,"[]"),{stdout:"",stderr:"",exitCode:0};let s=r.length;e[0]&&/^\d+$/.test(e[0])&&(s=Math.min(parseInt(e[0],10),r.length));let i=r.length-s,o="";for(let a=i;a<r.length;a++){let l=(a+1).toString().padStart(5," ");o+=`${l} ${r[a]}
|
|
545
|
+
`}return{stdout:o,stderr:"",exitCode:0}}},Pb={name:"history",flags:[{flag:"-c",type:"boolean"}]}});var Nd={};J(Nd,{flagsForFuzzing:()=>Fb,xargsCommand:()=>_b});var Db,_b,Fb,Id=v(()=>{"use strict";Nr();ne();Db={name:"xargs",summary:"build and execute command lines from standard input",usage:"xargs [OPTION]... [COMMAND [INITIAL-ARGS]]",options:["-I REPLACE replace occurrences of REPLACE with input","-d DELIM use DELIM as input delimiter (e.g., -d '\\n' for newline)","-n NUM use at most NUM arguments per command line","-P NUM run at most NUM processes at a time","-0, --null items are separated by null, not whitespace","-t, --verbose print commands before executing","-r, --no-run-if-empty do not run command if input is empty"," --help display this help and exit"]},_b={name:"xargs",async execute(e,t){if(B(e))return U(Db);let n=null,r=null,s=null,i=null,o=!1,a=!1,l=!1,c=0;for(let w=0;w<e.length;w++){let b=e[w];if(b==="-I"&&w+1<e.length)n=e[++w],c=w+1;else if(b==="-d"&&w+1<e.length)r=e[++w].replace(/\\n/g,`
|
|
546
|
+
`).replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\0/g,"\0").replace(/\\\\/g,"\\"),c=w+1;else if(b==="-n"&&w+1<e.length)s=parseInt(e[++w],10),c=w+1;else if(b==="-P"&&w+1<e.length)i=parseInt(e[++w],10),c=w+1;else if(b==="-0"||b==="--null")o=!0,c=w+1;else if(b==="-t"||b==="--verbose")a=!0,c=w+1;else if(b==="-r"||b==="--no-run-if-empty")l=!0,c=w+1;else{if(b.startsWith("--"))return Z("xargs",b);if(b.startsWith("-")&&b.length>1){for(let x of b.slice(1))if(!"0tr".includes(x))return Z("xargs",`-${x}`);b.includes("0")&&(o=!0),b.includes("t")&&(a=!0),b.includes("r")&&(l=!0),c=w+1}else if(!b.startsWith("-")){c=w;break}}}let u=e.slice(c);u.length===0&&u.push("echo");let f;if(o?f=t.stdin.split("\0").filter(w=>w.length>0):r!==null?f=t.stdin.replace(/\n$/,"").split(r).filter(b=>b.length>0):f=t.stdin.split(/\s+/).map(w=>w.trim()).filter(w=>w.length>0),f.length===0)return l?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0};let p="",h="",d=0,m=w=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(w)?`"${w.replace(/([\\"`$])/g,"\\$1")}"`:w,g=async w=>{if(a){let x=w.map(m).join(" ");h+=`${x}
|
|
547
|
+
`}return t.exec?t.exec(tn([w[0]]),{cwd:t.cwd,signal:t.signal,args:w.slice(1)}):{stdout:`${w.map(m).join(" ")}
|
|
548
|
+
`,stderr:"",exitCode:0}},y=async w=>{if(i!==null&&i>1)for(let b=0;b<w.length;b+=i){let x=w.slice(b,b+i),A=await Promise.all(x.map(g));for(let $ of A)p+=$.stdout,h+=$.stderr,$.exitCode!==0&&(d=$.exitCode)}else for(let b of w){let x=await g(b);p+=x.stdout,h+=x.stderr,x.exitCode!==0&&(d=x.exitCode)}};if(n!==null){let w=f.map(b=>u.map(x=>x.replaceAll(n,b)));await y(w)}else if(s!==null){let w=[];for(let b=0;b<f.length;b+=s){let x=f.slice(b,b+s);w.push([...u,...x])}await y(w)}else{let w=[...u,...f],b=await g(w);p+=b.stdout,h+=b.stderr,d=b.exitCode}return{stdout:p,stderr:h,exitCode:d}}},Fb={name:"xargs",flags:[{flag:"-I",type:"value",valueHint:"string"},{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-0",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-r",type:"boolean"}],stdinType:"text"}});var Bl={};J(Bl,{falseCommand:()=>Mb,falseFlagsForFuzzing:()=>Bb,flagsForFuzzing:()=>Ub,trueCommand:()=>Lb});var Lb,Mb,Ub,Bb,Wl=v(()=>{"use strict";Lb={name:"true",async execute(){return{stdout:"",stderr:"",exitCode:0}}},Mb={name:"false",async execute(){return{stdout:"",stderr:"",exitCode:1}}},Ub={name:"true",flags:[]},Bb={name:"false",flags:[]}});var $d={};J($d,{clearCommand:()=>zb,flagsForFuzzing:()=>Hb});var Wb,zb,Hb,Od=v(()=>{"use strict";ne();Wb={name:"clear",summary:"clear the terminal screen",usage:"clear [OPTIONS]",options:[" --help display this help and exit"]},zb={name:"clear",async execute(e,t){return B(e)?U(Wb):{stdout:"\x1B[2J\x1B[H",stderr:"",exitCode:0}}},Hb={name:"clear",flags:[]}});var zl={};J(zl,{bashCommand:()=>jb,flagsForFuzzing:()=>Vb,shCommand:()=>Gb,shFlagsForFuzzing:()=>qb});async function hs(e,t,n,r){if(!r.exec)return{stdout:"",stderr:`bash: internal error: exec function not available
|
|
549
|
+
`,exitCode:1};let s=$r(r.exportedEnv||{},{0:t,"#":String(n.length),"@":n.join(" "),"*":n.join(" ")});n.forEach((a,l)=>{s[String(l+1)]=a});let i=e;if(i.startsWith("#!")){let a=i.indexOf(`
|
|
550
|
+
`);a!==-1&&(i=i.slice(a+1))}return await r.exec(i,{env:s,cwd:r.cwd,stdin:r.stdin,signal:r.signal})}var Rd,jb,Gb,Vb,qb,Hl=v(()=>{"use strict";Kn();ne();Rd={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},jb={name:"bash",async execute(e,t){if(B(e))return U(Rd);if(e[0]==="-c"&&e.length>=2){let s=e[1],i=e[2]||"bash",o=e.slice(3);return hs(s,i,o,t)}if(e.length===0)return t.stdin?.trim()?hs(t.stdin,"bash",[],t):{stdout:"",stderr:"",exitCode:0};let n=e[0],r=e.slice(1);try{let s=t.fs.resolvePath(t.cwd,n),i=await t.fs.readFile(s);return hs(i,n,r,t)}catch{return{stdout:"",stderr:`bash: ${n}: No such file or directory
|
|
551
|
+
`,exitCode:127}}}},Gb={name:"sh",async execute(e,t){if(B(e))return U({...Rd,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(e[0]==="-c"&&e.length>=2){let s=e[1],i=e[2]||"sh",o=e.slice(3);return hs(s,i,o,t)}if(e.length===0)return t.stdin?.trim()?hs(t.stdin,"sh",[],t):{stdout:"",stderr:"",exitCode:0};let n=e[0],r=e.slice(1);try{let s=t.fs.resolvePath(t.cwd,n),i=await t.fs.readFile(s);return hs(i,n,r,t)}catch{return{stdout:"",stderr:`sh: ${n}: No such file or directory
|
|
552
|
+
`,exitCode:127}}}};Vb={name:"bash",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"},qb={name:"sh",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"}});function jl(e,t,n,r,s,i,o,a,l,c){switch(t){case"sort":return Array.isArray(e)?[[...e].sort(o)]:[null];case"sort_by":return!Array.isArray(e)||n.length===0?[null]:[[...e].sort((f,p)=>{let h=s(f,n[0],r)[0],d=s(p,n[0],r)[0];return o(h,d)})];case"bsearch":{if(!Array.isArray(e)){let f=e===null?"null":typeof e=="object"?"object":typeof e;throw new Error(`${f} (${JSON.stringify(e)}) cannot be searched from`)}return n.length===0?[null]:s(e,n[0],r).map(f=>{let p=0,h=e.length;for(;p<h;){let d=p+h>>>1;o(e[d],f)<0?p=d+1:h=d}return p<e.length&&o(e[p],f)===0?p:-p-1})}case"unique_by":{if(!Array.isArray(e)||n.length===0)return[null];let u=new Map;for(let p of e){let h=s(p,n[0],r)[0],d=JSON.stringify(h);u.has(d)||u.set(d,{item:p,key:h})}let f=[...u.values()];return f.sort((p,h)=>o(p.key,h.key)),[f.map(p=>p.item)]}case"group_by":{if(!Array.isArray(e)||n.length===0)return[null];let u=new Map;for(let f of e){let p=JSON.stringify(s(f,n[0],r)[0]);u.has(p)||u.set(p,[]),u.get(p)?.push(f)}return[[...u.values()]]}case"max":return Array.isArray(e)&&e.length>0?[e.reduce((u,f)=>o(u,f)>0?u:f)]:[null];case"max_by":return!Array.isArray(e)||e.length===0||n.length===0?[null]:[e.reduce((u,f)=>{let p=s(u,n[0],r)[0],h=s(f,n[0],r)[0];return o(p,h)>0?u:f})];case"min":return Array.isArray(e)&&e.length>0?[e.reduce((u,f)=>o(u,f)<0?u:f)]:[null];case"min_by":return!Array.isArray(e)||e.length===0||n.length===0?[null]:[e.reduce((u,f)=>{let p=s(u,n[0],r)[0],h=s(f,n[0],r)[0];return o(p,h)<0?u:f})];case"add":{let u=f=>{let p=f.filter(h=>h!==null);return p.length===0?null:p.every(h=>typeof h=="number")?p.reduce((h,d)=>h+d,0):p.every(h=>typeof h=="string")?p.join(""):p.every(h=>Array.isArray(h))?p.flat():p.every(h=>h&&typeof h=="object"&&!Array.isArray(h))?$r(...p):null};if(n.length>=1){let f=s(e,n[0],r);return[u(f)]}return Array.isArray(e)?[u(e)]:[null]}case"any":{if(n.length>=2){try{let u=i(e,n[0],r);for(let f of u)if(s(f,n[1],r).some(a))return[!0]}catch(u){if(u instanceof c)throw u}return[!1]}return n.length===1?Array.isArray(e)?[e.some(u=>a(s(u,n[0],r)[0]))]:[!1]:Array.isArray(e)?[e.some(a)]:[!1]}case"all":{if(n.length>=2){try{let u=i(e,n[0],r);for(let f of u)if(!s(f,n[1],r).some(a))return[!1]}catch(u){if(u instanceof c)throw u}return[!0]}return n.length===1?Array.isArray(e)?[e.every(u=>a(s(u,n[0],r)[0]))]:[!0]:Array.isArray(e)?[e.every(a)]:[!0]}case"select":return n.length===0?[e]:s(e,n[0],r).some(a)?[e]:[];case"map":return n.length===0||!Array.isArray(e)?[null]:[e.flatMap(f=>s(f,n[0],r))];case"map_values":{if(n.length===0)return[null];if(Array.isArray(e))return[e.flatMap(u=>s(u,n[0],r))];if(e&&typeof e=="object"){let u=Object.create(null);for(let[f,p]of Object.entries(e)){if(!Te(f))continue;let h=s(p,n[0],r);h.length>0&&Ue(u,f,h[0])}return[u]}return[null]}case"has":{if(n.length===0)return[!1];let f=s(e,n[0],r)[0];return Array.isArray(e)&&typeof f=="number"?[f>=0&&f<e.length]:e&&typeof e=="object"&&typeof f=="string"?[_n(e,f)]:[!1]}case"in":{if(n.length===0)return[!1];let f=s(e,n[0],r)[0];return Array.isArray(f)&&typeof e=="number"?[e>=0&&e<f.length]:f&&typeof f=="object"&&typeof e=="string"?[_n(f,e)]:[!1]}case"contains":{if(n.length===0)return[!1];let u=s(e,n[0],r);return[l(e,u[0])]}case"inside":{if(n.length===0)return[!1];let u=s(e,n[0],r);return[l(u[0],e)]}default:return null}}var Td=v(()=>{"use strict";Kn();bn()});function Gl(e,t,n,r,s,i,o,a){switch(t){case"first":if(n.length>0)try{let l=i(e,n[0],r);return l.length>0?[l[0]]:[]}catch(l){if(l instanceof a)throw l;return[]}return Array.isArray(e)&&e.length>0?[e[0]]:[null];case"last":if(n.length>0){let l=s(e,n[0],r);return l.length>0?[l[l.length-1]]:[]}return Array.isArray(e)&&e.length>0?[e[e.length-1]]:[null];case"nth":{if(n.length<1)return[null];let l=s(e,n[0],r);if(n.length>1){for(let u of l)if(u<0)throw new Error("nth doesn't support negative indices");let c;try{c=i(e,n[1],r)}catch(u){if(u instanceof a)throw u;c=[]}return l.flatMap(u=>{let f=u;return f<c.length?[c[f]]:[]})}return Array.isArray(e)?l.flatMap(c=>{let u=c;if(u<0)throw new Error("nth doesn't support negative indices");return u<e.length?[e[u]]:[null]}):[null]}case"range":{if(n.length===0)return[];let l=Math.max(r.limits.maxIterations*100,1e6),c=d=>d.length>=l,u=s(e,n[0],r);if(n.length===1){let d=[];for(let m of u){let g=m;for(let y=0;y<g;y++)if(d.push(y),c(d))return d}return d}let f=s(e,n[1],r);if(n.length===2){let d=[];for(let m of u)for(let g of f){let y=m,w=g;for(let b=y;b<w;b++)if(d.push(b),c(d))return d}return d}let p=s(e,n[2],r),h=[];for(let d of u)for(let m of f)for(let g of p){let y=d,w=m,b=g;if(b!==0){if(b>0){for(let x=y;x<w;x+=b)if(h.push(x),c(h))return h}else for(let x=y;x>w;x+=b)if(h.push(x),c(h))return h}}return h}case"limit":return n.length<2?[]:s(e,n[0],r).flatMap(c=>{let u=c;if(u<0)throw new Error("limit doesn't support negative count");if(u===0)return[];let f;try{f=i(e,n[1],r)}catch(p){if(p instanceof a)throw p;f=[]}return f.slice(0,u)});case"isempty":{if(n.length<1)return[!0];try{return[i(e,n[0],r).length===0]}catch(l){if(l instanceof a)throw l;return[!0]}}case"isvalid":{if(n.length<1)return[!0];try{return[s(e,n[0],r).length>0]}catch(l){if(l instanceof a)throw l;return[!1]}}case"skip":return n.length<2?[]:s(e,n[0],r).flatMap(c=>{let u=c;if(u<0)throw new Error("skip doesn't support negative count");return s(e,n[1],r).slice(u)});case"until":{if(n.length<2)return[e];let l=e,c=r.limits.maxIterations;for(let u=0;u<c;u++){if(s(l,n[0],r).some(o))return[l];let p=s(l,n[1],r);if(p.length===0)return[l];l=p[0]}throw new a(`jq until: too many iterations (${c}), increase executionLimits.maxJqIterations`,"iterations")}case"while":{if(n.length<2)return[e];let l=[],c=e,u=r.limits.maxIterations;for(let f=0;f<u&&s(c,n[0],r).some(o);f++){l.push(c);let h=s(c,n[1],r);if(h.length===0)break;c=h[0]}if(l.length>=u)throw new a(`jq while: too many iterations (${u}), increase executionLimits.maxJqIterations`,"iterations");return l}case"repeat":{if(n.length===0)return[e];let l=[],c=e,u=r.limits.maxIterations;for(let f=0;f<u;f++){l.push(c);let p=s(c,n[0],r);if(p.length===0)break;c=p[0]}if(l.length>=u)throw new a(`jq repeat: too many iterations (${u}), increase executionLimits.maxJqIterations`,"iterations");return l}default:return null}}var Pd=v(()=>{"use strict"});function Vl(e,t,n,r,s){switch(t){case"now":return[Date.now()/1e3];case"gmtime":{if(typeof e!="number")return[null];let i=new Date(e*1e3),o=i.getUTCFullYear(),a=i.getUTCMonth(),l=i.getUTCDate(),c=i.getUTCHours(),u=i.getUTCMinutes(),f=i.getUTCSeconds(),p=i.getUTCDay(),h=Date.UTC(o,0,1),d=Math.floor((i.getTime()-h)/(1440*60*1e3));return[[o,a,l,c,u,f,p,d]]}case"mktime":{if(!Array.isArray(e))throw new Error("mktime requires parsed datetime inputs");let[i,o,a,l=0,c=0,u=0]=e;if(typeof i!="number"||typeof o!="number")throw new Error("mktime requires parsed datetime inputs");let f=Date.UTC(i,o,a??1,l??0,c??0,u??0);return[Math.floor(f/1e3)]}case"strftime":{if(n.length===0)return[null];let o=s(e,n[0],r)[0];if(typeof o!="string")throw new Error("strftime/1 requires a string format");let a;if(typeof e=="number")a=new Date(e*1e3);else if(Array.isArray(e)){let[p,h,d,m=0,g=0,y=0]=e;if(typeof p!="number"||typeof h!="number")throw new Error("strftime/1 requires parsed datetime inputs");a=new Date(Date.UTC(p,h,d??1,m??0,g??0,y??0))}else throw new Error("strftime/1 requires parsed datetime inputs");let l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"],u=(p,h=2)=>String(p).padStart(h,"0");return[o.replace(/%Y/g,String(a.getUTCFullYear())).replace(/%m/g,u(a.getUTCMonth()+1)).replace(/%d/g,u(a.getUTCDate())).replace(/%H/g,u(a.getUTCHours())).replace(/%M/g,u(a.getUTCMinutes())).replace(/%S/g,u(a.getUTCSeconds())).replace(/%A/g,l[a.getUTCDay()]).replace(/%B/g,c[a.getUTCMonth()]).replace(/%Z/g,"UTC").replace(/%%/g,"%")]}case"strptime":{if(n.length===0)return[null];if(typeof e!="string")throw new Error("strptime/1 requires a string input");let o=s(e,n[0],r)[0];if(typeof o!="string")throw new Error("strptime/1 requires a string format");if(o==="%Y-%m-%dT%H:%M:%SZ"){let l=e.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(l){let[,c,u,f,p,h,d]=l.map(Number),m=new Date(Date.UTC(c,u-1,f,p,h,d)),g=m.getUTCDay(),y=Date.UTC(c,0,1),w=Math.floor((m.getTime()-y)/(1440*60*1e3));return[[c,u-1,f,p,h,d,g,w]]}}let a=new Date(e);if(!Number.isNaN(a.getTime())){let l=a.getUTCFullYear(),c=a.getUTCMonth(),u=a.getUTCDate(),f=a.getUTCHours(),p=a.getUTCMinutes(),h=a.getUTCSeconds(),d=a.getUTCDay(),m=Date.UTC(l,0,1),g=Math.floor((a.getTime()-m)/(1440*60*1e3));return[[l,c,u,f,p,h,d,g]]}throw new Error(`Cannot parse date: ${e}`)}case"fromdate":{if(typeof e!="string")throw new Error("fromdate requires a string input");let i=new Date(e);if(Number.isNaN(i.getTime()))throw new Error(`date "${e}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(i.getTime()/1e3)]}case"todate":{if(typeof e!="number")throw new Error("todate requires a number input");return[new Date(e*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")]}default:return null}}var Dd=v(()=>{"use strict"});function pn(e){return e!==!1&&e!==null}function ds(e,t){return JSON.stringify(e)===JSON.stringify(t)}function si(e,t){return typeof e=="number"&&typeof t=="number"?e-t:typeof e=="string"&&typeof t=="string"?e.localeCompare(t):0}function ql(e,t){let n=mt(e);for(let r of Object.keys(t)){if(!Te(r))continue;let s=_n(n,r)?ze(n[r]):null,i=ze(t[r]);s&&i?Ue(n,r,ql(s,i)):Ue(n,r,t[r])}return n}function ms(e,t=3e3){let n=0,r=e;for(;n<t;)if(Array.isArray(r)){if(r.length===0)return n+1;r=r[0],n++}else if(r!==null&&typeof r=="object"){let s=Object.keys(r);if(s.length===0)return n+1;r=r[s[0]],n++}else return n;return n}function lo(e,t){let n=a=>a===null?0:typeof a=="boolean"?1:typeof a=="number"?2:typeof a=="string"?3:Array.isArray(a)?4:typeof a=="object"?5:6,r=n(e),s=n(t);if(r!==s)return r-s;if(typeof e=="number"&&typeof t=="number")return e-t;if(typeof e=="string"&&typeof t=="string")return e.localeCompare(t);if(typeof e=="boolean"&&typeof t=="boolean")return(e?1:0)-(t?1:0);if(Array.isArray(e)&&Array.isArray(t)){for(let a=0;a<Math.min(e.length,t.length);a++){let l=lo(e[a],t[a]);if(l!==0)return l}return e.length-t.length}let i=ze(e),o=ze(t);if(i&&o){let a=Object.keys(i).sort(),l=Object.keys(o).sort();for(let c=0;c<Math.min(a.length,l.length);c++){let u=a[c].localeCompare(l[c]);if(u!==0)return u}if(a.length!==l.length)return a.length-l.length;for(let c of a){let u=lo(i[c],o[c]);if(u!==0)return u}}return 0}function co(e,t){if(ds(e,t))return!0;if(typeof e=="string"&&typeof t=="string")return e.includes(t);if(Array.isArray(e)&&Array.isArray(t))return t.every(s=>e.some(i=>co(i,s)));let n=ze(e),r=ze(t);return n&&r?Object.keys(r).every(s=>_n(n,s)&&co(n[s],r[s])):!1}var uo=v(()=>{"use strict";bn()});function Zl(e,t,n){switch(t){case"@base64":return typeof e=="string"?typeof Buffer<"u"?[Buffer.from(e,"utf-8").toString("base64")]:[btoa(e)]:[null];case"@base64d":return typeof e=="string"?typeof Buffer<"u"?[Buffer.from(e,"base64").toString("utf-8")]:[atob(e)]:[null];case"@uri":return typeof e=="string"?[encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")]:[null];case"@urid":return typeof e=="string"?[decodeURIComponent(e)]:[null];case"@csv":return Array.isArray(e)?[e.map(s=>{if(s===null)return"";if(typeof s=="boolean")return s?"true":"false";if(typeof s=="number")return String(s);let i=String(s);return i.includes(",")||i.includes('"')||i.includes(`
|
|
553
|
+
`)||i.includes("\r")?`"${i.replace(/"/g,'""')}"`:i}).join(",")]:[null];case"@tsv":return Array.isArray(e)?[e.map(r=>String(r??"").replace(/\t/g,"\\t").replace(/\n/g,"\\n")).join(" ")]:[null];case"@json":{let r=n??Zb;return ms(e,r+1)>r?[null]:[JSON.stringify(e)]}case"@html":return typeof e=="string"?[e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")]:[null];case"@sh":return typeof e=="string"?[`'${e.replace(/'/g,"'\\''")}'`]:[null];case"@text":return typeof e=="string"?[e]:e==null?[""]:[String(e)];default:return null}}var Zb,_d=v(()=>{"use strict";uo();Zb=2e3});function Kl(e,t,n,r,s,i){switch(t){case"index":return n.length===0?[null]:s(e,n[0],r).map(a=>{if(typeof e=="string"&&typeof a=="string"){if(a===""&&e==="")return null;let l=e.indexOf(a);return l>=0?l:null}if(Array.isArray(e)){if(Array.isArray(a)){for(let c=0;c<=e.length-a.length;c++){let u=!0;for(let f=0;f<a.length;f++)if(!i(e[c+f],a[f])){u=!1;break}if(u)return c}return null}let l=e.findIndex(c=>i(c,a));return l>=0?l:null}return null});case"rindex":return n.length===0?[null]:s(e,n[0],r).map(a=>{if(typeof e=="string"&&typeof a=="string"){let l=e.lastIndexOf(a);return l>=0?l:null}if(Array.isArray(e)){if(Array.isArray(a)){for(let l=e.length-a.length;l>=0;l--){let c=!0;for(let u=0;u<a.length;u++)if(!i(e[l+u],a[u])){c=!1;break}if(c)return l}return null}for(let l=e.length-1;l>=0;l--)if(i(e[l],a))return l;return null}return null});case"indices":return n.length===0?[[]]:s(e,n[0],r).map(a=>{let l=[];if(typeof e=="string"&&typeof a=="string"){let c=e.indexOf(a);for(;c!==-1;)l.push(c),c=e.indexOf(a,c+1)}else if(Array.isArray(e))if(Array.isArray(a)){let c=a.length;if(c===0)for(let u=0;u<=e.length;u++)l.push(u);else for(let u=0;u<=e.length-c;u++){let f=!0;for(let p=0;p<c;p++)if(!i(e[u+p],a[p])){f=!1;break}f&&l.push(u)}}else for(let c=0;c<e.length;c++)i(e[c],a)&&l.push(c);return l});default:return null}}var Fd=v(()=>{"use strict"});function Ql(e,t,n,r,s){switch(t){case"fabs":case"abs":return typeof e=="number"?[Math.abs(e)]:typeof e=="string"?[e]:[null];case"exp10":return typeof e=="number"?[10**e]:[null];case"exp2":return typeof e=="number"?[2**e]:[null];case"pow":{if(n.length<2)return[null];let i=s(e,n[0],r),o=s(e,n[1],r),a=i[0],l=o[0];return typeof a!="number"||typeof l!="number"?[null]:[a**l]}case"atan2":{if(n.length<2)return[null];let i=s(e,n[0],r),o=s(e,n[1],r),a=i[0],l=o[0];return typeof a!="number"||typeof l!="number"?[null]:[Math.atan2(a,l)]}case"hypot":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[Math.hypot(e,i)]}case"fma":{if(typeof e!="number"||n.length<2)return[null];let i=s(e,n[0],r)[0],o=s(e,n[1],r)[0];return[e*i+o]}case"copysign":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[Math.sign(i)*Math.abs(e)]}case"drem":case"remainder":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[e-Math.round(e/i)*i]}case"fdim":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[Math.max(0,e-i)]}case"fmax":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[Math.max(e,i)]}case"fmin":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[Math.min(e,i)]}case"ldexp":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[e*2**i]}case"scalbn":case"scalbln":{if(typeof e!="number"||n.length===0)return[null];let i=s(e,n[0],r)[0];return[e*2**i]}case"nearbyint":return typeof e=="number"?[Math.round(e)]:[null];case"logb":return typeof e=="number"?[Math.floor(Math.log2(Math.abs(e)))]:[null];case"significand":if(typeof e=="number"){let i=Math.floor(Math.log2(Math.abs(e)));return[e/2**i]}return[null];case"frexp":if(typeof e=="number"){if(e===0)return[[0,0]];let i=Math.floor(Math.log2(Math.abs(e)))+1;return[[e/2**i,i]]}return[null];case"modf":if(typeof e=="number"){let i=Math.trunc(e);return[[e-i,i]]}return[null];default:return null}}var Ld=v(()=>{"use strict"});function Xl(e,t,n,r,s,i,o,a){switch(t){case"recurse":{if(n.length===0){let h=[],d=m=>{if(h.push(m),Array.isArray(m))for(let g of m)d(g);else if(m&&typeof m=="object")for(let g of Object.keys(m))d(m[g])};return d(e),h}let l=[],c=n.length>=2?n[1]:null,u=1e4,f=0,p=h=>{if(f++>u||c&&!s(h,c,r).some(i))return;l.push(h);let d=s(h,n[0],r);for(let m of d)m!=null&&p(m)};return p(e),l}case"recurse_down":return a(e,"recurse",n,r);case"walk":{if(n.length===0)return[e];let l=new WeakSet,c=u=>{if(u&&typeof u=="object"){if(l.has(u))return u;l.add(u)}let f;if(Array.isArray(u))f=u.map(c);else if(u&&typeof u=="object"){let h=Object.create(null);for(let[d,m]of Object.entries(u))Te(d)&&Ue(h,d,c(m));f=h}else f=u;return s(f,n[0],r)[0]};return[c(e)]}case"transpose":{if(!Array.isArray(e))return[null];if(e.length===0)return[[]];let l=Math.max(...e.map(u=>Array.isArray(u)?u.length:0)),c=[];for(let u=0;u<l;u++)c.push(e.map(f=>Array.isArray(f)?f[u]:null));return[c]}case"combinations":{if(n.length>0){let f=s(e,n[0],r)[0];if(!Array.isArray(e)||f<0)return[];if(f===0)return[[]];let p=[],h=(d,m)=>{if(m===f){p.push([...d]);return}for(let g of e)d.push(g),h(d,m+1),d.pop()};return h([],0),p}if(!Array.isArray(e))return[];if(e.length===0)return[[]];for(let u of e)if(!Array.isArray(u))return[];let l=[],c=(u,f)=>{if(u===e.length){l.push([...f]);return}let p=e[u];for(let h of p)f.push(h),c(u+1,f),f.pop()};return c(0,[]),l}case"parent":{if(r.root===void 0||r.currentPath===void 0)return[];let l=r.currentPath;if(l.length===0)return[];let c=n.length>0?s(e,n[0],r)[0]:1;if(c>=0){if(c>l.length)return[];let u=l.slice(0,l.length-c);return[o(r.root,u)]}else{let u=-c-1;if(u>=l.length)return[e];let f=l.slice(0,u);return[o(r.root,f)]}}case"parents":{if(r.root===void 0||r.currentPath===void 0)return[[]];let l=r.currentPath,c=[];for(let u=l.length-1;u>=0;u--)c.push(o(r.root,l.slice(0,u)));return[c]}case"root":return r.root!==void 0?[r.root]:[];default:return null}}var Md=v(()=>{"use strict";bn()});function Yl(e,t,n,r,s){switch(t){case"keys":return Array.isArray(e)?[e.map((i,o)=>o)]:e&&typeof e=="object"?[Object.keys(e).sort()]:[null];case"keys_unsorted":return Array.isArray(e)?[e.map((i,o)=>o)]:e&&typeof e=="object"?[Object.keys(e)]:[null];case"length":return typeof e=="string"?[e.length]:Array.isArray(e)?[e.length]:e&&typeof e=="object"?[Object.keys(e).length]:e===null?[0]:typeof e=="number"?[Math.abs(e)]:[null];case"utf8bytelength":{if(typeof e=="string")return[new TextEncoder().encode(e).length];let i=e===null?"null":Array.isArray(e)?"array":typeof e,o=i==="array"||i==="object"?JSON.stringify(e):String(e);throw new Error(`${i} (${o}) only strings have UTF-8 byte length`)}case"to_entries":{let i=ze(e);return i?[Object.entries(i).map(([o,a])=>({key:o,value:a}))]:[null]}case"from_entries":if(Array.isArray(e)){let i=Object.create(null);for(let o of e){let a=ze(o);if(a){let l=a.key??a.Key??a.name??a.Name??a.k,c=a.value??a.Value??a.v;if(l!==void 0){let u=String(l);Te(u)&&Ue(i,u,c)}}}return[i]}return[null];case"with_entries":{if(n.length===0)return[e];let i=ze(e);if(i){let a=Object.entries(i).map(([c,u])=>({key:c,value:u})).flatMap(c=>s(c,n[0],r)),l=Object.create(null);for(let c of a){let u=ze(c);if(u){let f=u.key??u.name??u.k,p=u.value??u.v;if(f!==void 0){let h=String(f);Te(h)&&Ue(l,h,p)}}}return[l]}return[null]}case"reverse":return Array.isArray(e)?[[...e].reverse()]:typeof e=="string"?[e.split("").reverse().join("")]:[null];case"flatten":return Array.isArray(e)?(n.length>0?s(e,n[0],r):[Number.POSITIVE_INFINITY]).map(o=>{let a=o;if(a<0)throw new Error("flatten depth must not be negative");return e.flat(a)}):[null];case"unique":if(Array.isArray(e)){let i=new Set,o=[];for(let a of e){let l=JSON.stringify(a);i.has(l)||(i.add(l),o.push(a))}return[o]}return[null];case"tojson":case"tojsonstream":{let i=r.limits.maxDepth??Kb;return ms(e,i+1)>i?[null]:[JSON.stringify(e)]}case"fromjson":{if(typeof e=="string"){let i=e.trim().toLowerCase();if(i==="nan")return[Number.NaN];if(i==="inf"||i==="infinity")return[Number.POSITIVE_INFINITY];if(i==="-inf"||i==="-infinity")return[Number.NEGATIVE_INFINITY];try{return[os(JSON.parse(e))]}catch{throw new Error(`Invalid JSON: ${e}`)}}return[e]}case"tostring":return typeof e=="string"?[e]:[JSON.stringify(e)];case"tonumber":if(typeof e=="number")return[e];if(typeof e=="string"){let i=Number(e);if(Number.isNaN(i))throw new Error(`${JSON.stringify(e)} cannot be parsed as a number`);return[i]}throw new Error(`${typeof e} cannot be parsed as a number`);case"toboolean":{if(typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="true")return[!0];if(e==="false")return[!1];throw new Error(`string (${JSON.stringify(e)}) cannot be parsed as a boolean`)}let i=e===null?"null":Array.isArray(e)?"array":typeof e,o=i==="array"||i==="object"?JSON.stringify(e):String(e);throw new Error(`${i} (${o}) cannot be parsed as a boolean`)}case"tostream":{let i=[],o=(a,l)=>{if(a===null||typeof a!="object")i.push([l,a]);else if(Array.isArray(a))if(a.length===0)i.push([l,[]]);else for(let c=0;c<a.length;c++)o(a[c],[...l,c]);else{let c=Object.keys(a);if(c.length===0)i.push([l,Object.create(null)]);else for(let u of c)o(a[u],[...l,u])}};return o(e,[]),i.push([[]]),i}case"fromstream":{if(n.length===0)return[e];let i=s(e,n[0],r),o=null;for(let a of i){if(!Array.isArray(a)||a.length===1&&Array.isArray(a[0])&&a[0].length===0||a.length!==2)continue;let[l,c]=a;if(!Array.isArray(l))continue;if(l.length===0){o=c;continue}o===null&&(o=typeof l[0]=="number"?[]:Object.create(null));let u=o;for(let p=0;p<l.length-1;p++){let h=l[p],d=l[p+1];if(Array.isArray(u)&&typeof h=="number"){for(;u.length<=h;)u.push(null);u[h]===null&&(u[h]=typeof d=="number"?[]:Object.create(null)),u=u[h]}else{let m=ze(u);if(m){let g=String(h);if(!Te(g))continue;(m[g]===null||m[g]===void 0)&&Ue(m,g,typeof d=="number"?[]:Object.create(null)),u=m[g]}}}let f=l[l.length-1];if(Array.isArray(u)&&typeof f=="number"){for(;u.length<=f;)u.push(null);u[f]=c}else{let p=ze(u);if(p){let h=String(f);Te(h)&&Ue(p,h,c)}}}return[o]}case"truncate_stream":{let i=typeof e=="number"?Math.floor(e):0;if(n.length===0)return[];let o=[],a=s(e,n[0],r);for(let l of a)if(Array.isArray(l)){if(l.length===1&&Array.isArray(l[0])){let c=l[0];c.length>i&&o.push([c.slice(i)]);continue}if(l.length===2&&Array.isArray(l[0])){let c=l[0],u=l[1];c.length>i&&o.push([c.slice(i),u])}}return o}default:return null}}var Kb,Ud=v(()=>{"use strict";bn();uo();Kb=2e3});function Jl(e,t,n,r,s,i,o,a,l,c){switch(t){case"getpath":{if(n.length===0)return[null];let u=s(e,n[0],r),f=[];for(let p of u){let h=p,d=e;for(let m of h){if(d==null){d=null;break}if(Array.isArray(d)&&typeof m=="number")d=d[m];else if(typeof m=="string"){let g=ze(d);if(!g||!Object.hasOwn(g,m)){d=null;break}d=g[m]}else{d=null;break}}f.push(d)}return f}case"setpath":{if(n.length<2)return[null];let f=s(e,n[0],r)[0],h=s(e,n[1],r)[0];return[o(e,f,h)]}case"delpaths":{if(n.length===0)return[e];let f=s(e,n[0],r)[0],p=e;for(let h of f.sort((d,m)=>m.length-d.length))p=a(p,h);return[p]}case"path":{if(n.length===0)return[[]];let u=[];return c(e,n[0],r,[],u),u}case"del":return n.length===0?[e]:[l(e,n[0],r)];case"pick":{if(n.length===0)return[null];let u=[];for(let p of n)c(e,p,r,[],u);let f=null;for(let p of u){for(let d of p)if(typeof d=="number"&&d<0)throw new Error("Out of bounds negative array index");let h=e;for(let d of p){if(h==null)break;if(Array.isArray(h)&&typeof d=="number")h=h[d];else if(typeof d=="string"){let m=ze(h);if(!m||!Object.hasOwn(m,d)){h=null;break}h=m[d]}else{h=null;break}}f=o(f,p,h)}return[f]}case"paths":{let u=[],f=(p,h)=>{if(p&&typeof p=="object")if(Array.isArray(p))for(let d=0;d<p.length;d++)u.push([...h,d]),f(p[d],[...h,d]);else for(let d of Object.keys(p))u.push([...h,d]),f(p[d],[...h,d])};return f(e,[]),n.length>0?u.filter(p=>{let h=e;for(let m of p)if(Array.isArray(h)&&typeof m=="number")h=h[m];else if(typeof m=="string"){let g=ze(h);if(!g||!Object.hasOwn(g,m))return!1;h=g[m]}else return!1;return s(h,n[0],r).some(i)}):u}case"leaf_paths":{let u=[],f=(p,h)=>{if(p===null||typeof p!="object")u.push(h);else if(Array.isArray(p))for(let d=0;d<p.length;d++)f(p[d],[...h,d]);else for(let d of Object.keys(p))f(p[d],[...h,d])};return f(e,[]),u}default:return null}}var Bd=v(()=>{"use strict";bn()});function ec(e,t,n,r,s,i){switch(t){case"IN":{if(n.length===0)return[!1];if(n.length===1){let c=s(e,n[0],r);for(let u of c)if(i(e,u))return[!0];return[!1]}let o=s(e,n[0],r),a=s(e,n[1],r),l=new Set(a.map(c=>JSON.stringify(c)));for(let c of o)if(l.has(JSON.stringify(c)))return[!0];return[!1]}case"INDEX":{if(n.length===0)return[Object.create(null)];if(n.length===1){let l=s(e,n[0],r),c=Object.create(null);for(let u of l){let f=String(u);Te(f)&&Ue(c,f,u)}return[c]}if(n.length===2){let l=s(e,n[0],r),c=Object.create(null);for(let u of l){let f=s(u,n[1],r);if(f.length>0){let p=String(f[0]);Te(p)&&Ue(c,p,u)}}return[c]}let o=s(e,n[0],r),a=Object.create(null);for(let l of o){let c=s(l,n[1],r),u=s(l,n[2],r);if(c.length>0&&u.length>0){let f=String(c[0]);Te(f)&&Ue(a,f,u[0])}}return[a]}case"JOIN":{if(n.length<2)return[null];let o=ze(s(e,n[0],r)[0]);if(!o)return[null];if(!Array.isArray(e))return[null];let a=[];for(let l of e){let c=s(l,n[1],r),u=c.length>0?String(c[0]):"",f=_n(o,u)?o[u]:null;a.push([l,f])}return[a]}default:return null}}var Wd=v(()=>{"use strict";bn()});function tc(e,t,n,r,s){switch(t){case"join":{if(!Array.isArray(e))return[null];let i=n.length>0?s(e,n[0],r):[""];for(let o of e)if(Array.isArray(o)||o!==null&&typeof o=="object")throw new Error("cannot join: contains arrays or objects");return i.map(o=>e.map(a=>a===null?"":typeof a=="string"?a:String(a)).join(String(o)))}case"split":{if(typeof e!="string"||n.length===0)return[null];let i=s(e,n[0],r),o=String(i[0]);return[e.split(o)]}case"splits":{if(typeof e!="string"||n.length===0)return[];let i=s(e,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(e,n[1],r)[0]):"g";return K(o,a.includes("g")?a:`${a}g`).split(e)}catch{return[]}}case"scan":{if(typeof e!="string"||n.length===0)return[];let i=s(e,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(e,n[1],r)[0]):"";return[...K(o,a.includes("g")?a:`${a}g`).matchAll(e)].map(u=>u.length>1?u.slice(1):u[0])}catch{return[]}}case"test":{if(typeof e!="string"||n.length===0)return[!1];let i=s(e,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(e,n[1],r)[0]):"";return[K(o,a).test(e)]}catch{return[!1]}}case"match":{if(typeof e!="string"||n.length===0)return[null];let i=s(e,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(e,n[1],r)[0]):"",c=K(o,`${a}d`).exec(e);if(!c)return[];let u=c.indices;return[{offset:c.index,length:c[0].length,string:c[0],captures:c.slice(1).map((f,p)=>({offset:u?.[p+1]?.[0]??null,length:f?.length??0,string:f??"",name:null}))}]}catch{return[null]}}case"capture":{if(typeof e!="string"||n.length===0)return[null];let i=s(e,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(e,n[1],r)[0]):"",c=K(o,a).match(e);return!c||!c.groups?[Object.create(null)]:[c.groups]}catch{return[null]}}case"sub":{if(typeof e!="string"||n.length<2)return[null];let i=s(e,n[0],r),o=s(e,n[1],r),a=String(i[0]),l=String(o[0]);try{let c=n.length>2?String(s(e,n[2],r)[0]):"";return[K(a,c).replace(e,l)]}catch{return[e]}}case"gsub":{if(typeof e!="string"||n.length<2)return[null];let i=s(e,n[0],r),o=s(e,n[1],r),a=String(i[0]),l=String(o[0]);try{let c=n.length>2?String(s(e,n[2],r)[0]):"g",u=c.includes("g")?c:`${c}g`;return[K(a,u).replace(e,l)]}catch{return[e]}}case"ascii_downcase":return typeof e=="string"?[e.replace(/[A-Z]/g,i=>String.fromCharCode(i.charCodeAt(0)+32))]:[null];case"ascii_upcase":return typeof e=="string"?[e.replace(/[a-z]/g,i=>String.fromCharCode(i.charCodeAt(0)-32))]:[null];case"ltrimstr":{if(typeof e!="string"||n.length===0)return[e];let i=s(e,n[0],r),o=String(i[0]);return[e.startsWith(o)?e.slice(o.length):e]}case"rtrimstr":{if(typeof e!="string"||n.length===0)return[e];let i=s(e,n[0],r),o=String(i[0]);return o===""?[e]:[e.endsWith(o)?e.slice(0,-o.length):e]}case"trimstr":{if(typeof e!="string"||n.length===0)return[e];let i=s(e,n[0],r),o=String(i[0]);if(o==="")return[e];let a=e;return a.startsWith(o)&&(a=a.slice(o.length)),a.endsWith(o)&&(a=a.slice(0,-o.length)),[a]}case"trim":if(typeof e=="string")return[e.trim()];throw new Error("trim input must be a string");case"ltrim":if(typeof e=="string")return[e.trimStart()];throw new Error("trim input must be a string");case"rtrim":if(typeof e=="string")return[e.trimEnd()];throw new Error("trim input must be a string");case"startswith":{if(typeof e!="string"||n.length===0)return[!1];let i=s(e,n[0],r);return[e.startsWith(String(i[0]))]}case"endswith":{if(typeof e!="string"||n.length===0)return[!1];let i=s(e,n[0],r);return[e.endsWith(String(i[0]))]}case"ascii":return typeof e=="string"&&e.length>0?[e.charCodeAt(0)]:[null];case"explode":return typeof e=="string"?[Array.from(e).map(i=>i.codePointAt(0))]:[null];case"implode":if(!Array.isArray(e))throw new Error("implode input must be an array");return[e.map(a=>{if(typeof a=="string")throw new Error(`string (${JSON.stringify(a)}) can't be imploded, unicode codepoint needs to be numeric`);if(typeof a!="number"||Number.isNaN(a))throw new Error("number (null) can't be imploded, unicode codepoint needs to be numeric");let l=Math.trunc(a);return l<0||l>1114111||l>=55296&&l<=57343?String.fromCodePoint(65533):String.fromCodePoint(l)}).join("")];default:return null}}var zd=v(()=>{"use strict";Ve()});function nc(e,t){switch(t){case"type":return e===null?["null"]:Array.isArray(e)?["array"]:typeof e=="boolean"?["boolean"]:typeof e=="number"?["number"]:typeof e=="string"?["string"]:typeof e=="object"?["object"]:["null"];case"infinite":return[Number.POSITIVE_INFINITY];case"nan":return[Number.NaN];case"isinfinite":return[typeof e=="number"&&!Number.isFinite(e)];case"isnan":return[typeof e=="number"&&Number.isNaN(e)];case"isnormal":return[typeof e=="number"&&Number.isFinite(e)&&e!==0];case"isfinite":return[typeof e=="number"&&Number.isFinite(e)];case"numbers":return typeof e=="number"?[e]:[];case"strings":return typeof e=="string"?[e]:[];case"booleans":return typeof e=="boolean"?[e]:[];case"nulls":return e===null?[e]:[];case"arrays":return Array.isArray(e)?[e]:[];case"objects":return e&&typeof e=="object"&&!Array.isArray(e)?[e]:[];case"iterables":return Array.isArray(e)||e&&typeof e=="object"&&!Array.isArray(e)?[e]:[];case"scalars":return!Array.isArray(e)&&!(e&&typeof e=="object")?[e]:[];case"values":return e===null?[]:[e];case"not":return e===!1||e===null?[!0]:[!1];case"null":return[null];case"true":return[!0];case"false":return[!1];case"empty":return[];default:return null}}var Hd=v(()=>{"use strict"});var jd=v(()=>{"use strict";Td();Pd();Dd();_d();Fd();Ld();Md();Ud();Bd();Wd();zd();Hd()});function fo(e,t,n){if(t.length===0)return n;let[r,...s]=t;if(typeof r=="number"){if(e&&typeof e=="object"&&!Array.isArray(e))throw new Error("Cannot index object with number");if(r>536870911)throw new Error("Array index too large");if(r<0)throw new Error("Out of bounds negative array index");let c=Array.isArray(e)?[...e]:[];for(;c.length<=r;)c.push(null);return c[r]=fo(c[r],s,n),c}if(Array.isArray(e))throw new Error("Cannot index array with string");if(!Te(r))return e??Object.create(null);let i=ze(e),o=i?mt(i):Object.create(null),a=Object.hasOwn(o,r)?o[r]:void 0;return Ue(o,r,fo(a,s,n)),o}function po(e,t){if(t.length===0)return null;if(t.length===1){let s=t[0];if(Array.isArray(e)&&typeof s=="number"){let i=[...e];return i.splice(s,1),i}if(e&&typeof e=="object"&&!Array.isArray(e)){let i=String(s);if(!Te(i))return e;let o=mt(e);return delete o[i],o}return e}let[n,...r]=t;if(Array.isArray(e)&&typeof n=="number"){let s=[...e];return s[n]=po(s[n],r),s}if(e&&typeof e=="object"&&!Array.isArray(e)){let s=String(n);if(!Te(s))return e;let i=mt(e);return Object.hasOwn(i,s)&&Ue(i,s,po(i[s],r)),i}return e}var Gd=v(()=>{"use strict";bn()});function Yb(e){return{vars:new Map,limits:{maxIterations:e?.limits?.maxIterations??Qb,maxDepth:e?.limits?.maxDepth??Zd},env:e?.env,coverage:e?.coverage,requireDefenseContext:e?.requireDefenseContext,defenseContextChecked:!1}}function go(e,t,n){let r=new Map(e.vars);return r.set(t,n),{vars:r,limits:e.limits,env:e.env,requireDefenseContext:e.requireDefenseContext,defenseContextChecked:e.defenseContextChecked,root:e.root,currentPath:e.currentPath,funcs:e.funcs,labels:e.labels,coverage:e.coverage}}function ii(e,t,n){switch(t.type){case"var":return go(e,t.name,n);case"array":{if(!Array.isArray(n))return null;let r=e;for(let s=0;s<t.elements.length;s++){let i=t.elements[s],o=s<n.length?n[s]:null,a=ii(r,i,o);if(a===null)return null;r=a}return r}case"object":{let r=ze(n);if(!r)return null;let s=e;for(let i of t.fields){let o;if(typeof i.key=="string")o=i.key;else{let c=V(n,i.key,e);if(c.length===0)return null;o=String(c[0])}let a=_n(r,o)?r[o]:null;i.keyVar&&(s=go(s,i.keyVar,a));let l=ii(s,i.pattern,a);if(l===null)return null;s=l}return s}}}function Jb(e,t){let n=e;for(let r of t)if(n&&typeof n=="object")if(Array.isArray(n))if(typeof r=="number")n=n[r];else return;else{let s=ze(n);if(s&&typeof r=="string"&&Object.hasOwn(s,r))n=s[r];else return}else return;return n}function ar(e){if(e.type==="Identity")return[];if(e.type==="Field"){let t=e.base?ar(e.base):[];return t===null?null:[...t,e.name]}if(e.type==="Index"&&e.index.type==="Literal"){let t=e.base?ar(e.base):[];if(t===null)return null;let n=e.index.value;return typeof n=="number"||typeof n=="string"?[...t,n]:null}if(e.type==="Pipe"){let t=ar(e.left);return t===null?null:rc(t,e.right)}if(e.type==="Call"){if(e.name==="parent"||e.name==="root")return null;if(e.name==="first"&&e.args.length===0)return[0];if(e.name==="last"&&e.args.length===0)return[-1]}return null}function rc(e,t){if(t.type==="Call"){if(t.name==="parent"){let n=1;if(t.args.length>0&&t.args[0].type==="Literal"){let r=t.args[0].value;typeof r=="number"&&(n=r)}if(n>=0)return e.slice(0,Math.max(0,e.length-n));{let r=-n-1;return e.slice(0,Math.min(r,e.length))}}if(t.name==="root")return[]}if(t.type==="Field"){let n=ar(t);if(n!==null)return[...e,...n]}if(t.type==="Index"&&t.index.type==="Literal"){let n=ar(t);if(n!==null)return[...e,...n]}if(t.type==="Pipe"){let n=rc(e,t.left);return n===null?null:rc(n,t.right)}return t.type==="Identity"?e:null}function Vd(e,t,n){if(t.type==="Comma"){let r=[];try{r.push(...V(e,t.left,n))}catch(s){if(s instanceof Q)throw s;if(r.length>0)return r;throw new Error("evaluation failed")}try{r.push(...V(e,t.right,n))}catch(s){if(s instanceof Q)throw s;return r}return r}return V(e,t,n)}function V(e,t,n){let r=n&&"vars"in n?n:Yb(n);switch(r.defenseContextChecked||(rt(r.requireDefenseContext,"query-engine","evaluation"),r={...r,defenseContextChecked:!0}),r.root===void 0&&(r={...r,root:e,currentPath:[]}),r.coverage?.hit(`jq:node:${t.type}`),t.type){case"Identity":return[e];case"Field":return(t.base?V(e,t.base,r):[e]).flatMap(i=>{let o=ze(i);if(o){if(!Object.hasOwn(o,t.name))return[null];let l=o[t.name];return[l===void 0?null:l]}if(i===null)return[null];let a=Array.isArray(i)?"array":typeof i;throw new Error(`Cannot index ${a} with string "${t.name}"`)});case"Index":return(t.base?V(e,t.base,r):[e]).flatMap(i=>V(i,t.index,r).flatMap(a=>{if(typeof a=="number"&&Array.isArray(i)){if(Number.isNaN(a))return[null];let l=Math.trunc(a),c=l<0?i.length+l:l;return c>=0&&c<i.length?[i[c]]:[null]}if(typeof a=="string"){let l=ze(i);return!l||!Object.hasOwn(l,a)?[null]:[l[a]]}return[null]}));case"Slice":return(t.base?V(e,t.base,r):[e]).flatMap(i=>{if(i===null)return[null];if(!Array.isArray(i)&&typeof i!="string")throw new Error(`Cannot slice ${typeof i} (${JSON.stringify(i)})`);let o=i.length,a=t.start?V(e,t.start,r):[0],l=t.end?V(e,t.end,r):[o];return a.flatMap(c=>l.map(u=>{let f=c,p=u,h=Number.isNaN(f)?0:Number.isInteger(f)?f:Math.floor(f),d=Number.isNaN(p)?o:Number.isInteger(p)?p:Math.ceil(p),m=qd(h,o),g=qd(d,o);return Array.isArray(i),i.slice(m,g)}))});case"Iterate":return(t.base?V(e,t.base,r):[e]).flatMap(i=>Array.isArray(i)?i:i&&typeof i=="object"?Object.values(i):[]);case"Pipe":{let s=V(e,t.left,r),i=ar(t.left),o=[];for(let a of s)try{if(i!==null){let l={...r,currentPath:[...r.currentPath??[],...i]};o.push(...V(a,t.right,l))}else o.push(...V(a,t.right,r))}catch(l){throw l instanceof gs?l.withPrependedResults(o):l}return o}case"Comma":{let s=V(e,t.left,r),i=V(e,t.right,r);return[...s,...i]}case"Literal":return[t.value];case"Array":return t.elements?[V(e,t.elements,r)]:[[]];case"Object":{let s=[Object.create(null)];for(let i of t.entries){let o=typeof i.key=="string"?[i.key]:V(e,i.key,r),a=V(e,i.value,r),l=[];for(let c of s)for(let u of o){if(typeof u!="string"){let f=u===null?"null":Array.isArray(u)?"array":typeof u;throw new Error(`Cannot use ${f} (${JSON.stringify(u)}) as object key`)}if(!Te(u)){for(let f of a)l.push(mt(c));continue}for(let f of a){let p=mt(c);Ue(p,u,f),l.push(p)}}s.length=0,s.push(...l)}return s}case"Paren":return V(e,t.expr,r);case"BinaryOp":return n5(e,t.op,t.left,t.right,r);case"UnaryOp":return V(e,t.operand,r).map(i=>{if(t.op==="-"){if(typeof i=="number")return-i;if(typeof i=="string"){let o=a=>a.length>5?`"${a.slice(0,3)}...`:JSON.stringify(a);throw new Error(`string (${o(i)}) cannot be negated`)}return null}return t.op==="not"?!pn(i):null});case"Cond":return V(e,t.cond,r).flatMap(i=>{if(pn(i))return V(e,t.then,r);for(let o of t.elifs)if(V(e,o.cond,r).some(pn))return V(e,o.then,r);return t.else?V(e,t.else,r):[e]});case"Try":try{return V(e,t.body,r)}catch(s){if(t.catch){let i=s instanceof mo?s.value:s instanceof Error?s.message:String(s);return V(i,t.catch,r)}return[]}case"Call":return Kd(e,t.name,t.args,r);case"VarBind":return V(e,t.value,r).flatMap(i=>{let o=null,a=[];t.pattern?a.push(t.pattern):t.name&&a.push({type:"var",name:t.name}),t.alternatives&&a.push(...t.alternatives);for(let l of a)if(o=ii(r,l,i),o!==null)break;return o===null?[]:V(e,t.body,o)});case"VarRef":{if(t.name==="$ENV")return[r.env?Et(r.env):Object.create(null)];let s=r.vars.get(t.name);return s!==void 0?[s]:[null]}case"Recurse":{let s=[],i=new WeakSet,o=a=>{if(a&&typeof a=="object"){if(i.has(a))return;i.add(a)}if(s.push(a),Array.isArray(a))for(let l of a)o(l);else if(a&&typeof a=="object")for(let l of Object.keys(a))o(a[l])};return o(e),s}case"Optional":try{return V(e,t.expr,r)}catch{return[]}case"StringInterp":return[t.parts.map(i=>typeof i=="string"?i:V(e,i,r).map(a=>typeof a=="string"?a:JSON.stringify(a)).join("")).join("")];case"UpdateOp":return[e5(e,t.path,t.op,t.value,r)];case"Reduce":{let s=V(e,t.expr,r),i=V(e,t.init,r)[0],o=r.limits.maxDepth??Zd;for(let a of s){let l;if(t.pattern){if(l=ii(r,t.pattern,a),l===null)continue}else l=go(r,t.varName,a);if(i=V(i,t.update,l)[0],ms(i,o+1)>o)return[null]}return[i]}case"Foreach":{let s=V(e,t.expr,r),i=V(e,t.init,r)[0],o=[];for(let a of s)try{let l;if(t.pattern){if(l=ii(r,t.pattern,a),l===null)continue}else l=go(r,t.varName,a);if(i=V(i,t.update,l)[0],t.extract){let c=V(i,t.extract,l);o.push(...c)}else o.push(i)}catch(l){throw l instanceof gs?l.withPrependedResults(o):l}return o}case"Label":try{return V(e,t.body,{...r,labels:new Set([...r.labels??[],t.name])})}catch(s){if(s instanceof gs&&s.label===t.name)return s.partialResults;throw s}case"Break":throw new gs(t.name);case"Def":{let s=new Map(r.funcs??[]),i=`${t.name}/${t.params.length}`;s.set(i,{params:t.params,body:t.funcBody,closure:new Map(r.funcs??[])});let o={...r,funcs:s};return V(e,t.body,o)}default:{let s=t;throw new Error(`Unknown AST node type: ${s.type}`)}}}function qd(e,t){return e<0?Math.max(0,t+e):Math.min(e,t)}function e5(e,t,n,r,s){function i(l,c){switch(n){case"=":return c;case"|=":return V(l,r,s)[0]??null;case"+=":return typeof l=="number"&&typeof c=="number"||typeof l=="string"&&typeof c=="string"?l+c:Array.isArray(l)&&Array.isArray(c)?[...l,...c]:l&&c&&typeof l=="object"&&typeof c=="object"?fl(l,c):c;case"-=":return typeof l=="number"&&typeof c=="number"?l-c:l;case"*=":return typeof l=="number"&&typeof c=="number"?l*c:l;case"/=":return typeof l=="number"&&typeof c=="number"?l/c:l;case"%=":return typeof l=="number"&&typeof c=="number"?l%c:l;case"//=":return l===null||l===!1?c:l;default:return c}}function o(l,c,u){switch(c.type){case"Identity":return u(l);case"Field":{if(!Te(c.name))return l;if(c.base)return o(l,c.base,f=>{if(f&&typeof f=="object"&&!Array.isArray(f)){let p=mt(f),h=Object.hasOwn(p,c.name)?p[c.name]:void 0;return Ue(p,c.name,u(h)),p}return f});if(l&&typeof l=="object"&&!Array.isArray(l)){let f=mt(l),p=Object.hasOwn(f,c.name)?f[c.name]:void 0;return Ue(f,c.name,u(p)),f}return l}case"Index":{let p=V(e,c.index,s)[0];if(typeof p=="number"&&Number.isNaN(p))throw new Error("Cannot set array element at NaN index");if(typeof p=="number"&&!Number.isInteger(p)&&(p=Math.trunc(p)),c.base)return o(l,c.base,h=>{if(typeof p=="number"&&Array.isArray(h)){let d=[...h],m=p<0?d.length+p:p;if(m>=0){for(;d.length<=m;)d.push(null);d[m]=u(d[m])}return d}if(typeof p=="string"&&h&&typeof h=="object"&&!Array.isArray(h)){if(!Te(p))return h;let d=mt(h),m=Object.hasOwn(d,p)?d[p]:void 0;return Ue(d,p,u(m)),d}return h});if(typeof p=="number"){if(p>536870911)throw new Error("Array index too large");if(p<0&&(!l||!Array.isArray(l)))throw new Error("Out of bounds negative array index");if(Array.isArray(l)){let d=[...l],m=p<0?d.length+p:p;if(m>=0){for(;d.length<=m;)d.push(null);d[m]=u(d[m])}return d}if(l==null){let d=[];for(;d.length<=p;)d.push(null);return d[p]=u(null),d}return l}if(typeof p=="string"&&l&&typeof l=="object"&&!Array.isArray(l)){if(!Te(p))return l;let h=mt(l),d=Object.hasOwn(h,p)?h[p]:void 0;return Ue(h,p,u(d)),h}return l}case"Iterate":{let f=p=>{if(Array.isArray(p))return p.map(h=>u(h));if(p&&typeof p=="object"){let h=Object.create(null);for(let[d,m]of Object.entries(p))Te(d)&&Ue(h,d,u(m));return h}return p};return c.base?o(l,c.base,f):f(l)}case"Pipe":{let f=o(l,c.left,p=>p);return o(f,c.right,u)}default:return u(l)}}return o(e,t,l=>{if(n==="|=")return i(l,l);let c=V(e,r,s);return i(l,c[0]??null)})}function t5(e,t,n){function r(i,o,a){switch(o.type){case"Identity":return a;case"Field":{if(!Te(o.name))return i;if(o.base){let l=V(i,o.base,n)[0],c=r(l,{type:"Field",name:o.name},a);return r(i,o.base,c)}if(i&&typeof i=="object"&&!Array.isArray(i)){let l=mt(i);return Ue(l,o.name,a),l}return i}case"Index":{if(o.base){let u=V(i,o.base,n)[0],f=r(u,{type:"Index",index:o.index},a);return r(i,o.base,f)}let c=V(e,o.index,n)[0];if(typeof c=="number"&&Array.isArray(i)){let u=[...i],f=c<0?u.length+c:c;return f>=0&&f<u.length&&(u[f]=a),u}if(typeof c=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){if(!Te(c))return i;let u=mt(i);return Ue(u,c,a),u}return i}default:return i}}function s(i,o){switch(o.type){case"Identity":return null;case"Field":{if(!Te(o.name))return i;if(o.base){let l=V(i,o.base,n)[0];if(l==null)return i;let c=s(l,{type:"Field",name:o.name});return r(i,o.base,c)}if(i&&typeof i=="object"&&!Array.isArray(i)){if(!Te(o.name))return i;let l=mt(i);return delete l[o.name],l}return i}case"Index":{if(o.base){let u=V(i,o.base,n)[0];if(u==null)return i;let f=s(u,{type:"Index",index:o.index});return r(i,o.base,f)}let c=V(e,o.index,n)[0];if(typeof c=="number"&&Array.isArray(i)){let u=[...i],f=c<0?u.length+c:c;return f>=0&&f<u.length&&u.splice(f,1),u}if(typeof c=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){if(!Te(c))return i;let u=mt(i);return delete u[c],u}return i}case"Iterate":return Array.isArray(i)?[]:i&&typeof i=="object"?Object.create(null):i;case"Pipe":{let u=function(h,d,m){switch(d.type){case"Identity":return m;case"Field":{if(!Te(d.name))return h;if(h&&typeof h=="object"&&!Array.isArray(h)){let g=mt(h);return Ue(g,d.name,m),g}return h}case"Index":{let y=V(e,d.index,n)[0];if(typeof y=="number"&&Array.isArray(h)){let w=[...h],b=y<0?w.length+y:y;return b>=0&&b<w.length&&(w[b]=m),w}if(typeof y=="string"&&h&&typeof h=="object"&&!Array.isArray(h)){if(!Te(y))return h;let w=mt(h);return Ue(w,y,m),w}return h}case"Pipe":{let g=V(h,d.left,n)[0],y=u(g,d.right,m);return u(h,d.left,y)}default:return h}};var a=u;let l=o.left,c=o.right,f=V(i,l,n)[0];if(f==null)return i;let p=s(f,c);return u(i,l,p)}default:return i}}return s(e,t)}function n5(e,t,n,r,s){if(t==="and")return V(e,n,s).flatMap(l=>pn(l)?V(e,r,s).map(u=>pn(u)):[!1]);if(t==="or")return V(e,n,s).flatMap(l=>pn(l)?[!0]:V(e,r,s).map(u=>pn(u)));if(t==="//"){let l=V(e,n,s).filter(c=>c!=null&&c!==!1);return l.length>0?l:V(e,r,s)}let i=V(e,n,s),o=V(e,r,s);return i.flatMap(a=>o.map(l=>{switch(t){case"+":return a===null?l:l===null?a:typeof a=="number"&&typeof l=="number"||typeof a=="string"&&typeof l=="string"?a+l:Array.isArray(a)&&Array.isArray(l)?[...a,...l]:a&&l&&typeof a=="object"&&typeof l=="object"&&!Array.isArray(a)&&!Array.isArray(l)?fl(a,l):null;case"-":if(typeof a=="number"&&typeof l=="number")return a-l;if(Array.isArray(a)&&Array.isArray(l)){let c=new Set(l.map(u=>JSON.stringify(u)));return a.filter(u=>!c.has(JSON.stringify(u)))}if(typeof a=="string"&&typeof l=="string"){let c=u=>u.length>10?`"${u.slice(0,10)}...`:JSON.stringify(u);throw new Error(`string (${c(a)}) and string (${c(l)}) cannot be subtracted`)}return null;case"*":if(typeof a=="number"&&typeof l=="number")return a*l;if(typeof a=="string"&&typeof l=="number")return a.repeat(l);{let c=ze(a),u=ze(l);if(c&&u)return ql(c,u)}return null;case"/":if(typeof a=="number"&&typeof l=="number"){if(l===0)throw new Error(`number (${a}) and number (${l}) cannot be divided because the divisor is zero`);return a/l}return typeof a=="string"&&typeof l=="string"?a.split(l):null;case"%":if(typeof a=="number"&&typeof l=="number"){if(l===0)throw new Error(`number (${a}) and number (${l}) cannot be divided (remainder) because the divisor is zero`);return!Number.isFinite(a)&&!Number.isNaN(a)?!Number.isFinite(l)&&!Number.isNaN(l)&&a<0&&l>0?-1:0:a%l}return null;case"==":return ds(a,l);case"!=":return!ds(a,l);case"<":return si(a,l)<0;case"<=":return si(a,l)<=0;case">":return si(a,l)>0;case">=":return si(a,l)>=0;default:return null}}))}function Kd(e,t,n,r){let s=Xb.get(t);if(s)return typeof e=="number"?[s(e)]:[null];let i=Ql(e,t,n,r,V);if(i!==null)return i;let o=tc(e,t,n,r,V);if(o!==null)return o;let a=Vl(e,t,n,r,V);if(a!==null)return a;let l=Zl(e,t,r.limits.maxDepth);if(l!==null)return l;let c=nc(e,t);if(c!==null)return c;let u=Yl(e,t,n,r,V);if(u!==null)return u;let f=jl(e,t,n,r,V,Vd,lo,pn,co,Q);if(f!==null)return f;let p=Jl(e,t,n,r,V,pn,fo,po,t5,ho);if(p!==null)return p;let h=Kl(e,t,n,r,V,ds);if(h!==null)return h;let d=Gl(e,t,n,r,V,Vd,pn,Q);if(d!==null)return d;let m=Xl(e,t,n,r,V,pn,Jb,Kd);if(m!==null)return m;let g=ec(e,t,n,r,V,ds);if(g!==null)return g;switch(t){case"builtins":return[["add/0","all/0","all/1","all/2","any/0","any/1","any/2","arrays/0","ascii/0","ascii_downcase/0","ascii_upcase/0","booleans/0","bsearch/1","builtins/0","combinations/0","combinations/1","contains/1","debug/0","del/1","delpaths/1","empty/0","env/0","error/0","error/1","explode/0","first/0","first/1","flatten/0","flatten/1","floor/0","from_entries/0","fromdate/0","fromjson/0","getpath/1","gmtime/0","group_by/1","gsub/2","gsub/3","has/1","implode/0","IN/1","IN/2","INDEX/1","INDEX/2","index/1","indices/1","infinite/0","inside/1","isempty/1","isnan/0","isnormal/0","isvalid/1","iterables/0","join/1","keys/0","keys_unsorted/0","last/0","last/1","length/0","limit/2","ltrimstr/1","map/1","map_values/1","match/1","match/2","max/0","max_by/1","min/0","min_by/1","mktime/0","modulemeta/1","nan/0","not/0","nth/1","nth/2","null/0","nulls/0","numbers/0","objects/0","path/1","paths/0","paths/1","pick/1","range/1","range/2","range/3","recurse/0","recurse/1","recurse_down/0","repeat/1","reverse/0","rindex/1","rtrimstr/1","scalars/0","scan/1","scan/2","select/1","setpath/2","skip/2","sort/0","sort_by/1","split/1","splits/1","splits/2","sqrt/0","startswith/1","strftime/1","strings/0","strptime/1","sub/2","sub/3","test/1","test/2","to_entries/0","toboolean/0","todate/0","tojson/0","tostream/0","fromstream/1","truncate_stream/1","tonumber/0","tostring/0","transpose/0","trim/0","ltrim/0","rtrim/0","type/0","unique/0","unique_by/1","until/2","utf8bytelength/0","values/0","walk/1","while/2","with_entries/1"]];case"error":{let y=n.length>0?V(e,n[0],r)[0]:e;throw new mo(y)}case"env":return[r.env?Et(r.env):Object.create(null)];case"debug":return[e];case"input_line_number":return[1];default:{let y=`${t}/${n.length}`,w=r.funcs?.get(y);if(w){let b=w.closure??r.funcs??new Map,x=new Map(b);x.set(y,w);for(let $=0;$<w.params.length;$++){let O=w.params[$],F=n[$];if(F){let P=V(e,F,r),M;if(P.length===0)M={type:"Call",name:"empty",args:[]};else if(P.length===1)M={type:"Literal",value:P[0]};else{M={type:"Literal",value:P[P.length-1]};for(let C=P.length-2;C>=0;C--)M={type:"Comma",left:{type:"Literal",value:P[C]},right:M}}x.set(`${O}/0`,{params:[],body:M})}}let A={...r,funcs:x};return V(e,w.body,A)}throw new Error(`Unknown function: ${t}`)}}}function ho(e,t,n,r,s){if(t.type==="Comma"){let a=t;ho(e,a.left,n,r,s),ho(e,a.right,n,r,s);return}let i=ar(t);if(i!==null){s.push([...r,...i]);return}if(t.type==="Iterate"){if(Array.isArray(e))for(let a=0;a<e.length;a++)s.push([...r,a]);else if(e&&typeof e=="object")for(let a of Object.keys(e))s.push([...r,a]);return}if(t.type==="Recurse"){let a=(l,c)=>{if(s.push([...r,...c]),l&&typeof l=="object")if(Array.isArray(l))for(let u=0;u<l.length;u++)a(l[u],[...c,u]);else for(let u of Object.keys(l))a(l[u],[...c,u])};a(e,[]);return}if(t.type==="Pipe"){let a=ar(t.left);if(a!==null){let l=V(e,t.left,n);for(let c of l)ho(c,t.right,n,[...r,...a],s);return}}V(e,t,n).length>0&&s.push(r)}var gs,mo,Qb,Zd,Xb,Qd=v(()=>{"use strict";Kn();xe();Fn();jd();Gd();bn();uo();gs=class e extends Error{label;partialResults;constructor(t,n=[]){super(`break ${t}`),this.label=t,this.partialResults=n,this.name="BreakError"}withPrependedResults(t){return new e(this.label,[...t,...this.partialResults])}},mo=class extends Error{value;constructor(t){super(typeof t=="string"?t:JSON.stringify(t)),this.value=t,this.name="JqError"}},Qb=1e4,Zd=2e3,Xb=new Map([["floor",Math.floor],["ceil",Math.ceil],["round",Math.round],["sqrt",Math.sqrt],["log",Math.log],["log10",Math.log10],["log2",Math.log2],["exp",Math.exp],["sin",Math.sin],["cos",Math.cos],["tan",Math.tan],["asin",Math.asin],["acos",Math.acos],["atan",Math.atan],["sinh",Math.sinh],["cosh",Math.cosh],["tanh",Math.tanh],["asinh",Math.asinh],["acosh",Math.acosh],["atanh",Math.atanh],["cbrt",Math.cbrt],["expm1",Math.expm1],["log1p",Math.log1p],["trunc",Math.trunc]])});function Yd(e){let t=[],n=0,r=(c=0)=>e[n+c],s=()=>e[n++],i=()=>n>=e.length,o=c=>c>="0"&&c<="9",a=c=>c>="a"&&c<="z"||c>="A"&&c<="Z"||c==="_",l=c=>a(c)||o(c);for(;!i();){let c=n,u=s();if(!(u===" "||u===" "||u===`
|
|
554
|
+
`||u==="\r")){if(u==="#"){for(;!i()&&r()!==`
|
|
555
|
+
`;)s();continue}if(u==="."&&r()==="."){s(),t.push({type:"DOTDOT",pos:c});continue}if(u==="="&&r()==="="){s(),t.push({type:"EQ",pos:c});continue}if(u==="!"&&r()==="="){s(),t.push({type:"NE",pos:c});continue}if(u==="<"&&r()==="="){s(),t.push({type:"LE",pos:c});continue}if(u===">"&&r()==="="){s(),t.push({type:"GE",pos:c});continue}if(u==="/"&&r()==="/"){s(),r()==="="?(s(),t.push({type:"UPDATE_ALT",pos:c})):t.push({type:"ALT",pos:c});continue}if(u==="+"&&r()==="="){s(),t.push({type:"UPDATE_ADD",pos:c});continue}if(u==="-"&&r()==="="){s(),t.push({type:"UPDATE_SUB",pos:c});continue}if(u==="*"&&r()==="="){s(),t.push({type:"UPDATE_MUL",pos:c});continue}if(u==="/"&&r()==="="){s(),t.push({type:"UPDATE_DIV",pos:c});continue}if(u==="%"&&r()==="="){s(),t.push({type:"UPDATE_MOD",pos:c});continue}if(u==="="&&r()!=="="){t.push({type:"ASSIGN",pos:c});continue}if(u==="."){t.push({type:"DOT",pos:c});continue}if(u==="|"){r()==="="?(s(),t.push({type:"UPDATE_PIPE",pos:c})):t.push({type:"PIPE",pos:c});continue}if(u===","){t.push({type:"COMMA",pos:c});continue}if(u===":"){t.push({type:"COLON",pos:c});continue}if(u===";"){t.push({type:"SEMICOLON",pos:c});continue}if(u==="("){t.push({type:"LPAREN",pos:c});continue}if(u===")"){t.push({type:"RPAREN",pos:c});continue}if(u==="["){t.push({type:"LBRACKET",pos:c});continue}if(u==="]"){t.push({type:"RBRACKET",pos:c});continue}if(u==="{"){t.push({type:"LBRACE",pos:c});continue}if(u==="}"){t.push({type:"RBRACE",pos:c});continue}if(u==="?"){t.push({type:"QUESTION",pos:c});continue}if(u==="+"){t.push({type:"PLUS",pos:c});continue}if(u==="-"){t.push({type:"MINUS",pos:c});continue}if(u==="*"){t.push({type:"STAR",pos:c});continue}if(u==="/"){t.push({type:"SLASH",pos:c});continue}if(u==="%"){t.push({type:"PERCENT",pos:c});continue}if(u==="<"){t.push({type:"LT",pos:c});continue}if(u===">"){t.push({type:"GT",pos:c});continue}if(o(u)){let f=u;for(;!i()&&(o(r())||r()==="."||r()==="e"||r()==="E");)(r()==="e"||r()==="E")&&(e[n+1]==="+"||e[n+1]==="-")&&(f+=s()),f+=s();t.push({type:"NUMBER",value:Number(f),pos:c});continue}if(u==='"'){let f="";for(;!i()&&r()!=='"';)if(r()==="\\"){if(s(),i())break;let p=s();switch(p){case"n":f+=`
|
|
556
|
+
`;break;case"r":f+="\r";break;case"t":f+=" ";break;case"\\":f+="\\";break;case'"':f+='"';break;case"(":f+="\\(";break;default:f+=p}}else f+=s();i()||s(),t.push({type:"STRING",value:f,pos:c});continue}if(a(u)||u==="$"||u==="@"){let f=u;for(;!i()&&l(r());)f+=s();let p=Xd.get(f);p?t.push({type:p,value:f,pos:c}):t.push({type:"IDENT",value:f,pos:c});continue}throw new Error(`Unexpected character '${u}' at position ${c}`)}}return t.push({type:"EOF",pos:n}),t}function Jd(e){let t=Yd(e);return new sc(t).parse()}var Xd,yo,sc,em=v(()=>{"use strict";Xd=new Map([["and","AND"],["or","OR"],["not","NOT"],["if","IF"],["then","THEN"],["elif","ELIF"],["else","ELSE"],["end","END"],["as","AS"],["try","TRY"],["catch","CATCH"],["true","TRUE"],["false","FALSE"],["null","NULL"],["reduce","REDUCE"],["foreach","FOREACH"],["label","LABEL"],["break","BREAK"],["def","DEF"]]),yo=new Set(Xd.values());sc=class e{tokens;pos=0;constructor(t){this.tokens=t}peek(t=0){return this.tokens[this.pos+t]??{type:"EOF",pos:-1}}advance(){return this.tokens[this.pos++]}check(t){return this.peek().type===t}match(...t){for(let n of t)if(this.check(n))return this.advance();return null}expect(t,n){if(!this.check(t))throw new Error(`${n} at position ${this.peek().pos}, got ${this.peek().type}`);return this.advance()}isFieldNameAfterDot(t=0){let n=this.peek(t),r=this.peek(t+1);return r.type==="STRING"?!0:r.type==="IDENT"||yo.has(r.type)?r.pos===n.pos+1:!1}isIdentLike(){let t=this.peek().type;return t==="IDENT"||yo.has(t)}consumeFieldNameAfterDot(t){let n=this.peek();return n.type==="STRING"?this.advance().value:(n.type==="IDENT"||yo.has(n.type))&&n.pos===t.pos+1?this.advance().value:null}parse(){let t=this.parseExpr();if(!this.check("EOF"))throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`);return t}parseExpr(){return this.parsePipe()}parsePattern(){if(this.match("LBRACKET")){let r=[];if(!this.check("RBRACKET"))for(r.push(this.parsePattern());this.match("COMMA")&&!this.check("RBRACKET");)r.push(this.parsePattern());return this.expect("RBRACKET","Expected ']' after array pattern"),{type:"array",elements:r}}if(this.match("LBRACE")){let r=[];if(!this.check("RBRACE"))for(r.push(this.parsePatternField());this.match("COMMA")&&!this.check("RBRACE");)r.push(this.parsePatternField());return this.expect("RBRACE","Expected '}' after object pattern"),{type:"object",fields:r}}let t=this.expect("IDENT","Expected variable name in pattern"),n=t.value;if(!n.startsWith("$"))throw new Error(`Variable name must start with $ at position ${t.pos}`);return{type:"var",name:n}}parsePatternField(){if(this.match("LPAREN")){let n=this.parseExpr();this.expect("RPAREN","Expected ')' after computed key"),this.expect("COLON","Expected ':' after computed key");let r=this.parsePattern();return{key:n,pattern:r}}let t=this.peek();if(t.type==="IDENT"||yo.has(t.type)){let n=t.value;if(n.startsWith("$")){if(this.advance(),this.match("COLON")){let r=this.parsePattern();return{key:n.slice(1),pattern:r,keyVar:n}}return{key:n.slice(1),pattern:{type:"var",name:n}}}if(this.advance(),this.match("COLON")){let r=this.parsePattern();return{key:n,pattern:r}}return{key:n,pattern:{type:"var",name:`$${n}`}}}throw new Error(`Expected field name in object pattern at position ${t.pos}`)}parsePipe(){let t=this.parseComma();for(;this.match("PIPE");){let n=this.parseComma();t={type:"Pipe",left:t,right:n}}return t}parseComma(){let t=this.parseVarBind();for(;this.match("COMMA");){let n=this.parseVarBind();t={type:"Comma",left:t,right:n}}return t}parseVarBind(){let t=this.parseUpdate();if(this.match("AS")){let n=this.parsePattern(),r=[];for(;this.check("QUESTION")&&this.peekAhead(1)?.type==="ALT";)this.advance(),this.advance(),r.push(this.parsePattern());this.expect("PIPE","Expected '|' after variable binding");let s=this.parseExpr();return n.type==="var"&&r.length===0?{type:"VarBind",name:n.name,value:t,body:s}:{type:"VarBind",name:n.type==="var"?n.name:"",value:t,body:s,pattern:n.type!=="var"?n:void 0,alternatives:r.length>0?r:void 0}}return t}peekAhead(t){let n=this.pos+t;return n<this.tokens.length?this.tokens[n]:void 0}parseUpdate(){let t=this.parseAlt(),n=new Map([["ASSIGN","="],["UPDATE_ADD","+="],["UPDATE_SUB","-="],["UPDATE_MUL","*="],["UPDATE_DIV","/="],["UPDATE_MOD","%="],["UPDATE_ALT","//="],["UPDATE_PIPE","|="]]),r=this.match("ASSIGN","UPDATE_ADD","UPDATE_SUB","UPDATE_MUL","UPDATE_DIV","UPDATE_MOD","UPDATE_ALT","UPDATE_PIPE");if(r){let s=this.parseVarBind(),i=n.get(r.type);if(i)return{type:"UpdateOp",op:i,path:t,value:s}}return t}parseAlt(){let t=this.parseOr();for(;this.match("ALT");){let n=this.parseOr();t={type:"BinaryOp",op:"//",left:t,right:n}}return t}parseOr(){let t=this.parseAnd();for(;this.match("OR");){let n=this.parseAnd();t={type:"BinaryOp",op:"or",left:t,right:n}}return t}parseAnd(){let t=this.parseNot();for(;this.match("AND");){let n=this.parseNot();t={type:"BinaryOp",op:"and",left:t,right:n}}return t}parseNot(){return this.parseComparison()}parseComparison(){let t=this.parseAddSub(),n=new Map([["EQ","=="],["NE","!="],["LT","<"],["LE","<="],["GT",">"],["GE",">="]]),r=this.match("EQ","NE","LT","LE","GT","GE");if(r){let s=n.get(r.type);if(s){let i=this.parseAddSub();t={type:"BinaryOp",op:s,left:t,right:i}}}return t}parseAddSub(){let t=this.parseMulDiv();for(;;)if(this.match("PLUS")){let n=this.parseMulDiv();t={type:"BinaryOp",op:"+",left:t,right:n}}else if(this.match("MINUS")){let n=this.parseMulDiv();t={type:"BinaryOp",op:"-",left:t,right:n}}else break;return t}parseMulDiv(){let t=this.parseUnary();for(;;)if(this.match("STAR")){let n=this.parseUnary();t={type:"BinaryOp",op:"*",left:t,right:n}}else if(this.match("SLASH")){let n=this.parseUnary();t={type:"BinaryOp",op:"/",left:t,right:n}}else if(this.match("PERCENT")){let n=this.parseUnary();t={type:"BinaryOp",op:"%",left:t,right:n}}else break;return t}parseUnary(){return this.match("MINUS")?{type:"UnaryOp",op:"-",operand:this.parseUnary()}:this.parsePostfix()}parsePostfix(){let t=this.parsePrimary();for(;;)if(this.match("QUESTION"))t={type:"Optional",expr:t};else if(this.check("DOT")&&this.isFieldNameAfterDot())this.advance(),t={type:"Field",name:this.advance().value,base:t};else if(this.check("LBRACKET"))if(this.advance(),this.match("RBRACKET"))t={type:"Iterate",base:t};else if(this.check("COLON")){this.advance();let n=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),t={type:"Slice",end:n,base:t}}else{let n=this.parseExpr();if(this.match("COLON")){let r=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),t={type:"Slice",start:n,end:r,base:t}}else this.expect("RBRACKET","Expected ']'"),t={type:"Index",index:n,base:t}}else break;return t}parsePrimary(){if(this.match("DOTDOT"))return{type:"Recurse"};if(this.check("DOT")){let t=this.advance();if(this.check("LBRACKET")){if(this.advance(),this.match("RBRACKET"))return{type:"Iterate"};if(this.check("COLON")){this.advance();let s=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",end:s}}let r=this.parseExpr();if(this.match("COLON")){let s=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",start:r,end:s}}return this.expect("RBRACKET","Expected ']'"),{type:"Index",index:r}}let n=this.consumeFieldNameAfterDot(t);return n!==null?{type:"Field",name:n}:{type:"Identity"}}if(this.match("TRUE"))return{type:"Literal",value:!0};if(this.match("FALSE"))return{type:"Literal",value:!1};if(this.match("NULL"))return{type:"Literal",value:null};if(this.check("NUMBER"))return{type:"Literal",value:this.advance().value};if(this.check("STRING")){let n=this.advance().value;return n.includes("\\(")?this.parseStringInterpolation(n):{type:"Literal",value:n}}if(this.match("LBRACKET")){if(this.match("RBRACKET"))return{type:"Array"};let t=this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Array",elements:t}}if(this.match("LBRACE"))return this.parseObjectConstruction();if(this.match("LPAREN")){let t=this.parseExpr();return this.expect("RPAREN","Expected ')'"),{type:"Paren",expr:t}}if(this.match("IF"))return this.parseIf();if(this.match("TRY")){let t=this.parsePostfix(),n;return this.match("CATCH")&&(n=this.parsePostfix()),{type:"Try",body:t,catch:n}}if(this.match("REDUCE")){let t=this.parseAddSub();this.expect("AS","Expected 'as' after reduce expression");let n=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let r=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let s=this.parseExpr();this.expect("RPAREN","Expected ')' after update expression");let i=n.type==="var"?n.name:"";return{type:"Reduce",expr:t,varName:i,init:r,update:s,pattern:n.type!=="var"?n:void 0}}if(this.match("FOREACH")){let t=this.parseAddSub();this.expect("AS","Expected 'as' after foreach expression");let n=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let r=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let s=this.parseExpr(),i;this.match("SEMICOLON")&&(i=this.parseExpr()),this.expect("RPAREN","Expected ')' after expressions");let o=n.type==="var"?n.name:"";return{type:"Foreach",expr:t,varName:o,init:r,update:s,extract:i,pattern:n.type!=="var"?n:void 0}}if(this.match("LABEL")){let t=this.expect("IDENT","Expected label name (e.g., $out)"),n=t.value;if(!n.startsWith("$"))throw new Error(`Label name must start with $ at position ${t.pos}`);this.expect("PIPE","Expected '|' after label name");let r=this.parseExpr();return{type:"Label",name:n,body:r}}if(this.match("BREAK")){let t=this.expect("IDENT","Expected label name to break to"),n=t.value;if(!n.startsWith("$"))throw new Error(`Break label must start with $ at position ${t.pos}`);return{type:"Break",name:n}}if(this.match("DEF")){let n=this.expect("IDENT","Expected function name after def").value,r=[];if(this.match("LPAREN")){if(!this.check("RPAREN")){let o=this.expect("IDENT","Expected parameter name");for(r.push(o.value);this.match("SEMICOLON");){let a=this.expect("IDENT","Expected parameter name");r.push(a.value)}}this.expect("RPAREN","Expected ')' after parameters")}this.expect("COLON","Expected ':' after function name");let s=this.parseExpr();this.expect("SEMICOLON","Expected ';' after function body");let i=this.parseExpr();return{type:"Def",name:n,params:r,funcBody:s,body:i}}if(this.match("NOT"))return{type:"Call",name:"not",args:[]};if(this.check("IDENT")){let n=this.advance().value;if(n.startsWith("$"))return{type:"VarRef",name:n};if(this.match("LPAREN")){let r=[];if(!this.check("RPAREN"))for(r.push(this.parseExpr());this.match("SEMICOLON");)r.push(this.parseExpr());return this.expect("RPAREN","Expected ')'"),{type:"Call",name:n,args:r}}return{type:"Call",name:n,args:[]}}throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`)}parseObjectConstruction(){let t=[];if(!this.check("RBRACE"))do{let n,r;if(this.match("LPAREN"))n=this.parseExpr(),this.expect("RPAREN","Expected ')'"),this.expect("COLON","Expected ':'"),r=this.parseObjectValue();else if(this.isIdentLike()){let s=this.advance().value;this.match("COLON")?(n=s,r=this.parseObjectValue()):(n=s,r={type:"Field",name:s})}else if(this.check("STRING"))n=this.advance().value,this.expect("COLON","Expected ':'"),r=this.parseObjectValue();else throw new Error(`Expected object key at position ${this.peek().pos}`);t.push({key:n,value:r})}while(this.match("COMMA"));return this.expect("RBRACE","Expected '}'"),{type:"Object",entries:t}}parseObjectValue(){let t=this.parseVarBind();for(;this.match("PIPE");){let n=this.parseVarBind();t={type:"Pipe",left:t,right:n}}return t}parseIf(){let t=this.parseExpr();this.expect("THEN","Expected 'then'");let n=this.parseExpr(),r=[];for(;this.match("ELIF");){let i=this.parseExpr();this.expect("THEN","Expected 'then' after elif");let o=this.parseExpr();r.push({cond:i,then:o})}let s;return this.match("ELSE")&&(s=this.parseExpr()),this.expect("END","Expected 'end'"),{type:"Cond",cond:t,then:n,elifs:r,else:s}}parseStringInterpolation(t){let n=[],r="",s=0;for(;s<t.length;)if(t[s]==="\\"&&t[s+1]==="("){r&&(n.push(r),r=""),s+=2;let i=1,o="";for(;s<t.length&&i>0;)t[s]==="("?i++:t[s]===")"&&i--,i>0&&(o+=t[s]),s++;let a=Yd(o),l=new e(a);n.push(l.parse())}else r+=t[s],s++;return r&&n.push(r),{type:"StringInterp",parts:n}}}});var tm=v(()=>{"use strict";Qd();em()});var rm={};J(rm,{flagsForFuzzing:()=>i5,jqCommand:()=>s5});function nm(e){let t=[],n=0,r=e.length;for(;n<r;){for(;n<r&&/\s/.test(e[n]);)n++;if(n>=r)break;let s=n,i=e[n];if(i==="{"||i==="["){let o=i,a=i==="{"?"}":"]",l=1,c=!1,u=!1;for(n++;n<r&&l>0;){let f=e[n];u?u=!1:f==="\\"?u=!0:f==='"'?c=!c:c||(f===o?l++:f===a&&l--),n++}if(l!==0)throw new Error(`Unexpected end of JSON input at position ${n} (unclosed ${o})`);t.push(os(JSON.parse(e.slice(s,n))))}else if(i==='"'){let o=!1;for(n++;n<r;){let a=e[n];if(o)o=!1;else if(a==="\\")o=!0;else if(a==='"'){n++;break}n++}t.push(os(JSON.parse(e.slice(s,n))))}else if(i==="-"||i>="0"&&i<="9"){for(;n<r&&/[\d.eE+-]/.test(e[n]);)n++;t.push(os(JSON.parse(e.slice(s,n))))}else if(e.slice(n,n+4)==="true")t.push(!0),n+=4;else if(e.slice(n,n+5)==="false")t.push(!1),n+=5;else if(e.slice(n,n+4)==="null")t.push(null),n+=4;else{let o=e.slice(n,n+10);throw new Error(`Invalid JSON at position ${s}: unexpected '${o.split(/\s/)[0]}'`)}}return t}function oi(e,t,n,r,s,i=0){if(e===null||e===void 0)return"null";if(typeof e=="boolean")return String(e);if(typeof e=="number")return Number.isFinite(e)?String(e):"null";if(typeof e=="string")return n?e:JSON.stringify(e);let o=s?" ":" ";if(Array.isArray(e))return e.length===0?"[]":t?`[${e.map(l=>oi(l,!0,!1,r,s)).join(",")}]`:`[
|
|
557
|
+
${e.map(l=>o.repeat(i+1)+oi(l,!1,!1,r,s,i+1)).join(`,
|
|
558
|
+
`)}
|
|
559
|
+
${o.repeat(i)}]`;if(typeof e=="object"){let a=Object.keys(e);return r&&(a=a.sort()),a.length===0?"{}":t?`{${a.map(c=>`${JSON.stringify(c)}:${oi(e[c],!0,!1,r,s)}`).join(",")}}`:`{
|
|
560
|
+
${a.map(c=>{let u=oi(e[c],!1,!1,r,s,i+1);return`${o.repeat(i+1)}${JSON.stringify(c)}: ${u}`}).join(`,
|
|
561
|
+
`)}
|
|
562
|
+
${o.repeat(i)}}`}return String(e)}var r5,s5,i5,sm=v(()=>{"use strict";yn();xe();Fn();an();vr();ne();tm();bn();r5={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE]",options:["-r, --raw-output output strings without quotes","-c, --compact compact output (no pretty printing)","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --help display this help and exit"]};s5={name:"jq",async execute(e,t){rt(t.requireDefenseContext,"jq","execution entry");let n=(m,g)=>Tt(t.requireDefenseContext,"jq",m,g);if(B(e))return U(r5);let r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1,u=!1,f=".",p=!1,h=[];for(let m=0;m<e.length;m++){let g=e[m];if(g==="-r"||g==="--raw-output")r=!0;else if(g==="-c"||g==="--compact-output")s=!0;else if(g==="-e"||g==="--exit-status")i=!0;else if(g==="-s"||g==="--slurp")o=!0;else if(g==="-n"||g==="--null-input")a=!0;else if(g==="-j"||g==="--join-output")l=!0;else if(!(g==="-a"||g==="--ascii")){if(g==="-S"||g==="--sort-keys")c=!0;else if(!(g==="-C"||g==="--color")){if(!(g==="-M"||g==="--monochrome"))if(g==="--tab")u=!0;else if(g==="-")h.push("-");else{if(g.startsWith("--"))return Z("jq",g);if(g.startsWith("-")){for(let y of g.slice(1))if(y==="r")r=!0;else if(y==="c")s=!0;else if(y==="e")i=!0;else if(y==="s")o=!0;else if(y==="n")a=!0;else if(y==="j")l=!0;else if(y!=="a"){if(y==="S")c=!0;else if(y!=="C"){if(y!=="M")return Z("jq",`-${y}`)}}}else p?h.push(g):(f=g,p=!0)}}}}let d=[];if(!a)if(h.length===0||h.length===1&&h[0]==="-")d.push({source:"stdin",content:t.stdin});else{let m=await n("file read",()=>Cr(t,h,{cmdName:"jq",stopOnError:!0}));if(m.exitCode!==0)return{stdout:"",stderr:m.stderr,exitCode:2};d=m.files.map(g=>({source:g.filename||"stdin",content:g.content}))}try{let m=Jd(f),g=[],y={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0,env:t.env,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext};if(a)g=V(null,m,y);else if(o){let O=[];for(let{content:F}of d){let P=F.trim();P&&O.push(...nm(P))}g=V(O,m,y)}else for(let{content:O}of d){let F=O.trim();if(!F)continue;let P=nm(F);for(let M of P)g.push(...V(M,m,y))}let w=g.map(O=>oi(O,s,r,c,u)),b=l?"":`
|
|
563
|
+
`,x=w.join(b),A=t.limits?.maxStringLength;if(A!==void 0&&A>0&&x.length>A)throw new Q(`jq: output size limit exceeded (${A} bytes)`,"string_length");let $=i&&(g.length===0||g.every(O=>O==null||O===!1))?1:0;return{stdout:x?l?x:`${x}
|
|
564
|
+
`:"",stderr:"",exitCode:$}}catch(m){if(m instanceof he)throw m;if(m instanceof Q)return{stdout:"",stderr:`jq: ${Be(m.message)}
|
|
565
|
+
`,exitCode:Q.EXIT_CODE};let g=Be(m.message);return g.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${g}
|
|
566
|
+
`,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${g}
|
|
567
|
+
`,exitCode:5}}}},i5={name:"jq",flags:[{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"json",needsArgs:!0}});var om={};J(om,{base64Command:()=>l5,flagsForFuzzing:()=>c5});async function im(e,t,n){if(t.length===0||t.length===1&&t[0]==="-")return{ok:!0,data:Uint8Array.from(e.stdin,a=>a.charCodeAt(0))};let r=[];for(let a of t){if(a==="-"){r.push(Uint8Array.from(e.stdin,l=>l.charCodeAt(0)));continue}try{let l=e.fs.resolvePath(e.cwd,a),c=await e.fs.readFileBuffer(l);r.push(c)}catch{return{ok:!1,error:{stdout:"",stderr:`${n}: ${a}: No such file or directory
|
|
568
|
+
`,exitCode:1}}}}let s=r.reduce((a,l)=>a+l.length,0),i=new Uint8Array(s),o=0;for(let a of r)i.set(a,o),o+=a.length;return{ok:!0,data:i}}var o5,a5,l5,c5,am=v(()=>{"use strict";st();ne();o5={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},a5={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};l5={name:"base64",async execute(e,t){if(B(e))return U(o5);let n=Ee("base64",e,a5);if(!n.ok)return n.error;let r=n.result.flags.decode,s=n.result.flags.wrap,i=n.result.positional;try{if(r){let l=await im(t,i,"base64");if(!l.ok)return l.error;if(typeof Buffer<"u"){let h=Buffer.from(l.data).toString("utf8").replace(/\s/g,"");return{stdout:Buffer.from(h,"base64").toString("latin1"),stderr:"",exitCode:0,stdoutEncoding:"binary"}}let u=String.fromCharCode(...l.data).replace(/\s/g,"");return{stdout:atob(u),stderr:"",exitCode:0,stdoutEncoding:"binary"}}let o=await im(t,i,"base64");if(!o.ok)return o.error;let a;if(typeof Buffer<"u"?a=Buffer.from(o.data).toString("base64"):a=btoa(String.fromCharCode(...o.data)),s>0){let l=[];for(let c=0;c<a.length;c+=s)l.push(a.slice(c,c+s));a=l.join(`
|
|
569
|
+
`)+(a.length>0?`
|
|
570
|
+
`:"")}return{stdout:a,stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`base64: invalid input
|
|
571
|
+
`,exitCode:1}}}},c5={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}});var cm={};J(cm,{diffCommand:()=>p5,flagsForFuzzing:()=>h5});import*as lm from"diff";var u5,f5,p5,h5,um=v(()=>{"use strict";st();ne();u5={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:["-u, --unified output unified diff format (default)","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --help display this help and exit"]},f5={unified:{short:"u",long:"unified",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},p5={name:"diff",async execute(e,t){if(B(e))return U(u5);let n=Ee("diff",e,f5);if(!n.ok)return n.error;let r=n.result.flags.brief,s=n.result.flags.reportSame,i=n.result.flags.ignoreCase,o=n.result.positional;if(n.result.flags.unified,o.length<2)return{stdout:"",stderr:`diff: missing operand
|
|
572
|
+
`,exitCode:2};let a,l,[c,u]=o;try{a=c==="-"?t.stdin:await t.fs.readFile(t.fs.resolvePath(t.cwd,c))}catch{return{stdout:"",stderr:`diff: ${c}: No such file or directory
|
|
573
|
+
`,exitCode:2}}try{l=u==="-"?t.stdin:await t.fs.readFile(t.fs.resolvePath(t.cwd,u))}catch{return{stdout:"",stderr:`diff: ${u}: No such file or directory
|
|
574
|
+
`,exitCode:2}}let f=a,p=l;return i&&(f=f.toLowerCase(),p=p.toLowerCase()),f===p?s?{stdout:`Files ${c} and ${u} are identical
|
|
575
|
+
`,stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0}:r?{stdout:`Files ${c} and ${u} differ
|
|
576
|
+
`,stderr:"",exitCode:1}:{stdout:lm.createTwoFilesPatch(c,u,a,l,"","",{context:3}),stderr:"",exitCode:1}}},h5={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2}});var fm={};J(fm,{dateCommand:()=>w5,flagsForFuzzing:()=>b5});function zt(e,t=2){return String(e).padStart(t,"0")}function wo(e,t,n){let r={Y:e.getUTCFullYear(),m:e.getUTCMonth(),D:e.getUTCDate(),H:e.getUTCHours(),M:e.getUTCMinutes(),S:e.getUTCSeconds(),w:e.getUTCDay()},s="",i=0;for(;i<t.length;){if(t[i]==="%"&&i+1<t.length){let o=t[++i];switch(o){case"%":s+="%";break;case"a":s+=m5[r.w];break;case"b":case"h":s+=g5[r.m];break;case"d":s+=zt(r.D);break;case"e":s+=String(r.D).padStart(2," ");break;case"F":s+=`${r.Y}-${zt(r.m+1)}-${zt(r.D)}`;break;case"H":s+=zt(r.H);break;case"I":s+=zt(r.H%12||12);break;case"m":s+=zt(r.m+1);break;case"M":s+=zt(r.M);break;case"n":s+=`
|
|
577
|
+
`;break;case"p":s+=r.H<12?"AM":"PM";break;case"P":s+=r.H<12?"am":"pm";break;case"R":s+=`${zt(r.H)}:${zt(r.M)}`;break;case"s":s+=Math.floor(e.getTime()/1e3);break;case"S":s+=zt(r.S);break;case"t":s+=" ";break;case"T":s+=`${zt(r.H)}:${zt(r.M)}:${zt(r.S)}`;break;case"u":s+=r.w||7;break;case"w":s+=r.w;break;case"y":s+=zt(r.Y%100);break;case"Y":s+=r.Y;break;case"z":s+="+0000";break;case"Z":s+="UTC";break;default:s+=`%${o}`}}else s+=t[i];i++}return s}function y5(e){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t;if(/^\d+$/.test(e))return new Date(Number.parseInt(e,10)*1e3);let n=e.toLowerCase();return n==="now"||n==="today"?new Date:n==="yesterday"?new Date(Date.now()-864e5):n==="tomorrow"?new Date(Date.now()+864e5):null}var d5,m5,g5,w5,b5,pm=v(()=>{"use strict";ne();d5={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING","-u, --utc print Coordinated Universal Time (UTC)","-I, --iso-8601 output date/time in ISO 8601 format","-R, --rfc-email output RFC 5322 date format"," --help display this help and exit"]},m5=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];w5={name:"date",async execute(e,t){if(B(e))return U(d5);let n=!1,r=null,s=null,i=!1,o=!1;for(let c=0;c<e.length;c++){let u=e[c];if(u==="-u"||u==="--utc")n=!0;else if(u==="-d"||u==="--date")r=e[++c]??"";else if(u.startsWith("--date="))r=u.slice(7);else if(u==="-I"||u==="--iso-8601")i=!0;else if(u==="-R"||u==="--rfc-email")o=!0;else if(u.startsWith("+"))s=u.slice(1);else{if(u.startsWith("--"))return Z("date",u);if(u.startsWith("-"))for(let f of u.slice(1))if(f==="u")n=!0;else if(f==="I")i=!0;else if(f==="R")o=!0;else return Z("date",`-${f}`)}}let a=r!==null?y5(r):new Date;if(!a)return{stdout:"",stderr:`date: invalid date '${r}'
|
|
578
|
+
`,exitCode:1};let l;return s?l=wo(a,s,n):i?l=wo(a,"%Y-%m-%dT%H:%M:%S%z",n):o?l=wo(a,"%a, %d %b %Y %H:%M:%S %z",n):l=wo(a,"%a %b %e %H:%M:%S %Z %Y",n),{stdout:`${l}
|
|
579
|
+
`,stderr:"",exitCode:0}}},b5={name:"date",flags:[{flag:"-d",type:"value",valueHint:"string"},{flag:"-u",type:"boolean"},{flag:"-I",type:"boolean"},{flag:"-R",type:"boolean"}]}});function bo(e){let t=e.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!t)return null;let n=parseFloat(t[1]);switch(t[2]||"s"){case"s":return n*1e3;case"m":return n*60*1e3;case"h":return n*60*60*1e3;case"d":return n*24*60*60*1e3;default:return null}}var ic=v(()=>{"use strict"});var dm={};J(dm,{flagsForFuzzing:()=>A5,sleepCommand:()=>E5});var x5,hm,E5,A5,mm=v(()=>{"use strict";zs();ic();ne();x5={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be:
|
|
580
|
+
s - seconds (default)
|
|
581
|
+
m - minutes
|
|
582
|
+
h - hours
|
|
583
|
+
d - days
|
|
584
|
+
|
|
585
|
+
NUMBER may be a decimal number.`,options:[" --help display this help and exit"]},hm=36e5,E5={name:"sleep",async execute(e,t){if(B(e))return U(x5);if(e.length===0)return{stdout:"",stderr:`sleep: missing operand
|
|
586
|
+
`,exitCode:1};let n=0;for(let r of e){let s=bo(r);if(s===null)return{stdout:"",stderr:`sleep: invalid time interval '${r}'
|
|
587
|
+
`,exitCode:1};n+=s}return n>hm&&(n=hm),t.signal?.aborted?{stdout:"",stderr:"",exitCode:0}:(t.sleep?await t.sleep(n):t.signal?await new Promise(r=>{let s=()=>{Qr(i),r()},i=Sr(()=>{t.signal?.removeEventListener("abort",s),r()},n);t.signal?.addEventListener("abort",s,{once:!0})}):await new Promise(r=>Sr(r,n)),{stdout:"",stderr:"",exitCode:0})}},A5={name:"sleep",flags:[],needsArgs:!0}});var gm={};J(gm,{flagsForFuzzing:()=>v5,timeoutCommand:()=>C5});var S5,C5,v5,ym=v(()=>{"use strict";Nr();zs();ic();ne();S5={name:"timeout",summary:"run a command with a time limit",usage:"timeout [OPTION] DURATION COMMAND [ARG]...",description:`Start COMMAND, and kill it if still running after DURATION.
|
|
588
|
+
|
|
589
|
+
DURATION is a number with optional suffix:
|
|
590
|
+
s - seconds (default)
|
|
591
|
+
m - minutes
|
|
592
|
+
h - hours
|
|
593
|
+
d - days`,options:["-k, --kill-after=DURATION send KILL signal after DURATION if still running","-s, --signal=SIGNAL specify signal to send (default: TERM)"," --preserve-status exit with same status as COMMAND, even on timeout"," --foreground run command in foreground"," --help display this help and exit"]},C5={name:"timeout",async execute(e,t){if(B(e))return U(S5);let n=0;for(let c=0;c<e.length;c++){let u=e[c];if(u==="--preserve-status")n=c+1;else if(u==="--foreground")n=c+1;else if(u==="-k"||u==="--kill-after")c++,n=c+1;else if(u.startsWith("--kill-after="))n=c+1;else if(u==="-s"||u==="--signal")c++,n=c+1;else if(u.startsWith("--signal="))n=c+1;else{if(u.startsWith("--")&&u!=="--")return Z("timeout",u);if(u.startsWith("-")&&u.length>1&&u!=="--")if(u.startsWith("-k"))n=c+1;else if(u.startsWith("-s"))n=c+1;else return Z("timeout",u);else{n=c;break}}}let r=e.slice(n);if(r.length===0)return{stdout:"",stderr:`timeout: missing operand
|
|
594
|
+
`,exitCode:1};let s=r[0],i=bo(s);if(i===null)return{stdout:"",stderr:`timeout: invalid time interval '${s}'
|
|
595
|
+
`,exitCode:1};let o=r.slice(1);if(o.length===0)return{stdout:"",stderr:`timeout: missing operand
|
|
596
|
+
`,exitCode:1};if(!t.exec)return{stdout:"",stderr:`timeout: exec not available
|
|
597
|
+
`,exitCode:1};let a=new AbortController,l;try{let c=new Promise(p=>{l=Sr(()=>{a.abort(),p({timedOut:!0})},i)}),u=t.exec(tn([o[0]]),{cwd:t.cwd,signal:a.signal,stdin:t.stdin,args:o.slice(1)}).then(p=>({timedOut:!1,result:p})),f=await Promise.race([c,u]);return f.timedOut?{stdout:"",stderr:"",exitCode:124}:f.result}finally{l!==void 0&&Qr(l)}}},v5={name:"timeout",flags:[{flag:"-k",type:"value",valueHint:"string"},{flag:"-s",type:"value",valueHint:"string"},{flag:"--preserve-status",type:"boolean"},{flag:"--foreground",type:"boolean"}],needsArgs:!0,minArgs:2}});var YO,JO,ys,xo,ai=v(()=>{"use strict";YO=globalThis.SharedArrayBuffer,JO=globalThis.Atomics,ys=performance.now.bind(performance),xo=globalThis.Headers});var wm={};J(wm,{flagsForFuzzing:()=>I5,timeCommand:()=>k5});function N5(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return t>0?`${t}:${n.toString().padStart(2,"0")}:${r.toFixed(2).padStart(5,"0")}`:`${n}:${r.toFixed(2).padStart(5,"0")}`}var k5,I5,bm=v(()=>{"use strict";yn();Kn();Nr();ai();k5={name:"time",async execute(e,t){let n="%e %M",r=null,s=!1,i=!1,o=0;for(;o<e.length;){let d=e[o];if(d==="-f"||d==="--format"){if(o++,o>=e.length)return{stdout:"",stderr:`time: missing argument to '-f'
|
|
598
|
+
`,exitCode:1};n=e[o],o++}else if(d==="-o"||d==="--output"){if(o++,o>=e.length)return{stdout:"",stderr:`time: missing argument to '-o'
|
|
599
|
+
`,exitCode:1};r=e[o],o++}else if(d==="-a"||d==="--append")s=!0,o++;else if(d==="-v"||d==="--verbose")n=`Command being timed: %C
|
|
600
|
+
Elapsed (wall clock) time: %e seconds
|
|
601
|
+
Maximum resident set size (kbytes): %M`,o++;else if(d==="-p"||d==="--portability")i=!0,o++;else if(d==="--"){o++;break}else if(d.startsWith("-"))o++;else break}let a=e.slice(o);if(a.length===0)return{stdout:"",stderr:"",exitCode:0};let l=ys(),c=a.join(" "),u;try{if(!t.exec)return{stdout:"",stderr:`time: exec not available
|
|
602
|
+
`,exitCode:1};u=await t.exec(tn([a[0]]),{env:Et(t.env),cwd:t.cwd,stdin:t.stdin,signal:t.signal,args:a.slice(1)})}catch(d){u={stdout:"",stderr:`time: ${Be(d.message)}
|
|
603
|
+
`,exitCode:127}}let p=(ys()-l)/1e3,h;if(i?h=`real ${p.toFixed(2)}
|
|
604
|
+
user 0.00
|
|
605
|
+
sys 0.00
|
|
606
|
+
`:(h=n.replace(/%e/g,p.toFixed(2)).replace(/%E/g,N5(p)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,c),h.endsWith(`
|
|
607
|
+
`)||(h+=`
|
|
608
|
+
`)),r)try{let d=t.fs.resolvePath(t.cwd,r);if(s&&await t.fs.exists(d)){let m=await t.fs.readFile(d);await t.fs.writeFile(d,m+h)}else await t.fs.writeFile(d,h)}catch(d){let m=Be(d.message);return{stdout:u.stdout,stderr:u.stderr+`time: cannot write to '${r}': ${m}
|
|
609
|
+
`,exitCode:u.exitCode}}else u={...u,stderr:u.stderr+h};return u}};I5={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0}});var xm={};J(xm,{flagsForFuzzing:()=>O5,seqCommand:()=>$5});var $5,O5,Em=v(()=>{"use strict";$5={name:"seq",async execute(e){let t=`
|
|
610
|
+
`,n=!1,r=[],s=0;for(;s<e.length;){let d=e[s];if(d==="-s"&&s+1<e.length){t=e[s+1],s+=2;continue}if(d==="-w"){n=!0,s++;continue}if(d==="--"){s++;break}if(d.startsWith("-")&&d!=="-"){if(d.startsWith("-s")&&d.length>2){t=d.slice(2),s++;continue}if((d==="-ws"||d==="-sw")&&(n=!0,s+1<e.length)){t=e[s+1],s+=2;continue}}r.push(d),s++}for(;s<e.length;)r.push(e[s]),s++;if(r.length===0)return{stdout:"",stderr:`seq: missing operand
|
|
611
|
+
`,exitCode:1};let i=1,o=1,a;if(r.length===1?a=parseFloat(r[0]):r.length===2?(i=parseFloat(r[0]),a=parseFloat(r[1])):(i=parseFloat(r[0]),o=parseFloat(r[1]),a=parseFloat(r[2])),Number.isNaN(i)||Number.isNaN(o)||Number.isNaN(a))return{stdout:"",stderr:`seq: invalid floating point argument: '${r.find(m=>Number.isNaN(parseFloat(m)))}'
|
|
612
|
+
`,exitCode:1};if(o===0)return{stdout:"",stderr:`seq: invalid Zero increment value: '0'
|
|
613
|
+
`,exitCode:1};let l=[],c=d=>{let m=String(d),g=m.indexOf(".");return g===-1?0:m.length-g-1},u=Math.max(c(i),c(o),c(a)),f=1e5,p=0;if(o>0)for(let d=i;d<=a+1e-10&&!(p++>f);d+=o)l.push(u>0?d.toFixed(u):String(Math.round(d)));else for(let d=i;d>=a-1e-10&&!(p++>f);d+=o)l.push(u>0?d.toFixed(u):String(Math.round(d)));if(n&&l.length>0){let d=Math.max(...l.map(m=>m.replace("-","").length));for(let m=0;m<l.length;m++){let g=l[m].startsWith("-"),w=(g?l[m].slice(1):l[m]).padStart(d,"0");l[m]=g?`-${w}`:w}}let h=l.join(t);return{stdout:h?`${h}
|
|
614
|
+
`:"",stderr:"",exitCode:0}}},O5={name:"seq",flags:[{flag:"-s",type:"value",valueHint:"string"},{flag:"-w",type:"boolean"}],needsArgs:!0}});var Am={};J(Am,{exprCommand:()=>R5,flagsForFuzzing:()=>P5});function T5(e){if(e.length===1)return e[0];let t=0;function n(){let c=r();for(;t<e.length&&e[t]==="|";){t++;let u=r();if(c!=="0"&&c!=="")return c;c=u}return c}function r(){let c=s();for(;t<e.length&&e[t]==="&";){t++;let u=s();(c==="0"||c===""||u==="0"||u==="")&&(c="0")}return c}function s(){let c=i();for(;t<e.length;){let u=e[t];if(["=","!=","<",">","<=",">="].includes(u)){t++;let f=i(),p=parseInt(c,10),h=parseInt(f,10),d=!Number.isNaN(p)&&!Number.isNaN(h),m;u==="="?m=d?p===h:c===f:u==="!="?m=d?p!==h:c!==f:u==="<"?m=d?p<h:c<f:u===">"?m=d?p>h:c>f:u==="<="?m=d?p<=h:c<=f:m=d?p>=h:c>=f,c=m?"1":"0"}else break}return c}function i(){let c=o();for(;t<e.length;){let u=e[t];if(u==="+"||u==="-"){t++;let f=o(),p=parseInt(c,10),h=parseInt(f,10);if(Number.isNaN(p)||Number.isNaN(h))throw new Error("non-integer argument");c=String(u==="+"?p+h:p-h)}else break}return c}function o(){let c=a();for(;t<e.length;){let u=e[t];if(u==="*"||u==="/"||u==="%"){t++;let f=a(),p=parseInt(c,10),h=parseInt(f,10);if(Number.isNaN(p)||Number.isNaN(h))throw new Error("non-integer argument");if((u==="/"||u==="%")&&h===0)throw new Error("division by zero");u==="*"?c=String(p*h):u==="/"?c=String(Math.trunc(p/h)):c=String(p%h)}else break}return c}function a(){let c=l();for(;t<e.length&&e[t]===":";){t++;let u=l(),p=K(`^${u}`).match(c);p?c=p[1]!==void 0?p[1]:String(p[0].length):c="0"}return c}function l(){if(t>=e.length)throw new Error("syntax error");let c=e[t];if(c==="match"){t++;let u=l(),f=l(),h=K(f).match(u);return h?h[1]!==void 0?h[1]:String(h[0].length):"0"}if(c==="substr"){t++;let u=l(),f=parseInt(l(),10),p=parseInt(l(),10);if(Number.isNaN(f)||Number.isNaN(p))throw new Error("non-integer argument");return u.substring(f-1,f-1+p)}if(c==="index"){t++;let u=l(),f=l();for(let p=0;p<u.length;p++)if(f.includes(u[p]))return String(p+1);return"0"}if(c==="length"){t++;let u=l();return String(u.length)}if(c==="("){t++;let u=n();if(t>=e.length||e[t]!==")")throw new Error("syntax error");return t++,u}return t++,c}return n()}var R5,P5,Sm=v(()=>{"use strict";yn();Ve();R5={name:"expr",async execute(e,t){if(e.length===0)return{stdout:"",stderr:`expr: missing operand
|
|
615
|
+
`,exitCode:2};try{let n=T5(e),r=n==="0"||n===""?1:0;return{stdout:`${n}
|
|
616
|
+
`,stderr:"",exitCode:r}}catch(n){return{stdout:"",stderr:`expr: ${Be(n.message)}
|
|
617
|
+
`,exitCode:2}}}};P5={name:"expr",flags:[],needsArgs:!0}});function _5(e){function t(h,d){return h<<d|h>>>32-d}let n=new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]),r=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],s=e.length*8,i=(e.length%64<56?56:120)-e.length%64,o=new Uint8Array(e.length+i+8);o.set(e),o[e.length]=128;let a=new DataView(o.buffer);a.setUint32(o.length-8,s>>>0,!0),a.setUint32(o.length-4,Math.floor(s/4294967296),!0);let l=1732584193,c=4023233417,u=2562383102,f=271733878;for(let h=0;h<o.length;h+=64){let d=new Uint32Array(16);for(let b=0;b<16;b++)d[b]=a.getUint32(h+b*4,!0);let m=l,g=c,y=u,w=f;for(let b=0;b<64;b++){let x,A;b<16?(x=g&y|~g&w,A=b):b<32?(x=w&g|~w&y,A=(5*b+1)%16):b<48?(x=g^y^w,A=(3*b+5)%16):(x=y^(g|~w),A=7*b%16),x=x+m+n[b]+d[A]>>>0,m=w,w=y,y=g,g=g+t(x,r[b])>>>0}l=l+m>>>0,c=c+g>>>0,u=u+y>>>0,f=f+w>>>0}let p=new Uint8Array(16);return new DataView(p.buffer).setUint32(0,l,!0),new DataView(p.buffer).setUint32(4,c,!0),new DataView(p.buffer).setUint32(8,u,!0),new DataView(p.buffer).setUint32(12,f,!0),Array.from(p).map(h=>h.toString(16).padStart(2,"0")).join("")}async function Cm(e,t){if(e==="md5")return _5(t);let n=D5.get(e);if(!n)throw new Error(`Unknown algorithm: ${e}`);let r=await globalThis.crypto.subtle.digest(n,new Uint8Array(t).buffer);return Array.from(new Uint8Array(r)).map(s=>s.toString(16).padStart(2,"0")).join("")}function ws(e,t,n){let r={name:e,summary:n,usage:`${e} [OPTION]... [FILE]...`,options:["-c, --check read checksums from FILEs and check them"," --help display this help and exit"]};return{name:e,async execute(s,i){if(B(s))return U(r);let o=!1,a=[];for(let f of s)if(f==="-c"||f==="--check")o=!0;else if(!(f==="-b"||f==="-t"||f==="--binary"||f==="--text")){if(f.startsWith("-")&&f!=="-")return Z(e,f);a.push(f)}a.length===0&&a.push("-");let l=async f=>{if(f==="-")return Uint8Array.from(i.stdin,p=>p.charCodeAt(0));try{return await i.fs.readFileBuffer(i.fs.resolvePath(i.cwd,f))}catch{return null}};if(o){let f=0,p="";for(let h of a){let d=h==="-"?i.stdin:await i.fs.readFile(i.fs.resolvePath(i.cwd,h)).catch(()=>null);if(d===null)return{stdout:"",stderr:`${e}: ${h}: No such file or directory
|
|
618
|
+
`,exitCode:1};for(let m of d.split(`
|
|
619
|
+
`)){let g=m.match(/^([a-fA-F0-9]+)\s+[* ]?(.+)$/);if(!g)continue;let[,y,w]=g,b=await l(w);if(b===null){p+=`${w}: FAILED open or read
|
|
620
|
+
`,f++;continue}let x=await Cm(t,b)===y.toLowerCase();p+=`${w}: ${x?"OK":"FAILED"}
|
|
621
|
+
`,x||f++}}return f>0&&(p+=`${e}: WARNING: ${f} computed checksum${f>1?"s":""} did NOT match
|
|
622
|
+
`),{stdout:p,stderr:"",exitCode:f>0?1:0}}let c="",u=0;for(let f of a){let p=await l(f);if(p===null){c+=`${e}: ${f}: No such file or directory
|
|
623
|
+
`,u=1;continue}c+=`${await Cm(t,p)} ${f}
|
|
624
|
+
`}return{stdout:c,stderr:"",exitCode:u}}}}var D5,Eo=v(()=>{"use strict";ne();D5=new Map([["sha1","SHA-1"],["sha256","SHA-256"]])});var vm={};J(vm,{flagsForFuzzing:()=>L5,md5sumCommand:()=>F5});var F5,L5,km=v(()=>{"use strict";Eo();F5=ws("md5sum","md5","compute MD5 message digest"),L5={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}});var Nm={};J(Nm,{flagsForFuzzing:()=>U5,sha1sumCommand:()=>M5});var M5,U5,Im=v(()=>{"use strict";Eo();M5=ws("sha1sum","sha1","compute SHA1 message digest"),U5={name:"sha1sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}});var $m={};J($m,{flagsForFuzzing:()=>W5,sha256sumCommand:()=>B5});var B5,W5,Om=v(()=>{"use strict";Eo();B5=ws("sha256sum","sha256","compute SHA256 message digest"),W5={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}});var Rm=Oi(oc=>{oc.read=function(e,t,n,r,s){var i,o,a=s*8-r-1,l=(1<<a)-1,c=l>>1,u=-7,f=n?s-1:0,p=n?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=a;u>0;i=i*256+e[t+f],f+=p,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=r;u>0;o=o*256+e[t+f],f+=p,u-=8);if(i===0)i=1-c;else{if(i===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-c}return(h?-1:1)*o*Math.pow(2,i-r)};oc.write=function(e,t,n,r,s,i){var o,a,l,c=i*8-s-1,u=(1<<c)-1,f=u>>1,p=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?t+=p/l:t+=p*Math.pow(2,1-f),t*l>=2&&(o++,l/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(t*l-1)*Math.pow(2,s),o=o+f):(a=t*Math.pow(2,f-1)*Math.pow(2,s),o=0));s>=8;e[n+h]=a&255,h+=d,a/=256,s-=8);for(o=o<<s|a,c+=s;c>0;e[n+h]=o&255,h+=d,o/=256,c-=8);e[n+h-d]|=m*128}});function H5(){if(!(typeof globalThis.TextDecoder>"u"))return Ao??(Ao=new globalThis.TextDecoder("utf-8"))}function Pm(e,t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let n=H5();return n?n.decode(e):G5(e)}case"utf-16le":return V5(e);case"us-ascii":case"ascii":return q5(e);case"latin1":case"iso-8859-1":return Z5(e);case"windows-1252":return K5(e);default:throw new RangeError(`Encoding '${t}' not supported`)}}function ac(e,t){t.length!==0&&(e.push(String.fromCharCode.apply(null,t)),t.length=0)}function pt(e,t,n){t.push(n),t.length>=bs&&ac(e,t)}function j5(e,t,n){if(n<=65535){pt(e,t,n);return}n-=65536,pt(e,t,55296+(n>>10)),pt(e,t,56320+(n&1023))}function G5(e){let t=[],n=[],r=0;for(e.length>=3&&e[0]===239&&e[1]===187&&e[2]===191&&(r=3);r<e.length;){let s=e[r];if(s<=127){pt(t,n,s),r++;continue}if(s<194||s>244){pt(t,n,An),r++;continue}if(s<=223){if(r+1>=e.length){pt(t,n,An),r++;continue}let u=e[r+1];if((u&192)!==128){pt(t,n,An),r++;continue}let f=(s&31)<<6|u&63;pt(t,n,f),r+=2;continue}if(s<=239){if(r+2>=e.length){pt(t,n,An),r++;continue}let u=e[r+1],f=e[r+2];if(!((u&192)===128&&(f&192)===128&&!(s===224&&u<160)&&!(s===237&&u>=160))){pt(t,n,An),r++;continue}let h=(s&15)<<12|(u&63)<<6|f&63;pt(t,n,h),r+=3;continue}if(r+3>=e.length){pt(t,n,An),r++;continue}let i=e[r+1],o=e[r+2],a=e[r+3];if(!((i&192)===128&&(o&192)===128&&(a&192)===128&&!(s===240&&i<144)&&!(s===244&&i>143))){pt(t,n,An),r++;continue}let c=(s&7)<<18|(i&63)<<12|(o&63)<<6|a&63;j5(t,n,c),r+=4}return ac(t,n),t.join("")}function V5(e){let t=[],n=[],r=e.length,s=0;for(;s+1<r;){let i=e[s]|e[s+1]<<8;if(s+=2,i>=55296&&i<=56319){if(s+1<r){let o=e[s]|e[s+1]<<8;o>=56320&&o<=57343?(pt(t,n,i),pt(t,n,o),s+=2):pt(t,n,An)}else pt(t,n,An);continue}if(i>=56320&&i<=57343){pt(t,n,An);continue}pt(t,n,i)}return s<r&&pt(t,n,An),ac(t,n),t.join("")}function q5(e){let t=[];for(let n=0;n<e.length;n+=bs){let r=Math.min(e.length,n+bs),s=new Array(r-n);for(let i=n,o=0;i<r;i++,o++)s[o]=e[i]&127;t.push(String.fromCharCode.apply(null,s))}return t.join("")}function Z5(e){let t=[];for(let n=0;n<e.length;n+=bs){let r=Math.min(e.length,n+bs),s=new Array(r-n);for(let i=n,o=0;i<r;i++,o++)s[o]=e[i];t.push(String.fromCharCode.apply(null,s))}return t.join("")}function K5(e){let t=[],n="";for(let r=0;r<e.length;r++){let s=e[r],i=s>=128&&s<=159?Tm[s]:void 0;n+=i??String.fromCharCode(s),n.length>=bs&&(t.push(n),n="")}return n&&t.push(n),t.join("")}var Tm,z5,Ao,bs,An,Dm=v(()=>{Tm={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},z5={};for(let[e,t]of Object.entries(Tm))z5[t]=Number.parseInt(e,10);bs=32*1024,An=65533});function Ht(e){return new DataView(e.buffer,e.byteOffset)}var _m,Fm,tt,Pr,Je,lc,Lm,Mm,jt,li=v(()=>{_m=Af(Rm(),1);Dm();Fm={len:1,get(e,t){return Ht(e).getUint8(t)},put(e,t,n){return Ht(e).setUint8(t,n),t+1}},tt={len:2,get(e,t){return Ht(e).getUint16(t,!0)},put(e,t,n){return Ht(e).setUint16(t,n,!0),t+2}},Pr={len:2,get(e,t){return Ht(e).getUint16(t)},put(e,t,n){return Ht(e).setUint16(t,n),t+2}},Je={len:4,get(e,t){return Ht(e).getUint32(t,!0)},put(e,t,n){return Ht(e).setUint32(t,n,!0),t+4}},lc={len:4,get(e,t){return Ht(e).getUint32(t)},put(e,t,n){return Ht(e).setUint32(t,n),t+4}},Lm={len:4,get(e,t){return Ht(e).getInt32(t)},put(e,t,n){return Ht(e).setInt32(t,n),t+4}},Mm={len:8,get(e,t){return Ht(e).getBigUint64(t,!0)},put(e,t,n){return Ht(e).setBigUint64(t,n,!0),t+8}},jt=class{constructor(t,n){this.len=t,this.encoding=n}get(t,n=0){let r=t.subarray(n,n+this.len);return Pm(r,this.encoding)}}});var X5,Le,Dr,ci=v(()=>{X5="End-Of-Stream",Le=class extends Error{constructor(){super(X5),this.name="EndOfStreamError"}},Dr=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}}});var Um=v(()=>{});var _r,So=v(()=>{ci();_r=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(t,n=!1){let r=await this.read(t,n);return this.peekQueue.push(t.subarray(0,r)),r}async read(t,n=!1){if(t.length===0)return 0;let r=this.readFromPeekBuffer(t);if(this.endOfStream||(r+=await this.readRemainderFromStream(t.subarray(r),n)),r===0&&!n)throw new Le;return r}readFromPeekBuffer(t){let n=t.length,r=0;for(;this.peekQueue.length>0&&n>0;){let s=this.peekQueue.pop();if(!s)throw new Error("peekData should be defined");let i=Math.min(s.length,n);t.set(s.subarray(0,i),r),r+=i,n-=i,i<s.length&&this.peekQueue.push(s.subarray(i))}return r}async readRemainderFromStream(t,n){let r=0;for(;r<t.length&&!this.endOfStream;){if(this.interrupted)throw new Dr;let s=await this.readFromStream(t.subarray(r),n);if(s===0)break;r+=s}if(!n&&r<t.length)throw new Le;return r}}});var Bm=v(()=>{ci();Um();So()});var Co,Wm=v(()=>{So();Co=class extends _r{constructor(t){super(),this.reader=t}async abort(){return this.close()}async close(){this.reader.releaseLock()}}});var ui,cc=v(()=>{Wm();ui=class extends Co{async readFromStream(t,n){if(t.length===0)return 0;let r=await this.reader.read(new Uint8Array(t.length),{min:n?void 0:t.length});return r.done&&(this.endOfStream=r.done),r.value?(t.set(r.value),r.value.length):0}}});var xs,uc=v(()=>{ci();So();xs=class extends _r{constructor(t){super(),this.reader=t,this.buffer=null}writeChunk(t,n){let r=Math.min(n.length,t.length);return t.set(n.subarray(0,r)),r<n.length?this.buffer=n.subarray(r):this.buffer=null,r}async readFromStream(t,n){if(t.length===0)return 0;let r=0;for(this.buffer&&(r+=this.writeChunk(t,this.buffer));r<t.length&&!this.endOfStream;){let s=await this.reader.read();if(s.done){this.endOfStream=!0;break}s.value&&(r+=this.writeChunk(t.subarray(r),s.value))}if(!n&&r===0&&this.endOfStream)throw new Le;return r}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}});function fc(e){try{let t=e.getReader({mode:"byob"});return t instanceof ReadableStreamDefaultReader?new xs(t):new ui(t)}catch(t){if(t instanceof TypeError)return new xs(e.getReader());throw t}}var zm=v(()=>{cc();uc()});var Fr=v(()=>{ci();Bm();cc();uc();zm()});var Qn,fi=v(()=>{Fr();Qn=class{constructor(t){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=t?.onClose,t?.abortSignal&&t.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(t,n=this.position){let r=new Uint8Array(t.len);if(await this.readBuffer(r,{position:n})<t.len)throw new Le;return t.get(r,0)}async peekToken(t,n=this.position){let r=new Uint8Array(t.len);if(await this.peekBuffer(r,{position:n})<t.len)throw new Le;return t.get(r,0)}async readNumber(t){if(await this.readBuffer(this.numBuffer,{length:t.len})<t.len)throw new Le;return t.get(this.numBuffer,0)}async peekNumber(t){if(await this.peekBuffer(this.numBuffer,{length:t.len})<t.len)throw new Le;return t.get(this.numBuffer,0)}async ignore(t){if(t<0)throw new RangeError("ignore length must be \u2265 0 bytes");if(this.fileInfo.size!==void 0){let n=this.fileInfo.size-this.position;if(t>n)return this.position+=n,n}return this.position+=t,t}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(t,n){if(!this.supportsRandomAccess()&&n&&n.position!==void 0&&n.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:t.length,position:this.position,...n}}abort(){return Promise.resolve()}}});var J5,vo,Hm=v(()=>{fi();Fr();J5=256e3,vo=class extends Qn{constructor(t,n){super(n),this.streamReader=t,this.fileInfo=n?.fileInfo??{}}async readBuffer(t,n){let r=this.normalizeOptions(t,n),s=r.position-this.position;if(s>0)return await this.ignore(s),this.readBuffer(t,n);if(s<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return 0;let i=await this.streamReader.read(t.subarray(0,r.length),r.mayBeLess);if(this.position+=i,(!n||!n.mayBeLess)&&i<r.length)throw new Le;return i}async peekBuffer(t,n){let r=this.normalizeOptions(t,n),s=0;if(r.position){let i=r.position-this.position;if(i>0){let o=new Uint8Array(r.length+i);return s=await this.peekBuffer(o,{mayBeLess:r.mayBeLess}),t.set(o.subarray(i)),s-i}if(i<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{s=await this.streamReader.peek(t.subarray(0,r.length),r.mayBeLess)}catch(i){if(n?.mayBeLess&&i instanceof Le)return 0;throw i}if(!r.mayBeLess&&s<r.length)throw new Le}return s}async ignore(t){if(t<0)throw new RangeError("ignore length must be \u2265 0 bytes");let n=Math.min(J5,t),r=new Uint8Array(n),s=0;for(;s<t;){let i=t-s,o=await this.readBuffer(r,{length:Math.min(n,i)});if(o<0)return o;s+=o}return s}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}});var ko,jm=v(()=>{Fr();fi();ko=class extends Qn{constructor(t,n){super(n),this.uint8Array=t,this.fileInfo={...n?.fileInfo??{},size:t.length}}async readBuffer(t,n){n?.position&&(this.position=n.position);let r=await this.peekBuffer(t,n);return this.position+=r,r}async peekBuffer(t,n){let r=this.normalizeOptions(t,n),s=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&s<r.length)throw new Le;return t.set(this.uint8Array.subarray(r.position,r.position+s)),s}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(t){this.position=t}}});var No,Gm=v(()=>{Fr();fi();No=class extends Qn{constructor(t,n){super(n),this.blob=t,this.fileInfo={...n?.fileInfo??{},size:t.size,mimeType:t.type}}async readBuffer(t,n){n?.position&&(this.position=n.position);let r=await this.peekBuffer(t,n);return this.position+=r,r}async peekBuffer(t,n){let r=this.normalizeOptions(t,n),s=Math.min(this.blob.size-r.position,r.length);if(!r.mayBeLess&&s<r.length)throw new Le;let i=await this.blob.slice(r.position,r.position+s).arrayBuffer();return t.set(new Uint8Array(i)),s}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(t){this.position=t}}});function Vm(e,t){let n=fc(e),r=t??{},s=r.onClose;return r.onClose=async()=>{if(await n.close(),s)return s()},new vo(n,r)}function qm(e,t){return new ko(e,t)}function Zm(e,t){return new No(e,t)}var Km=v(()=>{Fr();Hm();jm();Gm();Fr();fi()});var Xm=Oi((rT,Qm)=>{var Es=1e3,As=Es*60,Ss=As*60,Lr=Ss*24,tx=Lr*7,nx=Lr*365.25;Qm.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return rx(e);if(n==="number"&&isFinite(e))return t.long?ix(e):sx(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function rx(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*nx;case"weeks":case"week":case"w":return n*tx;case"days":case"day":case"d":return n*Lr;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Ss;case"minutes":case"minute":case"mins":case"min":case"m":return n*As;case"seconds":case"second":case"secs":case"sec":case"s":return n*Es;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function sx(e){var t=Math.abs(e);return t>=Lr?Math.round(e/Lr)+"d":t>=Ss?Math.round(e/Ss)+"h":t>=As?Math.round(e/As)+"m":t>=Es?Math.round(e/Es)+"s":e+"ms"}function ix(e){var t=Math.abs(e);return t>=Lr?Io(e,t,Lr,"day"):t>=Ss?Io(e,t,Ss,"hour"):t>=As?Io(e,t,As,"minute"):t>=Es?Io(e,t,Es,"second"):e+" ms"}function Io(e,t,n,r){var s=t>=n*1.5;return Math.round(e/n)+" "+r+(s?"s":"")}});var Jm=Oi((sT,Ym)=>{function ox(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=a,n.humanize=Xm(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let f=0;for(let p=0;p<u.length;p++)f=(f<<5)-f+u.charCodeAt(p),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=t;function n(u){let f,p=null,h,d;function m(...g){if(!m.enabled)return;let y=m,w=Number(new Date),b=w-(f||w);y.diff=b,y.prev=f,y.curr=w,f=w,g[0]=n.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let x=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,O)=>{if($==="%%")return"%";x++;let F=n.formatters[O];if(typeof F=="function"){let P=g[x];$=F.call(y,P),g.splice(x,1),x--}return $}),n.formatArgs.call(y,g),(y.log||n.log).apply(y,g)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==n.namespaces&&(h=n.namespaces,d=n.enabled(u)),d),set:g=>{p=g}}),typeof n.init=="function"&&n.init(m),m}function r(u,f){let p=n(this.namespace+(typeof f>"u"?":":f)+u);return p.log=this.log,p}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of f)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function i(u,f){let p=0,h=0,d=-1,m=0;for(;p<u.length;)if(h<f.length&&(f[h]===u[p]||f[h]==="*"))f[h]==="*"?(d=h,m=p,h++):(p++,h++);else if(d!==-1)h=d+1,m++,p=m;else return!1;for(;h<f.length&&f[h]==="*";)h++;return h===f.length}function o(){let u=[...n.names,...n.skips.map(f=>"-"+f)].join(",");return n.enable(""),u}function a(u){for(let f of n.skips)if(i(u,f))return!1;for(let f of n.names)if(i(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Ym.exports=ox});var e0=Oi((Gt,$o)=>{Gt.formatArgs=lx;Gt.save=cx;Gt.load=ux;Gt.useColors=ax;Gt.storage=fx();Gt.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Gt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ax(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function lx(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+$o.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),e.splice(r,0,t)}Gt.log=console.debug||console.log||(()=>{});function cx(e){try{e?Gt.storage.setItem("debug",e):Gt.storage.removeItem("debug")}catch{}}function ux(){let e;try{e=Gt.storage.getItem("debug")||Gt.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function fx(){try{return localStorage}catch{}}$o.exports=Jm()(Gt);var{formatters:px}=$o.exports;px.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Mr,pc,t0,n0,r0,s0=v(()=>{li();Mr={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},pc={get(e){return{signature:Je.get(e,0),compressedSize:Je.get(e,8),uncompressedSize:Je.get(e,12)}},len:16},t0={get(e){let t=tt.get(e,6);return{signature:Je.get(e,0),minVersion:tt.get(e,4),dataDescriptor:!!(t&8),compressedMethod:tt.get(e,8),compressedSize:Je.get(e,18),uncompressedSize:Je.get(e,22),filenameLength:tt.get(e,26),extraFieldLength:tt.get(e,28),filename:null}},len:30},n0={get(e){return{signature:Je.get(e,0),nrOfThisDisk:tt.get(e,4),nrOfThisDiskWithTheStart:tt.get(e,6),nrOfEntriesOnThisDisk:tt.get(e,8),nrOfEntriesOfSize:tt.get(e,10),sizeOfCd:Je.get(e,12),offsetOfStartOfCd:Je.get(e,16),zipFileCommentLength:tt.get(e,20)}},len:22},r0={get(e){let t=tt.get(e,8);return{signature:Je.get(e,0),minVersion:tt.get(e,6),dataDescriptor:!!(t&8),compressedMethod:tt.get(e,10),compressedSize:Je.get(e,20),uncompressedSize:Je.get(e,24),filenameLength:tt.get(e,28),extraFieldLength:tt.get(e,30),fileCommentLength:tt.get(e,32),relativeOffsetOfLocalHeader:Je.get(e,42),filename:null}},len:46}});function o0(e){let t=new Uint8Array(Je.len);return Je.put(t,0,e),t}function dx(e,t){let n=e.length,r=t.length;if(r>n)return-1;for(let s=0;s<=n-r;s++){let i=!0;for(let o=0;o<r;o++)if(e[s+o]!==t[o]){i=!1;break}if(i)return s}return-1}function mx(e){let t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t),r=0;for(let s of e)n.set(s,r),r+=s.length;return n}var i0,Ln,hc,hx,Oo,Ur,a0=v(()=>{li();i0=Af(e0(),1);s0();Ln=(0,i0.default)("tokenizer:inflate"),hc=256*1024,hx=o0(Mr.DataDescriptor),Oo=o0(Mr.EndOfCentralDirectory),Ur=class e{constructor(t){this.tokenizer=t,this.syncBuffer=new Uint8Array(hc)}async isZip(){return await this.peekSignature()===Mr.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(Je)}async findEndOfCentralDirectoryLocator(){let t=this.tokenizer,n=Math.min(16*1024,t.fileInfo.size),r=this.syncBuffer.subarray(0,n);await this.tokenizer.readBuffer(r,{position:t.fileInfo.size-n});for(let s=r.length-4;s>=0;s--)if(r[s]===Oo[0]&&r[s+1]===Oo[1]&&r[s+2]===Oo[2]&&r[s+3]===Oo[3])return t.fileInfo.size-n+s;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Ln("Cannot reading central-directory without random-read support");return}Ln("Reading central-directory...");let t=this.tokenizer.position,n=await this.findEndOfCentralDirectoryLocator();if(n>0){Ln("Central-directory 32-bit signature found");let r=await this.tokenizer.readToken(n0,n),s=[];this.tokenizer.setPosition(r.offsetOfStartOfCd);for(let i=0;i<r.nrOfEntriesOfSize;++i){let o=await this.tokenizer.readToken(r0);if(o.signature!==Mr.CentralFileHeader)throw new Error("Expected Central-File-Header signature");o.filename=await this.tokenizer.readToken(new jt(o.filenameLength,"utf-8")),await this.tokenizer.ignore(o.extraFieldLength),await this.tokenizer.ignore(o.fileCommentLength),s.push(o),Ln(`Add central-directory file-entry: n=${i+1}/${s.length}: filename=${s[i].filename}`)}return this.tokenizer.setPosition(t),s}this.tokenizer.setPosition(t)}async unzip(t){let n=await this.readCentralDirectory();if(n)return this.iterateOverCentralDirectory(n,t);let r=!1;do{let s=await this.readLocalFileHeader();if(!s)break;let i=t(s);r=!!i.stop;let o;if(await this.tokenizer.ignore(s.extraFieldLength),s.dataDescriptor&&s.compressedSize===0){let a=[],l=hc;Ln("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let c=-1;for(;c<0&&l===hc;){l=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),c=dx(this.syncBuffer.subarray(0,l),hx);let u=c>=0?c:l;if(i.handler){let f=new Uint8Array(u);await this.tokenizer.readBuffer(f),a.push(f)}else await this.tokenizer.ignore(u)}Ln(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),i.handler&&await this.inflate(s,mx(a),i.handler)}else i.handler?(Ln(`Reading compressed-file-data: ${s.compressedSize} bytes`),o=new Uint8Array(s.compressedSize),await this.tokenizer.readBuffer(o),await this.inflate(s,o,i.handler)):(Ln(`Ignoring compressed-file-data: ${s.compressedSize} bytes`),await this.tokenizer.ignore(s.compressedSize));if(Ln(`Reading data-descriptor at pos=${this.tokenizer.position}`),s.dataDescriptor&&(await this.tokenizer.readToken(pc)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-pc.len}`)}while(!r)}async iterateOverCentralDirectory(t,n){for(let r of t){let s=n(r);if(s.handler){this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);let i=await this.readLocalFileHeader();if(i){await this.tokenizer.ignore(i.extraFieldLength);let o=new Uint8Array(r.compressedSize);await this.tokenizer.readBuffer(o),await this.inflate(i,o,s.handler)}}if(s.stop)break}}async inflate(t,n,r){if(t.compressedMethod===0)return r(n);if(t.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);Ln(`Decompress filename=${t.filename}, compressed-size=${n.length}`);let s=await e.decompressDeflateRaw(n);return r(s)}static async decompressDeflateRaw(t){let n=new ReadableStream({start(i){i.enqueue(t),i.close()}}),r=new DecompressionStream("deflate-raw"),s=n.pipeThrough(r);try{let o=await new Response(s).arrayBuffer();return new Uint8Array(o)}catch(i){let o=i instanceof Error?`Failed to deflate ZIP entry: ${i.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(o)}}async readLocalFileHeader(){let t=await this.tokenizer.peekToken(Je);if(t===Mr.LocalFileHeader){let n=await this.tokenizer.readToken(t0);return n.filename=await this.tokenizer.readToken(new jt(n.filenameLength,"utf-8")),n}if(t===Mr.CentralFileHeader)return!1;throw t===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var pi,l0=v(()=>{pi=class{constructor(t){this.tokenizer=t}inflate(){let t=this.tokenizer;return new ReadableStream({async pull(n){let r=new Uint8Array(1024),s=await t.readBuffer(r,{mayBeLess:!0});if(s===0){n.close();return}n.enqueue(r.subarray(0,s))}}).pipeThrough(new DecompressionStream("gzip"))}}});var c0=v(()=>{a0();l0()});function dc(e){let{byteLength:t}=e;if(t===6)return e.getUint16(0)*2**32+e.getUint32(2);if(t===5)return e.getUint8(0)*2**32+e.getUint32(1);if(t===4)return e.getUint32(0);if(t===3)return e.getUint8(0)*2**16+e.getUint16(1);if(t===2)return e.getUint16(0);if(t===1)return e.getUint8(0)}var dT,mT,gT,u0=v(()=>{dT={utf8:new globalThis.TextDecoder("utf8")},mT=new globalThis.TextEncoder,gT=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});function f0(e,t){if(t==="utf-16le"){let n=[];for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);n.push(s&255,s>>8&255)}return n}if(t==="utf-16be"){let n=[];for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);n.push(s>>8&255,s&255)}return n}return[...e].map(n=>n.charCodeAt(0))}function p0(e,t=0){let n=Number.parseInt(new jt(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let s=t;s<t+148;s++)r+=e[s];for(let s=t+156;s<t+512;s++)r+=e[s];return n===r}var h0,d0=v(()=>{li();h0={get:(e,t)=>e[t+3]&127|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}});var m0,g0,y0=v(()=>{m0=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],g0=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function $x(e){let t=e?.streamReader;if(t?.constructor?.name!=="WebStreamByobReader")return e;let{reader:n}=t,r=async()=>{await n.cancel(),n.releaseLock()};return t.close=r,t.abort=async()=>{t.interrupted=!0,await r()},e}function wc(e,t,n){if(!Number.isFinite(e)||e<0||e>t)throw new Xn(`${n} has invalid size ${e} (maximum ${t} bytes)`);return e}async function lr(e,t,{maximumLength:n=hn,reason:r="skip"}={}){let s=wc(t,n,r);await e.ignore(s)}async function gc(e,t,n,{maximumLength:r=t.length,reason:s="read"}={}){let i=n?.length??t.length,o=wc(i,r,s);return e.readBuffer(t,{...n,length:o})}async function Ox(e,{maximumLength:t=Un}={}){let s=new ReadableStream({start(c){c.enqueue(e),c.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),i=[],o=0;try{for(;;){let{done:c,value:u}=await s.read();if(c)break;if(o+=u.length,o>t)throw await s.cancel(),new Error(`ZIP entry decompressed data exceeds ${t} bytes`);i.push(u)}}finally{s.releaseLock()}let a=new Uint8Array(o),l=0;for(let c of i)a.set(c,l),l+=c.length;return a}function Tx(e,t){if(e.length<Ro)return-1;let n=e.length-Ro;for(let r=0;r<=n;r++)if(Je.get(e,r)===O0&&Je.get(e,r+8)===t+r)return r;return-1}function Px(e){return(e.codePointAt(0)&32)!==0}function Dx(e,t){let n=new Uint8Array(t),r=0;for(let s of e)n.set(s,r),r+=s.length;return n}async function _x(e,{shouldBuffer:t,maximumLength:n=Un}={}){let{syncBuffer:r}=e,{length:s}=r,i=[],o=0;for(;;){let a=await e.tokenizer.peekBuffer(r,{mayBeLess:!0}),l=Tx(r.subarray(0,a),o),c=l>=0?0:a===s?Math.min(Rx,a-1):0,u=l>=0?l:a-c;if(u===0)break;if(o+=u,o>n)throw new Error(`ZIP entry compressed data exceeds ${n} bytes`);if(t){let f=new Uint8Array(u);await e.tokenizer.readBuffer(f),i.push(f)}else await e.tokenizer.ignore(u);if(l>=0)break}if(Dt(e.tokenizer)||(e.knownSizeDescriptorScannedBytes+=o),!!t)return Dx(i,o)}function Fx(e,t){return Dt(e.tokenizer)?Math.max(0,hn-(e.tokenizer.position-t)):Math.max(0,Un-e.knownSizeDescriptorScannedBytes)}async function Lx(e,t,{shouldBuffer:n,maximumDescriptorLength:r=Un}={}){if(t.dataDescriptor&&t.compressedSize===0)return _x(e,{shouldBuffer:n,maximumLength:r});if(!n){await lr(e.tokenizer,t.compressedSize,{maximumLength:Dt(e.tokenizer)?Un:e.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let s=Hx(e.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>s)throw new Error(`ZIP entry compressed data exceeds ${s} bytes`);let i=new Uint8Array(t.compressedSize);return await e.tokenizer.readBuffer(i),i}function Mx(e,t){let n=e.getReader(),r=0,s=!1,i=!1,o=async a=>{s||i||(i=!0,await n.cancel(a))};return new ReadableStream({async pull(a){if(r>=t){a.close(),await o();return}let{done:l,value:c}=await n.read();if(l||!c){s=!0,a.close();return}let u=t-r;if(c.length>u){a.enqueue(c.subarray(0,u)),r+=u,a.close(),await o();return}a.enqueue(c),r+=c.length},async cancel(a){await o(a)}})}async function R0(e,t){return new yc(t).fromBuffer(e)}function N0(e){switch(e=e.toLowerCase(),e){case"application/epub+zip":return{ext:"epub",mime:e};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:e};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:e};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:e};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:e};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:e};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:e};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:e};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:e};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:e};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:e};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:e};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:e};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:e};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:e};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:e};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function Mn(e,t,n){n={offset:0,...n};for(let[r,s]of t.entries())if(n.mask){if(s!==(n.mask[r]&e[r+n.offset]))return!1}else if(s!==e[r+n.offset])return!1;return!0}function Ux(e){return Number.isFinite(e)?Math.max(1,Math.trunc(e)):hi}function Bx(e,t,n){return n===void 0?e.read(t):(n.throwIfAborted(),new Promise((r,s)=>{let i=()=>{n.removeEventListener("abort",o)},o=()=>{let a=n.reason;i(),(async()=>{try{await e.cancel(a)}catch{}})(),s(a)};n.addEventListener("abort",o,{once:!0}),(async()=>{try{let a=await e.read(t);i(),r(a)}catch(a){i(),s(a)}})()}))}function Wx(e){return Number.isFinite(e)?Math.max(0,Math.min(gx,Math.trunc(e))):0}function zx(e){return Number.isFinite(e)?Math.max(0,e):Number.MAX_SAFE_INTEGER}function Dt(e){let t=e.fileInfo.size;return!Number.isFinite(t)||t===Number.MAX_SAFE_INTEGER}function di(e,t,n){return Dt(e)&&e.position-t>n}function Hx(e){let t=e.fileInfo.size,n=Number.isFinite(t)?Math.max(0,t-e.position):Number.MAX_SAFE_INTEGER;return Math.min(n,yx)}function jx(e){if(e instanceof Le||e instanceof Xn)return!0;if(!(e instanceof Error))return!1;if(kx.has(e.message)||Ix.has(e.code))return!0;for(let t of Nx)if(e.message.startsWith(t))return!0;return!1}function I0(e,t=Un){let n=[e.compressedSize,e.uncompressedSize];for(let r of n)if(!Number.isFinite(r)||r<0||r>t)return!1;return!0}function Gx(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function Vx(e,t){t.startsWith("word/")&&(e.hasWordDirectory=!0),t.startsWith("ppt/")&&(e.hasPresentationDirectory=!0),t.startsWith("xl/")&&(e.hasSpreadsheetDirectory=!0),t.startsWith("3D/")&&t.endsWith(".model")&&(e.hasThreeDimensionalModelEntry=!0)}function $0(e){if(!(!e.hasContentTypesEntry||e.hasUnparseableContentTypes||e.isParsingContentTypes||e.hasParsedContentTypesEntry)){if(e.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(e.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(e.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(e.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function qx(e){let t=e.indexOf('.main+xml"');if(t===-1){let s="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return e.includes(`ContentType="${s}"`)?s:void 0}let n=e.slice(0,t),r=n.lastIndexOf('"');return n.slice(r+1)}var hi,gx,Un,w0,yx,hn,To,b0,wx,bx,x0,mc,E0,A0,xx,Ex,Ax,Sx,Cx,S0,C0,v0,vx,k0,kx,Nx,Ix,Xn,O0,Ro,Rx,yc,vT,kT,T0=v(()=>{li();Km();c0();u0();d0();y0();hi=4100,gx=hi-2,Un=1024*1024,w0=1024,yx=2**31-1,hn=16*1024*1024,To=Un,b0=Un,wx=hn,bx=1,x0=100,mc=hn,E0=64,A0=To,xx=256,Ex=512,Ax=hn,Sx=512,Cx=512,S0=256,C0=To,v0=To,vx=To,k0=hn,kx=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),Nx=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],Ix=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),Xn=class extends Error{};O0=134695760,Ro=16,Rx=Ro-1;Ur.prototype.inflate=async function(e,t,n){if(e.compressedMethod===0)return n(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);let r=await Ox(t,{maximumLength:Un});return n(r)};Ur.prototype.unzip=async function(e){let t=!1,n=0,r=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(di(this.tokenizer,r,hn))throw new Xn(`ZIP stream probing exceeds ${hn} bytes`);let s=await this.readLocalFileHeader();if(!s)break;if(n++,n>w0)throw new Error(`ZIP entry count exceeds ${w0}`);let i=e(s);t=!!i.stop,await this.tokenizer.ignore(s.extraFieldLength);let o=await Lx(this,s,{shouldBuffer:!!i.handler,maximumDescriptorLength:Math.min(Un,Fx(this,r))});if(i.handler&&await this.inflate(s,o,i.handler),s.dataDescriptor){let a=new Uint8Array(Ro);if(await this.tokenizer.readBuffer(a),Je.get(a,0)!==O0)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-a.length}`)}if(di(this.tokenizer,r,hn))throw new Xn(`ZIP stream probing exceeds ${hn} bytes`)}while(!t)};yc=class e{constructor(t){let n=Wx(t?.mpegOffsetTolerance);this.options={...t,mpegOffsetTolerance:n},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(t){return $x(Vm(t,this.getTokenizerOptions()))}async parseTokenizer(t,n=0){this.detectionReentryCount=n;let r=t.position;for(let s of this.detectors){let i;try{i=await s.detect(t)}catch(o){if(o instanceof Le||o instanceof Xn)return;throw o}if(i)return i;if(r!==t.position)return}}async fromTokenizer(t){try{return await this.parseTokenizer(t)}finally{await t.close()}}async fromBuffer(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``);let n=t instanceof Uint8Array?t:new Uint8Array(t);if(n?.length>1)return this.fromTokenizer(qm(n,this.getTokenizerOptions()))}async fromBlob(t){this.options.signal?.throwIfAborted();let n=Zm(t,this.getTokenizerOptions());return this.fromTokenizer(n)}async fromStream(t){this.options.signal?.throwIfAborted();let n=this.createTokenizerFromWebStream(t);return this.fromTokenizer(n)}async toDetectionStream(t,n){let r=Ux(n?.sampleSize??hi),s,i,o=t.getReader({mode:"byob"});try{let{value:c,done:u}=await Bx(o,new Uint8Array(r),this.options.signal);if(i=c,!u&&c)try{s=await this.fromBuffer(c.subarray(0,r))}catch(f){if(!(f instanceof Le))throw f;s=void 0}i=c}finally{o.releaseLock()}let a=new TransformStream({async start(c){c.enqueue(i)},transform(c,u){u.enqueue(c)}}),l=t.pipeThrough(a);return l.fileType=s,l}async detectGzip(t){if(this.gzipProbeDepth>=bx)return{ext:"gz",mime:"application/gzip"};let n=new pi(t),r=Mx(n.inflate(),wx),s=Dt(t),i,o,a,l;if(s){let c=new AbortController;i=setTimeout(()=>{c.abort(new DOMException(`Operation timed out after ${x0} ms`,"TimeoutError"))},x0),o=this.options.signal===void 0?c.signal:AbortSignal.any([this.options.signal,c.signal]),a=new e({...this.options,signal:o}),a.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{l=await(a??this).fromStream(r)}catch(c){if(c?.name==="AbortError"&&o?.reason?.name!=="TimeoutError")throw c}finally{clearTimeout(i),s||this.gzipProbeDepth--}return l?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(t,n){return Mn(this.buffer,t,n)}checkString(t,n){return this.check(f0(t,n?.encoding),n)}detectConfident=async t=>{if(this.buffer=new Uint8Array(hi),t.fileInfo.size===void 0&&(t.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=t,Dt(t)&&(await t.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(t);if(await t.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await t.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=S0?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(t));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(t);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await lr(t,6,{maximumLength:6,reason:"ID3 header prefix"});let n=await t.readToken(h0),r=Dt(t);if(!Number.isFinite(n)||n<0||r&&(n>mc||t.position+n>mc))return;if(t.position+n>t.fileInfo.size)return r?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await lr(t,n,{maximumLength:r?mc:t.fileInfo.size,reason:"ID3 payload"})}catch(s){if(s instanceof Le)return;throw s}return this.detectionReentryCount>=S0?void 0:(this.detectionReentryCount++,this.parseTokenizer(t,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let n,r=Gx();try{await new Ur(t).unzip(s=>{Vx(r,s.filename);let i=s.filename==="[Content_Types].xml",o=$0(r);if(!i&&o)return n=o,{stop:!0};switch(s.filename){case"META-INF/mozilla.rsa":return n={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return n={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return I0(s,b0)?{async handler(a){let l=new TextDecoder("utf-8").decode(a).trim();n=N0(l)},stop:!0}:{};case"[Content_Types].xml":return r.hasContentTypesEntry=!0,I0(s,b0)?(r.isParsingContentTypes=!0,{async handler(a){let l=new TextDecoder("utf-8").decode(a),c=qx(l);c&&(n=N0(c)),r.hasParsedContentTypesEntry=!0,r.isParsingContentTypes=!1},stop:!0}):(r.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(s.filename)?(n={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(s){if(!jx(s))throw s;r.isParsingContentTypes&&(r.isParsingContentTypes=!1,r.hasUnparseableContentTypes=!0)}return n??$0(r)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await t.ignore(28);let n=new Uint8Array(8);return await t.readBuffer(n),Mn(n,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Mn(n,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Mn(n,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Mn(n,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Mn(n,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Mn(n,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let n=await this.readTiffHeader(!1);if(n)return n}if(this.check([77,77])){let n=await this.readTiffHeader(!0);if(n)return n}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function n(){let l=await t.peekNumber(Fm),c=128,u=0;for(;(l&c)===0&&c!==0;)++u,c>>=1;let f=new Uint8Array(u+1);return await gc(t,f,void 0,{maximumLength:f.length,reason:"EBML field"}),f}async function r(){let l=await n(),c=await n();c[0]^=128>>c.length-1;let u=Math.min(6,c.length),f=new DataView(l.buffer),p=new DataView(c.buffer,c.length-u,u);return{id:dc(f),len:dc(p)}}async function s(l){let c=0;for(;l>0;){if(c++,c>xx||di(t,o,hn))return;let u=t.position,f=await r();if(f.id===17026){if(f.len>E0)return;let p=wc(f.len,E0,"EBML DocType");return(await t.readToken(new jt(p))).replaceAll(/\00.*$/g,"")}if(Dt(t)&&(!Number.isFinite(f.len)||f.len<0||f.len>A0)||(await lr(t,f.len,{maximumLength:Dt(t)?A0:t.fileInfo.size,reason:"EBML payload"}),--l,t.position<=u))return}}let i=await r(),o=t.position;switch(await s(i.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let n=lc.get(this.buffer,4),r=Pr.get(this.buffer,6);if(n>0&&n<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(r>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let n=new jt(4,"latin1").get(this.buffer,2);if(n.match("^d*")&&n>=1e3&&n<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await t.ignore(8),await t.readToken(new jt(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
|
|
625
|
+
`,"\r"," "," ","\0"].some(n=>this.checkString(n,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let n={ext:"png",mime:"image/png"},r={ext:"apng",mime:"image/apng"};await t.ignore(8);async function s(){return{length:await t.readToken(Lm),type:await t.readToken(new jt(4,"latin1"))}}let i=Dt(t),o=t.position,a=0,l=!1;do{if(a++,a>Ex||di(t,o,Ax))break;let c=t.position,u=await s();if(u.length<0)return;if(u.type==="IHDR"){if(u.length!==13)return;l=!0}switch(u.type){case"IDAT":return n;case"acTL":return r;default:if(!l&&u.type!=="CgBI")return;if(i&&u.length>C0)return l&&Px(u.type)?n:void 0;try{await lr(t,u.length+4,{maximumLength:i?C0+4:t.fileInfo.size,reason:"PNG chunk payload"})}catch(f){if(!i&&(f instanceof Xn||f instanceof Le))return n;throw f}}if(t.position<=c)break}while(t.position+8<t.fileInfo.size);return n}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let n=new jt(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(n){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return n.startsWith("3g")?n.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
|
|
626
|
+
`))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let n=!1;try{async function r(){let a=new Uint8Array(16);return await gc(t,a,void 0,{maximumLength:a.length,reason:"ASF header GUID"}),{id:a,size:Number(await t.readToken(Mm))}}await lr(t,30,{maximumLength:30,reason:"ASF header prelude"});let s=Dt(t),i=t.position,o=0;for(;t.position+24<t.fileInfo.size&&(o++,!(o>Sx||di(t,i,hn)));){let a=t.position,l=await r(),c=l.size-24;if(!Number.isFinite(c)||c<0){n=!0;break}if(Mn(l.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let u=new Uint8Array(16);if(c-=await gc(t,u,void 0,{maximumLength:u.length,reason:"ASF stream type GUID"}),Mn(u,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Mn(u,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(s&&c>v0){n=!0;break}if(await lr(t,c,{maximumLength:s?v0:t.fileInfo.size,reason:"ASF header payload"}),t.position<=a){n=!0;break}}}catch(r){if(r instanceof Le||r instanceof Xn)Dt(t)&&(n=!0);else throw r}return n?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await t.ignore(20),await t.readToken(new jt(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await t.peekBuffer(this.buffer,{length:Math.min(256,t.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let n=new DataView(this.buffer.buffer).getUint32(12,!0);if(n>12&&this.buffer.length>=n+16)try{let r=new TextDecoder().decode(this.buffer.subarray(16,n+16));if(JSON.parse(r).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await t.peekBuffer(this.buffer,{length:Math.min(512,t.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&p0(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let n="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:n})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:n})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
|
|
627
|
+
`,{offset:2,encoding:n})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async t=>{this.buffer=new Uint8Array(hi);let n=zx(t.fileInfo.size);if(await t.peekBuffer(this.buffer,{length:Math.min(8,n),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await t.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,n),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let r=0;r<=this.options.mpegOffsetTolerance;++r){let s=this.scanMpeg(r);if(s)return s}};async readTiffTag(t){let n=await this.tokenizer.readToken(t?Pr:tt);switch(await this.tokenizer.ignore(10),n){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(t){let n=await this.tokenizer.readToken(t?Pr:tt);if(!(n>Cx)&&!(Dt(this.tokenizer)&&2+n*12>k0))for(let r=0;r<n;++r){let s=await this.readTiffTag(t);if(s)return s}}async readTiffHeader(t){let n={ext:"tif",mime:"image/tiff"},r=(t?Pr:tt).get(this.buffer,2),s=(t?lc:Je).get(this.buffer,4);if(r===42){if(s>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(s>=8){let a=(t?Pr:tt).get(this.buffer,8),l=(t?Pr:tt).get(this.buffer,10);if(a===28&&l===254||a===31&&l===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(Dt(this.tokenizer)&&s>vx)return n;let i=Dt(this.tokenizer)?k0:this.tokenizer.fileInfo.size;try{await lr(this.tokenizer,s,{maximumLength:i,reason:"TIFF IFD offset"})}catch(a){if(a instanceof Le)return;throw a}let o;try{o=await this.readTiffIFD(t)}catch(a){if(a instanceof Le)return;throw a}return o??n}if(r===43)return n}scanMpeg(t){if(this.check([255,224],{offset:t,mask:[255,224]})){if(this.check([16],{offset:t+1,mask:[22]}))return this.check([8],{offset:t+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:t+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:t+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:t+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},vT=new Set(m0),kT=new Set(g0)});var P0={};J(P0,{fileCommand:()=>tE,flagsForFuzzing:()=>nE});function Xx(e,t){let n=Qx.get(e);if(n)return n;let[r,s]=t.split("/"),i=s?.split("+")[0]?.replace(/-/g," ")||e;switch(r){case"image":return`${i.toUpperCase()} image data`;case"audio":return`${i.toUpperCase()} audio`;case"video":return`${i.toUpperCase()} video`;case"font":return`${i} font`;case"model":return`${i} 3D model`;case"application":return s?.includes("zip")||s?.includes("compressed")?`${i} archive data`:s?.includes("executable")?`${i} executable`:`${e.toUpperCase()} data`;default:return`${e.toUpperCase()} data`}}function Yx(e){let t=e.split("/").pop()||e;if(t.startsWith(".")&&!t.includes(".",1))return t;let n=t.lastIndexOf(".");return n===-1||n===0?"":t.slice(n).toLowerCase()}function Jx(e,t){if(e.startsWith("#!")){let c=e.split(`
|
|
628
|
+
`)[0];return c.includes("python")?{description:"Python script, ASCII text executable",mime:"text/x-python"}:c.includes("node")||c.includes("bun")||c.includes("deno")?{description:"JavaScript script, ASCII text executable",mime:"text/javascript"}:c.includes("bash")?{description:"Bourne-Again shell script, ASCII text executable",mime:"text/x-shellscript"}:c.includes("sh")?{description:"POSIX shell script, ASCII text executable",mime:"text/x-shellscript"}:c.includes("ruby")?{description:"Ruby script, ASCII text executable",mime:"text/x-ruby"}:c.includes("perl")?{description:"Perl script, ASCII text executable",mime:"text/x-perl"}:{description:"script, ASCII text executable",mime:"text/plain"}}let n=e.trimStart();if(n.startsWith("<?xml"))return{description:"XML document",mime:"application/xml"};if(n.startsWith("<!DOCTYPE html")||n.toLowerCase().startsWith("<html"))return{description:"HTML document",mime:"text/html"};let r=e.includes(`\r
|
|
629
|
+
`),s=e.includes("\r")&&!r,i="";r?i=", with CRLF line terminators":s&&(i=", with CR line terminators");let o=Yx(t),a=o?Kx.get(o):void 0;if(a)return a.mime.startsWith("text/")&&i?{description:`${a.description}${i}`,mime:a.mime}:a;let l=!1;for(let c=0;c<Math.min(e.length,8192);c++)if(e.charCodeAt(c)>127){l=!0;break}return l?{description:`UTF-8 Unicode text${i}`,mime:"text/plain; charset=utf-8"}:{description:`ASCII text${i}`,mime:"text/plain"}}async function eE(e,t){if(t.length===0)return{description:"empty",mime:"inode/x-empty"};let n=await R0(t);if(n)return{description:Xx(n.ext,n.mime),mime:n.mime};let r=new TextDecoder("utf-8",{fatal:!1}).decode(t);return Jx(r,e)}var Zx,Kx,Qx,tE,nE,D0=v(()=>{"use strict";T0();ne();Zx={name:"file",summary:"determine file type",usage:"file [OPTION]... FILE...",options:["-b, --brief do not prepend filenames to output","-i, --mime output MIME type strings","-L, --dereference follow symlinks"," --help display this help and exit"]},Kx=new Map([[".js",{description:"JavaScript source",mime:"text/javascript"}],[".mjs",{description:"JavaScript module",mime:"text/javascript"}],[".cjs",{description:"CommonJS module",mime:"text/javascript"}],[".ts",{description:"TypeScript source",mime:"text/typescript"}],[".tsx",{description:"TypeScript JSX source",mime:"text/typescript"}],[".jsx",{description:"JavaScript JSX source",mime:"text/javascript"}],[".py",{description:"Python script",mime:"text/x-python"}],[".rb",{description:"Ruby script",mime:"text/x-ruby"}],[".go",{description:"Go source",mime:"text/x-go"}],[".rs",{description:"Rust source",mime:"text/x-rust"}],[".c",{description:"C source",mime:"text/x-c"}],[".h",{description:"C header",mime:"text/x-c"}],[".cpp",{description:"C++ source",mime:"text/x-c++"}],[".hpp",{description:"C++ header",mime:"text/x-c++"}],[".java",{description:"Java source",mime:"text/x-java"}],[".sh",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".bash",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".zsh",{description:"Zsh shell script",mime:"text/x-shellscript"}],[".json",{description:"JSON data",mime:"application/json"}],[".yaml",{description:"YAML data",mime:"text/yaml"}],[".yml",{description:"YAML data",mime:"text/yaml"}],[".xml",{description:"XML document",mime:"application/xml"}],[".csv",{description:"CSV text",mime:"text/csv"}],[".toml",{description:"TOML data",mime:"text/toml"}],[".html",{description:"HTML document",mime:"text/html"}],[".htm",{description:"HTML document",mime:"text/html"}],[".css",{description:"CSS stylesheet",mime:"text/css"}],[".svg",{description:"SVG image",mime:"image/svg+xml"}],[".md",{description:"Markdown document",mime:"text/markdown"}],[".markdown",{description:"Markdown document",mime:"text/markdown"}],[".txt",{description:"ASCII text",mime:"text/plain"}],[".rst",{description:"reStructuredText",mime:"text/x-rst"}],[".env",{description:"ASCII text",mime:"text/plain"}],[".gitignore",{description:"ASCII text",mime:"text/plain"}],[".dockerignore",{description:"ASCII text",mime:"text/plain"}]]),Qx=new Map([["jpg","JPEG image data"],["jpeg","JPEG image data"],["png","PNG image data"],["gif","GIF image data"],["webp","WebP image data"],["bmp","PC bitmap"],["ico","MS Windows icon resource"],["tif","TIFF image data"],["tiff","TIFF image data"],["psd","Adobe Photoshop Document"],["avif","AVIF image"],["heic","HEIC image"],["heif","HEIF image"],["jxl","JPEG XL image"],["icns","Mac OS X icon"],["svg","SVG Scalable Vector Graphics image"],["pdf","PDF document"],["epub","EPUB document"],["mobi","Mobipocket E-book"],["djvu","DjVu document"],["zip","Zip archive data"],["gz","gzip compressed data"],["gzip","gzip compressed data"],["bz2","bzip2 compressed data"],["xz","XZ compressed data"],["tar","POSIX tar archive"],["rar","RAR archive data"],["7z","7-zip archive data"],["lz","lzip compressed data"],["lzma","LZMA compressed data"],["zst","Zstandard compressed data"],["cab","Microsoft Cabinet archive"],["ar","Unix ar archive"],["rpm","RPM package"],["deb","Debian binary package"],["apk","Android Package"],["dmg","Apple disk image"],["iso","ISO 9660 CD-ROM filesystem data"],["vhd","Microsoft Virtual Hard Disk"],["vhdx","Microsoft Virtual Hard Disk (new format)"],["qcow2","QEMU QCOW Image"],["mp3","Audio file with ID3"],["m4a","MPEG-4 audio"],["aac","AAC audio"],["wav","RIFF (little-endian) data, WAVE audio"],["flac","FLAC audio bitstream data"],["ogg","Ogg data"],["oga","Ogg audio"],["opus","Ogg Opus audio"],["aiff","AIFF audio"],["wma","Windows Media Audio"],["amr","AMR audio"],["mid","MIDI audio"],["midi","MIDI audio"],["ape","Monkey's Audio"],["mp4","ISO Media, MPEG-4"],["m4v","MPEG-4 video"],["webm","WebM"],["avi","RIFF (little-endian) data, AVI"],["mov","ISO Media, Apple QuickTime movie"],["mkv","Matroska data"],["wmv","Windows Media Video"],["flv","Flash Video"],["3gp","3GPP multimedia"],["3g2","3GPP2 multimedia"],["ogv","Ogg video"],["mts","MPEG transport stream"],["m2ts","MPEG transport stream"],["ts","MPEG transport stream"],["mpg","MPEG video"],["mpeg","MPEG video"],["exe","PE32 executable"],["dll","PE32 DLL"],["elf","ELF executable"],["mach","Mach-O executable"],["wasm","WebAssembly (wasm) binary module"],["dex","Android Dalvik executable"],["class","Java class file"],["swf","Adobe Flash"],["doc","Microsoft Word Document"],["docx","Microsoft Word 2007+ Document"],["xls","Microsoft Excel Spreadsheet"],["xlsx","Microsoft Excel 2007+ Spreadsheet"],["ppt","Microsoft PowerPoint Presentation"],["pptx","Microsoft PowerPoint 2007+ Presentation"],["odt","OpenDocument Text"],["ods","OpenDocument Spreadsheet"],["odp","OpenDocument Presentation"],["ttf","TrueType Font"],["otf","OpenType Font"],["woff","Web Open Font Format"],["woff2","Web Open Font Format 2"],["eot","Embedded OpenType font"],["stl","Stereolithography CAD"],["obj","Wavefront 3D Object"],["gltf","GL Transmission Format"],["glb","GL Transmission Format (binary)"],["sqlite","SQLite 3.x database"],["mdb","Microsoft Access Database"],["xml","XML document"],["json","JSON data"],["macho","Mach-O binary"],["ics","iCalendar data"],["vcf","vCard data"],["msi","Microsoft Installer"],["ps","PostScript"],["ai","Adobe Illustrator"],["indd","Adobe InDesign"],["sketch","Sketch design file"],["fig","Figma design file"],["xd","Adobe XD"],["blend","Blender"],["fbx","Autodesk FBX"],["lnk","MS Windows shortcut"],["alias","Mac OS alias"],["torrent","BitTorrent file"],["pcap","pcap capture file"],["arrow","Apache Arrow"],["parquet","Apache Parquet"]]);tE={name:"file",async execute(e,t){if(B(e))return U(Zx);let n=!1,r=!1,s=[];for(let a of e)if(a.startsWith("--")){if(a==="--brief")n=!0;else if(a==="--mime"||a==="--mime-type")r=!0;else if(a!=="--dereference")return Z("file",a)}else if(a.startsWith("-")&&a!=="-"){for(let l of a.slice(1))if(l==="b")n=!0;else if(l==="i")r=!0;else if(l!=="L")return Z("file",`-${l}`)}else s.push(a);if(s.length===0)return{stdout:"",stderr:`Usage: file [-bLi] FILE...
|
|
630
|
+
`,exitCode:1};let i="",o=0;for(let a of s)try{let l=t.fs.resolvePath(t.cwd,a);if((await t.fs.stat(l)).isDirectory){let h=r?"inode/directory":"directory";i+=n?`${h}
|
|
631
|
+
`:`${a}: ${h}
|
|
632
|
+
`;continue}let u=await t.fs.readFileBuffer(l),f=await eE(a,u),p=r?f.mime:f.description;i+=n?`${p}
|
|
633
|
+
`:`${a}: ${p}
|
|
634
|
+
`}catch{i+=n?`cannot open
|
|
635
|
+
`:`${a}: cannot open (No such file or directory)
|
|
636
|
+
`,o=1}return{stdout:i,stderr:"",exitCode:o}}},nE={name:"file",flags:[{flag:"-b",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-L",type:"boolean"}],needsArgs:!0}});var _0={};J(_0,{flagsForFuzzing:()=>oE,htmlToMarkdownCommand:()=>iE});import rE from"turndown";var sE,iE,oE,F0=v(()=>{"use strict";ne();sE={name:"html-to-markdown",summary:"convert HTML to Markdown (BashEnv extension)",usage:"html-to-markdown [OPTION]... [FILE]",description:["Convert HTML content to Markdown format using the turndown library.","This is a non-standard BashEnv extension command, not available in regular bash.","","Read HTML from FILE or standard input and output Markdown to standard output.","Commonly used with curl to convert web pages:"," curl -s https://example.com | html-to-markdown","","Supported HTML elements:"," - Headings (h1-h6) \u2192 # Markdown headings"," - Paragraphs (p) \u2192 Plain text with blank lines"," - Links (a) \u2192 [text](url)"," - Images (img) \u2192 "," - Bold/Strong \u2192 **text**"," - Italic/Em \u2192 _text_"," - Code (code, pre) \u2192 `inline` or fenced blocks"," - Lists (ul, ol, li) \u2192 - or 1. items"," - Blockquotes \u2192 > quoted text"," - Horizontal rules (hr) \u2192 ---"],options:["-b, --bullet=CHAR bullet character for unordered lists (-, +, or *)","-c, --code=FENCE fence style for code blocks (``` or ~~~)","-r, --hr=STRING string for horizontal rules (default: ---)"," --heading-style=STYLE"," heading style: 'atx' for # headings (default),"," 'setext' for underlined headings (h1/h2 only)"," --help display this help and exit"],examples:["echo '<h1>Hello</h1><p>World</p>' | html-to-markdown","html-to-markdown page.html","curl -s https://example.com | html-to-markdown > page.md"]},iE={name:"html-to-markdown",async execute(e,t){if(B(e))return U(sE);let n="-",r="```",s="---",i="atx",o=[];for(let l=0;l<e.length;l++){let c=e[l];if(c==="-b"||c==="--bullet")n=e[++l]??"-";else if(c.startsWith("--bullet="))n=c.slice(9);else if(c==="-c"||c==="--code")r=e[++l]??"```";else if(c.startsWith("--code="))r=c.slice(7);else if(c==="-r"||c==="--hr")s=e[++l]??"---";else if(c.startsWith("--hr="))s=c.slice(5);else if(c.startsWith("--heading-style=")){let u=c.slice(16);(u==="setext"||u==="atx")&&(i=u)}else if(c==="-")o.push("-");else{if(c.startsWith("--"))return Z("html-to-markdown",c);if(c.startsWith("-"))return Z("html-to-markdown",c);o.push(c)}}let a;if(o.length===0||o.length===1&&o[0]==="-")a=t.stdin;else try{let l=t.fs.resolvePath(t.cwd,o[0]);a=await t.fs.readFile(l)}catch{return{stdout:"",stderr:`html-to-markdown: ${o[0]}: No such file or directory
|
|
637
|
+
`,exitCode:1}}if(!a.trim())return{stdout:"",stderr:"",exitCode:0};try{let l=new rE({bulletListMarker:n,codeBlockStyle:"fenced",fence:r,hr:s,headingStyle:i});return l.remove(["script","style","footer"]),{stdout:`${l.turndown(a).trim()}
|
|
638
|
+
`,stderr:"",exitCode:0}}catch(l){return{stdout:"",stderr:`html-to-markdown: conversion error: ${l.message}
|
|
639
|
+
`,exitCode:1}}}},oE={name:"html-to-markdown",flags:[],stdinType:"text"}});var L0={};J(L0,{flagsForFuzzing:()=>uE,helpCommand:()=>cE});function lE(e){let t=[],n=new Set(e);t.push(`Available commands:
|
|
640
|
+
`);let r=[];for(let[s,i]of aE){let o=i.filter(a=>n.has(a));if(o.length>0){t.push(` ${s}:`),t.push(` ${o.join(", ")}
|
|
641
|
+
`);for(let a of o)n.delete(a)}}for(let s of n)r.push(s);return r.length>0&&(t.push(" Other:"),t.push(` ${r.sort().join(", ")}
|
|
642
|
+
`)),t.push("Use '<command> --help' for details on a specific command."),`${t.join(`
|
|
643
|
+
`)}
|
|
644
|
+
`}var aE,cE,uE,M0=v(()=>{"use strict";Nr();aE=new Map([["File operations",["ls","cat","head","tail","wc","touch","mkdir","rm","cp","mv","ln","chmod","stat","readlink"]],["Text processing",["grep","sed","awk","sort","uniq","cut","tr","tee","diff"]],["Search",["find"]],["Navigation & paths",["pwd","basename","dirname","tree","du"]],["Environment & shell",["echo","printf","env","printenv","export","alias","unalias","history","clear","true","false","bash","sh"]],["Data processing",["xargs","jq","base64","date"]],["Network",["curl","html-to-markdown"]]]);cE={name:"help",async execute(e,t){if(e.includes("--help")||e.includes("-h"))return{stdout:`help - display available commands
|
|
645
|
+
|
|
646
|
+
Usage: help [command]
|
|
647
|
+
|
|
648
|
+
Options:
|
|
649
|
+
-h, --help Show this help message
|
|
650
|
+
|
|
651
|
+
If a command name is provided, shows help for that command.
|
|
652
|
+
Otherwise, lists all available commands.
|
|
653
|
+
`,stderr:"",exitCode:0};if(e.length>0&&t.exec){let r=e[0];return t.exec(tn([r]),{cwd:t.cwd,signal:t.signal,args:["--help"]})}let n=t.getRegisteredCommands?.()??[];return{stdout:lE(n),stderr:"",exitCode:0}}},uE={name:"help",flags:[]}});var U0={};J(U0,{flagsForFuzzing:()=>dE,whichCommand:()=>hE});var fE,pE,hE,dE,B0=v(()=>{"use strict";st();ne();fE={name:"which",summary:"locate a command",usage:"which [-as] program ...",options:["-a List all instances of executables found","-s No output, just return 0 if found, 1 if not","--help display this help and exit"]},pE={showAll:{short:"a",type:"boolean"},silent:{short:"s",type:"boolean"}},hE={name:"which",async execute(e,t){if(B(e))return U(fE);let n=Ee("which",e,pE);if(!n.ok)return n.error;let r=n.result.flags.showAll,s=n.result.flags.silent,i=n.result.positional;if(i.length===0)return{stdout:"",stderr:"",exitCode:1};let a=(t.env.get("PATH")||"/usr/bin:/bin").split(":"),l="",c=!0;for(let u of i){let f=!1;for(let p of a){if(!p)continue;let h=t.fs.resolvePath(p,u);if(await t.fs.exists(h)&&(f=!0,s||(l+=`${h}
|
|
654
|
+
`),!r))break}f||(c=!1)}return{stdout:l,stderr:"",exitCode:c?0:1}}},dE={name:"which",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"boolean"}],needsArgs:!0}});var W0={};J(W0,{flagsForFuzzing:()=>yE,tac:()=>gE});async function mE(e,t){if(e.length>0&&e[0]!=="-"){let s=t.fs.resolvePath(t.cwd,e[0]);try{let o=(await t.fs.readFile(s)).split(`
|
|
655
|
+
`);o[o.length-1]===""&&o.pop();let a=o.reverse();return{stdout:a.length>0?`${a.join(`
|
|
656
|
+
`)}
|
|
657
|
+
`:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${e[0]}: No such file or directory
|
|
658
|
+
`,exitCode:1}}}let n=t.stdin.split(`
|
|
659
|
+
`);n[n.length-1]===""&&n.pop();let r=n.reverse();return{stdout:r.length>0?`${r.join(`
|
|
660
|
+
`)}
|
|
661
|
+
`:"",stderr:"",exitCode:0}}var gE,yE,z0=v(()=>{"use strict";gE={name:"tac",execute:mE},yE={name:"tac",flags:[],stdinType:"text",needsFiles:!0}});var H0={};J(H0,{flagsForFuzzing:()=>xE,hostname:()=>bE});async function wE(e,t){return{stdout:`localhost
|
|
662
|
+
`,stderr:"",exitCode:0}}var bE,xE,j0=v(()=>{"use strict";bE={name:"hostname",execute:wE},xE={name:"hostname",flags:[]}});var G0={};J(G0,{flagsForFuzzing:()=>SE,whoami:()=>AE});async function EE(e,t){return{stdout:`user
|
|
663
|
+
`,stderr:"",exitCode:0}}var AE,SE,V0=v(()=>{"use strict";AE={name:"whoami",execute:EE},SE={name:"whoami",flags:[]}});var q0={};J(q0,{flagsForFuzzing:()=>kE,od:()=>vE});async function CE(e,t){let n="octal",r=[],s=[];for(let h=0;h<e.length;h++){let d=e[h];if(d==="-c")r.push("char");else if(d==="-An"||d==="-A"&&e[h+1]==="n")n="none",d==="-A"&&h++;else if(d==="-t"&&e[h+1]){let m=e[++h];m==="x1"?r.push("hex"):m==="c"?r.push("char"):m.startsWith("o")&&r.push("octal")}else(!d.startsWith("-")||d==="-")&&s.push(d)}r.length===0&&r.push("octal");let i=t.stdin;if(s.length>0&&s[0]!=="-"){let h=s[0].startsWith("/")?s[0]:`${t.cwd}/${s[0]}`;try{i=await t.fs.readFile(h)}catch{return{stdout:"",stderr:`od: ${s[0]}: No such file or directory
|
|
664
|
+
`,exitCode:1}}}let o=r.includes("char");function a(h){return h===0?" \\0":h===7?" \\a":h===8?" \\b":h===9?" \\t":h===10?" \\n":h===11?" \\v":h===12?" \\f":h===13?" \\r":h>=32&&h<127?` ${String.fromCharCode(h)}`:` ${h.toString(8).padStart(3,"0")}`}function l(h){return o?` ${h.toString(16).padStart(2,"0")}`:` ${h.toString(16).padStart(2,"0")}`}function c(h){return` ${h.toString(8).padStart(3,"0")}`}let u=[];for(let h of i)u.push(h.charCodeAt(0));let f=16,p=[];for(let h=0;h<u.length;h+=f){let d=u.slice(h,h+f);for(let m=0;m<r.length;m++){let g=r[m],y;g==="char"?y=d.map(a):g==="hex"?y=d.map(l):y=d.map(c);let w="";m===0&&n!=="none"?w=`${h.toString(8).padStart(7,"0")} `:(m>0||n==="none")&&(w=n==="none"?"":" "),p.push(w+y.join(""))}}return n!=="none"&&u.length>0&&p.push(u.length.toString(8).padStart(7,"0")),{stdout:p.length>0?`${p.join(`
|
|
665
|
+
`)}
|
|
666
|
+
`:"",stderr:"",exitCode:0}}var vE,kE,Z0=v(()=>{"use strict";vE={name:"od",execute:CE},kE={name:"od",flags:[{flag:"-c",type:"boolean"},{flag:"-A",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-N",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}});var _o={};J(_o,{flagsForFuzzing:()=>FE,gunzipCommand:()=>DE,gunzipFlagsForFuzzing:()=>LE,gzipCommand:()=>PE,zcatCommand:()=>_E,zcatFlagsForFuzzing:()=>ME});import{constants as bc,gunzipSync as K0,gzipSync as Q0}from"node:zlib";function X0(e){return e.best?bc.Z_BEST_COMPRESSION:e.level8?8:e.level7?7:e.level6?6:e.level5?5:e.level4?4:e.level3?3:e.level2?2:e.fast?bc.Z_BEST_SPEED:bc.Z_DEFAULT_COMPRESSION}function Y0(e){if(e.length<10)return{originalName:null,mtime:null,headerSize:0};if(e[0]!==31||e[1]!==139)return{originalName:null,mtime:null,headerSize:0};let t=e[3],n=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r=10;if(t&4){if(r+2>e.length)return{originalName:null,mtime:null,headerSize:0};let i=e[r]|e[r+1]<<8;r+=2+i}let s=null;if(t&8){let i=r;for(;r<e.length&&e[r]!==0;)r++;r<e.length&&(s=new TextDecoder().decode(e.slice(i,r)),r++)}if(t&16){for(;r<e.length&&e[r]!==0;)r++;r++}return t&2&&(r+=2),{originalName:s,mtime:n>0?new Date(n*1e3):null,headerSize:r}}function J0(e){if(e.length<4)return 0;let t=e.length;return e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24}function Do(e){return e.length>=2&&e[0]===31&&e[1]===139}function Po(e){return Buffer.from(e).toString("latin1")}function e2(e){return e.limits?.maxOutputSize??0}function xc(e,t){if(t>0){if(J0(e)>t)throw new Error(`decompressed data exceeds limit (${t} bytes)`);return K0(e,{maxOutputLength:t})}return K0(e)}async function t2(e,t,n,r,s,i){let o=n.suffix,a,l,c,u=e2(e);if(t==="-"||t==="")if(c=Uint8Array.from(e.stdin,f=>f.charCodeAt(0)),s){if(!Do(c))return n.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: stdin: not in gzip format
|
|
667
|
+
`,exitCode:1};try{let f=xc(c,u);return{stdout:Po(f),stderr:"",exitCode:0}}catch(f){let p=f instanceof Error?f.message:"unknown error";return{stdout:"",stderr:`${r}: stdin: ${p}
|
|
668
|
+
`,exitCode:1}}}else{let f=X0(n),p=Q0(c,{level:f});return{stdout:Po(p),stderr:"",exitCode:0}}a=e.fs.resolvePath(e.cwd,t);try{if((await e.fs.stat(a)).isDirectory)return n.recursive?await n2(e,a,n,r,s,i):n.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: is a directory -- ignored
|
|
669
|
+
`,exitCode:1}}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
670
|
+
`,exitCode:1}}try{c=await e.fs.readFileBuffer(a)}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
671
|
+
`,exitCode:1}}if(s){if(!t.endsWith(o))return n.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: unknown suffix -- ignored
|
|
672
|
+
`,exitCode:1};if(!Do(c))return n.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
673
|
+
`,exitCode:1};let f;try{f=xc(c,u)}catch(p){let h=p instanceof Error?p.message:"unknown error";return{stdout:"",stderr:`${r}: ${t}: ${h}
|
|
674
|
+
`,exitCode:1}}if(i)return{stdout:Po(f),stderr:"",exitCode:0};if(n.name){let p=Y0(c);p.originalName?l=e.fs.resolvePath(e.cwd,p.originalName):l=a.slice(0,-o.length)}else l=a.slice(0,-o.length);if(!n.force)try{return await e.fs.stat(l),{stdout:"",stderr:`${r}: ${l} already exists; not overwritten
|
|
675
|
+
`,exitCode:1}}catch{}if(await e.fs.writeFile(l,f),!n.keep&&!i&&await e.fs.rm(a),n.verbose){let p=c.length>0?((1-c.length/f.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${p}% -- replaced with ${l.split("/").pop()}
|
|
676
|
+
`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}else{if(t.endsWith(o))return n.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t} already has ${o} suffix -- unchanged
|
|
677
|
+
`,exitCode:1};let f=X0(n),p;try{p=Q0(c,{level:f})}catch(h){let d=h instanceof Error?h.message:"unknown error";return{stdout:"",stderr:`${r}: ${t}: ${d}
|
|
678
|
+
`,exitCode:1}}if(i)return{stdout:Po(p),stderr:"",exitCode:0};if(l=a+o,!n.force)try{return await e.fs.stat(l),{stdout:"",stderr:`${r}: ${l} already exists; not overwritten
|
|
679
|
+
`,exitCode:1}}catch{}if(await e.fs.writeFile(l,p),!n.keep&&!i&&await e.fs.rm(a),n.verbose){let h=c.length>0?((1-p.length/c.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${h}% -- replaced with ${l.split("/").pop()}
|
|
680
|
+
`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}}async function n2(e,t,n,r,s,i){let o=await e.fs.readdir(t),a="",l="",c=0;for(let u of o){let f=e.fs.resolvePath(t,u),p=await e.fs.stat(f);if(p.isDirectory){let h=await n2(e,f,n,r,s,i);a+=h.stdout,l+=h.stderr,h.exitCode!==0&&(c=h.exitCode)}else if(p.isFile){let h=n.suffix;if(s&&!u.endsWith(h)||!s&&u.endsWith(h))continue;let d=f.startsWith(`${e.cwd}/`)?f.slice(e.cwd.length+1):f,m=await t2(e,d,n,r,s,i);a+=m.stdout,l+=m.stderr,m.exitCode!==0&&(c=m.exitCode)}}return{stdout:a,stderr:l,exitCode:c}}async function RE(e,t,n,r){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));else{let f=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
681
|
+
`,exitCode:1}}}if(!Do(s))return n.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
682
|
+
`,exitCode:1};let i=s.length,o=J0(s),a=o>0?((1-i/o)*100).toFixed(1):"0.0",c=Y0(s).originalName||(t==="-"?"":t.replace(/\.gz$/,""));return{stdout:`${i.toString().padStart(10)} ${o.toString().padStart(10)} ${a.padStart(5)}% ${c}
|
|
683
|
+
`,stderr:"",exitCode:0}}async function TE(e,t,n,r){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,i=>i.charCodeAt(0));else{let i=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(i)}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
684
|
+
`,exitCode:1}}}if(!Do(s))return n.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
685
|
+
`,exitCode:1};try{return xc(s,e2(e)),n.verbose?{stdout:"",stderr:`${t}: OK
|
|
686
|
+
`,exitCode:0}:{stdout:"",stderr:"",exitCode:0}}catch(i){let o=i instanceof Error?i.message:"invalid";return{stdout:"",stderr:`${r}: ${t}: ${o}
|
|
687
|
+
`,exitCode:1}}}async function Ec(e,t,n){let r=n==="zcat"?$E:n==="gunzip"?IE:NE;if(B(e))return U(r);let s=Ee(n,e,OE);if(!s.ok)return s.error.stderr.includes("unrecognized option"),s.error;let i=s.result.flags,o=s.result.positional,a=n==="gunzip"||n==="zcat"||i.decompress||i.uncompress,l=n==="zcat"||i.stdout||i.toStdout;if(i.list){o.length===0&&(o=["-"]);let p=` compressed uncompressed ratio uncompressed_name
|
|
688
|
+
`,h="",d=0;for(let m of o){let g=await RE(t,m,i,n);p+=g.stdout,h+=g.stderr,g.exitCode!==0&&(d=g.exitCode)}return{stdout:p,stderr:h,exitCode:d}}if(i.test){o.length===0&&(o=["-"]);let p="",h="",d=0;for(let m of o){let g=await TE(t,m,i,n);p+=g.stdout,h+=g.stderr,g.exitCode!==0&&(d=g.exitCode)}return{stdout:p,stderr:h,exitCode:d}}o.length===0&&(o=["-"]);let c="",u="",f=0;for(let p of o){let h=await t2(t,p,i,n,a,l);c+=h.stdout,u+=h.stderr,h.exitCode!==0&&(f=h.exitCode)}return{stdout:c,stderr:u,exitCode:f}}var NE,IE,$E,OE,PE,DE,_E,FE,LE,ME,Fo=v(()=>{"use strict";st();ne();NE={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
|
|
689
|
+
|
|
690
|
+
When no FILE is given, or when FILE is -, read from standard input.
|
|
691
|
+
|
|
692
|
+
With -d, decompress instead.`,options:["-c, --stdout write to standard output, keep original files","-d, --decompress decompress","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not save or restore the original name and timestamp","-N, --name save or restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode","-1, --fast compress faster","-9, --best compress better"," --help display this help and exit"]},IE={name:"gunzip",summary:"decompress files",usage:"gunzip [OPTION]... [FILE]...",description:`Decompress FILEs (by default, in-place).
|
|
693
|
+
|
|
694
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:["-c, --stdout write to standard output, keep original files","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not restore the original name and timestamp","-N, --name restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},$E={name:"zcat",summary:"decompress files to stdout",usage:"zcat [OPTION]... [FILE]...",description:`Decompress FILEs to standard output.
|
|
695
|
+
|
|
696
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:["-f, --force force; read compressed data even from a terminal","-l, --list list compressed file contents","-q, --quiet suppress all warnings","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},OE={stdout:{short:"c",long:"stdout",type:"boolean"},toStdout:{long:"to-stdout",type:"boolean"},decompress:{short:"d",long:"decompress",type:"boolean"},uncompress:{long:"uncompress",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},keep:{short:"k",long:"keep",type:"boolean"},list:{short:"l",long:"list",type:"boolean"},noName:{short:"n",long:"no-name",type:"boolean"},name:{short:"N",long:"name",type:"boolean"},quiet:{short:"q",long:"quiet",type:"boolean"},recursive:{short:"r",long:"recursive",type:"boolean"},suffix:{short:"S",long:"suffix",type:"string",default:".gz"},test:{short:"t",long:"test",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},fast:{short:"1",long:"fast",type:"boolean"},level2:{short:"2",type:"boolean"},level3:{short:"3",type:"boolean"},level4:{short:"4",type:"boolean"},level5:{short:"5",type:"boolean"},level6:{short:"6",type:"boolean"},level7:{short:"7",type:"boolean"},level8:{short:"8",type:"boolean"},best:{short:"9",long:"best",type:"boolean"}};PE={name:"gzip",async execute(e,t){return{...await Ec(e,t,"gzip"),stdoutEncoding:"binary"}}},DE={name:"gunzip",async execute(e,t){return{...await Ec(e,t,"gunzip"),stdoutEncoding:"binary"}}},_E={name:"zcat",async execute(e,t){return{...await Ec(e,t,"zcat"),stdoutEncoding:"binary"}}},FE={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},LE={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},ME={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0}});function Ac(e,t){if(e instanceof Uint8Array)return e;if(t==="base64")return Uint8Array.from(atob(e),n=>n.charCodeAt(0));if(t==="hex"){let n=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)n[r/2]=parseInt(e.slice(r,r+2),16);return n}if(t==="binary"||t==="latin1"){if(e.length<=65536)return Uint8Array.from(e,s=>s.charCodeAt(0));let r=new Uint8Array(e.length);for(let s=0;s<e.length;s++)r[s]=e.charCodeAt(s);return r}return UE.encode(e)}function Lo(e,t){if(t==="base64"){if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let n=65536,r="";for(let s=0;s<e.length;s+=n){let i=e.subarray(s,s+n);r+=String.fromCharCode(...i)}return btoa(r)}if(t==="hex")return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("");if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(e).toString(t);let n=65536;if(e.length<=n)return String.fromCharCode(...e);let r="";for(let s=0;s<e.length;s+=n){let i=e.subarray(s,s+n);r+=String.fromCharCode(...i)}return r}return BE.decode(e)}function Mo(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}var UE,BE,Sc=v(()=>{"use strict";UE=new TextEncoder,BE=new TextDecoder});function Cc(e){let t=e.indexOf("=");if(t>=0){let n=e.slice(0,t),r=e.slice(t+1);return n?`${encodeURIComponent(n)}=${encodeURIComponent(r)}`:encodeURIComponent(r)}return encodeURIComponent(e)}function vc(e){let t=e.indexOf("=");if(t<0)return null;let n=e.slice(0,t),r=e.slice(t+1),s,i,o=r.match(/;type=([^;]+)$/);o&&(i=o[1],r=r.slice(0,-o[0].length));let a=r.match(/;filename=([^;]+)/);return a&&(s=a[1],r=r.replace(a[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(s=s??r.slice(1).split("/").pop()),{name:n,value:r,filename:s,contentType:i}}function r2(e,t){let n=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let s of e){let i=s.value;if(i.startsWith("@")||i.startsWith("<")){let a=i.slice(1);i=t.get(a)??""}let o=`--${n}\r
|
|
697
|
+
`;s.filename?(o+=`Content-Disposition: form-data; name="${s.name}"; filename="${s.filename}"\r
|
|
698
|
+
`,s.contentType&&(o+=`Content-Type: ${s.contentType}\r
|
|
699
|
+
`)):o+=`Content-Disposition: form-data; name="${s.name}"\r
|
|
700
|
+
`,o+=`\r
|
|
701
|
+
${i}\r
|
|
702
|
+
`,r.push(o)}return r.push(`--${n}--\r
|
|
703
|
+
`),{body:r.join(""),boundary:n}}var kc=v(()=>{"use strict"});var s2,i2=v(()=>{"use strict";s2={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data"," --data-urlencode DATA URL-encode and POST data","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]}});function o2(e){let t={method:"GET",headers:new xo,dataBinary:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1},n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(s==="-X"||s==="--request")t.method=e[++r]??"GET";else if(s.startsWith("-X"))t.method=s.slice(2);else if(s.startsWith("--request="))t.method=s.slice(10);else if(s==="-H"||s==="--header"){let i=e[++r];if(i){let o=i.indexOf(":");if(o>0){let a=i.slice(0,o).trim(),l=i.slice(o+1).trim();t.headers.append(a,l)}}}else if(s.startsWith("--header=")){let i=s.slice(9),o=i.indexOf(":");if(o>0){let a=i.slice(0,o).trim(),l=i.slice(o+1).trim();t.headers.append(a,l)}}else if(s==="-d"||s==="--data"||s==="--data-raw")t.data=e[++r]??"",n=!0;else if(s.startsWith("-d"))t.data=s.slice(2),n=!0;else if(s.startsWith("--data="))t.data=s.slice(7),n=!0;else if(s.startsWith("--data-raw="))t.data=s.slice(11),n=!0;else if(s==="--data-binary")t.data=e[++r]??"",t.dataBinary=!0,n=!0;else if(s.startsWith("--data-binary="))t.data=s.slice(14),t.dataBinary=!0,n=!0;else if(s==="--data-urlencode"){let i=e[++r]??"";t.data=(t.data?`${t.data}&`:"")+Cc(i),n=!0}else if(s.startsWith("--data-urlencode=")){let i=s.slice(17);t.data=(t.data?`${t.data}&`:"")+Cc(i),n=!0}else if(s==="-F"||s==="--form"){let i=e[++r]??"",o=vc(i);o&&t.formFields.push(o),n=!0}else if(s.startsWith("--form=")){let i=s.slice(7),o=vc(i);o&&t.formFields.push(o),n=!0}else if(s==="-u"||s==="--user")t.user=e[++r];else if(s.startsWith("-u"))t.user=s.slice(2);else if(s.startsWith("--user="))t.user=s.slice(7);else if(s==="-A"||s==="--user-agent")t.headers.set("User-Agent",e[++r]??"");else if(s.startsWith("-A"))t.headers.set("User-Agent",s.slice(2));else if(s.startsWith("--user-agent="))t.headers.set("User-Agent",s.slice(13));else if(s==="-e"||s==="--referer")t.headers.set("Referer",e[++r]??"");else if(s.startsWith("-e"))t.headers.set("Referer",s.slice(2));else if(s.startsWith("--referer="))t.headers.set("Referer",s.slice(10));else if(s==="-b"||s==="--cookie")t.headers.set("Cookie",e[++r]??"");else if(s.startsWith("-b"))t.headers.set("Cookie",s.slice(2));else if(s.startsWith("--cookie="))t.headers.set("Cookie",s.slice(9));else if(s==="-c"||s==="--cookie-jar")t.cookieJar=e[++r];else if(s.startsWith("--cookie-jar="))t.cookieJar=s.slice(13);else if(s==="-T"||s==="--upload-file")t.uploadFile=e[++r],t.method==="GET"&&(t.method="PUT");else if(s.startsWith("--upload-file="))t.uploadFile=s.slice(14),t.method==="GET"&&(t.method="PUT");else if(s==="-m"||s==="--max-time"){let i=parseFloat(e[++r]??"0");!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(s.startsWith("--max-time=")){let i=parseFloat(s.slice(11));!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(s==="--connect-timeout"){let i=parseFloat(e[++r]??"0");!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(s.startsWith("--connect-timeout=")){let i=parseFloat(s.slice(18));!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(s==="-o"||s==="--output")t.outputFile=e[++r];else if(s.startsWith("--output="))t.outputFile=s.slice(9);else if(s==="-O"||s==="--remote-name")t.useRemoteName=!0;else if(s==="-I"||s==="--head")t.headOnly=!0,t.method="HEAD";else if(s==="-i"||s==="--include")t.includeHeaders=!0;else if(s==="-s"||s==="--silent")t.silent=!0;else if(s==="-S"||s==="--show-error")t.showError=!0;else if(s==="-f"||s==="--fail")t.failSilently=!0;else if(s==="-L"||s==="--location")t.followRedirects=!0;else if(s==="--max-redirs")r++;else if(!s.startsWith("--max-redirs="))if(s==="-w"||s==="--write-out")t.writeOut=e[++r];else if(s.startsWith("--write-out="))t.writeOut=s.slice(12);else if(s==="-v"||s==="--verbose")t.verbose=!0;else{if(s.startsWith("--")&&s!=="--")return Z("curl",s);if(s.startsWith("-")&&s!=="-")for(let i of s.slice(1))switch(i){case"s":t.silent=!0;break;case"S":t.showError=!0;break;case"f":t.failSilently=!0;break;case"L":t.followRedirects=!0;break;case"I":t.headOnly=!0,t.method="HEAD";break;case"i":t.includeHeaders=!0;break;case"O":t.useRemoteName=!0;break;case"v":t.verbose=!0;break;default:return Z("curl",`-${i}`)}else s.startsWith("-")||(t.url=s)}}return n&&t.method==="GET"&&(t.method="POST"),t}var a2=v(()=>{"use strict";ai();ne();kc()});function Nc(e){return Object.entries(e).map(([t,n])=>`${t}: ${n}`).join(`\r
|
|
704
|
+
`)}function l2(e){try{return new URL(e).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function Ic(e,t){let n=e;return n=n.replace(/%\{http_code\}/g,String(t.status)),n=n.replace(/%\{content_type\}/g,t.headers["content-type"]||""),n=n.replace(/%\{url_effective\}/g,t.url),n=n.replace(/%\{size_download\}/g,String(t.bodyLength)),n=n.replace(/\\n/g,`
|
|
705
|
+
`),n}var c2=v(()=>{"use strict"});var u2={};J(u2,{curlCommand:()=>VE});async function WE(e,t){if(e.uploadFile){let n=t.fs.resolvePath(t.cwd,e.uploadFile);return{body:await t.fs.readFile(n)}}if(e.formFields.length>0){let n=new Map;for(let i of e.formFields)if(i.value.startsWith("@")||i.value.startsWith("<")){let o=t.fs.resolvePath(t.cwd,i.value.slice(1));try{let a=await t.fs.readFile(o);n.set(i.value.slice(1),a)}catch{n.set(i.value.slice(1),"")}}let{body:r,boundary:s}=r2(e.formFields,n);return{body:r,contentType:`multipart/form-data; boundary=${s}`}}return e.data!==void 0?{body:e.data}:{}}function zE(e,t){let n=new xo(e.headers);if(e.user){let r=Buffer.from(e.user).toString("base64");n.set("Authorization",`Basic ${r}`)}return t&&!n.has("Content-Type")&&n.set("Content-Type",t),n}async function HE(e,t,n){if(!e.cookieJar)return;let r=t["set-cookie"];if(!r)return;let s=n.fs.resolvePath(n.cwd,e.cookieJar);await n.fs.writeFile(s,r)}function jE(e){return Lo(e,"binary")}function GE(e,t,n){let r="";if(e.verbose){r+=`> ${e.method} ${n}
|
|
706
|
+
`;for(let[s,i]of e.headers)r+=`> ${s}: ${i}
|
|
707
|
+
`;r+=`>
|
|
708
|
+
`,r+=`< HTTP/1.1 ${t.status} ${t.statusText}
|
|
709
|
+
`;for(let[s,i]of Object.entries(t.headers))r+=`< ${s}: ${i}
|
|
710
|
+
`;r+=`<
|
|
711
|
+
`}return e.includeHeaders&&!e.verbose&&(r+=`HTTP/1.1 ${t.status} ${t.statusText}\r
|
|
712
|
+
`,r+=Nc(t.headers),r+=`\r
|
|
713
|
+
\r
|
|
714
|
+
`),e.headOnly?e.includeHeaders||e.verbose||(r+=`HTTP/1.1 ${t.status} ${t.statusText}\r
|
|
715
|
+
`,r+=Nc(t.headers),r+=`\r
|
|
716
|
+
`):r+=jE(t.body),e.writeOut&&(r+=Ic(e.writeOut,{status:t.status,headers:t.headers,url:t.url,bodyLength:t.body.byteLength})),r}var VE,f2=v(()=>{"use strict";Sc();en();ai();ne();kc();i2();a2();c2();VE={name:"curl",async execute(e,t){if(B(e))return U(s2);let n=o2(e);if("exitCode"in n)return n;let r=n;if(!r.url)return{stdout:"",stderr:`curl: no URL specified
|
|
717
|
+
`,exitCode:2};if(!t.fetch)return{stdout:"",stderr:`curl: internal error: fetch not available
|
|
718
|
+
`,exitCode:1};let s=r.url;s.match(/^https?:\/\//)||(s=`https://${s}`);try{let{body:i,contentType:o}=await WE(r,t),a=zE(r,o),l=await t.fetch(s,{method:r.method,headers:a,body:i,followRedirects:r.followRedirects,timeoutMs:r.timeoutMs});if(await HE(r,l.headers,t),r.failSilently&&l.status>=400)return{stdout:"",stderr:r.showError||!r.silent?`curl: (22) The requested URL returned error: ${l.status}
|
|
719
|
+
`:"",exitCode:22};let c=GE(r,l,s);if(r.outputFile||r.useRemoteName){let u=r.outputFile||l2(s),f=t.fs.resolvePath(t.cwd,u);await t.fs.writeFile(f,r.headOnly?"":l.body),r.verbose||(c=""),r.writeOut&&(c=Ic(r.writeOut,{status:l.status,headers:l.headers,url:l.url,bodyLength:l.body.byteLength}))}return{stdout:c,stderr:"",exitCode:0}}catch(i){let o=qe(i),a=1;return o.includes("Network access denied")?a=7:o.includes("HTTP method")&&o.includes("not allowed")?a=3:o.includes("Redirect target not in allow-list")||o.includes("Too many redirects")?a=47:o.includes("aborted")&&(a=28),{stdout:"",stderr:!r.silent||r.showError?`curl: (${a}) ${o}
|
|
720
|
+
`:"",exitCode:a}}}}});function Oc(e){let{pid:t,ppid:n,uid:r,gid:s}=e;return`Name: bash
|
|
721
|
+
State: R (running)
|
|
722
|
+
Pid: ${t}
|
|
723
|
+
PPid: ${n}
|
|
724
|
+
Uid: ${r} ${r} ${r} ${r}
|
|
725
|
+
Gid: ${s} ${s} ${s} ${s}
|
|
726
|
+
`}var A2,S2,Rc=v(()=>{"use strict";A2="5.1.0(1)-release",S2="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT"});function k2(e){let t=e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!t)return!1;let n=e.slice(t[0].length);if(n===""||n==="+")return!0;if(n[0]==="["){let r=0,s=0;for(;s<n.length;s++)if(n[s]==="[")r++;else if(n[s]==="]"&&(r--,r===0))break;if(r!==0||s>=n.length)return!1;let i=n.slice(s+1);return i===""||i==="+"}return!1}function N2(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r==="[")t++;else if(r==="]")t--;else{if(t===0&&r==="=")return n;if(t===0&&r==="+"&&e[n+1]==="=")return n+1}}return-1}function uA(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function I2(e){return e===" "||e===" "||e===`
|
|
727
|
+
`||e===";"||e==="&"||e==="|"||e==="("||e===")"||e==="<"||e===">"}var E,fr,v2,aA,lA,cA,Ho,pr=v(()=>{"use strict";(function(e){e.EOF="EOF",e.NEWLINE="NEWLINE",e.SEMICOLON="SEMICOLON",e.AMP="AMP",e.PIPE="PIPE",e.PIPE_AMP="PIPE_AMP",e.AND_AND="AND_AND",e.OR_OR="OR_OR",e.BANG="BANG",e.LESS="LESS",e.GREAT="GREAT",e.DLESS="DLESS",e.DGREAT="DGREAT",e.LESSAND="LESSAND",e.GREATAND="GREATAND",e.LESSGREAT="LESSGREAT",e.DLESSDASH="DLESSDASH",e.CLOBBER="CLOBBER",e.TLESS="TLESS",e.AND_GREAT="AND_GREAT",e.AND_DGREAT="AND_DGREAT",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.DSEMI="DSEMI",e.SEMI_AND="SEMI_AND",e.SEMI_SEMI_AND="SEMI_SEMI_AND",e.DBRACK_START="DBRACK_START",e.DBRACK_END="DBRACK_END",e.DPAREN_START="DPAREN_START",e.DPAREN_END="DPAREN_END",e.IF="IF",e.THEN="THEN",e.ELSE="ELSE",e.ELIF="ELIF",e.FI="FI",e.FOR="FOR",e.WHILE="WHILE",e.UNTIL="UNTIL",e.DO="DO",e.DONE="DONE",e.CASE="CASE",e.ESAC="ESAC",e.IN="IN",e.FUNCTION="FUNCTION",e.SELECT="SELECT",e.TIME="TIME",e.COPROC="COPROC",e.WORD="WORD",e.NAME="NAME",e.NUMBER="NUMBER",e.ASSIGNMENT_WORD="ASSIGNMENT_WORD",e.FD_VARIABLE="FD_VARIABLE",e.COMMENT="COMMENT",e.HEREDOC_CONTENT="HEREDOC_CONTENT"})(E||(E={}));fr=class extends Error{line;column;constructor(t,n,r){super(`line ${n}: ${t}`),this.line=n,this.column=r,this.name="LexerError"}},v2=new Map([["if",E.IF],["then",E.THEN],["else",E.ELSE],["elif",E.ELIF],["fi",E.FI],["for",E.FOR],["while",E.WHILE],["until",E.UNTIL],["do",E.DO],["done",E.DONE],["case",E.CASE],["esac",E.ESAC],["in",E.IN],["function",E.FUNCTION],["select",E.SELECT],["time",E.TIME],["coproc",E.COPROC]]);aA=[[";",";","&",E.SEMI_SEMI_AND],["<","<","<",E.TLESS],["&",">",">",E.AND_DGREAT]],lA=[["[","[",E.DBRACK_START],["]","]",E.DBRACK_END],["(","(",E.DPAREN_START],[")",")",E.DPAREN_END],["&","&",E.AND_AND],["|","|",E.OR_OR],[";",";",E.DSEMI],[";","&",E.SEMI_AND],["|","&",E.PIPE_AMP],[">",">",E.DGREAT],["<","&",E.LESSAND],[">","&",E.GREATAND],["<",">",E.LESSGREAT],[">","|",E.CLOBBER],["&",">",E.AND_GREAT]],cA=new Map([["|",E.PIPE],["&",E.AMP],[";",E.SEMICOLON],["(",E.LPAREN],[")",E.RPAREN],["<",E.LESS],[">",E.GREAT]]);Ho=class{input;pos=0;line=1;column=1;tokens=[];pendingHeredocs=[];dparenDepth=0;maxHeredocSize;constructor(t,n){this.input=t,this.maxHeredocSize=n?.maxHeredocSize??10485760}tokenize(){let n=this.input.length,r=this.tokens,s=this.pendingHeredocs;for(;this.pos<n;){if(s.length>0&&r.length>0&&r[r.length-1].type===E.NEWLINE){this.readHeredocContent();continue}if(this.skipWhitespace(),this.pos>=n)break;let i=this.nextToken();i&&r.push(i)}return r.push({type:E.EOF,value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),r}skipWhitespace(){let t=this.input,n=t.length,r=this.pos,s=this.column,i=this.line;for(;r<n;){let o=t[r];if(o===" "||o===" ")r++,s++;else if(o==="\\"&&t[r+1]===`
|
|
728
|
+
`)r+=2,i++,s=1;else break}this.pos=r,this.column=s,this.line=i}nextToken(){let t=this.input,n=this.pos,r=this.line,s=this.column,i=t[n],o=t[n+1],a=t[n+2];if(i==="#"&&this.dparenDepth===0)return this.readComment(n,r,s);if(i===`
|
|
729
|
+
`)return this.pos=n+1,this.line++,this.column=1,{type:E.NEWLINE,value:`
|
|
730
|
+
`,start:n,end:n+1,line:r,column:s};if(i==="<"&&o==="<"&&a==="-")return this.pos=n+3,this.column=s+3,this.registerHeredocFromLookahead(!0),this.makeToken(E.DLESSDASH,"<<-",n,r,s);for(let[c,u,f,p]of aA)if(i===c&&o===u&&a===f)return this.pos=n+3,this.column=s+3,this.makeToken(p,c+u+f,n,r,s);if(i==="<"&&o==="<")return this.pos=n+2,this.column=s+2,this.registerHeredocFromLookahead(!1),this.makeToken(E.DLESS,"<<",n,r,s);if(i==="("&&o==="(")return this.dparenDepth>0?(this.pos=n+1,this.column=s+1,this.dparenDepth++,this.makeToken(E.LPAREN,"(",n,r,s)):this.looksLikeNestedSubshells(n+2)||this.dparenClosesWithSpacedParens(n+2)?(this.pos=n+1,this.column=s+1,this.makeToken(E.LPAREN,"(",n,r,s)):(this.pos=n+2,this.column=s+2,this.dparenDepth=1,this.makeToken(E.DPAREN_START,"((",n,r,s));if(i===")"&&o===")")return this.dparenDepth===1?(this.pos=n+2,this.column=s+2,this.dparenDepth=0,this.makeToken(E.DPAREN_END,"))",n,r,s)):this.dparenDepth>1?(this.pos=n+1,this.column=s+1,this.dparenDepth--,this.makeToken(E.RPAREN,")",n,r,s)):(this.pos=n+1,this.column=s+1,this.makeToken(E.RPAREN,")",n,r,s));for(let[c,u,f]of lA)if(!(c==="("&&u==="("||c===")"&&u===")")&&!(this.dparenDepth>0&&c===";"&&(f===E.DSEMI||f===E.SEMI_AND||f===E.SEMI_SEMI_AND))&&i===c&&o===u){if(f===E.DBRACK_START||f===E.DBRACK_END){let p=t[n+2];if(p!==void 0&&p!==" "&&p!==" "&&p!==`
|
|
731
|
+
`&&p!==";"&&p!=="&"&&p!=="|"&&p!=="("&&p!==")"&&p!=="<"&&p!==">")break}return this.pos=n+2,this.column=s+2,this.makeToken(f,c+u,n,r,s)}if(i==="("&&this.dparenDepth>0)return this.pos=n+1,this.column=s+1,this.dparenDepth++,this.makeToken(E.LPAREN,"(",n,r,s);if(i===")"&&this.dparenDepth>1)return this.pos=n+1,this.column=s+1,this.dparenDepth--,this.makeToken(E.RPAREN,")",n,r,s);let l=cA.get(i);if(l!==void 0)return this.pos=n+1,this.column=s+1,this.makeToken(l,i,n,r,s);if(i==="{"){let c=this.scanFdVariable(n);return c!==null?(this.pos=c.end,this.column=s+(c.end-n),{type:E.FD_VARIABLE,value:c.varname,start:n,end:c.end,line:r,column:s}):o==="}"?(this.pos=n+2,this.column=s+2,{type:E.WORD,value:"{}",start:n,end:n+2,line:r,column:s,quoted:!1,singleQuoted:!1}):this.scanBraceExpansion(n)!==null?this.readWordWithBraceExpansion(n,r,s):this.scanLiteralBraceWord(n)!==null?this.readWordWithBraceExpansion(n,r,s):o!==void 0&&o!==" "&&o!==" "&&o!==`
|
|
732
|
+
`?this.readWord(n,r,s):(this.pos=n+1,this.column=s+1,this.makeToken(E.LBRACE,"{",n,r,s))}return i==="}"?this.isWordCharFollowing(n+1)?this.readWord(n,r,s):(this.pos=n+1,this.column=s+1,this.makeToken(E.RBRACE,"}",n,r,s)):i==="!"?o==="="?(this.pos=n+2,this.column=s+2,this.makeToken(E.WORD,"!=",n,r,s)):(this.pos=n+1,this.column=s+1,this.makeToken(E.BANG,"!",n,r,s)):this.readWord(n,r,s)}looksLikeNestedSubshells(t){let n=this.input,r=n.length,s=t;for(;s<r&&(n[s]===" "||n[s]===" ");)s++;if(s>=r)return!1;let i=n[s];if(i==="(")return this.looksLikeNestedSubshells(s+1);let o=/[a-zA-Z_]/.test(i),a=i==="!"||i==="[";if(!o&&!a)return!1;let l=s;for(;l<r&&/[a-zA-Z0-9_\-.]/.test(n[l]);)l++;if(l===s)return a;let c=l;for(;c<r&&(n[c]===" "||n[c]===" ");)c++;if(c>=r)return!1;let u=n[c];if(u==="="&&n[c+1]!=="="||u===`
|
|
733
|
+
`||l===c&&/[+\-*/%<>&|^!~?:]/.test(u)&&u!=="-"||u===")"&&n[c+1]===")")return!1;if(c>l&&(u==="-"||u==='"'||u==="'"||u==="$"||/[a-zA-Z_/.]/.test(u))){let f=c;for(;f<r&&n[f]!==`
|
|
734
|
+
`;){if(n[f]===")")return!0;f++}return!1}if(u===")"){let f=c+1;for(;f<r&&(n[f]===" "||n[f]===" ");)f++;if(n[f]==="|"&&n[f+1]==="|"||n[f]==="&"&&n[f+1]==="&"||n[f]===";"||n[f]==="|"&&n[f+1]!=="|")return!0}return!1}makeToken(t,n,r,s,i){return{type:t,value:n,start:r,end:this.pos,line:s,column:i}}readComment(t,n,r){let s=this.input,i=s.length,o=this.pos;for(;o<i&&s[o]!==`
|
|
735
|
+
`;)o++;let a=s.slice(t,o);return this.pos=o,this.column=r+(o-t),{type:E.COMMENT,value:a,start:t,end:o,line:n,column:r}}readWord(t,n,r){let s=this.input,i=s.length,o=this.pos,a=o;for(;o<i;){let b=s[o];if(b===" "||b===" "||b===`
|
|
736
|
+
`||b===";"||b==="&"||b==="|"||b==="("||b===")"||b==="<"||b===">"||b==="'"||b==='"'||b==="\\"||b==="$"||b==="`"||b==="{"||b==="}"||b==="~"||b==="*"||b==="?"||b==="[")break;o++}if(o>a){let b=s[o];if(!(b==="("&&o>a&&"@*+?!".includes(s[o-1]))){if(o>=i||b===" "||b===" "||b===`
|
|
737
|
+
`||b===";"||b==="&"||b==="|"||b==="("||b===")"||b==="<"||b===">"){let x=s.slice(a,o);this.pos=o,this.column=r+(o-a);let A=v2.get(x);if(A!==void 0)return{type:A,value:x,start:t,end:o,line:n,column:r};let $=N2(x);return $>0&&k2(x.slice(0,$))?{type:E.ASSIGNMENT_WORD,value:x,start:t,end:o,line:n,column:r}:/^[0-9]+$/.test(x)?{type:E.NUMBER,value:x,start:t,end:o,line:n,column:r}:/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(x)?{type:E.NAME,value:x,start:t,end:o,line:n,column:r,quoted:!1,singleQuoted:!1}:{type:E.WORD,value:x,start:t,end:o,line:n,column:r,quoted:!1,singleQuoted:!1}}}}o=this.pos;let l=this.column,c=this.line,u="",f=!1,p=!1,h=!1,d=!1,m=s[o]==='"'||s[o]==="'",g=!1,y=0;for(;o<i;){let b=s[o];if(!h&&!d){if(b==="("&&u.length>0&&"@*+?!".includes(u[u.length-1])){let x=this.scanExtglobPattern(o);if(x!==null){u+=x.content,o=x.end,l+=x.content.length;continue}}if(b==="["&&y===0){if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u)){let x=o+1<i?s[o+1]:"";if(x==="^"||x==="!"){u+=b,o++,l++;continue}y=1,u+=b,o++,l++;continue}}else if(b==="["&&y>0){u.length>0&&u[u.length-1]!=="\\"&&y++,u+=b,o++,l++;continue}else if(b==="]"&&y>0){u.length>0&&u[u.length-1]!=="\\"&&y--,u+=b,o++,l++;continue}if(y>0){if(b===`
|
|
738
|
+
`)break;u+=b,o++,l++;continue}if(b===" "||b===" "||b===`
|
|
739
|
+
`||b===";"||b==="&"||b==="|"||b==="("||b===")"||b==="<"||b===">")break}if(b==="$"&&o+1<i&&s[o+1]==="'"&&!h&&!d){for(u+="$'",o+=2,l+=2;o<i&&s[o]!=="'";)s[o]==="\\"&&o+1<i?(u+=s[o]+s[o+1],o+=2,l+=2):(u+=s[o],o++,l++);o<i&&(u+="'",o++,l++);continue}if(b==="$"&&o+1<i&&s[o+1]==='"'&&!h&&!d){o++,l++,d=!0,f=!0,u===""&&(m=!0),o++,l++;continue}if(b==="'"&&!d){if(h)if(h=!1,!m||g)u+=b;else{let x=o+1<i?s[o+1]:"";x&&!I2(x)&&x!=="'"&&(x==='"'?(g=!0,u+=b,p=!1,f=!1):(g=!0,u+=b))}else h=!0,m&&!g?(p=!0,f=!0):u+=b;o++,l++;continue}if(b==='"'&&!h){if(d)if(d=!1,!m||g)u+=b;else{let x=o+1<i?s[o+1]:"";x&&!I2(x)&&x!=='"'&&(x==="'"?(g=!0,u+=b,p=!1,f=!1):(g=!0,u+=b))}else d=!0,m&&!g?f=!0:u+=b;o++,l++;continue}if(b==="\\"&&!h&&o+1<i){let x=s[o+1];if(x===`
|
|
740
|
+
`){o+=2,c++,l=1;continue}if(d){if(x==='"'||x==="\\"||x==="$"||x==="`"||x===`
|
|
741
|
+
`){if(x===`
|
|
742
|
+
`){o+=2,l=1,c++;continue}u+=b+x,o+=2,l+=2;continue}}else{x==="\\"||x==='"'||x==="'"||x==="`"||x==="*"||x==="?"||x==="["||x==="]"||x==="("||x===")"||x==="$"||x==="-"||x==="."||x==="^"||x==="+"||x==="{"||x==="}"?u+=b+x:u+=x,o+=2,l+=2;continue}}if(b==="$"&&o+1<i&&s[o+1]==="("&&!h){u+=b,o++,l++,u+=s[o],o++,l++;let x=1,A=!1,$=!1,O=0,F=!1,P="",M=s[o]==="("&&!this.dollarDparenIsSubshell(o);for(;x>0&&o<i;){let C=s[o];if(u+=C,A)C==="'"&&(A=!1);else if($)C==="\\"&&o+1<i?(u+=s[o+1],o++,l++):C==='"'&&($=!1);else if(C==="'")A=!0,P="";else if(C==='"')$=!0,P="";else if(C==="\\"&&o+1<i)u+=s[o+1],o++,l++,P="";else if(C==="$"&&o+1<i&&s[o+1]==="{"){o++,l++,u+=s[o],o++,l++;let N=1,R=!1,I=!1;for(;N>0&&o<i;){let T=s[o];if(T==="\\"&&o+1<i&&!R){u+=T,o++,l++,u+=s[o],o++,l++;continue}u+=T,R?T==="'"&&(R=!1):I?T==='"'&&(I=!1):T==="'"?R=!0:T==='"'?I=!0:T==="{"?N++:T==="}"&&N--,T===`
|
|
743
|
+
`?(c++,l=0):l++,o++}P="";continue}else if(C==="#"&&!M&&(P===""||/\s/.test(s[o-1]||""))){for(;o+1<i&&s[o+1]!==`
|
|
744
|
+
`;)o++,l++,u+=s[o];P=""}else/[a-zA-Z_]/.test(C)?P+=C:(P==="case"?(O++,F=!1):P==="in"&&O>0?F=!0:P==="esac"&&O>0&&(O--,F=!1),P="",C==="("?o>0&&s[o-1]==="$"?x++:F||x++:C===")"?F?F=!1:x--:C===";"&&O>0&&(o+1<i&&s[o+1]===";"||o+1<i&&s[o+1]==="&")&&(F=!0));C===`
|
|
745
|
+
`&&(c++,l=0,P=""),o++,l++}continue}if(b==="$"&&o+1<i&&s[o+1]==="["&&!h){u+=b,o++,l++,u+=s[o],o++,l++;let x=1;for(;x>0&&o<i;){let A=s[o];u+=A,A==="["?x++:A==="]"?x--:A===`
|
|
746
|
+
`&&(c++,l=0),o++,l++}continue}if(b==="$"&&o+1<i&&s[o+1]==="{"&&!h){u+=b,o++,l++,u+=s[o],o++,l++;let x=1,A=!1,$=!1,O=c,F=l,P=c,M=l;for(;x>0&&o<i;){let C=s[o];if(C==="\\"&&o+1<i&&s[o+1]===`
|
|
747
|
+
`){o+=2,c++,l=1;continue}if(C==="\\"&&o+1<i&&!A){u+=C,o++,l++,u+=s[o],o++,l++;continue}u+=C,A?C==="'"&&(A=!1):$?C==='"'&&($=!1):C==="'"?(A=!0,O=c,F=l):C==='"'?($=!0,P=c,M=l):C==="{"?x++:C==="}"&&x--,C===`
|
|
748
|
+
`&&(c++,l=0),o++,l++}if(A)throw new fr("unexpected EOF while looking for matching `''",O,F);if($)throw new fr("unexpected EOF while looking for matching `\"'",P,M);continue}if(b==="$"&&o+1<i&&!h){let x=s[o+1];if(x==="#"||x==="?"||x==="$"||x==="!"||x==="@"||x==="*"||x==="-"||x>="0"&&x<="9"){u+=b+x,o+=2,l+=2;continue}}if(b==="`"&&!h){for(u+=b,o++,l++;o<i&&s[o]!=="`";){let x=s[o];u+=x,x==="\\"&&o+1<i&&(u+=s[o+1],o++,l++),x===`
|
|
749
|
+
`&&(c++,l=0),o++,l++}o<i&&(u+=s[o],o++,l++);continue}u+=b,o++,b===`
|
|
750
|
+
`?(c++,l=1):l++}if(this.pos=o,this.column=l,this.line=c,g&&m&&(u=s[t]+u,f=!1,p=!1),h||d){let b=h?"'":'"';throw new fr(`unexpected EOF while looking for matching \`${b}'`,n,r)}if(!m&&u.length>=2){if(u[0]==="'"&&u[u.length-1]==="'"){let b=u.slice(1,-1);!b.includes("'")&&!b.includes('"')&&(u=b,f=!0,p=!0)}else if(u[0]==='"'&&u[u.length-1]==='"'){let b=u.slice(1,-1),x=!1;for(let A=0;A<b.length;A++){if(b[A]==='"'){x=!0;break}b[A]==="\\"&&A+1<b.length&&A++}x||(u=b,f=!0,p=!1)}}if(u==="")return{type:E.WORD,value:"",start:t,end:o,line:n,column:r,quoted:f,singleQuoted:p};let w=v2.get(u);if(!f&&w!==void 0)return{type:w,value:u,start:t,end:o,line:n,column:r};if(!m){let b=N2(u);if(b>0&&k2(u.slice(0,b)))return{type:E.ASSIGNMENT_WORD,value:u,start:t,end:o,line:n,column:r,quoted:f,singleQuoted:p}}return/^[0-9]+$/.test(u)?{type:E.NUMBER,value:u,start:t,end:o,line:n,column:r}:uA(u)?{type:E.NAME,value:u,start:t,end:o,line:n,column:r,quoted:f,singleQuoted:p}:{type:E.WORD,value:u,start:t,end:o,line:n,column:r,quoted:f,singleQuoted:p}}readHeredocContent(){for(;this.pendingHeredocs.length>0;){let t=this.pendingHeredocs.shift();if(!t)break;let n=this.pos,r=this.line,s=this.column,i="";for(;this.pos<this.input.length;){let o="";for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
751
|
+
`;)o+=this.input[this.pos],this.pos++,this.column++;if((t.stripTabs?o.replace(/^\t+/,""):o)===t.delimiter){this.pos<this.input.length&&this.input[this.pos]===`
|
|
752
|
+
`&&(this.pos++,this.line++,this.column=1);break}if(i+=o,i.length>this.maxHeredocSize)throw new fr(`Heredoc size limit exceeded (${this.maxHeredocSize} bytes)`,r,s);this.pos<this.input.length&&this.input[this.pos]===`
|
|
753
|
+
`&&(i+=`
|
|
754
|
+
`,this.pos++,this.line++,this.column=1)}this.tokens.push({type:E.HEREDOC_CONTENT,value:i,start:n,end:this.pos,line:r,column:s})}}addPendingHeredoc(t,n,r){this.pendingHeredocs.push({delimiter:t,stripTabs:n,quoted:r})}registerHeredocFromLookahead(t){let n=this.pos,r=this.column;for(;this.pos<this.input.length&&(this.input[this.pos]===" "||this.input[this.pos]===" ");)this.pos++,this.column++;let s="",i=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(/[\s;<>&|()]/.test(o))break;if(o==="'"||o==='"'){i=!0;let a=o;for(this.pos++,this.column++;this.pos<this.input.length&&this.input[this.pos]!==a;)s+=this.input[this.pos],this.pos++,this.column++;this.pos<this.input.length&&this.input[this.pos]===a&&(this.pos++,this.column++)}else o==="\\"?(i=!0,this.pos++,this.column++,this.pos<this.input.length&&(s+=this.input[this.pos],this.pos++,this.column++)):(s+=o,this.pos++,this.column++)}this.pos=n,this.column=r,s&&this.pendingHeredocs.push({delimiter:s,stripTabs:t,quoted:i})}isWordCharFollowing(t){if(t>=this.input.length)return!1;let n=this.input[t];return!(n===" "||n===" "||n===`
|
|
755
|
+
`||n===";"||n==="&"||n==="|"||n==="("||n===")"||n==="<"||n===">")}readWordWithBraceExpansion(t,n,r){let s=this.input,i=s.length,o=t,a=r;for(;o<i;){let c=s[o];if(c===" "||c===" "||c===`
|
|
756
|
+
`||c===";"||c==="&"||c==="|"||c==="("||c===")"||c==="<"||c===">")break;if(c==="{"){if(this.scanBraceExpansion(o)!==null){let f=1;for(o++,a++;o<i&&f>0;)s[o]==="{"?f++:s[o]==="}"&&f--,o++,a++;continue}o++,a++;continue}if(c==="}"){o++,a++;continue}if(c==="$"&&o+1<i&&s[o+1]==="("){o++,a++,o++,a++;let u=1;for(;u>0&&o<i;)s[o]==="("?u++:s[o]===")"&&u--,o++,a++;continue}if(c==="$"&&o+1<i&&s[o+1]==="{"){o++,a++,o++,a++;let u=1;for(;u>0&&o<i;)s[o]==="{"?u++:s[o]==="}"&&u--,o++,a++;continue}if(c==="`"){for(o++,a++;o<i&&s[o]!=="`";)s[o]==="\\"&&o+1<i?(o+=2,a+=2):(o++,a++);o<i&&(o++,a++);continue}o++,a++}let l=s.slice(t,o);return this.pos=o,this.column=a,{type:E.WORD,value:l,start:t,end:o,line:n,column:r,quoted:!1,singleQuoted:!1}}scanBraceExpansion(t){let n=this.input,r=n.length,s=t+1,i=1,o=!1,a=!1;for(;s<r&&i>0;){let l=n[s];if(l==="{")i++,s++;else if(l==="}")i--,s++;else if(l===","&&i===1)o=!0,s++;else if(l==="."&&s+1<r&&n[s+1]===".")a=!0,s+=2;else{if(l===" "||l===" "||l===`
|
|
757
|
+
`||l===";"||l==="&"||l==="|")return null;s++}}return i===0&&(o||a)?n.slice(t,s):null}scanLiteralBraceWord(t){let n=this.input,r=n.length,s=t+1,i=1;for(;s<r&&i>0;){let o=n[s];if(o==="{")i++,s++;else if(o==="}"){if(i--,i===0)return n.slice(t,s+1);s++}else{if(o===" "||o===" "||o===`
|
|
758
|
+
`||o===";"||o==="&"||o==="|")return null;s++}}return null}scanExtglobPattern(t){let n=this.input,r=n.length,s=t+1,i=1;for(;s<r&&i>0;){let o=n[s];if(o==="\\"&&s+1<r){s+=2;continue}if("@*+?!".includes(o)&&s+1<r&&n[s+1]==="("){s++,i++,s++;continue}if(o==="(")i++,s++;else if(o===")")i--,s++;else{if(o===`
|
|
759
|
+
`)return null;s++}}return i===0?{content:n.slice(t,s),end:s}:null}scanFdVariable(t){let n=this.input,r=n.length,s=t+1,i=s;for(;s<r;){let u=n[s];if(s===i){if(!(u>="a"&&u<="z"||u>="A"&&u<="Z"||u==="_"))return null}else if(!(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||u==="_"))break;s++}if(s===i)return null;let o=n.slice(i,s);if(s>=r||n[s]!=="}"||(s++,s>=r))return null;let a=n[s],l=s+1<r?n[s+1]:"";return a===">"||a==="<"||a==="&"&&(l===">"||l==="<")?{varname:o,end:s}:null}dollarDparenIsSubshell(t){let n=this.input,r=n.length,s=t+1,i=2,o=!1,a=!1,l=!1;for(;s<r&&i>0;){let c=n[s];if(o){c==="'"&&(o=!1),c===`
|
|
760
|
+
`&&(l=!0),s++;continue}if(a){if(c==="\\"){s+=2;continue}c==='"'&&(a=!1),c===`
|
|
761
|
+
`&&(l=!0),s++;continue}if(c==="'"){o=!0,s++;continue}if(c==='"'){a=!0,s++;continue}if(c==="\\"){s+=2;continue}if(c===`
|
|
762
|
+
`&&(l=!0),c==="("){i++,s++;continue}if(c===")"){if(i--,i===1){let u=s+1;if(u<r&&n[u]===")")return!1;let f=u,p=!1;for(;f<r&&(n[f]===" "||n[f]===" "||n[f]===`
|
|
763
|
+
`);)p=!0,f++;if(p&&f<r&&n[f]===")"||l)return!0}if(i===0)return!1;s++;continue}s++}return!1}dparenClosesWithSpacedParens(t){let n=this.input,r=n.length,s=t,i=2,o=!1,a=!1;for(;s<r&&i>0;){let l=n[s];if(o){l==="'"&&(o=!1),s++;continue}if(a){if(l==="\\"){s+=2;continue}l==='"'&&(a=!1),s++;continue}if(l==="'"){o=!0,s++;continue}if(l==='"'){a=!0,s++;continue}if(l==="\\"){s+=2;continue}if(l==="("){i++,s++;continue}if(l===")"){if(i--,i===1){let c=s+1;if(c<r&&n[c]===")")return!1;let u=c,f=!1;for(;u<r&&(n[u]===" "||n[u]===" "||n[u]===`
|
|
764
|
+
`);)f=!0,u++;if(f&&u<r&&n[u]===")")return!0}if(i===0)return!1;s++;continue}if(i===1&&(l==="|"&&s+1<r&&n[s+1]==="|"||l==="&"&&s+1<r&&n[s+1]==="&"||l==="|"&&s+1<r&&n[s+1]!=="|"))return!0;s++}return!1}}});var _c,Fc,$2,Lc,O2,R2,T2,bt,Br=v(()=>{"use strict";pr();_c=1e6,Fc=1e5,$2=1e6,Lc=200,O2=new Set([E.LESS,E.GREAT,E.DLESS,E.DGREAT,E.LESSAND,E.GREATAND,E.LESSGREAT,E.DLESSDASH,E.CLOBBER,E.TLESS,E.AND_GREAT,E.AND_DGREAT]),R2=new Set([E.LESS,E.GREAT,E.DLESS,E.DGREAT,E.LESSAND,E.GREATAND,E.LESSGREAT,E.DLESSDASH,E.CLOBBER,E.TLESS]),T2=new Set([E.LESS,E.GREAT,E.DLESS,E.DGREAT,E.LESSAND,E.GREATAND,E.LESSGREAT,E.DLESSDASH,E.CLOBBER,E.TLESS,E.AND_GREAT,E.AND_DGREAT]),bt=class extends Error{line;column;token;constructor(t,n,r,s=void 0){super(`Parse error at ${n}:${r}: ${t}`),this.line=n,this.column=r,this.token=s,this.name="ParseException"}}});var Y,Wr=v(()=>{"use strict";Y={script(e){return{type:"Script",statements:e}},statement(e,t=[],n=!1,r,s){let i={type:"Statement",pipelines:e,operators:t,background:n};return r&&(i.deferredError=r),s!==void 0&&(i.sourceText=s),i},pipeline(e,t=!1,n=!1,r=!1,s){return{type:"Pipeline",commands:e,negated:t,timed:n,timePosix:r,pipeStderr:s}},simpleCommand(e,t=[],n=[],r=[]){return{type:"SimpleCommand",name:e,args:t,assignments:n,redirections:r}},word(e){return{type:"Word",parts:e}},literal(e){return{type:"Literal",value:e}},singleQuoted(e){return{type:"SingleQuoted",value:e}},doubleQuoted(e){return{type:"DoubleQuoted",parts:e}},escaped(e){return{type:"Escaped",value:e}},parameterExpansion(e,t=null){return{type:"ParameterExpansion",parameter:e,operation:t}},commandSubstitution(e,t=!1){return{type:"CommandSubstitution",body:e,legacy:t}},arithmeticExpansion(e){return{type:"ArithmeticExpansion",expression:e}},assignment(e,t,n=!1,r=null){return{type:"Assignment",name:e,value:t,append:n,array:r}},redirection(e,t,n=null,r){let s={type:"Redirection",fd:n,operator:e,target:t};return r&&(s.fdVariable=r),s},hereDoc(e,t,n=!1,r=!1){return{type:"HereDoc",delimiter:e,content:t,stripTabs:n,quoted:r}},ifNode(e,t=null,n=[]){return{type:"If",clauses:e,elseBody:t,redirections:n}},forNode(e,t,n,r=[]){return{type:"For",variable:e,words:t,body:n,redirections:r}},whileNode(e,t,n=[]){return{type:"While",condition:e,body:t,redirections:n}},untilNode(e,t,n=[]){return{type:"Until",condition:e,body:t,redirections:n}},caseNode(e,t,n=[]){return{type:"Case",word:e,items:t,redirections:n}},caseItem(e,t,n=";;"){return{type:"CaseItem",patterns:e,body:t,terminator:n}},subshell(e,t=[]){return{type:"Subshell",body:e,redirections:t}},group(e,t=[]){return{type:"Group",body:e,redirections:t}},functionDef(e,t,n=[],r){return{type:"FunctionDef",name:e,body:t,redirections:n,sourceFile:r}},conditionalCommand(e,t=[],n){return{type:"ConditionalCommand",expression:e,redirections:t,line:n}},arithmeticCommand(e,t=[],n){return{type:"ArithmeticCommand",expression:e,redirections:t,line:n}}}});function Ke(e,t){for(;t<e.length;){if(e[t]==="\\"&&e[t+1]===`
|
|
765
|
+
`){t+=2;continue}if(/\s/.test(e[t])){t++;continue}break}return t}function mi(e){if(e.includes("#")){let[n,r]=e.split("#"),s=Number.parseInt(n,10);if(s<2||s>64)return Number.NaN;if(s<=36){let o=Number.parseInt(r,s);return o>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:o}let i=0;for(let o of r){let a;if(/[0-9]/.test(o))a=o.charCodeAt(0)-48;else if(/[a-z]/.test(o))a=o.charCodeAt(0)-97+10;else if(/[A-Z]/.test(o))a=o.charCodeAt(0)-65+36;else if(o==="@")a=62;else if(o==="_")a=63;else return Number.NaN;if(a>=s)return Number.NaN;if(i=i*s+a,i>Number.MAX_SAFE_INTEGER)return Number.MAX_SAFE_INTEGER}return i}if(e.startsWith("0x")||e.startsWith("0X")){let n=Number.parseInt(e.slice(2),16);return n>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:n}if(e.startsWith("0")&&e.length>1&&/^[0-9]+$/.test(e)){if(/[89]/.test(e))return Number.NaN;let n=Number.parseInt(e,8);return n>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:n}let t=Number.parseInt(e,10);return t>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t}function P2(e,t,n,r){if(n.slice(r,r+3)!=="$((")return null;let s=r+3,i=1,o=s;for(;s<n.length-1&&i>0;)n[s]==="("&&n[s+1]==="("?(i++,s+=2):n[s]===")"&&n[s+1]===")"?(i--,i>0&&(s+=2)):s++;let a=n.slice(o,s),{expr:l}=e(t,a,0);return s+=2,{expr:{type:"ArithNested",expression:l},pos:s}}function D2(e,t){if(e.slice(t,t+2)!=="$'")return null;let n=t+2,r="";for(;n<e.length&&e[n]!=="'";)if(e[n]==="\\"&&n+1<e.length){let i=e[n+1];switch(i){case"n":r+=`
|
|
766
|
+
`;break;case"t":r+=" ";break;case"r":r+="\r";break;case"\\":r+="\\";break;case"'":r+="'";break;default:r+=i}n+=2}else r+=e[n],n++;e[n]==="'"&&n++;let s=Number.parseInt(r,10);return{expr:{type:"ArithNumber",value:Number.isNaN(s)?0:s},pos:n}}function _2(e,t){if(e.slice(t,t+2)!=='$"')return null;let n=t+2,r="";for(;n<e.length&&e[n]!=='"';)e[n]==="\\"&&n+1<e.length?(r+=e[n+1],n+=2):(r+=e[n],n++);e[n]==='"'&&n++;let s=Number.parseInt(r,10);return{expr:{type:"ArithNumber",value:Number.isNaN(s)?0:s},pos:n}}var jo,F2=v(()=>{"use strict";jo=["=","+=","-=","*=","/=","%=","<<=",">>=","&=","|=","^="]});function fA(e){let t="",n=0;for(;n<e.length;)if(e[n]==='"'){for(n++;n<e.length&&e[n]!=='"';)e[n]==="\\"&&n+1<e.length?(t+=e[n+1],n+=2):(t+=e[n],n++);n<e.length&&n++}else t+=e[n],n++;return t}function Ce(e,t){let n=fA(t),{expr:r,pos:s}=nn(e,n,0),i=Ke(n,s);if(i<n.length){let o=t.slice(i).trim();if(o)return{type:"ArithmeticExpression",originalText:t,expression:{type:"ArithSyntaxError",errorToken:o,message:`${o}: syntax error: invalid arithmetic operator (error token is "${o}")`}}}return{type:"ArithmeticExpression",expression:r,originalText:t}}function Vt(e,t){return{expr:{type:"ArithSyntaxError",errorToken:e,message:`syntax error: operand expected (error token is "${e}")`},pos:t}}function qt(e,t){return Ke(e,t)>=e.length}function nn(e,t,n){return pA(e,t,n)}function pA(e,t,n){let{expr:r,pos:s}=gi(e,t,n);for(s=Ke(t,s);t[s]===",";){if(s++,qt(t,s))return Vt(",",s);let{expr:o,pos:a}=gi(e,t,s);r={type:"ArithBinary",operator:",",left:r,right:o},s=Ke(t,a)}return{expr:r,pos:s}}function gi(e,t,n){let{expr:r,pos:s}=hA(e,t,n);if(s=Ke(t,s),t[s]==="?"){s++;let{expr:i,pos:o}=nn(e,t,s);if(s=Ke(t,o),t[s]===":"){s++;let{expr:a,pos:l}=nn(e,t,s);return{expr:{type:"ArithTernary",condition:r,consequent:i,alternate:a},pos:l}}}return{expr:r,pos:s}}function hA(e,t,n){let{expr:r,pos:s}=L2(e,t,n);for(;s=Ke(t,s),t.slice(s,s+2)==="||";){if(s+=2,qt(t,s))return Vt("||",s);let{expr:o,pos:a}=L2(e,t,s);r={type:"ArithBinary",operator:"||",left:r,right:o},s=a}return{expr:r,pos:s}}function L2(e,t,n){let{expr:r,pos:s}=M2(e,t,n);for(;s=Ke(t,s),t.slice(s,s+2)==="&&";){if(s+=2,qt(t,s))return Vt("&&",s);let{expr:o,pos:a}=M2(e,t,s);r={type:"ArithBinary",operator:"&&",left:r,right:o},s=a}return{expr:r,pos:s}}function M2(e,t,n){let{expr:r,pos:s}=U2(e,t,n);for(;s=Ke(t,s),t[s]==="|"&&t[s+1]!=="|";){if(s++,qt(t,s))return Vt("|",s);let{expr:o,pos:a}=U2(e,t,s);r={type:"ArithBinary",operator:"|",left:r,right:o},s=a}return{expr:r,pos:s}}function U2(e,t,n){let{expr:r,pos:s}=B2(e,t,n);for(;s=Ke(t,s),t[s]==="^";){if(s++,qt(t,s))return Vt("^",s);let{expr:o,pos:a}=B2(e,t,s);r={type:"ArithBinary",operator:"^",left:r,right:o},s=a}return{expr:r,pos:s}}function B2(e,t,n){let{expr:r,pos:s}=W2(e,t,n);for(;s=Ke(t,s),t[s]==="&"&&t[s+1]!=="&";){if(s++,qt(t,s))return Vt("&",s);let{expr:o,pos:a}=W2(e,t,s);r={type:"ArithBinary",operator:"&",left:r,right:o},s=a}return{expr:r,pos:s}}function W2(e,t,n){let{expr:r,pos:s}=z2(e,t,n);for(;s=Ke(t,s),t.slice(s,s+2)==="=="||t.slice(s,s+2)==="!=";){let i=t.slice(s,s+2);if(s+=2,qt(t,s))return Vt(i,s);let{expr:o,pos:a}=z2(e,t,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}return{expr:r,pos:s}}function z2(e,t,n){let{expr:r,pos:s}=Mc(e,t,n);for(;;)if(s=Ke(t,s),t.slice(s,s+2)==="<="||t.slice(s,s+2)===">="){let i=t.slice(s,s+2);if(s+=2,qt(t,s))return Vt(i,s);let{expr:o,pos:a}=Mc(e,t,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}else if(t[s]==="<"||t[s]===">"){let i=t[s];if(s++,qt(t,s))return Vt(i,s);let{expr:o,pos:a}=Mc(e,t,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}else break;return{expr:r,pos:s}}function Mc(e,t,n){let{expr:r,pos:s}=H2(e,t,n);for(;s=Ke(t,s),t.slice(s,s+2)==="<<"||t.slice(s,s+2)===">>";){let i=t.slice(s,s+2);if(s+=2,qt(t,s))return Vt(i,s);let{expr:o,pos:a}=H2(e,t,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}return{expr:r,pos:s}}function H2(e,t,n){let{expr:r,pos:s}=j2(e,t,n);for(;s=Ke(t,s),(t[s]==="+"||t[s]==="-")&&t[s+1]!==t[s];){let i=t[s];if(s++,qt(t,s))return Vt(i,s);let{expr:o,pos:a}=j2(e,t,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}return{expr:r,pos:s}}function j2(e,t,n){let{expr:r,pos:s}=Go(e,t,n);for(;;)if(s=Ke(t,s),t[s]==="*"&&t[s+1]!=="*"){if(s++,qt(t,s))return Vt("*",s);let{expr:o,pos:a}=Go(e,t,s);r={type:"ArithBinary",operator:"*",left:r,right:o},s=a}else if(t[s]==="/"||t[s]==="%"){let i=t[s];if(s++,qt(t,s))return Vt(i,s);let{expr:o,pos:a}=Go(e,t,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}else break;return{expr:r,pos:s}}function Go(e,t,n){let{expr:r,pos:s}=Uc(e,t,n),i=Ke(t,s);if(t.slice(i,i+2)==="**"){if(i+=2,qt(t,i))return Vt("**",i);let{expr:a,pos:l}=Go(e,t,i);return{expr:{type:"ArithBinary",operator:"**",left:r,right:a},pos:l}}return{expr:r,pos:s}}function Uc(e,t,n){let r=Ke(t,n);if(t.slice(r,r+2)==="++"||t.slice(r,r+2)==="--"){let s=t.slice(r,r+2);r+=2;let{expr:i,pos:o}=Uc(e,t,r);return{expr:{type:"ArithUnary",operator:s,operand:i,prefix:!0},pos:o}}if(t[r]==="+"||t[r]==="-"||t[r]==="!"||t[r]==="~"){let s=t[r];r++;let{expr:i,pos:o}=Uc(e,t,r);return{expr:{type:"ArithUnary",operator:s,operand:i,prefix:!0},pos:o}}return mA(e,t,r)}function dA(e,t){let n=e[t];return n==="$"||n==="`"}function mA(e,t,n){let{expr:r,pos:s}=G2(e,t,n,!1),i=[r];for(;dA(t,s);){let{expr:a,pos:l}=G2(e,t,s,!0);i.push(a),s=l}i.length>1&&(r={type:"ArithConcat",parts:i});let o;if(t[s]==="["&&r.type==="ArithConcat"){s++;let{expr:a,pos:l}=nn(e,t,s);o=a,s=l,t[s]==="]"&&s++}if(o&&r.type==="ArithConcat"&&(r={type:"ArithDynamicElement",nameExpr:r,subscript:o},o=void 0),s=Ke(t,s),r.type==="ArithConcat"||r.type==="ArithVariable"||r.type==="ArithDynamicElement"){for(let a of jo)if(t.slice(s,s+a.length)===a&&t.slice(s,s+a.length+1)!=="=="){s+=a.length;let{expr:l,pos:c}=gi(e,t,s);return r.type==="ArithDynamicElement"?{expr:{type:"ArithDynamicAssignment",operator:a,target:r.nameExpr,subscript:r.subscript,value:l},pos:c}:r.type==="ArithConcat"?{expr:{type:"ArithDynamicAssignment",operator:a,target:r,value:l},pos:c}:{expr:{type:"ArithAssignment",operator:a,variable:r.name,value:l},pos:c}}}if(t.slice(s,s+2)==="++"||t.slice(s,s+2)==="--"){let a=t.slice(s,s+2);return s+=2,{expr:{type:"ArithUnary",operator:a,operand:r,prefix:!1},pos:s}}return{expr:r,pos:s}}function G2(e,t,n,r=!1){let s=Ke(t,n),i=P2(nn,e,t,s);if(i)return i;let o=D2(t,s);if(o)return o;let a=_2(t,s);if(a)return a;if(t.slice(s,s+2)==="$("&&t[s+2]!=="("){s+=2;let c=1,u=s;for(;s<t.length&&c>0;)t[s]==="("?c++:t[s]===")"&&c--,c>0&&s++;let f=t.slice(u,s);return s++,{expr:{type:"ArithCommandSubst",command:f},pos:s}}if(t[s]==="`"){s++;let c=s;for(;s<t.length&&t[s]!=="`";)s++;let u=t.slice(c,s);return t[s]==="`"&&s++,{expr:{type:"ArithCommandSubst",command:u},pos:s}}if(t[s]==="("){s++;let{expr:c,pos:u}=nn(e,t,s);return s=Ke(t,u),t[s]===")"&&s++,{expr:{type:"ArithGroup",expression:c},pos:s}}if(t[s]==="'"){s++;let c="";for(;s<t.length&&t[s]!=="'";)c+=t[s],s++;t[s]==="'"&&s++;let u=Number.parseInt(c,10);return{expr:{type:"ArithSingleQuote",content:c,value:Number.isNaN(u)?0:u},pos:s}}if(t[s]==='"'){s++;let c="";for(;s<t.length&&t[s]!=='"';)t[s]==="\\"&&s+1<t.length?(c+=t[s+1],s+=2):(c+=t[s],s++);t[s]==='"'&&s++;let u=c.trim();if(!u)return{expr:{type:"ArithNumber",value:0},pos:s};let{expr:f}=nn(e,u,0);return{expr:f,pos:s}}if(/[0-9]/.test(t[s])){let c="",u=!1,f=!1;for(;s<t.length;){let h=t[s];if(u)if(/[0-9a-zA-Z@_]/.test(h))c+=h,s++;else break;else if(h==="#")u=!0,c+=h,s++;else if(c==="0"&&(h==="x"||h==="X")&&s+1<t.length&&/[0-9a-fA-F]/.test(t[s+1]))f=!0,c+=h,s++;else if(f&&/[0-9a-fA-F]/.test(h))c+=h,s++;else if(!f&&/[0-9]/.test(h))c+=h,s++;else break}if(s<t.length&&/[a-zA-Z_]/.test(t[s])){let h=c;for(;s<t.length&&/[a-zA-Z0-9_]/.test(t[s]);)h+=t[s],s++;return{expr:{type:"ArithSyntaxError",errorToken:h,message:`${h}: value too great for base (error token is "${h}")`},pos:s}}if(t[s]==="."&&/[0-9]/.test(t[s+1]))throw new De(`${c}.${t[s+1]}...: syntax error: invalid arithmetic operator`);if(t[s]==="["){let h=t.slice(s).trim();return{expr:{type:"ArithNumberSubscript",number:c,errorToken:h},pos:t.length}}return{expr:{type:"ArithNumber",value:mi(c)},pos:s}}if(t[s]==="$"&&t[s+1]==="{"){let c=s+2,u=1,f=c;for(;f<t.length&&u>0;)t[f]==="{"?u++:t[f]==="}"&&u--,u>0&&f++;let p=t.slice(c,f),h=f+1;if(t[h]==="#"){let d=h+1;for(;d<t.length&&/[0-9a-zA-Z@_]/.test(t[d]);)d++;let m=t.slice(h+1,d);return{expr:{type:"ArithDynamicBase",baseExpr:p,value:m},pos:d}}if(/[0-9]/.test(t[h])||t[h]==="x"||t[h]==="X"){let d=h;if(t[h]==="x"||t[h]==="X")for(d++;d<t.length&&/[0-9a-fA-F]/.test(t[d]);)d++;else for(;d<t.length&&/[0-9]/.test(t[d]);)d++;let m=t.slice(h,d);return{expr:{type:"ArithDynamicNumber",prefix:p,suffix:m},pos:d}}return s=h,{expr:{type:"ArithBracedExpansion",content:p},pos:s}}if(t[s]==="$"&&s+1<t.length&&/[0-9]/.test(t[s+1])){s++;let c="";for(;s<t.length&&/[0-9]/.test(t[s]);)c+=t[s],s++;return{expr:{type:"ArithVariable",name:c,hasDollarPrefix:!0},pos:s}}if(t[s]==="$"&&s+1<t.length&&/[*@#?\-!$]/.test(t[s+1])){let c=t[s+1];return s+=2,{expr:{type:"ArithSpecialVar",name:c},pos:s}}let l=!1;if(t[s]==="$"&&s+1<t.length&&/[a-zA-Z_]/.test(t[s+1])&&(l=!0,s++),s<t.length&&/[a-zA-Z_]/.test(t[s])){let c="";for(;s<t.length&&/[a-zA-Z0-9_]/.test(t[s]);)c+=t[s],s++;if(t[s]==="["&&!r){s++;let u;if(t[s]==="'"||t[s]==='"'){let p=t[s];for(s++,u="";s<t.length&&t[s]!==p;)u+=t[s],s++;t[s]===p&&s++,s=Ke(t,s),t[s]==="]"&&s++}let f;if(u===void 0){let{expr:p,pos:h}=nn(e,t,s);f=p,s=h,t[s]==="]"&&s++}if(s=Ke(t,s),t[s]==="["&&f)return{expr:{type:"ArithDoubleSubscript",array:c,index:f},pos:s};if(!r){for(let p of jo)if(t.slice(s,s+p.length)===p&&t.slice(s,s+p.length+1)!=="=="){s+=p.length;let{expr:h,pos:d}=gi(e,t,s);return{expr:{type:"ArithAssignment",operator:p,variable:c,subscript:f,stringKey:u,value:h},pos:d}}}return{expr:{type:"ArithArrayElement",array:c,index:f,stringKey:u},pos:s}}if(s=Ke(t,s),!r){for(let u of jo)if(t.slice(s,s+u.length)===u&&t.slice(s,s+u.length+1)!=="=="){s+=u.length;let{expr:f,pos:p}=gi(e,t,s);return{expr:{type:"ArithAssignment",operator:u,variable:c,value:f},pos:p}}}return{expr:{type:"ArithVariable",name:c,hasDollarPrefix:l},pos:s}}if(t[s]==="#"){let c=s+1;for(;c<t.length&&t[c]!==`
|
|
767
|
+
`;)c++;let u=t.slice(s,c).trim()||"#";return{expr:{type:"ArithSyntaxError",errorToken:u,message:`${u}: syntax error: invalid arithmetic operator (error token is "${u}")`},pos:t.length}}return{expr:{type:"ArithNumber",value:0},pos:s}}var Nt=v(()=>{"use strict";xe();F2()});function gA(e){let t="",n=0;for(;n<e.length;){let r=e[n];if(r<128){t+=String.fromCharCode(r),n++;continue}if((r&224)===192){if(n+1<e.length&&(e[n+1]&192)===128&&r>=194){let s=(r&31)<<6|e[n+1]&63;t+=String.fromCharCode(s),n+=2;continue}t+=String.fromCharCode(r),n++;continue}if((r&240)===224){if(n+2<e.length&&(e[n+1]&192)===128&&(e[n+2]&192)===128){if(r===224&&e[n+1]<160){t+=String.fromCharCode(r),n++;continue}let s=(r&15)<<12|(e[n+1]&63)<<6|e[n+2]&63;if(s>=55296&&s<=57343){t+=String.fromCharCode(r),n++;continue}t+=String.fromCharCode(s),n+=3;continue}t+=String.fromCharCode(r),n++;continue}if((r&248)===240&&r<=244){if(n+3<e.length&&(e[n+1]&192)===128&&(e[n+2]&192)===128&&(e[n+3]&192)===128){if(r===240&&e[n+1]<144){t+=String.fromCharCode(r),n++;continue}let s=(r&7)<<18|(e[n+1]&63)<<12|(e[n+2]&63)<<6|e[n+3]&63;if(s>1114111){t+=String.fromCharCode(r),n++;continue}t+=String.fromCodePoint(s),n+=4;continue}t+=String.fromCharCode(r),n++;continue}t+=String.fromCharCode(r),n++}return t}function Z2(e,t,n){let r=n+1;for(;r<t.length&&/[a-zA-Z0-9_-]/.test(t[r]);)r++;return r}function Bc(e,t,n,r,s){let i=1,o=n+1;for(;o<t.length&&i>0;)t[o]===r?i++:t[o]===s&&i--,i>0&&o++;return i===0?o:-1}function zr(e,t,n){let r=n,s=1;for(;r<t.length&&s>0;){let i=t[r];if(i==="\\"&&r+1<t.length){r+=2;continue}if(i==="'"){let o=t.indexOf("'",r+1);if(o!==-1){r=o+1;continue}}if(i==='"'){for(r++;r<t.length&&t[r]!=='"';)t[r]==="\\"&&r+1<t.length?r+=2:r++;r<t.length&&r++;continue}i==="{"?s++:i==="}"&&s--,s>0&&r++}return r}function K2(e,t,n){let r=n,s=!1;for(;r<t.length;){let i=t[r];if(i==="/"&&s||i==="}")break;if(i==="'"){let o=t.indexOf("'",r+1);if(o!==-1){r=o+1,s=!0;continue}}if(i==='"'){for(r++;r<t.length&&t[r]!=='"';)t[r]==="\\"&&r+1<t.length?r+=2:r++;r<t.length&&r++,s=!0;continue}i==="\\"?(r+=2,s=!0):(r++,s=!0)}return r}function Q2(e,t,n){let r=n,s="";for(;r<t.length;){let i=t[r];if(i==="*"||i==="?")s+=i,r++;else if(i==="["){let o=yA(t,r);o===-1?(s+=i,r++):(s+=t.slice(r,o+1),r=o+1)}else break}return{pattern:s,endIndex:r}}function yA(e,t){let n=t+1;for(n<e.length&&e[n]==="^"&&n++,n<e.length&&e[n]==="]"&&n++;n<e.length;){let r=e[n];if(r==="\\"&&n+1<e.length){let s=e[n+1];if(s==='"'||s==="'")return-1;n+=2;continue}if(r==="]")return n;if(r==='"'||r==="$"||r==="`")return-1;if(r==="'"){let s=e.indexOf("'",n+1);if(s!==-1){n=s+1;continue}}if(r==="["&&n+1<e.length&&e[n+1]===":"){let s=e.indexOf(":]",n+2);if(s!==-1){n=s+2;continue}}if(r==="["&&n+1<e.length&&(e[n+1]==="."||e[n+1]==="=")){let i=`${e[n+1]}]`,o=e.indexOf(i,n+2);if(o!==-1){n=o+2;continue}}n++}return-1}function X2(e,t,n){let r="",s=n;for(;s<t.length&&t[s]!=="'";){let i=t[s];if(i==="\\"&&s+1<t.length)switch(t[s+1]){case"n":r+=`
|
|
768
|
+
`,s+=2;break;case"t":r+=" ",s+=2;break;case"r":r+="\r",s+=2;break;case"\\":r+="\\",s+=2;break;case"'":r+="'",s+=2;break;case'"':r+='"',s+=2;break;case"a":r+="\x07",s+=2;break;case"b":r+="\b",s+=2;break;case"e":case"E":r+="\x1B",s+=2;break;case"f":r+="\f",s+=2;break;case"v":r+="\v",s+=2;break;case"x":{let a=[],l=s;for(;l+1<t.length&&t[l]==="\\"&&t[l+1]==="x";){let c=t.slice(l+2,l+4),u=parseInt(c,16);if(!Number.isNaN(u)&&c.length>0)a.push(u),l+=2+c.length;else break}a.length>0?(r+=gA(a),s=l):(r+="\\x",s+=2);break}case"u":{let a=t.slice(s+2,s+6),l=parseInt(a,16);Number.isNaN(l)?(r+="\\u",s+=2):(r+=String.fromCharCode(l),s+=6);break}case"c":{if(s+2<t.length){let l=t[s+2].charCodeAt(0)&31;r+=String.fromCharCode(l),s+=3}else r+="\\c",s+=2;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let a="",l=s+1;for(;l<t.length&&l<s+4&&/[0-7]/.test(t[l]);)a+=t[l],l++;let c=parseInt(a,8);r+=String.fromCharCode(c),s=l;break}default:r+=i,s++}else r+=i,s++}return s<t.length&&t[s]==="'"&&s++,{part:Y.literal(r),endIndex:s}}function Wc(e,t){let n=t.trim();return n===""?{type:"ArithmeticExpression",expression:{type:"ArithNumber",value:0}}:Ce(e,n)}function q2(e){let t=[],n="",r=0;for(let s=0;s<e.length;s++){let i=e[s];i==="{"?(r++,n+=i):i==="}"?(r--,n+=i):i===","&&r===0?(t.push(n),n=""):n+=i}return t.push(n),t}function Y2(e,t,n,r){let s=Bc(e,t,n,"{","}");if(s===-1)return null;let i=t.slice(n+1,s),o=i.match(/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/);if(o)return{part:{type:"BraceExpansion",items:[{type:"Range",start:Number.parseInt(o[1],10),end:Number.parseInt(o[2],10),step:o[3]?Number.parseInt(o[3],10):void 0,startStr:o[1],endStr:o[2]}]},endIndex:s+1};let a=i.match(/^([a-zA-Z])\.\.([a-zA-Z])(?:\.\.(-?\d+))?$/);return a?{part:{type:"BraceExpansion",items:[{type:"Range",start:a[1],end:a[2],step:a[3]?Number.parseInt(a[3],10):void 0}]},endIndex:s+1}:i.includes(",")&&r?{part:{type:"BraceExpansion",items:q2(i).map(u=>({type:"Word",word:Y.word(r(e,u,!1,!1,!1))}))},endIndex:s+1}:i.includes(",")?{part:{type:"BraceExpansion",items:q2(i).map(u=>({type:"Word",word:Y.word([Y.literal(u)])}))},endIndex:s+1}:null}function zc(e,t){let n="";for(let r of t.parts)switch(r.type){case"Literal":n+=r.value;break;case"SingleQuoted":n+=`'${r.value}'`;break;case"Escaped":n+=r.value;break;case"DoubleQuoted":n+='"';for(let s of r.parts)s.type==="Literal"||s.type==="Escaped"?n+=s.value:s.type==="ParameterExpansion"&&(n+=`\${${s.parameter}}`);n+='"';break;case"ParameterExpansion":n+=`\${${r.parameter}}`;break;case"Glob":n+=r.pattern;break;case"TildeExpansion":n+="~",r.user&&(n+=r.user);break;case"BraceExpansion":{n+="{";let s=[];for(let i of r.items)if(i.type==="Range"){let o=i.startStr??String(i.start),a=i.endStr??String(i.end);i.step!==void 0?s.push(`${o}..${a}..${i.step}`):s.push(`${o}..${a}`)}else s.push(zc(e,i.word));s.length===1&&r.items[0].type==="Range"?n+=s[0]:n+=s.join(","),n+="}";break}default:n+=r.type}return n}function J2(e,t){return{[E.LESS]:"<",[E.GREAT]:">",[E.DGREAT]:">>",[E.LESSAND]:"<&",[E.GREATAND]:">&",[E.LESSGREAT]:"<>",[E.CLOBBER]:">|",[E.TLESS]:"<<<",[E.AND_GREAT]:"&>",[E.AND_DGREAT]:"&>>",[E.DLESS]:"<",[E.DLESSDASH]:"<"}[t]||">"}var Hc=v(()=>{"use strict";Wr();Nt();pr()});function Vo(e){let t=e.current(),n=t.type;if(n===E.NUMBER){let r=e.peek(1);return t.end!==r.start?!1:R2.has(r.type)}if(n===E.FD_VARIABLE){let r=e.peek(1);return T2.has(r.type)}return O2.has(n)}function qo(e){let t=null,n;e.check(E.NUMBER)?t=Number.parseInt(e.advance().value,10):e.check(E.FD_VARIABLE)&&(n=e.advance().value);let r=e.advance(),s=J2(e,r.type);if(r.type===E.DLESS||r.type===E.DLESSDASH)return wA(e,s,t,r.type===E.DLESSDASH);e.isWord()||e.error("Expected redirection target");let i=e.parseWord();return Y.redirection(s,i,t,n)}function wA(e,t,n,r){e.isWord()||e.error("Expected here-document delimiter");let s=e.advance(),i=s.value,o=s.quoted||!1;(i.startsWith("'")&&i.endsWith("'")||i.startsWith('"')&&i.endsWith('"'))&&(i=i.slice(1,-1));let a=Y.redirection(r?"<<-":"<<",Y.hereDoc(i,Y.word([]),r,o),n);return e.addPendingHeredoc(a,i,r,o),a}function tg(e){let t=e.current().line,n=[],r=null,s=[],i=[];for(;e.check(E.ASSIGNMENT_WORD)||Vo(e);)e.checkIterationLimit(),e.check(E.ASSIGNMENT_WORD)?n.push(bA(e)):i.push(qo(e));if(e.isWord())r=e.parseWord();else if(n.length>0&&(e.check(E.DBRACK_START)||e.check(E.DPAREN_START))){let a=e.advance();r=Y.word([Y.literal(a.value)])}for(;(!e.isStatementEnd()||e.check(E.RBRACE))&&!e.check(E.PIPE,E.PIPE_AMP);)if(e.checkIterationLimit(),Vo(e))i.push(qo(e));else if(e.check(E.RBRACE)){let a=e.advance();s.push(e.parseWordFromString(a.value,!1,!1))}else if(e.check(E.LBRACE)){let a=e.advance();s.push(e.parseWordFromString(a.value,!1,!1))}else if(e.check(E.DBRACK_END)){let a=e.advance();s.push(e.parseWordFromString(a.value,!1,!1))}else if(e.isWord())s.push(e.parseWord());else if(e.check(E.ASSIGNMENT_WORD)){let a=e.advance(),l=a.value,c=l.endsWith("="),u=l.endsWith("=(");if((c||u)&&(u||e.check(E.LPAREN))){let f=u?l.slice(0,-2):l.slice(0,-1);u||e.expect(E.LPAREN);let p=jc(e);e.expect(E.RPAREN);let h=p.map(m=>zc(e,m)),d=`${f}=(${h.join(" ")})`;s.push(e.parseWordFromString(d,!1,!1))}else s.push(e.parseWordFromString(l,a.quoted,a.singleQuoted))}else if(e.check(E.LPAREN))e.error("syntax error near unexpected token `('");else break;let o=Y.simpleCommand(r,s,n,i);return o.line=t,o}function bA(e){let t=e.expect(E.ASSIGNMENT_WORD),n=t.value,r=n.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);r||e.error(`Invalid assignment: ${n}`);let s=r[0],i,o=s.length;if(n[o]==="["){let f=0,p=o+1;for(;o<n.length;o++)if(n[o]==="[")f++;else if(n[o]==="]"&&(f--,f===0))break;f!==0&&e.error(`Invalid assignment: ${n}`),i=n.slice(p,o),o++}let a=n[o]==="+";a&&o++,n[o]!=="="&&e.error(`Invalid assignment: ${n}`),o++;let l=n.slice(o);if(l==="("){let f=jc(e);e.expect(E.RPAREN);let p=i!==void 0?`${s}[${i}]`:s;return Y.assignment(p,null,a,f)}if(l===""&&e.check(E.LPAREN)){let f=e.current();if(t.end===f.start){e.advance();let p=jc(e);e.expect(E.RPAREN);let h=i!==void 0?`${s}[${i}]`:s;return Y.assignment(h,null,a,p)}}let c=l?e.parseWordFromString(l,t.quoted,t.singleQuoted,!0):null,u=i!==void 0?`${s}[${i}]`:s;return Y.assignment(u,c,a,null)}function jc(e){let t=[];for(e.skipNewlines();!e.check(E.RPAREN,E.EOF);)e.checkIterationLimit(),e.isWord()?t.push(e.parseWord()):xA.has(e.current().type)?e.error(`syntax error near unexpected token \`${e.current().value}'`):e.advance(),e.skipNewlines();return t}var xA,ng=v(()=>{"use strict";Wr();pr();Br();Hc();xA=new Set([E.AMP,E.PIPE,E.PIPE_AMP,E.SEMICOLON,E.AND_AND,E.OR_OR,E.DSEMI,E.SEMI_AND,E.SEMI_SEMI_AND])});function Gc(e,t){e.expect(E.IF);let n=[],r=e.parseCompoundList();e.expect(E.THEN);let s=e.parseCompoundList();if(s.length===0){let a=e.check(E.FI)?"fi":e.check(E.ELSE)?"else":e.check(E.ELIF)?"elif":"fi";e.error(`syntax error near unexpected token \`${a}'`)}for(n.push({condition:r,body:s});e.check(E.ELIF);){e.advance();let a=e.parseCompoundList();e.expect(E.THEN);let l=e.parseCompoundList();if(l.length===0){let c=e.check(E.FI)?"fi":e.check(E.ELSE)?"else":e.check(E.ELIF)?"elif":"fi";e.error(`syntax error near unexpected token \`${c}'`)}n.push({condition:a,body:l})}let i=null;e.check(E.ELSE)&&(e.advance(),i=e.parseCompoundList(),i.length===0&&e.error("syntax error near unexpected token `fi'")),e.expect(E.FI);let o=t?.skipRedirections?[]:e.parseOptionalRedirections();return Y.ifNode(n,i,o)}function Vc(e,t){let n=e.expect(E.FOR);if(e.check(E.DPAREN_START))return AA(e,t,n.line);e.isWord()||e.error("Expected variable name in for loop");let s=e.advance().value,i=null;if(e.skipNewlines(),e.check(E.IN))for(e.advance(),i=[];!e.check(E.SEMICOLON,E.NEWLINE,E.DO,E.EOF)&&e.isWord();)i.push(e.parseWord());e.check(E.SEMICOLON)&&e.advance(),e.skipNewlines(),e.expect(E.DO);let o=e.parseCompoundList();e.expect(E.DONE);let a=t?.skipRedirections?[]:e.parseOptionalRedirections();return Y.forNode(s,i,o,a)}function AA(e,t,n){e.expect(E.DPAREN_START);let r=null,s=null,i=null,o=["","",""],a=0,l=0;for(;!e.check(E.DPAREN_END,E.EOF);){let f=e.advance();if(f.type===E.SEMICOLON&&l===0){if(a++,a>2)break}else f.value==="("&&l++,f.value===")"&&l--,o[a]+=f.value}e.expect(E.DPAREN_END),o[0].trim()&&(r=Ce(e,o[0].trim())),o[1].trim()&&(s=Ce(e,o[1].trim())),o[2].trim()&&(i=Ce(e,o[2].trim())),e.skipNewlines(),e.check(E.SEMICOLON)&&e.advance(),e.skipNewlines();let c;e.check(E.LBRACE)?(e.advance(),c=e.parseCompoundList(),e.expect(E.RBRACE)):(e.expect(E.DO),c=e.parseCompoundList(),e.expect(E.DONE));let u=t?.skipRedirections?[]:e.parseOptionalRedirections();return{type:"CStyleFor",init:r,condition:s,update:i,body:c,redirections:u,line:n}}function qc(e,t){e.expect(E.WHILE);let n=e.parseCompoundList();e.expect(E.DO);let r=e.parseCompoundList();r.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(E.DONE);let s=t?.skipRedirections?[]:e.parseOptionalRedirections();return Y.whileNode(n,r,s)}function Zc(e,t){e.expect(E.UNTIL);let n=e.parseCompoundList();e.expect(E.DO);let r=e.parseCompoundList();r.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(E.DONE);let s=t?.skipRedirections?[]:e.parseOptionalRedirections();return Y.untilNode(n,r,s)}function Kc(e,t){e.expect(E.CASE),e.isWord()||e.error("Expected word after 'case'");let n=e.parseWord();e.skipNewlines(),e.expect(E.IN),e.skipNewlines();let r=[];for(;!e.check(E.ESAC,E.EOF);){e.checkIterationLimit();let i=e.getPos(),o=SA(e);if(o&&r.push(o),e.skipNewlines(),e.getPos()===i&&!o)break}e.expect(E.ESAC);let s=t?.skipRedirections?[]:e.parseOptionalRedirections();return Y.caseNode(n,r,s)}function SA(e){e.check(E.LPAREN)&&e.advance();let t=[];for(;e.isWord()&&(t.push(e.parseWord()),e.check(E.PIPE));)e.advance();if(t.length===0)return null;e.expect(E.RPAREN),e.skipNewlines();let n=[];for(;!e.check(E.DSEMI,E.SEMI_AND,E.SEMI_SEMI_AND,E.ESAC,E.EOF);){e.checkIterationLimit(),e.isWord()&&e.peek(1).type===E.RPAREN&&e.error("syntax error near unexpected token `)'"),e.check(E.LPAREN)&&e.peek(1).type===E.WORD&&e.error(`syntax error near unexpected token \`${e.peek(1).value}'`);let s=e.getPos(),i=e.parseStatement();if(i&&n.push(i),e.skipSeparators(!1),e.getPos()===s&&!i)break}let r=";;";return e.check(E.DSEMI)?(e.advance(),r=";;"):e.check(E.SEMI_AND)?(e.advance(),r=";&"):e.check(E.SEMI_SEMI_AND)&&(e.advance(),r=";;&"),Y.caseItem(t,n,r)}function Qc(e,t){e.expect(E.LPAREN);let n=e.parseCompoundList();e.expect(E.RPAREN);let r=t?.skipRedirections?[]:e.parseOptionalRedirections();return Y.subshell(n,r)}function Xc(e,t){e.expect(E.LBRACE);let n=e.parseCompoundList();e.expect(E.RBRACE);let r=t?.skipRedirections?[]:e.parseOptionalRedirections();return Y.group(n,r)}var rg=v(()=>{"use strict";Wr();Nt();pr()});function sg(e){return e.isWord()||e.check(E.LBRACE)||e.check(E.RBRACE)||e.check(E.ASSIGNMENT_WORD)}function ig(e){if(e.check(E.BANG)&&e.peek(1).type===E.LPAREN){e.advance(),e.advance();let t=1,n="!(";for(;t>0&&!e.check(E.EOF);)if(e.check(E.LPAREN))t++,n+="(",e.advance();else if(e.check(E.RPAREN))t--,t>0&&(n+=")"),e.advance();else if(e.isWord())n+=e.advance().value;else if(e.check(E.PIPE))n+="|",e.advance();else break;return n+=")",e.parseWordFromString(n,!1,!1,!1,!1,!0)}return e.parseWordNoBraceExpansion()}function Jc(e){return e.skipNewlines(),NA(e)}function NA(e){let t=og(e);for(e.skipNewlines();e.check(E.OR_OR);){e.advance(),e.skipNewlines();let n=og(e);t={type:"CondOr",left:t,right:n},e.skipNewlines()}return t}function og(e){let t=Yc(e);for(e.skipNewlines();e.check(E.AND_AND);){e.advance(),e.skipNewlines();let n=Yc(e);t={type:"CondAnd",left:t,right:n},e.skipNewlines()}return t}function Yc(e){return e.skipNewlines(),e.check(E.BANG)?(e.advance(),e.skipNewlines(),{type:"CondNot",operand:Yc(e)}):IA(e)}function IA(e){if(e.check(E.LPAREN)){e.advance();let t=Jc(e);return e.expect(E.RPAREN),{type:"CondGroup",expression:t}}if(sg(e)){let t=e.current(),n=t.value;if(vA.includes(n)&&!t.quoted){if(e.advance(),e.check(E.DBRACK_END)&&e.error(`Expected operand after ${n}`),sg(e)){let i=e.parseWordNoBraceExpansion();return{type:"CondUnary",operator:n,operand:i}}let s=e.current();e.error(`unexpected argument \`${s.value}' to conditional unary operator`)}let r=e.parseWordNoBraceExpansion();if(e.isWord()&&kA.includes(e.current().value)){let s=e.advance().value,i;return s==="=~"?i=$A(e):s==="=="||s==="!="?i=ig(e):i=e.parseWordNoBraceExpansion(),{type:"CondBinary",operator:s,left:r,right:i}}if(e.check(E.LESS)){e.advance();let s=e.parseWordNoBraceExpansion();return{type:"CondBinary",operator:"<",left:r,right:s}}if(e.check(E.GREAT)){e.advance();let s=e.parseWordNoBraceExpansion();return{type:"CondBinary",operator:">",left:r,right:s}}if(e.isWord()&&e.current().value==="="){e.advance();let s=ig(e);return{type:"CondBinary",operator:"==",left:r,right:s}}return{type:"CondWord",word:r}}e.error("Expected conditional expression")}function $A(e){let t=[],n=0,r=-1,s=e.getInput(),i=()=>e.check(E.DBRACK_END)||e.check(E.AND_AND)||e.check(E.OR_OR)||e.check(E.NEWLINE)||e.check(E.EOF);for(;!i();){let o=e.current(),a=r>=0&&o.start>r;if(n===0&&a)break;if(n>0&&a){let l=s.slice(r,o.start);t.push({type:"Literal",value:l})}if(e.isWord()||e.check(E.ASSIGNMENT_WORD)){let l=e.parseWordForRegex();t.push(...l.parts),r=e.peek(-1).end}else if(e.check(E.LPAREN)){let l=e.advance();t.push({type:"Literal",value:"("}),n++,r=l.end}else if(e.check(E.DPAREN_START)){let l=e.advance();t.push({type:"Literal",value:"(("}),n+=2,r=l.end}else if(e.check(E.DPAREN_END))if(n>=2){let l=e.advance();t.push({type:"Literal",value:"))"}),n-=2,r=l.end}else{if(n===1)break;break}else if(e.check(E.RPAREN))if(n>0){let l=e.advance();t.push({type:"Literal",value:")"}),n--,r=l.end}else break;else if(e.check(E.PIPE)){let l=e.advance();t.push({type:"Literal",value:"|"}),r=l.end}else if(e.check(E.SEMICOLON))if(n>0){let l=e.advance();t.push({type:"Literal",value:";"}),r=l.end}else break;else if(n>0&&e.check(E.LESS)){let l=e.advance();t.push({type:"Literal",value:"<"}),r=l.end}else if(n>0&&e.check(E.GREAT)){let l=e.advance();t.push({type:"Literal",value:">"}),r=l.end}else if(n>0&&e.check(E.DGREAT)){let l=e.advance();t.push({type:"Literal",value:">>"}),r=l.end}else if(n>0&&e.check(E.DLESS)){let l=e.advance();t.push({type:"Literal",value:"<<"}),r=l.end}else if(n>0&&e.check(E.LESSAND)){let l=e.advance();t.push({type:"Literal",value:"<&"}),r=l.end}else if(n>0&&e.check(E.GREATAND)){let l=e.advance();t.push({type:"Literal",value:">&"}),r=l.end}else if(n>0&&e.check(E.LESSGREAT)){let l=e.advance();t.push({type:"Literal",value:"<>"}),r=l.end}else if(n>0&&e.check(E.CLOBBER)){let l=e.advance();t.push({type:"Literal",value:">|"}),r=l.end}else if(n>0&&e.check(E.TLESS)){let l=e.advance();t.push({type:"Literal",value:"<<<"}),r=l.end}else if(n>0&&e.check(E.AMP)){let l=e.advance();t.push({type:"Literal",value:"&"}),r=l.end}else if(n>0&&e.check(E.LBRACE)){let l=e.advance();t.push({type:"Literal",value:"{"}),r=l.end}else if(n>0&&e.check(E.RBRACE)){let l=e.advance();t.push({type:"Literal",value:"}"}),r=l.end}else break}return t.length===0&&e.error("Expected regex pattern after =~"),{type:"Word",parts:t}}var vA,kA,ag=v(()=>{"use strict";pr();vA=["-a","-b","-c","-d","-e","-f","-g","-h","-k","-p","-r","-s","-t","-u","-w","-x","-G","-L","-N","-O","-S","-z","-n","-o","-v","-R"],kA=["==","!=","=~","<",">","-eq","-ne","-lt","-le","-gt","-ge","-nt","-ot","-ef"]});function yi(e){return e.length>0?e:[Y.literal("")]}function RA(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let s=e[r];if(s==="\\"){r+=2;continue}if("@*+?!".includes(s)&&r+1<e.length&&e[r+1]==="("){r++,n++,r++;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function TA(e,t,n){let r=n+1,s=t[r];if("@*#?$!-0123456789".includes(s))return{part:Y.parameterExpansion(s),endIndex:r+1};let i="";for(;r<t.length&&/[a-zA-Z0-9_]/.test(t[r]);)i+=t[r],r++;return{part:Y.parameterExpansion(i),endIndex:r}}function PA(e,t,n,r=!1){let s=n+2,i=!1;t[s]==="!"&&(i=!0,s++);let o=!1;t[s]==="#"&&!/[}:#%/^,]/.test(t[s+1]||"}")&&(o=!0,s++);let a="",l=t[s];if(/[@*#?$!-]/.test(l)&&!/[a-zA-Z0-9_]/.test(t[s+1]||""))a=l,s++;else for(;s<t.length&&/[a-zA-Z0-9_]/.test(t[s]);)a+=t[s],s++;if(t[s]==="["){let u=Bc(e,t,s,"[","]");if(a+=t.slice(s,u+1),s=u+1,t[s]==="["){let f=1,p=s;for(;p<t.length&&f>0;)t[p]==="{"?f++:t[p]==="}"&&f--,f>0&&p++;let h=t.slice(n+2,p);return{part:Y.parameterExpansion("",{type:"BadSubstitution",text:h}),endIndex:p+1}}}if(a===""&&!i&&!o&&t[s]!=="}"){let u=1,f=s;for(;f<t.length&&u>0;)t[f]==="{"?u++:t[f]==="}"&&u--,u>0&&f++;if(u>0)throw new bt("unexpected EOF while looking for matching '}'",0,0);let p=t.slice(n+2,f);return{part:Y.parameterExpansion("",{type:"BadSubstitution",text:p}),endIndex:f+1}}let c=null;if(i){let u=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(u)if(s<t.length&&t[s]!=="}"&&/[:=\-+?#%/^,@]/.test(t[s])){let f=eu(e,t,s,a,r);f.operation?(c={type:"Indirection",innerOp:f.operation},s=f.endIndex):(c={type:"ArrayKeys",array:u[1],star:u[2]==="*"},a="")}else c={type:"ArrayKeys",array:u[1],star:u[2]==="*"},a="";else if(t[s]==="*"||t[s]==="@"&&!/[QPaAEKkuUL]/.test(t[s+1]||"")){let f=t[s];s++,c={type:"VarNamePrefix",prefix:a,star:f==="*"},a=""}else if(s<t.length&&t[s]!=="}"&&/[:=\-+?#%/^,@]/.test(t[s])){let f=eu(e,t,s,a,r);f.operation?(c={type:"Indirection",innerOp:f.operation},s=f.endIndex):c={type:"Indirection"}}else c={type:"Indirection"}}else if(o)if(t[s]===":")for(c={type:"LengthSliceError"};s<t.length&&t[s]!=="}";)s++;else t[s]!=="}"&&/[-+=?]/.test(t[s])?e.error(`\${#${a}${t.slice(s,t.indexOf("}",s))}}: bad substitution`):t[s]==="/"?e.error(`\${#${a}${t.slice(s,t.indexOf("}",s))}}: bad substitution`):c={type:"Length"};if(!c&&s<t.length&&t[s]!=="}"){let u=eu(e,t,s,a,r);c=u.operation,s=u.endIndex}if(s<t.length&&t[s]!=="}"){let u=t[s];if(!/[:\-+=?#%/^,@[]/.test(u)){let f=s;for(;f<t.length&&t[f]!=="}";)f++;let p=t.slice(n,f+1);e.error(`\${${p.slice(2,-1)}}: bad substitution`)}}for(;s<t.length&&t[s]!=="}";)s++;if(s>=t.length)throw new bt("unexpected EOF while looking for matching '}'",0,0);return{part:Y.parameterExpansion(a,c),endIndex:s+1}}function eu(e,t,n,r,s=!1){let i=n,o=t[i],a=t[i+1]||"";if(o===":"){let l=a;if("-=?+".includes(l)){i+=2;let y=zr(e,t,i),w=t.slice(i,y),b=hr(e,w,!1,!1,!0,!1,s,!1,!1,!0),x=Y.word(yi(b));if(l==="-")return{operation:{type:"DefaultValue",word:x,checkEmpty:!0},endIndex:y};if(l==="=")return{operation:{type:"AssignDefault",word:x,checkEmpty:!0},endIndex:y};if(l==="?")return{operation:{type:"ErrorIfUnset",word:x,checkEmpty:!0},endIndex:y};if(l==="+")return{operation:{type:"UseAlternative",word:x,checkEmpty:!0},endIndex:y}}i++;let c=zr(e,t,i),u=t.slice(i,c),f=-1,p=0,h=0;for(let g=0;g<u.length;g++){let y=u[g];if(y==="("||y==="[")p++;else if(y===")"||y==="]")p--;else if(y==="?"&&p===0)h++;else if(y===":"&&p===0)if(h>0)h--;else{f=g;break}}let d=f>=0?u.slice(0,f):u,m=f>=0?u.slice(f+1):null;return{operation:{type:"Substring",offset:Wc(e,d),length:m!==null?Wc(e,m):null},endIndex:c}}if("-=?+".includes(o)){i++;let l=zr(e,t,i),c=t.slice(i,l),u=hr(e,c,!1,!1,!0,!1,s,!1,!1,!0),f=Y.word(yi(u));if(o==="-")return{operation:{type:"DefaultValue",word:f,checkEmpty:!1},endIndex:l};if(o==="=")return{operation:{type:"AssignDefault",word:f,checkEmpty:!1},endIndex:l};if(o==="?")return{operation:{type:"ErrorIfUnset",word:c?f:null,checkEmpty:!1},endIndex:l};if(o==="+")return{operation:{type:"UseAlternative",word:f,checkEmpty:!1},endIndex:l}}if(o==="#"||o==="%"){let l=a===o,c=o==="#"?"prefix":"suffix";i+=l?2:1;let u=zr(e,t,i),f=t.slice(i,u),p=hr(e,f,!1,!1,!1);return{operation:{type:"PatternRemoval",pattern:Y.word(yi(p)),side:c,greedy:l},endIndex:u}}if(o==="/"){let l=a==="/";i+=l?2:1;let c=null;t[i]==="#"?(c="start",i++):t[i]==="%"&&(c="end",i++);let u;c!==null&&(t[i]==="/"||t[i]==="}")?u=i:u=K2(e,t,i);let f=t.slice(i,u),p=hr(e,f,!1,!1,!1),h=Y.word(yi(p)),d=null,m=u;if(t[u]==="/"){let g=u+1,y=zr(e,t,g),w=t.slice(g,y),b=hr(e,w,!1,!1,!1);d=Y.word(yi(b)),m=y}return{operation:{type:"PatternReplacement",pattern:h,replacement:d,all:l,anchor:c},endIndex:m}}if(o==="^"||o===","){let l=a===o,c=o==="^"?"upper":"lower";i+=l?2:1;let u=zr(e,t,i),f=t.slice(i,u),p=f?Y.word([Y.literal(f)]):null;return{operation:{type:"CaseModification",direction:c,all:l,pattern:p},endIndex:u}}return o==="@"&&/[QPaAEKkuUL]/.test(a)?{operation:{type:"Transform",operator:a},endIndex:i+2}:{operation:null,endIndex:i}}function tu(e,t,n,r=!1){let s=n+1;if(s>=t.length)return{part:Y.literal("$"),endIndex:s};let i=t[s];if(i==="("&&t[s+1]==="(")return e.isDollarDparenSubshell(t,n)?e.parseCommandSubstitution(t,n):e.parseArithmeticExpansion(t,n);if(i==="["){let o=1,a=s+1;for(;a<t.length&&o>0;)t[a]==="["?o++:t[a]==="]"&&o--,o>0&&a++;if(o===0){let l=t.slice(s+1,a),c=Ce(e,l);return{part:Y.arithmeticExpansion(c),endIndex:a+1}}}return i==="("?e.parseCommandSubstitution(t,n):i==="{"?PA(e,t,n,r):/[a-zA-Z_0-9@*#?$!-]/.test(i)?TA(e,t,n):{part:Y.literal("$"),endIndex:s}}function lg(e,t){let n=[],r=0,s="",i=()=>{s&&(n.push(Y.literal(s)),s="")};for(;r<t.length;){let o=t[r];if(o==="\\"&&r+1<t.length){let a=t[r+1];if(a==="$"||a==="`"||a==='"'||a==="\\"){s+=a,r+=2;continue}s+=o,r++;continue}if(o==="$"){i();let{part:a,endIndex:l}=tu(e,t,r,!0);a&&n.push(a),r=l;continue}if(o==="`"){i();let{part:a,endIndex:l}=e.parseBacktickSubstitution(t,r,!0);n.push(a),r=l;continue}s+=o,r++}return i(),n}function DA(e,t,n){let r=[],s=n,i="",o=()=>{i&&(r.push(Y.literal(i)),i="")};for(;s<t.length&&t[s]!=='"';){let a=t[s];if(a==="\\"&&s+1<t.length){let l=t[s+1];if('"\\$`\n'.includes(l)){i+=l,s+=2;continue}i+=a,s++;continue}if(a==="$"){o();let{part:l,endIndex:c}=tu(e,t,s,!0);l&&r.push(l),s=c;continue}if(a==="`"){o();let{part:l,endIndex:c}=e.parseBacktickSubstitution(t,s,!0);r.push(l),s=c;continue}i+=a,s++}return o(),{part:Y.doubleQuoted(r),endIndex:s}}function hr(e,t,n=!1,r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1){if(r)return[Y.singleQuoted(t)];if(n){let d=lg(e,t);return[Y.doubleQuoted(d)]}if(t.length>=2&&t[0]==='"'&&t[t.length-1]==='"'){let d=t.slice(1,-1),m=!1;for(let g=0;g<d.length;g++){if(d[g]==='"'){m=!0;break}d[g]==="\\"&&g+1<d.length&&g++}if(!m){let g=lg(e,d);return[Y.doubleQuoted(g)]}}let u=[],f=0,p="",h=()=>{p&&(u.push(Y.literal(p)),p="")};for(;f<t.length;){let d=t[f];if(d==="\\"&&f+1<t.length){let m=t[f+1];if(l){h(),u.push(Y.escaped(m)),f+=2;continue}let g=i?m==="$"||m==="`"||m===`
|
|
769
|
+
`:m==="$"||m==="`"||m==='"'||m==="'"||m===`
|
|
770
|
+
`||c&&m==="}",y=o?"*?[]\\".includes(m):"*?[]\\(){}.^+".includes(m);g?p+=m:y?(h(),u.push(Y.escaped(m))):p+=`\\${m}`,f+=2;continue}if(d==="'"&&!o&&!i){h();let m=t.indexOf("'",f+1);if(m===-1){p+=t.slice(f);break}u.push(Y.singleQuoted(t.slice(f+1,m))),f=m+1;continue}if(d==='"'&&!i){h();let{part:m,endIndex:g}=DA(e,t,f+1);u.push(m),f=g+1;continue}if(d==="$"&&t[f+1]==="'"){h();let{part:m,endIndex:g}=X2(e,t,f+2);u.push(m),f=g;continue}if(d==="$"){h();let{part:m,endIndex:g}=tu(e,t,f);m&&u.push(m),f=g;continue}if(d==="`"){h();let{part:m,endIndex:g}=e.parseBacktickSubstitution(t,f);u.push(m),f=g;continue}if(d==="~"){let m=f>0?t[f-1]:"";if(f===0||m==="="||s&&m===":"){let y=Z2(e,t,f),w=t[y];if(w===void 0||w==="/"||w===":"){h();let b=t.slice(f+1,y)||null;u.push({type:"TildeExpansion",user:b}),f=y;continue}}}if("@*+?!".includes(d)&&f+1<t.length&&t[f+1]==="("){let m=RA(t,f+1);if(m!==-1){h();let g=t.slice(f,m+1);u.push({type:"Glob",pattern:g}),f=m+1;continue}}if(d==="*"||d==="?"||d==="["){h();let{pattern:m,endIndex:g}=Q2(e,t,f);u.push({type:"Glob",pattern:m}),f=g;continue}if(d==="{"&&!s&&!a&&!i){let m=Y2(e,t,f,hr);if(m){h(),u.push(m.part),f=m.endIndex;continue}}p+=d,f++}return h(),u}var cg=v(()=>{"use strict";Wr();Nt();Br();Hc()});function ug(e,t){let n=e.length,r=t+3,s=2,i=!1,o=!1;for(;r<n&&s>0;){let a=e[r];if(i){a==="'"&&(i=!1),r++;continue}if(o){if(a==="\\"){r+=2;continue}a==='"'&&(o=!1),r++;continue}if(a==="'"){i=!0,r++;continue}if(a==='"'){o=!0,r++;continue}if(a==="\\"){r+=2;continue}if(a==="("){s++,r++;continue}if(a===")"){if(s--,s===1){let l=r+1;return!(l<n&&e[l]===")")}if(s===0)return!1;r++;continue}if(s===1&&(a==="|"&&r+1<n&&e[r+1]==="|"||a==="&"&&r+1<n&&e[r+1]==="&"||a==="|"&&r+1<n&&e[r+1]!=="|"))return!0;r++}return!1}function fg(e,t,n,r){let s=t+2,i=1,o=s,a=!1,l=!1,c=0,u=!1,f="";for(;o<e.length&&i>0;){let m=e[o];a?m==="'"&&(a=!1):l?m==="\\"&&o+1<e.length?o++:m==='"'&&(l=!1):m==="'"?(a=!0,f=""):m==='"'?(l=!0,f=""):m==="\\"&&o+1<e.length?(o++,f=""):/[a-zA-Z_]/.test(m)?f+=m:(f==="case"?(c++,u=!1):f==="in"&&c>0?u=!0:f==="esac"&&c>0&&(c--,u=!1),f="",m==="("?o>0&&e[o-1]==="$"?i++:u||i++:m===")"?u?u=!1:i--:m===";"&&c>0&&o+1<e.length&&e[o+1]===";"&&(u=!0)),i>0&&o++}i>0&&r("unexpected EOF while looking for matching `)'");let p=e.slice(s,o),d=n().parse(p);return{part:Y.commandSubstitution(d,!1),endIndex:o+1}}function pg(e,t,n,r,s){let o=t+1,a="";for(;o<e.length&&e[o]!=="`";)if(e[o]==="\\"){let u=e[o+1];u==="$"||u==="`"||u==="\\"||u===`
|
|
771
|
+
`||n&&u==='"'?(u!==`
|
|
772
|
+
`&&(a+=u),o+=2):(a+=e[o],o++)}else a+=e[o],o++;o>=e.length&&s("unexpected EOF while looking for matching ``'");let c=r().parse(a);return{part:Y.commandSubstitution(c,!0),endIndex:o+1}}var hg=v(()=>{"use strict";Wr()});function Sn(e,t){return new ce().parse(e,t)}var ce,ot=v(()=>{"use strict";Wr();Nt();ng();rg();ag();cg();pr();hg();Br();Br();ce=class e{tokens=[];pos=0;pendingHeredocs=[];parseIterations=0;parseDepth=0;_input="";getInput(){return this._input}checkIterationLimit(){if(this.parseIterations++,this.parseIterations>$2)throw new bt("Maximum parse iterations exceeded (possible infinite loop)",this.current().line,this.current().column)}enterDepth(){if(this.parseDepth++,this.parseDepth>Lc)throw new bt(`Maximum parser nesting depth exceeded (${Lc})`,this.current().line,this.current().column);return()=>{this.parseDepth--}}parse(t,n){if(t.length>_c)throw new bt(`Input too large: ${t.length} bytes exceeds limit of ${_c}`,1,1);this._input=t;let r=new Ho(t,n);if(this.tokens=r.tokenize(),this.tokens.length>Fc)throw new bt(`Too many tokens: ${this.tokens.length} exceeds limit of ${Fc}`,1,1);return this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}parseTokens(t){return this.tokens=t,this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}current(){return this.tokens[this.pos]||this.tokens[this.tokens.length-1]}peek(t=0){return this.tokens[this.pos+t]||this.tokens[this.tokens.length-1]}advance(){let t=this.current();return this.pos<this.tokens.length-1&&this.pos++,t}getPos(){return this.pos}check(t,n,r,s,...i){let o=this.tokens[this.pos]?.type;return o===t||n!==void 0&&o===n||r!==void 0&&o===r||s!==void 0&&o===s?!0:i.length>0?i.includes(o):!1}expect(t,n){if(this.check(t))return this.advance();let r=this.current();throw new bt(n||`Expected ${t}, got ${r.type}`,r.line,r.column,r)}error(t){let n=this.current();throw new bt(t,n.line,n.column,n)}skipNewlines(){for(;this.check(E.NEWLINE,E.COMMENT);)this.check(E.NEWLINE)?(this.advance(),this.processHeredocs()):this.advance()}skipSeparators(t=!0){for(;;){if(this.check(E.NEWLINE)){this.advance(),this.processHeredocs();continue}if(this.check(E.SEMICOLON,E.COMMENT)){this.advance();continue}if(t&&this.check(E.DSEMI,E.SEMI_AND,E.SEMI_SEMI_AND)){this.advance();continue}break}}addPendingHeredoc(t,n,r,s){this.pendingHeredocs.push({redirect:t,delimiter:n,stripTabs:r,quoted:s})}processHeredocs(){for(let t of this.pendingHeredocs)if(this.check(E.HEREDOC_CONTENT)){let n=this.advance(),r;t.quoted?r=Y.word([Y.literal(n.value)]):r=this.parseWordFromString(n.value,!1,!1,!1,!0),t.redirect.target=Y.hereDoc(t.delimiter,r,t.stripTabs,t.quoted)}this.pendingHeredocs=[]}isStatementEnd(){return this.check(E.EOF,E.NEWLINE,E.SEMICOLON,E.AMP,E.AND_AND,E.OR_OR,E.RPAREN,E.RBRACE,E.DSEMI,E.SEMI_AND,E.SEMI_SEMI_AND)}isCommandStart(){let t=this.current().type;return t===E.WORD||t===E.NAME||t===E.NUMBER||t===E.ASSIGNMENT_WORD||t===E.IF||t===E.FOR||t===E.WHILE||t===E.UNTIL||t===E.CASE||t===E.LPAREN||t===E.LBRACE||t===E.DPAREN_START||t===E.DBRACK_START||t===E.FUNCTION||t===E.BANG||t===E.TIME||t===E.IN||t===E.LESS||t===E.GREAT||t===E.DLESS||t===E.DGREAT||t===E.LESSAND||t===E.GREATAND||t===E.LESSGREAT||t===E.DLESSDASH||t===E.CLOBBER||t===E.TLESS||t===E.AND_GREAT||t===E.AND_DGREAT}parseScript(){let t=[],r=0;for(this.skipNewlines();!this.check(E.EOF);){r++,r>1e4&&this.error("Parser stuck: too many iterations (>10000)");let s=this.checkUnexpectedToken();if(s){t.push(s),this.skipSeparators(!1);continue}let i=this.pos,o=this.parseStatement();o&&t.push(o),this.skipSeparators(!1),this.check(E.DSEMI,E.SEMI_AND,E.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${this.current().value}'`),this.pos===i&&!this.check(E.EOF)&&this.advance()}return Y.script(t)}checkUnexpectedToken(){let t=this.current().type,n=this.current().value;if((t===E.DO||t===E.DONE||t===E.THEN||t===E.ELSE||t===E.ELIF||t===E.FI||t===E.ESAC)&&this.error(`syntax error near unexpected token \`${n}'`),t===E.RBRACE||t===E.RPAREN){let r=`syntax error near unexpected token \`${n}'`;return this.advance(),Y.statement([Y.pipeline([Y.simpleCommand(null,[],[],[])])],[],!1,{message:r,token:n})}return(t===E.DSEMI||t===E.SEMI_AND||t===E.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${n}'`),t===E.SEMICOLON&&this.error(`syntax error near unexpected token \`${n}'`),(t===E.PIPE||t===E.PIPE_AMP)&&this.error(`syntax error near unexpected token \`${n}'`),null}parseStatement(){if(this.skipNewlines(),!this.isCommandStart())return null;let t=this.current().start,n=[],r=[],s=!1,i=this.parsePipeline();for(n.push(i);this.check(E.AND_AND,E.OR_OR);){let l=this.advance();r.push(l.type===E.AND_AND?"&&":"||"),this.skipNewlines();let c=this.parsePipeline();n.push(c)}this.check(E.AMP)&&(this.advance(),s=!0);let o=this.pos>0?this.tokens[this.pos-1].end:t,a=this._input.slice(t,o);return Y.statement(n,r,s,void 0,a)}parsePipeline(){let t=!1,n=!1;this.check(E.TIME)&&(this.advance(),t=!0,this.check(E.WORD,E.NAME)&&this.current().value==="-p"&&(this.advance(),n=!0));let r=0;for(;this.check(E.BANG);)this.advance(),r++;let s=r%2===1,i=[],o=[],a=this.parseCommand();for(i.push(a);this.check(E.PIPE,E.PIPE_AMP);){let l=this.advance();this.skipNewlines(),o.push(l.type===E.PIPE_AMP);let c=this.parseCommand();i.push(c)}return Y.pipeline(i,s,t,n,o.length>0?o:void 0)}parseCommand(){return this.check(E.IF)?Gc(this):this.check(E.FOR)?Vc(this):this.check(E.WHILE)?qc(this):this.check(E.UNTIL)?Zc(this):this.check(E.CASE)?Kc(this):this.check(E.LPAREN)?Qc(this):this.check(E.LBRACE)?Xc(this):this.check(E.DPAREN_START)?this.dparenClosesWithSpacedParens()?this.parseNestedSubshellsFromDparen():this.parseArithmeticCommand():this.check(E.DBRACK_START)?this.parseConditionalCommand():this.check(E.FUNCTION)?this.parseFunctionDef():this.check(E.NAME,E.WORD)&&this.peek(1).type===E.LPAREN&&this.peek(2).type===E.RPAREN?this.parseFunctionDef():tg(this)}dparenClosesWithSpacedParens(){let t=1,n=1;for(;n<this.tokens.length-this.pos;){let r=this.peek(n);if(r.type===E.EOF)return!1;if(r.type===E.DPAREN_START||r.type===E.LPAREN)t++;else if(r.type===E.DPAREN_END){if(t-=2,t<=0)return!1}else if(r.type===E.RPAREN&&(t--,t===0&&this.peek(n+1).type===E.RPAREN))return!0;n++}return!1}parseNestedSubshellsFromDparen(){this.advance();let t=this.parseCompoundList();this.expect(E.RPAREN),this.expect(E.RPAREN);let n=this.parseOptionalRedirections(),r=Y.subshell(t,[]);return Y.subshell([Y.statement([Y.pipeline([r],!1,!1,!1)])],n)}isWord(){let t=this.current().type;return t===E.WORD||t===E.NAME||t===E.NUMBER||t===E.IF||t===E.FOR||t===E.WHILE||t===E.UNTIL||t===E.CASE||t===E.FUNCTION||t===E.ELSE||t===E.ELIF||t===E.FI||t===E.THEN||t===E.DO||t===E.DONE||t===E.ESAC||t===E.IN||t===E.SELECT||t===E.TIME||t===E.COPROC||t===E.BANG}parseWord(){let t=this.advance();return this.parseWordFromString(t.value,t.quoted,t.singleQuoted)}parseWordNoBraceExpansion(){let t=this.advance();return this.parseWordFromString(t.value,t.quoted,t.singleQuoted,!1,!1,!0)}parseWordForRegex(){let t=this.advance();return this.parseWordFromString(t.value,t.quoted,t.singleQuoted,!1,!1,!0,!0)}parseWordFromString(t,n=!1,r=!1,s=!1,i=!1,o=!1,a=!1){let l=hr(this,t,n,r,s,i,!1,o,a);return Y.word(l)}parseCommandSubstitution(t,n){return fg(t,n,()=>new e,r=>this.error(r))}parseBacktickSubstitution(t,n,r=!1){return pg(t,n,r,()=>new e,s=>this.error(s))}isDollarDparenSubshell(t,n){return ug(t,n)}parseArithmeticExpansion(t,n){let r=n+3,s=1,i=0,o=r;for(;o<t.length-1&&s>0;)t[o]==="$"&&t[o+1]==="("?t[o+2]==="("?(s++,o+=3):(i++,o+=2):t[o]==="("&&t[o+1]==="("?(s++,o+=2):t[o]===")"&&t[o+1]===")"?i>0?(i--,o++):(s--,s>0&&(o+=2)):t[o]==="("?(i++,o++):(t[o]===")"&&i>0&&i--,o++);let a=t.slice(r,o),l=this.parseArithmeticExpression(a);return{part:Y.arithmeticExpansion(l),endIndex:o+2}}parseArithmeticCommand(){let t=this.expect(E.DPAREN_START),n="",r=1,s=0,i=!1,o=!1;for(;r>0&&!this.check(E.EOF);){if(i){if(i=!1,s>0){s--,n+=")";continue}if(this.check(E.RPAREN)){r--,o=!0,this.advance();continue}if(this.check(E.DPAREN_END)){r--,o=!0;continue}n+=")";continue}if(this.check(E.DPAREN_START))r++,n+="((",this.advance();else if(this.check(E.DPAREN_END))s>=2?(s-=2,n+="))",this.advance()):s===1?(s--,n+=")",i=!0,this.advance()):(r--,o=!0,r>0&&(n+="))"),this.advance());else if(this.check(E.LPAREN))s++,n+="(",this.advance();else if(this.check(E.RPAREN))s>0&&s--,n+=")",this.advance();else{let c=this.current().value,u=n.length>0?n[n.length-1]:"";n.length>0&&!n.endsWith(" ")&&!(c==="="&&/[|&^+\-*/%<>]$/.test(n))&&!(c==="<"&&u==="<")&&!(c===">"&&u===">")&&(n+=" "),n+=c,this.advance()}}o||this.expect(E.DPAREN_END);let a=this.parseArithmeticExpression(n.trim()),l=this.parseOptionalRedirections();return Y.arithmeticCommand(a,l,t.line)}parseConditionalCommand(){let t=this.expect(E.DBRACK_START),n=Jc(this);this.expect(E.DBRACK_END);let r=this.parseOptionalRedirections();return Y.conditionalCommand(n,r,t.line)}parseFunctionDef(){let t;if(this.check(E.FUNCTION)){if(this.advance(),this.check(E.NAME)||this.check(E.WORD))t=this.advance().value;else{let s=this.current();throw new bt("Expected function name",s.line,s.column,s)}this.check(E.LPAREN)&&(this.advance(),this.expect(E.RPAREN))}else t=this.advance().value,t.includes("$")&&this.error(`\`${t}': not a valid identifier`),this.expect(E.LPAREN),this.expect(E.RPAREN);this.skipNewlines();let n=this.parseCompoundCommandBody({forFunctionBody:!0}),r=this.parseOptionalRedirections();return Y.functionDef(t,n,r)}parseCompoundCommandBody(t){let n=t?.forFunctionBody;if(this.check(E.LBRACE))return Xc(this,{skipRedirections:n});if(this.check(E.LPAREN))return Qc(this,{skipRedirections:n});if(this.check(E.IF))return Gc(this,{skipRedirections:n});if(this.check(E.FOR))return Vc(this,{skipRedirections:n});if(this.check(E.WHILE))return qc(this,{skipRedirections:n});if(this.check(E.UNTIL))return Zc(this,{skipRedirections:n});if(this.check(E.CASE))return Kc(this,{skipRedirections:n});this.error("Expected compound command for function body")}parseCompoundList(){let t=this.enterDepth(),n=[];for(this.skipNewlines();!this.check(E.EOF,E.FI,E.ELSE,E.ELIF,E.THEN,E.DO,E.DONE,E.ESAC,E.RPAREN,E.RBRACE,E.DSEMI,E.SEMI_AND,E.SEMI_SEMI_AND)&&this.isCommandStart();){this.checkIterationLimit();let r=this.pos,s=this.parseStatement();if(s&&n.push(s),this.skipSeparators(),this.pos===r&&!s)break}return t(),n}parseOptionalRedirections(){let t=[];for(;Vo(this);){this.checkIterationLimit();let n=this.pos;if(t.push(qo(this)),this.pos===n)break}return t}parseArithmeticExpression(t){return Ce(this,t)}}});function ru(e){return LA.get(e)??""}function bg(e){let t=[],n="",r=0;for(;r<e.length;){let s=e[r];if(s==="["){for(n+=s,r++,r<e.length&&(e[r]==="!"||e[r]==="^")&&(n+=e[r],r++),r<e.length&&e[r]==="]"&&(n+=e[r],r++);r<e.length&&e[r]!=="]";){if(e[r]==="["&&r+1<e.length&&e[r+1]===":"){let i=e.indexOf(":]",r+2);if(i!==-1){n+=e.slice(r,i+2),r=i+2;continue}}if(e[r]==="\\"&&r+1<e.length){n+=e[r]+e[r+1],r+=2;continue}n+=e[r],r++}r<e.length&&e[r]==="]"&&(n+=e[r],r++)}else s===":"?(n!==""&&t.push(n),n="",r++):s==="\\"&&r+1<e.length?(n+=s+e[r+1],r+=2):(n+=s,r++)}return n!==""&&t.push(n),t}function xg(e){let t="^";for(let n=0;n<e.length;n++){let r=e[n];if(r==="*")t+="[^/]*";else if(r==="?")t+="[^/]";else if(r==="["){let s=n+1,i="[";s<e.length&&(e[s]==="^"||e[s]==="!")&&(i+="^",s++),s<e.length&&e[s]==="]"&&(i+="\\]",s++);let o=s;for(;o<e.length;){if(e[o]==="\\"&&o+1<e.length){o+=2;continue}if(e[o]==="["&&o+1<e.length&&e[o+1]===":"){let l=e.indexOf(":]",o+2);if(l!==-1){o=l+2;continue}}if(e[o]==="]")break;o++}let a=s;for(;s<e.length&&e[s]!=="]";){if(e[s]==="["&&s+1<e.length&&e[s+1]===":"){let l=e.indexOf(":]",s+2);if(l!==-1){let c=e.slice(s+2,l),u=ru(c);i+=u,s=l+2;continue}}if(e[s]==="\\"&&s+1<e.length){i+=`\\${e[s+1]}`,s+=2;continue}if(e[s]==="-"){let l=s===a,c=s+1===o;l||c?i+="\\-":i+="-"}else i+=e[s];s++}i+="]",t+=i,n=s}else if(r==="\\"&&n+1<e.length){let s=e[n+1];/[.+^${}()|\\*?[\]]/.test(s)?t+=`\\${s}`:t+=s,n++}else/[.+^${}()|]/.test(r)?t+=`\\${r}`:t+=r}return t+="$",K(t)}function su(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let s=e[r];if(s==="\\"){r+=2;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function iu(e){let t=[],n="",r=0,s=!1,i=0;for(;i<e.length;){let o=e[i];if(o==="'"&&!s){s=!0,n+="\0QUOTE_START\0",i++;continue}if(o==="'"&&s){s=!1,n+="\0QUOTE_END\0",i++;continue}if(s){n+=o,i++;continue}if(o==="\\"){n+=o,i+1<e.length?(n+=e[i+1],i+=2):i++;continue}o==="("?(r++,n+=o):o===")"?(r--,n+=o):o==="|"&&r===0?(t.push(n),n=""):n+=o,i++}return t.push(n),t}var LA,Eg=v(()=>{"use strict";Ve();LA=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9a-fA-F"]])});var Ag,dr,Zo=v(()=>{"use strict";xe();Ve();Xr();Eg();Ag=5,dr=class{fs;cwd;globignorePatterns=[];hasGlobignore=!1;globstar=!1;nullglob=!1;failglob=!1;dotglob=!1;extglob=!1;globskipdots=!0;ops={count:0};maxOps;constructor(t,n,r,s){this.fs=t,this.cwd=n,typeof s=="boolean"?(this.globstar=s,this.maxOps=1e5):s?(this.globstar=s.globstar??!1,this.nullglob=s.nullglob??!1,this.failglob=s.failglob??!1,this.dotglob=s.dotglob??!1,this.extglob=s.extglob??!1,this.globskipdots=s.globskipdots??!0,this.maxOps=s.maxGlobOperations??1e5):this.maxOps=1e5;let i=r?.get("GLOBIGNORE");i!==void 0&&i!==""&&(this.hasGlobignore=!0,this.globignorePatterns=bg(i))}checkOpsLimit(){if(++this.ops.count>this.maxOps)throw new Q(`Glob operation limit exceeded (${this.maxOps})`,"glob_operations")}hasNullglob(){return this.nullglob}hasFailglob(){return this.failglob}filterGlobignore(t){return!this.hasGlobignore&&!this.globskipdots?t:t.filter(n=>{let r=n.split("/").pop()||n;if((this.hasGlobignore||this.globskipdots)&&(r==="."||r===".."))return!1;if(this.hasGlobignore){for(let s of this.globignorePatterns)if(this.matchGlobignorePattern(n,s))return!1}return!0})}matchGlobignorePattern(t,n){return xg(n).test(t)}isGlobPattern(t){return!!(t.includes("*")||t.includes("?")||/\[.*\]/.test(t)||this.extglob&&/[@*+?!]\(/.test(t))}async expandArgs(t,n){let r=t.map((o,a)=>(n?.[a]??!1)||!this.isGlobPattern(o)?null:this.expand(o)),s=await Promise.all(r.map(o=>o||Promise.resolve(null))),i=[];for(let o=0;o<t.length;o++){let a=s[o];a===null?i.push(t[o]):a.length>0?i.push(...a):i.push(t[o])}return i}async expand(t){if(this.globstar){let r=t.split("/"),s=0;for(let i of r)if(i==="**"&&(s++,s>Ag))throw new Q(`Glob pattern has too many ** segments (max ${Ag})`,"glob_operations")}let n;if(t.includes("**")&&this.globstar&&this.isGlobstarValid(t))n=await this.expandRecursive(t);else{let r=t.replace(/\*\*+/g,"*");n=await this.expandSimple(r)}return this.filterGlobignore(n)}isGlobstarValid(t){let n=t.split("/");for(let r of n)if(r.includes("**")&&r!=="**")return!1;return!0}hasGlobChars(t){return!!(t.includes("*")||t.includes("?")||/\[.*\]/.test(t)||this.extglob&&/[@*+?!]\(/.test(t))}async expandSimple(t){let n=t.startsWith("/"),r=t.split("/").filter(c=>c!==""),s=-1;for(let c=0;c<r.length;c++)if(this.hasGlobChars(r[c])){s=c;break}if(s===-1)return[t];let i,o;if(s===0)n?(i="/",o="/"):(i=this.cwd,o="");else{let c=r.slice(0,s);n?(i=`/${c.join("/")}`,o=`/${c.join("/")}`):(i=this.fs.resolvePath(this.cwd,c.join("/")),o=c.join("/"))}let a=r.slice(s);return(await this.expandSegments(i,o,a)).sort()}async expandSegments(t,n,r){if(this.checkOpsLimit(),r.length===0)return[n];let[s,...i]=r,o=[];try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let a=await this.fs.readdirWithFileTypes(t),l=[],c=[...a],u=this.dotglob||this.hasGlobignore;if(s.startsWith(".")||this.dotglob){let p=a.some(d=>d.name==="."),h=a.some(d=>d.name==="..");p||c.push({name:".",isFile:!1,isDirectory:!0,isSymbolicLink:!1}),h||c.push({name:"..",isFile:!1,isDirectory:!0,isSymbolicLink:!1})}for(let p of c)if(!(p.name.startsWith(".")&&!s.startsWith(".")&&!u)&&this.matchPattern(p.name,s)){let h=t==="/"?`/${p.name}`:`${t}/${p.name}`,d;n===""?d=p.name:n==="/"?d=`/${p.name}`:d=`${n}/${p.name}`,i.length===0?l.push(Promise.resolve([d])):p.isDirectory&&l.push(this.expandSegments(h,d,i))}let f=await Promise.all(l);for(let p of f)o.push(...p)}else{this.checkOpsLimit();let a=await this.fs.readdir(t),l=[],c=[...a],u=this.dotglob||this.hasGlobignore;(s.startsWith(".")||this.dotglob)&&(a.includes(".")||c.push("."),a.includes("..")||c.push(".."));for(let p of c)if(!(p.startsWith(".")&&!s.startsWith(".")&&!u)&&this.matchPattern(p,s)){let h=t==="/"?`/${p}`:`${t}/${p}`,d;n===""?d=p:n==="/"?d=`/${p}`:d=`${n}/${p}`,i.length===0?l.push(Promise.resolve([d])):l.push((async()=>{try{if(this.checkOpsLimit(),(await this.fs.stat(h)).isDirectory)return this.expandSegments(h,d,i)}catch(m){if(m instanceof Q)throw m}return[]})())}let f=await Promise.all(l);for(let p of f)o.push(...p)}}catch(a){if(a instanceof Q)throw a}return o}async expandRecursive(t){let n=[],r=t.indexOf("**"),s=t.slice(0,r).replace(/\/$/,"")||".",o=t.slice(r+2).replace(/^\//,"");return o.includes("**")&&this.isGlobstarValid(o)?(await this.walkDirectoryMultiGlobstar(s,o,n),[...new Set(n)].sort()):(await this.walkDirectory(s,o,n),n.sort())}async walkDirectoryMultiGlobstar(t,n,r){this.checkOpsLimit();let s=this.fs.resolvePath(this.cwd,t);try{this.checkOpsLimit();let i=this.fs.readdirWithFileTypes?await this.fs.readdirWithFileTypes(s):null;if(i){let o=[];for(let c of i){let u=t==="."?c.name:`${t}/${c.name}`;c.isDirectory&&o.push(u)}let a=t==="."?n:`${t}/${n}`,l=await this.expandRecursive(a);r.push(...l);for(let c=0;c<o.length;c+=100){let u=o.slice(c,c+100);await Promise.all(u.map(f=>this.walkDirectoryMultiGlobstar(f,n,r)))}}else{this.checkOpsLimit();let o=await this.fs.readdir(s),a=[];for(let u of o){let f=t==="."?u:`${t}/${u}`,p=this.fs.resolvePath(this.cwd,f);try{this.checkOpsLimit(),(await this.fs.stat(p)).isDirectory&&a.push(f)}catch(h){if(h instanceof Q)throw h}}let l=t==="."?n:`${t}/${n}`,c=await this.expandRecursive(l);r.push(...c);for(let u=0;u<a.length;u+=100){let f=a.slice(u,u+100);await Promise.all(f.map(p=>this.walkDirectoryMultiGlobstar(p,n,r)))}}}catch(i){if(i instanceof Q)throw i}}async walkDirectory(t,n,r){this.checkOpsLimit();let s=this.fs.resolvePath(this.cwd,t);try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let i=await this.fs.readdirWithFileTypes(s),o=[],a=[];for(let l of i){let c=t==="."?l.name:`${t}/${l.name}`;l.isDirectory?a.push(c):n&&this.matchPattern(l.name,n)&&o.push(c)}r.push(...o);for(let l=0;l<a.length;l+=100){let c=a.slice(l,l+100);await Promise.all(c.map(u=>this.walkDirectory(u,n,r)))}}else{this.checkOpsLimit();let i=await this.fs.readdir(s),o=[];for(let l=0;l<i.length;l+=100){let c=i.slice(l,l+100),u=await Promise.all(c.map(async f=>{let p=t==="."?f:`${t}/${f}`,h=this.fs.resolvePath(this.cwd,p);try{this.checkOpsLimit();let d=await this.fs.stat(h);return{name:f,path:p,isDirectory:d.isDirectory}}catch(d){if(d instanceof Q)throw d;return null}}));o.push(...u.filter(f=>f!==null))}for(let l of o)!l.isDirectory&&n&&this.matchPattern(l.name,n)&&r.push(l.path);let a=o.filter(l=>l.isDirectory);for(let l=0;l<a.length;l+=100){let c=a.slice(l,l+100);await Promise.all(c.map(u=>this.walkDirectory(u.path,n,r)))}}}catch(i){if(i instanceof Q)throw i}}matchPattern(t,n){return this.patternToRegex(n).test(t)}patternToRegex(t){let n=this.patternToRegexStr(t);return K(`^${n}$`)}patternToRegexStr(t){let n="",r=!1;for(let s=0;s<t.length;s++){if(t.slice(s,s+13)==="\0QUOTE_START\0"){r=!0,s+=12;continue}if(t.slice(s,s+11)==="\0QUOTE_END\0"){r=!1,s+=10;continue}let i=t[s];if(r){/[.+^${}()|\\*?[\]]/.test(i)?n+=`\\${i}`:n+=i;continue}if(this.extglob&&(i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&s+1<t.length&&t[s+1]==="("){let o=su(t,s+1);if(o!==-1){let a=t.slice(s+2,o),l=iu(a),c=l.map(f=>this.patternToRegexStr(f)),u=c.length>0?c.join("|"):"(?:)";if(i==="@")n+=`(?:${u})`;else if(i==="*")n+=`(?:${u})*`;else if(i==="+")n+=`(?:${u})+`;else if(i==="?")n+=`(?:${u})?`;else if(i==="!")if(o<t.length-1){let p=l.map(d=>this.computePatternLength(d));if(p.every(d=>d!==null)&&p.every(d=>d===p[0])&&p[0]!==null){let d=p[0];if(d===0)n+="(?:.+)";else{let m=[];d>0&&m.push(`.{0,${d-1}}`),m.push(`.{${d+1},}`),m.push(`(?!(?:${u})).{${d}}`),n+=`(?:${m.join("|")})`}}else n+=`(?:(?!(?:${u})).)*?`}else n+=`(?!(?:${u})$).*`;s=o;continue}}if(i==="*")n+=".*";else if(i==="?")n+=".";else if(i==="["){let o=s+1,a="[";o<t.length&&(t[o]==="^"||t[o]==="!")&&(a+="^",o++),o<t.length&&t[o]==="]"&&(a+="\\]",o++);let l=o;for(;l<t.length;){if(t[l]==="\\"&&l+1<t.length){l+=2;continue}if(t[l]==="["&&l+1<t.length&&t[l+1]===":"){let u=t.indexOf(":]",l+2);if(u!==-1){l=u+2;continue}}if(t[l]==="]")break;l++}let c=o;for(;o<t.length&&t[o]!=="]";){if(t[o]==="["&&o+1<t.length&&t[o+1]===":"){let u=t.indexOf(":]",o+2);if(u!==-1){let f=t.slice(o+2,u),p=ru(f);a+=p,o=u+2;continue}}if(t[o]==="\\"&&o+1<t.length){a+=`\\${t[o+1]}`,o+=2;continue}if(t[o]==="-"){let u=o===c,f=o+1===l;u||f?a+="\\-":a+="-"}else a+=t[o];o++}a+="]",n+=a,s=o}else if(i==="\\"&&s+1<t.length){let o=t[s+1];/[.+^${}()|\\*?[\]]/.test(o)?n+=`\\${o}`:n+=o,s++}else/[.+^${}()|]/.test(i)?n+=`\\${i}`:n+=i}return n}computePatternLength(t){let n=0,r=0,s=!1;for(;r<t.length;){if(t.slice(r,r+13)==="\0QUOTE_START\0"){s=!0,r+=13;continue}if(t.slice(r,r+11)==="\0QUOTE_END\0"){s=!1,r+=11;continue}let i=t[r];if(s){n+=1,r++;continue}if((i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&r+1<t.length&&t[r+1]==="("){let o=su(t,r+1);if(o!==-1){if(i==="@"){let a=t.slice(r+2,o),c=iu(a).map(u=>this.computePatternLength(u));if(c.every(u=>u!==null)&&c.every(u=>u===c[0])){n+=c[0],r=o+1;continue}return null}return null}}if(i==="*")return null;if(i==="?"){n+=1,r++;continue}if(i==="["){let o=t.indexOf("]",r+1);if(o!==-1){n+=1,r=o+1;continue}n+=1,r++;continue}if(i==="\\"){n+=1,r+=2;continue}n+=1,r++}return n}}});function ou(e){for(let t=0;t<e.length;t++){if(e[t]==="\\"){t++;continue}if(e[t]==="$"){let n=e[t+1];if(n==="{"||n&&/[a-zA-Z_]/.test(n))return!0}}return!1}function MA(e){if(!e.operation)return!1;let t=e.operation,n;if((t.type==="DefaultValue"||t.type==="AssignDefault"||t.type==="UseAlternative"||t.type==="ErrorIfUnset")&&(n=t.word?.parts),!n)return!1;for(let r of n)if(r.type==="DoubleQuoted"||r.type==="SingleQuoted")return!0;return!1}function Sg(e){if(!e.operation)return!1;let t=e.operation,n;if((t.type==="DefaultValue"||t.type==="AssignDefault"||t.type==="UseAlternative"||t.type==="ErrorIfUnset")&&(n=t.word?.parts),!n||n.length===0)return!1;for(let r of n)if(r.type!=="DoubleQuoted"&&r.type!=="SingleQuoted")return!1;return!0}function wi(e){let t=!1,n=!1,r=!1,s=!1,i=!1,o=!1,a=!1;for(let l of e){if((l.type==="SingleQuoted"||l.type==="DoubleQuoted")&&(t=!0,l.type==="DoubleQuoted"))for(let c of l.parts)c.type==="ParameterExpansion"&&(c.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/)&&(!c.operation||c.operation.type==="PatternRemoval"||c.operation.type==="PatternReplacement")&&(s=!0),(c.operation?.type==="VarNamePrefix"||c.operation?.type==="ArrayKeys")&&(o=!0),c.operation?.type==="Indirection"&&(a=!0));l.type==="CommandSubstitution"&&(n=!0),l.type==="ParameterExpansion"&&(i=!0,(l.parameter==="@"||l.parameter==="*")&&(r=!0),MA(l)&&(t=!0),(l.operation?.type==="VarNamePrefix"||l.operation?.type==="ArrayKeys")&&(o=!0),l.operation?.type==="Indirection"&&(a=!0)),l.type==="Glob"&&ou(l.pattern)&&(i=!0)}return{hasQuoted:t,hasCommandSub:n,hasArrayVar:r,hasArrayAtExpansion:s,hasParamExpansion:i,hasVarNamePrefixExpansion:o,hasIndirection:a}}var Ko=v(()=>{"use strict"});function at(e,t){let n=`${t}_`,r=[];for(let s of e.state.env.keys())if(s.startsWith(n)){let i=s.slice(n.length),o=Number.parseInt(i,10);!Number.isNaN(o)&&String(o)===i&&r.push(o)}return r.sort((s,i)=>s-i)}function Bn(e,t){let n=`${t}_`;for(let r of e.state.env.keys())r.startsWith(n)&&e.state.env.delete(r)}function Cn(e,t){let n=`${t}_`,r=`${t}__length`,s=[];for(let i of e.state.env.keys())if(i!==r&&i.startsWith(n)){let o=i.slice(n.length);if(o.startsWith("_length"))continue;s.push(o)}return s.sort()}function Qo(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function au(e){if(e.parts.length<2)return null;let t=e.parts[0],n=e.parts[1];if(t.type!=="Glob"||!t.pattern.startsWith("["))return null;let r,s=n,i=1;if(n.type==="Literal"&&n.value.startsWith("]")){let f=n.value.slice(1);if(f.startsWith("+=")||f.startsWith("="))r=t.pattern.slice(1);else if(f===""){if(e.parts.length<3)return null;let p=e.parts[2];if(p.type!=="Literal"||!p.value.startsWith("=")&&!p.value.startsWith("+="))return null;r=t.pattern.slice(1),s=p,i=2}else return null}else if(t.pattern==="["&&(n.type==="DoubleQuoted"||n.type==="SingleQuoted")){if(e.parts.length<3)return null;let f=e.parts[2];if(f.type!=="Literal"||!f.value.startsWith("]=")&&!f.value.startsWith("]+="))return null;if(n.type==="SingleQuoted")r=n.value;else{r="";for(let p of n.parts)(p.type==="Literal"||p.type==="Escaped")&&(r+=p.value)}s=f,i=2}else if(t.pattern.endsWith("]")){if(n.type!=="Literal"||!n.value.startsWith("=")&&!n.value.startsWith("+="))return null;r=t.pattern.slice(1,-1)}else return null;r=Qo(r);let o;if(s.type!=="Literal")return null;s.value.startsWith("]=")||s.value.startsWith("]+=")?o=s.value.slice(1):o=s.value;let a=o.startsWith("+=");if(!a&&!o.startsWith("="))return null;let l=[],c=a?2:1,u=o.slice(c);u&&l.push({type:"Literal",value:u});for(let f=i+1;f<e.parts.length;f++){let p=e.parts[f];p.type==="BraceExpansion"?l.push({type:"Literal",value:UA(p)}):l.push(p)}return{key:r,valueParts:l,append:a}}function UA(e){return`{${e.items.map(n=>{if(n.type==="Range"){let r=n.startStr??String(n.start),s=n.endStr??String(n.end),i=`${r}..${s}`;return n.step&&(i+=`..${n.step}`),i}return ks(n.word)}).join(",")}}`}function ks(e){let t="";for(let n of e.parts)switch(n.type){case"Literal":t+=n.value;break;case"Glob":t+=n.pattern;break;case"SingleQuoted":t+=n.value;break;case"DoubleQuoted":for(let r of n.parts)(r.type==="Literal"||r.type==="Escaped")&&(t+=r.value);break;case"Escaped":t+=n.value;break;case"BraceExpansion":t+="{",t+=n.items.map(r=>r.type==="Range"?`${r.startStr}..${r.endStr}${r.step?`..${r.step}`:""}`:ks(r.word)).join(","),t+="}";break;case"TildeExpansion":t+="~",n.user&&(t+=n.user);break}return t}var dn=v(()=>{"use strict"});function ht(e){return e.get("IFS")??`
|
|
773
|
+
`}function St(e){return e.get("IFS")===""}function Xo(e){let t=ht(e);if(t==="")return!0;for(let n of t)if(n!==" "&&n!==" "&&n!==`
|
|
774
|
+
`)return!1;return!0}function Cg(e){let t=!1,n=[];for(let r of e.split(""))r==="-"?t=!0:/[\\^$.*+?()[\]{}|]/.test(r)?n.push(`\\${r}`):r===" "?n.push("\\t"):r===`
|
|
775
|
+
`?n.push("\\n"):n.push(r);return t&&n.push("\\-"),n.join("")}function de(e){let t=e.get("IFS");return t===void 0?" ":t[0]||""}function WA(e){return BA.includes(e)}function lu(e){let t=new Set,n=new Set;for(let r of e)WA(r)?t.add(r):n.add(r);return{whitespace:t,nonWhitespace:n}}function cu(e,t,n,r){if(t==="")return e===""?{words:[],wordStarts:[]}:{words:[e],wordStarts:[0]};let{whitespace:s,nonWhitespace:i}=lu(t),o=[],a=[],l=0;for(;l<e.length&&s.has(e[l]);)l++;if(l>=e.length)return{words:[],wordStarts:[]};if(i.has(e[l]))for(o.push(""),a.push(l),l++;l<e.length&&s.has(e[l]);)l++;for(;l<e.length&&!(n!==void 0&&o.length>=n);){let c=l;for(a.push(c);l<e.length;){let u=e[l];if(!r&&u==="\\"){l++,l<e.length&&l++;continue}if(s.has(u)||i.has(u))break;l++}if(o.push(e.substring(c,l)),l>=e.length)break;for(;l<e.length&&s.has(e[l]);)l++;if(l<e.length&&i.has(e[l])){for(l++;l<e.length&&s.has(e[l]);)l++;for(;l<e.length&&i.has(e[l])&&!(n!==void 0&&o.length>=n);)for(o.push(""),a.push(l),l++;l<e.length&&s.has(e[l]);)l++}}return{words:o,wordStarts:a}}function Yo(e,t){if(t==="")return{words:e?[e]:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};if(e==="")return{words:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};let{whitespace:n,nonWhitespace:r}=lu(t),s=[],i=0,o=!1,a=!1,l=i;for(;i<e.length&&n.has(e[i]);)i++;if(i>l&&(o=!0),i>=e.length)return{words:[],hadLeadingDelimiter:!0,hadTrailingDelimiter:!0};if(r.has(e[i]))for(s.push(""),i++;i<e.length&&n.has(e[i]);)i++;for(;i<e.length;){let c=i;for(;i<e.length;){let f=e[i];if(n.has(f)||r.has(f))break;i++}if(s.push(e.substring(c,i)),i>=e.length){a=!1;break}let u=i;for(;i<e.length&&n.has(e[i]);)i++;if(i<e.length&&r.has(e[i])){for(i++;i<e.length&&n.has(e[i]);)i++;for(;i<e.length&&r.has(e[i]);)for(s.push(""),i++;i<e.length&&n.has(e[i]);)i++}i>=e.length&&i>u&&(a=!0)}return{words:s,hadLeadingDelimiter:o,hadTrailingDelimiter:a}}function He(e,t){return Yo(e,t).words}function zA(e,t){for(let n of e)if(t.has(n))return!0;return!1}function vg(e,t,n){if(t==="")return e;let{whitespace:r,nonWhitespace:s}=lu(t),i=e.length;for(;i>0&&r.has(e[i-1]);){if(!n&&i>=2){let a=0,l=i-2;for(;l>=0&&e[l]==="\\";)a++,l--;if(a%2===1)break}i--}let o=e.substring(0,i);if(o.length>=1&&s.has(o[o.length-1])){if(!n&&o.length>=2){let l=0,c=o.length-2;for(;c>=0&&o[c]==="\\";)l++,c--;if(l%2===1)return o}let a=o.substring(0,o.length-1);if(!zA(a,s))return a}return o}var BA,rn=v(()=>{"use strict";BA=`
|
|
776
|
+
`});function Me(e,t){return e.state.namerefs?.has(t)??!1}function Jn(e,t){e.state.namerefs??=new Set,e.state.namerefs.add(t)}function kg(e,t){e.state.namerefs?.delete(t),e.state.boundNamerefs?.delete(t),e.state.invalidNamerefs?.delete(t)}function Ng(e,t){e.state.invalidNamerefs??=new Set,e.state.invalidNamerefs.add(t)}function Ig(e,t){return e.state.invalidNamerefs?.has(t)??!1}function uu(e,t){e.state.boundNamerefs??=new Set,e.state.boundNamerefs.add(t)}function Jo(e,t){let n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let s=n[1],i=Array.from(e.state.env.keys()).some(a=>a.startsWith(`${s}_`)&&!a.includes("__")),o=e.state.associativeArrays?.has(s)??!1;return i||o}return Array.from(e.state.env.keys()).some(s=>s.startsWith(`${t}_`)&&!s.includes("__"))?!0:e.state.env.has(t)}function _t(e,t,n=100){if(!Me(e,t)||Ig(e,t))return t;let r=new Set,s=t;for(;n-- >0;){if(r.has(s))return;if(r.add(s),!Me(e,s))return s;let i=e.state.env.get(s);if(i===void 0||i===""||!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(i))return s;s=i}}function Hr(e,t){if(Me(e,t))return e.state.env.get(t)}function $g(e,t,n,r=100){if(!Me(e,t)||Ig(e,t))return t;let s=new Set,i=t;for(;r-- >0;){if(s.has(i))return;if(s.add(i),!Me(e,i))return i;let o=e.state.env.get(i);if(o===void 0||o==="")return n!==void 0?/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)&&Jo(e,n)?i:null:i;if(!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(o))return i;i=o}}var vn=v(()=>{"use strict"});function HA(e,t){let n=t.replace(/\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(r,s)=>e.state.env.get(s)??"");return n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(r,s)=>e.state.env.get(s)??""),n}function oe(e,t){return t==="FUNCNAME"?(e.state.funcNameStack??[]).map((i,o)=>[o,i]):t==="BASH_LINENO"?(e.state.callLineStack??[]).map((i,o)=>[o,String(i)]):t==="BASH_SOURCE"?(e.state.sourceStack??[]).map((i,o)=>[o,i]):e.state.associativeArrays?.has(t)?Cn(e,t).map(i=>[i,e.state.env.get(`${t}_${i}`)??""]):at(e,t).map(s=>[s,e.state.env.get(`${t}_${s}`)??""])}function er(e,t){return t==="FUNCNAME"?(e.state.funcNameStack?.length??0)>0:t==="BASH_LINENO"?(e.state.callLineStack?.length??0)>0:t==="BASH_SOURCE"?(e.state.sourceStack?.length??0)>0:e.state.associativeArrays?.has(t)?Cn(e,t).length>0:at(e,t).length>0}async function ve(e,t,n=!0,r=!1){switch(t){case"?":return String(e.state.lastExitCode);case"$":return String(e.state.virtualPid);case"#":return e.state.env.get("#")||"0";case"@":return e.state.env.get("@")||"";case"_":return e.state.lastArg;case"-":{let o="";return o+="h",e.state.options.errexit&&(o+="e"),e.state.options.noglob&&(o+="f"),e.state.options.nounset&&(o+="u"),e.state.options.verbose&&(o+="v"),e.state.options.xtrace&&(o+="x"),o+="B",e.state.options.noclobber&&(o+="C"),o+="s",o}case"*":{let o=Number.parseInt(e.state.env.get("#")||"0",10);if(o===0)return"";let a=[];for(let l=1;l<=o;l++)a.push(e.state.env.get(String(l))||"");return a.join(de(e.state.env))}case"0":return e.state.env.get("0")||"bash";case"PWD":return e.state.env.get("PWD")??"";case"OLDPWD":return e.state.env.get("OLDPWD")??"";case"PPID":return String(e.state.virtualPpid);case"UID":return String(e.state.virtualUid);case"EUID":return String(e.state.virtualUid);case"RANDOM":return String(Math.floor(Math.random()*32768));case"SECONDS":return String(Math.floor((Date.now()-e.state.startTime)/1e3));case"BASH_VERSION":return A2;case"!":return String(e.state.lastBackgroundPid);case"BASHPID":return String(e.state.bashPid);case"LINENO":return String(e.state.currentLine);case"FUNCNAME":{let o=e.state.funcNameStack?.[0];if(o!==void 0)return o;if(n&&e.state.options.nounset)throw new $t("FUNCNAME");return""}case"BASH_LINENO":{let o=e.state.callLineStack?.[0];if(o!==void 0)return String(o);if(n&&e.state.options.nounset)throw new $t("BASH_LINENO");return""}case"BASH_SOURCE":{let o=e.state.sourceStack?.[0];if(o!==void 0)return o;if(n&&e.state.options.nounset)throw new $t("BASH_SOURCE");return""}}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/.test(t))throw new Ot(`\${${t}}`);let s=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(s){let o=s[1],a=s[2];if(Me(e,o)){let f=_t(e,o);if(f&&f!==o){if(f.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return"";o=f}}if(a==="@"||a==="*"){let f=oe(e,o);if(f.length>0)return f.map(([,h])=>h).join(" ");let p=e.state.env.get(o);return p!==void 0?p:""}if(o==="FUNCNAME"){let f=Number.parseInt(a,10);return!Number.isNaN(f)&&f>=0?e.state.funcNameStack?.[f]??"":""}if(o==="BASH_LINENO"){let f=Number.parseInt(a,10);if(!Number.isNaN(f)&&f>=0){let p=e.state.callLineStack?.[f];return p!==void 0?String(p):""}return""}if(o==="BASH_SOURCE"){let f=Number.parseInt(a,10);return!Number.isNaN(f)&&f>=0?e.state.sourceStack?.[f]??"":""}if(e.state.associativeArrays?.has(o)){let f=Qo(a);f=HA(e,f);let p=e.state.env.get(`${o}_${f}`);if(p===void 0&&n&&e.state.options.nounset)throw new $t(`${o}[${a}]`);return p||""}let c;if(/^-?\d+$/.test(a))c=Number.parseInt(a,10);else try{let f=new ce,p=Ce(f,a);c=await te(e,p.expression)}catch{let f=e.state.env.get(a);c=f?Number.parseInt(f,10):0,Number.isNaN(c)&&(c=0)}if(c<0){let f=oe(e,o),p=e.state.currentLine;if(f.length===0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${p}: ${o}: bad array subscript
|
|
777
|
+
`,"";let d=Math.max(...f.map(([g])=>typeof g=="number"?g:0))+1+c;return d<0?(e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${p}: ${o}: bad array subscript
|
|
778
|
+
`,""):e.state.env.get(`${o}_${d}`)||""}let u=e.state.env.get(`${o}_${c}`);if(u!==void 0)return u;if(c===0){let f=e.state.env.get(o);if(f!==void 0)return f}if(n&&e.state.options.nounset)throw new $t(`${o}[${c}]`);return""}if(/^[1-9][0-9]*$/.test(t)){let o=e.state.env.get(t);if(o===void 0&&n&&e.state.options.nounset)throw new $t(t);return o||""}if(Me(e,t)){let o=_t(e,t);if(o===void 0)return"";if(o!==t)return await ve(e,o,n,r);let a=e.state.env.get(t);if((a===void 0||a==="")&&n&&e.state.options.nounset)throw new $t(t);return a||""}let i=e.state.env.get(t);if(i!==void 0)return e.state.tempEnvBindings?.some(o=>o.has(t))&&(e.state.accessedTempEnvVars=e.state.accessedTempEnvVars||new Set,e.state.accessedTempEnvVars.add(t)),i;if(er(e,t)){let o=e.state.env.get(`${t}_0`);return o!==void 0?o:""}if(n&&e.state.options.nounset)throw new $t(t);return""}async function Wn(e,t){if(new Set(["?","$","#","_","-","0","PPID","UID","EUID","RANDOM","SECONDS","BASH_VERSION","!","BASHPID","LINENO"]).has(t))return!0;if(t==="@"||t==="*")return Number.parseInt(e.state.env.get("#")||"0",10)>0;if(t==="PWD"||t==="OLDPWD")return e.state.env.has(t);let r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(r){let s=r[1],i=r[2];if(Me(e,s)){let l=_t(e,s);if(l&&l!==s){if(l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return!1;s=l}}if(i==="@"||i==="*")return oe(e,s).length>0?!0:e.state.env.has(s);if(e.state.associativeArrays?.has(s)){let l=Qo(i);return e.state.env.has(`${s}_${l}`)}let a;if(/^-?\d+$/.test(i))a=Number.parseInt(i,10);else try{let l=new ce,c=Ce(l,i);a=await te(e,c.expression)}catch{let l=e.state.env.get(i);a=l?Number.parseInt(l,10):0,Number.isNaN(a)&&(a=0)}if(a<0){let l=oe(e,s);if(l.length===0)return!1;let u=Math.max(...l.map(([f])=>typeof f=="number"?f:0))+1+a;return u<0?!1:e.state.env.has(`${s}_${u}`)}return e.state.env.has(`${s}_${a}`)}if(Me(e,t)){let s=_t(e,t);return s===void 0||s===t?e.state.env.has(t):Wn(e,s)}return!!(e.state.env.has(t)||er(e,t))}var Zt=v(()=>{"use strict";Nt();ot();Rc();Ft();xe();dn();rn();vn()});async function Og(e,t){let n="",r=0;for(;r<t.length;){if(t[r]==="$"){if(t[r+1]==="{"){let s=1,i=r+2;for(;i<t.length&&s>0;)t[i]==="{"?s++:t[i]==="}"&&s--,i++;n+=t.slice(r,i),r=i;continue}if(t[r+1]==="("){let s=1,i=r+2;for(;i<t.length&&s>0;)t[i]==="("?s++:t[i]===")"&&s--,i++;n+=t.slice(r,i),r=i;continue}if(/[a-zA-Z_]/.test(t[r+1]||"")){let s=r+1;for(;s<t.length&&/[a-zA-Z0-9_]/.test(t[s]);)s++;let i=t.slice(r+1,s),o=await ve(e,i);n+=o,r=s;continue}if(/[0-9]/.test(t[r+1]||"")){let s=r+1;for(;s<t.length&&/[0-9]/.test(t[s]);)s++;let i=t.slice(r+1,s),o=await ve(e,i);n+=o,r=s;continue}if(/[*@#?\-!$]/.test(t[r+1]||"")){let s=t[r+1],i=await ve(e,s);n+=i,r+=2;continue}}if(t[r]==='"'){for(n+='"',r++;r<t.length&&t[r]!=='"';)if(t[r]==="$"&&/[a-zA-Z_]/.test(t[r+1]||"")){let s=r+1;for(;s<t.length&&/[a-zA-Z0-9_]/.test(t[s]);)s++;let i=t.slice(r+1,s),o=await ve(e,i);n+=o,r=s}else t[r]==="\\"?(n+=t[r],r++,r<t.length&&(n+=t[r],r++)):(n+=t[r],r++);r<t.length&&(n+='"',r++);continue}n+=t[r],r++}return n}async function fu(e,t){let n=t,r=t.startsWith('"')&&t.endsWith('"'),s=t.startsWith("'")&&t.endsWith("'");if((r||s)&&(n=t.slice(1,-1)),s)return n;let i="",o=0;for(;o<n.length;)if(n[o]==="$")if(n[o+1]==="("){let a=1,l=o+2;for(;l<n.length&&a>0;)n[l]==="("&&n[l-1]==="$"||n[l]==="("?a++:n[l]===")"&&a--,l++;let c=n.slice(o+2,l-1);if(e.execFn){let u=await e.execFn(c,{signal:e.state.signal});i+=u.stdout.replace(/\n+$/,""),u.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+u.stderr)}o=l}else if(n[o+1]==="{"){let a=1,l=o+2;for(;l<n.length&&a>0;)n[l]==="{"?a++:n[l]==="}"&&a--,l++;let c=n.slice(o+2,l-1),u=await ve(e,c);i+=u,o=l}else if(/[a-zA-Z_]/.test(n[o+1]||"")){let a=o+1;for(;a<n.length&&/[a-zA-Z0-9_]/.test(n[a]);)a++;let l=n.slice(o+1,a),c=await ve(e,l);i+=c,o=a}else i+=n[o],o++;else if(n[o]==="`"){let a=o+1;for(;a<n.length&&n[a]!=="`";)a++;let l=n.slice(o+1,a);if(e.execFn){let c=await e.execFn(l,{signal:e.state.signal});i+=c.stdout.replace(/\n+$/,""),c.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+c.stderr)}o=a+1}else i+=n[o],o++;return i}var Rg=v(()=>{"use strict";Zt()});function jA(e,t,n,r,s){let i=n??1;i===0&&(i=1);let o=Math.abs(i),a=[],l=0;r?.match(/^-?0\d/)&&(l=Math.max(l,r.replace(/^-/,"").length)),s?.match(/^-?0\d/)&&(l=Math.max(l,s.replace(/^-/,"").length));let c=u=>{if(l>0){let f=u<0,p=String(Math.abs(u)).padStart(l,"0");return f?`-${p}`:p}return String(u)};if(e<=t)for(let u=e,f=0;u<=t&&f<ea;u+=o,f++)a.push(c(u));else for(let u=e,f=0;u>=t&&f<ea;u-=o,f++)a.push(c(u));return a}function GA(e,t,n){let r=n??1;r===0&&(r=1);let s=e.charCodeAt(0),i=t.charCodeAt(0),o=Math.abs(r),a=e>="A"&&e<="Z",l=e>="a"&&e<="z",c=t>="A"&&t<="Z",u=t>="a"&&t<="z";if(a&&u||l&&c){let p=n!==void 0?`..${n}`:"";throw new Jr(`{${e}..${t}${p}}: invalid sequence`)}let f=[];if(s<=i)for(let p=s,h=0;p<=i&&h<ea;p+=o,h++)f.push(String.fromCharCode(p));else for(let p=s,h=0;p>=i&&h<ea;p-=o,h++)f.push(String.fromCharCode(p));return f}function pu(e,t,n,r,s){let i=n!==void 0?`..${n}`:"";return typeof e=="number"&&typeof t=="number"?{expanded:jA(e,t,n,r,s),literal:`{${e}..${t}${i}}`}:typeof e=="string"&&typeof t=="string"?{expanded:GA(e,t,n),literal:`{${e}..${t}${i}}`}:{expanded:null,literal:`{${e}..${t}${i}}`}}var ea,Tg=v(()=>{"use strict";xe();ea=1e4});function Pg(e){if(e.statements.length!==1)return null;let t=e.statements[0];if(t.operators.length!==0||t.pipelines.length!==1)return null;let n=t.pipelines[0];if(n.negated||n.commands.length!==1)return null;let r=n.commands[0];if(r.type!=="SimpleCommand")return null;let s=r;if(s.name!==null||s.args.length!==0||s.assignments.length!==0||s.redirections.length!==1)return null;let i=s.redirections[0];return i.operator!=="<"||i.target.type!=="Word"?null:{target:i.target}}var Dg=v(()=>{"use strict"});function zn(e,t){return!!(/[*?[]/.test(e)||t&&/[@*+?!]\(/.test(e))}function hu(e){let t="",n=0;for(;n<e.length;)e[n]==="\\"&&n+1<e.length?(t+=e[n+1],n+=2):(t+=e[n],n++);return t}function Kt(e){return e.replace(/([*?[\]\\()|])/g,"\\$1")}function Ns(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var Is=v(()=>{"use strict"});function Ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var $s=v(()=>{"use strict"});function we(e,t,n=!1){let r="",s=0;for(;s<e.length;){let i=e[s];if(n&&(i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&s+1<e.length&&e[s+1]==="("){let o=VA(e,s+1);if(o!==-1){let a=e.slice(s+2,o),c=qA(a).map(f=>we(f,t,n)),u=c.length>0?c.join("|"):"(?:)";i==="@"?r+=`(?:${u})`:i==="*"?r+=`(?:${u})*`:i==="+"?r+=`(?:${u})+`:i==="?"?r+=`(?:${u})?`:i==="!"&&(r+=`(?!(?:${u})$).*`),s=o+1;continue}}if(i==="\\")if(s+1<e.length){let o=e[s+1];/[\\^$.|+(){}[\]*?]/.test(o)?r+=`\\${o}`:r+=o,s+=2}else r+="\\\\",s++;else if(i==="*")r+=t?".*":".*?",s++;else if(i==="?")r+=".",s++;else if(i==="["){let o=ZA(e,s);if(o===-1)r+="\\[",s++;else{let a=e.slice(s+1,o);r+=KA(a),s=o+1}}else/[\^$.|+(){}]/.test(i)?(r+=`\\${i}`,s++):(r+=i,s++)}return r}function VA(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let s=e[r];if(s==="\\"){r+=2;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function qA(e){let t=[],n="",r=0,s=0;for(;s<e.length;){let i=e[s];if(i==="\\"){n+=i,s+1<e.length?(n+=e[s+1],s+=2):s++;continue}i==="("?(r++,n+=i):i===")"?(r--,n+=i):i==="|"&&r===0?(t.push(n),n=""):n+=i,s++}return t.push(n),t}function ZA(e,t){let n=t+1;for(n<e.length&&e[n]==="^"&&n++,n<e.length&&e[n]==="]"&&n++;n<e.length;){if(e[n]==="\\"&&n+1<e.length){n+=2;continue}if(e[n]==="]")return n;if(e[n]==="'"){let r=e.indexOf("'",n+1);if(r!==-1){n=r+1;continue}}if(e[n]==="["&&n+1<e.length&&e[n+1]===":"){let r=e.indexOf(":]",n+2);if(r!==-1){n=r+2;continue}}n++}return-1}function KA(e){let t="[",n=0;for((e[0]==="^"||e[0]==="!")&&(t+="^",n++);n<e.length;){if(e[n]==="'"){let s=e.indexOf("'",n+1);if(s!==-1){let i=e.slice(n+1,s);for(let o of i)o==="\\"?t+="\\\\":o==="]"?t+="\\]":o==="^"&&t==="["?t+="\\^":t+=o;n=s+1;continue}}if(e[n]==="["&&n+1<e.length&&e[n+1]===":"){let s=e.indexOf(":]",n+2);if(s!==-1){let i=e.slice(n+2,s);t+=XA(i),n=s+2;continue}}let r=e[n];r==="\\"?n+1<e.length?(t+=`\\${e[n+1]}`,n+=2):(t+="\\\\",n++):r==="-"&&n>0&&n<e.length-1?(t+="-",n++):r==="^"&&n===0?(t+="^",n++):(r==="]"&&n===0?t+="\\]":t+=r,n++)}return t+="]",t}function XA(e){return QA.get(e)??""}var QA,Os=v(()=>{"use strict";QA=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]])});function tr(e,t,n,r){if(n==="prefix")return K(`^${t}`,"s").replace(e,"");let s=K(`${t}$`,"s");if(r)return s.replace(e,"");for(let i=e.length;i>=0;i--){let o=e.slice(i);if(s.test(o))return e.slice(0,i)}return e}function Rs(e,t){let n=Array.from(e.state.env.keys()),r=new Set,s=e.state.associativeArrays??new Set,i=new Set;for(let a of n){let l=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);l&&i.add(l[1]);let c=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);c&&i.add(c[1])}let o=a=>{for(let l of s){let c=`${l}_`;if(a.startsWith(c)&&a!==l)return!0}return!1};for(let a of n)if(a.startsWith(t))if(a.includes("__")){let l=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);l?.[1].startsWith(t)&&r.add(l[1])}else if(/_\d+$/.test(a)){let l=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);l?.[1].startsWith(t)&&r.add(l[1])}else o(a)||r.add(a);return[...r].sort()}var jr=v(()=>{"use strict";Ve()});function YA(e,t){let n=(i,o=2)=>String(i).padStart(o,"0");if(e===""){let i=n(t.getHours()),o=n(t.getMinutes()),a=n(t.getSeconds());return`${i}:${o}:${a}`}let r="",s=0;for(;s<e.length;)if(e[s]==="%"){if(s+1>=e.length){r+="%",s++;continue}let i=e[s+1];switch(i){case"H":r+=n(t.getHours());break;case"M":r+=n(t.getMinutes());break;case"S":r+=n(t.getSeconds());break;case"d":r+=n(t.getDate());break;case"m":r+=n(t.getMonth()+1);break;case"Y":r+=t.getFullYear();break;case"y":r+=n(t.getFullYear()%100);break;case"I":{let o=t.getHours()%12;o===0&&(o=12),r+=n(o);break}case"p":r+=t.getHours()<12?"AM":"PM";break;case"P":r+=t.getHours()<12?"am":"pm";break;case"%":r+="%";break;case"a":{r+=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.getDay()];break}case"b":{r+=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()];break}default:r+=`%${i}`}s+=2}else r+=e[s],s++;return r}function bi(e,t){let n="",r=0,s=e.state.env.get("USER")||e.state.env.get("LOGNAME")||"user",i=e.state.env.get("HOSTNAME")||"localhost",o=i.split(".")[0],a=e.state.env.get("PWD")||"/",l=e.state.env.get("HOME")||"/",c=a.startsWith(l)?`~${a.slice(l.length)}`:a,u=a.split("/").pop()||a,f=new Date,p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],d=e.state.env.get("__COMMAND_NUMBER")||"1";for(;r<t.length;){let m=t[r];if(m==="\\"){if(r+1>=t.length){n+="\\",r++;continue}let g=t[r+1];if(g>="0"&&g<="7"){let y="",w=r+1;for(;w<t.length&&w<r+4&&t[w]>="0"&&t[w]<="7";)y+=t[w],w++;let b=Number.parseInt(y,8)%256;n+=String.fromCharCode(b),r=w;continue}switch(g){case"\\":n+="\\",r+=2;break;case"a":n+="\x07",r+=2;break;case"e":n+="\x1B",r+=2;break;case"n":n+=`
|
|
779
|
+
`,r+=2;break;case"r":n+="\r",r+=2;break;case"$":n+="$",r+=2;break;case"[":case"]":r+=2;break;case"u":n+=s,r+=2;break;case"h":n+=o,r+=2;break;case"H":n+=i,r+=2;break;case"w":n+=c,r+=2;break;case"W":n+=u,r+=2;break;case"d":{let y=String(f.getDate()).padStart(2," ");n+=`${p[f.getDay()]} ${h[f.getMonth()]} ${y}`,r+=2;break}case"t":{let y=String(f.getHours()).padStart(2,"0"),w=String(f.getMinutes()).padStart(2,"0"),b=String(f.getSeconds()).padStart(2,"0");n+=`${y}:${w}:${b}`,r+=2;break}case"T":{let y=f.getHours()%12;y===0&&(y=12);let w=String(y).padStart(2,"0"),b=String(f.getMinutes()).padStart(2,"0"),x=String(f.getSeconds()).padStart(2,"0");n+=`${w}:${b}:${x}`,r+=2;break}case"@":{let y=f.getHours()%12;y===0&&(y=12);let w=String(y).padStart(2,"0"),b=String(f.getMinutes()).padStart(2,"0"),x=f.getHours()<12?"AM":"PM";n+=`${w}:${b} ${x}`,r+=2;break}case"A":{let y=String(f.getHours()).padStart(2,"0"),w=String(f.getMinutes()).padStart(2,"0");n+=`${y}:${w}`,r+=2;break}case"D":if(r+2<t.length&&t[r+2]==="{"){let y=t.indexOf("}",r+3);if(y!==-1){let w=t.slice(r+3,y);n+=YA(w,f),r=y+1}else n+="\\D",r+=2}else n+="\\D",r+=2;break;case"s":n+="bash",r+=2;break;case"v":n+="5.0",r+=2;break;case"V":n+="5.0.0",r+=2;break;case"j":n+="0",r+=2;break;case"l":n+="tty",r+=2;break;case"#":n+=d,r+=2;break;case"!":n+=d,r+=2;break;case"x":n+="\\x",r+=2;break;default:n+=`\\${g}`,r+=2}}else n+=m,r++}return n}var du=v(()=>{"use strict"});function mr(e){if(e==="")return"''";if(/[\n\r\t\x00-\x1f\x7f']/.test(e)){let n="$'";for(let r of e)switch(r){case"'":n+="\\'";break;case"\\":n+="\\\\";break;case`
|
|
780
|
+
`:n+="\\n";break;case"\r":n+="\\r";break;case" ":n+="\\t";break;default:{let s=r.charCodeAt(0);s<32||s===127?n+=`\\${s.toString(8).padStart(3,"0")}`:n+=r}}return`${n}'`}return`'${e}'`}var mu=v(()=>{"use strict"});function Qt(e,t){e.state.readonlyVars=e.state.readonlyVars||new Set,e.state.readonlyVars.add(t)}function Hn(e,t){return e.state.readonlyVars?.has(t)??!1}function gt(e,t,n="bash"){if(Hn(e,t)){let r=`${n}: ${t}: readonly variable
|
|
781
|
+
`;throw new ge(1,"",r)}return null}function kn(e,t){let n=e.state.exportedVars?.has(t)??!1;if(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(t),e.state.localScopes.length>0&&e.state.localScopes[e.state.localScopes.length-1].has(t)&&!n){for(e.state.localExportedVars||(e.state.localExportedVars=[]);e.state.localExportedVars.length<e.state.localScopes.length;)e.state.localExportedVars.push(new Set);e.state.localExportedVars[e.state.localExportedVars.length-1].add(t)}}function ta(e,t){e.state.exportedVars?.delete(t)}var gr=v(()=>{"use strict";xe()});function yr(e,t){if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t))return"";let n="",r=e.state.env.has(`${t}__length`)||Array.from(e.state.env.keys()).some(i=>i.startsWith(`${t}_`)&&/^[0-9]+$/.test(i.slice(t.length+1))),s=e.state.associativeArrays?.has(t)??!1;return r&&!s&&(n+="a"),s&&(n+="A"),e.state.integerVars?.has(t)&&(n+="i"),Me(e,t)&&(n+="n"),Hn(e,t)&&(n+="r"),e.state.exportedVars?.has(t)&&(n+="x"),n}var na=v(()=>{"use strict";vn();gr()});async function _g(e,t,n,r){return e.coverage?.hit("bash:expansion:default_value"),(n.isUnset||t.checkEmpty&&n.isEmpty)&&t.word?r(e,t.word.parts,n.inDoubleQuotes):n.effectiveValue}async function Fg(e,t,n,r,s){if(e.coverage?.hit("bash:expansion:assign_default"),(r.isUnset||n.checkEmpty&&r.isEmpty)&&n.word){let o=await s(e,n.word.parts,r.inDoubleQuotes),a=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(a){let[,l,c]=a,u;if(/^\d+$/.test(c))u=Number.parseInt(c,10);else{try{let p=new ce,h=Ce(p,c);u=await te(e,h.expression)}catch{let p=e.state.env.get(c);u=p?Number.parseInt(p,10):0}Number.isNaN(u)&&(u=0)}e.state.env.set(`${l}_${u}`,o);let f=Number.parseInt(e.state.env.get(`${l}__length`)||"0",10);u>=f&&e.state.env.set(`${l}__length`,String(u+1))}else e.state.env.set(t,o);return o}return r.effectiveValue}async function Lg(e,t,n,r,s){if(e.coverage?.hit("bash:expansion:error_if_unset"),r.isUnset||n.checkEmpty&&r.isEmpty){let o=n.word?await s(e,n.word.parts,r.inDoubleQuotes):`${t}: parameter null or not set`;throw new ge(1,"",`bash: ${o}
|
|
782
|
+
`)}return r.effectiveValue}async function Mg(e,t,n,r){return e.coverage?.hit("bash:expansion:use_alternative"),!(n.isUnset||t.checkEmpty&&n.isEmpty)&&t.word?r(e,t.word.parts,n.inDoubleQuotes):""}async function Ug(e,t,n,r,s){e.coverage?.hit("bash:expansion:pattern_removal");let i="",o=e.state.shoptOptions.extglob;if(n.pattern)for(let l of n.pattern.parts)if(l.type==="Glob")i+=we(l.pattern,n.greedy,o);else if(l.type==="Literal")i+=we(l.value,n.greedy,o);else if(l.type==="SingleQuoted"||l.type==="Escaped")i+=Ae(l.value);else if(l.type==="DoubleQuoted"){let c=await r(e,l.parts);i+=Ae(c)}else if(l.type==="ParameterExpansion"){let c=await s(e,l);i+=we(c,n.greedy,o)}else{let c=await s(e,l);i+=Ae(c)}if(n.side==="prefix")return K(`^${i}`,"s").replace(t,"");let a=K(`${i}$`,"s");if(n.greedy)return a.replace(t,"");for(let l=t.length;l>=0;l--){let c=t.slice(l);if(a.test(c))return t.slice(0,l)}return t}async function Bg(e,t,n,r,s){e.coverage?.hit("bash:expansion:pattern_replacement");let i="",o=e.state.shoptOptions.extglob;if(n.pattern)for(let c of n.pattern.parts)if(c.type==="Glob")i+=we(c.pattern,!0,o);else if(c.type==="Literal")i+=we(c.value,!0,o);else if(c.type==="SingleQuoted"||c.type==="Escaped")i+=Ae(c.value);else if(c.type==="DoubleQuoted"){let u=await r(e,c.parts);i+=Ae(u)}else if(c.type==="ParameterExpansion"){let u=await s(e,c);i+=we(u,!0,o)}else{let u=await s(e,c);i+=Ae(u)}let a=n.replacement?await r(e,n.replacement.parts):"";if(n.anchor==="start"?i=`^${i}`:n.anchor==="end"&&(i=`${i}$`),i==="")return t;let l=n.all?"gs":"s";try{let c=K(i,l);if(n.all){let u="",f=0,p=0,h=e.limits.maxStringLength,d=c.exec(t);for(;d!==null&&!(d[0].length===0&&d.index===t.length);){if(u+=t.slice(f,d.index)+a,f=d.index+d[0].length,d[0].length===0&&f++,p++,p%100===0&&u.length>h)throw new Q(`pattern replacement: string length limit exceeded (${h} bytes)`,"string_length");d=c.exec(t)}return u+=t.slice(f),u}return c.replace(t,a)}catch(c){if(c instanceof Q)throw c;return t}}function Wg(e,t,n){e.coverage?.hit("bash:expansion:length");let r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(r){let s=r[1],i=oe(e,s);return i.length>0?String(i.length):e.state.env.get(s)!==void 0?"1":"0"}if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t)&&er(e,t)){if(t==="FUNCNAME"){let i=e.state.funcNameStack?.[0]||"";return String([...i].length)}if(t==="BASH_LINENO"){let i=e.state.callLineStack?.[0];return String(i!==void 0?[...String(i)].length:0)}let s=e.state.env.get(`${t}_0`)||"";return String([...s].length)}return String([...n].length)}async function zg(e,t,n,r){e.coverage?.hit("bash:expansion:substring");let s=await te(e,r.offset.expression),i=r.length?await te(e,r.length.expression):void 0;if(t==="@"||t==="*"){let c=Number.parseInt(e.state.env.get("#")||"0",10),u=[];for(let d=1;d<=c;d++)u.push(e.state.env.get(String(d))||"");let f=e.state.env.get("0")||"bash",p,h;if(s<=0)if(p=[f,...u],s<0){if(h=p.length+s,h<0)return""}else h=0;else p=u,h=s-1;if(h<0||h>=p.length)return"";if(i!==void 0){let d=i<0?p.length+i:h+i;return p.slice(h,Math.max(h,d)).join(" ")}return p.slice(h).join(" ")}let o=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(o){let c=o[1];if(e.state.associativeArrays?.has(c))throw new ge(1,"",`bash: \${${c}[@]: 0: 3}: bad substitution
|
|
783
|
+
`);let u=oe(e,c),f=0;if(s<0){if(u.length>0){let p=u[u.length-1][0],d=(typeof p=="number"?p:0)+1+s;if(d<0||(f=u.findIndex(([m])=>typeof m=="number"&&m>=d),f<0))return""}}else if(f=u.findIndex(([p])=>typeof p=="number"&&p>=s),f<0)return"";if(i!==void 0){if(i<0)throw new De(`${o[1]}[@]: substring expression < 0`);return u.slice(f,f+i).map(([,p])=>p).join(" ")}return u.slice(f).map(([,p])=>p).join(" ")}let a=[...n],l=s;if(l<0&&(l=Math.max(0,a.length+l)),i!==void 0){if(i<0){let c=a.length+i;return a.slice(l,Math.max(l,c)).join("")}return a.slice(l,l+i).join("")}return a.slice(l).join("")}async function Hg(e,t,n,r,s){if(e.coverage?.hit("bash:expansion:case_modification"),n.pattern){let i=e.state.shoptOptions.extglob,o="";for(let f of n.pattern.parts)if(f.type==="Glob")o+=we(f.pattern,!0,i);else if(f.type==="Literal")o+=we(f.value,!0,i);else if(f.type==="SingleQuoted"||f.type==="Escaped")o+=Ae(f.value);else if(f.type==="DoubleQuoted"){let p=await r(e,f.parts);o+=Ae(p)}else if(f.type==="ParameterExpansion"){let p=await s(e,f);o+=we(p,!0,i)}let a=K(`^(?:${o})$`),l=n.direction==="upper"?f=>f.toUpperCase():f=>f.toLowerCase(),c="",u=!1;for(let f of t)!n.all&&u?c+=f:a.test(f)?(c+=l(f),u=!0):c+=f;return c}return n.direction==="upper"?n.all?t.toUpperCase():t.charAt(0).toUpperCase()+t.slice(1):n.all?t.toLowerCase():t.charAt(0).toLowerCase()+t.slice(1)}function jg(e,t,n,r,s){e.coverage?.hit("bash:expansion:transform");let i=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(i&&s.operator==="Q")return oe(e,i[1]).map(([,c])=>mr(c)).join(" ");if(i&&s.operator==="a")return yr(e,i[1]);let o=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[.+\]$/);if(o&&s.operator==="a")return yr(e,o[1]);switch(s.operator){case"Q":return r?"":mr(n);case"P":return bi(e,n);case"a":return yr(e,t);case"A":return r?"":`${t}=${mr(n)}`;case"E":return n.replace(/\\([\\abefnrtv'"?])/g,(a,l)=>{switch(l){case"\\":return"\\";case"a":return"\x07";case"b":return"\b";case"e":return"\x1B";case"f":return"\f";case"n":return`
|
|
784
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"'":return"'";case'"':return'"';case"?":return"?";default:return l}});case"K":case"k":return r?"":mr(n);case"u":return n.charAt(0).toUpperCase()+n.slice(1);case"U":return n.toUpperCase();case"L":return n.toLowerCase();default:return n}}async function Gg(e,t,n,r,s,i,o=!1){if(e.coverage?.hit("bash:expansion:indirection"),Me(e,t))return Hr(e,t)||"";let a=/^[a-zA-Z_][a-zA-Z0-9_]*\[([@*])\]$/.test(t);if(r){if(s.innerOp?.type==="UseAlternative")return"";throw new Ot(`\${!${t}}`)}let l=n;if(a&&(l===""||l.includes(" ")))throw new Ot(`\${!${t}}`);let c=l.match(/^[a-zA-Z_][a-zA-Z0-9_]*\[(.+)\]$/);if(c&&c[1].includes("~"))throw new Ot(`\${!${t}}`);if(s.innerOp){let u={type:"ParameterExpansion",parameter:l,operation:s.innerOp};return i(e,u,o)}return await ve(e,l)}function Vg(e,t){e.coverage?.hit("bash:expansion:array_keys");let r=oe(e,t.array).map(([s])=>String(s));return t.star?r.join(de(e.state.env)):r.join(" ")}function qg(e,t){e.coverage?.hit("bash:expansion:var_name_prefix");let n=Rs(e,t.prefix);return t.star?n.join(de(e.state.env)):n.join(" ")}function Zg(e,t,n,r){let s=Number.parseInt(e.state.env.get("#")||"0",10),i=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(t==="*")return{isEmpty:s===0,effectiveValue:n};if(t==="@")return{isEmpty:s===0||s===1&&e.state.env.get("1")==="",effectiveValue:n};if(i){let[,o,a]=i,l=oe(e,o);if(l.length===0)return{isEmpty:!0,effectiveValue:""};if(a==="*"){let c=de(e.state.env),u=l.map(([,f])=>f).join(c);return{isEmpty:r?u==="":!1,effectiveValue:u}}return{isEmpty:l.length===1&&l.every(([,c])=>c===""),effectiveValue:l.map(([,c])=>c).join(" ")}}return{isEmpty:n==="",effectiveValue:n}}var Kg=v(()=>{"use strict";Nt();ot();Ve();Ft();xe();rn();vn();$s();Os();jr();du();mu();Zt();na()});function Qg(e){let t=0;for(;t<e.length;){let n=e[t];if(n==="\\"&&t+1<e.length){t+=2;continue}if(n==="'"){let r=e.indexOf("'",t+1);if(r!==-1){t=r+1;continue}}if(n==="$"&&t+1<e.length&&e[t+1]==="("||n==="`")return!0;t++}return!1}function Xg(e,t){let n=1,r=t,s=!1,i=!1;for(;r<e.length&&n>0;){let o=e[r];if(o==="\\"&&!s&&r+1<e.length){r+=2;continue}if(o==="'"&&!i){s=!s,r++;continue}if(o==='"'&&!s){i=!i,r++;continue}if(!s&&!i){if(o==="(")n++;else if(o===")"&&(n--,n===0))return r}r++}return-1}async function ra(e,t){let n=new ce,r;try{r=n.parse(t)}catch{return""}let s=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;let i=new Map(e.state.env),o=e.state.cwd,a=e.state.suppressVerbose;e.state.suppressVerbose=!0;try{let l=await e.executeScript(r),c=l.exitCode;return e.state.env=i,e.state.cwd=o,e.state.suppressVerbose=a,e.state.lastExitCode=c,e.state.env.set("?",String(c)),l.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+l.stderr),e.state.bashPid=s,l.stdout.replace(/\n+$/,"")}catch(l){if(e.state.env=i,e.state.cwd=o,e.state.bashPid=s,e.state.suppressVerbose=a,l instanceof Q)throw l;return l instanceof ge?(e.state.lastExitCode=l.exitCode,e.state.env.set("?",String(l.exitCode)),l.stdout?.replace(/\n+$/,"")??""):""}}function gu(e,t){let n="",r=0;for(;r<t.length;){let s=t[r];if(s==="'"){let i=t.indexOf("'",r+1);if(i!==-1){let o=t.slice(r+1,i);n+=Kt(o),r=i+1;continue}}if(s==='"'){let i=-1,o=r+1;for(;o<t.length;){if(t[o]==="\\"){o+=2;continue}if(t[o]==='"'){i=o;break}o++}if(i!==-1){let a=t.slice(r+1,i),l=JA(e,a);n+=Kt(l),r=i+1;continue}}if(s==="$"&&r+1<t.length){let i=t[r+1];if(i==="{"){let o=t.indexOf("}",r+2);if(o!==-1){let a=t.slice(r+2,o);n+=e.state.env.get(a)??"",r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<t.length&&/[a-zA-Z0-9_]/.test(t[o]);)o++;let a=t.slice(r+1,o);n+=e.state.env.get(a)??"",r=o;continue}}if(s==="\\"&&r+1<t.length){n+=s+t[r+1],r+=2;continue}n+=s,r++}return n}function JA(e,t){let n="",r=0;for(;r<t.length;){let s=t[r];if(s==="\\"&&r+1<t.length){let i=t[r+1];if(i==="$"||i==="`"||i==="\\"||i==='"'){n+=i,r+=2;continue}n+=s,r++;continue}if(s==="$"&&r+1<t.length){let i=t[r+1];if(i==="{"){let o=t.indexOf("}",r+2);if(o!==-1){let a=t.slice(r+2,o);n+=e.state.env.get(a)??"",r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<t.length&&/[a-zA-Z0-9_]/.test(t[o]);)o++;let a=t.slice(r+1,o);n+=e.state.env.get(a)??"",r=o;continue}}n+=s,r++}return n}async function Yg(e,t){let n="",r=0;for(;r<t.length;){let s=t[r];if(s==="'"){let i=t.indexOf("'",r+1);if(i!==-1){let o=t.slice(r+1,i);n+=Kt(o),r=i+1;continue}}if(s==='"'){let i=-1,o=r+1;for(;o<t.length;){if(t[o]==="\\"){o+=2;continue}if(t[o]==='"'){i=o;break}o++}if(i!==-1){let a=t.slice(r+1,i),l=await eS(e,a);n+=Kt(l),r=i+1;continue}}if(s==="$"&&r+1<t.length&&t[r+1]==="("){let i=Xg(t,r+2);if(i!==-1){let o=t.slice(r+2,i),a=await ra(e,o);n+=a,r=i+1;continue}}if(s==="`"){let i=t.indexOf("`",r+1);if(i!==-1){let o=t.slice(r+1,i),a=await ra(e,o);n+=a,r=i+1;continue}}if(s==="$"&&r+1<t.length){let i=t[r+1];if(i==="{"){let o=t.indexOf("}",r+2);if(o!==-1){let a=t.slice(r+2,o);n+=e.state.env.get(a)??"",r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<t.length&&/[a-zA-Z0-9_]/.test(t[o]);)o++;let a=t.slice(r+1,o);n+=e.state.env.get(a)??"",r=o;continue}}if(s==="\\"&&r+1<t.length){n+=s+t[r+1],r+=2;continue}n+=s,r++}return n}async function eS(e,t){let n="",r=0;for(;r<t.length;){let s=t[r];if(s==="\\"&&r+1<t.length){let i=t[r+1];if(i==="$"||i==="`"||i==="\\"||i==='"'){n+=i,r+=2;continue}n+=s,r++;continue}if(s==="$"&&r+1<t.length&&t[r+1]==="("){let i=Xg(t,r+2);if(i!==-1){let o=t.slice(r+2,i),a=await ra(e,o);n+=a,r=i+1;continue}}if(s==="`"){let i=t.indexOf("`",r+1);if(i!==-1){let o=t.slice(r+1,i),a=await ra(e,o);n+=a,r=i+1;continue}}if(s==="$"&&r+1<t.length){let i=t[r+1];if(i==="{"){let o=t.indexOf("}",r+2);if(o!==-1){let a=t.slice(r+2,o);n+=e.state.env.get(a)??"",r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<t.length&&/[a-zA-Z0-9_]/.test(t[o]);)o++;let a=t.slice(r+1,o);n+=e.state.env.get(a)??"",r=o;continue}}n+=s,r++}return n}var Jg=v(()=>{"use strict";ot();xe();Is()});function e6(e,t){if(!t.startsWith("~"))return t;e.coverage?.hit("bash:expansion:tilde");let n=e.state.env.get("HOME")!==void 0?e.state.env.get("HOME"):"/home/user";if(t==="~"||t.startsWith("~/"))return n+t.slice(1);let r=1;for(;r<t.length&&/[a-zA-Z0-9_-]/.test(t[r]);)r++;let s=t.slice(1,r),i=t.slice(r);return i!==""&&!i.startsWith("/")?t:s==="root"?`/root${i}`:t}var t6=v(()=>{"use strict"});async function tS(e,t,n,r){let s="";for(let i of t.parts)if(i.type==="Glob")s+=we(i.pattern,!0,e.state.shoptOptions.extglob);else if(i.type==="Literal")s+=we(i.value,!0,e.state.shoptOptions.extglob);else if(i.type==="SingleQuoted"||i.type==="Escaped")s+=Ae(i.value);else if(i.type==="DoubleQuoted"){let o=await n(e,i.parts);s+=Ae(o)}else if(i.type==="ParameterExpansion"){let o=await r(e,i);s+=we(o,!0,e.state.shoptOptions.extglob)}else{let o=await r(e,i);s+=Ae(o)}return s}async function n6(e,t,n,r){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion"||s.parts[0].operation?.type!=="PatternReplacement")return null;let i=s.parts[0],o=i.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!o)return null;let a=o[1],l=o[2]==="*",c=i.operation,u=oe(e,a),f=u.map(([,g])=>g);if(u.length===0){let g=e.state.env.get(a);g!==void 0&&f.push(g)}if(f.length===0)return{values:[],quoted:!0};let p="";c.pattern&&(p=await tS(e,c.pattern,n,r));let h=c.replacement?await n(e,c.replacement.parts):"",d=p;c.anchor==="start"?d=`^${p}`:c.anchor==="end"&&(d=`${p}$`);let m=[];try{let g=K(d,c.all?"g":"");for(let y of f)m.push(g.replace(y,h))}catch{m.push(...f)}if(l){let g=de(e.state.env);return{values:[m.join(g)],quoted:!0}}return{values:m,quoted:!0}}async function r6(e,t,n,r){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion"||s.parts[0].operation?.type!=="PatternRemoval")return null;let i=s.parts[0],o=i.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!o)return null;let a=o[1],l=o[2]==="*",c=i.operation,u=oe(e,a),f=u.map(([,m])=>m);if(u.length===0){let m=e.state.env.get(a);m!==void 0&&f.push(m)}if(f.length===0)return{values:[],quoted:!0};let p="",h=e.state.shoptOptions.extglob;if(c.pattern)for(let m of c.pattern.parts)if(m.type==="Glob")p+=we(m.pattern,c.greedy,h);else if(m.type==="Literal")p+=we(m.value,c.greedy,h);else if(m.type==="SingleQuoted"||m.type==="Escaped")p+=Ae(m.value);else if(m.type==="DoubleQuoted"){let g=await n(e,m.parts);p+=Ae(g)}else if(m.type==="ParameterExpansion"){let g=await r(e,m);p+=we(g,c.greedy,h)}else{let g=await r(e,m);p+=Ae(g)}let d=[];for(let m of f)d.push(tr(m,p,c.side,c.greedy));if(l){let m=de(e.state.env);return{values:[d.join(m)],quoted:!0}}return{values:d,quoted:!0}}var s6=v(()=>{"use strict";Ve();rn();$s();Os();jr();Zt()});async function i6(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let n=t[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||n.parts[0].operation?.type!=="DefaultValue"&&n.parts[0].operation?.type!=="UseAlternative"&&n.parts[0].operation?.type!=="AssignDefault")return null;let r=n.parts[0],s=r.operation,i=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/),o,a=!1;if(i){let l=i[1];a=i[2]==="*";let c=oe(e,l),u=c.length>0||e.state.env.has(l),f=c.length===0||c.length===1&&c.every(([,h])=>h===""),p=s.checkEmpty??!1;if(s.type==="UseAlternative"?o=u&&!(p&&f):o=!u||p&&f,!o){if(c.length>0){let d=c.map(([,m])=>m);if(a){let m=de(e.state.env);return{values:[d.join(m)],quoted:!0}}return{values:d,quoted:!0}}let h=e.state.env.get(l);return h!==void 0?{values:[h],quoted:!0}:{values:[],quoted:!0}}}else{let l=r.parameter,c=await Wn(e,l),u=await ve(e,l),f=u==="",p=s.checkEmpty??!1;if(s.type==="UseAlternative"?o=c&&!(p&&f):o=!c||p&&f,!o)return{values:[u],quoted:!0}}if(o&&s.word){let l=s.word.parts,c=null,u=!1;for(let f of l)if(f.type==="ParameterExpansion"&&!f.operation){let p=f.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(p){c=p[1],u=p[2]==="*";break}}if(c){let f=oe(e,c);if(f.length>0){let h=f.map(([,d])=>d);if(u||a){let d=de(e.state.env);return{values:[h.join(d)],quoted:!0}}return{values:h,quoted:!0}}let p=e.state.env.get(c);return p!==void 0?{values:[p],quoted:!0}:{values:[],quoted:!0}}}return null}async function o6(e,t,n,r,s){if(!n||t.length!==1||t[0].type!=="DoubleQuoted")return null;let i=t[0],o=-1,a="",l=!1,c=null;for(let m=0;m<i.parts.length;m++){let g=i.parts[m];if(g.type==="ParameterExpansion"&&(g.operation?.type==="PatternRemoval"||g.operation?.type==="PatternReplacement")){let y=g.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(y){o=m,a=y[1],l=y[2]==="*",c=g.operation;break}}}if(o===-1||o===0&&o===i.parts.length-1)return null;let u="";for(let m=0;m<o;m++)u+=await r(e,i.parts[m]);let f="";for(let m=o+1;m<i.parts.length;m++)f+=await r(e,i.parts[m]);let p=oe(e,a),h=p.map(([,m])=>m);if(p.length===0){let m=e.state.env.get(a);if(m!==void 0)h=[m];else{if(l)return{values:[u+f],quoted:!0};let g=u+f;return{values:g?[g]:[],quoted:!0}}}if(c?.type==="PatternRemoval"){let m=c,g="",y=e.state.shoptOptions.extglob;if(m.pattern)for(let w of m.pattern.parts)if(w.type==="Glob")g+=we(w.pattern,m.greedy,y);else if(w.type==="Literal")g+=we(w.value,m.greedy,y);else if(w.type==="SingleQuoted"||w.type==="Escaped")g+=Ae(w.value);else if(w.type==="DoubleQuoted"){let b=await s(e,w.parts);g+=Ae(b)}else if(w.type==="ParameterExpansion"){let b=await r(e,w);g+=we(b,m.greedy,y)}else{let b=await r(e,w);g+=Ae(b)}h=h.map(w=>tr(w,g,m.side,m.greedy))}else if(c?.type==="PatternReplacement"){let m=c,g="";if(m.pattern)for(let b of m.pattern.parts)if(b.type==="Glob")g+=we(b.pattern,!0,e.state.shoptOptions.extglob);else if(b.type==="Literal")g+=we(b.value,!0,e.state.shoptOptions.extglob);else if(b.type==="SingleQuoted"||b.type==="Escaped")g+=Ae(b.value);else if(b.type==="DoubleQuoted"){let x=await s(e,b.parts);g+=Ae(x)}else if(b.type==="ParameterExpansion"){let x=await r(e,b);g+=we(x,!0,e.state.shoptOptions.extglob)}else{let x=await r(e,b);g+=Ae(x)}let y=m.replacement?await s(e,m.replacement.parts):"",w=g;m.anchor==="start"?w=`^${g}`:m.anchor==="end"&&(w=`${g}$`);try{let b=K(w,m.all?"g":"");h=h.map(x=>b.replace(x,y))}catch{}}if(l){let m=de(e.state.env);return{values:[u+h.join(m)+f],quoted:!0}}return h.length===1?{values:[u+h[0]+f],quoted:!0}:{values:[u+h[0],...h.slice(1,-1),h[h.length-1]+f],quoted:!0}}async function a6(e,t,n,r){if(!n||t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0],i=-1,o="",a=!1;for(let h=0;h<s.parts.length;h++){let d=s.parts[h];if(d.type==="ParameterExpansion"&&!d.operation){let m=d.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(m){i=h,o=m[1],a=m[2]==="*";break}}}if(i===-1)return null;let l="";for(let h=0;h<i;h++)l+=await r(e,s.parts[h]);let c="";for(let h=i+1;h<s.parts.length;h++)c+=await r(e,s.parts[h]);let u=oe(e,o),f=u.map(([,h])=>h);if(u.length===0){let h=e.state.env.get(o);if(h!==void 0)return{values:[l+h+c],quoted:!0};if(a)return{values:[l+c],quoted:!0};let d=l+c;return{values:d?[d]:[],quoted:!0}}if(a){let h=de(e.state.env);return{values:[l+f.join(h)+c],quoted:!0}}return f.length===1?{values:[l+f[0]+c],quoted:!0}:{values:[l+f[0],...f.slice(1,-1),f[f.length-1]+c],quoted:!0}}var l6=v(()=>{"use strict";Ve();rn();$s();Os();jr();Zt()});async function c6(e,t,n){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let r=t[0];if(r.parts.length!==1||r.parts[0].type!=="ParameterExpansion"||r.parts[0].operation?.type!=="Substring")return null;let s=r.parts[0],i=s.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!i)return null;let o=i[1],a=i[2]==="*",l=s.operation;if(e.state.associativeArrays?.has(o))throw new ge(1,"",`bash: \${${o}[@]: 0: 3}: bad substitution
|
|
785
|
+
`);let c=l.offset?await n(e,l.offset.expression):0,u=l.length?await n(e,l.length.expression):void 0,f=oe(e,o),p=0;if(c<0){if(f.length>0){let d=f[f.length-1][0],g=(typeof d=="number"?d:0)+1+c;if(g<0)return{values:[],quoted:!0};p=f.findIndex(([y])=>typeof y=="number"&&y>=g),p<0&&(p=f.length)}}else p=f.findIndex(([d])=>typeof d=="number"&&d>=c),p<0&&(p=f.length);let h;if(u!==void 0){if(u<0)throw new De(`${o}[@]: substring expression < 0`);h=f.slice(p,p+u).map(([,d])=>d)}else h=f.slice(p).map(([,d])=>d);if(h.length===0)return{values:[],quoted:!0};if(a){let d=de(e.state.env);return{values:[h.join(d)],quoted:!0}}return{values:h,quoted:!0}}function u6(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let n=t[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||n.parts[0].operation?.type!=="Transform")return null;let r=n.parts[0],s=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!s)return null;let i=s[1],o=s[2]==="*",a=r.operation,l=oe(e,i);if(l.length===0){let f=e.state.env.get(i);if(f!==void 0){let p;switch(a.operator){case"a":p="";break;case"P":p=bi(e,f);break;case"Q":p=mr(f);break;default:p=f}return{values:[p],quoted:!0}}return o?{values:[""],quoted:!0}:{values:[],quoted:!0}}let c=yr(e,i),u;switch(a.operator){case"a":u=l.map(()=>c);break;case"P":u=l.map(([,f])=>bi(e,f));break;case"Q":u=l.map(([,f])=>mr(f));break;case"u":u=l.map(([,f])=>f.charAt(0).toUpperCase()+f.slice(1));break;case"U":u=l.map(([,f])=>f.toUpperCase());break;case"L":u=l.map(([,f])=>f.toLowerCase());break;default:u=l.map(([,f])=>f)}if(o){let f=de(e.state.env);return{values:[u.join(f)],quoted:!0}}return{values:u,quoted:!0}}var f6=v(()=>{"use strict";xe();rn();du();mu();Zt();na()});function p6(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let n=t[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion")return null;let r=n.parts[0];if(r.operation)return null;let s=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!s)return null;let i=s[1];if(Me(e,i)){let l=Hr(e,i);if(l?.endsWith("[@]")||l?.endsWith("[*]"))return{values:[],quoted:!0}}let o=oe(e,i);if(o.length>0)return{values:o.map(([,l])=>l),quoted:!0};let a=e.state.env.get(i);return a!==void 0?{values:[a],quoted:!0}:{values:[],quoted:!0}}function h6(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let n=t[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||n.parts[0].operation)return null;let s=n.parts[0].parameter;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)||!Me(e,s))return null;let i=Hr(e,s);if(!i)return null;let o=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!o)return null;let a=o[1],l=oe(e,a);if(l.length>0)return{values:l.map(([,u])=>u),quoted:!0};let c=e.state.env.get(a);return c!==void 0?{values:[c],quoted:!0}:{values:[],quoted:!0}}var d6=v(()=>{"use strict";vn();Zt()});async function m6(e,t,n,r,s){if(!n||t.length!==1||t[0].type!=="DoubleQuoted")return null;let i=t[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||i.parts[0].operation?.type!=="Indirection")return null;let o=i.parts[0],a=o.operation,l=await ve(e,o.parameter),c=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!c){if(!a.innerOp&&(l==="@"||l==="*")){let d=Number.parseInt(e.state.env.get("#")||"0",10),m=[];for(let g=1;g<=d;g++)m.push(e.state.env.get(String(g))||"");return l==="*"?{values:[m.join(de(e.state.env))],quoted:!0}:{values:m,quoted:!0}}return null}let u=c[1],f=c[2]==="*",p=oe(e,u);if(a.innerOp){if(a.innerOp.type==="Substring")return nS(e,p,u,f,a.innerOp);if(a.innerOp.type==="DefaultValue"||a.innerOp.type==="UseAlternative"||a.innerOp.type==="AssignDefault"||a.innerOp.type==="ErrorIfUnset")return rS(e,p,u,f,a.innerOp,s);if(a.innerOp.type==="Transform"&&a.innerOp.operator==="a"){let m=yr(e,u),g=p.map(()=>m);return f?{values:[g.join(de(e.state.env))],quoted:!0}:{values:g,quoted:!0}}let d=[];for(let[,m]of p){let g={type:"ParameterExpansion",parameter:"_indirect_elem_",operation:a.innerOp},y=e.state.env.get("_indirect_elem_");e.state.env.set("_indirect_elem_",m);try{let w=await r(e,g,!0);d.push(w)}finally{y!==void 0?e.state.env.set("_indirect_elem_",y):e.state.env.delete("_indirect_elem_")}}return f?{values:[d.join(de(e.state.env))],quoted:!0}:{values:d,quoted:!0}}if(p.length>0){let d=p.map(([,m])=>m);return f?{values:[d.join(de(e.state.env))],quoted:!0}:{values:d,quoted:!0}}let h=e.state.env.get(u);return h!==void 0?{values:[h],quoted:!0}:{values:[],quoted:!0}}async function nS(e,t,n,r,s){let i=s.offset?await te(e,s.offset.expression):0,o=s.length?await te(e,s.length.expression):void 0,a=0;if(i<0){if(t.length>0){let u=t[t.length-1][0],p=(typeof u=="number"?u:0)+1+i;if(p<0)return{values:[],quoted:!0};if(a=t.findIndex(([h])=>typeof h=="number"&&h>=p),a<0)return{values:[],quoted:!0}}}else if(a=t.findIndex(([u])=>typeof u=="number"&&u>=i),a<0)return{values:[],quoted:!0};let l;if(o!==void 0){if(o<0)throw new De(`${n}[@]: substring expression < 0`);l=t.slice(a,a+o)}else l=t.slice(a);let c=l.map(([,u])=>u);return r?{values:[c.join(de(e.state.env))],quoted:!0}:{values:c,quoted:!0}}async function rS(e,t,n,r,s,i){let o=s.checkEmpty??!1,a=t.map(([,u])=>u),l=t.length===0,c=t.length===0;if(s.type==="UseAlternative")return!c&&!(o&&l)&&s.word?{values:[await i(e,s.word.parts,!0)],quoted:!0}:{values:[],quoted:!0};if(s.type==="DefaultValue")return(c||o&&l)&&s.word?{values:[await i(e,s.word.parts,!0)],quoted:!0}:r?{values:[a.join(de(e.state.env))],quoted:!0}:{values:a,quoted:!0};if(s.type==="AssignDefault"){if((c||o&&l)&&s.word){let f=await i(e,s.word.parts,!0);return e.state.env.set(`${n}_0`,f),e.state.env.set(`${n}__length`,"1"),{values:[f],quoted:!0}}return r?{values:[a.join(de(e.state.env))],quoted:!0}:{values:a,quoted:!0}}return r?{values:[a.join(de(e.state.env))],quoted:!0}:{values:a,quoted:!0}}async function g6(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="UseAlternative"&&t[0].operation?.type!=="DefaultValue")return null;let n=t[0],r=n.operation,s=r?.word;if(!s||s.parts.length!==1||s.parts[0].type!=="DoubleQuoted")return null;let i=s.parts[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||i.parts[0].operation?.type!=="Indirection")return null;let o=i.parts[0],l=(await ve(e,o.parameter)).match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!l)return null;let c=await Wn(e,n.parameter),u=await ve(e,n.parameter)==="",f=r.checkEmpty??!1,p;if(r.type==="UseAlternative"?p=c&&!(f&&u):p=!c||f&&u,p){let h=l[1],d=l[2]==="*",m=oe(e,h);if(m.length>0){let y=m.map(([,w])=>w);return d?{values:[y.join(de(e.state.env))],quoted:!0}:{values:y,quoted:!0}}let g=e.state.env.get(h);return g!==void 0?{values:[g],quoted:!0}:{values:[],quoted:!0}}return{values:[],quoted:!1}}async function y6(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="Indirection")return null;let n=t[0],s=n.operation.innerOp;if(!s||s.type!=="UseAlternative"&&s.type!=="DefaultValue")return null;let i=s.word;if(!i||i.parts.length!==1||i.parts[0].type!=="DoubleQuoted")return null;let o=i.parts[0];if(o.parts.length!==1||o.parts[0].type!=="ParameterExpansion"||o.parts[0].operation?.type!=="Indirection")return null;let a=o.parts[0],c=(await ve(e,a.parameter)).match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!c)return null;let u=await ve(e,n.parameter),f=await Wn(e,n.parameter),p=u==="",h=s.checkEmpty??!1,d;if(s.type==="UseAlternative"?d=f&&!(h&&p):d=!f||h&&p,d){let m=c[1],g=c[2]==="*",y=oe(e,m);if(y.length>0){let b=y.map(([,x])=>x);return g?{values:[b.join(de(e.state.env))],quoted:!0}:{values:b,quoted:!0}}let w=e.state.env.get(m);return w!==void 0?{values:[w],quoted:!0}:{values:[],quoted:!0}}return{values:[],quoted:!1}}var w6=v(()=>{"use strict";Ft();xe();rn();Zt();na()});function b6(e){let t=Number.parseInt(e.state.env.get("#")||"0",10),n=[];for(let r=1;r<=t;r++)n.push(e.state.env.get(String(r))||"");return n}async function x6(e,t,n,r){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0],i=-1,o=!1;for(let w=0;w<s.parts.length;w++){let b=s.parts[w];if(b.type==="ParameterExpansion"&&(b.parameter==="@"||b.parameter==="*")&&b.operation?.type==="Substring"){i=w,o=b.parameter==="*";break}}if(i===-1)return null;let l=s.parts[i].operation,c=l.offset?await n(e,l.offset.expression):0,u=l.length?await n(e,l.length.expression):void 0,f=Number.parseInt(e.state.env.get("#")||"0",10),p=[];for(let w=1;w<=f;w++)p.push(e.state.env.get(String(w))||"");let h=e.state.env.get("0")||"bash",d;if(c<=0){let w=[h,...p],b=w.length+c;if(b<0)d=[];else{let x=c<0?b:0;if(u!==void 0){let A=u<0?w.length+u:x+u;d=w.slice(x,Math.max(x,A))}else d=w.slice(x)}}else{let w=c-1;if(w>=p.length)d=[];else if(u!==void 0){let b=u<0?p.length+u:w+u;d=p.slice(w,Math.max(w,b))}else d=p.slice(w)}let m="";for(let w=0;w<i;w++)m+=await r(e,s.parts[w]);let g="";for(let w=i+1;w<s.parts.length;w++)g+=await r(e,s.parts[w]);if(d.length===0){let w=m+g;return{values:w?[w]:[],quoted:!0}}if(o){let w=de(e.state.env);return{values:[m+d.join(w)+g],quoted:!0}}return d.length===1?{values:[m+d[0]+g],quoted:!0}:{values:[m+d[0],...d.slice(1,-1),d[d.length-1]+g],quoted:!0}}async function E6(e,t,n,r){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0],i=-1,o=!1;for(let y=0;y<s.parts.length;y++){let w=s.parts[y];if(w.type==="ParameterExpansion"&&(w.parameter==="@"||w.parameter==="*")&&w.operation?.type==="PatternReplacement"){i=y,o=w.parameter==="*";break}}if(i===-1)return null;let l=s.parts[i].operation,c=b6(e),u="";for(let y=0;y<i;y++)u+=await n(e,s.parts[y]);let f="";for(let y=i+1;y<s.parts.length;y++)f+=await n(e,s.parts[y]);if(c.length===0){let y=u+f;return{values:y?[y]:[],quoted:!0}}let p="";if(l.pattern)for(let y of l.pattern.parts)if(y.type==="Glob")p+=we(y.pattern,!0,e.state.shoptOptions.extglob);else if(y.type==="Literal")p+=we(y.value,!0,e.state.shoptOptions.extglob);else if(y.type==="SingleQuoted"||y.type==="Escaped")p+=Ae(y.value);else if(y.type==="DoubleQuoted"){let w=await r(e,y.parts);p+=Ae(w)}else if(y.type==="ParameterExpansion"){let w=await n(e,y);p+=we(w,!0,e.state.shoptOptions.extglob)}else{let w=await n(e,y);p+=Ae(w)}let h=l.replacement?await r(e,l.replacement.parts):"",d=p;l.anchor==="start"?d=`^${p}`:l.anchor==="end"&&(d=`${p}$`);let m=[];try{let y=K(d,l.all?"g":"");for(let w of c)m.push(y.replace(w,h))}catch{m.push(...c)}if(o){let y=de(e.state.env);return{values:[u+m.join(y)+f],quoted:!0}}return m.length===1?{values:[u+m[0]+f],quoted:!0}:{values:[u+m[0],...m.slice(1,-1),m[m.length-1]+f],quoted:!0}}async function A6(e,t,n,r){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0],i=-1,o=!1;for(let g=0;g<s.parts.length;g++){let y=s.parts[g];if(y.type==="ParameterExpansion"&&(y.parameter==="@"||y.parameter==="*")&&y.operation?.type==="PatternRemoval"){i=g,o=y.parameter==="*";break}}if(i===-1)return null;let l=s.parts[i].operation,c=b6(e),u="";for(let g=0;g<i;g++)u+=await n(e,s.parts[g]);let f="";for(let g=i+1;g<s.parts.length;g++)f+=await n(e,s.parts[g]);if(c.length===0){let g=u+f;return{values:g?[g]:[],quoted:!0}}let p="",h=e.state.shoptOptions.extglob;if(l.pattern)for(let g of l.pattern.parts)if(g.type==="Glob")p+=we(g.pattern,l.greedy,h);else if(g.type==="Literal")p+=we(g.value,l.greedy,h);else if(g.type==="SingleQuoted"||g.type==="Escaped")p+=Ae(g.value);else if(g.type==="DoubleQuoted"){let y=await r(e,g.parts);p+=Ae(y)}else if(g.type==="ParameterExpansion"){let y=await n(e,g);p+=we(y,l.greedy,h)}else{let y=await n(e,g);p+=Ae(y)}let d=[];for(let g of c)d.push(tr(g,p,l.side,l.greedy));if(o){let g=de(e.state.env);return{values:[u+d.join(g)+f],quoted:!0}}return d.length===1?{values:[u+d[0]+f],quoted:!0}:{values:[u+d[0],...d.slice(1,-1),d[d.length-1]+f],quoted:!0}}async function S6(e,t,n){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let r=t[0],s=-1,i=!1;for(let p=0;p<r.parts.length;p++){let h=r.parts[p];if(h.type==="ParameterExpansion"&&(h.parameter==="@"||h.parameter==="*")){s=p,i=h.parameter==="*";break}}if(s===-1)return null;let o=r.parts[s];if(o.type==="ParameterExpansion"&&o.operation)return null;let a=Number.parseInt(e.state.env.get("#")||"0",10),l="";for(let p=0;p<s;p++)l+=await n(e,r.parts[p]);let c="";for(let p=s+1;p<r.parts.length;p++)c+=await n(e,r.parts[p]);if(a===0){if(i)return{values:[l+c],quoted:!0};let p=l+c;return{values:p?[p]:[],quoted:!0}}let u=[];for(let p=1;p<=a;p++)u.push(e.state.env.get(String(p))||"");if(i){let p=de(e.state.env);return{values:[l+u.join(p)+c],quoted:!0}}return u.length===1?{values:[l+u[0]+c],quoted:!0}:{values:[l+u[0],...u.slice(1,-1),u[u.length-1]+c],quoted:!0}}var C6=v(()=>{"use strict";Ve();rn();$s();Os();jr()});function sS(e){return new dr(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations})}async function sa(e,t){if(e.state.options.noglob)return t;let n=sS(e),r=[];for(let s of t)if(zn(s,e.state.shoptOptions.extglob)){let i=await n.expand(s);if(i.length>0)r.push(...i);else{if(n.hasFailglob())throw new Rn(s);n.hasNullglob()||r.push(s)}}else r.push(s);return r}async function v6(e,t,n,r){let s=-1,i="",o=!1;for(let w=0;w<t.length;w++){let b=t[w];if(b.type==="ParameterExpansion"&&b.operation?.type==="PatternReplacement"){let x=b.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(x){s=w,i=x[1],o=x[2]==="*";break}}}if(s===-1)return null;let l=t[s].operation,c=oe(e,i),u=c.map(([,w])=>w);if(c.length===0){let w=e.state.env.get(i);w!==void 0&&(u=[w])}if(u.length===0)return{values:[],quoted:!1};let f="";if(l.pattern)for(let w of l.pattern.parts)if(w.type==="Glob")f+=we(w.pattern,!0,e.state.shoptOptions.extglob);else if(w.type==="Literal")f+=we(w.value,!0,e.state.shoptOptions.extglob);else if(w.type==="SingleQuoted"||w.type==="Escaped")f+=Ae(w.value);else if(w.type==="DoubleQuoted"){let b=await n(e,w.parts);f+=Ae(b)}else if(w.type==="ParameterExpansion"){let b=await r(e,w);f+=we(b,!0,e.state.shoptOptions.extglob)}else{let b=await r(e,w);f+=Ae(b)}let p=l.replacement?await n(e,l.replacement.parts):"",h=f;l.anchor==="start"?h=`^${f}`:l.anchor==="end"&&(h=`${f}$`);let d=[];try{let w=K(h,l.all?"g":"");for(let b of u)d.push(w.replace(b,p))}catch{d.push(...u)}let m=ht(e.state.env),g=St(e.state.env);if(o){let w=de(e.state.env),b=d.join(w);return g?{values:b?[b]:[],quoted:!1}:{values:He(b,m),quoted:!1}}if(g)return{values:d,quoted:!1};let y=[];for(let w of d)w===""?y.push(""):y.push(...He(w,m));return{values:y,quoted:!1}}async function k6(e,t,n,r){let s=-1,i="",o=!1;for(let y=0;y<t.length;y++){let w=t[y];if(w.type==="ParameterExpansion"&&w.operation?.type==="PatternRemoval"){let b=w.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(b){s=y,i=b[1],o=b[2]==="*";break}}}if(s===-1)return null;let l=t[s].operation,c=oe(e,i),u=c.map(([,y])=>y);if(c.length===0){let y=e.state.env.get(i);y!==void 0&&(u=[y])}if(u.length===0)return{values:[],quoted:!1};let f="",p=e.state.shoptOptions.extglob;if(l.pattern)for(let y of l.pattern.parts)if(y.type==="Glob")f+=we(y.pattern,l.greedy,p);else if(y.type==="Literal")f+=we(y.value,l.greedy,p);else if(y.type==="SingleQuoted"||y.type==="Escaped")f+=Ae(y.value);else if(y.type==="DoubleQuoted"){let w=await n(e,y.parts);f+=Ae(w)}else if(y.type==="ParameterExpansion"){let w=await r(e,y);f+=we(w,l.greedy,p)}else{let w=await r(e,y);f+=Ae(w)}let h=[];for(let y of u)h.push(tr(y,f,l.side,l.greedy));let d=ht(e.state.env),m=St(e.state.env);if(o){let y=de(e.state.env),w=h.join(y);return m?{values:w?[w]:[],quoted:!1}:{values:He(w,d),quoted:!1}}if(m)return{values:h,quoted:!1};let g=[];for(let y of h)y===""?g.push(""):g.push(...He(y,d));return{values:g,quoted:!1}}async function N6(e,t,n,r){let s=-1,i=!1;for(let g=0;g<t.length;g++){let y=t[g];if(y.type==="ParameterExpansion"&&(y.parameter==="@"||y.parameter==="*")&&y.operation?.type==="PatternRemoval"){s=g,i=y.parameter==="*";break}}if(s===-1)return null;let a=t[s].operation,l=Number.parseInt(e.state.env.get("#")||"0",10),c=[];for(let g=1;g<=l;g++)c.push(e.state.env.get(String(g))||"");if(c.length===0)return{values:[],quoted:!1};let u="",f=e.state.shoptOptions.extglob;if(a.pattern)for(let g of a.pattern.parts)if(g.type==="Glob")u+=we(g.pattern,a.greedy,f);else if(g.type==="Literal")u+=we(g.value,a.greedy,f);else if(g.type==="SingleQuoted"||g.type==="Escaped")u+=Ae(g.value);else if(g.type==="DoubleQuoted"){let y=await n(e,g.parts);u+=Ae(y)}else if(g.type==="ParameterExpansion"){let y=await r(e,g);u+=we(y,a.greedy,f)}else{let y=await r(e,g);u+=Ae(y)}let p=[];for(let g of c)p.push(tr(g,u,a.side,a.greedy));let h=ht(e.state.env),d=St(e.state.env);if(i){let g=de(e.state.env),y=p.join(g);return d?{values:y?[y]:[],quoted:!1}:{values:He(y,h),quoted:!1}}if(d)return{values:p,quoted:!1};let m=[];for(let g of p)g===""?m.push(""):m.push(...He(g,h));return{values:m,quoted:!1}}async function I6(e,t,n,r){let s=-1,i=!1;for(let b=0;b<t.length;b++){let x=t[b];if(x.type==="ParameterExpansion"&&(x.parameter==="@"||x.parameter==="*")&&x.operation?.type==="Substring"){s=b,i=x.parameter==="*";break}}if(s===-1)return null;let a=t[s].operation,l=a.offset?await n(e,a.offset.expression):0,c=a.length?await n(e,a.length.expression):void 0,u=Number.parseInt(e.state.env.get("#")||"0",10),f=[];for(let b=1;b<=u;b++)f.push(e.state.env.get(String(b))||"");let p=e.state.env.get("0")||"bash",h;if(l<=0){let b=[p,...f],x=b.length+l;if(x<0)h=[];else{let A=l<0?x:0;if(c!==void 0){let $=c<0?b.length+c:A+c;h=b.slice(A,Math.max(A,$))}else h=b.slice(A)}}else{let b=l-1;if(b>=f.length)h=[];else if(c!==void 0){let x=c<0?f.length+c:b+c;h=f.slice(b,Math.max(b,x))}else h=f.slice(b)}let d="";for(let b=0;b<s;b++)d+=await r(e,t[b]);let m="";for(let b=s+1;b<t.length;b++)m+=await r(e,t[b]);let g=ht(e.state.env),y=St(e.state.env);if(h.length===0){let b=d+m;return b?y?{values:[b],quoted:!1}:{values:He(b,g),quoted:!1}:{values:[],quoted:!1}}let w;if(i){let b=de(e.state.env),x=d+h.join(b)+m;y?w=x?[x]:[]:w=He(x,g)}else if(y)h.length===1?w=[d+h[0]+m]:w=[d+h[0],...h.slice(1,-1),h[h.length-1]+m];else{w=[];for(let b=0;b<h.length;b++){let x=h[b];if(b===0&&(x=d+x),b===h.length-1&&(x=x+m),x==="")w.push("");else{let A=He(x,g);w.push(...A)}}}return{values:await sa(e,w),quoted:!1}}async function $6(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].parameter!=="@"&&t[0].parameter!=="*"||t[0].operation)return null;let n=t[0].parameter==="*",r=Number.parseInt(e.state.env.get("#")||"0",10);if(r===0)return{values:[],quoted:!1};let s=[];for(let c=1;c<=r;c++)s.push(e.state.env.get(String(c))||"");let i=ht(e.state.env),o=St(e.state.env),a=Xo(e.state.env),l;if(n)if(o)l=s.filter(c=>c!=="");else{let c=de(e.state.env),u=s.join(c);l=He(u,i)}else if(o)l=s.filter(c=>c!=="");else if(a){l=[];for(let c of s){if(c==="")continue;let u=He(c,i);l.push(...u)}}else{l=[];for(let c of s)if(c==="")l.push("");else{let u=He(c,i);l.push(...u)}for(;l.length>0&&l[l.length-1]==="";)l.pop()}return{values:await sa(e,l),quoted:!1}}async function O6(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation)return null;let n=t[0].parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!n)return null;let r=n[1],s=n[2]==="*",i=oe(e,r),o;if(i.length===0){let f=e.state.env.get(r);if(f!==void 0)o=[f];else return{values:[],quoted:!1}}else o=i.map(([,f])=>f);let a=ht(e.state.env),l=St(e.state.env),c=Xo(e.state.env),u;if(s)if(l)u=o.filter(f=>f!=="");else{let f=de(e.state.env),p=o.join(f);u=He(p,a)}else if(l)u=o.filter(f=>f!=="");else if(c){u=[];for(let f of o){if(f==="")continue;let p=He(f,a);u.push(...p)}}else{u=[];for(let f of o)if(f==="")u.push("");else{let p=He(f,a);u.push(...p)}for(;u.length>0&&u[u.length-1]==="";)u.pop()}return{values:await sa(e,u),quoted:!1}}function R6(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="VarNamePrefix")return null;let n=t[0].operation,r=Rs(e,n.prefix);if(r.length===0)return{values:[],quoted:!1};let s=ht(e.state.env),i=St(e.state.env),o;if(n.star)if(i)o=r;else{let a=de(e.state.env),l=r.join(a);o=He(l,s)}else if(i)o=r;else{o=[];for(let a of r){let l=He(a,s);o.push(...l)}}return{values:o,quoted:!1}}function T6(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="ArrayKeys")return null;let n=t[0].operation,s=oe(e,n.array).map(([l])=>String(l));if(s.length===0)return{values:[],quoted:!1};let i=ht(e.state.env),o=St(e.state.env),a;if(n.star)if(o)a=s;else{let l=de(e.state.env),c=s.join(l);a=He(c,i)}else if(o)a=s;else{a=[];for(let l of s){let c=He(l,i);a.push(...c)}}return{values:a,quoted:!1}}async function P6(e,t,n){let r=-1;for(let p=0;p<t.length;p++){let h=t[p];if(h.type==="ParameterExpansion"&&(h.parameter==="@"||h.parameter==="*")&&!h.operation){r=p;break}}if(r===-1||t.length<=1)return null;let s=Number.parseInt(e.state.env.get("#")||"0",10),i=[];for(let p=1;p<=s;p++)i.push(e.state.env.get(String(p))||"");let o="";for(let p=0;p<r;p++)o+=await n(e,t[p]);let a="";for(let p=r+1;p<t.length;p++)a+=await n(e,t[p]);let l=ht(e.state.env),c=St(e.state.env),u=Xo(e.state.env);if(s===0){let p=o+a;return{values:p?[p]:[],quoted:!1}}let f;{let p=[];for(let h=0;h<i.length;h++){let d=i[h];h===0&&(d=o+d),h===i.length-1&&(d=d+a),p.push(d)}if(c)f=p.filter(h=>h!=="");else if(u){f=[];for(let h of p){if(h==="")continue;let d=He(h,l);f.push(...d)}}else{f=[];for(let h of p)if(h==="")f.push("");else{let d=He(h,l);f.push(...d)}for(;f.length>0&&f[f.length-1]==="";)f.pop()}}return f.length===0?{values:[],quoted:!1}:{values:await sa(e,f),quoted:!1}}var D6=v(()=>{"use strict";Ve();Zo();xe();rn();$s();Is();Os();jr();Zt()});async function L6(e,t,n){e.coverage?.hit("bash:expansion:word_glob");let r=t.parts,{hasQuoted:s,hasCommandSub:i,hasArrayVar:o,hasArrayAtExpansion:a,hasParamExpansion:l,hasVarNamePrefixExpansion:c,hasIndirection:u}=wi(r),p=n.hasBraceExpansion(r)?await n.expandWordWithBracesAsync(e,t):null;if(p&&p.length>1)return iS(e,p,s);let h=await oS(e,r,a,c,u,n);if(h!==null)return h;let d=await lS(e,r,n);if(d!==null)return d;let m=await cS(e,r,n);if(m!==null)return m;let g=await fS(e,r,n.expandPart);if(g!==null)return F6(e,g);if((i||o||l)&&!St(e.state.env)){let w=ht(e.state.env),b=n.buildIfsCharClassPattern(w),x=await n.smartWordSplit(e,r,w,b,n.expandPart);return F6(e,x)}let y=await n.expandWordAsync(e,t);return pS(e,t,r,y,s,n.expandWordForGlobbing)}async function iS(e,t,n){let r=[];for(let s of t)if(!(!n&&s===""))if(!n&&!e.state.options.noglob&&zn(s,e.state.shoptOptions.extglob)){let i=await ia(e,s);r.push(...i)}else r.push(s);return{values:r,quoted:!1}}async function oS(e,t,n,r,s,i){if(n){let o=p6(e,t);if(o!==null)return o}{let o=h6(e,t);if(o!==null)return o}{let o=await i6(e,t);if(o!==null)return o}{let o=await o6(e,t,n,i.expandPart,i.expandWordPartsAsync);if(o!==null)return o}{let o=await a6(e,t,n,i.expandPart);if(o!==null)return o}{let o=await c6(e,t,i.evaluateArithmetic);if(o!==null)return o}{let o=u6(e,t);if(o!==null)return o}{let o=await n6(e,t,i.expandWordPartsAsync,i.expandPart);if(o!==null)return o}{let o=await r6(e,t,i.expandWordPartsAsync,i.expandPart);if(o!==null)return o}if(r&&t.length===1&&t[0].type==="DoubleQuoted"){let o=aS(e,t);if(o!==null)return o}{let o=await m6(e,t,s,i.expandParameterAsync,i.expandWordPartsAsync);if(o!==null)return o}{let o=await g6(e,t);if(o!==null)return o}{let o=await y6(e,t);if(o!==null)return o}return null}function aS(e,t){let n=t[0];if(n.type!=="DoubleQuoted")return null;if(n.parts.length===1&&n.parts[0].type==="ParameterExpansion"&&n.parts[0].operation?.type==="VarNamePrefix"){let r=n.parts[0].operation,s=Rs(e,r.prefix);return r.star?{values:[s.join(de(e.state.env))],quoted:!0}:{values:s,quoted:!0}}if(n.parts.length===1&&n.parts[0].type==="ParameterExpansion"&&n.parts[0].operation?.type==="ArrayKeys"){let r=n.parts[0].operation,i=oe(e,r.array).map(([o])=>String(o));return r.star?{values:[i.join(de(e.state.env))],quoted:!0}:{values:i,quoted:!0}}return null}async function lS(e,t,n){{let r=await x6(e,t,n.evaluateArithmetic,n.expandPart);if(r!==null)return r}{let r=await E6(e,t,n.expandPart,n.expandWordPartsAsync);if(r!==null)return r}{let r=await A6(e,t,n.expandPart,n.expandWordPartsAsync);if(r!==null)return r}{let r=await S6(e,t,n.expandPart);if(r!==null)return r}return null}async function cS(e,t,n){{let r=await v6(e,t,n.expandWordPartsAsync,n.expandPart);if(r!==null)return r}{let r=await k6(e,t,n.expandWordPartsAsync,n.expandPart);if(r!==null)return r}{let r=await N6(e,t,n.expandWordPartsAsync,n.expandPart);if(r!==null)return r}{let r=await I6(e,t,n.evaluateArithmetic,n.expandPart);if(r!==null)return r}{let r=await $6(e,t);if(r!==null)return r}{let r=await O6(e,t);if(r!==null)return r}{let r=R6(e,t);if(r!==null)return r}{let r=T6(e,t);if(r!==null)return r}{let r=await P6(e,t,n.expandPart);if(r!==null)return r}return null}function _6(e){if(e.type!=="DoubleQuoted")return null;for(let t=0;t<e.parts.length;t++){let n=e.parts[t];if(n.type!=="ParameterExpansion"||n.operation)continue;let r=n.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(r)return{type:"array",name:r[1],atIndex:t,isStar:r[2]==="*"};if(n.parameter==="@"||n.parameter==="*")return{type:"positional",atIndex:t,isStar:n.parameter==="*"}}return null}async function uS(e,t,n,r){let s="";for(let a=0;a<n.atIndex;a++)s+=await r(e,t.parts[a]);let i="";for(let a=n.atIndex+1;a<t.parts.length;a++)i+=await r(e,t.parts[a]);let o;if(n.type==="array"){if(o=oe(e,n.name).map(([,l])=>l),o.length===0){let l=e.state.env.get(n.name);l!==void 0&&(o=[l])}}else{let a=Number.parseInt(e.state.env.get("#")||"0",10);o=[];for(let l=1;l<=a;l++)o.push(e.state.env.get(String(l))||"")}if(n.isStar){let a=de(e.state.env),l=o.join(a);return[s+l+i]}if(o.length===0){let a=s+i;return a?[a]:[]}return o.length===1?[s+o[0]+i]:[s+o[0],...o.slice(1,-1),o[o.length-1]+i]}async function fS(e,t,n){if(t.length<2)return null;let r=!1;for(let l of t)if(_6(l)){r=!0;break}if(!r)return null;let s=ht(e.state.env),i=St(e.state.env),o=[];for(let l of t){let c=_6(l);if(c&&l.type==="DoubleQuoted"){let u=await uS(e,l,c,n);o.push(u)}else if(l.type==="DoubleQuoted"||l.type==="SingleQuoted"){let u=await n(e,l);o.push([u])}else if(l.type==="Literal")o.push([l.value]);else if(l.type==="ParameterExpansion"){let u=await n(e,l);if(i)o.push(u?[u]:[]);else{let f=He(u,s);o.push(f)}}else{let u=await n(e,l);if(i)o.push(u?[u]:[]);else{let f=He(u,s);o.push(f)}}}let a=[];for(let l of o)if(l.length!==0)if(a.length===0)a.push(...l);else{let c=a.length-1;a[c]=a[c]+l[0];for(let u=1;u<l.length;u++)a.push(l[u])}return a}async function F6(e,t){if(e.state.options.noglob)return{values:t,quoted:!1};let n=[];for(let r of t)if(zn(r,e.state.shoptOptions.extglob)){let s=await ia(e,r);n.push(...s)}else n.push(r);return{values:n,quoted:!1}}async function ia(e,t){let n=new dr(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations}),r=await n.expand(t);if(r.length>0)return r;if(n.hasFailglob())throw new Rn(t);return n.hasNullglob()?[]:[t]}async function pS(e,t,n,r,s,i){let o=n.some(a=>a.type==="Glob");if(!e.state.options.noglob&&o){let a=await i(e,t);if(zn(a,e.state.shoptOptions.extglob)){let c=await ia(e,a);if(c.length>0&&c[0]!==a)return{values:c,quoted:!1};if(c.length===0)return{values:[],quoted:!1}}let l=hu(r);if(!St(e.state.env)){let c=ht(e.state.env);return{values:He(l,c),quoted:!1}}return{values:[l],quoted:!1}}if(!s&&!e.state.options.noglob&&zn(r,e.state.shoptOptions.extglob)){let a=await i(e,t);if(zn(a,e.state.shoptOptions.extglob)){let l=await ia(e,a);if(l.length>0&&l[0]!==a)return{values:l,quoted:!1}}}if(r===""&&!s)return{values:[],quoted:!1};if(o&&!s){let a=hu(r);if(!St(e.state.env)){let l=ht(e.state.env);return{values:He(a,l),quoted:!1}}return{values:[a],quoted:!1}}return{values:[r],quoted:s}}var M6=v(()=>{"use strict";Zo();xe();rn();Ko();s6();l6();f6();d6();Is();w6();jr();C6();D6();Zt()});async function B6(e,t){let n=t.operation;if(!n||n.type!=="DefaultValue"&&n.type!=="AssignDefault"&&n.type!=="UseAlternative")return null;let r=n.word;if(!r||r.parts.length===0)return null;let s=await Wn(e,t.parameter),o=await ve(e,t.parameter,!1)==="",a=n.checkEmpty??!1,l;return n.type==="UseAlternative"?l=s&&!(a&&o):l=!s||a&&o,l?r.parts:null}function hS(e){return e.type==="SingleQuoted"?!0:e.type==="DoubleQuoted"?e.parts.every(n=>n.type==="Literal"):!1}async function dS(e,t){if(t.type!=="ParameterExpansion")return null;let n=await B6(e,t);if(!n||n.length<=1)return null;let r=n.some(i=>hS(i)),s=n.some(i=>i.type==="Literal"||i.type==="ParameterExpansion"||i.type==="CommandSubstitution"||i.type==="ArithmeticExpansion");return r&&s?n:null}function mS(e){return e.type==="DoubleQuoted"||e.type==="SingleQuoted"||e.type==="Literal"?!1:e.type==="Glob"?ou(e.pattern):!(!(e.type==="ParameterExpansion"||e.type==="CommandSubstitution"||e.type==="ArithmeticExpansion")||e.type==="ParameterExpansion"&&Sg(e))}async function W6(e,t,n,r,s){if(e.coverage?.hit("bash:expansion:word_split"),t.length===1&&t[0].type==="ParameterExpansion"){let p=t[0],h=await B6(e,p);if(h&&h.length>0&&h.length>1&&h.some(m=>m.type==="DoubleQuoted"||m.type==="SingleQuoted")&&h.some(m=>m.type==="Literal"||m.type==="ParameterExpansion"||m.type==="CommandSubstitution"||m.type==="ArithmeticExpansion"))return U6(e,h,n,r,s)}let i=[],o=!1;for(let p of t){let h=mS(p),d=p.type==="DoubleQuoted"||p.type==="SingleQuoted",m=h?await dS(e,p):null,g=await s(e,p);i.push({value:g,isSplittable:h,isQuoted:d,mixedDefaultParts:m??void 0}),h&&(o=!0)}if(!o){let p=i.map(h=>h.value).join("");return p?[p]:[]}let a=[],l="",c=!1,u=!1,f=!1;for(let p of i)if(!p.isSplittable)u?p.isQuoted&&p.value===""?(l!==""&&a.push(l),a.push(""),c=!0,l="",u=!1,f=!0):p.value!==""?(l!==""&&a.push(l),l=p.value,u=!1,f=!1):(l+=p.value,f=!1):(l+=p.value,f=p.isQuoted&&p.value==="");else if(p.mixedDefaultParts){let h=await U6(e,p.mixedDefaultParts,n,r,s);if(h.length!==0)if(h.length===1)l+=h[0],c=!0;else{l+=h[0],a.push(l),c=!0;for(let d=1;d<h.length-1;d++)a.push(h[d]);l=h[h.length-1]}u=!1,f=!1}else{let{words:h,hadLeadingDelimiter:d,hadTrailingDelimiter:m}=Yo(p.value,n);if(f&&d&&l===""&&(a.push(""),c=!0),h.length===0)m&&(u=!0);else if(h.length===1)l+=h[0],c=!0,u=m;else{l+=h[0],a.push(l),c=!0;for(let g=1;g<h.length-1;g++)a.push(h[g]);l=h[h.length-1],u=m}f=!1}return l!==""?a.push(l):a.length===0&&c&&a.push(""),a}function gS(e,t){return e.length>0&&t.includes(e[0])}async function U6(e,t,n,r,s){let i=[];for(let u of t){let p=!(u.type==="DoubleQuoted"||u.type==="SingleQuoted"),h=await s(e,u);i.push({value:h,isSplittable:p})}let o=[],a="",l=!1,c=!1;for(let u of i)if(!u.isSplittable)c&&u.value!==""?(a!==""&&o.push(a),a=u.value,c=!1):a+=u.value;else{gS(u.value,n)&&a!==""&&(o.push(a),a="",l=!0);let{words:p,hadTrailingDelimiter:h}=Yo(u.value,n);if(p.length===0)h&&(c=!0);else if(p.length===1)a+=p[0],l=!0,c=h;else{a+=p[0],o.push(a),l=!0;for(let d=1;d<p.length-1;d++)o.push(p[d]);a=p[p.length-1],c=h}}return a!==""?o.push(a):o.length===0&&l&&o.push(""),o}var z6=v(()=>{"use strict";Zt();rn();Ko()});function H6(e){switch(e.type){case"Literal":return e.value;case"SingleQuoted":return e.value;case"Escaped":return e.value;default:return null}}function j6(e){switch(e.type){case"SingleQuoted":case"Escaped":case"DoubleQuoted":return!0;case"Literal":return e.value==="";default:return!1}}var G6=v(()=>{"use strict"});var Au={};J(Au,{escapeGlobChars:()=>Kt,escapeRegexChars:()=>Ns,expandRedirectTarget:()=>Ei,expandWord:()=>se,expandWordForPattern:()=>xu,expandWordForRegex:()=>bu,expandWordWithGlob:()=>In,getArrayElements:()=>oe,getVariable:()=>ve,hasQuotedMultiValueAt:()=>xi,isArray:()=>er,isWordFullyQuoted:()=>wu});function wr(e,t,n){if(e.length>t)throw new Q(`${n}: string length limit exceeded (${t} bytes)`,"string_length")}async function Nn(e,t,n=!1){let r=[];for(let s of t)r.push(await sn(e,s,n));return r.join("")}function yS(e){return j6(e)}function wu(e){if(e.parts.length===0)return!0;for(let t of e.parts)if(!yS(t))return!1;return!0}function wS(e,t,n=!1){let r=H6(t);if(r!==null)return r;switch(t.type){case"TildeExpansion":return n?t.user===null?"~":`~${t.user}`:(e.coverage?.hit("bash:expansion:tilde"),t.user===null?e.state.env.get("HOME")??"/home/user":t.user==="root"?"/root":`~${t.user}`);case"Glob":return gu(e,t.pattern);default:return null}}async function se(e,t){return Eu(e,t)}async function bu(e,t){let n=[];for(let r of t.parts)if(r.type==="Escaped")n.push(`\\${r.value}`);else if(r.type==="SingleQuoted")n.push(r.value);else if(r.type==="DoubleQuoted"){let s=await Nn(e,r.parts);n.push(s)}else if(r.type==="TildeExpansion"){let s=await sn(e,r);n.push(Ns(s))}else n.push(await sn(e,r));return n.join("")}async function xu(e,t){let n=[];for(let r of t.parts)if(r.type==="Escaped"){let s=r.value;"()|*?[]".includes(s)?n.push(`\\${s}`):n.push(s)}else if(r.type==="SingleQuoted")n.push(Kt(r.value));else if(r.type==="DoubleQuoted"){let s=await Nn(e,r.parts);n.push(Kt(s))}else n.push(await sn(e,r));return n.join("")}async function V6(e,t){let n=[];for(let r of t.parts)if(r.type==="SingleQuoted")n.push(Kt(r.value));else if(r.type==="Escaped"){let s=r.value;"*?[]\\()|".includes(s)?n.push(`\\${s}`):n.push(s)}else if(r.type==="DoubleQuoted"){let s=await Nn(e,r.parts);n.push(Kt(s))}else r.type==="Glob"?Qg(r.pattern)?n.push(await Yg(e,r.pattern)):n.push(gu(e,r.pattern)):r.type==="Literal"?n.push(r.value):n.push(await sn(e,r));return n.join("")}function aa(e){for(let t of e)if(t.type==="BraceExpansion"||t.type==="DoubleQuoted"&&aa(t.parts))return!0;return!1}async function q6(e,t,n={count:0}){if(n.count>yu)return[[]];let r=[[]];for(let s of t)if(s.type==="BraceExpansion"){let i=[],o=!1,a="";for(let u of s.items)if(u.type==="Range"){let f=pu(u.start,u.end,u.step,u.startStr,u.endStr);if(f.expanded)for(let p of f.expanded)n.count++,i.push(p);else{o=!0,a=f.literal;break}}else{let f=await q6(e,u.word.parts,n);for(let p of f){n.count++;let h=[];for(let d of p)typeof d=="string"?h.push(d):h.push(await sn(e,d));i.push(h.join(""))}}if(o){for(let u of r)n.count++,u.push(a);continue}if(r.length*i.length>e.limits.maxBraceExpansionResults||n.count>yu)return r;let c=[];for(let u of r)for(let f of i){if(n.count++,n.count>yu)return c.length>0?c:r;c.push([...u,f])}r=c}else for(let i of r)n.count++,i.push(s);return r}async function Z6(e,t){let n=t.parts;if(!aa(n))return[await se(e,t)];let r=await q6(e,n),s=[];for(let i of r){let o=[];for(let a of i)typeof a=="string"?o.push(a):o.push(await sn(e,a));s.push(e6(e,o.join("")))}return s}function bS(){return{expandWordAsync:Eu,expandWordForGlobbing:V6,expandWordWithBracesAsync:Z6,expandWordPartsAsync:Nn,expandPart:sn,expandParameterAsync:oa,hasBraceExpansion:aa,evaluateArithmetic:te,buildIfsCharClassPattern:Cg,smartWordSplit:W6}}async function In(e,t){return L6(e,t,bS())}function xS(e){for(let t of e){if(t.type==="ParameterExpansion")return t.parameter;if(t.type==="Literal")return t.value}return""}function xi(e,t){if(Number.parseInt(e.state.env.get("#")||"0",10)<2)return!1;function r(s){for(let i of s)if(i.type==="DoubleQuoted"){for(let o of i.parts)if(o.type==="ParameterExpansion"&&o.parameter==="@"&&!o.operation)return!0}return!1}return r(t.parts)}async function Ei(e,t){if(xi(e,t))return{error:`bash: $@: ambiguous redirect
|
|
786
|
+
`};let n=t.parts,{hasQuoted:r}=wi(n);if(aa(n)&&(await Z6(e,t)).length>1)return{error:`bash: ${n.map(h=>h.type==="Literal"?h.value:h.type==="BraceExpansion"?`{${h.items.map(m=>{if(m.type==="Range"){let g=m.step?`..${m.step}`:"";return`${m.startStr??m.start}..${m.endStr??m.end}${g}`}return m.word.parts.map(g=>g.type==="Literal"?g.value:"").join("")}).join(",")}}`:"").join("")}: ambiguous redirect
|
|
787
|
+
`};let s=await Eu(e,t),{hasParamExpansion:i,hasCommandSub:o}=wi(n);if((i||o)&&!r&&!St(e.state.env)){let f=ht(e.state.env);if(He(s,f).length>1)return{error:`bash: $${xS(n)}: ambiguous redirect
|
|
788
|
+
`}}if(r||e.state.options.noglob)return{target:s};let l=await V6(e,t);if(!zn(l,e.state.shoptOptions.extglob))return{target:s};let c=new dr(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations}),u=await c.expand(l);return u.length===0?c.hasFailglob()?{error:`bash: no match: ${s}
|
|
789
|
+
`}:{target:s}:u.length===1?{target:u[0]}:{error:`bash: ${s}: ambiguous redirect
|
|
790
|
+
`}}async function Eu(e,t){let n=t.parts,r=n.length;if(r===1){let o=await sn(e,n[0]);return wr(o,e.limits.maxStringLength,"word expansion"),o}let s=[];for(let o=0;o<r;o++)s.push(await sn(e,n[o]));let i=s.join("");return wr(i,e.limits.maxStringLength,"word expansion"),i}async function sn(e,t,n=!1){if(t.type==="ParameterExpansion")return oa(e,t,n);let r=wS(e,t,n);if(r!==null)return r;switch(t.type){case"DoubleQuoted":{let s=[];for(let i of t.parts)s.push(await sn(e,i,!0));return s.join("")}case"CommandSubstitution":{let s=Pg(t.body);if(s)try{let p=await se(e,s.target),h=p.startsWith("/")?p:`${e.state.cwd}/${p}`,d=await e.fs.readFile(h);e.state.lastExitCode=0,e.state.env.set("?","0");let m=d.replace(/\n+$/,"");return wr(m,e.limits.maxStringLength,"command substitution"),m}catch(p){if(p instanceof Q)throw p;return e.state.lastExitCode=1,e.state.env.set("?","1"),""}let i=e.substitutionDepth??0,o=e.limits.maxSubstitutionDepth;if(i>=o)throw new Q(`Command substitution nesting limit exceeded (${o})`,"substitution_depth");let a=e.substitutionDepth;e.substitutionDepth=i+1;let l=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;let c=new Map(e.state.env),u=e.state.cwd,f=e.state.suppressVerbose;e.state.suppressVerbose=!0;try{let p=await e.executeScript(t.body),h=p.exitCode;e.state.env=c,e.state.cwd=u,e.state.suppressVerbose=f,e.state.lastExitCode=h,e.state.env.set("?",String(h)),p.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+p.stderr),e.state.bashPid=l,e.substitutionDepth=a;let d=p.stdout.replace(/\n+$/,"");return wr(d,e.limits.maxStringLength,"command substitution"),d}catch(p){if(e.state.env=c,e.state.cwd=u,e.state.bashPid=l,e.substitutionDepth=a,e.state.suppressVerbose=f,p instanceof Q)throw p;if(p instanceof ge){e.state.lastExitCode=p.exitCode,e.state.env.set("?",String(p.exitCode)),p.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+p.stderr);let h=p.stdout.replace(/\n+$/,"");return wr(h,e.limits.maxStringLength,"command substitution"),h}throw p}}case"ArithmeticExpansion":{let s=t.expression.originalText;if(s&&/\$[a-zA-Z_][a-zA-Z0-9_]*(?![{[(])/.test(s)){let o=await Og(e,s),a=new ce,l=Ce(a,o);return String(await te(e,l.expression,!0))}return String(await te(e,t.expression.expression,!0))}case"BraceExpansion":{let s=[];for(let i of t.items)if(i.type==="Range"){let o=pu(i.start,i.end,i.step,i.startStr,i.endStr);if(o.expanded)s.push(...o.expanded);else return o.literal}else s.push(await se(e,i.word));return s.join(" ")}default:return""}}async function oa(e,t,n=!1){let{parameter:r}=t,{operation:s}=t,i=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(i){let[,p,h]=i;if(e.state.associativeArrays?.has(p)||h.includes("$(")||h.includes("`")||h.includes("${")){let m=await fu(e,h);r=`${p}[${m}]`}}else if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)&&Me(e,r)){let p=_t(e,r);if(p&&p!==r){let h=p.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(h){let[,d,m]=h;if(e.state.associativeArrays?.has(d)||m.includes("$(")||m.includes("`")||m.includes("${")){let y=await fu(e,m);r=`${d}[${y}]`}}}}let o=s&&(s.type==="DefaultValue"||s.type==="AssignDefault"||s.type==="UseAlternative"||s.type==="ErrorIfUnset"),a=await ve(e,r,!o);if(!s)return a;let l=!await Wn(e,r),{isEmpty:c,effectiveValue:u}=Zg(e,r,a,n),f={value:a,isUnset:l,isEmpty:c,effectiveValue:u,inDoubleQuotes:n};switch(s.type){case"DefaultValue":return _g(e,s,f,Nn);case"AssignDefault":return Fg(e,r,s,f,Nn);case"ErrorIfUnset":return Lg(e,r,s,f,Nn);case"UseAlternative":return Mg(e,s,f,Nn);case"PatternRemoval":{let p=await Ug(e,a,s,Nn,sn);return wr(p,e.limits.maxStringLength,"pattern removal"),p}case"PatternReplacement":{let p=await Bg(e,a,s,Nn,sn);return wr(p,e.limits.maxStringLength,"pattern replacement"),p}case"Length":return Wg(e,r,a);case"LengthSliceError":throw new Ot(r);case"BadSubstitution":throw new Ot(s.text);case"Substring":return zg(e,r,a,s);case"CaseModification":{let p=await Hg(e,a,s,Nn,oa);return wr(p,e.limits.maxStringLength,"case modification"),p}case"Transform":return jg(e,r,a,l,s);case"Indirection":return Gg(e,r,a,l,s,oa,n);case"ArrayKeys":return Vg(e,s);case"VarNamePrefix":return qg(e,s);default:return a}}var yu,Lt=v(()=>{"use strict";Nt();ot();Zo();Ft();xe();Ko();Rg();Tg();Dg();Is();Kg();Jg();t6();Zt();M6();z6();rn();vn();G6();Is();Zt();yu=1e5});function ES(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":if(t===0)throw new De("division by 0");return Math.trunc(e/t);case"%":if(t===0)throw new De("division by 0");return e%t;case"**":if(t<0)throw new De("exponent less than 0");return e**t;case"<<":return e<<t;case">>":return e>>t;case"<":return e<t?1:0;case"<=":return e<=t?1:0;case">":return e>t?1:0;case">=":return e>=t?1:0;case"==":return e===t?1:0;case"!=":return e!==t?1:0;case"&":return e&t;case"|":return e|t;case"^":return e^t;case",":return t;default:return 0}}function K6(e,t,n){switch(n){case"=":return t;case"+=":return e+t;case"-=":return e-t;case"*=":return e*t;case"/=":return t!==0?Math.trunc(e/t):0;case"%=":return t!==0?e%t:0;case"<<=":return e<<t;case">>=":return e>>t;case"&=":return e&t;case"|=":return e|t;case"^=":return e^t;default:return t}}function AS(e,t){switch(t){case"-":return-e;case"+":return+e;case"!":return e===0?1:0;case"~":return~e;default:return e}}async function SS(e,t){let n=e.state.env.get(t);if(n!==void 0)return n;let r=e.state.env.get(`${t}_0`);return r!==void 0?r:await ve(e,t)}function CS(e){if(!e)return 0;let t=Number.parseInt(e,10);if(!Number.isNaN(t)&&/^-?\d+$/.test(e.trim()))return t;let n=e.trim();if(!n)return 0;try{let r=new ce,{expr:s,pos:i}=nn(r,n,0);if(i<n.length){let o=n.slice(i).trim().split(/\s+/)[0];throw new De(`${n}: syntax error in expression (error token is "${o}")`)}return s.type==="ArithNumber"?s.value:t||0}catch(r){if(r instanceof De)throw r;let s=n.split(/\s+/).slice(1)[0]||n;throw new De(`${n}: syntax error in expression (error token is "${s}")`)}}async function Su(e,t){if(!t)return 0;let n=Number.parseInt(t,10);if(!Number.isNaN(n)&&/^-?\d+$/.test(t.trim()))return n;let r=t.trim();if(!r)return 0;let s=new ce,{expr:i,pos:o}=nn(s,r,0);if(o<r.length){let a=r.slice(o).trim(),l=a.split(/\s+/)[0]||a;throw new De(`syntax error in expression (error token is "${l}")`,"","")}return await te(e,i)}async function Cu(e,t,n=new Set,r=0){if(r>100)throw new De("maximum variable indirection depth exceeded");if(n.has(t))return 0;n.add(t);let s=await SS(e,t);if(!s)return 0;let i=Number.parseInt(s,10);if(!Number.isNaN(i)&&/^-?\d+$/.test(s.trim()))return i;let o=s.trim();if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(o))return await Cu(e,o,n,r+1);let a=new ce,{expr:l,pos:c}=nn(a,o,0);if(c<o.length){let u=o.slice(c).trim(),f=u.split(/\s+/)[0]||u;throw new De(`${o}: syntax error in expression (error token is "${f}")`)}return await te(e,l)}async function la(e,t){if(t.startsWith("#")){let f=t.slice(1),p=f.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(p){let d=p[1],m=oe(e,d);return String(m.length)}let h=e.state.env.get(f)||"";return String(h.length)}if(t.startsWith("!")){let f=t.slice(1),p=e.state.env.get(f)||"";return e.state.env.get(p)||""}let n=[":-",":=",":?",":+","-","=","?","+"],r=-1,s="";for(let f of n){let p=t.indexOf(f);p>0&&(r===-1||p<r)&&(r=p,s=f)}if(r===-1)return await ve(e,t);let i=t.slice(0,r),o=t.slice(r+s.length),a=e.state.env.get(i),l=a===void 0,c=a==="",u=s.startsWith(":");switch(s){case":-":case"-":return l||u&&c?o:a||"";case":=":case"=":return l||u&&c?(e.state.env.set(i,o),o):a||"";case":+":case"+":return!(l||u&&c)?o:"";case":?":case"?":{if(l||u&&c)throw new Error(o||`${i}: parameter null or not set`);return a||""}default:return a||""}}async function te(e,t,n=!1){switch(t.type){case"ArithNumber":if(Number.isNaN(t.value))throw new De("value too great for base");return t.value;case"ArithVariable":return await Cu(e,t.name);case"ArithSpecialVar":{let s=(await ve(e,t.name)).trim();if(!s)return 0;let i=Number.parseInt(s,10);if(!Number.isNaN(i)&&/^-?\d+$/.test(s))return i;let o=new ce,{expr:a}=nn(o,s,0);return await te(e,a)}case"ArithNested":return await te(e,t.expression);case"ArithCommandSubst":{if(e.execFn){let r=await e.execFn(t.command,{signal:e.state.signal});r.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+r.stderr);let s=r.stdout.trim();return Number.parseInt(s,10)||0}return 0}case"ArithBracedExpansion":{let r=await la(e,t.content);return Number.parseInt(r,10)||0}case"ArithDynamicBase":{let r=await la(e,t.baseExpr),s=Number.parseInt(r,10);if(s<2||s>64)return 0;let i=`${s}#${t.value}`;return mi(i)}case"ArithDynamicNumber":{let s=await la(e,t.prefix)+t.suffix;return mi(s)}case"ArithArrayElement":{let r=e.state.associativeArrays?.has(t.array),s=async i=>{let o=e.state.env.get(i);return o!==void 0?await Su(e,o):0};if(t.stringKey!==void 0)return await s(`${t.array}_${t.stringKey}`);if(r&&t.index?.type==="ArithVariable"&&!t.index.hasDollarPrefix)return await s(`${t.array}_${t.index.name}`);if(r&&t.index?.type==="ArithVariable"&&t.index.hasDollarPrefix){let i=await ve(e,t.index.name);return await s(`${t.array}_${i}`)}if(t.index){let i=await te(e,t.index,n);if(i<0){let l=oe(e,t.array),c=e.state.currentLine;if(l.length===0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${c}: ${t.array}: bad array subscript
|
|
791
|
+
`,0;let f=Math.max(...l.map(([p])=>typeof p=="number"?p:0))+1+i;if(f<0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${c}: ${t.array}: bad array subscript
|
|
792
|
+
`,0;i=f}let o=`${t.array}_${i}`,a=e.state.env.get(o);if(a!==void 0)return Su(e,a);if(i===0){let l=e.state.env.get(t.array);if(l!==void 0)return Su(e,l)}if(e.state.options.nounset&&!Array.from(e.state.env.keys()).some(c=>c===t.array||c.startsWith(`${t.array}_`)))throw new $t(`${t.array}[${i}]`);return 0}return 0}case"ArithDoubleSubscript":throw new De("double subscript","","");case"ArithNumberSubscript":throw new De(`${t.number}${t.errorToken}: syntax error: invalid arithmetic operator (error token is "${t.errorToken}")`);case"ArithSyntaxError":throw new De(t.message,"","",!0);case"ArithSingleQuote":{if(n)throw new De(`syntax error: operand expected (error token is "'${t.content}'")`);return t.value}case"ArithBinary":{if(t.operator==="||")return await te(e,t.left,n)||await te(e,t.right,n)?1:0;if(t.operator==="&&")return await te(e,t.left,n)&&await te(e,t.right,n)?1:0;let r=await te(e,t.left,n),s=await te(e,t.right,n);return ES(r,s,t.operator)}case"ArithUnary":{let r=await te(e,t.operand,n);if(t.operator==="++"||t.operator==="--"){if(t.operand.type==="ArithVariable"){let s=t.operand.name,i=Number.parseInt(await ve(e,s),10)||0,o=t.operator==="++"?i+1:i-1;return e.state.env.set(s,String(o)),t.prefix?o:i}if(t.operand.type==="ArithArrayElement"){let s=t.operand.array,i=e.state.associativeArrays?.has(s),o;if(t.operand.stringKey!==void 0)o=`${s}_${t.operand.stringKey}`;else if(i&&t.operand.index?.type==="ArithVariable"&&!t.operand.index.hasDollarPrefix)o=`${s}_${t.operand.index.name}`;else if(i&&t.operand.index?.type==="ArithVariable"&&t.operand.index.hasDollarPrefix){let c=await ve(e,t.operand.index.name);o=`${s}_${c}`}else if(t.operand.index){let c=await te(e,t.operand.index,n);o=`${s}_${c}`}else return r;let a=Number.parseInt(e.state.env.get(o)||"0",10)||0,l=t.operator==="++"?a+1:a-1;return e.state.env.set(o,String(l)),t.prefix?l:a}if(t.operand.type==="ArithConcat"){let s="";for(let i of t.operand.parts)s+=await Ts(e,i,n);if(s&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)){let i=Number.parseInt(e.state.env.get(s)||"0",10)||0,o=t.operator==="++"?i+1:i-1;return e.state.env.set(s,String(o)),t.prefix?o:i}}if(t.operand.type==="ArithDynamicElement"){let s="";if(t.operand.nameExpr.type==="ArithConcat")for(let i of t.operand.nameExpr.parts)s+=await Ts(e,i,n);else t.operand.nameExpr.type==="ArithVariable"&&(s=t.operand.nameExpr.hasDollarPrefix?await ve(e,t.operand.nameExpr.name):t.operand.nameExpr.name);if(s&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)){let i=await te(e,t.operand.subscript,n),o=`${s}_${i}`,a=Number.parseInt(e.state.env.get(o)||"0",10)||0,l=t.operator==="++"?a+1:a-1;return e.state.env.set(o,String(l)),t.prefix?l:a}}return r}return AS(r,t.operator)}case"ArithTernary":return await te(e,t.condition,n)?await te(e,t.consequent,n):await te(e,t.alternate,n);case"ArithAssignment":{let r=t.variable,s=r;if(t.stringKey!==void 0)s=`${r}_${t.stringKey}`;else if(t.subscript){let l=e.state.associativeArrays?.has(r);if(l&&t.subscript.type==="ArithVariable"&&!t.subscript.hasDollarPrefix)s=`${r}_${t.subscript.name}`;else if(l&&t.subscript.type==="ArithVariable"&&t.subscript.hasDollarPrefix){let c=await ve(e,t.subscript.name);s=`${r}_${c||"\\"}`}else if(l){let c=await te(e,t.subscript,n);s=`${r}_${c}`}else{let c=await te(e,t.subscript,n);if(c<0){let u=oe(e,r);u.length>0&&(c=Math.max(...u.map(([p])=>typeof p=="number"?p:0))+1+c)}s=`${r}_${c}`}}let i=Number.parseInt(e.state.env.get(s)||"0",10)||0,o=await te(e,t.value,n),a=K6(i,o,t.operator);return e.state.env.set(s,String(a)),a}case"ArithGroup":return await te(e,t.expression,n);case"ArithConcat":{let r="";for(let s of t.parts)r+=await Ts(e,s,n);return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)?await Cu(e,r):Number.parseInt(r,10)||0}case"ArithDynamicAssignment":{let r="";if(t.target.type==="ArithConcat")for(let l of t.target.parts)r+=await Ts(e,l,n);else t.target.type==="ArithVariable"&&(r=t.target.hasDollarPrefix?await ve(e,t.target.name):t.target.name);if(!r||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r))return 0;let s=r;if(t.subscript){let l=await te(e,t.subscript,n);s=`${r}_${l}`}let i=Number.parseInt(e.state.env.get(s)||"0",10)||0,o=await te(e,t.value,n),a=K6(i,o,t.operator);return e.state.env.set(s,String(a)),a}case"ArithDynamicElement":{let r="";if(t.nameExpr.type==="ArithConcat")for(let a of t.nameExpr.parts)r+=await Ts(e,a,n);else t.nameExpr.type==="ArithVariable"&&(r=t.nameExpr.hasDollarPrefix?await ve(e,t.nameExpr.name):t.nameExpr.name);if(!r||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r))return 0;let s=await te(e,t.subscript,n),i=`${r}_${s}`,o=e.state.env.get(i);return o!==void 0?CS(o):0}default:return 0}}async function Ts(e,t,n=!1){switch(t.type){case"ArithNumber":return String(t.value);case"ArithSingleQuote":return String(await te(e,t,n));case"ArithVariable":return t.hasDollarPrefix?await ve(e,t.name):t.name;case"ArithSpecialVar":return await ve(e,t.name);case"ArithBracedExpansion":return await la(e,t.content);case"ArithCommandSubst":return e.execFn?(await e.execFn(t.command,{signal:e.state.signal})).stdout.trim():"0";case"ArithConcat":{let r="";for(let s of t.parts)r+=await Ts(e,s,n);return r}default:return String(await te(e,t,n))}}var Ft=v(()=>{"use strict";Nt();ot();xe();Lt()});zs();an();var $c=[{name:"echo",load:async()=>(await Promise.resolve().then(()=>(Nf(),kf))).echoCommand},{name:"cat",load:async()=>(await Promise.resolve().then(()=>($f(),If))).catCommand},{name:"printf",load:async()=>(await Promise.resolve().then(()=>(Mf(),Lf))).printfCommand},{name:"ls",load:async()=>(await Promise.resolve().then(()=>(zf(),Wf))).lsCommand},{name:"mkdir",load:async()=>(await Promise.resolve().then(()=>(jf(),Hf))).mkdirCommand},{name:"rmdir",load:async()=>(await Promise.resolve().then(()=>(Zf(),qf))).rmdirCommand},{name:"touch",load:async()=>(await Promise.resolve().then(()=>(Qf(),Kf))).touchCommand},{name:"rm",load:async()=>(await Promise.resolve().then(()=>(Yf(),Xf))).rmCommand},{name:"cp",load:async()=>(await Promise.resolve().then(()=>(e1(),Jf))).cpCommand},{name:"mv",load:async()=>(await Promise.resolve().then(()=>(n1(),t1))).mvCommand},{name:"ln",load:async()=>(await Promise.resolve().then(()=>(s1(),r1))).lnCommand},{name:"chmod",load:async()=>(await Promise.resolve().then(()=>(a1(),o1))).chmodCommand},{name:"pwd",load:async()=>(await Promise.resolve().then(()=>(c1(),l1))).pwdCommand},{name:"readlink",load:async()=>(await Promise.resolve().then(()=>(f1(),u1))).readlinkCommand},{name:"head",load:async()=>(await Promise.resolve().then(()=>(m1(),d1))).headCommand},{name:"tail",load:async()=>(await Promise.resolve().then(()=>(y1(),g1))).tailCommand},{name:"wc",load:async()=>(await Promise.resolve().then(()=>(x1(),b1))).wcCommand},{name:"stat",load:async()=>(await Promise.resolve().then(()=>(A1(),E1))).statCommand},{name:"grep",load:async()=>(await Promise.resolve().then(()=>(Gi(),ji))).grepCommand},{name:"fgrep",load:async()=>(await Promise.resolve().then(()=>(Gi(),ji))).fgrepCommand},{name:"egrep",load:async()=>(await Promise.resolve().then(()=>(Gi(),ji))).egrepCommand},{name:"rg",load:async()=>(await Promise.resolve().then(()=>(mp(),dp))).rgCommand},{name:"sed",load:async()=>(await Promise.resolve().then(()=>(Np(),kp))).sedCommand},{name:"awk",load:async()=>(await Promise.resolve().then(()=>(oh(),ih))).awkCommand2},{name:"sort",load:async()=>(await Promise.resolve().then(()=>(gh(),mh))).sortCommand},{name:"uniq",load:async()=>(await Promise.resolve().then(()=>(wh(),yh))).uniqCommand},{name:"comm",load:async()=>(await Promise.resolve().then(()=>(xh(),bh))).commCommand},{name:"cut",load:async()=>(await Promise.resolve().then(()=>(Ah(),Eh))).cutCommand},{name:"paste",load:async()=>(await Promise.resolve().then(()=>(vh(),Ch))).pasteCommand},{name:"tr",load:async()=>(await Promise.resolve().then(()=>(Ih(),Nh))).trCommand},{name:"rev",load:async()=>(await Promise.resolve().then(()=>(Oh(),$h))).rev},{name:"nl",load:async()=>(await Promise.resolve().then(()=>(Ph(),Th))).nl},{name:"fold",load:async()=>(await Promise.resolve().then(()=>(Fh(),_h))).fold},{name:"expand",load:async()=>(await Promise.resolve().then(()=>(Uh(),Mh))).expand},{name:"unexpand",load:async()=>(await Promise.resolve().then(()=>(Hh(),zh))).unexpand},{name:"strings",load:async()=>(await Promise.resolve().then(()=>(qh(),Vh))).strings},{name:"split",load:async()=>(await Promise.resolve().then(()=>(Xh(),Qh))).split},{name:"column",load:async()=>(await Promise.resolve().then(()=>(ed(),Jh))).column},{name:"join",load:async()=>(await Promise.resolve().then(()=>(nd(),td))).join},{name:"tee",load:async()=>(await Promise.resolve().then(()=>(sd(),rd))).teeCommand},{name:"find",load:async()=>(await Promise.resolve().then(()=>(hd(),pd))).findCommand},{name:"basename",load:async()=>(await Promise.resolve().then(()=>(md(),dd))).basenameCommand},{name:"dirname",load:async()=>(await Promise.resolve().then(()=>(yd(),gd))).dirnameCommand},{name:"tree",load:async()=>(await Promise.resolve().then(()=>(xd(),bd))).treeCommand},{name:"du",load:async()=>(await Promise.resolve().then(()=>(Sd(),Ad))).duCommand},{name:"env",load:async()=>(await Promise.resolve().then(()=>(Ll(),Fl))).envCommand},{name:"printenv",load:async()=>(await Promise.resolve().then(()=>(Ll(),Fl))).printenvCommand},{name:"alias",load:async()=>(await Promise.resolve().then(()=>(Ul(),Ml))).aliasCommand},{name:"unalias",load:async()=>(await Promise.resolve().then(()=>(Ul(),Ml))).unaliasCommand},{name:"history",load:async()=>(await Promise.resolve().then(()=>(kd(),vd))).historyCommand},{name:"xargs",load:async()=>(await Promise.resolve().then(()=>(Id(),Nd))).xargsCommand},{name:"true",load:async()=>(await Promise.resolve().then(()=>(Wl(),Bl))).trueCommand},{name:"false",load:async()=>(await Promise.resolve().then(()=>(Wl(),Bl))).falseCommand},{name:"clear",load:async()=>(await Promise.resolve().then(()=>(Od(),$d))).clearCommand},{name:"bash",load:async()=>(await Promise.resolve().then(()=>(Hl(),zl))).bashCommand},{name:"sh",load:async()=>(await Promise.resolve().then(()=>(Hl(),zl))).shCommand},{name:"jq",load:async()=>(await Promise.resolve().then(()=>(sm(),rm))).jqCommand},{name:"base64",load:async()=>(await Promise.resolve().then(()=>(am(),om))).base64Command},{name:"diff",load:async()=>(await Promise.resolve().then(()=>(um(),cm))).diffCommand},{name:"date",load:async()=>(await Promise.resolve().then(()=>(pm(),fm))).dateCommand},{name:"sleep",load:async()=>(await Promise.resolve().then(()=>(mm(),dm))).sleepCommand},{name:"timeout",load:async()=>(await Promise.resolve().then(()=>(ym(),gm))).timeoutCommand},{name:"time",load:async()=>(await Promise.resolve().then(()=>(bm(),wm))).timeCommand},{name:"seq",load:async()=>(await Promise.resolve().then(()=>(Em(),xm))).seqCommand},{name:"expr",load:async()=>(await Promise.resolve().then(()=>(Sm(),Am))).exprCommand},{name:"md5sum",load:async()=>(await Promise.resolve().then(()=>(km(),vm))).md5sumCommand},{name:"sha1sum",load:async()=>(await Promise.resolve().then(()=>(Im(),Nm))).sha1sumCommand},{name:"sha256sum",load:async()=>(await Promise.resolve().then(()=>(Om(),$m))).sha256sumCommand},{name:"file",load:async()=>(await Promise.resolve().then(()=>(D0(),P0))).fileCommand},{name:"html-to-markdown",load:async()=>(await Promise.resolve().then(()=>(F0(),_0))).htmlToMarkdownCommand},{name:"help",load:async()=>(await Promise.resolve().then(()=>(M0(),L0))).helpCommand},{name:"which",load:async()=>(await Promise.resolve().then(()=>(B0(),U0))).whichCommand},{name:"tac",load:async()=>(await Promise.resolve().then(()=>(z0(),W0))).tac},{name:"hostname",load:async()=>(await Promise.resolve().then(()=>(j0(),H0))).hostname},{name:"whoami",load:async()=>(await Promise.resolve().then(()=>(V0(),G0))).whoami},{name:"od",load:async()=>(await Promise.resolve().then(()=>(Z0(),q0))).od},{name:"gzip",load:async()=>(await Promise.resolve().then(()=>(Fo(),_o))).gzipCommand},{name:"gunzip",load:async()=>(await Promise.resolve().then(()=>(Fo(),_o))).gunzipCommand},{name:"zcat",load:async()=>(await Promise.resolve().then(()=>(Fo(),_o))).zcatCommand}],qE=[],ZE=[],h2=[{name:"curl",load:async()=>(await Promise.resolve().then(()=>(f2(),u2))).curlCommand}],p2=new Map;function Uo(e){return{name:e.name,async execute(t,n){let r=p2.get(e.name);return r||(r=await wt.runTrustedAsync(()=>e.load()),p2.set(e.name,r)),n.coverage,r.execute(t,n)}}}function KE(){return $c.map(e=>e.name)}function QE(){return h2.map(e=>e.name)}function d2(e){return(e?$c.filter(n=>e.includes(n.name)):$c).map(Uo)}function m2(){return h2.map(Uo)}function g2(){return qE.map(Uo)}function y2(){return ZE.map(Uo)}function w2(e){return"load"in e&&typeof e.load=="function"}function XE(e,t){return{name:e,trusted:!0,execute:t}}function b2(e){let t=null;return{name:e.name,trusted:!0,async execute(n,r){return t||(t=await e.load()),t.execute(n,r)}}}Sc();function Se(e){if(!e||e==="/")return"/";let t=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;t.startsWith("/")||(t=`/${t}`);let n=t.split("/").filter(s=>s&&s!=="."),r=[];for(let s of n)s===".."?r.pop():r.push(s);return`/${r.join("/")}`||"/"}function it(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}function Bo(e){let t=Se(e);if(t==="/")return"/";let n=t.lastIndexOf("/");return n===0?"/":t.slice(0,n)}function Wo(e,t){if(t.startsWith("/"))return Se(t);let n=e==="/"?`/${t}`:`${e}/${t}`;return Se(n)}function cr(e,t){return e==="/"?`/${t}`:`${e}/${t}`}function zo(e,t){if(t.startsWith("/"))return Se(t);let n=Bo(e);return Se(cr(n,t))}var Cs=new TextEncoder;function JE(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}var Yn=class{data=new Map;constructor(t){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),t)for(let[n,r]of Object.entries(t))typeof r=="function"?this.writeFileLazy(n,r):JE(r)?this.writeFileSync(n,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(n,r)}ensureParentDirs(t){let n=Bo(t);n!=="/"&&(this.data.has(n)||(this.ensureParentDirs(n),this.data.set(n,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(t,n,r,s){it(t,"write");let i=Se(t);this.ensureParentDirs(i);let o=Mo(r),a=Ac(n,o);this.data.set(i,{type:"file",content:a,mode:s?.mode??420,mtime:s?.mtime??new Date})}writeFileLazy(t,n,r){it(t,"write");let s=Se(t);this.ensureParentDirs(s),this.data.set(s,{type:"file",lazy:n,mode:r?.mode??420,mtime:r?.mtime??new Date})}async materializeLazy(t,n){let r=await n.lazy(),i={type:"file",content:typeof r=="string"?Cs.encode(r):r,mode:n.mode,mtime:n.mtime};return this.data.set(t,i),i}async readFile(t,n){let r=await this.readFileBuffer(t),s=Mo(n);return Lo(r,s)}async readFileBuffer(t){it(t,"open");let n=this.resolvePathWithSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);if("lazy"in r){let s=await this.materializeLazy(n,r);return s.content instanceof Uint8Array?s.content:Cs.encode(s.content)}return r.content instanceof Uint8Array?r.content:Cs.encode(r.content)}async writeFile(t,n,r){this.writeFileSync(t,n,r)}async appendFile(t,n,r){it(t,"append");let s=Se(t),i=this.data.get(s);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${t}'`);let o=Mo(r),a=Ac(n,o);if(i?.type==="file"){let l=i;"lazy"in l&&(l=await this.materializeLazy(s,l));let c="content"in l&&l.content instanceof Uint8Array?l.content:Cs.encode("content"in l?l.content:""),u=new Uint8Array(c.length+a.length);u.set(c),u.set(a,c.length),this.data.set(s,{type:"file",content:u,mode:l.mode,mtime:new Date})}else this.writeFileSync(t,n,r)}async exists(t){if(t.includes("\0"))return!1;try{let n=this.resolvePathWithSymlinks(t);return this.data.has(n)}catch{return!1}}async stat(t){it(t,"stat");let n=this.resolvePathWithSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(n,r));let s=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=Cs.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}async lstat(t){it(t,"lstat");let n=this.resolveIntermediateSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(n,r));let s=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=Cs.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}resolveIntermediateSymlinks(t){let n=Se(t);if(n==="/")return"/";let r=n.slice(1).split("/");if(r.length<=1)return n;let s="",i=new Set;for(let o=0;o<r.length-1;o++){let a=r[o];s=`${s}/${a}`;let l=this.data.get(s),c=0,u=40;for(;l&&l.type==="symlink"&&c<u;){if(i.has(s))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(s),s=zo(s,l.target),l=this.data.get(s),c++}if(c>=u)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`)}return`${s}/${r[r.length-1]}`}resolvePathWithSymlinks(t){let n=Se(t);if(n==="/")return"/";let r=n.slice(1).split("/"),s="",i=new Set;for(let o of r){s=`${s}/${o}`;let a=this.data.get(s),l=0,c=40;for(;a&&a.type==="symlink"&&l<c;){if(i.has(s))throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`);i.add(s),s=zo(s,a.target),a=this.data.get(s),l++}if(l>=c)throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`)}return s}async mkdir(t,n){this.mkdirSync(t,n)}mkdirSync(t,n){it(t,"mkdir");let r=Se(t);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(!n?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${t}'`);return}let s=Bo(r);if(s!=="/"&&!this.data.has(s))if(n?.recursive)this.mkdirSync(s,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(t){return(await this.readdirWithFileTypes(t)).map(r=>r.name)}async readdirWithFileTypes(t){it(t,"scandir");let n=Se(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let s=new Set;for(;r&&r.type==="symlink";){if(s.has(n))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);s.add(n),n=zo(n,r.target),r=this.data.get(n)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let i=n==="/"?"/":`${n}/`,o=new Map;for(let[a,l]of this.data.entries())if(a!==n&&a.startsWith(i)){let c=a.slice(i.length),u=c.split("/")[0];u&&!c.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,n){it(t,"rm");let r=Se(t),s=this.data.get(r);if(!s){if(n?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}if(s.type==="directory"){let i=await this.readdir(r);if(i.length>0){if(!n?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let o of i){let a=cr(r,o);await this.rm(a,n)}}}this.data.delete(r)}async cp(t,n,r){it(t,"cp"),it(n,"cp");let s=Se(t),i=Se(n),o=this.data.get(s);if(!o)throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(o.type==="file")if(this.ensureParentDirs(i),"content"in o){let a=o.content instanceof Uint8Array?new Uint8Array(o.content):o.content;this.data.set(i,{...o,content:a})}else this.data.set(i,{...o});else if(o.type==="symlink")this.ensureParentDirs(i),this.data.set(i,{...o});else if(o.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);await this.mkdir(i,{recursive:!0});let a=await this.readdir(s);for(let l of a){let c=cr(s,l),u=cr(i,l);await this.cp(c,u,r)}}}async mv(t,n){await this.cp(t,n,{recursive:!0}),await this.rm(t,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(t,n){return Wo(t,n)}async chmod(t,n){it(t,"chmod");let r=Se(t),s=this.data.get(r);if(!s)throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);s.mode=n}async symlink(t,n){it(n,"symlink");let r=Se(n);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${n}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:t,mode:511,mtime:new Date})}async link(t,n){it(t,"link"),it(n,"link");let r=Se(t),s=Se(n),i=this.data.get(r);if(!i)throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${t}'`);if(this.data.has(s))throw new Error(`EEXIST: file already exists, link '${n}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(r,o)),this.ensureParentDirs(s),this.data.set(s,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(t){it(t,"readlink");let n=Se(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return r.target}async realpath(t){it(t,"realpath");let n=this.resolvePathWithSymlinks(t);if(!this.data.has(n))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return n}async utimes(t,n,r){it(t,"utimes");let s=Se(t),i=this.resolvePathWithSymlinks(s),o=this.data.get(i);if(!o)throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);o.mtime=r}};Rc();function eA(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function tA(e,t){e.mkdirSync("/bin",{recursive:!0}),e.mkdirSync("/usr/bin",{recursive:!0}),t&&(e.mkdirSync("/home/user",{recursive:!0}),e.mkdirSync("/tmp",{recursive:!0}))}function nA(e){e.mkdirSync("/dev",{recursive:!0}),e.writeFileSync("/dev/null",""),e.writeFileSync("/dev/zero",new Uint8Array(0)),e.writeFileSync("/dev/stdin",""),e.writeFileSync("/dev/stdout",""),e.writeFileSync("/dev/stderr","")}function rA(e,t){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${S2}
|
|
793
|
+
`),e.writeFileSync("/proc/self/exe","/bin/bash"),e.writeFileSync("/proc/self/cmdline","bash\0"),e.writeFileSync("/proc/self/comm",`bash
|
|
794
|
+
`),e.writeFileLazy?e.writeFileLazy("/proc/self/status",()=>Oc(t)):e.writeFileSync("/proc/self/status",Oc(t)),e.writeFileSync("/proc/self/fd/0","/dev/stdin"),e.writeFileSync("/proc/self/fd/1","/dev/stdout"),e.writeFileSync("/proc/self/fd/2","/dev/stderr")}function C2(e,t,n={pid:1,ppid:0,uid:1e3,gid:1e3}){eA(e)&&(tA(e,t),nA(e),rA(e,n))}yn();Kn();xe();var sA=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],iA=["braceexpand","hashall","interactive-comments"];function Tc(e){let t=[],n=[...iA.map(r=>({name:r,enabled:!0})),...sA.map(r=>({name:r,enabled:e[r]}))].sort((r,s)=>r.name.localeCompare(s.name));for(let r of n)r.enabled&&t.push(r.name);return t.join(":")}function vs(e){e.state.env.set("SHELLOPTS",Tc(e.state.options))}var oA=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function Pc(e){let t=[];for(let n of oA)e[n]&&t.push(n);return t.join(":")}function Dc(e){e.state.env.set("BASHOPTS",Pc(e.state.shoptOptions))}Kn();Br();an();ot();Br();var FA="BASH_ALIAS_";function dg(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function mg(e){if(e.parts.length!==1)return null;let t=e.parts[0];return t.type==="Literal"?t.value:null}function gg(e,t){return e.env.get(`${FA}${t}`)}function nu(e,t,n){if(!t.name||!dg(t.name))return t;let r=mg(t.name);if(!r)return t;let s=gg(e,r);if(!s||n.has(r))return t;try{n.add(r);let i=new ce,o=s,a=s.endsWith(" ");if(!a)for(let f of t.args){let p=wg(f);o+=` ${p}`}let l;try{l=i.parse(o)}catch(f){if(f instanceof bt)throw f;return t}if(l.statements.length!==1||l.statements[0].pipelines.length!==1||l.statements[0].pipelines[0].commands.length!==1)return yg(t,s);let c=l.statements[0].pipelines[0].commands[0];if(c.type!=="SimpleCommand")return yg(t,s);let u={...c,assignments:[...t.assignments,...c.assignments],redirections:[...c.redirections,...t.redirections],line:t.line};if(a&&t.args.length>0&&(u={...u,args:[...u.args,...t.args]},u.args.length>0)){let f=u.args[0];if(dg(f)){let p=mg(f);if(p&&gg(e,p)){let h={type:"SimpleCommand",name:f,args:u.args.slice(1),assignments:[],redirections:[]},d=nu(e,h,n);d!==h&&(u={...u,name:d.name,args:[...d.args]})}}}return u}catch(i){throw n.delete(r),i}}function yg(e,t){let n=t;for(let o of e.args){let a=wg(o);n+=` ${a}`}let r=new ce,s=r.parseWordFromString("eval",!1,!1),i=r.parseWordFromString(`'${n.replace(/'/g,"'\\''")}'`,!1,!1);return{type:"SimpleCommand",name:s,args:[i],assignments:e.assignments,redirections:e.redirections,line:e.line}}function wg(e){let t="";for(let n of e.parts)switch(n.type){case"Literal":t+=n.value.replace(/([\s"'$`\\*?[\]{}()<>|&;#!])/g,"\\$1");break;case"SingleQuoted":t+=`'${n.value}'`;break;case"DoubleQuoted":t+=`"${n.parts.map(r=>r.type==="Literal"?r.value:`$${r.type}`).join("")}"`;break;case"ParameterExpansion":t+=`\${${n.parameter}}`;break;case"CommandSubstitution":t+="$(...)";break;case"ArithmeticExpansion":t+=`$((${n.expression}))`;break;case"Glob":t+=n.pattern;break;default:break}return t}Ft();Lt();dn();async function Q6(e,t){let n=t.parts.map(u=>u.type==="Literal"?u.value:"\0").join(""),r=n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);if(!r||!n.endsWith(")"))return null;let s=r[1],i=[],o=!1,a="",l=!1;for(let u of t.parts)if(u.type==="Literal"){let f=u.value;if(!o){let p=f.indexOf("=(");p!==-1&&(o=!0,f=f.slice(p+2))}if(o){f.endsWith(")")&&(f=f.slice(0,-1));let p=f.split(/(\s+)/);for(let h of p)/^\s+$/.test(h)?(a||l)&&(i.push(a),a="",l=!1):h&&(a+=h)}}else if(o)if(u.type==="BraceExpansion")if(/^\[.+\]=/.test(a))a+=ks({type:"Word",parts:[u]});else{(a||l)&&(i.push(a),a="",l=!1);let p=await In(e,{type:"Word",parts:[u]});i.push(...p.values)}else{(u.type==="SingleQuoted"||u.type==="DoubleQuoted"||u.type==="Escaped")&&(l=!0);let f=await se(e,{type:"Word",parts:[u]});a+=f}(a||l)&&i.push(a);let c=i.map(u=>/^\[.+\]=/.test(u)?u:u===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(u)&&!u.startsWith("'")&&!u.startsWith('"')?`'${u.replace(/'/g,"'\\''")}'`:u);return`${s}=(${c.join(" ")})`}async function X6(e,t){let n=-1,r=-1,s=!1;for(let m=0;m<t.parts.length;m++){let g=t.parts[m];if(g.type==="Literal"){let y=g.value.indexOf("+=");if(y!==-1){let b=g.value.slice(0,y);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(b)){n=m,r=y,s=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(b)){n=m,r=y,s=!0;break}}let w=g.value.indexOf("=");if(w!==-1&&(w===0||g.value[w-1]!=="+")){let b=g.value.slice(0,w);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(b)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(b)){n=m,r=w;break}}}}if(n===-1)return null;let i=t.parts.slice(0,n),o=t.parts[n];if(o.type!=="Literal")return null;let a=s?2:1,l=o.value.slice(0,r),c=o.value.slice(r+a),u=t.parts.slice(n+1),f="";for(let m of i)f+=await se(e,{type:"Word",parts:[m]});f+=l;let p={type:"Word",parts:c!==""?[{type:"Literal",value:c},...u]:u},h=p.parts.length>0?await se(e,p):"";return`${f}${s?"+=":"="}${h}`}var vS=["tar","yq","xan","sqlite3","python3","python"];function Y6(e){return vS.includes(e)}yn();Fn();an();xe();xe();var ye=Object.freeze({stdout:"",stderr:"",exitCode:0});function be(e=""){return{stdout:e,stderr:"",exitCode:0}}function z(e,t=1){return{stdout:"",stderr:e,exitCode:t}}function H(e,t,n){return{stdout:e,stderr:t,exitCode:n}}function lt(e){return{stdout:"",stderr:"",exitCode:e?0:1}}function jn(e,t,n="",r=""){throw new Q(e,t,n,r)}function It(e){let t=e.state.fileDescriptors;if(t&&t.size>=e.limits.maxFileDescriptors)throw new Q(`too many open file descriptors (max ${e.limits.maxFileDescriptors})`,"file_descriptors")}function vu(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Tn;return ye}if(t.length>1)throw new ge(1,"",`bash: break: too many arguments
|
|
795
|
+
`);let n=1;if(t.length>0){let r=Number.parseInt(t[0],10);if(Number.isNaN(r)||r<1)throw new ge(128,"",`bash: break: ${t[0]}: numeric argument required
|
|
796
|
+
`);n=r}throw new vt(n)}async function ku(e,t){let n,r=!1,s=!1,i=0;for(;i<t.length;)if(t[i]==="--"){i++;break}else if(t[i]==="-L")s=!1,i++;else if(t[i]==="-P")s=!0,i++;else if(t[i].startsWith("-")&&t[i]!=="-")i++;else break;let o=t.slice(i);if(o.length===0||o[0]==="~"?n=e.state.env.get("HOME")||"/":o[0]==="-"?(n=e.state.previousDir,r=!0):n=o[0],!n.startsWith("/")&&!n.startsWith("./")&&!n.startsWith("../")&&n!=="."&&n!==".."){let f=e.state.env.get("CDPATH");if(f){let p=f.split(":").filter(h=>h);for(let h of p){let d=h.startsWith("/")?`${h}/${n}`:`${e.state.cwd}/${h}/${n}`;try{if((await e.fs.stat(d)).isDirectory){n=d,r=!0;break}}catch{}}}}let l=(n.startsWith("/")?n:`${e.state.cwd}/${n}`).split("/").filter(f=>f&&f!=="."),c="";for(let f of l)if(f==="..")c=c.split("/").slice(0,-1).join("/")||"/";else{c=c?`${c}/${f}`:`/${f}`;try{if(!(await e.fs.stat(c)).isDirectory)return z(`bash: cd: ${n}: Not a directory
|
|
797
|
+
`)}catch{return z(`bash: cd: ${n}: No such file or directory
|
|
798
|
+
`)}}let u=c||"/";if(s)try{u=await e.fs.realpath(u)}catch{}return e.state.previousDir=e.state.cwd,e.state.cwd=u,e.state.env.set("PWD",e.state.cwd),e.state.env.set("OLDPWD",e.state.previousDir),be(r?`${u}
|
|
799
|
+
`:"")}ot();Nt();ot();Ve();Ft();Lt();dn();function Nu(e,t){return e.fs.resolvePath(e.state.cwd,t)}var kS=["-e","-a","-f","-d","-r","-w","-x","-s","-L","-h","-k","-g","-u","-G","-O","-b","-c","-p","-S","-t","-N"];function ca(e){return kS.includes(e)}async function ua(e,t,n){let r=Nu(e,n);switch(t){case"-e":case"-a":return e.fs.exists(r);case"-f":return await e.fs.exists(r)?(await e.fs.stat(r)).isFile:!1;case"-d":return await e.fs.exists(r)?(await e.fs.stat(r)).isDirectory:!1;case"-r":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&256)!==0:!1;case"-w":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&128)!==0:!1;case"-x":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&64)!==0:!1;case"-s":return await e.fs.exists(r)?(await e.fs.stat(r)).size>0:!1;case"-L":case"-h":try{return(await e.fs.lstat(r)).isSymbolicLink}catch{return!1}case"-k":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&512)!==0:!1;case"-g":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&1024)!==0:!1;case"-u":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&2048)!==0:!1;case"-G":case"-O":return e.fs.exists(r);case"-b":return!1;case"-c":return["/dev/null","/dev/zero","/dev/random","/dev/urandom","/dev/tty","/dev/stdin","/dev/stdout","/dev/stderr"].includes(r);case"-p":return!1;case"-S":return!1;case"-t":return!1;case"-N":return e.fs.exists(r);default:return!1}}var NS=["-nt","-ot","-ef"];function fa(e){return NS.includes(e)}async function pa(e,t,n,r){let s=Nu(e,n),i=Nu(e,r);switch(t){case"-nt":try{let o=await e.fs.stat(s),a=await e.fs.stat(i);return o.mtime>a.mtime}catch{return!1}case"-ot":try{let o=await e.fs.stat(s),a=await e.fs.stat(i);return o.mtime<a.mtime}catch{return!1}case"-ef":try{if(!await e.fs.exists(s)||!await e.fs.exists(i))return!1;let o=e.fs.resolvePath(e.state.cwd,s),a=e.fs.resolvePath(e.state.cwd,i);return o===a}catch{return!1}default:return!1}}var IS=new Set(["-eq","-ne","-lt","-le","-gt","-ge"]);function ha(e){return IS.has(e)}function da(e,t,n){switch(e){case"-eq":return t===n;case"-ne":return t!==n;case"-lt":return t<n;case"-le":return t<=n;case"-gt":return t>n;case"-ge":return t>=n}}function Ai(e){return e==="="||e==="=="||e==="!="}function ma(e,t,n,r=!1,s=!1,i=!1){if(r){let a=Ps(t,n,s,i);return e==="!="?!a:a}if(s){let a=t.toLowerCase()===n.toLowerCase();return e==="!="?!a:a}let o=t===n;return e==="!="?!o:o}var $S=new Set(["-z","-n"]);function ga(e){return $S.has(e)}function ya(e,t){switch(e){case"-z":return t==="";case"-n":return t!==""}}Nt();ot();Ft();dn();async function wa(e,t){let n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let r=n[1],s=n[2];if(e.state.associativeArrays?.has(r)){let a=s;return(a.startsWith("'")&&a.endsWith("'")||a.startsWith('"')&&a.endsWith('"'))&&(a=a.slice(1,-1)),a=a.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(l,c)=>e.state.env.get(c)||""),e.state.env.has(`${r}_${a}`)}let o;try{let a=new ce,l=Ce(a,s);o=await te(e,l.expression)}catch{if(/^-?\d+$/.test(s))o=Number.parseInt(s,10);else{let a=e.state.env.get(s);o=a?Number.parseInt(a,10):0}}if(o<0){let a=at(e,r),l=e.state.currentLine;if(a.length===0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${l}: ${r}: bad array subscript
|
|
800
|
+
`,!1;if(o=Math.max(...a)+1+o,o<0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${l}: ${r}: bad array subscript
|
|
801
|
+
`,!1}return e.state.env.has(`${r}_${o}`)}return e.state.env.has(t)?!0:e.state.associativeArrays?.has(t)?Cn(e,t).length>0:at(e,t).length>0}async function br(e,t){switch(t.type){case"CondBinary":{let n=await se(e,t.left),r=t.right.parts.length>0&&t.right.parts.every(i=>i.type==="SingleQuoted"||i.type==="DoubleQuoted"||i.type==="Escaped"&&t.operator!=="=~"),s;if(t.operator==="=~")if(r){let i=await se(e,t.right);s=Ns(i)}else s=await bu(e,t.right);else Ai(t.operator)&&!r?s=await xu(e,t.right):s=await se(e,t.right);if(Ai(t.operator)){let i=e.state.shoptOptions.nocasematch;return ma(t.operator,n,s,!r,i,!0)}if(ha(t.operator))return da(t.operator,await ey(e,n),await ey(e,s));if(fa(t.operator))return pa(e,t.operator,n,s);switch(t.operator){case"=~":try{let i=e.state.shoptOptions.nocasematch,o=PS(s),l=K(o,i?"i":"").match(n);if(Bn(e,"BASH_REMATCH"),l)for(let c=0;c<l.length;c++)e.state.env.set(`BASH_REMATCH_${c}`,l[c]||"");return l!==null}catch{throw new Error("syntax error in regular expression")}case"<":return n<s;case">":return n>s;default:return!1}}case"CondUnary":{let n=await se(e,t.operand);return ca(t.operator)?ua(e,t.operator,n):ga(t.operator)?ya(t.operator,n):t.operator==="-v"?await wa(e,n):t.operator==="-o"?$u(e,n):!1}case"CondNot":return e.state.shoptOptions.extglob&&t.operand.type==="CondGroup"&&t.operand.expression.type==="CondWord"?`!(${await se(e,t.operand.expression.word)})`!=="":!await br(e,t.operand);case"CondAnd":return await br(e,t.left)?await br(e,t.right):!1;case"CondOr":return await br(e,t.left)?!0:await br(e,t.right);case"CondGroup":return await br(e,t.expression);case"CondWord":return await se(e,t.word)!=="";default:return!1}}async function Si(e,t){if(t.length===0)return H("","",1);if(t.length===1)return lt(!!t[0]);if(t.length===2){let r=t[0],s=t[1];return r==="("?z(`test: '(' without matching ')'
|
|
802
|
+
`,2):ca(r)?lt(await ua(e,r,s)):ga(r)?lt(ya(r,s)):r==="!"?lt(!s):r==="-v"?lt(await wa(e,s)):r==="-o"?lt($u(e,s)):r==="="||r==="=="||r==="!="||r==="<"||r===">"||r==="-eq"||r==="-ne"||r==="-lt"||r==="-le"||r==="-gt"||r==="-ge"||r==="-nt"||r==="-ot"||r==="-ef"?z(`test: ${r}: unary operator expected
|
|
803
|
+
`,2):H("","",1)}if(t.length===3){let r=t[0],s=t[1],i=t[2];if(Ai(s))return lt(ma(s,r,i));if(ha(s)){let o=ba(r),a=ba(i);return!o.valid||!a.valid?H("","",2):lt(da(s,o.value,a.value))}if(fa(s))return lt(await pa(e,s,r,i));switch(s){case"-a":return lt(r!==""&&i!=="");case"-o":return lt(r!==""||i!=="");case">":return lt(r>i);case"<":return lt(r<i)}if(r==="!"){let o=await Si(e,[s,i]);return H("",o.stderr,o.exitCode===0?1:o.exitCode===1?0:o.exitCode)}if(r==="("&&i===")")return lt(s!=="")}if(t.length===4){if(t[0]==="!"){let r=await Si(e,t.slice(1));return H("",r.stderr,r.exitCode===0?1:r.exitCode===1?0:r.exitCode)}if(t[0]==="("&&t[3]===")")return Si(e,[t[1],t[2]])}let n=await ny(e,t,0);return n.pos<t.length?z(`test: too many arguments
|
|
804
|
+
`,2):lt(n.value)}async function ny(e,t,n){return OS(e,t,n)}async function OS(e,t,n){let{value:r,pos:s}=await J6(e,t,n);for(;t[s]==="-o";){let i=await J6(e,t,s+1);r=r||i.value,s=i.pos}return{value:r,pos:s}}async function J6(e,t,n){let{value:r,pos:s}=await Iu(e,t,n);for(;t[s]==="-a";){let i=await Iu(e,t,s+1);r=r&&i.value,s=i.pos}return{value:r,pos:s}}async function Iu(e,t,n){if(t[n]==="!"){let{value:r,pos:s}=await Iu(e,t,n+1);return{value:!r,pos:s}}return RS(e,t,n)}async function RS(e,t,n){let r=t[n];if(r==="("){let{value:i,pos:o}=await ny(e,t,n+1);return{value:i,pos:t[o]===")"?o+1:o}}let s=t[n+1];if(Ai(s)){let i=r,o=t[n+2]??"";return{value:ma(s,i,o),pos:n+3}}if(ha(s)){let i=ba(r),o=ba(t[n+2]??"0");return!i.valid||!o.valid?{value:!1,pos:n+3}:{value:da(s,i.value,o.value),pos:n+3}}if(fa(s)){let i=r,o=t[n+2]??"";return{value:await pa(e,s,i,o),pos:n+3}}if(ca(r)){let i=t[n+1]??"";return{value:await ua(e,r,i),pos:n+2}}if(ga(r)){let i=t[n+1]??"";return{value:ya(r,i),pos:n+2}}if(r==="-v"){let i=t[n+1]??"";return{value:await wa(e,i),pos:n+2}}if(r==="-o"){let i=t[n+1]??"";return{value:$u(e,i),pos:n+2}}return{value:r!==void 0&&r!=="",pos:n+1}}function Ps(e,t,n=!1,r=!1){let s=`^${ry(t,r)}$`;return K(s,n?"is":"s").test(e)}function ry(e,t){let n="";for(let r=0;r<e.length;r++){let s=e[r];if(t&&(s==="@"||s==="*"||s==="+"||s==="?"||s==="!")&&r+1<e.length&&e[r+1]==="("){let i=sy(e,r+1);if(i!==-1){let o=e.slice(r+2,i),a=iy(o),l=a.map(u=>ry(u,t)),c=l.length>0?l.join("|"):"(?:)";if(s==="@")n+=`(?:${c})`;else if(s==="*")n+=`(?:${c})*`;else if(s==="+")n+=`(?:${c})+`;else if(s==="?")n+=`(?:${c})?`;else if(s==="!")if(i<e.length-1){let f=a.map(h=>oy(h,t));if(f.every(h=>h!==null)&&f.every(h=>h===f[0])&&f[0]!==null){let h=f[0];if(h===0)n+="(?:.+)";else{let d=[];h>0&&d.push(`.{0,${h-1}}`),d.push(`.{${h+1},}`),d.push(`(?!(?:${c})).{${h}}`),n+=`(?:${d.join("|")})`}}else n+=`(?:(?!(?:${c})).)*?`}else n+=`(?!(?:${c})$).*`;r=i;continue}}if(s==="\\")if(r+1<e.length){let i=e[r+1];/[\\^$.|+(){}[\]*?]/.test(i)?n+=`\\${i}`:n+=i,r++}else n+="\\\\";else if(s==="*")n+=".*";else if(s==="?")n+=".";else if(s==="["){let i=e.indexOf("]",r+1);i!==-1?(n+=e.slice(r,i+1),r=i):n+="\\["}else/[\\^$.|+(){}]/.test(s)?n+=`\\${s}`:n+=s}return n}function sy(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let s=e[r];if(s==="\\"){r+=2;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function iy(e){let t=[],n="",r=0,s=0;for(;s<e.length;){let i=e[s];if(i==="\\"){n+=i,s+1<e.length?(n+=e[s+1],s+=2):s++;continue}i==="("?(r++,n+=i):i===")"?(r--,n+=i):i==="|"&&r===0?(t.push(n),n=""):n+=i,s++}return t.push(n),t}function oy(e,t){let n=0,r=0;for(;r<e.length;){let s=e[r];if(t&&(s==="@"||s==="*"||s==="+"||s==="?"||s==="!")&&r+1<e.length&&e[r+1]==="("){let i=sy(e,r+1);if(i!==-1){if(s==="@"){let o=e.slice(r+2,i),l=iy(o).map(c=>oy(c,t));if(l.every(c=>c!==null)&&l.every(c=>c===l[0])){n+=l[0],r=i+1;continue}return null}return null}}if(s==="*")return null;if(s==="?"){n+=1,r++;continue}if(s==="["){let i=e.indexOf("]",r+1);if(i!==-1){n+=1,r=i+1;continue}n+=1,r++;continue}if(s==="\\"){n+=1,r+=2;continue}n+=1,r++}return n}function $u(e,t){let r=new Map([["errexit",()=>e.state.options.errexit===!0],["nounset",()=>e.state.options.nounset===!0],["pipefail",()=>e.state.options.pipefail===!0],["xtrace",()=>e.state.options.xtrace===!0],["e",()=>e.state.options.errexit===!0],["u",()=>e.state.options.nounset===!0],["x",()=>e.state.options.xtrace===!0]]).get(t);return r?r():!1}async function ey(e,t){if(t=t.trim(),t==="")return 0;if(/^[+-]?(\d+#[a-zA-Z0-9@_]+|0[xX][0-9a-fA-F]+|0[0-7]+|\d+)$/.test(t))return ty(t);try{let n=new ce,r=Ce(n,t);return await te(e,r.expression)}catch{return ty(t)}}function TS(e,t){let n=0;for(let r of e){let s;if(r>="0"&&r<="9")s=r.charCodeAt(0)-48;else if(r>="a"&&r<="z")s=r.charCodeAt(0)-97+10;else if(r>="A"&&r<="Z")s=r.charCodeAt(0)-65+36;else if(r==="@")s=62;else if(r==="_")s=63;else return Number.NaN;if(s>=t)return Number.NaN;n=n*t+s}return n}function ty(e){if(e=e.trim(),e==="")return 0;let t=!1;e.startsWith("-")?(t=!0,e=e.slice(1)):e.startsWith("+")&&(e=e.slice(1));let n,r=e.match(/^(\d+)#([a-zA-Z0-9@_]+)$/);if(r){let s=Number.parseInt(r[1],10);s>=2&&s<=64?n=TS(r[2],s):n=0}else/^0[xX][0-9a-fA-F]+$/.test(e)?n=Number.parseInt(e,16):/^0[0-7]+$/.test(e)?n=Number.parseInt(e,8):n=Number.parseInt(e,10);return Number.isNaN(n)&&(n=0),t?-n:n}function ba(e){if(e=e.trim(),e==="")return{value:0,valid:!0};let t=!1;if(e.startsWith("-")?(t=!0,e=e.slice(1)):e.startsWith("+")&&(e=e.slice(1)),!/^\d+$/.test(e))return{value:0,valid:!1};let n=Number.parseInt(e,10);return Number.isNaN(n)?{value:0,valid:!1}:{value:t?-n:n,valid:!0}}function PS(e){let t="",n=0;for(;n<e.length;)if(e[n]==="\\"&&n+1<e.length)t+=e[n]+e[n+1],n+=2;else if(e[n]==="["){let r=DS(e,n);t+=r.converted,n=r.endIndex}else t+=e[n],n++;return t}function DS(e,t){let n=t+1,r="[";n<e.length&&(e[n]==="^"||e[n]==="!")&&(r+="^",n++);let s=!1;n<e.length&&e[n]==="]"&&(s=!0,n++);let i=!1;n<e.length&&e[n]==="["&&n+1<e.length&&e[n+1]!==":"&&(i=!0,n++);let o="",a=!1;for(;n<e.length;){let l=e[n];if(l==="]"){a=!0,n++;break}if(l==="["&&n+1<e.length&&e[n+1]===":"){let c=e.indexOf(":]",n+2);if(c!==-1){let u=e.slice(n+2,c);o+=_S(u),n=c+2;continue}}if(l==="["&&n+1<e.length){let c=e[n+1];if(c==="."||c==="="){let u=`${c}]`,f=e.indexOf(u,n+2);if(f!==-1){let p=e.slice(n+2,f);o+=p,n=f+2;continue}}}if(l==="\\"&&n+1<e.length){o+=l+e[n+1],n+=2;continue}o+=l,n++}return a?(s&&(r+="\\]"),i&&(r+="\\["),r+=o,r+="]",{converted:r,endIndex:n}):{converted:"\\[",endIndex:t+1}}function _S(e){return new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]).get(e)??""}Lt();Nt();ot();Ft();gr();function Gn(e){let t=[],n="",r=!1,s=!1,i=!1,o=!1;for(let a of e){if(i){n+=a,i=!1,o=!0;continue}if(a==="\\"){i=!0;continue}if(a==="'"&&!s){r||(o=!0),r=!r;continue}if(a==='"'&&!r){s||(o=!0),s=!s;continue}if((a===" "||a===" "||a===`
|
|
805
|
+
`)&&!r&&!s){o&&(t.push(n),n="",o=!1);continue}n+=a,o=!0}return o&&t.push(n),t}function xa(e){let t=[],n=0;for(;n<e.length;){for(;n<e.length&&/\s/.test(e[n]);)n++;if(n>=e.length)break;if(e[n]!=="["){n++;continue}n++;let r="";if(e[n]==="'"||e[n]==='"'){let i=e[n];for(n++;n<e.length&&e[n]!==i;)r+=e[n],n++;e[n]===i&&n++}else for(;n<e.length&&e[n]!=="]"&&e[n]!=="=";)r+=e[n],n++;for(;n<e.length&&e[n]!=="]";)n++;if(e[n]==="]"&&n++,e[n]!=="=")continue;n++;let s="";if(e[n]==="'"||e[n]==='"'){let i=e[n];for(n++;n<e.length&&e[n]!==i;)e[n]==="\\"&&n+1<e.length&&n++,s+=e[n],n++;e[n]===i&&n++}else for(;n<e.length&&!/\s/.test(e[n]);)s+=e[n],n++;t.push([r,s])}return t}function ay(e){let t=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(t)return{name:t[1],isArray:!0,arrayElements:Gn(t[2])};let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([^\]]+)\]=(.*)$/s);if(n)return{name:n[1],isArray:!1,arrayIndex:n[2],value:n[3]};if(e.includes("=")){let r=e.indexOf("=");return{name:e.slice(0,r),isArray:!1,value:e.slice(r+1)}}return{name:e,isArray:!1}}async function FS(e,t){try{let n=new ce,r=Ce(n,t);return await te(e,r.expression)}catch{let n=parseInt(t,10);return Number.isNaN(n)?0:n}}async function ly(e,t,n={}){let{name:r,isArray:s,arrayElements:i,value:o,arrayIndex:a}=t,{makeReadonly:l=!1,checkReadonly:c=!0}=n;if(c){let u=gt(e,r);if(u)return u}if(s&&i){for(let u=0;u<i.length;u++)e.state.env.set(`${r}_${u}`,i[u]);e.state.env.set(`${r}__length`,String(i.length))}else if(a!==void 0&&o!==void 0){let u=await FS(e,a);e.state.env.set(`${r}_${u}`,o);let f=parseInt(e.state.env.get(`${r}__length`)??"0",10);u>=f&&e.state.env.set(`${r}__length`,String(u+1))}else o!==void 0&&e.state.env.set(r,o);return l&&Qt(e,r),null}function xr(e,t){e.state.localVarDepth=e.state.localVarDepth||new Map,e.state.localVarDepth.set(t,e.state.callDepth)}function Ds(e,t){return e.state.localVarDepth?.get(t)}function Ea(e,t){e.state.localVarDepth?.delete(t)}function cy(e,t,n){e.state.localVarStack=e.state.localVarStack||new Map;let r=e.state.localVarStack.get(t)||[];r.push({value:n,scopeIndex:e.state.localScopes.length-1}),e.state.localVarStack.set(t,r)}function Aa(e,t){let n=e.state.localVarStack?.get(t);if(!(!n||n.length===0))return n.pop()}function uy(e,t){if(e.state.localVarStack)for(let[n,r]of e.state.localVarStack.entries()){for(;r.length>0&&r[r.length-1].scopeIndex===t;)r.pop();r.length===0&&e.state.localVarStack.delete(n)}}xe();Lt();var Ou=new Set([":",".","break","continue","eval","exec","exit","export","readonly","return","set","shift","trap","unset"]);function fy(e){return Ou.has(e)}var Ru=new Set(["if","then","else","elif","fi","case","esac","for","select","while","until","do","done","in","function","{","}","time","[[","]]","!"]),_s=new Set([":","true","false","cd","export","unset","exit","local","set","break","continue","return","eval","shift","getopts","compgen","complete","compopt","pushd","popd","dirs","source",".","read","mapfile","readarray","declare","typeset","readonly","let","command","shopt","exec","test","[","echo","printf","pwd","alias","unalias","type","hash","ulimit","umask","trap","times","wait","kill","jobs","fg","bg","disown","suspend","fc","history","help","enable","builtin","caller"]);Lt();async function Gr(e,t,n,r){try{if((await e.fs.stat(t)).isDirectory)return`bash: ${n}: Is a directory
|
|
806
|
+
`;if(r.checkNoclobber&&e.state.options.noclobber&&!r.isClobber&&n!=="/dev/null")return`bash: ${n}: cannot overwrite existing file
|
|
807
|
+
`}catch{}return null}function nr(e){let n=Math.min(e.length,8192);for(let r=0;r<n;r++)if(e.charCodeAt(r)>127)return"utf8";return"binary"}function LS(e){if(!e.startsWith("__rw__:"))return null;let t=e.slice(7),n=t.indexOf(":");if(n===-1)return null;let r=Number.parseInt(t.slice(0,n),10);if(Number.isNaN(r)||r<0)return null;let s=n+1,i=t.slice(s,s+r),o=s+r+1,a=t.slice(o),l=a.indexOf(":");if(l===-1)return null;let c=Number.parseInt(a.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;let u=a.slice(l+1);return{path:i,position:c,content:u}}async function py(e,t){let n=new Map;for(let r=0;r<t.length;r++){let s=t[r];if(s.target.type==="HereDoc")continue;if(s.operator===">&"||s.operator==="<&"){if(xi(e,s.target))return{targets:n,error:`bash: $@: ambiguous redirect
|
|
808
|
+
`};n.set(r,await se(e,s.target))}else{let o=await Ei(e,s.target);if("error"in o)return{targets:n,error:o.error};n.set(r,o.target)}}return{targets:n}}function MS(e){e.state.nextFd===void 0&&(e.state.nextFd=10);let t=e.state.nextFd,n=e.limits.maxFileDescriptors;if(t>=n)throw new Error(`bash: cannot allocate file descriptor: too many open files (max ${n})`);return e.state.nextFd++,t}async function Sa(e,t){for(let n of t){if(!n.fdVariable)continue;if(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),(n.operator===">&"||n.operator==="<&")&&n.target.type==="Word"&&await se(e,n.target)==="-"){let i=e.state.env.get(n.fdVariable);if(i!==void 0){let o=Number.parseInt(i,10);Number.isNaN(o)||e.state.fileDescriptors.delete(o)}continue}let r=MS(e);if(e.state.env.set(n.fdVariable,String(r)),n.target.type==="Word"){let s=await se(e,n.target);if(n.operator===">&"||n.operator==="<&"){let i=Number.parseInt(s,10);if(!Number.isNaN(i)){let o=e.state.fileDescriptors.get(i);o!==void 0&&(It(e),e.state.fileDescriptors.set(r,o));continue}}if(n.operator===">"||n.operator===">>"||n.operator===">|"||n.operator==="&>"||n.operator==="&>>"){let i=e.fs.resolvePath(e.state.cwd,s);(n.operator===">"||n.operator===">|"||n.operator==="&>")&&await e.fs.writeFile(i,"","binary"),It(e),e.state.fileDescriptors.set(r,`__file__:${i}`)}else if(n.operator==="<<<")It(e),e.state.fileDescriptors.set(r,`${s}
|
|
809
|
+
`);else if(n.operator==="<"||n.operator==="<>")try{let i=e.fs.resolvePath(e.state.cwd,s),o=await e.fs.readFile(i);It(e),e.state.fileDescriptors.set(r,o)}catch{return H("",`bash: ${s}: No such file or directory
|
|
810
|
+
`,1)}}}return null}async function Vn(e,t){for(let n of t){if(n.target.type==="HereDoc")continue;let r=n.operator===">&";if(n.operator!==">"&&n.operator!==">|"&&n.operator!=="&>"&&!r)continue;let s;if(r){if(s=await se(e,n.target),s==="-"||!Number.isNaN(Number.parseInt(s,10))||n.fd!=null)continue}else{let a=await Ei(e,n.target);if("error"in a)return H("",a.error,1);s=a.target}let i=e.fs.resolvePath(e.state.cwd,s),o=n.operator===">|";if(i.includes("\0"))return H("",`bash: ${s}: No such file or directory
|
|
811
|
+
`,1);try{let a=await e.fs.stat(i);if(a.isDirectory)return H("",`bash: ${s}: Is a directory
|
|
812
|
+
`,1);if(e.state.options.noclobber&&!o&&!a.isDirectory&&s!=="/dev/null")return H("",`bash: ${s}: cannot overwrite existing file
|
|
813
|
+
`,1)}catch{}if(s!=="/dev/null"&&s!=="/dev/stdout"&&s!=="/dev/stderr"&&s!=="/dev/full"&&await e.fs.writeFile(i,"","binary"),s==="/dev/full")return H("",`bash: /dev/full: No space left on device
|
|
814
|
+
`,1)}return null}async function Qe(e,t,n,r){let{stdout:s,stderr:i,exitCode:o}=t,a=t.stdoutEncoding==="binary"?()=>"binary":u=>nr(u);for(let u=0;u<n.length;u++){let f=n[u];if(f.target.type==="HereDoc")continue;let p,h=r?.get(u);if(h!==void 0)p=h;else if(f.operator===">&"||f.operator==="<&"){if(xi(e,f.target)){i+=`bash: $@: ambiguous redirect
|
|
815
|
+
`,o=1,s="";continue}p=await se(e,f.target)}else{let m=await Ei(e,f.target);if("error"in m){i+=m.error,o=1,s="";continue}p=m.target}if(!f.fdVariable){if(p.includes("\0")){i+=`bash: ${p.replace(/\0/g,"")}: No such file or directory
|
|
816
|
+
`,o=1,s="";continue}switch(f.operator){case">":case">|":{let d=f.fd??1,m=f.operator===">|";if(d===1){if(p==="/dev/stdout")break;if(p==="/dev/stderr"){i+=s,s="";break}if(p==="/dev/full"){i+=`bash: echo: write error: No space left on device
|
|
817
|
+
`,o=1,s="";break}let g=e.fs.resolvePath(e.state.cwd,p),y=await Gr(e,g,p,{checkNoclobber:!0,isClobber:m});if(y){i+=y,o=1,s="";break}await e.fs.writeFile(g,s,a(s)),s=""}else if(d===2){if(p==="/dev/stderr")break;if(p==="/dev/stdout"){s+=i,i="";break}if(p==="/dev/full"){i+=`bash: echo: write error: No space left on device
|
|
818
|
+
`,o=1;break}if(p==="/dev/null")i="";else{let g=e.fs.resolvePath(e.state.cwd,p),y=await Gr(e,g,p,{checkNoclobber:!0,isClobber:m});if(y){i+=y,o=1;break}await e.fs.writeFile(g,i,nr(i)),i=""}}break}case">>":{let d=f.fd??1;if(d===1){if(p==="/dev/stdout")break;if(p==="/dev/stderr"){i+=s,s="";break}if(p==="/dev/full"){i+=`bash: echo: write error: No space left on device
|
|
819
|
+
`,o=1,s="";break}let m=e.fs.resolvePath(e.state.cwd,p),g=await Gr(e,m,p,{});if(g){i+=g,o=1,s="";break}await e.fs.appendFile(m,s,a(s)),s=""}else if(d===2){if(p==="/dev/stderr")break;if(p==="/dev/stdout"){s+=i,i="";break}if(p==="/dev/full"){i+=`bash: echo: write error: No space left on device
|
|
820
|
+
`,o=1;break}let m=e.fs.resolvePath(e.state.cwd,p),g=await Gr(e,m,p,{});if(g){i+=g,o=1;break}await e.fs.appendFile(m,i,nr(i)),i=""}break}case">&":case"<&":{let d=f.fd??1;if(p==="-")break;if(p.endsWith("-")){let m=p.slice(0,-1),g=Number.parseInt(m,10);if(!Number.isNaN(g)){let y=e.state.fileDescriptors?.get(g);y!==void 0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(d,y),g>=3&&e.state.fileDescriptors?.delete(g)):g===1||g===2?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(d,`__dupout__:${g}`)):g===0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(d,`__dupin__:${g}`)):g>=3&&(i+=`bash: ${g}: Bad file descriptor
|
|
821
|
+
`,o=1)}break}if(p==="2"||p==="&2")d===1&&(i+=s,s="");else if(p==="1"||p==="&1")s+=i,i="";else{let m=Number.parseInt(p,10);if(Number.isNaN(m)){if(f.operator===">&"){let g=e.fs.resolvePath(e.state.cwd,p),y=await Gr(e,g,p,{checkNoclobber:!0});if(y){i=y,o=1,s="";break}if(f.fd==null){let w=s+i;await e.fs.writeFile(g,w,a(w)),s="",i=""}else d===1?(await e.fs.writeFile(g,s,a(s)),s=""):d===2&&(await e.fs.writeFile(g,i,nr(i)),i="")}}else{let g=e.state.fileDescriptors?.get(m);if(g?.startsWith("__file__:")){let y=g.slice(9);d===1?(await e.fs.appendFile(y,s,a(s)),s=""):d===2&&(await e.fs.appendFile(y,i,nr(i)),i="")}else if(g?.startsWith("__rw__:")){let y=LS(g);y&&(d===1?(await e.fs.appendFile(y.path,s,a(s)),s=""):d===2&&(await e.fs.appendFile(y.path,i,nr(i)),i=""))}else if(g?.startsWith("__dupout__:")){let y=Number.parseInt(g.slice(11),10);if(y!==1)if(y===2)d===1&&(i+=s,s="");else{let w=e.state.fileDescriptors?.get(y);if(w?.startsWith("__file__:")){let b=w.slice(9);d===1?(await e.fs.appendFile(b,s,a(s)),s=""):d===2&&(await e.fs.appendFile(b,i,nr(i)),i="")}}}else g?.startsWith("__dupin__:")?(i+=`bash: ${m}: Bad file descriptor
|
|
822
|
+
`,o=1,s=""):m>=3&&(i+=`bash: ${m}: Bad file descriptor
|
|
823
|
+
`,o=1,s="")}}break}case"&>":{if(p==="/dev/full"){i=`bash: echo: write error: No space left on device
|
|
824
|
+
`,o=1,s="";break}let d=e.fs.resolvePath(e.state.cwd,p),m=await Gr(e,d,p,{checkNoclobber:!0});if(m){i=m,o=1,s="";break}let g=s+i;await e.fs.writeFile(d,g,a(g)),s="",i="";break}case"&>>":{if(p==="/dev/full"){i=`bash: echo: write error: No space left on device
|
|
825
|
+
`,o=1,s="";break}let d=e.fs.resolvePath(e.state.cwd,p),m=await Gr(e,d,p,{});if(m){i=m,o=1,s="";break}let g=s+i;await e.fs.appendFile(d,g,a(g)),s="",i="";break}}}}let l=e.state.fileDescriptors?.get(1);if(l){if(l==="__dupout__:2")i+=s,s="";else if(l.startsWith("__file__:")){let u=l.slice(9);await e.fs.appendFile(u,s,a(s)),s=""}else if(l.startsWith("__file_append__:")){let u=l.slice(16);await e.fs.appendFile(u,s,a(s)),s=""}}let c=e.state.fileDescriptors?.get(2);if(c){if(c==="__dupout__:1")s+=i,i="";else if(c.startsWith("__file__:")){let u=c.slice(9);await e.fs.appendFile(u,i,nr(i)),i=""}else if(c.startsWith("__file_append__:")){let u=c.slice(16);await e.fs.appendFile(u,i,nr(i)),i=""}}return H(s,i,o)}function hy(e,t){if(e.state.options.posix&&Ou.has(t.name)){let r=`bash: line ${e.state.currentLine}: \`${t.name}': is a special builtin
|
|
826
|
+
`;throw new ge(2,"",r)}let n={...t,sourceFile:t.sourceFile??e.state.currentSource??"main"};return e.state.functions.set(t.name,n),ye}async function US(e,t){let n="";for(let r of t)if((r.operator==="<<"||r.operator==="<<-")&&r.target.type==="HereDoc"){let s=r.target,i=await se(e,s.content);s.stripTabs&&(i=i.split(`
|
|
827
|
+
`).map(a=>a.replace(/^\t+/,"")).join(`
|
|
828
|
+
`)),(r.fd??0)===0&&(n=i)}else if(r.operator==="<<<"&&r.target.type==="Word")n=`${await se(e,r.target)}
|
|
829
|
+
`;else if(r.operator==="<"&&r.target.type==="Word"){let s=await se(e,r.target),i=e.fs.resolvePath(e.state.cwd,s);try{n=await e.fs.readFile(i)}catch{}}return n}async function Ca(e,t,n,r="",s){e.state.callDepth++,e.state.callDepth>e.limits.maxCallDepth&&(e.state.callDepth--,jn(`${t.name}: maximum recursion depth (${e.limits.maxCallDepth}) exceeded, increase executionLimits.maxCallDepth`,"recursion")),e.state.funcNameStack||(e.state.funcNameStack=[]),e.state.callLineStack||(e.state.callLineStack=[]),e.state.sourceStack||(e.state.sourceStack=[]),e.state.funcNameStack.unshift(t.name),e.state.callLineStack.unshift(s??e.state.currentLine),e.state.sourceStack.unshift(t.sourceFile??"main"),e.state.localScopes.push(new Map),e.state.localExportedVars||(e.state.localExportedVars=[]),e.state.localExportedVars.push(new Set);let i=new Map;for(let c=0;c<n.length;c++)i.set(String(c+1),e.state.env.get(String(c+1))),e.state.env.set(String(c+1),n[c]);i.set("@",e.state.env.get("@")),i.set("#",e.state.env.get("#")),e.state.env.set("@",n.join(" ")),e.state.env.set("#",String(n.length));let o=()=>{let c=e.state.localScopes.length-1,u=e.state.localScopes.pop();if(u)for(let[f,p]of u)p===void 0?e.state.env.delete(f):e.state.env.set(f,p);if(uy(e,c),e.state.fullyUnsetLocals)for(let[f,p]of e.state.fullyUnsetLocals.entries())p===c&&e.state.fullyUnsetLocals.delete(f);if(e.state.localExportedVars&&e.state.localExportedVars.length>0){let f=e.state.localExportedVars.pop();if(f)for(let p of f)e.state.exportedVars?.delete(p)}for(let[f,p]of i)p===void 0?e.state.env.delete(f):e.state.env.set(f,p);e.state.funcNameStack?.shift(),e.state.callLineStack?.shift(),e.state.sourceStack?.shift(),e.state.callDepth--},{targets:a,error:l}=await py(e,t.redirections);if(l)return o(),H("",l,1);try{let c=await US(e,t.redirections),u=r||c,f=await e.executeCommand(t.body,u);return o(),Qe(e,f,t.redirections,a)}catch(c){if(o(),c instanceof xt){let u=H(c.stdout,c.stderr,c.exitCode);return Qe(e,u,t.redirections,a)}throw c}}var my=["!","[[","]]","case","do","done","elif","else","esac","fi","for","function","if","in","then","time","until","while","{","}"],Pu=[".",":","[","alias","bg","bind","break","builtin","caller","cd","command","compgen","complete","compopt","continue","declare","dirs","disown","echo","enable","eval","exec","exit","export","false","fc","fg","getopts","hash","help","history","jobs","kill","let","local","logout","mapfile","popd","printf","pushd","pwd","read","readarray","readonly","return","set","shift","shopt","source","suspend","test","times","trap","true","type","typeset","ulimit","umask","unalias","unset","wait"],BS=["autocd","assoc_expand_once","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","dotglob","execfail","expand_aliases","extdebug","extglob","extquote","failglob","force_fignore","globasciiranges","globstar","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lastpipe","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","nocaseglob","nocasematch","nullglob","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath","xpg_echo"],WS=Pu;async function Du(e,t){let n=[],r=null,s="",i="",o=null,a=!1,l=!1,c=!1,u=null,f=null,p=null,h=[],d=["alias","arrayvar","binding","builtin","command","directory","disabled","enabled","export","file","function","group","helptopic","hostname","job","keyword","running","service","setopt","shopt","signal","stopped","user","variable"];for(let x=0;x<t.length;x++){let A=t[x];if(A==="-v")n.push("variable");else if(A==="-e")n.push("export");else if(A==="-f")n.push("file");else if(A==="-d")n.push("directory");else if(A==="-k")n.push("keyword");else if(A==="-A"){if(x++,x>=t.length)return z(`compgen: -A: option requires an argument
|
|
830
|
+
`,2);let $=t[x];if(!d.includes($))return z(`compgen: ${$}: invalid action name
|
|
831
|
+
`,2);n.push($)}else if(A==="-W"){if(x++,x>=t.length)return z(`compgen: -W: option requires an argument
|
|
832
|
+
`,2);r=t[x]}else if(A==="-P"){if(x++,x>=t.length)return z(`compgen: -P: option requires an argument
|
|
833
|
+
`,2);s=t[x]}else if(A==="-S"){if(x++,x>=t.length)return z(`compgen: -S: option requires an argument
|
|
834
|
+
`,2);i=t[x]}else if(A==="-o"){if(x++,x>=t.length)return z(`compgen: -o: option requires an argument
|
|
835
|
+
`,2);let $=t[x];if($==="plusdirs")a=!0;else if($==="dirnames")l=!0;else if($==="default")c=!0;else if(!($==="filenames"||$==="nospace"||$==="bashdefault"||$==="noquote"))return z(`compgen: ${$}: invalid option name
|
|
836
|
+
`,2)}else if(A==="-F"){if(x++,x>=t.length)return z(`compgen: -F: option requires an argument
|
|
837
|
+
`,2);f=t[x]}else if(A==="-C"){if(x++,x>=t.length)return z(`compgen: -C: option requires an argument
|
|
838
|
+
`,2);p=t[x]}else if(A==="-X"){if(x++,x>=t.length)return z(`compgen: -X: option requires an argument
|
|
839
|
+
`,2);u=t[x]}else if(A==="-G"){if(x++,x>=t.length)return z(`compgen: -G: option requires an argument
|
|
840
|
+
`,2)}else if(A==="--"){h.push(...t.slice(x+1));break}else A.startsWith("-")||h.push(A)}o=h[0]??null;let m=[];if(l){let x=await Tu(e,o);m.push(...x)}if(c){let x=await dy(e,o);m.push(...x)}for(let x of n)if(x==="variable"){let A=zS(e,o);m.push(...A)}else if(x==="export"){let A=HS(e,o);m.push(...A)}else if(x==="function"){let A=jS(e,o);m.push(...A)}else if(x==="builtin"){let A=GS(o);m.push(...A)}else if(x==="keyword"){let A=VS(o);m.push(...A)}else if(x==="alias"){let A=qS(e,o);m.push(...A)}else if(x==="shopt"){let A=ZS(o);m.push(...A)}else if(x==="helptopic"){let A=KS(o);m.push(...A)}else if(x==="directory"){let A=await Tu(e,o);m.push(...A)}else if(x==="file"){let A=await dy(e,o);m.push(...A)}else if(x==="user"){let A=QS(o);m.push(...A)}else if(x==="command"){let A=await XS(e,o);m.push(...A)}if(r!==null)try{let x=await YS(e,r),A=JS(e,x);for(let $ of A)(o===null||$.startsWith(o))&&m.push($)}catch{return H("","",1)}if(a){let x=await Tu(e,o);for(let A of x)m.includes(A)||m.push(A)}let g="";if(f!==null){let x=e.state.functions.get(f);if(x){let A=new Map;A.set("COMP_WORDS__length",e.state.env.get("COMP_WORDS__length")),e.state.env.set("COMP_WORDS__length","0"),A.set("COMP_CWORD",e.state.env.get("COMP_CWORD")),e.state.env.set("COMP_CWORD","-1"),A.set("COMP_LINE",e.state.env.get("COMP_LINE")),e.state.env.set("COMP_LINE",""),A.set("COMP_POINT",e.state.env.get("COMP_POINT")),e.state.env.set("COMP_POINT","0");let $=new Map;for(let F of e.state.env.keys())(F==="COMPREPLY"||F.startsWith("COMPREPLY_")||F==="COMPREPLY__length")&&($.set(F,e.state.env.get(F)),e.state.env.delete(F));let O=["compgen",h[0]??"",""];try{let F=await Ca(e,x,O,"");if(F.exitCode!==0)return Fs(e,A),Fs(e,$),H("",F.stderr,1);g=F.stdout;let P=eC(e);m.push(...P)}catch{return Fs(e,A),Fs(e,$),H("","",1)}Fs(e,A),Fs(e,$)}}if(p!==null)try{let x=Sn(p),A=await e.executeScript(x);if(A.exitCode!==0)return H("",A.stderr,A.exitCode);if(A.stdout){let $=A.stdout.split(`
|
|
841
|
+
`);for(let O of $)O.length>0&&m.push(O)}}catch(x){if(x.name==="ParseException")return z(`compgen: -C: ${x.message}
|
|
842
|
+
`,2);throw x}let y=m;if(u!==null){let x=u.startsWith("!"),A=x?u.slice(1):u;y=m.filter($=>{let O=Ps($,A,!1,!0);return x?O:!O})}if(y.length===0&&o!==null)return H(g,"",1);let w=y.map(x=>`${s}${x}${i}`).join(`
|
|
843
|
+
`),b=g+(w?`${w}
|
|
844
|
+
`:"");return be(b)}function zS(e,t){let n=new Set;for(let s of e.state.env.keys()){if(s.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(s)||s.endsWith("__length"))continue;let i=s.split("_")[0];/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)?n.add(s):i&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(i)&&e.state.env.has(`${i}__length`)&&n.add(i)}let r=Array.from(n);return t!==null&&(r=r.filter(s=>s.startsWith(t))),r.sort()}function HS(e,t){let n=e.state.exportedVars??new Set,r=Array.from(n);return t!==null&&(r=r.filter(s=>s.startsWith(t))),r=r.filter(s=>s.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(s)||s.endsWith("__length")?!1:e.state.env.has(s)),r.sort()}function jS(e,t){let n=Array.from(e.state.functions.keys());return t!==null&&(n=n.filter(r=>r.startsWith(t))),n.sort()}function GS(e){let t=[...Pu];return e!==null&&(t=t.filter(n=>n.startsWith(e))),t.sort()}function VS(e){let t=[...my];return e!==null&&(t=t.filter(n=>n.startsWith(e))),t.sort()}function qS(e,t){let n=[];for(let s of e.state.env.keys())if(s.startsWith("BASH_ALIAS_")){let i=s.slice(11);n.push(i)}let r=n;return t!==null&&(r=r.filter(s=>s.startsWith(t))),r.sort()}function ZS(e){let t=[...BS];return e!==null&&(t=t.filter(n=>n.startsWith(e))),t.sort()}function KS(e){let t=[...WS];return e!==null&&(t=t.filter(n=>n.startsWith(e))),t.sort()}async function Tu(e,t){let n=[];try{let r=e.state.cwd,s=t??"";if(t){let o=t.lastIndexOf("/");if(o!==-1){let a=t.slice(0,o)||"/";s=t.slice(o+1),a.startsWith("/")?r=a:r=`${e.state.cwd}/${a}`}}let i=await e.fs.readdir(r);for(let o of i){let a=`${r}/${o}`;try{if((await e.fs.stat(a)).isDirectory&&(!s||o.startsWith(s)))if(t?.includes("/")){let c=t.lastIndexOf("/"),u=t.slice(0,c+1);n.push(u+o)}else n.push(o)}catch{}}}catch{}return n.sort()}async function dy(e,t){let n=[];try{let r=e.state.cwd,s=t??"";if(t){let o=t.lastIndexOf("/");if(o!==-1){let a=t.slice(0,o)||"/";s=t.slice(o+1),a.startsWith("/")?r=a:r=`${e.state.cwd}/${a}`}}let i=await e.fs.readdir(r);for(let o of i)if(!s||o.startsWith(s))if(t?.includes("/")){let a=t.lastIndexOf("/"),l=t.slice(0,a+1);n.push(l+o)}else n.push(o)}catch{}return n.sort()}function QS(e){return["root","nobody"]}async function XS(e,t){let n=new Set;for(let i of Pu)n.add(i);for(let i of e.state.functions.keys())n.add(i);for(let i of e.state.env.keys())i.startsWith("BASH_ALIAS_")&&n.add(i.slice(11));for(let i of my)n.add(i);let r=e.state.env.get("PATH")??"/usr/bin:/bin";for(let i of r.split(":"))if(i)try{let o=await e.fs.readdir(i);for(let a of o)n.add(a)}catch{}let s=Array.from(n);return t!==null&&(s=s.filter(i=>i.startsWith(t))),s.sort()}async function YS(e,t){let r=new ce().parseWordFromString(t,!1,!1);return await se(e,r)}function JS(e,t){let n=e.state.env.get("IFS")??`
|
|
845
|
+
`;if(n.length===0)return[t];let r=new Set(n.split("")),s=[],i="",o=0;for(;o<t.length;){let a=t[o];if(a==="\\"&&o+1<t.length){let l=t[o+1];i+=l,o+=2}else r.has(a)?(i.length>0&&(s.push(i),i=""),o++):(i+=a,o++)}return i.length>0&&s.push(i),s}function Fs(e,t){for(let[n,r]of t)r===void 0?e.state.env.delete(n):e.state.env.set(n,r)}function eC(e){let t=[];if(e.state.env.get("COMPREPLY__length")!==void 0){let s=oe(e,"COMPREPLY");for(let[,i]of s)t.push(i)}else{let s=e.state.env.get("COMPREPLY");s!==void 0&&t.push(s)}return t}var tC=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function Fu(e,t){e.state.completionSpecs||(e.state.completionSpecs=new Map);let n=!1,r=!1,s=!1,i,o,a,l=[],c=[],u=[];for(let f=0;f<t.length;f++){let p=t[f];if(p==="-p")n=!0;else if(p==="-r")r=!0;else if(p==="-D")s=!0;else if(p==="-W"){if(f++,f>=t.length)return z(`complete: -W: option requires an argument
|
|
846
|
+
`,2);i=t[f]}else if(p==="-F"){if(f++,f>=t.length)return z(`complete: -F: option requires an argument
|
|
847
|
+
`,2);o=t[f]}else if(p==="-o"){if(f++,f>=t.length)return z(`complete: -o: option requires an argument
|
|
848
|
+
`,2);let h=t[f];if(!tC.includes(h))return z(`complete: ${h}: invalid option name
|
|
849
|
+
`,2);l.push(h)}else if(p==="-A"){if(f++,f>=t.length)return z(`complete: -A: option requires an argument
|
|
850
|
+
`,2);c.push(t[f])}else if(p==="-C"){if(f++,f>=t.length)return z(`complete: -C: option requires an argument
|
|
851
|
+
`,2);a=t[f]}else if(p==="-G"){if(f++,f>=t.length)return z(`complete: -G: option requires an argument
|
|
852
|
+
`,2)}else if(p==="-P"){if(f++,f>=t.length)return z(`complete: -P: option requires an argument
|
|
853
|
+
`,2)}else if(p==="-S"){if(f++,f>=t.length)return z(`complete: -S: option requires an argument
|
|
854
|
+
`,2)}else if(p==="-X"){if(f++,f>=t.length)return z(`complete: -X: option requires an argument
|
|
855
|
+
`,2)}else if(p==="--"){u.push(...t.slice(f+1));break}else p.startsWith("-")||u.push(p)}if(r){if(u.length===0)return e.state.completionSpecs.clear(),be("");for(let f of u)e.state.completionSpecs.delete(f);return be("")}if(n)return u.length===0?_u(e):_u(e,u);if(t.length===0||u.length===0&&!i&&!o&&!a&&l.length===0&&c.length===0&&!s)return _u(e);if(o&&u.length===0&&!s)return z(`complete: -F: option requires a command name
|
|
856
|
+
`,2);if(s){let f={isDefault:!0};return i!==void 0&&(f.wordlist=i),o!==void 0&&(f.function=o),a!==void 0&&(f.command=a),l.length>0&&(f.options=l),c.length>0&&(f.actions=c),e.state.completionSpecs.set("__default__",f),be("")}for(let f of u){let p=Object.create(null);i!==void 0&&(p.wordlist=i),o!==void 0&&(p.function=o),a!==void 0&&(p.command=a),l.length>0&&(p.options=l),c.length>0&&(p.actions=c),e.state.completionSpecs.set(f,p)}return be("")}function _u(e,t){let n=e.state.completionSpecs;if(!n||n.size===0){if(t&&t.length>0){let i="";for(let o of t)i+=`complete: ${o}: no completion specification
|
|
857
|
+
`;return H("",i,1)}return be("")}let r=[],s=t||Array.from(n.keys());for(let i of s){if(i==="__default__")continue;let o=n.get(i);if(!o){if(t)return H(r.join(`
|
|
858
|
+
`)+(r.length>0?`
|
|
859
|
+
`:""),`complete: ${i}: no completion specification
|
|
860
|
+
`,1);continue}let a="complete";if(o.options)for(let l of o.options)a+=` -o ${l}`;if(o.actions)for(let l of o.actions)a+=` -A ${l}`;o.wordlist!==void 0&&(o.wordlist.includes(" ")||o.wordlist.includes("'")?a+=` -W '${o.wordlist}'`:a+=` -W ${o.wordlist}`),o.function!==void 0&&(a+=` -F ${o.function}`),o.isDefault&&(a+=" -D"),a+=` ${i}`,r.push(a)}return r.length===0?be(""):be(`${r.join(`
|
|
861
|
+
`)}
|
|
862
|
+
`)}var gy=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function Lu(e,t){e.state.completionSpecs||(e.state.completionSpecs=new Map);let n=!1,r=!1,s=[],i=[],o=[];for(let a=0;a<t.length;a++){let l=t[a];if(l==="-D")n=!0;else if(l==="-E")r=!0;else if(l==="-o"){if(a++,a>=t.length)return z(`compopt: -o: option requires an argument
|
|
863
|
+
`,2);let c=t[a];if(!gy.includes(c))return z(`compopt: ${c}: invalid option name
|
|
864
|
+
`,2);s.push(c)}else if(l==="+o"){if(a++,a>=t.length)return z(`compopt: +o: option requires an argument
|
|
865
|
+
`,2);let c=t[a];if(!gy.includes(c))return z(`compopt: ${c}: invalid option name
|
|
866
|
+
`,2);i.push(c)}else if(l==="--"){o.push(...t.slice(a+1));break}else!l.startsWith("-")&&!l.startsWith("+")&&o.push(l)}if(n){let a=e.state.completionSpecs.get("__default__")??{isDefault:!0},l=new Set(a.options??[]);for(let c of s)l.add(c);for(let c of i)l.delete(c);return a.options=l.size>0?Array.from(l):void 0,e.state.completionSpecs.set("__default__",a),be("")}if(r){let a=e.state.completionSpecs.get("__empty__")??{},l=new Set(a.options??[]);for(let c of s)l.add(c);for(let c of i)l.delete(c);return a.options=l.size>0?Array.from(l):void 0,e.state.completionSpecs.set("__empty__",a),be("")}if(o.length>0){for(let a of o){let l=e.state.completionSpecs.get(a)??{},c=new Set(l.options??[]);for(let u of s)c.add(u);for(let u of i)c.delete(u);l.options=c.size>0?Array.from(c):void 0,e.state.completionSpecs.set(a,l)}return be("")}return z(`compopt: not currently executing completion function
|
|
867
|
+
`,1)}xe();function Mu(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Tn;return ye}if(t.length>1)throw new ge(1,"",`bash: continue: too many arguments
|
|
868
|
+
`);let n=1;if(t.length>0){let r=Number.parseInt(t[0],10);if(Number.isNaN(r)||r<1)throw new ge(1,"",`bash: continue: ${t[0]}: numeric argument required
|
|
869
|
+
`);n=r}throw new kt(n)}Nt();ot();Ft();dn();vn();gr();function nt(e,t){let n=e.state.env.get("HOME")||"/home/user";return t.split(":").map(i=>i==="~"?n:i==="~root"?"/root":i.startsWith("~/")?n+i.slice(1):i.startsWith("~root/")?`/root${i.slice(5)}`:i).join(":")}dn();vn();function Uu(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return!0}return!1}function Bu(e){let t="$'";for(let n=0;n<e.length;n++){let r=e[n],s=e.charCodeAt(n);s===7?t+="\\a":s===8?t+="\\b":s===9?t+="\\t":s===10?t+="\\n":s===11?t+="\\v":s===12?t+="\\f":s===13?t+="\\r":s===27?t+="\\e":s===39?t+="\\'":s===92?t+="\\\\":s<32||s===127?t+=`\\${s.toString(8).padStart(3,"0")}`:t+=r}return t+="'",t}function va(e){return Uu(e)?Bu(e):/^[a-zA-Z0-9_/.:\-@%+,=]*$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Vr(e){return Uu(e)?Bu(e):`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Wu(e){return Uu(e)?Bu(e):`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function yy(e,t){let n="";return e.state.integerVars?.has(t)&&(n+="i"),e.state.lowercaseVars?.has(t)&&(n+="l"),Me(e,t)&&(n+="n"),e.state.readonlyVars?.has(t)&&(n+="r"),e.state.uppercaseVars?.has(t)&&(n+="u"),e.state.exportedVars?.has(t)&&(n+="x"),n===""?"--":`-${n}`}function zu(e){return e===""?"''":/[\s'\\]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:e}function wy(e,t){let n="",r="",s=!1;for(let i of t){let o=yy(e,i);if(e.state.associativeArrays?.has(i)){let u=Cn(e,i);if(u.length===0)n+=`declare -A ${i}=()
|
|
870
|
+
`;else{let f=u.map(p=>{let h=e.state.env.get(`${i}_${p}`)??"",d=zu(h);return`['${p}']=${d}`});n+=`declare -A ${i}=(${f.join(" ")})
|
|
871
|
+
`}continue}let l=at(e,i);if(l.length>0){let u=l.map(f=>{let p=e.state.env.get(`${i}_${f}`)??"";return`[${f}]=${Vr(p)}`});n+=`declare -a ${i}=(${u.join(" ")})
|
|
872
|
+
`;continue}if(e.state.env.has(`${i}__length`)){n+=`declare -a ${i}=()
|
|
873
|
+
`;continue}let c=e.state.env.get(i);if(c!==void 0)n+=`declare ${o} ${i}=${Wu(c)}
|
|
874
|
+
`;else{let u=e.state.declaredVars?.has(i),f=e.state.localVarDepth?.has(i);u||f?n+=`declare ${o} ${i}
|
|
875
|
+
`:(r+=`bash: declare: ${i}: not found
|
|
876
|
+
`,s=!0)}}return H(n,r,s?1:0)}function by(e,t){let{filterExport:n,filterReadonly:r,filterNameref:s,filterIndexedArray:i,filterAssocArray:o}=t,a=n||r||s||i||o,l="",c=new Set;for(let f of e.state.env.keys()){if(f.startsWith("BASH_"))continue;if(f.endsWith("__length")){let h=f.slice(0,-8);c.add(h);continue}let p=f.lastIndexOf("_");if(p>0){let h=f.slice(0,p),d=f.slice(p+1);if(/^\d+$/.test(d)||e.state.associativeArrays?.has(h)){c.add(h);continue}}c.add(f)}if(e.state.localVarDepth)for(let f of e.state.localVarDepth.keys())c.add(f);if(e.state.associativeArrays)for(let f of e.state.associativeArrays)c.add(f);let u=Array.from(c).sort();for(let f of u){let p=yy(e,f),h=e.state.associativeArrays?.has(f),d=at(e,f),m=!h&&(d.length>0||e.state.env.has(`${f}__length`));if(a&&(o&&!h||i&&!m||n&&!e.state.exportedVars?.has(f)||r&&!e.state.readonlyVars?.has(f)||s&&!Me(e,f)))continue;if(h){let y=Cn(e,f);if(y.length===0)l+=`declare -A ${f}=()
|
|
877
|
+
`;else{let w=y.map(b=>{let x=e.state.env.get(`${f}_${b}`)??"",A=zu(x);return`['${b}']=${A}`});l+=`declare -A ${f}=(${w.join(" ")})
|
|
878
|
+
`}continue}if(d.length>0){let y=d.map(w=>{let b=e.state.env.get(`${f}_${w}`)??"";return`[${w}]=${Vr(b)}`});l+=`declare -a ${f}=(${y.join(" ")})
|
|
879
|
+
`;continue}if(e.state.env.has(`${f}__length`)){l+=`declare -a ${f}=()
|
|
880
|
+
`;continue}let g=e.state.env.get(f);g!==void 0&&(l+=`declare ${p} ${f}=${Wu(g)}
|
|
881
|
+
`)}return be(l)}function xy(e){let t="",n=Array.from(e.state.associativeArrays??[]).sort();for(let r of n){let s=Cn(e,r);if(s.length===0)t+=`declare -A ${r}=()
|
|
882
|
+
`;else{let i=s.map(o=>{let a=e.state.env.get(`${r}_${o}`)??"",l=zu(a);return`['${o}']=${l}`});t+=`declare -A ${r}=(${i.join(" ")})
|
|
883
|
+
`}}return be(t)}function Ey(e){let t="",n=new Set;for(let s of e.state.env.keys()){if(s.startsWith("BASH_"))continue;if(s.endsWith("__length")){let o=s.slice(0,-8);e.state.associativeArrays?.has(o)||n.add(o);continue}let i=s.lastIndexOf("_");if(i>0){let o=s.slice(0,i),a=s.slice(i+1);/^\d+$/.test(a)&&(e.state.associativeArrays?.has(o)||n.add(o))}}let r=Array.from(n).sort();for(let s of r){let i=at(e,s);if(i.length===0)t+=`declare -a ${s}=()
|
|
884
|
+
`;else{let o=i.map(a=>{let l=e.state.env.get(`${s}_${a}`)??"";return`[${a}]=${Vr(l)}`});t+=`declare -a ${s}=(${o.join(" ")})
|
|
885
|
+
`}}return be(t)}function Ay(e){let t="",n=new Set;for(let s of e.state.env.keys()){if(s.startsWith("BASH_"))continue;if(s.endsWith("__length")){let o=s.slice(0,-8);n.add(o);continue}let i=s.lastIndexOf("_");if(i>0){let o=s.slice(0,i),a=s.slice(i+1);if(/^\d+$/.test(a)||e.state.associativeArrays?.has(o)){n.add(o);continue}}n.add(s)}let r=Array.from(n).sort();for(let s of r){if(e.state.associativeArrays?.has(s)||at(e,s).length>0||e.state.env.has(`${s}__length`))continue;let a=e.state.env.get(s);a!==void 0&&(t+=`${s}=${va(a)}
|
|
886
|
+
`)}return be(t)}function Hu(e,t){e.state.integerVars??=new Set,e.state.integerVars.add(t)}function Ci(e,t){return e.state.integerVars?.has(t)??!1}function ju(e,t){e.state.lowercaseVars??=new Set,e.state.lowercaseVars.add(t),e.state.uppercaseVars?.delete(t)}function nC(e,t){return e.state.lowercaseVars?.has(t)??!1}function Gu(e,t){e.state.uppercaseVars??=new Set,e.state.uppercaseVars.add(t),e.state.lowercaseVars?.delete(t)}function rC(e,t){return e.state.uppercaseVars?.has(t)??!1}function Ls(e,t,n){return nC(e,t)?n.toLowerCase():rC(e,t)?n.toUpperCase():n}async function Sy(e,t){try{let n=new ce,r=Ce(n,t),s=await te(e,r.expression);return String(s)}catch{return"0"}}function sC(e){let t=e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!t)return null;let n=t[0],r=n.length;if(e[r]!=="[")return null;let s=0,i=r+1;for(;r<e.length;r++)if(e[r]==="[")s++;else if(e[r]==="]"&&(s--,s===0))break;if(s!==0)return null;let o=e.slice(i,r);if(r++,e[r]!=="=")return null;r++;let a=e.slice(r);return{name:n,indexExpr:o,value:a}}async function Vu(e,t){let n=!1,r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1,u=!1,f=!1,p=!1,h=!1,d=!1,m=!1,g=!1,y=[];for(let P=0;P<t.length;P++){let M=t[P];if(M==="-a")n=!0;else if(M==="-A")r=!0;else if(M==="-r")s=!0;else if(M==="-x")i=!0;else if(M==="-p")o=!0;else if(M==="-n")a=!0;else if(M==="+n")l=!0;else if(M==="+a")c=!0;else if(M==="+x")u=!0;else if(M==="--"){y.push(...t.slice(P+1));break}else if(M.startsWith("+")){for(let C of M.slice(1))if(C==="n")l=!0;else if(C==="a")c=!0;else if(C==="x")u=!0;else if(C!=="r"){if(C!=="i"){if(!(C==="f"||C==="F"))return H("",`bash: typeset: +${C}: invalid option
|
|
887
|
+
`,2)}}}else if(M==="-i")f=!0;else if(M==="-l")p=!0;else if(M==="-u")h=!0;else if(M==="-f")d=!0;else if(M==="-F")m=!0;else if(M==="-g")g=!0;else if(M.startsWith("-"))for(let C of M.slice(1))if(C==="a")n=!0;else if(C==="A")r=!0;else if(C==="r")s=!0;else if(C==="x")i=!0;else if(C==="p")o=!0;else if(C==="n")a=!0;else if(C==="i")f=!0;else if(C==="l")p=!0;else if(C==="u")h=!0;else if(C==="f")d=!0;else if(C==="F")m=!0;else if(C==="g")g=!0;else return H("",`bash: typeset: -${C}: invalid option
|
|
888
|
+
`,2);else y.push(M)}let b=e.state.localScopes.length>0&&!g,x=P=>{if(!b)return;let M=e.state.localScopes[e.state.localScopes.length-1];M.has(P)||M.set(P,e.state.env.get(P))},A=P=>{if(!b)return;let M=e.state.localScopes[e.state.localScopes.length-1];M.has(P)||M.set(P,e.state.env.get(P));let C=`${P}_`;for(let R of e.state.env.keys())R.startsWith(C)&&!R.includes("__")&&(M.has(R)||M.set(R,e.state.env.get(R)));let N=`${P}__length`;e.state.env.has(N)&&!M.has(N)&&M.set(N,e.state.env.get(N))},$=P=>{b&&xr(e,P)};if(m){if(y.length===0){let C=Array.from(e.state.functions.keys()).sort(),N="";for(let R of C)N+=`declare -f ${R}
|
|
889
|
+
`;return be(N)}let P=!0,M="";for(let C of y)e.state.functions.has(C)?M+=`${C}
|
|
890
|
+
`:P=!1;return H(M,"",P?0:1)}if(d){if(y.length===0){let M="",C=Array.from(e.state.functions.keys()).sort();for(let N of C)M+=`${N} ()
|
|
891
|
+
{
|
|
892
|
+
# function body
|
|
893
|
+
}
|
|
894
|
+
`;return be(M)}let P=!0;for(let M of y)e.state.functions.has(M)||(P=!1);return H("","",P?0:1)}if(o&&y.length>0)return wy(e,y);if(o&&y.length===0)return by(e,{filterExport:i,filterReadonly:s,filterNameref:a,filterIndexedArray:n,filterAssocArray:r});if(y.length===0&&r&&!o)return xy(e);if(y.length===0&&n&&!o)return Ey(e);if(y.length===0&&!o)return Ay(e);let O="",F=0;for(let P of y){let M=P.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(M&&!c){let I=M[1],T=M[2];if(r&&at(e,I).length>0){O+=`bash: declare: ${I}: cannot convert indexed to associative array
|
|
895
|
+
`,F=1;continue}if((n||!r&&!n)&&e.state.associativeArrays?.has(I)){O+=`bash: declare: ${I}: cannot convert associative to indexed array
|
|
896
|
+
`,F=1;continue}if(A(I),r&&(e.state.associativeArrays??=new Set,e.state.associativeArrays.add(I)),Bn(e,I),e.state.env.delete(I),e.state.env.delete(`${I}__length`),r&&T.includes("[")){let L=xa(T);for(let[me,ue]of L){let re=nt(e,ue);e.state.env.set(`${I}_${me}`,re)}}else if(r){let L=Gn(T);for(let me=0;me<L.length;me+=2){let ue=L[me],re=me+1<L.length?nt(e,L[me+1]):"";e.state.env.set(`${I}_${ue}`,re)}}else{let L=Gn(T);if(L.some(ue=>/^\[[^\]]+\]=/.test(ue))){let ue=0;for(let re of L){let W=re.match(/^\[([^\]]+)\]=(.*)$/);if(W){let q=W[1],fe=W[2],ie=nt(e,fe),ke;if(/^-?\d+$/.test(q))ke=Number.parseInt(q,10);else try{let G=new ce,Oe=Ce(G,q);ke=await te(e,Oe.expression)}catch{ke=0}e.state.env.set(`${I}_${ke}`,ie),ue=ke+1}else{let q=nt(e,re);e.state.env.set(`${I}_${ue}`,q),ue++}}}else{for(let ue=0;ue<L.length;ue++)e.state.env.set(`${I}_${ue}`,L[ue]);e.state.env.set(`${I}__length`,String(L.length))}}$(I),s&&Qt(e,I),i&&kn(e,I);continue}if(l){let I=P.includes("=")?P.slice(0,P.indexOf("=")):P;if(kg(e,I),!P.includes("="))continue}if(u){let I=P.includes("=")?P.slice(0,P.indexOf("=")):P;if(ta(e,I),!P.includes("="))continue}let C=sC(P);if(C){let{name:I,indexExpr:T,value:L}=C,me=gt(e,I);if(me)return me;A(I);let ue;try{let W=new ce,q=Ce(W,T);ue=await te(e,q.expression)}catch{let W=parseInt(T,10);ue=Number.isNaN(W)?0:W}e.state.env.set(`${I}_${ue}`,L);let re=parseInt(e.state.env.get(`${I}__length`)??"0",10);ue>=re&&e.state.env.set(`${I}__length`,String(ue+1)),$(I),s&&Qt(e,I),i&&kn(e,I);continue}let N=P.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(N&&!c){let I=N[1],T=N[2],L=gt(e,I);if(L)return L;A(I);let me=Gn(T);if(e.state.associativeArrays?.has(I)){let ue=xa(T);for(let[re,W]of ue){let q=nt(e,W);e.state.env.set(`${I}_${re}`,q)}}else{let ue=at(e,I),re=0,W=e.state.env.get(I);ue.length===0&&W!==void 0?(e.state.env.set(`${I}_0`,W),e.state.env.delete(I),re=1):ue.length>0&&(re=Math.max(...ue)+1);for(let fe=0;fe<me.length;fe++)e.state.env.set(`${I}_${re+fe}`,nt(e,me[fe]));let q=re+me.length;e.state.env.set(`${I}__length`,String(q))}$(I),s&&Qt(e,I),i&&kn(e,I);continue}let R=P.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(R){let I=R[1],T=nt(e,R[2]),L=gt(e,I);if(L)return L;x(I),f&&Hu(e,I),p&&ju(e,I),h&&Gu(e,I);let ue=at(e,I).length>0||e.state.associativeArrays?.has(I);if(Ci(e,I)){let re=e.state.env.get(I)??"0",W=parseInt(re,10)||0,q=parseInt(await Sy(e,T),10)||0;T=String(W+q),e.state.env.set(I,T)}else if(ue){T=Ls(e,I,T);let re=`${I}_0`,W=e.state.env.get(re)??"";e.state.env.set(re,W+T)}else{T=Ls(e,I,T);let re=e.state.env.get(I)??"";e.state.env.set(I,re+T)}$(I),s&&Qt(e,I),i&&kn(e,I),e.state.options.allexport&&!u&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(I));continue}if(P.includes("=")){let I=P.indexOf("="),T=P.slice(0,I),L=P.slice(I+1);if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(T)){O+=`bash: typeset: \`${T}': not a valid identifier
|
|
897
|
+
`,F=1;continue}let me=gt(e,T);if(me)return me;if(x(T),a){if(L!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(L)){O+=`bash: declare: \`${L}': invalid variable name for name reference
|
|
898
|
+
`,F=1;continue}e.state.env.set(T,L),Jn(e,T),L!==""&&Jo(e,L)&&uu(e,T),$(T),s&&Qt(e,T),i&&kn(e,T);continue}if(f&&Hu(e,T),p&&ju(e,T),h&&Gu(e,T),Ci(e,T)&&(L=await Sy(e,L)),L=Ls(e,T,L),Me(e,T)){let ue=_t(e,T);ue&&ue!==T?e.state.env.set(ue,L):e.state.env.set(T,L)}else e.state.env.set(T,L);$(T),s&&Qt(e,T),i&&kn(e,T),e.state.options.allexport&&!u&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(T))}else{let I=P;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(I)){O+=`bash: typeset: \`${I}': not a valid identifier
|
|
899
|
+
`,F=1;continue}if(n||r?A(I):x(I),a){Jn(e,I);let L=e.state.env.get(I);L!==void 0&&L!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(L)?Ng(e,I):L&&Jo(e,L)&&uu(e,I),$(I),s&&Qt(e,I),i&&kn(e,I);continue}if(f&&Hu(e,I),p&&ju(e,I),h&&Gu(e,I),r){if(at(e,I).length>0){O+=`bash: declare: ${I}: cannot convert indexed to associative array
|
|
900
|
+
`,F=1;continue}e.state.associativeArrays??=new Set,e.state.associativeArrays.add(I)}let T=Array.from(e.state.env.keys()).some(L=>L.startsWith(`${I}_`)&&!L.startsWith(`${I}__length`));!e.state.env.has(I)&&!T&&(n||r?e.state.env.set(`${I}__length`,"0"):(e.state.declaredVars??=new Set,e.state.declaredVars.add(I))),$(I),s&&Qt(e,I),i&&kn(e,I)}}return H("",O,F)}async function qu(e,t){let n=!1,r=!1,s=!1,i=[];for(let o=0;o<t.length;o++){let a=t[o];if(a==="-a")n=!0;else if(a==="-A")r=!0;else if(a==="-p")s=!0;else if(a==="--"){i.push(...t.slice(o+1));break}else a.startsWith("-")||i.push(a)}if(i.length===0){let o="",a=Array.from(e.state.readonlyVars||[]).sort();for(let l of a){let c=e.state.env.get(l);if(c!==void 0){let u=c.replace(/\\/g,"\\\\").replace(/"/g,'\\"');o+=`declare -r ${l}="${u}"
|
|
901
|
+
`}}return be(o)}for(let o of i){let a=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(a){let f=a[1],p=a[2],h=gt(e,f);if(h)return h;let d=Gn(p);if(e.state.associativeArrays?.has(f)){let m=xa(p);for(let[g,y]of m){let w=nt(e,y);e.state.env.set(`${f}_${g}`,w)}}else{let m=at(e,f),g=0,y=e.state.env.get(f);m.length===0&&y!==void 0?(e.state.env.set(`${f}_0`,y),e.state.env.delete(f),g=1):m.length>0&&(g=Math.max(...m)+1);for(let b=0;b<d.length;b++)e.state.env.set(`${f}_${g+b}`,nt(e,d[b]));let w=g+d.length;e.state.env.set(`${f}__length`,String(w))}Qt(e,f);continue}let l=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(l){let f=l[1],p=nt(e,l[2]),h=gt(e,f);if(h)return h;let d=e.state.env.get(f)??"";e.state.env.set(f,d+p),Qt(e,f);continue}let c=ay(o);if(c.value===void 0&&!c.isArray){Qt(e,c.name);continue}let u=await ly(e,c,{makeReadonly:!0});if(u)return u}return ye}function Zu(e){return e.state.directoryStack??=[],e.state.directoryStack}function vi(e,t){return t&&e===t?"~":t&&e.startsWith(`${t}/`)?`~${e.slice(t.length)}`:e}function iC(e){let t=e.split("/").filter(r=>r&&r!=="."),n=[];for(let r of t)r===".."?n.pop():n.push(r);return`/${n.join("/")}`}async function Ku(e,t){let n=Zu(e),r;for(let a=0;a<t.length;a++){let l=t[a];if(l==="--"){if(a+1<t.length){if(r!==void 0)return z(`bash: pushd: too many arguments
|
|
902
|
+
`,2);r=t[a+1],a++}}else{if(l.startsWith("-")&&l!=="-")return z(`bash: pushd: ${l}: invalid option
|
|
903
|
+
`,2);if(r!==void 0)return z(`bash: pushd: too many arguments
|
|
904
|
+
`,2);r=l}}if(r===void 0){if(n.length<2)return z(`bash: pushd: no other directory
|
|
905
|
+
`,1);let a=n[0];n[0]=n[1],n[1]=a,r=n[0]}let s;if(r.startsWith("/"))s=r;else if(r===".."){let a=e.state.cwd.split("/").filter(l=>l);a.pop(),s=`/${a.join("/")}`}else r==="."?s=e.state.cwd:r.startsWith("~")?s=(e.state.env.get("HOME")||"/")+r.slice(1):s=`${e.state.cwd}/${r}`;s=iC(s);try{if(!(await e.fs.stat(s)).isDirectory)return z(`bash: pushd: ${r}: Not a directory
|
|
906
|
+
`,1)}catch{return z(`bash: pushd: ${r}: No such file or directory
|
|
907
|
+
`,1)}n.unshift(e.state.cwd),e.state.previousDir=e.state.cwd,e.state.cwd=s,e.state.env.set("PWD",s),e.state.env.set("OLDPWD",e.state.previousDir);let i=e.state.env.get("HOME")||"",o=`${[s,...n].map(a=>vi(a,i)).join(" ")}
|
|
908
|
+
`;return be(o)}function Qu(e,t){let n=Zu(e);for(let o of t)if(o!=="--")return o.startsWith("-")&&o!=="-"?z(`bash: popd: ${o}: invalid option
|
|
909
|
+
`,2):z(`bash: popd: too many arguments
|
|
910
|
+
`,2);if(n.length===0)return z(`bash: popd: directory stack empty
|
|
911
|
+
`,1);let r=n.shift();if(!r)return z(`bash: popd: directory stack empty
|
|
912
|
+
`,1);e.state.previousDir=e.state.cwd,e.state.cwd=r,e.state.env.set("PWD",r),e.state.env.set("OLDPWD",e.state.previousDir);let s=e.state.env.get("HOME")||"",i=`${[r,...n].map(o=>vi(o,s)).join(" ")}
|
|
913
|
+
`;return be(i)}function Xu(e,t){let n=Zu(e),r=!1,s=!1,i=!1,o=!1;for(let u of t)if(u!=="--")if(u.startsWith("-"))for(let f of u.slice(1))if(f==="c")r=!0;else if(f==="l")s=!0;else if(f==="p")i=!0;else if(f==="v")i=!0,o=!0;else return z(`bash: dirs: -${f}: invalid option
|
|
914
|
+
`,2);else return z(`bash: dirs: too many arguments
|
|
915
|
+
`,1);if(r)return e.state.directoryStack=[],ye;let a=[e.state.cwd,...n],l=e.state.env.get("HOME")||"",c;return o?(c=a.map((u,f)=>{let p=s?u:vi(u,l);return` ${f} ${p}`}).join(`
|
|
916
|
+
`),c+=`
|
|
917
|
+
`):i?c=a.map(u=>s?u:vi(u,l)).join(`
|
|
918
|
+
`)+`
|
|
919
|
+
`:c=a.map(u=>s?u:vi(u,l)).join(" ")+`
|
|
920
|
+
`,be(c)}ot();xe();async function ka(e,t,n){let r=t;if(r.length>0){let a=r[0];if(a==="--")r=r.slice(1);else if(a.startsWith("-")&&a!=="-"&&a.length>1)return z(`bash: eval: ${a}: invalid option
|
|
921
|
+
eval: usage: eval [arg ...]
|
|
922
|
+
`,2)}if(r.length===0)return ye;let s=r.join(" ");if(s.trim()==="")return ye;let i=e.state.groupStdin,o=n??e.state.groupStdin;o!==void 0&&(e.state.groupStdin=o);try{let a=Sn(s);return await e.executeScript(a)}catch(a){if(a instanceof vt||a instanceof kt||a instanceof xt||a instanceof ge)throw a;if(a.name==="ParseException")return z(`bash: eval: ${a.message}
|
|
923
|
+
`);throw a}finally{e.state.groupStdin=i}}xe();function Yu(e,t){let n,r="";if(t.length===0)n=e.state.lastExitCode;else{let s=t[0],i=Number.parseInt(s,10);s===""||Number.isNaN(i)||!/^-?\d+$/.test(s)?(r=`bash: exit: ${s}: numeric argument required
|
|
924
|
+
`,n=2):n=(i%256+256)%256}throw new ge(n,"",r)}gr();function Ju(e,t){let n=!1,r=[];for(let o of t)o==="-n"?n=!0:o==="-p"||o==="--"||r.push(o);if(r.length===0&&!n){let o="",a=e.state.exportedVars??new Set,l=Array.from(a).sort();for(let c of l){let u=e.state.env.get(c);if(u!==void 0){let f=u.replace(/\\/g,"\\\\").replace(/"/g,'\\"');o+=`declare -x ${c}="${f}"
|
|
925
|
+
`}}return be(o)}if(n){for(let o of r){let a,l;if(o.includes("=")){let c=o.indexOf("=");a=o.slice(0,c),l=nt(e,o.slice(c+1)),e.state.env.set(a,l)}else a=o;ta(e,a)}return ye}let s="",i=0;for(let o of r){let a,l,c=!1,u=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(u)a=u[1],l=nt(e,u[2]),c=!0;else if(o.includes("=")){let f=o.indexOf("=");a=o.slice(0,f),l=nt(e,o.slice(f+1))}else a=o;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a)){s+=`bash: export: \`${o}': not a valid identifier
|
|
926
|
+
`,i=1;continue}if(l!==void 0)if(c){let f=e.state.env.get(a)??"";e.state.env.set(a,f+l)}else e.state.env.set(a,l);else e.state.env.has(a)||e.state.env.set(a,"");kn(e,a)}return H("",s,i)}function Na(e,t){if(t.length<2)return z(`bash: getopts: usage: getopts optstring name [arg ...]
|
|
927
|
+
`);let n=t[0],r=t[1],s=!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r),i=n.startsWith(":"),o=i?n.slice(1):n,a;if(t.length>2)a=t.slice(2);else{let m=Number.parseInt(e.state.env.get("#")||"0",10);a=[];for(let g=1;g<=m;g++)a.push(e.state.env.get(String(g))||"")}let l=Number.parseInt(e.state.env.get("OPTIND")||"1",10);l<1&&(l=1);let c=Number.parseInt(e.state.env.get("__GETOPTS_CHARINDEX")||"0",10);if(e.state.env.set("OPTARG",""),l>a.length)return s||e.state.env.set(r,"?"),e.state.env.set("OPTIND",String(a.length+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),{exitCode:s?2:1,stdout:"",stderr:""};let u=a[l-1];if(!u||u==="-"||!u.startsWith("-"))return s||e.state.env.set(r,"?"),{exitCode:s?2:1,stdout:"",stderr:""};if(u==="--")return e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),s||e.state.env.set(r,"?"),{exitCode:s?2:1,stdout:"",stderr:""};let f=c===0?1:c,p=u[f];if(!p)return e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),Na(e,t);let h=o.indexOf(p);if(h===-1){let m="";return i?e.state.env.set("OPTARG",p):m=`bash: illegal option -- ${p}
|
|
928
|
+
`,s||e.state.env.set(r,"?"),f+1<u.length?(e.state.env.set("__GETOPTS_CHARINDEX",String(f+1)),e.state.env.set("OPTIND",String(l))):(e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0")),{exitCode:s?2:0,stdout:"",stderr:m}}if(h+1<o.length&&o[h+1]===":")if(f+1<u.length)e.state.env.set("OPTARG",u.slice(f+1)),e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0");else{if(l>=a.length){let m="";return i?(e.state.env.set("OPTARG",p),s||e.state.env.set(r,":")):(m=`bash: option requires an argument -- ${p}
|
|
929
|
+
`,s||e.state.env.set(r,"?")),e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),{exitCode:s?2:0,stdout:"",stderr:m}}e.state.env.set("OPTARG",a[l]),e.state.env.set("OPTIND",String(l+2)),e.state.env.set("__GETOPTS_CHARINDEX","0")}else f+1<u.length?(e.state.env.set("__GETOPTS_CHARINDEX",String(f+1)),e.state.env.set("OPTIND",String(l))):(e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"));return s||e.state.env.set(r,p),{exitCode:s?2:0,stdout:"",stderr:""}}async function ef(e,t){e.state.hashTable||(e.state.hashTable=new Map);let n=!1,r=!1,s=!1,i=!1,o=!1,a="",l=[],c=0;for(;c<t.length;){let d=t[c];if(d==="--"){c++,l.push(...t.slice(c));break}if(d==="-r")n=!0,c++;else if(d==="-d")r=!0,c++;else if(d==="-l")s=!0,c++;else if(d==="-t")o=!0,c++;else if(d==="-p"){if(i=!0,c++,c>=t.length)return z(`bash: hash: -p: option requires an argument
|
|
930
|
+
`,1);a=t[c],c++}else if(d.startsWith("-")&&d.length>1){for(let m of d.slice(1))if(m==="r")n=!0;else if(m==="d")r=!0;else if(m==="l")s=!0;else if(m==="t")o=!0;else return m==="p"?z(`bash: hash: -p: option requires an argument
|
|
931
|
+
`,1):z(`bash: hash: -${m}: invalid option
|
|
932
|
+
`,1);c++}else l.push(d),c++}if(n)return e.state.hashTable.clear(),ye;if(r){if(l.length===0)return z(`bash: hash: -d: option requires an argument
|
|
933
|
+
`,1);let d=!1,m="";for(let g of l)e.state.hashTable.has(g)?e.state.hashTable.delete(g):(m+=`bash: hash: ${g}: not found
|
|
934
|
+
`,d=!0);return d?z(m,1):ye}if(o){if(l.length===0)return z(`bash: hash: -t: option requires an argument
|
|
935
|
+
`,1);let d="",m=!1,g="";for(let y of l){let w=e.state.hashTable.get(y);w?l.length>1?d+=`${y} ${w}
|
|
936
|
+
`:d+=`${w}
|
|
937
|
+
`:(g+=`bash: hash: ${y}: not found
|
|
938
|
+
`,m=!0)}return m?{exitCode:1,stdout:d,stderr:g}:be(d)}if(i){if(l.length===0)return z(`bash: hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]
|
|
939
|
+
`,1);let d=l[0];return e.state.hashTable.set(d,a),ye}if(l.length===0){if(e.state.hashTable.size===0)return be(`hash: hash table empty
|
|
940
|
+
`);let d="";if(s)for(let[m,g]of e.state.hashTable)d+=`builtin hash -p ${g} ${m}
|
|
941
|
+
`;else{d=`hits command
|
|
942
|
+
`;for(let[,m]of e.state.hashTable)d+=` 1 ${m}
|
|
943
|
+
`}return be(d)}let u=!1,f="",h=(e.state.env.get("PATH")||"/usr/bin:/bin").split(":");for(let d of l){if(d.includes("/")){f+=`bash: hash: ${d}: cannot use / in name
|
|
944
|
+
`,u=!0;continue}let m=!1;for(let g of h){if(!g)continue;let y=`${g}/${d}`;if(await e.fs.exists(y)){e.state.hashTable.set(d,y),m=!0;break}}m||(f+=`bash: hash: ${d}: not found
|
|
945
|
+
`,u=!0)}return u?z(f,1):ye}Ve();var Cy=new Map([[":",[": [arguments]",`Null command.
|
|
946
|
+
No effect; the command does nothing.
|
|
947
|
+
Exit Status:
|
|
948
|
+
Always succeeds.`]],[".",[". filename [arguments]",`Execute commands from a file in the current shell.
|
|
949
|
+
Read and execute commands from FILENAME in the current shell.
|
|
950
|
+
The entries in $PATH are used to find the directory containing FILENAME.
|
|
951
|
+
Exit Status:
|
|
952
|
+
Returns the status of the last command executed in FILENAME.`]],["[",["[ arg... ]",`Evaluate conditional expression.
|
|
953
|
+
This is a synonym for the "test" builtin, but the last argument must
|
|
954
|
+
be a literal \`]', to match the opening \`['.`]],["alias",["alias [-p] [name[=value] ... ]",`Define or display aliases.
|
|
955
|
+
Without arguments, \`alias' prints the list of aliases in the reusable
|
|
956
|
+
form \`alias NAME=VALUE' on standard output.
|
|
957
|
+
Exit Status:
|
|
958
|
+
alias returns true unless a NAME is supplied for which no alias has been
|
|
959
|
+
defined.`]],["bg",["bg [job_spec ...]",`Move jobs to the background.
|
|
960
|
+
Place the jobs identified by each JOB_SPEC in the background, as if they
|
|
961
|
+
had been started with \`&'.`]],["break",["break [n]",`Exit for, while, or until loops.
|
|
962
|
+
Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing
|
|
963
|
+
loops.
|
|
964
|
+
Exit Status:
|
|
965
|
+
The exit status is 0 unless N is not greater than or equal to 1.`]],["builtin",["builtin [shell-builtin [arg ...]]",`Execute shell builtins.
|
|
966
|
+
Execute SHELL-BUILTIN with arguments ARGs without performing command
|
|
967
|
+
lookup. This is useful when you wish to reimplement a shell builtin
|
|
968
|
+
as a shell function, but need to execute the builtin within the function.
|
|
969
|
+
Exit Status:
|
|
970
|
+
Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
|
|
971
|
+
not a shell builtin.`]],["caller",["caller [expr]",`Return the context of the current subroutine call.
|
|
972
|
+
Without EXPR, returns "$line $filename". With EXPR, returns
|
|
973
|
+
"$line $subroutine $filename"; this extra information can be used to
|
|
974
|
+
provide a stack trace.
|
|
975
|
+
Exit Status:
|
|
976
|
+
Returns 0 unless the shell is not executing a subroutine call or
|
|
977
|
+
EXPR is invalid.`]],["cd",["cd [-L|-P] [dir]",`Change the shell working directory.
|
|
978
|
+
Change the current directory to DIR. The default DIR is the value of the
|
|
979
|
+
HOME shell variable.
|
|
980
|
+
|
|
981
|
+
The variable CDPATH defines the search path for the directory containing
|
|
982
|
+
DIR. Alternative directory names in CDPATH are separated by a colon (:).
|
|
983
|
+
A null directory name is the same as the current directory. If DIR begins
|
|
984
|
+
with a slash (/), then CDPATH is not used.
|
|
985
|
+
|
|
986
|
+
If the directory is not found, and the shell option \`cdable_vars' is set,
|
|
987
|
+
the word is assumed to be a variable name. If that variable has a value,
|
|
988
|
+
its value is used for DIR.
|
|
989
|
+
|
|
990
|
+
Options:
|
|
991
|
+
-L force symbolic links to be followed
|
|
992
|
+
-P use the physical directory structure without following symbolic
|
|
993
|
+
links
|
|
994
|
+
|
|
995
|
+
The default is to follow symbolic links, as if \`-L' were specified.
|
|
996
|
+
|
|
997
|
+
Exit Status:
|
|
998
|
+
Returns 0 if the directory is changed; non-zero otherwise.`]],["command",["command [-pVv] command [arg ...]",`Execute a simple command or display information about commands.
|
|
999
|
+
Runs COMMAND with ARGS suppressing shell function lookup, or display
|
|
1000
|
+
information about the specified COMMANDs.
|
|
1001
|
+
|
|
1002
|
+
Options:
|
|
1003
|
+
-p use a default value for PATH that is guaranteed to find all of
|
|
1004
|
+
the standard utilities
|
|
1005
|
+
-v print a description of COMMAND similar to the \`type' builtin
|
|
1006
|
+
-V print a more verbose description of each COMMAND
|
|
1007
|
+
|
|
1008
|
+
Exit Status:
|
|
1009
|
+
Returns exit status of COMMAND, or failure if COMMAND is not found.`]],["compgen",["compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]",`Display possible completions depending on the options.
|
|
1010
|
+
Intended to be used from within a shell function generating possible
|
|
1011
|
+
completions. If the optional WORD argument is supplied, matches against
|
|
1012
|
+
WORD are generated.
|
|
1013
|
+
Exit Status:
|
|
1014
|
+
Returns success unless an invalid option is supplied or an error occurs.`]],["complete",["complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]",`Specify how arguments are to be completed.
|
|
1015
|
+
For each NAME, specify how arguments are to be completed.
|
|
1016
|
+
Exit Status:
|
|
1017
|
+
Returns success unless an invalid option is supplied or an error occurs.`]],["continue",["continue [n]",`Resume for, while, or until loops.
|
|
1018
|
+
Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.
|
|
1019
|
+
If N is specified, resumes the Nth enclosing loop.
|
|
1020
|
+
Exit Status:
|
|
1021
|
+
The exit status is 0 unless N is not greater than or equal to 1.`]],["declare",["declare [-aAfFgilnrtux] [-p] [name[=value] ...]",`Set variable values and attributes.
|
|
1022
|
+
Declare variables and give them attributes. If no NAMEs are given,
|
|
1023
|
+
display the attributes and values of all variables.
|
|
1024
|
+
|
|
1025
|
+
Options:
|
|
1026
|
+
-a to make NAMEs indexed arrays (if supported)
|
|
1027
|
+
-A to make NAMEs associative arrays (if supported)
|
|
1028
|
+
-i to make NAMEs have the \`integer' attribute
|
|
1029
|
+
-l to convert the value of each NAME to lower case on assignment
|
|
1030
|
+
-n make NAME a reference to the variable named by its value
|
|
1031
|
+
-r to make NAMEs readonly
|
|
1032
|
+
-t to make NAMEs have the \`trace' attribute
|
|
1033
|
+
-u to convert the value of each NAME to upper case on assignment
|
|
1034
|
+
-x to make NAMEs export
|
|
1035
|
+
|
|
1036
|
+
Exit Status:
|
|
1037
|
+
Returns success unless an invalid option is supplied or a variable
|
|
1038
|
+
assignment error occurs.`]],["dirs",["dirs [-clpv] [+N] [-N]",`Display directory stack.
|
|
1039
|
+
Display the list of currently remembered directories. Directories
|
|
1040
|
+
find their way onto the list with the \`pushd' command; you can get
|
|
1041
|
+
back up through the list with the \`popd' command.
|
|
1042
|
+
Exit Status:
|
|
1043
|
+
Returns success unless an invalid option is supplied or an error occurs.`]],["disown",["disown [-h] [-ar] [jobspec ...]",`Remove jobs from current shell.
|
|
1044
|
+
Without any JOBSPECs, remove the current job.`]],["echo",["echo [-neE] [arg ...]",`Write arguments to the standard output.
|
|
1045
|
+
Display the ARGs, separated by a single space character and followed by a
|
|
1046
|
+
newline, on the standard output.
|
|
1047
|
+
|
|
1048
|
+
Options:
|
|
1049
|
+
-n do not append a newline
|
|
1050
|
+
-e enable interpretation of the following backslash escapes
|
|
1051
|
+
-E explicitly suppress interpretation of backslash escapes
|
|
1052
|
+
|
|
1053
|
+
Exit Status:
|
|
1054
|
+
Returns success unless a write error occurs.`]],["enable",["enable [-a] [-dnps] [-f filename] [name ...]",`Enable and disable shell builtins.
|
|
1055
|
+
Enables and disables builtin shell commands.
|
|
1056
|
+
Exit Status:
|
|
1057
|
+
Returns success unless NAME is not a shell builtin or an error occurs.`]],["eval",["eval [arg ...]",`Execute arguments as a shell command.
|
|
1058
|
+
Combine ARGs into a single string, use the result as input to the shell,
|
|
1059
|
+
and execute the resulting commands.
|
|
1060
|
+
Exit Status:
|
|
1061
|
+
Returns exit status of command or success if command is null.`]],["exec",["exec [-cl] [-a name] [command [arguments ...]] [redirection ...]",`Replace the shell with the given command.
|
|
1062
|
+
Execute COMMAND, replacing this shell with the specified program.
|
|
1063
|
+
ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,
|
|
1064
|
+
any redirections take effect in the current shell.
|
|
1065
|
+
Exit Status:
|
|
1066
|
+
Returns success unless COMMAND is not found or a redirection error occurs.`]],["exit",["exit [n]",`Exit the shell.
|
|
1067
|
+
Exits the shell with a status of N. If N is omitted, the exit status
|
|
1068
|
+
is that of the last command executed.`]],["export",["export [-fn] [name[=value] ...] or export -p",`Set export attribute for shell variables.
|
|
1069
|
+
Marks each NAME for automatic export to the environment of subsequently
|
|
1070
|
+
executed commands. If VALUE is supplied, assign VALUE before exporting.
|
|
1071
|
+
|
|
1072
|
+
Options:
|
|
1073
|
+
-f refer to shell functions
|
|
1074
|
+
-n remove the export property from each NAME
|
|
1075
|
+
-p display a list of all exported variables and functions
|
|
1076
|
+
|
|
1077
|
+
Exit Status:
|
|
1078
|
+
Returns success unless an invalid option is given or NAME is invalid.`]],["false",["false",`Return an unsuccessful result.
|
|
1079
|
+
Exit Status:
|
|
1080
|
+
Always fails.`]],["fc",["fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]",`Display or execute commands from the history list.
|
|
1081
|
+
Exit Status:
|
|
1082
|
+
Returns success or status of executed command.`]],["fg",["fg [job_spec]",`Move job to the foreground.
|
|
1083
|
+
Place the job identified by JOB_SPEC in the foreground, making it the
|
|
1084
|
+
current job.`]],["getopts",["getopts optstring name [arg]",`Parse option arguments.
|
|
1085
|
+
Getopts is used by shell procedures to parse positional parameters
|
|
1086
|
+
as options.
|
|
1087
|
+
|
|
1088
|
+
OPTSTRING contains the option letters to be recognized; if a letter
|
|
1089
|
+
is followed by a colon, the option is expected to have an argument,
|
|
1090
|
+
which should be separated from it by white space.
|
|
1091
|
+
Exit Status:
|
|
1092
|
+
Returns success if an option is found; fails if the end of options is
|
|
1093
|
+
encountered or an error occurs.`]],["hash",["hash [-lr] [-p pathname] [-dt] [name ...]",`Remember or display program locations.
|
|
1094
|
+
Determine and remember the full pathname of each command NAME.
|
|
1095
|
+
Exit Status:
|
|
1096
|
+
Returns success unless NAME is not found or an invalid option is given.`]],["help",["help [-s] [pattern ...]",`Display information about builtin commands.
|
|
1097
|
+
Displays brief summaries of builtin commands. If PATTERN is
|
|
1098
|
+
specified, gives detailed help on all commands matching PATTERN,
|
|
1099
|
+
otherwise the list of help topics is printed.
|
|
1100
|
+
|
|
1101
|
+
Options:
|
|
1102
|
+
-s output only a short usage synopsis for each topic matching
|
|
1103
|
+
PATTERN
|
|
1104
|
+
|
|
1105
|
+
Exit Status:
|
|
1106
|
+
Returns success unless PATTERN is not found.`]],["history",["history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]",`Display or manipulate the history list.
|
|
1107
|
+
Display the history list with line numbers, prefixing each modified
|
|
1108
|
+
entry with a \`*'.
|
|
1109
|
+
Exit Status:
|
|
1110
|
+
Returns success unless an invalid option is given or an error occurs.`]],["jobs",["jobs [-lnprs] [jobspec ...] or jobs -x command [args]",`Display status of jobs.
|
|
1111
|
+
Lists the active jobs.
|
|
1112
|
+
Exit Status:
|
|
1113
|
+
Returns success unless an invalid option is given or an error occurs.`]],["kill",["kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]",`Send a signal to a job.
|
|
1114
|
+
Send the processes identified by PID or JOBSPEC the signal named by
|
|
1115
|
+
SIGSPEC or SIGNUM.
|
|
1116
|
+
Exit Status:
|
|
1117
|
+
Returns success unless an invalid option is given or an error occurs.`]],["let",["let arg [arg ...]",`Evaluate arithmetic expressions.
|
|
1118
|
+
Evaluate each ARG as an arithmetic expression. Evaluation is done in
|
|
1119
|
+
fixed-width integers with no check for overflow, though division by 0
|
|
1120
|
+
is trapped and flagged as an error.
|
|
1121
|
+
Exit Status:
|
|
1122
|
+
If the last ARG evaluates to 0, let returns 1; 0 is returned otherwise.`]],["local",["local [option] name[=value] ...",`Define local variables.
|
|
1123
|
+
Create a local variable called NAME, and give it VALUE. OPTION can
|
|
1124
|
+
be any option accepted by \`declare'.
|
|
1125
|
+
|
|
1126
|
+
Local can only be used within a function; it makes the variable NAME
|
|
1127
|
+
have a visible scope restricted to that function and its children.
|
|
1128
|
+
Exit Status:
|
|
1129
|
+
Returns success unless an invalid option is supplied, a variable
|
|
1130
|
+
assignment error occurs, or the shell is not executing a function.`]],["logout",["logout [n]",`Exit a login shell.
|
|
1131
|
+
Exits a login shell with exit status N. Returns an error if not executed
|
|
1132
|
+
in a login shell.`]],["mapfile",["mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]",`Read lines from the standard input into an indexed array variable.
|
|
1133
|
+
Read lines from the standard input into the indexed array variable ARRAY,
|
|
1134
|
+
or from file descriptor FD if the -u option is supplied.
|
|
1135
|
+
|
|
1136
|
+
Options:
|
|
1137
|
+
-d delim Use DELIM to terminate lines, instead of newline
|
|
1138
|
+
-n count Copy at most COUNT lines
|
|
1139
|
+
-O origin Begin assigning to ARRAY at index ORIGIN
|
|
1140
|
+
-s count Discard the first COUNT lines read
|
|
1141
|
+
-t Remove a trailing DELIM from each line read (default newline)
|
|
1142
|
+
-u fd Read lines from file descriptor FD instead of standard input
|
|
1143
|
+
|
|
1144
|
+
Exit Status:
|
|
1145
|
+
Returns success unless an invalid option is given or ARRAY is readonly.`]],["popd",["popd [-n] [+N | -N]",`Remove directories from stack.
|
|
1146
|
+
Removes entries from the directory stack.
|
|
1147
|
+
Exit Status:
|
|
1148
|
+
Returns success unless an invalid argument is supplied or the directory
|
|
1149
|
+
change fails.`]],["printf",["printf [-v var] format [arguments]",`Formats and prints ARGUMENTS under control of the FORMAT.
|
|
1150
|
+
|
|
1151
|
+
Options:
|
|
1152
|
+
-v var assign the output to shell variable VAR rather than
|
|
1153
|
+
display it on the standard output
|
|
1154
|
+
|
|
1155
|
+
FORMAT is a character string which contains three types of objects: plain
|
|
1156
|
+
characters, which are simply copied to standard output; character escape
|
|
1157
|
+
sequences, which are converted and copied to the standard output; and
|
|
1158
|
+
format specifications, each of which causes printing of the next successive
|
|
1159
|
+
argument.
|
|
1160
|
+
Exit Status:
|
|
1161
|
+
Returns success unless an invalid option is given or a write or assignment
|
|
1162
|
+
error occurs.`]],["pushd",["pushd [-n] [+N | -N | dir]",`Add directories to stack.
|
|
1163
|
+
Adds a directory to the top of the directory stack, or rotates
|
|
1164
|
+
the stack, making the new top of the stack the current working
|
|
1165
|
+
directory.
|
|
1166
|
+
Exit Status:
|
|
1167
|
+
Returns success unless an invalid argument is supplied or the directory
|
|
1168
|
+
change fails.`]],["pwd",["pwd [-LP]",`Print the name of the current working directory.
|
|
1169
|
+
|
|
1170
|
+
Options:
|
|
1171
|
+
-L print the value of $PWD if it names the current working
|
|
1172
|
+
directory
|
|
1173
|
+
-P print the physical directory, without any symbolic links
|
|
1174
|
+
|
|
1175
|
+
By default, \`pwd' behaves as if \`-L' were specified.
|
|
1176
|
+
Exit Status:
|
|
1177
|
+
Returns 0 unless an invalid option is given or the current directory
|
|
1178
|
+
cannot be read.`]],["read",["read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]",`Read a line from the standard input and split it into fields.
|
|
1179
|
+
Reads a single line from the standard input, or from file descriptor FD
|
|
1180
|
+
if the -u option is supplied. The line is split into fields as with word
|
|
1181
|
+
splitting, and the first word is assigned to the first NAME, the second
|
|
1182
|
+
word to the second NAME, and so on, with any leftover words assigned to
|
|
1183
|
+
the last NAME.
|
|
1184
|
+
Exit Status:
|
|
1185
|
+
The return code is zero, unless end-of-file is encountered, read times out,
|
|
1186
|
+
or an invalid file descriptor is supplied as the argument to -u.`]],["readarray",["readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]","Read lines from a file into an array variable.\n A synonym for `mapfile'."]],["readonly",["readonly [-aAf] [name[=value] ...] or readonly -p",`Mark shell variables as unchangeable.
|
|
1187
|
+
Mark each NAME as read-only; the values of these NAMEs may not be
|
|
1188
|
+
changed by subsequent assignment.
|
|
1189
|
+
Exit Status:
|
|
1190
|
+
Returns success unless an invalid option is given or NAME is invalid.`]],["return",["return [n]",`Return from a shell function.
|
|
1191
|
+
Causes a function or sourced script to exit with the return value
|
|
1192
|
+
specified by N. If N is omitted, the return status is that of the
|
|
1193
|
+
last command executed within the function or script.
|
|
1194
|
+
Exit Status:
|
|
1195
|
+
Returns N, or failure if the shell is not executing a function or script.`]],["set",["set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]",`Set or unset values of shell options and positional parameters.
|
|
1196
|
+
Change the value of shell attributes and positional parameters, or
|
|
1197
|
+
display the names and values of shell variables.
|
|
1198
|
+
|
|
1199
|
+
Options:
|
|
1200
|
+
-e Exit immediately if a command exits with a non-zero status.
|
|
1201
|
+
-u Treat unset variables as an error when substituting.
|
|
1202
|
+
-x Print commands and their arguments as they are executed.
|
|
1203
|
+
-o option-name
|
|
1204
|
+
Set the variable corresponding to option-name
|
|
1205
|
+
|
|
1206
|
+
Exit Status:
|
|
1207
|
+
Returns success unless an invalid option is given.`]],["shift",["shift [n]",`Shift positional parameters.
|
|
1208
|
+
Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is
|
|
1209
|
+
not given, it is assumed to be 1.
|
|
1210
|
+
Exit Status:
|
|
1211
|
+
Returns success unless N is negative or greater than $#.`]],["shopt",["shopt [-pqsu] [-o] [optname ...]",`Set and unset shell options.
|
|
1212
|
+
Change the setting of each shell option OPTNAME. Without any option
|
|
1213
|
+
arguments, list each supplied OPTNAME, or all shell options if no
|
|
1214
|
+
OPTNAMEs are given, with an indication of whether or not each is set.
|
|
1215
|
+
|
|
1216
|
+
Options:
|
|
1217
|
+
-o restrict OPTNAMEs to those defined for use with \`set -o'
|
|
1218
|
+
-p print each shell option with an indication of its status
|
|
1219
|
+
-q suppress output
|
|
1220
|
+
-s enable (set) each OPTNAME
|
|
1221
|
+
-u disable (unset) each OPTNAME
|
|
1222
|
+
|
|
1223
|
+
Exit Status:
|
|
1224
|
+
Returns success if OPTNAME is enabled; fails if an invalid option is
|
|
1225
|
+
given or OPTNAME is disabled.`]],["source",["source filename [arguments]",`Execute commands from a file in the current shell.
|
|
1226
|
+
Read and execute commands from FILENAME in the current shell.
|
|
1227
|
+
The entries in $PATH are used to find the directory containing FILENAME.
|
|
1228
|
+
Exit Status:
|
|
1229
|
+
Returns the status of the last command executed in FILENAME.`]],["suspend",["suspend [-f]",`Suspend shell execution.
|
|
1230
|
+
Suspend the execution of this shell until it receives a SIGCONT signal.`]],["test",["test [expr]",`Evaluate conditional expression.
|
|
1231
|
+
Exits with a status of 0 (true) or 1 (false) depending on
|
|
1232
|
+
the evaluation of EXPR. Expressions may be unary or binary.
|
|
1233
|
+
Exit Status:
|
|
1234
|
+
Returns success if EXPR evaluates to true; fails if EXPR evaluates to
|
|
1235
|
+
false or an invalid argument is given.`]],["times",["times",`Display process times.
|
|
1236
|
+
Prints the accumulated user and system times for the shell and all of its
|
|
1237
|
+
child processes.
|
|
1238
|
+
Exit Status:
|
|
1239
|
+
Always succeeds.`]],["trap",["trap [-lp] [[arg] signal_spec ...]",`Trap signals and other events.
|
|
1240
|
+
Defines and activates handlers to be run when the shell receives signals
|
|
1241
|
+
or other conditions.
|
|
1242
|
+
Exit Status:
|
|
1243
|
+
Returns success unless a SIGSPEC is invalid or an invalid option is given.`]],["true",["true",`Return a successful result.
|
|
1244
|
+
Exit Status:
|
|
1245
|
+
Always succeeds.`]],["type",["type [-afptP] name [name ...]",`Display information about command type.
|
|
1246
|
+
For each NAME, indicate how it would be interpreted if used as a
|
|
1247
|
+
command name.
|
|
1248
|
+
|
|
1249
|
+
Options:
|
|
1250
|
+
-a display all locations containing an executable named NAME
|
|
1251
|
+
-f suppress shell function lookup
|
|
1252
|
+
-P force a PATH search for each NAME, even if it is an alias,
|
|
1253
|
+
builtin, or function, and returns the name of the disk file
|
|
1254
|
+
that would be executed
|
|
1255
|
+
-p returns either the name of the disk file that would be executed,
|
|
1256
|
+
or nothing if \`type -t NAME' would not return \`file'
|
|
1257
|
+
-t output a single word which is one of \`alias', \`keyword',
|
|
1258
|
+
\`function', \`builtin', \`file' or \`', if NAME is an alias,
|
|
1259
|
+
shell reserved word, shell function, shell builtin, disk file,
|
|
1260
|
+
or not found, respectively
|
|
1261
|
+
|
|
1262
|
+
Exit Status:
|
|
1263
|
+
Returns success if all of the NAMEs are found; fails if any are not found.`]],["typeset",["typeset [-aAfFgilnrtux] [-p] name[=value] ...","Set variable values and attributes.\n A synonym for `declare'."]],["ulimit",["ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]",`Modify shell resource limits.
|
|
1264
|
+
Provides control over the resources available to the shell and processes
|
|
1265
|
+
it creates, on systems that allow such control.
|
|
1266
|
+
Exit Status:
|
|
1267
|
+
Returns success unless an invalid option is supplied or an error occurs.`]],["umask",["umask [-p] [-S] [mode]",`Display or set file mode mask.
|
|
1268
|
+
Sets the user file-creation mask to MODE. If MODE is omitted, prints
|
|
1269
|
+
the current value of the mask.
|
|
1270
|
+
Exit Status:
|
|
1271
|
+
Returns success unless MODE is invalid or an invalid option is given.`]],["unalias",["unalias [-a] name [name ...]",`Remove each NAME from the list of defined aliases.
|
|
1272
|
+
Exit Status:
|
|
1273
|
+
Returns success unless a NAME is not an existing alias.`]],["unset",["unset [-f] [-v] [-n] [name ...]",`Unset values and attributes of shell variables and functions.
|
|
1274
|
+
For each NAME, remove the corresponding variable or function.
|
|
1275
|
+
|
|
1276
|
+
Options:
|
|
1277
|
+
-f treat each NAME as a shell function
|
|
1278
|
+
-v treat each NAME as a shell variable
|
|
1279
|
+
-n treat each NAME as a name reference and unset the variable itself
|
|
1280
|
+
rather than the variable it references
|
|
1281
|
+
|
|
1282
|
+
Without options, unset first tries to unset a variable, and if that fails,
|
|
1283
|
+
tries to unset a function.
|
|
1284
|
+
Exit Status:
|
|
1285
|
+
Returns success unless an invalid option is given or a NAME is read-only.`]],["wait",["wait [-fn] [id ...]",`Wait for job completion and return exit status.
|
|
1286
|
+
Waits for each process identified by an ID, which may be a process ID or a
|
|
1287
|
+
job specification, and reports its termination status.
|
|
1288
|
+
Exit Status:
|
|
1289
|
+
Returns the status of the last ID; fails if ID is invalid or an invalid
|
|
1290
|
+
option is given.`]]]),vy=[...Cy.keys()].sort();function tf(e,t){let n=!1,r=[],s=0;for(;s<t.length;){let l=t[s];if(l==="--"){for(s++;s<t.length;)r.push(t[s]),s++;break}if(l.startsWith("-")&&l.length>1){for(let c=1;c<l.length;c++){let u=l[c];if(u==="s")n=!0;else return z(`bash: help: -${u}: invalid option
|
|
1291
|
+
`,2)}s++}else r.push(l),s++}if(r.length===0)return aC();let i="",o=!1,a="";for(let l of r){let c=oC(l);if(c.length===0){a+=`bash: help: no help topics match \`${l}'. Try \`help help' or \`man -k ${l}' or \`info ${l}'.
|
|
1292
|
+
`,o=!0;continue}for(let u of c){let f=Cy.get(u);if(!f)continue;let[p,h]=f;n?i+=`${u}: ${p}
|
|
1293
|
+
`:i+=`${u}: ${p}
|
|
1294
|
+
${h}
|
|
1295
|
+
`}}return{exitCode:o?1:0,stdout:i,stderr:a}}function oC(e){let t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,"."),n=K(`^${t}$`);return vy.filter(r=>n.test(r))}function aC(){let e=[];e.push("just-bash shell builtins"),e.push("These shell commands are defined internally. Type `help' to see this list."),e.push("Type `help name' to find out more about the function `name'."),e.push("");let t=36,n=vy.slice(),r=Math.ceil(n.length/2);for(let s=0;s<r;s++){let i=n[s]||"",o=n[s+r]||"",a=i.padEnd(t);e.push(o?`${a}${o}`:i)}return be(`${e.join(`
|
|
1296
|
+
`)}
|
|
1297
|
+
`)}ot();Ft();function lC(e){let t=[],n="",r=0;for(let s of e){for(let i of s)i==="("?r++:i===")"&&r--;n?n+=` ${s}`:n=s,r===0&&(t.push(n),n="")}return n&&t.push(n),t}async function nf(e,t){if(t.length===0)return z(`bash: let: expression expected
|
|
1298
|
+
`);let n=lC(t),r=0;for(let s of n)try{let o=Sn(`(( ${s} ))`).statements[0];if(o&&o.pipelines.length>0&&o.pipelines[0].commands.length>0){let a=o.pipelines[0].commands[0];a.type==="ArithmeticCommand"&&(r=await te(e,a.expression.expression))}}catch(i){return z(`bash: let: ${s}: ${i.message}
|
|
1299
|
+
`)}return H("","",r===0?1:0)}Nt();ot();Ft();dn();vn();gr();async function rf(e,t){if(e.state.localScopes.length===0)return z(`bash: local: can only be used in a function
|
|
1300
|
+
`);let n=e.state.localScopes[e.state.localScopes.length-1],r="",s=0,i=!1,o=!1,a=!1,l=[];for(let c of t)if(c==="-n")i=!0;else if(c==="-a")o=!0;else if(c==="-p")a=!0;else if(c.startsWith("-")&&!c.includes("="))for(let u of c.slice(1))u==="n"?i=!0:u==="a"?o=!0:u==="p"&&(a=!0);else l.push(c);if(l.length===0){let c="",u=Array.from(n.keys()).filter(f=>!f.includes("_")||!f.match(/_\d+$/)).filter(f=>!f.includes("__length")).sort();for(let f of u){let p=e.state.env.get(f);p!==void 0&&(c+=`${f}=${p}
|
|
1301
|
+
`)}return H(c,"",0)}for(let c of l){let u,f,p=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(p){u=p[1];let y=p[2];if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u)){r+=`bash: local: \`${c}': not a valid identifier
|
|
1302
|
+
`,s=1;continue}if(gt(e,u,"bash"),!n.has(u)){n.set(u,e.state.env.get(u));let x=`${u}_`;for(let A of e.state.env.keys())A.startsWith(x)&&!A.includes("__")&&(n.has(A)||n.set(A,e.state.env.get(A)))}let w=`${u}_`;for(let x of e.state.env.keys())x.startsWith(w)&&!x.includes("__")&&e.state.env.delete(x);let b=Gn(y);for(let x=0;x<b.length;x++)e.state.env.set(`${u}_${x}`,b[x]);e.state.env.set(`${u}__length`,String(b.length)),xr(e,u),i&&Jn(e,u);continue}let h=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(h){u=h[1];let y=h[2];if(gt(e,u,"bash"),!n.has(u)){n.set(u,e.state.env.get(u));let O=`${u}_`;for(let P of e.state.env.keys())P.startsWith(O)&&!P.includes("__")&&(n.has(P)||n.set(P,e.state.env.get(P)));let F=`${u}__length`;e.state.env.has(F)&&!n.has(F)&&n.set(F,e.state.env.get(F))}let w=Gn(y),b=at(e,u),x=0,A=e.state.env.get(u);b.length===0&&A!==void 0?(e.state.env.set(`${u}_0`,A),e.state.env.delete(u),x=1):b.length>0&&(x=Math.max(...b)+1);for(let O=0;O<w.length;O++)e.state.env.set(`${u}_${x+O}`,nt(e,w[O]));let $=x+w.length;e.state.env.set(`${u}__length`,String($)),xr(e,u),i&&Jn(e,u);continue}let d=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(d){u=d[1];let y=nt(e,d[2]);gt(e,u,"bash"),n.has(u)||n.set(u,e.state.env.get(u));let w=e.state.env.get(u)??"";e.state.env.set(u,w+y),xr(e,u),i&&Jn(e,u);continue}let m=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([^\]]+)\]=(.*)$/s);if(m){u=m[1];let y=m[2],w=nt(e,m[3]);if(gt(e,u,"bash"),!n.has(u)){n.set(u,e.state.env.get(u));let A=`${u}_`;for(let O of e.state.env.keys())O.startsWith(A)&&!O.includes("__")&&(n.has(O)||n.set(O,e.state.env.get(O)));let $=`${u}__length`;e.state.env.has($)&&!n.has($)&&n.set($,e.state.env.get($))}let b;try{let A=new ce,$=Ce(A,y);b=await te(e,$.expression)}catch{let A=parseInt(y,10);b=Number.isNaN(A)?0:A}e.state.env.set(`${u}_${b}`,w);let x=parseInt(e.state.env.get(`${u}__length`)??"0",10);b>=x&&e.state.env.set(`${u}__length`,String(b+1)),xr(e,u),i&&Jn(e,u);continue}if(c.includes("=")){let y=c.indexOf("=");u=c.slice(0,y),f=nt(e,c.slice(y+1))}else u=c;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u)){r+=`bash: local: \`${c}': not a valid identifier
|
|
1303
|
+
`,s=1;continue}let g=n.has(u);if(f!==void 0){let y=e.state.env.get(u);if(e.state.tempEnvBindings){let w=e.state.accessedTempEnvVars?.has(u),b=e.state.mutatedTempEnvVars?.has(u);if(!w&&!b)for(let x=e.state.tempEnvBindings.length-1;x>=0;x--){let A=e.state.tempEnvBindings[x];if(A.has(u)){y=A.get(u);break}}}cy(e,u,y)}if(!g){let y=e.state.env.get(u);if(e.state.tempEnvBindings)for(let w=e.state.tempEnvBindings.length-1;w>=0;w--){let b=e.state.tempEnvBindings[w];if(b.has(u)){y=b.get(u);break}}if(n.set(u,y),o){let w=`${u}_`;for(let x of e.state.env.keys())x.startsWith(w)&&!x.includes("__")&&(n.has(x)||n.set(x,e.state.env.get(x)));let b=`${u}__length`;e.state.env.has(b)&&!n.has(b)&&n.set(b,e.state.env.get(b))}}if(o&&f===void 0){let y=`${u}_`;for(let w of e.state.env.keys())w.startsWith(y)&&!w.includes("__")&&e.state.env.delete(w);e.state.env.set(`${u}__length`,"0")}else if(f!==void 0){if(gt(e,u,"bash"),i&&f!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(f)){r+=`bash: local: \`${f}': invalid variable name for name reference
|
|
1304
|
+
`,s=1;continue}e.state.env.set(u,f),e.state.options.allexport&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(u))}else{let y=e.state.tempEnvBindings?.some(w=>w.has(u));!g&&!y&&e.state.env.delete(u)}xr(e,u),i&&Jn(e,u)}return H("",r,s)}dn();function sf(e,t,n){let r=`
|
|
1305
|
+
`,s=0,i=0,o=0,a=!1,l="MAPFILE",c=0;for(;c<t.length;){let w=t[c];w==="-d"&&c+1<t.length?(r=t[c+1]===""?"\0":t[c+1]||`
|
|
1306
|
+
`,c+=2):w==="-n"&&c+1<t.length?(s=Number.parseInt(t[c+1],10)||0,c+=2):w==="-O"&&c+1<t.length?(i=Number.parseInt(t[c+1],10)||0,c+=2):w==="-s"&&c+1<t.length?(o=Number.parseInt(t[c+1],10)||0,c+=2):w==="-t"?(a=!0,c++):w==="-u"||w==="-C"||w==="-c"?c+=2:(w.startsWith("-")||(l=w),c++)}let u=n;!u&&e.state.groupStdin!==void 0&&(u=e.state.groupStdin);let f=[],p=u,h=0,d=0,m=e.limits?.maxArrayElements??1e5;for(;p.length>0;){let w=p.indexOf(r);if(w===-1){if(p.length>0){if(d<o)d++;else if(s===0||h<s){if(i+h>=m)return H("",`mapfile: array element limit exceeded (${m})
|
|
1307
|
+
`,1);let A=p,$=A.indexOf("\0");$!==-1&&(A=A.substring(0,$)),f.push(A),h++}}break}let b=p.substring(0,w),x=b.indexOf("\0");if(x!==-1&&(b=b.substring(0,x)),!a&&r!=="\0"&&(b+=r),p=p.substring(w+r.length),d<o){d++;continue}if(s>0&&h>=s)break;if(i+h>=m)return H("",`mapfile: array element limit exceeded (${m})
|
|
1308
|
+
`,1);f.push(b),h++}i===0&&Bn(e,l);for(let w=0;w<f.length;w++)e.state.env.set(`${l}_${i+w}`,f[w]);let g=parseInt(e.state.env.get(`${l}__length`)||"0",10),y=i+f.length;return e.state.env.set(`${l}__length`,String(Math.max(g,y))),e.state.groupStdin!==void 0&&!n&&(e.state.groupStdin=""),H("","",0)}dn();rn();function cC(e){if(!e.startsWith("__rw__:"))return null;let t=e.slice(7),n=t.indexOf(":");if(n===-1)return null;let r=Number.parseInt(t.slice(0,n),10);if(Number.isNaN(r)||r<0)return null;let s=n+1,i=t.slice(s,s+r),o=s+r+1,a=t.slice(o),l=a.indexOf(":");if(l===-1)return null;let c=Number.parseInt(a.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;let u=a.slice(l+1);return{path:i,position:c,content:u}}function uC(e,t,n){return`__rw__:${e.length}:${e}:${t}:${n}`}function of(e,t,n,r=-1){let s=!1,i=`
|
|
1309
|
+
`,o="",a=-1,l=-1,c=null,u=-1,f=-1,p=[],h=0,d=!1,m=(C,N)=>{let R=1;for(;R<C.length;){let I=C[R];if(I==="r")s=!0,R++;else if(I==="s")R++;else{if(I==="d")return R+1<C.length?(i=C.substring(R+1),{nextArgIndex:N+1}):N+1<t.length?(i=t[N+1],{nextArgIndex:N+2}):{nextArgIndex:N+1};if(I==="n"){if(R+1<C.length){let T=C.substring(R+1);return a=Number.parseInt(T,10),(Number.isNaN(a)||a<0)&&(d=!0,a=0),{nextArgIndex:N+1}}else if(N+1<t.length)return a=Number.parseInt(t[N+1],10),(Number.isNaN(a)||a<0)&&(d=!0,a=0),{nextArgIndex:N+2};return{nextArgIndex:N+1}}else if(I==="N"){if(R+1<C.length){let T=C.substring(R+1);return l=Number.parseInt(T,10),(Number.isNaN(l)||l<0)&&(d=!0,l=0),{nextArgIndex:N+1}}else if(N+1<t.length)return l=Number.parseInt(t[N+1],10),(Number.isNaN(l)||l<0)&&(d=!0,l=0),{nextArgIndex:N+2};return{nextArgIndex:N+1}}else{if(I==="a")return R+1<C.length?(c=C.substring(R+1),{nextArgIndex:N+1}):N+1<t.length?(c=t[N+1],{nextArgIndex:N+2}):{nextArgIndex:N+1};if(I==="p")return R+1<C.length?(o=C.substring(R+1),{nextArgIndex:N+1}):N+1<t.length?(o=t[N+1],{nextArgIndex:N+2}):{nextArgIndex:N+1};if(I==="u"){if(R+1<C.length){let T=C.substring(R+1);return u=Number.parseInt(T,10),Number.isNaN(u)||u<0?{nextArgIndex:-2}:{nextArgIndex:N+1}}else if(N+1<t.length)return u=Number.parseInt(t[N+1],10),Number.isNaN(u)||u<0?{nextArgIndex:-2}:{nextArgIndex:N+2};return{nextArgIndex:N+1}}else if(I==="t"){if(R+1<C.length){let T=C.substring(R+1);return f=Number.parseFloat(T),Number.isNaN(f)&&(f=0),{nextArgIndex:N+1}}else if(N+1<t.length)return f=Number.parseFloat(t[N+1]),Number.isNaN(f)&&(f=0),{nextArgIndex:N+2};return{nextArgIndex:N+1}}else if(I==="e"||I==="i"||I==="P"){if(I==="i"&&N+1<t.length)return{nextArgIndex:N+2};R++}else R++}}}return{nextArgIndex:N+1}};for(;h<t.length;){let C=t[h];if(C.startsWith("-")&&C.length>1&&C!=="--"){let N=m(C,h);if(N.nextArgIndex===-1)return{stdout:"",stderr:"",exitCode:2};if(N.nextArgIndex===-2)return{stdout:"",stderr:"",exitCode:1};h=N.nextArgIndex}else if(C==="--")for(h++;h<t.length;)p.push(t[h]),h++;else p.push(C),h++}if(d)return H("","",1);if(p.length===0&&c===null&&p.push("REPLY"),f===0){if(c)Bn(e,c);else{for(let C of p)e.state.env.set(C,"");p.length===0&&e.state.env.set("REPLY","")}return H("","",0)}if(f<0&&f!==-1)return H("","",1);let g=n;u>=0?e.state.fileDescriptors?g=e.state.fileDescriptors.get(u)||"":g="":!g&&e.state.groupStdin!==void 0&&(g=e.state.groupStdin);let y=i===""?"\0":i,w="",b=0,x=!0,A=C=>{if(u>=0&&e.state.fileDescriptors)e.state.fileDescriptors.set(u,g.substring(C));else if(r>=0&&e.state.fileDescriptors){let N=e.state.fileDescriptors.get(r);if(N?.startsWith("__rw__:")){let R=cC(N);if(R){let I=R.position+C;e.state.fileDescriptors.set(r,uC(R.path,I,R.content))}}}else e.state.groupStdin!==void 0&&!n&&(e.state.groupStdin=g.substring(C))};if(l>=0){let C=Math.min(l,g.length);w=g.substring(0,C),b=C,x=C>=l,A(b);let N=p[0]||"REPLY";e.state.env.set(N,w);for(let R=1;R<p.length;R++)e.state.env.set(p[R],"");return H("","",x?0:1)}else if(a>=0){let C=0,N=0,R=!1;for(;N<g.length&&C<a;){let I=g[N];if(I===y){b=N+1,R=!0;break}if(!s&&I==="\\"&&N+1<g.length){let T=g[N+1];if(T===y&&y===`
|
|
1310
|
+
`){N+=2,b=N;continue}if(T===y){N+=2,C++,w+=T,b=N;continue}w+=T,N+=2,C++,b=N}else w+=I,N++,C++,b=N}x=C>=a||R,A(b)}else{b=0;let C=0;for(;C<g.length;){let N=g[C];if(N===y){b=C+y.length,x=!0;break}if(!s&&N==="\\"&&C+1<g.length){let R=g[C+1];if(R===`
|
|
1311
|
+
`){C+=2;continue}if(R===y){w+=R,C+=2;continue}w+=N,w+=R,C+=2;continue}w+=N,C++}if(C>=g.length&&(x=!1,b=C,w.length===0&&g.length===0)){for(let N of p)e.state.env.set(N,"");return c&&Bn(e,c),H("","",1)}A(b)}y===`
|
|
1312
|
+
`&&w.endsWith(`
|
|
1313
|
+
`)&&(w=w.slice(0,-1));let $=C=>s?C:C.replace(/\\(.)/g,"$1");if(p.length===1&&p[0]==="REPLY")return e.state.env.set("REPLY",$(w)),H("","",x?0:1);let O=ht(e.state.env);if(c){let{words:C}=cu(w,O,void 0,s),N=e.limits?.maxArrayElements??1e5;if(C.length>N)return H("",`read: array element limit exceeded (${N})
|
|
1314
|
+
`,1);Bn(e,c);for(let R=0;R<C.length;R++)e.state.env.set(`${c}_${R}`,$(C[R]));return H("","",x?0:1)}let F=p.length,{words:P,wordStarts:M}=cu(w,O,F,s);for(let C=0;C<p.length;C++){let N=p[C];if(C<p.length-1)e.state.env.set(N,$(P[C]??""));else if(C<M.length){let R=w.substring(M[C]);R=vg(R,O,s),R=$(R),e.state.env.set(N,R)}else e.state.env.set(N,"")}return H("","",x?0:1)}xe();function af(e,t){if(e.state.callDepth===0&&e.state.sourceDepth===0)return z("bash: return: can only `return' from a function or sourced script\n");let n=e.state.lastExitCode;if(t.length>0){let r=t[0],s=Number.parseInt(r,10);if(r===""||Number.isNaN(s)||!/^-?\d+$/.test(r))return z(`bash: return: ${r}: numeric argument required
|
|
1315
|
+
`,2);n=(s%256+256)%256}throw new xt(n)}xe();dn();var Ia=`set: usage: set [-eux] [+eux] [-o option] [+o option]
|
|
1316
|
+
Options:
|
|
1317
|
+
-e Exit immediately if a command exits with non-zero status
|
|
1318
|
+
+e Disable -e
|
|
1319
|
+
-u Treat unset variables as an error when substituting
|
|
1320
|
+
+u Disable -u
|
|
1321
|
+
-x Print commands and their arguments as they are executed
|
|
1322
|
+
+x Disable -x
|
|
1323
|
+
-o errexit Same as -e
|
|
1324
|
+
+o errexit Disable errexit
|
|
1325
|
+
-o nounset Same as -u
|
|
1326
|
+
+o nounset Disable nounset
|
|
1327
|
+
-o pipefail Return status of last failing command in pipeline
|
|
1328
|
+
+o pipefail Disable pipefail
|
|
1329
|
+
-o xtrace Same as -x
|
|
1330
|
+
+o xtrace Disable xtrace
|
|
1331
|
+
`,ky=new Map([["e","errexit"],["u","nounset"],["x","xtrace"],["v","verbose"],["f","noglob"],["C","noclobber"],["a","allexport"],["n","noexec"],["h",null],["b",null],["m",null],["B",null],["H",null],["P",null],["T",null],["E",null],["p",null]]),Ny=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["noclobber","noclobber"],["noglob","noglob"],["allexport","allexport"],["noexec","noexec"],["posix","posix"],["vi","vi"],["emacs","emacs"],["notify",null],["monitor",null],["braceexpand",null],["histexpand",null],["physical",null],["functrace",null],["errtrace",null],["privileged",null],["hashall",null],["ignoreeof",null],["interactive-comments",null],["keyword",null],["onecmd",null]]),Iy=["errexit","nounset","pipefail","verbose","xtrace","posix","allexport","noclobber","noglob","noexec","vi","emacs"],$y=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"];function Oy(e,t,n){t!==null&&(n&&(t==="vi"?e.state.options.emacs=!1:t==="emacs"&&(e.state.options.vi=!1)),e.state.options[t]=n,vs(e))}function fC(e,t){return t+1<e.length&&!e[t+1].startsWith("-")&&!e[t+1].startsWith("+")}function pC(e,t){let n=at(e,t);if(n.length===0)return`${t}=()`;let r=n.map(s=>{let i=e.state.env.get(`${t}_${s}`)??"";return`[${s}]=${Vr(i)}`});return`${t}=(${r.join(" ")})`}function hC(e){return/^[a-zA-Z0-9_]+$/.test(e)?e:`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function dC(e,t){let n=Cn(e,t);if(n.length===0)return`${t}=()`;let r=n.map(s=>{let i=e.state.env.get(`${t}_${s}`)??"";return`[${hC(s)}]=${Vr(i)}`});return`${t}=(${r.join(" ")} )`}function mC(e){let t=new Set,n=e.state.associativeArrays??new Set;for(let r of e.state.env.keys()){let s=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(s){let i=s[1];n.has(i)||t.add(i)}}return t}function gC(e){return e.state.associativeArrays??new Set}function cf(e,t){if(t.includes("--help"))return be(Ia);if(t.length===0){let r=mC(e),s=gC(e),i=l=>{for(let c of s){let u=`${c}_`,f=`${c}__length`;if(l!==f&&l.startsWith(u)){if(l.slice(u.length).startsWith("_length"))continue;return!0}}return!1},o=[];for(let[l,c]of e.state.env){if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(l)||r.has(l)||s.has(l))continue;let u=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(u&&r.has(u[1]))continue;let f=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);f&&r.has(f[1])||i(l)||f&&s.has(f[1])||o.push([l,c])}let a=[];for(let[l,c]of o.sort(([u],[f])=>u<f?-1:u>f?1:0))a.push(`${l}=${va(c)}`);for(let l of[...r].sort((c,u)=>c<u?-1:c>u?1:0))a.push(pC(e,l));for(let l of[...s].sort((c,u)=>c<u?-1:c>u?1:0))a.push(dC(e,l));return a.sort((l,c)=>{let u=l.split("=")[0],f=c.split("=")[0];return u<f?-1:u>f?1:0}),be(a.length>0?`${a.join(`
|
|
1332
|
+
`)}
|
|
1333
|
+
`:"")}let n=0;for(;n<t.length;){let r=t[n];if((r==="-o"||r==="+o")&&fC(t,n)){let s=t[n+1];if(!Ny.has(s)){let i=`bash: set: ${s}: invalid option name
|
|
1334
|
+
${Ia}`;if(e.state.options.posix)throw new Jt(1,"",i);return z(i)}Oy(e,Ny.get(s)??null,r==="-o"),n+=2;continue}if(r==="-o"){let s=Iy.map(a=>`${a.padEnd(16)}${e.state.options[a]?"on":"off"}`),i=$y.map(a=>`${a.padEnd(16)}off`),o=[...s,...i].sort();return be(`${o.join(`
|
|
1335
|
+
`)}
|
|
1336
|
+
`)}if(r==="+o"){let s=Iy.map(a=>`set ${e.state.options[a]?"-o":"+o"} ${a}`),i=$y.map(a=>`set +o ${a}`),o=[...s,...i].sort();return be(`${o.join(`
|
|
1337
|
+
`)}
|
|
1338
|
+
`)}if(r.length>1&&(r[0]==="-"||r[0]==="+")&&r[1]!=="-"){let s=r[0]==="-";for(let i=1;i<r.length;i++){let o=r[i];if(!ky.has(o)){let a=`bash: set: ${r[0]}${o}: invalid option
|
|
1339
|
+
${Ia}`;if(e.state.options.posix)throw new Jt(1,"",a);return z(a)}Oy(e,ky.get(o)??null,s)}n++;continue}if(r==="--")return lf(e,t.slice(n+1)),ye;if(r==="-"){if(e.state.options.xtrace=!1,e.state.options.verbose=!1,vs(e),n+1<t.length)return lf(e,t.slice(n+1)),ye;n++;continue}if(r==="+"){n++;continue}if(r.startsWith("-")||r.startsWith("+")){let s=`bash: set: ${r}: invalid option
|
|
1340
|
+
${Ia}`;if(e.state.options.posix)throw new Jt(1,"",s);return z(s)}return lf(e,t.slice(n)),ye}return ye}function lf(e,t){let n=1;for(;e.state.env.has(String(n));)e.state.env.delete(String(n)),n++;for(let r=0;r<t.length;r++)e.state.env.set(String(r+1),t[r]);e.state.env.set("#",String(t.length)),e.state.env.set("@",t.join(" ")),e.state.env.set("*",t.join(" "))}xe();function uf(e,t){let n=1;if(t.length>0){let o=Number.parseInt(t[0],10);if(Number.isNaN(o)||o<0){let a=`bash: shift: ${t[0]}: numeric argument required
|
|
1341
|
+
`;if(e.state.options.posix)throw new Jt(1,"",a);return z(a)}n=o}let r=Number.parseInt(e.state.env.get("#")||"0",10);if(n>r){let o=`bash: shift: shift count out of range
|
|
1342
|
+
`;if(e.state.options.posix)throw new Jt(1,"",o);return z(o)}if(n===0)return ye;let s=[];for(let o=1;o<=r;o++)s.push(e.state.env.get(String(o))||"");let i=s.slice(n);for(let o=1;o<=r;o++)e.state.env.delete(String(o));for(let o=0;o<i.length;o++)e.state.env.set(String(o+1),i[o]);return e.state.env.set("#",String(i.length)),e.state.env.set("@",i.join(" ")),ye}ot();xe();async function ff(e,t){let n=t;if(n.length>0&&n[0]==="--"&&(n=n.slice(1)),n.length===0)return H("",`bash: source: filename argument required
|
|
1343
|
+
`,2);let r=n[0],s=null,i=null;if(r.includes("/")){let c=e.fs.resolvePath(e.state.cwd,r);try{i=await e.fs.readFile(c),s=c}catch{}}else{let u=(e.state.env.get("PATH")||"").split(":").filter(f=>f);for(let f of u){let p=e.fs.resolvePath(e.state.cwd,`${f}/${r}`);try{if((await e.fs.stat(p)).isDirectory)continue;i=await e.fs.readFile(p),s=p;break}catch{}}if(i===null){let f=e.fs.resolvePath(e.state.cwd,r);try{i=await e.fs.readFile(f),s=f}catch{}}}if(i===null)return z(`bash: ${r}: No such file or directory
|
|
1344
|
+
`);let o=new Map;if(n.length>1){for(let u=1;u<=9;u++)o.set(String(u),e.state.env.get(String(u)));o.set("#",e.state.env.get("#")),o.set("@",e.state.env.get("@"));let c=n.slice(1);e.state.env.set("#",String(c.length)),e.state.env.set("@",c.join(" "));for(let u=0;u<c.length&&u<9;u++)e.state.env.set(String(u+1),c[u]);for(let u=c.length+1;u<=9;u++)e.state.env.delete(String(u))}let a=e.state.currentSource,l=()=>{if(e.state.sourceDepth--,e.state.currentSource=a,n.length>1)for(let[c,u]of o)u===void 0?e.state.env.delete(c):e.state.env.set(c,u)};if(e.state.sourceDepth++,e.state.sourceDepth>e.limits.maxSourceDepth)throw e.state.sourceDepth--,new Q(`source: maximum nesting depth (${e.limits.maxSourceDepth}) exceeded, increase executionLimits.maxSourceDepth`,"recursion");e.state.currentSource=r;try{let c=Sn(i),u=await e.executeScript(c);return l(),u}catch(c){if(l(),c instanceof ge)throw c;if(c instanceof xt)return H(c.stdout,c.stderr,c.exitCode);if(c.name==="ParseException")return z(`bash: ${r}: ${c.message}
|
|
1345
|
+
`);throw c}}Nt();ot();Ft();Zt();Lt();vn();gr();function Ry(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function yC(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')}async function Ty(e,t){if(yC(t))return null;try{let n=new ce,r=Ce(n,t);return await te(e,r.expression)}catch{let n=parseInt(t,10);return Number.isNaN(n)?0:n}}function Py(e,t){if(e.state.localVarStack?.has(t)){let r=Aa(e,t);if(r){r.value===void 0?e.state.env.delete(t):e.state.env.set(t,r.value);let s=e.state.localVarStack?.get(t);if(!s||s.length===0)Ea(e,t),e.state.localVarStack?.delete(t),e.state.fullyUnsetLocals=e.state.fullyUnsetLocals||new Map,e.state.fullyUnsetLocals.set(t,r.scopeIndex),pf(e,t);else{let i=s[s.length-1];e.state.localVarDepth=e.state.localVarDepth||new Map,e.state.localVarDepth.set(t,i.scopeIndex+1)}return!0}return e.state.env.delete(t),Ea(e,t),e.state.localVarStack?.delete(t),e.state.fullyUnsetLocals=e.state.fullyUnsetLocals||new Map,e.state.fullyUnsetLocals.set(t,0),!0}for(let r=e.state.localScopes.length-1;r>=0;r--){let s=e.state.localScopes[r];if(s.has(t)){let i=s.get(t);i===void 0?e.state.env.delete(t):e.state.env.set(t,i),s.delete(t);let o=!1;for(let a=r-1;a>=0;a--)if(e.state.localScopes[a].has(t)){e.state.localVarDepth&&e.state.localVarDepth.set(t,a+1),o=!0;break}return o||Ea(e,t),!0}}return!1}function pf(e,t){if(!e.state.tempEnvBindings||e.state.tempEnvBindings.length===0)return!1;for(let n=e.state.tempEnvBindings.length-1;n>=0;n--){let r=e.state.tempEnvBindings[n];if(r.has(t)){let s=r.get(t);return s===void 0?e.state.env.delete(t):e.state.env.set(t,s),r.delete(t),!0}}return!1}async function Dy(e,t){if(t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if(t.startsWith('"')&&t.endsWith('"')){let n=t.slice(1,-1),s=new ce().parseWordFromString(n,!0,!1);return se(e,s)}if(t.includes("$")){let r=new ce().parseWordFromString(t,!1,!1);return se(e,r)}return t}async function hf(e,t){let n="both",r="",s=0;for(let i of t){if(i==="-v"){n="variable";continue}if(i==="-f"){n="function";continue}if(n==="function"){e.state.functions.delete(i);continue}if(n==="variable"){let c=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(c){let p=c[1],h=c[2];if(h==="@"||h==="*"){let b=oe(e,p);for(let[x]of b)e.state.env.delete(`${p}_${x}`);e.state.env.delete(p);continue}let d=e.state.associativeArrays?.has(p);if(d){let b=await Dy(e,h);e.state.env.delete(`${p}_${b}`);continue}let m=er(e,p),g=e.state.declaredVars?.has(p);if((e.state.env.has(p)||g)&&!m&&!d){r+=`bash: unset: ${p}: not an array variable
|
|
1346
|
+
`,s=1;continue}let w=await Ty(e,h);if(w===null&&m){r+=`bash: unset: ${h}: not a valid identifier
|
|
1347
|
+
`,s=1;continue}if(w===null)continue;if(w<0){let b=oe(e,p),x=b.length,A=e.state.currentLine;if(x===0){r+=`bash: line ${A}: unset: [${w}]: bad array subscript
|
|
1348
|
+
`,s=1;continue}let $=x+w;if($<0){r+=`bash: line ${A}: unset: [${w}]: bad array subscript
|
|
1349
|
+
`,s=1;continue}let O=b[$][0];e.state.env.delete(`${p}_${O}`);continue}e.state.env.delete(`${p}_${w}`);continue}if(!Ry(i)){r+=`bash: unset: \`${i}': not a valid identifier
|
|
1350
|
+
`,s=1;continue}let u=i;if(Me(e,i)){let p=_t(e,i);p&&p!==i&&(u=p)}if(Hn(e,u)){r+=`bash: unset: ${u}: cannot unset: readonly variable
|
|
1351
|
+
`,s=1;continue}let f=Ds(e,u);if(f!==void 0&&f!==e.state.callDepth)Py(e,u);else if(e.state.fullyUnsetLocals?.has(u))e.state.env.delete(u);else if(f!==void 0){let p=e.state.accessedTempEnvVars?.has(u),h=e.state.mutatedTempEnvVars?.has(u);if((p||h)&&e.state.localVarStack?.has(u)){let d=Aa(e,u);d?d.value===void 0?e.state.env.delete(u):e.state.env.set(u,d.value):e.state.env.delete(u)}else e.state.env.delete(u)}else pf(e,u)||e.state.env.delete(u);e.state.exportedVars?.delete(u);continue}let o=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(o){let c=o[1],u=o[2];if(u==="@"||u==="*"){let m=oe(e,c);for(let[g]of m)e.state.env.delete(`${c}_${g}`);e.state.env.delete(c);continue}let f=e.state.associativeArrays?.has(c);if(f){let m=await Dy(e,u);e.state.env.delete(`${c}_${m}`);continue}let p=er(e,c);if(e.state.env.has(c)&&!p&&!f){r+=`bash: unset: ${c}: not an array variable
|
|
1352
|
+
`,s=1;continue}let d=await Ty(e,u);if(d===null&&p){r+=`bash: unset: ${u}: not a valid identifier
|
|
1353
|
+
`,s=1;continue}if(d===null)continue;if(d<0){let m=oe(e,c),g=m.length,y=e.state.currentLine;if(g===0){r+=`bash: line ${y}: unset: [${d}]: bad array subscript
|
|
1354
|
+
`,s=1;continue}let w=g+d;if(w<0){r+=`bash: line ${y}: unset: [${d}]: bad array subscript
|
|
1355
|
+
`,s=1;continue}let b=m[w][0];e.state.env.delete(`${c}_${b}`);continue}e.state.env.delete(`${c}_${d}`);continue}if(!Ry(i)){r+=`bash: unset: \`${i}': not a valid identifier
|
|
1356
|
+
`,s=1;continue}let a=i;if(Me(e,i)){let c=_t(e,i);c&&c!==i&&(a=c)}if(Hn(e,a)){r+=`bash: unset: ${a}: cannot unset: readonly variable
|
|
1357
|
+
`,s=1;continue}let l=Ds(e,a);if(l!==void 0&&l!==e.state.callDepth)Py(e,a);else if(e.state.fullyUnsetLocals?.has(a))e.state.env.delete(a);else if(l!==void 0){let c=e.state.accessedTempEnvVars?.has(a),u=e.state.mutatedTempEnvVars?.has(a);if((c||u)&&e.state.localVarStack?.has(a)){let f=Aa(e,a);f?f.value===void 0?e.state.env.delete(a):e.state.env.set(a,f.value):e.state.env.delete(a)}else e.state.env.delete(a)}else pf(e,a)||e.state.env.delete(a);e.state.exportedVars?.delete(a),e.state.functions.delete(i)}return H("",r,s)}var df=["extglob","dotglob","nullglob","failglob","globstar","globskipdots","nocaseglob","nocasematch","expand_aliases","lastpipe","xpg_echo"],wC=["autocd","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","execfail","extdebug","extquote","force_fignore","globasciiranges","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath"];function $a(e){return df.includes(e)}function bC(e){return wC.includes(e)}function _y(e,t){let n=!1,r=!1,s=!1,i=!1,o=!1,a=[],l=0;for(;l<t.length;){let p=t[l];if(p==="--"){l++;break}if(p.startsWith("-")&&p.length>1){for(let h=1;h<p.length;h++){let d=p[h];switch(d){case"s":n=!0;break;case"u":r=!0;break;case"p":s=!0;break;case"q":i=!0;break;case"o":o=!0;break;default:return{exitCode:2,stdout:"",stderr:`shopt: -${d}: invalid option
|
|
1358
|
+
`}}}l++}else break}for(;l<t.length;)a.push(t[l]),l++;if(o)return xC(e,a,n,r,s,i);if(n&&r)return{exitCode:1,stdout:"",stderr:`shopt: cannot set and unset shell options simultaneously
|
|
1359
|
+
`};if(a.length===0){if(n||r){let h=[];for(let d of df){let m=e.state.shoptOptions[d];n&&m?h.push(s?`shopt -s ${d}`:`${d} on`):r&&!m&&h.push(s?`shopt -u ${d}`:`${d} off`)}return{exitCode:0,stdout:h.length>0?`${h.join(`
|
|
1360
|
+
`)}
|
|
1361
|
+
`:"",stderr:""}}let p=[];for(let h of df){let d=e.state.shoptOptions[h];p.push(s?`shopt ${d?"-s":"-u"} ${h}`:`${h} ${d?"on":"off"}`)}return{exitCode:0,stdout:`${p.join(`
|
|
1362
|
+
`)}
|
|
1363
|
+
`,stderr:""}}let c=!1,u="",f=[];for(let p of a){if(!$a(p)&&!bC(p)){u+=`shopt: ${p}: invalid shell option name
|
|
1364
|
+
`,c=!0;continue}if(n)$a(p)&&(e.state.shoptOptions[p]=!0,Dc(e));else if(r)$a(p)&&(e.state.shoptOptions[p]=!1,Dc(e));else if($a(p)){let h=e.state.shoptOptions[p];i?h||(c=!0):s?(f.push(`shopt ${h?"-s":"-u"} ${p}`),h||(c=!0)):(f.push(`${p} ${h?"on":"off"}`),h||(c=!0))}else i?c=!0:s?(f.push(`shopt -u ${p}`),c=!0):(f.push(`${p} off`),c=!0)}return{exitCode:c?1:0,stdout:f.length>0?`${f.join(`
|
|
1365
|
+
`)}
|
|
1366
|
+
`:"",stderr:u}}function xC(e,t,n,r,s,i){let o=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["posix","posix"],["allexport","allexport"],["noclobber","noclobber"],["noglob","noglob"],["noexec","noexec"],["vi","vi"],["emacs","emacs"]]),a=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"],l=[...o.keys(),...a].sort();if(t.length===0){let p=[];for(let h of l){let d=a.includes(h),m=o.get(h),g=d||!m?!1:e.state.options[m];n&&!g||r&&g||p.push(s?`set ${g?"-o":"+o"} ${h}`:`${h} ${g?"on":"off"}`)}return{exitCode:0,stdout:p.length>0?`${p.join(`
|
|
1367
|
+
`)}
|
|
1368
|
+
`:"",stderr:""}}let c=!1,u="",f=[];for(let p of t){let h=o.has(p),d=a.includes(p);if(!h&&!d){u+=`shopt: ${p}: invalid option name
|
|
1369
|
+
`,c=!0;continue}if(d){n||r||(i?c=!0:s?(f.push(`set +o ${p}`),c=!0):(f.push(`${p} off`),c=!0));continue}let m=o.get(p);if(m)if(n)m==="vi"?e.state.options.emacs=!1:m==="emacs"&&(e.state.options.vi=!1),e.state.options[m]=!0,vs(e);else if(r)e.state.options[m]=!1,vs(e);else{let g=e.state.options[m];i?g||(c=!0):s?(f.push(`set ${g?"-o":"+o"} ${p}`),g||(c=!0)):(f.push(`${p} ${g?"on":"off"}`),g||(c=!0))}}return{exitCode:c?1:0,stdout:f.length>0?`${f.join(`
|
|
1370
|
+
`)}
|
|
1371
|
+
`:"",stderr:u}}async function Fy(e,t,n){if(t.includes("/")){let o=e.fs.resolvePath(e.state.cwd,t);if(!await e.fs.exists(o))return{error:"not_found",path:o};let a=o.split("/").pop()||t,l=e.commands.get(a);try{let c=await e.fs.stat(o);return c.isDirectory?{error:"permission_denied",path:o}:l?{cmd:l,path:o}:(c.mode&73)!==0?{script:!0,path:o}:{error:"permission_denied",path:o}}catch{return{error:"not_found",path:o}}}if(!n&&e.state.hashTable){let o=e.state.hashTable.get(t);if(o)if(await e.fs.exists(o)){let a=e.commands.get(t);if(a)return{cmd:a,path:o};try{let l=await e.fs.stat(o);if(!l.isDirectory&&(l.mode&73)!==0)return{script:!0,path:o}}catch{}}else e.state.hashTable.delete(t)}let s=(n??e.state.env.get("PATH")??"/usr/bin:/bin").split(":");for(let o of s){if(!o)continue;let l=`${o.startsWith("/")?o:e.fs.resolvePath(e.state.cwd,o)}/${t}`;if(await e.fs.exists(l))try{let c=await e.fs.stat(l);if(c.isDirectory)continue;let u=(c.mode&73)!==0,f=e.commands.get(t),p=o==="/bin"||o==="/usr/bin";if(f&&p)return{cmd:f,path:l};if(u){if(f&&!p)return{script:!0,path:l};if(!f)return{script:!0,path:l}}}catch{}}if(!await e.fs.exists("/usr/bin")){let o=e.commands.get(t);if(o)return{cmd:o,path:`/usr/bin/${t}`}}return null}async function Oa(e,t){let n=[];if(t.includes("/")){let i=e.fs.resolvePath(e.state.cwd,t);if(await e.fs.exists(i))try{let o=await e.fs.stat(i);o.isDirectory||(o.mode&73)!==0&&n.push(t)}catch{}return n}let s=(e.state.env.get("PATH")||"/usr/bin:/bin").split(":");for(let i of s){if(!i)continue;let a=`${i.startsWith("/")?i:e.fs.resolvePath(e.state.cwd,i)}/${t}`;if(await e.fs.exists(a)){try{if((await e.fs.stat(a)).isDirectory)continue}catch{continue}n.push(i.startsWith("/")?a:`${i}/${t}`)}}return n}Fn();function EC(e){return e!==null&&typeof e=="object"&&"then"in e&&typeof e.then=="function"}function Xe(e,t,n,r){return((...s)=>{rt(t,n,`${r} call`);let i=e(...s);return EC(i)?i.then(o=>(rt(t,n,`${r} post-await`),o),o=>{throw rt(t,n,`${r} post-await`),o}):(rt(t,n,`${r} return`),i)})}function AC(e,t,n){let r={readFile:Xe(e.readFile.bind(e),t,n,"fs.readFile"),readFileBuffer:Xe(e.readFileBuffer.bind(e),t,n,"fs.readFileBuffer"),writeFile:Xe(e.writeFile.bind(e),t,n,"fs.writeFile"),appendFile:Xe(e.appendFile.bind(e),t,n,"fs.appendFile"),exists:Xe(e.exists.bind(e),t,n,"fs.exists"),stat:Xe(e.stat.bind(e),t,n,"fs.stat"),mkdir:Xe(e.mkdir.bind(e),t,n,"fs.mkdir"),readdir:Xe(e.readdir.bind(e),t,n,"fs.readdir"),rm:Xe(e.rm.bind(e),t,n,"fs.rm"),cp:Xe(e.cp.bind(e),t,n,"fs.cp"),mv:Xe(e.mv.bind(e),t,n,"fs.mv"),resolvePath:Xe(e.resolvePath.bind(e),t,n,"fs.resolvePath"),getAllPaths:Xe(e.getAllPaths.bind(e),t,n,"fs.getAllPaths"),chmod:Xe(e.chmod.bind(e),t,n,"fs.chmod"),symlink:Xe(e.symlink.bind(e),t,n,"fs.symlink"),link:Xe(e.link.bind(e),t,n,"fs.link"),readlink:Xe(e.readlink.bind(e),t,n,"fs.readlink"),lstat:Xe(e.lstat.bind(e),t,n,"fs.lstat"),realpath:Xe(e.realpath.bind(e),t,n,"fs.realpath"),utimes:Xe(e.utimes.bind(e),t,n,"fs.utimes")};return e.readdirWithFileTypes&&(r.readdirWithFileTypes=Xe(e.readdirWithFileTypes.bind(e),t,n,"fs.readdirWithFileTypes")),r}function Ly(e,t){if(!e.requireDefenseContext)return e;let n=`command:${t}`,r={...e,fs:AC(e.fs,e.requireDefenseContext,n)};return e.exec&&(r.exec=Xe(e.exec,e.requireDefenseContext,n,"exec")),e.fetch&&(r.fetch=Xe(e.fetch,e.requireDefenseContext,n,"fetch")),e.sleep&&(r.sleep=Xe(e.sleep,e.requireDefenseContext,n,"sleep")),e.getRegisteredCommands&&(r.getRegisteredCommands=Xe(e.getRegisteredCommands,e.requireDefenseContext,n,"getRegisteredCommands")),r}xe();en();async function Wy(e,t,n,r){let s=!1,i=!1,o=!1,a=!1,l=!1,c=[];for(let m of t)if(m.startsWith("-")&&m.length>1)for(let g of m.slice(1))g==="t"?s=!0:g==="p"?i=!0:g==="P"?o=!0:g==="a"?a=!0:g==="f"&&(l=!0);else c.push(m);let u="",f="",p=0,h=!1,d=!1;for(let m of c){let g=!1;if(o){if(a){let $=await r(m);if($.length>0){for(let O of $)u+=`${O}
|
|
1372
|
+
`;h=!0,g=!0}}else{let $=await n(m);$&&(u+=`${$}
|
|
1373
|
+
`,h=!0,g=!0)}g||(d=!0);continue}let y=!l&&e.state.functions.has(m);if(a&&y){if(!i)if(s)u+=`function
|
|
1374
|
+
`;else{let $=e.state.functions.get(m),O=$?My(m,$):`${m} is a function
|
|
1375
|
+
`;u+=O}g=!0}let w=e.state.env.get(`BASH_ALIAS_${m}`);if(w!==void 0&&(a||!g)&&(i||(s?u+=`alias
|
|
1376
|
+
`:u+=`${m} is aliased to \`${w}'
|
|
1377
|
+
`),g=!0,!a)||Ru.has(m)&&(a||!g)&&(i||(s?u+=`keyword
|
|
1378
|
+
`:u+=`${m} is a shell keyword
|
|
1379
|
+
`),g=!0,!a))continue;if(!a&&y&&!g){if(!i)if(s)u+=`function
|
|
1380
|
+
`;else{let $=e.state.functions.get(m),O=$?My(m,$):`${m} is a function
|
|
1381
|
+
`;u+=O}g=!0;continue}if(!(_s.has(m)&&(a||!g)&&(i||(s?u+=`builtin
|
|
1382
|
+
`:u+=`${m} is a shell builtin
|
|
1383
|
+
`),g=!0,!a))){if(a){let $=await r(m);for(let O of $)i?u+=`${O}
|
|
1384
|
+
`:s?u+=`file
|
|
1385
|
+
`:u+=`${m} is ${O}
|
|
1386
|
+
`,h=!0,g=!0}else if(!g){let $=await n(m);$&&(i?u+=`${$}
|
|
1387
|
+
`:s?u+=`file
|
|
1388
|
+
`:u+=`${m} is ${$}
|
|
1389
|
+
`,h=!0,g=!0)}if(!g&&(d=!0,!s&&!i)){let $=!0;if(m.includes("/")){let O=e.fs.resolvePath(e.state.cwd,m);await e.fs.exists(O)&&($=!1)}$&&(f+=`bash: type: ${m}: not found
|
|
1390
|
+
`)}}}return i?p=d&&!h?1:0:p=d?1:0,H(u,f,p)}function My(e,t){let n;return t.body.type==="Group"?n=t.body.body.map(s=>ki(s)).join("; "):n=ki(t.body),`${e} is a function
|
|
1391
|
+
${e} ()
|
|
1392
|
+
{
|
|
1393
|
+
${n}
|
|
1394
|
+
}
|
|
1395
|
+
`}function ki(e){if(Array.isArray(e))return e.map(t=>ki(t)).join("; ");if(e.type==="Statement"){let t=[];for(let n=0;n<e.pipelines.length;n++){let r=e.pipelines[n];t.push(SC(r)),e.operators[n]&&t.push(e.operators[n])}return t.join(" ")}if(e.type==="SimpleCommand"){let t=e,n=[];t.name&&n.push(Uy(t.name));for(let r of t.args)n.push(Uy(r));return n.join(" ")}return e.type==="Group"?`{ ${e.body.map(r=>ki(r)).join("; ")}; }`:"..."}function SC(e){let t=e.commands.map(n=>ki(n));return(e.negated?"! ":"")+t.join(" | ")}function Uy(e){let t="";for(let n of e.parts)n.type==="Literal"?t+=n.value:n.type==="DoubleQuoted"?t+=`"${n.parts.map(r=>By(r)).join("")}"`:n.type==="SingleQuoted"?t+=`'${n.value}'`:t+=By(n);return t}function By(e){let t=e;return t.type==="Literal"?t.value??"":t.type==="Variable"?`$${t.name}`:""}async function zy(e,t,n,r){let s="",i="",o=0;for(let a of t){if(!a){o=1;continue}let l=e.state.env.get(`BASH_ALIAS_${a}`);if(l!==void 0)r?s+=`${a} is an alias for "${l}"
|
|
1396
|
+
`:s+=`alias ${a}='${l}'
|
|
1397
|
+
`;else if(Ru.has(a))r?s+=`${a} is a shell keyword
|
|
1398
|
+
`:s+=`${a}
|
|
1399
|
+
`;else if(_s.has(a))r?s+=`${a} is a shell builtin
|
|
1400
|
+
`:s+=`${a}
|
|
1401
|
+
`;else if(e.state.functions.has(a))r?s+=`${a} is a function
|
|
1402
|
+
`:s+=`${a}
|
|
1403
|
+
`;else if(a.includes("/")){let c=e.fs.resolvePath(e.state.cwd,a),u=!1;if(await e.fs.exists(c))try{let f=await e.fs.stat(c);f.isDirectory||(f.mode&73)!==0&&(r?s+=`${a} is ${a}
|
|
1404
|
+
`:s+=`${a}
|
|
1405
|
+
`,u=!0)}catch{}u||(r&&(i+=`${a}: not found
|
|
1406
|
+
`),o=1)}else if(e.commands.has(a)){let u=(e.state.env.get("PATH")??"/usr/bin:/bin").split(":"),f=null;for(let p of u){if(!p)continue;let h=`${p}/${a}`;try{let d=await e.fs.stat(h);if(!d.isDirectory&&(d.mode&73)!==0){f=h;break}}catch{}}f||(f=`/usr/bin/${a}`),r?s+=`${a} is ${f}
|
|
1407
|
+
`:s+=`${f}
|
|
1408
|
+
`}else r&&(i+=`${a}: not found
|
|
1409
|
+
`),o=1}return H(s,i,o)}async function Hy(e,t){if(t.includes("/")){let s=e.fs.resolvePath(e.state.cwd,t);if(await e.fs.exists(s)){try{let i=await e.fs.stat(s);if(i.isDirectory||!((i.mode&73)!==0))return null}catch{return null}return t}return null}let r=(e.state.env.get("PATH")??"/usr/bin:/bin").split(":");for(let s of r){if(!s)continue;let o=`${s.startsWith("/")?s:e.fs.resolvePath(e.state.cwd,s)}/${t}`;if(await e.fs.exists(o)){try{if((await e.fs.stat(o)).isDirectory)continue}catch{continue}return`${s}/${t}`}}if(e.commands.has(t)){for(let s of r)if(s==="/usr/bin"||s==="/bin")return`${s}/${t}`;return`/usr/bin/${t}`}return null}async function jy(e,t,n,r,s,i,o,a){let{ctx:l,runCommand:c}=e;if(l.coverage&&_s.has(t)&&l.coverage.hit(`bash:builtin:${t}`),t==="export")return Ju(l,n);if(t==="unset")return hf(l,n);if(t==="exit")return Yu(l,n);if(t==="local")return rf(l,n);if(t==="set")return cf(l,n);if(t==="break")return vu(l,n);if(t==="continue")return Mu(l,n);if(t==="return")return af(l,n);if(t==="eval"&&l.state.options.posix)return ka(l,n,s);if(t==="shift")return uf(l,n);if(t==="getopts")return Na(l,n);if(t==="compgen")return Du(l,n);if(t==="complete")return Fu(l,n);if(t==="compopt")return Lu(l,n);if(t==="pushd")return await Ku(l,n);if(t==="popd")return Qu(l,n);if(t==="dirs")return Xu(l,n);if(t==="source"||t===".")return ff(l,n);if(t==="read")return of(l,n,s,a);if(t==="mapfile"||t==="readarray")return sf(l,n,s);if(t==="declare"||t==="typeset")return Vu(l,n);if(t==="readonly")return qu(l,n);if(!i){let u=l.state.functions.get(t);if(u)return Ca(l,u,n,s)}if(t==="eval")return ka(l,n,s);if(t==="cd")return await ku(l,n);if(t===":"||t==="true")return ye;if(t==="false")return lt(!1);if(t==="let")return nf(l,n);if(t==="command")return CC(e,n,s);if(t==="builtin")return vC(e,n,s);if(t==="shopt")return _y(l,n);if(t==="exec"){if(n.length===0)return ye;let[u,...f]=n;return c(u,f,[],s,!1,!1,-1)}if(t==="wait")return ye;if(t==="type")return await Wy(l,n,u=>Hy(l,u),u=>Oa(l,u));if(t==="hash")return ef(l,n);if(t==="help")return tf(l,n);if(t==="["||t==="test"){let u=n;if(t==="["){if(n[n.length-1]!=="]")return z("[: missing `]'\n",2);u=n.slice(0,-1)}return Si(l,u)}return null}async function CC(e,t,n){let{ctx:r,runCommand:s}=e;if(t.length===0)return ye;let i=!1,o=!1,a=!1,l=t;for(;l.length>0&&l[0].startsWith("-");){let f=l[0];if(f==="--"){l=l.slice(1);break}for(let p of f.slice(1))p==="p"?i=!0:p==="V"?o=!0:p==="v"&&(a=!0);l=l.slice(1)}if(l.length===0)return ye;if(a||o)return await zy(r,l,a,o);let[c,...u]=l;return s(c,u,[],n,!0,i,-1)}async function vC(e,t,n){let{runCommand:r}=e;if(t.length===0)return ye;let s=t;if(s[0]==="--"&&(s=s.slice(1),s.length===0))return ye;let i=s[0];if(!_s.has(i))return z(`bash: builtin: ${i}: not a shell builtin
|
|
1410
|
+
`);let[,...o]=s;return r(i,o,[],n,!0,!1,-1)}async function Gy(e,t,n,r,s){let{ctx:i,buildExportedEnv:o,executeUserScript:a}=e,c=await Fy(i,t,s?"/usr/bin:/bin":void 0);if(!c)return Y6(t)?z(`bash: ${t}: command not available in browser environments. Exclude '${t}' from your commands or use the Node.js bundle.
|
|
1411
|
+
`,127):z(`bash: ${t}: command not found
|
|
1412
|
+
`,127);if("error"in c)return c.error==="permission_denied"?z(`bash: ${t}: Permission denied
|
|
1413
|
+
`,126):z(`bash: ${t}: No such file or directory
|
|
1414
|
+
`,127);if("script"in c)return t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,c.path)),await a(c.path,n,r);let{cmd:u,path:f}=c;t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,f));let p=r||i.state.groupStdin||"",h=o(),d={fs:i.fs,cwd:i.state.cwd,env:i.state.env,exportedEnv:h,stdin:p,limits:i.limits,exec:i.execFn,fetch:i.fetch,getRegisteredCommands:()=>Array.from(i.commands.keys()),sleep:i.sleep,trace:i.trace,fileDescriptors:i.state.fileDescriptors,xpgEcho:i.state.shoptOptions.xpg_echo,coverage:i.coverage,signal:i.state.signal,requireDefenseContext:i.requireDefenseContext,jsBootstrapCode:i.jsBootstrapCode},m=Ly(d,t);try{let g=()=>Tt(i.requireDefenseContext,"command",`${t} execution`,()=>u.execute(n,m));return u.trusted?await wt.runTrustedAsync(()=>g()):await g()}catch(g){if(g instanceof Q||g instanceof he)throw g;return z(`${t}: ${Be(qe(g))}
|
|
1415
|
+
`)}}Ft();xe();Lt();async function mf(e,t){let n=e.state.inCondition;e.state.inCondition=!0;let r="",s="",i=0;try{for(let o of t){let a=await e.executeStatement(o);r+=a.stdout,s+=a.stderr,i=a.exitCode}}finally{e.state.inCondition=n}return{stdout:r,stderr:s,exitCode:i}}xe();en();function Ni(e,t,n,r){if(e instanceof vt)return t+=e.stdout,n+=e.stderr,e.levels>1&&r>1?(e.levels--,e.stdout=t,e.stderr=n,{action:"rethrow",stdout:t,stderr:n,error:e}):{action:"break",stdout:t,stderr:n};if(e instanceof kt)return t+=e.stdout,n+=e.stderr,e.levels>1&&r>1?(e.levels--,e.stdout=t,e.stderr=n,{action:"rethrow",stdout:t,stderr:n,error:e}):{action:"continue",stdout:t,stderr:n};if(e instanceof xt||e instanceof Bt||e instanceof ge||e instanceof Q)return e.prependOutput(t,n),{action:"rethrow",stdout:t,stderr:n,error:e};let s=qe(e);return{action:"error",stdout:t,stderr:`${n}${s}
|
|
1416
|
+
`,exitCode:1}}xe();en();async function Ra(e,t,n="",r=""){let s=n,i=r,o=0;try{for(let a of t){let l=await e.executeStatement(a);s+=l.stdout,i+=l.stderr,o=l.exitCode}}catch(a){if(Ri(a)||a instanceof Bt||a instanceof ge||a instanceof Q||a instanceof Tn)throw a.prependOutput(s,i),a;return{stdout:s,stderr:`${i}${qe(a)}
|
|
1417
|
+
`,exitCode:1}}return{stdout:s,stderr:i,exitCode:o}}async function Vy(e,t){let n="",r="";for(let s of t.clauses){let i=await mf(e,s.condition);if(n+=i.stdout,r+=i.stderr,i.exitCode===0)return Ra(e,s.body,n,r)}return t.elseBody?Ra(e,t.elseBody,n,r):H(n,r,0)}async function qy(e,t){let n=await Vn(e,t.redirections);if(n)return n;let r="",s="",i=0,o=0;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t.variable))return z(`bash: \`${t.variable}': not a valid identifier
|
|
1418
|
+
`);let a=[];if(t.words===null)a=(e.state.env.get("@")||"").split(" ").filter(Boolean);else if(t.words.length===0)a=[];else try{for(let c of t.words){let u=await In(e,c);a.push(...u.values)}}catch(c){if(c instanceof Rn)return{stdout:"",stderr:c.stderr,exitCode:1};throw c}e.state.loopDepth++;try{for(let c of a){o++,o>e.limits.maxLoopIterations&&jn(`for loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",r,s),e.state.env.set(t.variable,c);try{for(let u of t.body){let f=await e.executeStatement(u);r+=f.stdout,s+=f.stderr,i=f.exitCode}}catch(u){let f=Ni(u,r,s,e.state.loopDepth);if(r=f.stdout,s=f.stderr,f.action==="break")break;if(f.action==="continue")continue;if(f.action==="error"){let p=H(r,s,f.exitCode??1);return Qe(e,p,t.redirections)}throw f.error}}}finally{e.state.loopDepth--}let l=H(r,s,i);return Qe(e,l,t.redirections)}async function Zy(e,t){let n=await Vn(e,t.redirections);if(n)return n;let r=t.line;r!==void 0&&(e.state.currentLine=r);let s="",i="",o=0,a=0;t.init&&await te(e,t.init.expression),e.state.loopDepth++;try{for(;a++,a>e.limits.maxLoopIterations&&jn(`for loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",s,i),!(t.condition&&(r!==void 0&&(e.state.currentLine=r),await te(e,t.condition.expression)===0));){try{for(let c of t.body){let u=await e.executeStatement(c);s+=u.stdout,i+=u.stderr,o=u.exitCode}}catch(c){let u=Ni(c,s,i,e.state.loopDepth);if(s=u.stdout,i=u.stderr,u.action==="break")break;if(u.action==="continue"){t.update&&await te(e,t.update.expression);continue}if(u.action==="error"){let f=H(s,i,u.exitCode??1);return Qe(e,f,t.redirections)}throw u.error}t.update&&await te(e,t.update.expression)}}finally{e.state.loopDepth--}let l=H(s,i,o);return Qe(e,l,t.redirections)}async function Ky(e,t,n=""){let r="",s="",i=0,o=0,a=n;for(let c of t.redirections)if((c.operator==="<<"||c.operator==="<<-")&&c.target.type==="HereDoc"){let u=c.target,f=await se(e,u.content);u.stripTabs&&(f=f.split(`
|
|
1419
|
+
`).map(p=>p.replace(/^\t+/,"")).join(`
|
|
1420
|
+
`)),a=f}else if(c.operator==="<<<"&&c.target.type==="Word")a=`${await se(e,c.target)}
|
|
1421
|
+
`;else if(c.operator==="<"&&c.target.type==="Word")try{let u=await se(e,c.target),f=e.fs.resolvePath(e.state.cwd,u);a=await e.fs.readFile(f)}catch{let u=await se(e,c.target);return z(`bash: ${u}: No such file or directory
|
|
1422
|
+
`)}let l=e.state.groupStdin;a&&(e.state.groupStdin=a),e.state.loopDepth++;try{for(;;){o++,o>e.limits.maxLoopIterations&&jn(`while loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",r,s);let c=0,u=!1,f=!1,p=e.state.inCondition;e.state.inCondition=!0;try{for(let h of t.condition){let d=await e.executeStatement(h);r+=d.stdout,s+=d.stderr,c=d.exitCode}}catch(h){if(h instanceof vt){if(r+=h.stdout,s+=h.stderr,h.levels>1&&e.state.loopDepth>1)throw h.levels--,h.stdout=r,h.stderr=s,e.state.inCondition=p,h;u=!0}else if(h instanceof kt){if(r+=h.stdout,s+=h.stderr,h.levels>1&&e.state.loopDepth>1)throw h.levels--,h.stdout=r,h.stderr=s,e.state.inCondition=p,h;f=!0}else throw e.state.inCondition=p,h}finally{e.state.inCondition=p}if(u)break;if(!f){if(c!==0)break;try{for(let h of t.body){let d=await e.executeStatement(h);r+=d.stdout,s+=d.stderr,i=d.exitCode}}catch(h){let d=Ni(h,r,s,e.state.loopDepth);if(r=d.stdout,s=d.stderr,d.action==="break")break;if(d.action==="continue")continue;if(d.action==="error")return H(r,s,d.exitCode??1);throw d.error}}}}finally{e.state.loopDepth--,e.state.groupStdin=l}return H(r,s,i)}async function Qy(e,t){let n="",r="",s=0,i=0;e.state.loopDepth++;try{for(;;){i++,i>e.limits.maxLoopIterations&&jn(`until loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",n,r);let o=await mf(e,t.condition);if(n+=o.stdout,r+=o.stderr,o.exitCode===0)break;try{for(let a of t.body){let l=await e.executeStatement(a);n+=l.stdout,r+=l.stderr,s=l.exitCode}}catch(a){let l=Ni(a,n,r,e.state.loopDepth);if(n=l.stdout,r=l.stderr,l.action==="break")break;if(l.action==="continue")continue;if(l.action==="error")return H(n,r,l.exitCode??1);throw l.error}}}finally{e.state.loopDepth--}return H(n,r,s)}async function Xy(e,t){let n=await Vn(e,t.redirections);if(n)return n;let r="",s="",i=0,o=await se(e,t.word),a=!1;for(let c=0;c<t.items.length;c++){let u=t.items[c],f=a;if(!a)for(let p of u.patterns){let h=await se(e,p);wu(p)&&(h=Kt(h));let d=e.state.shoptOptions.nocasematch,m=e.state.shoptOptions.extglob;if(Ps(o,h,d,m)){f=!0;break}}if(f){let p=await Ra(e,u.body,r,s);if(r=p.stdout,s=p.stderr,i=p.exitCode,u.terminator===";;")break;u.terminator===";&"?a=!0:a=!1}else a=!1}let l=H(r,s,i);return Qe(e,l,t.redirections)}xe();Lt();function gf(e,t){if(e.parts.length!==1)return!1;let n=e.parts[0];return n.type!=="Literal"?!1:t.includes(n.value)}function Yy(e){if(!e.startsWith("__rw__:"))return null;let t=e.slice(7),n=t.indexOf(":");if(n===-1)return null;let r=Number.parseInt(t.slice(0,n),10);if(Number.isNaN(r)||r<0)return null;let s=n+1,i=t.slice(s,s+r),o=s+r+1,a=t.slice(o),l=a.indexOf(":");if(l===-1)return null;let c=Number.parseInt(a.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;let u=a.slice(l+1);return{path:i,position:c,content:u}}ot();Lt();var Jy="+ ";async function e7(e){let t=e.state.env.get("PS4");if(t===void 0)return Jy;if(t==="")return"";try{let r=new ce().parseWordFromString(t,!1,!1);return await se(e,r)}catch{return e.state.expansionStderr=`${e.state.expansionStderr||""}bash: ${t}: bad substitution
|
|
1423
|
+
`,t||Jy}}function kC(e){return e.map(t=>NC(t)).join(" ")}function NC(e){if(e==="")return"''";if(!/[\s'"\\$`!*?[\]{}|&;<>()~#\n\t]/.test(e))return e;let n=/[\x00-\x1f\x7f]/.test(e),r=e.includes(`
|
|
1424
|
+
`),s=e.includes(" "),i=e.includes("\\"),o=e.includes("'");if(n||r||s||i){let l="";for(let c of e){let u=c.charCodeAt(0);c===`
|
|
1425
|
+
`?l+="\\n":c===" "?l+="\\t":c==="\\"?l+="\\\\":c==="'"?l+="'":c==='"'?l+='"':u<32||u===127?u<256?l+=`\\x${u.toString(16).padStart(2,"0")}`:l+=`\\u${u.toString(16).padStart(4,"0")}`:l+=c}return`$'${l}'`}return o?`"${e.replace(/([\\$`"])/g,"\\$1")}"`:`'${e}'`}async function t7(e,t,n){if(!e.state.options.xtrace)return"";let r=await e7(e),s=[t,...n],i=kC(s);return`${r}${i}
|
|
1426
|
+
`}async function n7(e,t,n){return e.state.options.xtrace?`${await e7(e)}${t}=${n}
|
|
1427
|
+
`:""}ai();xe();async function r7(e,t,n){let r=t.timed?ys():0,s="",i=ye,o=0,a=[],l="",c=t.commands.length>1,u=e.state.lastArg;for(let p=0;p<t.commands.length;p++){let h=t.commands[p],d=p===t.commands.length-1,m=p===0;c&&(e.state.lastArg="",m||(e.state.groupStdin=void 0));let y=c&&(!d||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,w;try{w=await n(h,s)}catch(b){if(b instanceof Ot)w={stdout:b.stdout,stderr:b.stderr,exitCode:1};else if(b instanceof ge&&t.commands.length>1)w={stdout:b.stdout,stderr:b.stderr,exitCode:b.exitCode};else if(b instanceof Bt&&t.commands.length>1)w={stdout:b.stdout,stderr:b.stderr,exitCode:b.exitCode};else throw y&&(e.state.env=y),b}y&&(e.state.env=y),a.push(w.exitCode),w.exitCode!==0&&(o=w.exitCode),d?i=w:(t.pipeStderr?.[p]??!1?s=w.stderr+w.stdout:(s=w.stdout,l+=w.stderr),i={stdout:"",stderr:"",exitCode:w.exitCode})}if(l&&(i={...i,stderr:l+i.stderr}),t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let p of e.state.env.keys())p.startsWith("PIPESTATUS_")&&e.state.env.delete(p);for(let p=0;p<a.length;p++)e.state.env.set(`PIPESTATUS_${p}`,String(a[p]));e.state.env.set("PIPESTATUS__length",String(a.length))}if(e.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),t.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),t.timed){let h=(ys()-r)/1e3,d=Math.floor(h/60),m=h%60,g;t.timePosix?g=`real ${h.toFixed(2)}
|
|
1428
|
+
user 0.00
|
|
1429
|
+
sys 0.00
|
|
1430
|
+
`:g=`
|
|
1431
|
+
real ${`${d}m${m.toFixed(3)}s`}
|
|
1432
|
+
user 0m0.000s
|
|
1433
|
+
sys 0m0.000s
|
|
1434
|
+
`,i={...i,stderr:i.stderr+g}}return c&&!e.state.shoptOptions.lastpipe&&(e.state.lastArg=u),i}Nt();ot();Ft();xe();Lt();dn();vn();gr();async function s7(e,t){let n=new Map,r="";for(let s of t.assignments){let i=s.name;if(s.array){let u=await IC(e,t,i,s.array,s.append,n);if(u.error)return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:u.error};if(r+=u.xtraceOutput,u.continueToNext)continue}let o=s.value?await se(e,s.value):"";if(i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[\]$/))return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:H("",`bash: ${i}: bad array subscript
|
|
1435
|
+
`,1)};let l=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(l){let u=await PC(e,t,l[1],l[2],o,s.append,n);if(u.error)return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:u.error};if(u.continueToNext)continue}let c=await _C(e,t,i,o,s.append,n);if(c.error)return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:c.error};r+=c.xtraceOutput,c.continueToNext}return{continueToNext:!1,xtraceOutput:r,tempAssignments:n}}async function IC(e,t,n,r,s,i){let o="";if(/\[.+\]$/.test(n))return{continueToNext:!1,xtraceOutput:"",error:H("",`bash: ${n}: cannot assign list to array member
|
|
1436
|
+
`,1)};if(Me(e,n)){let u=Hr(e,n);if(u===void 0||u==="")throw new ge(1,"","");let f=_t(e,n);if(f&&/^[a-zA-Z_][a-zA-Z0-9_]*\[@\]$/.test(f))return{continueToNext:!1,xtraceOutput:"",error:H("",`bash: ${n}: cannot assign list to array member
|
|
1437
|
+
`,1)}}if(Hn(e,n)){if(t.name)return o+=`bash: ${n}: readonly variable
|
|
1438
|
+
`,{continueToNext:!0,xtraceOutput:o};let u=gt(e,n);if(u)return{continueToNext:!1,xtraceOutput:"",error:u}}let a=e.state.associativeArrays?.has(n),l=$C(r),c=()=>{let u=`${n}_`;for(let f of e.state.env.keys())f.startsWith(u)&&!f.includes("__")&&e.state.env.delete(f);e.state.env.delete(n)};if(a&&l?await OC(e,t,n,r,s,c,u=>{o+=u}):l?await RC(e,n,r,s,c):await TC(e,n,r,s,c),t.name){i.set(n,e.state.env.get(n));let f=`(${r.map(p=>ks(p)).join(" ")})`;e.state.env.set(n,f)}return{continueToNext:!0,xtraceOutput:o}}function $C(e){return e.some(t=>{if(t.parts.length>=2){let n=t.parts[0],r=t.parts[1];if(n.type!=="Glob"||!n.pattern.startsWith("["))return!1;if(n.pattern==="["&&(r.type==="DoubleQuoted"||r.type==="SingleQuoted")){if(t.parts.length<3)return!1;let s=t.parts[2];return s.type!=="Literal"?!1:s.value.startsWith("]=")||s.value.startsWith("]+=")}return r.type!=="Literal"?!1:r.value.startsWith("]")?r.value.startsWith("]=")||r.value.startsWith("]+="):n.pattern.endsWith("]")?r.value.startsWith("=")||r.value.startsWith("+="):!1}return!1})}async function OC(e,t,n,r,s,i,o){let a=[];for(let l of r){let c=au(l);if(c){let{key:u,valueParts:f,append:p}=c,h;f.length>0?h=await se(e,{type:"Word",parts:f}):h="",h=nt(e,h),a.push({type:"keyed",key:u,value:h,append:p})}else{let u=await se(e,l);a.push({type:"invalid",expandedValue:u})}}s||i();for(let l of a)if(l.type==="keyed")if(l.append){let c=e.state.env.get(`${n}_${l.key}`)??"";e.state.env.set(`${n}_${l.key}`,c+l.value)}else e.state.env.set(`${n}_${l.key}`,l.value);else{let c=t.line??e.state.currentLine??1;o(`bash: line ${c}: ${n}: ${l.expandedValue}: must use subscript when assigning associative array
|
|
1439
|
+
`)}}async function RC(e,t,n,r,s){let i=[];for(let a of n){let l=au(a);if(l){let{key:c,valueParts:u,append:f}=l,p;u.length>0?p=await se(e,{type:"Word",parts:u}):p="",p=nt(e,p),i.push({type:"keyed",indexExpr:c,value:p,append:f})}else{let c=await In(e,a);i.push({type:"non-keyed",values:c.values})}}r||s();let o=0;for(let a of i)if(a.type==="keyed"){let l;try{let c=new ce,u=Ce(c,a.indexExpr);l=await te(e,u.expression,!1)}catch{if(/^-?\d+$/.test(a.indexExpr))l=Number.parseInt(a.indexExpr,10);else{let c=e.state.env.get(a.indexExpr);l=c?Number.parseInt(c,10):0,Number.isNaN(l)&&(l=0)}}if(a.append){let c=e.state.env.get(`${t}_${l}`)??"";e.state.env.set(`${t}_${l}`,c+a.value)}else e.state.env.set(`${t}_${l}`,a.value);o=l+1}else for(let l of a.values)e.state.env.set(`${t}_${o++}`,l)}async function TC(e,t,n,r,s){let i=[];for(let a of n){let l=await In(e,a);i.push(...l.values)}let o=0;if(r){let a=oe(e,t);if(a.length>0)o=Math.max(...a.map(([c])=>typeof c=="number"?c:0))+1;else{let l=e.state.env.get(t);l!==void 0&&(e.state.env.set(`${t}_0`,l),e.state.env.delete(t),o=1)}}else s();for(let a=0;a<i.length;a++)e.state.env.set(`${t}_${o+a}`,i[a]);r||e.state.env.set(`${t}__length`,String(i.length))}async function PC(e,t,n,r,s,i,o){let a=n;if(Me(e,n)){let f=_t(e,n);if(f&&f!==n){if(f.includes("["))return{continueToNext:!1,xtraceOutput:"",error:H("",`bash: \`${f}': not a valid identifier
|
|
1440
|
+
`,1)};a=f}}if(Hn(e,a)){if(t.name)return{continueToNext:!0,xtraceOutput:""};let f=gt(e,a);if(f)return{continueToNext:!1,xtraceOutput:"",error:f}}let l=e.state.associativeArrays?.has(a),c;if(l)c=await i7(e,a,r);else{let f=await DC(e,a,r);if(f.error)return{continueToNext:!1,xtraceOutput:"",error:f.error};c=`${a}_${f.index}`}let u=i?(e.state.env.get(c)||"")+s:s;if(t.name)o.set(c,e.state.env.get(c)),e.state.env.set(c,u);else{let f=Ds(e,a);if(f!==void 0&&f===e.state.callDepth&&e.state.localScopes.length>0){let p=e.state.localScopes[e.state.localScopes.length-1];p.has(c)||p.set(c,e.state.env.get(c))}e.state.env.set(c,u)}return{continueToNext:!0,xtraceOutput:""}}async function i7(e,t,n){let r;if(n.startsWith("'")&&n.endsWith("'"))r=n.slice(1,-1);else if(n.startsWith('"')&&n.endsWith('"')){let s=n.slice(1,-1),o=new ce().parseWordFromString(s,!0,!1);r=await se(e,o)}else if(n.includes("$")){let i=new ce().parseWordFromString(n,!1,!1);r=await se(e,i)}else r=n;return`${t}_${r}`}async function DC(e,t,n){let r=n;n.startsWith('"')&&n.endsWith('"')&&n.length>=2&&(r=n.slice(1,-1));let s;if(/^-?\d+$/.test(r))s=Number.parseInt(r,10);else{try{let i=new ce,o=Ce(i,r);s=await te(e,o.expression,!1)}catch(i){if(i instanceof De){let l=`bash: line ${e.state.currentLine}: ${n}: ${i.message}
|
|
1441
|
+
`;if(i.fatal)throw new ge(1,"",l);return{index:0,error:H("",l,1)}}let o=e.state.env.get(n);s=o?Number.parseInt(o,10):0}Number.isNaN(s)&&(s=0)}if(s<0){let i=oe(e,t);if(i.length===0){let a=e.state.currentLine;return{index:0,error:H("",`bash: line ${a}: ${t}[${n}]: bad array subscript
|
|
1442
|
+
`,1)}}if(s=Math.max(...i.map(([a])=>typeof a=="number"?a:0))+1+s,s<0){let a=e.state.currentLine;return{index:0,error:H("",`bash: line ${a}: ${t}[${n}]: bad array subscript
|
|
1443
|
+
`,1)}}}return{index:s}}async function _C(e,t,n,r,s,i){let o="",a=n,l=null;if(Me(e,n)){let f=$g(e,n,r);if(f===void 0)return{continueToNext:!1,xtraceOutput:"",error:H("",`bash: ${n}: circular name reference
|
|
1444
|
+
`,1)};if(f===null)return{continueToNext:!0,xtraceOutput:""};a=f;let p=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);p&&(l={arrayName:p[1],subscriptExpr:p[2]},a=p[1])}if(Hn(e,a)){if(t.name)return o+=`bash: ${a}: readonly variable
|
|
1445
|
+
`,{continueToNext:!0,xtraceOutput:o};let f=gt(e,a);if(f)return{continueToNext:!1,xtraceOutput:"",error:f}}let c;if(Ci(e,a))try{let f=new ce;if(s){let h=`(${e.state.env.get(a)||"0"}) + (${r})`,d=Ce(f,h);c=String(await te(e,d.expression))}else{let p=Ce(f,r);c=String(await te(e,p.expression))}}catch{c="0"}else{let{isArray:f}=await Promise.resolve().then(()=>(Lt(),Au)),p=f(e,a)?`${a}_0`:a;c=s?(e.state.env.get(p)||"")+r:r}c=Ls(e,a,c),o+=await n7(e,a,c);let u=a;if(l)u=await FC(e,l);else{let{isArray:f}=await Promise.resolve().then(()=>(Lt(),Au));f(e,a)&&(u=`${a}_0`)}return t.name?(i.set(u,e.state.env.get(u)),e.state.env.set(u,c)):(e.state.env.set(u,c),e.state.options.allexport&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(a)),e.state.tempEnvBindings?.some(f=>f.has(a))&&(e.state.mutatedTempEnvVars=e.state.mutatedTempEnvVars||new Set,e.state.mutatedTempEnvVars.add(a))),{continueToNext:!1,xtraceOutput:o}}async function FC(e,t){let{arrayName:n,subscriptExpr:r}=t;if(e.state.associativeArrays?.has(n))return i7(e,n,r);let i;if(/^-?\d+$/.test(r))i=Number.parseInt(r,10);else{try{let o=new ce,a=Ce(o,r);i=await te(e,a.expression,!1)}catch{let o=e.state.env.get(r);i=o?Number.parseInt(o,10):0}Number.isNaN(i)&&(i=0)}if(i<0){let o=oe(e,n);o.length>0&&(i=Math.max(...o.map(l=>l[0]))+1+i)}return`${n}_${i}`}ot();xe();Lt();en();async function o7(e,t,n,r){let s=await Vn(e,t.redirections);if(s)return s;let i=new Map(e.state.env),o=e.state.cwd,a={...e.state.options},l=new Map(e.state.functions),c=e.state.localScopes,u=e.state.localVarStack,f=e.state.localVarDepth,p=e.state.fullyUnsetLocals;if(e.state.localScopes=c.map(O=>new Map(O)),u){e.state.localVarStack=new Map;for(let[O,F]of u.entries())e.state.localVarStack.set(O,F.map(P=>({...P})))}f&&(e.state.localVarDepth=new Map(f)),p&&(e.state.fullyUnsetLocals=new Map(p));let h=e.state.loopDepth,d=e.state.parentHasLoopContext;e.state.parentHasLoopContext=h>0,e.state.loopDepth=0;let m=e.state.lastArg,g=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;let y=e.state.groupStdin;n&&(e.state.groupStdin=n);let w="",b="",x=0,A=()=>{e.state.env=i,e.state.cwd=o,e.state.options=a,e.state.functions=l,e.state.localScopes=c,e.state.localVarStack=u,e.state.localVarDepth=f,e.state.fullyUnsetLocals=p,e.state.loopDepth=h,e.state.parentHasLoopContext=d,e.state.groupStdin=y,e.state.bashPid=g,e.state.lastArg=m};try{for(let O of t.body){let F=await r(O);w+=F.stdout,b+=F.stderr,x=F.exitCode}}catch(O){if(A(),O instanceof Q)throw O;if(O instanceof Tn){w+=O.stdout,b+=O.stderr;let P=H(w,b,0);return Qe(e,P,t.redirections)}if(O instanceof vt||O instanceof kt){w+=O.stdout,b+=O.stderr;let P=H(w,b,0);return Qe(e,P,t.redirections)}if(O instanceof ge){w+=O.stdout,b+=O.stderr;let P=H(w,b,O.exitCode);return Qe(e,P,t.redirections)}if(O instanceof xt){w+=O.stdout,b+=O.stderr;let P=H(w,b,O.exitCode);return Qe(e,P,t.redirections)}if(O instanceof Bt){let P=H(w+O.stdout,b+O.stderr,O.exitCode);return Qe(e,P,t.redirections)}let F=H(w,`${b}${qe(O)}
|
|
1446
|
+
`,1);return Qe(e,F,t.redirections)}A();let $=H(w,b,x);return Qe(e,$,t.redirections)}async function a7(e,t,n,r){let s="",i="",o=0,a=await Sa(e,t.redirections);if(a)return a;let l=n;for(let f of t.redirections)if((f.operator==="<<"||f.operator==="<<-")&&f.target.type==="HereDoc"){let p=f.target,h=await se(e,p.content);p.stripTabs&&(h=h.split(`
|
|
1447
|
+
`).map(m=>m.replace(/^\t+/,"")).join(`
|
|
1448
|
+
`));let d=f.fd??0;d!==0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),It(e),e.state.fileDescriptors.set(d,h)):l=h}else if(f.operator==="<<<"&&f.target.type==="Word")l=`${await se(e,f.target)}
|
|
1449
|
+
`;else if(f.operator==="<"&&f.target.type==="Word")try{let p=await se(e,f.target),h=e.fs.resolvePath(e.state.cwd,p);l=await e.fs.readFile(h)}catch{let p=await se(e,f.target);return H("",`bash: ${p}: No such file or directory
|
|
1450
|
+
`,1)}let c=e.state.groupStdin;l&&(e.state.groupStdin=l);try{for(let f of t.body){let p=await r(f);s+=p.stdout,i+=p.stderr,o=p.exitCode}}catch(f){if(e.state.groupStdin=c,f instanceof Q)throw f;if(Ri(f)||f instanceof Bt||f instanceof ge)throw f.prependOutput(s,i),f;return H(s,`${i}${qe(f)}
|
|
1451
|
+
`,1)}e.state.groupStdin=c;let u=H(s,i,o);return Qe(e,u,t.redirections)}async function l7(e,t,n,r,s){let i;try{i=await e.fs.readFile(t)}catch{return z(`bash: ${t}: No such file or directory
|
|
1452
|
+
`,127)}if(i.startsWith("#!")){let g=i.indexOf(`
|
|
1453
|
+
`);g!==-1&&(i=i.slice(g+1))}let o=new Map(e.state.env),a=e.state.cwd,l={...e.state.options},c=e.state.loopDepth,u=e.state.parentHasLoopContext,f=e.state.lastArg,p=e.state.bashPid,h=e.state.groupStdin,d=e.state.currentSource;e.state.parentHasLoopContext=c>0,e.state.loopDepth=0,e.state.bashPid=e.state.nextVirtualPid++,r&&(e.state.groupStdin=r),e.state.currentSource=t,e.state.env.set("0",t),e.state.env.set("#",String(n.length)),e.state.env.set("@",n.join(" ")),e.state.env.set("*",n.join(" "));for(let g=0;g<n.length&&g<9;g++)e.state.env.set(String(g+1),n[g]);for(let g=n.length+1;g<=9;g++)e.state.env.delete(String(g));let m=()=>{e.state.env=o,e.state.cwd=a,e.state.options=l,e.state.loopDepth=c,e.state.parentHasLoopContext=u,e.state.lastArg=f,e.state.bashPid=p,e.state.groupStdin=h,e.state.currentSource=d};try{let y=new ce().parse(i),w=await s(y);return m(),w}catch(g){if(m(),g instanceof ge||g instanceof Q)throw g;if(g.name==="ParseException")return z(`bash: ${t}: ${g.message}
|
|
1454
|
+
`);throw g}}var Ii=class{ctx;constructor(t,n){this.ctx={state:n,fs:t.fs,commands:t.commands,limits:t.limits,execFn:t.exec,executeScript:this.executeScript.bind(this),executeStatement:this.executeStatement.bind(this),executeCommand:this.executeCommand.bind(this),fetch:t.fetch,sleep:t.sleep,trace:t.trace,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext??!1,jsBootstrapCode:t.jsBootstrapCode}}assertDefenseContext(t){if(!this.ctx.requireDefenseContext||wt.isInSandboxedContext())return;let n=`interpreter ${t} attempted outside defense context`;throw new he(n,{timestamp:Date.now(),type:"missing_defense_context",message:n,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:wt.getCurrentExecutionId()})}buildExportedEnv(){let t=this.ctx.state.exportedVars,n=this.ctx.state.tempExportedVars,r=new Set;if(t)for(let i of t)r.add(i);if(n)for(let i of n)r.add(i);if(r.size===0)return Object.create(null);let s=Object.create(null);for(let i of r){let o=this.ctx.state.env.get(i);o!==void 0&&(s[i]=o)}return s}async executeScript(t){this.assertDefenseContext("execution");let n="",r="",s=0,i=this.ctx.limits.maxOutputSize,o=(a,l)=>{n.length+r.length+a.length+l.length>i&&jn(`total output size exceeded (>${i} bytes), increase executionLimits.maxOutputSize`,"output_size"),n+=a,r+=l};for(let a of t.statements)try{let l=await this.executeStatement(a);o(l.stdout,l.stderr),s=l.exitCode,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s))}catch(l){if(l instanceof ge)throw l.prependOutput(n,r),l;if(l instanceof Jt)return o(l.stdout,l.stderr),s=l.exitCode,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Et(this.ctx.state.env)};if(l instanceof Q)throw l;if(l instanceof Bt)return o(l.stdout,l.stderr),s=l.exitCode,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Et(this.ctx.state.env)};if(l instanceof $t)return o(l.stdout,l.stderr),s=1,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Et(this.ctx.state.env)};if(l instanceof Ot)return o(l.stdout,l.stderr),s=1,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Et(this.ctx.state.env)};if(l instanceof De){o(l.stdout,l.stderr),s=1,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s));continue}if(l instanceof Jr){o(l.stdout,l.stderr),s=1,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s));continue}if(l instanceof vt||l instanceof kt){if(this.ctx.state.loopDepth>0)throw l.prependOutput(n,r),l;o(l.stdout,l.stderr);continue}throw l instanceof xt&&l.prependOutput(n,r),l}return{stdout:n,stderr:r,exitCode:s,env:Et(this.ctx.state.env)}}async executeUserScript(t,n,r=""){return l7(this.ctx,t,n,r,s=>this.executeScript(s))}async executeStatement(t){if(this.assertDefenseContext("statement"),this.ctx.state.signal?.aborted)throw new es;if(this.ctx.state.commandCount++,this.ctx.state.commandCount>this.ctx.limits.maxCommandCount&&jn(`too many commands executed (>${this.ctx.limits.maxCommandCount}), increase executionLimits.maxCommandCount`,"commands"),t.deferredError)throw new bt(t.deferredError.message,t.line??1,1);if(this.ctx.state.options.noexec)return ye;this.ctx.state.errexitSafe=!1;let n="",r="";this.ctx.state.options.verbose&&!this.ctx.state.suppressVerbose&&t.sourceText&&(r+=`${t.sourceText}
|
|
1455
|
+
`);let s=0,i=-1,o=!1;for(let c=0;c<t.pipelines.length;c++){let u=t.pipelines[c],f=c>0?t.operators[c-1]:null;if(f==="&&"&&s!==0||f==="||"&&s===0)continue;let p=await this.executePipeline(u);n+=p.stdout,r+=p.stderr,s=p.exitCode,i=c,o=u.negated,this.ctx.state.lastExitCode=s,this.ctx.state.env.set("?",String(s))}let a=i<t.pipelines.length-1,l=this.ctx.state.errexitSafe;if(this.ctx.state.errexitSafe=a||o||l,this.ctx.state.options.errexit&&s!==0&&i===t.pipelines.length-1&&!o&&!this.ctx.state.inCondition&&!l)throw new Bt(s,n,r);return H(n,r,s)}async executePipeline(t){return r7(this.ctx,t,(n,r)=>this.executeCommand(n,r))}async executeCommand(t,n){switch(this.assertDefenseContext("command"),this.ctx.coverage?.hit(`bash:cmd:${t.type}`),t.type){case"SimpleCommand":return this.executeSimpleCommand(t,n);case"If":return Vy(this.ctx,t);case"For":return qy(this.ctx,t);case"CStyleFor":return Zy(this.ctx,t);case"While":return Ky(this.ctx,t,n);case"Until":return Qy(this.ctx,t);case"Case":return Xy(this.ctx,t);case"Subshell":return this.executeSubshell(t,n);case"Group":return this.executeGroup(t,n);case"FunctionDef":return hy(this.ctx,t);case"ArithmeticCommand":return this.executeArithmeticCommand(t);case"ConditionalCommand":return this.executeConditionalCommand(t);default:return ye}}async executeSimpleCommand(t,n){try{return await this.executeSimpleCommandInner(t,n)}catch(r){if(r instanceof Rn)return z(r.stderr);throw r}}async executeSimpleCommandInner(t,n){if(t.line!==void 0&&(this.ctx.state.currentLine=t.line),this.ctx.state.shoptOptions.expand_aliases&&t.name){let x=t,A=100;for(;A>0;){let $=this.expandAlias(x);if($===x)break;x=$,A--}this.aliasExpansionStack.clear(),x!==t&&(t=x)}this.ctx.state.expansionStderr="";let r=await s7(this.ctx,t);if(r.error)return r.error;let s=r.tempAssignments,i=r.xtraceOutput;if(!t.name){if(t.redirections.length>0){let A=await Vn(this.ctx,t.redirections);if(A)return A;let $=H("",i,0);return Qe(this.ctx,$,t.redirections)}this.ctx.state.lastArg="";let x=(this.ctx.state.expansionStderr||"")+i;return this.ctx.state.expansionStderr="",H("",x,this.ctx.state.lastExitCode)}let o=t.name&&gf(t.name,["local","declare","typeset","export","readonly"]),a=Array.from(s.keys());if(a.length>0&&!o){this.ctx.state.tempExportedVars=this.ctx.state.tempExportedVars||new Set;for(let x of a)this.ctx.state.tempExportedVars.add(x)}let l=await Sa(this.ctx,t.redirections);if(l){for(let[x,A]of s)A===void 0?this.ctx.state.env.delete(x):this.ctx.state.env.set(x,A);return l}let c=-1;for(let x of t.redirections){if((x.operator==="<<"||x.operator==="<<-")&&x.target.type==="HereDoc"){let A=x.target,$=await se(this.ctx,A.content);A.stripTabs&&($=$.split(`
|
|
1456
|
+
`).map(F=>F.replace(/^\t+/,"")).join(`
|
|
1457
|
+
`));let O=x.fd??0;O!==0?(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),It(this.ctx),this.ctx.state.fileDescriptors.set(O,$)):n=$;continue}if(x.operator==="<<<"&&x.target.type==="Word"){n=`${await se(this.ctx,x.target)}
|
|
1458
|
+
`;continue}if(x.operator==="<"&&x.target.type==="Word")try{let A=await se(this.ctx,x.target),$=this.ctx.fs.resolvePath(this.ctx.state.cwd,A);n=await this.ctx.fs.readFile($)}catch{let A=await se(this.ctx,x.target);for(let[$,O]of s)O===void 0?this.ctx.state.env.delete($):this.ctx.state.env.set($,O);return z(`bash: ${A}: No such file or directory
|
|
1459
|
+
`)}if(x.operator==="<&"&&x.target.type==="Word"){let A=await se(this.ctx,x.target),$=Number.parseInt(A,10);if(!Number.isNaN($)&&this.ctx.state.fileDescriptors){let O=this.ctx.state.fileDescriptors.get($);if(O!==void 0)if(O.startsWith("__rw__:")){let F=Yy(O);F&&(n=F.content.slice(F.position),c=$)}else O.startsWith("__file__:")||O.startsWith("__file_append__:")||(n=O)}}}let u=await se(this.ctx,t.name),f=[],p=[];if(gf(t.name,["local","declare","typeset","export","readonly"])&&(u==="local"||u==="declare"||u==="typeset"||u==="export"||u==="readonly"))for(let x of t.args){let A=await Q6(this.ctx,x);if(A)f.push(A),p.push(!0);else{let $=await X6(this.ctx,x);if($!==null)f.push($),p.push(!0);else{let O=await In(this.ctx,x);for(let F of O.values)f.push(F),p.push(O.quoted)}}}else for(let x of t.args){let A=await In(this.ctx,x);for(let $ of A.values)f.push($),p.push(A.quoted)}if(!u){if(t.name.parts.every(A=>A.type==="CommandSubstitution"||A.type==="ParameterExpansion"||A.type==="ArithmeticExpansion")){if(f.length>0){let A=f.shift();return p.shift(),await this.runCommand(A,f,p,n,!1,!1,c)}return H("","",this.ctx.state.lastExitCode)}return z(`bash: : command not found
|
|
1460
|
+
`,127)}if(u==="exec"&&(f.length===0||f[0]==="--")){for(let x of t.redirections){if(x.target.type==="HereDoc"||x.fdVariable)continue;let A=await se(this.ctx,x.target),$=x.fd??(x.operator==="<"||x.operator==="<>"?0:1);switch(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),x.operator){case">":case">|":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,A);await this.ctx.fs.writeFile(O,"","utf8"),It(this.ctx),this.ctx.state.fileDescriptors.set($,`__file__:${O}`);break}case">>":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,A);It(this.ctx),this.ctx.state.fileDescriptors.set($,`__file_append__:${O}`);break}case"<":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,A);try{let F=await this.ctx.fs.readFile(O);It(this.ctx),this.ctx.state.fileDescriptors.set($,F)}catch{return z(`bash: ${A}: No such file or directory
|
|
1461
|
+
`)}break}case"<>":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,A);try{let F=await this.ctx.fs.readFile(O);It(this.ctx),this.ctx.state.fileDescriptors.set($,`__rw__:${O.length}:${O}:0:${F}`)}catch{await this.ctx.fs.writeFile(O,"","utf8"),It(this.ctx),this.ctx.state.fileDescriptors.set($,`__rw__:${O.length}:${O}:0:`)}break}case">&":{if(A==="-")this.ctx.state.fileDescriptors.delete($);else if(A.endsWith("-")){let O=A.slice(0,-1),F=Number.parseInt(O,10);if(!Number.isNaN(F)){let P=this.ctx.state.fileDescriptors.get(F);P!==void 0?this.ctx.state.fileDescriptors.set($,P):this.ctx.state.fileDescriptors.set($,`__dupout__:${F}`),this.ctx.state.fileDescriptors.delete(F)}}else{let O=Number.parseInt(A,10);Number.isNaN(O)||(It(this.ctx),this.ctx.state.fileDescriptors.set($,`__dupout__:${O}`))}break}case"<&":{if(A==="-")this.ctx.state.fileDescriptors.delete($);else if(A.endsWith("-")){let O=A.slice(0,-1),F=Number.parseInt(O,10);if(!Number.isNaN(F)){let P=this.ctx.state.fileDescriptors.get(F);P!==void 0?this.ctx.state.fileDescriptors.set($,P):this.ctx.state.fileDescriptors.set($,`__dupin__:${F}`),this.ctx.state.fileDescriptors.delete(F)}}else{let O=Number.parseInt(A,10);Number.isNaN(O)||(It(this.ctx),this.ctx.state.fileDescriptors.set($,`__dupin__:${O}`))}break}}}for(let[x,A]of s)A===void 0?this.ctx.state.env.delete(x):this.ctx.state.env.set(x,A);if(this.ctx.state.tempExportedVars)for(let x of s.keys())this.ctx.state.tempExportedVars.delete(x);return ye}if(this.ctx.state.extraArgs){f.push(...this.ctx.state.extraArgs);for(let x=0;x<this.ctx.state.extraArgs.length;x++)p.push(!0);this.ctx.state.extraArgs=void 0}let d=await t7(this.ctx,u,f);s.size>0&&(this.ctx.state.tempEnvBindings=this.ctx.state.tempEnvBindings||[],this.ctx.state.tempEnvBindings.push(new Map(s)));let m,g=null;try{m=await this.runCommand(u,f,p,n,!1,!1,c)}catch(x){if(x instanceof vt||x instanceof kt)g=x,m=ye;else throw x}let y=i+d;if(y&&(m={...m,stderr:y+m.stderr}),m=await Qe(this.ctx,m,t.redirections),g)throw g;if(f.length>0){let x=f[f.length-1];if((u==="declare"||u==="local"||u==="typeset")&&/^[a-zA-Z_][a-zA-Z0-9_]*=\(/.test(x)){let A=x.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);A&&(x=A[1])}this.ctx.state.lastArg=x}else this.ctx.state.lastArg=u;let w=fy(u)&&u!=="unset"&&u!=="eval";if(!this.ctx.state.options.posix||!w)for(let[x,A]of s)this.ctx.state.fullyUnsetLocals?.has(x)||(A===void 0?this.ctx.state.env.delete(x):this.ctx.state.env.set(x,A));if(this.ctx.state.tempExportedVars)for(let x of s.keys())this.ctx.state.tempExportedVars.delete(x);return s.size>0&&this.ctx.state.tempEnvBindings&&this.ctx.state.tempEnvBindings.pop(),this.ctx.state.expansionStderr&&(m={...m,stderr:this.ctx.state.expansionStderr+m.stderr},this.ctx.state.expansionStderr=""),m}async runCommand(t,n,r,s,i=!1,o=!1,a=-1){let l={ctx:this.ctx,runCommand:(u,f,p,h,d,m,g)=>this.runCommand(u,f,p,h,d,m,g),buildExportedEnv:()=>this.buildExportedEnv(),executeUserScript:(u,f,p)=>this.executeUserScript(u,f,p)},c=await jy(l,t,n,r,s,i,o,a);return c!==null?c:Gy(l,t,n,s,o)}aliasExpansionStack=new Set;expandAlias(t){return nu(this.ctx.state,t,this.aliasExpansionStack)}async findCommandInPath(t){return Oa(this.ctx,t)}async executeSubshell(t,n=""){return o7(this.ctx,t,n,r=>this.executeStatement(r))}async executeGroup(t,n=""){return a7(this.ctx,t,n,r=>this.executeStatement(r))}async executeArithmeticCommand(t){t.line!==void 0&&(this.ctx.state.currentLine=t.line);let n=await Vn(this.ctx,t.redirections);if(n)return n;try{let r=await te(this.ctx,t.expression.expression),s=lt(r!==0);return this.ctx.state.expansionStderr&&(s={...s,stderr:this.ctx.state.expansionStderr+s.stderr},this.ctx.state.expansionStderr=""),Qe(this.ctx,s,t.redirections)}catch(r){let s=z(`bash: arithmetic expression: ${r.message}
|
|
1462
|
+
`);return Qe(this.ctx,s,t.redirections)}}async executeConditionalCommand(t){t.line!==void 0&&(this.ctx.state.currentLine=t.line);let n=await Vn(this.ctx,t.redirections);if(n)return n;try{let r=await br(this.ctx,t.expression),s=lt(r);return this.ctx.state.expansionStderr&&(s={...s,stderr:this.ctx.state.expansionStderr+s.stderr},this.ctx.state.expansionStderr=""),Qe(this.ctx,s,t.redirections)}catch(r){let s=r instanceof De?1:2,i=z(`bash: conditional expression: ${r.message}
|
|
1463
|
+
`,s);return Qe(this.ctx,i,t.redirections)}}};var yt={maxCallDepth:100,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:1e4,maxJsTimeoutMs:1e4,maxGlobOperations:1e5,maxStringLength:10485760,maxArrayElements:1e5,maxHeredocSize:10485760,maxSubstitutionDepth:50,maxBraceExpansionResults:1e4,maxOutputSize:10485760,maxFileDescriptors:1024,maxSourceDepth:100};function c7(e){return e?{maxCallDepth:e.maxCallDepth??yt.maxCallDepth,maxCommandCount:e.maxCommandCount??yt.maxCommandCount,maxLoopIterations:e.maxLoopIterations??yt.maxLoopIterations,maxAwkIterations:e.maxAwkIterations??yt.maxAwkIterations,maxSedIterations:e.maxSedIterations??yt.maxSedIterations,maxJqIterations:e.maxJqIterations??yt.maxJqIterations,maxSqliteTimeoutMs:e.maxSqliteTimeoutMs??yt.maxSqliteTimeoutMs,maxPythonTimeoutMs:e.maxPythonTimeoutMs??yt.maxPythonTimeoutMs,maxJsTimeoutMs:e.maxJsTimeoutMs??yt.maxJsTimeoutMs,maxGlobOperations:e.maxGlobOperations??yt.maxGlobOperations,maxStringLength:e.maxStringLength??yt.maxStringLength,maxArrayElements:e.maxArrayElements??yt.maxArrayElements,maxHeredocSize:e.maxHeredocSize??yt.maxHeredocSize,maxSubstitutionDepth:e.maxSubstitutionDepth??yt.maxSubstitutionDepth,maxBraceExpansionResults:e.maxBraceExpansionResults??yt.maxBraceExpansionResults,maxOutputSize:e.maxOutputSize??yt.maxOutputSize,maxFileDescriptors:e.maxFileDescriptors??yt.maxFileDescriptors,maxSourceDepth:e.maxSourceDepth??yt.maxSourceDepth}:{...yt}}function u7(){throw new Error("node:dns is not available in browser environments")}an();zs();function yf(e){try{let t=new URL(e);return{origin:t.origin,pathname:t.pathname,href:t.href}}catch{return null}}function LC(e){let t=yf(e);return t?{origin:t.origin,pathPrefix:t.pathname}:null}function f7(e){if(e.includes("\\"))return!0;let t=e.toLowerCase();return t.includes("%2f")||t.includes("%5c")}function MC(e,t){return t==="/"||t===""?!0:t.endsWith("/")?e.startsWith(t):e===t||e.startsWith(`${t}/`)}function wf(e,t){let n=yf(e);if(!n)return!1;let r=LC(t);return!r||n.origin!==r.origin||r.pathPrefix!=="/"&&r.pathPrefix!==""&&f7(n.pathname)?!1:MC(n.pathname,r.pathPrefix)}function p7(e){return typeof e=="string"?e:e.url}function h7(e,t){return!t||t.length===0?!1:t.some(n=>wf(e,p7(n)))}function bf(e){let t=UC(e);if(t==="localhost"||t.endsWith(".localhost"))return!0;let n=d7(t);if(n)return Ta(n);let r=WC(t);return r?zC(r):!1}function UC(e){let t=e.trim().toLowerCase();return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function BC(e){if(!e)return null;let t=10,n=e;if(n.startsWith("0x")||n.startsWith("0X")?(t=16,n=n.slice(2)):n.length>1&&n.startsWith("0")&&(t=8),!n||t===16&&!/^[0-9a-fA-F]+$/.test(n)||t===10&&!/^\d+$/.test(n)||t===8&&!/^[0-7]+$/.test(n))return null;let r=Number.parseInt(n,t);return!Number.isFinite(r)||r<0?null:r}function d7(e){let t=e.split(".");if(t.length===0||t.length>4)return null;let n=t.map(l=>BC(l));if(n.some(l=>l===null))return null;let r=n;if(t.length===1){let l=r[0];return l>4294967295?null:[l>>>24&255,l>>>16&255,l>>>8&255,l&255]}if(t.length===2){let[l,c]=r;return l>255||c>16777215?null:[l,c>>>16&255,c>>>8&255,c&255]}if(t.length===3){let[l,c,u]=r;return l>255||c>255||u>65535?null:[l,c,u>>>8&255,u&255]}let[s,i,o,a]=r;return s>255||i>255||o>255||a>255?null:[s,i,o,a]}function WC(e){let t=e,n=null;if(t.includes(".")){let m=t.lastIndexOf(":");if(m<0)return null;let g=t.slice(m+1),y=d7(g);if(!y)return null;n=y,t=t.slice(0,m)}let r=t.includes("::")?t.split("::").length-1:0;if(r>1)return null;let[s,i]=t.split("::"),o=s?s.split(":").filter(Boolean):[],a=i?i.split(":").filter(Boolean):[],l=m=>/^[0-9a-f]{1,4}$/i.test(m)?Number.parseInt(m,16):null,c=o.map(l),u=a.map(l);if(c.some(m=>m===null)||u.some(m=>m===null))return null;let f=n?2:0,p=c.length+u.length+f,h=0;if(r===1){if(h=8-p,h<0)return null}else if(p!==8)return null;let d=[...c,...new Array(h).fill(0),...u];return n&&(d.push(n[0]<<8|n[1]),d.push(n[2]<<8|n[3])),d.length===8?d:null}function Ta(e){let[t,n]=e;return t===127||t===10||t===172&&n>=16&&n<=31||t===192&&n===168||t===169&&n===254||t===0||t===100&&n>=64&&n<=127||t===198&&(n===18||n===19)||t===192&&n===0&&e[2]===0||t===192&&n===0&&e[2]===2||t===198&&n===51&&e[2]===100||t===203&&n===0&&e[2]===113||t>=240}function zC(e){if(e.every(s=>s===0)||e.slice(0,7).every(s=>s===0)&&e[7]===1||(e[0]&65472)===65152||(e[0]&65024)===64512)return!0;if(e[0]===0&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===65535){let s=[e[6]>>>8&255,e[6]&255,e[7]>>>8&255,e[7]&255];return Ta(s)}if(e[0]===8193&&e[1]===3512)return!0;if(e[0]===100&&e[1]===65435&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===0){let s=[e[6]>>>8&255,e[6]&255,e[7]>>>8&255,e[7]&255];return Ta(s)}if(e[0]===100&&e[1]===65435&&e[2]===1)return!0;if(e[0]===8194){let s=[e[1]>>>8&255,e[1]&255,e[2]>>>8&255,e[2]&255];return Ta(s)}return!1}function m7(e){let t=[];for(let n of e){if(typeof n!="string"&&(n===null||typeof n!="object"||!("url"in n)||typeof n.url!="string")){t.push('Invalid allow-list entry: must be a string URL or an object with a "url" string property');continue}let r=p7(n);if(!yf(r)){t.push(`Invalid URL in allow-list: "${r}" - must be a valid URL with scheme and host (e.g., "https://example.com")`);continue}let i=new URL(r);if(i.protocol!=="http:"&&i.protocol!=="https:"){t.push(`Only http and https URLs are allowed in allow-list: "${r}"`);continue}if(!i.hostname){t.push(`Allow-list entry must include a hostname: "${r}"`);continue}if(i.pathname!=="/"&&i.pathname!==""&&f7(i.pathname)){t.push(`Allow-list entry contains ambiguous path separators: "${r}"`);continue}(i.search||i.hash)&&t.push(`Query strings and fragments are ignored in allow-list entries: "${r}"`)}return t}var $n=class extends Error{constructor(t,n){let r=n??"URL not in allow-list";super(`Network access denied: ${r}: ${t}`),this.name="NetworkAccessDeniedError"}},Ms=class extends Error{constructor(t){super(`Too many redirects (max: ${t})`),this.name="TooManyRedirectsError"}},Us=class extends Error{constructor(t){super(`Redirect target not in allow-list: ${t}`),this.name="RedirectNotAllowedError"}},Pa=class extends Error{constructor(t,n){super(`HTTP method '${t}' not allowed. Allowed methods: ${n.join(", ")}`),this.name="MethodNotAllowedError"}},Bs=class extends Error{constructor(t){super(`Response body too large (max: ${t} bytes)`),this.name="ResponseTooLargeError"}};function HC(e){return new Promise((t,n)=>{u7(e,{all:!0},(r,s)=>{r?n(r):t(s)})})}var jC=20,GC=3e4,VC=10485760,qC=["GET","HEAD"],ZC=new Set(["GET","HEAD","OPTIONS"]),KC=new Set([301,302,303,307,308]);function xf(e){let t=e.allowedUrlPrefixes??[];if(!e.dangerouslyAllowFullInternetAccess){let h=m7(t);if(h.length>0)throw new Error(`Invalid network allow-list:
|
|
1464
|
+
${h.join(`
|
|
1465
|
+
`)}`)}let n=[];for(let h of t)typeof h=="object"&&h.transform&&h.transform.length>0&&n.push(h);function r(h){if(n.length===0)return null;let d=null;for(let m of n)if(wf(h,m.url)&&m.transform){d||(d=new Headers);for(let g of m.transform)for(let[y,w]of Object.entries(g.headers))d.set(y,w)}return d}let s=e.maxRedirects??jC,i=e.timeoutMs??GC,o=e.maxResponseSize??VC,a=e.dangerouslyAllowFullInternetAccess?["GET","HEAD","POST","PUT","DELETE","PATCH","OPTIONS"]:e.allowedMethods??qC,l=e.denyPrivateRanges??(typeof process<"u"&&!0),c=e._dnsResolve??HC;async function u(h){if(!e.dangerouslyAllowFullInternetAccess&&!h7(h,t))throw new $n(h);if(l)try{let d=new URL(h);if(bf(d.hostname))throw new $n(h,"private/loopback IP address blocked");let m=d.hostname;if(/[a-zA-Z]/.test(m))try{let y=await c(m);for(let{address:w}of y)if(bf(w))throw new $n(h,"hostname resolves to private/loopback IP address")}catch(y){if(y instanceof $n)throw y;let w=y?.code;if(!(w==="ENOTFOUND"||w==="ENODATA"))throw new $n(h,"DNS resolution failed for private IP check")}}catch(d){if(d instanceof $n)throw d}}function f(h){if(e.dangerouslyAllowFullInternetAccess)return;let d=h.toUpperCase();if(!a.includes(d))throw new Pa(d,a)}async function p(h,d={}){let m=d.method?.toUpperCase()??"GET";await u(h),f(m);let g=h,y=0,w=d.followRedirects??!0,b=d.timeoutMs!==void 0?Math.min(d.timeoutMs,i):i;for(;;){let x=new AbortController,A=Sr(()=>x.abort(),b);try{let $=await wt.runTrustedAsync(()=>{let O=r(g),F=QC(d.headers,O),P={method:m,headers:F,signal:x.signal,redirect:"manual"};return d.body&&!ZC.has(m)&&(P.body=d.body),fetch(g,P)});if(KC.has($.status)&&w){let O=$.headers.get("location");if(!O)return await g7($,g,o);let F=new URL(O,g).href;try{await u(F)}catch{throw new Us(F)}if(y++,y>s)throw new Ms(s);g=F;continue}return await g7($,g,o)}finally{Qr(A)}}}return p}function QC(e,t){if(!e&&!t)return;if(!t)return e;let n=e instanceof Headers?new Headers(e):new Headers(e);for(let[r,s]of t)n.set(r,s);return n}async function g7(e,t,n){let r=Object.create(null);if(e.headers.forEach((i,o)=>{r[o.toLowerCase()]=i}),n>0){let i=e.headers.get("content-length");if(i){let o=parseInt(i,10);if(!Number.isNaN(o)&&o>n)throw new Bs(n)}}let s;if(n>0&&e.body){let i=e.body.getReader(),o=[],a=0;for(;;){let{done:c,value:u}=await i.read();if(c)break;if(u){if(a+=u.byteLength,a>n)throw i.cancel(),new Bs(n);o.push(u)}}s=new Uint8Array(a);let l=0;for(let c of o)s.set(c,l),l+=c.byteLength}else{let i=await e.arrayBuffer();if(n>0&&i.byteLength>n)throw new Bs(n);s=new Uint8Array(i)}return{status:e.status,statusText:e.statusText,headers:r,body:s,url:t}}pr();ot();an();function y7(e){return Zr(e)}function Zr(e){return e.statements.map(w7).join(`
|
|
1466
|
+
`)}function w7(e){let t=[];for(let r=0;r<e.pipelines.length;r++)t.push(XC(e.pipelines[r])),r<e.operators.length&&t.push(e.operators[r]);let n=t.join(" ");return e.background&&(n+=" &"),n}function XC(e){let t=[];e.timed&&t.push(e.timePosix?"time -p":"time"),e.negated&&t.push("!");let n=[];for(let s=0;s<e.commands.length;s++)if(n.push(b7(e.commands[s])),s<e.commands.length-1){let i=e.pipeStderr?.[s];n.push(i?"|&":"|")}return(t.length>0?`${t.join(" ")} `:"")+n.join(" ")}function b7(e){switch(e.type){case"SimpleCommand":return YC(e);case"If":return av(e);case"For":return lv(e);case"CStyleFor":return cv(e);case"While":return uv(e);case"Until":return fv(e);case"Case":return pv(e);case"Subshell":return dv(e);case"Group":return mv(e);case"ArithmeticCommand":return gv(e);case"ConditionalCommand":return yv(e);case"FunctionDef":return wv(e);default:{let t=e;throw new Error(`Unsupported command type: ${t.type}`)}}}function YC(e){let t=[];for(let n of e.assignments)t.push(JC(n));e.name&&t.push(Mt(e.name));for(let n of e.args)t.push(Mt(n));for(let n of e.redirections)t.push(A7(n));return t.join(" ")}function JC(e){let t=e.append?"+=":"=";if(e.array){let n=e.array.map(Mt).join(" ");return`${e.name}${t}(${n})`}return e.value?`${e.name}${t}${Mt(e.value)}`:`${e.name}${t}`}function Mt(e){return e.parts.map(t=>Da(t,!1)).join("")}function Er(e){return e.parts.map(t=>Da(t,!0)).join("")}function Da(e,t){switch(e.type){case"Literal":return t?tv(e.value):ev(e.value);case"SingleQuoted":return`'${e.value}'`;case"DoubleQuoted":return`"${e.parts.map(n=>Da(n,!0)).join("")}"`;case"Escaped":return`\\${e.value}`;case"ParameterExpansion":return x7(e);case"CommandSubstitution":return e.legacy?`\`${Zr(e.body)}\``:`$(${Zr(e.body)})`;case"ArithmeticExpansion":return`$((${je(e.expression.expression)}))`;case"ProcessSubstitution":return e.direction==="input"?`<(${Zr(e.body)})`:`>(${Zr(e.body)})`;case"BraceExpansion":return iv(e);case"TildeExpansion":return e.user!==null?`~${e.user}`:"~";case"Glob":return e.pattern;default:{let n=e;throw new Error(`Unsupported word part type: ${n.type}`)}}}function ev(e){return e.replace(/[\s\\'"`!|&;()<>{}[\]*?~#]/g,"\\$&")}function tv(e){return e.replace(/[$`"\\]/g,"\\$&")}function nv(e,t){return e.parts.map(n=>rv(n,t)).join("")}function rv(e,t){switch(e.type){case"Literal":return t?e.value:e.value.replace(/[$`]/g,"\\$&");case"Escaped":return`\\${e.value}`;case"ParameterExpansion":return x7(e);case"CommandSubstitution":return e.legacy?`\`${Zr(e.body)}\``:`$(${Zr(e.body)})`;case"ArithmeticExpansion":return`$((${je(e.expression.expression)}))`;default:return Da(e,!1)}}function x7(e){return e.operation?`\${${E7(e.parameter,e.operation)}}`:sv(e.parameter)?`\${${e.parameter}}`:`$${e.parameter}`}function sv(e){return!(/^[?#@*$!\-0-9]$/.test(e)||/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))}function E7(e,t){switch(t.type){case"Length":return`#${e}`;case"LengthSliceError":return`#${e}:`;case"BadSubstitution":return t.text;case"DefaultValue":return`${e}${t.checkEmpty?":":""}-${Er(t.word)}`;case"AssignDefault":return`${e}${t.checkEmpty?":":""}=${Er(t.word)}`;case"ErrorIfUnset":return`${e}${t.checkEmpty?":":""}?${t.word?Er(t.word):""}`;case"UseAlternative":return`${e}${t.checkEmpty?":":""}+${Er(t.word)}`;case"Substring":{let n=je(t.offset.expression);return t.length?`${e}:${n}:${je(t.length.expression)}`:`${e}:${n}`}case"PatternRemoval":{let n=t.side==="prefix"?"#":"%",r=t.greedy?`${n}${n}`:n;return`${e}${r}${Er(t.pattern)}`}case"PatternReplacement":{let n="/";t.all?n="//":t.anchor==="start"?n="/#":t.anchor==="end"&&(n="/%");let r=t.replacement?`/${Er(t.replacement)}`:"";return`${e}${n}${Er(t.pattern)}${r}`}case"CaseModification":{let n=t.direction==="upper"?"^":",",r=t.all?`${n}${n}`:n,s=t.pattern?Er(t.pattern):"";return`${e}${r}${s}`}case"Transform":return`${e}@${t.operator}`;case"Indirection":return t.innerOp?`!${E7(e,t.innerOp)}`:`!${e}`;case"ArrayKeys":return`!${t.array}[${t.star?"*":"@"}]`;case"VarNamePrefix":return`!${t.prefix}${t.star?"*":"@"}`;default:{let n=t;throw new Error(`Unsupported parameter operation type: ${n.type}`)}}}function iv(e){return`{${e.items.map(ov).join(",")}}`}function ov(e){if(e.type==="Word")return Mt(e.word);let t=e.startStr??String(e.start),n=e.endStr??String(e.end);return e.step!==void 0?`${t}..${n}..${e.step}`:`${t}..${n}`}function A7(e){let t=e.fdVariable?`{${e.fdVariable}}`:e.fd!==null?String(e.fd):"";if(e.operator==="<<"||e.operator==="<<-"){let n=e.target,r=n.quoted?`'${n.delimiter}'`:n.delimiter,s=nv(n.content,n.quoted);return`${t}${e.operator}${r}
|
|
1467
|
+
${s}${n.delimiter}`}return e.operator==="<<<"?`${t}<<< ${Mt(e.target)}`:e.operator==="&>"||e.operator==="&>>"?`${e.operator} ${Mt(e.target)}`:`${t}${e.operator} ${Mt(e.target)}`}function On(e){return e.length===0?"":` ${e.map(A7).join(" ")}`}function mn(e){return e.map(w7).join(`
|
|
1468
|
+
`)}function av(e){let t=[];for(let n=0;n<e.clauses.length;n++){let r=e.clauses[n],s=n===0?"if":"elif";t.push(`${s} ${mn(r.condition)}; then
|
|
1469
|
+
${mn(r.body)}`)}return e.elseBody&&t.push(`else
|
|
1470
|
+
${mn(e.elseBody)}`),`${t.join(`
|
|
1471
|
+
`)}
|
|
1472
|
+
fi${On(e.redirections)}`}function lv(e){let t;if(e.words===null)t=`for ${e.variable}`;else{let n=e.words.map(Mt).join(" ");t=`for ${e.variable} in ${n}`}return`${t}; do
|
|
1473
|
+
${mn(e.body)}
|
|
1474
|
+
done${On(e.redirections)}`}function cv(e){let t=e.init?je(e.init.expression):"",n=e.condition?je(e.condition.expression):"",r=e.update?je(e.update.expression):"";return`for ((${t}; ${n}; ${r})); do
|
|
1475
|
+
${mn(e.body)}
|
|
1476
|
+
done${On(e.redirections)}`}function uv(e){return`while ${mn(e.condition)}; do
|
|
1477
|
+
${mn(e.body)}
|
|
1478
|
+
done${On(e.redirections)}`}function fv(e){return`until ${mn(e.condition)}; do
|
|
1479
|
+
${mn(e.body)}
|
|
1480
|
+
done${On(e.redirections)}`}function pv(e){let t=e.items.map(hv).join(`
|
|
1481
|
+
`);return`case ${Mt(e.word)} in
|
|
1482
|
+
${t}
|
|
1483
|
+
esac${On(e.redirections)}`}function hv(e){let t=e.patterns.map(Mt).join(" | "),n=mn(e.body);return n?`${t})
|
|
1484
|
+
${n}
|
|
1485
|
+
${e.terminator}`:`${t})
|
|
1486
|
+
${e.terminator}`}function dv(e){return`(${mn(e.body)})${On(e.redirections)}`}function mv(e){return`{ ${mn(e.body)}; }${On(e.redirections)}`}function gv(e){return`((${je(e.expression.expression)}))${On(e.redirections)}`}function yv(e){return`[[ ${qr(e.expression)} ]]${On(e.redirections)}`}function wv(e){let t=b7(e.body);return`${e.name}() ${t}${On(e.redirections)}`}function je(e){switch(e.type){case"ArithNumber":return String(e.value);case"ArithVariable":return e.hasDollarPrefix?`$${e.name}`:e.name;case"ArithSpecialVar":return`$${e.name}`;case"ArithBinary":return`${je(e.left)} ${e.operator} ${je(e.right)}`;case"ArithUnary":return e.prefix?`${e.operator}${je(e.operand)}`:`${je(e.operand)}${e.operator}`;case"ArithTernary":return`${je(e.condition)} ? ${je(e.consequent)} : ${je(e.alternate)}`;case"ArithAssignment":return`${e.subscript?`${e.variable}[${je(e.subscript)}]`:e.stringKey!==void 0?`${e.variable}[${e.stringKey}]`:e.variable} ${e.operator} ${je(e.value)}`;case"ArithDynamicAssignment":return`${e.subscript?`${je(e.target)}[${je(e.subscript)}]`:je(e.target)} ${e.operator} ${je(e.value)}`;case"ArithDynamicElement":return`${je(e.nameExpr)}[${je(e.subscript)}]`;case"ArithGroup":return`(${je(e.expression)})`;case"ArithNested":return`$((${je(e.expression)}))`;case"ArithCommandSubst":return`$(${e.command})`;case"ArithBracedExpansion":return`\${${e.content}}`;case"ArithArrayElement":return e.stringKey!==void 0?`${e.array}[${e.stringKey}]`:e.index?`${e.array}[${je(e.index)}]`:e.array;case"ArithDynamicBase":return`\${${e.baseExpr}}#${e.value}`;case"ArithDynamicNumber":return`\${${e.prefix}}${e.suffix}`;case"ArithConcat":return e.parts.map(je).join("");case"ArithDoubleSubscript":return`${e.array}[${je(e.index)}]`;case"ArithNumberSubscript":return`${e.number}[${e.errorToken}]`;case"ArithSyntaxError":return e.errorToken;case"ArithSingleQuote":return`'${e.content}'`;default:{let t=e;throw new Error(`Unsupported arithmetic expression type: ${t.type}`)}}}function qr(e){switch(e.type){case"CondBinary":return`${Mt(e.left)} ${e.operator} ${Mt(e.right)}`;case"CondUnary":return`${e.operator} ${Mt(e.operand)}`;case"CondNot":return`! ${qr(e.operand)}`;case"CondAnd":return`${qr(e.left)} && ${qr(e.right)}`;case"CondOr":return`${qr(e.left)} || ${qr(e.right)}`;case"CondGroup":return`( ${qr(e.expression)} )`;case"CondWord":return Mt(e.word);default:{let t=e;throw new Error(`Unsupported conditional expression type: ${t.type}`)}}}var Ef=class{fs;commands=new Map;useDefaultLayout=!1;limits;secureFetch;sleepFn;traceFn;logger;defenseInDepthConfig;coverageWriter;jsBootstrapCode;transformPlugins=[];state;constructor(t={}){let n=t.fs??new Yn(t.files);this.fs=n,this.useDefaultLayout=!t.cwd&&!t.files;let r=t.cwd||(this.useDefaultLayout?"/home/user":"/"),s=new Map([["HOME",this.useDefaultLayout?"/home/user":"/"],["PATH","/usr/bin:/bin"],["IFS",`
|
|
1487
|
+
`],["OSTYPE","linux-gnu"],["MACHTYPE","x86_64-pc-linux-gnu"],["HOSTTYPE","x86_64"],["HOSTNAME","localhost"],["PWD",r],["OLDPWD",r],["OPTIND","1"],...Object.entries(t.env??{})]);if(this.limits=c7({...t.executionLimits,...t.maxCallDepth!==void 0&&{maxCallDepth:t.maxCallDepth},...t.maxCommandCount!==void 0&&{maxCommandCount:t.maxCommandCount},...t.maxLoopIterations!==void 0&&{maxLoopIterations:t.maxLoopIterations}}),t.fetch?this.secureFetch=t.fetch:t.network&&(this.secureFetch=xf(t.network)),this.sleepFn=t.sleep,this.traceFn=t.trace,this.logger=t.logger,this.defenseInDepthConfig=t.defenseInDepth??!0,this.coverageWriter=t.coverage,this.state={env:s,cwd:r,previousDir:"/home/user",functions:new Map,localScopes:[],callDepth:0,sourceDepth:0,commandCount:0,lastExitCode:0,lastArg:"",startTime:Date.now(),lastBackgroundPid:0,virtualPid:t.processInfo?.pid??1,virtualPpid:t.processInfo?.ppid??0,virtualUid:t.processInfo?.uid??1e3,virtualGid:t.processInfo?.gid??1e3,bashPid:t.processInfo?.pid??1,nextVirtualPid:(t.processInfo?.pid??1)+1,currentLine:1,options:{errexit:!1,pipefail:!1,nounset:!1,xtrace:!1,verbose:!1,posix:!1,allexport:!1,noclobber:!1,noglob:!1,noexec:!1,vi:!1,emacs:!1},shoptOptions:{extglob:!1,dotglob:!1,nullglob:!1,failglob:!1,globstar:!1,globskipdots:!0,nocaseglob:!1,nocasematch:!1,expand_aliases:!1,lastpipe:!1,xpg_echo:!1},inCondition:!1,loopDepth:0,exportedVars:new Set(["HOME","PATH","PWD","OLDPWD",...Object.keys(t.env||{})]),readonlyVars:new Set(["SHELLOPTS","BASHOPTS"]),hashTable:new Map},this.state.env.set("SHELLOPTS",Tc(this.state.options)),this.state.env.set("BASHOPTS",Pc(this.state.shoptOptions)),C2(n,this.useDefaultLayout,{pid:this.state.virtualPid,ppid:this.state.virtualPpid,uid:this.state.virtualUid,gid:this.state.virtualGid}),r!=="/"&&n instanceof Yn)try{n.mkdirSync(r,{recursive:!0})}catch{}for(let i of d2(t.commands))this.registerCommand(i);if(t.fetch||t.network)for(let i of m2())this.registerCommand(i);if(t.python)for(let i of g2())this.registerCommand(i);if(t.javascript){for(let o of y2())this.registerCommand(o);let i=typeof t.javascript=="object"?t.javascript:Object.create(null);i.bootstrap&&(this.jsBootstrapCode=i.bootstrap)}if(t.customCommands)for(let i of t.customCommands)w2(i)?this.registerCommand(b2(i)):this.registerCommand({...i,trusted:i.trusted??!0})}registerCommand(t){this.commands.set(t.name,t);let n=this.fs;if(typeof n.writeFileSync=="function"){let r=`#!/bin/bash
|
|
1488
|
+
# Built-in command: ${t.name}
|
|
1489
|
+
`;try{n.writeFileSync(`/bin/${t.name}`,r)}catch{}try{n.writeFileSync(`/usr/bin/${t.name}`,r)}catch{}}}logResult(t){return this.logger&&(t.stdout&&this.logger.debug("stdout",{output:t.stdout}),t.stderr&&this.logger.info("stderr",{output:t.stderr}),this.logger.info("exit",{exitCode:t.exitCode})),t.stdout=C7(t.stdout),t.stderr=C7(t.stderr),t}async exec(t,n){if(this.state.callDepth===0&&(this.state.commandCount=0),this.state.commandCount++,this.state.commandCount>this.limits.maxCommandCount)return{stdout:"",stderr:`bash: maximum command count (${this.limits.maxCommandCount}) exceeded (possible infinite loop). Increase with executionLimits.maxCommandCount option.
|
|
1490
|
+
`,exitCode:1,env:cn(this.state.env,n?.env)};if(!t.trim())return{stdout:"",stderr:"",exitCode:0,env:cn(this.state.env,n?.env)};this.logger?.info("exec",{command:t});let r=n?.cwd??this.state.cwd,s,i=r;if(n?.cwd)if(n.env&&"PWD"in n.env)s=n.env.PWD;else if(n?.env&&!("PWD"in n.env))try{s=await this.fs.realpath(r),i=s}catch{s=r}else s=r;let o=n?.replaceEnv?new Map:new Map(this.state.env);if(n?.env)for(let[f,p]of Object.entries(n.env))o.set(f,p);s!==void 0&&o.set("PWD",s);let a={...this.state,env:o,cwd:i,functions:new Map(this.state.functions),localScopes:[...this.state.localScopes],options:{...this.state.options},hashTable:this.state.hashTable,groupStdin:n?.stdin,signal:n?.signal,extraArgs:n?.args},l=t;n?.rawScript||(l=S7(t));let c=this.defenseInDepthConfig?wt.getInstance(this.defenseInDepthConfig):null,u=c?.activate();try{let f=async()=>{let p=Sn(l,{maxHeredocSize:this.limits.maxHeredocSize}),h;if(this.transformPlugins.length>0){let w=Object.create(null);for(let b of this.transformPlugins){let x=b.transform({ast:p,metadata:w});p=x.ast,x.metadata&&(w=$r(w,x.metadata))}h=w}let d={fs:this.fs,commands:this.commands,limits:this.limits,exec:this.exec.bind(this),fetch:this.secureFetch,sleep:this.sleepFn,trace:this.traceFn,coverage:this.coverageWriter,requireDefenseContext:c?.isEnabled()===!0,jsBootstrapCode:this.jsBootstrapCode},y=await new Ii(d,a).executeScript(p);return h&&(y.metadata=h),this.logResult(y)};return u?await u.run(f):await f()}catch(f){if(f instanceof ge)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:f.exitCode,env:cn(this.state.env,n?.env)});if(f instanceof Jt)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:f.exitCode,env:cn(this.state.env,n?.env)});if(f instanceof De)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:1,env:cn(this.state.env,n?.env)});if(f instanceof es)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:124,env:cn(this.state.env,n?.env)});if(f instanceof Q)return this.logResult({stdout:f.stdout,stderr:Be(f.stderr),exitCode:Q.EXIT_CODE,env:cn(this.state.env,n?.env)});if(f instanceof he)return this.logResult({stdout:"",stderr:`bash: security violation: ${Be(f.message)}
|
|
1491
|
+
`,exitCode:1,env:cn(this.state.env,n?.env)});if(f.name==="ParseException")return this.logResult({stdout:"",stderr:`bash: syntax error: ${Be(f.message)}
|
|
1492
|
+
`,exitCode:2,env:cn(this.state.env,n?.env)});if(f instanceof fr)return this.logResult({stdout:"",stderr:`bash: ${Be(f.message)}
|
|
1493
|
+
`,exitCode:2,env:cn(this.state.env,n?.env)});if(f instanceof RangeError)return this.logResult({stdout:"",stderr:`bash: ${Be(f.message)}
|
|
1494
|
+
`,exitCode:1,env:cn(this.state.env,n?.env)});throw f}finally{u?.deactivate()}}async readFile(t){return this.fs.readFile(this.fs.resolvePath(this.state.cwd,t))}async writeFile(t,n){return this.fs.writeFile(this.fs.resolvePath(this.state.cwd,t),n)}getCwd(){return this.state.cwd}getEnv(){return Et(this.state.env)}registerTransformPlugin(t){this.transformPlugins.push(t)}transform(t){let n=S7(t),r=Sn(n,{maxHeredocSize:this.limits.maxHeredocSize}),s=Object.create(null);for(let i of this.transformPlugins){let o=i.transform({ast:r,metadata:s});r=o.ast,o.metadata&&(s=$r(s,o.metadata))}return{script:y7(r),ast:r,metadata:s}}};function S7(e){let t=e.split(`
|
|
1495
|
+
`),n=[],r=[];for(let s=0;s<t.length;s++){let i=t[s];if(r.length>0){let l=r[r.length-1];if((l.stripTabs?i.replace(/^\t+/,""):i)===l.delimiter){n.push(i.trimStart()),r.pop();continue}n.push(i);continue}let o=i.trimStart();n.push(o);let a=/<<(-?)\s*(['"]?)([\w-]+)\2/g;for(let l of o.matchAll(a)){let c=l[1]==="-",u=l[3];r.push({delimiter:u,stripTabs:c})}}return n.join(`
|
|
1496
|
+
`)}var bv=new TextDecoder("utf-8",{fatal:!0});function C7(e){if(!e)return e;let t=!1;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s>255)return e;s>127&&(t=!0)}if(!t)return e;let n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);try{return bv.decode(n)}catch{return e}}var _a=class{baseFs;mounts=new Map;constructor(t){if(this.baseFs=t?.base??new Yn,t?.mounts)for(let{mountPoint:n,filesystem:r}of t.mounts)this.mount(n,r)}mount(t,n){this.validateMountPath(t);let r=Se(t);this.validateMount(r),this.mounts.set(r,{mountPoint:r,filesystem:n})}unmount(t){let n=Se(t);if(!this.mounts.has(n))throw new Error(`No filesystem mounted at '${t}'`);this.mounts.delete(n)}getMounts(){return Array.from(this.mounts.values()).map(t=>({mountPoint:t.mountPoint,filesystem:t.filesystem}))}isMountPoint(t){let n=Se(t);return this.mounts.has(n)}validateMountPath(t){let n=t.split("/");for(let r of n)if(r==="."||r==="..")throw new Error(`Invalid mount point '${t}': contains '.' or '..' segments`)}validateMount(t){if(t==="/")throw new Error("Cannot mount at root '/'");for(let n of this.mounts.keys())if(n!==t){if(t.startsWith(`${n}/`))throw new Error(`Cannot mount at '${t}': inside existing mount '${n}'`);if(n.startsWith(`${t}/`))throw new Error(`Cannot mount at '${t}': would contain existing mount '${n}'`)}}routePath(t){it(t,"access");let n=Se(t),r=null,s=0;for(let i of this.mounts.values()){let o=i.mountPoint;if(n===o)return{fs:i.filesystem,relativePath:"/"};n.startsWith(`${o}/`)&&o.length>s&&(r=i,s=o.length)}if(r){let i=n.slice(s);return{fs:r.filesystem,relativePath:i||"/"}}return{fs:this.baseFs,relativePath:n}}getChildMountPoints(t){let n=Se(t),r=n==="/"?"/":`${n}/`,s=[];for(let i of this.mounts.keys())if(i.startsWith(r)){let a=i.slice(r.length).split("/")[0];a&&!s.includes(a)&&s.push(a)}return s}async readFile(t,n){let{fs:r,relativePath:s}=this.routePath(t);return r.readFile(s,n)}async readFileBuffer(t){let{fs:n,relativePath:r}=this.routePath(t);return n.readFileBuffer(r)}async writeFile(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.writeFile(i,n,r)}async appendFile(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.appendFile(i,n,r)}async exists(t){let n=Se(t);if(this.mounts.has(n)||this.getChildMountPoints(n).length>0)return!0;let{fs:s,relativePath:i}=this.routePath(t);return s.exists(i)}async stat(t){let n=Se(t),r=this.mounts.get(n);if(r)try{return await r.filesystem.stat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(n).length>0)try{return await this.baseFs.stat(n)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:o}=this.routePath(t);return i.stat(o)}async lstat(t){let n=Se(t),r=this.mounts.get(n);if(r)try{return await r.filesystem.lstat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(n).length>0)try{return await this.baseFs.lstat(n)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:o}=this.routePath(t);return i.lstat(o)}async mkdir(t,n){let r=Se(t);if(this.mounts.has(r)){if(n?.recursive)return;throw new Error(`EEXIST: directory already exists, mkdir '${t}'`)}if(this.getChildMountPoints(r).length>0&&n?.recursive)return;let{fs:i,relativePath:o}=this.routePath(t);return i.mkdir(o,n)}async readdir(t){let n=Se(t),r=new Set,s=null,{fs:i,relativePath:o}=this.routePath(t);try{let l=await i.readdir(o);for(let c of l)r.add(c)}catch(l){let c=l.code,u=l.message||"";if(c!=="ENOENT"&&!u.includes("ENOENT"))throw l;s=l}let a=this.getChildMountPoints(n);for(let l of a)r.add(l);if(r.size===0&&s&&!this.mounts.has(n))throw s;return Array.from(r).sort()}async rm(t,n){let r=Se(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot remove '${t}'`);if(this.getChildMountPoints(r).length>0)throw new Error(`EBUSY: contains mount points, cannot remove '${t}'`);let{fs:i,relativePath:o}=this.routePath(t);return i.rm(o,n)}async cp(t,n,r){let s=this.routePath(t),i=this.routePath(n);return s.fs===i.fs?s.fs.cp(s.relativePath,i.relativePath,r):this.crossMountCopy(t,n,r)}async mv(t,n){let r=Se(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot move '${t}'`);let s=this.routePath(t),i=this.routePath(n);if(s.fs===i.fs)return s.fs.mv(s.relativePath,i.relativePath);await this.cp(t,n,{recursive:!0}),await this.rm(t,{recursive:!0})}resolvePath(t,n){return Wo(t,n)}getAllPaths(){let t=new Set;for(let n of this.baseFs.getAllPaths())t.add(n);for(let n of this.mounts.keys()){let r=n.split("/").filter(Boolean),s="";for(let o of r)s=`${s}/${o}`,t.add(s);let i=this.mounts.get(n);if(i)for(let o of i.filesystem.getAllPaths())o==="/"?t.add(n):t.add(`${n}${o}`)}return Array.from(t).sort()}async chmod(t,n){let r=Se(t),s=this.mounts.get(r);if(s)return s.filesystem.chmod("/",n);let{fs:i,relativePath:o}=this.routePath(t);return i.chmod(o,n)}async symlink(t,n){let{fs:r,relativePath:s}=this.routePath(n);return r.symlink(t,s)}async link(t,n){let r=this.routePath(t),s=this.routePath(n);if(r.fs!==s.fs)throw new Error(`EXDEV: cross-device link not permitted, link '${t}' -> '${n}'`);return r.fs.link(r.relativePath,s.relativePath)}async readlink(t){let{fs:n,relativePath:r}=this.routePath(t);return n.readlink(r)}async realpath(t){let n=Se(t);if(this.mounts.get(n))return n;let{fs:s,relativePath:i}=this.routePath(t),o=await s.realpath(i);for(let[a,l]of this.mounts)if(n===a||n.startsWith(`${a}/`))return o==="/"?a:`${a}${o}`;return o}async crossMountCopy(t,n,r){let s=await this.lstat(t);if(s.isFile){let i=await this.readFileBuffer(t);await this.writeFile(n,i),await this.chmod(n,s.mode)}else if(s.isDirectory){if(!r?.recursive)throw new Error(`cp: ${t} is a directory (not copied)`);await this.mkdir(n,{recursive:!0});let i=await this.readdir(t);for(let o of i){let a=cr(t,o),l=cr(n,o);await this.crossMountCopy(a,l,r)}}else if(s.isSymbolicLink){let i=await this.readlink(t);await this.symlink(i,n)}}async utimes(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.utimes(i,n,r)}};export{Ef as Bash,Yn as InMemoryFs,_a as MountableFs,$n as NetworkAccessDeniedError,Us as RedirectNotAllowedError,Ms as TooManyRedirectsError,XE as defineCommand,KE as getCommandNames,QE as getNetworkCommandNames};
|
|
1497
|
+
/*! Bundled license information:
|
|
1498
|
+
|
|
1499
|
+
re2js/build/index.esm.js:
|
|
1500
|
+
(*!
|
|
1501
|
+
* re2js
|
|
1502
|
+
* RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
|
|
1503
|
+
*
|
|
1504
|
+
* @version v1.4.0
|
|
1505
|
+
* @author Alexey Vasiliev
|
|
1506
|
+
* @homepage https://github.com/le0pard/re2js#readme
|
|
1507
|
+
* @repository github:le0pard/re2js
|
|
1508
|
+
* @license MIT
|
|
1509
|
+
*)
|
|
1510
|
+
|
|
1511
|
+
ieee754/index.js:
|
|
1512
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
1513
|
+
*/
|