openrod 0.0.0 → 0.1.0
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/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +58 -2
- package/SETUPS.md +75 -0
- package/THIRD_PARTY_NOTICES.md +15823 -0
- package/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/assets/index-CEZ0R3YS.js +522 -0
- package/dist/assets/index-DYjVZRjW.css +1 -0
- package/dist/assets/index.esm-BVqeoYDn.js +376 -0
- package/dist/assets/index.esm-CXAOoF3i.js +16 -0
- package/dist/assets/index.esm-D0s8MSqt.js +1666 -0
- package/dist/assets/pixelify-sans-cyrillic-wght-normal-BfQLqnEI.woff2 +0 -0
- package/dist/assets/pixelify-sans-latin-ext-wght-normal-CsF3XSp0.woff2 +0 -0
- package/dist/assets/pixelify-sans-latin-wght-normal-Cbhn5ptY.woff2 +0 -0
- package/dist/assets/terminal-view-6GBZ9nXN.css +32 -0
- package/dist/assets/terminal-view-CkPFNoXi.js +40 -0
- package/dist/favicon.png +0 -0
- package/dist/index.html +16 -0
- package/dist/logos/SOURCES.md +133 -0
- package/dist/logos/agents/aider.svg +1 -0
- package/dist/logos/agents/antigravity.svg +1 -0
- package/dist/logos/agents/claudecode.svg +1 -0
- package/dist/logos/agents/codex.svg +1 -0
- package/dist/logos/agents/copilot.svg +1 -0
- package/dist/logos/agents/cursor.svg +1 -0
- package/dist/logos/agents/factory.svg +1 -0
- package/dist/logos/agents/gemini.svg +1 -0
- package/dist/logos/agents/kiro.svg +1 -0
- package/dist/logos/agents/openclaw-color.svg +1 -0
- package/dist/logos/agents/opencode.svg +1 -0
- package/dist/logos/agents/pi.svg +1 -0
- package/dist/logos/anthropic.svg +1 -0
- package/dist/logos/aws-bedrock.svg +1 -0
- package/dist/logos/aws-s3.svg +1 -0
- package/dist/logos/aws.svg +1 -0
- package/dist/logos/claude-code.svg +1 -0
- package/dist/logos/codex.svg +1 -0
- package/dist/logos/copilot.svg +1 -0
- package/dist/logos/cursor.svg +1 -0
- package/dist/logos/deepinfra.svg +1 -0
- package/dist/logos/github.svg +1 -0
- package/dist/logos/google-cloud.svg +1 -0
- package/dist/logos/google-vertex-ai.svg +1 -0
- package/dist/logos/nvidia.svg +1 -0
- package/dist/logos/openai.svg +1 -0
- package/dist/logos/openrouter.svg +1 -0
- package/dist/logos/pypi.svg +1 -0
- package/dist/logos/templates/debian.svg +1 -0
- package/dist/logos/templates/nodejs.svg +1 -0
- package/dist/logos/templates/python.svg +1 -0
- package/dist/logos/templates/ubuntu.svg +1 -0
- package/dist/logos/vscode.svg +1 -0
- package/dist/openrod.png +0 -0
- package/node_modules/@bufbuild/protobuf/README.md +41 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.d.ts +6 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.js +66 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.js +31 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.js +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.d.ts +140 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.js +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.d.ts +79 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.d.ts +63 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.js +105 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.js +244 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.d.ts +29 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.js +58 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.js +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.js +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.d.ts +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.js +29 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.d.ts +145 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.js +74 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.d.ts +85 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/create.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +296 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.d.ts +634 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.js +53 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.d.ts +46 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.js +209 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.d.ts +60 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.js +168 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.js +45 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.d.ts +48 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +415 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.d.ts +73 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +1037 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/index.js +55 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.js +33 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.d.ts +16 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.js +70 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/package.json +4 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.js +131 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.js +36 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.d.ts +20 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.js +78 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js +41 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.d.ts +49 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.js +157 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.d.ts +30 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.js +115 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.js +110 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.d.ts +107 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.js +376 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.d.ts +45 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +292 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.d.ts +217 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.js +16 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +469 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.js +129 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.js +149 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +954 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.js +437 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.d.ts +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +625 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.js +684 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.d.ts +4 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.js +47 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.js +481 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.d.ts +34 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.js +358 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.d.ts +76 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.js +220 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/types.d.ts +135 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.js +188 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.d.ts +286 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +726 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js +37 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.d.ts +69 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.js +191 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.d.ts +53 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.js +106 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.js +199 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.d.ts +70 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.js +334 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.d.ts +38 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.js +75 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +68 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.js +60 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.js +892 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.js +126 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.js +106 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.js +59 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.js +242 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js +48 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/json.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/json.js +44 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.d.ts +21 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.js +66 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/clone.d.ts +6 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/clone.js +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.d.ts +140 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js +40 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.d.ts +79 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.d.ts +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js +101 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +239 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.d.ts +29 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js +53 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +32 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.d.ts +15 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.d.ts +145 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +71 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.d.ts +85 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/create.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/create.js +293 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts +634 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js +50 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/equals.d.ts +46 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/equals.js +206 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/extensions.d.ts +60 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/extensions.js +159 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/fields.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/fields.js +41 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.d.ts +48 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +409 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts +73 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +1029 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/index.js +29 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/is-message.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/is-message.js +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts +16 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/json-value.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/merge.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/merge.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/package.json +4 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js +128 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js +31 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.d.ts +20 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js +71 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.d.ts +49 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.js +152 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.d.ts +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js +109 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js +105 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts +107 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js +369 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts +45 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +284 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.d.ts +217 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +464 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js +124 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +140 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +948 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +433 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts +67 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +620 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.js +680 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.d.ts +4 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.js +44 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.js +477 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.d.ts +34 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.js +355 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.d.ts +76 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.js +214 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts +135 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +184 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts +286 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +721 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.d.ts +69 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js +186 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts +53 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +101 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts +70 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +325 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.d.ts +38 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +69 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js +36 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +65 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +888 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +123 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +103 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js +56 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js +239 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +64 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +32 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/json.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/json.js +41 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.d.ts +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +50 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +61 -0
- package/node_modules/@bufbuild/protobuf/package.json +147 -0
- package/node_modules/@connectrpc/connect/README.md +62 -0
- package/node_modules/@connectrpc/connect/dist/cjs/any-client.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/cjs/any-client.js +33 -0
- package/node_modules/@connectrpc/connect/dist/cjs/call-options.d.ts +34 -0
- package/node_modules/@connectrpc/connect/dist/cjs/call-options.js +15 -0
- package/node_modules/@connectrpc/connect/dist/cjs/callback-client.d.ts +31 -0
- package/node_modules/@connectrpc/connect/dist/cjs/callback-client.js +116 -0
- package/node_modules/@connectrpc/connect/dist/cjs/code.d.ts +75 -0
- package/node_modules/@connectrpc/connect/dist/cjs/code.js +92 -0
- package/node_modules/@connectrpc/connect/dist/cjs/connect-error.d.ts +104 -0
- package/node_modules/@connectrpc/connect/dist/cjs/connect-error.js +141 -0
- package/node_modules/@connectrpc/connect/dist/cjs/context-values.d.ts +34 -0
- package/node_modules/@connectrpc/connect/dist/cjs/context-values.js +41 -0
- package/node_modules/@connectrpc/connect/dist/cjs/cors.d.ts +45 -0
- package/node_modules/@connectrpc/connect/dist/cjs/cors.js +82 -0
- package/node_modules/@connectrpc/connect/dist/cjs/http-headers.d.ts +37 -0
- package/node_modules/@connectrpc/connect/dist/cjs/http-headers.js +63 -0
- package/node_modules/@connectrpc/connect/dist/cjs/implementation.d.ts +159 -0
- package/node_modules/@connectrpc/connect/dist/cjs/implementation.js +78 -0
- package/node_modules/@connectrpc/connect/dist/cjs/index.d.ts +22 -0
- package/node_modules/@connectrpc/connect/dist/cjs/index.js +46 -0
- package/node_modules/@connectrpc/connect/dist/cjs/interceptor.d.ts +170 -0
- package/node_modules/@connectrpc/connect/dist/cjs/interceptor.js +30 -0
- package/node_modules/@connectrpc/connect/dist/cjs/package.json +1 -0
- package/node_modules/@connectrpc/connect/dist/cjs/promise-client.d.ts +40 -0
- package/node_modules/@connectrpc/connect/dist/cjs/promise-client.js +135 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/async-iterable.d.ts +527 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/async-iterable.js +913 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/compression.d.ts +48 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/compression.js +75 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/content-type-matcher.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/content-type-matcher.js +43 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/create-method-url.d.ts +17 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/create-method-url.js +36 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/envelope.d.ts +90 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/envelope.js +214 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/index.d.ts +25 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/index.js +95 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/invoke-implementation.d.ts +33 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/invoke-implementation.js +178 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/limit-io.d.ts +24 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/limit-io.js +80 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/normalize.d.ts +11 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/normalize.js +55 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/protocol-handler-factory.d.ts +18 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/protocol-handler-factory.js +15 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/protocol-headers.d.ts +9 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/protocol-headers.js +67 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/run-call.d.ts +45 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/run-call.js +125 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/serialization.d.ts +104 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/serialization.js +149 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/signals.d.ts +36 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/signals.js +100 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/transport-options.d.ts +98 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/transport-options.js +15 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal-fetch.d.ts +35 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal-fetch.js +150 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal-handler-client.d.ts +7 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal-handler-client.js +88 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal-handler.d.ts +167 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal-handler.js +130 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal.d.ts +102 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol/universal.js +78 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/code-string.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/code-string.js +52 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/content-type.d.ts +40 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/content-type.js +71 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/end-stream.d.ts +44 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/end-stream.js +137 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/error-json.d.ts +36 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/error-json.js +166 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/get-request.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/get-request.js +66 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/handler-factory.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/handler-factory.js +296 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/headers.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/headers.js +32 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/http-status.d.ts +15 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/http-status.js +90 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/index.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/index.js +81 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/parse-timeout.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/parse-timeout.js +44 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/query-params.d.ts +8 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/query-params.js +24 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/request-header.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/request-header.js +70 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/trailer-mux.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/trailer-mux.js +53 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/transport.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/transport.js +210 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/validate-response.d.ts +30 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/validate-response.js +71 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/version.d.ts +20 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-connect/version.js +58 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/content-type.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/content-type.js +38 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/gen/status_pb.d.ts +91 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/gen/status_pb.js +27 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/handler-factory.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/handler-factory.js +124 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/headers.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/headers.js +29 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/http-status.d.ts +8 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/http-status.js +46 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/index.d.ts +10 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/index.js +61 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/parse-timeout.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/parse-timeout.js +53 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/request-header.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/request-header.js +56 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/trailer-status.d.ts +28 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/trailer-status.js +118 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/transport.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/transport.js +185 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/validate-response.d.ts +33 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/validate-response.js +75 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/validate-trailer.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc/validate-trailer.js +44 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/content-type.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/content-type.js +41 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/handler-factory.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/handler-factory.js +130 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/headers.d.ts +20 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/headers.js +44 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/index.d.ts +8 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/index.js +61 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/request-header.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/request-header.js +59 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/trailer.d.ts +27 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/trailer.js +71 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/transport.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/transport.js +234 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/validate-response.d.ts +34 -0
- package/node_modules/@connectrpc/connect/dist/cjs/protocol-grpc-web/validate-response.js +73 -0
- package/node_modules/@connectrpc/connect/dist/cjs/router-transport.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/cjs/router-transport.js +32 -0
- package/node_modules/@connectrpc/connect/dist/cjs/router.d.ts +81 -0
- package/node_modules/@connectrpc/connect/dist/cjs/router.js +68 -0
- package/node_modules/@connectrpc/connect/dist/cjs/transport.d.ts +20 -0
- package/node_modules/@connectrpc/connect/dist/cjs/transport.js +15 -0
- package/node_modules/@connectrpc/connect/dist/esm/any-client.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/esm/any-client.js +30 -0
- package/node_modules/@connectrpc/connect/dist/esm/call-options.d.ts +34 -0
- package/node_modules/@connectrpc/connect/dist/esm/call-options.js +14 -0
- package/node_modules/@connectrpc/connect/dist/esm/callback-client.d.ts +31 -0
- package/node_modules/@connectrpc/connect/dist/esm/callback-client.js +113 -0
- package/node_modules/@connectrpc/connect/dist/esm/code.d.ts +75 -0
- package/node_modules/@connectrpc/connect/dist/esm/code.js +89 -0
- package/node_modules/@connectrpc/connect/dist/esm/connect-error.d.ts +104 -0
- package/node_modules/@connectrpc/connect/dist/esm/connect-error.js +137 -0
- package/node_modules/@connectrpc/connect/dist/esm/context-values.d.ts +34 -0
- package/node_modules/@connectrpc/connect/dist/esm/context-values.js +37 -0
- package/node_modules/@connectrpc/connect/dist/esm/cors.d.ts +45 -0
- package/node_modules/@connectrpc/connect/dist/esm/cors.js +79 -0
- package/node_modules/@connectrpc/connect/dist/esm/http-headers.d.ts +37 -0
- package/node_modules/@connectrpc/connect/dist/esm/http-headers.js +58 -0
- package/node_modules/@connectrpc/connect/dist/esm/implementation.d.ts +159 -0
- package/node_modules/@connectrpc/connect/dist/esm/implementation.js +73 -0
- package/node_modules/@connectrpc/connect/dist/esm/index.d.ts +22 -0
- package/node_modules/@connectrpc/connect/dist/esm/index.js +27 -0
- package/node_modules/@connectrpc/connect/dist/esm/interceptor.d.ts +170 -0
- package/node_modules/@connectrpc/connect/dist/esm/interceptor.js +27 -0
- package/node_modules/@connectrpc/connect/dist/esm/promise-client.d.ts +40 -0
- package/node_modules/@connectrpc/connect/dist/esm/promise-client.js +128 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/async-iterable.d.ts +527 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/async-iterable.js +891 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/compression.d.ts +48 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/compression.js +71 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/content-type-matcher.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/content-type-matcher.js +40 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/create-method-url.d.ts +17 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/create-method-url.js +33 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/envelope.d.ts +90 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/envelope.js +206 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/index.d.ts +25 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/index.js +33 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/invoke-implementation.d.ts +33 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/invoke-implementation.js +173 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/limit-io.d.ts +24 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/limit-io.js +75 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/normalize.d.ts +11 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/normalize.js +51 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/protocol-handler-factory.d.ts +18 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/protocol-handler-factory.js +14 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/protocol-headers.d.ts +9 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/protocol-headers.js +64 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/run-call.d.ts +45 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/run-call.js +121 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/serialization.d.ts +104 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/serialization.js +141 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/signals.d.ts +36 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/signals.js +95 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/transport-options.d.ts +98 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/transport-options.js +14 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal-fetch.d.ts +35 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal-fetch.js +142 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal-handler-client.d.ts +7 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal-handler-client.js +85 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal-handler.d.ts +167 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal-handler.js +124 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal.d.ts +102 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol/universal.js +74 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/code-string.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/code-string.js +48 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/content-type.d.ts +40 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/content-type.js +66 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/end-stream.d.ts +44 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/end-stream.js +131 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/error-json.d.ts +36 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/error-json.js +160 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/get-request.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/get-request.js +63 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/handler-factory.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/handler-factory.js +293 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/headers.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/headers.js +29 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/http-status.d.ts +15 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/http-status.js +86 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/index.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/index.js +33 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/parse-timeout.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/parse-timeout.js +41 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/query-params.d.ts +8 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/query-params.js +21 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/request-header.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/request-header.js +66 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/trailer-mux.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/trailer-mux.js +49 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/transport.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/transport.js +207 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/validate-response.d.ts +30 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/validate-response.js +67 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/version.d.ts +20 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-connect/version.js +53 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/content-type.d.ts +16 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/content-type.js +34 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/gen/status_pb.d.ts +91 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/gen/status_pb.js +24 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/handler-factory.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/handler-factory.js +121 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/headers.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/headers.js +26 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/http-status.d.ts +8 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/http-status.js +43 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/index.d.ts +10 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/index.js +28 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/parse-timeout.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/parse-timeout.js +50 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/request-header.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/request-header.js +52 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/trailer-status.d.ts +28 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/trailer-status.js +113 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/transport.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/transport.js +182 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/validate-response.d.ts +33 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/validate-response.js +71 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/validate-trailer.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc/validate-trailer.js +41 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/content-type.d.ts +19 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/content-type.js +37 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/handler-factory.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/handler-factory.js +127 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/headers.d.ts +20 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/headers.js +33 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/index.d.ts +8 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/index.js +26 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/request-header.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/request-header.js +55 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/trailer.d.ts +27 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/trailer.js +65 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/transport.d.ts +6 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/transport.js +231 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/validate-response.d.ts +34 -0
- package/node_modules/@connectrpc/connect/dist/esm/protocol-grpc-web/validate-response.js +69 -0
- package/node_modules/@connectrpc/connect/dist/esm/router-transport.d.ts +13 -0
- package/node_modules/@connectrpc/connect/dist/esm/router-transport.js +29 -0
- package/node_modules/@connectrpc/connect/dist/esm/router.d.ts +81 -0
- package/node_modules/@connectrpc/connect/dist/esm/router.js +65 -0
- package/node_modules/@connectrpc/connect/dist/esm/transport.d.ts +20 -0
- package/node_modules/@connectrpc/connect/dist/esm/transport.js +14 -0
- package/node_modules/@connectrpc/connect/package.json +67 -0
- package/node_modules/@connectrpc/connect-node/README.md +144 -0
- package/node_modules/@connectrpc/connect-node/buf.gen.yaml +10 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/compression.d.ts +15 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/compression.js +96 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/connect-node-adapter.d.ts +42 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/connect-node-adapter.js +60 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/connect-transport.d.ts +100 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/connect-transport.js +25 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-transport.d.ts +95 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-transport.js +24 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-web-transport.d.ts +96 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-web-transport.js +25 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/http2-session-manager.d.ts +146 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/http2-session-manager.js +543 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/index.d.ts +14 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/index.js +34 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-error.d.ts +45 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-error.js +153 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-transport-options.d.ts +100 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-transport-options.js +58 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-client.d.ts +54 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-client.js +347 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-handler.d.ts +42 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-handler.js +225 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-header.d.ts +20 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-header.js +117 -0
- package/node_modules/@connectrpc/connect-node/dist/cjs/package.json +1 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/compression.d.ts +15 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/compression.js +93 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/connect-node-adapter.d.ts +42 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/connect-node-adapter.js +57 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/connect-transport.d.ts +100 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/connect-transport.js +22 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/grpc-transport.d.ts +95 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/grpc-transport.js +21 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/grpc-web-transport.d.ts +96 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/grpc-web-transport.js +22 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/http2-session-manager.d.ts +146 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/http2-session-manager.js +539 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/index.d.ts +14 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/index.js +21 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-error.d.ts +45 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-error.js +146 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.d.ts +100 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js +55 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.d.ts +54 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js +344 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-handler.d.ts +42 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-handler.js +221 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-header.d.ts +20 -0
- package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-header.js +113 -0
- package/node_modules/@connectrpc/connect-node/package.json +44 -0
- package/node_modules/@nvidia/openshell-sdk/README.md +303 -0
- package/node_modules/@nvidia/openshell-sdk/dist/client.d.ts +1243 -0
- package/node_modules/@nvidia/openshell-sdk/dist/client.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/client.js +1321 -0
- package/node_modules/@nvidia/openshell-sdk/dist/client.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/errors.d.ts +35 -0
- package/node_modules/@nvidia/openshell-sdk/dist/errors.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/errors.js +79 -0
- package/node_modules/@nvidia/openshell-sdk/dist/errors.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/datamodel_pb.d.ts +301 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/datamodel_pb.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/datamodel_pb.js +69 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/datamodel_pb.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/google/rpc/error_details_pb.d.ts +581 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/google/rpc/error_details_pb.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/google/rpc/error_details_pb.js +90 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/google/rpc/error_details_pb.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/openshell_pb.d.ts +9131 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/openshell_pb.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/openshell_pb.js +1898 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/openshell_pb.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/options_pb.d.ts +58 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/options_pb.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/options_pb.js +24 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/options_pb.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/sandbox_pb.d.ts +1203 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/sandbox_pb.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/sandbox_pb.js +277 -0
- package/node_modules/@nvidia/openshell-sdk/dist/gen/sandbox_pb.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/index.d.ts +7 -0
- package/node_modules/@nvidia/openshell-sdk/dist/index.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/index.js +6 -0
- package/node_modules/@nvidia/openshell-sdk/dist/index.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/oidc.d.ts +14 -0
- package/node_modules/@nvidia/openshell-sdk/dist/oidc.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/oidc.js +177 -0
- package/node_modules/@nvidia/openshell-sdk/dist/oidc.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/raw.d.ts +6 -0
- package/node_modules/@nvidia/openshell-sdk/dist/raw.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/raw.js +15 -0
- package/node_modules/@nvidia/openshell-sdk/dist/raw.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/ssh-validate.d.ts +11 -0
- package/node_modules/@nvidia/openshell-sdk/dist/ssh-validate.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/ssh-validate.js +58 -0
- package/node_modules/@nvidia/openshell-sdk/dist/ssh-validate.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/transport.d.ts +35 -0
- package/node_modules/@nvidia/openshell-sdk/dist/transport.d.ts.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/dist/transport.js +97 -0
- package/node_modules/@nvidia/openshell-sdk/dist/transport.js.map +1 -0
- package/node_modules/@nvidia/openshell-sdk/package.json +58 -0
- package/package.json +93 -4
- package/server/activity-delivery.js +143 -0
- package/server/activity-store.js +168 -0
- package/server/agent-inventory.js +76 -0
- package/server/agent-resources.py +60 -0
- package/server/api.js +648 -0
- package/server/cli.js +168 -0
- package/server/cloud-connections.js +56 -0
- package/server/cloud-origin.js +11 -0
- package/server/cloud-proxy.js +122 -0
- package/server/cloud-ssh-proxy.cjs +73 -0
- package/server/cloud-ssh.js +135 -0
- package/server/cloud-transfer.js +221 -0
- package/server/compute.js +50 -0
- package/server/editor.js +114 -0
- package/server/egress.js +204 -0
- package/server/files.js +489 -0
- package/server/gateway-install.js +64 -0
- package/server/gateway.js +415 -0
- package/server/image-templates.js +393 -0
- package/server/ingress.js +185 -0
- package/server/launch-token.js +55 -0
- package/server/local-catalog.js +111 -0
- package/server/local-cloud-native.js +152 -0
- package/server/local-cloud.js +123 -0
- package/server/location-inventory.js +94 -0
- package/server/machines.js +84 -0
- package/server/openshell-cli.js +144 -0
- package/server/org.js +536 -0
- package/server/orphan-processes.js +42 -0
- package/server/paths.js +28 -0
- package/server/policy-template-store.js +92 -0
- package/server/policy.js +583 -0
- package/server/remote-gateway-state.js +123 -0
- package/server/remote-gateway.js +420 -0
- package/server/remote-hosts.js +354 -0
- package/server/remote-http.js +14 -0
- package/server/remote-image-engine.js +47 -0
- package/server/remote-runtime.js +65 -0
- package/server/remote-runtime.py +162 -0
- package/server/sandbox-identity.js +14 -0
- package/server/security.js +139 -0
- package/server/session-revocations.js +20 -0
- package/server/setup-artifact-installer.py +54 -0
- package/server/setup-artifacts.js +23 -0
- package/server/setup-auth-discovery.js +24 -0
- package/server/setup-credentials.js +54 -0
- package/server/setup-deployment.js +299 -0
- package/server/setup-discovery.js +289 -0
- package/server/setup-egress.js +133 -0
- package/server/setup-http.js +47 -0
- package/server/setup-installer.py +289 -0
- package/server/setup-json.py +8 -0
- package/server/setup-members.js +77 -0
- package/server/setup-packages.js +214 -0
- package/server/setup-preparation.js +144 -0
- package/server/setup-python.js +8 -0
- package/server/setup-remote-check.js +35 -0
- package/server/setup-transfer.js +17 -0
- package/server/setup-verifier.cjs +43 -0
- package/server/setups.js +172 -0
- package/server/ssh-hosts.js +184 -0
- package/server/ssh.js +153 -0
- package/server/start.js +71 -0
- package/server/terminal.js +173 -0
- package/server/worker-auth.js +18 -0
- package/shared/agent-access.js +103 -0
- package/shared/antigravity-network-guidance.js +9 -0
- package/shared/group-membership.js +33 -0
- package/shared/group-network.js +29 -0
- package/shared/policy-templates.js +79 -0
- package/shared/secret-fields.js +35 -0
- package/shared/setup-launch.js +25 -0
- package/shared/setup-targets.js +11 -0
- package/shared/setup-targets.json +12 -0
- package/src/lib/activity-export.js +52 -0
- package/src/lib/activity-inventory.js +45 -0
- package/src/lib/agents.js +41 -0
- package/src/lib/api.js +173 -0
- package/src/lib/cloud-machine.js +9 -0
- package/src/lib/cloud-origin.js +6 -0
- package/src/lib/cloud-transfer.js +22 -0
- package/src/lib/compute-target.js +46 -0
- package/src/lib/delete-network-policies.js +15 -0
- package/src/lib/egress-groups.js +24 -0
- package/src/lib/egress.js +28 -0
- package/src/lib/files.js +24 -0
- package/src/lib/fleet.js +100 -0
- package/src/lib/format.js +24 -0
- package/src/lib/groups.js +16 -0
- package/src/lib/image-templates.js +139 -0
- package/src/lib/import-setup.js +36 -0
- package/src/lib/local-cloud.js +118 -0
- package/src/lib/location-inventory.js +20 -0
- package/src/lib/locations.js +5 -0
- package/src/lib/placement.js +9 -0
- package/src/lib/policy-editor.js +58 -0
- package/src/lib/policy-sources.js +33 -0
- package/src/lib/quick-setup.js +110 -0
- package/src/lib/sandbox-creations.js +59 -0
- package/src/lib/sandbox-images.js +38 -0
- package/src/lib/sandbox-session.js +140 -0
- package/src/lib/sandboxes.js +78 -0
- package/src/lib/secret-inventory.js +26 -0
- package/src/lib/services.js +41 -0
- package/src/lib/setup-import-jobs.js +62 -0
- package/src/lib/setup-imports.js +4 -0
- package/src/lib/setup-network.js +39 -0
- package/src/lib/setup-template-build.js +17 -0
- package/src/lib/utils.js +6 -0
- package/vendor/OPENSHELL-LICENSE +203 -0
- package/vendor/nvidia-openshell-sdk-0.0.0.tgz +0 -0
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.esm-CXAOoF3i.js","assets/index.esm-BVqeoYDn.js","assets/index.esm-D0s8MSqt.js","assets/terminal-view-CkPFNoXi.js","assets/terminal-view-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var zz=Object.defineProperty;var Pz=(e,t,r)=>t in e?zz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var tn=(e,t,r)=>Pz(e,typeof t!="symbol"?t+"":t,r);function Iz(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const c=Object.getOwnPropertyDescriptor(a,l);c&&Object.defineProperty(e,l,c.get?c:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=r(l);fetch(l.href,c)}})();function fR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var y0={exports:{}},pd={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var qN;function _z(){if(qN)return pd;qN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var f in l)f!=="key"&&(c[f]=l[f])}else c=l;return l=c.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:c}}return pd.Fragment=t,pd.jsx=r,pd.jsxs=r,pd}var YN;function Lz(){return YN||(YN=1,y0.exports=_z()),y0.exports}var s=Lz(),v0={exports:{}},At={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var KN;function Bz(){if(KN)return At;KN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),v=Symbol.iterator;function j(I){return I===null||typeof I!="object"?null:(I=v&&I[v]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,C={};function E(I,$,Q){this.props=I,this.context=$,this.refs=C,this.updater=Q||S}E.prototype.isReactComponent={},E.prototype.setState=function(I,$){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,$,"setState")},E.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=E.prototype;function O(I,$,Q){this.props=I,this.context=$,this.refs=C,this.updater=Q||S}var k=O.prototype=new T;k.constructor=O,N(k,E.prototype),k.isPureReactComponent=!0;var M=Array.isArray;function A(){}var R={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function _(I,$,Q){var G=Q.ref;return{$$typeof:e,type:I,key:$,ref:G!==void 0?G:null,props:Q}}function L(I,$){return _(I.type,$,I.props)}function Y(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function P(I){var $={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Q){return $[Q]})}var V=/\/+/g;function U(I,$){return typeof I=="object"&&I!==null&&I.key!=null?P(""+I.key):$.toString(36)}function H(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function($){I.status==="pending"&&(I.status="fulfilled",I.value=$)},function($){I.status==="pending"&&(I.status="rejected",I.reason=$)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function F(I,$,Q,G,se){var ee=typeof I;(ee==="undefined"||ee==="boolean")&&(I=null);var ne=!1;if(I===null)ne=!0;else switch(ee){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(I.$$typeof){case e:case t:ne=!0;break;case x:return ne=I._init,F(ne(I._payload),$,Q,G,se)}}if(ne)return se=se(I),ne=G===""?"."+U(I,0):G,M(se)?(Q="",ne!=null&&(Q=ne.replace(V,"$&/")+"/"),F(se,$,Q,"",function(Z){return Z})):se!=null&&(Y(se)&&(se=L(se,Q+(se.key==null||I&&I.key===se.key?"":(""+se.key).replace(V,"$&/")+"/")+ne)),$.push(se)),1;ne=0;var ie=G===""?".":G+":";if(M(I))for(var oe=0;oe<I.length;oe++)G=I[oe],ee=ie+U(G,oe),ne+=F(G,$,Q,ee,se);else if(oe=j(I),typeof oe=="function")for(I=oe.call(I),oe=0;!(G=I.next()).done;)G=G.value,ee=ie+U(G,oe++),ne+=F(G,$,Q,ee,se);else if(ee==="object"){if(typeof I.then=="function")return F(H(I),$,Q,G,se);throw $=String(I),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ne}function q(I,$,Q){if(I==null)return I;var G=[],se=0;return F(I,G,"","",function(ee){return $.call(Q,ee,se++)}),G}function W(I){if(I._status===-1){var $=I._result,Q=$();Q.then(function(G){(I._status===0||I._status===-1)&&(I._status=1,I._result=G,Q.status===void 0&&(Q.status="fulfilled",Q.value=G))},function(G){(I._status===0||I._status===-1)&&(I._status=2,I._result=G,Q.status===void 0&&(Q.status="rejected",Q.reason=G))}),I._status===-1&&(I._status=0,I._result=Q)}if(I._status===1)return I._result.default;throw I._result}var B=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function J(I){var $=R.T,Q={};Q.types=$!==null?$.types:null,R.T=Q;try{var G=I(),se=R.S;se!==null&&se(Q,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(A,B)}catch(ee){B(ee)}finally{$!==null&&Q.types!==null&&($.types=Q.types),R.T=$}}function X(I){var $=R.T;if($!==null){var Q=$.types;Q===null?$.types=[I]:Q.indexOf(I)===-1&&Q.push(I)}else J(X.bind(null,I))}var re={map:q,forEach:function(I,$,Q){q(I,function(){$.apply(this,arguments)},Q)},count:function(I){var $=0;return q(I,function(){$++}),$},toArray:function(I){return q(I,function($){return $})||[]},only:function(I){if(!Y(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return At.Activity=p,At.Children=re,At.Component=E,At.Fragment=r,At.Profiler=l,At.PureComponent=O,At.StrictMode=a,At.Suspense=h,At.ViewTransition=b,At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,At.__COMPILER_RUNTIME={__proto__:null,c:function(I){return R.H.useMemoCache(I)}},At.addTransitionType=X,At.cache=function(I){return function(){return I.apply(null,arguments)}},At.cacheSignal=function(){return null},At.cloneElement=function(I,$,Q){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var G=N({},I.props),se=I.key;if($!=null)for(ee in $.key!==void 0&&(se=""+$.key),$)!z.call($,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&$.ref===void 0||(G[ee]=$[ee]);var ee=arguments.length-2;if(ee===1)G.children=Q;else if(1<ee){for(var ne=Array(ee),ie=0;ie<ee;ie++)ne[ie]=arguments[ie+2];G.children=ne}return _(I.type,se,G)},At.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},At.createElement=function(I,$,Q){var G,se={},ee=null;if($!=null)for(G in $.key!==void 0&&(ee=""+$.key),$)z.call($,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(se[G]=$[G]);var ne=arguments.length-2;if(ne===1)se.children=Q;else if(1<ne){for(var ie=Array(ne),oe=0;oe<ne;oe++)ie[oe]=arguments[oe+2];se.children=ie}if(I&&I.defaultProps)for(G in ne=I.defaultProps,ne)se[G]===void 0&&(se[G]=ne[G]);return _(I,ee,se)},At.createRef=function(){return{current:null}},At.forwardRef=function(I){return{$$typeof:f,render:I}},At.isValidElement=Y,At.lazy=function(I){return{$$typeof:x,_payload:{_status:-1,_result:I},_init:W}},At.memo=function(I,$){return{$$typeof:m,type:I,compare:$===void 0?null:$}},At.startTransition=J,At.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},At.use=function(I){return R.H.use(I)},At.useActionState=function(I,$,Q){return R.H.useActionState(I,$,Q)},At.useCallback=function(I,$){return R.H.useCallback(I,$)},At.useContext=function(I){return R.H.useContext(I)},At.useDebugValue=function(){},At.useDeferredValue=function(I,$){return R.H.useDeferredValue(I,$)},At.useEffect=function(I,$){return R.H.useEffect(I,$)},At.useEffectEvent=function(I){return R.H.useEffectEvent(I)},At.useId=function(){return R.H.useId()},At.useImperativeHandle=function(I,$,Q){return R.H.useImperativeHandle(I,$,Q)},At.useInsertionEffect=function(I,$){return R.H.useInsertionEffect(I,$)},At.useLayoutEffect=function(I,$){return R.H.useLayoutEffect(I,$)},At.useMemo=function(I,$){return R.H.useMemo(I,$)},At.useOptimistic=function(I,$){return R.H.useOptimistic(I,$)},At.useReducer=function(I,$,Q){return R.H.useReducer(I,$,Q)},At.useRef=function(I){return R.H.useRef(I)},At.useState=function(I){return R.H.useState(I)},At.useSyncExternalStore=function(I,$,Q){return R.H.useSyncExternalStore(I,$,Q)},At.useTransition=function(){return R.H.useTransition()},At.version="19.3.0",At}var XN;function tf(){return XN||(XN=1,v0.exports=Bz()),v0.exports}var g=tf();const Qe=fR(g),$z=Iz({__proto__:null,default:Qe},[g]);var Vz=(e,t,r,a,l,c,u,f)=>{let h=document.documentElement,m=["light","dark"];function x(v){(Array.isArray(e)?e:[e]).forEach(j=>{let S=j==="class",N=S&&c?l.map(C=>c[C]||C):l;S?(h.classList.remove(...N),h.classList.add(c&&c[v]?c[v]:v)):h.setAttribute(j,v)}),p(v)}function p(v){f&&m.includes(v)&&(h.style.colorScheme=v)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(a)x(a);else try{let v=localStorage.getItem(t)||r,j=u&&v==="system"?b():v;x(j)}catch{}},WN=["light","dark"],mR="(prefers-color-scheme: dark)",Uz=typeof window>"u",Vv=g.createContext(void 0),Hz={setTheme:e=>{},themes:[]},hR=()=>{var e;return(e=g.useContext(Vv))!=null?e:Hz},Fz=e=>g.useContext(Vv)?g.createElement(g.Fragment,null,e.children):g.createElement(qz,{...e}),Gz=["light","dark"],qz=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:c=Gz,defaultTheme:u=r?"system":"light",attribute:f="data-theme",value:h,children:m,nonce:x,scriptProps:p})=>{let[b,v]=g.useState(()=>Kz(l,u)),[j,S]=g.useState(()=>b==="system"?w0():b),N=h?Object.values(h):c,C=g.useCallback(k=>{let M=k;if(!M)return;k==="system"&&r&&(M=w0());let A=h?h[M]:M,R=t?Xz(x):null,z=document.documentElement,_=L=>{L==="class"?(z.classList.remove(...N),A&&z.classList.add(A)):L.startsWith("data-")&&(A?z.setAttribute(L,A):z.removeAttribute(L))};if(Array.isArray(f)?f.forEach(_):_(f),a){let L=WN.includes(u)?u:null,Y=WN.includes(M)?M:L;z.style.colorScheme=Y}R==null||R()},[x]),E=g.useCallback(k=>{let M=typeof k=="function"?k(b):k;v(M);try{localStorage.setItem(l,M)}catch{}},[b]),T=g.useCallback(k=>{let M=w0(k);S(M),b==="system"&&r&&!e&&C("system")},[b,e]);g.useEffect(()=>{let k=window.matchMedia(mR);return k.addListener(T),T(k),()=>k.removeListener(T)},[T]),g.useEffect(()=>{let k=M=>{M.key===l&&(M.newValue?v(M.newValue):E(u))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[E]),g.useEffect(()=>{C(e??b)},[e,b]);let O=g.useMemo(()=>({theme:b,setTheme:E,forcedTheme:e,resolvedTheme:b==="system"?j:b,themes:r?[...c,"system"]:c,systemTheme:r?j:void 0}),[b,E,e,j,r,c]);return g.createElement(Vv.Provider,{value:O},g.createElement(Yz,{forcedTheme:e,storageKey:l,attribute:f,enableSystem:r,enableColorScheme:a,defaultTheme:u,value:h,themes:c,nonce:x,scriptProps:p}),m)},Yz=g.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:a,enableColorScheme:l,defaultTheme:c,value:u,themes:f,nonce:h,scriptProps:m})=>{let x=JSON.stringify([r,t,c,e,f,u,a,l]).slice(1,-1);return g.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${Vz.toString()})(${x})`}})}),Kz=(e,t)=>{if(Uz)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},Xz=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},w0=e=>(e||(e=window.matchMedia(mR)),e.matches?"dark":"light"),j0={exports:{}},gd={},S0={exports:{}},N0={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var QN;function Wz(){return QN||(QN=1,(function(e){function t(H,F){var q=H.length;H.push(F);e:for(;0<q;){var W=q-1>>>1,B=H[W];if(0<l(B,F))H[W]=F,H[q]=B,q=W;else break e}}function r(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var F=H[0],q=H.pop();if(q!==F){H[0]=q;e:for(var W=0,B=H.length,J=B>>>1;W<J;){var X=2*(W+1)-1,re=H[X],I=X+1,$=H[I];if(0>l(re,q))I<B&&0>l($,re)?(H[W]=$,H[I]=q,W=I):(H[W]=re,H[X]=q,W=X);else if(I<B&&0>l($,q))H[W]=$,H[I]=q,W=I;else break e}}return F}function l(H,F){var q=H.sortIndex-F.sortIndex;return q!==0?q:H.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],m=[],x=1,p=null,b=3,v=!1,j=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(H){for(var F=r(m);F!==null;){if(F.callback===null)a(m);else if(F.startTime<=H)a(m),F.sortIndex=F.expirationTime,t(h,F);else break;F=r(m)}}function k(H){if(S=!1,O(H),!j)if(r(h)!==null)j=!0,M||(M=!0,Y());else{var F=r(m);F!==null&&U(k,F.startTime-H)}}var M=!1,A=-1,R=5,z=-1;function _(){return N?!0:!(e.unstable_now()-z<R)}function L(){if(N=!1,M){var H=e.unstable_now();z=H;var F=!0;try{e:{j=!1,S&&(S=!1,E(A),A=-1),v=!0;var q=b;try{t:{for(O(H),p=r(h);p!==null&&!(p.expirationTime>H&&_());){var W=p.callback;if(typeof W=="function"){p.callback=null,b=p.priorityLevel;var B=W(p.expirationTime<=H);if(H=e.unstable_now(),typeof B=="function"){p.callback=B,O(H),F=!0;break t}p===r(h)&&a(h),O(H)}else a(h);p=r(h)}if(p!==null)F=!0;else{var J=r(m);J!==null&&U(k,J.startTime-H),F=!1}}break e}finally{p=null,b=q,v=!1}F=void 0}}finally{F?Y():M=!1}}}var Y;if(typeof T=="function")Y=function(){T(L)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,V=P.port2;P.port1.onmessage=L,Y=function(){V.postMessage(null)}}else Y=function(){C(L,0)};function U(H,F){A=C(function(){H(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var F=3;break;default:F=b}var q=b;b=F;try{return H()}finally{b=q}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(H,F){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=b;b=H;try{return F()}finally{b=q}},e.unstable_scheduleCallback=function(H,F,q){var W=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?W+q:W):q=W,H){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=q+B,H={id:x++,callback:F,priorityLevel:H,startTime:q,expirationTime:B,sortIndex:-1},q>W?(H.sortIndex=q,t(m,H),r(h)===null&&H===r(m)&&(S?(E(A),A=-1):S=!0,U(k,q-W))):(H.sortIndex=B,t(h,H),j||v||(j=!0,M||(M=!0,Y()))),H},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(H){var F=b;return function(){var q=b;b=F;try{return H.apply(this,arguments)}finally{b=q}}}})(N0)),N0}var ZN;function Qz(){return ZN||(ZN=1,S0.exports=Wz()),S0.exports}var C0={exports:{}},Ms={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var JN;function Zz(){if(JN)return Ms;JN=1;var e=tf();function t(x){var p="https://react.dev/errors/"+x;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+x+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function f(x,p,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:v===u?u:""+v,children:x,containerInfo:p,implementation:b}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(x,p){if(x==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ms.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ms.browser=function(x){return{$$typeof:c,_reason:x}},Ms.createPortal=function(x,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return f(x,p,null,b)},Ms.flushSync=function(x){var p=h.T,b=a.p;try{if(h.T=null,a.p=2,x)return x()}finally{h.T=p,a.p=b,a.d.f()}},Ms.preconnect=function(x,p){typeof x=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(x,p))},Ms.prefetchDNS=function(x){typeof x=="string"&&a.d.D(x)},Ms.preinit=function(x,p){if(typeof x=="string"&&p&&typeof p.as=="string"){var b=p.as,v=m(b,p.crossOrigin),j=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?a.d.S(x,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:j,fetchPriority:S}):b==="script"&&a.d.X(x,{crossOrigin:v,integrity:j,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ms.preinitModule=function(x,p){if(typeof x=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=m(p.as,p.crossOrigin);a.d.M(x,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&a.d.M(x)},Ms.preload=function(x,p){if(typeof x=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,v=m(b,p.crossOrigin);a.d.L(x,b,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ms.preloadModule=function(x,p){if(typeof x=="string")if(p){var b=m(p.as,p.crossOrigin);a.d.m(x,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else a.d.m(x)},Ms.requestFormReset=function(x){a.d.r(x)},Ms.unstable_batchedUpdates=function(x,p){return x(p)},Ms.useFormState=function(x,p,b){return h.H.useFormState(x,p,b)},Ms.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ms.version="19.3.0",Ms}var eC;function pR(){if(eC)return C0.exports;eC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),C0.exports=Zz(),C0.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var tC;function Jz(){if(tC)return gd;tC=1;var e=Qz(),t=tf(),r=pR();function a(n){var o="https://react.dev/errors/"+n;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)o+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){for(var o=n,i=o;i&&!i.alternate;)o=i,(o.flags&4098)!==0&&(n=o.return),i=o.return;for(;o.return;)o=o.return;return o.tag===3?n:null}function u(n){if(n.tag===13){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function f(n){if(n.tag===31){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(a(188))}function m(n){var o=n.alternate;if(!o){if(o=c(n),o===null)throw Error(a(188));return o!==n?null:n}for(var i=n,d=o;;){var y=i.return;if(y===null)break;var w=y.alternate;if(w===null){if(d=y.return,d!==null){i=d;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===i)return h(y),n;if(w===d)return h(y),o;w=w.sibling}throw Error(a(188))}if(i.return!==d.return)i=y,d=w;else{for(var D=!1,K=y.child;K;){if(K===i){D=!0,i=y,d=w;break}if(K===d){D=!0,d=y,i=w;break}K=K.sibling}if(!D){for(K=w.child;K;){if(K===i){D=!0,i=w,d=y;break}if(K===d){D=!0,d=w,i=y;break}K=K.sibling}if(!D)throw Error(a(189))}}if(i.alternate!==d)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?n:o}function x(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n;for(n=n.child;n!==null;){if(o=x(n),o!==null)return o;n=n.sibling}return null}function p(n,o,i,d,y,w){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&i(n,d,y,w)||(n.tag!==22||n.memoizedState===null)&&(o||n.tag!==5&&n.tag!==27)&&p(n.child,o,i,d,y,w))return!0;n=n.sibling}return!1}function b(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function v(n){var o=!1;for(n=n.return;n!==null&&(n.tag===4&&(o=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return o}function j(n){var o=[null,null],i=b(n);return i===null||S(o,n,i.child,{foundSelf:!1}),o}function S(n,o,i,d){for(;i!==null;){if(i===o)d.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(d.foundSelf)return n[1]=i,!0;n[0]=i}else if((i.tag!==22||i.memoizedState===null)&&S(n,o,i.child,d))return!0;i=i.sibling}return!1}function N(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(a(559))}}var C=null,E=null;function T(n,o,i){return n===i?!0:n===o?(C=n,!0):!1}function O(n,o,i){return n===i?(E=n,!1):n===o?(E!==null&&(C=n),!0):!1}function k(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function M(n,o,i){for(var d=0,y=n;y;y=i(y))d++;y=0;for(var w=o;w;w=i(w))y++;for(;0<d-y;)n=i(n),d--;for(;0<y-d;)o=i(o),y--;for(;d--;){if(n===o||o!==null&&n===o.alternate)return n;n=i(n),o=i(o)}return null}var A=Object.assign,R=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),U=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),X=Symbol.for("react.legacy_hidden"),re=Symbol.for("react.memo_cache_sentinel"),I=Symbol.for("react.view_transition"),$=Symbol.for("react.recoverable"),Q=Symbol.iterator;function G(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var se=Symbol.for("react.client.reference");function ee(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===se?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case L:return"Fragment";case P:return"Profiler";case Y:return"StrictMode";case F:return"Suspense";case q:return"SuspenseList";case J:return"Activity";case I:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case _:return"Portal";case U:return n.displayName||"Context";case V:return(n._context.displayName||"Context")+".Consumer";case H:var o=n.render;return n=n.displayName,n||(n=o.displayName||o.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case W:return o=n.displayName||null,o!==null?o:ee(n.type)||"Memo";case B:o=n._payload,n=n._init;try{return ee(n(o))}catch{}}return null}var ne=Array.isArray,ie=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},de=[],ke=-1;function _e(n){return{current:n}}function je(n){0>ke||(n.current=de[ke],de[ke]=null,ke--)}function Ae(n,o){ke++,de[ke]=n.current,n.current=o}var te=_e(null),Ee=_e(null),Te=_e(null),be=_e(null);function We(n,o){switch(Ae(Te,o),Ae(Ee,n),Ae(te,null),o.nodeType){case 9:case 11:n=(n=o.documentElement)&&(n=n.namespaceURI)?tN(n):0;break;default:if(n=o.tagName,o=o.namespaceURI)o=tN(o),n=nN(o,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}je(te),Ae(te,n)}function Se(){je(te),je(Ee),je(Te)}function Fe(n){var o=n.memoizedState;o!==null&&(Pc._currentValue=o.memoizedState,Ae(be,n)),o=te.current;var i=nN(o,n.type);o!==i&&(Ae(Ee,n),Ae(te,i))}function Re(n){Ee.current===n&&(je(te),je(Ee)),be.current===n&&(je(be),Pc._currentValue=Z)}var ve,pe;function $e(n){if(ve===void 0)try{throw Error()}catch(i){var o=i.stack.trim().match(/\n( *(at )?)/);ve=o&&o[1]||"",pe=-1<i.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+ve+n+pe}var Je=!1;function mt(n,o){if(!n||Je)return"";Je=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(o){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(et){var he=et}Reflect.construct(n,[],ze)}else{try{ze.call()}catch(et){he=et}ze=!1;try{var we=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ze=!0,new n}finally{ze&&(we!==void 0?Object.defineProperty(n.prototype,"props",we):delete n.prototype.props)}}}else{try{throw Error()}catch(et){he=et}(ze=n())&&typeof ze.catch=="function"&&ze.catch(function(){})}}catch(et){if(et&&he&&typeof et.stack=="string")return[et.stack,he.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=d.DetermineComponentFrameRoot(),D=w[0],K=w[1];if(D&&K){var le=D.split(`
|
|
45
|
+
`),xe=K.split(`
|
|
46
|
+
`);for(y=d=0;d<le.length&&!le[d].includes("DetermineComponentFrameRoot");)d++;for(;y<xe.length&&!xe[y].includes("DetermineComponentFrameRoot");)y++;if(d===le.length||y===xe.length)for(d=le.length-1,y=xe.length-1;1<=d&&0<=y&&le[d]!==xe[y];)y--;for(;1<=d&&0<=y;d--,y--)if(le[d]!==xe[y]){if(d!==1||y!==1)do if(d--,y--,0>y||le[d]!==xe[y]){var Ce=`
|
|
47
|
+
`+le[d].replace(" at new "," at ");return n.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",n.displayName)),Ce}while(1<=d&&0<=y);break}}}finally{Je=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?$e(i):""}function ot(n,o){switch(n.tag){case 26:case 27:case 5:return $e(n.type);case 16:return $e("Lazy");case 13:return n.child!==o&&o!==null?$e("Suspense Fallback"):$e("Suspense");case 19:return $e("SuspenseList");case 0:case 15:return mt(n.type,!1);case 11:return mt(n.type.render,!1);case 1:return mt(n.type,!0);case 31:return $e("Activity");case 30:return $e("ViewTransition");default:return""}}function Ie(n){try{var o="",i=null;do o+=ot(n,i),i=n,n=n.return;while(n);return o}catch(d){return`
|
|
48
|
+
Error generating stack: `+d.message+`
|
|
49
|
+
`+d.stack}}var at=Object.prototype.hasOwnProperty,Xe=e.unstable_scheduleCallback,me=e.unstable_cancelCallback,Me=e.unstable_shouldYield,Oe=e.unstable_requestPaint,tt=e.unstable_now,Ue=e.unstable_getCurrentPriorityLevel,Ge=e.unstable_ImmediatePriority,ht=e.unstable_UserBlockingPriority,yt=e.unstable_NormalPriority,ue=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,Pe=e.log,st=e.unstable_setDisableYieldValue,vt=null,wt=null;function Ht(n){if(typeof Pe=="function"&&st(n),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(vt,n)}catch{}}var kt=Math.clz32?Math.clz32:ae,ct=Math.log,jt=Math.LN2;function ae(n){return n>>>=0,n===0?32:31-(ct(n)/jt|0)|0}var Ke=256,ut=262144,Jt=4194304;function Rn(n){var o=n&42;if(o!==0)return o;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&-n;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Et(n,o,i){var d=n.pendingLanes;if(d===0)return 0;var y=0,w=n.suspendedLanes,D=n.pingedLanes;n=n.warmLanes;var K=d&134217727;return K!==0?(d=K&~w,d!==0?y=Rn(d):(D&=K,D!==0?y=Rn(D):i||(i=K&~n,i!==0&&(y=Rn(i))))):(K=d&~w,K!==0?y=Rn(K):D!==0?y=Rn(D):i||(i=d&~n,i!==0&&(y=Rn(i)))),y===0?0:o!==0&&o!==y&&(o&w)===0&&(w=y&-y,i=o&-o,w>=i||w===32&&(i&4194048)!==0)?o:y}function Pt(n,o){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&o)===0}function Ln(n,o){(o&8)!==0&&(o|=o&32);var i=n.entangledLanes;if(i!==0)for(n=n.entanglements,i&=o;0<i;){var d=31-kt(i),y=1<<d;o|=n[d],i&=~y}return o}function Eo(n,o){switch(n){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ps(){var n=Jt;return Jt<<=1,(Jt&62914560)===0&&(Jt=4194304),n}function ao(n){for(var o=[],i=0;31>i;i++)o.push(n);return o}function Ks(n,o){n.pendingLanes|=o,o!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Ro(n,o,i,d,y,w){var D=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var K=n.entanglements,le=n.expirationTimes,xe=n.hiddenUpdates;for(i=D&~i;0<i;){var Ce=31-kt(i),ze=1<<Ce;K[Ce]=0,le[Ce]=-1;var he=xe[Ce];if(he!==null)for(xe[Ce]=null,Ce=0;Ce<he.length;Ce++){var we=he[Ce];we!==null&&(we.lane&=-536870913)}i&=~ze}d!==0&&Ls(n,d,0),w!==0&&y===0&&n.tag!==0&&(n.suspendedLanes|=w&~(D&~o))}function Ls(n,o,i){n.pendingLanes|=o,n.suspendedLanes&=~o;var d=31-kt(o);n.entangledLanes|=o,n.entanglements[d]=n.entanglements[d]|1073741824|i&261930}function cr(n,o){var i=n.entangledLanes|=o;for(n=n.entanglements;i;){var d=31-kt(i),y=1<<d;y&o|n[d]&o&&(n[d]|=o),i&=~y}}function Ss(n,o){var i=o&-o;return i=(i&42)!==0?1:Rr(i),(i&(n.suspendedLanes|o))!==0?0:i}function Rr(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Ar(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Or(){var n=oe.p;return n!==0?n:(n=window.event,n===void 0?32:BN(n.type))}function Fi(n,o){var i=oe.p;try{return oe.p=n,o()}finally{oe.p=i}}var Hn=Math.random().toString(36).slice(2),Mn="__reactFiber$"+Hn,Ns="__reactProps$"+Hn,ur="__reactContainer$"+Hn,Su="__reactEvents$"+Hn,Xl="__reactListeners$"+Hn,Wl="__reactHandles$"+Hn,Ya="__reactResources$"+Hn,Gi="__reactMarker$"+Hn,Ql="__reactLoad$"+Hn;function Zl(n){delete n[Mn],delete n[Ns],delete n[Xl],delete n[Wl]}function io(n){var o;if(o=n[Mn])return o;for(var i=n.parentNode;i;){if(o=i[ur]||i[Mn]){if(i=o.alternate,o.child!==null||i!==null&&i.child!==null)for(n=yN(n);n!==null;){if(i=n[Mn])return i;n=yN(n)}return o}n=i,i=n.parentNode}return null}function qi(n){if(n=n[Mn]||n[ur]){var o=n.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return n}return null}function Ne(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n.stateNode;throw Error(a(33))}function Be(n){var o=n[Ya];return o||(o=n[Ya]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Ve(n){n[Gi]=!0}function gt(n){n[Ql]=void 0}var Mt=new Set,Rt={};function Bt(n,o){fn(n,o),fn(n+"Capture",o)}function fn(n,o){for(Rt[n]=o,n=0;n<o.length;n++)Mt.add(o[n])}var sn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ct={},Dt={};function en(n){return at.call(Dt,n)?!0:at.call(Ct,n)?!1:sn.test(n)?Dt[n]=!0:(Ct[n]=!0,!1)}var St=!1;function ts(){var n=St;return St=!1,n}function Dn(n,o,i){if(en(o))if(i===null)n.removeAttribute(o);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(o);return;case"boolean":var d=o.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(o);return}}n.setAttribute(o,i)}}function dr(n,o,i){if(i===null)n.removeAttribute(o);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttribute(o,i)}}function Kn(n,o,i,d){if(d===null)n.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(o,i,d)}}function Xn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Jl(n){var o=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Nu(n,o,i){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,o);if(!n.hasOwnProperty(o)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,w=d.set;return Object.defineProperty(n,o,{configurable:!0,get:function(){return y.call(this)},set:function(D){i=""+D,w.call(this,D)}}),Object.defineProperty(n,o,{enumerable:d.enumerable}),{getValue:function(){return i},setValue:function(D){i=""+D},stopTracking:function(){n._valueTracker=null,delete n[o]}}}}function oa(n){if(!n._valueTracker){var o=Jl(n)?"checked":"value";n._valueTracker=Nu(n,o,""+n[o])}}function ec(n){if(!n)return!1;var o=n._valueTracker;if(!o)return!0;var i=o.getValue(),d="";return n&&(d=Jl(n)?n.checked?"true":"false":n.value),n=d,n!==i?(o.setValue(n),!0):!1}var If=/[\n"\\]/g;function kn(n){return n.replace(If,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Ps(n,o,i,d,y,w,D,K){n.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?n.type=D:n.removeAttribute("type"),o!=null?D==="number"?(o===0&&n.value===""||n.value!=o)&&(n.value=""+Xn(o)):n.value!==""+Xn(o)&&(n.value=""+Xn(o)):D!=="submit"&&D!=="reset"||n.removeAttribute("value"),o!=null?D==="number"&&n.value==o?tc(n,Xn(n.value)):tc(n,Xn(o)):i!=null?tc(n,Xn(i)):d!=null&&n.removeAttribute("value"),y==null&&w!=null&&(n.defaultChecked=!!w),y!=null&&(n.checked=y&&typeof y!="function"&&typeof y!="symbol"),K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?n.name=""+Xn(K):n.removeAttribute("name")}function Ka(n,o,i,d,y,w,D,K){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.type=w),o!=null||i!=null){if(!(w!=="submit"&&w!=="reset"||o!=null)){oa(n);return}i=i!=null?""+Xn(i):"",o=o!=null?""+Xn(o):i,K||o===n.value||(n.value=o),n.defaultValue=o}d=d??y,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=K?n.checked:!!d,n.defaultChecked=!!d,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(n.name=D),oa(n)}function tc(n,o){n.defaultValue!==""+o&&(n.defaultValue=""+o)}function Xs(n,o,i,d){if(n=n.options,o){o={};for(var y=0;y<i.length;y++)o["$"+i[y]]=!0;for(i=0;i<n.length;i++)y=o.hasOwnProperty("$"+n[i].value),n[i].selected!==y&&(n[i].selected=y),y&&d&&(n[i].defaultSelected=!0)}else{for(i=""+Xn(i),o=null,y=0;y<n.length;y++){if(n[y].value===i){n[y].selected=!0,d&&(n[y].defaultSelected=!0);return}o!==null||n[y].disabled||(o=n[y])}o!==null&&(o.selected=!0)}}function nc(n,o,i){if(o!=null&&(o=""+Xn(o),o!==n.value&&(n.value=o),i==null)){n.defaultValue!==o&&(n.defaultValue=o);return}n.defaultValue=i!=null?""+Xn(i):""}function fr(n,o,i,d){if(o==null){if(d!=null){if(i!=null)throw Error(a(92));if(ne(d)){if(1<d.length)throw Error(a(93));d=d[0]}i=d}i==null&&(i=""),o=i}i=Xn(o),n.defaultValue=i,d=n.textContent,d===i&&d!==""&&d!==null&&(n.value=d),oa(n)}function Bs(n,o){if(o){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=o;return}}n.textContent=o}var Xa=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Cu(n,o,i){var d=o.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?d?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="":d?n.setProperty(o,i):typeof i!="number"||i===0||Xa.has(o)?o==="float"?n.cssFloat=i:n[o]=(""+i).trim():n[o]=i+"px"}function mr(n,o,i){if(o!=null&&typeof o!="object")throw Error(a(62));if(n=n.style,i!=null){for(var d in i)!i.hasOwnProperty(d)||o!=null&&o.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="",St=!0);for(var y in o)d=o[y],o.hasOwnProperty(y)&&i[y]!==d&&(Cu(n,y,d),St=!0)}else for(var w in o)o.hasOwnProperty(w)&&Cu(n,w,o[w])}function Yi(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ku=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Tu=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Cs(n){return Tu.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function $s(){}var Ki=null;function Xi(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Wt=null,gs=null;function Mr(n){var o=qi(n);if(o&&(n=o.stateNode)){var i=n[Ns]||null;e:switch(n=o.stateNode,o.type){case"input":if(Ps(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),o=i.name,i.type==="radio"&&o!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+kn(""+o)+'"][type="radio"]'),o=0;o<i.length;o++){var d=i[o];if(d!==n&&d.form===n.form){var y=d[Ns]||null;if(!y)throw Error(a(90));Ps(d,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(o=0;o<i.length;o++)d=i[o],d.form===n.form&&ec(d)}break e;case"textarea":nc(n,i.value,i.defaultValue);break e;case"select":o=i.value,o!=null&&Xs(n,!!i.multiple,o,!1)}}}var hr=!1;function Wi(n,o,i){if(hr)return n(o,i);hr=!0;try{var d=n(o);return d}finally{if(hr=!1,(Wt!==null||gs!==null)&&(Im(),Wt&&(o=Wt,n=gs,gs=Wt=null,Mr(o),n)))for(o=0;o<n.length;o++)Mr(n[o])}}function aa(n,o){var i=n.stateNode;if(i===null)return null;var d=i[Ns]||null;if(d===null)return null;i=d[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(a(231,o,typeof i));return i}var ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qi=!1;if(ks)try{var Eu={};Object.defineProperty(Eu,"passive",{get:function(){Qi=!0}}),window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}catch{Qi=!1}var Wa=null,sx=null,_f=null;function Qw(){if(_f)return _f;var n,o=sx,i=o.length,d,y="value"in Wa?Wa.value:Wa.textContent,w=y.length;for(n=0;n<i&&o[n]===y[n];n++);var D=i-n;for(d=1;d<=D&&o[i-d]===y[w-d];d++);return _f=y.slice(n,1<d?1-d:void 0)}function Lf(n){var o=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&o===13&&(n=13)):n=o,n===10&&(n=13),32<=n||n===13?n:0}function Bf(){return!0}function Zw(){return!1}function Vs(n){function o(i,d,y,w,D){this._reactName=i,this._targetInst=y,this.type=d,this.nativeEvent=w,this.target=D,this.currentTarget=null;for(var K in n)n.hasOwnProperty(K)&&(i=n[K],this[K]=i?i(w):w[K]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Bf:Zw,this.isPropagationStopped=Zw,this}return A(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Bf)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Bf)},persist:function(){},isPersistent:Bf}),o}var Qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$f=Vs(Qa),Ru=A({},Qa,{view:0,detail:0}),o4=Vs(Ru),rx,ox,Au,Vf=A({},Ru,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ix,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Au&&(Au&&n.type==="mousemove"?(rx=n.screenX-Au.screenX,ox=n.screenY-Au.screenY):ox=rx=0,Au=n),rx)},movementY:function(n){return"movementY"in n?n.movementY:ox}}),Jw=Vs(Vf),a4=A({},Vf,{dataTransfer:0}),i4=Vs(a4),l4=A({},Ru,{relatedTarget:0}),ax=Vs(l4),c4=A({},Qa,{animationName:0,elapsedTime:0,pseudoElement:0}),u4=Vs(c4),d4=A({},Qa,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),f4=Vs(d4),m4=A({},Qa,{data:0}),e2=Vs(m4),h4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p4={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},g4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x4(n){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(n):(n=g4[n])?!!o[n]:!1}function ix(){return x4}var b4=A({},Ru,{key:function(n){if(n.key){var o=h4[n.key]||n.key;if(o!=="Unidentified")return o}return n.type==="keypress"?(n=Lf(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?p4[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ix,charCode:function(n){return n.type==="keypress"?Lf(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Lf(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),y4=Vs(b4),v4=A({},Vf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),t2=Vs(v4),w4=A({},Qa,{submitter:0}),j4=Vs(w4),S4=A({},Ru,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ix}),N4=Vs(S4),C4=A({},Qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),k4=Vs(C4),T4=A({},Vf,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),E4=Vs(T4),R4=A({},Qa,{newState:0,oldState:0,source:0}),A4=Vs(R4),O4=[9,13,27,32],lx=ks&&"CompositionEvent"in window,Ou=null;ks&&"documentMode"in document&&(Ou=document.documentMode);var M4=ks&&"TextEvent"in window&&!Ou,n2=ks&&(!lx||Ou&&8<Ou&&11>=Ou),s2=" ",r2=!1;function o2(n,o){switch(n){case"keyup":return O4.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a2(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var sc=!1;function D4(n,o){switch(n){case"compositionend":return a2(o);case"keypress":return o.which!==32?null:(r2=!0,s2);case"textInput":return n=o.data,n===s2&&r2?null:n;default:return null}}function z4(n,o){if(sc)return n==="compositionend"||!lx&&o2(n,o)?(n=Qw(),_f=sx=Wa=null,sc=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return n2&&o.locale!=="ko"?null:o.data;default:return null}}var P4={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function i2(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o==="input"?!!P4[n.type]:o==="textarea"}function l2(n,o,i,d){Wt?gs?gs.push(d):gs=[d]:Wt=d,o=Um(o,"onChange"),0<o.length&&(i=new $f("onChange","change",null,i,d),n.push({event:i,listeners:o}))}var Mu=null,Du=null;function I4(n){XS(n,0)}function Uf(n){var o=Ne(n);if(ec(o))return n}function c2(n,o){if(n==="change")return o}var u2=!1;if(ks){var cx;if(ks){var ux="oninput"in document;if(!ux){var d2=document.createElement("div");d2.setAttribute("oninput","return;"),ux=typeof d2.oninput=="function"}cx=ux}else cx=!1;u2=cx&&(!document.documentMode||9<document.documentMode)}function f2(){Mu&&(Mu.detachEvent("onpropertychange",m2),Du=Mu=null)}function m2(n){if(n.propertyName==="value"&&Uf(Du)){var o=[];l2(o,Du,n,Xi(n)),Wi(I4,o)}}function _4(n,o,i){n==="focusin"?(f2(),Mu=o,Du=i,Mu.attachEvent("onpropertychange",m2)):n==="focusout"&&f2()}function L4(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Uf(Du)}function B4(n,o){if(n==="click")return Uf(o)}function $4(n,o){if(n==="input"||n==="change")return Uf(o)}function V4(n,o){return n===o&&(n!==0||1/n===1/o)||n!==n&&o!==o}var pr=typeof Object.is=="function"?Object.is:V4;function zu(n,o){if(pr(n,o))return!0;if(typeof n!="object"||n===null||typeof o!="object"||o===null)return!1;var i=Object.keys(n),d=Object.keys(o);if(i.length!==d.length)return!1;for(d=0;d<i.length;d++){var y=i[d];if(!at.call(o,y)||!pr(n[y],o[y]))return!1}return!0}function dx(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function h2(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function p2(n,o){var i=h2(n);n=0;for(var d;i;){if(i.nodeType===3){if(d=n+i.textContent.length,n<=o&&d>=o)return{node:i,offset:o-n};n=d}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=h2(i)}}function g2(n,o){return n&&o?n===o?!0:n&&n.nodeType===3?!1:o&&o.nodeType===3?g2(n,o.parentNode):"contains"in n?n.contains(o):n.compareDocumentPosition?!!(n.compareDocumentPosition(o)&16):!1:!1}function x2(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var o=dx(n.document);o instanceof n.HTMLIFrameElement;){try{var i=typeof o.contentWindow.location.href=="string"}catch{i=!1}if(i)n=o.contentWindow;else break;o=dx(n.document)}return o}function fx(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o&&(o==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||o==="textarea"||n.contentEditable==="true")}var U4=ks&&"documentMode"in document&&11>=document.documentMode,rc=null,mx=null,Pu=null,hx=!1;function b2(n,o,i){var d=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;hx||rc==null||rc!==dx(d)||(d=rc,"selectionStart"in d&&fx(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Pu&&zu(Pu,d)||(Pu=d,d=Um(mx,"onSelect"),0<d.length&&(o=new $f("onSelect","select",null,o,i),n.push({event:o,listeners:d}),o.target=rc)))}function Zi(n,o){var i={};return i[n.toLowerCase()]=o.toLowerCase(),i["Webkit"+n]="webkit"+o,i["Moz"+n]="moz"+o,i}var oc={animationend:Zi("Animation","AnimationEnd"),animationiteration:Zi("Animation","AnimationIteration"),animationstart:Zi("Animation","AnimationStart"),transitionrun:Zi("Transition","TransitionRun"),transitionstart:Zi("Transition","TransitionStart"),transitioncancel:Zi("Transition","TransitionCancel"),transitionend:Zi("Transition","TransitionEnd")},px={},y2={};ks&&(y2=document.createElement("div").style,"AnimationEvent"in window||(delete oc.animationend.animation,delete oc.animationiteration.animation,delete oc.animationstart.animation),"TransitionEvent"in window||delete oc.transitionend.transition);function Ji(n){if(px[n])return px[n];if(!oc[n])return n;var o=oc[n],i;for(i in o)if(o.hasOwnProperty(i)&&i in y2)return px[n]=o[i];return n}var v2=Ji("animationend"),w2=Ji("animationiteration"),j2=Ji("animationstart"),H4=Ji("transitionrun"),F4=Ji("transitionstart"),G4=Ji("transitioncancel"),S2=Ji("transitionend"),N2=new Map,gx="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");gx.push("scrollEnd");function lo(n,o){N2.set(n,o),Bt(o,[n])}var q4=0;function ia(n,o){if(n.name!=null&&n.name!=="auto")return n.name;if(o.autoName!==null)return o.autoName;n=mo.identifierPrefix;var i=q4++;return n="_"+n+"t_"+i.toString(32)+"_",o.autoName=n}function C2(n){if(n==null||typeof n=="string")return n;var o=null,i=Cc;if(i!==null)for(var d=0;d<i.length;d++){var y=n[i[d]];if(y!=null){if(y==="none")return"none";o=o==null?y:o+(" "+y)}}return o??n.default}function la(n,o){return n=C2(n),o=C2(o),o==null?n==="auto"?null:n:o==="auto"?null:o}var Hf=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Dr=[],ac=0,xx=0;function Ff(){for(var n=ac,o=xx=ac=0;o<n;){var i=Dr[o];Dr[o++]=null;var d=Dr[o];Dr[o++]=null;var y=Dr[o];Dr[o++]=null;var w=Dr[o];if(Dr[o++]=null,d!==null&&y!==null){var D=d.pending;D===null?y.next=y:(y.next=D.next,D.next=y),d.pending=y}w!==0&&k2(i,y,w)}}function Gf(n,o,i,d){Dr[ac++]=n,Dr[ac++]=o,Dr[ac++]=i,Dr[ac++]=d,xx|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function bx(n,o,i,d){return Gf(n,o,i,d),qf(n)}function el(n,o){return Gf(n,null,null,o),qf(n)}function k2(n,o,i){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i);for(var y=!1,w=n.return;w!==null;)w.childLanes|=i,d=w.alternate,d!==null&&(d.childLanes|=i),w.tag===22&&(n=w.stateNode,n===null||n._visibility&1||(y=!0)),n=w,w=w.return;return n.tag===3?(w=n.stateNode,y&&o!==null&&(y=31-kt(i),n=w.hiddenUpdates,d=n[y],d===null?n[y]=[o]:d.push(o),o.lane=i|536870912),w):null}function qf(n){if(50<sd)throw sd=0,Pm=null,Error(a(185));for(var o=n.return;o!==null;)n=o,o=n.return;return n.tag===3?n.stateNode:null}var ic={};function Y4(n,o,i,d){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ws(n,o,i,d){return new Y4(n,o,i,d)}function yx(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ca(n,o){var i=n.alternate;return i===null?(i=Ws(n.tag,o,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=o,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&1206910976,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,o=n.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function T2(n,o){n.flags&=1206910978;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=o,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,o=i.dependencies,n.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),n}function Yf(n,o,i,d,y,w){var D=0;if(d=n,typeof d=="function")yx(d)&&(D=1);else if(typeof d=="string")D=wz(n,i,te.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(d){case J:return n=Ws(31,i,o,y),n.elementType=J,n.lanes=w,n;case L:return tl(i.children,y,w,o);case Y:D=8,y|=24;break;case P:return n=Ws(12,i,o,y|2),n.elementType=P,n.lanes=w,n;case F:return n=Ws(13,i,o,y),n.elementType=F,n.lanes=w,n;case q:return n=Ws(19,i,o,y),n.elementType=q,n.lanes=w,n;case X:case I:return n=y|32,n=Ws(30,i,o,n),n.elementType=I,n.lanes=w,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case U:D=10;break e;case V:D=9;break e;case H:D=11;break e;case W:D=14;break e;case B:D=16,d=null;break e}D=29,i=Error(a(130,n===null?"null":typeof n,"")),d=null}return o=Ws(D,i,o,y),o.elementType=n,o.type=d,o.lanes=w,o}function tl(n,o,i,d){return n=Ws(7,n,d,o),n.lanes=i,n}function vx(n,o,i){return n=Ws(6,n,null,o),n.lanes=i,n}function E2(n){var o=Ws(18,null,null,0);return o.stateNode=n,o}function wx(n,o,i){return o=Ws(4,n.children!==null?n.children:[],n.key,o),o.lanes=i,o.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},o}var R2=new WeakMap;function zr(n,o){if(typeof n=="object"&&n!==null){var i=R2.get(n);return i!==void 0?i:(o={value:n,source:o,stack:Ie(o)},R2.set(n,o),o)}return{value:n,source:o,stack:Ie(o)}}var lc=[],cc=0,Kf=null,Iu=0,Pr=[],Ir=0,Za=null,Ao=1,Oo="";function ua(n,o){lc[cc++]=Iu,lc[cc++]=Kf,Kf=n,Iu=o}function A2(n,o,i){Pr[Ir++]=Ao,Pr[Ir++]=Oo,Pr[Ir++]=Za,Za=n;var d=Ao;n=Oo;var y=32-kt(d)-1;d&=~(1<<y),i+=1;var w=32-kt(o)+y;if(30<w){var D=y-y%5;w=(d&(1<<D)-1).toString(32),d>>=D,y-=D,Ao=1<<32-kt(o)+y|i<<y|d,Oo=w+n}else Ao=1<<w|i<<y|d,Oo=n}function Xf(n){n.return!==null&&(ua(n,1),A2(n,1,0))}function jx(n){for(;n===Kf;)Kf=lc[--cc],lc[cc]=null,Iu=lc[--cc],lc[cc]=null;for(;n===Za;)Za=Pr[--Ir],Pr[Ir]=null,Oo=Pr[--Ir],Pr[Ir]=null,Ao=Pr[--Ir],Pr[Ir]=null}function O2(n,o){Pr[Ir++]=Ao,Pr[Ir++]=Oo,Pr[Ir++]=Za,Ao=o.id,Oo=o.overflow,Za=n}var xs=null,Sn=null,Vt=!1,Ja=null,_r=!1,Sx=Error(a(519));function ei(n){var o=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _u(zr(o,n)),Sx}function M2(n){var o=n.stateNode,i=n.type,d=n.memoizedProps;switch(o[Mn]=n,o[Ns]=d,i){case"dialog":Yt("cancel",o),Yt("close",o);break;case"iframe":case"object":case"embed":Yt("load",o);break;case"video":case"audio":for(i=0;i<od.length;i++)Yt(od[i],o);break;case"source":Yt("error",o);break;case"img":case"image":case"link":Yt("error",o),Yt("load",o);break;case"details":Yt("toggle",o);break;case"input":Yt("invalid",o),Ka(o,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Yt("invalid",o);break;case"textarea":Yt("invalid",o),fr(o,d.value,d.defaultValue,d.children)}i=d.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||o.textContent===""+i||d.suppressHydrationWarning===!0||JS(o.textContent,i)?(d.popover!=null&&(Yt("beforetoggle",o),Yt("toggle",o)),d.onScroll!=null&&Yt("scroll",o),d.onScrollEnd!=null&&Yt("scrollend",o),d.onClick!=null&&(o.onclick=$s),o=!0):o=!1,o||ei(n,!0)}function Wf(n){for(xs=n.return;xs;)switch(xs.tag){case 5:case 31:case 13:_r=!1;return;case 27:case 3:_r=!0;return;default:xs=xs.return}}function uc(n){if(n!==xs)return!1;if(!Vt)return Wf(n),Vt=!0,!1;var o=n.tag,i;if((i=o!==3&&o!==27)&&((i=o===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||Jb(n.type,n.memoizedProps)),i=!i),i&&Sn&&ei(n),Wf(n),o===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Sn=bN(n)}else if(o===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Sn=bN(n)}else o===27?(o=Sn,gi(n.type)?(n=l0,l0=null,Sn=n):Sn=o):Sn=xs?Br(n.stateNode.nextSibling):null;return!0}function nl(){Sn=xs=null,Vt=!1}function Nx(){var n=Ja;return n!==null&&(Js===null?Js=n:Js.push.apply(Js,n),Ja=null),n}function _u(n){Ja===null?Ja=[n]:Ja.push(n)}var Cx=_e(null),sl=null,da=null;function ti(n,o,i){Ae(Cx,o._currentValue),o._currentValue=i}function fa(n){n._currentValue=Cx.current,je(Cx)}function Qf(n,o,i){for(;n!==null;){var d=n.alternate;if((n.childLanes&o)!==o?(n.childLanes|=o,d!==null&&(d.childLanes|=o)):d!==null&&(d.childLanes&o)!==o&&(d.childLanes|=o),n===i)break;n=n.return}}function kx(n,o,i,d){var y=n.child;for(y!==null&&(y.return=n);y!==null;){var w=y.dependencies;if(w!==null){var D=y.child;w=w.firstContext;e:for(;w!==null;){var K=w;w=y;for(var le=0;le<o.length;le++)if(K.context===o[le]){w.lanes|=i,K=w.alternate,K!==null&&(K.lanes|=i),Qf(w.return,i,n),d||(D=null);break e}w=K.next}}else if(y.tag===18){if(D=y.return,D===null)throw Error(a(341));D.lanes|=i,w=D.alternate,w!==null&&(w.lanes|=i),Qf(D,i,n),D=null}else y.tag===13&&y.memoizedState!==null&&y.memoizedState.dehydrated===null?(y.lanes|=i,D=y.alternate,D!==null&&(D.lanes|=i),Qf(y.return,i,n),D=y.child,D=D!==null?D.sibling:null):D=y.child;if(D!==null)D.return=y;else for(D=y;D!==null;){if(D===n){D=null;break}if(y=D.sibling,y!==null){y.return=D.return,D=y;break}D=D.return}y=D}}function rl(n,o,i,d){n=null;for(var y=o,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var D=y.alternate;if(D===null)throw Error(a(387));if(D=D.memoizedProps,D!==null){var K=y.type;pr(y.pendingProps.value,D.value)||(n!==null?n.push(K):n=[K])}}else if(y===be.current){if(D=y.alternate,D===null)throw Error(a(387));D.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(n!==null?n.push(Pc):n=[Pc])}y=y.return}return n!==null&&kx(o,n,i,d),o.flags|=262144,n!==null}function Zf(n){for(n=n.firstContext;n!==null;){if(!pr(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ol(n){sl=n,da=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ts(n){return D2(sl,n)}function Jf(n,o){return sl===null&&ol(n),D2(n,o)}function D2(n,o){var i=o._currentValue;if(o={context:o,memoizedValue:i,next:null},da===null){if(n===null)throw Error(a(308));da=o,n.dependencies={lanes:0,firstContext:o},n.flags|=524288}else da=da.next=o;return i}var K4=typeof AbortController<"u"?AbortController:function(){var n=[],o=this.signal={aborted:!1,addEventListener:function(i,d){n.push(d)}};this.abort=function(){o.aborted=!0,n.forEach(function(i){return i()})}},X4=e.unstable_scheduleCallback,W4=e.unstable_NormalPriority,Wn={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tx(){return{controller:new K4,data:new Map,refCount:0}}function Lu(n){n.refCount--,n.refCount===0&&X4(W4,function(){n.controller.abort()})}function z2(n,o){if((n.pendingLanes&4194048)!==0){var i=n.transitionTypes;for(i===null&&(i=n.transitionTypes=[]),n=0;n<o.length;n++){var d=o[n];i.indexOf(d)===-1&&i.push(d)}}}var Bu=null;function Q4(n){var o=n.transitionTypes;return n.transitionTypes=null,o}var $u=null,Ex=0,al=0,dc=null;function Z4(n,o){if($u===null){var i=$u=[];Ex=0,al=Fb(),dc={status:"pending",value:void 0,then:function(d){i.push(d)}}}return Ex++,o.then(P2,P2),o}function P2(){if(--Ex===0&&(Bu=null,$u!==null)){dc!==null&&(dc.status="fulfilled");var n=$u;$u=null,al=0,dc=null;for(var o=0;o<n.length;o++)(0,n[o])()}}function J4(n,o){var i=[],d={status:"pending",value:null,reason:null,then:function(y){i.push(y)}};return n.then(function(){d.status="fulfilled",d.value=o;for(var y=0;y<i.length;y++)(0,i[y])(o)},function(y){for(d.status="rejected",d.reason=y,y=0;y<i.length;y++)(0,i[y])(void 0)}),d}var I2=ie.S;ie.S=function(n,o){if(ES=tt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&Z4(n,o),Bu!==null)for(var i=Rc;i!==null;)z2(i,Bu),i=i.next;if(i=n.types,i!==null){for(var d=Rc;d!==null;)z2(d,i),d=d.next;if(al!==0){d=Bu,d===null&&(d=Bu=[]);for(var y=0;y<i.length;y++){var w=i[y];d.indexOf(w)===-1&&d.push(w)}}}I2!==null&&I2(n,o)};var il=_e(null);function Rx(){var n=il.current;return n!==null?n:yn.pooledCache}function em(n,o){o===null?Ae(il,il.current):Ae(il,o.pool)}function _2(){var n=Rx();return n===null?null:{parent:Wn._currentValue,pool:n}}var fc=Error(a(460)),Ax=Error(a(474)),tm=Error(a(542)),nm={then:function(){}};function L2(n){return n=n.status,n==="fulfilled"||n==="rejected"}function B2(n,o,i){switch(i=n[i],i===void 0?n.push(o):i!==o&&(o.then($s,$s),o=i),o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,V2(n),n===void 0&&!("reason"in o)?Error(a(600)):n;default:if(typeof o.status=="string")o.then($s,$s);else{if(n=yn,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=o,n.status="pending",n.then(function(d){if(o.status==="pending"){var y=o;y.status="fulfilled",y.value=d}},function(d){if(o.status==="pending"){var y=o;y.status="rejected",y.reason=d}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,V2(n),n}throw cl=o,fc}}function ll(n){try{var o=n._init;return o(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(cl=i,fc):i}}var cl=null;function $2(){if(cl===null)throw Error(a(459));var n=cl;return cl=null,n}function V2(n){if(n===fc||n===tm)throw Error(a(483))}var mc=null,Vu=0;function sm(n){var o=Vu;return Vu+=1,mc===null&&(mc=[]),B2(mc,n,o)}function ni(n,o){o=o.props.ref,n.ref=o!==void 0?o:null}function rm(n,o){throw o.$$typeof===R?Error(a(525)):(n=Object.prototype.toString.call(o),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":n)))}function U2(n){function o(ge,fe){if(n){var ye=ge.deletions;ye===null?(ge.deletions=[fe],ge.flags|=16):ye.push(fe)}}function i(ge,fe){if(!n)return null;for(;fe!==null;)o(ge,fe),fe=fe.sibling;return null}function d(ge){for(var fe=new Map;ge!==null;)ge.key===null?fe.set(ge.index,ge):fe.set(ge.key,ge),ge=ge.sibling;return fe}function y(ge,fe){return ge=ca(ge,fe),ge.index=0,ge.sibling=null,ge}function w(ge,fe,ye){return ge.index=ye,n?(ye=ge.alternate,ye!==null?(ye=ye.index,ye<fe?(ge.flags|=2,fe):ye):(ge.flags|=134217730,fe)):(ge.flags|=1048576,fe)}function D(ge){return n&&ge.alternate===null&&(ge.flags|=134217730),ge}function K(ge,fe,ye,De){return fe===null||fe.tag!==6?(fe=vx(ye,ge.mode,De),fe.return=ge,fe):(fe=y(fe,ye),fe.return=ge,fe)}function le(ge,fe,ye,De){var rt=ye.type;return rt===L?(ge=Ce(ge,fe,ye.props.children,De,ye.key),ni(ge,ye),ge):fe!==null&&(fe.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===B&&ll(rt)===fe.type)?(fe=y(fe,ye.props),ni(fe,ye),fe.return=ge,fe):(fe=Yf(ye.type,ye.key,ye.props,null,ge.mode,De),ni(fe,ye),fe.return=ge,fe)}function xe(ge,fe,ye,De){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==ye.containerInfo||fe.stateNode.implementation!==ye.implementation?(fe=wx(ye,ge.mode,De),fe.return=ge,fe):(fe=y(fe,ye.children||[]),fe.return=ge,fe)}function Ce(ge,fe,ye,De,rt){return fe===null||fe.tag!==7?(fe=tl(ye,ge.mode,De,rt),fe.return=ge,fe):(fe=y(fe,ye),fe.return=ge,fe)}function ze(ge,fe,ye){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return fe=vx(""+fe,ge.mode,ye),fe.return=ge,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case z:return ye=Yf(fe.type,fe.key,fe.props,null,ge.mode,ye),ni(ye,fe),ye.return=ge,ye;case _:return fe=wx(fe,ge.mode,ye),fe.return=ge,fe;case B:return fe=ll(fe),ze(ge,fe,ye)}if(ne(fe)||G(fe))return fe=tl(fe,ge.mode,ye,null),fe.return=ge,fe;if(typeof fe.then=="function")return ze(ge,sm(fe),ye);if(fe.$$typeof===U)return ze(ge,Jf(ge,fe),ye);rm(ge,fe)}return null}function he(ge,fe,ye,De){var rt=fe!==null?fe.key:null;if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return rt!==null?null:K(ge,fe,""+ye,De);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case z:return ye.key===rt?le(ge,fe,ye,De):null;case _:return ye.key===rt?xe(ge,fe,ye,De):null;case B:return ye=ll(ye),he(ge,fe,ye,De)}if(ne(ye)||G(ye))return rt!==null?null:Ce(ge,fe,ye,De,null);if(typeof ye.then=="function")return he(ge,fe,sm(ye),De);if(ye.$$typeof===U)return he(ge,fe,Jf(ge,ye),De);rm(ge,ye)}return null}function we(ge,fe,ye,De,rt){if(typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint")return ge=ge.get(ye)||null,K(fe,ge,""+De,rt);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case z:return ge=ge.get(De.key===null?ye:De.key)||null,le(fe,ge,De,rt);case _:return ge=ge.get(De.key===null?ye:De.key)||null,xe(fe,ge,De,rt);case B:return De=ll(De),we(ge,fe,ye,De,rt)}if(ne(De)||G(De))return ge=ge.get(ye)||null,Ce(fe,ge,De,rt,null);if(typeof De.then=="function")return we(ge,fe,ye,sm(De),rt);if(De.$$typeof===U)return we(ge,fe,ye,Jf(fe,De),rt);rm(fe,De)}return null}function et(ge,fe,ye,De){for(var rt=null,Xt=null,xt=fe,Tt=fe=0,Jn=null;xt!==null&&Tt<ye.length;Tt++){xt.index>Tt?(Jn=xt,xt=null):Jn=xt.sibling;var Qt=he(ge,xt,ye[Tt],De);if(Qt===null){xt===null&&(xt=Jn);break}n&&xt&&Qt.alternate===null&&o(ge,xt),fe=w(Qt,fe,Tt),Xt===null?rt=Qt:Xt.sibling=Qt,Xt=Qt,xt=Jn}if(Tt===ye.length)return i(ge,xt),Vt&&ua(ge,Tt),rt;if(xt===null){for(;Tt<ye.length;Tt++)xt=ze(ge,ye[Tt],De),xt!==null&&(fe=w(xt,fe,Tt),Xt===null?rt=xt:Xt.sibling=xt,Xt=xt);return Vt&&ua(ge,Tt),rt}for(xt=d(xt);Tt<ye.length;Tt++)Jn=we(xt,ge,Tt,ye[Tt],De),Jn!==null&&(n&&(Qt=Jn.alternate,Qt!==null&&xt.delete(Qt.key===null?Tt:Qt.key)),fe=w(Jn,fe,Tt),Xt===null?rt=Jn:Xt.sibling=Jn,Xt=Jn);return n&&xt.forEach(function(wi){return o(ge,wi)}),Vt&&ua(ge,Tt),rt}function dt(ge,fe,ye,De){if(ye==null)throw Error(a(151));for(var rt=null,Xt=null,xt=fe,Tt=fe=0,Jn=null,Qt=ye.next();xt!==null&&!Qt.done;Tt++,Qt=ye.next()){xt.index>Tt?(Jn=xt,xt=null):Jn=xt.sibling;var wi=he(ge,xt,Qt.value,De);if(wi===null){xt===null&&(xt=Jn);break}n&&xt&&wi.alternate===null&&o(ge,xt),fe=w(wi,fe,Tt),Xt===null?rt=wi:Xt.sibling=wi,Xt=wi,xt=Jn}if(Qt.done)return i(ge,xt),Vt&&ua(ge,Tt),rt;if(xt===null){for(;!Qt.done;Tt++,Qt=ye.next())Qt=ze(ge,Qt.value,De),Qt!==null&&(fe=w(Qt,fe,Tt),Xt===null?rt=Qt:Xt.sibling=Qt,Xt=Qt);return Vt&&ua(ge,Tt),rt}for(xt=d(xt);!Qt.done;Tt++,Qt=ye.next())Qt=we(xt,ge,Tt,Qt.value,De),Qt!==null&&(n&&(Jn=Qt.alternate,Jn!==null&&xt.delete(Jn.key===null?Tt:Jn.key)),fe=w(Qt,fe,Tt),Xt===null?rt=Qt:Xt.sibling=Qt,Xt=Qt);return n&&xt.forEach(function(Dz){return o(ge,Dz)}),Vt&&ua(ge,Tt),rt}function _t(ge,fe,ye,De){if(typeof ye=="object"&&ye!==null&&ye.type===L&&ye.key===null&&ye.props.ref===void 0&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case z:e:{for(var rt=ye.key;fe!==null;){if(fe.key===rt){if(rt=ye.type,rt===L){if(fe.tag===7){i(ge,fe.sibling),De=y(fe,ye.props.children),ni(De,ye),De.return=ge,ge=De;break e}}else if(fe.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===B&&ll(rt)===fe.type){i(ge,fe.sibling),De=y(fe,ye.props),ni(De,ye),De.return=ge,ge=De;break e}i(ge,fe);break}else o(ge,fe);fe=fe.sibling}ye.type===L?(De=tl(ye.props.children,ge.mode,De,ye.key),ni(De,ye),De.return=ge,ge=De):(De=Yf(ye.type,ye.key,ye.props,null,ge.mode,De),ni(De,ye),De.return=ge,ge=De)}return D(ge);case _:e:{for(rt=ye.key;fe!==null;){if(fe.key===rt)if(fe.tag===4&&fe.stateNode.containerInfo===ye.containerInfo&&fe.stateNode.implementation===ye.implementation){i(ge,fe.sibling),De=y(fe,ye.children||[]),De.return=ge,ge=De;break e}else{i(ge,fe);break}else o(ge,fe);fe=fe.sibling}De=wx(ye,ge.mode,De),De.return=ge,ge=De}return D(ge);case B:return ye=ll(ye),_t(ge,fe,ye,De)}if(ne(ye))return et(ge,fe,ye,De);if(G(ye)){if(rt=G(ye),typeof rt!="function")throw Error(a(150));return ye=rt.call(ye),dt(ge,fe,ye,De)}if(typeof ye.then=="function")return _t(ge,fe,sm(ye),De);if(ye.$$typeof===U)return _t(ge,fe,Jf(ge,ye),De);rm(ge,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint"?(ye=""+ye,fe!==null&&fe.tag===6?(i(ge,fe.sibling),De=y(fe,ye),De.return=ge,ge=De):(i(ge,fe),De=vx(ye,ge.mode,De),De.return=ge,ge=De),D(ge)):i(ge,fe)}return function(ge,fe,ye,De){try{Vu=0;var rt=_t(ge,fe,ye,De);return mc=null,rt}catch(xt){if(xt===fc||xt===tm)throw xt;var Xt=Ws(29,xt,null,ge.mode);return Xt.lanes=De,Xt.return=ge,Xt}finally{}}}var ul=U2(!0),H2=U2(!1),si=!1;function Ox(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mx(n,o){n=n.updateQueue,o.updateQueue===n&&(o.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function oi(n,o,i){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(nn&2)!==0){var y=d.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),d.pending=o,o=qf(n),k2(n,null,i),o}return Gf(n,d,o,i),qf(n)}function Uu(n,o,i){if(o=o.updateQueue,o!==null&&(o=o.shared,(i&4194048)!==0)){var d=o.lanes;d&=n.pendingLanes,i|=d,o.lanes=i,cr(n,i)}}function Dx(n,o){var i=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,i===d)){var y=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var D={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?y=w=D:w=w.next=D,i=i.next}while(i!==null);w===null?y=w=o:w=w.next=o}else y=w=o;i={baseState:d.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:d.shared,callbacks:d.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=o:n.next=o,i.lastBaseUpdate=o}var zx=!1;function Hu(){if(zx){var n=dc;if(n!==null)throw n}}function Fu(n,o,i,d){zx=!1;var y=n.updateQueue;si=!1;var w=y.firstBaseUpdate,D=y.lastBaseUpdate,K=y.shared.pending;if(K!==null){y.shared.pending=null;var le=K,xe=le.next;le.next=null,D===null?w=xe:D.next=xe,D=le;var Ce=n.alternate;Ce!==null&&(Ce=Ce.updateQueue,K=Ce.lastBaseUpdate,K!==D&&(K===null?Ce.firstBaseUpdate=xe:K.next=xe,Ce.lastBaseUpdate=le))}if(w!==null){var ze=y.baseState;D=0,Ce=xe=le=null,K=w;do{var he=K.lane&-536870913,we=he!==K.lane;if(we?(Kt&he)===he:(d&he)===he){he!==0&&he===al&&(zx=!0),Ce!==null&&(Ce=Ce.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var et=n,dt=K;he=o;var _t=i;switch(dt.tag){case 1:if(et=dt.payload,typeof et=="function"){ze=et.call(_t,ze,he);break e}ze=et;break e;case 3:et.flags=et.flags&-65537|128;case 0:if(et=dt.payload,he=typeof et=="function"?et.call(_t,ze,he):et,he==null)break e;ze=A({},ze,he);break e;case 2:si=!0}}he=K.callback,he!==null&&(n.flags|=64,we&&(n.flags|=8192),we=y.callbacks,we===null?y.callbacks=[he]:we.push(he))}else we={lane:he,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Ce===null?(xe=Ce=we,le=ze):Ce=Ce.next=we,D|=he;if(K=K.next,K===null){if(K=y.shared.pending,K===null)break;we=K,K=we.next,we.next=null,y.lastBaseUpdate=we,y.shared.pending=null}}while(!0);Ce===null&&(le=ze),y.baseState=le,y.firstBaseUpdate=xe,y.lastBaseUpdate=Ce,w===null&&(y.shared.lanes=0),fi|=D,n.lanes=D,n.memoizedState=ze}}function F2(n,o){if(typeof n!="function")throw Error(a(191,n));n.call(o)}function G2(n,o){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)F2(i[n],o)}var ai=_e(null),om=_e(0);function q2(n,o){n=xa,Ae(om,n),Ae(ai,o),xa=n|o.baseLanes}function Px(){Ae(om,xa),Ae(ai,ai.current)}function Ix(){xa=om.current,je(ai),je(om)}var Es=_e(null),Is=null;function ii(n){var o=n.alternate;Ae(Rs,Rs.current&1),Ae(Es,n),Is===null&&(o===null||ai.current!==null||o.memoizedState!==null)&&(Is=n)}function _x(n){Ae(Rs,Rs.current),Ae(Es,n),Is===null&&(Is=n)}function Y2(n){n.tag===22?(Ae(Rs,Rs.current),Ae(Es,n),Is===null&&(Is=n)):li()}function li(){Ae(Rs,Rs.current),Ae(Es,Es.current)}function gr(n){je(Es),Is===n&&(Is=null),je(Rs)}var Rs=_e(0);function Gu(n,o){Ae(Es,Es.current),Ae(Rs,o)}function Lx(n){je(Rs),je(Es),Is===n&&(Is=null)}function am(n){for(var o=n;o!==null;){if(o.tag===13){var i=o.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||a0(i)||i0(i)))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!=="independent"){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ma=0,It=null,mn=null,Qn=null,im=!1,hc=!1,dl=!1,lm=0,qu=0,pc=null,eD=0;function Bn(){throw Error(a(321))}function Bx(n,o){if(o===null)return!1;for(var i=0;i<o.length&&i<n.length;i++)if(!pr(n[i],o[i]))return!1;return!0}function $x(n,o,i,d,y,w){return ma=w,It=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,ie.H=n===null||n.memoizedState===null?Aj:Oj,dl=!1,w=i(d,y),dl=!1,hc&&(w=X2(o,i,d,y)),K2(n),w}function K2(n){ie.H=pm;var o=mn!==null&&mn.next!==null;if(ma=0,Qn=mn=It=null,im=!1,qu=0,pc=null,o)throw Error(a(300));n===null||Zn||(n=n.dependencies,n!==null&&Zf(n)&&(Zn=!0))}function X2(n,o,i,d){It=n;var y=0;do{if(hc&&(pc=null),qu=0,hc=!1,25<=y)throw Error(a(301));if(y+=1,Qn=mn=null,n.updateQueue!=null){var w=n.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}ie.H=lD,w=o(i,d)}while(hc);return w}function tD(){var n=ie.H,o=n.useState()[0];return o=typeof o.then=="function"?Yu(o):o,n=n.useState()[0],(mn!==null?mn.memoizedState:null)!==n&&(It.flags|=1024),o}function Vx(){var n=lm!==0;return lm=0,n}function Ux(n,o,i){o.updateQueue=n.updateQueue,o.flags&=-2053,n.lanes&=~i}function Hx(n){if(im){for(n=n.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}im=!1}ma=0,Qn=mn=It=null,hc=!1,qu=lm=0,pc=null}function Us(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?It.memoizedState=Qn=n:Qn=Qn.next=n,Qn}function Fn(){if(mn===null){var n=It.alternate;n=n!==null?n.memoizedState:null}else n=mn.next;var o=Qn===null?It.memoizedState:Qn.next;if(o!==null)Qn=o,mn=n;else{if(n===null)throw It.alternate===null?Error(a(467)):Error(a(310));mn=n,n={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},Qn===null?It.memoizedState=Qn=n:Qn=Qn.next=n}return Qn}function cm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yu(n){var o=qu;return qu+=1,pc===null&&(pc=[]),n=B2(pc,n,o),o=It,(Qn===null?o.memoizedState:Qn.next)===null&&(o=o.alternate,ie.H=o===null||o.memoizedState===null?Aj:Oj),n}function um(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Yu(n);if(n.$$typeof===$)return;if(n.$$typeof===U)return Ts(n)}throw Error(a(438,String(n)))}function Fx(n){var o=null,i=It.updateQueue;if(i!==null&&(o=i.memoCache),o==null){var d=It.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(o={data:d.data.map(function(y){return y.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),i===null&&(i=cm(),It.updateQueue=i),i.memoCache=o,i=o.data[o.index],i===void 0)for(i=o.data[o.index]=Array(n),d=0;d<n;d++)i[d]=re;return o.index++,i}function ha(n,o){return typeof o=="function"?o(n):o}function dm(n){var o=Fn();return Gx(o,mn,n)}function Gx(n,o,i){var d=n.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=i;var y=n.baseQueue,w=d.pending;if(w!==null){if(y!==null){var D=y.next;y.next=w.next,w.next=D}o.baseQueue=y=w,d.pending=null}if(w=n.baseState,y===null)n.memoizedState=w;else{o=y.next;var K=D=null,le=null,xe=o,Ce=!1;do{var ze=xe.lane&-536870913;if(ze!==xe.lane?(Kt&ze)===ze:(ma&ze)===ze){var he=xe.revertLane;if(he===0)le!==null&&(le=le.next={lane:0,revertLane:0,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),ze===al&&(Ce=!0);else if((ma&he)===he){xe=xe.next,he===al&&(Ce=!0);continue}else ze={lane:0,revertLane:xe.revertLane,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},le===null?(K=le=ze,D=w):le=le.next=ze,It.lanes|=he,fi|=he;ze=xe.action,dl&&i(w,ze),w=xe.hasEagerState?xe.eagerState:i(w,ze)}else he={lane:ze,revertLane:xe.revertLane,gesture:xe.gesture,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},le===null?(K=le=he,D=w):le=le.next=he,It.lanes|=ze,fi|=ze;xe=xe.next}while(xe!==null&&xe!==o);if(le===null?D=w:le.next=K,!pr(w,n.memoizedState)&&(Zn=!0,Ce&&(i=dc,i!==null)))throw i;n.memoizedState=w,n.baseState=D,n.baseQueue=le,d.lastRenderedState=w}return y===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function qx(n){var o=Fn(),i=o.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=n;var d=i.dispatch,y=i.pending,w=o.memoizedState;if(y!==null){i.pending=null;var D=y=y.next;do w=n(w,D.action),D=D.next;while(D!==y);pr(w,o.memoizedState)||(Zn=!0),o.memoizedState=w,o.baseQueue===null&&(o.baseState=w),i.lastRenderedState=w}return[w,d]}function W2(n,o,i){var d=It,y=Fn(),w=Vt;if(w){if(i===void 0)throw Error(a(407));i=i()}else i=o();var D=!pr((mn||y).memoizedState,i);if(D&&(y.memoizedState=i,Zn=!0),y=y.queue,Xx(J2.bind(null,d,y,n),[n]),n=y.getSnapshot!==o||D||Qn!==null&&(Qn.memoizedState.tag&1)!==0,gc(n?9:8,{destroy:void 0},Z2.bind(null,d,y,i,o),null),n){if(d.flags|=2048,yn===null)throw Error(a(349));w||(ma&127)!==0||Q2(d,o,i)}return i}function Q2(n,o,i){n.flags|=16384,n={getSnapshot:o,value:i},o=It.updateQueue,o===null?(o=cm(),It.updateQueue=o,o.stores=[n]):(i=o.stores,i===null?o.stores=[n]:i.push(n))}function Z2(n,o,i,d){o.value=i,o.getSnapshot=d,ej(o)&&tj(n)}function J2(n,o,i){return i(function(){ej(o)&&tj(n)})}function ej(n){var o=n.getSnapshot;n=n.value;try{var i=o();return!pr(n,i)}catch{return!0}}function tj(n){var o=el(n,2);o!==null&&er(o,n,2)}function Yx(n){var o=Us();if(typeof n=="function"){var i=n;if(n=i(),dl){Ht(!0);try{i()}finally{Ht(!1)}}}return o.memoizedState=o.baseState=n,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:n},o}function nj(n,o,i,d){return n.baseState=i,Gx(n,mn,typeof d=="function"?d:ha)}function nD(n,o,i,d,y){if(hm(n))throw Error(a(485));if(n=o.action,n!==null){var w={payload:y,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};ie.T!==null?i(!0):w.isTransition=!1,d(w),i=o.pending,i===null?(w.next=o.pending=w,sj(o,w)):(w.next=i.next,o.pending=i.next=w)}}function sj(n,o){var i=o.action,d=o.payload,y=n.state;if(o.isTransition){var w=ie.T,D={};D.types=w!==null?w.types:null,ie.T=D;try{var K=i(y,d),le=ie.S;le!==null&&le(D,K),rj(n,o,K)}catch(xe){Kx(n,o,xe)}finally{w!==null&&D.types!==null&&(w.types=D.types),ie.T=w}}else try{w=i(y,d),rj(n,o,w)}catch(xe){Kx(n,o,xe)}}function rj(n,o,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(d){oj(n,o,d)},function(d){return Kx(n,o,d)}):oj(n,o,i)}function oj(n,o,i){o.status="fulfilled",o.value=i,aj(o),n.state=i,o=n.pending,o!==null&&(i=o.next,i===o?n.pending=null:(i=i.next,o.next=i,sj(n,i)))}function Kx(n,o,i){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do o.status="rejected",o.reason=i,aj(o),o=o.next;while(o!==d)}n.action=null}function aj(n){n=n.listeners;for(var o=0;o<n.length;o++)(0,n[o])()}function ij(n,o){return o}function lj(n,o){if(Vt){var i=yn.formState;if(i!==null){e:{var d=It;if(Vt){if(Sn){t:{for(var y=Sn,w=_r;y.nodeType!==8;){if(!w){y=null;break t}if(y=Br(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){Sn=Br(y.nextSibling),d=y.data==="F!";break e}}ei(d)}d=!1}d&&(o=i[0])}}return i=Us(),i.memoizedState=i.baseState=o,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ij,lastRenderedState:o},i.queue=d,i=Tj.bind(null,It,d),d.dispatch=i,d=Yx(!1),w=eb.bind(null,It,!1,d.queue),d=Us(),y={state:o,dispatch:null,action:n,pending:null},d.queue=y,i=nD.bind(null,It,y,w,i),y.dispatch=i,d.memoizedState=n,[o,i,!1]}function cj(n){var o=Fn();return uj(o,mn,n)}function uj(n,o,i){if(o=Gx(n,o,ij)[0],n=dm(ha)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var d=Yu(o)}catch(D){throw D===fc?tm:D}else d=o;o=Fn();var y=o.queue,w=y.dispatch;return i!==o.memoizedState&&(It.flags|=2048,gc(9,{destroy:void 0},sD.bind(null,y,i),null)),[d,w,n]}function sD(n,o){n.action=o}function dj(n){var o=Fn(),i=mn;if(i!==null)return uj(o,i,n);Fn(),o=o.memoizedState,i=Fn();var d=i.queue.dispatch;return i.memoizedState=n,[o,d,!1]}function gc(n,o,i,d){return n={tag:n,create:i,deps:d,inst:o,next:null},o=It.updateQueue,o===null&&(o=cm(),It.updateQueue=o),i=o.lastEffect,i===null?o.lastEffect=n.next=n:(d=i.next,i.next=n,n.next=d,o.lastEffect=n),n}function fj(){return Fn().memoizedState}function fm(n,o,i,d){var y=Us();It.flags|=n,y.memoizedState=gc(1|o,{destroy:void 0},i,d===void 0?null:d)}function mm(n,o,i,d){var y=Fn();d=d===void 0?null:d;var w=y.memoizedState.inst;mn!==null&&d!==null&&Bx(d,mn.memoizedState.deps)?y.memoizedState=gc(o,w,i,d):(It.flags|=n,y.memoizedState=gc(1|o,w,i,d))}function mj(n,o){fm(8390656,8,n,o)}function Xx(n,o){mm(2048,8,n,o)}function rD(n){It.flags|=4;var o=It.updateQueue;if(o===null)o=cm(),It.updateQueue=o,o.events=[n];else{var i=o.events;i===null?o.events=[n]:i.push(n)}}function hj(n){var o=Fn().memoizedState;return rD({ref:o,nextImpl:n}),function(){if((nn&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}function pj(n,o){return mm(4,2,n,o)}function gj(n,o){return mm(4,4,n,o)}function xj(n,o){if(typeof o=="function"){n=n();var i=o(n);return function(){typeof i=="function"?i():o(null)}}if(o!=null)return n=n(),o.current=n,function(){o.current=null}}function bj(n,o,i){i=i!=null?i.concat([n]):null,mm(4,4,xj.bind(null,o,n),i)}function Wx(){}function yj(n,o){var i=Fn();o=o===void 0?null:o;var d=i.memoizedState;return o!==null&&Bx(o,d[1])?d[0]:(i.memoizedState=[n,o],n)}function vj(n,o){var i=Fn();o=o===void 0?null:o;var d=i.memoizedState;if(o!==null&&Bx(o,d[1]))return d[0];if(d=n(),dl){Ht(!0);try{n()}finally{Ht(!1)}}return i.memoizedState=[d,o],d}function Qx(n,o,i){return i===void 0||(ma&1073741824)!==0&&(Kt&261930)===0?n.memoizedState=o:(n.memoizedState=i,n=AS(),It.lanes|=n,fi|=n,i)}function wj(n,o,i,d){return pr(i,o)?i:ai.current!==null?(n=Qx(n,i,d),pr(n,o)||(Zn=!0),n):(ma&106)===0||(ma&1073741824)!==0&&(Kt&261930)===0?(Zn=!0,n.memoizedState=i):(n=AS(),It.lanes|=n,fi|=n,o)}function jj(n,o,i,d,y){var w=oe.p;oe.p=w!==0&&8>w?w:8;var D=ie.T,K={};K.types=D!==null?D.types:null,ie.T=K,eb(n,!1,o,i);try{var le=y(),xe=ie.S;if(xe!==null&&xe(K,le),le!==null&&typeof le=="object"&&typeof le.then=="function"){var Ce=J4(le,d);Ku(n,o,Ce,vr(n))}else Ku(n,o,d,vr(n))}catch(ze){Ku(n,o,{then:function(){},status:"rejected",reason:ze},vr())}finally{oe.p=w,D!==null&&K.types!==null&&(D.types=K.types),ie.T=D}}function oD(){}function Zx(n,o,i,d){if(n.tag!==5)throw Error(a(476));var y=Sj(n).queue;jj(n,y,o,Z,i===null?oD:function(){return Nj(n),i(d)})}function Sj(n){var o=n.memoizedState;if(o!==null)return o;o={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:Z},next:null};var i={};return o.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:i},next:null},n.memoizedState=o,n=n.alternate,n!==null&&(n.memoizedState=o),o}function Nj(n){var o=Sj(n);o.next===null&&(o=n.alternate.memoizedState),Ku(n,o.next.queue,{},vr())}function Jx(){return Ts(Pc)}function Cj(){return Fn().memoizedState}function kj(){return Fn().memoizedState}function aD(n){for(var o=n.return;o!==null;){switch(o.tag){case 24:case 3:var i=vr();n=ri(i);var d=oi(o,n,i);d!==null&&(er(d,o,i),Uu(d,o,i)),o={cache:Tx()},n.payload=o;return}o=o.return}}function iD(n,o,i){var d=vr();i={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},hm(n)?Ej(o,i):(i=bx(n,o,i,d),i!==null&&(er(i,n,d),Rj(i,o,d)))}function Tj(n,o,i){var d=vr();Ku(n,o,i,d)}function Ku(n,o,i,d){var y={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(hm(n))Ej(o,y);else{var w=n.alternate;if(n.lanes===0&&(w===null||w.lanes===0)&&(w=o.lastRenderedReducer,w!==null))try{var D=o.lastRenderedState,K=w(D,i);if(y.hasEagerState=!0,y.eagerState=K,pr(K,D))return Gf(n,o,y,0),yn===null&&Ff(),!1}catch{}finally{}if(i=bx(n,o,y,d),i!==null)return er(i,n,d),Rj(i,o,d),!0}return!1}function eb(n,o,i,d){if(d={lane:2,revertLane:Fb(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},hm(n)){if(o)throw Error(a(479))}else o=bx(n,i,d,2),o!==null&&er(o,n,2)}function hm(n){var o=n.alternate;return n===It||o!==null&&o===It}function Ej(n,o){hc=im=!0;var i=n.pending;i===null?o.next=o:(o.next=i.next,i.next=o),n.pending=o}function Rj(n,o,i){if((i&4194048)!==0){var d=o.lanes;d&=n.pendingLanes,i|=d,o.lanes=i,cr(n,i)}}var pm={readContext:Ts,use:um,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useLayoutEffect:Bn,useInsertionEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useSyncExternalStore:Bn,useId:Bn,useHostTransitionStatus:Bn,useFormState:Bn,useActionState:Bn,useOptimistic:Bn,useMemoCache:Bn,useCacheRefresh:Bn,useEffectEvent:Bn},Aj={readContext:Ts,use:um,useCallback:function(n,o){return Us().memoizedState=[n,o===void 0?null:o],n},useContext:Ts,useEffect:mj,useImperativeHandle:function(n,o,i){i=i!=null?i.concat([n]):null,fm(4194308,4,xj.bind(null,o,n),i)},useLayoutEffect:function(n,o){return fm(4194308,4,n,o)},useInsertionEffect:function(n,o){fm(4,2,n,o)},useMemo:function(n,o){var i=Us();o=o===void 0?null:o;var d=n();if(dl){Ht(!0);try{n()}finally{Ht(!1)}}return i.memoizedState=[d,o],d},useReducer:function(n,o,i){var d=Us();if(i!==void 0){var y=i(o);if(dl){Ht(!0);try{i(o)}finally{Ht(!1)}}}else y=o;return d.memoizedState=d.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},d.queue=n,n=n.dispatch=iD.bind(null,It,n),[d.memoizedState,n]},useRef:function(n){var o=Us();return n={current:n},o.memoizedState=n},useState:function(n){n=Yx(n);var o=n.queue,i=Tj.bind(null,It,o);return o.dispatch=i,[n.memoizedState,i]},useDebugValue:Wx,useDeferredValue:function(n,o){var i=Us();return Qx(i,n,o)},useTransition:function(){var n=Yx(!1);return n=jj.bind(null,It,n.queue,!0,!1),Us().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,o,i){var d=It,y=Us();if(Vt){if(i===void 0)throw Error(a(407));i=i()}else{if(i=o(),yn===null)throw Error(a(349));(Kt&127)!==0||Q2(d,o,i)}y.memoizedState=i;var w={value:i,getSnapshot:o};return y.queue=w,mj(J2.bind(null,d,w,n),[n]),d.flags|=2048,gc(9,{destroy:void 0},Z2.bind(null,d,w,i,o),null),i},useId:function(){var n=Us(),o=yn.identifierPrefix;if(Vt){var i=Oo,d=Ao;i=(d&~(1<<32-kt(d)-1)).toString(32)+i,o="_"+o+"R_"+i,i=lm++,0<i&&(o+="H"+i.toString(32)),o+="_"}else i=eD++,o="_"+o+"r_"+i.toString(32)+"_";return n.memoizedState=o},useHostTransitionStatus:Jx,useFormState:lj,useActionState:lj,useOptimistic:function(n){var o=Us();o.memoizedState=o.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=i,o=eb.bind(null,It,!0,i),i.dispatch=o,[n,o]},useMemoCache:Fx,useCacheRefresh:function(){return Us().memoizedState=aD.bind(null,It)},useEffectEvent:function(n){var o=Us(),i={impl:n};return o.memoizedState=i,function(){if((nn&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Oj={readContext:Ts,use:um,useCallback:yj,useContext:Ts,useEffect:Xx,useImperativeHandle:bj,useInsertionEffect:pj,useLayoutEffect:gj,useMemo:vj,useReducer:dm,useRef:fj,useState:function(){return dm(ha)},useDebugValue:Wx,useDeferredValue:function(n,o){var i=Fn();return wj(i,mn.memoizedState,n,o)},useTransition:function(){var n=dm(ha)[0],o=Fn().memoizedState;return[typeof n=="boolean"?n:Yu(n),o]},useSyncExternalStore:W2,useId:Cj,useHostTransitionStatus:Jx,useFormState:cj,useActionState:cj,useOptimistic:function(n,o){var i=Fn();return nj(i,mn,n,o)},useMemoCache:Fx,useCacheRefresh:kj,useEffectEvent:hj},lD={readContext:Ts,use:um,useCallback:yj,useContext:Ts,useEffect:Xx,useImperativeHandle:bj,useInsertionEffect:pj,useLayoutEffect:gj,useMemo:vj,useReducer:qx,useRef:fj,useState:function(){return qx(ha)},useDebugValue:Wx,useDeferredValue:function(n,o){var i=Fn();return mn===null?Qx(i,n,o):wj(i,mn.memoizedState,n,o)},useTransition:function(){var n=qx(ha)[0],o=Fn().memoizedState;return[typeof n=="boolean"?n:Yu(n),o]},useSyncExternalStore:W2,useId:Cj,useHostTransitionStatus:Jx,useFormState:dj,useActionState:dj,useOptimistic:function(n,o){var i=Fn();return mn!==null?nj(i,mn,n,o):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:Fx,useCacheRefresh:kj,useEffectEvent:hj};function tb(n,o,i,d){o=n.memoizedState,i=i(d,o),i=i==null?o:A({},o,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var nb={enqueueSetState:function(n,o,i){n=n._reactInternals;var d=vr(),y=ri(d);y.payload=o,i!=null&&(y.callback=i),o=oi(n,y,d),o!==null&&(er(o,n,d),Uu(o,n,d))},enqueueReplaceState:function(n,o,i){n=n._reactInternals;var d=vr(),y=ri(d);y.tag=1,y.payload=o,i!=null&&(y.callback=i),o=oi(n,y,d),o!==null&&(er(o,n,d),Uu(o,n,d))},enqueueForceUpdate:function(n,o){n=n._reactInternals;var i=vr(),d=ri(i);d.tag=2,o!=null&&(d.callback=o),o=oi(n,d,i),o!==null&&(er(o,n,i),Uu(o,n,i))}};function Mj(n,o,i,d,y,w,D){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,w,D):o.prototype&&o.prototype.isPureReactComponent?!zu(i,d)||!zu(y,w):!0}function Dj(n,o,i,d){n=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(i,d),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(i,d),o.state!==n&&nb.enqueueReplaceState(o,o.state,null)}function fl(n,o){var i=o;if("ref"in o){i={};for(var d in o)d!=="ref"&&(i[d]=o[d])}if(n=n.defaultProps){i===o&&(i=A({},i));for(var y in n)i[y]===void 0&&(i[y]=n[y])}return i}function zj(n){Hf(n)}function Pj(n){console.error(n)}function Ij(n){Hf(n)}function gm(n,o){try{var i=n.onUncaughtError;i(o.value,{componentStack:o.stack})}catch(d){setTimeout(function(){throw d})}}function _j(n,o,i){try{var d=n.onCaughtError;d(i.value,{componentStack:i.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function sb(n,o,i){return i=ri(i),i.tag=3,i.payload={element:null},i.callback=function(){gm(n,o)},i}function Lj(n){return n=ri(n),n.tag=3,n}function Bj(n,o,i,d){var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var w=d.value;n.payload=function(){return y(w)},n.callback=function(){_j(o,i,d)}}var D=i.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(n.callback=function(){_j(o,i,d),typeof y!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var K=d.stack;this.componentDidCatch(d.value,{componentStack:K!==null?K:""})})}function cD(n,o,i,d,y){if(i.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(o=i.alternate,o!==null&&rl(o,i,y,!0),i=Es.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Is===null?_m():i.alternate===null&&$n===0&&($n=3),i.flags&=-257,i.flags|=65536,i.lanes=y,d===nm?i.flags|=16384:(o=i.updateQueue,o===null?i.updateQueue=new Set([d]):o.add(d),Vb(n,d,y)),!1;case 22:return i.flags|=65536,d===nm?i.flags|=16384:(o=i.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([d])},i.updateQueue=o):(i=o.retryQueue,i===null?o.retryQueue=new Set([d]):i.add(d)),Vb(n,d,y)),!1}throw Error(a(435,i.tag))}return Vb(n,d,y),_m(),!1}if(Vt)return o=Es.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=y,d!==Sx&&(n=Error(a(422),{cause:d}),_u(zr(n,i)))):(d!==Sx&&(o=Error(a(423),{cause:d}),_u(zr(o,i))),n=n.current.alternate,n.flags|=65536,y&=-y,n.lanes|=y,d=zr(d,i),y=sb(n.stateNode,d,y),Dx(n,y),$n!==4&&($n=2)),!1;var w=Error(a(520),{cause:d});if(w=zr(w,i),nd===null?nd=[w]:nd.push(w),$n!==4&&($n=2),o===null)return!0;d=zr(d,i),i=o;do{switch(i.tag){case 3:return i.flags|=65536,n=y&-y,i.lanes|=n,n=sb(i.stateNode,d,n),Dx(i,n),!1;case 1:if(o=i.type,w=i.stateNode,(i.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(mi===null||!mi.has(w))))return i.flags|=65536,y&=-y,i.lanes|=y,y=Lj(y),Bj(y,n,i,d),Dx(i,y),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var rb=Error(a(461)),Zn=!1;function ns(n,o,i,d){o.child=n===null?H2(o,null,i,d):ul(o,n.child,i,d)}function $j(n,o,i,d,y){i=i.render;var w=o.ref;if("ref"in d){var D={};for(var K in d)K!=="ref"&&(D[K]=d[K])}else D=d;return ol(o),d=$x(n,o,i,D,w,y),K=Vx(),n!==null&&!Zn?(Ux(n,o,y),pa(n,o,y)):(Vt&&K&&Xf(o),o.flags|=1,ns(n,o,d,y),o.child)}function Vj(n,o,i,d,y){if(n===null){var w=i.type;return typeof w=="function"&&!yx(w)&&w.defaultProps===void 0&&i.compare===null?(o.tag=15,o.type=w,Uj(n,o,w,d,y)):(n=Yf(i.type,null,d,o,o.mode,y),n.ref=o.ref,n.return=o,o.child=n)}if(w=n.child,!fb(n,y)){var D=w.memoizedProps;if(i=i.compare,i=i!==null?i:zu,i(D,d)&&n.ref===o.ref)return pa(n,o,y)}return o.flags|=1,n=ca(w,d),n.ref=o.ref,n.return=o,o.child=n}function Uj(n,o,i,d,y){if(n!==null){var w=n.memoizedProps;if(zu(w,d)&&n.ref===o.ref)if(Zn=!1,o.pendingProps=d=w,fb(n,y))(n.flags&131072)!==0&&(Zn=!0);else return o.lanes=n.lanes,pa(n,o,y)}return ob(n,o,i,d,y)}function Hj(n,o,i,d){var y=d.children,w=n!==null?n.memoizedState:null;if(n===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((o.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,n!==null){for(d=o.child=n.child,y=0;d!==null;)y=y|d.lanes|d.childLanes,d=d.sibling;d=y&~w}else d=0,o.child=null;return Fj(n,o,w,i,d)}if((i&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},n!==null&&em(o,w!==null?w.cachePool:null),w!==null?q2(o,w):Px(),Y2(o);else return d=o.lanes=536870912,Fj(n,o,w!==null?w.baseLanes|i:i,i,d)}else w!==null?(em(o,w.cachePool),q2(o,w),li(),o.memoizedState=null):(n!==null&&em(o,null),Px(),li());return ns(n,o,y,i),o.child}function Xu(n,o){return n!==null&&n.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Fj(n,o,i,d,y){var w=Rx();return w=w===null?null:{parent:Wn._currentValue,pool:w},o.memoizedState={baseLanes:i,cachePool:w},n!==null&&em(o,null),Px(),Y2(o),n!==null&&rl(n,o,d,!0),o.childLanes=y,null}function xm(n,o){return o=bm({mode:o.mode,children:o.children},n.mode),o.ref=n.ref,n.child=o,o.return=n,o}function Gj(n,o,i){return ul(o,n.child,null,i),n=xm(o,o.pendingProps),n.flags|=2,gr(o),o.memoizedState=null,n}function uD(n,o,i){var d=o.pendingProps,y=(o.flags&128)!==0;if(o.flags&=-129,n===null){if(Vt){if(d.mode==="hidden")return n=xm(o,d),o.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Xu(null,n);if(_x(o),(n=Sn)?(n=xN(n,_r),n=n!==null&&n.data==="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:Za!==null?{id:Ao,overflow:Oo}:null,retryLane:536870912,hydrationErrors:null},i=E2(n),i.return=o,o.child=i,xs=o,Sn=null)):n=null,n===null)throw ei(o);return o.lanes=536870912,null}return xm(o,d)}var w=n.memoizedState;if(w!==null){var D=w.dehydrated;if(_x(o),y)if(o.flags&256)o.flags&=-257,o=Gj(n,o,i);else if(o.memoizedState!==null)o.child=n.child,o.flags|=128,o=null;else throw Error(a(558));else if(Zn||rl(n,o,i,!1),y=(i&n.childLanes)!==0,Zn||y){if(ai.current===null){if(d=yn,d!==null&&(D=Ss(d,i),D!==0&&D!==w.retryLane))throw w.retryLane=D,el(n,D),er(d,n,D),rb;_m()}o=Gj(n,o,i)}else n=w.treeContext,Sn=Br(D.nextSibling),xs=o,Vt=!0,Ja=null,_r=!1,n!==null&&O2(o,n),o=xm(o,d),o.flags|=134221824;return o}return n=ca(n.child,{mode:d.mode,children:d.children}),n.ref=o.ref,o.child=n,n.return=o,n}function xc(n,o){var i=o.ref;if(i===null)n!==null&&n.ref!==null&&(o.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(n===null||n.ref!==i)&&(o.flags|=4194816)}}function ob(n,o,i,d,y){return ol(o),i=$x(n,o,i,d,void 0,y),d=Vx(),n!==null&&!Zn?(Ux(n,o,y),pa(n,o,y)):(Vt&&d&&Xf(o),o.flags|=1,ns(n,o,i,y),o.child)}function qj(n,o,i,d,y,w){return ol(o),o.updateQueue=null,i=X2(o,d,i,y),K2(n),d=Vx(),n!==null&&!Zn?(Ux(n,o,w),pa(n,o,w)):(Vt&&d&&Xf(o),o.flags|=1,ns(n,o,i,w),o.child)}function Yj(n,o,i,d,y){if(ol(o),o.stateNode===null){var w=ic,D=i.contextType;typeof D=="object"&&D!==null&&(w=Ts(D)),w=new i(d,w),o.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=nb,o.stateNode=w,w._reactInternals=o,w=o.stateNode,w.props=d,w.state=o.memoizedState,w.refs={},Ox(o),D=i.contextType,w.context=typeof D=="object"&&D!==null?Ts(D):ic,w.state=o.memoizedState,D=i.getDerivedStateFromProps,typeof D=="function"&&(tb(o,i,D,d),w.state=o.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(D=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),D!==w.state&&nb.enqueueReplaceState(w,w.state,null),Fu(o,d,w,y),Hu(),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308),d=!0}else if(n===null){w=o.stateNode;var K=o.memoizedProps,le=fl(i,K);w.props=le;var xe=w.context,Ce=i.contextType;D=ic,typeof Ce=="object"&&Ce!==null&&(D=Ts(Ce));var ze=i.getDerivedStateFromProps;Ce=typeof ze=="function"||typeof w.getSnapshotBeforeUpdate=="function",K=o.pendingProps!==K,Ce||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(K||xe!==D)&&Dj(o,w,d,D),si=!1;var he=o.memoizedState;w.state=he,Fu(o,d,w,y),Hu(),xe=o.memoizedState,K||he!==xe||si?(typeof ze=="function"&&(tb(o,i,ze,d),xe=o.memoizedState),(le=si||Mj(o,i,le,d,he,xe,D))?(Ce||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(o.flags|=4194308)):(typeof w.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=d,o.memoizedState=xe),w.props=d,w.state=xe,w.context=D,d=le):(typeof w.componentDidMount=="function"&&(o.flags|=4194308),d=!1)}else{w=o.stateNode,Mx(n,o),D=o.memoizedProps,Ce=fl(i,D),w.props=Ce,ze=o.pendingProps,he=w.context,xe=i.contextType,le=ic,typeof xe=="object"&&xe!==null&&(le=Ts(xe)),K=i.getDerivedStateFromProps,(xe=typeof K=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==ze||he!==le)&&Dj(o,w,d,le),si=!1,he=o.memoizedState,w.state=he,Fu(o,d,w,y),Hu();var we=o.memoizedState;D!==ze||he!==we||si||n!==null&&n.dependencies!==null&&Zf(n.dependencies)?(typeof K=="function"&&(tb(o,i,K,d),we=o.memoizedState),(Ce=si||Mj(o,i,Ce,d,he,we,le)||n!==null&&n.dependencies!==null&&Zf(n.dependencies))?(xe||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(d,we,le),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(d,we,le)),typeof w.componentDidUpdate=="function"&&(o.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(o.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(o.flags|=1024),o.memoizedProps=d,o.memoizedState=we),w.props=d,w.state=we,w.context=le,d=Ce):(typeof w.componentDidUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(o.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(o.flags|=1024),d=!1)}return w=d,xc(n,o),d=(o.flags&128)!==0,w||d?(w=o.stateNode,i=d&&typeof i.getDerivedStateFromError!="function"?null:w.render(),o.flags|=1,n!==null&&d?(o.child=ul(o,n.child,null,y),o.child=ul(o,null,i,y)):ns(n,o,i,y),o.memoizedState=w.state,n=o.child):n=pa(n,o,y),n}function Kj(n,o,i,d){return nl(),o.flags|=256,ns(n,o,i,d),o.child}var ab={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ib(n){return{baseLanes:n,cachePool:_2()}}function lb(n,o,i){return n=n!==null?n.childLanes&~i:0,o&&(n|=yr),n}function Xj(n,o,i){var d=o.pendingProps,y=!1,w=(o.flags&128)!==0,D;if((D=w)||(D=n!==null&&n.memoizedState===null?!1:(Rs.current&2)!==0),D&&(y=!0,o.flags&=-129),D=(o.flags&32)!==0,o.flags&=-33,n===null){if(Vt){if(y?ii(o):li(),(n=Sn)?(n=xN(n,_r),n=n!==null&&n.data!=="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:Za!==null?{id:Ao,overflow:Oo}:null,retryLane:536870912,hydrationErrors:null},i=E2(n),i.return=o,o.child=i,xs=o,Sn=null)):n=null,n===null)throw ei(o);return i0(n)?o.lanes=32:o.lanes=536870912,null}return w=d.children,d=d.fallback,y?(li(),y=o.mode,w=bm({mode:"hidden",children:w},y),d=tl(d,y,i,null),w.return=o,d.return=o,w.sibling=d,o.child=w,d=o.child,d.memoizedState=ib(i),d.childLanes=lb(n,D,i),o.memoizedState=ab,Xu(null,d)):(ii(o),cb(o,w))}var K=n.memoizedState;if(K!==null){var le=K.dehydrated;if(le!==null)return dD(n,o,w,D,d,le,K,i)}return y?(li(),y=d.fallback,w=o.mode,K=n.child,le=K.sibling,d=ca(K,{mode:"hidden",children:d.children}),d.subtreeFlags=K.subtreeFlags&1206910976,le!==null?y=ca(le,y):(y=tl(y,w,i,null),y.flags|=2),y.return=o,d.return=o,d.sibling=y,o.child=d,Xu(null,d),d=o.child,y=n.child.memoizedState,y===null?y=ib(i):(w=y.cachePool,w!==null?(K=Wn._currentValue,w=w.parent!==K?{parent:K,pool:K}:w):w=_2(),y={baseLanes:y.baseLanes|i,cachePool:w}),d.memoizedState=y,d.childLanes=lb(n,D,i),o.memoizedState=ab,Xu(n.child,d)):(ii(o),i=n.child,n=i.sibling,i=ca(i,{mode:"visible",children:d.children}),i.return=o,i.sibling=null,n!==null&&(D=o.deletions,D===null?(o.deletions=[n],o.flags|=16):D.push(n)),o.child=i,o.memoizedState=null,i)}function cb(n,o){return o=bm({mode:"visible",children:o},n.mode),o.return=n,n.child=o}function bm(n,o){return n=Ws(22,n,null,o),n.lanes=0,n}function ym(n,o,i){return ul(o,n.child,null,i),n=cb(o,o.pendingProps.children),n.flags|=2,o.memoizedState=null,n}function dD(n,o,i,d,y,w,D,K){if(i)return o.flags&256?(ii(o),o.flags&=-257,ym(n,o,K)):o.memoizedState!==null?(li(),o.child=n.child,o.flags|=128,null):(li(),w=y.fallback,D=o.mode,y=bm({mode:"visible",children:y.children},D),w=tl(w,D,K,null),w.flags|=2,y.return=o,w.return=o,y.sibling=w,o.child=y,ul(o,n.child,null,K),y=o.child,y.memoizedState=ib(K),y.childLanes=lb(n,d,K),o.memoizedState=ab,Xu(null,y));if(ii(o),i0(w)){if(d=w.nextSibling&&w.nextSibling.dataset,d)var le=d.dgst;return d=le,d!==""&&(y=Error(a(419)),y.stack="",y.digest=d,_u({value:y,source:null,stack:null})),ym(n,o,K)}if(Zn||rl(n,o,K,!1),d=(K&n.childLanes)!==0,Zn||d){if(ai.current!==null)return ym(n,o,K);if(d=yn,d!==null&&(y=Ss(d,K),y!==0&&y!==D.retryLane))throw D.retryLane=y,el(n,y),er(d,n,y),rb;return a0(w)||_m(),ym(n,o,K)}return a0(w)?(o.flags|=192,o.child=n.child,null):(n=D.treeContext,Sn=Br(w.nextSibling),xs=o,Vt=!0,Ja=null,_r=!1,n!==null&&O2(o,n),o=cb(o,y.children),o.flags|=134221824,o)}function Wj(n,o,i){n.lanes|=o;var d=n.alternate;d!==null&&(d.lanes|=o),Qf(n.return,o,i)}function Qj(n){for(var o=null;n!==null;){var i=n.alternate;i!==null&&am(i)===null&&(o=n),n=n.sibling}return o}function vm(n,o,i,d,y,w){var D=n.memoizedState;D===null?n.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:d,tail:i,tailMode:y,treeForkCount:w}:(D.isBackwards=o,D.rendering=null,D.renderingStartTime=0,D.last=d,D.tail=i,D.tailMode=y,D.treeForkCount=w)}function ub(n){var o=n.child;for(n.child=null;o!==null;){var i=o.sibling;o.sibling=n.child,n.child=o,o=i}}function db(n,o,i){var d=o.pendingProps,y=d.revealOrder,w=d.tail;d=d.children;var D=Rs.current;if(o.flags&128)return Gu(o,D),null;var K=(D&2)!==0;if(K?(D=D&1|2,o.flags|=128):D&=1,Gu(o,D),y==="backwards"&&n!==null?(ub(n),ns(n,o,d,i),ub(n)):ns(n,o,d,i),d=Vt?Iu:0,!K&&n!==null&&(n.flags&128)!==0)e:for(n=o.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Wj(n,i,o);else if(n.tag===19)Wj(n,i,o);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===o)break e;for(;n.sibling===null;){if(n.return===null||n.return===o)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(y){case"backwards":i=Qj(o.child),i===null?(y=o.child,o.child=null):(y=i.sibling,i.sibling=null,ub(o)),vm(o,!0,y,null,w,d);break;case"unstable_legacy-backwards":for(i=null,y=o.child,o.child=null;y!==null;){if(n=y.alternate,n!==null&&am(n)===null){o.child=y;break}n=y.sibling,y.sibling=i,i=y,y=n}vm(o,!0,i,null,w,d);break;case"together":vm(o,!1,null,null,void 0,d);break;case"independent":o.memoizedState=null;break;default:i=Qj(o.child),i===null?(y=o.child,o.child=null):(y=i.sibling,i.sibling=null),vm(o,!1,y,i,w,d)}return o.child}function Zj(n,o,i){var d=o.pendingProps;return ti(o,o.type,d.value),ns(n,o,d.children,i),o.child}function pa(n,o,i){if(n!==null&&(o.dependencies=n.dependencies),fi|=o.lanes,(i&o.childLanes)===0)if(n!==null){if(rl(n,o,i,!1),(i&o.childLanes)===0)return null}else return null;if(n!==null&&o.child!==n.child)throw Error(a(153));if(o.child!==null){for(n=o.child,i=ca(n,n.pendingProps),o.child=i,i.return=o;n.sibling!==null;)n=n.sibling,i=i.sibling=ca(n,n.pendingProps),i.return=o;i.sibling=null}return o.child}function fb(n,o){return(n.lanes&o)!==0?!0:(n=n.dependencies,!!(n!==null&&Zf(n)))}function fD(n,o,i){switch(o.tag){case 3:We(o,o.stateNode.containerInfo),ti(o,Wn,n.memoizedState.cache),nl();break;case 27:case 5:Fe(o);break;case 4:We(o,o.stateNode.containerInfo);break;case 10:ti(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,_x(o),null;break;case 13:var d=o.memoizedState;if(d!==null){if(d.dehydrated!==null)return ii(o),o.flags|=128,null;d=rl(n,o,i,!1);var y=o.child.childLanes;return d||(i&y)!==0?Xj(n,o,i):(ii(o),n=pa(n,o,i),n!==null?n.sibling:null)}ii(o);break;case 19:if(o.flags&128)return db(n,o,i);if(y=(n.flags&128)!==0,d=(i&o.childLanes)!==0,d||(rl(n,o,i,!1),d=(i&o.childLanes)!==0),y){if(d)return db(n,o,i);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),Gu(o,Rs.current),d)break;return null;case 22:return o.lanes=0,Hj(n,o,i,o.pendingProps);case 24:ti(o,Wn,n.memoizedState.cache)}return pa(n,o,i)}function Jj(n,o,i){if(n!==null)if(n.memoizedProps!==o.pendingProps)Zn=!0;else{if(!fb(n,i)&&(o.flags&128)===0)return Zn=!1,fD(n,o,i);Zn=(n.flags&131072)!==0}else Zn=!1,Vt&&(o.flags&1048576)!==0&&A2(o,Iu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var d=o.pendingProps;if(n=ll(o.elementType),o.type=n,typeof n=="function")yx(n)?(d=fl(n,d),o.tag=1,o=Yj(null,o,n,d,i)):(o.tag=0,o=ob(null,o,n,d,i));else{if(n!=null){var y=n.$$typeof;if(y===H){o.tag=11,o=$j(null,o,n,d,i);break e}else if(y===W){o.tag=14,o=Vj(null,o,n,d,i);break e}else if(y===U){o.tag=10,o.type=n,o=Zj(null,o,i);break e}}throw o=ee(n)||n,Error(a(306,o,""))}}return o;case 0:return ob(n,o,o.type,o.pendingProps,i);case 1:return d=o.type,y=fl(d,o.pendingProps),Yj(n,o,d,y,i);case 3:e:{if(We(o,o.stateNode.containerInfo),n===null)throw Error(a(387));d=o.pendingProps;var w=o.memoizedState;y=w.element,Mx(n,o),Fu(o,d,null,i);var D=o.memoizedState;if(d=D.cache,ti(o,Wn,d),d!==w.cache&&kx(o,[Wn],i,!0),Hu(),d=D.element,w.isDehydrated)if(w={element:d,isDehydrated:!1,cache:D.cache},o.updateQueue.baseState=w,o.memoizedState=w,o.flags&256){o=Kj(n,o,d,i);break e}else if(d!==y){y=zr(Error(a(424)),o),_u(y),o=Kj(n,o,d,i);break e}else{switch(n=o.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Sn=Br(n.firstChild),xs=o,Vt=!0,Ja=null,_r=!0,i=H2(o,null,d,i),o.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling}else{if(nl(),d===y){o=pa(n,o,i);break e}ns(n,o,d,i)}o=o.child}return o;case 26:return xc(n,o),n===null?(i=NN(o.type,null,o.pendingProps,null))?o.memoizedState=i:Vt||(o.stateNode=sN(o.type,o.pendingProps,Te.current,o)):o.memoizedState=NN(o.type,n.memoizedProps,o.pendingProps,n.memoizedState),null;case 27:return Fe(o),n===null&&Vt&&(d=o.stateNode=vN(o.type,o.pendingProps,Te.current),xs=o,_r=!0,y=Sn,gi(o.type)?(l0=y,Sn=Br(d.firstChild)):Sn=y),ns(n,o,o.pendingProps.children,i),xc(n,o),n===null&&(o.flags|=4194304),o.child;case 5:return n===null&&Vt&&((y=d=Sn)&&(d=az(d,o.type,o.pendingProps,_r),d!==null?(o.stateNode=d,xs=o,Sn=Br(d.firstChild),_r=!1,y=!0):y=!1),y||ei(o)),Fe(o),y=o.type,w=o.pendingProps,D=n!==null?n.memoizedProps:null,d=w.children,Jb(y,w)?d=null:D!==null&&Jb(y,D)&&(o.flags|=32),o.memoizedState!==null&&(y=$x(n,o,tD,null,null,i),Pc._currentValue=y),xc(n,o),ns(n,o,d,i),o.child;case 6:return n===null&&Vt&&((n=i=Sn)&&(i=iz(i,o.pendingProps,_r),i!==null?(o.stateNode=i,xs=o,Sn=null,n=!0):n=!1),n||ei(o)),null;case 13:return Xj(n,o,i);case 4:return We(o,o.stateNode.containerInfo),d=o.pendingProps,n===null?o.child=ul(o,null,d,i):ns(n,o,d,i),o.child;case 11:return $j(n,o,o.type,o.pendingProps,i);case 7:return d=o.pendingProps,xc(n,o),ns(n,o,d,i),o.child;case 8:return ns(n,o,o.pendingProps.children,i),o.child;case 12:return ns(n,o,o.pendingProps.children,i),o.child;case 10:return Zj(n,o,i);case 9:return y=o.type._context,d=o.pendingProps.children,ol(o),y=Ts(y),d=d(y),o.flags|=1,ns(n,o,d,i),o.child;case 14:return Vj(n,o,o.type,o.pendingProps,i);case 15:return Uj(n,o,o.type,o.pendingProps,i);case 19:return db(n,o,i);case 31:return uD(n,o,i);case 22:return Hj(n,o,i,o.pendingProps);case 24:return ol(o),d=Ts(Wn),n===null?(y=Rx(),y===null&&(y=yn,w=Tx(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=i),y=w),o.memoizedState={parent:d,cache:y},Ox(o),ti(o,Wn,y)):((n.lanes&i)!==0&&(Mx(n,o),Fu(o,null,null,i),Hu()),y=n.memoizedState,w=o.memoizedState,y.parent!==d?(y={parent:d,cache:d},o.memoizedState=y,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=y),ti(o,Wn,d)):(d=w.cache,ti(o,Wn,d),d!==y.cache&&kx(o,[Wn],i,!0))),ns(n,o,o.pendingProps.children,i),o.child;case 30:return o.stateNode===null&&(o.stateNode={autoName:null,paired:null,clones:null,ref:null}),d=o.pendingProps,d.name!=null&&d.name!=="auto"?o.flags|=n===null?18882560:18874368:Vt&&Xf(o),n!==null&&n.memoizedProps.name!==d.name?o.flags|=4194816:xc(n,o),ns(n,o,d.children,i),o.child;case 29:throw o.pendingProps}throw Error(a(156,o.tag))}function ga(n){n.flags|=4}function mb(n,o,i,d,y){var w;if((w=(n.mode&32)!==0)&&(w=i===null?EN(o,d):EN(o,d)&&(d.src!==i.src||d.srcSet!==i.srcSet)),w){if(n.flags|=16777216,(y&335544128)===y)if(n.stateNode.complete)n.flags|=8192;else if(zS())n.flags|=8192;else throw cl=nm,Ax}else n.flags&=-16777217}function eS(n,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!RN(o))if(zS())n.flags|=8192;else throw cl=nm,Ax}function wm(n,o){o!==null&&(n.flags|=4),n.flags&16384&&(o=n.tag!==22?ps():536870912,n.lanes|=o,jc|=o)}function Wu(n,o){if(!Vt)switch(n.tailMode){case"visible":break;case"collapsed":for(var i=n.tail,d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?o||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null;break;default:for(o=n.tail,i=null;o!==null;)o.alternate!==null&&(i=o),o=o.sibling;i===null?n.tail=null:i.sibling=null}}function Nn(n){var o=n.alternate!==null&&n.alternate.child===n.child,i=0,d=0;if(o)for(var y=n.child;y!==null;)i|=y.lanes|y.childLanes,d|=y.subtreeFlags&1206910976,d|=y.flags&1206910976,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)i|=y.lanes|y.childLanes,d|=y.subtreeFlags,d|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=d,n.childLanes=i,o}function mD(n,o,i){var d=o.pendingProps;switch(jx(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nn(o),null;case 1:return Nn(o),null;case 3:return i=o.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),fa(Wn),Se(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(uc(o)?ga(o):n===null||n.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Nx())),Nn(o),null;case 26:var y=o.type,w=o.memoizedState;return n===null?(ga(o),w!==null?(Nn(o),eS(o,w)):(Nn(o),mb(o,y,null,d,i))):w?w!==n.memoizedState?(ga(o),Nn(o),eS(o,w)):(Nn(o),o.flags&=-16777217):(n=n.memoizedProps,n!==d&&ga(o),Nn(o),mb(o,y,n,d,i)),null;case 27:if(Re(o),i=Te.current,y=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==d&&ga(o);else{if(!d){if(o.stateNode===null)throw Error(a(166));return Nn(o),o.subtreeFlags&=-33554433,null}n=te.current,uc(o)?M2(o):(n=vN(y,d,i),o.stateNode=n,ga(o))}return Nn(o),o.subtreeFlags&=-33554433,null;case 5:if(Re(o),y=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==d&&ga(o);else{if(!d){if(o.stateNode===null)throw Error(a(166));return Nn(o),o.subtreeFlags&=-33554433,null}if(w=te.current,uc(o))M2(o);else{var D=id(Te.current);switch(w){case 1:w=D.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=D.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=D.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=D.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=D.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof d.is=="string"?D.createElement("select",{is:d.is}):D.createElement("select"),d.multiple?w.multiple=!0:d.size&&(w.size=d.size);break;default:w=typeof d.is=="string"?D.createElement(y,{is:d.is}):D.createElement(y)}}w[Mn]=o,w[Ns]=d;e:for(D=o.child;D!==null;){if(D.tag===5||D.tag===6)w.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===o)break e;for(;D.sibling===null;){if(D.return===null||D.return===o)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}o.stateNode=w;e:switch(Os(w,y,d),y){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ga(o)}}return Nn(o),o.subtreeFlags&=-33554433,mb(o,o.type,n===null?null:n.memoizedProps,o.pendingProps,i),null;case 6:if(n&&o.stateNode!=null)n.memoizedProps!==d&&ga(o);else{if(typeof d!="string"&&o.stateNode===null)throw Error(a(166));if(n=Te.current,uc(o)){if(n=o.stateNode,i=o.memoizedProps,d=null,y=xs,y!==null)switch(y.tag){case 27:case 5:d=y.memoizedProps}n[Mn]=o,n=!!(n.nodeValue===i||d!==null&&d.suppressHydrationWarning===!0||JS(n.nodeValue,i)),n||ei(o,!0)}else n=id(n).createTextNode(d),n[Mn]=o,o.stateNode=n}return Nn(o),null;case 31:if(i=o.memoizedState,n===null||n.memoizedState!==null){if(d=uc(o),i!==null){if(n===null){if(!d)throw Error(a(318));if(n=o.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Mn]=o}else nl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Nn(o),n=!1}else i=Nx(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return o.flags&256?(gr(o),o):(gr(o),null);if((o.flags&128)!==0)throw Error(a(558))}return Nn(o),null;case 13:if(d=o.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=uc(o),d!==null&&d.dehydrated!==null){if(n===null){if(!y)throw Error(a(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(a(317));y[Mn]=o}else nl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Nn(o),y=!1}else y=Nx(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(gr(o),o):(gr(o),null)}return gr(o),(o.flags&128)!==0?(o.lanes=i,o):(i=d!==null,n=n!==null&&n.memoizedState!==null,i&&(d=o.child,y=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(y=d.alternate.memoizedState.cachePool.pool),w=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(w=d.memoizedState.cachePool.pool),w!==y&&(d.flags|=2048)),i!==n&&i&&(o.child.flags|=8192),wm(o,o.updateQueue),Nn(o),null);case 4:return Se(),n===null&&Kb(o.stateNode.containerInfo),o.flags|=67108864,Nn(o),null;case 10:return fa(o.type),Nn(o),null;case 19:if(Lx(o),d=o.memoizedState,d===null)return Nn(o),null;if(y=(o.flags&128)!==0,w=d.rendering,w===null)if(y)Wu(d,!1);else{if($n!==0||n!==null&&(n.flags&128)!==0)for(n=o.child;n!==null;){if(w=am(n),w!==null){for(o.flags|=128,Wu(d,!1),n=w.updateQueue,o.updateQueue=n,wm(o,n),o.subtreeFlags=0,n=i,i=o.child;i!==null;)T2(i,n),i=i.sibling;return Gu(o,Rs.current&1|2),Vt&&ua(o,d.treeForkCount),o.child}n=n.sibling}d.tail!==null&&tt()>Dm&&(o.flags|=128,y=!0,Wu(d,!1),o.lanes=4194304)}else{if(!y)if(n=am(w),n!==null){if(o.flags|=128,y=!0,n=n.updateQueue,o.updateQueue=n,wm(o,n),Wu(d,!0),d.tail===null&&d.tailMode!=="collapsed"&&d.tailMode!=="visible"&&!w.alternate&&!Vt)return Nn(o),null}else 2*tt()-d.renderingStartTime>Dm&&i!==536870912&&(o.flags|=128,y=!0,Wu(d,!1),o.lanes=4194304);d.isBackwards?(w.sibling=o.child,o.child=w):(n=d.last,n!==null?n.sibling=w:o.child=w,d.last=w)}if(d.tail!==null){n=d.tail;e:{for(i=n;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return d.rendering=n,d.tail=n.sibling,d.renderingStartTime=tt(),n.sibling=null,w=Rs.current,w=y?w&1|2:w&1,d.tailMode==="visible"||d.tailMode==="collapsed"||!i||Vt?Gu(o,w):(i=w,Ae(Es,o),Ae(Rs,i),Is===null&&(Is=o)),Vt&&ua(o,d.treeForkCount),n}return Nn(o),null;case 22:case 23:return gr(o),Ix(),d=o.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(o.flags|=8192):d&&(o.flags|=8192),d?(i&536870912)!==0&&(o.flags&128)===0&&(Nn(o),o.subtreeFlags&6&&(o.flags|=8192)):Nn(o),i=o.updateQueue,i!==null&&wm(o,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==i&&(o.flags|=2048),n!==null&&je(il),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),o.memoizedState.cache!==i&&(o.flags|=2048),fa(Wn),Nn(o),null;case 25:return null;case 30:return o.flags|=33554432,Nn(o),null}throw Error(a(156,o.tag))}function hD(n,o){switch(jx(o),o.tag){case 1:return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 3:return fa(Wn),Se(),n=o.flags,(n&65536)!==0&&(n&128)===0?(o.flags=n&-65537|128,o):null;case 26:case 27:case 5:return Re(o),null;case 31:if(o.memoizedState!==null){if(gr(o),o.alternate===null)throw Error(a(340));nl()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 13:if(gr(o),n=o.memoizedState,n!==null&&n.dehydrated!==null){if(o.alternate===null)throw Error(a(340));nl()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 19:return Lx(o),n=o.flags,n&65536?(o.flags=n&-65537|128,n=o.memoizedState,n!==null&&(n.rendering=null,n.tail=null),o.flags|=4,o):null;case 4:return Se(),null;case 10:return fa(o.type),null;case 22:case 23:return gr(o),Ix(),n!==null&&je(il),n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 24:return fa(Wn),null;case 25:return null;default:return null}}function tS(n,o){switch(jx(o),o.tag){case 3:fa(Wn),Se();break;case 26:case 27:case 5:Re(o);break;case 4:Se();break;case 31:o.memoizedState!==null&&gr(o);break;case 13:gr(o);break;case 19:Lx(o);break;case 10:fa(o.type);break;case 22:case 23:gr(o),Ix(),n!==null&&je(il);break;case 24:fa(Wn)}}function Qu(n,o){try{var i=o.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var y=d.next;i=y;do{if((i.tag&n)===n){d=void 0;var w=i.create,D=i.inst;d=w(),D.destroy=d}i=i.next}while(i!==y)}}catch(K){an(o,o.return,K)}}function ci(n,o,i){try{var d=o.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var w=y.next;d=w;do{if((d.tag&n)===n){var D=d.inst,K=D.destroy;if(K!==void 0){D.destroy=void 0,y=o;var le=i,xe=K;try{xe()}catch(Ce){an(y,le,Ce)}}}d=d.next}while(d!==w)}}catch(Ce){an(o,o.return,Ce)}}function nS(n){var o=n.updateQueue;if(o!==null){var i=n.stateNode;try{G2(o,i)}catch(d){an(n,n.return,d)}}}function sS(n,o,i){i.props=fl(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(d){an(n,o,d)}}function Mo(n,o){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:var y=n.stateNode,w=ia(n.memoizedProps,y);(y.ref===null||y.ref.name!==w)&&(y.ref=uN(w)),d=y.ref;break;case 7:if(n.stateNode===null){var D=new wr(n);p(n.child,!1,rz,D,void 0,void 0),n.stateNode=D}d=n.stateNode;break;default:d=n.stateNode}typeof i=="function"?n.refCleanup=i(d):i.current=d}}catch(K){an(n,o,K)}}function As(n,o){var i=n.ref,d=n.refCleanup;if(i!==null)if(typeof d=="function")try{d()}catch(y){an(n,o,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(y){an(n,o,y)}else i.current=null}function jm(n,o){if((n.tag===5||n.tag===27||n.tag===6)&&n.alternate===null&&o!==null)for(var i=0;i<o.length;i++)gN(n.stateNode,o[i])}function rS(n){for(var o=n.return;o!==null&&(pb(o)&&gN(n.stateNode,o.stateNode),!hb(o));)o=o.return}function Zu(n){for(var o=n.return;o!==null&&(pb(o)&&oz(n.stateNode,o.stateNode),!hb(o));)o=o.return}function hb(n){return n.tag===5||n.tag===3||n.tag===27}function pb(n){return n&&n.tag===7&&n.stateNode!==null}function gb(n){var o=n.type,i=n.memoizedProps,d=n.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":i.autoFocus&&d.focus();break e;case"img":i.src?d.src=i.src:i.srcSet&&(d.srcset=i.srcSet)}}catch(y){an(n,n.return,y)}}function xb(n,o,i){try{var d=n.stateNode;$D(d,n.type,i,o),d[Ns]=o}catch(y){an(n,n.return,y)}}function oS(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&gi(n.type)||n.tag===4}function bb(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||oS(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&gi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function yb(n,o,i,d){var y=n.tag;if(y===5||y===6)y=n.stateNode,o?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(y,o):(o=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.appendChild(y),i=i._reactRootContainer,i!=null||o.onclick!==null||(o.onclick=$s)),jm(n,d),St=!0;else if(y!==4&&(y===27&&(jm(n,d),d=null,gi(n.type)&&(i=n.stateNode,o=null)),n=n.child,n!==null))for(yb(n,o,i,d),n=n.sibling;n!==null;)yb(n,o,i,d),n=n.sibling}function Sm(n,o,i,d){var y=n.tag;if(y===5||y===6)y=n.stateNode,o?i.insertBefore(y,o):i.appendChild(y),jm(n,d),St=!0;else if(y!==4&&(y===27&&(jm(n,d),d=null,gi(n.type)&&(i=n.stateNode)),n=n.child,n!==null))for(Sm(n,o,i,d),n=n.sibling;n!==null;)Sm(n,o,i,d),n=n.sibling}function aS(n){var o=n.stateNode,i=n.memoizedProps;try{for(var d=n.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);Os(o,d,i),o[Mn]=n,o[Ns]=i}catch(w){an(n,n.return,w)}}var Nm=!1,xr=null;function iS(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(Nm=!0)}var Do=null;function lS(){var n=Do;return Do=null,n}var Qs=0;function bc(n,o,i,d,y){return Qs=0,cS(n.child,o,i,d,y)}function cS(n,o,i,d,y){for(var w=!1;n!==null;){if(n.tag===5){var D=n.stateNode;if(d!==null){var K=n0(D);d.push(K),K.view&&(w=!0)}else w||n0(D).view&&(w=!0);Nm=!0,lN(D,Qs===0?o:o+"_"+Qs,i),Qs++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&y||cS(n.child,o,i,d,y)&&(w=!0));n=n.sibling}return w}function zo(n,o){for(;n!==null;)n.tag===5?cN(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&o||zo(n.child,o)),n=n.sibling}function Cm(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(Cm(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var o=n.memoizedProps;if(o.name==null||o.name==="auto")throw Error(a(544));var i=o.name;o=la(o.default,o.share),o!=="none"&&(bc(n,i,o,null,!1)||zo(n.child,!1))}n=n.sibling}}function vb(n,o){if(n.tag===30){var i=n.stateNode,d=n.memoizedProps,y=ia(d,i),w=la(d.default,i.paired?d.share:d.enter);w!=="none"?bc(n,y,w,null,!1)?(Cm(n),i.paired||o||kc(n,d.onEnter)):zo(n.child,!1):Cm(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)vb(n,o),n=n.sibling;else Cm(n)}function wb(n){if(xr!==null&&xr.size!==0){var o=xr;if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var i=n.memoizedProps,d=i.name;if(d!=null&&d!=="auto"){var y=o.get(d);if(y!==void 0){var w=la(i.default,i.share);if(w!=="none"&&(bc(n,d,w,null,!1)?(w=n.stateNode,y.paired=w,w.paired=y,kc(n,i.onShare)):zo(n.child,!1)),o.delete(d),o.size===0)break}}}wb(n)}n=n.sibling}}}function jb(n){if(n.tag===30){var o=n.memoizedProps,i=ia(o,n.stateNode),d=xr!==null?xr.get(i):void 0,y=la(o.default,d!==void 0?o.share:o.exit);y!=="none"&&(bc(n,i,y,null,!1)?d!==void 0?(y=n.stateNode,d.paired=y,y.paired=d,xr.delete(i),kc(n,o.onShare)):kc(n,o.onExit):zo(n.child,!1)),xr!==null&&wb(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)jb(n),n=n.sibling;else xr!==null&&wb(n)}function uS(n){for(n=n.child;n!==null;){if(n.tag===30){var o=n.memoizedProps,i=ia(o,n.stateNode);o=la(o.default,o.update),n.flags&=-5,o!=="none"&&bc(n,i,o,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&uS(n);n=n.sibling}}function Sb(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var o=n.stateNode;o.paired!==null&&(o.paired=null,zo(n.child,!1))}Sb(n)}n=n.sibling}}function km(n){if(n.tag===30)n.stateNode.paired=null,zo(n.child,!1),Sb(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)km(n),n=n.sibling;else Sb(n)}function dS(n){for(n=n.child;n!==null;)n.tag===30?zo(n.child,!1):(n.subtreeFlags&33554432)!==0&&dS(n),n=n.sibling}function Nb(n,o,i,d,y,w,D){for(var K=!1;o!==null;){if(o.tag===5){var le=o.stateNode;if(w!==null&&Qs<w.length){var xe=w[Qs],Ce=n0(le);(xe.view||Ce.view)&&(K=!0);var ze;if(ze=(n.flags&4)===0)if(Ce.clip)ze=!0;else{ze=xe.rect;var he=Ce.rect;ze=ze.y!==he.y||ze.x!==he.x||ze.height!==he.height||ze.width!==he.width}ze&&(n.flags|=4),Ce.abs?Ce=!xe.abs:(xe=xe.rect,Ce=Ce.rect,Ce=xe.height!==Ce.height||xe.width!==Ce.width),Ce&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&lN(le,Qs===0?i:i+"_"+Qs,y),K&&(n.flags&4)!==0||(Do===null&&(Do=[]),Do.push(le,Qs===0?d:d+"_"+Qs,o.memoizedProps)),Qs++}else(o.tag!==22||o.memoizedState===null)&&(o.tag===30&&D?n.flags|=o.flags&32:Nb(n,o.child,i,d,y,w,D)&&(K=!0));o=o.sibling}return K}function fS(n,o){for(n=n.child;n!==null;){if(n.tag===30){var i=n.memoizedProps,d=n.stateNode,y=ia(i,d),w=la(i.default,i.update),D;D=n.memoizedState,n.memoizedState=null,d=n;var K=n.child;Qs=0,y=Nb(d,K,y,y,w,D,!1),(n.flags&4)!==0&&y&&kc(n,i.onUpdate)}else(n.subtreeFlags&33554432)!==0&&fS(n);n=n.sibling}}var bs=!1,rn=!1,Po=!1,Cb=!1,mS=typeof WeakSet=="function"?WeakSet:Set,ys=null,Io=!1,Ju=!1,Tm=!1,kb=!1;function pD(n,o,i){if(n=n.containerInfo,Qb=Ic,n=x2(n),fx(n)){if("selectionStart"in n)var d={start:n.selectionStart,end:n.selectionEnd};else e:{d=(d=n.ownerDocument)&&d.defaultView||window;var y=d.getSelection&&d.getSelection();if(y&&y.rangeCount!==0){d=y.anchorNode;var w=y.anchorOffset,D=y.focusNode;y=y.focusOffset;try{d.nodeType,D.nodeType}catch{d=null;break e}var K=0,le=-1,xe=-1,Ce=0,ze=0,he=n,we=null;t:for(;;){for(var et;he!==d||w!==0&&he.nodeType!==3||(le=K+w),he!==D||y!==0&&he.nodeType!==3||(xe=K+y),he.nodeType===3&&(K+=he.nodeValue.length),(et=he.firstChild)!==null;)we=he,he=et;for(;;){if(he===n)break t;if(we===d&&++Ce===w&&(le=K),we===D&&++ze===y&&(xe=K),(et=he.nextSibling)!==null)break;he=we,we=he.parentNode}he=et}d=le===-1||xe===-1?null:{start:le,end:xe}}else d=null}d=d||{start:0,end:0}}else d=null;for(Zb={focusedElem:n,selectionRange:d},Ic=!1,i=(i&335544064)===i,ys=o,o=i?9270:1024;ys!==null;){if(n=ys,i&&(d=n.deletions,d!==null))for(w=0;w<d.length;w++)i&&jb(d[w]);if(n.alternate===null&&(n.flags&2)!==0)i&&iS(n),Em(i);else{if(n.tag===22){if(d=n.alternate,n.memoizedState!==null){d!==null&&d.memoizedState===null&&i&&jb(d),Em(i);continue}else if(d!==null&&d.memoizedState!==null){i&&iS(n),Em(i);continue}}d=n.child,(n.subtreeFlags&o)!==0&&d!==null?(d.return=n,ys=d):(i&&uS(n),Em(i))}}xr=null}function Em(n){for(;ys!==null;){var o=ys,i=n,d=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 15:break;case 1:if((y&1024)!==0&&d!==null){i=void 0,y=d.memoizedProps,d=d.memoizedState;var w=o.stateNode;try{var D=fl(o.type,y);i=w.getSnapshotBeforeUpdate(D,d),w.__reactInternalSnapshotBeforeUpdate=i}catch(K){an(o,o.return,K)}}break;case 3:if((y&1024)!==0){if(d=o.stateNode.containerInfo,i=d.nodeType,i===9)o0(d);else if(i===1)switch(d.nodeName){case"HEAD":case"HTML":case"BODY":o0(d);break;default:d.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&d!==null&&(i=ia(d.memoizedProps,d.stateNode),y=o.memoizedProps,y=la(y.default,y.update),y!=="none"&&bc(d,i,y,d.memoizedState=[],!0));break;default:if((y&1024)!==0)throw Error(a(163))}if(d=o.sibling,d!==null){d.return=o.return,ys=d;break}ys=o.return}}function hS(n,o,i){var d=i.flags;switch(i.tag){case 0:case 11:case 15:_o(n,i),d&4&&Qu(5,i);break;case 1:if(_o(n,i),d&4)if(n=i.stateNode,o===null)try{n.componentDidMount()}catch(D){an(i,i.return,D)}else{var y=fl(i.type,o.memoizedProps);o=o.memoizedState;try{n.componentDidUpdate(y,o,n.__reactInternalSnapshotBeforeUpdate)}catch(D){an(i,i.return,D)}}d&64&&nS(i),d&512&&Mo(i,i.return);break;case 3:if(_o(n,i),d&64&&(n=i.updateQueue,n!==null)){if(o=null,i.child!==null)switch(i.child.tag){case 27:case 5:o=i.child.stateNode;break;case 1:o=i.child.stateNode}try{G2(n,o)}catch(D){an(i,i.return,D)}}break;case 27:o===null&&d&4&&aS(i);case 26:case 5:_o(n,i),o===null&&d&4&&gb(i),d&512&&Mo(i,i.return);break;case 12:_o(n,i);break;case 31:_o(n,i),d&4&&bS(n,i);break;case 13:_o(n,i),d&4&&yS(n,i),d&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=TD.bind(null,i),lz(n,i))));break;case 22:if(d=i.memoizedState!==null||bs,!d){var w=o!==null&&o.memoizedState!==null||rn;o=bs,y=rn,bs=d,(rn=w)&&!y?(d=2,(i.subtreeFlags&8772)!==0&&(d|=1),fo(n,i,d)):_o(n,i),bs=o,rn=y}break;case 30:_o(n,i),d&512&&Mo(i,i.return);break;case 7:d&512&&Mo(i,i.return);default:_o(n,i)}}function Tb(n,o){for(n=n.child;n!==null;)pS(n,o),n=n.sibling}function pS(n,o){switch(n.tag){case 5:case 26:try{var i=n.stateNode;if(o){var d=i.style;typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"}else{var y=n.stateNode,w=n.memoizedProps.style,D=w!=null&&w.hasOwnProperty("display")?w.display:null;y.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(le){an(n,n.return,le)}Eb(n,o);break;case 6:try{n.stateNode.nodeValue=o?"":n.memoizedProps,St=!0}catch(le){an(n,n.return,le)}break;case 18:try{var K=n.stateNode;o?iN(K,!0):iN(n.stateNode,!1)}catch(le){an(n,n.return,le)}break;case 22:case 23:n.memoizedState===null&&Tb(n,o);break;default:Tb(n,o)}}function Eb(n,o){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var i=n,d=o;switch(i.tag){case 4:pS(i,d);break e;case 22:i.memoizedState===null&&Eb(i,d);break e;default:Eb(i,d)}}n=n.sibling}}function gS(n){var o=n.alternate;o!==null&&(n.alternate=null,gS(o)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(o=n.stateNode,o!==null&&Zl(o)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var An=null,Zs=!1;function co(n,o,i){for(i=i.child;i!==null;)xS(n,o,i),i=i.sibling}function xS(n,o,i){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(vt,i)}catch{}switch(i.tag){case 26:rn||As(i,o),co(n,o,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!rn&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:rn||As(i,o),Zu(i);var d=An,y=Zs;gi(i.type)&&(An=i.stateNode,Zs=!1),co(n,o,i),wN(i.stateNode,i.type,i.memoizedProps),An=d,Zs=y;break;case 5:rn||As(i,o),Zu(i);case 6:if(i.tag===6&&Zu(i),d=An,y=Zs,An=null,co(n,o,i),An=d,Zs=y,An!==null)if(Zs)try{(An.nodeType===9?An.body:An.nodeName==="HTML"?An.ownerDocument.body:An).removeChild(i.stateNode),St=!0}catch(w){an(i,o,w)}else try{An.removeChild(i.stateNode),St=!0}catch(w){an(i,o,w)}break;case 18:An!==null&&(Zs?(n=An,aN(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),_c(n)):aN(An,i.stateNode));break;case 4:d=An,y=Zs,An=i.stateNode.containerInfo,Zs=!0,co(n,o,i),An=d,Zs=y;break;case 0:case 11:case 14:case 15:ci(2,i,o),rn||ci(4,i,o),co(n,o,i);break;case 1:rn||(As(i,o),d=i.stateNode,typeof d.componentWillUnmount=="function"&&sS(i,o,d)),co(n,o,i);break;case 21:co(n,o,i);break;case 22:rn=(d=rn)||i.memoizedState!==null,co(n,o,i),rn=d;break;case 30:As(i,o),co(n,o,i);break;case 7:rn||As(i,o),co(n,o,i);break;default:co(n,o,i)}}function bS(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{_c(n)}catch(i){an(o,o.return,i)}}}function yS(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{_c(n)}catch(i){an(o,o.return,i)}}function gD(n){switch(n.tag){case 31:case 13:case 19:var o=n.stateNode;return o===null&&(o=n.stateNode=new mS),o;case 22:return n=n.stateNode,o=n._retryCache,o===null&&(o=n._retryCache=new mS),o;default:throw Error(a(435,n.tag))}}function Rm(n,o){var i=gD(n);o.forEach(function(d){if(!i.has(d)){i.add(d);var y=ED.bind(null,n,d);d.then(y,y)}})}function Hs(n,o,i){var d=o.deletions;if(d!==null)for(var y=0;y<d.length;y++){var w=d[y],D=n,K=o,le=K;e:for(;le!==null;){switch(le.tag){case 27:if(gi(le.type)){An=le.stateNode,Zs=!1;break e}break;case 5:An=le.stateNode,Zs=!1;break e;case 3:case 4:An=le.stateNode.containerInfo,Zs=!0;break e}le=le.return}if(An===null)throw Error(a(160));xS(D,K,w),An=null,Zs=!1,D=w.alternate,D!==null&&(D.return=null),w.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)vS(o,n,i),o=o.sibling}var uo=null;function vS(n,o,i){var d=n.alternate,y=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(y&4&&(d=n.updateQueue,d=d!==null?d.events:null,d!==null))for(var w=0;w<d.length;w++){var D=d[w];D.ref.impl=D.nextImpl}Hs(o,n,i),Fs(n),y&4&&(ci(3,n,n.return),Qu(3,n),ci(5,n,n.return));break;case 1:Hs(o,n,i),Fs(n),y&512&&(rn||d===null||As(d,d.return)),y&64&&bs&&(n=n.updateQueue,n!==null&&(o=n.callbacks,o!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?o:i.concat(o))));break;case 26:if(w=uo,Hs(o,n,i),Fs(n),y&512&&(rn||d===null||As(d,d.return)),y&4)if(y=d!==null?d.memoizedState:null,i=n.memoizedState,d===null)if(i===null)if(n.stateNode===null)if(bs)n.stateNode=sN(n.type,n.memoizedProps,o.containerInfo,n);else{e:{o=n.type,i=n.memoizedProps,y=w.ownerDocument||w;t:switch(o){case"title":d=y.getElementsByTagName("title")[0],(!d||d[Gi]||d[Mn]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=y.createElement(o),y.head.insertBefore(d,y.querySelector("head > title"))),Os(d,o,i),d[Mn]=n,Ve(d),o=d;break e;case"link":if(w=TN("link","href",y).get(o+(i.href||""))){for(D=0;D<w.length;D++)if(d=w[D],d.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&d.getAttribute("rel")===(i.rel==null?null:i.rel)&&d.getAttribute("title")===(i.title==null?null:i.title)&&d.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(D,1);break t}}d=y.createElement(o),Os(d,o,i),y.head.appendChild(d);break;case"meta":if(w=TN("meta","content",y).get(o+(i.content||""))){for(D=0;D<w.length;D++)if(d=w[D],d.getAttribute("content")===(i.content==null?null:""+i.content)&&d.getAttribute("name")===(i.name==null?null:i.name)&&d.getAttribute("property")===(i.property==null?null:i.property)&&d.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&d.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(D,1);break t}}d=y.createElement(o),Os(d,o,i),y.head.appendChild(d);break;default:throw Error(a(468,o))}d[Mn]=n,Ve(d),o=d}n.stateNode=o}else bs||f0(w,n.type,n.stateNode);else n.stateNode=kN(w,i,n.memoizedProps);else y!==i?(y===null?(o=d.stateNode,o===null||rn||o.parentNode.removeChild(o)):y.count--,i===null?bs||f0(w,n.type,n.stateNode):kN(w,i,n.memoizedProps)):i===null&&n.stateNode!==null&&xb(n,n.memoizedProps,d.memoizedProps);break;case 27:Hs(o,n,i),Fs(n),y&512&&(rn||d===null||As(d,d.return)),d!==null&&y&4&&xb(n,n.memoizedProps,d.memoizedProps);break;case 5:if(w=Po,Po=!1,Hs(o,n,i),Po=w,Fs(n),y&512&&(rn||d===null||As(d,d.return)),n.flags&32){o=n.stateNode;try{Bs(o,""),St=!0}catch(Ce){an(n,n.return,Ce)}}y&4&&n.stateNode!=null&&(o=n.memoizedProps,xb(n,o,d!==null?d.memoizedProps:o)),y&1024&&(Cb=!0);break;case 6:if(Hs(o,n,i),Fs(n),y&4){if(n.stateNode===null)throw Error(a(162));o=n.memoizedProps,i=n.stateNode;try{i.nodeValue=o,St=!0}catch(Ce){an(n,n.return,Ce)}}break;case 3:if(St=!1,Fm=null,w=uo,uo=ld(o.containerInfo),Hs(o,n,i),uo=w,Fs(n),y&4&&d!==null&&d.memoizedState.isDehydrated)try{_c(o.containerInfo)}catch(Ce){an(n,n.return,Ce)}Cb&&(Cb=!1,wS(n)),St=!1;break;case 4:y=Po,Po=bs,d=ts(),w=uo,uo=ld(n.stateNode.containerInfo),Hs(o,n,i),Fs(n),uo=w,St&&Ju&&(Tm=!0),St=d,Po=y;break;case 12:Hs(o,n,i),Fs(n);break;case 31:Hs(o,n,i),Fs(n),y&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,Rm(n,o)));break;case 13:Hs(o,n,i),Fs(n),n.child.flags&8192&&n.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Mm=tt()),y&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,Rm(n,o)));break;case 22:w=n.memoizedState!==null,D=d!==null&&d.memoizedState!==null;var K=bs,le=rn,xe=Po;bs=K||w,Po=xe||w,rn=le||D,Hs(o,n,i),rn=le,Po=xe,bs=K,Fs(n),y&8192&&(o=n.stateNode,o._visibility=w?o._visibility&-2:o._visibility|1,!w||d===null||D||bs||rn||(o=D||rn,i=bs,d=rn,bs=w||bs,rn=o,ui(n,2),bs=i,rn=d),!w&&Po||Tb(n,w)),y&4&&(o=n.updateQueue,o!==null&&(i=o.retryQueue,i!==null&&(o.retryQueue=null,Rm(n,i))));break;case 19:Hs(o,n,i),Fs(n),y&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,Rm(n,o)));break;case 30:y&512&&(rn||d===null||As(d,d.return)),y=ts(),w=Ju,D=(i&335544064)===i,K=n.memoizedProps,Ju=D&&la(K.default,K.update)!=="none",Hs(o,n,i),Fs(n),D&&d!==null&&St&&(n.flags|=4),Ju=w,St=y;break;case 21:break;case 7:y&512&&(rn||d===null||As(d,d.return)),d&&d.stateNode!==null&&(d.stateNode._fragmentFiber=n);default:Hs(o,n,i),Fs(n)}}function Fs(n){var o=n.flags;if(o&2){try{for(var i,d=n.return;d!==null;){if(oS(d)){i=d;break}d=d.return}d=null;for(var y=n.return;y!==null;){if(pb(y)){var w=y.stateNode;d===null?d=[w]:d.push(w)}if(hb(y))break;y=y.return}var D=d;if(i==null)throw Error(a(160));switch(i.tag){case 27:var K=i.stateNode,le=bb(n);Sm(n,le,K,D);break;case 5:var xe=i.stateNode;i.flags&32&&(Bs(xe,""),i.flags&=-33);var Ce=bb(n);Sm(n,Ce,xe,D);break;case 3:case 4:var ze=i.stateNode.containerInfo,he=bb(n);yb(n,he,ze,D);break;default:throw Error(a(161))}}catch(we){an(n,n.return,we)}n.flags&=-3}o&4096&&(n.flags&=-4097)}function wS(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var o=n;wS(o),o.tag===5&&o.flags&1024&&(o=o.stateNode,Ic=!0,o.reset(),Ic=!1),n=n.sibling}}function yc(n,o){if(o.subtreeFlags&9270)for(o=o.child;o!==null;)jS(o,n),o=o.sibling;else fS(o)}function jS(n,o){var i=n.alternate;if(i===null)vb(n,!1);else switch(n.tag){case 3:if(kb=Io=!1,lS(),yc(o,n),!Io&&!Tm){if(n=Do,n!==null)for(var d=0;d<n.length;d+=3){i=n[d];var y=n[d+1];cN(i,n[d+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+y+")"})}n=o.containerInfo,n=n.nodeType===9?n.documentElement:n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName===""&&(n.style.viewTransitionName="none",n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),n.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),kb=!0}Do=null;break;case 5:yc(o,n);break;case 4:d=Io,Io=!1,yc(o,n),Io&&(Tm=!0),Io=d;break;case 22:n.memoizedState===null&&(i.memoizedState!==null?vb(n,!1):yc(o,n));break;case 30:d=Io,y=lS(),Io=!1,yc(o,n),Io&&(n.flags|=4);var w=n.memoizedProps,D=n.stateNode;o=ia(w,D),D=ia(i.memoizedProps,D);var K=la(w.default,w.update);K==="none"?o=!1:(w=i.memoizedState,i.memoizedState=null,i=n.child,Qs=0,o=Nb(n,i,o,D,K,w,!0),Qs!==(w===null?0:w.length)&&(n.flags|=32)),(n.flags&4)!==0&&o?(kc(n,n.memoizedProps.onUpdate),Do=y):y!==null&&(y.push.apply(y,Do),Do=y),Io=(n.flags&32)!==0?!0:d;break;default:yc(o,n)}}function _o(n,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)hS(n,o.alternate,o),o=o.sibling}function ui(n,o){for(n=n.child;n!==null;){var i=n,d=o;switch(i.tag){case 0:case 11:case 14:case 15:ci(4,i,i.return),ui(i,d);break;case 1:As(i,i.return);var y=i.stateNode;typeof y.componentWillUnmount=="function"&&sS(i,i.return,y),ui(i,d);break;case 27:(d&2)!==0&&wN(i.stateNode,i.type,i.memoizedProps);case 5:As(i,i.return),i.tag!==5&&i.tag!==27||Zu(i),ui(i,d);break;case 6:Zu(i);break;case 26:As(i,i.return),y=i.stateNode,i.memoizedState!==null||y===null||rn||y.parentNode.removeChild(y),ui(i,d);break;case 22:i.memoizedState===null&&ui(i,d);break;case 30:As(i,i.return),ui(i,d);break;case 7:As(i,i.return);default:ui(i,d)}n=n.sibling}}function fo(n,o,i){for(i=(o.subtreeFlags&8772)!==0?i:i&-2,o=o.child;o!==null;){var d=o.alternate,y=n,w=o,D=w.flags,K=(i&1)!==0;switch(w.tag){case 0:case 11:case 15:fo(y,w,i),Qu(4,w);break;case 1:if(fo(y,w,i),d=w,y=d.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(Ce){an(d,d.return,Ce)}if(d=w,y=d.updateQueue,y!==null){var le=d.stateNode;try{var xe=y.shared.hiddenCallbacks;if(xe!==null)for(y.shared.hiddenCallbacks=null,y=0;y<xe.length;y++)F2(xe[y],le)}catch(Ce){an(d,d.return,Ce)}}K&&D&64&&nS(w),Mo(w,w.return);break;case 27:(i&2)!==0&&aS(w);case 5:w.tag!==5&&w.tag!==27||rS(w),fo(y,w,i),K&&d===null&&D&4&&gb(w),Mo(w,w.return);break;case 6:rS(w);break;case 26:le=w.stateNode,w.memoizedState!==null||le===null||bs||f0(ld(le.ownerDocument),w.type,le),fo(y,w,i),K&&d===null&&D&4&&gb(w),Mo(w,w.return);break;case 12:fo(y,w,i);break;case 31:fo(y,w,i),K&&D&4&&bS(y,w);break;case 13:fo(y,w,i),K&&D&4&&yS(y,w);break;case 22:w.memoizedState===null&&fo(y,w,i),Mo(w,w.return);break;case 30:fo(y,w,i),Mo(w,w.return);break;case 7:Mo(w,w.return);default:fo(y,w,i)}o=o.sibling}}function Rb(n,o){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(n=o.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&Lu(i))}function Ab(n,o){n=null,o.alternate!==null&&(n=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==n&&(o.refCount++,n!=null&&Lu(n))}function Lr(n,o,i,d){var y=(i&335544064)===i;if(o.subtreeFlags&(y?10262:10256))for(o=o.child;o!==null;)SS(n,o,i,d),o=o.sibling;else y&&dS(o)}function SS(n,o,i,d){var y=(i&335544064)===i;y&&o.alternate===null&&o.return!==null&&o.return.alternate!==null&&km(o);var w=o.flags;switch(o.tag){case 0:case 11:case 15:Lr(n,o,i,d),w&2048&&Qu(9,o);break;case 1:Lr(n,o,i,d);break;case 3:Lr(n,o,i,d),y&&kb&&(n=n.containerInfo,n=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,n.style.viewTransitionName==="root"&&(n.style.viewTransitionName=""),n=n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName==="none"&&(n.style.viewTransitionName="")),w&2048&&(w=null,o.alternate!==null&&(w=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==w&&(o.refCount++,w!=null&&Lu(w)));break;case 12:if(w&2048){Lr(n,o,i,d),w=o.stateNode;try{var D=o.memoizedProps,K=D.id,le=D.onPostCommit;typeof le=="function"&&le(K,o.alternate===null?"mount":"update",w.passiveEffectDuration,-0)}catch(xe){an(o,o.return,xe)}}else Lr(n,o,i,d);break;case 31:Lr(n,o,i,d);break;case 13:Lr(n,o,i,d);break;case 23:break;case 22:D=o.stateNode,K=o.alternate,o.memoizedState!==null?(y&&K!==null&&K.memoizedState===null&&km(K),D._visibility&2?Lr(n,o,i,d):ed(n,o)):(y&&K!==null&&K.memoizedState!==null&&km(o),D._visibility&2?Lr(n,o,i,d):(D._visibility|=2,vc(n,o,i,d,(o.subtreeFlags&10256)!==0||!1))),w&2048&&Rb(K,o);break;case 24:Lr(n,o,i,d),w&2048&&Ab(o.alternate,o);break;case 30:y&&(w=o.alternate,w!==null&&(zo(w.child,!0),zo(o.child,!0))),Lr(n,o,i,d);break;default:Lr(n,o,i,d)}}function vc(n,o,i,d,y){for(y=y&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var w=n,D=o,K=i,le=d,xe=D.flags;switch(D.tag){case 0:case 11:case 15:vc(w,D,K,le,y),Qu(8,D);break;case 23:break;case 22:var Ce=D.stateNode;D.memoizedState!==null?Ce._visibility&2?vc(w,D,K,le,y):ed(w,D):(Ce._visibility|=2,vc(w,D,K,le,y)),y&&xe&2048&&Rb(D.alternate,D);break;case 24:vc(w,D,K,le,y),y&&xe&2048&&Ab(D.alternate,D);break;default:vc(w,D,K,le,y)}o=o.sibling}}function ed(n,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var i=n,d=o,y=d.flags;switch(d.tag){case 22:ed(i,d),y&2048&&Rb(d.alternate,d);break;case 24:ed(i,d),y&2048&&Ab(d.alternate,d);break;default:ed(i,d)}o=o.sibling}}var ml=8192;function hl(n,o,i){if(n.subtreeFlags&ml)for(n=n.child;n!==null;)NS(n,o,i),n=n.sibling}function NS(n,o,i){switch(n.tag){case 26:hl(n,o,i),n.flags&ml&&(n.memoizedState!==null?jz(i,uo,n.memoizedState,n.memoizedProps):(n=n.stateNode,(o&335544128)===o&&ON(i,n)));break;case 5:hl(n,o,i),n.flags&ml&&(n=n.stateNode,(o&335544128)===o&&ON(i,n));break;case 3:case 4:var d=uo;uo=ld(n.stateNode.containerInfo),hl(n,o,i),uo=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=ml,ml=16777216,hl(n,o,i),ml=d):hl(n,o,i));break;case 30:if((n.flags&ml)!==0&&(d=n.memoizedProps.name,d!=null&&d!=="auto")){var y=n.stateNode;y.paired=null,xr===null&&(xr=new Map),xr.set(d,y)}hl(n,o,i);break;default:hl(n,o,i)}}function CS(n){var o=n.alternate;if(o!==null&&(n=o.child,n!==null)){o.child=null;do o=n.sibling,n.sibling=null,n=o;while(n!==null)}}function td(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var i=0;i<o.length;i++){var d=o[i];ys=d,TS(d,n)}CS(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)kS(n),n=n.sibling}function kS(n){switch(n.tag){case 0:case 11:case 15:td(n),n.flags&2048&&ci(9,n,n.return);break;case 3:td(n);break;case 12:td(n);break;case 22:var o=n.stateNode;n.memoizedState!==null&&o._visibility&2&&(n.return===null||n.return.tag!==13)?(o._visibility&=-3,Am(n)):td(n);break;default:td(n)}}function Am(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var i=0;i<o.length;i++){var d=o[i];ys=d,TS(d,n)}CS(n)}for(n=n.child;n!==null;){switch(o=n,o.tag){case 0:case 11:case 15:ci(8,o,o.return),Am(o);break;case 22:i=o.stateNode,i._visibility&2&&(i._visibility&=-3,Am(o));break;default:Am(o)}n=n.sibling}}function TS(n,o){for(;ys!==null;){var i=ys;switch(i.tag){case 0:case 11:case 15:ci(8,i,o);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var d=i.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Lu(i.memoizedState.cache)}if(d=i.child,d!==null)d.return=i,ys=d;else e:for(i=n;ys!==null;){d=ys;var y=d.sibling,w=d.return;if(gS(d),d===i){ys=null;break e}if(y!==null){y.return=w,ys=y;break e}ys=w}}}var xD={getCacheForType:function(n){var o=Ts(Wn),i=o.data.get(n);return i===void 0&&(i=n(),o.data.set(n,i)),i},cacheSignal:function(){return Ts(Wn).controller.signal}},bD=typeof WeakMap=="function"?WeakMap:Map,nn=0,yn=null,qt=null,Kt=0,on=0,br=null,di=!1,wc=!1,Ob=!1,xa=0,$n=0,fi=0,pl=0,Om=0,yr=0,jc=0,nd=null,Js=null,Mb=!1,Mm=0,ES=0,Dm=1/0,zm=null,mi=null,zn=0,mo=null,gl=null,Lo=0,Db=0,zb=null,RS=null,Sc=null,Nc=null,Cc=null,sd=0,Pm=null;function vr(){return(nn&2)!==0&&Kt!==0?Kt&-Kt:ie.T!==null?Fb():Or()}function AS(){if(yr===0)if((Kt&536870912)===0||Vt){var n=ut;ut<<=1,(ut&3932160)===0&&(ut=262144),yr=n}else yr=536870912;return n=Es.current,n!==null&&(n.flags|=32),yr}function kc(n,o){if(o!=null){var i=n.stateNode,d=i.ref;d===null&&(d=i.ref=uN(ia(n.memoizedProps,i))),Nc===null&&(Nc=[]),Nc.push(o.bind(null,d))}}function er(n,o,i){(n===yn&&(on===2||on===9)||n.cancelPendingCommit!==null)&&(Tc(n,0),hi(n,Kt,yr,!1)),Ks(n,i),((nn&2)===0||n!==yn)&&(n===yn&&((nn&2)===0&&(pl|=i),$n===4&&hi(n,Kt,yr,!1)),Bo(n))}function OS(n,o,i){if((nn&6)!==0)throw Error(a(327));var d=!i&&(o&127)===0&&(o&n.expiredLanes)===0||Pt(n,o),y=d?wD(n,o):Ib(n,o,!0),w=d;do{if(y===0){wc&&!d&&hi(n,o,0,!1);break}else{if(i=n.current.alternate,w&&!yD(i)){y=Ib(n,o,!1),w=!1;continue}if(y===2){if(w=o,n.errorRecoveryDisabledLanes&w)var D=0;else D=n.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){o=D;e:{var K=n;y=nd;var le=K.current.memoizedState.isDehydrated;if(le&&(Tc(K,D).flags|=256),D=Ib(K,D,!1),D!==2&&D!==6){if(Ob&&!le){K.errorRecoveryDisabledLanes|=w,pl|=w,y=4;break e}w=Js,Js=y,w!==null&&(Js===null?Js=w:Js.push.apply(Js,w))}y=D}if(w=!1,y!==2)continue}}if(y===1){Tc(n,0),hi(n,o,0,!0);break}e:{switch(d=n,w=y,w){case 0:case 1:throw Error(a(345));case 4:if((o&4194048)!==o&&(o&62914560)!==o)break;case 6:hi(d,o,yr,!di);break e;case 2:Js=null;break;case 3:case 5:break;default:throw Error(a(329))}if((o&62914560)===o&&(y=Mm+300-tt(),10<y)){if(hi(d,o,yr,!di),Et(d,0,!0)!==0)break e;Lo=o,d.timeoutHandle=t0(MS.bind(null,d,i,Js,zm,Mb,o,yr,pl,jc,di,w,"Throttled",-0,0),y);break e}MS(d,i,Js,zm,Mb,o,yr,pl,jc,di,w,null,-0,0)}}break}while(!0);Bo(n)}function MS(n,o,i,d,y,w,D,K,le,xe,Ce,ze,he,we){n.timeoutHandle=-1;var et=o.subtreeFlags,dt=(w&335544064)===w;if(ze=null,(dt||et&8192||(et&16785408)===16785408)&&(ze={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$s},xr=null,NS(o,w,ze),dt&&(et=ze,dt=n.containerInfo,dt=(dt.nodeType===9?dt:dt.ownerDocument).__reactViewTransition,dt!=null&&(et.count++,et.waitingForViewTransition=!0,et=dd.bind(et),dt.finished.then(et,et))),et=(w&62914560)===w?Mm-tt():(w&4194048)===w?ES-tt():0,et=Sz(ze,et),et!==null)){Lo=w,n.cancelPendingCommit=et($S.bind(null,n,o,w,i,d,y,D,K,le,xe,Ce,ze,null,he,we)),hi(n,w,D,!xe);return}$S(n,o,w,i,d,y,D,K,le,xe,Ce,ze)}function yD(n){for(var o=n;;){var i=o.tag;if((i===0||i===11||i===15)&&o.flags&16384&&(i=o.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var d=0;d<i.length;d++){var y=i[d],w=y.getSnapshot;y=y.value;try{if(!pr(w(),y))return!1}catch{return!1}}if(i=o.child,o.subtreeFlags&16384&&i!==null)i.return=o,o=i;else{if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function hi(n,o,i,d){o=Ln(n,o),o&=~Om,o&=~pl,n.suspendedLanes|=o,n.pingedLanes&=~o,d&&(n.warmLanes|=o),d=n.expirationTimes;for(var y=o;0<y;){var w=31-kt(y),D=1<<w;d[w]=-1,y&=~D}i!==0&&Ls(n,i,o)}function Im(){return(nn&6)===0?(rd(0),!1):!0}function Pb(){if(qt!==null){if(on===0)var n=qt.return;else n=qt,da=sl=null,Hx(n),mc=null,Vu=0,n=qt;for(;n!==null;)tS(n.alternate,n),n=n.return;qt=null}}function Tc(n,o){var i=n.timeoutHandle;return i!==-1&&(n.timeoutHandle=-1,HD(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),Lo=0,Pb(),yn=n,qt=i=ca(n.current,null),Kt=o,on=0,br=null,di=!1,wc=Pt(n,o),Ob=!1,jc=yr=Om=pl=fi=$n=0,Js=nd=null,Mb=!1,xa=Ln(n,o),Ff(),i}function DS(n,o){It=null,ie.H=pm,o===fc||o===tm?(o=$2(),on=3):o===Ax?(o=$2(),on=4):on=o===rb?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,br=o,qt===null&&($n=1,gm(n,zr(o,n.current)))}function zS(){var n=Es.current;return n===null?!0:(Kt&4194048)===Kt?Is===null:(Kt&62914560)===Kt||(Kt&536870912)!==0?n===Is:!1}function PS(){var n=ie.H;return ie.H=pm,n===null?pm:n}function IS(){var n=ie.A;return ie.A=xD,n}function _m(){$n=4,di||(Kt&4194048)!==Kt&&Es.current!==null||(wc=!0),(fi&134217727)===0&&(pl&134217727)===0||yn===null||hi(yn,Kt,yr,!1)}function Ib(n,o,i){var d=nn;nn|=2;var y=PS(),w=IS();(yn!==n||Kt!==o)&&(zm=null,Tc(n,o)),o=!1;var D=$n;e:do try{if(on!==0&&qt!==null){var K=qt,le=br;switch(on){case 8:Pb(),D=6;break e;case 3:case 2:case 9:case 6:Es.current===null&&(o=!0);var xe=on;if(on=0,br=null,Ec(n,K,le,xe),i&&wc){D=0;break e}break;default:xe=on,on=0,br=null,Ec(n,K,le,xe)}}vD(),D=$n;break}catch(Ce){DS(n,Ce)}while(!0);return o&&n.shellSuspendCounter++,da=sl=null,nn=d,ie.H=y,ie.A=w,qt===null&&(yn=null,Kt=0,Ff()),D}function vD(){for(;qt!==null;)_S(qt)}function wD(n,o){var i=nn;nn|=2;var d=PS(),y=IS();yn!==n||Kt!==o?(zm=null,Dm=tt()+500,Tc(n,o)):wc=Pt(n,o);e:do try{if(on!==0&&qt!==null){o=qt;var w=br;t:switch(on){case 1:on=0,br=null,Ec(n,o,w,1);break;case 2:case 9:if(L2(w)){on=0,br=null,LS(o);break}o=function(){on!==2&&on!==9||yn!==n||(on=7),Bo(n)},w.then(o,o);break e;case 3:on=7;break e;case 4:on=5;break e;case 7:L2(w)?(on=0,br=null,LS(o)):(on=0,br=null,Ec(n,o,w,7));break;case 5:var D=null;switch(qt.tag){case 26:D=qt.memoizedState;case 5:case 27:var K=qt;if(D?RN(D):K.stateNode.complete){on=0,br=null;var le=K.sibling;if(le!==null)qt=le;else{var xe=K.return;xe!==null?(qt=xe,Lm(xe)):qt=null}break t}}on=0,br=null,Ec(n,o,w,5);break;case 6:on=0,br=null,Ec(n,o,w,6);break;case 8:Pb(),$n=6;break e;default:throw Error(a(462))}}jD();break}catch(Ce){DS(n,Ce)}while(!0);return da=sl=null,ie.H=d,ie.A=y,nn=i,qt!==null?0:(yn=null,Kt=0,Ff(),$n)}function jD(){for(;qt!==null&&!Me();)_S(qt)}function _S(n){var o=Jj(n.alternate,n,xa);n.memoizedProps=n.pendingProps,o===null?Lm(n):qt=o}function LS(n){var o=n,i=o.alternate;switch(o.tag){case 15:case 0:o=qj(i,o,o.pendingProps,o.type,void 0,Kt);break;case 11:o=qj(i,o,o.pendingProps,o.type.render,o.ref,Kt);break;case 5:Hx(o);var d=o;d===xs&&(Vt?(Wf(d),d.tag===5&&d.stateNode!=null&&(Sn=d.stateNode)):(Wf(d),Vt=!0));default:tS(i,o),o=qt=T2(o,xa),o=Jj(i,o,xa)}n.memoizedProps=n.pendingProps,o===null?Lm(n):qt=o}function Ec(n,o,i,d){da=sl=null,Hx(o),mc=null,Vu=0;var y=o.return;try{if(cD(n,y,o,i,Kt)){$n=1,gm(n,zr(i,n.current)),qt=null;return}}catch(w){if(y!==null)throw qt=y,w;$n=1,gm(n,zr(i,n.current)),qt=null;return}o.flags&32768?(Vt||d===1?n=!0:wc||(Kt&536870912)!==0?n=!1:(di=n=!0,(d===2||d===9||d===3||d===6)&&(d=Es.current,d!==null&&d.tag===13&&(d.flags|=16384))),BS(o,n)):Lm(o)}function Lm(n){var o=n;do{if((o.flags&32768)!==0){BS(o,di);return}n=o.return;var i=mD(o.alternate,o,xa);if(i!==null){qt=i;return}if(o=o.sibling,o!==null){qt=o;return}qt=o=n}while(o!==null);$n===0&&($n=5)}function BS(n,o){do{var i=hD(n.alternate,n);if(i!==null){i.flags&=32767,qt=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!o&&(n=n.sibling,n!==null)){qt=n;return}qt=n=i}while(n!==null);$n=6,qt=null}function $S(n,o,i,d,y,w,D,K,le,xe,Ce,ze){n.cancelPendingCommit=null;do Bm();while(zn!==0);if((nn&6)!==0)throw Error(a(327));if(o!==null){if(o===n.current)throw Error(a(177));n===yn&&(qt=yn=null,Kt=0),gl=o,mo=n,Lo=i,zb=y,RS=d,SD(n,o,i,D,K,le,ze)}}function SD(n,o,i,d,y,w,D){var K=o.lanes|o.childLanes;if(Db=K,K|=xx,Ro(n,i,K,d,y,w),Nc=null,(i&335544064)===i?(Cc=Q4(n),d=10262):(Cc=null,d=10256),(o.subtreeFlags&d)!==0||(o.flags&d)!==0?(n.callbackNode=null,n.callbackPriority=0,RD(yt,function(){return $b(),null})):(n.callbackNode=null,n.callbackPriority=0),Nm=!1,d=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||d){d=ie.T,ie.T=null,y=oe.p,oe.p=2,w=nn,nn|=4;try{pD(n,o,i)}finally{nn=w,oe.p=y,ie.T=d}}zn=1,Nm?Sc=XD(D,n.containerInfo,Cc,_b,Lb,CD,Bb,$b,ND):(_b(),Lb(),Bb())}function ND(n){if(zn!==0){var o=mo.onRecoverableError;o(n,{componentStack:null})}}function CD(){zn===3&&(zn=0,jS(gl,mo),zn=4)}function _b(){if(zn===1){zn=0;var n=mo,o=gl,i=Lo,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=ie.T,ie.T=null;var y=oe.p;oe.p=2;var w=nn;nn|=4;try{Ju=Tm=!1,vS(o,n,i),i=Zb;var D=x2(n.containerInfo),K=i.focusedElem,le=i.selectionRange;if(D!==K&&K&&K.ownerDocument&&g2(K.ownerDocument.documentElement,K)){if(le!==null&&fx(K)){var xe=le.start,Ce=le.end;if(Ce===void 0&&(Ce=xe),"selectionStart"in K)K.selectionStart=xe,K.selectionEnd=Math.min(Ce,K.value.length);else{var ze=K.ownerDocument||document,he=ze&&ze.defaultView||window;if(he.getSelection){var we=he.getSelection(),et=K.textContent.length,dt=Math.min(le.start,et),_t=le.end===void 0?dt:Math.min(le.end,et);!we.extend&&dt>_t&&(D=_t,_t=dt,dt=D);var ge=p2(K,dt),fe=p2(K,_t);if(ge&&fe&&(we.rangeCount!==1||we.anchorNode!==ge.node||we.anchorOffset!==ge.offset||we.focusNode!==fe.node||we.focusOffset!==fe.offset)){var ye=ze.createRange();ye.setStart(ge.node,ge.offset),we.removeAllRanges(),dt>_t?(we.addRange(ye),we.extend(fe.node,fe.offset)):(ye.setEnd(fe.node,fe.offset),we.addRange(ye))}}}}for(ze=[],we=K;we=we.parentNode;)we.nodeType===1&&ze.push({element:we,left:we.scrollLeft,top:we.scrollTop});for(typeof K.focus=="function"&&K.focus(),K=0;K<ze.length;K++){var De=ze[K];De.element.scrollLeft=De.left,De.element.scrollTop=De.top}}Ic=!!Qb,Zb=Qb=null}finally{nn=w,oe.p=y,ie.T=d}}n.current=o,zn=2}}function Lb(){if(zn===2){zn=0;var n=mo,o=gl,i=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||i){i=ie.T,ie.T=null;var d=oe.p;oe.p=2;var y=nn;nn|=4;try{hS(n,o.alternate,o)}finally{nn=y,oe.p=d,ie.T=i}}zn=3}}function Bb(){if(zn===4||zn===3){zn=0;var n=Sc;Sc=null,Oe();var o=mo,i=gl,d=Lo,y=RS,w=(d&335544064)===d?10262:10256;if((i.subtreeFlags&w)!==0||(i.flags&w)!==0?zn=5:(zn=0,gl=mo=null,VS(o,o.pendingLanes)),w=o.pendingLanes,w===0&&(mi=null),Ar(d),i=i.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(vt,i,void 0,(i.current.flags&128)===128)}catch{}if(y!==null){i=ie.T,w=oe.p,oe.p=2,ie.T=null;try{for(var D=o.onRecoverableError,K=0;K<y.length;K++){var le=y[K];D(le.value,{componentStack:le.stack})}}finally{ie.T=i,oe.p=w}}if(y=Nc,D=Cc,Cc=null,y!==null&&(Nc=null,D===null&&(D=[]),n!==null))for(le=0;le<y.length;le++)i=(0,y[le])(D),i!==void 0&&n.finished.finally(i);(Lo&3)!==0&&Bm(),Bo(o),w=o.pendingLanes,(d&261930)!==0&&(w&42)!==0?o===Pm?sd++:(sd=0,Pm=o):(sd=0,Pm=null),rd(0)}}function VS(n,o){(n.pooledCacheLanes&=o)===0&&(o=n.pooledCache,o!=null&&(n.pooledCache=null,Lu(o)))}function Bm(){return Sc!==null&&(Sc.skipTransition(),Sc=null),_b(),Lb(),Bb(),$b()}function $b(){if(zn!==5)return!1;var n=mo,o=Db;Db=0;var i=Ar(Lo),d=ie.T,y=oe.p;try{oe.p=32>i?32:i,ie.T=null,i=zb,zb=null;var w=mo,D=Lo;if(zn=0,gl=mo=null,Lo=0,(nn&6)!==0)throw Error(a(331));var K=nn;if(nn|=4,kS(w.current),SS(w,w.current,D,i),nn=K,rd(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(vt,w)}catch{}return!0}finally{oe.p=y,ie.T=d,VS(n,o)}}function US(n,o,i){o=zr(i,o),o=sb(n.stateNode,o,2),n=oi(n,o,2),n!==null&&(Ks(n,2),Bo(n))}function an(n,o,i){if(n.tag===3)US(n,n,i);else for(;o!==null;){if(o.tag===3){US(o,n,i);break}else if(o.tag===1){var d=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(mi===null||!mi.has(d))){n=zr(i,n),i=Lj(2),d=oi(o,i,2),d!==null&&(Bj(i,d,o,n),Ks(d,2),Bo(d));break}}o=o.return}}function Vb(n,o,i){var d=n.pingCache;if(d===null){d=n.pingCache=new bD;var y=new Set;d.set(o,y)}else y=d.get(o),y===void 0&&(y=new Set,d.set(o,y));y.has(i)||(Ob=!0,y.add(i),n=kD.bind(null,n,o,i),o.then(n,n))}function kD(n,o,i){var d=n.pingCache;d!==null&&d.delete(o),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,yn===n&&(Kt&i)===i&&(($n===4||$n===3&&(Kt&62914560)===Kt&&300>tt()-Mm)&&(nn&2)===0?Tc(n,0):Om|=i,jc===Kt&&(jc=0)),Bo(n)}function HS(n,o){o===0&&(o=ps()),n=el(n,o),n!==null&&(Ks(n,o),Bo(n))}function TD(n){var o=n.memoizedState,i=0;o!==null&&(i=o.retryLane),HS(n,i)}function ED(n,o){var i=0;switch(n.tag){case 31:case 13:var d=n.stateNode,y=n.memoizedState;y!==null&&(i=y.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(o),HS(n,i)}function RD(n,o){return Xe(n,o)}var Rc=null,Ac=null,Ub=!1,$m=!1,Hb=!1,pi=0;function Bo(n){n!==Ac&&n.next===null&&(Ac===null?Rc=Ac=n:Ac=Ac.next=n),$m=!0,Ub||(Ub=!0,OD())}function rd(n,o){if(!Hb&&$m){Hb=!0;do for(var i=!1,d=Rc;d!==null;){if(n!==0){var y=d.pendingLanes;if(y===0)var w=0;else{var D=d.suspendedLanes,K=d.pingedLanes;w=(1<<31-kt(42|n)+1)-1,w&=y&~(D&~K),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,YS(d,w))}else w=Kt,w=Et(d,d===yn?w:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(w&3)===0||Pt(d,w)||(i=!0,YS(d,w));d=d.next}while(i);Hb=!1}}function AD(){FS()}function FS(){$m=Ub=!1;var n=0;pi!==0&&UD()&&(n=pi);for(var o=tt(),i=null,d=Rc;d!==null;){var y=d.next,w=GS(d,o);w===0?(d.next=null,i===null?Rc=y:i.next=y,y===null&&(Ac=i)):(i=d,(n!==0||(w&3)!==0)&&($m=!0)),d=y}zn!==0&&zn!==5||rd(n),pi!==0&&(pi=0)}function GS(n,o){for(var i=n.suspendedLanes,d=n.pingedLanes,y=n.expirationTimes,w=n.pendingLanes&-62914561;0<w;){var D=31-kt(w),K=1<<D,le=y[D];le===-1?((K&i)===0||(K&d)!==0)&&(y[D]=Eo(K,o)):le<=o&&(n.expiredLanes|=K),w&=~K}if(o=yn,i=Kt,i=Et(n,n===o?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,i===0||n===o&&(on===2||on===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&me(d),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||Pt(n,i)){if(o=i&-i,o===n.callbackPriority)return o;switch(d!==null&&me(d),Ar(i)){case 2:case 8:i=ht;break;case 32:i=yt;break;case 268435456:i=Ye;break;default:i=yt}return d=qS.bind(null,n),i=Xe(i,d),n.callbackPriority=o,n.callbackNode=i,o}return d!==null&&d!==null&&me(d),n.callbackPriority=2,n.callbackNode=null,2}function qS(n,o){if(zn!==0&&zn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(Bm()&&n.callbackNode!==i)return null;var d=Kt;return d=Et(n,n===yn?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(OS(n,d,o),GS(n,tt()),n.callbackNode!=null&&n.callbackNode===i?qS.bind(null,n):null)}function YS(n,o){if(Bm())return null;OS(n,o,!0)}function OD(){FD(function(){(nn&6)!==0?Xe(Ge,AD):FS()})}function Fb(){if(pi===0){var n=al;n===0&&(n=Ke,Ke<<=1,(Ke&261888)===0&&(Ke=256)),pi=n}return pi}function KS(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Cs(n)}function MD(n,o,i,d,y){if(o==="submit"&&i&&i.stateNode===y){var w=KS((y[Ns]||null).action),D=d.submitter;D&&(o=(o=D[Ns]||null)?KS(o.formAction):D.getAttribute("formAction"),o!==null&&(w=o,D=null));var K=new $f("action","action",null,d,y);n.push({event:K,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(pi!==0){var le=new FormData(y,D);Zx(i,{pending:!0,data:le,method:y.method,action:w},null,le)}}else typeof w=="function"&&(K.preventDefault(),le=new FormData(y,D),Zx(i,{pending:!0,data:le,method:y.method,action:w},w,le))},currentTarget:y}]})}}for(var Gb=0;Gb<gx.length;Gb++){var qb=gx[Gb],DD=qb.toLowerCase(),zD=qb[0].toUpperCase()+qb.slice(1);lo(DD,"on"+zD)}lo(v2,"onAnimationEnd"),lo(w2,"onAnimationIteration"),lo(j2,"onAnimationStart"),lo("dblclick","onDoubleClick"),lo("focusin","onFocus"),lo("focusout","onBlur"),lo(H4,"onTransitionRun"),lo(F4,"onTransitionStart"),lo(G4,"onTransitionCancel"),lo(S2,"onTransitionEnd"),fn("onMouseEnter",["mouseout","mouseover"]),fn("onMouseLeave",["mouseout","mouseover"]),fn("onPointerEnter",["pointerout","pointerover"]),fn("onPointerLeave",["pointerout","pointerover"]),Bt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var od="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),PD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(od));function XS(n,o){o=(o&4)!==0;for(var i=0;i<n.length;i++){var d=n[i],y=d.event;d=d.listeners;e:{var w=void 0;if(o)for(var D=d.length-1;0<=D;D--){var K=d[D],le=K.instance,xe=K.currentTarget;if(K=K.listener,le!==w&&y.isPropagationStopped())break e;w=K,y.currentTarget=xe;try{w(y)}catch(Ce){Hf(Ce)}y.currentTarget=null,w=le}else for(D=0;D<d.length;D++){if(K=d[D],le=K.instance,xe=K.currentTarget,K=K.listener,le!==w&&y.isPropagationStopped())break e;w=K,y.currentTarget=xe;try{w(y)}catch(Ce){Hf(Ce)}y.currentTarget=null,w=le}}}}function Yt(n,o){var i=o[Su];i===void 0&&(i=o[Su]=new Set);var d=n+"__bubble";i.has(d)||(WS(o,n,2,!1),i.add(d))}function Yb(n,o,i){var d=0;o&&(d|=4),WS(i,n,d,o)}var Vm="_reactListening"+Math.random().toString(36).slice(2);function Kb(n){if(!n[Vm]){n[Vm]=!0,Mt.forEach(function(i){i!=="selectionchange"&&(PD.has(i)||Yb(i,!1,n),Yb(i,!0,n))});var o=n.nodeType===9?n:n.ownerDocument;o===null||o[Vm]||(o[Vm]=!0,Yb("selectionchange",!1,o))}}function WS(n,o,i,d){switch(BN(o)){case 2:var y=Tz;break;case 8:y=Ez;break;default:y=h0}i=y.bind(null,o,i,n),y=void 0,!Qi||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),d?y!==void 0?n.addEventListener(o,i,{capture:!0,passive:y}):n.addEventListener(o,i,!0):y!==void 0?n.addEventListener(o,i,{passive:y}):n.addEventListener(o,i,!1)}function Xb(n,o,i,d,y){var w=d;if((o&1)===0&&(o&2)===0&&d!==null)e:for(;;){if(d===null)return;var D=d.tag;if(D===3||D===4){var K=d.stateNode.containerInfo;if(K===y)break;if(D===4)for(D=d.return;D!==null;){var le=D.tag;if((le===3||le===4)&&D.stateNode.containerInfo===y)return;D=D.return}for(;K!==null;){if(D=io(K),D===null)return;if(le=D.tag,le===5||le===6||le===26||le===27){d=w=D;continue e}K=K.parentNode}}d=d.return}Wi(function(){var xe=w,Ce=Xi(i),ze=[];e:{var he=N2.get(n);if(he!==void 0){var we=$f,et=n;switch(n){case"keypress":if(Lf(i)===0)break e;case"keydown":case"keyup":we=y4;break;case"focusin":et="focus",we=ax;break;case"focusout":et="blur",we=ax;break;case"beforeblur":case"afterblur":we=ax;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=Jw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=i4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=N4;break;case v2:case w2:case j2:we=u4;break;case S2:we=k4;break;case"scroll":case"scrollend":we=o4;break;case"wheel":we=E4;break;case"copy":case"cut":case"paste":we=f4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=t2;break;case"submit":we=j4;break;case"toggle":case"beforetoggle":we=A4}var dt=(o&4)!==0,_t=!dt&&(n==="scroll"||n==="scrollend"),ge=dt?he!==null?he+"Capture":null:he;dt=[];for(var fe=xe,ye;fe!==null;){var De=fe;if(ye=De.stateNode,De=De.tag,De!==5&&De!==26&&De!==27||ye===null||ge===null||(De=aa(fe,ge),De!=null&&dt.push(ad(fe,De,ye))),_t)break;fe=fe.return}0<dt.length&&(he=new we(he,et,null,i,Ce),ze.push({event:he,listeners:dt}))}}if((o&7)===0){e:{if(we=n==="mouseover"||n==="pointerover",he=n==="mouseout"||n==="pointerout",we&&i!==Ki&&(et=i.relatedTarget||i.fromElement)&&(io(et)||et[ur]))break e;(he||we)&&(et=Ce.window===Ce?Ce:(we=Ce.ownerDocument)?we.defaultView||we.parentWindow:window,he?(we=i.relatedTarget||i.toElement,he=xe,we=we?io(we):null,we!==null&&(_t=c(we),dt=we.tag,we!==_t||dt!==5&&dt!==27&&dt!==6)&&(we=null)):(he=null,we=xe),he!==we&&(dt=Jw,De="onMouseLeave",ge="onMouseEnter",fe="mouse",(n==="pointerout"||n==="pointerover")&&(dt=t2,De="onPointerLeave",ge="onPointerEnter",fe="pointer"),_t=he==null?et:Ne(he),ye=we==null?et:Ne(we),et=new dt(De,fe+"leave",he,i,Ce),et.target=_t,et.relatedTarget=ye,De=null,io(Ce)===xe&&(dt=new dt(ge,fe+"enter",we,i,Ce),dt.target=ye,dt.relatedTarget=_t,De=dt),_t=De,dt=he&&we?M(he,we,ID):null,he!==null&&QS(ze,et,he,dt,!1),we!==null&&_t!==null&&QS(ze,_t,we,dt,!0)))}e:{if(he=xe?Ne(xe):window,we=he.nodeName&&he.nodeName.toLowerCase(),we==="select"||we==="input"&&he.type==="file")var rt=c2;else if(i2(he))if(u2)rt=$4;else{rt=L4;var Xt=_4}else we=he.nodeName,!we||we.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?xe&&Yi(xe.elementType)&&(rt=c2):rt=B4;if(rt&&(rt=rt(n,xe))){l2(ze,rt,i,Ce);break e}Xt&&Xt(n,he,xe)}switch(Xt=xe?Ne(xe):window,n){case"focusin":(i2(Xt)||Xt.contentEditable==="true")&&(rc=Xt,mx=xe,Pu=null);break;case"focusout":Pu=mx=rc=null;break;case"mousedown":hx=!0;break;case"contextmenu":case"mouseup":case"dragend":hx=!1,b2(ze,i,Ce);break;case"selectionchange":if(U4)break;case"keydown":case"keyup":b2(ze,i,Ce)}var xt;if(lx)e:{switch(n){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else sc?o2(n,i)&&(Tt="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Tt="onCompositionStart");Tt&&(n2&&i.locale!=="ko"&&(sc||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&sc&&(xt=Qw()):(Wa=Ce,sx="value"in Wa?Wa.value:Wa.textContent,sc=!0)),Xt=Um(xe,Tt),0<Xt.length&&(Tt=new e2(Tt,n,null,i,Ce),ze.push({event:Tt,listeners:Xt}),xt?Tt.data=xt:(xt=a2(i),xt!==null&&(Tt.data=xt)))),(xt=M4?D4(n,i):z4(n,i))&&(Tt=Um(xe,"onBeforeInput"),0<Tt.length&&(Xt=new e2("onBeforeInput","beforeinput",null,i,Ce),ze.push({event:Xt,listeners:Tt}),Xt.data=xt)),MD(ze,n,xe,i,Ce)}XS(ze,o)})}function ad(n,o,i){return{instance:n,listener:o,currentTarget:i}}function Um(n,o){for(var i=o+"Capture",d=[];n!==null;){var y=n,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=aa(n,i),y!=null&&d.unshift(ad(n,y,w)),y=aa(n,o),y!=null&&d.push(ad(n,y,w))),n.tag===3)return d;n=n.return}return[]}function ID(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function QS(n,o,i,d,y){for(var w=o._reactName,D=[];i!==null&&i!==d;){var K=i,le=K.alternate,xe=K.stateNode;if(K=K.tag,le!==null&&le===d)break;K!==5&&K!==26&&K!==27||xe===null||(le=xe,y?(xe=aa(i,w),xe!=null&&D.unshift(ad(i,xe,le))):y||(xe=aa(i,w),xe!=null&&D.push(ad(i,xe,le)))),i=i.return}D.length!==0&&n.push({event:o,listeners:D})}var _D=/\r\n?/g,LD=/\u0000|\uFFFD/g;function ZS(n){return(typeof n=="string"?n:""+n).replace(_D,`
|
|
50
|
+
`).replace(LD,"")}function JS(n,o){return o=ZS(o),ZS(n)===o}function ln(n,o,i,d,y,w){switch(i){case"children":if(typeof d=="string")o==="body"||o==="textarea"&&d===""||Bs(n,d);else if(typeof d=="number"||typeof d=="bigint")o!=="body"&&Bs(n,""+d);else return;break;case"className":dr(n,"class",d);break;case"tabIndex":dr(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":dr(n,i,d);break;case"style":mr(n,d,w);return;case"data":if(o!=="object"){dr(n,"data",d);break}case"src":case"href":if(d===""&&(o!=="a"||i!=="href")){n.removeAttribute(i);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(i);break}d=Cs(d),n.setAttribute(i,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(i==="formAction"?(o!=="input"&&ln(n,o,"name",y.name,y,null),ln(n,o,"formEncType",y.formEncType,y,null),ln(n,o,"formMethod",y.formMethod,y,null),ln(n,o,"formTarget",y.formTarget,y,null)):(ln(n,o,"encType",y.encType,y,null),ln(n,o,"method",y.method,y,null),ln(n,o,"target",y.target,y,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(i);break}d=Cs(d),n.setAttribute(i,d);break;case"onClick":d!=null&&(n.onclick=$s);return;case"onScroll":d!=null&&Yt("scroll",n);return;case"onScrollEnd":d!=null&&Yt("scrollend",n);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(i=d.__html,i!=null){if(y.children!=null)throw Error(a(60));(w!=null?w.__html:void 0)!==i&&(n.innerHTML=i)}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}i=Cs(d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,d):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":d===!0?n.setAttribute(i,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,d):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(i,d):n.removeAttribute(i);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(i):n.setAttribute(i,d);break;case"popover":Yt("beforetoggle",n),Yt("toggle",n),Dn(n,"popover",d);break;case"xlinkActuate":Kn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Kn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Kn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Kn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Kn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Kn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Kn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Dn(n,"is",d);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=ku.get(i)||i,Dn(n,i,d);else return}St=!0}function Wb(n,o,i,d,y,w){switch(i){case"style":mr(n,d,w);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(i=d.__html,i!=null){if(y.children!=null)throw Error(a(60));(w!=null?w.__html:void 0)!==i&&(n.innerHTML=i)}}break;case"children":if(typeof d=="string")Bs(n,d);else if(typeof d=="number"||typeof d=="bigint")Bs(n,""+d);else return;break;case"onScroll":d!=null&&Yt("scroll",n);return;case"onScrollEnd":d!=null&&Yt("scrollend",n);return;case"onClick":d!=null&&(n.onclick=$s);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Rt.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(y=i.endsWith("Capture"),w=i.slice(2,y?i.length-7:void 0),o=n[Ns]||null,o=o!=null?o[i]:null,typeof o=="function"&&n.removeEventListener(w,o,y),typeof d=="function")){typeof o!="function"&&o!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(w,d,y);break e}St=!0,i in n?n[i]=d:d===!0?n.setAttribute(i,""):Dn(n,i,d)}return}St=!0}function Os(n,o,i){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yt("error",n),Yt("load",n);var d=!1,y=!1,w;for(w in i)if(i.hasOwnProperty(w)){var D=i[w];if(D!=null)switch(w){case"src":d=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:ln(n,o,w,D,i,null)}}y&&ln(n,o,"srcSet",i.srcSet,i,null),d&&ln(n,o,"src",i.src,i,null);return;case"input":Yt("invalid",n);var K=w=D=y=null,le=null,xe=null;for(d in i)if(i.hasOwnProperty(d)){var Ce=i[d];if(Ce!=null)switch(d){case"name":y=Ce;break;case"type":D=Ce;break;case"checked":le=Ce;break;case"defaultChecked":xe=Ce;break;case"value":w=Ce;break;case"defaultValue":K=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(a(137,o));break;default:ln(n,o,d,Ce,i,null)}}Ka(n,w,K,le,xe,D,y,!1);return;case"select":Yt("invalid",n),d=D=w=null;for(y in i)if(i.hasOwnProperty(y)&&(K=i[y],K!=null))switch(y){case"value":w=K;break;case"defaultValue":D=K;break;case"multiple":d=K;default:ln(n,o,y,K,i,null)}o=w,i=D,n.multiple=!!d,o!=null?Xs(n,!!d,o,!1):i!=null&&Xs(n,!!d,i,!0);return;case"textarea":Yt("invalid",n),w=y=d=null;for(D in i)if(i.hasOwnProperty(D)&&(K=i[D],K!=null))switch(D){case"value":d=K;break;case"defaultValue":y=K;break;case"children":w=K;break;case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(91));break;default:ln(n,o,D,K,i,null)}fr(n,d,y,w);return;case"option":for(le in i)if(i.hasOwnProperty(le)&&(d=i[le],d!=null))switch(le){case"selected":n.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:ln(n,o,le,d,i,null)}return;case"dialog":Yt("beforetoggle",n),Yt("toggle",n),Yt("cancel",n),Yt("close",n);break;case"iframe":case"object":Yt("load",n);break;case"video":case"audio":for(d=0;d<od.length;d++)Yt(od[d],n);break;case"image":Yt("error",n),Yt("load",n);break;case"details":Yt("toggle",n);break;case"embed":case"source":case"link":Yt("error",n),Yt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(xe in i)if(i.hasOwnProperty(xe)&&(d=i[xe],d!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:ln(n,o,xe,d,i,null)}return;default:if(Yi(o)){for(Ce in i)i.hasOwnProperty(Ce)&&(d=i[Ce],d!==void 0&&Wb(n,o,Ce,d,i,void 0));return}}for(K in i)i.hasOwnProperty(K)&&(d=i[K],d!=null&&ln(n,o,K,d,i,null))}var BD={};function $D(n,o,i,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,D=null,K=null,le=null,xe=null,Ce=null;for(we in i){var ze=i[we];if(i.hasOwnProperty(we)&&ze!=null)switch(we){case"checked":break;case"value":break;case"defaultValue":le=ze;default:d.hasOwnProperty(we)||ln(n,o,we,null,d,ze)}}for(var he in d){var we=d[he];if(ze=i[he],d.hasOwnProperty(he)&&(we!=null||ze!=null))switch(he){case"type":we!==ze&&(St=!0),w=we;break;case"name":we!==ze&&(St=!0),y=we;break;case"checked":we!==ze&&(St=!0),xe=we;break;case"defaultChecked":we!==ze&&(St=!0),Ce=we;break;case"value":we!==ze&&(St=!0),D=we;break;case"defaultValue":we!==ze&&(St=!0),K=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(a(137,o));break;default:we!==ze&&ln(n,o,he,we,d,ze)}}Ps(n,D,K,le,xe,Ce,w,y);return;case"select":we=D=K=he=null;for(w in i)if(le=i[w],i.hasOwnProperty(w)&&le!=null)switch(w){case"value":break;case"multiple":we=le;default:d.hasOwnProperty(w)||ln(n,o,w,null,d,le)}for(y in d)if(w=d[y],le=i[y],d.hasOwnProperty(y)&&(w!=null||le!=null))switch(y){case"value":w!==le&&(St=!0),he=w;break;case"defaultValue":w!==le&&(St=!0),K=w;break;case"multiple":w!==le&&(St=!0),D=w;default:w!==le&&ln(n,o,y,w,d,le)}o=K,i=D,d=we,he!=null?Xs(n,!!i,he,!1):!!d!=!!i&&(o!=null?Xs(n,!!i,o,!0):Xs(n,!!i,i?[]:"",!1));return;case"textarea":we=he=null;for(K in i)if(y=i[K],i.hasOwnProperty(K)&&y!=null&&!d.hasOwnProperty(K))switch(K){case"value":break;case"children":break;default:ln(n,o,K,null,d,y)}for(D in d)if(y=d[D],w=i[D],d.hasOwnProperty(D)&&(y!=null||w!=null))switch(D){case"value":y!==w&&(St=!0),he=y;break;case"defaultValue":y!==w&&(St=!0),we=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(a(91));break;default:y!==w&&ln(n,o,D,y,d,w)}nc(n,he,we);return;case"option":for(var et in i)if(he=i[et],i.hasOwnProperty(et)&&he!=null&&!d.hasOwnProperty(et))switch(et){case"selected":n.selected=!1;break;default:ln(n,o,et,null,d,he)}for(le in d)if(he=d[le],we=i[le],d.hasOwnProperty(le)&&he!==we&&(he!=null||we!=null))switch(le){case"selected":he!==we&&(St=!0),n.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:ln(n,o,le,he,d,we)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var dt in i)he=i[dt],i.hasOwnProperty(dt)&&he!=null&&!d.hasOwnProperty(dt)&&ln(n,o,dt,null,d,he);for(xe in d)if(he=d[xe],we=i[xe],d.hasOwnProperty(xe)&&he!==we&&(he!=null||we!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(a(137,o));break;default:ln(n,o,xe,he,d,we)}return;default:if(Yi(o)){for(var _t in i)he=i[_t],i.hasOwnProperty(_t)&&he!==void 0&&!d.hasOwnProperty(_t)&&Wb(n,o,_t,void 0,d,he);for(Ce in d)he=d[Ce],we=i[Ce],!d.hasOwnProperty(Ce)||he===we||he===void 0&&we===void 0||Wb(n,o,Ce,he,d,we);return}}for(var ge in i)he=i[ge],i.hasOwnProperty(ge)&&he!=null&&!d.hasOwnProperty(ge)&&ln(n,o,ge,null,d,he);for(ze in d)he=d[ze],we=i[ze],!d.hasOwnProperty(ze)||he===we||he==null&&we==null||ln(n,o,ze,he,d,we)}function eN(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function VD(){if(typeof performance.getEntriesByType=="function"){for(var n=0,o=0,i=performance.getEntriesByType("resource"),d=0;d<i.length;d++){var y=i[d],w=y.transferSize,D=y.initiatorType,K=y.duration;if(w&&K&&eN(D)){for(D=0,K=y.responseEnd,d+=1;d<i.length;d++){var le=i[d],xe=le.startTime;if(xe>K)break;var Ce=le.transferSize,ze=le.initiatorType;Ce&&eN(ze)&&(le=le.responseEnd,D+=Ce*(le<K?1:(K-xe)/(le-xe)))}if(--d,o+=8*(w+D)/(y.duration/1e3),n++,10<n)break}}if(0<n)return o/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Qb=null,Zb=null;function id(n){return n.nodeType===9?n:n.ownerDocument}function tN(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nN(n,o){if(n===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&o==="foreignObject"?0:n}function sN(n,o,i,d){return i=id(i).createElement(n),i[Mn]=d,i[Ns]=o,Os(i,n,o),Ve(i),i}function Jb(n,o){return n==="textarea"||n==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var e0=null;function UD(){var n=window.event;return n&&n.type==="popstate"?n===e0?!1:(e0=n,!0):(e0=null,!1)}var t0=typeof setTimeout=="function"?setTimeout:void 0,HD=typeof clearTimeout=="function"?clearTimeout:void 0,rN=typeof Promise=="function"?Promise:void 0,oN=typeof requestAnimationFrame=="function"?requestAnimationFrame:t0,FD=typeof queueMicrotask=="function"?queueMicrotask:typeof rN<"u"?function(n){return rN.resolve(null).then(n).catch(GD)}:t0;function GD(n){setTimeout(function(){throw n})}function gi(n){return n==="head"}function aN(n,o){var i=o,d=0;do{var y=i.nextSibling;if(n.removeChild(i),y&&y.nodeType===8)if(i=y.data,i==="/$"||i==="/&"){if(d===0){n.removeChild(y),_c(o);return}d--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")d++;else if(i==="html")c0(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,c0(i);for(var w=i.firstChild;w;){var D=w.nextSibling,K=w.nodeName;w[Gi]||K==="SCRIPT"||K==="STYLE"||K==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=D}}else i==="body"&&c0(n.ownerDocument.body);i=y}while(i);_c(o)}function iN(n,o){var i=n;n=0;do{var d=i.nextSibling;if(i.nodeType===1?o?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(o?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=d}while(i)}function lN(n,o,i){if(o=CSS.escape(o)!==o?"r-"+btoa(o).replace(/=/g,""):o,n.style.viewTransitionName=o,i!=null&&(n.style.viewTransitionClass=i),i=getComputedStyle(n),i.display==="inline"){if(o=n.getClientRects(),o.length===1)var d=1;else for(var y=d=0;y<o.length;y++){var w=o[y];0<w.width&&0<w.height&&d++}d===1&&(n=n.style,n.display=o.length===1?"inline-block":"block",n.marginTop="-"+i.paddingTop,n.marginBottom="-"+i.paddingBottom)}}function cN(n,o){n=n.style,o=o.style;var i=o!=null?o.hasOwnProperty("viewTransitionName")?o.viewTransitionName:o.hasOwnProperty("view-transition-name")?o["view-transition-name"]:null:null;n.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=o!=null?o.hasOwnProperty("viewTransitionClass")?o.viewTransitionClass:o.hasOwnProperty("view-transition-class")?o["view-transition-class"]:null:null,n.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),n.display==="inline-block"&&(o==null?n.display=n.margin="":(i=o.display,n.display=i==null||typeof i=="boolean"?"":i,i=o.margin,i!=null?n.margin=i:(i=o.hasOwnProperty("marginTop")?o.marginTop:o["margin-top"],n.marginTop=i==null||typeof i=="boolean"?"":i,o=o.hasOwnProperty("marginBottom")?o.marginBottom:o["margin-bottom"],n.marginBottom=o==null||typeof o=="boolean"?"":o)))}function qD(n,o,i){return i=i.ownerDocument.defaultView,{rect:n,abs:o.position==="absolute"||o.position==="fixed",clip:o.clipPath!=="none"||o.overflow!=="visible"||o.filter!=="none"||o.mask!=="none"||o.mask!=="none"||o.borderRadius!=="0px",view:0<=n.bottom&&0<=n.right&&n.top<=i.innerHeight&&n.left<=i.innerWidth}}function n0(n){var o=n.getBoundingClientRect(),i=getComputedStyle(n);return qD(o,i,n)}function YD(n){return n.documentElement.clientHeight}function KD(n){this.addEventListener("load",n),this.addEventListener("error",n)}function XD(n,o,i,d,y,w,D,K,le){var xe=o.nodeType===9?o:o.ownerDocument;try{var Ce=xe.startViewTransition({update:function(){var he=xe.defaultView,we=he.navigation&&he.navigation.transition,et=xe.fonts.status;d();var dt=[];if(et==="loaded"&&(YD(xe),xe.fonts.status==="loading"&&dt.push(xe.fonts.ready)),et=dt.length,n!==null)for(var _t=n.suspenseyImages,ge=0,fe=0;fe<_t.length;fe++){var ye=_t[fe];if(!ye.complete){var De=ye.getBoundingClientRect();if(0<De.bottom&&0<De.right&&De.top<he.innerHeight&&De.left<he.innerWidth){if(ge+=AN(ye),ge>Gm){dt.length=et;break}ye=new Promise(KD.bind(ye)),dt.push(ye)}}}if(0<dt.length)return he=Promise.race([Promise.all(dt),new Promise(function(rt){return setTimeout(rt,500)})]).then(y,y),(we?Promise.allSettled([we.finished,he]):he).then(w,w);if(y(),we)return we.finished.then(w,w);w()},types:i});xe.__reactViewTransition=Ce;var ze=[];return Ce.ready.then(function(){for(var he=xe.documentElement.getAnimations({subtree:!0}),we=0;we<he.length;we++){var et=he[we],dt=et.effect,_t=dt.pseudoElement;if(_t!=null&&_t.startsWith("::view-transition")){ze.push(et),et=dt.getKeyframes();for(var ge=_t=void 0,fe=!0,ye=0;ye<et.length;ye++){var De=et[ye],rt=De.width;if(_t===void 0)_t=rt;else if(_t!==rt){fe=!1;break}if(rt=De.height,ge===void 0)ge=rt;else if(ge!==rt){fe=!1;break}delete De.width,delete De.height,De.transform==="none"&&delete De.transform}fe&&_t!==void 0&&ge!==void 0&&(dt.setKeyframes(et),fe=getComputedStyle(dt.target,dt.pseudoElement),fe.width!==_t||fe.height!==ge)&&(fe=et[0],fe.width=_t,fe.height=ge,fe=et[et.length-1],fe.width=_t,fe.height=ge,dt.setKeyframes(et))}}D()},function(he){xe.__reactViewTransition===Ce&&(xe.__reactViewTransition=null);try{if(typeof he=="object"&&he!==null)switch(he.name){case"InvalidStateError":(he.message==="View transition was skipped because document visibility state is hidden."||he.message==="Skipping view transition because document visibility state has become hidden."||he.message==="Skipping view transition because viewport size changed."||he.message==="Transition was aborted because of invalid state")&&(he=null)}he!==null&&le(he)}finally{d(),y(),D()}}),Ce.finished.finally(function(){for(var he=0;he<ze.length;he++)ze[he].cancel();xe.__reactViewTransition===Ce&&(xe.__reactViewTransition=null),K()}),Ce}catch{return d(),y(),D(),null}}function xl(n,o){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+o+")"}xl.prototype.animate=function(n,o){return o=typeof o=="number"?{duration:o}:A({},o),o.pseudoElement=this._selector,this._scope.animate(n,o)},xl.prototype.getAnimations=function(){for(var n=this._scope,o=this._selector,i=n.getAnimations({subtree:!0}),d=[],y=0;y<i.length;y++){var w=i[y].effect;w!==null&&w.target===n&&w.pseudoElement===o&&d.push(i[y])}return d},xl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function uN(n){return{name:n,group:new xl("group",n),imagePair:new xl("image-pair",n),old:new xl("old",n),new:new xl("new",n)}}function wr(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}wr.prototype.addEventListener=function(n,o,i){var d=null,y=null;if(!(i!=null&&typeof i!="boolean"&&(d=i.signal||null,d!==null&&d.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var w=this._eventListeners;if(fN(w,n,o,i)===-1){var D=this,K=o;i!=null&&typeof i!="boolean"&&i.once===!0&&(K=function(le){D.removeEventListener(n,o,i),typeof o=="function"?o.call(this,le):o.handleEvent(le)}),d!==null&&(y=D.removeEventListener.bind(D,n,o,i),d.addEventListener("abort",y,{once:!0}),y=d.removeEventListener.bind(d,"abort",y)),d=Oc(i),w.push({type:n,listener:o,optionsOrUseCapture:i,attachedListener:K,cleanup:y}),p(this._fragmentFiber.child,!1,WD,n,K,d)}this._eventListeners=w}};function WD(n,o,i,d){return N(n).addEventListener(o,i,d),!1}wr.prototype.removeEventListener=function(n,o,i){var d=this._eventListeners;if(d!==null&&(o=fN(d,n,o,i),o!==-1)){var y=d[o];i=y.attachedListener;var w=y.cleanup;y=Oc(y.optionsOrUseCapture),p(this._fragmentFiber.child,!1,QD,n,i,y),d.splice(o,1),w!==null&&w()}};function QD(n,o,i,d){return N(n).removeEventListener(o,i,d),!1}function Oc(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function dN(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function fN(n,o,i,d){if(n.length===0)return-1;d=dN(d);for(var y=0;y<n.length;y++){var w=n[y];if(w.type===o&&w.listener===i&&dN(w.optionsOrUseCapture)===d)return y}return-1}wr.prototype.dispatchEvent=function(n){var o=b(this._fragmentFiber);if(o===null)return!0;o=N(o);var i=this._eventListeners;if(i!==null&&0<i.length||!n.bubbles){var d=o.nodeType===9?o.createComment(""):document.createTextNode("");if(i)for(var y=0;y<i.length;y++){var w=i[y];d.addEventListener(w.type,w.attachedListener,Oc(w.optionsOrUseCapture))}if(o.appendChild(d),n=d.dispatchEvent(n),i)for(y=0;y<i.length;y++)w=i[y],d.removeEventListener(w.type,w.attachedListener,Oc(w.optionsOrUseCapture));return o.removeChild(d),n}return o.dispatchEvent(n)},wr.prototype.focus=function(n){p(this._fragmentFiber.child,!0,mN,n,void 0,void 0)};function mN(n,o){return n.tag===6?!1:(n=N(n),cz(n,o))}wr.prototype.focusLast=function(n){var o=[];p(this._fragmentFiber.child,!0,s0,o,void 0,void 0);for(var i=o.length-1;0<=i&&!mN(o[i],n);i--);};function s0(n,o){return o.push(n),!1}wr.prototype.blur=function(){var n=b(this._fragmentFiber);n!==null&&(n=N(n),n=id(n).activeElement,n!==null&&p(this._fragmentFiber.child,!1,ZD,n,void 0,void 0))};function ZD(n,o){return n.tag===6?!1:(n=N(n),n===o||n.contains(o)?(o.blur(),!0):!1)}wr.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),p(this._fragmentFiber.child,!1,JD,n,void 0,void 0)};function JD(n,o){return n.tag===6||(n=N(n),o.observe(n)),!1}wr.prototype.unobserveUsing=function(n){var o=this._observers;if(o!==null&&o.has(n)){o.delete(n),p(this._fragmentFiber.child,!1,ez,n,void 0,void 0);for(var i=o=0;i<ho.length;i++){var d=ho[i];d.fragmentInstance===this&&d.observer===n?n.unobserve(d.instance):ho[o++]=d}ho.length=o}};function ez(n,o){return n.tag===6||(n=N(n),o.unobserve(n)),!1}var ho=[],r0=!1;function tz(n,o,i){ho.push({fragmentInstance:n,observer:o,instance:i}),r0||(r0=!0,uz(function(){r0=!1;var d=ho;ho=[];for(var y=0;y<d.length;y++){var w=d[y];w.observer.unobserve(w.instance)}}))}wr.prototype.getClientRects=function(){var n=[];return p(this._fragmentFiber.child,!1,nz,n,void 0,void 0),n};function nz(n,o){if(n.tag===6){n=n.stateNode;var i=n.ownerDocument.createRange();i.selectNodeContents(n),o.push.apply(o,i.getClientRects())}else n=N(n),o.push.apply(o,n.getClientRects());return!1}wr.prototype.getRootNode=function(n){var o=b(this._fragmentFiber);return o===null?this:N(o).getRootNode(n)},wr.prototype.compareDocumentPosition=function(n){var o=b(this._fragmentFiber);if(o===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];p(this._fragmentFiber.child,!1,s0,i,void 0,void 0);var d=N(o);if(i.length===0){if(i=d,v(this._fragmentFiber)){e:{for(o=this._fragmentFiber.return;o!==null;){if(o.tag===4){o=o.stateNode.containerInfo;break e}if(o.tag===3||o.tag===5||o.tag===27)break;o=o.return}o=null}o!=null&&(i=o)}o=this._fragmentFiber;var y=d=i.compareDocumentPosition(n);return i===n?y=Node.DOCUMENT_POSITION_CONTAINS:d&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=j(o)[1],i===null?y=Node.DOCUMENT_POSITION_PRECEDING:(n=N(i).compareDocumentPosition(n),y=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),y|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}o=N(i[0]),y=N(i[i.length-1]);var w=v(this._fragmentFiber)?o.parentElement:d;if(w==null)return Node.DOCUMENT_POSITION_DISCONNECTED;d=w.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY,w=w.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY;var D=o.compareDocumentPosition(n),K=y.compareDocumentPosition(n),le=D&Node.DOCUMENT_POSITION_CONTAINED_BY||K&Node.DOCUMENT_POSITION_CONTAINED_BY;return K=d&&w&&D&Node.DOCUMENT_POSITION_FOLLOWING&&K&Node.DOCUMENT_POSITION_PRECEDING,o=d&&o===n||w&&y===n||le||K?Node.DOCUMENT_POSITION_CONTAINED_BY:!d&&o===n||!w&&y===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:D,o&Node.DOCUMENT_POSITION_DISCONNECTED||o&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||sz(o,this._fragmentFiber,i[0],i[i.length-1],n)?o:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function sz(n,o,i,d,y){var w=io(y);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!w)e:{for(;w!==null;){if(w.tag===7&&(w===o||w.alternate===o)){i=!0;break e}w=w.return}i=!1}return i}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(w===null)return w=y.ownerDocument,y===w||y===w.documentElement||y===w.body;e:{for(w=o,o=b(o);w!==null;){if(!(w.tag!==5&&w.tag!==3&&w.tag!==27||w!==o&&w.alternate!==o)){w=!0;break e}w=w.return}w=!1}return w}return n&Node.DOCUMENT_POSITION_PRECEDING?((o=!!w)&&!(o=w===i)&&(o=M(i,w,k),o===null?o=!1:(p(o,!0,T,w,i),w=C,C=null,o=w!==null)),o):n&Node.DOCUMENT_POSITION_FOLLOWING?((o=!!w)&&!(o=w===d)&&(o=M(d,w,k),o===null?o=!1:(p(o,!0,O,w,d),w=C,E=C=null,o=w!==null)),o):!1}function hN(n,o){var i=n.ownerDocument.createRange();i.selectNodeContents(n),n=i.getBoundingClientRect(),window.scrollTo(window.scrollX+n.left,o?window.scrollY+n.top:window.scrollY+n.bottom-window.innerHeight)}wr.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(a(566));var o=[];p(this._fragmentFiber.child,!1,s0,o,void 0,void 0);var i=n!==!1;if(o.length===0){var d=j(this._fragmentFiber);if(d=i?d[1]||d[0]||b(this._fragmentFiber):d[0]||d[1],d===null)return;if(d.tag===6){n=N(d),hN(n,i);return}if(d=N(d),d.nodeType!==9){if(d.nodeType===11){i="host"in d?d.host:null,i!==null&&i.scrollIntoView(n);return}d.scrollIntoView(n)}}for(d=i?o.length-1:0;d!==(i?-1:o.length);){var y=o[d];y.tag===6?(y=N(y),hN(y,i)):N(y).scrollIntoView(n),d+=i?-1:1}};function rz(n,o){return n=N(n),pN(n,o),!1}function pN(n,o){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(o)}function gN(n,o){var i=o._eventListeners;if(i!==null)for(var d=0;d<i.length;d++){var y=i[d];n.addEventListener(y.type,y.attachedListener,Oc(y.optionsOrUseCapture))}n.nodeType!==3&&(i=o._observers,i!==null&&i.forEach(function(w){for(var D=0,K=0;K<ho.length;K++){var le=ho[K];(le.fragmentInstance!==o||le.observer!==w||le.instance!==n)&&(ho[D++]=le)}ho.length=D,w.observe(n)}),pN(n,o))}function oz(n,o){var i=o._eventListeners;if(i!==null)for(var d=0;d<i.length;d++){var y=i[d];n.removeEventListener(y.type,y.attachedListener,Oc(y.optionsOrUseCapture))}n.nodeType!==3&&(i=o._observers,i!==null&&i.forEach(function(w){typeof w.rootMargin=="string"?tz(o,w,n):w.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(o))}function o0(n){var o=n.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var i=o;switch(o=o.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":o0(i),Zl(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function az(n,o,i,d){for(;n.nodeType===1;){var y=i;if(n.nodeName.toLowerCase()!==o.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[Gi])switch(o){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(w=n.getAttribute("rel"),w==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(w!==y.rel||n.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||n.getAttribute("title")!==(y.title==null?null:y.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(w=n.getAttribute("src"),(w!==(y.src==null?null:y.src)||n.getAttribute("type")!==(y.type==null?null:y.type)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(o==="input"&&n.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&n.getAttribute("name")===w)return n}else return n;if(n=Br(n.nextSibling),n===null)break}return null}function iz(n,o,i){if(o==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Br(n.nextSibling),n===null))return null;return n}function xN(n,o){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Br(n.nextSibling),n===null))return null;return n}function a0(n){return n.data==="$?"||n.data==="$~"}function i0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function lz(n,o){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=o;else if(n.data!=="$?"||i.readyState!=="loading")o();else{var d=function(){o(),i.removeEventListener("DOMContentLoaded",d)};i.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Br(n){for(;n!=null;n=n.nextSibling){var o=n.nodeType;if(o===1||o===3)break;if(o===8){if(o=n.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return n}var l0=null;function bN(n){n=n.nextSibling;for(var o=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(o===0)return Br(n.nextSibling);o--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||o++}n=n.nextSibling}return null}function yN(n){n=n.previousSibling;for(var o=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(o===0)return n;o--}else i!=="/$"&&i!=="/&"||o++}n=n.previousSibling}return null}function cz(n,o){function i(){d=!0}if(n.ownerDocument.activeElement===n)return!0;var d=!1;try{n.ownerDocument.addEventListener("focus",i,!0),(n.focus||HTMLElement.prototype.focus).call(n,o)}finally{n.ownerDocument.removeEventListener("focus",i,!0)}return d}function uz(n){oN(function(){oN(function(o){return n(o)})})}function vN(n,o,i){switch(o=id(i),n){case"html":if(n=o.documentElement,!n)throw Error(a(452));return n;case"head":if(n=o.head,!n)throw Error(a(453));return n;case"body":if(n=o.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function wN(n,o,i){for(var d in i){var y=i[d];i.hasOwnProperty(d)&&y!=null&&ln(n,o,d,null,BD,y)}i.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===$s&&(n.onclick=null),Zl(n)}function c0(n){for(var o=n.attributes;o.length;)n.removeAttributeNode(o[0]);Zl(n)}var $r=new Map,jN=new Set;function ld(n){if(typeof n.getRootNode=="function"){var o=n.getRootNode();if(o.nodeType===9||o.nodeType===11)return o}return n.nodeType===9?n:n.ownerDocument}var ba=oe.d;oe.d={f:dz,r:fz,D:mz,C:hz,L:pz,m:gz,X:bz,S:xz,M:yz};function dz(){var n=ba.f(),o=Im();return n||o}function fz(n){var o=qi(n);o!==null&&o.tag===5&&o.type==="form"?Nj(o):ba.r(n)}var Mc=typeof document>"u"?null:document;function SN(n,o,i){var d=Mc;if(d&&typeof o=="string"&&o){var y=kn(o);y='link[rel="'+n+'"][href="'+y+'"]',typeof i=="string"&&(y+='[crossorigin="'+i+'"]'),jN.has(y)||(jN.add(y),n={rel:n,crossOrigin:i,href:o},d.querySelector(y)===null&&(o=d.createElement("link"),Os(o,"link",n),Ve(o),d.head.appendChild(o)))}}function mz(n){ba.D(n),SN("dns-prefetch",n,null)}function hz(n,o){ba.C(n,o),SN("preconnect",n,o)}function pz(n,o,i){ba.L(n,o,i);var d=Mc;if(d&&n&&o){var y='link[rel="preload"][as="'+kn(o)+'"]';o==="image"&&i&&i.imageSrcSet?(y+='[imagesrcset="'+kn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(y+='[imagesizes="'+kn(i.imageSizes)+'"]')):y+='[href="'+kn(n)+'"]';var w=y;switch(o){case"style":w=Dc(n);break;case"script":w=zc(n)}if(!($r.has(w)||(n=A({rel:"preload",href:o==="image"&&i&&i.imageSrcSet?void 0:n,as:o},i),$r.set(w,n),d.querySelector(y)!==null||o==="style"&&d.querySelector(cd(w))||o==="script"&&d.querySelector(ud(w))))){var D=d.createElement("link");Os(D,"link",n),o==="style"&&(D[Ql]=!0,D.onload=D.onerror=function(){gt(D)}),Ve(D),d.head.appendChild(D)}}}function gz(n,o){ba.m(n,o);var i=Mc;if(i&&n){var d=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+kn(d)+'"][href="'+kn(n)+'"]',w=y;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=zc(n)}if(!$r.has(w)&&(n=A({rel:"modulepreload",href:n},o),$r.set(w,n),i.querySelector(y)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ud(w)))return}d=i.createElement("link"),Os(d,"link",n),Ve(d),i.head.appendChild(d)}}}function xz(n,o,i){ba.S(n,o,i);var d=Mc;if(d&&n){var y=Be(d).hoistableStyles,w=Dc(n);o=o||"default";var D=y.get(w);if(!D){var K={loading:0,preload:null};if(D=d.querySelector(cd(w)))K.loading=5;else{n=A({rel:"stylesheet",href:n,"data-precedence":o},i),(i=$r.get(w))&&u0(n,i);var le=D=d.createElement("link");Ve(le),Os(le,"link",n),le._p=new Promise(function(xe,Ce){le.onload=xe,le.onerror=Ce}),le.addEventListener("load",function(){K.loading|=1}),le.addEventListener("error",function(){K.loading|=2}),K.loading|=4,Hm(D,o,d)}D={type:"stylesheet",instance:D,count:1,state:K},y.set(w,D)}}}function bz(n,o){ba.X(n,o);var i=Mc;if(i&&n){var d=Be(i).hoistableScripts,y=zc(n),w=d.get(y);w||(w=i.querySelector(ud(y)),w||(n=A({src:n,async:!0},o),(o=$r.get(y))&&d0(n,o),w=i.createElement("script"),Ve(w),Os(w,"link",n),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},d.set(y,w))}}function yz(n,o){ba.M(n,o);var i=Mc;if(i&&n){var d=Be(i).hoistableScripts,y=zc(n),w=d.get(y);w||(w=i.querySelector(ud(y)),w||(n=A({src:n,async:!0,type:"module"},o),(o=$r.get(y))&&d0(n,o),w=i.createElement("script"),Ve(w),Os(w,"link",n),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},d.set(y,w))}}function NN(n,o,i,d){var y=(y=Te.current)?ld(y):null;if(!y)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=Dc(i.href),o=Be(y).hoistableStyles,d=o.get(i),d||(d={type:"style",instance:null,count:0,state:null},o.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=Dc(i.href);var w=Be(y).hoistableStyles,D=w.get(n);if(D||(y=y.ownerDocument||y,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(n,D),(w=y.querySelector(cd(n)))?w._p||(D.instance=w,D.state.loading=5):(w=$r.get(n),w||(w={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},$r.set(n,w)),vz(y,n,w,D.state))),o&&d===null)throw Error(a(528,""));return D}if(o&&d!==null)throw Error(a(529,""));return null;case"script":return o=i.async,i=i.src,typeof i=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(i=zc(i),o=Be(y).hoistableScripts,d=o.get(i),d||(d={type:"script",instance:null,count:0,state:null},o.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function Dc(n){return'href="'+kn(n)+'"'}function cd(n){return'link[rel="stylesheet"]['+n+"]"}function CN(n){return A({},n,{"data-precedence":n.precedence,precedence:null})}function vz(n,o,i,d){if(o=n.querySelector('link[rel="preload"][as="style"]['+o+"]")){if(o[Ql]!==!0){d.loading=1;return}}else o=n.createElement("link"),o[Ql]=!0,o.onload=o.onerror=gt.bind(null,o),Os(o,"link",i),Ve(o),n.head.appendChild(o);d.preload=o,o.addEventListener("load",function(){return d.loading|=1}),o.addEventListener("error",function(){return d.loading|=2})}function zc(n){return'[src="'+kn(n)+'"]'}function ud(n){return"script[async]"+n}function kN(n,o,i){if(o.count++,o.instance===null)switch(o.type){case"style":var d=n.querySelector('style[data-href~="'+kn(i.href)+'"]');if(d)return o.instance=d,Ve(d),d;var y=A({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Ve(d),Os(d,"style",y),Hm(d,i.precedence,n),o.instance=d;case"stylesheet":y=Dc(i.href);var w=n.querySelector(cd(y));if(w)return o.state.loading|=4,o.instance=w,Ve(w),w;d=CN(i),(y=$r.get(y))&&u0(d,y),w=(n.ownerDocument||n).createElement("link"),Ve(w);var D=w;return D._p=new Promise(function(K,le){D.onload=K,D.onerror=le}),Os(w,"link",d),o.state.loading|=4,Hm(w,i.precedence,n),o.instance=w;case"script":return w=zc(i.src),(y=n.querySelector(ud(w)))?(o.instance=y,Ve(y),y):(d=i,(y=$r.get(w))&&(d=A({},i),d0(d,y)),n=n.ownerDocument||n,y=n.createElement("script"),Ve(y),Os(y,"link",d),n.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(a(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(d=o.instance,o.state.loading|=4,Hm(d,i.precedence,n));return o.instance}function Hm(n,o,i){for(var d=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=d.length?d[d.length-1]:null,w=y,D=0;D<d.length;D++){var K=d[D];if(K.dataset.precedence===o)w=K;else if(w!==y)break}w?w.parentNode.insertBefore(n,w.nextSibling):(o=i.nodeType===9?i.head:i,o.insertBefore(n,o.firstChild))}function u0(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.title==null&&(n.title=o.title)}function d0(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.integrity==null&&(n.integrity=o.integrity)}var Fm=null;function TN(n,o,i){if(Fm===null){var d=new Map,y=Fm=new Map;y.set(i,d)}else y=Fm,d=y.get(i),d||(d=new Map,y.set(i,d));if(d.has(n))return d;for(d.set(n,null),i=i.getElementsByTagName(n),y=0;y<i.length;y++){var w=i[y];if(!(w[Gi]||w[Mn]||n==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(o)||"";D=n+D;var K=d.get(D);K?K.push(w):d.set(D,[w])}}return d}function f0(n,o,i){n=n.ownerDocument||n,n.head.insertBefore(i,o==="title"?n.querySelector("head > title"):null)}function wz(n,o,i){if(i===1||o.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return n=o.disabled,typeof o.precedence=="string"&&n==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function EN(n,o){return n==="img"&&o.src!=null&&o.src!==""&&o.onLoad==null&&o.loading!=="lazy"}function RN(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function AN(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function ON(n,o){typeof o.decode=="function"&&(n.imgCount++,o.complete||(n.imgBytes+=AN(o),n.suspenseyImages.push(o)),n=Nz.bind(n),o.decode().then(n,n))}function jz(n,o,i,d){if(i.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var y=Dc(d.href),w=o.querySelector(cd(y));if(w){o=w._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(n.count++,n=dd.bind(n),o.then(n,n)),i.state.loading|=4,i.instance=w,Ve(w);return}w=o.ownerDocument||o,d=CN(d),(y=$r.get(y))&&u0(d,y),w=w.createElement("link"),Ve(w);var D=w;D._p=new Promise(function(K,le){D.onload=K,D.onerror=le}),Os(w,"link",d),i.instance=w}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,o),(o=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=dd.bind(n),o.addEventListener("load",i),o.addEventListener("error",i))}}var Gm=0;function Sz(n,o){return n.stylesheets&&n.count===0&&Ym(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var d=setTimeout(function(){if(n.stylesheets&&Ym(n,n.stylesheets),n.unsuspend){var w=n.unsuspend;n.unsuspend=null,w()}},6e4+o);0<n.imgBytes&&Gm===0&&(Gm=62500*VD());var y=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ym(n,n.stylesheets),n.unsuspend)){var w=n.unsuspend;n.unsuspend=null,w()}},(n.imgBytes>Gm?50:800)+o);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(y)}}:null}function MN(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Ym(n,n.stylesheets);else if(n.unsuspend){var o=n.unsuspend;n.unsuspend=null,o()}}}function dd(){this.count--,MN(this)}function Nz(){this.imgCount--,MN(this)}var qm=null;function Ym(n,o){n.stylesheets=null,n.unsuspend!==null&&(n.count++,qm=new Map,o.forEach(Cz,n),qm=null,dd.call(n))}function Cz(n,o){if(!(o.state.loading&4)){var i=qm.get(n);if(i)var d=i.get(null);else{i=new Map,qm.set(n,i);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var D=y[w];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(i.set(D.dataset.precedence,D),d=D)}d&&i.set(null,d)}y=o.instance,D=y.getAttribute("data-precedence"),w=i.get(D)||d,w===d&&i.set(null,y),i.set(D,y),this.count++,d=dd.bind(this),y.addEventListener("load",d),y.addEventListener("error",d),w?w.parentNode.insertBefore(y,w.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(y,n.firstChild)),o.state.loading|=4}}var Pc={$$typeof:U,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function kz(n,o,i,d,y,w,D,K,le){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ao(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ao(0),this.hiddenUpdates=ao(null),this.identifierPrefix=d,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=le,this.transitionTypes=null,this.incompleteTransitions=new Map}function DN(n,o,i,d,y,w,D,K,le,xe,Ce,ze){return n=new kz(n,o,i,D,le,xe,Ce,ze,K),o=1,w===!0&&(o|=24),w=Ws(3,null,null,o),n.current=w,w.stateNode=n,o=Tx(),o.refCount++,n.pooledCache=o,o.refCount++,w.memoizedState={element:d,isDehydrated:i,cache:o},Ox(w),n}function zN(n){return n?(n=ic,n):ic}function PN(n,o,i,d,y,w){y=zN(y),d.context===null?d.context=y:d.pendingContext=y,d=ri(o),d.payload={element:i},w=w===void 0?null:w,w!==null&&(d.callback=w),i=oi(n,d,o),i!==null&&(er(i,n,o),Uu(i,n,o))}function IN(n,o){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<o?i:o}}function m0(n,o){IN(n,o),(n=n.alternate)&&IN(n,o)}function _N(n){if(n.tag===13||n.tag===31){var o=el(n,67108864);o!==null&&er(o,n,67108864),m0(n,67108864)}}function LN(n){if(n.tag===13||n.tag===31){var o=vr();o=Rr(o);var i=el(n,o);i!==null&&er(i,n,o),m0(n,o)}}var Ic=!0;function Tz(n,o,i,d){var y=ie.T;ie.T=null;var w=oe.p;try{oe.p=2,h0(n,o,i,d)}finally{oe.p=w,ie.T=y}}function Ez(n,o,i,d){var y=ie.T;ie.T=null;var w=oe.p;try{oe.p=8,h0(n,o,i,d)}finally{oe.p=w,ie.T=y}}function h0(n,o,i,d){if(Ic){var y=p0(d);if(y===null)Xb(n,o,d,Km,i),$N(n,d);else if(Az(y,n,o,i,d))d.stopPropagation();else if($N(n,d),o&4&&-1<Rz.indexOf(n)){for(;y!==null;){var w=qi(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=Rn(w.pendingLanes);if(D!==0){var K=w;for(K.pendingLanes|=2,K.entangledLanes|=2;D;){var le=1<<31-kt(D);K.entanglements[1]|=le,D&=~le}Bo(w),(nn&6)===0&&(Dm=tt()+500,rd(0))}}break;case 31:case 13:K=el(w,2),K!==null&&er(K,w,2),Im(),m0(w,2)}if(w=p0(d),w===null&&Xb(n,o,d,Km,i),w===y)break;y=w}y!==null&&d.stopPropagation()}else Xb(n,o,d,null,i)}}function p0(n){return n=Xi(n),g0(n)}var Km=null;function g0(n){if(Km=null,n=io(n),n!==null){var o=c(n);if(o===null)n=null;else{var i=o.tag;if(i===13){if(n=u(o),n!==null)return n;n=null}else if(i===31){if(n=f(o),n!==null)return n;n=null}else if(i===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;n=null}else o!==n&&(n=null)}}return Km=n,null}function BN(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ue()){case Ge:return 2;case ht:return 8;case yt:case ue:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var x0=!1,xi=null,bi=null,yi=null,fd=new Map,md=new Map,vi=[],Rz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function $N(n,o){switch(n){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":bi=null;break;case"mouseover":case"mouseout":yi=null;break;case"pointerover":case"pointerout":fd.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":md.delete(o.pointerId)}}function hd(n,o,i,d,y,w){return n===null||n.nativeEvent!==w?(n={blockedOn:o,domEventName:i,eventSystemFlags:d,nativeEvent:w,targetContainers:[y]},o!==null&&(o=qi(o),o!==null&&_N(o)),n):(n.eventSystemFlags|=d,o=n.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),n)}function Az(n,o,i,d,y){switch(o){case"focusin":return xi=hd(xi,n,o,i,d,y),!0;case"dragenter":return bi=hd(bi,n,o,i,d,y),!0;case"mouseover":return yi=hd(yi,n,o,i,d,y),!0;case"pointerover":var w=y.pointerId;return fd.set(w,hd(fd.get(w)||null,n,o,i,d,y)),!0;case"gotpointercapture":return w=y.pointerId,md.set(w,hd(md.get(w)||null,n,o,i,d,y)),!0}return!1}function VN(n){var o=io(n.target);if(o!==null){var i=c(o);if(i!==null){if(o=i.tag,o===13){if(o=u(i),o!==null){n.blockedOn=o,Fi(n.priority,function(){LN(i)});return}}else if(o===31){if(o=f(i),o!==null){n.blockedOn=o,Fi(n.priority,function(){LN(i)});return}}else if(o===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Xm(n){if(n.blockedOn!==null)return!1;for(var o=n.targetContainers;0<o.length;){var i=p0(n.nativeEvent);if(i===null){i=n.nativeEvent;var d=new i.constructor(i.type,i);Ki=d,i.target.dispatchEvent(d),Ki=null}else return o=qi(i),o!==null&&_N(o),n.blockedOn=i,!1;o.shift()}return!0}function UN(n,o,i){Xm(n)&&i.delete(o)}function Oz(){x0=!1,xi!==null&&Xm(xi)&&(xi=null),bi!==null&&Xm(bi)&&(bi=null),yi!==null&&Xm(yi)&&(yi=null),fd.forEach(UN),md.forEach(UN)}function Wm(n,o){n.blockedOn===o&&(n.blockedOn=null,x0||(x0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Oz)))}var Qm=null;function HN(n){Qm!==n&&(Qm=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Qm===n&&(Qm=null);for(var o=0;o<n.length;o+=3){var i=n[o],d=n[o+1],y=n[o+2];if(typeof d!="function"){if(g0(d||i)===null)continue;break}var w=qi(i);w!==null&&(n.splice(o,3),o-=3,Zx(w,{pending:!0,data:y,method:i.method,action:d},d,y))}}))}function _c(n){function o(le){return Wm(le,n)}xi!==null&&Wm(xi,n),bi!==null&&Wm(bi,n),yi!==null&&Wm(yi,n),fd.forEach(o),md.forEach(o);for(var i=0;i<vi.length;i++){var d=vi[i];d.blockedOn===n&&(d.blockedOn=null)}for(;0<vi.length&&(i=vi[0],i.blockedOn===null);)VN(i),i.blockedOn===null&&vi.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(d=0;d<i.length;d+=3){var y=i[d],w=i[d+1],D=y[Ns]||null;if(typeof w=="function")D||HN(i);else if(D){var K=null;if(w&&w.hasAttribute("formAction")){if(y=w,D=w[Ns]||null)K=D.formAction;else if(g0(y)!==null)continue}else K=D.action;typeof K=="function"?i[d+1]=K:(i.splice(d,3),d-=3),HN(i)}}}function FN(){function n(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(D){return y=D})},focusReset:"manual",scroll:"manual"})}function o(){y!==null&&(y(),y=null),d||setTimeout(i,20)}function i(){if(!d&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,y=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(i,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),y!==null&&(y(),y=null)}}}function b0(n){this._internalRoot=n}Zm.prototype.render=b0.prototype.render=function(n){var o=this._internalRoot;if(o===null)throw Error(a(409));var i=o.current,d=vr();PN(i,d,n,o,null,null)},Zm.prototype.unmount=b0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var o=n.containerInfo;PN(n.current,2,null,n,null,null),Im(),o[ur]=null}};function Zm(n){this._internalRoot=n}Zm.prototype.unstable_scheduleHydration=function(n){if(n){var o=Or();n={blockedOn:null,target:n,priority:o};for(var i=0;i<vi.length&&o!==0&&o<vi[i].priority;i++);vi.splice(i,0,n),i===0&&VN(n)}};var GN=t.version;if(GN!=="19.3.0")throw Error(a(527,GN,"19.3.0"));oe.findDOMNode=function(n){var o=n._reactInternals;if(o===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(o),n=n!==null?x(n):null,n=n===null?null:n.stateNode,n};var Mz={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ie,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jm.isDisabled&&Jm.supportsFiber)try{vt=Jm.inject(Mz),wt=Jm}catch{}}return gd.createRoot=function(n,o){if(!l(n))throw Error(a(299));var i=!1,d="",y=zj,w=Pj,D=Ij;return o!=null&&(o.unstable_strictMode===!0&&(i=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(D=o.onRecoverableError)),o=DN(n,1,!1,null,null,i,d,null,y,w,D,FN),n[ur]=o.current,Kb(n),new b0(o)},gd.hydrateRoot=function(n,o,i){if(!l(n))throw Error(a(299));var d=!1,y="",w=zj,D=Pj,K=Ij,le=null;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(y=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(D=i.onCaughtError),i.onRecoverableError!==void 0&&(K=i.onRecoverableError),i.formState!==void 0&&(le=i.formState)),o=DN(n,1,!0,o,i??null,d,y,le,w,D,K,FN),o.context=zN(null),i=o.current,d=vr(),d=Rr(d),y=ri(d),y.callback=null,oi(i,y,d),i=d,o.current.lanes=i,Ks(o,i),Bo(o),n[ur]=o.current,Kb(n),new Zm(o)},gd.version="19.3.0",gd}var nC;function eP(){if(nC)return j0.exports;nC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),j0.exports=Jz(),j0.exports}var tP=eP();const nP="modulepreload",sP=function(e){return"/"+e},sC={},Ay=function(t,r,a){let l=Promise.resolve();if(r&&r.length>0){let u=function(m){return Promise.all(m.map(x=>Promise.resolve(x).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=u(r.map(m=>{if(m=sP(m),m in sC)return;sC[m]=!0;const x=m.endsWith(".css"),p=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const b=document.createElement("link");if(b.rel=x?"stylesheet":nP,x||(b.as="script"),b.crossOrigin="",b.href=m,h&&b.setAttribute("nonce",h),document.head.appendChild(b),x)return new Promise((v,j)=>{b.addEventListener("load",v),b.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})},gR="openrod.compute-target";function rP(e,t){const r=new URL(e);if(r.hash.startsWith("#cloud-return="))return"local";const a=r.searchParams.get("target");if(a==="local"||a==="cloud")return a;try{return(t==null?void 0:t.getItem(gR))==="cloud"?"cloud":"local"}catch{return"local"}}function oP(e,t){if(!["local","cloud"].includes(e))throw new Error("Unknown compute target");return`${e==="cloud"?"/api/remote/os":"/api/os"}${t}`}let xR="local";const bR=()=>xR;function yR(e){if(!["local","cloud"].includes(e))throw new Error("Unknown compute target");xR=e}function aP(e,t){const r=t??null;return{uid:r,revision:e.revision+(e.uid&&e.uid!==r?1:0)}}let vR=null;const Oy=()=>vR;function rC(e){vR=typeof e=="string"&&/^[a-f0-9]{16}$/.test(e)?e:null}const ki="CONSOLE_TOKEN_REQUIRED";function qr(e,t,r=null,a=Oy()){const l=()=>e??bR(),c=a;let u,f;const h=v=>oP(l(),v),m=v=>t&&v?AbortSignal.any([t,v]):t??v;async function x(){t==null||t.throwIfAborted();const v=await fetch(h("/context"),{signal:t,headers:l()==="cloud"&&c?{"x-openrod-local-owner":c}:void 0}),j=await v.json();if(t==null||t.throwIfAborted(),j.code===ki?window.dispatchEvent(new Event(ki)):(v.status===401||j.code==="CLOUD_OWNER_CHANGED")&&window.dispatchEvent(new Event("openrod-session-expired")),!v.ok)throw new Error(j.error??"Could not read gateway registrations.");return u??(u=JSON.stringify([j.gateway,j.workspace])),j}async function p(){return t==null||t.throwIfAborted(),r??(u||(f??(f=x().finally(()=>{f=null})),await f),u)}async function b(v,{method:j="GET",body:S,signal:N,scoped:C=!0,raw:E=!1}={}){const T=m(N);T==null||T.throwIfAborted();const O=C?await p():null;T==null||T.throwIfAborted();const k=await fetch(h(v),{method:j,signal:T,headers:{...l()==="cloud"&&c?{"x-openrod-local-owner":c}:{},...O?{"x-openshell-context":O}:{},...O&&r?{"x-openshell-location":"1"}:{},...j==="GET"?{}:{"content-type":E?"application/octet-stream":"application/json","x-openshell-console":"1"}},body:S===void 0?void 0:E?S:JSON.stringify(S)}),M=await k.json().catch(()=>({}));if(T==null||T.throwIfAborted(),M.code===ki?window.dispatchEvent(new Event(ki)):(k.status===401||M.code==="CLOUD_OWNER_CHANGED")&&window.dispatchEvent(new Event("openrod-session-expired")),!k.ok)throw Object.assign(new Error(M.error??`Request failed (${k.status})`),{code:M.code,sandboxes:M.sandboxes});return M}return{target:e,signal:t,path:h,owner:c,url:(v,j={})=>{const S=new URLSearchParams({...j,...l()==="cloud"&&c?{owner:c}:{}});return h(v)+(S.size?"?"+S:"")},forContext:v=>qr(e,t,v,c),inventory:v=>b("/inventory",{signal:v,scoped:!1}),context:x,contextKey:p,connections:v=>b("/connections",{signal:v,scoped:!1}),connectionJob:(v,j)=>b(`/connections/jobs/${encodeURIComponent(v)}`,{signal:j,scoped:!1}),connect:v=>b("/connections/connect",{method:"POST",body:v}),installConnectionDocker:v=>b(`/connections/jobs/${encodeURIComponent(v)}/docker`,{method:"POST",body:{approve:!0}}),installConnectionRuntime:v=>b(`/connections/jobs/${encodeURIComponent(v)}/install`,{method:"POST",body:{method:"download"}}),uploadConnectionPackage:(v,j)=>b(`/connections/jobs/${encodeURIComponent(v)}/package`,{method:"POST",body:j,raw:!0}),scanSshHost:v=>b("/connections/hosts/scan",{method:"POST",body:v}),addSshHost:v=>b("/connections/hosts",{method:"POST",body:{token:v}}),removeSshHost:v=>b("/connections/hosts/remove",{method:"POST",body:{alias:v}}),forgetRemote:()=>b("/connections/forget",{method:"POST",body:{}}),disconnectRemote:()=>b("/connections/disconnect",{method:"POST",body:{}}),syncLocalCatalog:()=>b("/local-catalog",{method:"POST",body:{}}),setups:()=>b("/setups"),discoverSetups:v=>b("/setups/scan",{method:"POST",body:{sources:v}}),reviewSetup:(v,j)=>b("/setups/review",{method:"POST",body:{token:v,ids:j}}),removeSetupReviewItem:(v,j)=>b("/setups/remove-review-item",{method:"POST",body:{token:v,item:j}}),prepareSetup:(v,j)=>b("/setups/prepare",{method:"POST",body:{token:v,items:j,approved:!0}}),prepareLaunchSetup:(v,j)=>b(`/setups/${v}/prepare-launch`,{method:"POST",body:{revision:j}}),prepareSavedSetup:v=>b(`/setups/${v}/prepare`,{method:"POST",body:{}}),setupPreparation:v=>b(`/setups/preparations/${v}`),cancelSetupPreparation:v=>b(`/setups/preparations/${v}/cancel`,{method:"POST",body:{}}),setupFile:(v,j,S)=>b("/setups/file",{method:"POST",body:{token:v,item:j,path:S}}),saveSetup:(v,j,S)=>b("/setups/save",{method:"POST",body:{token:v,name:j,acknowledged:S}}),deleteSetup:(v,j)=>b(`/setups/${v}/delete`,{method:"POST",body:{revision:j}}),deleteSetupItem:(v,j,S)=>b(`/setups/${v}/delete-item`,{method:"POST",body:{item:j,revision:S}}),previewSetup:(v,j,S)=>b(`/setups/${v}/preview`,{method:"POST",body:{sandbox:j,targets:S}}),enableSetup:(v,j,S,N=!1)=>b(`/setups/${v}/enable`,{method:"POST",body:{sandbox:j,token:S,approveAccess:N}}),removeSetup:(v,j,S)=>b(`/setups/${v}/remove`,{method:"POST",body:{sandbox:j,token:S}}),setupJobs:v=>b(`/setups/${v}/jobs`),cloudExport:v=>b(`/cloud-export?name=${encodeURIComponent(v)}`),importCloud:v=>b("/cloud-import",{method:"POST",body:v}),cloudTransfer:(v,j)=>b("/cloud-transfer",{method:"POST",body:{name:v,ticket:j}}),selectContext:v=>b("/context",{method:"POST",body:v}),previewActivityDeletion:v=>b("/activity/delete-preview",{method:"POST",body:v}),deleteActivity:v=>b("/activity/delete",{method:"POST",body:{token:v}}),activityDestinations:()=>b("/activity-destinations"),createActivityDestination:v=>b("/activity-destinations",{method:"POST",body:v}),activityDestinationAction:(v,j)=>b(`/activity-destinations/${encodeURIComponent(v)}/${j}`,{method:"POST",body:{}}),overview:()=>b("/overview"),sandbox:v=>b(`/sandboxes/${encodeURIComponent(v)}`),activity:(v={})=>b(`/activity?query=${encodeURIComponent(JSON.stringify(v))}`),create:v=>b("/sandboxes",{method:"POST",body:v}),sshConnection:v=>b(`/sandboxes/${encodeURIComponent(v)}/ssh`),openSshTerminal:(v,j)=>b(`/sandboxes/${encodeURIComponent(v)}/ssh-open`,{method:"POST",body:{mode:j}}),sshConfig:v=>b(`/sandboxes/${encodeURIComponent(v)}/ssh-config`,{method:"POST",body:{}}),terminalSession:(v,j)=>b(`/sandboxes/${encodeURIComponent(v)}/terminal-session`,{method:"POST",body:j}),lifecycle:(v,j)=>b(`/sandboxes/${encodeURIComponent(v)}/${j}`,{method:"POST",body:{}}),editors:()=>b("/editors"),openEditor:(v,j)=>b(`/sandboxes/${encodeURIComponent(v)}/editor`,{method:"POST",body:{editor:j}}),fleetPolicy:()=>b("/policy/fleet"),policy:v=>b(`/policy/${encodeURIComponent(v)}`),revision:(v,j)=>b(`/policy/${encodeURIComponent(v)}/revisions/${j}`),applyOps:(v,j)=>b(`/policy/${encodeURIComponent(v)}/ops`,{method:"POST",body:{ops:j}}),restore:(v,j)=>b(`/policy/${encodeURIComponent(v)}/restore`,{method:"POST",body:{version:j}}),globalPolicy:()=>b("/policy/global"),removeGlobal:()=>b("/policy/global/remove",{method:"POST",body:{}}),settings:v=>b(`/settings${v?`/${encodeURIComponent(v)}`:""}`),setSetting:v=>b("/settings",{method:"POST",body:v}),secrets:()=>b("/secrets"),createSecret:v=>b("/secrets",{method:"POST",body:v}),rotateSecret:(v,j)=>b(`/secrets/${encodeURIComponent(v)}/rotate`,{method:"POST",body:{credentials:j}}),secretExpiry:(v,j,S)=>b(`/secrets/${encodeURIComponent(v)}/expiry`,{method:"POST",body:{key:j,expiresAt:S}}),deleteSecret:v=>b(`/secrets/${encodeURIComponent(v)}/delete`,{method:"POST",body:{}}),attachSecret:(v,j,S)=>b(`/secrets/${encodeURIComponent(v)}/${S?"attach":"detach"}`,{method:"POST",body:{sandbox:j}}),importProfile:v=>b("/profiles/import",{method:"POST",body:{id:v}}),deleteTemplates:v=>b("/templates/delete",{method:"POST",body:{ids:v}}),templates:()=>b("/templates"),imageTemplates:()=>b("/image-templates"),localImages:()=>b("/image-templates/local-images"),buildImageTemplate:(v,j=!1)=>b("/image-templates",{method:"POST",body:{recipe:v,replace:j}}),cancelImageBuild:v=>b(`/image-templates/${encodeURIComponent(v)}/cancel`,{method:"POST",body:{}}),dismissImageBuild:v=>b(`/image-templates/${encodeURIComponent(v)}/dismiss`,{method:"POST",body:{}}),imageTemplateUsage:v=>b(`/image-templates/${encodeURIComponent(v)}/usage`),deleteImageTemplate:v=>b(`/image-templates/${encodeURIComponent(v)}/delete`,{method:"POST",body:{}}),org:()=>b("/org"),saveOrg:v=>b("/org",{method:"POST",body:v}),saveGroup:v=>b("/org/groups",{method:"POST",body:v}),deleteGroup:v=>b(`/org/groups/${encodeURIComponent(v)}/delete`,{method:"POST",body:{}}),setGroupMembers:(v,j,S="replace")=>b("/org/members",{method:"POST",body:{sandboxes:v,groups:j,mode:S}}),savePolicy:v=>b("/egress/policies",{method:"POST",body:v}),deletePolicy:v=>b(`/egress/policies/${encodeURIComponent(v)}/delete`,{method:"POST",body:{}}),saveTemplate:v=>b("/templates",{method:"POST",body:v}),deleteTemplate:v=>b(`/templates/${encodeURIComponent(v)}/delete`,{method:"POST",body:{}}),localFolder:v=>b("/local-folder",{method:"POST",body:{path:v}}),files:(v,j)=>b(`/files/${encodeURIComponent(v)}?path=${encodeURIComponent(j)}`),seed:v=>b(`/files/${encodeURIComponent(v)}/seed`),retrySeed:v=>b(`/files/${encodeURIComponent(v)}/seed/retry`,{method:"POST",body:{}}),prepareDownload:(v,j)=>b(`/files/${encodeURIComponent(v)}/download`,{method:"POST",body:{path:j}}),startUpload:v=>b(`/files/${encodeURIComponent(v)}/uploads`,{method:"POST",body:{}}),uploadFile:(v,j,S,N,C)=>b(`/files/${encodeURIComponent(v)}/uploads/${j}?path=${encodeURIComponent(S)}`,{method:"POST",body:N,raw:!0,signal:C}),commitUpload:(v,j,S)=>b(`/files/${encodeURIComponent(v)}/uploads/${j}/commit`,{method:"POST",body:{dir:S}}),cancelUpload:(v,j)=>b(`/files/${encodeURIComponent(v)}/uploads/${j}/cancel`,{method:"POST",body:{}}),ingress:()=>b("/ingress"),exposeService:v=>b("/ingress/expose",{method:"POST",body:v}),closeService:v=>b("/ingress/close",{method:"POST",body:{sandbox:v.sandbox,name:v.name}}),extendService:(v,j)=>b("/ingress/extend",{method:"POST",body:{sandbox:v.sandbox,name:v.name,closeAfterMinutes:j}})}}const cs=qr(),oC="",Na=/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(oC)?oC:"",Ko=!!Na,qc="Cloud is coming soon. We're still working on it.";function iP(e){try{const t=new URL(e);return t.origin===e&&t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname)&&!!t.port&&Number(t.port)>0&&!t.username&&!t.password}catch{return!1}}function lP(e){var t;try{const r=(t=/^#local-connect=([A-Za-z0-9_-]+)$/.exec(e))==null?void 0:t[1];if(!r||r.length>2048)return null;const a=JSON.parse(atob(r.replaceAll("-","+").replaceAll("_","/")));return!iP(a.origin)||!/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(a.nonce??"")||!/^[a-f0-9]{64}$/.test(a.challenge??"")?null:{origin:a.origin,nonce:a.nonce,challenge:a.challenge}}catch{return null}}function cP(e,t,r,a=Na){var l;return!!(a&&t&&e.source===t&&e.origin===a&&((l=e.data)==null?void 0:l.type)==="openrod-local-connected"&&e.data.nonce===r&&typeof e.data.code=="string"&&/^[a-f0-9]{64}\.[a-f0-9]{64}$/.test(e.data.code))}async function su(e,t,{signal:r}={}){const a=await fetch(`/api/local-cloud/${e}`,{signal:r,method:t===void 0?"GET":"POST",headers:{...Oy()?{"x-openrod-local-owner":Oy()}:{},...t===void 0?{}:{"content-type":"application/json","x-openshell-console":"1"}},body:t===void 0?void 0:JSON.stringify(t)}),l=await a.json().catch(()=>({}));if(l.code==="CLOUD_OWNER_CHANGED"&&window.dispatchEvent(new Event("openrod-session-expired")),!a.ok)throw Object.assign(new Error(l.error??"Cloud connection unavailable"),{status:a.status});return l}const uP=(e,t)=>new Promise((r,a)=>{const l=()=>{clearTimeout(c),a(new DOMException("Cloud preparation cancelled.","AbortError"))},c=setTimeout(()=>{t==null||t.removeEventListener("abort",l),r()},e);t==null||t.addEventListener("abort",l,{once:!0}),t!=null&&t.aborted&&l()});async function wR(e,{signal:t,onProgress:r=()=>{},wait:a=uP,attempts:l=120}={}){var c,u,f;for(let h=0;h<l;h++){t==null||t.throwIfAborted();const m=await e();if(t==null||t.throwIfAborted(),!m.connected)throw new Error("Your cloud connection expired. Connect again to continue.");if(m.error)throw new Error(m.error);if(r(m),((c=m.machine)==null?void 0:c.status)==="ready")return m;if(((u=m.machine)==null?void 0:u.status)==="error"||(f=m.machine)!=null&&f.error)throw new Error(m.machine.error??"Your cloud machine could not start.");h<l-1&&await a(5e3,t)}throw new Error("Your private machine is still preparing. Check its status before trying again.")}async function jR(e,t,r,a){const l=await e.cloudExport(r),c=await t.importCloud(a?{...l.bundle,destinationGroups:a}:l.bundle);return{...c,warning:c.warning||l.warning}}async function dP(e,t,r,a){if(t.target!=="local")throw Error("Choose a local destination for this workspace.");return jR(e,t,r,a)}async function fP(e,t=fetch){const r=await t("/api/cloud/local-connect/authorize",{method:"POST",headers:{"content-type":"application/json","x-openshell-console":"1"},body:JSON.stringify(e)}),a=await r.json().catch(()=>({}));if(!r.ok)throw new Error(a.error??"Could not finish sign-in.");if(typeof a.code!="string"||!/^[a-f0-9]{64}\.[a-f0-9]{64}$/.test(a.code))throw new Error("Invalid sign-in response.");return a}function mP({popup:e,origin:t,cloud:r=Na,request:a=su,events:l=window,focus:c=()=>window.focus(),setTimer:u=setInterval,clearTimer:f=clearInterval,now:h=Date.now}){let m,x=!1,p=!1,b,v;const j=new Promise((k,M)=>{b=k,v=M}),S=async()=>{m&&await a("cancel",{nonce:m}).catch(()=>{})},N=()=>{f(O),l.removeEventListener("message",E)};function C(k="Cloud sign-in was cancelled."){return p?Promise.resolve():(p=!0,N(),e.close(),v(new Error(k)),S())}const E=async k=>{if(!(p||x||!m||!cP(k,e,m,r))){x=!0;try{const M=await a("finish",{nonce:m,code:k.data.code});if(p){await S();return}if(!M.connected||!M.user)throw new Error("Sign-in did not finish. Try again.");p=!0,N(),e.close(),c(),b(M)}catch(M){if(p){await S();return}await C(M.message)}}},T=h()+15*6e4,O=u(()=>{(e.closed||h()>T)&&C(e.closed?"Cloud sign-in was cancelled.":"Cloud sign-in timed out. Try again.")},500);return l.addEventListener("message",E),Promise.resolve().then(async()=>{if(p)return;const k=await a("start",{origin:t});if(m=k.nonce,p){await S();return}e.location.href=k.url}).catch(k=>{p||C(k.message)}),{promise:j,cancel:C}}const Qp=g.createContext(null),SR=g.createContext(null),Er=()=>g.useContext(Qp);function Uv(){const e=g.useContext(SR);if(!e)throw new Error("useApi outside ComputeSession");return e}function hP({target:e,children:t}){const r=Er(),a=g.useMemo(()=>e&&(r!=null&&r.localViewer)?{...r,target:e,nativeActions:e==="local"||!!r.connected}:r,[r,e]);return s.jsx(Qp.Provider,{value:a,children:t})}function My({target:e,ownerScope:t,children:r}){const a=g.useMemo(()=>{const l=new AbortController;return{controller:l,generation:0,api:qr(e,l.signal)}},[e,t]);return g.useEffect(()=>{const l=++a.generation;return()=>queueMicrotask(()=>{l===a.generation&&a.controller.abort()})},[a]),s.jsx(SR.Provider,{value:a.api,children:r})}function pP({children:e,user:t,logout:r}){yR("cloud");const a={target:"cloud",localViewer:!1,nativeActions:!1,user:t,logout:r};return s.jsx(Qp.Provider,{value:a,children:s.jsx(My,{target:"local",children:e})})}function gP({children:e,status:t,onStatus:r,onCancel:a}){var b;const[l,c]=g.useState(((b=t.machine)==null?void 0:b.status)==="ready"),[u,f]=g.useState(t.machine),[h,m]=g.useState(""),[x,p]=g.useState(0);return g.useEffect(()=>{if(l)return;const v=new AbortController;return m(""),wR(()=>su("machine"),{signal:v.signal,onProgress:j=>{f(j.machine),r(j)}}).then(()=>c(!0)).catch(j=>{j.name!=="AbortError"&&m(j.message)}),()=>v.abort()},[x,l,r]),l?e:s.jsx("main",{className:"grid min-h-screen place-items-center px-6",children:s.jsxs("section",{className:"max-w-sm text-center",children:[s.jsx("h1",{className:"text-2xl font-semibold",children:"Preparing your private machine…"}),s.jsx("p",{role:"status",className:"mt-3 text-sm text-muted-foreground",children:(u==null?void 0:u.message)||"Your account has one dedicated machine. Its first start can take several minutes."}),h&&s.jsxs(s.Fragment,{children:[s.jsx("p",{role:"alert",className:"mt-4 text-sm text-destructive",children:h}),s.jsx("button",{className:"mt-4 text-sm underline",onClick:()=>p(v=>v+1),children:"Try again"})]}),s.jsx("button",{className:"mt-6 block w-full text-xs underline",onClick:a,children:"Use local compute"}),Na]})})}function xP({children:e}){var O;const[t,r]=g.useState(()=>rP(window.location.href,window.sessionStorage)),[a,l]=g.useState(()=>Ko?null:{connected:!1}),[c,u]=g.useState(""),[f,h]=g.useState(!1),[m,x]=g.useState(!1),p=g.useRef(null),b=g.useRef({uid:null,revision:0});yR(t),rC(a!=null&&a.connected?a.owner:null),g.useEffect(()=>{let k=!0;if(!Ko)return;su("status").then(A=>{k&&l(A)}).catch(A=>{k&&(u(A.message),l({connected:!1}))});const M=()=>{l({connected:!1}),u("Your cloud connection expired. Connect again to continue.")};return window.addEventListener("openrod-session-expired",M),()=>{var A;k=!1,window.removeEventListener("openrod-session-expired",M),(A=p.current)==null||A.cancel("Cloud connection cancelled.")}},[]),g.useEffect(()=>{if(!(a!=null&&a.connected)||!a.expires)return;const k=typeof a.expires=="number"?a.expires:Date.parse(a.expires);if(!Number.isFinite(k))return;const M=setTimeout(()=>{l({connected:!1}),u("Your cloud connection expired. Connect again to continue.")},Math.max(0,k-Date.now()));return()=>clearTimeout(M)},[a]);function v(k){if(!["local","cloud"].includes(k))return;try{sessionStorage.setItem(gR,k)}catch{}const M=new URL(window.location.href);M.searchParams.delete("target"),M.hash="",window.history.replaceState(null,"",M),window.dispatchEvent(new HashChangeEvent("hashchange")),r(k)}async function j(){if(a!=null&&a.connected)return a;if(!Ko)throw new Error(qc);if(p.current)throw new Error("A cloud sign-in is already open.");const k=window.open("about:blank","_blank","popup,width=520,height=720");if(!k)throw new Error("Allow popups to connect your local OpenRod to cloud.");const M=mP({popup:k,origin:window.location.origin});p.current=M,h(!0),u("");try{const A=await M.promise;if(p.current!==M)throw new Error("Cloud sign-in was cancelled.");return rC(A.owner),l(A),A}catch(A){throw p.current===M&&u(A.message),A}finally{p.current===M&&(p.current=null,h(!1))}}function S(k="Cloud connection cancelled."){const M=p.current;if(M)return p.current=null,h(!1),u(k),M.cancel(k)}async function N(){try{await su("disconnect",{}),l({connected:!1}),v("local")}catch(k){[401,403].includes(k.status)&&(l({connected:!1}),v("local")),u(k.message)}}b.current=aP(b.current,a!=null&&a.connected?(O=a.user)==null?void 0:O.uid:null);const C=b.current.revision,E=`${t}:${C}`,T={target:t,localViewer:!0,nativeActions:t==="local"||!!(a!=null&&a.connected),user:a==null?void 0:a.user,connected:!!(a!=null&&a.connected),connecting:f,error:c,connect:j,disconnect:N,selectTarget:v,createRequested:m,requestCreate:x,cancelConnect:()=>S()};return s.jsx(Qp.Provider,{value:T,children:t==="cloud"&&!(a!=null&&a.connected)?s.jsx("main",{className:"grid min-h-screen place-items-center px-6",children:s.jsxs("section",{className:"max-w-sm text-center",children:[s.jsx("h1",{className:"text-2xl font-semibold",children:"Connect your cloud workspace"}),s.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Sign in with Google to control your private cloud machine from local OpenRod."}),c&&s.jsx("p",{role:"alert",className:"mt-4 text-sm text-destructive",children:c}),Ko?s.jsx("button",{disabled:a===null||f,className:"mt-6 rounded-lg bg-primary px-4 py-3 text-sm text-primary-foreground disabled:opacity-50",onClick:()=>j().catch(()=>{}),children:a===null?"Checking connection…":f?"Connecting…":"Continue with Google"}):s.jsxs(s.Fragment,{children:[s.jsx("button",{disabled:!0,"aria-disabled":"true",title:qc,className:"mt-6 cursor-not-allowed rounded-lg bg-primary px-4 py-3 text-sm text-primary-foreground opacity-50",children:"Continue with Google"}),s.jsx("p",{role:"status",className:"mt-3 text-xs text-muted-foreground",children:qc})]}),s.jsx("button",{className:"mt-4 block w-full text-xs underline",onClick:()=>{S(),v("local")},children:"Use local compute"})]})}):t==="cloud"?s.jsx(gP,{status:a,onStatus:l,onCancel:()=>v("local"),children:s.jsx(My,{target:t,ownerScope:C,children:e},E)},"cloud"):s.jsx(My,{target:t,ownerScope:C,children:e},E)})}/**
|
|
51
|
+
* @license lucide-react v0.577.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const NR=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim();/**
|
|
56
|
+
* @license lucide-react v0.577.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const bP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
61
|
+
* @license lucide-react v0.577.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const yP=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase());/**
|
|
66
|
+
* @license lucide-react v0.577.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const aC=e=>{const t=yP(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
71
|
+
* @license lucide-react v0.577.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/var vP={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
76
|
+
* @license lucide-react v0.577.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const wP=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
81
|
+
* @license lucide-react v0.577.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const jP=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:l="",children:c,iconNode:u,...f},h)=>g.createElement("svg",{ref:h,...vP,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:NR("lucide",l),...!c&&!wP(f)&&{"aria-hidden":"true"},...f},[...u.map(([m,x])=>g.createElement(m,x)),...Array.isArray(c)?c:[c]]));/**
|
|
86
|
+
* @license lucide-react v0.577.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const nt=(e,t)=>{const r=g.forwardRef(({className:a,...l},c)=>g.createElement(jP,{ref:c,iconNode:t,className:NR(`lucide-${bP(aC(e))}`,`lucide-${e}`,a),...l}));return r.displayName=aC(e),r};/**
|
|
91
|
+
* @license lucide-react v0.577.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const SP=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],NP=nt("activity",SP);/**
|
|
96
|
+
* @license lucide-react v0.577.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const CP=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],nf=nt("arrow-down",CP);/**
|
|
101
|
+
* @license lucide-react v0.577.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const kP=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Hv=nt("arrow-left",kP);/**
|
|
106
|
+
* @license lucide-react v0.577.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const TP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],_h=nt("arrow-right",TP);/**
|
|
111
|
+
* @license lucide-react v0.577.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const EP=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Mi=nt("arrow-up-right",EP);/**
|
|
116
|
+
* @license lucide-react v0.577.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const RP=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],sf=nt("arrow-up",RP);/**
|
|
121
|
+
* @license lucide-react v0.577.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const AP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],OP=nt("ban",AP);/**
|
|
126
|
+
* @license lucide-react v0.577.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const MP=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],DP=nt("book-open",MP);/**
|
|
131
|
+
* @license lucide-react v0.577.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const zP=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],CR=nt("bot",zP);/**
|
|
136
|
+
* @license lucide-react v0.577.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const PP=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Fl=nt("box",PP);/**
|
|
141
|
+
* @license lucide-react v0.577.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const IP=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],_P=nt("building-2",IP);/**
|
|
146
|
+
* @license lucide-react v0.577.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const LP=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],BP=nt("cable",LP);/**
|
|
151
|
+
* @license lucide-react v0.577.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const $P=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],VP=nt("calendar-clock",$P);/**
|
|
156
|
+
* @license lucide-react v0.577.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const UP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qn=nt("check",UP);/**
|
|
161
|
+
* @license lucide-react v0.577.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const HP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ko=nt("chevron-down",HP);/**
|
|
166
|
+
* @license lucide-react v0.577.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const FP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hr=nt("chevron-right",FP);/**
|
|
171
|
+
* @license lucide-react v0.577.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const GP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kR=nt("chevron-up",GP);/**
|
|
176
|
+
* @license lucide-react v0.577.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const qP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],iC=nt("circle-alert",qP);/**
|
|
181
|
+
* @license lucide-react v0.577.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const YP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],KP=nt("circle-check",YP);/**
|
|
186
|
+
* @license lucide-react v0.577.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const XP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],WP=nt("circle-x",XP);/**
|
|
191
|
+
* @license lucide-react v0.577.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const QP=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ZP=nt("cloud",QP);/**
|
|
196
|
+
* @license lucide-react v0.577.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const JP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Zp=nt("copy",JP);/**
|
|
201
|
+
* @license lucide-react v0.577.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const eI=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],Fv=nt("door-open",eI);/**
|
|
206
|
+
* @license lucide-react v0.577.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const tI=[["path",{d:"M10 12h.01",key:"1kxr2c"}],["path",{d:"M18 20V6a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v14",key:"36qu9e"}],["path",{d:"M2 20h20",key:"owomy5"}]],TR=nt("door-closed",tI);/**
|
|
211
|
+
* @license lucide-react v0.577.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const nI=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Yc=nt("download",nI);/**
|
|
216
|
+
* @license lucide-react v0.577.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const sI=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ER=nt("earth",sI);/**
|
|
221
|
+
* @license lucide-react v0.577.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const rI=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],oI=nt("ellipsis",rI);/**
|
|
226
|
+
* @license lucide-react v0.577.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const aI=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],iI=nt("external-link",aI);/**
|
|
231
|
+
* @license lucide-react v0.577.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const lI=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],RR=nt("file-code-corner",lI);/**
|
|
236
|
+
* @license lucide-react v0.577.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const cI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Gv=nt("file-text",cI);/**
|
|
241
|
+
* @license lucide-react v0.577.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const uI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],dI=nt("file",uI);/**
|
|
246
|
+
* @license lucide-react v0.577.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const fI=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],mI=nt("folder-git-2",fI);/**
|
|
251
|
+
* @license lucide-react v0.577.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const hI=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],pI=nt("folder-input",hI);/**
|
|
256
|
+
* @license lucide-react v0.577.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const gI=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],lC=nt("folder",gI);/**
|
|
261
|
+
* @license lucide-react v0.577.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const xI=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],cC=nt("funnel",xI);/**
|
|
266
|
+
* @license lucide-react v0.577.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const bI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],qv=nt("globe",bI);/**
|
|
271
|
+
* @license lucide-react v0.577.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const yI=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],AR=nt("hard-drive",yI);/**
|
|
276
|
+
* @license lucide-react v0.577.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const vI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ru=nt("info",vI);/**
|
|
281
|
+
* @license lucide-react v0.577.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const wI=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],pu=nt("key-round",wI);/**
|
|
286
|
+
* @license lucide-react v0.577.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const jI=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],dp=nt("laptop",jI);/**
|
|
291
|
+
* @license lucide-react v0.577.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const SI=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],NI=nt("layers",SI);/**
|
|
296
|
+
* @license lucide-react v0.577.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const CI=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],OR=nt("link-2",CI);/**
|
|
301
|
+
* @license lucide-react v0.577.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const kI=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],TI=nt("list-filter",kI);/**
|
|
306
|
+
* @license lucide-react v0.577.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const EI=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ou=nt("loader-circle",EI);/**
|
|
311
|
+
* @license lucide-react v0.577.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const RI=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],uC=nt("lock",RI);/**
|
|
316
|
+
* @license lucide-react v0.577.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const AI=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],OI=nt("monitor",AI);/**
|
|
321
|
+
* @license lucide-react v0.577.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const MI=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],DI=nt("moon",MI);/**
|
|
326
|
+
* @license lucide-react v0.577.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const zI=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Jp=nt("network",zI);/**
|
|
331
|
+
* @license lucide-react v0.577.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const PI=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],MR=nt("octagon-x",PI);/**
|
|
336
|
+
* @license lucide-react v0.577.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const II=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Yv=nt("package",II);/**
|
|
341
|
+
* @license lucide-react v0.577.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const _I=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],LI=nt("panel-left",_I);/**
|
|
346
|
+
* @license lucide-react v0.577.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const BI=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],$I=nt("pause",BI);/**
|
|
351
|
+
* @license lucide-react v0.577.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const VI=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],dC=nt("pencil",VI);/**
|
|
356
|
+
* @license lucide-react v0.577.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const UI=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],DR=nt("play",UI);/**
|
|
361
|
+
* @license lucide-react v0.577.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const HI=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Kv=nt("plug",HI);/**
|
|
366
|
+
* @license lucide-react v0.577.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const FI=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ds=nt("plus",FI);/**
|
|
371
|
+
* @license lucide-react v0.577.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const GI=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],$a=nt("refresh-cw",GI);/**
|
|
376
|
+
* @license lucide-react v0.577.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const qI=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],YI=nt("rotate-ccw",qI);/**
|
|
381
|
+
* @license lucide-react v0.577.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const KI=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],XI=nt("rotate-cw",KI);/**
|
|
386
|
+
* @license lucide-react v0.577.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const WI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],QI=nt("search",WI);/**
|
|
391
|
+
* @license lucide-react v0.577.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const ZI=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],rf=nt("server",ZI);/**
|
|
396
|
+
* @license lucide-react v0.577.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const JI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Gl=nt("shield-check",JI);/**
|
|
401
|
+
* @license lucide-react v0.577.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const e6=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],Xv=nt("shield-off",e6);/**
|
|
406
|
+
* @license lucide-react v0.577.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const t6=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],n6=nt("sliders-horizontal",t6);/**
|
|
411
|
+
* @license lucide-react v0.577.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const s6=[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],r6=nt("square-code",s6);/**
|
|
416
|
+
* @license lucide-react v0.577.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const o6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],a6=nt("square-plus",o6);/**
|
|
421
|
+
* @license lucide-react v0.577.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const i6=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],zR=nt("square-terminal",i6);/**
|
|
426
|
+
* @license lucide-react v0.577.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const l6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],c6=nt("square",l6);/**
|
|
431
|
+
* @license lucide-react v0.577.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const u6=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],d6=nt("sun",u6);/**
|
|
436
|
+
* @license lucide-react v0.577.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const f6=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wv=nt("terminal",f6);/**
|
|
441
|
+
* @license lucide-react v0.577.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const m6=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],fC=nt("timer",m6);/**
|
|
446
|
+
* @license lucide-react v0.577.0 - ISC
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the ISC license.
|
|
449
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/const h6=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Gn=nt("trash-2",h6);/**
|
|
451
|
+
* @license lucide-react v0.577.0 - ISC
|
|
452
|
+
*
|
|
453
|
+
* This source code is licensed under the ISC license.
|
|
454
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
+
*/const p6=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Va=nt("triangle-alert",p6);/**
|
|
456
|
+
* @license lucide-react v0.577.0 - ISC
|
|
457
|
+
*
|
|
458
|
+
* This source code is licensed under the ISC license.
|
|
459
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
+
*/const g6=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],x6=nt("upload",g6);/**
|
|
461
|
+
* @license lucide-react v0.577.0 - ISC
|
|
462
|
+
*
|
|
463
|
+
* This source code is licensed under the ISC license.
|
|
464
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
+
*/const b6=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],y6=nt("user-round",b6);/**
|
|
466
|
+
* @license lucide-react v0.577.0 - ISC
|
|
467
|
+
*
|
|
468
|
+
* This source code is licensed under the ISC license.
|
|
469
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
+
*/const v6=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Oa=nt("users",v6);/**
|
|
471
|
+
* @license lucide-react v0.577.0 - ISC
|
|
472
|
+
*
|
|
473
|
+
* This source code is licensed under the ISC license.
|
|
474
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
+
*/const w6=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],mC=nt("webhook",w6);/**
|
|
476
|
+
* @license lucide-react v0.577.0 - ISC
|
|
477
|
+
*
|
|
478
|
+
* This source code is licensed under the ISC license.
|
|
479
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
+
*/const j6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],En=nt("x",j6),PR=[{id:"claude",name:"Claude Code",command:"claude",config:".claude.json",key:"mcpServers",format:"claude",skills:".claude/skills"},{id:"codex",name:"Codex",command:"codex",config:".codex/config.toml",key:"mcp_servers",format:"codex",skills:".agents/skills",extraSkillRoots:[".codex/skills"]},{id:"opencode",name:"OpenCode",command:"opencode",config:".config/opencode/opencode.json",alternateConfig:".config/opencode/opencode.jsonc",key:"mcp",format:"opencode",skills:".config/opencode/skills",extraSkillRoots:[".claude/skills",".agents/skills"]},{id:"pi",name:"Pi",command:"pi",config:".pi/agent/mcp.json",key:"mcpServers",format:"json",skills:".pi/agent/skills",extraSkillRoots:[".agents/skills"],note:"Requires a Pi version with built-in MCP support; MCP extensions can override it."},{id:"cursor",name:"Cursor",command:"cursor-agent",config:".cursor/mcp.json",key:"mcpServers",format:"json",skills:".cursor/skills"},{id:"antigravity",name:"Antigravity CLI",command:"agy",config:".gemini/config/mcp_config.json",key:"mcpServers",format:"antigravity",skills:".gemini/config/skills"},{id:"copilot",name:"GitHub Copilot",command:"copilot",config:".copilot/mcp-config.json",key:"mcpServers",format:"copilot",skills:".copilot/skills"},{id:"kiro",name:"Kiro CLI",command:"kiro-cli",config:".kiro/settings/mcp.json",key:"mcpServers",format:"json",skills:".kiro/skills"},{id:"droid",name:"Factory Droid",command:"droid",config:".factory/mcp.json",key:"mcpServers",format:"droid",skills:".factory/skills"},{id:"aider",name:"Aider",command:"aider",reason:"Aider has no supported native MCP or SKILL.md setup integration. Choose another agent to use this Setup."}],S6=PR,N6=PR.filter(e=>e.config&&e.skills),Dy=e=>N6.find(t=>t.id===e),C6=e=>e.filter(t=>!!Dy(t));function eg(){return typeof window<"u"}function zs(e){return Qv(e)?(e.nodeName||"").toLowerCase():"#document"}function xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ua(e){var t;return(t=(Qv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qv(e){return eg()?e instanceof Node||e instanceof xn(e).Node:!1}function Gt(e){return eg()?e instanceof Element||e instanceof xn(e).Element:!1}function un(e){return eg()?e instanceof HTMLElement||e instanceof xn(e).HTMLElement:!1}function au(e){return!eg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xn(e).ShadowRoot}function of(e){const{overflow:t,overflowX:r,overflowY:a,display:l}=Cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&l!=="inline"&&l!=="contents"}function k6(e){return/^(table|td|th)$/.test(zs(e))}function tg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const T6=/transform|translate|scale|rotate|perspective|filter/,E6=/paint|layout|strict|content/,bl=e=>!!e&&e!=="none";let k0;function Zv(e){const t=Gt(e)?Cr(e):e;return bl(t.transform)||bl(t.translate)||bl(t.scale)||bl(t.rotate)||bl(t.perspective)||!Jv()&&(bl(t.backdropFilter)||bl(t.filter))||T6.test(t.willChange||"")||E6.test(t.contain||"")}function R6(e){let t=Ma(e);for(;un(t)&&!Ta(t);){if(Zv(t))return t;if(tg(t))return null;t=Ma(t)}return null}function Jv(){return k0==null&&(k0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),k0}function Ta(e){return/^(html|body|#document)$/.test(zs(e))}function Cr(e){return xn(e).getComputedStyle(e)}function ng(e){return Gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ma(e){if(zs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||au(e)&&e.host||Ua(e);return au(t)?t.host:t}function IR(e){const t=Ma(e);return Ta(t)?(e.ownerDocument||e).body:un(t)&&of(t)?t:IR(t)}function $d(e,t,r){var a;t===void 0&&(t=[]),r===void 0&&(r=!0);const l=IR(e),c=l===((a=e.ownerDocument)==null?void 0:a.body),u=xn(l);if(c){const f=zy(u);return t.concat(u,u.visualViewport||[],of(l)?l:[],f&&r?$d(f):[])}else return t.concat(l,$d(l,[],r))}function zy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const e1={...$z},hC={};function fs(e,t){const r=g.useRef(hC);return r.current===hC&&(r.current=e(t)),r}const T0=e1.useInsertionEffect,A6=T0&&T0!==e1.useLayoutEffect?T0:e=>e();function Ze(e){const t=fs(O6).current;return t.next=e,A6(t.effect),t.trampoline}function O6(){const e={next:void 0,callback:M6,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function M6(){}const D6=()=>{},qe=typeof document<"u"?g.useLayoutEffect:D6;function Py(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const t1={};function Ys(e,t,r,a,l){if(!r&&!a&&!l&&!e)return fp(t);let c=fp(e);return t&&(c=Sd(c,t)),r&&(c=Sd(c,r)),a&&(c=Sd(c,a)),l&&(c=Sd(c,l)),c}function z6(e){if(e.length===0)return t1;if(e.length===1)return fp(e[0]);let t=fp(e[0]);for(let r=1;r<e.length;r+=1)t=Sd(t,e[r]);return t}function fp(e){return n1(e)?{...LR(e,t1)}:P6(e)}function Sd(e,t){return n1(t)?LR(t,e):I6(e,t)}function P6(e){const t={...e};for(const r in t){const a=t[r];_R(r,a)&&(t[r]=BR(a))}return t}function I6(e,t){if(!t)return e;for(const r in t){const a=t[r];switch(r){case"style":{e[r]=Py(e.style,a);break}case"className":{e[r]=$R(e.className,a);break}default:_R(r,a)?e[r]=_6(e[r],a):e[r]=a}}return e}function _R(e,t){const r=e.charCodeAt(0),a=e.charCodeAt(1),l=e.charCodeAt(2);return r===111&&a===110&&l>=65&&l<=90&&(typeof t=="function"||typeof t>"u")}function n1(e){return typeof e=="function"}function LR(e,t){return n1(e)?e(t):e??t1}function _6(e,t){return t?e?(...r)=>{const a=r[0];if(VR(a)){const c=a;mp(c);const u=t(...r);return c.baseUIHandlerPrevented||e==null||e(...r),u}const l=t(...r);return e==null||e(...r),l}:BR(t):e}function BR(e){return e&&((...t)=>{const r=t[0];return VR(r)&&mp(r),e(...t)})}function mp(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function $R(e,t){return t?e?t+" "+e:t:e}function VR(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function L6(e,t){return function(a,...l){const c=new URL(e);return c.searchParams.set("code",a.toString()),l.forEach(u=>c.searchParams.append("args[]",u)),`${t} error #${a}; visit ${c} for the full message.`}}const Zt=L6("https://base-ui.com/production-error","Base UI"),UR=g.createContext(void 0);function sg(e=!1){const t=g.useContext(UR);if(t===void 0&&!e)throw new Error(Zt(16));return t}function B6(e){const{focusableWhenDisabled:t,disabled:r,composite:a=!1,tabIndex:l=0,isNativeButton:c}=e,u=a&&t!==!1,f=a&&t===!1;return{props:g.useMemo(()=>{const m={onKeyDown(x){r&&t&&x.key!=="Tab"&&x.preventDefault()}};return a||(m.tabIndex=l,!c&&r&&(m.tabIndex=t?l:-1)),(c&&(t||u)||!c&&r)&&(m["aria-disabled"]=r),c&&(!t||f)&&(m.disabled=r),m},[a,r,t,u,f,c,l])}}function Ft(e){return(e==null?void 0:e.ownerDocument)||document}function Kc(e,t,{detail:r=0}={}){e.dispatchEvent(new(xn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function oo(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:a=0,native:l=!0,composite:c}=e,u=g.useRef(null),f=sg(!0),h=c??f!==void 0,{props:m}=B6({focusableWhenDisabled:r,disabled:t,composite:h,tabIndex:a,isNativeButton:l}),x=g.useCallback(()=>{const v=u.current;E0(v)&&h&&t&&m.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,m.disabled,h]);qe(x,[x]);const p=g.useCallback((v={})=>{const{onClick:j,onMouseDown:S,onKeyUp:N,onKeyDown:C,onPointerDown:E,...T}=v;return Ys({onClick(O){if(t){O.preventDefault();return}j==null||j(O)},onMouseDown(O){t||S==null||S(O)},onKeyDown(O){if(t||(mp(O),C==null||C(O),O.baseUIHandlerPrevented))return;const k=O.target===O.currentTarget,M=O.currentTarget,A=E0(M),R=!l&&$6(M),z=k&&(l?A:!R),_=O.key==="Enter",L=O.key===" ",Y=M.getAttribute("role"),P=(Y==null?void 0:Y.startsWith("menuitem"))||Y==="option"||Y==="gridcell";if(k&&h&&L){if(O.defaultPrevented&&P)return;O.preventDefault(),(!l||A)&&(O.preventBaseUIHandler(),Kc(M,O));return}if(!z||l||!L&&!_){k&&R&&L&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),_&&(O.preventBaseUIHandler(),Kc(M,O)))},onKeyUp(O){if(!t){if(mp(O),N==null||N(O),O.target===O.currentTarget&&l&&h&&E0(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!l&&!h&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),Kc(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}E==null||E(O)}},l?{type:"button"}:{role:"button"},m,T)},[t,m,h,l]),b=Ze(v=>{u.current=v,x()});return{getButtonProps:p,buttonRef:b}}function E0(e){return un(e)&&e.tagName==="BUTTON"}function $6(e){return un(e)&&e.tagName==="A"&&!!e.href}function Yr(e,t,r,a){const l=fs(HR).current;return U6(l,e,t,r,a)&&FR(l,[e,t,r,a]),l.callback}function V6(e){const t=fs(HR).current;return H6(t,e)&&FR(t,e),t.callback}function HR(){return{callback:null,cleanup:null,refs:[]}}function U6(e,t,r,a,l){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==a||e.refs[3]!==l}function H6(e,t){return e.refs.length!==t.length||e.refs.some((r,a)=>r!==t[a])}function FR(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const a=Array(t.length).fill(null);for(let l=0;l<t.length;l+=1){const c=t[l];if(c!=null)switch(typeof c){case"function":{const u=c(r);typeof u=="function"&&(a[l]=u);break}case"object":{c.current=r;break}}}e.cleanup=()=>{for(let l=0;l<t.length;l+=1){const c=t[l];if(c!=null)switch(typeof c){case"function":{const u=a[l];typeof u=="function"?u():c(null);break}case"object":{c.current=null;break}}}}}}}const F6=parseInt(g.version,10);function s1(e){return F6>=e}function pC(e){if(!g.isValidElement(e))return null;const t=e,r=t.props;return(s1(19)?r==null?void 0:r.ref:t.ref)??null}function Tn(){}const kr=Object.freeze([]),gn=Object.freeze({});function G6(e,t){const r={};for(const a in e){const l=e[a];if(t!=null&&t.hasOwnProperty(a)){const c=t[a](l);c!=null&&Object.assign(r,c);continue}l===!0?r[`data-${a.toLowerCase()}`]="":l&&(r[`data-${a.toLowerCase()}`]=l.toString())}return r}function q6(e,t){return typeof e=="function"?e(t):e}function GR(e,t){return typeof e=="function"?e(t):e}function Nt(e,t,r={}){let a=t.render;r.enabled!==!1&&(a=W6(a));const l=Y6(t,r,a);if(r.enabled===!1)return null;const c=r.state??gn;return Q6(e,a,l,c)}function Y6(e,t,r){const{className:a,style:l}=e,{state:c=gn,ref:u,props:f,stateAttributesMapping:h,enabled:m=!0}=t,x=m?q6(a,c):void 0,p=m?GR(l,c):void 0,b=m?G6(c,h):gn,v=m&&f?K6(f):void 0,j=m?Py(b,v)??{}:gn;return typeof document<"u"&&(m?Array.isArray(u)?j.ref=V6([j.ref,pC(r),...u]):j.ref=Yr(j.ref,pC(r),u):Yr(null,null)),m?(x!==void 0&&(j.className=$R(j.className,x)),p!==void 0&&(j.style=Py(j.style,p)),j):gn}function K6(e){return Array.isArray(e)?z6(e):Ys(void 0,e)}const X6=Symbol.for("react.lazy");function W6(e){if((e==null?void 0:e.$$typeof)!==X6)return e;const t=g.Children.toArray(e)[0];return g.isValidElement(t)?t:e}function Q6(e,t,r,a){if(t){if(typeof t=="function")return t(r,a);const l=Ys(r,t.props);return l.ref=r.ref,g.cloneElement(t,l)}if(e&&typeof e=="string")return Z6(e,r);throw new Error(Zt(8))}function Z6(e,t){return e==="button"?g.createElement("button",{type:"button",...t,key:t.key}):e==="img"?g.createElement("img",{alt:"",...t,key:t.key}):g.createElement(e,t)}const J6=g.forwardRef(function(t,r){const{render:a,className:l,disabled:c=!1,focusableWhenDisabled:u=!1,nativeButton:f=!0,style:h,...m}=t,{getButtonProps:x,buttonRef:p}=oo({disabled:c,focusableWhenDisabled:u,native:f});return Nt("button",t,{state:{disabled:c},ref:[r,p],props:[m,x]})});function qR(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=qR(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function YR(){for(var e,t,r=0,a="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=qR(e))&&(a&&(a+=" "),a+=t);return a}const gC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xC=YR,rg=(e,t)=>r=>{var a;if((t==null?void 0:t.variants)==null)return xC(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:c}=t,u=Object.keys(l).map(m=>{const x=r==null?void 0:r[m],p=c==null?void 0:c[m];if(x===null)return null;const b=gC(x)||gC(p);return l[m][b]}),f=r&&Object.entries(r).reduce((m,x)=>{let[p,b]=x;return b===void 0||(m[p]=b),m},{}),h=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,x)=>{let{class:p,className:b,...v}=x;return Object.entries(v).every(j=>{let[S,N]=j;return Array.isArray(N)?N.includes({...c,...f}[S]):{...c,...f}[S]===N})?[...m,p,b]:m},[]);return xC(e,u,h,r==null?void 0:r.class,r==null?void 0:r.className)},e_=(e,t)=>{const r=new Array(e.length+t.length);for(let a=0;a<e.length;a++)r[a]=e[a];for(let a=0;a<t.length;a++)r[e.length+a]=t[a];return r},t_=(e,t)=>({classGroupId:e,validator:t}),KR=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),hp="-",bC=[],n_="arbitrary..",s_=e=>{const t=o_(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return r_(u);const f=u.split(hp),h=f[0]===""&&f.length>1?1:0;return XR(f,h,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const h=a[u],m=r[u];return h?m?e_(m,h):h:m||bC}return r[u]||bC}}},XR=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const l=e[t],c=r.nextPart.get(l);if(c){const m=XR(e,t+1,c);if(m)return m}const u=r.validators;if(u===null)return;const f=t===0?e.join(hp):e.slice(t).join(hp),h=u.length;for(let m=0;m<h;m++){const x=u[m];if(x.validator(f))return x.classGroupId}},r_=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),a=t.slice(0,r);return a?n_+a:void 0})(),o_=e=>{const{theme:t,classGroups:r}=e;return a_(r,t)},a_=(e,t)=>{const r=KR();for(const a in e){const l=e[a];r1(l,r,a,t)}return r},r1=(e,t,r,a)=>{const l=e.length;for(let c=0;c<l;c++){const u=e[c];i_(u,t,r,a)}},i_=(e,t,r,a)=>{if(typeof e=="string"){l_(e,t,r);return}if(typeof e=="function"){c_(e,t,r,a);return}u_(e,t,r,a)},l_=(e,t,r)=>{const a=e===""?t:WR(t,e);a.classGroupId=r},c_=(e,t,r,a)=>{if(d_(e)){r1(e(a),t,r,a);return}t.validators===null&&(t.validators=[]),t.validators.push(t_(r,e))},u_=(e,t,r,a)=>{const l=Object.entries(e),c=l.length;for(let u=0;u<c;u++){const[f,h]=l[u];r1(h,WR(t,f),r,a)}},WR=(e,t)=>{let r=e;const a=t.split(hp),l=a.length;for(let c=0;c<l;c++){const u=a[c];let f=r.nextPart.get(u);f||(f=KR(),r.nextPart.set(u,f)),r=f}return r},d_=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,f_=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),a=Object.create(null);const l=(c,u)=>{r[c]=u,t++,t>e&&(t=0,a=r,r=Object.create(null))};return{get(c){let u=r[c];if(u!==void 0)return u;if((u=a[c])!==void 0)return l(c,u),u},set(c,u){c in r?r[c]=u:l(c,u)}}},Iy="!",yC=":",m_=[],vC=(e,t,r,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:a,isExternal:l}),h_=e=>{const{prefix:t,experimentalParseClassName:r}=e;let a=l=>{const c=[];let u=0,f=0,h=0,m;const x=l.length;for(let S=0;S<x;S++){const N=l[S];if(u===0&&f===0){if(N===yC){c.push(l.slice(h,S)),h=S+1;continue}if(N==="/"){m=S;continue}}N==="["?u++:N==="]"?u--:N==="("?f++:N===")"&&f--}const p=c.length===0?l:l.slice(h);let b=p,v=!1;p.endsWith(Iy)?(b=p.slice(0,-1),v=!0):p.startsWith(Iy)&&(b=p.slice(1),v=!0);const j=m&&m>h?m-h:void 0;return vC(c,v,b,j)};if(t){const l=t+yC,c=a;a=u=>u.startsWith(l)?c(u.slice(l.length)):vC(m_,!1,u,void 0,!0)}if(r){const l=a;a=c=>r({className:c,parseClassName:l})}return a},p_=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,a)=>{t.set(r,1e6+a)}),r=>{const a=[];let l=[];for(let c=0;c<r.length;c++){const u=r[c],f=u[0]==="[",h=t.has(u);f||h?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},g_=e=>({cache:f_(e.cacheSize),parseClassName:h_(e),sortModifiers:p_(e),postfixLookupClassGroupIds:x_(e),...s_(e)}),x_=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let a=0;a<r.length;a++)t[r[a]]=!0;return t},b_=/\s+/,y_=(e,t)=>{const{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:c,postfixLookupClassGroupIds:u}=t,f=[],h=e.trim().split(b_);let m="";for(let x=h.length-1;x>=0;x-=1){const p=h[x],{isExternal:b,modifiers:v,hasImportantModifier:j,baseClassName:S,maybePostfixModifierPosition:N}=r(p);if(b){m=p+(m.length>0?" "+m:m);continue}let C=!!N,E;if(C){const A=S.substring(0,N);E=a(A);const R=E&&u[E]?a(S):void 0;R&&R!==E&&(E=R,C=!1)}else E=a(S);if(!E){if(!C){m=p+(m.length>0?" "+m:m);continue}if(E=a(S),!E){m=p+(m.length>0?" "+m:m);continue}C=!1}const T=v.length===0?"":v.length===1?v[0]:c(v).join(":"),O=j?T+Iy:T,k=O+E;if(f.indexOf(k)>-1)continue;f.push(k);const M=l(E,C);for(let A=0;A<M.length;++A){const R=M[A];f.push(O+R)}m=p+(m.length>0?" "+m:m)}return m},v_=(...e)=>{let t=0,r,a,l="";for(;t<e.length;)(r=e[t++])&&(a=QR(r))&&(l&&(l+=" "),l+=a);return l},QR=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=QR(e[a]))&&(r&&(r+=" "),r+=t);return r},w_=(e,...t)=>{let r,a,l,c;const u=h=>{const m=t.reduce((x,p)=>p(x),e());return r=g_(m),a=r.cache.get,l=r.cache.set,c=f,f(h)},f=h=>{const m=a(h);if(m)return m;const x=y_(h,r);return l(h,x),x};return c=u,(...h)=>c(v_(...h))},j_=[],ss=e=>{const t=r=>r[e]||j_;return t.isThemeGetter=!0,t.themeKey=e,t},ZR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,JR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,S_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,N_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,T_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ji=e=>S_.test(e),Ut=e=>!!e&&!Number.isNaN(Number(e)),$o=e=>!!e&&Number.isInteger(Number(e)),R0=e=>e.endsWith("%")&&Ut(e.slice(0,-1)),ya=e=>N_.test(e),eA=()=>!0,R_=e=>C_.test(e)&&!k_.test(e),o1=()=>!1,A_=e=>T_.test(e),O_=e=>E_.test(e),M_=e=>!it(e)&&!lt(e),D_=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),z_=e=>Bi(e,sA,o1),it=e=>ZR.test(e),yl=e=>Bi(e,rA,R_),wC=e=>Bi(e,U_,Ut),P_=e=>Bi(e,aA,eA),I_=e=>Bi(e,oA,o1),jC=e=>Bi(e,tA,o1),__=e=>Bi(e,nA,O_),eh=e=>Bi(e,iA,A_),lt=e=>JR.test(e),xd=e=>ql(e,rA),L_=e=>ql(e,oA),SC=e=>ql(e,tA),B_=e=>ql(e,sA),$_=e=>ql(e,nA),th=e=>ql(e,iA,!0),V_=e=>ql(e,aA,!0),Bi=(e,t,r)=>{const a=ZR.exec(e);return a?a[1]?t(a[1]):r(a[2]):!1},ql=(e,t,r=!1)=>{const a=JR.exec(e);return a?a[1]?t(a[1]):r:!1},tA=e=>e==="position"||e==="percentage",nA=e=>e==="image"||e==="url",sA=e=>e==="length"||e==="size"||e==="bg-size",rA=e=>e==="length",U_=e=>e==="number",oA=e=>e==="family-name",aA=e=>e==="number"||e==="weight",iA=e=>e==="shadow",H_=()=>{const e=ss("color"),t=ss("font"),r=ss("text"),a=ss("font-weight"),l=ss("tracking"),c=ss("leading"),u=ss("breakpoint"),f=ss("container"),h=ss("spacing"),m=ss("radius"),x=ss("shadow"),p=ss("inset-shadow"),b=ss("text-shadow"),v=ss("drop-shadow"),j=ss("blur"),S=ss("perspective"),N=ss("aspect"),C=ss("ease"),E=ss("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...O(),lt,it],M=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],R=()=>[lt,it,h],z=()=>[ji,"full","auto",...R()],_=()=>[$o,"none","subgrid",lt,it],L=()=>["auto",{span:["full",$o,lt,it]},$o,lt,it],Y=()=>[$o,"auto",lt,it],P=()=>["auto","min","max","fr",lt,it],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],F=()=>[ji,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],q=()=>[f,ji,"screen","full","dvw","lvw","svw","min","max","fit",...R()],W=()=>[ji,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],B=()=>[e,lt,it],J=()=>[...O(),SC,jC,{position:[lt,it]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",B_,z_,{size:[lt,it]}],I=()=>[R0,xd,yl],$=()=>["","none","full",m,lt,it],Q=()=>["",Ut,xd,yl],G=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[Ut,R0,SC,jC],ne=()=>["","none",j,lt,it],ie=()=>["none",Ut,lt,it],oe=()=>["none",Ut,lt,it],Z=()=>[Ut,lt,it],de=()=>[ji,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ya],breakpoint:[ya],color:[eA],container:[ya],"drop-shadow":[ya],ease:["in","out","in-out"],font:[M_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ya],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ya],shadow:[ya],spacing:["px",Ut],text:[ya],"text-shadow":[ya],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ji,it,lt,N]}],container:["container"],"container-type":[{"@container":["","normal","size",lt,it]}],"container-named":[D_],columns:[{columns:[Ut,"auto",it,lt,f]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[$o,"auto",lt,it]}],basis:[{basis:[ji,"full","auto",f,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ut,ji,"auto","initial","none",it]}],grow:[{grow:["",Ut,lt,it]}],shrink:[{shrink:["",Ut,lt,it]}],order:[{order:[$o,"first","last","none",lt,it]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[f,"screen",...F()]}],"min-w":[{"min-w":[f,"screen","none",...F()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh","none",...F()]}],"font-size":[{text:["base",r,xd,yl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,V_,P_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",R0,it]}],"font-family":[{font:[L_,I_,t]}],"font-features":[{"font-features":[it]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,lt,it]}],"line-clamp":[{"line-clamp":[Ut,"none",lt,wC]}],leading:[{leading:["none",c,...R()]}],"list-image":[{"list-image":["none",lt,it]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",lt,it]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ut,"from-font","auto",lt,yl]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ut,"auto",lt,it]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[$o,lt,it]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",lt,it]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",lt,it]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$o,lt,it],radial:["",lt,it],conic:["",$o,lt,it]},$_,__]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-bs":[{"border-bs":Q()}],"border-w-be":[{"border-be":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ut,lt,it]}],"outline-w":[{outline:["",Ut,xd,yl]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","inner","none",x,th,eh]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",p,th,eh]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ut,yl]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",b,th,eh]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ut,lt,it]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[lt,it]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",lt,it]}],filter:[{filter:["","none",lt,it]}],blur:[{blur:ne()}],brightness:[{brightness:[Ut,lt,it]}],contrast:[{contrast:[Ut,lt,it]}],"drop-shadow":[{"drop-shadow":["","none",v,th,eh]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ut,lt,it]}],"hue-rotate":[{"hue-rotate":[Ut,lt,it]}],invert:[{invert:["",Ut,lt,it]}],saturate:[{saturate:[Ut,lt,it]}],sepia:[{sepia:["",Ut,lt,it]}],"backdrop-filter":[{"backdrop-filter":["","none",lt,it]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[Ut,lt,it]}],"backdrop-contrast":[{"backdrop-contrast":[Ut,lt,it]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ut,lt,it]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ut,lt,it]}],"backdrop-invert":[{"backdrop-invert":["",Ut,lt,it]}],"backdrop-opacity":[{"backdrop-opacity":[Ut,lt,it]}],"backdrop-saturate":[{"backdrop-saturate":[Ut,lt,it]}],"backdrop-sepia":[{"backdrop-sepia":["",Ut,lt,it]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",lt,it]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ut,"initial",lt,it]}],ease:[{ease:["linear","initial",C,lt,it]}],delay:[{delay:[Ut,lt,it]}],animate:[{animate:["none",E,lt,it]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,lt,it]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[lt,it,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":["translate-none"],zoom:[{zoom:[$o,lt,it]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",lt,it]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",lt,it]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ut,xd,yl,wC]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},F_=w_(H_);function Le(...e){return F_(YR(e))}const _y=rg("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ce({className:e,variant:t="default",size:r="default",...a}){return s.jsx(J6,{"data-slot":"button",className:Le(_y({variant:t,size:r,className:e})),...a})}const G_="data-valid",q_="data-invalid",Y_={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},K_={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},X_={disabled:!1,...K_},og={valid(e){return e===null?null:e?{[G_]:""}:{[q_]:""}}},W_={invalid:void 0,name:void 0,validityData:{state:Y_,errors:[],error:"",value:"",initialValue:null},setValidityData:Tn,disabled:void 0,setTouched:Tn,setDirty:Tn,setFilled:Tn,setFocused:Tn,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:X_,registerFieldControl:Tn,validation:{getValidationProps:(e,t=gn)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Tn,getInputControl:()=>null,commit:async()=>{},change:Tn}},Q_=g.createContext(W_);function gu(e=!0){const t=g.useContext(Q_);if(t.setValidityData===Tn&&!e)throw new Error(Zt(28));return t}const Z_=g.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Tn,validationMode:"onSubmit",submitCountRef:{current:0}});function ag(){return g.useContext(Z_)}let NC=0;function J_(e,t="mui"){const[r,a]=g.useState(e),l=e||r;return g.useEffect(()=>{r==null&&(NC+=1,a(`${t}-${NC}`))},[r,t]),l}const CC=e1.useId;function zl(e,t){if(CC!==void 0){const r=CC();return e??(t?`${t}-${r}`:r)}return J_(e,t)}function ms(e){return zl(e,"base-ui")}const eL=g.createContext({controlId:void 0,registerControlId:Tn,resetControlId:Tn,labelId:void 0,setLabelId:Tn,messageIds:[],setMessageIds:Tn,getDescriptionProps:e=>e});function af(){return g.useContext(eL)}function lA(e,t,r,a=!0,l){const[c,u]=g.useState(),f=ms(l?`${l}-label`:void 0),h=e??t??c;return qe(()=>{const m=e||t||!a?void 0:tL(r.current,f);c!==m&&u(m)}),h}function tL(e,t){const r=nL(e);if(r)return!r.id&&t&&(r.id=t),r.id||void 0}function nL(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const r=e.id;if(r){const l=e.nextElementSibling;if(l&&l.htmlFor===r)return l}const a=e.labels;return a&&a[0]}function lf(e={}){const{id:t,enabled:r=!0}=e,{controlId:a,registerControlId:l,resetControlId:c}=af(),u=ms(),f=fs(()=>Symbol()),h=g.useRef(!1),m=g.useRef(!1),x=Ze(()=>{!h.current||l===Tn||(h.current=!1,l(f.current,void 0))});return qe(()=>{if(!r||l===Tn){x();return}let p;if(t!==void 0)m.current=!0,p=t;else if(m.current)p=u;else{c();return}if(p===void 0){x();return}h.current=!0,l(f.current,p)},[t,r,l,c,u,f,x]),qe(()=>x,[x]),(r?a:void 0)??t??u}function sL(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:rL,platform:oL,maxTouchPoints:aL}=sL(),ig=rL.toLowerCase(),Vd=oL.toLowerCase(),lg=/^i(os$|p)/.test(Vd)||Vd==="macintel"&&aL>1,kC="android",Ly=Vd===kC||ig.includes(kC),a1=!lg&&Vd.startsWith("mac");Vd.startsWith("win");const iL=a1||lg;var dR;const Ha=typeof CSS<"u"&&!!((dR=CSS.supports)!=null&&dR.call(CSS,"-webkit-backdrop-filter:none"));!Ha&&ig.includes("firefox");!Ha&&ig.includes("chrom");const lL=iL,i1=/jsdom|happydom/.test(ig);function _s(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function pt(e,t){var a;if(!e||!t)return!1;const r=(a=t.getRootNode)==null?void 0:a.call(t);if(e.contains(t))return!0;if(r&&au(r)){let l=t;for(;l;){if(e===l)return!0;l=l.parentNode||l.host}}return!1}function Ds(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const By="data-base-ui-focusable",cA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",cg="ArrowLeft",ug="ArrowRight",uA="ArrowUp",l1="ArrowDown",c1="data-starting-style",cL="data-ending-style",uL={[c1]:""},dL={[cL]:""},Fa={transitionStatus(e){return e==="starting"?uL:e==="ending"?dL:null}},fL="data-open",mL="data-closed",hL="data-anchor-hidden",dA="data-popup-open",pL="data-pressed",gL={[dA]:""},xL={[dA]:"",[pL]:""},bL={[fL]:""},yL={[mL]:""},vL={[hL]:""},u1={open(e){return e?gL:null}},pp={open(e){return e?xL:null}},cf={open(e){return e?bL:yL},anchorHidden(e){return e?vL:null}},dg={...cf,...Fa},$y="data-trigger-disabled";function gp(e,t){if(!Gt(e))return!1;const r=e;if(t.hasElement(r))return!r.hasAttribute($y);for(const[,a]of t.entries())if(pt(a,r))return!a.hasAttribute($y);return!1}function A0(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}function wL(e){return e.matches("html,body")}function fg(e){return un(e)&&e.matches(cA)}function jL(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${cA}`))!=null}function Vy(e){return e?e.getAttribute("role")==="combobox"&&fg(e):!1}function SL(e){if(!e||i1)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function xp(e){return e?e.hasAttribute(By)?e:e.querySelector(`[${By}]`)||e:null}function Di(e,t,r=!0){return e.filter(l=>l.parentId===t).flatMap(l=>{var c;return[...!r||(c=l.context)!=null&&c.open?[l]:[],...Di(e,l.id,r)]})}function TC(e,t){var l;let r=[],a=(l=e.find(c=>c.id===t))==null?void 0:l.parentId;for(;a;){const c=e.find(u=>u.id===a);a=c==null?void 0:c.parentId,c&&(r=r.concat(c))}return r}function qo(e){e.preventDefault(),e.stopPropagation()}function NL(e){return"nativeEvent"in e}function mg(e){return e.pointerType===""&&e.isTrusted?!0:Ly&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function d1(e){return i1?!1:!Ly&&e.width===0&&e.height===0||Ly&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ei(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function CL(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const iu=Math.min,Ea=Math.max,bp=Math.round,nh=Math.floor,Ra=e=>({x:e,y:e}),kL={left:"right",right:"left",bottom:"top",top:"bottom"};function fA(e,t,r){return Ea(e,iu(t,r))}function zi(e,t){return typeof e=="function"?e(t):e}function Fr(e){return e.split("-")[0]}function Da(e){return e.split("-")[1]}function f1(e){return e==="x"?"y":"x"}function m1(e){return e==="y"?"height":"width"}function Ur(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function h1(e){return f1(Ur(e))}function TL(e,t,r){r===void 0&&(r=!1);const a=Da(e),l=h1(e),c=m1(l);let u=l==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=yp(u)),[u,yp(u)]}function EL(e){const t=yp(e);return[Uy(e),t,Uy(t)]}function Uy(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const EC=["left","right"],RC=["right","left"],RL=["top","bottom"],AL=["bottom","top"];function OL(e,t,r){switch(e){case"top":case"bottom":return r?t?RC:EC:t?EC:RC;case"left":case"right":return t?RL:AL;default:return[]}}function ML(e,t,r,a){const l=Da(e);let c=OL(Fr(e),r==="start",a);return l&&(c=c.map(u=>u+"-"+l),t&&(c=c.concat(c.map(Uy)))),c}function yp(e){const t=Fr(e);return kL[t]+e.slice(t.length)}function DL(e){var t,r,a,l;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(a=e.bottom)!=null?a:0,left:(l=e.left)!=null?l:0}}function mA(e){return typeof e!="number"?DL(e):{top:e,right:e,bottom:e,left:e}}function Ud(e){const{x:t,y:r,width:a,height:l}=e;return{width:a,height:l,top:r,left:t,right:t+a,bottom:r+l,x:t,y:r}}function Ad(e,t){return t<0||t>=e.length}function Lh(e,t){return Ca(e.current,{disabledIndices:t})}function Hy(e,t){return Ca(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ca(e,{startingIndex:t=-1,decrement:r=!1,disabledIndices:a,amount:l=1}={}){let c=t;do c+=r?-l:l;while(c>=0&&c<=e.length-1&&Xc(e,c,a));return c}function Xc(e,t,r){if(typeof r=="function"?r(t):(r==null?void 0:r.includes(t))??!1)return!0;const l=e[t];return l?!hg(l)||l.matches(":disabled")?!0:!r&&(l.hasAttribute("disabled")||l.getAttribute("aria-disabled")==="true"):!1}function zL(e){return e.visibility==="hidden"||e.visibility==="collapse"}function hg(e,t=e?Cr(e):null){return!e||!e.isConnected||!t||zL(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const PL='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function IL(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const r=e.getRootNode();return au(r)?r.host:null}function Fy(e){for(const t of Array.from(e.children))if(zs(t)==="summary")return t;return null}function _L(e,t){const r=Fy(t);return!!r&&(e===r||pt(r,e))}function hA(e){const t=e?zs(e):"";return e!=null&&e.matches(PL)&&(t!=="summary"||e.parentElement!=null&&zs(e.parentElement)==="details"&&Fy(e.parentElement)===e)&&(t!=="details"||Fy(e)==null)&&(t!=="input"||e.type!=="hidden")}function pA(e){if(!hA(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=IL(t)){const r=t!==e,a=zs(t)==="slot";if(t.hasAttribute("inert")||r&&zs(t)==="details"&&!t.open&&!_L(e,t)||t.hasAttribute("hidden")||!a&&!LL(t,r))return!1}return!0}function LL(e,t){const r=Cr(e);return t?r.display!=="none":hg(e,r)}function gA(e){const t=e.tabIndex;if(t<0){const r=zs(e);if(r==="details"||r==="audio"||r==="video"||un(e)&&e.isContentEditable)return 0}return t}function O0(e){if(zs(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function BL(e,t){const r=O0(e);if(!r)return!0;const a=t.find(l=>{const c=O0(l);return(c==null?void 0:c.name)===r.name&&c.form===r.form&&c.checked});return a?a===r:t.find(l=>{const c=O0(l);return(c==null?void 0:c.name)===r.name&&c.form===r.form})===r}function xA(e){if(un(e)&&zs(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return un(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function bA(e,t){xA(e).forEach(r=>{hA(r)&&t.push(r),bA(r,t)})}function yA(e,t,r){xA(e).forEach(a=>{un(a)&&a.matches(t)&&r.push(a),yA(a,t,r)})}function p1(e){return pA(e)&&gA(e)>=0}function vA(e){const t=[];return bA(e,t),t.filter(pA)}function uf(e){const t=vA(e);return t.filter(r=>gA(r)>=0&&BL(r,t))}function wA(e,t){const r=uf(e),a=r.length;if(a===0)return;const l=_s(Ft(e)),c=r.indexOf(l),u=c===-1?t===1?0:a-1:c+t;return r[u]}function g1(e){return wA(Ft(e).body,1)||e}function jA(e){return wA(Ft(e).body,-1)||e}function SA(e,t){if(!e)return null;const r=uf(Ft(e).body),a=r.length;if(a===0)return null;const l=r.indexOf(e);if(l===-1)return null;const c=(l+t+a)%a;return r[c]}function $L(e){return SA(e,1)}function VL(e){return SA(e,-1)}function Wc(e,t){const r=t||e.currentTarget,a=e.relatedTarget;return!a||!pt(r,a)}function UL(e){uf(e).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function AC(e){const t=[];yA(e,"[data-tabindex]",t),t.forEach(r=>{const a=r.dataset.tabindex;delete r.dataset.tabindex,a?r.setAttribute("tabindex",a):r.removeAttribute("tabindex")})}function x1(e){g.useEffect(e,kr)}const bd=0;class Kr{constructor(){tn(this,"currentId",bd);tn(this,"clear",()=>{this.currentId!==bd&&(clearTimeout(this.currentId),this.currentId=bd)});tn(this,"disposeEffect",()=>this.clear)}static create(){return new Kr}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=bd,r()},t)}isStarted(){return this.currentId!==bd}}function es(){const e=fs(Kr.create).current;return x1(e.disposeEffect),e}const HL=g.createContext({disabled:!1});function FL(){return g.useContext(HL)}var Xr=pR();const GL=fR(Xr),sh=null;class qL{constructor(){tn(this,"callbacks",[]);tn(this,"callbacksCount",0);tn(this,"nextId",1);tn(this,"startId",1);tn(this,"isScheduled",!1);tn(this,"tick",t=>{var l;this.isScheduled=!1;const r=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let c=0;c<r.length;c+=1)(l=r[c])==null||l.call(r,t)})}request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||this.callbacks[r]!==null&&(this.callbacks[r]=null,this.callbacksCount-=1)}}let rh=new qL;class ar{constructor(){tn(this,"currentId",sh);tn(this,"cancel",()=>{this.currentId!==sh&&(rh.cancel(this.currentId),this.currentId=sh)});tn(this,"disposeEffect",()=>this.cancel)}static create(){return new ar}static request(t){return rh.request(t)}static cancel(t){return rh.cancel(t)}request(t){this.cancel(),this.currentId=rh.request(()=>{this.currentId=sh,t()})}}function lu(){const e=fs(ar.create).current;return x1(e.disposeEffect),e}function va(e){return e==null?e:"current"in e?e.current:e}let oh=null;function YL(e){if(!oh){const t=[];oh=t,queueMicrotask(()=>{oh=null,Xr.flushSync(()=>{for(const r of t)r()})})}oh.push(e)}function df(e,t=!1,r=!1){const a=lu();return Ze((l,c=null)=>{a.cancel();const u=va(e);if(u==null)return;const f=u,h=()=>{if(!r){Xr.flushSync(l);return}YL(()=>{c!=null&&c.aborted||l()})};if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){l();return}function m(){Promise.all(f.getAnimations().map(x=>x.finished)).then(()=>{c!=null&&c.aborted||h()},()=>{if(c!=null&&c.aborted)return;if(f.getAnimations().some(p=>p.pending||p.playState!=="finished")){m();return}h()})}if(t){const x=c1;if(!f.hasAttribute(x)){a.request(m);return}const p=new MutationObserver(()=>{f.hasAttribute(x)||(p.disconnect(),m())});p.observe(f,{attributes:!0,attributeFilter:[x]}),c==null||c.addEventListener("abort",()=>p.disconnect(),{once:!0});return}a.request(m)})}function ir(e){const{enabled:t=!0,open:r,ref:a,batch:l=!1,onComplete:c}=e,u=Ze(c),f=df(a,r,l);g.useEffect(()=>{if(!t)return;const h=new AbortController;return f(u,h.signal),()=>{h.abort()}},[t,r,u,f])}function Ga(e,t=!1,r=!1,a=!1){const[l,c]=g.useState(e&&t?"idle":void 0),[u,f]=g.useState(e&&!a);return e&&!u&&(f(!0),c("starting")),!e&&u&&l!=="ending"&&!r&&c("ending"),!e&&!u&&l==="ending"&&c(void 0),qe(()=>{if(!e&&u&&l!=="ending"&&r){const h=ar.request(()=>{c("ending")});return()=>{ar.cancel(h)}}},[e,u,l,r]),qe(()=>{if(!e||t)return;const h=ar.request(()=>{c(void 0)});return()=>{ar.cancel(h)}},[t,e]),qe(()=>{if(!e||!t)return;e&&u&&l!=="idle"&&c("starting");const h=ar.request(()=>{c("idle")});return()=>{ar.cancel(h)}},[t,e,u,l]),{mounted:u,setMounted:f,transitionStatus:l}}function Wr({controlled:e,default:t,name:r,state:a="value"}){const{current:l}=g.useRef(e!==void 0),[c,u]=g.useState(t),f=l&&e!==void 0?e:c,h=g.useCallback(m=>{l||u(m)},[]);return[f,h]}function pg(e,t,r,a,l=!0,c){const{registerFieldControl:u}=gu(),f=fs(()=>Symbol());qe(()=>{const h=f.current;if(!l){u(h,void 0);return}u(h,{controlRef:e,getValue:a,id:t,name:c,value:r})},[e,l,a,t,c,u,f,r]),qe(()=>{const h=f.current;return()=>{u(h,void 0)}},[u,f])}function ff(e,t){const r=g.useRef(e),a=Ze(t);qe(()=>{r.current!==e&&a(r.current),r.current=e},[e,a])}const Tr="none",Jo="trigger-press",Un="trigger-hover",Qc="trigger-focus",gg="outside-press",Al="item-press",NA="close-press",Pi="focus-out",mf="escape-key",Gy="list-navigation",CA="cancel-open",Nd="sibling-open",kA="disabled",OC="missing",MC="initial",xg="imperative-action",KL="window-resize";function bt(e,t,r,a){let l=!1,c=!1;const u=a??gn;return{reason:e,event:t??new Event("base-ui"),cancel(){l=!0},allowPropagation(){c=!0},get isCanceled(){return l},get isPropagationAllowed(){return c},trigger:r,...u}}const XL=g.forwardRef(function(t,r){const{render:a,className:l,id:c,name:u,value:f,disabled:h=!1,onValueChange:m,defaultValue:x,autoFocus:p=!1,style:b,...v}=t,{state:j,name:S,disabled:N,setTouched:C,setDirty:E,validityData:T,setFocused:O,setFilled:k,validationMode:M,validation:A}=gu(),{clearErrors:R,elementRef:z,submitCountRef:_}=ag(),L=N||h,Y=S??u,P={...j,disabled:L},{labelId:V}=af(),U=lf({id:c}),[H]=Wr({controlled:f,default:x,name:"FieldControl",state:"value"}),F=f!==void 0,q=F?H:void 0,W=q==null?void 0:String(q),B=Ze(()=>{var I;return(I=A.inputRef.current)==null?void 0:I.value});pg(A.inputRef,U,W,B,!L,u),qe(()=>{var $;const I=W??(($=A.inputRef.current)==null?void 0:$.value);I!==void 0&&k(I!=="")},[W,A.inputRef,k]),ff(W,()=>{W!==void 0&&(R(Y),E(W!==(T.initialValue??"")),A.change(W))});const J=g.useRef(null),X=es();return qe(()=>{p&&J.current===_s(Ft(J.current))&&O(!0)},[p,O]),Nt("input",t,{ref:[r,J],state:P,props:[{id:U,disabled:L,name:Y,ref:A.inputRef,"aria-labelledby":V,autoFocus:p,...F?{value:q}:{defaultValue:x},onChange(I){const $=I.currentTarget.value,Q=bt(Tr,I.nativeEvent);m==null||m($,Q),!F&&(E($!==(T.initialValue??"")),k($!==""),!I.nativeEvent.defaultPrevented&&!Q.isCanceled&&(R(Y),A.change($)))},onFocus(){O(!0)},onBlur(I){if(C(!0),O(!1),M==="onBlur"){const $=I.currentTarget.value;A.commit($),F&&queueMicrotask(()=>{var G;const Q=(G=A.inputRef.current)==null?void 0:G.value;Q!==void 0&&Q!==$&&Q!==(T.initialValue??"")&&A.commit(Q)})}},onKeyDown(I){if(I.currentTarget.tagName==="INPUT"&&I.key==="Enter"){C(!0);const $=I.currentTarget.value,Q=I.currentTarget.form;if(Q&&Q===z.current&&!I.defaultPrevented){const G=I.currentTarget,se=_.current;X.start(0,()=>{_.current===se&&A.commit(G.value)})}else A.commit($)}}},v,I=>A.getValidationProps(L,I)],stateAttributesMapping:og})}),WL=g.forwardRef(function(t,r){return s.jsx(XL,{ref:r,...t})});function Ot({className:e,type:t,...r}){return s.jsx(WL,{type:t,"data-slot":"input",className:Le("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...r})}const TA=48,na=(e,t=0)=>{const r=new Int32Array(e.length);for(let a=0;a<e.length;a++)r[a]=e.charCodeAt(a)-TA-t;return r},bg=e=>{const t=new Int32Array(e.length+1);for(let r=0;r<e.length;r++)t[r+1]=t[r]+e[r];return t},Ii=e=>{const t=new Int32Array(e.length);let r=0;for(let a=0;a<e.length;a++){const l=e.charCodeAt(a)-TA;r+=l>>>1^-(l&1),t[a]=r}return t},QL=384,ZL=[],Sl=bg(na("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),JL=bg(na(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),e8="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",t8=(()=>{const e=Sl.length-1,t=new Int32Array(e);for(let l=e-1;l>=0;l--){let c=1,u=l+1;for(let f=Sl[l];f<Sl[l+1];f++)c+=t[u],u+=t[u];t[l]=c}const r=new Int32Array(Sl[e]);let a=0;for(let l=0;l<e;l++){let c=l+1;for(let u=Sl[l];u<Sl[l+1];u++)r[a++]=c,c+=t[c]}return r})(),n8=na("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),s8=bg(na("1233333593464636351265367151576")),r8=na("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0324325853;D>E?3257D>03258432585:0325B:;0328B:032"),o8=na("012123445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EJK4444::EJ4444441691;644444114244444:;L6666555555555555555999666664444444444444444444444226?6:66644M9N?D:111::::6DJ199"),a8=Ii("0202002020020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),i8=(()=>{const e=new Int32Array(319).fill(-1),t=Ii("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),r=Ii("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let a=0;a<t.length;a++)e[t[a]]=r[a];return e})(),l8="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top|none | auto square video| auto fr max min px| auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const t=e.split(" "),r=t.shift();for(let a=0;a<t.length;a++)t[a]=r+t[a];return t}),DC=Ii("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),c8=Ii("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),u8=Ii("02222222222222222222222222222222222222222222222222222222222222222203062222222222IL2200IL021042222]`222IL0gj2e50n2222U00X202[^2y0000560|{~22>22|22222222222G000qOVI00000}2>40000B00000I¨000°00000000000000021Q²±00´000000000000000000000222HGHa5¾222Ã6À2222ÍÐ000°2±"),EA=new Int32Array(991),RA=new Int32Array(991),AA=new Int32Array(991);let qy="";const Yy=new Int32Array(1030);{const e=new Map;let t=0,r=0;for(let a=0;a<DC.length;a++)for(const l of l8[u8[a]]){let c=e.get(l);c===void 0&&(c=t++,e.set(l,c),Yy[c*2]=qy.length,Yy[c*2+1]=l.length,qy+=l),EA[r]=DC[a],RA[r]=c8[a],AA[r]=c,r++}}const d8=Ii("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),f8=bg(na("1::22222432:222:22:22>222222:22:2221322511111311111114")),m8=Ii("24A;33N=C@H4A;33N=C@<2;363@QTQʰ222ˉºŴŽ2R2=18cƴÅŇÜÛŲǝȈ:ħ25=11D3A@216Er25;11B3?<438Cn9@7=<8192>2E121@9@EHE@9>2T25511<398216=V25511<398216=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),h8=na("ij"),p8=na(""),g8=na("1"),x8="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var b8={GROUP_COUNT:QL,customValidatorNames:ZL,edgeStart:Sl,labelStart:JL,labelText:e8,edgeTarget:t8,nodeGroup:n8,nodeVlist:i8,vlistPat:s8,vlistOps:r8,vlistRef:o8,vlistGroup:a8,litAnchor:EA,litGroup:RA,litPool:AA,poolOffsets:Yy,poolText:qy,adjGid:d8,adjStart:f8,adjTgt:m8,patGid:h8,patTgt:p8,postfixLookupGroups:g8,orderSensitiveModifiers:x8};const y8="line"in new Error,Vo=-1,vl=-1,M0=(e,t,r)=>{let a=2166136261;for(let l=t;l<r;l++)a=Math.imul(a^e.charCodeAt(l),16777619);return a},D0=(e,t,r)=>{const a=r-t;let l=Math.imul(a,2654435761)^e.charCodeAt(t);if(a>3){const c=a>>2,u=a>>1;l=Math.imul(l^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+c),2246822507),l=Math.imul(l^e.charCodeAt(t+u)<<8^e.charCodeAt(t+u+c)<<16^e.charCodeAt(r-3),3266489909),l^=e.charCodeAt(r-2)<<8^e.charCodeAt(r-1)<<16;for(let f=t+3,h=r-4;f<t+8&&f<h;f++,h--)l=Math.imul(l^e.charCodeAt(f)^e.charCodeAt(h)<<8,16777619)}return l^l>>>15|0},v8=(e,t,r={})=>{const{GROUP_COUNT:a,edgeStart:l,labelStart:c,labelText:u,edgeTarget:f,nodeGroup:h,nodeVlist:m,vlistPat:x,vlistOps:p,vlistRef:b,vlistGroup:v,litAnchor:j,litGroup:S,litPool:N,poolOffsets:C,poolText:E,adjGid:T,adjStart:O,adjTgt:k,patGid:M,patTgt:A,postfixLookupGroups:R,customValidatorNames:z,orderSensitiveModifiers:_}=e,L=new Int32Array(a).fill(-1);for(let Ne=0;Ne<T.length;Ne++)L[T[Ne]]=Ne;let Y=0;for(let Ne=0;Ne+1<O.length;Ne++){const Be=O[Ne+1]-O[Ne];Be>Y&&(Y=Be)}let P=32;for(;P<2*(1+Y+M.length);)P<<=1;const V=new Int32Array(b.length+1);for(let Ne=0;Ne<b.length;Ne++)V[Ne+1]=V[Ne]+x[b[Ne]+1]-x[b[Ne]];const U=new Uint8Array(a);for(let Ne=0;Ne<R.length;Ne++)U[R[Ne]]=1;const H=l.length-1,F=new Uint8Array(H);let q=0,W=!0;for(let Ne=0;Ne<j.length;Ne++){F[j[Ne]]=1;const Be=C[N[Ne]*2+1];Be>q&&(q=Be);const Ve=E.charCodeAt(C[N[Ne]*2]);(Ve===91||Ve===40)&&(W=!1)}let B=1;for(;B<j.length*2;)B<<=1;const J=new Int32Array(B).fill(-1);for(let Ne=0;Ne<j.length;Ne++){const Be=C[N[Ne]*2];let Ve=(M0(E,Be,Be+C[N[Ne]*2+1])^Math.imul(j[Ne],2654435761)|0)&B-1;for(;J[Ve]!==-1;)Ve=Ve+1&B-1;J[Ve]=Ne}const X=(Ne,Be,Ve,gt)=>{let Mt=(M0(Be,Ve,gt)^Math.imul(Ne,2654435761)|0)&B-1;const Rt=gt-Ve;for(;;){const Bt=J[Mt];if(Bt===-1)return-1;if(j[Bt]===Ne&&C[N[Bt]*2+1]===Rt){const fn=C[N[Bt]*2];let sn=!0;for(let Ct=0;Ct<Rt;Ct++)if(E.charCodeAt(fn+Ct)!==Be.charCodeAt(Ve+Ct)){sn=!1;break}if(sn)return S[Bt]}Mt=Mt+1&B-1}},re=r.cacheSize??8192,I=r.prefix??e.prefix??"",$=I===""?"":I+":",Q=$.length,G=(z??[]).map(Ne=>{throw new Error("cn: missing validator "+Ne)}),se=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let oe=0,Z=-1,de=-1,ke=-1,_e=-1;const je=Ne=>Ne>=97&&Ne<=122||Ne>=65&&Ne<=90||Ne>=48&&Ne<=57||Ne===95,Ae=Ne=>/\s/.test(String.fromCharCode(Ne)),te=(Ne,Be,Ve)=>{if(oe=0,Z=-1,Ve-Be<3)return;const gt=Ne.charCodeAt(Be),Mt=Ne.charCodeAt(Ve-1);if(gt===91&&Mt===93)oe=1;else if(gt===40&&Mt===41)oe=2;else return;ke=Be+1,_e=Ve-1;let Rt=Be+1;if(je(Ne.charCodeAt(Rt))){for(Rt++;Rt<Ve-1;){const Bt=Ne.charCodeAt(Rt);if(!je(Bt)&&Bt!==45)break;Rt++}Rt<Ve-2&&Ne.charCodeAt(Rt)===58&&(Z=Be+1,de=Rt,ke=Rt+1)}},Ee=(Ne,Be,Ve,gt)=>{if(Ve-Be!==gt.length)return!1;for(let Mt=0;Mt<gt.length;Mt++)if(Ne.charCodeAt(Be+Mt)!==gt.charCodeAt(Mt))return!1;return!0},Te=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,be=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,We=Ne=>!!Ne&&!Number.isNaN(Number(Ne)),Se=(Ne,Be,Ve)=>{if(Ve-Be<11||!Ee(Ne,Be,Be+10,"@container"))return!1;if(Ne.charCodeAt(Be+10)===47)return Ve-Be>=12;const gt=Ne.charCodeAt(Be+11);return gt===115&&Ve-Be>=17&&Ee(Ne,Be+10,Be+16,"-size/")||gt===110&&Ve-Be>=19&&Ee(Ne,Be+10,Be+18,"-normal/")},Fe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Re="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(Ne=>Ne.split(" ")),ve=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],pe=(Ne,Be,Ve,gt)=>{if(Ne>=10){if(Ne>=25)return G[Ne-25](Be.slice(Ve,gt));const Mt=Ne-10;if(oe!==Fe[Mt])return!1;if(Z>=0){for(const Rt of Re[Mt])if(Ee(Be,Z,de,Rt))return!0;return!1}switch(ve[Mt]){case 0:return!1;case 1:return!0;case 2:{const Rt=Be.slice(ke,_e);return se.test(Rt)&&!ee.test(Rt)}case 3:return We(Be.slice(ke,_e));case 4:return ie.test(Be.slice(ke,_e));default:return ne.test(Be.slice(ke,_e))}}switch(Ne){case 0:return!0;case 1:return oe===0;case 2:return oe===1;case 3:return oe===2;case 4:return Te.test(Be.slice(Ve,gt));case 5:return We(Be.slice(Ve,gt));case 6:{const Mt=Be.slice(Ve,gt);return!!Mt&&Number.isInteger(Number(Mt))}case 7:return gt>Ve&&Be.charCodeAt(gt-1)===37&&We(Be.slice(Ve,gt-1));case 8:return be.test(Be.slice(Ve,gt));default:return Se(Be,Ve,gt)}},$e=new Set(typeof _=="string"?_.split(" "):_),Je=(Ne,Be,Ve,gt,Mt,Rt)=>{const Bt=M0(Be,Ve,gt)^(Mt?2654435769:0)|0;let fn=Ne.get(Bt);if(fn!==void 0)e:for(let Dt=0;Dt<fn.length;Dt++){const en=fn[Dt];if(!(en.imp!==Mt||en.k.length!==gt-Ve)){for(let St=0;St<en.k.length;St++)if(en.k.charCodeAt(St)!==Be.charCodeAt(Ve+St))continue e;return en.id}}else Ne.set(Bt,fn=[]);const sn=Be.slice(Ve,gt),Ct=Rt(sn);return fn.push({k:sn,imp:Mt,id:Ct}),Ct};let mt=new Map,ot=new Map,Ie=2;const at=4096,Xe=(Ne,Be)=>{const Ve=[];let gt=0,Mt=0,Rt=0;for(let Ct=0;Ct<Ne.length;Ct++){const Dt=Ne.charCodeAt(Ct);gt===0&&Mt===0&&Dt===58?(Ve.push(Ne.slice(Rt,Ct)),Rt=Ct+1):Dt===91?gt++:Dt===93?gt--:Dt===40?Mt++:Dt===41&&Mt--}Ve.push(Ne.slice(Rt));let Bt=Ve[0];if(Ve.length>1){const Ct=[];let Dt=[];for(const en of Ve)en.charCodeAt(0)===91||$e.has(en)?(Dt.length&&(Ct.push(...Dt.sort()),Dt=[]),Ct.push(en)):Dt.push(en);Dt.length&&Ct.push(...Dt.sort()),Bt=Ct.join(":")}const fn=Be?Bt+" !":Bt;let sn=ot.get(fn);return sn===void 0&&ot.set(fn,sn=Ie++),sn};let me=new Map,Me=a;const Oe=a+4096,tt=()=>Me++,Ue=2097152,Ge=8192,ht=new Int32Array(Ge),yt=new Array(Ge).fill(null),ue=new Int32Array(Ge),Ye=new Int32Array(Ge),Pe=new Uint8Array(Ge);let st=0;const vt=(Ne,Be,Ve,gt,Mt,Rt,Bt,fn)=>{let sn=Ne;if(yt[Ne]!==null)if(yt[Ne|1]===null)sn=Ne|1;else if((st++&3)===0)sn=Ne|st>>2&1;else return;yt[sn]=Be.slice(Ve,gt),ht[sn]=Mt,ue[sn]=Rt,Ye[sn]=Bt,Pe[sn]=fn},wt=()=>yt.fill(null);let Ht=256,kt=[new Int32Array(Ht),new Int32Array(Ht),new Int32Array(Ht),new Int32Array(Ht)],[ct,jt,ae,Ke]=kt,ut=new Uint8Array(Ht),Jt=new Uint8Array(Ht);const Rn=()=>{Ht*=2,kt=kt.map(Be=>{const Ve=new Int32Array(Ht);return Ve.set(Be),Ve}),[ct,jt,ae,Ke]=kt;const Ne=new Uint8Array(Ht);Ne.set(ut),ut=Ne,Jt=new Uint8Array(Ht)};let Et=64,Pt=new Int32Array(Et),Ln=new Int32Array(Et);const Eo=new Int32Array(a);let ps=2048,ao=21,Ks=new Float64Array(ps),Ro=new Int32Array(ps),Ls=0;const cr=(Ne,Be)=>{if(Ne===0&&Be<a)return Eo[Be]===Ls?1:(Eo[Be]=Ls,0);const Ve=Ne*2097152+Be+1;let gt=Math.imul(Ve,2654435761)>>>ao;for(;Ro[gt]===Ls;){if(Ks[gt]===Ve)return 1;gt=gt+1&ps-1}return Ks[gt]=Ve,Ro[gt]=Ls,0},Ss=(Ne,Be,Ve,gt,Mt)=>{if(Ve-Be>=2&&Ne.charCodeAt(Be)===91&&Ne.charCodeAt(Ve-1)===93){let Rt=-1;for(let Bt=Be+1;Bt<Ve-1;Bt++)if(Ne.charCodeAt(Bt)===58){Rt=Bt;break}return Rt===-1||Rt===Be+1?Vo:Je(me,Ne,Be+1,Rt,0,tt)}if(gt>=0&&h[gt]>=0)return h[gt];for(let Rt=Mt-1;Rt>=0;Rt--){const Bt=Ln[Rt];if(Bt>Ve)continue;const fn=Pt[Rt],sn=Ve-Bt;if(F[fn]===1&&sn>0&&sn<=q){const Dn=Ne.charCodeAt(Bt);if(W===!1||Dn!==91&&Dn!==40){const dr=X(fn,Ne,Bt,Ve);if(dr>=0)return dr}}const Ct=m[fn];if(Ct<0)continue;const Dt=b[Ct],en=x[Dt],St=x[Dt+1];if(en===St)continue;te(Ne,Bt,Ve);const ts=V[Ct]-en;for(let Dn=en;Dn<St;Dn++)if(pe(p[Dn],Ne,Bt,Ve))return v[ts+Dn]}return Vo},Rr=Ne=>{const Be=Ne.length;let Ve=0,gt=0,Mt=!1;(Ie>at||mt.size>at)&&(mt=new Map,ot=new Map,Ie=2,wt()),Me>Oe&&(me=new Map,Me=a,wt());let Rt=0;for(;Rt<Be;){let Ct=Ne.charCodeAt(Rt);if(Ct===32||Ct>=9&&Ct<=13||Ct>=160&&Ae(Ct)){Ct!==32&&(Mt=!0),Rt++;continue}const Dt=Rt;let en=0;for(;Rt<Be;){if(Ct=Ne.charCodeAt(Rt),Ct<=32){if(Ct===32)break;if(Ct>=9&&Ct<=13){Mt=!0;break}}else if(Ct>=160&&Ae(Ct)){Mt=!0;break}en=Math.imul(en^Ct,16777619),Rt++}const St=Rt,ts=St-Dt;Ve===Ht&&Rn();const Dn=Ve++;ct[Dn]=Dt,jt[Dn]=St,gt+=ts,en^=Math.imul(ts,2654435761);const dr=en^en>>>15|0,Kn=dr&8190;{let Wt=-1;if(ht[Kn]===dr&&yt[Kn]!==null&&yt[Kn].length===ts?Wt=Kn:ht[Kn|1]===dr&&yt[Kn|1]!==null&&yt[Kn|1].length===ts&&(Wt=Kn|1),Wt>=0){const gs=yt[Wt];let Mr=!0;for(let hr=0;hr<ts;hr++)if(gs.charCodeAt(hr)!==Ne.charCodeAt(Dt+hr)){Mr=!1;break}if(Mr){ae[Dn]=ue[Wt],Ke[Dn]=Ye[Wt],ut[Dn]=Pe[Wt];continue}}}let Xn=Dt;if(Q!==0){if(St-Dt<=Q||!Ne.startsWith($,Dt)){ae[Dn]=Vo,vt(Kn,Ne,Dt,St,dr,Vo,0,0);continue}Xn=Dt+Q}let Jl=0,Nu=0,oa=-1,ec=-1;for(let Wt=Xn;Wt<St;Wt++){const gs=Ne.charCodeAt(Wt);if(Jl===0&&Nu===0){if(gs===58){oa=Wt;continue}if(gs===47){ec=Wt;continue}}gs===91?Jl++:gs===93?Jl--:gs===40?Nu++:gs===41&&Nu--}const If=oa>=Xn?oa+1:Xn;let kn=If,Ps=St,Ka=!1,tc=0;Ps>kn&&Ne.charCodeAt(Ps-1)===33?(Ka=!0,Ps--):Ps>kn&&Ne.charCodeAt(kn)===33&&(Ka=!0,kn++,tc=1);let Xs=-1;ec>If&&(Xs=ec+tc,Xs>=Ps&&(Xs=-1));let nc=kn;Ps-kn>1&&Ne.charCodeAt(kn)===45&&(nc=kn+1);let fr=0,Bs=0,Xa=0,Cu=-1,mr=0;(m[0]>=0||F[0]===1)&&(Pt[0]=0,Ln[0]=nc,mr=1);let Yi=vl,ku=0;for(let Wt=nc;Wt<Ps;Wt++)if(Wt===Xs&&(Yi=Bs<Xa?vl:fr,ku=mr),fr!==vl){const gs=Ne.charCodeAt(Wt);let Mr=-1;if(Bs<Xa)u.charCodeAt(Bs)===gs?(Bs++,Bs===Xa&&(Mr=fr=Cu)):fr=vl;else{const hr=l[fr],Wi=l[fr+1];let aa=vl;for(let ks=hr;ks<Wi;ks++){const Qi=c[ks];if(u.charCodeAt(Qi)===gs){c[ks+1]-Qi===1?Mr=aa=f[ks]:(Bs=Qi+1,Xa=c[ks+1],Cu=f[ks],aa=fr);break}}fr=aa}if(Mr>=0&&(m[Mr]>=0||F[Mr]===1)&&Wt+1<Ps&&Ne.charCodeAt(Wt+1)===45){if(mr===Et){Et*=2;const hr=new Int32Array(Et);hr.set(Pt),Pt=hr;const Wi=new Int32Array(Et);Wi.set(Ln),Ln=Wi}Pt[mr]=Mr,Ln[mr]=Wt+2,mr++}}Xs===Ps&&(Yi=Bs<Xa?vl:fr,ku=mr);const Tu=Bs<Xa?vl:fr;let Cs,$s=!1;if(Xs>=0)if($s=!0,Cs=Ss(Ne,kn,Xs,Yi,ku),Cs!==Vo&&Cs<a&&U[Cs]){const Wt=Ss(Ne,kn,Ps,Tu,mr);Wt!==Vo&&Wt!==Cs&&(Cs=Wt,$s=!1)}else Cs===Vo&&(Cs=Ss(Ne,kn,Ps,Tu,mr),$s=!1);else Cs=Ss(Ne,kn,Ps,Tu,mr);let Ki=0,Xi=0;Cs===Vo?ae[Dn]=Vo:(Xi=$s?1:0,Ki=Xn>=oa?Ka?1:0:Je(mt,Ne,Xn,oa,Ka?1:0,Wt=>Xe(Wt,Ka)),ae[Dn]=Cs,ut[Dn]=Xi,Ke[Dn]=Ki),vt(Kn,Ne,Dt,St,dr,Cs,Ki,Xi)}if(Ve===0)return"";if(Ve===1)return ct[0]===0&&jt[0]===Be?Ne:Ne.slice(ct[0],jt[0]);if(Ve*P>ps){for(;Ve*P>ps;)ps<<=1,ao--;Ks=new Float64Array(ps),Ro=new Int32Array(ps)}if(Ie>=Ue||Me>=Ue)throw new Error("cn: too many distinct classes in one merge");Ls=Ls+1|0,Ls===0&&(Eo.fill(0),Ro.fill(0),Ls=1);let Bt=!1;for(let Ct=Ve-1;Ct>=0;Ct--){const Dt=ae[Ct];if(Dt===Vo){Jt[Ct]=1;continue}const en=Ke[Ct];if(cr(en,Dt)===1){Jt[Ct]=0,Bt=!0;continue}if(Jt[Ct]=1,Dt<a){const St=L[Dt];if(St>=0)for(let ts=O[St];ts<O[St+1];ts++)cr(en,k[ts]);if(ut[Ct]&1)for(let ts=0;ts<M.length;ts++)M[ts]===Dt&&cr(en,A[ts])}}if(!Bt&&!Mt&&Be===gt+Ve-1)return Ne;let fn="",sn=0;for(;sn<Ve;){if(!Jt[sn]){sn++;continue}const Ct=ct[sn];let Dt=jt[sn],en=sn+1;for(;en<Ve&&Jt[en]&&ct[en]===Dt+1&&Ne.charCodeAt(Dt)===32;)Dt=jt[en],en++;fn.length>0&&(fn+=" "),fn+=Ne.slice(Ct,Dt),sn=en}return fn},Ar=16384,Or=new Int32Array(Ar*2);let Fi=0,Hn=1,Mn=Object.create(null),Ns=Object.create(null),ur=new Map,Su=new Map,Xl=0,Wl=0;const Ya=()=>{Fi^=Ar,Hn=Hn+1|0,Wl=0},Gi=Ne=>{let Be=Mn[Ne];if(Be!==void 0)return Be;const Ve=D0(Ne,0,Ne.length),gt=(Ve&16383)+Fi,Mt=Or[gt]===(Ve^Hn)||Or[gt^Ar]===(Ve^Hn-1);return Mt&&(Be=Ns[Ne],Be!==void 0)?(Mn[Ne]=Be,Be):(Be=Rr(Ne),Mt?(Mn[Ne]=Be,++Xl>re&&(Xl=0,Ns=Mn,Mn=Object.create(null),Ya())):(Or[gt]=Ve^Hn,++Wl>Ar&&Ya()),Be)},Ql=Ne=>{let Be=ur.get(Ne);if(Be!==void 0)return Be;const Ve=D0(Ne,0,Ne.length),gt=(Ve&16383)+Fi,Mt=Or[gt]===(Ve^Hn)||Or[gt^Ar]===(Ve^Hn-1);return Mt&&(Be=Su.get(Ne),Be!==void 0)?(ur.set(Ne,Be),Be):(Be=Rr(Ne),Mt?(ur.set(Ne,Be),++Xl>re&&(Xl=0,Su=ur,ur=new Map,Ya())):(Or[gt]=Ve^Hn,++Wl>Ar&&Ya()),Be)},Zl=Ne=>{const Be=D0(Ne,0,Ne.length),Ve=(Be&16383)+Fi;return Or[Ve]===(Be^Hn)||Or[Ve^Ar]===(Be^Hn-1)?!0:(Or[Ve]=Be^Hn,++Wl>Ar&&Ya(),!1)},io=re===0?Rr:y8?Ne=>{const Be=ur.get(Ne);return Be!==void 0?Be:Ql(Ne)}:Gi;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?io(arguments[0]):io(j8.apply(null,arguments))},mergeString:io,seenBefore:re===0?()=>!1:Zl,mergeUncached:Rr}},vp=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let r="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const a=e;for(let l=0;l<a.length;l++){const c=a[l];if(!c)continue;const u=typeof c=="string"?c:vp(c,t);u&&(r&&(r+=" "),r+=u)}return r}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const a in e)e[a]&&(r&&(r+=" "),r+=a)}return r},w8=(e,t)=>{let r="";for(let a=0;a<e.length;a++){const l=e[a];if(!l)continue;const c=typeof l=="string"?l:vp(l,t);c&&(r&&(r+=" "),r+=c)}return r},j8=function(){return w8(arguments,!1)},S8=(e,t)=>{const r=t===void 0?()=>!0:t.seenBefore,a=t===void 0?e:t.mergeUncached;let l=new Map,c=new Map,u=0,f=null;const h=(b,v,j,S)=>{let N=0;if(v){if(v!==b.a0)return!1;N=1}if(j){if(j!==(N===0?b.a0:b.a1))return!1;N++}if(S){if(S!==(N===0?b.a0:N===1?b.a1:b.a2))return!1;N++}return N===b.t},m=(b,v)=>{const j=b.a;let S=0;for(let N=0;N<v.length;N++){const C=v[N];if(C){if(C!==j[S])return!1;S++}}return S===b.t},x=(b,v)=>{const j=b.length,S=f===null?null:f.n;if(!v){if(S!==null&&m(S,b))return f=S,S.r;if(f!==null&&f!==S&&m(f,b))return f.r}let N="",C=-1,E=0,T=!1;for(let M=0;M<j;M++){let A=b[M];if(A){if(typeof A!="string"){if(A=b[M]=vp(A,!0),!A)continue;T=!0}C<0&&(N=A,C=M),E++}}if(E===0)return"";if(E===1)return e(N);if(T){if(S!==null&&m(S,b))return f=S,S.r;if(f!==null&&f!==S&&m(f,b))return f.r}let O=l.get(N);O===void 0&&(O=c.get(N),O!==void 0&&l.set(N,O));let k=null;if(O!==void 0)e:for(let M=0;M<O.length;M++){const A=O[M];if(A.t!==E)continue;const R=A.a;let z=1;for(let _=C+1;_<j;_++){const L=b[_];if(L&&L!==R[z++])continue e}k=A;break}if(k===null){let M=N;const A=[N];for(let R=C+1;R<j;R++){const z=b[R];z&&(M+=" "+z,A.push(z))}if(!r(M))return a(M);k={r:e(M),t:A.length,a0:A[0],a1:A[1],a2:A[2]??"",a:A,n:null},O===void 0&&l.set(N,O=[]),O.length>=256&&O.shift(),O.push(k),++u>1e3&&(u=0,c=l,l=new Map)}return f!==null&&f!==k&&(f.n=k),f=k,k.r},p=b=>Array.isArray(b)?x(b.slice(),!1):e(vp(b,!0));return function(b,v,j){const S=arguments.length;if((S|1)===3){const E=f;if(E!==null){const T=E.n;if(T!==null&&h(T,b,v,j))return f=T,T.r;if(E!==T&&h(E,b,v,j))return E.r}return x([b,v,j],!0)}if(S===1)return typeof b=="string"?e(b):p(b);const N=f;if(N!==null){const E=N.n;if(E!==null){const T=E.a;let O=0,k=!0;for(let M=0;M<S;M++){const A=arguments[M];if(A){if(A!==T[O]){k=!1;break}O++}}if(k&&O===E.t)return f=E,E.r}if(N!==E){const T=N.a;let O=0,k=!0;for(let M=0;M<S;M++){const A=arguments[M];if(A){if(A!==T[O]){k=!1;break}O++}}if(k&&O===N.t)return N.r}}const C=[];for(let E=0;E<S;E++)C.push(arguments[E]);return x(C,!0)}},zC=v8(b8),hs=S8(zC.mergeString,zC);function N8({className:e,...t}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:hs("w-full caption-bottom text-sm",e),...t})})}function C8({className:e,...t}){return s.jsx("thead",{"data-slot":"table-header",className:hs("[&_tr]:border-b",e),...t})}function k8({className:e,...t}){return s.jsx("tbody",{"data-slot":"table-body",className:hs("[&_tr:last-child]:border-0",e),...t})}function PC({className:e,...t}){return s.jsx("tr",{"data-slot":"table-row",className:hs("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function z0({className:e,...t}){return s.jsx("th",{"data-slot":"table-head",className:hs("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...t})}function Lc({className:e,...t}){return s.jsx("td",{"data-slot":"table-cell",className:hs("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}function xu(e){const t=Math.round((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;const r=Math.round(t/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Hd(e){return!e||!Number.isFinite(Date.parse(e))?"Not reported":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e))}const OA={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},yg={...OA,position:"fixed",top:0,left:0},b1={...OA,position:"absolute"};function T8(e){if(!e)return null;for(const t of e.elements){const r=t.tagName;if(r==="BUTTON"||r==="INPUT"){const a=t;if(a.type==="submit")return a}}return null}const E8="data-checked",R8="data-unchecked";function MA(e){return{checked(t){return e.indeterminate?{}:t?{[E8]:""}:{[R8]:""}},...og}}const A8=g.createContext(void 0);function O8(){return g.useContext(A8)}const DA=g.createContext(void 0);function M8(){const e=g.useContext(DA);if(e===void 0)throw new Error(Zt(14));return e}const D8="data-parent",z8=g.forwardRef(function(t,r){const{checked:a,className:l,defaultChecked:c=!1,"aria-labelledby":u,disabled:f=!1,form:h,id:m,indeterminate:x=!1,inputRef:p,name:b,onCheckedChange:v,parent:j=!1,readOnly:S=!1,render:N,required:C=!1,uncheckedValue:E,value:T,nativeButton:O=!1,style:k,...M}=t,{clearErrors:A}=ag(),{disabled:R,name:z,setDirty:_,setFilled:L,setFocused:Y,setTouched:P,state:V,validationMode:U,validityData:H,validation:F}=gu(),q=FL(),{labelId:W,registerControlId:B,getDescriptionProps:J}=af(),X=O8(),re=(X==null?void 0:X.allValues)===void 0?void 0:X.parent,I=re!==void 0,$=R||q.disabled||(X==null?void 0:X.disabled)||f,Q=z??b,G=T??Q,se=ms(),ee=(X==null?void 0:X.registerControlId)!==B,ne=lf({id:m||void 0,enabled:ee}),ie=O?ne:se;let oe={};I&&(j?oe=re.getParentProps():G!==void 0&&(oe=re.getChildProps(G)));const{checked:Z=a,indeterminate:de=x,onCheckedChange:ke,..._e}=oe,je=X==null?void 0:X.value,Ae=g.useRef(null),{getButtonProps:te,buttonRef:Ee}=oo({disabled:$,native:O}),Te=(X==null?void 0:X.validation)??F,[be,We]=Wr({controlled:G!==void 0&&je!==void 0&&!j?je.includes(G):Z,default:c,name:"Checkbox",state:"checked"}),Se=I?!!Z:be,Fe=I&&de||x;pg(Ae,se,be,void 0,!X&&!$,b);const Re=re==null?void 0:re.registerChildId,ve=g.useRef(null),pe=Te.registerInput,$e=X?G:void 0,Je=g.useCallback(Oe=>pe(Oe,{controlRef:Ae,value:$e}),[pe,$e]),mt=Yr(p,ve,j?void 0:Je),ot=lA(u,W,ve,!O,ne);qe(()=>{ve.current&&(ve.current.indeterminate=Fe),X||L(be)},[be,Fe,X,L]),ff(be,()=>{X||(A(Q),_(be!==H.initialValue),Te.change(be))});const Ie=Ys({checked:be,disabled:$,form:h,name:j?void 0:Q,id:O?void 0:ne,required:C,ref:mt,style:Q?b1:yg,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Oe){if(Oe.nativeEvent.defaultPrevented)return;if(S){Oe.preventDefault();return}const tt=Oe.currentTarget.checked,Ue=bt(Tr,Oe.nativeEvent);if(v==null||v(tt,Ue),!Ue.isCanceled&&(ke==null||ke(tt,Ue),!Ue.isCanceled&&(We(tt),G!==void 0&&X!==void 0&&!j&&!I))){const Ge=tt?[...X.value,G]:X.value.filter(ht=>ht!==G);X.setValue(Ge,Ue)}},onClick(Oe){Oe.stopPropagation()},onFocus(){var Oe;(Oe=Ae.current)==null||Oe.focus()}},T!==void 0?{value:(X?be&&T:T)||""}:gn,J,Oe=>Te.getValidationProps($,Oe));g.useEffect(()=>{if(!re||G===void 0)return;const Oe=re.disabledStatesRef.current;return Oe.set(G,$),()=>{Oe.delete(G)}},[re,$,G]);const at=g.useMemo(()=>({...V,checked:Se,disabled:$,readOnly:S,required:C,indeterminate:Fe}),[V,Se,$,S,C,Fe]),Xe=MA(at),me=Nt("span",t,{state:at,ref:[Ee,Ae,r],props:[{id:ie,role:"checkbox","aria-checked":Fe?"mixed":Se,"aria-readonly":S||void 0,"aria-required":C||void 0,"aria-labelledby":ot,[D8]:j?"":void 0,onFocus(){$||Y(!0)},onBlur(){const Oe=ve.current;Oe&&(P(!0),Y(!1),U==="onBlur"&&Te.commit(X?je:Oe.checked))},onKeyDown(Oe){var Ye;if(Oe.key!=="Enter"||(Oe.preventBaseUIHandler(),Oe.defaultPrevented))return;const tt=((Ye=ve.current)==null?void 0:Ye.form)??null,Ue=Oe.currentTarget,Ge=Oe.nativeEvent,ht=Oe.preventDefault,yt=Ge.preventDefault;let ue=!1;Oe.preventDefault=()=>{ue=!0,ht.call(Oe)},Ge.preventDefault=()=>{ue=!0,yt.call(Ge)},yt.call(Ge),xn(Ue).queueMicrotask(()=>{var Pe;Oe.preventDefault=ht,Ge.preventDefault=yt,ue||(Pe=T8(tt))==null||Pe.click()})},onClick(Oe){if(S||$)return;Oe.preventDefault();const tt=ve.current;tt&&Kc(tt,Oe)}},M,_e,te,J,Oe=>Te.getValidationProps($,Oe)],stateAttributesMapping:Xe}),Me=me.props.id;return qe(()=>{if(!(!Re||j||G===void 0||Me===void 0))return Re(G,Me)},[Re,j,G,Me]),s.jsxs(DA.Provider,{value:at,children:[me,!be&&!X&&Q&&!j&&E!==void 0&&s.jsx("input",{type:"hidden",form:h,name:Q,value:E,disabled:$}),s.jsx("input",{...Ie,suppressHydrationWarning:!0})]})}),P8=g.forwardRef(function(t,r){const{render:a,className:l,style:c,keepMounted:u=!1,...f}=t,h=M8(),m=h.checked||h.indeterminate,{mounted:x,transitionStatus:p,setMounted:b}=Ga(m),v=g.useRef(null),j={...h,transitionStatus:p};ir({batch:!0,enabled:!m,open:m,ref:v,onComplete(){m||b(!1)}});const N={...MA(h),...Fa},C=u||x,E=Nt("span",t,{ref:[r,v],state:j,stateAttributesMapping:N,props:f});return C?E:null});function Pl({className:e,...t}){return s.jsx(z8,{"data-slot":"checkbox",className:hs("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",e),...t,children:s.jsx(P8,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:s.jsx(qn,{})})})}function I8(e){const t=g.useRef(!0);t.current&&(t.current=!1,e())}function _8(e){const[t,r]=g.useState({current:e,previous:null});return Object.is(e,t.current)||r({current:e,previous:t.current}),t.previous}function zA(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function In(e){const t=fs(L8,e).current;return t.next=e,qe(t.effect),t}function L8(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var P0={exports:{}},I0={};/**
|
|
481
|
+
* @license React
|
|
482
|
+
* use-sync-external-store-shim.production.js
|
|
483
|
+
*
|
|
484
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
485
|
+
*
|
|
486
|
+
* This source code is licensed under the MIT license found in the
|
|
487
|
+
* LICENSE file in the root directory of this source tree.
|
|
488
|
+
*/var IC;function B8(){if(IC)return I0;IC=1;var e=tf();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,l=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function f(p,b){var v=b(),j=a({inst:{value:v,getSnapshot:b}}),S=j[0].inst,N=j[1];return c(function(){S.value=v,S.getSnapshot=b,h(S)&&N({inst:S})},[p,v,b]),l(function(){return h(S)&&N({inst:S}),p(function(){h(S)&&N({inst:S})})},[p]),u(v),v}function h(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!r(p,v)}catch{return!0}}function m(p,b){return b()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return I0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,I0}var _C;function PA(){return _C||(_C=1,P0.exports=B8()),P0.exports}var y1=PA(),_0={exports:{}},L0={};/**
|
|
489
|
+
* @license React
|
|
490
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
491
|
+
*
|
|
492
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
493
|
+
*
|
|
494
|
+
* This source code is licensed under the MIT license found in the
|
|
495
|
+
* LICENSE file in the root directory of this source tree.
|
|
496
|
+
*/var LC;function $8(){if(LC)return L0;LC=1;var e=tf(),t=PA();function r(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var a=typeof Object.is=="function"?Object.is:r,l=t.useSyncExternalStore,c=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return L0.useSyncExternalStoreWithSelector=function(m,x,p,b,v){var j=c(null);if(j.current===null){var S={hasValue:!1,value:null};j.current=S}else S=j.current;j=f(function(){function C(M){if(!E){if(E=!0,T=M,M=b(M),v!==void 0&&S.hasValue){var A=S.value;if(v(A,M))return O=A}return O=M}if(A=O,a(T,M))return A;var R=b(M);return v!==void 0&&v(A,R)?(T=M,A):(T=M,O=R)}var E=!1,T,O,k=p===void 0?null:p;return[function(){return C(x())},k===null?void 0:function(){return C(k())}]},[x,p,b,v]);var N=l(m,j[0],j[1]);return u(function(){S.hasValue=!0,S.value=N},[N]),h(N),N},L0}var BC;function V8(){return BC||(BC=1,_0.exports=$8()),_0.exports}var U8=V8();const Ky=[];let Xy;function H8(){return Xy}function F8(e){Ky.push(e)}function hf(e){const t=(r,a)=>{const l=fs(G8).current;let c;try{Xy=l;for(const u of Ky)u.before(l);c=e(r,a);for(const u of Ky)u.after(l);l.didInitialize=!0}finally{Xy=void 0}return c};return t.displayName=e.displayName||e.name,t}function v1(e){return g.forwardRef(hf(e))}function G8(){return{didInitialize:!1}}const q8=s1(19),Y8=q8?X8:W8;function IA(e,t,r,a,l){return Y8(e,t,r,a,l)}function K8(e,t,r,a,l){const c=g.useCallback(()=>t(e.getSnapshot(),r,a,l),[e,t,r,a,l]);return y1.useSyncExternalStore(e.subscribe,c,c)}F8({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let r=0;r<e.syncHooks.length;r+=1){const a=e.syncHooks[r],l=a.selector(a.store.state,a.a1,a.a2,a.a3);Object.is(a.value,l)||(t=!0,a.value=l)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const r=new Set;for(const l of e.syncHooks)r.add(l.store);const a=[];for(const l of r)a.push(l.subscribe(t));return()=>{for(const l of a)l()}}),y1.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function X8(e,t,r,a,l){const c=H8();if(!c)return K8(e,t,r,a,l);const u=c.syncIndex;c.syncIndex+=1;let f;return c.didInitialize?(f=c.syncHooks[u],(f.store!==e||f.selector!==t||!Object.is(f.a1,r)||!Object.is(f.a2,a)||!Object.is(f.a3,l))&&(f.store!==e&&(c.didChangeStore=!0),f.store=e,f.selector=t,f.a1=r,f.a2=a,f.a3=l,f.value=t(e.getSnapshot(),r,a,l))):(f={store:e,selector:t,a1:r,a2:a,a3:l,value:t(e.getSnapshot(),r,a,l)},c.syncHooks.push(f)),f.value}function W8(e,t,r,a,l){return U8.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,c=>t(c,r,a,l))}class Q8{constructor(t){tn(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));tn(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const a of this.listeners){if(r!==this.updateTick)return;a(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,a,l){return IA(this,t,r,a,l)}}class bu extends Q8{constructor(t,r={},a){super(t),this.context=r,this.selectors=a}useSyncedValue(t,r){g.useDebugValue(t);const a=this;qe(()=>{a.state[t]!==r&&a.set(t,r)},[a,t,r])}useSyncedValueWithCleanup(t,r){const a=this;qe(()=>(a.state[t]!==r&&a.set(t,r),()=>{a.set(t,void 0)}),[a,t,r])}useSyncedValues(t){const r=this,a=Object.values(t);qe(()=>{r.update(t)},[r,...a])}useControlledProp(t,r){g.useDebugValue(t);const a=this,l=r!==void 0;qe(()=>{l&&!Object.is(a.state[t],r)&&a.setState({...a.state,[t]:r})},[a,t,r,l])}select(t,r,a,l){const c=this.selectors[t];return c(this.state,r,a,l)}useState(t,r,a,l){return g.useDebugValue(t),IA(this,this.selectors[t],r,a,l)}useContextCallback(t,r){g.useDebugValue(t);const a=Ze(r??Tn);this.context[t]=a}useStateSetter(t){const r=g.useRef(void 0);return r.current===void 0&&(r.current=a=>{this.set(t,a)}),r.current}observe(t,r){let a;typeof t=="function"?a=t:a=this.selectors[t];let l=a(this.state);return r(l,l,this),this.subscribe(c=>{const u=a(c);if(!Object.is(l,u)){const f=l;l=u,r(u,f,this)}})}}function Xo(...e){return()=>{for(let t=0;t<e.length;t+=1){const r=e[t];r&&r()}}}function Lt(e,t,r,a){return e.addEventListener(t,r,a),()=>{e.removeEventListener(t,r,a)}}function Z8(e,t){return t!=null&&!Ei(t)?0:typeof e=="function"?e():e}function Il(e,t,r){const a=Z8(e,r);return typeof a=="number"?a:a==null?void 0:a[t]}function $C(e){return typeof e=="function"?e():e}function _A(e,t){return t||e==="click"||e==="mousedown"}function J8(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const LA=g.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Kr,currentIdRef:{current:null},currentContextRef:{current:null}});function eB(e,t){e.current=t.current}function tB(e){const{children:t,delay:r,timeoutMs:a=0}=e,l=g.useRef(r),c=g.useRef(r),u=g.useRef(null),f=g.useRef(null),h=es();return qe(()=>{if(c.current=r,!u.current){l.current=r;return}l.current={open:Il(l.current,"open"),close:Il(r,"close")}},[r,u,l,c]),s.jsx(LA.Provider,{value:g.useMemo(()=>({hasProvider:!0,delayRef:l,initialDelayRef:c,currentIdRef:u,timeoutMs:a,currentContextRef:f,timeout:h}),[a,h]),children:t})}function nB(e,t={open:!1}){const{open:r}=t,a="rootStore"in e?e.rootStore:e,l=a.useState("floatingId"),c=g.useContext(LA),{currentIdRef:u,delayRef:f,timeoutMs:h,initialDelayRef:m,currentContextRef:x,hasProvider:p,timeout:b}=c,[v,j]=g.useState(!1),S=g.useRef(r);return qe(()=>{S.current=r},[r]),qe(()=>{function N(){var C;(C=x.current)==null||C.setIsInstantPhase(!1),u.current=null,x.current=null,f.current=m.current,b.clear()}if(u.current&&!r&&u.current===l){if(j(!1),h){const C=l;return b.start(h,()=>{a.select("open")||u.current&&u.current!==C||N()}),()=>{(S.current||u.current!==C)&&b.clear()}}N()}},[r,l,u,f,h,m,x,b,a]),qe(()=>{if(!r)return;const N=x.current,C=u.current;b.clear(),x.current={onOpenChange:a.setOpen,setIsInstantPhase:j},u.current=l,f.current={open:0,close:Il(m.current,"close")},C!==null&&C!==l?(j(!0),N==null||N.setIsInstantPhase(!0),N==null||N.onOpenChange(!1,bt(Tr))):(j(!1),N==null||N.setIsInstantPhase(!1))},[r,l,a,u,f,m,x,b]),qe(()=>()=>{if(u.current===l){if(x.current=null,!S.current)return;u.current=null,eB(f,m),b.clear()}},[x,u,f,l,m,b]),g.useMemo(()=>({activeIdRef:u,hasProvider:p,delayRef:f,isInstantPhase:v}),[u,p,f,v])}const _i=g.forwardRef(function(t,r){const[a,l]=g.useState();qe(()=>{lL&&Ha&&l("button")},[]);const c={tabIndex:0,role:a};return s.jsx("span",{...t,ref:r,style:yg,"aria-hidden":a?void 0:!0,...c,"data-base-ui-focus-guard":""})});function Fd(e){return`data-base-ui-${e}`}let ah=0;function Bh(e,t={}){const{preventScroll:r=!1,sync:a=!1,shouldFocus:l}=t;cancelAnimationFrame(ah);function c(){l&&!l()||e==null||e.focus({preventScroll:r})}if(a)return c(),Tn;const u=requestAnimationFrame(c);return ah=u,()=>{ah===u&&(cancelAnimationFrame(u),ah=0)}}const B0={inert:new WeakMap,"aria-hidden":new WeakMap},VC="data-base-ui-inert",Wy={inert:new WeakSet,"aria-hidden":new WeakSet};let yd=new WeakMap,$0=0;function sB(e){return Wy[e]}function BA(e){return e?au(e)?e.host:BA(e.parentNode):null}const UC=(e,t)=>t.map(r=>{if(e.contains(r))return r;const a=BA(r);return e.contains(a)?a:null}).filter(r=>r!=null),HC=e=>{const t=new Set;return e.forEach(r=>{let a=r;for(;a&&!t.has(a);)t.add(a),a=a.parentNode}),t},FC=(e,t,r)=>{const a=[],l=c=>{!c||r.has(c)||Array.from(c.children).forEach(u=>{zs(u)!=="script"&&(t.has(u)?l(u):a.push(u))})};return l(e),a};function rB(e,t,r,a,{mark:l=!0}){let c=null;a?c="inert":r&&(c="aria-hidden");let u=null,f=null;const h=UC(t,e),m=l?FC(t,HC(h),new Set(h)):[],x=[],p=[];if(c){const b=B0[c],v=sB(c);f=v,u=b;const j=UC(t,Array.from(t.querySelectorAll("[aria-live]"))),S=h.concat(j);FC(t,HC(S),new Set(S)).forEach(C=>{const E=C.getAttribute(c),T=E!==null&&E!=="false",O=(b.get(C)||0)+1;b.set(C,O),x.push(C),O===1&&T&&v.add(C),T||C.setAttribute(c,c==="inert"?"":"true")})}return l&&m.forEach(b=>{const v=(yd.get(b)||0)+1;yd.set(b,v),p.push(b),v===1&&b.setAttribute(VC,"")}),$0+=1,()=>{u&&x.forEach(b=>{const j=(u.get(b)||0)-1;u.set(b,j),j||(!(f!=null&&f.has(b))&&c&&b.removeAttribute(c),f==null||f.delete(b))}),l&&p.forEach(b=>{const v=(yd.get(b)||0)-1;yd.set(b,v),v||b.removeAttribute(VC)}),$0-=1,$0||(B0.inert=new WeakMap,B0["aria-hidden"]=new WeakMap,Wy.inert=new WeakSet,Wy["aria-hidden"]=new WeakSet,yd=new WeakMap)}}function GC(e,t={}){const{ariaHidden:r=!1,inert:a=!1,mark:l=!0}=t,c=Ft(e[0]).body;return rB(e,c,r,a,{mark:l})}const oB=500,$A=500,aB={style:{transition:"none"}},VA="data-base-ui-click-trigger",UA={fallbackAxisSide:"none"},w1={fallbackAxisSide:"end"},iB={clipPath:"inset(50%)",position:"fixed",top:0,left:0},HA=g.createContext(null),FA=()=>g.useContext(HA),lB=Fd("portal");function GA(e={}){const{ref:t,container:r,componentProps:a=gn,elementProps:l}=e,c=zl(),u=FA(),f=u==null?void 0:u.portalNode,[h,m]=g.useState(null),[x,p]=g.useState(null),b=Ze(N=>{N!==null&&p(N)}),v=g.useRef(null);qe(()=>{if(r===null){v.current&&(v.current=null,p(null),m(null));return}const N=(r&&(Qv(r)?r:r.current))??f??document.body;if(N==null){v.current&&(v.current=null,p(null),m(null));return}v.current!==N&&(v.current=N,p(null),m(N))},[r,f]);const j=Nt("div",a,{ref:[t,b],props:[{id:c,[lB]:""},l]}),S=h&&j?Xr.createPortal(j,h):null;return{node:x,nodeId:g.isValidElement(j)?j.props.id:void 0,subtree:S}}const vg=g.forwardRef(function(t,r){const{render:a,className:l,style:c,children:u,container:f,portalOwnerRole:h,...m}=t,{node:x,nodeId:p,subtree:b}=GA({container:f,ref:r,componentProps:t,elementProps:m}),v=g.useRef(null),j=g.useRef(null),S=g.useRef(null),N=g.useRef(null),[C,E]=g.useState(null),T=g.useRef(!1),O=C==null?void 0:C.modal,k=C==null?void 0:C.open,M=!!C&&!C.modal&&C.open&&!!x;g.useEffect(()=>{if(!x||O)return;function R(z){x&&z.relatedTarget&&Wc(z)&&(z.type==="focusin"?T.current&&(AC(x),T.current=!1):(UL(x),T.current=!0))}return Xo(Lt(x,"focusin",R,!0),Lt(x,"focusout",R,!0))},[x,O]),qe(()=>{!x||k!==!0||!T.current||(AC(x),T.current=!1)},[k,x]);const A=g.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:j,beforeInsideRef:S,afterInsideRef:N,portalNode:x,setFocusManagerState:E}),[x]);return s.jsxs(g.Fragment,{children:[b,s.jsxs(HA.Provider,{value:A,children:[M&&x&&s.jsx(_i,{"data-type":"outside",ref:v,onFocus:R=>{var z;if(Wc(R,x))(z=S.current)==null||z.focus();else{const _=C?C.domReference:null,L=jA(_);L==null||L.focus()}}}),M&&x&&s.jsx("span",{role:h,"aria-owns":p,style:iB}),x&&Xr.createPortal(u,x),M&&x&&s.jsx(_i,{"data-type":"outside",ref:j,onFocus:R=>{var z;if(Wc(R,x))(z=N.current)==null||z.focus();else{const _=C?C.domReference:null,L=g1(_);L==null||L.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,bt(Pi,R.nativeEvent)))}}})]})]})});function qA(){const e=new Map;return{emit(t,r){var a;(a=e.get(t))==null||a.forEach(l=>l(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var a;(a=e.get(t))==null||a.delete(r)}}}class j1{constructor(){tn(this,"nodesRef",{current:[]});tn(this,"events",qA())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const r=this.nodesRef.current.findIndex(a=>a===t);r!==-1&&this.nodesRef.current.splice(r,1)}}const YA=g.createContext(null),KA=g.createContext(null),$i=()=>{var e;return((e=g.useContext(YA))==null?void 0:e.id)||null},Vi=e=>{const t=g.useContext(KA);return e??t};function S1(e){const t=zl(),r=Vi(e),a=$i();return qe(()=>{if(!t)return;const l={id:t,parentId:a};return r==null||r.addNode(l),()=>{r==null||r.removeNode(l)}},[r,t,a]),t}function XA(e){const{children:t,id:r}=e,a=$i();return s.jsx(YA.Provider,{value:g.useMemo(()=>({id:r,parentId:a}),[r,a]),children:t})}function WA(e){const{children:t,externalTree:r}=e,a=fs(()=>r??new j1).current;return s.jsx(KA.Provider,{value:a,children:t})}function cB(e,t){const r=xn(Ds(e));return e instanceof r.KeyboardEvent?"keyboard":e instanceof r.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof r.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const qC=20;let Ti=[];function N1(){Ti=Ti.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function YC(e){N1(),e&&zs(e)!=="body"&&(Ti.push(new WeakRef(e)),Ti.length>qC&&(Ti=Ti.slice(-qC)))}function KC(){var e;return N1(),(e=Ti[Ti.length-1])==null?void 0:e.deref()}function uB(e){return e?p1(e)?e:uf(e)[0]||e:null}function XC(e){var l;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const r=vA(e).filter(c=>{const u=c.getAttribute("data-tabindex")||"";return p1(c)||c.hasAttribute("data-tabindex")&&!u.startsWith("-")}),a=e.getAttribute("tabindex");r.length===0?a!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function wg(e){const{context:t,children:r,disabled:a=!1,initialFocus:l=!0,returnFocus:c=!0,restoreFocus:u=!1,modal:f=!0,closeOnFocusOut:h=!0,openInteractionType:m="",nextFocusableElement:x,previousFocusableElement:p,beforeContentFocusGuardRef:b,externalTree:v,getInsideElements:j}=e,S="rootStore"in t?t.rootStore:t,N=S.useState("open"),C=S.useState("domReferenceElement"),E=S.useState("floatingElement"),{events:T,dataRef:O}=S.context,k=Ze(()=>{var oe;return(oe=O.current.floatingContext)==null?void 0:oe.nodeId}),M=l===!1,A=Vy(C)&&M,R=In(l),z=In(c),_=In(m),L=In(N),Y=Vi(v),P=FA(),V=g.useRef(!1),U=g.useRef(!1),H=g.useRef(!1),F=g.useRef(null),q=g.useRef(""),W=g.useRef(""),B=g.useRef(null),J=g.useRef(null),X=Yr(B,b,P==null?void 0:P.beforeInsideRef),re=Yr(J,P==null?void 0:P.afterInsideRef),I=es(),$=es(),Q=lu(),G=P!=null,se=xp(E),ee=Ze((oe=se)=>oe?uf(oe):[]),ne=Ze(()=>(j==null?void 0:j().filter(oe=>oe!=null))??[]);g.useEffect(()=>{if(a||!f)return;function oe(de){de.key==="Tab"&&pt(se,_s(Ft(se)))&&ee().length===0&&!A&&qo(de)}const Z=Ft(se);return Lt(Z,"keydown",oe)},[a,se,f,A,ee]),g.useEffect(()=>{if(a||!N)return;const oe=Ft(se);function Z(){H.current=!1}function de(_e){const je=Ds(_e),Ae=ne(),te=pt(E,je)||pt(C,je)||pt(P==null?void 0:P.portalNode,je)||Ae.some(Ee=>Ee===je||pt(Ee,je));H.current=!te,W.current=_e.pointerType||"keyboard",je!=null&&je.closest(`[${VA}]`)&&(U.current=!0,$.start(0,()=>{U.current=!1}))}function ke(){W.current="keyboard"}return Xo(Lt(oe,"pointerdown",de,!0),Lt(oe,"pointerup",Z,!0),Lt(oe,"pointercancel",Z,!0),Lt(oe,"keydown",ke,!0),Z)},[a,E,C,se,N,P,$,ne]),g.useEffect(()=>{if(a||!h)return;const oe=Ft(se);function Z(){U.current=!0,$.start(0,()=>{U.current=!1})}function de(Ae){const te=Ds(Ae);p1(te)&&(F.current=te)}function ke(Ae){const te=Ae.relatedTarget,Ee=Ae.currentTarget,Te=Ds(Ae);f&&te==null&&Te!=null&&pt(E,Te)&&YC(Te),queueMicrotask(()=>{const be=k(),We=S.context.triggerElements,Se=ne(),Fe=(te==null?void 0:te.hasAttribute(Fd("focus-guard")))&&[B.current,J.current,P==null?void 0:P.beforeInsideRef.current,P==null?void 0:P.afterInsideRef.current,P==null?void 0:P.beforeOutsideRef.current,P==null?void 0:P.afterOutsideRef.current,va(p),va(x)].includes(te),Re=!(pt(C,te)||pt(E,te)||pt(te,E)||pt(P==null?void 0:P.portalNode,te)||Se.some(ve=>ve===te||pt(ve,te))||We.hasMatchingElement(ve=>pt(ve,te))||Fe||Y&&(Di(Y.nodesRef.current,be).find(ve=>{var pe,$e;return pt((pe=ve.context)==null?void 0:pe.elements.floating,te)||pt(($e=ve.context)==null?void 0:$e.elements.domReference,te)})||TC(Y.nodesRef.current,be).find(ve=>{var pe,$e,Je;return[(pe=ve.context)==null?void 0:pe.elements.floating,xp(($e=ve.context)==null?void 0:$e.elements.floating)].includes(te)||((Je=ve.context)==null?void 0:Je.elements.domReference)===te})));if(Ee===C&&se&&XC(se),u&&Ee!==C&&!hg(Te)&&_s(oe)===oe.body){if(un(se)&&(se.focus(),u==="popup")){Q.request(()=>{se.focus()});return}const ve=ee(),pe=F.current,$e=(pe&&ve.includes(pe)?pe:null)||ve[ve.length-1]||se;un($e)&&$e.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(A||!f)&&te&&Re&&!U.current&&(A||te!==KC())&&(V.current=!0,S.setOpen(!1,bt(Pi,Ae)))})}function _e(){H.current||(O.current.insideReactTree=!0,I.start(0,()=>{O.current.insideReactTree=!1}))}const je=un(C)?C:null;if(!(!E&&!je))return Xo(je&&Lt(je,"focusout",ke),je&&Lt(je,"pointerdown",Z),E&&Lt(E,"focusin",de),E&&Lt(E,"focusout",ke),E&&P&&Lt(E,"focusout",_e,!0))},[a,C,E,se,f,Y,P,S,h,u,ee,A,k,O,I,$,Q,x,p,ne]),g.useEffect(()=>{var Ee,Te,be;if(a||!E||!N)return;const oe=Array.from(((Ee=P==null?void 0:P.portalNode)==null?void 0:Ee.querySelectorAll(`[${Fd("portal")}]`))||[]),de=(be=(Te=(Y?TC(Y.nodesRef.current,k()):[]).find(We=>{var Se;return Vy(((Se=We.context)==null?void 0:Se.elements.domReference)||null)}))==null?void 0:Te.context)==null?void 0:be.elements.domReference,_e=[...[E,...oe,B.current,J.current,P==null?void 0:P.beforeOutsideRef.current,P==null?void 0:P.afterOutsideRef.current,...ne()],de,va(p),va(x),A?C:null].filter(We=>We!=null),je=GC(_e,{ariaHidden:f||A,mark:!1}),Ae=[E,...oe].filter(We=>We!=null),te=GC(Ae);return()=>{te(),je()}},[N,a,C,E,f,P,A,Y,k,x,p,ne]),qe(()=>{if(!N||a||!un(se))return;q.current="",W.current="";const oe=Ft(se),Z=_s(oe);queueMicrotask(()=>{const de=R.current,ke=typeof de=="function"?de(_.current||""):de;if(ke===void 0||ke===!1||pt(se,Z))return;let je=null;const Ae=()=>(je==null&&(je=ee(se)),je[0]||se);let te;ke===!0||ke===null?te=Ae():te=va(ke),te=te||Ae();const Ee=pt(se,_s(oe));Bh(te,{preventScroll:te===se,shouldFocus(){if(!L.current)return!1;if(Ee)return!0;const Te=_s(oe);return!(Te!==te&&pt(se,Te))}})})},[a,N,se,ee,R,_,L]),qe(()=>{if(a||!se)return;const oe=Ft(se),Z=_s(oe),de=_.current==null;YC(Z);function ke(je){if(je.open||(q.current=cB(je.nativeEvent,W.current)),je.reason===Un&&je.nativeEvent.type==="mouseleave"&&(V.current=!0),je.reason===gg)if(je.nested)V.current=!1;else if(mg(je.nativeEvent)||d1(je.nativeEvent))V.current=!1;else{let Ae=!1;Ft(se).createElement("div").focus({get preventScroll(){return Ae=!0,!1}}),Ae?V.current=!1:V.current=!0}}T.on("openchange",ke);function _e(je){const Ae=z.current;let te=typeof Ae=="function"?Ae(je):Ae;if(te===void 0||te===!1)return null;te===null&&(te=!0);const Ee=C!=null&&C.isConnected?C:null,Te=Z!=null&&Z.isConnected&&zs(Z)!=="body"?Z:null;let be=de?Te||Ee:Ee||Te;return be||(be=KC()||null),typeof te=="boolean"?be:va(te)||be||null}return()=>{T.off("openchange",ke);const je=_s(oe),Ae=ne(),te=pt(E,je)||Ae.some(We=>We===je||pt(We,je))||Y&&Di(Y.nodesRef.current,k(),!1).some(We=>{var Se;return pt((Se=We.context)==null?void 0:Se.elements.floating,je)}),Ee=z.current,Te=q.current,be=_e(Te);queueMicrotask(()=>{const We=uB(be),Se=typeof Ee!="boolean";if(Ee&&!V.current&&un(We)&&(!(!Se&&We!==je&&je!==oe.body)||te)){const Fe={preventScroll:!0};Te==="keyboard"&&(Fe.focusVisible=!0),We.focus(Fe)}V.current=!1})}},[a,E,se,z,_,T,Y,C,k,ne]),qe(()=>{if(!Ha||N||!E)return;const oe=_s(Ft(E));!un(oe)||!fg(oe)||pt(E,oe)&&oe.blur()},[N,E]),qe(()=>{if(!(a||!P))return P.setFocusManagerState({modal:f,closeOnFocusOut:h,open:N,onOpenChange:S.setOpen,domReference:C}),()=>{P.setFocusManagerState(null)}},[a,P,f,N,S,h,C]),qe(()=>{if(!(a||!se))return XC(se),()=>{queueMicrotask(N1)}},[a,se]);const ie=!a&&(f?!A:!0)&&(G||f);return s.jsxs(g.Fragment,{children:[ie&&s.jsx(_i,{"data-type":"inside",ref:X,onFocus:oe=>{var Z;if(f){const de=ee();Bh(de[de.length-1])}else if(P!=null&&P.portalNode)if(V.current=!1,Wc(oe,P.portalNode)){const de=g1(C);de==null||de.focus()}else(Z=va(p??P.beforeOutsideRef))==null||Z.focus()}}),r,ie&&s.jsx(_i,{"data-type":"inside",ref:re,onFocus:oe=>{var Z;if(f)Bh(ee()[0]);else if(P!=null&&P.portalNode)if(h&&(V.current=!0),Wc(oe,P.portalNode)){const de=jA(C);de==null||de.focus()}else(Z=va(x??P.afterOutsideRef))==null||Z.focus()}})]})}function C1(e,t={}){const{enabled:r=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:u=!0,touchOpenDelay:f=0,reason:h=Jo}=t,m="rootStore"in e?e.rootStore:e,x=m.context.dataRef,p=g.useRef(void 0),b=lu(),v=es(),j=g.useMemo(()=>{function S(C,E,T,O){const k=bt(h,E,T);C&&O==="touch"&&f>0?v.start(f,()=>{m.setOpen(!0,k)}):m.setOpen(C,k)}function N(C,E,T){const O=x.current.openEvent,k=m.select("domReferenceElement")!==E;return C&&k||!C||!l?!0:O&&u?!T(O.type):!1}return{onPointerDown(C){p.current=Ei(C.pointerType,!0)&&d1(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const E=p.current,T=C.nativeEvent,O=m.select("open");if(C.button!==0||a==="click"||Ei(E,!0)&&c)return;const k=N(O,C.currentTarget,R=>R==="click"||R==="mousedown"),M=Ds(T);if(fg(M)){S(k,T,M,E);return}const A=C.currentTarget;b.request(()=>{S(k,T,A,E)})},onClick(C){if(a==="mousedown-only")return;const E=p.current;if(a==="mousedown"&&E){p.current=void 0;return}if(Ei(E,!0)&&c)return;const T=m.select("open"),O=N(T,C.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");S(O,C.nativeEvent,C.currentTarget,E)},onKeyDown(){p.current=void 0}}},[x,a,c,h,m,u,l,b,v,f]);return g.useMemo(()=>r?{reference:j}:gn,[r,j])}function dB(e,t){let r=null,a=null,l=!1;return{contextElement:e||void 0,getBoundingClientRect(){var v;const c=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},u=t.axis==="x"||t.axis==="both",f=t.axis==="y"||t.axis==="both",h=["mouseenter","mousemove"].includes(((v=t.dataRef.current.openEvent)==null?void 0:v.type)||"")&&t.pointerType!=="touch";let m=c.width,x=c.height,p=c.x,b=c.y;return r==null&&t.x&&u&&(r=c.x-t.x),a==null&&t.y&&f&&(a=c.y-t.y),p-=r||0,b-=a||0,m=0,x=0,!l||h?(m=t.axis==="y"?c.width:0,x=t.axis==="x"?c.height:0,p=u&&t.x!=null?t.x:p,b=f&&t.y!=null?t.y:b):l&&!h&&(x=t.axis==="x"?c.height:x,m=t.axis==="y"?c.width:m),l=!0,{width:m,height:x,x:p,y:b,top:b,right:p+m,bottom:b+x,left:p}}}}function WC(e){return e!=null&&e.clientX!=null}function fB(e,t={}){const{enabled:r=!0,axis:a="both"}=t,l="rootStore"in e?e.rootStore:e,c=l.useState("open"),u=l.useState("floatingElement"),f=l.useState("domReferenceElement"),h=l.context.dataRef,m=g.useRef(!1),x=g.useRef(null),[p,b]=g.useState(),[v,j]=g.useState([]),S=Ze(O=>{l.set("positionReference",O)}),N=Ze((O,k,M)=>{m.current||h.current.openEvent&&!WC(h.current.openEvent)||l.set("positionReference",dB(M??f,{x:O,y:k,axis:a,dataRef:h,pointerType:p}))}),C=Ze(O=>{c?x.current||(N(O.clientX,O.clientY,O.currentTarget),j([])):N(O.clientX,O.clientY,O.currentTarget)}),E=Ei(p)?u:c;g.useEffect(()=>{if(!r){S(f);return}if(!E)return;function O(){var A;(A=x.current)==null||A.call(x),x.current=null}const k=xn(u);function M(A){const R=Ds(A);pt(u,R)?O():N(A.clientX,A.clientY)}return!h.current.openEvent||WC(h.current.openEvent)?x.current=Lt(k,"mousemove",M):S(f),O},[E,r,u,h,f,l,N,S,v]),g.useEffect(()=>()=>{l.set("positionReference",null)},[l]),g.useEffect(()=>{r&&!u&&(m.current=!1)},[r,u]),g.useEffect(()=>{!r&&c&&(m.current=!0)},[r,c]);const T=g.useMemo(()=>{function O(k){b(k.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:C,onMouseEnter:C}},[C]);return g.useMemo(()=>r?{reference:T,trigger:T}:{},[r,T])}function mB(){return!1}function hB(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function pf(e,t={}){const{enabled:r=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="sloppy",referencePress:u=mB,bubbles:f,externalTree:h}=t,m="rootStore"in e?e.rootStore:e,x=m.useState("open"),p=m.useState("floatingElement"),{dataRef:b,events:v}=m.context,j=Vi(h),S=Ze(typeof l=="function"?l:()=>!1),N=typeof l=="function"?S:l,C=N!==!1,E=Ze(()=>c),{escapeKey:T,outsidePress:O}=hB(f),k=g.useRef(!1),M=g.useRef(!1),A=g.useRef(!1),R=g.useRef(!1),z=g.useRef(!1),_=g.useRef(""),L=g.useRef(null),Y=es(),P=es(),V=Ze(()=>{P.clear(),b.current.insideReactTree=!1}),U=Ze(I=>{var G;const $=(G=b.current.floatingContext)==null?void 0:G.nodeId;return(j?Di(j.nodesRef.current,$):[]).some(se=>{var ee;return((ee=se.context)==null?void 0:ee.open)&&!se.context.dataRef.current[I]})}),H=Ze(I=>A0(I,m.select("floatingElement"))||A0(I,m.select("domReferenceElement"))),F=Ze(I=>{u()&&m.setOpen(!1,bt(Jo,I.nativeEvent))}),q=Ze(I=>{if(!x||!r||!a||I.key!=="Escape"||z.current||!T&&U("__escapeKeyBubbles"))return;const $=NL(I)?I.nativeEvent:I,Q=bt(mf,$);m.setOpen(!1,Q),Q.isCanceled||I.preventDefault(),!T&&!Q.isPropagationAllowed&&I.stopPropagation()}),W=Ze(()=>{b.current.insideReactTree=!0,P.start(0,V)}),B=Ze(I=>{if(!x||!r||I.button!==0)return;const $=Ds(I.nativeEvent);pt(m.select("floatingElement"),$)&&(k.current||(k.current=!0,M.current=!1))}),J=Ze(I=>{!x||!r||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&k.current&&(M.current=!0)});g.useEffect(()=>{function I($){$.open||(R.current=!1)}return v.on("openchange",I),()=>{v.off("openchange",I)}},[v]),g.useEffect(()=>{if(!x||!r)return x||(R.current=!1),V;b.current.__escapeKeyBubbles=T,b.current.__outsidePressBubbles=O;const I=new Kr,$=new Kr,Q=Ft(p);function G(){I.clear(),z.current=!0}function se(){I.start(Ha?5:0,()=>{z.current=!1})}function ee(){A.current=!0,$.start(0,()=>{A.current=!1})}function ne(){k.current=!1,M.current=!1}function ie(){const Re=_.current,ve=Re==="pen"||!Re?"mouse":Re,pe=E(),$e=typeof pe=="function"?pe():pe;return typeof $e=="string"?$e:$e[ve]}function oe(Re){const ve=ie();return ve==="intentional"&&Re.type!=="click"||ve==="sloppy"&&Re.type==="click"}function Z(Re){var $e;const ve=($e=b.current.floatingContext)==null?void 0:$e.nodeId,pe=j&&Di(j.nodesRef.current,ve).some(Je=>{var mt;return A0(Re,(mt=Je.context)==null?void 0:mt.elements.floating)});return H(Re)||pe}function de(Re){if(oe(Re)){Re.type!=="click"&&!H(Re)&&($.clear(),A.current=!1),V();return}if(b.current.insideReactTree){V();return}const ve=Ds(Re),pe=`[${Fd("inert")}]`,$e=Gt(ve)?ve.getRootNode():null,Je=Array.from((au($e)?$e:Ft(m.select("floatingElement"))).querySelectorAll(pe)),mt=m.context.triggerElements;if(ve&&(mt.hasElement(ve)||mt.hasMatchingElement(Ie=>pt(Ie,ve))))return;let ot=Gt(ve)?ve:null;for(;ot&&!Ta(ot);){const Ie=Ma(ot);if(Ta(Ie)||!Gt(Ie))break;ot=Ie}if(!(Je.length&&Gt(ve)&&!wL(ve)&&!pt(ve,m.select("floatingElement"))&&Je.every(Ie=>!pt(ot,Ie)))){if(un(ve)&&!("touches"in Re)){const Ie=Ta(ve),at=Cr(ve),Xe=/auto|scroll/,me=Ie||Xe.test(at.overflowX),Me=Ie||Xe.test(at.overflowY),Oe=me&&ve.clientWidth>0&&ve.scrollWidth>ve.clientWidth,tt=Me&&ve.clientHeight>0&&ve.scrollHeight>ve.clientHeight,Ue=at.direction==="rtl",Ge=tt&&(Ue?Re.offsetX<=ve.offsetWidth-ve.clientWidth:Re.offsetX>ve.clientWidth),ht=Oe&&Re.offsetY>ve.clientHeight;if(Ge||ht)return}if(!Z(Re)){if(ie()==="intentional"){if(Re.detail!==0&&!mg(Re)&&!R.current)return;if(A.current){$.clear(),A.current=!1;return}}typeof N=="function"&&!N(Re)||U("__outsidePressBubbles")||(m.setOpen(!1,bt(gg,Re)),V())}}}function ke(Re){ie()!=="sloppy"||Re.pointerType==="touch"||!m.select("open")||!r||H(Re)||de(Re)}function _e(Re){if(ie()!=="sloppy"||!m.select("open")||!r||H(Re))return;const ve=Re.touches[0];ve&&(L.current={startTime:Date.now(),startX:ve.clientX,startY:ve.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},Y.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function je(Re,ve){const pe=Ds(Re);if(!pe)return;const $e=Lt(pe,Re.type,()=>{ve(Re),$e()})}function Ae(Re){_.current="touch",je(Re,_e)}function te(Re){Y.clear(),Re.type==="pointerdown"&&(Re.button===0&&(R.current=!0),_.current=Re.pointerType),!(Re.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)&&je(Re,ve=>{ve.type==="pointerdown"?ke(ve):de(ve)})}function Ee(Re){if(Re.type==="pointercancel"&&(R.current=!1),!k.current)return;const ve=M.current;if(ne(),ie()==="intentional"){if(Re.type==="pointercancel"){ve&&ee();return}if(!Z(Re)){if(ve){ee();return}typeof N=="function"&&!N(Re)||($.clear(),A.current=!0,V())}}}function Te(Re){if(ie()!=="sloppy"||!L.current||H(Re))return;const ve=Re.touches[0];if(!ve)return;const pe=Math.abs(ve.clientX-L.current.startX),$e=Math.abs(ve.clientY-L.current.startY),Je=Math.sqrt(pe*pe+$e*$e);Je>5&&(L.current.dismissOnTouchEnd=!0),Je>10&&(de(Re),Y.clear(),L.current=null)}function be(Re){je(Re,Te)}function We(Re){ie()!=="sloppy"||!L.current||H(Re)||(L.current.dismissOnTouchEnd&&de(Re),Y.clear(),L.current=null)}function Se(Re){je(Re,We)}const Fe=Xo(a&&Xo(Lt(Q,"keydown",q),Lt(Q,"compositionstart",G),Lt(Q,"compositionend",se)),C&&Xo(Lt(Q,"click",te,!0),Lt(Q,"pointerdown",te,!0),Lt(Q,"pointerup",Ee,!0),Lt(Q,"pointercancel",Ee,!0),Lt(Q,"mousedown",te,!0),Lt(Q,"mouseup",Ee,!0),Lt(Q,"touchstart",Ae,{capture:!0,passive:!0}),Lt(Q,"touchmove",be,{capture:!0,passive:!0}),Lt(Q,"touchend",Se,{capture:!0,passive:!0})));return()=>{Fe(),I.clear(),$.clear(),ne(),A.current=!1,V()}},[b,p,a,C,N,x,r,T,O,q,V,E,U,H,j,m,Y]);const X=g.useMemo(()=>({onKeyDown:q,onPointerDown:F,onClick:F}),[q,F]),re=g.useMemo(()=>({onKeyDown:q,onPointerDown:J,onMouseDown:J,onClickCapture:W,onMouseDownCapture(I){W(),B(I)},onPointerDownCapture(I){W(),B(I)},onMouseUpCapture:W,onTouchEndCapture:W,onTouchMoveCapture:W}),[q,W,B,J]);return g.useMemo(()=>r?{reference:X,floating:re,trigger:X}:{},[r,X,re])}function QC(e,t,r){let{reference:a,floating:l}=e;const c=Ur(t),u=h1(t),f=m1(u),h=Fr(t),m=c==="y",x=a.x+a.width/2-l.width/2,p=a.y+a.height/2-l.height/2,b=a[f]/2-l[f]/2;let v;switch(h){case"top":v={x,y:a.y-l.height};break;case"bottom":v={x,y:a.y+a.height};break;case"right":v={x:a.x+a.width,y:p};break;case"left":v={x:a.x-l.width,y:p};break;default:v={x:a.x,y:a.y}}const j=Da(t);return j&&(v[u]+=b*(j==="end"?1:-1)*(r&&m?-1:1)),v}async function pB(e,t){var r;t===void 0&&(t={});const{x:a,y:l,platform:c,rects:u,elements:f,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:x="viewport",elementContext:p="floating",altBoundary:b=!1,padding:v=0}=zi(t,e),j=mA(v),N=f[b?p==="floating"?"reference":"floating":p],C=Ud(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(N)))==null||r?N:N.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:m,rootBoundary:x,strategy:h})),E=p==="floating"?{x:a,y:l,width:u.floating.width,height:u.floating.height}:u.reference,T=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),O=await(c.isElement==null?void 0:c.isElement(T))&&await(c.getScale==null?void 0:c.getScale(T))||{x:1,y:1},k=Ud(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:T,strategy:h}):E);return{top:(C.top-k.top+j.top)/O.y,bottom:(k.bottom-C.bottom+j.bottom)/O.y,left:(C.left-k.left+j.left)/O.x,right:(k.right-C.right+j.right)/O.x}}const gB=50,xB=async(e,t,r)=>{const{placement:a="bottom",strategy:l="absolute",middleware:c=[],platform:u}=r,f=u.detectOverflow?u:{...u,detectOverflow:pB},h=await(u.isRTL==null?void 0:u.isRTL(t));let m=await u.getElementRects({reference:e,floating:t,strategy:l}),{x,y:p}=QC(m,a,h),b=a,v=0;const j={};for(let S=0;S<c.length;S++){const N=c[S];if(!N)continue;const{name:C,fn:E}=N,{x:T,y:O,data:k,reset:M}=await E({x,y:p,initialPlacement:a,placement:b,strategy:l,middlewareData:j,rects:m,platform:f,elements:{reference:e,floating:t}});x=T??x,p=O??p,j[C]={...j[C],...k},M&&v<gB&&(v++,typeof M=="object"&&(M.placement&&(b=M.placement),M.rects&&(m=M.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:l}):M.rects),{x,y:p}=QC(m,b,h)),S=-1)}return{x,y:p,placement:b,strategy:l,middlewareData:j}},bB=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,a;const{placement:l,middlewareData:c,rects:u,initialPlacement:f,platform:h,elements:m}=t,{mainAxis:x=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:S=!0,...N}=zi(e,t);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const C=Fr(l),E=Ur(f),T=Fr(f)===f,O=await(h.isRTL==null?void 0:h.isRTL(m.floating)),k=b||(T||!S?[yp(f)]:EL(f)),M=j!=="none";!b&&M&&k.push(...ML(f,S,j,O));const A=[f,...k],R=await h.detectOverflow(t,N),z=[];let _=((a=c.flip)==null?void 0:a.overflows)||[];if(x&&z.push(R[C]),p){const V=TL(l,u,O);z.push(R[V[0]],R[V[1]])}if(_=[..._,{placement:l,overflows:z}],!z.every(V=>V<=0)){var L,Y;const V=(((L=c.flip)==null?void 0:L.index)||0)+1,U=A[V];if(U&&(!(p==="alignment"?E!==Ur(U):!1)||_.every(q=>Ur(q.placement)===E?q.overflows[0]>0:!0)))return{data:{index:V,overflows:_},reset:{placement:U}};let H=(Y=_.filter(F=>F.overflows[0]<=0).sort((F,q)=>F.overflows[1]-q.overflows[1])[0])==null?void 0:Y.placement;if(!H)switch(v){case"bestFit":{var P;const F=(P=_.filter(q=>{if(M){const W=Ur(q.placement);return W===E||W==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(W=>W>0).reduce((W,B)=>W+B,0)]).sort((q,W)=>q[1]-W[1])[0])==null?void 0:P[0];F&&(H=F);break}case"initialPlacement":H=f;break}if(l!==H)return{reset:{placement:H}}}return{}}}},QA=new Set(["left","top"]);async function yB(e,t){const{placement:r,platform:a,elements:l}=e,c=await(a.isRTL==null?void 0:a.isRTL(l.floating)),u=Fr(r),f=Da(r),h=Ur(r)==="y",m=QA.has(u)?-1:1,x=c&&h?-1:1,p=zi(t,e);let{mainAxis:b,crossAxis:v,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return f&&typeof j=="number"&&(v=f==="end"?j*-1:j),h?{x:v*x,y:b*m}:{x:b*m,y:v*x}}const vB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,a;const{x:l,y:c,placement:u,middlewareData:f}=t,h=await yB(t,e);return u===((r=f.offset)==null?void 0:r.placement)&&(a=f.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:c+h.y,data:{...h,placement:u}}}}},wB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:a,placement:l,platform:c}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:E=>{let{x:T,y:O}=E;return{x:T,y:O}}},...m}=zi(e,t),x={x:r,y:a},p=await c.detectOverflow(t,m),b=Ur(l),v=f1(b);let j=x[v],S=x[b];const N=(E,T)=>fA(T+p[E==="y"?"top":"left"],T,T-p[E==="y"?"bottom":"right"]);u&&(j=N(v,j)),f&&(S=N(b,S));const C=h.fn({...t,[v]:j,[b]:S});return{...C,data:{x:C.x-r,y:C.y-a,enabled:{[v]:u,[b]:f}}}}}},jB=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,a;const{x:l,y:c,placement:u,rects:f,middlewareData:h}=t,{offset:m=0,mainAxis:x=!0,crossAxis:p=!0}=zi(e,t),b={x:l,y:c},v=Ur(u),j=f1(v);let S=b[j],N=b[v];const C=zi(m,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(r=C.mainAxis)!=null?r:0,crossAxis:(a=C.crossAxis)!=null?a:0};if(x){const k=j==="y"?"height":"width",M=f.reference[j]-f.floating[k]+E.mainAxis,A=f.reference[j]+f.reference[k]-E.mainAxis;S<M?S=M:S>A&&(S=A)}if(p){var T,O;const k=j==="y"?"width":"height",M=QA.has(Fr(u)),A=f.reference[v]-f.floating[k]+(M&&((T=h.offset)==null?void 0:T[v])||0)+(M?0:E.crossAxis),R=f.reference[v]+f.reference[k]+(M?0:((O=h.offset)==null?void 0:O[v])||0)-(M?E.crossAxis:0);N<A?N=A:N>R&&(N=R)}return{[j]:S,[v]:N}}}},SB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:a,platform:l,elements:c}=t,{apply:u=()=>{},...f}=zi(e,t),h=await l.detectOverflow(t,f),m=Fr(r),x=Da(r),p=Ur(r)==="y",{width:b,height:v}=a.floating;let j,S;m==="top"||m==="bottom"?(j=m,S=x===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(S=m,j=x==="end"?"top":"bottom");const N=v-h.top-h.bottom,C=b-h.left-h.right,E=iu(v-h[j],N),T=iu(b-h[S],C),O=t.middlewareData.shift,k=!O;let M=E,A=T;O!=null&&O.enabled.x&&(A=C),O!=null&&O.enabled.y&&(M=N),k&&!x&&(p?A=b-2*Ea(h.left,h.right):M=v-2*Ea(h.top,h.bottom)),await u({...t,availableWidth:A,availableHeight:M});const R=await l.getDimensions(c.floating);return b!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function ZA(e){const t=Cr(e);let r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const l=un(e),c=l?e.offsetWidth:r,u=l?e.offsetHeight:a,f=bp(r)!==c||bp(a)!==u;return f&&(r=c,a=u),{width:r,height:a,$:f}}function k1(e){return Gt(e)?e:e.contextElement}function Zc(e){const t=k1(e);if(!un(t))return Ra(1);const r=t.getBoundingClientRect(),{width:a,height:l,$:c}=ZA(t);let u=(c?bp(r.width):r.width)/a,f=(c?bp(r.height):r.height)/l;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const NB=Ra(0);function JA(e){const t=xn(e);return!Jv()||!t.visualViewport?NB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function CB(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===xn(e)}function _l(e,t,r,a){t===void 0&&(t=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),c=k1(e);let u=Ra(1);t&&(a?Gt(a)&&(u=Zc(a)):u=Zc(e));const f=CB(c,r,a)?JA(c):Ra(0);let h=(l.left+f.x)/u.x,m=(l.top+f.y)/u.y,x=l.width/u.x,p=l.height/u.y;if(c&&a){const b=xn(c),v=Gt(a)?xn(a):a;let j=b,S=zy(j);for(;S&&v!==j;){const N=Zc(S),C=S.getBoundingClientRect(),E=Cr(S),T=C.left+(S.clientLeft+parseFloat(E.paddingLeft))*N.x,O=C.top+(S.clientTop+parseFloat(E.paddingTop))*N.y;h*=N.x,m*=N.y,x*=N.x,p*=N.y,h+=T,m+=O,j=xn(S),S=zy(j)}}return Ud({width:x,height:p,x:h,y:m})}function jg(e,t){const r=ng(e).scrollLeft;return t?t.left+r:_l(Ua(e)).left+r}function e5(e,t){const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-jg(e,r),l=r.top+t.scrollTop;return{x:a,y:l}}function kB(e){let{elements:t,rect:r,offsetParent:a,strategy:l}=e;const c=l==="fixed",u=Ua(a),f=t?tg(t.floating):!1;if(a===u||f&&c)return r;let h={scrollLeft:0,scrollTop:0},m=Ra(1);const x=Ra(0),p=un(a);if((p||!c)&&((zs(a)!=="body"||of(u))&&(h=ng(a)),p)){const v=_l(a);m=Zc(a),x.x=v.x+a.clientLeft,x.y=v.y+a.clientTop}const b=u&&!p&&!c?e5(u,h):Ra(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-h.scrollLeft*m.x+x.x+b.x,y:r.y*m.y-h.scrollTop*m.y+x.y+b.y}}function TB(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function EB(e){const t=ng(e),r=e.ownerDocument.body,a=Ea(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=Ea(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-t.scrollLeft+jg(e);const u=-t.scrollTop;return Cr(r).direction==="rtl"&&(c+=Ea(e.clientWidth,r.clientWidth)-a),{width:a,height:l,x:c,y:u}}const RB=25;function AB(e,t,r){r===void 0&&(r="viewport");const a=r==="layoutViewport",l=xn(e),c=Ua(e),u=l.visualViewport;let f=c.clientWidth,h=c.clientHeight,m=0,x=0;if(u){const b=!Jv()||t==="fixed";a?b||(m=-u.offsetLeft,x=-u.offsetTop):(f=u.width,h=u.height,b&&(m=u.offsetLeft,x=u.offsetTop))}if(jg(c)<=0){const b=c.ownerDocument,v=b.body,j=getComputedStyle(v),S=b.compatMode==="CSS1Compat"&&parseFloat(j.marginLeft)+parseFloat(j.marginRight)||0,N=Math.abs(c.clientWidth-v.clientWidth-S),C=getComputedStyle(c).scrollbarGutter==="stable both-edges"?N/2:N;C<=RB&&(f-=C)}return{width:f,height:h,x:m,y:x}}function OB(e,t){const r=_l(e,!0,t==="fixed"),a=r.top+e.clientTop,l=r.left+e.clientLeft,c=Zc(e),u=e.clientWidth*c.x,f=e.clientHeight*c.y,h=l*c.x,m=a*c.y;return{width:u,height:f,x:h,y:m}}function ZC(e,t,r){let a;if(t==="viewport"||t==="layoutViewport")a=AB(e,r,t);else if(t==="document")a=EB(Ua(e));else if(Gt(t))a=OB(t,r);else{const l=JA(e);a={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return Ud(a)}function MB(e,t){const r=t.get(e);if(r)return r;let a=$d(e,[],!1).filter(f=>Gt(f)&&zs(f)!=="body"),l=null;const c=Cr(e).position==="fixed";let u=c?Ma(e):e;for(;Gt(u)&&!Ta(u);){const f=Cr(u),h=Zv(u),m=l?l.position:c?"fixed":"";!h&&(m==="fixed"||m==="absolute"&&f.position==="static")?a=a.filter(p=>p!==u):l=f,u=Ma(u)}return t.set(e,a),a}function DB(e){let{element:t,boundary:r,rootBoundary:a,strategy:l}=e;const u=[...r==="clippingAncestors"?tg(t)?[]:MB(t,this._c):[].concat(r),a],f=ZC(t,u[0],l);let h=f.top,m=f.right,x=f.bottom,p=f.left;for(let b=1;b<u.length;b++){const v=ZC(t,u[b],l);h=Ea(v.top,h),m=iu(v.right,m),x=iu(v.bottom,x),p=Ea(v.left,p)}return{width:m-p,height:x-h,x:p,y:h}}function zB(e){const{width:t,height:r}=ZA(e);return{width:t,height:r}}function PB(e,t,r){const a=un(t),l=Ua(t),c=r==="fixed",u=_l(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const h=Ra(0);if((a||!c)&&((zs(t)!=="body"||of(l))&&(f=ng(t)),a)){const b=_l(t,!0,c,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}!a&&l&&(h.x=jg(l));const m=l&&!a&&!c?e5(l,f):Ra(0),x=u.left+f.scrollLeft-h.x-m.x,p=u.top+f.scrollTop-h.y-m.y;return{x,y:p,width:u.width,height:u.height}}function V0(e){return Cr(e).position==="static"}function JC(e,t){if(!un(e)||Cr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ua(e)===r&&(r=r.ownerDocument.body),r}function t5(e,t){const r=xn(e);if(tg(e))return r;if(!un(e)){let l=Ma(e);for(;l&&!Ta(l);){if(Gt(l)&&!V0(l))return l;l=Ma(l)}return r}let a=JC(e,t);for(;a&&k6(a)&&V0(a);)a=JC(a,t);return a&&Ta(a)&&V0(a)&&!Zv(a)?r:a||R6(e)||r}const IB=async function(e){const t=this.getOffsetParent||t5,r=this.getDimensions,a=await r(e.floating);return{reference:PB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function _B(e){return Cr(e).direction==="rtl"}const n5={convertOffsetParentRelativeRectToViewportRelativeRect:kB,getDocumentElement:Ua,getClippingRect:DB,getOffsetParent:t5,getElementRects:IB,getClientRects:TB,getDimensions:zB,getScale:Zc,isElement:Gt,isRTL:_B};function s5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function LB(e,t,r){let a=null,l;const c=Ua(e);function u(){var x;clearTimeout(l),(x=a)==null||x.disconnect(),a=null}function f(x,p){x===void 0&&(x=!1),p===void 0&&(p=1),u();const b=e.getBoundingClientRect(),{left:v,top:j,width:S,height:N}=b;if(x||t(),!S||!N)return;const C=nh(j),E=nh(c.clientWidth-(v+S)),T=nh(c.clientHeight-(j+N)),O=nh(v),M={rootMargin:-C+"px "+-E+"px "+-T+"px "+-O+"px",threshold:Ea(0,iu(1,p))||1};let A=!0;function R(z){const _=z[0].intersectionRatio;if(!s5(b,e.getBoundingClientRect()))return f();if(_!==p){if(!A)return f();_?f(!1,_):l=setTimeout(()=>{f(!1,1e-7)},1e3)}A=!1}try{a=new IntersectionObserver(R,{...M,root:c.ownerDocument})}catch{a=new IntersectionObserver(R,M)}a.observe(e)}const h=xn(e),m=()=>f(r);return h.addEventListener("resize",m),f(!0),()=>{h.removeEventListener("resize",m),u()}}function ek(e,t,r,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,m=k1(e),x=l||c?[...m?$d(m):[],...t?$d(t):[]]:[];x.forEach(C=>{l&&C.addEventListener("scroll",r),c&&C.addEventListener("resize",r)});const p=m&&f?LB(m,r,c):null;let b=-1,v=null;u&&(v=new ResizeObserver(C=>{let[E]=C;E&&E.target===m&&v&&t&&(v.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(t)})),r()}),m&&!h&&v.observe(m),t&&v.observe(t));let j,S=h?_l(e):null;h&&N();function N(){const C=_l(e);S&&!s5(S,C)&&r(),S=C,j=requestAnimationFrame(N)}return r(),()=>{var C;x.forEach(E=>{l&&E.removeEventListener("scroll",r),c&&E.removeEventListener("resize",r)}),p==null||p(),(C=v)==null||C.disconnect(),v=null,h&&cancelAnimationFrame(j)}}const BB=vB,$B=wB,VB=bB,UB=SB,HB=jB,FB=(e,t,r)=>{const a=new Map,l=r??{},c={...n5,...l.platform,_c:a};return xB(e,t,{...l,platform:c})};var GB=typeof document<"u",qB=function(){},$h=GB?g.useLayoutEffect:qB;function wp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,a,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(a=r;a--!==0;)if(!wp(e[a],t[a]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(t,l[a]))return!1;for(a=r;a--!==0;){const c=l[a];if(!(c==="_owner"&&e.$$typeof)&&!wp(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function r5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tk(e,t){const r=r5(e);return Math.round(t*r)/r}function U0(e){const t=g.useRef(e);return $h(()=>{t.current=e}),t}function YB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:l,elements:{reference:c,floating:u}={},transform:f=!0,whileElementsMounted:h,open:m}=e,[x,p]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,v]=g.useState(a);wp(b,a)||v(a);const[j,S]=g.useState(null),[N,C]=g.useState(null),E=g.useCallback(q=>{q!==M.current&&(M.current=q,S(q))},[]),T=g.useCallback(q=>{q!==A.current&&(A.current=q,C(q))},[]),O=c||j,k=u||N,M=g.useRef(null),A=g.useRef(null),R=g.useRef(x),z=h!=null,_=U0(h),L=U0(l),Y=U0(m),P=g.useCallback(()=>{if(!M.current||!A.current)return;const q={placement:t,strategy:r,middleware:b};L.current&&(q.platform=L.current),FB(M.current,A.current,q).then(W=>{const B={...W,isPositioned:Y.current!==!1};V.current&&!wp(R.current,B)&&(R.current=B,Xr.flushSync(()=>{p(B)}))})},[b,t,r,L,Y]);$h(()=>{m===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(q=>({...q,isPositioned:!1})))},[m]);const V=g.useRef(!1);$h(()=>(V.current=!0,()=>{V.current=!1}),[]),$h(()=>{if(O&&(M.current=O),k&&(A.current=k),O&&k){if(_.current)return _.current(O,k,P);P()}},[O,k,P,_,z]);const U=g.useMemo(()=>({reference:M,floating:A,setReference:E,setFloating:T}),[E,T]),H=g.useMemo(()=>({reference:O,floating:k}),[O,k]),F=g.useMemo(()=>{const q={position:r,left:0,top:0};if(!H.floating)return q;const W=tk(H.floating,x.x),B=tk(H.floating,x.y);return f?{...q,transform:"translate("+W+"px, "+B+"px)",...r5(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:B}},[r,f,H.floating,x.x,x.y]);return g.useMemo(()=>({...x,update:P,refs:U,elements:H,floatingStyles:F}),[x,P,U,H,F])}const KB=(e,t)=>{const r=BB(e);return{name:r.name,fn:r.fn,options:[e,t]}},XB=(e,t)=>{const r=$B(e);return{name:r.name,fn:r.fn,options:[e,t]}},WB=(e,t)=>({fn:HB(e).fn,options:[e,t]}),QB=(e,t)=>{const r=VB(e);return{name:r.name,fn:r.fn,options:[e,t]}},ZB=(e,t)=>{const r=UB(e);return{name:r.name,fn:r.fn,options:[e,t]}},JB={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class T1 extends bu{constructor(r){const{syncOnly:a,nested:l,onOpenChange:c,triggerElements:u,...f}=r;super({...f,positionReference:f.referenceElement,domReferenceElement:f.referenceElement},{onOpenChange:c,dataRef:{current:{}},events:qA(),nested:l,triggerElements:u},JB);tn(this,"syncOpenEvent",(r,a)=>{(!r||!this.state.open||a!=null&&CL(a))&&(this.context.dataRef.current.openEvent=r?a:void 0)});tn(this,"dispatchOpenChange",(r,a)=>{this.syncOpenEvent(r,a.event);const l={open:r,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",l)});tn(this,"setOpen",(r,a)=>{var l,c,u,f;if(this.syncOnly){(c=(l=this.context).onOpenChange)==null||c.call(l,r,a);return}this.dispatchOpenChange(r,a),(f=(u=this.context).onOpenChange)==null||f.call(u,r,a)});this.syncOnly=a}}function o5(e){const{popupStore:t,treatPopupAsFloatingElement:r=!1,floatingRootContext:a,floatingId:l,nested:c,onOpenChange:u}=e,f=t.useState("open"),h=t.useState("activeTriggerElement"),m=t.useState(r?"popupElement":"positionerElement"),x=t.context.triggerElements,p=u,b=g.useRef(null);a===void 0&&b.current===null&&(b.current=new T1({open:f,transitionStatus:void 0,referenceElement:h,floatingElement:m,triggerElements:x,onOpenChange:p,floatingId:l,syncOnly:!0,nested:c}));const v=a??b.current;return t.useSyncedValue("floatingId",l),qe(()=>{const j={open:f,floatingId:l,referenceElement:h,floatingElement:m};Gt(h)&&(j.domReferenceElement=h),v.state.positionReference===v.state.referenceElement&&(j.positionReference=h),v.update(j)},[f,l,h,m,v]),v.context.onOpenChange=p,v.context.nested=c,v}const gf={tabIndex:-1,[By]:""};function a5(e){return t=>t==="touch"?e.current:!0}function E1(e,t=!1){const r=zl(),a=$i()!=null,l=fs(()=>e(r,a)).current;return o5({popupStore:l,treatPopupAsFloatingElement:t,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:a,onOpenChange:l.setOpen}),l}function Sg({handle:e,store:t}){return qe(()=>e.attachStore(t),[e,t]),null}function nk(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function e$(e,t){const r=g.useRef(null);return Ze(a=>{const l=r.current;if(l!==null){if(l.element===a&&l.store===t&&l.id===e)return;r.current=null;const c=l.store;c.context.triggerElements.getById(l.id)===l.element&&(c.context.triggerElements.delete(l.id),nk(c))}a!==null&&e!==void 0&&(r.current={store:t,id:e,element:a},t.context.triggerElements.add(e,a),nk(t))})}function Ng(e,t,r,a=!1){let l=e.preventUnmountingOnClose;t?l=!1:a&&(l=!0);const c=(r==null?void 0:r.id)??null;let u=e.activeTriggerId,f=e.activeTriggerElement;return(c||t)&&(u=c,f=r??null),{open:t,preventUnmountingOnClose:l,activeTriggerId:u,activeTriggerElement:f}}function R1(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function t$(e,t,r,a={}){var x,p,b;const l=r.reason,c=l===Un,u=t&&l===Qc,f=!t&&(l===Jo||l===mf),h=R1(r);if((p=(x=e.context).onOpenChange)==null||p.call(x,t,r),r.isCanceled)return;(b=a.onBeforeDispatch)==null||b.call(a),e.state.floatingRootContext.dispatchOpenChange(t,r);const m=()=>{const v=Ng(e.state,t,r.trigger,h()),j={...a.extraState,...v};u?j.instantType="focus":f?j.instantType="dismiss":c&&(j.instantType=void 0),e.update(j)};c?Xr.flushSync(m):m()}function A1(e,t,r,a){const l=r.useState("isMountedByTrigger",e),c=e$(e,r),u=Ze(h=>{const m=r.select("open"),x=r.select("activeTriggerId");if(x===e){const p={activeTriggerElement:h,...m?a:null};r.update(p);return}if(x==null&&m){const p={activeTriggerId:e??null,activeTriggerElement:h,...a};r.update(p)}}),f=Ze(h=>{c(h),h&&u(h)});return qe(()=>(f(t.current),()=>f(null)),[f,t,r,e]),qe(()=>{if(l){const h={activeTriggerElement:t.current,...a};r.update(h)}},[l,r,t,...Object.values(a)]),{registerTrigger:f,isMountedByThisTrigger:l}}function Cg(e,t={}){const{closeOnActiveTriggerUnmount:r=!1}=t,a=g.useRef(null),l=e.useState("open"),c=e.useState("triggerCount"),u=e.useState("activeTriggerId"),f=e.useState("activeTriggerElement");qe(()=>{if(!l){a.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const h=e.context.triggerElements.size,m={};e.state.triggerCount!==h&&(m.triggerCount=h);const x=e.select("activeTriggerId");let p=null;if(x){const b=e.context.triggerElements.getById(x);if(b)a.current=x,b!==e.state.activeTriggerElement&&(m.activeTriggerElement=b);else{for(const[v,j]of e.context.triggerElements.entries())if(j===e.state.activeTriggerElement){m.activeTriggerId=v,m.activeTriggerElement=j,a.current=v;break}m.activeTriggerId===void 0&&(a.current===x?p=x:a.current=null)}}else a.current=null;if(!p&&!x&&h===1){const b=e.context.triggerElements.entries().next();if(!b.done){const[v,j]=b.value;m.activeTriggerId=v,m.activeTriggerElement=j,a.current=v}}(m.triggerCount!==void 0||m.activeTriggerId!==void 0||m.activeTriggerElement!==void 0)&&e.update(m),p&&r&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===p&&!e.context.triggerElements.getById(p)){const b=bt(Tr);e.setOpen(!1,b),b.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[l,e,c,u,f,r])}function kg(e,t,r,a){const{mounted:l,setMounted:c,transitionStatus:u}=Ga(e,!1,!1,a),f=t.useState("preventUnmountingOnClose"),h=e?!1:f;t.useSyncedValues({mounted:l,transitionStatus:u,preventUnmountingOnClose:h});const m=Ze(()=>{var x,p;c(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),r==null||r(),(p=(x=t.context).onOpenChangeComplete)==null||p.call(x,!1)});return ir({enabled:l&&!e&&!h,open:e,ref:t.context.popupRef,onComplete(){e||m()}}),{forceUnmount:m,transitionStatus:u}}function Tg(e,t){e.useSyncedValues(t),qe(()=>()=>{e.update({activeTriggerProps:gn,inactiveTriggerProps:gn,popupProps:gn})},[e])}function i5(e,t){qe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),qe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class xf{constructor(){this.idMap=new Map}add(t,r){this.idMap.set(t,r)}delete(t){this.idMap.delete(t)}hasElement(t){for(const r of this.idMap.values())if(r===t)return!0;return!1}hasMatchingElement(t){for(const r of this.idMap.values())if(t(r))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Eg(e,t,r=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new T1({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:r,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:gn,inactiveTriggerProps:gn,popupProps:gn}}const Od=e=>e.triggerIdProp??e.activeTriggerId,O1=e=>e.openProp??e.open,sk=e=>{var r;return(((r=e.popupElement)==null?void 0:r.id)??e.floatingId)||void 0};function l5(e,t){return t!==void 0&&O1(e)&&Od(e)===t}function n$(e,t){return l5(e,t)?!0:t!==void 0&&O1(e)&&Od(e)==null&&e.triggerCount===1}const Rg={open:O1,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Od,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:sk,isTriggerActive:(e,t)=>t!==void 0&&Od(e)===t,isOpenedByTrigger:(e,t)=>l5(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Od(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>n$(e,t)?sk(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function M1(e){const t=g.useCallback(a=>e===void 0?Tn:e.subscribeStore(a),[e]),r=g.useCallback(()=>e===void 0?void 0:e.store,[e]);return y1.useSyncExternalStore(t,r,()=>e==null?void 0:e.serverStore)}function s$(e){const{open:t=!1,onOpenChange:r,elements:a={}}=e,l=zl(),c=$i()!=null,u=fs(()=>new T1({open:t,transitionStatus:void 0,onOpenChange:r,referenceElement:a.reference??null,floatingElement:a.floating??null,triggerElements:new xf,floatingId:l,syncOnly:!1,nested:c})).current;return qe(()=>{const f={open:t,floatingId:l};a.reference!==void 0&&(f.referenceElement=a.reference,f.domReferenceElement=Gt(a.reference)?a.reference:null),a.floating!==void 0&&(f.floatingElement=a.floating),u.update(f)},[t,l,a.reference,a.floating,u]),u.context.onOpenChange=r,u.context.nested=c,u}function r$(e){return o$(e,e.rootContext)}function o$(e,t){const{nodeId:r,externalTree:a}=e,l=t.useState("referenceElement"),c=t.useState("floatingElement"),u=t.useState("domReferenceElement"),f=t.useState("open"),h=t.useState("floatingId"),[m,x]=g.useState(null),[p,b]=g.useState(void 0),[v,j]=g.useState(void 0),S=g.useRef(null),N=Vi(a),C=g.useMemo(()=>({reference:l,floating:c,domReference:u}),[l,c,u]),E=YB({...e,elements:{...C,...m&&{reference:m}}}),T=Gt(p)?p:null,O=v===void 0?t.state.floatingElement:v;t.useSyncedValue("referenceElement",p??null),t.useSyncedValue("domReferenceElement",p===void 0?u:T),t.useSyncedValue("floatingElement",O);const k=g.useCallback(L=>{const Y=Gt(L)?{getBoundingClientRect:()=>L.getBoundingClientRect(),getClientRects:()=>L.getClientRects(),contextElement:L}:L;x(Y),E.refs.setReference(Y)},[E.refs]),M=g.useCallback(L=>{(Gt(L)||L===null)&&(S.current=L,b(L)),(Gt(E.refs.reference.current)||E.refs.reference.current===null||L!==null&&!Gt(L))&&E.refs.setReference(L)},[E.refs,b]),A=g.useCallback(L=>{j(L),E.refs.setFloating(L)},[E.refs]),R=g.useMemo(()=>({...E.refs,setReference:M,setFloating:A,setPositionReference:k,domReference:S}),[E.refs,M,A,k]),z=g.useMemo(()=>({...E.elements,domReference:u}),[E.elements,u]),_=g.useMemo(()=>({...E,dataRef:t.context.dataRef,open:f,onOpenChange:t.setOpen,events:t.context.events,floatingId:h,refs:R,elements:z,nodeId:r,rootStore:t}),[E,R,z,r,t,f,h]);return qe(()=>{u&&(S.current=u)},[u]),qe(()=>{t.context.dataRef.current.floatingContext=_;const L=N==null?void 0:N.nodesRef.current.find(Y=>Y.id===r);L&&(L.context=_)}),g.useMemo(()=>({...E,context:_,refs:R,elements:z,rootStore:t}),[E,R,z,_,t])}const H0=a1&&Ha;function c5(e,t={}){const{enabled:r=!0,delay:a}=t,l="rootStore"in e?e.rootStore:e,{events:c,dataRef:u}=l.context,f=g.useRef(!1),h=g.useRef(null),m=g.useRef(!0),x=es();g.useEffect(()=>{const b=l.select("domReferenceElement");if(!r)return;const v=xn(b);function j(){const C=l.select("domReferenceElement");!l.select("open")&&un(C)&&C===_s(Ft(C))&&(f.current=!0,h.current=C)}function S(){m.current=!0}function N(){m.current=!1}return Xo(Lt(v,"blur",j),H0&&Lt(v,"keydown",S,!0),H0&&Lt(v,"pointerdown",N,!0))},[l,r]),g.useEffect(()=>{if(!r)return;function b(v){if(v.reason===Jo||v.reason===mf){const j=l.select("domReferenceElement");Gt(j)&&(h.current=j,f.current=!0)}}return c.on("openchange",b),()=>{c.off("openchange",b)}},[c,r,l]);const p=g.useMemo(()=>{function b(){f.current=!1,h.current=null}return{onMouseLeave(){b()},onFocus(v){const j=v.currentTarget;if(f.current){if(h.current===j)return;b()}const S=Ds(v.nativeEvent);if(Gt(S)){if(H0&&!v.relatedTarget){if(!m.current&&!fg(S))return}else if(!SL(S))return}const N=gp(v.relatedTarget,l.context.triggerElements),{nativeEvent:C,currentTarget:E}=v,T=typeof a=="function"?a():a;if(l.select("open")&&N||T===0||T===void 0){l.setOpen(!0,bt(Qc,C,E));return}x.start(T,()=>{f.current||l.setOpen(!0,bt(Qc,C,E))})},onBlur(v){b();const j=v.relatedTarget,S=v.nativeEvent,N=Gt(j)&&j.hasAttribute(Fd("focus-guard"))&&j.getAttribute("data-type")==="outside";x.start(0,()=>{var O;const C=l.select("domReferenceElement"),E=_s(Ft(C));!j&&E===C||pt((O=u.current.floatingContext)==null?void 0:O.refs.floating.current,E)||pt(C,E)||N||gp(j??E,l.context.triggerElements)||l.setOpen(!1,bt(Qc,S))})}}},[u,a,l,x]);return g.useMemo(()=>r?{reference:p,trigger:p}:{},[r,p])}class D1{constructor(){tn(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});tn(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Kr,this.restTimeout=new Kr,this.handleCloseOptions=void 0}static create(){return new D1}}const jp=new WeakMap;function Sp(e){var r,a,l;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&jp.get(t)===e&&((r=e.pointerEventsScopeElement)==null||r.style.removeProperty("pointer-events"),(a=e.pointerEventsReferenceElement)==null||a.style.removeProperty("pointer-events"),(l=e.pointerEventsFloatingElement)==null||l.style.removeProperty("pointer-events"),jp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function u5(e,t){const{scopeElement:r,referenceElement:a,floatingElement:l}=t,c=jp.get(r);c&&c!==e&&Sp(c),Sp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=r,e.pointerEventsReferenceElement=a,e.pointerEventsFloatingElement=l,jp.set(r,e),r.style.pointerEvents="none",a.style.pointerEvents="auto",l.style.pointerEvents="auto"}function z1(e){const t=e.context.dataRef.current,r=fs(()=>t.hoverInteractionState??D1.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=r),x1(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function P1(e,t={}){const{enabled:r=!0,closeDelay:a=0,nodeId:l}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),f=c.useState("floatingElement"),h=c.useState("domReferenceElement"),{dataRef:m}=c.context,x=Vi(),p=$i(),b=z1(c),v=es(),j=Ze(()=>{var C;return _A((C=m.current.openEvent)==null?void 0:C.type,b.interactedInside)}),S=Ze(()=>{var C;return J8((C=m.current.openEvent)==null?void 0:C.type)}),N=Ze(()=>{Sp(b)});qe(()=>{u||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,N())},[u,b,N]),g.useEffect(()=>N,[N]),qe(()=>{var C,E,T,O,k;if(r&&u&&(C=b.handleCloseOptions)!=null&&C.blockPointerEvents&&S()&&Gt(h)&&f){const M=h,A=f,R=Ft(f),z=(T=(E=x==null?void 0:x.nodesRef.current.find(P=>P.id===p))==null?void 0:E.context)==null?void 0:T.elements.floating;z&&(z.style.pointerEvents="");const _=b.pointerEventsScopeElement!==A?b.pointerEventsScopeElement:null,L=z!==A?z:null,Y=((k=(O=b.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??_??L??M.closest("[data-rootownerid]")??R.body;return u5(b,{scopeElement:Y,referenceElement:M,floatingElement:A}),()=>{N()}}},[r,u,h,f,b,S,x,p,N]),g.useEffect(()=>{if(!r)return;function C(){return!!(x&&p&&Di(x.nodesRef.current,p).length>0)}function E(R){const z=Il(a,"close",b.pointerType),_=()=>{c.setOpen(!1,bt(Un,R)),x==null||x.events.emit("floating.closed",R)};z?b.openChangeTimeout.start(z,_):(b.openChangeTimeout.clear(),_())}function T(R){const z=Ds(R);if(!jL(z)){b.interactedInside=!1;return}b.interactedInside=(z==null?void 0:z.closest("[aria-haspopup]"))!=null}function O(){b.openChangeTimeout.clear(),v.clear(),x==null||x.events.off("floating.closed",M),N()}function k(R){var Y;if(C()&&x){x.events.on("floating.closed",M);return}if(gp(R.relatedTarget,c.context.triggerElements))return;const z=((Y=m.current.floatingContext)==null?void 0:Y.nodeId)??l,_=R.relatedTarget;if(!(x&&z&&Gt(_)&&Di(x.nodesRef.current,z,!1).some(P=>{var V;return pt((V=P.context)==null?void 0:V.elements.floating,_)}))){if(b.handler){b.handler(R);return}N(),S()&&!j()&&E(R)}}function M(R){!x||!p||C()||v.start(0,()=>{x.events.off("floating.closed",M),c.setOpen(!1,bt(Un,R)),x.events.emit("floating.closed",R)})}const A=f;return Xo(A&&Lt(A,"mouseenter",O),A&&Lt(A,"mouseleave",k),A&&Lt(A,"pointerdown",T,!0),()=>{x==null||x.events.off("floating.closed",M)})},[r,f,c,m,a,l,S,j,N,b,x,p,v])}const a$={current:null};function I1(e,t={}){const{enabled:r=!0,delay:a=0,handleClose:l=null,mouseOnly:c=!1,restMs:u=0,move:f=!0,triggerElementRef:h=a$,externalTree:m,isActiveTrigger:x=!0,getHandleCloseContext:p,isClosing:b,shouldOpen:v,guardStaleOpen:j=!1}=t,S="rootStore"in e?e.rootStore:e,{dataRef:N,events:C}=S.context,E=Vi(m),T=z1(S),O=g.useRef(!1),k=In(l),M=In(a),A=In(u),R=In(r),z=In(v),_=In(b),L=Ze(()=>{var H;return _A((H=N.current.openEvent)==null?void 0:H.type,T.interactedInside)}),Y=Ze(()=>{var H;return((H=z.current)==null?void 0:H.call(z))!==!1}),P=Ze((H,F,q)=>{const W=S.context.triggerElements;if(W.hasElement(F))return!H||!pt(H,F);if(!Gt(q))return!1;const B=q;return W.hasMatchingElement(J=>pt(J,B))&&(!H||!pt(H,B))}),V=Ze(()=>{if(!T.handler)return;Ft(S.select("domReferenceElement")).removeEventListener("mousemove",T.handler),T.handler=void 0}),U=Ze(()=>{Sp(T)});return x&&(T.handleCloseOptions=l==null?void 0:l.__options),g.useEffect(()=>V,[V]),g.useEffect(()=>{if(!r)return;function H(F){F.open?O.current=!1:(O.current=F.reason===Un,V(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return C.on("openchange",H),()=>{C.off("openchange",H)}},[r,C,T,V]),g.useEffect(()=>{if(!r)return;function H(X,re=!0){const I=Il(M.current,"close",T.pointerType);I?T.openChangeTimeout.start(I,()=>{S.setOpen(!1,bt(Un,X)),E==null||E.events.emit("floating.closed",X)}):re&&(T.openChangeTimeout.clear(),S.setOpen(!1,bt(Un,X)),E==null||E.events.emit("floating.closed",X))}const F=h.current??(x?S.select("domReferenceElement"):null);if(!Gt(F))return;function q(X){var je;if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,c&&!Ei(T.pointerType))return;const re=$C(A.current),I=Il(M.current,"open",T.pointerType),$=Ds(X),Q=X.currentTarget??null,G=S.select("domReferenceElement");let se=Q;if(Gt($)&&!S.context.triggerElements.hasElement($)){for(const Ae of S.context.triggerElements.elements())if(pt(Ae,$)){se=Ae;break}}Gt(Q)&&Gt(G)&&!S.context.triggerElements.hasElement(Q)&&pt(Q,G)&&(se=G);const ee=se==null?!1:P(G,se,$),ne=S.select("open"),ie=((je=_.current)==null?void 0:je.call(_))??S.select("transitionStatus")==="ending",oe=!ne&&ie&&O.current,Z=!ee&&Gt(se)&&Gt(G)&&pt(G,se)&&oe,de=re>0&&!I,ke=ee&&(ne||oe)||Z,_e=!ne||ee;if(ke){Y()&&S.setOpen(!0,bt(Un,X,se));return}de||(I?T.openChangeTimeout.start(I,()=>{_e&&Y()&&S.setOpen(!0,bt(Un,X,se))}):_e&&Y()&&S.setOpen(!0,bt(Un,X,se)))}function W(X){if(L()){U();return}V();const re=S.select("domReferenceElement"),I=Ft(re);T.restTimeout.clear(),T.restTimeoutPending=!1;const $=N.current.floatingContext??(p==null?void 0:p());if(gp(X.relatedTarget,S.context.triggerElements))return;if(k.current&&$){S.select("open")||T.openChangeTimeout.clear();const G=h.current;T.handler=k.current({...$,tree:E,x:X.clientX,y:X.clientY,onClose(){U(),V(),R.current&&!L()&&G===S.select("domReferenceElement")&&H(X,!0)}}),I.addEventListener("mousemove",T.handler),T.handler(X);return}(T.pointerType==="touch"?!pt(S.select("floatingElement"),X.relatedTarget):!0)&&H(X)}function B(X){pt(F,X.relatedTarget)||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1)}const J=j?Lt(F,"mouseout",B):void 0;return f?Xo(Lt(F,"mousemove",q,{once:!0}),Lt(F,"mouseenter",q),Lt(F,"mouseleave",W),J):Xo(Lt(F,"mouseenter",q),Lt(F,"mouseleave",W),J)},[V,U,N,M,S,r,k,T,x,P,L,c,f,A,h,E,R,p,_,Y,j]),g.useMemo(()=>{if(!r)return;function H(F){T.pointerType=F.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(F){var $,Q,G;const{nativeEvent:q}=F,W=F.currentTarget,B=S.select("domReferenceElement"),J=S.select("open"),X=P(B,W,F.target);if(c&&!Ei(T.pointerType))return;if(J&&X&&(($=T.handleCloseOptions)!=null&&$.blockPointerEvents)){const se=S.select("floatingElement");if(se){const ee=((G=(Q=T.handleCloseOptions)==null?void 0:Q.getScope)==null?void 0:G.call(Q))??W.ownerDocument.body;u5(T,{scopeElement:ee,referenceElement:W,floatingElement:se})}}const re=$C(A.current);if(J&&!X||re===0||!X&&T.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;T.restTimeout.clear();function I(){if(T.restTimeoutPending=!1,L())return;const se=S.select("open");!T.blockMouseMove&&(!se||X)&&Y()&&S.setOpen(!0,bt(Un,q,W))}T.pointerType==="touch"?Xr.flushSync(()=>{I()}):X&&J?I():(T.restTimeoutPending=!0,T.restTimeout.start(re,I))}}},[r,T,L,P,c,S,A,Y])}const i$="Escape";function rk(e){return Ha&&e.movementX===0&&e.movementY===0}function Ag(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function ih(e,t){return Ag(t,e===uA||e===l1,e===cg||e===ug)}function F0(e,t,r){return Ag(t,e===l1,r?e===cg:e===ug)||e==="Enter"||e===" "||e===""}function l$(e,t,r){return Ag(t,r?e===cg:e===ug,e===l1)}function c$(e,t,r,a){const l=r?e===ug:e===cg,c=e===uA;return t==="both"||t==="horizontal"&&a?e===i$:Ag(t,l,c)}function d5(e,t){const{listRef:r,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:f=!1,loopFocus:h=!1,nested:m=!1,rtl:x=!1,virtual:p=!1,focusItemOnOpen:b="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:j=!0,disabledIndices:S=void 0,orientation:N="vertical",parentOrientation:C,id:E,resetOnPointerLeave:T=!0,externalTree:O,grid:k}=t,M=k!=null,A="rootStore"in e?e.rootStore:e,R=A.useState("open"),z=A.useState("floatingElement"),_=A.useState("domReferenceElement"),L=A.context.dataRef,Y=xp(z),P=Vy(_),V=In(Y),U=$i(),H=Vi(O),F=g.useRef(b),q=g.useRef(u??-1),W=g.useRef(null),B=g.useRef(!0),J=Ze(Se=>{l(q.current===-1?null:q.current,Se)}),X=g.useRef(!!z),re=g.useRef(R),I=g.useRef(!1),$=g.useRef(!1),Q=g.useRef(null),G=In(S),se=In(R),ee=In(u),ne=In(T),ie=lu(),oe=lu(),Z=Ze(()=>{function Se(pe){p?H==null||H.events.emit("virtualfocus",pe):Q.current=Bh(pe,{sync:I.current,preventScroll:!0})}const Fe=r.current[q.current],Re=$.current;Fe&&Se(Fe),(I.current?pe=>pe():pe=>ie.request(pe))(()=>{var Je;const pe=r.current[q.current]||Fe;if(!pe)return;Fe||Se(pe),te&&(Re||!B.current)&&((Je=pe.scrollIntoView)==null||Je.call(pe,{block:"nearest",inline:"nearest"}))})});qe(()=>{L.current.orientation=N},[L,N]),qe(()=>{c&&(R&&z?(q.current=u??-1,F.current&&u!=null&&($.current=!0,J())):X.current&&(q.current=-1,J()))},[c,R,z,u,J]),qe(()=>{if(c){if(!R){I.current=!1;return}if(z)if(a==null){if(I.current=!1,ee.current!=null)return;if(X.current&&(q.current=-1,Z()),(!re.current||!X.current)&&F.current&&(W.current!=null||F.current===!0&&W.current==null)){let Se=0;const Fe=()=>{r.current[0]==null?(Se<2&&(Se?ve=>oe.request(ve):queueMicrotask)(Fe),Se+=1):(q.current=W.current==null||F0(W.current,N,x)||m?Lh(r):Hy(r),W.current=null,J())};Fe()}}else Ad(r.current,a)||(q.current=a,Z(),$.current=!1)}},[c,R,z,a,ee,m,r,N,x,J,Z,oe]),qe(()=>{var pe,$e;if(!c||z||!H||p||!X.current)return;const Se=H.nodesRef.current,Fe=($e=(pe=Se.find(Je=>Je.id===U))==null?void 0:pe.context)==null?void 0:$e.elements.floating,Re=_s(Ft(_??Fe??null)),ve=Se.some(Je=>Je.context&&pt(Je.context.elements.floating,Re));Fe&&!ve&&B.current&&Fe.focus({preventScroll:!0})},[c,z,_,H,U,p]),qe(()=>{re.current=R,X.current=!!z}),qe(()=>{R||(W.current=null,F.current=b)},[R,b]);const de=a!=null,ke=Ze(Se=>{if(!se.current)return;const Fe=r.current.indexOf(Se.currentTarget);Fe!==-1&&(q.current!==Fe||a!==Fe)&&(q.current=Fe,J(Se))}),_e=Ze(()=>{var Se,Fe,Re;return C??((Re=(Fe=(Se=H==null?void 0:H.nodesRef.current.find(ve=>ve.id===U))==null?void 0:Se.context)==null?void 0:Fe.dataRef)==null?void 0:Re.current.orientation)}),je=Ze(()=>Lh(r,G.current)),Ae=Ze(Se=>{if(B.current=!1,I.current=!0,Se.which===229||!se.current&&Se.currentTarget===V.current)return;if(m&&c$(Se.key,N,x,M)){ih(Se.key,_e())||qo(Se),A.setOpen(!1,bt(Gy,Se.nativeEvent)),un(_)&&(p?H==null||H.events.emit("virtualfocus",_):_.focus());return}const Fe=q.current,Re=Lh(r,S),ve=Hy(r,S);if(P||(Se.key==="Home"&&(qo(Se),q.current=Re,J(Se)),Se.key==="End"&&(qo(Se),q.current=ve,J(Se))),k!=null){const pe=k(Se,q.current,r,N,h,x,S,Re,ve);if(pe!=null&&(q.current=pe,J(Se)),N==="both")return}if(ih(Se.key,N)){if(qo(Se),R&&!p&&_s(Se.currentTarget.ownerDocument)===Se.currentTarget){q.current=F0(Se.key,N,x)?Re:ve,J(Se);return}F0(Se.key,N,x)?h?Fe>=ve?f&&Fe!==r.current.length?q.current=-1:(I.current=!1,q.current=Re):q.current=Ca(r.current,{startingIndex:Fe,disabledIndices:S}):q.current=Math.min(ve,Ca(r.current,{startingIndex:Fe,disabledIndices:S})):h?Fe<=Re?f&&Fe!==-1?q.current=r.current.length:(I.current=!1,q.current=ve):q.current=Ca(r.current,{startingIndex:Fe,decrement:!0,disabledIndices:S}):q.current=Math.max(Re,Ca(r.current,{startingIndex:Fe,decrement:!0,disabledIndices:S})),Ad(r.current,q.current)&&(q.current=-1),J(Se)}}),te=g.useMemo(()=>({onFocus(Fe){I.current=!0,ke(Fe)},onClick:({currentTarget:Fe})=>Fe.focus({preventScroll:!0}),onMouseMove(Fe){rk(Fe)||(I.current=!0,$.current=!1,v&&ke(Fe))},onPointerLeave(Fe){var ve;if(!se.current||!B.current||Fe.pointerType==="touch")return;I.current=!0;const Re=Fe.relatedTarget;if(!(!v||r.current.includes(Re))&&ne.current&&((ve=Q.current)==null||ve.call(Q),Q.current=null,q.current=-1,J(Fe),!p)){const pe=V.current,$e=_s(Ft(pe));pe&&pt(pe,$e)&&pe.focus({preventScroll:!0})}}}),[ke,se,V,v,r,J,ne,p]),Ee=g.useMemo(()=>p&&R&&de&&{"aria-activedescendant":`${E}-${a}`},[p,R,de,E,a]),Te=g.useMemo(()=>({...P?{}:Ee,onKeyDown(Se){if(Se.key==="Tab"&&Se.shiftKey&&R&&!p){const Fe=Ds(Se.nativeEvent);if(Fe&&!pt(V.current,Fe))return;qo(Se),A.setOpen(!1,bt(Pi,Se.nativeEvent)),un(_)&&_.focus();return}Ae(Se)},onPointerMove(Se){rk(Se)||(B.current=!0)}}),[Ee,Ae,V,P,A,R,p,_]),be=g.useMemo(()=>{function Se(ve){A.setOpen(!0,bt(Gy,ve.nativeEvent,ve.currentTarget))}function Fe(ve){b==="auto"&&mg(ve.nativeEvent)&&(F.current=!p)}function Re(ve){F.current=b,b==="auto"&&d1(ve.nativeEvent)&&(F.current=!0)}return{onKeyDown(ve){const pe=A.select("open");B.current=!1;const $e=ve.key.startsWith("Arrow"),Je=l$(ve.key,_e(),x),mt=ih(ve.key,N),ot=(m?Je:mt)||ve.key==="Enter"||ve.key.trim()==="";if(p&&pe)return Ae(ve);if(!(!pe&&!j&&$e)){if(ot){const Ie=ih(ve.key,_e());W.current=m&&Ie?null:ve.key}if(m){Je&&(qo(ve),pe?(q.current=je(),J(ve)):Se(ve));return}mt&&(ee.current!=null&&(q.current=ee.current),qo(ve),!pe&&j?Se(ve):Ae(ve),pe&&J(ve))}},onFocus(ve){A.select("open")&&!p&&(q.current=-1,J(ve))},onPointerDown:Re,onPointerEnter:Re,onMouseDown:Fe,onClick:Fe}},[Ae,b,je,m,J,A,j,N,_e,x,ee,p]),We=g.useMemo(()=>({...Ee,...be}),[Ee,be]);return g.useMemo(()=>c?{reference:We,floating:Te,item:te,trigger:be}:{},[c,We,Te,be,te])}function f5(e,t){const{listRef:r,elementsRef:a,activeIndex:l,onMatch:c,disabledIndices:u,onTyping:f,enabled:h=!0,resetMs:m=750,selectedIndex:x=null}=t,p="rootStore"in e?e.rootStore:e,b=p.useState("open"),v=es(),j=g.useRef(""),S=g.useRef(x??l??-1),N=g.useRef(null),C=Ze(O=>{function k(V){return a==null?void 0:a.current[V]}function M(V){const U=k(V);return U&&!hg(U)||U!=null&&U.matches(":disabled")?!1:u==null||!Xc(kr,V,u)}function A(V,U,H=0){if(V.length===0)return-1;const F=(H%V.length+V.length)%V.length,q=U.toLowerCase();for(let W=0;W<V.length;W+=1){const B=(F+W)%V.length,J=V[B];if(!(!(J!=null&&J.toLowerCase().startsWith(q))||!M(B)))return B}return-1}const R=r.current;if(j.current.length>0&&O.key===" "&&(qo(O),f==null||f(!0)),j.current.length>0&&j.current[0]!==" "&&A(R,j.current)===-1&&O.key!==" "&&(f==null||f(!1)),R==null||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;b&&O.key!==" "&&(qo(O),f==null||f(!0));const z=j.current==="";z&&(S.current=x??l??-1),R.every((V,U)=>{var H,F;return V&&M(U)?((H=V[0])==null?void 0:H.toLowerCase())!==((F=V[1])==null?void 0:F.toLowerCase()):!0})&&j.current===O.key&&(j.current="",S.current=N.current),j.current+=O.key,v.start(m,()=>{j.current="",S.current=N.current,f==null||f(!1)});const Y=((z?x??l??-1:S.current)??0)+1,P=A(R,j.current,Y);P!==-1?(c==null||c(P),N.current=P):O.key!==" "&&(j.current="",f==null||f(!1))}),E=Ze(O=>{const k=O.relatedTarget,M=p.select("domReferenceElement"),A=p.select("floatingElement");pt(M,k)||pt(A,k)||(v.clear(),j.current="",S.current=N.current,f==null||f(!1))});qe(()=>{!b&&x!==null||(v.clear(),N.current=null,j.current!==""&&(j.current=""))},[b,x,v]);const T=g.useMemo(()=>({onKeyDown:C,onBlur:E}),[C,E]);return g.useMemo(()=>h?{reference:T,floating:T}:{},[h,T])}const ok=.1,u$=ok*ok,hn=.5;function lh(e,t,r,a,l,c){return a>=t!=c>=t&&e<=(l-r)*(t-a)/(c-a)+r}function ch(e,t,r,a,l,c,u,f,h,m){let x=!1;return lh(e,t,r,a,l,c)&&(x=!x),lh(e,t,l,c,u,f)&&(x=!x),lh(e,t,u,f,h,m)&&(x=!x),lh(e,t,h,m,r,a)&&(x=!x),x}function d$(e,t,r){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}function uh(e,t,r,a,l,c){const u=Math.min(r,l),f=Math.max(r,l),h=Math.min(a,c),m=Math.max(a,c);return e>=u&&e<=f&&t>=h&&t<=m}function _1(e={}){const{blockPointerEvents:t=!1}=e,r=new Kr,a=({x:l,y:c,placement:u,elements:f,onClose:h,nodeId:m,tree:x})=>{const p=u==null?void 0:u.split("-")[0];let b=!1,v=null,j=null,S=typeof performance<"u"?performance.now():0;function N(E,T){const O=performance.now(),k=O-S;if(v===null||j===null||k===0)return v=E,j=T,S=O,!1;const M=E-v,A=T-j,R=M*M+A*A,z=k*k*u$;return v=E,j=T,S=O,R<z}function C(){r.clear(),h()}return function(T){r.clear();const O=f.domReference,k=f.floating;if(!O||!k||p==null||l==null||c==null)return;const{clientX:M,clientY:A}=T,R=Ds(T),z=T.type==="mouseleave",_=pt(k,R),L=pt(O,R);if(_&&(b=!0,!z))return;if(L&&(b=!1,!z)){b=!0;return}if(z&&Gt(T.relatedTarget)&&pt(k,T.relatedTarget))return;function Y(){return!!(x&&Di(x.nodesRef.current,m).length>0)}function P(){Y()||C()}if(Y())return;const V=O.getBoundingClientRect(),U=k.getBoundingClientRect(),H=l>U.right-U.width/2,F=c>U.bottom-U.height/2,q=U.width>V.width,W=U.height>V.height,B=(q?V:U).left,J=(q?V:U).right,X=(W?V:U).top,re=(W?V:U).bottom;if(p==="top"&&c>=V.bottom-1||p==="bottom"&&c<=V.top+1||p==="left"&&l>=V.right-1||p==="right"&&l<=V.left+1){P();return}let I=!1;switch(p){case"top":I=uh(M,A,B,V.top+1,J,U.bottom-1);break;case"bottom":I=uh(M,A,B,U.top+1,J,V.bottom-1);break;case"left":I=uh(M,A,U.right-1,re,V.left+1,X);break;case"right":I=uh(M,A,V.right-1,re,U.left+1,X);break}if(I)return;if(b&&!d$(M,A,V)){P();return}if(!z&&N(M,A)){P();return}let $=!1;switch(p){case"top":{const Q=q?hn/2:hn*4,G=q||H?l+Q:l-Q,se=q?l-Q:H?l+Q:l-Q,ee=c+hn+1,ne=H||q?U.bottom-hn:U.top,ie=H?q?U.bottom-hn:U.top:U.bottom-hn;$=ch(M,A,G,ee,se,ee,U.left,ne,U.right,ie);break}case"bottom":{const Q=q?hn/2:hn*4,G=q||H?l+Q:l-Q,se=q?l-Q:H?l+Q:l-Q,ee=c-hn,ne=H||q?U.top+hn:U.bottom,ie=H?q?U.top+hn:U.bottom:U.top+hn;$=ch(M,A,G,ee,se,ee,U.left,ne,U.right,ie);break}case"left":{const Q=W?hn/2:hn*4,G=W||F?c+Q:c-Q,se=W?c-Q:F?c+Q:c-Q,ee=l+hn+1,ne=F||W?U.right-hn:U.left,ie=F?W?U.right-hn:U.left:U.right-hn;$=ch(M,A,ne,U.top,ie,U.bottom,ee,G,ee,se);break}case"right":{const Q=W?hn/2:hn*4,G=W||F?c+Q:c-Q,se=W?c-Q:F?c+Q:c-Q,ee=l-hn,ne=F||W?U.left+hn:U.right,ie=F?W?U.left+hn:U.right:U.left+hn;$=ch(M,A,ee,G,ee,se,ne,U.top,ie,U.bottom);break}}$?b||r.start(40,P):P()}};return a.__options={...e,blockPointerEvents:t},a}const m5=g.createContext(void 0),h5=g.createContext(void 0),p5=g.createContext(void 0);function sa(){const e=g.useContext(m5);if(e===void 0)throw new Error(Zt(60));return e}function Og(){const e=g.useContext(h5);if(e===void 0)throw new Error(Zt(101));return e}function g5(){const e=g.useContext(p5);if(e===void 0)throw new Error(Zt(61));return e}function f$(e,t,r=Object.is){const{length:a}=e;if(a!==t.length)return!1;for(let l=0;l<a;l+=1)if(!r(e[l],t[l]))return!1;return!0}const x5=(e,t)=>Object.is(e,t);function Ll(e,t,r){return e==null||t==null?Object.is(e,t):r(e,t)}function m$(e,t,r){return Array.isArray(e)&&Array.isArray(t)?!f$(e,t,(a,l)=>Ll(a,l,r)):e!==t}function Qy(e,t,r){return e?e.some(a=>a===void 0?!1:Ll(t,a,r)):!1}function Vh(e,t,r){return e?e.findIndex(a=>a===void 0?!1:Ll(a,t,r)):-1}function h$(e,t){if(t!==x5)return a=>Qy(e,a,t);const r=new Set(e);return r.delete(void 0),a=>r.has(a)&&(a!==0||e.some(l=>Object.is(a,l)))}function b5(e,t,r,a){const l=a&&Array.isArray(t)?e.findIndex(h$(t,r)):Vh(e,t,r);return l===-1?null:l}function p$(e,t,r,a,l,c){return Qy(a,t,l)?c!=null&&e>c&&Qy(a,r[c],l)?c:e:e===c?b5(r,a,l,!0):c}function g$(e,t,r){return e.filter(a=>!Ll(t,a,r))}function Zy(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function x$(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function y5(e){return x$(e==null?void 0:e[0])}function b$(e){return y5(e)?e.flatMap(t=>t.items):e}function y$(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(y5(t)){for(const r of t)for(const a of r.items)if(a&&a.value==null&&a.label!=null)return!0;return!1}for(const r of t)if(r&&r.value==null&&r.label!=null)return!0;return!1}function v5(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Zy(e)}function Vc(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Zy(e.value):Zy(e)}function w5(e,t,r){function a(){return v5(e,r)}if(r&&e!=null)return r(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??a();if(Array.isArray(t)){const c=b$(t);if(e==null||typeof e!="object"){const u=c.find(f=>f.value===e);return u&&u.label!=null?u.label:a()}if("value"in e){const u=c.find(f=>f&&f.value===e.value);if(u&&u.label!=null)return u.label}}return a()}function v$(e,t,r){return e.reduce((a,l,c)=>(c>0&&a.push(", "),a.push(s.jsx(g.Fragment,{children:w5(l,t,r)},c)),a),[])}const w$={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:r,itemToStringValue:a}=e;return t==null?!1:r&&Array.isArray(t)?t.length>0:Vc(t,a)!==""},hasNullItemLabel:(e,t)=>t?y$(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const r=e.isItemEqualToValue,a=e.value;return e.multiple?Array.isArray(a)&&a.some(l=>Ll(t,l,r)):Ll(t,a,r)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function j$(e){const t=g.useRef(""),r=g.useCallback(l=>{l.defaultPrevented||(t.current=l.pointerType,e(l,l.pointerType))},[e]);return{onClick:g.useCallback(l=>{if(l.detail===0){e(l,"keyboard");return}"pointerType"in l?e(l,l.pointerType):e(l,t.current),t.current=""},[e]),onPointerDown:r}}function j5(e,t){const r=Ze((c,u)=>{(typeof e=="function"?e():e)||t(u||(lg?"touch":""))}),{onClick:a,onPointerDown:l}=j$(r);return g.useMemo(()=>({onClick:a,onPointerDown:l}),[a,l])}function S5(e){const[t,r]=g.useState(null),a=j5(e,r);return ff(e,l=>{l&&!e&&r(null)}),g.useMemo(()=>({openMethod:t,triggerProps:a}),[t,a])}function Cd(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}const bo=1;function L1(e,t){return Math.max(0,e-t)}function Np(e,t){if(t<=0)return 0;const r=Cd(e,0,t),a=r,l=t-r,c=a<=bo,u=l<=bo;return c&&u?a<=l?0:t:c?0:u?t:r}function S$(e){const{id:t,value:r,defaultValue:a=null,onValueChange:l,open:c,defaultOpen:u=!1,onOpenChange:f,name:h,form:m,autoComplete:x,disabled:p=!1,readOnly:b=!1,required:v=!1,modal:j=!0,actionsRef:S,inputRef:N,onOpenChangeComplete:C,items:E,multiple:T=!1,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:M=x5,highlightItemOnHover:A=!0,children:R}=e,{clearErrors:z}=ag(),{setDirty:_,setTouched:L,setFocused:Y,validityData:P,setFilled:V,name:U,disabled:H,validation:F,validationMode:q}=gu(),W=lf({id:t}),B=H||p,J=U??h,[X,re]=Wr({controlled:r,default:T?a??kr:a,name:"Select",state:"value"}),[I,$]=Wr({controlled:c,default:u,name:"Select",state:"open"}),Q=g.useRef([]),G=g.useRef([]),se=g.useRef(null),ee=g.useRef(null),ne=g.useRef(0),ie=g.useRef(null),oe=g.useRef([]),Z=g.useRef(!1),de=g.useRef(null),ke=g.useRef(null),_e=g.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),je=g.useRef(!1),Ae=g.useRef(X),{mounted:te,setMounted:Ee,transitionStatus:Te}=Ga(I),{openMethod:be,triggerProps:We}=S5(I),Se=fs(()=>new bu({id:W,labelId:void 0,modal:j,multiple:T,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:M,value:X,open:I,mounted:te,transitionStatus:Te,items:E,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:gn,triggerProps:gn,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:Tn,setOpen:Tn,handleScrollArrowVisibility:Tn,onOpenChangeComplete:Tn,listRef:Q,popupRef:se,scrollHandlerRef:ee,scrollArrowsMountedCountRef:ne,valueRef:ie,valuesRef:oe,labelsRef:G,typingRef:Z,selectionRef:_e,firstItemTextRef:de,selectedItemTextRef:ke,alignItemWithTriggerActiveRef:je,initialValueRef:Ae},w$)).current,Fe=Se.useState("activeIndex"),Re=Se.useState("selectedIndex"),ve=Se.useState("triggerElement"),pe=Se.useState("positionerElement"),$e=_8(be),Je=be??$e,mt=g.useMemo(()=>T?"":Vc(X,k),[T,X,k]),ot=g.useMemo(()=>T&&Array.isArray(X)?X.map(ct=>Vc(ct,k)):Vc(X,k),[T,X,k]),Ie=In(ve),at=Ze(()=>ot);pg(Ie,W,X,at,!B,h);const Xe=T?Array.isArray(X)&&X.length>0:X!=null&&mt!=="";qe(()=>{V(Xe)},[Xe,V]),qe(function(){const jt=b5(oe.current,X,M,T);jt===null&&(ke.current=null),!I&&Se.set("selectedIndex",jt)},[T,I,X,M,Se]),ff(X,()=>{z(J),_(m$(X,P.initialValue,M)),F.change(X)});const me=Ze((ct,jt)=>{f==null||f(ct,jt),!jt.isCanceled&&($(ct),!ct&&(jt.reason===Pi||jt.reason===gg)&&(L(!0),Y(!1),q==="onBlur"&&F.commit(X)))}),Me=Ze(()=>{Ee(!1),Se.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C==null||C(!1)});ir({enabled:!S,open:I,ref:se,onComplete(){I||Me()}}),g.useImperativeHandle(S,()=>({unmount:Me}),[Me]);const Oe=Ze((ct,jt)=>{l==null||l(ct,jt),!jt.isCanceled&&re(ct)}),tt=Ze(ct=>{const jt=L1(ct.scrollHeight,ct.clientHeight),ae=Np(ct.scrollTop,jt),Ke=ae>0,ut=ae<jt;Se.set("scrollUpArrowVisible",Ke),Se.set("scrollDownArrowVisible",ut)}),Ue=s$({open:I,onOpenChange:me,elements:{reference:ve,floating:pe}}),Ge=C1(Ue,{enabled:!B,event:"mousedown"}),ht=pf(Ue),yt=d5(Ue,{enabled:!B,listRef:Q,activeIndex:Fe,selectedIndex:Re,disabledIndices:kr,onNavigate(ct){ct===null&&!I||Se.set("activeIndex",ct)},focusItemOnHover:A}),ue=f5(Ue,{enabled:!B&&(I||!b&&!T),listRef:G,activeIndex:Fe,selectedIndex:Re,disabledIndices:ct=>zA(Q.current[ct]),onMatch(ct){I?Se.set("activeIndex",ct):Oe(oe.current[ct],bt(Tr))},onTyping(ct){Z.current=ct}}),Ye=g.useMemo(()=>Ys(ue.reference,yt.reference,ht.reference,Ge.reference,We),[Ge.reference,ue.reference,yt.reference,ht.reference,We]),Pe=g.useMemo(()=>Ys(gf,ue.floating,yt.floating,ht.floating),[ue.floating,yt.floating,ht.floating]),st=yt.item??gn;Se.useContextCallback("setValue",Oe),Se.useContextCallback("setOpen",me),Se.useContextCallback("handleScrollArrowVisibility",tt),Se.useContextCallback("onOpenChangeComplete",C),I8(()=>{Se.update({popupProps:Pe,triggerProps:Ye})}),Se.useSyncedValues({id:W,modal:j,multiple:T,value:X,open:I,mounted:te,transitionStatus:Te,popupProps:Pe,triggerProps:Ye,items:E,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:M,openMethod:Je});const vt=g.useMemo(()=>({disabled:B,readOnly:b,required:v,multiple:T,highlightItemOnHover:A,itemProps:st}),[B,b,v,T,A,st]),wt=Yr(N,F.inputRef),Ht=T?void 0:J,kt=g.useMemo(()=>!T||!Array.isArray(X)||!J?null:X.map(ct=>{const jt=Vc(ct,k);return s.jsx("input",{type:"hidden",form:m,name:J,value:jt,disabled:B},jt)}),[T,X,m,J,k,B]);return s.jsxs(m5.Provider,{value:Se,children:[s.jsx(h5.Provider,{value:vt,children:s.jsx(p5.Provider,{value:Ue,children:R})}),s.jsx("input",{...F.getValidationProps(B,{onFocus(){var ct;(ct=Se.state.triggerElement)==null||ct.focus({focusVisible:!0})},onChange(ct){if(ct.nativeEvent.defaultPrevented||B||b)return;const jt=ct.currentTarget.value,ae=bt(Tr,ct.nativeEvent);function Ke(){if(T)return;const ut=jt.toLowerCase();let Jt=oe.current.findIndex(Et=>Vc(Et,k).toLowerCase()===ut||v5(Et,O).toLowerCase()===ut);Jt===-1&&(Jt=oe.current.findIndex((Et,Pt)=>{const Ln=G.current[Pt];return Ln!=null&&Ln.toLowerCase()===ut}));const Rn=oe.current[Jt];Rn!=null&&Oe(Rn,ae)}Se.set("forceMount",!0),queueMicrotask(Ke)}}),id:W&&Ht==null?`${W}-hidden-input`:void 0,form:m,name:Ht,autoComplete:x,value:mt,disabled:B,required:v&&!(T&&Xe),readOnly:b,ref:wt,style:J?b1:yg,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),kt]})}function N$(e,t){return e??t}const dh=5;function N5(e,t){const r=C$(t);return e.clientX>=r.left-dh&&e.clientX<=r.right+dh&&e.clientY>=r.top-dh&&e.clientY<=r.bottom+dh}function C$(e){const t=e.getBoundingClientRect(),r=xn(e);if(i1)return t;const a=r.getComputedStyle(e,"::before"),l=r.getComputedStyle(e,"::after");if(!(a.content!=="none"||l.content!=="none"))return t;const u=parseFloat(a.width)||0,f=parseFloat(a.height)||0,h=parseFloat(l.width)||0,m=parseFloat(l.height)||0,x=Math.max(t.width,u,h),p=Math.max(t.height,f,m),b=x-t.width,v=p-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-v/2,bottom:t.bottom+v/2}}const k$="data-popup-side",T$=400,E$={...pp,...og,popupSide:e=>e?{[k$]:e}:null,value:()=>null},R$=g.forwardRef(function(t,r){var ne;const{render:a,className:l,id:c,disabled:u=!1,nativeButton:f=!0,style:h,...m}=t,{setTouched:x,setFocused:p,validationMode:b,validation:v,state:j,disabled:S}=gu(),{labelId:N}=af(),C=sa(),{readOnly:E,required:T,disabled:O}=Og(),k=S||O||u,M=C.useState("open"),A=C.useState("mounted"),R=C.useState("value"),z=C.useState("triggerProps"),_=C.useState("positionerElement"),L=C.useState("listElement"),Y=C.useState("popupSide"),P=C.useState("id"),V=C.useState("labelId"),U=C.useState("hasSelectedValue"),H=A&&_?Y:null,F=c??P,q=N$(N,V);lf({id:c});const W=In(_),B=g.useRef(null),{getButtonProps:J,buttonRef:X}=oo({disabled:k,native:f}),re=C.useStateSetter("triggerElement"),I=es(),$=es(),Q=es();g.useEffect(()=>{if(M)return Q.start(T$,()=>{C.context.selectionRef.current.allowUnselectedMouseUp=!0,C.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{Q.clear()};C.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},$.clear()},[M,C,$,Q]);const G=Ys(z,{id:F,role:"combobox","aria-expanded":M,"aria-haspopup":"listbox","aria-controls":M?(L==null?void 0:L.id)??((ne=xp(_))==null?void 0:ne.id):void 0,"aria-labelledby":q,"aria-readonly":E||void 0,"aria-required":T||void 0,tabIndex:k?-1:0,onFocus(ie){p(!0),M&&C.context.alignItemWithTriggerActiveRef.current&&C.context.setOpen(!1,bt(Tr,ie.nativeEvent)),I.start(0,()=>{C.set("forceMount",!0)})},onBlur(ie){pt(_,ie.relatedTarget)||(x(!0),p(!1),b==="onBlur"&&v.commit(R))},onMouseDown(ie){if(M)return;const oe=Ft(ie.currentTarget);function Z(de){if(!B.current)return;const ke=de.target;pt(B.current,ke)||pt(W.current,ke)||N5(de,B.current)||C.context.setOpen(!1,bt(CA,de))}$.start(0,()=>{oe.addEventListener("mouseup",Z,{once:!0})})}},m,J),se=v.getValidationProps(k,G);se.role="combobox";const ee={...j,open:M,disabled:k,value:R,readOnly:E,popupSide:H,placeholder:!U};return Nt("button",t,{ref:[r,B,X,re],state:ee,stateAttributesMapping:E$,props:se})}),A$={value:()=>null},O$=g.forwardRef(function(t,r){const{className:a,render:l,children:c,placeholder:u,style:f,...h}=t,m=sa(),x=m.useState("value"),p=m.useState("items"),b=m.useState("itemToStringLabel"),v=m.useState("hasSelectedValue"),j=!v&&u!=null&&c==null,S=m.useState("hasNullItemLabel",j),N={value:x,placeholder:!v};let C=null;return typeof c=="function"?C=c(x):c!=null?C=c:j&&!S?C=u:Array.isArray(x)?C=v$(x,p,b):C=w5(x,p,b),Nt("span",t,{state:N,ref:[r,m.context.valueRef],props:[{children:C},h],stateAttributesMapping:A$})}),M$=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,m={open:sa().useState("open")};return Nt("span",t,{state:m,ref:r,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:u1})}),D$=g.forwardRef(function(t,r){const a=sa(),l=a.useState("mounted"),c=a.useState("forceMount");return l||c?s.jsx(vg,{ref:r,...t}):null});function bf(e){return s1(19)?e:e?"true":void 0}const C5=g.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function z$(){return g.useContext(C5)}function yf(e){const{children:t,elementsRef:r,labelsRef:a,onMapChange:l}=e,c=Ze(l),[,u]=g.useState(!1),f=fs(I$).current,h=fs(P$).current,m=g.useRef(0),x=g.useRef(!0),p=g.useRef(null),b=g.useRef(null),v=Ze(()=>{x.current||(x.current=!0,u(k=>!k))}),j=Ze((k,M)=>{h.set(k,M),v()}),S=Ze(k=>{h.delete(k),v()}),N=Ze(k=>{const M=new Map;return r.current.length=0,a&&(a.current.length=0),k.forEach(A=>{var R,z;M.set(A.element,{...A.registration.metadata??{},index:A.index}),r.current[A.index]=A.element,a&&(a.current[A.index]=A.registration.label!==void 0?A.registration.label:((z=(R=A.registration.textRef)==null?void 0:R.current)==null?void 0:z.textContent)??A.element.textContent)}),m.current=r.current.length,M});function C(k){var R;if((R=b.current)==null||R.disconnect(),b.current=null,typeof MutationObserver!="function"||k.length<2)return;const M=new MutationObserver(z=>{if(!B$(z))return;let _=null;for(const L of k)if(L.isConnected){if(_&&k5(_,L)>0){M.disconnect(),v();return}_=L}});b.current=M;const A=new Set;for(let z=1;z<k.length;z+=1){const _=L$(k[z-1],k[z]);_&&A.add(_)}A.forEach(z=>M.observe(z,{childList:!0}))}const E=Ze(()=>{const[k,M]=_$(h),A=N(k),R=p.current,z=!R||R.length!==k.length||k.some((_,L)=>{const Y=R[L];return _.index!==Y.index||_.element!==Y.element||_.registration.index!==Y.registration.index||_.registration.metadata!==Y.registration.metadata});C(M),p.current=k,x.current=!1,z&&(f.forEach(_=>_(A)),c(A))});qe(()=>(!x.current&&p.current&&N(p.current),()=>{r.current=[],a&&(a.current=[])}),[r,a,N]),qe(()=>{x.current&&E()}),qe(()=>()=>{var k;(k=b.current)==null||k.disconnect(),x.current=!0},[]);const T=Ze(k=>(f.add(k),()=>{f.delete(k)})),O=g.useMemo(()=>({register:j,unregister:S,subscribeMapChange:T,nextIndexRef:m}),[j,S,T,m]);return s.jsx(C5.Provider,{value:O,children:t})}function P$(){return new Map}function I$(){return new Set}function _$(e){const t=new Set,r=[],a=[];e.forEach((c,u)=>{if(!u.isConnected)return;const f=c.index,h={index:f??-1,element:u,registration:c};f===null?a.push(h):f>=0&&(t.add(f),r.push(h))});let l=0;return a.sort((c,u)=>k5(c.element,u.element)),a.forEach(c=>{for(;t.has(l);)l+=1;c.index=l,r.push(c),l+=1}),t.size>0&&r.sort((c,u)=>c.index-u.index),[r,a.map(c=>c.element)]}function L$(e,t){let r=e.parentElement;for(;r&&!r.contains(t);)r=r.parentElement;return r}function B$(e){for(const t of e)for(let r=0;r<t.removedNodes.length;r+=1)if(t.removedNodes[r].isConnected)return!0;return!1}function k5(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const $$=g.createContext(void 0);function Mg(){const e=g.useContext($$);return(e==null?void 0:e.direction)??"ltr"}const V$=e=>({name:"arrow",options:e,async fn(t){var W,B;const{x:r,y:a,placement:l,rects:c,platform:u,elements:f,middlewareData:h}=t,{element:m,padding:x=0,offsetParent:p="real"}=zi(e,t)||{};if(m==null)return{};const b=mA(x),v={x:r,y:a},j=h1(l),S=m1(j),N=await u.getDimensions(m),C=j==="y",E=C?"top":"left",T=C?"bottom":"right",O=C?"clientHeight":"clientWidth",k=c.reference[S]+c.reference[j]-v[j]-c.floating[S],M=v[j]-c.reference[j],A=p==="real"?await((W=u.getOffsetParent)==null?void 0:W.call(u,m)):f.floating;let R=f.floating[O]||c.floating[S];(!R||!await((B=u.isElement)==null?void 0:B.call(u,A)))&&(R=f.floating[O]||c.floating[S]);const z=k/2-M/2,_=R/2-N[S]/2-1,L=Math.min(b[E],_),Y=Math.min(b[T],_),P=L,V=R-N[S]-Y,U=R/2-N[S]/2+z,H=fA(P,U,V),F=!h.arrow&&Da(l)!=null&&U!==H&&c.reference[S]/2-(U<P?L:Y)-N[S]/2<0,q=F?U<P?U-P:U-V:0;return{[j]:v[j]+q,data:{[j]:H,centerOffset:U-H-q,...F&&{alignmentOffset:q}},reset:F}}}),U$=(e,t)=>{const{name:r,fn:a}=V$(e);return{name:r,fn:a,options:[e,t]}},H$={name:"hide",async fn(e){const{width:t,height:r,x:a,y:l}=e.rects.reference,c=t===0&&r===0&&a===0&&l===0,u=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:u.top-r>=0||u.right-t>=0||u.bottom-r>=0||u.left-t>=0||c}}}},F$={sideX:"left",sideY:"top"},G$="--available-width",q$="--available-height",Y$="--anchor-width",K$="--anchor-height",X$="--transform-origin",ak=G$,ik=q$;function T5(e,t,r){const a=e==="inline-start"||e==="inline-end";return{top:"top",right:a?r?"inline-start":"inline-end":"right",bottom:"bottom",left:a?r?"inline-end":"inline-start":"left"}[t]}function lk(e,t,r){const{rects:a,placement:l}=e;return{side:T5(t,Fr(l),r),align:Da(l)||"center",anchor:{width:a.reference.width,height:a.reference.height},positioner:{width:a.floating.width,height:a.floating.height}}}function Dg(e){return W$(e,r$)}function W$(e,t){var ht,yt;const{anchor:r,positionMethod:a="absolute",side:l="bottom",sideOffset:c=0,align:u="center",alignOffset:f=0,collisionBoundary:h,collisionPadding:m=5,sticky:x=!1,arrowPadding:p=5,disableAnchorTracking:b=!1,inline:v,keepMounted:j=!1,floatingRootContext:S,mounted:N,collisionAvoidance:C,shift:E,nodeId:T,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:M}=e,[A,R]=g.useState(null);!N&&A!==null&&R(null);const z=C.side||"flip",_=C.align||"flip",L=C.fallbackAxisSide||"end",Y=(E==null?void 0:E.crossAxis)??!1,P=E==null?void 0:E.rootBoundary,V=typeof r=="function"?r:void 0,U=Ze(V),H=V?U:r,F=In(r),q=In(N),B=Mg()==="rtl",J=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[l],X=u==="center"?J:`${J}-${u}`;let re=m;typeof re=="number"?re={top:re,right:re,bottom:re,left:re}:re&&(re={top:re.top||0,right:re.right||0,bottom:re.bottom||0,left:re.left||0});const I=1,$=l==="bottom"?I:0,Q=l==="top"?I:0,G=l==="right"?I:0,se=l==="left"?I:0,ee={boundary:h==="clipping-ancestors"?"clippingAncestors":h,padding:re},ne=g.useRef(null),ie=In(c),oe=In(f),Z=typeof c!="function"?c:0,de=typeof f!="function"?f:0,ke=[];v&&ke.push(v),ke.push(KB(ue=>{const Ye=lk(ue,l,B),Pe=typeof ie.current=="function"?ie.current(Ye):ie.current,st=typeof oe.current=="function"?oe.current(Ye):oe.current;return{mainAxis:Pe,crossAxis:st,alignmentAxis:st}},[Z,de,B,l]));const _e=_==="none"&&z!=="shift",je=!_e&&(x||Y||z==="shift"),Ae=z==="none"?null:QB({...ee,padding:{top:re.top+I+$,right:re.right+I+se,bottom:re.bottom+I+Q,left:re.left+I+G},mainAxis:!Y&&z==="flip",crossAxis:_==="flip"?"alignment":!1,fallbackAxisSideDirection:L}),te=_e?null:XB({...ee,rootBoundary:P,mainAxis:_!=="none",crossAxis:je,limiter:x||Y?void 0:WB(ue=>{if(!ne.current)return{};const{width:Ye,height:Pe}=ne.current.getBoundingClientRect(),st=Ur(Fr(ue.placement)),vt=st==="y"?Ye:Pe,wt=st==="y"?re.left+re.right:re.top+re.bottom;return{offset:vt/2+wt/2}})},[ee,x,Y,P,re,_]);z==="shift"||_==="shift"||u==="center"?ke.push(te,Ae):ke.push(Ae,te),ke.push(ZB({...ee,apply({elements:{floating:ue},availableWidth:Ye,availableHeight:Pe,rects:st}){if(!q.current)return;const vt=ue.style;vt.setProperty(ak,`${Ye}px`),vt.setProperty(ik,`${Pe}px`);const wt=xn(ue).devicePixelRatio||1,{x:Ht,y:kt,width:ct,height:jt}=st.reference,ae=(Math.round((Ht+ct)*wt)-Math.round(Ht*wt))/wt,Ke=(Math.round((kt+jt)*wt)-Math.round(kt*wt))/wt;vt.setProperty(Y$,`${ae}px`),vt.setProperty(K$,`${Ke}px`)}}),U$(ue=>({element:ne.current||Ft(ue.elements.floating).createElement("div"),padding:ne.current?p:0,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(ue){var Rn,Et,Pt,Ln,Eo,ps;const{elements:{floating:Ye},middlewareData:Pe,placement:st,platform:vt,rects:wt,y:Ht}=ue,kt=Fr(st),ct=Da(st),jt=Ur(kt)==="y",ae=ne.current,Ke=typeof c=="function"?c(lk(ue,l,B)):c;let ut;if(!ae&&ct&&Math.abs(jt?((Rn=Pe.shift)==null?void 0:Rn.x)||0:((Et=Pe.shift)==null?void 0:Et.y)||0)<=1)ut=ct==="start"===(jt&&((Pt=vt.isRTL)==null?void 0:Pt.call(vt,Ye))===!0)?"100%":"0%";else{const ao=jt?((Ln=Pe.arrow)==null?void 0:Ln.x)||0:((Eo=Pe.arrow)==null?void 0:Eo.y)||0,Ks=jt?(ae==null?void 0:ae.clientWidth)||0:(ae==null?void 0:ae.clientHeight)||0;ut=`${ao+Ks/2}px`}let Jt=kt==="top"||kt==="left"?`calc(100% + ${Ke}px)`:`${-Ke}px`;return je&&jt&&Math.abs(((ps=Pe.shift)==null?void 0:ps.y)||0)>Ke&&(Jt=`${wt.reference.y+wt.reference.height/2-Ht}px`),Ye.style.setProperty(X$,jt?`${ut} ${Jt}`:`${Jt} ${ut}`),{}}},H$,O),qe(()=>{!N&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[N,S]);const Ee=g.useMemo(()=>({ancestorScroll:!b,elementResize:!b&&typeof ResizeObserver<"u",layoutShift:!b&&typeof IntersectionObserver<"u"}),[b]),{refs:Te,elements:be,x:We,y:Se,middlewareData:Fe,update:Re,placement:ve,context:pe,isPositioned:$e,floatingStyles:Je}=t({rootContext:S,open:j?N:void 0,placement:X,middleware:ke,strategy:a,whileElementsMounted:j?void 0:(...ue)=>ek(...ue,Ee),nodeId:T,externalTree:M}),{sideX:mt,sideY:ot}=Fe.adaptiveOrigin||F$,Ie=$e?a:"fixed",at=g.useMemo(()=>{let ue;return $e?O?ue={position:Ie,[mt]:We,[ot]:Se}:ue={...Je,position:Ie}:ue={position:Ie,top:0,left:0},ue[ak]="100vw",ue[ik]="100vh",$e||(ue.opacity=0),ue},[O,Ie,mt,We,ot,Se,Je,$e]),Xe=g.useRef(null);qe(()=>{if(!N)return;const ue=F.current,Ye=typeof ue=="function"?ue():ue,st=(ck(Ye)?Ye.current:Ye)||null||null;st!==Xe.current&&(Te.setPositionReference(st),Xe.current=st)},[N,Te,H,F]),g.useEffect(()=>{if(!N)return;const ue=F.current;typeof ue!="function"&&ck(ue)&&ue.current!==Xe.current&&(Te.setPositionReference(ue.current),Xe.current=ue.current)},[N,Te,H,F]),g.useEffect(()=>{if(j&&N&&be.reference&&be.floating)return ek(be.reference,be.floating,Re,Ee)},[j,N,be,Re,Ee]);const me=Fr(ve),Me=T5(l,me,B),Oe=Da(ve)||"center",tt=!!((ht=Fe.hide)!=null&&ht.referenceHidden);qe(()=>{k&&N&&$e&&me!==J&&R(me)},[k,N,$e,me,J]);const Ue=g.useMemo(()=>{var ue,Ye;return{position:"absolute",top:(ue=Fe.arrow)==null?void 0:ue.y,left:(Ye=Fe.arrow)==null?void 0:Ye.x}},[Fe.arrow]),Ge=((yt=Fe.arrow)==null?void 0:yt.centerOffset)!==0;return g.useMemo(()=>({positionerStyles:at,arrowStyles:Ue,arrowRef:ne,arrowUncentered:Ge,side:Me,align:Oe,physicalSide:me,anchorHidden:tt,refs:Te,context:pe,isPositioned:$e,update:Re}),[at,Ue,ne,Ge,Me,Oe,me,tt,Te,pe,$e,Re])}function ck(e){return e!=null&&"current"in e}const E5=g.createContext(void 0);function B1(){const e=g.useContext(E5);if(!e)throw new Error(Zt(59));return e}const zg=g.forwardRef(function(t,r){const{cutout:a,...l}=t;let c;if(a){const u=a.getBoundingClientRect();c=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${u.left}px ${u.top}px,${u.left}px ${u.bottom}px,${u.right}px ${u.bottom}px,${u.right}px ${u.top}px,${u.left}px ${u.top}px)`}return s.jsx("div",{ref:r,role:"presentation","data-base-ui-inert":"",...l,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})});function Cp(e,t){e&&Object.assign(e.style,t)}const R5={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function vf(e){return e==="starting"?aB:gn}function Pg(e,t,{styles:r,transitionStatus:a,props:l,refs:c,hidden:u,inert:f=!1}){const h={...r};return f&&(h.pointerEvents="none"),Nt("div",e,{state:t,ref:c,props:[{role:"presentation",hidden:u,style:h},vf(a),l],stateAttributesMapping:cf})}let uk={},dk={},fk="";function Ig(e,t){return of(e)?e:t}function mk(e,t,r){return/hidden|clip/.test(e.getComputedStyle(Ig(t,r)).overflowY)}function Q$(e){if(typeof document>"u")return!1;const t=Ft(e);return xn(t).innerWidth-t.documentElement.clientWidth>0}function Z$(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=Ft(e),a=r.documentElement,l=r.body,c=Ig(a,l),u=c.style.overflowY,f=a.style.scrollbarGutter;a.style.scrollbarGutter="stable",c.style.overflowY="scroll";const h=c.offsetWidth;c.style.overflowY="hidden";const m=c.offsetWidth;return c.style.overflowY=u,a.style.scrollbarGutter=f,h===m}function J$(e){const t=Ft(e),r=t.documentElement,a=t.body,l=Ig(r,a),c={overflowY:l.style.overflowY,overflowX:l.style.overflowX};return Object.assign(l.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(l.style,c)}}function eV(e){var v;const t=Ft(e),r=t.documentElement,a=t.body,l=xn(r);let c=0,u=0,f=!1;const h=ar.create();if(Ha&&(((v=l.visualViewport)==null?void 0:v.scale)??1)!==1)return()=>{};function m(){const j=l.getComputedStyle(r),S=l.getComputedStyle(a),E=(j.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=r.scrollTop,u=r.scrollLeft,uk={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},fk=r.style.scrollBehavior,dk={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};const T=r.scrollHeight>r.clientHeight,O=r.scrollWidth>r.clientWidth,k=j.overflowY==="scroll"||S.overflowY==="scroll",M=j.overflowX==="scroll"||S.overflowX==="scroll",A=Math.max(0,l.innerWidth-a.clientWidth),R=Math.max(0,l.innerHeight-a.clientHeight),z=parseFloat(S.marginTop)+parseFloat(S.marginBottom),_=parseFloat(S.marginLeft)+parseFloat(S.marginRight),L=Ig(r,a);if(f=Z$(e),f){r.style.scrollbarGutter=E,L.style.overflowY="hidden",L.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(T||k)&&(r.style.overflowY="scroll"),(O||M)&&(r.style.overflowX="scroll"),Object.assign(a.style,{position:"relative",height:z||R?`calc(100dvh - ${z+R}px)`:"100dvh",width:_||A?`calc(100vw - ${_+A}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),a.scrollTop=c,a.scrollLeft=u,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function x(){Object.assign(r.style,uk),Object.assign(a.style,dk),f||(r.scrollTop=c,r.scrollLeft=u,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=fk)}function p(){x(),h.request(m)}m();const b=Lt(l,"resize",p);return()=>{h.cancel(),x(),typeof l.removeEventListener=="function"&&b()}}class tV{constructor(){tn(this,"lockCount",0);tn(this,"restore",null);tn(this,"timeoutLock",Kr.create());tn(this,"timeoutUnlock",Kr.create());tn(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});tn(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Ft(t),a=r.documentElement,l=r.body,c=xn(a);if(mk(c,a,l)){const f=new c.MutationObserver(()=>{mk(c,a,l)||(f.disconnect(),this.restore=null,this.lock(t))}),h={attributes:!0};f.observe(a,h),f.observe(l,h),this.restore=()=>f.disconnect();return}const u=lg||!Q$(t);this.restore=u?J$(t):eV(t)}}const nV=new tV;function A5(e=!0,t=null){qe(()=>{if(e)return nV.acquire(t)},[e,t])}const sV=20;function $1(e,t,r,a){const[l,c]=g.useState(!1);qe(()=>{if(!e||!t||r==null){c(!1);return}const u=Ft(r).documentElement.clientWidth,f=r.offsetWidth;c(u>0&&f>0&&f>=u-sV)},[e,t,r]),A5(e&&(!t||l),a)}const rV={position:"fixed"},oV=g.forwardRef(function(t,r){const{anchor:a,className:l,render:c,positionMethod:u,side:f,align:h,sideOffset:m,alignOffset:x,collisionBoundary:p="clipping-ancestors",collisionPadding:b,arrowPadding:v,sticky:j,disableAnchorTracking:S,alignItemWithTrigger:N=!0,collisionAvoidance:C=UA,style:E,...T}=t,O=sa(),k=g5(),M=O.useState("open"),A=O.useState("mounted"),R=O.useState("modal"),z=O.useState("value"),_=O.useState("openMethod"),L=O.useState("positionerElement"),Y=O.useState("triggerElement"),P=O.useState("isItemEqualToValue"),V=O.useState("transitionStatus"),U=g.useRef(null),H=g.useRef(null),[F,q]=g.useState(N),W=A&&F&&_!=="touch";!A&&F!==N&&q(N),g.useImperativeHandle(O.context.alignItemWithTriggerActiveRef,()=>W),$1((W||R)&&M,_==="touch",L,Y);const B=Dg({anchor:a,floatingRootContext:k,positionMethod:u,mounted:A,side:f,sideOffset:m,align:h,alignOffset:x,arrowPadding:v,collisionBoundary:p,collisionPadding:b,sticky:j,disableAnchorTracking:S??W,collisionAvoidance:C,keepMounted:!0}),J=W?"none":B.side,X=W?rV:B.positionerStyles,re={open:M,side:J,align:B.align,anchorHidden:B.anchorHidden};qe(()=>{O.set("popupSide",B.side)},[O,B.side]);const I=O.useStateSetter("positionerElement"),$=Pg(t,re,{styles:X,transitionStatus:V,props:T,refs:[r,I],hidden:!A,inert:!M}),Q=g.useRef(0),G=Ze(ee=>{if(O.context.valuesRef.current.length===0)return;const ne=Q.current;Q.current=ee.size;const ie=bt(Tr);if(ne!==0&&!O.state.multiple&&z!==null&&Vh(O.context.valuesRef.current,z,P)===-1){const Z=O.context.initialValueRef.current,ke=Z!=null&&Vh(O.context.valuesRef.current,Z,P)!==-1?Z:null;O.context.setValue(ke,ie),ke===null&&(O.set("selectedIndex",null),O.context.selectedItemTextRef.current=null)}if(ne!==0&&O.state.multiple&&Array.isArray(z)){const oe=z.filter(Z=>Vh(O.context.valuesRef.current,Z,P)!==-1);oe.length!==z.length&&(O.context.setValue(oe,ie),oe.length===0&&(O.set("selectedIndex",null),O.context.selectedItemTextRef.current=null))}if(M&&W){O.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const oe={height:""};Cp(L,oe),Cp(O.context.popupRef.current,oe)}}),se=g.useMemo(()=>({...B,side:J,alignItemWithTriggerActive:W,setControlledAlignItemWithTrigger:q,scrollUpArrowRef:U,scrollDownArrowRef:H}),[B,J,W,q]);return s.jsx(yf,{elementsRef:O.context.listRef,labelsRef:O.context.labelsRef,onMapChange:G,children:s.jsxs(E5.Provider,{value:se,children:[A&&R&&s.jsx(zg,{inert:bf(!M),cutout:Y}),$]})})}),fh="base-ui-disable-scrollbar",Jy={className:fh,getElement(e){return s.jsx("style",{nonce:e,href:fh,precedence:"base-ui:low",children:`.${fh}{scrollbar-width:none}.${fh}::-webkit-scrollbar{display:none}`})}},aV=g.createContext(void 0);function _g(e){return g.useContext(aV)}const ev="ArrowUp",tv="ArrowDown",nv="ArrowLeft",sv="ArrowRight",rv="Home",ov="End",wf=new Set([ev,tv,nv,sv,rv,ov]),iV="Shift",lV=[iV,"Control","Alt","Meta"];function cV(e){return un(e)&&e.tagName==="INPUT"}function hk(e){return!!(cV(e)&&e.selectionStart!=null||un(e)&&e.tagName==="TEXTAREA")}function pk(e,t,r,a){if(!e||!t||!t.scrollTo)return;let l=e.scrollLeft,c=e.scrollTop;const u=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(u&&a!=="vertical"){const h=gk(e,t,"left"),m=mh(e),x=mh(t);r==="ltr"&&(h+t.offsetWidth+x.scrollMarginRight>e.scrollLeft+e.clientWidth-m.scrollPaddingRight?l=h+t.offsetWidth+x.scrollMarginRight-e.clientWidth+m.scrollPaddingRight:h-x.scrollMarginLeft<e.scrollLeft+m.scrollPaddingLeft&&(l=h-x.scrollMarginLeft-m.scrollPaddingLeft)),r==="rtl"&&(h-x.scrollMarginLeft<e.scrollLeft+m.scrollPaddingLeft?l=h-x.scrollMarginLeft-m.scrollPaddingLeft:h+t.offsetWidth+x.scrollMarginRight>e.scrollLeft+e.clientWidth-m.scrollPaddingRight&&(l=h+t.offsetWidth+x.scrollMarginRight-e.clientWidth+m.scrollPaddingRight))}if(f&&a!=="horizontal"){const h=gk(e,t,"top"),m=mh(e),x=mh(t);h-x.scrollMarginTop<e.scrollTop+m.scrollPaddingTop?c=h-x.scrollMarginTop-m.scrollPaddingTop:h+t.offsetHeight+x.scrollMarginBottom>e.scrollTop+e.clientHeight-m.scrollPaddingBottom&&(c=h+t.offsetHeight+x.scrollMarginBottom-e.clientHeight+m.scrollPaddingBottom)}e.scrollTo({left:l,top:c,behavior:"auto"})}function gk(e,t,r){const a=r==="left"?"offsetLeft":"offsetTop";let l=0;for(;t.offsetParent&&(l+=t[a],t.offsetParent!==e);)t=t.offsetParent;return l}function mh(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const uV=g.createContext(void 0),dV={disableStyleElements:!1};function fV(){return g.useContext(uV)??dV}const xk="--transform-origin",mV={...cf,...Fa},hV=g.forwardRef(function(t,r){const{render:a,className:l,style:c,finalFocus:u,...f}=t,h=sa(),{multiple:m,readOnly:x,highlightItemOnHover:p}=Og(),b=g5(),{side:v,align:j,alignItemWithTriggerActive:S,isPositioned:N,setControlledAlignItemWithTrigger:C}=B1(),E=_g()!=null,T=Mg(),{nonce:O,disableStyleElements:k}=fV(),M=h.useState("id"),A=h.useState("open"),R=h.useState("openMethod"),z=h.useState("mounted"),_=h.useState("popupProps"),L=h.useState("transitionStatus"),Y=h.useState("triggerElement"),P=h.useState("positionerElement"),V=h.useState("listElement"),U=g.useRef(!1),H=g.useRef(!1),F=g.useRef({}),q=lu(),W=Ze(re=>{if(!P||!h.context.popupRef.current||!H.current)return;const I=P.style.top==="0px",$=P.style.bottom==="0px";if(U.current||!S||!I&&!$){h.context.handleScrollArrowVisibility(re);return}const Q=yk(P),G=kd(P.getBoundingClientRect().height,"y",Q),se=Ft(P),ee=xn(P),ne=ee.getComputedStyle(P),ie=parseFloat(ne.marginTop),oe=parseFloat(ne.marginBottom),Z=bk(ee.getComputedStyle(h.context.popupRef.current)),de=Math.min(se.documentElement.clientHeight-ie-oe,Z),ke=re.scrollTop,_e=hh(re);let je=null;const Ae=be=>{P.style.height=`${be}px`},te=I?_e-ke:ke,Ee=Math.min(G+te,de);if(te<=bo){const be=Cd(te,0,de-G);be>0&&Ae(G+be),re.scrollTop=I?_e:0,de-(G+be)<=bo&&(U.current=!0),h.context.handleScrollArrowVisibility(re);return}if(de-Ee>bo)je=I?1/0:0;else if($&&ke<_e){const be=G+te-de;je=ke-(te-be)}const Te=Math.ceil(Ee);if(Te!==0&&Ae(Te),je!=null){const be=Cd(je,0,hh(re));Math.abs(re.scrollTop-be)>bo&&(re.scrollTop=be)}Te>=de-bo&&(U.current=!0),h.context.handleScrollArrowVisibility(re)});g.useImperativeHandle(h.context.scrollHandlerRef,()=>W,[W]),ir({open:A,ref:h.context.popupRef,onComplete(){A&&h.context.onOpenChangeComplete(!0)}});const B={open:A,transitionStatus:L,side:v,align:j};qe(()=>{!P||!h.context.popupRef.current||Object.keys(F.current).length||(F.current={top:P.style.top||"0",left:P.style.left||"0",right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[h,P]),qe(()=>{A||S||(H.current=!1,U.current=!1,Cp(P,F.current))},[A,S,P]),qe(()=>{var $,Q;const re=h.context.popupRef.current;if(!A||!Y||!P||!re||S&&!N||h.state.transitionStatus==="ending")return;if(H.current=!0,re.style.removeProperty(xk),!S){q.request(()=>h.context.handleScrollArrowVisibility(V||re));return}const I=pV(re);try{let G=h.context.selectedItemTextRef.current;G!=null&&G.isConnected||(G=!h.select("hasSelectedValue")&&(($=h.context.firstItemTextRef.current)!=null&&$.isConnected)?h.context.firstItemTextRef.current:null);const se=h.context.valueRef.current,ee=xn(P),ne=ee.getComputedStyle(P),ie=ee.getComputedStyle(re),oe=Ft(Y),Z=yk(Y),de=ph(Y.getBoundingClientRect(),Z),ke=ph(P.getBoundingClientRect(),Z),_e=de.height,je=V||re,Ae=je.scrollHeight,te=parseFloat(ie.borderBottomWidth),Ee=parseFloat(ne.marginTop)||10,Te=parseFloat(ne.marginBottom)||10,be=parseFloat(ne.minHeight)||100,We=bk(ie),Se=5,Fe=5,Re=20,ve=oe.documentElement.clientHeight-Ee-Te,pe=oe.documentElement.clientWidth,$e=ve-de.bottom+_e;let Je,mt=T==="rtl"?de.right-ke.width:de.left,ot=0;if(G&&se){const yt=ph(se.getBoundingClientRect(),Z);Je=ph(G.getBoundingClientRect(),Z),mt=ke.left+(T==="rtl"?yt.right-Je.right:yt.left-Je.left);const ue=yt.top-de.top+yt.height/2;ot=Je.top-ke.top+Je.height/2-ue}const Ie=$e+ot+Te+te;let at=Math.min(ve,Ie);const Xe=ve-Ee-Te,me=Ie-at,Me=pe-Fe;P.style.left=`${Cd(mt,Se,Me-ke.width)}px`,P.style.height=`${at}px`,P.style.maxHeight="none",P.style.marginTop=`${Ee}px`,P.style.marginBottom=`${Te}px`,re.style.height="100%";const Oe=hh(je),tt=me>=Oe-bo;tt&&(at=Math.min(ve,ke.height)-(me-Oe));const Ue=de.top<Re||de.bottom>ve-Re||Math.ceil(at)+bo<Math.min(Ae,be),Ge=(((Q=ee.visualViewport)==null?void 0:Q.scale)??1)!==1&&Ha;if(Ue||Ge){Cp(P,F.current),C(!1);return}const ht=Math.max(be,at);if(tt){const yt=Math.max(0,ve-Ie);P.style.top=ke.height>=Xe?"0":`${yt}px`,P.style.height=`${at}px`,je.scrollTop=hh(je)}else P.style.bottom="0",je.scrollTop=me;if(Je){const yt=ke.top,ue=ke.height,Ye=Je.top+Je.height/2,Pe=Cd(ue>0?(Ye-yt)/ue*100:50,0,100);re.style.setProperty(xk,`50% ${Pe}%`)}(ht===ve||at>=We)&&(U.current=!0),h.context.handleScrollArrowVisibility(je),p&&h.state.selectedIndex===null&&h.state.activeIndex===null&&h.context.listRef.current[0]!=null&&h.set("activeIndex",0)}finally{I()}},[h,A,P,Y,S,C,q,V,p,T,N]),g.useEffect(()=>{if(!S||!P||!A)return;const re=xn(P);function I($){h.context.setOpen(!1,bt(KL,$))}return Lt(re,"resize",I)},[h,S,P,A]);const J={...V?{role:"presentation"}:{role:"listbox","aria-multiselectable":m||void 0,"aria-readonly":x||void 0,id:`${M}-list`},onKeyDown(re){E&&wf.has(re.key)&&re.stopPropagation()},onScroll(re){V||W(re.currentTarget)},...S&&{style:V?{height:"100%"}:R5},className:!V&&S?Jy.className:void 0},X=Nt("div",t,{ref:[r,h.context.popupRef],state:B,stateAttributesMapping:mV,props:[_,J,vf(L),f]});return s.jsxs(g.Fragment,{children:[!k&&Jy.getElement(O),s.jsx(wg,{context:b,modal:!1,disabled:!z,openInteractionType:R,returnFocus:u,restoreFocus:!0,children:X})]})});function bk(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function hh(e){return L1(e.scrollHeight,e.clientHeight)}function yk(e){return n5.getScale(e)}function kd(e,t,r){return e/r[t]}function ph(e,t){return Ud({x:kd(e.x,"x",t),y:kd(e.y,"y",t),width:kd(e.width,"x",t),height:kd(e.height,"y",t)})}const vk=[["transform","none"],["scale","1"],["translate","0 0"]];function pV(e){const{style:t}=e,r={};for(const[a,l]of vk)r[a]=t.getPropertyValue(a),t.setProperty(a,l,"important");return()=>{for(const[a]of vk){const l=r[a];l?t.setProperty(a,l):t.removeProperty(a)}}}const gV=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,f=sa(),{multiple:h,readOnly:m}=Og(),{alignItemWithTriggerActive:x}=B1(),p=f.useState("hasScrollArrows"),b=f.useState("openMethod"),j={id:`${f.useState("id")}-list`,role:"listbox","aria-multiselectable":h||void 0,"aria-readonly":m||void 0,onScroll(N){var C,E;(E=(C=f.context.scrollHandlerRef).current)==null||E.call(C,N.currentTarget)},...x&&{style:R5},className:p&&b!=="touch"?Jy.className:void 0},S=f.useStateSetter("listElement");return Nt("div",t,{ref:[r,S],props:[j,u]})});function Yl(e={}){const{guess:t,label:r,metadata:a,textRef:l,index:c}=e,{register:u,unregister:f,subscribeMapChange:h,nextIndexRef:m}=z$(),x=g.useRef(-1),[p,b]=g.useState(c==null&&t?()=>{if(x.current===-1){const N=m.current;m.current+=1,x.current=N}return x.current}:-1),v=c??p,j=g.useRef(null),S=g.useCallback(N=>{const C=j.current;C&&f(C),j.current=N,N&&u(N,{metadata:a??null,index:c??null,label:r,textRef:l})},[c,u,f,a,r,l]);return qe(()=>{if(c==null)return h(N=>{var E;const C=j.current?(E=N.get(j.current))==null?void 0:E.index:null;C!=null&&b(C)})},[c,h]),{ref:S,index:v}}const O5=g.createContext(void 0);function V1(){const e=g.useContext(O5);if(!e)throw new Error(Zt(57));return e}const xV=g.memo(g.forwardRef(function(t,r){const{render:a,className:l,style:c,value:u=null,label:f,disabled:h=!1,nativeButton:m=!1,...x}=t,p=g.useRef(null),b=Yl({guess:!0,label:f,textRef:p}),v=sa(),{itemProps:j,multiple:S,disabled:N,readOnly:C}=Og(),E=N||h,T=v.useState("isActive",b.index),O=v.useState("open"),k=v.useState("isSelected",u),M=v.useState("isSelectedByFocus",b.index),A=v.useState("isItemEqualToValue"),R=b.index,z=g.useRef(null);qe(()=>{const B=v.context.valuesRef.current;return B[R]=u,()=>{delete B[R]}},[R,u,v]),qe(()=>{const B=v.state.value,J=v.state.selectedIndex;let X=J,re;S&&Array.isArray(B)?(X=p$(R,u,v.context.valuesRef.current,B,A,J),re=X===R,R===J&&!re&&(v.context.selectedItemTextRef.current=null)):(re=B!==void 0&&Ll(u,B,A),re&&(X=R)),v.set("selectedIndex",X),re&&p.current&&(v.context.selectedItemTextRef.current=p.current)},[R,S,A,v,u]);const _=g.useRef("mouse"),L=g.useRef(!1),{getButtonProps:Y,buttonRef:P}=oo({disabled:E,focusableWhenDisabled:!0,native:m,composite:!0}),V={disabled:E,selected:k,highlighted:T};function U(B){if(N||C)return;const J=v.state.value;if(S){const X=Array.isArray(J)?J:[],re=k?g$(X,u,A):[...X,u];v.context.setValue(re,bt(Al,B))}else v.context.setValue(u,bt(Al,B)),v.context.setOpen(!1,bt(Al,B))}function H(){v.context.selectionRef.current.dragY=0}const F={role:"option","aria-selected":k,tabIndex:O&&T?0:-1,onKeyDown(B){v.set("activeIndex",R),B.key===" "&&v.context.typingRef.current&&B.preventDefault()},onClick(B){const J=_.current!=="touch",X=B.nativeEvent.pointerType,re=J&&mg(B.nativeEvent)&&(X!==void 0||T),I=J&&!re&&!L.current;L.current=!1,!(E||I)&&U(B.nativeEvent)},onPointerEnter(B){_.current=B.pointerType},onPointerMove(B){if(B.pointerType==="mouse"&&B.buttons===1){const J=v.context.selectionRef.current;J.dragY+=B.movementY,J.dragY**2>=64&&(J.allowUnselectedMouseUp=!0)}},onPointerDown(B){_.current=B.pointerType,L.current=!0,H()},onMouseUp(){var X;if(H(),E||_.current==="touch"||L.current)return;const B=!v.context.selectionRef.current.allowSelectedMouseUp&&k,J=!v.context.selectionRef.current.allowUnselectedMouseUp&&!k;B||J||(L.current=!0,(X=z.current)==null||X.click(),L.current=!1)}},q=Nt("div",t,{ref:[P,r,b.ref,z],state:V,props:[j,F,x,Y]}),W=g.useMemo(()=>({selected:k,index:R,textRef:p,selectedByFocus:M}),[k,R,p,M]);return s.jsx(O5.Provider,{value:W,children:q})})),bV=g.forwardRef(function(t,r){const{selected:a}=V1();return t.keepMounted||a?s.jsx(yV,{...t,ref:r}):null}),yV=g.memo(g.forwardRef((e,t)=>{const{render:r,className:a,style:l,keepMounted:c,...u}=e,{selected:f}=V1(),h=g.useRef(null),{transitionStatus:m,setMounted:x}=Ga(f),b=Nt("span",e,{ref:[t,h],state:{selected:f,transitionStatus:m},props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Fa});return ir({batch:!0,enabled:!f,open:f,ref:h,onComplete(){f||x(!1)}}),b})),vV=g.memo(g.forwardRef(function(t,r){const{index:a,textRef:l,selectedByFocus:c}=V1(),u=sa(),{render:f,className:h,style:m,...x}=t,p=g.useCallback(v=>{v&&(a===0&&(u.context.firstItemTextRef.current=v),c&&(u.context.selectedItemTextRef.current=v))},[u,a,c]);return Nt("div",t,{ref:[p,r,l],props:x})})),M5=g.forwardRef(function(t,r){const{render:a,className:l,style:c,direction:u,keepMounted:f,...h}=t,m=u==="up",x=sa(),{side:p,scrollDownArrowRef:b,scrollUpArrowRef:v}=B1(),j=m?"scrollUpArrowVisible":"scrollDownArrowVisible",S=x.useState(j),N=x.useState("openMethod"),C=S&&N!=="touch",E=es(),T=m?v:b,{mounted:O,transitionStatus:k,setMounted:M}=Ga(C);qe(()=>(x.context.scrollArrowsMountedCountRef.current+=1,x.set("hasScrollArrows",!0),()=>{x.context.scrollArrowsMountedCountRef.current=Math.max(0,x.context.scrollArrowsMountedCountRef.current-1),x.context.scrollArrowsMountedCountRef.current===0&&x.set("hasScrollArrows",!1)}),[x]),ir({open:C,ref:T,onComplete(){C||M(!1)}});const z=Nt("div",t,{ref:[r,T],state:{direction:u,visible:C,side:p,transitionStatus:k},props:[{"aria-hidden":!0,children:m?"▲":"▼",style:{position:"absolute"},onMouseMove(L){if(L.movementX===0&&L.movementY===0||E.isStarted())return;x.set("activeIndex",null);function Y(){var q;const P=x.state.listElement??x.context.popupRef.current;if(!P)return;x.set("activeIndex",null),x.context.handleScrollArrowVisibility(P);const V=L1(P.scrollHeight,P.clientHeight),U=Np(P.scrollTop,V),H=U===(m?0:V),F=x.context.listRef.current;if(U!==P.scrollTop&&(P.scrollTop=U),H){E.clear();return}if(F.length>0){const W=((q=T.current)==null?void 0:q.offsetHeight)||0;P.scrollTop=wV(F,m,U,P.clientHeight,W,V)}E.start(40,Y)}E.start(40,Y)},onMouseLeave(){E.clear()}},h],stateAttributesMapping:Fa});return O||f?z:null});function wV(e,t,r,a,l,c){if(t){let x=0;const p=r+l-bo;for(let j=0;j<e.length;j+=1){const S=e[j];if(S&&S.offsetTop>=p){x=j;break}}const b=Math.max(0,x-1),v=e[b];return b<x&&v?Np(v.offsetTop-l,c):0}let u=e.length-1;const f=r+a-l+bo;for(let x=0;x<e.length;x+=1){const p=e[x];if(p&&p.offsetTop+p.offsetHeight>f){u=Math.max(0,x-1);break}}const h=Math.min(e.length-1,u+1),m=e[h];return h>u&&m?Np(m.offsetTop+m.offsetHeight-a+l,c):c}const jV=g.forwardRef(function(t,r){return s.jsx(M5,{...t,ref:r,direction:"down"})}),SV=g.forwardRef(function(t,r){return s.jsx(M5,{...t,ref:r,direction:"up"})}),NV=g.createContext(void 0),CV=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,[f,h]=g.useState(),m=g.useMemo(()=>({labelId:f,setLabelId:h}),[f,h]),x=Nt("div",t,{ref:r,props:[{role:"group","aria-labelledby":f},u]});return s.jsx(NV.Provider,{value:m,children:x})}),Uh=S$;function wk({className:e,...t}){return s.jsx(CV,{"data-slot":"select-group",className:Le("scroll-my-1 p-1",e),...t})}function Hh({className:e,...t}){return s.jsx(O$,{"data-slot":"select-value",className:Le("flex flex-1 text-left",e),...t})}function Fh({className:e,size:t="default",children:r,...a}){return s.jsxs(R$,{"data-slot":"select-trigger","data-size":t,className:Le("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[r,s.jsx(M$,{render:s.jsx(ko,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Gh({className:e,children:t,side:r="bottom",sideOffset:a=4,align:l="center",alignOffset:c=0,alignItemWithTrigger:u=!0,...f}){return s.jsx(D$,{children:s.jsx(oV,{side:r,sideOffset:a,align:l,alignOffset:c,alignItemWithTrigger:u,className:"isolate z-50",children:s.jsxs(hV,{"data-slot":"select-content","data-align-trigger":u,className:Le("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...f,children:[s.jsx(kV,{}),s.jsx(gV,{children:t}),s.jsx(TV,{})]})})})}function Td({className:e,children:t,...r}){return s.jsxs(xV,{"data-slot":"select-item",className:Le("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[s.jsx(vV,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),s.jsx(bV,{render:s.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:s.jsx(qn,{className:"pointer-events-none"})})]})}function kV({className:e,...t}){return s.jsx(SV,{"data-slot":"select-scroll-up-button",className:Le("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:s.jsx(kR,{})})}function TV({className:e,...t}){return s.jsx(jV,{"data-slot":"select-scroll-down-button",className:Le("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:s.jsx(ko,{})})}function cn({children:e,value:t,onChange:r,className:a,disabled:l,...c}){const u=h=>g.Children.toArray(h).join(""),f=g.Children.toArray(e).map(h=>({value:h.props.value??u(h.props.children),label:u(h.props.children),disabled:h.props.disabled}));return s.jsxs(Uh,{items:f,value:t,disabled:l,onValueChange:h=>r==null?void 0:r({target:{value:h}}),children:[s.jsx(Fh,{className:a,...c,children:s.jsx(Hh,{})}),s.jsx(Gh,{align:"start",alignItemWithTrigger:!1,children:f.map(h=>s.jsx(Td,{className:"text-xs",value:h.value,disabled:h.disabled,children:h.label},h.value))})]})}const D5=g.createContext(void 0);function Kl(e){const t=g.useContext(D5);if(!e&&t===void 0)throw new Error(Zt(27));return t}const U1=g.forwardRef(function(t,r){const{render:a,className:l,style:c,forceRender:u=!1,...f}=t,h=Kl(),m=h.useState("open"),x=h.useState("nested"),p=h.useState("mounted"),b=h.useState("transitionStatus");return Nt("div",t,{state:{open:m,transitionStatus:b},ref:[h.context.backdropRef,r],stateAttributesMapping:dg,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},f],enabled:u||!x})}),Lg=g.forwardRef(function(t,r){const{render:a,className:l,style:c,disabled:u=!1,nativeButton:f=!0,...h}=t,m=Kl(),x=m.useState("open"),{getButtonProps:p,buttonRef:b}=oo({disabled:u,native:f}),v={disabled:u};function j(S){x&&m.setOpen(!1,bt(NA,S.nativeEvent))}return Nt("button",t,{state:v,ref:[r,b],props:[{onClick:j},h,p]})}),H1=g.forwardRef(function(t,r){const{render:a,className:l,style:c,id:u,...f}=t,h=Kl(),m=ms(u);return h.useSyncedValueWithCleanup("descriptionElementId",m),Nt("p",t,{ref:r,props:[{id:m},f]})}),z5=g.createContext(void 0);function EV(){const e=g.useContext(z5);if(e===void 0)throw new Error(Zt(26));return e}const RV="--nested-dialogs",AV="data-nested-dialog-open",OV={...cf,...Fa,nestedDialogOpen(e){return e?{[AV]:""}:null}},F1=g.forwardRef(function(t,r){const{render:a,className:l,style:c,finalFocus:u,initialFocus:f,...h}=t,m=Kl(),x=m.useState("descriptionElementId"),p=m.useState("disablePointerDismissal"),b=m.useState("floatingRootContext"),v=m.useState("popupProps"),j=m.useState("modal"),S=m.useState("mounted"),N=m.useState("nested"),C=m.useState("nestedOpenDialogCount"),E=m.useState("open"),T=m.useState("openMethod"),O=m.useState("titleElementId"),k=m.useState("transitionStatus"),M=m.useState("role"),A=b.useState("floatingId");EV(),ir({open:E,ref:m.context.popupRef,onComplete(){var P,V;E&&((V=(P=m.context).onOpenChangeComplete)==null||V.call(P,!0))}});const R=f===void 0?a5(m.context.popupRef):f,z=C>0,_=m.useStateSetter("popupElement"),Y=Nt("div",t,{state:{open:E,nested:N,transitionStatus:k,nestedDialogOpen:z},props:[v,{id:A,"aria-labelledby":O,"aria-describedby":x,role:M,...gf,hidden:!S,onKeyDown(P){wf.has(P.key)&&P.stopPropagation()},style:{[RV]:C}},h],ref:[r,m.context.popupRef,_],stateAttributesMapping:OV});return s.jsx(wg,{context:b,openInteractionType:T,disabled:!S,closeOnFocusOut:!p,initialFocus:R,returnFocus:u,modal:j!==!1,restoreFocus:"popup",children:Y})}),G1=g.forwardRef(function(t,r){const{keepMounted:a=!1,...l}=t,c=Kl(),u=c.useState("mounted"),f=c.useState("modal"),h=c.useState("open");return u||a?s.jsx(z5.Provider,{value:a,children:s.jsxs(vg,{ref:r,...l,children:[u&&f===!0&&s.jsx(zg,{ref:c.context.internalBackdropRef,inert:bf(!h)}),t.children]})}):null});function MV({store:e,parentContext:t,isDrawer:r}){const a=e.useState("open"),l=e.useState("disablePointerDismissal"),c=e.useState("modal"),u=e.useState("popupElement"),f=e.useState("floatingRootContext"),[h,m]=g.useState(0),[x,p]=g.useState(0),b=h===0,v=pf(f,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(j){if(!e.context.outsidePressEnabledRef.current||"button"in j&&j.button!==0)return!1;if("touches"in j){if(j.type==="touchend"){if(j.changedTouches.length!==1||j.touches.length!==0)return!1}else if(j.touches.length!==1)return!1}const S=Ds(j);if(b&&!l){if(c){const N=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return N||C?N===S||C===S||pt(S,u)&&!(S!=null&&S.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:b});return A5(a&&c===!0,u),e.useContextCallback("onNestedDialogOpen",(j,S)=>{m(j),p(S)}),qe(()=>(t!=null&&t.onNestedDialogOpen&&(a?t.onNestedDialogOpen(h+1,x+(r?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&a&&t.onNestedDialogOpen(0,0)}),[r,a,h,x,t]),Tg(e,{activeTriggerProps:v.reference,inactiveTriggerProps:v.trigger,popupProps:v.floating,nestedOpenDialogCount:h,nestedOpenDrawerCount:x}),null}const DV={...Rg,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class zV extends bu{constructor(r,a,l){const c=new xf,u=PV(r,c,a,l);super(u,IV(c),DV);tn(this,"setOpen",(r,a)=>{var l,c;a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!r&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),(c=(l=this.context).onOpenChange)==null||c.call(l,r,a),!a.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(r,a),this.update(Ng(this.state,r,a.trigger)))})}}function PV(e,t,r,a=!1){return{...Eg(t,r,a),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function IV(e){return{popupRef:g.createRef(),backdropRef:g.createRef(),internalBackdropRef:g.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function P5(e,t){const{children:r,open:a,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:u,disablePointerDismissal:f=!1,modal:h=!0,actionsRef:m,handle:x,triggerId:p,defaultTriggerId:b=null}=t,v=e==="drawer",j=e==="alert-dialog",S=j?!0:h,N=j||f,C=j?"alertdialog":"dialog",E=Kl(!0),T=E!=null,O={modal:S,disablePointerDismissal:N,nested:T,role:C},k=E1((L,Y)=>new zV({open:l,openProp:a,activeTriggerId:b,triggerIdProp:p,...O},L,Y),!0);k.useControlledProp("openProp",a),k.useControlledProp("triggerIdProp",p),k.useSyncedValues(O),k.useContextCallback("onOpenChange",c),k.useContextCallback("onOpenChangeComplete",u);const M=k.useState("open"),A=k.useState("mounted"),R=k.useState("payload");i5(k,M),Cg(k);const{forceUnmount:z}=kg(M,k);g.useImperativeHandle(m,()=>({unmount:z,close:()=>k.setOpen(!1,bt(xg))}),[z,k]);const _=M||A;return s.jsxs(D5.Provider,{value:k,children:[x&&s.jsx(Sg,{handle:x,store:k}),_&&s.jsx(MV,{store:k,parentContext:E==null?void 0:E.context,isDrawer:v}),typeof r=="function"?r({payload:R}):r]})}const I5=hf(function(t){return P5("dialog",t)}),q1=g.forwardRef(function(t,r){const{render:a,className:l,style:c,id:u,...f}=t,h=Kl(),m=ms(u);return h.useSyncedValueWithCleanup("titleElementId",m),Nt("h2",t,{ref:r,props:[{id:m},f]})});function vn({...e}){return s.jsx(I5,{"data-slot":"dialog",...e})}function _V({...e}){return s.jsx(G1,{"data-slot":"dialog-portal",...e})}function LV({className:e,...t}){return s.jsx(U1,{"data-slot":"dialog-overlay",className:Le("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function wn({className:e,children:t,showCloseButton:r=!0,...a}){return s.jsxs(_V,{children:[s.jsx(LV,{}),s.jsxs(F1,{"data-slot":"dialog-content",className:Le("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[t,r&&s.jsxs(Lg,{"data-slot":"dialog-close",render:s.jsx(ce,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[s.jsx(En,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jn({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:Le("flex flex-col gap-2",e),...t})}function ea({className:e,showCloseButton:t=!1,children:r,...a}){return s.jsxs("div",{"data-slot":"dialog-footer",className:Le("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...a,children:[r,t&&s.jsx(Lg,{render:s.jsx(ce,{variant:"outline"}),children:"Close"})]})}function bn({className:e,...t}){return s.jsx(q1,{"data-slot":"dialog-title",className:Le("font-heading text-base leading-none font-medium",e),...t})}function _n({className:e,...t}){return s.jsx(H1,{"data-slot":"dialog-description",className:Le("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const _5=g.createContext(void 0);function Y1(){const e=g.useContext(_5);if(e===void 0)throw new Error(Zt(64));return e}const BV="data-activation-direction",Bg={tabActivationDirection:e=>({[BV]:e})},$V=g.forwardRef(function(t,r){const{className:a,defaultValue:l=0,onValueChange:c,orientation:u="horizontal",render:f,value:h,style:m,...x}=t,p=t.defaultValue!==void 0,b=g.useRef([]),[v,j]=g.useState(()=>new Map),[S,N]=Wr({controlled:h,default:l,name:"Tabs",state:"value"}),C=h!==void 0,[E,T]=g.useState(()=>new Map),O=g.useRef(void 0),k=g.useCallback(se=>av(E,se),[E]),[M,A]=g.useState(()=>({previousValue:S,tabActivationDirection:"none"})),{previousValue:R,tabActivationDirection:z}=M;let _=z,L=!1;R!==S&&(_=jk(R,S,u,E),L=R!=null&&S!=null&&k(S)==null);const Y=L?R:S,P=R!==Y||z!==_;qe(()=>{P&&A({previousValue:Y,tabActivationDirection:_})},[Y,P,_]);const V=Ze((se,ee)=>{const ne=jk(S,se,u,E);ee.activationDirection=ne,c==null||c(se,ee),!ee.isCanceled&&N(se)}),U=Ze((se,ee)=>{c==null||c(se,bt(ee,void 0,void 0,{activationDirection:"none"}))}),H=Ze((se,ee)=>(j(ne=>{const ie=new Map(ne);return ie.set(se,ee),ie}),()=>{j(ne=>{if(ne.get(se)!==ee)return ne;const ie=new Map(ne);return ie.delete(se),ie})})),F=g.useCallback(se=>v.get(se),[v]),q=g.useCallback(se=>{for(const ee of E.values())if(se===ee.value)return ee.id},[E]),W=g.useMemo(()=>({getTabElementBySelectedValue:k,getTabIdByPanelValue:q,getTabPanelIdByValue:F,onValueChange:V,orientation:u,registerMountedTabPanel:H,setTabMap:T,tabActivationDirection:_,value:S}),[k,q,F,V,u,H,T,_,S]),B=g.useMemo(()=>{for(const se of E.values())if(se.value===S)return se},[E,S]),J=g.useMemo(()=>{for(const se of E.values())if(!se.disabled)return se.value},[E]),X=g.useRef(!p),re=g.useRef(l),I=g.useRef(p),$=g.useRef(!1);qe(()=>{var oe;if(C)return;function se(Z,de){N(Z),A({previousValue:Z,tabActivationDirection:"none"}),U(Z,de),X.current=!1}if(E.size===0){$.current&&S!==null&&!((oe=O.current)!=null&&oe.isConnected)&&se(null,OC);return}$.current=!0,O.current=E.keys().next().value;const ee=B==null?void 0:B.disabled,ne=B==null&&S!==null;if(!ee&&S===re.current&&(I.current=!1),I.current&&ee&&S===re.current)return;const ie=X.current;if(ee||ne){const Z=J??null;if(S===Z){X.current=!1;return}let de=OC;ie?de=MC:ee&&(de=kA),se(Z,de);return}ie&&B!=null&&(U(S,MC),X.current=!1)},[J,C,U,B,N,E,S]);const G=Nt("div",t,{state:{orientation:u,tabActivationDirection:_},ref:r,props:x,stateAttributesMapping:Bg});return s.jsx(_5.Provider,{value:W,children:s.jsx(yf,{elementsRef:b,children:G})})});function av(e,t){for(const[r,a]of e.entries())if(t===a.value)return r;return null}function jk(e,t,r,a){if(e==null||t==null)return"none";const[l,c,u]=r==="horizontal"?["left","left","right"]:["top","up","down"],f=av(a,e),h=av(a,t);if(f==null||h==null)return f!==h&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?u:c:"none";const m=f.getBoundingClientRect()[l],x=h.getBoundingClientRect()[l];return x<m?c:x>m?u:"none"}const K1="data-composite-item-active";function L5(e={}){const{highlightItemOnHover:t,highlightedIndex:r,onHighlightedIndexChange:a}=sg(),{ref:l,index:c}=Yl(e),u=r===c,f=g.useRef(null),h=Yr(l,f);return{compositeProps:{tabIndex:u?0:-1,onFocus(){a(c)},onMouseMove(){const x=f.current;if(!t||!x)return;const p=x.hasAttribute("disabled")||x.ariaDisabled==="true";!u&&!p&&x.focus()}},compositeRef:h,index:c}}const B5=g.createContext(void 0);function VV(){const e=g.useContext(B5);if(e===void 0)throw new Error(Zt(65));return e}const UV=g.forwardRef(function(t,r){const{className:a,disabled:l=!1,render:c,value:u,id:f,nativeButton:h=!0,style:m,...x}=t,{value:p,getTabPanelIdByValue:b,onValueChange:v,orientation:j,tabActivationDirection:S}=Y1(),{activateOnFocus:N,registerTabResizeObserverElement:C,tabsListElement:E}=VV(),{highlightedIndex:T,onHighlightedIndexChange:O}=sg(),k=ms(f),M=g.useMemo(()=>({disabled:l,id:k,value:u}),[l,k,u]),{compositeProps:A,compositeRef:R,index:z}=L5({metadata:M}),_=u===p,L=g.useRef(!1),Y=g.useRef(null),P=Ze($=>{var Q;(Q=Y.current)==null||Q.call(Y),Y.current=$?C($):null});qe(()=>{if(L.current){L.current=!1;return}if(!(_&&z>-1&&T!==z))return;const $=E;if($!=null){const Q=_s(Ft($));if(Q&&pt($,Q))return}l||O(z)},[_,z,T,O,l,E]);const{getButtonProps:V,buttonRef:U}=oo({disabled:l,native:h,focusableWhenDisabled:!0}),H=b(u),F=g.useRef(!1),q=g.useRef(!1);function W($){v(u,bt(Tr,$.nativeEvent,void 0,{activationDirection:"none"}))}function B($){_||l||W($)}function J($){_||l||N&&(!F.current||q.current)&&W($)}function X($){if(_||l)return;F.current=!0,q.current=$.button===0;const Q=Ft($.currentTarget);function G(){F.current=!1,q.current=!1,Q.removeEventListener("pointerup",G),Q.removeEventListener("pointercancel",G)}Q.addEventListener("pointerup",G),Q.addEventListener("pointercancel",G)}return Nt("button",t,{state:{disabled:l,active:_,orientation:j,tabActivationDirection:S},ref:[r,U,R,P],props:[A,{role:"tab","aria-controls":H,"aria-selected":_,id:k,onClick:B,onFocus:J,onPointerDown:X,[K1]:_?"":void 0,onKeyDownCapture(){L.current=!0}},x,V],stateAttributesMapping:Bg})}),HV="data-index",FV={...Bg,...Fa},GV=g.forwardRef(function(t,r){const{className:a,value:l,render:c,keepMounted:u=!1,style:f,...h}=t,{value:m,getTabIdByPanelValue:x,orientation:p,tabActivationDirection:b,registerMountedTabPanel:v}=Y1(),j=ms(),{ref:S,index:N}=Yl(),C=l===m,{mounted:E,transitionStatus:T,setMounted:O}=Ga(C),k=!E,M=x(l),A={hidden:k,orientation:p,tabActivationDirection:b,transitionStatus:T},R=g.useRef(null),z=Nt("div",t,{state:A,ref:[r,S,R],props:[{"aria-labelledby":M,hidden:k,id:j,role:"tabpanel",tabIndex:C?0:-1,inert:bf(!C),[HV]:N},h],stateAttributesMapping:FV});return ir({open:C,ref:R,onComplete(){C||O(!1)}}),qe(()=>{if(!(j==null||k&&!u))return v(l,j)},[k,u,l,j,v]),u||E?z:null});function qV(e){const{loopFocus:t=!0,orientation:r="both",grid:a,onLoop:l,direction:c,highlightedIndex:u,onHighlightedIndexChange:f,rootRef:h,enableHomeAndEndKeys:m=!1,stopEventPropagation:x,disabledIndices:p,modifierKeys:b=kr}=e,[v,j]=g.useState(0),S=a!=null,N=g.useRef(null),C=Yr(N,h),E=g.useRef([]),T=g.useRef(!1),O=g.useRef(null),k=u??v,M=Ze((L,Y=!1)=>{if(O.current=E.current[L]??null,(f??j)(L),Y){const P=E.current[L];pk(N.current,P,c,r)}}),A=Ze(L=>{var U;if(L.size===0)return;if(T.current){const H=E.current,F=H.indexOf(O.current);if(F===-1){const q=H[k];!q||Xc(H,k,p)?M(YV(H,p)):O.current=q}else F!==k&&M(F);return}T.current=!0;const Y=Array.from(L.keys()),P=Y.find(H=>H==null?void 0:H.hasAttribute(K1))??null,V=P?((U=L.get(P))==null?void 0:U.index)??-1:-1;if(V!==-1)M(V);else if(Xc(Y,k,p)){const H=Ca(Y,{disabledIndices:p});Ad(Y,H)||M(H)}pk(N.current,P,c,r)});qe(()=>{if(p==null||u!=null||!T.current)return;const L=E.current;if(Xc(L,k,p)){const Y=Ca(L,{disabledIndices:p});Ad(L,Y)||M(Y)}},[p,u,k,E,M]);const R=Ze((L,Y,P)=>l?l(L,Y,P,E):P),z=Ze(L=>{const Y=L.key===rv||L.key===ov;if(!wf.has(L.key)||!m&&Y||KV(L,b)||!N.current)return;const V=c==="rtl",U=V?nv:sv,H=V?sv:nv,F=r==="vertical"?tv:U,q=r==="vertical"?ev:H,W=Ds(L.nativeEvent);if(W!=null&&hk(W)&&!zA(W)){const $=W.selectionStart,Q=W.selectionEnd,G=W.value;if($==null||L.shiftKey||$!==Q||L.key!==q&&$<G.length||L.key!==F&&$>0)return}let B=k;const J=Lh(E,p),X=Hy(E,p);a!=null&&(B=a({disabledIndices:p,elementsRef:E,event:L,highlightedIndex:k,loopFocus:t,maxIndex:X,minIndex:J,onLoop:R,orientation:r,rtl:V}));const re=r!=="vertical"&&L.key===U||r!=="horizontal"&&L.key===tv,I=r!=="vertical"&&L.key===H||r!=="horizontal"&&L.key===ev;m&&(L.key===rv?B=J:L.key===ov&&(B=X)),B===k&&(re||I)&&(t&&B===X&&re?(B=J,l&&(B=l(L,k,B,E))):t&&B===J&&I?(B=X,l&&(B=l(L,k,B,E))):B=Ca(E.current,{startingIndex:B,decrement:I,disabledIndices:p})),B!==k&&!Ad(E.current,B)&&(x&&L.stopPropagation(),(S||Y||re||I)&&L.preventDefault(),M(B,!0),queueMicrotask(()=>{var $;($=E.current[B])==null||$.focus()}))});return{props:{ref:C,onFocus(L){const Y=N.current,P=Ds(L.nativeEvent);!Y||P==null||!hk(P)||P.setSelectionRange(0,P.value.length)},onKeyDown:z},highlightedIndex:k,onHighlightedIndexChange:M,elementsRef:E,onMapChange:A,relayKeyboardEvent:z}}function YV(e,t){let r=-1;for(let a=0;a<e.length;a+=1){const l=e[a];if(!(!l||Xc(e,a,t))){if(l.hasAttribute(K1))return a;r===-1&&(r=a)}}return Math.max(r,0)}function KV(e,t){for(const r of lV)if(!t.includes(r)&&e.getModifierState(r))return!0;return!1}function $5(e){const{render:t,className:r,style:a,refs:l=kr,props:c=kr,state:u=gn,stateAttributesMapping:f,highlightedIndex:h,onHighlightedIndexChange:m,orientation:x,grid:p,loopFocus:b,onLoop:v,enableHomeAndEndKeys:j,onMapChange:S,stopEventPropagation:N=!0,rootRef:C,disabledIndices:E,modifierKeys:T,highlightItemOnHover:O=!1,tag:k="div",...M}=e,A=Mg(),{props:R,highlightedIndex:z,onHighlightedIndexChange:_,elementsRef:L,onMapChange:Y,relayKeyboardEvent:P}=qV({grid:p,loopFocus:b,onLoop:v,orientation:x,highlightedIndex:h,onHighlightedIndexChange:m,rootRef:C,stopEventPropagation:N,enableHomeAndEndKeys:j,direction:A,disabledIndices:E,modifierKeys:T}),V=Nt(k,e,{state:u,ref:l,props:[R,...c,M],stateAttributesMapping:f}),U=g.useMemo(()=>({highlightedIndex:z,onHighlightedIndexChange:_,highlightItemOnHover:O,relayKeyboardEvent:P}),[z,_,O,P]);return s.jsx(UR.Provider,{value:U,children:s.jsx(yf,{elementsRef:L,onMapChange:H=>{S==null||S(H),Y(H)},children:V})})}const XV=g.forwardRef(function(t,r){const{activateOnFocus:a=!1,className:l,loopFocus:c=!0,render:u,style:f,...h}=t,{orientation:m,setTabMap:x,tabActivationDirection:p}=Y1(),[b,v]=g.useState(0),[j,S]=g.useState(null),N=g.useRef(new Set),C=g.useRef(new Set),E=g.useRef(null);qe(()=>{if(typeof ResizeObserver>"u")return;const R=new ResizeObserver(()=>{N.current.forEach(z=>{z()})});return E.current=R,j&&R.observe(j),C.current.forEach(z=>{R.observe(z)}),()=>{R.disconnect(),E.current=null}},[j]);const T=Ze(R=>(N.current.add(R),()=>{N.current.delete(R)})),O=Ze(R=>{var z;return C.current.add(R),(z=E.current)==null||z.observe(R),()=>{var _;C.current.delete(R),(_=E.current)==null||_.unobserve(R)}}),k={orientation:m,tabActivationDirection:p},M={"aria-orientation":m==="vertical"?"vertical":void 0,role:"tablist"},A=g.useMemo(()=>({activateOnFocus:a,registerIndicatorUpdateListener:T,registerTabResizeObserverElement:O,tabsListElement:j}),[a,T,O,j]);return s.jsx(B5.Provider,{value:A,children:s.jsx($5,{render:u,className:l,style:f,state:k,refs:[r,S],props:[M,h],stateAttributesMapping:Bg,highlightedIndex:b,enableHomeAndEndKeys:!0,loopFocus:c,orientation:m,onHighlightedIndexChange:v,onMapChange:x,disabledIndices:kr})})});function jf({className:e,orientation:t="horizontal",...r}){return s.jsx($V,{"data-slot":"tabs","data-orientation":t,className:Le("group/tabs flex gap-2 data-horizontal:flex-col",e),...r})}const WV=rg("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Sf({className:e,variant:t="default",...r}){return s.jsx(XV,{"data-slot":"tabs-list","data-variant":t,className:Le(WV({variant:t}),e),...r})}function jr({className:e,...t}){return s.jsx(UV,{"data-slot":"tabs-trigger",className:Le("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function yo({className:e,...t}){return s.jsx(GV,{"data-slot":"tabs-content",className:Le("flex-1 text-sm outline-none",e),...t})}const V5=g.createContext(void 0);function U5(){const e=g.useContext(V5);if(e===void 0)throw new Error(Zt(10));return e}const QV={value:()=>null},ZV=g.forwardRef(function(t,r){const{render:a,className:l,disabled:c=!1,hiddenUntilFound:u,keepMounted:f,loopFocus:h,onValueChange:m,multiple:x=!1,orientation:p="vertical",value:b,defaultValue:v,style:j,...S}=t,N=v??kr,C=g.useRef([]),[E,T]=Wr({controlled:b,default:N,name:"Accordion",state:"value"}),O=Ze((R,z,_)=>{if(x)if(z){const L=E.slice();if(L.push(R),m==null||m(L,_),_.isCanceled)return;T(L)}else{const L=E.filter(Y=>Y!==R);if(m==null||m(L,_),_.isCanceled)return;T(L)}else{const L=E[0]===R?[]:[R];if(m==null||m(L,_),_.isCanceled)return;T(L)}}),k=g.useMemo(()=>({value:E,disabled:c,orientation:p}),[E,c,p]),M=g.useMemo(()=>({disabled:c,handleValueChange:O,hiddenUntilFound:u??!1,keepMounted:f??!1,state:k,value:E}),[c,O,u,f,k,E]),A=Nt("div",t,{state:k,ref:r,props:S,stateAttributesMapping:QV});return s.jsx(V5.Provider,{value:M,children:s.jsx(yf,{elementsRef:C,children:A})})});function JV(e){const{open:t,defaultOpen:r=!1,onOpenChange:a,disabled:l}=e,[c,u]=Wr({controlled:t,default:r,name:"Collapsible",state:"open"}),{mounted:f,setMounted:h,transitionStatus:m}=Ga(c,!0,!0),x=ms(),[p,b]=g.useState(),v=p===null?void 0:p??x,j=Ze(S=>{const N=!c,C=bt(Jo,S.nativeEvent);a(N,C),!C.isCanceled&&u(N)});return g.useMemo(()=>({defaultPanelId:x,disabled:l,handleTrigger:j,mounted:f,open:c,panelId:v,setMounted:h,setOpen:u,setPanelIdState:b,transitionStatus:m}),[x,l,j,f,c,v,h,u,b,m])}const H5=g.createContext(void 0);function F5(){const e=g.useContext(H5);if(e===void 0)throw new Error(Zt(15));return e}const G5=g.createContext(void 0);function X1(){const e=g.useContext(G5);if(e===void 0)throw new Error(Zt(9));return e}const e7="data-open",t7="data-closed",n7=c1,s7="data-panel-open",r7={[e7]:""},o7={[t7]:""},a7={open(e){return e?{[s7]:""}:null}},i7={open(e){return e?r7:o7}},l7="data-index",W1={...i7,index:e=>({[l7]:String(e)}),...Fa,value:()=>null},c7=g.forwardRef(function(t,r){const{className:a,disabled:l=!1,onOpenChange:c,render:u,value:f,style:h,...m}=t,{ref:x,index:p}=Yl(),b=Yr(r,x),{disabled:v,handleValueChange:j,state:S,value:N}=U5(),C=ms(),E=f??C,T=l||v,O=N.indexOf(E)!==-1,k=Ze((H,F)=>{c==null||c(H,F),!F.isCanceled&&j(E,H,F)}),M=JV({open:O,onOpenChange:k,disabled:T}),A=g.useMemo(()=>({open:M.open,disabled:M.disabled,transitionStatus:M.transitionStatus}),[M.open,M.disabled,M.transitionStatus]),R=g.useMemo(()=>({...M,onOpenChange:k,state:A}),[M,A,k]),z=g.useMemo(()=>({...S,hidden:!O&&!M.mounted,index:p,disabled:T,open:O}),[M.mounted,T,p,O,S]),_=ms(),[L,Y]=g.useState(),P=L===null?void 0:L??_,V=g.useMemo(()=>({defaultTriggerId:_,open:O,state:z,setTriggerId:Y,triggerId:P}),[_,O,z,Y,P]),U=Nt("div",t,{state:z,ref:b,props:m,stateAttributesMapping:W1});return s.jsx(H5.Provider,{value:R,children:s.jsx(G5.Provider,{value:V,children:U})})}),u7=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,{state:f}=X1();return Nt("h3",t,{state:f,ref:r,props:u,stateAttributesMapping:W1})}),d7=g.forwardRef(function(t,r){const{disabled:a,className:l,id:c,render:u,nativeButton:f=!0,style:h,...m}=t,{panelId:x,open:p,handleTrigger:b,disabled:v}=F5(),j=a||v,{getButtonProps:S,buttonRef:N}=oo({disabled:j,focusableWhenDisabled:!0,native:f}),{defaultTriggerId:C,state:E,setTriggerId:T}=X1(),O=c||void 0,k=O??C;return qe(()=>(T(R=>O??(R===null?void 0:R)),()=>{T(R=>R===O?null:R)}),[O,T]),Nt("button",t,{state:E,ref:[r,N],props:[{"aria-controls":p?x:void 0,"aria-expanded":p,id:k,onClick:b},m,S],stateAttributesMapping:a7})}),vd={height:void 0,width:void 0};function f7(e){const{externalRef:t,hiddenUntilFound:r,id:a,keepMounted:l,mounted:c,onOpenChange:u,open:f,setMounted:h,setOpen:m,transitionStatus:x}=e,p=g.useRef(null),b=g.useRef(null),[v,j]=g.useState(vd),S=g.useRef(vd),N=g.useRef(!1),C=g.useRef(f),E=g.useRef(!1),[T,O]=g.useState(!1),k=g.useRef(null),M=Yr(t,p),A=In(f),R=df(p),z=!f&&!c,_=T?"idle":x,L=f&&(C.current||E.current),Y=!f&&c&&b.current==="css-animation"&&v.height===void 0&&v.width===void 0?S.current:v,P=r&&z&&b.current!=="css-animation",V=Ze((W,B=!0)=>{B&&(S.current=W),j(W)}),U=Ze(()=>{var W;(W=k.current)==null||W.call(k),k.current=null}),H=Ze(W=>{U(),k.current=()=>{k.current=null,W()}}),F=Ze(()=>{f&&c&&b.current==="css-animation"&&(E.current=!0)});qe(()=>{!T||x==="starting"||O(!1)},[T,x]),g.useEffect(()=>()=>{F(),U()},[F,U]),qe(()=>{const W=p.current;if(!W)return;!f&&k.current&&U();const B=m7(W,L);if(b.current=B,f&&x==="idle"&&C.current&&B==="css-animation"){S.current=Bc(W);return}if(f&&x==="starting"){const re=N.current;if(N.current=!1,B==="none"){V(Bc(W)),O(!0);return}if(B==="css-transition"){const Q=h7(W);if(V(Bc(W)),!re)return Q;const G=gh(W,"transition-duration","0s");return H(G),O(!0),Q}V(Bc(W));const I=gh(W,"animation-name","none");if(!re){I();return}const $=gh(W,"animation-duration","0s");I(),H($),O(!0);return}if(!f&&c&&(x==="idle"||x==="starting")){if(C.current=!1,E.current=!1,B==="none"){V(vd,!1),h(!1);return}V(Bc(W));return}if(x!=="ending")return;if(B==="none"){h(!1);return}const J=Bc(W);if(!(J.height>0||J.width>0)){h(!1);return}V(J),B==="css-animation"&&gh(W,"animation-name","none")()},[c,f,U,V,h,H,L,x]),ir({enabled:f&&c&&_==="idle",open:!0,ref:p,onComplete(){f&&V(vd,!1)}}),g.useEffect(()=>{if(f||!c||_!=="ending"||!p.current)return;const B=new AbortController;let J=-1;function X(){A.current||(h(!1),V(vd,!1))}return J=ar.request(()=>{R(X,B.signal)}),()=>{ar.cancel(J),B.abort()}},[A,c,f,_,R,V,h]),qe(()=>{const W=p.current;!W||!r||!z||W.setAttribute("hidden","until-found")},[z,r]),g.useEffect(function(){const B=p.current;if(!B)return;function J(X){const re=bt(Tr,X);u(!0,re),!re.isCanceled&&(N.current=!0,m(!0))}return Lt(B,"beforematch",J)},[u,m]);const q=l||r||c||f;return{height:Y.height,props:{...P?{[n7]:""}:void 0,hidden:z,id:a},ref:M,shouldPreventOpenAnimation:L,shouldRender:q,transitionStatus:_,width:Y.width}}function Bc(e){return{height:e.scrollHeight,width:e.scrollWidth}}function m7(e,t){const r=xn(e).getComputedStyle(e),a=(r.animationName.split(",").map(c=>c.trim()).some(c=>c!==""&&c!=="none")||t)&&Sk(r.animationDuration),l=Sk(r.transitionDuration);return a&&l||l?"css-transition":a?"css-animation":"none"}function Sk(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function gh(e,t,r){const a=e.style.getPropertyValue(t),l=e.style.getPropertyPriority(t);return e.style.setProperty(t,r),()=>{if(a===""){e.style.removeProperty(t);return}e.style.setProperty(t,a,l)}}function h7(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(l=>{e.style.setProperty(l,"initial","important")});function r(){Object.entries(t).forEach(([l,c])=>{if(c===""){e.style.removeProperty(l);return}e.style.setProperty(l,c)})}const a=ar.request(r);return()=>{ar.cancel(a),r()}}const p7="--accordion-panel-height",g7="--accordion-panel-width",x7=g.forwardRef(function(t,r){const{className:a,hiddenUntilFound:l,keepMounted:c,id:u,render:f,style:h,...m}=t,{hiddenUntilFound:x,keepMounted:p}=U5(),{defaultPanelId:b,mounted:v,onOpenChange:j,open:S,setMounted:N,setOpen:C,setPanelIdState:E,transitionStatus:T}=F5(),O=l??x,k=c??p,M=u||void 0,A=u??b;qe(()=>(E(B=>M??(B===null?void 0:B)),()=>{E(B=>B===M?null:B)}),[M,E]);const{height:R,props:z,ref:_,shouldPreventOpenAnimation:L,shouldRender:Y,transitionStatus:P,width:V}=f7({externalRef:r,hiddenUntilFound:O,id:A,keepMounted:k,mounted:v,onOpenChange:j,open:S,setMounted:N,setOpen:C,transitionStatus:T}),{state:U,triggerId:H}=X1(),F={...U,transitionStatus:P},q=GR(h,F),W=Nt("div",{...t,style:void 0},{state:F,ref:_,props:[z,{"aria-labelledby":H,role:"region",style:{[p7]:R===void 0?"auto":`${R}px`,[g7]:V===void 0?"auto":`${V}px`}},m,q?{style:q}:void 0,L?{style:{animationName:"none"}}:void 0],stateAttributesMapping:W1});return Y?W:null});function b7({className:e,...t}){return s.jsx(ZV,{"data-slot":"accordion",className:Le("flex w-full flex-col",e),...t})}function y7({className:e,...t}){return s.jsx(c7,{"data-slot":"accordion-item",className:Le("not-last:border-b",e),...t})}function v7({className:e,children:t,...r}){return s.jsx(u7,{className:"flex",children:s.jsxs(d7,{"data-slot":"accordion-trigger",className:Le("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",e),...r,children:[t,s.jsx(ko,{"data-slot":"accordion-trigger-icon",className:"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"}),s.jsx(kR,{"data-slot":"accordion-trigger-icon",className:"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"})]})})}function w7({className:e,children:t,...r}){return s.jsx(x7,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",...r,children:s.jsx("div",{className:Le("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),children:t})})}const Q1=g.createContext({});function Nf(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const j7=typeof window<"u",cu=j7?g.useLayoutEffect:g.useEffect,$g=g.createContext(null);function Z1(e,t){e.indexOf(t)===-1&&e.push(t)}function kp(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const To=(e,t,r)=>r>t?t:r<e?e:r;let Vg=()=>{};const za={},J1=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),q5=e=>typeof e=="object"&&e!==null,ew=e=>/^0[^.\s]+$/u.test(e);function Y5(e){let t;return()=>(t===void 0&&(t=e()),t)}const jo=e=>e,Cf=(...e)=>e.reduce((t,r)=>a=>r(t(a))),Gd=(e,t,r)=>{const a=t-e;return a?(r-e)/a:1};class Tp{constructor(){this.subscriptions=[]}add(t){return Z1(this.subscriptions,t),()=>this.remove(t)}remove(t){kp(this.subscriptions,t)}notify(t,r,a){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](t,r,a);else for(let c=0;c<l;c++){const u=this.subscriptions[c];u&&u(t,r,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Gr=e=>e*1e3,Sr=e=>e/1e3,K5=(e,t)=>t?e*(1e3/t):0,X5=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,S7=1e-7,N7=12;function C7(e,t,r,a,l){let c,u,f=0;do u=t+(r-t)/2,c=X5(u,a,l)-e,c>0?r=u:t=u;while(Math.abs(c)>S7&&++f<N7);return u}function kf(e,t,r,a){if(e===t&&r===a)return jo;const l=c=>C7(c,0,1,e,r);return c=>c===0||c===1?c:X5(l(c),t,a)}const W5=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Q5=e=>t=>1-e(1-t),Z5=kf(.33,1.53,.69,.99),tw=Q5(Z5),J5=W5(tw),eO=e=>e>=1?1:(e*=2)<1?.5*tw(e):.5*(2-Math.pow(2,-10*(e-1))),nw=e=>1-Math.sin(Math.acos(e)),tO=Q5(nw),nO=W5(nw),k7=kf(.42,0,1,1),T7=kf(0,0,.58,1),sw=kf(.42,0,.58,1),E7=e=>Array.isArray(e)&&typeof e[0]!="number",sO=e=>Array.isArray(e)&&typeof e[0]=="number",R7={linear:jo,easeIn:k7,easeInOut:sw,easeOut:T7,circIn:nw,circInOut:nO,circOut:tO,backIn:tw,backInOut:J5,backOut:Z5,anticipate:eO},A7=e=>typeof e=="string",Nk=e=>{if(sO(e)){Vg(e.length===4);const[t,r,a,l]=e;return kf(t,r,a,l)}else if(A7(e))return R7[e];return e},xh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function O7(e){let t=new Set,r=new Set,a=!1,l=!1;const c=new Set;let u={delta:0,timestamp:0,isProcessing:!1};function f(m){c.has(m)&&(r.add(m),e()),m(u)}const h={schedule:(m,x=!1,p=!1)=>{const v=p&&a?t:r;return x&&c.add(m),v.add(m),m},cancel:m=>{r.delete(m),c.delete(m)},process:m=>{if(u=m,a){l=!0;return}a=!0;const x=t;t=r,r=x,t.forEach(f),t.clear(),a=!1,l&&(l=!1,h.process(m))}};return h}const M7=40;function rO(e,t){let r=!1,a=!0;const l={delta:0,timestamp:0,isProcessing:!1},c=()=>r=!0,u=xh.reduce((T,O)=>(T[O]=O7(c),T),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:x,update:p,preRender:b,render:v,postRender:j}=u,S=()=>{const T=za.useManualTiming,O=T?l.timestamp:performance.now();r=!1,T||(l.delta=a?1e3/60:Math.max(Math.min(O-l.timestamp,M7),1)),l.timestamp=O,l.isProcessing=!0,f.process(l),h.process(l),m.process(l),x.process(l),p.process(l),b.process(l),v.process(l),j.process(l),l.isProcessing=!1,r&&t&&(a=!1,e(S))},N=()=>{r=!0,a=!0,l.isProcessing||e(S)};return{schedule:xh.reduce((T,O)=>{const k=u[O];return T[O]=(M,A=!1,R=!1)=>(r||N(),k.schedule(M,A,R)),T},{}),cancel:T=>{for(let O=0;O<xh.length;O++)u[xh[O]].cancel(T)},state:l,steps:u}}const{schedule:dn,cancel:ta,state:vs,steps:G0}=rO(typeof requestAnimationFrame<"u"?requestAnimationFrame:jo,!0);let qh;function D7(){qh=void 0}const js={now:()=>(qh===void 0&&js.set(vs.isProcessing||za.useManualTiming?vs.timestamp:performance.now()),qh),set:e=>{qh=e,queueMicrotask(D7)}},Jc=e=>Math.round(e*1e5)/1e5,oO=e=>t=>typeof t=="string"&&t.startsWith(e),aO=oO("--"),z7=oO("var(--"),rw=e=>z7(e)?P7.test(e.split("/*")[0].trim()):!1,P7=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ck(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const yu={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},qd={...yu,transform:e=>To(0,1,e)},bh={...yu,default:1},ow=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function I7(e){return e==null}const _7=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,aw=(e,t)=>r=>!!(typeof r=="string"&&_7.test(r)&&r.startsWith(e)||t&&!I7(r)&&Object.prototype.hasOwnProperty.call(r,t)),iO=(e,t,r)=>a=>{if(typeof a!="string")return a;const[l,c,u,f]=a.match(ow);return{[e]:parseFloat(l),[t]:parseFloat(c),[r]:parseFloat(u),alpha:f!==void 0?parseFloat(f):1}},L7=e=>To(0,255,e),q0={...yu,transform:e=>Math.round(L7(e))},El={test:aw("rgb","red"),parse:iO("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:a=1})=>"rgba("+q0.transform(e)+", "+q0.transform(t)+", "+q0.transform(r)+", "+Jc(qd.transform(a))+")"};function B7(e){let t="",r="",a="",l="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),a=e.substring(5,7),l=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),a=e.substring(3,4),l=e.substring(4,5),t+=t,r+=r,a+=a,l+=l),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(a,16),alpha:l?parseInt(l,16)/255:1}}const iv={test:aw("#"),parse:B7,transform:El.transform},Tf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wa=Tf("deg"),Wo=Tf("%"),ft=Tf("px"),$7=Tf("vh"),V7=Tf("vw"),kk={...Wo,parse:e=>Wo.parse(e)/100,transform:e=>Wo.transform(e*100)},Hc={test:aw("hsl","hue"),parse:iO("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+Wo.transform(Jc(t))+", "+Wo.transform(Jc(r))+", "+Jc(qd.transform(a))+")"},is={test:e=>El.test(e)||iv.test(e)||Hc.test(e),parse:e=>El.test(e)?El.parse(e):Hc.test(e)?Hc.parse(e):iv.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?El.transform(e):Hc.transform(e),getAnimatableNone:e=>{const t=is.parse(e);return t.alpha=0,is.transform(t)}},U7=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,lO=new RegExp(ow.source),cO=new RegExp(U7.source,"i");function H7(e){return isNaN(e)&&typeof e=="string"&&(lO.test(e)||cO.test(e))}const uO="number",dO="color",F7="var",G7="var(",Tk="${}",q7=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y7(e){const t=e.toString();return lO.test(t)||cO.test(t)}function Yd(e){const t=e.toString(),r=[],a={color:[],number:[],var:[]},l=[];let c=0;const f=t.replace(q7,h=>(is.test(h)?(a.color.push(c),l.push(dO),r.push(is.parse(h))):h.startsWith(G7)?(a.var.push(c),l.push(F7),r.push(h)):(a.number.push(c),l.push(uO),r.push(parseFloat(h))),++c,Tk)).split(Tk);return{values:r,split:f,indexes:a,types:l}}function K7(e){return Yd(e).values}function fO({split:e,types:t}){const r=e.length;return a=>{let l="";for(let c=0;c<r;c++)if(l+=e[c],a[c]!==void 0){const u=t[c];u===uO?l+=Jc(a[c]):u===dO?l+=is.transform(a[c]):l+=a[c]}return l}}function X7(e){return fO(Yd(e))}const W7=e=>typeof e=="number"?0:is.test(e)?is.getAnimatableNone(e):e,Q7=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:W7(e);function Z7(e){const t=Yd(e);return fO(t)(t.values.map((a,l)=>Q7(a,t.split[l])))}const Nr={test:H7,parse:K7,createTransformer:X7,getAnimatableNone:Z7};function Y0(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function J7({hue:e,saturation:t,lightness:r,alpha:a}){e/=360,t/=100,r/=100;let l=0,c=0,u=0;if(!t)l=c=u=r;else{const f=r<.5?r*(1+t):r+t-r*t,h=2*r-f;l=Y0(h,f,e+1/3),c=Y0(h,f,e),u=Y0(h,f,e-1/3)}return{red:Math.round(l*255),green:Math.round(c*255),blue:Math.round(u*255),alpha:a}}function Ep(e,t){return r=>r>0?t:e}const pn=(e,t,r)=>e+(t-e)*r,K0=(e,t,r)=>{const a=e*e,l=r*(t*t-a)+a;return l<0?0:Math.sqrt(l)},eU=[iv,El,Hc],tU=e=>eU.find(t=>t.test(e));function Ek(e){const t=tU(e);if(!t)return!1;let r=t.parse(e);return t===Hc&&(r=J7(r)),r}const Rk=(e,t)=>{const r=Ek(e),a=Ek(t);if(!r||!a)return Ep(e,t);const l={...r};return c=>(l.red=K0(r.red,a.red,c),l.green=K0(r.green,a.green,c),l.blue=K0(r.blue,a.blue,c),l.alpha=pn(r.alpha,a.alpha,c),El.transform(l))},lv=new Set(["none","hidden"]);function nU(e,t){return lv.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function sU(e,t){return r=>pn(e,t,r)}function iw(e){return typeof e=="number"?sU:typeof e=="string"?rw(e)?Ep:is.test(e)?Rk:aU:Array.isArray(e)?mO:typeof e=="object"?is.test(e)?Rk:rU:Ep}function mO(e,t){const r=[...e],a=r.length,l=e.map((c,u)=>iw(c)(c,t[u]));return c=>{for(let u=0;u<a;u++)r[u]=l[u](c);return r}}function rU(e,t){const r={...e,...t},a={};for(const l in r)e[l]!==void 0&&t[l]!==void 0&&(a[l]=iw(e[l])(e[l],t[l]));return l=>{for(const c in a)r[c]=a[c](l);return r}}function oU(e,t){const r=[],a={color:0,var:0,number:0};for(let l=0;l<t.values.length;l++){const c=t.types[l],u=e.indexes[c][a[c]],f=e.values[u]??0;r[l]=f,a[c]++}return r}const aU=(e,t)=>{const r=Nr.createTransformer(t),a=Yd(e),l=Yd(t);return a.indexes.var.length===l.indexes.var.length&&a.indexes.color.length===l.indexes.color.length&&a.indexes.number.length>=l.indexes.number.length?lv.has(e)&&!l.values.length||lv.has(t)&&!a.values.length?nU(e,t):Cf(mO(oU(a,l),l.values),r):Ep(e,t)},Ak=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function iU(e,t){const r=Ak.exec(e);if(!r)return;const a=Ak.exec(t);if(!a||r[2]!==a[2])return;const l=r[2],c=parseFloat(r[1]),u=parseFloat(a[1]);return f=>Jc(pn(c,u,f))+l}function lw(e,t,r){if(typeof e=="number"&&typeof t=="number"&&typeof r=="number")return pn(e,t,r);if(typeof e=="string"&&typeof t=="string"){const l=iU(e,t);if(l)return l}return iw(e)(e,t)}const lU=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>dn.update(t,r),stop:()=>ta(t),now:()=>vs.isProcessing?vs.timestamp:js.now()}},hO=(e,t,r=10)=>{let a="";const l=Math.max(Math.round(t/r),2);for(let c=0;c<l;c++)a+=Math.round(e(c/(l-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},cw=2e4;function uw(e,t=50,r=cw,a){let l=0,c=e.next(l);for(;!c.done&&l<r;)l+=t,c=e.next(l);return l>=r?1/0:l}function cU(e,t=100,r){const a=r({...e,keyframes:[0,t]}),l=Math.min(uw(a),cw);return{type:"keyframes",ease:c=>a.next(l*c).value/t,duration:Sr(l)}}const Pn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function cv(e,t){return e*Math.sqrt(1-t*t)}const uU=12;function dU(e,t,r){let a=r;for(let l=1;l<uU;l++)a=a-e(a)/t(a);return a}const X0=.001;function fU({duration:e=Pn.duration,bounce:t=Pn.bounce,velocity:r=Pn.velocity,mass:a=Pn.mass}){let l,c,u=1-t;u=To(Pn.minDamping,Pn.maxDamping,u),e=To(Pn.minDuration,Pn.maxDuration,Sr(e)),u<1?(l=m=>{const x=m*u,p=x*e,b=x-r,v=cv(m,u),j=Math.exp(-p);return X0-b/v*j},c=m=>{const p=m*u*e,b=p*r+r,v=u*u*m*m*e,j=Math.exp(-p),S=cv(m*m,u);return(-l(m)+X0>0?-1:1)*((b-v)*j)/S}):(l=m=>{const x=Math.exp(-m*e),p=(m-r)*e+1;return-X0+x*p},c=m=>{const x=Math.exp(-m*e),p=(r-m)*(e*e);return x*p});const f=5/e,h=dU(l,c,f);if(e=Gr(e),isNaN(h))return{stiffness:Pn.stiffness,damping:Pn.damping,duration:e};{const m=h*h*a;return{stiffness:m,damping:u*2*Math.sqrt(a*m),duration:e}}}const mU=["duration","bounce"];function hU(e,t){return t.some(r=>e[r]!==void 0)}const uv=(e,t)=>(t?e>=0:e>0)&&e<1/0;function W0(e,t){if(uv(e,t))return e}function pU(e){const t=W0(e.stiffness),r=W0(e.damping,!0),a=W0(e.mass);let l={...e,stiffness:t??Pn.stiffness,damping:r??Pn.damping,mass:a??Pn.mass,isResolvedFromDuration:!1,isTimeDefined:(t??r??a)===void 0&&hU(e,mU)};if(l.isTimeDefined){if(l.velocity=0,e.visualDuration){const c=e.visualDuration,u=2*Math.PI/(c*1.2),f=u*u,h=2*To(.05,1,1-(e.bounce||0))*Math.sqrt(f);l={...l,mass:Pn.mass,stiffness:f,damping:h}}else{const c=fU(l);l={...l,...c,mass:Pn.mass},l.isResolvedFromDuration=!0}(!uv(l.stiffness)||!uv(l.damping,!0))&&(l.stiffness=Pn.stiffness,l.damping=Pn.damping)}return l}function Rp(e=Pn.visualDuration,t=Pn.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,a=r.keyframes[0],l=r.keyframes[r.keyframes.length-1],c={done:!1,value:a},{stiffness:u,damping:f,mass:h,duration:m,velocity:x,isResolvedFromDuration:p,isTimeDefined:b}=pU({...r,velocity:-Sr(r.velocity||0)}),v=f/(2*Math.sqrt(u*h)),j=Sr(Math.sqrt(u/h)),S=v*j,N={target:l,delta:l-a,velocity:x||0,restSpeed:0,restDelta:0},C=()=>{const A=Math.abs(N.delta)<5;N.restSpeed=r.restSpeed||(A?Pn.restSpeed.granular:Pn.restSpeed.default),N.restDelta=r.restDelta||(A?Pn.restDelta.granular:Pn.restDelta.default)};C();let E,T,O;if(v<1){const A=cv(j,v),R={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};O=()=>{R.A=(N.velocity+S*N.delta)/A,R.sinC=S*R.A+N.delta*A,R.cosC=S*N.delta-R.A*A};const z=_=>{_!==R.t&&(R.t=_,R.env=Math.exp(-S*_),R.sin=Math.sin(A*_),R.cos=Math.cos(A*_))};E=_=>(z(_),N.target-R.env*(R.A*R.sin+N.delta*R.cos)),T=_=>(z(_),R.env*(R.sinC*R.sin+R.cosC*R.cos))}else if(v===1){E=R=>N.target-Math.exp(-j*R)*(N.delta+(N.velocity+j*N.delta)*R);const A={C:0};O=()=>{A.C=N.velocity+j*N.delta},T=R=>Math.exp(-j*R)*(j*A.C*R-N.velocity)}else{const A=j*Math.sqrt(v*v-1);E=z=>{const _=Math.exp(-S*z),L=Math.min(A*z,300);return N.target-_*((N.velocity+S*N.delta)*Math.sinh(L)+A*N.delta*Math.cosh(L))/A};const R={P:0,sinh:0,cosh:0};O=()=>{R.P=(N.velocity+S*N.delta)/A,R.sinh=S*R.P-N.delta*A,R.cosh=S*N.delta-R.P*A},T=z=>{const _=Math.exp(-S*z),L=Math.min(A*z,300);return _*(R.sinh*Math.sinh(L)+R.cosh*Math.cosh(L))}}O();const k=p&&m||null,M={calculatedDuration:k,retarget:(A,R)=>{N.target=A[A.length-1],N.delta=N.target-A[0],N.velocity=b?0:-Sr(R),r.restSpeed&&r.restDelta||C(),M.calculatedDuration=k,c.done=!1,O()},velocity:A=>Gr(T(A)),next:A=>{const R=E(A);if(p)c.done=A>=m;else{const z=Gr(T(A));c.done=Math.abs(z)<=N.restSpeed&&Math.abs(N.target-R)<=N.restDelta}return c.value=c.done?N.target:R,c},toString:()=>{const A=Math.min(uw(M),cw),R=hO(z=>M.next(A*z).value,A,30);return A+"ms "+R},toTransition:()=>{}};return M}Rp.applyToOptions=e=>{const t=cU(e,100,Rp);return e.ease=t.ease,e.duration=Gr(t.duration),e.type="keyframes",e};function dv({keyframes:e,velocity:t=0,power:r=.8,timeConstant:a=325,bounceDamping:l=10,bounceStiffness:c=500,modifyTarget:u,min:f,max:h,restDelta:m=.5,restSpeed:x}){const p=e[0],b={done:!1,value:p},v=A=>A<f||A>h,j=A=>f===void 0?h:h===void 0||Math.abs(f-A)<Math.abs(h-A)?f:h;let S=r*t;const N=p+S,C=u===void 0?N:u(N);C!==N&&(S=C-p);const E=A=>-S*Math.exp(-A/a),T=A=>{const R=E(A);b.done=Math.abs(R)<=m,b.value=b.done?C:C+R};let O,k;const M=A=>{v(b.value)&&(O=A,k=Rp({keyframes:[b.value,j(b.value)],velocity:-E(A)/a*1e3,damping:l,stiffness:c,restDelta:m,restSpeed:x}))};return M(0),{calculatedDuration:null,next:A=>{let R=!1;return!k&&O===void 0&&(R=!0,T(A),M(A)),O!==void 0&&A>=O?k.next(A-O):(!R&&T(A),b)}}}function gU(e,t,r){const a=[],l=r||za.mix||lw,c=e.length-1;for(let u=0;u<c;u++){let f=l(e[u],e[u+1]);if(t){const h=Array.isArray(t)?t[u]||jo:t;f=Cf(h,f)}a.push(f)}return a}function pO(e,t,{clamp:r=!0,ease:a,mixer:l}={}){const c=e.length;if(Vg(c===t.length),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const u=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=gU(t,a,l),h=f.length,m=x=>{if(u&&x<e[0])return t[0];let p=0;if(h>1)for(;p<e.length-2&&!(x<e[p+1]);p++);const b=Gd(e[p],e[p+1],x);return f[p](b)};return r?x=>m(To(e[0],e[c-1],x)):m}function xU(e,t){const r=e[e.length-1];for(let a=1;a<=t;a++){const l=Gd(0,t,a);e.push(pn(r,1,l))}}function bU(e){const t=[0];return xU(t,e.length-1),t}function yU(e,t){return e.map(r=>r*t)}function vU(e,t){return e.map(()=>t||sw).splice(0,e.length-1)}function eu({duration:e=300,keyframes:t,times:r,ease:a="easeInOut"}){const l=E7(a)?a.map(Nk):Nk(a)||sw,c={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(l)&&(!r||r.length!==2||r[0]===0&&r[1]===1)){const[h,m]=t,x=h===m?void 0:(za.mix||lw)(h,m);return{calculatedDuration:e,next:p=>(c.value=x?x(l(e>0?To(0,1,p/e):1)):m,c.done=p>=e,c)}}const u=yU(r&&r.length===t.length?r:bU(t),e),f=pO(u,t,{ease:Array.isArray(l)?l:vU(t,l)});return{calculatedDuration:e,next:h=>(c.value=f(h),c.done=h>=e,c)}}const wU=5;function jU(e,t,r){const a=Math.max(t-wU,0);return K5(r-e(a),t-a)}function gO(e,t,r=0){return t<=0?r:e.velocity?e.velocity(t):jU(a=>e.next(a).value,t,e.next(t).value)}const SU=e=>e!==null;function Ug(e,{repeat:t,repeatType:r="loop"},a,l=1){const c=e.filter(SU),f=l<0||t&&r!=="loop"&&t%2===1?0:c.length-1;return!f||a===void 0?c[f]:a}const NU={decay:dv,inertia:dv,tween:eu,keyframes:eu,spring:Rp};function dw(e){typeof e.type=="string"&&(e.type=NU[e.type])}function xO(e,t){return{kind:e,animation:t,timestamp:js.now(),frameTimestamp:vs.timestamp,frameIsProcessing:vs.isProcessing}}function bO(e,t,r){const a=globalThis.__MOTION_INSPECT__;if(a)try{a({...xO("animation-start",e),options:r?{...t,...r}:t})}catch{}}function CU(e,t){const r=globalThis.__MOTION_INSPECT__;if(r)try{r({...xO("layout-animation-start",e),node:t})}catch{}}class Hg{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){var t;this.isResolved=!0,(t=this._resolve)==null||t.call(this)}then(t,r){return this.finished.then(t,r)}}const kU=e=>e/100;class Ap extends Hg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var a,l;const{motionValue:r}=this.options;r&&r.updatedAt!==js.now()&&this.tick(js.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(l=(a=this.options).onStop)==null||l.call(a))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause(),bO(this,this.options)}initAnimation(){const{options:t}=this;dw(t);const{type:r=eu,repeat:a=0,repeatDelay:l=0,repeatType:c,velocity:u=0}=t;let{keyframes:f}=t;const h=r||eu;h!==eu&&typeof f[0]!="number"&&(this.mixKeyframes=Cf(kU,lw(f[0],f[1])),f=[0,100]);const m=h(f===t.keyframes?t:{...t,keyframes:f});c==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...f].reverse(),velocity:-u})),m.calculatedDuration===null&&(m.calculatedDuration=uw(m));const{calculatedDuration:x}=m;this.calculatedDuration=x,this.resolvedDuration=x+l,this.totalDuration=this.resolvedDuration*(a+1)-l,this.generator=m}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:a,totalDuration:l,mixKeyframes:c,mirroredGenerator:u,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:x,repeat:p,repeatType:b,repeatDelay:v,type:j,onUpdate:S,finalKeyframe:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-l/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const C=this.currentTime-m*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?C<0:C>l;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let T=this.currentTime,O=a;if(p){const R=Math.min(this.currentTime,l)/f;let z=Math.floor(R),_=R%1;!_&&R>=1&&(_=1),_===1&&z--,z=Math.min(z,p+1),!!(z%2)&&(b==="reverse"?(_=1-_,v&&(_-=v/f)):b==="mirror"&&(O=u)),T=To(0,1,_)*f}let k;E?(this.delayState.value=x[0],k=this.delayState):k=O.next(T),c&&!E&&(k.value=c(k.value));let{done:M}=k;!E&&h!==null&&(M=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return A&&j!==dv&&(k.value=Ug(x,this.options,N,this.speed)),S&&S(k.value),A&&this.finish(),k}then(t,r){return this.finished.then(t,r)}get duration(){return Sr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(this.currentTime)}set time(t){t=Gr(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return gO(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(js.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=Sr(this.currentTime))}play(){var l,c;if(this.isStopped)return;const{driver:t=lU,startTime:r}=this.options;this.driver||(this.driver=t(u=>this.tick(u))),(c=(l=this.options).onPlay)==null||c.call(l);const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=r??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(js.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}const TU=new Set(["brightness","contrast","saturate","opacity"]);function EU(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=r.match(ow)||[];if(!a)return e;const l=r.replace(a,"");let c=TU.has(t)?1:0;return a!==r&&(c*=100),t+"("+c+l+")"}const RU=/\b([a-z-]*)\(.*?\)/gu,fv={...Nr,getAnimatableNone:e=>{const t=e.match(RU);return t?t.map(EU).join(" "):e}},mv={...Nr,getAnimatableNone:e=>{const t=Nr.parse(e);return Nr.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},Ok={...yu,transform:Math.round},AU={rotate:wa,pathRotation:wa,rotateX:wa,rotateY:wa,rotateZ:wa,scale:bh,scaleX:bh,scaleY:bh,scaleZ:bh,skew:wa,skewX:wa,skewY:wa,distance:ft,translateX:ft,translateY:ft,translateZ:ft,x:ft,y:ft,z:ft,perspective:ft,transformPerspective:ft,opacity:qd,originX:kk,originY:kk,originZ:ft},Op={borderWidth:ft,borderTopWidth:ft,borderRightWidth:ft,borderBottomWidth:ft,borderLeftWidth:ft,borderRadius:ft,borderTopLeftRadius:ft,borderTopRightRadius:ft,borderBottomRightRadius:ft,borderBottomLeftRadius:ft,width:ft,maxWidth:ft,height:ft,maxHeight:ft,top:ft,right:ft,bottom:ft,left:ft,inset:ft,insetBlock:ft,insetBlockStart:ft,insetBlockEnd:ft,insetInline:ft,insetInlineStart:ft,insetInlineEnd:ft,padding:ft,paddingTop:ft,paddingRight:ft,paddingBottom:ft,paddingLeft:ft,paddingBlock:ft,paddingBlockStart:ft,paddingBlockEnd:ft,paddingInline:ft,paddingInlineStart:ft,paddingInlineEnd:ft,margin:ft,marginTop:ft,marginRight:ft,marginBottom:ft,marginLeft:ft,marginBlock:ft,marginBlockStart:ft,marginBlockEnd:ft,marginInline:ft,marginInlineStart:ft,marginInlineEnd:ft,fontSize:ft,backgroundPositionX:ft,backgroundPositionY:ft,...AU,zIndex:Ok,fillOpacity:qd,strokeOpacity:qd,numOctaves:Ok},OU={...Op,color:is,backgroundColor:is,outlineColor:is,fill:is,stroke:is,borderColor:is,borderTopColor:is,borderRightColor:is,borderBottomColor:is,borderLeftColor:is,filter:fv,WebkitFilter:fv,mask:mv,WebkitMask:mv},yO=e=>OU[e],MU=new Set([fv,mv]);function fw(e,t){let r=yO(e);return MU.has(r)||(r=Nr),r.getAnimatableNone?r.getAnimatableNone(t):void 0}function DU(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Rl=e=>e*180/Math.PI,hv=e=>{const t=Rl(Math.atan2(e[1],e[0]));return pv(t)},zU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:hv,rotateZ:hv,skewX:e=>Rl(Math.atan(e[1])),skewY:e=>Rl(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},pv=e=>(e=e%360,e<0&&(e+=360),e),Mk=hv,Dk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),zk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),PU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Dk,scaleY:zk,scale:e=>(Dk(e)+zk(e))/2,rotateX:e=>pv(Rl(Math.atan2(e[6],e[5]))),rotateY:e=>pv(Rl(Math.atan2(-e[2],e[0]))),rotateZ:Mk,rotate:Mk,skewX:e=>Rl(Math.atan(e[4])),skewY:e=>Rl(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function gv(e){return e.includes("scale")?1:0}function xv(e,t){if(!e||e==="none")return gv(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,l;if(r)a=PU,l=r;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=zU,l=f}if(!l)return gv(t);const c=a[t],u=l[1].split(",").map(_U);return typeof c=="function"?c(u):u[c]}const IU=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return xv(r,t)};function _U(e){return parseFloat(e.trim())}const vu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wu=new Set([...vu,"pathRotation"]),Pk=e=>e===yu||e===ft,LU=new Set(["x","y","z"]),BU=vu.filter(e=>!LU.has(e));function $U(e){const t=[];return BU.forEach(r=>{const a=e.getValue(r);if(a!==void 0){const l=a.get(),c=r.startsWith("scale")?1:0;if(l===c)return;t.push([r,l]),a.set(c)}}),t}const VU=new Set(["bottom","right"]);function Ik(e,t,r,a,l,c){const u=parseFloat(e);if(!isNaN(u))return u;const{min:f,max:h}=t()[r],m=h-f;return c==="border-box"?m:m-parseFloat(a)-parseFloat(l)}const Ol={width:({width:e,paddingLeft:t="0",paddingRight:r="0",boxSizing:a},l)=>Ik(e,l,"x",t,r,a),height:({height:e,paddingTop:t="0",paddingBottom:r="0",boxSizing:a},l)=>Ik(e,l,"y",t,r,a),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:r}=t();return parseFloat(e)+(r.max-r.min)},right:({left:e},t)=>{const{x:r}=t();return parseFloat(e)+(r.max-r.min)},x:({transform:e})=>xv(e,"x"),y:({transform:e})=>xv(e,"y")};Ol.translateX=Ol.x;Ol.translateY=Ol.y;const Ml=new Set;let bv=!1,yv=!1,vv=!1;function vO(){if(yv){const e=[],t=new Set,r=new Set;Ml.forEach(l=>{l.needsMeasurement&&(e.push(l),t.add(l.element),VU.has(l.name)&&r.add(l.element))});const a=new Map;r.forEach(l=>{const c=$U(l);c.length&&(a.set(l,c),l.render())}),e.forEach(l=>l.measureInitialState()),t.forEach(l=>{l.render();const c=a.get(l);c&&c.forEach(([u,f])=>{var h;(h=l.getValue(u))==null||h.set(f)})}),e.forEach(l=>l.measureEndState()),e.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}yv=!1,bv=!1,Ml.forEach(e=>e.complete(vv)),Ml.clear()}function wO(){Ml.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yv=!0)})}function UU(){vv=!0,wO(),vO(),vv=!1}function HU(e,t,r){if(typeof e=="string"){if(J1(e)||ew(e))return parseFloat(e);if(!Nr.test(e)&&Nr.test(r))return fw(t,r)}return e??void 0}class mw{constructor(t,r,a,l,c,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=a,this.motionValue=l,this.element=c,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(Ml.add(this),bv||(bv=!0,dn.read(wO),dn.resolveKeyframes(vO))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:a,motionValue:l}=this;if(t[0]===null){const c=l==null?void 0:l.get(),u=t[t.length-1];if(c!==void 0)t[0]=c;else if(a&&r){const f=HU(a.readValue(r,u),r,u);f!==void 0&&(t[0]=f)}t[0]===void 0&&(t[0]=u),l&&c===void 0&&l.set(t[0])}DU(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ml.delete(this)}cancel(){this.state==="scheduled"&&(Ml.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const FU=e=>e.startsWith("--");function jO(e,t,r){FU(t)?e.style.setProperty(t,r):e.style[t]=r}const GU={};function SO(e,t){const r=Y5(e);return()=>GU[t]??r()}const qU=SO(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),NO=SO(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ed=([e,t,r,a])=>`cubic-bezier(${e}, ${t}, ${r}, ${a})`,_k={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ed([0,.65,.55,1]),circOut:Ed([.55,0,1,.45]),backIn:Ed([.31,.01,.66,-.59]),backOut:Ed([.33,1.53,.69,.99])};function CO(e,t){if(e)return typeof e=="function"?NO()?hO(e,t):"ease-out":sO(e)?Ed(e):Array.isArray(e)?e.map(r=>CO(r,t)||_k.easeOut):_k[e]}function YU(e,t,r,{delay:a=0,duration:l=300,repeat:c=0,repeatType:u="loop",ease:f="easeOut",times:h}={},m=void 0){const x={[t]:r};h&&(x.offset=h);const p=CO(f,l);Array.isArray(p)&&(x.easing=p);const b={delay:a,duration:l,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:c+1,direction:u==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(x,b)}function kO(e){return typeof e=="function"&&"applyToOptions"in e}function KU({type:e,...t}){return kO(e)&&NO()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class TO extends Hg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:a,keyframes:l,pseudoElement:c,allowFlatten:u=!1,finalKeyframe:f,onComplete:h}=t;this.isPseudoElement=!!c,this.allowFlatten=u,this.options=t,Vg(typeof t.type!="string");const m=KU(t);this.animation=YU(r,a,l,m,c),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const x=Ug(l,this.options,f,this.speed);this.updateMotionValue&&this.updateMotionValue(x),jO(r,a,x),this.animation.cancel()}h==null||h(),this.notifyFinished()},bO(this,t,m)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,a,l;const t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((l=(a=this.animation).commitStyles)==null||l.call(a))}get duration(){var r,a;const t=((a=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:a.call(r).duration)||0;return Sr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(Number(this.animation.currentTime)||0)}set time(t){const r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Gr(t),r&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:r,rangeEnd:a,observe:l}){var c;return this.allowFlatten&&((c=this.animation.effect)==null||c.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&qU()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),a&&(this.animation.rangeEnd=a),jo):l(this)}}const EO={anticipate:eO,backInOut:J5,circInOut:nO};function XU(e){return e in EO}function WU(e){typeof e.ease=="string"&&XU(e.ease)&&(e.ease=EO[e.ease])}const Q0=10;class QU extends TO{constructor(t){WU(t),dw(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:a,onComplete:l,element:c,...u}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const f=new Ap({...u,autoplay:!1}),h=Math.max(Q0,js.now()-this.startTime),m=To(0,Q0,h-Q0),x=f.sample(h).value,{name:p}=this.options;c&&p&&jO(c,p,x),r.setWithVelocity(f.sample(Math.max(0,h-m)).value,x,m),f.stop()}}const Lk=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Nr.test(e)||e==="0")&&!e.startsWith("url("));function ZU(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function JU(e,t,r,a){const l=e[0];if(l===null)return!1;if(t==="display"||t==="visibility")return!0;const c=e[e.length-1],u=Lk(l,t),f=Lk(c,t);return!u||!f?!1:ZU(e)||(r==="spring"||kO(r))&&a}function wv(e){e.duration=0,e.type="keyframes"}const jv=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),e9=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function t9(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&e9.test(e[t]))return!0;return!1}const Bk=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),n9=Y5(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function s9(e){var p;const{motionValue:t,name:r,repeatDelay:a,repeatType:l,damping:c,type:u,keyframes:f}=e;if(!r||!(jv.has(r)||Bk.has(r)))return!1;const h=(p=t==null?void 0:t.owner)==null?void 0:p.current;if(!(h instanceof HTMLElement)&&!(h instanceof SVGElement))return!1;const{onUpdate:m,transformTemplate:x}=t.owner.getProps();return n9()&&(jv.has(r)||Bk.has(r)&&t9(f))&&(r!=="transform"||!x)&&!m&&!a&&l!=="mirror"&&c!==0&&u!=="inertia"}const r9=40;class o9 extends Hg{constructor(t){var h;super(),this.stop=()=>{var m,x;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=js.now();const{keyframes:r,name:a,motionValue:l,element:c}=t,u=t;u.autoplay??(u.autoplay=!0),u.delay??(u.delay=0),u.type??(u.type="keyframes"),u.repeat??(u.repeat=0),u.repeatDelay??(u.repeatDelay=0),u.repeatType??(u.repeatType="loop");const f=(c==null?void 0:c.KeyframeResolver)||mw;this.keyframeResolver=new f(r,(m,x,p)=>this.onKeyframesResolved(m,x,u,!p),a,l,c),(h=this.keyframeResolver)==null||h.scheduleResolve()}onKeyframesResolved(t,r,a,l){var N,C;this.keyframeResolver=void 0;const{name:c,type:u,velocity:f,delay:h,isHandoff:m,onUpdate:x}=a;this.resolvedAt=js.now();let p=!0;JU(t,c,u,f)||(p=!1,(za.instantAnimations||!h)&&(x==null||x(Ug(t,a,r))),t[0]=t[t.length-1],wv(a),a.repeat=0);const b=l?this.resolvedAt?this.resolvedAt-this.createdAt>r9?this.resolvedAt:this.createdAt:this.createdAt:void 0,{onComplete:v}=a;a.startTime??(a.startTime=b),a.finalKeyframe=r,a.keyframes=t,a.onComplete=()=>{v==null||v(),this.notifyFinished()};const j=p&&!m&&s9(a);let S;if(j){a.element=(C=(N=a.motionValue)==null?void 0:N.owner)==null?void 0:C.current;try{S=new QU(a)}catch{S=new Ap(a)}}else S=new Ap(a);this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this._animation.finished:super.finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),UU()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function RO(e,t,r,a=0,l=1){const c=Array.from(e).sort((m,x)=>m.sortNodePosition(x)).indexOf(t),u=e.size,f=(u-1)*a;return typeof r=="function"?r(c,u):l===1?c*a:f-c*a}const $k=30,a9=e=>!isNaN(parseFloat(e)),Md={current:void 0};class i9{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const l=js.now();if(this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=js.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=a9(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){var a;return t==="change"?this.onChangeSubscribe(r):((a=this.events)[t]||(a[t]=new Tp)).add(r)}onChangeSubscribe(t){const{events:r}=this;return!r.change&&!this.changeSubscriber?this.changeSubscriber=t:(r.change||(r.change=new Tp,r.change.add(this.changeSubscriber),this.changeSubscriber=void 0),r.change.add(t)),()=>{var a;this.changeSubscriber===t?this.changeSubscriber=void 0:(a=r.change)==null||a.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){dn.read(()=>{var t;!this.changeSubscriber&&!((t=this.events.change)!=null&&t.getSize())&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,a){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){var a;const{current:t,changeSubscriber:r}=this;r?r(t):(a=this.events.change)==null||a.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Md.current&&Md.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=js.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>$k)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,$k);return K5(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{var c;this.hasAnimated=!0;let a=!1,l;l=t(()=>{var u;a=!0,(u=this.events.animationComplete)==null||u.notify(),this.animation===l&&this.clearAnimation(),r()}),a||(this.animation=l),(c=this.events.animationStart)==null||c.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bl(e,t){return new i9(e,t)}function AO(e,t){if(e!=null&&e.inherit&&t){const{inherit:r,...a}=e;return{...t,...a}}return e}function hw(e,t){const r=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return r!==e?AO(r,e):r}const l9={type:"spring",stiffness:500,damping:25,restSpeed:10},c9=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),u9={type:"keyframes",duration:.8},d9={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},f9=(e,{keyframes:t})=>t.length>2?u9:wu.has(e)?e.startsWith("scale")?c9(t[1]):l9:d9,m9=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function h9(e){for(const t in e)if(!m9.has(t))return!0;return!1}const pw=(e,t,r,a={},l,c)=>u=>{const f=hw(a,e)||{},h=f.delay||a.delay||0;let{elapsed:m=0}=a;m=m-Gr(h);const x={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-m,onUpdate:b=>{t.set(b),f.onUpdate&&f.onUpdate(b)},onComplete:()=>{u(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:c?void 0:l};h9(f)||Object.assign(x,f9(e,x)),x.duration&&(x.duration=Gr(x.duration)),x.repeatDelay&&(x.repeatDelay=Gr(x.repeatDelay)),x.from!==void 0&&(x.keyframes[0]=x.from);let p=!1;if((x.type===!1||x.duration===0&&!x.repeatDelay)&&(wv(x),x.delay===0&&(p=!0)),(za.instantAnimations||za.skipAnimations||l!=null&&l.shouldSkipAnimations||f.skipAnimations)&&(p=!0,wv(x),x.delay=0),x.allowFlatten=!f.type&&!f.ease,p&&!c&&t.get()!==void 0){const b=Ug(x.keyframes,f);if(b!==void 0){dn.update(()=>{x.onUpdate(b),x.onComplete()});return}}return f.isSync?new Ap(x):new o9(x)},p9=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function g9(e){const t=p9.exec(e);if(!t)return[,];const[,r,a,l]=t;return[`--${r??a}`,l]}function OO(e,t,r=1){const[a,l]=g9(e);if(!a)return;const c=window.getComputedStyle(t).getPropertyValue(a);if(c){const u=c.trim();return J1(u)?parseFloat(u):u}return rw(l)?OO(l,t,r+1):l}function Vk(e){const t=[{},{}];return e==null||e.values.forEach((r,a)=>{t[0][a]=r.get(),t[1][a]=r.getVelocity()}),t}function gw(e,t,r,a){if(typeof t=="function"){const[l,c]=Vk(a);t=t(r!==void 0?r:e.custom,l,c)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[l,c]=Vk(a);t=t(r!==void 0?r:e.custom,l,c)}return t}function Dl(e,t,r){const a=e.getProps();return gw(a,t,r!==void 0?r:a.custom,e)}const MO=new Set(["width","height","top","left","right","bottom",...vu]),Sv=e=>Array.isArray(e);function x9(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Bl(r))}function b9(e){return Sv(e)?e[e.length-1]||0:e}function y9(e,t){const r=Dl(e,t);let{transitionEnd:a={},transition:l={},...c}=r||{};c={...c,...a};for(const u in c){const f=b9(c[u]);x9(e,u,f)}}const us=e=>!!(e&&e.getVelocity);function v9(e){return!!(us(e)&&e.add)}function Nv(e,t){const r=e.getValue("willChange");if(v9(r))return r.add(t);if(!r&&za.WillChange){const a=new za.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function xw(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const w9="framerAppearId",DO="data-"+xw(w9);function zO(e){return e.props[DO]}const j9=typeof window<"u";function S9({protectedKeys:e,needsAnimating:t},r){const a=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,a}function PO(e,t,{delay:r=0,transitionOverride:a,type:l}={}){let{transition:c,transitionEnd:u,...f}=t;const h=e.getDefaultTransition();c=c?AO(c,h):h;const m=c==null?void 0:c.reduceMotion,x=c==null?void 0:c.skipAnimations;a&&(c=a);const p=[],b=l&&e.animationState&&e.animationState.getState()[l],v=c==null?void 0:c.path;v&&v.animateVisualElement(e,f,c,r,p);for(const j in f){const S=e.getValue(j,e.latestValues[j]??null),N=f[j];if(N===void 0||b&&S9(b,j))continue;const C={delay:r,...hw(c||{},j)};x&&(C.skipAnimations=!0);const E=S.get();if(E!==void 0&&!S.isAnimating()&&!Array.isArray(N)&&N===E&&!C.velocity){dn.update(()=>S.set(N));continue}let T=!1;if(j9&&window.MotionHandoffAnimation){const M=zO(e);if(M){const A=window.MotionHandoffAnimation(M,j,dn);A!==null&&(C.startTime=A,T=!0)}}Nv(e,j);const O=m??e.shouldReduceMotion;S.start(pw(j,S,N,O&&MO.has(j)?{type:!1}:C,e,T));const k=S.animation;k&&p.push(k)}if(u){const j=()=>dn.update(()=>{u&&y9(e,u)});p.length?Promise.all(p).then(j):j()}return p}function Cv(e,t,r={}){var h;const a=Dl(e,t,r.type==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);let{transition:l=e.getDefaultTransition()||{}}=a||{};r.transitionOverride&&(l=r.transitionOverride);const c=a?()=>Promise.all(PO(e,a,r)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:x=0,staggerChildren:p,staggerDirection:b}=l;return N9(e,t,m,x,p,b,r)}:()=>Promise.resolve(),{when:f}=l;if(f){const[m,x]=f==="beforeChildren"?[c,u]:[u,c];return m().then(()=>x())}else return Promise.all([c(),u(r.delay)])}function N9(e,t,r=0,a=0,l=0,c=1,u){const f=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),f.push(Cv(h,t,{...u,delay:r+(typeof a=="function"?0:a)+RO(e.variantChildren,h,a,l,c)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(f)}function C9(e,t,r={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const l=t.map(c=>Cv(e,c,r));a=Promise.all(l)}else if(typeof t=="string")a=Cv(e,t,r);else{const l=typeof t=="function"?Dl(e,t,r.custom):t;a=Promise.all(PO(e,l,r))}return a.then(()=>{e.notify("AnimationComplete",t)})}const k9={test:e=>e==="auto",parse:e=>e},T9=e=>t=>t.test(e),E9=[yu,ft,Wo,wa,V7,$7,k9],Uk=e=>E9.find(T9(e));function R9(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ew(e):!0}const A9=new Set(["auto","none","0"]);function O9(e,t,r){let a=0,l;for(;a<e.length&&!l;){const c=e[a];typeof c=="string"&&!A9.has(c)&&Y7(c)&&(l=e[a]),a++}if(l&&r)for(const c of t)e[c]!==l&&(e[c]=fw(r,l))}class M9 extends mw{constructor(t,r,a,l,c){super(t,r,a,l,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:a}=this;if(!r||!r.current)return;super.readKeyframes();for(let x=0;x<t.length;x++){let p=t[x];if(typeof p=="string"&&(p=p.trim(),rw(p))){const b=OO(p,r.current);b!==void 0&&(t[x]=b),x===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!MO.has(a)||t.length!==2)return;const[l,c]=t;if(typeof l=="number"&&typeof c=="number")return;const u=Uk(l),f=Uk(c),h=Ck(l),m=Ck(c);if(h!==m&&Ol[a]){this.needsMeasurement=!0;return}if(u!==f)if(Pk(u)&&Pk(f))for(let x=0;x<t.length;x++){const p=t[x];typeof p=="string"&&(t[x]=parseFloat(p))}else Ol[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,a=[];for(let l=0;l<t.length;l++)(t[l]===null||R9(t[l]))&&a.push(l);a.length&&O9(t,a,r)}measure(){const{element:t,name:r}=this;return Ol[r](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){var c;const{element:t,unresolvedKeyframes:r,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),r[0]=this.measuredOrigin;const l=r[r.length-1];l!==void 0&&((c=this.motionValue)==null||c.jump(l,!1))}measureEndState(){var c,u;const{element:t,unresolvedKeyframes:r}=this;if(!t||!t.current)return;(c=this.motionValue)==null||c.jump(this.measuredOrigin,!1);const a=r.length-1,l=r[a];r[a]=this.measure(),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([f,h])=>{t.getValue(f).set(h)}),this.resolveNoneKeyframes()}}const bw=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Yh(e){return q5(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function yw(e){return q5(e)&&"ownerSVGElement"in e}const kv=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function vw(e,t,r){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const l=document.querySelectorAll(e);return l?Array.from(l):[]}return Array.from(e).filter(a=>a!=null)}const D9={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},z9=vu.length;function P9(e,t,r){let a="",l=!0;for(let u=0;u<z9;u++){const f=vu[u],h=e[f];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(f.startsWith("scale")?1:0);else{const x=parseFloat(h);m=f.startsWith("scale")?x===1:x===0}if(!m||r){const x=kv(h,Op[f]);if(!m){l=!1;const p=D9[f]||f;a+=`${p}(${x}) `}r&&(t[f]=x)}}const c=e.pathRotation;return c&&(l=!1,a+=`rotate(${kv(c,Op.pathRotation)}) `),a=a.trim(),r?a=r(t,l?"":a):l&&(a="none"),a}function ww(e,t,r){const{style:a,vars:l,transformOrigin:c}=e;let u=!1,f=!1;for(const h in t){const m=t[h];if(wu.has(h)){u=!0;continue}else if(aO(h)){l[h]=m;continue}else{const x=kv(m,Op[h]);h.startsWith("origin")?(f=!0,c[h]=x):a[h]=x}}if(t.transform||(u||r?a.transform=P9(t,e.transform,r):a.transform&&(a.transform="none")),f){const{originX:h="50%",originY:m="50%",originZ:x=0}=c;a.transformOrigin=`${h} ${m} ${x}`}}const I9={offset:"stroke-dashoffset",array:"stroke-dasharray"},_9={offset:"strokeDashoffset",array:"strokeDasharray"};function L9(e,t,r=1,a=0,l=!0){e.pathLength=1;const c=l?I9:_9;e[c.offset]=`${-a}`,e[c.array]=`${t} ${r}`}const IO=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _O(e,{attrX:t,attrY:r,attrScale:a,pathLength:l,pathSpacing:c=1,pathOffset:u=0,...f},h,m,x){if(ww(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:b}=e;for(const v of IO)p[v]!==void 0&&(b[v]=p[v],delete p[v]);(b.transform||p.transformOrigin)&&(b.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),b.transform&&(b.transformBox=(x==null?void 0:x.transformBox)??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),r!==void 0&&(p.y=r),a!==void 0&&(p.scale=a),l!==void 0&&L9(p,l,c,u,!1)}function LO({top:e,left:t,right:r,bottom:a}){return{x:{min:t,max:r},y:{min:e,max:a}}}function B9({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $9(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:a.y,right:a.x}}function Z0(e){return e===void 0||e===1}function Tv({scale:e,scaleX:t,scaleY:r}){return!Z0(e)||!Z0(t)||!Z0(r)}function Nl(e){return Tv(e)||BO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function BO(e){return Hk(e.x)||Hk(e.y)}function Hk(e){return e&&e!=="0%"}function Mp(e,t,r){const a=e-r,l=t*a;return r+l}function Fk(e,t,r,a,l){return l!==void 0&&(e=Mp(e,l,a)),Mp(e,r,a)+t}function Ev(e,t=0,r=1,a,l){e.min=Fk(e.min,t,r,a,l),e.max=Fk(e.max,t,r,a,l)}function $O(e,{x:t,y:r}){Ev(e.x,t.translate,t.scale,t.originPoint),Ev(e.y,r.translate,r.scale,r.originPoint)}const Gk=.999999999999,qk=1.0000000000001;function V9(e,t,r,a=!1){var f;const l=r.length;if(!l)return;t.x=t.y=1;let c,u;for(let h=0;h<l;h++){c=r[h],u=c.projectionDelta;const{visualElement:m}=c.options;m&&m.props.style&&m.props.style.display==="contents"||(a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&(Yo(e.x,-c.scroll.offset.x),Yo(e.y,-c.scroll.offset.y)),u&&(t.x*=u.x.scale,t.y*=u.y.scale,$O(e,u)),a&&Nl(c.latestValues)&&Kh(e,c.latestValues,(f=c.layout)==null?void 0:f.layoutBox))}t.x<qk&&t.x>Gk&&(t.x=1),t.y<qk&&t.y>Gk&&(t.y=1)}function Yo(e,t){e.min+=t,e.max+=t}function Yk(e,t,r,a,l=.5){const c=pn(e.min,e.max,l);Ev(e,t,r,c,a)}function Kk(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Kh(e,t,r){const a=r??e;Yk(e.x,Kk(t.x,a.x),t.scaleX,t.scale,t.originX),Yk(e.y,Kk(t.y,a.y),t.scaleY,t.scale,t.originY)}function VO(e,t){return LO($9(e.getBoundingClientRect(),t))}function U9(e,t,r){const a=VO(e,r),{scroll:l}=t;return l&&(Yo(a.x,l.offset.x),Yo(a.y,l.offset.y)),a}const{schedule:jw}=rO(queueMicrotask,!1),go={x:!1,y:!1};function UO(){return go.x||go.y}function H9(e){return e==="x"||e==="y"?go[e]?null:(go[e]=!0,()=>{go[e]=!1}):go.x||go.y?null:(go.x=go.y=!0,()=>{go.x=go.y=!1})}function HO(e,t){const r=vw(e),a=new AbortController,l={passive:!0,...t,signal:a.signal};return[r,l,()=>a.abort()]}function F9(e){return!(e.pointerType==="touch"||UO())}function G9(e,t,r={}){const[a,l,c]=HO(e,r);return a.forEach(u=>{let f=!1,h=!1,m;const x=()=>{u.removeEventListener("pointerleave",j)},p=N=>{m&&(m(N),m=void 0),x()},b=N=>{f=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),h&&(h=!1,p(N))},v=()=>{f=!0,window.addEventListener("pointerup",b,l),window.addEventListener("pointercancel",b,l)},j=N=>{if(N.pointerType!=="touch"){if(f){h=!0;return}p(N)}},S=N=>{if(!F9(N))return;h=!1;const C=t(u,N);typeof C=="function"&&(m=C,u.addEventListener("pointerleave",j,l))};u.addEventListener("pointerenter",S,l),u.addEventListener("pointerdown",v,l)}),c}const FO=(e,t)=>t?e===t?!0:FO(e,t.parentElement):!1,Sw=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,q9=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Y9(e){return q9.has(e.tagName)||e.isContentEditable===!0}const K9=new Set(["INPUT","SELECT","TEXTAREA"]);function X9(e){return K9.has(e.tagName)||e.isContentEditable===!0}const Xh=new WeakSet;function Xk(e){return t=>{t.key==="Enter"&&e(t)}}function J0(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const W9=(e,t)=>{const r=e.currentTarget;if(!r)return;const a=Xk(()=>{if(Xh.has(r))return;J0(r,"down");const l=Xk(()=>{J0(r,"up")}),c=()=>J0(r,"cancel");r.addEventListener("keyup",l,t),r.addEventListener("blur",c,t)});r.addEventListener("keydown",a,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",a),t)};function Wk(e){return Sw(e)&&!UO()}const Qk=new WeakSet;function Q9(e,t,r={}){const[a,l,c]=HO(e,r),u=f=>{const h=f.currentTarget;if(!Wk(f)||Qk.has(f))return;Xh.add(h),r.stopPropagation&&Qk.add(f);const m=t(h,f),x={...l,capture:!0},p=(j,S)=>{window.removeEventListener("pointerup",b,x),window.removeEventListener("pointercancel",v,x),Xh.has(h)&&Xh.delete(h),Wk(j)&&typeof m=="function"&&m(j,{success:S})},b=j=>{p(j,h===window||h===document||r.useGlobalTarget||FO(h,j.target))},v=j=>{p(j,!1)};window.addEventListener("pointerup",b,x),window.addEventListener("pointercancel",v,x)};return a.forEach(f=>{(r.useGlobalTarget?window:f).addEventListener("pointerdown",u,l),Yh(f)&&(f.addEventListener("focus",m=>W9(m,l)),!Y9(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),c}const Wh=new WeakMap;let Ni;const GO=(e,t,r)=>(a,l)=>l&&l[0]?l[0][e+"Size"]:yw(a)&&"getBBox"in a?a.getBBox()[t]:a[r],Z9=GO("inline","width","offsetWidth"),J9=GO("block","height","offsetHeight");function eH({target:e,borderBoxSize:t}){var r;(r=Wh.get(e))==null||r.forEach(a=>{a(e,{get width(){return Z9(e,t)},get height(){return J9(e,t)}})})}function tH(e){e.forEach(eH)}function nH(){typeof ResizeObserver>"u"||(Ni=new ResizeObserver(tH))}function sH(e,t){Ni||nH();const r=vw(e);return r.forEach(a=>{let l=Wh.get(a);l||(l=new Set,Wh.set(a,l)),l.add(t),Ni==null||Ni.observe(a)}),()=>{r.forEach(a=>{const l=Wh.get(a);l==null||l.delete(t),l!=null&&l.size||Ni==null||Ni.unobserve(a)})}}const Qh=new Set;let Fc;function rH(){Fc=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Qh.forEach(t=>t(e))},window.addEventListener("resize",Fc)}function oH(e){return Qh.add(e),Fc||rH(),()=>{Qh.delete(e),!Qh.size&&typeof Fc=="function"&&(window.removeEventListener("resize",Fc),Fc=void 0)}}function Zk(e,t){return typeof e=="function"?oH(e):sH(e,t)}function aH(e){return yw(e)&&e.tagName==="svg"}function iH(...e){const t=!Array.isArray(e[0]),r=t?0:-1,a=e[0+r],l=e[1+r],c=e[2+r],u=e[3+r],f=pO(l,c,u);return t?f(a):f}const Rd=new Set,Jk=({timestamp:e})=>{Rd.forEach(t=>t.tick(e))};class lH extends Hg{constructor(t){super(),this.state="idle",this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{var a,l;this.state!=="idle"&&(this.teardown(),(l=(a=this.options).onStop)==null||l.call(a))},this.options=t,dw(t),this.factory=t.type||eu,this.generator=this.factory(t);const{driver:r}=t;r&&(this.driver=r(a=>this.tick(a))),this.startTime=this.now(),this.state="running",this.driver?this.driver.start():(Rd.size||dn.update(Jk,!0),Rd.add(this))}setTarget(t,r){this.nextTarget=t,this.nextVelocity=r,this.hasNextTarget=!0}retarget(t,r){const{options:a,generator:l}=this;a.keyframes=t,a.velocity=r,this.startTime=this.now(),this.currentTime=0,l.retarget?l.retarget(t,r):this.generator=this.factory(a)}tick(t){var p;const{options:r,hasNextTarget:a}=this,{delay:l=0,onUpdate:c,onPlay:u}=r,f=Math.round(t-this.startTime)-l,h=this.currentTime=Math.max(0,f),m=this.generator.next(h),x=f<0?r.keyframes[0]:m.value;if(a){this.hasNextTarget=!1;const{keyframes:b}=r;b[0]=x,b[1]=this.nextTarget,this.retarget(b,this.nextVelocity??this.getGeneratorVelocity())}(a||!this.started)&&(this.started=!0,u==null||u()),this.state==="running"&&(c==null||c(x),m.done&&f>=0&&!a&&!this.hasNextTarget&&this.state==="running"&&(this.notifyFinished(),this.teardown(),this.state="finished",(p=r.onComplete)==null||p.call(r)))}getGeneratorVelocity(){return gO(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():js.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(Rd.delete(this),Rd.size||ta(Jk))}}function cH(e,t,r={}){const a=e.get();let l=null,c;const u=typeof a=="string"?a.replace(/[\d.-]/g,""):void 0,f=x=>c(u?x+u:x),h=()=>{var x;return(x=e.events.animationStart)==null?void 0:x.notify()},m=()=>{l&&(l.stop(),l=null),e.animation=void 0};if(e.attach((x,p)=>{c=p;const b=tT(x);if((l==null?void 0:l.state)==="running"){l.setTarget(b,r.velocity);return}const v=tT(e.get()),j=l?l.getGeneratorVelocity():e.getVelocity();if(m(),v===b)return;const S={keyframes:[v,b],velocity:j,type:"spring",restDelta:.001,restSpeed:.01,...r,onUpdate:f},N=l=new lH({...S,onPlay:h});e.animation=N,N.then(()=>{var C;l===N&&(l=null,e.animation=void 0,(C=e.events.animationComplete)==null||C.notify())})},m),us(t)){let x=r.skipInitialAnimation===!0;const p=t.on("change",v=>{x?(x=!1,e.jump(eT(v,u),!1)):e.set(eT(v,u))}),b=e.on("destroy",p);return()=>{p(),b()}}return m}function eT(e,t){return t?e+t:e}function tT(e){return typeof e=="number"?e:parseFloat(e)}const nT=()=>({translate:0,scale:1,origin:0,originPoint:0}),Gc=()=>({x:nT(),y:nT()}),sT=()=>({min:0,max:0}),as=()=>({x:sT(),y:sT()}),uH=new WeakMap;function Fg(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Kd(e){return typeof e=="string"||Array.isArray(e)}const Nw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Dp=["initial",...Nw];function Gg(e){if(Fg(e.animate))return!0;for(let t=0;t<Dp.length;t++)if(Kd(e[Dp[t]]))return!0;return!1}function qO(e){return!!(Gg(e)||e.variants)}function dH(e,t,r){for(const a in t){const l=t[a],c=r[a];if(us(l))e.addValue(a,l);else if(us(c))e.addValue(a,Bl(l,{owner:e}));else if(c!==l)if(e.hasValue(a)){const u=e.getValue(a);u.liveStyle===!0?u.jump(l):u.hasAnimated||u.set(l)}else{const u=e.getStaticValue(a);e.addValue(a,Bl(u!==void 0?u:l,{owner:e}))}}for(const a in r)t[a]===void 0&&e.removeValue(a);return t}const zp={current:null},Cw={current:!1},fH=typeof window<"u";function YO(){if(Cw.current=!0,!!fH)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zp.current=e.matches;e.addEventListener("change",t),t()}else zp.current=!1}const rT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Pp={};function KO(e){Pp=e}function mH(){return Pp}class hH{scrapeMotionValuesFromProps(t,r,a){return{}}constructor({parent:t,props:r,presenceContext:a,reducedMotionConfig:l,skipAnimations:c,blockInitialAnimation:u,visualState:f},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=mw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=js.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,dn.render(this.render,!1,!0))};const{latestValues:m,renderState:x}=f;this.latestValues=m,this.baseTarget={...m},this.initialValues=r.initial?{...m}:{},this.renderState=x,this.parent=t,this.props=r,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=l,this.skipAnimationsConfig=c,this.options=h,this.blockInitialAnimation=!!u,this.isControllingVariants=Gg(r),this.isVariantNode=qO(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...b}=this.scrapeMotionValuesFromProps(r,{},this);for(const v in b){const j=b[v];m[v]!==void 0&&us(j)&&j.set(m[v])}}mount(t){var r,a;if(this.hasBeenMounted)for(const l in this.initialValues)(r=this.values.get(l))==null||r.jump(this.initialValues[l]),this.latestValues[l]=this.initialValues[l];this.current=t,uH.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((l,c)=>this.bindToMotionValue(c,l)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Cw.current||YO(),this.shouldReduceMotion=zp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(a=this.parent)==null||a.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ta(this.notifyUpdate),ta(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const a=this.features[r];a&&(a.unmount(),a.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&jv.has(t)&&this.current instanceof HTMLElement){const{factory:u,keyframes:f,times:h,ease:m,duration:x}=r.accelerate,p=new TO({element:this.current,name:t,keyframes:f,times:h,ease:m,duration:Gr(x)}),b=u(p);this.valueSubscriptions.set(t,()=>{b(),p.cancel()});return}const a=wu.has(t);a&&this.onBindTransform&&this.onBindTransform();const l=r.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&dn.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;typeof window<"u"&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{l(),c&&c()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Pp){const r=Pp[t];if(!r)continue;const{isEnabled:a,Feature:l}=r;if(!this.features[t]&&l&&a(this.props)&&(this.features[t]=new l(this)),this.features[t]){const c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):as()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let a=0;a<rT.length;a++){const l=rT[a];this.propEventSubscriptions[l]&&(this.propEventSubscriptions[l](),delete this.propEventSubscriptions[l]);const c="on"+l,u=t[c];u&&(this.propEventSubscriptions[l]=this.on(l,u))}this.prevMotionValues=dH(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const a=this.values.get(t);r!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&r!==void 0&&(a=Bl(r===null?void 0:r,{owner:this}),this.addValue(t,a)),a}readValue(t,r){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(J1(a)||ew(a))?a=parseFloat(a):typeof a!="number"&&!Nr.test(a)&&Nr.test(r)&&(a=fw(t,r)),this.setBaseTarget(t,us(a)?a.get():a)),us(a)?a.get():a}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var c;const{initial:r}=this.props;let a;if(typeof r=="string"||typeof r=="object"){const u=gw(this.props,r,(c=this.presenceContext)==null?void 0:c.custom);u&&(a=u[t])}if(r&&a!==void 0)return a;const l=this.getBaseTargetFromProps(this.props,t);return l!==void 0&&!us(l)?l:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Tp),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){jw.render(this.render)}}class XO extends hH{constructor(){super(...arguments),this.KeyframeResolver=M9}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){const a=t.style;return a?a[r]:void 0}removeValueFromRenderState(t,{vars:r,style:a}){delete r[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;us(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class Ui{constructor(t){this.isMounted=!1,this.node=t}update(){}}function WO(e,{style:t,vars:r},a,l){const c=e.style;let u;for(u in t)c[u]=t[u];l==null||l.applyProjectionStyles(c,a);for(u in r)c.setProperty(u,r[u])}function oT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wd={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ft.test(e))e=parseFloat(e);else return e;const r=oT(e,t.target.x),a=oT(e,t.target.y);return`${r}% ${a}%`}},pH={correct:(e,{treeScale:t,projectionDelta:r})=>{const a=e,l=Nr.parse(e);if(l.length>5)return a;const c=Nr.createTransformer(e),u=typeof l[0]!="number"?1:0,f=r.x.scale*t.x,h=r.y.scale*t.y;l[0+u]/=f,l[1+u]/=h;const m=pn(f,h,.5);return typeof l[2+u]=="number"&&(l[2+u]/=m),typeof l[3+u]=="number"&&(l[3+u]/=m),c(l)}},Rv={borderRadius:{...wd,applyTo:[...bw]},borderTopLeftRadius:wd,borderTopRightRadius:wd,borderBottomLeftRadius:wd,borderBottomRightRadius:wd,boxShadow:pH};function QO(e,{layout:t,layoutId:r}){return wu.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Rv[e]||e==="opacity")}function kw(e,t,r){var u;const a=e.style,l=t==null?void 0:t.style,c={};if(!a)return c;for(const f in a)(us(a[f])||l&&us(l[f])||QO(f,e)||((u=r==null?void 0:r.getValue(f))==null?void 0:u.liveStyle)!==void 0)&&(c[f]=a[f]);return c}function gH(e){return window.getComputedStyle(e)}class xH extends XO{constructor(){super(...arguments),this.type="html",this.renderInstance=WO}mount(t){Vg(!!t.style),super.mount(t)}readValueFromInstance(t,r){var a;if(wu.has(r))return(a=this.projection)!=null&&a.isProjecting?gv(r):IU(t,r);{const l=gH(t),c=(aO(r)?l.getPropertyValue(r):l[r])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(t,{transformPagePoint:r}){return VO(t,r)}build(t,r,a){ww(t,r,a.transformTemplate)}scrapeMotionValuesFromProps(t,r,a){return kw(t,r,a)}}const ZO=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),JO=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bH(e,t,r,a){WO(e,t,void 0,a);for(const l in t.attrs)e.setAttribute(ZO.has(l)?l:xw(l),t.attrs[l])}function eM(e,t,r){const a=kw(e,t,r);for(const l in e)if(us(e[l])||us(t[l])){const c=vu.indexOf(l)!==-1?"attr"+l.charAt(0).toUpperCase()+l.substring(1):l;a[c]=e[l]}return a}class yH extends XO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=as}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(wu.has(r)){const a=yO(r);return a&&a.default||0}if(IO.includes(r)){const l=getComputedStyle(t)[r];if(typeof l=="string"&&l)return l.trim()}return r=ZO.has(r)?r:xw(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,a){return eM(t,r,a)}build(t,r,a){_O(t,r,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,r,a,l){bH(t,r,a,l)}mount(t){this.isSVGTag=JO(t.tagName),super.mount(t)}}const vH=Dp.length;function tM(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?tM(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<vH;r++){const a=Dp[r],l=e.props[a];(Kd(l)||l===!1)&&(t[a]=l)}return t}function nM(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let a=0;a<r;a++)if(t[a]!==e[a])return!1;return!0}const wH=[...Nw].reverse(),jH=Nw.length;function SH(e){return t=>Promise.all(t.map(({animation:r,options:a})=>C9(e,r,a)))}function NH(e){let t=SH(e),r=aT(),a=!0,l=!1;const c=m=>(x,p)=>{var v;const b=Dl(e,p,m==="exit"?(v=e.presenceContext)==null?void 0:v.custom:void 0);if(b){const{transition:j,transitionEnd:S,...N}=b;x={...x,...N,...S}}return x};function u(m){t=m(e)}function f(m){const{props:x}=e,p=tM(e.parent)||{},b=[],v=new Set;let j={},S=1/0;for(let C=0;C<jH;C++){const E=wH[C],T=r[E],O=x[E]!==void 0?x[E]:p[E],k=Kd(O),M=E===m?T.isActive:null;M===!1&&(S=C);let A=O===p[E]&&O!==x[E]&&k;if(A&&(a||l)&&e.manuallyAnimateOnMount&&(A=!1),T.protectedKeys={...j},!T.isActive&&M===null||!O&&!T.prevProp||Fg(O)||typeof O=="boolean")continue;if(E==="exit"&&T.isActive&&M!==!0){T.prevResolvedValues&&(j={...j,...T.prevResolvedValues});continue}const R=CH(T.prevProp,O);let z=R||E===m&&T.isActive&&!A&&k||C>S&&k,_=!1;const L=Array.isArray(O)?O:[O];let Y=L.reduce(c(E),{});M===!1&&(Y={});const{prevResolvedValues:P={}}=T,V={...P,...Y},U=q=>{z=!0,v.has(q)&&(_=!0,v.delete(q)),T.needsAnimating[q]=!0;const W=e.getValue(q);W&&(W.liveStyle=!1)};for(const q in V){const W=Y[q],B=P[q];if(j.hasOwnProperty(q))continue;let J=!1;Sv(W)&&Sv(B)?J=!nM(W,B)||R:J=W!==B,J?W!=null?U(q):v.add(q):W!==void 0&&v.has(q)?U(q):T.protectedKeys[q]=!0}T.prevProp=O,T.prevResolvedValues=Y,T.isActive&&(j={...j,...Y}),(a||l)&&e.blockInitialAnimation&&(z=!1);const H=A&&R;z&&(!H||_)&&b.push(...L.map(q=>{const W={type:E};if(typeof q=="string"&&(a||l)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:B}=e,J=Dl(B,q);if(B.enteringChildren&&J){const{delayChildren:X}=J.transition||{};W.delay=RO(B.enteringChildren,e,X)}}return{animation:q,options:W}}))}if(v.size){const C={};if(typeof x.initial!="boolean"){const E=Dl(e,Array.isArray(x.initial)?x.initial[0]:x.initial);E&&E.transition&&(C.transition=E.transition)}v.forEach(E=>{const T=e.getBaseTarget(E),O=e.getValue(E);O&&(O.liveStyle=!0),C[E]=T??null}),b.push({animation:C})}let N=!!b.length;return a&&(x.initial===!1||x.initial===x.animate)&&!e.manuallyAnimateOnMount&&(N=!1),a=!1,l=!1,N?t(b):Promise.resolve()}function h(m,x){var b;if(r[m].isActive===x)return Promise.resolve();(b=e.variantChildren)==null||b.forEach(v=>{var j;return(j=v.animationState)==null?void 0:j.setActive(m,x)}),r[m].isActive=x;const p=f(m);for(const v in r)r[v].protectedKeys={};return p}return{animateChanges:f,setActive:h,setAnimateFunction:u,getState:()=>r,reset:()=>{r=aT(),l=!0}}}function CH(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nM(t,e):!1}function wl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function aT(){return{animate:wl(!0),whileInView:wl(),whileHover:wl(),whileTap:wl(),whileDrag:wl(),whileFocus:wl(),exit:wl()}}function Av(e,t){e.min=t.min,e.max=t.max}function po(e,t){Av(e.x,t.x),Av(e.y,t.y)}function iT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const sM=1e-4,kH=1-sM,TH=1+sM,rM=.01,EH=0-rM,RH=0+rM;function qs(e){return e.max-e.min}function AH(e,t,r){return Math.abs(e-t)<=r}function lT(e,t,r,a=.5){e.origin=a,e.originPoint=pn(t.min,t.max,e.origin),e.scale=qs(r)/qs(t),e.translate=pn(r.min,r.max,e.origin)-e.originPoint,(e.scale>=kH&&e.scale<=TH||isNaN(e.scale))&&(e.scale=1),(e.translate>=EH&&e.translate<=RH||isNaN(e.translate))&&(e.translate=0)}function Dd(e,t,r,a){lT(e.x,t.x,r.x,a?a.originX:void 0),lT(e.y,t.y,r.y,a?a.originY:void 0)}function cT(e,t,r,a=0){const l=a?pn(r.min,r.max,a):r.min;e.min=l+t.min,e.max=e.min+qs(t)}function OH(e,t,r,a){cT(e.x,t.x,r.x,a==null?void 0:a.x),cT(e.y,t.y,r.y,a==null?void 0:a.y)}function uT(e,t,r,a=0){const l=a?pn(r.min,r.max,a):r.min;e.min=t.min-l,e.max=e.min+qs(t)}function Ip(e,t,r,a){uT(e.x,t.x,r.x,a==null?void 0:a.x),uT(e.y,t.y,r.y,a==null?void 0:a.y)}function dT(e,t,r,a,l){return e-=t,e=Mp(e,1/r,a),l!==void 0&&(e=Mp(e,1/l,a)),e}function MH(e,t=0,r=1,a=.5,l,c=e,u=e){if(Wo.test(t)&&(t=parseFloat(t),t=pn(u.min,u.max,t/100)-u.min),typeof t!="number")return;let f=pn(c.min,c.max,a);e===c&&(f-=t),e.min=dT(e.min,t,r,f,l),e.max=dT(e.max,t,r,f,l)}function fT(e,t,[r,a,l],c,u){MH(e,t[r],t[a],t[l],t.scale,c,u)}const DH=["x","scaleX","originX"],zH=["y","scaleY","originY"];function mT(e,t,r,a){fT(e.x,t,DH,r?r.x:void 0,a?a.x:void 0),fT(e.y,t,zH,r?r.y:void 0,a?a.y:void 0)}function hT(e){return e.translate===0&&e.scale===1}function oM(e){return hT(e.x)&&hT(e.y)}function pT(e,t){return e.min===t.min&&e.max===t.max}function PH(e,t){return pT(e.x,t.x)&&pT(e.y,t.y)}function gT(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aM(e,t){return gT(e.x,t.x)&&gT(e.y,t.y)}function xT(e){return qs(e.x)/qs(e.y)}function bT(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ho(e){return[e("x"),e("y")]}function IH(e,t,r){let a="";const l=e.x.translate/t.x,c=e.y.translate/t.y,u=(r==null?void 0:r.z)||0;if((l||c||u)&&(a=`translate3d(${l}px, ${c}px, ${u}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:m,rotate:x,pathRotation:p,rotateX:b,rotateY:v,skewX:j,skewY:S}=r;m&&(a=`perspective(${m}px) ${a}`),x&&(a+=`rotate(${x}deg) `),p&&(a+=`rotate(${p}deg) `),b&&(a+=`rotateX(${b}deg) `),v&&(a+=`rotateY(${v}deg) `),j&&(a+=`skewX(${j}deg) `),S&&(a+=`skewY(${S}deg) `)}const f=e.x.scale*t.x,h=e.y.scale*t.y;return(f!==1||h!==1)&&(a+=`scale(${f}, ${h})`),a||"none"}const _H=bw.length,yT=e=>typeof e=="string"?parseFloat(e):e,vT=e=>typeof e=="number"||ft.test(e);function LH(e,t,r,a,l,c){l?(e.opacity=pn(0,r.opacity??1,BH(a)),e.opacityExit=pn(t.opacity??1,0,$H(a))):c&&(e.opacity=pn(t.opacity??1,r.opacity??1,a));for(let u=0;u<_H;u++){const f=bw[u];let h=wT(t,f),m=wT(r,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||vT(h)===vT(m)?(e[f]=Math.max(pn(yT(h),yT(m),a),0),(Wo.test(m)||Wo.test(h))&&(e[f]+="%")):e[f]=m}(t.rotate||r.rotate)&&(e.rotate=pn(t.rotate||0,r.rotate||0,a))}function wT(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const BH=iM(0,.5,tO),$H=iM(.5,.95,jo);function iM(e,t,r){return a=>a<e?0:a>t?1:r(Gd(e,t,a))}function VH(e,t,r){const a=us(e)?e:Bl(e);return a.start(pw("",a,t,r)),a.animation}function Xd(e,t,r,a={passive:!0}){return e.addEventListener(t,r,a),()=>e.removeEventListener(t,r,a)}const UH=(e,t)=>e.depth-t.depth;class HH{constructor(){this.children=[],this.isDirty=!1}add(t){Z1(this.children,t),this.isDirty=!0}remove(t){kp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(UH),this.isDirty=!1,this.children.forEach(t)}}function FH(e,t){const r=js.now(),a=({timestamp:l})=>{const c=l-r;c>=t&&(ta(a),e(c-t))};return dn.setup(a,!0),()=>ta(a)}function Zh(e){return us(e)?e.get():e}class GH{constructor(){this.members=[]}add(t){Z1(this.members,t);for(let r=this.members.length-1;r>=0;r--){const a=this.members[r];if(a===t||a===this.lead||a===this.prevLead)continue;const l=a.instance;(!l||l.isConnected===!1)&&!a.snapshot&&(kp(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(kp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){var r;for(let a=this.members.indexOf(t)-1;a>=0;a--){const l=this.members[a];if(l.isPresent!==!1&&((r=l.instance)==null?void 0:r.isConnected)!==!1)return this.promote(l),!0}return!1}promote(t,r){var l;const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.updateSnapshot(),t.scheduleRender();const{layoutDependency:c}=a.options,{layoutDependency:u}=t.options;(c===void 0||c!==u)&&(t.resumeFrom=a,r&&(a.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),(l=t.root)!=null&&l.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,a,l,c,u;(a=(r=t.options).onExitComplete)==null||a.call(r),(u=(l=t.resumingFrom)==null?void 0:(c=l.options).onExitComplete)==null||u.call(c)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Jh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ey=["","X","Y","Z"],qH=1e3;let YH=0;function ty(e,t,r,a){const{latestValues:l}=t;l[e]&&(r[e]=l[e],t.setStaticValue(e,0),a&&(a[e]=0))}function lM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=zO(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:l,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",dn,!(l||c))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&lM(a)}function cM({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:a,resetTransform:l}){return class{constructor(u={},f=t==null?void 0:t()){this.id=YH++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(WH),this.nodes.forEach(nF),this.nodes.forEach(sF),this.nodes.forEach(QH)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new HH)}addEventListener(u,f){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new Tp),this.eventHandlers.get(u).add(f)}notifyListeners(u,...f){const h=this.eventHandlers.get(u);h&&h.notify(...f)}hasListeners(u){return this.eventHandlers.has(u)}mount(u){if(this.instance)return;this.isSVG=yw(u)&&!aH(u),this.instance=u;const{layoutId:f,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||f)&&(this.isLayoutDirty=!0),e){let x,p=0;const b=()=>this.root.updateBlockedByResize=!1;dn.read(()=>{p=window.innerWidth}),e(u,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,x&&x(),x=FH(b,250),Jh.hasAnimatedSinceResize&&(Jh.hasAnimatedSinceResize=!1,this.nodes.forEach(NT)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:x,hasLayoutChanged:p,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||m.getDefaultTransition()||lF,{onLayoutAnimationStart:S,onLayoutAnimationComplete:N}=m.getProps(),C=!this.targetLayout||!aM(this.targetLayout,v),E=!p&&b;if(this.options.layoutRoot||this.resumeFrom||E||p&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...hw(j,"layout"),onPlay:S,onComplete:N};(m.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(x,E,T.path)}else p||NT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ta(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rF),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let x=0;x<this.path.length;x++){const p=this.path[x];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:f,layout:h}=this.options;if(f===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const h=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),h&&this.nodes.forEach(JH),this.nodes.forEach(jT);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ST);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(eF),this.nodes.forEach(tF),this.nodes.forEach(KH),this.nodes.forEach(XH)):this.nodes.forEach(ST),this.clearAllSnapshots();const f=js.now();vs.delta=To(0,1e3/60,f-vs.timestamp),vs.timestamp=f,vs.isProcessing=!0,G0.update.process(vs),G0.preRender.process(vs),G0.render.process(vs),vs.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ZH),this.sharedNodes.forEach(oF)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!qs(this.snapshot.measuredBox.x)&&!qs(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=as()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(f=!1),f&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:h,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!l)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!oM(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,x=m!==this.prevTransformTemplateValue;u&&this.instance&&(f||Nl(this.latestValues)||x)&&(l(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const f=this.measurePageBox();let h=this.removeElementScroll(f);return u&&(h=this.removeTransform(h)),cF(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var m;const{visualElement:u}=this.options;if(!u)return as();const f=u.measureViewportBox();if(!(((m=this.scroll)==null?void 0:m.wasRoot)||this.path.some(uF))){const{scroll:x}=this.root;x&&(Yo(f.x,x.offset.x),Yo(f.y,x.offset.y))}return f}removeElementScroll(u){var h;const f=as();if(po(f,u),(h=this.scroll)!=null&&h.wasRoot)return f;for(let m=0;m<this.path.length;m++){const x=this.path[m],{scroll:p,options:b}=x;x!==this.root&&p&&b.layoutScroll&&(p.wasRoot&&po(f,u),Yo(f.x,p.offset.x),Yo(f.y,p.offset.y))}return f}applyTransform(u,f=!1,h){var x,p;const m=h||as();po(m,u);for(let b=0;b<this.path.length;b++){const v=this.path[b];!f&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Yo(m.x,-v.scroll.offset.x),Yo(m.y,-v.scroll.offset.y)),Nl(v.latestValues)&&Kh(m,v.latestValues,(x=v.layout)==null?void 0:x.layoutBox)}return Nl(this.latestValues)&&Kh(m,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),m}removeTransform(u){var h;const f=as();po(f,u);for(let m=0;m<this.path.length;m++){const x=this.path[m];if(!Nl(x.latestValues))continue;let p;x.instance&&(Tv(x.latestValues)&&x.updateSnapshot(),p=as(),po(p,x.measurePageBox())),mT(f,x.latestValues,(h=x.snapshot)==null?void 0:h.layoutBox,p)}return Nl(this.latestValues)&&mT(f,this.latestValues),f}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==vs.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var v;const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==f;if(!(u||h&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:x,layoutId:p}=this.options;if(!this.layout||!(x||p))return;this.resolvedRelativeTargetAt=vs.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=as(),this.targetWithTransforms=as()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OH(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):po(this.target,this.layout.layoutBox),$O(this.target,this.targetDelta)):po(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Tv(this.parent.latestValues)||BO(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(u,f,h){this.relativeParent=u,this.linkedParentVersion=u.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=as(),this.relativeTargetOrigin=as(),Ip(this.relativeTargetOrigin,f,h,this.options.layoutAnchor||void 0),po(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var j;const u=this.getLead(),f=!!this.resumingFrom||this!==u;let h=!0;if((this.isProjectionDirty||(j=this.parent)!=null&&j.isProjectionDirty)&&(h=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===vs.timestamp&&(h=!1),h)return;const{layout:m,layoutId:x}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||x))return;po(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,b=this.treeScale.y;V9(this.layoutCorrected,this.treeScale,this.path,f),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=as());const{target:v}=u;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(iT(this.prevProjectionDelta.x,this.projectionDelta.x),iT(this.prevProjectionDelta.y,this.projectionDelta.y)),Dd(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==b||!bT(this.projectionDelta.x,this.prevProjectionDelta.x)||!bT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var f;if((f=this.options.visualElement)==null||f.scheduleRender(),u){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Gc(),this.projectionDelta=Gc(),this.projectionDeltaWithTransform=Gc()}setAnimationOrigin(u,f=!1,h){const m=this.snapshot,x=m?m.latestValues:{},p={...this.latestValues},b=Gc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const v=as(),j=m?m.source:void 0,S=this.layout?this.layout.source:void 0,N=j!==S,C=this.getStack(),E=!C||C.members.length<=1,T=!!(N&&!E&&this.options.crossfade===!0&&!this.path.some(iF));this.animationProgress=0;let O;const k=h==null?void 0:h.interpolateProjection(u);this.mixTargetDelta=M=>{const A=M/1e3,R=k==null?void 0:k(A);R?(b.x.translate=R.x,b.x.scale=pn(u.x.scale,1,A),b.x.origin=u.x.origin,b.x.originPoint=u.x.originPoint,b.y.translate=R.y,b.y.scale=pn(u.y.scale,1,A),b.y.origin=u.y.origin,b.y.originPoint=u.y.originPoint):(CT(b.x,u.x,A),CT(b.y,u.y,A)),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ip(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),aF(this.relativeTarget,this.relativeTargetOrigin,v,A),O&&PH(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=as()),po(O,this.relativeTarget)),N&&(this.animationValues=p,LH(p,x,this.latestValues,A,T,E)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){var f,h,m;this.notifyListeners("animationStart"),(f=this.currentAnimation)==null||f.stop(),(m=(h=this.resumingFrom)==null?void 0:h.currentAnimation)==null||m.stop(),this.pendingAnimation&&(ta(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dn.update(()=>{Jh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bl(0)),this.motionValue.jump(0,!1),this.currentAnimation=VH(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:x=>{this.mixTargetDelta(x),u.onUpdate&&u.onUpdate(x)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),CU(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(qH),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead(),{targetWithTransforms:f,layout:h,latestValues:m}=u;let{target:x}=u;if(!(!f||!x||!h)){if(this!==u&&this.layout&&h&&uM(this.options.animationType,this.layout.layoutBox,h.layoutBox)){x=this.target||as();const p=qs(this.layout.layoutBox.x);x.x.min=u.target.x.min,x.x.max=x.x.min+p;const b=qs(this.layout.layoutBox.y);x.y.min=u.target.y.min,x.y.max=x.y.min+b}po(f,x),Kh(f,m),Dd(this.projectionDeltaWithTransform,this.layoutCorrected,f,m)}}registerSharedNode(u,f){this.sharedNodes.has(u)||this.sharedNodes.set(u,new GH),this.sharedNodes.get(u).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var f;const{layoutId:u}=this.options;return u?((f=this.getStack())==null?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:u}=this.options;return u?(f=this.getStack())==null?void 0:f.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),u&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let f=!1;const{latestValues:h}=u;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)return;const m={};h.z&&ty("z",u,m,this.animationValues);for(let x=0;x<ey.length;x++)ty(`rotate${ey[x]}`,u,m,this.animationValues),ty(`skew${ey[x]}`,u,m,this.animationValues);u.render();for(const x in m)u.setStaticValue(x,m[x]),this.animationValues&&(this.animationValues[x]=m[x]);u.scheduleRender()}applyProjectionStyles(u,f){if(!this.instance||this.isSVG)return;if(!this.isVisible){u.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,u.visibility="",u.opacity="",u.pointerEvents=Zh(f==null?void 0:f.pointerEvents)||"",u.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(u.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,u.pointerEvents=Zh(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Nl(this.latestValues)&&(u.transform=h?h({},""):"none",this.hasProjected=!1);return}u.visibility="";const x=m.animationValues||m.latestValues;this.applyTransformsToTarget();let p=IH(this.projectionDeltaWithTransform,this.treeScale,x);h&&(p=h(x,p)),u.transform=p;const{x:b,y:v}=this.projectionDelta;u.transformOrigin=`${b.origin*100}% ${v.origin*100}% 0`,m.animationValues?u.opacity=m===this?x.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:u.opacity=m===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const j in Rv){if(x[j]===void 0)continue;const{correct:S,applyTo:N,isCSSVariable:C}=Rv[j],E=p==="none"?x[j]:S(x[j],m);if(N){const T=N.length;for(let O=0;O<T;O++)u[N[O]]=E}else C?this.options.visualElement.renderState.vars[j]=E:u[j]=E}this.options.layoutId&&(u.pointerEvents=m===this?Zh(f==null?void 0:f.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var f;return(f=u.currentAnimation)==null?void 0:f.stop()}),this.root.nodes.forEach(jT),this.root.sharedNodes.clear()}}}function KH(e){e.updateLayout()}function XH(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:a,measuredBox:l}=e.layout,{animationType:c}=e.options,u=t.source!==e.layout.source;if(c==="size")Ho(p=>{const b=u?t.measuredBox[p]:t.layoutBox[p],v=qs(b);b.min=a[p].min,b.max=b.min+v});else if(c==="x"||c==="y"){const p=c==="x"?"y":"x";Av(u?t.measuredBox[p]:t.layoutBox[p],a[p])}else uM(c,t.layoutBox,a)&&Ho(p=>{const b=u?t.measuredBox[p]:t.layoutBox[p],v=qs(a[p]);b.max=b.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+v)});const f=Gc();Dd(f,a,t.layoutBox);const h=Gc();u?Dd(h,e.applyTransform(l,!0),t.measuredBox):Dd(h,a,t.layoutBox);const m=!oM(f);let x=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:b,layout:v}=p;if(b&&v){const j=e.options.layoutAnchor||void 0,S=as();Ip(S,t.layoutBox,b.layoutBox,j);const N=as();Ip(N,a,v.layoutBox,j),aM(S,N)||(x=!0),p.options.layoutRoot&&(e.relativeTarget=N,e.relativeTargetOrigin=S,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:a,snapshot:t,delta:h,layoutDelta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:x})}else if(e.isLead()){const{onExitComplete:a}=e.options;a&&a()}e.options.transition=void 0}function WH(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function QH(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ZH(e){e.clearSnapshot()}function jT(e){e.clearMeasurements()}function JH(e){e.isLayoutDirty=!0,e.updateLayout()}function ST(e){e.isLayoutDirty=!1}function eF(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function tF(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function NT(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nF(e){e.resolveTargetDelta()}function sF(e){e.calcProjection()}function rF(e){e.resetSkewAndRotation()}function oF(e){e.removeLeadSnapshot()}function CT(e,t,r){e.translate=pn(t.translate,0,r),e.scale=pn(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function kT(e,t,r,a){e.min=pn(t.min,r.min,a),e.max=pn(t.max,r.max,a)}function aF(e,t,r,a){kT(e.x,t.x,r.x,a),kT(e.y,t.y,r.y,a)}function iF(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lF={duration:.45,ease:[.4,0,.1,1]},TT=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ET=TT("applewebkit/")&&!TT("chrome/")?Math.round:jo;function RT(e){e.min=ET(e.min),e.max=ET(e.max)}function cF(e){RT(e.x),RT(e.y)}function uM(e,t,r){return e==="position"||e==="preserve-aspect"&&!AH(xT(t),xT(r),.2)}function uF(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const dF=cM({attachResizeListener:(e,t)=>Xd(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),ny={current:void 0},dM=cM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ny.current){const e=new dF({});e.mount(window),e.setOptions({layoutScroll:!0}),ny.current=e}return ny.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ef=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function AT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fF(...e){return t=>{let r=!1;const a=e.map(l=>{const c=AT(l,t);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let l=0;l<a.length;l++){const c=a[l];typeof c=="function"?c():AT(e[l],null)}}}}function mF(...e){return g.useCallback(fF(...e),e)}class hF extends g.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(Yh(r)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=r.offsetParent,l=Yh(a)&&a.offsetWidth||0,c=Yh(a)&&a.offsetHeight||0,u=getComputedStyle(r),f=this.props.sizeRef.current;f.height=parseFloat(u.height),f.width=parseFloat(u.width),f.top=r.offsetTop,f.left=r.offsetLeft,f.right=l-f.width-f.left,f.bottom=c-f.height-f.top,f.direction=u.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function pF({children:e,isPresent:t,anchorX:r,anchorY:a,root:l,pop:c}){var b;const u=g.useId(),f=g.useRef(null),h=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:m}=g.useContext(Ef),x=c!==!1?((b=e.props)==null?void 0:b.ref)??(e==null?void 0:e.ref):void 0,p=mF(f,x);return g.useInsertionEffect(()=>{const{width:v,height:j,top:S,left:N,right:C,bottom:E,direction:T}=h.current;if(t||c===!1||!f.current||!v||!j)return;const O=T==="rtl",k=r==="left"?O?`right: ${C}`:`left: ${N}`:O?`left: ${N}`:`right: ${C}`,M=a==="bottom"?`bottom: ${E}`:`top: ${S}`;f.current.dataset.motionPopId=u;const A=document.createElement("style");m&&(A.nonce=m);const R=l??document.head;return R.appendChild(A),A.sheet&&A.sheet.insertRule(`
|
|
497
|
+
[data-motion-pop-id="${u}"] {
|
|
498
|
+
position: absolute !important;
|
|
499
|
+
width: ${v}px !important;
|
|
500
|
+
height: ${j}px !important;
|
|
501
|
+
${k}px !important;
|
|
502
|
+
${M}px !important;
|
|
503
|
+
}
|
|
504
|
+
`),()=>{var z;(z=f.current)==null||z.removeAttribute("data-motion-pop-id"),R.contains(A)&&R.removeChild(A)}},[t]),s.jsx(hF,{isPresent:t,childRef:f,sizeRef:h,pop:c,children:c===!1?e:g.cloneElement(e,{ref:p})})}const gF=({children:e,initial:t,isPresent:r,onExitComplete:a,custom:l,presenceAffectsLayout:c,mode:u,anchorX:f,anchorY:h,root:m})=>{const x=Nf(xF),p=g.useId(),b=g.useRef(r),v=g.useRef(a);cu(()=>{b.current=r,v.current=a});let j=!0,S=g.useMemo(()=>(j=!1,{id:p,initial:t,isPresent:r,custom:l,onExitComplete:N=>{x.set(N,!0);for(const C of x.values())if(!C)return;a&&a()},register:N=>(x.set(N,!1),()=>{var C;x.delete(N),!b.current&&!x.size&&((C=v.current)==null||C.call(v))})}),[r,x,a]);return c&&j&&(S={...S}),g.useMemo(()=>{x.forEach((N,C)=>x.set(C,!1))},[r]),g.useEffect(()=>{!r&&!x.size&&a&&a()},[r]),e=s.jsx(pF,{pop:u==="popLayout",isPresent:r,anchorX:f,anchorY:h,root:m,children:e}),s.jsx($g.Provider,{value:S,children:e})};function xF(){return new Map}function fM(e=!0){const t=g.useContext($g);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:a,register:l}=t,c=g.useId();g.useEffect(()=>{if(e)return l(c)},[e]);const u=g.useCallback(()=>e&&a&&a(c),[c,a,e]);return!r&&a?[!1,u]:[!0]}const yh=e=>e.key||"";function OT(e){const t=[];return g.Children.forEach(e,r=>{g.isValidElement(r)&&t.push(r)}),t}const Rf=({children:e,custom:t,initial:r=!0,onExitComplete:a,presenceAffectsLayout:l=!0,mode:c="sync",propagate:u=!1,anchorX:f="left",anchorY:h="top",root:m})=>{const[x,p]=fM(u),b=g.useMemo(()=>OT(e),[e]),v=u&&!x?[]:b.map(yh),j=g.useRef(!0),S=g.useRef(b),N=Nf(()=>new Map),C=g.useRef(new Set),[E,T]=g.useState(b),[O,k]=g.useState(b);cu(()=>{u&&!x&&!O.length&&(p==null||p())},[x,u,O.length,p]),cu(()=>{j.current=!1,S.current=b;for(let R=0;R<O.length;R++){const z=yh(O[R]);v.includes(z)?(N.delete(z),C.current.delete(z)):N.get(z)!==!0&&N.set(z,!1)}},[O,v.length,v.join("-")]);const M=[];if(b!==E){let R=[...b],z=0;for(const _ of O){const L=v.indexOf(yh(_));L===-1?(R.splice(z++,0,_),M.push(_)):z=L+M.length+1}return c==="wait"&&M.length&&(R=M),k(OT(R)),T(b),null}const{forceRender:A}=g.useContext(Q1);return s.jsx(s.Fragment,{children:O.map(R=>{const z=yh(R),_=u&&!x?!1:b===O||v.includes(z),L=()=>{if(C.current.has(z))return;if(N.has(z))C.current.add(z),N.set(z,!0);else return;let Y=!0;N.forEach(P=>{P||(Y=!1)}),Y&&(A==null||A(),k(S.current),u&&(p==null||p()),a&&a())};return s.jsx(gF,{isPresent:_,initial:!j.current||r?void 0:!1,custom:t,presenceAffectsLayout:l,mode:c,root:m,onExitComplete:_?void 0:L,anchorX:f,anchorY:h,children:R},z)})})},mM=g.createContext({strict:!1}),MT={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let DT=!1;function bF(){if(DT)return;const e={};for(const t in MT)e[t]={isEnabled:r=>MT[t].some(a=>!!r[a])};KO(e),DT=!0}function hM(){return bF(),mH()}function yF(e){const t=hM();for(const r in e)t[r]={...t[r],...e[r]};KO(t)}const qg=g.createContext({});function vF(e,t){if(Gg(e)){const{initial:r,animate:a}=e;return{initial:r===!1||Kd(r)?r:void 0,animate:Kd(a)?a:void 0}}return e.inherit!==!1?t:{}}function wF(e){const{initial:t,animate:r}=vF(e,g.useContext(qg));return g.useMemo(()=>({initial:t,animate:r}),[zT(t),zT(r)])}function zT(e){return Array.isArray(e)?e.join(" "):e}const Tw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function pM(e,t,r){for(const a in t)!us(t[a])&&!QO(a,r)&&(e[a]=t[a])}function jF({transformTemplate:e},t){return g.useMemo(()=>{const r=Tw();return ww(r,t,e),Object.assign({},r.vars,r.style)},[t])}function SF(e,t){const r=e.style||{},a={};return pM(a,r,e),Object.assign(a,jF(e,t)),a}function NF(e,t){const r={},a=SF(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=a,r}const gM=()=>({...Tw(),attrs:{}});function CF(e,t,r,a){const l=g.useMemo(()=>{const c=gM();return _O(c,t,JO(a),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[t]);if(e.style){const c={};pM(c,e.style,e),l.style={...c,...l.style}}return l}const kF=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function _p(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||kF.has(e)}function TF(e,t){return e.startsWith("on")?!_p(e):(t==null?void 0:t(e))??!_p(e)}function EF(e,t,r,a){const l={};for(const c in e)c==="values"&&typeof e.values=="object"||us(e[c])||(TF(c,a)||r===!0&&_p(c)||!t&&!_p(c)||e.draggable&&c.startsWith("onDrag"))&&(l[c]=e[c]);return l}const RF=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ew(e){return typeof e!="string"||e.includes("-")?!1:!!(RF.indexOf(e)>-1||/[A-Z]/u.test(e))}function AF(e,t,r,{latestValues:a},l,c=!1,u,f){const m=(u??Ew(e)?CF:NF)(t,a,l,e),x=EF(t,typeof e=="string",c,f),p=e!==g.Fragment?{...x,...m,ref:r}:{},{children:b}=t,v=g.useMemo(()=>us(b)?b.get():b,[b]);return g.createElement(e,{...p,children:v})}function OF({scrapeMotionValuesFromProps:e,createRenderState:t},r,a,l){return{latestValues:MF(r,a,l,e),renderState:t()}}function MF(e,t,r,a){const l={},c=a(e,{});for(const b in c)l[b]=Zh(c[b]);let{initial:u,animate:f}=e;const h=Gg(e),m=qO(e);t&&m&&!h&&e.inherit!==!1&&(u===void 0&&(u=t.initial),f===void 0&&(f=t.animate));let x=r?r.initial===!1:!1;x=x||u===!1;const p=x?f:u;if(p&&typeof p!="boolean"&&!Fg(p)){const b=Array.isArray(p)?p:[p];for(let v=0;v<b.length;v++){const j=gw(e,b[v]);if(j){const{transitionEnd:S,transition:N,...C}=j;for(const E in C){let T=C[E];if(Array.isArray(T)){const O=x?T.length-1:0;T=T[O]}T!==null&&(l[E]=T)}for(const E in S)l[E]=S[E]}}}return l}const xM=e=>(t,r)=>{const a=g.useContext(qg),l=g.useContext($g),c=()=>OF(e,t,a,l);return r?c():Nf(c)},DF=xM({scrapeMotionValuesFromProps:kw,createRenderState:Tw}),zF=xM({scrapeMotionValuesFromProps:eM,createRenderState:gM}),PF=Symbol.for("motionComponentSymbol");function IF(e,t,r){const a=g.useRef(r);g.useInsertionEffect(()=>{a.current=r});const l=g.useRef(null);return g.useCallback(c=>{var f;c&&((f=e.onMount)==null||f.call(e,c)),t&&(c?t.mount(c):t.unmount());const u=a.current;if(typeof u=="function")if(c){const h=u(c);typeof h=="function"&&(l.current=h)}else l.current?(l.current(),l.current=null):u(c);else u&&(u.current=c)},[t])}const bM=g.createContext({});function Uc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _F(e,t,r,a,l,c){var T,O;const{visualElement:u}=g.useContext(qg),f=g.useContext(mM),h=g.useContext($g),m=g.useContext(Ef),x=m.reducedMotion,p=m.skipAnimations,b=g.useRef(null),v=g.useRef(!1);a=a||f.renderer,!b.current&&a&&(b.current=a(e,{visualState:t,parent:u,props:r,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:x,skipAnimations:p,isSVG:c}),v.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const j=b.current,S=g.useContext(bM);j&&!j.projection&&l&&(j.type==="html"||j.type==="svg")&&LF(b.current,r,l,S);const N=g.useRef(!1);g.useInsertionEffect(()=>{j&&N.current&&j.update(r,h)});const C=r[DO],E=g.useRef(!!C&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,C))&&((O=window.MotionHasOptimisedAnimation)==null?void 0:O.call(window,C)));return cu(()=>{var k;!v.current||!j||((k=j.animationState)==null||k.animateChanges(),j.enteringChildren=void 0)},[]),cu(()=>{v.current=!0,j&&(N.current=!0,window.MotionIsMounted=!0,j.updateFeatures(),j.scheduleRenderMicrotask(),E.current&&j.animationState&&j.animationState.animateChanges())}),g.useEffect(()=>{j&&(!E.current&&j.animationState&&j.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,C)}),E.current=!1),j.enteringChildren=void 0)}),j}function LF(e,t,r,a){const{layoutId:l,layout:c,drag:u,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutAnchor:x,layoutCrossfade:p}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:yM(e.parent)),e.projection.setOptions({layoutId:l,layout:c,alwaysMeasureLayout:!!u||f&&Uc(f),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:a,crossfade:p,layoutScroll:h,layoutRoot:m,layoutAnchor:x})}function yM(e){if(e)return e.options.allowProjection!==!1?e.projection:yM(e.parent)}function sy(e,{forwardMotionProps:t=!1,type:r}={},a,l){a&&yF(a);const c=r?r==="svg":Ew(e),u=c?zF:DF;function f(m,x){let p;const b={...g.useContext(Ef),...m,layoutId:BF(m)},{isStatic:v,isValidProp:j}=b,S=wF(m),N=u(m,v);if(!v&&typeof window<"u"){$F();const C=VF(b);p=C.MeasureLayout,S.visualElement=_F(e,N,b,l,C.ProjectionNode,c)}return s.jsxs(qg.Provider,{value:S,children:[p&&S.visualElement?s.jsx(p,{visualElement:S.visualElement,...b}):null,AF(e,m,IF(N,S.visualElement,x),N,v,t,c,j)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=g.forwardRef(f);return h[PF]=e,h}function BF({layoutId:e}){const t=g.useContext(Q1).id;return t&&e!==void 0?t+"-"+e:e}function $F(e,t){g.useContext(mM).strict}function VF(e){const t=hM(),{drag:r,layout:a}=t;if(!r&&!a)return{};const l={...r,...a};return{MeasureLayout:r!=null&&r.isEnabled(e)||a!=null&&a.isEnabled(e)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}function UF(e,t){if(typeof Proxy>"u")return sy;const r=new Map,a=(c,u)=>sy(c,u,e,t),l=(c,u)=>a(c,u);return new Proxy(l,{get:(c,u)=>u==="create"?a:(r.has(u)||r.set(u,sy(u,void 0,e,t)),r.get(u))})}const HF=(e,t)=>t.isSVG??Ew(e)?new yH(t):new xH(t,{allowProjection:e!==g.Fragment});class FF extends Ui{constructor(t){super(t),t.animationState||(t.animationState=NH(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Fg(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let GF=0;class qF extends Ui{constructor(){super(...arguments),this.id=GF++,this.isExitComplete=!1}update(){var c;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:u,custom:f}=this.node.getProps();if(typeof u=="string"||typeof u=="object"&&u!==null&&!Array.isArray(u)){const h=Dl(this.node,u,f);if(h){const{transition:m,transitionEnd:x,...p}=h;for(const b in p)(c=this.node.getValue(b))==null||c.jump(p[b])}}this.node.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}const l=this.exitAnimation=this.node.animationState.setActive("exit",!t);r&&!t&&l.then(()=>{this.exitAnimation===l&&(this.isExitComplete=!0,r(this.id))})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const YF={animation:{Feature:FF},exit:{Feature:qF}};function Yg(e){return{point:{x:e.pageX,y:e.pageY}}}const KF=e=>t=>Sw(t)&&e(t,Yg(t));function zd(e,t,r,a){return Xd(e,t,KF(r),a)}const vM=({current:e})=>e?e.ownerDocument.defaultView:null,PT=(e,t)=>Math.abs(e-t);function XF(e,t){const r=PT(e.x,t.x),a=PT(e.y,t.y);return Math.sqrt(r**2+a**2)}const IT=new Set(["auto","scroll"]);class wM{constructor(t,r,{transformPagePoint:a,contextWindow:l=window,dragSnapToOrigin:c=!1,distanceThreshold:u=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=j=>{this.handleScroll(j.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vh(this.lastRawMoveEventInfo,this.transformPagePoint));const j=ry(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,N=XF(j.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!N)return;const{point:C}=j;this.history.push({...C,timestamp:js.now()});const{onStart:E,onMove:T}=this.handlers;S||(E&&E(this.lastMoveEvent,j),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,j)},this.handlePointerMove=(j,S)=>{this.lastMoveEvent=j,this.lastRawMoveEventInfo=S,this.lastMoveEventInfo=vh(S,this.transformPagePoint),this.hasPendingMove=!0,dn.update(this.updatePoint,!0)},this.handlePointerUp=(j,S)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:N,onSessionEnd:C,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=ry(j.type==="pointercancel"?this.lastMoveEventInfo:vh(S,this.transformPagePoint),this.history);this.startEvent&&N&&N(j,T),C&&C(j,T)},!Sw(t))return;this.dragSnapToOrigin=c,this.handlers=r,this.transformPagePoint=a,this.distanceThreshold=u,this.contextWindow=l||window;const h=Yg(t),m=vh(h,this.transformPagePoint),{point:x}=m,{timestamp:p}=vs;this.history=[{...x,timestamp:p}];const{onSessionStart:b}=r;b&&b(t,ry(m,this.history));const v={passive:!0,capture:!0};this.removeListeners=Cf(zd(this.contextWindow,"pointermove",this.handlePointerMove,v),zd(this.contextWindow,"pointerup",this.handlePointerUp,v),zd(this.contextWindow,"pointercancel",this.handlePointerUp,v)),f&&this.startScrollTracking(f)}startScrollTracking(t){let r=t.parentElement;for(;r;){const a=getComputedStyle(r);(IT.has(a.overflowX)||IT.has(a.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const r=this.scrollPositions.get(t);if(!r)return;const a=t===window,l=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},c={x:l.x-r.x,y:l.y-r.y};c.x===0&&c.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,l),dn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ta(this.updatePoint)}}function vh(e,t){return t?{point:t(e.point)}:e}function _T(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ry({point:e},t){return{point:e,delta:_T(e,jM(t)),offset:_T(e,WF(t)),velocity:QF(t,.1)}}function WF(e){return e[0]}function jM(e){return e[e.length-1]}function QF(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,a=null;const l=jM(e);for(;r>=0&&(a=e[r],!(l.timestamp-a.timestamp>Gr(t)));)r--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&l.timestamp-a.timestamp>Gr(t)*2&&(a=e[1]);const c=Sr(l.timestamp-a.timestamp);if(c===0)return{x:0,y:0};const u={x:(l.x-a.x)/c,y:(l.y-a.y)/c};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function ZF(e,{min:t,max:r},a){return t!==void 0&&e<t?e=a?pn(t,e,a.min):Math.max(e,t):r!==void 0&&e>r&&(e=a?pn(r,e,a.max):Math.min(e,r)),e}function LT(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function JF(e,{top:t,left:r,bottom:a,right:l}){return{x:LT(e.x,r,l),y:LT(e.y,t,a)}}function BT(e,t){let r=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,a]=[a,r]),{min:r,max:a}}function eG(e,t){return{x:BT(e.x,t.x),y:BT(e.y,t.y)}}function tG(e,t){let r=.5;const a=qs(e),l=qs(t);return l>a?r=Gd(t.min,t.max-a,e.min):a>l&&(r=Gd(e.min,e.max-l,t.min)),To(0,1,r)}function nG(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const Ov=.35;function sG(e=Ov){return e===!1?e=0:e===!0&&(e=Ov),{x:$T(e,"left","right"),y:$T(e,"top","bottom")}}function $T(e,t,r){return{min:VT(e,t),max:VT(e,r)}}function VT(e,t){return typeof e=="number"?e:e[t]||0}const rG=new WeakMap;class oG{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=as(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:a}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const c=p=>{r&&this.snapToCursor(p),this.stopAnimation()},u=(p,b)=>{const{drag:v,dragPropagation:j,onDragStart:S}=this.getProps();if(v&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=H9(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ho(C=>{let E=this.getAxisMotionValue(C).get()||0;if(Wo.test(E)){const{projection:T}=this.visualElement;if(T&&T.layout){const O=T.layout.layoutBox[C];O&&(E=qs(O)*(parseFloat(E)/100))}}this.originPoint[C]=E}),S&&dn.update(()=>S(p,b),!1,!0),Nv(this.visualElement,"transform");const{animationState:N}=this.visualElement;N&&N.setActive("whileDrag",!0)},f=(p,b)=>{this.latestPointerEvent=p,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:j,onDirectionLock:S,onDrag:N}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:C}=b;if(j&&this.currentDirection===null){this.currentDirection=iG(C),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",b.point,C),this.updateAxis("y",b.point,C),this.visualElement.render(),N&&dn.update(()=>N(p,b),!1,!0)},h=(p,b)=>{this.latestPointerEvent=p,this.latestPanInfo=b,this.stop(p,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:x}=this.getProps();this.panSession=new wM(t,{onSessionStart:c,onStart:u,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:x,distanceThreshold:a,contextWindow:vM(this.visualElement),element:this.visualElement.current})}stop(t,r){const a=t||this.latestPointerEvent,l=r||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!l||!a)return;const{velocity:u}=l;this.startAnimation(u);const{onDragEnd:f}=this.getProps();f&&dn.postRender(()=>f(a,l))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,a){const{drag:l}=this.getProps();if(!a||!wh(t,l,this.currentDirection))return;const c=this.getAxisMotionValue(t);let u=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(u=ZF(u,this.constraints[t],this.elastic[t])),c.set(u)}resolveConstraints(){var c;const{dragConstraints:t,dragElastic:r}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(c=this.visualElement.projection)==null?void 0:c.layout,l=this.constraints;t&&Uc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=JF(a.layoutBox,t):this.constraints=!1,this.elastic=sG(r),l!==this.constraints&&!Uc(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&Ho(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=nG(a.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Uc(t))return!1;const a=t.current,{projection:l}=this.visualElement;if(!l||!l.layout)return!1;l.root&&(l.root.scroll=void 0,l.root.updateScroll());const c=U9(a,l.root,this.visualElement.getTransformPagePoint());let u=eG(l.layout.layoutBox,c);if(r){const f=r(B9(u));this.hasMutatedConstraints=!!f,f&&(u=LO(f))}return u}startAnimation(t){const{drag:r,dragMomentum:a,dragElastic:l,dragTransition:c,dragSnapToOrigin:u,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=Ho(x=>{if(!wh(x,r,this.currentDirection))return;let p=h&&h[x]||{};(u===!0||u===x)&&(p={min:0,max:0});const b=l?200:1e6,v=l?40:1e7,j={type:"inertia",velocity:a?t[x]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...c,...p};return this.startAxisValueAnimation(x,j)});return Promise.all(m).then(f)}startAxisValueAnimation(t,r){const a=this.getAxisMotionValue(t);return Nv(this.visualElement,t),a.start(pw(t,a,0,r,this.visualElement,!1))}stopAnimation(){Ho(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,l=this.visualElement.getProps()[r];return l||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:r}){var f;const{drag:a}=this.getProps(),l={x:t,y:r},c=((f=this.visualElement.getTransformPagePoint())==null?void 0:f(l))||l,u=this.visualElement.measureViewportBox();Ho(h=>{if(!wh(h,a,this.currentDirection))return;const m=this.getAxisMotionValue(h),{min:x,max:p}=u[h];m.set((m.get()||0)+c[h]-pn(x,p,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:a}=this.visualElement;if(!Uc(r)||!a||!this.constraints)return;this.stopAnimation();const l=this.constraints,c={x:0,y:0};Ho(f=>{const h=this.getAxisMotionValue(f).get();c[f]=tG({min:h,max:h},l[f])});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ho(f=>{const h=this.getAxisMotionValue(f);if(!wh(f,t,null)||!h.get())return;const{min:m,max:x}=this.constraints[f];h.set(pn(m,x,c[f]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;rG.set(this.visualElement,this);const t=this.visualElement.current,r=zd(t,"pointerdown",m=>{const{drag:x,dragListener:p=!0}=this.getProps(),b=m.target,v=b!==t&&X9(b);x&&p&&!v&&this.start(m)});let a;const l=()=>{const{dragConstraints:m}=this.getProps();Uc(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),a||(a=aG(t,m.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,u=c.addEventListener("measure",l);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),dn.read(l);const f=Xd(window,"resize",()=>this.scalePositionWithinConstraints()),h=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:x})=>{this.isDragging&&x&&(Ho(p=>{const b=this.getAxisMotionValue(p);b&&(this.originPoint[p]+=m[p].translate,b.set(b.get()+m[p].translate))}),this.visualElement.render())}));return()=>{f(),r(),u(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:a=!1,dragPropagation:l=!1,dragConstraints:c=!1,dragElastic:u=Ov,dragMomentum:f=!0}=t;return{...t,drag:r,dragDirectionLock:a,dragPropagation:l,dragConstraints:c,dragElastic:u,dragMomentum:f}}}function UT(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function aG(e,t,r){const a=Zk(e,UT(r)),l=Zk(t,UT(r));return()=>{a(),l()}}function wh(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function iG(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class lG extends Ui{constructor(t){super(t),this.removeGroupControls=jo,this.removeListeners=jo,this.controls=new oG(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jo}update(){const{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const oy=e=>(t,r)=>{e&&dn.update(()=>e(t,r),!1,!0)};class cG extends Ui{constructor(){super(...arguments),this.removePointerDownListener=jo}onPointerDown(t){this.session=new wM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:a,onPanEnd:l}=this.node.getProps();return{onSessionStart:oy(t),onStart:oy(r),onMove:oy(a),onEnd:(c,u)=>{delete this.session,l&&dn.postRender(()=>l(c,u))}}}mount(){this.removePointerDownListener=zd(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ay=!1;class uG extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:a,layoutId:l}=this.props,{projection:c}=t;c&&(r.group&&r.group.add(c),a&&a.register&&l&&a.register(c),ay&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:a,drag:l,isPresent:c}=this.props,{projection:u}=a;return u&&(u.isPresent=c,t.layoutDependency!==r&&u.setOptions({...u.options,layoutDependency:r}),ay=!0,l||t.layoutDependency!==r||r===void 0||t.isPresent!==c?u.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?u.promote():u.relegate()||dn.postRender(()=>{const f=u.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:r}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=r,a.root.didUpdate(),jw.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:a}=this.props,{projection:l}=t;ay=!0,l&&(l.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(l),a&&a.deregister&&a.deregister(l))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function SM(e){const[t,r]=fM(),a=g.useContext(Q1);return s.jsx(uG,{...e,layoutGroup:a,switchLayoutGroup:g.useContext(bM),isPresent:t,safeToRemove:r})}const dG={pan:{Feature:cG},drag:{Feature:lG,ProjectionNode:dM,MeasureLayout:SM}};function HT(e,t,r){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",r==="Start");const l="onHover"+r,c=a[l];c&&dn.postRender(()=>c(t,Yg(t)))}class fG extends Ui{mount(){const{current:t}=this.node;t&&(this.unmount=G9(t,(r,a)=>(HT(this.node,a,"Start"),l=>HT(this.node,l,"End"))))}unmount(){}}class mG extends Ui{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Cf(Xd(this.node.current,"focus",()=>this.onFocus()),Xd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function FT(e,t,r){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",r==="Start");const l="onTap"+(r==="End"?"":r),c=a[l];c&&dn.postRender(()=>c(t,Yg(t)))}class hG extends Ui{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:r,propagate:a}=this.node.props;this.unmount=Q9(t,(l,c)=>(FT(this.node,c,"Start"),(u,{success:f})=>FT(this.node,u,f?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(a==null?void 0:a.tap)===!1})}unmount(){}}const Mv=new WeakMap,iy=new WeakMap,pG=e=>{const t=Mv.get(e.target);t&&t(e)},gG=e=>{e.forEach(pG)};function xG({root:e,...t}){const r=e||document;iy.has(r)||iy.set(r,{});const a=iy.get(r),l=JSON.stringify(t);return a[l]||(a[l]=new IntersectionObserver(gG,{root:e,...t})),a[l]}function bG(e,t,r){const a=xG(t);return Mv.set(e,r),a.observe(e),()=>{Mv.delete(e),a.unobserve(e)}}const yG={some:0,all:1};class vG extends Ui{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var h;(h=this.stopObserver)==null||h.call(this);const{viewport:t={}}=this.node.getProps(),{root:r,margin:a,amount:l="some",once:c}=t,u={root:r?r.current:void 0,rootMargin:a,threshold:typeof l=="number"?l:yG[l]},f=m=>{const{isIntersecting:x}=m;if(this.isInView===x||(this.isInView=x,c&&!x&&this.hasEnteredView))return;x&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",x);const{onViewportEnter:p,onViewportLeave:b}=this.node.getProps(),v=x?p:b;v&&v(m)};this.stopObserver=bG(this.node.current,u,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(wG(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function wG({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const jG={inView:{Feature:vG},tap:{Feature:hG},focus:{Feature:mG},hover:{Feature:fG}},SG={layout:{ProjectionNode:dM,MeasureLayout:SM}},NG={...YF,...jG,...dG,...SG},CG=UF(NG,HF);function Rw(e){const t=Nf(()=>Bl(e)),{isStatic:r}=g.useContext(Ef);if(r){const[,a]=g.useState(e);g.useEffect(()=>t.on("change",a),[])}return t}function NM(e,t){const r=Rw(t()),a=()=>r.set(t());return a(),cu(()=>{const l=()=>dn.preRender(a,!1,!0),c=e.map(u=>u.on("change",l));return()=>{c.forEach(u=>u()),ta(a)}}),r}function kG(e){Md.current=[],e();const t=NM(Md.current,e);return Md.current=void 0,t}function TG(e,t,r,a){if(typeof e=="function")return kG(e);const c=iH(t,r,a),u=Array.isArray(e)?GT(e,c):GT([e],([h])=>c(h)),f=Array.isArray(e)?void 0:e.accelerate;return f&&!f.isTransformed&&typeof t!="function"&&Array.isArray(r)&&(a==null?void 0:a.clamp)!==!1&&(u.accelerate={...f,times:t,keyframes:r,isTransformed:!0}),u}function GT(e,t){const r=Nf(()=>[]);return NM(e,()=>{r.length=0;const a=e.length;for(let l=0;l<a;l++)r[l]=e[l].get();return t(r)})}function EG(e,t={}){const{isStatic:r}=g.useContext(Ef),a=()=>us(e)?e.get():e;if(r)return TG(a);const l=Rw(a());return g.useInsertionEffect(()=>cH(l,e,t),[l,JSON.stringify(t)]),l}function RG(e,t={}){return EG(e,{type:"spring",...t})}function lr(){!Cw.current&&YO();const[e]=g.useState(zp.current);return e}const AG={some:0,all:1};function OG(e,t,{root:r,margin:a,amount:l="some"}={}){const c=vw(e),u=new WeakMap,f=m=>{m.forEach(x=>{const p=u.get(x.target);if(x.isIntersecting!==!!p)if(x.isIntersecting){const b=t(x.target,x);typeof b=="function"?u.set(x.target,b):h.unobserve(x.target)}else typeof p=="function"&&(p(x),u.delete(x.target))})},h=new IntersectionObserver(f,{root:r,rootMargin:a,threshold:typeof l=="number"?l:AG[l]});return c.forEach(m=>h.observe(m)),()=>h.disconnect()}function CM(e,{root:t,margin:r,amount:a,once:l=!1,initial:c=!1}={}){const[u,f]=g.useState(c);return g.useEffect(()=>{if(!e.current||l&&u)return;const h=()=>(f(!0),l?void 0:()=>f(!1)),m={root:t&&t.current||void 0,margin:r,amount:a};return OG(e.current,h,m)},[t,e,r,l,a]),u}const Yn=CG,qT=e=>typeof e=="function"?void 0:e.filter;function So({children:e,className:t,variant:r,duration:a=.4,delay:l=0,offset:c=6,direction:u="down",inView:f=!1,inViewMargin:h="-50px",blur:m="6px",...x}){const p=g.useRef(null),b=CM(p,{once:!0,margin:h}),v=!f||b,j=lr(),S={hidden:{[u==="left"||u==="right"?"x":"y"]:u==="right"||u==="down"?-c:c,opacity:0,filter:`blur(${m})`},visible:{[u==="left"||u==="right"?"x":"y"]:0,opacity:1,filter:"blur(0px)"}},N=r??S,C=qT(N.hidden),E=qT(N.visible),T=C!=null&&E!=null&&C!==E;return s.jsx(Rf,{children:s.jsx(Yn.div,{ref:p,initial:j?!1:"hidden",animate:v?"visible":"hidden",exit:"hidden",variants:N,transition:{delay:.04+l,duration:j?0:a,ease:"easeOut",...T?{filter:{duration:a}}:{}},className:t,...x,children:e})})}function zt({className:e,...t}){return s.jsx(ou,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:hs("size-4 animate-spin motion-reduce:animate-none",e),...t})}const Kg=[{name:"Claude Code",logo:"claudecode",commands:["claude","claude-code"]},{name:"Codex",logo:"codex",commands:["codex"]},{name:"GitHub Copilot",logo:"copilot",commands:["copilot"]},{name:"Cursor",logo:"cursor",commands:["cursor-agent","agent"],aliases:["Cursor CLI"]},{name:"Gemini CLI",logo:"gemini",commands:["gemini"]},{name:"OpenCode",logo:"opencode",commands:["opencode"]},{name:"OpenClaw",logo:"openclaw-color",commands:["openclaw"]},{name:"Pi",logo:"pi",commands:["pi"]},{name:"Antigravity CLI",logo:"antigravity",commands:["agy"],aliases:["Antigravity"]},{name:"Kiro CLI",logo:"kiro",commands:["kiro-cli"],aliases:["Kiro"]},{name:"Factory Droid",logo:"factory",commands:["droid"],aliases:["Droid","Factory"]},{name:"Aider",logo:"aider",commands:["aider"]}];function kM(e){var m,x;const t=(e==null?void 0:e.labels)??{},r=t["openshell.console/agents"]||t["openshell.console/agent"],a=typeof r=="string"?r.split(/[,\n]/).map(p=>p.trim()).filter(Boolean):[],l=Array.isArray(e==null?void 0:e.command)?(m=e.command[0])==null?void 0:m.split("/").pop():null,c=(x=e==null?void 0:e.agentInventory)==null?void 0:x.agents,u=a.length>0,h=(Array.isArray(c)?c:u?a:l&&l!=="agent"?[l]:[]).flatMap(p=>{var v,j;const b=Kg.find(S=>{var N;return S.name.toLowerCase()===p.toLowerCase()||S.commands.includes(p.toLowerCase())||((N=S.aliases)==null?void 0:N.some(C=>C.toLowerCase()===p.toLowerCase()))});return b?[{resources:(j=(v=e==null?void 0:e.agentInventory)==null?void 0:v.resources)==null?void 0:j[b.name],name:b.name,logo:`/logos/agents/${b.logo}.svg`}]:u?[{name:p,logo:null}]:[]});return h.filter((p,b)=>h.findIndex(v=>v.name.toLowerCase()===p.name.toLowerCase())===b)}function ly(e){const t=e==null?void 0:e.agentInventory;return(t==null?void 0:t.status)==="checked"?t.agents.length?"Installed agents":"No supported agents found":t!=null&&t.checkedAt?"Last detected agents · scan unavailable":(t==null?void 0:t.status)==="unavailable"?"Agent scan unavailable":"Agent inventory not checked"}const MG=`
|
|
505
|
+
## OpenShell website access
|
|
506
|
+
|
|
507
|
+
Network access is restricted per destination, not globally offline. A denied website or hosted search request does not mean another website is blocked.
|
|
508
|
+
For a user-requested website, call read_url_content for that website. Hosted URL fetch and search services are deliberately blocked because they bypass the sandbox destination policy. read_url_content can fall back to a direct request from this sandbox, where the website policy applies.
|
|
509
|
+
If a request is denied, report that specific destination or service as blocked. On a later request for a different website, try that website independently; do not reuse an earlier denial as evidence that all internet access is unavailable. Do not claim to have fetched current content without a successful tool result.
|
|
510
|
+
Do not use hosted search, external proxies, or other relay services to bypass a blocked destination. Never change network policy to complete a browsing request.
|
|
511
|
+
`,Aw=[{id:"ubuntu:24.04",name:"Ubuntu 24.04"},{id:"debian:12-slim",name:"Debian 12 slim"}],DG=["git","curl","ripgrep"],jh=(e,t="bash")=>`curl -fsSL ${e} -o /tmp/install-agent.sh && ${t} /tmp/install-agent.sh && rm /tmp/install-agent.sh`,zG=[{id:"claude",command:"claude",featured:!0},{id:"codex",command:"codex",featured:!0,npm:"@openai/codex"},{id:"opencode",command:"opencode",featured:!0,npm:"opencode-ai"},{id:"pi",command:"pi",npm:"@earendil-works/pi-coding-agent",ignoreScripts:!0,packages:["fd-find","ripgrep"]},{id:"cursor",command:"cursor-agent",featured:!0,install:jh("https://cursor.com/install")},{id:"antigravity",command:"agy",install:jh("https://antigravity.google/cli/install.sh")},{id:"copilot",command:"copilot",npm:"@github/copilot"},{id:"kiro",command:"kiro-cli",packages:["unzip"],install:jh("https://cli.kiro.dev/install")},{id:"droid",command:"droid",install:jh("https://app.factory.ai/cli","sh")},{id:"aider",command:"aider",python:!0}],ls=zG.map(e=>{const t=Kg.find(r=>r.commands.includes(e.command));return{...e,name:t.name,logo:`/logos/agents/${t.logo}.svg`}}),Dv=e=>ls.filter(t=>e.agents.includes(t.id)),Ow=[{id:"node",name:"Node.js 22",logo:"/logos/templates/nodejs.svg"},{id:"python",name:"Python 3",logo:"/logos/templates/python.svg"},{id:"vscode",name:"VS Code Server",logo:"/logos/vscode.svg"}],PG="/run/openshell-supervisor-ca/material/ca-bundle.crt",Lp=[...ls.map(e=>({id:e.command,name:e.name})),{id:"",name:"Shell"}],IG=/^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$/,_G=8e3,Xg=e=>e.source==="build"&&Array.isArray(e.agents)&&new Set(e.agents).size+(Array.isArray(e.customAgents)?e.customAgents.length:0)>1;function ja(e={}){const t={name:"",source:"build",agents:["claude"],customAgents:[],repository:"",runtimes:[],base:Aw[0].id,packages:[...DG],setup:"",image:"",environment:[],command:"claude",setups:[],setupRevisions:{},...e};return Xg(t)&&(t.command=""),t}const YT=e=>e.split(/[\s,]+/).filter(Boolean),cy=e=>`openshell-image-recipe-v3:${e}`;function KT(e){try{const t=JSON.parse(sessionStorage.getItem(e));return t!=null&&t.recipe&&typeof t.recipe.name=="string"?t:null}catch{return null}}function LG(e){var t,r,a;return e.source==="image"?{source:"image",image:e.image,command:e.command,...(t=e.setups)!=null&&t.length?{setups:e.setups,setupRevisions:e.setupRevisions||{}}:{}}:{source:"build",agents:e.agents,...(r=e.setups)!=null&&r.length?{setups:e.setups,setupRevisions:e.setupRevisions||{}}:{},...(a=e.customAgents)!=null&&a.length?{customAgents:e.customAgents}:{},repository:e.repository,runtimes:e.runtimes,base:e.base,packages:e.packages,setup:e.setup,command:e.command}}function BG(e){let t=2166136261;for(const r of zv(e))t=Math.imul(t^r.charCodeAt(0),16777619);return(t>>>0).toString(16).padStart(8,"0")}const uy=e=>"'"+e.replaceAll("'","'\\''")+"'",$G=/^[a-zA-Z0-9][a-zA-Z0-9._/:@-]{0,255}$/;function VG(e){const t={};if((!Array.isArray(e.setups)||e.setups.length>8||e.setups.some(r=>typeof r!="string"||!/^[a-f0-9]{24}$/.test(r))||new Set(e.setups).size!==e.setups.length)&&(t.setups="Choose up to eight unique saved Setups."),e.setupRevisions&&(typeof e.setupRevisions!="object"||Array.isArray(e.setupRevisions)||Object.entries(e.setupRevisions).some(([r,a])=>{var l;return!((l=e.setups)!=null&&l.includes(r))||!/^[a-f0-9]{64}$/.test(a)}))&&(t.setups="Invalid pinned Setup revision."),IG.test(e.name||"")||(t.name="Use lowercase letters, digits and dashes for the name, up to 19 characters."),e.source==="build"){if((!Array.isArray(e.agents)||e.agents.some(r=>!ls.some(a=>a.id===r)))&&(t.agents="Choose a supported agent."),(!Array.isArray(e.runtimes)||e.runtimes.some(r=>!Ow.some(a=>a.id===r)))&&(t.runtimes="Choose a supported runtime."),typeof e.repository!="string")t.repository="Invalid repository.";else if(e.repository)try{const r=new URL(e.repository);if(/[\r\n\0]/.test(e.repository)||r.protocol!=="https:"||r.username||r.password||r.search||r.hash)throw new Error}catch{t.repository="Use a public HTTPS repository URL without credentials or query parameters."}Aw.some(r=>r.id===e.base)||(t.base="Choose a supported base image."),(!Array.isArray(e.packages)||e.packages.length>80||e.packages.some(r=>typeof r!="string"||!/^[a-z0-9][a-z0-9+.-]*(=[a-zA-Z0-9:.+~_-]+)?$/.test(r)))&&(t.packages="Add up to 80 valid apt package names, such as jq or build-essential."),(!Array.isArray(e.customAgents)||e.customAgents.length>10||e.customAgents.some(r=>!r||typeof r.name!="string"||!r.name.trim()||r.name.length>80||/[\x00-\x1f\x7f]/.test(r.name)||typeof r.install!="string"||!r.install.trim()||r.install.length>6e3||/[\x00\r]/.test(r.install)))&&(t.customAgents="Enter valid custom agent install commands, up to 6,000 characters."),(typeof e.setup!="string"||e.setup.length>6e3)&&(t.setup="Setup commands must be under 6 KB.")}else e.source==="image"?$G.test(e.image||"")||(t.image="Enter a valid image reference, such as team/workspace:latest."):t.source="Choose an image source.";return!Array.isArray(e.environment)||e.environment.length>40||e.environment.some(r=>!r||typeof r.name!="string"||typeof r.value!="string"||r.name.length>128||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(r.name)||/[\x00-\x1f\x7f]/.test(r.value)||r.value.length>1e3)?t.environment="Use variable names of letters, digits and underscores (up to 128) and single-line values (up to 1,000 characters).":e.environment.some(r=>r.name.startsWith("OPENSHELL_"))?t.environment="Variable names starting with OPENSHELL_ are reserved by OpenShell.":e.environment.some(r=>/secret|token|password|api_?key|credential|auth/i.test(r.name))?t.environment="Keep credentials out of templates. Attach them through Secrets when you launch.":new Set(e.environment.map(r=>r.name)).size!==e.environment.length&&(t.environment="Environment variable names must be unique."),(typeof e.command!="string"||e.command.length>512||/[\r\n\0]/.test(e.command))&&(t.command="Use a single-line start command, up to 512 characters."),Xg(e)&&e.command!==""&&(t.command="Templates with multiple agents must start in Shell."),!Object.keys(t).length&&new TextEncoder().encode(JSON.stringify(LG(e))).length>_G&&(t.setup="This recipe is too large to store with the template. Shorten the setup commands or package list."),t}function zv(e){var u,f,h;const t=Dv(e),r=!!((u=e.setups)!=null&&u.length)||e.runtimes.includes("node")||t.some(m=>m.npm),a=!!((f=e.setups)!=null&&f.length)||e.runtimes.includes("python")||t.some(m=>m.python),l=[...new Set(["ca-certificates","curl","iproute2","tmux",...e.packages,...t.flatMap(m=>m.packages??[]),...e.repository?["git"]:[],...a?["python3","python3-venv"]:[]])],c=[`FROM ${e.base}`,"","USER root","ENV DEBIAN_FRONTEND=noninteractive",`RUN apt-get update --error-on=any && apt-get install -y --no-install-recommends ${l.map(uy).join(" ")} && rm -rf /var/lib/apt/lists/*`,'RUN if getent passwd 1000 >/dev/null; then usermod --login sandbox --home /sandbox --move-home --shell /bin/bash "$(getent passwd 1000 | cut -d: -f1)"; else useradd --uid 1000 --create-home --home-dir /sandbox --shell /bin/bash sandbox; fi && chown -R 1000:1000 /sandbox'];r&&c.push("","COPY --from=node:22-bookworm-slim /usr/local/ /usr/local/"),a&&c.push("","RUN python3 -m venv /usr/local/venv",'ENV PATH="/usr/local/venv/bin:${PATH}"'),e.runtimes.includes("vscode")&&c.push(`RUN echo 'ca_certificate = ${PG}' >> /etc/wgetrc`);for(const m of t.filter(x=>x.npm))c.push(`RUN npm install --global ${m.ignoreScripts?"--ignore-scripts ":""}${m.npm}`);e.agents.includes("pi")&&c.push("RUN ln -sf /usr/bin/fdfind /usr/local/bin/fd"),e.agents.includes("aider")&&c.push("RUN python3 -m venv /opt/aider && /opt/aider/bin/pip install --no-cache-dir aider-chat && ln -s /opt/aider/bin/aider /usr/local/bin/aider"),e.agents.includes("claude")&&c.push("RUN curl -fsSL https://claude.ai/install.sh -o /tmp/install-claude.sh && bash /tmp/install-claude.sh && cp -L /root/.local/bin/claude /usr/local/bin/claude && chmod 0755 /usr/local/bin/claude && rm -rf /root/.local /root/.claude* /tmp/install-claude.sh"),c.push("","ENV HOME=/sandbox",'ENV PATH="/sandbox/.local/bin:/sandbox/.npm-global/bin:/sandbox/.opencode/bin:${PATH}"',"ENV NPM_CONFIG_PREFIX=/sandbox/.npm-global","USER sandbox","WORKDIR /sandbox");for(const m of t.filter(x=>x.install))c.push(`RUN ${m.install} && command -v ${m.command}`);for(const m of e.customAgents??[])c.push(`RUN ${JSON.stringify(["/bin/bash","-euo","pipefail","-c",m.install])}`);return e.repository&&c.push(`RUN git clone -- ${uy(e.repository)} /sandbox/project`,"WORKDIR /sandbox/project"),e.setup.trim()&&c.push("COPY --chown=1000:1000 setup.sh /tmp/template-setup.sh","RUN bash -eu /tmp/template-setup.sh"),e.agents.includes("antigravity")&&c.push(`RUN printf '%s\\n' ${MG.split(`
|
|
512
|
+
`).map(uy).join(" ")} >> ${e.repository?"/sandbox/project":"/sandbox"}/GEMINI.md`),(h=e.setups)!=null&&h.length&&c.push("COPY --chown=1000:1000 setup-bundles/ /sandbox/.openshell/bundles/"),c.push("",'CMD ["/bin/bash"]',""),c.join(`
|
|
513
|
+
`)}const XT="openshell.console/session",UG="openshell.console/project",dy=e=>!!(e!=null&&e.remote&&/^console-ssh-[a-f0-9]{24}$/.test(e.name??e.gateway??"")),HG=e=>{var r;const t=(r=e==null?void 0:e.labels)==null?void 0:r[UG];return typeof t=="string"&&/^[A-Za-z0-9]([A-Za-z0-9._-]{0,61}[A-Za-z0-9])?$/.test(t)?t:null},FG={shell:"/bin/bash -l",...Object.fromEntries(ls.map(e=>[e.command,e.command]))},GG=e=>Object.hasOwn(FG,e??""),qG=e=>{var t;return GG((t=e==null?void 0:e.labels)==null?void 0:t[XT])?e.labels[XT]:"shell"},TM=e=>{var t;return e==="shell"?"Shell":((t=ls.find(r=>r.command===e))==null?void 0:t.name)??e};function TZ(e){const t=qG(e),r=kM(e).flatMap(l=>ls.filter(c=>c.name===l.name).map(c=>c.command)),a=[...new Set([...t==="shell"?[]:[t],...r])];return[{id:"shell",name:"Shell"},...a.map(l=>({id:l,name:TM(l)}))]}function Bp(e,t,r,a=typeof r=="string"?r:(r==null?void 0:r.target)??bR()){var h,m;const l=new URLSearchParams;t&&l.set("session",t);const c=typeof(r==null?void 0:r.gateway)=="string"?r.gateway:((h=r==null?void 0:r.gateway)==null?void 0:h.name)??(r==null?void 0:r.name),u=(r==null?void 0:r.workspace)??((m=r==null?void 0:r.gateway)==null?void 0:m.workspace);c&&u&&(l.set("gateway",c),l.set("workspace",u),r!=null&&r.remote&&l.set("remote","1"));const f=l.toString();return`?target=${a}#terminal/${encodeURIComponent(e)}${f?`?${f}`:""}`}const Mw=g.createContext(null);function Pa({location:e,children:t}){const r=Uv(),a=Er(),l=a!=null&&a.localViewer&&(e!=null&&e.target)?e.target:r.target,c=g.useMemo(()=>qr(l,r.signal,e==null?void 0:e.context),[l,r.signal,e==null?void 0:e.context]),u=g.useMemo(()=>({location:e,api:c}),[e,c]);return s.jsx(hP,{target:e==null?void 0:e.target,children:s.jsx(Mw.Provider,{value:u,children:t})})}function $t(){var t;const e=Uv();return((t=g.useContext(Mw))==null?void 0:t.api)??e}function Cn(){var e;return((e=g.useContext(Mw))==null?void 0:e.location)??null}function Dw(e){if(e==null)return[];const t=Array.isArray(e)?e:[e];if(t.some(r=>typeof r!="string"||!r))throw new Error("Groups must be a list of group IDs.");return[...new Set(t)]}const Wg=(e,t)=>e.appliesTo.everyone||Dw(t.groups??t.group).some(r=>e.appliesTo.groups.includes(r))||e.appliesTo.sandboxes.includes(t.name)||(e.appliesTo.setups??[]).some(r=>(t.setups??[]).includes(r)),YG=e=>e.startsWith("*")||!e.includes(".")?[e]:[e,`**.${e}`],KG=e=>e.flatMap(YG);function EM(e,t){if(t=String(t??"").toLowerCase(),e.startsWith("**."))return t.endsWith(e.slice(2));if(e.startsWith("*.")){const r=e.slice(1);return t.endsWith(r)&&!t.slice(0,-r.length).includes(".")&&t.length>r.length}return t===e}const RM=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48).replace(/-$/,""),No=(e,t)=>{var r;return Dw((r=e==null?void 0:e.assignments)==null?void 0:r[t])},XG=(e,t)=>(e??[]).filter(r=>Wg(r,t)),AM=(e,t)=>(e??[]).filter(r=>!r.appliesTo.everyone&&r.appliesTo.groups.includes(t));function WT({pressed:e,onClick:t,children:r,count:a,muted:l}){return s.jsxs("button",{type:"button","aria-pressed":e,onClick:t,className:Le("flex items-center gap-1.5 rounded-md border px-3 py-2 text-xs outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",e?"border-foreground/50 bg-accent font-medium text-foreground":"border-foreground/20 bg-background text-foreground hover:border-foreground/40 hover:bg-accent/50"),children:[e?s.jsx(qn,{className:"size-3","aria-hidden":"true"}):!l&&s.jsx(Oa,{className:"size-3 text-muted-foreground","aria-hidden":"true"}),r,a!=null&&s.jsx("span",{className:"font-mono text-[10px] tabular-nums text-faint",children:a})]})}function WG({onCreated:e,existing:t}){const r=$t(),[a,l]=g.useState(!1),[c,u]=g.useState(""),[f,h]=g.useState(!1),[m,x]=g.useState(null),p=RM(c),b=t.some(j=>j.id===p);async function v(){if(!(!p||b)){h(!0),x(null);try{const{group:j}=await r.saveGroup({id:p,name:c.trim(),description:"",isNew:!0});l(!1),u(""),e(j)}catch(j){x(j.message)}finally{h(!1)}}}return a?s.jsxs("div",{className:"grid w-full gap-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Ot,{value:c,onChange:j=>u(j.target.value),autoFocus:!0,placeholder:"Frontend","aria-label":"New group name",className:"h-7 max-w-52 text-xs",onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),v()),j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),l(!1))}}),s.jsxs(ce,{type:"button",size:"xs",onClick:v,disabled:f||!p||b,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[f&&s.jsx(zt,{"aria-hidden":"true"}),"Create"]}),s.jsx(ce,{type:"button",size:"xs",variant:"ghost",onClick:()=>{l(!1),u("")},children:"Cancel"})]}),(m||b)&&s.jsx("p",{className:"text-[11px] text-red-700",children:m??`A group called "${c.trim()}" already exists.`})]}):s.jsxs("button",{type:"button",onClick:()=>l(!0),className:"flex items-center gap-1 rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground outline-none transition-colors hover:border-foreground/30 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(ds,{className:"size-3","aria-hidden":"true"}),"New group"]})}function Wd({groups:e,counts:t={},value:r,onChange:a,multiple:l=!1,required:c=!1,allowCreate:u=!0,onCreated:f}){const h=g.useId(),m=l?r:r?[r]:[],x=p=>{a(l?m.includes(p)?m.filter(b=>b!==p):[...m,p]:p)};return s.jsxs("div",{role:"group","aria-label":l?"Choose groups":"Choose a group",className:"flex flex-wrap items-center gap-1.5",children:[!l&&!c&&s.jsx(WT,{pressed:!r,onClick:()=>a(null),muted:!0,children:"No group"}),e.map(p=>c&&!l?s.jsxs("label",{className:"relative min-w-0 cursor-pointer",children:[s.jsx("input",{type:"radio",name:h,value:p.id,checked:r===p.id,onChange:()=>a(p.id),required:!0,className:"peer sr-only"}),s.jsxs("span",{className:"flex items-center gap-1.5 rounded-md border border-foreground/20 bg-background px-3 py-2 text-xs text-foreground transition-colors hover:border-foreground/40 hover:bg-accent/50 peer-checked:border-foreground/50 peer-checked:bg-accent peer-checked:font-medium peer-focus-visible:ring-2 peer-focus-visible:ring-ring",children:[r===p.id?s.jsx(qn,{className:"size-3 shrink-0","aria-hidden":"true"}):s.jsx(Oa,{className:"size-3 shrink-0 text-muted-foreground","aria-hidden":"true"}),s.jsx("span",{className:"break-words",children:p.name}),t[p.id]!=null&&s.jsx("span",{"aria-label":`${t[p.id]} sandboxes`,className:"font-mono text-[10px] text-faint",children:t[p.id]})]})]},p.id):s.jsx(WT,{pressed:m.includes(p.id),onClick:()=>x(p.id),count:t[p.id],children:p.name},p.id)),u&&s.jsx(WG,{existing:e,onCreated:p=>{f==null||f(p),x(p.id)}})]})}const ws=e=>(e==null?void 0:e.label)??((e==null?void 0:e.target)==="cloud"?"Cloud":e!=null&&e.remote?`SSH · ${e.host??e.gateway}`:"Local"),Vn=e=>{var t,r;return JSON.stringify([[((t=e.location)==null?void 0:t.target)??"local",((r=e.location)==null?void 0:r.context)??""],e.id??e.name])};function Co({location:e}){return e?s.jsxs("span",{className:`inline-flex shrink-0 items-center rounded border px-1.5 py-0.5 text-[10px] font-normal ${e.connected?"border-border text-muted-foreground":"border-amber-500/40 text-amber-600"}`,title:e.error||`${e.gateway} · ${e.workspace}`,children:[ws(e),!e.connected&&" · Disconnected"]}):null}function QG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const ZG=e=>{switch(e){case"success":return tq;case"info":return sq;case"warning":return nq;case"error":return rq;default:return null}},JG=Array(12).fill(0),eq=({visible:e,className:t})=>Qe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Qe.createElement("div",{className:"sonner-spinner"},JG.map((r,a)=>Qe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),tq=Qe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Qe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),nq=Qe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Qe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),sq=Qe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Qe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),rq=Qe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Qe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),oq=Qe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Qe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Qe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aq=()=>{const[e,t]=Qe.useState(document.hidden);return Qe.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[]),e};let iq=1;const lq=100,QT=e=>{var t;return typeof(e==null?void 0:e.id)=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:iq++};class cq{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(r=>t(r)),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-lq;t<=0||(this.toasts=this.toasts.filter(r=>t>0&&this.dismissedToasts.has(r.id)?(this.dismissedToasts.delete(r.id),t--,!1):!0))},this.create=t=>{const{message:r,...a}=t,l=QT(t),c=this.pendingDismissals.get(l);c!==void 0&&(cancelAnimationFrame(c),this.pendingDismissals.delete(l),this.dismissedToasts.delete(l));const u=this.dismissedToasts.has(l),f=t.dismissible===void 0?!0:t.dismissible;return u&&(this.dismissedToasts.delete(l),this.toasts=this.toasts.filter(m=>m.id!==l)),(u?void 0:this.toasts.find(m=>m.id===l))?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...t,id:l,title:r}),{...m,...t,id:l,dismissible:f,title:r}):m):this.addToast({title:r,...a,dismissible:f,id:l}),l},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(a=>{this.dismissedToasts.add(a.id),this.subscribers.forEach(l=>l({id:a.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const r=this.pendingDismissals.get(t);return r!==void 0&&cancelAnimationFrame(r),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(a=>a({id:t,dismiss:!0}))})),t},this.message=(t,r)=>this.create({...r,message:t,type:void 0}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let a;r.loading!==void 0&&(a=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const l=Promise.resolve(t instanceof Function?t():t);let c=a!==void 0,u;const f=l.then(async m=>{if(u=["resolve",m],Qe.isValidElement(m))c=!1,this.create({id:a,type:"default",message:m});else if(dq(m)&&!m.ok){c=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,j=typeof p=="object"&&!Qe.isValidElement(p)?p:{message:p};this.create({id:a,type:"error",description:b,...j})}else if(m instanceof Error){c=!1;const p=typeof r.error=="function"?await r.error(m):r.error,b=typeof r.description=="function"?await r.description(m):r.description,j=typeof p=="object"&&!Qe.isValidElement(p)?p:{message:p};this.create({id:a,type:"error",description:b,...j})}else if(r.success!==void 0){c=!1;const p=typeof r.success=="function"?await r.success(m):r.success,b=typeof r.description=="function"?await r.description(m):r.description,j=typeof p=="object"&&!Qe.isValidElement(p)?p:{message:p};this.create({id:a,type:"success",description:b,...j})}}).catch(async m=>{if(u=["reject",m],r.error!==void 0){c=!1;const x=typeof r.error=="function"?await r.error(m):r.error,p=typeof r.description=="function"?await r.description(m):r.description,v=typeof x=="object"&&!Qe.isValidElement(x)?x:{message:x};this.create({id:a,type:"error",description:p,...v})}}).finally(()=>{c&&(this.dismiss(a),a=void 0),r.finally==null||r.finally.call(r)}),h=()=>new Promise((m,x)=>f.then(()=>u[0]==="reject"?x(u[1]):m(u[1])).catch(x));return typeof a!="string"&&typeof a!="number"?{unwrap:h}:Object.assign(a,{unwrap:h})},this.custom=(t,r)=>{const a=QT(r);return this.create({...r,jsx:t(a),id:a,type:void 0}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const rr=new cq,uq=(e,t)=>rr.message(e,t),dq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",fq=uq,mq=()=>rr.toasts,hq=()=>rr.getActiveToasts(),He=Object.assign(fq,{success:rr.success,info:rr.info,warning:rr.warning,error:rr.error,custom:rr.custom,message:rr.message,promise:rr.promise,dismiss:rr.dismiss,loading:rr.loading},{getHistory:mq,getToasts:hq});QG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Sh(e){return e.label!==void 0}const pq=3,gq="24px",xq="16px",ZT=4e3,bq=356,yq=14,vq=45,wq=200;function Uo(...e){return e.filter(Boolean).join(" ")}function jq(e){const[t,r]=e.split("-"),a=[];return t&&a.push(t),r&&a.push(r),a}const Sq=e=>{var t,r,a,l,c,u,f,h,m;const{invert:x,toast:p,unstyled:b,interacting:v,setHeights:j,visibleToasts:S,heights:N,index:C,toasts:E,expanded:T,removeToast:O,defaultRichColors:k,closeButton:M,style:A,cancelButtonStyle:R,actionButtonStyle:z,className:_="",descriptionClassName:L="",duration:Y,position:P,gap:V,expandByDefault:U,classNames:H,icons:F,closeButtonAriaLabel:q="Close toast"}=e,[W,B]=Qe.useState(null),[J,X]=Qe.useState(null),[re,I]=Qe.useState(!1),[$,Q]=Qe.useState(!1),[G,se]=Qe.useState(!1),[ee,ne]=Qe.useState(!1),[ie,oe]=Qe.useState(!1),[Z,de]=Qe.useState(0),[ke,_e]=Qe.useState(0),je=Qe.useRef(p.duration||Y||ZT),Ae=Qe.useRef(null),te=Qe.useRef(null),Ee=C===0,Te=C+1<=S,be=p.type,We=be??"default",Se=p.dismissible!==!1,Fe=p.className||"",Re=p.descriptionClassName||"",ve=Qe.useMemo(()=>N.findIndex(Pe=>Pe.toastId===p.id)||0,[N,p.id]),pe=Qe.useMemo(()=>{var Pe;return(Pe=p.closeButton)!=null?Pe:M},[p.closeButton,M]),$e=Qe.useMemo(()=>p.duration||Y||ZT,[p.duration,Y]),Je=Qe.useRef(0),mt=Qe.useRef(0),ot=Qe.useRef(0),Ie=Qe.useRef(null),[at,Xe]=P.split("-"),me=Qe.useMemo(()=>N.reduce((Pe,st,vt)=>vt>=ve?Pe:Pe+st.height,0),[N,ve]),Me=aq(),Oe=Qe.useMemo(()=>{var Pe;return(Pe=e.swipeDirections)!=null?Pe:jq(P)},[e.swipeDirections,P]),tt=p.invert||x,Ue=be==="loading";mt.current=Qe.useMemo(()=>ve*V+me,[ve,me]),Qe.useEffect(()=>{je.current=$e},[$e]),Qe.useEffect(()=>{I(!0)},[]),Qe.useEffect(()=>{const Pe=te.current;if(Pe){const st=Pe.getBoundingClientRect().height;return _e(st),j(vt=>[{toastId:p.id,height:st,position:p.position},...vt]),()=>j(vt=>vt.filter(wt=>wt.toastId!==p.id))}},[j,p.id]),Qe.useLayoutEffect(()=>{if(!re)return;const Pe=te.current,st=Pe.style.height;Pe.style.height="auto";const vt=Pe.getBoundingClientRect().height;Pe.style.height=st,_e(vt),j(wt=>wt.find(kt=>kt.toastId===p.id)?wt.map(kt=>kt.toastId===p.id?{...kt,height:vt}:kt):[{toastId:p.id,height:vt,position:p.position},...wt])},[re,p.title,p.description,j,p.id,p.jsx,p.action,p.cancel]);const Ge=Qe.useCallback(()=>{Q(!0),de(mt.current),j(Pe=>Pe.filter(st=>st.toastId!==p.id)),setTimeout(()=>{O(p)},wq)},[p,O,j,mt]);Qe.useEffect(()=>{if(p.promise&&be==="loading"||p.duration===1/0||p.type==="loading")return;let Pe;return T||v||Me?(()=>{if(ot.current<Je.current){const wt=new Date().getTime()-Je.current;je.current=je.current-wt}ot.current=new Date().getTime()})():(()=>{je.current!==1/0&&(Je.current=new Date().getTime(),Pe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Ge()},je.current))})(),()=>clearTimeout(Pe)},[T,v,p,be,Me,Ge]),Qe.useEffect(()=>{p.delete&&(Ge(),p.onDismiss==null||p.onDismiss.call(p,p))},[Ge,p.delete]);function ht(){var Pe;if(F!=null&&F.loading){var st;return Qe.createElement("div",{className:Uo(H==null?void 0:H.loader,p==null||(st=p.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":be==="loading"},F.loading)}return Qe.createElement(eq,{className:Uo(H==null?void 0:H.loader,p==null||(Pe=p.classNames)==null?void 0:Pe.loader),visible:be==="loading"})}const yt=p.icon||(F==null?void 0:F[be])||ZG(be);var ue,Ye;return Qe.createElement("li",{tabIndex:0,ref:te,className:Uo(_,Fe,H==null?void 0:H.toast,p==null||(t=p.classNames)==null?void 0:t.toast,H==null?void 0:H[We],p==null||(r=p.classNames)==null?void 0:r[We]),"data-sonner-toast":"","data-rich-colors":(ue=p.richColors)!=null?ue:k,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":re,"data-promise":!!p.promise,"data-swiped":ie,"data-removed":$,"data-visible":Te,"data-y-position":at,"data-x-position":Xe,"data-index":C,"data-front":Ee,"data-swiping":G,"data-dismissible":Se,"data-type":be,"data-invert":tt,"data-swipe-out":ee,"data-swipe-direction":J,"data-expanded":!!(T||U&&re),"data-testid":p.testId,style:{"--index":C,"--toasts-before":C,"--z-index":E.length-C,"--offset":`${$?Z:mt.current}px`,"--initial-height":U?"auto":`${ke}px`,...A,...p.style},onDragEnd:()=>{se(!1),B(null),Ie.current=null},onPointerDown:Pe=>{Pe.button!==2&&(Ue||!Se||(Ae.current=new Date,de(mt.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(se(!0),Ie.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,st,vt;if(ee||!Se)return;Ie.current=null;const wt=Number(((Pe=te.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ht=Number(((st=te.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),kt=new Date().getTime()-((vt=Ae.current)==null?void 0:vt.getTime()),ct=W==="x"?wt:Ht,jt=Math.abs(ct)/kt;if((W==="x"?Oe.includes(wt>0?"right":"left"):Oe.includes(Ht>0?"bottom":"top"))&&(Math.abs(ct)>=vq||jt>.11)){de(mt.current),p.onDismiss==null||p.onDismiss.call(p,p),X(W==="x"?wt>0?"right":"left":Ht>0?"down":"up"),Ge(),ne(!0);return}else{var Ke,ut;(Ke=te.current)==null||Ke.style.setProperty("--swipe-amount-x","0px"),(ut=te.current)==null||ut.style.setProperty("--swipe-amount-y","0px")}oe(!1),se(!1),B(null)},onPointerMove:Pe=>{var st,vt,wt;if(!Ie.current||!Se||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;const kt=Pe.clientY-Ie.current.y,ct=Pe.clientX-Ie.current.x;!W&&(Math.abs(ct)>1||Math.abs(kt)>1)&&B(Math.abs(ct)>Math.abs(kt)?"x":"y");let jt={x:0,y:0};const ae=Ke=>1/(1.5+Math.abs(Ke)/20);if(W==="y"){if(Oe.includes("top")||Oe.includes("bottom"))if(Oe.includes("top")&&kt<0||Oe.includes("bottom")&&kt>0)jt.y=kt;else{const Ke=kt*ae(kt);jt.y=Math.abs(Ke)<Math.abs(kt)?Ke:kt}}else if(W==="x"&&(Oe.includes("left")||Oe.includes("right")))if(Oe.includes("left")&&ct<0||Oe.includes("right")&&ct>0)jt.x=ct;else{const Ke=ct*ae(ct);jt.x=Math.abs(Ke)<Math.abs(ct)?Ke:ct}(Math.abs(jt.x)>0||Math.abs(jt.y)>0)&&oe(!0),(vt=te.current)==null||vt.style.setProperty("--swipe-amount-x",`${jt.x}px`),(wt=te.current)==null||wt.style.setProperty("--swipe-amount-y",`${jt.y}px`)}},pe&&!p.jsx&&be!=="loading"?Qe.createElement("button",{"aria-label":q,"data-disabled":Ue,"data-close-button":!0,onClick:Ue||!Se?()=>{}:()=>{Ge(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Uo(H==null?void 0:H.closeButton,p==null||(a=p.classNames)==null?void 0:a.closeButton)},(Ye=F==null?void 0:F.close)!=null?Ye:oq):null,(be||p.icon||p.promise)&&p.icon!==null&&((F==null?void 0:F[be])!==null||p.icon)?Qe.createElement("div",{"data-icon":"",className:Uo(H==null?void 0:H.icon,p==null||(l=p.classNames)==null?void 0:l.icon)},be==="loading"?p.icon||ht():p.promise?ht():null,be!=="loading"?yt:null):null,Qe.createElement("div",{"data-content":"",className:Uo(H==null?void 0:H.content,p==null||(c=p.classNames)==null?void 0:c.content)},Qe.createElement("div",{"data-title":"",className:Uo(H==null?void 0:H.title,p==null||(u=p.classNames)==null?void 0:u.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Qe.createElement("div",{"data-description":"",className:Uo(L,Re,H==null?void 0:H.description,p==null||(f=p.classNames)==null?void 0:f.description)},typeof p.description=="function"?p.description():p.description):null),Qe.isValidElement(p.cancel)?p.cancel:p.cancel&&Sh(p.cancel)?Qe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Pe=>{Sh(p.cancel)&&Se&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Pe),Ge())},className:Uo(H==null?void 0:H.cancelButton,p==null||(h=p.classNames)==null?void 0:h.cancelButton)},p.cancel.label):null,Qe.isValidElement(p.action)?p.action:p.action&&Sh(p.action)?Qe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||z,onClick:Pe=>{Sh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Pe),!Pe.defaultPrevented&&Ge())},className:Uo(H==null?void 0:H.actionButton,p==null||(m=p.classNames)==null?void 0:m.actionButton)},p.action.label):null)};function JT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Nq(e,t){const r={};return[e,t].forEach((a,l)=>{const c=l===1,u=c?"--mobile-offset":"--offset",f=c?xq:gq;function h(m){["top","right","bottom","left"].forEach(x=>{r[`${u}-${x}`]=typeof m=="number"?`${m}px`:m})}typeof a=="number"||typeof a=="string"?h(a):typeof a=="object"?["top","right","bottom","left"].forEach(m=>{a[m]===void 0?r[`${u}-${m}`]=f:r[`${u}-${m}`]=typeof a[m]=="number"?`${a[m]}px`:a[m]}):h(f)}),r}const Cq=Qe.forwardRef(function(t,r){const{id:a,invert:l,position:c="bottom-right",hotkey:u=["altKey","KeyT"],expand:f,closeButton:h,className:m,offset:x,mobileOffset:p,theme:b="light",richColors:v,duration:j,style:S,visibleToasts:N=pq,toastOptions:C,dir:E=JT(),gap:T=yq,icons:O,customAriaLabel:k,containerAriaLabel:M="Notifications"}=t,[A,R]=Qe.useState([]),z=Qe.useMemo(()=>a?A.filter(I=>I.toasterId===a):A.filter(I=>!I.toasterId),[A,a]),_=Qe.useMemo(()=>Array.from(new Set([c].concat(z.filter(I=>I.position).map(I=>I.position)))),[z,c]),[L,Y]=Qe.useState([]),[P,V]=Qe.useState(!1),[U,H]=Qe.useState(!1),[F,q]=Qe.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Qe.useRef(null),B=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=Qe.useRef(null),X=Qe.useRef(!1),re=Qe.useCallback(I=>{R($=>{var Q;return(Q=$.find(G=>G.id===I.id))!=null&&Q.delete||rr.dismiss(I.id),$.filter(({id:G})=>G!==I.id)})},[]);return Qe.useEffect(()=>rr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{R($=>$.map(Q=>Q.id===I.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{GL.flushSync(()=>{R($=>{const Q=$.findIndex(G=>G.id===I.id);return Q!==-1?[...$.slice(0,Q),{...$[Q],...I},...$.slice(Q+1)]:[I,...$]})})})}),[]),Qe.useEffect(()=>{if(b!=="system"){q(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:$})=>{q($?"dark":"light")})}catch{I.addListener(({matches:Q})=>{try{q(Q?"dark":"light")}catch(G){console.error(G)}})}},[b]),Qe.useEffect(()=>{A.length<=1&&V(!1)},[A]),Qe.useEffect(()=>{const I=$=>{var Q;if(u.length>0&&u.every(ee=>$[ee]||$.code===ee)){var se;V(!0),(se=W.current)==null||se.focus()}$.code==="Escape"&&(document.activeElement===W.current||(Q=W.current)!=null&&Q.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[u]),Qe.useEffect(()=>{if(W.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,X.current=!1)}},[W.current]),Qe.createElement("section",{ref:r,"aria-label":k??`${M} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},_.map((I,$)=>{var Q;const[G,se]=I.split("-");return z.length?Qe.createElement("ol",{key:I,dir:E==="auto"?JT():E,tabIndex:-1,ref:W,className:m,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":G,"data-x-position":se,style:{"--front-toast-height":`${((Q=L[0])==null?void 0:Q.height)||0}px`,"--width":`${bq}px`,"--gap":`${T}px`,...S,...Nq(x,p)},onBlur:ee=>{X.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(X.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||X.current||(X.current=!0,J.current=ee.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{U||V(!1)},onDragEnd:()=>V(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},z.filter(ee=>!ee.position&&$===0||ee.position===I).map((ee,ne)=>{var ie,oe;return Qe.createElement(Sq,{key:ee.id,icons:O,index:ne,toast:ee,defaultRichColors:v,duration:(ie=C==null?void 0:C.duration)!=null?ie:j,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:l,visibleToasts:N,closeButton:(oe=C==null?void 0:C.closeButton)!=null?oe:h,interacting:U,position:I,style:C==null?void 0:C.style,unstyled:C==null?void 0:C.unstyled,classNames:C==null?void 0:C.classNames,cancelButtonStyle:C==null?void 0:C.cancelButtonStyle,actionButtonStyle:C==null?void 0:C.actionButtonStyle,closeButtonAriaLabel:C==null?void 0:C.closeButtonAriaLabel,removeToast:re,toasts:z.filter(Z=>Z.position==ee.position),heights:L.filter(Z=>Z.position==ee.position),setHeights:Y,expandByDefault:f,gap:T,expanded:P,swipeDirections:t.swipeDirections})})):null}))}),kq={info:{icon:s.jsx(ru,{className:"size-4 text-muted-foreground"}),role:"status"},progress:{icon:s.jsx(zt,{className:"size-4 text-muted-foreground"}),role:"status"},success:{icon:s.jsx(qn,{className:"size-4 text-emerald-600"}),role:"status"},warning:{icon:s.jsx(Va,{className:"size-4 text-amber-600"}),role:"alert"},error:{icon:s.jsx(MR,{className:"size-4 text-destructive"}),role:"alert"}};function Tq({tone:e="info",title:t,children:r,actions:a,onDismiss:l,dismissLabel:c}){const{icon:u,role:f}=kq[e];return s.jsxs("div",{role:f,className:"flex w-[var(--width)] max-w-full gap-3 rounded-[var(--radius)] border border-border bg-popover p-4 text-xs text-popover-foreground shadow-lg",children:[s.jsx("span",{className:"mt-px shrink-0","aria-hidden":"true",children:u}),s.jsxs("div",{className:"min-w-0 flex-1",children:[t&&s.jsx("p",{className:"break-words font-medium",children:t}),r&&s.jsx("div",{className:"mt-0.5 break-words text-muted-foreground",children:r}),a&&s.jsx("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:a})]}),l&&s.jsx("button",{type:"button","aria-label":c??"Dismiss notification",onClick:l,className:"-mt-1 -mr-1 size-6 shrink-0 rounded-md text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"mx-auto size-3.5"})})]})}function Li({id:e,...t}){return g.useEffect(()=>{const r=setTimeout(()=>He.custom(()=>s.jsx(Tq,{...t}),{id:e,duration:1/0,dismissible:!1,unstyled:!0}));return()=>clearTimeout(r)}),g.useEffect(()=>()=>{He.dismiss(e)},[e]),null}const Eq="Not downloaded yet. Import downloads this npm package and checks that it starts, in a temporary sandbox.",zw=e=>e===Eq||e.startsWith("Prepare package"),Pw=e=>e.kind==="mcp"&&!e.disabled&&!e.config&&!e.configuration&&!e.package;function Rq(e){const t=new Map([["shadcn","ui.shadcn.com"],["@magicuidesign/mcp","magicui.design"]]).get(e==null?void 0:e.name);return t?[{phase:"runtime",host:t,port:443,reason:"Default component registry this MCP reads from."}]:[]}function OM(e){var r;const t=new Set(e.preparationIssues||[]);return!!(!e.disabled&&e.package&&!e.artifact&&!((r=e.credentialFields)!=null&&r.length)&&e.issues.every(a=>zw(a)||t.has(a)))}function Aq(e){return!e.disabled&&(!e.issues.length||OM(e))}function Oq(e){const t=e.requirements||[];return[...t,...Rq(e.package).filter(r=>!t.some(a=>a.host===r.host&&a.phase===r.phase))]}const eE=e=>e.items.some(t=>!t.disabled&&t.issues.length>0),MM=e=>!!(e!=null&&e.useSourceSecrets||e!=null&&e.provider||Object.values((e==null?void 0:e.secrets)||{}).some(Boolean)),DM=(e,t)=>e.issues.filter(r=>{var a;return!zw(r)&&!((a=e.preparationIssues)!=null&&a.includes(r))&&!(r.startsWith("Connect credentials")&&MM(t))}),Mq=(e,t={})=>new Map(e.items.map(r=>[r.id,new Set(DM(r,t[r.id]))])),Dq=(e,t={})=>e.items.filter(r=>!r.disabled&&DM(r,t[r.id]).length>0),zq=(e,t)=>t.items.some(r=>!r.disabled&&r.issues.some(a=>{var l;return!((l=e.get(r.id))!=null&&l.has(a))}));async function Pq(e,t,r,a,{onProgress:l=()=>{},onReview:c=()=>{},isCancelled:u=()=>!1,resumeJob:f,wait:h=m=>new Promise(x=>setTimeout(x,m))}={}){const m=Mq(t,a);let x=f||await e.prepareSetup(t.token,a);l(x);let p=0;for(;x.status==="running";){await h(1500*Math.min(p+1,4));try{x=await e.setupPreparation(x.id),p=0}catch(v){if(++p>=20)throw v;continue}l(x)}if(x.review&&c(x.review),x.status==="cancelled"||u())return{status:"cancelled",review:x.review};if(x.status!=="complete"||!x.review)throw new Error(x.message||"Import could not finish. Try again.");return zq(m,x.review)?{status:"needs-attention",review:x.review}:(l({...x,message:"Saving your setup…"}),{status:"saved",setup:await e.saveSetup(x.review.token,r,!0),inactive:x.review.items.filter(v=>!v.disabled&&v.issues.length).map(v=>v.name)})}function Qd({value:e,startValue:t=0,direction:r="up",delay:a=0,className:l,decimalPlaces:c=0,...u}){const f=g.useRef(null),h=lr(),m=Rw(r==="down"?e:t),x=RG(m,{damping:60,stiffness:100}),p=CM(f,{once:!0,margin:"0px"}),b=g.useCallback(v=>Intl.NumberFormat("en-US",{minimumFractionDigits:c,maximumFractionDigits:c}).format(Number(v.toFixed(c))),[c]);return g.useEffect(()=>{if(!p)return;const v=setTimeout(()=>m.set(r==="down"?t:e),a*1e3);return()=>clearTimeout(v)},[m,p,a,e,r,t]),g.useEffect(()=>x.on("change",v=>{f.current&&!h&&(f.current.textContent=b(v))}),[x,b,h]),g.useEffect(()=>{f.current&&h&&(f.current.textContent=b(e))},[h,e,b]),s.jsx("span",{ref:f,className:Le("inline-block tabular-nums",l),...u,children:h?b(e):t})}function zM(e){if(e.length<2)return e.length?`M${e[0][0]} ${e[0][1]}`:"";const t=e.length,r=[],a=[];for(let u=0;u<t-1;u++)r[u]=e[u+1][0]-e[u][0],a[u]=(e[u+1][1]-e[u][1])/(r[u]||1);const l=[a[0]];for(let u=1;u<t-1;u++)l[u]=a[u-1]*a[u]<=0?0:(a[u-1]+a[u])/2;l[t-1]=a[t-2];for(let u=0;u<t-1;u++){if(a[u]===0){l[u]=0,l[u+1]=0;continue}const f=l[u]/a[u],h=l[u+1]/a[u],m=Math.hypot(f,h);m>3&&(l[u]=3*f/m*a[u],l[u+1]=3*h/m*a[u])}let c=`M${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let u=0;u<t-1;u++){const f=r[u]/3;c+=` C${(e[u][0]+f).toFixed(2)} ${(e[u][1]+l[u]*f).toFixed(2)} ${(e[u+1][0]-f).toFixed(2)} ${(e[u+1][1]-l[u+1]*f).toFixed(2)} ${e[u+1][0].toFixed(2)} ${e[u+1][1].toFixed(2)}`}return c}function PM(e,t,r){const a=r-t*6e4,l=Array.from({length:t},(c,u)=>({at:a+(u+1)*6e4,allowed:0,denied:0}));for(const c of e){if(c.kind!=="audit"||!c.verdict||!c.at)continue;const u=Date.parse(c.at);if(u<=a||u>r)continue;const f=Math.min(t-1,Math.floor((u-a)/6e4));l[f][c.verdict]+=1}return l}const Iq=e=>new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});function IM({points:e,height:t=34,title:r,action:a}){const l=g.useRef(null),c=g.useId(),u=lr(),[f,h]=g.useState(280),[m,x]=g.useState(null);g.useLayoutEffect(()=>{const k=l.current;if(!k)return;const M=()=>h(k.clientWidth);M();const A=new ResizeObserver(M);return A.observe(k),()=>A.disconnect()},[]);const p=Math.max(4,Math.round(t*.18)),b=e.map(k=>k.allowed+k.denied),v=Math.max(1,...b),j=k=>(e.length<2?f-12:k/(e.length-1)*(f-12))+6,S=k=>t-p-k/v*(t-p*2),N=b.map((k,M)=>[j(M),S(k)]),C=zM(N),E=`${C} L${j(e.length-1).toFixed(2)} ${t} L${j(0).toFixed(2)} ${t} Z`,T=m===null?null:e[m],O=k=>e.reduce((M,A)=>M+A[k],0);return s.jsxs("div",{className:"relative w-full",onMouseLeave:()=>x(null),onMouseMove:k=>{const M=k.currentTarget.getBoundingClientRect(),A=(k.clientX-M.left)/Math.max(1,M.width);x(Math.min(e.length-1,Math.max(0,Math.round(A*(e.length-1)))))},children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"min-w-0 truncate text-[10px] font-bold tracking-widest text-faint uppercase",children:T?s.jsxs("span",{className:"font-mono normal-case tracking-normal text-muted-foreground",children:[Iq(T.at)," · ",T.allowed," allowed",T.denied?s.jsxs("span",{className:"text-red-600",children:[" · ",T.denied," denied"]}):null]}):r}),s.jsx("span",{className:"ml-auto shrink-0",children:a})]}),s.jsx("div",{ref:l,className:"w-full",children:s.jsxs("svg",{width:f,height:t,role:"img","aria-label":`${O("allowed")} allowed and ${O("denied")} denied connections over ${e.length} minutes`,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:c,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:"var(--ink)",stopOpacity:"0.1"}),s.jsx("stop",{offset:"100%",stopColor:"var(--ink)",stopOpacity:"0"})]})}),s.jsx("path",{d:E,fill:`url(#${c})`}),s.jsx(Yn.path,{d:C,fill:"none",stroke:"var(--ink)",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",opacity:"0.72",initial:u?!1:{pathLength:0},animate:{pathLength:1},transition:{duration:.9,ease:"easeOut"}}),e.map((k,M)=>k.denied?s.jsx("circle",{cx:j(M),cy:t-2,r:"1.75",fill:"var(--status-error)",opacity:m===M?1:.75},k.at):null),T&&s.jsxs("g",{children:[s.jsx("line",{x1:j(m),x2:j(m),y1:"0",y2:t,stroke:"var(--ink)",strokeWidth:"1",strokeDasharray:"2 3",opacity:"0.25"}),s.jsx("circle",{cx:j(m),cy:S(b[m]),r:"3",fill:"var(--surface)",stroke:"var(--ink)",strokeWidth:"1.5"})]})]})})]})}function ra({value:e,onValueChange:t,className:r,ref:a,...l}){return s.jsxs("div",{className:Le("relative",r),children:[s.jsx(QI,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ot,{ref:a,value:e,onChange:c=>t(c.target.value),className:"h-7 rounded-[3px] pr-7 pl-8 text-xs focus-visible:ring-1",...l}),e&&s.jsx("button",{type:"button","aria-label":"Clear search",className:"absolute top-1/2 right-2 -translate-y-1/2",onClick:()=>t(""),children:s.jsx(En,{className:"size-3.5"})})]})}function $l({...e}){return s.jsx(I5,{"data-slot":"sheet",...e})}function _q({...e}){return s.jsx(G1,{"data-slot":"sheet-portal",...e})}function Lq({className:e,...t}){return s.jsx(U1,{"data-slot":"sheet-overlay",className:Le("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function uu({className:e,children:t,side:r="right",showCloseButton:a=!0,...l}){return s.jsxs(_q,{children:[s.jsx(Lq,{}),s.jsxs(F1,{"data-slot":"sheet-content","data-side":r,className:Le("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...l,children:[t,a&&s.jsxs(Lg,{"data-slot":"sheet-close",render:s.jsx(ce,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[s.jsx(En,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function du({className:e,...t}){return s.jsx("div",{"data-slot":"sheet-header",className:Le("flex flex-col gap-0.5 p-4",e),...t})}function fu({className:e,...t}){return s.jsx(q1,{"data-slot":"sheet-title",className:Le("font-heading text-base font-medium text-foreground",e),...t})}function mu({className:e,...t}){return s.jsx(H1,{"data-slot":"sheet-description",className:Le("text-sm text-muted-foreground",e),...t})}function Bq(e){return P5("alert-dialog",e)}function Qr({...e}){return s.jsx(Bq,{"data-slot":"alert-dialog",...e})}function $q({...e}){return s.jsx(G1,{"data-slot":"alert-dialog-portal",...e})}function Vq({className:e,...t}){return s.jsx(U1,{"data-slot":"alert-dialog-overlay",className:hs("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Zr({className:e,size:t="default",...r}){return s.jsxs($q,{children:[s.jsx(Vq,{}),s.jsx(F1,{"data-slot":"alert-dialog-content","data-size":t,className:hs("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r})]})}function Jr({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:hs("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function eo({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:hs("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function to({className:e,...t}){return s.jsx(q1,{"data-slot":"alert-dialog-title",className:hs("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function no({className:e,...t}){return s.jsx(H1,{"data-slot":"alert-dialog-description",className:hs("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function so({className:e,...t}){return s.jsx(ce,{"data-slot":"alert-dialog-action",className:hs(e),...t})}function ro({className:e,variant:t="outline",size:r="default",...a}){return s.jsx(Lg,{"data-slot":"alert-dialog-cancel",className:hs(e),render:s.jsx(ce,{variant:t,size:r}),...a})}const _M=g.createContext(void 0);function Qg(e){const t=g.useContext(_M);if(t===void 0&&!e)throw new Error(Zt(33));return t}const LM=g.createContext(void 0);function Hi(e){const t=g.useContext(LM);if(t===void 0&&!e)throw new Error(Zt(36));return t}const Uq=g.createContext(void 0);function Iw(e=!0){const t=g.useContext(Uq);if(t===void 0&&!e)throw new Error(Zt(25));return t}const BM=g.createContext(void 0);function Hq(){const e=g.useContext(BM);if(e===void 0)throw new Error(Zt(30));return e}function Fq(e){const{closeOnClick:t,highlighted:r,id:a,nodeId:l,store:c,typingRef:u,itemRef:f,itemMetadata:h}=e,{events:m}=c.useState("floatingTreeRoot"),x=c.useState("open"),p=Iw(!0),b=p!==void 0;return g.useMemo(()=>({id:a,role:"menuitem",tabIndex:x&&r?0:-1,onKeyDown(v){v.key===" "&&(u!=null&&u.current)&&v.preventDefault()},onMouseMove(v){l&&m.emit("itemhover",{nodeId:l,target:v.currentTarget})},onClick(v){t&&m.emit("close",{domEvent:v,reason:Al})},onMouseUp(v){if(p){const j=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,b&&j&&Math.abs(v.clientX-j.x)<=1&&Math.abs(v.clientY-j.y)<=1||b&&!a1&&v.button===2)return}f.current&&c.context.allowMouseUpTriggerRef.current&&(!b||v.button===2)&&h.type==="regular-item"&&Kc(f.current,v,{detail:1})}}),[t,r,a,m,l,x,c,u,f,p,b,h])}const _w={type:"regular-item"};function Lw(e){const{closeOnClick:t,disabled:r,highlighted:a,id:l,store:c,typingRef:u=c.context.typingRef,nativeButton:f,itemMetadata:h,nodeId:m}=e,x=g.useRef(null),{getButtonProps:p,buttonRef:b}=oo({disabled:r,focusableWhenDisabled:!0,native:f,composite:!0}),v=Fq({closeOnClick:t,highlighted:a,id:l,nodeId:m,store:c,typingRef:u,itemRef:x,itemMetadata:h}),j=g.useCallback(N=>Ys(v,{onMouseEnter(){h.type==="submenu-trigger"&&h.setActive()}},N,p),[v,p,h]),S=Yr(x,b);return g.useMemo(()=>({getItemProps:j,itemRef:S}),[j,S])}const Gq="data-checked",qq="data-unchecked",Zg={checked(e){return e?{[Gq]:""}:{[qq]:""}},...Fa},Yq=g.forwardRef(function(t,r){const{render:a,className:l,id:c,label:u,nativeButton:f=!1,disabled:h=!1,closeOnClick:m=!1,checked:x,defaultChecked:p,onCheckedChange:b,style:v,...j}=t,S=Yl({guess:!0,label:u}),N=Qg(!0),C=ms(c),{store:E}=Hi(),T=E.useState("disabled"),O=h||T,k=E.useState("isActive",S.index),M=E.useState("itemProps"),[A,R]=Wr({controlled:x,default:p??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:z,itemRef:_}=Lw({closeOnClick:m,disabled:O,highlighted:k,id:C,store:E,nativeButton:f,nodeId:N==null?void 0:N.context.nodeId,itemMetadata:_w}),L=g.useMemo(()=>({disabled:O,highlighted:k,checked:A}),[O,k,A]);function Y(V){const U=bt(Al,V.nativeEvent,void 0,{preventUnmountOnClose:Tn});b==null||b(!A,U),!U.isCanceled&&R(H=>!H)}const P=Nt("div",t,{state:L,stateAttributesMapping:Zg,props:[M,{role:"menuitemcheckbox","aria-checked":A,onClick:Y},j,z],ref:[_,r,S.ref]});return s.jsx(BM.Provider,{value:L,children:P})}),Kq=g.forwardRef(function(t,r){const{render:a,className:l,style:c,keepMounted:u=!1,...f}=t,h=Hq(),m=g.useRef(null),{transitionStatus:x,mounted:p,setMounted:b}=Ga(h.checked);ir({batch:!0,enabled:!h.checked,open:h.checked,ref:m,onComplete(){h.checked||b(!1)}});const v={checked:h.checked,disabled:h.disabled,highlighted:h.highlighted,transitionStatus:x};return Nt("span",t,{state:v,ref:[r,m],stateAttributesMapping:Zg,props:{"aria-hidden":!0,...f},enabled:u||p})}),Bw=g.createContext(void 0);function Xq(){const e=g.useContext(Bw);if(e===void 0)throw new Error(Zt(31));return e}const Wq=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,[f,h]=g.useState(void 0),m=Nt("div",t,{ref:r,props:{role:"group","aria-labelledby":f,...u}});return s.jsx(Bw.Provider,{value:h,children:m})}),Qq=g.forwardRef(function(t,r){const{render:a,className:l,style:c,id:u,...f}=t,h=ms(u),m=Xq();return qe(()=>(m(h),()=>{m(x=>x===h?void 0:x)}),[m,h]),Nt("div",t,{ref:r,props:{id:h,"aria-hidden":!0,...f}})}),Zq=g.forwardRef(function(t,r){const{render:a,className:l,id:c,label:u,nativeButton:f=!1,disabled:h=!1,closeOnClick:m=!0,style:x,...p}=t,b=Yl({guess:!0,label:u}),v=Qg(!0),j=ms(c),{store:S}=Hi(),N=S.useState("disabled"),C=h||N,E=S.useState("isActive",b.index),T=S.useState("itemProps"),{getItemProps:O,itemRef:k}=Lw({closeOnClick:m,disabled:C,highlighted:E,id:j,store:S,nativeButton:f,nodeId:v==null?void 0:v.context.nodeId,itemMetadata:_w});return Nt("div",t,{state:{disabled:C,highlighted:E},props:[T,p,O],ref:[k,r,b.ref]})}),Jq=g.forwardRef(function(t,r){const{render:a,className:l,style:c,finalFocus:u,...f}=t,{store:h}=Hi(),{side:m,align:x}=Qg(),p=_g()!=null,b=h.useState("open"),v=h.useState("transitionStatus"),j=h.useState("popupProps"),S=h.useState("mounted"),N=h.useState("instantType"),C=h.useState("activeTriggerElement"),E=h.useState("parent"),T=h.useState("lastOpenChangeReason"),O=h.useState("rootId"),k=h.useState("floatingRootContext"),M=h.useState("floatingTreeRoot"),A=h.useState("closeDelay"),R=h.useState("hoverEnabled"),z=h.useState("disabled"),_=h.useState("openMethod"),L=E.type==="context-menu";ir({open:b,ref:h.context.popupRef,onComplete(){var H,F;b&&((F=(H=h.context).onOpenChangeComplete)==null||F.call(H,!0))}}),g.useEffect(()=>{function H(F){h.setOpen(!1,bt(F.reason,F.domEvent))}return M.events.on("close",H),()=>{M.events.off("close",H)}},[M.events,h]),P1(k,{enabled:R&&!z&&!L&&E.type!=="menubar",closeDelay:A});const Y=h.useStateSetter("popupElement"),P={transitionStatus:v,side:m,align:x,open:b,nested:E.type==="menu",instant:N},V=Nt("div",t,{state:P,ref:[r,h.context.popupRef,Y],stateAttributesMapping:dg,props:[j,{onKeyDown(H){p&&wf.has(H.key)&&H.stopPropagation()}},vf(v),f,{"data-rootownerid":O}]});let U=E.type===void 0||L;return(C||E.type==="menubar"&&T!==gg)&&(U=!0),s.jsx(wg,{context:k,openInteractionType:_,modal:L,disabled:!S,returnFocus:u===void 0?U:u,initialFocus:E.type!=="menu",restoreFocus:!0,externalTree:E.type!=="menubar"?M:void 0,previousFocusableElement:C,nextFocusableElement:E.type===void 0?h.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:E.type===void 0?h.context.beforeContentFocusGuardRef:void 0,children:V})}),$M=g.createContext(void 0);function eY(){const e=g.useContext($M);if(e===void 0)throw new Error(Zt(32));return e}const tY=g.forwardRef(function(t,r){const{keepMounted:a=!1,...l}=t,{store:c,parent:u}=Hi();if(!(c.useState("mounted")||a))return null;const m=u.type==="menu"||u.type==="menubar"?"group":void 0;return s.jsx($M.Provider,{value:a,children:s.jsx(vg,{ref:r,...l,portalOwnerRole:m})})}),nY=g.forwardRef(function(t,r){var Ee;const{anchor:a,positionMethod:l="absolute",className:c,render:u,side:f,align:h,sideOffset:m=0,alignOffset:x=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:v=5,sticky:j=!1,disableAnchorTracking:S=!1,collisionAvoidance:N=UA,style:C,...E}=t,{store:T}=Hi(),O=eY(),k=Iw(!0),M=T.useState("parent"),A=T.useState("floatingRootContext"),R=T.useState("floatingTreeRoot"),z=T.useState("mounted"),_=T.useState("open"),L=T.useState("modal"),Y=T.useState("openMethod"),P=T.useState("activeTriggerElement"),V=T.useState("transitionStatus"),U=T.useState("positionerElement"),H=T.useState("instantType"),F=T.useState("adaptiveOrigin"),q=T.useState("lastOpenChangeReason"),W=T.useState("floatingNodeId"),B=T.useState("floatingParentNodeId"),J=A.useState("domReferenceElement"),X=g.useRef(null),re=df(U);let I=a,$=m,Q=x,G=h,se=N;M.type==="context-menu"&&(I=a??((Ee=M.context)==null?void 0:Ee.anchor),G=G??"start",!f&&G!=="center"&&(Q=t.alignOffset??2,$=t.sideOffset??-5));let ee=f,ne=G;M.type==="menu"?(ee=ee??"inline-end",ne=ne??"start",se=t.collisionAvoidance??w1):M.type==="menubar"&&(ee=ee??(M.context.orientation==="vertical"?"inline-end":"bottom"),ne=ne??"start");const ie=M.type==="context-menu",oe=Dg({anchor:I,floatingRootContext:A,positionMethod:k?"fixed":l,mounted:z,side:ee,sideOffset:$,align:ne,alignOffset:Q,arrowPadding:ie?0:v,collisionBoundary:p,collisionPadding:b,sticky:j,nodeId:W,keepMounted:O,disableAnchorTracking:S,collisionAvoidance:se,shift:ie?{crossAxis:!("side"in se&&se.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:R,adaptiveOrigin:F});g.useEffect(()=>{function Te(be){be.open&&(be.parentNodeId===W&&T.set("hoverEnabled",!1),be.nodeId!==W&&be.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,bt(Nd)))}return R.events.on("menuopenchange",Te),()=>{R.events.off("menuopenchange",Te)}},[T,R.events,W]),g.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Te(be){if(be.open||be.nodeId!==T.select("floatingParentNodeId"))return;const We=be.reason??Nd;T.setOpen(!1,bt(We))}return R.events.on("menuopenchange",Te),()=>{R.events.off("menuopenchange",Te)}},[R.events,T]);const Z=es();g.useEffect(()=>{_||Z.clear()},[_,Z]),g.useEffect(()=>{function Te(be){if(!(!_||be.nodeId!==T.select("floatingParentNodeId")))if(be.target&&P&&P!==be.target){const We=T.select("closeDelay");We>0?Z.isStarted()||Z.start(We,()=>{T.setOpen(!1,bt(Nd))}):T.setOpen(!1,bt(Nd))}else Z.clear()}return R.events.on("itemhover",Te),()=>{R.events.off("itemhover",Te)}},[R.events,_,P,T,Z]),g.useEffect(()=>{const Te={open:_,nodeId:W,parentNodeId:B,reason:T.select("lastOpenChangeReason")};R.events.emit("menuopenchange",Te)},[R.events,_,T,W,B]),qe(()=>{const Te=J,be=X.current;if(Te&&(X.current=Te),be&&Te&&Te!==be){T.set("instantType",void 0);const We=new AbortController;return re(()=>{T.set("instantType","trigger-change")},We.signal),()=>{We.abort()}}},[J,re,T]);const de={open:_,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:M.type==="menu",instant:H},ke=M.type==="menubar"&&M.context.modal;$1(_&&(ke||L&&q!==Un),Y==="touch",U,P);const je=Pg(t,de,{styles:oe.positionerStyles,transitionStatus:V,props:E,refs:[r,T.useStateSetter("positionerElement")],hidden:!z,inert:!_}),Ae=z&&M.type!=="menu"&&(M.type!=="menubar"&&L&&q!==Un||M.type==="menubar"&&M.context.modal);let te=null;return M.type==="menubar"?te=M.context.contentElement:M.type===void 0&&(te=P),s.jsxs(_M.Provider,{value:oe,children:[Ae&&s.jsx(zg,{ref:M.type==="context-menu"||M.type==="nested-context-menu"?M.context.internalBackdropRef:null,inert:bf(!_),cutout:te}),s.jsx(XA,{id:W,children:s.jsx(yf,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:je})})]})}),VM=g.createContext(void 0);function sY(){const e=g.useContext(VM);if(e===void 0)throw new Error(Zt(34));return e}const rY=g.memo(g.forwardRef(function(t,r){const{render:a,className:l,value:c,defaultValue:u,onValueChange:f,disabled:h=!1,style:m,"aria-labelledby":x,...p}=t,[b,v]=g.useState(void 0),[j,S]=Wr({controlled:c,default:u,name:"MenuRadioGroup"}),N=Ze((O,k)=>{f==null||f(O,k),!k.isCanceled&&S(O)}),E=Nt("div",t,{state:{disabled:h},ref:r,props:{role:"group","aria-labelledby":x??b,"aria-disabled":h||void 0,...p}}),T=g.useMemo(()=>({value:j,setValue:N,disabled:h}),[j,N,h]);return s.jsx(Bw.Provider,{value:v,children:s.jsx(VM.Provider,{value:T,children:E})})})),UM=g.createContext(void 0);function oY(){const e=g.useContext(UM);if(e===void 0)throw new Error(Zt(35));return e}const aY=g.forwardRef(function(t,r){const{render:a,className:l,id:c,label:u,nativeButton:f=!1,disabled:h=!1,closeOnClick:m=!1,value:x,style:p,...b}=t,v=Yl({guess:!0,label:u}),j=Qg(!0),S=ms(c),{store:N}=Hi(),C=N.useState("isActive",v.index),E=N.useState("itemProps"),{value:T,setValue:O,disabled:k}=sY(),M=N.useState("disabled"),A=h||k||M,R=T===x,{getItemProps:z,itemRef:_}=Lw({closeOnClick:m,disabled:A,highlighted:C,id:S,store:N,nativeButton:f,nodeId:j==null?void 0:j.context.nodeId,itemMetadata:_w}),L=g.useMemo(()=>({disabled:A,highlighted:C,checked:R}),[A,C,R]);function Y(V){const U=bt(Al,V.nativeEvent,void 0,{preventUnmountOnClose:Tn});O(x,U)}const P=Nt("div",t,{state:L,stateAttributesMapping:Zg,props:[E,{role:"menuitemradio","aria-checked":R,onClick:Y},b,z],ref:[_,r,v.ref]});return s.jsx(UM.Provider,{value:L,children:P})}),iY=g.forwardRef(function(t,r){const{render:a,className:l,style:c,keepMounted:u=!1,...f}=t,h=oY(),m=g.useRef(null),{transitionStatus:x,mounted:p,setMounted:b}=Ga(h.checked);ir({batch:!0,enabled:!h.checked,open:h.checked,ref:m,onComplete(){h.checked||b(!1)}});const v={checked:h.checked,disabled:h.disabled,highlighted:h.highlighted,transitionStatus:x};return Nt("span",t,{state:v,stateAttributesMapping:Zg,ref:[r,m],props:{"aria-hidden":!0,...f},enabled:u||p})}),lY=g.createContext(null);function HM(e){return g.useContext(lY)}const cY={...Rg,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class uY extends bu{constructor(r,a,l=!1){const c=new xf,u=fY(c,a,l,r);super(u,dY(c),cY);tn(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",f=>{var h;if((h=this.unsubscribeParentListener)==null||h.call(this),f.type==="menu"){let m=f.store.select("rootId"),x=f.store.select("floatingTreeRoot"),p=f.store.select("keyboardEventRelay");this.unsubscribeParentListener=f.store.subscribe(()=>{const b=f.store.select("rootId"),v=f.store.select("floatingTreeRoot"),j=f.store.select("keyboardEventRelay");m===b&&x===v&&p===j||(m=b,x=v,p=j,this.notifyAll())}),this.context.allowMouseUpTriggerRef=f.store.context.allowMouseUpTriggerRef;return}f.type!==void 0&&(this.context.allowMouseUpTriggerRef=f.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(r,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:r,eventDetails:a})}}function dY(e){return{positionerRef:g.createRef(),popupRef:g.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:g.createRef(),beforeContentFocusGuardRef:g.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function fY(e,t,r=!1,a){return{...Eg(e,t,r),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new j1,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:gn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...a}}const mY=g.createContext(void 0);function hY(){return g.useContext(mY)}const pY=hf(function(t){const{children:r,open:a,onOpenChange:l,onOpenChangeComplete:c,defaultOpen:u=!1,disabled:f=!1,modal:h,loopFocus:m=!0,orientation:x="vertical",actionsRef:p,closeParentOnEsc:b=!1,handle:v,triggerId:j,defaultTriggerId:S=null,highlightItemOnHover:N=!0}=t,C=Iw(!0),E=Hi(!0),T=HM(!0),O=hY(),k=g.useMemo(()=>O&&E?{type:"menu",store:E.store}:T?{type:"menubar",context:T}:C&&!E?{type:"context-menu",context:C}:{type:void 0},[C,E,T,O]),M=zl(),A=zl(),R=$i(),z=k.type==="menu"?k.store:void 0,_=(a??u)&&(z==null?void 0:z.state.transitionStatus)==="starting",L=fs(()=>_?z==null?void 0:z.state.instantType:void 0).current,Y=gY({open:u,openProp:a,activeTriggerId:S,triggerIdProp:j,parent:k,disabled:f,highlightItemOnHover:N,modal:k.type===void 0?h:void 0,rootId:M,instantType:L},A,R!=null);Y.useControlledProp("openProp",a),Y.useControlledProp("triggerIdProp",j),Y.useContextCallback("onOpenChangeComplete",c);const P=Y.useState("floatingTreeRoot"),V=S1(P),U=Y.useState("open"),H=Y.useState("activeTriggerElement"),F=Y.useState("positionerElement"),q=Y.useState("hoverEnabled"),W=Y.useState("disabled"),B=Y.useState("lastOpenChangeReason"),J=Y.useState("parent"),X=Y.useState("activeIndex"),re=Y.useState("payload"),I=Y.useState("floatingParentNodeId"),$=g.useRef(null),Q=g.useRef(J.type!=="context-menu"),G=es(),se=g.useRef(!0),ee=es(),ne=I!=null,{openMethod:ie,triggerProps:oe}=S5(U);Y.useSyncedValues({disabled:f,highlightItemOnHover:N,modal:J.type===void 0?h:void 0,openMethod:ie,rootId:M}),Cg(Y);const{forceUnmount:Z,transitionStatus:de}=kg(U,Y,()=>{Y.set("allowMouseEnter",!1)},_),ke=df(Y.context.popupRef);g.useEffect(()=>{if(L===void 0)return;const Ie=()=>{Y.state.instantType===L&&Y.set("instantType",void 0)};if(!U){Ie();return}if(de!==void 0)return;if(Y.context.popupRef.current==null){Ie();return}const at=new AbortController;return ke(Ie,at.signal),()=>{at.abort()}},[L,U,de,ke,Y]),qe(()=>{C&&!E?Y.update({parent:{type:"context-menu",context:C},floatingNodeId:V,floatingParentNodeId:R}):E&&Y.update({floatingNodeId:V,floatingParentNodeId:R})},[C,E,V,R,Y]),g.useEffect(()=>{if(U||($.current=null),J.type==="context-menu"){if(!U){G.clear(),Q.current=!1;return}G.start(500,()=>{Q.current=!0})}},[G,U,J.type]),qe(()=>{!U&&!q&&Y.set("hoverEnabled",!0)},[U,q,Y]);const _e=Ze((Ie,at)=>{const Xe=at.reason;if(!Ie&&!Y.select("open")||U===Ie&&at.trigger===H&&B===Xe)return;const me=R1(at);if(!Ie&&at.trigger==null&&(at.trigger=H??void 0),l==null||l(Ie,at),at.isCanceled)return;Y.state.floatingRootContext.dispatchOpenChange(Ie,at);const Me=at.event;if(Ie===!1&&(Me==null?void 0:Me.type)==="click"&&Me.pointerType==="touch"&&!se.current)return;Ie&&Xe===Qc?(se.current=!1,ee.start(300,()=>{se.current=!0})):(se.current=!0,ee.clear());const Oe=(Xe===Jo||Xe===Al)&&Me.detail===0,tt=!Ie&&(Xe===mf||Xe==null);$.current=at.event;const Ue=Ng(Y.state,Ie,at.trigger,me());Ue.openChangeReason=Xe,J.type==="menubar"&&(Xe===Qc||Xe===Pi||Xe===Un||Xe===Gy||Xe===Nd)?Ue.instantType="group":Oe||tt?Ue.instantType=Oe?"click":"dismiss":Ue.instantType=void 0,Y.update(Ue)}),je=o5({popupStore:Y,floatingRootContext:Y.state.floatingRootContext,floatingId:A,nested:R!=null,onOpenChange:_e}),Ae=je.context.events;qe(()=>{const Ie=({open:at,eventDetails:Xe})=>_e(at,Xe);return Ae.on("setOpen",Ie),()=>{Ae==null||Ae.off("setOpen",Ie)}},[Ae,_e]);const te=g.useCallback(()=>{Y.setOpen(!1,bt(xg))},[Y]);g.useImperativeHandle(p,()=>({unmount:Z,close:te}),[Z,te]);let Ee;J.type==="context-menu"&&(Ee=J.context),g.useImperativeHandle(Ee==null?void 0:Ee.positionerRef,()=>F,[F]),g.useImperativeHandle(Ee==null?void 0:Ee.actionsRef,()=>({setOpen:_e}),[_e]);const Te=pf(je,{enabled:!W,bubbles:{escapeKey:b&&J.type==="menu"},outsidePress(){var Ie;return J.type!=="context-menu"||((Ie=$.current)==null?void 0:Ie.type)==="contextmenu"?!0:Q.current},externalTree:ne?P:void 0}),be=Mg(),We=g.useCallback(Ie=>{Y.select("activeIndex")!==Ie&&Y.set("activeIndex",Ie)},[Y]),Se=d5(je,{enabled:!W,listRef:Y.context.itemDomElements,activeIndex:X,nested:J.type!==void 0,loopFocus:m,orientation:x,parentOrientation:J.type==="menubar"?J.context.orientation:void 0,rtl:be==="rtl",disabledIndices:kr,onNavigate:We,openOnArrowKeyDown:J.type!=="context-menu",externalTree:ne?P:void 0,focusItemOnHover:N}),Fe=g.useCallback(Ie=>{Y.context.typingRef.current=Ie},[Y]),Re=f5(je,{enabled:!W,listRef:Y.context.itemLabels,elementsRef:Y.context.itemDomElements,activeIndex:X,resetMs:oB,onMatch:Ie=>{U&&Ie!==X&&Y.set("activeIndex",Ie)},onTyping:Fe}),ve=g.useMemo(()=>{const Ie=Ys(Re.reference,Se.reference,Te.reference,{onMouseMove(){Y.set("allowMouseEnter",!0)}},oe);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=U,Ie},[Y,Re.reference,Se.reference,Te.reference,oe,U]),pe=g.useMemo(()=>{const Ie=Ys(Se.trigger,Te.trigger,oe);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=!1,Ie},[Se.trigger,Te.trigger,oe]);fs(()=>(Y.update({inactiveTriggerProps:pe}),null));const $e=g.useMemo(()=>Ys(gf,{id:A,role:"menu","aria-orientation":x==="horizontal"?"horizontal":void 0,"aria-labelledby":H==null?void 0:H.id,onMouseMove(){Y.set("allowMouseEnter",!0),J.type==="menu"&&Y.set("hoverEnabled",!1)},onClick(){Y.select("hoverEnabled")&&Y.set("hoverEnabled",!1)},onKeyDown(Ie){const at=Y.select("keyboardEventRelay");at&&!Ie.isPropagationStopped()&&at(Ie)}},Re.floating,Se.floating,Te.floating),[H,A,x,J.type,Y,Re.floating,Se.floating,Te.floating]),Je=Se.item??gn;Tg(Y,{floatingRootContext:je,activeTriggerProps:ve,inactiveTriggerProps:pe,popupProps:$e,itemProps:Je});const mt=g.useMemo(()=>({store:Y,parent:k}),[Y,k]),ot=s.jsxs(LM.Provider,{value:mt,children:[v&&s.jsx(Sg,{handle:v,store:Y}),typeof r=="function"?r({payload:re}):r]});return J.type===void 0||J.type==="context-menu"?s.jsx(WA,{externalTree:P,children:ot}):ot});function gY(e,t,r){return fs(()=>new uY(e,t,r)).current}function FM(e){const{render:t,className:r,style:a,state:l=gn,props:c=kr,refs:u=kr,metadata:f,stateAttributesMapping:h,tag:m="div",...x}=e,{compositeProps:p,compositeRef:b}=L5({metadata:f});return Nt(m,e,{state:l,ref:[b,...u],props:[p,...c,x],stateAttributesMapping:h})}function GM(e){if(un(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Ta(e))return GM(Ma(e))}function qM(e,t){const r=g.useRef(null);function a(c){Xr.flushSync(()=>{e.setOpen(!1,bt(Pi,c.nativeEvent,c.currentTarget))});const u=VL(r.current);u==null||u.focus()}function l(c){var f;const u=e.select("positionerElement");if(u&&Wc(c,u))(f=e.context.beforeContentFocusGuardRef.current)==null||f.focus();else{Xr.flushSync(()=>{e.setOpen(!1,bt(Pi,c.nativeEvent,c.currentTarget))});let h=$L(e.context.triggerFocusTargetRef.current||t.current);for(;h!==null&&pt(u,h);){const m=h;if(h=g1(h),h===m)break}h==null||h.focus()}}return{preFocusGuardRef:r,handlePreFocusGuardFocus:a,handleFocusTargetFocus:l}}function xY(e){const{enabled:t=!0,mouseDownAction:r,open:a}=e,l=g.useRef(!1);return g.useMemo(()=>t?{onMouseDown:c=>{(r==="open"&&!a||r==="close"&&a)&&(l.current=!0,Ft(c.currentTarget).addEventListener("click",()=>{l.current=!1},{once:!0}))},onClick:c=>{l.current&&(l.current=!1,c.preventBaseUIHandler())}}:gn,[t,r,a])}const bY=v1(function(t,r){const{render:a,className:l,style:c,disabled:u=!1,nativeButton:f=!0,id:h,openOnHover:m,delay:x=100,closeDelay:p=0,handle:b,payload:v,...j}=t,S=Hi(!0),C=M1(b)??(S==null?void 0:S.store);if(!C)throw new Error(Zt(85));const E=ms(h),T=C.useState("isTriggerActive",E),O=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",E),M=C.useState("triggerPopupId",E),A=g.useRef(null),R=vY(),z=sg(!0),_=Vi(),L=g.useMemo(()=>_??new j1,[_]),Y=S1(L),P=$i(),{registerTrigger:V,isMountedByThisTrigger:U}=A1(E,A,C,{payload:v,closeDelay:p,parent:R,floatingTreeRoot:L,floatingNodeId:Y,floatingParentNodeId:P,keyboardEventRelay:z==null?void 0:z.relayKeyboardEvent}),H=R.type==="menubar",F=C.useState("disabled"),q=u||F||H&&R.context.disabled,{getButtonProps:W,buttonRef:B}=oo({disabled:q,native:f});g.useEffect(()=>{!k&&R.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,R.type]);const J=g.useRef(null),X=es(),re=Ze(Ee=>{if(!J.current)return;X.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Te=Ee.target;pt(J.current,Te)||pt(C.select("positionerElement"),Te)||Te===J.current||Te!=null&&GM(Te)===C.select("rootId")||N5(Ee,J.current)||L.events.emit("close",{domEvent:Ee,reason:CA})});g.useEffect(()=>{k&&C.select("lastOpenChangeReason")===Un&&Ft(J.current).addEventListener("mouseup",re,{once:!0})},[k,re,C]);const I=H&&R.context.hasSubmenuOpen,Q=I1(O,{enabled:(m??I)&&!q&&(!H||I&&!U),handleClose:_1({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:R.type===void 0?x:void 0,delay:{close:p},triggerElementRef:A,externalTree:L,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),G=yY(k,C.select("lastOpenChangeReason")),se=C1(O,{enabled:!q,event:k&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:R.type===void 0?G:!1}),ee=c5(O,{enabled:!q&&I}),ne=xY({open:k,enabled:H,mouseDownAction:"open"}),ie=g.useMemo(()=>Ys(ee.reference,se.reference),[ee.reference,se.reference]),oe=C.useState("triggerProps",U),{preFocusGuardRef:Z,handlePreFocusGuardFocus:de,handleFocusTargetFocus:ke}=qM(C,A),_e={disabled:q,open:k},je=[J,r,B,V,A],Ae=[ie,Q??gn,oe,{"aria-haspopup":"menu","aria-controls":M,id:E,onMouseDown:Ee=>{if(C.select("open"))return;X.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),Ft(Ee.currentTarget).addEventListener("mouseup",re,{once:!0})}},H?{role:"menuitem"}:{},ne,j,W],te=Nt("button",t,{enabled:!H,stateAttributesMapping:pp,state:_e,ref:je,props:Ae});return H?s.jsx(FM,{tag:"button",render:a,className:l,style:c,state:_e,refs:je,props:Ae,stateAttributesMapping:pp}):k?s.jsxs(g.Fragment,{children:[s.jsx(_i,{ref:Z,onFocus:de},`${E}-pre-focus-guard`),s.jsx(g.Fragment,{children:te},E),s.jsx(_i,{ref:C.context.triggerFocusTargetRef,onFocus:ke},`${E}-post-focus-guard`)]}):s.jsx(g.Fragment,{children:te},E)});function yY(e,t){const r=es(),[a,l]=g.useState(!1);return qe(()=>{e&&t===Un?(l(!0),r.start($A,()=>{l(!1)})):e||(r.clear(),l(!1))},[e,t,r]),a}function vY(){const e=HM();return g.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}const wY=g.forwardRef(function(t,r){const{className:a,render:l,orientation:c="horizontal",style:u,...f}=t;return Nt("div",t,{state:{orientation:c},ref:r,props:[{role:"separator","aria-orientation":c},f]})});function Af({...e}){return s.jsx(pY,{"data-slot":"dropdown-menu",...e})}function Of({...e}){return s.jsx(bY,{"data-slot":"dropdown-menu-trigger",...e})}function Mf({align:e="start",alignOffset:t=0,side:r="bottom",sideOffset:a=4,className:l,positionerRender:c,...u}){return s.jsx(tY,{children:s.jsx(nY,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:r,sideOffset:a,render:c,children:s.jsx(Jq,{"data-slot":"dropdown-menu-content",className:Le("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",l),...u})})})}function ep({...e}){return s.jsx(Wq,{"data-slot":"dropdown-menu-group",...e})}function Pv({className:e,inset:t,...r}){return s.jsx(Qq,{"data-slot":"dropdown-menu-label","data-inset":t,className:Le("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",e),...r})}function Gs({className:e,inset:t,variant:r="default",...a}){return s.jsx(Zq,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:Le("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...a})}g.createContext(null);function YM({className:e,children:t,checked:r,inset:a,...l}){return s.jsxs(Yq,{"data-slot":"dropdown-menu-checkbox-item","data-inset":a,className:Le("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:r,...l,children:[s.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:s.jsx(Kq,{children:s.jsx(qn,{})})}),t]})}function jY({...e}){return s.jsx(rY,{"data-slot":"dropdown-menu-radio-group",...e})}function tE({className:e,children:t,inset:r,...a}){return s.jsxs(aY,{"data-slot":"dropdown-menu-radio-item","data-inset":r,className:Le("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[s.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:s.jsx(iY,{children:s.jsx(qn,{})})}),t]})}function Pd({className:e,...t}){return s.jsx(wY,{"data-slot":"dropdown-menu-separator",className:Le("-mx-1 my-1 h-px bg-border",e),...t})}function On({className:e,...t}){return s.jsx("label",{"data-slot":"label",className:hs("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const SY=[{id:"rest",label:"HTTP",hint:"Inspect each request: method and path"},{id:"tcp",label:"TCP",hint:"Connection only; nothing inside is inspected"},{id:"websocket",label:"WebSocket"},{id:"graphql",label:"GraphQL"}],KM=[{id:"read-only",label:"Read only",hint:"GET, HEAD and OPTIONS"},{id:"read-write",label:"Read & write",hint:"Adds POST, PUT, PATCH and DELETE"},{id:"full",label:"Full",hint:"Any request"},{id:"custom",label:"Specific requests",hint:"Only the method and path pairs listed"}],NY=["GET","POST","PUT","PATCH","DELETE","HEAD","*"],xo=(e={})=>({host:"",ports:"443",protocol:"rest",access:"read-only",allow:[],deny:[],enforcement:"enforce",allowedIps:"",...e}),CY=[{id:"github-api-read",label:"GitHub API · read",rule:{name:"github-api-read",binaries:[],endpoints:[xo({host:"api.github.com",access:"custom",allow:[{method:"GET",path:"/repos/**"}]})]}},{id:"github-git",label:"git clone from GitHub",rule:{name:"github-git",binaries:["/usr/lib/git-core/git-remote-http","/usr/lib/git-core/git-remote-https"],endpoints:[xo({host:"github.com"}),xo({host:"codeload.github.com"})]}},{id:"npm",label:"npm registry",rule:{name:"npm-registry",binaries:["/usr/bin/node","/usr/local/bin/node"],endpoints:[xo({host:"registry.npmjs.org"})]}},{id:"pypi",label:"PyPI",rule:{name:"pypi",binaries:["/usr/bin/python3*","/usr/local/bin/pip*"],endpoints:[xo({host:"pypi.org"}),xo({host:"files.pythonhosted.org"})]}},{id:"huggingface",label:"Hugging Face · downloads",rule:{name:"huggingface",binaries:["/usr/bin/python3*"],endpoints:[xo({host:"huggingface.co"}),xo({host:"**.hf.co"})]}}];function fy(e){var t;return{name:(e==null?void 0:e.name)??"",binaries:[...(e==null?void 0:e.binaries)??[]],endpoints:((t=e==null?void 0:e.endpoints)!=null&&t.length?e.endpoints:[xo()]).map(r=>{var a;return xo({...r,ports:Array.isArray(r.ports)?r.ports.join(", "):String(r.ports??r.port??"443"),access:(a=r.allow)!=null&&a.length?"custom":r.access&&r.access!=="custom"?r.access:"read-only",protocol:r.protocol??"rest",allowedIps:Array.isArray(r.allowedIps)?r.allowedIps.join(", "):r.allowedIps??"",allow:[...r.allow??[]],deny:[...r.deny??[]]})})}}function kY(e){return{name:e.name.trim(),binaries:e.binaries,endpoints:e.endpoints.map(t=>({host:t.host.trim(),ports:t.ports.split(/[\s,]+/).filter(Boolean).map(Number),protocol:t.protocol,...t.protocol==="tcp"&&t.tlsSkip?{tlsSkip:!0}:{},access:t.protocol==="tcp"||t.access==="custom"?null:t.access,allow:t.protocol==="tcp"||t.access!=="custom"?[]:t.allow.filter(r=>r.path),deny:t.protocol==="tcp"?[]:t.deny.filter(r=>r.path),enforcement:t.enforcement,allowedIps:t.allowedIps.split(/[\s,]+/).filter(Boolean)}))}}function TY(e){const t={binaries:e.binaries??[],endpoints:(e.endpoints??[]).map(u=>({...u,ports:u.ports??(u.port?[u.port]:[]),allow:u.allow??[],deny:u.deny??[]}))},r=t.binaries.length?[...new Set(t.binaries.map(u=>u.split("/").pop()))].join(", "):"no program",a=t.endpoints.map(u=>{var h;const f=`${u.host||"…"}:${u.ports.join(",")||"…"}`;return u.protocol==="tcp"?`open connections to ${f}`:u.allow.length?`send ${u.allow.map(m=>`${m.method} ${m.path}`).join(", ")} to ${f}`:`make ${((h=KM.find(m=>m.id===u.access))==null?void 0:h.label.toLowerCase())??""} requests to ${f}`}),l=t.endpoints.flatMap(u=>u.deny.map(f=>`${f.method} ${f.path}`)),c=t.endpoints.some(u=>u.enforcement==="audit");return`${r} may ${a.join("; and ")}${l.length?`, except ${l.join(", ")}`:""}.${c?" Audit only: violations are logged but allowed.":""}`}function tu({options:e,value:t,onChange:r,label:a}){return s.jsx("div",{role:"radiogroup","aria-label":a,className:"flex items-center gap-1 rounded-md border border-border p-0.5",children:e.map(l=>s.jsx("button",{type:"button",role:"radio","aria-checked":t===l.id,onClick:()=>r(l.id),title:l.hint,className:`flex-1 rounded px-2 py-1 text-[11px] whitespace-nowrap outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${t===l.id?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,children:l.label},l.id))})}function $p({items:e,onChange:t,kind:r}){return s.jsxs("div",{className:"space-y-1.5",children:[e.map((a,l)=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(cn,{value:a.method,onChange:c=>t(e.map((u,f)=>f===l?{...u,method:c.target.value}:u)),"aria-label":"Method",className:"h-8 rounded-md border border-input bg-transparent px-1.5 font-mono text-[11px] outline-none focus-visible:ring-2 focus-visible:ring-ring",children:NY.map(c=>s.jsx("option",{children:c},c))}),s.jsx(Ot,{value:a.path,onChange:c=>t(e.map((u,f)=>f===l?{...u,path:c.target.value}:u)),className:"h-8 font-mono text-[11px]",placeholder:"/repos/**","aria-label":"Path pattern"}),s.jsx(ce,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${r} rule`,onClick:()=>t(e.filter((c,u)=>u!==l)),children:s.jsx(En,{className:"size-3.5"})})]},l)),s.jsxs("button",{type:"button",onClick:()=>t([...e,{method:"GET",path:""}]),className:`flex items-center gap-1 text-[11px] outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring ${r==="deny"?"text-red-700":"text-muted-foreground"}`,children:[s.jsx(ds,{className:"size-3"}),r==="deny"?"Block request":"Allow request"]})]})}function EY({open:e,onOpenChange:t,initial:r,onSubmit:a,knownPrograms:l=[],title:c="New rule",submitLabel:u="Add rule",lockName:f=!1}){const[h,m]=g.useState(()=>fy(r)),[x,p]=g.useState(""),[b,v]=g.useState(!1),[j,S]=g.useState(null);g.useEffect(()=>{e&&(m(fy(r)),S(null),p(""))},[e,r]);const N=(k,M)=>m(A=>({...A,endpoints:A.endpoints.map((R,z)=>z===k?{...R,...M}:R)})),C=k=>{const M=k.trim();M&&!h.binaries.includes(M)&&m(A=>({...A,binaries:[...A.binaries,M]})),p("")},E=kY(h),T=l.filter(k=>!h.binaries.includes(k));async function O(k){k.preventDefault(),v(!0),S(null);try{await a(E),t(!1)}catch(M){S(M.message)}finally{v(!1)}}return s.jsx(vn,{open:e,onOpenChange:t,children:s.jsx(wn,{className:"max-h-[90svh] overflow-y-auto sm:max-w-xl",children:s.jsxs("form",{onSubmit:O,className:"grid gap-5",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:c}),s.jsx(_n,{className:"sr-only",children:"Everything not allowed by a rule stays denied."})]}),!f&&s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx("span",{className:"self-center text-[11px] text-muted-foreground",children:"Presets"}),CY.map(k=>s.jsx("button",{type:"button",onClick:()=>m(fy(k.rule)),className:"rounded border border-border px-2 py-0.5 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:k.label},k.id))]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"rule-name",className:"text-xs",children:"Rule name"}),s.jsx(Ot,{id:"rule-name",value:h.name,disabled:f,onChange:k=>m(M=>({...M,name:k.target.value.toLowerCase()})),className:"font-mono text-xs",placeholder:"github-api-read",required:!0})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium",children:"Programs"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.binaries.map(k=>s.jsxs("span",{className:"flex items-center gap-1 rounded-md border border-foreground/20 bg-accent py-0.5 pr-0.5 pl-2 font-mono text-[11px]",children:[k,s.jsx("button",{type:"button","aria-label":`Remove ${k}`,onClick:()=>m(M=>({...M,binaries:M.binaries.filter(A=>A!==k)})),className:"rounded p-0.5 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"size-3"})})]},k)),!h.binaries.length&&s.jsx("span",{className:"text-[11px] text-amber-700",children:"Add at least one program"})]}),s.jsxs("div",{className:"flex gap-1.5",children:[s.jsx(Ot,{value:x,onChange:k=>p(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),C(x))},className:"h-8 font-mono text-[11px]",placeholder:"/usr/bin/curl",title:"Globs like /usr/bin/python3* work","aria-label":"Program path"}),s.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>C(x),disabled:!x.trim(),children:"Add"})]}),T.length>0&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Seen"}),T.slice(0,6).map(k=>s.jsxs("button",{type:"button",onClick:()=>C(k),className:"rounded border border-dashed border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:["+ ",k]},k))]})]}),s.jsxs("div",{className:"grid gap-3",children:[s.jsx("span",{className:"text-xs font-medium",children:"Destinations"}),h.endpoints.map((k,M)=>s.jsxs("div",{className:"grid gap-3 rounded-lg border border-border p-3",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"grid flex-1 gap-1",children:[s.jsx(On,{className:"text-[11px] text-muted-foreground",htmlFor:`host-${M}`,children:"Host"}),s.jsx(Ot,{id:`host-${M}`,value:k.host,onChange:A=>N(M,{host:A.target.value}),className:"h-8 font-mono text-[11px]",placeholder:"api.github.com",title:"Wildcards like *.example.com work",required:!0})]}),s.jsxs("div",{className:"grid w-24 gap-1",children:[s.jsx(On,{className:"text-[11px] text-muted-foreground",htmlFor:`ports-${M}`,children:"Ports"}),s.jsx(Ot,{id:`ports-${M}`,value:k.ports,onChange:A=>N(M,{ports:A.target.value}),className:"h-8 font-mono text-[11px]",placeholder:"443",required:!0})]}),h.endpoints.length>1&&s.jsx(ce,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Remove destination",onClick:()=>m(A=>({...A,endpoints:A.endpoints.filter((R,z)=>z!==M)})),children:s.jsx(Gn,{className:"size-3.5"})})]}),s.jsx(tu,{label:"Inspection",options:SY,value:k.protocol,onChange:A=>N(M,{protocol:A})}),k.protocol!=="tcp"&&s.jsxs(s.Fragment,{children:[s.jsx(tu,{label:"Access",options:KM,value:k.access,onChange:A=>N(M,{access:A,allow:A==="custom"&&!k.allow.length?[{method:"GET",path:""}]:k.allow})}),k.access==="custom"&&s.jsx($p,{kind:"allow",items:k.allow,onChange:A=>N(M,{allow:A})}),s.jsx($p,{kind:"deny",items:k.deny,onChange:A=>N(M,{deny:A})})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("div",{className:"w-52",children:s.jsx(tu,{label:"Enforcement",options:[{id:"enforce",label:"Enforce"},{id:"audit",label:"Audit only"}],value:k.enforcement,onChange:A=>N(M,{enforcement:A})})}),k.enforcement==="audit"&&s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-amber-700",children:[s.jsx(Va,{className:"size-3"}),"Logged, not blocked"]})]}),s.jsxs("details",{className:"group",children:[s.jsx("summary",{title:"Only for hosts resolving to private addresses. Loopback and metadata are always blocked.",className:"cursor-pointer text-[11px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:"Private network access"}),s.jsx("div",{className:"mt-2 grid gap-1",children:s.jsx(Ot,{value:k.allowedIps,onChange:A=>N(M,{allowedIps:A.target.value}),className:"h-8 font-mono text-[11px]",placeholder:"10.0.5.20/32","aria-label":"Allowed IPs"})})]})]},M)),s.jsxs(ce,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>m(k=>({...k,endpoints:[...k.endpoints,xo()]})),children:[s.jsx(ds,{}),"Add destination"]})]}),s.jsx("p",{className:"rounded-md border border-border bg-muted/40 px-3 py-2 text-[11px] leading-relaxed",children:TY(E)}),j&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:j}),s.jsxs(ea,{children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(ce,{type:"submit",disabled:b||!h.binaries.length,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[b&&s.jsx(zt,{"aria-hidden":"true"}),u]})]})]})})})}function Df({className:e,...t}){return s.jsx("textarea",{"data-slot":"textarea",className:hs("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}const Ri={ports:[443,80],programs:[],requests:"any",allow:[],deny:[],enforcement:"enforce",privateIps:[]},XM=[{id:"any",label:"Any",hint:"Every method and path"},{id:"read-only",label:"Read only",hint:"GET, HEAD and OPTIONS"},{id:"read-write",label:"Read & write",hint:"Adds POST, PUT and PATCH"},{id:"custom",label:"Specific",hint:"Only the method and path pairs listed"}],RY=[{label:"GitHub · read and clone",policy:{name:"GitHub read",destinations:["github.com","api.github.com","codeload.github.com"],advanced:{...Ri,ports:[443],requests:"custom",allow:[{method:"GET",path:"/**"},{method:"HEAD",path:"/**"},{method:"POST",path:"/*/*/git-upload-pack"}],deny:[{method:"*",path:"/*/*/git-receive-pack"}]}}},{label:"npm",policy:{name:"npm registry",destinations:["registry.npmjs.org"],advanced:{...Ri,ports:[443]}}},{label:"PyPI",policy:{name:"PyPI",destinations:["pypi.org","files.pythonhosted.org"],advanced:{...Ri,ports:[443],requests:"read-only"}}}],Id=(e={})=>({name:"",action:"allow",destinations:[],appliesTo:{everyone:!1,groups:[],sandboxes:[]},advanced:Ri,...e}),AY=e=>e.split(`
|
|
514
|
+
`).map(t=>t.trim()).filter(Boolean),Vp=e=>e.split(/[\s,]+/).filter(Boolean),OY=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40).replace(/-$/,""),tp=e=>e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`,MY=e=>JSON.stringify({...Ri,...e})===JSON.stringify(Ri);function my(e){const t={...Ri,...(e==null?void 0:e.advanced)??{}};return{id:(e==null?void 0:e.id)??"",name:(e==null?void 0:e.name)??"",action:(e==null?void 0:e.action)??"allow",setup:(e==null?void 0:e.setup)??null,destinations:[...(e==null?void 0:e.destinations)??[]],appliesTo:{everyone:!1,groups:[],sandboxes:[],...(e==null?void 0:e.appliesTo)??{}},ports:t.ports.join(", "),programs:[...t.programs],requests:t.requests,allow:[...t.allow],deny:[...t.deny],enforcement:t.enforcement,privateIps:t.privateIps.join(", ")}}function DY(e,t){return{id:t?OY(e.name):e.id,name:e.name.trim(),action:e.action,destinations:e.destinations,appliesTo:e.appliesTo,...e.setup?{setup:e.setup}:{},...e.action==="allow"?{advanced:{ports:Vp(e.ports).map(Number),programs:e.programs,requests:e.requests,allow:e.requests==="custom"?e.allow.filter(r=>r.path):[],deny:e.deny.filter(r=>r.path),enforcement:e.enforcement,privateIps:Vp(e.privateIps)}}:{}}}const zY=e=>{var t;return((t=e.setup)==null?void 0:t.name)??"an MCPs & Skills setup"};function Up(e,t){var l;const r=e.appliesTo;if(r.everyone)return"every sandbox";const a=[...r.groups.map(c=>{var u;return((u=t.find(f=>f.id===c))==null?void 0:u.name)??c}),...r.sandboxes,...(l=r.setups)!=null&&l.length?[`sandboxes using “${zY(e)}”`]:[]];return a.length?tp(a):null}function PY(e,t=[]){var x;const r=e.destinations.length>3?`${e.destinations.slice(0,3).join(", ")} and ${e.destinations.length-3} more`:tp(e.destinations),a=Up(e,t),l=a?`Applies to ${a}.`:"Not applied to any sandbox yet.";if(e.action==="block")return`Blocks ${r||"…"} and their subdomains, for every program. Beats every allow. ${l}`;const c={...Ri,...e.advanced},u=c.requests==="custom"?`only ${c.allow.map(p=>`${p.method} ${p.path}`).join(", ")||"the listed requests"}`:((x=XM.find(p=>p.id===c.requests))==null?void 0:x.label.toLowerCase())+" requests",f=c.programs.length?`from ${tp([...new Set(c.programs.map(p=>p.split("/").pop()))])}`:"from any program",h=c.deny.length?`, except ${c.deny.map(p=>`${p.method} ${p.path}`).join(", ")}`:"",m=c.enforcement==="audit"?" Audit only: violations are logged, not blocked.":"";return`Allows ${u}${h} to ${r||"…"} on port${c.ports.length===1?"":"s"} ${tp(c.ports.map(String))}, ${f}.${m} ${l}`}function WM({open:e,onOpenChange:t,initial:r,groups:a=[],sandboxes:l=[],assignments:c={},setupMembers:u={},knownPrograms:f=[],onSaved:h,onGroupCreated:m}){var X,re;const x=$t(),p=!(r!=null&&r.id),[b,v]=g.useState(()=>my(r)),[j,S]=g.useState([]),N=[...a,...j.filter(I=>!a.some($=>$.id===I.id))].sort((I,$)=>I.name.localeCompare($.name)),[C,E]=g.useState(""),[T,O]=g.useState(""),[k,M]=g.useState(!1),[A,R]=g.useState(null),[z,_]=g.useState(!1);g.useEffect(()=>{e&&(v(my(r)),R(null),E(""),O(""),_(!1))},[e,r]);const L=I=>v($=>({...$,...I})),Y=I=>v($=>({...$,appliesTo:{...$.appliesTo,...I}})),P=((X=b.appliesTo.setups)==null?void 0:X.length)>0,V=!b.appliesTo.everyone&&!b.appliesTo.sandboxes.length&&(P||b.appliesTo.groups.length>0)&&b.appliesTo.groups.every(I=>N.some($=>$.id===I)),U=DY(b,p),H=I=>{const $=Vp(I).filter((Q,G,se)=>!b.destinations.includes(Q)&&se.indexOf(Q)===G);$.length&&L({destinations:[...b.destinations,...$]}),O("")},F=I=>{const $=I.trim();$&&!b.programs.includes($)&&L({programs:[...b.programs,$]}),E("")},q=Object.fromEntries(N.map(I=>[I.id,l.filter($=>No({assignments:c},$).includes(I.id)).length])),W=l.filter(I=>Wg(U,{name:I,groups:No({assignments:c},I),setups:u[I]??[]}));async function B(I){if(I.preventDefault(),!V){R("Choose at least one group for this network rule.");return}M(!0),R(null);const $=Vp(T).filter(G=>!U.destinations.includes(G)),Q={...U,destinations:[...U.destinations,...$]};try{h(await x.savePolicy({...Q,isNew:p}),Q),t(!1)}catch(G){R(G.message)}finally{M(!1)}}async function J(){M(!0),R(null);try{h({...await x.deletePolicy(r.id),deleted:!0},r),t(!1)}catch(I){R(I.message)}finally{M(!1)}}return s.jsx(vn,{open:e,onOpenChange:t,children:s.jsx(wn,{className:"max-h-[90svh] overflow-y-auto sm:max-w-xl",children:s.jsxs("form",{onSubmit:B,className:"grid gap-5",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:p?"Add network rule":`Edit ${r.name}`}),s.jsx(_n,{className:"text-xs",children:"Sandboxes start locked down: nothing leaves them unless a rule allows it. A block beats every allow."})]}),p&&s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx("span",{className:"self-center text-[11px] text-muted-foreground",children:"Start from"}),RY.map(I=>s.jsx("button",{type:"button",onClick:()=>v($=>({...my(Id(I.policy)),appliesTo:$.appliesTo})),className:"rounded border border-border px-2 py-0.5 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:I.label},I.label))]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"policy-name",className:"text-xs",children:"Name"}),s.jsx(Ot,{id:"policy-name",value:b.name,onChange:I=>L({name:I.target.value}),className:"text-xs",placeholder:"GitHub read",required:!0,autoFocus:p})]}),s.jsxs("fieldset",{className:"grid gap-2 rounded-lg border border-border bg-muted/20 p-3",children:[s.jsxs("legend",{className:"px-1 text-xs font-medium",children:["Groups ",s.jsxs("span",{className:"text-muted-foreground",children:["· ",P?"Optional":"Required"]})]}),P&&s.jsxs("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:["Applies to sandboxes that use the MCPs & Skills setup",(re=b.setup)!=null&&re.name?s.jsxs(s.Fragment,{children:[" “",s.jsx("span",{className:"text-foreground",children:b.setup.name}),"”"]}):"",". Groups you pick here also get it."]}),s.jsx(Wd,{multiple:!0,required:!P,groups:N,counts:q,value:b.appliesTo.groups,onChange:I=>Y({everyone:!1,groups:I,sandboxes:[]}),onCreated:I=>{S($=>[...$,I]),m==null||m(I)}}),W.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[W.length," ",W.length===1?"sandbox":"sandboxes"," currently in scope."]}),!p&&!P&&(r.appliesTo.everyone||r.appliesTo.sandboxes.length||!r.appliesTo.groups.length)&&s.jsx("p",{className:"text-[11px] text-amber-700",children:"This rule uses a legacy scope. Choose its groups before saving; saving replaces the previous scope."})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium",children:"Action"}),s.jsx("div",{className:"w-48",children:s.jsx(tu,{label:"Action",options:[{id:"allow",label:"Allow"},{id:"block",label:"Block"}],value:b.action,onChange:I=>L({action:I})})})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"policy-destinations",className:"text-xs",children:"Destinations"}),s.jsxs("div",{className:"flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent px-2 py-1.5 focus-within:ring-2 focus-within:ring-ring",children:[b.destinations.map(I=>s.jsxs("span",{className:"flex items-center gap-1 rounded-md border border-foreground/20 bg-accent py-0.5 pr-0.5 pl-2 font-mono text-[11px]",children:[I,s.jsx("button",{type:"button","aria-label":`Remove ${I}`,onClick:()=>L({destinations:b.destinations.filter($=>$!==I)}),className:"rounded p-0.5 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"size-3"})})]},I)),s.jsx("input",{id:"policy-destinations",value:T,onChange:I=>/[\s,]$/.test(I.target.value)?H(I.target.value):O(I.target.value),onKeyDown:I=>{I.key==="Enter"?(I.preventDefault(),H(T)):I.key==="Backspace"&&!T&&b.destinations.length&&L({destinations:b.destinations.slice(0,-1)})},onBlur:()=>H(T),className:"min-w-32 flex-1 bg-transparent font-mono text-[11px] outline-none placeholder:text-muted-foreground",placeholder:b.destinations.length?"":b.action==="block"?"pastebin.com":"github.com","aria-label":"Destinations"})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:b.action==="block"?"Press Enter after each host. Blocking a host also blocks its subdomains.":"Press Enter after each host. *.example.com matches one level, **.example.com any depth."})]}),b.action==="allow"&&s.jsxs("details",{className:"group rounded-lg border border-border",open:!MY(r==null?void 0:r.advanced)||void 0,children:[s.jsx("summary",{className:"cursor-pointer px-3 py-2 text-xs font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Advanced"}),s.jsxs("div",{className:"grid gap-4 border-t border-border p-3",children:[s.jsxs("div",{className:"grid gap-1",children:[s.jsx(On,{htmlFor:"policy-ports",className:"text-[11px] text-muted-foreground",children:"Ports"}),s.jsx(Ot,{id:"policy-ports",value:b.ports,onChange:I=>L({ports:I.target.value}),className:"h-8 w-40 font-mono text-[11px]",placeholder:"443, 80"})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Requests"}),s.jsx(tu,{label:"Requests",options:XM,value:b.requests,onChange:I=>L({requests:I,allow:I==="custom"&&!b.allow.length?[{method:"GET",path:""}]:b.allow})}),b.requests==="custom"&&s.jsx($p,{kind:"allow",items:b.allow,onChange:I=>L({allow:I})}),s.jsx($p,{kind:"deny",items:b.deny,onChange:I=>L({deny:I})})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Programs"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[b.programs.map(I=>s.jsxs("span",{className:"flex items-center gap-1 rounded-md border border-foreground/20 bg-accent py-0.5 pr-0.5 pl-2 font-mono text-[11px]",children:[I,s.jsx("button",{type:"button","aria-label":`Remove ${I}`,onClick:()=>L({programs:b.programs.filter($=>$!==I)}),className:"rounded p-0.5 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"size-3"})})]},I)),!b.programs.length&&s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Any program"})]}),s.jsxs("div",{className:"flex gap-1.5",children:[s.jsx(Ot,{value:C,onChange:I=>E(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),F(C))},className:"h-8 font-mono text-[11px]",placeholder:"/usr/bin/git",title:"Globs like /usr/bin/python3* work","aria-label":"Program path"}),s.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>F(C),disabled:!C.trim(),children:"Add"})]}),f.filter(I=>!b.programs.includes(I)).length>0&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Seen"}),f.filter(I=>!b.programs.includes(I)).slice(0,6).map(I=>s.jsxs("button",{type:"button",onClick:()=>F(I),className:"rounded border border-dashed border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:["+ ",I]},I))]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("div",{className:"w-52",children:s.jsx(tu,{label:"Enforcement",options:[{id:"enforce",label:"Enforce"},{id:"audit",label:"Audit only"}],value:b.enforcement,onChange:I=>L({enforcement:I})})}),b.enforcement==="audit"&&s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-amber-700",children:[s.jsx(Va,{className:"size-3"}),"Request rules are logged, not enforced"]})]}),s.jsxs("div",{className:"grid gap-1",children:[s.jsx(On,{htmlFor:"policy-ips",className:"text-[11px] text-muted-foreground",title:"Loopback and cloud metadata stay blocked",children:"Private addresses"}),s.jsx(Ot,{id:"policy-ips",value:b.privateIps,onChange:I=>L({privateIps:I.target.value}),className:"h-8 font-mono text-[11px]",placeholder:"10.0.5.0/24"})]})]})]}),s.jsx("p",{className:"rounded-md border border-border bg-muted/40 px-3 py-2 text-[11px] leading-relaxed",children:PY(U,N)}),A&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:A}),s.jsxs(ea,{className:"sm:justify-between",children:[p?s.jsx("span",{}):z?s.jsxs("span",{className:"grid gap-1.5",children:[b.setup&&s.jsxs("span",{className:"max-w-64 text-[11px] text-muted-foreground",children:["Sandboxes that use “",b.setup.name,"” lose access to these websites. Enabling the setup again asks you to approve them for each sandbox."]}),s.jsx(ce,{type:"button",variant:"destructive",disabled:k,onClick:J,children:"Delete rule"})]}):s.jsx(ce,{type:"button",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>_(!0),children:"Delete"}),s.jsxs("span",{className:"flex gap-2",children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(ce,{type:"submit",disabled:k||!V||!b.name.trim()||!b.destinations.length&&!T.trim(),className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[k&&s.jsx(zt,{"aria-hidden":"true"}),p?"Add rule":"Save rule"]})]})]})]})})})}function IY({open:e,onOpenChange:t,org:r,onSaved:a}){const l=$t(),[c,u]=g.useState(""),[f,h]=g.useState(!1),[m,x]=g.useState(null);g.useEffect(()=>{e&&(u(((r==null?void 0:r.blocked)??[]).join(`
|
|
515
|
+
`)),x(null))},[e,r]);async function p(b){b.preventDefault(),h(!0),x(null);try{a(await l.saveOrg({...r,blocked:AY(c)})),t(!1)}catch(v){x(v.message)}finally{h(!1)}}return s.jsx(vn,{open:e,onOpenChange:t,children:s.jsx(wn,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:p,className:"grid gap-4",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"Blocked everywhere"}),s.jsx(_n,{className:"text-xs",children:"Blocked in every sandbox, with their subdomains. No rule can open them."})]}),s.jsx(Df,{rows:6,value:c,onChange:b=>u(b.target.value),className:"font-mono text-[11px]",placeholder:`pastebin.com
|
|
516
|
+
**.ngrok.io`,"aria-label":"Blocked hosts"}),m&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:m}),s.jsxs(ea,{children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(ce,{type:"submit",disabled:f,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[f&&s.jsx(zt,{"aria-hidden":"true"}),"Save"]})]})]})})})}function nE({className:e,size:t="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":t,className:Le("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg border border-border bg-card py-(--card-spacing) text-sm text-card-foreground [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg",e),...r})}function QM({borderWidth:e=1,duration:t=14,shineColor:r="#000000",className:a,style:l,...c}){return s.jsx("div",{style:{"--border-width":`${e}px`,"--duration":`${t}s`,backgroundImage:`radial-gradient(transparent,transparent, ${Array.isArray(r)?r.join(","):r},transparent,transparent)`,backgroundSize:"300% 300%",mask:"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",WebkitMask:"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",WebkitMaskComposite:"xor",maskComposite:"exclude",padding:"var(--border-width)",...l},className:Le("motion-safe:animate-shine pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position]",a),...c})}const ZM=g.createContext(void 0);function zf(e){const t=g.useContext(ZM);if(t===void 0&&!e)throw new Error(Zt(72));return t}const _Y={...Rg,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class LY extends bu{constructor(r,a,l){const c=new xf;super(BY(r,c,a,l),$Y(c),_Y);tn(this,"setOpen",(r,a)=>{t$(this,r,a,{extraState:{openChangeReason:a.reason}})})}cancelPendingOpen(r){this.state.floatingRootContext.dispatchOpenChange(!1,bt(Jo,r))}}function BY(e,t,r,a=!1){return{...Eg(t,r,a),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function $Y(e){return{popupRef:g.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const VY=hf(function(t){const{disabled:r=!1,defaultOpen:a=!1,open:l,disableHoverablePopup:c=!1,trackCursorAxis:u="none",actionsRef:f,onOpenChange:h,onOpenChangeComplete:m,handle:x,triggerId:p,defaultTriggerId:b=null,children:v}=t,j=E1((L,Y)=>new LY({open:a,openProp:l,activeTriggerId:b,triggerIdProp:p},L,Y));j.useControlledProp("openProp",l),j.useControlledProp("triggerIdProp",p),j.useContextCallback("onOpenChange",h),j.useContextCallback("onOpenChangeComplete",m);const S=j.useState("open"),N=!r&&S,C=j.useState("activeTriggerId"),E=j.useState("mounted"),T=j.useState("payload");j.useSyncedValues({trackCursorAxis:u,disableHoverablePopup:c,disabled:r}),Cg(j,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:O,transitionStatus:k}=kg(N,j),M=j.useState("isInstantPhase"),A=j.useState("instantType"),R=j.useState("lastOpenChangeReason"),z=g.useRef(null);qe(()=>{S&&r&&j.setOpen(!1,bt(kA))},[S,r,j]),qe(()=>{k==="ending"&&R===Tr||k!=="ending"&&M?(A!=="delay"&&(z.current=A),j.set("instantType","delay")):z.current!==null&&(j.set("instantType",z.current),z.current=null)},[k,M,R,A,j]),qe(()=>{N&&C==null&&j.set("payload",void 0)},[j,C,N]),g.useImperativeHandle(f,()=>({unmount:O,close:()=>j.setOpen(!1,bt(xg))}),[O,j]);const _=N||E||!r&&u!=="none";return s.jsxs(ZM.Provider,{value:j,children:[x&&s.jsx(Sg,{handle:x,store:j}),_&&s.jsx(UY,{store:j,disabled:r,trackCursorAxis:u}),typeof v=="function"?v({payload:T}):v]})});function UY({store:e,disabled:t,trackCursorAxis:r}){const a=e.useState("floatingRootContext"),l=pf(a,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),c=fB(a,{enabled:!t&&r!=="none",axis:r==="none"?void 0:r}),u=g.useMemo(()=>Ys(c.reference,l.reference),[c.reference,l.reference]);return Tg(e,{activeTriggerProps:u,inactiveTriggerProps:u,popupProps:l.floating??gn}),null}const JM=g.createContext(void 0);function HY(){return g.useContext(JM)}const FY=600,e3="data-base-ui-tooltip-trigger";function sE(e){if("composedPath"in e){const r=e.composedPath();for(let a=0;a<r.length;a+=1){const l=r[a];if(Gt(l))return l}}const t=e.target;return Gt(t)?t:null}function GY(e){let t=e;for(;t;){const r=t.closest(`[${e3}]`);if(r)return r;const a=t.getRootNode();t="host"in a&&Gt(a.host)?a.host:null}return null}const qY=v1(function(t,r){const{render:a,className:l,style:c,handle:u,payload:f,disabled:h,delay:m,closeOnClick:x=!0,closeDelay:p,id:b,...v}=t,j=zf(!0),N=M1(u)??j;if(!N)throw new Error(Zt(82));const C=ms(b),E=N.useState("isTriggerActive",C),T=N.useState("isOpenedByTrigger",C),O=N.useState("floatingRootContext"),k=g.useRef(null),M=p??0,{registerTrigger:A,isMountedByThisTrigger:R}=A1(C,k,N,{payload:f,closeOnClick:x,closeDelay:M}),z=HY(),{activeIdRef:_,delayRef:L,isInstantPhase:Y,hasProvider:P}=nB(O,{open:T}),V=z1(O);N.useSyncedValue("isInstantPhase",Y);const U=N.useState("disabled"),H=h??U,F=In(H),q=N.useState("trackCursorAxis"),W=N.useState("disableHoverablePopup"),B=g.useRef(!1),J=es(),X=g.useRef(void 0);function re(){return P&&_.current!=null?0:m??z??FY}function I(Z){const de=k.current;if(!de||!Z)return!1;const ke=GY(Z);return ke!==null&&ke!==de&&pt(de,ke)}function $(Z){const de=I(Z);return B.current=de,de&&(V.openChangeTimeout.clear(),V.restTimeout.clear(),V.restTimeoutPending=!1,J.clear()),de}const Q=I1(O,{enabled:!H,mouseOnly:!0,move:!1,handleClose:!W&&q!=="both"?_1():null,restMs:re,delay(){return p==null&&P?{close:Il(L.current,"close")}:{close:M}},triggerElementRef:k,isActiveTrigger:E,isClosing:()=>N.select("transitionStatus")==="ending",shouldOpen(){return!B.current}}),G=c5(O,{enabled:!H}).reference,se=Z=>{const de=B.current,ke=sE(Z),_e=$(ke),je=k.current,Ae=je&&ke&&pt(je,ke);if(_e&&N.select("open")&&N.select("lastOpenChangeReason")===Un){N.setOpen(!1,bt(Un,Z));return}if(de&&!_e&&Ae&&!F.current&&!N.select("open")&&je&&Ei(X.current)){const te=()=>{!B.current&&!F.current&&!N.select("open")&&N.setOpen(!0,bt(Un,Z,je))},Ee=re();Ee===0?(J.clear(),te()):J.start(Ee,te)}},ee=N.useState("triggerProps",R);return Nt("button",t,{state:{open:T},ref:[r,A,k],props:[Q,G,R||q!=="none"?ee:void 0,{onMouseOver(Z){se(Z.nativeEvent)},onFocus(Z){I(sE(Z.nativeEvent))&&Z.preventBaseUIHandler()},onMouseLeave(){B.current=!1,J.clear(),X.current=void 0},onPointerEnter(Z){X.current=Z.pointerType},onPointerDown(Z){X.current=Z.pointerType,N.set("closeOnClick",x),x&&!N.select("open")&&N.cancelPendingOpen(Z.nativeEvent)},onClick(Z){x&&!N.select("open")&&N.cancelPendingOpen(Z.nativeEvent)},id:C,[$y]:H?"":void 0,[e3]:H?void 0:""},v],stateAttributesMapping:u1})}),t3=g.createContext(void 0);function YY(){const e=g.useContext(t3);if(e===void 0)throw new Error(Zt(70));return e}const KY=g.forwardRef(function(t,r){const{children:a,container:l,className:c,render:u,style:f,...h}=t,{node:m,subtree:x}=GA({container:l,ref:r,componentProps:t,elementProps:h});return!x&&!m?null:s.jsxs(g.Fragment,{children:[x,m&&Xr.createPortal(a,m)]})}),XY=g.forwardRef(function(t,r){const{keepMounted:a=!1,...l}=t;return zf().useState("mounted")||a?s.jsx(t3.Provider,{value:a,children:s.jsx(KY,{ref:r,...l})}):null}),n3=g.createContext(void 0);function s3(){const e=g.useContext(n3);if(e===void 0)throw new Error(Zt(71));return e}const WY=g.forwardRef(function(t,r){const{render:a,className:l,anchor:c,positionMethod:u="absolute",side:f="top",align:h="center",sideOffset:m=0,alignOffset:x=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:v=5,sticky:j=!1,disableAnchorTracking:S=!1,collisionAvoidance:N=w1,style:C,...E}=t,T=zf(),O=YY(),k=T.useState("open"),M=T.useState("mounted"),A=T.useState("trackCursorAxis"),R=T.useState("disableHoverablePopup"),z=T.useState("floatingRootContext"),_=T.useState("instantType"),L=T.useState("transitionStatus"),Y=T.useState("adaptiveOrigin"),P=Dg({anchor:c,positionMethod:u,floatingRootContext:z,mounted:M,side:f,sideOffset:m,align:h,alignOffset:x,collisionBoundary:p,collisionPadding:b,sticky:j,arrowPadding:v,disableAnchorTracking:S,keepMounted:O,collisionAvoidance:N,adaptiveOrigin:Y}),V=g.useMemo(()=>({open:k,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:A!=="none"?"tracking-cursor":_}),[k,P.side,P.align,P.anchorHidden,A,_]),U=Pg(t,V,{styles:P.positionerStyles,transitionStatus:L,props:E,refs:[r,T.useStateSetter("positionerElement")],hidden:!M,inert:!k||A==="both"||R});return s.jsx(n3.Provider,{value:P,children:U})}),QY=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,f=zf(),{side:h,align:m}=s3(),x=f.useState("open"),p=f.useState("instantType"),b=f.useState("transitionStatus"),v=f.useState("popupProps"),j=f.useState("floatingRootContext"),S=f.useState("disabled"),N=f.useState("closeDelay");ir({open:x,ref:f.context.popupRef,onComplete(){var O,k;x&&((k=(O=f.context).onOpenChangeComplete)==null||k.call(O,!0))}}),P1(j,{enabled:!S,closeDelay:N});const C=f.useStateSetter("popupElement");return Nt("div",t,{state:{open:x,side:h,align:m,instant:p,transitionStatus:b},ref:[r,f.context.popupRef,C],props:[gf,v,vf(b),u],stateAttributesMapping:dg})}),ZY=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,f=zf(),{arrowRef:h,side:m,align:x,arrowUncentered:p,arrowStyles:b}=s3(),v=f.useState("open"),j=f.useState("instantType");return Nt("div",t,{state:{open:v,side:m,align:x,uncentered:p,instant:j},ref:[r,h],props:[{style:b,"aria-hidden":!0},u],stateAttributesMapping:cf})}),JY=function(t){const{delay:r,closeDelay:a,timeout:l=400}=t,c=g.useMemo(()=>({open:r,close:a}),[r,a]);return s.jsx(JM.Provider,{value:r,children:s.jsx(tB,{delay:c,timeoutMs:l,children:t.children})})};function Jg({delay:e=0,...t}){return s.jsx(JY,{"data-slot":"tooltip-provider",delay:e,...t})}function Ia({...e}){return s.jsx(VY,{"data-slot":"tooltip",...e})}function _a({...e}){return s.jsx(qY,{"data-slot":"tooltip-trigger",...e})}function La({className:e,side:t="top",sideOffset:r=4,align:a="center",alignOffset:l=0,children:c,...u}){return s.jsx(XY,{children:s.jsx(WY,{align:a,alignOffset:l,side:t,sideOffset:r,className:"isolate z-50",children:s.jsxs(QY,{"data-slot":"tooltip-content",className:Le("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...u,children:[c,s.jsx(ZY,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Qo={own:{label:"Sandbox",swatch:"bg-stone-700",beam:["#a8a29e","#44403c"]},agent:{label:"Agent defaults",swatch:"bg-indigo-500",beam:["#a5b4fc","#6366f1"]},org:{label:"Shared",swatch:"bg-[#4a5568]",beam:["#94a3b8","#4a5568"]},group:{label:"Inherited",swatch:"bg-teal-600",beam:["#5eead4","#0f766e"]},policy:{label:"Network rule",swatch:"bg-indigo-600",beam:["#a5b4fc","#4338ca"]},secret:{label:"Secret",swatch:"bg-amber-600",beam:["#fcd34d","#b45309"]}},Hp=["org","policy","group","agent","own","secret"],Aa=e=>e.startsWith("_provider_")?"secret":e.startsWith("egress_")?"policy":e.startsWith("org_")?"org":e.startsWith("group_")?"group":e.startsWith("agent-")?"agent":"own",_d=e=>e.replace(/^_provider_/,"").replace(/^(org|group|egress)_/,"").replace(/_/g,"-");function $w(e){if(!e)return null;try{return new URL(e.includes("://")?e:`https://${e}`).hostname}catch{return e.split("/")[0].replace(/:\d+$/,"")}}function r3(e){try{const t=new URL(e.includes("://")?e:`https://${e}`);return Number(t.port)||(t.protocol==="http:"?80:443)}catch{return 443}}const Fp=e=>e.split("/").pop(),o3=e=>/^\d+\.\d+\.\d+\.\d+$/.test(e);function eK(e){const t=String(e).replace(/^\*\*?\./,"").split(".");return(t.length>=3&&["co","com","org","net","ac","gov"].includes(t.at(-2))?t.at(-3):t.at(-2)??t[0])??e}function Vw({host:e,tone:t="default",className:r}){return s.jsx("span",{"aria-hidden":"true",className:Le("flex size-6 shrink-0 items-center justify-center rounded-md border font-sans text-xs font-medium",t==="denied"?"border-red-200/60 bg-red-50 text-red-700":"border-border bg-muted/50 text-muted-foreground",r),children:eK(e).charAt(0).toUpperCase()})}const rE=g.forwardRef(function({item:t,denied:r,active:a,onFocus:l,onBlur:c,onAllow:u},f){const h=Qo[t.source]??Qo.own;return s.jsxs("div",{ref:f,className:Le("relative z-10 flex h-[23px] w-full min-w-0 items-center rounded-md border bg-card transition-colors",a?"border-stone-400":"border-border/80"),children:[s.jsxs(Ia,{children:[s.jsxs(_a,{render:s.jsx("button",{type:"button"}),onMouseEnter:l,onMouseLeave:c,onFocus:l,onBlur:c,"aria-label":`${t.host}, ${r?`${t.count} blocked attempts`:`allowed · ${h.label}`}`,className:"flex h-full min-w-0 flex-1 items-center gap-2 rounded-md px-2.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-foreground",children:t.host}),r?s.jsxs("span",{className:"shrink-0 text-[10px] tabular-nums text-muted-foreground",children:[t.count,"×"]}):s.jsx("span",{className:Le("size-1 shrink-0 rounded-full",h.swatch)})]}),s.jsxs(La,{className:"max-w-sm break-all font-sans",children:[t.host," · ",r?"Blocked in recent activity":`Allowed · ${h.label}`]})]}),r&&u&&s.jsx(ce,{size:"sm",variant:"ghost",className:"mr-1 px-2 text-[11px]",onClick:u,children:"Review"})]})}),Nh=g.forwardRef(function({title:t,count:r,icon:a,summary:l,open:c,onToggle:u,tone:f="neutral",children:h,className:m,...x},p){const b=g.useId();return s.jsxs("section",{ref:p,...x,className:Le("relative z-10 min-w-0 overflow-hidden rounded-none border shadow-[0_2px_6px_#1c191703]",f==="blocked"?"border-red-200/60 bg-[var(--graph-blocked)]":f==="allowed"?"border-emerald-200/60 bg-[var(--graph-allowed)]":"border-stone-200 bg-[var(--graph-neutral)]",m),children:[s.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":b,"aria-label":`${c?"Collapse":"Expand"} ${t}`,onClick:u,className:"group flex w-full items-center gap-2.5 rounded-none px-4 py-2.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[s.jsx("span",{className:Le("flex size-7 shrink-0 items-center justify-center rounded-full border bg-card",f==="blocked"?"border-red-200/60 text-red-500":f==="allowed"?"border-emerald-200/60 text-emerald-600":"border-border text-stone-500"),children:s.jsx(a,{className:"size-3.5",strokeWidth:1.5})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"flex items-center gap-2 text-[11px] font-medium",children:[t,s.jsx("span",{className:"text-[10px] font-normal tabular-nums text-muted-foreground",children:r})]}),s.jsx("span",{className:"mt-0.5 block truncate text-[10px] text-muted-foreground",title:l,children:l})]}),s.jsx(ko,{className:Le("size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",c&&"rotate-180")})]}),s.jsx(Yn.div,{id:b,initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:lr()?0:.22,ease:[.22,1,.36,1]},inert:!c,"aria-hidden":!c,className:"overflow-hidden",children:s.jsx("div",{className:"space-y-0.5 border-t border-black/5 p-2",children:h})})]})});function $c({children:e,canvas:t,label:r}){var h;const[a,l]=g.useState({x:0,y:0}),c=g.useRef(null),u=g.useRef(!1),f=(m,x,p)=>{const b=t.current.getBoundingClientRect(),v=m.getBoundingClientRect(),j=b.width/t.current.offsetWidth||1,S=(v.left-b.left)/j-a.x,N=(v.top-b.top)/j-a.y;return{x:Math.max(-S,Math.min(x,b.width/j-S-v.width/j)),y:Math.max(-N,Math.min(p,b.height/j-N-v.height/j))}};return g.useLayoutEffect(()=>{var m;(m=t.current)==null||m.dispatchEvent(new Event("graph-move"))},[a,t]),g.cloneElement(e,{tabIndex:0,"aria-label":`${r}. Drag to move or use arrow keys`,className:Le(e.props.className,"cursor-grab touch-none select-none outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing"),style:{...e.props.style,transform:`translate(${a.x}px, ${a.y}px)`,zIndex:(h=c.current)!=null&&h.moved?30:10},onDragStart:m=>m.preventDefault(),onPointerDown:m=>{m.button!==0||!m.isPrimary||m.target.closest("[data-resource-list]")||m.target.closest("button")&&!m.target.closest("button[aria-expanded], [data-graph-drag-handle]")||(u.current=!1,c.current={id:m.pointerId,x:m.clientX,y:m.clientY,offset:a,moved:!1})},onPointerLeave:()=>{var m;(m=c.current)!=null&&m.moved||(c.current=null)},onPointerMove:m=>{const x=c.current;if(!x||x.id!==m.pointerId)return;const p=m.clientX-x.x,b=m.clientY-x.y;if(!x.moved&&Math.hypot(p,b)<5)return;x.moved=!0,u.current=!0,m.currentTarget.setPointerCapture(m.pointerId);const v=t.current.getBoundingClientRect().width/t.current.offsetWidth||1;l(f(m.currentTarget,x.offset.x+p/v,x.offset.y+b/v))},onPointerUp:m=>{m.currentTarget.hasPointerCapture(m.pointerId)&&m.currentTarget.releasePointerCapture(m.pointerId),c.current=null,l(x=>({...x}))},onPointerCancel:()=>{c.current=null,u.current=!1},onLostPointerCapture:()=>{c.current=null},onClickCapture:m=>{u.current&&(m.preventDefault(),m.stopPropagation(),u.current=!1)},onKeyDown:m=>{if(m.target!==m.currentTarget)return;const x={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[m.key];if(!x)return;m.preventDefault();const p=m.shiftKey?20:5;l(f(m.currentTarget,a.x+x[0]*p,a.y+x[1]*p))}})}function tK({name:e,phase:t,agents:r=[],agentStatus:a="Agent inventory not checked",allowed:l,denied:c,onAllow:u,compact:f=!1,fill:h=!1,owner:m="Not reported",secrets:x=[],gateway:p}){const b=g.useRef(null),v=g.useRef(null),j=g.useRef(null),S=g.useMemo(()=>({agents:g.createRef(),owner:g.createRef(),secrets:g.createRef(),blocked:g.createRef(),allowed:g.createRef()}),[]),[N,C]=g.useReducer(z=>z+1,0);g.useEffect(()=>{var L;let z=(L=b.current)==null?void 0:L.clientWidth;const _=new ResizeObserver(()=>{var P;const Y=(P=b.current)==null?void 0:P.clientWidth;Y!==z&&(z=Y,C())});return _.observe(b.current),()=>_.disconnect()},[]);const[E,T]=g.useState({}),[O,k]=g.useState(null),M=z=>T(_=>({..._,[z]:!_[z]})),A=["secrets","blocked","allowed",...r.flatMap(z=>[`${z.name}:mcps`,`${z.name}:skills`])],R=A.every(z=>E[z]);return s.jsx(Jg,{delay:150,children:s.jsxs("div",{className:Le("@container flex flex-col overflow-hidden rounded-xl border border-border/70 bg-card font-sans",h&&"flex-1"),"aria-label":`Access graph for ${e}`,children:[s.jsx("div",{className:"flex items-center justify-end gap-3 border-b border-border/50 px-4 py-1.5",children:s.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s.jsx("button",{type:"button",onClick:C,className:"rounded px-1 text-[10px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:"Reset layout"}),s.jsx("button",{type:"button",onClick:()=>T(Object.fromEntries(A.map(z=>[z,!R]))),className:"rounded px-1 text-[10px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:R?"Collapse all":"Expand all"})]})}),s.jsxs("div",{ref:b,className:Le("relative mx-auto grid w-full flex-1 max-w-[1020px] grid-cols-1 items-center gap-5 px-4 @2xl:grid-cols-[minmax(0,1fr)_160px_minmax(0,1.3fr)] @2xl:gap-x-8 @2xl:gap-y-7 @2xl:px-6",f?"py-3":"py-7"),children:[s.jsx("div",{ref:S.agents,"aria-label":"Agent types",className:"relative z-10 order-3 flex flex-col items-center gap-7 @2xl:order-none @2xl:col-start-1 @2xl:row-start-1 @2xl:row-span-4",children:(r.length?r:[{name:a,logo:null}]).map(z=>s.jsx($c,{canvas:b,label:z.name,children:s.jsxs("div",{className:"flex w-full max-w-[280px] flex-col items-center gap-2",children:[s.jsxs(nE,{"data-agent-node":!0,className:"relative isolate size-[52px] shrink-0 items-center justify-center gap-0 overflow-visible rounded-[14px] border-stone-300/80 bg-gradient-to-b from-stone-50 to-stone-100 p-1.5 shadow-[0_3px_0_-1px_var(--color-stone-200),0_3px_0_0_var(--edge-neutral),0_6px_10px_-5px_#1c191725,inset_0_1px_0_var(--frame-highlight)]",children:[s.jsx(QM,{shineColor:["var(--edge-neutral)","var(--frame-highlight)","var(--ink-faint)"],duration:18,"aria-hidden":"true"}),s.jsx("div",{className:"flex size-full items-center justify-center rounded-[9px] border border-stone-200/80 bg-card shadow-[inset_0_2px_4px_#1c191708,0_1px_0_var(--frame-highlight)]",children:z.logo?s.jsx("img",{src:z.logo,alt:"",className:"size-6 object-contain"}):s.jsx(CR,{className:"size-5 text-muted-foreground",strokeWidth:1.3,"aria-hidden":"true"})})]}),s.jsx("span",{className:"max-w-full break-words bg-card px-2 text-center text-xs font-medium",children:z.name}),r.length>0&&s.jsx("div",{className:"relative w-full pt-4 before:absolute before:left-1/2 before:top-0 before:h-4 before:border-l before:border-[var(--edge-neutral)]",children:s.jsx("div",{role:"group","aria-label":`${z.name} resources`,className:"overflow-hidden rounded-xl border border-border/80 bg-card shadow-[0_2px_8px_#1c191705]",children:[{kind:"mcps",title:"MCPs",icon:Kv},{kind:"skills",title:"Skills",icon:DP}].map(({kind:_,title:L,icon:Y})=>{var q;const P=(q=z.resources)==null?void 0:q[_],V=(P==null?void 0:P.status)==="checked",U=(P==null?void 0:P.status)==="unsupported",H=V?P.items:[],F=`${z.name}:${_}`;return s.jsx(Nh,{title:L,"aria-label":`${z.name} ${L}`,count:V?H.length:"-",icon:Y,summary:U?"Setup integration unavailable":V?"In agent user configuration":"Inventory unavailable",open:!!E[F],onToggle:()=>M(F),className:Le("border-0 shadow-none",_==="skills"&&"border-t border-border/60"),children:s.jsxs("div",{"data-resource-list":!0,className:"max-h-48 touch-pan-y select-text space-y-0.5 overflow-y-auto overscroll-contain",children:[H.map(W=>s.jsxs("div",{className:"flex min-h-[23px] items-center gap-2 rounded-md border border-border/80 bg-card px-2.5 py-1 text-[11px]",children:[s.jsx("span",{className:"min-w-0 flex-1 break-words",children:_==="skills"?W.name.replace(/^os-[a-f0-9]{8}-(?=.)/i,""):W.name}),W.disabled&&s.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"Disabled"})]},W.name)),!H.length&&s.jsx("p",{className:"px-2 py-2 text-center text-[11px] text-muted-foreground",children:U?`${L} integration unavailable`:V?`No ${L} found in user configuration`:`${L} inventory unavailable`})]})},_)})})})]})},`${e}-${N}-${z.name}`))}),s.jsx($c,{canvas:b,label:"Owner",children:s.jsxs(nE,{ref:S.owner,role:"group","aria-label":"Owner",className:"relative z-10 w-max min-w-0 max-w-full justify-self-center gap-1.5 border-stone-200 bg-[var(--graph-neutral)] px-3 py-2.5 shadow-[0_2px_6px_#1c191703] @2xl:col-start-2 @2xl:row-start-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground",children:[s.jsx(y6,{className:"size-3 shrink-0",strokeWidth:1.5,"aria-hidden":"true"}),s.jsx("span",{children:"Owner"})]}),s.jsx("p",{className:"min-w-0 whitespace-normal text-[11px] font-medium leading-relaxed [overflow-wrap:anywhere]",children:m})]})},`${e}-${N}-owner`),s.jsx($c,{canvas:b,label:e,children:s.jsxs("div",{ref:j,className:"relative z-10 flex min-w-0 flex-col items-center justify-self-center rounded-xl px-3 @2xl:col-start-2 @2xl:row-start-2",children:[s.jsx("div",{ref:v,className:"flex size-14 items-center justify-center rounded-2xl border border-stone-300 bg-card shadow-[0_3px_8px_#1c191708]",children:s.jsx(Fl,{className:"size-6 text-stone-600",strokeWidth:1.3})}),s.jsx("p",{className:"mt-2 max-w-[156px] truncate text-xs font-medium",title:e,children:e})]})},`${e}-${N}-sandbox`),s.jsx($c,{canvas:b,label:"Gateway",children:s.jsx("div",{className:"relative z-10 flex justify-center @2xl:col-start-2 @2xl:row-start-3",children:s.jsxs(Ia,{children:[s.jsxs(_a,{"data-graph-drag-handle":!0,render:s.jsx("button",{type:"button"}),className:"relative z-10 flex min-h-10 max-w-full items-center gap-1.5 bg-card px-2 text-[10px] text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(rf,{className:"size-3 shrink-0",strokeWidth:1.5}),s.jsx("span",{children:p?p.remote?"Remote endpoint":"Local/tunnel endpoint":"Gateway not reported"})]}),s.jsxs(La,{className:"max-w-64 font-sans",children:[p?`Connected through ${p.name}. `:"","The sandbox’s host machine is not reported."]})]})})},`${e}-${N}-gateway`),s.jsx($c,{canvas:b,label:"Network access",children:s.jsxs("section",{"aria-label":"Network access",className:"relative z-10 order-4 overflow-hidden rounded-xl border border-border/80 bg-card shadow-[0_2px_8px_#1c191705] @2xl:order-none @2xl:col-start-3 @2xl:row-start-1 @2xl:row-span-4",children:[s.jsxs("div",{className:"flex items-center gap-2 border-b border-border/60 px-4 py-3",children:[s.jsx(Jp,{className:"size-3.5 text-muted-foreground",strokeWidth:1.5,"aria-hidden":"true"}),s.jsx("h4",{className:"text-[11px] font-medium",children:"Network"}),s.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:"Outbound access"})]}),s.jsxs(Nh,{ref:S.allowed,title:"Approved network",count:l.length,icon:qn,summary:"Destinations in policy",tone:"allowed",open:!!E.allowed,onToggle:()=>M("allowed"),className:"border-0 shadow-none",children:[l.map(z=>s.jsx(rE,{item:z,active:O===z.host,onFocus:()=>k(z.host),onBlur:()=>k(null)},z.host)),!l.length&&s.jsx("p",{className:"py-2 text-center text-[11px] text-muted-foreground",children:"No approved destinations"})]}),s.jsxs(Nh,{ref:S.blocked,title:"Blocked network",count:c.length,icon:OP,summary:"Recent connection attempts",tone:"blocked",open:!!E.blocked,onToggle:()=>M("blocked"),className:"border-0 border-t border-border/60 shadow-none",children:[c.map(z=>s.jsx(rE,{item:z,denied:!0,active:O===z.host,onFocus:()=>k(z.host),onBlur:()=>k(null),onAllow:u?()=>u(z):void 0},z.host)),!c.length&&s.jsx("p",{className:"py-2 text-center text-[11px] text-muted-foreground",children:"No blocked attempts"})]})]})},`${e}-${N}-network`),s.jsx($c,{canvas:b,label:"Secrets",children:s.jsxs(Nh,{ref:S.secrets,title:"Secrets",count:x.length,icon:pu,summary:x.length?x.map(z=>z.name).join(", "):"None attached",open:!!E.secrets,onToggle:()=>M("secrets"),className:"@2xl:col-start-2 @2xl:row-start-4",children:[x.map(z=>{var _;return s.jsxs(Ia,{children:[s.jsx(_a,{render:s.jsx("button",{type:"button"}),className:"block w-full truncate rounded-lg border border-border/70 bg-card px-2.5 py-1.5 text-left text-[11px] outline-none focus-visible:ring-2 focus-visible:ring-ring",children:z.name}),s.jsxs(La,{className:"max-w-72 break-words font-sans",children:[z.name,z.type?` · ${z.type}`:"",(_=z.credentialKeys)!=null&&_.length?` · ${z.credentialKeys.join(", ")}`:""]})]},z.name)}),!x.length&&s.jsx("p",{className:"py-2 text-center text-[11px] text-muted-foreground",children:"No secrets attached"})]})},`${e}-${N}-secrets`),s.jsx(nK,{container:b,core:v,hub:j,groups:S},`${e}-${N}-${r.map(z=>z.name).join(",")}`)]})]})})}function nK({container:e,core:t,hub:r,groups:a}){const l=g.useRef(null),[c,u]=g.useState([]);return g.useEffect(()=>{function f(){var C;if(!e.current||!t.current||!r.current)return;const x=(C=l.current)==null?void 0:C.getScreenCTM();if(!x)return;const p=x.inverse(),b=E=>{const T=E.getBoundingClientRect(),O=new DOMPoint(T.left,T.top).matrixTransform(p),k=new DOMPoint(T.right,T.bottom).matrixTransform(p);return{left:O.x,top:O.y,right:k.x,bottom:k.y,width:k.x-O.x,height:k.y-O.y}},v=b(t.current),j=b(r.current),S=v.left+v.width/2,N=v.top+v.height/2;u(Object.entries(a).flatMap(([E,T])=>{const O=T.current?b(T.current):null;if(!O)return[];if(E==="owner"||E==="secrets"){const L=E==="owner"?v.top:j.bottom,Y=E==="owner"?O.bottom:O.top,P=O.left+O.width/2,V=(L+Y)/2;return[{key:E,d:`M ${S} ${L} C ${S} ${V}, ${P} ${V}, ${P} ${Y}`,x:P,y:Y}]}if(E==="agents")return[...T.current.querySelectorAll("[data-agent-node]")].map((L,Y)=>{const P=b(L),V=v.left,U=P.right,H=P.top+P.height/2,F=(V+U)/2;return{key:`agent-${Y}`,d:`M ${V} ${N} C ${F} ${N}, ${F} ${H}, ${U} ${H}`,x:U,y:H}});const k=v.right,M=O.left,A=b(T.current.querySelector("button")),R=A.top+A.height/2,z=k+(M-k)*.4,_=z+(M-z)*.5;return[{key:E,d:`M ${k} ${N} H ${z} C ${_} ${N}, ${_} ${R}, ${M} ${R}`,x:M,y:R}]}))}f();const h=new ResizeObserver(f);[e.current,t.current,r.current,...Object.values(a).map(x=>x.current)].filter(Boolean).forEach(x=>h.observe(x));const m=e.current;return m.addEventListener("graph-move",f),()=>{h.disconnect(),m.removeEventListener("graph-move",f)}},[e,t,r,a]),s.jsx("svg",{ref:l,className:"pointer-events-none absolute inset-0 hidden size-full overflow-visible @2xl:block","aria-hidden":"true",fill:"none",children:c.map(f=>s.jsxs("g",{children:[s.jsx("path",{d:f.d,stroke:f.key==="blocked"?"var(--edge-blocked)":f.key==="allowed"?"var(--edge-allowed)":"var(--edge-neutral)",strokeWidth:"1.5",strokeLinecap:"round"}),s.jsx("circle",{cx:f.x,cy:f.y,r:"2.5",fill:"var(--card)",stroke:"var(--edge-neutral)"})]},f.key))})}async function sK(e,t){const r=[],a=[],l=[];for(const c of e)try{const u=await t(c.id);r.push(c.id);for(const f of u.failed??[])l.push({...f,rule:c.name})}catch(u){a.push({id:c.id,name:c.name,message:u.message})}return{deleted:r,failed:a,syncFailures:l}}const Zd=e=>e.id||`${e.sandbox}|${e.at}|${e.source}|${e.target}|${e.message}`,oE={CRITICAL:6,FATAL:6,HIGH:5,MED:4,MEDIUM:4,LOW:3,INFO:2,INFORMATIONAL:2},rK={policy_dns_ineligible:"no rule allows this host",transparent_tcp_policy_denied:"no rule allows this connection"},oK={NET:"Network",HTTP:"HTTP",SSH:"Session",CONFIG:"Configuration",PROC:"Process",FILE:"File",AUTH:"Authentication",FINDING:"Finding",EVENT:"Event"};function a3(e){var u,f,h,m;const t=((u=e.binary)==null?void 0:u.split("/").pop())||"",r=Kg.find(x=>x.commands.includes(t.toLowerCase())&&t.toLowerCase()!=="agent"),a=r?{name:r.name,logo:`/logos/agents/${r.logo}.svg`}:null,l=e.direction||(e.kind==="inbound"&&["NET","HTTP","SSH"].includes(e.category)?"in":e.kind==="audit"&&["NET","HTTP"].includes(e.category)?"out":"unknown"),c={time:e.at??"",sandbox:e.sandbox??"",scope:e.scope??"",sandboxId:e.sandboxId??((f=e.original)==null?void 0:f.sandboxId)??"",agent:(a==null?void 0:a.name)??"Unknown",category:oK[e.category]??(e.kind==="log"?"Log":"Unclassified"),severity:e.severity||"Not reported",logLevel:e.level&&e.level!=="OCSF"?e.level:"Not reported",direction:l,verdict:e.verdict||(["NET","HTTP","SSH","AUTH"].includes(e.category)?"not reported":"not applicable"),outcome:e.outcome??"unknown",process:e.binary??"",action:[r?"":t,e.method||e.action].filter(Boolean).join(" · ")||"Not reported",destination:e.destination??"",policy:e.policy??"",session:e.sessionId??"",correlation:e.correlationId??"",why:rK[e.reason]??e.reason??""};return{event:e,agent:a,key:Zd(e),values:c,timestamp:Date.parse(e.at),search:[...Object.values(c),e.message,e.detail,e.source,e.target,JSON.stringify(((h=e.original)==null?void 0:h.fields)??((m=e.original)==null?void 0:m.metadata)??{})].join(" ").toLowerCase()}}function aE(e,{query:t="",direction:r="all",sandboxes:a=[],verdicts:l=[],agents:c=[],filters:u={},range:f="all",from:h="",to:m="",now:x=Date.now(),sort:p={key:"time",direction:"desc"}}={}){const b=new Set(a),v=t.trim().toLowerCase(),j=f==="custom"?h?Date.parse(h):-1/0:f==="all"?-1/0:x-Number(f)*6e4,S=f==="custom"&&m?Date.parse(m):1/0;return e.filter(N=>r!=="all"&&N.values.direction!==r||b.size&&!b.has(N.values.sandbox)||c.length&&!c.includes(N.values.agent)||l.length&&!l.includes(N.values.verdict)||v&&!N.search.includes(v)||f!=="all"&&(!Number.isFinite(N.timestamp)||N.timestamp<j||N.timestamp>S)?!1:Object.entries(u).every(([C,E])=>{var T;return!((T=E==null?void 0:E.value)!=null&&T.trim())||(E.mode==="equals"?(N.values[C]??"").toLowerCase()===E.value.trim().toLowerCase():(N.values[C]??"").toLowerCase().includes(E.value.trim().toLowerCase()))!==(E.mode==="excludes")})).sort((N,C)=>{const E=p.key==="severity"?oE[N.values.severity.toUpperCase()]??-1:p.key==="time"?Number.isFinite(N.timestamp)?N.timestamp:0:N.values[p.key]??"",T=p.key==="severity"?oE[C.values.severity.toUpperCase()]??-1:p.key==="time"?Number.isFinite(C.timestamp)?C.timestamp:0:C.values[p.key]??"",O=typeof E=="number"?E-T:E.localeCompare(T,void 0,{numeric:!0});return(p.direction==="asc"?O:-O)||N.key.localeCompare(C.key)})}const i3=g.createContext(null),hy=2e3;function Uw({children:e}){const t=$t(),r=Cn(),[a,l]=g.useState(null),[c,u]=g.useState(null),[f,h]=g.useState([]),[m,x]=g.useState("connecting"),[p,b]=g.useState(null),[v,j]=g.useState(null),S=g.useRef(new Set),N=g.useRef(0),[C,E]=g.useState(0),T=g.useCallback(A=>{const R=A.filter(z=>{const _=Zd(z);return S.current.has(_)?!1:(S.current.add(_),!0)});R.length&&h(z=>{const _=[...R,...z].sort((L,Y)=>(Y.at??"").localeCompare(L.at??""));if(_.length<=hy)return _;for(const L of _.slice(hy))S.current.delete(Zd(L));return _.slice(0,hy)})},[]),O=g.useCallback(async()=>{try{u(await t.overview())}catch(A){u(R=>R??{error:A.message})}},[t]),k=g.useCallback(async()=>{const A=N.current;try{const R=await t.activity({limit:500});if(A!==N.current)return;T(R.events),b(R.coverage),j(null)}catch(R){j(R.message)}},[T,t]);g.useEffect(()=>{let A,R,z=!1;const _=()=>{N.current++,S.current.clear(),h([]),E(L=>L+1),k()};return l(null),u(null),h([]),S.current.clear(),N.current++,t.context().then(async L=>{if(z)return;if(!r&&!L.configured){x("setup-required"),l([]);return}O(),k(),R=setInterval(O,15e3);const Y=await t.contextKey();z||(A=new EventSource(t.url("/stream",{context:Y,...r?{location:"1"}:{}})),A.onopen=()=>{x("live"),_()},A.addEventListener("context-changed",()=>window.location.reload()),A.addEventListener("activity-deleted",P=>{b(JSON.parse(P.data).coverage),_()}),A.onerror=()=>x("reconnecting"),A.addEventListener("sandboxes",P=>{x("live"),l(JSON.parse(P.data))}),A.addEventListener("log",P=>T([JSON.parse(P.data)])),A.addEventListener("collection",P=>b(JSON.parse(P.data))),A.addEventListener("gateway-health",()=>x("live")),A.addEventListener("gateway-error",()=>x("gateway-down")))}).catch(()=>{z||x("gateway-down")}),()=>{z=!0,A==null||A.close(),clearInterval(R)}},[T,k,O,t,r==null?void 0:r.context]);const M=g.useMemo(()=>({sandboxes:a??(c==null?void 0:c.sandboxes)??null,overview:c,events:f,connection:m,collection:p,historyError:v,activityRevision:C,refresh:()=>{O(),k()}}),[a,c,f,m,p,v,C,O,k]);return s.jsx(i3.Provider,{value:M,children:e})}function qa(){const e=g.useContext(i3);if(!e)throw new Error("useLive outside LiveProvider");return e}const Cl={running:{label:"Ready",bar:"bg-emerald-500",strip:"bg-emerald-500",cell:"bg-emerald-500/85",ring:"ring-emerald-600/30"},sleeping:{label:"Stopped",bar:"bg-stone-300",strip:"bg-stone-400",cell:"bg-stone-300",ring:"ring-stone-400/40"},provisioning:{label:"Preparing",bar:"bg-amber-400",strip:"bg-amber-400",cell:"bg-amber-400",ring:"ring-amber-600/30"},error:{label:"Needs attention",bar:"bg-red-500",strip:"bg-red-500",cell:"bg-red-500",ring:"ring-red-600/40"},unknown:{label:"Unverified",bar:"bg-stone-200",strip:"bg-stone-300",cell:"bg-stone-200",ring:"ring-stone-400/30"}},Iv=["running","sleeping","provisioning","error","unknown"],aK={ready:"running",provisioning:"provisioning",starting:"provisioning",stopping:"provisioning",stopped:"sleeping",completed:"sleeping",error:"error",deleting:"unknown",unknown:"unknown",unspecified:"unknown"},Gp={ready:"Ready",provisioning:"Provisioning",starting:"Starting",stopping:"Stopping",stopped:"Stopped",completed:"Completed",error:"Error",deleting:"Deleting",unknown:"Unknown",unspecified:"Unknown"},ex=e=>aK[e]??"unknown",Ba=e=>Cl[ex(e)],iK=e=>["ready","provisioning","starting"].includes(e),lK=e=>e==="stopped",cK=e=>e!=null&&e.length?e.join(" "):"Scratch shell",np=(e,t)=>t||(/^sha256:[a-f0-9]{64}$/i.test(e??"")?"Unknown template":e)||"Gateway default";function uK(e){const t=Object.fromEntries(Iv.map(r=>[r,0]));for(const r of e)t[ex(r.phase)]+=1;return{total:e.length,status:t}}const Ld=e=>{var t,r;return e.owner||((t=e.labels)==null?void 0:t["openshell.console/owner"])||((r=e.labels)==null?void 0:r.owner)||"Not reported"};function l3(e,t=Date.now()){const r=Date.parse(e);if(!Number.isFinite(r))return"Not reported";const a=Math.max(0,Math.floor((t-r)/6e4));return a<1?"<1m":a<60?`${a}m`:a<1440?`${Math.floor(a/60)}h ${a%60}m`:`${Math.floor(a/1440)}d ${Math.floor(a%1440/60)}h`}function dK(e,t=Date.now()){return["stopped","completed"].includes(e.phase)?"Not running":e.phase==="ready"?l3(e.startedAt,t):"-"}const Zo={loaded:{label:"Enforced",dot:"bg-emerald-500",cls:"bg-emerald-50 text-emerald-800 border-emerald-600/20"},pending:{label:"Loading",dot:"bg-amber-400",cls:"bg-amber-50 text-amber-800 border-amber-500/30"},failed:{label:"Failed",dot:"bg-red-500",cls:"bg-red-50 text-red-700 border-red-200"},superseded:{label:"Superseded",dot:"bg-stone-300",cls:"bg-muted text-muted-foreground border-border"},unspecified:{label:"Unknown",dot:"bg-stone-200",cls:"bg-muted text-muted-foreground border-border"}},Hw={"read-only":"Read only","read-write":"Read & write",full:"Any request",custom:"Specific requests",connect:"Connection",none:"No access",blocked:"Blocked"},fK=["GET","POST","PUT","PATCH","DELETE","HEAD","*"],mK={own:ER,agent:Fl,org:_P,group:Oa,policy:Gl,secret:pu},wo=(e,t,r=`${t}s`)=>`${e} ${e===1?t:r}`,c3=e=>e.replace(/^\*\*?\./,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,56);function jd({children:e,tone:t="",title:r}){return s.jsx("span",{title:r,className:Le("rounded-md border px-1.5 py-px font-mono text-[10.5px]",t||"border-border text-muted-foreground"),children:e})}function u3({source:e}){return s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-2 py-0.5 text-[11.5px] text-foreground/80",children:[s.jsx("span",{className:Le("size-1.5 rounded-full",Qo[e].swatch),"aria-hidden":"true"}),Qo[e].label]})}function nu({className:e,children:t}){return s.jsx("div",{className:Le("rounded-lg border border-border bg-card",e),children:t})}function hK({options:e,value:t,onChange:r,label:a}){return s.jsx("div",{role:"tablist","aria-label":a,className:"flex items-center gap-0.5 rounded-lg bg-muted p-0.5",children:e.map(l=>s.jsxs("button",{role:"tab","aria-selected":t===l.id,onClick:()=>r(l.id),className:Le("rounded-md px-2.5 py-1 text-[12px] outline-none transition-all focus-visible:ring-2 focus-visible:ring-ring",t===l.id?"bg-card text-foreground shadow-[0_1px_2px_#0000001a]":"text-muted-foreground hover:text-foreground"),children:[l.label,l.count!=null&&s.jsx("span",{className:"ml-1 text-faint tabular-nums",children:l.count})]},l.id))})}function d3({n:e,total:t}){return s.jsxs("span",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"h-1 w-14 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full bg-stone-700",style:{width:`${t?e/t*100:0}%`}})}),s.jsxs("span",{className:"text-[12px] tabular-nums",children:[s.jsx("span",{className:"text-foreground",children:e}),s.jsxs("span",{className:"text-faint",children:["/",t]})]})]})}const f3="grid-cols-[minmax(0,2fr)_minmax(0,1fr)_8rem_7rem_5rem_1rem]",m3="grid-cols-[minmax(0,1.6fr)_7.5rem_5rem_minmax(0,1fr)_13.5rem]",iE="grid-cols-[minmax(0,1.2fr)_minmax(0,1.3fr)_8rem_5rem_1rem]",py="grid-cols-[1rem_minmax(0,1.1fr)_4.5rem_minmax(0,1.5fr)_minmax(0,1fr)_7.5rem_5rem]";function pK({d:e,total:t,onOpen:r}){const[a,l]=g.useState(!1),c=lr(),u=g.useId(),f=Hp.filter(m=>e.sources.has(m)),h=[...e.grants].sort((m,x)=>m.sandbox.localeCompare(x.sandbox)||m.key.localeCompare(x.key));return s.jsxs("li",{children:[s.jsxs("button",{onClick:()=>l(!a),"aria-expanded":a,"aria-controls":u,className:Le("grid min-h-10 w-full items-center gap-4 px-6 py-2 text-left outline-none transition-colors hover:bg-muted/60 focus-visible:bg-muted/60",a&&"bg-muted/60",f3),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(Vw,{host:e.host,className:"size-6 text-[13px]"}),s.jsx("span",{className:"min-w-0",children:s.jsxs("span",{className:"block truncate font-mono text-[11px]",title:e.host,children:[e.host,s.jsx("span",{className:"ml-2 text-faint",children:[...e.ports].map(m=>`:${m}`).join(" ")})]})})]}),s.jsx("span",{className:"flex flex-wrap gap-1",children:f.map(m=>s.jsx(u3,{source:m},m))}),s.jsx("span",{className:"text-[12px] text-muted-foreground",children:e.access.size===1?Hw[[...e.access][0]]??[...e.access][0]:"Mixed"}),s.jsx("span",{className:"block",children:s.jsx(d3,{n:e.sandboxes.size,total:t})}),s.jsx("span",{className:"text-right text-[12px] tabular-nums text-muted-foreground",children:e.hits?e.hits.toLocaleString():"-"}),s.jsx(Hr,{className:Le("size-3.5 text-faint transition-transform",a&&"rotate-90"),"aria-hidden":"true"})]}),s.jsx(Rf,{initial:!1,children:a&&s.jsx(Yn.div,{id:u,role:"region","aria-label":`Access to ${e.host}`,initial:c?!1:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:c?0:.18,ease:[.2,0,0,1]},className:"overflow-hidden bg-muted/30",children:s.jsxs(Yn.div,{initial:c?!1:{opacity:0,y:-3},animate:{opacity:1,y:0},transition:{duration:c?0:.2},className:"px-6 pt-3 pb-4 pl-[3.75rem]",children:[s.jsxs("div",{className:"mb-2 flex items-baseline gap-2",children:[s.jsx("h3",{className:"text-xs font-medium",children:"Sandbox access"}),s.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[wo(e.sandboxes.size,"sandbox","sandboxes")," · ",wo(h.length,"rule assignment")]})]}),s.jsx("div",{className:"overflow-hidden rounded-md border border-border bg-card",children:s.jsxs("table",{className:"w-full table-fixed text-left text-xs","aria-label":`Sandbox access to ${e.host}`,children:[s.jsxs("colgroup",{children:[s.jsx("col",{className:"w-[35%]"}),s.jsx("col",{className:"w-[35%]"}),s.jsx("col",{className:"w-[15%]"}),s.jsx("col",{className:"w-[15%]"})]}),s.jsx("thead",{className:"border-b border-border bg-muted/40 text-[11px] text-muted-foreground",children:s.jsxs("tr",{children:[["Sandbox","Rule","Source"].map(m=>s.jsx("th",{scope:"col",className:"h-8 px-3 font-medium",children:m},m)),s.jsx("th",{scope:"col",className:"px-3",children:s.jsx("span",{className:"sr-only",children:"Actions"})})]})}),s.jsx("tbody",{className:"divide-y divide-border/60",children:h.map(m=>{const x=Qo[Aa(m.key)];return s.jsxs("tr",{className:"transition-colors hover:bg-muted/30 focus-within:bg-muted/30",children:[s.jsx("td",{className:"h-10 px-3",children:s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(Fl,{"aria-hidden":"true",strokeWidth:1.4,className:"size-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate font-medium",title:m.sandbox,children:m.sandbox})]})}),s.jsx("td",{className:"px-3",children:s.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",title:_d(m.key),children:_d(m.key)})}),s.jsx("td",{className:"px-3 text-muted-foreground",children:s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{"aria-hidden":"true",className:Le("size-1.5 shrink-0 rounded-full",x.swatch)}),x.label]})}),s.jsx("td",{className:"px-2 text-right",children:s.jsxs(ce,{variant:"ghost",size:"sm",className:"h-7 text-[11px] text-muted-foreground","aria-label":`View ${m.sandbox} policy for ${_d(m.key)}`,onClick:()=>r(m.sandbox),children:["View rules",s.jsx(Mi,{className:"size-3"})]})})]},`${m.sandbox}:${m.key}`)})})]})})]})})})]})}function gK({b:e,onDecide:t}){return s.jsxs("li",{className:Le("grid items-center gap-4 px-6 py-2",m3),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(Vw,{host:e.host,tone:"denied",className:"size-6 text-[13px]"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block truncate font-mono text-xs",children:e.host}),s.jsxs("span",{className:"block text-[11.5px] text-muted-foreground",children:[":",e.port,e.lastAt?` · ${xu(e.lastAt)}`:""]})]})]}),s.jsx("span",{className:"text-[12px] tabular-nums",children:wo(e.sandboxes.size,"sandbox","sandboxes")}),s.jsxs("span",{className:"text-[12px] tabular-nums text-red-600/90",children:[e.attempts,"×"]}),s.jsx("span",{className:"truncate font-mono text-[11.5px] text-muted-foreground",children:[...e.programs].map(Fp).join(", ")||"-"}),s.jsxs("span",{className:"flex items-center justify-end gap-1.5",children:[s.jsxs(Af,{children:[s.jsxs(Of,{className:"inline-flex h-7 items-center gap-1 rounded-md bg-[var(--action)] px-2.5 text-[12px] font-medium text-[var(--action-foreground)] outline-none transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",children:["Allow",s.jsx(ko,{className:"size-3 opacity-70"})]}),s.jsx(Mf,{align:"end",className:"w-60",children:s.jsxs(ep,{children:[s.jsxs(Pv,{children:["Allow ",e.host]}),s.jsxs(Gs,{onClick:()=>t("allow-org",e),children:[s.jsx(Oa,{}),"Choose groups",s.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"new rule"})]}),e.sandboxes.size===1&&s.jsxs(Gs,{onClick:()=>t("allow-one",e),children:[s.jsx(Oa,{}),"Groups of ",[...e.sandboxes][0]]})]})})]}),s.jsx(ce,{variant:"ghost",size:"sm",className:"h-7 rounded-lg px-2.5 text-[12px] text-muted-foreground hover:text-red-700",onClick:()=>t("block-org",e),title:"Add to the shared blocked hosts",children:"Block everywhere"})]})]})}function _v({title:e,count:t,actions:r,children:a}){return s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("h3",{className:"text-[16px] font-semibold tracking-[-0.01em]",children:e}),t!=null&&s.jsx("span",{className:"rounded-full bg-muted px-2 py-px text-[12px] tabular-nums text-muted-foreground",children:t}),r&&s.jsx("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:r})]}),a]})}function sp({className:e,children:t}){return s.jsx("div",{className:Le("sticky top-0 z-10 grid h-9 items-center gap-4 border-b border-border bg-muted px-6 text-xs font-medium text-muted-foreground",e),children:t})}function lE({action:e}){return e==="block"?s.jsx("span",{className:"w-fit rounded-full border border-red-200 bg-red-50 px-2 py-px text-[11.5px] text-red-700",children:"Block"}):s.jsx("span",{className:"w-fit rounded-full border border-emerald-600/20 bg-emerald-50 px-2 py-px text-[11.5px] text-emerald-800",children:"Allow"})}function cE({hosts:e}){return s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",title:e.join(`
|
|
517
|
+
`),children:e.slice(0,3).join(", ")}),e.length>3&&s.jsxs("span",{className:"shrink-0 text-[11px] text-faint",children:["+",e.length-3]})]})}function uE({label:e,checked:t,mixed:r=!1,disabled:a,onChange:l}){const c=g.useRef(null);return g.useEffect(()=>{c.current&&(c.current.indeterminate=r)},[r]),s.jsx("input",{ref:c,type:"checkbox","aria-label":e,checked:t,disabled:a,onChange:l,className:"block size-4 cursor-pointer rounded border-border accent-[var(--action)] focus-visible:outline-2 focus-visible:outline-ring disabled:cursor-not-allowed"})}function xK({policies:e,org:t,sandboxes:r,groups:a,assignments:l,setupMembers:c,onEdit:u,onEditBlocked:f,onClearBlocked:h,selected:m,onSelect:x,onSelectAll:p,onDelete:b,deleting:v}){var C;const j=((C=t==null?void 0:t.org)==null?void 0:C.blocked)??[],S=e.filter(E=>m.has(E.id)).length,N=e.length>0&&S===e.length;return s.jsxs(s.Fragment,{children:[s.jsxs(sp,{className:py,children:[s.jsx(uE,{label:"Select all matching network rules",checked:N,mixed:S>0&&!N,disabled:v||!e.length,onChange:p}),s.jsx("span",{children:"Rule"}),s.jsx("span",{children:"Action"}),s.jsx("span",{children:"Destinations"}),s.jsx("span",{children:"Groups"}),s.jsx("span",{children:"Enforced"}),s.jsx("span",{className:"text-right",children:"Actions"})]}),s.jsxs("ul",{className:"divide-y divide-border/60",children:[j.length>0&&s.jsxs("li",{className:Le("grid min-h-10 items-center gap-4 px-6 py-2 transition-colors hover:bg-muted/60",py),children:[s.jsx("span",{}),s.jsxs("button",{onClick:f,"aria-label":"Edit blocked everywhere",className:"col-span-5 grid grid-cols-subgrid items-center gap-4 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[s.jsx(Xv,{"aria-hidden":"true",strokeWidth:1.5,className:"size-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate text-xs font-medium",children:"Blocked everywhere"})]}),s.jsx(lE,{action:"block"}),s.jsx(cE,{hosts:j}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Every sandbox · beats every rule"}),s.jsx("span",{className:"text-[12px] text-faint",children:"Always"})]}),s.jsxs(ce,{variant:"ghost",size:"sm",className:"h-7 justify-self-end px-2 text-xs text-muted-foreground hover:text-destructive","aria-label":"Clear blocked everywhere",disabled:v,onClick:h,children:[s.jsx(Gn,{className:"size-3.5"}),"Delete"]})]}),e.map(E=>{const T=r.filter(k=>Wg(E,{name:k.name,groups:No({assignments:l},k.name),setups:(c==null?void 0:c[k.name])??[]})),O=T.filter(k=>k.status==="loaded"&&k.rules.some(M=>M.key===`egress_${E.id}`)).length;return s.jsxs("li",{className:Le("grid min-h-10 items-center gap-4 px-6 py-2 transition-colors hover:bg-muted/60",py,m.has(E.id)&&"bg-accent/40"),children:[s.jsx(uE,{label:`Select ${E.name}`,checked:m.has(E.id),disabled:v,onChange:()=>x(E.id)}),s.jsxs("button",{onClick:()=>u(E),disabled:v,"aria-label":`Edit ${E.name}`,className:"col-span-5 grid grid-cols-subgrid items-center gap-4 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[s.jsx(Gl,{"aria-hidden":"true",strokeWidth:1.5,className:"size-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate text-xs font-medium",children:E.name})]}),s.jsx(lE,{action:E.action}),s.jsx(cE,{hosts:E.destinations}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:E.appliesTo.everyone||E.appliesTo.sandboxes.length||!E.appliesTo.groups.length?s.jsx("span",{className:"text-amber-700",title:`Current scope: ${Up(E,a)||"none"}`,children:"Assign a group"}):Up(E,a)}),T.length?s.jsx(d3,{n:O,total:T.length}):s.jsx("span",{className:"text-[12px] text-faint",children:"No sandboxes"})]}),s.jsxs(ce,{variant:"ghost",size:"sm",className:"h-7 justify-self-end px-2 text-xs text-muted-foreground hover:text-destructive","aria-label":`Delete ${E.name}`,disabled:v,onClick:()=>b([E]),children:[s.jsx(Gn,{className:"size-3.5"}),"Delete"]})]},E.id)})]})]})}function bK({fleet:e,org:t,events:r,onOpen:a,onOpenGlobal:l,onDecide:c,onNavigate:u,onRefresh:f,onEditPolicy:h,onAddPolicy:m,onEditBlocked:x,onClearBlocked:p,forSandbox:b,onClearSandbox:v}){var Re,ve;const j=$t(),[S,N]=g.useState(()=>new Set),[C,E]=g.useState(null),[T,O]=g.useState(!1),[k,M]=g.useState([]),A=g.useRef(!1),[R,z]=g.useState("all"),[_,L]=g.useState(""),[Y,P]=g.useState(100),[V,U]=g.useState("rules"),[H,F]=g.useState(Date.now),q=g.useRef(null),W=g.useRef(null);g.useEffect(()=>{const pe=setInterval(()=>F(Date.now()),3e4),$e=Je=>{var mt;(Je.metaKey||Je.ctrlKey)&&Je.key.toLowerCase()==="k"&&(Je.preventDefault(),(mt=q.current)==null||mt.focus())};return window.addEventListener("keydown",$e),()=>{clearInterval(pe),window.removeEventListener("keydown",$e)}},[]),g.useEffect(()=>{var pe;P(100),(pe=W.current)==null||pe.scrollTo({top:0})},[_,R,V]);const B=g.useMemo(()=>PM(r,15,H),[r,H]),J=e.sandboxes,X=J.length,re=(t==null?void 0:t.policies)??[],I=(t==null?void 0:t.groups)??[],{destinations:$,blocked:Q,perSandbox:G}=g.useMemo(()=>{var Ie,at;const pe=new Map,$e=new Map,Je=new Map;for(const Xe of J){const me=new Set,Me={};for(const Oe of Xe.rules){const tt=Aa(Oe.key);Me[tt]=(Me[tt]??0)+1;for(const Ue of Oe.endpoints){if(Ue.blocked)continue;me.add(Ue.host);const Ge=pe.get(Ue.host)??{host:Ue.host,sources:new Set,access:new Set,ports:new Set,sandboxes:new Set,grants:[],hits:0,hitsBySandbox:new Map};Ge.sources.add(tt),Ge.access.add(Ue.access),Ue.ports.forEach(yt=>Ge.ports.add(yt)),Ge.sandboxes.add(Xe.name);let ht=Ge.grants.find(yt=>yt.sandbox===Xe.name&&yt.key===Oe.key);ht||(ht={sandbox:Xe.name,key:Oe.key,source:tt,access:[],ports:[]},Ge.grants.push(ht)),ht.access.push(Ue.access),ht.ports.push(...Ue.ports),pe.set(Ue.host,Ge)}}$e.set(Xe.name,me),Je.set(Xe.name,{counts:Me,blocked:0})}const mt=new Map;for(const Xe of r){if(Xe.kind!=="audit"||!Xe.verdict)continue;const me=$w(Xe.destination);if(!me||o3(me))continue;if(Xe.verdict==="allowed"){const tt=pe.get(me);tt&&(tt.hits+=1,tt.hitsBySandbox.set(Xe.sandbox,(tt.hitsBySandbox.get(Xe.sandbox)??0)+1));continue}if(Xe.verdict!=="denied"||(Ie=$e.get(Xe.sandbox))!=null&&Ie.has(me))continue;const Me=mt.get(me)??{host:me,port:r3(Xe.destination),sandboxes:new Set,attempts:0,programs:new Set,lastAt:null};Me.attempts+=1,Me.sandboxes.add(Xe.sandbox),Xe.binary&&Me.programs.add(Xe.binary),Xe.at&&(!Me.lastAt||Xe.at>Me.lastAt)&&(Me.lastAt=Xe.at),mt.set(me,Me);const Oe=Je.get(Xe.sandbox);Oe&&(Oe.blocked+=1)}const ot=KG([...((at=t==null?void 0:t.org)==null?void 0:at.blocked)??[],...((t==null?void 0:t.policies)??[]).filter(Xe=>Xe.action==="block").flatMap(Xe=>Xe.destinations)]);return{destinations:[...pe.values()].sort((Xe,me)=>me.sandboxes.size-Xe.sandboxes.size||me.hits-Xe.hits||Xe.host.localeCompare(me.host)),blocked:[...mt.values()].filter(Xe=>!ot.some(me=>EM(me,Xe.host))).sort((Xe,me)=>me.sandboxes.size-Xe.sandboxes.size||me.attempts-Xe.attempts),perSandbox:Je}},[J,r,t]),se=J.filter(pe=>pe.status==="loaded").length,ee=_.trim().toLowerCase(),ne=$.filter(pe=>(R==="all"||pe.sources.has(R))&&(!ee||[pe.host,...pe.grants.flatMap($e=>[$e.sandbox,$e.key])].join(" ").toLowerCase().includes(ee))),ie=ne.length,oe=[{id:"all",label:"All"},...Hp.filter(pe=>$.some($e=>$e.sources.has(pe))).map(pe=>({id:pe,label:Qo[pe].label}))],Z=Q.filter(pe=>!ee||[pe.host,...pe.programs,...pe.sandboxes].join(" ").toLowerCase().includes(ee)),de=J.filter(pe=>!ee||pe.name.toLowerCase().includes(ee)),ke=pe=>{var $e;return!b||Wg(pe,{name:b,groups:No(t,b),setups:(($e=t==null?void 0:t.setupMembers)==null?void 0:$e[b])??[]})},_e=re.filter(pe=>ke(pe)).filter(pe=>!ee||[pe.name,pe.action,...pe.destinations,Up(pe,I)].join(" ").toLowerCase().includes(ee)),je=re.filter(pe=>S.has(pe.id)),Ae=_e.filter(pe=>S.has(pe.id)).length;function te(pe){N($e=>{const Je=new Set($e);return Je.has(pe)?Je.delete(pe):Je.add(pe),Je})}function Ee(){N(pe=>{const $e=new Set(pe),Je=_e.every(mt=>pe.has(mt.id));for(const mt of _e)Je?$e.delete(mt.id):$e.add(mt.id);return $e})}async function Te(){if(!(A.current||!(C!=null&&C.length))){A.current=!0,O(!0),M([]);try{const pe=await sK(C,$e=>j.deletePolicy($e));N($e=>{const Je=new Set($e);return pe.deleted.forEach(mt=>Je.delete(mt)),pe.failed.forEach(({id:mt})=>Je.add(mt)),Je}),M(pe.failed),pe.deleted.length&&He.success(`Deleted ${wo(pe.deleted.length,"network rule")}`),pe.failed.length&&He.error(`${wo(pe.failed.length,"network rule")} could not be deleted. Review the errors and retry.`),pe.syncFailures.length&&He.warning("Rules deleted, but some sandboxes could not be updated",{description:pe.syncFailures.map($e=>`${$e.rule} · ${$e.sandbox}: ${$e.error}`).join(`
|
|
518
|
+
`)}),E(null),await f()}finally{O(!1),A.current=!1}}}const be=V==="rules"?_e.length:V==="destinations"?ie:V==="blocked"?Z.length:de.length,We=V==="rules"?re.length:V==="destinations"?$.length:V==="blocked"?Q.length:X,Se=!!(_||V==="destinations"&&R!=="all"),Fe=()=>{L(""),z("all")};return s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 pt-4 pb-3 sm:px-6",children:[s.jsx("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"Egress inventory",children:[{id:"rules",label:"Rules",count:re.length},{id:"destinations",label:"Destinations",count:$.length},{id:"blocked",label:"Blocked hosts",count:Q.length,dot:"bg-red-500"},{id:"sandboxes",label:"Sandboxes",count:X}].map(pe=>s.jsxs("button",{"aria-pressed":V===pe.id,onClick:()=>{U(pe.id),Fe()},className:Le("rounded-md px-3 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",V===pe.id?"bg-accent/70":"hover:bg-muted/60"),children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[pe.dot&&s.jsx("span",{className:Le("size-1.5 rounded-full",pe.dot)}),pe.label]}),s.jsx("span",{className:"mt-1 block font-mono text-lg leading-none tabular-nums",children:s.jsx(Qd,{value:pe.count})})]},pe.id))}),s.jsx("div",{className:"ml-auto hidden w-64 px-3 lg:block",children:s.jsx(IM,{points:B,height:34,title:"Connections · 15m"})})]}),s.jsxs("div",{className:"flex h-[3px] shrink-0 overflow-hidden bg-border",role:"img","aria-label":`${se} of ${X} sandbox policies enforced`,children:[se>0&&s.jsx("span",{className:"bg-emerald-400/70",style:{width:`${se/X*100}%`}}),X>se&&s.jsx("span",{className:"flex-1 bg-amber-400/70"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-4 py-2 sm:px-6",children:[s.jsx(ra,{ref:q,value:_,onValueChange:L,placeholder:V==="sandboxes"?"Search sandbox…":V==="rules"?"Search rule, destination…":"Search destination, sandbox, rule…","aria-label":"Search egress",className:"mr-auto w-full sm:w-64"}),V==="destinations"&&s.jsx(cn,{"aria-label":"Filter by source",value:R,onChange:pe=>z(pe.target.value),className:"h-8 max-w-44 rounded-md border border-border bg-card px-2 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",children:oe.map(pe=>s.jsx("option",{value:pe.id,children:pe.id==="all"?"All sources":pe.label},pe.id))}),Se&&s.jsxs(ce,{variant:"ghost",size:"sm",onClick:Fe,children:[s.jsx(En,{className:"size-3"}),"Clear"]}),b&&V==="rules"&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"flex items-center gap-1 rounded-md border border-foreground/20 bg-accent py-0.5 pr-0.5 pl-2 text-[12px]",children:["For ",s.jsx("span",{className:"font-mono",children:b}),s.jsx("button",{"aria-label":"Show every rule",onClick:v,className:"rounded p-0.5 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"size-3"})})]}),s.jsxs(ce,{variant:"ghost",size:"sm",onClick:()=>a(b),children:["Rules & history",s.jsx(Mi,{className:"size-3"})]})]}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Refresh egress",onClick:f,children:s.jsx($a,{className:"size-3.5"})}),s.jsxs(ce,{size:"sm",className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",onClick:m,children:[s.jsx(ds,{className:"size-3.5"}),"Add rule"]})]}),V==="rules"&&je.length>0&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-border bg-accent/30 px-6 py-2",children:[s.jsxs("span",{role:"status",className:"mr-auto text-xs",children:[s.jsx("strong",{children:je.length})," selected",je.length>Ae&&s.jsxs("span",{className:"text-muted-foreground",children:[" · ",je.length-Ae," outside current filters"]})]}),s.jsx(ce,{variant:"ghost",size:"sm",disabled:T,onClick:()=>N(new Set),children:"Clear selection"}),s.jsxs(ce,{variant:"destructive",size:"sm",disabled:T,onClick:()=>E([...je]),children:[s.jsx(Gn,{className:"size-3.5"}),T?"Deleting…":"Delete selected"]})]}),J.some(pe=>pe.source==="global")&&s.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-2 border-b border-amber-500/30 bg-amber-50/60 px-6 py-2 text-xs text-amber-800",children:[s.jsx(Va,{className:"size-3.5"}),s.jsx("span",{className:"mr-auto",children:"A global policy overrides every sandbox's network rules."}),s.jsx(ce,{variant:"outline",size:"sm",onClick:l,children:"Review"})]}),k.length>0&&s.jsxs(Li,{id:"egress:delete-errors",tone:"error",title:"Some rules could not be deleted",onDismiss:()=>M([]),dismissLabel:"Dismiss deletion errors",children:[s.jsx("p",{children:"Failed rules remain selected for retry."}),s.jsx("ul",{className:"mt-1 max-h-28 overflow-auto",children:k.map(pe=>s.jsxs("li",{children:[s.jsx("strong",{className:"text-foreground",children:pe.name}),": ",pe.message]},pe.id))})]}),s.jsx("div",{ref:W,tabIndex:0,role:"region","aria-label":"Egress inventory results",className:"min-h-0 flex-1 overflow-auto overscroll-contain outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:be===0&&!(V==="rules"&&!Se&&((ve=(Re=t==null?void 0:t.org)==null?void 0:Re.blocked)!=null&&ve.length))?s.jsxs("div",{className:"py-20 text-center",children:[s.jsx(ER,{className:"mx-auto mb-3 size-6 text-muted-foreground"}),s.jsx("p",{className:"text-sm",children:Se?"No matching results":V==="rules"?b?`No rule applies to ${b} yet`:"No network rules yet":V==="blocked"?"No blocked hosts to review":V==="sandboxes"?"No sandboxes yet":"No open destinations"}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:!Se&&V==="rules"?"Sandboxes are locked down: nothing leaves them until a rule allows it.":!Se&&V==="destinations"?"Destinations appear when a sandbox policy allows access.":!Se&&V==="blocked"?"Blocked connection attempts will appear here.":""}),Se?s.jsx(ce,{variant:"outline",className:"mt-4",onClick:Fe,children:"Clear filters"}):V==="rules"&&s.jsxs(ce,{className:"mt-4 bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",onClick:m,children:[s.jsx(ds,{}),"Add rule"]})]}):s.jsxs("div",{className:"min-w-[960px] bg-card",children:[V==="rules"&&s.jsx(xK,{policies:_e,org:Se?null:t,sandboxes:J,groups:I,assignments:t==null?void 0:t.assignments,setupMembers:t==null?void 0:t.setupMembers,onEdit:h,onEditBlocked:x,onClearBlocked:p,selected:S,onSelect:te,onSelectAll:Ee,onDelete:E,deleting:T}),V==="destinations"&&s.jsxs(s.Fragment,{children:[s.jsxs(sp,{className:f3,children:[s.jsx("span",{children:"Destination"}),s.jsx("span",{children:"Source"}),s.jsx("span",{children:"Access"}),s.jsx("span",{children:"Sandboxes"}),s.jsx("span",{className:"text-right",children:"Requests"}),s.jsx("span",{})]}),s.jsx("ul",{className:"divide-y divide-border/60",children:ne.slice(0,Y).map(pe=>s.jsx(pK,{d:pe,total:X,onOpen:a},pe.host))})]}),V==="blocked"&&s.jsxs(s.Fragment,{children:[s.jsxs(sp,{className:m3,children:[s.jsx("span",{children:"Destination"}),s.jsx("span",{children:"Sandboxes"}),s.jsx("span",{children:"Attempts"}),s.jsx("span",{children:"Program"}),s.jsx("span",{className:"text-right",children:"Actions"})]}),s.jsx("ul",{className:"divide-y divide-border/60",children:Z.slice(0,Y).map(pe=>s.jsx(gK,{b:pe,onDecide:c},pe.host))})]}),V==="sandboxes"&&s.jsxs(s.Fragment,{children:[s.jsxs(sp,{className:iE,children:[s.jsx("span",{children:"Sandbox"}),s.jsx("span",{children:"Rules by source"}),s.jsx("span",{children:"Policy"}),s.jsx("span",{className:"text-right",children:"Blocked"}),s.jsx("span",{})]}),s.jsx("ul",{className:"divide-y divide-border/70",children:de.slice(0,Y).map(pe=>{var Je,mt;const $e=G.get(pe.name)??{counts:{},blocked:0};return s.jsx("li",{children:s.jsxs("button",{onClick:()=>a(pe.name),className:Le("grid min-h-10 w-full items-center gap-4 px-6 py-2 text-left outline-none transition-colors hover:bg-muted/60 focus-visible:bg-muted/60",iE),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[s.jsx("span",{className:Le("size-2 shrink-0 rounded-[3px]",Ba(pe.phase).cell),"aria-hidden":"true"}),s.jsx("span",{className:"truncate font-mono text-xs",children:pe.name})]}),s.jsx("span",{className:"items-center gap-3 flex",children:Hp.filter(ot=>$e.counts[ot]).map(ot=>s.jsxs("span",{className:"flex items-center gap-1.5 text-[12px] tabular-nums",title:Qo[ot].label,children:[s.jsx("span",{className:Le("size-1.5 rounded-full",Qo[ot].swatch)}),$e.counts[ot]]},ot))}),s.jsxs("span",{className:"items-center gap-1.5 text-[12px] flex",children:[s.jsx("span",{className:Le("size-1.5 rounded-full",((Je=Zo[pe.status])==null?void 0:Je.dot)??"bg-stone-200")}),pe.error?"Unavailable":pe.version?`v${pe.version} ${(mt=Zo[pe.status])==null?void 0:mt.label.toLowerCase()}`:"-"]}),s.jsx("span",{className:Le("text-right text-[12px] tabular-nums",$e.blocked?"text-red-600/90":"text-faint"),children:$e.blocked||"-"}),s.jsx(Hr,{className:"size-3.5 text-faint","aria-hidden":"true"})]})},pe.name)})})]}),V!=="rules"&&be>Y&&s.jsxs("button",{onClick:()=>P(pe=>pe+100),className:"w-full border-t border-border py-3 text-xs text-muted-foreground outline-none hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring",children:["Show ",Math.min(100,be-Y)," more"]})]})}),s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border bg-card px-6 py-2 text-[11px] text-muted-foreground",children:[s.jsxs("span",{children:[s.jsx("strong",{className:"font-medium text-foreground",children:be.toLocaleString()}),Se?` of ${We.toLocaleString()}`:""," ",V==="blocked"?"blocked hosts":V]}),s.jsxs("span",{className:"hidden sm:inline",children:[se,"/",X," policies enforced · ⌘K to search"]})]}),s.jsx(Qr,{open:C!==null,onOpenChange:pe=>{!pe&&!A.current&&E(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Delete ",wo((C==null?void 0:C.length)??0,"network rule"),"?"]}),s.jsx(no,{children:"Removes these rules and updates the affected sandboxes. Deleting an allow rule can remove access; deleting a block rule can permit access allowed by other rules. Each sandbox must keep at least one network rule across its groups."})]}),s.jsx("ul",{"aria-label":"Network rules to delete",className:"max-h-48 overflow-auto rounded-md border border-border p-3 text-xs",children:C==null?void 0:C.map(pe=>s.jsx("li",{className:"break-all py-1",children:pe.name},pe.id))}),s.jsxs(eo,{children:[s.jsx(ro,{disabled:T,children:"Cancel"}),s.jsx(so,{variant:"destructive",disabled:T||!(C!=null&&C.length),onClick:Te,children:T?"Deleting…":"Delete rules"})]})]})})]})}function dE({kind:e,onAdd:t}){const[r,a]=g.useState(!1),[l,c]=g.useState("GET"),[u,f]=g.useState("");return r?s.jsxs("form",{className:"flex items-center gap-1.5",onSubmit:async h=>{h.preventDefault(),await t({method:l,path:u})&&(a(!1),f(""))},children:[s.jsx(cn,{value:l,onChange:h=>c(h.target.value),"aria-label":"Method",className:"h-7 rounded-md border border-input bg-card px-1 font-mono text-[11px]",children:fK.map(h=>s.jsx("option",{children:h},h))}),s.jsx(Ot,{value:u,onChange:h=>f(h.target.value),className:"h-7 w-48 bg-card font-mono text-[11px]",placeholder:"/path/**","aria-label":"Path pattern",autoFocus:!0}),s.jsx(ce,{type:"submit",size:"xs",variant:e==="deny"?"destructive":"outline",disabled:!u.startsWith("/"),children:e==="deny"?"Block":"Allow"}),s.jsx(ce,{type:"button",size:"icon-xs",variant:"ghost",onClick:()=>a(!1),"aria-label":"Cancel",children:s.jsx(En,{})})]}):s.jsxs("button",{onClick:()=>a(!0),className:Le("flex items-center gap-1 text-[12px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",e==="deny"?"text-red-600/80 hover:text-red-700":"text-muted-foreground hover:text-foreground"),children:[s.jsx(ds,{className:"size-3"}),e==="deny"?"Block request":"Allow request"]})}function yK(e){const t=[...new Set(e.endpoints.map(r=>Hw[r.access]??r.access))];return t.length===1?t[0]:"Mixed"}function Fw({rule:e,onOp:t,onDelete:r,busy:a,locked:l,managedBy:c,onManage:u}){const[f,h]=g.useState(!1),m=Aa(e.key),x=mK[m],p=e.endpoints.map(v=>v.host),b=e.endpoints.some(v=>v.protocol!=="tcp"&&v.enforcement==="audit"||v.credentialRisk);return s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>h(!f),"aria-expanded":f,className:"flex w-full items-center gap-4 px-5 py-3.5 text-left outline-none transition-colors hover:bg-stone-50/70 focus-visible:bg-stone-50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",children:[s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg border border-border bg-linear-to-b from-card to-stone-100",title:Qo[m].label,children:s.jsx(x,{strokeWidth:1.5,className:"size-3.5 text-stone-600"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"truncate text-[13.5px] font-medium",children:_d(e.key)}),b&&s.jsx(Va,{className:"size-3 shrink-0 text-amber-600","aria-label":"Audit only or uninspected"})]}),s.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5",children:[s.jsx("span",{className:"truncate font-mono text-[11.5px] text-muted-foreground",children:p[0]}),p.length>1&&s.jsxs("span",{className:"shrink-0 text-[11.5px] text-faint",children:["+",p.length-1]})]})]}),s.jsx("span",{className:"hidden shrink-0 sm:block",children:s.jsx(u3,{source:m})}),s.jsx("span",{className:"hidden w-24 shrink-0 text-[12px] text-muted-foreground sm:block",children:yK(e)}),s.jsx("span",{className:"hidden w-28 shrink-0 truncate text-right font-mono text-[11px] text-faint lg:block",children:[...new Set(e.binaries.map(Fp))].join(", ")}),s.jsx(Hr,{className:Le("size-3.5 shrink-0 text-faint transition-transform duration-200",f&&"rotate-90 text-muted-foreground"),"aria-hidden":"true"})]}),s.jsx(Rf,{initial:!1,children:f&&s.jsx(Yn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22,ease:[.2,0,0,1]},className:"overflow-hidden",children:s.jsxs("div",{className:"space-y-4 px-5 pt-1 pb-5 pl-[4.25rem]",children:[m==="agent"&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Included for this agent at launch. Only the destinations and programs listed here are allowed by this rule."}),e.endpoints.map(v=>s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsxs("span",{className:"font-mono text-[12.5px] font-medium",children:[v.host,s.jsx("span",{className:"text-muted-foreground",children:v.ports.length?`:${v.ports.join(",")}`:""}),v.path?` ${v.path}`:""]}),s.jsx(jd,{children:v.protocol}),s.jsx(jd,{children:(Hw[v.access]??v.access).toLowerCase()}),v.protocol!=="tcp"&&v.enforcement==="audit"&&s.jsx(jd,{tone:"border-amber-500/40 bg-amber-50 text-amber-800",title:v.enforcementUnset?"Unset, treated as audit":void 0,children:"audit only"}),v.allowedIps.length>0&&s.jsxs(jd,{title:"Private addresses allowed",children:["ips ",v.allowedIps.join(", ")]}),v.credentialRisk&&s.jsx(jd,{tone:"border-amber-500/40 bg-amber-50 text-amber-800",title:v.tlsSkip?"Encrypted traffic passes through without request inspection":"Credentials are uninspected",children:v.tlsSkip?"TLS passthrough":"uninspected"}),!l&&e.endpoints.length>1&&s.jsx("button",{onClick:()=>t({kind:"removeEndpoint",ruleName:e.key,host:v.host,port:v.port}),disabled:a,className:"ml-auto text-[12px] text-faint outline-none hover:text-destructive focus-visible:ring-2 focus-visible:ring-ring",children:"Remove"})]}),(v.allow.length>0||v.deny.length>0)&&s.jsxs("ul",{className:"space-y-1 border-l border-border pl-3 font-mono text-[11.5px]",children:[v.allow.map((j,S)=>s.jsxs("li",{children:[s.jsx("span",{className:"text-emerald-700",children:"allow"})," ",s.jsxs("span",{className:"text-foreground/75",children:[j.method," ",j.path]})]},`a${S}`)),v.deny.map((j,S)=>s.jsxs("li",{children:[s.jsx("span",{className:"text-red-600",children:"block"})," ",s.jsxs("span",{className:"text-foreground/75",children:[j.method," ",j.path]})]},`d${S}`))]}),!l&&v.protocol!=="tcp"&&s.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1.5",children:[s.jsx(dE,{kind:"allow",onAdd:j=>t({kind:"addAllow",ruleName:e.key,host:v.host,ports:v.ports,binaries:e.binaries,match:j})}),s.jsx(dE,{kind:"deny",onAdd:j=>t({kind:"addDeny",ruleName:e.key,host:v.host,ports:v.ports,binaries:e.binaries,match:j})})]})]},`${v.host}:${v.ports.join(",")}:${v.path??""}`)),s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.binaries.map(v=>s.jsxs("span",{title:v,className:"flex items-center gap-0.5 rounded-md bg-muted py-0.5 pr-1 pl-2 font-mono text-[10.5px] text-foreground/75",children:[Fp(v),!l&&e.binaries.length>1?s.jsx("button",{onClick:()=>t({kind:"removeBinary",ruleName:e.key,binary:v}),disabled:a,"aria-label":`Remove ${v}`,className:"rounded p-0.5 text-muted-foreground outline-none hover:text-destructive focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"size-2.5"})}):s.jsx("span",{className:"w-1"})]},v)),s.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[c&&(u?s.jsxs("button",{onClick:u,className:"text-[12px] text-muted-foreground underline-offset-2 outline-none hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:["Managed in ",c]}):s.jsxs("span",{className:"text-[12px] text-muted-foreground",children:["Managed in ",c]})),!l&&r&&s.jsxs(ce,{variant:"ghost",size:"xs",className:"text-muted-foreground hover:text-destructive",disabled:a,onClick:r,children:[s.jsx(Gn,{}),"Delete"]})]})]})]})})})]})}function vK({revisions:e,onOpen:t}){const r=e.slice(0,10).reverse();return s.jsx("div",{className:"flex items-center gap-1","aria-label":"Revisions",children:r.map((a,l)=>{var c,u;return s.jsx("button",{onClick:()=>t(a.version),title:`v${a.version} · ${(c=Zo[a.status])==null?void 0:c.label} · ${xu(a.createdAt)}`,className:Le("rounded-full outline-none transition-transform hover:scale-125 focus-visible:ring-2 focus-visible:ring-ring",l===r.length-1?"size-2.5":"size-1.5",((u=Zo[a.status])==null?void 0:u.dot)??"bg-stone-200"),"aria-label":`Revision ${a.version}`},a.version)})})}function wK({sandbox:e,version:t,latest:r,onClose:a,onRestore:l}){var h,m,x,p;const c=$t(),[u,f]=g.useState(null);return g.useEffect(()=>{f(null),t!=null&&c.revision(e,t).then(f).catch(b=>f({error:b.message}))},[e,t,c]),s.jsx($l,{open:t!=null,onOpenChange:b=>{b||a()},children:s.jsxs(uu,{className:"w-full! overflow-y-auto sm:max-w-[460px]!",children:[s.jsxs(du,{className:"border-b p-6",children:[s.jsxs(fu,{className:"font-mono text-base",children:[e," · v",t]}),s.jsx(mu,{children:u!=null&&u.revision?`${(h=Zo[u.revision.status])==null?void 0:h.label} · ${Hd(u.revision.createdAt)}`:"Loading…"})]}),s.jsxs("div",{className:"space-y-4 px-6 pb-6",children:[(u==null?void 0:u.error)&&s.jsx("p",{className:"text-sm text-muted-foreground",children:u.error}),((m=u==null?void 0:u.revision)==null?void 0:m.loadError)&&s.jsx("p",{className:"rounded-md border border-red-200 bg-red-50/60 p-2 font-mono text-[11px] text-red-700",children:u.revision.loadError}),((p=(x=u==null?void 0:u.revision)==null?void 0:x.provenance)==null?void 0:p["console.openshell/change"])&&s.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:u.revision.provenance["console.openshell/change"]}),(u==null?void 0:u.policy)&&(u.policy.rules.length?s.jsx(nu,{className:"divide-y divide-border/70 overflow-hidden",children:u.policy.rules.map(b=>s.jsx(Fw,{rule:b,locked:!0,onOp:()=>{}},b.key))}):s.jsx("p",{className:"text-[12px] text-muted-foreground",children:"No rules."})),(u==null?void 0:u.policy)&&t!==r&&s.jsxs(ce,{variant:"outline",size:"sm",onClick:()=>l(t),children:[s.jsx(YI,{}),"Restore"]})]})]})})}function h3({onClick:e}){return s.jsxs("button",{onClick:e,className:"group flex items-center gap-1.5 text-[12.5px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(Hv,{className:"size-3.5 transition-transform group-hover:-translate-x-0.5"}),"All sandboxes"]})}function jK({onBack:e}){var f,h,m;const t=$t(),[r,a]=g.useState(null),[l,c]=g.useState(!1),u=g.useCallback(()=>t.globalPolicy().then(a).catch(x=>a({error:x.message})),[t]);return g.useEffect(()=>{u()},[u]),s.jsxs("div",{className:"space-y-6 px-4 py-5 sm:px-6",children:[s.jsx(h3,{onClick:e}),r?r.error?s.jsx("p",{className:"py-16 text-center text-sm text-muted-foreground",children:r.error}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:r.active?`Global policy · v${(f=r.current)==null?void 0:f.revision.version}`:"No global policy"}),s.jsx("p",{className:"mt-3 text-[13px] text-muted-foreground",children:r.active?"Overrides every sandbox's own rules.":"Each sandbox follows its own rules."}),r.active&&s.jsxs(ce,{variant:"outline",className:"mt-5 rounded-lg border-destructive/30 text-destructive hover:bg-destructive/5",onClick:()=>c(!0),children:[s.jsx(Xv,{}),"Remove"]})]}),((m=(h=r.current)==null?void 0:h.policy)==null?void 0:m.rules.length)>0&&s.jsx(nu,{className:"divide-y divide-border/70 overflow-hidden",children:r.current.policy.rules.map(x=>s.jsx(Fw,{rule:x,locked:!0,onOp:()=>{}},x.key))}),r.revisions.length>0&&s.jsx(_v,{title:"History",children:s.jsx(nu,{className:"divide-y divide-border/60",children:r.revisions.map(x=>{var p,b;return s.jsxs("div",{className:"flex h-11 items-center gap-3 px-5 text-[12.5px]",children:[s.jsx("span",{className:Le("size-1.5 rounded-full",(p=Zo[x.status])==null?void 0:p.dot),"aria-hidden":"true"}),s.jsxs("span",{className:"font-mono",children:["v",x.version]}),s.jsx("span",{className:"text-muted-foreground",children:(b=Zo[x.status])==null?void 0:b.label}),s.jsx("span",{className:"ml-auto text-muted-foreground",children:xu(x.createdAt)})]},x.version)})})})]}):s.jsx("p",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}),s.jsx(Qr,{open:l,onOpenChange:c,children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsx(to,{children:"Remove the global policy?"}),s.jsx(no,{children:"Every sandbox reverts to its own rules."})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsx(so,{variant:"destructive",onClick:async()=>{try{await t.removeGlobal(),He.success("Global policy removed"),u()}catch(x){He.error(x.message)}finally{c(!1)}},children:"Remove"})]})]})})]})}const fE=[{id:"all",label:"All"},...Hp.map(e=>({id:e,label:Qo[e].label}))];function SK({name:e,sandbox:t,events:r,onBack:a,onNavigate:l,onDraft:c,onEditPolicy:u,onEditBlocked:f,onOpenGlobal:h,reloadSignal:m}){var H,F,q,W,B,J;const x=$t(),p=Cn(),[b,v]=g.useState(null),[j,S]=g.useState(!1),[N,C]=g.useState(null),[E,T]=g.useState(null),[O,k]=g.useState("all"),M=g.useCallback(async()=>{try{const X=await x.policy(e);return v(X),X}catch(X){v({error:X.message})}},[e,x]);g.useEffect(()=>{v(null),M()},[M]),g.useEffect(()=>{m&&M()},[m]);async function A(X){var re;for(let I=0;I<20;I++){const $=await M(),Q=(re=$==null?void 0:$.revisions)==null?void 0:re.find(G=>G.version===X);if((Q==null?void 0:Q.status)==="loaded"){He.success(`Policy v${X} is enforced in ${e}`);return}if((Q==null?void 0:Q.status)==="failed"){He.error(`v${X} failed to load: ${Q.loadError??"unknown error"}`);return}await new Promise(G=>setTimeout(G,1500))}He.warning(`v${X} saved; not yet loaded by ${e}`)}async function R(X){S(!0);try{const re=await x.applyOps(e,X);return He(`Saved as v${re.version}`),A(re.version),!0}catch(re){return He.error(re.message),!1}finally{S(!1)}}async function z(X){S(!0);try{const re=await x.restore(e,X);He(`Restored v${X} as v${re.version}`),T(null),A(re.version)}catch(re){He.error(re.message)}finally{S(!1)}}const _=((H=b==null?void 0:b.effective)==null?void 0:H.rules)??[],L=new Set(_.flatMap(X=>X.endpoints.filter(re=>!re.blocked).map(re=>re.host))),Y=g.useMemo(()=>{const X=new Map;for(const re of r){if(re.sandbox!==e||re.verdict!=="denied")continue;const I=$w(re.destination);if(!I||o3(I)||L.has(I))continue;const $=X.get(I)??{host:I,port:r3(re.destination),count:0,binary:null,lastAt:null};$.count+=1,!$.binary&&re.binary&&($.binary=re.binary),re.at&&(!$.lastAt||re.at>$.lastAt)&&($.lastAt=re.at),X.set(I,$)}return[...X.values()].sort((re,I)=>I.count-re.count)},[r,e,b]),P=(b==null?void 0:b.source)==="global",V=Object.fromEntries(fE.map(X=>[X.id,_.filter(re=>X.id==="all"||Aa(re.key)===X.id).length])),U=_.filter(X=>O==="all"||Aa(X.key)===O);return s.jsxs("div",{className:"space-y-6 px-4 py-5 sm:px-6",children:[s.jsxs("div",{className:"space-y-5",children:[s.jsx(h3,{onClick:a}),b?b.error?s.jsx("p",{role:"alert",className:"py-16 text-center text-sm text-muted-foreground",children:b.error}):s.jsxs("header",{className:"flex flex-wrap items-end gap-x-6 gap-y-4",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:[s.jsx("span",{className:Le("size-2 rounded-[3px]",Ba(t==null?void 0:t.phase).cell)}),"Sandbox"]}),s.jsx("h2",{className:"mt-2 truncate text-xl font-semibold tracking-tight",children:e}),s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[b.latest&&s.jsxs("span",{className:Le("flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[12px]",(F=Zo[b.latest.status])==null?void 0:F.cls),children:[s.jsxs("span",{className:"relative flex size-1.5",children:[b.latest.status==="loaded"&&s.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-60"}),s.jsx("span",{className:Le("relative inline-flex size-1.5 rounded-full",(q=Zo[b.latest.status])==null?void 0:q.dot)})]}),"v",b.latest.version," ",(W=Zo[b.latest.status])==null?void 0:W.label.toLowerCase()]}),s.jsx(vK,{revisions:b.revisions,onOpen:T}),s.jsxs("span",{className:"text-[12.5px] text-muted-foreground tabular-nums",children:[wo(L.size,"destination")," open"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ce,{variant:"outline",className:"rounded-lg",onClick:()=>{try{sessionStorage.setItem("gateway-box",p?JSON.stringify({name:e,location:p}):e)}catch{}l("sandboxes")},children:[s.jsx(Jp,{}),"View sandbox"]}),s.jsxs(ce,{className:"rounded-lg bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",disabled:j||P,onClick:()=>c(null,A),children:[s.jsx(ds,{}),"Add rule"]})]})]}):s.jsx("p",{role:"status",className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]}),b&&!b.error&&s.jsxs(s.Fragment,{children:[P&&s.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-amber-500/30 bg-amber-50/60 px-4 py-2 text-[12.5px] text-amber-800",children:[s.jsx(Va,{className:"size-3.5"}),s.jsx("span",{className:"mr-auto",children:"Global policy in force · editing disabled"}),s.jsx(ce,{variant:"outline",size:"sm",onClick:h,children:"Review"})]}),b.configurationError&&s.jsx("p",{className:"rounded-xl border border-red-200 bg-red-50/60 px-4 py-3 font-mono text-[11.5px] text-red-700",children:b.configurationError}),Y.length>0&&!P&&s.jsx(_v,{title:"Blocked recently",count:Y.length,children:s.jsx(nu,{className:"divide-y divide-border/70 overflow-hidden",children:Y.slice(0,6).map(X=>s.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",children:[s.jsx(Vw,{host:X.host,tone:"denied",className:"size-7 text-[15px]"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"block truncate font-mono text-[12.5px]",children:[X.host,s.jsxs("span",{className:"text-muted-foreground",children:[":",X.port]})]}),s.jsxs("span",{className:"block text-[11.5px] text-muted-foreground",children:[X.binary?Fp(X.binary):"Unknown program",X.lastAt?` · ${xu(X.lastAt)}`:""]})]}),s.jsxs("span",{className:"text-[12px] tabular-nums text-red-600/90",children:[X.count,"×"]}),s.jsx(ce,{variant:"outline",size:"sm",className:"h-7 rounded-lg text-[12px]",onClick:()=>c({name:c3(X.host),binaries:X.binary?[X.binary]:[],endpoints:[{host:X.host,ports:[X.port],protocol:X.port===443||X.port===80?"rest":"tcp",access:"read-only",enforcement:"enforce"}]},A),children:"Allow"})]},X.host))})}),s.jsx(_v,{title:"Rules",count:_.length,actions:s.jsx(hK,{label:"Filter rules",options:fE.filter(X=>X.id==="all"||V[X.id]>0).map(X=>({...X,count:V[X.id]})),value:O,onChange:k}),children:U.length===0?s.jsx(nu,{className:"flex flex-col items-center border-dashed py-12 shadow-none",children:s.jsx("p",{className:"text-[13px] text-muted-foreground",children:"No rules yet"})}):s.jsx(nu,{className:"divide-y divide-border/70 overflow-hidden",children:U.map(X=>{const re=Aa(X.key);return s.jsx(Fw,{rule:X,busy:j,locked:!["own","agent"].includes(re)||P,onOp:I=>R([I]),onDelete:["own","agent"].includes(re)?()=>C(X.key):null,managedBy:re==="secret"?"Secrets":re==="policy"?"Network rules":re==="org"?"Blocked everywhere":re==="group"?"Groups":null,onManage:re==="secret"?()=>l("secrets"):re==="policy"?()=>u(X.key.replace(/^egress_/,"")):re==="org"?f:re==="group"?()=>l("groups"):void 0},X.key)})})})]}),s.jsx(Qr,{open:!!N,onOpenChange:X=>{X||C(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Delete rule ",N,"?"]}),s.jsxs(no,{children:[e," loses access immediately. Restorable from revisions."]})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsx(so,{variant:"destructive",onClick:async()=>{await R([{kind:"removeRule",ruleName:N}]),C(null)},children:"Delete rule"})]})]})}),s.jsx(wK,{sandbox:e,version:E,latest:(J=(B=b==null?void 0:b.revisions)==null?void 0:B[0])==null?void 0:J.version,onClose:()=>T(null),onRestore:z})]})}function NK(e){const t=e.port===443||e.port===80;return{name:c3(e.host),binaries:[...e.programs],endpoints:[{host:e.host,ports:[e.port],protocol:t?"rest":"tcp",...t?{access:"read-only"}:{},enforcement:"enforce"}]}}const mE="egress-allow",hE="egress-sandbox",Vl="egress-policy",pE=()=>{try{const e=JSON.parse(sessionStorage.getItem(Vl)??"null");return sessionStorage.removeItem(Vl),e}catch{return null}};function CK(e){const t=Cn();return s.jsx(kK,{...e},(t==null?void 0:t.id)??(t==null?void 0:t.context)??"default")}function kK({onNavigate:e}){var se,ee,ne,ie,oe;const t=$t(),r=Cn(),a=Z=>e(Z,r),l=qa(),[c,u]=g.useState(null),[f,h]=g.useState(!1),[m,x]=g.useState(()=>{try{const Z=sessionStorage.getItem(hE);return sessionStorage.removeItem(hE),Z}catch{return null}}),[p,b]=g.useState(null),[v,j]=g.useState(null),[S,N]=g.useState(null),[C,E]=g.useState(null),[T,O]=g.useState(!1),[k,M]=g.useState(!1),[A,R]=g.useState(!1),[z,_]=g.useState(null),[L,Y]=g.useState(0),P=g.useRef(null),V=g.useCallback(async()=>{try{b(await t.fleetPolicy())}catch(Z){b({error:Z.message,sandboxes:[]})}try{j(await t.org())}catch{j(null)}},[t]);g.useEffect(()=>{V()},[V]);const[U,H]=g.useState(pE);g.useEffect(()=>{const Z=()=>{const de=pE();de&&(H(de),V())};return window.addEventListener(Vl,Z),()=>window.removeEventListener(Vl,Z)},[V]),g.useEffect(()=>{U!=null&&U.new&&E({initial:Id({appliesTo:{everyone:!1,groups:[],sandboxes:[],...U.new.appliesTo}})})},[U]);const F=g.useRef(null);g.useEffect(()=>{if(!(U!=null&&U.edit)||!v||F.current===U)return;const Z=v.policies.find(de=>de.id===U.edit);Z&&(F.current=U,E({initial:Z}))},[U,v]),g.useEffect(()=>{let Z=null;try{Z=JSON.parse(sessionStorage.getItem(mE)??"null"),sessionStorage.removeItem(mE)}catch{}!(Z!=null&&Z.sandbox)||!(Z!=null&&Z.host)||(u(Z.sandbox),N({sandbox:Z.sandbox,initial:NK({host:Z.host,port:Number(Z.port)||443,programs:new Set(Z.binary?[Z.binary]:[])}),after:()=>Y(de=>de+1)}))},[]);const q=g.useMemo(()=>{const Z=new Set;for(const de of l.events)de.binary&&Z.add(de.binary);return[...Z].sort()},[l.events]),W=Z=>{var de;u(Z),(de=P.current)==null||de.scrollTo({top:0})},B=()=>{var Z;h(!0),(Z=P.current)==null||Z.scrollTo({top:0})},J=()=>{var Z;u(null),h(!1),V(),(Z=P.current)==null||Z.scrollTo({top:0})};function X(Z,de){const _e={everyone:!1,groups:Z==="allow-one"?No(v,[...de.sandboxes][0]):[],sandboxes:[]};if(Z.startsWith("allow")){E({initial:Id({name:de.host,destinations:[de.host],appliesTo:_e})});return}_({kind:Z,b:de})}function re(Z){const de=((v==null?void 0:v.policies)??[]).find(ke=>ke.id===Z);de&&E({initial:de})}function I(Z,de){var _e,je;const ke=((_e=Z.applied)==null?void 0:_e.length)??0;(je=Z.failed)!=null&&je.length?He.warning(`${de}. ${wo(Z.failed.length,"sandbox","sandboxes")} could not be updated`,{description:Z.failed.map(Ae=>`${Ae.sandbox}: ${Ae.error}`).join(`
|
|
519
|
+
`)}):He.success(de,{description:ke?`Updated ${wo(ke,"sandbox","sandboxes")}.`:void 0}),V(),Y(Ae=>Ae+1)}async function $(){R(!0);try{const Z=v??await t.org();I(await t.saveOrg({...Z.org,blocked:[]}),"Cleared blocked hosts"),M(!1)}catch(Z){He.error(Z.message)}finally{R(!1)}}async function Q(){const{b:Z}=z;try{const de=v??await t.org();I(await t.saveOrg({...de.org,blocked:[...de.org.blocked,Z.host]}),`${Z.host} blocked everywhere`),_(null)}catch(de){He.error(de.message)}}const G=((se=p==null?void 0:p.sandboxes)==null?void 0:se.length)??0;return s.jsxs("div",{ref:P,className:"h-full overflow-y-auto",children:[f?s.jsx(jK,{onBack:J}):c?s.jsx(SK,{name:c,sandbox:((ee=p==null?void 0:p.sandboxes)==null?void 0:ee.find(Z=>Z.name===c))??((ne=l.sandboxes)==null?void 0:ne.find(Z=>Z.name===c)),events:l.events,onBack:J,onNavigate:a,onOpenGlobal:B,reloadSignal:L,onDraft:(Z,de)=>N({sandbox:c,initial:Z,after:de}),onEditPolicy:re,onEditBlocked:()=>O(!0)},c):p?p.error?s.jsx("p",{role:"alert",className:"py-24 text-center text-sm text-muted-foreground",children:p.error}):s.jsx(bK,{fleet:p,org:v,events:l.events,onOpen:W,onOpenGlobal:B,onDecide:X,onNavigate:a,onRefresh:V,onEditPolicy:Z=>E({initial:Z}),onEditBlocked:()=>O(!0),onClearBlocked:()=>M(!0),onAddPolicy:()=>E({initial:Id(m?{appliesTo:{everyone:!1,groups:No(v,m),sandboxes:[]}}:{})}),forSandbox:m,onClearSandbox:()=>x(null)}):s.jsx("p",{role:"status",className:"py-24 text-center text-sm text-muted-foreground",children:"Loading…"}),s.jsx(WM,{open:!!C,onOpenChange:Z=>{Z||E(null)},initial:C==null?void 0:C.initial,groups:(v==null?void 0:v.groups)??[],sandboxes:((p==null?void 0:p.sandboxes)??l.sandboxes??[]).map(Z=>Z.name),assignments:(v==null?void 0:v.assignments)??{},setupMembers:(v==null?void 0:v.setupMembers)??{},knownPrograms:q,onGroupCreated:()=>t.org().then(j).catch(()=>{}),onSaved:(Z,de)=>I(Z,`${Z.deleted?"Deleted":"Saved"} ${de.name}`)}),s.jsx(Qr,{open:k,onOpenChange:Z=>{!Z&&!A&&M(!1)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Unblock ",wo(((oe=(ie=v==null?void 0:v.org)==null?void 0:ie.blocked)==null?void 0:oe.length)??0,"host")," everywhere?"]}),s.jsx(no,{children:"Removes the shared blocked list and updates every sandbox. These hosts can then be reached if another rule allows them."})]}),s.jsxs(eo,{children:[s.jsx(ro,{disabled:A,children:"Cancel"}),s.jsx(so,{variant:"destructive",disabled:A,onClick:$,children:A?"Removing…":"Unblock all"})]})]})}),s.jsx(IY,{open:T,onOpenChange:O,org:v==null?void 0:v.org,onSaved:Z=>I(Z,"Saved blocked hosts")}),s.jsx(EY,{open:!!S,onOpenChange:Z=>{Z||N(null)},initial:S==null?void 0:S.initial,knownPrograms:q,onSubmit:async Z=>{var ke;const de=await t.applyOps(S.sandbox,[{kind:"addRule",rule:Z}]);He(`Saved as v${de.version}`),Y(_e=>_e+1),(ke=S.after)==null||ke.call(S,de.version)}}),s.jsx(Qr,{open:!!z,onOpenChange:Z=>{Z||_(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Block ",z==null?void 0:z.b.host," everywhere?"]}),s.jsxs(no,{children:["Adds it, with its subdomains, to the hosts blocked in every sandbox. No rule can open it. Applies to ",wo(G,"sandbox","sandboxes"),"."]})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsx(so,{variant:"destructive",onClick:Q,children:"Block everywhere"})]})]})})]})}const TK=e=>e!=null&&e.egressPolicy?` ${e.egressPolicy.created?"Created":"Updated"} the egress policy “${e.egressPolicy.name}”.`:e!=null&&e.egressPolicyError?" Its egress policy wasn’t saved.":"";function EK(e,t=Pq){let r=[];const a=new Set,l=new Map,c=(u,f)=>{r=r.map(h=>h.id===u?{...h,...f}:h),a.forEach(h=>h())};return{subscribe:u=>(a.add(u),()=>a.delete(u)),getSnapshot:()=>r,updateReview(u,f,h){if(l.has(u))throw new Error("Wait for the import to finish before removing items.");c(u,{review:f,prepared:h,preparation:null,status:"needs-attention",message:f.items.length?"Import selection updated. Review it to finish importing.":"No items remain in this import."})},dismiss(u){r=r.filter(f=>f.id!==u),a.forEach(f=>f())},async cancel(u){var m;const f=l.get(u);if(!f)return;f.cancelled=!0;const h=r.find(x=>x.id===u);((m=h==null?void 0:h.preparation)==null?void 0:m.status)==="running"&&await f.api.cancelSetupPreparation(h.preparation.id)},start({id:u=crypto.randomUUID(),review:f,name:h,choices:m={},resumeJob:x,saveOnly:p=!1,api:b=e,location:v=null},j={}){if(l.has(u))return{id:u,promise:l.get(u).promise};const S={cancelled:!1,api:b};return l.set(u,S),r=[...r.filter(N=>N.id!==u),{id:u,name:h,review:f,location:v,prepared:p,status:"importing",message:p?"Saving your setup…":"Preparing your tools…"}],a.forEach(N=>N()),S.promise=(async()=>{var N;try{const C=p?{status:"saved",setup:await b.saveSetup(f.token,h,!0),inactive:f.items.filter(E=>{var T;return!E.disabled&&((T=E.issues)==null?void 0:T.length)}).map(E=>E.name)}:await t(b,f,h,m,{resumeJob:x,isCancelled:()=>S.cancelled,onProgress:E=>{var T;c(u,{preparation:E,message:E.message}),(T=j.onProgress)==null||T.call(j,E)},onReview:E=>{var T;c(u,{review:E,prepared:!0}),(T=j.onReview)==null||T.call(j,E)}});return c(u,{status:C.status,setup:C.setup,...C.status==="cancelled"?{prepared:!1}:{},message:C.status==="saved"?`Available in templates and sandboxes.${(N=C.inactive)!=null&&N.length?` Inactive: ${C.inactive.join(", ")}.`:""}${TK(C.setup)}`:C.status==="needs-attention"?"Some items need attention. Open the import to remove or fix them.":"Import cancelled. You can resume from the completed preparation."}),C}catch(C){throw c(u,{status:"failed",message:C.message}),C}finally{l.delete(u)}})(),{id:u,promise:S.promise}}}}const Ai=EK(cs),RK=(e,t)=>(e??[]).filter(r=>{var a;return r.action==="allow"&&(((a=r.appliesTo)==null?void 0:a.setups)??[]).some(l=>{var c;return l===t.id||l===((c=t.preparedFrom)==null?void 0:c.id)})}),AK=(e={})=>{var t,r,a;return!((t=e.programs)!=null&&t.length)&&(e.requests??"any")==="any"&&!((r=e.deny)!=null&&r.length)&&!((a=e.privateIps)!=null&&a.length)},OK=(e,t,r)=>RK(e,t).some(a=>{var l;return AK(a.advanced)&&(((l=a.advanced)==null?void 0:l.ports)??[443,80]).map(Number).includes(Number(r.port??443))&&a.destinations.some(c=>EM(c,r.host))}),p3=e=>{var t;return!!(e.credentialRef||(t=e.credentialFields)!=null&&t.length)},MK=(e,t)=>String(e??"").toLowerCase()===String(t??"").toLowerCase(),gE=(e,t)=>!p3(e)&&(t.phase==="runtime"||t.phase==="auth"&&(e.requirements??[]).some(r=>r.phase==="runtime"&&MK(r.host,t.host))),Lv=e=>`${e.host}${Number(e.port??443)===443?"":`:${e.port}`}`,DK=e=>`${Lv(e)}${e.path||""}`;function zK(e,t,r,a=l=>l.requirements??[]){const l=new Set,c=new Map;for(const f of e)for(const h of r(f))for(const m of a(h).filter(x=>["runtime","auth"].includes(x.phase)))t&&!(m.phase==="runtime"&&p3(h))&&OK(t,f,m)?l.add(Lv(m)):c.set(DK(m),Lv(m));const u=new Set(c.values());return{covered:[...l].filter(f=>!u.has(f)),uncovered:[...c.keys()]}}function PK(e){const t=(e==null?void 0:e.hosts)??[],r=a=>[...new Set(t.filter(l=>l.host===a).flatMap(l=>l.items??[]))];return[...new Set((e==null?void 0:e.destinations)??t.map(a=>a.host))].filter(a=>{var l;return!((l=e==null?void 0:e.blocked)!=null&&l.includes(a))}).map(a=>({host:a,items:r(a)}))}const Gw=[{id:"codex",name:"Codex",logo:"codex"},{id:"claude",name:"Claude Code",logo:"claudecode"},{id:"cursor",name:"Cursor",logo:"cursor"}],qp=(e,t)=>e.items.filter(r=>r.kind===t).length,ka=e=>e.issues.filter(t=>!zw(t)),IK=e=>e.items.filter(t=>!t.disabled&&!ka(t).length).length,Yp=e=>e.items.filter(t=>ka(t).length).length,xE=e=>e.sources.map(t=>{var r;return((r=Gw.find(a=>a.id===t))==null?void 0:r.name)||t}).join(", "),_K=e=>`${e.host}${e.port&&Number(e.port)!==443?`:${e.port}`:""}${e.path||""}`,LK={build:"Downloads from",runtime:"Connects to",auth:"Sign-in"},bE={connected:"Connected","needs-sign-in":"Needs sign-in","needs-credentials":"Needs credentials",unverified:"Couldn’t check"},BK={prepared:"Ready","sign-in-in-sandbox":"Sign in after install","needs-attention":"Needs attention",disabled:"Inactive"},yE=e=>{var t,r,a;return e.disabled?"Inactive":Pw(e)?"Can’t run in a sandbox":ka(e).length?"Needs attention":e.issues.length?"Installs on import":e.kind==="skill"?`${((t=e.files)==null?void 0:t.length)??0} files`:((r=e.auth)==null?void 0:r.mode)==="agent-session"?"Sign in after install":((a=e.verification)==null?void 0:a.status)==="connected"?"Connected":e.artifact?"Package ready":"Not checked yet"},$K=e=>/^(?=.{1,253}$)[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?\.[a-z]{2,63}$/i.test(e)&&!e.includes("..")&&!e.includes("*")&&!e.endsWith(".local"),g3=(e=[])=>e.some(t=>!$K(t))?"Enter domain names like api.github.com (no wildcards, IP addresses or local names).":e.length>20?"Add up to 20 websites.":"",x3=e=>{var t;return((t=e.credentialFields)==null?void 0:t.length)>0&&!e.requirements.some(r=>r.phase==="runtime")},b3=(e,t)=>{var r;return x3(e)&&MM(t)&&!((r=t==null?void 0:t.hosts)!=null&&r.length)},rp=e=>(e==null?void 0:e.egressPolicy)??(e!=null&&e.egressPolicyError?{error:e.egressPolicyError}:null),VK=e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`;function Jd({children:e}){return e?s.jsx("p",{role:"alert",className:"rounded-lg border border-destructive/20 bg-destructive/5 p-3 text-xs text-destructive",children:e}):null}function y3({children:e}){return s.jsxs("div",{className:"flex gap-2 rounded-lg border bg-muted/30 p-3 text-xs leading-relaxed text-muted-foreground",children:[s.jsx(Gl,{className:"mt-0.5 size-3.5 shrink-0"}),s.jsx("span",{children:e})]})}const vE=[{kind:"mcp",label:"MCPs",icon:Kv},{kind:"skill",label:"Skills",icon:Gv}];function v3({items:e,children:t}){return s.jsxs(jf,{defaultValue:e.some(r=>r.kind==="mcp")?"mcp":"skill",className:"min-w-0 gap-3",children:[s.jsx(Sf,{"aria-label":"Setup item categories",className:"w-full",children:vE.map(({kind:r,label:a,icon:l})=>s.jsxs(jr,{value:r,className:"gap-2 text-xs",children:[s.jsx(l,{className:"size-3.5"}),a,s.jsx("span",{className:"rounded bg-foreground/5 px-1.5 text-[10px] tabular-nums text-muted-foreground",children:e.filter(c=>c.kind===r).length})]},r))}),vE.map(({kind:r,label:a,icon:l})=>s.jsx(yo,{value:r,keepMounted:!0,className:"min-w-0",children:s.jsx(So,{duration:.16,offset:2,blur:"0px",children:e.some(c=>c.kind===r)?t(e.filter(c=>c.kind===r)):s.jsxs("div",{className:"rounded-lg border border-dashed px-4 py-8 text-center",children:[s.jsx(l,{className:"mx-auto mb-2 size-5 text-muted-foreground",strokeWidth:1.5}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",a," in this setup."]})]})})},r))]})}function w3(e){const t=Cn();return s.jsx(UK,{...e},(t==null?void 0:t.id)??(t==null?void 0:t.context)??"default")}function UK({sandbox:e=null,setupIds:t=[]}){const r=$t(),a=Cn(),[l,c]=g.useState(null),[u,f]=g.useState(""),[h,m]=g.useState(!1),[x,p]=g.useState(null),[b,v]=g.useState(null),[j,S]=g.useState(!1),[N,C]=g.useState(""),[E,T]=g.useState(""),[O,k]=g.useState("all"),[M,A]=g.useState(!1),[R,z]=g.useState(!1),[_,L]=g.useState(null),Y=g.useCallback(async()=>{z(!0);try{c(await r.setups()),f("")}catch(F){f(F.message)}finally{z(!1)}},[r]),V=g.useSyncExternalStore(Ai.subscribe,Ai.getSnapshot).filter(F=>{var q;return F.status==="saved"&&((q=F.location)==null?void 0:q.context)===(a==null?void 0:a.context)}).map(F=>F.id).join(",");g.useEffect(()=>{Y()},[Y,V]);const U=g.useMemo(()=>(l||[]).filter(F=>{const q=[F.name,...F.items.flatMap(W=>[W.name,...W.sources||[]])].join(" ").toLowerCase().includes(E.trim().toLowerCase());return(!e||t.includes(F.id))&&q&&(O==="all"||(O==="review"?Yp(F)>0:Yp(F)===0))}).sort((F,q)=>F.name.localeCompare(q.name,void 0,{numeric:!0})*(M?-1:1)),[l,E,O,M,e,t]),H=!!(E||O!=="all");return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b px-4 py-3 sm:px-6",children:[s.jsx(ra,{"aria-label":"Search setups",placeholder:"Search…",value:E,onValueChange:T,className:"mr-auto min-w-32 flex-1 sm:max-w-60"}),s.jsxs(cn,{"aria-label":"Filter setups by status",value:O,onChange:F=>k(F.target.value),className:"h-8 w-36 bg-card text-xs",children:[s.jsx("option",{value:"all",children:"All statuses"}),s.jsx("option",{value:"imported",children:"Imported"}),s.jsx("option",{value:"review",children:"Needs review"})]}),H&&s.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>{T(""),k("all")},children:"Clear"}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Refresh setups",disabled:R,onClick:Y,children:R?s.jsx(zt,{className:"size-3.5"}):s.jsx($a,{className:"size-3.5"})}),s.jsxs(ce,{size:"sm",className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",onClick:()=>m(!0),children:[s.jsx(ds,{}),"Bring my setup"]})]}),u&&s.jsxs("div",{className:"space-y-2 border-b px-4 py-3 sm:px-6",children:[s.jsx(Jd,{children:u}),s.jsx(ce,{variant:"outline",size:"sm",disabled:R,onClick:Y,children:"Try again"})]}),s.jsx("div",{className:"flex-1",children:!l&&!u?s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 py-12 text-xs text-muted-foreground",children:[s.jsx(zt,{}),"Loading setups…"]}):l&&!U.length?s.jsxs("div",{className:"px-4 py-16 text-center",children:[s.jsx(pI,{className:"mx-auto mb-3 size-6 text-muted-foreground",strokeWidth:1.5}),s.jsx("p",{className:"text-sm font-medium",children:e&&!H?"No setups in this sandbox":l.length?"No matching setups":"No setups yet"}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:e&&!H?"Choose a setup from MCPs & Skills to enable it here.":l.length?"Try another name, tool, source agent, or status.":"Import MCPs and Skills from Codex, Claude Code, or Cursor."}),(!e||H)&&s.jsx(ce,{variant:"outline",size:"sm",className:"mt-4",onClick:()=>l.length?(T(""),k("all")):m(!0),children:l.length?"Clear filters":"Bring my setup"})]}):l&&s.jsx(So,{duration:.15,offset:0,blur:"0px",children:s.jsxs(N8,{"aria-label":"MCPs & Skills",className:"min-w-[740px] text-xs",children:[s.jsx(C8,{children:s.jsxs(PC,{className:"hover:bg-transparent",children:[s.jsx(z0,{scope:"col","aria-sort":M?"descending":"ascending",className:"h-9 px-4 text-[11px] font-normal text-muted-foreground sm:pl-6",children:s.jsxs("button",{className:"flex items-center gap-1.5 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>A(F=>!F),children:["Name",M?s.jsx(nf,{className:"size-3"}):s.jsx(sf,{className:"size-3"})]})}),["Source agents","MCPs","Skills","Created"].map(F=>s.jsx(z0,{scope:"col",className:"h-9 px-4 text-[11px] font-normal text-muted-foreground",children:F},F)),s.jsx(z0,{className:"w-12",children:s.jsx("span",{className:"sr-only",children:"Actions"})})]})}),s.jsx(k8,{children:U.map(F=>{const q=Gw.filter(W=>F.items.some(B=>{var J;return(J=B.sources)==null?void 0:J.includes(W.id)}));return s.jsxs(PC,{className:"cursor-pointer hover:bg-muted/40",onClick:()=>p(F),children:[s.jsx(Lc,{className:"max-w-72 px-4 py-2 sm:pl-6",children:s.jsxs("button",{"aria-label":`Open setup ${F.name}`,onClick:W=>{W.stopPropagation(),p(F)},className:"group flex max-w-full items-center gap-2 rounded text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg border bg-muted/40 text-muted-foreground",children:s.jsx(Yv,{className:"size-3.5",strokeWidth:1.5})}),s.jsx("span",{className:"truncate font-mono text-xs font-medium group-hover:underline",children:F.name})]})}),s.jsx(Lc,{className:"px-4 py-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[q.map(W=>s.jsx("img",{src:`/logos/agents/${W.logo}.svg`,alt:W.name,title:W.name,className:"size-4 object-contain"},W.id)),!q.length&&s.jsx("span",{className:"text-muted-foreground",children:"Not reported"})]})}),s.jsx(Lc,{className:"px-4 py-2 tabular-nums",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx(Kv,{"aria-hidden":"true",className:"size-3.5 text-muted-foreground",strokeWidth:1.5}),qp(F,"mcp")]})}),s.jsx(Lc,{className:"px-4 py-2 tabular-nums",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx(Gv,{"aria-hidden":"true",className:"size-3.5 text-muted-foreground",strokeWidth:1.5}),qp(F,"skill")]})}),s.jsx(Lc,{className:"px-4 py-2 text-[11px] text-muted-foreground",children:F.createdAt?Hd(F.createdAt):"Not reported"}),s.jsx(Lc,{className:"px-4 py-2 text-right sm:pr-6",children:s.jsx(ce,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive","aria-label":`Delete setup ${F.name}`,onClick:W=>{W.stopPropagation(),C(""),v(F)},children:s.jsx(Gn,{className:"size-3.5"})})})]},F.id)})})]})})}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t bg-card px-4 py-2 text-[11px] text-muted-foreground sm:px-6",children:[s.jsxs("span",{children:[s.jsx("strong",{className:"font-medium text-foreground",children:U.length}),H?` of ${(l==null?void 0:l.length)||0}`:""," ",(l==null?void 0:l.length)===1?"setup":"setups"]}),s.jsx("span",{children:"Saved locally · Available in templates and sandboxes"})]}),b&&s.jsx(vn,{open:!0,onOpenChange:F=>{!F&&!j&&v(null)},children:s.jsxs(wn,{className:"sm:max-w-md",children:[s.jsxs(jn,{children:[s.jsxs(bn,{children:["Delete “",b.name,"”?"]}),s.jsx(_n,{children:"This deletes the setup and its egress policy. MCPs already installed in sandboxes stay, but lose access to the websites that policy allowed. Templates that use this setup need another setup before reuse."})]}),s.jsx(Jd,{children:N}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ce,{variant:"ghost",disabled:j,onClick:()=>v(null),children:"Cancel"}),s.jsxs(ce,{variant:"destructive",disabled:j,onClick:async()=>{S(!0),C("");try{await r.deleteSetup(b.id,b.revision),c(F=>F.filter(q=>q.id!==b.id)),p(F=>(F==null?void 0:F.id)===b.id?null:F),v(null)}catch(F){C(F.message)}finally{S(!1)}},children:[j&&s.jsx(zt,{}),"Delete setup"]})]})]})}),h&&s.jsx(S3,{initialReview:h.review,initialName:h.name,onClose:()=>m(!1),onSaved:F=>{m(!1),Y(),L(rp(F))}}),_&&s.jsx(j3,{policy:_,onClose:()=>L(null)}),x&&s.jsx(YK,{setup:x,sandbox:e,onPrepare:async()=>{try{const F=await r.prepareSavedSetup(x.id);m({review:F,name:x.name+" (updated)"}),p(null)}catch(F){f(F.message)}},onUpdated:F=>{p(F),c(q=>q.map(W=>W.id===F.id?F:W))},onClose:()=>p(null)})]})}function HK(){const e=g.useSyncExternalStore(Ai.subscribe,Ai.getSnapshot),[t,r]=g.useState(null),[a,l]=g.useState(null);return s.jsxs(s.Fragment,{children:[e.map(c=>s.jsx(Li,{id:`setup-import:${c.id}`,tone:c.status==="importing"?"progress":c.status==="saved"?"success":c.status==="failed"?"error":"warning",title:s.jsxs(s.Fragment,{children:[c.name," · ",c.status==="importing"?"Importing":c.status==="saved"?"Imported":c.status==="cancelled"?"Import cancelled":c.status==="failed"?"Import failed":"Import needs attention"]}),actions:s.jsxs(s.Fragment,{children:[s.jsx(Co,{location:c.location}),!["importing","saved"].includes(c.status)&&s.jsx(ce,{size:"xs",variant:"outline",onClick:()=>r(c),children:"Review import"}),c.status==="saved"&&rp(c.setup)&&s.jsx(ce,{size:"xs",variant:"outline",onClick:()=>l({policy:rp(c.setup),location:c.location}),children:"View egress policy"})]}),onDismiss:c.status==="importing"?void 0:()=>Ai.dismiss(c.id),dismissLabel:`Dismiss import notification for ${c.name}`,children:c.message},c.id)),t&&s.jsx(Pa,{location:t.location,children:s.jsx(S3,{initialJob:t,initialReview:t.review,initialName:t.name,onClose:()=>r(null),onSaved:c=>{l({policy:rp(c),location:t.location}),r(null)}},t.id)}),(a==null?void 0:a.policy)&&s.jsx(Pa,{location:a.location,children:s.jsx(j3,{policy:a.policy,onClose:()=>l(null)})})]})}function j3({policy:e,onClose:t}){var O,k,M,A,R;const r=$t(),a=Cn(),[l,c]=g.useState([]),[u,f]=g.useState(null),[h,m]=g.useState([]),[x,p]=g.useState(!1),[b,v]=g.useState(""),[j,S]=g.useState(!1);g.useEffect(()=>{if(e.error)return;let z=!0;return r.org().then(_=>{var Y;if(!z)return;const L=(_.policies??[]).find(P=>P.id===e.id);m(_.groups??[]),f(L??null),c(((Y=L==null?void 0:L.appliesTo)==null?void 0:Y.groups)??[])}).catch(_=>{z&&v(`Could not load groups: ${_.message}`)}),()=>{z=!1}},[r,e.id,e.error]);const N=async()=>{p(!0),v("");try{await r.savePolicy({...u,appliesTo:{...u.appliesTo,everyone:!1,groups:l},isNew:!1}),f({...u,appliesTo:{...u.appliesTo,groups:l}}),S(!0)}catch(z){v(z.message)}finally{p(!1)}},C=u&&(l.length!==u.appliesTo.groups.length||l.some(z=>!u.appliesTo.groups.includes(z))),E=PK(e),T=()=>{try{sessionStorage.setItem(Vl,JSON.stringify({edit:e.id}))}catch{}t(),window.dispatchEvent(new CustomEvent("openrod-navigate",{detail:{view:"egress",location:a}})),window.dispatchEvent(new Event(Vl))};return e.error?s.jsx(vn,{open:!0,onOpenChange:z=>{z||t()},children:s.jsxs(wn,{className:"sm:max-w-md",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"Egress policy not saved"}),s.jsx(_n,{children:"The setup was saved, but its egress policy wasn’t. When you enable the setup on a sandbox, you approve its websites there instead."})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:e.error}),s.jsx("div",{className:"flex justify-end",children:s.jsx(ce,{onClick:t,children:"Done"})})]})}):s.jsx(vn,{open:!0,onOpenChange:z=>{z||t()},children:s.jsxs(wn,{className:"max-h-[90svh] overflow-y-auto sm:max-w-md",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:e.created?"Egress policy created":"Egress policy updated"}),s.jsxs(_n,{children:["We ",e.created?"created":"updated"," the egress policy “",e.name,"”. Sandboxes that use this setup can now reach the websites below. This policy doesn’t open anything else."]})]}),E.length>0&&s.jsx("ul",{"aria-label":"Allowed websites",className:"max-h-64 divide-y overflow-y-auto rounded-lg border text-xs",children:E.map(z=>s.jsxs("li",{className:"flex items-baseline justify-between gap-3 px-3 py-2",children:[s.jsx("span",{className:"min-w-0 break-all font-mono",children:z.host}),z.items.length>0&&s.jsx("span",{className:"max-w-[50%] text-right text-muted-foreground",children:z.items.join(", ")})]},z.host))}),((O=e.blocked)==null?void 0:O.length)>0&&s.jsxs("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:["Not allowed because your organization blocks them: ",e.blocked.join(", "),"."]}),((k=e.approval)==null?void 0:k.length)>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Not in this policy, because an MCP sends credentials there or names it as its sign-in service: ",e.approval.map(z=>`${z.host} (${z.items.join(", ")})`).join(", "),". You approve these for each sandbox when you enable the setup there."]}),(((M=e.sync)==null?void 0:M.error)||((R=(A=e.sync)==null?void 0:A.failed)==null?void 0:R.length)>0)&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"The policy is saved, but some sandboxes that use this setup weren’t updated yet. The console keeps retrying in the background."}),u&&s.jsxs("fieldset",{className:"grid gap-1.5 text-xs",children:[s.jsx("legend",{className:"font-medium",children:"Assign to groups"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Sandboxes in these groups get this policy, whether or not they use the setup."}),s.jsx(Wd,{multiple:!0,groups:h,value:l,onChange:z=>{S(!1),c(z)},onCreated:z=>m(_=>[..._,z])}),b&&s.jsx("p",{role:"alert",className:"text-[11px] text-red-700",children:b}),j&&!C&&s.jsx("p",{role:"status",className:"text-[11px] text-muted-foreground",children:"Groups saved."})]}),!u&&b&&s.jsx("p",{role:"alert",className:"text-[11px] text-red-700",children:b}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"To let an MCP reach another website, add it to this policy in Network › Egress."}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ce,{variant:"outline",onClick:T,children:"Edit policy"}),C&&s.jsxs(ce,{disabled:x,onClick:N,children:[x&&s.jsx(zt,{}),"Save groups"]}),s.jsx(ce,{variant:C?"ghost":"default",disabled:x,onClick:t,children:C?"Skip":"Done"})]})]})})}function FK({item:e}){var l;const t=c=>[...new Set(e.requirements.filter(u=>["runtime","auth"].includes(u.phase)&&c(u)).map(u=>u.host.toLowerCase()))],r=t(c=>gE(e,c)),a=t(c=>!gE(e,c));return s.jsxs(s.Fragment,{children:[r.length>0&&s.jsxs("p",{className:"text-muted-foreground",children:["Import adds ",r.join(", ")," to this setup’s egress policy."]}),a.length>0&&s.jsxs("p",{className:"text-muted-foreground",children:["You approve ",a.join(", ")," for each sandbox when you enable the setup there",e.credentialRef||(l=e.credentialFields)!=null&&l.length?", because this MCP sends credentials":"","."]})]})}function GK({preparation:e,onCancel:t}){var p,b;const r=e.status==="running",[a,l]=g.useState(Date.now);g.useEffect(()=>{if(!r)return;l(Date.now());const v=setInterval(()=>l(Date.now()),1e3);return()=>clearInterval(v)},[r]);const c=Date.parse(e.createdAt),u=r?e.current:null,f=((p=e.items)==null?void 0:p.filter(v=>v.kind==="mcp"))??[],h=((b=e.items)==null?void 0:b.filter(v=>v.kind==="skill"))??[],m=h.every(v=>v.state),x=s.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/40"});return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(zt,{}),s.jsx("span",{className:"min-w-0 flex-1",children:u&&f.length?"Preparing your tools…":e.message}),r&&!Number.isNaN(c)&&s.jsx("span",{"aria-hidden":"true",className:"tabular-nums text-muted-foreground",children:VK(Math.max(0,Math.floor((a-c)/1e3)))}),r&&s.jsx(ce,{size:"sm",variant:"outline",onClick:t,children:"Cancel import"})]}),(f.length>0||h.length>0)&&s.jsxs("ul",{"aria-label":"Import progress",className:"space-y-1.5 border-t pt-2",children:[f.map(v=>{const j=(u==null?void 0:u.id)===v.id,S=!j&&Pw(v);return s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"flex size-3.5 shrink-0 items-center justify-center",children:j?s.jsx(zt,{className:"size-3.5"}):S||!v.state||v.state==="disabled"?x:v.state==="needs-attention"?s.jsx(Gl,{className:"size-3.5 text-amber-600"}):s.jsx(qn,{className:"size-3.5 text-emerald-600"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.name}),s.jsx("span",{className:"min-w-0 max-w-[60%] truncate text-right text-muted-foreground",children:j?u.message:S?"Skipped":BK[v.state]||"Waiting"})]},v.id)}),h.length>0&&s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"flex size-3.5 shrink-0 items-center justify-center",children:m?s.jsx(qn,{className:"size-3.5 text-emerald-600"}):x}),s.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h.length," ",h.length===1?"skill":"skills"]}),s.jsx("span",{className:"text-muted-foreground",children:m?"Done":"Waiting"})]})]})]})}function qK({item:e,choice:t,disabled:r,onChange:a}){const l=g3(t==null?void 0:t.hosts)||(b3(e,t)?"Enter at least one website, for example api.github.com.":"");return x3(e)?s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("p",{className:"font-medium",children:"Where should this MCP send its credentials?"}),s.jsxs("p",{className:"text-muted-foreground",children:[e.name," needs at least one website it may send ",e.credentialFields.join(", ")," to, for example api.github.com."]}),s.jsx(Ot,{"aria-label":`Websites for ${e.name}`,"aria-invalid":l?!0:void 0,disabled:r,placeholder:"e.g. api.github.com",value:(t==null?void 0:t.hostsText)??"",onChange:c=>a(c.target.value)}),s.jsx("span",{className:"text-muted-foreground",children:"Domain names only, separated by commas or spaces. HTTPS only."}),l&&s.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:l})]}):null}function S3({onClose:e,onSaved:t,initialReview:r=null,initialName:a="My setup",initialJob:l=null}){const c=$t(),u=Cn(),[f,h]=g.useState([]),[m,x]=g.useState(null),[p,b]=g.useState([]),[v,j]=g.useState(r),[S,N]=g.useState(a),[C,E]=g.useState(""),[T,O]=g.useState(null),[k,M]=g.useState(!1),[A,R]=g.useState("");async function z(oe){M(!0),R("");try{await oe()}catch(Z){R(Z.message)}finally{M(!1)}}const[_,L]=g.useState({}),[Y,P]=g.useState((l==null?void 0:l.preparation)??null),[V,U]=g.useState((l==null?void 0:l.prepared)??!1),[H,F]=g.useState(!1),[q,W]=g.useState(!!l),B=g.useRef(l==null?void 0:l.id),J=g.useRef(!0);g.useEffect(()=>(J.current=!0,()=>{J.current=!1}),[]);const X=(Y==null?void 0:Y.status)==="running"||k&&!!Y,re=(oe,Z)=>{U(!1),L(de=>({...de,[oe]:{...de[oe],...Z}}))};async function I(oe){const Z=await c.removeSetupReviewItem(v.token,oe);j(Z),b(de=>de.filter(ke=>ke!==oe)),L(de=>Object.fromEntries(Object.entries(de).filter(([ke])=>ke!==oe))),P(null),B.current&&Ai.updateReview(B.current,Z,V)}async function $(oe=!1){W(!0),F(!0);const Z=Ai.start({id:B.current,review:v,name:S,choices:_,saveOnly:oe,api:c,location:u,resumeJob:(Y==null?void 0:Y.status)==="running"?Y:void 0},{onProgress:de=>{J.current&&P(de)},onReview:de=>{J.current&&(j(de),U(!0),L({}))}});B.current=Z.id;try{const de=await Z.promise;if(!J.current)return;de.status==="saved"?t(de.setup):de.status==="needs-attention"?R("Some items couldn’t be prepared. Remove them or fix them, then retry the import."):(U(!1),R("Import cancelled. Completed preparation is kept here for retry."))}finally{J.current&&F(!1)}}const Q=(m==null?void 0:m.items.filter(oe=>`${oe.name} ${oe.kind} ${oe.sources.join(" ")}`.toLowerCase().includes(C.toLowerCase())))??[],G=new Set(p),se=(oe,Z)=>b(de=>{const ke=new Set(de);for(const _e of oe)Z?ke.add(_e.id):ke.delete(_e.id);return[...ke]}),ee=Q.length>0&&Q.every(oe=>G.has(oe.id)),ne=v?Dq(v,_):[],ie=Object.values(_).some(oe=>g3(oe.hosts))||!!(v!=null&&v.items.some(oe=>!oe.disabled&&b3(oe,_[oe.id])));return s.jsxs(vn,{open:!0,onOpenChange:oe=>{!oe&&(B.current||H||!k&&!X)&&e()},children:[s.jsxs(wn,{className:"flex max-h-[90svh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[s.jsxs(jn,{className:"shrink-0 px-6 pb-4 pt-6 pr-12",children:[s.jsx(bn,{children:v?"Import setup":m?"Choose what to bring":"Bring my setup"}),s.jsx(_n,{children:v?"Import downloads and checks your MCPs, then saves the setup.":m?"Select the MCPs and skills to import. Items found in more than one agent are listed once.":"Choose the agents to import MCPs and skills from."})]}),s.jsxs("div",{className:"min-h-0 space-y-5 overflow-y-auto px-6 pb-5",children:[!m&&!v&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"grid gap-2 sm:grid-cols-3",children:Gw.map(oe=>s.jsxs("button",{type:"button","aria-pressed":f.includes(oe.id),onClick:()=>h(Z=>Z.includes(oe.id)?Z.filter(de=>de!==oe.id):[...Z,oe.id]),className:`flex items-center gap-2 rounded-xl border px-3 py-4 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring ${f.includes(oe.id)?"border-ring bg-muted":"bg-card"}`,children:[s.jsx("span",{className:"flex size-7 items-center justify-center rounded-lg border bg-muted/30",children:s.jsx("img",{src:`/logos/agents/${oe.logo}.svg`,alt:"",className:"size-4"})}),oe.name,f.includes(oe.id)&&s.jsx(qn,{className:"ml-auto size-3.5"})]},oe.id))})}),m&&!v&&s.jsxs(s.Fragment,{children:[s.jsx(ra,{"aria-label":"Search discovered tools",placeholder:"Search MCPs and Skills…",value:C,onValueChange:E}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("p",{role:"status",className:"text-xs text-muted-foreground",children:[p.length," of ",m.items.length," selected",C.trim()?` · ${Q.length} matching`:""]}),s.jsx(ce,{size:"sm",variant:"outline",disabled:k||!Q.length,onClick:()=>se(Q,!ee),children:ee?C.trim()?"Clear results":"Clear all":C.trim()?"Select all results":"Select all"})]}),s.jsx("div",{className:"grid items-start gap-3 sm:grid-cols-2",children:[{kind:"mcp",label:"MCPs"},{kind:"skill",label:"Skills"}].map(({kind:oe,label:Z})=>{const de=Q.filter(je=>je.kind===oe),ke=de.filter(je=>G.has(je.id)).length,_e=de.length>0&&ke===de.length;return s.jsxs("section",{"aria-label":Z,className:"min-w-0 overflow-hidden rounded-xl border",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 border-b bg-muted px-3 py-2",children:[s.jsxs("h3",{className:"text-xs font-medium",children:[Z,s.jsxs("span",{className:"ml-2 font-normal text-muted-foreground",children:[ke,"/",de.length]})]}),s.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 text-xs",disabled:k||!de.length,"aria-label":`${_e?"Clear":"Select all"} ${Z}${C.trim()?" in search results":""}`,onClick:()=>se(de,!_e),children:_e?"Clear":"Select all"})]}),s.jsxs("div",{className:"max-h-64 divide-y overflow-y-auto",children:[de.map(je=>s.jsxs("label",{className:"flex cursor-pointer items-start gap-3 p-3",children:[s.jsx(Pl,{disabled:k,"aria-label":`Import ${je.name} from ${xE(je)}`,checked:G.has(je.id),onCheckedChange:Ae=>se([je],Ae)}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-xs font-medium",children:je.name}),s.jsxs("span",{className:"mt-1 block text-[11px] text-muted-foreground",children:[xE(je),Pw(je)?" · Can’t run in a sandbox":ka(je).length?" · Needs attention":""]})]})]},je.id)),!de.length&&s.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:C.trim()?`No matching ${Z}`:`No ${Z} found`})]})]},oe)})}),C.trim()&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select all only affects the search results. Other selections are kept."}),m.warnings.map(oe=>s.jsx("p",{className:"text-[11px] text-muted-foreground",children:oe},oe))]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"grid gap-1.5 text-xs",children:["Setup name",s.jsx(Ot,{disabled:k,value:S,onChange:oe=>N(oe.target.value),maxLength:80})]}),s.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:s.jsxs("span",{children:[IK(v)," ready · ",Yp(v)," need attention"]})}),s.jsx(v3,{items:v.items,children:oe=>s.jsx(b7,{className:"overflow-hidden rounded-lg border",children:oe.map(Z=>{var de,ke,_e,je,Ae,te,Ee,Te;return s.jsxs(y7,{value:Z.id,children:[s.jsxs("div",{className:"flex items-center [&>h3]:min-w-0 [&>h3]:flex-1",children:[s.jsxs(v7,{className:"items-center gap-3 rounded-none px-3 py-3 text-xs hover:bg-muted/30 hover:no-underline",children:[s.jsx("span",{className:"min-w-0 flex-1 break-words",children:Z.name}),s.jsx("span",{className:`shrink-0 text-[11px] font-normal ${["Needs attention","Can’t run in a sandbox"].includes(yE(Z))?"text-amber-700 dark:text-amber-400":"text-muted-foreground"}`,children:yE(Z)})]}),s.jsx(ce,{variant:"ghost",size:"icon",className:"mr-2 size-7 shrink-0 text-muted-foreground hover:text-destructive",disabled:k||X,"aria-label":`Remove ${Z.name} from import`,title:"Remove from this import",onClick:()=>z(()=>I(Z.id)),children:s.jsx(Gn,{className:"size-3.5"})})]}),s.jsxs(w7,{className:"space-y-3 border-t bg-muted/10 px-4 py-4 text-xs leading-relaxed [&_p:not(:last-child)]:mb-0",children:[ka(Z).length>0&&s.jsx("div",{className:"space-y-1 text-amber-700 dark:text-amber-400",children:ka(Z).map(be=>s.jsx("p",{children:be},be))}),Z.requirements.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground",children:"Network access"}),Z.requirements.map((be,We)=>s.jsxs("p",{children:[s.jsxs("span",{className:"font-medium",children:[LK[be.phase]||be.phase,":"]})," ",_K(be),s.jsxs("span",{className:"text-muted-foreground",children:[" · ",be.reason]})]},We)),Z.kind==="mcp"&&!Z.disabled&&!ka(Z).some(be=>!be.startsWith("Connect credentials"))&&s.jsx(FK,{item:Z})]}),Z.package&&s.jsxs("p",{children:["npm package ",Z.package.name,"@",((de=Z.artifact)==null?void 0:de.version)||Z.package.requested,Z.artifact?" · downloaded and version-locked":" · downloads when you press Import"]}),Z.verification&&s.jsxs("p",{children:["Connection: ",bE[Z.verification.status]||Z.verification.status,Z.verification.reason?` · ${Z.verification.reason}`:""]}),((ke=Z.artifact)==null?void 0:ke.verification)&&s.jsxs("p",{children:["Startup check: ",bE[Z.artifact.verification.status]||Z.artifact.verification.status,Z.artifact.verification.toolCount!==void 0?` · ${Z.artifact.verification.toolCount} tools found`:""]}),Z.credentialRef&&s.jsxs("p",{children:["Credentials connected · ",Z.credentialRef.provider,". Values are held by the gateway."]}),((_e=Z.configuration)==null?void 0:_e.endpoint)&&!Z.credentialRef&&s.jsx(y3,{children:"If this MCP needs an account, sign in from the agent inside the sandbox. Your desktop sign-in isn’t copied."}),Z.kind==="mcp"&&!Z.disabled&&(Z.configuration||Z.package)&&!((je=Z.configuration)!=null&&je.endpoint)&&s.jsx(qK,{item:Z,choice:_[Z.id],disabled:k||X,onChange:be=>re(Z.id,{hostsText:be,hosts:be.split(/[\s,]+/).map(We=>We.replace(/^https?:\/\//i,"").split("/")[0].toLowerCase()).filter(Boolean)})}),((Ae=Z.credentialFields)==null?void 0:Ae.length)>0&&s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx("p",{className:"font-medium",children:"Connect credentials"}),((te=Z.sourceCredentialFields)==null?void 0:te.length)>0&&s.jsxs("label",{className:"flex items-start gap-2",children:[s.jsx(Pl,{disabled:k||X,checked:((Ee=_[Z.id])==null?void 0:Ee.useSourceSecrets)||!1,onCheckedChange:be=>re(Z.id,{useSourceSecrets:!!be})}),"Use the credentials from your config file (",Z.sourceCredentialFields.join(", "),")."]}),Z.credentialFields.filter(be=>{var We,Se;return!((We=_[Z.id])!=null&&We.useSourceSecrets)||!((Se=Z.sourceCredentialFields)!=null&&Se.includes(be))}).map(be=>{var We,Se;return s.jsxs("label",{className:"grid gap-1",children:[be,s.jsx(Ot,{type:"password",autoComplete:"new-password","aria-label":`${Z.name} ${be}`,disabled:k||X,value:((Se=(We=_[Z.id])==null?void 0:We.secrets)==null?void 0:Se[be])||"",onChange:Fe=>{var Re;return re(Z.id,{secrets:{...(Re=_[Z.id])==null?void 0:Re.secrets,[be]:Fe.target.value}})}})]},be)}),s.jsx("p",{className:"text-muted-foreground",children:"Stored in the gateway and sent only to this MCP’s server. Never saved in the setup or in images."})]}),Z.configuration&&s.jsxs("details",{className:"group/config",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 rounded-sm text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[s.jsx(Hr,{className:"size-3 transition-transform group-open/config:rotate-90"}),"Configuration"]}),s.jsx("pre",{className:"mt-2 overflow-x-auto rounded border bg-muted/30 p-3 text-[11px]",children:JSON.stringify(Z.configuration,null,2)})]}),(Te=Z.files)==null?void 0:Te.map(be=>s.jsxs("button",{disabled:k,onClick:()=>z(async()=>O({path:be.path,...await c.setupFile(v.token,Z.id,be.path)})),className:"flex w-full items-center gap-1.5 rounded px-1 py-1 text-left hover:bg-muted",children:[s.jsx(Gv,{className:"size-3"}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:be.path}),s.jsxs("span",{className:"text-muted-foreground",children:[be.bytes," B"]})]},be.path))]})]},Z.id)})})}),Y&&s.jsx("div",{role:"status","aria-live":"polite",className:"space-y-2 rounded-lg border bg-muted/30 p-3 text-xs",children:X?s.jsx(GK,{preparation:Y,onCancel:()=>{Ai.cancel(B.current).catch(oe=>R(oe.message))}}):s.jsx("p",{children:V?eE(v)?"Checks finished. Some items need attention.":"Checks finished. Ready to save.":"Not finished. Press Import to continue."})}),r&&s.jsx(ce,{variant:"ghost",disabled:X||k,onClick:()=>{j(null),h([...new Set(r.items.flatMap(oe=>oe.sources))]),P(null),U(!1),L({})},children:"Re-scan sources"})]}),s.jsx(Jd,{children:A})]}),s.jsxs("div",{className:"shrink-0 space-y-4 border-t bg-muted/20 px-6 py-4",children:[v&&!X&&!V&&ne.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[ne.map(oe=>oe.name).join(", ")," will be saved as inactive. You can fix ",ne.length===1?"it":"them"," later."]}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[m&&s.jsx(ce,{variant:"ghost",disabled:k||X,onClick:()=>{v?(j(null),U(!1),P(null),L({})):(x(null),b([])),R("")},children:"Back"}),s.jsx(ce,{variant:"ghost",disabled:!B.current&&!H&&(k||X),onClick:e,children:H?"Continue in background":B.current?"Close":"Cancel"}),v?s.jsxs(ce,{disabled:k||!S.trim()||!v.items.length||ie,onClick:()=>z(()=>$(V&&!eE(v))),children:[k&&s.jsx(zt,{}),k?"Importing…":X?"Resume import":q?"Retry import":"Import"]}):m?s.jsxs(ce,{disabled:k||!p.length,onClick:()=>z(async()=>{j(await c.reviewSetup(m.token,p)),W(!1)}),children:[k&&s.jsx(zt,{}),"Review selection"]}):s.jsxs(ce,{disabled:k||!f.length,onClick:()=>z(async()=>x(await c.discoverSetups(f))),children:[k&&s.jsx(zt,{}),"Discover tools"]})]})]})]}),T&&s.jsx(vn,{open:!0,onOpenChange:()=>O(null),children:s.jsxs(wn,{className:"max-h-[85svh] overflow-y-auto sm:max-w-3xl",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:T.path}),s.jsx(_n,{children:"Read-only file preview. Content is not executed."})]}),s.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-lg border bg-muted/30 p-4 font-mono text-xs",children:T.content})]})})]})}function YK({setup:e,sandbox:t,onUpdated:r,onClose:a,onPrepare:l}){var L,Y;const c=$t(),u=Cn(),[f,h]=g.useState([]),[m,x]=g.useState(null),[p,b]=g.useState(t||""),[v,j]=g.useState([]),[S,N]=g.useState(null),[C,E]=g.useState(null),[T,O]=g.useState([]),[k,M]=g.useState(!1),[A,R]=g.useState("");g.useEffect(()=>{let P=!0;return c.overview().then(V=>{P&&(h(V.sandboxes),x({...V.gateway,target:u==null?void 0:u.target}))}).catch(V=>{P&&R(V.message)}),()=>{P=!1}},[c]),g.useEffect(()=>{let P=!1,V;const U=async()=>{try{const H=await c.setupJobs(e.id);if(P)return;O(H),H.some(F=>F.status==="waiting")&&(V=setTimeout(U,2e3))}catch{}};return U(),()=>{P=!0,clearTimeout(V)}},[e.id,C,c]);async function z(P){M(!0),R("");try{await P()}catch(V){R(V.message),N(null)}finally{M(!1)}}const _=e.items.filter(P=>{var V;return!P.disabled&&!P.issues.length&&!P.credentialRef&&((V=P.auth)==null?void 0:V.mode)==="agent-session"});return s.jsx(vn,{open:!0,onOpenChange:P=>{!P&&!k&&a()},children:s.jsxs(wn,{className:"max-h-[90svh] overflow-y-auto sm:max-w-lg",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:e.name}),s.jsx(_n,{className:"sr-only",children:"Manage the MCPs and Skills in this saved setup."})]}),s.jsx(v3,{items:e.items,children:P=>s.jsx("div",{className:"max-h-72 divide-y overflow-y-auto rounded-lg border",children:P.map(V=>{var U,H;return s.jsxs("div",{className:"flex items-start gap-2 px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 self-center",children:V.issues.length||((U=V.auth)==null?void 0:U.mode)==="agent-session"?s.jsxs("details",{className:"group/item",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 rounded-sm text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[s.jsx(Hr,{className:"size-3 shrink-0 text-muted-foreground transition-transform group-open/item:rotate-90"}),s.jsx("span",{className:"min-w-0 flex-1 break-words font-medium",children:V.name}),s.jsx("span",{className:`shrink-0 text-[10px] ${ka(V).length?"text-amber-700 dark:text-amber-400":"text-muted-foreground"}`,children:ka(V).length?"Needs review":V.issues.length?"Installs automatically":"Sign-in needed"})]}),s.jsxs("div",{className:"space-y-1.5 pb-1 pl-5 pt-2 text-[11px] leading-relaxed text-muted-foreground",children:[V.issues.map(F=>s.jsx("p",{children:F},F)),((H=V.auth)==null?void 0:H.mode)==="agent-session"&&s.jsx("p",{children:"Sign in inside the sandbox after installation."})]})]}):s.jsx("p",{className:"break-words pl-5 text-xs font-medium",children:V.name})}),s.jsx(ce,{variant:"ghost",size:"icon",className:"size-6 shrink-0 text-muted-foreground hover:text-destructive",disabled:k,"aria-label":`Delete ${V.name} from setup`,title:V.kind==="mcp"?"Remove from this setup. Copies already installed in sandboxes stay, but lose the website access only this MCP needed.":"Remove from this setup. Copies already installed in sandboxes stay.",onClick:()=>z(async()=>{const{egressPolicyError:F,...q}=await c.deleteSetupItem(e.id,V.id,e.revision);N(null),E(null),r(q),F&&R(`Removed. The setup’s egress policy wasn’t updated: ${F}`)}),children:s.jsx(Gn,{className:"size-3.5"})})]},V.id)})})}),s.jsx("div",{className:"flex items-center justify-between gap-3",children:s.jsxs(ce,{variant:"outline",size:"sm",onClick:l,disabled:k,children:[Yp(e)?"Resolve issues":"Prepare setup",s.jsx(Hr,{className:"size-3.5"})]})}),s.jsxs("details",{className:"group/install border-t pt-3",open:t?!0:void 0,children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between rounded-sm text-xs font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:["Install in a sandbox",s.jsx(Hr,{className:"size-3.5 text-muted-foreground transition-transform group-open/install:rotate-90"})]}),s.jsxs("div",{className:"space-y-3 pt-4",children:[s.jsxs("fieldset",{disabled:k,className:"grid gap-3",children:[s.jsxs("label",{className:"grid gap-1.5 text-xs",children:["Sandbox",s.jsxs(cn,{"aria-label":"Setup destination",value:p,onChange:P=>{b(P.target.value),N(null),E(null)},className:"w-full text-xs",children:[s.jsx("option",{value:"",children:"Choose a sandbox"}),f.map(P=>s.jsxs("option",{value:P.name,children:[P.name," · ",P.phase]},P.name))]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-xs",children:"Enable for agents"}),s.jsx("div",{className:"flex flex-wrap gap-4",children:S6.map(P=>s.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[s.jsx(Pl,{disabled:!P.config,title:P.reason,checked:v.includes(P.id),onCheckedChange:V=>{j(U=>V?[...U,P.id]:U.filter(H=>H!==P.id)),N(null),E(null)}}),P.name,!P.config&&s.jsx("span",{className:"text-muted-foreground",children:" · Unavailable"})]},P.id))})]}),s.jsxs(ce,{variant:"outline",disabled:!p||!v.length||k,onClick:()=>z(async()=>{E(null),N(await c.previewSetup(e.id,p,v))}),children:[k&&s.jsx(zt,{}),"Check requirements"]})]}),S&&s.jsxs("div",{className:"space-y-3",children:[S.problems.map(P=>s.jsx("p",{className:"text-xs text-amber-700",children:P},P)),S.network.map((P,V)=>{var U;return s.jsxs("div",{className:"rounded-lg border p-3 text-xs",children:[s.jsxs("p",{className:"flex justify-between gap-2 font-medium",children:[s.jsxs("span",{children:[P.item," · ",P.host,":",P.port,P.path||""]}),s.jsx("span",{children:P.status==="allowed"?"Existing access":P.status==="policy"?"Allowed by setup policy":P.status==="blocked"?"Blocked":P.status==="proposed"?"Requested access":"Needs review"})]}),s.jsx("p",{className:"mt-1 text-muted-foreground",children:P.reason}),((U=P.binaries)==null?void 0:U.length)>0&&s.jsx("p",{className:"mt-1 break-all font-mono text-muted-foreground",children:P.binaries.join(", ")}),P.credentialProvider&&s.jsxs("p",{children:["Credential binding: ",P.credentialProvider]})]},V)}),(L=S.inactive)==null?void 0:L.map(P=>s.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.name,": inactive · ",P.issues.join(" ")]},P.name)),S.notes.length>0&&s.jsx(y3,{children:S.notes.join(" ")}),!S.canEnable&&s.jsx("button",{type:"button",onClick:()=>{a(),window.dispatchEvent(new CustomEvent("openrod-navigate",{detail:{view:"egress",location:u}}))},className:"inline-block text-xs underline underline-offset-4",children:"Review access in Network › Egress"}),s.jsxs("div",{className:"flex justify-end gap-2",children:[S.installed&&s.jsx(ce,{variant:"outline",disabled:k,onClick:()=>z(async()=>{E(await c.removeSetup(e.id,p,S.token)),N(null)}),children:"Remove from sandbox"}),s.jsxs(ce,{disabled:k||!S.canEnable,onClick:()=>z(async()=>{E(await c.enableSetup(e.id,p,S.token,S.requiresApproval)),N(null)}),children:[k&&s.jsx(zt,{}),S.requiresApproval?"Approve access & enable":S.installed?"Check & reapply":"Enable & check"]})]})]}),C&&s.jsx("p",{role:"status",className:"rounded-lg border bg-muted/30 p-3 text-xs",children:C.status==="removed"?"Removed from this sandbox. Restart the agent to unload it. The sandbox no longer gets this setup’s egress policy; access you approved for it separately stays.":"Prepared configuration installed. Restart the agent to load it. Connection checks below apply to this sandbox; they do not execute tools."}),(Y=C==null?void 0:C.checks)==null?void 0:Y.map((P,V)=>s.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.item,": ",P.status,P.toolCount!==void 0?` · ${P.toolCount} tools discovered`:"",P.reason?` · ${P.reason}`:""]},V)),((C==null?void 0:C.status)==="installed"||(S==null?void 0:S.installed)||T.some(P=>P.sandbox===p&&P.status==="installed"))&&p&&(m==null?void 0:m.name)&&(m==null?void 0:m.workspace)&&_.length>0&&s.jsxs("div",{className:"space-y-2 text-xs",children:[s.jsxs("p",{className:"font-medium",children:["Sign in to ",_.map(P=>P.name).join(", ")]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(P=>{var V,U;return s.jsxs("a",{className:"rounded-md border px-3 py-2 hover:bg-muted",href:Bp(p,((V=Dy(P))==null?void 0:V.command)||P,m),target:"_blank",rel:"noreferrer",children:["Open ",(U=Dy(P))==null?void 0:U.name]},P)})}),v.includes("codex")&&_.filter(P=>{var V;return(V=P.configuration)==null?void 0:V.endpoint}).map(P=>s.jsxs("a",{className:"block underline underline-offset-4",href:`${Bp(p,"codex",m)}&setupLogin=${e.id}&mcp=${encodeURIComponent(P.id)}`,target:"_blank",rel:"noreferrer",children:["Sign in to ",P.name," with Codex"]},P.id)),s.jsxs("details",{className:"text-[11px] text-muted-foreground",children:[s.jsx("summary",{className:"cursor-pointer",children:"About sign-in"}),s.jsx("p",{className:"mt-2",children:"Use the agent’s MCP menu to authenticate and confirm tool availability. Sessions stay in this sandbox and are not baked into images. Console connection checks do not use these sessions."})]})]}),T.filter(P=>!p||P.sandbox===p).map((P,V)=>s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[P.sandbox,": ",P.status,P.error?` · ${P.error}`:""]},V))]})]}),s.jsx(Jd,{children:A})]})})}function N3(e){const t=Cn();return s.jsx(XK,{...e},(t==null?void 0:t.id)??(t==null?void 0:t.context)??"default")}const KK=[];function XK({value:e=[],onChange:t,inherited:r=KK,accessReview:a,onAccessReview:l,automaticAccess:c=!1,autoPrepare:u=!1,preparationContext:f="sandbox",localCatalog:h}){const m=$t(),[x,p]=g.useState([]),[b,v]=g.useState(""),[j,S]=g.useState(null),N=!!l;g.useEffect(()=>{let R=!0;return m.setups().then(z=>{R&&p(z.filter(_=>!(h!=null&&h.available)||!_.localSource||h.setups.includes(_.id)||r.includes(_.id)))}).catch(z=>{R&&v(z.message)}),()=>{R=!1}},[m,h,r]),g.useEffect(()=>{if(!N)return;let R=!0;return m.org().then(z=>{R&&S(z.policies??null)}).catch(()=>{R&&S(null)}),()=>{R=!1}},[N,m]);const C=x.filter(R=>e.includes(R.id)||r.includes(R.id)),E=R=>u?Aq(R):!R.disabled&&!R.issues.length,T=R=>u?R.items.filter(OM):[],O=R=>R.items.filter(z=>!E(z)),k=zK(C,j,R=>R.items.filter(E),R=>u?Oq(R):R.requirements),M=C.some(R=>R.items.some(z=>{var _;return E(z)&&!z.credentialRef&&((_=z.auth)==null?void 0:_.mode)==="agent-session"})),A=JSON.stringify(C.map(R=>[R.id,R.revision]));return g.useEffect(()=>{l==null||l(c?Object.fromEntries(JSON.parse(A)):null)},[A,c,l]),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"MCPs & Skills"}),x.map(R=>s.jsxs("div",{className:"rounded-lg border p-2.5 text-xs",children:[s.jsxs("label",{className:"flex items-start gap-2",children:[s.jsx(Pl,{"aria-label":`Use ${R.name}`,disabled:r.includes(R.id)||!R.items.some(E),checked:e.includes(R.id)||r.includes(R.id),onCheckedChange:z=>t(z?[...e,R.id]:e.filter(_=>_!==R.id))}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"block truncate",children:[R.name,r.includes(R.id)?" · From image template":""]}),s.jsxs("span",{className:"mt-1 block text-[11px] text-muted-foreground",children:[qp(R,"mcp")," MCPs · ",qp(R,"skill")," Skills",T(R).length?` · ${T(R).length} install automatically`:"",O(R).length?` · ${O(R).length} inactive`:""]})]})]}),O(R).length>0&&s.jsxs("details",{className:"mt-2 pl-6 text-[11px] text-muted-foreground",children:[s.jsx("summary",{className:"cursor-pointer",children:"Items that will stay inactive"}),s.jsxs("div",{className:"mt-2 space-y-2",children:[O(R).map(z=>s.jsxs("p",{children:[s.jsxs("span",{className:"font-medium text-foreground",children:[z.name,":"]})," ",z.issues.join(" ")]},z.id)),s.jsx("p",{children:"Resolve these items in MCPs & Skills."})]})]})]},R.id)),l&&k.uncovered.length>0&&s.jsxs("div",{className:"space-y-2 pt-1 text-xs",children:[s.jsx("p",{className:"font-medium",children:c?"Required access":"Network access"}),s.jsx("ul",{className:"divide-y text-[11px] text-muted-foreground",children:k.uncovered.map(R=>s.jsx("li",{className:"break-all py-1",children:R},R))}),!c&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"flex items-start gap-2",children:[s.jsx(Pl,{checked:!!a,onCheckedChange:R=>l(R?Object.fromEntries(C.map(z=>[z.id,z.revision])):null)}),"Allow these destinations for tools and connection checks."]}),!a&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Otherwise, review access in MCPs & Skills before installation."})]})]}),l&&k.covered.length>0&&s.jsxs("div",{className:"space-y-2 pt-1 text-xs",children:[s.jsx("p",{className:"font-medium",children:C.length>1?"Allowed by the setups’ egress policies":"Allowed by the setup’s egress policy"}),s.jsx("ul",{className:"divide-y text-[11px] text-muted-foreground",children:k.covered.map(R=>s.jsx("li",{className:"break-all py-1",children:R},R))})]}),s.jsx(Jd,{children:b}),M&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:f==="template"?"Sign in after launching the sandbox.":"Sign in inside the sandbox after installation."})]})}function WK(e){var r;const t={locations:[],sandboxes:[],templates:[]};for(const{target:a,inventory:l,cloud:c=a==="cloud"}of e){const u=new Map((l.locations??[]).map(f=>{const h={...f,target:a,cloud:c,id:JSON.stringify([a,f.context]),...c?{label:"Cloud"}:{}};return t.locations.push(h),[f.context,h]}));for(const f of["sandboxes","templates"])for(const h of l[f]??[]){const m=u.get((r=h.location)==null?void 0:r.context);m&&t[f].push({...h,location:m})}}return t}function ju(){var m;const e=Er(),t=!!(e!=null&&e.localViewer),r=t&&e.connected,a=`${t}:${r?(m=e.user)==null?void 0:m.uid:""}`,[l,c]=g.useState(null),[u,f]=g.useReducer(x=>x+1,0);g.useEffect(()=>{let x=!0,p;const b=new AbortController,v=qr("local",b.signal);let j=null;const S=async()=>{var O,k;const N=await Promise.allSettled([v.inventory(),...r?[su("inventory",void 0,{signal:b.signal})]:[]]);if(!x)return;const C=[],E=[];for(let M=0;M<N.length;M++){const A=M===0?"local":"cloud",R=M!==0||!t,z=N[M];if(z.status==="fulfilled")C.push({target:A,cloud:R,inventory:z.value}),(O=z.value.machine)!=null&&O.error&&E.push(z.value.machine.error);else{E.push(`${R?"Cloud":"Local"} inventory unavailable: ${z.reason.message}`);const _=(k=j==null?void 0:j.filter(L=>L.target===A)[0])==null?void 0:k.inventory;if(_){const L=_.locations.map(Y=>({...Y,connected:!1,error:z.reason.message}));C.push({target:A,cloud:R,inventory:{..._,locations:L}})}}}j=C;const T=WK(C);c({scope:a,inventory:T,error:E.join("; ")||null}),p=setTimeout(S,T.templates.some(M=>M.status==="building")?1200:5e3)};return S(),()=>{x=!1,b.abort(),clearTimeout(p)}},[a,u,t,r]);const h=(l==null?void 0:l.scope)===a?l:null;return{...(h==null?void 0:h.inventory)??{sandboxes:[],templates:[],locations:[]},error:(h==null?void 0:h.error)??null,loading:!h,refresh:f}}function QK(){let e=[];const t=new Set,r=new Map,a=()=>t.forEach(u=>u()),l=(u,f)=>{e=e.map(h=>h.id===u?{...h,...typeof f=="function"?f(h):f}:h),a()};function c(u){const f=e.find(p=>p.id===u),{task:h}=r.get(u),m=new AbortController;r.set(u,{task:h,controller:m}),l(u,{status:"preparing",message:"Preparing environment…",error:null,build:null});const x={signal:m.signal,progress:p=>l(u,{message:p}),build:p=>l(u,b=>{var v;return{build:{...p,logs:p.logs??((v=b.build)==null?void 0:v.logs)}}}),creating:()=>l(u,{status:"creating",message:"Creating sandbox…"})};h(x).then(p=>{if(m.signal.aborted)return l(u,{status:"cancelled",message:"Creation cancelled."});l(u,{status:"created",sandbox:{...p,location:p.location??f.location},message:""})}).catch(p=>{m.signal.aborted||p.name==="AbortError"?l(u,{status:"cancelled",message:"Creation cancelled."}):l(u,{status:"failed",error:p.message,message:""})})}return{subscribe:u=>(t.add(u),()=>t.delete(u)),getSnapshot:()=>e,start({name:u,location:f,task:h}){const m=crypto.randomUUID();return e=[...e,{id:m,name:u,location:f,status:"preparing"}],r.set(m,{task:h}),c(m),m},retry(u){r.has(u)&&c(u)},cancel(u){var h,m;const f=e.find(x=>x.id===u);(f==null?void 0:f.status)==="preparing"&&((m=(h=r.get(u))==null?void 0:h.controller)==null||m.abort(),l(u,{message:"Cancelling…"}))},update:l,dismiss(u){r.delete(u),e=e.filter(f=>f.id!==u),a()}}}const vo=QK(),kl="gateway-box",C3=["error","stopped","completed","deleting"],wE=(e,t)=>JSON.stringify([e==null?void 0:e.context,t]),jE=e=>e.status==="created"&&e.phase!=="ready"&&!C3.includes(e.phase);function ZK({jobs:e}){const{sandboxes:t,loading:r}=ju();return g.useEffect(()=>{if(r)return;const a=new Map(t.map(l=>[wE(l.location,l.name),l]));for(const l of e){const c=a.get(wE(l.location,l.name));c?(c.phase!==l.phase||!l.reported)&&vo.update(l.id,{phase:c.phase,reported:!0,sandbox:c}):l.reported&&vo.dismiss(l.id)}},[t,r,e]),null}function SE(e){try{sessionStorage.setItem(kl,JSON.stringify({name:e.name,location:e.location}))}catch{}window.dispatchEvent(new CustomEvent("openrod-navigate",{detail:{view:"sandboxes"}})),window.dispatchEvent(new Event(kl))}function JK({job:e,onClose:t}){const r=g.useRef(null),a=g.useRef(!0),l=e.build;return g.useEffect(()=>{a.current&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[l==null?void 0:l.logs,e.message]),s.jsx(vn,{open:!0,onOpenChange:c=>{c||t()},children:s.jsxs(wn,{className:"flex h-[min(36rem,90svh)] flex-col gap-3 sm:max-w-2xl",children:[s.jsxs(jn,{children:[s.jsxs(bn,{children:["Build logs · ",e.name]}),s.jsx(_n,{children:(l==null?void 0:l.status)==="failed"?"Build failed":e.status==="failed"?"Creation failed":e.status==="cancelled"?"Creation cancelled":(l==null?void 0:l.status)==="ready"?"Build complete":e.message||"Preparing environment…"})]}),(l==null?void 0:l.name)&&s.jsx("p",{className:"truncate font-mono text-[11px] text-muted-foreground",children:l.name}),s.jsx("pre",{ref:r,tabIndex:0,"aria-label":"Build output",onScroll:c=>{const u=c.currentTarget;a.current=u.scrollHeight-u.scrollTop-u.clientHeight<40},className:"min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-all rounded-md border bg-muted/30 p-3 font-mono text-[10px] leading-relaxed",children:(l==null?void 0:l.logs)||((l==null?void 0:l.status)==="ready"?"Using a ready image template. No build was needed.":"Waiting for build output…")}),((l==null?void 0:l.error)||e.error)&&s.jsx("p",{role:"alert",className:"text-xs text-destructive",children:(l==null?void 0:l.error)||e.error})]})})}function eX(){const e=g.useSyncExternalStore(vo.subscribe,vo.getSnapshot),[t,r]=g.useState(null),a=e.filter(c=>c.status==="created"),l=e.find(c=>c.id===t);return s.jsxs(s.Fragment,{children:[a.some(jE)&&s.jsx(ZK,{jobs:a}),e.map(c=>{var p;const u=c.status==="created"&&c.phase==="ready",f=c.status==="created"&&C3.includes(c.phase),h=c.status==="preparing"||c.status==="creating"||jE(c),m=c.build&&s.jsx(ce,{size:"xs",variant:"outline",onClick:()=>r(c.id),children:"Show build"}),x=c.status==="preparing"?{tone:"progress",title:`Preparing ${c.name}…`,body:c.message,actions:s.jsxs(s.Fragment,{children:[m,s.jsx(ce,{size:"xs",variant:"ghost",onClick:()=>vo.cancel(c.id),children:"Cancel"})]})}:c.status==="creating"?{tone:"progress",title:`Creating ${c.name}…`,body:c.message}:c.status==="failed"?{tone:"error",title:`Couldn’t create ${c.name}`,body:c.error,actions:s.jsxs(s.Fragment,{children:[m,s.jsx(ce,{size:"xs",variant:"outline",onClick:()=>vo.retry(c.id),children:"Try again"})]})}:c.status==="cancelled"?{tone:"info",title:`${c.name} not created`,body:"Creation was cancelled."}:u?{tone:"success",title:`${c.name} is ready`,body:"Your sandbox is ready to use.",actions:s.jsxs(ce,{size:"xs",variant:"outline",disabled:((p=c.location)==null?void 0:p.connected)===!1,onClick:()=>SE(c),children:["Open sandbox",s.jsx(Mi,{className:"size-3"})]})}:f?{tone:"error",title:`${c.name} needs attention`,body:`Status: ${Gp[c.phase]}. Open the sandbox to inspect it.`,actions:s.jsxs(ce,{size:"xs",variant:"outline",onClick:()=>SE(c),children:["Open sandbox",s.jsx(Mi,{className:"size-3"})]})}:{tone:"progress",title:`Starting ${c.name}…`,body:"Your new sandbox is starting. You can keep browsing while it gets ready."};return s.jsx(Li,{id:`sandbox-creation:${c.id}`,tone:x.tone,title:x.title,actions:s.jsxs(s.Fragment,{children:[s.jsx(Co,{location:c.location}),x.actions]}),onDismiss:h?void 0:()=>vo.dismiss(c.id),dismissLabel:`Dismiss status for ${c.name}`,children:x.body},c.id)}),l&&s.jsx(JK,{job:l,onClose:()=>r(null)})]})}const k3=g.createContext(void 0);function tX(){return g.useContext(k3)}const nX=g.forwardRef(function(t,r){const{className:a,defaultPressed:l=!1,disabled:c=!1,form:u,onPressedChange:f,pressed:h,render:m,type:x,value:p,nativeButton:b=!0,style:v,...j}=t,S=ms(p||void 0),N=tX(),C=(N==null?void 0:N.value)??[],E=(c||(N==null?void 0:N.disabled))??!1,[T,O]=Wr({controlled:N?S!==void 0&&C.indexOf(S)>-1:h,default:l,name:"Toggle",state:"pressed"}),{getButtonProps:k,buttonRef:M}=oo({disabled:E,native:b}),A={disabled:E,pressed:T},R=[M,r],z=[{"aria-pressed":T,onClick(Y){var U;const P=!T,V=bt(Tr,Y.nativeEvent);f==null||f(P,V),!V.isCanceled&&(S&&((U=N==null?void 0:N.setGroupValue)==null||U.call(N,S,P,V)),!V.isCanceled&&O(P))}},j,k],_=Nt("button",t,{enabled:!N,state:A,ref:R,props:z}),L=g.useMemo(()=>({disabled:E,focusableWhenDisabled:!1}),[E]);return N?s.jsx(FM,{tag:"button",render:m,className:a,style:v,metadata:L,state:A,refs:R,props:z}):_}),sX=g.createContext(void 0);function rX(){return g.useContext(sX)}const oX=g.forwardRef(function(t,r){const{defaultValue:a,disabled:l=!1,loopFocus:c=!0,onValueChange:u,orientation:f="horizontal",multiple:h=!1,value:m,className:x,render:p,style:b,...v}=t,j=_g(),S=rX(),N=a??kr,C=m!==void 0||a!==void 0,E=((j==null?void 0:j.disabled)??!1)||((S==null?void 0:S.disabled)??!1)||l,[T,O]=Wr({controlled:m,default:N,name:"ToggleGroup",state:"value"}),k=Ze((_,L,Y)=>{let P;h?(P=T.slice(),L?P.push(_):P.splice(T.indexOf(_),1)):P=L?[_]:[],u==null||u(P,Y),!Y.isCanceled&&O(P)}),M={disabled:E,multiple:h,orientation:f},A=g.useMemo(()=>({disabled:E,setGroupValue:k,value:T,isValueInitialized:C}),[E,k,T,C]),R={role:"group"},z=Nt("div",t,{enabled:!!j,state:M,ref:r,props:[R,v]});return s.jsx(k3.Provider,{value:A,children:j?z:s.jsx($5,{render:p,className:x,style:b,state:M,refs:[r],props:[R,v],loopFocus:c,enableHomeAndEndKeys:!0,orientation:f})})}),aX=rg("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),T3=g.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function iX({className:e,variant:t,size:r,spacing:a=2,orientation:l="horizontal",children:c,...u}){return s.jsx(oX,{"data-slot":"toggle-group","data-variant":t,"data-size":r,"data-spacing":a,"data-orientation":l,style:{"--gap":a},className:Le("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",e),...u,children:s.jsx(T3.Provider,{value:{variant:t,size:r,spacing:a,orientation:l},children:c})})}function lX({className:e,children:t,variant:r="default",size:a="default",...l}){const c=g.useContext(T3);return s.jsx(nX,{"data-slot":"toggle-group-item","data-variant":c.variant||r,"data-size":c.size||a,"data-spacing":c.spacing,className:Le("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",aX({variant:c.variant||r,size:c.size||a}),e),...l,children:t})}const NE=[{value:"light",label:"Light mode",icon:d6},{value:"dark",label:"Dark mode",icon:DI},{value:"system",label:"Auto · Follow computer",icon:OI}];function cX(){const{theme:e="system",setTheme:t}=hR(),r=lr(),a=Math.max(0,NE.findIndex(l=>l.value===e));return s.jsx(Jg,{delay:200,children:s.jsxs(iX,{"aria-label":"Appearance",value:[e],onValueChange:l=>{l.length&&t(l[0])},spacing:1,className:"relative isolate mb-3 gap-1 rounded-xl border border-sidebar-border bg-background/70 p-1 shadow-[inset_0_1px_3px_#00000008]",children:[s.jsx(Yn.span,{"aria-hidden":"true",initial:!1,animate:{x:a*36},transition:r?{duration:0}:{type:"spring",stiffness:450,damping:32},className:"pointer-events-none absolute left-1 top-1 size-8 rounded-lg border border-border bg-card shadow-[0_2px_4px_#00000014,inset_0_1px_0_var(--button-highlight)]",children:s.jsx(QM,{duration:12,shineColor:["var(--border)","var(--frame-highlight)","var(--ink-faint)"]})}),NE.map(({value:l,label:c,icon:u})=>s.jsxs(Ia,{children:[s.jsx(_a,{render:s.jsx(lX,{value:l,"aria-label":c}),className:Le("relative z-10 size-8 min-w-8 rounded-lg p-0 text-muted-foreground hover:bg-transparent aria-pressed:bg-transparent data-[state=on]:bg-transparent motion-reduce:transition-none",e===l&&"text-foreground"),children:s.jsx(Yn.span,{"aria-hidden":"true",initial:!1,animate:{rotate:e===l&&l==="light"?45:e===l&&l==="dark"?-12:0,scale:e===l?1:.9},transition:{duration:r?0:.22},className:"flex items-center justify-center",children:s.jsx(u,{className:"size-3.5",strokeWidth:1.7})})}),s.jsx(La,{side:"top",children:c})]},l))]})})}const E3=g.createContext(void 0);function Pf(e){const t=g.useContext(E3);if(t===void 0&&!e)throw new Error(Zt(47));return t}const uX={...Rg,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class dX extends bu{constructor(r,a,l){const c=new xf;super(fX(r,c,a,l),mX(c),uX);tn(this,"setOpen",(r,a)=>{var p,b;const l=a.reason===Un,c=a.reason===Jo&&a.event.detail===0,u=!r&&(a.reason===mf||a.reason==null),f=R1(a),h=this.select("activeTriggerId");if(!r&&a.reason===NA&&a.trigger==null&&h!=null&&(a.trigger=this.context.triggerElements.getById(h)??this.select("activeTriggerElement")??void 0),(b=(p=this.context).onOpenChange)==null||b.call(p,r,a),a.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(r,a);const m=()=>{const v=Ng(this.state,r,a.trigger,f());v.openChangeReason=a.reason,this.update(v)};l?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start($A,()=>{this.set("stickIfOpen",!1)}),Xr.flushSync(m)):m();let x;c?x="click":u?x="dismiss":a.reason===Pi&&(x="focus"),this.set("instantType",x)})}}function fX(e,t,r,a=!1){const l={...Eg(t,r,a),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return l.open&&(e==null?void 0:e.mounted)===void 0&&(l.mounted=!0),l}function mX(e){return{popupRef:g.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:g.createRef(),beforeContentFocusGuardRef:g.createRef(),stickIfOpenTimeout:new Kr,triggerElements:e}}const CE=hf(function({props:t}){const{children:r,open:a,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:u,modal:f=!1,handle:h,triggerId:m,defaultTriggerId:x=null}=t,p=pX(h,{modal:f,open:l,openProp:a,activeTriggerId:x,triggerIdProp:m});p.useControlledProp("openProp",a),p.useControlledProp("triggerIdProp",m);const b=p.useState("open"),v=p.useState("mounted"),j=p.useState("payload");p.useContextCallback("onOpenChange",c),p.useContextCallback("onOpenChangeComplete",u),i5(p,b),Cg(p);const{forceUnmount:S}=kg(b,p,()=>{p.update({stickIfOpen:!0,openChangeReason:null})});p.useSyncedValues({modal:f}),g.useEffect(()=>{b||p.context.stickIfOpenTimeout.clear()},[p,b]),g.useImperativeHandle(t.actionsRef,()=>({unmount:S,close:()=>p.setOpen(!1,bt(xg))}),[S,p]);const N=b||v;return s.jsxs(E3.Provider,{value:p,children:[h&&s.jsx(Sg,{handle:h,store:p}),N&&s.jsx(gX,{store:p,modal:f}),typeof r=="function"?r({payload:j}):r]})});function hX(e){return Pf(!0)?s.jsx(CE,{props:e}):s.jsx(WA,{children:s.jsx(CE,{props:e})})}function pX(e,t){const r=E1((a,l)=>new dX(t,a,l));return g.useEffect(()=>r.context.stickIfOpenTimeout.disposeEffect(),[r]),r}function gX({store:e,modal:t}){const r=e.useState("floatingRootContext"),a=pf(r,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),l=a.reference,c=a.floating;return Tg(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:c}),null}const xX=300,bX=v1(function(t,r){const{render:a,className:l,style:c,disabled:u=!1,nativeButton:f=!0,handle:h,payload:m,openOnHover:x=!1,delay:p=xX,closeDelay:b=0,id:v,...j}=t,S=Pf(!0),C=M1(h)??S;if(!C)throw new Error(Zt(74));const E=ms(v),T=C.useState("isTriggerActive",E),O=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",E),M=C.useState("triggerPopupId",E),A=g.useRef(null),{registerTrigger:R,isMountedByThisTrigger:z}=A1(E,A,C,{payload:m,disabled:u,openOnHover:x,closeDelay:b}),_=C.useState("openChangeReason"),L=C.useState("stickIfOpen"),Y=C.useState("openMethod"),P=C.useState("focusManagerModal"),V=I1(O,{enabled:!u&&x&&(Y!=="touch"||_!==Jo),mouseOnly:!0,move:!1,handleClose:_1(),restMs:p,delay:{close:b},triggerElementRef:A,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),U=C1(O,{stickIfOpen:L}),H=j5(()=>C.select("open"),G=>{C.set("openMethod",G)}),F=C.useState("triggerProps",z),{getButtonProps:q,buttonRef:W}=oo({disabled:u,native:f}),B={open(G){return G&&_===Jo?pp.open(G):u1.open(G)}},{preFocusGuardRef:J,handlePreFocusGuardFocus:X,handleFocusTargetFocus:re}=qM(C,A),$=Nt("button",t,{state:{disabled:u,open:k},ref:[W,r,R,A],props:[U.reference,V,F,H,{[VA]:"",id:E,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":M},j,q],stateAttributesMapping:B}),Q=s.jsx(g.Fragment,{children:$},E);return z&&!P?s.jsxs(g.Fragment,{children:[s.jsx(_i,{ref:J,onFocus:X}),Q,s.jsx(_i,{ref:C.context.triggerFocusTargetRef,onFocus:re})]}):Q}),R3=g.createContext(void 0);function yX(){const e=g.useContext(R3);if(e===void 0)throw new Error(Zt(45));return e}const vX=g.forwardRef(function(t,r){const{keepMounted:a=!1,...l}=t;return Pf().useState("mounted")||a?s.jsx(R3.Provider,{value:a,children:s.jsx(vg,{ref:r,...l})}):null}),A3=g.createContext(void 0);function wX(){const e=g.useContext(A3);if(!e)throw new Error(Zt(46));return e}const jX=g.forwardRef(function(t,r){const{render:a,className:l,style:c,anchor:u,positionMethod:f,side:h,align:m,sideOffset:x,alignOffset:p,collisionBoundary:b="clipping-ancestors",collisionPadding:v,arrowPadding:j,sticky:S,disableAnchorTracking:N=!1,collisionAvoidance:C=w1,...E}=t,T=Pf(),O=yX(),k=S1(),M=T.useState("floatingRootContext"),A=T.useState("mounted"),R=T.useState("open"),z=T.useState("openChangeReason"),_=T.useState("activeTriggerElement"),L=T.useState("modal"),Y=T.useState("openMethod"),P=T.useState("positionerElement"),V=T.useState("instantType"),U=T.useState("transitionStatus"),H=T.useState("adaptiveOrigin"),F=g.useRef(null),q=df(P),W=Dg({anchor:u,floatingRootContext:M,positionMethod:f,mounted:A,side:h,sideOffset:x,align:m,alignOffset:p,arrowPadding:j,collisionBoundary:b,collisionPadding:v,sticky:S,disableAnchorTracking:N,keepMounted:O,nodeId:k,collisionAvoidance:C,adaptiveOrigin:H}),B=M.useState("domReferenceElement");qe(()=>{const $=B,Q=F.current;if($&&(F.current=$),Q&&$&&$!==Q){T.set("instantType",void 0);const G=new AbortController;return q(()=>{T.set("instantType","trigger-change")},G.signal),()=>{G.abort()}}},[B,q,T]);const J=L===!0&&z!==Un;$1(R&&J,Y==="touch",P,_);const X=T.useStateSetter("positionerElement"),re={open:R,side:W.side,align:W.align,anchorHidden:W.anchorHidden,instant:V},I=Pg(t,re,{styles:W.positionerStyles,transitionStatus:U,props:E,refs:[r,X],hidden:!A,inert:!R});return s.jsxs(A3.Provider,{value:W,children:[A&&J&&s.jsx(zg,{inert:bf(!R),cutout:_}),s.jsx(XA,{id:k,children:I})]})}),SX=g.createContext(void 0);function NX(){const[e,t]=g.useState(0),r=Ze(()=>(t(l=>l+1),()=>{t(l=>Math.max(0,l-1))}));return{context:g.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}const CX=g.forwardRef(function(t,r){const{render:a,className:l,style:c,initialFocus:u,finalFocus:f,...h}=t,m=Pf(),x=wX(),p=_g()!=null,{context:b,hasClosePart:v}=NX(),j=m.useState("open"),S=m.useState("openMethod"),N=m.useState("instantType"),C=m.useState("transitionStatus"),E=m.useState("popupProps"),T=m.useState("titleElementId"),O=m.useState("descriptionElementId"),k=m.useState("modal"),M=m.useState("mounted"),A=m.useState("openChangeReason"),R=m.useState("activeTriggerElement"),z=m.useState("floatingRootContext"),_=z.useState("floatingId"),L=m.useState("disabled"),Y=m.useState("openOnHover"),P=m.useState("closeDelay");ir({open:j,ref:m.context.popupRef,onComplete(){var W,B;j&&((B=(W=m.context).onOpenChangeComplete)==null||B.call(W,!0))}}),P1(z,{enabled:Y&&!L,closeDelay:P});const V=u===void 0?a5(m.context.popupRef):u,U=k!==!1&&v;m.useSyncedValue("focusManagerModal",U);const H=m.useStateSetter("popupElement"),F={open:j,side:x.side,align:x.align,instant:N,transitionStatus:C},q=Nt("div",t,{state:F,ref:[r,m.context.popupRef,H],props:[E,{id:_,role:"dialog",...gf,"aria-labelledby":T,"aria-describedby":O,onKeyDown(W){p&&wf.has(W.key)&&W.stopPropagation()}},vf(C),h],stateAttributesMapping:dg});return s.jsx(wg,{context:z,openInteractionType:S,modal:U,disabled:!M||A===Un,initialFocus:V,returnFocus:f,restoreFocus:"popup",previousFocusableElement:un(R)?R:void 0,nextFocusableElement:m.context.triggerFocusTargetRef,beforeContentFocusGuardRef:m.context.beforeContentFocusGuardRef,children:s.jsx(SX.Provider,{value:b,children:q})})});function op({...e}){return s.jsx(hX,{"data-slot":"popover",...e})}function ap({...e}){return s.jsx(bX,{"data-slot":"popover-trigger",...e})}function ip({className:e,align:t="center",alignOffset:r=0,side:a="bottom",sideOffset:l=4,...c}){return s.jsx(vX,{children:s.jsx(jX,{align:t,alignOffset:r,side:a,sideOffset:l,className:"isolate z-50",children:s.jsx(CX,{"data-slot":"popover-content",className:hs("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...c})})})}function O3(e){return Nt(e.defaultTagName??"div",e,e)}const gy=768;function kX(){const[e,t]=g.useState(void 0);return g.useEffect(()=>{const r=window.matchMedia(`(max-width: ${gy-1}px)`),a=()=>{t(window.innerWidth<gy)};return r.addEventListener("change",a),t(window.innerWidth<gy),()=>r.removeEventListener("change",a)},[]),!!e}const TX="sidebar_state",EX=3600*24*7,RX="16rem",AX="18rem",OX="3rem",MX="b",M3=g.createContext(null);function qw(){const e=g.useContext(M3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function DX({defaultOpen:e=!0,open:t,onOpenChange:r,className:a,style:l,children:c,...u}){const f=kX(),[h,m]=g.useState(!1),[x,p]=g.useState(e),b=t??x,v=g.useCallback(C=>{const E=typeof C=="function"?C(b):C;r?r(E):p(E),document.cookie=`${TX}=${E}; path=/; max-age=${EX}`},[r,b]),j=g.useCallback(()=>f?m(C=>!C):v(C=>!C),[f,v,m]);g.useEffect(()=>{const C=E=>{E.key===MX&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),j())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[j]);const S=b?"expanded":"collapsed",N=g.useMemo(()=>({state:S,open:b,setOpen:v,isMobile:f,openMobile:h,setOpenMobile:m,toggleSidebar:j}),[S,b,v,f,h,m,j]);return s.jsx(M3.Provider,{value:N,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":RX,"--sidebar-width-icon":OX,...l},className:Le("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...u,children:c})})}function zX({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:a,children:l,dir:c,...u}){const{isMobile:f,state:h,openMobile:m,setOpenMobile:x}=qw();return r==="none"?s.jsx("div",{"data-slot":"sidebar",className:Le("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...u,children:l}):f?s.jsx($l,{open:m,onOpenChange:x,...u,children:s.jsxs(uu,{dir:c,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":AX},side:e,children:[s.jsxs(du,{className:"sr-only",children:[s.jsx(fu,{children:"Sidebar"}),s.jsx(mu,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:l})]})}):s.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[s.jsx("div",{"data-slot":"sidebar-gap",className:Le("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:Le("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...u,children:s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:l})})]})}function PX({className:e,onClick:t,...r}){const{toggleSidebar:a}=qw();return s.jsxs(ce,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Le(e),onClick:l=>{t==null||t(l),a()},...r,children:[s.jsx(LI,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function IX({className:e,...t}){return s.jsx("main",{"data-slot":"sidebar-inset",className:Le("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function _X({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Le("flex flex-col gap-2 p-2",e),...t})}function LX({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Le("flex flex-col gap-2 p-2",e),...t})}function BX({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Le("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function kE({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Le("relative flex w-full min-w-0 flex-col p-2",e),...t})}function TE({className:e,render:t,...r}){return O3({defaultTagName:"div",props:Ys({className:Le("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e)},r),render:t,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function EE({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:Le("w-full text-sm",e),...t})}function RE({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Le("flex w-full min-w-0 flex-col gap-0",e),...t})}function AE({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Le("group/menu-item relative",e),...t})}const $X=rg("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function OE({render:e,isActive:t=!1,variant:r="default",size:a="default",tooltip:l,className:c,...u}){const{isMobile:f,state:h}=qw(),m=O3({defaultTagName:"button",props:Ys({className:Le($X({variant:r,size:a}),c)},u),render:l?s.jsx(_a,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:t}});return l?(typeof l=="string"&&(l={children:l}),s.jsxs(Ia,{children:[m,s.jsx(La,{side:"right",align:"center",hidden:h!=="collapsed"||f,...l})]})):m}const VX=[{label:"Sandboxes",icon:Fl,view:"sandboxes"},{label:"Templates",icon:NI,view:"templates"},{label:"MCPs & Skills",icon:Yv,view:"setups"},{label:"Activity",icon:NP,view:"activity"},{label:"Connections",icon:BP,view:"connections"}],UX=[{label:"Groups",icon:Oa,view:"groups"},{label:"Network",icon:Jp,view:"egress",also:["ingress"]},{label:"Secrets",icon:pu,view:"secrets"}],ME={live:{label:"Live",dot:"bg-emerald-500"},connecting:{label:"Connecting",dot:"bg-amber-400"},reconnecting:{label:"Reconnecting",dot:"bg-amber-400"},"gateway-down":{label:"Unreachable",dot:"bg-red-500"},"setup-required":{label:"Not connected",dot:"bg-muted-foreground"}};function HX({view:e,onNavigate:t}){const{connection:r,overview:a}=qa(),l=ME[r]??ME.connecting,c=a==null?void 0:a.gateway;return s.jsxs(zX,{collapsible:"offcanvas",className:"border-r border-sidebar-border",children:[s.jsx(_X,{className:"h-14 shrink-0 justify-center px-6 py-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"sidebar-icon-hover inline-flex shrink-0",children:s.jsx("img",{src:"/openrod.png",alt:"","aria-hidden":"true",className:"sidebar-icon size-9 object-contain"})}),s.jsxs("span",{className:"flex flex-col leading-none",children:[s.jsx("span",{className:"sidebar-wordmark text-lg font-normal tracking-tight whitespace-nowrap",children:"OpenRod"}),s.jsx("span",{className:"mt-0.5 text-[10px] whitespace-nowrap text-muted-foreground",children:"for OpenShell"})]})]})}),s.jsxs(BX,{className:"px-3 pt-4",children:[s.jsxs(kE,{className:"p-0",children:[s.jsx(TE,{className:"px-3 text-[10px] font-bold tracking-widest text-faint uppercase",children:"Environment"}),s.jsx(EE,{children:s.jsx(RE,{children:VX.map(({label:u,icon:f,view:h})=>s.jsx(AE,{children:s.jsxs(OE,{isActive:e===h,onClick:()=>t(h),children:[s.jsx(f,{}),u]})},h))})})]}),s.jsxs(kE,{className:"p-0 pt-4",children:[s.jsx(TE,{className:"px-3 text-[10px] font-bold tracking-widest text-faint uppercase",children:"Security"}),s.jsx(EE,{children:s.jsx(RE,{children:UX.map(({label:u,icon:f,view:h,also:m=[]})=>s.jsx(AE,{children:s.jsxs(OE,{isActive:e===h||m.includes(e),onClick:()=>t(m.includes(e)?e:h),children:[s.jsx(f,{}),u]})},h))})})]})]}),s.jsxs(LX,{className:"border-t border-sidebar-border p-4",children:[s.jsx(cX,{}),s.jsxs(op,{children:[s.jsxs(ap,{className:"flex w-full items-center gap-2 rounded-md text-left outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","aria-label":"Gateway details",children:[s.jsxs("span",{className:"relative flex size-1.5 shrink-0","aria-hidden":"true",children:[r==="live"&&s.jsx("span",{className:"absolute inline-flex size-full rounded-full bg-emerald-400/55 motion-safe:animate-ping"}),s.jsx("span",{className:`relative inline-flex size-1.5 rounded-full ${l.dot}`})]}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-xs font-medium",children:(c==null?void 0:c.name)??"Gateway"}),s.jsxs("span",{className:"block truncate font-mono text-[10px] text-muted-foreground",children:[l.label,c!=null&&c.version?` · v${c.version}`:""]})]})]}),s.jsxs(ip,{side:"top",align:"start",sideOffset:10,className:"w-64 gap-3 p-4",children:[s.jsxs("p",{className:"flex items-center gap-1.5 text-xs font-medium",children:[s.jsx("span",{className:`size-1.5 rounded-full ${(c==null?void 0:c.status)==="healthy"?"bg-emerald-500":"bg-red-500"}`,"aria-hidden":"true"}),c?c.status==="healthy"?"Healthy":c.status:r==="setup-required"?"No connection selected":a!=null&&a.error?"Unreachable":"Reading…"]}),c?s.jsx("dl",{className:"grid gap-2.5",children:[["Endpoint",c.endpoint,!0],["Authentication",c.authMode==="mtls"?"mTLS":c.authMode],["Runtime",c.drivers.map(u=>`${u.driver}${u.version?` ${u.version}`:""}`).join(", ")||"-",!0],["Registration",c.remote?"Remote":"Local / tunnel endpoint"]].map(([u,f,h])=>s.jsxs("div",{children:[s.jsx("dt",{className:"text-[10px] text-muted-foreground",children:u}),s.jsx("dd",{className:`break-all ${h?"font-mono text-[11px]":"text-xs"}`,children:f})]},u))}):a!=null&&a.error?s.jsx("p",{className:"font-mono text-[10px] text-muted-foreground",children:a.error}):null,s.jsx(FX,{})]})]})]})]})}function FX(){const[e,t]=g.useState(null),[r,a]=g.useState(!1),[l,c]=g.useState(null);if(g.useEffect(()=>{let f=!0;return cs.connections().then(h=>{f&&t(h.active)}).catch(()=>{}),()=>{f=!1}},[]),!e||e.status!=="connected")return null;async function u(){a(!0),c(null);try{await cs.disconnectRemote(),t(null)}catch(f){c(f.message)}finally{a(!1)}}return s.jsxs("div",{className:"grid gap-2 border-t border-border pt-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rf,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-xs font-medium",children:e.host}),s.jsx("span",{className:"block text-[10px] text-muted-foreground",children:"SSH machine · connected"})]}),s.jsx(ce,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:r,onClick:u,children:r?"Disconnecting…":"Disconnect"})]}),l&&s.jsx("p",{role:"alert",className:"text-[10px] text-destructive",children:l})]})}const Ul={local:{id:"local",label:"Local",hint:"Runs on this computer"},remote:{id:"remote",label:"Remote",hint:"Runs on an SSH host"},cloud:{id:"cloud",label:"Cloud",hint:"Runs on a cloud machine"}},lp=e=>{var t;return((t=Ul[e==null?void 0:e.placement])==null?void 0:t.id)??(e!=null&&e.remote?"remote":"local")},xy=({x:e,y:t})=>s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:e-1.6,cy:t,r:".7",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:e+1.6,cy:t,r:".7",fill:"currentColor",stroke:"none"}),s.jsx("path",{d:`M${e-1.1} ${t+1.5}q1.1 1 2.2 0`})]}),GX={local:()=>s.jsxs(s.Fragment,{children:[s.jsx("rect",{x:"2.5",y:"2.5",width:"11",height:"8",rx:"1.8"}),s.jsx("path",{d:"M1 13.5h14"}),s.jsx(xy,{x:8,y:6})]}),remote:()=>s.jsxs(s.Fragment,{children:[s.jsx("rect",{x:"3",y:"5",width:"10",height:"9",rx:"2"}),s.jsx("path",{d:"M5.8 3a3.2 3.2 0 0 1 4.4 0"}),s.jsx("circle",{cx:"8",cy:"1.6",r:".55",fill:"currentColor",stroke:"none",className:"motion-safe:animate-pulse"}),s.jsx(xy,{x:8,y:8.8})]}),cloud:()=>s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M4.5 13.5a3 3 0 0 1-.4-6 4 4 0 0 1 7.7-.7 3.4 3.4 0 0 1-.1 6.7z"}),s.jsx("path",{d:"M13.6 1.2v2M12.6 2.2h2",className:"motion-safe:animate-pulse"}),s.jsx(xy,{x:7.6,y:9.6})]})},qX={local:"bg-indigo-50 text-indigo-700 ring-indigo-200 dark:bg-indigo-500/15 dark:text-indigo-300 dark:ring-indigo-400/30",remote:"bg-fuchsia-50 text-fuchsia-700 ring-fuchsia-200 dark:bg-fuchsia-500/15 dark:text-fuchsia-300 dark:ring-fuchsia-400/30",cloud:"bg-sky-50 text-sky-700 ring-sky-200 dark:bg-sky-500/15 dark:text-sky-300 dark:ring-sky-400/30"};function YX({type:e,className:t="size-3.5"}){const r=GX[e];return s.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:`shrink-0 overflow-visible transition-transform duration-200 motion-safe:group-hover:-translate-y-px motion-safe:group-hover:-rotate-6 ${t}`,children:s.jsx(r,{})})}function D3({type:e,title:t}){return s.jsxs("span",{title:t,className:`inline-flex shrink-0 items-center gap-1 rounded-full py-0.5 pr-2 pl-1.5 text-[11px] font-medium ring-1 ring-inset ${qX[e]}`,children:[s.jsx(YX,{type:e}),Ul[e].label]})}function z3({location:e}){const t=lp(e);return s.jsx(D3,{type:t,title:`${Ul[t].hint} · ${ws(e)}`})}const KX=864e5;function XX(e,t,r){const a=e.map(f=>Date.parse(f.createdAt)).filter(Number.isFinite).sort((f,h)=>f-h),l=e.length-a.length,c=[];let u=0;for(let f=t-1;f>=0;f--){const h=r-f*KX;for(;u<a.length&&a[u]<=h;)u++;c.push({at:h,count:u+l})}return c}const WX=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"});function QX({points:e,height:t=34,title:r}){const a=g.useRef(null),l=g.useId(),c=lr(),[u,f]=g.useState(280),[h,m]=g.useState(null);g.useLayoutEffect(()=>{const O=a.current;if(!O)return;const k=()=>f(O.clientWidth);k();const M=new ResizeObserver(k);return M.observe(O),()=>M.disconnect()},[]);const x=Math.max(4,Math.round(t*.18)),p=e.map(O=>O.count),b=Math.max(1,...p),v=O=>(e.length<2?u-12:O/(e.length-1)*(u-12))+6,j=O=>t-x-O/b*(t-x*2),S=zM(p.map((O,k)=>[v(k),j(O)])),N=`${S} L${v(e.length-1).toFixed(2)} ${t} L${v(0).toFixed(2)} ${t} Z`,C=h===null?null:e[h],E=p[0]??0,T=p[p.length-1]??0;return s.jsxs("div",{className:"relative w-full",onMouseLeave:()=>m(null),onMouseMove:O=>{const k=O.currentTarget.getBoundingClientRect(),M=(O.clientX-k.left)/Math.max(1,k.width);m(Math.min(e.length-1,Math.max(0,Math.round(M*(e.length-1)))))},children:[s.jsx("h2",{className:"min-w-0 truncate text-[10px] font-bold tracking-widest text-faint uppercase",children:C?s.jsxs("span",{className:"font-mono normal-case tracking-normal text-muted-foreground",children:[WX(C.at)," · ",C.count.toLocaleString("en-US")," ",C.count===1?"box":"boxes"]}):r}),s.jsx("div",{ref:a,className:"w-full",children:s.jsxs("svg",{width:u,height:t,role:"img","aria-label":`${E} boxes ${e.length} days ago, ${T} now`,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:l,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:"var(--ink)",stopOpacity:"0.1"}),s.jsx("stop",{offset:"100%",stopColor:"var(--ink)",stopOpacity:"0"})]})}),s.jsx("path",{d:N,fill:`url(#${l})`}),s.jsx(Yn.path,{d:S,fill:"none",stroke:"var(--ink)",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",opacity:"0.72",initial:c?!1:{pathLength:0},animate:{pathLength:1},transition:{duration:.9,ease:"easeOut"}}),C&&s.jsxs("g",{children:[s.jsx("line",{x1:v(h),x2:v(h),y1:"0",y2:t,stroke:"var(--ink)",strokeWidth:"1",strokeDasharray:"2 3",opacity:"0.25"}),s.jsx("circle",{cx:v(h),cy:j(p[h]),r:"3",fill:"var(--surface)",stroke:"var(--ink)",strokeWidth:"1.5"})]})]})})]})}const ZX=e=>e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"",JX={policy_dns_ineligible:"no rule allows this host",transparent_tcp_policy_denied:"no rule allows this connection"},eW=e=>e?JX[e]??e:null;function tW({event:e,dense:t=!1,showSandbox:r=!1}){var l;const a=e.verdict==="denied";return s.jsxs("div",{className:`flex items-center gap-3 border-b border-border/50 px-3 font-mono text-[11px] last:border-b-0 ${t?"h-[26px]":"h-[30px] px-4"} ${a?"bg-red-50/40":""}`,title:e.message,children:[s.jsx("span",{className:"w-[4.5rem] shrink-0 tabular-nums text-muted-foreground",children:ZX(e.at)}),s.jsx("span",{className:`w-12 shrink-0 text-[10px] font-medium tracking-wide uppercase ${a?"text-red-600":"text-emerald-700"}`,children:a?"Denied":"Allowed"}),r&&s.jsx("span",{className:"hidden w-24 shrink-0 truncate text-muted-foreground md:block",children:e.sandbox}),!t&&s.jsx("span",{className:"hidden w-20 shrink-0 truncate text-muted-foreground lg:block",children:e.binary?e.binary.split("/").pop():e.category==="HTTP"?e.method:"-"}),s.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[e.method&&t?`${e.method} `:"",e.destination??e.detail]}),!t&&s.jsx("span",{className:"hidden w-56 shrink-0 truncate text-right text-[10px] text-muted-foreground xl:block",children:a?eW(e.reason):(l=e.policy)==null?void 0:l.replace(/^_provider_/,"provider · ")})]})}function ef({command:e,label:t}){const[r,a]=g.useState(!1);return s.jsxs("div",{className:"flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted/40 py-1.5 pr-1.5 pl-3",children:[s.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-[11px]",title:t?void 0:e,children:t??e}),s.jsx(ce,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Copy command",onClick:async()=>{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)},children:r?s.jsx(qn,{className:"size-3.5 text-emerald-600"}):s.jsx(Zp,{className:"size-3.5"})})]})}function Yw(e=[],t){const r=Dw(t);return e.filter(a=>!a.appliesTo.everyone&&a.appliesTo.groups.some(l=>r.includes(l)))}function Kw(){const[e,t]=g.useState(null),[r,a]=g.useState(""),l=g.useRef(null),c=g.useRef(!0),u=g.useCallback((x,p,b=!0)=>{const v=l.current;v&&(l.current=null,v.cleanup(),b&&t(null),p?v.reject(p):v.resolve(x))},[]),f=g.useCallback(()=>u(void 0,new DOMException("Workspace transfer cancelled.","AbortError")),[u]);g.useEffect(()=>(c.current=!0,()=>{c.current=!1,u(void 0,new DOMException("Workspace transfer cancelled.","AbortError"),!1)}),[u]);const h=g.useCallback(async(x,p,b)=>{b==null||b.throwIfAborted();const v=await x.org();if(!c.current)throw new DOMException("Workspace transfer cancelled.","AbortError");b==null||b.throwIfAborted();const j=(v.groups??[]).filter(S=>Yw(v.policies??[],[S.id]).length>0);if(!j.length)throw new Error(`Add a group with a network rule in ${p} before copying this workspace.`);if(j.length!==1){if(l.current)throw new Error("Finish the current workspace transfer first.");return a(""),t({groups:j,label:p}),new Promise((S,N)=>{const C=()=>u(void 0,new DOMException("Workspace transfer cancelled.","AbortError"));l.current={resolve:S,reject:N,cleanup:()=>b==null?void 0:b.removeEventListener("abort",C)},b==null||b.addEventListener("abort",C,{once:!0}),b!=null&&b.aborted&&C()})}},[u]),m=s.jsx(vn,{open:!!e,onOpenChange:x=>{x||f()},children:s.jsxs(wn,{className:"sm:max-w-md",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"Choose a destination group"}),s.jsxs(_n,{children:["The copied sandbox inherits this group’s network rules in ",e==null?void 0:e.label,"."]})]}),s.jsxs(cn,{"aria-label":"Destination sandbox group",value:r,onChange:x=>a(x.target.value),className:"h-9 rounded-md border bg-background px-2 text-sm",children:[s.jsx("option",{value:"",children:"Choose a group"}),e==null?void 0:e.groups.map(x=>s.jsx("option",{value:x.id,children:x.name},x.id))]}),s.jsxs(ea,{children:[s.jsx(ce,{variant:"ghost",onClick:f,children:"Cancel"}),s.jsx(ce,{disabled:!(e!=null&&e.groups.some(x=>x.id===r)),onClick:()=>u([r]),children:"Copy workspace"})]})]})});return{chooseGroups:h,dialog:m,cancel:f}}const Kp="http://127.0.0.1:4600",nW=e=>`${Kp}/?handoff=cloud&target=local#cloud-return=${encodeURIComponent(e)}`;function DE(e,t,r,a){var l;return!!(t&&e.source===t&&e.origin===Kp&&((l=e.data)==null?void 0:l.type)===a&&e.data.nonce===r)}function sW({children:e,className:t,variant:r="outline",size:a="sm"}){return s.jsx(Jg,{delay:200,children:s.jsxs(Ia,{children:[s.jsxs(_a,{render:s.jsx(ce,{type:"button",variant:r,size:a,disabled:!0,focusableWhenDisabled:!0,className:Le("cursor-not-allowed opacity-50",t)}),children:[e,s.jsxs("span",{className:"sr-only",children:[" ",qc]})]}),s.jsx(La,{side:"bottom",className:"max-w-60",children:qc})]})})}function rW({name:e,sandbox:t}){const r=$t(),a=Er(),l=Cn(),{locations:c,refresh:u}=ju(),{chooseGroups:f,dialog:h}=Kw(),m=g.useRef(null);g.useEffect(()=>()=>{var j;return(j=m.current)==null?void 0:j.abort()},[]);const[x,p]=g.useState(null),b=g.useRef(null);if(g.useEffect(()=>{let j=!0;const S=async C=>{const E=b.current;if(E){if(DE(C,E.popup,E.nonce,"openrod-local-result")&&E.accepted){if(j){if(typeof C.data.error=="string")He.error("Couldn’t continue locally",{description:C.data.error});else if(typeof C.data.name=="string")He.success("Workspace ready locally",{description:C.data.warning||E.warning||"Reconnect your agent credentials locally to continue."});else return;p(null)}b.current=null;return}if(!(E.accepted||!DE(C,E.popup,E.nonce,"openrod-local-ready"))){E.accepted=!0,p("transfer");try{const T=await r.cloudExport(E.name);E.warning=T.warning,E.popup.postMessage({type:"openrod-local-bundle",nonce:E.nonce,bundle:T.bundle,warning:T.warning},Kp)}catch(T){E.popup.postMessage({type:"openrod-local-bundle",nonce:E.nonce,error:T.message},Kp),b.current===E&&(b.current=null),j&&(p(null),He.error("Couldn’t continue locally",{description:T.message}))}}}};window.addEventListener("message",S);const N=setInterval(()=>{const C=b.current;C&&(C.popup.closed||Date.now()>C.expires)&&(b.current=null,p(null),C.popup.closed||He.error("Local transfer timed out. Try again."))},1e3);return()=>{j=!1,window.removeEventListener("message",S),clearInterval(N),b.current=null}},[e,r]),(t==null?void 0:t.phase)!=="ready")return null;async function v(){if(x||(l==null?void 0:l.connected)===!1)return;const j=c.find(C=>C.target!=="cloud"&&!C.remote&&C.connected);if(!j){He.error("Connect a local gateway before importing this workspace.");return}const S=new AbortController;m.current=S;const N=r.signal?AbortSignal.any([r.signal,S.signal]):S.signal;p("transfer");try{const C=qr("local",N,j.context);p("groups");const E=await f(C,"local OpenRod",N);p("transfer");const T=await dP(qr(r.target,N,l==null?void 0:l.context),C,e,E);N.throwIfAborted(),He.success("Workspace running locally",{description:T.warning||"Your cloud source is unchanged. Reconnect agent credentials locally."});try{sessionStorage.setItem("gateway-box",JSON.stringify({name:T.name,context:j.context,target:"local"}))}catch{}u(),a.selectTarget("local"),window.dispatchEvent(new CustomEvent("openrod-sandbox-handoff",{detail:{name:T.name,context:j.context,target:"local"}}))}catch(C){C.name!=="AbortError"&&He.error("Couldn’t import locally",{description:C.message})}finally{S.signal.aborted||p(null),m.current===S&&(m.current=null)}}return a!=null&&a.localViewer&&!Ko?s.jsxs(sW,{className:"w-full justify-start text-xs",children:[s.jsx(dp,{className:"size-3.5","aria-hidden":"true"}),"Import and run locally"]}):s.jsxs("div",{className:"flex items-center gap-1",children:[h,s.jsxs(ce,{variant:"outline",size:"sm",className:"flex-1 justify-start text-xs",disabled:!!x||(l==null?void 0:l.connected)===!1,onClick:()=>{if(a!=null&&a.localViewer){v();return}const j=crypto.randomUUID(),S=window.open(nW(j),"_blank");if(!S){He.error("Allow popups to continue locally.");return}b.current={popup:S,nonce:j,name:e,accepted:!1,expires:Date.now()+40*6e4},p("connect")},children:[x?s.jsx(zt,{className:"size-3.5"}):s.jsx(dp,{className:"size-3.5","aria-hidden":"true"}),x==="connect"?"Connecting to local OpenRod…":x==="groups"?"Choose destination group…":x==="transfer"?"Copying and rebuilding…":"Import and run locally"]}),s.jsx(Jg,{delay:200,children:s.jsxs(Ia,{children:[s.jsx(_a,{render:s.jsx(ce,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"What this does",className:"text-muted-foreground"}),children:s.jsx(ru,{className:"size-3.5","aria-hidden":"true"})}),s.jsxs(La,{side:"bottom",className:"max-w-60",children:[a!=null&&a.localViewer?"Creates a separate local sandbox, copies files and rebuilds the image for this computer. Your cloud source stays available.":"Open OpenRod on this computer first. Creates a local sandbox, copies files and rebuilds saved templates."," Reconnect agents locally."]})]})})]})}const Sa="/sandbox",zE=1024**3;function sr(e){if(e==null||!Number.isFinite(e))return"-";if(e<1024)return`${e} B`;const t=["KB","MB","GB","TB"];let r=e/1024,a=0;for(;r>=1024&&a<t.length-1;)r/=1024,a++;return`${r>=10?Math.round(r):r.toFixed(1)} ${t[a]}`}function hu(e){return/^[\w@%+=:,./~-]+$/.test(e)?e:`'${e.replaceAll("'","'\\''")}'`}const P3=e=>e.startsWith("~/")?`~/${hu(e.slice(2))}`:hu(e),Bv=(e,t,r=Sa)=>`openshell sandbox upload ${hu(e)} ${P3(t)} ${hu(r)}`,oW=(e,t,r=".")=>`openshell sandbox download ${hu(e)} ${hu(t)} ${P3(r)}`,cp=new Set(["waiting","uploading","cloning"]),aW=(e,t)=>e==="/"?`/${t}`:`${e}/${t}`,Ch=e=>e.type==="dir"||e.targetType==="dir";function iW(e){const t=[...e.items??[]].map(r=>{var a;return(a=r.webkitGetAsEntry)==null?void 0:a.call(r)}).filter(Boolean);return t.length?t:[...e.files]}async function lW(e){const t=[];async function r(a,l){if(a instanceof window.File){t.push({path:a.name,file:a});return}if(a.isFile)t.push({path:l+a.name,file:await new Promise((c,u)=>a.file(c,u))});else if(a.isDirectory){const c=a.createReader();for(;;){const u=await new Promise((f,h)=>c.readEntries(f,h));if(!u.length)break;for(const f of u)await r(f,`${l}${a.name}/`)}}}for(const a of e)await r(a,"");return t}function cW({seed:e,onRetry:t}){if(!e)return null;const r=e.kind==="folder"?"Uploading":"Cloning";return cp.has(e.state)?s.jsxs("p",{className:"flex items-center gap-2 border-b border-border bg-muted/30 px-5 py-2 text-xs",children:[s.jsx(zt,{"aria-hidden":"true"}),e.state==="waiting"?"Waiting for the sandbox to start, then "+r.toLowerCase():r,s.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e.source}),"→",s.jsx("span",{className:"font-mono text-[11px]",children:e.dest})]}):e.state==="failed"?s.jsxs("div",{role:"alert",className:"flex items-start gap-3 border-b border-red-200 bg-red-50/60 px-5 py-2.5 text-xs text-red-700",children:[s.jsx(Va,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"font-medium",children:[e.kind==="folder"?"Upload":"Clone"," of ",s.jsx("span",{className:"font-mono text-[11px]",children:e.source})," failed"]}),s.jsx("p",{className:"mt-0.5 text-[11px]",children:e.error})]}),s.jsx(ce,{variant:"outline",size:"sm",onClick:t,className:"shrink-0",children:"Retry"})]}):s.jsxs("p",{className:"flex items-center gap-2 border-b border-border px-5 py-2 text-[11px] text-muted-foreground",children:[s.jsx(mI,{className:"size-3.5 shrink-0","aria-hidden":"true"}),"Started from ",s.jsx("span",{className:"min-w-0 truncate font-mono",children:e.source}),e.files!=null&&s.jsxs("span",{children:["· ",e.files.toLocaleString()," files, ",sr(e.bytes)]}),s.jsxs("span",{children:["→ ",s.jsx("span",{className:"font-mono",children:e.dest})]})]})}function uW(e){const t=Cn();return s.jsx(dW,{...e},`${(t==null?void 0:t.id)??(t==null?void 0:t.context)??"default"}:${e.sandbox.name}`)}function dW({sandbox:e,demo:t}){const r=$t(),a=Cn(),l=e.name,c=e.phase==="ready",u=HG(e),[f,h]=g.useState(u?`${Sa}/${u}`:Sa),[m,x]=g.useState(null),[p,b]=g.useState(null),[v,j]=g.useState(!1),[S,N]=g.useState(null),[C,E]=g.useState(!1),[T,O]=g.useState(null),[k,M]=g.useState(null),[A,R]=g.useState(null),z=g.useRef(null),_=g.useCallback(async B=>{j(!0);try{const J=await r.files(l,B);x(J),b(null),J.path!==B&&h(J.path)}catch(J){if(B!==Sa&&/does not exist/.test(J.message)){h(Sa);return}b(J.message)}finally{j(!1)}},[l,r]);g.useEffect(()=>{c&&!t&&_(f)},[f,c,t,_]);const L=S==null?void 0:S.state;g.useEffect(()=>{if(t)return;let B=!1,J;const X=async()=>{try{const re=await r.seed(l);if(B)return;N(re),re&&cp.has(re.state)&&(J=setTimeout(X,2e3))}catch{}};return(!S||cp.has(L))&&X(),()=>{B=!0,clearTimeout(J)}},[l,t,L,r]);const Y=g.useRef(null);g.useEffect(()=>{if(cp.has(Y.current)&&L==="done"&&c){const B=u?`${Sa}/${u}`:f;B!==f?h(B):_(f)}Y.current=L},[L]);async function P(){try{N(await r.retrySeed(l))}catch(B){He.error(B.message)}}async function V(B,J){R(B);const X=He.loading(`Preparing ${J}…`);try{const{token:re,filename:I,bytes:$}=await r.prepareDownload(l,B),Q=document.createElement("a");Q.href=r.url(`/downloads/${re}`,{context:await r.contextKey(),...a?{location:"1"}:{}}),Q.download=I,document.body.append(Q),Q.click(),Q.remove(),He.success(`Downloading ${I}`,{id:X,description:sr($)})}catch(re){He.error(re.message,{id:X})}finally{R(null)}}function U(B){if(!B.length){He.error("Nothing to upload. Empty folders are skipped.");return}const J=B.reduce(($,Q)=>$+Q.file.size,0);if(J>zE){He.error(`That is ${sr(J)}; the console uploads up to ${sr(zE)}.`,{description:`From a terminal: ${Bv(l,"./my-files",f)}`});return}if(m&&J>m.free){He.error(`The sandbox has ${sr(m.free)} free; this is ${sr(J)}.`);return}const re=[...new Set(B.map($=>$.path.split("/")[0]))].filter($=>m==null?void 0:m.entries.some(Q=>Q.name===$)),I={files:B,bytes:J,dir:f,taken:re};re.length?M(I):H(I)}async function H({files:B,bytes:J,dir:X}){M(null);const re=new AbortController;let I;O({done:0,total:B.length,sent:0,bytes:J,committing:!1,controller:re});try{({id:I}=await r.startUpload(l));let $=0;await Promise.all(Array.from({length:Math.min(4,B.length)},async()=>{for(;$<B.length&&!re.signal.aborted;){const G=B[$++];try{await r.uploadFile(l,I,G.path,G.file,re.signal)}catch(se){throw re.abort(),se}O(se=>se&&{...se,done:se.done+1,sent:se.sent+G.file.size})}})),O(G=>G&&{...G,committing:!0});const Q=await r.commitUpload(l,I,X);He.success(`Uploaded ${Q.files.toLocaleString()} ${Q.files===1?"file":"files"} to ${Q.dest}`,{description:sr(Q.bytes)}),X===f&&_(f)}catch($){I&&r.cancelUpload(l,I).catch(()=>{}),He.error(re.signal.aborted&&$.name==="AbortError"?"Upload cancelled.":$.message)}finally{O(null)}}async function F(B){if(B.preventDefault(),E(!1),!c||T)return;const J=iW(B.dataTransfer);try{U(await lW(J))}catch(X){He.error(`Could not read the dropped files: ${X.message}`)}}if(t)return s.jsx("p",{className:"p-5 text-sm text-muted-foreground",children:"Files are unavailable for synthetic sandboxes."});const q=f.split("/").filter(Boolean).map((B,J,X)=>({label:B,path:`/${X.slice(0,J+1).join("/")}`})),W=(m==null?void 0:m.path)===f?m.entries:[];return s.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",onDragOver:B=>{c&&!T&&Array.from(B.dataTransfer.types).includes("Files")&&(B.preventDefault(),E(!0))},onDragLeave:B=>{B.currentTarget.contains(B.relatedTarget)||E(!1)},onDrop:F,children:[s.jsx(cW,{seed:S,onRetry:P}),s.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border px-5 py-2",children:[s.jsx("nav",{"aria-label":"Folder",className:"flex min-w-0 flex-1 items-center gap-0.5 font-mono text-[11px]",children:q.map((B,J)=>s.jsxs(g.Fragment,{children:[J>0&&s.jsx(Hr,{className:"size-3 shrink-0 text-muted-foreground","aria-hidden":"true"}),J===q.length-1?s.jsx("span",{className:"truncate px-1 text-foreground","aria-current":"page",children:B.label}):s.jsx("button",{type:"button",onClick:()=>h(B.path),className:"truncate rounded px-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:B.label})]},B.path))}),m&&s.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[sr(m.free)," free"]}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",disabled:!c||v,onClick:()=>_(f),children:s.jsx($a,{className:v?"animate-spin":void 0,"aria-hidden":"true"})}),s.jsxs(ce,{variant:"outline",size:"sm",disabled:!c||!!A,onClick:()=>V(f,`${f.split("/").pop()}.tar.gz`),children:[A===f?s.jsx(zt,{"aria-hidden":"true"}):s.jsx(Yc,{"aria-hidden":"true"}),"Download folder"]}),s.jsxs(ce,{variant:"outline",size:"sm",disabled:!c||!!T,onClick:()=>{var B;return(B=z.current)==null?void 0:B.click()},children:[s.jsx(x6,{"aria-hidden":"true"}),"Upload"]}),s.jsx("input",{ref:z,type:"file",multiple:!0,hidden:!0,onChange:B=>{const J=[...B.target.files].map(X=>({path:X.name,file:X}));B.target.value="",U(J)}})]}),T&&s.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border bg-muted/30 px-5 py-2 text-xs",role:"status",children:[s.jsx(zt,{"aria-hidden":"true"}),s.jsx("span",{className:"flex-1",children:T.committing?`Sending ${T.total.toLocaleString()} ${T.total===1?"file":"files"} to ${f}…`:`Reading ${T.done.toLocaleString()} of ${T.total.toLocaleString()} files · ${sr(T.sent)} of ${sr(T.bytes)}`}),!T.committing&&s.jsxs(ce,{variant:"ghost",size:"sm",onClick:()=>T.controller.abort(),children:[s.jsx(En,{"aria-hidden":"true"}),"Cancel"]})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:c?p?s.jsx("p",{role:"alert",className:"p-5 text-sm text-destructive",children:p}):m?s.jsxs("ul",{"aria-label":`Files in ${f}`,className:"divide-y divide-border/60",children:[f!==Sa&&s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>h(f.slice(0,f.lastIndexOf("/"))||"/"),className:"flex w-full items-center gap-2 px-5 py-1.5 text-left font-mono text-xs text-muted-foreground hover:bg-muted/50",children:[s.jsx(lC,{className:"size-3.5","aria-hidden":"true"}),".."]})}),W.map(B=>{const J=aW(f,B.name),X=B.type==="link"?OR:Ch(B)?lC:dI,re=s.jsxs(s.Fragment,{children:[s.jsx(X,{className:`size-3.5 shrink-0 ${Ch(B)?"text-sky-600":"text-muted-foreground"}`,"aria-hidden":"true"}),s.jsx("span",{className:"truncate",children:B.name}),B.target&&s.jsxs("span",{className:"truncate text-muted-foreground",children:["→ ",B.target]})]});return s.jsxs("li",{className:"group flex items-center gap-3 px-5 py-1 hover:bg-muted/50",children:[Ch(B)?s.jsx("button",{type:"button",onClick:()=>h(J),className:"flex min-w-0 flex-1 items-center gap-2 py-0.5 text-left font-mono text-xs",children:re}):s.jsx("span",{className:"flex min-w-0 flex-1 items-center gap-2 py-0.5 font-mono text-xs",children:re}),s.jsx("span",{className:"w-16 shrink-0 text-right text-[11px] text-muted-foreground",children:B.size!=null?sr(B.size):""}),s.jsx("span",{className:"hidden w-16 shrink-0 text-right text-[11px] text-muted-foreground sm:block",title:B.modifiedAt,children:xu(B.modifiedAt)}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":`Download ${B.name}`,className:"opacity-60 group-hover:opacity-100",disabled:!!A||B.targetType==="missing",onClick:()=>V(J,Ch(B)?`${B.name}.tar.gz`:B.name),children:A===J?s.jsx(zt,{"aria-hidden":"true"}):s.jsx(Yc,{"aria-hidden":"true"})})]},B.name)}),!W.length&&s.jsx("li",{className:"px-5 py-3 text-xs text-muted-foreground",children:"This folder is empty. Drop files here to upload them."}),m.truncated&&s.jsxs("li",{className:"px-5 py-2 text-[11px] text-muted-foreground",children:["Showing the first ",W.length.toLocaleString()," entries."]})]}):s.jsx("p",{className:"p-5 text-sm text-muted-foreground",children:"Loading files…"}):s.jsx("p",{className:"p-5 text-sm text-muted-foreground",children:"Start the sandbox to browse its files."})}),s.jsxs("div",{className:"shrink-0 space-y-1.5 border-t border-border bg-muted/20 px-5 py-3",children:[s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Drop files or folders anywhere here to upload into this folder. Only /sandbox is reachable; symlinks stay links. From a terminal:"}),s.jsxs("div",{className:"grid gap-1.5 lg:grid-cols-2",children:[s.jsx(ef,{command:Bv(l,"./my-files",f)}),s.jsx(ef,{command:oW(l,f,".")})]})]}),C&&s.jsxs("div",{className:"pointer-events-none absolute inset-2 flex items-center justify-center rounded-lg border-2 border-dashed border-sky-500 bg-background/85 text-sm",children:["Drop to upload into ",s.jsx("span",{className:"ml-1 font-mono",children:f})]}),s.jsx(Qr,{open:!!k,onOpenChange:B=>{B||M(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Replace ",(k==null?void 0:k.taken.length)===1?`“${k.taken[0]}”`:`${k==null?void 0:k.taken.length} items`,"?"]}),s.jsxs(no,{children:[(k==null?void 0:k.taken.length)>1&&s.jsxs("span",{className:"mb-2 block font-mono text-[11px]",children:[k.taken.slice(0,6).join(", "),k.taken.length>6?", …":""]}),"Files with the same name in ",k==null?void 0:k.dir," are replaced. Folders are merged: matching files inside are replaced, and nothing is deleted."]})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsx(so,{onClick:()=>H(k),children:"Replace"})]})]})})]})}function up({agent:e={name:"Not reported"}}){return s.jsxs("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5 align-middle",title:`AI agent: ${e.name}`,children:[e.logo?s.jsx("img",{src:e.logo,alt:"",className:"size-3.5 shrink-0 object-contain"}):s.jsx(CR,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground",strokeWidth:1.5}),s.jsx("span",{className:"truncate",children:e.name})]})}function PE({agents:e=[],status:t="Agent inventory not checked"}){return e.length?s.jsx("span",{title:t,className:"flex min-w-0 flex-col items-start gap-1.5",children:e.map(r=>s.jsx(up,{agent:r},r.name))}):s.jsx("span",{className:"text-muted-foreground",children:t})}function Tl({title:e,icon:t,children:r,aside:a,className:l}){return s.jsxs("section",{className:l,children:[s.jsxs("h3",{className:"mb-2 flex items-center gap-1.5 text-sm font-medium text-foreground",children:[t&&s.jsx(t,{className:"size-3","aria-hidden":"true"}),e,a&&s.jsx("span",{className:"ml-auto font-normal normal-case tracking-normal",children:a})]}),r]})}function fW(){const e=$t(),t=Er(),r=!!(t!=null&&t.nativeActions),[a,l]=g.useState([]);return g.useEffect(()=>{if(!r)return;let c=!1,u,f;const h=()=>{f??(f=e.editors().then(m=>m.filter(x=>x.installed))),f.then(m=>{c||l(m)}).catch(()=>{f=void 0,c||(u=setTimeout(h,3e3))})};return h(),()=>{c=!0,clearTimeout(u)}},[r,e]),a}function mW({name:e,editors:t,cloud:r,context:a,cursorAgent:l=!1}){var z;const c=$t(),[u,f]=g.useState(null),[h,m]=g.useState(null),[x,p]=g.useState("ssh"),[b,v]=g.useState(!1),[j,S]=g.useState(!1),[N,C]=g.useState(null);g.useEffect(()=>{if(r)return;let _=!1;return f(null),m(null),p("ssh"),C(null),c.sshConnection(e).then(L=>{_||(f(L),p(L.defaultMode))}).catch(L=>{_||m(L.message)}),()=>{_=!0}},[e,r,c]);const E=(u==null?void 0:u.modes[x])??(u==null?void 0:u.modes.ssh),T=x==="ssh"?"Open SSH in terminal":x==="attach"?"Attach canonical TTY":`New ${((z=TM(E==null?void 0:E.session))==null?void 0:z.toLowerCase())??"session"}`,O=h||(u?u.cliInstalled?u.sshInstalled?u.terminalSupported?null:"Opening a system terminal is supported on macOS and Linux.":"Install OpenSSH to connect.":"Install the openshell CLI to connect.":"Checking connection…");async function k(_){v(!0);try{await c.openEditor(e,_.id),He.success(`Opening ${e} in ${_.label}`)}catch(L){He.error(`Couldn’t open ${_.label}`,{description:L.message})}finally{v(!1)}}async function M(){v(!0);try{await c.openSshTerminal(e,x),He.success(x==="ssh"?`Opening SSH to ${e}`:x==="attach"?`Attaching to ${e}`:`Starting a new session in ${e}`)}catch(_){He.error("Couldn’t open SSH terminal",{description:_.message})}finally{v(!1)}}async function A(){S(!0);try{C(await c.sshConfig(e))}catch(_){He.error("Couldn’t generate SSH config",{description:_.message})}finally{S(!1)}}const R=s.jsxs(ce,{variant:"outline",size:"sm",className:"justify-start text-xs",nativeButton:!1,disabled:!r&&(!(a!=null&&a.name)||!(a!=null&&a.workspace)),render:s.jsx("a",{href:r||a!=null&&a.name&&(a!=null&&a.workspace)?Bp(e,void 0,a):void 0,target:"_blank",rel:"noreferrer"}),children:[s.jsx(qv,{className:"size-3.5"}),"Browser"]});return r?s.jsx(Tl,{title:"Open in",children:s.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:R})}):s.jsxs(s.Fragment,{children:[s.jsxs(Tl,{title:"Open in",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[s.jsxs(ce,{variant:"outline",size:"sm",className:"justify-start text-xs",disabled:!(u!=null&&u.canOpenTerminal)||b,title:O??T,onClick:M,children:[b?s.jsx(zt,{className:"size-3.5"}):s.jsx(zR,{className:"size-3.5"}),"Terminal"]}),[...l?[{id:"cursor",label:"Cursor"}]:[],{id:"vscode",label:"VS Code"}].map(_=>{const L=t.some(Y=>Y.id===_.id);return s.jsxs(ce,{variant:"outline",size:"sm",className:"justify-start text-xs",disabled:!L||b,title:L?"Connects over SSH through OpenShell. The first time, OpenShell adds one Include line to ~/.ssh/config.":`${_.label} is not installed.`,onClick:()=>k(_),children:[s.jsx("img",{src:`/logos/${_.id}.svg`,alt:"",className:"size-3.5 dark:invert"}),_.label]},_.id)}),R]}),O&&s.jsx("p",{role:h?"alert":"status",className:"mt-2 text-[11px] text-muted-foreground",children:O}),u&&s.jsxs("details",{className:"group mt-2 text-[11px] text-muted-foreground",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1 py-1 hover:text-foreground [&::-webkit-details-marker]:hidden",children:[s.jsx(Hr,{className:"size-3 transition-transform group-open:rotate-90","aria-hidden":"true"}),"Connection options"]}),s.jsxs("div",{className:"mt-1.5 space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap gap-1 rounded-md bg-muted p-1",children:[s.jsx(ce,{type:"button",variant:x==="ssh"?"secondary":"ghost",size:"xs",onClick:()=>p("ssh"),children:"SSH shell"}),s.jsx(ce,{type:"button",variant:x==="exec"?"secondary":"ghost",size:"xs",onClick:()=>p("exec"),children:"New session"}),u.modes.attach&&s.jsx(ce,{type:"button",variant:x==="attach"?"secondary":"ghost",size:"xs",onClick:()=>p("attach"),children:"Attach"})]}),s.jsx("p",{className:"text-[10px] leading-relaxed",children:x==="ssh"?"Login shell over SSH.":x==="attach"?"Reconnects to the sandbox’s running terminal.":"Starts a separate shell or agent in the sandbox."}),E&&s.jsx(ef,{command:E.command,label:x==="ssh"?`ssh ${E.alias}`:`openshell sandbox ${x==="attach"?"connect":"exec --name"} ${e}`}),u.gateway.remote&&s.jsxs("p",{className:"break-all text-[10px]",children:["Via gateway ",s.jsxs("span",{className:"font-mono",children:[u.gateway.name,"/",u.gateway.workspace]})," at ",s.jsx("span",{className:"font-mono",children:u.gateway.endpoint})]}),s.jsxs(ce,{variant:"outline",size:"sm",className:"w-full justify-start text-xs font-normal text-muted-foreground",disabled:!u.cliInstalled||j,onClick:A,children:[j?s.jsx(zt,{className:"size-3.5"}):s.jsx(r6,{className:"size-3.5"}),"SSH configuration"]})]})]})]}),s.jsx(vn,{open:!!N,onOpenChange:_=>{_||C(null)},children:s.jsxs(wn,{className:"sm:max-w-2xl",children:[s.jsxs(jn,{children:[s.jsxs(bn,{children:["SSH configuration for ",e]}),s.jsx(_n,{children:"The console does not change ~/.ssh/config. Review and add this Host block yourself, then connect with the command below."})]}),N&&s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:"max-h-[50svh] overflow-auto whitespace-pre rounded-md border bg-muted/30 p-3 font-mono text-[11px]",children:N.config}),s.jsx(ef,{command:N.command}),s.jsx(ce,{variant:"outline",onClick:async()=>{try{await navigator.clipboard.writeText(N.config),He.success("SSH config copied")}catch{He.error("Couldn’t copy SSH config")}},children:"Copy Host block"})]})]})})]})}const hW={"read-only":"read-only","read-write":"read-write",full:"full",custom:"custom rules",blocked:"blocked"},pW={secret:"from provider",policy:"network rule",org:"blocked everywhere",group:"inherited",agent:"agent defaults",own:"rule"};function gW(e){var r;const t=Cn();return t&&!((r=e.liveData)!=null&&r.demo)?s.jsx(Uw,{children:s.jsx(IE,{...e,scoped:!0},e.name)},t.id??t.context):s.jsx(IE,{...e},e.name)}function IE({name:e,sandbox:t,onClose:r,onNavigate:a,onChanged:l,liveData:c,scoped:u}){var I,$,Q,G,se;const f=$t(),h=Cn(),m=qa(),x=u?m:c??m,p=ee=>a(ee,h),[b,v]=g.useState(15),[j,S]=g.useState(Date.now);g.useEffect(()=>{const ee=setInterval(()=>S(Date.now()),3e4);return()=>clearInterval(ee)},[]);const[N,C]=g.useState(null),[E,T]=g.useState(null),[O,k]=g.useState(null),[M,A]=g.useState(!1),R=Er(),z=!!(R!=null&&R.nativeActions),_=!!(h!=null&&h.cloud||((h==null?void 0:h.target)??(R==null?void 0:R.target))==="cloud"),L=fW(),Y=((I=x.sandboxes)==null?void 0:I.find(ee=>ee.name===e))??t,P=Y?`${Y.phase}|${Y.policyVersion}`:null;g.useEffect(()=>{if(!e||(h==null?void 0:h.connected)===!1){C(null),T((h==null?void 0:h.error)??null);return}if(C(null),T(null),x.demo)return;let ee=!1,ne,ie=3e4;const oe=async()=>{var Z;try{const de=await f.sandbox(e);ee||(C(de),T(null),ie=(Z=de.setupJobs)!=null&&Z.some(ke=>ke.status==="waiting")?2e3:3e4)}catch(de){ee||T(de.message)}ee||(ne=setTimeout(oe,ie))};return oe(),()=>{ee=!0,clearTimeout(ne)}},[e,P,x.demo,f,h==null?void 0:h.connected,h==null?void 0:h.error]);const V=(N==null?void 0:N.name)===e?N:Y,U=g.useMemo(()=>x.events.filter(ee=>ee.sandbox===e&&ee.kind==="audit"&&ee.verdict).slice(0,14),[x.events,e]);async function H(ee){var ne;if((h==null?void 0:h.connected)!==!1){k(ee);try{await f.lifecycle(e,ee),He.success(ee==="delete"?`Deleting ${e}`:ee==="stop"?`Stopping ${e}`:`Starting ${e}`),l==null||l(),(ne=x.refresh)==null||ne.call(x),ee==="delete"&&r()}catch(ie){He.error(ie.message)}finally{k(null),A(!1)}}}const F=g.useMemo(()=>x.events.filter(ee=>ee.sandbox===e),[x.events,e]),q=g.useMemo(()=>PM(F,b,j),[F,b,j]),W=g.useMemo(()=>{var ne;const ee=new Map;for(const ie of((ne=N==null?void 0:N.policy)==null?void 0:ne.rules)??[])for(const oe of ie.endpoints)!oe.blocked&&!ee.has(oe.host)&&ee.set(oe.host,{host:oe.host,source:Aa(ie.key)});return[...ee.values()]},[N]),B=g.useMemo(()=>{const ee=new Map;for(const ne of F){if(ne.kind!=="audit"||ne.verdict!=="denied")continue;const ie=$w(ne.destination);if(!ie)continue;const oe=ee.get(ie)??{host:ie,count:0};oe.count+=1,ee.set(ie,oe)}return[...ee.values()].sort((ne,ie)=>ie.count-ne.count)},[F]),J=kM(V),X=V==null?void 0:V.phase,re=(($=N==null?void 0:N.policy)==null?void 0:$.rules)??[];return s.jsxs(s.Fragment,{children:[s.jsx(vn,{open:!!e,onOpenChange:ee=>{ee||r()},children:s.jsxs(wn,{className:"flex! h-[min(900px,94svh)] w-[calc(100%-1.5rem)]! max-w-[1280px]! flex-col gap-0! overflow-hidden p-0!",children:[s.jsxs(jn,{className:"shrink-0 border-b border-border px-5 py-4 pr-12",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-6 gap-y-3",children:[s.jsxs(bn,{className:"flex min-w-0 items-center gap-2 text-base",children:[s.jsx(Fl,{"aria-hidden":"true",strokeWidth:1.5,className:"size-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate",children:e}),s.jsx(Co,{location:h}),X&&s.jsxs("span",{className:"ml-2 flex shrink-0 items-center gap-1.5 text-xs font-normal text-muted-foreground",children:[s.jsx("span",{className:`size-1.5 rounded-full ${Ba(X).cell}`}),Gp[X]]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-xs text-muted-foreground",children:[s.jsxs("span",{children:[s.jsx("strong",{className:"mr-1 font-sans font-medium text-foreground",children:N!=null&&N.policy?W.length:"-"}),"allowed hosts"]}),s.jsxs("span",{children:[s.jsx("strong",{className:"mr-1 font-sans font-medium text-foreground",children:B.length}),"blocked hosts"]})]})]}),s.jsx(_n,{className:"sr-only",children:"Sandbox access graph, details, rules, files, and connection activity."})]}),E&&s.jsx("p",{role:"alert",className:"shrink-0 border-b px-5 py-2 text-xs text-destructive",children:E}),V?s.jsxs(jf,{defaultValue:"overview",className:"min-h-0 flex-1 gap-0!",children:[s.jsx("div",{className:"shrink-0 border-b border-border px-5 py-2",children:s.jsxs(Sf,{variant:"line","aria-label":"Sandbox information",className:"max-w-full",children:[s.jsx(jr,{value:"overview",className:"px-3 text-xs",children:"Overview"}),s.jsxs(jr,{value:"rules",className:"px-3 text-xs",children:["Rules",(N==null?void 0:N.policy)&&s.jsx("span",{className:"text-muted-foreground",children:re.length})]}),s.jsx(jr,{value:"setups",className:"px-3 text-xs",children:"MCPs & Skills"}),s.jsx(jr,{value:"files",className:"px-3 text-xs",children:"Files"}),s.jsx(jr,{value:"activity",className:"px-3 text-xs",children:"Activity"}),s.jsx(jr,{value:"details",className:"px-3 text-xs",children:"Details"})]})}),s.jsx(yo,{value:"overview",className:"min-h-0 overflow-y-auto",children:s.jsxs("div",{className:"grid min-h-full grid-cols-1 lg:h-full lg:grid-cols-[minmax(0,1fr)_250px]",children:[s.jsx("div",{className:"flex min-w-0 flex-col p-4 sm:p-5",children:s.jsx(Tl,{title:"Access graph",className:"flex flex-1 flex-col",children:N!=null&&N.policy?s.jsx(tK,{compact:!0,fill:!0,agentStatus:ly(V),agents:J,name:e,phase:X,allowed:W,denied:B,owner:Ld(V),gateway:x.demo||(Q=x.overview)==null?void 0:Q.gateway,secrets:(V.providers??[]).map(ee=>{var ne,ie;return((ie=(ne=x.overview)==null?void 0:ne.providers)==null?void 0:ie.find(oe=>oe.name===ee))??{name:ee}})}):s.jsx("p",{className:"rounded-lg border border-border p-5 text-sm text-muted-foreground",children:x.demo?"Policy data is unavailable for synthetic sandboxes.":E?"The access graph is unavailable because the policy could not be loaded.":N?"No policy was reported by the gateway.":"Loading access graph…"})})}),s.jsxs("aside",{"aria-label":"Sandbox summary",className:"space-y-5 border-t border-border bg-muted/20 p-5 lg:border-t-0 lg:border-l",children:[X==="ready"&&!x.demo&&(h==null?void 0:h.connected)!==!1&&s.jsx(mW,{name:e,editors:L,cursorAgent:J.some(ee=>ee.name==="Cursor"),cloud:!z,context:h?{name:h.gateway,workspace:h.workspace,target:h.target}:{...(G=x.overview)==null?void 0:G.gateway,target:R==null?void 0:R.target}},e),!x.demo&&X==="ready"&&(h==null?void 0:h.connected)!==!1&&_&&s.jsx(rW,{name:e,sandbox:V},e),s.jsxs(Tl,{title:"At a glance",children:[(se=V.setupJobs)==null?void 0:se.filter(ee=>["waiting","failed","blocked"].includes(ee.status)).map(ee=>s.jsx("p",{role:"status",className:"mb-3 text-xs text-muted-foreground",children:ee.status==="waiting"?"Installing included MCPs and skills…":`Included tools could not be activated: ${ee.error} Open MCPs & Skills to retry.`},ee.setup)),s.jsx("dl",{className:"grid grid-cols-2 gap-4 lg:grid-cols-1",children:[["Status",s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:`size-1.5 rounded-full ${Ba(X).cell}`,"aria-hidden":"true"}),Gp[X]??"Unknown"]})],["Owner",Ld(V)],[J.length===1?"AI agent":"AI agents",s.jsx(PE,{agents:J,status:ly(V)})],["Image",np(V.image,V.imageTemplateName)],["Providers",V.providers.join(", ")||"None"],["Created",Hd(V.createdAt)],["Policy",N?`v${N.policyVersionNumber??V.policyVersion} · ${N.policySource??"sandbox"}`:"Not reported"]].map(([ee,ne])=>s.jsxs("div",{className:"min-w-0",children:[s.jsx("dt",{className:"text-[11px] text-muted-foreground",children:ee}),s.jsx("dd",{className:"mt-1 break-words text-xs",children:ne})]},ee))})]}),V.problem&&ex(X)==="error"&&s.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50/60 p-3",children:[s.jsxs("p",{className:"flex items-center gap-1.5 text-xs font-medium text-red-700",children:[s.jsx(Va,{className:"size-3.5","aria-hidden":"true"}),"Failed to start"]}),/failed to resolve .*image/i.test(V.problem)&&/index\.docker\.io/.test(V.problem)&&s.jsx("p",{className:"mt-1 text-[11px] text-red-700",children:"Start Docker, then recreate this sandbox."}),s.jsx("p",{className:"mt-1 max-h-28 overflow-y-auto font-mono text-[10px] leading-relaxed break-words text-red-700/80",children:V.problem})]})]})]})}),s.jsx(yo,{value:"rules",className:"min-h-0 space-y-6 overflow-y-auto p-5",children:s.jsx(Tl,{title:"Network rules",icon:qv,aside:s.jsx("button",{disabled:(h==null?void 0:h.connected)===!1,onClick:()=>{try{sessionStorage.setItem("egress-sandbox",e)}catch{}r(),p("egress")},className:"text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:"Edit"}),children:N!=null&&N.policy?re.length===0?s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"No rules. All outbound denied."}):s.jsx("ul",{className:"divide-y divide-border/70 rounded-md border border-border",children:re.map(ee=>s.jsxs("li",{className:"px-3 py-2",children:[s.jsxs("p",{className:"flex items-center gap-2 text-[11px]",children:[s.jsx("span",{className:"truncate font-mono font-medium",children:Aa(ee.key)==="own"?ee.name:_d(ee.key)}),s.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:pW[Aa(ee.key)]})]}),s.jsx("ul",{className:"mt-1.5 space-y-0.5",children:ee.endpoints.map(ne=>s.jsxs("li",{className:"flex items-center gap-2 font-mono text-[11px]",children:[s.jsx("span",{className:`size-1.5 shrink-0 rounded-full ${ne.blocked?"bg-red-500":"bg-emerald-500"}`,"aria-hidden":"true"}),s.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[ne.host,ne.port?`:${ne.port}`:""]}),s.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[hW[ne.access]??ne.access,ne.tlsSkip?" · TLS passthrough":"",ne.protocol!=="tcp"&&ne.enforcement==="audit"?" · audit only":""]})]},`${ne.host}:${ne.port}`))}),ee.binaries.length>0&&s.jsx("p",{className:"mt-1.5 truncate font-mono text-[10px] text-muted-foreground",title:ee.binaries.join(", "),children:ee.binaries.map(ne=>ne.split("/").pop()).filter((ne,ie,oe)=>oe.indexOf(ne)===ie).join(", ")})]},ee.key))}):s.jsx("p",{className:"text-sm text-muted-foreground",children:x.demo?"Policy data is unavailable in this preview.":E?"Rules could not be loaded. Close and reopen to retry.":N?"No policy reported.":"Loading rules…"})})}),s.jsx(yo,{value:"setups",className:"min-h-0 overflow-y-auto",children:(h==null?void 0:h.connected)===!1?s.jsx("p",{role:"status",className:"p-5 text-sm text-muted-foreground",children:"Reconnect this location to manage MCPs & Skills."}):s.jsx(w3,{sandbox:e,setupIds:(N==null?void 0:N.setupIds)??[]})}),s.jsx(yo,{value:"files",className:"flex min-h-0 flex-col",children:(h==null?void 0:h.connected)===!1?s.jsx("p",{role:"status",className:"p-5 text-sm text-muted-foreground",children:"Reconnect this location to access files."}):s.jsx(uW,{sandbox:V,demo:x.demo})}),s.jsxs(yo,{value:"activity",className:"min-h-0 space-y-6 overflow-y-auto p-5",children:[s.jsxs(Tl,{title:"Connection activity",aside:s.jsx("div",{className:"flex gap-1",children:[15,60].map(ee=>s.jsx("button",{onClick:()=>v(ee),"aria-pressed":b===ee,className:`rounded px-2 py-1 text-xs ${b===ee?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:ee===15?"15m":"1h"},ee))}),children:[s.jsx("div",{className:"rounded-lg border border-border p-4",children:s.jsx(IM,{points:q,height:100,title:"Outbound decisions per minute"})}),s.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Based on the recent event buffer",x.demo?" · synthetic preview":"","."]})]}),s.jsx(Tl,{title:"Egress",aside:U.length?s.jsx("button",{onClick:()=>{r(),p("activity")},className:"text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:"All"}):null,children:U.length?s.jsx("div",{className:"rounded-md border border-border",children:U.map(ee=>s.jsx(tW,{event:ee,dense:!0},`${ee.at}|${ee.message}`))}):s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"No connections yet"})})]}),s.jsx(yo,{value:"details",className:"min-h-0 space-y-5 overflow-y-auto p-5",children:s.jsx("dl",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2",children:[["Owner",Ld(V)],["Image",np(V.image,V.imageTemplateName),!0],...V.image&&np(V.image,V.imageTemplateName)!==V.image?[["Image reference",V.image,!0]]:[],["Command",cK(V.command),!0],[J.length===1?"AI agent":"AI agents",s.jsx(PE,{agents:J,status:ly(V)})],["Providers",V.providers.join(", ")||"None"],["Created",Hd(V.createdAt)],["Workspace",V.workspace],["Policy",N?`v${N.policyVersionNumber??V.policyVersion} · ${N.policySource??"sandbox"}`:`v${V.policyVersion??"-"}`],["Sandbox ID",V.id,!0,!0]].map(([ee,ne,ie,oe])=>s.jsxs("div",{className:oe?"sm:col-span-2":void 0,children:[s.jsx("dt",{className:"mb-1 text-[11px] text-muted-foreground",children:ee}),s.jsx("dd",{className:`break-all ${ie?"font-mono text-xs":"text-sm"}`,children:ne??"Not reported"})]},ee))})})]}):s.jsx("p",{role:"status",className:"flex-1 p-5 text-sm text-muted-foreground",children:E?"Sandbox details unavailable.":"Loading sandbox…"}),V&&!x.demo&&s.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2 border-t border-border bg-muted/20 px-5 py-3",children:[iK(X)&&s.jsxs(ce,{variant:"outline",size:"sm",disabled:!!O||(h==null?void 0:h.connected)===!1,onClick:()=>H("stop"),children:[O==="stop"?s.jsx(zt,{"aria-hidden":"true"}):s.jsx(c6,{"aria-hidden":"true"}),"Stop"]}),lK(X)&&s.jsxs(ce,{variant:"outline",size:"sm",disabled:!!O||(h==null?void 0:h.connected)===!1,onClick:()=>H("start"),children:[O==="start"?s.jsx(zt,{"aria-hidden":"true"}):s.jsx(DR,{"aria-hidden":"true"}),"Start"]}),s.jsxs(ce,{variant:"outline",size:"sm",disabled:!!O||(h==null?void 0:h.connected)===!1||X==="deleting",className:"border-destructive/30 text-destructive hover:bg-destructive/5 hover:text-destructive",onClick:()=>A(!0),children:[s.jsx(Gn,{"aria-hidden":"true"}),"Delete"]})]})]})}),s.jsx(Qr,{open:M,onOpenChange:A,children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Delete ",e,"?"]}),s.jsx(no,{children:"All files inside will be lost."})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsxs(so,{variant:"destructive",onClick:()=>H("delete"),disabled:O==="delete",children:[O==="delete"&&s.jsx(zt,{"aria-hidden":"true"}),"Delete"]})]})]})})]})}const I3=({className:e,containerRef:t,fromRef:r,toRef:a,curvature:l=0,reverse:c=!1,duration:u=5,delay:f=0,pathColor:h="gray",pathWidth:m=2,pathOpacity:x=.2,gradientStartColor:p="#ffaa40",gradientStopColor:b="#9c40ff",repeat:v=1/0,repeatDelay:j=0,startXOffset:S=0,startYOffset:N=0,endXOffset:C=0,endYOffset:E=0})=>{const T=g.useId(),[O,k]=g.useState(""),[M,A]=g.useState({width:0,height:0}),R=c?{x1:["90%","-10%"],x2:["100%","0%"],y1:["0%","0%"],y2:["0%","0%"]}:{x1:["10%","110%"],x2:["0%","100%"],y1:["0%","0%"],y2:["0%","0%"]};return g.useEffect(()=>{const z=()=>{if(t.current&&r.current&&a.current){const L=t.current.getBoundingClientRect(),Y=r.current.getBoundingClientRect(),P=a.current.getBoundingClientRect(),V=L.width,U=L.height;A({width:V,height:U});const H=Y.left-L.left+Y.width/2+S,F=Y.top-L.top+Y.height/2+N,q=P.left-L.left+P.width/2+C,W=P.top-L.top+P.height/2+E,B=F-l,J=`M ${H},${F} Q ${(H+q)/2},${B} ${q},${W}`;k(J)}},_=new ResizeObserver(()=>{z()});return t.current&&_.observe(t.current),z(),()=>{_.disconnect()}},[t,r,a,l,S,N,C,E]),s.jsxs("svg",{fill:"none",width:M.width,height:M.height,xmlns:"http://www.w3.org/2000/svg",className:Le("pointer-events-none absolute top-0 left-0 transform-gpu stroke-2",e),viewBox:`0 0 ${M.width} ${M.height}`,children:[s.jsx("path",{d:O,stroke:h,strokeWidth:m,strokeOpacity:x,strokeLinecap:"round"}),s.jsx("path",{d:O,strokeWidth:m,stroke:`url(#${T})`,strokeOpacity:"1",strokeLinecap:"round"}),s.jsx("defs",{children:s.jsxs(Yn.linearGradient,{className:"transform-gpu",id:T,gradientUnits:"userSpaceOnUse",initial:{x1:"0%",x2:"0%",y1:"0%",y2:"0%"},animate:{x1:R.x1,x2:R.x2,y1:R.y1,y2:R.y2},transition:{delay:f,duration:u,ease:[.16,1,.3,1],repeat:v,repeatDelay:j},children:[s.jsx("stop",{stopColor:p,stopOpacity:"0"}),s.jsx("stop",{stopColor:p}),s.jsx("stop",{offset:"32.5%",stopColor:b}),s.jsx("stop",{offset:"100%",stopColor:b,stopOpacity:"0"})]})})]})},xW=["working","needs-docker","needs-install"],_E={working:{icon:ou,tone:"text-muted-foreground animate-spin motion-reduce:animate-none",title:e=>`Connecting to ${e.host}`},"needs-docker":{icon:iC,tone:"text-amber-500",title:e=>`Docker isn’t installed on ${e.host}`},"needs-install":{icon:iC,tone:"text-amber-500",title:e=>`${e.host} needs the runtime images`},failed:{icon:WP,tone:"text-destructive",title:e=>`Couldn’t connect to ${e.host}`}};function _3({onConnected:e,onBack:t,initialHost:r,connectedHost:a=null,onUseConnected:l}){var re,I;const[c,u]=g.useState(null),[f,h]=g.useState("download"),[m,x]=g.useState(""),[p,b]=g.useState(null),[v,j]=g.useState(null),[S,N]=g.useState(null),[C,E]=g.useState(!1),[T,O]=g.useState(null),[k,M]=g.useState(null),[A,R]=g.useState(0),z=g.useRef(0),_=g.useRef(null),L=g.useRef(!1),Y=g.useId(),P=g.useCallback($=>{L.current||(L.current=!0,e($))},[e]);g.useEffect(()=>{const $=new AbortController,Q=++z.current,G=setTimeout(()=>$.abort(new Error("Reading hosts timed out. Try refreshing.")),1e4);return E(!0),O(null),M(null),cs.connections($.signal).then(se=>{var ie,oe,Z;if(z.current!==Q)return;u(se);const ee=(ie=se.job)!=null&&ie.host&&xW.includes(se.job.status)?se.job:null;ee&&(b(ee),h(ee.runtimeInstallation||"download"));const ne=(ee==null?void 0:ee.host)??_.current??r??((oe=se.active)==null?void 0:oe.host);x(se.hosts.some(de=>de.name===ne)?ne:((Z=se.hosts[0])==null?void 0:Z.name)||"")}).catch(se=>{z.current===Q&&se.name!=="AbortError"&&O(se.message)}).finally(()=>{clearTimeout(G),z.current===Q&&E(!1)}),()=>{$.abort(),clearTimeout(G),z.current+=1}},[A,r]),g.useEffect(()=>{if((p==null?void 0:p.status)!=="working"||k||S)return;const $=new AbortController;let Q;async function G(){try{const se=await cs.connectionJob(p.id,$.signal);if($.signal.aborted)return;b(se),se.status==="ready"?P(se):se.status==="working"&&(Q=setTimeout(G,1e3))}catch(se){$.signal.aborted||M(se.message)}}return Q=setTimeout(G,500),()=>{$.abort(),clearTimeout(Q)}},[p==null?void 0:p.id,p==null?void 0:p.status,k,S,P]);async function V($,Q){N($),O(null),M(null);try{const G=await Q();b(G),G.status==="ready"&&P(G)}catch(G){O(G.message)}finally{N(null)}}const U=(c==null?void 0:c.hosts)??[],H=U.find($=>$.name===m),F=!!S||(p==null?void 0:p.status)==="working",q=(p==null?void 0:p.status)==="needs-install"||(p==null?void 0:p.status)==="needs-docker",W=c&&!c.tools.ssh,B=p&&p.host===m&&_E[p.status]?_E[p.status]:null,J=()=>R($=>$+1),X=!!(a&&l&&m===a&&!p);return s.jsxs("div",{className:"grid gap-6 text-xs",children:[s.jsxs("div",{className:"grid gap-6 md:grid-cols-2 md:gap-8",children:[s.jsx("div",{className:"grid min-w-0 content-start gap-5",children:s.jsx(yW,{host:(H==null?void 0:H.label)??(m||"Your server"),live:(p==null?void 0:p.status)==="working"||X})}),s.jsxs("div",{className:"grid min-w-0 content-start gap-5",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(On,{htmlFor:`${Y}-host`,className:"text-xs",children:"SSH host"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(cn,{id:`${Y}-host`,className:"flex-1",value:H?m:"",disabled:F||!U.length,onChange:$=>{_.current=$.target.value,x($.target.value),b(null),j(null),O(null),M(null)},children:[s.jsx("option",{value:"",disabled:!0,children:U.length?"Choose a host":"No hosts in ~/.ssh/config"}),U.map($=>s.jsx("option",{value:$.name,children:$.label??$.name},$.name))]}),s.jsx(ce,{type:"button",variant:"outline",size:"icon","aria-label":"Refresh hosts",disabled:!!S||C,onClick:J,children:s.jsx($a,{className:`size-3.5 ${C?"animate-spin motion-reduce:animate-none":""}`})})]}),X?s.jsx("p",{className:"text-muted-foreground",children:"Connected now. Choose another host to replace this connection."}):a&&H&&s.jsxs("p",{className:"text-muted-foreground",children:["Connecting ",m," replaces the connection to ",a,"."]}),H&&!H.managed&&!X&&s.jsxs("p",{className:"text-muted-foreground",children:["First time? Run ",s.jsxs("code",{className:"rounded bg-muted px-1 font-mono text-foreground",children:["ssh ",m]})," once to trust the machine."]}),W&&s.jsx(kh,{children:"OpenSSH isn’t installed on this computer. Install it, then refresh."})]}),s.jsxs(bW,{children:[s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("p",{className:"font-medium text-foreground",children:"If the host is missing the runtime images"}),s.jsx("div",{role:"radiogroup","aria-label":"Runtime images",className:"inline-flex w-fit rounded-lg bg-muted p-0.5",children:[["download","Download on host"],["upload","I’ll upload a package"]].map(([$,Q])=>s.jsx("button",{type:"button",role:"radio","aria-checked":f===$,disabled:F||q,onClick:()=>h($),className:`rounded-md px-2.5 py-1 transition-colors disabled:opacity-60 ${f===$?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:Q},$))})]}),s.jsxs("ul",{className:"grid list-disc gap-1.5 pl-4",children:[s.jsx("li",{children:"Needs Linux with Docker. On Ubuntu or Debian, OpenRod can install Docker (it asks first; needs passwordless sudo)."}),s.jsx("li",{children:"Docker access is admin access. Connect only to machines you trust."}),s.jsx("li",{children:"The host gets credentials for its own gateway, never your main one."}),s.jsx("li",{children:"The link runs inside OpenRod on this computer. Stopping OpenRod disconnects it; disconnect any time from the gateway menu in the sidebar."})]})]})]})]}),B&&s.jsxs("div",{role:"status","aria-live":"polite",className:"grid gap-3 rounded-xl border border-border bg-muted/20 p-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(B.icon,{className:`mt-0.5 size-4 shrink-0 ${B.tone}`}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium text-foreground",children:B.title(p)}),p.stage&&p.stage!=="Connection failed"&&s.jsx("p",{className:"mt-0.5 break-words whitespace-pre-wrap text-muted-foreground",children:p.stage})]})]}),p.probe&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:[`${p.probe.os||"Unknown OS"} · ${p.probe.arch||"?"}`,p.probe.dockerInstalled===!1?"No Docker":"Docker found",p.probe.runtimeReady?"Images ready":"Images missing"].map($=>s.jsx("span",{className:"rounded-full border border-border bg-background px-2 py-0.5 text-[10px] text-muted-foreground",children:$},$))}),p.status==="needs-docker"&&((re=p.probe)!=null&&re.dockerInstallSupported?s.jsxs("div",{className:"grid gap-2 border-t border-border pt-3",children:[s.jsxs("p",{className:"text-muted-foreground",children:["OpenRod will install ",s.jsx("code",{className:"font-mono",children:"docker.io"}),", start it, and add your SSH user to the ",s.jsx("code",{className:"font-mono",children:"docker"})," group (root-equivalent). Nothing changes unless you approve."]}),s.jsx(ce,{type:"button",size:"sm",className:"justify-self-start",disabled:F,onClick:()=>V("docker",()=>cs.installConnectionDocker(p.id)),children:S==="docker"?"Starting…":"Install Docker and continue"})]}):s.jsxs("div",{className:"grid gap-2 border-t border-border pt-3",children:[s.jsxs("p",{className:"text-muted-foreground",children:[((I=p.probe)==null?void 0:I.dockerInstallReason)||"Automatic install works on Ubuntu and Debian only."," Install Docker yourself, then check again."]}),s.jsx(ce,{type:"button",variant:"outline",size:"sm",className:"justify-self-start",disabled:F,onClick:()=>V("connect",()=>cs.connect({host:p.host,runtimeInstallation:f})),children:"Check again"})]})),p.status==="needs-install"&&s.jsxs("div",{className:"grid gap-2 border-t border-border pt-3",children:[s.jsx(ce,{type:"button",variant:"outline",size:"sm",className:"justify-self-start",disabled:F,onClick:()=>V("download",()=>cs.installConnectionRuntime(p.id)),children:S==="download"?"Starting download…":"Download on host"}),s.jsxs("p",{className:"text-muted-foreground",children:["Or upload a ",s.jsx("code",{className:"font-mono",children:"docker save"})," .tar with the sandbox, supervisor and gateway images for this host’s architecture."]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ot,{"aria-label":"Docker-save package (.tar)",type:"file",accept:".tar,application/x-tar",className:"h-8 flex-1 text-xs",disabled:F,onChange:$=>{var Q;j(((Q=$.target.files)==null?void 0:Q[0])??null),O(null)}}),s.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:F||!(v!=null&&v.name.toLowerCase().endsWith(".tar")),onClick:()=>V("upload",()=>cs.uploadConnectionPackage(p.id,v)),children:S==="upload"?"Uploading…":"Upload"})]}),v&&!v.name.toLowerCase().endsWith(".tar")&&s.jsx(kh,{children:"Choose an uncompressed .tar archive."})]})]}),(T||B&&p.error)&&s.jsx(kh,{children:T||p.error}),k&&s.jsxs(kh,{children:["Lost track of progress: ",k," It may still be running. Refresh to check."]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-4",children:[s.jsx(ce,{type:"button",variant:"ghost",className:"mr-auto",disabled:!!S,onClick:t,children:"Back"}),X?s.jsxs(ce,{type:"button",onClick:l,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:["Continue with ",a]}):s.jsx(ce,{type:"button",disabled:F||!H||W||q,onClick:()=>V("connect",()=>cs.connect({host:m,runtimeInstallation:f})),className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:S==="connect"||(p==null?void 0:p.status)==="working"?s.jsxs(s.Fragment,{children:[s.jsx(ou,{className:"size-3.5 animate-spin"}),"Connecting…"]}):(p==null?void 0:p.status)==="failed"&&p.host===m?"Try again":"Connect"})]})]})}function kh({children:e}){return s.jsx("p",{role:"alert",className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 break-words whitespace-pre-wrap text-destructive",children:e})}function bW({children:e}){const[t,r]=g.useState(!1);return s.jsxs("div",{children:[s.jsxs("button",{type:"button","aria-expanded":t,onClick:()=>r(a=>!a),className:"flex w-full items-center gap-2 rounded text-left text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(ru,{className:"size-3.5"}),"Requirements & safety",s.jsx(ko,{className:`ml-auto size-3.5 transition-transform ${t?"rotate-180":""}`})]}),t&&s.jsx("div",{className:"grid gap-4 pt-3 text-muted-foreground",children:e})]})}function yW({host:e,live:t}){const r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=(u,f,h,m)=>s.jsxs("div",{className:"z-10 flex flex-col items-center gap-2 text-center",children:[s.jsx("span",{ref:u,className:"flex size-11 items-center justify-center rounded-2xl border border-border bg-background shadow-sm",children:s.jsx(f,{className:"size-5"})}),s.jsxs("span",{children:[s.jsx("span",{className:"block max-w-32 truncate font-medium text-foreground",children:h}),s.jsx("span",{className:"block text-[10px] text-muted-foreground",children:m})]})]});return s.jsxs("div",{ref:r,className:"relative flex items-start justify-between overflow-hidden rounded-xl border border-border bg-muted/20 px-8 py-4",children:[c(a,dp,"This computer","Gateway"),s.jsx("span",{className:"absolute top-[38px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 rounded-full border border-border bg-background px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:"ssh"}),c(l,rf,e,"Docker · sandboxes"),s.jsx(I3,{containerRef:r,fromRef:a,toRef:l,duration:t?2.5:5,pathOpacity:.25,gradientStartColor:"#f59e0b",gradientStopColor:"#10b981"})]})}function vW({width:e=16,height:t=16,x:r=0,y:a=0,cx:l=1,cy:c=1,cr:u=1,className:f,glow:h=!1,...m}){const x=g.useId(),p=g.useRef(null),[b,v]=g.useState({width:0,height:0});g.useEffect(()=>{const S=()=>{if(p.current){const{width:N,height:C}=p.current.getBoundingClientRect();v({width:N,height:C})}};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const j=Array.from({length:Math.ceil(b.width/e)*Math.ceil(b.height/t)},(S,N)=>{const C=N%Math.ceil(b.width/e),E=Math.floor(N/Math.ceil(b.width/e));return{x:C*e+l+r,y:E*t+c+a,delay:Math.random()*5,duration:Math.random()*3+2}});return s.jsxs("svg",{ref:p,"aria-hidden":"true",className:Le("pointer-events-none absolute inset-0 h-full w-full text-neutral-400/80",f),...m,children:[s.jsx("defs",{children:s.jsxs("radialGradient",{id:`${x}-gradient`,children:[s.jsx("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"1"}),s.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),j.map(S=>s.jsx(Yn.circle,{cx:S.x,cy:S.y,r:u,fill:h?`url(#${x}-gradient)`:"currentColor",initial:h?{opacity:.4,scale:1}:{},animate:h?{opacity:[.4,1,.4],scale:[1,1.5,1]}:{},transition:h?{duration:S.duration,repeat:1/0,repeatType:"reverse",delay:S.delay,ease:"easeInOut"}:{}},`${S.x}-${S.y}`))]})}function L3({step:e}){return s.jsx("ol",{"aria-label":"Steps",className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:["Location","Sandbox"].map((t,r)=>{const a=r+1===e,l=r+1<e;return s.jsxs(g.Fragment,{children:[r>0&&s.jsx("span",{"aria-hidden":"true",className:`h-px w-6 transition-colors ${l||a?"bg-foreground/40":"bg-border"}`}),s.jsxs("li",{"aria-current":a?"step":void 0,className:`flex items-center gap-1.5 transition-colors ${a?"text-foreground":""}`,children:[s.jsx("span",{className:`flex size-4 items-center justify-center rounded-full text-[9px] font-semibold transition-colors ${a?"bg-foreground text-background":l?"bg-foreground/15 text-foreground":"border border-border"}`,children:r+1}),t]})]},t)})})}const Th=e=>{var t;return((t=e==null?void 0:e.label)==null?void 0:t.replace(/^SSH · /,""))??(e==null?void 0:e.gateway)};function LE({live:e}){const t=lr(),r=g.useId();return s.jsxs("svg",{viewBox:"0 0 72 48",className:"h-16 w-auto text-foreground","aria-hidden":"true",children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:`${r}-screen`,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0",stopColor:"currentColor",stopOpacity:"0.14"}),s.jsx("stop",{offset:"1",stopColor:"currentColor",stopOpacity:"0.03"})]})}),s.jsx("rect",{x:"10",y:"2",width:"52",height:"34",rx:"3.5",fill:"var(--popover)",stroke:"currentColor",strokeOpacity:"0.55"}),s.jsx("rect",{x:"13.5",y:"5.5",width:"45",height:"27",rx:"1.5",fill:`url(#${r}-screen)`}),s.jsx("rect",{x:"18",y:"11",width:"14",height:"1.6",rx:"0.8",fill:"currentColor",fillOpacity:"0.45"}),s.jsx("rect",{x:"18",y:"16",width:"22",height:"1.6",rx:"0.8",fill:"currentColor",fillOpacity:"0.3"}),s.jsx("rect",{x:"18",y:"21",width:"9",height:"1.6",rx:"0.8",fill:"#10b981",fillOpacity:"0.8"}),s.jsx(Yn.rect,{x:"29",y:"20.3",width:"3",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.7",animate:t||!e?void 0:{opacity:[1,0,1]},transition:{duration:1.1,repeat:1/0,times:[0,.5,1]}}),s.jsx("path",{d:"M2 38.5h68l-2.6 5.2a2.5 2.5 0 0 1-2.2 1.3H6.8a2.5 2.5 0 0 1-2.2-1.3Z",fill:"var(--popover)",stroke:"currentColor",strokeOpacity:"0.55",strokeLinejoin:"round"}),s.jsx("rect",{x:"30",y:"38.5",width:"12",height:"1.6",rx:"0.8",fill:"currentColor",fillOpacity:"0.35"})]})}function B3({live:e}){const t=lr();return s.jsx("svg",{viewBox:"0 0 52 50",className:"h-[60px] w-auto text-foreground","aria-hidden":"true",children:[0,1,2].map(r=>s.jsxs("g",{children:[s.jsx("rect",{x:"2",y:2+r*16,width:"48",height:"13",rx:"3",fill:"var(--popover)",stroke:"currentColor",strokeOpacity:"0.55"}),s.jsxs(s.Fragment,{children:[s.jsx(Yn.circle,{cx:"9",cy:8.5+r*16,r:"1.6",fill:"#10b981",initial:{opacity:.9},animate:t||!e?void 0:{opacity:[.9,.25,.9]},transition:{duration:1.6,repeat:1/0,delay:r*.35}}),s.jsx("circle",{cx:"14.5",cy:8.5+r*16,r:"1.6",fill:"currentColor",fillOpacity:"0.25"}),[0,1,2,3].map(a=>s.jsx("rect",{x:30+a*4.2,y:5.5+r*16,width:"1.6",height:"6",rx:"0.8",fill:"currentColor",fillOpacity:"0.22"},a))]})]},r))})}function wW(){return s.jsx("svg",{viewBox:"0 0 76 48",className:"h-16 w-auto text-foreground","aria-hidden":"true",children:s.jsxs("g",{transform:"translate(0 3)",children:[s.jsx("path",{d:"M20 42a14 14 0 0 1-1.6-27.9A18 18 0 0 1 52.6 10 13 13 0 0 1 56 42Z",fill:"var(--popover)",stroke:"currentColor",strokeOpacity:"0.55",strokeLinejoin:"round"}),[0,1,2].map(e=>s.jsx("rect",{x:24+e*10,y:"26",width:"7",height:"7",rx:"1.5",fill:"currentColor",fillOpacity:.3-e*.07},e))]})})}function jW({kind:e,live:t}){const r=g.useRef(null),a=g.useRef(null),l=g.useRef(null);return s.jsxs("div",{ref:r,className:"relative flex h-36 items-center justify-center gap-14",children:[s.jsx(vW,{width:14,height:14,className:"text-foreground/15 transition-colors duration-500 [mask-image:radial-gradient(160px_circle_at_center,white,transparent)] group-hover:text-foreground/30"}),e==="cloud"&&s.jsx("span",{className:"relative z-10",children:s.jsx(wW,{})}),e==="local"&&s.jsx("span",{className:"relative z-10 transition-transform duration-500 group-hover:scale-105",children:s.jsx(LE,{live:t})}),e==="remote"&&s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:a,className:"relative z-10 transition-transform duration-500 group-hover:-translate-x-1",children:s.jsx(LE,{live:t})}),s.jsx("span",{ref:l,className:"relative z-10 transition-transform duration-500 group-hover:translate-x-1",children:s.jsx(B3,{live:t})}),s.jsx(I3,{containerRef:r,fromRef:a,toRef:l,duration:t?2.5:4,pathOpacity:.3,gradientStartColor:"#f59e0b",gradientStopColor:"#10b981"})]})]})}function by({index:e,scene:t,live:r,title:a,caption:l,tone:c="idle",disabled:u,onClick:f,trailing:h}){const m=lr(),x=p=>{const b=p.currentTarget.getBoundingClientRect();p.currentTarget.style.setProperty("--x",`${p.clientX-b.left}px`),p.currentTarget.style.setProperty("--y",`${p.clientY-b.top}px`)};return s.jsxs(Yn.button,{type:"button",disabled:u,onClick:f,onPointerMove:x,initial:m?!1:{opacity:0,y:10},animate:{opacity:u?.5:1,y:0},transition:{duration:.35,delay:e*.07,ease:[.22,1,.36,1]},className:"group relative block w-full overflow-hidden rounded-2xl bg-muted/30 text-left outline-none transition-colors duration-300 hover:bg-muted/50 focus-visible:bg-muted/50 focus-visible:ring-1 focus-visible:ring-foreground/20 disabled:pointer-events-none",children:[s.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(260px circle at var(--x, 50%) var(--y, 50%), color-mix(in oklab, var(--foreground) 7%, transparent), transparent 70%)"}}),s.jsx(jW,{kind:t,live:r}),s.jsxs("span",{className:"relative flex items-center gap-3 px-4 pt-1 pb-4",children:[s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm font-medium",children:a}),s.jsxs("span",{className:"flex items-center gap-1.5 truncate text-xs text-muted-foreground",children:[c!=="idle"&&s.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full ${c==="live"?"bg-emerald-500":"bg-amber-500"}`}),l]})]}),h||s.jsx(Mi,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground transition-all duration-300 group-hover:translate-x-0.5 group-hover:-translate-y-0.5 group-hover:text-foreground"})]})]})}function SW({locations:e,allowRemote:t,onPick:r,onConnected:a,onCancel:l,connecting:c}){const u=lr(),[f,h]=g.useState("choose"),[m,x]=g.useState(null),[p,b]=g.useState(!1),[v,j]=g.useState(null),S=e.find(O=>!O.remote),N=e.find(O=>O.remote);g.useEffect(()=>{if(S||!t)return;let O=!0;return cs.connections().then(k=>{O&&x(k.locals)}).catch(()=>{O&&x([])}),()=>{O=!1}},[S,t]);async function C(){b(!0),j(null);try{await cs.connect({localGateway:m[0].name}),window.location.reload()}catch(O){j(O.message),b(!1)}}const E=u?{}:{initial:{opacity:0,x:f==="remote"?24:-24},animate:{opacity:1,x:0},exit:{opacity:0,x:f==="remote"?-24:24},transition:{duration:.22,ease:[.22,1,.36,1]}},T=S?S.connected?"Local gateway":"Disconnected":m!=null&&m.length?`Use ${m[0].name}`:m?"No local gateway running":"Checking…";return s.jsxs("div",{className:"flex min-h-0 flex-col gap-6 rounded-xl bg-popover p-7 ring-1 ring-foreground/10",children:[s.jsxs(jn,{className:"gap-3",children:[s.jsx(L3,{step:1}),s.jsxs("div",{className:"flex items-center gap-2",children:[f==="remote"&&s.jsx(ce,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Back to locations",onClick:()=>h("choose"),children:s.jsx(Hv,{})}),s.jsx(bn,{children:f==="remote"?"Connect a machine":"Where should it run?"})]}),s.jsx(_n,{className:f==="remote"?"sr-only":"text-xs",children:f==="remote"?"Connect an SSH host to run sandboxes on.":"Pick a location for this sandbox."})]}),s.jsx("div",{className:"-m-2 min-h-0 flex-1 overflow-x-hidden overflow-y-auto p-2",children:s.jsx(Rf,{mode:"wait",initial:!1,children:f==="choose"?s.jsxs(Yn.div,{...E,className:"grid gap-3",children:[s.jsxs("div",{className:`grid gap-4 ${t?"sm:grid-cols-3":""}`,children:[s.jsx(by,{index:0,scene:"local",live:S==null?void 0:S.connected,title:"This computer",caption:T,tone:S!=null&&S.connected?"live":"idle",disabled:S?!S.connected:!(m!=null&&m.length)||p,onClick:()=>S?r(S.id??S.context):C(),trailing:p&&s.jsx(ou,{className:"size-4 animate-spin text-muted-foreground"})}),t&&s.jsx(by,{index:1,scene:"remote",live:N==null?void 0:N.connected,title:"Remote machine",caption:N!=null&&N.connected?`Connected · ${Th(N)}`:N?`${Th(N)} · Disconnected`:"Your server, over SSH",tone:N!=null&&N.connected?"live":N?"warn":"idle",onClick:()=>h("remote")}),t&&s.jsx(by,{index:2,scene:"cloud",title:"Cloud",caption:"Coming soon",disabled:!0,trailing:s.jsx("span",{"aria-hidden":"true"})})]}),v&&s.jsx("p",{role:"alert",className:"text-xs text-destructive",children:v}),s.jsx("div",{className:"mt-3 flex justify-end",children:s.jsx(ce,{type:"button",variant:"ghost",onClick:l,children:"Cancel"})})]},"choose"):s.jsx(Yn.div,{...E,children:c?s.jsxs("div",{role:"status",className:"grid place-items-center gap-3 py-16 text-xs text-muted-foreground",children:[s.jsx(ou,{className:"size-5 animate-spin"}),"Connected. Opening the sandbox form…"]}):s.jsx(_3,{initialHost:N?Th(N):void 0,connectedHost:N!=null&&N.connected?Th(N):null,onUseConnected:()=>r(N.id??N.context),onConnected:a,onBack:()=>h("choose")})},"remote")})})]})}const Fo=(e,t="read-write")=>({host:e,ports:[443],protocol:"rest",access:t,enforcement:"enforce"}),Eh=["/usr/local/bin/node","/usr/bin/node"],yy=["generativelanguage.googleapis.com","cloudcode-pa.googleapis.com","oauth2.googleapis.com","accounts.google.com","www.googleapis.com","aiplatform.googleapis.com","*.aiplatform.googleapis.com"],NW=new Set(["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","daily-cloudcode-pa.sandbox.googleapis.com"]),CW=e=>({...Fo(e),...NW.has(e)?{deny:["fetchFromTrawlerCache","rewriteUri","generateContent"].map(t=>({method:"*",path:`/**:${t}*`}))}:{}}),Rh=["api.anthropic.com","api.openai.com","openrouter.ai","api.groq.com","api.deepseek.com","api.mistral.ai","api.x.ai","generativelanguage.googleapis.com"],Si=(e,t,r)=>({name:e,binaries:t,endpoints:[...new Set(r)].map(a=>Fo(a))}),vy={claude:{name:"Claude Code",binaries:["/usr/bin/claude","/usr/local/bin/claude"],endpoints:["api.anthropic.com","platform.claude.com","claude.ai"].map(e=>Fo(e)),authentication:"Attach a Claude credential or sign in with your subscription after connecting."},opencode:{name:"OpenCode",binaries:["/usr/local/lib/node_modules/opencode-ai/bin/opencode.exe","/usr/local/bin/opencode","/sandbox/.opencode/bin/opencode"],endpoints:[Fo("models.opencode.ai","read-only"),Fo("models.dev","read-only"),Fo("opencode.ai"),...Rh.map(e=>Fo(e))],authentication:"Includes connections for OpenCode’s hosted models. Use /connect for models that require an account. Other model providers need their own network rules and credentials."},codex:{name:"Codex",binaries:["/usr/bin/codex","/usr/local/bin/codex","/usr/local/lib/node_modules/@openai/**/codex","/usr/lib/node_modules/@openai/**/codex"],endpoints:["api.openai.com","auth.openai.com","chatgpt.com","ab.chatgpt.com"].map(e=>Fo(e)),authentication:"Attach a Codex credential, or run codex after connecting and choose “Sign in with Device Code” (ChatGPT plan) or “Provide your own API key”. “Sign in with ChatGPT” can’t complete from a sandbox."},gemini:Si("Gemini CLI",[...Eh,"/usr/local/bin/gemini"],yy),pi:{...Si("Pi",[...Eh,"/usr/local/bin/pi"],[...Rh,...yy,"platform.claude.com","claude.ai","auth.openai.com","chatgpt.com","github.com","api.github.com","api.githubcopilot.com","*.githubcopilot.com","auth.x.ai","auth.kimi.com","api.kimi.com","auth.meta.com","api.meta.ai","radius.pi.dev"]),authentication:'Use /login inside Pi. If sign-in ends on a "site can’t be reached" page, copy the full URL from the address bar, paste it into Pi and press Enter.'},aider:Si("Aider",["/usr/local/bin/aider","/opt/aider/bin/python*","/usr/bin/python3*","/usr/local/bin/python3*"],Rh),copilot:Si("GitHub Copilot",[...Eh,"/usr/local/bin/copilot","/usr/local/lib/node_modules/@github/**/copilot","/usr/lib/node_modules/@github/**/copilot"],["github.com","api.github.com","api.githubcopilot.com","*.githubcopilot.com","copilot-proxy.githubusercontent.com"]),cursor:{...Si("Cursor",["/sandbox/.local/bin/cursor-agent","/sandbox/.local/share/cursor-agent/**","/usr/local/bin/cursor-agent"],[]),endpoints:[...["cursor.com","api2.cursor.sh","api3.cursor.sh","*.cursor.sh","*.cursorapi.com"].map(e=>Fo(e)),{host:"agentn.global.api5.cursor.sh",ports:[443],protocol:"tcp",tlsSkip:!0}]},antigravity:{...Si("Antigravity",["/sandbox/.local/bin/agy","/sandbox/.antigravity/**","/sandbox/.local/share/antigravity/**","/usr/local/bin/agy",...Eh],[]),endpoints:[...[...yy,"antigravity.google","daily-cloudcode-pa.googleapis.com","daily-cloudcode-pa.sandbox.googleapis.com"].map(CW),Fo("lh3.googleusercontent.com","read-only")]},kiro:Si("Kiro",["/sandbox/.local/bin/kiro-cli","/sandbox/.local/bin/kiro-cli-chat","/usr/local/bin/kiro-cli"],["app.kiro.dev","prod.us-east-1.auth.desktop.kiro.dev","runtime.us-east-1.kiro.dev","runtime.eu-central-1.kiro.dev","management.us-east-1.kiro.dev","management.eu-central-1.kiro.dev","q.us-east-1.amazonaws.com","q.eu-central-1.amazonaws.com","oidc.us-east-1.amazonaws.com","oidc.eu-central-1.amazonaws.com","cognito-identity.us-east-1.amazonaws.com","view.awsapps.com"]),droid:Si("Factory Droid",["/sandbox/.local/bin/droid","/sandbox/.factory/bin/**","/usr/local/bin/droid"],["factory.ai","*.factory.ai",...Rh])},kW=e=>({host:e,ports:[443],protocol:"rest",enforcement:"enforce",allow:[{method:"GET",path:"/**"}]}),Xp={vscode:{name:"VS Code Server",rule:"tool-vscode-server",binaries:["/usr/bin/curl","/usr/bin/wget","/sandbox/.vscode-server/**"],endpoints:["update.code.visualstudio.com","vscode.download.prss.microsoft.com"].map(kW)}};function $3(e){if((e==null?void 0:e.source)!=="build")return{profiles:[],unsupported:[]};const t=[...new Set(e.agents??[])];return{profiles:[...t.filter(r=>vy[r]).map(r=>({id:r,rule:`agent-${r}`,...vy[r]})),...[...new Set(e.runtimes??[])].filter(r=>Xp[r]).map(r=>({id:r,...Xp[r]}))],unsupported:t.filter(r=>!vy[r])}}const Hl=ls.filter(e=>!$3({source:"build",agents:[e.id]}).unsupported.length);function Xw(e){const t=Array.isArray(e)?e:e==="terminal"?[]:[e];if(t.some(r=>!Hl.some(a=>a.id===r)))throw new Error("Choose a supported agent.");return Hl.filter(r=>t.includes(r.id)).map(r=>r.id)}function TW(e,t){const r=Xw(e);if(r.length!==1||t==="shell")return"shell";const a=Hl.find(l=>l.id===t&&r.includes(l.id));if(!a)throw new Error("Choose Shell or a selected agent.");return a.command}const V3=Ow.filter(e=>Xp[e.id]);function Ww(e,t="",r="agent",a=!1,l=[],c=[]){if(!["agent","shell"].includes(r))throw new Error("Choose Shell or the selected agent.");if(c.some(m=>!Xp[m]))throw new Error("Choose a supported tool.");const u=[...a||l.length?["python","node"]:[],...V3.filter(m=>c.includes(m.id)).map(m=>m.id)],f=Xw(e),h=Hl.find(m=>m.id===f[0]);return ja({name:t,agents:f,runtimes:u,setups:l.map(m=>m.id),setupRevisions:Object.fromEntries(l.map(m=>[m.id,m.revision])),command:Array.isArray(e)||r==="shell"?"":(h==null?void 0:h.command)||""})}function EW(e,t,r="agent",a=!1,l=[],c=[]){const u=Ww(t,"",r,a,l,c);return e.find(f=>f.managed&&f.status==="ready"&&f.image&&f.build===BG(u)&&JSON.stringify(ja({...f.recipe,name:""}))===JSON.stringify(u))}function BE(e,t){const r={claude:["claude-code"],codex:["codex"]}[t]||[];return e.filter(a=>r.includes(a.type))}const U3=(e,t)=>new Promise((r,a)=>{const l=()=>{clearTimeout(c),a(new DOMException("Preparation cancelled.","AbortError"))},c=setTimeout(()=>{t==null||t.removeEventListener("abort",l),r()},e);t==null||t.addEventListener("abort",l,{once:!0}),t!=null&&t.aborted&&l()});async function RW(e,t,{openIn:r="agent",withSetups:a=!1,setups:l=[],tools:c=[],signal:u,onProgress:f=()=>{},onBuild:h=()=>{},onBuildUpdate:m=()=>{},wait:x=U3}={}){const p=()=>{if(u!=null&&u.aborted)throw new DOMException("Preparation cancelled.","AbortError")};p();const b=await e.imageTemplates();p();const v=EW(b,t,r,a,l,c);if(v)return m(v),v;const j=Xw(t),N=`q-${(j.length>1?"agents":j[0]||"terminal").slice(0,9)}-${crypto.randomUUID().slice(0,6)}`;f("Preparing environment… First-time setup can take a few minutes.");const C=await e.buildImageTemplate(Ww(t,N,r,a,l,c));if(h(N),m({...C,name:N}),p(),C.status==="failed")throw new Error(C.error||"Environment build failed.");for(let E=0;E<900;E++){await x(2e3,u),p();const T=(await e.imageTemplates()).find(O=>O.name===N);if(p(),!T)throw new Error("The environment build disappeared. Check Templates and try again.");if(m(T),T.status==="failed")throw new Error(T.error||"Environment build failed.");if(T.status==="ready")return T}throw new Error("The build is still running. Check Templates before trying again.")}async function H3(e,t,r,{signal:a,expectedRevisions:l={},onProgress:c=()=>{},wait:u=U3}={}){const f=()=>{if(a!=null&&a.aborted)throw new DOMException("Preparation cancelled.","AbortError")};if(f(),!t.length)return{setups:[],accessReview:null};const h=await e.setups(),m=[],x=r?{}:null;for(const p of t){f();const b=h.find(j=>j.id===p);if(!b||r&&r[p]!==b.revision||l[p]&&l[p]!==b.revision)throw new Error("A selected Setup changed. Reopen the dialog and review it again.");c(`Preparing MCP packages for ${b.name}…`);let v;try{v=await e.prepareLaunchSetup(p,b.revision);for(let j=0;v.status==="running"&&j<900;j++)f(),c(v.message||`Preparing ${b.name}…`),await u(2e3,a),f(),v=await e.setupPreparation(v.id);if(f(),v.status!=="complete"||!v.setup)throw new Error(v.message||"Package preparation did not finish. Retry creation.");m.push(v.setup),x&&(x[v.setup.id]=v.setup.revision)}catch(j){throw v!=null&&v.id&&v.status==="running"&&await e.cancelSetupPreparation(v.id).catch(()=>{}),j}}return{setups:m,accessReview:x}}const or=e=>(e==null?void 0:e.id)??(e==null?void 0:e.context),F3=["claude","codex","cursor","pi","antigravity","opencode"].map(e=>Hl.find(t=>t.id===e)).filter(Boolean),$E=Hl.filter(e=>!F3.includes(e)),AW=[{id:"empty",label:"Empty"},{id:"folder",label:"Local folder"},{id:"repo",label:"Git repository"}];function VE({title:e,summary:t,children:r,...a}){return s.jsxs("details",{className:"group/setup min-w-0 border-t border-border",...a,children:[s.jsxs("summary",{className:"flex min-h-11 cursor-pointer list-none items-center gap-2 rounded-sm py-2 outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[s.jsx(Hr,{className:"size-3.5 shrink-0 text-muted-foreground transition-transform group-open/setup:rotate-90","aria-hidden":"true"}),s.jsx("span",{className:"shrink-0 text-xs font-medium",children:e}),s.jsx("span",{className:"ml-auto truncate text-right text-[11px] text-muted-foreground",title:t,children:t})]}),s.jsx("div",{className:"grid min-w-0 gap-4 pb-4 pt-1",children:r})]})}function OW(e){var t;try{const r=new URL(e.trim());if(r.protocol!=="https:")return null;const a=(t=r.pathname.split("/").filter(Boolean).pop())==null?void 0:t.replace(/\.git$/,"");return a?`${Sa}/${/^[A-Za-z0-9]([A-Za-z0-9._-]{0,61}[A-Za-z0-9])?$/.test(a)?a:"repo"}`:null}catch{return null}}const MW={gitignore:".gitignore applied","gitignore-empty":".gitignore matched nothing, so everything is sent",none:"Not a git repository, so everything is sent"},DW={included:e=>`git history included (${sr(e.gitBytes)})`,worktree:()=>"Git worktree: history not included",subfolder:()=>"Inside a repository: history not included",none:()=>null};function zW({plan:e,sandbox:t}){return s.jsxs("div",{className:"grid min-w-0 gap-1 text-[11px]",children:[e.over?s.jsxs("p",{className:"text-red-700",children:["Over ",sr(e.limit),". Add a .gitignore, or upload it from a terminal."]}):s.jsxs("p",{children:[e.files.toLocaleString()," ",e.files===1?"file":"files"," · ",sr(e.bytes)," → ",s.jsx("span",{className:"font-mono",children:e.dest})]}),s.jsx("p",{className:"text-muted-foreground",children:[MW[e.filter],DW[e.git](e),e.links?`${e.links} ${e.links===1?"symlink":"symlinks"} kept as links`:null].filter(Boolean).join(" · ")}),e.secretCount>0&&s.jsxs("p",{className:"text-amber-700",children:["May hold secrets: ",s.jsx("span",{className:"font-mono",children:e.secrets.join(", ")}),e.secretCount>e.secrets.length?` and ${e.secretCount-e.secrets.length} more`:"",". Add ",e.secretCount===1?"it":"them"," to .gitignore to leave ",e.secretCount===1?"it":"them"," out."]}),s.jsxs("details",{className:"mt-1",children:[s.jsx("summary",{className:"cursor-pointer text-muted-foreground",children:"Upload from a terminal instead"}),e.git==="included"&&s.jsx("p",{className:"mt-1 text-muted-foreground",children:"Without git history."}),s.jsx(ef,{command:Bv(t||"NAME",e.display,Sa)})]})]})}function PW({org:e,value:t,onChange:r,onCreated:a,onAddPolicy:l,invalid:c=!1}){const u=lr(),f=Yw(e.policies,t),h=Object.fromEntries(e.groups.map(x=>{var p,b;return[x.id,((b=(p=e.members)==null?void 0:p[x.id])==null?void 0:b.length)??0]})),m=e.groups.filter(x=>t.includes(x.id));return s.jsx("div",{id:"sandbox-groups",className:`-m-3 rounded-lg p-3 transition-colors ${c?"bg-destructive/5 ring-1 ring-destructive/60":""}`,children:s.jsxs("fieldset",{"aria-invalid":c||void 0,className:"grid min-w-0 gap-2.5",children:[s.jsxs("legend",{className:"mb-2.5 text-xs font-medium",children:["Groups ",s.jsx("span",{className:c?"text-destructive":"text-muted-foreground",children:"· Required"})]}),s.jsx(Wd,{multiple:!0,required:!0,groups:e.groups,counts:h,value:t,onChange:r,onCreated:a}),s.jsx(Yn.p,{initial:u?!1:{opacity:0,y:3},animate:{opacity:1,y:0},transition:{duration:.18},"aria-live":"polite",className:`text-[11px] leading-relaxed ${c?"text-destructive":"text-muted-foreground"}`,children:f.length?s.jsxs(s.Fragment,{children:["Gets ",f.length===1?"this network rule":`these ${f.length} network rules`,": ",s.jsx("span",{className:"text-foreground",children:f.map(x=>x.name).join(", ")}),"."]}):m.length?s.jsx(s.Fragment,{children:"Add a network rule to at least one selected group before creating a sandbox."}):c?e.groups.length?"Choose at least one group to create a sandbox.":"Create a group to create a sandbox.":e.groups.length?null:"Create a group to share network access between sandboxes. Network rules can then target the whole group."},t.join(",")||"empty"),m.length>0&&!f.length&&s.jsx(ce,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:l,children:"Add network rule"})]})})}function UE(e,t){const r=vo.getSnapshot().filter(a=>a.status!=="failed"&&a.status!=="cancelled"&&or(a.location)===or(t));return new Set([...e.map(a=>a.name),...r.map(a=>a.name)])}function HE(e,t="sandbox"){for(let r=1;r<1e3;r++){const a=`${t}-${r}`;if(!e.has(a))return a}return""}function G3({locations:e,location:t,onLocationChange:r,onRefreshLocations:a,allowRemote:l=!1,...c}){var k;const u=Cn(),f=$t(),[h,m]=g.useState(null),x=(k=c.initialImageTemplate)==null?void 0:k.location,p=e??[],b=x??t,v=b?p.find(M=>or(M)===or(b))??(or(u)===or(b)?u:b):p.find(M=>or(M)===h)??u??p.find(M=>M.target===f.target&&M.connected)??null,j=!c.initialImageTemplate&&(l||p.length>1),[S,N]=g.useState("where"),[C,E]=g.useState(null);g.useEffect(()=>{c.open||m(null),N("where"),E(null)},[c.open]);const T=M=>{const A=p.find(R=>or(R)===M&&R.connected);A&&(m(M),r==null||r(A))};g.useEffect(()=>{if(!C)return;const M=p.find(R=>R.gateway===C&&R.connected);if(M){E(null),T(or(M)),N("form");return}const A=setInterval(()=>a==null?void 0:a(),1500);return()=>clearInterval(A)},[C,p]);const O=j&&S==="where"?s.jsx(SW,{locations:p,allowRemote:l,connecting:!!C,onPick:M=>{T(M),N("form")},onConnected:M=>{E(M.gateway),a==null||a()},onCancel:()=>c.onOpenChange(!1)}):null;return s.jsx(Pa,{location:v,children:s.jsx(IW,{...c,locations:p,onLocationChange:T,chooser:O,onChangeLocation:j?()=>N("where"):void 0},or(v)??"default")})}function IW({open:e,onOpenChange:t,onStarted:r,initialImageTemplate:a=null,locations:l,onLocationChange:c,chooser:u,onChangeLocation:f}){var ht,yt;const h=$t(),m=Cn(),x=lr(),[p,b]=g.useState([]),[v,j]=g.useState([]),[S,N]=g.useState(""),[C,E]=g.useState([]),[T,O]=g.useState([]),[k,M]=g.useState(null),[A,R]=g.useState(""),[z,_]=g.useState([]),[L,Y]=g.useState("quick"),[P,V]=g.useState([]),[U,H]=g.useState("shell"),[F,q]=g.useState([]),[W,B]=g.useState({}),[J,X]=g.useState(null),[re,I]=g.useState(null),[$,Q]=g.useState("empty"),G=Er(),se=!!(m!=null&&m.cloud||((m==null?void 0:m.target)??(G==null?void 0:G.target))==="cloud"),[ee,ne]=g.useState(""),[ie,oe]=g.useState(null),[Z,de]=g.useState(""),[ke,_e]=g.useState(null),[je,Ae]=g.useState([]),[te,Ee]=g.useState(null),[Te,be]=g.useState(!1),[We,Se]=g.useState(0),[Fe,Re]=g.useState(!1);g.useEffect(()=>{if(!e||(m==null?void 0:m.connected)===!1)return;let ue=!0;return b([]),j([]),h.overview().then(Pe=>{if(!ue)return;const st=Pe.sandboxes??[],vt=Pe.providers??[];b(st),j(vt),N(HE(UE(st,m))),_(vt.map(wt=>wt.name))}).catch(Pe=>{ue&&X(Pe.message)}),N(""),Y(a?"template":"quick"),V([]),H("shell"),q([]),B({}),O([]),R((a==null?void 0:a.name)||""),E(a?[a]:[]),h.imageTemplates().then(Pe=>{ue&&E(Pe.filter(st=>st.status==="ready"||st.exists))}).catch(Pe=>{ue&&X(Pe.message)}),_([]),X(null),I(null),_e(null),Q("empty"),ne(""),oe(null),de(""),Ae([]),Re(!1),Ee(null),be(dy(m)),(dy(m)?h.syncLocalCatalog():Promise.resolve(null)).then(async Pe=>{if(!ue)return;const st=await h.org();ue&&(Pe!=null&&Pe.available&&(st.groups=st.groups.filter(vt=>!Pe.importedGroups.includes(vt.id)||Pe.groups.includes(vt.id))),_e(st),Ee(Pe))}).catch(Pe=>{ue&&(_e(null),X(`Could not load sandbox settings: ${Pe.message}`))}).finally(()=>{ue&&be(!1)}),()=>{ue=!1}},[e,h,m==null?void 0:m.connected,m==null?void 0:m.remote,a,We]);const ve=L==="template"?C.find(ue=>ue.name===A):null,pe=Hl.filter(ue=>P.includes(ue.id)),$e=$3(L==="quick"?Ww(P,"","agent",!1,[],F):ve!=null&&ve.managed?ve.recipe:null),Je=L==="quick"?[...new Set(pe.flatMap(ue=>{const Ye=W[ue.id];return BE(v,ue.id).some(Pe=>Pe.name===Ye)?[Ye]:[]}))]:z,mt=ve!=null&&ve.managed&&ve.recipe.source==="build"?ls.filter(ue=>ve.recipe.agents.includes(ue.id)):null,ot=L==="quick"?P:(mt??[]).map(ue=>ue.id),Ie=C6(ot),at=L==="quick"?T.length>0:!!((yt=(ht=ve==null?void 0:ve.recipe)==null?void 0:ht.setups)!=null&&yt.length),Xe=at&&!Ie.length;function me(ue){const Ye=P.includes(ue)?P.filter(Pe=>Pe!==ue):[...P,ue];V(Ye),X(null),(Ye.length!==1||!Ye.includes(U))&&H("shell"),B(Pe=>Object.fromEntries(Object.entries(Pe).filter(([st])=>Ye.includes(st)))),/^(sandbox|terminal|claude|codex|cursor|opencode|pi|antigravity|copilot|kiro|droid|aider)-\d+$/.test(S)&&N(HE(UE(p??[],m),Ye.length===1?Ye[0]:"sandbox"))}g.useEffect(()=>{if($!=="folder"||!ee.trim()){oe(null);return}let ue=!1;oe({loading:!0});const Ye=setTimeout(()=>{h.localFolder(ee.trim()).then(Pe=>{ue||oe({data:Pe})}).catch(Pe=>{ue||oe({error:Pe.message})})},400);return()=>{ue=!0,clearTimeout(Ye)}},[$,ee,h]);const Me=je.length>0&&je.every(ue=>ke==null?void 0:ke.groups.some(Ye=>Ye.id===ue))&&Yw(ke==null?void 0:ke.policies,je).length>0,Oe=$==="repo"?OW(Z):null,tt=$==="empty"||($==="folder"?!!(ie!=null&&ie.data&&!ie.data.over):!!Oe),Ue=$==="folder"?ee.trim():$==="repo"?Z.trim():"";function Ge(ue){var Rn;if(ue.preventDefault(),(m==null?void 0:m.connected)===!1)return;const Ye=[!S&&"sandbox-name",L==="template"&&!ve&&"sandbox-image-template",!Me&&"sandbox-groups"].find(Boolean);if(Ye||!tt||Xe){Re(!0),Ye&&((Rn=document.getElementById(Ye))==null||Rn.scrollIntoView({behavior:x?"auto":"smooth",block:"center"}));return}const Pe=$==="folder"?{folder:ie.data.path}:$==="repo"?{repository:Z.trim()}:{},st=S.trim(),vt=L==="quick",wt=P,Ht=F,kt=vt?{session:TW(P,U)}:{},ct=T,jt=k,ae=Je,Ke=Ie,ut=je,Jt=ve;vo.start({name:st,location:m,task:async({signal:Et,progress:Pt,build:Ln,creating:Eo})=>{let ps=Jt,ao=[],Ks=null,Ro=null;const Ls=()=>{Ro&&h.cancelImageBuild(Ro).catch(Ss=>He.error(Ss.message))};Et.addEventListener("abort",Ls);try{if(vt){const Ss=await H3(h,ct,jt,{signal:Et,onProgress:Pt});ao=Ss.setups.map(Rr=>Rr.id),Ks=Ss.accessReview,ps=await RW(h,wt,{withSetups:ct.length>0,setups:Ss.setups,tools:Ht,signal:Et,onProgress:Pt,onBuildUpdate:Ln,onBuild:Rr=>{Ro=Rr,Et.aborted&&Ls()}})}}finally{Et.removeEventListener("abort",Ls)}if(Et.aborted)throw new DOMException("Cancelled","AbortError");Eo();const cr=await h.create({name:st,imageTemplate:ps.name,includeTemplateAccess:!vt,...kt,providers:ae,setups:ao,setupAccessReview:Ks,setupTargets:Ke,groups:ut,...Pe});cr.seed&&He(`${cr.seed.kind==="folder"?"Uploading":"Cloning"} ${cr.seed.source}`,{description:`Into ${cr.seed.dest} once the sandbox starts. Progress is in its Files tab.`});for(const Ss of cr.opened??[])He(`Opened ${Ss.name||"default"} on port ${Ss.port}`,{description:Ss.url??void 0});return{...cr,image:ps.image,providers:ae,createdAt:new Date().toISOString(),...m?{location:m}:{}}}}),t(!1),r==null||r()}return s.jsxs(s.Fragment,{children:[s.jsx(vn,{open:e,onOpenChange:t,children:s.jsx(wn,{className:"max-h-[90svh] gap-4 bg-transparent p-0 ring-0 sm:max-w-4xl",children:u??s.jsx(s.Fragment,{children:s.jsx("form",{onSubmit:Ge,className:"@container flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl bg-popover ring-1 ring-foreground/10 max-h-[90svh]",children:s.jsxs(jf,{value:L,onValueChange:ue=>{Y(ue),X(null)},className:"contents",children:[s.jsxs(jn,{className:"shrink-0 gap-3 px-5 pt-5 pb-4 @3xl:px-7 @3xl:pt-6",children:[f&&s.jsx("div",{className:"pr-8",children:s.jsx(L3,{step:2})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 pr-8",children:[s.jsx(bn,{children:"New sandbox"}),f?s.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-border bg-muted/30 py-0.5 pr-1 pl-2.5 text-[11px] text-muted-foreground",children:[m!=null&&m.remote?s.jsx(rf,{"aria-hidden":"true",className:"size-3"}):s.jsx(dp,{"aria-hidden":"true",className:"size-3"}),s.jsx("span",{className:"max-w-40 truncate text-foreground",children:m!=null&&m.remote?ws(m).replace(/^SSH · /,""):"This computer"}),s.jsx(ce,{type:"button",variant:"ghost",size:"sm",className:"h-5 rounded-full px-2 text-[11px]",onClick:f,children:"Change"})]}):!a&&l.length>0?null:s.jsx(Co,{location:m}),s.jsxs(Sf,{className:"ml-auto w-fit","aria-label":"Sandbox creation method",children:[s.jsx(jr,{value:"quick",className:"px-3 text-xs",children:"Quick setup"}),s.jsx(jr,{value:"template",className:"px-3 text-xs",children:"From template"})]})]}),!f&&l.length>0&&!a&&s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"sandbox-location",className:"text-xs",children:"Location"}),s.jsxs(Uh,{value:or(m)??"",onValueChange:c,items:l.map(ue=>({value:or(ue),label:`${ws(ue)}${ue.connected?"":" · Disconnected"}`})),children:[s.jsx(Fh,{id:"sandbox-location",className:"w-full text-xs",children:s.jsx(Hh,{placeholder:"Choose a connected location"})}),s.jsx(Gh,{align:"start",alignItemWithTrigger:!1,children:l.map(ue=>s.jsxs(Td,{value:or(ue),disabled:!ue.connected,children:[ws(ue),ue.connected?"":" · Disconnected"]},or(ue)))})]})]}),(m==null?void 0:m.connected)===!1&&s.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"This location is disconnected. Choose a connected location to create a sandbox."}),Te&&s.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading your local network policies, MCPs & Skills, and Groups…"}),(te==null?void 0:te.available)&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Your local network policies, MCPs & Skills, and Groups are available here. Existing remote sandboxes keep their settings."}),dy(m)&&!Te&&!ke&&s.jsx(ce,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>Se(ue=>ue+1),children:"Retry loading settings"})]}),s.jsx("div",{className:"grid min-h-0 flex-1 overflow-y-auto overscroll-contain border-t border-border @3xl:grid-cols-[minmax(0,1fr)_19rem] @3xl:overflow-hidden",children:s.jsxs("fieldset",{disabled:(m==null?void 0:m.connected)===!1,className:"contents",children:[s.jsxs(Yn.div,{initial:x?!1:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.25,ease:[.22,1,.36,1]},className:"grid min-w-0 content-start gap-6 p-5 @3xl:overflow-y-auto @3xl:p-7",children:[s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"sandbox-name",className:"text-xs",children:"Name"}),s.jsx(Ot,{id:"sandbox-name",value:S,onChange:ue=>N(ue.target.value.toLowerCase()),className:"h-10 font-mono text-sm",required:!0,"aria-invalid":Fe&&!S||void 0,pattern:"[a-z0-9]([a-z0-9\\-]{0,17}[a-z0-9])?",maxLength:19,title:"Lowercase letters, digits and dashes, up to 19",autoFocus:!0})]}),s.jsxs(yo,{value:"quick",className:"grid gap-4",children:[s.jsxs("fieldset",{className:"min-w-0",children:[s.jsx("legend",{className:"mb-1.5 text-xs font-medium",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-2 gap-2 @3xl:grid-cols-3",children:F3.map(ue=>s.jsxs("label",{className:"relative min-w-0",children:[s.jsx("input",{type:"checkbox",checked:P.includes(ue.id),onChange:()=>me(ue.id),className:"peer sr-only"}),s.jsxs("span",{className:"flex min-h-11 cursor-pointer items-center gap-2.5 rounded-lg border border-border bg-background px-3 py-2 text-xs transition-all hover:-translate-y-px hover:bg-muted/50 hover:shadow-sm motion-reduce:hover:translate-y-0 @3xl:min-h-14 peer-checked:border-foreground/40 peer-checked:bg-accent peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-disabled:pointer-events-none peer-disabled:opacity-50",children:[s.jsx("img",{src:ue.logo,alt:"",className:"size-4 shrink-0 object-contain"}),s.jsx("span",{className:"min-w-0 flex-1",children:ue.name}),P.includes(ue.id)&&s.jsx(qn,{className:"size-3.5 shrink-0","aria-hidden":"true"})]})]},ue.id))}),s.jsxs(Af,{children:[s.jsxs(Of,{render:s.jsx(ce,{type:"button",variant:"outline",className:"mt-2 w-full justify-between text-xs"}),children:[s.jsx("span",{className:"truncate",children:$E.filter(ue=>P.includes(ue.id)).map(ue=>ue.name).join(", ")||"More agents"}),s.jsx(ko,{className:"size-3.5 shrink-0","aria-hidden":"true"})]}),s.jsx(Mf,{align:"start",children:$E.map(ue=>s.jsxs(YM,{checked:P.includes(ue.id),onCheckedChange:()=>me(ue.id),closeOnClick:!1,className:"text-xs",children:[s.jsx("img",{src:ue.logo,alt:"",className:"size-4 shrink-0 object-contain"}),ue.name]},ue.id))})]})]}),s.jsxs("fieldset",{className:"min-w-0",children:[s.jsx("legend",{className:"mb-1.5 text-xs font-medium",children:"Tools"}),s.jsx("div",{className:"grid grid-cols-2 gap-2 @3xl:grid-cols-3",children:V3.map(ue=>s.jsxs("label",{className:"relative min-w-0",title:"Allows VS Code's server download from the start. Open in VS Code works without it and allows the download on first open.",children:[s.jsx("input",{type:"checkbox",checked:F.includes(ue.id),onChange:()=>q(F.includes(ue.id)?F.filter(Ye=>Ye!==ue.id):[...F,ue.id]),className:"peer sr-only"}),s.jsxs("span",{className:"flex min-h-11 cursor-pointer items-center gap-2.5 rounded-lg border border-border bg-background px-3 py-2 text-xs transition-colors hover:bg-muted/50 peer-checked:border-foreground/40 peer-checked:bg-accent peer-focus-visible:ring-2 peer-focus-visible:ring-ring",children:[s.jsx("img",{src:ue.logo,alt:"",className:"size-4 shrink-0 object-contain dark:invert"}),s.jsx("span",{className:"min-w-0 flex-1",children:ue.name}),F.includes(ue.id)&&s.jsx(qn,{className:"size-3.5 shrink-0","aria-hidden":"true"})]})]},ue.id))})]}),pe.length>0&&s.jsxs("fieldset",{className:"min-w-0",children:[s.jsx("legend",{className:"mb-1.5 text-xs font-medium",children:"Open in"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{id:"shell",name:"Shell"},...pe.length===1?pe:[]].map(ue=>s.jsxs("label",{className:"relative min-w-0",children:[s.jsx("input",{type:"radio",name:"quick-open-in",value:ue.id,checked:U===ue.id,onChange:()=>H(ue.id),className:"peer sr-only"}),s.jsxs("span",{className:"flex min-h-16 cursor-pointer items-center gap-2.5 rounded-lg border border-border bg-background px-3 py-3 text-xs transition-colors hover:bg-muted/50 peer-checked:border-foreground/40 peer-checked:bg-accent peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-disabled:pointer-events-none peer-disabled:opacity-50",children:[ue.id==="shell"?s.jsx(Wv,{className:"size-5 shrink-0","aria-hidden":"true"}):s.jsx("img",{src:ue.logo,alt:"",className:"size-5 shrink-0 object-contain"}),s.jsx("span",{className:"min-w-0 flex-1 font-medium",children:ue.name}),s.jsx("span",{"aria-hidden":"true",className:`flex size-3.5 shrink-0 items-center justify-center rounded-full border ${U===ue.id?"border-foreground":"border-muted-foreground/40"}`,children:U===ue.id&&s.jsx("span",{className:"size-1.5 rounded-full bg-foreground"})})]})]},ue.id))})]}),pe.map(ue=>{const Ye=BE(v,ue.id);return Ye.length?s.jsxs("div",{className:"grid gap-1.5",children:[s.jsxs(On,{htmlFor:`quick-sign-in-${ue.id}`,className:"text-xs",children:[ue.name," API key"]}),s.jsxs(Uh,{value:W[ue.id]||"",onValueChange:Pe=>B(st=>({...st,[ue.id]:Pe??""})),children:[s.jsx(Fh,{id:`quick-sign-in-${ue.id}`,className:"w-full text-xs",children:s.jsx(Hh,{children:W[ue.id]||"None, I’ll use my subscription"})}),s.jsx(Gh,{align:"start",alignItemWithTrigger:!1,children:s.jsxs(wk,{children:[s.jsx(Td,{value:"",className:"text-xs",children:"None, I’ll use my subscription"}),Ye.map(Pe=>s.jsx(Td,{value:Pe.name,className:"text-xs",children:Pe.name},Pe.name))]})})]})]},ue.id):null})]}),s.jsx(yo,{value:"template",className:"grid gap-4",children:s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"sandbox-image-template",className:"text-xs",children:"Environment"}),s.jsxs(Uh,{value:A,onValueChange:ue=>R(ue??""),children:[s.jsx(Fh,{id:"sandbox-image-template","aria-invalid":Fe&&!ve||void 0,className:"w-full text-xs",children:s.jsx(Hh,{children:A||"Choose a template"})}),s.jsx(Gh,{align:"start",alignItemWithTrigger:!1,children:s.jsx(wk,{children:C.map(ue=>s.jsx(Td,{value:ue.name,className:"text-xs",children:ue.name},ue.name))})})]}),Fe&&!ve&&C.length>0&&s.jsx("p",{className:"text-[11px] text-destructive",children:"Choose a template to create a sandbox."}),!C.length&&s.jsx("p",{className:`text-[11px] ${Fe?"text-destructive":"text-muted-foreground"}`,children:"No ready templates. Use Quick setup or create one in Templates."}),ve&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:mt?`Included tools: ${[...mt.map(ue=>ue.name),...(ve.recipe.customAgents??[]).map(ue=>ue.name),"Terminal"].join(", ")}`:"Installed tools are not reported by this template."})]})}),L==="template"&&s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium",children:"Providers"}),v.length?s.jsx("div",{className:"flex flex-wrap gap-1.5",children:v.map(ue=>{const Ye=z.includes(ue.name);return s.jsxs("button",{type:"button","aria-pressed":Ye,onClick:()=>_(Pe=>Ye?Pe.filter(st=>st!==ue.name):[...Pe,ue.name]),className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${Ye?"border-foreground/25 bg-accent":"border-border text-muted-foreground hover:text-foreground"}`,children:[s.jsx("span",{className:`size-1.5 rounded-full ${Ye?"bg-emerald-500":"bg-stone-300"}`,"aria-hidden":"true"}),s.jsx("span",{className:"font-mono",children:ue.name}),s.jsx("span",{className:"text-muted-foreground",children:ue.type})]},ue.name)})}):s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"No providers"})]}),J&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:J})]}),s.jsxs(Yn.aside,{initial:x?!1:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.25,delay:.06,ease:[.22,1,.36,1]},className:"grid min-w-0 content-start gap-6 border-t border-border bg-muted/25 p-5 @3xl:overflow-y-auto @3xl:border-t-0 @3xl:border-l @3xl:p-6",children:[ke?s.jsx(PW,{org:ke,value:je,onChange:Ae,invalid:Fe&&!Me,onAddPolicy:()=>I(Id({appliesTo:{everyone:!1,groups:je,sandboxes:[]}})),onCreated:ue=>_e(Ye=>({...Ye,groups:[...Ye.groups,ue].sort((Pe,st)=>Pe.name.localeCompare(st.name)),members:{...Ye.members,[ue.id]:[]}}))}):s.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:J?"Groups unavailable. Reopen this dialog to retry.":"Loading groups…"}),(L==="quick"||at&&(Xe||ot.includes("aider")))&&s.jsxs("div",{className:"space-y-3",children:[L==="quick"&&!Te&&s.jsx(N3,{localCatalog:te,autoPrepare:!0,automaticAccess:!0,preparationContext:"sandbox",accessReview:k,onAccessReview:M,value:T,onChange:O}),at&&Xe&&s.jsx("p",{role:"alert",className:"text-xs text-destructive",children:ot.includes("aider")?"Setup installation is unavailable for Aider. Choose another agent.":L==="quick"?"Choose an agent to use this Setup.":"Choose a template with a supported agent to use this Setup."}),at&&!Xe&&ot.includes("aider")&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Setup installation is unavailable for Aider."})]}),s.jsxs("div",{className:"grid min-w-0",children:[s.jsx(VE,{title:"Add project files",summary:Ue,children:s.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium",children:"Start with"}),s.jsx("div",{className:"flex items-center gap-1 rounded-md border border-border p-0.5",children:AW.filter(ue=>!se||ue.id!=="folder").map(ue=>s.jsx("button",{type:"button",onClick:()=>Q(ue.id),"aria-pressed":$===ue.id,className:`flex-1 rounded px-2.5 py-1 text-[11px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${$===ue.id?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,children:ue.label},ue.id))}),$==="folder"&&s.jsxs(s.Fragment,{children:[s.jsx(Ot,{value:ee,onChange:ue=>ne(ue.target.value),className:"font-mono text-xs",placeholder:"~/code/my-project","aria-label":"Folder on this computer"}),(ie==null?void 0:ie.loading)&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Checking the folder…"}),(ie==null?void 0:ie.error)&&s.jsx("p",{className:"text-[11px] text-red-700",children:ie.error}),(ie==null?void 0:ie.data)&&s.jsx(zW,{plan:ie.data,sandbox:S})]}),$==="repo"&&s.jsxs(s.Fragment,{children:[s.jsx(Ot,{value:Z,onChange:ue=>de(ue.target.value),className:"font-mono text-xs",placeholder:"https://github.com/org/repo","aria-label":"Git repository URL"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[Oe?s.jsxs(s.Fragment,{children:["Cloned into ",s.jsx("span",{className:"font-mono",children:Oe})," once the sandbox starts. "]}):"An https:// URL. ","Public repositories only. Your access rules must allow Git connections to this host."]})]})]})}),$e.profiles.length>0&&s.jsx(VE,{title:$e.profiles.some(ue=>ue.rule.startsWith("tool-"))?"Agent and tool connections":"Agent connections",summary:`${new Set($e.profiles.flatMap(ue=>ue.endpoints.map(Ye=>`${Ye.host}:${Ye.ports.join(",")}`))).size} destinations`,children:s.jsx("div",{className:"max-h-52 divide-y overflow-y-auto",children:$e.profiles.map(ue=>s.jsxs("details",{className:"px-3 py-2",children:[s.jsxs("summary",{className:"cursor-pointer text-xs",children:[ue.name,s.jsxs("span",{className:"ml-2 text-[11px] text-muted-foreground",children:[ue.endpoints.length," destinations · ",ue.rule]})]}),s.jsx("ul",{className:"mt-2 space-y-1",children:ue.endpoints.map(Ye=>{var Pe;return s.jsxs("li",{className:"flex flex-wrap items-baseline justify-between gap-x-3 text-[11px]",children:[s.jsxs("span",{className:"break-all font-mono",children:[Ye.host,":",Ye.ports.join(",")]}),s.jsx("span",{className:"text-muted-foreground",children:Ye.tlsSkip?"TLS passthrough":(Pe=Ye.allow)!=null&&Pe.length?`${Ye.allow.map(st=>st.method).join(", ")} only`:Ye.access==="read-only"?"Read only":"Read & write"})]},Ye.host)})}),ue.authentication&&s.jsx("p",{className:"mt-2 text-[11px]",children:ue.authentication}),s.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:"Allowed programs"}),s.jsx("ul",{className:"mt-1 space-y-1 break-all font-mono text-[10px] text-muted-foreground",children:ue.binaries.map(Ye=>s.jsx("li",{children:Ye},Ye))})]},ue.id))})})]})]})]})}),s.jsxs(ea,{className:"mx-0 mb-0 shrink-0 items-center rounded-none border-t border-border bg-popover px-5 py-4 @3xl:px-7",children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s.jsx(ce,{type:"submit",disabled:(m==null?void 0:m.connected)===!1,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:"Create sandbox"})]})]})})})})}),s.jsx(WM,{open:!!re,initial:re,onOpenChange:ue=>{ue||I(null)},groups:(ke==null?void 0:ke.groups)??[],sandboxes:(p??[]).map(ue=>ue.name),assignments:(ke==null?void 0:ke.assignments)??{},onGroupCreated:ue=>_e(Ye=>({...Ye,groups:[...Ye.groups,ue]})),onSaved:(ue,Ye)=>{var Pe;Ae(st=>[...new Set([...st,...Ye.appliesTo.groups])]),_e(st=>({...st,policies:[...st.policies.filter(vt=>vt.id!==Ye.id),Ye]})),(Pe=ue.failed)!=null&&Pe.length?He.error("Rule saved, but some sandboxes could not be updated."):He.success(`Saved ${Ye.name}`)}})]})}function tx({count:e,rowHeight:t,overscan:r=8}){const[a,l]=g.useState(null),[c,u]=g.useState(0),[f,h]=g.useState(0);g.useLayoutEffect(()=>{if(!a)return;const b=()=>h(a.clientHeight);b();const v=new ResizeObserver(b);return v.observe(a),()=>v.disconnect()},[a]);const m=Math.max(0,Math.floor(c/t)-r),x=Math.ceil((f||600)/t)+r*2,p=Math.min(e,m+x);return{ref:l,onScroll:b=>u(b.currentTarget.scrollTop),start:m,end:p,paddingTop:m*t,totalHeight:e*t,scrollToTop:()=>{a==null||a.scrollTo({top:0}),u(0)}}}const FE=["api.anthropic.com","api.openai.com","github.com","pypi.org","registry.npmjs.org","files.pythonhosted.org","objects.githubusercontent.com","huggingface.co","sentry.io","api.stripe.com","pastebin.com","ngrok.io","s3.amazonaws.com"],GE=new Set(["pastebin.com","ngrok.io","api.stripe.com"]);function _W(e){let t=e>>>0;return()=>(t=t*1664525+1013904223>>>0)/2**32}const LW=(e,t)=>t[Math.floor(e()*t.length)];function q3(e,t=Math.random,r=new Date().toISOString()){const a=e[Math.floor(t()**2.2*e.length)],l=t()<.08?LW(t,[...GE]):FE[Math.floor(t()**1.8*(FE.length-3))],c=GE.has(l)?t()<.9:t()<.03;return{sandbox:a.name,at:r,kind:"audit",level:"OCSF",category:"NET",action:"OPEN",severity:c?"MED":"INFO",verdict:c?"denied":"allowed",destination:`${l}:443`,binary:"/usr/local/bin/claude",reason:c?"policy_dns_ineligible":null,policy:c?null:"_provider_my_claude",message:`NET:OPEN [${c?"MED":"INFO"}] ${c?"DENIED":"ALLOWED"} /usr/local/bin/claude(0) -> ${l}:443 #${Math.floor(t()*1e9)}`,detail:`/usr/local/bin/claude(0) -> ${l}:443`}}function BW(e,t=2e3){const r=_W(11),a=Date.now(),l=new Map(e.map(c=>[c.name,c.phase]));return Array.from({length:t},(c,u)=>q3(e,r,new Date(a-u*1500).toISOString())).filter(c=>["ready","error"].includes(l.get(c.sandbox)))}function Y3(e){const t=g.useMemo(()=>null,[]),[r,a]=g.useState(()=>t?BW(t):[]);return g.useEffect(()=>{if(!t)return;const l=t.filter(u=>u.phase==="ready"),c=setInterval(()=>{const u=Array.from({length:1+Math.floor(Math.random()*6)},()=>q3(l));a(f=>[...u,...f].slice(0,2e3))},450);return()=>clearInterval(c)},[t]),t?{...e,sandboxes:t,events:r,demo:!0}:e}const qE=[],$W={context:'["preview","default"]',gateway:"preview",workspace:"default",label:"Local",remote:!1,connected:!0},YE=40,VW=["all","running","sleeping","provisioning","error","unknown"],os=e=>(e==null?void 0:e.id)??(e==null?void 0:e.context),tr=Vn,Ah=e=>JSON.stringify([os(e.location),e.name]),Ci=e=>e.toLocaleString("en-US"),wy=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),KE=[{id:"name",label:"Sandbox",width:"26%"},{id:"type",label:"Type",width:"11%",filter:"values"},{id:"phase",label:"Status",width:"11%",filter:"values"},{id:"owner",label:"Owner",width:"12%",filter:"values"},{id:"image",label:"Image",width:"22%",filter:"values"},{id:"startedAt",label:"Uptime",width:"8%"},{id:"createdAt",label:"Created",width:"10%",filter:"recent"}],UW=[{value:"1",label:"Last 24 hours"},{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"}],jy={type:[],phase:[],owner:[],image:[],createdAt:""},HW=Object.fromEntries(Object.entries(Ul).map(([e,t])=>[t.label,e])),K3=()=>s.jsx(AR,{"aria-hidden":"true",strokeWidth:1.5,className:"size-3.5 shrink-0 text-muted-foreground"}),Sy={type:e=>s.jsx(D3,{type:HW[e.value]}),phase:e=>s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full ${Cl[e.value].bar}`}),s.jsx("span",{className:"truncate",children:e.label})]}),image:e=>s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx(K3,{}),s.jsx("span",{className:"truncate font-mono text-[11px]",children:e.label})]})},XE={type:e=>e.type,phase:e=>ex(e.sandbox.phase),owner:e=>e.owner,image:e=>e.image},WE=Object.keys(Ul);function FW({onNavigate:e,allowRemote:t=!1,createRequest:r=0,onCreateRequestHandled:a}){const l=$t(),c=Er(),u=Y3(qa()),f=ju(),{locations:h}=f,m=Cn(),[x,p]=g.useState(null),b=os(m)??x,v=os(m)??"",[j,S]=g.useState(null),[N,C]=g.useState(null),E=t;g.useEffect(()=>{let me=!0;return l.contextKey().then(Me=>{me&&p(JSON.stringify([l.target,Me]))}).catch(()=>{}),()=>{me=!1}},[l]);const T=h.find(me=>os(me)===b),O=h.find(me=>os(me)===v&&me.connected)??(T!=null&&T.connected?T:null)??h.find(me=>me.target===l.target&&!me.remote&&me.connected)??h.find(me=>me.target===l.target&&me.connected),k=h.find(me=>os(me)===os(j))??j??O,M=g.useSyncExternalStore(vo.subscribe,vo.getSnapshot),A=g.useMemo(()=>M.filter(me=>me.status==="created"&&!me.reported).map(me=>me.sandbox),[M]),R=g.useMemo(()=>u.demo?(u.sandboxes??qE).map((me,Me)=>{const Oe=T??O??$W,tt=WE[Me%WE.length];return{...me,location:tt===lp(Oe)?Oe:{...Oe,placement:tt,host:`${tt}-demo`}}}):f.sandboxes,[u.demo,u.sandboxes,T,O,f.sandboxes]),z=g.useMemo(()=>{const me=new Set(R.map(Ah));return[...A.filter(Me=>!me.has(Ah(Me))).map(Me=>({...Me,location:h.find(Oe=>os(Oe)===os(Me.location))??Me.location})),...R]},[R,A,h]),[_,L]=g.useState(""),[Y,P]=g.useState(jy),V=(me,Me)=>P(Oe=>({...Oe,[me]:Me})),[U,H]=g.useState({key:"name",direction:"asc"}),F=g.useDeferredValue(_),[q,W]=g.useState(null),[B,J]=g.useState(()=>new Set),[X,re]=g.useState(null),[I,$]=g.useState(!1),Q=g.useRef(!1),[G,se]=g.useState([]),[ee,ne]=g.useState(!!(c!=null&&c.createRequested));g.useEffect(()=>{c!=null&&c.createRequested&&(ne(!0),c.requestCreate(!1))},[c==null?void 0:c.createRequested]);const[ie,oe]=g.useState(Date.now),Z=g.useRef(null);g.useEffect(()=>{const me=setInterval(()=>oe(Date.now()),3e4),Me=Ue=>{var Ge;(Ue.metaKey||Ue.ctrlKey)&&Ue.key.toLowerCase()==="k"&&(Ue.preventDefault(),(Ge=Z.current)==null||Ge.focus())};window.addEventListener("keydown",Me);const Oe=()=>{try{const Ue=sessionStorage.getItem(kl);if(sessionStorage.removeItem(kl),Ue){let Ge;try{Ge=JSON.parse(Ue)}catch{}C(Ge&&typeof Ge.name=="string"?{name:Ge.name,context:os(Ge.location)??(Ge.context&&Ge.target?JSON.stringify([Ge.target,Ge.context]):Ge.context)}:{name:Ue})}}catch{}},tt=Ue=>{var ht;const Ge=Ue.detail;typeof(Ge==null?void 0:Ge.name)=="string"&&(C({name:Ge.name,context:((ht=Ge.location)==null?void 0:ht.id)??(Ge.context?JSON.stringify([Ge.target??l.target,Ge.context]):void 0)}),f.refresh())};return Oe(),window.addEventListener("openrod-sandbox-handoff",tt),window.addEventListener(kl,Oe),()=>{clearInterval(me),window.removeEventListener("keydown",Me),window.removeEventListener(kl,Oe),window.removeEventListener("openrod-sandbox-handoff",tt)}},[]),g.useEffect(()=>{const me=(N==null?void 0:N.context)??b;if(!N||!me||f.loading)return;const Me=z.find(Oe=>Oe.name===N.name&&os(Oe.location)===me);if(Me!=null&&Me.location.connected){W(Me),C(null);try{sessionStorage.removeItem(kl)}catch{}}},[N,b,f.loading,z]);const de=g.useRef(null);g.useEffect(()=>{const me=M.filter(Oe=>Oe.status==="created");if(!de.current){de.current=new Set(me.map(Oe=>Oe.id));return}const Me=me.filter(Oe=>!de.current.has(Oe.id));Me.length&&(Me.forEach(Oe=>de.current.add(Oe.id)),W(null),L(""),P(jy),H({key:"createdAt",direction:"desc"}),f.refresh())},[M]);const ke=g.useMemo(()=>uK(z),[z]),_e=g.useMemo(()=>z.map(me=>({sandbox:me,owner:Ld(me),type:Ul[lp(me.location)].label,image:np(me.image,me.imageTemplateName),search:[me.name,me.id,me.image,me.imageTemplateName,ws(me.location),Ul[lp(me.location)].label,Ld(me),...me.providers??[]].join(" ").toLowerCase()})),[z]),je=g.useMemo(()=>Object.fromEntries(Object.entries(XE).map(([me,Me])=>{const Oe=new Map;for(const Ue of _e)Oe.set(Me(Ue),(Oe.get(Me(Ue))??0)+1);const tt=[...Oe.keys()].sort(me==="phase"?(Ue,Ge)=>Iv.indexOf(Ue)-Iv.indexOf(Ge):wy.compare);return[me,tt.map(Ue=>({value:Ue,label:me==="phase"?Cl[Ue].label:Ue,count:Oe.get(Ue)}))]})),[_e]),Ae=g.useMemo(()=>{const me=F.trim().toLowerCase(),Me=Y.createdAt?ie-Number(Y.createdAt)*864e5:null,Oe=_e.filter(Ue=>(!v||os(Ue.sandbox.location)===v)&&Object.entries(XE).every(([Ge,ht])=>!Y[Ge].length||Y[Ge].includes(ht(Ue)))&&(Me===null||Date.parse(Ue.sandbox.createdAt)>=Me)&&(!me||Ue.search.includes(me))),tt=Ue=>U.key==="owner"||U.key==="image"||U.key==="type"?Ue[U.key]:U.key==="startedAt"?Ue.sandbox.phase==="ready"?Ue.sandbox.startedAt:null:Ue.sandbox[U.key];return Oe.sort((Ue,Ge)=>{const ht=tt(Ue),yt=tt(Ge);if(!ht&&yt)return 1;if(ht&&!yt)return-1;const ue=wy.compare(ht??"",yt??"");return(U.direction==="asc"?ue:-ue)||wy.compare(Ue.sandbox.name,Ge.sandbox.name)})},[_e,Y,v,F,U,ie]);g.useEffect(()=>{const me=new Set(z.filter(Me=>{var Oe;return((Oe=Me.location)==null?void 0:Oe.connected)&&!u.demo}).map(tr));J(Me=>{const Oe=new Set([...Me].filter(tt=>me.has(tt)));return Oe.size===Me.size?Me:Oe})},[z,u.demo]);const te=g.useMemo(()=>z.filter(me=>{var Me;return((Me=me.location)==null?void 0:Me.connected)&&B.has(tr(me))}),[z,B]),Ee=Ae.filter(me=>{var Me;return((Me=me.sandbox.location)==null?void 0:Me.connected)&&!u.demo}),Te=Ee.reduce((me,Me)=>me+Number(B.has(tr(Me.sandbox))),0),be=Ee.length>0&&Te===Ee.length,We=g.useCallback(me=>{var Me;(Me=me.location)!=null&&Me.connected&&J(Oe=>{const tt=new Set(Oe),Ue=tr(me);return tt.has(Ue)?tt.delete(Ue):tt.add(Ue),tt})},[]),Se=()=>J(me=>{const Me=new Set(me);for(const{sandbox:Oe}of Ee)be?Me.delete(tr(Oe)):Me.add(tr(Oe));return Me});async function Fe(){if(Q.current||u.demo||!(X!=null&&X.length))return;Q.current=!0,$(!0),se([]);const me=new Set,Me=[];let Oe=0;const tt=async()=>{for(;Oe<X.length;){const Ue=X[Oe++];try{const Ge=h.find(ht=>os(ht)===os(Ue.location));if(!(Ge!=null&&Ge.connected))throw new Error("Location is disconnected. Reconnect before deleting.");await qr(c!=null&&c.localViewer?Ge.target??"local":l.target,l.signal,Ge.context).lifecycle(Ue.name,"delete"),me.add(tr(Ue))}catch(Ge){Me.push({key:tr(Ue),name:Ue.name,location:Ue.location,message:Ge.message})}}};try{await Promise.all(Array.from({length:Math.min(4,X.length)},tt)),J(Ue=>new Set([...Ue].filter(Ge=>!me.has(Ge)))),se(Me),me.size&&He.success(`Deletion requested for ${Ci(me.size)} ${me.size===1?"sandbox":"sandboxes"}`),Me.length&&He.error(`${Ci(Me.length)} ${Me.length===1?"sandbox could":"sandboxes could"} not be deleted. Review the errors and retry.`),f.refresh()}finally{Q.current=!1,$(!1),re(null)}}const Re=tx({count:Ae.length,rowHeight:YE});g.useEffect(()=>{Re.scrollToTop()},[F,Y,v,U]);const ve=g.useMemo(()=>XX(z,30,ie),[z,ie]),pe=()=>{L(""),P(jy)},$e=_||Object.values(Y).some(me=>me.length),Je=z.length===0&&f.loading&&!u.demo,mt=z.length===0&&f.error,ot=q&&(z.find(me=>tr(me)===tr(q))??(q.id==null?z.find(me=>Ah(me)===Ah(q)):null)??q),Ie=ot&&(h.find(me=>os(me)===os(ot.location))??ot.location),at=ot?{...u,sandboxes:[ot],events:os(Ie)===b?u.events:qE,overview:os(Ie)===b?u.overview:{gateway:{name:Ie==null?void 0:Ie.gateway,workspace:Ie==null?void 0:Ie.workspace,remote:Ie==null?void 0:Ie.remote}},refresh:f.refresh}:null,Xe=()=>{S(O??null),ne(!0)};return g.useEffect(()=>{r&&(Xe(),a==null||a())},[r]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex h-[calc(100svh-3.5rem)] min-h-0 flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 pt-4 pb-3 sm:px-6",children:[s.jsx("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"Sandbox status",children:VW.filter(me=>["all","running","sleeping"].includes(me)||ke.status[me]>0).map(me=>s.jsxs("button",{"aria-pressed":me==="all"?!Y.phase.length:Y.phase.length===1&&Y.phase[0]===me,onClick:()=>V("phase",me==="all"?[]:[me]),className:`rounded-md px-3 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${(me==="all"?!Y.phase.length:Y.phase.length===1&&Y.phase[0]===me)?"bg-accent/70":"hover:bg-muted/60"}`,children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[me!=="all"&&s.jsx("span",{"aria-hidden":"true",className:`size-1.5 rounded-full ${Cl[me].bar}`}),me==="all"?"Sandboxes":Cl[me].label]}),s.jsx("span",{className:"mt-1 block font-mono text-lg leading-none tabular-nums",children:s.jsx(Qd,{value:me==="all"?ke.total:ke.status[me]})})]},me))}),s.jsx("div",{className:"ml-auto hidden w-64 px-3 lg:block",children:s.jsx(QX,{points:ve,height:34,title:"Boxes · 30d"})})]}),s.jsx("div",{className:"flex h-[3px] shrink-0 overflow-hidden",role:"img","aria-label":Object.entries(ke.status).map(([me,Me])=>`${Me} ${Cl[me].label}`).join(", "),children:Object.entries(ke.status).map(([me,Me])=>Me>0&&s.jsx("span",{className:Cl[me].strip,style:{width:`${Me/ke.total*100}%`}},me))}),f.error&&z.length>0&&s.jsxs(Li,{id:"sandboxes:inventory-error",tone:"warning",title:"Inventory refresh failed",actions:s.jsx(ce,{size:"xs",variant:"outline",onClick:f.refresh,children:"Retry"}),children:["Showing the last reading. ",f.error]}),h.filter(me=>!me.connected).map(me=>s.jsx(qW,{location:me,onReconnected:f.refresh},os(me))),u.demo&&s.jsx("p",{className:"border-b border-border px-6 py-2 text-xs text-amber-700",children:"Preview · synthetic sandbox data"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-4 py-2 sm:px-6",children:[s.jsx(ra,{ref:Z,value:_,onValueChange:L,placeholder:"Search name, owner, image…","aria-label":"Search sandboxes",className:"mr-auto w-full sm:w-64"}),$e&&s.jsxs(ce,{variant:"ghost",size:"sm",onClick:pe,children:[s.jsx(En,{className:"size-3"}),"Clear"]}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Refresh sandboxes",onClick:f.refresh,children:s.jsx($a,{className:"size-3.5"})}),s.jsxs(ce,{size:"sm",disabled:!O&&!E,onClick:Xe,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[s.jsx(ds,{className:"size-3.5"}),"New sandbox"]})]}),te.length>0&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-border bg-accent/30 px-6 py-2",children:[s.jsxs("span",{role:"status",className:"mr-auto text-xs",children:[s.jsx("strong",{children:Ci(te.length)})," selected",te.length>Te&&s.jsxs("span",{className:"text-muted-foreground",children:[" · ",Ci(te.length-Te)," outside current filters"]})]}),s.jsx(ce,{variant:"ghost",size:"sm",disabled:I,onClick:()=>J(new Set),children:"Clear selection"}),s.jsxs(ce,{variant:"destructive",size:"sm",disabled:I||u.demo,title:u.demo?"Deletion is unavailable for synthetic preview data":void 0,onClick:()=>re([...te]),children:[s.jsx(Gn,{className:"size-3.5"}),I?"Deleting…":"Delete selected"]})]}),G.length>0&&s.jsxs(Li,{id:"sandboxes:delete-errors",tone:"error",title:"Some sandboxes could not be deleted",onDismiss:()=>se([]),dismissLabel:"Dismiss deletion errors",children:[s.jsx("p",{children:"Failed boxes remain selected for retry."}),s.jsx("ul",{className:"mt-1 max-h-28 overflow-auto",children:G.map(me=>s.jsxs("li",{children:[s.jsx("strong",{className:"text-foreground",children:me.name})," ",s.jsx(Co,{location:me.location}),": ",me.message]},me.key))})]}),s.jsx("div",{ref:Re.ref,onScroll:Re.onScroll,tabIndex:0,role:"region","aria-label":"Sandbox inventory",className:"min-h-0 flex-1 overflow-auto overscroll-contain outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:Je?s.jsx("p",{role:"status",className:"py-20 text-center text-sm text-muted-foreground",children:"Loading sandboxes…"}):mt?s.jsxs("div",{role:"alert",className:"py-16 text-center",children:[s.jsx("p",{children:"Inventory unavailable"}),s.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:f.error}),s.jsx(ce,{variant:"outline",onClick:f.refresh,className:"mt-4",children:"Retry"})]}):Ae.length?s.jsxs("table",{"aria-label":"Sandboxes","aria-rowcount":Ae.length+1,className:"w-full min-w-[1040px] table-fixed border-separate border-spacing-0 text-xs",children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:48}}),KE.map(me=>s.jsx("col",{style:{width:me.width}},me.id))]}),s.jsx("thead",{className:"sticky top-0 z-10 bg-muted",children:s.jsxs("tr",{"aria-rowindex":1,children:[s.jsx("th",{scope:"col",className:"h-9 border-b border-border px-4 sm:pl-6",children:s.jsx(X3,{label:"Select all matching sandboxes",checked:be,mixed:Te>0&&!be,disabled:I||!Ee.length,onChange:Se})}),KE.map(me=>s.jsx("th",{scope:"col","aria-sort":U.key===me.id?U.direction==="asc"?"ascending":"descending":"none",className:"group/column h-9 border-b border-border px-4 text-left font-medium text-muted-foreground first:pl-6",children:s.jsxs("div",{className:"flex h-9 items-center gap-1",children:[s.jsxs("button",{onClick:()=>H(Me=>({key:me.id,direction:Me.key===me.id&&Me.direction==="asc"?"desc":"asc"})),className:"flex h-9 min-w-0 items-center gap-1.5 outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx("span",{className:"truncate",children:me.label}),U.key===me.id&&(U.direction==="asc"?s.jsx(sf,{className:"size-3 shrink-0"}):s.jsx(nf,{className:"size-3 shrink-0"}))]}),s.jsx(YW,{column:me,sort:U,onSort:Me=>H({key:me.id,direction:Me}),values:je[me.id],value:Y[me.id],onFilter:Me=>V(me.id,Me)})]})},me.id))]})}),s.jsxs("tbody",{children:[Re.paddingTop>0&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:8,style:{height:Re.paddingTop,padding:0,border:0}})}),Ae.slice(Re.start,Re.end).map((me,Me)=>{var Oe;return s.jsx(GW,{row:me,now:ie,index:Re.start+Me+2,onOpen:W,selected:B.has(tr(me.sandbox)),onSelect:We,disabled:I||u.demo||!((Oe=me.sandbox.location)!=null&&Oe.connected)},tr(me.sandbox))}),Re.end<Ae.length&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:8,style:{height:(Ae.length-Re.end)*YE,padding:0,border:0}})})]})]}):s.jsxs("div",{className:"py-20 text-center",children:[s.jsx(Fl,{className:"mx-auto mb-3 size-6 text-muted-foreground"}),s.jsx("p",{className:"text-sm",children:z.length?"No matching sandboxes":"No sandboxes yet"}),s.jsx(ce,{variant:"outline",disabled:!z.length&&!O&&!E,className:"mt-4",onClick:()=>z.length?pe():Xe(),children:z.length?"Clear filters":"Create sandbox"})]})}),s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border bg-card px-6 py-2 text-[11px] text-muted-foreground",children:[s.jsxs("span",{children:[s.jsx("strong",{className:"font-medium text-foreground",children:Ci(Ae.length)}),$e?` of ${Ci(z.length)}`:""," sandboxes"]}),s.jsx("span",{className:"hidden sm:inline",children:"Click a row to inspect · ⌘K to search"})]})]}),ot&&(Ie==null?void 0:Ie.connected)&&s.jsx(Pa,{location:Ie,children:s.jsx(gW,{name:ot.name,sandbox:ot,liveData:at,onClose:()=>W(null),onNavigate:e,onChanged:f.refresh})},tr(ot)),s.jsx(Qr,{open:X!==null,onOpenChange:me=>{!me&&!Q.current&&re(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Delete ",Ci((X==null?void 0:X.length)??0)," ",(X==null?void 0:X.length)===1?"sandbox":"sandboxes","?"]}),s.jsx(no,{children:"This permanently deletes the selected sandboxes and their data. This cannot be undone."})]}),s.jsx("ul",{"aria-label":"Sandboxes to delete",className:"max-h-48 overflow-auto rounded-md border border-border p-3 text-xs",children:X==null?void 0:X.map(me=>s.jsxs("li",{className:"flex items-center gap-2 break-all py-1",children:[me.name,s.jsx(Co,{location:me.location})]},tr(me)))}),s.jsxs(eo,{children:[s.jsx(ro,{disabled:I,children:"Cancel"}),s.jsx(so,{variant:"destructive",disabled:I||!(X!=null&&X.length),onClick:Fe,children:I?"Deleting…":"Delete sandboxes"})]})]})}),s.jsx(Pa,{location:k,children:s.jsx(G3,{open:ee,onOpenChange:ne,locations:h,location:k,onLocationChange:S,onRefreshLocations:f.refresh,allowRemote:E})})]})}const GW=g.memo(function({row:t,now:r,index:a,onOpen:l,selected:c,onSelect:u,disabled:f}){var j;const{sandbox:h,owner:m,image:x}=t,p="h-10 border-b border-border/60 px-4 py-0 align-middle text-muted-foreground",b=!((j=h.location)!=null&&j.connected),v=`${h.name} at ${ws(h.location)}`;return s.jsxs("tr",{"aria-rowindex":a,"aria-disabled":b||void 0,onClick:()=>{b||l(h)},className:`group transition-colors ${b?"opacity-60":"cursor-pointer hover:bg-muted/60 focus-within:bg-muted/60"} ${c?"bg-accent/40":"bg-card"}`,children:[s.jsx("td",{className:`${p} sm:pl-6`,onClick:S=>S.stopPropagation(),children:s.jsx(X3,{label:`Select ${v}`,checked:c,disabled:f,onChange:()=>u(h)})}),s.jsx("td",{className:`${p} pl-6`,children:s.jsxs("button",{disabled:b,"aria-haspopup":"dialog","aria-label":`Open ${v}`,onClick:S=>{S.stopPropagation(),b||l(h)},className:"flex h-9 w-full min-w-0 items-center gap-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed",children:[s.jsx(Fl,{"aria-hidden":"true",strokeWidth:1.4,className:"size-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate font-medium text-foreground",title:h.name,children:h.name}),s.jsx(Mi,{className:"ml-auto size-3 shrink-0 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"})]})}),s.jsx("td",{className:p,children:s.jsx(z3,{location:h.location})}),s.jsx("td",{className:p,children:s.jsxs("span",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx("span",{className:`size-1.5 shrink-0 rounded-full ${Ba(h.phase).bar}`}),Gp[h.phase]??"Unknown"]})}),s.jsx("td",{className:p,children:s.jsx("span",{className:"block truncate",title:m,children:m})}),s.jsx("td",{className:p,children:s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",title:h.image||x,children:[s.jsx(K3,{}),s.jsx("span",{className:"truncate font-mono text-[11px]",children:x})]})}),s.jsx("td",{className:p,children:s.jsx("span",{className:"block truncate font-mono text-[11px]",title:"Uptime requires a reported start time",children:dK(h,r)})}),s.jsx("td",{className:p,children:s.jsxs("span",{className:"block truncate tabular-nums",title:h.createdAt||"Not reported",children:[l3(h.createdAt,r),h.createdAt?" ago":""]})})]})});function qW({location:e,onReconnected:t}){const r=$t(),[a,l]=g.useState({busy:!1,error:null}),c=g.useRef(!0);g.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);async function u(){l({busy:!0,error:null});try{let f=await r.connect({host:e.host});for(;f.status==="working";)await new Promise(h=>setTimeout(h,1e3)),f=await r.connectionJob(f.id);if(f.status!=="ready")throw new Error(f.error||`${e.host} needs setup. Use New sandbox → Remote to finish connecting.`);t(),c.current&&l({busy:!1,error:null})}catch(f){c.current&&l({busy:!1,error:f.message})}}return s.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1 border-b border-amber-200 bg-amber-50 px-6 py-2 text-xs text-amber-800",children:[s.jsxs("span",{children:[ws(e)," disconnected. Its last inventory is retained; reconnect to use these resources.",e.error?` ${e.error}`:"",a.error?` ${a.error}`:""]}),e.host&&s.jsxs(ce,{size:"xs",variant:"outline",disabled:a.busy,onClick:u,children:[s.jsx($a,{className:`size-3 ${a.busy?"animate-spin motion-reduce:animate-none":""}`}),a.busy?"Reconnecting…":"Reconnect"]})]})}function X3({label:e,checked:t,mixed:r=!1,disabled:a,onChange:l}){const c=g.useRef(null);return g.useEffect(()=>{c.current&&(c.current.indeterminate=r)},[r]),s.jsx("input",{ref:c,type:"checkbox","aria-label":e,checked:t,disabled:a,onChange:l,className:"block size-4 cursor-pointer rounded border-border accent-[var(--action)] focus-visible:outline-2 focus-visible:outline-ring disabled:cursor-not-allowed"})}function YW({column:e,sort:t,onSort:r,values:a,value:l,onFilter:c}){const u=e.filter==="values"?l.length>0:e.filter==="recent"?!!l:!1,f=t.key===e.id?t.direction:null,h=m=>c(l.includes(m)?l.filter(x=>x!==m):[...l,m]);return s.jsxs(Af,{children:[s.jsx(Of,{render:s.jsx("button",{type:"button","aria-label":`Sort and filter ${e.label}${u?" (filtered)":""}`,className:`flex h-6 shrink-0 items-center justify-center overflow-hidden rounded outline-none hover:bg-background/70 hover:text-foreground focus-visible:w-6 focus-visible:ring-2 focus-visible:ring-ring data-[popup-open]:w-6 ${u?"w-6 text-foreground":"w-0 group-hover/column:w-6"}`}),children:s.jsx(TI,{className:"size-3.5 shrink-0"})}),s.jsxs(Mf,{align:"start",className:"w-56",children:[s.jsxs(ep,{children:[s.jsxs(Gs,{className:"text-xs",onClick:()=>r("asc"),children:[s.jsx(sf,{className:"size-3.5"}),"Sort ascending",f==="asc"&&s.jsx(qn,{className:"ml-auto size-3.5"})]}),s.jsxs(Gs,{className:"text-xs",onClick:()=>r("desc"),children:[s.jsx(nf,{className:"size-3.5"}),"Sort descending",f==="desc"&&s.jsx(qn,{className:"ml-auto size-3.5"})]})]}),e.filter==="values"&&s.jsxs(s.Fragment,{children:[s.jsx(Pd,{}),s.jsxs(ep,{children:[s.jsx(Pv,{className:"text-[11px]",children:"Show only"}),s.jsx("div",{className:"max-h-64 overflow-y-auto",children:a.map(m=>{var x;return s.jsxs(YM,{checked:l.includes(m.value),onCheckedChange:()=>h(m.value),closeOnClick:!1,className:"text-xs",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:((x=Sy[e.id])==null?void 0:x.call(Sy,m))??m.label}),s.jsx("span",{className:"ml-2 font-mono text-[10px] tabular-nums text-muted-foreground",children:Ci(m.count)})]},m.value)})})]})]}),e.filter==="recent"&&s.jsxs(s.Fragment,{children:[s.jsx(Pd,{}),s.jsxs(ep,{children:[s.jsx(Pv,{className:"text-[11px]",children:"Created"}),s.jsxs(jY,{value:l,onValueChange:c,children:[s.jsx(tE,{value:"",className:"text-xs",children:"Any time"}),UW.map(m=>s.jsx(tE,{value:m.value,className:"text-xs",children:m.label},m.value))]})]})]}),u&&s.jsxs(s.Fragment,{children:[s.jsx(Pd,{}),s.jsxs(Gs,{className:"text-xs",onClick:()=>c(e.filter==="values"?[]:""),children:[s.jsx(En,{className:"size-3.5"}),"Clear filter"]})]})]})]})}const Ny=()=>({name:"",url:"",format:"ocsf",auth:"none",token:"",sandboxes:"",category:"",verdict:""}),Oh="h-9 w-full rounded-md border border-border bg-card px-2 text-xs",Cy=e=>e?new Date(e).toLocaleString():"Never";function KW(){const e=$t(),[t,r]=g.useState([]),[a,l]=g.useState(Ny),[c,u]=g.useState(!1),[f,h]=g.useState(null),[m,x]=g.useState(null),[p,b]=g.useState(null),[v,j]=g.useState(!1),S=g.useCallback(async()=>{try{r(await e.activityDestinations()),b(null),j(!0)}catch(T){b(T.message)}},[e]);g.useEffect(()=>{S();const T=setInterval(S,5e3);return()=>clearInterval(T)},[S]);const N=T=>({value:a[T],onChange:O=>l(k=>({...k,[T]:O.target.value}))});async function C(T,O){x(T);try{const k=await e.activityDestinationAction(T,O);O==="test"&&He.success(`Test accepted · HTTP ${k.status}`),await S(),h(null)}catch(k){He.error(k.message),await S()}finally{x(null)}}async function E(T){T.preventDefault(),x("new");try{await e.createActivityDestination({name:a.name,url:a.url,format:a.format,auth:a.auth,token:a.token,filters:{sandboxes:a.sandboxes.split(",").map(O=>O.trim()).filter(Boolean),categories:a.category?[a.category]:[],verdicts:a.verdict?[a.verdict]:[]}}),l(Ny()),u(!1),await S(),He.success("Webhook saved. Test it, then enable forwarding.")}catch(O){He.error(O.message)}finally{x(null)}}return s.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-5",children:[s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Webhooks start paused. Test the connection, then enable forwarding."}),p&&s.jsxs("div",{role:"alert",className:"rounded-md border border-destructive/30 p-3 text-xs",children:[p,s.jsx("button",{className:"ml-2 underline",onClick:S,children:"Retry"})]}),!v&&!p&&s.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading webhooks…"}),t.map(T=>s.jsxs("section",{className:"space-y-3 rounded-lg border border-border p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("h3",{className:"truncate text-sm font-medium",children:T.name}),s.jsx("span",{className:`text-xs ${T.error?"text-amber-700":"text-muted-foreground"}`,children:T.enabled?T.error?"Retrying":"Enabled":T.error?"Needs attention":"Paused"})]}),s.jsx("p",{className:"break-all font-mono text-[11px] text-muted-foreground",children:T.url}),s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[T.delivered.toLocaleString()," delivered · ",T.backlog.toLocaleString()," pending"]}),s.jsxs("details",{className:"text-xs",children:[s.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Delivery details"}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.format==="ocsf"?"OCSF JSON":"Console JSON"," · ",T.auth==="none"?"No authentication":T.auth==="bearer"?"Bearer token":"API key"]}),s.jsxs("p",{className:"text-xs",children:[T.filters.sandboxes.join(", ")||"All sandboxes"," · ",T.filters.categories.join(", ")||"All event types"," · ",T.filters.verdicts.join(", ")||"All decisions"]}),s.jsxs("dl",{className:"grid grid-cols-3 gap-3 text-xs",children:[s.jsxs("div",{children:[s.jsx("dt",{className:"text-muted-foreground",children:"Delivered"}),s.jsx("dd",{className:"mt-1",children:T.delivered.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("dt",{className:"text-muted-foreground",children:"Pending"}),s.jsx("dd",{className:"mt-1",children:T.backlog.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("dt",{className:"text-muted-foreground",children:"Filtered out"}),s.jsx("dd",{className:"mt-1",children:T.skipped.toLocaleString()})]})]}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Last delivery: ",Cy(T.lastDeliveredAt),T.lastStatus?` · HTTP ${T.lastStatus}`:""]}),T.lastTest&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Test: ",T.lastTest.ok?`Accepted · HTTP ${T.lastTest.status}`:T.lastTest.error," · ",Cy(T.lastTest.at)]})]})]}),T.error&&s.jsxs("p",{role:"status",className:"text-xs text-amber-700",children:[T.error," · Attempt ",T.attempts,"/8",T.enabled?` · Next retry ${Cy(T.nextAttempt)}`:" · Forwarding paused; queued events retained"]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ce,{size:"xs",variant:"outline",disabled:!!m,onClick:()=>C(T.id,"test"),children:"Send test"}),s.jsx(ce,{size:"xs",variant:"outline",disabled:!!m,onClick:()=>C(T.id,T.enabled?"pause":"resume"),children:T.enabled?"Pause":"Enable forwarding"}),T.error&&s.jsx(ce,{size:"xs",variant:"outline",disabled:!!m,onClick:()=>C(T.id,"retry"),children:"Retry now"}),s.jsx(ce,{size:"xs",variant:"ghost",disabled:!!m,onClick:()=>h(T.id),children:"Remove"})]}),f===T.id&&s.jsxs("div",{className:"space-y-2 border-t border-border pt-3 text-xs",children:[s.jsx("p",{children:"Remove this webhook and its delivery position? Activity history will remain."}),s.jsx(ce,{size:"xs",variant:"destructive",disabled:!!m,onClick:()=>C(T.id,"remove"),children:"Remove webhook"}),s.jsx(ce,{size:"xs",variant:"ghost",onClick:()=>h(null),children:"Cancel"})]})]},T.id)),v&&!t.length&&!c&&s.jsxs("div",{className:"rounded-lg border border-dashed border-border p-6 text-center",children:[s.jsx("p",{className:"text-sm",children:"No webhooks connected"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Send activity to your monitoring tools."})]}),c?s.jsxs("form",{onSubmit:E,className:"space-y-4 rounded-lg border border-border p-4",children:[s.jsx("h3",{className:"text-sm font-medium",children:"New webhook"}),s.jsxs("label",{className:"block space-y-1 text-xs",children:[s.jsx("span",{children:"Name"}),s.jsx(Ot,{required:!0,maxLength:80,placeholder:"Security monitoring",...N("name")})]}),s.jsxs("label",{className:"block space-y-1 text-xs",children:[s.jsx("span",{children:"HTTPS endpoint"}),s.jsx(Ot,{required:!0,type:"url",placeholder:"https://logs.example.com/events",...N("url")})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Use a public HTTPS endpoint that accepts JSON."}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("label",{className:"space-y-1 text-xs",children:[s.jsx("span",{children:"Event format"}),s.jsxs(cn,{className:Oh,...N("format"),children:[s.jsx("option",{value:"ocsf",children:"OCSF JSON"}),s.jsx("option",{value:"json",children:"Console JSON"})]})]}),s.jsxs("label",{className:"space-y-1 text-xs",children:[s.jsx("span",{children:"Authentication"}),s.jsxs(cn,{className:Oh,...N("auth"),children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"bearer",children:"Bearer token"}),s.jsx("option",{value:"api-key",children:"X-API-Key"})]})]})]}),a.auth!=="none"&&s.jsxs("label",{className:"block space-y-1 text-xs",children:[s.jsx("span",{children:a.auth==="bearer"?"Bearer token":"API key"}),s.jsx(Ot,{required:!0,type:"password",autoComplete:"new-password",...N("token")})]}),s.jsxs("details",{className:"rounded-md border border-border p-3",children:[s.jsxs("summary",{className:"cursor-pointer text-xs font-medium",children:["Event filters ",s.jsxs("span",{className:"font-normal text-muted-foreground",children:["· ",a.sandboxes||a.category||a.verdict?"Custom":"All events"]})]}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("label",{className:"block space-y-1 text-xs",children:[s.jsx("span",{children:"Sandboxes"}),s.jsx(Ot,{placeholder:"All sandboxes, or comma-separated names",...N("sandboxes")})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("label",{className:"space-y-1 text-xs",children:[s.jsx("span",{children:"Event type"}),s.jsxs(cn,{className:Oh,...N("category"),children:[s.jsx("option",{value:"",children:"All event types"}),Object.entries({NET:"Network",HTTP:"HTTP",SSH:"Session",AUTH:"Authentication",PROC:"Process",FILE:"File",CONFIG:"Configuration",FINDING:"Finding",EVENT:"Event"}).map(([T,O])=>s.jsx("option",{value:T,children:O},T))]})]}),s.jsxs("label",{className:"space-y-1 text-xs",children:[s.jsx("span",{children:"Decision"}),s.jsxs(cn,{className:Oh,...N("verdict"),children:[s.jsx("option",{value:"",children:"All decisions"}),s.jsx("option",{value:"allowed",children:"Allowed"}),s.jsx("option",{value:"denied",children:"Denied"})]})]})]})]})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Forwarding includes original log data. You can enable it after saving."}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ce,{type:"submit",size:"sm",disabled:!!m,children:"Save paused"}),s.jsx(ce,{type:"button",size:"sm",variant:"ghost",onClick:()=>{u(!1),l(Ny())},children:"Cancel"})]})]}):s.jsx(ce,{size:"sm",variant:"outline",onClick:()=>u(!0),children:"Add webhook"}),s.jsxs("details",{className:"border-t border-border pt-4 text-[11px] text-muted-foreground",children:[s.jsx("summary",{className:"cursor-pointer text-xs hover:text-foreground",children:"Integration details"}),s.jsxs("div",{className:"mt-3 space-y-3 leading-relaxed",children:[s.jsx("p",{children:"Events are collected from the time the webhook is created and sent while the console server runs, even with this drawer closed. Existing history is not backfilled."}),s.jsx("p",{children:"The endpoint receives one JSON event per HTTPS POST and must return HTTP 2xx. Vendor-specific formats such as Splunk HEC need an adapter. Acceptance confirms receipt, not indexing."}),s.jsx("p",{children:"Delivery is at least once. Deduplicate using the Idempotency-Key header or event ID. Failures retry with backoff and pause after 8 attempts. History and delivery positions survive restarts; collection gaps still apply."}),s.jsx("p",{children:"OCSF uses version 1.4.0, Base Event, with source fields in unmapped.openshell. Credentials are stored locally in a file restricted to your OS account and are never returned to the browser."})]})]})]})}const W3="1.4.0";function QE(e){const t=Date.parse(e.at),r=Date.parse(e.receivedAt);if(!Number.isFinite(t)&&!Number.isFinite(r))throw new Error("OCSF export requires an event or collection timestamp");const a={INFO:1,INFORMATIONAL:1,LOW:2,MED:3,MEDIUM:3,HIGH:4,CRITICAL:5,FATAL:6}[String(e.severity).toUpperCase()]??0,l=e.action||e.method;return{category_uid:0,class_uid:0,activity_id:l?99:0,type_uid:l?99:0,...l?{activity_name:l}:{},severity_id:a,time:Number.isFinite(t)?t:r,metadata:{version:W3,product:{name:"OpenRod",vendor_name:"OpenRod"},...e.id?{uid:e.id}:{},...Number.isFinite(r)?{logged_time:r}:{},...e.correlationId?{correlation_uid:e.correlationId}:{}},...e.message?{message:e.message}:{},status_id:e.outcome==="success"?1:e.outcome==="failure"?2:0,raw_data:JSON.stringify(e.original??e),unmapped:{openshell:e,time_basis:Number.isFinite(t)?"source_event":"collection_time; source timestamp unavailable"}}}function XW(e,t="json",r){if(!Array.isArray(r))return t==="ocsf"?QE(e):e;const a=a3(e).values,l=Object.fromEntries(r.filter(u=>Object.hasOwn(a,u)).map(u=>[u,a[u]]));if(t!=="ocsf")return l;const c=QE(e);return{category_uid:0,class_uid:0,activity_id:r.includes("action")?c.activity_id:0,type_uid:r.includes("action")?c.type_uid:0,...r.includes("action")&&c.activity_name?{activity_name:c.activity_name}:{},severity_id:r.includes("severity")?c.severity_id:0,time:c.time,metadata:{version:W3,product:c.metadata.product},unmapped:{openshell:l,time_basis:c.unmapped.time_basis}}}function WW(e,t,r="json"){const a=e.map(l=>XW(l,r,t==null?void 0:t.columns));return r==="ocsf"?a:{exportedAt:new Date().toISOString(),context:t,events:a}}function QW(e,{paused:t,demo:r,activityRevision:a}){const l=$t(),c=g.useRef(t);c.current=t;const u=JSON.stringify(e),[f,h]=g.useState({events:[],total:0,nextOffset:null}),[m,x]=g.useState(0),[p,b]=g.useState(null),[v,j]=g.useState(!1),[S,N]=g.useReducer(O=>O+1,0),C=g.useRef(0),E=g.useRef(0);return g.useEffect(()=>{const O=++C.current;if(r)return;let k=!0;const M=async(R=!1)=>{const z=++E.current;j(!0);try{const _=await l.activity(JSON.parse(u));k&&C.current===O&&z===E.current&&(!R||!c.current)&&(h(_),b(null))}catch(_){k&&z===E.current&&b(_.message)}finally{k&&z===E.current&&j(!1)}};x(0),h({events:[],total:0,nextOffset:null}),M();const A=setInterval(()=>{c.current||M(!0)},5e3);return()=>{k=!1,clearInterval(A)}},[u,r,S,a,l]),{...f,loading:v,error:p,page:m,goToPage:async O=>{if(v||O<0||O>=Math.ceil(f.total/e.limit))return;const k=C.current,M=++E.current;j(!0);try{const A=await l.activity({...JSON.parse(u),snapshot:f.snapshot,offset:O*e.limit,now:f.now});k===C.current&&M===E.current&&(h(A),x(O),b(null))}catch(A){k===C.current&&M===E.current&&b(A.message)}finally{k===C.current&&M===E.current&&j(!1)}},refresh:N}}const jl=50,Mh=[{id:"time",label:"Time",width:150},{id:"severity",label:"Security severity",width:150},{id:"logLevel",label:"Log level",width:110},{id:"sandbox",label:"Sandbox",width:125},{id:"agent",label:"Observed agent",width:145},{id:"action",label:"Activity",width:200},{id:"verdict",label:"Decision",width:125},{id:"destination",label:"Target",width:260}],ZW=Object.fromEntries(Kg.map(e=>[e.name,{name:e.name,logo:`/logos/agents/${e.logo}.svg`}])),Dh={all:"Available history",15:"Last 15 minutes",60:"Last hour",1440:"Last 24 hours",custom:"Custom range"},nr="h-8 rounded-md border border-border bg-card px-2 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",JW=e=>Number.isFinite(Date.parse(e))?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"-";function ky({options:e,selected:t,onChange:r,label:a}){const[l,c]=g.useState(""),u=g.useDeferredValue(l),f=g.useMemo(()=>e.filter(x=>x.toLowerCase().includes(u.toLowerCase())),[e,u]),h=tx({count:f.length,rowHeight:32});g.useEffect(()=>{h.scrollToTop()},[u]);const m=new Set(t);return s.jsxs(s.Fragment,{children:[s.jsx(ra,{"aria-label":`Search ${a}`,placeholder:`Search ${a.toLowerCase()}…`,value:l,onValueChange:c}),s.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[s.jsxs("span",{children:[t.length.toLocaleString()," selected · ",f.length.toLocaleString()," matches"]}),s.jsx("button",{onClick:()=>r([]),className:"underline",children:"Clear"})]}),s.jsxs("div",{ref:h.ref,onScroll:h.onScroll,className:"h-56 overflow-auto",role:"group","aria-label":a,children:[s.jsx("div",{style:{height:h.totalHeight,position:"relative"},children:s.jsx("div",{style:{transform:`translateY(${h.paddingTop}px)`},children:f.slice(h.start,h.end).map(x=>s.jsxs("label",{className:"flex h-8 cursor-pointer items-center gap-2 rounded px-2 text-xs hover:bg-muted",children:[s.jsx("input",{type:"checkbox",checked:m.has(x),onChange:()=>r(m.has(x)?t.filter(p=>p!==x):[...t,x])}),s.jsx("span",{className:"truncate",title:x,children:x})]},x))})}),!f.length&&s.jsx("p",{className:"py-5 text-center text-xs text-muted-foreground",children:"No matches"})]})]})}function zh(e){if(!e||!Number.isFinite(Date.parse(e)))return e||"";const t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,19)}function eQ(){try{const e=JSON.parse(new URLSearchParams(window.location.search).get("investigation")||"{}");if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const r of["query","direction","range","from","to"])typeof e[r]=="string"&&(t[r]=e[r]);for(const r of["sandboxes","verdicts","agents"])Array.isArray(e[r])&&e[r].every(a=>typeof a=="string")&&(t[r]=e[r]);return e.filters&&typeof e.filters=="object"&&Object.values(e.filters).every(r=>r&&typeof r.value=="string"&&["equals","contains","excludes"].includes(r.mode))&&(t.filters=e.filters),e.sort&&typeof e.sort.key=="string"&&["asc","desc"].includes(e.sort.direction)&&(t.sort=e.sort),Q3(t)}catch{return{}}}function Q3(e){var a,l;if(((l=(a=e.filters)==null?void 0:a.agent)==null?void 0:l.mode)!=="equals")return e;const{agent:t,...r}=e.filters;return{...e,agents:e.agents??(t.value?[t.value]:[]),filters:r}}function tQ(){try{const e=JSON.parse(localStorage.getItem("openshell.activity.views")||"[]");return Array.isArray(e)?e.filter(t=>t&&typeof t.name=="string"&&t.query&&typeof t.query=="object"):[]}catch{return[]}}function nQ(e,t,r){const a=new Blob([JSON.stringify(WW(e,t,r),null,2)],{type:"application/json"}),l=URL.createObjectURL(a),c=document.createElement("a");c.href=l,c.download=r==="ocsf"?"openshell-activity-ocsf.json":"openshell-activity.json",c.click(),setTimeout(()=>URL.revokeObjectURL(l),1e3)}function sQ(){const e=Cn();return s.jsx(rQ,{},(e==null?void 0:e.id)??(e==null?void 0:e.context)??"default")}function rQ(){var kt,ct,jt;const e=$t(),t=Cn(),r=Y3(qa()),[a]=g.useState(eQ),[l,c]=g.useState(["time","sandbox","agent","action","verdict","destination"]),u=Mh.filter(ae=>l.includes(ae.id)),[f,h]=g.useState(tQ),[m,x]=g.useState(""),[p,b]=g.useState(!1),[v,j]=g.useState("columns"),[S,N]=g.useState(null),[C,E]=g.useState(!1),[T,O]=g.useState(null),[k,M]=g.useState(Date.now),[A,R]=g.useState(a.query??""),[z,_]=g.useState(a.direction??"all"),[L,Y]=g.useState(a.sandboxes??[]),[P,V]=g.useState(a.agents??[]),[U,H]=g.useState(a.verdicts??[]),[F,q]=g.useState(a.filters??{}),[W,B]=g.useState(a.range??"all"),[J,X]=g.useState(zh(a.from)),[re,I]=g.useState(zh(a.to)),[$,Q]=g.useState(a.sort??{key:"time",direction:"desc"}),[G,se]=g.useState(null),[ee,ne]=g.useState(()=>new Set),[ie,oe]=g.useState(null),[Z,de]=g.useState(!1),[ke,_e]=g.useState(null),je=g.useDeferredValue(A),Ae={query:je,direction:z,sandboxes:L,verdicts:U,agents:P,filters:F,range:W,from:J&&Number.isFinite(Date.parse(J))?new Date(J).toISOString():J,to:re&&Number.isFinite(Date.parse(re))?new Date(re).toISOString():re,sort:$},te=JSON.stringify(Ae),[Ee,Te]=g.useState({query:te,page:0}),be=QW({...Ae,limit:jl},{paused:!!T,demo:r.demo,activityRevision:r.activityRevision});g.useEffect(()=>{ne(new Set),se(null)},[r.activityRevision]),g.useEffect(()=>{ne(new Set)},[je,z,L,U,P,F,W,J,re]);async function We(ae,Ke){ot(),de(!0),_e(null);try{const ut=await e.previewActivityDeletion({mode:ae,ids:Ke||[...ee],query:Ae});oe(ut)}catch(ut){He.error(ut.message)}finally{de(!1)}}async function Se(){de(!0),_e(null);try{const ae=await e.deleteActivity(ie.token);oe(null),se(null),ne(new Set),O([]),be.refresh(),r.refresh(),He.success(`Deleted ${ae.deleted.toLocaleString()} log${ae.deleted===1?"":"s"}`)}catch(ae){_e(ae.message)}finally{de(!1)}}function Fe(ae){ot(),ne(Ke=>{const ut=new Set(Ke);return ut.has(ae)?ut.delete(ae):ut.size<5e3&&ut.add(ae),ut})}const Re=r.demo?T??r.events:be.events;function ve(ae){ae=Q3(ae),ot(),R(ae.query||""),_(ae.direction||"all"),Y(ae.sandboxes||[]),H(ae.verdicts||[]),V(ae.agents||[]),q(ae.filters||{}),B(ae.range||"all"),X(zh(ae.from)),I(zh(ae.to)),Q(ae.sort||{key:"time",direction:"desc"})}function pe(ae,Ke){ve({filters:{[ae]:{mode:"equals",value:Ke}}}),se(null)}function $e(ae){N({format:ae,columns:[...l],range:W,from:J,to:re})}const Je=S&&(!S.columns.length||S.range==="custom"&&(!S.from&&!S.to||S.from&&!Number.isFinite(Date.parse(S.from))||S.to&&!Number.isFinite(Date.parse(S.to))||S.from&&S.to&&Date.parse(S.from)>Date.parse(S.to)));async function mt(){if(!S||Je)return;const{format:ae,columns:Ke,range:ut,from:Jt,to:Rn}=S,Et={...Ae,columns:Ke,range:ut,from:Jt?new Date(Jt).toISOString():"",to:Rn?new Date(Rn).toISOString():""};E(!0);try{if(r.demo){nQ(aE(at,{...Et,now:k}).map(Ln=>Ln.event),{...Et,demo:!0},ae),N(null);return}const Pt=document.createElement("a");Pt.href=e.url("/activity/export",{format:ae,query:JSON.stringify(Et),context:await e.contextKey(),...t?{location:"1"}:{}}),Pt.download=ae==="ocsf"?"openshell-activity-ocsf.json":"openshell-activity.json",document.body.appendChild(Pt),Pt.click(),Pt.remove(),N(null)}catch(Pt){He.error(`Export failed: ${Pt.message}`)}finally{E(!1)}}const ot=()=>{T||(O(Re),M(Date.now()))},Ie=ae=>Ke=>{ot(),ae(Ke)},at=g.useMemo(()=>Re.map(a3),[Re]),Xe=g.useMemo(()=>[...new Set([...(r.sandboxes??[]).map(ae=>ae.name),...be.sandboxes??[],...Re.map(ae=>ae.sandbox),...L].filter(Boolean))].sort(),[r.sandboxes,be.sandboxes,Re,L]),me=g.useMemo(()=>[...new Set(r.demo?at.map(ae=>ae.values.agent):be.agents??at.map(ae=>ae.values.agent))].filter(Boolean).sort((ae,Ke)=>ae.localeCompare(Ke)),[r.demo,at,be.agents]),Me=W==="custom"&&(!J&&!re||J&&re&&Date.parse(J)>Date.parse(re)),Oe=g.useMemo(()=>Me?[]:r.demo?aE(at,{query:je,direction:z,sandboxes:L,verdicts:U,agents:P,filters:F,range:W,from:J,to:re,now:k,sort:$}):at,[at,je,z,L,U,P,F,W,J,re,k,$,Me,r.demo]),tt=Me?0:r.demo?Oe.length:be.total||0,Ue=Math.max(1,Math.ceil(tt/jl)),Ge=r.demo?Math.min(Ee.query===te?Ee.page:0,Ue-1):be.page,ht=r.demo?Oe.slice(Ge*jl,(Ge+1)*jl):Oe;function yt(ae){ot(),ne(new Set),se(null),r.demo?Te({query:te,page:ae}):be.goToPage(ae)}const ue=tx({count:ht.length,rowHeight:48});g.useEffect(()=>{ue.scrollToTop()},[je,z,L,U,P,F,W,J,re,$,Ge]);const Ye=g.useMemo(()=>{if(!T)return 0;const ae=new Set(T.map(Zd));return r.events.filter(Ke=>!ae.has(Zd(Ke))).length},[T,r.events]),Pe=ht.filter(ae=>ae.values.verdict==="denied").length,st=ht.filter(ae=>ae.values.verdict==="allowed").length,vt=A||L.length||U.length||P.length||z!=="all"||W!=="all"||Object.values(F).some(ae=>ae.value);function wt(){ot(),R(""),_("all"),Y([]),H([]),V([]),q({}),B("all"),X(""),I("")}const Ht=[...z!=="all"?[{label:`Direction: ${z}`,clear:()=>_("all")}]:[],...A?[{label:`Search: ${A}`,clear:()=>R("")}]:[],...L.length?[{label:`${L.length} sandbox${L.length===1?`: ${L[0]}`:"es"}`,clear:()=>Y([])}]:[],...P.length?[{label:`Observed agents: ${P.join(", ")}`,clear:()=>V([])}]:[],...U.length?[{label:`Decision: ${U.join(", ")}`,clear:()=>H([])}]:[],...W!=="all"?[{label:Dh[W],clear:()=>B("all")}]:[],...Object.entries(F).filter(([,ae])=>ae.value).map(([ae,Ke])=>{var ut;return{label:`${((ut=Mh.find(Jt=>Jt.id===ae))==null?void 0:ut.label)??ae}${ae==="agent"?"":` ${Ke.mode}`}: ${Ke.value}`,clear:()=>q(Jt=>({...Jt,[ae]:{...Ke,value:""}}))}})];return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex h-[calc(100svh-3.5rem)] min-h-0 flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-4 py-3 sm:px-6",children:[s.jsx(ra,{"aria-label":"Search activity",placeholder:"Search activity…",value:A,onValueChange:Ie(R),className:"min-w-44 flex-1 basis-full sm:basis-44"}),s.jsxs(op,{children:[s.jsxs(ap,{className:`${nr} flex items-center gap-2 hover:bg-muted`,children:[s.jsx(cC,{className:"size-3.5"}),"Filters",(W!=="all"||z!=="all"||L.length>0||U.length>0||Object.values(F).some(ae=>ae.value))&&s.jsx("span",{className:"rounded bg-foreground px-1.5 text-[10px] text-background",children:+(W!=="all")+ +(z!=="all")+ +(L.length>0)+ +(U.length>0)+Object.values(F).filter(ae=>ae.value).length})]}),s.jsxs(ip,{align:"end",className:"max-h-[min(38rem,80svh)] w-80 max-w-[calc(100vw-2rem)] overflow-y-auto p-4",children:[s.jsx("p",{className:"text-xs font-medium",children:"Filter activity"}),s.jsxs("label",{className:"grid gap-1.5 text-[11px] text-muted-foreground",children:["Time frame",s.jsx(cn,{"aria-label":"Time range",className:nr,value:W,onChange:ae=>Ie(B)(ae.target.value),children:Object.entries(Dh).map(([ae,Ke])=>s.jsx("option",{value:ae,children:Ke},ae))})]}),s.jsxs("label",{className:"grid gap-1.5 text-[11px] text-muted-foreground",children:["Direction",s.jsxs(cn,{"aria-label":"Direction",className:nr,value:z,onChange:ae=>Ie(_)(ae.target.value),children:[s.jsx("option",{value:"all",children:"All directions"}),s.jsx("option",{value:"unknown",children:"Direction not applicable / unknown"}),s.jsx("option",{value:"out",children:"Outbound"}),s.jsx("option",{value:"in",children:"Inbound"})]})]}),s.jsxs("label",{className:"grid gap-1.5 text-[11px] text-muted-foreground",children:["Event type",s.jsxs(cn,{"aria-label":"Event category",className:nr,value:((kt=F.category)==null?void 0:kt.value)||"",onChange:ae=>Ie(q)({...F,category:{mode:"equals",value:ae.target.value}}),children:[s.jsx("option",{value:"",children:"All event types"}),["Network","HTTP","Session","Configuration","Process","File","Authentication","Finding","Event","Log","Unclassified"].map(ae=>s.jsx("option",{children:ae},ae))]})]}),s.jsxs("label",{className:"grid gap-1.5 text-[11px] text-muted-foreground",children:["Security severity",s.jsxs(cn,{"aria-label":"Security severity",className:nr,value:((ct=F.severity)==null?void 0:ct.value)||"",onChange:ae=>Ie(q)({...F,severity:{mode:"equals",value:ae.target.value}}),children:[s.jsx("option",{value:"",children:"All severities"}),["FATAL","CRITICAL","HIGH","MED","LOW","INFO","Not reported"].map(ae=>s.jsx("option",{children:ae},ae))]})]}),s.jsxs("label",{className:"grid gap-1.5 text-[11px] text-muted-foreground",children:["Log level",s.jsxs(cn,{"aria-label":"Log level",className:nr,value:((jt=F.logLevel)==null?void 0:jt.value)||"",onChange:ae=>Ie(q)({...F,logLevel:{mode:"equals",value:ae.target.value}}),children:[s.jsx("option",{value:"",children:"All log levels"}),["ERROR","WARN","INFO","DEBUG","TRACE","Not reported"].map(ae=>s.jsx("option",{children:ae},ae))]})]}),s.jsxs("div",{className:"mt-1 border-t pt-3",children:[s.jsx("p",{className:"mb-2 text-[11px] font-medium",children:"Decision"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:["allowed","denied","not reported","not applicable"].map(ae=>s.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[s.jsx("input",{type:"checkbox",checked:U.includes(ae),onChange:()=>Ie(H)(U.includes(ae)?U.filter(Ke=>Ke!==ae):[...U,ae])}),ae]},ae))})]}),s.jsxs("div",{className:"mt-1 flex flex-col gap-2 border-t pt-3",children:[s.jsx("p",{className:"text-[11px] font-medium",children:"Sandboxes"}),s.jsx(ky,{label:"Sandboxes",options:Xe,selected:L,onChange:Ie(Y)})]})]})]}),s.jsxs(op,{children:[s.jsxs(ap,{className:`${nr} flex items-center gap-2 hover:bg-muted`,children:[s.jsx(n6,{className:"size-3.5"}),"View",s.jsx(ko,{className:"size-3"})]}),s.jsxs(ip,{align:"end",className:"w-72 p-3",children:[s.jsx("div",{className:"mb-1 flex gap-1 rounded-md bg-muted p-1",role:"group","aria-label":"View options",children:[["columns","Columns"],["saved","Saved views"]].map(([ae,Ke])=>s.jsx("button",{"aria-pressed":v===ae,onClick:()=>j(ae),className:`flex-1 rounded px-2 py-1.5 text-xs transition-colors ${v===ae?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:Ke},ae))}),v==="columns"?s.jsx("div",{children:Mh.map(ae=>s.jsxs("label",{className:"flex items-center gap-2 py-1 text-xs",children:[s.jsx("input",{type:"checkbox",disabled:ae.id==="time",checked:l.includes(ae.id),onChange:Ke=>c(Ke.target.checked?[...l,ae.id]:l.filter(ut=>ut!==ae.id))}),ae.label]},ae.id))}):s.jsxs("div",{className:"flex max-h-80 flex-col gap-3 overflow-auto",children:[s.jsx(Ot,{"aria-label":"View name",value:m,onChange:ae=>x(ae.target.value),placeholder:"Name this investigation…"}),s.jsx(ce,{size:"sm",disabled:!m.trim(),onClick:()=>{try{const ae=[...f.filter(Ke=>Ke.name!==m.trim()),{name:m.trim(),query:Ae}];localStorage.setItem("openshell.activity.views",JSON.stringify(ae)),h(ae),x(""),He.success("View saved in this browser")}catch{He.error("Could not save view")}},children:"Save view"}),f.map(ae=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{className:"min-w-0 flex-1 truncate text-left text-xs",onClick:()=>ve(ae.query),children:ae.name}),s.jsx("button",{"aria-label":`Delete view ${ae.name}`,onClick:()=>{try{const Ke=f.filter(ut=>ut.name!==ae.name);localStorage.setItem("openshell.activity.views",JSON.stringify(Ke)),h(Ke)}catch{He.error("Could not delete view")}},children:s.jsx(En,{className:"size-3"})})]},ae.name)),!f.length&&s.jsx("p",{className:"py-2 text-center text-xs text-muted-foreground",children:"No saved views yet."})]})]})]}),s.jsxs(Af,{children:[s.jsxs(Of,{"aria-label":"Activity actions",className:`${nr} flex items-center gap-2 hover:bg-muted`,children:["Actions",s.jsx(ko,{className:"size-3"})]}),s.jsxs(Mf,{align:"end",className:"w-60",children:[s.jsxs(Gs,{disabled:C||!!Me,onClick:()=>$e("json"),children:[s.jsx(Yc,{}),"Export Console JSON"]}),s.jsxs(Gs,{disabled:C||!!Me,onClick:()=>$e("ocsf"),children:[s.jsx(Yc,{}),"Export OCSF JSON"]}),s.jsxs(Gs,{onClick:()=>b(!0),children:[s.jsx(mC,{}),"Webhooks"]}),!r.demo&&s.jsxs(s.Fragment,{children:[s.jsx(Pd,{}),s.jsxs(Gs,{disabled:Z||!ee.size,variant:"destructive",onClick:()=>We("selected"),children:[s.jsx(Gn,{}),"Delete selected logs",ee.size?` (${ee.size})`:""]}),s.jsxs(Gs,{disabled:Z||!!Me||be.loading||!be.total,variant:"destructive",onClick:()=>We("matching"),children:[s.jsx(Gn,{}),"Delete matching logs"]}),s.jsxs(Gs,{disabled:Z,variant:"destructive",onClick:()=>We("all"),children:[s.jsx(Gn,{}),"Delete all logs"]})]})]})]})]}),(be.error||r.historyError)&&!r.demo&&s.jsx(Li,{id:"activity:history-error",tone:"error",title:"History unavailable",actions:s.jsx(ce,{size:"xs",variant:"outline",onClick:be.refresh,children:"Retry"}),children:be.error||r.historyError}),W==="custom"&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-border px-6 py-2 text-xs",children:[s.jsxs("label",{className:"flex items-center gap-2",children:["From",s.jsx("input",{type:"datetime-local","aria-label":"From time",className:nr,value:J,onInput:ae=>Ie(X)(ae.currentTarget.value)})]}),s.jsxs("label",{className:"flex items-center gap-2",children:["To",s.jsx("input",{type:"datetime-local","aria-label":"To time",className:nr,value:re,onInput:ae=>Ie(I)(ae.currentTarget.value)})]}),s.jsx("span",{className:"text-muted-foreground",children:Intl.DateTimeFormat().resolvedOptions().timeZone}),Me&&s.jsx("span",{role:"alert",className:"text-red-600",children:"Choose a start or end time; the end must follow the start."})]}),!!vt&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b border-border px-6 py-2",children:[Ht.map(ae=>s.jsxs("button",{onClick:ae.clear,title:`Remove ${ae.label}`,className:"flex max-w-72 items-center gap-2 rounded border border-border bg-muted/40 px-2 py-1 text-[11px]",children:[s.jsx("span",{className:"truncate",children:ae.label}),s.jsx(En,{className:"size-3 shrink-0"})]},ae.label)),s.jsx(ce,{size:"xs",variant:"ghost",onClick:wt,children:"Clear all"})]}),s.jsxs("div",{className:"flex min-h-10 flex-wrap items-center gap-x-4 gap-y-1 border-b border-border px-6 py-2 text-[11px] text-muted-foreground",children:[s.jsxs("span",{children:[s.jsx("strong",{className:"font-mono text-foreground",children:tt.toLocaleString()})," ",r.demo?"demo events":"matching events"]}),s.jsxs("span",{children:[st.toLocaleString()," allowed · ",s.jsxs("span",{className:Pe?"text-red-600":"",children:[Pe.toLocaleString()," denied"]})," ",s.jsx("span",{className:"text-muted-foreground/70",children:"on this page"})]}),s.jsxs("button",{className:"flex min-h-10 items-center gap-1.5 rounded px-2 text-xs hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>{T?(O(null),Te({query:te,page:0}),M(Date.now()),be.refresh(),ue.scrollToTop()):ot()},children:[T?s.jsx(DR,{className:"size-3"}):s.jsx($I,{className:"size-3"}),T?"Resume":"Pause"]}),T&&s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{children:"View paused"}),s.jsx("button",{className:"rounded text-foreground underline underline-offset-4 disabled:opacity-40",disabled:r.demo&&!Ye,onClick:()=>{O(r.demo?r.events:Re),M(Date.now()),be.refresh(),ue.scrollToTop()},children:r.demo?`${Ye.toLocaleString()} new events`:"Refresh"})]}),ee.size>0&&s.jsxs("span",{className:"flex items-center gap-2",children:[ee.size.toLocaleString()," selected",s.jsx("button",{className:"underline",onClick:()=>ne(new Set),children:"Clear selection"})]}),s.jsx("span",{className:"ml-auto",children:Intl.DateTimeFormat().resolvedOptions().timeZone})]}),s.jsxs("div",{ref:ue.ref,onScroll:ae=>{ue.onScroll(ae),ae.currentTarget.scrollTop>0&&ot()},tabIndex:0,role:"region","aria-label":"Activity events",className:"min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[s.jsxs("table",{style:{minWidth:u.reduce((ae,Ke)=>ae+Ke.width,r.demo?0:40)},className:"w-full table-fixed border-separate border-spacing-0 text-xs","aria-label":"Activity","aria-rowcount":ht.length+1,children:[s.jsxs("colgroup",{children:[!r.demo&&s.jsx("col",{style:{width:52}}),u.map(ae=>s.jsx("col",{style:{width:ae.width}},ae.id))]}),s.jsx("thead",{className:"sticky top-0 z-10 bg-muted",children:s.jsxs("tr",{children:[!r.demo&&s.jsx("th",{scope:"col",className:"h-10 border-b border-border pr-3 pl-4 text-left sm:pl-6",children:s.jsx("input",{type:"checkbox","aria-label":"Select logs on this page",disabled:!ht.length||ht.length>5e3,checked:ht.length>0&&ht.every(ae=>ee.has(ae.key)),ref:ae=>{ae&&(ae.indeterminate=ht.some(Ke=>ee.has(Ke.key))&&!ht.every(Ke=>ee.has(Ke.key)))},onChange:ae=>{ot(),ne(ae.target.checked?new Set(ht.map(Ke=>Ke.key)):new Set)}})}),u.map(ae=>{var Ke,ut,Jt,Rn;return s.jsx("th",{scope:"col","aria-sort":$.key===ae.id?$.direction==="asc"?"ascending":"descending":"none",className:"h-10 border-b border-border px-3 text-left font-medium text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("button",{className:"flex h-9 flex-1 items-center gap-1 outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>Ie(Q)({key:ae.id,direction:$.key===ae.id&&$.direction==="asc"?"desc":"asc"}),children:[ae.label,$.key===ae.id&&($.direction==="asc"?s.jsx(sf,{className:"size-3"}):s.jsx(nf,{className:"size-3"}))]}),s.jsxs(op,{children:[s.jsx(ap,{"aria-label":`Filter ${ae.label}`,className:`rounded p-1 hover:bg-accent ${(ae.id==="time"?W!=="all":ae.id==="sandbox"?L.length:ae.id==="verdict"?U.length:ae.id==="agent"?P.length||(Ke=F.agent)!=null&&Ke.value:(ut=F[ae.id])!=null&&ut.value)?"bg-accent text-foreground":""}`,children:s.jsx(cC,{className:"size-3"})}),s.jsxs(ip,{align:"start",children:[s.jsxs("p",{className:"text-xs font-medium",children:["Filter ",ae.label.toLowerCase()]}),ae.id==="agent"?s.jsxs("div",{role:"group","aria-label":"Observed agents",className:"max-h-64 overflow-y-auto",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between px-2 text-[11px] text-muted-foreground",children:[s.jsx("span",{children:P.length?`${P.length} selected`:"All agents"}),s.jsx("button",{className:"underline",onClick:()=>{ot(),V([]),q(({agent:Et,...Pt})=>Pt)},children:"Clear"})]}),me.map(Et=>s.jsxs("label",{className:"flex min-h-8 cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-muted",children:[s.jsx("input",{type:"checkbox",checked:P.includes(Et),onChange:()=>{ot(),q(({agent:Pt,...Ln})=>Ln),V(Pt=>Pt.includes(Et)?Pt.filter(Ln=>Ln!==Et):[...Pt,Et])},className:"accent-foreground"}),s.jsx(up,{agent:ZW[Et]??{name:Et}})]},Et)),!me.length&&s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No agents in the logs"})]}):ae.id==="sandbox"?s.jsx(ky,{label:"Sandboxes",options:Xe,selected:L,onChange:Ie(Y)}):ae.id==="verdict"?s.jsx(ky,{label:"Decisions",options:["allowed","denied","not reported","not applicable"],selected:U,onChange:Ie(H)}):ae.id==="time"?s.jsxs(s.Fragment,{children:[s.jsx(cn,{"aria-label":"Filter time",className:nr,value:W,onChange:Et=>Ie(B)(Et.target.value),children:Object.entries(Dh).map(([Et,Pt])=>s.jsx("option",{value:Et,children:Pt},Et))}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Custom dates appear above the table."})]}):s.jsxs(s.Fragment,{children:[s.jsxs(cn,{"aria-label":`${ae.label} match mode`,className:nr,value:((Jt=F[ae.id])==null?void 0:Jt.mode)??"contains",onChange:Et=>{var Pt;return Ie(q)({...F,[ae.id]:{value:((Pt=F[ae.id])==null?void 0:Pt.value)??"",mode:Et.target.value}})},children:[s.jsx("option",{value:"equals",children:"Equals"}),s.jsx("option",{value:"contains",children:"Contains"}),s.jsx("option",{value:"excludes",children:"Excludes"})]}),s.jsx(Ot,{"aria-label":`${ae.label} filter value`,placeholder:`Filter ${ae.label.toLowerCase()}…`,value:((Rn=F[ae.id])==null?void 0:Rn.value)??"",onChange:Et=>{var Pt;return Ie(q)({...F,[ae.id]:{mode:((Pt=F[ae.id])==null?void 0:Pt.mode)??"contains",value:Et.target.value}})},className:"h-8 text-xs"})]})]})]})]})},ae.id)})]})}),s.jsxs("tbody",{children:[ue.paddingTop>0&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:u.length+(r.demo?0:1),style:{height:ue.paddingTop,padding:0}})}),ht.slice(ue.start,ue.end).map((ae,Ke)=>s.jsxs("tr",{"aria-rowindex":ue.start+Ke+2,onClick:()=>{ot(),se(ae)},className:`group cursor-pointer hover:bg-muted/70 ${(G==null?void 0:G.key)===ae.key?"bg-accent":"bg-card"}`,children:[!r.demo&&s.jsx("td",{className:"h-12 border-b border-border/60 pr-3 pl-4 sm:pl-6",onClick:ut=>ut.stopPropagation(),children:s.jsx("input",{type:"checkbox","aria-label":`Select log ${ae.values.sandbox} ${ae.values.time}`,checked:ee.has(ae.key),disabled:!ee.has(ae.key)&&ee.size>=5e3,onChange:()=>Fe(ae.key)})}),u.map(ut=>s.jsx("td",{className:`h-12 border-b border-border/60 px-3 py-0 font-mono text-[11px] ${ut.id==="verdict"?ae.values.verdict==="denied"?"text-red-600":ae.values.verdict==="allowed"?"text-emerald-700":"text-muted-foreground":ut.id==="destination"?"text-foreground":"text-muted-foreground"}`,children:ut.id==="time"?s.jsx("button",{"aria-label":`Inspect event ${ae.values.sandbox} ${ae.values.time}`,"aria-haspopup":"dialog",className:"h-8 w-full truncate text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:Jt=>{Jt.stopPropagation(),ot(),se(ae)},children:JW(ae.values.time)}):ut.id==="action"?s.jsxs("span",{className:"block truncate",title:`${ae.values.category} · ${ae.values.action} · ${ae.values.process}`,children:[s.jsxs("span",{className:"block truncate text-foreground",children:[ae.values.category," · ",ae.event.method||ae.event.action||"Not reported"]}),s.jsx("span",{className:"block truncate text-[10px]",children:ae.values.process||ae.event.detail||ae.event.message||"Process not reported"})]}):ut.id==="agent"&&ae.agent?s.jsx("span",{className:"font-sans text-foreground",children:s.jsx(up,{agent:ae.agent})}):s.jsx("span",{className:"block truncate",title:ae.values[ut.id],children:ae.values[ut.id]||"-"})},ut.id))]},ae.key)),ue.end<ht.length&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:u.length+(r.demo?0:1),style:{height:(ht.length-ue.end)*48,padding:0}})})]})]}),!ht.length&&s.jsxs("div",{className:"py-20 text-center text-sm text-muted-foreground",children:[s.jsx("p",{children:be.error&&!r.demo?"Could not load retained events":be.loading&&!r.demo?"Searching retained events…":Me?"Set a valid time range":vt?"No matching events in available history":"No activity available"}),!!vt&&s.jsx(ce,{variant:"outline",size:"sm",className:"mt-3",onClick:wt,children:"Clear filters"})]})]}),tt>jl&&s.jsxs("nav",{"aria-label":"Activity pagination",className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-border bg-card px-6 py-3",children:[s.jsxs("span",{"aria-live":"polite",className:"text-xs tabular-nums text-muted-foreground",children:[(Ge*jl+1).toLocaleString(),"-",Math.min((Ge+1)*jl,tt).toLocaleString()," of ",tt.toLocaleString()," logs"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ce,{variant:"outline",size:"sm","aria-label":"First page",disabled:Ge===0||!r.demo&&be.loading,onClick:()=>yt(0),children:"First"}),s.jsx(ce,{variant:"outline",size:"sm","aria-label":"Previous page",disabled:Ge===0||!r.demo&&be.loading,onClick:()=>yt(Ge-1),children:"Previous"}),s.jsx("span",{"aria-live":"polite",className:"px-2 text-xs tabular-nums text-muted-foreground",children:!r.demo&&be.loading?"Loading…":`Page ${Ge+1} of ${Ue.toLocaleString()}`}),s.jsx(ce,{variant:"outline",size:"sm","aria-label":"Next page",disabled:Ge>=Ue-1||!r.demo&&be.loading,onClick:()=>yt(Ge+1),children:"Next"}),s.jsx(ce,{variant:"outline",size:"sm","aria-label":"Last page",disabled:Ge>=Ue-1||!r.demo&&be.loading,onClick:()=>yt(Ue-1),children:"Last"})]})]})]}),s.jsx(vn,{open:!!S,onOpenChange:ae=>{ae||N(null)},children:s.jsxs(wn,{className:"sm:max-w-md max-h-[85vh] overflow-y-auto",children:[s.jsxs(jn,{children:[s.jsxs(bn,{children:["Export ",(S==null?void 0:S.format)==="ocsf"?"OCSF JSON":"Console JSON"]}),s.jsx(_n,{children:"Your current columns and time frame are ready to export. Other table filters still apply."})]}),S&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"grid gap-2 text-xs font-medium",children:["Time frame",s.jsx(cn,{className:nr,value:S.range,onChange:ae=>N({...S,range:ae.target.value}),children:Object.entries(Dh).map(([ae,Ke])=>s.jsx("option",{value:ae,children:Ke},ae))})]}),S.range==="custom"&&s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[["from","to"].map(ae=>s.jsxs("label",{className:"grid gap-1 text-xs",children:[s.jsx("span",{children:ae==="from"?"From":"To"}),s.jsx("input",{type:"datetime-local",className:nr+" w-full min-w-0",value:S[ae],onChange:Ke=>N({...S,[ae]:Ke.target.value})})]},ae)),s.jsxs("p",{className:"text-[11px] text-muted-foreground sm:col-span-2",children:[Intl.DateTimeFormat().resolvedOptions().timeZone," · Leave one end empty for an open range."]})]}),s.jsxs("fieldset",{className:"space-y-3",children:[s.jsx("legend",{className:"text-xs font-medium",children:"Columns"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:Mh.map(ae=>s.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[s.jsx("input",{type:"checkbox",checked:S.columns.includes(ae.id),disabled:ae.id==="time"&&S.format==="ocsf",onChange:Ke=>N({...S,columns:Ke.target.checked?[...S.columns,ae.id]:S.columns.filter(ut=>ut!==ae.id)})}),ae.label]},ae.id))})]}),S.format==="ocsf"&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"OCSF includes the required event time and schema fields alongside your selected columns."}),Je&&s.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Choose at least one column and a valid time frame."}),s.jsxs(ea,{children:[s.jsx(ce,{variant:"outline",onClick:()=>N(null),children:"Cancel"}),s.jsxs(ce,{disabled:C||Je,onClick:mt,children:[s.jsx(Yc,{}),C?"Exporting…":"Export"]})]})]})]})}),s.jsx(Qr,{open:!!ie,onOpenChange:ae=>{!ae&&!Z&&oe(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsx(to,{children:(ie==null?void 0:ie.mode)==="all"?"Delete all retained logs?":(ie==null?void 0:ie.mode)==="matching"?"Delete matching logs?":"Delete selected logs?"}),s.jsxs(no,{children:[ie==null?void 0:ie.count.toLocaleString()," log",(ie==null?void 0:ie.count)===1?"":"s"," will be permanently removed from Activity and pending webhook delivery. This cannot be undone."]})]}),s.jsxs("p",{className:"text-xs leading-relaxed text-muted-foreground",children:[(ie==null?void 0:ie.mode)==="all"?"This includes every sandbox and ignores the current filters. ":"","New logs arriving after this review will be kept. Copies in sandbox files, exports, or external systems are not deleted; a webhook request already in flight may still arrive."]}),ke&&s.jsx("p",{role:"alert",className:"text-xs text-destructive",children:ke}),s.jsxs(eo,{children:[s.jsx(ro,{disabled:Z,children:"Cancel"}),s.jsx(so,{variant:"destructive",disabled:Z||!(ie!=null&&ie.count)||!!ke,onClick:Se,children:Z?"Deleting…":`Delete ${ie==null?void 0:ie.count.toLocaleString()} log${(ie==null?void 0:ie.count)===1?"":"s"}`})]})]})}),s.jsx($l,{open:p,onOpenChange:b,children:s.jsxs(uu,{className:"gap-0 data-[side=right]:w-full sm:data-[side=right]:max-w-2xl",children:[s.jsxs(du,{className:"border-b border-border pr-12",children:[s.jsxs(fu,{className:"flex items-center gap-2",children:[s.jsx(mC,{"aria-hidden":"true",className:"size-4 text-muted-foreground",strokeWidth:1.5}),"Webhooks"]}),s.jsx(mu,{children:"Send activity to an HTTPS endpoint."})]}),p&&s.jsx(KW,{})]})}),s.jsx($l,{open:!!G,onOpenChange:ae=>{ae||se(null)},children:s.jsxs(uu,{className:"w-full gap-0 sm:max-w-lg",children:[s.jsxs(du,{className:"border-b border-border pr-12",children:[s.jsx(fu,{children:"Event details"}),s.jsx(mu,{children:"Full values from this event. The activity view stays paused."})]}),G&&s.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-auto p-5",children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:[[G.event.scope?"scope":"sandbox",G.event.scope||G.values.sandbox,"Sandbox timeline"],["destination",G.values.destination,"Same target"],["process",G.values.process,"Same executable"],["policy",G.values.policy,"Same policy"],["session",G.values.session,"Same session"],["correlation",G.values.correlation,"Same correlation"]].filter(([,ae])=>ae).map(([ae,Ke,ut])=>s.jsx(ce,{size:"xs",variant:"outline",onClick:()=>pe(ae,Ke),children:ut},ae))}),!r.demo&&s.jsxs(ce,{size:"sm",variant:"destructive",disabled:Z,onClick:()=>We("selected",[G.key]),children:[s.jsx(Gn,{}),"Delete log"]}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Pivots match recorded fields. An executable match does not prove the same process instance."}),s.jsx("dl",{className:"space-y-4",children:[["Timestamp",G.values.time],["Sandbox",G.values.sandbox],["Sandbox ID",G.values.sandboxId],["Collection scope",G.event.scope],["Direction",G.values.direction],["Category",G.values.category],["Security severity",G.values.severity],["Log level",G.values.logLevel],["Decision",G.values.verdict],["Agent",G.values.agent],["Attribution",G.agent?"Executable name match only; initiating agent and parent process are not reported.":"Initiating agent not reported by this event."],["Initiator","Not reported"],["Session ID",G.values.session],["Correlation ID",G.values.correlation],["Action",G.values.action],["Executable",G.event.binary],["Destination",G.values.destination],["Policy",G.event.policy],["Policy revision at event time",G.event.policyVersion??"Not reported"],["Enforcement mode at event time",G.event.enforcement??"Not reported"],["Event ID",G.key],["Source cursor",G.event.sourceCursor],["Identity evidence",G.event.idSource||"No source event ID reported"],["Received at",G.event.receivedAt],["Source",G.event.source],["Parser target",G.event.target],["Reason",G.event.reason],["Why",G.values.why]].map(([ae,Ke])=>s.jsxs("div",{children:[s.jsx("dt",{className:"mb-1 text-[11px] text-muted-foreground",children:ae}),s.jsxs("dd",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-xs",children:ae==="Agent"&&G.agent?s.jsx(up,{agent:G.agent}):Ke||"-"}),Ke&&s.jsx(ZE,{label:ae,value:Ke})]})]},ae))}),s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("h3",{className:"text-xs font-medium",children:"Raw event"}),s.jsx(ZE,{label:"raw event",value:JSON.stringify(G.event,null,2)})]}),s.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-all rounded-md border border-border bg-muted/40 p-3 text-[11px]",children:JSON.stringify(G.event,null,2)})]})]})]})})]})}function ZE({label:e,value:t}){const[r,a]=g.useState(!1);return g.useEffect(()=>{if(r){const l=setTimeout(()=>a(!1),1500);return()=>clearTimeout(l)}},[r]),s.jsx("button",{className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted","aria-label":`Copy ${e}`,onClick:async()=>{try{await navigator.clipboard.writeText(t),a(!0)}catch{He.error("Could not copy to clipboard")}},children:r?s.jsx(qn,{className:"size-3.5"}):s.jsx(Zp,{className:"size-3.5"})})}const Oi=(e,t,r=`${t}s`)=>`${e} ${e===1?t:r}`,JE="groups-show-sandboxes";function oQ(e){try{sessionStorage.setItem(Vl,JSON.stringify(e))}catch{}}function Wp(e,t){var r,a;(r=e.failed)!=null&&r.length?He.warning(`${t}. ${Oi(e.failed.length,"sandbox","sandboxes")} could not be updated`,{description:e.failed.map(l=>`${l.sandbox}: ${l.error}`).join(`
|
|
520
|
+
`)}):He.success(t,{description:(a=e.applied)!=null&&a.length?`Network access updated in ${Oi(e.applied.length,"sandbox","sandboxes")}.`:void 0})}function aQ({policy:e,onClick:t}){const r=e.action==="block"?Xv:Gl;return s.jsxs("button",{type:"button",onClick:t,title:`${e.action==="block"?"Blocks":"Allows"} ${e.destinations.join(", ")}`,className:Le("flex max-w-full items-center gap-1 rounded-full border px-2 py-px text-[11px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",e.action==="block"?"border-red-200 bg-red-50 text-red-700 hover:bg-red-100/70":"border-emerald-600/20 bg-emerald-50 text-emerald-800 hover:bg-emerald-100/70"),children:[s.jsx(r,{className:"size-3 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"truncate",children:e.name})]})}function iQ({names:e,limit:t=4}){return e.length?s.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[e.slice(0,t).map(r=>s.jsx("span",{className:"rounded border border-border bg-background px-1.5 py-px font-mono text-[10.5px] text-muted-foreground",children:r},r)),e.length>t&&s.jsxs("span",{className:"text-[11px] text-faint",children:["+",e.length-t]})]}):s.jsx("span",{className:"text-[11px] text-faint",children:"No sandboxes yet"})}const lQ=[{title:"Create a group",body:"Name it for a kind of work, like Frontend or Data."},{title:"Add network rules",body:"Choose the destinations this group can reach or must block."},{title:"Add sandboxes",body:"Choose one or more groups for each sandbox. Their network rules combine."}];function cQ({onCreate:e,onPolicy:t}){return s.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[s.jsx(So,{children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"flex size-9 items-center justify-center rounded-xl border border-stone-300 bg-card shadow-[0_3px_8px_#1c191708]",children:s.jsx(Oa,{className:"size-4.5 text-stone-600",strokeWidth:1.4})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-[15px] font-medium tracking-tight",children:"Give sandboxes the same network access, together"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Instead of one rule per sandbox, make a group and aim rules at the group."})]})]})}),s.jsxs("ol",{className:"relative mt-8 grid gap-3 sm:grid-cols-3",children:[s.jsx("span",{"aria-hidden":"true",className:"absolute top-[22px] right-[16%] left-[16%] hidden h-px bg-gradient-to-r from-border via-stone-300 to-border sm:block"}),lQ.map((r,a)=>s.jsx(So,{delay:.08+a*.08,className:"relative",children:s.jsxs("li",{className:"flex h-full flex-col rounded-lg border border-border bg-card p-4",children:[s.jsx("span",{className:"relative z-10 flex size-[26px] items-center justify-center rounded-full border border-stone-300 bg-card font-mono text-[11px] text-stone-600",children:a+1}),s.jsx("p",{className:"mt-3 text-xs font-medium",children:r.title}),s.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:r.body})]})},r.title))]}),s.jsx(So,{delay:.34,children:s.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-2",children:[s.jsxs(ce,{onClick:e,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[s.jsx(ds,{}),"Create your first group"]}),s.jsxs(ce,{variant:"ghost",onClick:t,className:"text-muted-foreground",children:["Network rules",s.jsx(_h,{})]})]})})]})}function uQ({open:e,onOpenChange:t,groups:r,sandboxes:a,assignments:l,onCreated:c}){const u=$t(),[f,h]=g.useState(""),[m,x]=g.useState(""),[p,b]=g.useState([]),[v,j]=g.useState(!1),[S,N]=g.useState(null);g.useEffect(()=>{e&&(h(""),x(""),b([]),N(null))},[e]);const C=RM(f),E=r.some(k=>k.id===C),T=k=>No({assignments:l},k).map(M=>{var A;return(A=r.find(R=>R.id===M))==null?void 0:A.name}).filter(Boolean).join(", ");async function O(k){k.preventDefault(),j(!0),N(null);try{const{group:M}=await u.saveGroup({id:C,name:f.trim(),description:m.trim(),isNew:!0});let A=null;if(p.length)try{A=await u.setGroupMembers(p,[M.id],"add")}catch(R){He.warning(`Created ${M.name}, but could not add sandboxes`,{description:R.message})}t(!1),c(M,A,p.length)}catch(M){N(M.message)}finally{j(!1)}}return s.jsx(vn,{open:e,onOpenChange:t,children:s.jsx(wn,{className:"max-h-[90svh] overflow-y-auto sm:max-w-md",children:s.jsxs("form",{onSubmit:O,className:"grid gap-4",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"New group"}),s.jsx(_n,{className:"text-xs",children:"Network rules aimed at this group reach every sandbox in it."})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"group-name",className:"text-xs",children:"Name"}),s.jsx(Ot,{id:"group-name",value:f,onChange:k=>h(k.target.value),placeholder:"Frontend",className:"text-xs",required:!0,autoFocus:!0}),E&&s.jsx("p",{className:"text-[11px] text-red-700",children:"A group with this name already exists."})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsxs(On,{htmlFor:"group-description",className:"text-xs",children:["Description ",s.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional)"})]}),s.jsx(Df,{id:"group-description",rows:2,value:m,onChange:k=>x(k.target.value),placeholder:"Web apps: npm and GitHub",className:"text-xs"})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsxs("span",{className:"text-xs font-medium",children:["Add sandboxes ",s.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional)"})]}),a.length?s.jsx("ul",{className:"max-h-48 divide-y divide-border/60 overflow-y-auto rounded-md border border-border",children:a.map(k=>{const M=p.includes(k.name),A=T(k.name);return s.jsx("li",{children:s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 px-3 py-1.5 text-xs hover:bg-muted/50",children:[s.jsx("input",{type:"checkbox",checked:M,onChange:()=>b(R=>M?R.filter(z=>z!==k.name):[...R,k.name]),className:"size-3.5"}),s.jsx("span",{className:Le("size-1.5 shrink-0 rounded-full",Ba(k.phase).cell),"aria-hidden":"true"}),s.jsx("span",{className:"truncate font-mono",children:k.name}),A&&s.jsx("span",{className:"ml-auto shrink-0 text-[11px] text-muted-foreground",children:`also in ${A}`})]})},k.name)})}):s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"No sandboxes yet. Pick this group when you create one."})]}),S&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:S}),s.jsxs(ea,{children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(ce,{type:"submit",disabled:v||!C||E,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[v&&s.jsx(zt,{"aria-hidden":"true"}),"Create group",p.length?` with ${Oi(p.length,"sandbox","sandboxes")}`:""]})]})]})})})}function dQ({group:e,org:t,sandboxes:r,onClose:a,onChanged:l,onPolicy:c}){const u=$t(),[f,h]=g.useState(""),[m,x]=g.useState(""),[p,b]=g.useState(!1),[v,j]=g.useState(!1);if(g.useEffect(()=>{e&&(h(e.name),x(e.description))},[e]),!e)return s.jsx($l,{open:!1,onOpenChange:()=>{}});const S=t.members[e.id]??[],N=AM(t.policies,e.id),C=t.policies.filter(R=>R.appliesTo.everyone),E=r.filter(R=>!S.includes(R.name)),T=R=>No(t,R).map(z=>{var _;return(_=t.groups.find(L=>L.id===z))==null?void 0:_.name}).filter(Boolean).join(", "),O=f.trim()!==e.name||m.trim()!==e.description;async function k(){b(!0);try{await u.saveGroup({...e,name:f.trim()||e.name,description:m.trim()}),He.success(`Saved ${f.trim()||e.name}`),l()}catch(R){He.error(R.message)}finally{b(!1)}}async function M(R,z){b(!0);try{Wp(await u.setGroupMembers(R,[e.id],z?"add":"remove"),z?`Added ${R.join(", ")} to ${e.name}`:`Removed ${R.join(", ")} from ${e.name}`),l()}catch(_){He.error(_.message)}finally{b(!1)}}async function A(){b(!0);try{Wp(await u.deleteGroup(e.id),`Deleted ${e.name}`),a(),l()}catch(R){He.error(R.message)}finally{b(!1),j(!1)}}return s.jsx($l,{open:!0,onOpenChange:R=>{R||a()},children:s.jsxs(uu,{className:"w-full! overflow-y-auto sm:max-w-[460px]!",children:[s.jsxs(du,{className:"border-b p-6",children:[s.jsxs(fu,{className:"flex items-center gap-2 text-base",children:[s.jsx(Oa,{className:"size-4 text-muted-foreground",strokeWidth:1.5}),e.name]}),s.jsxs(mu,{children:[Oi(S.length,"sandbox","sandboxes")," · ",Oi(N.length,"rule")," aimed at this group"]})]}),s.jsxs("div",{className:"space-y-6 px-6 pb-6",children:[s.jsxs("section",{className:"grid gap-3",children:[s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"edit-group-name",className:"text-xs",children:"Name"}),s.jsx(Ot,{id:"edit-group-name",value:f,onChange:R=>h(R.target.value),className:"text-xs"})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:"edit-group-description",className:"text-xs",children:"Description"}),s.jsx(Df,{id:"edit-group-description",rows:2,value:m,onChange:R=>x(R.target.value),className:"text-xs"})]}),O&&s.jsxs(ce,{size:"sm",className:"w-fit bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",disabled:p,onClick:k,children:[p&&s.jsx(zt,{}),"Save"]})]}),s.jsxs("section",{className:"grid gap-2",children:[s.jsx("h3",{className:"text-[10px] font-bold tracking-widest text-faint uppercase",children:"Sandboxes"}),S.length?s.jsx("ul",{className:"divide-y divide-border/60 rounded-md border border-border",children:S.map(R=>{const z=r.find(_=>_.name===R);return s.jsxs("li",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[s.jsx("span",{className:Le("size-1.5 shrink-0 rounded-full",Ba(z==null?void 0:z.phase).cell),"aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:R}),s.jsx(ce,{size:"icon-xs",variant:"ghost","aria-label":`Remove ${R} from ${e.name}`,disabled:p,onClick:()=>M([R],null),children:s.jsx(En,{})})]},R)})}):s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["No sandboxes yet. Add one below, or pick ",e.name," when you create a sandbox."]}),E.length>0&&s.jsxs(cn,{value:"","aria-label":`Add a sandbox to ${e.name}`,disabled:p,onChange:R=>R.target.value&&M([R.target.value],e.id),className:"h-8 w-fit rounded-md border border-dashed border-border bg-transparent px-2 text-[11px] text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx("option",{value:"",children:"+ Add sandbox"}),E.map(R=>s.jsxs("option",{value:R.name,children:[R.name,T(R.name)?` (also in ${T(R.name)})`:""]},R.name))]})]}),s.jsxs("section",{className:"grid gap-2",children:[s.jsx("h3",{className:"text-[10px] font-bold tracking-widest text-faint uppercase",children:"Network access"}),N.length?s.jsx("div",{className:"flex flex-wrap gap-1.5",children:N.map(R=>s.jsx(aQ,{policy:R,onClick:()=>c({edit:R.id})},R.id))}):s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"No network rules yet. A sandbox can join if another selected group provides its network policy."}),C.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Also, like every sandbox: ",C.map(R=>R.name).join(", "),"."]}),s.jsxs(ce,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>c({new:{appliesTo:{groups:[e.id]}}}),children:[s.jsx(ds,{}),"Add rule for ",e.name]})]}),s.jsxs("section",{className:"border-t border-border pt-4",children:[(S.length>0||N.length>0)&&s.jsx("p",{className:"mb-2 text-[11px] text-muted-foreground",children:"Move the sandboxes and move or delete the network rules before deleting this group."}),s.jsxs(ce,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive",disabled:p||S.length>0||N.length>0,onClick:()=>j(!0),children:[s.jsx(Gn,{}),"Delete group"]})]})]}),s.jsx(Qr,{open:v,onOpenChange:j,children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Delete ",e.name,"?"]}),s.jsx(no,{children:"This empty group will be deleted."})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsx(so,{variant:"destructive",onClick:A,children:"Delete group"})]})]})})]})})}function fQ({group:e,members:t,policies:r,onOpen:a,delay:l}){return s.jsx(So,{delay:l,className:"h-full",children:s.jsxs("button",{onClick:a,className:"group/card flex h-full w-full flex-col gap-3 rounded-lg border border-border bg-card p-4 text-left outline-none transition-[border-color,box-shadow] hover:border-stone-300 hover:shadow-[0_3px_10px_#1c19170a] focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsxs("span",{className:"flex items-start gap-2",children:[s.jsx(Oa,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground",strokeWidth:1.5,"aria-hidden":"true"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-xs font-medium",children:e.name}),e.description&&s.jsx("span",{className:"mt-0.5 line-clamp-2 block text-[11px] text-muted-foreground",children:e.description})]}),s.jsx(Hr,{className:"size-3.5 shrink-0 text-faint transition-transform group-hover/card:translate-x-0.5","aria-hidden":"true"})]}),s.jsx(iQ,{names:t}),s.jsxs("span",{className:"mt-auto flex min-w-0 flex-wrap items-center gap-1 border-t border-border/60 pt-3",children:[r.length?r.slice(0,3).map(c=>s.jsx("span",{className:Le("truncate rounded-full border px-2 py-px text-[10.5px]",c.action==="block"?"border-red-200 bg-red-50 text-red-700":"border-emerald-600/20 bg-emerald-50 text-emerald-800"),children:c.name},c.id)):s.jsx("span",{className:"text-[11px] text-faint",children:"No rules yet"}),r.length>3&&s.jsxs("span",{className:"text-[11px] text-faint",children:["+",r.length-3]})]})]})})}function mQ({onNavigate:e}){const t=$t(),r=qa(),[a,l]=g.useState(null),[c,u]=g.useState(!1),[f,h]=g.useState(null),[m,x]=g.useState(""),[p,b]=g.useState([]),[v,j]=g.useState([]),[S,N]=g.useState(!1),[C,E]=g.useState(()=>{try{return localStorage.getItem(JE)==="1"}catch{return!1}}),T=()=>E(U=>{try{localStorage.setItem(JE,U?"0":"1")}catch{}return!U}),O=g.useCallback(async()=>{try{l(await t.org())}catch(U){l({error:U.message})}},[]);g.useEffect(()=>{O()},[O]);const k=g.useMemo(()=>[...r.sandboxes??[]].filter(U=>U.phase!=="deleting").sort((U,H)=>U.name.localeCompare(H.name)),[r.sandboxes]),M=U=>{oQ(U),e("egress")};if(!a)return s.jsx("p",{role:"status",className:"py-24 text-center text-sm text-muted-foreground",children:"Loading…"});if(a.error)return s.jsx("p",{role:"alert",className:"py-24 text-center text-sm text-muted-foreground",children:a.error});const A=a.groups,R=a.assignments??{},z=k.filter(U=>No(a,U.name).length).length,_=m.trim().toLowerCase(),L=k.filter(U=>!_||U.name.includes(_)||A.some(H=>No(a,U.name).includes(H.id)&&H.name.toLowerCase().includes(_))),Y=L.length>0&&L.every(U=>p.includes(U.name));async function P(U,H,F="replace"){N(!0);try{Wp(await t.setGroupMembers(U,H,F),`Updated groups for ${Oi(U.length,"sandbox","sandboxes")}`),b([]),await O()}catch(q){He.error(q.message)}finally{N(!1)}}const V=s.jsx(uQ,{open:c,onOpenChange:u,groups:A,sandboxes:k,assignments:R,onCreated:async(U,H,F)=>{H?Wp(H,`Created ${U.name} with ${Oi(F,"sandbox","sandboxes")}`):He.success(`Created ${U.name}`,{description:"Add a network rule, then assign sandboxes to the group."}),await O(),h(U.id)}});return A.length?s.jsxs("div",{className:"h-[calc(100svh-3.5rem)] overflow-y-auto",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-4 pt-4 pb-3 sm:px-6",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:[{label:"Groups",value:A.length},{label:"In a group",value:z},{label:"No group",value:k.length-z}].map(U=>s.jsxs("div",{className:"rounded-md px-3 py-1.5",children:[s.jsx("span",{className:"block text-[11px] text-muted-foreground",children:U.label}),s.jsx("span",{className:"mt-1 block font-mono text-lg leading-none tabular-nums",children:s.jsx(Qd,{value:U.value})})]},U.label))}),s.jsxs(ce,{size:"sm",className:"ml-auto bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",onClick:()=>u(!0),children:[s.jsx(ds,{className:"size-3.5"}),"New group"]})]}),s.jsxs("section",{"aria-label":"Groups",className:"grid gap-3 px-4 py-5 sm:grid-cols-2 sm:px-6 xl:grid-cols-3",children:[A.map((U,H)=>s.jsx(fQ,{group:U,members:a.members[U.id]??[],policies:AM(a.policies,U.id),onOpen:()=>h(U.id),delay:H*.04},U.id)),s.jsx(So,{delay:A.length*.04,className:"h-full",children:s.jsxs("button",{onClick:()=>u(!0),className:"flex h-full min-h-32 w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-dashed border-border text-[11px] text-muted-foreground outline-none transition-colors hover:border-foreground/30 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(ds,{className:"size-4",strokeWidth:1.5,"aria-hidden":"true"}),"New group"]})})]}),s.jsxs("section",{"aria-label":"Sandboxes and their groups",className:"border-t border-border",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 sm:px-6",children:[s.jsxs("button",{type:"button",onClick:T,"aria-expanded":C,className:"flex items-center gap-1.5 rounded text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(Hr,{className:Le("size-3.5 text-muted-foreground transition-transform",C&&"rotate-90"),"aria-hidden":"true"}),s.jsx("span",{className:"font-medium",children:"Sandboxes"}),s.jsx("span",{className:"font-mono text-[11px] tabular-nums text-muted-foreground",children:k.length}),k.length-z>0&&s.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["· ",k.length-z," not in a group"]})]}),C&&s.jsx(ra,{value:m,onValueChange:x,placeholder:"Search sandbox or group…","aria-label":"Search sandboxes",className:"ml-auto w-full sm:w-56"})]}),C&&s.jsxs(s.Fragment,{children:[p.length>0&&s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-y border-border bg-accent/50 px-4 py-2 text-xs sm:px-6",children:[s.jsx(qn,{className:"size-3.5","aria-hidden":"true"}),Oi(p.length,"sandbox","sandboxes")," selected",s.jsx("fieldset",{disabled:S,className:"min-w-0",children:s.jsx(Wd,{multiple:!0,allowCreate:!1,groups:A,value:v,onChange:j})}),s.jsx(ce,{variant:"outline",size:"sm",disabled:S||!v.length,onClick:()=>P(p,v,"add"),children:"Add to groups"}),s.jsx(ce,{variant:"outline",size:"sm",disabled:S||!v.length,onClick:()=>P(p,v,"remove"),children:"Remove from groups"}),s.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>b([]),children:"Clear"}),S&&s.jsx(zt,{"aria-hidden":"true"})]}),k.length?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("div",{className:"min-w-[640px]",children:[s.jsxs("div",{className:"grid h-9 grid-cols-[28px_minmax(0,1.4fr)_minmax(180px,1fr)_minmax(0,1.2fr)] items-center gap-4 border-y border-border bg-muted px-4 text-xs font-medium text-muted-foreground sm:px-6",children:[s.jsx("input",{type:"checkbox","aria-label":"Select every sandbox shown",checked:Y,onChange:()=>b(Y?[]:L.map(U=>U.name)),className:"size-3.5"}),s.jsx("span",{children:"Sandbox"}),s.jsx("span",{children:"Groups"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Jp,{className:"size-3","aria-hidden":"true"}),"Network rules"]})]}),s.jsxs("ul",{className:"divide-y divide-border/60 bg-card",children:[L.map(U=>{var W;const H=No(a,U.name),F=XG(a.policies,{name:U.name,groups:H,setups:((W=a.setupMembers)==null?void 0:W[U.name])??[]}),q=p.includes(U.name);return s.jsxs("li",{className:Le("grid min-h-11 grid-cols-[28px_minmax(0,1.4fr)_minmax(180px,1fr)_minmax(0,1.2fr)] items-center gap-4 px-4 py-1.5 sm:px-6",q&&"bg-accent/40"),children:[s.jsx("input",{type:"checkbox","aria-label":`Select ${U.name}`,checked:q,onChange:()=>b(B=>q?B.filter(J=>J!==U.name):[...B,U.name]),className:"size-3.5"}),s.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[s.jsx("span",{className:Le("size-2 shrink-0 rounded-[3px]",Ba(U.phase).cell),"aria-hidden":"true"}),s.jsx("span",{className:"truncate font-mono text-xs",children:U.name})]}),s.jsx("fieldset",{disabled:S,"aria-label":`Groups for ${U.name}`,className:"min-w-0",children:s.jsx(Wd,{multiple:!0,required:!0,allowCreate:!1,groups:A,value:H,onChange:B=>{const J=B.filter(re=>!H.includes(re)),X=H.filter(re=>!B.includes(re));P([U.name],J.length?J:X,J.length?"add":"remove")}})}),s.jsx("span",{className:"truncate text-[11px] text-muted-foreground",title:F.map(B=>B.name).join(`
|
|
521
|
+
`),children:F.length?F.map(B=>B.name).join(", "):s.jsx("span",{className:"text-faint",title:"Its policy and agent rules still apply",children:"No network rules"})})]},U.name)}),!L.length&&s.jsxs("li",{className:"px-6 py-8 text-center text-xs text-muted-foreground",children:["No sandbox matches “",m,"”."]})]})]})}):s.jsx("p",{className:"px-6 py-10 text-center text-xs text-muted-foreground",children:"No sandboxes yet. When you create one, pick a group for it in the New sandbox dialog."})]})]}),V,s.jsx(dQ,{group:A.find(U=>U.id===f)??null,org:a,sandboxes:k,onClose:()=>h(null),onChanged:O,onPolicy:M})]}):s.jsxs("div",{className:"h-[calc(100svh-3.5rem)] overflow-y-auto",children:[s.jsx(cQ,{onCreate:()=>u(!0),onPolicy:()=>e("egress")}),V]})}const hQ=({className:e,size:t=50,delay:r=0,duration:a=6,colorFrom:l="#ffaa40",colorTo:c="#9c40ff",transition:u,style:f,reverse:h=!1,initialOffset:m=0,borderWidth:x=1})=>s.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-[inherit] border-(length:--border-beam-width) border-transparent mask-[linear-gradient(transparent,transparent),linear-gradient(#000,#000)] mask-intersect [mask-clip:padding-box,border-box]",style:{"--border-beam-width":`${x}px`},children:s.jsx(Yn.div,{className:Le("absolute aspect-square","bg-linear-to-l from-(--color-from) via-(--color-to) to-transparent",e),style:{width:t,offsetPath:`rect(0 auto auto 0 round ${t}px)`,"--color-from":l,"--color-to":c,...f},initial:{offsetDistance:`${m}%`},animate:{offsetDistance:h?[`${100-m}%`,`${-m}%`]:[`${m}%`,`${100+m}%`]},transition:{repeat:1/0,ease:"linear",duration:a,delay:-r,...u}})}),pQ=[{minutes:60,label:"1 hour"},{minutes:480,label:"8 hours"},{minutes:1440,label:"1 day"},{minutes:null,label:"Until I close it"}],gQ=[{label:"Dev server",port:3e3,name:"dev"},{label:"Vite",port:5173,name:"vite"},{label:"Jupyter",port:8888,name:"jupyter"},{label:"Web app",port:8080,name:"web"}];function xQ(e,t){const r=Date.parse(e)-t;if(r<=0)return"closing…";const a=Math.round(r/6e4);return a<60?`${a}m`:a<2880?`${Math.floor(a/60)}h ${a%60?`${a%60}m`:""}`.trim():`${Math.round(a/1440)}d`}function bQ(e=3e4){const[t,r]=g.useState(Date.now());return g.useEffect(()=>{const a=setInterval(()=>r(Date.now()),e);return()=>clearInterval(a)},[e]),t}function Z3({value:e,onChange:t,label:r="Close automatically"}){return s.jsx("div",{role:"radiogroup","aria-label":r,className:"flex items-center gap-1 rounded-md border border-border p-0.5",children:pQ.map(a=>s.jsx("button",{type:"button",role:"radio","aria-checked":e===a.minutes,onClick:()=>t(a.minutes),className:`flex-1 rounded px-2 py-1 text-[11px] whitespace-nowrap outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${e===a.minutes?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,children:a.label},String(a.minutes)))})}function yQ({text:e}){const[t,r]=g.useState(!1);return s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Copy URL",onClick:async()=>{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)},children:t?s.jsx(qn,{className:"size-3.5 text-emerald-600"}):s.jsx(Zp,{className:"size-3.5"})})}function vQ({service:e,visits:t,now:r,onChanged:a,remote:l}){var v;const c=$t(),[u,f]=g.useState(null),[h,m]=g.useState(!1),x=e.name||"default",p=t.filter(j=>j.verdict==="denied").length;async function b(j,S,N){f(j);try{await S(),He.success(N),a()}catch(C){He.error(C.message)}finally{f(null),m(!1)}}return s.jsxs("div",{className:"relative overflow-hidden rounded-lg border border-border bg-card",children:[e.expiresAt&&Date.parse(e.expiresAt)-r<15*6e4&&s.jsx(hQ,{size:60,duration:8,colorFrom:"#f59e0b",colorTo:"#fde68a"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-3",children:[s.jsx(Fv,{strokeWidth:1.4,className:"size-4 text-emerald-600","aria-hidden":"true"}),s.jsx("span",{className:"font-mono text-[13px] font-medium",children:x}),s.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:["→ port ",e.port]}),s.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-[11px]",children:[s.jsx(fC,{className:`size-3.5 ${e.expiresAt?"text-amber-600":"text-muted-foreground"}`,"aria-hidden":"true"}),e.expiresAt?s.jsxs("span",{className:"text-amber-800",children:["closes in ",xQ(e.expiresAt,r)]}):s.jsx("span",{className:"text-muted-foreground",children:"no timer"})]})]}),l&&s.jsx("p",{className:"border-t border-border/70 px-4 py-2 text-[11px] text-muted-foreground",children:"Reachable by anyone with gateway access."}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-t border-border/70 px-4 py-2",children:[e.url?s.jsxs(s.Fragment,{children:[s.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"min-w-0 truncate font-mono text-[11px] underline-offset-2 hover:underline",children:e.url}),s.jsx(yQ,{text:e.url}),s.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"rounded p-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(iI,{className:"size-3.5"})})]}):s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"No URL"}),s.jsxs("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",title:"Visits recorded in the last hour",children:[t.length," visit",t.length===1?"":"s",p?s.jsxs("span",{className:"text-red-600",children:[" · ",p," failed"]}):null]})]}),p>0&&((v=t[0])==null?void 0:v.verdict)==="denied"&&s.jsxs("p",{className:"border-t border-border/70 bg-amber-50/50 px-4 py-1.5 text-[11px] text-amber-800",children:["Last visit failed: nothing listening on port ",e.port,"."]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-t border-border/70 px-4 py-2",children:[h?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-full sm:w-96",children:s.jsx(Z3,{value:void 0,onChange:j=>b("extend",()=>c.extendService(e,j),j?"Timer reset":"Timer removed"),label:"New auto-close"})}),s.jsx(ce,{size:"icon-xs",variant:"ghost",onClick:()=>m(!1),"aria-label":"Cancel",children:s.jsx(En,{})})]}):s.jsxs(ce,{size:"xs",variant:"ghost",onClick:()=>m(!0),disabled:!!u,children:[s.jsx(fC,{}),"Change timer"]}),s.jsxs(ce,{size:"xs",variant:"outline",className:"ml-auto border-destructive/30 text-destructive hover:bg-destructive/5 hover:text-destructive",disabled:!!u,onClick:()=>b("close",()=>c.closeService(e),`Closed ${x}`),children:[u==="close"?s.jsx(zt,{}):s.jsx(TR,{}),"Close now"]})]})]})}function wQ({sandbox:e,onOpened:t}){const r=$t(),[a,l]=g.useState(""),[c,u]=g.useState(""),[f,h]=g.useState(60),[m,x]=g.useState(!1),[p,b]=g.useState(null);async function v(j){j.preventDefault(),x(!0),b(null);try{const S=await r.exposeService({sandbox:e,name:c.trim(),port:Number(a),closeAfterMinutes:f});He.success(`Opened ${c||"default"} on port ${a}`,{description:S.url??void 0}),l(""),u(""),t()}catch(S){b(S.message)}finally{x(!1)}}return s.jsxs("form",{onSubmit:v,className:"space-y-3 rounded-lg border border-dashed border-border p-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium",children:"Open a port"}),gQ.map(j=>s.jsxs("button",{type:"button",onClick:()=>{l(String(j.port)),u(j.name)},className:`rounded border px-2 py-0.5 text-[11px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${a===String(j.port)?"border-foreground/25 bg-accent":"border-border text-muted-foreground hover:text-foreground"}`,children:[j.label," ",s.jsx("span",{className:"font-mono opacity-60",children:j.port})]},j.port))]}),s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsxs("div",{className:"grid w-24 gap-1",children:[s.jsx(On,{htmlFor:"door-port",className:"text-[11px] text-muted-foreground",children:"Port"}),s.jsx(Ot,{id:"door-port",value:a,onChange:j=>l(j.target.value.replace(/\D/g,"")),className:"h-8 font-mono text-xs",placeholder:"3000",required:!0,inputMode:"numeric",title:"App must listen on 127.0.0.1"})]}),s.jsxs("div",{className:"grid w-36 gap-1",children:[s.jsx(On,{htmlFor:"door-name",className:"text-[11px] text-muted-foreground",children:"Name"}),s.jsx(Ot,{id:"door-name",value:c,onChange:j=>u(j.target.value.toLowerCase()),className:"h-8 font-mono text-xs",placeholder:"default"})]}),s.jsxs("div",{className:"min-w-72 flex-1",children:[s.jsx("span",{className:"mb-1 block text-[11px] text-muted-foreground",children:"Auto-close"}),s.jsx(Z3,{value:f,onChange:h})]}),s.jsxs(ce,{type:"submit",size:"sm",disabled:m||!a,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[m?s.jsx(zt,{}):s.jsx(Fv,{}),"Open"]})]}),p&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:p})]})}const Ph={visit:e=>e.verdict==="denied"?`Visit to port ${e.port??"?"} failed`:`Visit to port ${e.port??"?"}`,session:()=>"Terminal session opened",command:()=>"Command run","service-opened":e=>`Opened ${e.service||"default"} → port ${e.port??"?"}`,"service-closed":e=>`Closed ${e.service||"default"}`};function jQ(e){const t=[];for(const r of e){const a=t[t.length-1];if(a&&r.type==="visit"&&a.type==="visit"&&a.port===r.port&&Math.abs(Date.parse(a.at)-Date.parse(r.at))<2e3){r.verdict==="denied"&&(t[t.length-1]=r);continue}t.push(r)}return t}function SQ(){const e=Cn();return s.jsx(NQ,{},(e==null?void 0:e.id)??(e==null?void 0:e.context)??"default")}function NQ(){var E,T,O;const e=$t(),t=Cn(),r=t?`ingress-scope:${t.context}`:"ingress-scope",a=qa(),l=bQ(),c=(a.sandboxes??[]).filter(k=>k.phase!=="deleting"),[u,f]=g.useState(()=>{try{return sessionStorage.getItem(r)}catch{return null}}),h=((E=c.find(k=>k.name===u))==null?void 0:E.name)??((T=c[0])==null?void 0:T.name)??null;g.useEffect(()=>{try{h&&sessionStorage.setItem(r,h)}catch{}},[h,r]);const[m,x]=g.useState(null),p=g.useCallback(()=>e.ingress().then(x).catch(k=>x({error:k.message})),[e]);g.useEffect(()=>{p();const k=setInterval(p,15e3);return()=>clearInterval(k)},[p]);const b=((m==null?void 0:m.services)??[]).filter(k=>k.sandbox===h),v=g.useMemo(()=>{const k={};for(const M of(m==null?void 0:m.services)??[])k[M.sandbox]=(k[M.sandbox]??0)+1;return k},[m]),j=g.useMemo(()=>jQ(a.events.filter(k=>k.kind==="inbound"&&k.sandbox===h)),[a.events,h]),S=k=>j.filter(M=>M.type==="visit"&&M.port===k&&Date.parse(M.at)>l-36e5),N=j.filter(k=>k.type==="session"||k.type==="command"),C=(O=m==null?void 0:m.sessions)==null?void 0:O.ttlSeconds;return s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsxs("nav",{"aria-label":"Sandbox",className:"hidden w-56 shrink-0 overflow-y-auto border-r border-border bg-background p-3 md:block",children:[s.jsx("p",{className:"px-2 pb-2 text-[10px] font-bold tracking-widest text-faint uppercase",children:"Sandboxes"}),c.map(k=>s.jsxs("button",{onClick:()=>f(k.name),"aria-current":h===k.name,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${h===k.name?"bg-accent":"hover:bg-muted/60"}`,children:[s.jsx("span",{className:`size-2 shrink-0 rounded-[2px] ${Ba(k.phase).cell}`,"aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:k.name}),v[k.name]?s.jsxs("span",{className:"rounded bg-emerald-50 px-1 font-mono text-[10px] text-emerald-800",title:"Open services",children:[v[k.name]," open"]}):s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:"closed"})]},k.id))]}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:h?m?m.error?s.jsx("p",{role:"alert",className:"py-16 text-center text-sm text-muted-foreground",children:m.error}):s.jsxs("div",{className:"mx-auto grid max-w-6xl gap-6 px-4 py-5 sm:px-6 xl:grid-cols-[minmax(0,1fr)_17rem]",children:[s.jsxs("div",{className:"min-w-0 space-y-6",children:[s.jsx(cn,{value:h,onChange:k=>f(k.target.value),className:"h-8 rounded-md border border-input bg-transparent px-2 font-mono text-xs md:hidden","aria-label":"Sandbox",children:c.map(k=>s.jsx("option",{children:k.name},k.id))}),s.jsx(So,{duration:.22,offset:3,blur:"1px",children:s.jsx("div",{className:`rounded-lg border p-5 ${b.length?"border-emerald-600/20 bg-emerald-50/40":"border-border bg-card"}`,children:s.jsxs("p",{className:"flex items-center gap-2 text-sm font-medium",children:[b.length?s.jsx(Fv,{className:"size-4 text-emerald-600"}):s.jsx(TR,{className:"size-4 text-muted-foreground"}),b.length?`${b.length} service${b.length===1?"":"s"} open`:`${h} is closed`]})})}),s.jsxs("section",{className:"space-y-3",children:[s.jsxs("h2",{className:"flex items-center gap-1.5 text-[10px] font-bold tracking-widest text-faint uppercase",children:[s.jsx(qv,{className:"size-3"}),"Web services"]}),b.map(k=>s.jsx(vQ,{remote:m.auth.remote,service:k,visits:S(k.port),now:l,onChanged:()=>{p(),a.refresh()}},`${k.sandbox}/${k.name}`)),s.jsx(wQ,{sandbox:h,onOpened:()=>{p(),a.refresh()}})]}),s.jsxs("section",{className:"space-y-2",children:[s.jsxs("h2",{className:"flex items-center gap-1.5 text-[10px] font-bold tracking-widest text-faint uppercase",children:[s.jsx(zR,{className:"size-3"}),"Terminal access"]}),s.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[s.jsx("p",{className:"px-4 py-3 text-[11px] text-muted-foreground",children:C===null?"Default session lifetime":C===0?"Sessions never expire":`Sessions expire after ${Math.round(C/60)} min`}),s.jsx("div",{className:"border-t border-border/70",children:N.length?N.slice(0,8).map(k=>s.jsxs("div",{className:"flex h-[28px] items-center gap-3 border-b border-border/50 px-4 font-mono text-[11px] last:border-0",children:[s.jsx("span",{className:"w-16 shrink-0 text-muted-foreground",children:new Date(k.at).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),s.jsx("span",{children:Ph[k.type](k)})]},`${k.at}|${k.message}`)):s.jsx("p",{className:"px-4 py-2.5 text-[11px] text-muted-foreground",children:"No recent sessions"})})]})]})]}),s.jsxs("aside",{className:"space-y-4",children:[s.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[s.jsxs("h3",{className:"flex items-center gap-1.5 text-[10px] font-bold tracking-widest text-faint uppercase",children:[s.jsx(pu,{className:"size-3"}),"Access"]}),s.jsx("p",{className:"mt-2 text-[11px] leading-relaxed",children:m.auth.mode==="mtls"?"Client certificate (this Mac)":`Sign-in: ${m.auth.mode}`})]}),s.jsxs("section",{children:[s.jsx("h3",{className:"mb-2 text-[10px] font-bold tracking-widest text-faint uppercase",children:"Recent inbound"}),s.jsx("ol",{className:"rounded-lg border border-border bg-card",children:j.length?j.slice(0,14).map(k=>{var M;return s.jsxs("li",{className:"flex items-start gap-2 border-b border-border/50 px-3 py-1.5 text-[11px] last:border-0",children:[s.jsx("span",{className:`mt-1.5 size-1.5 shrink-0 rounded-full ${k.verdict==="denied"?"bg-red-500":k.type.startsWith("service")?"bg-emerald-500":"bg-stone-400"}`,"aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1",children:((M=Ph[k.type])==null?void 0:M.call(Ph,k))??k.type}),s.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:xu(k.at)})]},`${k.at}|${k.message}`)}):s.jsx("li",{className:"px-3 py-2 text-[11px] text-muted-foreground",children:"Nothing yet."})})]})]})]}):s.jsx("p",{role:"status",className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):s.jsx("p",{className:"py-16 text-center text-sm text-muted-foreground",children:"No sandboxes yet."})})]})}function CQ({tab:e,onNavigate:t}){const r=Cn();return s.jsxs(jf,{value:e,onValueChange:a=>t(a,r),className:"h-[calc(100svh-3.5rem)] min-h-0 gap-0",children:[s.jsx("div",{className:"shrink-0 border-b bg-card px-4 sm:px-8",children:s.jsxs(Sf,{variant:"line",className:"h-11! gap-5 p-0",children:[s.jsx(jr,{value:"egress",className:"h-full px-0 text-xs after:bottom-0!",children:"Egress"}),s.jsx(jr,{value:"ingress",className:"h-full px-0 text-xs after:bottom-0!",children:"Ingress"})]})}),s.jsx(yo,{value:"egress",className:"min-h-0",children:s.jsx(CK,{onNavigate:t})}),s.jsx(yo,{value:"ingress",className:"min-h-0",children:s.jsx(SQ,{})})]})}const Ty=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function kQ(e,t,r=Date.now()){const a=new Map(t.map(l=>[l.id,l]));return e.map(l=>{const c=a.get(l.type),u=Object.values(l.expires??{}).map(Date.parse).filter(Number.isFinite).sort((m,x)=>m-x)[0]??null,f=u===null?"none":u<=r?"expired":u<=r+7*864e5?"expiring":"scheduled",h=((c==null?void 0:c.endpoints)??[]).map(m=>m.host);return{secret:l,profile:c,expiry:u,status:f,service:(c==null?void 0:c.name)??l.type,hosts:h,search:[l.name,l.type,c==null?void 0:c.name,...l.credentialKeys,...l.attachedTo,...h].join(" ").toLowerCase()}})}function TQ(e,{query:t,scope:r,service:a,expiry:l,sort:c}){const u=t.trim().toLowerCase();return e.filter(f=>(!u||f.search.includes(u))&&(r==="all"||(r==="attached"?f.secret.attachedTo.length>0:f.secret.attachedTo.length===0))&&(!a||f.secret.type===a)&&(!l||f.status===l)).sort((f,h)=>{const m=v=>({name:v.secret.name,service:v.service,credentials:v.secret.credentialKeys.length,attached:v.secret.attachedTo.length,expiry:v.expiry})[c.key],x=m(f),p=m(h);if(x===null)return p===null?Ty.compare(f.secret.name,h.secret.name):1;if(p===null)return-1;const b=typeof x=="number"?x-p:Ty.compare(x,p);return(c.direction==="asc"?b:-b)||Ty.compare(f.secret.name,h.secret.name)})}const EQ=[{id:"agent",label:"Agents"},{id:"inference",label:"Models"},{id:"code",label:"Code & packages"},{id:"cloud",label:"Cloud"}],J3=[{id:"claude-code",name:"Claude Code",group:"agent",blurb:"Anthropic's coding agent",keyUrl:"https://console.anthropic.com/settings/keys",keyHint:"sk-ant-…"},{id:"codex",name:"Codex",group:"agent",blurb:"Existing Codex OAuth session",helpUrl:"https://developers.openai.com/codex/auth/"},{id:"copilot",name:"Copilot",group:"agent",blurb:"GitHub Copilot CLI"},{id:"cursor",name:"Cursor",group:"agent",blurb:"Cursor bootstrap network access"},{id:"anthropic",name:"Anthropic",group:"inference",blurb:"Claude API",keyUrl:"https://console.anthropic.com/settings/keys",keyHint:"sk-ant-…"},{id:"openai",name:"OpenAI",group:"inference",blurb:"GPT models API",keyUrl:"https://platform.openai.com/api-keys",keyHint:"sk-…"},{id:"nvidia",name:"NVIDIA",group:"inference",blurb:"NIM model endpoints",keyUrl:"https://build.nvidia.com",keyHint:"nvapi-…"},{id:"openrouter",name:"OpenRouter",group:"inference",blurb:"One key, many models",keyUrl:"https://openrouter.ai/keys",keyHint:"sk-or-…"},{id:"deepinfra",name:"DeepInfra",group:"inference",blurb:"Open models, hosted"},{id:"google-vertex-ai",name:"Vertex AI",group:"inference",blurb:"Google Cloud models"},{id:"aws-bedrock",name:"Bedrock",group:"inference",blurb:"Models on AWS"},{id:"github",name:"GitHub",group:"code",blurb:"Repos and API",keyUrl:"https://github.com/settings/personal-access-tokens",keyHint:"github_pat_…"},{id:"pypi",name:"PyPI",group:"code",blurb:"Install Python packages"},{id:"aws",name:"AWS",group:"cloud",blurb:"AWS APIs"},{id:"aws-s3",name:"S3",group:"cloud",blurb:"Buckets and objects"},{id:"google-cloud",name:"Google Cloud",group:"cloud",blurb:"GCP APIs"}],e4=e=>J3.find(t=>t.id===e)??null,RQ=e=>e4(e)?`/logos/${e}.svg`:null;function nx({type:e,size:t="md",className:r}){const a=RQ(e),l=t==="lg"?"size-10 rounded-lg":t==="sm"?"size-6 rounded-md":"size-8 rounded-md",c=t==="lg"?"size-5":t==="sm"?"size-3.5":"size-[18px]";return s.jsx("span",{className:Le("flex shrink-0 items-center justify-center border border-border/80 bg-linear-to-b from-background to-muted/50 shadow-[0_1px_2px_#00000008]",l,r),children:a?s.jsx("img",{src:a,alt:"","aria-hidden":"true",className:Le("object-contain",c),draggable:!1}):s.jsx(pu,{strokeWidth:1.4,className:Le("text-muted-foreground",c),"aria-hidden":"true"})})}function t4(e){return e.id==="aws-bedrock"?"This profile requires an upstream Bedrock bridge. Direct AWS credential authentication is not implemented by this profile; this form cannot configure the bridge.":(e.credentials??[]).some(t=>{var r;return t.refresh===!0||((r=t.refresh)==null?void 0:r.strategy)})?"This profile requires managed credential refresh setup. Configure it with the OpenShell CLI; this form does not yet support its refresh material.":(e.credentials??[]).some(t=>{var r;return!((r=t.envVars)!=null&&r.length)})?"This profile has credentials without environment mappings and cannot be configured in this form.":null}function AQ(e){return(e.credentials??[]).map(t=>{var r;return{...t,key:(r=t.envVars)==null?void 0:r[0],label:t.description||t.name,placeholder:t.name==="account_id"?"Enter account ID":/token/.test(t.name)?"Paste token":"Paste API key",inputType:t.name==="account_id"?"text":"password"}})}function OQ(e,t){const r=t4(e);if(r)throw new Error(r);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Credentials must be an object.");const a=e.credentials??[],l=new Set(a.flatMap(u=>u.envVars??[])),c={};for(const[u,f]of Object.entries(t)){if(!l.has(u))throw new Error(`${u} is not a credential of this profile.`);if(typeof f!="string")throw new Error(`${u} must be text.`);if(f){if(!f.trim()||f!==f.trim()||/[\r\n\x00]/.test(f))throw new Error(`${u} contains whitespace or line breaks. Paste only the credential value.`);if(f.length>8192)throw new Error(`${u} is too long.`);c[u]=f}}for(const u of a){const f=u.envVars.filter(h=>c[h]);if(u.required&&!f.length)throw new Error(`${u.description||u.name} is required.`);if(new Set(f.map(h=>c[h])).size>1)throw new Error(`Aliases for ${u.name} must contain the same value.`)}if(a.length&&!Object.keys(c).length)throw new Error("Enter at least one credential.");return c}function MQ({query:e,setQuery:t,have:r,onPick:a,picking:l}){const c=e.trim().toLowerCase(),u=h=>!c||`${h.name} ${h.blurb} ${h.id}`.toLowerCase().includes(c),f=EQ.map(h=>({...h,items:J3.filter(m=>m.group===h.id&&u(m))})).filter(h=>h.items.length);return s.jsxs("div",{className:"space-y-3",children:[s.jsx(ra,{value:e,onValueChange:t,placeholder:"Search services","aria-label":"Search services",autoFocus:!0}),s.jsxs("div",{className:"-mx-1 max-h-[60svh] space-y-3 overflow-y-auto px-1 pt-1",children:[f.map(h=>s.jsxs("section",{children:[s.jsx("h3",{className:"mb-1.5 text-[10px] font-bold tracking-widest text-faint uppercase",children:h.label}),s.jsx("div",{className:"grid grid-cols-3 gap-1.5 sm:grid-cols-4",children:h.items.map(m=>s.jsxs("button",{type:"button",onClick:()=>a(m),disabled:!!l,title:m.blurb,className:"group relative flex items-center gap-2 rounded-lg border border-border/70 bg-card py-1.5 pr-2 pl-1.5 text-left outline-none transition-[border-color,background-color,transform] hover:border-foreground/20 hover:bg-muted/30 focus-visible:ring-2 focus-visible:ring-ring motion-safe:hover:-translate-y-px disabled:opacity-60",children:[l===m.id?s.jsx("span",{className:"flex size-6 items-center justify-center",children:s.jsx(zt,{className:"size-3.5"})}):s.jsx(nx,{type:m.id,size:"sm"}),s.jsx("span",{className:"min-w-0 truncate text-[12px] font-medium",children:m.name}),r.has(m.id)&&s.jsx("span",{className:"absolute -top-1 -right-1 flex size-3.5 items-center justify-center rounded-full bg-emerald-500 text-white",title:"You already have a secret for this",children:s.jsx(qn,{className:"size-2.5",strokeWidth:3})})]},m.id))})]},h.id)),!f.length&&s.jsxs("p",{className:"py-6 text-center text-[11px] text-muted-foreground",children:["No service matches “",e,"”."]})]})]})}function DQ({service:e,profile:t,taken:r,sandboxes:a,onBack:l,onDone:c}){const u=$t(),[f,h]=g.useState(()=>{const A=`my-${e.id}`;if(!r.has(A))return A;for(let R=2;;R++)if(!r.has(`${A}-${R}`))return`${A}-${R}`}),[m,x]=g.useState({}),[p,b]=g.useState([]),[v,j]=g.useState(!1),[S,N]=g.useState(null),C=t.endpoints.map(A=>A.host),E=AQ(t),T=t4(t),O=t.id==="codex"&&E.some(A=>A.key==="CODEX_AUTH_ACCESS_TOKEN"),k=E.length===0;async function M(A){A.preventDefault(),j(!0),N(null);try{await u.createSecret({name:f,type:t.id,credentials:OQ(t,m)}),x({});const R=[];for(const z of p)try{await u.attachSecret(f,z,!0)}catch{R.push(z)}He.success(`Stored ${f}`,{description:p.length?`Attached to ${p.filter(z=>!R.includes(z)).join(", ")||"none"}${R.length?` · failed: ${R.join(", ")}`:""}`:"Credential saved. Vendor connection not tested."}),c()}catch(R){N(R.message)}finally{j(!1)}}return s.jsxs("form",{onSubmit:M,autoComplete:"off",className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ce,{type:"button",variant:"ghost",size:"icon-sm",onClick:l,"aria-label":"Choose another service",children:s.jsx(Hv,{})}),s.jsx(nx,{type:e.id,size:"lg"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-[14px] font-medium",children:e.name}),s.jsx("p",{className:"truncate text-[11px] text-muted-foreground",children:e.blurb})]}),e.keyUrl&&!k&&!T&&s.jsxs("a",{href:e.keyUrl,target:"_blank",rel:"noreferrer",className:"flex shrink-0 items-center gap-0.5 rounded-md px-2 py-1 text-[11px] text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:["Get a key",s.jsx(Mi,{className:"size-3"})]})]}),O&&s.jsxs("p",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2.5 text-xs leading-relaxed",children:["This profile stores an existing ChatGPT OAuth session: access token, refresh token, and account ID, with an optional ID token. An OpenAI API key does not belong in these fields. Browser sign-in and API-key setup for Codex are not available in this form. ",s.jsx("a",{className:"underline",href:e.helpUrl,target:"_blank",rel:"noreferrer",children:"Authentication guide"})]}),T&&s.jsx("p",{role:"status",className:"rounded-lg border border-border bg-muted/30 px-3 py-2.5 text-xs leading-relaxed",children:T}),k&&s.jsxs("p",{className:"rounded-lg border border-border px-3 py-2.5 text-[11px] leading-relaxed",children:[s.jsx("span",{className:"font-medium",children:"No key needed."})," ",s.jsxs("span",{className:"text-muted-foreground",children:["This lets a sandbox reach ",e.name,"'s hosts, but only from the programs below."]})]}),s.jsx("div",{className:"space-y-2.5",children:!T&&E.map((A,R)=>{const z=A.key;return s.jsxs("label",{className:"block",children:[s.jsxs("span",{className:"mb-1 flex items-baseline gap-2 text-[11px]",children:[s.jsxs("span",{className:"font-medium",children:[A.label,A.required?s.jsx("span",{className:"text-muted-foreground",children:" · required"}):s.jsx("span",{className:"font-normal text-muted-foreground",children:" · optional"})]}),s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:z})]}),s.jsxs("span",{className:"relative block",children:[s.jsx(uC,{className:"absolute top-2.5 left-3 size-3.5 text-muted-foreground","aria-hidden":"true"}),s.jsx(Ot,{"aria-label":A.label,type:A.inputType,value:m[z]??"",onChange:_=>x(L=>({...L,[z]:_.target.value})),className:"h-9 pl-9 font-mono text-xs",placeholder:E.length===1&&e.keyHint?e.keyHint:A.placeholder,required:A.required,maxLength:8192,autoFocus:R===0,spellCheck:!1,autoComplete:"off"})]})]},z)})}),s.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2.5",children:[s.jsx("p",{className:"text-[10px] font-bold tracking-widest text-faint uppercase",children:"Profile destinations"}),s.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:C.map(A=>s.jsx("span",{className:"rounded border border-border bg-card px-1.5 py-0.5 font-mono text-[10px]",children:A},A))}),s.jsxs("p",{className:"mt-1.5 text-[10px] text-muted-foreground",children:["Allowed program paths: ",t.binaries.join(", ")||"None declared",". These must match the programs installed in your sandbox."]})]}),!T&&s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsxs("label",{className:"grid w-44 gap-1",children:[s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name"}),s.jsx(Ot,{value:f,onChange:A=>h(A.target.value.toLowerCase()),className:"h-8 font-mono text-xs",required:!0,pattern:"[a-z0-9]([a-z0-9\\-]{0,61}[a-z0-9])?"})]}),a.length>0&&s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"mb-1 block text-[11px] text-muted-foreground",children:"Attach to"}),s.jsx("div",{className:"flex flex-wrap gap-1",children:a.map(A=>{const R=p.includes(A.name);return s.jsxs("button",{type:"button","aria-pressed":R,onClick:()=>b(z=>R?z.filter(_=>_!==A.name):[...z,A.name]),className:`flex h-8 items-center gap-1.5 rounded-md border px-2 font-mono text-[11px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${R?"border-foreground/25 bg-accent":"border-border text-muted-foreground hover:text-foreground"}`,children:[s.jsx("span",{className:`size-1.5 rounded-full ${R?"bg-emerald-500":"bg-stone-300"}`,"aria-hidden":"true"}),A.name]},A.id)})})]})]}),S&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:S}),s.jsxs(ce,{type:"submit",disabled:v||!!T,className:"h-9 w-full bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[v?s.jsx(zt,{}):s.jsx(uC,{}),k?`Add ${e.name} access`:`Store ${e.name} secret`]})]})}function zQ({open:e,onOpenChange:t,profiles:r,providers:a,sandboxes:l,reload:c}){const u=$t(),f=lr(),[h,m]=g.useState(""),[x,p]=g.useState(null),[b,v]=g.useState(null),[j,S]=g.useState(r);g.useEffect(()=>S(r),[r]),g.useEffect(()=>{e||(p(null),m(""),v(null))},[e]);const N=new Set(a.map(M=>M.type)),C=new Set(a.map(M=>M.name)),E=x&&j.find(M=>M.id===x.id);async function T(M){if(j.some(A=>A.id===M.id)){p(M);return}v(M.id);try{await u.importProfile(M.id);const A=await c();S((A==null?void 0:A.profiles)??j),p(M)}catch(A){He.error(`Couldn't set up ${M.name}: ${A.message}`)}finally{v(null)}}const O=x&&E?"key":"pick",k=f?{}:{initial:{opacity:0,x:O==="key"?12:-12},animate:{opacity:1,x:0},exit:{opacity:0,x:O==="key"?-12:12},transition:{duration:.16,ease:"easeOut"}};return s.jsx(vn,{open:e,onOpenChange:t,children:s.jsxs(wn,{className:"gap-0 overflow-hidden p-0 sm:max-w-[580px]","aria-describedby":void 0,children:[s.jsxs("div",{className:"border-b border-border px-5 pt-4 pb-3",children:[s.jsx(bn,{className:"text-[14px]",children:O==="pick"?"Add secret":(E==null?void 0:E.credentials.length)===0?`Add ${x.name}`:"Add credentials"}),s.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:O==="pick"?"Pick the service it's for.":(E==null?void 0:E.credentials.length)===0?"Access only. Nothing secret is stored.":"Stored by the gateway. Saving does not verify the vendor connection."})]}),s.jsx("div",{className:"max-h-[75svh] overflow-y-auto p-5",children:s.jsx(Rf,{mode:"wait",initial:!1,children:s.jsx(Yn.div,{...k,children:O==="pick"?s.jsx(MQ,{query:h,setQuery:m,have:N,onPick:T,picking:b}):s.jsx(DQ,{service:x,profile:E,taken:C,sandboxes:l,onBack:()=>p(null),onDone:()=>{t(!1),c()}})},O)})})]})})}const PQ={header:e=>`sent as the ${e.headerName??"custom"} header`,bearer:()=>"sent as Authorization: Bearer",basic:()=>"sent as HTTP basic auth",query:e=>`sent as the ?${e.queryParam??"…"} parameter`,path:()=>"placed in the request path"},IQ=e=>(PQ[e.authStyle]??(()=>"resolved by the proxy"))(e),_Q=e=>e&&Date.parse(e)-Date.now()<7*864e5;function LQ({id:e,label:t,hint:r,value:a,onChange:l,required:c}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsxs(On,{htmlFor:e,className:"font-mono text-[11px]",children:[t,c&&s.jsx("span",{className:"text-red-600",children:" *"})]}),s.jsx(Ot,{id:e,type:"password",value:a,onChange:u=>l(u.target.value),autoComplete:"off",spellCheck:!1,className:"font-mono text-xs",placeholder:"Paste the value",required:c,title:r})]})}function BQ({secret:e,onClose:t,onDone:r}){const a=$t(),[l,c]=g.useState({}),[u,f]=g.useState(!1),[h,m]=g.useState(null);return g.useEffect(()=>{c({}),m(null)},[e]),s.jsx(vn,{open:!!e,onOpenChange:x=>{x||t()},children:s.jsx(wn,{className:"sm:max-w-md","aria-describedby":void 0,children:s.jsxs("form",{autoComplete:"off",className:"grid gap-4",onSubmit:async x=>{x.preventDefault(),f(!0),m(null);try{const p=await a.rotateSecret(e.name,l);c({}),He.success(`Rotated ${e.name}`,{description:p.sandboxesNotified?`${p.sandboxesNotified} sandbox${p.sandboxesNotified===1?"":"es"} updated`:void 0}),t(),r()}catch(p){m(p.message)}finally{f(!1)}},children:[s.jsx(jn,{children:s.jsxs(bn,{children:["Rotate ",e==null?void 0:e.name]})}),e==null?void 0:e.credentialKeys.map(x=>s.jsx(LQ,{id:`rot-${x}`,label:x,value:l[x]??"",onChange:p=>c(b=>({...b,[x]:p}))},x)),h&&s.jsx("p",{role:"alert",className:"rounded-md border border-red-200 bg-red-50/60 px-3 py-2 text-[11px] text-red-700",children:h}),s.jsxs(ea,{children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:t,children:"Cancel"}),s.jsxs(ce,{type:"submit",disabled:u||!Object.values(l).some(Boolean),className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[u&&s.jsx(zt,{"aria-hidden":"true"}),"Rotate"]})]})]})})})}function $Q({secret:e,keyName:t,onDone:r}){var m;const a=$t(),l=(m=e.expires)==null?void 0:m[t],[c,u]=g.useState(!1),[f,h]=g.useState("");return c?s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Ot,{type:"date",value:f,onChange:x=>h(x.target.value),className:"h-7 w-36 text-[11px]","aria-label":`Expiry for ${t}`}),s.jsx(ce,{size:"xs",variant:"outline",onClick:async()=>{try{await a.secretExpiry(e.name,t,f?new Date(`${f}T23:59:00`).toISOString():null),He.success(f?"Expiry set":"Expiry cleared"),u(!1),r()}catch(x){He.error(x.message)}},children:"Save"}),l&&s.jsx(ce,{size:"xs",variant:"ghost",onClick:async()=>{try{await a.secretExpiry(e.name,t,null),u(!1),r()}catch(x){He.error(x.message)}},children:"Clear"}),s.jsx(ce,{size:"icon-xs",variant:"ghost",onClick:()=>u(!1),"aria-label":"Cancel",children:s.jsx(En,{})})]}):s.jsxs("button",{onClick:()=>{h(l?l.slice(0,10):""),u(!0)},className:`flex items-center gap-1 text-[11px] outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring ${_Q(l)?"text-amber-700":"text-muted-foreground"}`,children:[s.jsx(VP,{className:"size-3"}),l?`expires ${Hd(l)}`:"no expiry"]})}function VQ({secret:e,profile:t,sandboxes:r,onRotate:a,onDelete:l,onDone:c}){var p;const u=$t(),[f,h]=g.useState(!1),m=r.filter(b=>!e.attachedTo.includes(b.name));async function x(b,v){h(!0);try{await u.attachSecret(e.name,b,v),He.success(v?`Attached to ${b}`:`Detached from ${b}`),c()}catch(j){He.error(j.message)}finally{h(!1)}}return s.jsxs("div",{className:"bg-card",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border/70 px-4 py-3",children:[s.jsx(nx,{type:e.type}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"truncate font-mono text-[13px] font-medium",children:e.name}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:((p=e4(e.type))==null?void 0:p.name)??(t==null?void 0:t.name)??e.type})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[e.credentialKeys.length>0&&s.jsxs(ce,{size:"sm",variant:"outline",onClick:a,children:[s.jsx($a,{}),"Rotate"]}),s.jsx(ce,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l,"aria-label":`Delete ${e.name}`,children:s.jsx(Gn,{className:"size-3.5"})})]})]}),s.jsxs("div",{className:"grid gap-4 px-4 py-3 ",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("h4",{className:"text-[10px] font-bold tracking-widest text-faint uppercase",children:"Credentials"}),e.credentialKeys.length===0&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"None. Access only."}),e.credentialKeys.map(b=>{const v=t==null?void 0:t.credentials.find(j=>j.envVars.includes(b));return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-[11px]",title:v?IQ(v):void 0,children:[s.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-hidden":"true"}),b]}),s.jsx("div",{className:"pl-3",children:s.jsx($Q,{secret:e,keyName:b,onDone:c})})]},b)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("h4",{className:"text-[10px] font-bold tracking-widest text-faint uppercase",children:"Allowed hosts"}),t?s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"space-y-0.5 font-mono text-[11px]",children:t.endpoints.map(b=>s.jsxs("li",{children:[b.host,b.port?`:${b.port}`:"",s.jsxs("span",{className:"font-sans text-[10px] text-muted-foreground",children:[" ",b.access??""]})]},`${b.host}:${b.port}`))}),s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["by ",t.binaries.map(b=>b.split("/").pop()).filter((b,v,j)=>j.indexOf(b)===v).join(", ")||"any program"]})]}):s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Profile not found."})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-border/70 px-4 py-2.5 text-[11px]",children:[s.jsx(OR,{className:"size-3 text-muted-foreground","aria-hidden":"true"}),s.jsx("span",{className:"text-muted-foreground",children:"Attached to"}),e.attachedTo.map(b=>s.jsxs("span",{className:"flex items-center gap-0.5 rounded bg-muted py-0.5 pr-0.5 pl-1.5 font-mono text-[10px]",children:[b,s.jsx("button",{onClick:()=>x(b,!1),disabled:f,"aria-label":`Detach from ${b}`,className:"rounded p-0.5 text-muted-foreground outline-none hover:text-destructive focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"size-2.5"})})]},b)),!e.attachedTo.length&&s.jsx("span",{className:"text-muted-foreground/70",children:"no sandbox"}),m.length>0&&s.jsxs(cn,{value:"",disabled:f,onChange:b=>b.target.value&&x(b.target.value,!0),"aria-label":"Attach to a sandbox",className:"ml-auto h-7 rounded-md border border-input bg-transparent px-1.5 text-[11px] text-muted-foreground",children:[s.jsx("option",{value:"",children:"Attach to…"}),m.map(b=>s.jsx("option",{value:b.name,children:b.name},b.id))]}),f&&s.jsx(zt,{className:"size-3"})]})]})}const eR=[],tR=[{id:"name",label:"Secret",width:"28%"},{id:"service",label:"Service",width:"16%"},{id:"credentials",label:"Credentials",width:"13%"},{id:"attached",label:"Sandboxes",width:"16%"},{id:"expiry",label:"Next expiry",width:"15%"},{id:"hosts",label:"Allowed hosts",width:"12%"}],UQ={none:"No expiry",expired:"Expired",expiring:"Within 7 days",scheduled:"Scheduled"};function HQ(){const e=Cn();return s.jsx(FQ,{},(e==null?void 0:e.id)??(e==null?void 0:e.context)??"default")}function FQ(){const e=$t(),t=qa(),[r,a]=g.useState(null),[l,c]=g.useState(null),[u,f]=g.useState(!1),[h,m]=g.useState(!1),[x,p]=g.useState(null),[b,v]=g.useState(null),[j,S]=g.useState(null),[N,C]=g.useState(""),[E,T]=g.useState("all"),[O,k]=g.useState(""),[M,A]=g.useState(""),[R,z]=g.useState({key:"name",direction:"asc"}),[_,L]=g.useState(Date.now),Y=g.useRef(null),P=g.useDeferredValue(N),V=g.useCallback(async()=>{f(!0);try{const ne=await e.secrets();return a(ne),c(null),ne}catch(ne){return c(ne.message),null}finally{f(!1)}},[e]);g.useEffect(()=>{V()},[V]),g.useEffect(()=>{const ne=setInterval(()=>L(Date.now()),6e4),ie=oe=>{var Z;(oe.metaKey||oe.ctrlKey)&&oe.key.toLowerCase()==="k"&&!j&&!h&&!x&&!b&&(oe.preventDefault(),(Z=Y.current)==null||Z.focus())};return window.addEventListener("keydown",ie),()=>{clearInterval(ne),window.removeEventListener("keydown",ie)}},[j,h,x,b]);const U=(r==null?void 0:r.providers)??eR,H=(r==null?void 0:r.profiles)??eR,F=g.useMemo(()=>kQ(U,H,_),[U,H,_]),q=g.useMemo(()=>TQ(F,{query:P,scope:E,service:O,expiry:M,sort:R}),[F,P,E,O,M,R]),W=g.useMemo(()=>[...new Map(F.map(ne=>[ne.secret.type,ne.service])).entries()].sort((ne,ie)=>ne[1].localeCompare(ie[1])),[F]),B=tx({count:q.length,rowHeight:40});g.useEffect(()=>{B.scrollToTop()},[P,E,O,M,R]);const J=F.find(ne=>ne.secret.name===j),X=(t.sandboxes??[]).filter(ne=>ne.phase!=="deleting"),re=F.filter(ne=>ne.secret.attachedTo.length>0).length,I=F.filter(ne=>ne.status==="expiring").length,$=F.filter(ne=>ne.status==="expired").length,Q=N||E!=="all"||O||M,G=()=>{C(""),T("all"),k(""),A("")},se=()=>{V(),t.refresh()},ee="h-10 border-b border-border/60 px-4 py-0 align-middle text-muted-foreground";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex h-[calc(100svh-3.5rem)] min-h-0 flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-border px-4 pt-4 pb-3 sm:px-6",role:"group","aria-label":"Secret inventory summary",children:[[["all","Secrets",F.length],["attached","Attached",re],["unattached","Unattached",F.length-re]].map(([ne,ie,oe])=>s.jsxs("button",{"aria-pressed":E===ne,onClick:()=>T(ne),className:`rounded-md px-3 py-1.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring ${E===ne?"bg-accent/70":"hover:bg-muted/60"}`,children:[s.jsx("span",{className:"text-[11px] text-muted-foreground",children:ie}),s.jsx("span",{className:"mt-1 block font-mono text-lg leading-none tabular-nums",children:s.jsx(Qd,{value:oe})})]},ne)),s.jsx("div",{className:"ml-auto flex gap-1",children:[["expiring","Expiring in 7 days",I],["expired","Expired",$]].map(([ne,ie,oe])=>s.jsxs("button",{"aria-pressed":M===ne,onClick:()=>A(M===ne?"":ne),className:`rounded-md px-3 py-1.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring ${M===ne?"bg-accent/70":"hover:bg-muted/60"}`,children:[s.jsx("span",{className:"text-[11px] text-muted-foreground",children:ie}),s.jsx("span",{className:`mt-1 block font-mono text-lg leading-none tabular-nums ${oe?ne==="expired"?"text-red-600":"text-amber-700":"text-muted-foreground"}`,children:s.jsx(Qd,{value:oe})})]},ne))})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-4 py-2 sm:px-6",children:[s.jsx(ra,{ref:Y,value:N,onValueChange:C,placeholder:"Search name, sandbox, host…","aria-label":"Search secrets",className:"mr-auto w-full sm:w-72"}),s.jsxs(cn,{"aria-label":"Filter by service",value:O,onChange:ne=>k(ne.target.value),className:"h-8 max-w-44 rounded-md border border-border bg-card px-2 text-xs",children:[s.jsx("option",{value:"",children:"All services"}),W.map(([ne,ie])=>s.jsx("option",{value:ne,children:ie},ne))]}),s.jsxs(cn,{"aria-label":"Filter by expiry",value:M,onChange:ne=>A(ne.target.value),className:"h-8 rounded-md border border-border bg-card px-2 text-xs",children:[s.jsx("option",{value:"",children:"Any expiry"}),Object.entries(UQ).map(([ne,ie])=>s.jsx("option",{value:ne,children:ie},ne))]}),Q&&s.jsxs(ce,{variant:"ghost",size:"sm",onClick:G,children:[s.jsx(En,{}),"Clear"]}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Refresh secrets",disabled:u,onClick:se,children:s.jsx($a,{className:u?"animate-spin":""})}),s.jsxs(ce,{size:"sm",disabled:!r,onClick:()=>m(!0),className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[s.jsx(ds,{}),"Add secret"]})]}),l&&s.jsxs("div",{role:"alert",className:"flex items-center gap-3 border-b border-border px-6 py-2 text-xs text-red-600",children:[s.jsxs("span",{children:[r?"Could not refresh. Showing the last reading. ":"",l]}),s.jsx(ce,{variant:"outline",size:"sm",onClick:V,children:"Retry"})]}),s.jsx("div",{ref:B.ref,onScroll:B.onScroll,tabIndex:0,role:"region","aria-label":"Secret inventory",className:"min-h-0 flex-1 overflow-auto overscroll-contain outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:!r&&!l?s.jsx("p",{role:"status",className:"py-20 text-center text-sm text-muted-foreground",children:"Loading secrets…"}):q.length?s.jsxs("table",{"aria-label":"Secrets","aria-rowcount":q.length+1,className:"w-full min-w-[900px] table-fixed border-separate border-spacing-0 text-xs",children:[s.jsx("colgroup",{children:tR.map(ne=>s.jsx("col",{style:{width:ne.width}},ne.id))}),s.jsx("thead",{className:"sticky top-0 z-10 bg-muted",children:s.jsx("tr",{"aria-rowindex":1,children:tR.map(ne=>s.jsx("th",{scope:"col","aria-sort":R.key===ne.id?R.direction==="asc"?"ascending":"descending":"none",className:"h-9 border-b border-border px-4 text-left font-medium text-muted-foreground first:pl-6",children:ne.id==="hosts"?ne.label:s.jsxs("button",{className:"flex h-9 w-full items-center gap-1.5 outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>z({key:ne.id,direction:R.key===ne.id&&R.direction==="asc"?"desc":"asc"}),children:[ne.label,R.key===ne.id&&(R.direction==="asc"?s.jsx(sf,{className:"size-3"}):s.jsx(nf,{className:"size-3"}))]})},ne.id))})}),s.jsxs("tbody",{children:[B.paddingTop>0&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:6,style:{height:B.paddingTop,padding:0}})}),q.slice(B.start,B.end).map((ne,ie)=>s.jsxs("tr",{"aria-rowindex":B.start+ie+2,onClick:()=>S(ne.secret.name),className:"group cursor-pointer bg-card hover:bg-muted/60 focus-within:bg-muted/60",children:[s.jsx("td",{className:`${ee} pl-6`,children:s.jsxs("button",{"aria-haspopup":"dialog","aria-label":`Open ${ne.secret.name}`,className:"flex h-9 w-full items-center gap-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:oe=>{oe.stopPropagation(),S(ne.secret.name)},children:[s.jsx(nx,{type:ne.secret.type,size:"sm"}),s.jsx("span",{title:ne.secret.name,className:"truncate font-medium text-foreground",children:ne.secret.name}),s.jsx(Mi,{className:"ml-auto size-3 shrink-0 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"})]})}),s.jsx("td",{className:ee,children:s.jsx("span",{className:"block truncate",title:ne.service,children:ne.service})}),s.jsx("td",{className:ee,children:s.jsx("span",{className:"font-mono text-[11px]",children:ne.secret.credentialKeys.length||"Access only"})}),s.jsx("td",{className:ee,children:s.jsx("span",{className:"block truncate",title:ne.secret.attachedTo.slice(0,10).join(", "),children:ne.secret.attachedTo.length===1?ne.secret.attachedTo[0]:ne.secret.attachedTo.length?`${ne.secret.attachedTo.length.toLocaleString()} sandboxes`:"Unattached"})}),s.jsx("td",{className:ee,children:s.jsxs("span",{className:ne.status==="expired"?"text-red-600":ne.status==="expiring"?"text-amber-700":"",title:ne.expiry?new Date(ne.expiry).toLocaleString():void 0,children:[ne.status==="expired"?"Expired · ":"",ne.expiry?new Date(ne.expiry).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):"No expiry"]})}),s.jsx("td",{className:ee,children:s.jsx("span",{className:"block truncate font-mono text-[11px]",title:ne.hosts.join(", "),children:ne.hosts.length===1?ne.hosts[0]:ne.hosts.length?`${ne.hosts.length} hosts`:"-"})})]},ne.secret.name)),B.end<q.length&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:6,style:{height:(q.length-B.end)*40,padding:0}})})]})]}):s.jsxs("div",{className:"py-20 text-center",children:[s.jsx(pu,{className:"mx-auto mb-3 size-6 text-muted-foreground"}),s.jsx("p",{className:"text-sm",children:l&&!r?"Secrets unavailable":F.length?"No matching secrets":"No secrets yet"}),r&&s.jsx(ce,{variant:"outline",className:"mt-4",onClick:F.length?G:()=>m(!0),children:F.length?"Clear filters":"Add secret"})]})}),s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border bg-card px-6 py-2 text-[11px] text-muted-foreground",children:[s.jsxs("span",{children:[s.jsx("strong",{className:"font-medium text-foreground",children:q.length.toLocaleString()}),Q?` of ${F.length.toLocaleString()}`:""," secrets"]}),s.jsx("span",{className:"hidden sm:inline",children:"Click a row to inspect · ⌘K to search"})]})]}),s.jsx($l,{open:!!J,onOpenChange:ne=>{ne||S(null)},children:s.jsxs(uu,{className:"w-full gap-0 sm:max-w-lg","aria-describedby":"secret-description",children:[s.jsxs(du,{className:"border-b border-border px-4 py-4 pr-12",children:[s.jsx(fu,{children:"Secret details"}),s.jsx(mu,{id:"secret-description",className:"text-xs",children:"Manage credentials, expiry, and sandbox access."})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:J&&s.jsx(VQ,{secret:J.secret,profile:J.profile,sandboxes:X,onRotate:()=>p(J.secret),onDelete:()=>v(J.secret),onDone:se},J.secret.name)})]})}),s.jsx(zQ,{open:h,onOpenChange:m,profiles:H,providers:U,sandboxes:X,reload:async()=>{const ne=await V();return t.refresh(),ne}}),s.jsx(BQ,{secret:x,onClose:()=>p(null),onDone:se}),s.jsx(Qr,{open:!!b,onOpenChange:ne=>{ne||v(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:["Delete ",b==null?void 0:b.name,"?"]}),s.jsx(no,{children:b!=null&&b.attachedTo.length?`Detach from ${b.attachedTo.join(", ")} first.`:"This cannot be undone."})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsx(so,{variant:"destructive",disabled:!!(b!=null&&b.attachedTo.length),onClick:async()=>{try{await e.deleteSecret(b.name),He.success(`Deleted ${b.name}`),se()}catch(ne){He.error(ne.message)}finally{v(null)}},children:"Delete"})]})]})})]})}async function GQ(e,t,r,a={}){var u,f,h;const l=await H3(e,t.setups||[],null,{...a,expectedRevisions:t.setupRevisions});if((u=a.signal)!=null&&u.aborted)throw new DOMException("Preparation cancelled.","AbortError");const c=ja({...t,setups:l.setups.map(m=>m.id),setupRevisions:Object.fromEntries(l.setups.map(m=>[m.id,m.revision]))});return(f=a.onPrepared)==null||f.call(a),(h=a.onProgress)==null||h.call(a,"Starting image build…"),e.buildImageTemplate(c,r)}const qQ="bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90";function Go({label:e,hint:t,htmlFor:r,children:a}){return s.jsxs("div",{className:"grid content-start gap-2",children:[s.jsx(On,{htmlFor:r,className:"text-xs",children:e}),a,t&&s.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:t})]})}function Bd({selected:e,onClick:t,children:r,disabled:a=!1}){return s.jsxs("button",{type:"button","aria-pressed":e,disabled:a,onClick:t,className:`flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left text-xs outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring ${e?"border-foreground/35 bg-muted/50":"bg-card text-muted-foreground hover:border-foreground/25"}`,children:[r,s.jsx("span",{className:`ml-auto flex size-4 items-center justify-center rounded-full border ${e?"border-foreground bg-foreground text-background":"border-border"}`,children:e&&s.jsx(qn,{className:"size-2.5"})})]})}function YQ(e){const t=Cn();return s.jsx(KQ,{...e},(t==null?void 0:t.id)??(t==null?void 0:t.context)??"default")}function KQ({initial:e,draftKey:t,onClose:r,onStarted:a}){var Q;const l=$t(),c=Cn(),[u,f]=g.useState(()=>ja(e==null?void 0:e.recipe)),h=!!(e!=null&&e.replace),[m]=g.useState(()=>(e==null?void 0:e.baseline)??JSON.stringify(ja(e==null?void 0:e.recipe))),[x,p]=g.useState(!!(e!=null&&e.advanced)),[b,v]=g.useState(()=>!Lp.some(G=>G.id===ja(e==null?void 0:e.recipe).command)),[j,S]=g.useState(()=>!!ja(e==null?void 0:e.recipe).customAgents.length||ls.some(G=>!G.featured&&ja(e==null?void 0:e.recipe).agents.includes(G.id))),[N,C]=g.useState(""),[E,T]=g.useState(!1),[O,k]=g.useState(!1),[M,A]=g.useState(""),R=g.useRef(null);g.useEffect(()=>()=>{var G;return(G=R.current)==null?void 0:G.abort()},[]);const[z,_]=g.useState(null),[L,Y]=g.useState(!1),[P,V]=g.useState(!1),U=u.source==="build",H=G=>{Xg({...u,...G})&&v(!1),f(se=>ja({...se,...G,...G.setups?{setupRevisions:Object.fromEntries(Object.entries(se.setupRevisions||{}).filter(([ee])=>G.setups.includes(ee)))}:{}}))},F=JSON.stringify(u)!==m,q=VG(u);g.useEffect(()=>{try{sessionStorage.setItem(t,JSON.stringify({recipe:u,replace:h,baseline:m,advanced:x}))}catch{}},[t,u,h,m,x]),g.useEffect(()=>{let G=!0;return l.localImages().then(se=>{G&&_(se)}).catch(se=>{G&&_({images:[],error:se.message})}),()=>{G=!1}},[l]),g.useEffect(()=>{const G=se=>{F&&(se.preventDefault(),se.returnValue="")};return window.addEventListener("beforeunload",G),()=>window.removeEventListener("beforeunload",G)},[F]);function W(G){var ne;const se=u.agents.includes(G)?u.agents.filter(ie=>ie!==G):ls.filter(ie=>ie.id===G||u.agents.includes(ie.id)).map(ie=>ie.id),ee=!b&&(u.command===""?u.agents.length===0:ls.some(ie=>ie.command===u.command));se.length>1&&v(!1),H({agents:se,...ee?{command:((ne=ls.find(ie=>ie.id===se[0]))==null?void 0:ne.command)??""}:{}})}const B=G=>H({runtimes:u.runtimes.includes(G)?u.runtimes.filter(se=>se!==G):[...u.runtimes,G]}),J=[Dv(u).some(G=>G.npm)&&!u.runtimes.includes("node")&&"Node.js 22",Dv(u).some(G=>G.python)&&!u.runtimes.includes("python")&&"Python 3"].filter(Boolean),X=Lp.filter(G=>{var se;return!U||G.id===""||u.agents.includes((se=ls.find(ee=>ee.command===G.id))==null?void 0:se.id)});async function re(G){G.preventDefault();const se=Object.entries(q)[0]??(b&&!u.command.trim()?["command","Enter a start command, or pick one of the options."]:null);if(se){["base","packages","setup","environment"].includes(se[0])&&p(!0),se[0]==="customAgents"&&S(!0),C(se[1]);return}if(E||(c==null?void 0:c.connected)===!1)return;T(!0),k(!0),C(""),A("");const ee=new AbortController;R.current=ee;try{a(await GQ(l,u,h,{signal:ee.signal,onProgress:A,onPrepared:()=>k(!1)}))}catch(ne){ne.name!=="AbortError"&&C(ne.message)}finally{T(!1),k(!1),A(""),R.current=null}}function I(){const G=URL.createObjectURL(new Blob([zv(u)],{type:"text/plain"})),se=document.createElement("a");se.href=G,se.download="Dockerfile",se.click(),URL.revokeObjectURL(G)}function $(){E||(F?V(!0):r())}return s.jsx(vn,{open:!0,onOpenChange:G=>{G||$()},children:s.jsx(wn,{showCloseButton:!1,className:"max-h-[calc(100svh-2rem)] overflow-hidden p-0 sm:max-w-2xl",children:s.jsxs("form",{onSubmit:re,className:"flex max-h-[calc(100svh-2rem)] min-h-0 flex-col",children:[s.jsxs(jn,{className:"shrink-0 flex-row items-center justify-between gap-3 border-b bg-card px-5 py-4 sm:px-6",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(bn,{className:"truncate text-sm",children:h?`Edit ${u.name}`:"New image template"}),s.jsxs(Ia,{children:[s.jsx(_a,{type:"button","aria-label":"About template access",className:"rounded-sm text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(ru,{className:"size-3.5"})}),s.jsx(La,{children:"Software only. Network, file and credential access come from the security preset you pick at launch, plus the selected agents' own sign-in and model destinations."})]})]}),s.jsx(_n,{className:"sr-only",children:"Choose the software and start command for your sandbox image."}),s.jsx(Co,{location:c})]}),s.jsx(ce,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Close template creation",disabled:E,onClick:$,children:s.jsx(En,{})})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s.jsxs("fieldset",{disabled:E||(c==null?void 0:c.connected)===!1,className:"mx-auto w-full max-w-2xl min-w-0 space-y-5 px-5 py-5 disabled:opacity-65 sm:px-6",children:[s.jsx(jf,{value:u.source,onValueChange:G=>{H({source:G}),G==="build"&&u.agents.length>1&&v(!1),C("")},children:s.jsxs(Sf,{className:"w-full",children:[s.jsx(jr,{value:"build",className:"text-xs",children:"Build an image"}),s.jsx(jr,{value:"image",className:"text-xs",children:"Use an existing image"})]})}),U&&s.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:"Images build on the console’s local Docker engine. For an SSH host, the image is built for its architecture and transferred automatically before the template is saved."}),s.jsx(Go,{label:"Name",htmlFor:"template-name",hint:u.name&&q.name?q.name:void 0,children:s.jsx(Ot,{id:"template-name",value:u.name,disabled:h,maxLength:19,onChange:G=>H({name:G.target.value.toLowerCase()}),placeholder:"frontend-app",className:"font-mono text-xs",autoFocus:!h})}),U?s.jsxs(s.Fragment,{children:[s.jsxs(Go,{label:"Agents",children:[s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:ls.filter(G=>G.featured).map(G=>s.jsxs(Bd,{selected:u.agents.includes(G.id),onClick:()=>W(G.id),children:[s.jsx("img",{src:G.logo,alt:"",className:"size-5 object-contain"}),s.jsx("span",{className:"font-medium text-foreground",children:G.name})]},G.id))}),s.jsxs(ce,{type:"button",variant:"outline",size:"sm","aria-expanded":j,"aria-controls":"template-more-agents",onClick:()=>S(G=>!G),className:"w-full justify-between",children:[s.jsxs("span",{children:[j?"Fewer agents":"More agents",!j&&u.customAgents.length>0&&" · custom install",ls.some(G=>!G.featured&&u.agents.includes(G.id))&&` · ${ls.filter(G=>!G.featured&&u.agents.includes(G.id)).length} selected`]}),s.jsx(ko,{className:`size-3.5 transition-transform ${j?"rotate-180":""}`})]}),j&&s.jsxs("div",{id:"template-more-agents",className:"space-y-2",children:[s.jsx("div",{className:"grid gap-2 sm:grid-cols-3",children:ls.filter(G=>!G.featured).map(G=>s.jsxs(Bd,{selected:u.agents.includes(G.id),onClick:()=>W(G.id),children:[s.jsx("img",{src:G.logo,alt:"",className:"size-4 object-contain"}),s.jsx("span",{className:"text-foreground",children:G.name})]},G.id))}),s.jsx(QQ,{agents:u.customAgents,onChange:G=>{G.length>u.customAgents.length&&v(!1),H({customAgents:G,...G.length>u.customAgents.length?{command:""}:{}})},error:N?q.customAgents:void 0})]})]}),s.jsx(Go,{label:"Repository",htmlFor:"template-repository",hint:"Optional. A public HTTPS repository, cloned into /sandbox/project. Private repositories can be cloned after launch.",children:s.jsx(Ot,{id:"template-repository",value:u.repository,onChange:G=>H({repository:G.target.value.trim()}),placeholder:"https://github.com/your-team/project.git",className:"font-mono text-xs"})}),s.jsx(Go,{label:"Runtimes and tools",hint:[J.length&&`${J.join(" and ")} ${J.length>1?"are":"is"} included for the selected agents.`,u.runtimes.includes("vscode")&&"VS Code Server allows VS Code's server download from the start. Open in VS Code works without it and allows the download on first open."].filter(Boolean).join(" ")||void 0,children:s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:Ow.map(G=>s.jsxs(Bd,{selected:u.runtimes.includes(G.id),onClick:()=>B(G.id),children:[s.jsx("img",{src:G.logo,alt:"",className:`size-5 object-contain ${G.id==="vscode"?"dark:invert":""}`}),s.jsx("span",{className:"font-medium text-foreground",children:G.name})]},G.id))})})]}):s.jsxs(Go,{label:"Image",htmlFor:"template-image",hint:z!=null&&z.error?z.error:"An image on the selected Docker engine, or a registry reference Docker is signed in to. OpenShell boots it as is.",children:[s.jsx(Ot,{id:"template-image",value:u.image,onChange:G=>H({image:G.target.value.trim()}),placeholder:"ghcr.io/your-team/workspace:latest",className:"font-mono text-xs"}),((Q=z==null?void 0:z.images)==null?void 0:Q.length)>0&&s.jsxs(cn,{"aria-label":"Choose an available image",value:z.images.some(G=>G.reference===u.image)?u.image:"",onChange:G=>H({image:G.target.value}),className:"w-full text-xs",children:[s.jsx("option",{value:"",disabled:!0,children:"Choose an available image"}),z.images.map(G=>s.jsx("option",{value:G.reference,children:G.reference},G.reference))]})]}),s.jsx(N3,{autoPrepare:!0,preparationContext:"template",value:u.setups,onChange:G=>H({setups:G})}),s.jsx(XQ,{starts:X,recipe:u,custom:b,setCustom:v,patch:H}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsxs("button",{type:"button","aria-expanded":x,onClick:()=>p(G=>!G),className:"flex items-center gap-1.5 rounded text-xs font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(ko,{className:`size-3.5 transition-transform ${x?"":"-rotate-90"}`}),"Advanced"]}),x&&s.jsxs(So,{duration:.15,offset:0,blur:"0px",className:"mt-5 space-y-6",children:[U&&s.jsxs("div",{className:"grid gap-6",children:[s.jsx(Go,{label:"Operating system",htmlFor:"template-base",children:s.jsx(cn,{id:"template-base",value:u.base,onChange:G=>H({base:G.target.value}),className:"w-full text-xs",children:Aw.map(G=>s.jsx("option",{value:G.id,children:G.name},G.id))})}),s.jsx(WQ,{packages:u.packages,onChange:G=>H({packages:G})})]}),U&&s.jsx(Go,{label:"Setup commands",htmlFor:"template-setup",hint:`Run with bash in ${u.repository?"/sandbox/project":"/sandbox"} as the sandbox user, at build time. A failing command stops the build.`,children:s.jsx(Df,{id:"template-setup",value:u.setup,onChange:G=>H({setup:G.target.value}),rows:5,placeholder:u.runtimes.includes("python")?"pip install -r requirements.txt":"npm ci",className:"font-mono text-xs",spellCheck:!1})}),s.jsxs(Go,{label:"Environment variables",hint:"Non-secret values, stored in the OpenShell template. Attach credentials through Secrets when you launch.",children:[u.environment.map((G,se)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ot,{"aria-label":`Variable ${se+1} name`,className:"min-w-0 flex-1 font-mono text-xs",value:G.name,onChange:ee=>H({environment:u.environment.map((ne,ie)=>se===ie?{...ne,name:ee.target.value}:ne)}),placeholder:"NODE_ENV"}),s.jsx(Ot,{"aria-label":`Variable ${se+1} value`,className:"min-w-0 flex-1 font-mono text-xs",value:G.value,onChange:ee=>H({environment:u.environment.map((ne,ie)=>se===ie?{...ne,value:ee.target.value}:ne)}),placeholder:"development"}),s.jsx(ce,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove variable ${se+1}`,onClick:()=>H({environment:u.environment.filter((ee,ne)=>ne!==se)}),children:s.jsx(Gn,{})})]},se)),s.jsxs(ce,{type:"button",variant:"outline",size:"sm",className:"justify-self-start",disabled:u.environment.length>=40,onClick:()=>H({environment:[...u.environment,{name:"",value:""}]}),children:[s.jsx(ds,{}),"Add variable"]})]}),U&&s.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>Y(!0),children:[s.jsx(RR,{}),"View Dockerfile"]})]})]}),s.jsxs("div",{className:"flex gap-3 rounded-lg border bg-muted/30 p-3",children:[s.jsx(Gl,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),s.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:"Software only. Network, file and credential access come from the policy you pick at launch, plus the selected agents' own sign-in and model destinations."})]}),N&&s.jsx("p",{role:"alert",className:"whitespace-pre-wrap rounded-md border border-red-200 bg-red-50/60 p-3 text-xs text-red-700",children:N})]})}),M&&s.jsx("p",{role:"status",className:"border-t px-5 py-3 text-xs text-muted-foreground sm:px-6",children:M}),s.jsxs("footer",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t bg-card px-5 py-3 sm:px-6",children:[h&&s.jsxs("p",{className:"mr-auto flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[s.jsx(ru,{className:"size-3.5 shrink-0"}),U?"Rebuilding replaces this template.":"Saving replaces this template."," Sandboxes already running from it keep their current image."]}),s.jsx(ce,{type:"button",variant:"ghost",disabled:E&&!O,onClick:()=>{var G;return O?(G=R.current)==null?void 0:G.abort():$()},children:O?"Cancel preparation":"Cancel"}),s.jsxs(ce,{type:"submit",className:qQ,disabled:E||(c==null?void 0:c.connected)===!1,children:[E?s.jsx(zt,{}):s.jsx(Yv,{}),O?"Preparing MCPs…":U?h?"Rebuild template":"Build template":"Save template"]})]}),s.jsx(vn,{open:L,onOpenChange:Y,children:s.jsxs(wn,{className:"max-h-[85svh] overflow-y-auto sm:max-w-2xl",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"Generated Dockerfile"}),s.jsx(_n,{children:"Setup commands are added as a separate build-context file."})]}),s.jsx("pre",{className:"overflow-x-auto rounded-md border bg-muted/30 p-4 font-mono text-[11px] leading-relaxed",children:U?zv(u):""}),s.jsxs(ce,{type:"button",variant:"outline",onClick:I,children:[s.jsx(Yc,{}),"Download Dockerfile"]})]})}),s.jsx(vn,{open:P,onOpenChange:V,children:s.jsxs(wn,{children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"Discard this template?"}),s.jsx(_n,{children:"Your changes haven’t been built yet."})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:()=>V(!1),children:"Keep editing"}),s.jsx(ce,{type:"button",variant:"destructive",onClick:r,children:"Discard"})]})]})})]})})})}function XQ({starts:e,recipe:t,custom:r,setCustom:a,patch:l}){const c=Xg(t),u=c?Lp.filter(f=>f.id===""):e;return s.jsxs(Go,{label:"Starts in",hint:c?"Multiple agents are installed. Start in Shell to run any of them.":r?"Runs through /bin/bash as the sandbox’s main process.":"Opens as a session you connect to. Exiting it keeps the sandbox running.",children:[s.jsxs("div",{role:"group","aria-label":"Starts in",className:"grid grid-cols-1 gap-2 min-[400px]:grid-cols-2 sm:grid-cols-3",children:[u.map(f=>{const h=ls.find(m=>m.command===f.id);return s.jsxs(Bd,{disabled:c,selected:c||!r&&t.command===f.id,onClick:()=>{a(!1),l({command:f.id})},children:[h?s.jsx("img",{src:h.logo,alt:"",className:"size-4 object-contain"}):s.jsx(Wv,{"aria-hidden":"true",className:"size-4"}),s.jsx("span",{children:f.name})]},f.id)}),!c&&s.jsxs(Bd,{selected:r,onClick:()=>{r||(a(!0),l({command:""}))},children:[s.jsx(RR,{"aria-hidden":"true",className:"size-4"}),s.jsx("span",{children:"Custom"})]})]}),!c&&r&&s.jsx(Ot,{"aria-label":"Start command",value:t.command,onChange:f=>l({command:f.target.value}),placeholder:"npm run dev",className:"font-mono text-xs"})]})}function WQ({packages:e,onChange:t}){const[r,a]=g.useState(""),l=g.useRef(null);function c(){const u=YT(r);u.length&&t([...new Set([...e,...u])]),a("")}return s.jsx(Go,{label:"System packages",htmlFor:"template-packages",hint:"Type a package and press Enter or Add. Paste multiple names separated by spaces, commas or new lines.",children:s.jsxs("div",{className:"rounded-lg border bg-card p-3",children:[e.length>0&&s.jsx("ul",{"aria-label":"System packages",className:"mb-3 flex flex-wrap gap-1.5",children:e.map(u=>s.jsxs("li",{className:"inline-flex max-w-full items-center gap-1 rounded-md border bg-muted/40 py-1 pl-2 pr-1",children:[s.jsx("span",{className:"min-w-0 break-all font-mono text-[11px]",children:u}),s.jsx("button",{type:"button","aria-label":`Remove package ${u}`,onClick:()=>t(e.filter(f=>f!==u)),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(En,{className:"size-3"})})]},u))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ot,{ref:l,id:"template-packages",value:r,onChange:u=>a(u.target.value),onBlur:c,onKeyDown:u=>{u.key==="Enter"&&!u.nativeEvent.isComposing&&(u.preventDefault(),c())},onPaste:u=>{const f=u.clipboardData.getData("text");if(/[\s,]/.test(f)){u.preventDefault();const h=u.currentTarget,m=r.slice(0,h.selectionStart)+f+r.slice(h.selectionEnd);t([...new Set([...e,...YT(m)])]),a("")}},placeholder:"e.g. jq, unzip, build-essential",className:"min-w-0 flex-1 font-mono text-xs",autoComplete:"off",spellCheck:!1}),s.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{var u;c(),(u=l.current)==null||u.focus()},children:[s.jsx(ds,{}),"Add"]})]})]})})}function QQ({agents:e,onChange:t,error:r}){return s.jsxs("div",{className:"space-y-2 pt-2",children:[s.jsx(On,{htmlFor:"custom-agent-install",className:"text-xs",children:"Install another agent"}),s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/20 px-3 py-1 focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",children:[s.jsx(Wv,{"aria-hidden":"true",className:"mt-2 size-3.5 shrink-0 text-muted-foreground"}),s.jsx(Df,{id:"custom-agent-install",value:e.map(a=>a.install).join(`
|
|
522
|
+
`),onChange:a=>t(a.target.value.trim()?[{name:"Custom agent",install:a.target.value}]:[]),rows:1,maxLength:6e3,spellCheck:!1,autoComplete:"off",placeholder:"Paste an agent install command…",className:"min-h-8 resize-none rounded-none border-0 bg-transparent px-0 py-1.5 font-mono text-xs leading-5 focus-visible:ring-0 md:text-xs","aria-invalid":!!r})]}),r&&s.jsx("p",{role:"alert",className:"text-[11px] text-destructive",children:r})]})}const rs=e=>(e==null?void 0:e.id)??(e==null?void 0:e.context),Ey="bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",Vr=e=>e.status==="building",Ih=e=>e.status==="ready"||e.exists,ZQ=e=>Vr(e)?e.exists?"Rebuilding":"Building":e.status==="failed"?e.exists?"Rebuild failed":"Build failed":"Ready";function nR({record:e}){return s.jsxs("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-[11px]",children:[Vr(e)?s.jsx(zt,{className:"size-3 text-amber-600"}):s.jsx("span",{className:`size-1.5 rounded-full ${e.status==="failed"?"bg-amber-500":"bg-emerald-500"}`}),ZQ(e)]})}const sR=e=>{var t;return((t=Lp.find(r=>r.id===e))==null?void 0:t.name)??e};function JQ(){var Ae;const e=$t(),t=Er(),{templates:r,locations:a,error:l,refresh:c,loading:u}=ju(),[f,h]=g.useState(""),[m,x]=g.useState(""),[p,b]=g.useState(null),[v,j]=g.useState(null),S=v?cy(rs(v.location)):null,[N,C]=g.useState(null),[E,T]=g.useState(!1),[O,k]=g.useState(""),M=g.useRef(!1),[A,R]=g.useState(null),[z,_]=g.useState(null),[L,Y]=g.useState(!1),P=g.useRef(!1),[V,U]=g.useState(()=>new Set),[H,F]=g.useState([]);g.useEffect(()=>{let te=!0;return e.contextKey().then(Ee=>{te&&b(JSON.stringify([e.target,Ee]))}).catch(Ee=>He.error(Ee.message)),()=>{te=!1}},[e]),g.useEffect(()=>{if(M.current||!p)return;const te=a.find(Te=>rs(Te)===p);if(!(te!=null&&te.connected))return;M.current=!0;const Ee=KT(cy(rs(te)));Ee&&j(Te=>Te??{...Ee,location:te})},[p,a]);const q=r.find(te=>Vn(te)===N),W=te=>a.find(Ee=>rs(Ee)===rs(te.location))??te.location,B=a.length>1,J=te=>W(te).connected!==!1,X=te=>{if(!J(te))throw new Error(`${ws(W(te))} is disconnected. Reconnect before continuing.`);return qr(t!=null&&t.localViewer?W(te).target??"local":e.target,e.signal,te.location.context)},re=r.filter(te=>(!B||!m||rs(te.location)===m)&&`${te.name} ${te.image||""} ${te.recipe.repository||""}`.toLowerCase().includes(f.toLowerCase())),I=re.filter(te=>!Vr(te)&&J(te)),$=r.filter(te=>V.has(Vn(te))&&!Vr(te)&&J(te)),Q=I.filter(te=>V.has(Vn(te))).length,G=I.length>0&&Q===I.length;g.useEffect(()=>{const te=new Set(r.filter(Ee=>!Vr(Ee)&&(a.find(Te=>rs(Te)===rs(Ee.location))??Ee.location).connected!==!1).map(Vn));U(Ee=>new Set([...Ee].filter(Te=>te.has(Te))))},[r,a]);function se(te){U(Ee=>{const Te=new Set(Ee);return Te.has(te)?Te.delete(te):Te.add(te),Te})}function ee(){U(te=>{const Ee=new Set(te);for(const Te of I)G?Ee.delete(Vn(Te)):Ee.add(Vn(Te));return Ee})}async function ne(te){const Ee=[];for(const Te of te)try{const be=await X(Te).imageTemplateUsage(Te.name);be.sandboxes.length&&Ee.push({target:Te,message:"This template cannot be deleted while sandboxes use it.",sandboxes:be.sandboxes})}catch(be){Ee.push({target:Te,message:be.message})}F(Ee)}async function ie(te){if(!P.current){P.current=!0,Y(!0),F([]),C(null),R(te);try{await ne(te)}finally{P.current=!1,Y(!1)}}}async function oe(te,Ee){if(!P.current){P.current=!0,Y(!0);try{await X(te).lifecycle(Ee,"delete"),He.success(`Deleted sandbox ${Ee}`),await ne(A),await c()}catch(Te){He.error(Te.message)}finally{P.current=!1,Y(!1)}}}async function Z(){if(P.current||!(A!=null&&A.length))return;P.current=!0,Y(!0),F([]);const te=new Set,Ee=[],Te=new Map;try{for(const be of A)try{const We=await X(be).deleteImageTemplate(be.name);te.add(Vn(be));const Se=We==null?void 0:We.imageCleanup,Fe=JSON.stringify([rs(be.location),Se==null?void 0:Se.image]);(Se==null?void 0:Se.status)==="retained"?Te.set(Fe,{image:Se.image,reason:Se.reason,location:W(be)}):Se!=null&&Se.image&&Te.delete(Fe)}catch(We){Ee.push({target:be,message:We.message,sandboxes:We.sandboxes})}for(const{image:be,reason:We,location:Se}of Te.values())He.warning(We,{description:`${ws(Se)} · ${be}`,duration:1e4});U(be=>new Set([...be].filter(We=>!te.has(We)))),C(be=>te.has(be)?null:be),F(Ee),te.size&&He.success(`Deleted ${te.size} ${te.size===1?"template":"templates"}`),R(Ee.length?A.filter(be=>!te.has(Vn(be))):null),await c()}finally{P.current=!1,Y(!1)}}function de(te,Ee,Te){J(te)&&(C(null),j({recipe:Ee,replace:Te,location:W(te)}))}function ke(){const te=a.find(Te=>rs(Te)===O);if(!(te!=null&&te.connected))return;const Ee=KT(cy(rs(te)));j({...Ee??{},location:te}),T(!1)}function _e(){try{sessionStorage.removeItem(S)}catch{}j(null)}async function je(te){try{await te(),await c()}catch(Ee){He.error(Ee.message)}}return s.jsxs("div",{className:"h-[calc(100svh-3.5rem)] overflow-y-auto",children:[v&&s.jsx(Pa,{location:W(v),children:s.jsx(YQ,{initial:v,draftKey:S,onClose:_e,onStarted:te=>{C(Vn({...te,location:v.location})),_e(),c()}},JSON.stringify([rs(v.location),((Ae=v.recipe)==null?void 0:Ae.name)||"new"]))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b px-4 py-3 sm:px-6",children:[s.jsx(ra,{"aria-label":"Search image templates",value:f,onValueChange:h,placeholder:"Search…",className:"mr-auto min-w-32 flex-1 sm:max-w-60"}),B&&s.jsxs(cn,{"aria-label":"Filter template location",value:m,onChange:te=>x(te.target.value),className:"h-8 rounded-md border bg-card px-2 text-xs",children:[s.jsx("option",{value:"",children:"All locations"}),a.map(te=>s.jsxs("option",{value:rs(te),children:[ws(te),rs(te)===p?" (default)":"",te.connected===!1?" · disconnected":""]},rs(te)))]}),s.jsxs(ce,{size:"sm",className:Ey,disabled:!a.some(te=>te.connected),onClick:()=>{k(""),T(!0)},children:[s.jsx(ds,{}),"New template"]})]}),$.length>0&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b bg-accent/30 px-4 py-2 sm:px-6",children:[s.jsxs("span",{role:"status",className:"mr-auto text-xs",children:[$.length," selected",$.length>Q&&s.jsxs("span",{className:"text-muted-foreground",children:[" · ",$.length-Q," outside current filters"]})]}),s.jsx(ce,{variant:"ghost",size:"sm",disabled:L,onClick:()=>U(new Set),children:"Clear selection"}),s.jsxs(ce,{variant:"destructive",size:"sm",disabled:L,onClick:()=>ie($),children:[s.jsx(Gn,{}),"Delete selected"]})]}),l&&s.jsxs("div",{role:"alert",className:"px-4 py-4 text-xs sm:px-6",children:[s.jsx("p",{children:l}),s.jsx(ce,{variant:"outline",size:"sm",className:"mt-3",onClick:c,children:"Try again"})]}),a.filter(te=>te.connected===!1).map(te=>s.jsxs("div",{role:"status",className:"border-b bg-muted/30 px-4 py-3 text-xs text-muted-foreground sm:px-6",children:[ws(te)," is disconnected. Saved templates are shown; reconnect to use or change them.",te.error&&s.jsx("span",{className:"ml-1",children:te.error})]},rs(te))),u&&!r.length?s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 py-10 text-xs text-muted-foreground",children:[s.jsx(zt,{}),"Loading…"]}):re.length?s.jsx(So,{duration:.15,offset:0,blur:"0px",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{"aria-label":"Image templates",className:"w-full min-w-[580px] text-left",children:[s.jsx("thead",{className:"border-b text-[11px] text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-10 px-4 py-2 sm:pl-6",children:s.jsx(Pl,{"aria-label":"Select all matching templates",checked:G,indeterminate:Q>0&&!G,disabled:L||!I.length,onCheckedChange:ee})}),s.jsx("th",{className:"px-4 py-2 font-normal",children:"Name"}),B&&s.jsx("th",{className:"px-4 py-2 font-normal",children:"Location"}),s.jsx("th",{className:"px-4 py-2 font-normal",children:"Starts in"}),s.jsx("th",{className:"px-4 py-2 font-normal",children:"Image"}),s.jsx("th",{className:"px-4 py-2 font-normal",children:"Status"}),s.jsx("th",{className:"px-4 py-2",children:s.jsx("span",{className:"sr-only",children:"Actions"})})]})}),s.jsx("tbody",{className:"divide-y",children:re.map(te=>s.jsxs("tr",{className:V.has(Vn(te))?"bg-accent/40 hover:bg-muted/40":"hover:bg-muted/40",children:[s.jsx("td",{className:"px-4 py-2 sm:pl-6",children:s.jsx(Pl,{"aria-label":`Select ${te.name} in ${ws(W(te))}`,checked:V.has(Vn(te)),disabled:L||Vr(te)||!J(te),onCheckedChange:()=>se(Vn(te))})}),s.jsx("td",{className:"max-w-72 px-4 py-2",children:s.jsxs("button",{className:"group flex max-w-full items-center gap-2 rounded text-left font-mono text-xs font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>C(Vn(te)),children:[s.jsx("span",{"aria-hidden":"true",className:"flex size-7 shrink-0 items-center justify-center rounded-lg border bg-muted/40 text-muted-foreground",children:s.jsx(AR,{className:"size-4",strokeWidth:1.5})}),s.jsx("span",{className:"truncate group-hover:underline",children:te.name})]})}),B&&s.jsx("td",{className:"px-4 py-2",children:s.jsx(z3,{location:W(te)})}),s.jsx("td",{className:"px-4 py-2 text-[11px] text-muted-foreground",children:te.managed===!1?"-":sR(te.recipe.command)}),s.jsx("td",{className:"px-4 py-2",children:s.jsx("span",{className:"block max-w-64 truncate font-mono text-[11px] text-muted-foreground",title:te.image||"",children:te.image||(te.recipe.source==="image"?te.recipe.image:"Not built yet")})}),s.jsx("td",{className:"px-4 py-2",children:s.jsx(nR,{record:te})}),s.jsx("td",{className:"px-4 py-2 text-right sm:pr-6",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[!Vr(te)&&(te.status==="failed"||te.status==="ready"&&te.managed)&&s.jsxs(ce,{variant:"ghost",size:"xs",disabled:!J(te),"aria-label":`Edit ${te.name} in ${ws(W(te))}`,onClick:()=>de(te,te.recipe,te.status==="ready"||!!te.exists),children:[s.jsx(dC,{}),"Edit"]}),s.jsxs(ce,{variant:"ghost",size:"xs",disabled:Ih(te)&&!J(te),onClick:()=>Ih(te)?_(te):C(Vn(te)),children:[Ih(te)?"Use template":Vr(te)?"View progress":"Details",s.jsx(_h,{})]}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${te.name} in ${ws(W(te))}`,title:Vr(te)?"Cancel the build before deleting this template":`Delete ${te.name}`,disabled:L||Vr(te)||!J(te),onClick:()=>ie([te]),children:s.jsx(Gn,{})})]})})]},Vn(te)))})]})})}):s.jsxs("div",{className:"py-12 text-center text-xs text-muted-foreground",children:[s.jsx("p",{children:r.length?"No matching templates.":"No image templates yet."}),f&&s.jsx(ce,{variant:"ghost",size:"sm",className:"mt-2",onClick:()=>h(""),children:"Clear search"})]}),s.jsx(vn,{open:!!q,onOpenChange:te=>{te||C(null)},children:s.jsx(wn,{className:"max-h-[85svh] overflow-y-auto sm:max-w-2xl",children:q&&s.jsxs(s.Fragment,{children:[s.jsxs(jn,{children:[s.jsx(bn,{className:"font-mono",children:q.name}),s.jsx(_n,{children:q.managed===!1?"Created outside the console. Edit it with the openshell CLI.":"OpenShell sandbox template"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Co,{location:W(q)}),s.jsx(nR,{record:q})]}),!J(q)&&s.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"This location is disconnected. Reconnect to use or change this template."}),s.jsx("dl",{className:"divide-y rounded-lg border px-4 text-xs",children:[["Image",s.jsx("span",{className:"break-all font-mono",children:q.image||(q.recipe.source==="image"?q.recipe.image:"Not built yet")},"i")],...q.managed===!1?[]:[["Starts in",sR(q.recipe.command)]],...q.recipe.source==="build"&&q.managed!==!1?[["Agents",[...q.recipe.agents.map(te=>{var Ee;return(Ee=ls.find(Te=>Te.id===te))==null?void 0:Ee.name}),...(q.recipe.customAgents??[]).map(te=>te.name)].join(", ")||"None"],["Repository",q.recipe.repository?s.jsx("span",{className:"break-all font-mono",children:q.recipe.repository},"r"):"None"]]:[],["Environment",q.recipe.environment.length?s.jsx("span",{className:"font-mono",children:q.recipe.environment.map(te=>te.name).join(", ")},"e"):"None"],["CLI",s.jsxs("code",{className:"font-mono",children:["openshell sandbox create --template ",q.name]},"c")]].map(([te,Ee])=>s.jsxs("div",{className:"flex gap-4 py-2",children:[s.jsx("dt",{className:"w-24 shrink-0 text-muted-foreground",children:te}),s.jsx("dd",{className:"min-w-0",children:Ee})]},te))}),q.error&&s.jsx("p",{role:"alert",className:"whitespace-pre-wrap rounded-md border border-amber-200 bg-amber-50/50 p-3 text-xs text-amber-800",children:q.error}),q.logs&&s.jsxs("details",{open:Vr(q)||q.status==="failed",className:"overflow-hidden rounded-lg border",children:[s.jsx("summary",{className:"cursor-pointer bg-muted/35 px-3 py-2 text-xs",children:"Build log"}),s.jsx("pre",{"aria-label":"Build log",className:"max-h-64 overflow-auto whitespace-pre-wrap break-all bg-card p-4 font-mono text-[10px] leading-relaxed",children:q.logs})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2 border-t pt-4",children:Vr(q)?s.jsxs(ce,{variant:"outline",disabled:!J(q),onClick:()=>je(()=>X(q).cancelImageBuild(q.name)),children:[s.jsx(En,{}),"Cancel build"]}):s.jsxs(s.Fragment,{children:[q.status==="failed"&&s.jsxs(ce,{variant:"outline",size:"sm",disabled:!J(q),onClick:()=>de(q,q.recipe,!!q.exists),children:[s.jsx(XI,{}),"Edit and retry"]}),q.status==="failed"&&q.exists&&s.jsx(ce,{variant:"ghost",size:"sm",disabled:!J(q),onClick:()=>je(()=>X(q).dismissImageBuild(q.name)),children:"Dismiss"}),q.status==="ready"&&q.managed&&s.jsxs(ce,{variant:"ghost",size:"sm",disabled:!J(q),onClick:()=>de(q,q.recipe,!0),children:[s.jsx(dC,{}),"Edit"]}),q.managed!==!1&&s.jsxs(ce,{variant:"ghost",size:"sm",disabled:!J(q),onClick:()=>de(q,{...q.recipe,name:`${q.name.slice(0,14)}-copy`},!1),children:[s.jsx(Zp,{}),"Duplicate"]}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Delete image template",disabled:L||!J(q),onClick:()=>ie([q]),children:s.jsx(Gn,{})}),Ih(q)&&s.jsxs(ce,{className:`ml-auto ${Ey}`,disabled:!J(q),onClick:()=>{_(q),C(null)},children:["Use template",s.jsx(_h,{})]})]})})]})})}),s.jsx(vn,{open:!!A,onOpenChange:te=>{!te&&!P.current&&R(null)},children:s.jsxs(wn,{className:"max-h-[85svh] overflow-y-auto",children:[s.jsxs(jn,{children:[s.jsxs(bn,{children:["Delete ",(A==null?void 0:A.length)===1?"this template":`${(A==null?void 0:A.length)??0} templates`,"?"]}),s.jsx(_n,{children:"The selected templates and their unused Docker images will be deleted in their owning locations. Templates used by existing sandboxes cannot be deleted. Images shared with other templates are kept."})]}),s.jsx("ul",{className:"max-h-40 overflow-y-auto text-xs",children:A==null?void 0:A.map(te=>s.jsxs("li",{className:"flex items-center gap-2 break-all py-1",children:[s.jsx("span",{className:"font-mono",children:te.name}),s.jsx(Co,{location:W(te)})]},Vn(te)))}),H.length>0&&s.jsxs("div",{role:"alert",className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-xs",children:[s.jsxs("p",{children:["Cannot delete ",(A==null?void 0:A.length)===1?"this template":"these templates","."]}),s.jsx("ul",{className:"mt-2 space-y-3",children:H.map(te=>{var Ee;return s.jsxs("li",{children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-mono",children:te.target.name})," ",s.jsx(Co,{location:W(te.target)}),": ",te.message]}),((Ee=te.sandboxes)==null?void 0:Ee.length)>0&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"mt-1 text-muted-foreground",children:"Delete the sandboxes below, then retry. Deleting a sandbox permanently removes its files."}),s.jsx("ul",{className:"mt-2 space-y-2",children:te.sandboxes.map(Te=>s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsx("span",{className:"break-all font-mono",children:Te.name}),s.jsxs(ce,{variant:"destructive",size:"sm",disabled:L||!J(te.target),"aria-label":`Delete sandbox ${Te.name} in ${ws(W(te.target))}`,onClick:()=>oe(te.target,Te.name),children:[s.jsx(Gn,{}),"Delete sandbox"]})]},Vn({...Te,location:te.target.location})))})]})]},Vn(te.target))})})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ce,{variant:"ghost",disabled:L,onClick:()=>R(null),children:"Cancel"}),s.jsxs(ce,{variant:"destructive",disabled:L||!(A!=null&&A.some(J)),onClick:Z,children:[L&&s.jsx(zt,{}),L?"Deleting…":H.length?"Retry deletion":(A==null?void 0:A.length)===1?"Delete template":"Delete templates"]})]})]})}),s.jsx(vn,{open:E,onOpenChange:T,children:s.jsxs(wn,{children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"New template"}),s.jsx(_n,{children:"Choose where to build and save this template. Its images and saved Setups belong to that location."})]}),s.jsxs("label",{className:"space-y-2 text-xs",children:[s.jsx("span",{className:"block font-medium",children:"Location"}),s.jsxs(cn,{"aria-label":"New template location",value:O,onChange:te=>k(te.target.value),className:"h-9 w-full rounded-md border bg-card px-3",children:[s.jsx("option",{value:"",disabled:!0,children:"Choose a location…"}),a.map(te=>s.jsxs("option",{value:rs(te),disabled:!te.connected,children:[ws(te),te.connected===!1?" · disconnected":""]},rs(te)))]})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ce,{variant:"ghost",onClick:()=>T(!1),children:"Cancel"}),s.jsxs(ce,{className:Ey,disabled:!a.some(te=>rs(te)===O&&te.connected),onClick:ke,children:["Continue",s.jsx(_h,{})]})]})]})}),z&&s.jsx(Pa,{location:W(z),children:s.jsx(G3,{open:!0,initialImageTemplate:z,onOpenChange:te=>{te||_(null)},onStarted:()=>_(null)})})]})}const n4=g.createContext(void 0);function eZ(){const e=g.useContext(n4);if(e===void 0)throw new Error(Zt(63));return e}const tZ="data-checked",nZ="data-unchecked",s4={...og,checked(e){return e?{[tZ]:""}:{[nZ]:""}}},sZ=g.forwardRef(function(t,r){const{checked:a,className:l,defaultChecked:c,"aria-labelledby":u,form:f,id:h,inputRef:m,name:x,nativeButton:p=!1,onCheckedChange:b,readOnly:v=!1,required:j=!1,disabled:S=!1,render:N,uncheckedValue:C,value:E,style:T,...O}=t,{clearErrors:k}=ag(),{state:M,setTouched:A,setDirty:R,validityData:z,setFilled:_,setFocused:L,validationMode:Y,disabled:P,name:V,validation:U}=gu(),{labelId:H}=af(),F=P||S,q=V??x,W=g.useRef(null),B=Yr(W,m,U.inputRef),J=g.useRef(null),X=ms(),re=lf({id:h}),I=p?void 0:re,[$,Q]=Wr({controlled:a,default:!!c,name:"Switch",state:"checked"});pg(J,X,$,void 0,!F,x),qe(()=>{_($)},[$,_]),ff($,()=>{k(q),R($!==z.initialValue),U.change($)});const{getButtonProps:G,buttonRef:se}=oo({disabled:F,native:p}),ee=lA(u,H,W,!p,I),ne={id:p?re:X,role:"switch","aria-checked":$,"aria-readonly":v||void 0,"aria-required":j||void 0,"aria-labelledby":ee,onFocus(){F||L(!0)},onBlur(){const de=W.current;!de||F||(A(!0),L(!1),Y==="onBlur"&&U.commit(de.checked))},onClick(de){if(v||F)return;de.preventDefault();const ke=W.current;ke&&Kc(ke,de)}},ie={...U.getValidationProps(F),checked:$,disabled:F,form:f,id:I,name:q,required:j,style:q?b1:yg,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:B,onChange(de){if(de.nativeEvent.defaultPrevented)return;if(v){de.preventDefault();return}const ke=de.currentTarget.checked,_e=bt(Tr,de.nativeEvent);b==null||b(ke,_e),!_e.isCanceled&&Q(ke)},onClick(de){de.stopPropagation()},onFocus(){var de;(de=J.current)==null||de.focus()},...E!==void 0?{value:E}:gn},oe=g.useMemo(()=>({...M,checked:$,disabled:F,readOnly:v,required:j}),[M,$,F,v,j]),Z=Nt("span",t,{state:oe,ref:[r,J,se],props:[ne,O,G,de=>U.getValidationProps(F,de)],stateAttributesMapping:s4});return s.jsxs(n4.Provider,{value:oe,children:[Z,!$&&q&&C!==void 0&&s.jsx("input",{type:"hidden",form:f,name:q,value:C,disabled:F}),s.jsx("input",{...ie,suppressHydrationWarning:!0})]})}),rZ=g.forwardRef(function(t,r){const{render:a,className:l,style:c,...u}=t,f=eZ();return Nt("span",t,{state:f,ref:r,stateAttributesMapping:s4,props:u})});function oZ({className:e,...t}){return s.jsx(sZ,{"data-slot":"switch",className:Le("peer relative inline-flex h-[18px] w-8 shrink-0 cursor-pointer items-center rounded-full border border-transparent outline-none transition-colors duration-200 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-[var(--connection)] data-unchecked:bg-foreground/15",e),...t,children:s.jsx(rZ,{"data-slot":"switch-thumb",className:"pointer-events-none block size-3.5 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] data-checked:translate-x-[15px] data-unchecked:translate-x-[1px]"})})}const rR={name:"",hostname:"",port:"",auth:"default",identityFile:""},aZ=[["default","SSH agent / default keys"],["identity","Key file"]];function iZ({open:e,onOpenChange:t,onAdded:r}){const[a,l]=g.useState(rR),[c,u]=g.useState(null),[f,h]=g.useState(!1),[m,x]=g.useState(null),p=g.useId();g.useEffect(()=>{e&&(l(rR),u(null),x(null),h(!1))},[e]);const b=C=>E=>{l(T=>({...T,[C]:E.target.value})),x(null)},v=a.name.trim()&&a.hostname.trim()&&(a.auth==="default"||a.identityFile.trim());async function j(C){h(!0),x(null);try{await C()}catch(E){x(E.message)}finally{h(!1)}}const S=C=>{C.preventDefault(),v&&!f&&j(async()=>u(await cs.scanSshHost(a)))},N=()=>j(async()=>{const C=await cs.addSshHost(c.token);r(C)});return s.jsx(vn,{open:e,onOpenChange:C=>{f||t(C)},children:s.jsxs(wn,{className:"sm:max-w-md","aria-describedby":void 0,children:[s.jsx(jn,{children:s.jsx(bn,{children:c?"Trust this machine?":"Add SSH connection"})}),c?s.jsxs("div",{className:"grid gap-4 text-xs",children:[s.jsxs("p",{className:"text-muted-foreground",children:["OpenRod reached ",s.jsxs("span",{className:"font-mono text-foreground",children:[c.user?`${c.user}@`:"",c.host,c.port?`:${c.port}`:""]})," and it presented these host keys. Confirm they match the server before you trust it; a mismatch could mean someone is intercepting the connection."]}),s.jsx("ul",{className:"grid gap-2",children:c.fingerprints.map(C=>s.jsxs("li",{className:"rounded-lg border border-border bg-muted/20 px-3 py-2",children:[s.jsx("span",{className:"block text-[10px] text-muted-foreground",children:C.type}),s.jsx("span",{className:"block font-mono break-all text-foreground",children:C.fingerprint})]},C.type))}),s.jsxs("p",{className:"text-muted-foreground",children:["On the server, ",s.jsx("code",{className:"rounded bg-muted px-1 font-mono text-foreground",children:"ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub"})," prints the matching fingerprint."]}),m&&s.jsx("p",{role:"alert",className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 break-words whitespace-pre-wrap text-destructive",children:m}),s.jsxs(ea,{children:[s.jsx(ce,{type:"button",variant:"ghost",disabled:f,onClick:()=>{u(null),x(null)},children:"Back"}),s.jsxs(ce,{type:"button",disabled:f,onClick:N,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[f?s.jsx(zt,{"aria-hidden":"true"}):s.jsx(Gl,{"aria-hidden":"true",className:"size-4"}),"Trust and save"]})]})]}):s.jsxs("form",{autoComplete:"off",className:"grid gap-4 text-xs",onSubmit:S,children:[s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:`${p}-name`,className:"text-xs",children:"Display name"}),s.jsx(Ot,{id:`${p}-name`,value:a.name,onChange:b("name"),maxLength:60,placeholder:"Build server",autoFocus:!0})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(On,{htmlFor:`${p}-host`,className:"text-xs",children:"Hostname"}),s.jsx(Ot,{id:`${p}-host`,value:a.hostname,onChange:b("hostname"),spellCheck:!1,autoCapitalize:"none",placeholder:"host.com or user@host.com",className:"font-mono"})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsxs(On,{htmlFor:`${p}-port`,className:"text-xs",children:["SSH port ",s.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional)"})]}),s.jsx(Ot,{id:`${p}-port`,value:a.port,onChange:b("port"),inputMode:"numeric",placeholder:"22",className:"font-mono"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx("div",{role:"radiogroup","aria-label":"Authentication",className:"inline-flex w-fit rounded-lg bg-muted p-0.5",children:aZ.map(([C,E])=>s.jsx("button",{type:"button",role:"radio","aria-checked":a.auth===C,onClick:()=>{l(T=>({...T,auth:C})),x(null)},className:`rounded-md px-3 py-1 transition-colors ${a.auth===C?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:E},C))}),a.auth==="identity"?s.jsx(Ot,{"aria-label":"Private key file",value:a.identityFile,onChange:b("identityFile"),spellCheck:!1,autoCapitalize:"none",placeholder:"~/.ssh/id_ed25519",className:"font-mono"}):s.jsx("p",{className:"text-muted-foreground",children:"Uses your SSH agent and the keys SSH tries by default. Password logins aren’t supported."})]}),m&&s.jsx("p",{role:"alert",className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 break-words whitespace-pre-wrap text-destructive",children:m}),s.jsxs(ea,{children:[s.jsx(ce,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(ce,{type:"submit",disabled:!v||f,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[f&&s.jsx(zt,{"aria-hidden":"true"}),f?"Checking…":"Continue"]})]})]})]})})}const r4={connected:{label:"Connected",dot:"bg-emerald-500"},connecting:{label:"Connecting…",dot:"bg-amber-400"},failed:{label:"Connection failed",dot:"bg-red-500"},off:{label:"Not connected",dot:"bg-stone-400 dark:bg-stone-500"}},oR=e=>r4[e]?e:"off",lZ=(e,t,r)=>`${e} ${e===1?t:r}`;function cZ({row:e,count:t}){const r=r4[e.state];return s.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx("span",{"aria-hidden":"true",className:Le("size-1.5 shrink-0 rounded-full",r.dot,e.state==="connecting"&&"motion-safe:animate-pulse")}),s.jsx("span",{children:r.label}),e.state==="connected"&&s.jsxs("span",{className:"hidden sm:inline",children:["· ",lZ(t,"sandbox","sandboxes")]})]})}function uZ({row:e,count:t,working:r,onToggle:a,onCreate:l,menu:c}){const u=e.state==="connected",f=e.label??e.name,h=e.address;return s.jsxs("li",{className:"px-4 py-2 sm:px-5",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("span",{className:"flex h-[18px] w-8 shrink-0 items-center justify-center",children:r||e.state==="connecting"?s.jsx(zt,{"aria-label":"Working",className:"size-3.5"}):s.jsx(oZ,{checked:u,"aria-label":`${u?"Disconnect from":"Connect to"} ${f}`,onCheckedChange:m=>a(e,m)})}),s.jsx("span",{"aria-hidden":"true",className:Le("flex w-6 shrink-0 justify-center transition-opacity duration-300 [&_svg]:block [&_svg]:h-[22px]",!u&&"opacity-50"),children:s.jsx(B3,{live:u})}),s.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2.5",children:[s.jsx("span",{className:"truncate text-[13px] font-medium",children:f}),h&&s.jsx("span",{className:"hidden min-w-0 truncate font-mono text-[11px] text-muted-foreground md:block",children:h})]}),s.jsx(cZ,{row:e,count:t}),s.jsxs("span",{className:"flex w-[60px] shrink-0 items-center justify-end gap-0.5",children:[u&&l&&s.jsxs(Ia,{children:[s.jsx(_a,{render:s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":`New sandbox on ${f}`,onClick:l,className:"size-7 text-muted-foreground hover:text-foreground"}),children:s.jsx(a6,{className:"size-4"})}),s.jsx(La,{children:"New sandbox"})]}),c]})]}),e.state==="failed"&&e.error&&s.jsx("p",{className:"mt-1 truncate pl-[46px] font-mono text-[11px] text-destructive",title:e.error,children:e.error})]})}function dZ({onCreateSandbox:e}){const t=ju(),[r,a]=g.useState(null),[l,c]=g.useState(null),[u,f]=g.useState(null),[h,m]=g.useState(null),[x,p]=g.useState(!1),[b,v]=g.useState(null),j=g.useCallback(async P=>{try{a(await cs.connections(P)),c(null)}catch(V){V.name!=="AbortError"&&c(V.message)}},[]);g.useEffect(()=>{const P=new AbortController;return j(P.signal),()=>P.abort()},[j]);const S=(r==null?void 0:r.active)??null,N=oR(S==null?void 0:S.status),C=N==="connected",E=g.useMemo(()=>{if(!r)return[];const P=r.hosts.map(V=>({...V,state:(S==null?void 0:S.host)===V.name?oR(S.status):"off",error:(S==null?void 0:S.host)===V.name?S.error:null}));return S&&!P.some(V=>V.name===S.host)&&P.push({name:S.host,state:N,error:S.error}),P},[r,S,N]),T=E.filter(P=>P.managed||P.name===(S==null?void 0:S.host)).sort((P,V)=>(V.state==="connected")-(P.state==="connected")||(P.label??P.name).localeCompare(V.label??V.name)),O=E.filter(P=>!T.includes(P)),k=P=>t.sandboxes.filter(V=>{var U;return((U=V.location)==null?void 0:U.remote)&&V.location.host===P.name}).length;async function M(P,V,U){f(P);try{await V(),await j(),t.refresh()}catch(H){He.error(U,{description:H.message})}finally{f(null)}}const A=(P,V)=>{V?m({host:P.name,replacing:C?S.host:void 0}):M(P.name,async()=>{await cs.disconnectRemote(),He.success(`Disconnected from ${P.label??P.name}`)},"Couldn’t disconnect")};function R(){const{kind:P,row:V}=b;v(null);const U=V.label??V.name;P==="forget"?M(V.name,async()=>{await cs.forgetRemote(),He.success(`Forgot ${U}`)},"Couldn’t forget it"):M(V.name,async()=>{(S==null?void 0:S.host)===V.name&&await cs.forgetRemote(),await cs.removeSshHost(V.name),He.success(`Deleted ${U}`)},"Couldn’t delete it")}function z(P){const V=P.name===(S==null?void 0:S.host);return!P.managed&&!V?null:s.jsxs(Af,{children:[s.jsx(Of,{render:s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":`More actions for ${P.label??P.name}`,className:"size-7 text-muted-foreground hover:text-foreground"}),children:s.jsx(oI,{className:"size-4"})}),s.jsxs(Mf,{align:"end",className:"min-w-44",children:[P.state==="connected"&&s.jsx(Gs,{onClick:()=>A(P,!1),children:"Disconnect"}),P.state!=="connected"&&P.state!=="connecting"&&s.jsx(Gs,{onClick:()=>A(P,!0),children:P.state==="failed"?"Try again":"Connect"}),V&&!P.managed&&s.jsx(Gs,{onClick:()=>v({kind:"forget",row:P}),children:"Forget"}),P.managed&&s.jsxs(s.Fragment,{children:[s.jsx(Pd,{}),s.jsxs(Gs,{variant:"destructive",disabled:P.state==="connected"||P.state==="connecting",onClick:()=>v({kind:"delete",row:P}),children:["Delete",P.state==="connected"?" (disconnect first)":""]})]})]})]})}const _=(P,V)=>s.jsx(So,{delay:.04*V,offset:4,blur:"3px",className:"contents",children:s.jsx(uZ,{row:P,count:k(P),working:u===P.name,onToggle:A,onCreate:e,menu:z(P)})},P.name),L=(b==null?void 0:b.row.label)??(b==null?void 0:b.row.name),Y="divide-y divide-border/60 overflow-hidden rounded-xl border border-border/80 bg-card";return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-[calc(100svh-3.5rem)] overflow-y-auto",children:s.jsxs("div",{className:"grid gap-8 px-4 py-5 sm:px-6",children:[l&&s.jsxs("div",{role:"alert",className:"flex items-center gap-3 text-xs text-red-600",children:[s.jsx("span",{children:l}),s.jsx(ce,{variant:"outline",size:"sm",onClick:()=>j(),children:"Retry"})]}),!r&&!l&&s.jsx("p",{role:"status",className:"py-20 text-center text-sm text-muted-foreground",children:"Reading connections…"}),r&&s.jsxs(s.Fragment,{children:[s.jsxs("section",{"aria-label":"SSH connections",className:"grid gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"text-sm font-medium",children:"SSH connections"}),s.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Added in OpenRod. One machine is connected at a time."})]}),s.jsx(ce,{variant:"ghost",size:"icon-sm","aria-label":"Refresh connections",onClick:()=>j(),className:"text-muted-foreground",children:s.jsx($a,{})}),s.jsxs(ce,{size:"sm",onClick:()=>p(!0),className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[s.jsx(ds,{className:"size-3.5"}),"Add"]})]}),T.length>0?s.jsx("ul",{className:Y,children:T.map(_)}):s.jsxs("div",{className:"rounded-xl border border-border bg-card py-14 text-center",children:[s.jsx(rf,{className:"mx-auto mb-3 size-6 text-muted-foreground",strokeWidth:1.5}),s.jsx("p",{className:"text-sm",children:"No saved connections"}),s.jsx("p",{className:"mx-auto mt-1 max-w-xs text-xs text-muted-foreground",children:"Add a server to run sandboxes on your own machine over SSH. You confirm its host key before anything is saved."}),s.jsx(ce,{variant:"outline",className:"mt-4",onClick:()=>p(!0),children:"Add connection"})]})]}),O.length>0&&s.jsxs("section",{"aria-label":"Hosts in your SSH config",className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-medium",children:"From your SSH config"}),s.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Found in ",s.jsx("span",{className:"font-mono",children:"~/.ssh/config"}),". OpenRod reads these and never edits them."]})]}),s.jsx("ul",{className:Y,children:O.map(_)})]})]})]})}),s.jsx(Qr,{open:!!b,onOpenChange:P=>{P||v(null)},children:s.jsxs(Zr,{children:[s.jsxs(Jr,{children:[s.jsxs(to,{children:[(b==null?void 0:b.kind)==="forget"?"Forget":"Delete"," ",L,"?"]}),s.jsx(no,{children:(b==null?void 0:b.kind)==="forget"?`${(b==null?void 0:b.row.state)==="connected"?"This disconnects from the machine and removes it from this page. ":"This removes it from this page. "}Sandboxes on the machine keep running, and the host stays in your SSH configuration, so you can connect again later.`:"This removes the saved connection and its trusted host keys from OpenRod. Sandboxes on the machine keep running. You can add it again later."})]}),s.jsxs(eo,{children:[s.jsx(ro,{children:"Cancel"}),s.jsx(so,{variant:"destructive",onClick:R,children:(b==null?void 0:b.kind)==="forget"?"Forget":"Delete"})]})]})}),s.jsx(iZ,{open:x,onOpenChange:p,onAdded:P=>{p(!1),He.success(`Added ${P.name}`),j(),m({host:P.alias})}}),s.jsx(vn,{open:!!h,onOpenChange:P=>{P||m(null)},children:s.jsxs(wn,{className:"sm:max-w-3xl","aria-describedby":void 0,children:[s.jsx(jn,{children:s.jsx(bn,{children:h!=null&&h.replacing?"Switch host":"Connect a remote machine"})}),h&&s.jsx(_3,{initialHost:h.host,connectedHost:h.replacing??null,onUseConnected:()=>m(null),onConnected:P=>{m(null),He.success(`Connected to ${P.host}`),j(),t.refresh()},onBack:()=>m(null)})]})})]})}const aR=({...e})=>{const{resolvedTheme:t}=hR();return s.jsx(Cq,{theme:t??"system",className:"toaster group",icons:{success:s.jsx(KP,{className:"size-4"}),info:s.jsx(ru,{className:"size-4"}),warning:s.jsx(Va,{className:"size-4"}),error:s.jsx(MR,{className:"size-4"}),loading:s.jsx(ou,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})};function fZ({children:e,user:t,logout:r}){const[a]=g.useState(()=>window.location.hash.startsWith("#local-connect=")?lP(window.location.hash)??!1:null),[l,c]=g.useState(""),u=g.useRef(null),f=a&&window.opener&&!window.opener.closed;return g.useEffect(()=>{if(!f)return;let h=!0;return u.current??(u.current=fP(a)),u.current.then(({code:m})=>{h&&window.opener.postMessage({type:"openrod-local-connected",nonce:a.nonce,code:m},a.origin)}).catch(m=>{h&&c(m.message)}),()=>{h=!1}},[a,f]),a===null?e:s.jsx("main",{className:"grid min-h-screen place-items-center px-6",children:s.jsxs("section",{className:"max-w-sm text-center",children:[s.jsx("h1",{className:"text-2xl font-semibold",children:"Finishing sign-in…"}),s.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:f?`Returning to local OpenRod as ${t.email}. This window will close automatically.`:"This sign-in request is invalid or its local OpenRod tab closed. Start again from local OpenRod."}),l&&s.jsx("p",{role:"alert",className:"mt-4 text-sm text-destructive",children:l}),(l||!f)&&s.jsx("button",{className:"mt-5 block w-full text-xs underline",onClick:r,children:"Sign out"})]})})}function mZ({children:e}){var j;const{chooseGroups:t,dialog:r,cancel:a}=Kw(),l=g.useRef(new AbortController),c=g.useMemo(()=>qr("local",l.current.signal),[]),u=g.useRef(0);g.useEffect(()=>{const S=++u.current;return()=>queueMicrotask(()=>{u.current===S&&l.current.abort()})},[]);const f=g.useRef((j=/^#cloud-return=([a-f0-9-]{36})$/.exec(window.location.hash))==null?void 0:j[1]),[h,m]=g.useState(Ko&&f.current&&window.opener?"waiting":"normal"),[x,p]=g.useState(""),b=g.useRef(!1),v=g.useRef(!1);return g.useEffect(()=>{if(h!=="waiting")return;const S=async N=>{var C;if(!(b.current||N.origin!==Na||N.source!==window.opener||((C=N.data)==null?void 0:C.type)!=="openrod-local-bundle"||N.data.nonce!==f.current)){b.current=!0,m("importing");try{if(typeof N.data.error=="string")throw Error(N.data.error);const T=(await c.inventory()).locations.find(A=>!A.remote&&A.connected);if(!T)throw Error("Connect a local gateway before importing this workspace.");const O=c.forContext(T.context),k=await t(O,"local OpenRod",l.current.signal);if(v.current)return;const M=await O.importCloud({...N.data.bundle,...k?{destinationGroups:k}:{}});if(window.opener.postMessage({type:"openrod-local-result",nonce:f.current,name:M.name},Na),v.current)return;p(N.data.warning??"Workspace copied locally. Reconnect agent credentials to continue."),window.location.href=Bp(M.name,"shell",{...T,target:"local"}),m("done")}catch(E){if(v.current||l.current.signal.aborted)return;p(E.message),m("error"),window.opener.postMessage({type:"openrod-local-result",nonce:f.current,error:E.message},Na)}}};return window.addEventListener("message",S),window.opener.postMessage({type:"openrod-local-ready",nonce:f.current},Na),()=>window.removeEventListener("message",S)},[h]),g.useEffect(()=>{if(!["waiting","importing"].includes(h))return;const S=Date.now()+35*6e4,N=setInterval(()=>{var C;((C=window.opener)!=null&&C.closed||Date.now()>S)&&(l.current.abort(),a(),p("The cloud tab closed or the copy timed out. Open the workspace to check whether a copy was created."),m("error"))},1e3);return()=>clearInterval(N)},[h]),h==="normal"||h==="done"?s.jsxs(s.Fragment,{children:[x&&s.jsx(Li,{id:"local-return",tone:h==="done"?"success":"warning",title:h==="done"?"Workspace continued locally":"Workspace copy didn’t finish",onDismiss:()=>p(""),children:x}),e]}):s.jsxs(s.Fragment,{children:[r,s.jsx("main",{className:"grid min-h-screen place-items-center px-6",children:s.jsxs("section",{className:"max-w-md text-center",children:[s.jsx("h1",{className:"text-2xl font-semibold",children:"Continuing your workspace locally…"}),s.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Keep the cloud tab open while your files are copied and your template is rebuilt for this computer."}),x&&s.jsx("p",{role:"alert",className:"mt-4 text-sm text-destructive",children:x}),s.jsx("button",{className:"mt-6 text-sm underline",onClick:()=>{l.current.abort(),a(),v.current=!0,b.current=!0,window.location.hash="",m("normal")},children:"Open local workspace"})]})})]})}function hZ(e){try{if(!e.startsWith("#handoff="))return null;const t=JSON.parse(atob(e.slice(9).replaceAll("-","+").replaceAll("_","/"))),r=new URL(t.origin);return r.origin!==t.origin||r.protocol!=="http:"||!["localhost","127.0.0.1","[::1]"].includes(r.hostname)||!/^\d{1,5}$/.test(r.port)||!/^[a-f0-9-]{36}$/.test(t.nonce)?null:{origin:r.origin,nonce:t.nonce}}catch{return null}}async function iR(e,t="GET"){const r=await fetch(`/api/cloud/${e}`,{method:t,headers:t==="POST"?{"x-openshell-console":"1"}:void 0}),a=await r.json();if(!r.ok)throw Error(a.error??"Cloud machine unavailable");return a}function pZ({children:e,logout:t}){const[r,a]=g.useState(null),[l,c]=g.useState(""),[u,f]=g.useState(null),h=g.useRef(hZ(window.location.hash)),m=g.useRef(!1);return g.useEffect(()=>{let x=!0,p;async function b(){try{const v=await iR("machine");x&&(a(v),c(v.error??""),v.status!=="ready"&&(p=setTimeout(b,5e3)))}catch(v){x&&(c(v.message),p=setTimeout(b,1e4))}}return b(),()=>{x=!1,clearTimeout(p)}},[]),g.useEffect(()=>{const x=h.current;if((r==null?void 0:r.status)!=="ready"||!x||!window.opener||m.current)return;m.current=!0,f({status:"waiting"});const p=j=>{var S;if(h.current&&!(j.source!==window.opener||j.origin!==x.origin||((S=j.data)==null?void 0:S.type)!=="openrod-cloud-result"||j.data.nonce!==x.nonce)){if(j.data.error){f({status:"error",message:j.data.error});return}f({status:"done",message:j.data.warning??"Workspace copied. Reconnect your agent credentials to continue."}),/^[a-z0-9-]{1,63}$/.test(j.data.name??"")&&(window.location.hash=`terminal/${j.data.name}?session=shell`)}};window.addEventListener("message",p),iR("handoff","POST").then(({ticket:j})=>window.opener.postMessage({type:"openrod-cloud-ready",nonce:x.nonce,ticket:j},x.origin)).catch(j=>f({status:"error",message:j.message}));const b=Date.now()+35*6e4,v=setInterval(()=>{var j;h.current&&((j=window.opener)!=null&&j.closed||Date.now()>b)&&(f({status:"error",message:"The source tab closed or the copy timed out. Open your workspace to check whether a copy was created."}),clearInterval(v))},1e3);return()=>{window.removeEventListener("message",p),clearInterval(v)}},[r==null?void 0:r.status]),(r==null?void 0:r.status)==="ready"&&(!u||u.status==="done")?s.jsxs(s.Fragment,{children:[(u==null?void 0:u.message)&&s.jsx(Li,{id:"cloud-transfer",tone:"success",title:"Workspace continued in the cloud",onDismiss:()=>f(null),children:u.message}),e]}):s.jsx("main",{className:"grid min-h-screen place-items-center px-6",children:s.jsxs("section",{className:"max-w-md text-center",children:[s.jsx("h1",{className:"text-2xl font-semibold",children:u?"Continuing your workspace…":"Preparing your private machine…"}),s.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:u?"Keep the local OpenRod tab open while your files are copied and your template is rebuilt.":"Your account has one dedicated machine. Its first start can take several minutes."}),(l||(u==null?void 0:u.message))&&s.jsx("p",{role:"alert",className:"mt-4 text-sm text-destructive",children:(u==null?void 0:u.message)??l}),u&&s.jsx("button",{onClick:()=>{h.current=null,f(null),window.location.hash=""},className:"mt-4 text-sm underline",children:"Open cloud workspace"}),s.jsx("button",{onClick:t,className:"mt-6 block w-full text-xs underline",children:"Sign out"})]})})}function gZ({open:e,onOpenChange:t}){const r=Er(),{chooseGroups:a,dialog:l}=Kw(),c=ju(),u=c.sandboxes.filter(T=>{var O,k,M;return T.phase==="ready"&&((O=T.location)==null?void 0:O.target)!=="cloud"&&!((k=T.location)!=null&&k.remote)&&((M=T.location)==null?void 0:M.connected)}),[f,h]=g.useState("new"),[m,x]=g.useState(""),[p,b]=g.useState(!1),[v,j]=g.useState(""),[S,N]=g.useState(""),C=g.useRef(null);g.useEffect(()=>()=>{var T;return(T=C.current)==null?void 0:T.abort()},[]),g.useEffect(()=>{e&&(j(""),x(""))},[e]);async function E(){if(p||!Ko)return;const T=u.find(k=>Vn(k)===m);if(f==="copy"&&!T){j("Choose a connected local sandbox.");return}const O=new AbortController;C.current=O,b(!0),j(""),N("signin");try{if(await r.connect(),O.signal.throwIfAborted(),f==="copy"){N("prepare"),await wR(()=>su("machine"),{signal:O.signal}),N("transfer");const k=qr("cloud",O.signal);N("groups");const M=await a(k,"cloud",O.signal);N("transfer");const A=await jR(qr("local",O.signal,T.location.context),k,T.name,M),R=await k.contextKey();O.signal.throwIfAborted();try{sessionStorage.setItem("gateway-box",JSON.stringify({name:A.name,context:R,target:"cloud"}))}catch{}c.refresh(),He.success("Workspace ready in cloud",{description:A.warning||"Reconnect your agent credentials to continue."})}r.requestCreate(f==="new"),t(!1),r.selectTarget("cloud")}catch(k){j(k.name==="AbortError"?"Cloud preparation cancelled.":k.message)}finally{b(!1),N(""),C.current=null}}return s.jsx(vn,{open:e,onOpenChange:T=>{p||t(T)},children:s.jsxs(wn,{className:"sm:max-w-md",children:[s.jsxs(jn,{children:[s.jsx(bn,{children:"Build in cloud"}),s.jsx(_n,{children:"Keep using local OpenRod, your terminal and editor with your private cloud machine."})]}),s.jsx("div",{className:"space-y-2",children:[["new","New cloud sandbox"],["existing","Open an existing cloud sandbox"],["copy","Continue an existing local sandbox"]].map(([T,O])=>s.jsxs("label",{className:"flex items-center gap-3 rounded-lg border p-3 text-sm",children:[s.jsx("input",{type:"radio",name:"cloud-start",disabled:p,checked:f===T,onChange:()=>h(T)}),O]},T))}),f==="copy"&&s.jsxs(s.Fragment,{children:[s.jsxs(cn,{"aria-label":"Local sandbox to copy",value:m,disabled:p,onChange:T=>x(T.target.value),className:"rounded-md border bg-background p-2 text-sm",children:[s.jsx("option",{value:"",children:"Choose a local sandbox"}),u.map(T=>s.jsxs("option",{value:Vn(T),children:[T.name," · ",ws(T.location)]},Vn(T)))]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Copies workspace files and rebuilds saved templates. Your local source stays available. Credential files are excluded; reconnect agents in cloud."})]}),v&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v}),!Ko&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:qc}),s.jsxs(ce,{disabled:p||!Ko||f==="copy"&&!m,onClick:E,children:[p&&s.jsx(zt,{}),p?S==="signin"?"Sign in with Google…":S==="groups"?"Choose destination group…":S==="transfer"?"Copying and rebuilding…":"Preparing cloud machine…":"Keep using local OpenRod"]}),p&&S==="prepare"&&s.jsx(ce,{variant:"ghost",onClick:()=>{var T;return(T=C.current)==null?void 0:T.abort()},children:"Cancel preparation"}),p&&r.connecting&&s.jsx(ce,{variant:"ghost",onClick:r.cancelConnect,children:"Cancel sign-in"}),Na,l]})})}async function Ry(e,t){const r=await fetch(`/api/auth/${e}`,{method:t===void 0?"GET":"POST",headers:t===void 0?void 0:{"content-type":"application/json","x-openshell-console":"1"},body:t===void 0?void 0:JSON.stringify(t)}),a=await r.json();if(a.code===ki&&window.dispatchEvent(new Event(ki)),!r.ok)throw Object.assign(new Error(a.error??"Sign-in unavailable"),{code:a.code});return a}const xZ=()=>{var e;return((e=Er())==null?void 0:e.target)==="cloud"};function bZ(){var a,l;const e=Er(),[t,r]=g.useState(!1);return e!=null&&e.localViewer?Ko?s.jsxs("div",{className:"ml-auto flex items-center gap-3 text-xs",children:[s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Compute"}),s.jsxs("select",{"aria-label":"Compute target",className:"rounded-md border bg-background px-2 py-1.5 text-foreground",value:e.target,onChange:c=>c.target.value==="cloud"&&!e.connected?r(!0):e.selectTarget(c.target.value),children:[s.jsx("option",{value:"local",children:"Local"}),s.jsx("option",{value:"cloud",children:"Cloud"})]})]}),e.connected&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"hidden max-w-40 truncate text-muted-foreground sm:block",children:(l=e.user)==null?void 0:l.email}),s.jsx("button",{className:"underline underline-offset-4",onClick:e.disconnect,children:"Sign out"})]}),!e.connected&&s.jsx("button",{disabled:e.connecting,onClick:()=>e.connect().catch(c=>He.error("Couldn’t sign in",{description:c.message})),className:_y({size:"sm",variant:"outline"}),children:e.connecting?"Signing in…":"Sign in"}),s.jsxs("button",{onClick:()=>r(!0),className:_y({size:"sm",className:"gap-2"}),children:[s.jsx(ZP,{"aria-hidden":"true"}),"Build in cloud"]}),s.jsx(gZ,{open:t,onOpenChange:r})]}):null:s.jsxs("div",{className:"ml-auto flex items-center gap-3 text-xs",children:[s.jsx("span",{className:"max-w-40 truncate text-muted-foreground",children:(a=e==null?void 0:e.user)==null?void 0:a.email}),s.jsx("button",{className:"underline underline-offset-4",onClick:e==null?void 0:e.logout,children:"Sign out"})]})}function yZ({children:e}){const[t,r]=g.useState(null),[a,l]=g.useState(null),[c,u]=g.useState(!0),[f,h]=g.useState(!1),[m,x]=g.useState(""),[p,b]=g.useState(!1);g.useEffect(()=>{let S=!0;async function N(){try{const T=await Ry("config");if(!["local","cloud"].includes(T.mode))throw Error("Invalid console configuration");if(!S)return;if(r(T),T.mode==="cloud"){const O=await fetch("/api/auth/me");if(O.ok){const k=await O.json();S&&l(k.user)}else if(O.status!==401){const k=await O.json();throw Error(k.error??"Authentication unavailable")}}}catch(T){S&&x(T.message)}finally{S&&u(!1)}}N();const C=()=>{l(null),x("Your session expired. Sign in again.")},E=()=>b(!0);return window.addEventListener("openrod-session-expired",C),window.addEventListener(ki,E),()=>{S=!1,window.removeEventListener("openrod-session-expired",C),window.removeEventListener(ki,E)}},[]);async function v(){h(!0),x("");let S,N;try{const{initializeApp:C,getApps:E}=await Ay(async()=>{const{initializeApp:k,getApps:M}=await import("./index.esm-CXAOoF3i.js");return{initializeApp:k,getApps:M}},__vite__mapDeps([0,1]));N=await Ay(()=>import("./index.esm-D0s8MSqt.js"),__vite__mapDeps([2,1])),S=N.getAuth(E()[0]??C(t.firebase)),await N.setPersistence(S,N.inMemoryPersistence);const T=await N.signInWithPopup(S,new N.GoogleAuthProvider),O=await Ry("session",{idToken:await T.user.getIdToken()});l(O.user??null)}catch(C){x(C.message)}finally{S&&await N.signOut(S).catch(()=>{}),h(!1)}}async function j(){try{await Ry("logout",{})}catch(S){x(S.message)}finally{l(null)}}return p?s.jsx("main",{className:"grid min-h-screen place-items-center bg-background px-6",children:s.jsxs("section",{className:"w-full max-w-md rounded-xl border border-border bg-card p-8 text-center shadow-sm",children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Open the console link"}),s.jsxs("p",{className:"mt-3 text-sm text-muted-foreground",children:["Open the link printed by ",s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:"openrod"})," in your terminal. It carries a secret that changes every time the console starts, so open the new link after a restart."]})]})}):c?s.jsx("div",{className:"grid min-h-screen place-items-center text-sm text-muted-foreground",children:"Loading OpenRod…"}):(t==null?void 0:t.mode)==="local"?s.jsx(xP,{children:s.jsx(mZ,{children:e})}):a?s.jsx(fZ,{user:a,logout:j,children:s.jsx(pP,{user:a,logout:j,children:s.jsx(pZ,{logout:j,children:e},a.uid)})}):s.jsx("main",{className:"grid min-h-screen place-items-center bg-background px-6",children:s.jsxs("section",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-8 text-center shadow-sm",children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:window.location.hash.startsWith("#local-connect=")?"Sign in to OpenRod":"Your workspace, in the cloud."}),s.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:window.location.hash.startsWith("#local-connect=")?"Sign in with Google. You’ll return to local OpenRod automatically.":"Sign in or create your account with Google. Your workspace runs on your own private machine."}),m&&s.jsx("p",{role:"alert",className:"mt-4 text-sm text-destructive",children:m}),s.jsx("button",{disabled:f||!t,onClick:v,className:"mt-6 w-full rounded-lg bg-primary px-4 py-3 text-sm font-medium text-primary-foreground disabled:opacity-50",children:f?"Signing in…":"Continue with Google"}),s.jsx("p",{className:"mt-5 text-xs text-muted-foreground",children:"Running OpenRod locally? No account required."})]})})}const vZ=g.lazy(()=>Ay(()=>import("./terminal-view-CkPFNoXi.js"),__vite__mapDeps([3,4])).then(e=>({default:e.TerminalView}))),$v={sandboxes:"Sandboxes",activity:"Activity",groups:"Groups",egress:"Network",ingress:"Network",secrets:"Secrets",templates:"Templates",setups:"MCPs & Skills",connections:"Connections"};class wZ extends g.Component{constructor(){super(...arguments);tn(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidUpdate(r){r.view!==this.props.view&&this.state.error&&this.setState({error:null})}render(){return this.state.error?s.jsxs("div",{role:"alert",className:"mx-auto mt-10 max-w-md rounded-lg border border-border p-5 text-center text-sm",children:[s.jsx("p",{children:"This page hit an error."}),s.jsx("p",{className:"mt-1 font-mono text-[11px] text-muted-foreground",children:this.state.error.message}),s.jsx("button",{className:"mt-3 text-xs underline underline-offset-2",onClick:()=>this.setState({error:null}),children:"Try again"})]}):this.props.children}}function lR(){const e=new URLSearchParams(window.location.hash.split("?")[1]??""),t=e.get("gateway"),r=e.get("workspace");if(!t||!r)return null;const a=e.get("remote")==="1",l=e.get("target")??new URLSearchParams(window.location.search).get("target")??void 0;return{id:JSON.stringify([l??"local",JSON.stringify([t,r])]),context:JSON.stringify([t,r]),gateway:t,workspace:r,connected:!0,remote:a,target:l,cloud:l==="cloud",label:e.get("label")||(a?`SSH · ${t}`:"Local")}}function jZ({location:e,children:t}){return e?s.jsx(Pa,{location:e,children:s.jsx(Uw,{children:t})}):t}function cR(){const e=/^#terminal\/([a-z0-9-]{1,63})(?:\?(.*))?$/.exec(window.location.hash);if(!e)return null;const t=new URLSearchParams(e[2]??""),r=t.get("gateway"),a=t.get("workspace"),l=r&&a?{context:JSON.stringify([r,a]),gateway:r,workspace:a,connected:!0,remote:t.get("remote")==="1",target:new URLSearchParams(window.location.search).get("target")??void 0}:null;return{name:e[1],session:t.get("session")||void 0,setupLogin:t.get("setupLogin")||void 0,mcp:t.get("mcp")||void 0,location:l}}function uR(){const e=window.location.hash.slice(1).split("?")[0];return e==="policies"?(window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}#egress`),"egress"):e==="guardrails"?(window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}#activity`),"activity"):$v[e]?e:"sandboxes"}function SZ({onSetup:e,children:t}){const{connection:r,overview:a}=qa();return e?r==="connecting"&&!a?s.jsx("section",{className:"p-8",children:s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Reading connection settings…"})}):r!=="setup-required"?t:s.jsxs("section",{"aria-labelledby":"setup-heading",className:"mx-auto my-16 grid w-full max-w-md justify-items-center gap-4 px-6 text-center",children:[s.jsx("h2",{id:"setup-heading",className:"text-xl font-semibold tracking-tight",children:"No sandbox location yet"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Create a sandbox on this computer or on your own server. You’ll choose where in the first step."}),s.jsxs(ce,{onClick:e,className:"bg-[var(--action)] text-[var(--action-foreground)] hover:bg-[var(--action)]/90",children:[s.jsx(ds,{"aria-hidden":"true",className:"size-4"}),"New sandbox"]})]}):t}function NZ(){var v;const e=xZ(),t=Uv(),r=Er(),[a,l]=g.useState(uR),[c,u]=g.useState(cR),[f,h]=g.useState(0),[m,x]=g.useState(lR),p=e?void 0:()=>{b("sandboxes"),h(j=>j+1)};g.useEffect(()=>{const j=()=>{l(uR()),u(cR()),x(lR())};window.addEventListener("popstate",j),window.addEventListener("hashchange",j);const S=N=>b(N.detail.view,N.detail.location);return window.addEventListener("openrod-navigate",S),()=>{window.removeEventListener("popstate",j),window.removeEventListener("hashchange",j),window.removeEventListener("openrod-navigate",S)}},[]);function b(j,S=null){var C;if((C=t.signal)!=null&&C.aborted||!$v[j])return;l(j),x(S);const N=S?`?${new URLSearchParams({gateway:S.gateway,workspace:S.workspace,label:S.label,remote:S.remote?"1":"0",...S.target?{target:S.target}:{}})}`:"";window.history.pushState(null,"",j==="sandboxes"&&!S?window.location.pathname:`#${j}${N}`)}return c?s.jsxs(s.Fragment,{children:[s.jsx(g.Suspense,{fallback:null,children:s.jsx(Pa,{location:c.location,children:s.jsx(vZ,{name:c.name,session:c.session,setupLogin:c.setupLogin,mcp:c.mcp},`${r==null?void 0:r.target} ${((v=c.location)==null?void 0:v.context)??""} ${c.name} ${c.session??""}`)})}),s.jsx(aR,{position:"bottom-right"})]}):s.jsx(Uw,{children:s.jsxs(DX,{children:[s.jsx(HX,{view:a,onNavigate:b}),s.jsxs(IX,{className:"min-w-0 bg-background",children:[s.jsxs("header",{className:"flex h-14 shrink-0 items-center border-b border-border bg-card px-4 sm:px-6",children:[s.jsx(PX,{className:"mr-2 md:hidden"}),s.jsx("h1",{className:"text-[18px] font-semibold tracking-tight",children:$v[a]}),m&&s.jsx("span",{className:"ml-3",children:s.jsx(Co,{location:m})}),s.jsx(bZ,{})]}),s.jsx(HK,{}),s.jsx(eX,{}),s.jsx(wZ,{view:a,children:s.jsx(jZ,{location:m,children:s.jsxs(SZ,{onSetup:a==="sandboxes"||a==="templates"||a==="connections"?void 0:p,children:[a==="sandboxes"&&s.jsx(FW,{onNavigate:b,allowRemote:!e,createRequest:f,onCreateRequestHandled:()=>h(0)}),a==="activity"&&s.jsx(sQ,{}),a==="groups"&&s.jsx(mQ,{onNavigate:b}),(a==="egress"||a==="ingress")&&s.jsx(CQ,{tab:a,onNavigate:b}),a==="secrets"&&s.jsx(HQ,{}),a==="templates"&&s.jsx(JQ,{}),a==="setups"&&s.jsx(w3,{}),a==="connections"&&!e&&s.jsx(dZ,{onCreateSandbox:p})]})})},`${a}:${(m==null?void 0:m.target)??""}:${(m==null?void 0:m.context)??""}`)]}),s.jsx(aR,{position:"bottom-right"})]})})}tP.createRoot(document.getElementById("root")).render(s.jsx(Qe.StrictMode,{children:s.jsx(Fz,{attribute:"class",defaultTheme:"system",enableSystem:!0,storageKey:"openshell-theme",children:s.jsx(yZ,{children:s.jsx(NZ,{})})})}));export{ce as B,ko as C,Af as D,Co as L,YI as R,Wv as T,Cn as a,TZ as b,Of as c,qG as d,Mf as e,Gs as f,s as j,dy as p,g as r,TM as s,Bp as t,$t as u};
|